[Scummvm-cvs-logs] scummvm master -> 9d3a2c1c7f9365f65908f583e62047830f60693d

sev- sev at scummvm.org
Sun Jul 31 23:36:18 CEST 2016


This automated email contains information about 825 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
93c28c7970 TITANIC: Initial engine skeleton
021c47b0c1 TITANIC: Skeleton screen manager class
08be41ac52 TITANIC: Added skeleton CMainGameWindow class
ab28f87143 TITANIC: Beginnings of Image class
0874af38db TITANIC: Added Image::loadResource
bc7bc8ab34 TITANIC: Class stubs and beginnings of CSaveableObject hierarchy
43d3b138ca TITANIC: Further setup of List class
c9c85ee622 TITANIC: Adding screen initialization code
3f59b21c3b TITANIC: Implement SimpleFile class
84c24b0807 TITANIC: Beginnings of CompressedFile class
2753998868 TITANIC: Work on decompressor
1e4de9a323 TITANIC: Starting to create classes for project item hierarchy
7818eecaff TITANIC: Split SimpleFile and CompressedFile into different files
c4a0d4923a TITANIC: Implement lots of SimpleFile methods
9b173df32f TITANIC: Implement CSaveableObject saving methods
e2aca904ec TITANIC: Implement saving methods for List and ListItem
ad8450209a TITANIC: Implement overall game saving code
8c9a1c2159 TITANIC: Implementing CProjectItem::loadData
ed5ae8412d CREATE_PROJECT: Disable fluidsynth library by default for Visual Studio
f8c6724112 TITANIC: Fleshed out CompressedFile class
6bee18dec1 TITANIC: Implement bulk of overall decompression method
29215ff364 TITANIC: Change CompressedFile to use common/zlib.h
572fc8fc9e TITANIC: Implemented bulk of applicationStarting
063f8a97c8 TITANIC: Fixes for game startup
938316b7df TITANIC: Implementing CProjectItem loading
a0dbab62b9 TITANIC: Major fleshing out of game loading code
4126cf4fb0 TITANIC: Implemented CRoomItem class
03f387b2bc TITANIC: Added CMovieClip class
4fbcefba65 TITANIC: Fix loading of CRoomItem class
8acf716d65 TITANIC: Implemented CNodeItem class
25422a6520 TITANIC: Implement CGameObject loading, CServiceElevatorDoro and ancestors
45043cc6e1 TITANIC: Added CViewItem class
f509f3322b TITANIC: Implemented CLinkItem class
27f5f9e926 TITANIC: Fix loading CLinkItem
906aa791ee TITANIC: Implemented CAnnounce, CPETPosition, CSUBGlass
63db0980e5 TITANIC: Rename of sub-folders for better clarity
4bd8ae1166 TITANIC: Implemented CSuccUBus and ancestor classes
06ce0dbfdd TITANIC: Implement TrueTalk NPC classes
f2cb4a6d98 TITANIC: Implement non-TrueTalk character classes
5c77a55328 TITANIC: Implemented CBackground class
83ad770f49 TITANIC: Implement CMovePlayerTo class hierarchy
ba8cbcb229 TITANIC: Renames messages sub-folder to moves
db4dfcebeb TITANIC: Renames messages sub-folder to moves
c5847f5b80 TITANIC: Start of new messages sub-folder
b08d0dd130 TITANIC: Added CTurnOnPlaySound and CTurnOnObject
16bcc6beba TITANIC: Implemented CCallBot
b361f2bf14 TITANIC: Implemented CAutoMusicPlayer and CSeasonalMusicPlayer
1a98b49f60 TITANIC: Implement CSummonBots and CRobotController
859c30a4e1 TITANIC: Implemented CTelevision
34ffd06c78 TITANIC: Implemented CSTButton class and descendents
b7cd6be9eb TITANIC: Implemented CToggleSwitch and descendents
bc3e044008 TITANIC: Implemented CStartAction and CHammerDispensorButton
405c1d9733 TITANIC: Implemented CDeadArea
03f842f8eb TITANIC: Implement computer and CDROM classes
b93f4e7077 TITANIC: Added CCarry and descendent classes
dd5fdcd8d9 TITANIC: Fix CCarry loading/saving
9364b27917 TITANIC: Implemented state room classes
def2a92ebf TITANIC: Add event class definitions
9080781b08 TITANIC: Add mouse events, cleanup of existing events
9cb1390c26 TITANIC: Implemented CClickResponder and descendents
6cb2a5e81f TITANIC: Added CCredits
decec97c4b TITANIC: Implement various parrot classes
fa015808ac TITANIC: Implement bowl and ear classes
0471a25575 TITANIC: Implement light switch and buttons
6eb777fe36 TITANIC: Added a lot of class definitions
95ebd2394b TITANIC: Loading bugfixes and implemented CBrain descendents
a89dd72f20 TITANIC: Implemented lots of CBackground descendent classes
5dd3798ebf TITANIC: Added a bunch of classes, loading method fixes
32d84ed33d TITANIC: Added lots more miscellaneous classes
9ce8e1130c TITANIC: Lots more miscellaneous classes
f7e057e4d7 TITANIC: Added more miscellaneous classes
700b77e1ea TITANIC: Added more miscellaneous classes
96825e2823 TITANIC: More saveable classes implemented
5dce31417c TITANIC: More saveable classes implemented
3ae4e63c80 TITANIC: Implemented more saveable classes
e688850e93 TITANIC: Implemented more saveable classes
d07fbeb255 TITANIC: Beginnings of CPetControl support classes
61518fb208 TITANIC: Move CPetControl and direct support classes to new folder
e03a110662 TITANIC: Fleshing out CPetControl support classes
5bdb873c47 TITANIC: gcc compilation fixes
7e966dbc5e TITANIC: gcc compilation fixes
03d3d5b539 TITANIC: Implemented remaining CPetControl classes loading
f01bd1be9f TITANIC: Create stubs for CStarControl support classes
20725a0eda TITANIC: Further work on CStarControl support classes and loading
ac930083ac TITANIC: Fixes for CStarControl loading
f423d4d41a TITANIC: Add missing CMailMan to saveable object list
7375394b81 TITANIC: Converting saveable objects hierarchy to have type data
dd5c119f32 TITANIC: gcc compilation fixes
2395e5601c TITANIC: Further gcc compilation fixes
fbcd4de457 TITANIC: Overall message handling method
3103c9aaa9 TITANIC: Implemented message target classes
0645a3dbde TITANIC: Fix crash when compressed newgame.st file was closed
d1a29a1d1a TITANIC: Moved CompressedFile class into simple_file.h
eff4ed1ac1 TITANIC: Fleshing out CProjectItem methods
34ade1f8cb TITANIC: Add const suffix to many tree item methods
8a404e62aa TITANIC: Implemented CTreeItem::findByName
71c3129ecf TITANIC: Added skeletons for game manager support classes
759c0e3b45 TITANIC: More game manager setup
0fead6fe56 TITANIC: Beginnings of game manager data loading
e68e8334ed TITANIC: Beginnings of True Talk scripts hierarchy
c0de794584 TITANIC: Added stubs for the different script classes
60e137c651 TITANIC: Implemented true talk manager & script loading
c269c770ac TITANIC: Implemented sound manager loading
bad72e2ae4 TITANIC: Implement various post-load methods
c6b07dcdd7 TITANIC: Added CGameObjectDescItem class
f0d992d854 TITANIC: Implemented setMode method for game state
c92bf22f03 TITANIC: Changed CGameStateSub to CGameLocation, properly implemented it
819b773491 TITANIC: Add message generation at end of applicationStarting
b57805bd4b TITANIC: Added main game event loop
0cc014d06b TITANIC: Implemented dumping of the project hierarchy
75286e8321 TITANIC: Fix loading project data
bc1585ccee TITANIC: Change some script method return types
041c6475d6 TITANIC: Fleshed out DirectDrawSurface creation
3c29a10130 TITANIC: Further graphics setup, beginnings of files manager
6a26539abb TITANIC: Fleshing out resource key and view loading
eaead0c6ae TITANIC: Starting to implement game view loading
8ec499c177 TITANIC: Implementing setActiveView, surface clearing
6be64df2f0 TITANIC: Implemented overall surface loading method
c78e2fefd9 TITANIC: Implement surface lock and unlocking
b5d64f9c20 TITANIC: Renames/fixes for OSVideoSurface methods
103f3b524e TITANIC: Implemented surface resizing and freeing
c1f2912fc4 TITANIC: Implemented surface shiftColors
5a3aa81ab6 TITANIC: Implemented CStdCWADFile class
8a1d238fd5 TITANIC: Implemented the CJPEGDecode and CTargaDecode classes
e80a151706 TITANIC: Fix image decoders
a8d94d448e TITANIC: Fixes to make message handling const, adding CEnterRoomMsg handlers
12ae5e10f3 TITANIC: Added stubbed CEnterRoomMsg event handlers as needed
13a8e5f822 TITANIC: Implement debugger with dump and room commands
39a4db06fa TITANIC: Add room number to debugger rooms listing
04b8c75a93 TITANIC: Add stubs for CEnterNodeMsg message handlers
ea585b0aa5 TITANIC: Add some CEnterViewMsg stubs
8b9f3dc0b8 TITANIC: Fleshing out CLinkItem class
61947ef56b TITANIC: Create Event manager class
9565fbaeac TITANIC: Implement input translator event methods
7a38b51357 TITANIC: Implemented drag/drop handling
4f5202f958 TITANIC: Remove const prefix from passed messages
c864deee1c TITANIC: Implement more events in CInputTranslator
abb9a549c8 TITANIC: Enable event handlng
3a42c8ca44 TITANIC: Added various preLoad methods
2665e0e08f TITANIC: Added various preSave and postSave methods
abb5e0a5c1 TITANIC: Added CGameManager::viewChange
f1d674c745 TITANIC: Implemented CViewItem::viewChange
d86941f8c6 TITANIC: Implement preEnterView and enterView
4704d72d6a TITANIC: Implementing view item message handling
46d5af527d TITANIC: Finished CViewItem::mouseChange
dbd8ab0f1c TITANIC: Implement view change logic
c6b239bdac TITANIC: Implemented CGameManager::update
8b5ad45f4a TITANIC: Minor fixes executing game manager update
ea54e6244e TITANIC: Fixes/renames for files manager
3c852cc240 Merge branch 'master' into titanic
6ebb0312ff TITANIC: Refactor out DirectDrawSurface to it's own class
fbc46ed5b4 TITANIC: Starting on frame rendering
9a66bc2e9e TITANIC: More graphics code, clipBounds method
217360d0c5 TITANIC: Add new derived Rect and Point classes
1e6a320010 TITANIC: Implementing view draw code
6a118677ed TITANIC: Fix initialization of screen manager surfaces
b7746eff42 TITANIC: Implement method for rendering view contents
5cec3b3bd8 TITANIC: Implement object image loading and drawing
46e554b981 GRAPHICS: Set parameterless Screen constructor to use screen format
06bd62fed4 TITANIC: First scene starting to be displayed
bfcf006bbb TITANIC: Fixes for correct positioning of view background
42208769f7 TITANIC: Enable drawing of view contents
7d2d624908 TITANIC: More view event handling, beginnings of mouse cursor loading
2f532c086d TITANIC: Unsuccessful initial attempt to load ycursors.avi file
66e198d665 TITANIC: Cleanup and fixes for message hierarchy
d9cc2908f8 TITANIC: Make all use of message targets public inheritance
83c6ebb466 TITANIC: Fix view message handling
71c0ad236e TITANIC: Implement CGameObject::stopMovie
bbc810e909 TITANIC: Fix crash when looking at television
fd78a874cc TITANIC: Added current location display to debugger room command
c948e8812e TITANIC: Support methods needed by CTelevision
f0a6cf38cf TITANIC: Implement television CLeaveViewMsg handler
02b46202be TITANIC: Implementing more CTelevision message handlers
0b37ac1869 TITANIC: Implementing more CTelevision message handlers
7320498409 TITANIC: Implementing more CTelevision code, CGameState movie list
448cc158c7 TITANIC: Fleshed out CStartAction class
447eb31a6c TITANIC: Fleshed out CDeadArea class
471737a41a TITANIC: Implemented CCDROM and various support stuff
d810e626ae TITANIC: Implemented CGameObject::checkPoint
d183a7b4f9 TITANIC: Fix initial loading of game object images
f64657b44d TITANIC: Fix handling of transparency
8bb9679be0 TITANIC: Renaming for PET inventory section
8a45f47c2e TITANIC: More renamings of PET sections
e0602c4851 TITANIC: More PET renaming, implemented setArea
a1e959b498 TITANIC: Fix PET post-loading
fe79317bde TITANIC: Beginnings of PET drawing
fee937c6ef TITANIC: Debugger command to turn PET on or off
08a801b112 TITANIC: Flesh out the CPETElement class
348b2d4b4b TITANIC: Fleshing out CPetVal
948fb5bcca TITANIC: Implement CPetVal drawing
c33bdcc09f TITANIC: Fleshing out CPetFrame
39ef1e3edb TITANIC: Renamed CPetVal to CPetGraphic
6d852165e9 Merge branch 'titanic' of https://github.com/dreammaster/scummvm into titanic
6a1b452e16 TITANIC: Work on implementing CDROM Tray class
5c902685fc TITANIC: Rename CPetGraphic to CPetGfxElement to avoid naming clash
d94b1dc7bb TITANIC: Implemented CPetGfxElement setup method
24a2fc7e85 TITANIC: Implement CPetFrame setup and drawing code
3149cd1a34 TITANIC: Implement CTreeItem::getHiddenRoom
7d819f71f7 TITANIC: PET frame is now showing
5923ee5001 TITANIC: Implement CPetFrame::setArea
18fabbb2d4 TITANIC: Beginnings of PET event handling code
43f183c207 TITANIC: Implement keyboard event handling
883e198eb3 TITANIC: Implement PET CMouseButtonDownMsg handling
9affb67a3c TITANIC: Implement PET message handlers
52905fdea9 TITANIC: Simplify the area switches used in PET control methods
08e8f105dc TITANIC: Implement CPetFrame event handling
3f3f4d910d TITANIC: Moved gfx/ pet classes into pet_control/
845e25d118 TITANIC: Added item strings
2c16d68f45 TITANIC: Simplified item strings setup
7ef899f18d TITANIC: Implementing CPetInventory setup
1b8ffff10e TITANIC: Implement overall PET inventory draw method
5795ec0c97 TITANIC: Implemented ScreenManager fillRect
32f7fcc7a0 TITANIC: Further work on CPetControlSub12 drawing
4321532743 TITANIC: Working on font loading
1efbed5409 TITANIC: Move most of the root classes into new support/ folder
2699efd633 TITANIC: Fix reading resources from game executable
ebdc773247 TITANIC: Implement font loading
56b2998744 TITANIC: Further work on STFont character drawing
3acf1116cd TITANIC: Implemented STFont::copyRect
572301a33e TITANIC: Implement OSVideoSurface::setupMap
303f577c4f TITANIC: Hacked copy of AVIDecoder to handle ycursors.avi
f65849084c TITANIC: Fix display of initial cursor
6f8de06ddb TITANIC: Fix loading of ycursors.avi video that contains mouse cursors
4f46928444 TITANIC: Fix loading of game object bounds
4e3ae0cf56 TITANIC: Fix setting cursor when highlighting object
19e4bca41c TITANIC: Set up cursors enum with better names
cb2dc0c8c8 TITANIC: Implementing CSTButton
08ed54f6c9 TITANIC: Beginnings of CProximity class
71a278791a TITANIC: Fix setting of buttons in mouse messages
ac59f58c8a TITANIC: Implement CBackground message handlers
e728e901d0 TITANIC: Fix for showing link cursors in some screens
51df4d98d3 TITANIC: In-progress converting message handling to be more like original
51dc36a9a5 TITANIC: Furhter in-progress message handling conversion
826dcf1f42 TITANIC: Fix class hierarchy in ClassDef structures
bc7a7deb77 TITANIC: Fix showing custom cursors when highlighting objects
cdfd9f3703 TITANIC: Fix message map for CTelevision
31934ac4ba TITANIC: Fleshed out CCDROMTray class
6fd32e6dc1 TITANIC: Minor change to Cursor enum
41c08d186a TITANIC: Implement CDeadArea messages
9f1bab5597 TITANIC: Converting other message stubs to new format
e7f2cb1ecb TITANIC: Add CComputer messages, more view change logic
b27d57c25b TITANIC: Implemented CCDROMComputer
c5b73db7b9 TITANIC: Implement onIdle method for regular game updates
63e2a01ecf TITANIC: Rename field in CGameState
e3d02532f7 TITANIC: Implementing preliminary video playback code
09a3ca0728 TITANIC: Implement movie loading
3d166fb8a9 TITANIC: More implementation code for movie playback
6405ba6ecb TITANIC: Starting to flesh out timers
f7748622fa TITANIC: Further implementation of timers
c8eb5a7734 TITANIC: Fix setting object bounds when drawing
d5e346681f TITANIC: Fix deleting movies
c9f322887c TITANIC: Fix CGameObject::changeStatus
c96164dde0 TITANIC: Cleanup of CSTButton
78d03f9784 TITANIC: Television video is now playing
62b087adce TITANIC: Fleshing out CTelevision::MovieEndMsg
1ee3f334d3 TITANIC: Change back to using original AVIDecoder
9db15f6967 TITANIC: Allow television video to play multiple times
8e5f7a9453 TITANIC: Fix stopping movies
91336a8611 TITANIC: Implement playing a range of frames within movie
cf785a19e3 TITANIC: Implement drag&drop dropping
ad6ea25c99 TITANIC: Added CCarry message handler stubs
7e1f802abd TITANIC: CCarry drag & move msg handlers
54b055bcf5 TITANIC: Implementing CCarry drag end handler
7ac4f7c3aa TITANIC: Implementing CComputerScreen messages
36d60d7476 TITANIC: Added remainder of CCarry msg handlers
c096bfa5d8 TITANIC: Implementing CArm message handlers
5cd3dd0d69 TITANIC: Adding CCarry descendent msg handlers
fdbb1868e4 TITANIC: Implemented CPhonographCylinder msg handlers
18a38c84e9 TITANIC: Implementing CCarry classes msg handlers
57d75d19cf TITANIC: Add CMagazine msg handler stubs
a6d03a15c9 TITANIC: More CMagazine message handlers
a5e9052635 TITANIC: More CArm message handlers
1babcc10cf TITANIC: Implemented PET methods for iterating sub-objects
f77a8a63cd TITANIC: Implemented CGameObject::find
7ddd5d1a8b TITANIC: Finished CArm msg handlers, stubs for adding to inventory
2dcda26eb1 TITANIC: Implement CBridgePiece message handlers
95c885f877 TITANIC: Implementing CCarryParrot msg handlers
bc716fda4b TITANIC: Implemented CCarryParrot msg handlers and support methods
ee2a70f466 TITANIC: Implemented CChicken message handlers
6a4e7c3d73 TITANIC: Implement CCrushedTV message handlers
fb5565679b TITANIC: Added CFeathers message map
daaa458d64 TITANIC: Restructuring PET list classes, beginning of inventory
066dd4f5cd TITANIC: Implementing PET inventory population
d971edf02e TITANIC: Stubs for selecting highlighted PET glyph
22248ccbf2 TITANIC: Implement glyphs drawing
a11e677494 TITANIC: Added item debugger command
46a30255b0 TITANIC: Seperate PET classes setup and reset methods
11cde7b413 TITANIC: Implement CPetGlyphs setup
fc33bc4182 TITANIC: Fix showing PET immediately when turned on via debugger
ca68e85f37 TITANIC: Fix to partially display PET inventory
b6e093d668 TITANIC: Fix drawing glyph squares in PET inventory tab
4562879450 TITANIC: Fix highlighting selected PET area button
5316951ba6 TITANIC: Fix item debugger command to immediately show PET inventory
4702411594 TITANIC: Further cleanup of pet element setups
42206332d0 TITANIC: Adding new class stubs for PET Real Life btns & elements
225af47088 TITANIC: Beginnings of PET RealLife Quit button
79c10ee30a TITANIC: Rename CPetControlSub12 to CPetText
9317035ab7 TITANIC: Fix accidental rename in Makefile
c74b975081 TITANIC: Implement CPetSection data table methods
5e16f0b6b3 TITANIC: Implement CPetQuit reset method
a6e76530b2 TITANIC: Implement RealLife tab setup
a8f8e4b69e TITANIC: Clarified UI color methods & tables
b398a5001b TITANIC: Implementing CPetLoad and CPetSave
282ed45c77 TITANIC: Beginnings of CPetSound
e4bc0b2601 TITANIC: Fix horizontal placement of PET glyphs
48e9387f2d TITANIC: Fix placement of PET glyphs scroll buttons
a719b0585f TITANIC: Beginnings of slider logic
4915f8900a TITANIC: Implement more slider functions
f79ebfa3e2 TITANIC: Added PET Sound tab setup
990f7b87c1 TITANIC: Sort out PET enter and leave methods
58e1a807f3 TITANIC: Clean up on element highlighting
631d979fb3 TITANIC: Fix mouse presses on PET glyphs
d11a95068c TITANIC: Standardizing PET mouse button methods, quit is now working
fc3f2952b0 TITANIC: Define Glyph flags enum
a8d4e827d2 TITANIC: Correct coordinates in CPetQuit setup
f6f68e547d TITANIC: Implement changing sound slider percentages
2b1e045b5c TITANIC: Implemented remainder of CPetSound methods
730895a9ea TITANIC: Cleaning up CPetLoad & CPetSave methods
73258800cf TITANIC: Beginnings of CPetRooms
4180e85bc0 TITANIC: Beginnings of PET Rooms glyph
af06188bae TITANIC: Implementing CPetRooms methods
a88c0b0999 TITANIC: Starting to flesh out CPetText drawing
c75de59a28 TITANIC: Implementing font text bounds calculations
36faf0890f TITANIC: Minor work towards text display
1512545f28 TITANIC: Resolve color handling code in CPetText
02bb9510aa TITANIC: Implemented CPetConversations setup
b114c768cd TITANIC: Adding more CPetText support methods
34c32e38e2 TITANIC: More font logic, beginnings of text cursor
d6b104d5a3 TITANIC: Further work on CTextCursor fields
a2f933a80e TITANIC: Minor fleshing out on font drawing
74e40be66e TITANIC: Implementing text cursor drawing
2675580208 TITANIC: Fix crashes in PET and text cursor
a8835043f5 TITANIC: PET Text is now partially showing
e4b231b39d TITANIC: Fix vertical drawing of text
001a2ac15e TITANIC: Implement surface changePixel method
75fdd1504d TITANIC: Call method to initialize OSVideoSurface _map array
6f001d8316 Merge branch 'master' into titanic
e778ac8bcd TITANIC: FIx confusion between mouse down & up messages in CPETElement hierarchy
b324d2ea6c TITANIC: FIx confusion between mouse down & up messages in CPetGlyph hierarchy
b7ad513b0f TITANIC: Implement PET Text scrolling
de73296196 TITANIC: Implement PET Text scrollToBottom, beginnings of addLine
ff72fc594b TITANIC: Implement PET Conversations mouse up, and text addLine
4fd482e418 TITANIC: Implement checks for whether NPCs can be summoned
23f5691b97 TITANIC: Implement summoning NPCs
487f2cef0f TITANIC: Handle Conversations double click, PET Text key handling
b117bae55a TITANIC: Implemented conversations text input entry
6fa57389a2 TITANIC: Finished PET Conversations input line processing
5d087a8fcd TITANIC: Implement PET Conversations & Text saving
6ec129d188 TITANIC: Added PET Conversations enter, PET Timers, and Text Cursor show
d6b84cd9e1 TITANIC: Added PET Conversations leave and Text Cursor hide
e47494a489 TITANIC: Implement TrueTalk script retrieval
7af7838b86 TITANIC: Implement PET Conversations displayNPC
6de4295cc3 TITANIC: Identifiied Pet Section showCursor & hideCursor methods
44d95d8e51 TITANIC: Simplify video surface shading palette
9205f22a43 TITANIC: Fix generation of shading palettes
e55f634686 TITANIC: Fix palette usage in changePixel
210468fae9 TITANIC: Minor palette cleanup, remove border from PET Quit view text
287a9f6ef2 TITANIC: Implement display of tooltips in RealLife
01989265aa TITANIC: PET Conversations now partly rendering
b11033800d TITANIC: Implementing PET support widgets
d46d3f7b0d TITANIC: Implementing more PET support widgets
b013d10d8f TITANIC: Implementing PET Nav Helmet section
ecb14e9bc2 TITANIC: Implement more NavHelmet section
a15e299a06 TITANIC: Implement messages PET section
65dbc2a265 TITANIC: Resolve Pet Text fontNumber fields, getting npc nums
2fb6923211 TITANIC: Implement PET Text color remapping
2a107eb540 TITANIC: Simplify PET Element getBounds methods
6691dfa408 TITANIC: Implement PET Conversations dial logic
9d8208bd46 TITANIC: Miscellaneous PET Conversations methods
ce2a9c6f1b TITANIC: Minor fleshing out of PET Conversations and Inventory
ad02fa76e0 TITANIC: Implement PET Rooms glyphs saving logic
6b97394ebd TITANIC: Fully implement PET Rooms loading/saving
21f98fff46 TITANIC: Fix cursor and entering text in PET Conversations area
f01b8e9c45 TITANIC: Fix multi-line text writing
6c2949ba23 TITANIC: Fix PET Conversations scroll buttons
93f88cc668 TITANIC: Fix PET Conversations doorbot/bellbot icons
8a6a5ad5c1 TITANIC: In progress implementation of PET Remote
c3dadcfe3b TITANIC: Beginnings of PET Remote glyph classes
efaa86bee4 TITANIC: Implement Television Control glyph
947d9e344c TITANIC: Implement toggle remote glyph base class
9a6ad7d1e0 TITANIC: Implemented remote entertainment device glyph
ab769eee0c TITANIC: Implement Operate Lights glyph
00cb975f15 TITANIC: Implement Deploy Floral Enhancement glyph
82a1f6f0aa TITANIC: Implement Deploy Relaxation Device glyph
dd9a4f4b5b TITANIC: Implement Deploy Comfort Device glyph
8551f08d0d TITANIC: Implemented more PET Remote glyph classes
6166c33734 TITANIC: Implemented more PET Remote glyph classes
77feb9d8c8 TITANIC: Implement remaining PET Remote glyphs
9ca8e2a928 TITANIC: Implement CMovieClip methods
4963c9f50b TITANIC: Implement CMovieEvent & CMovieRangeInfo
b79ed60a8e TITANIC: Added loadSound, support methods, and CSoundItem class
6948a44ac4 TITANIC: Implemented stopSound
f5a82bae97 TITANIC: Implemented sound & true talk call methods in CGameObject
07cbf78fe1 TITANIC: Implemented CTrueTalkManager getNpcScript
308926ba87 TITANIC: Implementing getting TrueTalk room scripts
f75b467925 TITANIC: Finished CRoomItem getScriptId
d712875c02 TITANIC: Renamed TT unnamed script classes to room scripts
d463be89fa TITANIC: Finished CComputerScreen TimerMsg
b1290d6dd9 TITANIC: Cleanup & renames for starting conversations
03a8cbaf98 TITANIC: Implemented TT manager loadAssets, beginnings of CDialogueFile
ab86c09a2f TITANIC: Beginnings of STtitleEngine class
4d22064997 TITANIC: Beginnings of script handler
2a2eaebdc2 TITANIC: Implemented CCharacter message handlers
8229947402 TITANIC: In progress message handlers for CTrueTalkNPC
7396781cd4 TITANIC: Implemented more CTrueTalkNPC message handlers
1e42f6ffed TITANIC: Beginnings of input line processing
b138134192 TITANIC: Finished CTrueTalkManager start method
695549585e TITANIC: Implemented CDialogueFile addToCache
0900217303 TITANIC: Implement CDialogueFile read
0692d261ee TITANIC: Implement reading dialogue string
339df8657e TITANIC: Implement CTrueTalkManager triggerNPC
b480a2f53e TITANIC: Implementing TTTalker
babdf0aa03 TITANIC: Setting up of title engine and title script
e85b171db8 TITANIC: Adding CTrueTalkManager support methods
0cbd9f5063 TITANIC: Changing TTNamed* classes to TTNpc*
bac4ced73d TITANIC: Further renaming of named scripts to npc scripts
f706ef3749 TITANIC: Fleshing out room item and PetText loading code
74935b371f TITANIC: Implementing scriptChanged methods
c4375b134a TITANIC: Beginnings of STVocab class, CScriptHandler constructor
71179e3763 TITANIC: More script handler setup
9ce6391a94 TITANIC: Beginnings of TTWord hierarchy
bb8f95ba9d TITANIC: Implementing vocab load
88dcfebebc TITANIC: Implementing vocab word loading
b7e4ed8744 TITANIC: Further fleshing out of vocab loading
45f84a9da5 TITANIC: Fix script handler initialization
3822d46341 TITANIC: FIx initializing file reader to read EXE resources
b99fa6ba8c TITANIC: Fix to SimpleFile scanf
0820c3ffae TITANIC: Refactor CTitleEngine to use CFilesManager for PE resources
5bb05084fd TITANIC: Fixes for TTString constructors
0f96471077 TITANIC: Add copy operators for TTString
a223309934 TITANIC: Changed casing on TTword classes to exactly match original
3a464e8770 TITANIC: Added new TTstringNode and TTsynonymNode classes
33ef893b04 TITANIC: Implemented vocab findWord
1045fda846 TITANIC: Variation TTstringNode initialize method
fa626a8bc9 TITANIC: Implemented TTsynonymNode copy
e86ce94441 TITANIC: Implement TTword scanCopy
b8c4105021 TITANIC: Implemented STVocab addWord
b8a7a98c54 TITANIC: Bugfixes for vocab loading
17de345191 TITANIC: Fix conditional checks in TTword classes load methods
a27d49a43c TITANIC: Fix finding existing words in STVocab findWord
9c8d4f234b TITANIC: Split TTsynonymNode into it's own file, and rename to TTsynonym
96a11a08bd TITANIC: Fix loading TTword3 vocab
01320c06cb TITANIC: Vocab list is now completely loading
7700923298 TITANIC: Change CFileReader to CExeResoucres
2f2397f7df TITANIC: Added STVocab destructor
4410c75599 TITANIC: Rename STVocab to TTvocab to match original
7b71462046 TITANIC: Implementing virtual methods for TTword
ae5cd8d8dd TITANIC: Fix TTstringNode pointers to TTsynonym
06876335cd TITANIC: Implement TTword copy
e8971dd106 TITANIC: Rename CScriptHandlerSub2 to TTparser
d649157c5b TITANIC: Figured out original class names for TTword descendents
f114ca6c26 TITANIC: More TTword subclass constructors
2f9d7f2284 TITANIC: Added TTword subclass copy methods
eb94894688 TITANIC: Implement TTword hierarchy virtual methods
e5e0e22c56 TITANIC: Beginnings of TTinput class
e862d80cd2 TITANIC: Beginning of parser input line normalization
68e230182c TITANIC: Implement TTparser normalize
1da409ca98 TITANIC: Rename stub method to normalizeContraction
69134c66cc TITANIC: Implemented parser normalizeContraction
76b61324de TITANIC: Renaming for normalized input line
2680caa5bd DEVTOOLS: Creation of titanic.dat for holding static data
053ff7ab75 TITANIC: Change engine to use titanic.dat
b37da849c9 TITANIC: Implement TTparser searchAndReplace methods
e1ba967233 TITANIC: Moved other static arrays from Titanic engine to dat file
e16239e21f TITANIC: Implemented parser replaceNumbers sub-methods
3878f38d8c TITANIC: Move replacement string arrays into TTparser, added NUMBERS array
361ac2cfe4 TITANIC: Implemented secondary replaceNumbers method
a7c1b2fc6b TITANIC: Finished TTparser processInput
39b85d845b TITANIC: Changed parser & script processInput methods to preprocess
aead3a0083 TITANIC: Beginnings of TThist class
5da19b674d TITANIC: Changed TTinput to TTsentence to match original
5b42ae357e TITANIC: Refactor TTstringNode to have a base TTnode class
c762308bff TITANIC: Implement TTsentence copy
89caddc217 TITANIC: Beginning of TTparser findFrames
cca38c15e5 TITANIC: Implemented TTstring tokenize
d4c6538726 TITANIC: Work on TTparser findFrames
defd50c926 TITANIC: Added support methods for finding synonyms by name
2b9fcd2cda TITANIC: Finished TTvocab getPrimeWord
f7b8a87065 TITANIC: Added TTstring deletePrefix
6fdaa608f1 TITANIC: Start on vocab method for finding words with prefixes
72add4230f TITANIC: Finished TTvocab getPrefixedWord
fc05032fed TITANIC: Finished TTvocab getWord
6fa65bbf0a TITANIC: Add proper destruction of node chains
c858190c54 TITANIC: Beginnings of TTvocab getSuffixedWord
54669e7b7e TITANIC: Added an enum for TTword wordMode
c4084e731b TITANIC: Implemented TTvocab getSuffixedWord
bb459dd5a8 TITANIC: Changed setSynStr parameter type
378c96736a TITANIC: Fields renaming
4d3ca910b7 TITANIC: Added TTnode methods
2d83f5b131 TITANIC: Starting TTparser loadRequests
1e35288fee TITANIC: Change TTnode addNode to addToTail
49c9060bec TITANIC: More implementation of TTparser loadRequests
dacfbe6a0e TITANIC: Beginnings of TTconcept class
886b710484 TITANIC: Implemented TTparser checkReferent
8668b37ef5 TITANIC: Finished TTparser loadRequests
87201eed1f TITANIC: Added TTparser addToConceptList
39a12288bb TITANIC: Start of considerRequests
59796e03e4 TITANIC: Change WordMode to WordClass and flesh it out
006c98cfa4 TITANIC: Added ParserAction enum
46bb597ba2 TITANIC: New TTconcept constructor
6d2f65c97f TITANIC: New TTconcept constructor and copy methods
82614fedf3 TITANIC: Making TTword constructors and copy methods const
b862f95fe1 TITANIC: Added concept pointers to CScriptHandler
bcfebf8f0f TITANIC: Added TTconcept destructor
1ffb8ff92b TITANIC: Added TTconcept deleteSiblings
8c99ff510c TITANIC: Added TTconcept copyFrom method
6ab35972e8 TITANIC: Implement TTconcept getText
c3055aeaf0 TITANIC: Added TTconcept setOwner
76c84afdfe TITANIC: Added TTconcept find methods
73e2e8f429 TITANIC: Added TTconcept id methods
938ec867fe TITANIC: Added TTword isClass method
d537a25bd7 TITANIC: Added TTsentenceSubBase setHandlerConcept
2b6a6cffc0 TITANIC: Implemented TTsentecneSubBase changeConcept
ae9a04bd41 TITANIC: Refactored TTsentenceSubBase to TTconceptNode
06b9131a6c TITANIC: Added TTconcept copy constructor
483929e70a TITANIC: Added various TTparser & TTconcept support methods
5576060aef TITANIC: Added TTparser filterConcepts
27417fa78d TITANIC: Added TTparser resetConcept
986ab4b0d1 TITANIC: Added TTsentence fn2 method
1992afe4aa TITANIC: Added TTconceptNode createConcept
f98ad33134 TITANIC: In-progress TTparser checkForAction
35f1839063 TITANIC: More work on TTparser considerRequests
63439a1c94 TITANIC: Finished TTparser checkForAction
1fff06e97a TITANIC: Added TTparser processRequests
409271778e TITANIC: Added TTparser removeNode
de1bb1e95c TITANIC: In-progress TTparser processModifiers
5ffe93ad9b TITANIC: Finished TTparser processModifiers
8a31189121 TITANIC: Adding more to TTparser considerRequests, and support methods
23cd7fd299 TITANIC: Fleshing out TTparser considerRequests
079a734831 TITANIC: Fleshing out TTparser considerRequests
eaab1605e0 TITANIC: Finished inner switch of TTparser considerRequests
ef186e1a2e TITANIC: Convert outer tag comparisons to switch cases in TTparser considerRequests
a261041be7 TITANIC: Adding tag switches to TTparser considerRequests
fb6e94e8bb TITANIC: Remaining tag switch cases in TTparser considerRequests
15843eb4c2 TITANIC: Remainder of TTparser considerRequests
fa04a6fdf0 TITANIC: Added CTrueTalkManager playSpeech
66a2500928 TITANIC: Added CTurnOnObject message handlers
1f4eca3d06 TITANIC: Message handler stubs for CDeskbot
a7ecc6d601 TITANIC: Adding CDeskbot message handlers
421812f27c TITANIC: More implementing deskbot message handlers
063fd5c26a TITANIC: Reorganising methods to class they are in the original
703bb288c1 TITANIC: Finished Deskbot message handlers
d0301bce6f TITANIC: Move unknown method from TTword to TTadj
b9ad4ff727 TITANIC: Fix dispatching messages by target name
2f4cf6a26a TITANIC: Beginnings of TTresponse class
4ee0ced047 TITANIC: Fleshing out TTscriptBase class
9f6a3d36f7 TITANIC: Further fleshing out of TTscriptBase
07c1b2b23d TITANIC: Fleshing out of CTrueTalkManager class
3ad600439b TITANIC: Added TTnpcScript getValue
d84fb55a24 TITANIC: Adding TTnpcScript dialogue Id handling
ef3bd4e286 DEVTOOLS: Adding Deskbot tags list
cf0051caf7 DEVTOOLS: Completed tags list for Deskbot
ec33749157 DEVTOOLS: Add Bellbot script responses to create_titanic
f51a428f8b DEVTOOLS: Fixes to Deskbot responses in create_titanic
ba5e13d479 TITANIC: Set up loading of deskbot & bellbot script response lists
451ab9d452 TITANIC: Load response data for remaining NPC scripts
58c8833d82 TITANIC: Implementing npc scripts chooseResponse methods
01020dcd8c TITANIC: Renaming script methods
4ab3b4d209 TITANIC: Further npc scripts chooseResponse methods
e2d3a0a32f TITANIC: Adding setDial method
b1ae3f44db TITANIC: More script dial methods
95dc0bc4cc TITANIC: Finished BarbotScript chooseResponse
6075a8fe49 TITANIC: Implement TTnpcScript selectResponse
928f9a8974 TITANIC: Remove redundant CScriptHandlerSub class
62c699fa3c TITANIC: New TTsentenceEntries class for holding sentence res data
6eb562a17a TITANIC: Beginnings of script handler processSentence
3196e488f1 TITANIC: Finished TTnpcScript processSentence
f02efd2d9e TITANIC: Beginnings of TTquotes class
4e766db41c TITANIC: Implemented TTnpcScript loadQuotes
b3bcf1cc4e TITANIC: Finished TTquotes load
e9c239797d TITANIC: Implement TTquotes read
ebb6028871 TITANIC: gcc compilation fixes
66efdc239c TITANIC: gcc compilation fixes
02b3526e29 TITANIC: gcc compilation fixes
764cfcb6d6 TITANIC: gcc compilation fixes
6c4eff4dfc TITANIC: Fix loading of JRQUOTES
253cf2f574 TITANIC: Fix startup crash when creating NPC scripts
51226842c8 TITANIC: Start of new TTvocabTree class; added load method
bfe075d314 TITANIC: Further fleshing out of TTquotes and TTquotesTree
289856dce3 TITANIC: Finished TTquotesTree search methods
9d92a5a6a4 TITANIC: Fleshing out usage of TTscriptArrayItem in TTnpcScript
a051735682 TITANIC: Added TTnpcScript getRangeValue
b76a6e2fb4 TITANIC: Added TTnpcScript setupDials
6792fd92b7 TITANIC: Renamings for script setupRanges
59c033e68f DEVTOOLS: Start of script ranges addition to create_titanic
c660bbf141 TITANIC: Beginnings of loading NPC range data
9a35125d65 TITANIC: Added Deskbot ranges to create_titanic
16797bd75f TITANIC: Add loading of Deskbot ranges
565940d27c DEVTOOLS: Added Doorbot ranges to create_titanic
0825f00bcc DEVTOOLS: Added Liftbot ranges to create_titanic
96f700a205 DEVTOOLS: Added MaitreD ranges to create_titanic
448b59c099 DEVTOOLS: Added Parrot ranges to create_titanic
31f8f1fbaf DEVTOOLS: Added SuccUBus ranges to create_titanic
e9c3d180cd DEVTOOLS: Fixes for range data generation in create_titanic
02cd4557a4 TITANIC: Remove unneeded NPC setupRanges methods
074dbb8c1a DEVTOOLS: Add NPC sentence entry data to create_titanic
041ce7f4ef DEVTOOLS: Add NPC Id mapping tables to create_titanic
cf79431c72 DEVTOOLS: Fix NPC Id mapping names in create_titanic
bc8e37e17b TITANIC: Load NPC mapping tables
c3d2f5f5ca DEVTOOLS: Fix writing of sentence entries in create_titanic
67b19851d5 TITANIC: Add loading of NPC sentence entry data
f88e65fe94 DEVTOOLS: Add Bellbot range data to create_titanic
4cdd55a7f2 TITANIC: Implemented remaining TTroomScript virtual methods
d99e06f373 TITANIC: Added TTnpcScript checkItems
f6cd02ce78 TITANIC: Added TTsentence contains
d3dc8d81ce TITANIC: Beginnings of BarbotScript process
8c237b3ee2 TITANIC: Fix NPC handleQuote method stubs
ab55958319 TITANIC: Fix compilation on MSVC9
840557236c TITANIC: Add loading of NPC tag maps, TTnpcScript translateId method
d13501bd1c TITANIC: Added TTnpcScript getDialLevel
f4ce2d04c3 TITANIC: Added Deskbot dial test methods
bf1657beb0 TITANIC: Changed NPC proc10 definitions to scriptChanged
52f6394ae5 TITANIC: Changed NPC proc7 definitions to process
314a8f25ab TITANIC: Added ParrotScript scriptChanged
a5e6d1e345 TITANIC: Remove deprecated NPC methods for data now loaded from DAT file
441d168d37 TITANIC: Replace NPC proc23 methods with a single getMapping
758fb87f0e TITANIC: Improve configure.engine
68f13646e1 TITANIC: Implementing more CGameObject/OSScreenManager draw methods
2267c5eb4c TITANIC: Beginnings of CCreditText class
f0889c17a4 TITANIC: Implementing lots of cGameObject methods
701caa956c TITANIC: Implemented mail manager methods
cafde79773 TITANIC: Added PET cursor related methods
4f85562c47 TITANIC: In progress adding CRoomFlags class
23da68350d TITANIC: Finished CRoomFlags methods
5aff1d01b4 TITANIC: Cleaning up mode and room flags fields on PET room glyphs
452274dae0 TITANIC: Flesh out PET Rooms adding glyphs
5a328ce28f TITANIC: Completed CPetRooms methods
3fb8c888a7 TITANIC: Adding miscellaneous CGameObject & CPetControl methods
54eac84dc5 TITANIC: Fix compilation issues
f7d6db05e8 TITANIC: Adding Pet Room glyph methods
5b98885f87 TITANIC: Figured out PET Room Glyph modes
fd2fd2cdc5 TITANIC: Added PET Room Glyph drawing
a4b746d24e TITANIC: Added further PET Rooms Glyph method
934787b19b TITANIC: Finsihed remaining PET Remote methods
ec5dcc17dc TITANIC: Added TTtalker methods
9ae0a76333 TITANIC: Properly named several PET Glyph virtual methods
6b376e2fa1 TITANIC: Added remaining PET Conversations methods
c2f6110d02 TITANIC: Added CPetGlyphs methods
6f5f59af17 TITANIC: Added various PET methods
bb567c6e11 TITANIC: Adding PET Inventory Glyph methods
5fe1f73159 TITANIC: Added remaining PET Inventory Glyph methods
42c8ac1c88 TITANIC: Added Pet Inventorty virtual methods
4ed93ca8f1 TITANIC: Cleanup of PET section classes methods to match original
243a3e6a7d TITANIC: Rename CPlaceHolder to CPlaceHolderItem to match original
507924b39d TITANIC: Fix initializing PET Remote glyphs
04afc63379 TITANIC: Adding savegame header load/save methods
0146a3c6b6 TITANIC: Added remaining CPetControl methods
6f063c4703 TITANIC: Fleshing out CGameObject and CPetControl methods
ad873455cf TITANIC: Adding PET Control bot methods
be9a05f8b5 TITANIC: Added CPetStarfield methods
b6f476c70f TITANIC: Cleanup and renamings for PET Starfield controller
ef1d10e926 TITANIC: Implemented remaining CGameManager methods and others
e161a3d207 TITANIC: Added extra CGameState methods
c87a6e212a TITANIC: Adding stub methods to CGameObject
3988a9eeee TITANIC: Adding more game object methods
f141b33717 TITANIC: Adding CGameObject methods
0e81482070 TITANIC: Added more CGameObject methods
a1c181f949 TITANIC: Adding CGameObject methods
4db07ba145 TITANIC: Add mouse down/up generation methods
0715be7926 TITANIC: Added CGameObject text methods
5c2a39e74a TITANIC: Set up empty message targets for classes without messages
123966554a TITANIC: gcc compilation fixes
ce0be01e31 TITANIC: Cleanup CGameObject list from CMovieClipList to CMovieRangeInfoList
a82bcd3ce7 TITANIC: Added CMovieRangeInfo methods
5ccc0a66da TITANIC: Removed const modifier from all saveable objects
8ea5d53329 TITANIC: Added CGameObject saving, and movie range info methods
d436ce5dae TITANIC: Beginning of work on star control hierarchy
eebb42be89 TITANIC: Work on CBaseStar and CStarControlSub4 classes
8f6ba6e00a TITANIC: Added CBaseStar data loading
712db65ff4 TITANIC: Implemented CStarControlSub15 class
ed2a716790 TITANIC: Implemented CSurfaceObj class
79b4754b33 TITANIC: Finish and better name fader classes
ed06a1a44e TITANIC: Added bulk ofCStarView draw
46ec1a004b TITANIC: Added CStarControl message handlers
2ff4d3ed66 TITANIC: Adding starfield points loading
82c0be2bc5 DEVTOOLS: Add second starfield points array to create_titanic
4840e3e86b TITANIC: In-progress loading of second starfield points array
d9e05e215c TITANIC: Fleshing out screen manager
5ab33f117a TITANIC: Adding more video surface methods
3f12927b77 TITANIC: Added CVideoSurface transPixelate
fb06cb4dde TITANIC: Added CMovieManager class
8b2d85f8e5 TITANIC: Figured out remainder of CMovieManager
f99b16f564 TITANIC: Suppress some warnings in unimplemented code
0b860220fc TITANIC: Beginnings of AVISurface class
b725c9add7 TITANIC: Added CStarArray initialization
341cf18661 TITANIC: Added CStarControlSub9 loading
cc9bf88ed5 TITANIC: Major implementation of OSMovie and AVISurface classes
6c56d5aa11 TITANIC: Named two remaining OSMovie virtual methods
fd954a8e0b TITANIC: Added OSVideoSurface flipVertically
62f2763bf7 VIDEO: Respect RIFF filesize field when decoding AVI files
207e1cbb29 TITANIC: Remove old hard-coded video loading code from cursors loading
fa6e12aaab VIDEO: Add support for a track filtering callback function
8a6bba0fec TITANIC: Change AVISurface to use a separate AVIDecoder for each video track
bb2d290dca VIDEO: Handle STRN chunks in AVI file streams to set stream name
c458c3c9b7 TITANIC: Fix warnings in AVISurface
513723c82d TITANIC: Making the AVISurface frameInfo a video surface
6b250453f9 TITANIC: Further implementation of movie frame decoding
f92f2243fd TITANIC: Fix star control points 2 loading
1986fa6e83 TITANIC: Fixes for mouse cursor/movie frame handling
b843b2fd33 TITANIC: Fix memory leak in image decoders
6331e3814a TITANIC: Fleshing out & fixes for video surface blit methods
7b331771ca TITANIC: Beginnings of CStarControlSub15 class
ce7e2c80d6 TITANIC: Further star control class stubs
7553b81d86 TITANIC: Some star control class definitions
e1695101bc TITANIC: Beginnings of matrix and vector classes
9b1efa3bf5 TITANIC: Added FMatrix methods
e674116edb TITANIC: More FVector methods
1b06a9294a TITANIC: Setup of CStarControlSub6 class
0118919d35 TITANIC: Further work on DMatrix
dee69e2069 TITANIC: Renaming of star point classes
c4e3cd87ab TITANIC: Finished startfield initDocument
29c87fe375 TITANIC: Renamed CStarControlSub12 to CStarField
789760295d VIDEO: Add titanic to list of engines using AVIDecoder
816b99f5a6 TITANIC: Added CStarField support methods
90f2cce0b9 TITANIC: Start of starfield rendering
9e14d4a566 TITANIC: Added CStarControlSub12 setupHandler
011286d4b8 TITANIC: Extra construction for CStarControlSub12
87db74d771 TITANIC: Adding CStarControlSub12 methods
020655a6f3 TITANIC: Adding CStarControlSub12 methods
3ee3784073 TITANIC: Added remaining CStarControlSub12 virtual methods
5387d4dd7b TITANIC: Added CStarControlSub20 copyFrom/copyTo methods
25e8d1d5a8 TITANIC: Simplify data usage in CStarControlSub20
87379442ff TITANIC: Fix scanning for files not to free resources
18e06f727a TITANIC: Fix loading of movies with only a single video track
2ea4116e0a TITANIC: gcc compilation fixes
53c7517dfb TITANIC: Fix loading movies for playback
d5bf17e73f TITANIC: Add movie _handled flag, simplify frame timinig code
c5792fce4b TITANIC: Clarify movie/surface has frame fields & variables
a13134b38d TITANIC: Clarify CVideoSurface _field48 as _freeMovieSurface
1102203396 TITANIC: Add missing engine saving functionality
543434aa78 TITANIC: Fix destroying previous game project when loading savegame
2db54279e9 TITANIC: Fixes for saving/loading savegame headers
0ed7b463e8 TITANIC: Fixes for saving & loading savegames
4ff4215706 TITANIC: Display first 5 savegame slots in PET RealLife tab
41a3c83bc6 TITANIC: Fleshing out PET RealLife Load functionality
03b45f44df TITANIC: Workaround for original using destroyed objects after save load
4f08292c8c TITANIC: Add support for arbitrary window event targets
7f05cfad13 DEVTOOLS: Save create_titanic bitmap resources with correct bitmap headers
21e4d6686f TITANIC: Beginnings of Continue Save dialog
7821b84659 TITANIC: Add button handling and evil twin to Continue Save dialog
8f43f2a7a5 TITANIC: Setting up Continue Save dialog slot names list
9a69ee3f44 TITANIC: Fix redrawing CPetText after line colors are changed
4bad949717 TITANIC: Add Continue Save dialog slots rendering and selection
9c5f3c305a TITANIC: gcc compilation fix
71b76acc63 TITANIC: Fixes and simplification of AVISurface
8a6a5cebfb TITANIC: Clarify MODE_2 as MODE_FOCUSED
c918602800 TITANIC: Fix some warnings
8dd24dd945 TITANIC: Finish CLinkItem class
382ba52e33 TITANIC: Fix exit crash when a movie is active
9e02409ef4 TITANIC: Clarification and fixes for movie reverse and repeat flags
00c568e175 TITANIC: Fix for movie play ranges that end at the AVI file end
d979dcd020 TITANIC: Fixes for movie notification, computer game logic cleanup
d690ca322c TITANIC: Cleanup of CTimeEventInfo class
2efee2ae8c TITANIC: Further timers cleanup
f1344c2c27 TITANIC: Added CCreditText loading
fd316a6058 TITANIC: Fleshed out various methods
d1880452b5 TITANIC: Added 16bit requirement to configure.engine
125a38c98a TITANIC: In progress adding TTbarbotScript process method
773bfca605 DEVTOOLS: Add secondary Barbot sentence data to create_titanic
6e2a4edd2a TITANIC: Finish TTbarbotScript process method
7d554339d3 TITANIC: Add semicolons after DEFFN lines
eb98b984fb TITANIC: Add semicolon after EMPTY_MESSAGE_MAP macro usages
4d79ee16c0 TITANIC: Add semicolon after CLASSDEF macro usage
c6e2f4e680 TITANIC: gcc compilation fix
875002daea TITANIC: Add semicolon to DECLARE_MESSAGE_MAP usage
13ce0156ff TITANIC: Fix crash loading Sentences/Default NPC data
cf805b07d3 TITANIC: Adding NPC Script support methods
6558eb78c3 TITANIC: More NPC Script support methods
d59b012442 DEVTOOLS: Add NPC Script word lists to create_titanic
3c547b6b35 TITANIC: Load word lists for each NPC Script class
539f13f5a4 TITANIC: Remove deprecated code
2844574dc0 TITANIC: Added NPC Script setDialRegion methods
3efc9f5cde TITANIC: Added NPC scripts gitDialsBitsets methods
9c763c978d TITANIC: Added BarbotScript proc25
fcb42d5715 TITANIC: Added Bellbot & Deskbot proc25
2faa3125c0 TITANIC: Added DoorbotScript proc25
f1c4647c9b TITANIC: Added LiftbotScript proc25
40955e590c TITANIC: Handled tag switch in BarbotScript handleQuote
78d8c4e3da TITANIC: Handled tag switch in BellbotScript handleQuote
de494c8c27 TITANIC: Handled tag switch in DeskbotScript handleQuote
04931130b4 TITANIC: Split NPC script support data structures to their own file
ebeea1bb23 TITANIC: Added remainder of BarbotScript handleQuote
7eece35951 TITANIC: Added remainder of BellbotScript handleQuote
a0441c83ec TITANIC: Added remainder of DeskbotScript handleQuote
95529c6a6e DEVTOOLS: Added handleQuote methods arrays to create_titanic
89da2a8857 TITANIC: Moved handleQuote data arrays to datafile
5bc347007c TITANIC: Finish DoorbotScript handleQuote
13114f1d83 TITANIC: Finish LiftbotScript handleQuote
2457340315 TITANIC: Finish MaitreDScript handleQuote
8cc9142a92 TITANIC: Renaming for NPC state methods
875a9998c5 TITANIC: Added BellbotScript updateState
a185a99a86 TTIANIC: Added support methods for BellbotScript updateState
7a2a705a7a TITANIC: Added DeskbotScript updateState
f36d392c11 DEVTOOLS: Add updateState methods arrays to create_titanic
52b6c92ac0 TITANIC: Add loading of updateState arrays
c7bd63d881 TITANIC: Added BarbotScript updateState
c08ad39a94 TITANIC: Added DeskbotScript setFlags17
186b4e095a TITANIC: Added DoorbotScript updateState
39f882d9f3 TITANIC: Added LiftbotScript updateState
72ef0e7675 TITANIC: Added MaitreDScript updateState
0ab3c53e15 DEVTOOLS: Add NPC pre-response arrays to create_titanic
0243d5b677 TITANIC: Add NPC preResponse methods
eef9303027 TITANIC: Handle NPC postResponse methods
4df8e58cf3 TITANIC: Fix commented out quotes tree searches
6aef21517f TITANIC: Rename NPC scripts proc25 to doSentenceEntry
a97dd2cda9 TITANIC: Handle NPC getDialsBitset methods
1adebe83dc TITANIC: Added NPC randomResponse methods, reworked NPC data
c3ba0badd1 TITANIC: Added BellbotScript preprocess
6eca180172 DEVTOOLS: Compilation fix for create_titanic under gcc
6dbbb173bd TITANIC: Fix identified warnings
01910f32f0 TITANIC: Fix identified warnings
d9435e538f TITANIC: Added BellbotScript process
cf63ceeb3c TITANIC: Adding BellbotScript support methods
2b38dd4ff1 TITANIC: Added Bellbot common phrase list to create_titanic
45fb6a2d32 TITANIC: Added BellbotScript checkCommonPhrases
377f926a6b TITANIC: Added BellbotScript scriptChanged
2bb4e83d5a DEVTOOLS: Properly set up PARROT_RANGES array in create_titanic
8a2491c51b TITANIC: Fix some clang warnings
e2b00938c7 TITANIC: Added DeskbotScript preprocess
07bf730443 TITANIC: Adding lots of const prefixes
af286f2c97 DEVTOOLS: Add entries sentence sets for Deskbot in create_titanic
267b8405fd TITANIC: Added DeskbotScript process
16aeae7819 TITANIC: Added DeskbotScript scriptChanged
19f8a0965b TITANIC: Added DoorbotScript process
9d3a2c1c7f Merge pull request #786 from dreammaster/titanic


Commit: 93c28c7970e9273b102e9efd8589806f1e849603
    https://github.com/scummvm/scummvm/commit/93c28c7970e9273b102e9efd8589806f1e849603
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-05T20:39:42-05:00

Commit Message:
TITANIC: Initial engine skeleton

Changed paths:
  A engines/titanic/configure.engine
  A engines/titanic/detection.cpp
  A engines/titanic/detection_tables.h
  A engines/titanic/module.mk
  A engines/titanic/titanic.cpp
  A engines/titanic/titanic.h



diff --git a/engines/titanic/configure.engine b/engines/titanic/configure.engine
new file mode 100644
index 0000000..781b783
--- /dev/null
+++ b/engines/titanic/configure.engine
@@ -0,0 +1,3 @@
+# This file is included from the main "configure" script
+# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
+add_engine titanic "Starship Titanic" no
diff --git a/engines/titanic/detection.cpp b/engines/titanic/detection.cpp
new file mode 100644
index 0000000..70fe25d
--- /dev/null
+++ b/engines/titanic/detection.cpp
@@ -0,0 +1,129 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/titanic.h"
+
+#include "base/plugins.h"
+#include "common/savefile.h"
+#include "common/str-array.h"
+#include "common/memstream.h"
+#include "engines/advancedDetector.h"
+#include "common/system.h"
+#include "graphics/colormasks.h"
+#include "graphics/surface.h"
+
+#define MAX_SAVES 99
+
+namespace Titanic {
+
+struct TitanicGameDescription {
+	ADGameDescription desc;
+};
+
+uint32 TitanicEngine::getFeatures() const {
+	return _gameDescription->desc.flags;
+}
+
+bool TitanicEngine::isDemo() const {
+	return (bool)(_gameDescription->desc.flags & ADGF_DEMO);
+}
+
+Common::Language TitanicEngine::getLanguage() const {
+	return _gameDescription->desc.language;
+}
+
+} // End of namespace Titanic
+
+static const PlainGameDescriptor TitanicGames[] = {
+	{"titanic", "Starship Titanic"},
+	{0, 0}
+};
+
+#include "titanic/detection_tables.h"
+
+class TitanicMetaEngine : public AdvancedMetaEngine {
+public:
+	TitanicMetaEngine() : AdvancedMetaEngine(Titanic::gameDescriptions, sizeof(Titanic::TitanicGameDescription), TitanicGames) {
+		_maxScanDepth = 3;
+	}
+
+	virtual const char *getName() const {
+		return "Titanic Engine";
+	}
+
+	virtual const char *getOriginalCopyright() const {
+		return "Titanic Engine (c)";
+	}
+
+	virtual bool hasFeature(MetaEngineFeature f) const;
+	virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
+	virtual SaveStateList listSaves(const char *target) const;
+	virtual int getMaximumSaveSlot() const;
+	virtual void removeSaveState(const char *target, int slot) const;
+	SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
+};
+
+bool TitanicMetaEngine::hasFeature(MetaEngineFeature f) const {
+	return
+	    (f == kSupportsListSaves) ||
+		(f == kSupportsLoadingDuringStartup) ||
+		(f == kSupportsDeleteSave) ||
+		(f == kSavesSupportMetaInfo) ||
+		(f == kSavesSupportThumbnail);
+}
+
+bool Titanic::TitanicEngine::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsRTL) ||
+		(f == kSupportsLoadingDuringRuntime) ||
+		(f == kSupportsSavingDuringRuntime);
+}
+
+bool TitanicMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
+	const Titanic::TitanicGameDescription *gd = (const Titanic::TitanicGameDescription *)desc;
+	*engine = new Titanic::TitanicEngine(syst, gd);
+
+	return gd != 0;
+}
+
+SaveStateList TitanicMetaEngine::listSaves(const char *target) const {
+	SaveStateList saveList;
+	return saveList;
+}
+
+int TitanicMetaEngine::getMaximumSaveSlot() const {
+	return MAX_SAVES;
+}
+
+void TitanicMetaEngine::removeSaveState(const char *target, int slot) const {
+}
+
+SaveStateDescriptor TitanicMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+	return SaveStateDescriptor();
+}
+
+
+#if PLUGIN_ENABLED_DYNAMIC(TITANIC)
+	REGISTER_PLUGIN_DYNAMIC(TITANIC, PLUGIN_TYPE_ENGINE, TitanicMetaEngine);
+#else
+	REGISTER_PLUGIN_STATIC(TITANIC, PLUGIN_TYPE_ENGINE, TitanicMetaEngine);
+#endif
diff --git a/engines/titanic/detection_tables.h b/engines/titanic/detection_tables.h
new file mode 100644
index 0000000..dab7bd5
--- /dev/null
+++ b/engines/titanic/detection_tables.h
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+namespace Titanic {
+	
+static const TitanicGameDescription gameDescriptions[] = {
+	{
+		{
+			"titanic",
+			0,
+			AD_ENTRY1s("a.st", "b283436d90974fdc81accc95dbd8e61c", 15405985),
+			Common::EN_ANY,
+			Common::kPlatformWindows,
+			ADGF_NO_FLAGS,
+			GUIO1(GUIO_NONE)
+		},
+	},
+
+	{ AD_TABLE_END_MARKER }
+};
+
+} // End of namespace Titanic
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
new file mode 100644
index 0000000..bb35941
--- /dev/null
+++ b/engines/titanic/module.mk
@@ -0,0 +1,13 @@
+MODULE := engines/titanic
+
+MODULE_OBJS := \
+	detection.o \
+	titanic.o
+
+# This module can be built as a plugin
+ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
+PLUGIN := 1
+endif
+
+# Include common rules
+include $(srcdir)/rules.mk
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
new file mode 100644
index 0000000..88e9fbc
--- /dev/null
+++ b/engines/titanic/titanic.cpp
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/scummsys.h"
+#include "common/config-manager.h"
+#include "common/debug-channels.h"
+#include "common/events.h"
+#include "engines/util.h"
+#include "graphics/scaler.h"
+#include "graphics/thumbnail.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc)
+	: _gameDescription(gameDesc), Engine(syst) {
+}
+
+TitanicEngine::~TitanicEngine() {
+}
+
+void TitanicEngine::initialize() {
+	// Set up debug channels
+	DebugMan.addDebugChannel(kDebugCore, "core", "Core engine debug level");
+	DebugMan.addDebugChannel(kDebugScripts, "scripts", "Game scripts");
+	DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
+	DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
+
+	initGraphics(320, 200, false);
+
+}
+
+Common::Error TitanicEngine::run() {
+	initialize();
+
+	return Common::kNoError;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
new file mode 100644
index 0000000..a49bb2d
--- /dev/null
+++ b/engines/titanic/titanic.h
@@ -0,0 +1,86 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TITANIC_H
+#define TITANIC_TITANIC_H
+
+#include "common/scummsys.h"
+#include "common/system.h"
+#include "common/serializer.h"
+#include "engines/advancedDetector.h"
+#include "engines/engine.h"
+
+/**
+ * This is the namespace of the Titanic engine.
+ *
+ * Status of this engine: In Development
+ *
+ * Games using this engine:
+ * - Starship Titanic
+ */
+namespace Titanic {
+
+enum TitanicDebugChannels {
+	kDebugCore      = 1 << 0,
+	kDebugScripts	= 1 << 1,
+	kDebugGraphics	= 1 << 2,
+	kDebugSound     = 1 << 3
+};
+
+#define TITANIC_SAVEGAME_VERSION 1
+
+struct TitanicGameDescription;
+
+struct TitanicSavegameHeader {
+	uint8 _version;
+	Common::String _saveName;
+	Graphics::Surface *_thumbnail;
+	int _year, _month, _day;
+	int _hour, _minute;
+	int _totalFrames;
+};
+
+class TitanicEngine : public Engine {
+private:
+	/**
+	 * Handles basic initialization
+	 */
+	void initialize();
+protected:
+	const TitanicGameDescription *_gameDescription;
+	int _loadSaveSlot;
+
+	// Engine APIs
+	virtual Common::Error run();
+	virtual bool hasFeature(EngineFeature f) const;
+public:
+	TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
+	virtual ~TitanicEngine();
+
+	uint32 getFeatures() const;
+	bool isDemo() const;
+	Common::Language getLanguage() const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TITANIC_H */


Commit: 021c47b0c13bf7a9e467d28cbf127974ebfd9e9d
    https://github.com/scummvm/scummvm/commit/021c47b0c13bf7a9e467d28cbf127974ebfd9e9d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-05T21:48:01-05:00

Commit Message:
TITANIC: Skeleton screen manager class

Changed paths:
  A engines/titanic/font.cpp
  A engines/titanic/font.h
  A engines/titanic/screen_manager.cpp
  A engines/titanic/screen_manager.h
    engines/titanic/module.mk
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/font.cpp b/engines/titanic/font.cpp
new file mode 100644
index 0000000..18f15ca
--- /dev/null
+++ b/engines/titanic/font.cpp
@@ -0,0 +1,30 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/font.h"
+
+namespace Titanic {
+
+STFont::STFont() {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/font.h b/engines/titanic/font.h
new file mode 100644
index 0000000..f0ea5e4
--- /dev/null
+++ b/engines/titanic/font.h
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FONT_H
+#define TITANIC_FONT_H
+
+#include "common/scummsys.h"
+
+namespace Titanic {
+
+class STFont {
+public:
+public:
+	STFont();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FONT_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index bb35941..2ddd8d1 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -2,6 +2,8 @@ MODULE := engines/titanic
 
 MODULE_OBJS := \
 	detection.o \
+	font.o \
+	screen_manager.o \
 	titanic.o
 
 # This module can be built as a plugin
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
new file mode 100644
index 0000000..7493f1f
--- /dev/null
+++ b/engines/titanic/screen_manager.cpp
@@ -0,0 +1,74 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/screen_manager.h"
+
+namespace Titanic {
+
+CScreenManagerRec::CScreenManagerRec() {
+	_field0 = 0;
+	_field4 = 0;
+	_field8 = 0;
+	_fieldC = 0;
+}
+
+/*------------------------------------------------------------------------*/
+
+CScreenManager::CScreenManager() {
+	_screenManagerPtr = nullptr;
+
+	_field4 = 0;
+	_fontRenderSurface = nullptr;
+	_mouseCursor = nullptr;
+	_textCursor = nullptr;
+	_fontNumber = 0;
+}
+
+CScreenManager::~CScreenManager() {
+	_screenManagerPtr = nullptr;
+}
+
+void CScreenManager::proc2(int v) {
+	if (v)
+		_field4 = v;
+}
+
+bool CScreenManager::proc3(int v) {
+	if (!v || _field4)
+		return false;
+
+	_field4 = 0;
+	proc27();
+	return true;
+}
+
+/*------------------------------------------------------------------------*/
+
+OSScreenManager::OSScreenManager(): CScreenManager() {
+	_field48 = 0;
+	_field4C = 0;
+	_field50 = 0;
+	_field54 = 0;
+	_directDrawManager = nullptr;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
new file mode 100644
index 0000000..e79fde0
--- /dev/null
+++ b/engines/titanic/screen_manager.h
@@ -0,0 +1,105 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SCREEN_MANAGER_H
+#define TITANIC_SCREEN_MANAGER_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "titanic/font.h"
+
+namespace Titanic {
+
+class CSurface {
+};
+
+class CScreenManagerRec {
+public:
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+public:
+	CScreenManagerRec();
+};
+
+class CScreenManager {
+public:
+	void *_screenManagerPtr;
+public:
+	int _field4;
+	Common::Array<CSurface> _backSurfaces;
+	CSurface *_fontRenderSurface;
+	CScreenManagerRec _entries[2];
+	void *_mouseCursor;
+	void *_textCursor;
+	int _fontNumber;
+public:
+	CScreenManager();
+	virtual ~CScreenManager();
+
+	void fn1() {}
+	void fn2() {}
+
+	virtual void proc2(int v);
+	virtual bool proc3(int v);
+	virtual void setMode() = 0;
+	virtual void proc5() = 0;
+	virtual void proc6() = 0;
+	virtual void proc7() = 0;
+	virtual void proc8() = 0;
+	virtual void proc9() = 0;
+	virtual void proc10() = 0;
+	virtual void proc11() = 0;
+	virtual void proc12() = 0;
+	virtual void proc13() = 0;
+	virtual void proc14() = 0;
+	virtual void proc15() = 0;
+	virtual void proc16() = 0;
+	virtual void getFont() = 0;
+	virtual void proc18() = 0;
+	virtual void proc19() = 0;
+	virtual void proc20() = 0;
+	virtual void proc21() = 0;
+	virtual void proc22() = 0;
+	virtual void proc23() = 0;
+	virtual void proc24() = 0;
+	virtual void proc25() = 0;
+	virtual void showCursor() = 0;
+	virtual void proc27() = 0;
+};
+
+class OSScreenManager: CScreenManager {
+public:
+	int _field48;
+	int _field4C;
+	int _field50;
+	int _field54;
+	void *_directDrawManager;
+	STFont _fonts[4];
+public:
+	OSScreenManager();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SCREEN_MANAGER_H */
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 88e9fbc..f0a70ce 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -44,9 +44,6 @@ void TitanicEngine::initialize() {
 	DebugMan.addDebugChannel(kDebugScripts, "scripts", "Game scripts");
 	DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
 	DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
-
-	initGraphics(320, 200, false);
-
 }
 
 Common::Error TitanicEngine::run() {


Commit: 08be41ac52f07bdc859a9a9fd2252b69a757a569
    https://github.com/scummvm/scummvm/commit/08be41ac52f07bdc859a9a9fd2252b69a757a569
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-05T22:11:02-05:00

Commit Message:
TITANIC: Added skeleton CMainGameWindow class

Changed paths:
  A engines/titanic/main_game_window.cpp
  A engines/titanic/main_game_window.h
    engines/titanic/module.mk
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
new file mode 100644
index 0000000..774cde6
--- /dev/null
+++ b/engines/titanic/main_game_window.cpp
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/main_game_window.h"
+
+namespace Titanic {
+
+CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) {
+	_gameView = nullptr;
+	_gameManager = nullptr;
+	_project = nullptr;
+	_field50 = 0;
+	_image = nullptr;
+	_cursor = nullptr;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
new file mode 100644
index 0000000..ae30347
--- /dev/null
+++ b/engines/titanic/main_game_window.h
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MAIN_GAME_WINDOW_H
+#define TITANIC_MAIN_GAME_WINDOW_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+
+namespace Titanic {
+
+class TitanicEngine;
+
+class CMainGameWindow {
+private:
+	TitanicEngine *_vm;
+public:
+	void *_gameView;
+	void *_gameManager;
+	void *_project;
+	int _field50;
+	void *_image;
+	void *_cursor;
+public:
+	CMainGameWindow(TitanicEngine *vm);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MAIN_GAME_WINDOW_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 2ddd8d1..6f26bd4 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -3,6 +3,7 @@ MODULE := engines/titanic
 MODULE_OBJS := \
 	detection.o \
 	font.o \
+	main_game_window.o \
 	screen_manager.o \
 	titanic.o
 
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 7493f1f..6ee67ca6 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -71,4 +71,29 @@ OSScreenManager::OSScreenManager(): CScreenManager() {
 	_directDrawManager = nullptr;
 }
 
+void OSScreenManager::setMode() {}
+void OSScreenManager::proc5() {}
+void OSScreenManager::proc6() {}
+void OSScreenManager::proc7() {}
+void OSScreenManager::proc8() {}
+void OSScreenManager::proc9() {}
+void OSScreenManager::proc10() {}
+void OSScreenManager::proc11() {}
+void OSScreenManager::proc12() {}
+void OSScreenManager::proc13() {}
+void OSScreenManager::proc14() {}
+void OSScreenManager::proc15() {}
+void OSScreenManager::proc16() {}
+void OSScreenManager::getFont() {}
+void OSScreenManager::proc18() {}
+void OSScreenManager::proc19() {}
+void OSScreenManager::proc20() {}
+void OSScreenManager::proc21() {}
+void OSScreenManager::proc22() {}
+void OSScreenManager::proc23() {}
+void OSScreenManager::proc24() {}
+void OSScreenManager::proc25() {}
+void OSScreenManager::showCursor() {}
+void OSScreenManager::proc27() {}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index e79fde0..b30b7a0 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -98,6 +98,31 @@ public:
 	STFont _fonts[4];
 public:
 	OSScreenManager();
+
+	virtual void setMode();
+	virtual void proc5();
+	virtual void proc6();
+	virtual void proc7();
+	virtual void proc8();
+	virtual void proc9();
+	virtual void proc10();
+	virtual void proc11();
+	virtual void proc12();
+	virtual void proc13();
+	virtual void proc14();
+	virtual void proc15();
+	virtual void proc16();
+	virtual void getFont();
+	virtual void proc18();
+	virtual void proc19();
+	virtual void proc20();
+	virtual void proc21();
+	virtual void proc22();
+	virtual void proc23();
+	virtual void proc24();
+	virtual void proc25();
+	virtual void showCursor();
+	virtual void proc27();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index f0a70ce..9230717 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -32,10 +32,14 @@
 namespace Titanic {
 
 TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc)
-	: _gameDescription(gameDesc), Engine(syst) {
+		: _gameDescription(gameDesc), Engine(syst) {
+	_window = nullptr;
+	_screenManager = nullptr;
 }
 
 TitanicEngine::~TitanicEngine() {
+	delete _window;
+	delete _screenManager;
 }
 
 void TitanicEngine::initialize() {
@@ -44,6 +48,9 @@ void TitanicEngine::initialize() {
 	DebugMan.addDebugChannel(kDebugScripts, "scripts", "Game scripts");
 	DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
 	DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
+
+	_window = new CMainGameWindow(this);
+	_screenManager = new OSScreenManager();
 }
 
 Common::Error TitanicEngine::run() {
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index a49bb2d..1265e70 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -28,6 +28,8 @@
 #include "common/serializer.h"
 #include "engines/advancedDetector.h"
 #include "engines/engine.h"
+#include "titanic/screen_manager.h"
+#include "titanic/main_game_window.h"
 
 /**
  * This is the namespace of the Titanic engine.
@@ -73,6 +75,9 @@ protected:
 	virtual Common::Error run();
 	virtual bool hasFeature(EngineFeature f) const;
 public:
+	OSScreenManager *_screenManager;
+	CMainGameWindow *_window;
+public:
 	TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
 	virtual ~TitanicEngine();
 


Commit: ab28f8714353ab5043d86375572815ebc75fe7ed
    https://github.com/scummvm/scummvm/commit/ab28f8714353ab5043d86375572815ebc75fe7ed
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-05T23:39:27-05:00

Commit Message:
TITANIC: Beginnings of Image class

Changed paths:
  A engines/titanic/image.cpp
  A engines/titanic/image.h
    engines/titanic/main_game_window.cpp
    engines/titanic/main_game_window.h
    engines/titanic/module.mk



diff --git a/engines/titanic/image.cpp b/engines/titanic/image.cpp
new file mode 100644
index 0000000..d49f2ec
--- /dev/null
+++ b/engines/titanic/image.cpp
@@ -0,0 +1,90 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/image.h"
+
+namespace Titanic {
+
+BITMAPINFOHEADER::BITMAPINFOHEADER() {
+	_biSize = 0;
+	_biWidth = 0;
+	_biHeight = 0;
+	_biPlanes = 0;
+	_biBitCount = 0;
+	_biCompression = 0;
+	_biSizeImage = 0;
+	_biXPelsPerMeter = 0;
+	_biYPelsPerMeter = 0;
+	_biCirUsed = 0;
+	_biClrImportant = 0;
+}
+
+/*------------------------------------------------------------------------*/
+
+RGBQuad::RGBQuad() : _rgbRed(0), _rgbGreen(0), _rgbBlue(0), _rgbReserved(0) {}
+
+/*------------------------------------------------------------------------*/
+
+Image::Image() {
+	_bitmapInfo = nullptr;
+	_bits = nullptr;
+	_flag = true;
+
+	set(16, 16);
+}
+
+void Image::proc6() {
+
+}
+
+void Image::set(int width, int height) {
+	delete _bitmapInfo;
+	if (_flag && _bitmapInfo)
+		delete[] _bits;
+
+	_bitmapInfo = new tagBITMAPINFO;
+	_bits = new byte[(width + 3) & 0xFFFC * height];
+
+	tagBITMAPINFO &bi = *_bitmapInfo;
+	bi._bmiHeader._biWidth = width;
+	bi._bmiHeader._biHeight = height;
+	bi._bmiHeader._biPlanes = 1;
+	bi._bmiHeader._biBitCount = 8;
+}
+
+void Image::proc8() {
+
+}
+
+bool Image::loadResource(const Common::String &name) {
+	return true;
+}
+
+void Image::proc10() {
+
+}
+
+void Image::draw() {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/image.h b/engines/titanic/image.h
new file mode 100644
index 0000000..625c78b
--- /dev/null
+++ b/engines/titanic/image.h
@@ -0,0 +1,79 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_IMAGE_H
+#define TITANIC_IMAGE_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+
+namespace Titanic {
+
+struct BITMAPINFOHEADER {
+	int _biSize;
+	int _biWidth;
+	int _biHeight;
+	int _biPlanes;
+	int _biBitCount;
+	bool _biCompression;
+	int _biSizeImage;
+	int _biXPelsPerMeter;
+	int _biYPelsPerMeter;
+	int _biCirUsed;
+	int _biClrImportant;
+
+	BITMAPINFOHEADER();
+};
+
+struct RGBQuad {
+	byte _rgbRed;
+	byte _rgbGreen;
+	byte _rgbBlue;
+	byte _rgbReserved;
+
+	RGBQuad();
+};
+
+struct tagBITMAPINFO {
+	BITMAPINFOHEADER _bmiHeader;
+	RGBQuad _bmiColors[256];
+};
+
+class Image {
+public:
+	tagBITMAPINFO *_bitmapInfo;
+	byte *_bits;
+	bool _flag;
+public:
+	Image();
+
+	virtual void proc6();
+	virtual void set(int width, int height);
+	virtual void proc8();
+	virtual bool loadResource(const Common::String &name);
+	virtual void proc10();
+	virtual void draw();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_IMAGE_H */
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 774cde6..54fb6c2 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -20,6 +20,7 @@
  *
  */
 
+#include "titanic/titanic.h"
 #include "titanic/main_game_window.h"
 
 namespace Titanic {
@@ -31,6 +32,11 @@ CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) {
 	_field50 = 0;
 	_image = nullptr;
 	_cursor = nullptr;
+
+	Image image;
+	bool result = image.loadResource("TITANIC");
+	if (!result)
+		return;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index ae30347..91e6860 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -25,6 +25,7 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
+#include "titanic/image.h"
 
 namespace Titanic {
 
@@ -38,7 +39,7 @@ public:
 	void *_gameManager;
 	void *_project;
 	int _field50;
-	void *_image;
+	Image *_image;
 	void *_cursor;
 public:
 	CMainGameWindow(TitanicEngine *vm);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 6f26bd4..18cde15 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -3,6 +3,7 @@ MODULE := engines/titanic
 MODULE_OBJS := \
 	detection.o \
 	font.o \
+	image.o \
 	main_game_window.o \
 	screen_manager.o \
 	titanic.o


Commit: 0874af38dbad54551e143e541f37163ec9e7e0e7
    https://github.com/scummvm/scummvm/commit/0874af38dbad54551e143e541f37163ec9e7e0e7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-06T11:22:08-05:00

Commit Message:
TITANIC: Added Image::loadResource

Changed paths:
    engines/titanic/image.cpp
    engines/titanic/image.h



diff --git a/engines/titanic/image.cpp b/engines/titanic/image.cpp
index d49f2ec..b18d591 100644
--- a/engines/titanic/image.cpp
+++ b/engines/titanic/image.cpp
@@ -20,6 +20,7 @@
  *
  */
 
+#include "common/file.h"
 #include "titanic/image.h"
 
 namespace Titanic {
@@ -76,6 +77,22 @@ void Image::proc8() {
 }
 
 bool Image::loadResource(const Common::String &name) {
+	// This method is hardcoded for the Titanic splash screen resource
+	assert(name == "TITANIC");
+
+	Common::File f;
+	if (!f.open("ST.exe"))
+		return false;
+
+	// The ST.exe executable has a bitmap called "TITANIC". Since we can't use
+	// the Windows FindResource function in ScummVM, this is hardcoded for now
+	f.seek(0x29B660);
+	uint size = f.readUint32LE();
+	if (size != 40)
+		return false;
+
+	loadBitmap(f);
+
 	return true;
 }
 
@@ -87,4 +104,18 @@ void Image::draw() {
 
 }
 
+void Image::loadBitmap(Common::SeekableReadStream &s) {
+	_bitmapInfo->_bmiHeader._biWidth = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biHeight = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biPlanes = s.readUint16LE();
+	_bitmapInfo->_bmiHeader._biBitCount = s.readUint16LE();
+	_bitmapInfo->_bmiHeader._biCompression = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biSizeImage = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biXPelsPerMeter = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biYPelsPerMeter = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biClrUsed = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biClrImportant = s.readUint32LE();
+
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/image.h b/engines/titanic/image.h
index 625c78b..adef011 100644
--- a/engines/titanic/image.h
+++ b/engines/titanic/image.h
@@ -34,11 +34,11 @@ struct BITMAPINFOHEADER {
 	int _biHeight;
 	int _biPlanes;
 	int _biBitCount;
-	bool _biCompression;
+	int _biCompression;
 	int _biSizeImage;
 	int _biXPelsPerMeter;
 	int _biYPelsPerMeter;
-	int _biCirUsed;
+	int _biClrUsed;
 	int _biClrImportant;
 
 	BITMAPINFOHEADER();
@@ -59,6 +59,8 @@ struct tagBITMAPINFO {
 };
 
 class Image {
+private:
+	void loadBitmap(Common::SeekableReadStream &s);
 public:
 	tagBITMAPINFO *_bitmapInfo;
 	byte *_bits;


Commit: bc7bc8ab3487df70263721493c26c16aab9c7b81
    https://github.com/scummvm/scummvm/commit/bc7bc8ab3487df70263721493c26c16aab9c7b81
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-07T16:22:16-05:00

Commit Message:
TITANIC: Class stubs and beginnings of CSaveableObject hierarchy

Changed paths:
  A engines/titanic/direct_draw.cpp
  A engines/titanic/direct_draw.h
  A engines/titanic/list.cpp
  A engines/titanic/list.h
  A engines/titanic/saveable_object.cpp
  A engines/titanic/saveable_object.h
  A engines/titanic/video_surface.cpp
  A engines/titanic/video_surface.h
    engines/titanic/image.cpp
    engines/titanic/main_game_window.cpp
    engines/titanic/main_game_window.h
    engines/titanic/module.mk
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/direct_draw.cpp b/engines/titanic/direct_draw.cpp
new file mode 100644
index 0000000..a79edf9
--- /dev/null
+++ b/engines/titanic/direct_draw.cpp
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/direct_draw.h"
+
+namespace Titanic {
+
+DirectDraw::DirectDraw(TitanicEngine *vm) : Manager(vm) {
+	_field8 = 0;
+	_fieldC = 0;
+	_width = 0;
+	_height = 0;
+	_bpp = 0;
+	_field1C = 0;
+	_field24 = 0;
+}
+
+/*------------------------------------------------------------------------*/
+
+DirectDrawManager::DirectDrawManager(TitanicEngine *vm) : 
+		Manager(vm), _directDraw(vm) {
+	_mainSurface = nullptr;
+	_backSurfaces[0] = _backSurfaces[1] = nullptr;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/direct_draw.h b/engines/titanic/direct_draw.h
new file mode 100644
index 0000000..f88df71
--- /dev/null
+++ b/engines/titanic/direct_draw.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DIRECT_DRAW_H
+#define TITANIC_DIRECT_DRAW_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+class DirectDraw: public Manager {
+public:
+	int _field8;
+	int _fieldC;
+	int _width;
+	int _height;
+	int _bpp;
+	int _field1C;
+	int _field24;
+public:
+	DirectDraw(TitanicEngine *vm);
+};
+
+class DirectDrawManager: public Manager {
+public:
+	DirectDraw _directDraw;
+	void *_mainSurface;
+	void *_backSurfaces[2];
+public:
+	DirectDrawManager(TitanicEngine *vm);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DIRECT_DRAW_H */
diff --git a/engines/titanic/image.cpp b/engines/titanic/image.cpp
index b18d591..0a13041 100644
--- a/engines/titanic/image.cpp
+++ b/engines/titanic/image.cpp
@@ -35,7 +35,7 @@ BITMAPINFOHEADER::BITMAPINFOHEADER() {
 	_biSizeImage = 0;
 	_biXPelsPerMeter = 0;
 	_biYPelsPerMeter = 0;
-	_biCirUsed = 0;
+	_biClrUsed = 0;
 	_biClrImportant = 0;
 }
 
diff --git a/engines/titanic/list.cpp b/engines/titanic/list.cpp
new file mode 100644
index 0000000..2b6496f
--- /dev/null
+++ b/engines/titanic/list.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/list.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/list.h b/engines/titanic/list.h
new file mode 100644
index 0000000..d94ccb9
--- /dev/null
+++ b/engines/titanic/list.h
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LIST_H
+#define TITANIC_LIST_H
+
+#include "common/scummsys.h"
+#include "titanic/saveable_object.h"
+
+namespace Titanic {
+
+class List : public CSaveableObject {
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LIST_H */
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 54fb6c2..9087caf 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -32,11 +32,13 @@ CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) {
 	_field50 = 0;
 	_image = nullptr;
 	_cursor = nullptr;
+}
 
+bool CMainGameWindow::Create() {
 	Image image;
 	bool result = image.loadResource("TITANIC");
 	if (!result)
-		return;
+		return true;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 91e6860..9b41212 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -43,6 +43,11 @@ public:
 	void *_cursor;
 public:
 	CMainGameWindow(TitanicEngine *vm);
+
+	/**
+	 * Creates the window
+	 */
+	bool Create();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 18cde15..a2a7722 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -2,11 +2,15 @@ MODULE := engines/titanic
 
 MODULE_OBJS := \
 	detection.o \
+	direct_draw.o \
 	font.o \
 	image.o \
+	list.o \
 	main_game_window.o \
+	saveable_object.o \
 	screen_manager.o \
-	titanic.o
+	titanic.o \
+	video_surface.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/saveable_object.cpp b/engines/titanic/saveable_object.cpp
new file mode 100644
index 0000000..c1b6612
--- /dev/null
+++ b/engines/titanic/saveable_object.cpp
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/saveable_object.h"
+#include "titanic/list.h"
+
+namespace Titanic {
+
+Common::HashMap<Common::String, CSaveableObject::CreateFunction> * 
+	CSaveableObject::_classList = nullptr;
+
+#define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
+#define ADDFN(T) (*_classList)["TEST"] = Function##T
+
+DEFFN(List);
+
+void CSaveableObject::initClassList() {
+	_classList = new Common::HashMap<Common::String, CreateFunction>();
+	ADDFN(List);
+}
+
+void CSaveableObject::freeClassList() {
+	delete _classList;
+}
+
+CSaveableObject *CSaveableObject::createInstance(const Common::String &name) {
+	return (*_classList)[name]();
+}
+
+void CSaveableObject::proc4() {
+
+}
+
+void CSaveableObject::proc5() {
+
+}
+
+void CSaveableObject::proc6() {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/saveable_object.h b/engines/titanic/saveable_object.h
new file mode 100644
index 0000000..5253892
--- /dev/null
+++ b/engines/titanic/saveable_object.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SAVEABLE_OBJECT_H
+#define TITANIC_SAVEABLE_OBJECT_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "common/hash-str.h"
+
+namespace Titanic {
+
+class CSaveableObject {
+	typedef CSaveableObject *(*CreateFunction)();
+private:
+	static Common::HashMap<Common::String, CreateFunction> *_classList;
+public:
+	/**
+	 * Sets up the list of saveable object classes
+	 */
+	static void initClassList();
+
+	/**
+	 * Free the list of saveable object classes
+	 */
+	static void freeClassList();
+
+	/**
+	 * Creates a new instance of a saveable object class
+	 */
+	static CSaveableObject *createInstance(const Common::String &name);
+public:
+	virtual void proc4();
+	virtual void proc5();
+	virtual void proc6();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SAVEABLE_OBJECT_H */
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 9230717..c438c35 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -28,6 +28,7 @@
 #include "graphics/scaler.h"
 #include "graphics/thumbnail.h"
 #include "titanic/titanic.h"
+#include "titanic/saveable_object.h"
 
 namespace Titanic {
 
@@ -40,6 +41,7 @@ TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDe
 TitanicEngine::~TitanicEngine() {
 	delete _window;
 	delete _screenManager;
+	CSaveableObject::freeClassList();
 }
 
 void TitanicEngine::initialize() {
@@ -49,6 +51,7 @@ void TitanicEngine::initialize() {
 	DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
 	DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
 
+	CSaveableObject::initClassList();
 	_window = new CMainGameWindow(this);
 	_screenManager = new OSScreenManager();
 }
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 1265e70..2e51a9d 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -51,6 +51,7 @@ enum TitanicDebugChannels {
 #define TITANIC_SAVEGAME_VERSION 1
 
 struct TitanicGameDescription;
+class TitanicEngine;
 
 struct TitanicSavegameHeader {
 	uint8 _version;
@@ -61,6 +62,13 @@ struct TitanicSavegameHeader {
 	int _totalFrames;
 };
 
+class Manager {
+protected:
+	TitanicEngine *_vm;
+public:
+	Manager(TitanicEngine *vm) : _vm(vm) {}
+};
+
 class TitanicEngine : public Engine {
 private:
 	/**
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
new file mode 100644
index 0000000..d25e9da
--- /dev/null
+++ b/engines/titanic/video_surface.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/video_surface.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
new file mode 100644
index 0000000..259c5b0
--- /dev/null
+++ b/engines/titanic/video_surface.h
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_VIDEO_SURFACE_H
+#define TITANIC_VIDEO_SURFACE_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "titanic/font.h"
+
+namespace Titanic {
+
+class CVideoSurface {
+
+};
+
+class OSVideoSurface : CVideoSurface {
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_VIDEO_SURFACE_H */


Commit: 43d3b138caf423bf7e84f1d251489839c0a68023
    https://github.com/scummvm/scummvm/commit/43d3b138caf423bf7e84f1d251489839c0a68023
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-07T18:07:44-05:00

Commit Message:
TITANIC: Further setup of List class

Changed paths:
  R engines/titanic/list.cpp
    engines/titanic/list.h
    engines/titanic/module.mk
    engines/titanic/saveable_object.cpp



diff --git a/engines/titanic/list.cpp b/engines/titanic/list.cpp
deleted file mode 100644
index 2b6496f..0000000
--- a/engines/titanic/list.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/list.h"
-
-namespace Titanic {
-
-} // End of namespace Titanic
diff --git a/engines/titanic/list.h b/engines/titanic/list.h
index d94ccb9..0d3c62e 100644
--- a/engines/titanic/list.h
+++ b/engines/titanic/list.h
@@ -24,11 +24,16 @@
 #define TITANIC_LIST_H
 
 #include "common/scummsys.h"
+#include "common/list.h"
 #include "titanic/saveable_object.h"
 
 namespace Titanic {
 
-class List : public CSaveableObject {
+class ListItem: public CSaveableObject {
+};
+
+class List : public CSaveableObject, Common::List<ListItem *> {
+public:
 
 };
 
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index a2a7722..bc37fba 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -5,7 +5,6 @@ MODULE_OBJS := \
 	direct_draw.o \
 	font.o \
 	image.o \
-	list.o \
 	main_game_window.o \
 	saveable_object.o \
 	screen_manager.o \
diff --git a/engines/titanic/saveable_object.cpp b/engines/titanic/saveable_object.cpp
index c1b6612..8d0e75b 100644
--- a/engines/titanic/saveable_object.cpp
+++ b/engines/titanic/saveable_object.cpp
@@ -32,10 +32,12 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 #define ADDFN(T) (*_classList)["TEST"] = Function##T
 
 DEFFN(List);
+DEFFN(ListItem);
 
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
 	ADDFN(List);
+	ADDFN(ListItem);
 }
 
 void CSaveableObject::freeClassList() {


Commit: c9c85ee6223024b6102d76fad1b81d37240bb74c
    https://github.com/scummvm/scummvm/commit/c9c85ee6223024b6102d76fad1b81d37240bb74c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-07T23:25:34-05:00

Commit Message:
TITANIC: Adding screen initialization code

Changed paths:
    engines/titanic/direct_draw.cpp
    engines/titanic/direct_draw.h
    engines/titanic/font.cpp
    engines/titanic/font.h
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/direct_draw.cpp b/engines/titanic/direct_draw.cpp
index a79edf9..d503938 100644
--- a/engines/titanic/direct_draw.cpp
+++ b/engines/titanic/direct_draw.cpp
@@ -20,26 +20,79 @@
  *
  */
 
+#include "common/debug.h"
+#include "engines/util.h"
+#include "titanic/titanic.h"
 #include "titanic/direct_draw.h"
 
 namespace Titanic {
 
-DirectDraw::DirectDraw(TitanicEngine *vm) : Manager(vm) {
+DirectDraw::DirectDraw(TitanicEngine *vm) : _vm(vm) {
 	_field8 = 0;
 	_fieldC = 0;
 	_width = 0;
 	_height = 0;
 	_bpp = 0;
-	_field1C = 0;
+	_numBackSurfaces = 0;
 	_field24 = 0;
 }
 
+void DirectDraw::setDisplayMode(int width, int height, int bpp, int refreshRate) {
+	debugC(ERROR_BASIC, kDebugGraphics, "DirectDraw::SetDisplayMode (%d x %d), %d bpp",
+		width, height, bpp);
+	assert(bpp == 8);
+	initGraphics(width, height, true);
+}
+
+void DirectDraw::diagnostics() {
+	debugC(ERROR_BASIC, kDebugGraphics, "Running DirectDraw Diagnostic...");
+}
+
 /*------------------------------------------------------------------------*/
 
-DirectDrawManager::DirectDrawManager(TitanicEngine *vm) : 
-		Manager(vm), _directDraw(vm) {
+DirectDrawManager::DirectDrawManager(TitanicEngine *vm, int v) : _directDraw(vm) {
 	_mainSurface = nullptr;
 	_backSurfaces[0] = _backSurfaces[1] = nullptr;
+	_directDraw._field8 = v;
+}
+
+void DirectDrawManager::initVideo(int width, int height, int bpp, int numBackSurfaces) {
+	debugC(ERROR_BASIC, kDebugGraphics, "Initialising video surfaces");
+	_directDraw._width = width;
+	_directDraw._numBackSurfaces = numBackSurfaces;
+	_directDraw._height = height;
+	_directDraw._bpp = bpp;
+
+	if (numBackSurfaces) {
+		setResolution();
+	} else {
+		initSurface();
+	}
+}
+
+void DirectDrawManager::setResolution() {
+	// TODO
+}
+
+void DirectDrawManager::proc2() {
+
+}
+
+void DirectDrawManager::proc3() {
+
+}
+
+void DirectDrawManager::initSurface() {
+	debugC(ERROR_BASIC, kDebugGraphics, "Creating surfaces");
+	_directDraw.setDisplayMode(_directDraw._width, _directDraw._height,
+		_directDraw._bpp, 0);
+
+	_mainSurface = new Graphics::Surface();
+	_mainSurface->create(_directDraw._width, _directDraw._height,
+		Graphics::PixelFormat::createFormatCLUT8());
+	_backSurfaces[0] = new Graphics::Surface();
+	_backSurfaces[0]->create(_directDraw._width, _directDraw._height,
+		Graphics::PixelFormat::createFormatCLUT8());
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/direct_draw.h b/engines/titanic/direct_draw.h
index f88df71..cb49efa 100644
--- a/engines/titanic/direct_draw.h
+++ b/engines/titanic/direct_draw.h
@@ -25,30 +25,64 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
-#include "titanic/titanic.h"
+#include "graphics/surface.h"
 
 namespace Titanic {
 
-class DirectDraw: public Manager {
+class TitanicEngine;
+
+class DirectDraw {
+private:
+	TitanicEngine *_vm;
 public:
 	int _field8;
 	int _fieldC;
 	int _width;
 	int _height;
 	int _bpp;
-	int _field1C;
+	int _numBackSurfaces;
 	int _field24;
 public:
 	DirectDraw(TitanicEngine *vm);
+
+	/**
+	 * Sets a new display mode
+	 */
+	void setDisplayMode(int width, int height, int bpp, int refreshRate);
+
+	/**
+	 * Logs diagnostic information
+	 */
+	void diagnostics();
 };
 
-class DirectDrawManager: public Manager {
+class DirectDrawManager {
 public:
 	DirectDraw _directDraw;
-	void *_mainSurface;
-	void *_backSurfaces[2];
+	Graphics::Surface *_mainSurface;
+	Graphics::Surface *_backSurfaces[2];
 public:
-	DirectDrawManager(TitanicEngine *vm);
+	DirectDrawManager(TitanicEngine *vm, int v);
+
+	/**
+	 * Initializes video surfaces
+	 * @param width				Screen width
+	 * @param height			Screen height
+	 * @param bpp				Bits per pixel
+	 * @param numBackSurfaces	Number of back surfaces	
+	 */
+	void initVideo(int width, int height, int bpp, int numBackSurfaces);
+
+	void setResolution();
+
+	void proc2();
+
+	void proc3();
+
+	/**
+	 * Initializes the surface for the screen
+	 */
+	void initSurface();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/font.cpp b/engines/titanic/font.cpp
index 18f15ca..bb8f2e0 100644
--- a/engines/titanic/font.cpp
+++ b/engines/titanic/font.cpp
@@ -27,4 +27,8 @@ namespace Titanic {
 STFont::STFont() {
 }
 
+void STFont::load(int fontNumber) {
+	// TODO
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/font.h b/engines/titanic/font.h
index f0ea5e4..2948505 100644
--- a/engines/titanic/font.h
+++ b/engines/titanic/font.h
@@ -31,6 +31,8 @@ class STFont {
 public:
 public:
 	STFont();
+
+	void load(int fontNumber);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 6ee67ca6..61b6ff4 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/screen_manager.h"
+#include "titanic/video_surface.h"
 
 namespace Titanic {
 
@@ -33,11 +34,10 @@ CScreenManagerRec::CScreenManagerRec() {
 
 /*------------------------------------------------------------------------*/
 
-CScreenManager::CScreenManager() {
+CScreenManager::CScreenManager(TitanicEngine *vm): _vm(vm) {
 	_screenManagerPtr = nullptr;
 
-	_field4 = 0;
-	_fontRenderSurface = nullptr;
+	_frontRenderSurface = nullptr;
 	_mouseCursor = nullptr;
 	_textCursor = nullptr;
 	_fontNumber = 0;
@@ -47,31 +47,51 @@ CScreenManager::~CScreenManager() {
 	_screenManagerPtr = nullptr;
 }
 
-void CScreenManager::proc2(int v) {
-	if (v)
-		_field4 = v;
+void CScreenManager::setWindowHandle(int v) {
+	// Not needed
 }
 
-bool CScreenManager::proc3(int v) {
-	if (!v || _field4)
-		return false;
-
-	_field4 = 0;
+bool CScreenManager::resetWindowHandle(int v) {
 	proc27();
 	return true;
 }
 
 /*------------------------------------------------------------------------*/
 
-OSScreenManager::OSScreenManager(): CScreenManager() {
+OSScreenManager::OSScreenManager(TitanicEngine *vm): CScreenManager(vm),
+		_directDrawManager(vm, 0) {
 	_field48 = 0;
 	_field4C = 0;
 	_field50 = 0;
 	_field54 = 0;
-	_directDrawManager = nullptr;
 }
 
-void OSScreenManager::setMode() {}
+OSScreenManager::~OSScreenManager() {
+	destroyFrontAndBackBuffers();
+}
+
+void OSScreenManager::setMode(int width, int height, int bpp, int numBackSurfaces, bool flag2) {
+	destroyFrontAndBackBuffers();
+	_directDrawManager.initVideo(width, height, bpp, numBackSurfaces);
+
+	_frontRenderSurface = new OSVideoSurface(this, nullptr);
+	_frontRenderSurface->setSurface(this, _directDrawManager._mainSurface);
+
+	for (uint idx = 0; idx < numBackSurfaces; ++idx) {
+		OSVideoSurface videoSurface(this, nullptr);
+		videoSurface.setSurface(this, _directDrawManager._backSurfaces[idx]);
+	}
+
+	// Load fonts
+	_fonts[0].load(149);
+	_fonts[1].load(151);
+	_fonts[2].load(152);
+	_fonts[3].load(153);
+
+	// Load the cursors
+	loadCursors();
+}
+
 void OSScreenManager::proc5() {}
 void OSScreenManager::proc6() {}
 void OSScreenManager::proc7() {}
@@ -96,4 +116,17 @@ void OSScreenManager::proc25() {}
 void OSScreenManager::showCursor() {}
 void OSScreenManager::proc27() {}
 
+void OSScreenManager::destroyFrontAndBackBuffers() {
+	delete _frontRenderSurface;
+	_frontRenderSurface = nullptr;
+
+	for (uint idx = 0; idx < _backSurfaces.size(); ++idx)
+		delete _backSurfaces[idx];
+	_backSurfaces.clear();
+}
+
+void OSScreenManager::loadCursors() {
+	// TODO
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index b30b7a0..4647c71 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -25,10 +25,14 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
+#include "titanic/direct_draw.h"
 #include "titanic/font.h"
+#include "titanic/video_surface.h"
 
 namespace Titanic {
 
+class TitanicEngine;
+
 class CSurface {
 };
 
@@ -43,26 +47,27 @@ public:
 };
 
 class CScreenManager {
+protected:
+	TitanicEngine *_vm;
 public:
 	void *_screenManagerPtr;
 public:
-	int _field4;
-	Common::Array<CSurface> _backSurfaces;
-	CSurface *_fontRenderSurface;
+	Common::Array<CVideoSurface *> _backSurfaces;
+	CVideoSurface *_frontRenderSurface;
 	CScreenManagerRec _entries[2];
 	void *_mouseCursor;
 	void *_textCursor;
 	int _fontNumber;
 public:
-	CScreenManager();
+	CScreenManager(TitanicEngine *vm);
 	virtual ~CScreenManager();
 
 	void fn1() {}
 	void fn2() {}
 
-	virtual void proc2(int v);
-	virtual bool proc3(int v);
-	virtual void setMode() = 0;
+	virtual void setWindowHandle(int v);
+	virtual bool resetWindowHandle(int v);
+	virtual void setMode(int width, int height, int bpp, int numBackSurfaces, bool flag2) = 0;
 	virtual void proc5() = 0;
 	virtual void proc6() = 0;
 	virtual void proc7() = 0;
@@ -89,17 +94,29 @@ public:
 };
 
 class OSScreenManager: CScreenManager {
+private:
+	DirectDrawManager _directDrawManager;
+
+	/**
+	 * Frees any surface buffers
+	 */
+	void destroyFrontAndBackBuffers();
+
+	/**
+	 * Load game cursors
+	 */
+	void loadCursors();
 public:
 	int _field48;
 	int _field4C;
 	int _field50;
 	int _field54;
-	void *_directDrawManager;
 	STFont _fonts[4];
 public:
-	OSScreenManager();
+	OSScreenManager(TitanicEngine *vm);
+	virtual ~OSScreenManager();
 
-	virtual void setMode();
+	virtual void setMode(int width, int height, int bpp, int numBackSurfaces, bool flag2);
 	virtual void proc5();
 	virtual void proc6();
 	virtual void proc7();
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index c438c35..d64577c 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -53,7 +53,7 @@ void TitanicEngine::initialize() {
 
 	CSaveableObject::initClassList();
 	_window = new CMainGameWindow(this);
-	_screenManager = new OSScreenManager();
+	_screenManager = new OSScreenManager(this);
 }
 
 Common::Error TitanicEngine::run() {
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 2e51a9d..ec0585c 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -50,6 +50,10 @@ enum TitanicDebugChannels {
 
 #define TITANIC_SAVEGAME_VERSION 1
 
+#define ERROR_BASIC 1
+#define ERROR_INTERMEDIATE 2
+#define ERROR_DETAILED 3
+
 struct TitanicGameDescription;
 class TitanicEngine;
 
@@ -62,13 +66,6 @@ struct TitanicSavegameHeader {
 	int _totalFrames;
 };
 
-class Manager {
-protected:
-	TitanicEngine *_vm;
-public:
-	Manager(TitanicEngine *vm) : _vm(vm) {}
-};
-
 class TitanicEngine : public Engine {
 private:
 	/**
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index d25e9da..d03e2f4 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -24,4 +24,19 @@
 
 namespace Titanic {
 
+CVideoSurface::CVideoSurface(CScreenManager *screenManager, Graphics::Surface *surface):
+			_screenManager(screenManager), _surface(surface) {
+}
+
+void CVideoSurface::setSurface(CScreenManager *screenManager, Graphics::Surface *surface) {
+	_screenManager = screenManager;
+	_surface = surface;
+}
+
+/*------------------------------------------------------------------------*/
+
+OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, Graphics::Surface *surface):
+		CVideoSurface(screenManager, surface) {
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 259c5b0..978eacf 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -25,16 +25,26 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
+#include "graphics/surface.h"
 #include "titanic/font.h"
 
 namespace Titanic {
 
+class CScreenManager;
+
 class CVideoSurface {
+private:
+	CScreenManager *_screenManager;
+	Graphics::Surface *_surface;
+public:
+	CVideoSurface(CScreenManager *screenManager, Graphics::Surface *surface);
 
+	void setSurface(CScreenManager *screenManager, Graphics::Surface *surface);
 };
 
-class OSVideoSurface : CVideoSurface {
-
+class OSVideoSurface : public CVideoSurface {
+public:
+	OSVideoSurface(CScreenManager *screenManager, Graphics::Surface *surface);
 };
 
 } // End of namespace Titanic


Commit: 3f59b21c3bb6c22bbf0a642bb0d10726af1c85ab
    https://github.com/scummvm/scummvm/commit/3f59b21c3bb6c22bbf0a642bb0d10726af1c85ab
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-14T11:55:59-05:00

Commit Message:
TITANIC: Implement SimpleFile class

Changed paths:
  A engines/titanic/files.cpp
  A engines/titanic/files.h
  A engines/titanic/string.cpp
  A engines/titanic/string.h
    engines/titanic/module.mk



diff --git a/engines/titanic/files.cpp b/engines/titanic/files.cpp
new file mode 100644
index 0000000..814746e
--- /dev/null
+++ b/engines/titanic/files.cpp
@@ -0,0 +1,167 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/files.h"
+#include "common/util.h"
+
+namespace Titanic {
+
+SimpleFile::SimpleFile() {
+}
+
+void SimpleFile::open(const Common::String &name, FileMode mode) {
+	assert(mode == FILE_READ);
+	if (!_file.open(name))
+		error("Could not find file - %s", name.c_str());
+}
+
+void SimpleFile::close() {
+	_file.close();
+}
+
+void SimpleFile::safeRead(void *dst, size_t count) {
+	if (_file.read(dst, count) != count)
+		error("Could not read %d bytes", count);
+}
+
+int SimpleFile::unsafeRead(void *dst, size_t count) {
+	return _file.read(dst, count);
+}
+
+CString SimpleFile::readString() {
+	char c;
+	CString result;
+	bool backslashFlag = false;
+
+	// First skip any spaces
+	do {
+		safeRead(&c, 1);
+	} while (Common::isSpace(c));
+
+	// Ensure we've found a starting quote for the string
+	if (c != '"')
+		error("Could not find starting quote");
+
+	bool endFlag = false;
+	while (!endFlag) {
+		// Read the next character
+		safeRead(&c, 1);
+
+		if (backslashFlag) {
+			backslashFlag = false;
+			switch (c) {
+			case 'n':
+				result += '\n';
+				break;
+			case 'r':
+				result += '\r';
+				break;
+			case '\t':
+				result += '\t';
+				break;
+			default:
+				result += c;
+				break;
+			}
+		} else {
+			switch (c) {
+			case '"':
+				endFlag = true;
+				break;
+			case '\\':
+				backslashFlag = true;
+				break;
+			default:
+				result += c;
+				break;
+			}
+		}
+	}
+
+	// Return the string
+	return result;
+}
+
+int SimpleFile::readNumber() {
+	char c;
+	int result = 0;
+	bool minusFlag = false;
+
+	// First skip any spaces
+	do {
+		safeRead(&c, 1);
+	} while (Common::isSpace(c));
+
+	// Check for prefix sign
+	if (c == '+' || c == '-') {
+		minusFlag = c == '-';
+		safeRead(&c, 1);
+	}
+
+	// Read in the number
+	if (!Common::isDigit(c))
+		error("Invalid number");
+
+	while (Common::isDigit(c)) {
+		result = result * 10 + (c - '0');
+		safeRead(&c, 1);
+	}
+
+	// Finally, if it's a minus value, then negate it
+	if (minusFlag)
+		result = -result;
+
+	return result;
+}
+
+double SimpleFile::readFloat() {
+	char c;
+	Common::String result;
+
+	// First skip any spaces
+	do {
+		safeRead(&c, 1);
+	} while (Common::isSpace(c));
+
+	// Check for prefix sign
+	if (c == '+' || c == '-') {
+		result += c;
+		safeRead(&c, 1);
+	}
+
+	// Read in the number
+	if (!Common::isDigit(c))
+		error("Invalid number");
+
+	while (Common::isDigit(c) || c == '.') {
+		result += c;
+		safeRead(&c, 1);
+	}
+
+	// Convert to a float and return it
+	float floatValue;
+	sscanf(result.c_str(), "%f", &floatValue);
+
+	return floatValue;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/files.h b/engines/titanic/files.h
new file mode 100644
index 0000000..d8810dc
--- /dev/null
+++ b/engines/titanic/files.h
@@ -0,0 +1,82 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FILES_H
+#define TITANIC_FILES_H
+
+#include "common/scummsys.h"
+#include "common/file.h"
+#include "titanic/string.h"
+
+namespace Titanic {
+
+enum FileMode { FILE_READ = 1, FILE_WRITE = 2 };
+
+class SimpleFile {
+public:
+	Common::File _file;
+public:
+	SimpleFile();
+
+	/**
+	 * Open a file for access
+	 */
+	virtual void open(const Common::String &name, FileMode mode = FILE_READ);
+
+	/**
+	 * Close the file
+	 */
+	virtual void close();
+
+	/**
+	 * Read from the file with validation
+	 */
+	virtual void safeRead(void *dst, size_t count);
+
+	/**
+	 * Read from the file
+	 */
+	virtual int unsafeRead(void *dst, size_t count);
+
+	/**
+	 * Read a string from the file
+	 */
+	virtual CString readString();
+
+	/**
+	 * Read a number from the file
+	 */
+	virtual int readNumber();
+
+	/**
+	 * Read a floating point number from the file
+	 */
+	virtual double readFloat();
+};
+
+class CompressedFile : public SimpleFile {
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FILES_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index bc37fba..d65459d 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -3,11 +3,13 @@ MODULE := engines/titanic
 MODULE_OBJS := \
 	detection.o \
 	direct_draw.o \
+	files.o \
 	font.o \
 	image.o \
 	main_game_window.o \
 	saveable_object.o \
 	screen_manager.o \
+	string.o \
 	titanic.o \
 	video_surface.o
 
diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp
new file mode 100644
index 0000000..cdc251d
--- /dev/null
+++ b/engines/titanic/string.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/files.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/string.h b/engines/titanic/string.h
new file mode 100644
index 0000000..9b8cca0
--- /dev/null
+++ b/engines/titanic/string.h
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STRING_H
+#define TITANIC_STRING_H
+
+#include "common/scummsys.h"
+#include "common/str.h"
+
+namespace Titanic {
+
+class CString : public Common::String {
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STRING_H */


Commit: 84c24b08079bc787e17995868fdd426f0a58d3da
    https://github.com/scummvm/scummvm/commit/84c24b08079bc787e17995868fdd426f0a58d3da
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-14T17:44:53-05:00

Commit Message:
TITANIC: Beginnings of CompressedFile class

Changed paths:
    engines/titanic/files.cpp
    engines/titanic/files.h



diff --git a/engines/titanic/files.cpp b/engines/titanic/files.cpp
index 814746e..a49c47a 100644
--- a/engines/titanic/files.cpp
+++ b/engines/titanic/files.cpp
@@ -28,6 +28,10 @@ namespace Titanic {
 SimpleFile::SimpleFile() {
 }
 
+SimpleFile::~SimpleFile() {
+	_file.close();
+}
+
 void SimpleFile::open(const Common::String &name, FileMode mode) {
 	assert(mode == FILE_READ);
 	if (!_file.open(name))
@@ -39,11 +43,12 @@ void SimpleFile::close() {
 }
 
 void SimpleFile::safeRead(void *dst, size_t count) {
-	if (_file.read(dst, count) != count)
+	assert(_file.isOpen());
+	if (unsafeRead(dst, count) != count)
 		error("Could not read %d bytes", count);
 }
 
-int SimpleFile::unsafeRead(void *dst, size_t count) {
+size_t SimpleFile::unsafeRead(void *dst, size_t count) {
 	return _file.read(dst, count);
 }
 
@@ -164,4 +169,74 @@ double SimpleFile::readFloat() {
 	return floatValue;
 }
 
+/*------------------------------------------------------------------------*/
+
+CompressedFile::CompressedFile() : SimpleFile() {
+	_field48 = 0;
+	_isReading = 0;
+	_field260 = 0;
+	_mode = 0;
+}
+
+CompressedFile::~CompressedFile() {
+}
+
+void CompressedFile::open(const Common::String &name, FileMode mode) {
+	SimpleFile::open(name, mode);
+
+	if (mode == FILE_READ) {
+		validate(&_mode, "1.0.4", 0x38);
+		_field48 = 2;
+	} else if (mode == FILE_WRITE) {
+		validate(&_mode, "1.0.4", 0x38);
+	}
+}
+void CompressedFile::close() {
+	_queue.clear();
+	SimpleFile::close();
+}
+
+size_t CompressedFile::unsafeRead(void *dst, size_t count) {
+	assert(_file.isOpen());
+	if (count == 0)
+		return 0;
+
+	// Ensure there's enough data queued in the buffer
+	decompress();
+
+	// Pass the data to the output buffer
+	size_t bytesRead = 0;
+	byte *dataPtr = (byte *)dst;
+
+	while (count > 0) {
+		if (_queue.empty()) {
+			decompress();
+
+		}
+
+		*dataPtr++ = _queue.pop();
+		++bytesRead;
+		--count;
+	}
+
+	return bytesRead;
+}
+
+void CompressedFile::validate(int *mode, const char *version, int v3) {
+	validate2(mode, 15, version, v3);
+}
+
+int CompressedFile::validate2(int *mode, int v15, const char *version, int v3) {
+	if (!version || *version != '1' || v3 != 0x38)
+		return -6;
+	if (!mode)
+		return -2;
+
+	// TODO
+}
+
+void CompressedFile::decompress() {
+
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/files.h b/engines/titanic/files.h
index d8810dc..a1fb741 100644
--- a/engines/titanic/files.h
+++ b/engines/titanic/files.h
@@ -25,6 +25,7 @@
 
 #include "common/scummsys.h"
 #include "common/file.h"
+#include "common/queue.h"
 #include "titanic/string.h"
 
 namespace Titanic {
@@ -32,10 +33,11 @@ namespace Titanic {
 enum FileMode { FILE_READ = 1, FILE_WRITE = 2 };
 
 class SimpleFile {
-public:
+protected:
 	Common::File _file;
 public:
 	SimpleFile();
+	virtual ~SimpleFile();
 
 	/**
 	 * Open a file for access
@@ -55,7 +57,7 @@ public:
 	/**
 	 * Read from the file
 	 */
-	virtual int unsafeRead(void *dst, size_t count);
+	virtual size_t unsafeRead(void *dst, size_t count);
 
 	/**
 	 * Read a string from the file
@@ -74,7 +76,39 @@ public:
 };
 
 class CompressedFile : public SimpleFile {
+private:
+	Common::Queue<byte> _queue;
+	int _field48;
+	int _isReading;
+	int _field260;
+	int _mode;
+
+	/**
+	 * Decompress data from the source file
+	 */
+	void decompress();
+
+	void validate(int *mode, const char *version, int v3);
+
+	int validate2(int *mode, int v15, const char *version, int v3);
+public:
+	CompressedFile();
+	virtual ~CompressedFile();
+
+	/**
+	 * Open a file for access
+	 */
+	virtual void open(const Common::String &name, FileMode mode = FILE_READ);
+
+	/**
+	 * Close the file
+	 */
+	virtual void close();
 
+	/**
+	 * Read from the file
+	 */
+	virtual size_t unsafeRead(void *dst, size_t count);
 };
 
 } // End of namespace Titanic


Commit: 2753998868fe9f456b87f87a786fb5d58fb2c232
    https://github.com/scummvm/scummvm/commit/2753998868fe9f456b87f87a786fb5d58fb2c232
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-15T16:17:38-05:00

Commit Message:
TITANIC: Work on decompressor

Changed paths:
    engines/titanic/files.cpp
    engines/titanic/files.h



diff --git a/engines/titanic/files.cpp b/engines/titanic/files.cpp
index a49c47a..6432595 100644
--- a/engines/titanic/files.cpp
+++ b/engines/titanic/files.cpp
@@ -171,8 +171,79 @@ double SimpleFile::readFloat() {
 
 /*------------------------------------------------------------------------*/
 
+DecompressorData::DecompressorData() {
+	_field0 = 0;
+	_field4 = 0;
+	_field8 = 0;
+	_fieldC = 0;
+	_field10 = 0;
+	_field14 = 0;
+}
+
+/*------------------------------------------------------------------------*/
+
+Decompressor::Decompressor() {
+	_createFn = nullptr;
+	_destroyFn = nullptr;
+	_field18 = 0;
+	_dataPtr = nullptr;
+	_field28 = 0;
+}
+
+void Decompressor::load(const char *version, int v) {
+	if (!version || *version != '1')
+		error("Bad version");
+	
+	_field18 = 0;
+	if (!_createFn) {
+		_createFn = &Decompressor::createMethod;
+		_field28 = 0;
+	}
+
+	if (!_destroyFn) {
+		_destroyFn = &Decompressor::destroyMethod;
+	}
+
+	_dataPtr = (this->*_createFn)(_field28, 1, 24);
+	_dataPtr->_field14 = 0;
+	_dataPtr->_fieldC = 0;
+	if (v < 0) {
+		v = -v;
+		_dataPtr->_fieldC = 1;
+	}
+
+	if (v < 8 || v > 15)
+		error("Bad parameter");
+
+	_dataPtr->_field10 = v;
+	_dataPtr->_field14 = sub1(_dataPtr->_fieldC ? nullptr : &Decompressor::method3, 1 << v);
+
+	if (_dataPtr->_field14)
+		sub2();
+	else
+		close();
+}
+
+int Decompressor::sub1(Method3Fn fn, int v) {
+
+}
+
+void Decompressor::close() {
+
+}
+
+DecompressorData *Decompressor::createMethod(int v1, int v2, int v3) {
+	return new DecompressorData();
+}
+
+void Decompressor::destroyMethod(DecompressorData *ptr) {
+	delete ptr;
+}
+
+/*------------------------------------------------------------------------*/
+
 CompressedFile::CompressedFile() : SimpleFile() {
-	_field48 = 0;
+	_fileMode = 0;
 	_isReading = 0;
 	_field260 = 0;
 	_mode = 0;
@@ -185,10 +256,11 @@ void CompressedFile::open(const Common::String &name, FileMode mode) {
 	SimpleFile::open(name, mode);
 
 	if (mode == FILE_READ) {
-		validate(&_mode, "1.0.4", 0x38);
-		_field48 = 2;
+		_decompressor.load();
+		_fileMode = 2;
 	} else if (mode == FILE_WRITE) {
-		validate(&_mode, "1.0.4", 0x38);
+		_decompressor.load();
+		_fileMode = 1;
 	}
 }
 void CompressedFile::close() {
@@ -211,7 +283,8 @@ size_t CompressedFile::unsafeRead(void *dst, size_t count) {
 	while (count > 0) {
 		if (_queue.empty()) {
 			decompress();
-
+			if (_queue.empty())
+				break;
 		}
 
 		*dataPtr++ = _queue.pop();
@@ -222,19 +295,6 @@ size_t CompressedFile::unsafeRead(void *dst, size_t count) {
 	return bytesRead;
 }
 
-void CompressedFile::validate(int *mode, const char *version, int v3) {
-	validate2(mode, 15, version, v3);
-}
-
-int CompressedFile::validate2(int *mode, int v15, const char *version, int v3) {
-	if (!version || *version != '1' || v3 != 0x38)
-		return -6;
-	if (!mode)
-		return -2;
-
-	// TODO
-}
-
 void CompressedFile::decompress() {
 
 }
diff --git a/engines/titanic/files.h b/engines/titanic/files.h
index a1fb741..1689f39 100644
--- a/engines/titanic/files.h
+++ b/engines/titanic/files.h
@@ -32,6 +32,9 @@ namespace Titanic {
 
 enum FileMode { FILE_READ = 1, FILE_WRITE = 2 };
 
+class Decompressor;
+class DecompressorData;
+
 class SimpleFile {
 protected:
 	Common::File _file;
@@ -75,10 +78,54 @@ public:
 	virtual double readFloat();
 };
 
+typedef DecompressorData *(Decompressor::*DecompressorCreateFn)(int v1, int v2, int v3);
+typedef void(Decompressor::*DecompressorDestroyFn)(DecompressorData *ptr);
+typedef void(Decompressor::*Method3Fn)();
+
+class DecompressorData {
+public:
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+public:
+	DecompressorData();
+};
+
+class Decompressor {
+private:
+	DecompressorCreateFn _createFn;
+	DecompressorDestroyFn _destroyFn;
+	int _field18;
+	DecompressorData *_dataPtr;
+	int _field28;
+
+	DecompressorData *createMethod(int v1, int v2, int v3);
+
+	void destroyMethod(DecompressorData *ptr);
+
+	void method3() {
+		// TODO
+	}
+
+	int sub1(Method3Fn fn, int v);
+
+	void sub2();
+public:
+	Decompressor();
+
+	void load(const char *version = "1.0.4", int v = 15);
+
+	void close();
+};
+
 class CompressedFile : public SimpleFile {
 private:
+	Decompressor _decompressor;
 	Common::Queue<byte> _queue;
-	int _field48;
+	int _fileMode;
 	int _isReading;
 	int _field260;
 	int _mode;
@@ -87,10 +134,6 @@ private:
 	 * Decompress data from the source file
 	 */
 	void decompress();
-
-	void validate(int *mode, const char *version, int v3);
-
-	int validate2(int *mode, int v15, const char *version, int v3);
 public:
 	CompressedFile();
 	virtual ~CompressedFile();


Commit: 1e4de9a3232127f72c7d832548343699aa1088cc
    https://github.com/scummvm/scummvm/commit/1e4de9a3232127f72c7d832548343699aa1088cc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-18T19:29:13-05:00

Commit Message:
TITANIC: Starting to create classes for project item hierarchy

Changed paths:
  A engines/titanic/objects/file_item.cpp
  A engines/titanic/objects/file_item.h
  A engines/titanic/objects/message_target.cpp
  A engines/titanic/objects/message_target.h
  A engines/titanic/objects/project_item.cpp
  A engines/titanic/objects/project_item.h
  A engines/titanic/objects/saveable_object.cpp
  A engines/titanic/objects/saveable_object.h
  A engines/titanic/objects/tree_item.cpp
  A engines/titanic/objects/tree_item.h
  R engines/titanic/saveable_object.cpp
  R engines/titanic/saveable_object.h
    engines/titanic/files.cpp
    engines/titanic/files.h
    engines/titanic/list.h
    engines/titanic/module.mk
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/files.cpp b/engines/titanic/files.cpp
index 6432595..2f5b1b5 100644
--- a/engines/titanic/files.cpp
+++ b/engines/titanic/files.cpp
@@ -25,7 +25,7 @@
 
 namespace Titanic {
 
-SimpleFile::SimpleFile() {
+SimpleFile::SimpleFile(): _stream(nullptr) {
 }
 
 SimpleFile::~SimpleFile() {
@@ -38,18 +38,24 @@ void SimpleFile::open(const Common::String &name, FileMode mode) {
 		error("Could not find file - %s", name.c_str());
 }
 
+void SimpleFile::open(Common::SeekableReadStream *stream, FileMode mode) {
+	close();
+	_stream = stream;
+}
+
 void SimpleFile::close() {
 	_file.close();
+	_stream = nullptr;
 }
 
 void SimpleFile::safeRead(void *dst, size_t count) {
-	assert(_file.isOpen());
+	assert(_stream);
 	if (unsafeRead(dst, count) != count)
 		error("Could not read %d bytes", count);
 }
 
 size_t SimpleFile::unsafeRead(void *dst, size_t count) {
-	return _file.read(dst, count);
+	return _stream->read(dst, count);
 }
 
 CString SimpleFile::readString() {
@@ -225,7 +231,7 @@ void Decompressor::load(const char *version, int v) {
 }
 
 int Decompressor::sub1(Method3Fn fn, int v) {
-
+	return 0;
 }
 
 void Decompressor::close() {
@@ -263,6 +269,19 @@ void CompressedFile::open(const Common::String &name, FileMode mode) {
 		_fileMode = 1;
 	}
 }
+
+void CompressedFile::open(Common::SeekableReadStream *stream, FileMode mode) {
+	SimpleFile::open(stream, mode);
+
+	if (mode == FILE_READ) {
+		_decompressor.load();
+		_fileMode = 2;
+	} else if (mode == FILE_WRITE) {
+		_decompressor.load();
+		_fileMode = 1;
+	}
+}
+
 void CompressedFile::close() {
 	_queue.clear();
 	SimpleFile::close();
diff --git a/engines/titanic/files.h b/engines/titanic/files.h
index 1689f39..0f72f60 100644
--- a/engines/titanic/files.h
+++ b/engines/titanic/files.h
@@ -38,6 +38,7 @@ class DecompressorData;
 class SimpleFile {
 protected:
 	Common::File _file;
+	Common::SeekableReadStream *_stream;
 public:
 	SimpleFile();
 	virtual ~SimpleFile();
@@ -48,6 +49,11 @@ public:
 	virtual void open(const Common::String &name, FileMode mode = FILE_READ);
 
 	/**
+	 * Set up a stream for access
+	 */
+	virtual void open(Common::SeekableReadStream *stream, FileMode mode = FILE_READ);
+
+	/**
 	 * Close the file
 	 */
 	virtual void close();
@@ -144,6 +150,11 @@ public:
 	virtual void open(const Common::String &name, FileMode mode = FILE_READ);
 
 	/**
+	 * Set up a stream for access
+	 */
+	virtual void open(Common::SeekableReadStream *stream, FileMode mode = FILE_READ);
+
+	/**
 	 * Close the file
 	 */
 	virtual void close();
diff --git a/engines/titanic/list.h b/engines/titanic/list.h
index 0d3c62e..bea3776 100644
--- a/engines/titanic/list.h
+++ b/engines/titanic/list.h
@@ -25,7 +25,7 @@
 
 #include "common/scummsys.h"
 #include "common/list.h"
-#include "titanic/saveable_object.h"
+#include "titanic/objects/saveable_object.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index d65459d..6cb4fc1 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -7,11 +7,15 @@ MODULE_OBJS := \
 	font.o \
 	image.o \
 	main_game_window.o \
-	saveable_object.o \
 	screen_manager.o \
 	string.o \
 	titanic.o \
-	video_surface.o
+	video_surface.o \
+	objects/file_item.o \
+	objects/message_target.o \
+	objects/project_item.o \
+	objects/saveable_object.o \
+	objects/tree_item.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/objects/file_item.cpp b/engines/titanic/objects/file_item.cpp
new file mode 100644
index 0000000..d49df71
--- /dev/null
+++ b/engines/titanic/objects/file_item.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/file_item.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/file_item.h b/engines/titanic/objects/file_item.h
new file mode 100644
index 0000000..133421a
--- /dev/null
+++ b/engines/titanic/objects/file_item.h
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FILE_ITEM_H
+#define TITANIC_FILE_ITEM_H
+
+#include "titanic/objects/tree_item.h"
+
+namespace Titanic {
+
+class CFileItem: public CTreeItem {
+public:
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FILE_ITEM_H */
diff --git a/engines/titanic/objects/message_target.cpp b/engines/titanic/objects/message_target.cpp
new file mode 100644
index 0000000..1e727a3
--- /dev/null
+++ b/engines/titanic/objects/message_target.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/message_target.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/message_target.h b/engines/titanic/objects/message_target.h
new file mode 100644
index 0000000..6afd709
--- /dev/null
+++ b/engines/titanic/objects/message_target.h
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MESSAGE_TARGET_H
+#define TITANIC_MESSAGE_TARGET_H
+
+#include "titanic/objects/saveable_object.h"
+
+namespace Titanic {
+
+class CMessageTarget: public CSaveableObject {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MESSAGE_TARGET_H */
diff --git a/engines/titanic/objects/project_item.cpp b/engines/titanic/objects/project_item.cpp
new file mode 100644
index 0000000..80596ec
--- /dev/null
+++ b/engines/titanic/objects/project_item.cpp
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/savefile.h"
+#include "titanic/titanic.h"
+#include "titanic/files.h"
+#include "titanic/objects/project_item.h"
+
+namespace Titanic {
+
+void CProjectItem::load(int id) {
+	CompressedFile file;
+	Common::InSaveFile *saveFile = nullptr;
+
+	// Clear any existing project contents
+	clear();
+
+	// Open either an existing savegame slot or the new game template
+	if (id > 0) {
+		saveFile = g_system->getSavefileManager()->openForLoading(
+			Common::String::format("slot%d.gam", id));
+		file.open(saveFile);
+	} else {
+		file.open("newgame.st");
+	}
+
+	// Load the contents in
+	loadData(file);
+
+	file.close();
+}
+
+void CProjectItem::clear() {
+
+}
+
+void CProjectItem::loadData(SimpleFile &file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/project_item.h b/engines/titanic/objects/project_item.h
new file mode 100644
index 0000000..2856f42
--- /dev/null
+++ b/engines/titanic/objects/project_item.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PROJECT_ITEM_H
+#define TITANIC_PROJECT_ITEM_H
+
+#include "common/scummsys.h"
+#include "titanic/files.h"
+#include "titanic/objects/file_item.h"
+
+namespace Titanic {
+
+class CProjectItem : public CFileItem {
+private:
+	/**
+	 * Load project data from the passed file
+	 */
+	void loadData(SimpleFile &file);
+public:
+	/**
+	 * Load the entire project data for a given Id
+	 */
+	void load(int id);
+
+	/**
+	 * Clear any currently loaded project
+	 */
+	void clear();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PROJECT_ITEM_H */
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
new file mode 100644
index 0000000..b2384a5
--- /dev/null
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -0,0 +1,75 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/saveable_object.h"
+#include "titanic/objects/file_item.h"
+#include "titanic/objects/message_target.h"
+#include "titanic/objects/project_item.h"
+#include "titanic/objects/tree_item.h"
+#include "titanic/list.h"
+
+namespace Titanic {
+
+Common::HashMap<Common::String, CSaveableObject::CreateFunction> * 
+	CSaveableObject::_classList = nullptr;
+
+#define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
+#define ADDFN(T) (*_classList)["TEST"] = Function##T
+
+DEFFN(List);
+DEFFN(ListItem);
+DEFFN(CMessageTarget);
+DEFFN(CTreeItem);
+DEFFN(CFileItem);
+DEFFN(CProjectItem);
+
+void CSaveableObject::initClassList() {
+	_classList = new Common::HashMap<Common::String, CreateFunction>();
+	ADDFN(List);
+	ADDFN(ListItem);
+	ADDFN(CMessageTarget);
+	ADDFN(CTreeItem);
+	ADDFN(CFileItem);
+	ADDFN(CProjectItem);
+}
+
+void CSaveableObject::freeClassList() {
+	delete _classList;
+}
+
+CSaveableObject *CSaveableObject::createInstance(const Common::String &name) {
+	return (*_classList)[name]();
+}
+
+void CSaveableObject::proc4() {
+
+}
+
+void CSaveableObject::proc5() {
+
+}
+
+void CSaveableObject::proc6() {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/saveable_object.h b/engines/titanic/objects/saveable_object.h
new file mode 100644
index 0000000..5253892
--- /dev/null
+++ b/engines/titanic/objects/saveable_object.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SAVEABLE_OBJECT_H
+#define TITANIC_SAVEABLE_OBJECT_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "common/hash-str.h"
+
+namespace Titanic {
+
+class CSaveableObject {
+	typedef CSaveableObject *(*CreateFunction)();
+private:
+	static Common::HashMap<Common::String, CreateFunction> *_classList;
+public:
+	/**
+	 * Sets up the list of saveable object classes
+	 */
+	static void initClassList();
+
+	/**
+	 * Free the list of saveable object classes
+	 */
+	static void freeClassList();
+
+	/**
+	 * Creates a new instance of a saveable object class
+	 */
+	static CSaveableObject *createInstance(const Common::String &name);
+public:
+	virtual void proc4();
+	virtual void proc5();
+	virtual void proc6();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SAVEABLE_OBJECT_H */
diff --git a/engines/titanic/objects/tree_item.cpp b/engines/titanic/objects/tree_item.cpp
new file mode 100644
index 0000000..06128ce
--- /dev/null
+++ b/engines/titanic/objects/tree_item.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/tree_item.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/tree_item.h b/engines/titanic/objects/tree_item.h
new file mode 100644
index 0000000..170a0e9
--- /dev/null
+++ b/engines/titanic/objects/tree_item.h
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TREE_ITEM_H
+#define TITANIC_TREE_ITEM_H
+
+#include "titanic/objects/message_target.h"
+
+namespace Titanic {
+
+class CTreeItem: public CMessageTarget {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TREE_ITEM_H */
diff --git a/engines/titanic/saveable_object.cpp b/engines/titanic/saveable_object.cpp
deleted file mode 100644
index 8d0e75b..0000000
--- a/engines/titanic/saveable_object.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/saveable_object.h"
-#include "titanic/list.h"
-
-namespace Titanic {
-
-Common::HashMap<Common::String, CSaveableObject::CreateFunction> * 
-	CSaveableObject::_classList = nullptr;
-
-#define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
-#define ADDFN(T) (*_classList)["TEST"] = Function##T
-
-DEFFN(List);
-DEFFN(ListItem);
-
-void CSaveableObject::initClassList() {
-	_classList = new Common::HashMap<Common::String, CreateFunction>();
-	ADDFN(List);
-	ADDFN(ListItem);
-}
-
-void CSaveableObject::freeClassList() {
-	delete _classList;
-}
-
-CSaveableObject *CSaveableObject::createInstance(const Common::String &name) {
-	return (*_classList)[name]();
-}
-
-void CSaveableObject::proc4() {
-
-}
-
-void CSaveableObject::proc5() {
-
-}
-
-void CSaveableObject::proc6() {
-
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/saveable_object.h b/engines/titanic/saveable_object.h
deleted file mode 100644
index 5253892..0000000
--- a/engines/titanic/saveable_object.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_SAVEABLE_OBJECT_H
-#define TITANIC_SAVEABLE_OBJECT_H
-
-#include "common/scummsys.h"
-#include "common/array.h"
-#include "common/hash-str.h"
-
-namespace Titanic {
-
-class CSaveableObject {
-	typedef CSaveableObject *(*CreateFunction)();
-private:
-	static Common::HashMap<Common::String, CreateFunction> *_classList;
-public:
-	/**
-	 * Sets up the list of saveable object classes
-	 */
-	static void initClassList();
-
-	/**
-	 * Free the list of saveable object classes
-	 */
-	static void freeClassList();
-
-	/**
-	 * Creates a new instance of a saveable object class
-	 */
-	static CSaveableObject *createInstance(const Common::String &name);
-public:
-	virtual void proc4();
-	virtual void proc5();
-	virtual void proc6();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_SAVEABLE_OBJECT_H */
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index d64577c..57f3c7d 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -28,7 +28,7 @@
 #include "graphics/scaler.h"
 #include "graphics/thumbnail.h"
 #include "titanic/titanic.h"
-#include "titanic/saveable_object.h"
+#include "titanic/objects/saveable_object.h"
 
 namespace Titanic {
 


Commit: 7818eecaff50fc78b1ac084b6eeaf11adcea0a63
    https://github.com/scummvm/scummvm/commit/7818eecaff50fc78b1ac084b6eeaf11adcea0a63
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-18T19:40:12-05:00

Commit Message:
TITANIC: Split SimpleFile and CompressedFile into different files

Changed paths:
  A engines/titanic/compressed_file.cpp
  A engines/titanic/compressed_file.h
  A engines/titanic/simple_file.cpp
  A engines/titanic/simple_file.h
  R engines/titanic/files.cpp
  R engines/titanic/files.h
    engines/titanic/module.mk
    engines/titanic/objects/project_item.cpp
    engines/titanic/objects/project_item.h
    engines/titanic/string.cpp



diff --git a/engines/titanic/compressed_file.cpp b/engines/titanic/compressed_file.cpp
new file mode 100644
index 0000000..7c0d987
--- /dev/null
+++ b/engines/titanic/compressed_file.cpp
@@ -0,0 +1,169 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/util.h"
+#include "titanic/compressed_file.h"
+
+namespace Titanic {
+
+DecompressorData::DecompressorData() {
+	_field0 = 0;
+	_field4 = 0;
+	_field8 = 0;
+	_fieldC = 0;
+	_field10 = 0;
+	_field14 = 0;
+}
+
+/*------------------------------------------------------------------------*/
+
+Decompressor::Decompressor() {
+	_createFn = nullptr;
+	_destroyFn = nullptr;
+	_field18 = 0;
+	_dataPtr = nullptr;
+	_field28 = 0;
+}
+
+void Decompressor::load(const char *version, int v) {
+	if (!version || *version != '1')
+		error("Bad version");
+	
+	_field18 = 0;
+	if (!_createFn) {
+		_createFn = &Decompressor::createMethod;
+		_field28 = 0;
+	}
+
+	if (!_destroyFn) {
+		_destroyFn = &Decompressor::destroyMethod;
+	}
+
+	_dataPtr = (this->*_createFn)(_field28, 1, 24);
+	_dataPtr->_field14 = 0;
+	_dataPtr->_fieldC = 0;
+	if (v < 0) {
+		v = -v;
+		_dataPtr->_fieldC = 1;
+	}
+
+	if (v < 8 || v > 15)
+		error("Bad parameter");
+
+	_dataPtr->_field10 = v;
+	_dataPtr->_field14 = sub1(_dataPtr->_fieldC ? nullptr : &Decompressor::method3, 1 << v);
+
+	if (_dataPtr->_field14)
+		sub2();
+	else
+		close();
+}
+
+int Decompressor::sub1(Method3Fn fn, int v) {
+	return 0;
+}
+
+void Decompressor::close() {
+
+}
+
+DecompressorData *Decompressor::createMethod(int v1, int v2, int v3) {
+	return new DecompressorData();
+}
+
+void Decompressor::destroyMethod(DecompressorData *ptr) {
+	delete ptr;
+}
+
+/*------------------------------------------------------------------------*/
+
+CompressedFile::CompressedFile() : SimpleFile() {
+	_fileMode = 0;
+	_isReading = 0;
+	_field260 = 0;
+	_mode = 0;
+}
+
+CompressedFile::~CompressedFile() {
+}
+
+void CompressedFile::open(const Common::String &name, FileMode mode) {
+	SimpleFile::open(name, mode);
+
+	if (mode == FILE_READ) {
+		_decompressor.load();
+		_fileMode = 2;
+	} else if (mode == FILE_WRITE) {
+		_decompressor.load();
+		_fileMode = 1;
+	}
+}
+
+void CompressedFile::open(Common::SeekableReadStream *stream, FileMode mode) {
+	SimpleFile::open(stream, mode);
+
+	if (mode == FILE_READ) {
+		_decompressor.load();
+		_fileMode = 2;
+	} else if (mode == FILE_WRITE) {
+		_decompressor.load();
+		_fileMode = 1;
+	}
+}
+
+void CompressedFile::close() {
+	_queue.clear();
+	SimpleFile::close();
+}
+
+size_t CompressedFile::unsafeRead(void *dst, size_t count) {
+	assert(_file.isOpen());
+	if (count == 0)
+		return 0;
+
+	// Ensure there's enough data queued in the buffer
+	decompress();
+
+	// Pass the data to the output buffer
+	size_t bytesRead = 0;
+	byte *dataPtr = (byte *)dst;
+
+	while (count > 0) {
+		if (_queue.empty()) {
+			decompress();
+			if (_queue.empty())
+				break;
+		}
+
+		*dataPtr++ = _queue.pop();
+		++bytesRead;
+		--count;
+	}
+
+	return bytesRead;
+}
+
+void CompressedFile::decompress() {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/compressed_file.h b/engines/titanic/compressed_file.h
new file mode 100644
index 0000000..814a1ab
--- /dev/null
+++ b/engines/titanic/compressed_file.h
@@ -0,0 +1,120 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_COMPRESSED_FILE_H
+#define TITANIC_COMPRESSED_FILE_H
+
+#include "common/scummsys.h"
+#include "common/file.h"
+#include "common/queue.h"
+#include "titanic/simple_file.h"
+#include "titanic/string.h"
+
+namespace Titanic {
+
+class Decompressor;
+class DecompressorData;
+
+typedef DecompressorData *(Decompressor::*DecompressorCreateFn)(int v1, int v2, int v3);
+typedef void(Decompressor::*DecompressorDestroyFn)(DecompressorData *ptr);
+typedef void(Decompressor::*Method3Fn)();
+
+class DecompressorData {
+public:
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+public:
+	DecompressorData();
+};
+
+class Decompressor {
+private:
+	DecompressorCreateFn _createFn;
+	DecompressorDestroyFn _destroyFn;
+	int _field18;
+	DecompressorData *_dataPtr;
+	int _field28;
+
+	DecompressorData *createMethod(int v1, int v2, int v3);
+
+	void destroyMethod(DecompressorData *ptr);
+
+	void method3() {
+		// TODO
+	}
+
+	int sub1(Method3Fn fn, int v);
+
+	void sub2();
+public:
+	Decompressor();
+
+	void load(const char *version = "1.0.4", int v = 15);
+
+	void close();
+};
+
+class CompressedFile : public SimpleFile {
+private:
+	Decompressor _decompressor;
+	Common::Queue<byte> _queue;
+	int _fileMode;
+	int _isReading;
+	int _field260;
+	int _mode;
+
+	/**
+	 * Decompress data from the source file
+	 */
+	void decompress();
+public:
+	CompressedFile();
+	virtual ~CompressedFile();
+
+	/**
+	 * Open a file for access
+	 */
+	virtual void open(const Common::String &name, FileMode mode = FILE_READ);
+
+	/**
+	 * Set up a stream for access
+	 */
+	virtual void open(Common::SeekableReadStream *stream, FileMode mode = FILE_READ);
+
+	/**
+	 * Close the file
+	 */
+	virtual void close();
+
+	/**
+	 * Read from the file
+	 */
+	virtual size_t unsafeRead(void *dst, size_t count);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_COMPRESSED_FILE_H */
diff --git a/engines/titanic/files.cpp b/engines/titanic/files.cpp
deleted file mode 100644
index 2f5b1b5..0000000
--- a/engines/titanic/files.cpp
+++ /dev/null
@@ -1,321 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/files.h"
-#include "common/util.h"
-
-namespace Titanic {
-
-SimpleFile::SimpleFile(): _stream(nullptr) {
-}
-
-SimpleFile::~SimpleFile() {
-	_file.close();
-}
-
-void SimpleFile::open(const Common::String &name, FileMode mode) {
-	assert(mode == FILE_READ);
-	if (!_file.open(name))
-		error("Could not find file - %s", name.c_str());
-}
-
-void SimpleFile::open(Common::SeekableReadStream *stream, FileMode mode) {
-	close();
-	_stream = stream;
-}
-
-void SimpleFile::close() {
-	_file.close();
-	_stream = nullptr;
-}
-
-void SimpleFile::safeRead(void *dst, size_t count) {
-	assert(_stream);
-	if (unsafeRead(dst, count) != count)
-		error("Could not read %d bytes", count);
-}
-
-size_t SimpleFile::unsafeRead(void *dst, size_t count) {
-	return _stream->read(dst, count);
-}
-
-CString SimpleFile::readString() {
-	char c;
-	CString result;
-	bool backslashFlag = false;
-
-	// First skip any spaces
-	do {
-		safeRead(&c, 1);
-	} while (Common::isSpace(c));
-
-	// Ensure we've found a starting quote for the string
-	if (c != '"')
-		error("Could not find starting quote");
-
-	bool endFlag = false;
-	while (!endFlag) {
-		// Read the next character
-		safeRead(&c, 1);
-
-		if (backslashFlag) {
-			backslashFlag = false;
-			switch (c) {
-			case 'n':
-				result += '\n';
-				break;
-			case 'r':
-				result += '\r';
-				break;
-			case '\t':
-				result += '\t';
-				break;
-			default:
-				result += c;
-				break;
-			}
-		} else {
-			switch (c) {
-			case '"':
-				endFlag = true;
-				break;
-			case '\\':
-				backslashFlag = true;
-				break;
-			default:
-				result += c;
-				break;
-			}
-		}
-	}
-
-	// Return the string
-	return result;
-}
-
-int SimpleFile::readNumber() {
-	char c;
-	int result = 0;
-	bool minusFlag = false;
-
-	// First skip any spaces
-	do {
-		safeRead(&c, 1);
-	} while (Common::isSpace(c));
-
-	// Check for prefix sign
-	if (c == '+' || c == '-') {
-		minusFlag = c == '-';
-		safeRead(&c, 1);
-	}
-
-	// Read in the number
-	if (!Common::isDigit(c))
-		error("Invalid number");
-
-	while (Common::isDigit(c)) {
-		result = result * 10 + (c - '0');
-		safeRead(&c, 1);
-	}
-
-	// Finally, if it's a minus value, then negate it
-	if (minusFlag)
-		result = -result;
-
-	return result;
-}
-
-double SimpleFile::readFloat() {
-	char c;
-	Common::String result;
-
-	// First skip any spaces
-	do {
-		safeRead(&c, 1);
-	} while (Common::isSpace(c));
-
-	// Check for prefix sign
-	if (c == '+' || c == '-') {
-		result += c;
-		safeRead(&c, 1);
-	}
-
-	// Read in the number
-	if (!Common::isDigit(c))
-		error("Invalid number");
-
-	while (Common::isDigit(c) || c == '.') {
-		result += c;
-		safeRead(&c, 1);
-	}
-
-	// Convert to a float and return it
-	float floatValue;
-	sscanf(result.c_str(), "%f", &floatValue);
-
-	return floatValue;
-}
-
-/*------------------------------------------------------------------------*/
-
-DecompressorData::DecompressorData() {
-	_field0 = 0;
-	_field4 = 0;
-	_field8 = 0;
-	_fieldC = 0;
-	_field10 = 0;
-	_field14 = 0;
-}
-
-/*------------------------------------------------------------------------*/
-
-Decompressor::Decompressor() {
-	_createFn = nullptr;
-	_destroyFn = nullptr;
-	_field18 = 0;
-	_dataPtr = nullptr;
-	_field28 = 0;
-}
-
-void Decompressor::load(const char *version, int v) {
-	if (!version || *version != '1')
-		error("Bad version");
-	
-	_field18 = 0;
-	if (!_createFn) {
-		_createFn = &Decompressor::createMethod;
-		_field28 = 0;
-	}
-
-	if (!_destroyFn) {
-		_destroyFn = &Decompressor::destroyMethod;
-	}
-
-	_dataPtr = (this->*_createFn)(_field28, 1, 24);
-	_dataPtr->_field14 = 0;
-	_dataPtr->_fieldC = 0;
-	if (v < 0) {
-		v = -v;
-		_dataPtr->_fieldC = 1;
-	}
-
-	if (v < 8 || v > 15)
-		error("Bad parameter");
-
-	_dataPtr->_field10 = v;
-	_dataPtr->_field14 = sub1(_dataPtr->_fieldC ? nullptr : &Decompressor::method3, 1 << v);
-
-	if (_dataPtr->_field14)
-		sub2();
-	else
-		close();
-}
-
-int Decompressor::sub1(Method3Fn fn, int v) {
-	return 0;
-}
-
-void Decompressor::close() {
-
-}
-
-DecompressorData *Decompressor::createMethod(int v1, int v2, int v3) {
-	return new DecompressorData();
-}
-
-void Decompressor::destroyMethod(DecompressorData *ptr) {
-	delete ptr;
-}
-
-/*------------------------------------------------------------------------*/
-
-CompressedFile::CompressedFile() : SimpleFile() {
-	_fileMode = 0;
-	_isReading = 0;
-	_field260 = 0;
-	_mode = 0;
-}
-
-CompressedFile::~CompressedFile() {
-}
-
-void CompressedFile::open(const Common::String &name, FileMode mode) {
-	SimpleFile::open(name, mode);
-
-	if (mode == FILE_READ) {
-		_decompressor.load();
-		_fileMode = 2;
-	} else if (mode == FILE_WRITE) {
-		_decompressor.load();
-		_fileMode = 1;
-	}
-}
-
-void CompressedFile::open(Common::SeekableReadStream *stream, FileMode mode) {
-	SimpleFile::open(stream, mode);
-
-	if (mode == FILE_READ) {
-		_decompressor.load();
-		_fileMode = 2;
-	} else if (mode == FILE_WRITE) {
-		_decompressor.load();
-		_fileMode = 1;
-	}
-}
-
-void CompressedFile::close() {
-	_queue.clear();
-	SimpleFile::close();
-}
-
-size_t CompressedFile::unsafeRead(void *dst, size_t count) {
-	assert(_file.isOpen());
-	if (count == 0)
-		return 0;
-
-	// Ensure there's enough data queued in the buffer
-	decompress();
-
-	// Pass the data to the output buffer
-	size_t bytesRead = 0;
-	byte *dataPtr = (byte *)dst;
-
-	while (count > 0) {
-		if (_queue.empty()) {
-			decompress();
-			if (_queue.empty())
-				break;
-		}
-
-		*dataPtr++ = _queue.pop();
-		++bytesRead;
-		--count;
-	}
-
-	return bytesRead;
-}
-
-void CompressedFile::decompress() {
-
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/files.h b/engines/titanic/files.h
deleted file mode 100644
index 0f72f60..0000000
--- a/engines/titanic/files.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_FILES_H
-#define TITANIC_FILES_H
-
-#include "common/scummsys.h"
-#include "common/file.h"
-#include "common/queue.h"
-#include "titanic/string.h"
-
-namespace Titanic {
-
-enum FileMode { FILE_READ = 1, FILE_WRITE = 2 };
-
-class Decompressor;
-class DecompressorData;
-
-class SimpleFile {
-protected:
-	Common::File _file;
-	Common::SeekableReadStream *_stream;
-public:
-	SimpleFile();
-	virtual ~SimpleFile();
-
-	/**
-	 * Open a file for access
-	 */
-	virtual void open(const Common::String &name, FileMode mode = FILE_READ);
-
-	/**
-	 * Set up a stream for access
-	 */
-	virtual void open(Common::SeekableReadStream *stream, FileMode mode = FILE_READ);
-
-	/**
-	 * Close the file
-	 */
-	virtual void close();
-
-	/**
-	 * Read from the file with validation
-	 */
-	virtual void safeRead(void *dst, size_t count);
-
-	/**
-	 * Read from the file
-	 */
-	virtual size_t unsafeRead(void *dst, size_t count);
-
-	/**
-	 * Read a string from the file
-	 */
-	virtual CString readString();
-
-	/**
-	 * Read a number from the file
-	 */
-	virtual int readNumber();
-
-	/**
-	 * Read a floating point number from the file
-	 */
-	virtual double readFloat();
-};
-
-typedef DecompressorData *(Decompressor::*DecompressorCreateFn)(int v1, int v2, int v3);
-typedef void(Decompressor::*DecompressorDestroyFn)(DecompressorData *ptr);
-typedef void(Decompressor::*Method3Fn)();
-
-class DecompressorData {
-public:
-	int _field0;
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
-	int _field14;
-public:
-	DecompressorData();
-};
-
-class Decompressor {
-private:
-	DecompressorCreateFn _createFn;
-	DecompressorDestroyFn _destroyFn;
-	int _field18;
-	DecompressorData *_dataPtr;
-	int _field28;
-
-	DecompressorData *createMethod(int v1, int v2, int v3);
-
-	void destroyMethod(DecompressorData *ptr);
-
-	void method3() {
-		// TODO
-	}
-
-	int sub1(Method3Fn fn, int v);
-
-	void sub2();
-public:
-	Decompressor();
-
-	void load(const char *version = "1.0.4", int v = 15);
-
-	void close();
-};
-
-class CompressedFile : public SimpleFile {
-private:
-	Decompressor _decompressor;
-	Common::Queue<byte> _queue;
-	int _fileMode;
-	int _isReading;
-	int _field260;
-	int _mode;
-
-	/**
-	 * Decompress data from the source file
-	 */
-	void decompress();
-public:
-	CompressedFile();
-	virtual ~CompressedFile();
-
-	/**
-	 * Open a file for access
-	 */
-	virtual void open(const Common::String &name, FileMode mode = FILE_READ);
-
-	/**
-	 * Set up a stream for access
-	 */
-	virtual void open(Common::SeekableReadStream *stream, FileMode mode = FILE_READ);
-
-	/**
-	 * Close the file
-	 */
-	virtual void close();
-
-	/**
-	 * Read from the file
-	 */
-	virtual size_t unsafeRead(void *dst, size_t count);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_FILES_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 6cb4fc1..17805e1 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -1,13 +1,14 @@
 MODULE := engines/titanic
 
 MODULE_OBJS := \
+	compressed_file.o \
 	detection.o \
 	direct_draw.o \
-	files.o \
 	font.o \
 	image.o \
 	main_game_window.o \
 	screen_manager.o \
+	simple_file.o \
 	string.o \
 	titanic.o \
 	video_surface.o \
diff --git a/engines/titanic/objects/project_item.cpp b/engines/titanic/objects/project_item.cpp
index 80596ec..90f85d9 100644
--- a/engines/titanic/objects/project_item.cpp
+++ b/engines/titanic/objects/project_item.cpp
@@ -22,7 +22,7 @@
 
 #include "common/savefile.h"
 #include "titanic/titanic.h"
-#include "titanic/files.h"
+#include "titanic/compressed_file.h"
 #include "titanic/objects/project_item.h"
 
 namespace Titanic {
diff --git a/engines/titanic/objects/project_item.h b/engines/titanic/objects/project_item.h
index 2856f42..93f6e17 100644
--- a/engines/titanic/objects/project_item.h
+++ b/engines/titanic/objects/project_item.h
@@ -24,7 +24,7 @@
 #define TITANIC_PROJECT_ITEM_H
 
 #include "common/scummsys.h"
-#include "titanic/files.h"
+#include "titanic/simple_file.h"
 #include "titanic/objects/file_item.h"
 
 namespace Titanic {
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
new file mode 100644
index 0000000..038603c
--- /dev/null
+++ b/engines/titanic/simple_file.cpp
@@ -0,0 +1,177 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/simple_file.h"
+
+namespace Titanic {
+
+SimpleFile::SimpleFile(): _stream(nullptr) {
+}
+
+SimpleFile::~SimpleFile() {
+	_file.close();
+}
+
+void SimpleFile::open(const Common::String &name, FileMode mode) {
+	assert(mode == FILE_READ);
+	if (!_file.open(name))
+		error("Could not find file - %s", name.c_str());
+}
+
+void SimpleFile::open(Common::SeekableReadStream *stream, FileMode mode) {
+	close();
+	_stream = stream;
+}
+
+void SimpleFile::close() {
+	_file.close();
+	_stream = nullptr;
+}
+
+void SimpleFile::safeRead(void *dst, size_t count) {
+	assert(_stream);
+	if (unsafeRead(dst, count) != count)
+		error("Could not read %d bytes", count);
+}
+
+size_t SimpleFile::unsafeRead(void *dst, size_t count) {
+	return _stream->read(dst, count);
+}
+
+CString SimpleFile::readString() {
+	char c;
+	CString result;
+	bool backslashFlag = false;
+
+	// First skip any spaces
+	do {
+		safeRead(&c, 1);
+	} while (Common::isSpace(c));
+
+	// Ensure we've found a starting quote for the string
+	if (c != '"')
+		error("Could not find starting quote");
+
+	bool endFlag = false;
+	while (!endFlag) {
+		// Read the next character
+		safeRead(&c, 1);
+
+		if (backslashFlag) {
+			backslashFlag = false;
+			switch (c) {
+			case 'n':
+				result += '\n';
+				break;
+			case 'r':
+				result += '\r';
+				break;
+			case '\t':
+				result += '\t';
+				break;
+			default:
+				result += c;
+				break;
+			}
+		} else {
+			switch (c) {
+			case '"':
+				endFlag = true;
+				break;
+			case '\\':
+				backslashFlag = true;
+				break;
+			default:
+				result += c;
+				break;
+			}
+		}
+	}
+
+	// Return the string
+	return result;
+}
+
+int SimpleFile::readNumber() {
+	char c;
+	int result = 0;
+	bool minusFlag = false;
+
+	// First skip any spaces
+	do {
+		safeRead(&c, 1);
+	} while (Common::isSpace(c));
+
+	// Check for prefix sign
+	if (c == '+' || c == '-') {
+		minusFlag = c == '-';
+		safeRead(&c, 1);
+	}
+
+	// Read in the number
+	if (!Common::isDigit(c))
+		error("Invalid number");
+
+	while (Common::isDigit(c)) {
+		result = result * 10 + (c - '0');
+		safeRead(&c, 1);
+	}
+
+	// Finally, if it's a minus value, then negate it
+	if (minusFlag)
+		result = -result;
+
+	return result;
+}
+
+double SimpleFile::readFloat() {
+	char c;
+	Common::String result;
+
+	// First skip any spaces
+	do {
+		safeRead(&c, 1);
+	} while (Common::isSpace(c));
+
+	// Check for prefix sign
+	if (c == '+' || c == '-') {
+		result += c;
+		safeRead(&c, 1);
+	}
+
+	// Read in the number
+	if (!Common::isDigit(c))
+		error("Invalid number");
+
+	while (Common::isDigit(c) || c == '.') {
+		result += c;
+		safeRead(&c, 1);
+	}
+
+	// Convert to a float and return it
+	float floatValue;
+	sscanf(result.c_str(), "%f", &floatValue);
+
+	return floatValue;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
new file mode 100644
index 0000000..6720d94
--- /dev/null
+++ b/engines/titanic/simple_file.h
@@ -0,0 +1,89 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SIMPLE_FILE_H
+#define TITANIC_SIMPLE_FILE_H
+
+#include "common/scummsys.h"
+#include "common/file.h"
+#include "common/queue.h"
+#include "titanic/string.h"
+
+namespace Titanic {
+
+enum FileMode { FILE_READ = 1, FILE_WRITE = 2 };
+
+class Decompressor;
+class DecompressorData;
+
+class SimpleFile {
+protected:
+	Common::File _file;
+	Common::SeekableReadStream *_stream;
+public:
+	SimpleFile();
+	virtual ~SimpleFile();
+
+	/**
+	 * Open a file for access
+	 */
+	virtual void open(const Common::String &name, FileMode mode = FILE_READ);
+
+	/**
+	 * Set up a stream for access
+	 */
+	virtual void open(Common::SeekableReadStream *stream, FileMode mode = FILE_READ);
+
+	/**
+	 * Close the file
+	 */
+	virtual void close();
+
+	/**
+	 * Read from the file with validation
+	 */
+	virtual void safeRead(void *dst, size_t count);
+
+	/**
+	 * Read from the file
+	 */
+	virtual size_t unsafeRead(void *dst, size_t count);
+
+	/**
+	 * Read a string from the file
+	 */
+	virtual CString readString();
+
+	/**
+	 * Read a number from the file
+	 */
+	virtual int readNumber();
+
+	/**
+	 * Read a floating point number from the file
+	 */
+	virtual double readFloat();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SIMPLE_FILE_H */
diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp
index cdc251d..55b7f8c 100644
--- a/engines/titanic/string.cpp
+++ b/engines/titanic/string.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/files.h"
+#include "titanic/string.h"
 
 namespace Titanic {
 


Commit: c4a0d4923afa6cded68ba2863c2df30fd38d1455
    https://github.com/scummvm/scummvm/commit/c4a0d4923afa6cded68ba2863c2df30fd38d1455
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-18T20:35:38-05:00

Commit Message:
TITANIC: Implement lots of SimpleFile methods

Changed paths:
    engines/titanic/compressed_file.cpp
    engines/titanic/compressed_file.h
    engines/titanic/simple_file.cpp
    engines/titanic/simple_file.h



diff --git a/engines/titanic/compressed_file.cpp b/engines/titanic/compressed_file.cpp
index 7c0d987..ea76016 100644
--- a/engines/titanic/compressed_file.cpp
+++ b/engines/titanic/compressed_file.cpp
@@ -20,7 +20,6 @@
  *
  */
 
-#include "common/util.h"
 #include "titanic/compressed_file.h"
 
 namespace Titanic {
@@ -106,28 +105,25 @@ CompressedFile::CompressedFile() : SimpleFile() {
 CompressedFile::~CompressedFile() {
 }
 
-void CompressedFile::open(const Common::String &name, FileMode mode) {
-	SimpleFile::open(name, mode);
+void CompressedFile::open(const Common::String &name) {
+	SimpleFile::open(name);
 
-	if (mode == FILE_READ) {
-		_decompressor.load();
-		_fileMode = 2;
-	} else if (mode == FILE_WRITE) {
-		_decompressor.load();
-		_fileMode = 1;
-	}
+	_decompressor.load();
+	_fileMode = 2;
 }
 
-void CompressedFile::open(Common::SeekableReadStream *stream, FileMode mode) {
-	SimpleFile::open(stream, mode);
+void CompressedFile::open(Common::SeekableReadStream *stream) {
+	SimpleFile::open(stream);
 
-	if (mode == FILE_READ) {
-		_decompressor.load();
-		_fileMode = 2;
-	} else if (mode == FILE_WRITE) {
-		_decompressor.load();
-		_fileMode = 1;
-	}
+	_decompressor.load();
+	_fileMode = 2;
+}
+
+void CompressedFile::open(Common::OutSaveFile *stream) {
+	SimpleFile::open(stream);
+
+	_decompressor.load();
+	_fileMode = 1;
 }
 
 void CompressedFile::close() {
diff --git a/engines/titanic/compressed_file.h b/engines/titanic/compressed_file.h
index 814a1ab..56e2c23 100644
--- a/engines/titanic/compressed_file.h
+++ b/engines/titanic/compressed_file.h
@@ -97,12 +97,17 @@ public:
 	/**
 	 * Open a file for access
 	 */
-	virtual void open(const Common::String &name, FileMode mode = FILE_READ);
+	virtual void open(const Common::String &name);
 
 	/**
-	 * Set up a stream for access
+	 * Set up a stream for read access
 	 */
-	virtual void open(Common::SeekableReadStream *stream, FileMode mode = FILE_READ);
+	virtual void open(Common::SeekableReadStream *stream);
+
+	/**
+	 * Set up a stream for write access
+	 */
+	virtual void open(Common::OutSaveFile *stream);
 
 	/**
 	 * Close the file
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index 038603c..5848fbe 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -20,41 +20,63 @@
  *
  */
 
+#include "common/util.h"
 #include "titanic/simple_file.h"
 
 namespace Titanic {
 
-SimpleFile::SimpleFile(): _stream(nullptr) {
+SimpleFile::SimpleFile(): _inStream(nullptr), _outStream(nullptr), _lineCount(1) {
 }
 
 SimpleFile::~SimpleFile() {
 	_file.close();
 }
 
-void SimpleFile::open(const Common::String &name, FileMode mode) {
-	assert(mode == FILE_READ);
+void SimpleFile::open(const Common::String &name) {
+	close();
+
 	if (!_file.open(name))
 		error("Could not find file - %s", name.c_str());
+	_inStream = &_file;
 }
 
-void SimpleFile::open(Common::SeekableReadStream *stream, FileMode mode) {
+void SimpleFile::open(Common::SeekableReadStream *stream) {
+	close();	
+	_inStream = stream;
+}
+
+void SimpleFile::open(Common::OutSaveFile *stream) {
 	close();
-	_stream = stream;
+	_outStream = stream;
 }
 
 void SimpleFile::close() {
 	_file.close();
-	_stream = nullptr;
+	if (_outStream)
+		_outStream->finalize();
+
+	_inStream = nullptr;
+	_outStream = nullptr;
 }
 
 void SimpleFile::safeRead(void *dst, size_t count) {
-	assert(_stream);
 	if (unsafeRead(dst, count) != count)
 		error("Could not read %d bytes", count);
 }
 
 size_t SimpleFile::unsafeRead(void *dst, size_t count) {
-	return _stream->read(dst, count);
+	assert(_inStream);
+	return _inStream->read(dst, count);
+}
+
+size_t SimpleFile::write(const void *src, size_t count) {
+	assert(_outStream);
+	return _outStream->write(src, count);
+}
+
+bool SimpleFile::eof() const {
+	assert(_inStream);
+	return _inStream->pos() >= _inStream->size();
 }
 
 CString SimpleFile::readString() {
@@ -174,4 +196,81 @@ double SimpleFile::readFloat() {
 	return floatValue;
 }
 
+void SimpleFile::writeLine(const CString &str) {
+	write(str.c_str(), str.size());
+	write("\r\n", 2);
+}
+
+void SimpleFile::writeString(const CString &str) {
+	if (str.empty())
+		return;
+
+	const char *msgP = str.c_str();
+	char c;
+	
+	while (c = *msgP++) {
+		switch (c) {
+		case '\r':
+			write("\\r", 2);
+			break;
+		case '\n':
+			write("\\n", 2);
+			break;
+		case '\t':
+			write("\\t", 2);
+			break;
+		case '\"':
+			write("\\\"", 2);
+			break;
+		case '\\':
+			write("\\\\", 2);
+			break;
+		case '{':
+			write("\\{", 2);
+			break;
+		case '}':
+			write("\\}", 2);
+			break;
+		default:
+			write(&c, 1);
+			break;
+		}
+	}
+}
+
+void SimpleFile::writeQuotedString(const CString &str) {
+	write("\"", 1);
+	writeString(str);
+	write("\" ", 2);
+}
+
+void SimpleFile::writeIndent(uint indent) {
+	for (uint idx = 0; idx < indent; ++idx)
+		write("\t", 1);
+}
+
+bool SimpleFile::IsClassEnd() {
+	char c;
+
+	do {
+		safeRead(&c, 1);
+	} while (Common::isSpace(c));
+
+	return c == '}';
+}
+
+void SimpleFile::writeClassStart(const CString &classStr, int indent) {
+	write("\n", 1);
+	writeIndent(indent);
+	write("{\n", 2);
+	writeIndent(indent + 1);
+	writeQuotedString(classStr);
+	write("\n", 1);
+}
+
+void SimpleFile::writeClassEnd(int indent) {
+	writeIndent(indent);
+	write("}\n", 2);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
index 6720d94..45d7000 100644
--- a/engines/titanic/simple_file.h
+++ b/engines/titanic/simple_file.h
@@ -26,19 +26,20 @@
 #include "common/scummsys.h"
 #include "common/file.h"
 #include "common/queue.h"
+#include "common/savefile.h"
 #include "titanic/string.h"
 
 namespace Titanic {
 
-enum FileMode { FILE_READ = 1, FILE_WRITE = 2 };
-
 class Decompressor;
 class DecompressorData;
 
 class SimpleFile {
 protected:
 	Common::File _file;
-	Common::SeekableReadStream *_stream;
+	Common::SeekableReadStream *_inStream;
+	Common::OutSaveFile *_outStream;
+	int _lineCount;
 public:
 	SimpleFile();
 	virtual ~SimpleFile();
@@ -46,12 +47,17 @@ public:
 	/**
 	 * Open a file for access
 	 */
-	virtual void open(const Common::String &name, FileMode mode = FILE_READ);
+	virtual void open(const Common::String &name);
+
+	/**
+	 * Set up a stream for read access
+	 */
+	virtual void open(Common::SeekableReadStream *stream);
 
 	/**
-	 * Set up a stream for access
+	 * Set up a stream for write access
 	 */
-	virtual void open(Common::SeekableReadStream *stream, FileMode mode = FILE_READ);
+	virtual void open(Common::OutSaveFile *stream);
 
 	/**
 	 * Close the file
@@ -69,19 +75,66 @@ public:
 	virtual size_t unsafeRead(void *dst, size_t count);
 
 	/**
+	 * Write out data
+	 */
+	virtual size_t write(const void *src, size_t count);
+
+	/**
+	 * Return true if the end of the file has been reached
+	 */
+	bool eof() const;
+
+	/**
 	 * Read a string from the file
 	 */
-	virtual CString readString();
+	CString readString();
 
 	/**
 	 * Read a number from the file
 	 */
-	virtual int readNumber();
+	int readNumber();
 
 	/**
 	 * Read a floating point number from the file
 	 */
-	virtual double readFloat();
+	double readFloat();
+
+	/**
+	 * Write a line
+	 */
+	void writeLine(const CString &str);
+
+	/**
+	 * Write a string
+	 */
+	void writeString(const CString &str);
+
+	/**
+	 * Write a quoted string
+	 */
+	void writeQuotedString(const CString &str);
+
+	/**
+	 * Write out a number of tabs to form an indent in the output
+	 */
+	void writeIndent(uint indent);
+
+	/**
+	 * Validates that the following non-space character is either
+	 * an opening or closing squiggly bracket denoting a class
+	 * definition start or end. Returns true if it's a class end
+	 */
+	bool IsClassEnd();
+
+	/**
+	 * Write the starting header for a class definition
+	 */
+	void writeClassStart(const CString &classStr, int indent);
+
+	/**
+	 * Write out the ending footer for a class definition
+	 */
+	void writeClassEnd(int indent);
 };
 
 } // End of namespace Titanic


Commit: 9b173df32f65ec4eec9b9acf800a2541ccf74678
    https://github.com/scummvm/scummvm/commit/9b173df32f65ec4eec9b9acf800a2541ccf74678
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-18T21:12:22-05:00

Commit Message:
TITANIC: Implement CSaveableObject saving methods

Changed paths:
    engines/titanic/objects/saveable_object.cpp
    engines/titanic/objects/saveable_object.h
    engines/titanic/simple_file.cpp
    engines/titanic/simple_file.h
    engines/titanic/string.h



diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
index b2384a5..caa5192 100644
--- a/engines/titanic/objects/saveable_object.cpp
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -60,16 +60,22 @@ CSaveableObject *CSaveableObject::createInstance(const Common::String &name) {
 	return (*_classList)[name]();
 }
 
-void CSaveableObject::proc4() {
-
+void CSaveableObject::save(SimpleFile *file, int indent) {
+	// Should always be overriden in descendents, so just write a dummy value
+	file->writeNumberLine(0, indent);
 }
 
-void CSaveableObject::proc5() {
-
+void CSaveableObject::load(SimpleFile *file) {
+	// Should always be overriden in descendents, so just read a dummy value
+	file->readNumber();
 }
 
-void CSaveableObject::proc6() {
+void CSaveableObject::saveHeader(SimpleFile *file, int indent) {
+	file->writeClassStart(getClassName(), indent);
+}
 
+void CSaveableObject::saveFooter(SimpleFile *file, int indent) {
+	file->writeClassEnd(indent);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/saveable_object.h b/engines/titanic/objects/saveable_object.h
index 5253892..e99d8c5 100644
--- a/engines/titanic/objects/saveable_object.h
+++ b/engines/titanic/objects/saveable_object.h
@@ -26,6 +26,7 @@
 #include "common/scummsys.h"
 #include "common/array.h"
 #include "common/hash-str.h"
+#include "titanic/simple_file.h"
 
 namespace Titanic {
 
@@ -49,9 +50,32 @@ public:
 	 */
 	static CSaveableObject *createInstance(const Common::String &name);
 public:
-	virtual void proc4();
-	virtual void proc5();
-	virtual void proc6();
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSaveableObject"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent);
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+	
+	/**
+	 * Write out a header definition for the class to file
+	 * prior to saving the actual data for the class
+	 */
+	virtual void saveHeader(SimpleFile *file, int indent);
+	
+	/**
+	 * Writes out a footer for the class after it's data has
+	 * been written to file
+	 */
+	virtual void saveFooter(SimpleFile *file, int indent);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index 5848fbe..9f371b2 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -244,6 +244,17 @@ void SimpleFile::writeQuotedString(const CString &str) {
 	write("\" ", 2);
 }
 
+void SimpleFile::writeNumber(int val) {
+	CString str = CString::format("%ld ", val);
+	write(str.c_str(), str.size());
+}
+
+void SimpleFile::writeNumberLine(int val, int indent) {
+	writeIndent(indent);
+	writeNumber(val);
+	write("\n", 1);
+}
+
 void SimpleFile::writeIndent(uint indent) {
 	for (uint idx = 0; idx < indent; ++idx)
 		write("\t", 1);
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
index 45d7000..17dd82a 100644
--- a/engines/titanic/simple_file.h
+++ b/engines/titanic/simple_file.h
@@ -100,10 +100,12 @@ public:
 	double readFloat();
 
 	/**
-	 * Write a line
+	 * Write a string line
 	 */
 	void writeLine(const CString &str);
 
+
+
 	/**
 	 * Write a string
 	 */
@@ -115,6 +117,16 @@ public:
 	void writeQuotedString(const CString &str);
 
 	/**
+	 * Write a number to file
+	 */
+	void writeNumber(int val);
+
+	/**
+	 * Write a number line to file
+	 */
+	void writeNumberLine(int val, int indent);
+
+	/**
 	 * Write out a number of tabs to form an indent in the output
 	 */
 	void writeIndent(uint indent);
diff --git a/engines/titanic/string.h b/engines/titanic/string.h
index 9b8cca0..46cbb02 100644
--- a/engines/titanic/string.h
+++ b/engines/titanic/string.h
@@ -29,7 +29,13 @@
 namespace Titanic {
 
 class CString : public Common::String {
-
+public:
+	CString() : Common::String() {}
+	CString(const char *str) : Common::String(str) {}
+	CString(const char *str, uint32 len) : Common::String(str, len) {}
+	CString(const char *beginP, const char *endP) : Common::String(beginP, endP) {}
+	CString(const String &str) : Common::String(str) {}
+	explicit CString(char c) : Common::String(c) {}
 };
 
 } // End of namespace Titanic


Commit: e2aca904ec8c0e0f23124b00b4b1eb525105f95e
    https://github.com/scummvm/scummvm/commit/e2aca904ec8c0e0f23124b00b4b1eb525105f95e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-18T22:05:51-05:00

Commit Message:
TITANIC: Implement saving methods for List and ListItem

Changed paths:
  A engines/titanic/objects/list.cpp
  A engines/titanic/objects/list.h
  R engines/titanic/list.h
    engines/titanic/module.mk
    engines/titanic/objects/saveable_object.cpp
    engines/titanic/objects/saveable_object.h
    engines/titanic/simple_file.cpp
    engines/titanic/simple_file.h



diff --git a/engines/titanic/list.h b/engines/titanic/list.h
deleted file mode 100644
index bea3776..0000000
--- a/engines/titanic/list.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_LIST_H
-#define TITANIC_LIST_H
-
-#include "common/scummsys.h"
-#include "common/list.h"
-#include "titanic/objects/saveable_object.h"
-
-namespace Titanic {
-
-class ListItem: public CSaveableObject {
-};
-
-class List : public CSaveableObject, Common::List<ListItem *> {
-public:
-
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_LIST_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 17805e1..abd3512 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -13,6 +13,7 @@ MODULE_OBJS := \
 	titanic.o \
 	video_surface.o \
 	objects/file_item.o \
+	objects/list.o \
 	objects/message_target.o \
 	objects/project_item.o \
 	objects/saveable_object.o \
diff --git a/engines/titanic/objects/list.cpp b/engines/titanic/objects/list.cpp
new file mode 100644
index 0000000..ddcddb0
--- /dev/null
+++ b/engines/titanic/objects/list.cpp
@@ -0,0 +1,88 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/list.h"
+
+namespace Titanic {
+
+void ListItem::save(SimpleFile *file, int indent) const {
+	// Should always be overriden in descendents, so just write a dummy value
+	file->writeNumberLine(0, indent);
+}
+
+void ListItem::load(SimpleFile *file) {
+	// Should always be overriden in descendents, so just read the dummy value
+	file->readNumber();
+}
+
+/*------------------------------------------------------------------------*/
+
+List::List() {
+}
+
+void List::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	saveItems(file, indent);
+}
+
+void List::load(SimpleFile *file) {
+	file->readNumber();
+	loadItems(file);
+}
+
+void List::saveItems(SimpleFile *file, int indent) const {
+	// Write out number of items
+	file->writeQuotedLine("L", indent);
+	file->writeNumberLine(size(), indent);
+
+	// Iterate through writing entries
+	List::const_iterator i;
+	for (i = begin(); i != end(); ++i) {
+		const ListItem *item = *i;
+		item->saveHeader(file, indent);
+		item->save(file, indent + 1);
+		item->saveFooter(file, indent);
+	}
+}
+
+void List::loadItems(SimpleFile *file) {
+	file->readBuffer();
+	uint count = file->readNumber();
+	
+	for (uint idx = 0; idx < count; ++idx) {
+		// Validate the class start header
+		if (!file->IsClassStart())
+			error("Unexpected class end");
+
+		// Get item's class name and use it to instantiate an item
+		CString className = file->readString();
+		CSaveableObject *newItem = CSaveableObject::createInstance(className);
+		if (!newItem)
+			error("Could not create instance of %s", className.c_str());
+
+		// Validate the class end footer
+		if (file->IsClassStart())
+			error("Unexpected class start");
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/list.h b/engines/titanic/objects/list.h
new file mode 100644
index 0000000..f989127
--- /dev/null
+++ b/engines/titanic/objects/list.h
@@ -0,0 +1,82 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LIST_H
+#define TITANIC_LIST_H
+
+#include "common/scummsys.h"
+#include "common/list.h"
+#include "titanic/objects/saveable_object.h"
+
+namespace Titanic {
+
+class ListItem: public CSaveableObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "ListItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+class List : public CSaveableObject, Common::List<ListItem *> {
+private:
+	/**
+	 * Write out the contents of the list
+	 */
+	void saveItems(SimpleFile *file, int indent) const;
+
+	/**
+	 * Read in the contents of a list
+	 */
+	void loadItems(SimpleFile *file);
+public:
+	List();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "List"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LIST_H */
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
index caa5192..25bd164 100644
--- a/engines/titanic/objects/saveable_object.cpp
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -22,10 +22,10 @@
 
 #include "titanic/objects/saveable_object.h"
 #include "titanic/objects/file_item.h"
+#include "titanic/objects/list.h"
 #include "titanic/objects/message_target.h"
 #include "titanic/objects/project_item.h"
 #include "titanic/objects/tree_item.h"
-#include "titanic/list.h"
 
 namespace Titanic {
 
@@ -60,21 +60,21 @@ CSaveableObject *CSaveableObject::createInstance(const Common::String &name) {
 	return (*_classList)[name]();
 }
 
-void CSaveableObject::save(SimpleFile *file, int indent) {
+void CSaveableObject::save(SimpleFile *file, int indent) const {
 	// Should always be overriden in descendents, so just write a dummy value
 	file->writeNumberLine(0, indent);
 }
 
 void CSaveableObject::load(SimpleFile *file) {
-	// Should always be overriden in descendents, so just read a dummy value
+	// Should always be overriden in descendents, so just read the dummy value
 	file->readNumber();
 }
 
-void CSaveableObject::saveHeader(SimpleFile *file, int indent) {
+void CSaveableObject::saveHeader(SimpleFile *file, int indent) const {
 	file->writeClassStart(getClassName(), indent);
 }
 
-void CSaveableObject::saveFooter(SimpleFile *file, int indent) {
+void CSaveableObject::saveFooter(SimpleFile *file, int indent) const {
 	file->writeClassEnd(indent);
 }
 
diff --git a/engines/titanic/objects/saveable_object.h b/engines/titanic/objects/saveable_object.h
index e99d8c5..4e7d949 100644
--- a/engines/titanic/objects/saveable_object.h
+++ b/engines/titanic/objects/saveable_object.h
@@ -58,7 +58,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent);
+	virtual void save(SimpleFile *file, int indent) const;
 
 	/**
 	 * Load the data for the class from file
@@ -69,13 +69,13 @@ public:
 	 * Write out a header definition for the class to file
 	 * prior to saving the actual data for the class
 	 */
-	virtual void saveHeader(SimpleFile *file, int indent);
+	virtual void saveHeader(SimpleFile *file, int indent) const;
 	
 	/**
 	 * Writes out a footer for the class after it's data has
 	 * been written to file
 	 */
-	virtual void saveFooter(SimpleFile *file, int indent);
+	virtual void saveFooter(SimpleFile *file, int indent) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index 9f371b2..cf95aca2 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -196,6 +196,14 @@ double SimpleFile::readFloat() {
 	return floatValue;
 }
 
+void SimpleFile::readBuffer(char *buffer, size_t count) {
+	CString tempString = readString();
+	if (buffer) {
+		strncpy(buffer, tempString.c_str(), count);
+		buffer[count - 1] = '\0';
+	}
+}
+
 void SimpleFile::writeLine(const CString &str) {
 	write(str.c_str(), str.size());
 	write("\r\n", 2);
@@ -244,6 +252,12 @@ void SimpleFile::writeQuotedString(const CString &str) {
 	write("\" ", 2);
 }
 
+void SimpleFile::writeQuotedLine(const CString &str, int indent) {
+	writeIndent(indent);
+	writeQuotedString(str);
+	write("\n", 1);
+}
+
 void SimpleFile::writeNumber(int val) {
 	CString str = CString::format("%ld ", val);
 	write(str.c_str(), str.size());
@@ -260,14 +274,15 @@ void SimpleFile::writeIndent(uint indent) {
 		write("\t", 1);
 }
 
-bool SimpleFile::IsClassEnd() {
+bool SimpleFile::IsClassStart() {
 	char c;
 
 	do {
 		safeRead(&c, 1);
 	} while (Common::isSpace(c));
 
-	return c == '}';
+	assert(c == '{' || c == '}');
+	return c == '{';
 }
 
 void SimpleFile::writeClassStart(const CString &classStr, int indent) {
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
index 17dd82a..65b0ac6 100644
--- a/engines/titanic/simple_file.h
+++ b/engines/titanic/simple_file.h
@@ -100,12 +100,15 @@ public:
 	double readFloat();
 
 	/**
+	 * Read a string and copy it into an optionally passed buffer
+	 */
+	void readBuffer(char *buffer = nullptr, size_t count = 0);
+
+	/**
 	 * Write a string line
 	 */
 	void writeLine(const CString &str);
 
-
-
 	/**
 	 * Write a string
 	 */
@@ -117,6 +120,11 @@ public:
 	void writeQuotedString(const CString &str);
 
 	/**
+	 * Write a quoted string line
+	 */
+	void writeQuotedLine(const CString &str, int indent);
+
+	/**
 	 * Write a number to file
 	 */
 	void writeNumber(int val);
@@ -134,9 +142,9 @@ public:
 	/**
 	 * Validates that the following non-space character is either
 	 * an opening or closing squiggly bracket denoting a class
-	 * definition start or end. Returns true if it's a class end
+	 * definition start or end. Returns true if it's a class start
 	 */
-	bool IsClassEnd();
+	bool IsClassStart();
 
 	/**
 	 * Write the starting header for a class definition


Commit: ad8450209a553fd06540cd01ab29f936c0d0dc29
    https://github.com/scummvm/scummvm/commit/ad8450209a553fd06540cd01ab29f936c0d0dc29
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-18T23:07:01-05:00

Commit Message:
TITANIC: Implement overall game saving code

Changed paths:
    engines/titanic/compressed_file.h
    engines/titanic/objects/project_item.cpp
    engines/titanic/objects/project_item.h
    engines/titanic/objects/tree_item.cpp
    engines/titanic/objects/tree_item.h



diff --git a/engines/titanic/compressed_file.h b/engines/titanic/compressed_file.h
index 56e2c23..cd9cf83 100644
--- a/engines/titanic/compressed_file.h
+++ b/engines/titanic/compressed_file.h
@@ -68,7 +68,7 @@ private:
 
 	int sub1(Method3Fn fn, int v);
 
-	void sub2();
+	void sub2() {}
 public:
 	Decompressor();
 
diff --git a/engines/titanic/objects/project_item.cpp b/engines/titanic/objects/project_item.cpp
index 90f85d9..e75f0e0 100644
--- a/engines/titanic/objects/project_item.cpp
+++ b/engines/titanic/objects/project_item.cpp
@@ -27,7 +27,15 @@
 
 namespace Titanic {
 
-void CProjectItem::load(int id) {
+void CProjectItem::save(SimpleFile *file, int indent) const {
+	error("TODO");
+}
+
+void CProjectItem::load(SimpleFile *file) {
+	error("TODO");
+}
+
+void CProjectItem::loadGame(int slotId) {
 	CompressedFile file;
 	Common::InSaveFile *saveFile = nullptr;
 
@@ -35,16 +43,28 @@ void CProjectItem::load(int id) {
 	clear();
 
 	// Open either an existing savegame slot or the new game template
-	if (id > 0) {
+	if (slotId > 0) {
 		saveFile = g_system->getSavefileManager()->openForLoading(
-			Common::String::format("slot%d.gam", id));
+			Common::String::format("slot%d.gam", slotId));
 		file.open(saveFile);
 	} else {
 		file.open("newgame.st");
 	}
 
 	// Load the contents in
-	loadData(file);
+	loadData(&file);
+
+	file.close();
+}
+
+void CProjectItem::saveGame(int slotId) {
+	CompressedFile file;
+	Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(
+		Common::String::format("slot%d.gam", slotId));
+	file.open(saveFile);
+
+	// Save the contents out
+	saveData(&file, this);
 
 	file.close();
 }
@@ -53,8 +73,33 @@ void CProjectItem::clear() {
 
 }
 
-void CProjectItem::loadData(SimpleFile &file) {
+void CProjectItem::loadData(SimpleFile *file) {
 
 }
 
+void CProjectItem::saveData(SimpleFile *file, CTreeItem *item) const {
+	while (item) {
+		item->saveHeader(file, 0);
+		item->save(file, 1);
+		item->saveFooter(file, 0);
+
+	
+		CTreeItem *child = item->getFirstChild();
+		if (child) {
+			file->write("\n{\n", 3);
+			file->writeQuotedString("DOWN");
+			file->write("\n}\n", 3);
+			saveData(file, child);
+			file->write("\n{\n", 3);
+			file->writeQuotedString("UP");
+		} else {
+			file->write("\n{\n", 3);
+			file->writeQuotedString("ALONG");
+		}
+		
+		file->write("\n}\n", 3);
+		item = item->getNextSibling();
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/project_item.h b/engines/titanic/objects/project_item.h
index 93f6e17..6277af8 100644
--- a/engines/titanic/objects/project_item.h
+++ b/engines/titanic/objects/project_item.h
@@ -34,12 +34,37 @@ private:
 	/**
 	 * Load project data from the passed file
 	 */
-	void loadData(SimpleFile &file);
+	void loadData(SimpleFile *file);
+
+	/**
+	 * Save project data to the passed file
+	 */
+	void saveData(SimpleFile *file, CTreeItem *item) const;
 public:
 	/**
-	 * Load the entire project data for a given Id
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CProjectItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);	
+
+	/**
+	 * Load the entire project data for a given slot Id
+	 */
+	void loadGame(int slotId);
+
+	/**
+	 * Save the entire project data to a given savegame slot
 	 */
-	void load(int id);
+	void saveGame(int slotId);
 
 	/**
 	 * Clear any currently loaded project
diff --git a/engines/titanic/objects/tree_item.cpp b/engines/titanic/objects/tree_item.cpp
index 06128ce..dcd0e46 100644
--- a/engines/titanic/objects/tree_item.cpp
+++ b/engines/titanic/objects/tree_item.cpp
@@ -24,4 +24,32 @@
 
 namespace Titanic {
 
+CTreeItem::CTreeItem() : _parent(nullptr), _firstChild(nullptr),
+	_nextSibling(nullptr), _priorSibling(nullptr), _field14(0) {
+}
+
+void CTreeItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	CMessageTarget::save(file, indent);
+}
+
+void CTreeItem::load(SimpleFile *file) {
+	file->readNumber();
+	CMessageTarget::load(file);
+}
+
+CTreeItem *CTreeItem::getLastSibling() {
+	CTreeItem *item = this;
+	while (item->getNextSibling())
+		item = item->getNextSibling();
+
+	return item;
+}
+
+CTreeItem *CTreeItem::getLastChild() {
+	if (!_firstChild)
+		return nullptr;
+	return _firstChild->getLastSibling();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/tree_item.h b/engines/titanic/objects/tree_item.h
index 170a0e9..454c3ca 100644
--- a/engines/titanic/objects/tree_item.h
+++ b/engines/titanic/objects/tree_item.h
@@ -28,6 +28,59 @@
 namespace Titanic {
 
 class CTreeItem: public CMessageTarget {
+private:
+	CTreeItem *_parent;
+	CTreeItem *_nextSibling;
+	CTreeItem *_priorSibling;
+	CTreeItem *_firstChild;
+	int _field14;
+public:
+	CTreeItem();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTreeItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+
+	/**
+	 * Get the parent for the given item
+	 */
+	CTreeItem *getParent() const { return _parent; }
+
+	/**
+	 * Get the next sibling
+	 */
+	CTreeItem *getNextSibling() { return _nextSibling; }
+
+	/**
+	 * Get the prior sibling
+	 */
+	CTreeItem *getPriorSibling() { return _priorSibling; }
+
+	/**
+	 * Get the last sibling of this sibling
+	 */
+	CTreeItem *getLastSibling();
+
+	/**
+	 * Get the first child of the item, if any
+	 */
+	CTreeItem *getFirstChild() { return _firstChild; }
+
+	/**
+	 * Get the last child of the item, if any
+	 */
+	CTreeItem *getLastChild();
 };
 
 } // End of namespace Titanic


Commit: 8c9a1c2159251570185de73a7c90003e863f3c7e
    https://github.com/scummvm/scummvm/commit/8c9a1c2159251570185de73a7c90003e863f3c7e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-19T19:45:17-05:00

Commit Message:
TITANIC: Implementing CProjectItem::loadData

Changed paths:
    engines/titanic/objects/project_item.cpp
    engines/titanic/objects/project_item.h
    engines/titanic/objects/tree_item.cpp
    engines/titanic/objects/tree_item.h



diff --git a/engines/titanic/objects/project_item.cpp b/engines/titanic/objects/project_item.cpp
index e75f0e0..599af89 100644
--- a/engines/titanic/objects/project_item.cpp
+++ b/engines/titanic/objects/project_item.cpp
@@ -73,8 +73,54 @@ void CProjectItem::clear() {
 
 }
 
-void CProjectItem::loadData(SimpleFile *file) {
+CProjectItem *CProjectItem::loadData(SimpleFile *file) {
+	if (!file->IsClassStart())
+		return nullptr;
+
+	CProjectItem *root = nullptr;
+	CTreeItem *parent = nullptr;
+	CTreeItem *item = nullptr;
+
+	do {
+		CString entryString = file->readString();
+
+		if (entryString == "ALONG") {
+			// Move along, nothing needed
+		} else if (entryString == "UP") {
+			// Move up
+			if (parent == nullptr ||
+				(parent = parent->getParent()) == nullptr)
+				break;
+		} else if (entryString == "DOWN") {
+			// Move down
+			if (parent == nullptr)
+				parent = item;
+			else
+				parent = parent->getLastChild();
+		} else {
+			// Create new class instance
+			item = dynamic_cast<CTreeItem *>(CSaveableObject::createInstance(entryString));
+			assert(item);
+
+			if (root) {
+				// Already created root project
+				item->addUnder(parent);
+			} else {
+				// TODO: Validate this is correct
+				root = dynamic_cast<CProjectItem *>(item);
+				assert(root);
+
+				_filename = root->_filename;
+			}
+
+			// Load the data for the item
+			item->load(file);
+		}
+
+		file->IsClassStart();
+	} while (file->IsClassStart());
 
+	return root;
 }
 
 void CProjectItem::saveData(SimpleFile *file, CTreeItem *item) const {
diff --git a/engines/titanic/objects/project_item.h b/engines/titanic/objects/project_item.h
index 6277af8..60fee9b 100644
--- a/engines/titanic/objects/project_item.h
+++ b/engines/titanic/objects/project_item.h
@@ -31,10 +31,12 @@ namespace Titanic {
 
 class CProjectItem : public CFileItem {
 private:
+	CString _filename;
+private:
 	/**
 	 * Load project data from the passed file
 	 */
-	void loadData(SimpleFile *file);
+	CProjectItem *loadData(SimpleFile *file);
 
 	/**
 	 * Save project data to the passed file
diff --git a/engines/titanic/objects/tree_item.cpp b/engines/titanic/objects/tree_item.cpp
index dcd0e46..bf0ae3e 100644
--- a/engines/titanic/objects/tree_item.cpp
+++ b/engines/titanic/objects/tree_item.cpp
@@ -52,4 +52,32 @@ CTreeItem *CTreeItem::getLastChild() {
 	return _firstChild->getLastSibling();
 }
 
+void CTreeItem::addUnder(CTreeItem *newParent) {
+	if (newParent->_firstChild)
+		addSibling(newParent->getLastSibling());
+	else
+		setParent(newParent);
+}
+
+void CTreeItem::setParent(CTreeItem *newParent) {
+	_parent = newParent;
+	_priorSibling = nullptr;
+	_nextSibling = newParent->_firstChild;
+
+	if (newParent->_firstChild)
+		newParent->_firstChild->_priorSibling = this;
+	newParent->_firstChild = this;
+}
+
+void CTreeItem::addSibling(CTreeItem *item) {
+	_priorSibling = item->_nextSibling;
+	_nextSibling = item->_nextSibling;
+	_parent = item->_parent;
+
+	if (item->_nextSibling)
+		item->_nextSibling->_priorSibling = this;
+	item->_nextSibling = this;
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/tree_item.h b/engines/titanic/objects/tree_item.h
index 454c3ca..d3c1d34 100644
--- a/engines/titanic/objects/tree_item.h
+++ b/engines/titanic/objects/tree_item.h
@@ -81,6 +81,21 @@ public:
 	 * Get the last child of the item, if any
 	 */
 	CTreeItem *getLastChild();
+
+	/**
+	 * Adds the item under another tree item
+	 */
+	void addUnder(CTreeItem *newParent);
+
+	/**
+	 * Sets the parent for the item
+	 */
+	void setParent(CTreeItem *newParent);
+
+	/**
+	 * Adds the item as a sibling of another item
+	 */
+	void addSibling(CTreeItem *item);
 };
 
 } // End of namespace Titanic


Commit: ed5ae8412dee5cadef806ad83a049ac1bc85ec4d
    https://github.com/scummvm/scummvm/commit/ed5ae8412dee5cadef806ad83a049ac1bc85ec4d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-21T15:18:09-05:00

Commit Message:
CREATE_PROJECT: Disable fluidsynth library by default for Visual Studio

Currently we don't have a lib file for fluidsynth built for Visual Studio
2015, and I've spent 5 fruitless hours trying to compile one. So I'm
disabling fluidsynth automatically for now, and we can always re-enable
it again if we ever do manage to create an appropriate library

Changed paths:
    dists/msvc14/create_msvc14.bat



diff --git a/dists/msvc14/create_msvc14.bat b/dists/msvc14/create_msvc14.bat
index 7082ac9..4a16c43 100644
--- a/dists/msvc14/create_msvc14.bat
+++ b/dists/msvc14/create_msvc14.bat
@@ -55,14 +55,14 @@ goto done
 echo.
 echo Creating project files with all engines enabled (stable and unstable)
 echo.
-create_project ..\.. --enable-all-engines --msvc --msvc-version 14 --build-events
+create_project ..\.. --enable-all-engines --disable-fluidsynth --msvc --msvc-version 14 --build-events
 goto done
 
 :stable
 echo.
 echo Creating normal project files, with only the stable engines enabled
 echo.
-create_project ..\.. --msvc --msvc-version 14
+create_project ..\.. --disable-fluidsynth --msvc --msvc-version 14
 goto done
 
 :tools


Commit: f8c6724112d9b6161a0df8ee31d98d13b36d2b40
    https://github.com/scummvm/scummvm/commit/f8c6724112d9b6161a0df8ee31d98d13b36d2b40
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-21T21:35:55-05:00

Commit Message:
TITANIC: Fleshed out CompressedFile class

Changed paths:
  A engines/titanic/compression.cpp
  A engines/titanic/compression.h
    engines/titanic/compressed_file.cpp
    engines/titanic/compressed_file.h
    engines/titanic/main_game_window.cpp
    engines/titanic/module.mk
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h



diff --git a/engines/titanic/compressed_file.cpp b/engines/titanic/compressed_file.cpp
index ea76016..c200370 100644
--- a/engines/titanic/compressed_file.cpp
+++ b/engines/titanic/compressed_file.cpp
@@ -24,82 +24,16 @@
 
 namespace Titanic {
 
-DecompressorData::DecompressorData() {
-	_field0 = 0;
-	_field4 = 0;
-	_field8 = 0;
-	_fieldC = 0;
-	_field10 = 0;
-	_field14 = 0;
-}
-
-/*------------------------------------------------------------------------*/
-
-Decompressor::Decompressor() {
-	_createFn = nullptr;
-	_destroyFn = nullptr;
-	_field18 = 0;
-	_dataPtr = nullptr;
-	_field28 = 0;
-}
-
-void Decompressor::load(const char *version, int v) {
-	if (!version || *version != '1')
-		error("Bad version");
-	
-	_field18 = 0;
-	if (!_createFn) {
-		_createFn = &Decompressor::createMethod;
-		_field28 = 0;
-	}
-
-	if (!_destroyFn) {
-		_destroyFn = &Decompressor::destroyMethod;
-	}
-
-	_dataPtr = (this->*_createFn)(_field28, 1, 24);
-	_dataPtr->_field14 = 0;
-	_dataPtr->_fieldC = 0;
-	if (v < 0) {
-		v = -v;
-		_dataPtr->_fieldC = 1;
-	}
-
-	if (v < 8 || v > 15)
-		error("Bad parameter");
-
-	_dataPtr->_field10 = v;
-	_dataPtr->_field14 = sub1(_dataPtr->_fieldC ? nullptr : &Decompressor::method3, 1 << v);
-
-	if (_dataPtr->_field14)
-		sub2();
-	else
-		close();
-}
-
-int Decompressor::sub1(Method3Fn fn, int v) {
-	return 0;
-}
-
-void Decompressor::close() {
-
-}
-
-DecompressorData *Decompressor::createMethod(int v1, int v2, int v3) {
-	return new DecompressorData();
-}
-
-void Decompressor::destroyMethod(DecompressorData *ptr) {
-	delete ptr;
-}
-
-/*------------------------------------------------------------------------*/
+#define BUFFER_SIZE 1024
 
 CompressedFile::CompressedFile() : SimpleFile() {
-	_fileMode = 0;
-	_isReading = 0;
-	_field260 = 0;
-	_mode = 0;
+	_fileMode = COMPMODE_NONE;
+	Common::fill(&_writeBuffer[0], &_writeBuffer[516], 0);
+	_dataStartPtr = nullptr;
+	_dataPtr = nullptr;
+	_dataRemaining = 0;
+	_dataMaxSize = 0;
+	_dataCount = 0;
 }
 
 CompressedFile::~CompressedFile() {
@@ -108,27 +42,58 @@ CompressedFile::~CompressedFile() {
 void CompressedFile::open(const Common::String &name) {
 	SimpleFile::open(name);
 
-	_decompressor.load();
-	_fileMode = 2;
+	_compression.initDecompress();
+	_fileMode = COMPMODE_READ;
+	_dataPtr = _dataStartPtr = new byte[BUFFER_SIZE];
+	_dataMaxSize = BUFFER_SIZE;
+	_dataRemaining = 0;
+	_dataCount = 0;
 }
 
 void CompressedFile::open(Common::SeekableReadStream *stream) {
 	SimpleFile::open(stream);
 
-	_decompressor.load();
-	_fileMode = 2;
+	_compression.initDecompress();
+	_fileMode = COMPMODE_READ;
+	_dataPtr = _dataStartPtr = new byte[BUFFER_SIZE];
+	_dataMaxSize = BUFFER_SIZE;
+	_dataRemaining = 0;
+	_dataCount = 0;
 }
 
 void CompressedFile::open(Common::OutSaveFile *stream) {
 	SimpleFile::open(stream);
 
-	_decompressor.load();
-	_fileMode = 1;
+	_compression.initCompress();
+	_fileMode = COMPMODE_WRITE;
 }
 
 void CompressedFile::close() {
-	_queue.clear();
-	SimpleFile::close();
+	int result;
+
+	switch (_fileMode) {
+	case COMPMODE_WRITE:
+		do {
+			_compression._destPtr = _writeBuffer;
+			_compression._destCount = 512;
+			result = _compression.compress(4);
+			int count = 512 - _compression._destCount;
+
+			if (count)
+				write(_writeBuffer, count);
+		} while (!result);
+		break;
+	case COMPMODE_READ:
+		_compression.close();
+		delete[] _dataStartPtr;
+		_dataStartPtr = _dataPtr = nullptr;
+		_dataRemaining = _dataMaxSize = 0;
+
+		SimpleFile::close();
+		break;
+	default:
+		break;
+	}
 }
 
 size_t CompressedFile::unsafeRead(void *dst, size_t count) {
@@ -144,22 +109,51 @@ size_t CompressedFile::unsafeRead(void *dst, size_t count) {
 	byte *dataPtr = (byte *)dst;
 
 	while (count > 0) {
-		if (_queue.empty()) {
+		if (!_dataRemaining) {
 			decompress();
-			if (_queue.empty())
+			if (!_dataRemaining)
 				break;
 		}
 
-		*dataPtr++ = _queue.pop();
-		++bytesRead;
-		--count;
+		*dataPtr++ = *_dataPtr++;
+		--_dataRemaining;
 	}
 
 	return bytesRead;
 }
 
 void CompressedFile::decompress() {
+	const size_t COUNT = 1;
+	byte fileByte;
+	int count;
+
+	_dataPtr = _dataStartPtr;
+	_compression._destPtr = _dataStartPtr;
+	_compression._destCount = _dataMaxSize;
+
+	if (_dataMaxSize < 0x100)
+		return;
+
+	// Loop to get data from the file as needed and decompress
+	do {
+		if (!_compression._srcCount) {
+			// Read in next byte from the source file
+			if (!SimpleFile::unsafeRead(&fileByte, 1))
+				break;
 
+			// Set up the decompressor to process the data
+			_compression._srcCount = COUNT;
+			_compression._srcPtr = &fileByte;
+		}
+
+		int count = _compression.decompress(COUNT);
+		_dataRemaining = _dataMaxSize - _compression._destCount;
+
+		if (count == COUNT) {
+			_dataCount = COUNT;
+			break;
+		}
+	} while (!count && _compression._destCount > 0x100);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/compressed_file.h b/engines/titanic/compressed_file.h
index cd9cf83..30b925d 100644
--- a/engines/titanic/compressed_file.h
+++ b/engines/titanic/compressed_file.h
@@ -25,66 +25,27 @@
 
 #include "common/scummsys.h"
 #include "common/file.h"
-#include "common/queue.h"
+#include "titanic/compression.h"
 #include "titanic/simple_file.h"
 #include "titanic/string.h"
 
 namespace Titanic {
 
-class Decompressor;
-class DecompressorData;
-
-typedef DecompressorData *(Decompressor::*DecompressorCreateFn)(int v1, int v2, int v3);
-typedef void(Decompressor::*DecompressorDestroyFn)(DecompressorData *ptr);
-typedef void(Decompressor::*Method3Fn)();
-
-class DecompressorData {
-public:
-	int _field0;
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
-	int _field14;
-public:
-	DecompressorData();
-};
-
-class Decompressor {
-private:
-	DecompressorCreateFn _createFn;
-	DecompressorDestroyFn _destroyFn;
-	int _field18;
-	DecompressorData *_dataPtr;
-	int _field28;
-
-	DecompressorData *createMethod(int v1, int v2, int v3);
-
-	void destroyMethod(DecompressorData *ptr);
-
-	void method3() {
-		// TODO
-	}
-
-	int sub1(Method3Fn fn, int v);
-
-	void sub2() {}
-public:
-	Decompressor();
-
-	void load(const char *version = "1.0.4", int v = 15);
-
-	void close();
-};
+enum CompressedFileMode { COMPMODE_NONE, COMPMODE_WRITE, COMPMODE_READ };
 
+/**
+ * Derived file that handles compressed files
+ */
 class CompressedFile : public SimpleFile {
 private:
-	Decompressor _decompressor;
-	Common::Queue<byte> _queue;
-	int _fileMode;
-	int _isReading;
-	int _field260;
-	int _mode;
+	Compression _compression;
+	CompressedFileMode _fileMode;
+	byte _writeBuffer[516];
+	byte *_dataStartPtr;
+	byte *_dataPtr;
+	int _dataRemaining;
+	int _dataMaxSize;
+	int _dataCount;
 
 	/**
 	 * Decompress data from the source file
diff --git a/engines/titanic/compression.cpp b/engines/titanic/compression.cpp
new file mode 100644
index 0000000..9dad905
--- /dev/null
+++ b/engines/titanic/compression.cpp
@@ -0,0 +1,142 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/compression.h"
+#include "common/textconsole.h"
+
+namespace Titanic {
+
+CompressionData::CompressionData() {
+	_commandNum = 0;
+	_field4 = 0;
+	_field8 = 0;
+	_fieldC = 0;
+	_field10 = 0;
+	_field14 = 0;
+}
+
+/*------------------------------------------------------------------------*/
+
+Compression::Compression() {
+	_srcPtr = nullptr;
+	_srcCount = 0;
+	_field8 = 0;
+	_destPtr = nullptr;
+	_destCount = 0;
+	_field14 = 0;
+	_field18 = 0;
+	_compressionData = nullptr;
+	_createFn = nullptr;
+	_destroyFn = nullptr;
+	_field28 = 0;
+	_field2C = 0;
+	_field30 = 0;
+	_field34 = 0;
+}
+
+Compression::~Compression() {
+	close();
+}
+
+void Compression::initDecompress(const char *version, int v) {
+	if (!version || *version != '1')
+		error("Bad version");
+	
+	_field18 = 0;
+	if (!_createFn) {
+		_createFn = &Compression::createMethod;
+		_field28 = 0;
+	}
+
+	if (!_destroyFn) {
+		_destroyFn = &Compression::destroyMethod;
+	}
+
+	_compressionData = (this->*_createFn)(_field28, 1);
+	_compressionData->_field14 = 0;
+	_compressionData->_fieldC = 0;
+	if (v < 0) {
+		v = -v;
+		_compressionData->_fieldC = 1;
+	}
+
+	if (v < 8 || v > 15)
+		error("Bad parameter");
+
+	_compressionData->_field10 = v;
+	_compressionData->_field14 = sub1(_compressionData->_fieldC ? nullptr : &Compression::method3, 1 << v);
+
+	if (_compressionData->_field14)
+		sub2();
+	else
+		close();
+}
+
+void Compression::initCompress(const char *version, int v) {
+	error("TODO");
+}
+
+
+int Compression::sub1(Method3Fn fn, int v) {
+	return 0;
+}
+
+void Compression::close() {
+	if (_destroyFn)
+		(this->*_destroyFn)(_compressionData);
+}
+
+CompressionData *Compression::createMethod(int v1, int v2) {
+	return new CompressionData();
+}
+
+void Compression::destroyMethod(CompressionData *ptr) {
+	delete ptr;
+}
+
+int Compression::compress(int v) {
+	return 0;
+}
+
+int Compression::decompress(size_t count) {
+/*
+	if (!_compressionData || !_srcPtr || !count)
+		// Needed fields aren't set
+		return -2;
+
+	int result = -5;
+	do {
+		int ebx = 5;
+
+		switch (_compressionData->_commandNum) {
+		case 0:
+			if (_compressionData->_field4)
+				return result;
+
+		default:
+			return -2;
+		}
+	}*/
+	return -2;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/compression.h b/engines/titanic/compression.h
new file mode 100644
index 0000000..6d3a5b9
--- /dev/null
+++ b/engines/titanic/compression.h
@@ -0,0 +1,106 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_COMPRESSION_H
+#define TITANIC_COMPRESSION_H
+
+#include "common/scummsys.h"
+
+namespace Titanic {
+
+class Compression;
+class CompressionData;
+
+typedef CompressionData *(Compression::*CompressionCreateFn)(int v1, int v2);
+typedef void(Compression::*CompressionDestroyFn)(CompressionData *ptr);
+typedef void(Compression::*Method3Fn)();
+
+class CompressionData {
+public:
+	int _commandNum;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+public:
+	CompressionData();
+};
+
+class Compression {
+private:
+	CompressionData *createMethod(int v1, int v2);
+
+	void destroyMethod(CompressionData *ptr);
+
+	void method3() {
+		// TODO
+	}
+
+	int sub1(Method3Fn fn, int v);
+
+	void sub2() {}
+public:
+	byte *_srcPtr;
+	int _srcCount;
+	int _field8;
+	byte *_destPtr;
+	int _destCount;
+	int _field14;
+	int _field18;
+	CompressionData *_compressionData;
+	CompressionCreateFn _createFn;
+	CompressionDestroyFn _destroyFn;
+	int _field28;
+	int _field2C;
+	int _field30;
+	int _field34;
+public:
+	Compression();
+	~Compression();
+
+	/**
+	 * Initialize for decompression
+	 */
+	void initDecompress(const char *version = "1.0.4", int v = 15);
+
+	/**
+	 * Initialize for compression
+	 */
+	void initCompress(const char *version = "1.0.4", int v = -1);
+
+	void close();
+
+	/**
+	 * Compress data
+	 */
+	int compress(int v);
+
+	/**
+	 * Decompress data
+	 */
+	int decompress(size_t count);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_COMPRESSION_H */
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 9087caf..78e07e9 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -39,6 +39,9 @@ bool CMainGameWindow::Create() {
 	bool result = image.loadResource("TITANIC");
 	if (!result)
 		return true;
+
+	// TODO: Stuff
+	return true;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index abd3512..7d126b4 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -2,6 +2,7 @@ MODULE := engines/titanic
 
 MODULE_OBJS := \
 	compressed_file.o \
+	compression.o \
 	detection.o \
 	direct_draw.o \
 	font.o \
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 61b6ff4..08262df 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -70,7 +70,7 @@ OSScreenManager::~OSScreenManager() {
 	destroyFrontAndBackBuffers();
 }
 
-void OSScreenManager::setMode(int width, int height, int bpp, int numBackSurfaces, bool flag2) {
+void OSScreenManager::setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) {
 	destroyFrontAndBackBuffers();
 	_directDrawManager.initVideo(width, height, bpp, numBackSurfaces);
 
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index 4647c71..4836bb3 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -67,7 +67,7 @@ public:
 
 	virtual void setWindowHandle(int v);
 	virtual bool resetWindowHandle(int v);
-	virtual void setMode(int width, int height, int bpp, int numBackSurfaces, bool flag2) = 0;
+	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) = 0;
 	virtual void proc5() = 0;
 	virtual void proc6() = 0;
 	virtual void proc7() = 0;
@@ -116,7 +116,7 @@ public:
 	OSScreenManager(TitanicEngine *vm);
 	virtual ~OSScreenManager();
 
-	virtual void setMode(int width, int height, int bpp, int numBackSurfaces, bool flag2);
+	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2);
 	virtual void proc5();
 	virtual void proc6();
 	virtual void proc7();


Commit: 6bee18dec1578ee37f3c25d91dfd60e00cd063c7
    https://github.com/scummvm/scummvm/commit/6bee18dec1578ee37f3c25d91dfd60e00cd063c7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-21T23:05:16-05:00

Commit Message:
TITANIC: Implement bulk of overall decompression method

Changed paths:
    engines/titanic/compression.cpp
    engines/titanic/compression.h



diff --git a/engines/titanic/compression.cpp b/engines/titanic/compression.cpp
index 9dad905..0c12ee0 100644
--- a/engines/titanic/compression.cpp
+++ b/engines/titanic/compression.cpp
@@ -43,7 +43,7 @@ Compression::Compression() {
 	_destPtr = nullptr;
 	_destCount = 0;
 	_field14 = 0;
-	_field18 = 0;
+	_errorMessage = nullptr;
 	_compressionData = nullptr;
 	_createFn = nullptr;
 	_destroyFn = nullptr;
@@ -61,7 +61,7 @@ void Compression::initDecompress(const char *version, int v) {
 	if (!version || *version != '1')
 		error("Bad version");
 	
-	_field18 = 0;
+	_errorMessage = nullptr;
 	if (!_createFn) {
 		_createFn = &Compression::createMethod;
 		_field28 = 0;
@@ -118,25 +118,174 @@ int Compression::compress(int v) {
 }
 
 int Compression::decompress(size_t count) {
-/*
 	if (!_compressionData || !_srcPtr || !count)
 		// Needed fields aren't set
 		return -2;
 
 	int result = -5;
-	do {
-		int ebx = 5;
+	int ebx = 5;
+	uint v;
 
+	for (;;) {
 		switch (_compressionData->_commandNum) {
 		case 0:
-			if (_compressionData->_field4)
+			if (!_srcCount)
 				return result;
 
+			result = 0;
+			--_srcCount;
+			++_field8;
+			_compressionData->_field4 = *_srcPtr++;
+
+			if ((_compressionData->_field4 & 0xf) == 8) {
+				_compressionData->_commandNum = 13;
+				_compressionData->_field4 = ebx;
+				_errorMessage = "unknown compression method";
+			} else {
+				if ((_compressionData->_field4 / 16 + 8) > _compressionData->_field10) {
+					_compressionData->_commandNum = 13;
+					_compressionData->_field4 = ebx;
+					_errorMessage = "invalid window size";
+				} else {
+					_compressionData->_commandNum = 1;
+				}
+			}
+			break;
+
+		case 1:
+			if (!_srcCount)
+				return result;
+
+			result = 0;
+			--_srcCount;
+			++_field8;
+			v = *_srcPtr++;
+			if ((_compressionData->_field4 * 256 + v) % 31) {
+				_compressionData->_commandNum = 13;
+				_compressionData->_field4 = ebx;
+				ebx = 5;
+				_errorMessage = "incorrect header check";
+			} else if (!(v & 0x20)) {
+				_compressionData->_commandNum = 7;
+				ebx = 5;
+			} else {
+				_compressionData->_commandNum = 2;
+				ebx = 5;
+			}
+			break;
+
+		case 2:
+			if (!_srcCount)
+				return result;
+
+			result = 0;
+			--_srcCount;
+			++_field8;
+			_compressionData->_field8 = (uint)*_srcPtr++ << 24;
+			_compressionData->_commandNum = 3;
+			break;
+
+		case 3:
+			if (!_srcCount)
+				return result;
+
+			result = 0;
+			--_srcCount;
+			++_field8;
+			_compressionData->_field8 += (uint)*_srcPtr++ << 16;
+			_compressionData->_commandNum = 4;
+			break;
+
+		case 4:
+			if (!_srcCount)
+				return result;
+
+			result = 0;
+			--_srcCount;
+			++_field8;
+			_compressionData->_field8 = (uint)*_srcPtr++ << 8;
+			_compressionData->_commandNum = ebx;
+			break;
+
+		case 5:
+			if (!_srcCount)
+				return result;
+
+			--_srcCount;
+			++_field8;
+			_compressionData->_field8 += *_srcPtr++;
+			_compressionData->_commandNum = ebx;
+			_field30 = _compressionData->_field8;
+			_compressionData->_commandNum = 6;
+			return 2;
+
+		case 6:
+			_compressionData->_commandNum = 13;
+			_compressionData->_field4 = 0;
+			_errorMessage = "need dictionary";
+			return -2;
+
+		case 7:
+			error("TODO");
+			break;
+
+		case 8:
+			if (!_srcCount)
+				return result;
+
+			--_srcCount;
+			++_field8;
+			_compressionData->_field8 += *_srcPtr++ << 24;
+			_compressionData->_commandNum = 9;
+			break;
+
+		case 9:
+			if (!_srcCount)
+				return result;
+
+			--_srcCount;
+			++_field8;
+			_compressionData->_field8 += *_srcPtr++ << 16;
+			_compressionData->_commandNum = 10;
+			break;
+
+		case 10:
+			if (!_srcCount)
+				return result;
+
+			--_srcCount;
+			++_field8;
+			_compressionData->_field8 += *_srcPtr++ << 8;
+			_compressionData->_commandNum = 11;
+			break;
+
+		case 11:
+			if (!_srcCount)
+				return result;
+
+			--_srcCount;
+			++_field8;
+			_compressionData->_field8 += *_srcPtr++ << 8;
+
+			if (_compressionData->_field4 == _compressionData->_field8) {
+				_compressionData->_commandNum = 12;
+			} else {
+				_compressionData->_commandNum = 13;
+				_compressionData->_field4 = ebx;
+				_errorMessage = "incorrect data check";				
+			}
+			break;
+
+		case 12:
+			return 1;
+
+		case 13:
+			return -3;
+
 		default:
 			return -2;
 		}
-	}*/
-	return -2;
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/compression.h b/engines/titanic/compression.h
index 6d3a5b9..fb784ce 100644
--- a/engines/titanic/compression.h
+++ b/engines/titanic/compression.h
@@ -66,7 +66,7 @@ public:
 	byte *_destPtr;
 	int _destCount;
 	int _field14;
-	int _field18;
+	const char *_errorMessage;
 	CompressionData *_compressionData;
 	CompressionCreateFn _createFn;
 	CompressionDestroyFn _destroyFn;


Commit: 29215ff3647b5ed2e5ccc40fd7534b0070edd62b
    https://github.com/scummvm/scummvm/commit/29215ff3647b5ed2e5ccc40fd7534b0070edd62b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-22T08:04:11-05:00

Commit Message:
TITANIC: Change CompressedFile to use common/zlib.h

Changed paths:
  R engines/titanic/compression.cpp
  R engines/titanic/compression.h
    engines/titanic/compressed_file.cpp
    engines/titanic/compressed_file.h
    engines/titanic/simple_file.cpp
    engines/titanic/simple_file.h



diff --git a/engines/titanic/compressed_file.cpp b/engines/titanic/compressed_file.cpp
index c200370..d0cd376 100644
--- a/engines/titanic/compressed_file.cpp
+++ b/engines/titanic/compressed_file.cpp
@@ -27,13 +27,8 @@ namespace Titanic {
 #define BUFFER_SIZE 1024
 
 CompressedFile::CompressedFile() : SimpleFile() {
-	_fileMode = COMPMODE_NONE;
-	Common::fill(&_writeBuffer[0], &_writeBuffer[516], 0);
-	_dataStartPtr = nullptr;
-	_dataPtr = nullptr;
-	_dataRemaining = 0;
-	_dataMaxSize = 0;
-	_dataCount = 0;
+	_readStream = nullptr;
+	_writeStream = nullptr;
 }
 
 CompressedFile::~CompressedFile() {
@@ -41,119 +36,39 @@ CompressedFile::~CompressedFile() {
 
 void CompressedFile::open(const Common::String &name) {
 	SimpleFile::open(name);
-
-	_compression.initDecompress();
-	_fileMode = COMPMODE_READ;
-	_dataPtr = _dataStartPtr = new byte[BUFFER_SIZE];
-	_dataMaxSize = BUFFER_SIZE;
-	_dataRemaining = 0;
-	_dataCount = 0;
+	_readStream = Common::wrapCompressedReadStream(&_file);
 }
 
 void CompressedFile::open(Common::SeekableReadStream *stream) {
 	SimpleFile::open(stream);
-
-	_compression.initDecompress();
-	_fileMode = COMPMODE_READ;
-	_dataPtr = _dataStartPtr = new byte[BUFFER_SIZE];
-	_dataMaxSize = BUFFER_SIZE;
-	_dataRemaining = 0;
-	_dataCount = 0;
+	_readStream = Common::wrapCompressedReadStream(&_file);
 }
 
 void CompressedFile::open(Common::OutSaveFile *stream) {
 	SimpleFile::open(stream);
-
-	_compression.initCompress();
-	_fileMode = COMPMODE_WRITE;
+	_writeStream = Common::wrapCompressedWriteStream(stream);
 }
 
 void CompressedFile::close() {
-	int result;
-
-	switch (_fileMode) {
-	case COMPMODE_WRITE:
-		do {
-			_compression._destPtr = _writeBuffer;
-			_compression._destCount = 512;
-			result = _compression.compress(4);
-			int count = 512 - _compression._destCount;
+	delete _readStream;
+	delete _writeStream;
+	_readStream = nullptr;
+	_writeStream = nullptr;
 
-			if (count)
-				write(_writeBuffer, count);
-		} while (!result);
-		break;
-	case COMPMODE_READ:
-		_compression.close();
-		delete[] _dataStartPtr;
-		_dataStartPtr = _dataPtr = nullptr;
-		_dataRemaining = _dataMaxSize = 0;
-
-		SimpleFile::close();
-		break;
-	default:
-		break;
-	}
+	SimpleFile::close();
 }
 
 size_t CompressedFile::unsafeRead(void *dst, size_t count) {
-	assert(_file.isOpen());
+	assert(_readStream);
 	if (count == 0)
 		return 0;
 
-	// Ensure there's enough data queued in the buffer
-	decompress();
-
-	// Pass the data to the output buffer
-	size_t bytesRead = 0;
-	byte *dataPtr = (byte *)dst;
-
-	while (count > 0) {
-		if (!_dataRemaining) {
-			decompress();
-			if (!_dataRemaining)
-				break;
-		}
-
-		*dataPtr++ = *_dataPtr++;
-		--_dataRemaining;
-	}
-
-	return bytesRead;
+	// Read data and decompress
+	return _readStream->read(dst, count);
 }
 
-void CompressedFile::decompress() {
-	const size_t COUNT = 1;
-	byte fileByte;
-	int count;
-
-	_dataPtr = _dataStartPtr;
-	_compression._destPtr = _dataStartPtr;
-	_compression._destCount = _dataMaxSize;
-
-	if (_dataMaxSize < 0x100)
-		return;
-
-	// Loop to get data from the file as needed and decompress
-	do {
-		if (!_compression._srcCount) {
-			// Read in next byte from the source file
-			if (!SimpleFile::unsafeRead(&fileByte, 1))
-				break;
-
-			// Set up the decompressor to process the data
-			_compression._srcCount = COUNT;
-			_compression._srcPtr = &fileByte;
-		}
-
-		int count = _compression.decompress(COUNT);
-		_dataRemaining = _dataMaxSize - _compression._destCount;
-
-		if (count == COUNT) {
-			_dataCount = COUNT;
-			break;
-		}
-	} while (!count && _compression._destCount > 0x100);
+size_t CompressedFile::write(const void *src, size_t count) {
+	return _writeStream->write(src, count);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/compressed_file.h b/engines/titanic/compressed_file.h
index 30b925d..4b1051b 100644
--- a/engines/titanic/compressed_file.h
+++ b/engines/titanic/compressed_file.h
@@ -25,32 +25,20 @@
 
 #include "common/scummsys.h"
 #include "common/file.h"
-#include "titanic/compression.h"
+#include "common/memstream.h"
+#include "common/zlib.h"
 #include "titanic/simple_file.h"
 #include "titanic/string.h"
 
 namespace Titanic {
 
-enum CompressedFileMode { COMPMODE_NONE, COMPMODE_WRITE, COMPMODE_READ };
-
 /**
  * Derived file that handles compressed files
  */
 class CompressedFile : public SimpleFile {
 private:
-	Compression _compression;
-	CompressedFileMode _fileMode;
-	byte _writeBuffer[516];
-	byte *_dataStartPtr;
-	byte *_dataPtr;
-	int _dataRemaining;
-	int _dataMaxSize;
-	int _dataCount;
-
-	/**
-	 * Decompress data from the source file
-	 */
-	void decompress();
+	Common::SeekableReadStream *_readStream;
+	Common::WriteStream *_writeStream;
 public:
 	CompressedFile();
 	virtual ~CompressedFile();
@@ -79,6 +67,11 @@ public:
 	 * Read from the file
 	 */
 	virtual size_t unsafeRead(void *dst, size_t count);
+
+	/**
+	 * Write out data
+	 */
+	virtual size_t write(const void *src, size_t count);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/compression.cpp b/engines/titanic/compression.cpp
deleted file mode 100644
index 0c12ee0..0000000
--- a/engines/titanic/compression.cpp
+++ /dev/null
@@ -1,291 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/compression.h"
-#include "common/textconsole.h"
-
-namespace Titanic {
-
-CompressionData::CompressionData() {
-	_commandNum = 0;
-	_field4 = 0;
-	_field8 = 0;
-	_fieldC = 0;
-	_field10 = 0;
-	_field14 = 0;
-}
-
-/*------------------------------------------------------------------------*/
-
-Compression::Compression() {
-	_srcPtr = nullptr;
-	_srcCount = 0;
-	_field8 = 0;
-	_destPtr = nullptr;
-	_destCount = 0;
-	_field14 = 0;
-	_errorMessage = nullptr;
-	_compressionData = nullptr;
-	_createFn = nullptr;
-	_destroyFn = nullptr;
-	_field28 = 0;
-	_field2C = 0;
-	_field30 = 0;
-	_field34 = 0;
-}
-
-Compression::~Compression() {
-	close();
-}
-
-void Compression::initDecompress(const char *version, int v) {
-	if (!version || *version != '1')
-		error("Bad version");
-	
-	_errorMessage = nullptr;
-	if (!_createFn) {
-		_createFn = &Compression::createMethod;
-		_field28 = 0;
-	}
-
-	if (!_destroyFn) {
-		_destroyFn = &Compression::destroyMethod;
-	}
-
-	_compressionData = (this->*_createFn)(_field28, 1);
-	_compressionData->_field14 = 0;
-	_compressionData->_fieldC = 0;
-	if (v < 0) {
-		v = -v;
-		_compressionData->_fieldC = 1;
-	}
-
-	if (v < 8 || v > 15)
-		error("Bad parameter");
-
-	_compressionData->_field10 = v;
-	_compressionData->_field14 = sub1(_compressionData->_fieldC ? nullptr : &Compression::method3, 1 << v);
-
-	if (_compressionData->_field14)
-		sub2();
-	else
-		close();
-}
-
-void Compression::initCompress(const char *version, int v) {
-	error("TODO");
-}
-
-
-int Compression::sub1(Method3Fn fn, int v) {
-	return 0;
-}
-
-void Compression::close() {
-	if (_destroyFn)
-		(this->*_destroyFn)(_compressionData);
-}
-
-CompressionData *Compression::createMethod(int v1, int v2) {
-	return new CompressionData();
-}
-
-void Compression::destroyMethod(CompressionData *ptr) {
-	delete ptr;
-}
-
-int Compression::compress(int v) {
-	return 0;
-}
-
-int Compression::decompress(size_t count) {
-	if (!_compressionData || !_srcPtr || !count)
-		// Needed fields aren't set
-		return -2;
-
-	int result = -5;
-	int ebx = 5;
-	uint v;
-
-	for (;;) {
-		switch (_compressionData->_commandNum) {
-		case 0:
-			if (!_srcCount)
-				return result;
-
-			result = 0;
-			--_srcCount;
-			++_field8;
-			_compressionData->_field4 = *_srcPtr++;
-
-			if ((_compressionData->_field4 & 0xf) == 8) {
-				_compressionData->_commandNum = 13;
-				_compressionData->_field4 = ebx;
-				_errorMessage = "unknown compression method";
-			} else {
-				if ((_compressionData->_field4 / 16 + 8) > _compressionData->_field10) {
-					_compressionData->_commandNum = 13;
-					_compressionData->_field4 = ebx;
-					_errorMessage = "invalid window size";
-				} else {
-					_compressionData->_commandNum = 1;
-				}
-			}
-			break;
-
-		case 1:
-			if (!_srcCount)
-				return result;
-
-			result = 0;
-			--_srcCount;
-			++_field8;
-			v = *_srcPtr++;
-			if ((_compressionData->_field4 * 256 + v) % 31) {
-				_compressionData->_commandNum = 13;
-				_compressionData->_field4 = ebx;
-				ebx = 5;
-				_errorMessage = "incorrect header check";
-			} else if (!(v & 0x20)) {
-				_compressionData->_commandNum = 7;
-				ebx = 5;
-			} else {
-				_compressionData->_commandNum = 2;
-				ebx = 5;
-			}
-			break;
-
-		case 2:
-			if (!_srcCount)
-				return result;
-
-			result = 0;
-			--_srcCount;
-			++_field8;
-			_compressionData->_field8 = (uint)*_srcPtr++ << 24;
-			_compressionData->_commandNum = 3;
-			break;
-
-		case 3:
-			if (!_srcCount)
-				return result;
-
-			result = 0;
-			--_srcCount;
-			++_field8;
-			_compressionData->_field8 += (uint)*_srcPtr++ << 16;
-			_compressionData->_commandNum = 4;
-			break;
-
-		case 4:
-			if (!_srcCount)
-				return result;
-
-			result = 0;
-			--_srcCount;
-			++_field8;
-			_compressionData->_field8 = (uint)*_srcPtr++ << 8;
-			_compressionData->_commandNum = ebx;
-			break;
-
-		case 5:
-			if (!_srcCount)
-				return result;
-
-			--_srcCount;
-			++_field8;
-			_compressionData->_field8 += *_srcPtr++;
-			_compressionData->_commandNum = ebx;
-			_field30 = _compressionData->_field8;
-			_compressionData->_commandNum = 6;
-			return 2;
-
-		case 6:
-			_compressionData->_commandNum = 13;
-			_compressionData->_field4 = 0;
-			_errorMessage = "need dictionary";
-			return -2;
-
-		case 7:
-			error("TODO");
-			break;
-
-		case 8:
-			if (!_srcCount)
-				return result;
-
-			--_srcCount;
-			++_field8;
-			_compressionData->_field8 += *_srcPtr++ << 24;
-			_compressionData->_commandNum = 9;
-			break;
-
-		case 9:
-			if (!_srcCount)
-				return result;
-
-			--_srcCount;
-			++_field8;
-			_compressionData->_field8 += *_srcPtr++ << 16;
-			_compressionData->_commandNum = 10;
-			break;
-
-		case 10:
-			if (!_srcCount)
-				return result;
-
-			--_srcCount;
-			++_field8;
-			_compressionData->_field8 += *_srcPtr++ << 8;
-			_compressionData->_commandNum = 11;
-			break;
-
-		case 11:
-			if (!_srcCount)
-				return result;
-
-			--_srcCount;
-			++_field8;
-			_compressionData->_field8 += *_srcPtr++ << 8;
-
-			if (_compressionData->_field4 == _compressionData->_field8) {
-				_compressionData->_commandNum = 12;
-			} else {
-				_compressionData->_commandNum = 13;
-				_compressionData->_field4 = ebx;
-				_errorMessage = "incorrect data check";				
-			}
-			break;
-
-		case 12:
-			return 1;
-
-		case 13:
-			return -3;
-
-		default:
-			return -2;
-		}
-	}
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/compression.h b/engines/titanic/compression.h
deleted file mode 100644
index fb784ce..0000000
--- a/engines/titanic/compression.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_COMPRESSION_H
-#define TITANIC_COMPRESSION_H
-
-#include "common/scummsys.h"
-
-namespace Titanic {
-
-class Compression;
-class CompressionData;
-
-typedef CompressionData *(Compression::*CompressionCreateFn)(int v1, int v2);
-typedef void(Compression::*CompressionDestroyFn)(CompressionData *ptr);
-typedef void(Compression::*Method3Fn)();
-
-class CompressionData {
-public:
-	int _commandNum;
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
-	int _field14;
-public:
-	CompressionData();
-};
-
-class Compression {
-private:
-	CompressionData *createMethod(int v1, int v2);
-
-	void destroyMethod(CompressionData *ptr);
-
-	void method3() {
-		// TODO
-	}
-
-	int sub1(Method3Fn fn, int v);
-
-	void sub2() {}
-public:
-	byte *_srcPtr;
-	int _srcCount;
-	int _field8;
-	byte *_destPtr;
-	int _destCount;
-	int _field14;
-	const char *_errorMessage;
-	CompressionData *_compressionData;
-	CompressionCreateFn _createFn;
-	CompressionDestroyFn _destroyFn;
-	int _field28;
-	int _field2C;
-	int _field30;
-	int _field34;
-public:
-	Compression();
-	~Compression();
-
-	/**
-	 * Initialize for decompression
-	 */
-	void initDecompress(const char *version = "1.0.4", int v = 15);
-
-	/**
-	 * Initialize for compression
-	 */
-	void initCompress(const char *version = "1.0.4", int v = -1);
-
-	void close();
-
-	/**
-	 * Compress data
-	 */
-	int compress(int v);
-
-	/**
-	 * Decompress data
-	 */
-	int decompress(size_t count);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_COMPRESSION_H */
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index cf95aca2..521f9e9 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -74,11 +74,6 @@ size_t SimpleFile::write(const void *src, size_t count) {
 	return _outStream->write(src, count);
 }
 
-bool SimpleFile::eof() const {
-	assert(_inStream);
-	return _inStream->pos() >= _inStream->size();
-}
-
 CString SimpleFile::readString() {
 	char c;
 	CString result;
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
index 65b0ac6..852c75b 100644
--- a/engines/titanic/simple_file.h
+++ b/engines/titanic/simple_file.h
@@ -80,11 +80,6 @@ public:
 	virtual size_t write(const void *src, size_t count);
 
 	/**
-	 * Return true if the end of the file has been reached
-	 */
-	bool eof() const;
-
-	/**
 	 * Read a string from the file
 	 */
 	CString readString();


Commit: 572fc8fc9ee65ec29c346f00cb34da482dda8d90
    https://github.com/scummvm/scummvm/commit/572fc8fc9ee65ec29c346f00cb34da482dda8d90
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-22T20:43:14-05:00

Commit Message:
TITANIC: Implemented bulk of applicationStarting

Changed paths:
  A engines/titanic/game_manager.cpp
  A engines/titanic/game_manager.h
  A engines/titanic/game_view.cpp
  A engines/titanic/game_view.h
    engines/titanic/main_game_window.cpp
    engines/titanic/main_game_window.h
    engines/titanic/module.mk
    engines/titanic/objects/project_item.h
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
new file mode 100644
index 0000000..94e1ad3
--- /dev/null
+++ b/engines/titanic/game_manager.cpp
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game_manager.h"
+
+namespace Titanic {
+
+CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
+		_project(project), _gameView(gameView) {
+	// TODO
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
new file mode 100644
index 0000000..0c1374e
--- /dev/null
+++ b/engines/titanic/game_manager.h
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GAME_MANAGER_H
+#define TITANIC_GAME_MANAGER_H
+
+#include "common/scummsys.h"
+
+namespace Titanic {
+
+class CProjectItem;
+class CGameView;
+
+class CGameManager {
+private:
+	CProjectItem *_project;
+	CGameView *_gameView;
+public:
+	CGameManager(CProjectItem *project, CGameView *gameView);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GAME_MANAGER_H */
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
new file mode 100644
index 0000000..d8410f1
--- /dev/null
+++ b/engines/titanic/game_view.cpp
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game_view.h"
+#include "titanic/game_manager.h"
+
+namespace Titanic {
+
+CGameView::CGameView() : _gameManager(nullptr), _field8(0), _fieldC(0) {
+}
+
+void CGameView::setGameManager(CGameManager *gameManager) {
+	_gameManager = gameManager;
+}
+
+/*------------------------------------------------------------------------*/
+
+CTitanicGameView::CTitanicGameView(CMainGameWindow *gameWindow) : 
+		CGameView(), _gameWindow(gameWindow) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h
new file mode 100644
index 0000000..588cf93
--- /dev/null
+++ b/engines/titanic/game_view.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GAME_VIEW_H
+#define TITANIC_GAME_VIEW_H
+
+#include "common/scummsys.h"
+
+namespace Titanic {
+
+class CMainGameWindow;
+class CGameManager;
+
+class CGameView {
+protected:
+	CGameManager *_gameManager;
+	int _field8;
+	int _fieldC;
+public:
+	CGameView();
+
+	/**
+	 * Set the game manager
+	 */
+	void setGameManager(CGameManager *gameManager);
+};
+
+class CTitanicGameView: public CGameView {
+private:
+	CMainGameWindow *_gameWindow;
+public:
+	CTitanicGameView(CMainGameWindow *gameWindow);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GAME_VIEW_H */
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 78e07e9..41eb825 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -22,6 +22,8 @@
 
 #include "titanic/titanic.h"
 #include "titanic/main_game_window.h"
+#include "titanic/game_manager.h"
+#include "titanic/game_view.h"
 
 namespace Titanic {
 
@@ -44,4 +46,38 @@ bool CMainGameWindow::Create() {
 	return true;
 }
 
+void CMainGameWindow::applicationStarting() {
+	// Set up the game project, and get game slot
+	int saveSlot = selectSavegame();
+	assert(_project);
+	
+	// Set the video mode
+	CScreenManager *screenManager = CScreenManager::setCurrent();
+	screenManager->setMode(640, 480, 1, 1, false);
+
+	// TODO: Clear surfaces
+
+	// Create game view and manager
+	_gameView = new CTitanicGameView(this);
+	_gameManager = new CGameManager(_project, _gameView);
+	_gameView->setGameManager(_gameManager);
+
+	// Load either a new game or selected existing save
+	_project->loadGame(saveSlot);
+
+	// TODO: Cursor/image and message generation
+}
+
+int CMainGameWindow::loadGame() {
+	_project = new CProjectItem();
+	_project->setFilename("starship.prj");
+
+	return selectSavegame();
+}
+
+int CMainGameWindow::selectSavegame() {
+	// TODO: For now, hardcoded to -1 for new saves
+	return -1;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 9b41212..dc2fdfd 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -25,7 +25,10 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
+#include "titanic/game_manager.h"
+#include "titanic/game_view.h"
 #include "titanic/image.h"
+#include "titanic/objects/project_item.h"
 
 namespace Titanic {
 
@@ -34,10 +37,22 @@ class TitanicEngine;
 class CMainGameWindow {
 private:
 	TitanicEngine *_vm;
+
+	/**
+	 * Checks for the presence of any savegames and, if present,
+	 * lets the user pick one to resume
+	 */
+	int loadGame();
+
+	/**
+	 * Creates the game "project" and determine a game save slot
+	 * to use
+	 */
+	int selectSavegame();
 public:
-	void *_gameView;
-	void *_gameManager;
-	void *_project;
+	CGameView *_gameView;
+	CGameManager *_gameManager;
+	CProjectItem *_project;
 	int _field50;
 	Image *_image;
 	void *_cursor;
@@ -48,6 +63,11 @@ public:
 	 * Creates the window
 	 */
 	bool Create();
+
+	/**
+	 * Called when the application starts
+	 */
+	void applicationStarting();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 7d126b4..fc855d2 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -6,6 +6,8 @@ MODULE_OBJS := \
 	detection.o \
 	direct_draw.o \
 	font.o \
+	game_manager.o \
+	game_view.o \
 	image.o \
 	main_game_window.o \
 	screen_manager.o \
diff --git a/engines/titanic/objects/project_item.h b/engines/titanic/objects/project_item.h
index 60fee9b..b313387 100644
--- a/engines/titanic/objects/project_item.h
+++ b/engines/titanic/objects/project_item.h
@@ -72,6 +72,11 @@ public:
 	 * Clear any currently loaded project
 	 */
 	void clear();
+
+	/**
+	 * Set the proejct's name
+	 */
+	void setFilename(const CString &name) { _filename = name; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 08262df..9df9fc3 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -34,8 +34,12 @@ CScreenManagerRec::CScreenManagerRec() {
 
 /*------------------------------------------------------------------------*/
 
+CScreenManager *CScreenManager::_screenManagerPtr;
+CScreenManager *CScreenManager::_currentScreenManagerPtr;
+
 CScreenManager::CScreenManager(TitanicEngine *vm): _vm(vm) {
 	_screenManagerPtr = nullptr;
+	_currentScreenManagerPtr = nullptr;
 
 	_frontRenderSurface = nullptr;
 	_mouseCursor = nullptr;
@@ -56,6 +60,13 @@ bool CScreenManager::resetWindowHandle(int v) {
 	return true;
 }
 
+CScreenManager *CScreenManager::setCurrent() {
+	if (!_currentScreenManagerPtr)
+		_currentScreenManagerPtr = _screenManagerPtr;
+
+	return _currentScreenManagerPtr;
+}
+
 /*------------------------------------------------------------------------*/
 
 OSScreenManager::OSScreenManager(TitanicEngine *vm): CScreenManager(vm),
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index 4836bb3..0b847c2 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -50,7 +50,13 @@ class CScreenManager {
 protected:
 	TitanicEngine *_vm;
 public:
-	void *_screenManagerPtr;
+	static CScreenManager *_screenManagerPtr;
+	static CScreenManager *_currentScreenManagerPtr;
+
+	/**
+	 * Set the current screen manager
+	 */
+	static CScreenManager *setCurrent();
 public:
 	Common::Array<CVideoSurface *> _backSurfaces;
 	CVideoSurface *_frontRenderSurface;


Commit: 063f8a97c842fa6745746180daffb513bda79658
    https://github.com/scummvm/scummvm/commit/063f8a97c842fa6745746180daffb513bda79658
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-22T21:15:20-05:00

Commit Message:
TITANIC: Fixes for game startup

Changed paths:
    engines/titanic/detection_tables.h
    engines/titanic/game_manager.cpp
    engines/titanic/main_game_window.cpp
    engines/titanic/objects/project_item.cpp
    engines/titanic/objects/saveable_object.cpp
    engines/titanic/screen_manager.cpp
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/detection_tables.h b/engines/titanic/detection_tables.h
index dab7bd5..e9cdcab 100644
--- a/engines/titanic/detection_tables.h
+++ b/engines/titanic/detection_tables.h
@@ -27,7 +27,7 @@ static const TitanicGameDescription gameDescriptions[] = {
 		{
 			"titanic",
 			0,
-			AD_ENTRY1s("a.st", "b283436d90974fdc81accc95dbd8e61c", 15405985),
+			AD_ENTRY1s("newgame.st", "c276f2661f0d0a547445a65db78b2292", 87227),
 			Common::EN_ANY,
 			Common::kPlatformWindows,
 			ADGF_NO_FLAGS,
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 94e1ad3..d29180f 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/game_manager.h"
+#include "titanic/screen_manager.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 41eb825..c4eec39 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -48,7 +48,7 @@ bool CMainGameWindow::Create() {
 
 void CMainGameWindow::applicationStarting() {
 	// Set up the game project, and get game slot
-	int saveSlot = selectSavegame();
+	int saveSlot = loadGame();
 	assert(_project);
 	
 	// Set the video mode
diff --git a/engines/titanic/objects/project_item.cpp b/engines/titanic/objects/project_item.cpp
index 599af89..ee3cb3f 100644
--- a/engines/titanic/objects/project_item.cpp
+++ b/engines/titanic/objects/project_item.cpp
@@ -28,11 +28,14 @@
 namespace Titanic {
 
 void CProjectItem::save(SimpleFile *file, int indent) const {
-	error("TODO");
+	file->writeNumberLine(6, indent);
+
 }
 
 void CProjectItem::load(SimpleFile *file) {
-	error("TODO");
+	file->readNumber();
+
+
 }
 
 void CProjectItem::loadGame(int slotId) {
@@ -43,7 +46,7 @@ void CProjectItem::loadGame(int slotId) {
 	clear();
 
 	// Open either an existing savegame slot or the new game template
-	if (slotId > 0) {
+	if (slotId >= 0) {
 		saveFile = g_system->getSavefileManager()->openForLoading(
 			Common::String::format("slot%d.gam", slotId));
 		file.open(saveFile);
@@ -109,8 +112,7 @@ CProjectItem *CProjectItem::loadData(SimpleFile *file) {
 				// TODO: Validate this is correct
 				root = dynamic_cast<CProjectItem *>(item);
 				assert(root);
-
-				_filename = root->_filename;
+				root->_filename = _filename;
 			}
 
 			// Load the data for the item
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
index 25bd164..201fe10 100644
--- a/engines/titanic/objects/saveable_object.cpp
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -33,7 +33,7 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 	CSaveableObject::_classList = nullptr;
 
 #define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
-#define ADDFN(T) (*_classList)["TEST"] = Function##T
+#define ADDFN(T) (*_classList)[#T] = Function##T
 
 DEFFN(List);
 DEFFN(ListItem);
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 9df9fc3..0846b81 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -45,6 +45,9 @@ CScreenManager::CScreenManager(TitanicEngine *vm): _vm(vm) {
 	_mouseCursor = nullptr;
 	_textCursor = nullptr;
 	_fontNumber = 0;
+	// TODO: Further initialization
+
+	_screenManagerPtr = this;
 }
 
 CScreenManager::~CScreenManager() {
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 57f3c7d..d998ec5 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -52,8 +52,9 @@ void TitanicEngine::initialize() {
 	DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
 
 	CSaveableObject::initClassList();
-	_window = new CMainGameWindow(this);
 	_screenManager = new OSScreenManager(this);
+	_window = new CMainGameWindow(this);
+	_window->applicationStarting();
 }
 
 Common::Error TitanicEngine::run() {


Commit: 938316b7dfdbbdf00b2b6e50ea2f05d856e15593
    https://github.com/scummvm/scummvm/commit/938316b7dfdbbdf00b2b6e50ea2f05d856e15593
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-22T22:39:37-05:00

Commit Message:
TITANIC: Implementing CProjectItem loading

Changed paths:
    engines/titanic/objects/file_item.h
    engines/titanic/objects/list.cpp
    engines/titanic/objects/list.h
    engines/titanic/objects/project_item.cpp
    engines/titanic/objects/project_item.h



diff --git a/engines/titanic/objects/file_item.h b/engines/titanic/objects/file_item.h
index 133421a..2261598 100644
--- a/engines/titanic/objects/file_item.h
+++ b/engines/titanic/objects/file_item.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_FILE_ITEM_H
 #define TITANIC_FILE_ITEM_H
 
+#include "titanic/objects/list.h"
 #include "titanic/objects/tree_item.h"
 
 namespace Titanic {
diff --git a/engines/titanic/objects/list.cpp b/engines/titanic/objects/list.cpp
index ddcddb0..1ebffac 100644
--- a/engines/titanic/objects/list.cpp
+++ b/engines/titanic/objects/list.cpp
@@ -85,4 +85,13 @@ void List::loadItems(SimpleFile *file) {
 	}
 }
 
+void List::destroyContents() {
+	for (iterator i = begin(); i != end(); ++i) {
+		CSaveableObject *obj = *i;
+		delete obj;
+	}
+
+	clear();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/list.h b/engines/titanic/objects/list.h
index f989127..ceb4715 100644
--- a/engines/titanic/objects/list.h
+++ b/engines/titanic/objects/list.h
@@ -75,6 +75,11 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
+
+	/**
+	 * Clear the list and destroy any items in it
+	 */
+	void destroyContents();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/project_item.cpp b/engines/titanic/objects/project_item.cpp
index ee3cb3f..8211854 100644
--- a/engines/titanic/objects/project_item.cpp
+++ b/engines/titanic/objects/project_item.cpp
@@ -27,15 +27,62 @@
 
 namespace Titanic {
 
+CProjectItem::CProjectItem() : _field34(0), _field38(0), _field3C(0) {
+}
+
 void CProjectItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(6, indent);
 
 }
 
 void CProjectItem::load(SimpleFile *file) {
-	file->readNumber();
+	int val = file->readNumber();
+	load2(file, val);
+}
+
+void CProjectItem::load2(SimpleFile *file, int val) {
+	int count;
+	_items.destroyContents();
 
+	switch (val) {
+	case 1:
+		file->readBuffer();
+		_field34 = file->readNumber();
+		// Deliberate fall-through
+
+	case 0:
+		count = file->readNumber();
+		for (int idx = 0; idx < count; ++idx) {
+
+		}
+		break;
+
+	case 6:
+		file->readBuffer();
+		_field3C = file->readNumber();
+		// Deliberate fall-through
+
+	case 5:
+		file->readBuffer();
+		_field38 = file->readNumber();
+		// Deliberate fall-through
+
+	case 4:
+		file->readBuffer();
+		// Deliberate fall-through
+
+	case 2:
+	case 3:
+		_items.load(file);
+		file->readBuffer();
+		_field34 = file->readNumber();
+		break;
+
+	default:
+		break;
+	}
 
+	CTreeItem::load(file);
 }
 
 void CProjectItem::loadGame(int slotId) {
diff --git a/engines/titanic/objects/project_item.h b/engines/titanic/objects/project_item.h
index b313387..d769f3d 100644
--- a/engines/titanic/objects/project_item.h
+++ b/engines/titanic/objects/project_item.h
@@ -32,6 +32,15 @@ namespace Titanic {
 class CProjectItem : public CFileItem {
 private:
 	CString _filename;
+	List _items;
+	int _field34;
+	int _field38;
+	int _field3C;
+
+	/**
+	 * Load data for the project
+	 */
+	void load2(SimpleFile *file, int val);
 private:
 	/**
 	 * Load project data from the passed file
@@ -43,6 +52,8 @@ private:
 	 */
 	void saveData(SimpleFile *file, CTreeItem *item) const;
 public:
+	CProjectItem();
+
 	/**
 	 * Return the class name
 	 */


Commit: a0dbab62b99afa331b5162a8c81a4db391cbd09e
    https://github.com/scummvm/scummvm/commit/a0dbab62b99afa331b5162a8c81a4db391cbd09e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-23T20:59:57-05:00

Commit Message:
TITANIC: Major fleshing out of game loading code

Changed paths:
  A engines/titanic/objects/dont_save_file_item.cpp
  A engines/titanic/objects/dont_save_file_item.h
  A engines/titanic/objects/game_object.cpp
  A engines/titanic/objects/game_object.h
  A engines/titanic/objects/named_item.cpp
  A engines/titanic/objects/named_item.h
  A engines/titanic/objects/pet_control.cpp
  A engines/titanic/objects/pet_control.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/module.mk
    engines/titanic/objects/file_item.cpp
    engines/titanic/objects/file_item.h
    engines/titanic/objects/list.cpp
    engines/titanic/objects/list.h
    engines/titanic/objects/message_target.cpp
    engines/titanic/objects/message_target.h
    engines/titanic/objects/project_item.cpp
    engines/titanic/objects/project_item.h
    engines/titanic/objects/saveable_object.cpp
    engines/titanic/objects/tree_item.cpp
    engines/titanic/objects/tree_item.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index d29180f..5e64962 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -30,4 +30,12 @@ CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
 	// TODO
 }
 
+void CGameManager::load(SimpleFile *file) {
+	// TODO
+}
+
+void CGameManager::gameLoaded() {
+	// TODO
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 0c1374e..d776c00 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -24,6 +24,7 @@
 #define TITANIC_GAME_MANAGER_H
 
 #include "common/scummsys.h"
+#include "titanic/simple_file.h"
 
 namespace Titanic {
 
@@ -36,6 +37,16 @@ private:
 	CGameView *_gameView;
 public:
 	CGameManager(CProjectItem *project, CGameView *gameView);
+
+	/**
+	 * Load data from a save file
+	 */
+	void load(SimpleFile *file);
+
+	/**
+	 * Called after loading a game has finished
+	 */
+	void gameLoaded();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index fc855d2..6d1e546 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -15,9 +15,13 @@ MODULE_OBJS := \
 	string.o \
 	titanic.o \
 	video_surface.o \
+	objects/dont_save_file_item.o \
 	objects/file_item.o \
+	objects/game_object.o \
 	objects/list.o \
 	objects/message_target.o \
+	objects/named_item.o \
+	objects/pet_control.o \
 	objects/project_item.o \
 	objects/saveable_object.o \
 	objects/tree_item.o
diff --git a/engines/titanic/objects/dont_save_file_item.cpp b/engines/titanic/objects/dont_save_file_item.cpp
new file mode 100644
index 0000000..bca66da
--- /dev/null
+++ b/engines/titanic/objects/dont_save_file_item.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/dont_save_file_item.h"
+
+namespace Titanic {
+
+void CDontSaveFileItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+}
+
+void CDontSaveFileItem::load(SimpleFile *file) {
+	file->readNumber();
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/dont_save_file_item.h b/engines/titanic/objects/dont_save_file_item.h
new file mode 100644
index 0000000..99deacc
--- /dev/null
+++ b/engines/titanic/objects/dont_save_file_item.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DONT_SAVE_FILE_ITEM_H
+#define TITANIC_DONT_SAVE_FILE_ITEM_H
+
+#include "titanic/objects/file_item.h"
+
+namespace Titanic {
+
+class CDontSaveFileItem : public CFileItem {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDontSaveFileItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DONT_SAVE_FILE_ITEM_H */
diff --git a/engines/titanic/objects/file_item.cpp b/engines/titanic/objects/file_item.cpp
index d49df71..925fc4d 100644
--- a/engines/titanic/objects/file_item.cpp
+++ b/engines/titanic/objects/file_item.cpp
@@ -24,5 +24,24 @@
 
 namespace Titanic {
 
+void CFileItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	CTreeItem::save(file, indent);
+}
+
+void CFileItem::load(SimpleFile *file) {
+	file->readNumber();
+
+	CTreeItem::load(file);
+}
+
+CString CFileItem::formFilename() const {
+	return "";
+}
+
+CString CFileItem::getFilename() const {
+	//dynamic_cast<CFileItem *>(getRoot())->formDataPath();
+	return _filename;
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/file_item.h b/engines/titanic/objects/file_item.h
index 2261598..94dd053 100644
--- a/engines/titanic/objects/file_item.h
+++ b/engines/titanic/objects/file_item.h
@@ -23,13 +23,45 @@
 #ifndef TITANIC_FILE_ITEM_H
 #define TITANIC_FILE_ITEM_H
 
+#include "titanic/string.h"
 #include "titanic/objects/list.h"
 #include "titanic/objects/tree_item.h"
 
 namespace Titanic {
 
 class CFileItem: public CTreeItem {
+private:
+	CString _filename;
 public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CFileItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);	
+
+	/**
+	 * Returns true if the item is a file item
+	 */
+	virtual bool isFileItem() const { return true; }
+
+	/**
+	 * Form a filename for the file item
+	 */
+	CString formFilename() const;
+
+	/**
+	 * Get a string?
+	 */
+	CString getFilename() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/game_object.cpp b/engines/titanic/objects/game_object.cpp
new file mode 100644
index 0000000..a1e1fac
--- /dev/null
+++ b/engines/titanic/objects/game_object.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/game_object.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/game_object.h b/engines/titanic/objects/game_object.h
new file mode 100644
index 0000000..7e0fba6
--- /dev/null
+++ b/engines/titanic/objects/game_object.h
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GAME_OBJECT_H
+#define TITANIC_GAME_OBJECT_H
+
+#include "titanic/objects/named_item.h"
+
+namespace Titanic {
+
+class CGameObject : public CNamedItem {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_H */
diff --git a/engines/titanic/objects/list.cpp b/engines/titanic/objects/list.cpp
index 1ebffac..4e0178d 100644
--- a/engines/titanic/objects/list.cpp
+++ b/engines/titanic/objects/list.cpp
@@ -25,73 +25,11 @@
 namespace Titanic {
 
 void ListItem::save(SimpleFile *file, int indent) const {
-	// Should always be overriden in descendents, so just write a dummy value
 	file->writeNumberLine(0, indent);
 }
 
 void ListItem::load(SimpleFile *file) {
-	// Should always be overriden in descendents, so just read the dummy value
 	file->readNumber();
 }
 
-/*------------------------------------------------------------------------*/
-
-List::List() {
-}
-
-void List::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(0, indent);
-	saveItems(file, indent);
-}
-
-void List::load(SimpleFile *file) {
-	file->readNumber();
-	loadItems(file);
-}
-
-void List::saveItems(SimpleFile *file, int indent) const {
-	// Write out number of items
-	file->writeQuotedLine("L", indent);
-	file->writeNumberLine(size(), indent);
-
-	// Iterate through writing entries
-	List::const_iterator i;
-	for (i = begin(); i != end(); ++i) {
-		const ListItem *item = *i;
-		item->saveHeader(file, indent);
-		item->save(file, indent + 1);
-		item->saveFooter(file, indent);
-	}
-}
-
-void List::loadItems(SimpleFile *file) {
-	file->readBuffer();
-	uint count = file->readNumber();
-	
-	for (uint idx = 0; idx < count; ++idx) {
-		// Validate the class start header
-		if (!file->IsClassStart())
-			error("Unexpected class end");
-
-		// Get item's class name and use it to instantiate an item
-		CString className = file->readString();
-		CSaveableObject *newItem = CSaveableObject::createInstance(className);
-		if (!newItem)
-			error("Could not create instance of %s", className.c_str());
-
-		// Validate the class end footer
-		if (file->IsClassStart())
-			error("Unexpected class start");
-	}
-}
-
-void List::destroyContents() {
-	for (iterator i = begin(); i != end(); ++i) {
-		CSaveableObject *obj = *i;
-		delete obj;
-	}
-
-	clear();
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/list.h b/engines/titanic/objects/list.h
index ceb4715..1842d2b 100644
--- a/engines/titanic/objects/list.h
+++ b/engines/titanic/objects/list.h
@@ -25,10 +25,14 @@
 
 #include "common/scummsys.h"
 #include "common/list.h"
+#include "titanic/simple_file.h"
 #include "titanic/objects/saveable_object.h"
 
 namespace Titanic {
 
+/**
+ * Base list item class
+ */
 class ListItem: public CSaveableObject {
 public:
 	/**
@@ -47,39 +51,87 @@ public:
 	virtual void load(SimpleFile *file);
 };
 
-class List : public CSaveableObject, Common::List<ListItem *> {
-private:
-	/**
-	 * Write out the contents of the list
-	 */
-	void saveItems(SimpleFile *file, int indent) const;
-
-	/**
-	 * Read in the contents of a list
-	 */
-	void loadItems(SimpleFile *file);
+template<typename T>
+class List : public CSaveableObject, public Common::List<T *> {
 public:
-	List();
-
 	/**
 	 * Return the class name
 	 */
-	virtual const char *getClassName() const { return "List"; }
+	virtual const char *getClassName() const { return nullptr; }
 
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent) const {
+		file->writeNumberLine(0, indent);
+
+		// Write out number of items
+		file->writeQuotedLine("L", indent);
+		file->writeNumberLine(Common::List<T *>::size(), indent);
+
+		// Iterate through writing entries
+		Common::List<T *>::const_iterator i;
+		for (i = Common::List<T *>::begin(); i != Common::List<T *>::end(); ++i) {
+			const ListItem *item = *i;
+			item->saveHeader(file, indent);
+			item->save(file, indent + 1);
+			item->saveFooter(file, indent);
+		}
+
+	}
 
 	/**
 	 * Load the data for the class from file
 	 */
-	virtual void load(SimpleFile *file);
+	virtual void load(SimpleFile *file) {
+		file->readNumber();
+		file->readBuffer();
+
+		Common::List<T *>::clear();
+		uint count = file->readNumber();
+
+		for (uint idx = 0; idx < count; ++idx) {
+			// Validate the class start header
+			if (!file->IsClassStart())
+				error("Unexpected class end");
+
+			// Get item's class name and use it to instantiate an item
+			CString className = file->readString();
+			T *newItem = dynamic_cast<T *>(CSaveableObject::createInstance(className));
+			if (!newItem)
+				error("Could not create instance of %s", className.c_str());
+
+			// Load the item's data and add it to the list
+			newItem->load(file);
+			Common::List<T *>::push_back(newItem);
+
+			// Validate the class end footer
+			if (file->IsClassStart())
+				error("Unexpected class start");
+		}
+	}
 
 	/**
 	 * Clear the list and destroy any items in it
 	 */
-	void destroyContents();
+	void destroyContents() {
+		for (Common::List<T *>::iterator i = Common::List<T *>::begin(); 
+				i != Common::List<T *>::end(); ++i) {
+			CSaveableObject *obj = *i;
+			delete obj;
+		}
+
+		Common::List<T *>::clear();
+	}
+
+	/**
+	 * Add a new item to the list of the type the list contains
+	 */
+	T *List::add() {
+		T *item = new T();
+		Common::List<T *>::push_back(item);
+		return item;
+	}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/message_target.cpp b/engines/titanic/objects/message_target.cpp
index 1e727a3..bd162ff 100644
--- a/engines/titanic/objects/message_target.cpp
+++ b/engines/titanic/objects/message_target.cpp
@@ -23,5 +23,15 @@
 #include "titanic/objects/message_target.h"
 
 namespace Titanic {
+	
+void CMessageTarget::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	CSaveableObject::save(file, indent);
+}
+
+void CMessageTarget::load(SimpleFile *file) {
+	file->readNumber();
+	CSaveableObject::load(file);
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/message_target.h b/engines/titanic/objects/message_target.h
index 6afd709..5e29dda 100644
--- a/engines/titanic/objects/message_target.h
+++ b/engines/titanic/objects/message_target.h
@@ -28,6 +28,22 @@
 namespace Titanic {
 
 class CMessageTarget: public CSaveableObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMessageTarget"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/named_item.cpp b/engines/titanic/objects/named_item.cpp
new file mode 100644
index 0000000..34db645
--- /dev/null
+++ b/engines/titanic/objects/named_item.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/named_item.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/named_item.h b/engines/titanic/objects/named_item.h
new file mode 100644
index 0000000..ee4ad35
--- /dev/null
+++ b/engines/titanic/objects/named_item.h
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NAMED_ITEM_H
+#define TITANIC_NAMED_ITEM_H
+
+#include "titanic/objects/tree_item.h"
+
+namespace Titanic {
+
+class CNamedItem: public CTreeItem {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NAMED_ITEM_H */
diff --git a/engines/titanic/objects/pet_control.cpp b/engines/titanic/objects/pet_control.cpp
new file mode 100644
index 0000000..73ef957
--- /dev/null
+++ b/engines/titanic/objects/pet_control.cpp
@@ -0,0 +1,31 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/pet_control.h"
+
+namespace Titanic {
+
+void CPetControl::gameLoaded() {
+	// TODO
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/pet_control.h b/engines/titanic/objects/pet_control.h
new file mode 100644
index 0000000..f6c9707
--- /dev/null
+++ b/engines/titanic/objects/pet_control.h
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_H
+#define TITANIC_PET_CONTROL_H
+
+#include "titanic/objects/game_object.h"
+
+namespace Titanic {
+
+class CPetControl : public CGameObject {
+public:
+	/**
+	 * Called after loading a game has finished
+	 */
+	void gameLoaded();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_H */
diff --git a/engines/titanic/objects/project_item.cpp b/engines/titanic/objects/project_item.cpp
index 8211854..2bd7515 100644
--- a/engines/titanic/objects/project_item.cpp
+++ b/engines/titanic/objects/project_item.cpp
@@ -21,50 +21,89 @@
  */
 
 #include "common/savefile.h"
+#include "titanic/game_manager.h"
 #include "titanic/titanic.h"
 #include "titanic/compressed_file.h"
+#include "titanic/objects/dont_save_file_item.h"
+#include "titanic/objects/pet_control.h"
 #include "titanic/objects/project_item.h"
 
 namespace Titanic {
 
-CProjectItem::CProjectItem() : _field34(0), _field38(0), _field3C(0) {
+void CFileListItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	file->writeQuotedLine(_name, indent);
+
+	ListItem::save(file, indent);
+}
+
+void CFileListItem::load(SimpleFile *file) {
+	file->readNumber();
+	_name = file->readString();
+
+	ListItem::load(file);
+}
+
+/*------------------------------------------------------------------------*/
+
+CProjectItem::CProjectItem() : _nextRoomNumber(0), _nextMessageNumber(0),
+		_nextObjectNumber(0), _gameManager(nullptr) {
 }
 
 void CProjectItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(6, indent);
+	file->writeQuotedLine("Next Avail. Object Number", indent);
+	file->writeNumberLine(_nextObjectNumber, indent);
+	file->writeQuotedLine("Next Avail. Message Number", indent);
+	file->writeNumberLine(_nextMessageNumber, indent);
+	file->writeQuotedLine("Next Avail. Room Number", indent);
+	file->writeNumberLine(_nextRoomNumber, indent);
+
+	CTreeItem::save(file, indent);
+}
+
+void CProjectItem::buildFilesList() {
+	_files.destroyContents();
 
+	CTreeItem *treeItem = getFirstChild();
+	while (treeItem) {
+		if (treeItem->isFileItem()) {
+			CString name = static_cast<CFileItem *>(treeItem)->getFilename();
+			_files.add()->_name = name;
+		}
+
+		treeItem = getNextSibling();
+	}
 }
 
 void CProjectItem::load(SimpleFile *file) {
 	int val = file->readNumber();
-	load2(file, val);
-}
-
-void CProjectItem::load2(SimpleFile *file, int val) {
+	_files.destroyContents();
 	int count;
-	_items.destroyContents();
 
 	switch (val) {
 	case 1:
 		file->readBuffer();
-		_field34 = file->readNumber();
+		_nextRoomNumber = file->readNumber();
 		// Deliberate fall-through
 
 	case 0:
+		// Load the list of files
 		count = file->readNumber();
 		for (int idx = 0; idx < count; ++idx) {
-
+			CString name = file->readString();
+			_files.add()->_name = name;
 		}
 		break;
 
 	case 6:
 		file->readBuffer();
-		_field3C = file->readNumber();
+		_nextObjectNumber = file->readNumber();
 		// Deliberate fall-through
 
 	case 5:
 		file->readBuffer();
-		_field38 = file->readNumber();
+		_nextMessageNumber = file->readNumber();
 		// Deliberate fall-through
 
 	case 4:
@@ -73,9 +112,9 @@ void CProjectItem::load2(SimpleFile *file, int val) {
 
 	case 2:
 	case 3:
-		_items.load(file);
+		_files.load(file);
 		file->readBuffer();
-		_field34 = file->readNumber();
+		_nextRoomNumber = file->readNumber();
 		break;
 
 	default:
@@ -85,6 +124,14 @@ void CProjectItem::load2(SimpleFile *file, int val) {
 	CTreeItem::load(file);
 }
 
+CGameManager *CProjectItem::getGameManager() {
+	return _gameManager;
+}
+
+void CProjectItem::resetGameManager() {
+	_gameManager = nullptr;
+}
+
 void CProjectItem::loadGame(int slotId) {
 	CompressedFile file;
 	Common::InSaveFile *saveFile = nullptr;
@@ -102,9 +149,27 @@ void CProjectItem::loadGame(int slotId) {
 	}
 
 	// Load the contents in
-	loadData(&file);
+	CProjectItem *newProject = loadData(&file);
+	file.IsClassStart();
+	getGameManager()->load(&file);
 
 	file.close();
+
+	// Clear existing project
+	clear();
+
+	// Detach each item under the loaded project, and re-attach them
+	// to the existing project instance (this)
+	CTreeItem *item;
+	while ((item = newProject->getFirstChild()) != nullptr) {
+		item->detach();
+		item->addUnder(this);
+	}
+	// Loaded project instance is no longer needed
+	newProject->destroyAll();
+
+	// Post-load processing
+	gameLoaded();
 }
 
 void CProjectItem::saveGame(int slotId) {
@@ -120,7 +185,9 @@ void CProjectItem::saveGame(int slotId) {
 }
 
 void CProjectItem::clear() {
-
+	CTreeItem *item;
+	while ((item = getFirstChild()) != nullptr)
+		item->destroyAll();
 }
 
 CProjectItem *CProjectItem::loadData(SimpleFile *file) {
@@ -156,7 +223,6 @@ CProjectItem *CProjectItem::loadData(SimpleFile *file) {
 				// Already created root project
 				item->addUnder(parent);
 			} else {
-				// TODO: Validate this is correct
 				root = dynamic_cast<CProjectItem *>(item);
 				assert(root);
 				root->_filename = _filename;
@@ -197,4 +263,32 @@ void CProjectItem::saveData(SimpleFile *file, CTreeItem *item) const {
 	}
 }
 
+void CProjectItem::gameLoaded() {
+	CGameManager *gameManager = getGameManager();
+	if (gameManager)
+		gameManager->gameLoaded();
+
+	CPetControl *petControl = getPetControl();
+	if (petControl)
+		petControl->gameLoaded();
+}
+
+CPetControl *CProjectItem::getPetControl() {
+	CDontSaveFileItem *fileItem = getDontSaveFileItem();
+	CTreeItem *treeItem;
+
+	if (!fileItem || (treeItem = fileItem->getLastChild()) == nullptr)
+		return nullptr;
+
+	while (treeItem) {
+		CPetControl *petControl = dynamic_cast<CPetControl *>(treeItem);
+		if (petControl)
+			return petControl;
+
+		treeItem = treeItem->getPriorSibling();
+	}
+
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/project_item.h b/engines/titanic/objects/project_item.h
index d769f3d..066dbf6 100644
--- a/engines/titanic/objects/project_item.h
+++ b/engines/titanic/objects/project_item.h
@@ -26,21 +26,56 @@
 #include "common/scummsys.h"
 #include "titanic/simple_file.h"
 #include "titanic/objects/file_item.h"
+#include "titanic/objects/list.h"
 
 namespace Titanic {
 
+class CGameManager;
+class CPetControl;
+
+/**
+ * File list item
+ */
+class CFileListItem : public ListItem {
+public:
+	CString _name;
+
+	virtual const char *getClassName() const { return "CFileListItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);	
+	
+};
+
+/**
+ * Filename list
+ */
+class CFileList: public List<CFileListItem> {
+public:
+	virtual const char *getClassName() const { return "CFileList"; }
+};
+
+
 class CProjectItem : public CFileItem {
 private:
 	CString _filename;
-	List _items;
-	int _field34;
-	int _field38;
-	int _field3C;
+	CFileList _files;
+	int _nextRoomNumber;
+	int _nextMessageNumber;
+	int _nextObjectNumber;
+	CGameManager *_gameManager;
 
 	/**
-	 * Load data for the project
+	 * Called during save, iterates through the children to do some stuff
 	 */
-	void load2(SimpleFile *file, int val);
+	void buildFilesList();
 private:
 	/**
 	 * Load project data from the passed file
@@ -51,6 +86,11 @@ private:
 	 * Save project data to the passed file
 	 */
 	void saveData(SimpleFile *file, CTreeItem *item) const;
+
+	/**
+	 * Does post-loading processing
+	 */
+	void gameLoaded();
 public:
 	CProjectItem();
 
@@ -70,6 +110,21 @@ public:
 	virtual void load(SimpleFile *file);	
 
 	/**
+	 * Get the game manager for the project
+	 */
+	virtual CGameManager *getGameManager();
+
+	/**
+	 * Get a reference to the PET control
+	 */
+	CPetControl *getPetControl();
+
+	/**
+	 * Resets the game manager field
+	 */
+	void resetGameManager();
+
+	/**
 	 * Load the entire project data for a given slot Id
 	 */
 	void loadGame(int slotId);
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
index 201fe10..45f9e13 100644
--- a/engines/titanic/objects/saveable_object.cpp
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -35,8 +35,7 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 #define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
 #define ADDFN(T) (*_classList)[#T] = Function##T
 
-DEFFN(List);
-DEFFN(ListItem);
+DEFFN(CFileListItem);
 DEFFN(CMessageTarget);
 DEFFN(CTreeItem);
 DEFFN(CFileItem);
@@ -44,8 +43,7 @@ DEFFN(CProjectItem);
 
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
-	ADDFN(List);
-	ADDFN(ListItem);
+	ADDFN(CFileListItem);
 	ADDFN(CMessageTarget);
 	ADDFN(CTreeItem);
 	ADDFN(CFileItem);
@@ -61,12 +59,10 @@ CSaveableObject *CSaveableObject::createInstance(const Common::String &name) {
 }
 
 void CSaveableObject::save(SimpleFile *file, int indent) const {
-	// Should always be overriden in descendents, so just write a dummy value
 	file->writeNumberLine(0, indent);
 }
 
 void CSaveableObject::load(SimpleFile *file) {
-	// Should always be overriden in descendents, so just read the dummy value
 	file->readNumber();
 }
 
diff --git a/engines/titanic/objects/tree_item.cpp b/engines/titanic/objects/tree_item.cpp
index bf0ae3e..3902df3 100644
--- a/engines/titanic/objects/tree_item.cpp
+++ b/engines/titanic/objects/tree_item.cpp
@@ -21,6 +21,8 @@
  */
 
 #include "titanic/objects/tree_item.h"
+#include "titanic/objects/dont_save_file_item.h"
+#include "titanic/objects/file_item.h"
 
 namespace Titanic {
 
@@ -38,6 +40,22 @@ void CTreeItem::load(SimpleFile *file) {
 	CMessageTarget::load(file);
 }
 
+CGameManager *CTreeItem::getGameManager() {
+	return _parent ? _parent->getGameManager() : nullptr;
+}
+
+CTreeItem *CTreeItem::getRoot() const {
+	CTreeItem *parent = getParent();
+
+	if (parent) {
+		do {
+			parent = parent->getParent();
+		} while (parent->getParent());
+	}
+
+	return parent;
+}
+
 CTreeItem *CTreeItem::getLastSibling() {
 	CTreeItem *item = this;
 	while (item->getNextSibling())
@@ -52,6 +70,17 @@ CTreeItem *CTreeItem::getLastChild() {
 	return _firstChild->getLastSibling();
 }
 
+CDontSaveFileItem *CTreeItem::getDontSaveFileItem() {
+	CTreeItem *item = getFirstChild();
+	while (item) {
+		CDontSaveFileItem *fileItem = dynamic_cast<CDontSaveFileItem *>(item);
+		if (fileItem)
+			return fileItem;
+
+		item = item->getNextSibling();
+	}
+}
+
 void CTreeItem::addUnder(CTreeItem *newParent) {
 	if (newParent->_firstChild)
 		addSibling(newParent->getLastSibling());
@@ -79,5 +108,44 @@ void CTreeItem::addSibling(CTreeItem *item) {
 	item->_nextSibling = this;
 }
 
+void CTreeItem::destroyAll() {
+	destroyOthers();
+	detach();
+	delete this;
+}
+
+int CTreeItem::destroyOthers() {
+	if (!_firstChild)
+		return 0;
+
+	CTreeItem *item = this, *child, *nextSibling;
+	int total = 0;
+
+	do {
+		child = item->_firstChild;
+		nextSibling = item->_nextSibling;
+
+		if (child)
+			total += child->destroyOthers();
+		child->detach();
+		delete child;
+		++total;
+	} while ((item = nextSibling) != nullptr);
+
+	return total;
+}
+
+void CTreeItem::detach() {
+	// Delink this item from any prior and/or next siblings
+	if (_priorSibling)
+		_priorSibling->_nextSibling = _nextSibling;
+	if (_nextSibling)
+		_nextSibling->_priorSibling = _priorSibling;
+
+	if (_parent && _parent->_firstChild == this)
+		_parent->_firstChild = _nextSibling;
+
+	_priorSibling = _nextSibling = _parent = nullptr;
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/tree_item.h b/engines/titanic/objects/tree_item.h
index d3c1d34..d6450e3 100644
--- a/engines/titanic/objects/tree_item.h
+++ b/engines/titanic/objects/tree_item.h
@@ -27,6 +27,9 @@
 
 namespace Titanic {
 
+class CGameManager;
+class CDontSaveFileItem;
+
 class CTreeItem: public CMessageTarget {
 private:
 	CTreeItem *_parent;
@@ -53,11 +56,26 @@ public:
 	virtual void load(SimpleFile *file);
 
 	/**
+	 * Get the game manager for the project
+	 */
+	virtual CGameManager *getGameManager();
+
+	/**
+	 * Returns true if the item is a file item
+	 */
+	virtual bool isFileItem() const { return false; }
+
+	/**
 	 * Get the parent for the given item
 	 */
 	CTreeItem *getParent() const { return _parent; }
 
 	/**
+	 * Jumps up through the parents to find the sub-root item
+	 */
+	CTreeItem *getRoot() const;
+
+	/**
 	 * Get the next sibling
 	 */
 	CTreeItem *getNextSibling() { return _nextSibling; }
@@ -83,6 +101,11 @@ public:
 	CTreeItem *getLastChild();
 
 	/**
+	 * Get any dont save file item in the immediate children
+	 */
+	CDontSaveFileItem *getDontSaveFileItem();
+
+	/**
 	 * Adds the item under another tree item
 	 */
 	void addUnder(CTreeItem *newParent);
@@ -96,6 +119,21 @@ public:
 	 * Adds the item as a sibling of another item
 	 */
 	void addSibling(CTreeItem *item);
+
+	/**
+	 * Destroys both the item as well as any of it's children
+	 */
+	void destroyAll();
+
+	/**
+	 * Destroys all tree items around the given one
+	 */
+	int destroyOthers();
+
+	/**
+	 * Detach the tree item from any other associated tree items
+	 */
+	void detach();
 };
 
 } // End of namespace Titanic


Commit: 4126cf4fb0a4a30e5abfbef9ae3ce46bce3fd620
    https://github.com/scummvm/scummvm/commit/4126cf4fb0a4a30e5abfbef9ae3ce46bce3fd620
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-23T22:52:02-05:00

Commit Message:
TITANIC: Implemented CRoomItem class

Changed paths:
  A engines/titanic/objects/resource_key.cpp
  A engines/titanic/objects/resource_key.h
  A engines/titanic/rooms/room_item.cpp
  A engines/titanic/rooms/room_item.h
    engines/titanic/module.mk
    engines/titanic/objects/named_item.cpp
    engines/titanic/objects/named_item.h
    engines/titanic/objects/saveable_object.cpp



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 6d1e546..6ddb96a 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -23,8 +23,10 @@ MODULE_OBJS := \
 	objects/named_item.o \
 	objects/pet_control.o \
 	objects/project_item.o \
+	objects/resource_key.o \
 	objects/saveable_object.o \
-	objects/tree_item.o
+	objects/tree_item.o \
+	rooms/room_item.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/objects/named_item.cpp b/engines/titanic/objects/named_item.cpp
index 34db645..f7d7c7b 100644
--- a/engines/titanic/objects/named_item.cpp
+++ b/engines/titanic/objects/named_item.cpp
@@ -24,5 +24,19 @@
 
 namespace Titanic {
 
+void CNamedItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	file->writeQuotedLine(_name, indent);
+
+	CTreeItem::save(file, indent);
+}
+
+void CNamedItem::load(SimpleFile *file) {
+	int val = file->readNumber();
+	if (!val)
+		_name = file->readString();
+
+	CTreeItem::load(file);
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/named_item.h b/engines/titanic/objects/named_item.h
index ee4ad35..d59b730 100644
--- a/engines/titanic/objects/named_item.h
+++ b/engines/titanic/objects/named_item.h
@@ -28,6 +28,23 @@
 namespace Titanic {
 
 class CNamedItem: public CTreeItem {
+public:
+	CString _name;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNamedItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/resource_key.cpp b/engines/titanic/objects/resource_key.cpp
new file mode 100644
index 0000000..612014b
--- /dev/null
+++ b/engines/titanic/objects/resource_key.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/simple_file.h"
+#include "titanic/objects/resource_key.h"
+
+namespace Titanic {
+
+void CResourceKey::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine("Resource Key...", indent);
+	file->writeQuotedLine(_key, indent);
+
+	CSaveableObject::save(file, indent);
+}
+
+void CResourceKey::load(SimpleFile *file) {
+	int val = file->readNumber();
+	
+	if (val == 1) {
+		file->readBuffer();
+		_value = file->readString();
+	}
+
+	CSaveableObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/resource_key.h b/engines/titanic/objects/resource_key.h
new file mode 100644
index 0000000..4cb40cd
--- /dev/null
+++ b/engines/titanic/objects/resource_key.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RESOURCE_KEY_H
+#define TITANIC_RESOURCE_KEY_H
+
+#include "titanic/string.h"
+#include "titanic/objects/saveable_object.h"
+
+namespace Titanic {
+
+class CResourceKey: public CSaveableObject {
+private:
+	CString _key;
+	CString _value;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CResourceKey"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RESOURCE_KEY_H */
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
index 45f9e13..f2f38f3 100644
--- a/engines/titanic/objects/saveable_object.cpp
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -26,6 +26,7 @@
 #include "titanic/objects/message_target.h"
 #include "titanic/objects/project_item.h"
 #include "titanic/objects/tree_item.h"
+#include "titanic/rooms/room_item.h"
 
 namespace Titanic {
 
@@ -40,6 +41,9 @@ DEFFN(CMessageTarget);
 DEFFN(CTreeItem);
 DEFFN(CFileItem);
 DEFFN(CProjectItem);
+DEFFN(CRoomItem);
+DEFFN(CMovieClipItem);
+DEFFN(CMovieClipList);
 
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
@@ -48,6 +52,9 @@ void CSaveableObject::initClassList() {
 	ADDFN(CTreeItem);
 	ADDFN(CFileItem);
 	ADDFN(CProjectItem);
+	ADDFN(CRoomItem);
+	ADDFN(CMovieClipItem);
+	ADDFN(CMovieClipList);
 }
 
 void CSaveableObject::freeClassList() {
diff --git a/engines/titanic/rooms/room_item.cpp b/engines/titanic/rooms/room_item.cpp
new file mode 100644
index 0000000..9e0c699
--- /dev/null
+++ b/engines/titanic/rooms/room_item.cpp
@@ -0,0 +1,105 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/rooms/room_item.h"
+
+namespace Titanic {
+
+CRoomItem::CRoomItem() : CNamedItem(), _roomNumber(0),
+		_roomDimensionX(0.0), _roomDimensionY(0.0) {
+}
+
+void CRoomItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(3, indent);
+	file->writeQuotedLine("Exit Movies", indent);
+	_exitMovieKey.save(file, indent);
+
+	file->writeNumberLine(_roomDimensionX * 1000.0, indent + 1);
+	file->writeNumberLine(_roomDimensionY * 1000.0, indent + 1);
+
+	file->writeQuotedLine("Transition Movie", indent);
+	_transitionMovieKey.save(file, indent);
+
+	file->writeQuotedLine("Movie Clip list", indent);
+	_clipList.save(file, indent + 1);
+
+	file->writeQuotedLine("Room Rect", indent);
+	file->writeNumberLine(_roomRect.left, indent + 1);
+	file->writeNumberLine(_roomRect.top, indent + 1);
+	file->writeNumberLine(_roomRect.right, indent + 1);
+	file->writeNumberLine(_roomRect.bottom, indent + 1);
+
+	file->writeQuotedLine("Room Number", indent);
+	file->writeNumberLine(_roomNumber, indent);
+
+	CNamedItem::save(file, indent);
+}
+
+void CRoomItem::load(SimpleFile *file) {
+	int val = file->readNumber();
+	
+	switch (val) {
+	case 3:
+		// Read exit movie
+		file->readBuffer();
+		_exitMovieKey.load(file);
+		// Deliberate fall-through
+
+	case 2:
+		// Read room dimensions
+		file->readBuffer();
+		_roomDimensionX = (double)file->readNumber() / 1000.0;
+		_roomDimensionY = (double)file->readNumber() / 1000.0;
+		// Deliberate fall-through
+
+	case 1:
+		// Read transition movie key and clip list
+		file->readBuffer();
+		_transitionMovieKey.load(file);
+
+		file->readBuffer();
+		_clipList.load(file);
+		loading();
+		// Deliberate fall-through
+
+	case 0:
+		// Read room rect
+		file->readBuffer();
+		_roomRect.left = file->readNumber();
+		_roomRect.top = file->readNumber();
+		_roomRect.right = file->readNumber();
+		_roomRect.bottom = file->readNumber();
+		file->readBuffer();
+		break;
+
+	default:
+		break;
+	}
+
+	CNamedItem::load(file);
+}
+
+void CRoomItem::loading() {
+	// TODO
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/rooms/room_item.h b/engines/titanic/rooms/room_item.h
new file mode 100644
index 0000000..bb8bbb8
--- /dev/null
+++ b/engines/titanic/rooms/room_item.h
@@ -0,0 +1,80 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ROOM_ITEM_H
+#define TITANIC_ROOM_ITEM_H
+
+#include "common/rect.h"
+#include "titanic/objects/list.h"
+#include "titanic/objects/resource_key.h"
+#include "titanic/objects/named_item.h"
+
+namespace Titanic {
+
+/**
+ * Movie clip item
+ */
+class CMovieClipItem : public ListItem {
+public:
+	virtual const char *getClassName() const { return "CMovieClipItem"; }
+};
+
+/**
+ * Movie clip list
+ */
+class CMovieClipList: public List<CMovieClipItem> {
+public:
+	virtual const char *getClassName() const { return "CMovieClipList"; }
+};
+
+class CRoomItem : public CNamedItem {
+private:
+	Common::Rect _roomRect;
+	CMovieClipList _clipList;
+	int _roomNumber;
+	CResourceKey _transitionMovieKey;
+	CResourceKey _exitMovieKey;
+	double _roomDimensionX, _roomDimensionY;
+
+	void loading();
+public:
+	CRoomItem();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CRoomItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ROOM_ITEM_H */


Commit: 03f387b2bc624bbbea01f0894dc9a2a218e9ef6d
    https://github.com/scummvm/scummvm/commit/03f387b2bc624bbbea01f0894dc9a2a218e9ef6d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-24T07:49:01-05:00

Commit Message:
TITANIC: Added CMovieClip class

Changed paths:
  A engines/titanic/objects/movie_clip.cpp
  A engines/titanic/objects/movie_clip.h
    engines/titanic/module.mk
    engines/titanic/objects/saveable_object.cpp
    engines/titanic/rooms/room_item.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 6ddb96a..848c737 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -20,6 +20,7 @@ MODULE_OBJS := \
 	objects/game_object.o \
 	objects/list.o \
 	objects/message_target.o \
+	objects/movie_clip.o \
 	objects/named_item.o \
 	objects/pet_control.o \
 	objects/project_item.o \
diff --git a/engines/titanic/objects/movie_clip.cpp b/engines/titanic/objects/movie_clip.cpp
new file mode 100644
index 0000000..2910051
--- /dev/null
+++ b/engines/titanic/objects/movie_clip.cpp
@@ -0,0 +1,68 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/movie_clip.h"
+
+namespace Titanic {
+
+CMovieClip::CMovieClip() {
+}
+
+void CMovieClip::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(2, indent);
+	file->writeQuotedLine("Clip", indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_field18, indent);
+	file->writeNumberLine(_field1C, indent);
+
+	ListItem::save(file, indent);
+}
+
+void CMovieClip::load(SimpleFile *file) {
+	int val = file->readNumber();
+
+	switch (val) {
+	case 1:
+		_string1 = file->readString();
+		_field18 = file->readNumber();
+		_field1C = file->readNumber();
+		_field20 = file->readNumber();
+		_field24 = file->readNumber();
+		_field28 = file->readNumber();
+		_field2C = file->readNumber();
+		_field30 = file->readNumber();
+		break;
+
+	case 2:
+		_string1 = file->readString();
+		_field18 = file->readNumber();
+		_field1C = file->readNumber();
+		break;
+
+	default:
+		break;
+	}
+
+	ListItem::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/movie_clip.h b/engines/titanic/objects/movie_clip.h
new file mode 100644
index 0000000..18446c6
--- /dev/null
+++ b/engines/titanic/objects/movie_clip.h
@@ -0,0 +1,82 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVIE_CLIP_H
+#define TITANIC_MOVIE_CLIP_H
+
+#include "titanic/objects/list.h"
+
+namespace Titanic {
+
+/**
+ * Movie clip item
+ */
+class CMovieClipItem : public ListItem {
+public:
+	virtual const char *getClassName() const { return "CMovieClipItem"; }
+};
+
+/**
+ * Movie clip list
+ */
+class CMovieClipList: public List<CMovieClipItem> {
+public:
+	virtual const char *getClassName() const { return "CMovieClipList"; }
+};
+
+/**
+ * Movie clip
+ */
+class CMovieClip : public ListItem {
+private:
+	CString _string1;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+	int _field28;
+	int _field2C;
+	int _field30;
+	CString _string2;
+	CString _string3;
+public:
+	CMovieClip();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMovieClip"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVIE_CLIP_H */
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
index f2f38f3..adc0369 100644
--- a/engines/titanic/objects/saveable_object.cpp
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -24,6 +24,7 @@
 #include "titanic/objects/file_item.h"
 #include "titanic/objects/list.h"
 #include "titanic/objects/message_target.h"
+#include "titanic/objects/movie_clip.h"
 #include "titanic/objects/project_item.h"
 #include "titanic/objects/tree_item.h"
 #include "titanic/rooms/room_item.h"
@@ -42,6 +43,7 @@ DEFFN(CTreeItem);
 DEFFN(CFileItem);
 DEFFN(CProjectItem);
 DEFFN(CRoomItem);
+DEFFN(CMovieClip);
 DEFFN(CMovieClipItem);
 DEFFN(CMovieClipList);
 
@@ -53,6 +55,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CFileItem);
 	ADDFN(CProjectItem);
 	ADDFN(CRoomItem);
+	ADDFN(CMovieClip);
 	ADDFN(CMovieClipItem);
 	ADDFN(CMovieClipList);
 }
diff --git a/engines/titanic/rooms/room_item.h b/engines/titanic/rooms/room_item.h
index bb8bbb8..4df14aa 100644
--- a/engines/titanic/rooms/room_item.h
+++ b/engines/titanic/rooms/room_item.h
@@ -25,27 +25,12 @@
 
 #include "common/rect.h"
 #include "titanic/objects/list.h"
-#include "titanic/objects/resource_key.h"
+#include "titanic/objects/movie_clip.h"
 #include "titanic/objects/named_item.h"
+#include "titanic/objects/resource_key.h"
 
 namespace Titanic {
 
-/**
- * Movie clip item
- */
-class CMovieClipItem : public ListItem {
-public:
-	virtual const char *getClassName() const { return "CMovieClipItem"; }
-};
-
-/**
- * Movie clip list
- */
-class CMovieClipList: public List<CMovieClipItem> {
-public:
-	virtual const char *getClassName() const { return "CMovieClipList"; }
-};
-
 class CRoomItem : public CNamedItem {
 private:
 	Common::Rect _roomRect;


Commit: 4fbcefba65f78e2346fb9a03e7b7c4cfbaf6133d
    https://github.com/scummvm/scummvm/commit/4fbcefba65f78e2346fb9a03e7b7c4cfbaf6133d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-24T20:22:22-05:00

Commit Message:
TITANIC: Fix loading of CRoomItem class

Changed paths:
    engines/titanic/objects/movie_clip.cpp
    engines/titanic/objects/movie_clip.h
    engines/titanic/objects/saveable_object.cpp
    engines/titanic/rooms/room_item.cpp



diff --git a/engines/titanic/objects/movie_clip.cpp b/engines/titanic/objects/movie_clip.cpp
index 2910051..2914cc8 100644
--- a/engines/titanic/objects/movie_clip.cpp
+++ b/engines/titanic/objects/movie_clip.cpp
@@ -53,6 +53,7 @@ void CMovieClip::load(SimpleFile *file) {
 		break;
 
 	case 2:
+		file->readString();
 		_string1 = file->readString();
 		_field18 = file->readNumber();
 		_field1C = file->readNumber();
diff --git a/engines/titanic/objects/movie_clip.h b/engines/titanic/objects/movie_clip.h
index 18446c6..e259d97 100644
--- a/engines/titanic/objects/movie_clip.h
+++ b/engines/titanic/objects/movie_clip.h
@@ -28,22 +28,6 @@
 namespace Titanic {
 
 /**
- * Movie clip item
- */
-class CMovieClipItem : public ListItem {
-public:
-	virtual const char *getClassName() const { return "CMovieClipItem"; }
-};
-
-/**
- * Movie clip list
- */
-class CMovieClipList: public List<CMovieClipItem> {
-public:
-	virtual const char *getClassName() const { return "CMovieClipList"; }
-};
-
-/**
  * Movie clip
  */
 class CMovieClip : public ListItem {
@@ -77,6 +61,14 @@ public:
 	virtual void load(SimpleFile *file);
 };
 
+/**
+ * Movie clip list
+ */
+class CMovieClipList: public List<CMovieClip> {
+public:
+	virtual const char *getClassName() const { return "CMovieClipList"; }
+};
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_MOVIE_CLIP_H */
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
index adc0369..45161be 100644
--- a/engines/titanic/objects/saveable_object.cpp
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -44,7 +44,6 @@ DEFFN(CFileItem);
 DEFFN(CProjectItem);
 DEFFN(CRoomItem);
 DEFFN(CMovieClip);
-DEFFN(CMovieClipItem);
 DEFFN(CMovieClipList);
 
 void CSaveableObject::initClassList() {
@@ -56,7 +55,6 @@ void CSaveableObject::initClassList() {
 	ADDFN(CProjectItem);
 	ADDFN(CRoomItem);
 	ADDFN(CMovieClip);
-	ADDFN(CMovieClipItem);
 	ADDFN(CMovieClipList);
 }
 
@@ -65,6 +63,7 @@ void CSaveableObject::freeClassList() {
 }
 
 CSaveableObject *CSaveableObject::createInstance(const Common::String &name) {
+warning("%s", name.c_str());
 	return (*_classList)[name]();
 }
 
diff --git a/engines/titanic/rooms/room_item.cpp b/engines/titanic/rooms/room_item.cpp
index 9e0c699..dce2bc0 100644
--- a/engines/titanic/rooms/room_item.cpp
+++ b/engines/titanic/rooms/room_item.cpp
@@ -89,6 +89,7 @@ void CRoomItem::load(SimpleFile *file) {
 		_roomRect.right = file->readNumber();
 		_roomRect.bottom = file->readNumber();
 		file->readBuffer();
+		_roomNumber = file->readNumber();
 		break;
 
 	default:


Commit: 8acf716d6554fdd7209ba6bb575891019941931e
    https://github.com/scummvm/scummvm/commit/8acf716d6554fdd7209ba6bb575891019941931e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-24T20:39:12-05:00

Commit Message:
TITANIC: Implemented CNodeItem class

Changed paths:
  A engines/titanic/objects/node_item.cpp
  A engines/titanic/objects/node_item.h
    engines/titanic/module.mk
    engines/titanic/objects/saveable_object.cpp



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 848c737..9dfbb2f 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -22,6 +22,7 @@ MODULE_OBJS := \
 	objects/message_target.o \
 	objects/movie_clip.o \
 	objects/named_item.o \
+	objects/node_item.o \
 	objects/pet_control.o \
 	objects/project_item.o \
 	objects/resource_key.o \
diff --git a/engines/titanic/objects/node_item.cpp b/engines/titanic/objects/node_item.cpp
new file mode 100644
index 0000000..f2a55cf
--- /dev/null
+++ b/engines/titanic/objects/node_item.cpp
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/node_item.h"
+
+namespace Titanic {
+
+CNodeItem::CNodeItem() : CNamedItem(), _field24(0), _field28(0), _field2C(0) {
+}
+
+void CNodeItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	file->writeQuotedLine("N", indent);
+	file->writeNumberLine(_field24, indent + 1);
+	file->writeNumberLine(_field28, indent + 1);
+
+	file->writeQuotedLine("N", indent);
+	file->writeNumberLine(_field2C, indent + 1);
+
+	CNamedItem::save(file, indent);
+}
+
+void CNodeItem::load(SimpleFile *file) {
+	file->readNumber();
+	file->readBuffer();
+	_field24 = file->readNumber();
+	_field28 = file->readNumber();
+
+	file->readBuffer();
+	_field2C = file->readNumber();
+
+	CNamedItem::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/node_item.h b/engines/titanic/objects/node_item.h
new file mode 100644
index 0000000..bfb5348
--- /dev/null
+++ b/engines/titanic/objects/node_item.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NODE_ITEM_H
+#define TITANIC_NODE_ITEM_H
+
+#include "titanic/objects/named_item.h"
+
+namespace Titanic {
+
+class CNodeItem : public CNamedItem {
+private:
+	int _field24;
+	int _field28;
+	int _field2C;
+public:
+	CNodeItem();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNodeItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);	
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FILE_ITEM_H */
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
index 45161be..7e9aa4b 100644
--- a/engines/titanic/objects/saveable_object.cpp
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -25,6 +25,7 @@
 #include "titanic/objects/list.h"
 #include "titanic/objects/message_target.h"
 #include "titanic/objects/movie_clip.h"
+#include "titanic/objects/node_item.h"
 #include "titanic/objects/project_item.h"
 #include "titanic/objects/tree_item.h"
 #include "titanic/rooms/room_item.h"
@@ -37,25 +38,27 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 #define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
 #define ADDFN(T) (*_classList)[#T] = Function##T
 
+DEFFN(CFileItem);
 DEFFN(CFileListItem);
 DEFFN(CMessageTarget);
-DEFFN(CTreeItem);
-DEFFN(CFileItem);
-DEFFN(CProjectItem);
-DEFFN(CRoomItem);
 DEFFN(CMovieClip);
 DEFFN(CMovieClipList);
+DEFFN(CNodeItem);
+DEFFN(CProjectItem);
+DEFFN(CRoomItem);
+DEFFN(CTreeItem);
 
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
+	ADDFN(CFileItem);
 	ADDFN(CFileListItem);
 	ADDFN(CMessageTarget);
-	ADDFN(CTreeItem);
-	ADDFN(CFileItem);
-	ADDFN(CProjectItem);
-	ADDFN(CRoomItem);
 	ADDFN(CMovieClip);
 	ADDFN(CMovieClipList);
+	ADDFN(CNodeItem);
+	ADDFN(CProjectItem);
+	ADDFN(CRoomItem);
+	ADDFN(CTreeItem);
 }
 
 void CSaveableObject::freeClassList() {


Commit: 25422a6520615cf5c5467654790e658085f28d95
    https://github.com/scummvm/scummvm/commit/25422a6520615cf5c5467654790e658085f28d95
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-24T23:14:49-05:00

Commit Message:
TITANIC: Implement CGameObject loading, CServiceElevatorDoro and ancestors

Changed paths:
  A engines/titanic/objects/auto_sound_event.cpp
  A engines/titanic/objects/auto_sound_event.h
  A engines/titanic/rooms/door_auto_sound_event.cpp
  A engines/titanic/rooms/door_auto_sound_event.h
  A engines/titanic/rooms/service_elevator_door.cpp
  A engines/titanic/rooms/service_elevator_door.h
    engines/titanic/module.mk
    engines/titanic/objects/game_object.cpp
    engines/titanic/objects/game_object.h
    engines/titanic/objects/resource_key.h
    engines/titanic/objects/saveable_object.cpp
    engines/titanic/simple_file.cpp
    engines/titanic/simple_file.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 9dfbb2f..5dc7195 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -15,6 +15,7 @@ MODULE_OBJS := \
 	string.o \
 	titanic.o \
 	video_surface.o \
+	objects/auto_sound_event.o \
 	objects/dont_save_file_item.o \
 	objects/file_item.o \
 	objects/game_object.o \
@@ -28,7 +29,9 @@ MODULE_OBJS := \
 	objects/resource_key.o \
 	objects/saveable_object.o \
 	objects/tree_item.o \
-	rooms/room_item.o
+	rooms/door_auto_sound_event.o \
+	rooms/room_item.o \
+	rooms/service_elevator_door.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/objects/auto_sound_event.cpp b/engines/titanic/objects/auto_sound_event.cpp
new file mode 100644
index 0000000..7160ac7
--- /dev/null
+++ b/engines/titanic/objects/auto_sound_event.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/auto_sound_event.h"
+
+namespace Titanic {
+
+CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
+}
+
+void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/auto_sound_event.h b/engines/titanic/objects/auto_sound_event.h
new file mode 100644
index 0000000..bcfc6a4
--- /dev/null
+++ b/engines/titanic/objects/auto_sound_event.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_SOUND_EVENT_H
+#define TITANIC_AUTO_SOUND_EVENT_H
+
+#include "titanic/objects/game_object.h"
+
+namespace Titanic {
+
+class CAutoSoundEvent : public CGameObject {
+private:
+	int _fieldBC;
+	int _fieldC0;
+public:
+	CAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/objects/game_object.cpp b/engines/titanic/objects/game_object.cpp
index a1e1fac..2e35417 100644
--- a/engines/titanic/objects/game_object.cpp
+++ b/engines/titanic/objects/game_object.cpp
@@ -21,7 +21,101 @@
  */
 
 #include "titanic/objects/game_object.h"
+#include "titanic/objects/resource_key.h"
 
 namespace Titanic {
 
+CGameObject::CGameObject(): CNamedItem() {
+	_bounds = Common::Rect(0, 0, 15, 15);
+	_field34 = 0;
+	_field38 = 0;
+	_field3C = 0;
+	_field40 = 0;
+	_field44 = 0xF0;
+	_field48 = 0xF0;
+	_field4C = 0xFF;
+	_field50 = 0;
+	_field54 = 0;
+	_field58 = 0;
+	_field5C = 1;
+	_field60 = 0;
+	_field74 = 1;
+	_field78 = 0;
+	_field8C = -1;
+	_field90 = 0;
+	_field94 = 0;
+	_field98 = 0;
+	_field9C = 0;
+	_fieldA0 = 0;
+	_fieldA4 = 0;
+	_fieldA8 = nullptr;
+	_fieldB8 = 0;
+}
+
+void CGameObject::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(7, indent);
+	error("TODO: CGameObject::save");
+
+	CNamedItem::save(file, indent);
+}
+
+void CGameObject::load(SimpleFile *file) {
+	int val = file->readNumber();
+	CResourceKey resourceKey;
+
+	switch (val) {
+	case 7:
+		_clipList2.load(file);
+		_field8C = file->readNumber();
+		// Deliberate fall-through
+
+	case 6:
+		val = _field74 = file->readNumber();
+		// Deliberate fall-through
+
+	case 5:
+		_clipList1.load(file);
+		// Deliberate fall-through
+
+	case 4:
+		_field60 = file->readNumber();
+		// Deliberate fall-through
+
+	case 3:
+		_field40 = file->readNumber();
+		// Deliberate fall-through
+
+	case 2:
+		_string = file->readString();
+		// Deliberate fall-through
+
+	case 1:
+		_bounds = file->readRect();
+		_field34 = file->readFloat();
+		_field38 = file->readFloat();
+		_field3C = file->readFloat();
+		_field44 = file->readNumber();
+		_field48 = file->readNumber();
+		_field4C = file->readNumber();
+		_fieldB8 = file->readNumber();
+		_field5C = file->readNumber();
+		_field50 = file->readNumber();
+		_field54 = file->readNumber();
+		_field58 = file->readNumber();
+
+		resourceKey.load(file);		
+		_fieldA8 = nullptr;
+		val = file->readNumber();
+		if (val) {
+			_string = resourceKey.getString();
+		}
+		break;
+
+	default:
+		break;
+	}
+
+	CNamedItem::load(file);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/game_object.h b/engines/titanic/objects/game_object.h
index 7e0fba6..53814f6 100644
--- a/engines/titanic/objects/game_object.h
+++ b/engines/titanic/objects/game_object.h
@@ -23,11 +23,58 @@
 #ifndef TITANIC_GAME_OBJECT_H
 #define TITANIC_GAME_OBJECT_H
 
+#include "common/rect.h"
+#include "titanic/objects/movie_clip.h"
 #include "titanic/objects/named_item.h"
 
 namespace Titanic {
 
 class CGameObject : public CNamedItem {
+protected:
+	Common::Rect _bounds;
+	double _field34;
+	double _field38;
+	double _field3C;
+	int _field40;
+	int _field44;
+	int _field48;
+	int _field4C;
+	int _field50;
+	int _field54;
+	int _field58;
+	int _field5C;
+	int _field60;
+	CMovieClipList _clipList1;
+	int _field74;
+	int _field78;
+	CMovieClipList _clipList2;
+	int _field8C;
+	int _field90;
+	int _field94;
+	int _field98;
+	int _field9C;
+	int _fieldA0;
+	int _fieldA4;
+	void *_fieldA8;
+	CString _string;
+	int _fieldB8;
+public:
+	CGameObject();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGameObject"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/resource_key.h b/engines/titanic/objects/resource_key.h
index 4cb40cd..9d1b70f 100644
--- a/engines/titanic/objects/resource_key.h
+++ b/engines/titanic/objects/resource_key.h
@@ -47,6 +47,8 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
+
+	const CString &getString() const { return _key; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
index 7e9aa4b..555394d 100644
--- a/engines/titanic/objects/saveable_object.cpp
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -29,6 +29,7 @@
 #include "titanic/objects/project_item.h"
 #include "titanic/objects/tree_item.h"
 #include "titanic/rooms/room_item.h"
+#include "titanic/rooms/service_elevator_door.h"
 
 namespace Titanic {
 
@@ -46,6 +47,7 @@ DEFFN(CMovieClipList);
 DEFFN(CNodeItem);
 DEFFN(CProjectItem);
 DEFFN(CRoomItem);
+DEFFN(CServiceElevatorDoor);
 DEFFN(CTreeItem);
 
 void CSaveableObject::initClassList() {
@@ -58,6 +60,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CNodeItem);
 	ADDFN(CProjectItem);
 	ADDFN(CRoomItem);
+	ADDFN(CServiceElevatorDoor);
 	ADDFN(CTreeItem);
 }
 
diff --git a/engines/titanic/rooms/door_auto_sound_event.cpp b/engines/titanic/rooms/door_auto_sound_event.cpp
new file mode 100644
index 0000000..279f4f9
--- /dev/null
+++ b/engines/titanic/rooms/door_auto_sound_event.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/rooms/door_auto_sound_event.h"
+
+namespace Titanic {
+
+CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(),
+		_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
+}
+
+void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldDC, indent);
+	file->writeNumberLine(_fieldE0, indent);
+
+	CAutoSoundEvent::save(file, indent);
+}
+
+void CDoorAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_fieldDC = file->readNumber();
+	_fieldE0 = file->readNumber();
+
+	CAutoSoundEvent::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/rooms/door_auto_sound_event.h b/engines/titanic/rooms/door_auto_sound_event.h
new file mode 100644
index 0000000..4f96027
--- /dev/null
+++ b/engines/titanic/rooms/door_auto_sound_event.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DOOR_AUTO_SOUND_EVENT_H
+#define TITANIC_DOOR_AUTO_SOUND_EVENT_H
+
+#include "titanic/objects/auto_sound_event.h"
+
+namespace Titanic {
+
+class CDoorAutoSoundEvent : public CAutoSoundEvent {
+protected:
+	CString _string1;
+	CString _string2;
+	int _fieldDC;
+	int _fieldE0;
+public:
+	CDoorAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DOOR_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/rooms/service_elevator_door.cpp b/engines/titanic/rooms/service_elevator_door.cpp
new file mode 100644
index 0000000..931a9d6
--- /dev/null
+++ b/engines/titanic/rooms/service_elevator_door.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/rooms/service_elevator_door.h"
+
+namespace Titanic {
+
+CServiceElevatorDoor::CServiceElevatorDoor() : CDoorAutoSoundEvent() {
+	_string1 = "z#31.wav";
+	_string2 = "z#32.wav";
+}
+
+void CServiceElevatorDoor::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string1, indent);
+
+	CDoorAutoSoundEvent::save(file, indent);
+}
+
+void CServiceElevatorDoor::load(SimpleFile *file) {
+	file->readNumber();
+	_string2 = file->readString();
+	_string1 = file->readString();
+
+	CDoorAutoSoundEvent::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/rooms/service_elevator_door.h b/engines/titanic/rooms/service_elevator_door.h
new file mode 100644
index 0000000..5b924bc
--- /dev/null
+++ b/engines/titanic/rooms/service_elevator_door.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SERVICE_ELEVATOR_DOOR_H
+#define TITANIC_SERVICE_ELEVATOR_DOOR_H
+
+#include "titanic/rooms/door_auto_sound_event.h"
+
+namespace Titanic {
+
+class CServiceElevatorDoor : public CDoorAutoSoundEvent {
+public:
+	CServiceElevatorDoor();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CServiceElevatorDoor"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SERVICE_ELEVATOR_DOOR_H */
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index 521f9e9..045de1f 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -191,6 +191,24 @@ double SimpleFile::readFloat() {
 	return floatValue;
 }
 
+Common::Point SimpleFile::readPoint() {
+	Common::Point pt;
+	pt.x = readNumber();
+	pt.y = readNumber();
+
+	return pt;
+}
+
+Common::Rect SimpleFile::readRect() {
+	Common::Rect r;
+	r.left = readNumber();
+	r.top = readNumber();
+	r.right = readNumber();
+	r.bottom = readNumber();
+
+	return r;
+}
+
 void SimpleFile::readBuffer(char *buffer, size_t count) {
 	CString tempString = readString();
 	if (buffer) {
@@ -264,6 +282,18 @@ void SimpleFile::writeNumberLine(int val, int indent) {
 	write("\n", 1);
 }
 
+void SimpleFile::writePoint(const Common::Point &pt, int indent) {
+	writeIndent(indent);
+	writeNumber(pt.x);
+	writeNumber(pt.y);
+	write("\n", 1);
+}
+
+void SimpleFile::writeRect(const Common::Rect &r, int indent) {
+	writePoint(Common::Point(r.left, r.top), indent);
+	writePoint(Common::Point(r.right, r.bottom), indent);
+}
+
 void SimpleFile::writeIndent(uint indent) {
 	for (uint idx = 0; idx < indent; ++idx)
 		write("\t", 1);
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
index 852c75b..c5ca701 100644
--- a/engines/titanic/simple_file.h
+++ b/engines/titanic/simple_file.h
@@ -26,6 +26,7 @@
 #include "common/scummsys.h"
 #include "common/file.h"
 #include "common/queue.h"
+#include "common/rect.h"
 #include "common/savefile.h"
 #include "titanic/string.h"
 
@@ -95,6 +96,16 @@ public:
 	double readFloat();
 
 	/**
+	 * Read in a point
+	 */
+	Common::Point readPoint();
+
+	/**
+	 * Read in a rect
+	 */
+	Common::Rect readRect();
+
+	/**
 	 * Read a string and copy it into an optionally passed buffer
 	 */
 	void readBuffer(char *buffer = nullptr, size_t count = 0);
@@ -130,6 +141,16 @@ public:
 	void writeNumberLine(int val, int indent);
 
 	/**
+	 * Write out a point line
+	 */
+	void writePoint(const Common::Point &pt, int indent);
+
+	/**
+	 * Write out a rect line
+	 */
+	void writeRect(const Common::Rect &r, int indent);
+
+	/**
 	 * Write out a number of tabs to form an indent in the output
 	 */
 	void writeIndent(uint indent);


Commit: 45043cc6e1da458a16e64e55ef5bed624421794d
    https://github.com/scummvm/scummvm/commit/45043cc6e1da458a16e64e55ef5bed624421794d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-24T23:51:32-05:00

Commit Message:
TITANIC: Added CViewItem class

Changed paths:
  A engines/titanic/objects/view_item.cpp
  A engines/titanic/objects/view_item.h
    engines/titanic/module.mk
    engines/titanic/objects/saveable_object.cpp
    engines/titanic/simple_file.cpp
    engines/titanic/simple_file.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 5dc7195..b14ec0f 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -29,6 +29,7 @@ MODULE_OBJS := \
 	objects/resource_key.o \
 	objects/saveable_object.o \
 	objects/tree_item.o \
+	objects/view_item.o \
 	rooms/door_auto_sound_event.o \
 	rooms/room_item.o \
 	rooms/service_elevator_door.o
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
index 555394d..cd5f7eb 100644
--- a/engines/titanic/objects/saveable_object.cpp
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -28,6 +28,7 @@
 #include "titanic/objects/node_item.h"
 #include "titanic/objects/project_item.h"
 #include "titanic/objects/tree_item.h"
+#include "titanic/objects/view_item.h"
 #include "titanic/rooms/room_item.h"
 #include "titanic/rooms/service_elevator_door.h"
 
@@ -49,6 +50,7 @@ DEFFN(CProjectItem);
 DEFFN(CRoomItem);
 DEFFN(CServiceElevatorDoor);
 DEFFN(CTreeItem);
+DEFFN(CViewItem);
 
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
@@ -62,6 +64,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CRoomItem);
 	ADDFN(CServiceElevatorDoor);
 	ADDFN(CTreeItem);
+	ADDFN(CViewItem);
 }
 
 void CSaveableObject::freeClassList() {
@@ -69,7 +72,6 @@ void CSaveableObject::freeClassList() {
 }
 
 CSaveableObject *CSaveableObject::createInstance(const Common::String &name) {
-warning("%s", name.c_str());
 	return (*_classList)[name]();
 }
 
diff --git a/engines/titanic/objects/view_item.cpp b/engines/titanic/objects/view_item.cpp
new file mode 100644
index 0000000..1199ba9
--- /dev/null
+++ b/engines/titanic/objects/view_item.cpp
@@ -0,0 +1,70 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/view_item.h"
+
+namespace Titanic {
+
+CViewItem::CViewItem() : CNamedItem() {
+	_field24 = 0;
+	_field28 = 0.0;
+	_field30 = 0;
+	_field50 = 0;
+	_field54 = 0;
+	setData(0.0);
+}
+
+void CViewItem::setData(double v) {
+	_field28 = v;
+	_field50 = cos(_field28) * 30.0;
+	_field54 = sin(_field28) * -30.0;
+}
+
+void CViewItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	_resourceKey.save(file, indent);
+	file->writeQuotedLine("V", indent);
+	file->writeFloatLine(_field28, indent + 1);
+	file->writeNumberLine(_field30, indent + 1);
+
+	CNamedItem::save(file, indent);
+}
+
+void CViewItem::load(SimpleFile *file) {
+	int val = file->readNumber();
+	
+	switch (val) {
+	case 1:
+		_resourceKey.load(file);
+		// Deliberate fall-through
+
+	default:
+		file->readBuffer();
+		setData(file->readFloat());
+		_field30 = file->readNumber();
+		break;
+	}
+
+	CNamedItem::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/view_item.h b/engines/titanic/objects/view_item.h
new file mode 100644
index 0000000..1bd2d6d
--- /dev/null
+++ b/engines/titanic/objects/view_item.h
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_VIEW_ITEM_H
+#define TITANIC_VIEW_ITEM_H
+
+#include "titanic/objects/named_item.h"
+#include "titanic/objects/resource_key.h"
+
+namespace Titanic {
+
+class CViewItem : public CNamedItem {
+private:
+	void setData(double v);
+protected:
+	int _field24;
+	double _field28;
+	int _field30;
+	CResourceKey _resourceKey;
+	int _field50;
+	int _field54;
+public:
+	CViewItem();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNamedItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NAMED_ITEM_H */
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index 045de1f..9bc365b 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -282,6 +282,17 @@ void SimpleFile::writeNumberLine(int val, int indent) {
 	write("\n", 1);
 }
 
+void SimpleFile::writeFloat(double val) {
+	Common::String valStr = Common::String::format("%f ", val);
+	write(valStr.c_str(), valStr.size());
+}
+
+void SimpleFile::writeFloatLine(double val, int indent) {
+	writeIndent(indent);
+	writeFloat(val);
+	write("\n", 1);
+}
+
 void SimpleFile::writePoint(const Common::Point &pt, int indent) {
 	writeIndent(indent);
 	writeNumber(pt.x);
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
index c5ca701..8ea2b5a 100644
--- a/engines/titanic/simple_file.h
+++ b/engines/titanic/simple_file.h
@@ -141,6 +141,16 @@ public:
 	void writeNumberLine(int val, int indent);
 
 	/**
+	 * Write a floating point number
+	 */
+	void writeFloat(double val);
+
+	/**
+	 * Write a floating point number as a line
+	 */
+	void writeFloatLine(double val, int indent);
+
+	/**
 	 * Write out a point line
 	 */
 	void writePoint(const Common::Point &pt, int indent);


Commit: f509f3322b54e2ffddc0244dca365756e0b47401
    https://github.com/scummvm/scummvm/commit/f509f3322b54e2ffddc0244dca365756e0b47401
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-25T07:40:04-05:00

Commit Message:
TITANIC: Implemented CLinkItem class

Changed paths:
  A engines/titanic/objects/link_item.cpp
  A engines/titanic/objects/link_item.h
    engines/titanic/module.mk
    engines/titanic/objects/saveable_object.cpp



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index b14ec0f..1120f69 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -19,6 +19,7 @@ MODULE_OBJS := \
 	objects/dont_save_file_item.o \
 	objects/file_item.o \
 	objects/game_object.o \
+	objects/link_item.o \
 	objects/list.o \
 	objects/message_target.o \
 	objects/movie_clip.o \
diff --git a/engines/titanic/objects/link_item.cpp b/engines/titanic/objects/link_item.cpp
new file mode 100644
index 0000000..90774ad
--- /dev/null
+++ b/engines/titanic/objects/link_item.cpp
@@ -0,0 +1,100 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/objects/link_item.h"
+
+namespace Titanic {
+
+CLinkItemSub::CLinkItemSub() : _field0(0), _field4(0), _field8(0), _fieldC(0) {
+}
+
+CLinkItem::CLinkItem() : CNamedItem() {
+	_field24 = -1;
+	_field28 = -1;
+	_field2C = -1;
+	_field30 = 0;
+	_field34 = 1;
+	_name = "Link";
+}
+
+void CLinkItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(2, indent);
+	file->writeQuotedLine("L", indent);
+	file->writeNumberLine(_field34, indent + 1);
+	file->writeNumberLine(_field30, indent + 1);
+	file->writeNumberLine(_field24, indent + 1);
+	file->writeNumberLine(_field28, indent + 1);
+	file->writeNumberLine(_field2C, indent + 1);
+
+	file->writeQuotedLine("Hotspot", indent + 1);
+	file->writeNumberLine(_sub._field0, indent + 2);
+	file->writeNumberLine(_sub._field4, indent + 2);
+	file->writeNumberLine(_sub._field8, indent + 2);
+	file->writeNumberLine(_sub._fieldC, indent + 2);
+
+	CNamedItem::save(file, indent);
+}
+
+void CLinkItem::load(SimpleFile *file) {
+	int val = file->readNumber();
+	file->readBuffer();
+
+	switch (val) {
+	case 3:
+		_field34 = file->readNumber();
+		// Deliberate fall-through
+
+	case 1:
+		_field30 = file->readNumber();
+		// Deliberate fall-through
+
+	case 0:
+		_field24 = file->readNumber();
+		_field28 = file->readNumber();
+		_field2C = file->readNumber();
+		break;
+
+	default:
+		break;
+	}
+
+	CNamedItem::load(file);
+
+	if (val < 2) {
+		switch (_field30) {
+		case 2:
+			_field34 = 2;
+			break;
+		case 3:
+			_field34 = 3;
+			break;
+		case 5:
+			_field34 = 7;
+			break;
+		default:
+			_field34 = 4;
+			break;
+		}
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/objects/link_item.h b/engines/titanic/objects/link_item.h
new file mode 100644
index 0000000..efe5ec1
--- /dev/null
+++ b/engines/titanic/objects/link_item.h
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LINK_ITEM_H
+#define TITANIC_LINK_ITEM_H
+
+#include "titanic/objects/named_item.h"
+
+namespace Titanic {
+
+class CLinkItemSub {
+public:
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+public:
+	CLinkItemSub();
+};
+
+class CLinkItem : public CNamedItem {
+protected:
+	int _field24;
+	int _field28;
+	int _field2C;
+	int _field30;
+	int _field34;
+	CLinkItemSub _sub;
+public:
+	CLinkItem();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLinkItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LINK_ITEM_H */
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
index cd5f7eb..b661168 100644
--- a/engines/titanic/objects/saveable_object.cpp
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/objects/saveable_object.h"
 #include "titanic/objects/file_item.h"
+#include "titanic/objects/link_item.h"
 #include "titanic/objects/list.h"
 #include "titanic/objects/message_target.h"
 #include "titanic/objects/movie_clip.h"
@@ -42,6 +43,7 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 
 DEFFN(CFileItem);
 DEFFN(CFileListItem);
+DEFFN(CLinkItem);
 DEFFN(CMessageTarget);
 DEFFN(CMovieClip);
 DEFFN(CMovieClipList);
@@ -56,6 +58,7 @@ void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
 	ADDFN(CFileItem);
 	ADDFN(CFileListItem);
+	ADDFN(CLinkItem);
 	ADDFN(CMessageTarget);
 	ADDFN(CMovieClip);
 	ADDFN(CMovieClipList);


Commit: 27f5f9e926159186da254a00a8bedc6dd028d2f4
    https://github.com/scummvm/scummvm/commit/27f5f9e926159186da254a00a8bedc6dd028d2f4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-25T07:50:44-05:00

Commit Message:
TITANIC: Fix loading CLinkItem

Changed paths:
    engines/titanic/objects/link_item.cpp



diff --git a/engines/titanic/objects/link_item.cpp b/engines/titanic/objects/link_item.cpp
index 90774ad..fe2a7cf 100644
--- a/engines/titanic/objects/link_item.cpp
+++ b/engines/titanic/objects/link_item.cpp
@@ -59,7 +59,7 @@ void CLinkItem::load(SimpleFile *file) {
 	file->readBuffer();
 
 	switch (val) {
-	case 3:
+	case 2:
 		_field34 = file->readNumber();
 		// Deliberate fall-through
 
@@ -71,6 +71,12 @@ void CLinkItem::load(SimpleFile *file) {
 		_field24 = file->readNumber();
 		_field28 = file->readNumber();
 		_field2C = file->readNumber();
+
+		file->readBuffer();
+		_sub._field0 = file->readNumber();
+		_sub._field4 = file->readNumber();
+		_sub._field8 = file->readNumber();
+		_sub._fieldC = file->readNumber();
 		break;
 
 	default:


Commit: 906aa791ee337f86dc7565e980afa395df5e9fdb
    https://github.com/scummvm/scummvm/commit/906aa791ee337f86dc7565e980afa395df5e9fdb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-25T08:39:15-05:00

Commit Message:
TITANIC: Implemented CAnnounce, CPETPosition, CSUBGlass

Changed paths:
  A engines/titanic/rooms/announce.cpp
  A engines/titanic/rooms/announce.h
  A engines/titanic/rooms/pet_position.cpp
  A engines/titanic/rooms/pet_position.h
  A engines/titanic/rooms/sub_glass.cpp
  A engines/titanic/rooms/sub_glass.h
    engines/titanic/module.mk
    engines/titanic/objects/saveable_object.cpp



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 1120f69..e74e811 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -31,9 +31,12 @@ MODULE_OBJS := \
 	objects/saveable_object.o \
 	objects/tree_item.o \
 	objects/view_item.o \
+	rooms/announce.o \
 	rooms/door_auto_sound_event.o \
+	rooms/pet_position.o \
 	rooms/room_item.o \
-	rooms/service_elevator_door.o
+	rooms/service_elevator_door.o \
+	rooms/sub_glass.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
index b661168..73980d1 100644
--- a/engines/titanic/objects/saveable_object.cpp
+++ b/engines/titanic/objects/saveable_object.cpp
@@ -28,10 +28,14 @@
 #include "titanic/objects/movie_clip.h"
 #include "titanic/objects/node_item.h"
 #include "titanic/objects/project_item.h"
+#include "titanic/objects/saveable_object.h"
 #include "titanic/objects/tree_item.h"
 #include "titanic/objects/view_item.h"
+#include "titanic/rooms/announce.h"
+#include "titanic/rooms/pet_position.h"
 #include "titanic/rooms/room_item.h"
 #include "titanic/rooms/service_elevator_door.h"
+#include "titanic/rooms/sub_glass.h"
 
 namespace Titanic {
 
@@ -41,6 +45,7 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 #define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
 #define ADDFN(T) (*_classList)[#T] = Function##T
 
+DEFFN(CAnnounce);
 DEFFN(CFileItem);
 DEFFN(CFileListItem);
 DEFFN(CLinkItem);
@@ -48,14 +53,17 @@ DEFFN(CMessageTarget);
 DEFFN(CMovieClip);
 DEFFN(CMovieClipList);
 DEFFN(CNodeItem);
+DEFFN(CPETPosition);
 DEFFN(CProjectItem);
 DEFFN(CRoomItem);
 DEFFN(CServiceElevatorDoor);
+DEFFN(CSUBGlass);
 DEFFN(CTreeItem);
 DEFFN(CViewItem);
 
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
+	ADDFN(CAnnounce);
 	ADDFN(CFileItem);
 	ADDFN(CFileListItem);
 	ADDFN(CLinkItem);
@@ -63,9 +71,11 @@ void CSaveableObject::initClassList() {
 	ADDFN(CMovieClip);
 	ADDFN(CMovieClipList);
 	ADDFN(CNodeItem);
+	ADDFN(CPETPosition);
 	ADDFN(CProjectItem);
 	ADDFN(CRoomItem);
 	ADDFN(CServiceElevatorDoor);
+	ADDFN(CSUBGlass);
 	ADDFN(CTreeItem);
 	ADDFN(CViewItem);
 }
diff --git a/engines/titanic/rooms/announce.cpp b/engines/titanic/rooms/announce.cpp
new file mode 100644
index 0000000..b790566
--- /dev/null
+++ b/engines/titanic/rooms/announce.cpp
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/rooms/announce.h"
+
+namespace Titanic {
+
+CAnnounce::CAnnounce() : _fieldBC(0), _fieldC0(0), _fieldC4(1), _fieldC8(0) {
+}
+
+void CAnnounce::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CAnnounce::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/rooms/announce.h b/engines/titanic/rooms/announce.h
new file mode 100644
index 0000000..58f928d
--- /dev/null
+++ b/engines/titanic/rooms/announce.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ANNOUNCE_H
+#define TITANIC_ANNOUNCE_H
+
+#include "titanic/objects/game_object.h"
+
+namespace Titanic {
+
+class CAnnounce : public CGameObject {
+private:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+public:
+	CAnnounce();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAnnounce"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ROOM_ITEM_H */
diff --git a/engines/titanic/rooms/pet_position.cpp b/engines/titanic/rooms/pet_position.cpp
new file mode 100644
index 0000000..b5bf2e6
--- /dev/null
+++ b/engines/titanic/rooms/pet_position.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/rooms/pet_position.h"
+
+namespace Titanic {
+
+void CPETPosition::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPETPosition::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/rooms/pet_position.h b/engines/titanic/rooms/pet_position.h
new file mode 100644
index 0000000..dc27377
--- /dev/null
+++ b/engines/titanic/rooms/pet_position.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_POSITION_H
+#define TITANIC_PET_POSITION_H
+
+#include "titanic/objects/game_object.h"
+
+namespace Titanic {
+
+class CPETPosition : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPETPosition"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ROOM_ITEM_H */
diff --git a/engines/titanic/rooms/sub_glass.cpp b/engines/titanic/rooms/sub_glass.cpp
new file mode 100644
index 0000000..27f47fd
--- /dev/null
+++ b/engines/titanic/rooms/sub_glass.cpp
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/rooms/sub_glass.h"
+
+namespace Titanic {
+
+CSUBGlass::CSUBGlass() : _fieldBC(0), _fieldC0(0), _fieldC4(1), _fieldC8(0) {
+}
+
+void CSUBGlass::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeQuotedLine(_string, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CSUBGlass::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+	_string = file->readString();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/rooms/sub_glass.h b/engines/titanic/rooms/sub_glass.h
new file mode 100644
index 0000000..b7a992d
--- /dev/null
+++ b/engines/titanic/rooms/sub_glass.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SUB_GLASS_H
+#define TITANIC_SUB_GLASS_H
+
+#include "titanic/objects/game_object.h"
+
+namespace Titanic {
+
+class CSUBGlass : public CGameObject {
+private:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	int _fieldCC;
+	CString _string;
+public:
+	CSUBGlass();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSUBGlass"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ROOM_ITEM_H */


Commit: 63db0980e5f48764667863afe15b8f43b386c1a8
    https://github.com/scummvm/scummvm/commit/63db0980e5f48764667863afe15b8f43b386c1a8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-25T08:48:21-05:00

Commit Message:
TITANIC: Rename of sub-folders for better clarity

Changed paths:
  A engines/titanic/core/auto_sound_event.cpp
  A engines/titanic/core/auto_sound_event.h
  A engines/titanic/core/dont_save_file_item.cpp
  A engines/titanic/core/dont_save_file_item.h
  A engines/titanic/core/file_item.cpp
  A engines/titanic/core/file_item.h
  A engines/titanic/core/game_object.cpp
  A engines/titanic/core/game_object.h
  A engines/titanic/core/link_item.cpp
  A engines/titanic/core/link_item.h
  A engines/titanic/core/list.cpp
  A engines/titanic/core/list.h
  A engines/titanic/core/message_target.cpp
  A engines/titanic/core/message_target.h
  A engines/titanic/core/movie_clip.cpp
  A engines/titanic/core/movie_clip.h
  A engines/titanic/core/named_item.cpp
  A engines/titanic/core/named_item.h
  A engines/titanic/core/node_item.cpp
  A engines/titanic/core/node_item.h
  A engines/titanic/core/pet_control.cpp
  A engines/titanic/core/pet_control.h
  A engines/titanic/core/project_item.cpp
  A engines/titanic/core/project_item.h
  A engines/titanic/core/resource_key.cpp
  A engines/titanic/core/resource_key.h
  A engines/titanic/core/saveable_object.cpp
  A engines/titanic/core/saveable_object.h
  A engines/titanic/core/tree_item.cpp
  A engines/titanic/core/tree_item.h
  A engines/titanic/core/view_item.cpp
  A engines/titanic/core/view_item.h
  A engines/titanic/game/announce.cpp
  A engines/titanic/game/announce.h
  A engines/titanic/game/door_auto_sound_event.cpp
  A engines/titanic/game/door_auto_sound_event.h
  A engines/titanic/game/pet_position.cpp
  A engines/titanic/game/pet_position.h
  A engines/titanic/game/room_item.cpp
  A engines/titanic/game/room_item.h
  A engines/titanic/game/service_elevator_door.cpp
  A engines/titanic/game/service_elevator_door.h
  A engines/titanic/game/sub_glass.cpp
  A engines/titanic/game/sub_glass.h
  A engines/titanic/game/succubus.cpp
  A engines/titanic/game/succubus.h
  R engines/titanic/objects/auto_sound_event.cpp
  R engines/titanic/objects/auto_sound_event.h
  R engines/titanic/objects/dont_save_file_item.cpp
  R engines/titanic/objects/dont_save_file_item.h
  R engines/titanic/objects/file_item.cpp
  R engines/titanic/objects/file_item.h
  R engines/titanic/objects/game_object.cpp
  R engines/titanic/objects/game_object.h
  R engines/titanic/objects/link_item.cpp
  R engines/titanic/objects/link_item.h
  R engines/titanic/objects/list.cpp
  R engines/titanic/objects/list.h
  R engines/titanic/objects/message_target.cpp
  R engines/titanic/objects/message_target.h
  R engines/titanic/objects/movie_clip.cpp
  R engines/titanic/objects/movie_clip.h
  R engines/titanic/objects/named_item.cpp
  R engines/titanic/objects/named_item.h
  R engines/titanic/objects/node_item.cpp
  R engines/titanic/objects/node_item.h
  R engines/titanic/objects/pet_control.cpp
  R engines/titanic/objects/pet_control.h
  R engines/titanic/objects/project_item.cpp
  R engines/titanic/objects/project_item.h
  R engines/titanic/objects/resource_key.cpp
  R engines/titanic/objects/resource_key.h
  R engines/titanic/objects/saveable_object.cpp
  R engines/titanic/objects/saveable_object.h
  R engines/titanic/objects/tree_item.cpp
  R engines/titanic/objects/tree_item.h
  R engines/titanic/objects/view_item.cpp
  R engines/titanic/objects/view_item.h
  R engines/titanic/rooms/announce.cpp
  R engines/titanic/rooms/announce.h
  R engines/titanic/rooms/door_auto_sound_event.cpp
  R engines/titanic/rooms/door_auto_sound_event.h
  R engines/titanic/rooms/pet_position.cpp
  R engines/titanic/rooms/pet_position.h
  R engines/titanic/rooms/room_item.cpp
  R engines/titanic/rooms/room_item.h
  R engines/titanic/rooms/service_elevator_door.cpp
  R engines/titanic/rooms/service_elevator_door.h
  R engines/titanic/rooms/sub_glass.cpp
  R engines/titanic/rooms/sub_glass.h
    engines/titanic/main_game_window.h
    engines/titanic/module.mk
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/core/auto_sound_event.cpp b/engines/titanic/core/auto_sound_event.cpp
new file mode 100644
index 0000000..1bd5f54
--- /dev/null
+++ b/engines/titanic/core/auto_sound_event.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/auto_sound_event.h"
+
+namespace Titanic {
+
+CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
+}
+
+void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/auto_sound_event.h b/engines/titanic/core/auto_sound_event.h
new file mode 100644
index 0000000..4180a68
--- /dev/null
+++ b/engines/titanic/core/auto_sound_event.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_SOUND_EVENT_H
+#define TITANIC_AUTO_SOUND_EVENT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CAutoSoundEvent : public CGameObject {
+private:
+	int _fieldBC;
+	int _fieldC0;
+public:
+	CAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/core/dont_save_file_item.cpp b/engines/titanic/core/dont_save_file_item.cpp
new file mode 100644
index 0000000..389cef5
--- /dev/null
+++ b/engines/titanic/core/dont_save_file_item.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/dont_save_file_item.h"
+
+namespace Titanic {
+
+void CDontSaveFileItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+}
+
+void CDontSaveFileItem::load(SimpleFile *file) {
+	file->readNumber();
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/dont_save_file_item.h b/engines/titanic/core/dont_save_file_item.h
new file mode 100644
index 0000000..f2b321c
--- /dev/null
+++ b/engines/titanic/core/dont_save_file_item.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DONT_SAVE_FILE_ITEM_H
+#define TITANIC_DONT_SAVE_FILE_ITEM_H
+
+#include "titanic/core/file_item.h"
+
+namespace Titanic {
+
+class CDontSaveFileItem : public CFileItem {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDontSaveFileItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DONT_SAVE_FILE_ITEM_H */
diff --git a/engines/titanic/core/file_item.cpp b/engines/titanic/core/file_item.cpp
new file mode 100644
index 0000000..0d3316d
--- /dev/null
+++ b/engines/titanic/core/file_item.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/file_item.h"
+
+namespace Titanic {
+
+void CFileItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	CTreeItem::save(file, indent);
+}
+
+void CFileItem::load(SimpleFile *file) {
+	file->readNumber();
+
+	CTreeItem::load(file);
+}
+
+CString CFileItem::formFilename() const {
+	return "";
+}
+
+CString CFileItem::getFilename() const {
+	//dynamic_cast<CFileItem *>(getRoot())->formDataPath();
+	return _filename;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/file_item.h b/engines/titanic/core/file_item.h
new file mode 100644
index 0000000..0795b05
--- /dev/null
+++ b/engines/titanic/core/file_item.h
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FILE_ITEM_H
+#define TITANIC_FILE_ITEM_H
+
+#include "titanic/string.h"
+#include "titanic/core/list.h"
+#include "titanic/core/tree_item.h"
+
+namespace Titanic {
+
+class CFileItem: public CTreeItem {
+private:
+	CString _filename;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CFileItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);	
+
+	/**
+	 * Returns true if the item is a file item
+	 */
+	virtual bool isFileItem() const { return true; }
+
+	/**
+	 * Form a filename for the file item
+	 */
+	CString formFilename() const;
+
+	/**
+	 * Get a string?
+	 */
+	CString getFilename() const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FILE_ITEM_H */
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
new file mode 100644
index 0000000..3238258
--- /dev/null
+++ b/engines/titanic/core/game_object.cpp
@@ -0,0 +1,121 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/game_object.h"
+#include "titanic/core/resource_key.h"
+
+namespace Titanic {
+
+CGameObject::CGameObject(): CNamedItem() {
+	_bounds = Common::Rect(0, 0, 15, 15);
+	_field34 = 0;
+	_field38 = 0;
+	_field3C = 0;
+	_field40 = 0;
+	_field44 = 0xF0;
+	_field48 = 0xF0;
+	_field4C = 0xFF;
+	_field50 = 0;
+	_field54 = 0;
+	_field58 = 0;
+	_field5C = 1;
+	_field60 = 0;
+	_field74 = 1;
+	_field78 = 0;
+	_field8C = -1;
+	_field90 = 0;
+	_field94 = 0;
+	_field98 = 0;
+	_field9C = 0;
+	_fieldA0 = 0;
+	_fieldA4 = 0;
+	_fieldA8 = nullptr;
+	_fieldB8 = 0;
+}
+
+void CGameObject::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(7, indent);
+	error("TODO: CGameObject::save");
+
+	CNamedItem::save(file, indent);
+}
+
+void CGameObject::load(SimpleFile *file) {
+	int val = file->readNumber();
+	CResourceKey resourceKey;
+
+	switch (val) {
+	case 7:
+		_clipList2.load(file);
+		_field8C = file->readNumber();
+		// Deliberate fall-through
+
+	case 6:
+		val = _field74 = file->readNumber();
+		// Deliberate fall-through
+
+	case 5:
+		_clipList1.load(file);
+		// Deliberate fall-through
+
+	case 4:
+		_field60 = file->readNumber();
+		// Deliberate fall-through
+
+	case 3:
+		_field40 = file->readNumber();
+		// Deliberate fall-through
+
+	case 2:
+		_string = file->readString();
+		// Deliberate fall-through
+
+	case 1:
+		_bounds = file->readRect();
+		_field34 = file->readFloat();
+		_field38 = file->readFloat();
+		_field3C = file->readFloat();
+		_field44 = file->readNumber();
+		_field48 = file->readNumber();
+		_field4C = file->readNumber();
+		_fieldB8 = file->readNumber();
+		_field5C = file->readNumber();
+		_field50 = file->readNumber();
+		_field54 = file->readNumber();
+		_field58 = file->readNumber();
+
+		resourceKey.load(file);		
+		_fieldA8 = nullptr;
+		val = file->readNumber();
+		if (val) {
+			_string = resourceKey.getString();
+		}
+		break;
+
+	default:
+		break;
+	}
+
+	CNamedItem::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
new file mode 100644
index 0000000..7d15882
--- /dev/null
+++ b/engines/titanic/core/game_object.h
@@ -0,0 +1,82 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GAME_OBJECT_H
+#define TITANIC_GAME_OBJECT_H
+
+#include "common/rect.h"
+#include "titanic/core/movie_clip.h"
+#include "titanic/core/named_item.h"
+
+namespace Titanic {
+
+class CGameObject : public CNamedItem {
+protected:
+	Common::Rect _bounds;
+	double _field34;
+	double _field38;
+	double _field3C;
+	int _field40;
+	int _field44;
+	int _field48;
+	int _field4C;
+	int _field50;
+	int _field54;
+	int _field58;
+	int _field5C;
+	int _field60;
+	CMovieClipList _clipList1;
+	int _field74;
+	int _field78;
+	CMovieClipList _clipList2;
+	int _field8C;
+	int _field90;
+	int _field94;
+	int _field98;
+	int _field9C;
+	int _fieldA0;
+	int _fieldA4;
+	void *_fieldA8;
+	CString _string;
+	int _fieldB8;
+public:
+	CGameObject();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGameObject"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_H */
diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp
new file mode 100644
index 0000000..1d85dfa
--- /dev/null
+++ b/engines/titanic/core/link_item.cpp
@@ -0,0 +1,106 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/link_item.h"
+
+namespace Titanic {
+
+CLinkItemSub::CLinkItemSub() : _field0(0), _field4(0), _field8(0), _fieldC(0) {
+}
+
+CLinkItem::CLinkItem() : CNamedItem() {
+	_field24 = -1;
+	_field28 = -1;
+	_field2C = -1;
+	_field30 = 0;
+	_field34 = 1;
+	_name = "Link";
+}
+
+void CLinkItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(2, indent);
+	file->writeQuotedLine("L", indent);
+	file->writeNumberLine(_field34, indent + 1);
+	file->writeNumberLine(_field30, indent + 1);
+	file->writeNumberLine(_field24, indent + 1);
+	file->writeNumberLine(_field28, indent + 1);
+	file->writeNumberLine(_field2C, indent + 1);
+
+	file->writeQuotedLine("Hotspot", indent + 1);
+	file->writeNumberLine(_sub._field0, indent + 2);
+	file->writeNumberLine(_sub._field4, indent + 2);
+	file->writeNumberLine(_sub._field8, indent + 2);
+	file->writeNumberLine(_sub._fieldC, indent + 2);
+
+	CNamedItem::save(file, indent);
+}
+
+void CLinkItem::load(SimpleFile *file) {
+	int val = file->readNumber();
+	file->readBuffer();
+
+	switch (val) {
+	case 2:
+		_field34 = file->readNumber();
+		// Deliberate fall-through
+
+	case 1:
+		_field30 = file->readNumber();
+		// Deliberate fall-through
+
+	case 0:
+		_field24 = file->readNumber();
+		_field28 = file->readNumber();
+		_field2C = file->readNumber();
+
+		file->readBuffer();
+		_sub._field0 = file->readNumber();
+		_sub._field4 = file->readNumber();
+		_sub._field8 = file->readNumber();
+		_sub._fieldC = file->readNumber();
+		break;
+
+	default:
+		break;
+	}
+
+	CNamedItem::load(file);
+
+	if (val < 2) {
+		switch (_field30) {
+		case 2:
+			_field34 = 2;
+			break;
+		case 3:
+			_field34 = 3;
+			break;
+		case 5:
+			_field34 = 7;
+			break;
+		default:
+			_field34 = 4;
+			break;
+		}
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
new file mode 100644
index 0000000..22c07a2
--- /dev/null
+++ b/engines/titanic/core/link_item.h
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LINK_ITEM_H
+#define TITANIC_LINK_ITEM_H
+
+#include "titanic/core/named_item.h"
+
+namespace Titanic {
+
+class CLinkItemSub {
+public:
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+public:
+	CLinkItemSub();
+};
+
+class CLinkItem : public CNamedItem {
+protected:
+	int _field24;
+	int _field28;
+	int _field2C;
+	int _field30;
+	int _field34;
+	CLinkItemSub _sub;
+public:
+	CLinkItem();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLinkItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LINK_ITEM_H */
diff --git a/engines/titanic/core/list.cpp b/engines/titanic/core/list.cpp
new file mode 100644
index 0000000..d733ce2
--- /dev/null
+++ b/engines/titanic/core/list.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/list.h"
+
+namespace Titanic {
+
+void ListItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+}
+
+void ListItem::load(SimpleFile *file) {
+	file->readNumber();
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/list.h b/engines/titanic/core/list.h
new file mode 100644
index 0000000..d990aec
--- /dev/null
+++ b/engines/titanic/core/list.h
@@ -0,0 +1,139 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LIST_H
+#define TITANIC_LIST_H
+
+#include "common/scummsys.h"
+#include "common/list.h"
+#include "titanic/simple_file.h"
+#include "titanic/core/saveable_object.h"
+
+namespace Titanic {
+
+/**
+ * Base list item class
+ */
+class ListItem: public CSaveableObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "ListItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+template<typename T>
+class List : public CSaveableObject, public Common::List<T *> {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return nullptr; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const {
+		file->writeNumberLine(0, indent);
+
+		// Write out number of items
+		file->writeQuotedLine("L", indent);
+		file->writeNumberLine(Common::List<T *>::size(), indent);
+
+		// Iterate through writing entries
+		Common::List<T *>::const_iterator i;
+		for (i = Common::List<T *>::begin(); i != Common::List<T *>::end(); ++i) {
+			const ListItem *item = *i;
+			item->saveHeader(file, indent);
+			item->save(file, indent + 1);
+			item->saveFooter(file, indent);
+		}
+
+	}
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file) {
+		file->readNumber();
+		file->readBuffer();
+
+		Common::List<T *>::clear();
+		uint count = file->readNumber();
+
+		for (uint idx = 0; idx < count; ++idx) {
+			// Validate the class start header
+			if (!file->IsClassStart())
+				error("Unexpected class end");
+
+			// Get item's class name and use it to instantiate an item
+			CString className = file->readString();
+			T *newItem = dynamic_cast<T *>(CSaveableObject::createInstance(className));
+			if (!newItem)
+				error("Could not create instance of %s", className.c_str());
+
+			// Load the item's data and add it to the list
+			newItem->load(file);
+			Common::List<T *>::push_back(newItem);
+
+			// Validate the class end footer
+			if (file->IsClassStart())
+				error("Unexpected class start");
+		}
+	}
+
+	/**
+	 * Clear the list and destroy any items in it
+	 */
+	void destroyContents() {
+		for (Common::List<T *>::iterator i = Common::List<T *>::begin(); 
+				i != Common::List<T *>::end(); ++i) {
+			CSaveableObject *obj = *i;
+			delete obj;
+		}
+
+		Common::List<T *>::clear();
+	}
+
+	/**
+	 * Add a new item to the list of the type the list contains
+	 */
+	T *List::add() {
+		T *item = new T();
+		Common::List<T *>::push_back(item);
+		return item;
+	}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LIST_H */
diff --git a/engines/titanic/core/message_target.cpp b/engines/titanic/core/message_target.cpp
new file mode 100644
index 0000000..a7dd3a0
--- /dev/null
+++ b/engines/titanic/core/message_target.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/message_target.h"
+
+namespace Titanic {
+	
+void CMessageTarget::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	CSaveableObject::save(file, indent);
+}
+
+void CMessageTarget::load(SimpleFile *file) {
+	file->readNumber();
+	CSaveableObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/message_target.h b/engines/titanic/core/message_target.h
new file mode 100644
index 0000000..1afc48b
--- /dev/null
+++ b/engines/titanic/core/message_target.h
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MESSAGE_TARGET_H
+#define TITANIC_MESSAGE_TARGET_H
+
+#include "titanic/core/saveable_object.h"
+
+namespace Titanic {
+
+class CMessageTarget: public CSaveableObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMessageTarget"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MESSAGE_TARGET_H */
diff --git a/engines/titanic/core/movie_clip.cpp b/engines/titanic/core/movie_clip.cpp
new file mode 100644
index 0000000..fec09f6
--- /dev/null
+++ b/engines/titanic/core/movie_clip.cpp
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/movie_clip.h"
+
+namespace Titanic {
+
+CMovieClip::CMovieClip() {
+}
+
+void CMovieClip::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(2, indent);
+	file->writeQuotedLine("Clip", indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_field18, indent);
+	file->writeNumberLine(_field1C, indent);
+
+	ListItem::save(file, indent);
+}
+
+void CMovieClip::load(SimpleFile *file) {
+	int val = file->readNumber();
+
+	switch (val) {
+	case 1:
+		_string1 = file->readString();
+		_field18 = file->readNumber();
+		_field1C = file->readNumber();
+		_field20 = file->readNumber();
+		_field24 = file->readNumber();
+		_field28 = file->readNumber();
+		_field2C = file->readNumber();
+		_field30 = file->readNumber();
+		break;
+
+	case 2:
+		file->readString();
+		_string1 = file->readString();
+		_field18 = file->readNumber();
+		_field1C = file->readNumber();
+		break;
+
+	default:
+		break;
+	}
+
+	ListItem::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/movie_clip.h b/engines/titanic/core/movie_clip.h
new file mode 100644
index 0000000..f16e3eb
--- /dev/null
+++ b/engines/titanic/core/movie_clip.h
@@ -0,0 +1,74 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVIE_CLIP_H
+#define TITANIC_MOVIE_CLIP_H
+
+#include "titanic/core/list.h"
+
+namespace Titanic {
+
+/**
+ * Movie clip
+ */
+class CMovieClip : public ListItem {
+private:
+	CString _string1;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+	int _field28;
+	int _field2C;
+	int _field30;
+	CString _string2;
+	CString _string3;
+public:
+	CMovieClip();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMovieClip"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+/**
+ * Movie clip list
+ */
+class CMovieClipList: public List<CMovieClip> {
+public:
+	virtual const char *getClassName() const { return "CMovieClipList"; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVIE_CLIP_H */
diff --git a/engines/titanic/core/named_item.cpp b/engines/titanic/core/named_item.cpp
new file mode 100644
index 0000000..10d9588
--- /dev/null
+++ b/engines/titanic/core/named_item.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/named_item.h"
+
+namespace Titanic {
+
+void CNamedItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	file->writeQuotedLine(_name, indent);
+
+	CTreeItem::save(file, indent);
+}
+
+void CNamedItem::load(SimpleFile *file) {
+	int val = file->readNumber();
+	if (!val)
+		_name = file->readString();
+
+	CTreeItem::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/named_item.h b/engines/titanic/core/named_item.h
new file mode 100644
index 0000000..75635fc
--- /dev/null
+++ b/engines/titanic/core/named_item.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NAMED_ITEM_H
+#define TITANIC_NAMED_ITEM_H
+
+#include "titanic/core/tree_item.h"
+
+namespace Titanic {
+
+class CNamedItem: public CTreeItem {
+public:
+	CString _name;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNamedItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NAMED_ITEM_H */
diff --git a/engines/titanic/core/node_item.cpp b/engines/titanic/core/node_item.cpp
new file mode 100644
index 0000000..f44be6d
--- /dev/null
+++ b/engines/titanic/core/node_item.cpp
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/node_item.h"
+
+namespace Titanic {
+
+CNodeItem::CNodeItem() : CNamedItem(), _field24(0), _field28(0), _field2C(0) {
+}
+
+void CNodeItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	file->writeQuotedLine("N", indent);
+	file->writeNumberLine(_field24, indent + 1);
+	file->writeNumberLine(_field28, indent + 1);
+
+	file->writeQuotedLine("N", indent);
+	file->writeNumberLine(_field2C, indent + 1);
+
+	CNamedItem::save(file, indent);
+}
+
+void CNodeItem::load(SimpleFile *file) {
+	file->readNumber();
+	file->readBuffer();
+	_field24 = file->readNumber();
+	_field28 = file->readNumber();
+
+	file->readBuffer();
+	_field2C = file->readNumber();
+
+	CNamedItem::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/node_item.h b/engines/titanic/core/node_item.h
new file mode 100644
index 0000000..e05c2eb
--- /dev/null
+++ b/engines/titanic/core/node_item.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NODE_ITEM_H
+#define TITANIC_NODE_ITEM_H
+
+#include "titanic/core/named_item.h"
+
+namespace Titanic {
+
+class CNodeItem : public CNamedItem {
+private:
+	int _field24;
+	int _field28;
+	int _field2C;
+public:
+	CNodeItem();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNodeItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);	
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FILE_ITEM_H */
diff --git a/engines/titanic/core/pet_control.cpp b/engines/titanic/core/pet_control.cpp
new file mode 100644
index 0000000..eee1826
--- /dev/null
+++ b/engines/titanic/core/pet_control.cpp
@@ -0,0 +1,31 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/pet_control.h"
+
+namespace Titanic {
+
+void CPetControl::gameLoaded() {
+	// TODO
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/pet_control.h b/engines/titanic/core/pet_control.h
new file mode 100644
index 0000000..b1dc461
--- /dev/null
+++ b/engines/titanic/core/pet_control.h
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_H
+#define TITANIC_PET_CONTROL_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPetControl : public CGameObject {
+public:
+	/**
+	 * Called after loading a game has finished
+	 */
+	void gameLoaded();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_H */
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
new file mode 100644
index 0000000..7a8a082
--- /dev/null
+++ b/engines/titanic/core/project_item.cpp
@@ -0,0 +1,294 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/savefile.h"
+#include "titanic/game_manager.h"
+#include "titanic/titanic.h"
+#include "titanic/compressed_file.h"
+#include "titanic/core/dont_save_file_item.h"
+#include "titanic/core/pet_control.h"
+#include "titanic/core/project_item.h"
+
+namespace Titanic {
+
+void CFileListItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	file->writeQuotedLine(_name, indent);
+
+	ListItem::save(file, indent);
+}
+
+void CFileListItem::load(SimpleFile *file) {
+	file->readNumber();
+	_name = file->readString();
+
+	ListItem::load(file);
+}
+
+/*------------------------------------------------------------------------*/
+
+CProjectItem::CProjectItem() : _nextRoomNumber(0), _nextMessageNumber(0),
+		_nextObjectNumber(0), _gameManager(nullptr) {
+}
+
+void CProjectItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(6, indent);
+	file->writeQuotedLine("Next Avail. Object Number", indent);
+	file->writeNumberLine(_nextObjectNumber, indent);
+	file->writeQuotedLine("Next Avail. Message Number", indent);
+	file->writeNumberLine(_nextMessageNumber, indent);
+	file->writeQuotedLine("Next Avail. Room Number", indent);
+	file->writeNumberLine(_nextRoomNumber, indent);
+
+	CTreeItem::save(file, indent);
+}
+
+void CProjectItem::buildFilesList() {
+	_files.destroyContents();
+
+	CTreeItem *treeItem = getFirstChild();
+	while (treeItem) {
+		if (treeItem->isFileItem()) {
+			CString name = static_cast<CFileItem *>(treeItem)->getFilename();
+			_files.add()->_name = name;
+		}
+
+		treeItem = getNextSibling();
+	}
+}
+
+void CProjectItem::load(SimpleFile *file) {
+	int val = file->readNumber();
+	_files.destroyContents();
+	int count;
+
+	switch (val) {
+	case 1:
+		file->readBuffer();
+		_nextRoomNumber = file->readNumber();
+		// Deliberate fall-through
+
+	case 0:
+		// Load the list of files
+		count = file->readNumber();
+		for (int idx = 0; idx < count; ++idx) {
+			CString name = file->readString();
+			_files.add()->_name = name;
+		}
+		break;
+
+	case 6:
+		file->readBuffer();
+		_nextObjectNumber = file->readNumber();
+		// Deliberate fall-through
+
+	case 5:
+		file->readBuffer();
+		_nextMessageNumber = file->readNumber();
+		// Deliberate fall-through
+
+	case 4:
+		file->readBuffer();
+		// Deliberate fall-through
+
+	case 2:
+	case 3:
+		_files.load(file);
+		file->readBuffer();
+		_nextRoomNumber = file->readNumber();
+		break;
+
+	default:
+		break;
+	}
+
+	CTreeItem::load(file);
+}
+
+CGameManager *CProjectItem::getGameManager() {
+	return _gameManager;
+}
+
+void CProjectItem::resetGameManager() {
+	_gameManager = nullptr;
+}
+
+void CProjectItem::loadGame(int slotId) {
+	CompressedFile file;
+	Common::InSaveFile *saveFile = nullptr;
+
+	// Clear any existing project contents
+	clear();
+
+	// Open either an existing savegame slot or the new game template
+	if (slotId >= 0) {
+		saveFile = g_system->getSavefileManager()->openForLoading(
+			Common::String::format("slot%d.gam", slotId));
+		file.open(saveFile);
+	} else {
+		file.open("newgame.st");
+	}
+
+	// Load the contents in
+	CProjectItem *newProject = loadData(&file);
+	file.IsClassStart();
+	getGameManager()->load(&file);
+
+	file.close();
+
+	// Clear existing project
+	clear();
+
+	// Detach each item under the loaded project, and re-attach them
+	// to the existing project instance (this)
+	CTreeItem *item;
+	while ((item = newProject->getFirstChild()) != nullptr) {
+		item->detach();
+		item->addUnder(this);
+	}
+	// Loaded project instance is no longer needed
+	newProject->destroyAll();
+
+	// Post-load processing
+	gameLoaded();
+}
+
+void CProjectItem::saveGame(int slotId) {
+	CompressedFile file;
+	Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(
+		Common::String::format("slot%d.gam", slotId));
+	file.open(saveFile);
+
+	// Save the contents out
+	saveData(&file, this);
+
+	file.close();
+}
+
+void CProjectItem::clear() {
+	CTreeItem *item;
+	while ((item = getFirstChild()) != nullptr)
+		item->destroyAll();
+}
+
+CProjectItem *CProjectItem::loadData(SimpleFile *file) {
+	if (!file->IsClassStart())
+		return nullptr;
+
+	CProjectItem *root = nullptr;
+	CTreeItem *parent = nullptr;
+	CTreeItem *item = nullptr;
+
+	do {
+		CString entryString = file->readString();
+
+		if (entryString == "ALONG") {
+			// Move along, nothing needed
+		} else if (entryString == "UP") {
+			// Move up
+			if (parent == nullptr ||
+				(parent = parent->getParent()) == nullptr)
+				break;
+		} else if (entryString == "DOWN") {
+			// Move down
+			if (parent == nullptr)
+				parent = item;
+			else
+				parent = parent->getLastChild();
+		} else {
+			// Create new class instance
+			item = dynamic_cast<CTreeItem *>(CSaveableObject::createInstance(entryString));
+			assert(item);
+
+			if (root) {
+				// Already created root project
+				item->addUnder(parent);
+			} else {
+				root = dynamic_cast<CProjectItem *>(item);
+				assert(root);
+				root->_filename = _filename;
+			}
+
+			// Load the data for the item
+			item->load(file);
+		}
+
+		file->IsClassStart();
+	} while (file->IsClassStart());
+
+	return root;
+}
+
+void CProjectItem::saveData(SimpleFile *file, CTreeItem *item) const {
+	while (item) {
+		item->saveHeader(file, 0);
+		item->save(file, 1);
+		item->saveFooter(file, 0);
+
+	
+		CTreeItem *child = item->getFirstChild();
+		if (child) {
+			file->write("\n{\n", 3);
+			file->writeQuotedString("DOWN");
+			file->write("\n}\n", 3);
+			saveData(file, child);
+			file->write("\n{\n", 3);
+			file->writeQuotedString("UP");
+		} else {
+			file->write("\n{\n", 3);
+			file->writeQuotedString("ALONG");
+		}
+		
+		file->write("\n}\n", 3);
+		item = item->getNextSibling();
+	}
+}
+
+void CProjectItem::gameLoaded() {
+	CGameManager *gameManager = getGameManager();
+	if (gameManager)
+		gameManager->gameLoaded();
+
+	CPetControl *petControl = getPetControl();
+	if (petControl)
+		petControl->gameLoaded();
+}
+
+CPetControl *CProjectItem::getPetControl() {
+	CDontSaveFileItem *fileItem = getDontSaveFileItem();
+	CTreeItem *treeItem;
+
+	if (!fileItem || (treeItem = fileItem->getLastChild()) == nullptr)
+		return nullptr;
+
+	while (treeItem) {
+		CPetControl *petControl = dynamic_cast<CPetControl *>(treeItem);
+		if (petControl)
+			return petControl;
+
+		treeItem = treeItem->getPriorSibling();
+	}
+
+	return nullptr;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
new file mode 100644
index 0000000..3c33498
--- /dev/null
+++ b/engines/titanic/core/project_item.h
@@ -0,0 +1,150 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PROJECT_ITEM_H
+#define TITANIC_PROJECT_ITEM_H
+
+#include "common/scummsys.h"
+#include "titanic/simple_file.h"
+#include "titanic/core/file_item.h"
+#include "titanic/core/list.h"
+
+namespace Titanic {
+
+class CGameManager;
+class CPetControl;
+
+/**
+ * File list item
+ */
+class CFileListItem : public ListItem {
+public:
+	CString _name;
+
+	virtual const char *getClassName() const { return "CFileListItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);	
+	
+};
+
+/**
+ * Filename list
+ */
+class CFileList: public List<CFileListItem> {
+public:
+	virtual const char *getClassName() const { return "CFileList"; }
+};
+
+
+class CProjectItem : public CFileItem {
+private:
+	CString _filename;
+	CFileList _files;
+	int _nextRoomNumber;
+	int _nextMessageNumber;
+	int _nextObjectNumber;
+	CGameManager *_gameManager;
+
+	/**
+	 * Called during save, iterates through the children to do some stuff
+	 */
+	void buildFilesList();
+private:
+	/**
+	 * Load project data from the passed file
+	 */
+	CProjectItem *loadData(SimpleFile *file);
+
+	/**
+	 * Save project data to the passed file
+	 */
+	void saveData(SimpleFile *file, CTreeItem *item) const;
+
+	/**
+	 * Does post-loading processing
+	 */
+	void gameLoaded();
+public:
+	CProjectItem();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CProjectItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);	
+
+	/**
+	 * Get the game manager for the project
+	 */
+	virtual CGameManager *getGameManager();
+
+	/**
+	 * Get a reference to the PET control
+	 */
+	CPetControl *getPetControl();
+
+	/**
+	 * Resets the game manager field
+	 */
+	void resetGameManager();
+
+	/**
+	 * Load the entire project data for a given slot Id
+	 */
+	void loadGame(int slotId);
+
+	/**
+	 * Save the entire project data to a given savegame slot
+	 */
+	void saveGame(int slotId);
+
+	/**
+	 * Clear any currently loaded project
+	 */
+	void clear();
+
+	/**
+	 * Set the proejct's name
+	 */
+	void setFilename(const CString &name) { _filename = name; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PROJECT_ITEM_H */
diff --git a/engines/titanic/core/resource_key.cpp b/engines/titanic/core/resource_key.cpp
new file mode 100644
index 0000000..eee749f
--- /dev/null
+++ b/engines/titanic/core/resource_key.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/simple_file.h"
+#include "titanic/core/resource_key.h"
+
+namespace Titanic {
+
+void CResourceKey::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine("Resource Key...", indent);
+	file->writeQuotedLine(_key, indent);
+
+	CSaveableObject::save(file, indent);
+}
+
+void CResourceKey::load(SimpleFile *file) {
+	int val = file->readNumber();
+	
+	if (val == 1) {
+		file->readBuffer();
+		_value = file->readString();
+	}
+
+	CSaveableObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/resource_key.h b/engines/titanic/core/resource_key.h
new file mode 100644
index 0000000..1b3d900
--- /dev/null
+++ b/engines/titanic/core/resource_key.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RESOURCE_KEY_H
+#define TITANIC_RESOURCE_KEY_H
+
+#include "titanic/string.h"
+#include "titanic/core/saveable_object.h"
+
+namespace Titanic {
+
+class CResourceKey: public CSaveableObject {
+private:
+	CString _key;
+	CString _value;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CResourceKey"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+
+	const CString &getString() const { return _key; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RESOURCE_KEY_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
new file mode 100644
index 0000000..c7e749e
--- /dev/null
+++ b/engines/titanic/core/saveable_object.cpp
@@ -0,0 +1,107 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/saveable_object.h"
+#include "titanic/core/file_item.h"
+#include "titanic/core/link_item.h"
+#include "titanic/core/list.h"
+#include "titanic/core/message_target.h"
+#include "titanic/core/movie_clip.h"
+#include "titanic/core/node_item.h"
+#include "titanic/core/project_item.h"
+#include "titanic/core/saveable_object.h"
+#include "titanic/core/tree_item.h"
+#include "titanic/core/view_item.h"
+#include "titanic/game/announce.h"
+#include "titanic/game/pet_position.h"
+#include "titanic/game/room_item.h"
+#include "titanic/game/service_elevator_door.h"
+#include "titanic/game/sub_glass.h"
+
+namespace Titanic {
+
+Common::HashMap<Common::String, CSaveableObject::CreateFunction> * 
+	CSaveableObject::_classList = nullptr;
+
+#define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
+#define ADDFN(T) (*_classList)[#T] = Function##T
+
+DEFFN(CAnnounce);
+DEFFN(CFileItem);
+DEFFN(CFileListItem);
+DEFFN(CLinkItem);
+DEFFN(CMessageTarget);
+DEFFN(CMovieClip);
+DEFFN(CMovieClipList);
+DEFFN(CNodeItem);
+DEFFN(CPETPosition);
+DEFFN(CProjectItem);
+DEFFN(CRoomItem);
+DEFFN(CServiceElevatorDoor);
+DEFFN(CSUBGlass);
+DEFFN(CTreeItem);
+DEFFN(CViewItem);
+
+void CSaveableObject::initClassList() {
+	_classList = new Common::HashMap<Common::String, CreateFunction>();
+	ADDFN(CAnnounce);
+	ADDFN(CFileItem);
+	ADDFN(CFileListItem);
+	ADDFN(CLinkItem);
+	ADDFN(CMessageTarget);
+	ADDFN(CMovieClip);
+	ADDFN(CMovieClipList);
+	ADDFN(CNodeItem);
+	ADDFN(CPETPosition);
+	ADDFN(CProjectItem);
+	ADDFN(CRoomItem);
+	ADDFN(CServiceElevatorDoor);
+	ADDFN(CSUBGlass);
+	ADDFN(CTreeItem);
+	ADDFN(CViewItem);
+}
+
+void CSaveableObject::freeClassList() {
+	delete _classList;
+}
+
+CSaveableObject *CSaveableObject::createInstance(const Common::String &name) {
+	return (*_classList)[name]();
+}
+
+void CSaveableObject::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+}
+
+void CSaveableObject::load(SimpleFile *file) {
+	file->readNumber();
+}
+
+void CSaveableObject::saveHeader(SimpleFile *file, int indent) const {
+	file->writeClassStart(getClassName(), indent);
+}
+
+void CSaveableObject::saveFooter(SimpleFile *file, int indent) const {
+	file->writeClassEnd(indent);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/saveable_object.h b/engines/titanic/core/saveable_object.h
new file mode 100644
index 0000000..4e7d949
--- /dev/null
+++ b/engines/titanic/core/saveable_object.h
@@ -0,0 +1,83 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SAVEABLE_OBJECT_H
+#define TITANIC_SAVEABLE_OBJECT_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "common/hash-str.h"
+#include "titanic/simple_file.h"
+
+namespace Titanic {
+
+class CSaveableObject {
+	typedef CSaveableObject *(*CreateFunction)();
+private:
+	static Common::HashMap<Common::String, CreateFunction> *_classList;
+public:
+	/**
+	 * Sets up the list of saveable object classes
+	 */
+	static void initClassList();
+
+	/**
+	 * Free the list of saveable object classes
+	 */
+	static void freeClassList();
+
+	/**
+	 * Creates a new instance of a saveable object class
+	 */
+	static CSaveableObject *createInstance(const Common::String &name);
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSaveableObject"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+	
+	/**
+	 * Write out a header definition for the class to file
+	 * prior to saving the actual data for the class
+	 */
+	virtual void saveHeader(SimpleFile *file, int indent) const;
+	
+	/**
+	 * Writes out a footer for the class after it's data has
+	 * been written to file
+	 */
+	virtual void saveFooter(SimpleFile *file, int indent) const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SAVEABLE_OBJECT_H */
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
new file mode 100644
index 0000000..d20e1da
--- /dev/null
+++ b/engines/titanic/core/tree_item.cpp
@@ -0,0 +1,151 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/tree_item.h"
+#include "titanic/core/dont_save_file_item.h"
+#include "titanic/core/file_item.h"
+
+namespace Titanic {
+
+CTreeItem::CTreeItem() : _parent(nullptr), _firstChild(nullptr),
+	_nextSibling(nullptr), _priorSibling(nullptr), _field14(0) {
+}
+
+void CTreeItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	CMessageTarget::save(file, indent);
+}
+
+void CTreeItem::load(SimpleFile *file) {
+	file->readNumber();
+	CMessageTarget::load(file);
+}
+
+CGameManager *CTreeItem::getGameManager() {
+	return _parent ? _parent->getGameManager() : nullptr;
+}
+
+CTreeItem *CTreeItem::getRoot() const {
+	CTreeItem *parent = getParent();
+
+	if (parent) {
+		do {
+			parent = parent->getParent();
+		} while (parent->getParent());
+	}
+
+	return parent;
+}
+
+CTreeItem *CTreeItem::getLastSibling() {
+	CTreeItem *item = this;
+	while (item->getNextSibling())
+		item = item->getNextSibling();
+
+	return item;
+}
+
+CTreeItem *CTreeItem::getLastChild() {
+	if (!_firstChild)
+		return nullptr;
+	return _firstChild->getLastSibling();
+}
+
+CDontSaveFileItem *CTreeItem::getDontSaveFileItem() {
+	CTreeItem *item = getFirstChild();
+	while (item) {
+		CDontSaveFileItem *fileItem = dynamic_cast<CDontSaveFileItem *>(item);
+		if (fileItem)
+			return fileItem;
+
+		item = item->getNextSibling();
+	}
+}
+
+void CTreeItem::addUnder(CTreeItem *newParent) {
+	if (newParent->_firstChild)
+		addSibling(newParent->getLastSibling());
+	else
+		setParent(newParent);
+}
+
+void CTreeItem::setParent(CTreeItem *newParent) {
+	_parent = newParent;
+	_priorSibling = nullptr;
+	_nextSibling = newParent->_firstChild;
+
+	if (newParent->_firstChild)
+		newParent->_firstChild->_priorSibling = this;
+	newParent->_firstChild = this;
+}
+
+void CTreeItem::addSibling(CTreeItem *item) {
+	_priorSibling = item->_nextSibling;
+	_nextSibling = item->_nextSibling;
+	_parent = item->_parent;
+
+	if (item->_nextSibling)
+		item->_nextSibling->_priorSibling = this;
+	item->_nextSibling = this;
+}
+
+void CTreeItem::destroyAll() {
+	destroyOthers();
+	detach();
+	delete this;
+}
+
+int CTreeItem::destroyOthers() {
+	if (!_firstChild)
+		return 0;
+
+	CTreeItem *item = this, *child, *nextSibling;
+	int total = 0;
+
+	do {
+		child = item->_firstChild;
+		nextSibling = item->_nextSibling;
+
+		if (child)
+			total += child->destroyOthers();
+		child->detach();
+		delete child;
+		++total;
+	} while ((item = nextSibling) != nullptr);
+
+	return total;
+}
+
+void CTreeItem::detach() {
+	// Delink this item from any prior and/or next siblings
+	if (_priorSibling)
+		_priorSibling->_nextSibling = _nextSibling;
+	if (_nextSibling)
+		_nextSibling->_priorSibling = _priorSibling;
+
+	if (_parent && _parent->_firstChild == this)
+		_parent->_firstChild = _nextSibling;
+
+	_priorSibling = _nextSibling = _parent = nullptr;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
new file mode 100644
index 0000000..ea5de32
--- /dev/null
+++ b/engines/titanic/core/tree_item.h
@@ -0,0 +1,141 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TREE_ITEM_H
+#define TITANIC_TREE_ITEM_H
+
+#include "titanic/core/message_target.h"
+
+namespace Titanic {
+
+class CGameManager;
+class CDontSaveFileItem;
+
+class CTreeItem: public CMessageTarget {
+private:
+	CTreeItem *_parent;
+	CTreeItem *_nextSibling;
+	CTreeItem *_priorSibling;
+	CTreeItem *_firstChild;
+	int _field14;
+public:
+	CTreeItem();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTreeItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+
+	/**
+	 * Get the game manager for the project
+	 */
+	virtual CGameManager *getGameManager();
+
+	/**
+	 * Returns true if the item is a file item
+	 */
+	virtual bool isFileItem() const { return false; }
+
+	/**
+	 * Get the parent for the given item
+	 */
+	CTreeItem *getParent() const { return _parent; }
+
+	/**
+	 * Jumps up through the parents to find the sub-root item
+	 */
+	CTreeItem *getRoot() const;
+
+	/**
+	 * Get the next sibling
+	 */
+	CTreeItem *getNextSibling() { return _nextSibling; }
+
+	/**
+	 * Get the prior sibling
+	 */
+	CTreeItem *getPriorSibling() { return _priorSibling; }
+
+	/**
+	 * Get the last sibling of this sibling
+	 */
+	CTreeItem *getLastSibling();
+
+	/**
+	 * Get the first child of the item, if any
+	 */
+	CTreeItem *getFirstChild() { return _firstChild; }
+
+	/**
+	 * Get the last child of the item, if any
+	 */
+	CTreeItem *getLastChild();
+
+	/**
+	 * Get any dont save file item in the immediate children
+	 */
+	CDontSaveFileItem *getDontSaveFileItem();
+
+	/**
+	 * Adds the item under another tree item
+	 */
+	void addUnder(CTreeItem *newParent);
+
+	/**
+	 * Sets the parent for the item
+	 */
+	void setParent(CTreeItem *newParent);
+
+	/**
+	 * Adds the item as a sibling of another item
+	 */
+	void addSibling(CTreeItem *item);
+
+	/**
+	 * Destroys both the item as well as any of it's children
+	 */
+	void destroyAll();
+
+	/**
+	 * Destroys all tree items around the given one
+	 */
+	int destroyOthers();
+
+	/**
+	 * Detach the tree item from any other associated tree items
+	 */
+	void detach();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TREE_ITEM_H */
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
new file mode 100644
index 0000000..e64229e
--- /dev/null
+++ b/engines/titanic/core/view_item.cpp
@@ -0,0 +1,70 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/view_item.h"
+
+namespace Titanic {
+
+CViewItem::CViewItem() : CNamedItem() {
+	_field24 = 0;
+	_field28 = 0.0;
+	_field30 = 0;
+	_field50 = 0;
+	_field54 = 0;
+	setData(0.0);
+}
+
+void CViewItem::setData(double v) {
+	_field28 = v;
+	_field50 = cos(_field28) * 30.0;
+	_field54 = sin(_field28) * -30.0;
+}
+
+void CViewItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	_resourceKey.save(file, indent);
+	file->writeQuotedLine("V", indent);
+	file->writeFloatLine(_field28, indent + 1);
+	file->writeNumberLine(_field30, indent + 1);
+
+	CNamedItem::save(file, indent);
+}
+
+void CViewItem::load(SimpleFile *file) {
+	int val = file->readNumber();
+	
+	switch (val) {
+	case 1:
+		_resourceKey.load(file);
+		// Deliberate fall-through
+
+	default:
+		file->readBuffer();
+		setData(file->readFloat());
+		_field30 = file->readNumber();
+		break;
+	}
+
+	CNamedItem::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
new file mode 100644
index 0000000..592bb21
--- /dev/null
+++ b/engines/titanic/core/view_item.h
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_VIEW_ITEM_H
+#define TITANIC_VIEW_ITEM_H
+
+#include "titanic/core/named_item.h"
+#include "titanic/core/resource_key.h"
+
+namespace Titanic {
+
+class CViewItem : public CNamedItem {
+private:
+	void setData(double v);
+protected:
+	int _field24;
+	double _field28;
+	int _field30;
+	CResourceKey _resourceKey;
+	int _field50;
+	int _field54;
+public:
+	CViewItem();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNamedItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NAMED_ITEM_H */
diff --git a/engines/titanic/game/announce.cpp b/engines/titanic/game/announce.cpp
new file mode 100644
index 0000000..098ae70
--- /dev/null
+++ b/engines/titanic/game/announce.cpp
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/announce.h"
+
+namespace Titanic {
+
+CAnnounce::CAnnounce() : _fieldBC(0), _fieldC0(0), _fieldC4(1), _fieldC8(0) {
+}
+
+void CAnnounce::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CAnnounce::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/announce.h b/engines/titanic/game/announce.h
new file mode 100644
index 0000000..baa5f1a
--- /dev/null
+++ b/engines/titanic/game/announce.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ANNOUNCE_H
+#define TITANIC_ANNOUNCE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CAnnounce : public CGameObject {
+private:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+public:
+	CAnnounce();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAnnounce"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ROOM_ITEM_H */
diff --git a/engines/titanic/game/door_auto_sound_event.cpp b/engines/titanic/game/door_auto_sound_event.cpp
new file mode 100644
index 0000000..158c147
--- /dev/null
+++ b/engines/titanic/game/door_auto_sound_event.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/door_auto_sound_event.h"
+
+namespace Titanic {
+
+CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(),
+		_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
+}
+
+void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldDC, indent);
+	file->writeNumberLine(_fieldE0, indent);
+
+	CAutoSoundEvent::save(file, indent);
+}
+
+void CDoorAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_fieldDC = file->readNumber();
+	_fieldE0 = file->readNumber();
+
+	CAutoSoundEvent::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/door_auto_sound_event.h b/engines/titanic/game/door_auto_sound_event.h
new file mode 100644
index 0000000..66e9594
--- /dev/null
+++ b/engines/titanic/game/door_auto_sound_event.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DOOR_AUTO_SOUND_EVENT_H
+#define TITANIC_DOOR_AUTO_SOUND_EVENT_H
+
+#include "titanic/core/auto_sound_event.h"
+
+namespace Titanic {
+
+class CDoorAutoSoundEvent : public CAutoSoundEvent {
+protected:
+	CString _string1;
+	CString _string2;
+	int _fieldDC;
+	int _fieldE0;
+public:
+	CDoorAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DOOR_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/game/pet_position.cpp b/engines/titanic/game/pet_position.cpp
new file mode 100644
index 0000000..eb3156d
--- /dev/null
+++ b/engines/titanic/game/pet_position.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet_position.h"
+
+namespace Titanic {
+
+void CPETPosition::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPETPosition::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet_position.h b/engines/titanic/game/pet_position.h
new file mode 100644
index 0000000..7ca6725
--- /dev/null
+++ b/engines/titanic/game/pet_position.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_POSITION_H
+#define TITANIC_PET_POSITION_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPETPosition : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPETPosition"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ROOM_ITEM_H */
diff --git a/engines/titanic/game/room_item.cpp b/engines/titanic/game/room_item.cpp
new file mode 100644
index 0000000..17e0ffc
--- /dev/null
+++ b/engines/titanic/game/room_item.cpp
@@ -0,0 +1,106 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/room_item.h"
+
+namespace Titanic {
+
+CRoomItem::CRoomItem() : CNamedItem(), _roomNumber(0),
+		_roomDimensionX(0.0), _roomDimensionY(0.0) {
+}
+
+void CRoomItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(3, indent);
+	file->writeQuotedLine("Exit Movies", indent);
+	_exitMovieKey.save(file, indent);
+
+	file->writeNumberLine(_roomDimensionX * 1000.0, indent + 1);
+	file->writeNumberLine(_roomDimensionY * 1000.0, indent + 1);
+
+	file->writeQuotedLine("Transition Movie", indent);
+	_transitionMovieKey.save(file, indent);
+
+	file->writeQuotedLine("Movie Clip list", indent);
+	_clipList.save(file, indent + 1);
+
+	file->writeQuotedLine("Room Rect", indent);
+	file->writeNumberLine(_roomRect.left, indent + 1);
+	file->writeNumberLine(_roomRect.top, indent + 1);
+	file->writeNumberLine(_roomRect.right, indent + 1);
+	file->writeNumberLine(_roomRect.bottom, indent + 1);
+
+	file->writeQuotedLine("Room Number", indent);
+	file->writeNumberLine(_roomNumber, indent);
+
+	CNamedItem::save(file, indent);
+}
+
+void CRoomItem::load(SimpleFile *file) {
+	int val = file->readNumber();
+	
+	switch (val) {
+	case 3:
+		// Read exit movie
+		file->readBuffer();
+		_exitMovieKey.load(file);
+		// Deliberate fall-through
+
+	case 2:
+		// Read room dimensions
+		file->readBuffer();
+		_roomDimensionX = (double)file->readNumber() / 1000.0;
+		_roomDimensionY = (double)file->readNumber() / 1000.0;
+		// Deliberate fall-through
+
+	case 1:
+		// Read transition movie key and clip list
+		file->readBuffer();
+		_transitionMovieKey.load(file);
+
+		file->readBuffer();
+		_clipList.load(file);
+		loading();
+		// Deliberate fall-through
+
+	case 0:
+		// Read room rect
+		file->readBuffer();
+		_roomRect.left = file->readNumber();
+		_roomRect.top = file->readNumber();
+		_roomRect.right = file->readNumber();
+		_roomRect.bottom = file->readNumber();
+		file->readBuffer();
+		_roomNumber = file->readNumber();
+		break;
+
+	default:
+		break;
+	}
+
+	CNamedItem::load(file);
+}
+
+void CRoomItem::loading() {
+	// TODO
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/room_item.h b/engines/titanic/game/room_item.h
new file mode 100644
index 0000000..c213d38
--- /dev/null
+++ b/engines/titanic/game/room_item.h
@@ -0,0 +1,65 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ROOM_ITEM_H
+#define TITANIC_ROOM_ITEM_H
+
+#include "common/rect.h"
+#include "titanic/core/list.h"
+#include "titanic/core/movie_clip.h"
+#include "titanic/core/named_item.h"
+#include "titanic/core/resource_key.h"
+
+namespace Titanic {
+
+class CRoomItem : public CNamedItem {
+private:
+	Common::Rect _roomRect;
+	CMovieClipList _clipList;
+	int _roomNumber;
+	CResourceKey _transitionMovieKey;
+	CResourceKey _exitMovieKey;
+	double _roomDimensionX, _roomDimensionY;
+
+	void loading();
+public:
+	CRoomItem();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CRoomItem"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ROOM_ITEM_H */
diff --git a/engines/titanic/game/service_elevator_door.cpp b/engines/titanic/game/service_elevator_door.cpp
new file mode 100644
index 0000000..717b61d
--- /dev/null
+++ b/engines/titanic/game/service_elevator_door.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/service_elevator_door.h"
+
+namespace Titanic {
+
+CServiceElevatorDoor::CServiceElevatorDoor() : CDoorAutoSoundEvent() {
+	_string1 = "z#31.wav";
+	_string2 = "z#32.wav";
+}
+
+void CServiceElevatorDoor::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string1, indent);
+
+	CDoorAutoSoundEvent::save(file, indent);
+}
+
+void CServiceElevatorDoor::load(SimpleFile *file) {
+	file->readNumber();
+	_string2 = file->readString();
+	_string1 = file->readString();
+
+	CDoorAutoSoundEvent::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/service_elevator_door.h b/engines/titanic/game/service_elevator_door.h
new file mode 100644
index 0000000..3ad897c
--- /dev/null
+++ b/engines/titanic/game/service_elevator_door.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SERVICE_ELEVATOR_DOOR_H
+#define TITANIC_SERVICE_ELEVATOR_DOOR_H
+
+#include "titanic/game/door_auto_sound_event.h"
+
+namespace Titanic {
+
+class CServiceElevatorDoor : public CDoorAutoSoundEvent {
+public:
+	CServiceElevatorDoor();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CServiceElevatorDoor"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SERVICE_ELEVATOR_DOOR_H */
diff --git a/engines/titanic/game/sub_glass.cpp b/engines/titanic/game/sub_glass.cpp
new file mode 100644
index 0000000..b16199d
--- /dev/null
+++ b/engines/titanic/game/sub_glass.cpp
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sub_glass.h"
+
+namespace Titanic {
+
+CSUBGlass::CSUBGlass() : _fieldBC(0), _fieldC0(0), _fieldC4(1), _fieldC8(0) {
+}
+
+void CSUBGlass::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeQuotedLine(_string, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CSUBGlass::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+	_string = file->readString();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sub_glass.h b/engines/titanic/game/sub_glass.h
new file mode 100644
index 0000000..00ff26f
--- /dev/null
+++ b/engines/titanic/game/sub_glass.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SUB_GLASS_H
+#define TITANIC_SUB_GLASS_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CSUBGlass : public CGameObject {
+private:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	int _fieldCC;
+	CString _string;
+public:
+	CSUBGlass();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSUBGlass"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ROOM_ITEM_H */
diff --git a/engines/titanic/game/succubus.cpp b/engines/titanic/game/succubus.cpp
new file mode 100644
index 0000000..27f47fd
--- /dev/null
+++ b/engines/titanic/game/succubus.cpp
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/rooms/sub_glass.h"
+
+namespace Titanic {
+
+CSUBGlass::CSUBGlass() : _fieldBC(0), _fieldC0(0), _fieldC4(1), _fieldC8(0) {
+}
+
+void CSUBGlass::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeQuotedLine(_string, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CSUBGlass::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+	_string = file->readString();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/succubus.h b/engines/titanic/game/succubus.h
new file mode 100644
index 0000000..f99597b
--- /dev/null
+++ b/engines/titanic/game/succubus.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SUCCUBUS_H
+#define TITANIC_SUCCUBUS_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CSuccUBus : public CGameObject {
+private:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	int _fieldCC;
+	CString _string;
+public:
+	CSuccUBus();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSuccUBus"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SUCCUBUS_H */
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index dc2fdfd..4796a4f 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -28,7 +28,7 @@
 #include "titanic/game_manager.h"
 #include "titanic/game_view.h"
 #include "titanic/image.h"
-#include "titanic/objects/project_item.h"
+#include "titanic/core/project_item.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index e74e811..97053a5 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -15,28 +15,28 @@ MODULE_OBJS := \
 	string.o \
 	titanic.o \
 	video_surface.o \
-	objects/auto_sound_event.o \
-	objects/dont_save_file_item.o \
-	objects/file_item.o \
-	objects/game_object.o \
-	objects/link_item.o \
-	objects/list.o \
-	objects/message_target.o \
-	objects/movie_clip.o \
-	objects/named_item.o \
-	objects/node_item.o \
-	objects/pet_control.o \
-	objects/project_item.o \
-	objects/resource_key.o \
-	objects/saveable_object.o \
-	objects/tree_item.o \
-	objects/view_item.o \
-	rooms/announce.o \
-	rooms/door_auto_sound_event.o \
-	rooms/pet_position.o \
-	rooms/room_item.o \
-	rooms/service_elevator_door.o \
-	rooms/sub_glass.o
+	core/auto_sound_event.o \
+	core/dont_save_file_item.o \
+	core/file_item.o \
+	core/game_object.o \
+	core/link_item.o \
+	core/list.o \
+	core/message_target.o \
+	core/movie_clip.o \
+	core/named_item.o \
+	core/node_item.o \
+	core/pet_control.o \
+	core/project_item.o \
+	core/resource_key.o \
+	core/saveable_object.o \
+	core/tree_item.o \
+	core/view_item.o \
+	game/announce.o \
+	game/door_auto_sound_event.o \
+	game/pet_position.o \
+	game/room_item.o \
+	game/service_elevator_door.o \
+	game/sub_glass.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/objects/auto_sound_event.cpp b/engines/titanic/objects/auto_sound_event.cpp
deleted file mode 100644
index 7160ac7..0000000
--- a/engines/titanic/objects/auto_sound_event.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/auto_sound_event.h"
-
-namespace Titanic {
-
-CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
-}
-
-void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/auto_sound_event.h b/engines/titanic/objects/auto_sound_event.h
deleted file mode 100644
index bcfc6a4..0000000
--- a/engines/titanic/objects/auto_sound_event.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_AUTO_SOUND_EVENT_H
-#define TITANIC_AUTO_SOUND_EVENT_H
-
-#include "titanic/objects/game_object.h"
-
-namespace Titanic {
-
-class CAutoSoundEvent : public CGameObject {
-private:
-	int _fieldBC;
-	int _fieldC0;
-public:
-	CAutoSoundEvent();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/objects/dont_save_file_item.cpp b/engines/titanic/objects/dont_save_file_item.cpp
deleted file mode 100644
index bca66da..0000000
--- a/engines/titanic/objects/dont_save_file_item.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/dont_save_file_item.h"
-
-namespace Titanic {
-
-void CDontSaveFileItem::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(0, indent);
-}
-
-void CDontSaveFileItem::load(SimpleFile *file) {
-	file->readNumber();
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/dont_save_file_item.h b/engines/titanic/objects/dont_save_file_item.h
deleted file mode 100644
index 99deacc..0000000
--- a/engines/titanic/objects/dont_save_file_item.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_DONT_SAVE_FILE_ITEM_H
-#define TITANIC_DONT_SAVE_FILE_ITEM_H
-
-#include "titanic/objects/file_item.h"
-
-namespace Titanic {
-
-class CDontSaveFileItem : public CFileItem {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDontSaveFileItem"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_DONT_SAVE_FILE_ITEM_H */
diff --git a/engines/titanic/objects/file_item.cpp b/engines/titanic/objects/file_item.cpp
deleted file mode 100644
index 925fc4d..0000000
--- a/engines/titanic/objects/file_item.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/file_item.h"
-
-namespace Titanic {
-
-void CFileItem::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(0, indent);
-	CTreeItem::save(file, indent);
-}
-
-void CFileItem::load(SimpleFile *file) {
-	file->readNumber();
-
-	CTreeItem::load(file);
-}
-
-CString CFileItem::formFilename() const {
-	return "";
-}
-
-CString CFileItem::getFilename() const {
-	//dynamic_cast<CFileItem *>(getRoot())->formDataPath();
-	return _filename;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/file_item.h b/engines/titanic/objects/file_item.h
deleted file mode 100644
index 94dd053..0000000
--- a/engines/titanic/objects/file_item.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_FILE_ITEM_H
-#define TITANIC_FILE_ITEM_H
-
-#include "titanic/string.h"
-#include "titanic/objects/list.h"
-#include "titanic/objects/tree_item.h"
-
-namespace Titanic {
-
-class CFileItem: public CTreeItem {
-private:
-	CString _filename;
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CFileItem"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);	
-
-	/**
-	 * Returns true if the item is a file item
-	 */
-	virtual bool isFileItem() const { return true; }
-
-	/**
-	 * Form a filename for the file item
-	 */
-	CString formFilename() const;
-
-	/**
-	 * Get a string?
-	 */
-	CString getFilename() const;
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_FILE_ITEM_H */
diff --git a/engines/titanic/objects/game_object.cpp b/engines/titanic/objects/game_object.cpp
deleted file mode 100644
index 2e35417..0000000
--- a/engines/titanic/objects/game_object.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/game_object.h"
-#include "titanic/objects/resource_key.h"
-
-namespace Titanic {
-
-CGameObject::CGameObject(): CNamedItem() {
-	_bounds = Common::Rect(0, 0, 15, 15);
-	_field34 = 0;
-	_field38 = 0;
-	_field3C = 0;
-	_field40 = 0;
-	_field44 = 0xF0;
-	_field48 = 0xF0;
-	_field4C = 0xFF;
-	_field50 = 0;
-	_field54 = 0;
-	_field58 = 0;
-	_field5C = 1;
-	_field60 = 0;
-	_field74 = 1;
-	_field78 = 0;
-	_field8C = -1;
-	_field90 = 0;
-	_field94 = 0;
-	_field98 = 0;
-	_field9C = 0;
-	_fieldA0 = 0;
-	_fieldA4 = 0;
-	_fieldA8 = nullptr;
-	_fieldB8 = 0;
-}
-
-void CGameObject::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(7, indent);
-	error("TODO: CGameObject::save");
-
-	CNamedItem::save(file, indent);
-}
-
-void CGameObject::load(SimpleFile *file) {
-	int val = file->readNumber();
-	CResourceKey resourceKey;
-
-	switch (val) {
-	case 7:
-		_clipList2.load(file);
-		_field8C = file->readNumber();
-		// Deliberate fall-through
-
-	case 6:
-		val = _field74 = file->readNumber();
-		// Deliberate fall-through
-
-	case 5:
-		_clipList1.load(file);
-		// Deliberate fall-through
-
-	case 4:
-		_field60 = file->readNumber();
-		// Deliberate fall-through
-
-	case 3:
-		_field40 = file->readNumber();
-		// Deliberate fall-through
-
-	case 2:
-		_string = file->readString();
-		// Deliberate fall-through
-
-	case 1:
-		_bounds = file->readRect();
-		_field34 = file->readFloat();
-		_field38 = file->readFloat();
-		_field3C = file->readFloat();
-		_field44 = file->readNumber();
-		_field48 = file->readNumber();
-		_field4C = file->readNumber();
-		_fieldB8 = file->readNumber();
-		_field5C = file->readNumber();
-		_field50 = file->readNumber();
-		_field54 = file->readNumber();
-		_field58 = file->readNumber();
-
-		resourceKey.load(file);		
-		_fieldA8 = nullptr;
-		val = file->readNumber();
-		if (val) {
-			_string = resourceKey.getString();
-		}
-		break;
-
-	default:
-		break;
-	}
-
-	CNamedItem::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/game_object.h b/engines/titanic/objects/game_object.h
deleted file mode 100644
index 53814f6..0000000
--- a/engines/titanic/objects/game_object.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_GAME_OBJECT_H
-#define TITANIC_GAME_OBJECT_H
-
-#include "common/rect.h"
-#include "titanic/objects/movie_clip.h"
-#include "titanic/objects/named_item.h"
-
-namespace Titanic {
-
-class CGameObject : public CNamedItem {
-protected:
-	Common::Rect _bounds;
-	double _field34;
-	double _field38;
-	double _field3C;
-	int _field40;
-	int _field44;
-	int _field48;
-	int _field4C;
-	int _field50;
-	int _field54;
-	int _field58;
-	int _field5C;
-	int _field60;
-	CMovieClipList _clipList1;
-	int _field74;
-	int _field78;
-	CMovieClipList _clipList2;
-	int _field8C;
-	int _field90;
-	int _field94;
-	int _field98;
-	int _field9C;
-	int _fieldA0;
-	int _fieldA4;
-	void *_fieldA8;
-	CString _string;
-	int _fieldB8;
-public:
-	CGameObject();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGameObject"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_H */
diff --git a/engines/titanic/objects/link_item.cpp b/engines/titanic/objects/link_item.cpp
deleted file mode 100644
index fe2a7cf..0000000
--- a/engines/titanic/objects/link_item.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/link_item.h"
-
-namespace Titanic {
-
-CLinkItemSub::CLinkItemSub() : _field0(0), _field4(0), _field8(0), _fieldC(0) {
-}
-
-CLinkItem::CLinkItem() : CNamedItem() {
-	_field24 = -1;
-	_field28 = -1;
-	_field2C = -1;
-	_field30 = 0;
-	_field34 = 1;
-	_name = "Link";
-}
-
-void CLinkItem::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(2, indent);
-	file->writeQuotedLine("L", indent);
-	file->writeNumberLine(_field34, indent + 1);
-	file->writeNumberLine(_field30, indent + 1);
-	file->writeNumberLine(_field24, indent + 1);
-	file->writeNumberLine(_field28, indent + 1);
-	file->writeNumberLine(_field2C, indent + 1);
-
-	file->writeQuotedLine("Hotspot", indent + 1);
-	file->writeNumberLine(_sub._field0, indent + 2);
-	file->writeNumberLine(_sub._field4, indent + 2);
-	file->writeNumberLine(_sub._field8, indent + 2);
-	file->writeNumberLine(_sub._fieldC, indent + 2);
-
-	CNamedItem::save(file, indent);
-}
-
-void CLinkItem::load(SimpleFile *file) {
-	int val = file->readNumber();
-	file->readBuffer();
-
-	switch (val) {
-	case 2:
-		_field34 = file->readNumber();
-		// Deliberate fall-through
-
-	case 1:
-		_field30 = file->readNumber();
-		// Deliberate fall-through
-
-	case 0:
-		_field24 = file->readNumber();
-		_field28 = file->readNumber();
-		_field2C = file->readNumber();
-
-		file->readBuffer();
-		_sub._field0 = file->readNumber();
-		_sub._field4 = file->readNumber();
-		_sub._field8 = file->readNumber();
-		_sub._fieldC = file->readNumber();
-		break;
-
-	default:
-		break;
-	}
-
-	CNamedItem::load(file);
-
-	if (val < 2) {
-		switch (_field30) {
-		case 2:
-			_field34 = 2;
-			break;
-		case 3:
-			_field34 = 3;
-			break;
-		case 5:
-			_field34 = 7;
-			break;
-		default:
-			_field34 = 4;
-			break;
-		}
-	}
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/link_item.h b/engines/titanic/objects/link_item.h
deleted file mode 100644
index efe5ec1..0000000
--- a/engines/titanic/objects/link_item.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_LINK_ITEM_H
-#define TITANIC_LINK_ITEM_H
-
-#include "titanic/objects/named_item.h"
-
-namespace Titanic {
-
-class CLinkItemSub {
-public:
-	int _field0;
-	int _field4;
-	int _field8;
-	int _fieldC;
-public:
-	CLinkItemSub();
-};
-
-class CLinkItem : public CNamedItem {
-protected:
-	int _field24;
-	int _field28;
-	int _field2C;
-	int _field30;
-	int _field34;
-	CLinkItemSub _sub;
-public:
-	CLinkItem();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLinkItem"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_LINK_ITEM_H */
diff --git a/engines/titanic/objects/list.cpp b/engines/titanic/objects/list.cpp
deleted file mode 100644
index 4e0178d..0000000
--- a/engines/titanic/objects/list.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/list.h"
-
-namespace Titanic {
-
-void ListItem::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(0, indent);
-}
-
-void ListItem::load(SimpleFile *file) {
-	file->readNumber();
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/list.h b/engines/titanic/objects/list.h
deleted file mode 100644
index 1842d2b..0000000
--- a/engines/titanic/objects/list.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_LIST_H
-#define TITANIC_LIST_H
-
-#include "common/scummsys.h"
-#include "common/list.h"
-#include "titanic/simple_file.h"
-#include "titanic/objects/saveable_object.h"
-
-namespace Titanic {
-
-/**
- * Base list item class
- */
-class ListItem: public CSaveableObject {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "ListItem"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-template<typename T>
-class List : public CSaveableObject, public Common::List<T *> {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return nullptr; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const {
-		file->writeNumberLine(0, indent);
-
-		// Write out number of items
-		file->writeQuotedLine("L", indent);
-		file->writeNumberLine(Common::List<T *>::size(), indent);
-
-		// Iterate through writing entries
-		Common::List<T *>::const_iterator i;
-		for (i = Common::List<T *>::begin(); i != Common::List<T *>::end(); ++i) {
-			const ListItem *item = *i;
-			item->saveHeader(file, indent);
-			item->save(file, indent + 1);
-			item->saveFooter(file, indent);
-		}
-
-	}
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file) {
-		file->readNumber();
-		file->readBuffer();
-
-		Common::List<T *>::clear();
-		uint count = file->readNumber();
-
-		for (uint idx = 0; idx < count; ++idx) {
-			// Validate the class start header
-			if (!file->IsClassStart())
-				error("Unexpected class end");
-
-			// Get item's class name and use it to instantiate an item
-			CString className = file->readString();
-			T *newItem = dynamic_cast<T *>(CSaveableObject::createInstance(className));
-			if (!newItem)
-				error("Could not create instance of %s", className.c_str());
-
-			// Load the item's data and add it to the list
-			newItem->load(file);
-			Common::List<T *>::push_back(newItem);
-
-			// Validate the class end footer
-			if (file->IsClassStart())
-				error("Unexpected class start");
-		}
-	}
-
-	/**
-	 * Clear the list and destroy any items in it
-	 */
-	void destroyContents() {
-		for (Common::List<T *>::iterator i = Common::List<T *>::begin(); 
-				i != Common::List<T *>::end(); ++i) {
-			CSaveableObject *obj = *i;
-			delete obj;
-		}
-
-		Common::List<T *>::clear();
-	}
-
-	/**
-	 * Add a new item to the list of the type the list contains
-	 */
-	T *List::add() {
-		T *item = new T();
-		Common::List<T *>::push_back(item);
-		return item;
-	}
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_LIST_H */
diff --git a/engines/titanic/objects/message_target.cpp b/engines/titanic/objects/message_target.cpp
deleted file mode 100644
index bd162ff..0000000
--- a/engines/titanic/objects/message_target.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/message_target.h"
-
-namespace Titanic {
-	
-void CMessageTarget::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(0, indent);
-	CSaveableObject::save(file, indent);
-}
-
-void CMessageTarget::load(SimpleFile *file) {
-	file->readNumber();
-	CSaveableObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/message_target.h b/engines/titanic/objects/message_target.h
deleted file mode 100644
index 5e29dda..0000000
--- a/engines/titanic/objects/message_target.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_MESSAGE_TARGET_H
-#define TITANIC_MESSAGE_TARGET_H
-
-#include "titanic/objects/saveable_object.h"
-
-namespace Titanic {
-
-class CMessageTarget: public CSaveableObject {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMessageTarget"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_MESSAGE_TARGET_H */
diff --git a/engines/titanic/objects/movie_clip.cpp b/engines/titanic/objects/movie_clip.cpp
deleted file mode 100644
index 2914cc8..0000000
--- a/engines/titanic/objects/movie_clip.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/movie_clip.h"
-
-namespace Titanic {
-
-CMovieClip::CMovieClip() {
-}
-
-void CMovieClip::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(2, indent);
-	file->writeQuotedLine("Clip", indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeNumberLine(_field18, indent);
-	file->writeNumberLine(_field1C, indent);
-
-	ListItem::save(file, indent);
-}
-
-void CMovieClip::load(SimpleFile *file) {
-	int val = file->readNumber();
-
-	switch (val) {
-	case 1:
-		_string1 = file->readString();
-		_field18 = file->readNumber();
-		_field1C = file->readNumber();
-		_field20 = file->readNumber();
-		_field24 = file->readNumber();
-		_field28 = file->readNumber();
-		_field2C = file->readNumber();
-		_field30 = file->readNumber();
-		break;
-
-	case 2:
-		file->readString();
-		_string1 = file->readString();
-		_field18 = file->readNumber();
-		_field1C = file->readNumber();
-		break;
-
-	default:
-		break;
-	}
-
-	ListItem::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/movie_clip.h b/engines/titanic/objects/movie_clip.h
deleted file mode 100644
index e259d97..0000000
--- a/engines/titanic/objects/movie_clip.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_MOVIE_CLIP_H
-#define TITANIC_MOVIE_CLIP_H
-
-#include "titanic/objects/list.h"
-
-namespace Titanic {
-
-/**
- * Movie clip
- */
-class CMovieClip : public ListItem {
-private:
-	CString _string1;
-	int _field18;
-	int _field1C;
-	int _field20;
-	int _field24;
-	int _field28;
-	int _field2C;
-	int _field30;
-	CString _string2;
-	CString _string3;
-public:
-	CMovieClip();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMovieClip"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-/**
- * Movie clip list
- */
-class CMovieClipList: public List<CMovieClip> {
-public:
-	virtual const char *getClassName() const { return "CMovieClipList"; }
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_MOVIE_CLIP_H */
diff --git a/engines/titanic/objects/named_item.cpp b/engines/titanic/objects/named_item.cpp
deleted file mode 100644
index f7d7c7b..0000000
--- a/engines/titanic/objects/named_item.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/named_item.h"
-
-namespace Titanic {
-
-void CNamedItem::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(0, indent);
-	file->writeQuotedLine(_name, indent);
-
-	CTreeItem::save(file, indent);
-}
-
-void CNamedItem::load(SimpleFile *file) {
-	int val = file->readNumber();
-	if (!val)
-		_name = file->readString();
-
-	CTreeItem::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/named_item.h b/engines/titanic/objects/named_item.h
deleted file mode 100644
index d59b730..0000000
--- a/engines/titanic/objects/named_item.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_NAMED_ITEM_H
-#define TITANIC_NAMED_ITEM_H
-
-#include "titanic/objects/tree_item.h"
-
-namespace Titanic {
-
-class CNamedItem: public CTreeItem {
-public:
-	CString _name;
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNamedItem"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_NAMED_ITEM_H */
diff --git a/engines/titanic/objects/node_item.cpp b/engines/titanic/objects/node_item.cpp
deleted file mode 100644
index f2a55cf..0000000
--- a/engines/titanic/objects/node_item.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/node_item.h"
-
-namespace Titanic {
-
-CNodeItem::CNodeItem() : CNamedItem(), _field24(0), _field28(0), _field2C(0) {
-}
-
-void CNodeItem::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(0, indent);
-	file->writeQuotedLine("N", indent);
-	file->writeNumberLine(_field24, indent + 1);
-	file->writeNumberLine(_field28, indent + 1);
-
-	file->writeQuotedLine("N", indent);
-	file->writeNumberLine(_field2C, indent + 1);
-
-	CNamedItem::save(file, indent);
-}
-
-void CNodeItem::load(SimpleFile *file) {
-	file->readNumber();
-	file->readBuffer();
-	_field24 = file->readNumber();
-	_field28 = file->readNumber();
-
-	file->readBuffer();
-	_field2C = file->readNumber();
-
-	CNamedItem::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/node_item.h b/engines/titanic/objects/node_item.h
deleted file mode 100644
index bfb5348..0000000
--- a/engines/titanic/objects/node_item.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_NODE_ITEM_H
-#define TITANIC_NODE_ITEM_H
-
-#include "titanic/objects/named_item.h"
-
-namespace Titanic {
-
-class CNodeItem : public CNamedItem {
-private:
-	int _field24;
-	int _field28;
-	int _field2C;
-public:
-	CNodeItem();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNodeItem"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);	
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_FILE_ITEM_H */
diff --git a/engines/titanic/objects/pet_control.cpp b/engines/titanic/objects/pet_control.cpp
deleted file mode 100644
index 73ef957..0000000
--- a/engines/titanic/objects/pet_control.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/pet_control.h"
-
-namespace Titanic {
-
-void CPetControl::gameLoaded() {
-	// TODO
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/pet_control.h b/engines/titanic/objects/pet_control.h
deleted file mode 100644
index f6c9707..0000000
--- a/engines/titanic/objects/pet_control.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_H
-#define TITANIC_PET_CONTROL_H
-
-#include "titanic/objects/game_object.h"
-
-namespace Titanic {
-
-class CPetControl : public CGameObject {
-public:
-	/**
-	 * Called after loading a game has finished
-	 */
-	void gameLoaded();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_H */
diff --git a/engines/titanic/objects/project_item.cpp b/engines/titanic/objects/project_item.cpp
deleted file mode 100644
index 2bd7515..0000000
--- a/engines/titanic/objects/project_item.cpp
+++ /dev/null
@@ -1,294 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/savefile.h"
-#include "titanic/game_manager.h"
-#include "titanic/titanic.h"
-#include "titanic/compressed_file.h"
-#include "titanic/objects/dont_save_file_item.h"
-#include "titanic/objects/pet_control.h"
-#include "titanic/objects/project_item.h"
-
-namespace Titanic {
-
-void CFileListItem::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(0, indent);
-	file->writeQuotedLine(_name, indent);
-
-	ListItem::save(file, indent);
-}
-
-void CFileListItem::load(SimpleFile *file) {
-	file->readNumber();
-	_name = file->readString();
-
-	ListItem::load(file);
-}
-
-/*------------------------------------------------------------------------*/
-
-CProjectItem::CProjectItem() : _nextRoomNumber(0), _nextMessageNumber(0),
-		_nextObjectNumber(0), _gameManager(nullptr) {
-}
-
-void CProjectItem::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(6, indent);
-	file->writeQuotedLine("Next Avail. Object Number", indent);
-	file->writeNumberLine(_nextObjectNumber, indent);
-	file->writeQuotedLine("Next Avail. Message Number", indent);
-	file->writeNumberLine(_nextMessageNumber, indent);
-	file->writeQuotedLine("Next Avail. Room Number", indent);
-	file->writeNumberLine(_nextRoomNumber, indent);
-
-	CTreeItem::save(file, indent);
-}
-
-void CProjectItem::buildFilesList() {
-	_files.destroyContents();
-
-	CTreeItem *treeItem = getFirstChild();
-	while (treeItem) {
-		if (treeItem->isFileItem()) {
-			CString name = static_cast<CFileItem *>(treeItem)->getFilename();
-			_files.add()->_name = name;
-		}
-
-		treeItem = getNextSibling();
-	}
-}
-
-void CProjectItem::load(SimpleFile *file) {
-	int val = file->readNumber();
-	_files.destroyContents();
-	int count;
-
-	switch (val) {
-	case 1:
-		file->readBuffer();
-		_nextRoomNumber = file->readNumber();
-		// Deliberate fall-through
-
-	case 0:
-		// Load the list of files
-		count = file->readNumber();
-		for (int idx = 0; idx < count; ++idx) {
-			CString name = file->readString();
-			_files.add()->_name = name;
-		}
-		break;
-
-	case 6:
-		file->readBuffer();
-		_nextObjectNumber = file->readNumber();
-		// Deliberate fall-through
-
-	case 5:
-		file->readBuffer();
-		_nextMessageNumber = file->readNumber();
-		// Deliberate fall-through
-
-	case 4:
-		file->readBuffer();
-		// Deliberate fall-through
-
-	case 2:
-	case 3:
-		_files.load(file);
-		file->readBuffer();
-		_nextRoomNumber = file->readNumber();
-		break;
-
-	default:
-		break;
-	}
-
-	CTreeItem::load(file);
-}
-
-CGameManager *CProjectItem::getGameManager() {
-	return _gameManager;
-}
-
-void CProjectItem::resetGameManager() {
-	_gameManager = nullptr;
-}
-
-void CProjectItem::loadGame(int slotId) {
-	CompressedFile file;
-	Common::InSaveFile *saveFile = nullptr;
-
-	// Clear any existing project contents
-	clear();
-
-	// Open either an existing savegame slot or the new game template
-	if (slotId >= 0) {
-		saveFile = g_system->getSavefileManager()->openForLoading(
-			Common::String::format("slot%d.gam", slotId));
-		file.open(saveFile);
-	} else {
-		file.open("newgame.st");
-	}
-
-	// Load the contents in
-	CProjectItem *newProject = loadData(&file);
-	file.IsClassStart();
-	getGameManager()->load(&file);
-
-	file.close();
-
-	// Clear existing project
-	clear();
-
-	// Detach each item under the loaded project, and re-attach them
-	// to the existing project instance (this)
-	CTreeItem *item;
-	while ((item = newProject->getFirstChild()) != nullptr) {
-		item->detach();
-		item->addUnder(this);
-	}
-	// Loaded project instance is no longer needed
-	newProject->destroyAll();
-
-	// Post-load processing
-	gameLoaded();
-}
-
-void CProjectItem::saveGame(int slotId) {
-	CompressedFile file;
-	Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(
-		Common::String::format("slot%d.gam", slotId));
-	file.open(saveFile);
-
-	// Save the contents out
-	saveData(&file, this);
-
-	file.close();
-}
-
-void CProjectItem::clear() {
-	CTreeItem *item;
-	while ((item = getFirstChild()) != nullptr)
-		item->destroyAll();
-}
-
-CProjectItem *CProjectItem::loadData(SimpleFile *file) {
-	if (!file->IsClassStart())
-		return nullptr;
-
-	CProjectItem *root = nullptr;
-	CTreeItem *parent = nullptr;
-	CTreeItem *item = nullptr;
-
-	do {
-		CString entryString = file->readString();
-
-		if (entryString == "ALONG") {
-			// Move along, nothing needed
-		} else if (entryString == "UP") {
-			// Move up
-			if (parent == nullptr ||
-				(parent = parent->getParent()) == nullptr)
-				break;
-		} else if (entryString == "DOWN") {
-			// Move down
-			if (parent == nullptr)
-				parent = item;
-			else
-				parent = parent->getLastChild();
-		} else {
-			// Create new class instance
-			item = dynamic_cast<CTreeItem *>(CSaveableObject::createInstance(entryString));
-			assert(item);
-
-			if (root) {
-				// Already created root project
-				item->addUnder(parent);
-			} else {
-				root = dynamic_cast<CProjectItem *>(item);
-				assert(root);
-				root->_filename = _filename;
-			}
-
-			// Load the data for the item
-			item->load(file);
-		}
-
-		file->IsClassStart();
-	} while (file->IsClassStart());
-
-	return root;
-}
-
-void CProjectItem::saveData(SimpleFile *file, CTreeItem *item) const {
-	while (item) {
-		item->saveHeader(file, 0);
-		item->save(file, 1);
-		item->saveFooter(file, 0);
-
-	
-		CTreeItem *child = item->getFirstChild();
-		if (child) {
-			file->write("\n{\n", 3);
-			file->writeQuotedString("DOWN");
-			file->write("\n}\n", 3);
-			saveData(file, child);
-			file->write("\n{\n", 3);
-			file->writeQuotedString("UP");
-		} else {
-			file->write("\n{\n", 3);
-			file->writeQuotedString("ALONG");
-		}
-		
-		file->write("\n}\n", 3);
-		item = item->getNextSibling();
-	}
-}
-
-void CProjectItem::gameLoaded() {
-	CGameManager *gameManager = getGameManager();
-	if (gameManager)
-		gameManager->gameLoaded();
-
-	CPetControl *petControl = getPetControl();
-	if (petControl)
-		petControl->gameLoaded();
-}
-
-CPetControl *CProjectItem::getPetControl() {
-	CDontSaveFileItem *fileItem = getDontSaveFileItem();
-	CTreeItem *treeItem;
-
-	if (!fileItem || (treeItem = fileItem->getLastChild()) == nullptr)
-		return nullptr;
-
-	while (treeItem) {
-		CPetControl *petControl = dynamic_cast<CPetControl *>(treeItem);
-		if (petControl)
-			return petControl;
-
-		treeItem = treeItem->getPriorSibling();
-	}
-
-	return nullptr;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/project_item.h b/engines/titanic/objects/project_item.h
deleted file mode 100644
index 066dbf6..0000000
--- a/engines/titanic/objects/project_item.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PROJECT_ITEM_H
-#define TITANIC_PROJECT_ITEM_H
-
-#include "common/scummsys.h"
-#include "titanic/simple_file.h"
-#include "titanic/objects/file_item.h"
-#include "titanic/objects/list.h"
-
-namespace Titanic {
-
-class CGameManager;
-class CPetControl;
-
-/**
- * File list item
- */
-class CFileListItem : public ListItem {
-public:
-	CString _name;
-
-	virtual const char *getClassName() const { return "CFileListItem"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);	
-	
-};
-
-/**
- * Filename list
- */
-class CFileList: public List<CFileListItem> {
-public:
-	virtual const char *getClassName() const { return "CFileList"; }
-};
-
-
-class CProjectItem : public CFileItem {
-private:
-	CString _filename;
-	CFileList _files;
-	int _nextRoomNumber;
-	int _nextMessageNumber;
-	int _nextObjectNumber;
-	CGameManager *_gameManager;
-
-	/**
-	 * Called during save, iterates through the children to do some stuff
-	 */
-	void buildFilesList();
-private:
-	/**
-	 * Load project data from the passed file
-	 */
-	CProjectItem *loadData(SimpleFile *file);
-
-	/**
-	 * Save project data to the passed file
-	 */
-	void saveData(SimpleFile *file, CTreeItem *item) const;
-
-	/**
-	 * Does post-loading processing
-	 */
-	void gameLoaded();
-public:
-	CProjectItem();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CProjectItem"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);	
-
-	/**
-	 * Get the game manager for the project
-	 */
-	virtual CGameManager *getGameManager();
-
-	/**
-	 * Get a reference to the PET control
-	 */
-	CPetControl *getPetControl();
-
-	/**
-	 * Resets the game manager field
-	 */
-	void resetGameManager();
-
-	/**
-	 * Load the entire project data for a given slot Id
-	 */
-	void loadGame(int slotId);
-
-	/**
-	 * Save the entire project data to a given savegame slot
-	 */
-	void saveGame(int slotId);
-
-	/**
-	 * Clear any currently loaded project
-	 */
-	void clear();
-
-	/**
-	 * Set the proejct's name
-	 */
-	void setFilename(const CString &name) { _filename = name; }
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PROJECT_ITEM_H */
diff --git a/engines/titanic/objects/resource_key.cpp b/engines/titanic/objects/resource_key.cpp
deleted file mode 100644
index 612014b..0000000
--- a/engines/titanic/objects/resource_key.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/simple_file.h"
-#include "titanic/objects/resource_key.h"
-
-namespace Titanic {
-
-void CResourceKey::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine("Resource Key...", indent);
-	file->writeQuotedLine(_key, indent);
-
-	CSaveableObject::save(file, indent);
-}
-
-void CResourceKey::load(SimpleFile *file) {
-	int val = file->readNumber();
-	
-	if (val == 1) {
-		file->readBuffer();
-		_value = file->readString();
-	}
-
-	CSaveableObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/resource_key.h b/engines/titanic/objects/resource_key.h
deleted file mode 100644
index 9d1b70f..0000000
--- a/engines/titanic/objects/resource_key.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_RESOURCE_KEY_H
-#define TITANIC_RESOURCE_KEY_H
-
-#include "titanic/string.h"
-#include "titanic/objects/saveable_object.h"
-
-namespace Titanic {
-
-class CResourceKey: public CSaveableObject {
-private:
-	CString _key;
-	CString _value;
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CResourceKey"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-
-	const CString &getString() const { return _key; }
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_RESOURCE_KEY_H */
diff --git a/engines/titanic/objects/saveable_object.cpp b/engines/titanic/objects/saveable_object.cpp
deleted file mode 100644
index 73980d1..0000000
--- a/engines/titanic/objects/saveable_object.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/saveable_object.h"
-#include "titanic/objects/file_item.h"
-#include "titanic/objects/link_item.h"
-#include "titanic/objects/list.h"
-#include "titanic/objects/message_target.h"
-#include "titanic/objects/movie_clip.h"
-#include "titanic/objects/node_item.h"
-#include "titanic/objects/project_item.h"
-#include "titanic/objects/saveable_object.h"
-#include "titanic/objects/tree_item.h"
-#include "titanic/objects/view_item.h"
-#include "titanic/rooms/announce.h"
-#include "titanic/rooms/pet_position.h"
-#include "titanic/rooms/room_item.h"
-#include "titanic/rooms/service_elevator_door.h"
-#include "titanic/rooms/sub_glass.h"
-
-namespace Titanic {
-
-Common::HashMap<Common::String, CSaveableObject::CreateFunction> * 
-	CSaveableObject::_classList = nullptr;
-
-#define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
-#define ADDFN(T) (*_classList)[#T] = Function##T
-
-DEFFN(CAnnounce);
-DEFFN(CFileItem);
-DEFFN(CFileListItem);
-DEFFN(CLinkItem);
-DEFFN(CMessageTarget);
-DEFFN(CMovieClip);
-DEFFN(CMovieClipList);
-DEFFN(CNodeItem);
-DEFFN(CPETPosition);
-DEFFN(CProjectItem);
-DEFFN(CRoomItem);
-DEFFN(CServiceElevatorDoor);
-DEFFN(CSUBGlass);
-DEFFN(CTreeItem);
-DEFFN(CViewItem);
-
-void CSaveableObject::initClassList() {
-	_classList = new Common::HashMap<Common::String, CreateFunction>();
-	ADDFN(CAnnounce);
-	ADDFN(CFileItem);
-	ADDFN(CFileListItem);
-	ADDFN(CLinkItem);
-	ADDFN(CMessageTarget);
-	ADDFN(CMovieClip);
-	ADDFN(CMovieClipList);
-	ADDFN(CNodeItem);
-	ADDFN(CPETPosition);
-	ADDFN(CProjectItem);
-	ADDFN(CRoomItem);
-	ADDFN(CServiceElevatorDoor);
-	ADDFN(CSUBGlass);
-	ADDFN(CTreeItem);
-	ADDFN(CViewItem);
-}
-
-void CSaveableObject::freeClassList() {
-	delete _classList;
-}
-
-CSaveableObject *CSaveableObject::createInstance(const Common::String &name) {
-	return (*_classList)[name]();
-}
-
-void CSaveableObject::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(0, indent);
-}
-
-void CSaveableObject::load(SimpleFile *file) {
-	file->readNumber();
-}
-
-void CSaveableObject::saveHeader(SimpleFile *file, int indent) const {
-	file->writeClassStart(getClassName(), indent);
-}
-
-void CSaveableObject::saveFooter(SimpleFile *file, int indent) const {
-	file->writeClassEnd(indent);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/saveable_object.h b/engines/titanic/objects/saveable_object.h
deleted file mode 100644
index 4e7d949..0000000
--- a/engines/titanic/objects/saveable_object.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_SAVEABLE_OBJECT_H
-#define TITANIC_SAVEABLE_OBJECT_H
-
-#include "common/scummsys.h"
-#include "common/array.h"
-#include "common/hash-str.h"
-#include "titanic/simple_file.h"
-
-namespace Titanic {
-
-class CSaveableObject {
-	typedef CSaveableObject *(*CreateFunction)();
-private:
-	static Common::HashMap<Common::String, CreateFunction> *_classList;
-public:
-	/**
-	 * Sets up the list of saveable object classes
-	 */
-	static void initClassList();
-
-	/**
-	 * Free the list of saveable object classes
-	 */
-	static void freeClassList();
-
-	/**
-	 * Creates a new instance of a saveable object class
-	 */
-	static CSaveableObject *createInstance(const Common::String &name);
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSaveableObject"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-	
-	/**
-	 * Write out a header definition for the class to file
-	 * prior to saving the actual data for the class
-	 */
-	virtual void saveHeader(SimpleFile *file, int indent) const;
-	
-	/**
-	 * Writes out a footer for the class after it's data has
-	 * been written to file
-	 */
-	virtual void saveFooter(SimpleFile *file, int indent) const;
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_SAVEABLE_OBJECT_H */
diff --git a/engines/titanic/objects/tree_item.cpp b/engines/titanic/objects/tree_item.cpp
deleted file mode 100644
index 3902df3..0000000
--- a/engines/titanic/objects/tree_item.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/tree_item.h"
-#include "titanic/objects/dont_save_file_item.h"
-#include "titanic/objects/file_item.h"
-
-namespace Titanic {
-
-CTreeItem::CTreeItem() : _parent(nullptr), _firstChild(nullptr),
-	_nextSibling(nullptr), _priorSibling(nullptr), _field14(0) {
-}
-
-void CTreeItem::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(0, indent);
-	CMessageTarget::save(file, indent);
-}
-
-void CTreeItem::load(SimpleFile *file) {
-	file->readNumber();
-	CMessageTarget::load(file);
-}
-
-CGameManager *CTreeItem::getGameManager() {
-	return _parent ? _parent->getGameManager() : nullptr;
-}
-
-CTreeItem *CTreeItem::getRoot() const {
-	CTreeItem *parent = getParent();
-
-	if (parent) {
-		do {
-			parent = parent->getParent();
-		} while (parent->getParent());
-	}
-
-	return parent;
-}
-
-CTreeItem *CTreeItem::getLastSibling() {
-	CTreeItem *item = this;
-	while (item->getNextSibling())
-		item = item->getNextSibling();
-
-	return item;
-}
-
-CTreeItem *CTreeItem::getLastChild() {
-	if (!_firstChild)
-		return nullptr;
-	return _firstChild->getLastSibling();
-}
-
-CDontSaveFileItem *CTreeItem::getDontSaveFileItem() {
-	CTreeItem *item = getFirstChild();
-	while (item) {
-		CDontSaveFileItem *fileItem = dynamic_cast<CDontSaveFileItem *>(item);
-		if (fileItem)
-			return fileItem;
-
-		item = item->getNextSibling();
-	}
-}
-
-void CTreeItem::addUnder(CTreeItem *newParent) {
-	if (newParent->_firstChild)
-		addSibling(newParent->getLastSibling());
-	else
-		setParent(newParent);
-}
-
-void CTreeItem::setParent(CTreeItem *newParent) {
-	_parent = newParent;
-	_priorSibling = nullptr;
-	_nextSibling = newParent->_firstChild;
-
-	if (newParent->_firstChild)
-		newParent->_firstChild->_priorSibling = this;
-	newParent->_firstChild = this;
-}
-
-void CTreeItem::addSibling(CTreeItem *item) {
-	_priorSibling = item->_nextSibling;
-	_nextSibling = item->_nextSibling;
-	_parent = item->_parent;
-
-	if (item->_nextSibling)
-		item->_nextSibling->_priorSibling = this;
-	item->_nextSibling = this;
-}
-
-void CTreeItem::destroyAll() {
-	destroyOthers();
-	detach();
-	delete this;
-}
-
-int CTreeItem::destroyOthers() {
-	if (!_firstChild)
-		return 0;
-
-	CTreeItem *item = this, *child, *nextSibling;
-	int total = 0;
-
-	do {
-		child = item->_firstChild;
-		nextSibling = item->_nextSibling;
-
-		if (child)
-			total += child->destroyOthers();
-		child->detach();
-		delete child;
-		++total;
-	} while ((item = nextSibling) != nullptr);
-
-	return total;
-}
-
-void CTreeItem::detach() {
-	// Delink this item from any prior and/or next siblings
-	if (_priorSibling)
-		_priorSibling->_nextSibling = _nextSibling;
-	if (_nextSibling)
-		_nextSibling->_priorSibling = _priorSibling;
-
-	if (_parent && _parent->_firstChild == this)
-		_parent->_firstChild = _nextSibling;
-
-	_priorSibling = _nextSibling = _parent = nullptr;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/tree_item.h b/engines/titanic/objects/tree_item.h
deleted file mode 100644
index d6450e3..0000000
--- a/engines/titanic/objects/tree_item.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_TREE_ITEM_H
-#define TITANIC_TREE_ITEM_H
-
-#include "titanic/objects/message_target.h"
-
-namespace Titanic {
-
-class CGameManager;
-class CDontSaveFileItem;
-
-class CTreeItem: public CMessageTarget {
-private:
-	CTreeItem *_parent;
-	CTreeItem *_nextSibling;
-	CTreeItem *_priorSibling;
-	CTreeItem *_firstChild;
-	int _field14;
-public:
-	CTreeItem();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTreeItem"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-
-	/**
-	 * Get the game manager for the project
-	 */
-	virtual CGameManager *getGameManager();
-
-	/**
-	 * Returns true if the item is a file item
-	 */
-	virtual bool isFileItem() const { return false; }
-
-	/**
-	 * Get the parent for the given item
-	 */
-	CTreeItem *getParent() const { return _parent; }
-
-	/**
-	 * Jumps up through the parents to find the sub-root item
-	 */
-	CTreeItem *getRoot() const;
-
-	/**
-	 * Get the next sibling
-	 */
-	CTreeItem *getNextSibling() { return _nextSibling; }
-
-	/**
-	 * Get the prior sibling
-	 */
-	CTreeItem *getPriorSibling() { return _priorSibling; }
-
-	/**
-	 * Get the last sibling of this sibling
-	 */
-	CTreeItem *getLastSibling();
-
-	/**
-	 * Get the first child of the item, if any
-	 */
-	CTreeItem *getFirstChild() { return _firstChild; }
-
-	/**
-	 * Get the last child of the item, if any
-	 */
-	CTreeItem *getLastChild();
-
-	/**
-	 * Get any dont save file item in the immediate children
-	 */
-	CDontSaveFileItem *getDontSaveFileItem();
-
-	/**
-	 * Adds the item under another tree item
-	 */
-	void addUnder(CTreeItem *newParent);
-
-	/**
-	 * Sets the parent for the item
-	 */
-	void setParent(CTreeItem *newParent);
-
-	/**
-	 * Adds the item as a sibling of another item
-	 */
-	void addSibling(CTreeItem *item);
-
-	/**
-	 * Destroys both the item as well as any of it's children
-	 */
-	void destroyAll();
-
-	/**
-	 * Destroys all tree items around the given one
-	 */
-	int destroyOthers();
-
-	/**
-	 * Detach the tree item from any other associated tree items
-	 */
-	void detach();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_TREE_ITEM_H */
diff --git a/engines/titanic/objects/view_item.cpp b/engines/titanic/objects/view_item.cpp
deleted file mode 100644
index 1199ba9..0000000
--- a/engines/titanic/objects/view_item.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/objects/view_item.h"
-
-namespace Titanic {
-
-CViewItem::CViewItem() : CNamedItem() {
-	_field24 = 0;
-	_field28 = 0.0;
-	_field30 = 0;
-	_field50 = 0;
-	_field54 = 0;
-	setData(0.0);
-}
-
-void CViewItem::setData(double v) {
-	_field28 = v;
-	_field50 = cos(_field28) * 30.0;
-	_field54 = sin(_field28) * -30.0;
-}
-
-void CViewItem::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	_resourceKey.save(file, indent);
-	file->writeQuotedLine("V", indent);
-	file->writeFloatLine(_field28, indent + 1);
-	file->writeNumberLine(_field30, indent + 1);
-
-	CNamedItem::save(file, indent);
-}
-
-void CViewItem::load(SimpleFile *file) {
-	int val = file->readNumber();
-	
-	switch (val) {
-	case 1:
-		_resourceKey.load(file);
-		// Deliberate fall-through
-
-	default:
-		file->readBuffer();
-		setData(file->readFloat());
-		_field30 = file->readNumber();
-		break;
-	}
-
-	CNamedItem::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/objects/view_item.h b/engines/titanic/objects/view_item.h
deleted file mode 100644
index 1bd2d6d..0000000
--- a/engines/titanic/objects/view_item.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_VIEW_ITEM_H
-#define TITANIC_VIEW_ITEM_H
-
-#include "titanic/objects/named_item.h"
-#include "titanic/objects/resource_key.h"
-
-namespace Titanic {
-
-class CViewItem : public CNamedItem {
-private:
-	void setData(double v);
-protected:
-	int _field24;
-	double _field28;
-	int _field30;
-	CResourceKey _resourceKey;
-	int _field50;
-	int _field54;
-public:
-	CViewItem();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNamedItem"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_NAMED_ITEM_H */
diff --git a/engines/titanic/rooms/announce.cpp b/engines/titanic/rooms/announce.cpp
deleted file mode 100644
index b790566..0000000
--- a/engines/titanic/rooms/announce.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/rooms/announce.h"
-
-namespace Titanic {
-
-CAnnounce::CAnnounce() : _fieldBC(0), _fieldC0(0), _fieldC4(1), _fieldC8(0) {
-}
-
-void CAnnounce::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-	file->writeNumberLine(_fieldC4, indent);
-	file->writeNumberLine(_fieldC8, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CAnnounce::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-	_fieldC4 = file->readNumber();
-	_fieldC8 = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/rooms/announce.h b/engines/titanic/rooms/announce.h
deleted file mode 100644
index 58f928d..0000000
--- a/engines/titanic/rooms/announce.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_ANNOUNCE_H
-#define TITANIC_ANNOUNCE_H
-
-#include "titanic/objects/game_object.h"
-
-namespace Titanic {
-
-class CAnnounce : public CGameObject {
-private:
-	int _fieldBC;
-	int _fieldC0;
-	int _fieldC4;
-	int _fieldC8;
-public:
-	CAnnounce();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAnnounce"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ROOM_ITEM_H */
diff --git a/engines/titanic/rooms/door_auto_sound_event.cpp b/engines/titanic/rooms/door_auto_sound_event.cpp
deleted file mode 100644
index 279f4f9..0000000
--- a/engines/titanic/rooms/door_auto_sound_event.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/rooms/door_auto_sound_event.h"
-
-namespace Titanic {
-
-CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(),
-		_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
-}
-
-void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeQuotedLine(_string2, indent);
-	file->writeNumberLine(_fieldDC, indent);
-	file->writeNumberLine(_fieldE0, indent);
-
-	CAutoSoundEvent::save(file, indent);
-}
-
-void CDoorAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_string1 = file->readString();
-	_string2 = file->readString();
-	_fieldDC = file->readNumber();
-	_fieldE0 = file->readNumber();
-
-	CAutoSoundEvent::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/rooms/door_auto_sound_event.h b/engines/titanic/rooms/door_auto_sound_event.h
deleted file mode 100644
index 4f96027..0000000
--- a/engines/titanic/rooms/door_auto_sound_event.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_DOOR_AUTO_SOUND_EVENT_H
-#define TITANIC_DOOR_AUTO_SOUND_EVENT_H
-
-#include "titanic/objects/auto_sound_event.h"
-
-namespace Titanic {
-
-class CDoorAutoSoundEvent : public CAutoSoundEvent {
-protected:
-	CString _string1;
-	CString _string2;
-	int _fieldDC;
-	int _fieldE0;
-public:
-	CDoorAutoSoundEvent();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_DOOR_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/rooms/pet_position.cpp b/engines/titanic/rooms/pet_position.cpp
deleted file mode 100644
index b5bf2e6..0000000
--- a/engines/titanic/rooms/pet_position.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/rooms/pet_position.h"
-
-namespace Titanic {
-
-void CPETPosition::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
-}
-
-void CPETPosition::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/rooms/pet_position.h b/engines/titanic/rooms/pet_position.h
deleted file mode 100644
index dc27377..0000000
--- a/engines/titanic/rooms/pet_position.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_POSITION_H
-#define TITANIC_PET_POSITION_H
-
-#include "titanic/objects/game_object.h"
-
-namespace Titanic {
-
-class CPETPosition : public CGameObject {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPETPosition"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ROOM_ITEM_H */
diff --git a/engines/titanic/rooms/room_item.cpp b/engines/titanic/rooms/room_item.cpp
deleted file mode 100644
index dce2bc0..0000000
--- a/engines/titanic/rooms/room_item.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/rooms/room_item.h"
-
-namespace Titanic {
-
-CRoomItem::CRoomItem() : CNamedItem(), _roomNumber(0),
-		_roomDimensionX(0.0), _roomDimensionY(0.0) {
-}
-
-void CRoomItem::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(3, indent);
-	file->writeQuotedLine("Exit Movies", indent);
-	_exitMovieKey.save(file, indent);
-
-	file->writeNumberLine(_roomDimensionX * 1000.0, indent + 1);
-	file->writeNumberLine(_roomDimensionY * 1000.0, indent + 1);
-
-	file->writeQuotedLine("Transition Movie", indent);
-	_transitionMovieKey.save(file, indent);
-
-	file->writeQuotedLine("Movie Clip list", indent);
-	_clipList.save(file, indent + 1);
-
-	file->writeQuotedLine("Room Rect", indent);
-	file->writeNumberLine(_roomRect.left, indent + 1);
-	file->writeNumberLine(_roomRect.top, indent + 1);
-	file->writeNumberLine(_roomRect.right, indent + 1);
-	file->writeNumberLine(_roomRect.bottom, indent + 1);
-
-	file->writeQuotedLine("Room Number", indent);
-	file->writeNumberLine(_roomNumber, indent);
-
-	CNamedItem::save(file, indent);
-}
-
-void CRoomItem::load(SimpleFile *file) {
-	int val = file->readNumber();
-	
-	switch (val) {
-	case 3:
-		// Read exit movie
-		file->readBuffer();
-		_exitMovieKey.load(file);
-		// Deliberate fall-through
-
-	case 2:
-		// Read room dimensions
-		file->readBuffer();
-		_roomDimensionX = (double)file->readNumber() / 1000.0;
-		_roomDimensionY = (double)file->readNumber() / 1000.0;
-		// Deliberate fall-through
-
-	case 1:
-		// Read transition movie key and clip list
-		file->readBuffer();
-		_transitionMovieKey.load(file);
-
-		file->readBuffer();
-		_clipList.load(file);
-		loading();
-		// Deliberate fall-through
-
-	case 0:
-		// Read room rect
-		file->readBuffer();
-		_roomRect.left = file->readNumber();
-		_roomRect.top = file->readNumber();
-		_roomRect.right = file->readNumber();
-		_roomRect.bottom = file->readNumber();
-		file->readBuffer();
-		_roomNumber = file->readNumber();
-		break;
-
-	default:
-		break;
-	}
-
-	CNamedItem::load(file);
-}
-
-void CRoomItem::loading() {
-	// TODO
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/rooms/room_item.h b/engines/titanic/rooms/room_item.h
deleted file mode 100644
index 4df14aa..0000000
--- a/engines/titanic/rooms/room_item.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_ROOM_ITEM_H
-#define TITANIC_ROOM_ITEM_H
-
-#include "common/rect.h"
-#include "titanic/objects/list.h"
-#include "titanic/objects/movie_clip.h"
-#include "titanic/objects/named_item.h"
-#include "titanic/objects/resource_key.h"
-
-namespace Titanic {
-
-class CRoomItem : public CNamedItem {
-private:
-	Common::Rect _roomRect;
-	CMovieClipList _clipList;
-	int _roomNumber;
-	CResourceKey _transitionMovieKey;
-	CResourceKey _exitMovieKey;
-	double _roomDimensionX, _roomDimensionY;
-
-	void loading();
-public:
-	CRoomItem();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CRoomItem"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ROOM_ITEM_H */
diff --git a/engines/titanic/rooms/service_elevator_door.cpp b/engines/titanic/rooms/service_elevator_door.cpp
deleted file mode 100644
index 931a9d6..0000000
--- a/engines/titanic/rooms/service_elevator_door.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/rooms/service_elevator_door.h"
-
-namespace Titanic {
-
-CServiceElevatorDoor::CServiceElevatorDoor() : CDoorAutoSoundEvent() {
-	_string1 = "z#31.wav";
-	_string2 = "z#32.wav";
-}
-
-void CServiceElevatorDoor::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string2, indent);
-	file->writeQuotedLine(_string1, indent);
-
-	CDoorAutoSoundEvent::save(file, indent);
-}
-
-void CServiceElevatorDoor::load(SimpleFile *file) {
-	file->readNumber();
-	_string2 = file->readString();
-	_string1 = file->readString();
-
-	CDoorAutoSoundEvent::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/rooms/service_elevator_door.h b/engines/titanic/rooms/service_elevator_door.h
deleted file mode 100644
index 5b924bc..0000000
--- a/engines/titanic/rooms/service_elevator_door.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_SERVICE_ELEVATOR_DOOR_H
-#define TITANIC_SERVICE_ELEVATOR_DOOR_H
-
-#include "titanic/rooms/door_auto_sound_event.h"
-
-namespace Titanic {
-
-class CServiceElevatorDoor : public CDoorAutoSoundEvent {
-public:
-	CServiceElevatorDoor();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CServiceElevatorDoor"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_SERVICE_ELEVATOR_DOOR_H */
diff --git a/engines/titanic/rooms/sub_glass.cpp b/engines/titanic/rooms/sub_glass.cpp
deleted file mode 100644
index 27f47fd..0000000
--- a/engines/titanic/rooms/sub_glass.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/rooms/sub_glass.h"
-
-namespace Titanic {
-
-CSUBGlass::CSUBGlass() : _fieldBC(0), _fieldC0(0), _fieldC4(1), _fieldC8(0) {
-}
-
-void CSUBGlass::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-	file->writeNumberLine(_fieldC4, indent);
-	file->writeNumberLine(_fieldC8, indent);
-	file->writeNumberLine(_fieldCC, indent);
-	file->writeQuotedLine(_string, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CSUBGlass::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-	_fieldC4 = file->readNumber();
-	_fieldC8 = file->readNumber();
-	_fieldCC = file->readNumber();
-	_string = file->readString();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/rooms/sub_glass.h b/engines/titanic/rooms/sub_glass.h
deleted file mode 100644
index b7a992d..0000000
--- a/engines/titanic/rooms/sub_glass.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_SUB_GLASS_H
-#define TITANIC_SUB_GLASS_H
-
-#include "titanic/objects/game_object.h"
-
-namespace Titanic {
-
-class CSUBGlass : public CGameObject {
-private:
-	int _fieldBC;
-	int _fieldC0;
-	int _fieldC4;
-	int _fieldC8;
-	int _fieldCC;
-	CString _string;
-public:
-	CSUBGlass();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSUBGlass"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ROOM_ITEM_H */
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index d998ec5..47b7c13 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -28,7 +28,7 @@
 #include "graphics/scaler.h"
 #include "graphics/thumbnail.h"
 #include "titanic/titanic.h"
-#include "titanic/objects/saveable_object.h"
+#include "titanic/core/saveable_object.h"
 
 namespace Titanic {
 


Commit: 4bd8ae116624802dd9e6e371bae8599523aa19b2
    https://github.com/scummvm/scummvm/commit/4bd8ae116624802dd9e6e371bae8599523aa19b2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-25T19:52:21-05:00

Commit Message:
TITANIC: Implemented CSuccUBus and ancestor classes

Changed paths:
  A engines/titanic/npcs/character.cpp
  A engines/titanic/npcs/character.h
  A engines/titanic/npcs/succubus.cpp
  A engines/titanic/npcs/succubus.h
  A engines/titanic/npcs/true_talk_npc.cpp
  A engines/titanic/npcs/true_talk_npc.h
  R engines/titanic/game/succubus.cpp
  R engines/titanic/game/succubus.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index c7e749e..ec0f293 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -36,6 +36,7 @@
 #include "titanic/game/room_item.h"
 #include "titanic/game/service_elevator_door.h"
 #include "titanic/game/sub_glass.h"
+#include "titanic/npcs/succubus.h"
 
 namespace Titanic {
 
@@ -58,6 +59,7 @@ DEFFN(CProjectItem);
 DEFFN(CRoomItem);
 DEFFN(CServiceElevatorDoor);
 DEFFN(CSUBGlass);
+DEFFN(CSuccUBus);
 DEFFN(CTreeItem);
 DEFFN(CViewItem);
 
@@ -76,6 +78,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CRoomItem);
 	ADDFN(CServiceElevatorDoor);
 	ADDFN(CSUBGlass);
+	ADDFN(CSuccUBus);
 	ADDFN(CTreeItem);
 	ADDFN(CViewItem);
 }
diff --git a/engines/titanic/game/succubus.cpp b/engines/titanic/game/succubus.cpp
deleted file mode 100644
index 27f47fd..0000000
--- a/engines/titanic/game/succubus.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/rooms/sub_glass.h"
-
-namespace Titanic {
-
-CSUBGlass::CSUBGlass() : _fieldBC(0), _fieldC0(0), _fieldC4(1), _fieldC8(0) {
-}
-
-void CSUBGlass::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-	file->writeNumberLine(_fieldC4, indent);
-	file->writeNumberLine(_fieldC8, indent);
-	file->writeNumberLine(_fieldCC, indent);
-	file->writeQuotedLine(_string, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CSUBGlass::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-	_fieldC4 = file->readNumber();
-	_fieldC8 = file->readNumber();
-	_fieldCC = file->readNumber();
-	_string = file->readString();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/succubus.h b/engines/titanic/game/succubus.h
deleted file mode 100644
index f99597b..0000000
--- a/engines/titanic/game/succubus.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_SUCCUBUS_H
-#define TITANIC_SUCCUBUS_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CSuccUBus : public CGameObject {
-private:
-	int _fieldBC;
-	int _fieldC0;
-	int _fieldC4;
-	int _fieldC8;
-	int _fieldCC;
-	CString _string;
-public:
-	CSuccUBus();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSuccUBus"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_SUCCUBUS_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 97053a5..7ae284a 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -36,7 +36,10 @@ MODULE_OBJS := \
 	game/pet_position.o \
 	game/room_item.o \
 	game/service_elevator_door.o \
-	game/sub_glass.o
+	game/sub_glass.o \
+	npcs/character.o \
+	npcs/succubus.o \
+	npcs/true_talk_npc.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/npcs/character.cpp b/engines/titanic/npcs/character.cpp
new file mode 100644
index 0000000..b8112ce
--- /dev/null
+++ b/engines/titanic/npcs/character.cpp
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/character.h"
+
+namespace Titanic {
+
+CCharacter::CCharacter() : CGameObject(), _fieldBC(0), _fieldC0(0), _fieldC4(1) {
+}
+
+void CCharacter::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeQuotedLine(_charName, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CCharacter::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_charName = file->readString();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/character.h b/engines/titanic/npcs/character.h
new file mode 100644
index 0000000..7f489d2
--- /dev/null
+++ b/engines/titanic/npcs/character.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHARACTER_H
+#define TITANIC_CHARACTER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CCharacter : public CGameObject {
+protected:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	CString _charName;
+public:
+	CCharacter();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCharacter"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SUCCUBUS_H */
diff --git a/engines/titanic/npcs/succubus.cpp b/engines/titanic/npcs/succubus.cpp
new file mode 100644
index 0000000..7570338
--- /dev/null
+++ b/engines/titanic/npcs/succubus.cpp
@@ -0,0 +1,215 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/succubus.h"
+
+namespace Titanic {
+
+int CSuccUBus::_v0;
+int CSuccUBus::_v1;
+int CSuccUBus::_v2;
+int CSuccUBus::_v3;
+int CSuccUBus::_v4;
+
+CSuccUBus::CSuccUBus() : CTrueTalkNPC() {
+	_field108 = -1;
+	_field10C = -1;
+	_field110 = -1;
+	_field114 = -1;
+	_field118 = 0x44;
+	_field11C = 0xA8;
+	_field120 = 0xA8;
+	_field124 = 0xF8;
+	_field128 = 0;
+	_field12C = 0x0E;
+	_field130 = 0x0E;
+	_field134 = 27;
+	_field138 = 40;
+	_field13C = 0x44;
+	_field140 = 1;
+	_field144 = 0;
+	_field148 = 0;
+	_field14C = 0;
+	_field150 = 0xE0;
+	_field154 = 0;
+	_field158 = 0;
+	_field15C = 0;
+	_string2 = "NULL";
+	_field16C = 28;
+	_field170 = 40;
+	_field174 = 82;
+	_field178 = 284;
+	_field17C = 148;
+	_field180 = 339;
+	_field184 = 15;
+	_field188 = 0;
+	_field18C = 0;
+	_field190 = 0;
+	_field194 = 240;
+	_field198 = 340;
+	_field19C = 0;
+	_field1A0 = -1;
+	_field1A4 = 0;
+	_field1A8 = 0;
+	_field1AC = 0;
+	_field1B0 = 0;
+	_field1B4 = 303;
+	_field1B8 = 312;
+	_field1BC = 313;
+	_field1C0 = 325;
+	_field1C4 = 326;
+	_field1C8 = 347;
+	_field1CC = 348;
+	_field1D0 = 375;
+	_field1D4 = 1;
+	_field1D8 = 0;
+}
+
+void CSuccUBus::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+
+	file->writeNumberLine(_v0, indent);
+	file->writeNumberLine(_field108, indent);
+	file->writeNumberLine(_field10C, indent);
+	file->writeNumberLine(_field110, indent);
+	file->writeNumberLine(_field114, indent);
+	file->writeNumberLine(_field118, indent);
+	file->writeNumberLine(_field11C, indent);
+	file->writeNumberLine(_field120, indent);
+	file->writeNumberLine(_field124, indent);
+	file->writeNumberLine(_field128, indent);
+	file->writeNumberLine(_field12C, indent);
+	file->writeNumberLine(_field130, indent);
+	file->writeNumberLine(_field134, indent);
+	file->writeNumberLine(_field138, indent);
+	file->writeNumberLine(_field13C, indent);
+	file->writeNumberLine(_field140, indent);
+
+	file->writeNumberLine(_v2, indent);
+	file->writeNumberLine(_field148, indent);
+	file->writeNumberLine(_field14C, indent);
+	file->writeNumberLine(_field150, indent);
+	file->writeNumberLine(_field154, indent);
+	file->writeNumberLine(_field158, indent);
+	file->writeNumberLine(_field15C, indent);
+
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_field16C, indent);
+	file->writeNumberLine(_field170, indent);
+	file->writeNumberLine(_field174, indent);
+	file->writeNumberLine(_field178, indent);
+	file->writeNumberLine(_field17C, indent);
+	file->writeNumberLine(_field180, indent);
+	file->writeNumberLine(_field184, indent);
+	file->writeNumberLine(_field188, indent);
+	file->writeNumberLine(_field18C, indent);
+	file->writeNumberLine(_field190, indent);
+	file->writeNumberLine(_field194, indent);
+	file->writeNumberLine(_field198, indent);
+	file->writeNumberLine(_field19C, indent);
+	file->writeNumberLine(_field1A0, indent);
+	file->writeNumberLine(_field1A4, indent);
+	file->writeNumberLine(_field1A8, indent);
+	file->writeNumberLine(_field1AC, indent);
+	file->writeNumberLine(_field1B0, indent);
+	file->writeNumberLine(_field1B4, indent);
+	file->writeNumberLine(_field1B8, indent);
+	file->writeNumberLine(_field1BC, indent);
+	file->writeNumberLine(_field1C0, indent);
+	file->writeNumberLine(_field1C4, indent);
+	file->writeNumberLine(_field1C8, indent);
+	file->writeNumberLine(_field1CC, indent);
+	file->writeNumberLine(_field1D0, indent);
+	file->writeNumberLine(_field1D4, indent);
+
+	file->writeNumberLine(_v3, indent);
+	file->writeNumberLine(_field1D8, indent);
+	file->writeNumberLine(_field104, indent);
+
+	CTrueTalkNPC::save(file, indent);
+}
+
+void CSuccUBus::load(SimpleFile *file) {
+	file->readNumber();
+
+	_v0 = file->readNumber();
+	_field108 = file->readNumber();
+	_field10C = file->readNumber();
+	_field110 = file->readNumber();
+	_field114 = file->readNumber();
+	_field118 = file->readNumber();
+	_field11C = file->readNumber();
+	_field120 = file->readNumber();
+	_field124 = file->readNumber();
+	_field128 = file->readNumber();
+	_field12C = file->readNumber();
+	_field130 = file->readNumber();
+	_field134 = file->readNumber();
+	_field138 = file->readNumber();
+	_field13C = file->readNumber();
+	_field140 = file->readNumber();
+	
+	_v2 = file->readNumber();
+	_field148 = file->readNumber();
+	_field14C = file->readNumber();
+	_field150 = file->readNumber();
+	_field154 = file->readNumber();
+	_field158 = file->readNumber();
+	_field15C = file->readNumber();
+
+	_string2 = file->readString();
+	_field16C = file->readNumber();
+	_field170 = file->readNumber();
+	_field174 = file->readNumber();
+	_field178 = file->readNumber();
+	_field17C = file->readNumber();
+	_field180 = file->readNumber();
+	_field184 = file->readNumber();
+	_field188 = file->readNumber();
+	_field18C = file->readNumber();
+	_field190 = file->readNumber();
+	_field194 = file->readNumber();
+	_field198 = file->readNumber();
+	_field19C = file->readNumber();
+	_field1A0 = file->readNumber();
+	_field1A4 = file->readNumber();
+	_field1A8 = file->readNumber();
+	_field1AC = file->readNumber();
+	_field1B0 = file->readNumber();
+	_field1B4 = file->readNumber();
+	_field1B8 = file->readNumber();
+	_field1BC = file->readNumber();
+	_field1C0 = file->readNumber();
+	_field1C4 = file->readNumber();
+	_field1C8 = file->readNumber();
+	_field1CC = file->readNumber();
+	_field1D0 = file->readNumber();
+	_field1D4 = file->readNumber();
+
+	_v3 = file->readNumber();
+	_field1D8 = file->readNumber();
+	_field104 = file->readNumber();
+
+	CTrueTalkNPC::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/succubus.h b/engines/titanic/npcs/succubus.h
new file mode 100644
index 0000000..2e30b12
--- /dev/null
+++ b/engines/titanic/npcs/succubus.h
@@ -0,0 +1,110 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SUCCUBUS_H
+#define TITANIC_SUCCUBUS_H
+
+#include "titanic/npcs/true_talk_npc.h"
+
+namespace Titanic {
+
+class CSuccUBus : public CTrueTalkNPC {
+private:
+	static int _v0;
+	static int _v1;
+	static int _v2;
+	static int _v3;
+	static int _v4;
+private:
+	int _field108;
+	int _field10C;
+	int _field110;
+	int _field114;
+	int _field118;
+	int _field11C;
+	int _field120;
+	int _field124;
+	int _field128;
+	int _field12C;
+	int _field130;
+	int _field134;
+	int _field138;
+	int _field13C;
+	int _field140;
+	int _field144;
+	int _field148;
+	int _field14C;
+	int _field150;
+	int _field154;
+	int _field158;
+	int _field15C;
+	CString _string2;
+	int _field16C;
+	int _field170;
+	int _field174;
+	int _field178;
+	int _field17C;
+	int _field180;
+	int _field184;
+	int _field188;
+	int _field18C;
+	int _field190;
+	int _field194;
+	int _field198;
+	int _field19C;
+	int _field1A0;
+	int _field1A4;
+	int _field1A8;
+	int _field1AC;
+	int _field1B0;
+	int _field1B4;
+	int _field1B8;
+	int _field1BC;
+	int _field1C0;
+	int _field1C4;
+	int _field1C8;
+	int _field1CC;
+	int _field1D0;
+	int _field1D4;
+	int _field1D8;
+public:
+	CSuccUBus();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSuccUBus"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SUCCUBUS_H */
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
new file mode 100644
index 0000000..924ea56
--- /dev/null
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -0,0 +1,66 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/true_talk_npc.h"
+
+namespace Titanic {
+
+CTrueTalkNPC::CTrueTalkNPC() : _string1("z451.dlg"),
+	_fieldD4(0x11170), _fieldE4(0), _fieldE8(0), _fieldEC(0), _fieldF0(0),
+	_fieldF4(0), _fieldF8(0), _fieldFC(0), _field100(0), _field104(0) {
+}
+
+void CTrueTalkNPC::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldD4, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_fieldF4, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_fieldFC, indent);
+	file->writeNumberLine(_field100, indent);
+	file->writeNumberLine(_field104, indent);
+
+	CCharacter::save(file, indent);
+}
+
+void CTrueTalkNPC::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldD4 = file->readNumber();
+	_string1 = file->readString();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_fieldF0 = file->readNumber();
+	_fieldF4 = file->readNumber();
+	_fieldF8 = file->readNumber();
+	_fieldFC = file->readNumber();
+	_field100 = file->readNumber();
+	_field104 = file->readNumber();
+
+	CCharacter::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
new file mode 100644
index 0000000..aed1ddb
--- /dev/null
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -0,0 +1,64 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TRUE_TALK_NPC_H
+#define TITANIC_TRUE_TALK_NPC_H
+
+#include "titanic/npcs/character.h"
+
+namespace Titanic {
+
+class CTrueTalkNPC : public CCharacter {
+protected:
+	int _fieldD4;
+	CString _string1;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+	int _fieldF4;
+	int _fieldF8;
+	int _fieldFC;
+	int _field100;
+	int _field104;
+public:
+	CTrueTalkNPC();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTrueTalkNPC"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TRUE_TALK_NPC_H */


Commit: 06ce0dbfddb016dc18ac38bbd938b8b5c71f454a
    https://github.com/scummvm/scummvm/commit/06ce0dbfddb016dc18ac38bbd938b8b5c71f454a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-25T21:42:10-05:00

Commit Message:
TITANIC: Implement TrueTalk NPC classes

Changed paths:
  A engines/titanic/npcs/barbot.cpp
  A engines/titanic/npcs/barbot.h
  A engines/titanic/npcs/bellbot.cpp
  A engines/titanic/npcs/bellbot.h
  A engines/titanic/npcs/deskbot.cpp
  A engines/titanic/npcs/deskbot.h
  A engines/titanic/npcs/doorbot.cpp
  A engines/titanic/npcs/doorbot.h
  A engines/titanic/npcs/liftbot.cpp
  A engines/titanic/npcs/liftbot.h
  A engines/titanic/npcs/maitre_d.cpp
  A engines/titanic/npcs/maitre_d.h
  A engines/titanic/npcs/parrot.cpp
  A engines/titanic/npcs/parrot.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index ec0f293..8f7c386 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -36,6 +36,13 @@
 #include "titanic/game/room_item.h"
 #include "titanic/game/service_elevator_door.h"
 #include "titanic/game/sub_glass.h"
+#include "titanic/npcs/barbot.h"
+#include "titanic/npcs/bellbot.h"
+#include "titanic/npcs/deskbot.h"
+#include "titanic/npcs/doorbot.h"
+#include "titanic/npcs/liftbot.h"
+#include "titanic/npcs/maitre_d.h"
+#include "titanic/npcs/parrot.h"
 #include "titanic/npcs/succubus.h"
 
 namespace Titanic {
@@ -47,13 +54,20 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 #define ADDFN(T) (*_classList)[#T] = Function##T
 
 DEFFN(CAnnounce);
+DEFFN(CBarbot);
+DEFFN(CBellBot);
+DEFFN(CDeskbot);
+DEFFN(CDoorbot);
 DEFFN(CFileItem);
 DEFFN(CFileListItem);
+DEFFN(CLiftBot);
 DEFFN(CLinkItem);
+DEFFN(CMaitreD);
 DEFFN(CMessageTarget);
 DEFFN(CMovieClip);
 DEFFN(CMovieClipList);
 DEFFN(CNodeItem);
+DEFFN(CParrot);
 DEFFN(CPETPosition);
 DEFFN(CProjectItem);
 DEFFN(CRoomItem);
@@ -66,13 +80,20 @@ DEFFN(CViewItem);
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
 	ADDFN(CAnnounce);
+	ADDFN(CBarbot);
+	ADDFN(CBellBot);
+	ADDFN(CDeskbot);
+	ADDFN(CDoorbot);
 	ADDFN(CFileItem);
 	ADDFN(CFileListItem);
+	ADDFN(CLiftBot);
 	ADDFN(CLinkItem);
+	ADDFN(CMaitreD);
 	ADDFN(CMessageTarget);
 	ADDFN(CMovieClip);
 	ADDFN(CMovieClipList);
 	ADDFN(CNodeItem);
+	ADDFN(CParrot);
 	ADDFN(CPETPosition);
 	ADDFN(CProjectItem);
 	ADDFN(CRoomItem);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 7ae284a..1d94289 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -37,7 +37,14 @@ MODULE_OBJS := \
 	game/room_item.o \
 	game/service_elevator_door.o \
 	game/sub_glass.o \
+	npcs/barbot.o \
+	npcs/bellbot.o \
 	npcs/character.o \
+	npcs/deskbot.o \
+	npcs/doorbot.o \
+	npcs/liftbot.o \
+	npcs/maitre_d.o \
+	npcs/parrot.o \
 	npcs/succubus.o \
 	npcs/true_talk_npc.o
 
diff --git a/engines/titanic/npcs/barbot.cpp b/engines/titanic/npcs/barbot.cpp
new file mode 100644
index 0000000..a460bdb
--- /dev/null
+++ b/engines/titanic/npcs/barbot.cpp
@@ -0,0 +1,236 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/barbot.h"
+
+namespace Titanic {
+
+int CBarbot::_v0;
+
+CBarbot::CBarbot() : CTrueTalkNPC() {
+	_field108 = 0;
+	_field10C = 0;
+	_field110 = 0;
+	_field114 = 0;
+	_field118 = 0;
+	_field11C = 0;
+	_field120 = 0;
+	_field124 = 0;
+	_field128 = 0;
+	_field12C = 0;
+	_field130 = 0;
+	_field134 = 0;
+	_field138 = 0;
+	_field13C = -1;
+	_field140 = 30;
+	_field144 = -1;
+	_field148 = -1;
+	_field14C = 0;
+	_field150 = 0;
+	_field154 = 0;
+	_field158 = -1;
+	_field15C = 0;
+	_field160 = 0;
+	_field164 = 558;
+	_field168 = 585;
+	_field16C = 659;
+	_field170 = 692;
+	_field174 = 802;
+	_field178 = 816;
+	_field17C = 1941;
+	_field180 = 1977;
+	_field184 = 1901;
+	_field188 = 1941;
+	_field18C = 810;
+	_field190 = 816;
+	_field194 = 857;
+	_field198 = 865;
+	_field19C = 842;
+	_field1A0 = 857;
+	_field1A4 = 821;
+	_field1A8 = 842;
+	_field1AC = 682;
+	_field1B0 = 692;
+	_field1B4 = 1977;
+	_field1B8 = 2018;
+	_field1BC = 2140;
+	_field1C0 = 2170;
+	_field1C4 = 2101;
+	_field1C8 = 2139;
+	_field1CC = 2018;
+	_field1D0 = 2099;
+	_field1D4 = 1902;
+	_field1D8 = 2015;
+	_field1E0 = 1811;
+	_field1E4 = 1901;
+	_field1E8 = 1810;
+	_field1EC = 1703;
+	_field1F0 = 1750;
+	_field1F4 = 1681;
+	_field1F8 = 1702;
+	_field1FC = 1642;
+
+	_field200 = 1702;
+	_field204 = 1571;
+	_field208 = 1641;
+	_field20C = 1499;
+	_field210 = 1570;
+	_field214 = 1403;
+	_field218 = 1463;
+	_field21C = 1464;
+	_field220 = 1499;
+	_field224 = 1288;
+	_field228 = 1295;
+	_field22C = 1266;
+	_field230 = 1287;
+	_field234 = 1245;
+	_field238 = 1265;
+	_field23C = 1208;
+	_field240 = 1244;
+	_field244 = 1171;
+	_field248 = 1207;
+	_field24C = 1120;
+	_field250 = 1170;
+	_field254 = 1092;
+	_field258 = 1120;
+	_field25C = 1092;
+	_field260 = 1092;
+	_field264 = 1044;
+	_field268 = 1091;
+	_field26C = 1011;
+	_field270 = 1043;
+	_field274 = 1001;
+	_field278 = 1010;
+	_field27C = 985;
+	_field280 = 1001;
+	_field284 = 927;
+	_field288 = 984;
+	_field28C = 912;
+	_field290 = 926;
+	_field294 = 898;
+	_field298 = 906;
+	_field29C = 802;
+	_field2A0 = 896;
+	_field2A4 = 865;
+	_field2A8 = 896;
+	_field2AC = 842;
+	_field2B0 = 865;
+	_field2B4 = 816;
+	_field2B8 = 842;
+	_field2BC = 802;
+	_field2C0 = 842;
+	_field2C4 = 740;
+	_field2C8 = 740;
+	_field2CC = 740;
+	_field2D0 = 692;
+	_field2D4 = 610;
+	_field2D8 = 558;
+	_field2E0 = 610;
+	_field2E4 = 500;
+	_field2E8 = 558;
+	_field2EC = 467;
+	_field2F0 = 500;
+	_field2F4 = 421;
+	_field2F8 = 466;
+	_field2FC = 349;
+	_field300 = 306;
+	_field304 = 306;
+	_field308 = 348;
+	_field30C = 305;
+	_field310 = 306;
+	_field314 = 281;
+	_field318 = 305;
+	_field31C = 202;
+	_field320 = 281;
+	_field324 = 182;
+	_field328 = 202;
+	_field32C = 165;
+	_field330 = 182;
+	_field334 = 96;
+	_field338 = 165;
+	_field33C = 0;
+	_field340 = 95;
+}
+
+void CBarbot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field108, indent);
+	file->writeNumberLine(_field10C, indent);
+	file->writeNumberLine(_field110, indent);
+	file->writeNumberLine(_field114, indent);
+	file->writeNumberLine(_field118, indent);
+	file->writeNumberLine(_field11C, indent);
+	file->writeNumberLine(_field120, indent);
+	file->writeNumberLine(_field124, indent);
+	file->writeNumberLine(_field128, indent);
+
+	file->writeNumberLine(_v0, indent);
+	file->writeNumberLine(_field12C, indent);
+	file->writeNumberLine(_field130, indent);
+	file->writeNumberLine(_field134, indent);
+	file->writeNumberLine(_field138, indent);
+	file->writeNumberLine(_field13C, indent);
+	file->writeNumberLine(_field140, indent);
+	file->writeNumberLine(_field144, indent);
+	file->writeNumberLine(_field148, indent);
+	file->writeNumberLine(_field14C, indent);
+	file->writeNumberLine(_field150, indent);
+	file->writeNumberLine(_field154, indent);
+	file->writeNumberLine(_field158, indent);
+	file->writeNumberLine(_field15C, indent);
+	file->writeNumberLine(_field160, indent);
+
+	CTrueTalkNPC::save(file, indent);
+}
+
+void CBarbot::load(SimpleFile *file) {
+	file->readNumber();
+	_field108 = file->readNumber();
+	_field10C = file->readNumber();
+	_field110 = file->readNumber();
+	_field114 = file->readNumber();
+	_field118 = file->readNumber();
+	_field11C = file->readNumber();
+	_field120 = file->readNumber();
+	_field124 = file->readNumber();
+	_field128 = file->readNumber();
+
+	_v0 = file->readNumber();
+	_field12C = file->readNumber();
+	_field130 = file->readNumber();
+	_field134 = file->readNumber();
+	_field138 = file->readNumber();
+	_field13C = file->readNumber();
+	_field140 = file->readNumber();
+	_field144 = file->readNumber();
+	_field148 = file->readNumber();
+	_field14C = file->readNumber();
+	_field150 = file->readNumber();
+	_field154 = file->readNumber();
+	_field158 = file->readNumber();
+	_field15C = file->readNumber();
+	_field160 = file->readNumber();
+	
+	CTrueTalkNPC::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h
new file mode 100644
index 0000000..d14d5a2
--- /dev/null
+++ b/engines/titanic/npcs/barbot.h
@@ -0,0 +1,196 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BARBOT_H
+#define TITANIC_BARBOT_H
+
+#include "titanic/npcs/true_talk_npc.h"
+
+namespace Titanic {
+
+class CBarbot : public CTrueTalkNPC {
+private:
+	static int _v0;
+private:
+	int _field108;
+	int _field10C;
+	int _field110;
+	int _field114;
+	int _field118;
+	int _field11C;
+	int _field120;
+	int _field124;
+	int _field128;
+	int _field12C;
+	int _field130;
+	int _field134;
+	int _field138;
+	int _field13C;
+	int _field140;
+	int _field144;
+	int _field148;
+	int _field14C;
+	int _field150;
+	int _field154;
+	int _field158;
+	int _field15C;
+	int _field160;
+	int _field164;
+	int _field168;
+	int _field16C;
+	int _field170;
+	int _field174;
+	int _field178;
+	int _field17C;
+	int _field180;
+	int _field184;
+	int _field188;
+	int _field18C;
+	int _field190;
+	int _field194;
+	int _field198;
+	int _field19C;
+	int _field1A0;
+	int _field1A4;
+	int _field1A8;
+	int _field1AC;
+	int _field1B0;
+	int _field1B4;
+	int _field1B8;
+	int _field1BC;
+	int _field1C0;
+	int _field1C4;
+	int _field1C8;
+	int _field1CC;
+	int _field1D0;
+	int _field1D4;
+	int _field1D8;
+	int _field1E0;
+	int _field1E4;
+	int _field1E8;
+	int _field1EC;
+	int _field1F0;
+	int _field1F4;
+	int _field1F8;
+	int _field1FC;
+	int _field200;
+	int _field204;
+	int _field208;
+	int _field20C;
+	int _field210;
+	int _field214;
+	int _field218;
+	int _field21C;
+	int _field220;
+	int _field224;
+	int _field228;
+	int _field22C;
+	int _field230;
+	int _field234;
+	int _field238;
+	int _field23C;
+	int _field240;
+	int _field244;
+	int _field248;
+	int _field24C;
+	int _field250;
+	int _field254;
+	int _field258;
+	int _field25C;
+	int _field260;
+	int _field264;
+	int _field268;
+	int _field26C;
+	int _field270;
+	int _field274;
+	int _field278;
+	int _field27C;
+	int _field280;
+	int _field284;
+	int _field288;
+	int _field28C;
+	int _field290;
+	int _field294;
+	int _field298;
+	int _field29C;
+	int _field2A0;
+	int _field2A4;
+	int _field2A8;
+	int _field2AC;
+	int _field2B0;
+	int _field2B4;
+	int _field2B8;
+	int _field2BC;
+	int _field2C0;
+	int _field2C4;
+	int _field2C8;
+	int _field2CC;
+	int _field2D0;
+	int _field2D4;
+	int _field2D8;
+	int _field2E0;
+	int _field2E4;
+	int _field2E8;
+	int _field2EC;
+	int _field2F0;
+	int _field2F4;
+	int _field2F8;
+	int _field2FC;
+	int _field300;
+	int _field304;
+	int _field308;
+	int _field30C;
+	int _field310;
+	int _field314;
+	int _field318;
+	int _field31C;
+	int _field320;
+	int _field324;
+	int _field328;
+	int _field32C;
+	int _field330;
+	int _field334;
+	int _field338;
+	int _field33C;
+	int _field340;
+public:
+	CBarbot();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBarbot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BARBOT_H */
diff --git a/engines/titanic/npcs/bellbot.cpp b/engines/titanic/npcs/bellbot.cpp
new file mode 100644
index 0000000..4874722
--- /dev/null
+++ b/engines/titanic/npcs/bellbot.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/bellbot.h"
+
+namespace Titanic {
+
+CBellBot::CBellBot() : CTrueTalkNPC(), _field108(0) {
+}
+
+void CBellBot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field108, indent);
+
+	CTrueTalkNPC::save(file, indent);
+}
+
+void CBellBot::load(SimpleFile *file) {
+	file->readNumber();
+	_field108 = file->readNumber();
+
+	CTrueTalkNPC::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/bellbot.h b/engines/titanic/npcs/bellbot.h
new file mode 100644
index 0000000..b47daa1
--- /dev/null
+++ b/engines/titanic/npcs/bellbot.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BELLBOT_H
+#define TITANIC_BELLBOT_H
+
+#include "titanic/npcs/true_talk_npc.h"
+
+namespace Titanic {
+
+class CBellBot : public CTrueTalkNPC {
+private:
+	int _field108;
+public:
+	CBellBot();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBellBot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BELLBOT_H */
diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp
new file mode 100644
index 0000000..c4745ae
--- /dev/null
+++ b/engines/titanic/npcs/deskbot.cpp
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/deskbot.h"
+
+namespace Titanic {
+
+int CDeskbot::_v1;
+int CDeskbot::_v2;
+
+CDeskbot::CDeskbot() : CTrueTalkNPC(), _field108(0), _field10C(0) {
+}
+
+void CDeskbot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+	file->writeNumberLine(_field108, indent);
+	file->writeNumberLine(_field10C, indent);
+
+	CTrueTalkNPC::save(file, indent);
+}
+
+void CDeskbot::load(SimpleFile *file) {
+	file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+	_field108 = file->readNumber();
+	_field10C = file->readNumber();
+
+	CTrueTalkNPC::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/deskbot.h b/engines/titanic/npcs/deskbot.h
new file mode 100644
index 0000000..2826b01
--- /dev/null
+++ b/engines/titanic/npcs/deskbot.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DESKBOT_H
+#define TITANIC_DESKBOT_H
+
+#include "titanic/npcs/true_talk_npc.h"
+
+namespace Titanic {
+
+class CDeskbot : public CTrueTalkNPC {
+private:
+	static int _v1;
+	static int _v2;
+private:
+	int _field108;
+	int _field10C;
+public:
+	CDeskbot();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDeskbot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DESKBOT_H */
diff --git a/engines/titanic/npcs/doorbot.cpp b/engines/titanic/npcs/doorbot.cpp
new file mode 100644
index 0000000..17db94f
--- /dev/null
+++ b/engines/titanic/npcs/doorbot.cpp
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/doorbot.h"
+
+namespace Titanic {
+
+int CDoorbot::_v1;
+int CDoorbot::_v2;
+
+CDoorbot::CDoorbot() : CTrueTalkNPC() {
+	_field108 = 0;
+	_field10C = 0;
+	_field110 = 0;
+	_field114 = 0;
+}
+
+void CDoorbot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+
+	file->writeNumberLine(_field108, indent);
+	file->writeNumberLine(_field10C, indent);
+	file->writeNumberLine(_field110, indent);
+	file->writeNumberLine(_field114, indent);
+
+	CTrueTalkNPC::save(file, indent);
+}
+
+void CDoorbot::load(SimpleFile *file) {
+	file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+
+	_field108 = file->readNumber();
+	_field10C = file->readNumber();
+	_field110 = file->readNumber();
+	_field114 = file->readNumber();
+
+	CTrueTalkNPC::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/doorbot.h b/engines/titanic/npcs/doorbot.h
new file mode 100644
index 0000000..e3ec7e8
--- /dev/null
+++ b/engines/titanic/npcs/doorbot.h
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DOORBOT_H
+#define TITANIC_DOORBOT_H
+
+#include "titanic/npcs/true_talk_npc.h"
+
+namespace Titanic {
+
+class CDoorbot : public CTrueTalkNPC {
+private:
+	static int _v1;
+	static int _v2;
+private:
+	int _field108;
+	int _field10C;
+	int _field110;
+	int _field114;
+public:
+	CDoorbot();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDoorbot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DOORBOT_H */
diff --git a/engines/titanic/npcs/liftbot.cpp b/engines/titanic/npcs/liftbot.cpp
new file mode 100644
index 0000000..3a0040d
--- /dev/null
+++ b/engines/titanic/npcs/liftbot.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/liftbot.h"
+
+namespace Titanic {
+
+int CLiftBot::_v1;
+int CLiftBot::_v2;
+
+CLiftBot::CLiftBot() : CTrueTalkNPC(), _field108(1) {
+}
+
+void CLiftBot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_field108, indent);
+	file->writeNumberLine(_v2, indent);
+
+	CTrueTalkNPC::save(file, indent);
+}
+
+void CLiftBot::load(SimpleFile *file) {
+	file->readNumber();
+	_v1 = file->readNumber();
+	_field108 = file->readNumber();
+	_v2 = file->readNumber();
+
+	CTrueTalkNPC::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/liftbot.h b/engines/titanic/npcs/liftbot.h
new file mode 100644
index 0000000..f18fd7f
--- /dev/null
+++ b/engines/titanic/npcs/liftbot.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LIFTBOT_H
+#define TITANIC_LIFTBOT_H
+
+#include "titanic/npcs/true_talk_npc.h"
+
+namespace Titanic {
+
+class CLiftBot : public CTrueTalkNPC {
+private:
+	static int _v1;
+	static int _v2;
+private:
+	int _field108;
+public:
+	CLiftBot();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLiftBot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LIFTBOT_H */
diff --git a/engines/titanic/npcs/maitre_d.cpp b/engines/titanic/npcs/maitre_d.cpp
new file mode 100644
index 0000000..d100a0b
--- /dev/null
+++ b/engines/titanic/npcs/maitre_d.cpp
@@ -0,0 +1,68 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/maitre_d.h"
+
+namespace Titanic {
+
+int CMaitreD::_v1;
+
+CMaitreD::CMaitreD() : CTrueTalkNPC(),
+	_string2("z#40.wav"), _string3("z#40.wav"), _field108(0), _field118(1),
+	_field11C(0), _field12C(0), _field130(1), _field134(0), _field138(0) {
+}
+
+void CMaitreD::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field108, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_field118, indent);
+	file->writeNumberLine(_field11C, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeNumberLine(_field12C, indent);
+	file->writeNumberLine(_field130, indent);
+
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_field134, indent);
+	file->writeNumberLine(_field138, indent);
+
+	CTrueTalkNPC::save(file, indent);
+}
+
+void CMaitreD::load(SimpleFile *file) {
+	file->readNumber();
+	_field108 = file->readNumber();
+	_string2 = file->readString();
+	_field118 = file->readNumber();
+	_field11C = file->readNumber();
+	_string3 = file->readString();
+	_field12C = file->readNumber();
+	_field130 = file->readNumber();
+
+	_v1 = file->readNumber();
+	_field134 = file->readNumber();
+	_field138 = file->readNumber();
+
+	CTrueTalkNPC::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/maitre_d.h b/engines/titanic/npcs/maitre_d.h
new file mode 100644
index 0000000..f44d6ee
--- /dev/null
+++ b/engines/titanic/npcs/maitre_d.h
@@ -0,0 +1,64 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MAITRED_H
+#define TITANIC_MAITRED_H
+
+#include "titanic/npcs/true_talk_npc.h"
+
+namespace Titanic {
+
+class CMaitreD : public CTrueTalkNPC {
+private:
+	static int _v1;
+private:
+	int _field108;
+	CString _string2;
+	int _field118;
+	int _field11C;
+	CString _string3;
+	int _field12C;
+	int _field130;
+	int _field134;
+	int _field138;
+public:
+	CMaitreD();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMaitreD"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MAITRED_H */
diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
new file mode 100644
index 0000000..c350079
--- /dev/null
+++ b/engines/titanic/npcs/parrot.cpp
@@ -0,0 +1,143 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/parrot.h"
+
+namespace Titanic {
+
+int CParrot::_v1;
+int CParrot::_v2;
+int CParrot::_v3;
+int CParrot::_v4;
+int CParrot::_v5;
+
+CParrot::CParrot() : CTrueTalkNPC() {
+	_field108 = 0;
+	_string2 = "CarryParrot";
+	_field118 = 1;
+	_field11C = 25;
+	_field120 = 0;
+	_field124 = 73;
+	_field128 = 58;
+	_field12C = 0;
+	_field130 = 0;
+	_field134 = 0;
+	_field138 = 851;
+	_field13C = 851;
+	_field140 = 265;
+	_field144 = 274;
+	_field148 = 726;
+	_field14C = 730;
+	_field150 = 510;
+	_field154 = 570;
+	_field158 = 569;
+	_field15C = 689;
+	_field160 = 690;
+	_field164 = 725;
+	_field168 = 375;
+	_field16C = 508;
+	_field170 = 363;
+	_field174 = 375;
+	_field178 = 303;
+	_field17C = 313;
+	_field180 = 279;
+	_field184 = 302;
+	_field188 = 260;
+	_field18C = 264;
+	_field190 = 315;
+	_field194 = 327;
+	_field198 = 330;
+	_field19C = 360;
+	_field1A0 = 175;
+	_field1A4 = 259;
+	_field1A8 = 175;
+	_field1AC = 175;
+	_field1B0 = 162;
+	_field1B4 = 175;
+	_field1B8 = 150;
+	_field1BC = 162;
+	_field1C0 = 135;
+	_field1C4 = 150;
+	_field1C8 = 95;
+	_field1CC = 135;
+	_field1D0 = 76;
+	_field1D4 = 95;
+	_field1D8 = 55;
+	_field1DC = 76;
+	_field1E0 = 30;
+	_field1E4 = 55;
+	_field1E8 = 0;
+	_field1EC = 30;
+
+	_string1 = "z454.dlg";
+	_fieldD4 = 0x13880;
+}
+
+void CParrot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldD4, indent);
+	
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_field108, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+	file->writeNumberLine(_v3, indent);
+	
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_field118, indent);
+	file->writeNumberLine(_field11C, indent);
+	file->writeNumberLine(_field120, indent);
+	file->writeNumberLine(_field124, indent);
+	file->writeNumberLine(_field128, indent);
+	file->writeNumberLine(_field12C, indent);
+	file->writeNumberLine(_field130, indent);
+	file->writeNumberLine(_v4, indent);
+	file->writeNumberLine(_v5, indent);
+
+	CTrueTalkNPC::save(file, indent);
+}
+
+void CParrot::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldD4 = file->readNumber();
+
+	_string1 = file->readString();
+	_field108 = file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+	_v3 = file->readNumber();
+
+	_string2 = file->readString();
+	_field118 = file->readNumber();
+	_field11C = file->readNumber();
+	_field120 = file->readNumber();
+	_field124 = file->readNumber();
+	_field128 = file->readNumber();
+	_field12C = file->readNumber();
+	_field130 = file->readNumber();
+	_v4 = file->readNumber();
+	_v5 = file->readNumber();
+
+	CTrueTalkNPC::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/parrot.h b/engines/titanic/npcs/parrot.h
new file mode 100644
index 0000000..991066e
--- /dev/null
+++ b/engines/titanic/npcs/parrot.h
@@ -0,0 +1,115 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PARROT_H
+#define TITANIC_PARROT_H
+
+#include "titanic/npcs/true_talk_npc.h"
+
+namespace Titanic {
+
+class CParrot : public CTrueTalkNPC {
+private:
+	static int _v1;
+	static int _v2;
+	static int _v3;
+	static int _v4;
+	static int _v5;
+private:
+	int _field108;
+	CString _string2;
+	int _field118;
+	int _field11C;
+	int _field120;
+	int _field124;
+	int _field128;
+	int _field12C;
+	int _field130;
+	int _field134;
+	int _field138;
+	int _field13C;
+	int _field140;
+	int _field144;
+	int _field148;
+	int _field14C;
+	int _field150;
+	int _field154;
+	int _field158;
+	int _field15C;
+	int _field160;
+	int _field164;
+	int _field168;
+	int _field16C;
+	int _field170;
+	int _field174;
+	int _field178;
+	int _field17C;
+	int _field180;
+	int _field184;
+	int _field188;
+	int _field18C;
+	int _field190;
+	int _field194;
+	int _field198;
+	int _field19C;
+	int _field1A0;
+	int _field1A4;
+	int _field1A8;
+	int _field1AC;
+	int _field1B0;
+	int _field1B4;
+	int _field1B8;
+	int _field1BC;
+	int _field1C0;
+	int _field1C4;
+	int _field1C8;
+	int _field1CC;
+	int _field1D0;
+	int _field1D4;
+	int _field1D8;
+	int _field1DC;
+	int _field1E0;
+	int _field1E4;
+	int _field1E8;
+	int _field1EC;
+public:
+	CParrot();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CParrot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PARROT_H */


Commit: f2cb4a6d98d914aa0557f35c84d3052d9739c5d5
    https://github.com/scummvm/scummvm/commit/f2cb4a6d98d914aa0557f35c84d3052d9739c5d5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-25T22:08:30-05:00

Commit Message:
TITANIC: Implement non-TrueTalk character classes

Changed paths:
  A engines/titanic/npcs/mobile.cpp
  A engines/titanic/npcs/mobile.h
  A engines/titanic/npcs/starlings.cpp
  A engines/titanic/npcs/starlings.h
  A engines/titanic/npcs/titania.cpp
  A engines/titanic/npcs/titania.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 8f7c386..758c56c 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -42,8 +42,11 @@
 #include "titanic/npcs/doorbot.h"
 #include "titanic/npcs/liftbot.h"
 #include "titanic/npcs/maitre_d.h"
+#include "titanic/npcs/mobile.h"
 #include "titanic/npcs/parrot.h"
+#include "titanic/npcs/starlings.h"
 #include "titanic/npcs/succubus.h"
+#include "titanic/npcs/titania.h"
 
 namespace Titanic {
 
@@ -64,6 +67,7 @@ DEFFN(CLiftBot);
 DEFFN(CLinkItem);
 DEFFN(CMaitreD);
 DEFFN(CMessageTarget);
+DEFFN(CMobile);
 DEFFN(CMovieClip);
 DEFFN(CMovieClipList);
 DEFFN(CNodeItem);
@@ -72,8 +76,10 @@ DEFFN(CPETPosition);
 DEFFN(CProjectItem);
 DEFFN(CRoomItem);
 DEFFN(CServiceElevatorDoor);
+DEFFN(CStarlings);
 DEFFN(CSUBGlass);
 DEFFN(CSuccUBus);
+DEFFN(CTitania);
 DEFFN(CTreeItem);
 DEFFN(CViewItem);
 
@@ -90,6 +96,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CLinkItem);
 	ADDFN(CMaitreD);
 	ADDFN(CMessageTarget);
+	ADDFN(CMobile);
 	ADDFN(CMovieClip);
 	ADDFN(CMovieClipList);
 	ADDFN(CNodeItem);
@@ -98,8 +105,10 @@ void CSaveableObject::initClassList() {
 	ADDFN(CProjectItem);
 	ADDFN(CRoomItem);
 	ADDFN(CServiceElevatorDoor);
+	ADDFN(CStarlings);
 	ADDFN(CSUBGlass);
 	ADDFN(CSuccUBus);
+	ADDFN(CTitania);
 	ADDFN(CTreeItem);
 	ADDFN(CViewItem);
 }
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 1d94289..3fadf67 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -44,8 +44,11 @@ MODULE_OBJS := \
 	npcs/doorbot.o \
 	npcs/liftbot.o \
 	npcs/maitre_d.o \
+	npcs/mobile.o \
 	npcs/parrot.o \
+	npcs/starlings.o \
 	npcs/succubus.o \
+	npcs/titania.o \
 	npcs/true_talk_npc.o
 
 # This module can be built as a plugin
diff --git a/engines/titanic/npcs/mobile.cpp b/engines/titanic/npcs/mobile.cpp
new file mode 100644
index 0000000..37c1d13
--- /dev/null
+++ b/engines/titanic/npcs/mobile.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/mobile.h"
+
+namespace Titanic {
+
+CMobile::CMobile() : CCharacter(), _fieldDC(0) {
+}
+
+void CMobile::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writePoint(_pos1, indent);
+	file->writeNumberLine(_fieldDC, indent);
+
+	CCharacter::save(file, indent);
+}
+
+void CMobile::load(SimpleFile *file) {
+	file->readNumber();
+	_pos1 = file->readPoint();
+	_fieldDC = file->readNumber();
+
+	CCharacter::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/mobile.h b/engines/titanic/npcs/mobile.h
new file mode 100644
index 0000000..9c74170
--- /dev/null
+++ b/engines/titanic/npcs/mobile.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOBILE_H
+#define TITANIC_MOBILE_H
+
+#include "titanic/npcs/character.h"
+
+namespace Titanic {
+
+class CMobile : public CCharacter {
+private:
+	Common::Point _pos1;
+	int _fieldDC;
+public:
+	CMobile();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMobile"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOBILE_H */
diff --git a/engines/titanic/npcs/starlings.cpp b/engines/titanic/npcs/starlings.cpp
new file mode 100644
index 0000000..dcb9fbd
--- /dev/null
+++ b/engines/titanic/npcs/starlings.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/starlings.h"
+
+namespace Titanic {
+
+int CStarlings::_v1;
+
+CStarlings::CStarlings() : CCharacter() {
+}
+
+void CStarlings::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+
+	CCharacter::save(file, indent);
+}
+
+void CStarlings::load(SimpleFile *file) {
+	file->readNumber();
+	_v1 = file->readNumber();
+
+	CCharacter::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/starlings.h b/engines/titanic/npcs/starlings.h
new file mode 100644
index 0000000..472d0f5
--- /dev/null
+++ b/engines/titanic/npcs/starlings.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STARLINGS_H
+#define TITANIC_STARLINGS_H
+
+#include "titanic/npcs/character.h"
+
+namespace Titanic {
+
+class CStarlings : public CCharacter {
+private:
+	static int _v1;
+public:
+	CStarlings();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CStarlings"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STARLING_H */
diff --git a/engines/titanic/npcs/titania.cpp b/engines/titanic/npcs/titania.cpp
new file mode 100644
index 0000000..3a71d7f
--- /dev/null
+++ b/engines/titanic/npcs/titania.cpp
@@ -0,0 +1,77 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/titania.h"
+
+namespace Titanic {
+
+CTitania::CTitania() : CCharacter() {
+	_fieldD4 = 0;
+	_fieldD8 = 0;
+	_fieldE0 = 0;
+	_fieldE4 = 0;
+	_fieldE8 = 0;
+	_fieldEC = 0;
+	_fieldF0 = 0;
+	_fieldF4 = 0;
+	_fieldF8 = 0;
+	_fieldFC = 0;
+	_field100 = 1;
+}
+
+void CTitania::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldD4, indent);
+	file->writeNumberLine(_fieldD8, indent);
+	file->writeNumberLine(_fieldDC, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_fieldF4, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_fieldFC, indent);
+	file->writeNumberLine(_field100, indent);
+
+	CCharacter::save(file, indent);
+}
+
+void CTitania::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldD4 = file->readNumber();
+	_fieldD8 = file->readNumber();
+	_fieldDC = file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_fieldF0 = file->readNumber();
+	_fieldF4 = file->readNumber();
+	_fieldF8 = file->readNumber();
+	_fieldFC = file->readNumber();
+	_field100 = file->readNumber();
+
+	CCharacter::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/titania.h b/engines/titanic/npcs/titania.h
new file mode 100644
index 0000000..ee61222
--- /dev/null
+++ b/engines/titanic/npcs/titania.h
@@ -0,0 +1,65 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TITANIA_H
+#define TITANIC_TITANIA_H
+
+#include "titanic/npcs/character.h"
+
+namespace Titanic {
+
+class CTitania : public CCharacter {
+private:
+	int _fieldD4;
+	int _fieldD8;
+	int _fieldDC;
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+	int _fieldF4;
+	int _fieldF8;
+	int _fieldFC;
+	int _field100;
+public:
+	CTitania();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTitania"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TITANIA_H */


Commit: 5c77a55328f98f1df79de86f82135ed60ee6f4fd
    https://github.com/scummvm/scummvm/commit/5c77a55328f98f1df79de86f82135ed60ee6f4fd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-25T22:21:43-05:00

Commit Message:
TITANIC: Implemented CBackground class

Changed paths:
  A engines/titanic/core/background.cpp
  A engines/titanic/core/background.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/background.cpp b/engines/titanic/core/background.cpp
new file mode 100644
index 0000000..63aaf30
--- /dev/null
+++ b/engines/titanic/core/background.cpp
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+CBackground::CBackground() : CGameObject(), _fieldBC(0), _fieldC0(0), _fieldDC(0) {
+}
+
+void CBackground::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldDC, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CBackground::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_fieldDC = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/background.h b/engines/titanic/core/background.h
new file mode 100644
index 0000000..a473525
--- /dev/null
+++ b/engines/titanic/core/background.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BACKGROUND_H
+#define TITANIC_BACKGROUND_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CBackground : public CGameObject {
+protected:
+	int _fieldBC;
+	int _fieldC0;
+	CString _string1;
+	CString _string2;
+	int _fieldDC;
+public:
+	CBackground();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBackground"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BACKGROUND_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 758c56c..551cd47 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/core/saveable_object.h"
+#include "titanic/core/background.h"
 #include "titanic/core/file_item.h"
 #include "titanic/core/link_item.h"
 #include "titanic/core/list.h"
@@ -57,6 +58,7 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 #define ADDFN(T) (*_classList)[#T] = Function##T
 
 DEFFN(CAnnounce);
+DEFFN(CBackground);
 DEFFN(CBarbot);
 DEFFN(CBellBot);
 DEFFN(CDeskbot);
@@ -86,6 +88,7 @@ DEFFN(CViewItem);
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
 	ADDFN(CAnnounce);
+	ADDFN(CBackground);
 	ADDFN(CBarbot);
 	ADDFN(CBellBot);
 	ADDFN(CDeskbot);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 3fadf67..74206ea 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -16,6 +16,7 @@ MODULE_OBJS := \
 	titanic.o \
 	video_surface.o \
 	core/auto_sound_event.o \
+	core/background.o \
 	core/dont_save_file_item.o \
 	core/file_item.o \
 	core/game_object.o \


Commit: 83ad770f498b5c99b4667b838b8c7a8def087e71
    https://github.com/scummvm/scummvm/commit/83ad770f498b5c99b4667b838b8c7a8def087e71
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-25T23:49:10-05:00

Commit Message:
TITANIC: Implement CMovePlayerTo class hierarchy

Changed paths:
  A engines/titanic/messages/enter_bomb_room.cpp
  A engines/titanic/messages/enter_bomb_room.h
  A engines/titanic/messages/exit_arboretum.cpp
  A engines/titanic/messages/exit_arboretum.h
  A engines/titanic/messages/exit_bridge.cpp
  A engines/titanic/messages/exit_bridge.h
  A engines/titanic/messages/exit_state_room.cpp
  A engines/titanic/messages/exit_state_room.h
  A engines/titanic/messages/exit_titania.cpp
  A engines/titanic/messages/exit_titania.h
  A engines/titanic/messages/move_player_in_parrot_room.cpp
  A engines/titanic/messages/move_player_in_parrot_room.h
  A engines/titanic/messages/move_player_to.cpp
  A engines/titanic/messages/move_player_to.h
  A engines/titanic/messages/move_player_to_from.cpp
  A engines/titanic/messages/move_player_to_from.h
  A engines/titanic/messages/multi_move.cpp
  A engines/titanic/messages/multi_move.h
  A engines/titanic/messages/pan_from_pel.cpp
  A engines/titanic/messages/pan_from_pel.h
  A engines/titanic/messages/restaurant_pan_handler.cpp
  A engines/titanic/messages/restaurant_pan_handler.h
  A engines/titanic/messages/restricted_move.cpp
  A engines/titanic/messages/restricted_move.h
  A engines/titanic/messages/trip_down_canal.cpp
  A engines/titanic/messages/trip_down_canal.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 551cd47..382023d 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -37,6 +37,20 @@
 #include "titanic/game/room_item.h"
 #include "titanic/game/service_elevator_door.h"
 #include "titanic/game/sub_glass.h"
+
+#include "titanic/messages/enter_bomb_room.h"
+#include "titanic/messages/exit_arboretum.h"
+#include "titanic/messages/exit_bridge.h"
+#include "titanic/messages/exit_state_room.h"
+#include "titanic/messages/move_player_in_parrot_room.h"
+#include "titanic/messages/move_player_to.h"
+#include "titanic/messages/move_player_to_from.h"
+#include "titanic/messages/multi_move.h"
+#include "titanic/messages/pan_from_pel.h"
+#include "titanic/messages/restaurant_pan_handler.h"
+#include "titanic/messages/restricted_move.h"
+#include "titanic/messages/trip_down_canal.h"
+
 #include "titanic/npcs/barbot.h"
 #include "titanic/npcs/bellbot.h"
 #include "titanic/npcs/deskbot.h"
@@ -57,63 +71,93 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 #define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
 #define ADDFN(T) (*_classList)[#T] = Function##T
 
-DEFFN(CAnnounce);
 DEFFN(CBackground);
-DEFFN(CBarbot);
-DEFFN(CBellBot);
-DEFFN(CDeskbot);
-DEFFN(CDoorbot);
 DEFFN(CFileItem);
 DEFFN(CFileListItem);
-DEFFN(CLiftBot);
 DEFFN(CLinkItem);
-DEFFN(CMaitreD);
 DEFFN(CMessageTarget);
-DEFFN(CMobile);
 DEFFN(CMovieClip);
 DEFFN(CMovieClipList);
 DEFFN(CNodeItem);
-DEFFN(CParrot);
-DEFFN(CPETPosition);
 DEFFN(CProjectItem);
+DEFFN(CTreeItem);
+DEFFN(CViewItem);
+
+DEFFN(CAnnounce);
+DEFFN(CPETPosition);
 DEFFN(CRoomItem);
 DEFFN(CServiceElevatorDoor);
-DEFFN(CStarlings);
 DEFFN(CSUBGlass);
+
+DEFFN(CEnterBombRoom);
+DEFFN(CExitArboretum);
+DEFFN(CExitBridge);
+DEFFN(CExitStateRoom);
+DEFFN(CMovePlayerInParrotRoom);
+DEFFN(CMovePlayerTo);
+DEFFN(CMovePlayerToFrom);
+DEFFN(CMultiMove);
+DEFFN(CPanFromPel);
+DEFFN(CRestaurantPanHandler);
+DEFFN(CRestrictedMove);
+DEFFN(CTripDownCanal);
+
+DEFFN(CBarbot);
+DEFFN(CBellBot);
+DEFFN(CDeskbot);
+DEFFN(CDoorbot);
+DEFFN(CLiftBot);
+DEFFN(CMaitreD);
+DEFFN(CMobile);
+DEFFN(CParrot);
+DEFFN(CStarlings);
 DEFFN(CSuccUBus);
 DEFFN(CTitania);
-DEFFN(CTreeItem);
-DEFFN(CViewItem);
 
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
-	ADDFN(CAnnounce);
 	ADDFN(CBackground);
-	ADDFN(CBarbot);
-	ADDFN(CBellBot);
-	ADDFN(CDeskbot);
-	ADDFN(CDoorbot);
 	ADDFN(CFileItem);
 	ADDFN(CFileListItem);
-	ADDFN(CLiftBot);
 	ADDFN(CLinkItem);
-	ADDFN(CMaitreD);
 	ADDFN(CMessageTarget);
-	ADDFN(CMobile);
 	ADDFN(CMovieClip);
 	ADDFN(CMovieClipList);
 	ADDFN(CNodeItem);
-	ADDFN(CParrot);
-	ADDFN(CPETPosition);
 	ADDFN(CProjectItem);
+	ADDFN(CTreeItem);
+	ADDFN(CViewItem);
+
+	ADDFN(CAnnounce);
+	ADDFN(CPETPosition);
 	ADDFN(CRoomItem);
 	ADDFN(CServiceElevatorDoor);
-	ADDFN(CStarlings);
 	ADDFN(CSUBGlass);
+
+	ADDFN(CEnterBombRoom);
+	ADDFN(CExitArboretum);
+	ADDFN(CExitBridge);
+	ADDFN(CExitStateRoom);
+	ADDFN(CMovePlayerInParrotRoom);
+	ADDFN(CMovePlayerTo);
+	ADDFN(CMovePlayerToFrom);
+	ADDFN(CMultiMove);
+	ADDFN(CPanFromPel);
+	ADDFN(CRestaurantPanHandler);
+	ADDFN(CRestrictedMove);
+	ADDFN(CTripDownCanal);
+
+	ADDFN(CBarbot);
+	ADDFN(CBellBot);
+	ADDFN(CDeskbot);
+	ADDFN(CDoorbot);
+	ADDFN(CMaitreD);
+	ADDFN(CLiftBot);
+	ADDFN(CMobile);
+	ADDFN(CParrot);
+	ADDFN(CStarlings);
 	ADDFN(CSuccUBus);
 	ADDFN(CTitania);
-	ADDFN(CTreeItem);
-	ADDFN(CViewItem);
 }
 
 void CSaveableObject::freeClassList() {
diff --git a/engines/titanic/messages/enter_bomb_room.cpp b/engines/titanic/messages/enter_bomb_room.cpp
new file mode 100644
index 0000000..049c3f4
--- /dev/null
+++ b/engines/titanic/messages/enter_bomb_room.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/enter_bomb_room.h"
+
+namespace Titanic {
+
+CEnterBombRoom::CEnterBombRoom() : CMovePlayerTo(), _fieldC8(0) {
+}
+
+void CEnterBombRoom::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CMovePlayerTo::save(file, indent);
+}
+
+void CEnterBombRoom::load(SimpleFile *file) {
+	file->readNumber();
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/enter_bomb_room.h b/engines/titanic/messages/enter_bomb_room.h
new file mode 100644
index 0000000..3ec5616
--- /dev/null
+++ b/engines/titanic/messages/enter_bomb_room.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_BOMB_ROOM_H
+#define TITANIC_ENTER_BOMB_ROOM_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CEnterBombRoom : public CMovePlayerTo {
+protected:
+	int _fieldC8;
+public:
+	CEnterBombRoom();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEnterBombRoom"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_BOMB_ROOM_H */
diff --git a/engines/titanic/messages/exit_arboretum.cpp b/engines/titanic/messages/exit_arboretum.cpp
new file mode 100644
index 0000000..0a50377
--- /dev/null
+++ b/engines/titanic/messages/exit_arboretum.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/exit_arboretum.h"
+
+namespace Titanic {
+
+CExitArboretum::CExitArboretum() : CMovePlayerTo(), 
+		_fieldC8(0), _fieldCC(0), _fieldD0(1) {
+}
+
+void CExitArboretum::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeNumberLine(_fieldD0, indent);
+
+	CMovePlayerTo::save(file, indent);
+}
+
+void CExitArboretum::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+	_fieldD0 = file->readNumber();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/exit_arboretum.h b/engines/titanic/messages/exit_arboretum.h
new file mode 100644
index 0000000..4ee135e
--- /dev/null
+++ b/engines/titanic/messages/exit_arboretum.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXIT_ARBORETUM_H
+#define TITANIC_EXIT_ARBORETUM_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CExitArboretum : public CMovePlayerTo {
+protected:
+	int _fieldC8;
+	int _fieldCC;
+	int _fieldD0;
+public:
+	CExitArboretum();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CExitArboretum"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BACKGROUND_H */
diff --git a/engines/titanic/messages/exit_bridge.cpp b/engines/titanic/messages/exit_bridge.cpp
new file mode 100644
index 0000000..27f923b
--- /dev/null
+++ b/engines/titanic/messages/exit_bridge.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/exit_bridge.h"
+
+namespace Titanic {
+
+CExitBridge::CExitBridge() : CMovePlayerTo() {
+}
+
+void CExitBridge::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CMovePlayerTo::save(file, indent);
+}
+
+void CExitBridge::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/exit_bridge.h b/engines/titanic/messages/exit_bridge.h
new file mode 100644
index 0000000..6d65a00
--- /dev/null
+++ b/engines/titanic/messages/exit_bridge.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXIT_BRIDGE_H
+#define TITANIC_EXIT_BRIDGE_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CExitBridge : public CMovePlayerTo {
+private:
+	CString _string1;
+public:
+	CExitBridge();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CExitBridge"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EXIT_BRIDGE_H */
diff --git a/engines/titanic/messages/exit_state_room.cpp b/engines/titanic/messages/exit_state_room.cpp
new file mode 100644
index 0000000..f1acd91
--- /dev/null
+++ b/engines/titanic/messages/exit_state_room.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/exit_state_room.h"
+
+namespace Titanic {
+
+CExitStateRoom::CExitStateRoom() : CMovePlayerTo(), _fieldC8(0) {
+}
+
+void CExitStateRoom::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CMovePlayerTo::save(file, indent);
+}
+
+void CExitStateRoom::load(SimpleFile *file) {
+	file->readNumber();
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/exit_state_room.h b/engines/titanic/messages/exit_state_room.h
new file mode 100644
index 0000000..12adcfb
--- /dev/null
+++ b/engines/titanic/messages/exit_state_room.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXIT_STATE_ROOM_H
+#define TITANIC_EXIT_STATE_ROOM_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CExitStateRoom : public CMovePlayerTo {
+protected:
+	int _fieldC8;
+public:
+	CExitStateRoom();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CExitStateRoom"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EXIT_STATE_ROOM_H */
diff --git a/engines/titanic/messages/exit_titania.cpp b/engines/titanic/messages/exit_titania.cpp
new file mode 100644
index 0000000..e94d0cd
--- /dev/null
+++ b/engines/titanic/messages/exit_titania.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/exit_titania.h"
+
+namespace Titanic {
+
+CExitTitania::CExitTitania() : CMovePlayerTo(), _fieldC8(0),
+		_string1("NULL"), _string2("NULL"), _string3("NULL") {
+}
+
+void CExitTitania::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string3, indent);
+
+	CMovePlayerTo::save(file, indent);
+}
+
+void CExitTitania::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldC8 = file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_string3 = file->readString();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/exit_titania.h b/engines/titanic/messages/exit_titania.h
new file mode 100644
index 0000000..529886a
--- /dev/null
+++ b/engines/titanic/messages/exit_titania.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXIT_TITANIA_H
+#define TITANIC_EXIT_TITANIA_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CExitTitania : public CMovePlayerTo {
+private:
+	int _fieldC8;
+	CString _string1;
+	CString _string2;
+	CString _string3;
+public:
+	CExitTitania();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CExitTitania"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EXIT_TITANIA_H */
diff --git a/engines/titanic/messages/move_player_in_parrot_room.cpp b/engines/titanic/messages/move_player_in_parrot_room.cpp
new file mode 100644
index 0000000..b1040bf
--- /dev/null
+++ b/engines/titanic/messages/move_player_in_parrot_room.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/move_player_in_parrot_room.h"
+
+namespace Titanic {
+
+CMovePlayerInParrotRoom::CMovePlayerInParrotRoom() : CMovePlayerTo() {
+}
+
+void CMovePlayerInParrotRoom::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CMovePlayerInParrotRoom::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/move_player_in_parrot_room.h b/engines/titanic/messages/move_player_in_parrot_room.h
new file mode 100644
index 0000000..f4e5779
--- /dev/null
+++ b/engines/titanic/messages/move_player_in_parrot_room.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVE_PLAYER_IN_PARROT_ROOM_H
+#define TITANIC_MOVE_PLAYER_IN_PARROT_ROOM_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CMovePlayerInParrotRoom : public CMovePlayerTo {
+public:
+	CMovePlayerInParrotRoom();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMovePlayerInParrotRoom"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVE_PLAYER_IN_PARROT_ROOM_H */
diff --git a/engines/titanic/messages/move_player_to.cpp b/engines/titanic/messages/move_player_to.cpp
new file mode 100644
index 0000000..66a71e8
--- /dev/null
+++ b/engines/titanic/messages/move_player_to.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+CMovePlayerTo::CMovePlayerTo() : CGameObject() {
+}
+
+void CMovePlayerTo::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_destination, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CMovePlayerTo::load(SimpleFile *file) {
+	file->readNumber();
+	_destination = file->readString();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/move_player_to.h b/engines/titanic/messages/move_player_to.h
new file mode 100644
index 0000000..aa785b9
--- /dev/null
+++ b/engines/titanic/messages/move_player_to.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVE_PLAYER_TO_H
+#define TITANIC_MOVE_PLAYER_TO_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CMovePlayerTo : public CGameObject {
+protected:
+	CString _destination;
+public:
+	CMovePlayerTo();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMovePlayerTo"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVE_PLAYER_TO_H */
diff --git a/engines/titanic/messages/move_player_to_from.cpp b/engines/titanic/messages/move_player_to_from.cpp
new file mode 100644
index 0000000..77c74d5
--- /dev/null
+++ b/engines/titanic/messages/move_player_to_from.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/move_player_to_from.h"
+
+namespace Titanic {
+
+CMovePlayerToFrom::CMovePlayerToFrom() : CGameObject() {
+}
+
+void CMovePlayerToFrom::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CMovePlayerToFrom::load(SimpleFile *file) {
+	file->readNumber();
+	_string2 = file->readString();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/move_player_to_from.h b/engines/titanic/messages/move_player_to_from.h
new file mode 100644
index 0000000..82fe5db
--- /dev/null
+++ b/engines/titanic/messages/move_player_to_from.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVE_PLAYER_TO_FROM_H
+#define TITANIC_MOVE_PLAYER_TO_FROM_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CMovePlayerToFrom : public CGameObject {
+private:
+	CString _string2;
+public:
+	CMovePlayerToFrom();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMovePlayerToFrom"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVE_PLAYER_TO_FROM_H */
diff --git a/engines/titanic/messages/multi_move.cpp b/engines/titanic/messages/multi_move.cpp
new file mode 100644
index 0000000..dd1948c
--- /dev/null
+++ b/engines/titanic/messages/multi_move.cpp
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/multi_move.h"
+
+namespace Titanic {
+
+CMultiMove::CMultiMove() : CMovePlayerTo() {
+}
+
+void CMultiMove::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeQuotedLine(_string4, indent);
+	file->writeQuotedLine(_string5, indent);
+
+	CMovePlayerTo::save(file, indent);
+}
+
+void CMultiMove::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_string3 = file->readString();
+	_string5 = file->readString();
+	_string4 = file->readString();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/multi_move.h b/engines/titanic/messages/multi_move.h
new file mode 100644
index 0000000..2cc4f4e
--- /dev/null
+++ b/engines/titanic/messages/multi_move.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MULTI_MOVE_H
+#define TITANIC_MULTI_MOVE_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CMultiMove : public CMovePlayerTo {
+private:
+	CString _string1;
+	CString _string2;
+	CString _string3;
+	CString _string4;
+	CString _string5;
+public:
+	CMultiMove();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMultiMove"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MULTI_MOVE_H */
diff --git a/engines/titanic/messages/pan_from_pel.cpp b/engines/titanic/messages/pan_from_pel.cpp
new file mode 100644
index 0000000..718927f
--- /dev/null
+++ b/engines/titanic/messages/pan_from_pel.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/pan_from_pel.h"
+
+namespace Titanic {
+
+CPanFromPel::CPanFromPel() : CMovePlayerTo(), _fieldC8(0) {
+}
+
+void CPanFromPel::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeQuotedLine(_string1, indent);
+
+	CMovePlayerTo::save(file, indent);
+}
+
+void CPanFromPel::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldC8 = file->readNumber();
+	_string1 = file->readString();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/pan_from_pel.h b/engines/titanic/messages/pan_from_pel.h
new file mode 100644
index 0000000..abb565c
--- /dev/null
+++ b/engines/titanic/messages/pan_from_pel.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PAN_FROM_PEL_H
+#define TITANIC_PAN_FROM_PEL_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CPanFromPel : public CMovePlayerTo {
+protected:
+	int _fieldC8;
+	CString _string1;
+public:
+	CPanFromPel();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPanFromPel"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PAN_FROM_PEL_H */
diff --git a/engines/titanic/messages/restaurant_pan_handler.cpp b/engines/titanic/messages/restaurant_pan_handler.cpp
new file mode 100644
index 0000000..14fd383
--- /dev/null
+++ b/engines/titanic/messages/restaurant_pan_handler.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/restaurant_pan_handler.h"
+
+namespace Titanic {
+
+CRestaurantPanHandler::CRestaurantPanHandler() : CMovePlayerTo() {
+}
+
+void CRestaurantPanHandler::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	CMovePlayerTo::save(file, indent);
+}
+
+void CRestaurantPanHandler::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/restaurant_pan_handler.h b/engines/titanic/messages/restaurant_pan_handler.h
new file mode 100644
index 0000000..dd757be
--- /dev/null
+++ b/engines/titanic/messages/restaurant_pan_handler.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RESTAURANT_PAN_HANDLER_H
+#define TITANIC_RESTAURANT_PAN_HANDLER_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CRestaurantPanHandler : public CMovePlayerTo {
+protected:
+	CString _string1;
+	CString _string2;
+public:
+	CRestaurantPanHandler();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CRestaurantPanHandler"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RESTAURANT_PAN_HANDLER_H */
diff --git a/engines/titanic/messages/restricted_move.cpp b/engines/titanic/messages/restricted_move.cpp
new file mode 100644
index 0000000..147cf11
--- /dev/null
+++ b/engines/titanic/messages/restricted_move.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/restricted_move.h"
+
+namespace Titanic {
+
+CRestrictedMove::CRestrictedMove() : CMovePlayerTo(), _fieldC8(0) {
+}
+
+void CRestrictedMove::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+
+	CMovePlayerTo::save(file, indent);
+}
+
+void CRestrictedMove::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldC8 = file->readNumber();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/restricted_move.h b/engines/titanic/messages/restricted_move.h
new file mode 100644
index 0000000..5feae29
--- /dev/null
+++ b/engines/titanic/messages/restricted_move.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RESTRICTED_MOVE_H
+#define TITANIC_RESTRICTED_MOVE_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CRestrictedMove : public CMovePlayerTo {
+protected:
+	int _fieldC8;
+public:
+	CRestrictedMove();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CRestrictedMove"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RESTRICTED_MOVE_H */
diff --git a/engines/titanic/messages/trip_down_canal.cpp b/engines/titanic/messages/trip_down_canal.cpp
new file mode 100644
index 0000000..be5f283
--- /dev/null
+++ b/engines/titanic/messages/trip_down_canal.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/trip_down_canal.h"
+
+namespace Titanic {
+
+CTripDownCanal::CTripDownCanal() : CMovePlayerTo() {
+}
+
+void CTripDownCanal::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CMovePlayerTo::save(file, indent);
+}
+
+void CTripDownCanal::load(SimpleFile *file) {
+	file->readNumber();
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/trip_down_canal.h b/engines/titanic/messages/trip_down_canal.h
new file mode 100644
index 0000000..117ce94
--- /dev/null
+++ b/engines/titanic/messages/trip_down_canal.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TRIP_DOWN_CANAL_H
+#define TITANIC_TRIP_DOWN_CANAL_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CTripDownCanal : public CMovePlayerTo {
+public:
+	CTripDownCanal();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTripDownCanal"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TRIP_DOWN_CANAL_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 74206ea..66157be 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -38,6 +38,19 @@ MODULE_OBJS := \
 	game/room_item.o \
 	game/service_elevator_door.o \
 	game/sub_glass.o \
+	messages/enter_bomb_room.o \
+	messages/exit_arboretum.o \
+	messages/exit_bridge.o \
+	messages/exit_state_room.o \
+	messages/exit_titania.o \
+	messages/move_player_in_parrot_room.o \
+	messages/move_player_to_from.o \
+	messages/move_player_to.o \
+	messages/multi_move.o \
+	messages/pan_from_pel.o \
+	messages/restaurant_pan_handler.o \
+	messages/restricted_move.o \
+	messages/trip_down_canal.o \
 	npcs/barbot.o \
 	npcs/bellbot.o \
 	npcs/character.o \


Commit: ba8cbcb229ae4086a6c1940fc0173527bb8fb1ae
    https://github.com/scummvm/scummvm/commit/ba8cbcb229ae4086a6c1940fc0173527bb8fb1ae
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-25T23:52:22-05:00

Commit Message:
TITANIC: Renames messages sub-folder to moves

Changed paths:
  A engines/titanic/moves/enter_bomb_room.cpp
  A engines/titanic/moves/enter_bomb_room.h
  A engines/titanic/moves/exit_arboretum.cpp
  A engines/titanic/moves/exit_arboretum.h
  A engines/titanic/moves/exit_bridge.cpp
  A engines/titanic/moves/exit_bridge.h
  A engines/titanic/moves/exit_state_room.cpp
  A engines/titanic/moves/exit_state_room.h
  A engines/titanic/moves/exit_titania.cpp
  A engines/titanic/moves/exit_titania.h
  A engines/titanic/moves/move_player_in_parrot_room.cpp
  A engines/titanic/moves/move_player_in_parrot_room.h
  A engines/titanic/moves/move_player_to.cpp
  A engines/titanic/moves/move_player_to.h
  A engines/titanic/moves/move_player_to_from.cpp
  A engines/titanic/moves/move_player_to_from.h
  A engines/titanic/moves/multi_move.cpp
  A engines/titanic/moves/multi_move.h
  A engines/titanic/moves/pan_from_pel.cpp
  A engines/titanic/moves/pan_from_pel.h
  A engines/titanic/moves/restaurant_pan_handler.cpp
  A engines/titanic/moves/restaurant_pan_handler.h
  A engines/titanic/moves/restricted_move.cpp
  A engines/titanic/moves/restricted_move.h
  A engines/titanic/moves/trip_down_canal.cpp
  A engines/titanic/moves/trip_down_canal.h
  R engines/titanic/messages/enter_bomb_room.cpp
  R engines/titanic/messages/enter_bomb_room.h
  R engines/titanic/messages/exit_arboretum.cpp
  R engines/titanic/messages/exit_arboretum.h
  R engines/titanic/messages/exit_bridge.cpp
  R engines/titanic/messages/exit_bridge.h
  R engines/titanic/messages/exit_state_room.cpp
  R engines/titanic/messages/exit_state_room.h
  R engines/titanic/messages/exit_titania.cpp
  R engines/titanic/messages/exit_titania.h
  R engines/titanic/messages/move_player_in_parrot_room.cpp
  R engines/titanic/messages/move_player_in_parrot_room.h
  R engines/titanic/messages/move_player_to.cpp
  R engines/titanic/messages/move_player_to.h
  R engines/titanic/messages/move_player_to_from.cpp
  R engines/titanic/messages/move_player_to_from.h
  R engines/titanic/messages/multi_move.cpp
  R engines/titanic/messages/multi_move.h
  R engines/titanic/messages/pan_from_pel.cpp
  R engines/titanic/messages/pan_from_pel.h
  R engines/titanic/messages/restaurant_pan_handler.cpp
  R engines/titanic/messages/restaurant_pan_handler.h
  R engines/titanic/messages/restricted_move.cpp
  R engines/titanic/messages/restricted_move.h
  R engines/titanic/messages/trip_down_canal.cpp
  R engines/titanic/messages/trip_down_canal.h



diff --git a/engines/titanic/messages/enter_bomb_room.cpp b/engines/titanic/messages/enter_bomb_room.cpp
deleted file mode 100644
index 049c3f4..0000000
--- a/engines/titanic/messages/enter_bomb_room.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/enter_bomb_room.h"
-
-namespace Titanic {
-
-CEnterBombRoom::CEnterBombRoom() : CMovePlayerTo(), _fieldC8(0) {
-}
-
-void CEnterBombRoom::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CMovePlayerTo::save(file, indent);
-}
-
-void CEnterBombRoom::load(SimpleFile *file) {
-	file->readNumber();
-	CMovePlayerTo::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/enter_bomb_room.h b/engines/titanic/messages/enter_bomb_room.h
deleted file mode 100644
index 3ec5616..0000000
--- a/engines/titanic/messages/enter_bomb_room.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_ENTER_BOMB_ROOM_H
-#define TITANIC_ENTER_BOMB_ROOM_H
-
-#include "titanic/messages/move_player_to.h"
-
-namespace Titanic {
-
-class CEnterBombRoom : public CMovePlayerTo {
-protected:
-	int _fieldC8;
-public:
-	CEnterBombRoom();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEnterBombRoom"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ENTER_BOMB_ROOM_H */
diff --git a/engines/titanic/messages/exit_arboretum.cpp b/engines/titanic/messages/exit_arboretum.cpp
deleted file mode 100644
index 0a50377..0000000
--- a/engines/titanic/messages/exit_arboretum.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/exit_arboretum.h"
-
-namespace Titanic {
-
-CExitArboretum::CExitArboretum() : CMovePlayerTo(), 
-		_fieldC8(0), _fieldCC(0), _fieldD0(1) {
-}
-
-void CExitArboretum::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldC8, indent);
-	file->writeNumberLine(_fieldCC, indent);
-	file->writeNumberLine(_fieldD0, indent);
-
-	CMovePlayerTo::save(file, indent);
-}
-
-void CExitArboretum::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldC8 = file->readNumber();
-	_fieldCC = file->readNumber();
-	_fieldD0 = file->readNumber();
-
-	CMovePlayerTo::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/exit_arboretum.h b/engines/titanic/messages/exit_arboretum.h
deleted file mode 100644
index 4ee135e..0000000
--- a/engines/titanic/messages/exit_arboretum.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_EXIT_ARBORETUM_H
-#define TITANIC_EXIT_ARBORETUM_H
-
-#include "titanic/messages/move_player_to.h"
-
-namespace Titanic {
-
-class CExitArboretum : public CMovePlayerTo {
-protected:
-	int _fieldC8;
-	int _fieldCC;
-	int _fieldD0;
-public:
-	CExitArboretum();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CExitArboretum"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_BACKGROUND_H */
diff --git a/engines/titanic/messages/exit_bridge.cpp b/engines/titanic/messages/exit_bridge.cpp
deleted file mode 100644
index 27f923b..0000000
--- a/engines/titanic/messages/exit_bridge.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/exit_bridge.h"
-
-namespace Titanic {
-
-CExitBridge::CExitBridge() : CMovePlayerTo() {
-}
-
-void CExitBridge::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CMovePlayerTo::save(file, indent);
-}
-
-void CExitBridge::load(SimpleFile *file) {
-	file->readNumber();
-	_string1 = file->readString();
-
-	CMovePlayerTo::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/exit_bridge.h b/engines/titanic/messages/exit_bridge.h
deleted file mode 100644
index 6d65a00..0000000
--- a/engines/titanic/messages/exit_bridge.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_EXIT_BRIDGE_H
-#define TITANIC_EXIT_BRIDGE_H
-
-#include "titanic/messages/move_player_to.h"
-
-namespace Titanic {
-
-class CExitBridge : public CMovePlayerTo {
-private:
-	CString _string1;
-public:
-	CExitBridge();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CExitBridge"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_EXIT_BRIDGE_H */
diff --git a/engines/titanic/messages/exit_state_room.cpp b/engines/titanic/messages/exit_state_room.cpp
deleted file mode 100644
index f1acd91..0000000
--- a/engines/titanic/messages/exit_state_room.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/exit_state_room.h"
-
-namespace Titanic {
-
-CExitStateRoom::CExitStateRoom() : CMovePlayerTo(), _fieldC8(0) {
-}
-
-void CExitStateRoom::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CMovePlayerTo::save(file, indent);
-}
-
-void CExitStateRoom::load(SimpleFile *file) {
-	file->readNumber();
-	CMovePlayerTo::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/exit_state_room.h b/engines/titanic/messages/exit_state_room.h
deleted file mode 100644
index 12adcfb..0000000
--- a/engines/titanic/messages/exit_state_room.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_EXIT_STATE_ROOM_H
-#define TITANIC_EXIT_STATE_ROOM_H
-
-#include "titanic/messages/move_player_to.h"
-
-namespace Titanic {
-
-class CExitStateRoom : public CMovePlayerTo {
-protected:
-	int _fieldC8;
-public:
-	CExitStateRoom();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CExitStateRoom"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_EXIT_STATE_ROOM_H */
diff --git a/engines/titanic/messages/exit_titania.cpp b/engines/titanic/messages/exit_titania.cpp
deleted file mode 100644
index e94d0cd..0000000
--- a/engines/titanic/messages/exit_titania.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/exit_titania.h"
-
-namespace Titanic {
-
-CExitTitania::CExitTitania() : CMovePlayerTo(), _fieldC8(0),
-		_string1("NULL"), _string2("NULL"), _string3("NULL") {
-}
-
-void CExitTitania::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldC8, indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeQuotedLine(_string2, indent);
-	file->writeQuotedLine(_string3, indent);
-
-	CMovePlayerTo::save(file, indent);
-}
-
-void CExitTitania::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldC8 = file->readNumber();
-	_string1 = file->readString();
-	_string2 = file->readString();
-	_string3 = file->readString();
-
-	CMovePlayerTo::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/exit_titania.h b/engines/titanic/messages/exit_titania.h
deleted file mode 100644
index 529886a..0000000
--- a/engines/titanic/messages/exit_titania.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_EXIT_TITANIA_H
-#define TITANIC_EXIT_TITANIA_H
-
-#include "titanic/messages/move_player_to.h"
-
-namespace Titanic {
-
-class CExitTitania : public CMovePlayerTo {
-private:
-	int _fieldC8;
-	CString _string1;
-	CString _string2;
-	CString _string3;
-public:
-	CExitTitania();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CExitTitania"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_EXIT_TITANIA_H */
diff --git a/engines/titanic/messages/move_player_in_parrot_room.cpp b/engines/titanic/messages/move_player_in_parrot_room.cpp
deleted file mode 100644
index b1040bf..0000000
--- a/engines/titanic/messages/move_player_in_parrot_room.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/move_player_in_parrot_room.h"
-
-namespace Titanic {
-
-CMovePlayerInParrotRoom::CMovePlayerInParrotRoom() : CMovePlayerTo() {
-}
-
-void CMovePlayerInParrotRoom::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
-}
-
-void CMovePlayerInParrotRoom::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/move_player_in_parrot_room.h b/engines/titanic/messages/move_player_in_parrot_room.h
deleted file mode 100644
index f4e5779..0000000
--- a/engines/titanic/messages/move_player_in_parrot_room.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_MOVE_PLAYER_IN_PARROT_ROOM_H
-#define TITANIC_MOVE_PLAYER_IN_PARROT_ROOM_H
-
-#include "titanic/messages/move_player_to.h"
-
-namespace Titanic {
-
-class CMovePlayerInParrotRoom : public CMovePlayerTo {
-public:
-	CMovePlayerInParrotRoom();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMovePlayerInParrotRoom"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_MOVE_PLAYER_IN_PARROT_ROOM_H */
diff --git a/engines/titanic/messages/move_player_to.cpp b/engines/titanic/messages/move_player_to.cpp
deleted file mode 100644
index 66a71e8..0000000
--- a/engines/titanic/messages/move_player_to.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/move_player_to.h"
-
-namespace Titanic {
-
-CMovePlayerTo::CMovePlayerTo() : CGameObject() {
-}
-
-void CMovePlayerTo::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_destination, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CMovePlayerTo::load(SimpleFile *file) {
-	file->readNumber();
-	_destination = file->readString();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/move_player_to.h b/engines/titanic/messages/move_player_to.h
deleted file mode 100644
index aa785b9..0000000
--- a/engines/titanic/messages/move_player_to.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_MOVE_PLAYER_TO_H
-#define TITANIC_MOVE_PLAYER_TO_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CMovePlayerTo : public CGameObject {
-protected:
-	CString _destination;
-public:
-	CMovePlayerTo();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMovePlayerTo"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_MOVE_PLAYER_TO_H */
diff --git a/engines/titanic/messages/move_player_to_from.cpp b/engines/titanic/messages/move_player_to_from.cpp
deleted file mode 100644
index 77c74d5..0000000
--- a/engines/titanic/messages/move_player_to_from.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/move_player_to_from.h"
-
-namespace Titanic {
-
-CMovePlayerToFrom::CMovePlayerToFrom() : CGameObject() {
-}
-
-void CMovePlayerToFrom::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string2, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CMovePlayerToFrom::load(SimpleFile *file) {
-	file->readNumber();
-	_string2 = file->readString();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/move_player_to_from.h b/engines/titanic/messages/move_player_to_from.h
deleted file mode 100644
index 82fe5db..0000000
--- a/engines/titanic/messages/move_player_to_from.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_MOVE_PLAYER_TO_FROM_H
-#define TITANIC_MOVE_PLAYER_TO_FROM_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CMovePlayerToFrom : public CGameObject {
-private:
-	CString _string2;
-public:
-	CMovePlayerToFrom();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMovePlayerToFrom"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_MOVE_PLAYER_TO_FROM_H */
diff --git a/engines/titanic/messages/multi_move.cpp b/engines/titanic/messages/multi_move.cpp
deleted file mode 100644
index dd1948c..0000000
--- a/engines/titanic/messages/multi_move.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/multi_move.h"
-
-namespace Titanic {
-
-CMultiMove::CMultiMove() : CMovePlayerTo() {
-}
-
-void CMultiMove::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeQuotedLine(_string2, indent);
-	file->writeQuotedLine(_string3, indent);
-	file->writeQuotedLine(_string4, indent);
-	file->writeQuotedLine(_string5, indent);
-
-	CMovePlayerTo::save(file, indent);
-}
-
-void CMultiMove::load(SimpleFile *file) {
-	file->readNumber();
-	_string1 = file->readString();
-	_string2 = file->readString();
-	_string3 = file->readString();
-	_string5 = file->readString();
-	_string4 = file->readString();
-
-	CMovePlayerTo::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/multi_move.h b/engines/titanic/messages/multi_move.h
deleted file mode 100644
index 2cc4f4e..0000000
--- a/engines/titanic/messages/multi_move.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_MULTI_MOVE_H
-#define TITANIC_MULTI_MOVE_H
-
-#include "titanic/messages/move_player_to.h"
-
-namespace Titanic {
-
-class CMultiMove : public CMovePlayerTo {
-private:
-	CString _string1;
-	CString _string2;
-	CString _string3;
-	CString _string4;
-	CString _string5;
-public:
-	CMultiMove();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMultiMove"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_MULTI_MOVE_H */
diff --git a/engines/titanic/messages/pan_from_pel.cpp b/engines/titanic/messages/pan_from_pel.cpp
deleted file mode 100644
index 718927f..0000000
--- a/engines/titanic/messages/pan_from_pel.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/pan_from_pel.h"
-
-namespace Titanic {
-
-CPanFromPel::CPanFromPel() : CMovePlayerTo(), _fieldC8(0) {
-}
-
-void CPanFromPel::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldC8, indent);
-	file->writeQuotedLine(_string1, indent);
-
-	CMovePlayerTo::save(file, indent);
-}
-
-void CPanFromPel::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldC8 = file->readNumber();
-	_string1 = file->readString();
-
-	CMovePlayerTo::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/pan_from_pel.h b/engines/titanic/messages/pan_from_pel.h
deleted file mode 100644
index abb565c..0000000
--- a/engines/titanic/messages/pan_from_pel.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PAN_FROM_PEL_H
-#define TITANIC_PAN_FROM_PEL_H
-
-#include "titanic/messages/move_player_to.h"
-
-namespace Titanic {
-
-class CPanFromPel : public CMovePlayerTo {
-protected:
-	int _fieldC8;
-	CString _string1;
-public:
-	CPanFromPel();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPanFromPel"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PAN_FROM_PEL_H */
diff --git a/engines/titanic/messages/restaurant_pan_handler.cpp b/engines/titanic/messages/restaurant_pan_handler.cpp
deleted file mode 100644
index 14fd383..0000000
--- a/engines/titanic/messages/restaurant_pan_handler.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/restaurant_pan_handler.h"
-
-namespace Titanic {
-
-CRestaurantPanHandler::CRestaurantPanHandler() : CMovePlayerTo() {
-}
-
-void CRestaurantPanHandler::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeQuotedLine(_string2, indent);
-
-	CMovePlayerTo::save(file, indent);
-}
-
-void CRestaurantPanHandler::load(SimpleFile *file) {
-	file->readNumber();
-	_string1 = file->readString();
-	_string2 = file->readString();
-
-	CMovePlayerTo::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/restaurant_pan_handler.h b/engines/titanic/messages/restaurant_pan_handler.h
deleted file mode 100644
index dd757be..0000000
--- a/engines/titanic/messages/restaurant_pan_handler.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_RESTAURANT_PAN_HANDLER_H
-#define TITANIC_RESTAURANT_PAN_HANDLER_H
-
-#include "titanic/messages/move_player_to.h"
-
-namespace Titanic {
-
-class CRestaurantPanHandler : public CMovePlayerTo {
-protected:
-	CString _string1;
-	CString _string2;
-public:
-	CRestaurantPanHandler();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CRestaurantPanHandler"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_RESTAURANT_PAN_HANDLER_H */
diff --git a/engines/titanic/messages/restricted_move.cpp b/engines/titanic/messages/restricted_move.cpp
deleted file mode 100644
index 147cf11..0000000
--- a/engines/titanic/messages/restricted_move.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/restricted_move.h"
-
-namespace Titanic {
-
-CRestrictedMove::CRestrictedMove() : CMovePlayerTo(), _fieldC8(0) {
-}
-
-void CRestrictedMove::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldC8, indent);
-
-	CMovePlayerTo::save(file, indent);
-}
-
-void CRestrictedMove::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldC8 = file->readNumber();
-
-	CMovePlayerTo::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/restricted_move.h b/engines/titanic/messages/restricted_move.h
deleted file mode 100644
index 5feae29..0000000
--- a/engines/titanic/messages/restricted_move.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_RESTRICTED_MOVE_H
-#define TITANIC_RESTRICTED_MOVE_H
-
-#include "titanic/messages/move_player_to.h"
-
-namespace Titanic {
-
-class CRestrictedMove : public CMovePlayerTo {
-protected:
-	int _fieldC8;
-public:
-	CRestrictedMove();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CRestrictedMove"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_RESTRICTED_MOVE_H */
diff --git a/engines/titanic/messages/trip_down_canal.cpp b/engines/titanic/messages/trip_down_canal.cpp
deleted file mode 100644
index be5f283..0000000
--- a/engines/titanic/messages/trip_down_canal.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/trip_down_canal.h"
-
-namespace Titanic {
-
-CTripDownCanal::CTripDownCanal() : CMovePlayerTo() {
-}
-
-void CTripDownCanal::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CMovePlayerTo::save(file, indent);
-}
-
-void CTripDownCanal::load(SimpleFile *file) {
-	file->readNumber();
-	CMovePlayerTo::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/trip_down_canal.h b/engines/titanic/messages/trip_down_canal.h
deleted file mode 100644
index 117ce94..0000000
--- a/engines/titanic/messages/trip_down_canal.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_TRIP_DOWN_CANAL_H
-#define TITANIC_TRIP_DOWN_CANAL_H
-
-#include "titanic/messages/move_player_to.h"
-
-namespace Titanic {
-
-class CTripDownCanal : public CMovePlayerTo {
-public:
-	CTripDownCanal();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTripDownCanal"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_TRIP_DOWN_CANAL_H */
diff --git a/engines/titanic/moves/enter_bomb_room.cpp b/engines/titanic/moves/enter_bomb_room.cpp
new file mode 100644
index 0000000..049c3f4
--- /dev/null
+++ b/engines/titanic/moves/enter_bomb_room.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/enter_bomb_room.h"
+
+namespace Titanic {
+
+CEnterBombRoom::CEnterBombRoom() : CMovePlayerTo(), _fieldC8(0) {
+}
+
+void CEnterBombRoom::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CMovePlayerTo::save(file, indent);
+}
+
+void CEnterBombRoom::load(SimpleFile *file) {
+	file->readNumber();
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/enter_bomb_room.h b/engines/titanic/moves/enter_bomb_room.h
new file mode 100644
index 0000000..3ec5616
--- /dev/null
+++ b/engines/titanic/moves/enter_bomb_room.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_BOMB_ROOM_H
+#define TITANIC_ENTER_BOMB_ROOM_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CEnterBombRoom : public CMovePlayerTo {
+protected:
+	int _fieldC8;
+public:
+	CEnterBombRoom();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEnterBombRoom"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_BOMB_ROOM_H */
diff --git a/engines/titanic/moves/exit_arboretum.cpp b/engines/titanic/moves/exit_arboretum.cpp
new file mode 100644
index 0000000..0a50377
--- /dev/null
+++ b/engines/titanic/moves/exit_arboretum.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/exit_arboretum.h"
+
+namespace Titanic {
+
+CExitArboretum::CExitArboretum() : CMovePlayerTo(), 
+		_fieldC8(0), _fieldCC(0), _fieldD0(1) {
+}
+
+void CExitArboretum::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeNumberLine(_fieldD0, indent);
+
+	CMovePlayerTo::save(file, indent);
+}
+
+void CExitArboretum::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+	_fieldD0 = file->readNumber();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/exit_arboretum.h b/engines/titanic/moves/exit_arboretum.h
new file mode 100644
index 0000000..4ee135e
--- /dev/null
+++ b/engines/titanic/moves/exit_arboretum.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXIT_ARBORETUM_H
+#define TITANIC_EXIT_ARBORETUM_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CExitArboretum : public CMovePlayerTo {
+protected:
+	int _fieldC8;
+	int _fieldCC;
+	int _fieldD0;
+public:
+	CExitArboretum();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CExitArboretum"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BACKGROUND_H */
diff --git a/engines/titanic/moves/exit_bridge.cpp b/engines/titanic/moves/exit_bridge.cpp
new file mode 100644
index 0000000..27f923b
--- /dev/null
+++ b/engines/titanic/moves/exit_bridge.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/exit_bridge.h"
+
+namespace Titanic {
+
+CExitBridge::CExitBridge() : CMovePlayerTo() {
+}
+
+void CExitBridge::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CMovePlayerTo::save(file, indent);
+}
+
+void CExitBridge::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/exit_bridge.h b/engines/titanic/moves/exit_bridge.h
new file mode 100644
index 0000000..6d65a00
--- /dev/null
+++ b/engines/titanic/moves/exit_bridge.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXIT_BRIDGE_H
+#define TITANIC_EXIT_BRIDGE_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CExitBridge : public CMovePlayerTo {
+private:
+	CString _string1;
+public:
+	CExitBridge();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CExitBridge"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EXIT_BRIDGE_H */
diff --git a/engines/titanic/moves/exit_state_room.cpp b/engines/titanic/moves/exit_state_room.cpp
new file mode 100644
index 0000000..f1acd91
--- /dev/null
+++ b/engines/titanic/moves/exit_state_room.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/exit_state_room.h"
+
+namespace Titanic {
+
+CExitStateRoom::CExitStateRoom() : CMovePlayerTo(), _fieldC8(0) {
+}
+
+void CExitStateRoom::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CMovePlayerTo::save(file, indent);
+}
+
+void CExitStateRoom::load(SimpleFile *file) {
+	file->readNumber();
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/exit_state_room.h b/engines/titanic/moves/exit_state_room.h
new file mode 100644
index 0000000..12adcfb
--- /dev/null
+++ b/engines/titanic/moves/exit_state_room.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXIT_STATE_ROOM_H
+#define TITANIC_EXIT_STATE_ROOM_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CExitStateRoom : public CMovePlayerTo {
+protected:
+	int _fieldC8;
+public:
+	CExitStateRoom();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CExitStateRoom"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EXIT_STATE_ROOM_H */
diff --git a/engines/titanic/moves/exit_titania.cpp b/engines/titanic/moves/exit_titania.cpp
new file mode 100644
index 0000000..e94d0cd
--- /dev/null
+++ b/engines/titanic/moves/exit_titania.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/exit_titania.h"
+
+namespace Titanic {
+
+CExitTitania::CExitTitania() : CMovePlayerTo(), _fieldC8(0),
+		_string1("NULL"), _string2("NULL"), _string3("NULL") {
+}
+
+void CExitTitania::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string3, indent);
+
+	CMovePlayerTo::save(file, indent);
+}
+
+void CExitTitania::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldC8 = file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_string3 = file->readString();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/exit_titania.h b/engines/titanic/moves/exit_titania.h
new file mode 100644
index 0000000..529886a
--- /dev/null
+++ b/engines/titanic/moves/exit_titania.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXIT_TITANIA_H
+#define TITANIC_EXIT_TITANIA_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CExitTitania : public CMovePlayerTo {
+private:
+	int _fieldC8;
+	CString _string1;
+	CString _string2;
+	CString _string3;
+public:
+	CExitTitania();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CExitTitania"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EXIT_TITANIA_H */
diff --git a/engines/titanic/moves/move_player_in_parrot_room.cpp b/engines/titanic/moves/move_player_in_parrot_room.cpp
new file mode 100644
index 0000000..b1040bf
--- /dev/null
+++ b/engines/titanic/moves/move_player_in_parrot_room.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/move_player_in_parrot_room.h"
+
+namespace Titanic {
+
+CMovePlayerInParrotRoom::CMovePlayerInParrotRoom() : CMovePlayerTo() {
+}
+
+void CMovePlayerInParrotRoom::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CMovePlayerInParrotRoom::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/move_player_in_parrot_room.h b/engines/titanic/moves/move_player_in_parrot_room.h
new file mode 100644
index 0000000..f4e5779
--- /dev/null
+++ b/engines/titanic/moves/move_player_in_parrot_room.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVE_PLAYER_IN_PARROT_ROOM_H
+#define TITANIC_MOVE_PLAYER_IN_PARROT_ROOM_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CMovePlayerInParrotRoom : public CMovePlayerTo {
+public:
+	CMovePlayerInParrotRoom();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMovePlayerInParrotRoom"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVE_PLAYER_IN_PARROT_ROOM_H */
diff --git a/engines/titanic/moves/move_player_to.cpp b/engines/titanic/moves/move_player_to.cpp
new file mode 100644
index 0000000..66a71e8
--- /dev/null
+++ b/engines/titanic/moves/move_player_to.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+CMovePlayerTo::CMovePlayerTo() : CGameObject() {
+}
+
+void CMovePlayerTo::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_destination, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CMovePlayerTo::load(SimpleFile *file) {
+	file->readNumber();
+	_destination = file->readString();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/move_player_to.h b/engines/titanic/moves/move_player_to.h
new file mode 100644
index 0000000..aa785b9
--- /dev/null
+++ b/engines/titanic/moves/move_player_to.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVE_PLAYER_TO_H
+#define TITANIC_MOVE_PLAYER_TO_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CMovePlayerTo : public CGameObject {
+protected:
+	CString _destination;
+public:
+	CMovePlayerTo();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMovePlayerTo"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVE_PLAYER_TO_H */
diff --git a/engines/titanic/moves/move_player_to_from.cpp b/engines/titanic/moves/move_player_to_from.cpp
new file mode 100644
index 0000000..77c74d5
--- /dev/null
+++ b/engines/titanic/moves/move_player_to_from.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/move_player_to_from.h"
+
+namespace Titanic {
+
+CMovePlayerToFrom::CMovePlayerToFrom() : CGameObject() {
+}
+
+void CMovePlayerToFrom::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CMovePlayerToFrom::load(SimpleFile *file) {
+	file->readNumber();
+	_string2 = file->readString();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/move_player_to_from.h b/engines/titanic/moves/move_player_to_from.h
new file mode 100644
index 0000000..82fe5db
--- /dev/null
+++ b/engines/titanic/moves/move_player_to_from.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVE_PLAYER_TO_FROM_H
+#define TITANIC_MOVE_PLAYER_TO_FROM_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CMovePlayerToFrom : public CGameObject {
+private:
+	CString _string2;
+public:
+	CMovePlayerToFrom();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMovePlayerToFrom"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVE_PLAYER_TO_FROM_H */
diff --git a/engines/titanic/moves/multi_move.cpp b/engines/titanic/moves/multi_move.cpp
new file mode 100644
index 0000000..dd1948c
--- /dev/null
+++ b/engines/titanic/moves/multi_move.cpp
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/multi_move.h"
+
+namespace Titanic {
+
+CMultiMove::CMultiMove() : CMovePlayerTo() {
+}
+
+void CMultiMove::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeQuotedLine(_string4, indent);
+	file->writeQuotedLine(_string5, indent);
+
+	CMovePlayerTo::save(file, indent);
+}
+
+void CMultiMove::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_string3 = file->readString();
+	_string5 = file->readString();
+	_string4 = file->readString();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/multi_move.h b/engines/titanic/moves/multi_move.h
new file mode 100644
index 0000000..2cc4f4e
--- /dev/null
+++ b/engines/titanic/moves/multi_move.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MULTI_MOVE_H
+#define TITANIC_MULTI_MOVE_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CMultiMove : public CMovePlayerTo {
+private:
+	CString _string1;
+	CString _string2;
+	CString _string3;
+	CString _string4;
+	CString _string5;
+public:
+	CMultiMove();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMultiMove"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MULTI_MOVE_H */
diff --git a/engines/titanic/moves/pan_from_pel.cpp b/engines/titanic/moves/pan_from_pel.cpp
new file mode 100644
index 0000000..718927f
--- /dev/null
+++ b/engines/titanic/moves/pan_from_pel.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/pan_from_pel.h"
+
+namespace Titanic {
+
+CPanFromPel::CPanFromPel() : CMovePlayerTo(), _fieldC8(0) {
+}
+
+void CPanFromPel::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeQuotedLine(_string1, indent);
+
+	CMovePlayerTo::save(file, indent);
+}
+
+void CPanFromPel::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldC8 = file->readNumber();
+	_string1 = file->readString();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/pan_from_pel.h b/engines/titanic/moves/pan_from_pel.h
new file mode 100644
index 0000000..abb565c
--- /dev/null
+++ b/engines/titanic/moves/pan_from_pel.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PAN_FROM_PEL_H
+#define TITANIC_PAN_FROM_PEL_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CPanFromPel : public CMovePlayerTo {
+protected:
+	int _fieldC8;
+	CString _string1;
+public:
+	CPanFromPel();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPanFromPel"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PAN_FROM_PEL_H */
diff --git a/engines/titanic/moves/restaurant_pan_handler.cpp b/engines/titanic/moves/restaurant_pan_handler.cpp
new file mode 100644
index 0000000..14fd383
--- /dev/null
+++ b/engines/titanic/moves/restaurant_pan_handler.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/restaurant_pan_handler.h"
+
+namespace Titanic {
+
+CRestaurantPanHandler::CRestaurantPanHandler() : CMovePlayerTo() {
+}
+
+void CRestaurantPanHandler::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	CMovePlayerTo::save(file, indent);
+}
+
+void CRestaurantPanHandler::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/restaurant_pan_handler.h b/engines/titanic/moves/restaurant_pan_handler.h
new file mode 100644
index 0000000..dd757be
--- /dev/null
+++ b/engines/titanic/moves/restaurant_pan_handler.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RESTAURANT_PAN_HANDLER_H
+#define TITANIC_RESTAURANT_PAN_HANDLER_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CRestaurantPanHandler : public CMovePlayerTo {
+protected:
+	CString _string1;
+	CString _string2;
+public:
+	CRestaurantPanHandler();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CRestaurantPanHandler"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RESTAURANT_PAN_HANDLER_H */
diff --git a/engines/titanic/moves/restricted_move.cpp b/engines/titanic/moves/restricted_move.cpp
new file mode 100644
index 0000000..147cf11
--- /dev/null
+++ b/engines/titanic/moves/restricted_move.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/restricted_move.h"
+
+namespace Titanic {
+
+CRestrictedMove::CRestrictedMove() : CMovePlayerTo(), _fieldC8(0) {
+}
+
+void CRestrictedMove::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+
+	CMovePlayerTo::save(file, indent);
+}
+
+void CRestrictedMove::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldC8 = file->readNumber();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/restricted_move.h b/engines/titanic/moves/restricted_move.h
new file mode 100644
index 0000000..5feae29
--- /dev/null
+++ b/engines/titanic/moves/restricted_move.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RESTRICTED_MOVE_H
+#define TITANIC_RESTRICTED_MOVE_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CRestrictedMove : public CMovePlayerTo {
+protected:
+	int _fieldC8;
+public:
+	CRestrictedMove();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CRestrictedMove"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RESTRICTED_MOVE_H */
diff --git a/engines/titanic/moves/trip_down_canal.cpp b/engines/titanic/moves/trip_down_canal.cpp
new file mode 100644
index 0000000..be5f283
--- /dev/null
+++ b/engines/titanic/moves/trip_down_canal.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/trip_down_canal.h"
+
+namespace Titanic {
+
+CTripDownCanal::CTripDownCanal() : CMovePlayerTo() {
+}
+
+void CTripDownCanal::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CMovePlayerTo::save(file, indent);
+}
+
+void CTripDownCanal::load(SimpleFile *file) {
+	file->readNumber();
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/trip_down_canal.h b/engines/titanic/moves/trip_down_canal.h
new file mode 100644
index 0000000..117ce94
--- /dev/null
+++ b/engines/titanic/moves/trip_down_canal.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TRIP_DOWN_CANAL_H
+#define TITANIC_TRIP_DOWN_CANAL_H
+
+#include "titanic/messages/move_player_to.h"
+
+namespace Titanic {
+
+class CTripDownCanal : public CMovePlayerTo {
+public:
+	CTripDownCanal();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTripDownCanal"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TRIP_DOWN_CANAL_H */


Commit: db4dfcebeb669f83c1a3768380e641f598fb9049
    https://github.com/scummvm/scummvm/commit/db4dfcebeb669f83c1a3768380e641f598fb9049
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-25T23:55:31-05:00

Commit Message:
TITANIC: Renames messages sub-folder to moves

Changed paths:
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk
    engines/titanic/moves/enter_bomb_room.cpp
    engines/titanic/moves/enter_bomb_room.h
    engines/titanic/moves/exit_arboretum.cpp
    engines/titanic/moves/exit_arboretum.h
    engines/titanic/moves/exit_bridge.cpp
    engines/titanic/moves/exit_bridge.h
    engines/titanic/moves/exit_state_room.cpp
    engines/titanic/moves/exit_state_room.h
    engines/titanic/moves/exit_titania.cpp
    engines/titanic/moves/exit_titania.h
    engines/titanic/moves/move_player_in_parrot_room.cpp
    engines/titanic/moves/move_player_in_parrot_room.h
    engines/titanic/moves/move_player_to.cpp
    engines/titanic/moves/move_player_to_from.cpp
    engines/titanic/moves/multi_move.cpp
    engines/titanic/moves/multi_move.h
    engines/titanic/moves/pan_from_pel.cpp
    engines/titanic/moves/pan_from_pel.h
    engines/titanic/moves/restaurant_pan_handler.cpp
    engines/titanic/moves/restaurant_pan_handler.h
    engines/titanic/moves/restricted_move.cpp
    engines/titanic/moves/restricted_move.h
    engines/titanic/moves/trip_down_canal.cpp
    engines/titanic/moves/trip_down_canal.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 382023d..080cdb6 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -38,18 +38,18 @@
 #include "titanic/game/service_elevator_door.h"
 #include "titanic/game/sub_glass.h"
 
-#include "titanic/messages/enter_bomb_room.h"
-#include "titanic/messages/exit_arboretum.h"
-#include "titanic/messages/exit_bridge.h"
-#include "titanic/messages/exit_state_room.h"
-#include "titanic/messages/move_player_in_parrot_room.h"
-#include "titanic/messages/move_player_to.h"
-#include "titanic/messages/move_player_to_from.h"
-#include "titanic/messages/multi_move.h"
-#include "titanic/messages/pan_from_pel.h"
-#include "titanic/messages/restaurant_pan_handler.h"
-#include "titanic/messages/restricted_move.h"
-#include "titanic/messages/trip_down_canal.h"
+#include "titanic/moves/enter_bomb_room.h"
+#include "titanic/moves/exit_arboretum.h"
+#include "titanic/moves/exit_bridge.h"
+#include "titanic/moves/exit_state_room.h"
+#include "titanic/moves/move_player_in_parrot_room.h"
+#include "titanic/moves/move_player_to.h"
+#include "titanic/moves/move_player_to_from.h"
+#include "titanic/moves/multi_move.h"
+#include "titanic/moves/pan_from_pel.h"
+#include "titanic/moves/restaurant_pan_handler.h"
+#include "titanic/moves/restricted_move.h"
+#include "titanic/moves/trip_down_canal.h"
 
 #include "titanic/npcs/barbot.h"
 #include "titanic/npcs/bellbot.h"
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 66157be..dcfe38c 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -38,19 +38,19 @@ MODULE_OBJS := \
 	game/room_item.o \
 	game/service_elevator_door.o \
 	game/sub_glass.o \
-	messages/enter_bomb_room.o \
-	messages/exit_arboretum.o \
-	messages/exit_bridge.o \
-	messages/exit_state_room.o \
-	messages/exit_titania.o \
-	messages/move_player_in_parrot_room.o \
-	messages/move_player_to_from.o \
-	messages/move_player_to.o \
-	messages/multi_move.o \
-	messages/pan_from_pel.o \
-	messages/restaurant_pan_handler.o \
-	messages/restricted_move.o \
-	messages/trip_down_canal.o \
+	moves/enter_bomb_room.o \
+	moves/exit_arboretum.o \
+	moves/exit_bridge.o \
+	moves/exit_state_room.o \
+	moves/exit_titania.o \
+	moves/move_player_in_parrot_room.o \
+	moves/move_player_to_from.o \
+	moves/move_player_to.o \
+	moves/multi_move.o \
+	moves/pan_from_pel.o \
+	moves/restaurant_pan_handler.o \
+	moves/restricted_move.o \
+	moves/trip_down_canal.o \
 	npcs/barbot.o \
 	npcs/bellbot.o \
 	npcs/character.o \
diff --git a/engines/titanic/moves/enter_bomb_room.cpp b/engines/titanic/moves/enter_bomb_room.cpp
index 049c3f4..e989d47 100644
--- a/engines/titanic/moves/enter_bomb_room.cpp
+++ b/engines/titanic/moves/enter_bomb_room.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/messages/enter_bomb_room.h"
+#include "titanic/moves/enter_bomb_room.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/enter_bomb_room.h b/engines/titanic/moves/enter_bomb_room.h
index 3ec5616..fc4d136 100644
--- a/engines/titanic/moves/enter_bomb_room.h
+++ b/engines/titanic/moves/enter_bomb_room.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_ENTER_BOMB_ROOM_H
 #define TITANIC_ENTER_BOMB_ROOM_H
 
-#include "titanic/messages/move_player_to.h"
+#include "titanic/moves/move_player_to.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/exit_arboretum.cpp b/engines/titanic/moves/exit_arboretum.cpp
index 0a50377..2b5b497 100644
--- a/engines/titanic/moves/exit_arboretum.cpp
+++ b/engines/titanic/moves/exit_arboretum.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/messages/exit_arboretum.h"
+#include "titanic/moves/exit_arboretum.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/exit_arboretum.h b/engines/titanic/moves/exit_arboretum.h
index 4ee135e..4e5815d 100644
--- a/engines/titanic/moves/exit_arboretum.h
+++ b/engines/titanic/moves/exit_arboretum.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_EXIT_ARBORETUM_H
 #define TITANIC_EXIT_ARBORETUM_H
 
-#include "titanic/messages/move_player_to.h"
+#include "titanic/moves/move_player_to.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/exit_bridge.cpp b/engines/titanic/moves/exit_bridge.cpp
index 27f923b..99138f9 100644
--- a/engines/titanic/moves/exit_bridge.cpp
+++ b/engines/titanic/moves/exit_bridge.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/messages/exit_bridge.h"
+#include "titanic/moves/exit_bridge.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/exit_bridge.h b/engines/titanic/moves/exit_bridge.h
index 6d65a00..c85c1bc 100644
--- a/engines/titanic/moves/exit_bridge.h
+++ b/engines/titanic/moves/exit_bridge.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_EXIT_BRIDGE_H
 #define TITANIC_EXIT_BRIDGE_H
 
-#include "titanic/messages/move_player_to.h"
+#include "titanic/moves/move_player_to.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/exit_state_room.cpp b/engines/titanic/moves/exit_state_room.cpp
index f1acd91..0dc4a4f 100644
--- a/engines/titanic/moves/exit_state_room.cpp
+++ b/engines/titanic/moves/exit_state_room.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/messages/exit_state_room.h"
+#include "titanic/moves/exit_state_room.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/exit_state_room.h b/engines/titanic/moves/exit_state_room.h
index 12adcfb..ecef4f1 100644
--- a/engines/titanic/moves/exit_state_room.h
+++ b/engines/titanic/moves/exit_state_room.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_EXIT_STATE_ROOM_H
 #define TITANIC_EXIT_STATE_ROOM_H
 
-#include "titanic/messages/move_player_to.h"
+#include "titanic/moves/move_player_to.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/exit_titania.cpp b/engines/titanic/moves/exit_titania.cpp
index e94d0cd..99585f5 100644
--- a/engines/titanic/moves/exit_titania.cpp
+++ b/engines/titanic/moves/exit_titania.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/messages/exit_titania.h"
+#include "titanic/moves/exit_titania.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/exit_titania.h b/engines/titanic/moves/exit_titania.h
index 529886a..1d2226a 100644
--- a/engines/titanic/moves/exit_titania.h
+++ b/engines/titanic/moves/exit_titania.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_EXIT_TITANIA_H
 #define TITANIC_EXIT_TITANIA_H
 
-#include "titanic/messages/move_player_to.h"
+#include "titanic/moves/move_player_to.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/move_player_in_parrot_room.cpp b/engines/titanic/moves/move_player_in_parrot_room.cpp
index b1040bf..cfe4cb6 100644
--- a/engines/titanic/moves/move_player_in_parrot_room.cpp
+++ b/engines/titanic/moves/move_player_in_parrot_room.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/messages/move_player_in_parrot_room.h"
+#include "titanic/moves/move_player_in_parrot_room.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/move_player_in_parrot_room.h b/engines/titanic/moves/move_player_in_parrot_room.h
index f4e5779..91f8b99 100644
--- a/engines/titanic/moves/move_player_in_parrot_room.h
+++ b/engines/titanic/moves/move_player_in_parrot_room.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_MOVE_PLAYER_IN_PARROT_ROOM_H
 #define TITANIC_MOVE_PLAYER_IN_PARROT_ROOM_H
 
-#include "titanic/messages/move_player_to.h"
+#include "titanic/moves/move_player_to.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/move_player_to.cpp b/engines/titanic/moves/move_player_to.cpp
index 66a71e8..8ce8f77 100644
--- a/engines/titanic/moves/move_player_to.cpp
+++ b/engines/titanic/moves/move_player_to.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/messages/move_player_to.h"
+#include "titanic/moves/move_player_to.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/move_player_to_from.cpp b/engines/titanic/moves/move_player_to_from.cpp
index 77c74d5..f349c5c 100644
--- a/engines/titanic/moves/move_player_to_from.cpp
+++ b/engines/titanic/moves/move_player_to_from.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/messages/move_player_to_from.h"
+#include "titanic/moves/move_player_to_from.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/multi_move.cpp b/engines/titanic/moves/multi_move.cpp
index dd1948c..6b35b8865 100644
--- a/engines/titanic/moves/multi_move.cpp
+++ b/engines/titanic/moves/multi_move.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/messages/multi_move.h"
+#include "titanic/moves/multi_move.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/multi_move.h b/engines/titanic/moves/multi_move.h
index 2cc4f4e..102b4b7 100644
--- a/engines/titanic/moves/multi_move.h
+++ b/engines/titanic/moves/multi_move.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_MULTI_MOVE_H
 #define TITANIC_MULTI_MOVE_H
 
-#include "titanic/messages/move_player_to.h"
+#include "titanic/moves/move_player_to.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/pan_from_pel.cpp b/engines/titanic/moves/pan_from_pel.cpp
index 718927f..db3c9bf 100644
--- a/engines/titanic/moves/pan_from_pel.cpp
+++ b/engines/titanic/moves/pan_from_pel.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/messages/pan_from_pel.h"
+#include "titanic/moves/pan_from_pel.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/pan_from_pel.h b/engines/titanic/moves/pan_from_pel.h
index abb565c..41f3fdb 100644
--- a/engines/titanic/moves/pan_from_pel.h
+++ b/engines/titanic/moves/pan_from_pel.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_PAN_FROM_PEL_H
 #define TITANIC_PAN_FROM_PEL_H
 
-#include "titanic/messages/move_player_to.h"
+#include "titanic/moves/move_player_to.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/restaurant_pan_handler.cpp b/engines/titanic/moves/restaurant_pan_handler.cpp
index 14fd383..b2487a4 100644
--- a/engines/titanic/moves/restaurant_pan_handler.cpp
+++ b/engines/titanic/moves/restaurant_pan_handler.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/messages/restaurant_pan_handler.h"
+#include "titanic/moves/restaurant_pan_handler.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/restaurant_pan_handler.h b/engines/titanic/moves/restaurant_pan_handler.h
index dd757be..f2f2c0c 100644
--- a/engines/titanic/moves/restaurant_pan_handler.h
+++ b/engines/titanic/moves/restaurant_pan_handler.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_RESTAURANT_PAN_HANDLER_H
 #define TITANIC_RESTAURANT_PAN_HANDLER_H
 
-#include "titanic/messages/move_player_to.h"
+#include "titanic/moves/move_player_to.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/restricted_move.cpp b/engines/titanic/moves/restricted_move.cpp
index 147cf11..d6a046d 100644
--- a/engines/titanic/moves/restricted_move.cpp
+++ b/engines/titanic/moves/restricted_move.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/messages/restricted_move.h"
+#include "titanic/moves/restricted_move.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/restricted_move.h b/engines/titanic/moves/restricted_move.h
index 5feae29..48ddefe9 100644
--- a/engines/titanic/moves/restricted_move.h
+++ b/engines/titanic/moves/restricted_move.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_RESTRICTED_MOVE_H
 #define TITANIC_RESTRICTED_MOVE_H
 
-#include "titanic/messages/move_player_to.h"
+#include "titanic/moves/move_player_to.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/trip_down_canal.cpp b/engines/titanic/moves/trip_down_canal.cpp
index be5f283..349a7e9 100644
--- a/engines/titanic/moves/trip_down_canal.cpp
+++ b/engines/titanic/moves/trip_down_canal.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/messages/trip_down_canal.h"
+#include "titanic/moves/trip_down_canal.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/moves/trip_down_canal.h b/engines/titanic/moves/trip_down_canal.h
index 117ce94..0a5f918 100644
--- a/engines/titanic/moves/trip_down_canal.h
+++ b/engines/titanic/moves/trip_down_canal.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_TRIP_DOWN_CANAL_H
 #define TITANIC_TRIP_DOWN_CANAL_H
 
-#include "titanic/messages/move_player_to.h"
+#include "titanic/moves/move_player_to.h"
 
 namespace Titanic {
 


Commit: c5847f5b8093833edc5dc4c26bf239d462b9f2f1
    https://github.com/scummvm/scummvm/commit/c5847f5b8093833edc5dc4c26bf239d462b9f2f1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-26T00:16:25-05:00

Commit Message:
TITANIC: Start of new messages sub-folder

Changed paths:
  A engines/titanic/messages/auto_sound_event.cpp
  A engines/titanic/messages/auto_sound_event.h
  A engines/titanic/messages/door_auto_sound_event.cpp
  A engines/titanic/messages/door_auto_sound_event.h
  R engines/titanic/core/auto_sound_event.cpp
  R engines/titanic/core/auto_sound_event.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/tree_item.cpp
    engines/titanic/game/door_auto_sound_event.h
    engines/titanic/module.mk



diff --git a/engines/titanic/core/auto_sound_event.cpp b/engines/titanic/core/auto_sound_event.cpp
deleted file mode 100644
index 1bd5f54..0000000
--- a/engines/titanic/core/auto_sound_event.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/core/auto_sound_event.h"
-
-namespace Titanic {
-
-CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
-}
-
-void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/core/auto_sound_event.h b/engines/titanic/core/auto_sound_event.h
deleted file mode 100644
index 4180a68..0000000
--- a/engines/titanic/core/auto_sound_event.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_AUTO_SOUND_EVENT_H
-#define TITANIC_AUTO_SOUND_EVENT_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CAutoSoundEvent : public CGameObject {
-private:
-	int _fieldBC;
-	int _fieldC0;
-public:
-	CAutoSoundEvent();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 080cdb6..296ee6a 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -38,6 +38,9 @@
 #include "titanic/game/service_elevator_door.h"
 #include "titanic/game/sub_glass.h"
 
+#include "titanic/messages/auto_sound_event.h"
+#include "titanic/messages/door_auto_sound_event.h"
+
 #include "titanic/moves/enter_bomb_room.h"
 #include "titanic/moves/exit_arboretum.h"
 #include "titanic/moves/exit_bridge.h"
@@ -89,6 +92,9 @@ DEFFN(CRoomItem);
 DEFFN(CServiceElevatorDoor);
 DEFFN(CSUBGlass);
 
+DEFFN(CAutoSoundEvent);
+DEFFN(CDoorAutoSoundEvent);
+
 DEFFN(CEnterBombRoom);
 DEFFN(CExitArboretum);
 DEFFN(CExitBridge);
@@ -134,6 +140,9 @@ void CSaveableObject::initClassList() {
 	ADDFN(CServiceElevatorDoor);
 	ADDFN(CSUBGlass);
 
+	ADDFN(CAutoSoundEvent);
+	ADDFN(CDoorAutoSoundEvent);
+
 	ADDFN(CEnterBombRoom);
 	ADDFN(CExitArboretum);
 	ADDFN(CExitBridge);
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index d20e1da..8c9080f 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -79,6 +79,8 @@ CDontSaveFileItem *CTreeItem::getDontSaveFileItem() {
 
 		item = item->getNextSibling();
 	}
+
+	return nullptr;
 }
 
 void CTreeItem::addUnder(CTreeItem *newParent) {
diff --git a/engines/titanic/game/door_auto_sound_event.h b/engines/titanic/game/door_auto_sound_event.h
index 66e9594..9bba304 100644
--- a/engines/titanic/game/door_auto_sound_event.h
+++ b/engines/titanic/game/door_auto_sound_event.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_DOOR_AUTO_SOUND_EVENT_H
 #define TITANIC_DOOR_AUTO_SOUND_EVENT_H
 
-#include "titanic/core/auto_sound_event.h"
+#include "titanic/messages/auto_sound_event.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/messages/auto_sound_event.cpp b/engines/titanic/messages/auto_sound_event.cpp
new file mode 100644
index 0000000..a9c8fc3
--- /dev/null
+++ b/engines/titanic/messages/auto_sound_event.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/auto_sound_event.h"
+
+namespace Titanic {
+
+CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
+}
+
+void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/auto_sound_event.h b/engines/titanic/messages/auto_sound_event.h
new file mode 100644
index 0000000..f3a805c
--- /dev/null
+++ b/engines/titanic/messages/auto_sound_event.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_SOUND_EVENT_H
+#define TITANIC_AUTO_SOUND_EVENT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CAutoSoundEvent : public CGameObject {
+protected:
+	int _fieldBC;
+	int _fieldC0;
+public:
+	CAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/messages/door_auto_sound_event.cpp b/engines/titanic/messages/door_auto_sound_event.cpp
new file mode 100644
index 0000000..69191a6
--- /dev/null
+++ b/engines/titanic/messages/door_auto_sound_event.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/door_auto_sound_event.h"
+
+namespace Titanic {
+
+CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(),
+		_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
+}
+
+void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldDC, indent);
+	file->writeNumberLine(_fieldE0, indent);
+
+	CAutoSoundEvent::save(file, indent);
+}
+
+void CDoorAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_fieldDC = file->readNumber();
+	_fieldE0 = file->readNumber();
+
+	CAutoSoundEvent::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/door_auto_sound_event.h b/engines/titanic/messages/door_auto_sound_event.h
new file mode 100644
index 0000000..a231b2f
--- /dev/null
+++ b/engines/titanic/messages/door_auto_sound_event.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DOOR_AUTO_SOUND_EVENT_H
+#define TITANIC_DOOR_AUTO_SOUND_EVENT_H
+
+#include "titanic/messages/auto_sound_event.h"
+
+namespace Titanic {
+
+class CDoorAutoSoundEvent : public CAutoSoundEvent {
+private:
+	CString _string1;
+	CString _string2;
+	int _fieldDC;
+	int _fieldE0;
+public:
+	CDoorAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DOOR_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index dcfe38c..c012fc2 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -15,7 +15,6 @@ MODULE_OBJS := \
 	string.o \
 	titanic.o \
 	video_surface.o \
-	core/auto_sound_event.o \
 	core/background.o \
 	core/dont_save_file_item.o \
 	core/file_item.o \
@@ -33,11 +32,12 @@ MODULE_OBJS := \
 	core/tree_item.o \
 	core/view_item.o \
 	game/announce.o \
-	game/door_auto_sound_event.o \
 	game/pet_position.o \
 	game/room_item.o \
 	game/service_elevator_door.o \
 	game/sub_glass.o \
+	messages/auto_sound_event.o \
+	messages/door_auto_sound_event.o \
 	moves/enter_bomb_room.o \
 	moves/exit_arboretum.o \
 	moves/exit_bridge.o \


Commit: b08d0dd1304250143a5015db6dc1206d708bceca
    https://github.com/scummvm/scummvm/commit/b08d0dd1304250143a5015db6dc1206d708bceca
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-26T07:36:51-05:00

Commit Message:
TITANIC: Added CTurnOnPlaySound and CTurnOnObject

Changed paths:
  A engines/titanic/core/turn_on_object.cpp
  A engines/titanic/core/turn_on_object.h
  A engines/titanic/core/turn_on_play_sound.cpp
  A engines/titanic/core/turn_on_play_sound.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 296ee6a..6b6b439 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -30,8 +30,11 @@
 #include "titanic/core/node_item.h"
 #include "titanic/core/project_item.h"
 #include "titanic/core/saveable_object.h"
+#include "titanic/core/turn_on_object.h"
+#include "titanic/core/turn_on_play_sound.h"
 #include "titanic/core/tree_item.h"
 #include "titanic/core/view_item.h"
+
 #include "titanic/game/announce.h"
 #include "titanic/game/pet_position.h"
 #include "titanic/game/room_item.h"
@@ -83,6 +86,8 @@ DEFFN(CMovieClip);
 DEFFN(CMovieClipList);
 DEFFN(CNodeItem);
 DEFFN(CProjectItem);
+DEFFN(CTurnOnObject);
+DEFFN(CTurnOnPlaySound);
 DEFFN(CTreeItem);
 DEFFN(CViewItem);
 
@@ -132,6 +137,8 @@ void CSaveableObject::initClassList() {
 	ADDFN(CNodeItem);
 	ADDFN(CProjectItem);
 	ADDFN(CTreeItem);
+	ADDFN(CTurnOnObject);
+	ADDFN(CTurnOnPlaySound);
 	ADDFN(CViewItem);
 
 	ADDFN(CAnnounce);
diff --git a/engines/titanic/core/turn_on_object.cpp b/engines/titanic/core/turn_on_object.cpp
new file mode 100644
index 0000000..b4ed2b4
--- /dev/null
+++ b/engines/titanic/core/turn_on_object.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/turn_on_object.h"
+
+namespace Titanic {
+
+CTurnOnObject::CTurnOnObject() : CBackground(), _string3("NULL") {
+}
+
+void CTurnOnObject::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string3, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CTurnOnObject::load(SimpleFile *file) {
+	file->readNumber();
+	_string3 = file->readString();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/turn_on_object.h b/engines/titanic/core/turn_on_object.h
new file mode 100644
index 0000000..a17d58e
--- /dev/null
+++ b/engines/titanic/core/turn_on_object.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TURN_ON_OBJECT_H
+#define TITANIC_TURN_ON_OBJECT_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CTurnOnObject : public CBackground {
+protected:
+	CString _string3;
+public:
+	CTurnOnObject();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTurnOnObject"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TURN_ON_OBJECT_H */
diff --git a/engines/titanic/core/turn_on_play_sound.cpp b/engines/titanic/core/turn_on_play_sound.cpp
new file mode 100644
index 0000000..d56aef8
--- /dev/null
+++ b/engines/titanic/core/turn_on_play_sound.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/turn_on_play_sound.h"
+
+namespace Titanic {
+
+CTurnOnPlaySound::CTurnOnPlaySound() : CTurnOnObject(), 
+		_string3("NULL"), _fieldF8(80), _fieldFC(0) {
+}
+
+void CTurnOnPlaySound::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_fieldFC, indent);
+
+	CTurnOnObject::save(file, indent);
+}
+
+void CTurnOnPlaySound::load(SimpleFile *file) {
+	file->readNumber();
+	_string3 = file->readString();
+	_fieldF8 = file->readNumber();
+	_fieldFC = file->readNumber();
+
+	CTurnOnObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/turn_on_play_sound.h b/engines/titanic/core/turn_on_play_sound.h
new file mode 100644
index 0000000..a0fc8ee
--- /dev/null
+++ b/engines/titanic/core/turn_on_play_sound.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TURN_ON_PLAY_SOUND_H
+#define TITANIC_TURN_ON_PLAY_SOUND_H
+
+#include "titanic/core/turn_on_object.h"
+
+namespace Titanic {
+
+class CTurnOnPlaySound : public CTurnOnObject {
+private:
+	CString _string3;
+	int _fieldF8;
+	int _fieldFC;
+public:
+	CTurnOnPlaySound();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTurnOnPlaySound"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TURN_ON_PLAY_SOUND_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index c012fc2..d4fcfd0 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -29,6 +29,8 @@ MODULE_OBJS := \
 	core/project_item.o \
 	core/resource_key.o \
 	core/saveable_object.o \
+	core/turn_on_object.o \
+	core/turn_on_play_sound.o \
 	core/tree_item.o \
 	core/view_item.o \
 	game/announce.o \


Commit: 16bcc6beba1b28c822c194aa35368e69b48f43cb
    https://github.com/scummvm/scummvm/commit/16bcc6beba1b28c822c194aa35368e69b48f43cb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-26T07:55:34-05:00

Commit Message:
TITANIC: Implemented CCallBot

Changed paths:
  A engines/titanic/npcs/callbot.cpp
  A engines/titanic/npcs/callbot.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 6b6b439..c154dde 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -59,6 +59,7 @@
 
 #include "titanic/npcs/barbot.h"
 #include "titanic/npcs/bellbot.h"
+#include "titanic/npcs/callbot.h"
 #include "titanic/npcs/deskbot.h"
 #include "titanic/npcs/doorbot.h"
 #include "titanic/npcs/liftbot.h"
@@ -115,6 +116,7 @@ DEFFN(CTripDownCanal);
 
 DEFFN(CBarbot);
 DEFFN(CBellBot);
+DEFFN(CCallBot);
 DEFFN(CDeskbot);
 DEFFN(CDoorbot);
 DEFFN(CLiftBot);
@@ -165,6 +167,7 @@ void CSaveableObject::initClassList() {
 
 	ADDFN(CBarbot);
 	ADDFN(CBellBot);
+	ADDFN(CCallBot);
 	ADDFN(CDeskbot);
 	ADDFN(CDoorbot);
 	ADDFN(CMaitreD);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index d4fcfd0..12b07a6 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -55,6 +55,7 @@ MODULE_OBJS := \
 	moves/trip_down_canal.o \
 	npcs/barbot.o \
 	npcs/bellbot.o \
+	npcs/callbot.o \
 	npcs/character.o \
 	npcs/deskbot.o \
 	npcs/doorbot.o \
diff --git a/engines/titanic/npcs/callbot.cpp b/engines/titanic/npcs/callbot.cpp
new file mode 100644
index 0000000..3fb7ee2
--- /dev/null
+++ b/engines/titanic/npcs/callbot.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/callbot.h"
+
+namespace Titanic {
+
+CCallBot::CCallBot() : CGameObject(), _fieldC8(0) {
+}
+
+void CCallBot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CCallBot::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_fieldC8 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/callbot.h b/engines/titanic/npcs/callbot.h
new file mode 100644
index 0000000..2f9edd3
--- /dev/null
+++ b/engines/titanic/npcs/callbot.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CALLBOT_H
+#define TITANIC_CALLBOT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CCallBot : public CGameObject {
+protected:
+	CString _string1;
+	int _fieldC8;
+public:
+	CCallBot();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCallBot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CALLBOT_H */


Commit: b361f2bf1484a54dd776f1b67cbd15037201348a
    https://github.com/scummvm/scummvm/commit/b361f2bf1484a54dd776f1b67cbd15037201348a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-26T19:11:30-05:00

Commit Message:
TITANIC: Implemented CAutoMusicPlayer and CSeasonalMusicPlayer

Changed paths:
  A engines/titanic/sound/auto_music_player.cpp
  A engines/titanic/sound/auto_music_player.h
  A engines/titanic/sound/auto_music_player_base.cpp
  A engines/titanic/sound/auto_music_player_base.h
  A engines/titanic/sound/seasonal_music_player.cpp
  A engines/titanic/sound/seasonal_music_player.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index c154dde..4eb9052 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -70,6 +70,8 @@
 #include "titanic/npcs/succubus.h"
 #include "titanic/npcs/titania.h"
 
+#include "titanic/sound/auto_music_player.h"
+
 namespace Titanic {
 
 Common::HashMap<Common::String, CSaveableObject::CreateFunction> * 
@@ -127,6 +129,8 @@ DEFFN(CStarlings);
 DEFFN(CSuccUBus);
 DEFFN(CTitania);
 
+DEFFN(CAutoMusicPlayer);
+
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
 	ADDFN(CBackground);
@@ -177,6 +181,8 @@ void CSaveableObject::initClassList() {
 	ADDFN(CStarlings);
 	ADDFN(CSuccUBus);
 	ADDFN(CTitania);
+
+	ADDFN(CAutoMusicPlayer);
 }
 
 void CSaveableObject::freeClassList() {
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 12b07a6..e1540c2 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -66,7 +66,10 @@ MODULE_OBJS := \
 	npcs/starlings.o \
 	npcs/succubus.o \
 	npcs/titania.o \
-	npcs/true_talk_npc.o
+	npcs/true_talk_npc.o \
+	sound/auto_music_player.o \
+	sound/auto_music_player_base.o \
+	sound/seasonal_music_player.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/sound/auto_music_player.cpp b/engines/titanic/sound/auto_music_player.cpp
new file mode 100644
index 0000000..2040bfc
--- /dev/null
+++ b/engines/titanic/sound/auto_music_player.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/auto_music_player.h"
+
+namespace Titanic {
+
+CAutoMusicPlayer::CAutoMusicPlayer() : CAutoMusicPlayerBase() {
+}
+
+void CAutoMusicPlayer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	CAutoMusicPlayerBase::save(file, indent);
+}
+
+void CAutoMusicPlayer::load(SimpleFile *file) {
+	file->readNumber();
+	_string2 = file->readString();
+
+	CAutoMusicPlayerBase::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/auto_music_player.h b/engines/titanic/sound/auto_music_player.h
new file mode 100644
index 0000000..11e46b0
--- /dev/null
+++ b/engines/titanic/sound/auto_music_player.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_MUSIC_PLAYER_H
+#define TITANIC_AUTO_MUSIC_PLAYER_H
+
+#include "titanic/sound/auto_music_player_base.h"
+
+namespace Titanic {
+
+class CAutoMusicPlayer : public CAutoMusicPlayerBase {
+private:
+	CString _string2;
+public:
+	CAutoMusicPlayer();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoMusicPlayer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LINK_ITEM_H */
diff --git a/engines/titanic/sound/auto_music_player_base.cpp b/engines/titanic/sound/auto_music_player_base.cpp
new file mode 100644
index 0000000..116fcf7
--- /dev/null
+++ b/engines/titanic/sound/auto_music_player_base.cpp
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/auto_music_player_base.h"
+
+namespace Titanic {
+
+CAutoMusicPlayerBase::CAutoMusicPlayerBase() : CGameObject(),
+	_fieldC8(1), _fieldCC(0), _fieldD0(-1), _fieldD4(1) {
+}
+void CAutoMusicPlayerBase::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeNumberLine(_fieldD0, indent);
+	file->writeNumberLine(_fieldD4, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CAutoMusicPlayerBase::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+	_fieldD0 = file->readNumber();
+	_fieldD4 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/auto_music_player_base.h b/engines/titanic/sound/auto_music_player_base.h
new file mode 100644
index 0000000..66ffabb
--- /dev/null
+++ b/engines/titanic/sound/auto_music_player_base.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_MUSIC_PLAYER_BASE_H
+#define TITANIC_AUTO_MUSIC_PLAYER_BASE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CAutoMusicPlayerBase : public CGameObject {
+protected:
+	CString _string1;
+	int _fieldC8;
+	int _fieldCC;
+	int _fieldD0;
+	int _fieldD4;
+public:
+	CAutoMusicPlayerBase();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoMusicPlayerBase"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUTO_MUSIC_PLAYER_BASE_H */
diff --git a/engines/titanic/sound/seasonal_music_player.cpp b/engines/titanic/sound/seasonal_music_player.cpp
new file mode 100644
index 0000000..c4a8f02
--- /dev/null
+++ b/engines/titanic/sound/seasonal_music_player.cpp
@@ -0,0 +1,66 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/seasonal_music_player.h"
+
+namespace Titanic {
+
+CSeasonalMusicPlayer::CSeasonalMusicPlayer() : CAutoMusicPlayerBase() {
+	_fieldD8 = 0;
+	_fieldDC = 1;
+	_fieldE0 = 0;
+	_fieldE4 = 0;
+	_fieldE8 = -4;
+	_fieldEC = -2;
+	_fieldF0 = -4;
+	_fieldF4 = -4;
+}
+
+void CSeasonalMusicPlayer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldD8, indent);
+	file->writeNumberLine(_fieldDC, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_fieldF4, indent);
+
+	CAutoMusicPlayerBase::save(file, indent);
+}
+
+void CSeasonalMusicPlayer::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldD8 = file->readNumber();
+	_fieldDC = file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_fieldF0 = file->readNumber();
+	_fieldF4 = file->readNumber();
+
+	CAutoMusicPlayerBase::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/seasonal_music_player.h b/engines/titanic/sound/seasonal_music_player.h
new file mode 100644
index 0000000..fe3a60b
--- /dev/null
+++ b/engines/titanic/sound/seasonal_music_player.h
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SEASONAL_MUSIC_PLAYER_H
+#define TITANIC_SEASONAL_MUSIC_PLAYER_H
+
+#include "titanic/sound/auto_music_player_base.h"
+
+namespace Titanic {
+
+class CSeasonalMusicPlayer : public CAutoMusicPlayerBase {
+private:
+	int _fieldD8;
+	int _fieldDC;
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+	int _fieldF4;
+public:
+	CSeasonalMusicPlayer();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSeasonalMusicPlayer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LINK_ITEM_H */


Commit: 1a98b49f607a9dcf133f54c0e133fb774def4a7c
    https://github.com/scummvm/scummvm/commit/1a98b49f607a9dcf133f54c0e133fb774def4a7c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-26T19:27:56-05:00

Commit Message:
TITANIC: Implement CSummonBots and CRobotController

Changed paths:
  A engines/titanic/npcs/robot_controller.cpp
  A engines/titanic/npcs/robot_controller.h
  A engines/titanic/npcs/summon_bots.cpp
  A engines/titanic/npcs/summon_bots.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk
    engines/titanic/npcs/character.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 4eb9052..1cbae87 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -68,6 +68,7 @@
 #include "titanic/npcs/parrot.h"
 #include "titanic/npcs/starlings.h"
 #include "titanic/npcs/succubus.h"
+#include "titanic/npcs/summon_bots.h"
 #include "titanic/npcs/titania.h"
 
 #include "titanic/sound/auto_music_player.h"
@@ -126,6 +127,7 @@ DEFFN(CMaitreD);
 DEFFN(CMobile);
 DEFFN(CParrot);
 DEFFN(CStarlings);
+DEFFN(CSummonBots);
 DEFFN(CSuccUBus);
 DEFFN(CTitania);
 
@@ -180,6 +182,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CParrot);
 	ADDFN(CStarlings);
 	ADDFN(CSuccUBus);
+	ADDFN(CSummonBots);
 	ADDFN(CTitania);
 
 	ADDFN(CAutoMusicPlayer);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index e1540c2..fb24d50 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -63,8 +63,10 @@ MODULE_OBJS := \
 	npcs/maitre_d.o \
 	npcs/mobile.o \
 	npcs/parrot.o \
+	npcs/robot_controller.o \
 	npcs/starlings.o \
 	npcs/succubus.o \
+	npcs/summon_bots.o \
 	npcs/titania.o \
 	npcs/true_talk_npc.o \
 	sound/auto_music_player.o \
diff --git a/engines/titanic/npcs/character.h b/engines/titanic/npcs/character.h
index 7f489d2..8e1e87e 100644
--- a/engines/titanic/npcs/character.h
+++ b/engines/titanic/npcs/character.h
@@ -54,4 +54,4 @@ public:
 
 } // End of namespace Titanic
 
-#endif /* TITANIC_SUCCUBUS_H */
+#endif /* TITANIC_CHARACTER_H */
diff --git a/engines/titanic/npcs/robot_controller.cpp b/engines/titanic/npcs/robot_controller.cpp
new file mode 100644
index 0000000..c6ef422
--- /dev/null
+++ b/engines/titanic/npcs/robot_controller.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/robot_controller.h"
+
+namespace Titanic {
+
+CRobotController::CRobotController() : CGameObject(), _string1("BellBot") {
+}
+
+void CRobotController::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CRobotController::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/robot_controller.h b/engines/titanic/npcs/robot_controller.h
new file mode 100644
index 0000000..876285e
--- /dev/null
+++ b/engines/titanic/npcs/robot_controller.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ROBOT_CONTROLLER_H
+#define TITANIC_ROBOT_CONTROLLER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CRobotController : public CGameObject {
+protected:
+	CString _string1;
+public:
+	CRobotController();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CRobotController"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ROBOT_CONTROLLER_H */
diff --git a/engines/titanic/npcs/summon_bots.cpp b/engines/titanic/npcs/summon_bots.cpp
new file mode 100644
index 0000000..661b3f0
--- /dev/null
+++ b/engines/titanic/npcs/summon_bots.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/summon_bots.h"
+
+namespace Titanic {
+
+CSummonBots::CSummonBots() : CRobotController(), _string2("NULL"),
+		_fieldC8(0), _fieldCC(0) {
+}
+
+void CSummonBots::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	CRobotController::save(file, indent);
+}
+
+void CSummonBots::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+	_string2 = file->readString();
+
+	CRobotController::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/summon_bots.h b/engines/titanic/npcs/summon_bots.h
new file mode 100644
index 0000000..d525ff6
--- /dev/null
+++ b/engines/titanic/npcs/summon_bots.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SUMMON_BOTS_H
+#define TITANIC_SUMMON_BOTS_H
+
+#include "titanic/npcs/robot_controller.h"
+
+namespace Titanic {
+
+class CSummonBots : public CRobotController {
+protected:
+	CString _string2;
+	int _fieldC8;
+	int _fieldCC;
+public:
+	CSummonBots();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSummonBots"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SUMMON_BOTS_H */


Commit: 859c30a4e1129cc3d1b5d4e4a0660229a16dfd24
    https://github.com/scummvm/scummvm/commit/859c30a4e1129cc3d1b5d4e4a0660229a16dfd24
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-26T19:45:30-05:00

Commit Message:
TITANIC: Implemented CTelevision

Changed paths:
  A engines/titanic/game/television.cpp
  A engines/titanic/game/television.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 1cbae87..a52b53d 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -40,6 +40,7 @@
 #include "titanic/game/room_item.h"
 #include "titanic/game/service_elevator_door.h"
 #include "titanic/game/sub_glass.h"
+#include "titanic/game/television.h"
 
 #include "titanic/messages/auto_sound_event.h"
 #include "titanic/messages/door_auto_sound_event.h"
@@ -100,6 +101,7 @@ DEFFN(CPETPosition);
 DEFFN(CRoomItem);
 DEFFN(CServiceElevatorDoor);
 DEFFN(CSUBGlass);
+DEFFN(CTelevision);
 
 DEFFN(CAutoSoundEvent);
 DEFFN(CDoorAutoSoundEvent);
@@ -154,6 +156,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CRoomItem);
 	ADDFN(CServiceElevatorDoor);
 	ADDFN(CSUBGlass);
+	ADDFN(CTelevision);
 
 	ADDFN(CAutoSoundEvent);
 	ADDFN(CDoorAutoSoundEvent);
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
new file mode 100644
index 0000000..4c6b38a
--- /dev/null
+++ b/engines/titanic/game/television.cpp
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/television.h"
+
+namespace Titanic {
+
+int CTelevision::_v1;
+int CTelevision::_v2;
+int CTelevision::_v3;
+int CTelevision::_v4;
+int CTelevision::_v5;
+int CTelevision::_v6;
+
+CTelevision::CTelevision() : CBackground(), _fieldE0(1),
+	_fieldE4(7), _fieldE8(0), _fieldEC(0), _fieldF0(0) {
+}
+
+void CTelevision::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_v2, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_v3, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_v4, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_v5, indent);
+	file->writeNumberLine(_v6, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CTelevision::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_v1 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_v2 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_v3 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_v4 = file->readNumber();
+	_fieldF0 = file->readNumber();
+	_v5 = file->readNumber();
+	_v6 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
new file mode 100644
index 0000000..4f39d60
--- /dev/null
+++ b/engines/titanic/game/television.h
@@ -0,0 +1,65 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TELEVISION_H
+#define TITANIC_TELEVISION_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CTelevision : public CBackground {
+private:
+	static int _v1;
+	static int _v2;
+	static int _v3;
+	static int _v4;
+	static int _v5;
+	static int _v6;
+private:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+public:
+	CTelevision();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTelevision"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TELEVISION_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index fb24d50..e28f0f3 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -38,6 +38,7 @@ MODULE_OBJS := \
 	game/room_item.o \
 	game/service_elevator_door.o \
 	game/sub_glass.o \
+	game/television.o \
 	messages/auto_sound_event.o \
 	messages/door_auto_sound_event.o \
 	moves/enter_bomb_room.o \


Commit: 34ffd06c7896ec0b9c4874800a57d8003862c8c4
    https://github.com/scummvm/scummvm/commit/34ffd06c7896ec0b9c4874800a57d8003862c8c4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-26T20:35:12-05:00

Commit Message:
TITANIC: Implemented CSTButton class and descendents

Changed paths:
  A engines/titanic/gfx/act_button.cpp
  A engines/titanic/gfx/act_button.h
  A engines/titanic/gfx/changes_season_button.cpp
  A engines/titanic/gfx/changes_season_button.h
  A engines/titanic/gfx/elevator_button.cpp
  A engines/titanic/gfx/elevator_button.h
  A engines/titanic/gfx/move_object_button.cpp
  A engines/titanic/gfx/move_object_button.h
  A engines/titanic/gfx/slider_button.cpp
  A engines/titanic/gfx/slider_button.h
  A engines/titanic/gfx/st_button.cpp
  A engines/titanic/gfx/st_button.h
  A engines/titanic/gfx/status_change_button.cpp
  A engines/titanic/gfx/status_change_button.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index a52b53d..e5fb365 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -42,6 +42,14 @@
 #include "titanic/game/sub_glass.h"
 #include "titanic/game/television.h"
 
+#include "titanic/gfx/act_button.h"
+#include "titanic/gfx/changes_season_button.h"
+#include "titanic/gfx/elevator_button.h"
+#include "titanic/gfx/move_object_button.h"
+#include "titanic/gfx/slider_button.h"
+#include "titanic/gfx/st_button.h"
+#include "titanic/gfx/status_change_button.h"
+
 #include "titanic/messages/auto_sound_event.h"
 #include "titanic/messages/door_auto_sound_event.h"
 
@@ -103,6 +111,14 @@ DEFFN(CServiceElevatorDoor);
 DEFFN(CSUBGlass);
 DEFFN(CTelevision);
 
+DEFFN(CActButton);
+DEFFN(CChangesSeasonButton);
+DEFFN(CElevatorButton);
+DEFFN(CMoveObjectButton);
+DEFFN(CSliderButton);
+DEFFN(CStatusChangeButton);
+DEFFN(CSTButton);
+
 DEFFN(CAutoSoundEvent);
 DEFFN(CDoorAutoSoundEvent);
 
@@ -158,6 +174,14 @@ void CSaveableObject::initClassList() {
 	ADDFN(CSUBGlass);
 	ADDFN(CTelevision);
 
+	ADDFN(CActButton);
+	ADDFN(CChangesSeasonButton);
+	ADDFN(CElevatorButton);
+	ADDFN(CMoveObjectButton);
+	ADDFN(CSliderButton);
+	ADDFN(CStatusChangeButton);
+	ADDFN(CSTButton);
+
 	ADDFN(CAutoSoundEvent);
 	ADDFN(CDoorAutoSoundEvent);
 
diff --git a/engines/titanic/gfx/act_button.cpp b/engines/titanic/gfx/act_button.cpp
new file mode 100644
index 0000000..3e79a17
--- /dev/null
+++ b/engines/titanic/gfx/act_button.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/act_button.h"
+
+namespace Titanic {
+
+CActButton::CActButton() : CSTButton() {
+}
+
+void CActButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSTButton::save(file, indent);
+}
+
+void CActButton::load(SimpleFile *file) {
+	file->readNumber();
+	CSTButton::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/act_button.h b/engines/titanic/gfx/act_button.h
new file mode 100644
index 0000000..0ae2d4d
--- /dev/null
+++ b/engines/titanic/gfx/act_button.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ACT_BUTTON_H
+#define TITANIC_ACT_BUTTON_H
+
+#include "titanic/gfx/st_button.h"
+
+namespace Titanic {
+
+class CActButton : public CSTButton {
+public:
+	CActButton();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CActButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ACT_BUTTON_H */
diff --git a/engines/titanic/gfx/changes_season_button.cpp b/engines/titanic/gfx/changes_season_button.cpp
new file mode 100644
index 0000000..a5f6778
--- /dev/null
+++ b/engines/titanic/gfx/changes_season_button.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/changes_season_button.h"
+
+namespace Titanic {
+
+CChangesSeasonButton::CChangesSeasonButton() : CSTButton() {
+}
+
+void CChangesSeasonButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSTButton::save(file, indent);
+}
+
+void CChangesSeasonButton::load(SimpleFile *file) {
+	file->readNumber();
+	CSTButton::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/changes_season_button.h b/engines/titanic/gfx/changes_season_button.h
new file mode 100644
index 0000000..8a75634
--- /dev/null
+++ b/engines/titanic/gfx/changes_season_button.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHANGES_SEASON_BUTTON_H
+#define TITANIC_CHANGES_SEASON_BUTTON_H
+
+#include "titanic/gfx/st_button.h"
+
+namespace Titanic {
+
+class CChangesSeasonButton : public CSTButton {
+public:
+	CChangesSeasonButton();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CChangesSeasonButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CHANGES_SEASON_BUTTON_H */
diff --git a/engines/titanic/gfx/elevator_button.cpp b/engines/titanic/gfx/elevator_button.cpp
new file mode 100644
index 0000000..81c9598
--- /dev/null
+++ b/engines/titanic/gfx/elevator_button.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/elevator_button.h"
+
+namespace Titanic {
+
+CElevatorButton::CElevatorButton() : CSTButton() {
+}
+
+void CElevatorButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSTButton::save(file, indent);
+}
+
+void CElevatorButton::load(SimpleFile *file) {
+	file->readNumber();
+	CSTButton::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/elevator_button.h b/engines/titanic/gfx/elevator_button.h
new file mode 100644
index 0000000..1090ea8
--- /dev/null
+++ b/engines/titanic/gfx/elevator_button.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ELEVATOR_BUTTON_H
+#define TITANIC_ELEVATOR_BUTTON_H
+
+#include "titanic/gfx/st_button.h"
+
+namespace Titanic {
+
+class CElevatorButton : public CSTButton {
+public:
+	CElevatorButton();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CElevatorButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ELEVATOR_BUTTON_H */
diff --git a/engines/titanic/gfx/move_object_button.cpp b/engines/titanic/gfx/move_object_button.cpp
new file mode 100644
index 0000000..4ab0825
--- /dev/null
+++ b/engines/titanic/gfx/move_object_button.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/move_object_button.h"
+
+namespace Titanic {
+
+CMoveObjectButton::CMoveObjectButton() : CSTButton(), _field11C(1) {
+}
+
+void CMoveObjectButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writePoint(_pos1, indent);
+	file->writeNumberLine(_field11C, indent);
+
+	CSTButton::save(file, indent);
+}
+
+void CMoveObjectButton::load(SimpleFile *file) {
+	file->readNumber();
+	_pos1 = file->readPoint();
+	_field11C = file->readNumber();
+
+	CSTButton::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/move_object_button.h b/engines/titanic/gfx/move_object_button.h
new file mode 100644
index 0000000..b00ba7b
--- /dev/null
+++ b/engines/titanic/gfx/move_object_button.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVE_OBJECT_BUTTON_H
+#define TITANIC_MOVE_OBJECT_BUTTON_H
+
+#include "titanic/gfx/st_button.h"
+
+namespace Titanic {
+
+class CMoveObjectButton : public CSTButton {
+private:
+	Common::Point _pos1;
+	int _field11C;
+public:
+	CMoveObjectButton();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMoveObjectButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVE_OBJECT_BUTTON_H */
diff --git a/engines/titanic/gfx/slider_button.cpp b/engines/titanic/gfx/slider_button.cpp
new file mode 100644
index 0000000..bcd9add
--- /dev/null
+++ b/engines/titanic/gfx/slider_button.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/slider_button.h"
+
+namespace Titanic {
+
+CSliderButton::CSliderButton() : CSTButton(), _field114(0),
+		_field118(0), _field11C(0) {
+}
+
+void CSliderButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field114, indent);
+	file->writeNumberLine(_field118, indent);
+	file->writeNumberLine(_field11C, indent);
+	file->writePoint(_pos1, indent);
+
+	CSTButton::save(file, indent);
+}
+
+void CSliderButton::load(SimpleFile *file) {
+	file->readNumber();
+	_field114 = file->readNumber();
+	_field118 = file->readNumber();
+	_field11C = file->readNumber();
+	_pos1 = file->readPoint();
+
+	CSTButton::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/slider_button.h b/engines/titanic/gfx/slider_button.h
new file mode 100644
index 0000000..e39a5f8
--- /dev/null
+++ b/engines/titanic/gfx/slider_button.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SLIDER_BUTTON_H
+#define TITANIC_SLIDER_BUTTON_H
+
+#include "titanic/gfx/st_button.h"
+
+namespace Titanic {
+
+class CSliderButton : public CSTButton {
+private:
+	int _field114;
+	int _field118;
+	int _field11C;
+	Common::Point _pos1;
+public:
+	CSliderButton();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSliderButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SLIDER_BUTTON_H */
diff --git a/engines/titanic/gfx/st_button.cpp b/engines/titanic/gfx/st_button.cpp
new file mode 100644
index 0000000..44aa5cb
--- /dev/null
+++ b/engines/titanic/gfx/st_button.cpp
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/st_button.h"
+
+namespace Titanic {
+
+CSTButton::CSTButton() : CBackground() {
+	_fieldE0 = 0;
+	_string3 = "NULL";
+	_fieldF0 = 0;
+	_fieldF4 = 0;
+	_string4 = "NULL";
+	_string5 = "NULL";
+	_field110 = 0;
+}
+
+void CSTButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_fieldF4, indent);
+	file->writeQuotedLine(_string4, indent);
+	file->writeQuotedLine(_string5, indent);
+	file->writeNumberLine(_field110, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CSTButton::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_string3 = file->readString();
+	_fieldF0 = file->readNumber();
+	_fieldF4 = file->readNumber();
+	_string4 = file->readString();
+	_string5 = file->readString();
+	_field110 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/st_button.h b/engines/titanic/gfx/st_button.h
new file mode 100644
index 0000000..39b3765
--- /dev/null
+++ b/engines/titanic/gfx/st_button.h
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ST_BUTTON_H
+#define TITANIC_ST_BUTTON_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CSTButton : public CBackground {
+private:
+	int _fieldE0;
+	CString _string3;
+	int _fieldF0;
+	int _fieldF4;
+	CString _string4;
+	CString _string5;
+	int _field110;
+public:
+	CSTButton();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSTButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ST_BUTTON_H */
diff --git a/engines/titanic/gfx/status_change_button.cpp b/engines/titanic/gfx/status_change_button.cpp
new file mode 100644
index 0000000..36037a2
--- /dev/null
+++ b/engines/titanic/gfx/status_change_button.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/status_change_button.h"
+
+namespace Titanic {
+
+CStatusChangeButton::CStatusChangeButton() : CSTButton() {
+}
+
+void CStatusChangeButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSTButton::save(file, indent);
+}
+
+void CStatusChangeButton::load(SimpleFile *file) {
+	file->readNumber();
+	CSTButton::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/status_change_button.h b/engines/titanic/gfx/status_change_button.h
new file mode 100644
index 0000000..b3b4125
--- /dev/null
+++ b/engines/titanic/gfx/status_change_button.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STATUS_CHANGE_BUTTON_H
+#define TITANIC_STATUS_CHANGE_BUTTON_H
+
+#include "titanic/gfx/st_button.h"
+
+namespace Titanic {
+
+class CStatusChangeButton : public CSTButton {
+public:
+	CStatusChangeButton();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CStatusChangeButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STATUS_CHANGE_BUTTON_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index e28f0f3..e91a602 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -39,6 +39,13 @@ MODULE_OBJS := \
 	game/service_elevator_door.o \
 	game/sub_glass.o \
 	game/television.o \
+	gfx/act_button.o \
+	gfx/changes_season_button.o \
+	gfx/elevator_button.o \
+	gfx/move_object_button.o \
+	gfx/slider_button.o \
+	gfx/st_button.o \
+	gfx/status_change_button.o \
 	messages/auto_sound_event.o \
 	messages/door_auto_sound_event.o \
 	moves/enter_bomb_room.o \


Commit: b7cd6be9ebacf5ff7d0ee2e9a5220397c00e6943
    https://github.com/scummvm/scummvm/commit/b7cd6be9ebacf5ff7d0ee2e9a5220397c00e6943
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-26T21:41:30-05:00

Commit Message:
TITANIC: Implemented CToggleSwitch and descendents

Changed paths:
  A engines/titanic/gfx/chev_left_off.cpp
  A engines/titanic/gfx/chev_left_off.h
  A engines/titanic/gfx/chev_left_on.cpp
  A engines/titanic/gfx/chev_left_on.h
  A engines/titanic/gfx/chev_right_off.cpp
  A engines/titanic/gfx/chev_right_off.h
  A engines/titanic/gfx/chev_right_on.cpp
  A engines/titanic/gfx/chev_right_on.h
  A engines/titanic/gfx/chev_send_rec_switch.cpp
  A engines/titanic/gfx/chev_send_rec_switch.h
  A engines/titanic/gfx/chev_switch.cpp
  A engines/titanic/gfx/chev_switch.h
  A engines/titanic/gfx/get_from_succ.cpp
  A engines/titanic/gfx/get_from_succ.h
  A engines/titanic/gfx/helmet_on_off.cpp
  A engines/titanic/gfx/helmet_on_off.h
  A engines/titanic/gfx/home_photo.cpp
  A engines/titanic/gfx/home_photo.h
  A engines/titanic/gfx/icon_nav_action.cpp
  A engines/titanic/gfx/icon_nav_action.h
  A engines/titanic/gfx/icon_nav_down.cpp
  A engines/titanic/gfx/icon_nav_down.h
  A engines/titanic/gfx/icon_nav_left.cpp
  A engines/titanic/gfx/icon_nav_left.h
  A engines/titanic/gfx/icon_nav_right.cpp
  A engines/titanic/gfx/icon_nav_right.h
  A engines/titanic/gfx/icon_nav_up.cpp
  A engines/titanic/gfx/icon_nav_up.h
  A engines/titanic/gfx/keybrd_butt.cpp
  A engines/titanic/gfx/keybrd_butt.h
  A engines/titanic/gfx/pet_mode_off.cpp
  A engines/titanic/gfx/pet_mode_off.h
  A engines/titanic/gfx/pet_mode_on.cpp
  A engines/titanic/gfx/pet_mode_on.h
  A engines/titanic/gfx/pet_mode_panel.cpp
  A engines/titanic/gfx/pet_mode_panel.h
  A engines/titanic/gfx/send_to_succ.cpp
  A engines/titanic/gfx/send_to_succ.h
  A engines/titanic/gfx/small_chev_left_off.cpp
  A engines/titanic/gfx/small_chev_left_off.h
  A engines/titanic/gfx/small_chev_left_on.cpp
  A engines/titanic/gfx/small_chev_left_on.h
  A engines/titanic/gfx/small_chev_right_off.cpp
  A engines/titanic/gfx/small_chev_right_off.h
  A engines/titanic/gfx/small_chev_right_on.cpp
  A engines/titanic/gfx/small_chev_right_on.h
  A engines/titanic/gfx/toggle_switch.cpp
  A engines/titanic/gfx/toggle_switch.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index e5fb365..e87325a 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -44,11 +44,35 @@
 
 #include "titanic/gfx/act_button.h"
 #include "titanic/gfx/changes_season_button.h"
+#include "titanic/gfx/chev_left_off.h"
+#include "titanic/gfx/chev_left_on.h"
+#include "titanic/gfx/chev_right_off.h"
+#include "titanic/gfx/chev_right_on.h"
+#include "titanic/gfx/chev_send_rec_switch.h"
+#include "titanic/gfx/chev_switch.h"
 #include "titanic/gfx/elevator_button.h"
+#include "titanic/gfx/get_from_succ.h"
+#include "titanic/gfx/helmet_on_off.h"
+#include "titanic/gfx/home_photo.h"
+#include "titanic/gfx/icon_nav_action.h"
+#include "titanic/gfx/icon_nav_down.h"
+#include "titanic/gfx/icon_nav_left.h"
+#include "titanic/gfx/icon_nav_right.h"
+#include "titanic/gfx/icon_nav_up.h"
+#include "titanic/gfx/keybrd_butt.h"
 #include "titanic/gfx/move_object_button.h"
+#include "titanic/gfx/pet_mode_off.h"
+#include "titanic/gfx/pet_mode_on.h"
+#include "titanic/gfx/pet_mode_panel.h"
+#include "titanic/gfx/send_to_succ.h"
 #include "titanic/gfx/slider_button.h"
-#include "titanic/gfx/st_button.h"
+#include "titanic/gfx/small_chev_left_off.h"
+#include "titanic/gfx/small_chev_left_on.h"
+#include "titanic/gfx/small_chev_right_off.h"
+#include "titanic/gfx/small_chev_right_on.h"
 #include "titanic/gfx/status_change_button.h"
+#include "titanic/gfx/st_button.h"
+#include "titanic/gfx/toggle_switch.h"
 
 #include "titanic/messages/auto_sound_event.h"
 #include "titanic/messages/door_auto_sound_event.h"
@@ -113,9 +137,32 @@ DEFFN(CTelevision);
 
 DEFFN(CActButton);
 DEFFN(CChangesSeasonButton);
+DEFFN(CChevLeftOff);
+DEFFN(CChevLeftOn);
+DEFFN(CChevRightOff);
+DEFFN(CChevRightOn);
+DEFFN(CChevSendRecSwitch);
+DEFFN(CChevSwitch);
 DEFFN(CElevatorButton);
+DEFFN(CGetFromSucc);
+DEFFN(CHelmetOnOff);
+DEFFN(CHomePhoto);
+DEFFN(CIconNavAction);
+DEFFN(CIconNavDown);
+DEFFN(CIconNavLeft);
+DEFFN(CIconNavRight);
+DEFFN(CIconNavUp);
+DEFFN(CKeybrdButt);
 DEFFN(CMoveObjectButton);
+DEFFN(CPetModeOff);
+DEFFN(CPetModeOn);
+DEFFN(CPetModePanel);
+DEFFN(CSendToSucc);
 DEFFN(CSliderButton);
+DEFFN(CSmallChevLeftOff);
+DEFFN(CSmallChevLeftOn);
+DEFFN(CSmallChevRightOff);
+DEFFN(CSmallChevRightOn);
 DEFFN(CStatusChangeButton);
 DEFFN(CSTButton);
 
@@ -176,9 +223,32 @@ void CSaveableObject::initClassList() {
 
 	ADDFN(CActButton);
 	ADDFN(CChangesSeasonButton);
+	ADDFN(CChevLeftOff);
+	ADDFN(CChevLeftOn);
+	ADDFN(CChevRightOff);
+	ADDFN(CChevRightOn);
+	ADDFN(CChevSendRecSwitch);
+	ADDFN(CChevSwitch);
 	ADDFN(CElevatorButton);
+	ADDFN(CGetFromSucc);
+	ADDFN(CHelmetOnOff);
+	ADDFN(CHomePhoto);
+	ADDFN(CIconNavAction);
+	ADDFN(CIconNavDown);
+	ADDFN(CIconNavLeft);
+	ADDFN(CIconNavRight);
+	ADDFN(CIconNavUp);
+	ADDFN(CKeybrdButt);
 	ADDFN(CMoveObjectButton);
+	ADDFN(CPetModeOff);
+	ADDFN(CPetModeOn);
+	ADDFN(CPetModePanel);
+	ADDFN(CSendToSucc);
 	ADDFN(CSliderButton);
+	ADDFN(CSmallChevLeftOff);
+	ADDFN(CSmallChevLeftOn);
+	ADDFN(CSmallChevRightOff);
+	ADDFN(CSmallChevRightOn);
 	ADDFN(CStatusChangeButton);
 	ADDFN(CSTButton);
 
diff --git a/engines/titanic/gfx/chev_left_off.cpp b/engines/titanic/gfx/chev_left_off.cpp
new file mode 100644
index 0000000..736cc0d
--- /dev/null
+++ b/engines/titanic/gfx/chev_left_off.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/chev_left_off.h"
+
+namespace Titanic {
+
+CChevLeftOff::CChevLeftOff() : CToggleSwitch() {
+}
+
+void CChevLeftOff::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CChevLeftOff::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/chev_left_off.h b/engines/titanic/gfx/chev_left_off.h
new file mode 100644
index 0000000..c3ea05d
--- /dev/null
+++ b/engines/titanic/gfx/chev_left_off.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHEV_LEFT_OFF_H
+#define TITANIC_CHEV_LEFT_OFF_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CChevLeftOff : public CToggleSwitch {
+public:
+	CChevLeftOff();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CChevLeftOff"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CHEV_LEFT_OFF_H */
diff --git a/engines/titanic/gfx/chev_left_on.cpp b/engines/titanic/gfx/chev_left_on.cpp
new file mode 100644
index 0000000..f233c53
--- /dev/null
+++ b/engines/titanic/gfx/chev_left_on.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/chev_left_on.h"
+
+namespace Titanic {
+
+CChevLeftOn::CChevLeftOn() : CToggleSwitch() {
+}
+
+void CChevLeftOn::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CChevLeftOn::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/chev_left_on.h b/engines/titanic/gfx/chev_left_on.h
new file mode 100644
index 0000000..c2f23c3
--- /dev/null
+++ b/engines/titanic/gfx/chev_left_on.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHEV_LEFT_ON_H
+#define TITANIC_CHEV_LEFT_ON_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CChevLeftOn : public CToggleSwitch {
+public:
+	CChevLeftOn();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CChevLeftOn"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CHEV_LEFT_ON_H */
diff --git a/engines/titanic/gfx/chev_right_off.cpp b/engines/titanic/gfx/chev_right_off.cpp
new file mode 100644
index 0000000..7cf3b11
--- /dev/null
+++ b/engines/titanic/gfx/chev_right_off.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/chev_right_off.h"
+
+namespace Titanic {
+
+CChevRightOff::CChevRightOff() : CToggleSwitch() {
+}
+
+void CChevRightOff::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CChevRightOff::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/chev_right_off.h b/engines/titanic/gfx/chev_right_off.h
new file mode 100644
index 0000000..da28759
--- /dev/null
+++ b/engines/titanic/gfx/chev_right_off.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHEV_RIGHT_OFF_H
+#define TITANIC_CHEV_RIGHT_OFF_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CChevRightOff : public CToggleSwitch {
+public:
+	CChevRightOff();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CChevRightOff"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CHEV_RIGHT_OFF_H */
diff --git a/engines/titanic/gfx/chev_right_on.cpp b/engines/titanic/gfx/chev_right_on.cpp
new file mode 100644
index 0000000..848abfc
--- /dev/null
+++ b/engines/titanic/gfx/chev_right_on.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/chev_right_on.h"
+
+namespace Titanic {
+
+CChevRightOn::CChevRightOn() : CToggleSwitch() {
+}
+
+void CChevRightOn::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CChevRightOn::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/chev_right_on.h b/engines/titanic/gfx/chev_right_on.h
new file mode 100644
index 0000000..eb307c1
--- /dev/null
+++ b/engines/titanic/gfx/chev_right_on.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHEV_RIGHT_ON_H
+#define TITANIC_CHEV_RIGHT_ON_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CChevRightOn : public CToggleSwitch {
+public:
+	CChevRightOn();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CChevRightOn"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CHEV_RIGHT_ON_H */
diff --git a/engines/titanic/gfx/chev_send_rec_switch.cpp b/engines/titanic/gfx/chev_send_rec_switch.cpp
new file mode 100644
index 0000000..affe9bc
--- /dev/null
+++ b/engines/titanic/gfx/chev_send_rec_switch.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/chev_send_rec_switch.h"
+
+namespace Titanic {
+
+CChevSendRecSwitch::CChevSendRecSwitch() : CToggleSwitch() {
+}
+
+void CChevSendRecSwitch::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CChevSendRecSwitch::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/chev_send_rec_switch.h b/engines/titanic/gfx/chev_send_rec_switch.h
new file mode 100644
index 0000000..8cd06e6
--- /dev/null
+++ b/engines/titanic/gfx/chev_send_rec_switch.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHEV_SEND_REC_SWITCH_H
+#define TITANIC_CHEV_SEND_REC_SWITCH_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CChevSendRecSwitch : public CToggleSwitch {
+public:
+	CChevSendRecSwitch();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSendRecSwitch"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CHEV_SEND_REC_SWITCH_H */
diff --git a/engines/titanic/gfx/chev_switch.cpp b/engines/titanic/gfx/chev_switch.cpp
new file mode 100644
index 0000000..d7f1107
--- /dev/null
+++ b/engines/titanic/gfx/chev_switch.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/chev_switch.h"
+
+namespace Titanic {
+
+CChevSwitch::CChevSwitch() : CToggleSwitch() {
+}
+
+void CChevSwitch::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CChevSwitch::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/chev_switch.h b/engines/titanic/gfx/chev_switch.h
new file mode 100644
index 0000000..e7b43c3
--- /dev/null
+++ b/engines/titanic/gfx/chev_switch.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHEV_SWITCH_H
+#define TITANIC_CHEV_SWITCH_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CChevSwitch : public CToggleSwitch {
+public:
+	CChevSwitch();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CChevSwitch"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CHEV_SWITCH_H */
diff --git a/engines/titanic/gfx/get_from_succ.cpp b/engines/titanic/gfx/get_from_succ.cpp
new file mode 100644
index 0000000..ad7b5dc
--- /dev/null
+++ b/engines/titanic/gfx/get_from_succ.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/get_from_succ.h"
+
+namespace Titanic {
+
+CGetFromSucc::CGetFromSucc() : CToggleSwitch() {
+}
+
+void CGetFromSucc::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CGetFromSucc::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/get_from_succ.h b/engines/titanic/gfx/get_from_succ.h
new file mode 100644
index 0000000..810eb31
--- /dev/null
+++ b/engines/titanic/gfx/get_from_succ.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GET_FROM_SUCC_H
+#define TITANIC_GET_FROM_SUCC_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CGetFromSucc : public CToggleSwitch {
+public:
+	CGetFromSucc();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGetFromSucc"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GET_FROM_SUCC_H */
diff --git a/engines/titanic/gfx/helmet_on_off.cpp b/engines/titanic/gfx/helmet_on_off.cpp
new file mode 100644
index 0000000..e1c6989
--- /dev/null
+++ b/engines/titanic/gfx/helmet_on_off.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/helmet_on_off.h"
+
+namespace Titanic {
+
+CHelmetOnOff::CHelmetOnOff() : CToggleSwitch() {
+}
+
+void CHelmetOnOff::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CHelmetOnOff::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/helmet_on_off.h b/engines/titanic/gfx/helmet_on_off.h
new file mode 100644
index 0000000..839c2a5
--- /dev/null
+++ b/engines/titanic/gfx/helmet_on_off.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_HELMET_ON_OFF_H
+#define TITANIC_HELMET_ON_OFF_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CHelmetOnOff : public CToggleSwitch {
+public:
+	CHelmetOnOff();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CHelmetOnOff"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HELMET_ON_OFF_H */
diff --git a/engines/titanic/gfx/home_photo.cpp b/engines/titanic/gfx/home_photo.cpp
new file mode 100644
index 0000000..48661fc
--- /dev/null
+++ b/engines/titanic/gfx/home_photo.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/home_photo.h"
+
+namespace Titanic {
+
+CHomePhoto::CHomePhoto() : CToggleSwitch() {
+}
+
+void CHomePhoto::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CHomePhoto::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/home_photo.h b/engines/titanic/gfx/home_photo.h
new file mode 100644
index 0000000..f8ad297
--- /dev/null
+++ b/engines/titanic/gfx/home_photo.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_HOME_PHOTO_H
+#define TITANIC_HOME_PHOTO_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CHomePhoto : public CToggleSwitch {
+public:
+	CHomePhoto();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CHomePhoto"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HOME_PHOTO_H */
diff --git a/engines/titanic/gfx/icon_nav_action.cpp b/engines/titanic/gfx/icon_nav_action.cpp
new file mode 100644
index 0000000..f8aaa72
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_action.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/icon_nav_action.h"
+
+namespace Titanic {
+
+CIconNavAction::CIconNavAction() : CToggleSwitch() {
+}
+
+void CIconNavAction::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CIconNavAction::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/icon_nav_action.h b/engines/titanic/gfx/icon_nav_action.h
new file mode 100644
index 0000000..812930b
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_action.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ICON_NAV_ACTION_H
+#define TITANIC_ICON_NAV_ACTION_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CIconNavAction : public CToggleSwitch {
+public:
+	CIconNavAction();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CIconNavAction"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ICON_NAV_ACTION_H */
diff --git a/engines/titanic/gfx/icon_nav_down.cpp b/engines/titanic/gfx/icon_nav_down.cpp
new file mode 100644
index 0000000..947aa4c
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_down.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/icon_nav_down.h"
+
+namespace Titanic {
+
+CIconNavDown::CIconNavDown() : CToggleSwitch() {
+}
+
+void CIconNavDown::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CIconNavDown::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/icon_nav_down.h b/engines/titanic/gfx/icon_nav_down.h
new file mode 100644
index 0000000..c6acfa0
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_down.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ICON_NAV_DOWN_H
+#define TITANIC_ICON_NAV_DOWN_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CIconNavDown : public CToggleSwitch {
+public:
+	CIconNavDown();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CIconNavDown"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ICON_NAV_DOWN_H */
diff --git a/engines/titanic/gfx/icon_nav_left.cpp b/engines/titanic/gfx/icon_nav_left.cpp
new file mode 100644
index 0000000..5ec5090
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_left.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/icon_nav_left.h"
+
+namespace Titanic {
+
+CIconNavLeft::CIconNavLeft() : CToggleSwitch() {
+}
+
+void CIconNavLeft::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CIconNavLeft::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/icon_nav_left.h b/engines/titanic/gfx/icon_nav_left.h
new file mode 100644
index 0000000..006056b
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_left.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ICON_NAV_LEFT_H
+#define TITANIC_ICON_NAV_LEFT_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CIconNavLeft : public CToggleSwitch {
+public:
+	CIconNavLeft();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CIconNavLeft"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ICON_NAV_LEFT_H */
diff --git a/engines/titanic/gfx/icon_nav_right.cpp b/engines/titanic/gfx/icon_nav_right.cpp
new file mode 100644
index 0000000..d133ed3
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_right.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/icon_nav_right.h"
+
+namespace Titanic {
+
+CIconNavRight::CIconNavRight() : CToggleSwitch() {
+}
+
+void CIconNavRight::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CIconNavRight::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/icon_nav_right.h b/engines/titanic/gfx/icon_nav_right.h
new file mode 100644
index 0000000..9f319d1
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_right.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ICON_NAV_RIGHT_H
+#define TITANIC_ICON_NAV_RIGHT_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CIconNavRight : public CToggleSwitch {
+public:
+	CIconNavRight();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CIconNavRight"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ICON_NAV_RIGHT_H */
diff --git a/engines/titanic/gfx/icon_nav_up.cpp b/engines/titanic/gfx/icon_nav_up.cpp
new file mode 100644
index 0000000..5b5d5ec
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_up.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/icon_nav_up.h"
+
+namespace Titanic {
+
+CIconNavUp::CIconNavUp() : CToggleSwitch() {
+}
+
+void CIconNavUp::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CIconNavUp::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/icon_nav_up.h b/engines/titanic/gfx/icon_nav_up.h
new file mode 100644
index 0000000..010b609
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_up.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ICON_NAV_UP_H
+#define TITANIC_ICON_NAV_UP_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CIconNavUp : public CToggleSwitch {
+public:
+	CIconNavUp();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CIconNavUp"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ICON_NAV_UP_H */
diff --git a/engines/titanic/gfx/keybrd_butt.cpp b/engines/titanic/gfx/keybrd_butt.cpp
new file mode 100644
index 0000000..3e7f5c1
--- /dev/null
+++ b/engines/titanic/gfx/keybrd_butt.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/keybrd_butt.h"
+
+namespace Titanic {
+
+CKeybrdButt::CKeybrdButt() : CToggleSwitch() {
+}
+
+void CKeybrdButt::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CKeybrdButt::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/keybrd_butt.h b/engines/titanic/gfx/keybrd_butt.h
new file mode 100644
index 0000000..52fff77
--- /dev/null
+++ b/engines/titanic/gfx/keybrd_butt.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_KEYBRD_BUTT_H
+#define TITANIC_KEYBRD_BUTT_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CKeybrdButt : public CToggleSwitch {
+public:
+	CKeybrdButt();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CKeybrdButt"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_KEYBRD_BUTT_H */
diff --git a/engines/titanic/gfx/pet_mode_off.cpp b/engines/titanic/gfx/pet_mode_off.cpp
new file mode 100644
index 0000000..d94ced0
--- /dev/null
+++ b/engines/titanic/gfx/pet_mode_off.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/pet_mode_off.h"
+
+namespace Titanic {
+
+CPetModeOff::CPetModeOff() : CToggleSwitch() {
+}
+
+void CPetModeOff::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CPetModeOff::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_mode_off.h b/engines/titanic/gfx/pet_mode_off.h
new file mode 100644
index 0000000..45b1010
--- /dev/null
+++ b/engines/titanic/gfx/pet_mode_off.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_MODE_OFF_H
+#define TITANIC_PET_MODE_OFF_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CPetModeOff : public CToggleSwitch {
+public:
+	CPetModeOff();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPetModeOff"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_MODE_OFF_H */
diff --git a/engines/titanic/gfx/pet_mode_on.cpp b/engines/titanic/gfx/pet_mode_on.cpp
new file mode 100644
index 0000000..2de0745
--- /dev/null
+++ b/engines/titanic/gfx/pet_mode_on.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/pet_mode_on.h"
+
+namespace Titanic {
+
+CPetModeOn::CPetModeOn() : CToggleSwitch() {
+}
+
+void CPetModeOn::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CPetModeOn::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_mode_on.h b/engines/titanic/gfx/pet_mode_on.h
new file mode 100644
index 0000000..8ebfd8d
--- /dev/null
+++ b/engines/titanic/gfx/pet_mode_on.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_MODE_ON_H
+#define TITANIC_PET_MODE_ON_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CPetModeOn : public CToggleSwitch {
+public:
+	CPetModeOn();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPetModeOn"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_MODE_ON_H */
diff --git a/engines/titanic/gfx/pet_mode_panel.cpp b/engines/titanic/gfx/pet_mode_panel.cpp
new file mode 100644
index 0000000..050cb76
--- /dev/null
+++ b/engines/titanic/gfx/pet_mode_panel.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/pet_mode_panel.h"
+
+namespace Titanic {
+
+CPetModePanel::CPetModePanel() : CToggleSwitch() {
+}
+
+void CPetModePanel::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CPetModePanel::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_mode_panel.h b/engines/titanic/gfx/pet_mode_panel.h
new file mode 100644
index 0000000..3a394df
--- /dev/null
+++ b/engines/titanic/gfx/pet_mode_panel.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_MODE_PANEL_H
+#define TITANIC_PET_MODE_PANEL_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CPetModePanel : public CToggleSwitch {
+public:
+	CPetModePanel();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPetModePanel"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_MODE_PANEL_H */
diff --git a/engines/titanic/gfx/send_to_succ.cpp b/engines/titanic/gfx/send_to_succ.cpp
new file mode 100644
index 0000000..82c923c
--- /dev/null
+++ b/engines/titanic/gfx/send_to_succ.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/send_to_succ.h"
+
+namespace Titanic {
+
+CSendToSucc::CSendToSucc() : CToggleSwitch() {
+}
+
+void CSendToSucc::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CSendToSucc::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/send_to_succ.h b/engines/titanic/gfx/send_to_succ.h
new file mode 100644
index 0000000..971c2e7
--- /dev/null
+++ b/engines/titanic/gfx/send_to_succ.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SEND_TO_SUCC_H
+#define TITANIC_SEND_TO_SUCC_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CSendToSucc : public CToggleSwitch {
+public:
+	CSendToSucc();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSendToSucc"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SEND_TO_SUCC_H */
diff --git a/engines/titanic/gfx/small_chev_left_off.cpp b/engines/titanic/gfx/small_chev_left_off.cpp
new file mode 100644
index 0000000..8614e33
--- /dev/null
+++ b/engines/titanic/gfx/small_chev_left_off.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/small_chev_left_off.h"
+
+namespace Titanic {
+
+CSmallChevLeftOff::CSmallChevLeftOff() : CToggleSwitch() {
+}
+
+void CSmallChevLeftOff::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CSmallChevLeftOff::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/small_chev_left_off.h b/engines/titanic/gfx/small_chev_left_off.h
new file mode 100644
index 0000000..bf73c74
--- /dev/null
+++ b/engines/titanic/gfx/small_chev_left_off.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SMALL_CHEV_LEFT_OFF_H
+#define TITANIC_SMALL_CHEV_LEFT_OFF_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CSmallChevLeftOff : public CToggleSwitch {
+public:
+	CSmallChevLeftOff();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSmallChevLeftOff"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SMALL_CHEV_LEFT_OFF_H */
diff --git a/engines/titanic/gfx/small_chev_left_on.cpp b/engines/titanic/gfx/small_chev_left_on.cpp
new file mode 100644
index 0000000..7f6a4ee
--- /dev/null
+++ b/engines/titanic/gfx/small_chev_left_on.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/small_chev_left_on.h"
+
+namespace Titanic {
+
+CSmallChevLeftOn::CSmallChevLeftOn() : CToggleSwitch() {
+}
+
+void CSmallChevLeftOn::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CSmallChevLeftOn::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/small_chev_left_on.h b/engines/titanic/gfx/small_chev_left_on.h
new file mode 100644
index 0000000..c98108b
--- /dev/null
+++ b/engines/titanic/gfx/small_chev_left_on.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SMALL_CHEV_LEFT_ON_H
+#define TITANIC_SMALL_CHEV_LEFT_ON_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CSmallChevLeftOn : public CToggleSwitch {
+public:
+	CSmallChevLeftOn();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSmallChevLeftOn"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SMALL_CHEV_LEFT_ON_H */
diff --git a/engines/titanic/gfx/small_chev_right_off.cpp b/engines/titanic/gfx/small_chev_right_off.cpp
new file mode 100644
index 0000000..1a3051b
--- /dev/null
+++ b/engines/titanic/gfx/small_chev_right_off.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/small_chev_right_off.h"
+
+namespace Titanic {
+
+CSmallChevRightOff::CSmallChevRightOff() : CToggleSwitch() {
+}
+
+void CSmallChevRightOff::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CSmallChevRightOff::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/small_chev_right_off.h b/engines/titanic/gfx/small_chev_right_off.h
new file mode 100644
index 0000000..5a6f3cc
--- /dev/null
+++ b/engines/titanic/gfx/small_chev_right_off.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SMALL_CHEV_RIGHT_OFF_H
+#define TITANIC_SMALL_CHEV_RIGHT_OFF_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CSmallChevRightOff : public CToggleSwitch {
+public:
+	CSmallChevRightOff();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSmallChevRightOff"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SMALL_CHEV_RIGHT_OFF_H */
diff --git a/engines/titanic/gfx/small_chev_right_on.cpp b/engines/titanic/gfx/small_chev_right_on.cpp
new file mode 100644
index 0000000..714b6b3
--- /dev/null
+++ b/engines/titanic/gfx/small_chev_right_on.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/small_chev_right_on.h"
+
+namespace Titanic {
+
+CSmallChevRightOn::CSmallChevRightOn() : CToggleSwitch() {
+}
+
+void CSmallChevRightOn::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CSmallChevRightOn::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/small_chev_right_on.h b/engines/titanic/gfx/small_chev_right_on.h
new file mode 100644
index 0000000..f010010
--- /dev/null
+++ b/engines/titanic/gfx/small_chev_right_on.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SMALL_CHEV_RIGHT_ON_H
+#define TITANIC_SMALL_CHEV_RIGHT_ON_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CSmallChevRightOn : public CToggleSwitch {
+public:
+	CSmallChevRightOn();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSmallChevRightOn"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SMALL_CHEV_RIGHT_ON_H */
diff --git a/engines/titanic/gfx/toggle_switch.cpp b/engines/titanic/gfx/toggle_switch.cpp
new file mode 100644
index 0000000..3307146
--- /dev/null
+++ b/engines/titanic/gfx/toggle_switch.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+CToggleSwitch::CToggleSwitch() : CGameObject(), _fieldBC(0) {
+}
+
+void CToggleSwitch::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writePoint(_pos1, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CToggleSwitch::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_pos1 = file->readPoint();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/toggle_switch.h b/engines/titanic/gfx/toggle_switch.h
new file mode 100644
index 0000000..977661d
--- /dev/null
+++ b/engines/titanic/gfx/toggle_switch.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TOGGLE_SWITCH_H
+#define TITANIC_TOGGLE_SWITCH_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CToggleSwitch : public CGameObject {
+private:
+	int _fieldBC;
+	Common::Point _pos1;
+public:
+	CToggleSwitch();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CToggleSwitch"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TOGGLE_SWITCH_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index e91a602..d8d87f0 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -41,11 +41,35 @@ MODULE_OBJS := \
 	game/television.o \
 	gfx/act_button.o \
 	gfx/changes_season_button.o \
+	gfx/chev_left_off.o \
+	gfx/chev_left_on.o \
+	gfx/chev_right_off.o \
+	gfx/chev_right_on.o \
+	gfx/chev_send_rec_switch.o \
+	gfx/chev_switch.o \
 	gfx/elevator_button.o \
+	gfx/get_from_succ.o \
+	gfx/helmet_on_off.o \
+	gfx/home_photo.o \
+	gfx/icon_nav_action.o \
+	gfx/icon_nav_down.o \
+	gfx/icon_nav_left.o \
+	gfx/icon_nav_right.o \
+	gfx/icon_nav_up.o \
+	gfx/keybrd_butt.o \
 	gfx/move_object_button.o \
+	gfx/pet_mode_off.o \
+	gfx/pet_mode_on.o \
+	gfx/pet_mode_panel.o \
+	gfx/send_to_succ.o \
 	gfx/slider_button.o \
-	gfx/st_button.o \
+	gfx/small_chev_left_off.o \
+	gfx/small_chev_left_on.o \
+	gfx/small_chev_right_off.o \
+	gfx/small_chev_right_on.o \
 	gfx/status_change_button.o \
+	gfx/st_button.o \
+	gfx/toggle_switch.o \
 	messages/auto_sound_event.o \
 	messages/door_auto_sound_event.o \
 	moves/enter_bomb_room.o \
@@ -88,3 +112,4 @@ endif
 
 # Include common rules
 include $(srcdir)/rules.mk
+


Commit: bc3e04400843615a77fd8df5a911070350f2323e
    https://github.com/scummvm/scummvm/commit/bc3e04400843615a77fd8df5a911070350f2323e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-26T22:08:54-05:00

Commit Message:
TITANIC: Implemented CStartAction and CHammerDispensorButton

Changed paths:
  A engines/titanic/game/hammer_dispensor_button.cpp
  A engines/titanic/game/hammer_dispensor_button.h
  A engines/titanic/game/start_action.cpp
  A engines/titanic/game/start_action.h
  R engines/titanic/game/door_auto_sound_event.cpp
  R engines/titanic/game/door_auto_sound_event.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/service_elevator_door.h
    engines/titanic/messages/door_auto_sound_event.h
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index e87325a..966e441 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -36,9 +36,11 @@
 #include "titanic/core/view_item.h"
 
 #include "titanic/game/announce.h"
+#include "titanic/game/hammer_dispensor_button.h"
 #include "titanic/game/pet_position.h"
 #include "titanic/game/room_item.h"
 #include "titanic/game/service_elevator_door.h"
+#include "titanic/game/start_action.h"
 #include "titanic/game/sub_glass.h"
 #include "titanic/game/television.h"
 
@@ -129,9 +131,11 @@ DEFFN(CTreeItem);
 DEFFN(CViewItem);
 
 DEFFN(CAnnounce);
+DEFFN(CHammerDispensorButton);
 DEFFN(CPETPosition);
 DEFFN(CRoomItem);
 DEFFN(CServiceElevatorDoor);
+DEFFN(CStartAction);
 DEFFN(CSUBGlass);
 DEFFN(CTelevision);
 
@@ -215,9 +219,11 @@ void CSaveableObject::initClassList() {
 	ADDFN(CViewItem);
 
 	ADDFN(CAnnounce);
+	ADDFN(CHammerDispensorButton);
 	ADDFN(CPETPosition);
 	ADDFN(CRoomItem);
 	ADDFN(CServiceElevatorDoor);
+	ADDFN(CStartAction);
 	ADDFN(CSUBGlass);
 	ADDFN(CTelevision);
 
diff --git a/engines/titanic/game/door_auto_sound_event.cpp b/engines/titanic/game/door_auto_sound_event.cpp
deleted file mode 100644
index 158c147..0000000
--- a/engines/titanic/game/door_auto_sound_event.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/door_auto_sound_event.h"
-
-namespace Titanic {
-
-CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(),
-		_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
-}
-
-void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeQuotedLine(_string2, indent);
-	file->writeNumberLine(_fieldDC, indent);
-	file->writeNumberLine(_fieldE0, indent);
-
-	CAutoSoundEvent::save(file, indent);
-}
-
-void CDoorAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_string1 = file->readString();
-	_string2 = file->readString();
-	_fieldDC = file->readNumber();
-	_fieldE0 = file->readNumber();
-
-	CAutoSoundEvent::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/door_auto_sound_event.h b/engines/titanic/game/door_auto_sound_event.h
deleted file mode 100644
index 9bba304..0000000
--- a/engines/titanic/game/door_auto_sound_event.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_DOOR_AUTO_SOUND_EVENT_H
-#define TITANIC_DOOR_AUTO_SOUND_EVENT_H
-
-#include "titanic/messages/auto_sound_event.h"
-
-namespace Titanic {
-
-class CDoorAutoSoundEvent : public CAutoSoundEvent {
-protected:
-	CString _string1;
-	CString _string2;
-	int _fieldDC;
-	int _fieldE0;
-public:
-	CDoorAutoSoundEvent();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_DOOR_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/game/hammer_dispensor_button.cpp b/engines/titanic/game/hammer_dispensor_button.cpp
new file mode 100644
index 0000000..eb9fa38
--- /dev/null
+++ b/engines/titanic/game/hammer_dispensor_button.cpp
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/hammer_dispensor_button.h"
+
+namespace Titanic {
+
+CHammerDispensorButton::CHammerDispensorButton() : CStartAction(),
+	_fieldF8(0), _fieldFC(0), _field100(0), _field104(56),
+	_field108(6), _field10C(0), _field110(0) {
+}
+
+void CHammerDispensorButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_fieldFC, indent);
+	file->writeNumberLine(_field100, indent);
+	file->writeNumberLine(_field104, indent);
+	file->writeNumberLine(_field108, indent);
+	file->writeNumberLine(_field110, indent);
+
+	CStartAction::save(file, indent);
+}
+
+void CHammerDispensorButton::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldF8 = file->readNumber();
+	_fieldFC = file->readNumber();
+	_field100 = file->readNumber();
+	_field104 = file->readNumber();
+	_field108 = file->readNumber();
+	_field110 = file->readNumber();
+
+	CStartAction::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/hammer_dispensor_button.h b/engines/titanic/game/hammer_dispensor_button.h
new file mode 100644
index 0000000..e4b5fc1
--- /dev/null
+++ b/engines/titanic/game/hammer_dispensor_button.h
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_HAMMER_DISPENSOR_H
+#define TITANIC_HAMMER_DISPENSOR_H
+
+#include "titanic/game/start_action.h"
+
+namespace Titanic {
+
+class CHammerDispensorButton : public CStartAction {
+private:
+	int _fieldF8;
+	int _fieldFC;
+	int _field100;
+	int _field104;
+	int _field108;
+	int _field10C;
+	int _field110;
+public:
+	CHammerDispensorButton();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CHammerDispensorButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HAMMER_DISPENSOR_H */
diff --git a/engines/titanic/game/service_elevator_door.h b/engines/titanic/game/service_elevator_door.h
index 3ad897c..a3a8388 100644
--- a/engines/titanic/game/service_elevator_door.h
+++ b/engines/titanic/game/service_elevator_door.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_SERVICE_ELEVATOR_DOOR_H
 #define TITANIC_SERVICE_ELEVATOR_DOOR_H
 
-#include "titanic/game/door_auto_sound_event.h"
+#include "titanic/messages/door_auto_sound_event.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/game/start_action.cpp b/engines/titanic/game/start_action.cpp
new file mode 100644
index 0000000..9bafd01
--- /dev/null
+++ b/engines/titanic/game/start_action.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/start_action.h"
+
+namespace Titanic {
+
+CStartAction::CStartAction() : CBackground() {
+}
+
+void CStartAction::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeQuotedLine(_string4, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CStartAction::load(SimpleFile *file) {
+	file->readNumber();
+	_string3 = file->readString();
+	_string4 = file->readString();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/start_action.h b/engines/titanic/game/start_action.h
new file mode 100644
index 0000000..3725dbc
--- /dev/null
+++ b/engines/titanic/game/start_action.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_START_ACTION_H
+#define TITANIC_START_ACTION_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CStartAction : public CBackground {
+protected:
+	CString _string3;
+	CString _string4;
+public:
+	CStartAction();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CStartAction"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_START_ACTION_H */
diff --git a/engines/titanic/messages/door_auto_sound_event.h b/engines/titanic/messages/door_auto_sound_event.h
index a231b2f..9bba304 100644
--- a/engines/titanic/messages/door_auto_sound_event.h
+++ b/engines/titanic/messages/door_auto_sound_event.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CDoorAutoSoundEvent : public CAutoSoundEvent {
-private:
+protected:
 	CString _string1;
 	CString _string2;
 	int _fieldDC;
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index d8d87f0..e10fe31 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -34,9 +34,11 @@ MODULE_OBJS := \
 	core/tree_item.o \
 	core/view_item.o \
 	game/announce.o \
+	game/hammer_dispensor_button.o \
 	game/pet_position.o \
 	game/room_item.o \
 	game/service_elevator_door.o \
+	game/start_action.o \
 	game/sub_glass.o \
 	game/television.o \
 	gfx/act_button.o \


Commit: 405c1d97330a1f158bdc5c472ff1bf778542fb5a
    https://github.com/scummvm/scummvm/commit/405c1d97330a1f158bdc5c472ff1bf778542fb5a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-26T22:15:08-05:00

Commit Message:
TITANIC: Implemented CDeadArea

Changed paths:
  A engines/titanic/game/dead_area.cpp
  A engines/titanic/game/dead_area.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 966e441..7451852 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -36,6 +36,7 @@
 #include "titanic/core/view_item.h"
 
 #include "titanic/game/announce.h"
+#include "titanic/game/dead_area.h"
 #include "titanic/game/hammer_dispensor_button.h"
 #include "titanic/game/pet_position.h"
 #include "titanic/game/room_item.h"
@@ -131,6 +132,7 @@ DEFFN(CTreeItem);
 DEFFN(CViewItem);
 
 DEFFN(CAnnounce);
+DEFFN(CDeadArea);
 DEFFN(CHammerDispensorButton);
 DEFFN(CPETPosition);
 DEFFN(CRoomItem);
@@ -219,6 +221,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CViewItem);
 
 	ADDFN(CAnnounce);
+	ADDFN(CDeadArea);
 	ADDFN(CHammerDispensorButton);
 	ADDFN(CPETPosition);
 	ADDFN(CRoomItem);
diff --git a/engines/titanic/game/dead_area.cpp b/engines/titanic/game/dead_area.cpp
new file mode 100644
index 0000000..1692d6b
--- /dev/null
+++ b/engines/titanic/game/dead_area.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/dead_area.h"
+
+namespace Titanic {
+
+CDeadArea::CDeadArea() : CGameObject() {
+}
+
+void CDeadArea::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CDeadArea::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/dead_area.h b/engines/titanic/game/dead_area.h
new file mode 100644
index 0000000..374e45e
--- /dev/null
+++ b/engines/titanic/game/dead_area.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DEAD_AREA_H
+#define TITANIC_DEAD_AREA_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CDeadArea : public CGameObject {
+public:
+	CDeadArea();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDeadArea"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DEAD_AREA_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index e10fe31..c90f300 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -34,6 +34,7 @@ MODULE_OBJS := \
 	core/tree_item.o \
 	core/view_item.o \
 	game/announce.o \
+	game/dead_area.o \
 	game/hammer_dispensor_button.o \
 	game/pet_position.o \
 	game/room_item.o \


Commit: 03f842f8ebe6413db2592785a5e69830f9a6e58b
    https://github.com/scummvm/scummvm/commit/03f842f8ebe6413db2592785a5e69830f9a6e58b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-26T22:36:59-05:00

Commit Message:
TITANIC: Implement computer and CDROM classes

Changed paths:
  A engines/titanic/game/cdrom.cpp
  A engines/titanic/game/cdrom.h
  A engines/titanic/game/cdrom_computer.cpp
  A engines/titanic/game/cdrom_computer.h
  A engines/titanic/game/cdrom_tray.cpp
  A engines/titanic/game/cdrom_tray.h
  A engines/titanic/game/computer_screen.cpp
  A engines/titanic/game/computer_screen.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 7451852..83b1d3c 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -36,6 +36,10 @@
 #include "titanic/core/view_item.h"
 
 #include "titanic/game/announce.h"
+#include "titanic/game/cdrom.h"
+#include "titanic/game/cdrom_computer.h"
+#include "titanic/game/cdrom_tray.h"
+#include "titanic/game/computer_screen.h"
 #include "titanic/game/dead_area.h"
 #include "titanic/game/hammer_dispensor_button.h"
 #include "titanic/game/pet_position.h"
@@ -132,6 +136,10 @@ DEFFN(CTreeItem);
 DEFFN(CViewItem);
 
 DEFFN(CAnnounce);
+DEFFN(CCDROM);
+DEFFN(CCDROMComputer);
+DEFFN(CCDROMTray);
+DEFFN(CComputerScreen);
 DEFFN(CDeadArea);
 DEFFN(CHammerDispensorButton);
 DEFFN(CPETPosition);
@@ -221,6 +229,10 @@ void CSaveableObject::initClassList() {
 	ADDFN(CViewItem);
 
 	ADDFN(CAnnounce);
+	ADDFN(CCDROM);
+	ADDFN(CCDROMComputer);
+	ADDFN(CCDROMTray);
+	ADDFN(CComputerScreen);
 	ADDFN(CDeadArea);
 	ADDFN(CHammerDispensorButton);
 	ADDFN(CPETPosition);
diff --git a/engines/titanic/game/cdrom.cpp b/engines/titanic/game/cdrom.cpp
new file mode 100644
index 0000000..40e8ed0
--- /dev/null
+++ b/engines/titanic/game/cdrom.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/cdrom.h"
+
+namespace Titanic {
+
+CCDROM::CCDROM() : CGameObject() {
+}
+
+void CCDROM::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writePoint(_pos1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CCDROM::load(SimpleFile *file) {
+	file->readNumber();
+	_pos1 = file->readPoint();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/cdrom.h b/engines/titanic/game/cdrom.h
new file mode 100644
index 0000000..cd05c79
--- /dev/null
+++ b/engines/titanic/game/cdrom.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CDROM_H
+#define TITANIC_CDROM_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CCDROM : public CGameObject {
+private:
+	Common::Point _pos1;
+public:
+	CCDROM();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCDROM"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CDROM_H */
diff --git a/engines/titanic/game/cdrom_computer.cpp b/engines/titanic/game/cdrom_computer.cpp
new file mode 100644
index 0000000..e67e4fb
--- /dev/null
+++ b/engines/titanic/game/cdrom_computer.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/cdrom_computer.h"
+
+namespace Titanic {
+
+CCDROMComputer::CCDROMComputer() : CGameObject(),
+		_fieldBC(0), _fieldC0(3), _fieldC4(55), _fieldC8(32) {
+}
+
+void CCDROMComputer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CCDROMComputer::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/cdrom_computer.h b/engines/titanic/game/cdrom_computer.h
new file mode 100644
index 0000000..368c45f
--- /dev/null
+++ b/engines/titanic/game/cdrom_computer.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CDROM_COMPUTER_H
+#define TITANIC_CDROM_COMPUTER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CCDROMComputer : public CGameObject {
+private:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+public:
+	CCDROMComputer();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCDROMComputer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CDROM_COMPUTER_H */
diff --git a/engines/titanic/game/cdrom_tray.cpp b/engines/titanic/game/cdrom_tray.cpp
new file mode 100644
index 0000000..32eea06
--- /dev/null
+++ b/engines/titanic/game/cdrom_tray.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/cdrom_tray.h"
+
+namespace Titanic {
+
+CCDROMTray::CCDROMTray() : CGameObject(), _fieldBC(0) {
+}
+
+void CCDROMTray::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeQuotedLine(_string1, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CCDROMTray::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_string1 = file->readString();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/cdrom_tray.h b/engines/titanic/game/cdrom_tray.h
new file mode 100644
index 0000000..371187e
--- /dev/null
+++ b/engines/titanic/game/cdrom_tray.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CDROM_TRAY_H
+#define TITANIC_CDROM_TRAY_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CCDROMTray : public CGameObject {
+private:
+	int _fieldBC;
+	CString _string1;
+public:
+	CCDROMTray();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCDROMTray"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CDROM_TRAY_H */
diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp
new file mode 100644
index 0000000..04de5e5
--- /dev/null
+++ b/engines/titanic/game/computer_screen.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/computer_screen.h"
+
+namespace Titanic {
+
+CComputerScreen::CComputerScreen() : CGameObject() {
+}
+
+void CComputerScreen::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CComputerScreen::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/computer_screen.h b/engines/titanic/game/computer_screen.h
new file mode 100644
index 0000000..adb8b99
--- /dev/null
+++ b/engines/titanic/game/computer_screen.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_COMPUTER_SCREEN_H
+#define TITANIC_COMPUTER_SCREEN_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CComputerScreen : public CGameObject {
+public:
+	CComputerScreen();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CComputerScreen"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_COMPUTER_SCREEN_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index c90f300..40b5b32 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -34,6 +34,10 @@ MODULE_OBJS := \
 	core/tree_item.o \
 	core/view_item.o \
 	game/announce.o \
+	game/cdrom.o \
+	game/cdrom_computer.o \
+	game/cdrom_tray.o \
+	game/computer_screen.o \
 	game/dead_area.o \
 	game/hammer_dispensor_button.o \
 	game/pet_position.o \


Commit: b93f4e70777275cf259d3ac763d10134805b4042
    https://github.com/scummvm/scummvm/commit/b93f4e70777275cf259d3ac763d10134805b4042
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-27T09:11:59-05:00

Commit Message:
TITANIC: Added CCarry and descendent classes

Changed paths:
  A engines/titanic/carry/arm.cpp
  A engines/titanic/carry/arm.h
  A engines/titanic/carry/brain.cpp
  A engines/titanic/carry/brain.h
  A engines/titanic/carry/bridge_piece.cpp
  A engines/titanic/carry/bridge_piece.h
  A engines/titanic/carry/carry.cpp
  A engines/titanic/carry/carry.h
  A engines/titanic/carry/carry_parrot.cpp
  A engines/titanic/carry/carry_parrot.h
  A engines/titanic/carry/chicken.cpp
  A engines/titanic/carry/chicken.h
  A engines/titanic/carry/crushed_tv.cpp
  A engines/titanic/carry/crushed_tv.h
  A engines/titanic/carry/ear.cpp
  A engines/titanic/carry/ear.h
  A engines/titanic/carry/eye.cpp
  A engines/titanic/carry/eye.h
  A engines/titanic/carry/feathers.cpp
  A engines/titanic/carry/feathers.h
  A engines/titanic/carry/fruit.cpp
  A engines/titanic/carry/fruit.h
  A engines/titanic/carry/glass.cpp
  A engines/titanic/carry/glass.h
  A engines/titanic/carry/hammer.cpp
  A engines/titanic/carry/hammer.h
  A engines/titanic/carry/head_piece.cpp
  A engines/titanic/carry/head_piece.h
  A engines/titanic/carry/hose.cpp
  A engines/titanic/carry/hose.h
  A engines/titanic/carry/key.cpp
  A engines/titanic/carry/key.h
  A engines/titanic/carry/liftbot_head.cpp
  A engines/titanic/carry/liftbot_head.h
  A engines/titanic/carry/long_stick.cpp
  A engines/titanic/carry/long_stick.h
  A engines/titanic/carry/magazine.cpp
  A engines/titanic/carry/magazine.h
  A engines/titanic/carry/mouth.cpp
  A engines/titanic/carry/mouth.h
  A engines/titanic/carry/napkin.cpp
  A engines/titanic/carry/napkin.h
  A engines/titanic/carry/nose.cpp
  A engines/titanic/carry/nose.h
  A engines/titanic/carry/note.cpp
  A engines/titanic/carry/note.h
  A engines/titanic/carry/parcel.cpp
  A engines/titanic/carry/parcel.h
  A engines/titanic/carry/phonograph_cylinder.cpp
  A engines/titanic/carry/phonograph_cylinder.h
  A engines/titanic/carry/photograph.cpp
  A engines/titanic/carry/photograph.h
  A engines/titanic/carry/plug_in.cpp
  A engines/titanic/carry/plug_in.h
  A engines/titanic/carry/sweets.cpp
  A engines/titanic/carry/sweets.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/carry/arm.cpp b/engines/titanic/carry/arm.cpp
new file mode 100644
index 0000000..fdf73e9
--- /dev/null
+++ b/engines/titanic/carry/arm.cpp
@@ -0,0 +1,75 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/arm.h"
+
+namespace Titanic {
+
+CArm::CArm() : CCarry(), _string6("Key"),
+	_field138(0), _field13C(0), _field140(0), _field144(0),
+	_field148(0), _field158(0), _field15C(220), _field160(208),
+	_field164(409), _field168(350), _field16C(3), _field170(0) {
+}
+
+void CArm::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string6, indent);
+	file->writeNumberLine(_field138, indent);
+	file->writeNumberLine(_field13C, indent);
+	file->writeNumberLine(_field140, indent);
+	file->writeNumberLine(_field144, indent);
+	file->writeNumberLine(_field148, indent);
+
+	file->writeQuotedLine(_string7, indent);
+	file->writeNumberLine(_field158, indent);
+	file->writeNumberLine(_field15C, indent);
+	file->writeNumberLine(_field160, indent);
+	file->writeNumberLine(_field164, indent);
+	file->writeNumberLine(_field168, indent);
+	file->writeNumberLine(_field16C, indent);
+	file->writeNumberLine(_field170, indent);
+
+	CCarry::save(file, indent);
+}
+
+void CArm::load(SimpleFile *file) {
+	file->readNumber();
+	_string6 = file->readString();
+	_field138 = file->readNumber();
+	_field13C = file->readNumber();
+	_field140 = file->readNumber();
+	_field144 = file->readNumber();
+	_field148 = file->readNumber();
+
+	_string7 = file->readString();
+	_field158 = file->readNumber();
+	_field15C = file->readNumber();
+	_field160 = file->readNumber();
+	_field164 = file->readNumber();
+	_field168 = file->readNumber();
+	_field16C = file->readNumber();
+	_field170 = file->readNumber();
+
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/arm.h b/engines/titanic/carry/arm.h
new file mode 100644
index 0000000..4874707
--- /dev/null
+++ b/engines/titanic/carry/arm.h
@@ -0,0 +1,67 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ARM_H
+#define TITANIC_ARM_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CArm : public CCarry {
+private:
+	CString _string6;
+	int _field138;
+	int _field13C;
+	int _field140;
+	int _field144;
+	int _field148;
+	CString _string7;
+	int _field158;
+	int _field15C;
+	int _field160;
+	int _field164;
+	int _field168;
+	int _field16C;
+	int _field170;
+public:
+	CArm();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CArm"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ARM_H */
diff --git a/engines/titanic/carry/brain.cpp b/engines/titanic/carry/brain.cpp
new file mode 100644
index 0000000..f37549c
--- /dev/null
+++ b/engines/titanic/carry/brain.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/brain.h"
+
+namespace Titanic {
+
+CBrain::CBrain() : CCarry(), _field12C(0),
+		_field130(0), _field134(0), _field138(0) {
+}
+
+void CBrain::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field12C, indent);
+	file->writeNumberLine(_field134, indent);
+	file->writeNumberLine(_field138, indent);
+
+	CCarry::save(file, indent);
+}
+
+void CBrain::load(SimpleFile *file) {
+	file->readNumber();
+	_field12C = file->readNumber();
+	_field134 = file->readNumber();
+	_field138 = file->readNumber();
+
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/brain.h b/engines/titanic/carry/brain.h
new file mode 100644
index 0000000..9037230
--- /dev/null
+++ b/engines/titanic/carry/brain.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BRAIN_H
+#define TITANIC_BRAIN_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CBrain : public CCarry {
+private:
+	int _field12C;
+	int _field130;
+	int _field134;
+	int _field138;
+public:
+	CBrain();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBrain"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BRAIN_H */
diff --git a/engines/titanic/carry/bridge_piece.cpp b/engines/titanic/carry/bridge_piece.cpp
new file mode 100644
index 0000000..b9c998d
--- /dev/null
+++ b/engines/titanic/carry/bridge_piece.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/bridge_piece.h"
+
+namespace Titanic {
+
+CBridgePiece::CBridgePiece() : CCarry(),
+		_field138(0), _field13C(0), _field140(0) {
+}
+
+void CBridgePiece::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string6, indent);
+	file->writeNumberLine(_field138, indent);
+	file->writeNumberLine(_field140, indent);
+
+	CCarry::save(file, indent);
+}
+
+void CBridgePiece::load(SimpleFile *file) {
+	file->readNumber();
+	_string6 = file->readString();
+	_field138 = file->readNumber();
+	_field140 = file->readNumber();
+
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/bridge_piece.h b/engines/titanic/carry/bridge_piece.h
new file mode 100644
index 0000000..f38e27e
--- /dev/null
+++ b/engines/titanic/carry/bridge_piece.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BRIDGE_PIECE_H
+#define TITANIC_BRIDGE_PIECE_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CBridgePiece : public CCarry {
+private:
+	CString _string6;
+	int _field138;
+	int _field13C;
+	int _field140;
+public:
+	CBridgePiece();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBridgePiece"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BRIDGE_PIECE_H */
diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
new file mode 100644
index 0000000..604c952
--- /dev/null
+++ b/engines/titanic/carry/carry.cpp
@@ -0,0 +1,81 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+CCarry::CCarry() : CGameObject(), _fieldC8(0), _fieldCC(0),
+	_fieldDC(0), _fieldE0(1), _fieldFC(0), _field100(0),
+	_field104(0), _field108(0), _field10C(0), _field110(0),
+	_field120(0), _field124(0), _field128(0), 
+	_string1("None"),
+	_string2("NULL"),
+	_string3("That doesn't seem to do anything."),
+	_string4("It doesn't seem to want this.") {
+}
+
+void CCarry::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldDC, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeQuotedLine(_string4, indent);
+	file->writeNumberLine(_fieldFC, indent);
+	file->writeNumberLine(_field104, indent);
+	file->writeNumberLine(_field108, indent);
+	file->writeNumberLine(_field10C, indent);
+	file->writeNumberLine(_field110, indent);
+	file->writeQuotedLine(_string5, indent);
+	file->writeNumberLine(_field120, indent);
+	file->writeNumberLine(_field124, indent);
+	file->writeNumberLine(_field128, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CCarry::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_fieldC8 = file->readNumber();
+	_string2 = file->readString();
+	_fieldDC = file->readNumber();
+	_fieldE0 = file->readNumber();
+	_string3 = file->readString();
+	_string4 = file->readString();
+	_fieldFC = file->readNumber();
+	_field104 = file->readNumber();
+	_field108 = file->readNumber();
+	_field10C = file->readNumber();
+	_field110 = file->readNumber();
+	_string5 = file->readString();
+	_field120 = file->readNumber();
+	_field124 = file->readNumber();
+	_field128 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
new file mode 100644
index 0000000..4bf98b7
--- /dev/null
+++ b/engines/titanic/carry/carry.h
@@ -0,0 +1,71 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CARRY_H
+#define TITANIC_CARRY_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CCarry : public CGameObject {
+private:
+	CString _string1;
+	int _fieldC8;
+	int _fieldCC;
+	CString _string2;
+	int _fieldDC;
+	int _fieldE0;
+	CString _string3;
+	CString _string4;
+	int _fieldFC;
+	int _field100;
+	int _field104;
+	int _field108;
+	int _field10C;
+	int _field110;
+	CString _string5;
+	int _field120;
+	int _field124;
+	int _field128;
+public:
+	CCarry();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCarry"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CARRY_H */
diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
new file mode 100644
index 0000000..80c8332
--- /dev/null
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/carry_parrot.h"
+
+namespace Titanic {
+
+CCarryParrot::CCarryParrot() : CCarry(), _string6("PerchedParrot"),
+		_field138(0), _field13C(0), _field140(0), _field144(10),
+		_field148(25), _field14C(0), _field150(8) {
+}
+
+void CCarryParrot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string6, indent);
+	file->writeNumberLine(_field138, indent);
+	file->writeNumberLine(_field13C, indent);
+	file->writeNumberLine(_field140, indent);
+
+	CCarry::save(file, indent);
+}
+
+void CCarryParrot::load(SimpleFile *file) {
+	file->readNumber();
+	_string6 = file->readString();
+	_field138 = file->readNumber();
+	_field13C = file->readNumber();
+	_field140 = file->readNumber();
+
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/carry_parrot.h b/engines/titanic/carry/carry_parrot.h
new file mode 100644
index 0000000..d4c7100
--- /dev/null
+++ b/engines/titanic/carry/carry_parrot.h
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CARRY_PARROT_H
+#define TITANIC_CARRY_PARROT_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CCarryParrot : public CCarry {
+private:
+	CString _string6;
+	int _field138;
+	int _field13C;
+	int _field140;
+	int _field144;
+	int _field148;
+	int _field14C;
+	int _field150;
+public:
+	CCarryParrot();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCarryParrot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CARRY_PARROT_H */
diff --git a/engines/titanic/carry/chicken.cpp b/engines/titanic/carry/chicken.cpp
new file mode 100644
index 0000000..972c993
--- /dev/null
+++ b/engines/titanic/carry/chicken.cpp
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/chicken.h"
+
+namespace Titanic {
+
+int CChicken::_v1;
+
+CChicken::CChicken() : CCarry(), _string6("None"),
+		_field12C(1), _field13C(0), _field140(0) {
+}
+
+void CChicken::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field12C, indent);
+	file->writeQuotedLine(_string6, indent);
+	file->writeNumberLine(_field13C, indent);
+	file->writeNumberLine(_field140, indent);
+
+	CCarry::save(file, indent);
+}
+
+void CChicken::load(SimpleFile *file) {
+	file->readNumber();
+	_field12C = file->readNumber();
+	_string6 = file->readString();
+	_field13C = file->readNumber();
+	_field140 = file->readNumber();
+
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/chicken.h b/engines/titanic/carry/chicken.h
new file mode 100644
index 0000000..a2ca321
--- /dev/null
+++ b/engines/titanic/carry/chicken.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHICKEN_H
+#define TITANIC_CHICKEN_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CChicken : public CCarry {
+private:
+	static int _v1;
+private:
+	int _field12C;
+	CString _string6;
+	int _field13C;
+	int _field140;
+public:
+	CChicken();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CChicken"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CHICKEN_H */
diff --git a/engines/titanic/carry/crushed_tv.cpp b/engines/titanic/carry/crushed_tv.cpp
new file mode 100644
index 0000000..a0a7ee7
--- /dev/null
+++ b/engines/titanic/carry/crushed_tv.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/crushed_tv.h"
+
+namespace Titanic {
+
+CCrushedTV::CCrushedTV() : CCarry() {
+}
+
+void CCrushedTV::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CCarry::save(file, indent);
+}
+
+void CCrushedTV::load(SimpleFile *file) {
+	file->readNumber();
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/crushed_tv.h b/engines/titanic/carry/crushed_tv.h
new file mode 100644
index 0000000..ccbeac5
--- /dev/null
+++ b/engines/titanic/carry/crushed_tv.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CRUSHED_TV_H
+#define TITANIC_CRUSHED_TV_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CCrushedTV : public CCarry {
+public:
+	CCrushedTV();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCrushedTV"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CRUSHED_TV_H */
diff --git a/engines/titanic/carry/ear.cpp b/engines/titanic/carry/ear.cpp
new file mode 100644
index 0000000..d87b09d
--- /dev/null
+++ b/engines/titanic/carry/ear.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/ear.h"
+
+namespace Titanic {
+
+CEar::CEar() : CHeadPiece() {
+}
+
+void CEar::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CHeadPiece::save(file, indent);
+}
+
+void CEar::load(SimpleFile *file) {
+	file->readNumber();
+	CHeadPiece::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/ear.h b/engines/titanic/carry/ear.h
new file mode 100644
index 0000000..fbee7d0
--- /dev/null
+++ b/engines/titanic/carry/ear.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EAR_H
+#define TITANIC_EAR_H
+
+#include "titanic/carry/head_piece.h"
+
+namespace Titanic {
+
+class CEar : public CHeadPiece {
+public:
+	CEar();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEar"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EAR_H */
diff --git a/engines/titanic/carry/eye.cpp b/engines/titanic/carry/eye.cpp
new file mode 100644
index 0000000..21fc3fa
--- /dev/null
+++ b/engines/titanic/carry/eye.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/eye.h"
+
+namespace Titanic {
+
+CEye::CEye() : CHeadPiece(), _eyeNum(0) {
+}
+
+void CEye::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_eyeNum, indent);
+	CHeadPiece::save(file, indent);
+}
+
+void CEye::load(SimpleFile *file) {
+	file->readNumber();
+	_eyeNum = file->readNumber();
+	CHeadPiece::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/eye.h b/engines/titanic/carry/eye.h
new file mode 100644
index 0000000..0f0e73b
--- /dev/null
+++ b/engines/titanic/carry/eye.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EYE_H
+#define TITANIC_EYE_H
+
+#include "titanic/carry/head_piece.h"
+
+namespace Titanic {
+
+class CEye : public CHeadPiece {
+private:
+	int _eyeNum;
+public:
+	CEye();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEye"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EYE_H */
diff --git a/engines/titanic/carry/feathers.cpp b/engines/titanic/carry/feathers.cpp
new file mode 100644
index 0000000..c03b738
--- /dev/null
+++ b/engines/titanic/carry/feathers.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/feathers.h"
+
+namespace Titanic {
+
+CFeathers::CFeathers() : CCarry() {
+}
+
+void CFeathers::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CCarry::save(file, indent);
+}
+
+void CFeathers::load(SimpleFile *file) {
+	file->readNumber();
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/feathers.h b/engines/titanic/carry/feathers.h
new file mode 100644
index 0000000..8fc11b7
--- /dev/null
+++ b/engines/titanic/carry/feathers.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FEATHERS_H
+#define TITANIC_FEATHERS_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CFeathers : public CCarry {
+public:
+	CFeathers();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CFeathers"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FEATHERS_H */
diff --git a/engines/titanic/carry/fruit.cpp b/engines/titanic/carry/fruit.cpp
new file mode 100644
index 0000000..3355d6e
--- /dev/null
+++ b/engines/titanic/carry/fruit.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/fruit.h"
+
+namespace Titanic {
+
+CFruit::CFruit() : CCarry(), _field12C(0),
+		_field130(0), _field134(0), _field138(0) {
+}
+
+void CFruit::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field12C, indent);
+	file->writeNumberLine(_field130, indent);
+	file->writeNumberLine(_field134, indent);
+	file->writeNumberLine(_field138, indent);
+
+	CCarry::save(file, indent);
+}
+
+void CFruit::load(SimpleFile *file) {
+	file->readNumber();
+	_field12C = file->readNumber();
+	_field130 = file->readNumber();
+	_field134 = file->readNumber();
+	_field138 = file->readNumber();
+
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/fruit.h b/engines/titanic/carry/fruit.h
new file mode 100644
index 0000000..bc8a109
--- /dev/null
+++ b/engines/titanic/carry/fruit.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FRUIT_H
+#define TITANIC_FRUIT_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CFruit : public CCarry {
+private:
+	int _field12C;
+	int _field130;
+	int _field134;
+	int _field138;
+public:
+	CFruit();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CFruit"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FRUIT_H */
diff --git a/engines/titanic/carry/glass.cpp b/engines/titanic/carry/glass.cpp
new file mode 100644
index 0000000..1f0e059
--- /dev/null
+++ b/engines/titanic/carry/glass.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/glass.h"
+
+namespace Titanic {
+
+CGlass::CGlass() : CCarry(), _string6("None") {
+}
+
+void CGlass::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string6, indent);
+	CCarry::save(file, indent);
+}
+
+void CGlass::load(SimpleFile *file) {
+	file->readNumber();
+	_string6 = file->readString();
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/glass.h b/engines/titanic/carry/glass.h
new file mode 100644
index 0000000..57922c1
--- /dev/null
+++ b/engines/titanic/carry/glass.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GLASS_H
+#define TITANIC_GLASS_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CGlass : public CCarry {
+private:
+	CString _string6;
+public:
+	CGlass();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGlass"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GLASS_H */
diff --git a/engines/titanic/carry/hammer.cpp b/engines/titanic/carry/hammer.cpp
new file mode 100644
index 0000000..f1dc3b2
--- /dev/null
+++ b/engines/titanic/carry/hammer.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/hammer.h"
+
+namespace Titanic {
+
+CHammer::CHammer() : CCarry() {
+}
+
+void CHammer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CCarry::save(file, indent);
+}
+
+void CHammer::load(SimpleFile *file) {
+	file->readNumber();
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/hammer.h b/engines/titanic/carry/hammer.h
new file mode 100644
index 0000000..ec05435
--- /dev/null
+++ b/engines/titanic/carry/hammer.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_HAMMER_H
+#define TITANIC_HAMMER_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CHammer : public CCarry {
+public:
+	CHammer();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CHammer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HAMMER_H */
diff --git a/engines/titanic/carry/head_piece.cpp b/engines/titanic/carry/head_piece.cpp
new file mode 100644
index 0000000..1eab585
--- /dev/null
+++ b/engines/titanic/carry/head_piece.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/head_piece.h"
+
+namespace Titanic {
+
+CHeadPiece::CHeadPiece() : CCarry(), _string6("Not Working"),
+		_field12C(0), _field13C(0) {
+}
+
+void CHeadPiece::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field12C, indent);
+	file->writeQuotedLine(_string6, indent);
+	file->writeNumberLine(_field13C, indent);
+
+	CCarry::save(file, indent);
+}
+
+void CHeadPiece::load(SimpleFile *file) {
+	file->readNumber();
+	_field12C = file->readNumber();
+	_string6 = file->readString();
+	_field13C = file->readNumber();
+
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/head_piece.h b/engines/titanic/carry/head_piece.h
new file mode 100644
index 0000000..ddadb75
--- /dev/null
+++ b/engines/titanic/carry/head_piece.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_HEAD_PIECE_H
+#define TITANIC_HEAD_PIECE_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CHeadPiece : public CCarry {
+private:
+	int _field12C;
+	CString _string6;
+	int _field13C;
+public:
+	CHeadPiece();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CHeadPiece"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HEAD_PIECE_H */
diff --git a/engines/titanic/carry/hose.cpp b/engines/titanic/carry/hose.cpp
new file mode 100644
index 0000000..bb52ec3
--- /dev/null
+++ b/engines/titanic/carry/hose.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/hose.h"
+
+namespace Titanic {
+
+CHose::CHose() : CCarry(),
+	_string6("Succ-U-Bus auxiliary hose attachment incompatible with sliding glass cover.") {
+}
+
+void CHose::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string6, indent);
+	CCarry::save(file, indent);
+}
+
+void CHose::load(SimpleFile *file) {
+	file->readNumber();
+	_string6 = file->readString();
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/hose.h b/engines/titanic/carry/hose.h
new file mode 100644
index 0000000..87f47b3
--- /dev/null
+++ b/engines/titanic/carry/hose.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_HOSE_H
+#define TITANIC_HOSE_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CHose : public CCarry {
+private:
+	CString _string6;
+public:
+	CHose();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CHose"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HOSE_H */
diff --git a/engines/titanic/carry/key.cpp b/engines/titanic/carry/key.cpp
new file mode 100644
index 0000000..2c559bb
--- /dev/null
+++ b/engines/titanic/carry/key.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/key.h"
+
+namespace Titanic {
+
+CKey::CKey() : CCarry() {
+}
+
+void CKey::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CCarry::save(file, indent);
+}
+
+void CKey::load(SimpleFile *file) {
+	file->readNumber();
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/key.h b/engines/titanic/carry/key.h
new file mode 100644
index 0000000..815bb95
--- /dev/null
+++ b/engines/titanic/carry/key.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_KEY_H
+#define TITANIC_KEY_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CKey : public CCarry {
+public:
+	CKey();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CKey"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_KEY_H */
diff --git a/engines/titanic/carry/liftbot_head.cpp b/engines/titanic/carry/liftbot_head.cpp
new file mode 100644
index 0000000..422d88a
--- /dev/null
+++ b/engines/titanic/carry/liftbot_head.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/liftbot_head.h"
+
+namespace Titanic {
+
+CLiftbotHead::CLiftbotHead() : CCarry(), _field12C(0) {
+}
+
+void CLiftbotHead::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field12C, indent);
+	CCarry::save(file, indent);
+}
+
+void CLiftbotHead::load(SimpleFile *file) {
+	file->readNumber();
+	_field12C = file->readNumber();
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/liftbot_head.h b/engines/titanic/carry/liftbot_head.h
new file mode 100644
index 0000000..be4ad58
--- /dev/null
+++ b/engines/titanic/carry/liftbot_head.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LIFTBOT_HEAD_H
+#define TITANIC_LIFTBOT_HEAD_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CLiftbotHead : public CCarry {
+private:
+	int _field12C;
+public:
+	CLiftbotHead();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLiftbotHead"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LIFTBOT_HEAD_H */
diff --git a/engines/titanic/carry/long_stick.cpp b/engines/titanic/carry/long_stick.cpp
new file mode 100644
index 0000000..d5bf73b
--- /dev/null
+++ b/engines/titanic/carry/long_stick.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/long_stick.h"
+
+namespace Titanic {
+
+CLongStick::CLongStick() : CCarry() {
+}
+
+void CLongStick::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CCarry::save(file, indent);
+}
+
+void CLongStick::load(SimpleFile *file) {
+	file->readNumber();
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/long_stick.h b/engines/titanic/carry/long_stick.h
new file mode 100644
index 0000000..3c8646d
--- /dev/null
+++ b/engines/titanic/carry/long_stick.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LONG_STICK_H
+#define TITANIC_LONG_STICK_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CLongStick : public CCarry {
+public:
+	CLongStick();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLongStick"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LONG_STICK_H */
diff --git a/engines/titanic/carry/magazine.cpp b/engines/titanic/carry/magazine.cpp
new file mode 100644
index 0000000..efb68c1
--- /dev/null
+++ b/engines/titanic/carry/magazine.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/magazine.h"
+
+namespace Titanic {
+
+CMagazine::CMagazine() : CCarry() {
+}
+
+void CMagazine::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field12C, indent);
+	file->writeNumberLine(_field130, indent);
+
+	CCarry::save(file, indent);
+}
+
+void CMagazine::load(SimpleFile *file) {
+	file->readNumber();
+	_field12C = file->readNumber();
+	_field130 = file->readNumber();
+
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/magazine.h b/engines/titanic/carry/magazine.h
new file mode 100644
index 0000000..a1a7eee
--- /dev/null
+++ b/engines/titanic/carry/magazine.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MAGAZINE_H
+#define TITANIC_MAGAZINE_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CMagazine : public CCarry {
+private:
+	int _field12C;
+	int _field130;
+public:
+	CMagazine();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMagazine"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MAGAZINE_H */
diff --git a/engines/titanic/carry/mouth.cpp b/engines/titanic/carry/mouth.cpp
new file mode 100644
index 0000000..058ffc4
--- /dev/null
+++ b/engines/titanic/carry/mouth.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/mouth.h"
+
+namespace Titanic {
+
+CMouth::CMouth() : CHeadPiece() {
+}
+
+void CMouth::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CHeadPiece::save(file, indent);
+}
+
+void CMouth::load(SimpleFile *file) {
+	file->readNumber();
+	CHeadPiece::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/mouth.h b/engines/titanic/carry/mouth.h
new file mode 100644
index 0000000..837a658
--- /dev/null
+++ b/engines/titanic/carry/mouth.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOUTH_H
+#define TITANIC_MOUTH_H
+
+#include "titanic/carry/head_piece.h"
+
+namespace Titanic {
+
+class CMouth : public CHeadPiece {
+public:
+	CMouth();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMouth"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOUTH_H */
diff --git a/engines/titanic/carry/napkin.cpp b/engines/titanic/carry/napkin.cpp
new file mode 100644
index 0000000..48d0381
--- /dev/null
+++ b/engines/titanic/carry/napkin.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/napkin.h"
+
+namespace Titanic {
+
+CNapkin::CNapkin() : CCarry() {
+}
+
+void CNapkin::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CCarry::save(file, indent);
+}
+
+void CNapkin::load(SimpleFile *file) {
+	file->readNumber();
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/napkin.h b/engines/titanic/carry/napkin.h
new file mode 100644
index 0000000..549b292
--- /dev/null
+++ b/engines/titanic/carry/napkin.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NAPKIN_H
+#define TITANIC_NAPKIN_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CNapkin : public CCarry {
+public:
+	CNapkin();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNapkin"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NAPKIN_H */
diff --git a/engines/titanic/carry/nose.cpp b/engines/titanic/carry/nose.cpp
new file mode 100644
index 0000000..cd5085d
--- /dev/null
+++ b/engines/titanic/carry/nose.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/nose.h"
+
+namespace Titanic {
+
+CNose::CNose() : CHeadPiece() {
+}
+
+void CNose::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CHeadPiece::save(file, indent);
+}
+
+void CNose::load(SimpleFile *file) {
+	file->readNumber();
+	CHeadPiece::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/nose.h b/engines/titanic/carry/nose.h
new file mode 100644
index 0000000..349c0c6
--- /dev/null
+++ b/engines/titanic/carry/nose.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NOSE_H
+#define TITANIC_NOSE_H
+
+#include "titanic/carry/head_piece.h"
+
+namespace Titanic {
+
+class CNose : public CHeadPiece {
+public:
+	CNose();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNose"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NOSE_H */
diff --git a/engines/titanic/carry/note.cpp b/engines/titanic/carry/note.cpp
new file mode 100644
index 0000000..e840012
--- /dev/null
+++ b/engines/titanic/carry/note.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/note.h"
+
+namespace Titanic {
+
+CNote::CNote() : CCarry(), _field138(1) {
+}
+
+void CNote::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string6, indent);
+	file->writeNumberLine(_field138, indent);
+	
+	CCarry::save(file, indent);
+}
+
+void CNote::load(SimpleFile *file) {
+	file->readNumber();
+	_string6 = file->readString();
+	_field138 = file->readNumber();
+
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/note.h b/engines/titanic/carry/note.h
new file mode 100644
index 0000000..d3923c8
--- /dev/null
+++ b/engines/titanic/carry/note.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NOTE_H
+#define TITANIC_NOTE_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CNote : public CCarry {
+private:
+	CString _string6;
+	int _field138;
+public:
+	CNote();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNote"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NOTE_H */
diff --git a/engines/titanic/carry/parcel.cpp b/engines/titanic/carry/parcel.cpp
new file mode 100644
index 0000000..b450d88
--- /dev/null
+++ b/engines/titanic/carry/parcel.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/parcel.h"
+
+namespace Titanic {
+
+CParcel::CParcel() : CCarry() {
+}
+
+void CParcel::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CCarry::save(file, indent);
+}
+
+void CParcel::load(SimpleFile *file) {
+	file->readNumber();
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/parcel.h b/engines/titanic/carry/parcel.h
new file mode 100644
index 0000000..e16ea9b
--- /dev/null
+++ b/engines/titanic/carry/parcel.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PARCEL_H
+#define TITANIC_PARCEL_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CParcel : public CCarry {
+public:
+	CParcel();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CParcel"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PARCEL_H */
diff --git a/engines/titanic/carry/phonograph_cylinder.cpp b/engines/titanic/carry/phonograph_cylinder.cpp
new file mode 100644
index 0000000..fb58c32
--- /dev/null
+++ b/engines/titanic/carry/phonograph_cylinder.cpp
@@ -0,0 +1,89 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/phonograph_cylinder.h"
+
+namespace Titanic {
+
+CPhonographCylinder::CPhonographCylinder() : CCarry(),
+	_field138(0), _field13C(0), _field140(0),  _field144(0), 
+	_field148(0), _field14C(0), _field150(0), _field154(0), 
+	_field158(0), _field15C(0), _field160(0), _field164(0), 
+	_field168(0), _field16C(0), _field170(0), _field174(0), 
+	_field178(0), _field17C(0), _field180(0), _field184(0) {
+}
+
+void CPhonographCylinder::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string6, indent);
+	file->writeNumberLine(_field138, indent);
+	file->writeNumberLine(_field13C, indent);
+	file->writeNumberLine(_field140, indent);
+	file->writeNumberLine(_field144, indent);
+	file->writeNumberLine(_field148, indent);
+	file->writeNumberLine(_field14C, indent);
+	file->writeNumberLine(_field150, indent);
+	file->writeNumberLine(_field154, indent);
+	file->writeNumberLine(_field158, indent);
+	file->writeNumberLine(_field15C, indent);
+	file->writeNumberLine(_field160, indent);
+	file->writeNumberLine(_field164, indent);
+	file->writeNumberLine(_field168, indent);
+	file->writeNumberLine(_field16C, indent);
+	file->writeNumberLine(_field170, indent);
+	file->writeNumberLine(_field174, indent);
+	file->writeNumberLine(_field178, indent);
+	file->writeNumberLine(_field17C, indent);
+	file->writeNumberLine(_field180, indent);
+	file->writeNumberLine(_field184, indent);
+
+	CCarry::save(file, indent);
+}
+
+void CPhonographCylinder::load(SimpleFile *file) {
+	file->readNumber();
+	_string6 = file->readString();
+	_field138 = file->readNumber();
+	_field13C = file->readNumber();
+	_field140 = file->readNumber();
+	_field144 = file->readNumber();
+	_field148 = file->readNumber();
+	_field14C = file->readNumber();
+	_field150 = file->readNumber();
+	_field154 = file->readNumber();
+	_field158 = file->readNumber();
+	_field15C = file->readNumber();
+	_field160 = file->readNumber();
+	_field164 = file->readNumber();
+	_field168 = file->readNumber();
+	_field16C = file->readNumber();
+	_field170 = file->readNumber();
+	_field174 = file->readNumber();
+	_field178 = file->readNumber();
+	_field17C = file->readNumber();
+	_field180 = file->readNumber();
+	_field184 = file->readNumber();
+
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/phonograph_cylinder.h b/engines/titanic/carry/phonograph_cylinder.h
new file mode 100644
index 0000000..327ba3e
--- /dev/null
+++ b/engines/titanic/carry/phonograph_cylinder.h
@@ -0,0 +1,74 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PHONOGRAPH_CYLINDER_H
+#define TITANIC_PHONOGRAPH_CYLINDER_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CPhonographCylinder : public CCarry {
+private:
+	CString _string6;
+	int _field138;
+	int _field13C;
+	int _field140;
+	int _field144;
+	int _field148;
+	int _field14C;
+	int _field150;
+	int _field154;
+	int _field158;
+	int _field15C;
+	int _field160;
+	int _field164;
+	int _field168;
+	int _field16C;
+	int _field170;
+	int _field174;
+	int _field178;
+	int _field17C;
+	int _field180;
+	int _field184;
+public:
+	CPhonographCylinder();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPhonographCylinder"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PHONOGRAPH_CYLINDER_H */
diff --git a/engines/titanic/carry/photograph.cpp b/engines/titanic/carry/photograph.cpp
new file mode 100644
index 0000000..92549b3
--- /dev/null
+++ b/engines/titanic/carry/photograph.cpp
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/photograph.h"
+
+namespace Titanic {
+
+int CPhotograph::_v1;
+
+CPhotograph::CPhotograph() : CCarry(), _field12C(0), _field130(0) {
+}
+
+void CPhotograph::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field12C, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_field130, indent);
+
+	CCarry::save(file, indent);
+}
+
+void CPhotograph::load(SimpleFile *file) {
+	file->readNumber();
+	_field12C = file->readNumber();
+	_v1 = file->readNumber();
+	_field130 = file->readNumber();
+
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/photograph.h b/engines/titanic/carry/photograph.h
new file mode 100644
index 0000000..1148df1
--- /dev/null
+++ b/engines/titanic/carry/photograph.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PHOTOGRAPH_H
+#define TITANIC_PHOTOGRAPH_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CPhotograph : public CCarry {
+private:
+	static int _v1;
+private:
+	int _field12C;
+	int _field130;
+public:
+	CPhotograph();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPhotograph"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PHOTOGRAPH_H */
diff --git a/engines/titanic/carry/plug_in.cpp b/engines/titanic/carry/plug_in.cpp
new file mode 100644
index 0000000..ff8d9b1
--- /dev/null
+++ b/engines/titanic/carry/plug_in.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/plug_in.h"
+
+namespace Titanic {
+
+CPlugIn::CPlugIn() : CCarry(), _field12C(0) {
+}
+
+void CPlugIn::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CCarry::save(file, indent);
+}
+
+void CPlugIn::load(SimpleFile *file) {
+	file->readNumber();
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/plug_in.h b/engines/titanic/carry/plug_in.h
new file mode 100644
index 0000000..aefb3d1
--- /dev/null
+++ b/engines/titanic/carry/plug_in.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PLUG_IN_H
+#define TITANIC_PLUG_IN_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CPlugIn : public CCarry {
+private:
+	int _field12C;
+public:
+	CPlugIn();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPlugIn"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PLUG_IN_H */
diff --git a/engines/titanic/carry/sweets.cpp b/engines/titanic/carry/sweets.cpp
new file mode 100644
index 0000000..faf3ad9
--- /dev/null
+++ b/engines/titanic/carry/sweets.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/sweets.h"
+
+namespace Titanic {
+
+CSweets::CSweets() : CCarry() {
+}
+
+void CSweets::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CCarry::save(file, indent);
+}
+
+void CSweets::load(SimpleFile *file) {
+	file->readNumber();
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/sweets.h b/engines/titanic/carry/sweets.h
new file mode 100644
index 0000000..1912e89
--- /dev/null
+++ b/engines/titanic/carry/sweets.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SWEETS_H
+#define TITANIC_SWEETS_H
+
+#include "titanic/carry/carry.h"
+
+namespace Titanic {
+
+class CSweets : public CCarry {
+public:
+	CSweets();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSweets"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SWEETS_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 83b1d3c..88688f2 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -20,6 +20,35 @@
  *
  */
 
+#include "titanic/carry/arm.h"
+#include "titanic/carry/brain.h"
+#include "titanic/carry/bridge_piece.h"
+#include "titanic/carry/carry.h"
+#include "titanic/carry/carry_parrot.h"
+#include "titanic/carry/chicken.h"
+#include "titanic/carry/crushed_tv.h"
+#include "titanic/carry/ear.h"
+#include "titanic/carry/eye.h"
+#include "titanic/carry/feathers.h"
+#include "titanic/carry/fruit.h"
+#include "titanic/carry/glass.h"
+#include "titanic/carry/hammer.h"
+#include "titanic/carry/head_piece.h"
+#include "titanic/carry/hose.h"
+#include "titanic/carry/key.h"
+#include "titanic/carry/liftbot_head.h"
+#include "titanic/carry/long_stick.h"
+#include "titanic/carry/magazine.h"
+#include "titanic/carry/mouth.h"
+#include "titanic/carry/napkin.h"
+#include "titanic/carry/nose.h"
+#include "titanic/carry/note.h"
+#include "titanic/carry/parcel.h"
+#include "titanic/carry/phonograph_cylinder.h"
+#include "titanic/carry/photograph.h"
+#include "titanic/carry/plug_in.h"
+#include "titanic/carry/sweets.h"
+
 #include "titanic/core/saveable_object.h"
 #include "titanic/core/background.h"
 #include "titanic/core/file_item.h"
@@ -121,6 +150,30 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 #define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
 #define ADDFN(T) (*_classList)[#T] = Function##T
 
+DEFFN(CArm);
+DEFFN(CBrain);
+DEFFN(CBridgePiece);
+DEFFN(CCarryParrot);
+DEFFN(CChicken);
+DEFFN(CCrushedTV);
+DEFFN(CFeathers);
+DEFFN(CFruit);
+DEFFN(CGlass);
+DEFFN(CHammer);
+DEFFN(CHeadPiece);
+DEFFN(CHose);
+DEFFN(CKey);
+DEFFN(CLiftbotHead);
+DEFFN(CLongStick);
+DEFFN(CMagazine);
+DEFFN(CNapkin);
+DEFFN(CNote);
+DEFFN(CParcel);
+DEFFN(CPhonographCylinder);
+DEFFN(CPhotograph);
+DEFFN(CPlugIn);
+DEFFN(CSweets);
+
 DEFFN(CBackground);
 DEFFN(CFileItem);
 DEFFN(CFileListItem);
@@ -214,6 +267,30 @@ DEFFN(CAutoMusicPlayer);
 
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
+	ADDFN(CArm);
+	ADDFN(CBrain);
+	ADDFN(CBridgePiece);
+	ADDFN(CCarryParrot);
+	ADDFN(CChicken);
+	ADDFN(CCrushedTV);
+	ADDFN(CFeathers);
+	ADDFN(CFruit);
+	ADDFN(CGlass);
+	ADDFN(CHammer);
+	ADDFN(CHeadPiece);
+	ADDFN(CHose);
+	ADDFN(CKey);
+	ADDFN(CLiftbotHead);
+	ADDFN(CLongStick);
+	ADDFN(CMagazine);
+	ADDFN(CNapkin);
+	ADDFN(CNote);
+	ADDFN(CParcel);
+	ADDFN(CPhonographCylinder);
+	ADDFN(CPhotograph);
+	ADDFN(CPlugIn);
+	ADDFN(CSweets);
+
 	ADDFN(CBackground);
 	ADDFN(CFileItem);
 	ADDFN(CFileListItem);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 40b5b32..d17314a 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -15,6 +15,34 @@ MODULE_OBJS := \
 	string.o \
 	titanic.o \
 	video_surface.o \
+	carry/arm.o \
+	carry/brain.o \
+	carry/bridge_piece.o \
+	carry/carry.o \
+	carry/carry_parrot.oo \
+	carry/chicken.o \
+	carry/crushed_tv.o \
+	carry/ear.o \
+	carry/eye.o \
+	carry/feathers.o \
+	carry/fruit.o \
+	carry/glass.o \
+	carry/hammer.o \
+	carry/head_piece.o \
+	carry/hose.o \
+	carry/key.o \
+	carry/liftbot_head.o \
+	carry/long_stick.o \
+	carry/magazine.o \
+	carry/mouth.o \
+	carry/napkin.o \
+	carry/nose.o \
+	carry/note.o \
+	carry/parcel.o \
+	carry/phonograph_cylinder.o \
+	carry/photograph.o \
+	carry/plug_in.o \
+	carry/sweets.o \
 	core/background.o \
 	core/dont_save_file_item.o \
 	core/file_item.o \
@@ -119,4 +147,3 @@ endif
 
 # Include common rules
 include $(srcdir)/rules.mk
-


Commit: dd5fdcd8d9a69a11547cb96f370a8d6717eb5114
    https://github.com/scummvm/scummvm/commit/dd5fdcd8d9a69a11547cb96f370a8d6717eb5114
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-27T10:39:01-05:00

Commit Message:
TITANIC: Fix CCarry loading/saving

Changed paths:
    engines/titanic/carry/carry.cpp
    engines/titanic/carry/carry.h



diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index 604c952..7454489 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -24,10 +24,9 @@
 
 namespace Titanic {
 
-CCarry::CCarry() : CGameObject(), _fieldC8(0), _fieldCC(0),
-	_fieldDC(0), _fieldE0(1), _fieldFC(0), _field100(0),
-	_field104(0), _field108(0), _field10C(0), _field110(0),
-	_field120(0), _field124(0), _field128(0), 
+CCarry::CCarry() : CGameObject(), _fieldDC(0), _fieldE0(1),
+	_field100(0), _field104(0), _field108(0), _field10C(0),
+	_field110(0), _field120(0), _field124(0), _field128(0),
 	_string1("None"),
 	_string2("NULL"),
 	_string3("That doesn't seem to do anything."),
@@ -37,13 +36,13 @@ CCarry::CCarry() : CGameObject(), _fieldC8(0), _fieldCC(0),
 void CCarry::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
-	file->writeNumberLine(_fieldC8, indent);
+	file->writePoint(_pos1, indent);
 	file->writeQuotedLine(_string2, indent);
 	file->writeNumberLine(_fieldDC, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeQuotedLine(_string3, indent);
 	file->writeQuotedLine(_string4, indent);
-	file->writeNumberLine(_fieldFC, indent);
+	file->writePoint(_pos2, indent);
 	file->writeNumberLine(_field104, indent);
 	file->writeNumberLine(_field108, indent);
 	file->writeNumberLine(_field10C, indent);
@@ -59,13 +58,13 @@ void CCarry::save(SimpleFile *file, int indent) const {
 void CCarry::load(SimpleFile *file) {
 	file->readNumber();
 	_string1 = file->readString();
-	_fieldC8 = file->readNumber();
+	_pos1 = file->readPoint();
 	_string2 = file->readString();
 	_fieldDC = file->readNumber();
 	_fieldE0 = file->readNumber();
 	_string3 = file->readString();
 	_string4 = file->readString();
-	_fieldFC = file->readNumber();
+	_pos2 = file->readPoint();
 	_field104 = file->readNumber();
 	_field108 = file->readNumber();
 	_field10C = file->readNumber();
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index 4bf98b7..b83ecb7 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -30,14 +30,13 @@ namespace Titanic {
 class CCarry : public CGameObject {
 private:
 	CString _string1;
-	int _fieldC8;
-	int _fieldCC;
+	Common::Point _pos1;
 	CString _string2;
 	int _fieldDC;
 	int _fieldE0;
 	CString _string3;
 	CString _string4;
-	int _fieldFC;
+	Common::Point _pos2;
 	int _field100;
 	int _field104;
 	int _field108;


Commit: 9364b2791746dd76b0cec46af4d58da1c347f5bb
    https://github.com/scummvm/scummvm/commit/9364b2791746dd76b0cec46af4d58da1c347f5bb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-27T11:49:48-05:00

Commit Message:
TITANIC: Implemented state room classes

Changed paths:
  A engines/titanic/game/doorbot_home_handler.cpp
  A engines/titanic/game/doorbot_home_handler.h
  A engines/titanic/game/drawer.cpp
  A engines/titanic/game/drawer.h
  A engines/titanic/game/drop_target.cpp
  A engines/titanic/game/drop_target.h
  A engines/titanic/game/sgt_state_room.cpp
  A engines/titanic/game/sgt_state_room.h
  A engines/titanic/messages/doorbot_needed_in_elevator_msg.cpp
  A engines/titanic/messages/doorbot_needed_in_elevator_msg.h
  A engines/titanic/messages/doorbot_needed_in_home_msg.cpp
  A engines/titanic/messages/doorbot_needed_in_home_msg.h
  A engines/titanic/messages/drop_object_msg.cpp
  A engines/titanic/messages/drop_object_msg.h
  A engines/titanic/messages/drop_zone_got_object_msg.cpp
  A engines/titanic/messages/drop_zone_got_object_msg.h
  A engines/titanic/messages/message.cpp
  A engines/titanic/messages/message.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 88688f2..f761633 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -70,10 +70,14 @@
 #include "titanic/game/cdrom_tray.h"
 #include "titanic/game/computer_screen.h"
 #include "titanic/game/dead_area.h"
+#include "titanic/game/doorbot_home_handler.h"
+#include "titanic/game/drawer.h"
+#include "titanic/game/drop_target.h"
 #include "titanic/game/hammer_dispensor_button.h"
 #include "titanic/game/pet_position.h"
 #include "titanic/game/room_item.h"
 #include "titanic/game/service_elevator_door.h"
+#include "titanic/game/sgt_state_room.h"
 #include "titanic/game/start_action.h"
 #include "titanic/game/sub_glass.h"
 #include "titanic/game/television.h"
@@ -194,10 +198,13 @@ DEFFN(CCDROMComputer);
 DEFFN(CCDROMTray);
 DEFFN(CComputerScreen);
 DEFFN(CDeadArea);
+DEFFN(CDoorbotHomeHandler);
+DEFFN(CDropTarget);
 DEFFN(CHammerDispensorButton);
 DEFFN(CPETPosition);
 DEFFN(CRoomItem);
 DEFFN(CServiceElevatorDoor);
+DEFFN(CSGTStateRoom);
 DEFFN(CStartAction);
 DEFFN(CSUBGlass);
 DEFFN(CTelevision);
@@ -311,10 +318,13 @@ void CSaveableObject::initClassList() {
 	ADDFN(CCDROMTray);
 	ADDFN(CComputerScreen);
 	ADDFN(CDeadArea);
+	ADDFN(CDoorbotHomeHandler);
+	ADDFN(CDropTarget);
 	ADDFN(CHammerDispensorButton);
 	ADDFN(CPETPosition);
 	ADDFN(CRoomItem);
 	ADDFN(CServiceElevatorDoor);
+	ADDFN(CSGTStateRoom);
 	ADDFN(CStartAction);
 	ADDFN(CSUBGlass);
 	ADDFN(CTelevision);
diff --git a/engines/titanic/game/doorbot_home_handler.cpp b/engines/titanic/game/doorbot_home_handler.cpp
new file mode 100644
index 0000000..5d25017
--- /dev/null
+++ b/engines/titanic/game/doorbot_home_handler.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/doorbot_home_handler.h"
+
+namespace Titanic {
+
+CDoorbotHomeHandler::CDoorbotHomeHandler() {
+}
+
+void CDoorbotHomeHandler::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CDoorbotHomeHandler::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/doorbot_home_handler.h b/engines/titanic/game/doorbot_home_handler.h
new file mode 100644
index 0000000..1557dbf
--- /dev/null
+++ b/engines/titanic/game/doorbot_home_handler.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DOORBOT_HOME_HANDLER_H
+#define TITANIC_DOORBOT_HOME_HANDLER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CDoorbotHomeHandler : public CGameObject {
+public:
+	CDoorbotHomeHandler();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDoorbotHomeHandler"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DOORBOT_HOME_HANDLER_H */
diff --git a/engines/titanic/game/drawer.cpp b/engines/titanic/game/drawer.cpp
new file mode 100644
index 0000000..3409522
--- /dev/null
+++ b/engines/titanic/game/drawer.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/drawer.h"
+
+namespace Titanic {
+
+CDrawer::CDrawer() : CSGTStateRoom(), _fieldF4(0) {
+}
+
+void CDrawer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldF4, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void CDrawer::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldF4 = file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/drawer.h b/engines/titanic/game/drawer.h
new file mode 100644
index 0000000..020b105
--- /dev/null
+++ b/engines/titanic/game/drawer.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DRAWER_H
+#define TITANIC_DRAWER_H
+
+#include "titanic/game/sgt_state_room.h"
+
+namespace Titanic {
+
+class CDrawer : public CSGTStateRoom {
+private:
+	int _fieldF4;
+public:
+	CDrawer();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDrawer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DRAWER_H */
diff --git a/engines/titanic/game/drop_target.cpp b/engines/titanic/game/drop_target.cpp
new file mode 100644
index 0000000..34a87e0
--- /dev/null
+++ b/engines/titanic/game/drop_target.cpp
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/drop_target.h"
+
+namespace Titanic {
+
+CDropTarget::CDropTarget() : CGameObject(), _fieldC4(0),
+	_fieldD4(0), _fieldE4(0), _fieldF4(0), _fieldF8(0),
+	_fieldFC(0), _field10C(1), _field110(8), _field114(20) {
+}
+
+void CDropTarget::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writePoint(_pos1, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldD4, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeNumberLine(_fieldF4, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_fieldFC, indent);
+	file->writeQuotedLine(_string4, indent);
+	file->writeNumberLine(_field10C, indent);
+	file->writeNumberLine(_field110, indent);
+	file->writeNumberLine(_field114, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CDropTarget::load(SimpleFile *file) {
+	file->readNumber();
+	_pos1 = file->readPoint();
+	_fieldC4 = file->readNumber();
+	_string1 = file->readString();
+	_fieldD4 = file->readNumber();
+	_string2 = file->readString();
+	_fieldE4 = file->readNumber();
+	_string3 = file->readString();
+	_fieldF4 = file->readNumber();
+	_fieldF8 = file->readNumber();
+	_fieldFC = file->readNumber();
+	_string4 = file->readString();
+	_field10C = file->readNumber();
+	_field110 = file->readNumber();
+	_field114 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/drop_target.h b/engines/titanic/game/drop_target.h
new file mode 100644
index 0000000..b106623
--- /dev/null
+++ b/engines/titanic/game/drop_target.h
@@ -0,0 +1,67 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DROP_TARGET_H
+#define TITANIC_DROP_TARGET_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CDropTarget : public CGameObject {
+private:
+	Common::Point _pos1;
+	int _fieldC4;
+	CString _string1;
+	int _fieldD4;
+	CString _string2;
+	int _fieldE4;
+	CString _string3;
+	int _fieldF4;
+	int _fieldF8;
+	int _fieldFC;
+	CString _string4;
+	int _field10C;
+	int _field110;
+	int _field114;
+public:
+	CDropTarget();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDropTarget"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DROP_TARGET_H */
diff --git a/engines/titanic/game/sgt_state_room.cpp b/engines/titanic/game/sgt_state_room.cpp
new file mode 100644
index 0000000..10bec50
--- /dev/null
+++ b/engines/titanic/game/sgt_state_room.cpp
@@ -0,0 +1,85 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt_state_room.h"
+
+namespace Titanic {
+
+CSGTStateRoomStatics *_statics;
+
+CSGTStateRoom::CSGTStateRoom() : CBackground(), _fieldE0(1),
+	_fieldE4(1), _fieldE8(0), _fieldEC(1), _fieldF0(1) {
+}
+
+void CSGTStateRoom::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_statics->_v1, indent);
+	file->writeQuotedLine(_statics->_v2, indent);
+	file->writeQuotedLine(_statics->_v3, indent);
+	file->writeQuotedLine(_statics->_v4, indent);
+	file->writeQuotedLine(_statics->_v5, indent);
+	file->writeQuotedLine(_statics->_v6, indent);
+	file->writeQuotedLine(_statics->_v7, indent);
+	file->writeQuotedLine(_statics->_v8, indent);
+	file->writeQuotedLine(_statics->_v9, indent);
+	file->writeQuotedLine(_statics->_v10, indent);
+	file->writeQuotedLine(_statics->_v11, indent);
+	file->writeQuotedLine(_statics->_v12, indent);
+
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_statics->_v13, indent);
+	file->writeNumberLine(_statics->_v14, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_fieldF0, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CSGTStateRoom::load(SimpleFile *file) {
+	file->readNumber();
+	_statics->_v1 = file->readString();
+	_statics->_v2 = file->readString();
+	_statics->_v3 = file->readString();
+	_statics->_v4 = file->readString();
+	_statics->_v5 = file->readString();
+	_statics->_v6 = file->readString();
+	_statics->_v7 = file->readString();
+	_statics->_v8 = file->readString();
+	_statics->_v9 = file->readString();
+	_statics->_v10 = file->readString();
+	_statics->_v11 = file->readString();
+	_statics->_v12 = file->readString();
+
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_statics->_v13 = file->readNumber();
+	_statics->_v14 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_fieldF0 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt_state_room.h b/engines/titanic/game/sgt_state_room.h
new file mode 100644
index 0000000..ba70e54
--- /dev/null
+++ b/engines/titanic/game/sgt_state_room.h
@@ -0,0 +1,77 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SGT_STATE_ROOM_H
+#define TITANIC_SGT_STATE_ROOM_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+struct CSGTStateRoomStatics {
+	CString _v1;
+	CString _v2;
+	CString _v3;
+	CString _v4;
+	CString _v5;
+	CString _v6;
+	CString _v7;
+	CString _v8;
+	CString _v9;
+	CString _v10;
+	CString _v11;
+	CString _v12;
+	int _v13;
+	int _v14;
+};
+
+class CSGTStateRoom : public CBackground {
+private:
+	CSGTStateRoomStatics *_statics;
+private:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+public:
+	CSGTStateRoom();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSGTStateRoom"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SGT_STATE_ROOM_H */
diff --git a/engines/titanic/messages/doorbot_needed_in_elevator_msg.cpp b/engines/titanic/messages/doorbot_needed_in_elevator_msg.cpp
new file mode 100644
index 0000000..a9c8fc3
--- /dev/null
+++ b/engines/titanic/messages/doorbot_needed_in_elevator_msg.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/auto_sound_event.h"
+
+namespace Titanic {
+
+CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
+}
+
+void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/doorbot_needed_in_elevator_msg.h b/engines/titanic/messages/doorbot_needed_in_elevator_msg.h
new file mode 100644
index 0000000..50b2c3f
--- /dev/null
+++ b/engines/titanic/messages/doorbot_needed_in_elevator_msg.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DOORBOT_NEEDED_IN_ELEVATOR_MSG_H
+#define TITANIC_DOORBOT_NEEDED_IN_ELEVATOR_MSG_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CAutoSoundEvent : public CMessage {
+protected:
+	int _fieldBC;
+	int _fieldC0;
+public:
+	CAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DOORBOT_NEEDED_IN_ELEVATOR_MSG_H */
diff --git a/engines/titanic/messages/doorbot_needed_in_home_msg.cpp b/engines/titanic/messages/doorbot_needed_in_home_msg.cpp
new file mode 100644
index 0000000..a9c8fc3
--- /dev/null
+++ b/engines/titanic/messages/doorbot_needed_in_home_msg.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/auto_sound_event.h"
+
+namespace Titanic {
+
+CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
+}
+
+void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/doorbot_needed_in_home_msg.h b/engines/titanic/messages/doorbot_needed_in_home_msg.h
new file mode 100644
index 0000000..f3a805c
--- /dev/null
+++ b/engines/titanic/messages/doorbot_needed_in_home_msg.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_SOUND_EVENT_H
+#define TITANIC_AUTO_SOUND_EVENT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CAutoSoundEvent : public CGameObject {
+protected:
+	int _fieldBC;
+	int _fieldC0;
+public:
+	CAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/messages/drop_object_msg.cpp b/engines/titanic/messages/drop_object_msg.cpp
new file mode 100644
index 0000000..a9c8fc3
--- /dev/null
+++ b/engines/titanic/messages/drop_object_msg.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/auto_sound_event.h"
+
+namespace Titanic {
+
+CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
+}
+
+void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/drop_object_msg.h b/engines/titanic/messages/drop_object_msg.h
new file mode 100644
index 0000000..f3a805c
--- /dev/null
+++ b/engines/titanic/messages/drop_object_msg.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_SOUND_EVENT_H
+#define TITANIC_AUTO_SOUND_EVENT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CAutoSoundEvent : public CGameObject {
+protected:
+	int _fieldBC;
+	int _fieldC0;
+public:
+	CAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/messages/drop_zone_got_object_msg.cpp b/engines/titanic/messages/drop_zone_got_object_msg.cpp
new file mode 100644
index 0000000..a9c8fc3
--- /dev/null
+++ b/engines/titanic/messages/drop_zone_got_object_msg.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/auto_sound_event.h"
+
+namespace Titanic {
+
+CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
+}
+
+void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/drop_zone_got_object_msg.h b/engines/titanic/messages/drop_zone_got_object_msg.h
new file mode 100644
index 0000000..f3a805c
--- /dev/null
+++ b/engines/titanic/messages/drop_zone_got_object_msg.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_SOUND_EVENT_H
+#define TITANIC_AUTO_SOUND_EVENT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CAutoSoundEvent : public CGameObject {
+protected:
+	int _fieldBC;
+	int _fieldC0;
+public:
+	CAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/messages/message.cpp b/engines/titanic/messages/message.cpp
new file mode 100644
index 0000000..08df20e
--- /dev/null
+++ b/engines/titanic/messages/message.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/message.h"
+
+namespace Titanic {
+
+CMessage::CMessage() : CSaveableObject() {
+}
+
+void CMessage::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+}
+
+void CMessage::load(SimpleFile *file) {
+	file->readNumber();
+	CSaveableObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/message.h b/engines/titanic/messages/message.h
new file mode 100644
index 0000000..59cc94e
--- /dev/null
+++ b/engines/titanic/messages/message.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MESSAGE_H
+#define TITANIC_MESSAGE_H
+
+#include "titanic/core/saveable_object.h"
+
+namespace Titanic {
+
+class CMessage : public CSaveableObject {
+public:
+	CMessage();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMessage"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MESSAGE_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index d17314a..1c7e5a5 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -67,10 +67,14 @@ MODULE_OBJS := \
 	game/cdrom_tray.o \
 	game/computer_screen.o \
 	game/dead_area.o \
+	game/doorbot_home_handler.o \
+	game/drawer.o \
+	game/drop_target.o \
 	game/hammer_dispensor_button.o \
 	game/pet_position.o \
 	game/room_item.o \
 	game/service_elevator_door.o \
+	game/sgt_state_room.o \
 	game/start_action.o \
 	game/sub_glass.o \
 	game/television.o \
@@ -107,6 +111,11 @@ MODULE_OBJS := \
 	gfx/toggle_switch.o \
 	messages/auto_sound_event.o \
 	messages/door_auto_sound_event.o \
+	messages/doorbot_needed_in_elevator_msg.o \
+	messages/doorbot_needed_in_home_msg.o \
+	messages/drop_object_msg.o \
+	messages/drop_zone_got_object_msg.o \
+	messages/message.o \
 	moves/enter_bomb_room.o \
 	moves/exit_arboretum.o \
 	moves/exit_bridge.o \


Commit: def2a92ebfad1d7ff6b23ca5e82aa2148a7ade45
    https://github.com/scummvm/scummvm/commit/def2a92ebfad1d7ff6b23ca5e82aa2148a7ade45
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-27T21:04:47-05:00

Commit Message:
TITANIC: Add event class definitions

Changed paths:
  A engines/titanic/messages/edit_control_msg.h
  A engines/titanic/messages/is_hooked_on_msg.h
  A engines/titanic/messages/lights_msg.h
  A engines/titanic/messages/sub_accept_ccarry_msg.h
  A engines/titanic/messages/transport_msg.h
  R engines/titanic/messages/doorbot_needed_in_elevator_msg.cpp
  R engines/titanic/messages/doorbot_needed_in_elevator_msg.h
  R engines/titanic/messages/doorbot_needed_in_home_msg.cpp
  R engines/titanic/messages/doorbot_needed_in_home_msg.h
  R engines/titanic/messages/drop_object_msg.cpp
  R engines/titanic/messages/drop_object_msg.h
  R engines/titanic/messages/drop_zone_got_object_msg.cpp
  R engines/titanic/messages/drop_zone_got_object_msg.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/messages/message.h
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index f761633..fdb8df6 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -114,8 +114,12 @@
 #include "titanic/gfx/st_button.h"
 #include "titanic/gfx/toggle_switch.h"
 
-#include "titanic/messages/auto_sound_event.h"
-#include "titanic/messages/door_auto_sound_event.h"
+#include "titanic/messages/message.h"
+#include "titanic/messages/edit_control_msg.h"
+#include "titanic/messages/is_hooked_on_msg.h"
+#include "titanic/messages/lights_msg.h"
+#include "titanic/messages/sub_accept_ccarry_msg.h"
+#include "titanic/messages/transport_msg.h"
 
 #include "titanic/moves/enter_bomb_room.h"
 #include "titanic/moves/exit_arboretum.h"
@@ -240,8 +244,170 @@ DEFFN(CSmallChevRightOn);
 DEFFN(CStatusChangeButton);
 DEFFN(CSTButton);
 
+DEFFN(CActMsg);
+DEFFN(CActivationmsg);
+DEFFN(CAddHeadPieceMsg);
+DEFFN(CAnimateMaitreDMsg);
+DEFFN(CArboretumGateMsg);
+DEFFN(CArmPickedUpFromTableMsg);
 DEFFN(CAutoSoundEvent);
+DEFFN(CBodyInBilgeRoomMsg);
+DEFFN(CBowlStateChange);
+DEFFN(CCarryObjectArrivedMsg);
+DEFFN(CChangeSeasonMsg);
+DEFFN(CCheckAllPossibleCodes);
+DEFFN(CCheckChevCode);
+DEFFN(CChildDragEndMsg);
+DEFFN(CChildDragMoveMsg);
+DEFFN(CChildDragStartMsg);
+DEFFN(CClearChevPanelBits);
+DEFFN(CCorrectMusicPlayedMsg);
+DEFFN(CCreateMusicPlayerMsg);
+DEFFN(CCylinderHolderReadyMsg);
+DEFFN(CDeactivationMsg);
+DEFFN(CDeliverCCarryMsg);
+DEFFN(CDisableMaitreDProdReceptor);
+DEFFN(CDismissBotMsg);
+DEFFN(CDoffNavHelmet);
+DEFFN(CDonNavHelmet);
 DEFFN(CDoorAutoSoundEvent);
+DEFFN(CDoorbotNeededInElevatorMsg);
+DEFFN(CDoorbotNeededInHomeMsg);
+DEFFN(CDropobjectMsg);
+DEFFN(CDropZoneGotObjectMsg);
+DEFFN(CDropZoneLostObjectMsg);
+DEFFN(CEditControlMsg);
+DEFFN(CEjectCylinderMsg);
+DEFFN(CErasePhonographCylinderMsg);
+DEFFN(CFreshenCookieMsg);
+DEFFN(CGetChevClassBits);
+DEFFN(CGetChevClassNum);
+DEFFN(CGetChevCodeFromRoomNameMsg);
+DEFFN(CGetChevFloorBits);
+DEFFN(CGetChevFloorNum);
+DEFFN(CGetChevLiftBits);
+DEFFN(CGetChevLiftNum);
+DEFFN(CGetChevRoomBits);
+DEFFN(CGetChevRoomNum);
+DEFFN(CHoseConnectedMsg);
+DEFFN(CInitializeAnimMsg);
+DEFFN(CIsEarBowlPuzzleDone);
+DEFFN(CIsHookedOnMsg);
+DEFFN(CIsParrotPresentMsg);
+DEFFN(CKeyCharMsg);
+DEFFN(CLemonFallsFromTreeMsg);
+DEFFN(CLightsMsg);
+DEFFN(CLockPhonographMsg);
+DEFFN(CMaitreDDefeatedMsg);
+DEFFN(CMaitreDHappyMsg);
+DEFFN(CMissiveOMatActionMsg);
+DEFFN(CMoveToStartPosMsg);
+DEFFN(CMovieEndMsg);
+DEFFN(CMovieFrameMsg);
+DEFFN(CMusicHasStartedMsg);
+DEFFN(CMusicHasStoppedMsg);
+DEFFN(CMusicSettingChangedMsg);
+DEFFN(CNPCPlayAnimationMsg);
+DEFFN(CNPCPlayIdleAnimationMsg);
+DEFFN(CNPCPlayTalkingAnimationMsg);
+DEFFN(CNPCQueueIdleAnimMsg);
+DEFFN(CNutPuzzleMsg);
+DEFFN(COnSummonBotMsg);
+DEFFN(COpeningCreditsMsg);
+DEFFN(CPETDeliverMsg);
+DEFFN(CPETGainedObjectMsg);
+DEFFN(CPETHelmetOnOffMsg);
+DEFFN(CPETKeyboardOnOffMsg);
+DEFFN(CPETLostObjectMsg);
+DEFFN(CPETObjectSelectedMsg);
+DEFFN(CPETObjectStateMsg);
+DEFFN(CPETPhotoOnOffMsg);
+DEFFN(CPETPlaySoundMsg);
+DEFFN(CPETReceiveMsg);
+DEFFN(CPETSetStarDestinationMsg);
+DEFFN(CPETStarFieldLockMsg);
+DEFFN(CPETStereoFieldOnOffMsg);
+DEFFN(CPETTargetMsg);
+DEFFN(CPanningAwayFromParrotMsg);
+DEFFN(CParrotSpeakMsg);
+DEFFN(CParrotTriesChickenMsg);
+DEFFN(CPassOnDragStartMsg);
+DEFFN(CPhonographPlayMsg);
+DEFFN(CPhonographReadyToPlayMsg);
+DEFFN(CPhonographRecordMsg);
+DEFFN(CPhonographStopMsg);
+DEFFN(CPlayRangeMsg);
+DEFFN(CPlayerTriesRestaurantTableMsg);
+DEFFN(CPreSaveMsg);
+DEFFN(CProdMaitreDMsg);
+DEFFN(CPumpingMsg);
+DEFFN(CPutBotBackInHisBoxMsg);
+DEFFN(CPutParrotBackMsg);
+DEFFN(CPuzzleSolvedMsg);
+DEFFN(CQueryCylinderHolderMsg);
+DEFFN(CQueryCylinderMsg);
+DEFFN(CQueryCylinderNameMsg);
+DEFFN(CQueryCylinderTypeMsg);
+DEFFN(CQueryMusicControlSettingMsg);
+DEFFN(CQueryPhonographState);
+DEFFN(CRecordOntoCylinderMsg);
+DEFFN(CRemoveFromGameMsg);
+DEFFN(CReplaceBowlAndNutsMsg);
+DEFFN(CRestaurantMusicChanged);
+DEFFN(CSendCCarryMsg);
+DEFFN(CSenseWorkingMsg);
+DEFFN(CServiceElevatorFloorChangeMsg);
+DEFFN(CServiceElevatorFloorRequestMsg);
+DEFFN(CServiceElevatorMsg);
+DEFFN(CSetChevButtonImageMsg);
+DEFFN(CSetChevClassBits);
+DEFFN(CSetChevFloorBits);
+DEFFN(CSetChevLiftBits);
+DEFFN(CSetChevPanelBitMsg);
+DEFFN(CSetChevPanelButtonsMsg);
+DEFFN(CSetChevRoomBits);
+DEFFN(CSetMusicControlsMsg);
+DEFFN(CSetVarMsg);
+DEFFN(CSetVolumeMsg);
+DEFFN(CShipSettingMsg);
+DEFFN(CShowTextMsg);
+DEFFN(CSignalObject);
+DEFFN(CSpeechFallsFromTreeMsg);
+DEFFN(CStartMusicMsg);
+DEFFN(CStatusChangeMsg);
+DEFFN(CStopMusicMsg);
+DEFFN(CSubAcceptCCarryMsg);
+DEFFN(CSubDeliverCCarryMsg);
+DEFFN(CSubSendCCarryMsg);
+DEFFN(CSUBTransition);
+DEFFN(CSubTurnOffMsg);
+DEFFN(CSubTurnOnMsg);
+DEFFN(CSummonBotMsg);
+DEFFN(CSummonBotQuerryMsg);
+DEFFN(CTakeHeadPieceMsg);
+DEFFN(CTextInputMsg);
+DEFFN(CTimeDilationMsg);
+DEFFN(CTimeMsg);
+DEFFN(CTitleSequenceEndedMsg);
+DEFFN(CTransitMsg);
+DEFFN(CTransportMsg);
+DEFFN(CTriggerAutoMusicPlayerMsg);
+DEFFN(CTriggerNPCEvent);
+DEFFN(CTrueTalkGetAnimSetMsg);
+DEFFN(CTrueTalkGetAssetDetailsMsg);
+DEFFN(CTrueTalkGetStateValueMsg);
+DEFFN(CTrueTalkNotifySpeechEndedMsg);
+DEFFN(CTrueTalkNotifySpeechStartedMsg);
+DEFFN(CTrueTalkQueueUpAnimSetMsg);
+DEFFN(CTrueTalkSelfQueueAnimSetMsg);
+DEFFN(CTrueTalkTriggerActionMsg);
+DEFFN(CTurnOff);
+DEFFN(CTurnOn);
+DEFFN(CUse);
+DEFFN(CUseWithCharMsg);
+DEFFN(CUseWithOtherMsg);
+DEFFN(CVirtualKeyCharMsg);
+DEFFN(CVisibleMsg);
 
 DEFFN(CEnterBombRoom);
 DEFFN(CExitArboretum);
@@ -360,8 +526,170 @@ void CSaveableObject::initClassList() {
 	ADDFN(CStatusChangeButton);
 	ADDFN(CSTButton);
 
+	ADDFN(CActMsg);
+	ADDFN(CActivationmsg);
+	ADDFN(CAddHeadPieceMsg);
+	ADDFN(CAnimateMaitreDMsg);
+	ADDFN(CArboretumGateMsg);
+	ADDFN(CArmPickedUpFromTableMsg);
 	ADDFN(CAutoSoundEvent);
+	ADDFN(CBodyInBilgeRoomMsg);
+	ADDFN(CBowlStateChange);
+	ADDFN(CCarryObjectArrivedMsg);
+	ADDFN(CChangeSeasonMsg);
+	ADDFN(CCheckAllPossibleCodes);
+	ADDFN(CCheckChevCode);
+	ADDFN(CChildDragEndMsg);
+	ADDFN(CChildDragMoveMsg);
+	ADDFN(CChildDragStartMsg);
+	ADDFN(CClearChevPanelBits);
+	ADDFN(CCorrectMusicPlayedMsg);
+	ADDFN(CCreateMusicPlayerMsg);
+	ADDFN(CCylinderHolderReadyMsg);
+	ADDFN(CDeactivationMsg);
+	ADDFN(CDeliverCCarryMsg);
+	ADDFN(CDisableMaitreDProdReceptor);
+	ADDFN(CDismissBotMsg);
+	ADDFN(CDoffNavHelmet);
+	ADDFN(CDonNavHelmet);
 	ADDFN(CDoorAutoSoundEvent);
+	ADDFN(CDoorbotNeededInElevatorMsg);
+	ADDFN(CDoorbotNeededInHomeMsg);
+	ADDFN(CDropobjectMsg);
+	ADDFN(CDropZoneGotObjectMsg);
+	ADDFN(CDropZoneLostObjectMsg);
+	ADDFN(CEditControlMsg);
+	ADDFN(CEjectCylinderMsg);
+	ADDFN(CErasePhonographCylinderMsg);
+	ADDFN(CFreshenCookieMsg);
+	ADDFN(CGetChevClassBits);
+	ADDFN(CGetChevClassNum);
+	ADDFN(CGetChevCodeFromRoomNameMsg);
+	ADDFN(CGetChevFloorBits);
+	ADDFN(CGetChevFloorNum);
+	ADDFN(CGetChevLiftBits);
+	ADDFN(CGetChevLiftNum);
+	ADDFN(CGetChevRoomBits);
+	ADDFN(CGetChevRoomNum);
+	ADDFN(CHoseConnectedMsg);
+	ADDFN(CInitializeAnimMsg);
+	ADDFN(CIsEarBowlPuzzleDone);
+	ADDFN(CIsHookedOnMsg);
+	ADDFN(CIsParrotPresentMsg);
+	ADDFN(CKeyCharMsg);
+	ADDFN(CLemonFallsFromTreeMsg);
+	ADDFN(CLightsMsg);
+	ADDFN(CLockPhonographMsg);
+	ADDFN(CMaitreDDefeatedMsg);
+	ADDFN(CMaitreDHappyMsg);
+	ADDFN(CMissiveOMatActionMsg);
+	ADDFN(CMoveToStartPosMsg);
+	ADDFN(CMovieEndMsg);
+	ADDFN(CMovieFrameMsg);
+	ADDFN(CMusicHasStartedMsg);
+	ADDFN(CMusicHasStoppedMsg);
+	ADDFN(CMusicSettingChangedMsg);
+	ADDFN(CNPCPlayAnimationMsg);
+	ADDFN(CNPCPlayIdleAnimationMsg);
+	ADDFN(CNPCPlayTalkingAnimationMsg);
+	ADDFN(CNPCQueueIdleAnimMsg);
+	ADDFN(CNutPuzzleMsg);
+	ADDFN(COnSummonBotMsg);
+	ADDFN(COpeningCreditsMsg);
+	ADDFN(CPETDeliverMsg);
+	ADDFN(CPETGainedObjectMsg);
+	ADDFN(CPETHelmetOnOffMsg);
+	ADDFN(CPETKeyboardOnOffMsg);
+	ADDFN(CPETLostObjectMsg);
+	ADDFN(CPETObjectSelectedMsg);
+	ADDFN(CPETObjectStateMsg);
+	ADDFN(CPETPhotoOnOffMsg);
+	ADDFN(CPETPlaySoundMsg);
+	ADDFN(CPETReceiveMsg);
+	ADDFN(CPETSetStarDestinationMsg);
+	ADDFN(CPETStarFieldLockMsg);
+	ADDFN(CPETStereoFieldOnOffMsg);
+	ADDFN(CPETTargetMsg);
+	ADDFN(CPanningAwayFromParrotMsg);
+	ADDFN(CParrotSpeakMsg);
+	ADDFN(CParrotTriesChickenMsg);
+	ADDFN(CPassOnDragStartMsg);
+	ADDFN(CPhonographPlayMsg);
+	ADDFN(CPhonographReadyToPlayMsg);
+	ADDFN(CPhonographRecordMsg);
+	ADDFN(CPhonographStopMsg);
+	ADDFN(CPlayRangeMsg);
+	ADDFN(CPlayerTriesRestaurantTableMsg);
+	ADDFN(CPreSaveMsg);
+	ADDFN(CProdMaitreDMsg);
+	ADDFN(CPumpingMsg);
+	ADDFN(CPutBotBackInHisBoxMsg);
+	ADDFN(CPutParrotBackMsg);
+	ADDFN(CPuzzleSolvedMsg);
+	ADDFN(CQueryCylinderHolderMsg);
+	ADDFN(CQueryCylinderMsg);
+	ADDFN(CQueryCylinderNameMsg);
+	ADDFN(CQueryCylinderTypeMsg);
+	ADDFN(CQueryMusicControlSettingMsg);
+	ADDFN(CQueryPhonographState);
+	ADDFN(CRecordOntoCylinderMsg);
+	ADDFN(CRemoveFromGameMsg);
+	ADDFN(CReplaceBowlAndNutsMsg);
+	ADDFN(CRestaurantMusicChanged);
+	ADDFN(CSendCCarryMsg);
+	ADDFN(CSenseWorkingMsg);
+	ADDFN(CServiceElevatorFloorChangeMsg);
+	ADDFN(CServiceElevatorFloorRequestMsg);
+	ADDFN(CServiceElevatorMsg);
+	ADDFN(CSetChevButtonImageMsg);
+	ADDFN(CSetChevClassBits);
+	ADDFN(CSetChevFloorBits);
+	ADDFN(CSetChevLiftBits);
+	ADDFN(CSetChevPanelBitMsg);
+	ADDFN(CSetChevPanelButtonsMsg);
+	ADDFN(CSetChevRoomBits);
+	ADDFN(CSetMusicControlsMsg);
+	ADDFN(CSetVarMsg);
+	ADDFN(CSetVolumeMsg);
+	ADDFN(CShipSettingMsg);
+	ADDFN(CShowTextMsg);
+	ADDFN(CSignalObject);
+	ADDFN(CSpeechFallsFromTreeMsg);
+	ADDFN(CStartMusicMsg);
+	ADDFN(CStatusChangeMsg);
+	ADDFN(CStopMusicMsg);
+	ADDFN(CSubAcceptCCarryMsg);
+	ADDFN(CSubDeliverCCarryMsg);
+	ADDFN(CSubSendCCarryMsg);
+	ADDFN(CSUBTransition);
+	ADDFN(CSubTurnOffMsg);
+	ADDFN(CSubTurnOnMsg);
+	ADDFN(CSummonBotMsg);
+	ADDFN(CSummonBotQuerryMsg);
+	ADDFN(CTakeHeadPieceMsg);
+	ADDFN(CTextInputMsg);
+	ADDFN(CTimeDilationMsg);
+	ADDFN(CTimeMsg);
+	ADDFN(CTitleSequenceEndedMsg);
+	ADDFN(CTransitMsg);
+	ADDFN(CTransportMsg);
+	ADDFN(CTriggerAutoMusicPlayerMsg);
+	ADDFN(CTriggerNPCEvent);
+	ADDFN(CTrueTalkGetAnimSetMsg);
+	ADDFN(CTrueTalkGetAssetDetailsMsg);
+	ADDFN(CTrueTalkGetStateValueMsg);
+	ADDFN(CTrueTalkNotifySpeechEndedMsg);
+	ADDFN(CTrueTalkNotifySpeechStartedMsg);
+	ADDFN(CTrueTalkQueueUpAnimSetMsg);
+	ADDFN(CTrueTalkSelfQueueAnimSetMsg);
+	ADDFN(CTrueTalkTriggerActionMsg);
+	ADDFN(CTurnOff);
+	ADDFN(CTurnOn);
+	ADDFN(CUse);
+	ADDFN(CUseWithCharMsg);
+	ADDFN(CUseWithOtherMsg);
+	ADDFN(CVirtualKeyCharMsg);
+	ADDFN(CVisibleMsg);
 
 	ADDFN(CEnterBombRoom);
 	ADDFN(CExitArboretum);
diff --git a/engines/titanic/messages/doorbot_needed_in_elevator_msg.cpp b/engines/titanic/messages/doorbot_needed_in_elevator_msg.cpp
deleted file mode 100644
index a9c8fc3..0000000
--- a/engines/titanic/messages/doorbot_needed_in_elevator_msg.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/auto_sound_event.h"
-
-namespace Titanic {
-
-CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
-}
-
-void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/doorbot_needed_in_elevator_msg.h b/engines/titanic/messages/doorbot_needed_in_elevator_msg.h
deleted file mode 100644
index 50b2c3f..0000000
--- a/engines/titanic/messages/doorbot_needed_in_elevator_msg.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_DOORBOT_NEEDED_IN_ELEVATOR_MSG_H
-#define TITANIC_DOORBOT_NEEDED_IN_ELEVATOR_MSG_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CAutoSoundEvent : public CMessage {
-protected:
-	int _fieldBC;
-	int _fieldC0;
-public:
-	CAutoSoundEvent();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_DOORBOT_NEEDED_IN_ELEVATOR_MSG_H */
diff --git a/engines/titanic/messages/doorbot_needed_in_home_msg.cpp b/engines/titanic/messages/doorbot_needed_in_home_msg.cpp
deleted file mode 100644
index a9c8fc3..0000000
--- a/engines/titanic/messages/doorbot_needed_in_home_msg.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/auto_sound_event.h"
-
-namespace Titanic {
-
-CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
-}
-
-void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/doorbot_needed_in_home_msg.h b/engines/titanic/messages/doorbot_needed_in_home_msg.h
deleted file mode 100644
index f3a805c..0000000
--- a/engines/titanic/messages/doorbot_needed_in_home_msg.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_AUTO_SOUND_EVENT_H
-#define TITANIC_AUTO_SOUND_EVENT_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CAutoSoundEvent : public CGameObject {
-protected:
-	int _fieldBC;
-	int _fieldC0;
-public:
-	CAutoSoundEvent();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/messages/drop_object_msg.cpp b/engines/titanic/messages/drop_object_msg.cpp
deleted file mode 100644
index a9c8fc3..0000000
--- a/engines/titanic/messages/drop_object_msg.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/auto_sound_event.h"
-
-namespace Titanic {
-
-CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
-}
-
-void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/drop_object_msg.h b/engines/titanic/messages/drop_object_msg.h
deleted file mode 100644
index f3a805c..0000000
--- a/engines/titanic/messages/drop_object_msg.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_AUTO_SOUND_EVENT_H
-#define TITANIC_AUTO_SOUND_EVENT_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CAutoSoundEvent : public CGameObject {
-protected:
-	int _fieldBC;
-	int _fieldC0;
-public:
-	CAutoSoundEvent();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/messages/drop_zone_got_object_msg.cpp b/engines/titanic/messages/drop_zone_got_object_msg.cpp
deleted file mode 100644
index a9c8fc3..0000000
--- a/engines/titanic/messages/drop_zone_got_object_msg.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/auto_sound_event.h"
-
-namespace Titanic {
-
-CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
-}
-
-void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/drop_zone_got_object_msg.h b/engines/titanic/messages/drop_zone_got_object_msg.h
deleted file mode 100644
index f3a805c..0000000
--- a/engines/titanic/messages/drop_zone_got_object_msg.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_AUTO_SOUND_EVENT_H
-#define TITANIC_AUTO_SOUND_EVENT_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CAutoSoundEvent : public CGameObject {
-protected:
-	int _fieldBC;
-	int _fieldC0;
-public:
-	CAutoSoundEvent();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/messages/edit_control_msg.h b/engines/titanic/messages/edit_control_msg.h
new file mode 100644
index 0000000..b44035a
--- /dev/null
+++ b/engines/titanic/messages/edit_control_msg.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EDIT_CONTROL_MSG_H
+#define TITANIC_EDIT_CONTROL_MSG_H
+
+#include "titanic/messages/message.h"
+
+namespace Titanic {
+
+class CEditControlMsg : public CMessage {
+private:
+	int _field4;
+	int _field8;
+	CString _string1;
+	int _field18;
+	int _field1C;
+	int _field20;
+public:
+	CEditControlMsg() : _field4(0), _field8(0), _field18(0),
+		_field1C(0), _field20(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEditControlMsg"; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EDIT_CONTROL_MSG_H */
diff --git a/engines/titanic/messages/is_hooked_on_msg.h b/engines/titanic/messages/is_hooked_on_msg.h
new file mode 100644
index 0000000..f8a5062
--- /dev/null
+++ b/engines/titanic/messages/is_hooked_on_msg.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_IS_HOOKED_ON_MSG_H
+#define TITANIC_IS_HOOKED_ON_MSG_H
+
+#include "titanic/messages/message.h"
+
+namespace Titanic {
+
+class CIsHookedOnMsg : public CMessage {
+private:
+	int _field4;
+	int _field8;
+	CString _string1;
+	int _field18;
+	int _field1C;
+	int _field20;
+public:
+	CIsHookedOnMsg() : CMessage(), _field4(0), _field8(0),
+		_field18(0), _field1C(0), _field20(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CIsHookedOnMsg"; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_IS_HOOKED_ON_MSG_H */
diff --git a/engines/titanic/messages/lights_msg.h b/engines/titanic/messages/lights_msg.h
new file mode 100644
index 0000000..1cd82ca
--- /dev/null
+++ b/engines/titanic/messages/lights_msg.h
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LIGHTS_MSG_H
+#define TITANIC_LIGHTS_MSG_H
+
+#include "titanic/messages/message.h"
+
+namespace Titanic {
+
+class CLightsMsg : public CMessage {
+public:
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+public:
+	CLightsMsg() : CMessage(), _field4(0), _field8(0),
+		_fieldC(0), _field10(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLightsMsg"; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LIGHTS_MSG_H */
diff --git a/engines/titanic/messages/message.h b/engines/titanic/messages/message.h
index 59cc94e..9f10a7e 100644
--- a/engines/titanic/messages/message.h
+++ b/engines/titanic/messages/message.h
@@ -47,6 +47,223 @@ public:
 	virtual void load(SimpleFile *file);
 };
 
+#define RAW_MESSAGE(NAME) class NAME: public CMessage { \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define STR_MESSAGE(NAME, FIELD) class NAME: public CMessage { \
+	public: CString FIELD; \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define STR2_MESSAGE(NAME, FIELD1, FIELD2) class NAME: public CMessage { \
+	public: CString FIELD1, FIELD2; \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define STR_MESSAGE_VAL(NAME, FIELD, VAL) class NAME: public CMessage { \
+	public: CString FIELD; \
+	NAME(): FIELD(VAL) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define NUM_MESSAGE(NAME, FIELD) class NAME: public CMessage { \
+	public: int FIELD; \
+	NAME(): FIELD(0) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define NUM_MESSAGE_VAL(NAME, FIELD, VAL) class NAME: public CMessage { \
+	public: int FIELD; \
+	NAME(): CMessage(), FIELD(VAL) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define NUM2_MESSAGE(NAME, FIELD1, FIELD2) class NAME: public CMessage { \
+	public: int FIELD1, FIELD2; \
+	NAME(): CMessage(), FIELD1(0), FIELD2(0) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define NUM3_MESSAGE(NAME, FIELD1, FIELD2, FIELD3) class NAME: public CMessage { \
+	public: int FIELD1, FIELD2, FIELD3; \
+	NAME(): CMessage(), FIELD1(0), FIELD2(0), FIELD3(0) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define NUM4_MESSAGE(NAME, FIELD1, FIELD2, FIELD3, FIELD4) \
+	class NAME: public CMessage { \
+	public: int FIELD1, FIELD2, FIELD3, FIELD4; \
+	NAME(): CMessage(), FIELD1(0), FIELD2(0), FIELD3(0), FIELD4(0) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define NUM2_MESSAGE_VAL(NAME, FIELD1, FIELD2, VAL1, VAL2) \
+	class NAME: public CMessage { \
+	public: int FIELD1, FIELD2; \
+	NAME(): CMessage(), FIELD1(VAL1), FIELD2(VAL2) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define SNUM_MESSAGE(NAME, SFIELD, NFIELD) class NAME: public CMessage { \
+	public: CString SFIELD; CString NFIELD; \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define SNUM_MESSAGE_VAL(NAME, SFIELD, NFIELD, SVAL, NVAL) \
+	class NAME: public CMessage { \
+	public: CString SFIELD; CString NFIELD; \
+	NAME(): CMessage(), SFIELD(SVAL), NFIELD(NVAL) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+
+STR_MESSAGE(CActMsg, _value);
+STR_MESSAGE(CActivationmsg, _value);
+STR_MESSAGE_VAL(CAddHeadPieceMsg, _value, "NULL");
+NUM_MESSAGE(CAnimateMaitreDMsg, _value);
+NUM_MESSAGE(CArboretumGateMsg, _value);
+RAW_MESSAGE(CArmPickedUpFromTableMsg);
+RAW_MESSAGE(CBodyInBilgeRoomMsg);
+NUM_MESSAGE(CBowlStateChange, _value);
+SNUM_MESSAGE(CCarryObjectArrivedMsg, _strValue, _numValue);
+STR_MESSAGE_VAL(CChangeSeasonMsg, _season, "Summer");
+RAW_MESSAGE(CCheckAllPossibleCodes);
+NUM2_MESSAGE(CCheckChevCode, _value1, _value2);
+NUM_MESSAGE(CChildDragEndMsg, _value);
+NUM2_MESSAGE(CChildDragMoveMsg, _value1, _value2);
+NUM2_MESSAGE(CChildDragStartMsg, _value1, _value2);
+RAW_MESSAGE(CClearChevPanelBits);
+RAW_MESSAGE(CCorrectMusicPlayedMsg);
+RAW_MESSAGE(CCreateMusicPlayerMsg);
+RAW_MESSAGE(CCylinderHolderReadyMsg);
+RAW_MESSAGE(CDeactivationMsg);
+STR_MESSAGE(CDeliverCCarryMsg, _value);
+RAW_MESSAGE(CDisableMaitreDProdReceptor);
+RAW_MESSAGE(CDismissBotMsg);
+RAW_MESSAGE(CDoffNavHelmet);
+RAW_MESSAGE(CDonNavHelmet);
+NUM_MESSAGE(CDoorbotNeededInElevatorMsg, _value);
+RAW_MESSAGE(CDoorbotNeededInHomeMsg);
+NUM_MESSAGE(CDropobjectMsg, _value);
+NUM_MESSAGE(CDropZoneGotObjectMsg, _value);
+NUM_MESSAGE(CDropZoneLostObjectMsg, _value);
+NUM_MESSAGE(CEjectCylinderMsg, _value);
+RAW_MESSAGE(CErasePhonographCylinderMsg);
+NUM2_MESSAGE(CFreshenCookieMsg, _value1, _value2);
+NUM_MESSAGE(CGetChevClassBits, _value);
+NUM_MESSAGE(CGetChevClassNum, _value);
+SNUM_MESSAGE(CGetChevCodeFromRoomNameMsg, _strValue, _numValue);
+NUM_MESSAGE(CGetChevFloorBits, _value);
+NUM_MESSAGE(CGetChevFloorNum, _value);
+NUM_MESSAGE(CGetChevLiftBits, _value);
+NUM_MESSAGE(CGetChevLiftNum, _value);
+NUM_MESSAGE(CGetChevRoomBits, _value);
+NUM_MESSAGE(CGetChevRoomNum, _value);
+NUM2_MESSAGE_VAL(CHoseConnectedMsg, _value1, _value2, 1, 0);
+RAW_MESSAGE(CInitializeAnimMsg);
+NUM_MESSAGE(CIsEarBowlPuzzleDone, _value);
+NUM_MESSAGE(CIsParrotPresentMsg, _value);
+NUM_MESSAGE_VAL(CKeyCharMsg, _value, 32);
+NUM2_MESSAGE(CLemonFallsFromTreeMsg, _value1, _value2);
+NUM_MESSAGE(CLockPhonographMsg, _value);
+RAW_MESSAGE(CMaitreDDefeatedMsg);
+RAW_MESSAGE(CMaitreDHappyMsg);
+NUM_MESSAGE(CMissiveOMatActionMsg, _value);
+RAW_MESSAGE(CMoveToStartPosMsg);
+NUM2_MESSAGE(CMovieEndMsg, _value1, _value2);
+NUM2_MESSAGE(CMovieFrameMsg, _value1, _value2);
+RAW_MESSAGE(CMusicHasStartedMsg);
+RAW_MESSAGE(CMusicHasStoppedMsg);
+RAW_MESSAGE(CMusicSettingChangedMsg);
+NUM2_MESSAGE(CNPCPlayAnimationMsg, _value1, _value2);
+NUM_MESSAGE(CNPCPlayIdleAnimationMsg, _value);
+NUM3_MESSAGE(CNPCPlayTalkingAnimationMsg, _value1, _value2, _value3);
+RAW_MESSAGE(CNPCQueueIdleAnimMsg);
+STR_MESSAGE(CNutPuzzleMsg, _value);
+NUM_MESSAGE(COnSummonBotMsg, _value);
+RAW_MESSAGE(COpeningCreditsMsg);
+RAW_MESSAGE(CPETDeliverMsg);
+RAW_MESSAGE(CPETGainedObjectMsg);
+RAW_MESSAGE(CPETHelmetOnOffMsg);
+RAW_MESSAGE(CPETKeyboardOnOffMsg);
+RAW_MESSAGE(CPETLostObjectMsg);
+RAW_MESSAGE(CPETObjectSelectedMsg);
+NUM_MESSAGE(CPETObjectStateMsg, _value);
+RAW_MESSAGE(CPETPhotoOnOffMsg);
+NUM_MESSAGE(CPETPlaySoundMsg, _value);
+RAW_MESSAGE(CPETReceiveMsg);
+RAW_MESSAGE(CPETSetStarDestinationMsg);
+NUM_MESSAGE(CPETStarFieldLockMsg, _value);
+RAW_MESSAGE(CPETStereoFieldOnOffMsg);
+SNUM_MESSAGE_VAL(CPETTargetMsg, _strValue, _numValue, nullptr, -1);
+NUM_MESSAGE(CPanningAwayFromParrotMsg, _value);
+STR2_MESSAGE(CParrotSpeakMsg, _value1, _value2);
+NUM2_MESSAGE(CParrotTriesChickenMsg, _value1, _value2);
+NUM4_MESSAGE(CPassOnDragStartMsg, _value1, _value2, _value3, _value4);
+NUM_MESSAGE(CPhonographPlayMsg, _value);
+RAW_MESSAGE(CPhonographReadyToPlayMsg);
+NUM_MESSAGE(CPhonographRecordMsg, _value);
+NUM3_MESSAGE(CPhonographStopMsg, _value1, _value2, _value3);
+NUM2_MESSAGE(CPlayRangeMsg, _value1, _value2);
+NUM2_MESSAGE(CPlayerTriesRestaurantTableMsg, _value1, _value2);
+NUM_MESSAGE(CPreSaveMsg, _value);
+NUM_MESSAGE(CProdMaitreDMsg, _value);
+NUM2_MESSAGE(CPumpingMsg, _value1, _value2);
+NUM_MESSAGE(CPutBotBackInHisBoxMsg, _value);
+NUM_MESSAGE(CPutParrotBackMsg, _value);
+RAW_MESSAGE(CPuzzleSolvedMsg);
+NUM3_MESSAGE(CQueryCylinderHolderMsg, _value1, _value2, _value3);
+NUM3_MESSAGE(CQueryCylinderMsg, _value1, _value2, _value3);
+NUM3_MESSAGE(CQueryCylinderNameMsg, _value1, _value2, _value3);
+NUM3_MESSAGE(CQueryCylinderTypeMsg, _value1, _value2, _value3);
+NUM_MESSAGE(CQueryMusicControlSettingMsg, _value);
+NUM_MESSAGE(CQueryPhonographState, _value);
+RAW_MESSAGE(CRecordOntoCylinderMsg);
+RAW_MESSAGE(CRemoveFromGameMsg);
+RAW_MESSAGE(CReplaceBowlAndNutsMsg);
+STR_MESSAGE(CRestaurantMusicChanged, _value);
+SNUM_MESSAGE(CSendCCarryMsg, _strValue, _numValue);
+STR_MESSAGE_VAL(CSenseWorkingMsg, _value, "Not Working");
+NUM2_MESSAGE(CServiceElevatorFloorChangeMsg, _value1, _value2);
+RAW_MESSAGE(CServiceElevatorFloorRequestMsg);
+NUM_MESSAGE_VAL(CServiceElevatorMsg, _value, 4);
+NUM2_MESSAGE(CSetChevButtonImageMsg, _value1, _value2);
+NUM_MESSAGE(CSetChevClassBits, _value);
+NUM_MESSAGE(CSetChevFloorBits, _value);
+NUM_MESSAGE(CSetChevLiftBits, _value);
+NUM2_MESSAGE(CSetChevPanelBitMsg, _value1, _value2);
+NUM_MESSAGE(CSetChevPanelButtonsMsg, _value);
+NUM_MESSAGE(CSetChevRoomBits, _value);
+RAW_MESSAGE(CSetMusicControlsMsg);
+SNUM_MESSAGE(CSetVarMsg, _varName, _value);
+NUM2_MESSAGE_VAL(CSetVolumeMsg, _value1, _value2, 70, 0);
+SNUM_MESSAGE(CShipSettingMsg, _strValue, _numValue);
+STR_MESSAGE_VAL(CShowTextMsg, _value, "NO TEXT INCLUDED!!!");
+SNUM_MESSAGE(CSignalObject, _strValue, _numValue);
+NUM2_MESSAGE(CSpeechFallsFromTreeMsg, _value1, _value2);
+NUM_MESSAGE(CStartMusicMsg, _value);
+NUM3_MESSAGE(CStatusChangeMsg, _value1, _value2, _value3);
+NUM_MESSAGE(CStopMusicMsg, _value);
+RAW_MESSAGE(CSubDeliverCCarryMsg);
+RAW_MESSAGE(CSubSendCCarryMsg);
+RAW_MESSAGE(CSUBTransition);
+RAW_MESSAGE(CSubTurnOffMsg);
+RAW_MESSAGE(CSubTurnOnMsg);
+SNUM_MESSAGE(CSummonBotMsg, _strValue, _numValue);
+STR_MESSAGE(CSummonBotQuerryMsg, _value);
+STR_MESSAGE(CTakeHeadPieceMsg, _value);
+STR2_MESSAGE(CTextInputMsg, _value1, _value2);
+NUM_MESSAGE(CTimeDilationMsg, _value);
+NUM_MESSAGE(CTimeMsg, _value);
+RAW_MESSAGE(CTitleSequenceEndedMsg);
+RAW_MESSAGE(CTransitMsg);
+NUM_MESSAGE(CTriggerAutoMusicPlayerMsg, _value);
+NUM_MESSAGE(CTriggerNPCEvent, _value);
+NUM4_MESSAGE(CTrueTalkGetAnimSetMsg, _value1, _value2, _value3, _value4);
+SNUM_MESSAGE(CTrueTalkGetAssetDetailsMsg, _strValue, _numValue);
+NUM2_MESSAGE_VAL(CTrueTalkGetStateValueMsg, _value1, _value2, 0, -1000);
+NUM2_MESSAGE(CTrueTalkNotifySpeechEndedMsg, _value1, _value2);
+NUM3_MESSAGE(CTrueTalkNotifySpeechStartedMsg, _value1, _value2, _value);
+NUM_MESSAGE(CTrueTalkQueueUpAnimSetMsg, _value);
+RAW_MESSAGE(CTrueTalkSelfQueueAnimSetMsg);
+NUM3_MESSAGE(CTrueTalkTriggerActionMsg, _value1, _value2, _value3);
+RAW_MESSAGE(CTurnOff);
+RAW_MESSAGE(CTurnOn);
+NUM_MESSAGE(CUse, _value);
+NUM_MESSAGE(CUseWithCharMsg, _value);
+NUM_MESSAGE(CUseWithOtherMsg, _value);
+NUM_MESSAGE(CVirtualKeyCharMsg, _value);
+NUM2_MESSAGE_VAL(CVisibleMsg, _value1, _value2, 1, 0);
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_MESSAGE_H */
diff --git a/engines/titanic/messages/sub_accept_ccarry_msg.h b/engines/titanic/messages/sub_accept_ccarry_msg.h
new file mode 100644
index 0000000..b7c48ae
--- /dev/null
+++ b/engines/titanic/messages/sub_accept_ccarry_msg.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SUB_ACCEPT_CCARRY_MSG_H
+#define TITANIC_SUB_ACCEPT_CCARRY_MSG_H
+
+#include "titanic/messages/message.h"
+
+namespace Titanic {
+
+class CSubAcceptCCarryMsg : public CMessage {
+public:
+	CString _string1;
+	int _value1, _value2, _value3;
+public:
+	CSubAcceptCCarryMsg() : _value1(0), _value2(0), _value3(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSubAcceptCCarryMsg"; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SUB_ACCEPT_CCARRY_MSG_H */
diff --git a/engines/titanic/messages/transport_msg.h b/engines/titanic/messages/transport_msg.h
new file mode 100644
index 0000000..513a250
--- /dev/null
+++ b/engines/titanic/messages/transport_msg.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TRANSPORT_MSG_H
+#define TITANIC_TRANSPORT_MSG_H
+
+#include "titanic/messages/message.h"
+
+namespace Titanic {
+
+class CTransportMsg : public CMessage {
+public:
+	CString _string;
+	int _value1, _value2;
+public:
+	CTransportMsg() : _value1(0), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTransportMsg"; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TRANSPORT_MSG_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 1c7e5a5..c20afb2 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -111,10 +111,6 @@ MODULE_OBJS := \
 	gfx/toggle_switch.o \
 	messages/auto_sound_event.o \
 	messages/door_auto_sound_event.o \
-	messages/doorbot_needed_in_elevator_msg.o \
-	messages/doorbot_needed_in_home_msg.o \
-	messages/drop_object_msg.o \
-	messages/drop_zone_got_object_msg.o \
 	messages/message.o \
 	moves/enter_bomb_room.o \
 	moves/exit_arboretum.o \


Commit: 9080781b08830449e3f762ab45924a15446435ef
    https://github.com/scummvm/scummvm/commit/9080781b08830449e3f762ab45924a15446435ef
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-27T23:22:38-05:00

Commit Message:
TITANIC: Add mouse events, cleanup of existing events

Changed paths:
  A engines/titanic/messages/messages.cpp
  A engines/titanic/messages/messages.h
  A engines/titanic/messages/mouse_messages.h
  A engines/titanic/messages/pet_messages.h
  R engines/titanic/messages/auto_sound_event.cpp
  R engines/titanic/messages/auto_sound_event.h
  R engines/titanic/messages/door_auto_sound_event.cpp
  R engines/titanic/messages/door_auto_sound_event.h
  R engines/titanic/messages/edit_control_msg.h
  R engines/titanic/messages/is_hooked_on_msg.h
  R engines/titanic/messages/lights_msg.h
  R engines/titanic/messages/message.cpp
  R engines/titanic/messages/message.h
  R engines/titanic/messages/sub_accept_ccarry_msg.h
  R engines/titanic/messages/transport_msg.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/service_elevator_door.h
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index fdb8df6..dbbf8aa 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -114,12 +114,9 @@
 #include "titanic/gfx/st_button.h"
 #include "titanic/gfx/toggle_switch.h"
 
-#include "titanic/messages/message.h"
-#include "titanic/messages/edit_control_msg.h"
-#include "titanic/messages/is_hooked_on_msg.h"
-#include "titanic/messages/lights_msg.h"
-#include "titanic/messages/sub_accept_ccarry_msg.h"
-#include "titanic/messages/transport_msg.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
+#include "titanic/messages/pet_messages.h"
 
 #include "titanic/moves/enter_bomb_room.h"
 #include "titanic/moves/exit_arboretum.h"
@@ -301,6 +298,16 @@ DEFFN(CLockPhonographMsg);
 DEFFN(CMaitreDDefeatedMsg);
 DEFFN(CMaitreDHappyMsg);
 DEFFN(CMissiveOMatActionMsg);
+DEFFN(CMouseMsg);
+DEFFN(CMouseMoveMsg);
+DEFFN(CMouseButtonMsg);
+DEFFN(CMouseButtonDownMsg);
+DEFFN(CMouseButtonUpMsg);
+DEFFN(CMouseButtonDoubleClickMsg);
+DEFFN(CMouseDragMsg);
+DEFFN(CMouseDragStartMsg);
+DEFFN(CMouseDragMoveMsg);
+DEFFN(CMouseDragEndMsg);
 DEFFN(CMoveToStartPosMsg);
 DEFFN(CMovieEndMsg);
 DEFFN(CMovieFrameMsg);
@@ -583,6 +590,16 @@ void CSaveableObject::initClassList() {
 	ADDFN(CMaitreDDefeatedMsg);
 	ADDFN(CMaitreDHappyMsg);
 	ADDFN(CMissiveOMatActionMsg);
+	ADDFN(CMouseMsg);
+	ADDFN(CMouseMoveMsg);
+	ADDFN(CMouseButtonMsg);
+	ADDFN(CMouseButtonDownMsg);
+	ADDFN(CMouseButtonUpMsg);
+	ADDFN(CMouseButtonDoubleClickMsg);
+	ADDFN(CMouseDragMsg);
+	ADDFN(CMouseDragStartMsg);
+	ADDFN(CMouseDragMoveMsg);
+	ADDFN(CMouseDragEndMsg);
 	ADDFN(CMoveToStartPosMsg);
 	ADDFN(CMovieEndMsg);
 	ADDFN(CMovieFrameMsg);
diff --git a/engines/titanic/game/service_elevator_door.h b/engines/titanic/game/service_elevator_door.h
index a3a8388..616601d 100644
--- a/engines/titanic/game/service_elevator_door.h
+++ b/engines/titanic/game/service_elevator_door.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_SERVICE_ELEVATOR_DOOR_H
 #define TITANIC_SERVICE_ELEVATOR_DOOR_H
 
-#include "titanic/messages/door_auto_sound_event.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/messages/auto_sound_event.cpp b/engines/titanic/messages/auto_sound_event.cpp
deleted file mode 100644
index a9c8fc3..0000000
--- a/engines/titanic/messages/auto_sound_event.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/auto_sound_event.h"
-
-namespace Titanic {
-
-CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
-}
-
-void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/auto_sound_event.h b/engines/titanic/messages/auto_sound_event.h
deleted file mode 100644
index f3a805c..0000000
--- a/engines/titanic/messages/auto_sound_event.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_AUTO_SOUND_EVENT_H
-#define TITANIC_AUTO_SOUND_EVENT_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CAutoSoundEvent : public CGameObject {
-protected:
-	int _fieldBC;
-	int _fieldC0;
-public:
-	CAutoSoundEvent();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/messages/door_auto_sound_event.cpp b/engines/titanic/messages/door_auto_sound_event.cpp
deleted file mode 100644
index 69191a6..0000000
--- a/engines/titanic/messages/door_auto_sound_event.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/door_auto_sound_event.h"
-
-namespace Titanic {
-
-CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(),
-		_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
-}
-
-void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeQuotedLine(_string2, indent);
-	file->writeNumberLine(_fieldDC, indent);
-	file->writeNumberLine(_fieldE0, indent);
-
-	CAutoSoundEvent::save(file, indent);
-}
-
-void CDoorAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_string1 = file->readString();
-	_string2 = file->readString();
-	_fieldDC = file->readNumber();
-	_fieldE0 = file->readNumber();
-
-	CAutoSoundEvent::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/door_auto_sound_event.h b/engines/titanic/messages/door_auto_sound_event.h
deleted file mode 100644
index 9bba304..0000000
--- a/engines/titanic/messages/door_auto_sound_event.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_DOOR_AUTO_SOUND_EVENT_H
-#define TITANIC_DOOR_AUTO_SOUND_EVENT_H
-
-#include "titanic/messages/auto_sound_event.h"
-
-namespace Titanic {
-
-class CDoorAutoSoundEvent : public CAutoSoundEvent {
-protected:
-	CString _string1;
-	CString _string2;
-	int _fieldDC;
-	int _fieldE0;
-public:
-	CDoorAutoSoundEvent();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_DOOR_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/messages/edit_control_msg.h b/engines/titanic/messages/edit_control_msg.h
deleted file mode 100644
index b44035a..0000000
--- a/engines/titanic/messages/edit_control_msg.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_EDIT_CONTROL_MSG_H
-#define TITANIC_EDIT_CONTROL_MSG_H
-
-#include "titanic/messages/message.h"
-
-namespace Titanic {
-
-class CEditControlMsg : public CMessage {
-private:
-	int _field4;
-	int _field8;
-	CString _string1;
-	int _field18;
-	int _field1C;
-	int _field20;
-public:
-	CEditControlMsg() : _field4(0), _field8(0), _field18(0),
-		_field1C(0), _field20(0) {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEditControlMsg"; }
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_EDIT_CONTROL_MSG_H */
diff --git a/engines/titanic/messages/is_hooked_on_msg.h b/engines/titanic/messages/is_hooked_on_msg.h
deleted file mode 100644
index f8a5062..0000000
--- a/engines/titanic/messages/is_hooked_on_msg.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_IS_HOOKED_ON_MSG_H
-#define TITANIC_IS_HOOKED_ON_MSG_H
-
-#include "titanic/messages/message.h"
-
-namespace Titanic {
-
-class CIsHookedOnMsg : public CMessage {
-private:
-	int _field4;
-	int _field8;
-	CString _string1;
-	int _field18;
-	int _field1C;
-	int _field20;
-public:
-	CIsHookedOnMsg() : CMessage(), _field4(0), _field8(0),
-		_field18(0), _field1C(0), _field20(0) {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CIsHookedOnMsg"; }
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_IS_HOOKED_ON_MSG_H */
diff --git a/engines/titanic/messages/lights_msg.h b/engines/titanic/messages/lights_msg.h
deleted file mode 100644
index 1cd82ca..0000000
--- a/engines/titanic/messages/lights_msg.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_LIGHTS_MSG_H
-#define TITANIC_LIGHTS_MSG_H
-
-#include "titanic/messages/message.h"
-
-namespace Titanic {
-
-class CLightsMsg : public CMessage {
-public:
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
-public:
-	CLightsMsg() : CMessage(), _field4(0), _field8(0),
-		_fieldC(0), _field10(0) {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLightsMsg"; }
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_LIGHTS_MSG_H */
diff --git a/engines/titanic/messages/message.cpp b/engines/titanic/messages/message.cpp
deleted file mode 100644
index 08df20e..0000000
--- a/engines/titanic/messages/message.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/messages/message.h"
-
-namespace Titanic {
-
-CMessage::CMessage() : CSaveableObject() {
-}
-
-void CMessage::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(0, indent);
-}
-
-void CMessage::load(SimpleFile *file) {
-	file->readNumber();
-	CSaveableObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/messages/message.h b/engines/titanic/messages/message.h
deleted file mode 100644
index 9f10a7e..0000000
--- a/engines/titanic/messages/message.h
+++ /dev/null
@@ -1,269 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_MESSAGE_H
-#define TITANIC_MESSAGE_H
-
-#include "titanic/core/saveable_object.h"
-
-namespace Titanic {
-
-class CMessage : public CSaveableObject {
-public:
-	CMessage();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMessage"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-#define RAW_MESSAGE(NAME) class NAME: public CMessage { \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define STR_MESSAGE(NAME, FIELD) class NAME: public CMessage { \
-	public: CString FIELD; \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define STR2_MESSAGE(NAME, FIELD1, FIELD2) class NAME: public CMessage { \
-	public: CString FIELD1, FIELD2; \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define STR_MESSAGE_VAL(NAME, FIELD, VAL) class NAME: public CMessage { \
-	public: CString FIELD; \
-	NAME(): FIELD(VAL) {} \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define NUM_MESSAGE(NAME, FIELD) class NAME: public CMessage { \
-	public: int FIELD; \
-	NAME(): FIELD(0) {} \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define NUM_MESSAGE_VAL(NAME, FIELD, VAL) class NAME: public CMessage { \
-	public: int FIELD; \
-	NAME(): CMessage(), FIELD(VAL) {} \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define NUM2_MESSAGE(NAME, FIELD1, FIELD2) class NAME: public CMessage { \
-	public: int FIELD1, FIELD2; \
-	NAME(): CMessage(), FIELD1(0), FIELD2(0) {} \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define NUM3_MESSAGE(NAME, FIELD1, FIELD2, FIELD3) class NAME: public CMessage { \
-	public: int FIELD1, FIELD2, FIELD3; \
-	NAME(): CMessage(), FIELD1(0), FIELD2(0), FIELD3(0) {} \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define NUM4_MESSAGE(NAME, FIELD1, FIELD2, FIELD3, FIELD4) \
-	class NAME: public CMessage { \
-	public: int FIELD1, FIELD2, FIELD3, FIELD4; \
-	NAME(): CMessage(), FIELD1(0), FIELD2(0), FIELD3(0), FIELD4(0) {} \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define NUM2_MESSAGE_VAL(NAME, FIELD1, FIELD2, VAL1, VAL2) \
-	class NAME: public CMessage { \
-	public: int FIELD1, FIELD2; \
-	NAME(): CMessage(), FIELD1(VAL1), FIELD2(VAL2) {} \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define SNUM_MESSAGE(NAME, SFIELD, NFIELD) class NAME: public CMessage { \
-	public: CString SFIELD; CString NFIELD; \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define SNUM_MESSAGE_VAL(NAME, SFIELD, NFIELD, SVAL, NVAL) \
-	class NAME: public CMessage { \
-	public: CString SFIELD; CString NFIELD; \
-	NAME(): CMessage(), SFIELD(SVAL), NFIELD(NVAL) {} \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-
-STR_MESSAGE(CActMsg, _value);
-STR_MESSAGE(CActivationmsg, _value);
-STR_MESSAGE_VAL(CAddHeadPieceMsg, _value, "NULL");
-NUM_MESSAGE(CAnimateMaitreDMsg, _value);
-NUM_MESSAGE(CArboretumGateMsg, _value);
-RAW_MESSAGE(CArmPickedUpFromTableMsg);
-RAW_MESSAGE(CBodyInBilgeRoomMsg);
-NUM_MESSAGE(CBowlStateChange, _value);
-SNUM_MESSAGE(CCarryObjectArrivedMsg, _strValue, _numValue);
-STR_MESSAGE_VAL(CChangeSeasonMsg, _season, "Summer");
-RAW_MESSAGE(CCheckAllPossibleCodes);
-NUM2_MESSAGE(CCheckChevCode, _value1, _value2);
-NUM_MESSAGE(CChildDragEndMsg, _value);
-NUM2_MESSAGE(CChildDragMoveMsg, _value1, _value2);
-NUM2_MESSAGE(CChildDragStartMsg, _value1, _value2);
-RAW_MESSAGE(CClearChevPanelBits);
-RAW_MESSAGE(CCorrectMusicPlayedMsg);
-RAW_MESSAGE(CCreateMusicPlayerMsg);
-RAW_MESSAGE(CCylinderHolderReadyMsg);
-RAW_MESSAGE(CDeactivationMsg);
-STR_MESSAGE(CDeliverCCarryMsg, _value);
-RAW_MESSAGE(CDisableMaitreDProdReceptor);
-RAW_MESSAGE(CDismissBotMsg);
-RAW_MESSAGE(CDoffNavHelmet);
-RAW_MESSAGE(CDonNavHelmet);
-NUM_MESSAGE(CDoorbotNeededInElevatorMsg, _value);
-RAW_MESSAGE(CDoorbotNeededInHomeMsg);
-NUM_MESSAGE(CDropobjectMsg, _value);
-NUM_MESSAGE(CDropZoneGotObjectMsg, _value);
-NUM_MESSAGE(CDropZoneLostObjectMsg, _value);
-NUM_MESSAGE(CEjectCylinderMsg, _value);
-RAW_MESSAGE(CErasePhonographCylinderMsg);
-NUM2_MESSAGE(CFreshenCookieMsg, _value1, _value2);
-NUM_MESSAGE(CGetChevClassBits, _value);
-NUM_MESSAGE(CGetChevClassNum, _value);
-SNUM_MESSAGE(CGetChevCodeFromRoomNameMsg, _strValue, _numValue);
-NUM_MESSAGE(CGetChevFloorBits, _value);
-NUM_MESSAGE(CGetChevFloorNum, _value);
-NUM_MESSAGE(CGetChevLiftBits, _value);
-NUM_MESSAGE(CGetChevLiftNum, _value);
-NUM_MESSAGE(CGetChevRoomBits, _value);
-NUM_MESSAGE(CGetChevRoomNum, _value);
-NUM2_MESSAGE_VAL(CHoseConnectedMsg, _value1, _value2, 1, 0);
-RAW_MESSAGE(CInitializeAnimMsg);
-NUM_MESSAGE(CIsEarBowlPuzzleDone, _value);
-NUM_MESSAGE(CIsParrotPresentMsg, _value);
-NUM_MESSAGE_VAL(CKeyCharMsg, _value, 32);
-NUM2_MESSAGE(CLemonFallsFromTreeMsg, _value1, _value2);
-NUM_MESSAGE(CLockPhonographMsg, _value);
-RAW_MESSAGE(CMaitreDDefeatedMsg);
-RAW_MESSAGE(CMaitreDHappyMsg);
-NUM_MESSAGE(CMissiveOMatActionMsg, _value);
-RAW_MESSAGE(CMoveToStartPosMsg);
-NUM2_MESSAGE(CMovieEndMsg, _value1, _value2);
-NUM2_MESSAGE(CMovieFrameMsg, _value1, _value2);
-RAW_MESSAGE(CMusicHasStartedMsg);
-RAW_MESSAGE(CMusicHasStoppedMsg);
-RAW_MESSAGE(CMusicSettingChangedMsg);
-NUM2_MESSAGE(CNPCPlayAnimationMsg, _value1, _value2);
-NUM_MESSAGE(CNPCPlayIdleAnimationMsg, _value);
-NUM3_MESSAGE(CNPCPlayTalkingAnimationMsg, _value1, _value2, _value3);
-RAW_MESSAGE(CNPCQueueIdleAnimMsg);
-STR_MESSAGE(CNutPuzzleMsg, _value);
-NUM_MESSAGE(COnSummonBotMsg, _value);
-RAW_MESSAGE(COpeningCreditsMsg);
-RAW_MESSAGE(CPETDeliverMsg);
-RAW_MESSAGE(CPETGainedObjectMsg);
-RAW_MESSAGE(CPETHelmetOnOffMsg);
-RAW_MESSAGE(CPETKeyboardOnOffMsg);
-RAW_MESSAGE(CPETLostObjectMsg);
-RAW_MESSAGE(CPETObjectSelectedMsg);
-NUM_MESSAGE(CPETObjectStateMsg, _value);
-RAW_MESSAGE(CPETPhotoOnOffMsg);
-NUM_MESSAGE(CPETPlaySoundMsg, _value);
-RAW_MESSAGE(CPETReceiveMsg);
-RAW_MESSAGE(CPETSetStarDestinationMsg);
-NUM_MESSAGE(CPETStarFieldLockMsg, _value);
-RAW_MESSAGE(CPETStereoFieldOnOffMsg);
-SNUM_MESSAGE_VAL(CPETTargetMsg, _strValue, _numValue, nullptr, -1);
-NUM_MESSAGE(CPanningAwayFromParrotMsg, _value);
-STR2_MESSAGE(CParrotSpeakMsg, _value1, _value2);
-NUM2_MESSAGE(CParrotTriesChickenMsg, _value1, _value2);
-NUM4_MESSAGE(CPassOnDragStartMsg, _value1, _value2, _value3, _value4);
-NUM_MESSAGE(CPhonographPlayMsg, _value);
-RAW_MESSAGE(CPhonographReadyToPlayMsg);
-NUM_MESSAGE(CPhonographRecordMsg, _value);
-NUM3_MESSAGE(CPhonographStopMsg, _value1, _value2, _value3);
-NUM2_MESSAGE(CPlayRangeMsg, _value1, _value2);
-NUM2_MESSAGE(CPlayerTriesRestaurantTableMsg, _value1, _value2);
-NUM_MESSAGE(CPreSaveMsg, _value);
-NUM_MESSAGE(CProdMaitreDMsg, _value);
-NUM2_MESSAGE(CPumpingMsg, _value1, _value2);
-NUM_MESSAGE(CPutBotBackInHisBoxMsg, _value);
-NUM_MESSAGE(CPutParrotBackMsg, _value);
-RAW_MESSAGE(CPuzzleSolvedMsg);
-NUM3_MESSAGE(CQueryCylinderHolderMsg, _value1, _value2, _value3);
-NUM3_MESSAGE(CQueryCylinderMsg, _value1, _value2, _value3);
-NUM3_MESSAGE(CQueryCylinderNameMsg, _value1, _value2, _value3);
-NUM3_MESSAGE(CQueryCylinderTypeMsg, _value1, _value2, _value3);
-NUM_MESSAGE(CQueryMusicControlSettingMsg, _value);
-NUM_MESSAGE(CQueryPhonographState, _value);
-RAW_MESSAGE(CRecordOntoCylinderMsg);
-RAW_MESSAGE(CRemoveFromGameMsg);
-RAW_MESSAGE(CReplaceBowlAndNutsMsg);
-STR_MESSAGE(CRestaurantMusicChanged, _value);
-SNUM_MESSAGE(CSendCCarryMsg, _strValue, _numValue);
-STR_MESSAGE_VAL(CSenseWorkingMsg, _value, "Not Working");
-NUM2_MESSAGE(CServiceElevatorFloorChangeMsg, _value1, _value2);
-RAW_MESSAGE(CServiceElevatorFloorRequestMsg);
-NUM_MESSAGE_VAL(CServiceElevatorMsg, _value, 4);
-NUM2_MESSAGE(CSetChevButtonImageMsg, _value1, _value2);
-NUM_MESSAGE(CSetChevClassBits, _value);
-NUM_MESSAGE(CSetChevFloorBits, _value);
-NUM_MESSAGE(CSetChevLiftBits, _value);
-NUM2_MESSAGE(CSetChevPanelBitMsg, _value1, _value2);
-NUM_MESSAGE(CSetChevPanelButtonsMsg, _value);
-NUM_MESSAGE(CSetChevRoomBits, _value);
-RAW_MESSAGE(CSetMusicControlsMsg);
-SNUM_MESSAGE(CSetVarMsg, _varName, _value);
-NUM2_MESSAGE_VAL(CSetVolumeMsg, _value1, _value2, 70, 0);
-SNUM_MESSAGE(CShipSettingMsg, _strValue, _numValue);
-STR_MESSAGE_VAL(CShowTextMsg, _value, "NO TEXT INCLUDED!!!");
-SNUM_MESSAGE(CSignalObject, _strValue, _numValue);
-NUM2_MESSAGE(CSpeechFallsFromTreeMsg, _value1, _value2);
-NUM_MESSAGE(CStartMusicMsg, _value);
-NUM3_MESSAGE(CStatusChangeMsg, _value1, _value2, _value3);
-NUM_MESSAGE(CStopMusicMsg, _value);
-RAW_MESSAGE(CSubDeliverCCarryMsg);
-RAW_MESSAGE(CSubSendCCarryMsg);
-RAW_MESSAGE(CSUBTransition);
-RAW_MESSAGE(CSubTurnOffMsg);
-RAW_MESSAGE(CSubTurnOnMsg);
-SNUM_MESSAGE(CSummonBotMsg, _strValue, _numValue);
-STR_MESSAGE(CSummonBotQuerryMsg, _value);
-STR_MESSAGE(CTakeHeadPieceMsg, _value);
-STR2_MESSAGE(CTextInputMsg, _value1, _value2);
-NUM_MESSAGE(CTimeDilationMsg, _value);
-NUM_MESSAGE(CTimeMsg, _value);
-RAW_MESSAGE(CTitleSequenceEndedMsg);
-RAW_MESSAGE(CTransitMsg);
-NUM_MESSAGE(CTriggerAutoMusicPlayerMsg, _value);
-NUM_MESSAGE(CTriggerNPCEvent, _value);
-NUM4_MESSAGE(CTrueTalkGetAnimSetMsg, _value1, _value2, _value3, _value4);
-SNUM_MESSAGE(CTrueTalkGetAssetDetailsMsg, _strValue, _numValue);
-NUM2_MESSAGE_VAL(CTrueTalkGetStateValueMsg, _value1, _value2, 0, -1000);
-NUM2_MESSAGE(CTrueTalkNotifySpeechEndedMsg, _value1, _value2);
-NUM3_MESSAGE(CTrueTalkNotifySpeechStartedMsg, _value1, _value2, _value);
-NUM_MESSAGE(CTrueTalkQueueUpAnimSetMsg, _value);
-RAW_MESSAGE(CTrueTalkSelfQueueAnimSetMsg);
-NUM3_MESSAGE(CTrueTalkTriggerActionMsg, _value1, _value2, _value3);
-RAW_MESSAGE(CTurnOff);
-RAW_MESSAGE(CTurnOn);
-NUM_MESSAGE(CUse, _value);
-NUM_MESSAGE(CUseWithCharMsg, _value);
-NUM_MESSAGE(CUseWithOtherMsg, _value);
-NUM_MESSAGE(CVirtualKeyCharMsg, _value);
-NUM2_MESSAGE_VAL(CVisibleMsg, _value1, _value2, 1, 0);
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_MESSAGE_H */
diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
new file mode 100644
index 0000000..f60ad12
--- /dev/null
+++ b/engines/titanic/messages/messages.cpp
@@ -0,0 +1,87 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/messages.h"
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+CMessage::CMessage() : CSaveableObject() {
+}
+
+void CMessage::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+}
+
+void CMessage::load(SimpleFile *file) {
+	file->readNumber();
+	CSaveableObject::load(file);
+}
+
+/*------------------------------------------------------------------------*/
+
+CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
+}
+
+void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+/*------------------------------------------------------------------------*/
+
+CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(),
+_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
+}
+
+void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldDC, indent);
+	file->writeNumberLine(_fieldE0, indent);
+
+	CAutoSoundEvent::save(file, indent);
+}
+
+void CDoorAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_fieldDC = file->readNumber();
+	_fieldE0 = file->readNumber();
+
+	CAutoSoundEvent::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
new file mode 100644
index 0000000..e9490a8
--- /dev/null
+++ b/engines/titanic/messages/messages.h
@@ -0,0 +1,385 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MESSAGES_H
+#define TITANIC_MESSAGES_H
+
+#include "titanic/core/saveable_object.h"
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CMessage : public CSaveableObject {
+public:
+	CMessage();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMessage"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+class CAutoSoundEvent : public CGameObject {
+protected:
+	int _fieldBC;
+	int _fieldC0;
+public:
+	CAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+
+class CDoorAutoSoundEvent : public CAutoSoundEvent {
+protected:
+	CString _string1;
+	CString _string2;
+	int _fieldDC;
+	int _fieldE0;
+public:
+	CDoorAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+
+class CEditControlMsg : public CMessage {
+private:
+	int _field4;
+	int _field8;
+	CString _string1;
+	int _field18;
+	int _field1C;
+	int _field20;
+public:
+	CEditControlMsg() : _field4(0), _field8(0), _field18(0),
+		_field1C(0), _field20(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEditControlMsg"; }
+};
+
+class CLightsMsg : public CMessage {
+public:
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+public:
+	CLightsMsg() : CMessage(), _field4(0), _field8(0),
+		_fieldC(0), _field10(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLightsMsg"; }
+};
+
+class CIsHookedOnMsg : public CMessage {
+private:
+	int _field4;
+	int _field8;
+	CString _string1;
+	int _field18;
+	int _field1C;
+	int _field20;
+public:
+	CIsHookedOnMsg() : CMessage(), _field4(0), _field8(0),
+		_field18(0), _field1C(0), _field20(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CIsHookedOnMsg"; }
+};
+
+
+class CSubAcceptCCarryMsg : public CMessage {
+public:
+	CString _string1;
+	int _value1, _value2, _value3;
+public:
+	CSubAcceptCCarryMsg() : _value1(0), _value2(0), _value3(0) {}
+
+	/**
+	* Return the class name
+	*/
+	virtual const char *getClassName() const { return "CSubAcceptCCarryMsg"; }
+};
+
+class CTransportMsg : public CMessage {
+public:
+	CString _string;
+	int _value1, _value2;
+public:
+	CTransportMsg() : _value1(0), _value2(0) {}
+
+	/**
+	* Return the class name
+	*/
+	virtual const char *getClassName() const { return "CTransportMsg"; }
+};
+
+#define RAW_MESSAGE(NAME) class NAME: public CMessage { \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define STR_MESSAGE(NAME, FIELD) class NAME: public CMessage { \
+	public: CString FIELD; \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define STR2_MESSAGE(NAME, FIELD1, FIELD2) class NAME: public CMessage { \
+	public: CString FIELD1, FIELD2; \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define STR_MESSAGE_VAL(NAME, FIELD, VAL) class NAME: public CMessage { \
+	public: CString FIELD; \
+	NAME(): FIELD(VAL) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define NUM_MESSAGE(NAME, FIELD) class NAME: public CMessage { \
+	public: int FIELD; \
+	NAME(): FIELD(0) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define NUM_MESSAGE_VAL(NAME, FIELD, VAL) class NAME: public CMessage { \
+	public: int FIELD; \
+	NAME(): CMessage(), FIELD(VAL) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define NUM2_MESSAGE(NAME, FIELD1, FIELD2) class NAME: public CMessage { \
+	public: int FIELD1, FIELD2; \
+	NAME(): CMessage(), FIELD1(0), FIELD2(0) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define NUM3_MESSAGE(NAME, FIELD1, FIELD2, FIELD3) class NAME: public CMessage { \
+	public: int FIELD1, FIELD2, FIELD3; \
+	NAME(): CMessage(), FIELD1(0), FIELD2(0), FIELD3(0) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define NUM4_MESSAGE(NAME, FIELD1, FIELD2, FIELD3, FIELD4) \
+	class NAME: public CMessage { \
+	public: int FIELD1, FIELD2, FIELD3, FIELD4; \
+	NAME(): CMessage(), FIELD1(0), FIELD2(0), FIELD3(0), FIELD4(0) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define NUM2_MESSAGE_VAL(NAME, FIELD1, FIELD2, VAL1, VAL2) \
+	class NAME: public CMessage { \
+	public: int FIELD1, FIELD2; \
+	NAME(): CMessage(), FIELD1(VAL1), FIELD2(VAL2) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define SNUM_MESSAGE(NAME, SFIELD, NFIELD) class NAME: public CMessage { \
+	public: CString SFIELD; CString NFIELD; \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+#define SNUM_MESSAGE_VAL(NAME, SFIELD, NFIELD, SVAL, NVAL) \
+	class NAME: public CMessage { \
+	public: CString SFIELD; CString NFIELD; \
+	NAME(): CMessage(), SFIELD(SVAL), NFIELD(NVAL) {} \
+	virtual const char *getClassName() const { return #NAME; } \
+	}
+
+STR_MESSAGE(CActMsg, _value);
+STR_MESSAGE(CActivationmsg, _value);
+STR_MESSAGE_VAL(CAddHeadPieceMsg, _value, "NULL");
+NUM_MESSAGE(CAnimateMaitreDMsg, _value);
+NUM_MESSAGE(CArboretumGateMsg, _value);
+RAW_MESSAGE(CArmPickedUpFromTableMsg);
+RAW_MESSAGE(CBodyInBilgeRoomMsg);
+NUM_MESSAGE(CBowlStateChange, _value);
+SNUM_MESSAGE(CCarryObjectArrivedMsg, _strValue, _numValue);
+STR_MESSAGE_VAL(CChangeSeasonMsg, _season, "Summer");
+RAW_MESSAGE(CCheckAllPossibleCodes);
+NUM2_MESSAGE(CCheckChevCode, _value1, _value2);
+NUM_MESSAGE(CChildDragEndMsg, _value);
+NUM2_MESSAGE(CChildDragMoveMsg, _value1, _value2);
+NUM2_MESSAGE(CChildDragStartMsg, _value1, _value2);
+RAW_MESSAGE(CClearChevPanelBits);
+RAW_MESSAGE(CCorrectMusicPlayedMsg);
+RAW_MESSAGE(CCreateMusicPlayerMsg);
+RAW_MESSAGE(CCylinderHolderReadyMsg);
+RAW_MESSAGE(CDeactivationMsg);
+STR_MESSAGE(CDeliverCCarryMsg, _value);
+RAW_MESSAGE(CDisableMaitreDProdReceptor);
+RAW_MESSAGE(CDismissBotMsg);
+RAW_MESSAGE(CDoffNavHelmet);
+RAW_MESSAGE(CDonNavHelmet);
+NUM_MESSAGE(CDoorbotNeededInElevatorMsg, _value);
+RAW_MESSAGE(CDoorbotNeededInHomeMsg);
+NUM_MESSAGE(CDropobjectMsg, _value);
+NUM_MESSAGE(CDropZoneGotObjectMsg, _value);
+NUM_MESSAGE(CDropZoneLostObjectMsg, _value);
+NUM_MESSAGE(CEjectCylinderMsg, _value);
+RAW_MESSAGE(CErasePhonographCylinderMsg);
+NUM2_MESSAGE(CFreshenCookieMsg, _value1, _value2);
+NUM_MESSAGE(CGetChevClassBits, _value);
+NUM_MESSAGE(CGetChevClassNum, _value);
+SNUM_MESSAGE(CGetChevCodeFromRoomNameMsg, _strValue, _numValue);
+NUM_MESSAGE(CGetChevFloorBits, _value);
+NUM_MESSAGE(CGetChevFloorNum, _value);
+NUM_MESSAGE(CGetChevLiftBits, _value);
+NUM_MESSAGE(CGetChevLiftNum, _value);
+NUM_MESSAGE(CGetChevRoomBits, _value);
+NUM_MESSAGE(CGetChevRoomNum, _value);
+NUM2_MESSAGE_VAL(CHoseConnectedMsg, _value1, _value2, 1, 0);
+RAW_MESSAGE(CInitializeAnimMsg);
+NUM_MESSAGE(CIsEarBowlPuzzleDone, _value);
+NUM_MESSAGE(CIsParrotPresentMsg, _value);
+NUM_MESSAGE_VAL(CKeyCharMsg, _value, 32);
+NUM2_MESSAGE(CLemonFallsFromTreeMsg, _value1, _value2);
+NUM_MESSAGE(CLockPhonographMsg, _value);
+RAW_MESSAGE(CMaitreDDefeatedMsg);
+RAW_MESSAGE(CMaitreDHappyMsg);
+NUM_MESSAGE(CMissiveOMatActionMsg, _value);
+RAW_MESSAGE(CMoveToStartPosMsg);
+NUM2_MESSAGE(CMovieEndMsg, _value1, _value2);
+NUM2_MESSAGE(CMovieFrameMsg, _value1, _value2);
+RAW_MESSAGE(CMusicHasStartedMsg);
+RAW_MESSAGE(CMusicHasStoppedMsg);
+RAW_MESSAGE(CMusicSettingChangedMsg);
+NUM2_MESSAGE(CNPCPlayAnimationMsg, _value1, _value2);
+NUM_MESSAGE(CNPCPlayIdleAnimationMsg, _value);
+NUM3_MESSAGE(CNPCPlayTalkingAnimationMsg, _value1, _value2, _value3);
+RAW_MESSAGE(CNPCQueueIdleAnimMsg);
+STR_MESSAGE(CNutPuzzleMsg, _value);
+NUM_MESSAGE(COnSummonBotMsg, _value);
+RAW_MESSAGE(COpeningCreditsMsg);
+NUM_MESSAGE(CPanningAwayFromParrotMsg, _value);
+STR2_MESSAGE(CParrotSpeakMsg, _value1, _value2);
+NUM2_MESSAGE(CParrotTriesChickenMsg, _value1, _value2);
+NUM4_MESSAGE(CPassOnDragStartMsg, _value1, _value2, _value3, _value4);
+NUM_MESSAGE(CPhonographPlayMsg, _value);
+RAW_MESSAGE(CPhonographReadyToPlayMsg);
+NUM_MESSAGE(CPhonographRecordMsg, _value);
+NUM3_MESSAGE(CPhonographStopMsg, _value1, _value2, _value3);
+NUM2_MESSAGE(CPlayRangeMsg, _value1, _value2);
+NUM2_MESSAGE(CPlayerTriesRestaurantTableMsg, _value1, _value2);
+NUM_MESSAGE(CPreSaveMsg, _value);
+NUM_MESSAGE(CProdMaitreDMsg, _value);
+NUM2_MESSAGE(CPumpingMsg, _value1, _value2);
+NUM_MESSAGE(CPutBotBackInHisBoxMsg, _value);
+NUM_MESSAGE(CPutParrotBackMsg, _value);
+RAW_MESSAGE(CPuzzleSolvedMsg);
+NUM3_MESSAGE(CQueryCylinderHolderMsg, _value1, _value2, _value3);
+NUM3_MESSAGE(CQueryCylinderMsg, _value1, _value2, _value3);
+NUM3_MESSAGE(CQueryCylinderNameMsg, _value1, _value2, _value3);
+NUM3_MESSAGE(CQueryCylinderTypeMsg, _value1, _value2, _value3);
+NUM_MESSAGE(CQueryMusicControlSettingMsg, _value);
+NUM_MESSAGE(CQueryPhonographState, _value);
+RAW_MESSAGE(CRecordOntoCylinderMsg);
+RAW_MESSAGE(CRemoveFromGameMsg);
+RAW_MESSAGE(CReplaceBowlAndNutsMsg);
+STR_MESSAGE(CRestaurantMusicChanged, _value);
+SNUM_MESSAGE(CSendCCarryMsg, _strValue, _numValue);
+STR_MESSAGE_VAL(CSenseWorkingMsg, _value, "Not Working");
+NUM2_MESSAGE(CServiceElevatorFloorChangeMsg, _value1, _value2);
+RAW_MESSAGE(CServiceElevatorFloorRequestMsg);
+NUM_MESSAGE_VAL(CServiceElevatorMsg, _value, 4);
+NUM2_MESSAGE(CSetChevButtonImageMsg, _value1, _value2);
+NUM_MESSAGE(CSetChevClassBits, _value);
+NUM_MESSAGE(CSetChevFloorBits, _value);
+NUM_MESSAGE(CSetChevLiftBits, _value);
+NUM2_MESSAGE(CSetChevPanelBitMsg, _value1, _value2);
+NUM_MESSAGE(CSetChevPanelButtonsMsg, _value);
+NUM_MESSAGE(CSetChevRoomBits, _value);
+RAW_MESSAGE(CSetMusicControlsMsg);
+SNUM_MESSAGE(CSetVarMsg, _varName, _value);
+NUM2_MESSAGE_VAL(CSetVolumeMsg, _value1, _value2, 70, 0);
+SNUM_MESSAGE(CShipSettingMsg, _strValue, _numValue);
+STR_MESSAGE_VAL(CShowTextMsg, _value, "NO TEXT INCLUDED!!!");
+SNUM_MESSAGE(CSignalObject, _strValue, _numValue);
+NUM2_MESSAGE(CSpeechFallsFromTreeMsg, _value1, _value2);
+NUM_MESSAGE(CStartMusicMsg, _value);
+NUM3_MESSAGE(CStatusChangeMsg, _value1, _value2, _value3);
+NUM_MESSAGE(CStopMusicMsg, _value);
+RAW_MESSAGE(CSubDeliverCCarryMsg);
+RAW_MESSAGE(CSubSendCCarryMsg);
+RAW_MESSAGE(CSUBTransition);
+RAW_MESSAGE(CSubTurnOffMsg);
+RAW_MESSAGE(CSubTurnOnMsg);
+SNUM_MESSAGE(CSummonBotMsg, _strValue, _numValue);
+STR_MESSAGE(CSummonBotQuerryMsg, _value);
+STR_MESSAGE(CTakeHeadPieceMsg, _value);
+STR2_MESSAGE(CTextInputMsg, _value1, _value2);
+NUM_MESSAGE(CTimeDilationMsg, _value);
+NUM_MESSAGE(CTimeMsg, _value);
+RAW_MESSAGE(CTitleSequenceEndedMsg);
+RAW_MESSAGE(CTransitMsg);
+NUM_MESSAGE(CTriggerAutoMusicPlayerMsg, _value);
+NUM_MESSAGE(CTriggerNPCEvent, _value);
+NUM4_MESSAGE(CTrueTalkGetAnimSetMsg, _value1, _value2, _value3, _value4);
+SNUM_MESSAGE(CTrueTalkGetAssetDetailsMsg, _strValue, _numValue);
+NUM2_MESSAGE_VAL(CTrueTalkGetStateValueMsg, _value1, _value2, 0, -1000);
+NUM2_MESSAGE(CTrueTalkNotifySpeechEndedMsg, _value1, _value2);
+NUM3_MESSAGE(CTrueTalkNotifySpeechStartedMsg, _value1, _value2, _value);
+NUM_MESSAGE(CTrueTalkQueueUpAnimSetMsg, _value);
+RAW_MESSAGE(CTrueTalkSelfQueueAnimSetMsg);
+NUM3_MESSAGE(CTrueTalkTriggerActionMsg, _value1, _value2, _value3);
+RAW_MESSAGE(CTurnOff);
+RAW_MESSAGE(CTurnOn);
+NUM_MESSAGE(CUse, _value);
+NUM_MESSAGE(CUseWithCharMsg, _value);
+NUM_MESSAGE(CUseWithOtherMsg, _value);
+NUM_MESSAGE(CVirtualKeyCharMsg, _value);
+NUM2_MESSAGE_VAL(CVisibleMsg, _value1, _value2, 1, 0);
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MESSAGE_H */
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
new file mode 100644
index 0000000..6b46603
--- /dev/null
+++ b/engines/titanic/messages/mouse_messages.h
@@ -0,0 +1,96 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOUSE_MESSAGES_H
+#define TITANIC_MOUSE_MESSAGES_H
+
+#include "titanic/messages/messages.h"
+
+namespace Titanic {
+
+class CMouseMsg : public CMessage {
+public:
+	int _buttons;
+	Common::Point _mousePos;
+public:
+	CMouseMsg() : _buttons(0) {}
+	virtual const char *getClassName() const { return "CMouseMsg"; }
+};
+
+class CMouseMoveMsg : public CMouseMsg {
+public:
+	virtual const char *getClassName() const { return "CMouseMoveMsg"; }
+};
+
+class CMouseButtonMsg : public CMouseMsg {
+public:
+	int _field10;
+public:
+	CMouseButtonMsg() : CMouseMsg(), _field10(0) {}
+	virtual const char *getClassName() const { return "CMouseButtonMsg"; }
+};
+
+class CMouseButtonDownMsg : public CMouseButtonMsg {
+public:
+	virtual const char *getClassName() const { return "CMouseButtonDownMsg"; }
+};
+
+class CMouseButtonUpMsg : public CMouseButtonMsg {
+public:
+	virtual const char *getClassName() const { return "CMouseButtonUpMsg"; }
+};
+
+class CMouseButtonDoubleClickMsg : public CMouseButtonMsg {
+public:
+	virtual const char *getClassName() const { return "CMouseButtonDoubleClickMsg"; }
+};
+
+class CMouseDragMsg : public CMouseMsg {
+public:
+	virtual const char *getClassName() const { return "CMouseDragMsg"; }
+};
+
+class CMouseDragMoveMsg : public CMouseDragMsg {
+public:
+	virtual const char *getClassName() const { return "CMouseDragMoveMsg"; }
+};
+
+class CMouseDragStartMsg : public CMouseDragMsg {
+public:
+	int _field10;
+	int _field14;
+public:
+	CMouseDragStartMsg() : CMouseDragMsg(), _field10(0), _field14(0) {}
+	virtual const char *getClassName() const { return "CMouseDragStartMsg"; }
+};
+
+class CMouseDragEndMsg : public CMouseDragMsg {
+public:
+	int _field10;
+public:
+	CMouseDragEndMsg() : CMouseDragMsg(), _field10(0) {}
+	virtual const char *getClassName() const { return "CMouseDragEndMsg"; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOUSE_MESSAGES_H */
diff --git a/engines/titanic/messages/pet_messages.h b/engines/titanic/messages/pet_messages.h
new file mode 100644
index 0000000..1aeaec0
--- /dev/null
+++ b/engines/titanic/messages/pet_messages.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_MESSAGES_H
+#define TITANIC_PET_MESSAGES_H
+
+#include "titanic/messages/messages.h"
+
+namespace Titanic {
+
+RAW_MESSAGE(CPETDeliverMsg);
+RAW_MESSAGE(CPETGainedObjectMsg);
+RAW_MESSAGE(CPETHelmetOnOffMsg);
+RAW_MESSAGE(CPETKeyboardOnOffMsg);
+RAW_MESSAGE(CPETLostObjectMsg);
+RAW_MESSAGE(CPETObjectSelectedMsg);
+NUM_MESSAGE(CPETObjectStateMsg, _value);
+RAW_MESSAGE(CPETPhotoOnOffMsg);
+NUM_MESSAGE(CPETPlaySoundMsg, _value);
+RAW_MESSAGE(CPETReceiveMsg);
+RAW_MESSAGE(CPETSetStarDestinationMsg);
+NUM_MESSAGE(CPETStarFieldLockMsg, _value);
+RAW_MESSAGE(CPETStereoFieldOnOffMsg);
+SNUM_MESSAGE_VAL(CPETTargetMsg, _strValue, _numValue, nullptr, -1);
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_MESSAGES_H */
diff --git a/engines/titanic/messages/sub_accept_ccarry_msg.h b/engines/titanic/messages/sub_accept_ccarry_msg.h
deleted file mode 100644
index b7c48ae..0000000
--- a/engines/titanic/messages/sub_accept_ccarry_msg.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_SUB_ACCEPT_CCARRY_MSG_H
-#define TITANIC_SUB_ACCEPT_CCARRY_MSG_H
-
-#include "titanic/messages/message.h"
-
-namespace Titanic {
-
-class CSubAcceptCCarryMsg : public CMessage {
-public:
-	CString _string1;
-	int _value1, _value2, _value3;
-public:
-	CSubAcceptCCarryMsg() : _value1(0), _value2(0), _value3(0) {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSubAcceptCCarryMsg"; }
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_SUB_ACCEPT_CCARRY_MSG_H */
diff --git a/engines/titanic/messages/transport_msg.h b/engines/titanic/messages/transport_msg.h
deleted file mode 100644
index 513a250..0000000
--- a/engines/titanic/messages/transport_msg.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_TRANSPORT_MSG_H
-#define TITANIC_TRANSPORT_MSG_H
-
-#include "titanic/messages/message.h"
-
-namespace Titanic {
-
-class CTransportMsg : public CMessage {
-public:
-	CString _string;
-	int _value1, _value2;
-public:
-	CTransportMsg() : _value1(0), _value2(0) {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTransportMsg"; }
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_TRANSPORT_MSG_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index c20afb2..d8fdbeb 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -111,7 +111,7 @@ MODULE_OBJS := \
 	gfx/toggle_switch.o \
 	messages/auto_sound_event.o \
 	messages/door_auto_sound_event.o \
-	messages/message.o \
+	messages/messages.o \
 	moves/enter_bomb_room.o \
 	moves/exit_arboretum.o \
 	moves/exit_bridge.o \


Commit: 9cb1390c2636f6b586b0f6dfca6573bc05dc6592
    https://github.com/scummvm/scummvm/commit/9cb1390c2636f6b586b0f6dfca6573bc05dc6592
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-28T07:49:21-05:00

Commit Message:
TITANIC: Implemented CClickResponder and descendents

Changed paths:
  A engines/titanic/core/click_responder.cpp
  A engines/titanic/core/click_responder.h
  A engines/titanic/game/desk_click_responder.cpp
  A engines/titanic/game/desk_click_responder.h
  A engines/titanic/game/null_port_hole.cpp
  A engines/titanic/game/null_port_hole.h
  A engines/titanic/game/sgt_upper_doors_sound.cpp
  A engines/titanic/game/sgt_upper_doors_sound.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/click_responder.cpp b/engines/titanic/core/click_responder.cpp
new file mode 100644
index 0000000..9e8564b
--- /dev/null
+++ b/engines/titanic/core/click_responder.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/click_responder.h"
+
+namespace Titanic {
+
+void CClickResponder::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CClickResponder::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/click_responder.h b/engines/titanic/core/click_responder.h
new file mode 100644
index 0000000..1f2fa72
--- /dev/null
+++ b/engines/titanic/core/click_responder.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CLICK_RESPONDER_H
+#define TITANIC_CLICK_RESPONDER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CClickResponder : public CGameObject {
+protected:
+	CString _string1, _string2;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CClickResponder"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CLICK_RESPONDER_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index dbbf8aa..3ad4c73 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -51,6 +51,7 @@
 
 #include "titanic/core/saveable_object.h"
 #include "titanic/core/background.h"
+#include "titanic/core/click_responder.h"
 #include "titanic/core/file_item.h"
 #include "titanic/core/link_item.h"
 #include "titanic/core/list.h"
@@ -70,14 +71,17 @@
 #include "titanic/game/cdrom_tray.h"
 #include "titanic/game/computer_screen.h"
 #include "titanic/game/dead_area.h"
+#include "titanic/game/desk_click_responder.h"
 #include "titanic/game/doorbot_home_handler.h"
 #include "titanic/game/drawer.h"
 #include "titanic/game/drop_target.h"
 #include "titanic/game/hammer_dispensor_button.h"
+#include "titanic/game/null_port_hole.h"
 #include "titanic/game/pet_position.h"
 #include "titanic/game/room_item.h"
 #include "titanic/game/service_elevator_door.h"
 #include "titanic/game/sgt_state_room.h"
+#include "titanic/game/sgt_upper_doors_sound.h"
 #include "titanic/game/start_action.h"
 #include "titanic/game/sub_glass.h"
 #include "titanic/game/television.h"
@@ -180,6 +184,7 @@ DEFFN(CPlugIn);
 DEFFN(CSweets);
 
 DEFFN(CBackground);
+DEFFN(CClickResponder);
 DEFFN(CFileItem);
 DEFFN(CFileListItem);
 DEFFN(CLinkItem);
@@ -199,13 +204,16 @@ DEFFN(CCDROMComputer);
 DEFFN(CCDROMTray);
 DEFFN(CComputerScreen);
 DEFFN(CDeadArea);
+DEFFN(CDeskClickResponder);
 DEFFN(CDoorbotHomeHandler);
 DEFFN(CDropTarget);
 DEFFN(CHammerDispensorButton);
+DEFFN(CNullPortHole);
 DEFFN(CPETPosition);
 DEFFN(CRoomItem);
 DEFFN(CServiceElevatorDoor);
 DEFFN(CSGTStateRoom);
+DEFFN(CSGTUpperDoorsSound);
 DEFFN(CStartAction);
 DEFFN(CSUBGlass);
 DEFFN(CTelevision);
@@ -472,6 +480,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CSweets);
 
 	ADDFN(CBackground);
+	ADDFN(CClickResponder);
 	ADDFN(CFileItem);
 	ADDFN(CFileListItem);
 	ADDFN(CLinkItem);
@@ -491,13 +500,16 @@ void CSaveableObject::initClassList() {
 	ADDFN(CCDROMTray);
 	ADDFN(CComputerScreen);
 	ADDFN(CDeadArea);
+	ADDFN(CDeskClickResponder);
 	ADDFN(CDoorbotHomeHandler);
 	ADDFN(CDropTarget);
 	ADDFN(CHammerDispensorButton);
+	ADDFN(CNullPortHole);
 	ADDFN(CPETPosition);
 	ADDFN(CRoomItem);
 	ADDFN(CServiceElevatorDoor);
 	ADDFN(CSGTStateRoom);
+	ADDFN(CSGTUpperDoorsSound);
 	ADDFN(CStartAction);
 	ADDFN(CSUBGlass);
 	ADDFN(CTelevision);
diff --git a/engines/titanic/game/desk_click_responder.cpp b/engines/titanic/game/desk_click_responder.cpp
new file mode 100644
index 0000000..312fe56
--- /dev/null
+++ b/engines/titanic/game/desk_click_responder.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/desk_click_responder.h"
+
+namespace Titanic {
+
+void CDeskClickResponder::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldD4, indent);
+	file->writeNumberLine(_fieldD8, indent);
+
+	CClickResponder::save(file, indent);
+}
+
+void CDeskClickResponder::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldD4 = file->readNumber();
+	_fieldD8 = file->readNumber();
+
+	CClickResponder::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/desk_click_responder.h b/engines/titanic/game/desk_click_responder.h
new file mode 100644
index 0000000..94afece
--- /dev/null
+++ b/engines/titanic/game/desk_click_responder.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DESK_CLICK_RESPONDER_H
+#define TITANIC_DESK_CLICK_RESPONDER_H
+
+#include "titanic/core/click_responder.h"
+
+namespace Titanic {
+
+class CDeskClickResponder : public CClickResponder {
+protected:
+	int _fieldD4;
+	int _fieldD8;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDeskClickResponder"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DESK_CLICK_RESPONDER_H */
diff --git a/engines/titanic/game/null_port_hole.cpp b/engines/titanic/game/null_port_hole.cpp
new file mode 100644
index 0000000..c437dfe
--- /dev/null
+++ b/engines/titanic/game/null_port_hole.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/null_port_hole.h"
+
+namespace Titanic {
+
+CNullPortHole::CNullPortHole() : CClickResponder() {
+	_string1 = "For a better view, why not visit the Promenade Deck?";
+	_string2 = "b#48.wav";
+}
+
+void CNullPortHole::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string1, indent);
+
+	CClickResponder::save(file, indent);
+}
+
+void CNullPortHole::load(SimpleFile *file) {
+	file->readNumber();
+	_string2 = file->readString();
+	_string1 = file->readString();
+
+	CClickResponder::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/null_port_hole.h b/engines/titanic/game/null_port_hole.h
new file mode 100644
index 0000000..2caff27
--- /dev/null
+++ b/engines/titanic/game/null_port_hole.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NULL_PORT_HOLE_H
+#define TITANIC_NULL_PORT_HOLE_H
+
+#include "titanic/core/click_responder.h"
+
+namespace Titanic {
+
+class CNullPortHole : public CClickResponder {
+public:
+	CNullPortHole();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNullPortHole"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NULL_PORT_HOLE_H */
diff --git a/engines/titanic/game/sgt_upper_doors_sound.cpp b/engines/titanic/game/sgt_upper_doors_sound.cpp
new file mode 100644
index 0000000..2380926
--- /dev/null
+++ b/engines/titanic/game/sgt_upper_doors_sound.cpp
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt_upper_doors_sound.h"
+
+namespace Titanic {
+
+CSGTUpperDoorsSound::CSGTUpperDoorsSound() {
+	_string2 = "b#53.wav";
+}
+
+void CSGTUpperDoorsSound::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	CClickResponder::save(file, indent);
+}
+
+void CSGTUpperDoorsSound::load(SimpleFile *file) {
+	file->readNumber();
+	_string2 = file->readString();
+
+	CClickResponder::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt_upper_doors_sound.h b/engines/titanic/game/sgt_upper_doors_sound.h
new file mode 100644
index 0000000..ed97627
--- /dev/null
+++ b/engines/titanic/game/sgt_upper_doors_sound.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SGT_UPPER_DOORS_SOUND_H
+#define TITANIC_SGT_UPPER_DOORS_SOUND_H
+
+#include "titanic/core/click_responder.h"
+
+namespace Titanic {
+
+class CSGTUpperDoorsSound : public CClickResponder {
+public:
+	CSGTUpperDoorsSound();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSGTUpperDoorsSound"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SGT_UPPER_DOORS_SOUND_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index d8fdbeb..855ba0b 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -44,6 +44,7 @@ MODULE_OBJS := \
 	carry/plug_in.o \
 	carry/sweets.o \
 	core/background.o \
+	core/click_responder.o \
 	core/dont_save_file_item.o \
 	core/file_item.o \
 	core/game_object.o \
@@ -67,14 +68,17 @@ MODULE_OBJS := \
 	game/cdrom_tray.o \
 	game/computer_screen.o \
 	game/dead_area.o \
+	game/desk_click_responder.o \
 	game/doorbot_home_handler.o \
 	game/drawer.o \
 	game/drop_target.o \
 	game/hammer_dispensor_button.o \
 	game/pet_position.o \
+	game/null_port_hole.o \
 	game/room_item.o \
 	game/service_elevator_door.o \
 	game/sgt_state_room.o \
+	game/sgt_upper_doors_sound.o \
 	game/start_action.o \
 	game/sub_glass.o \
 	game/television.o \


Commit: 6cb2a5e81f03ff984a2bc8b214c02f0a3c255952
    https://github.com/scummvm/scummvm/commit/6cb2a5e81f03ff984a2bc8b214c02f0a3c255952
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-28T08:09:29-05:00

Commit Message:
TITANIC: Added CCredits

Changed paths:
  A engines/titanic/game/credits.cpp
  A engines/titanic/game/credits.h
  A engines/titanic/game/credits_button.cpp
  A engines/titanic/game/credits_button.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 3ad4c73..799ee3c 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -70,6 +70,8 @@
 #include "titanic/game/cdrom_computer.h"
 #include "titanic/game/cdrom_tray.h"
 #include "titanic/game/computer_screen.h"
+#include "titanic/game/credits.h"
+#include "titanic/game/credits_button.h"
 #include "titanic/game/dead_area.h"
 #include "titanic/game/desk_click_responder.h"
 #include "titanic/game/doorbot_home_handler.h"
@@ -203,6 +205,8 @@ DEFFN(CCDROM);
 DEFFN(CCDROMComputer);
 DEFFN(CCDROMTray);
 DEFFN(CComputerScreen);
+DEFFN(CCredits);
+DEFFN(CCreditsButton);
 DEFFN(CDeadArea);
 DEFFN(CDeskClickResponder);
 DEFFN(CDoorbotHomeHandler);
@@ -499,6 +503,8 @@ void CSaveableObject::initClassList() {
 	ADDFN(CCDROMComputer);
 	ADDFN(CCDROMTray);
 	ADDFN(CComputerScreen);
+	ADDFN(CCredits);
+	ADDFN(CCreditsButton);
 	ADDFN(CDeadArea);
 	ADDFN(CDeskClickResponder);
 	ADDFN(CDoorbotHomeHandler);
diff --git a/engines/titanic/game/credits.cpp b/engines/titanic/game/credits.cpp
new file mode 100644
index 0000000..178d268
--- /dev/null
+++ b/engines/titanic/game/credits.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/credits.h"
+
+namespace Titanic {
+
+CCredits::CCredits() : CGameObject(), _fieldBC(-1), _fieldC0(1) {
+}
+
+void CCredits::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	
+	CGameObject::save(file, indent);
+}
+
+void CCredits::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/credits.h b/engines/titanic/game/credits.h
new file mode 100644
index 0000000..0e35a58
--- /dev/null
+++ b/engines/titanic/game/credits.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CREDITS_H
+#define TITANIC_CREDITS_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CCredits : public CGameObject {
+public:
+	int _fieldBC, _fieldC0;
+public:
+	CCredits();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCredits"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CREDITS_H */
diff --git a/engines/titanic/game/credits_button.cpp b/engines/titanic/game/credits_button.cpp
new file mode 100644
index 0000000..0ab23c1
--- /dev/null
+++ b/engines/titanic/game/credits_button.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/credits_button.h"
+
+namespace Titanic {
+
+CCreditsButton::CCreditsButton() : CBackground(), _fieldE0(1) {
+}
+
+void CCreditsButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	CBackground::save(file, indent);
+}
+
+void CCreditsButton::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/credits_button.h b/engines/titanic/game/credits_button.h
new file mode 100644
index 0000000..b22ce79
--- /dev/null
+++ b/engines/titanic/game/credits_button.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CREDITS_BUTTON_H
+#define TITANIC_CREDITS_BUTTON_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CCreditsButton : public CBackground {
+public:
+	int _fieldE0;
+public:
+	CCreditsButton();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCreditsButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CREDITS_BUTTON_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 855ba0b..9faf157 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -67,6 +67,8 @@ MODULE_OBJS := \
 	game/cdrom_computer.o \
 	game/cdrom_tray.o \
 	game/computer_screen.o \
+	game/credits.o \
+	game/credits_button.o \
 	game/dead_area.o \
 	game/desk_click_responder.o \
 	game/doorbot_home_handler.o \


Commit: decec97c4b7611c56135cf222544afa9f043c894
    https://github.com/scummvm/scummvm/commit/decec97c4b7611c56135cf222544afa9f043c894
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-28T10:57:45-05:00

Commit Message:
TITANIC: Implement various parrot classes

Changed paths:
  A engines/titanic/core/drop_target.cpp
  A engines/titanic/core/drop_target.h
  A engines/titanic/core/multi_drop_target.cpp
  A engines/titanic/core/multi_drop_target.h
  A engines/titanic/game/parrot/parrot_lobby_controller.cpp
  A engines/titanic/game/parrot/parrot_lobby_controller.h
  A engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
  A engines/titanic/game/parrot/parrot_lobby_link_updater.h
  A engines/titanic/game/parrot/parrot_lobby_object.cpp
  A engines/titanic/game/parrot/parrot_lobby_object.h
  A engines/titanic/game/parrot/parrot_lobby_view_object.cpp
  A engines/titanic/game/parrot/parrot_lobby_view_object.h
  A engines/titanic/game/parrot/parrot_loser.cpp
  A engines/titanic/game/parrot/parrot_loser.h
  A engines/titanic/game/parrot/parrot_nut_bowl_actor.cpp
  A engines/titanic/game/parrot/parrot_nut_bowl_actor.h
  A engines/titanic/game/parrot/parrot_nut_eater.cpp
  A engines/titanic/game/parrot/parrot_nut_eater.h
  A engines/titanic/game/parrot/parrot_perch_holder.cpp
  A engines/titanic/game/parrot/parrot_perch_holder.h
  A engines/titanic/game/parrot/parrot_succubus.cpp
  A engines/titanic/game/parrot/parrot_succubus.h
  A engines/titanic/game/parrot/parrot_trigger.cpp
  A engines/titanic/game/parrot/parrot_trigger.h
  A engines/titanic/game/port_hole.cpp
  A engines/titanic/game/port_hole.h
  A engines/titanic/game/sweet_bowl.cpp
  A engines/titanic/game/sweet_bowl.h
  R engines/titanic/game/drop_target.cpp
  R engines/titanic/game/drop_target.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/core/drop_target.cpp b/engines/titanic/core/drop_target.cpp
new file mode 100644
index 0000000..9782967
--- /dev/null
+++ b/engines/titanic/core/drop_target.cpp
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/drop_target.h"
+
+namespace Titanic {
+
+CDropTarget::CDropTarget() : CGameObject(), _fieldC4(0),
+	_fieldD4(0), _fieldE4(0), _fieldF4(0), _fieldF8(0),
+	_fieldFC(0), _field10C(1), _field110(8), _field114(20) {
+}
+
+void CDropTarget::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writePoint(_pos1, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldD4, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeNumberLine(_fieldF4, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_fieldFC, indent);
+	file->writeQuotedLine(_string4, indent);
+	file->writeNumberLine(_field10C, indent);
+	file->writeNumberLine(_field110, indent);
+	file->writeNumberLine(_field114, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CDropTarget::load(SimpleFile *file) {
+	file->readNumber();
+	_pos1 = file->readPoint();
+	_fieldC4 = file->readNumber();
+	_string1 = file->readString();
+	_fieldD4 = file->readNumber();
+	_string2 = file->readString();
+	_fieldE4 = file->readNumber();
+	_string3 = file->readString();
+	_fieldF4 = file->readNumber();
+	_fieldF8 = file->readNumber();
+	_fieldFC = file->readNumber();
+	_string4 = file->readString();
+	_field10C = file->readNumber();
+	_field110 = file->readNumber();
+	_field114 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/drop_target.h b/engines/titanic/core/drop_target.h
new file mode 100644
index 0000000..b106623
--- /dev/null
+++ b/engines/titanic/core/drop_target.h
@@ -0,0 +1,67 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DROP_TARGET_H
+#define TITANIC_DROP_TARGET_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CDropTarget : public CGameObject {
+private:
+	Common::Point _pos1;
+	int _fieldC4;
+	CString _string1;
+	int _fieldD4;
+	CString _string2;
+	int _fieldE4;
+	CString _string3;
+	int _fieldF4;
+	int _fieldF8;
+	int _fieldFC;
+	CString _string4;
+	int _field10C;
+	int _field110;
+	int _field114;
+public:
+	CDropTarget();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDropTarget"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DROP_TARGET_H */
diff --git a/engines/titanic/core/multi_drop_target.cpp b/engines/titanic/core/multi_drop_target.cpp
new file mode 100644
index 0000000..1f6e6cf
--- /dev/null
+++ b/engines/titanic/core/multi_drop_target.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/multi_drop_target.h"
+
+namespace Titanic {
+
+void CMultiDropTarget::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string5, indent);
+	file->writeQuotedLine(_string6, indent);
+
+	CDropTarget::save(file, indent);
+}
+
+void CMultiDropTarget::load(SimpleFile *file) {
+	file->readNumber();
+	_string5 = file->readString();
+	_string6 = file->readString();
+
+	CDropTarget::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/multi_drop_target.h b/engines/titanic/core/multi_drop_target.h
new file mode 100644
index 0000000..db6f605
--- /dev/null
+++ b/engines/titanic/core/multi_drop_target.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MULTI_DROP_TARGET_H
+#define TITANIC_MULTI_DROP_TARGET_H
+
+#include "titanic/core/drop_target.h"
+
+namespace Titanic {
+
+class CMultiDropTarget : public CDropTarget {
+public:
+	CString _string5;
+	CString _string6;
+public:
+	CMultiDropTarget() : CDropTarget(), _string5("1,2") {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMultiDropTarget"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CLICK_RESPONDER_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 799ee3c..411f1b4 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -52,11 +52,13 @@
 #include "titanic/core/saveable_object.h"
 #include "titanic/core/background.h"
 #include "titanic/core/click_responder.h"
+#include "titanic/core/drop_target.h"
 #include "titanic/core/file_item.h"
 #include "titanic/core/link_item.h"
 #include "titanic/core/list.h"
 #include "titanic/core/message_target.h"
 #include "titanic/core/movie_clip.h"
+#include "titanic/core/multi_drop_target.h"
 #include "titanic/core/node_item.h"
 #include "titanic/core/project_item.h"
 #include "titanic/core/saveable_object.h"
@@ -76,17 +78,28 @@
 #include "titanic/game/desk_click_responder.h"
 #include "titanic/game/doorbot_home_handler.h"
 #include "titanic/game/drawer.h"
-#include "titanic/game/drop_target.h"
 #include "titanic/game/hammer_dispensor_button.h"
 #include "titanic/game/null_port_hole.h"
 #include "titanic/game/pet_position.h"
+#include "titanic/game/port_hole.h"
 #include "titanic/game/room_item.h"
 #include "titanic/game/service_elevator_door.h"
 #include "titanic/game/sgt_state_room.h"
 #include "titanic/game/sgt_upper_doors_sound.h"
 #include "titanic/game/start_action.h"
 #include "titanic/game/sub_glass.h"
+#include "titanic/game/sweet_bowl.h"
 #include "titanic/game/television.h"
+#include "titanic/game/parrot/parrot_lobby_controller.h"
+#include "titanic/game/parrot/parrot_lobby_link_updater.h"
+#include "titanic/game/parrot/parrot_lobby_object.h"
+#include "titanic/game/parrot/parrot_lobby_view_object.h"
+#include "titanic/game/parrot/parrot_loser.h"
+#include "titanic/game/parrot/parrot_nut_bowl_actor.h"
+#include "titanic/game/parrot/parrot_nut_eater.h"
+#include "titanic/game/parrot/parrot_perch_holder.h"
+#include "titanic/game/parrot/parrot_succubus.h"
+#include "titanic/game/parrot/parrot_trigger.h"
 
 #include "titanic/gfx/act_button.h"
 #include "titanic/gfx/changes_season_button.h"
@@ -187,12 +200,14 @@ DEFFN(CSweets);
 
 DEFFN(CBackground);
 DEFFN(CClickResponder);
+DEFFN(CDropTarget);
 DEFFN(CFileItem);
 DEFFN(CFileListItem);
 DEFFN(CLinkItem);
 DEFFN(CMessageTarget);
 DEFFN(CMovieClip);
 DEFFN(CMovieClipList);
+DEFFN(CMultiDropTarget);
 DEFFN(CNodeItem);
 DEFFN(CProjectItem);
 DEFFN(CTurnOnObject);
@@ -210,17 +225,28 @@ DEFFN(CCreditsButton);
 DEFFN(CDeadArea);
 DEFFN(CDeskClickResponder);
 DEFFN(CDoorbotHomeHandler);
-DEFFN(CDropTarget);
 DEFFN(CHammerDispensorButton);
 DEFFN(CNullPortHole);
 DEFFN(CPETPosition);
+DEFFN(CPortHole);
 DEFFN(CRoomItem);
 DEFFN(CServiceElevatorDoor);
 DEFFN(CSGTStateRoom);
 DEFFN(CSGTUpperDoorsSound);
 DEFFN(CStartAction);
 DEFFN(CSUBGlass);
+DEFFN(CSweetBowl);
 DEFFN(CTelevision);
+DEFFN(CParrotLobbyController);
+DEFFN(CParrotLobbyLinkUpdater);
+DEFFN(CParrotLobbyObject);
+DEFFN(CParrotLobbyViewObject);
+DEFFN(CParrotLoser);
+DEFFN(CParrotNutBowlActor);
+DEFFN(CParrotNutEater);
+DEFFN(CParrotPerchHolder);
+DEFFN(CParrotSuccUBus);
+DEFFN(CParrotTrigger);
 
 DEFFN(CActButton);
 DEFFN(CChangesSeasonButton);
@@ -485,12 +511,14 @@ void CSaveableObject::initClassList() {
 
 	ADDFN(CBackground);
 	ADDFN(CClickResponder);
+	ADDFN(CDropTarget);
 	ADDFN(CFileItem);
 	ADDFN(CFileListItem);
 	ADDFN(CLinkItem);
 	ADDFN(CMessageTarget);
 	ADDFN(CMovieClip);
 	ADDFN(CMovieClipList);
+	ADDFN(CMultiDropTarget);
 	ADDFN(CNodeItem);
 	ADDFN(CProjectItem);
 	ADDFN(CTreeItem);
@@ -512,13 +540,25 @@ void CSaveableObject::initClassList() {
 	ADDFN(CHammerDispensorButton);
 	ADDFN(CNullPortHole);
 	ADDFN(CPETPosition);
+	ADDFN(CPortHole);
 	ADDFN(CRoomItem);
 	ADDFN(CServiceElevatorDoor);
 	ADDFN(CSGTStateRoom);
 	ADDFN(CSGTUpperDoorsSound);
 	ADDFN(CStartAction);
 	ADDFN(CSUBGlass);
+	ADDFN(CSweetBowl);
 	ADDFN(CTelevision);
+	ADDFN(CParrotLobbyController);
+	ADDFN(CParrotLobbyLinkUpdater);
+	ADDFN(CParrotLobbyObject);
+	ADDFN(CParrotLobbyViewObject);
+	ADDFN(CParrotLoser);
+	ADDFN(CParrotNutBowlActor);
+	ADDFN(CParrotNutEater);
+	ADDFN(CParrotPerchHolder);
+	ADDFN(CParrotSuccUBus);
+	ADDFN(CParrotTrigger);
 
 	ADDFN(CActButton);
 	ADDFN(CChangesSeasonButton);
diff --git a/engines/titanic/game/drop_target.cpp b/engines/titanic/game/drop_target.cpp
deleted file mode 100644
index 34a87e0..0000000
--- a/engines/titanic/game/drop_target.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/drop_target.h"
-
-namespace Titanic {
-
-CDropTarget::CDropTarget() : CGameObject(), _fieldC4(0),
-	_fieldD4(0), _fieldE4(0), _fieldF4(0), _fieldF8(0),
-	_fieldFC(0), _field10C(1), _field110(8), _field114(20) {
-}
-
-void CDropTarget::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writePoint(_pos1, indent);
-	file->writeNumberLine(_fieldC4, indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeNumberLine(_fieldD4, indent);
-	file->writeQuotedLine(_string2, indent);
-	file->writeNumberLine(_fieldE4, indent);
-	file->writeQuotedLine(_string3, indent);
-	file->writeNumberLine(_fieldF4, indent);
-	file->writeNumberLine(_fieldF8, indent);
-	file->writeNumberLine(_fieldFC, indent);
-	file->writeQuotedLine(_string4, indent);
-	file->writeNumberLine(_field10C, indent);
-	file->writeNumberLine(_field110, indent);
-	file->writeNumberLine(_field114, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CDropTarget::load(SimpleFile *file) {
-	file->readNumber();
-	_pos1 = file->readPoint();
-	_fieldC4 = file->readNumber();
-	_string1 = file->readString();
-	_fieldD4 = file->readNumber();
-	_string2 = file->readString();
-	_fieldE4 = file->readNumber();
-	_string3 = file->readString();
-	_fieldF4 = file->readNumber();
-	_fieldF8 = file->readNumber();
-	_fieldFC = file->readNumber();
-	_string4 = file->readString();
-	_field10C = file->readNumber();
-	_field110 = file->readNumber();
-	_field114 = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/drop_target.h b/engines/titanic/game/drop_target.h
deleted file mode 100644
index b106623..0000000
--- a/engines/titanic/game/drop_target.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_DROP_TARGET_H
-#define TITANIC_DROP_TARGET_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CDropTarget : public CGameObject {
-private:
-	Common::Point _pos1;
-	int _fieldC4;
-	CString _string1;
-	int _fieldD4;
-	CString _string2;
-	int _fieldE4;
-	CString _string3;
-	int _fieldF4;
-	int _fieldF8;
-	int _fieldFC;
-	CString _string4;
-	int _field10C;
-	int _field110;
-	int _field114;
-public:
-	CDropTarget();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDropTarget"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_DROP_TARGET_H */
diff --git a/engines/titanic/game/parrot/parrot_lobby_controller.cpp b/engines/titanic/game/parrot/parrot_lobby_controller.cpp
new file mode 100644
index 0000000..2376cea
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_lobby_controller.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/parrot/parrot_lobby_controller.h"
+
+namespace Titanic {
+
+void CParrotLobbyController::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CParrotLobbyObject::save(file, indent);
+}
+
+void CParrotLobbyController::load(SimpleFile *file) {
+	file->readNumber();
+	CParrotLobbyObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/parrot/parrot_lobby_controller.h b/engines/titanic/game/parrot/parrot_lobby_controller.h
new file mode 100644
index 0000000..371e31e
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_lobby_controller.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PARROT_LOBBY_CONTROLLER_H
+#define TITANIC_PARROT_LOBBY_CONTROLLER_H
+
+#include "titanic/game/parrot/parrot_lobby_object.h"
+
+namespace Titanic {
+
+class CParrotLobbyController : public CParrotLobbyObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CParrotLobbyController"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PARROT_LOBBY_CONTROLLER_H */
diff --git a/engines/titanic/game/parrot/parrot_lobby_link_updater.cpp b/engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
new file mode 100644
index 0000000..912495d
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/parrot/parrot_lobby_link_updater.h"
+
+namespace Titanic {
+
+void CParrotLobbyLinkUpdater::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CParrotLobbyLinkUpdater::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/parrot/parrot_lobby_link_updater.h b/engines/titanic/game/parrot/parrot_lobby_link_updater.h
new file mode 100644
index 0000000..d0843fe
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_lobby_link_updater.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PARROT_LOBBY_LINK_UPDATER_H
+#define TITANIC_PARROT_LOBBY_LINK_UPDATER_H
+
+#include "titanic/game/parrot/parrot_lobby_object.h"
+
+namespace Titanic {
+
+class CParrotLobbyLinkUpdater : public CParrotLobbyObject {
+public:
+	int _fieldBC;
+public:
+	CParrotLobbyLinkUpdater() : CParrotLobbyObject(), _fieldBC(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CParrotLobbyLinkUpdater"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PARROT_LOBBY_LINK_UPDATER_H */
diff --git a/engines/titanic/game/parrot/parrot_lobby_object.cpp b/engines/titanic/game/parrot/parrot_lobby_object.cpp
new file mode 100644
index 0000000..137f3e2
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_lobby_object.cpp
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/parrot/parrot_lobby_object.h"
+
+namespace Titanic {
+
+int CParrotLobbyObject::_v1;
+int CParrotLobbyObject::_v2;
+int CParrotLobbyObject::_v3;
+int CParrotLobbyObject::_v4;
+
+void CParrotLobbyObject::init() {
+	_v1 = 1;
+	_v2 = 1;
+	_v3 = 1;
+	_v4 = 7;
+}
+
+void CParrotLobbyObject::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+	file->writeNumberLine(_v3, indent);
+	file->writeNumberLine(_v4, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CParrotLobbyObject::load(SimpleFile *file) {
+	file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+	_v3 = file->readNumber();
+	_v4 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/parrot/parrot_lobby_object.h b/engines/titanic/game/parrot/parrot_lobby_object.h
new file mode 100644
index 0000000..85f2c3b
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_lobby_object.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PARROT_LOBBY_OBJECT_H
+#define TITANIC_PARROT_LOBBY_OBJECT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CParrotLobbyObject : public CGameObject {
+public:
+	static int _v1;
+	static int _v2;
+	static int _v3;
+	static int _v4;
+
+	static void init();
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CParrotLobbyObject"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PARROT_LOBBY_OBJECT_H */
diff --git a/engines/titanic/game/parrot/parrot_lobby_view_object.cpp b/engines/titanic/game/parrot/parrot_lobby_view_object.cpp
new file mode 100644
index 0000000..740eac8
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_lobby_view_object.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/parrot/parrot_lobby_view_object.h"
+
+namespace Titanic {
+
+void CParrotLobbyViewObject::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);	
+	CParrotLobbyObject::save(file, indent);
+}
+
+void CParrotLobbyViewObject::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	CParrotLobbyObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/parrot/parrot_lobby_view_object.h b/engines/titanic/game/parrot/parrot_lobby_view_object.h
new file mode 100644
index 0000000..00f7bbc
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_lobby_view_object.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PARROT_LOBBY_VIEW_OBJECT_H
+#define TITANIC_PARROT_LOBBY_VIEW_OBJECT_H
+
+#include "titanic/game/parrot/parrot_lobby_object.h"
+
+namespace Titanic {
+
+class CParrotLobbyViewObject : public CParrotLobbyObject {
+public:
+	int _fieldBC;
+public:
+	CParrotLobbyViewObject() : CParrotLobbyObject(), _fieldBC(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CParrotLobbyViewObject"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PARROT_LOBBY_VIEW_OBJECT_H */
diff --git a/engines/titanic/game/parrot/parrot_loser.cpp b/engines/titanic/game/parrot/parrot_loser.cpp
new file mode 100644
index 0000000..e82506e
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_loser.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/parrot/parrot_loser.h"
+
+namespace Titanic {
+
+void CParrotLoser::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CParrotLoser::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/parrot/parrot_loser.h b/engines/titanic/game/parrot/parrot_loser.h
new file mode 100644
index 0000000..dac253e
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_loser.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PARROT_LOSER_H
+#define TITANIC_PARROT_LOSER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CParrotLoser : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CParrotLoser"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PARROT_LOSER_H */
diff --git a/engines/titanic/game/parrot/parrot_nut_bowl_actor.cpp b/engines/titanic/game/parrot/parrot_nut_bowl_actor.cpp
new file mode 100644
index 0000000..0917319
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_nut_bowl_actor.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/parrot/parrot_nut_bowl_actor.h"
+
+namespace Titanic {
+
+CParrotNutBowlActor::CParrotNutBowlActor() : CGameObject(), 
+		_value1(0), _value2(0) {
+}
+
+void CParrotNutBowlActor::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+	
+	CGameObject::save(file, indent);
+}
+
+void CParrotNutBowlActor::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/parrot/parrot_nut_bowl_actor.h b/engines/titanic/game/parrot/parrot_nut_bowl_actor.h
new file mode 100644
index 0000000..623918c
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_nut_bowl_actor.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PARROT_NUT_BOWL_ACTOR_H
+#define TITANIC_PARROT_NUT_BOWL_ACTOR_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CParrotNutBowlActor : public CGameObject {
+public:
+	int _value1, _value2;
+public:
+	CParrotNutBowlActor();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CParrotNutBowlActor"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PARROT_NUT_BOWL_ACTOR_H */
diff --git a/engines/titanic/game/parrot/parrot_nut_eater.cpp b/engines/titanic/game/parrot/parrot_nut_eater.cpp
new file mode 100644
index 0000000..9d58632
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_nut_eater.cpp
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/parrot/parrot_nut_eater.h"
+
+namespace Titanic {
+
+CParrotNutEater::CParrotNutEater() : CGameObject(), _fieldBC(0),
+		_fieldC0(69), _fieldC4(132), _fieldC8(0), _fieldCC(68) {
+}
+
+void CParrotNutEater::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	
+	CGameObject::save(file, indent);
+}
+
+void CParrotNutEater::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/parrot/parrot_nut_eater.h b/engines/titanic/game/parrot/parrot_nut_eater.h
new file mode 100644
index 0000000..55367af
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_nut_eater.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PARROT_NUT_EATER_H
+#define TITANIC_PARROT_NUT_EATER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CParrotNutEater : public CGameObject {
+public:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	int _fieldCC;
+public:
+	CParrotNutEater();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CParrotNutEater"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CREDITS_H */
diff --git a/engines/titanic/game/parrot/parrot_perch_holder.cpp b/engines/titanic/game/parrot/parrot_perch_holder.cpp
new file mode 100644
index 0000000..00dfe4a
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_perch_holder.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/parrot/parrot_perch_holder.h"
+
+namespace Titanic {
+
+void CParrotPerchHolder::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CMultiDropTarget::save(file, indent);
+}
+
+void CParrotPerchHolder::load(SimpleFile *file) {
+	file->readNumber();
+	CMultiDropTarget::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/parrot/parrot_perch_holder.h b/engines/titanic/game/parrot/parrot_perch_holder.h
new file mode 100644
index 0000000..489e124
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_perch_holder.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PARROT_PERCH_HOLDER_H
+#define TITANIC_PARROT_PERCH_HOLDER_H
+
+#include "titanic/core/multi_drop_target.h"
+
+namespace Titanic {
+
+class CParrotPerchHolder : public CMultiDropTarget {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CParrotPerchHolder"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PARROT_PERCH_HOLDER_H */
diff --git a/engines/titanic/game/parrot/parrot_succubus.cpp b/engines/titanic/game/parrot/parrot_succubus.cpp
new file mode 100644
index 0000000..e29c6a6
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_succubus.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/parrot/parrot_succubus.h"
+
+namespace Titanic {
+
+CParrotSuccUBus::CParrotSuccUBus() : CSuccUBus(), _field1DC(0), 
+	_field1EC(0), _field1F0(376), _field1F4(393) {
+}
+
+void CParrotSuccUBus::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field1DC, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeNumberLine(_field1EC, indent);
+	
+	CSuccUBus::save(file, indent);
+}
+
+void CParrotSuccUBus::load(SimpleFile *file) {
+	file->readNumber();
+	_field1DC = file->readNumber();
+	_string3 = file->readString();
+	_field1EC = file->readNumber();
+
+	CSuccUBus::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/parrot/parrot_succubus.h b/engines/titanic/game/parrot/parrot_succubus.h
new file mode 100644
index 0000000..aad8a7f
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_succubus.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PARROT_SUCCUBUS_H
+#define TITANIC_PARROT_SUCCUBUS_H
+
+#include "titanic/npcs/succubus.h"
+
+namespace Titanic {
+
+class CParrotSuccUBus : public CSuccUBus {
+public:
+	int _field1DC;
+	CString _string3;
+	int _field1EC;
+	int _field1F0;
+	int _field1F4;
+public:
+	CParrotSuccUBus();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CParrotSuccUBus"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PARROT_SUCCUBUS_H */
diff --git a/engines/titanic/game/parrot/parrot_trigger.cpp b/engines/titanic/game/parrot/parrot_trigger.cpp
new file mode 100644
index 0000000..aeab3c1
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_trigger.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/parrot/parrot_trigger.h"
+
+namespace Titanic {
+
+void CParrotTrigger::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CParrotTrigger::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/parrot/parrot_trigger.h b/engines/titanic/game/parrot/parrot_trigger.h
new file mode 100644
index 0000000..cb0d59c
--- /dev/null
+++ b/engines/titanic/game/parrot/parrot_trigger.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PARROT_TRIGGER_H
+#define TITANIC_PARROT_TRIGGER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CParrotTrigger : public CGameObject {
+public:
+	int _value;
+public:
+	CParrotTrigger() : CGameObject(), _value(0x446AB) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CParrotTrigger"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PARROT_TRIGGER_H */
diff --git a/engines/titanic/game/port_hole.cpp b/engines/titanic/game/port_hole.cpp
new file mode 100644
index 0000000..5564732
--- /dev/null
+++ b/engines/titanic/game/port_hole.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/port_hole.h"
+
+namespace Titanic {
+
+CPortHole::CPortHole() : CGameObject(), _fieldBC(0),
+		_string1("b#47.wav"), _string2("b#46.wav") {
+}
+
+void CPortHole::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CPortHole::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/port_hole.h b/engines/titanic/game/port_hole.h
new file mode 100644
index 0000000..60aab51
--- /dev/null
+++ b/engines/titanic/game/port_hole.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PORT_HOLE_H
+#define TITANIC_PORT_HOLE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPortHole : public CGameObject {
+private:
+	int _fieldBC;
+	CString _string1, _string2;
+public:
+	CPortHole();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPortHole"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PORT_HOLE_H */
diff --git a/engines/titanic/game/sweet_bowl.cpp b/engines/titanic/game/sweet_bowl.cpp
new file mode 100644
index 0000000..f6bbb2c
--- /dev/null
+++ b/engines/titanic/game/sweet_bowl.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sweet_bowl.h"
+
+namespace Titanic {
+
+void CSweetBowl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CSweetBowl::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sweet_bowl.h b/engines/titanic/game/sweet_bowl.h
new file mode 100644
index 0000000..8fb20e4
--- /dev/null
+++ b/engines/titanic/game/sweet_bowl.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SWEET_BOWL_H
+#define TITANIC_SWEET_BOWL_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CSweetBowl : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSweetBowl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CREDITS_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 9faf157..f2265bf 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -46,12 +46,14 @@ MODULE_OBJS := \
 	core/background.o \
 	core/click_responder.o \
 	core/dont_save_file_item.o \
+	core/drop_target.o \
 	core/file_item.o \
 	core/game_object.o \
 	core/link_item.o \
 	core/list.o \
 	core/message_target.o \
 	core/movie_clip.o \
+	core/multi_drop_target.o \
 	core/named_item.o \
 	core/node_item.o \
 	core/pet_control.o \
@@ -73,9 +75,9 @@ MODULE_OBJS := \
 	game/desk_click_responder.o \
 	game/doorbot_home_handler.o \
 	game/drawer.o \
-	game/drop_target.o \
 	game/hammer_dispensor_button.o \
 	game/pet_position.o \
+	game/port_hole.o \
 	game/null_port_hole.o \
 	game/room_item.o \
 	game/service_elevator_door.o \
@@ -83,7 +85,18 @@ MODULE_OBJS := \
 	game/sgt_upper_doors_sound.o \
 	game/start_action.o \
 	game/sub_glass.o \
+	game/sweet_bowl.o \
 	game/television.o \
+	game/parrot/parrot_lobby_controller.o \
+	game/parrot/parrot_lobby_link_updater.o \
+	game/parrot/parrot_lobby_object.o \
+	game/parrot/parrot_lobby_view_object.o \
+	game/parrot/parrot_loser.o \
+	game/parrot/parrot_nut_bowl_actor.o \
+	game/parrot/parrot_nut_eater.o \
+	game/parrot/parrot_perch_holder.o \
+	game/parrot/parrot_succubus.o \
+	game/parrot/parrot_trigger.o \
 	gfx/act_button.o \
 	gfx/changes_season_button.o \
 	gfx/chev_left_off.o \
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 47b7c13..9deb5e6 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -29,6 +29,7 @@
 #include "graphics/thumbnail.h"
 #include "titanic/titanic.h"
 #include "titanic/core/saveable_object.h"
+#include "titanic/game/parrot/parrot_lobby_object.h"
 
 namespace Titanic {
 
@@ -52,6 +53,8 @@ void TitanicEngine::initialize() {
 	DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
 
 	CSaveableObject::initClassList();
+	CParrotLobbyObject::init();
+
 	_screenManager = new OSScreenManager(this);
 	_window = new CMainGameWindow(this);
 	_window->applicationStarting();


Commit: fa015808acb611f681a8027128e48fb458a84d14
    https://github.com/scummvm/scummvm/commit/fa015808acb611f681a8027128e48fb458a84d14
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-28T11:53:57-05:00

Commit Message:
TITANIC: Implement bowl and ear classes

Changed paths:
  A engines/titanic/carry/bowl_ear.cpp
  A engines/titanic/carry/bowl_ear.h
  A engines/titanic/carry/phonograph_ear.cpp
  A engines/titanic/carry/phonograph_ear.h
  A engines/titanic/game/bowl_unlocker.cpp
  A engines/titanic/game/bowl_unlocker.h
  A engines/titanic/game/ear_sweet_bowl.cpp
  A engines/titanic/game/ear_sweet_bowl.h
  A engines/titanic/game/empty_nut_bowl.cpp
  A engines/titanic/game/empty_nut_bowl.h
  A engines/titanic/game/no_nut_bowl.cpp
  A engines/titanic/game/no_nut_bowl.h
  A engines/titanic/game/nut_replacer.cpp
  A engines/titanic/game/nut_replacer.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/carry/bowl_ear.cpp b/engines/titanic/carry/bowl_ear.cpp
new file mode 100644
index 0000000..70d2409
--- /dev/null
+++ b/engines/titanic/carry/bowl_ear.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/bowl_ear.h"
+
+namespace Titanic {
+
+void CBowlEar::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CEar::save(file, indent);
+}
+
+void CBowlEar::load(SimpleFile *file) {
+	file->readNumber();
+	CEar::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/bowl_ear.h b/engines/titanic/carry/bowl_ear.h
new file mode 100644
index 0000000..c03446d
--- /dev/null
+++ b/engines/titanic/carry/bowl_ear.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BOWL_EAR_H
+#define TITANIC_BOWL_EAR_H
+
+#include "titanic/carry/ear.h"
+
+namespace Titanic {
+
+class CBowlEar : public CEar {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBowlEar"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BOWL_EAR_H */
diff --git a/engines/titanic/carry/phonograph_ear.cpp b/engines/titanic/carry/phonograph_ear.cpp
new file mode 100644
index 0000000..759356a
--- /dev/null
+++ b/engines/titanic/carry/phonograph_ear.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/phonograph_ear.h"
+
+namespace Titanic {
+
+void CPhonographEar::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CEar::save(file, indent);
+}
+
+void CPhonographEar::load(SimpleFile *file) {
+	file->readNumber();
+	CEar::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/phonograph_ear.h b/engines/titanic/carry/phonograph_ear.h
new file mode 100644
index 0000000..5904200
--- /dev/null
+++ b/engines/titanic/carry/phonograph_ear.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PHONOGRAPH_EYE_H
+#define TITANIC_PHONOGRAPH_EYE_H
+
+#include "titanic/carry/ear.h"
+
+namespace Titanic {
+
+class CPhonographEar : public CEar {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPhonographEar"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PHONOGRAPH_EYE_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 411f1b4..f0429a7 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -21,13 +21,13 @@
  */
 
 #include "titanic/carry/arm.h"
+#include "titanic/carry/bowl_ear.h"
 #include "titanic/carry/brain.h"
 #include "titanic/carry/bridge_piece.h"
 #include "titanic/carry/carry.h"
 #include "titanic/carry/carry_parrot.h"
 #include "titanic/carry/chicken.h"
 #include "titanic/carry/crushed_tv.h"
-#include "titanic/carry/ear.h"
 #include "titanic/carry/eye.h"
 #include "titanic/carry/feathers.h"
 #include "titanic/carry/fruit.h"
@@ -45,6 +45,7 @@
 #include "titanic/carry/note.h"
 #include "titanic/carry/parcel.h"
 #include "titanic/carry/phonograph_cylinder.h"
+#include "titanic/carry/phonograph_ear.h"
 #include "titanic/carry/photograph.h"
 #include "titanic/carry/plug_in.h"
 #include "titanic/carry/sweets.h"
@@ -68,6 +69,7 @@
 #include "titanic/core/view_item.h"
 
 #include "titanic/game/announce.h"
+#include "titanic/game/bowl_unlocker.h"
 #include "titanic/game/cdrom.h"
 #include "titanic/game/cdrom_computer.h"
 #include "titanic/game/cdrom_tray.h"
@@ -78,8 +80,12 @@
 #include "titanic/game/desk_click_responder.h"
 #include "titanic/game/doorbot_home_handler.h"
 #include "titanic/game/drawer.h"
+#include "titanic/game/ear_sweet_bowl.h"
+#include "titanic/game/empty_nut_bowl.h"
 #include "titanic/game/hammer_dispensor_button.h"
+#include "titanic/game/no_nut_bowl.h"
 #include "titanic/game/null_port_hole.h"
+#include "titanic/game/nut_replacer.h"
 #include "titanic/game/pet_position.h"
 #include "titanic/game/port_hole.h"
 #include "titanic/game/room_item.h"
@@ -175,11 +181,13 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 #define ADDFN(T) (*_classList)[#T] = Function##T
 
 DEFFN(CArm);
+DEFFN(CBowlEar);
 DEFFN(CBrain);
 DEFFN(CBridgePiece);
 DEFFN(CCarryParrot);
 DEFFN(CChicken);
 DEFFN(CCrushedTV);
+DEFFN(CEar);
 DEFFN(CFeathers);
 DEFFN(CFruit);
 DEFFN(CGlass);
@@ -194,6 +202,7 @@ DEFFN(CNapkin);
 DEFFN(CNote);
 DEFFN(CParcel);
 DEFFN(CPhonographCylinder);
+DEFFN(CPhonographEar);
 DEFFN(CPhotograph);
 DEFFN(CPlugIn);
 DEFFN(CSweets);
@@ -216,6 +225,7 @@ DEFFN(CTreeItem);
 DEFFN(CViewItem);
 
 DEFFN(CAnnounce);
+DEFFN(CBowlUnlocker);
 DEFFN(CCDROM);
 DEFFN(CCDROMComputer);
 DEFFN(CCDROMTray);
@@ -225,8 +235,12 @@ DEFFN(CCreditsButton);
 DEFFN(CDeadArea);
 DEFFN(CDeskClickResponder);
 DEFFN(CDoorbotHomeHandler);
+DEFFN(CEarSweetBowl);
+DEFFN(CEmptyNutBowl);
 DEFFN(CHammerDispensorButton);
+DEFFN(CNoNutBowl);
 DEFFN(CNullPortHole);
+DEFFN(CNutReplacer);
 DEFFN(CPETPosition);
 DEFFN(CPortHole);
 DEFFN(CRoomItem);
@@ -486,11 +500,13 @@ DEFFN(CAutoMusicPlayer);
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
 	ADDFN(CArm);
+	ADDFN(CBowlEar);
 	ADDFN(CBrain);
 	ADDFN(CBridgePiece);
 	ADDFN(CCarryParrot);
 	ADDFN(CChicken);
 	ADDFN(CCrushedTV);
+	ADDFN(CEar);
 	ADDFN(CFeathers);
 	ADDFN(CFruit);
 	ADDFN(CGlass);
@@ -505,6 +521,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CNote);
 	ADDFN(CParcel);
 	ADDFN(CPhonographCylinder);
+	ADDFN(CPhonographEar);
 	ADDFN(CPhotograph);
 	ADDFN(CPlugIn);
 	ADDFN(CSweets);
@@ -527,6 +544,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CViewItem);
 
 	ADDFN(CAnnounce);
+	ADDFN(CBowlUnlocker);
 	ADDFN(CCDROM);
 	ADDFN(CCDROMComputer);
 	ADDFN(CCDROMTray);
@@ -537,8 +555,12 @@ void CSaveableObject::initClassList() {
 	ADDFN(CDeskClickResponder);
 	ADDFN(CDoorbotHomeHandler);
 	ADDFN(CDropTarget);
+	ADDFN(CEarSweetBowl);
+	ADDFN(CEmptyNutBowl);
 	ADDFN(CHammerDispensorButton);
+	ADDFN(CNoNutBowl);
 	ADDFN(CNullPortHole);
+	ADDFN(CNutReplacer);
 	ADDFN(CPETPosition);
 	ADDFN(CPortHole);
 	ADDFN(CRoomItem);
diff --git a/engines/titanic/game/bowl_unlocker.cpp b/engines/titanic/game/bowl_unlocker.cpp
new file mode 100644
index 0000000..83ae9e3
--- /dev/null
+++ b/engines/titanic/game/bowl_unlocker.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/bowl_unlocker.h"
+
+namespace Titanic {
+
+void CBowlUnlocker::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CBowlUnlocker::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/bowl_unlocker.h b/engines/titanic/game/bowl_unlocker.h
new file mode 100644
index 0000000..455b0a7
--- /dev/null
+++ b/engines/titanic/game/bowl_unlocker.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BOWL_UNLOCKER_H
+#define TITANIC_BOWL_UNLOCKER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CBowlUnlocker : public CGameObject {
+public:
+	int _value;
+public:
+	CBowlUnlocker() : CGameObject(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBowlUnlocker"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BOWL_UNLOCKER_H */
diff --git a/engines/titanic/game/ear_sweet_bowl.cpp b/engines/titanic/game/ear_sweet_bowl.cpp
new file mode 100644
index 0000000..dc4ca7a
--- /dev/null
+++ b/engines/titanic/game/ear_sweet_bowl.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/ear_sweet_bowl.h"
+
+namespace Titanic {
+
+void CEarSweetBowl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSweetBowl::save(file, indent);
+}
+
+void CEarSweetBowl::load(SimpleFile *file) {
+	file->readNumber();
+	CSweetBowl::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/ear_sweet_bowl.h b/engines/titanic/game/ear_sweet_bowl.h
new file mode 100644
index 0000000..3e27516
--- /dev/null
+++ b/engines/titanic/game/ear_sweet_bowl.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EAR_SWEET_BOWL_H
+#define TITANIC_EAR_SWEET_BOWL_H
+
+#include "titanic/game/sweet_bowl.h"
+
+namespace Titanic {
+
+class CEarSweetBowl : public CSweetBowl {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEarSweetBowl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EAR_SWEET_BOWL_H */
diff --git a/engines/titanic/game/empty_nut_bowl.cpp b/engines/titanic/game/empty_nut_bowl.cpp
new file mode 100644
index 0000000..217029b
--- /dev/null
+++ b/engines/titanic/game/empty_nut_bowl.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/empty_nut_bowl.h"
+
+namespace Titanic {
+
+void CEmptyNutBowl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CEmptyNutBowl::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/empty_nut_bowl.h b/engines/titanic/game/empty_nut_bowl.h
new file mode 100644
index 0000000..c1c553a
--- /dev/null
+++ b/engines/titanic/game/empty_nut_bowl.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EMPTY_NUT_BOWL_H
+#define TITANIC_EMPTY_NUT_BOWL_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CEmptyNutBowl : public CGameObject {
+public:
+	int _value;
+public:
+	CEmptyNutBowl() : CGameObject(), _value(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEmptyNutBowl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NO_NUT_BOWL_H */
diff --git a/engines/titanic/game/no_nut_bowl.cpp b/engines/titanic/game/no_nut_bowl.cpp
new file mode 100644
index 0000000..354dea3
--- /dev/null
+++ b/engines/titanic/game/no_nut_bowl.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/no_nut_bowl.h"
+
+namespace Titanic {
+
+void CNoNutBowl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CBackground::save(file, indent);
+}
+
+void CNoNutBowl::load(SimpleFile *file) {
+	file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/no_nut_bowl.h b/engines/titanic/game/no_nut_bowl.h
new file mode 100644
index 0000000..40e8fd1
--- /dev/null
+++ b/engines/titanic/game/no_nut_bowl.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NO_NUT_BOWL_H
+#define TITANIC_NO_NUT_BOWL_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CNoNutBowl : public CBackground {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNoNutBowl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NO_NUT_BOWL_H */
diff --git a/engines/titanic/game/nut_replacer.cpp b/engines/titanic/game/nut_replacer.cpp
new file mode 100644
index 0000000..36c0510
--- /dev/null
+++ b/engines/titanic/game/nut_replacer.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/nut_replacer.h"
+
+namespace Titanic {
+
+void CNutReplacer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CNutReplacer::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/nut_replacer.h b/engines/titanic/game/nut_replacer.h
new file mode 100644
index 0000000..ef800c7
--- /dev/null
+++ b/engines/titanic/game/nut_replacer.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NUT_REPLACER_H
+#define TITANIC_NUT_REPLACER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CNutReplacer : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNutReplacer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NUT_REPLACER_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index f2265bf..0b43dbb 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -16,6 +16,7 @@ MODULE_OBJS := \
 	titanic.o \
 	video_surface.o \
 	carry/arm.o \
+	carry/bowl_ear.o \
 	carry/brain.o \
 	carry/bridge_piece.o \
 	carry/carry.o \
@@ -40,6 +41,7 @@ MODULE_OBJS := \
 	carry/note.o \
 	carry/parcel.o \
 	carry/phonograph_cylinder.o \
+	carry/phonograph_ear.o \
 	carry/photograph.o \
 	carry/plug_in.o \
 	carry/sweets.o \
@@ -65,6 +67,7 @@ MODULE_OBJS := \
 	core/tree_item.o \
 	core/view_item.o \
 	game/announce.o \
+	game/bowl_unlocker.o \
 	game/cdrom.o \
 	game/cdrom_computer.o \
 	game/cdrom_tray.o \
@@ -75,10 +78,14 @@ MODULE_OBJS := \
 	game/desk_click_responder.o \
 	game/doorbot_home_handler.o \
 	game/drawer.o \
+	game/ear_sweet_bowl.o \
+	game/empty_nut_bowl.o \
 	game/hammer_dispensor_button.o \
+	game/no_nut_bowl.o \
 	game/pet_position.o \
 	game/port_hole.o \
 	game/null_port_hole.o \
+	game/nut_replacer.o \
 	game/room_item.o \
 	game/service_elevator_door.o \
 	game/sgt_state_room.o \


Commit: 0471a25575d7cabff26f8abbace55c1dadaf6320
    https://github.com/scummvm/scummvm/commit/0471a25575d7cabff26f8abbace55c1dadaf6320
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-28T12:46:48-05:00

Commit Message:
TITANIC: Implement light switch and buttons

Changed paths:
  A engines/titanic/game/enter_exit_first_class_state.cpp
  A engines/titanic/game/enter_exit_first_class_state.h
  A engines/titanic/game/light.cpp
  A engines/titanic/game/light.h
  A engines/titanic/game/light_switch.cpp
  A engines/titanic/game/light_switch.h
  A engines/titanic/game/little_lift_button.cpp
  A engines/titanic/game/little_lift_button.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index f0429a7..12efdc1 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -82,7 +82,11 @@
 #include "titanic/game/drawer.h"
 #include "titanic/game/ear_sweet_bowl.h"
 #include "titanic/game/empty_nut_bowl.h"
+#include "titanic/game/enter_exit_first_class_state.h"
 #include "titanic/game/hammer_dispensor_button.h"
+#include "titanic/game/light.h"
+#include "titanic/game/light_switch.h"
+#include "titanic/game/little_lift_button.h"
 #include "titanic/game/no_nut_bowl.h"
 #include "titanic/game/null_port_hole.h"
 #include "titanic/game/nut_replacer.h"
@@ -188,6 +192,7 @@ DEFFN(CCarryParrot);
 DEFFN(CChicken);
 DEFFN(CCrushedTV);
 DEFFN(CEar);
+DEFFN(CEye);
 DEFFN(CFeathers);
 DEFFN(CFruit);
 DEFFN(CGlass);
@@ -237,7 +242,11 @@ DEFFN(CDeskClickResponder);
 DEFFN(CDoorbotHomeHandler);
 DEFFN(CEarSweetBowl);
 DEFFN(CEmptyNutBowl);
+DEFFN(CEnterExitFirstClassState);
 DEFFN(CHammerDispensorButton);
+DEFFN(CLight);
+DEFFN(CLightSwitch);
+DEFFN(CLittleLiftButton);
 DEFFN(CNoNutBowl);
 DEFFN(CNullPortHole);
 DEFFN(CNutReplacer);
@@ -507,6 +516,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CChicken);
 	ADDFN(CCrushedTV);
 	ADDFN(CEar);
+	ADDFN(CEye);
 	ADDFN(CFeathers);
 	ADDFN(CFruit);
 	ADDFN(CGlass);
@@ -557,7 +567,11 @@ void CSaveableObject::initClassList() {
 	ADDFN(CDropTarget);
 	ADDFN(CEarSweetBowl);
 	ADDFN(CEmptyNutBowl);
+	ADDFN(CEnterExitFirstClassState);
 	ADDFN(CHammerDispensorButton);
+	ADDFN(CLight);
+	ADDFN(CLightSwitch);
+	ADDFN(CLittleLiftButton);
 	ADDFN(CNoNutBowl);
 	ADDFN(CNullPortHole);
 	ADDFN(CNutReplacer);
diff --git a/engines/titanic/game/enter_exit_first_class_state.cpp b/engines/titanic/game/enter_exit_first_class_state.cpp
new file mode 100644
index 0000000..7fa191b
--- /dev/null
+++ b/engines/titanic/game/enter_exit_first_class_state.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/enter_exit_first_class_state.h"
+
+namespace Titanic {
+
+CString *CEnterExitFirstClassState::_v1;
+
+void CEnterExitFirstClassState::init() {
+	_v1 = new CString();
+}
+
+void CEnterExitFirstClassState::deinit() {
+	delete _v1;
+}
+
+void CEnterExitFirstClassState::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(*_v1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CEnterExitFirstClassState::load(SimpleFile *file) {
+	file->readNumber();
+	*_v1 = file->readString();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/enter_exit_first_class_state.h b/engines/titanic/game/enter_exit_first_class_state.h
new file mode 100644
index 0000000..f7bc4c6
--- /dev/null
+++ b/engines/titanic/game/enter_exit_first_class_state.h
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_EXIT_FIRST_CLASS_STATE_H
+#define TITANIC_ENTER_EXIT_FIRST_CLASS_STATE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEnterExitFirstClassState : public CGameObject {
+public:
+	static CString *_v1;
+
+	/**
+	 * Initialize static data
+	 */
+	static void init();
+
+	/**
+	 * De-initialize static data
+	 */
+	static void deinit();
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBowlUnlocker"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_EXIT_FIRST_CLASS_STATE_H */
diff --git a/engines/titanic/game/light.cpp b/engines/titanic/game/light.cpp
new file mode 100644
index 0000000..4f5a492
--- /dev/null
+++ b/engines/titanic/game/light.cpp
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/light.h"
+
+namespace Titanic {
+
+CLight::CLight() : CBackground(), _fieldE0(0), _fieldE4(0),
+	_fieldE8(0), _fieldEC(0), _fieldF0(0), _fieldF4(0),
+	_fieldF8(0), _fieldFC(0) {
+}
+
+void CLight::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_fieldF4, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_fieldFC, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CLight::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_fieldF0 = file->readNumber();
+	_fieldF4 = file->readNumber();
+	_fieldF8 = file->readNumber();
+	_fieldFC = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/light.h b/engines/titanic/game/light.h
new file mode 100644
index 0000000..482d1be
--- /dev/null
+++ b/engines/titanic/game/light.h
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LIGHT_H
+#define TITANIC_LIGHT_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CLight : public CBackground {
+private:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+	int _fieldF4;
+	int _fieldF8;
+	int _fieldFC;
+public:
+	CLight();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLight"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LIGHT_H */
diff --git a/engines/titanic/game/light_switch.cpp b/engines/titanic/game/light_switch.cpp
new file mode 100644
index 0000000..605fab3
--- /dev/null
+++ b/engines/titanic/game/light_switch.cpp
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/light_switch.h"
+
+namespace Titanic {
+
+int CLightSwitch::_v1;
+
+CLightSwitch::CLightSwitch() : CBackground(), 
+		_fieldE0(0), _fieldE4(0), _fieldE8(0) {
+}
+
+void CLightSwitch::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_fieldE8, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CLightSwitch::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_v1 = file->readNumber();
+	_fieldE8 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/light_switch.h b/engines/titanic/game/light_switch.h
new file mode 100644
index 0000000..0228b10
--- /dev/null
+++ b/engines/titanic/game/light_switch.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LIGHT_SWITCH_H
+#define TITANIC_LIGHT_SWITCH_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CLightSwitch : public CBackground {
+public:
+	static int _v1;
+private:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+public:
+	CLightSwitch();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLightSwitch"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LIGHT_SWITCH_H */
diff --git a/engines/titanic/game/little_lift_button.cpp b/engines/titanic/game/little_lift_button.cpp
new file mode 100644
index 0000000..3e2fbdd
--- /dev/null
+++ b/engines/titanic/game/little_lift_button.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/little_lift_button.h"
+
+namespace Titanic {
+
+void CLittleLiftButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CBackground::save(file, indent);
+}
+
+void CLittleLiftButton::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/little_lift_button.h b/engines/titanic/game/little_lift_button.h
new file mode 100644
index 0000000..475b843
--- /dev/null
+++ b/engines/titanic/game/little_lift_button.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LITTLE_LIFT_BUTTON_H
+#define TITANIC_LITTLE_LIFT_BUTTON_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CLittleLiftButton : public CBackground {
+private:
+	int _value;
+public:
+	CLittleLiftButton() : CBackground(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLittleLiftButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LITTLE_LIFT_BUTTON_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 0b43dbb..111fd25 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -80,7 +80,11 @@ MODULE_OBJS := \
 	game/drawer.o \
 	game/ear_sweet_bowl.o \
 	game/empty_nut_bowl.o \
+	game/enter_exit_first_class_state.o \
 	game/hammer_dispensor_button.o \
+	game/light.o \
+	game/light_switch.o \
+	game/little_lift_button.o \
 	game/no_nut_bowl.o \
 	game/pet_position.o \
 	game/port_hole.o \
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 9deb5e6..b3aae7b 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -30,6 +30,7 @@
 #include "titanic/titanic.h"
 #include "titanic/core/saveable_object.h"
 #include "titanic/game/parrot/parrot_lobby_object.h"
+#include "titanic/game/enter_exit_first_class_state.h"
 
 namespace Titanic {
 
@@ -54,12 +55,17 @@ void TitanicEngine::initialize() {
 
 	CSaveableObject::initClassList();
 	CParrotLobbyObject::init();
+	CEnterExitFirstClassState::init();
 
 	_screenManager = new OSScreenManager(this);
 	_window = new CMainGameWindow(this);
 	_window->applicationStarting();
 }
 
+void TitanicEngine::deinitialize() {
+	CEnterExitFirstClassState::deinit();
+}
+
 Common::Error TitanicEngine::run() {
 	initialize();
 
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index ec0585c..3a95e86 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -72,6 +72,11 @@ private:
 	 * Handles basic initialization
 	 */
 	void initialize();
+
+	/**
+	 * Handles game deinitialization
+	 */
+	void deinitialize();
 protected:
 	const TitanicGameDescription *_gameDescription;
 	int _loadSaveSlot;


Commit: 6eb777fe362d77189425c2ae137bedab0af5ee5f
    https://github.com/scummvm/scummvm/commit/6eb777fe362d77189425c2ae137bedab0af5ee5f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-28T21:42:13-05:00

Commit Message:
TITANIC: Added a lot of class definitions

Let's be honest here, it's a s**t-load of class definitions

Changed paths:
  A engines/titanic/carry/test_carry.cpp
  A engines/titanic/carry/test_carry.h
  A engines/titanic/core/static_image.cpp
  A engines/titanic/core/static_image.h
  A engines/titanic/game/annoy_barbot.cpp
  A engines/titanic/game/annoy_barbot.h
  A engines/titanic/game/bar_bell.cpp
  A engines/titanic/game/bar_bell.h
  A engines/titanic/game/bar_menu.cpp
  A engines/titanic/game/bar_menu.h
  A engines/titanic/game/bar_menu_button.cpp
  A engines/titanic/game/bar_menu_button.h
  A engines/titanic/game/belbot_get_light.cpp
  A engines/titanic/game/belbot_get_light.h
  A engines/titanic/game/bottom_of_well_monitor.cpp
  A engines/titanic/game/bottom_of_well_monitor.h
  A engines/titanic/game/brain_slot.cpp
  A engines/titanic/game/brain_slot.h
  A engines/titanic/game/bridge_door.cpp
  A engines/titanic/game/bridge_door.h
  A engines/titanic/game/call_pellerator.cpp
  A engines/titanic/game/call_pellerator.h
  A engines/titanic/game/chev_code.cpp
  A engines/titanic/game/chev_code.h
  A engines/titanic/game/chev_panel.cpp
  A engines/titanic/game/chev_panel.h
  A engines/titanic/game/chicken_cooler.cpp
  A engines/titanic/game/chicken_cooler.h
  A engines/titanic/game/cookie.cpp
  A engines/titanic/game/cookie.h
  A engines/titanic/game/doorbot_elevator_handler.cpp
  A engines/titanic/game/doorbot_elevator_handler.h
  A engines/titanic/game/elevator_action_area.cpp
  A engines/titanic/game/elevator_action_area.h
  A engines/titanic/game/end_credit_text.cpp
  A engines/titanic/game/end_credit_text.h
  A engines/titanic/game/end_credits.cpp
  A engines/titanic/game/end_credits.h
  A engines/titanic/game/end_explode_ship.cpp
  A engines/titanic/game/end_explode_ship.h
  A engines/titanic/game/end_game_credits.cpp
  A engines/titanic/game/end_game_credits.h
  A engines/titanic/game/end_sequence_control.cpp
  A engines/titanic/game/end_sequence_control.h
  A engines/titanic/game/enter_bridge.cpp
  A engines/titanic/game/enter_bridge.h
  A engines/titanic/game/enter_exit_sec_class_mini_lift.cpp
  A engines/titanic/game/enter_exit_sec_class_mini_lift.h
  A engines/titanic/game/enter_exit_view.cpp
  A engines/titanic/game/enter_exit_view.h
  A engines/titanic/game/enter_sec_class_state.cpp
  A engines/titanic/game/enter_sec_class_state.h
  A engines/titanic/game/exit_lift.cpp
  A engines/titanic/game/exit_lift.h
  A engines/titanic/game/exit_pellerator.cpp
  A engines/titanic/game/exit_pellerator.h
  A engines/titanic/game/fan.cpp
  A engines/titanic/game/fan.h
  A engines/titanic/game/fan_control.cpp
  A engines/titanic/game/fan_control.h
  A engines/titanic/game/fan_decrease.cpp
  A engines/titanic/game/fan_decrease.h
  A engines/titanic/game/fan_increase.cpp
  A engines/titanic/game/fan_increase.h
  A engines/titanic/game/fan_noises.cpp
  A engines/titanic/game/fan_noises.h
  A engines/titanic/game/floor_indicator.cpp
  A engines/titanic/game/floor_indicator.h
  A engines/titanic/game/get_lift_eye2.cpp
  A engines/titanic/game/get_lift_eye2.h
  A engines/titanic/game/glass_smasher.cpp
  A engines/titanic/game/glass_smasher.h
  A engines/titanic/game/gondolier_base.cpp
  A engines/titanic/game/gondolier_base.h
  A engines/titanic/game/hammer_clip.cpp
  A engines/titanic/game/hammer_clip.h
  A engines/titanic/game/head_slot.cpp
  A engines/titanic/game/head_slot.h
  A engines/titanic/game/head_spinner.cpp
  A engines/titanic/game/head_spinner.h
  A engines/titanic/game/idle_summoner.cpp
  A engines/titanic/game/idle_summoner.h
  A engines/titanic/game/leave_sec_class_state.cpp
  A engines/titanic/game/leave_sec_class_state.h
  A engines/titanic/game/long_stick_dispenser.cpp
  A engines/titanic/game/long_stick_dispenser.h
  A engines/titanic/game/mail_man.cpp
  A engines/titanic/game/mail_man.h
  A engines/titanic/game/missiveomat.cpp
  A engines/titanic/game/missiveomat.h
  A engines/titanic/game/movie_tester.cpp
  A engines/titanic/game/movie_tester.h
  A engines/titanic/game/navigation_computer.cpp
  A engines/titanic/game/navigation_computer.h
  A engines/titanic/game/parrot/player_meets_parrot.cpp
  A engines/titanic/game/parrot/player_meets_parrot.h
  A engines/titanic/game/pet/pet.cpp
  A engines/titanic/game/pet/pet.h
  A engines/titanic/game/pet/pet_class1.cpp
  A engines/titanic/game/pet/pet_class1.h
  A engines/titanic/game/pet/pet_class2.cpp
  A engines/titanic/game/pet/pet_class2.h
  A engines/titanic/game/pet/pet_class3.cpp
  A engines/titanic/game/pet/pet_class3.h
  A engines/titanic/game/pet/pet_monitor.cpp
  A engines/titanic/game/pet/pet_monitor.h
  A engines/titanic/game/pet/pet_position.cpp
  A engines/titanic/game/pet/pet_position.h
  A engines/titanic/game/pet/pet_sentinal.cpp
  A engines/titanic/game/pet/pet_sentinal.h
  A engines/titanic/game/pet/pet_sounds.cpp
  A engines/titanic/game/pet/pet_sounds.h
  A engines/titanic/game/pet/pet_transition.cpp
  A engines/titanic/game/pet/pet_transition.h
  A engines/titanic/game/pet/pet_transport.cpp
  A engines/titanic/game/pet/pet_transport.h
  A engines/titanic/game/pet_disabler.cpp
  A engines/titanic/game/pet_disabler.h
  A engines/titanic/game/pet_graphic.cpp
  A engines/titanic/game/pet_graphic.h
  A engines/titanic/game/pet_graphic2.cpp
  A engines/titanic/game/pet_graphic2.h
  A engines/titanic/game/phonograph_lid.cpp
  A engines/titanic/game/phonograph_lid.h
  A engines/titanic/game/place_holder.cpp
  A engines/titanic/game/place_holder.h
  A engines/titanic/game/reserved_table.cpp
  A engines/titanic/game/reserved_table.h
  A engines/titanic/game/search_point.cpp
  A engines/titanic/game/search_point.h
  A engines/titanic/game/sgt/sgt_doors.cpp
  A engines/titanic/game/sgt/sgt_doors.h
  A engines/titanic/game/sgt/sgt_navigation.cpp
  A engines/titanic/game/sgt/sgt_navigation.h
  A engines/titanic/game/sgt/sgt_restaurant_doors.cpp
  A engines/titanic/game/sgt/sgt_restaurant_doors.h
  A engines/titanic/game/sgt/sgt_state_room.cpp
  A engines/titanic/game/sgt/sgt_state_room.h
  A engines/titanic/game/sgt/sgt_upper_doors_sound.cpp
  A engines/titanic/game/sgt/sgt_upper_doors_sound.h
  A engines/titanic/game/ship_setting_button.cpp
  A engines/titanic/game/ship_setting_button.h
  A engines/titanic/game/show_cell_points.cpp
  A engines/titanic/game/show_cell_points.h
  A engines/titanic/game/splash_animation.cpp
  A engines/titanic/game/splash_animation.h
  A engines/titanic/game/star_control.cpp
  A engines/titanic/game/star_control.h
  A engines/titanic/game/starling_puret.cpp
  A engines/titanic/game/starling_puret.h
  A engines/titanic/game/sub_wrapper.cpp
  A engines/titanic/game/sub_wrapper.h
  A engines/titanic/game/throw_tv_down_well.cpp
  A engines/titanic/game/throw_tv_down_well.h
  A engines/titanic/game/titania_still_control.cpp
  A engines/titanic/game/titania_still_control.h
  A engines/titanic/game/tow_parrot_nav.cpp
  A engines/titanic/game/tow_parrot_nav.h
  A engines/titanic/sound/auto_sound_player.cpp
  A engines/titanic/sound/auto_sound_player.h
  A engines/titanic/sound/background_sound_maker.cpp
  A engines/titanic/sound/background_sound_maker.h
  A engines/titanic/sound/music_player.cpp
  A engines/titanic/sound/music_player.h
  A engines/titanic/sound/titania_speech.cpp
  A engines/titanic/sound/titania_speech.h
  A engines/titanic/sound/trigger_auto_music_player.cpp
  A engines/titanic/sound/trigger_auto_music_player.h
  R engines/titanic/game/pet_position.cpp
  R engines/titanic/game/pet_position.h
  R engines/titanic/game/sgt_state_room.cpp
  R engines/titanic/game/sgt_state_room.h
  R engines/titanic/game/sgt_upper_doors_sound.cpp
  R engines/titanic/game/sgt_upper_doors_sound.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/drawer.h
    engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/carry/test_carry.cpp b/engines/titanic/carry/test_carry.cpp
new file mode 100644
index 0000000..26b4f56
--- /dev/null
+++ b/engines/titanic/carry/test_carry.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/test_carry.h"
+
+namespace Titanic {
+
+void CTestArray::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CTestArray::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/test_carry.h b/engines/titanic/carry/test_carry.h
new file mode 100644
index 0000000..b542fb7
--- /dev/null
+++ b/engines/titanic/carry/test_carry.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TEST_CARRY_H
+#define TITANIC_TEST_CARRY_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CTestArray : public CGameObject {
+public:
+	int _value1, _value2;
+public:
+	CTestArray() : CGameObject(), _value1(0), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTestArray"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TEST_CARRY_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 12efdc1..f76340c 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -69,6 +69,7 @@
 #include "titanic/core/view_item.h"
 
 #include "titanic/game/announce.h"
+#include "titanic/game/belbot_get_light.h"
 #include "titanic/game/bowl_unlocker.h"
 #include "titanic/game/cdrom.h"
 #include "titanic/game/cdrom_computer.h"
@@ -90,12 +91,9 @@
 #include "titanic/game/no_nut_bowl.h"
 #include "titanic/game/null_port_hole.h"
 #include "titanic/game/nut_replacer.h"
-#include "titanic/game/pet_position.h"
 #include "titanic/game/port_hole.h"
 #include "titanic/game/room_item.h"
 #include "titanic/game/service_elevator_door.h"
-#include "titanic/game/sgt_state_room.h"
-#include "titanic/game/sgt_upper_doors_sound.h"
 #include "titanic/game/start_action.h"
 #include "titanic/game/sub_glass.h"
 #include "titanic/game/sweet_bowl.h"
@@ -110,6 +108,21 @@
 #include "titanic/game/parrot/parrot_perch_holder.h"
 #include "titanic/game/parrot/parrot_succubus.h"
 #include "titanic/game/parrot/parrot_trigger.h"
+#include "titanic/game/pet/pet.h"
+#include "titanic/game/pet/pet_class1.h"
+#include "titanic/game/pet/pet_class2.h"
+#include "titanic/game/pet/pet_class3.h"
+#include "titanic/game/pet/pet_monitor.h"
+#include "titanic/game/pet/pet_position.h"
+#include "titanic/game/pet/pet_sentinal.h"
+#include "titanic/game/pet/pet_sounds.h"
+#include "titanic/game/pet/pet_transition.h"
+#include "titanic/game/pet/pet_transport.h"
+#include "titanic/game/sgt/sgt_doors.h"
+#include "titanic/game/sgt/sgt_navigation.h"
+#include "titanic/game/sgt/sgt_restaurant_doors.h"
+#include "titanic/game/sgt/sgt_state_room.h"
+#include "titanic/game/sgt/sgt_upper_doors_sound.h"
 
 #include "titanic/gfx/act_button.h"
 #include "titanic/gfx/changes_season_button.h"
@@ -230,6 +243,7 @@ DEFFN(CTreeItem);
 DEFFN(CViewItem);
 
 DEFFN(CAnnounce);
+DEFFN(CBelbotGetLight);
 DEFFN(CBowlUnlocker);
 DEFFN(CCDROM);
 DEFFN(CCDROMComputer);
@@ -250,12 +264,9 @@ DEFFN(CLittleLiftButton);
 DEFFN(CNoNutBowl);
 DEFFN(CNullPortHole);
 DEFFN(CNutReplacer);
-DEFFN(CPETPosition);
 DEFFN(CPortHole);
 DEFFN(CRoomItem);
 DEFFN(CServiceElevatorDoor);
-DEFFN(CSGTStateRoom);
-DEFFN(CSGTUpperDoorsSound);
 DEFFN(CStartAction);
 DEFFN(CSUBGlass);
 DEFFN(CSweetBowl);
@@ -270,6 +281,21 @@ DEFFN(CParrotNutEater);
 DEFFN(CParrotPerchHolder);
 DEFFN(CParrotSuccUBus);
 DEFFN(CParrotTrigger);
+DEFFN(CPET);
+DEFFN(CPETClass1);
+DEFFN(CPETClass2);
+DEFFN(CPETClass3);
+DEFFN(CPETMonitor);
+DEFFN(CPETPosition);
+DEFFN(CPETSentinal);
+DEFFN(CPETSounds);
+DEFFN(CPETTransition);
+DEFFN(CPETTransport);
+DEFFN(CSGTDoors);
+DEFFN(CSGTNavigation);
+DEFFN(CSGTRestaurantDoors);
+DEFFN(CSGTStateRoom);
+DEFFN(CSGTUpperDoorsSound);
 
 DEFFN(CActButton);
 DEFFN(CChangesSeasonButton);
@@ -554,6 +580,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CViewItem);
 
 	ADDFN(CAnnounce);
+	ADDFN(CBelbotGetLight);
 	ADDFN(CBowlUnlocker);
 	ADDFN(CCDROM);
 	ADDFN(CCDROMComputer);
@@ -595,6 +622,21 @@ void CSaveableObject::initClassList() {
 	ADDFN(CParrotPerchHolder);
 	ADDFN(CParrotSuccUBus);
 	ADDFN(CParrotTrigger);
+	ADDFN(CPET);
+	ADDFN(CPETClass1);
+	ADDFN(CPETClass2);
+	ADDFN(CPETClass3);
+	ADDFN(CPETMonitor);
+	ADDFN(CPETPosition);
+	ADDFN(CPETSentinal);
+	ADDFN(CPETSounds);
+	ADDFN(CPETTransition);
+	ADDFN(CPETTransport);
+	ADDFN(CSGTDoors);
+	ADDFN(CSGTNavigation);
+	ADDFN(CSGTRestaurantDoors);
+	ADDFN(CSGTStateRoom);
+	ADDFN(CSGTUpperDoorsSound);
 
 	ADDFN(CActButton);
 	ADDFN(CChangesSeasonButton);
diff --git a/engines/titanic/core/static_image.cpp b/engines/titanic/core/static_image.cpp
new file mode 100644
index 0000000..54a041f
--- /dev/null
+++ b/engines/titanic/core/static_image.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/static_image.h"
+
+namespace Titanic {
+
+void CStaticImage::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CStaticImage::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/static_image.h b/engines/titanic/core/static_image.h
new file mode 100644
index 0000000..ac556f2
--- /dev/null
+++ b/engines/titanic/core/static_image.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STATIC_IMAGE_H
+#define TITANIC_STATIC_IMAGE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CStaticImage : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CStaticImage"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STATIC_IMAGE_H */
diff --git a/engines/titanic/game/annoy_barbot.cpp b/engines/titanic/game/annoy_barbot.cpp
new file mode 100644
index 0000000..c21e828
--- /dev/null
+++ b/engines/titanic/game/annoy_barbot.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/annoy_barbot.h"
+
+namespace Titanic {
+
+void CAnnoyBarbot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CAnnoyBarbot::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/annoy_barbot.h b/engines/titanic/game/annoy_barbot.h
new file mode 100644
index 0000000..18be7c1
--- /dev/null
+++ b/engines/titanic/game/annoy_barbot.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ANNOY_BARBOT_H
+#define TITANIC_ANNOY_BARBOT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CAnnoyBarbot : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAnnoyBarbot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ANNOY_BARBOT_H */
diff --git a/engines/titanic/game/bar_bell.cpp b/engines/titanic/game/bar_bell.cpp
new file mode 100644
index 0000000..71f0e87
--- /dev/null
+++ b/engines/titanic/game/bar_bell.cpp
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/bar_bell.h"
+
+namespace Titanic {
+
+CBarBell::CBarBell() : CGameObject(), _fieldBC(0),
+	_fieldC0(65), _fieldC4(0), _fieldC8(0), _fieldCC(0) {
+}
+
+void CBarBell::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CBarBell::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/bar_bell.h b/engines/titanic/game/bar_bell.h
new file mode 100644
index 0000000..87c244d
--- /dev/null
+++ b/engines/titanic/game/bar_bell.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BAR_BELL_H
+#define TITANIC_BAR_BELL_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CBarBell : public CGameObject {
+public:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	int _fieldCC;
+public:
+	CBarBell();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBarBell"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BAR_BELL_H */
diff --git a/engines/titanic/game/bar_menu.cpp b/engines/titanic/game/bar_menu.cpp
new file mode 100644
index 0000000..53ed48a
--- /dev/null
+++ b/engines/titanic/game/bar_menu.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/bar_menu.h"
+
+namespace Titanic {
+
+CBarMenu::CBarMenu() : CGameObject(), _fieldBC(0), _fieldC0(0), _fieldC4(6) {
+}
+
+void CBarMenu::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CBarMenu::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/bar_menu.h b/engines/titanic/game/bar_menu.h
new file mode 100644
index 0000000..69ba0aa
--- /dev/null
+++ b/engines/titanic/game/bar_menu.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BAR_MENU_H
+#define TITANIC_BAR_MENU_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CBarMenu : public CGameObject {
+public:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+public:
+	CBarMenu();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBarMenu"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BAR_MENU_H */
diff --git a/engines/titanic/game/bar_menu_button.cpp b/engines/titanic/game/bar_menu_button.cpp
new file mode 100644
index 0000000..897c7a8
--- /dev/null
+++ b/engines/titanic/game/bar_menu_button.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/bar_menu_button.h"
+
+namespace Titanic {
+
+void CBarMenuButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CBarMenuButton::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/bar_menu_button.h b/engines/titanic/game/bar_menu_button.h
new file mode 100644
index 0000000..56b618d
--- /dev/null
+++ b/engines/titanic/game/bar_menu_button.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BAR_MENU_BUTTON_H
+#define TITANIC_BAR_MENU_BUTTON_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CBarMenuButton : public CGameObject {
+public:
+	int _value;
+public:
+	CBarMenuButton() : CGameObject(), _value(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBarMenuButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BAR_MENU_BUTTON_H */
diff --git a/engines/titanic/game/belbot_get_light.cpp b/engines/titanic/game/belbot_get_light.cpp
new file mode 100644
index 0000000..4bbafcd
--- /dev/null
+++ b/engines/titanic/game/belbot_get_light.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/belbot_get_light.h"
+
+namespace Titanic {
+
+void CBelbotGetLight::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CBelbotGetLight::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readString();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/belbot_get_light.h b/engines/titanic/game/belbot_get_light.h
new file mode 100644
index 0000000..2c2d547
--- /dev/null
+++ b/engines/titanic/game/belbot_get_light.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BELBOT_GET_LIGHT_H
+#define TITANIC_BELBOT_GET_LIGHT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CBelbotGetLight : public CGameObject {
+private:
+	CString _value;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBelbotGetLight"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LIGHT_H */
diff --git a/engines/titanic/game/bottom_of_well_monitor.cpp b/engines/titanic/game/bottom_of_well_monitor.cpp
new file mode 100644
index 0000000..daca5db
--- /dev/null
+++ b/engines/titanic/game/bottom_of_well_monitor.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/bottom_of_well_monitor.h"
+
+namespace Titanic {
+
+void CBottomOfWellMonitor::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CBottomOfWellMonitor::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/bottom_of_well_monitor.h b/engines/titanic/game/bottom_of_well_monitor.h
new file mode 100644
index 0000000..de07aac
--- /dev/null
+++ b/engines/titanic/game/bottom_of_well_monitor.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BOTTOM_OF_WELL_MONITOR_H
+#define TITANIC_BOTTOM_OF_WELL_MONITOR_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CBottomOfWellMonitor : public CGameObject {
+public:
+	int _value;
+public:
+	CBottomOfWellMonitor() : _value(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBottomOfWellMonitor"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BOTTOM_OF_WELL_MONITOR_H */
diff --git a/engines/titanic/game/brain_slot.cpp b/engines/titanic/game/brain_slot.cpp
new file mode 100644
index 0000000..f8a029e
--- /dev/null
+++ b/engines/titanic/game/brain_slot.cpp
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/brain_slot.h"
+
+namespace Titanic {
+
+int CBrainSlot::_v1;
+int CBrainSlot::_v2;
+
+void CBrainSlot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CBrainSlot::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/brain_slot.h b/engines/titanic/game/brain_slot.h
new file mode 100644
index 0000000..982541f
--- /dev/null
+++ b/engines/titanic/game/brain_slot.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BRAIN_SLOT_H
+#define TITANIC_BRAIN_SLOT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CBrainSlot : public CGameObject {
+public:
+	static int _v1, _v2;
+public:
+	int _value1, _value2;
+public:
+	CBrainSlot() : CGameObject(), _value1(0), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBrainSlot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BRAIN_SLOT_H */
diff --git a/engines/titanic/game/bridge_door.cpp b/engines/titanic/game/bridge_door.cpp
new file mode 100644
index 0000000..b24f7a6
--- /dev/null
+++ b/engines/titanic/game/bridge_door.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/bridge_door.h"
+
+namespace Titanic {
+
+void CBridgeDoor::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CBridgeDoor::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/bridge_door.h b/engines/titanic/game/bridge_door.h
new file mode 100644
index 0000000..96703c1
--- /dev/null
+++ b/engines/titanic/game/bridge_door.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BRIDGE_DOOR_H
+#define TITANIC_BRIDGE_DOOR_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CBridgeDoor : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBridgeDoor"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BRIDGE_DOOR_H */
diff --git a/engines/titanic/game/call_pellerator.cpp b/engines/titanic/game/call_pellerator.cpp
new file mode 100644
index 0000000..85f2ab8
--- /dev/null
+++ b/engines/titanic/game/call_pellerator.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/call_pellerator.h"
+
+namespace Titanic {
+
+void CCallPellerator::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CCallPellerator::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/call_pellerator.h b/engines/titanic/game/call_pellerator.h
new file mode 100644
index 0000000..a6e8ded
--- /dev/null
+++ b/engines/titanic/game/call_pellerator.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CALL_PELLERATOR_H
+#define TITANIC_CALL_PELLERATOR_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CCallPellerator : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCallPellerator"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CALL_PELLERATOR_H */
diff --git a/engines/titanic/game/chev_code.cpp b/engines/titanic/game/chev_code.cpp
new file mode 100644
index 0000000..d2818f6
--- /dev/null
+++ b/engines/titanic/game/chev_code.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/chev_code.h"
+
+namespace Titanic {
+
+void CChevCode::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CChevCode::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/chev_code.h b/engines/titanic/game/chev_code.h
new file mode 100644
index 0000000..6bd6242
--- /dev/null
+++ b/engines/titanic/game/chev_code.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHEV_CODE_H
+#define TITANIC_CHEV_CODE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CChevCode : public CGameObject {
+public:
+	int _value;
+public:
+	CChevCode() : CGameObject(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CChevCode"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CHEV_CODE_H */
diff --git a/engines/titanic/game/chev_panel.cpp b/engines/titanic/game/chev_panel.cpp
new file mode 100644
index 0000000..665b91d
--- /dev/null
+++ b/engines/titanic/game/chev_panel.cpp
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/chev_panel.h"
+
+namespace Titanic {
+
+void CChevPanel::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	
+	CGameObject::save(file, indent);
+}
+
+void CChevPanel::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/chev_panel.h b/engines/titanic/game/chev_panel.h
new file mode 100644
index 0000000..39ad436
--- /dev/null
+++ b/engines/titanic/game/chev_panel.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHEV_PANEL_H
+#define TITANIC_CHEV_PANEL_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CChevPanel : public CGameObject {
+public:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+public:
+	CChevPanel() : _fieldBC(0), _fieldC0(0), _fieldC4(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CChevPanel"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CHEV_PANEL_H */
diff --git a/engines/titanic/game/chicken_cooler.cpp b/engines/titanic/game/chicken_cooler.cpp
new file mode 100644
index 0000000..feb3b4c
--- /dev/null
+++ b/engines/titanic/game/chicken_cooler.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/chicken_cooler.h"
+
+namespace Titanic {
+
+void CChickenCooler::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CChickenCooler::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/chicken_cooler.h b/engines/titanic/game/chicken_cooler.h
new file mode 100644
index 0000000..42e8a27
--- /dev/null
+++ b/engines/titanic/game/chicken_cooler.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHICKEN_COOLER_H
+#define TITANIC_CHICKEN_COOLER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CChickenCooler : public CGameObject {
+public:
+	int _fieldBC;
+	int _fieldC0;
+public:
+	CChickenCooler() : CGameObject(), _fieldBC(0), _fieldC0(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CChickenCooler"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CHICKEN_COOLER_H */
diff --git a/engines/titanic/game/cookie.cpp b/engines/titanic/game/cookie.cpp
new file mode 100644
index 0000000..98621d0
--- /dev/null
+++ b/engines/titanic/game/cookie.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/cookie.h"
+
+namespace Titanic {
+
+void CCookie::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CCookie::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/cookie.h b/engines/titanic/game/cookie.h
new file mode 100644
index 0000000..a1a72c9
--- /dev/null
+++ b/engines/titanic/game/cookie.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_COOKIE_H
+#define TITANIC_COOKIE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CCookie : public CGameObject {
+public:
+	int _value1;
+	int _value2;
+public:
+	CCookie() : CGameObject(), _value1(0), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCookie"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_COOKIE_H */
diff --git a/engines/titanic/game/doorbot_elevator_handler.cpp b/engines/titanic/game/doorbot_elevator_handler.cpp
new file mode 100644
index 0000000..1a85793
--- /dev/null
+++ b/engines/titanic/game/doorbot_elevator_handler.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/doorbot_elevator_handler.h"
+
+namespace Titanic {
+
+void CDoorbotElevatorHandler::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CDoorbotElevatorHandler::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/doorbot_elevator_handler.h b/engines/titanic/game/doorbot_elevator_handler.h
new file mode 100644
index 0000000..041e2c5
--- /dev/null
+++ b/engines/titanic/game/doorbot_elevator_handler.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DOORBOT_ELEVATOR_HANDLER_H
+#define TITANIC_DOORBOT_ELEVATOR_HANDLER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CDoorbotElevatorHandler : public CGameObject {
+public:
+	int _value;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDoorbotElevatorHandler"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DOORBOT_ELEVATOR_HANDLER_H */
diff --git a/engines/titanic/game/drawer.h b/engines/titanic/game/drawer.h
index 020b105..100e27c 100644
--- a/engines/titanic/game/drawer.h
+++ b/engines/titanic/game/drawer.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_DRAWER_H
 #define TITANIC_DRAWER_H
 
-#include "titanic/game/sgt_state_room.h"
+#include "titanic/game/sgt/sgt_state_room.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/game/elevator_action_area.cpp b/engines/titanic/game/elevator_action_area.cpp
new file mode 100644
index 0000000..3beef1b
--- /dev/null
+++ b/engines/titanic/game/elevator_action_area.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/elevator_action_area.h"
+
+namespace Titanic {
+
+void CElevatorActionArea::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CElevatorActionArea::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/elevator_action_area.h b/engines/titanic/game/elevator_action_area.h
new file mode 100644
index 0000000..07c4f13
--- /dev/null
+++ b/engines/titanic/game/elevator_action_area.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ELEVATOR_ACTION_AREA_H
+#define TITANIC_ELEVATOR_ACTION_AREA_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CElevatorActionArea : public CGameObject {
+public:
+	int _value;
+public:
+	CElevatorActionArea() : CGameObject(), _value(4) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CElevatorActionArea"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ELEVATOR_ACTION_AREA_H */
diff --git a/engines/titanic/game/end_credit_text.cpp b/engines/titanic/game/end_credit_text.cpp
new file mode 100644
index 0000000..949c6e2
--- /dev/null
+++ b/engines/titanic/game/end_credit_text.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/end_credit_text.h"
+
+namespace Titanic {
+
+void CEndCreditText::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CEndCreditText::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/end_credit_text.h b/engines/titanic/game/end_credit_text.h
new file mode 100644
index 0000000..258b1a3
--- /dev/null
+++ b/engines/titanic/game/end_credit_text.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_END_CREDIT_TEXT_H
+#define TITANIC_END_CREDIT_TEXT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEndCreditText : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEndCreditText"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_END_CREDIT_TEXT_H */
diff --git a/engines/titanic/game/end_credits.cpp b/engines/titanic/game/end_credits.cpp
new file mode 100644
index 0000000..0f71cfc
--- /dev/null
+++ b/engines/titanic/game/end_credits.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/end_credits.h"
+
+namespace Titanic {
+
+void CEndCredits::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CEndCredits::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/end_credits.h b/engines/titanic/game/end_credits.h
new file mode 100644
index 0000000..cf5c45a
--- /dev/null
+++ b/engines/titanic/game/end_credits.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_END_CREDITS_H
+#define TITANIC_END_CREDITS_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEndCredits : public CGameObject {
+public:
+	int _value;
+public:
+	CEndCredits() : CGameObject(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEndCredits"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_END_CREDITS_H */
diff --git a/engines/titanic/game/end_explode_ship.cpp b/engines/titanic/game/end_explode_ship.cpp
new file mode 100644
index 0000000..e12e03e
--- /dev/null
+++ b/engines/titanic/game/end_explode_ship.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/end_explode_ship.h"
+
+namespace Titanic {
+
+void CEndExplodeShip::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CEndExplodeShip::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/end_explode_ship.h b/engines/titanic/game/end_explode_ship.h
new file mode 100644
index 0000000..df2e0b1
--- /dev/null
+++ b/engines/titanic/game/end_explode_ship.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_END_EXPLODE_SHIP_H
+#define TITANIC_END_EXPLODE_SHIP_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEndExplodeShip : public CGameObject {
+public:
+	int _value1, _value2;
+public:
+	CEndExplodeShip() : CGameObject(), _value1(0), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEndExplodeShip"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_END_EXPLODE_SHIP_H */
diff --git a/engines/titanic/game/end_game_credits.cpp b/engines/titanic/game/end_game_credits.cpp
new file mode 100644
index 0000000..36c0510
--- /dev/null
+++ b/engines/titanic/game/end_game_credits.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/nut_replacer.h"
+
+namespace Titanic {
+
+void CNutReplacer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CNutReplacer::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/end_game_credits.h b/engines/titanic/game/end_game_credits.h
new file mode 100644
index 0000000..c243f9a
--- /dev/null
+++ b/engines/titanic/game/end_game_credits.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_END_GAME_SHIP_H
+#define TITANIC_END_GAME_SHIP_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEndGameShip : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEndGameShip"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_END_GAME_SHIP_H */
diff --git a/engines/titanic/game/end_sequence_control.cpp b/engines/titanic/game/end_sequence_control.cpp
new file mode 100644
index 0000000..1432435
--- /dev/null
+++ b/engines/titanic/game/end_sequence_control.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/end_sequence_control.h"
+
+namespace Titanic {
+
+void CEndSequenceControl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CEndSequenceControl::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/end_sequence_control.h b/engines/titanic/game/end_sequence_control.h
new file mode 100644
index 0000000..dc84929
--- /dev/null
+++ b/engines/titanic/game/end_sequence_control.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_END_SEQUENCE_CONTROL_H
+#define TITANIC_END_SEQUENCE_CONTROL_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEndSequenceControl : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEndSequenceControl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_END_SEQUENCE_CONTROL_H */
diff --git a/engines/titanic/game/enter_bridge.cpp b/engines/titanic/game/enter_bridge.cpp
new file mode 100644
index 0000000..13e4a50
--- /dev/null
+++ b/engines/titanic/game/enter_bridge.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/enter_bridge.h"
+
+namespace Titanic {
+
+void CEnterBridge::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CEnterBridge::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/enter_bridge.h b/engines/titanic/game/enter_bridge.h
new file mode 100644
index 0000000..bbc4cc9
--- /dev/null
+++ b/engines/titanic/game/enter_bridge.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_BRIDGE_H
+#define TITANIC_ENTER_BRIDGE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEnterBridge : public CGameObject {
+public:
+	int _value;
+public:
+	CEnterBridge() : CGameObject(), _value(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEnterBridge"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_BRIDGE_H */
diff --git a/engines/titanic/game/enter_exit_sec_class_mini_lift.cpp b/engines/titanic/game/enter_exit_sec_class_mini_lift.cpp
new file mode 100644
index 0000000..d4162ac
--- /dev/null
+++ b/engines/titanic/game/enter_exit_sec_class_mini_lift.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/enter_exit_sec_class_mini_lift.h"
+
+namespace Titanic {
+
+void CEnterExitSecClassMiniLift::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CEnterExitSecClassMiniLift::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/enter_exit_sec_class_mini_lift.h b/engines/titanic/game/enter_exit_sec_class_mini_lift.h
new file mode 100644
index 0000000..aa3f9b3
--- /dev/null
+++ b/engines/titanic/game/enter_exit_sec_class_mini_lift.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_EXIT_SEC_CLASS_MINI_LIFT_H
+#define TITANIC_ENTER_EXIT_SEC_CLASS_MINI_LIFT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEnterExitSecClassMiniLift : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEnterExitSecClassMiniLift"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_EXIT_SEC_CLASS_MINI_LIFT_H */
diff --git a/engines/titanic/game/enter_exit_view.cpp b/engines/titanic/game/enter_exit_view.cpp
new file mode 100644
index 0000000..e892161
--- /dev/null
+++ b/engines/titanic/game/enter_exit_view.cpp
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/enter_exit_view.h"
+
+namespace Titanic {
+
+CEnterExitView::CEnterExitView() : CGameObject(), _fieldBC(0),
+	_fieldC0(0), _fieldC4(0), _fieldC8(0), _fieldCC(0) {
+}
+
+void CEnterExitView::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CEnterExitView::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/enter_exit_view.h b/engines/titanic/game/enter_exit_view.h
new file mode 100644
index 0000000..05ed63d
--- /dev/null
+++ b/engines/titanic/game/enter_exit_view.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_EXIT_VIEW_H
+#define TITANIC_ENTER_EXIT_VIEW_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEnterExitView : public CGameObject {
+public:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	int _fieldCC;
+public:
+	CEnterExitView();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEnterExitView"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_EXIT_VIEW_H */
diff --git a/engines/titanic/game/enter_sec_class_state.cpp b/engines/titanic/game/enter_sec_class_state.cpp
new file mode 100644
index 0000000..2a18e81
--- /dev/null
+++ b/engines/titanic/game/enter_sec_class_state.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/enter_sec_class_state.h"
+
+namespace Titanic {
+
+void CEnterSecClassState::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CEnterSecClassState::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/enter_sec_class_state.h b/engines/titanic/game/enter_sec_class_state.h
new file mode 100644
index 0000000..5da623d
--- /dev/null
+++ b/engines/titanic/game/enter_sec_class_state.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_SEC_CLASS_STATE_H
+#define TITANIC_ENTER_SEC_CLASS_STATE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEnterSecClassState : public CGameObject {
+public:
+	int _value1, _value2;
+public:
+	CEnterSecClassState() : CGameObject(), _value1(0), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEnterSecClassState"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_SEC_CLASS_STATE_H */
diff --git a/engines/titanic/game/exit_lift.cpp b/engines/titanic/game/exit_lift.cpp
new file mode 100644
index 0000000..82e4411
--- /dev/null
+++ b/engines/titanic/game/exit_lift.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/exit_lift.h"
+
+namespace Titanic {
+
+void CExitLift::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CExitLift::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/exit_lift.h b/engines/titanic/game/exit_lift.h
new file mode 100644
index 0000000..9531fd6
--- /dev/null
+++ b/engines/titanic/game/exit_lift.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXIT_LIFT_H
+#define TITANIC_EXIT_LIFT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CExitLift : public CGameObject {
+public:
+	int _value1, _value2;
+public:
+	CExitLift() : CGameObject(), _value1(0), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CExitLift"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EXIT_LIFT_H */
diff --git a/engines/titanic/game/exit_pellerator.cpp b/engines/titanic/game/exit_pellerator.cpp
new file mode 100644
index 0000000..79754f8
--- /dev/null
+++ b/engines/titanic/game/exit_pellerator.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/exit_pellerator.h"
+
+namespace Titanic {
+
+void CExitPellerator::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CExitPellerator::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/exit_pellerator.h b/engines/titanic/game/exit_pellerator.h
new file mode 100644
index 0000000..6185f61
--- /dev/null
+++ b/engines/titanic/game/exit_pellerator.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXIT_PELLERATOR_H
+#define TITANIC_EXIT_PELLERATOR_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CExitPellerator : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CExitPellerator"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EXIT_PELLERATOR_H */
diff --git a/engines/titanic/game/fan.cpp b/engines/titanic/game/fan.cpp
new file mode 100644
index 0000000..4715aa7
--- /dev/null
+++ b/engines/titanic/game/fan.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/fan.h"
+
+namespace Titanic {
+
+void CFan::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CFan::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/fan.h b/engines/titanic/game/fan.h
new file mode 100644
index 0000000..75bdea5
--- /dev/null
+++ b/engines/titanic/game/fan.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FAN_H
+#define TITANIC_FAN_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CFan : public CGameObject {
+public:
+	int _value1, _value2;
+public:
+	CFan() : CGameObject(), _value1(0), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CFan"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FAN_H */
diff --git a/engines/titanic/game/fan_control.cpp b/engines/titanic/game/fan_control.cpp
new file mode 100644
index 0000000..44e36b2
--- /dev/null
+++ b/engines/titanic/game/fan_control.cpp
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/fan_control.h"
+
+namespace Titanic {
+
+CFanControl::CFanControl() : CGameObject(), _fieldBC(0),
+	_fieldC0(0), _fieldC4(0), _fieldC8(0), _fieldCC(0) {
+}
+
+void CFanControl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CFanControl::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/fan_control.h b/engines/titanic/game/fan_control.h
new file mode 100644
index 0000000..dfb1ccc
--- /dev/null
+++ b/engines/titanic/game/fan_control.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FAN_CONTROL_H
+#define TITANIC_FAN_CONTROL_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CFanControl : public CGameObject {
+public:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	int _fieldCC;
+public:
+	CFanControl();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CFanControl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FAN_CONTROL_H */
diff --git a/engines/titanic/game/fan_decrease.cpp b/engines/titanic/game/fan_decrease.cpp
new file mode 100644
index 0000000..41e227e
--- /dev/null
+++ b/engines/titanic/game/fan_decrease.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/fan_decrease.h"
+
+namespace Titanic {
+
+void CFanDecrease::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CFanDecrease::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/fan_decrease.h b/engines/titanic/game/fan_decrease.h
new file mode 100644
index 0000000..9831873
--- /dev/null
+++ b/engines/titanic/game/fan_decrease.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FAN_DECREASE_H
+#define TITANIC_FAN_DECREASE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CFanDecrease : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CFanDecrease"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FAN_DECREASE_H */
diff --git a/engines/titanic/game/fan_increase.cpp b/engines/titanic/game/fan_increase.cpp
new file mode 100644
index 0000000..06fcf47
--- /dev/null
+++ b/engines/titanic/game/fan_increase.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/fan_increase.h"
+
+namespace Titanic {
+
+void CFanIncrease::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CFanIncrease::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/fan_increase.h b/engines/titanic/game/fan_increase.h
new file mode 100644
index 0000000..1b9a0fd
--- /dev/null
+++ b/engines/titanic/game/fan_increase.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FAN_INCREASE_H
+#define TITANIC_FAN_INCREASE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CFanIncrease : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CFanIncrease"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FAN_INCREASE_H */
diff --git a/engines/titanic/game/fan_noises.cpp b/engines/titanic/game/fan_noises.cpp
new file mode 100644
index 0000000..ed77dc6
--- /dev/null
+++ b/engines/titanic/game/fan_noises.cpp
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/fan_noises.h"
+
+namespace Titanic {
+
+CFanNoises::CFanNoises() : CGameObject(), _fieldBC(-1),
+	_fieldC0(0), _fieldC4(70), _fieldC8(-1), _fieldCC(0),
+	_fieldD0(0), _fieldD4(-1) {
+}
+
+void CFanNoises::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeNumberLine(_fieldD0, indent);
+	file->writeNumberLine(_fieldD4, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CFanNoises::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+	_fieldD0 = file->readNumber();
+	_fieldD4 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/fan_noises.h b/engines/titanic/game/fan_noises.h
new file mode 100644
index 0000000..5e817a3
--- /dev/null
+++ b/engines/titanic/game/fan_noises.h
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FAN_NOISES_H
+#define TITANIC_FAN_NOISES_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CFanNoises : public CGameObject {
+public:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	int _fieldCC;
+	int _fieldD0;
+	int _fieldD4;
+public:
+	CFanNoises();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CFanNoises"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FAN_NOISES_H */
diff --git a/engines/titanic/game/floor_indicator.cpp b/engines/titanic/game/floor_indicator.cpp
new file mode 100644
index 0000000..b17bd4b
--- /dev/null
+++ b/engines/titanic/game/floor_indicator.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/floor_indicator.h"
+
+namespace Titanic {
+
+void CFloorIndicator::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CFloorIndicator::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/floor_indicator.h b/engines/titanic/game/floor_indicator.h
new file mode 100644
index 0000000..86a7125
--- /dev/null
+++ b/engines/titanic/game/floor_indicator.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FLOOR_INDICATOR_H
+#define TITANIC_FLOOR_INDICATOR_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CFloorIndicator : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CFloorIndicator"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FLOOR_INDICATOR_H */
diff --git a/engines/titanic/game/get_lift_eye2.cpp b/engines/titanic/game/get_lift_eye2.cpp
new file mode 100644
index 0000000..67a7b43
--- /dev/null
+++ b/engines/titanic/game/get_lift_eye2.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/get_lift_eye2.h"
+
+namespace Titanic {
+
+void CGetLiftEye2::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CGetLiftEye2::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
new file mode 100644
index 0000000..baca120
--- /dev/null
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GET_LIFT_EYE2_H
+#define TITANIC_GET_LIFT_EYE2_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CGetLiftEye2 : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGetLiftEye2"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GET_LIFT_EYE2_H */
diff --git a/engines/titanic/game/glass_smasher.cpp b/engines/titanic/game/glass_smasher.cpp
new file mode 100644
index 0000000..80b665d
--- /dev/null
+++ b/engines/titanic/game/glass_smasher.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/glass_smasher.h"
+
+namespace Titanic {
+
+void CGlassSmasher::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CGlassSmasher::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/glass_smasher.h b/engines/titanic/game/glass_smasher.h
new file mode 100644
index 0000000..c2b7ee6
--- /dev/null
+++ b/engines/titanic/game/glass_smasher.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GLASS_SMASHER_H
+#define TITANIC_GLASS_SMASHER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CGlassSmasher : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGlassSmasher"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GLASS_SMASHER_H */
diff --git a/engines/titanic/game/gondolier_base.cpp b/engines/titanic/game/gondolier_base.cpp
new file mode 100644
index 0000000..32f434e
--- /dev/null
+++ b/engines/titanic/game/gondolier_base.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/gondolier_base.h"
+
+namespace Titanic {
+
+void CGondolierBase::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CGondolierBase::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/gondolier_base.h b/engines/titanic/game/gondolier_base.h
new file mode 100644
index 0000000..99e0c995
--- /dev/null
+++ b/engines/titanic/game/gondolier_base.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GONDOLIER_BASE_H
+#define TITANIC_GONDOLIER_BASE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CGondolierBase : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGondolierBase"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GONDOLIER_BASE_H */
diff --git a/engines/titanic/game/hammer_clip.cpp b/engines/titanic/game/hammer_clip.cpp
new file mode 100644
index 0000000..60955a2
--- /dev/null
+++ b/engines/titanic/game/hammer_clip.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/hammer_clip.h"
+
+namespace Titanic {
+
+void CHammerClip::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CHammerClip::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/hammer_clip.h b/engines/titanic/game/hammer_clip.h
new file mode 100644
index 0000000..70abae5
--- /dev/null
+++ b/engines/titanic/game/hammer_clip.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_HAMMER_CLIP_H
+#define TITANIC_HAMMER_CLIP_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CHammerClip : public CGameObject {
+public:
+	int _value;
+public:
+	CHammerClip() : CGameObject(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CHammerClip"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HAMMER_CLIP_H */
diff --git a/engines/titanic/game/head_slot.cpp b/engines/titanic/game/head_slot.cpp
new file mode 100644
index 0000000..c037238
--- /dev/null
+++ b/engines/titanic/game/head_slot.cpp
@@ -0,0 +1,64 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/head_slot.h"
+
+namespace Titanic {
+
+CHeadSlot::CHeadSlot() : CGameObject(), _string1("NotWorking"), _string2("NULL"),
+	_fieldBC(0), _fieldD8(0), _fieldDC(27), _fieldE0(56),
+	_fieldE4(82), _fieldE8(112), _fieldEC(0) {
+}
+
+void CHeadSlot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldD8, indent);
+	file->writeNumberLine(_fieldDC, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_fieldEC, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CHeadSlot::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_fieldD8 = file->readNumber();
+	_fieldDC = file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_v1 = file->readNumber();
+	_fieldEC = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/head_slot.h b/engines/titanic/game/head_slot.h
new file mode 100644
index 0000000..210546a
--- /dev/null
+++ b/engines/titanic/game/head_slot.h
@@ -0,0 +1,64 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_HEAD_SLOT_H
+#define TITANIC_HEAD_SLOT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CHeadSlot : public CGameObject {
+public:
+	static int _v1;
+public:
+	int _fieldBC;
+	CString _string1;
+	CString _string2;
+	int _fieldD8;
+	int _fieldDC;
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+public:
+	CHeadSlot();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CHeadSlot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HEAD_SLOT_H */
diff --git a/engines/titanic/game/head_spinner.cpp b/engines/titanic/game/head_spinner.cpp
new file mode 100644
index 0000000..a01f4ea
--- /dev/null
+++ b/engines/titanic/game/head_spinner.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/head_spinner.h"
+
+namespace Titanic {
+
+void CHeadSpinner::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CHeadSpinner::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/head_spinner.h b/engines/titanic/game/head_spinner.h
new file mode 100644
index 0000000..8d3de61
--- /dev/null
+++ b/engines/titanic/game/head_spinner.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_HEAD_SPINNER_H
+#define TITANIC_HEAD_SPINNER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CHeadSpinner : public CGameObject {
+public:
+	int _value1, _value2;
+public:
+	CHeadSpinner() : CGameObject(), _value1(0), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CHeadSpinner"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HEAD_SPINNER_H */
diff --git a/engines/titanic/game/idle_summoner.cpp b/engines/titanic/game/idle_summoner.cpp
new file mode 100644
index 0000000..3932726
--- /dev/null
+++ b/engines/titanic/game/idle_summoner.cpp
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/idle_summoner.h"
+
+namespace Titanic {
+
+CIdleSummoner::CIdleSummoner() : CGameObject(), _fieldBC(0x57E40),
+	_fieldC0(0xEA60), _fieldC4(0x57E40), _fieldC8(0xEA60),
+	_fieldCC(0xEA60), _fieldD0(0xEA60), _fieldD4(0xEA60),
+	_fieldD8(0xEA60), _fieldDC(0xEA60) {
+}
+
+void CIdleSummoner::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeNumberLine(_fieldD0, indent);
+	file->writeNumberLine(_fieldD4, indent);
+	file->writeNumberLine(_fieldD8, indent);
+	file->writeNumberLine(_fieldDC, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CIdleSummoner::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+	_fieldD0 = file->readNumber();
+	_fieldD4 = file->readNumber();
+	_fieldD8 = file->readNumber();
+	_fieldDC = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/idle_summoner.h b/engines/titanic/game/idle_summoner.h
new file mode 100644
index 0000000..8f251b8
--- /dev/null
+++ b/engines/titanic/game/idle_summoner.h
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_IDLE_SUMMONER_H
+#define TITANIC_IDLE_SUMMONER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CIdleSummoner : public CGameObject {
+public:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	int _fieldCC;
+	int _fieldD0;
+	int _fieldD4;
+	int _fieldD8;
+	int _fieldDC;
+public:
+	CIdleSummoner();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CIdleSummoner"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_IDLE_SUMMONER_H */
diff --git a/engines/titanic/game/leave_sec_class_state.cpp b/engines/titanic/game/leave_sec_class_state.cpp
new file mode 100644
index 0000000..cbeb872
--- /dev/null
+++ b/engines/titanic/game/leave_sec_class_state.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/leave_sec_class_state.h"
+
+namespace Titanic {
+
+void CLeaveSecClassState::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CLeaveSecClassState::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/leave_sec_class_state.h b/engines/titanic/game/leave_sec_class_state.h
new file mode 100644
index 0000000..3bcfe81
--- /dev/null
+++ b/engines/titanic/game/leave_sec_class_state.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LEAVE_SEC_CLASS_STATE_H
+#define TITANIC_LEAVE_SEC_CLASS_STATE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CLeaveSecClassState : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLeaveSecClassState"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LEAVE_SEC_CLASS_STATE_H */
diff --git a/engines/titanic/game/long_stick_dispenser.cpp b/engines/titanic/game/long_stick_dispenser.cpp
new file mode 100644
index 0000000..bdd6240
--- /dev/null
+++ b/engines/titanic/game/long_stick_dispenser.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/long_stick_dispenser.h"
+
+namespace Titanic {
+
+void CLongStickDispenser::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CLongStickDispenser::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/long_stick_dispenser.h b/engines/titanic/game/long_stick_dispenser.h
new file mode 100644
index 0000000..2e28420
--- /dev/null
+++ b/engines/titanic/game/long_stick_dispenser.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LONG_STICK_DISPENSER_H
+#define TITANIC_LONG_STICK_DISPENSER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CLongStickDispenser : public CGameObject {
+public:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+public:
+	CLongStickDispenser() : CGameObject(), _fieldBC(0),
+		_fieldC0(0), _fieldC4(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLongStickDispenser"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LONG_STICK_DISPENSER_H */
diff --git a/engines/titanic/game/mail_man.cpp b/engines/titanic/game/mail_man.cpp
new file mode 100644
index 0000000..9096fc5
--- /dev/null
+++ b/engines/titanic/game/mail_man.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/mail_man.h"
+
+namespace Titanic {
+
+void CMailMan::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CMailMan::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/mail_man.h b/engines/titanic/game/mail_man.h
new file mode 100644
index 0000000..29ca165
--- /dev/null
+++ b/engines/titanic/game/mail_man.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MAIL_MAN_H
+#define TITANIC_MAIL_MAN_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CMailMan : public CGameObject {
+public:
+	int _value;
+public:
+	CMailMan() : CGameObject(), _value(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMailMan"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MAIL_MAN_H */
diff --git a/engines/titanic/game/missiveomat.cpp b/engines/titanic/game/missiveomat.cpp
new file mode 100644
index 0000000..fbe430f
--- /dev/null
+++ b/engines/titanic/game/missiveomat.cpp
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/missiveomat.h"
+
+namespace Titanic {
+
+CMissiveOMat::CMissiveOMat() : CGameObject(), _fieldBC(1),
+	_fieldC0(0), _fieldC4(0), _fieldE0(-1) {
+}
+
+void CMissiveOMat::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldE0, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CMissiveOMat::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_fieldE0 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/missiveomat.h b/engines/titanic/game/missiveomat.h
new file mode 100644
index 0000000..77ba4cb
--- /dev/null
+++ b/engines/titanic/game/missiveomat.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MISSIVEOMAT_H
+#define TITANIC_MISSIVEOMAT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CMissiveOMat : public CGameObject {
+public:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	CString _string1;
+	CString _string2;
+	int _fieldE0;
+public:
+	CMissiveOMat();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMissiveOMat"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MISSIVEOMAT_H */
diff --git a/engines/titanic/game/movie_tester.cpp b/engines/titanic/game/movie_tester.cpp
new file mode 100644
index 0000000..0a4f4a9
--- /dev/null
+++ b/engines/titanic/game/movie_tester.cpp
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/movie_tester.h"
+
+namespace Titanic {
+
+void CMovieTester::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+	CGameObject::save(file, indent);
+}
+
+void CMovieTester::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/movie_tester.h b/engines/titanic/game/movie_tester.h
new file mode 100644
index 0000000..b5e4032
--- /dev/null
+++ b/engines/titanic/game/movie_tester.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVIE_TESTER_H
+#define TITANIC_MOVIE_TESTER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CMovieTester : public CGameObject {
+public:
+	int _value1, _value2;
+public:
+	CMovieTester() : CGameObject(), _value1(0), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMovieTester"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVIE_TESTER_H */
diff --git a/engines/titanic/game/navigation_computer.cpp b/engines/titanic/game/navigation_computer.cpp
new file mode 100644
index 0000000..be2f189
--- /dev/null
+++ b/engines/titanic/game/navigation_computer.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/navigation_computer.h"
+
+namespace Titanic {
+
+void CNavigationComputer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CNavigationComputer::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/navigation_computer.h b/engines/titanic/game/navigation_computer.h
new file mode 100644
index 0000000..49e382a
--- /dev/null
+++ b/engines/titanic/game/navigation_computer.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NAVIGATION_COMPUTER_H
+#define TITANIC_NAVIGATION_COMPUTER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CNavigationComputer : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNavigationComputer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NAVIGATION_COMPUTER_H */
diff --git a/engines/titanic/game/parrot/parrot_lobby_link_updater.cpp b/engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
index 912495d..e62e9dd 100644
--- a/engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
+++ b/engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
@@ -26,12 +26,12 @@ namespace Titanic {
 
 void CParrotLobbyLinkUpdater::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
+	CParrotLobbyObject::save(file, indent);
 }
 
 void CParrotLobbyLinkUpdater::load(SimpleFile *file) {
 	file->readNumber();
-	CGameObject::load(file);
+	CParrotLobbyObject::load(file);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/parrot/player_meets_parrot.cpp b/engines/titanic/game/parrot/player_meets_parrot.cpp
new file mode 100644
index 0000000..1d7bd65
--- /dev/null
+++ b/engines/titanic/game/parrot/player_meets_parrot.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/parrot/player_meets_parrot.h"
+
+namespace Titanic {
+
+void CPlayerMeetsParrot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPlayerMeetsParrot::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/parrot/player_meets_parrot.h b/engines/titanic/game/parrot/player_meets_parrot.h
new file mode 100644
index 0000000..685e67a
--- /dev/null
+++ b/engines/titanic/game/parrot/player_meets_parrot.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PLAYER_MEETS_PARROT_H
+#define TITANIC_PLAYER_MEETS_PARROT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPlayerMeetsParrot : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPlayerMeetsParrot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PLAYER_MEETS_PARROT_H */
diff --git a/engines/titanic/game/pet/pet.cpp b/engines/titanic/game/pet/pet.cpp
new file mode 100644
index 0000000..3e65755
--- /dev/null
+++ b/engines/titanic/game/pet/pet.cpp
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet.h"
+
+namespace Titanic {
+
+CPET::CPET() : CGameObject(), _fieldBC(0), _fieldC0(3),
+	_fieldC4(0), _fieldC8(0), _fieldD8(0), _fieldDC(0) {
+}
+
+void CPET::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldD8, indent);
+	file->writeNumberLine(_fieldDC, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CPET::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_string1 = file->readString();
+	_fieldD8 = file->readNumber();
+	_fieldDC = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet.h b/engines/titanic/game/pet/pet.h
new file mode 100644
index 0000000..096c1de
--- /dev/null
+++ b/engines/titanic/game/pet/pet.h
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_H
+#define TITANIC_PET_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPET : public CGameObject {
+public:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	CString _string1;
+	int _fieldD8;
+	int _fieldDC;
+public:
+	CPET();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPET"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_H */
diff --git a/engines/titanic/game/pet/pet_class1.cpp b/engines/titanic/game/pet/pet_class1.cpp
new file mode 100644
index 0000000..4bd2556
--- /dev/null
+++ b/engines/titanic/game/pet/pet_class1.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_class1.h"
+
+namespace Titanic {
+
+void CPETClass1::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPETClass1::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_class1.h b/engines/titanic/game/pet/pet_class1.h
new file mode 100644
index 0000000..c390a87
--- /dev/null
+++ b/engines/titanic/game/pet/pet_class1.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CLASS1_H
+#define TITANIC_PET_CLASS1_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPETClass1 : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPETClass1"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CLASS1_H */
diff --git a/engines/titanic/game/pet/pet_class2.cpp b/engines/titanic/game/pet/pet_class2.cpp
new file mode 100644
index 0000000..8399468
--- /dev/null
+++ b/engines/titanic/game/pet/pet_class2.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_class2.h"
+
+namespace Titanic {
+
+void CPETClass2::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPETClass2::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_class2.h b/engines/titanic/game/pet/pet_class2.h
new file mode 100644
index 0000000..cfa445e
--- /dev/null
+++ b/engines/titanic/game/pet/pet_class2.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CLASS2_H
+#define TITANIC_PET_CLASS2_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPETClass2 : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPETClass2"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CLASS2_H */
diff --git a/engines/titanic/game/pet/pet_class3.cpp b/engines/titanic/game/pet/pet_class3.cpp
new file mode 100644
index 0000000..96ce6646
--- /dev/null
+++ b/engines/titanic/game/pet/pet_class3.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_class3.h"
+
+namespace Titanic {
+
+void CPETClass3::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPETClass3::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_class3.h b/engines/titanic/game/pet/pet_class3.h
new file mode 100644
index 0000000..a41a4d5
--- /dev/null
+++ b/engines/titanic/game/pet/pet_class3.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CLASS3_H
+#define TITANIC_PET_CLASS3_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPETClass3 : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPETClass3"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CLASS3_H */
diff --git a/engines/titanic/game/pet/pet_monitor.cpp b/engines/titanic/game/pet/pet_monitor.cpp
new file mode 100644
index 0000000..534fb3f
--- /dev/null
+++ b/engines/titanic/game/pet/pet_monitor.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_monitor.h"
+
+namespace Titanic {
+
+void CPETMonitor::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPETMonitor::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_monitor.h b/engines/titanic/game/pet/pet_monitor.h
new file mode 100644
index 0000000..544bbde
--- /dev/null
+++ b/engines/titanic/game/pet/pet_monitor.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_MONITOR_H
+#define TITANIC_PET_MONITOR_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPETMonitor : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPETMonitor"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_MONITOR_H */
diff --git a/engines/titanic/game/pet/pet_position.cpp b/engines/titanic/game/pet/pet_position.cpp
new file mode 100644
index 0000000..80ccec7
--- /dev/null
+++ b/engines/titanic/game/pet/pet_position.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_position.h"
+
+namespace Titanic {
+
+void CPETPosition::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPETPosition::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_position.h b/engines/titanic/game/pet/pet_position.h
new file mode 100644
index 0000000..6454b1e
--- /dev/null
+++ b/engines/titanic/game/pet/pet_position.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_POSITION_H
+#define TITANIC_PET_POSITION_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPETPosition : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPETPosition"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_POSITION_H */
diff --git a/engines/titanic/game/pet/pet_sentinal.cpp b/engines/titanic/game/pet/pet_sentinal.cpp
new file mode 100644
index 0000000..4ced872
--- /dev/null
+++ b/engines/titanic/game/pet/pet_sentinal.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_sentinal.h"
+
+namespace Titanic {
+
+void CPETSentinal::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPETSentinal::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_sentinal.h b/engines/titanic/game/pet/pet_sentinal.h
new file mode 100644
index 0000000..98f05df
--- /dev/null
+++ b/engines/titanic/game/pet/pet_sentinal.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_SENTINAL_H
+#define TITANIC_PET_SENTINAL_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPETSentinal : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPETSentinal"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_SENTINAL_H */
diff --git a/engines/titanic/game/pet/pet_sounds.cpp b/engines/titanic/game/pet/pet_sounds.cpp
new file mode 100644
index 0000000..abf6ba3
--- /dev/null
+++ b/engines/titanic/game/pet/pet_sounds.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_sounds.h"
+
+namespace Titanic {
+
+void CPETSounds::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPETSounds::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_sounds.h b/engines/titanic/game/pet/pet_sounds.h
new file mode 100644
index 0000000..cae45ac
--- /dev/null
+++ b/engines/titanic/game/pet/pet_sounds.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_SOUNDS_H
+#define TITANIC_PET_SOUNDS_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPETSounds : public CGameObject {
+public:
+	int _value;
+public:
+	CPETSounds() : CGameObject(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPETSounds"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_SOUNDS_H */
diff --git a/engines/titanic/game/pet/pet_transition.cpp b/engines/titanic/game/pet/pet_transition.cpp
new file mode 100644
index 0000000..fed2d2c
--- /dev/null
+++ b/engines/titanic/game/pet/pet_transition.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_transition.h"
+
+namespace Titanic {
+
+void CPETTransition::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPETTransition::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_transition.h b/engines/titanic/game/pet/pet_transition.h
new file mode 100644
index 0000000..3ccb45f
--- /dev/null
+++ b/engines/titanic/game/pet/pet_transition.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_TRANSITION_H
+#define TITANIC_PET_TRANSITION_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPETTransition : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPETTransition"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_TRANSITION_H */
diff --git a/engines/titanic/game/pet/pet_transport.cpp b/engines/titanic/game/pet/pet_transport.cpp
new file mode 100644
index 0000000..037e0b3
--- /dev/null
+++ b/engines/titanic/game/pet/pet_transport.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_transport.h"
+
+namespace Titanic {
+
+void CPETTransport::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPETTransport::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_transport.h b/engines/titanic/game/pet/pet_transport.h
new file mode 100644
index 0000000..af821ef
--- /dev/null
+++ b/engines/titanic/game/pet/pet_transport.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_TRANSPORT_H
+#define TITANIC_PET_TRANSPORT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPETTransport : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPETTransport"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_TRANSPORT_H */
diff --git a/engines/titanic/game/pet_disabler.cpp b/engines/titanic/game/pet_disabler.cpp
new file mode 100644
index 0000000..94a4964
--- /dev/null
+++ b/engines/titanic/game/pet_disabler.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet_disabler.h"
+
+namespace Titanic {
+
+void CPetDisabler::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPetDisabler::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readString();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet_disabler.h b/engines/titanic/game/pet_disabler.h
new file mode 100644
index 0000000..3e8c799
--- /dev/null
+++ b/engines/titanic/game/pet_disabler.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_DISABLER_H
+#define TITANIC_PET_DISABLER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPetDisabler : public CGameObject {
+public:
+	CString _value;
+public:
+	CPetDisabler() : CGameObject() {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPetDisabler"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_DISABLER_H */
diff --git a/engines/titanic/game/pet_graphic.cpp b/engines/titanic/game/pet_graphic.cpp
new file mode 100644
index 0000000..38226c9
--- /dev/null
+++ b/engines/titanic/game/pet_graphic.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet_graphic.h"
+
+namespace Titanic {
+
+void CPetGraphic::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPetGraphic::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet_graphic.h b/engines/titanic/game/pet_graphic.h
new file mode 100644
index 0000000..28b5d9a
--- /dev/null
+++ b/engines/titanic/game/pet_graphic.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_GRAPHIC_H
+#define TITANIC_PET_GRAPHIC_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPetGraphic : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPetGraphic"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_GRAPHIC_H */
diff --git a/engines/titanic/game/pet_graphic2.cpp b/engines/titanic/game/pet_graphic2.cpp
new file mode 100644
index 0000000..a8d244e
--- /dev/null
+++ b/engines/titanic/game/pet_graphic2.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet_graphic2.h"
+
+namespace Titanic {
+
+void CPetGraphic2::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPetGraphic2::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet_graphic2.h b/engines/titanic/game/pet_graphic2.h
new file mode 100644
index 0000000..aabf058
--- /dev/null
+++ b/engines/titanic/game/pet_graphic2.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_GRAPHIC2_H
+#define TITANIC_PET_GRAPHIC2_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPetGraphic2 : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNutReplacer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_GRAPHIC2_H */
diff --git a/engines/titanic/game/pet_position.cpp b/engines/titanic/game/pet_position.cpp
deleted file mode 100644
index eb3156d..0000000
--- a/engines/titanic/game/pet_position.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet_position.h"
-
-namespace Titanic {
-
-void CPETPosition::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
-}
-
-void CPETPosition::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet_position.h b/engines/titanic/game/pet_position.h
deleted file mode 100644
index 7ca6725..0000000
--- a/engines/titanic/game/pet_position.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_POSITION_H
-#define TITANIC_PET_POSITION_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CPETPosition : public CGameObject {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPETPosition"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ROOM_ITEM_H */
diff --git a/engines/titanic/game/phonograph_lid.cpp b/engines/titanic/game/phonograph_lid.cpp
new file mode 100644
index 0000000..c7c1bd3
--- /dev/null
+++ b/engines/titanic/game/phonograph_lid.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/phonograph_lid.h"
+
+namespace Titanic {
+
+void CPhonographLid::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPhonographLid::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/phonograph_lid.h b/engines/titanic/game/phonograph_lid.h
new file mode 100644
index 0000000..040fec4
--- /dev/null
+++ b/engines/titanic/game/phonograph_lid.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PHONOGRAPH_LID_H
+#define TITANIC_PHONOGRAPH_LID_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPhonographLid : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPhonographLid"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PHONOGRAPH_LID_H */
diff --git a/engines/titanic/game/place_holder.cpp b/engines/titanic/game/place_holder.cpp
new file mode 100644
index 0000000..f030880
--- /dev/null
+++ b/engines/titanic/game/place_holder.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/place_holder.h"
+
+namespace Titanic {
+
+void CPlaceHolder::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPlaceHolder::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/place_holder.h b/engines/titanic/game/place_holder.h
new file mode 100644
index 0000000..dd1c89d
--- /dev/null
+++ b/engines/titanic/game/place_holder.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PLACE_HOLDER_H
+#define TITANIC_PLACE_HOLDER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPlaceHolder : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPlaceHolder"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PLACE_HOLDER_H */
diff --git a/engines/titanic/game/reserved_table.cpp b/engines/titanic/game/reserved_table.cpp
new file mode 100644
index 0000000..222712a
--- /dev/null
+++ b/engines/titanic/game/reserved_table.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/reserved_table.h"
+
+namespace Titanic {
+
+void CReservedTable::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CReservedTable::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/reserved_table.h b/engines/titanic/game/reserved_table.h
new file mode 100644
index 0000000..abf3a65
--- /dev/null
+++ b/engines/titanic/game/reserved_table.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RESERVED_TABLE_H
+#define TITANIC_RESERVED_TABLE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CReservedTable : public CGameObject {
+public:
+	int _value1, _value2;
+public:
+	CReservedTable() : CGameObject(), _value1(0), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CReservedTable"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RESERVED_TABLE_H */
diff --git a/engines/titanic/game/search_point.cpp b/engines/titanic/game/search_point.cpp
new file mode 100644
index 0000000..c235e47
--- /dev/null
+++ b/engines/titanic/game/search_point.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/search_point.h"
+
+namespace Titanic {
+
+void CSearchPoint::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CSearchPoint::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/search_point.h b/engines/titanic/game/search_point.h
new file mode 100644
index 0000000..3908d87
--- /dev/null
+++ b/engines/titanic/game/search_point.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SEARCH_POINT_H
+#define TITANIC_SEARCH_POINT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CSearchPoint : public CGameObject {
+public:
+	int _value;
+public:
+	CSearchPoint() : CGameObject(), _value(2) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSearchPoint"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SEARCH_POINT_H */
diff --git a/engines/titanic/game/sgt/sgt_doors.cpp b/engines/titanic/game/sgt/sgt_doors.cpp
new file mode 100644
index 0000000..587a961
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_doors.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/sgt_doors.h"
+
+namespace Titanic {
+
+void CSGTDoors::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CSGTDoors::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/sgt_doors.h b/engines/titanic/game/sgt/sgt_doors.h
new file mode 100644
index 0000000..9464049
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_doors.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SGT_DOORS_H
+#define TITANIC_SGT_DOORS_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CSGTDoors : public CGameObject {
+public:
+	int _value1, _value2;
+public:
+	CSGTDoors() : CGameObject(), _value1(0), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSGTDoors"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SGT_DOORS_H */
diff --git a/engines/titanic/game/sgt/sgt_navigation.cpp b/engines/titanic/game/sgt/sgt_navigation.cpp
new file mode 100644
index 0000000..eba37fd
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_navigation.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/sgt_navigation.h"
+
+namespace Titanic {
+
+void CSGTNavigation::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CSGTNavigation::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/sgt_navigation.h b/engines/titanic/game/sgt/sgt_navigation.h
new file mode 100644
index 0000000..15c903f
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_navigation.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SGT_NAVIGATION_H
+#define TITANIC_SGT_NAVIGATION_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CSGTNavigation : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSGTNavigation"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SGT_NAVIGATION_H */
diff --git a/engines/titanic/game/sgt/sgt_restaurant_doors.cpp b/engines/titanic/game/sgt/sgt_restaurant_doors.cpp
new file mode 100644
index 0000000..e7d8f7b
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_restaurant_doors.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/sgt_restaurant_doors.h"
+
+namespace Titanic {
+
+void CSGTRestaurantDoors::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CSGTRestaurantDoors::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/sgt_restaurant_doors.h b/engines/titanic/game/sgt/sgt_restaurant_doors.h
new file mode 100644
index 0000000..287452e
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_restaurant_doors.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SGT_RESTAURANT_DOORS_H
+#define TITANIC_SGT_RESTAURANT_DOORS_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CSGTRestaurantDoors : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSGTRestaurantDoors"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SGT_RESTAURANT_DOORS_H */
diff --git a/engines/titanic/game/sgt/sgt_state_room.cpp b/engines/titanic/game/sgt/sgt_state_room.cpp
new file mode 100644
index 0000000..d244309
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_state_room.cpp
@@ -0,0 +1,85 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+CSGTStateRoomStatics *_statics;
+
+CSGTStateRoom::CSGTStateRoom() : CBackground(), _fieldE0(1),
+	_fieldE4(1), _fieldE8(0), _fieldEC(1), _fieldF0(1) {
+}
+
+void CSGTStateRoom::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_statics->_v1, indent);
+	file->writeQuotedLine(_statics->_v2, indent);
+	file->writeQuotedLine(_statics->_v3, indent);
+	file->writeQuotedLine(_statics->_v4, indent);
+	file->writeQuotedLine(_statics->_v5, indent);
+	file->writeQuotedLine(_statics->_v6, indent);
+	file->writeQuotedLine(_statics->_v7, indent);
+	file->writeQuotedLine(_statics->_v8, indent);
+	file->writeQuotedLine(_statics->_v9, indent);
+	file->writeQuotedLine(_statics->_v10, indent);
+	file->writeQuotedLine(_statics->_v11, indent);
+	file->writeQuotedLine(_statics->_v12, indent);
+
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_statics->_v13, indent);
+	file->writeNumberLine(_statics->_v14, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_fieldF0, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CSGTStateRoom::load(SimpleFile *file) {
+	file->readNumber();
+	_statics->_v1 = file->readString();
+	_statics->_v2 = file->readString();
+	_statics->_v3 = file->readString();
+	_statics->_v4 = file->readString();
+	_statics->_v5 = file->readString();
+	_statics->_v6 = file->readString();
+	_statics->_v7 = file->readString();
+	_statics->_v8 = file->readString();
+	_statics->_v9 = file->readString();
+	_statics->_v10 = file->readString();
+	_statics->_v11 = file->readString();
+	_statics->_v12 = file->readString();
+
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_statics->_v13 = file->readNumber();
+	_statics->_v14 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_fieldF0 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/sgt_state_room.h b/engines/titanic/game/sgt/sgt_state_room.h
new file mode 100644
index 0000000..ba70e54
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_state_room.h
@@ -0,0 +1,77 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SGT_STATE_ROOM_H
+#define TITANIC_SGT_STATE_ROOM_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+struct CSGTStateRoomStatics {
+	CString _v1;
+	CString _v2;
+	CString _v3;
+	CString _v4;
+	CString _v5;
+	CString _v6;
+	CString _v7;
+	CString _v8;
+	CString _v9;
+	CString _v10;
+	CString _v11;
+	CString _v12;
+	int _v13;
+	int _v14;
+};
+
+class CSGTStateRoom : public CBackground {
+private:
+	CSGTStateRoomStatics *_statics;
+private:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+public:
+	CSGTStateRoom();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSGTStateRoom"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SGT_STATE_ROOM_H */
diff --git a/engines/titanic/game/sgt/sgt_upper_doors_sound.cpp b/engines/titanic/game/sgt/sgt_upper_doors_sound.cpp
new file mode 100644
index 0000000..83a500e
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_upper_doors_sound.cpp
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/sgt_upper_doors_sound.h"
+
+namespace Titanic {
+
+CSGTUpperDoorsSound::CSGTUpperDoorsSound() {
+	_string2 = "b#53.wav";
+}
+
+void CSGTUpperDoorsSound::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	CClickResponder::save(file, indent);
+}
+
+void CSGTUpperDoorsSound::load(SimpleFile *file) {
+	file->readNumber();
+	_string2 = file->readString();
+
+	CClickResponder::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/sgt_upper_doors_sound.h b/engines/titanic/game/sgt/sgt_upper_doors_sound.h
new file mode 100644
index 0000000..ed97627
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_upper_doors_sound.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SGT_UPPER_DOORS_SOUND_H
+#define TITANIC_SGT_UPPER_DOORS_SOUND_H
+
+#include "titanic/core/click_responder.h"
+
+namespace Titanic {
+
+class CSGTUpperDoorsSound : public CClickResponder {
+public:
+	CSGTUpperDoorsSound();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSGTUpperDoorsSound"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SGT_UPPER_DOORS_SOUND_H */
diff --git a/engines/titanic/game/sgt_state_room.cpp b/engines/titanic/game/sgt_state_room.cpp
deleted file mode 100644
index 10bec50..0000000
--- a/engines/titanic/game/sgt_state_room.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/sgt_state_room.h"
-
-namespace Titanic {
-
-CSGTStateRoomStatics *_statics;
-
-CSGTStateRoom::CSGTStateRoom() : CBackground(), _fieldE0(1),
-	_fieldE4(1), _fieldE8(0), _fieldEC(1), _fieldF0(1) {
-}
-
-void CSGTStateRoom::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_statics->_v1, indent);
-	file->writeQuotedLine(_statics->_v2, indent);
-	file->writeQuotedLine(_statics->_v3, indent);
-	file->writeQuotedLine(_statics->_v4, indent);
-	file->writeQuotedLine(_statics->_v5, indent);
-	file->writeQuotedLine(_statics->_v6, indent);
-	file->writeQuotedLine(_statics->_v7, indent);
-	file->writeQuotedLine(_statics->_v8, indent);
-	file->writeQuotedLine(_statics->_v9, indent);
-	file->writeQuotedLine(_statics->_v10, indent);
-	file->writeQuotedLine(_statics->_v11, indent);
-	file->writeQuotedLine(_statics->_v12, indent);
-
-	file->writeNumberLine(_fieldE0, indent);
-	file->writeNumberLine(_fieldE4, indent);
-	file->writeNumberLine(_statics->_v13, indent);
-	file->writeNumberLine(_statics->_v14, indent);
-	file->writeNumberLine(_fieldE8, indent);
-	file->writeNumberLine(_fieldEC, indent);
-	file->writeNumberLine(_fieldF0, indent);
-
-	CBackground::save(file, indent);
-}
-
-void CSGTStateRoom::load(SimpleFile *file) {
-	file->readNumber();
-	_statics->_v1 = file->readString();
-	_statics->_v2 = file->readString();
-	_statics->_v3 = file->readString();
-	_statics->_v4 = file->readString();
-	_statics->_v5 = file->readString();
-	_statics->_v6 = file->readString();
-	_statics->_v7 = file->readString();
-	_statics->_v8 = file->readString();
-	_statics->_v9 = file->readString();
-	_statics->_v10 = file->readString();
-	_statics->_v11 = file->readString();
-	_statics->_v12 = file->readString();
-
-	_fieldE0 = file->readNumber();
-	_fieldE4 = file->readNumber();
-	_statics->_v13 = file->readNumber();
-	_statics->_v14 = file->readNumber();
-	_fieldE8 = file->readNumber();
-	_fieldEC = file->readNumber();
-	_fieldF0 = file->readNumber();
-
-	CBackground::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt_state_room.h b/engines/titanic/game/sgt_state_room.h
deleted file mode 100644
index ba70e54..0000000
--- a/engines/titanic/game/sgt_state_room.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_SGT_STATE_ROOM_H
-#define TITANIC_SGT_STATE_ROOM_H
-
-#include "titanic/core/background.h"
-
-namespace Titanic {
-
-struct CSGTStateRoomStatics {
-	CString _v1;
-	CString _v2;
-	CString _v3;
-	CString _v4;
-	CString _v5;
-	CString _v6;
-	CString _v7;
-	CString _v8;
-	CString _v9;
-	CString _v10;
-	CString _v11;
-	CString _v12;
-	int _v13;
-	int _v14;
-};
-
-class CSGTStateRoom : public CBackground {
-private:
-	CSGTStateRoomStatics *_statics;
-private:
-	int _fieldE0;
-	int _fieldE4;
-	int _fieldE8;
-	int _fieldEC;
-	int _fieldF0;
-public:
-	CSGTStateRoom();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSGTStateRoom"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_SGT_STATE_ROOM_H */
diff --git a/engines/titanic/game/sgt_upper_doors_sound.cpp b/engines/titanic/game/sgt_upper_doors_sound.cpp
deleted file mode 100644
index 2380926..0000000
--- a/engines/titanic/game/sgt_upper_doors_sound.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/sgt_upper_doors_sound.h"
-
-namespace Titanic {
-
-CSGTUpperDoorsSound::CSGTUpperDoorsSound() {
-	_string2 = "b#53.wav";
-}
-
-void CSGTUpperDoorsSound::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string2, indent);
-
-	CClickResponder::save(file, indent);
-}
-
-void CSGTUpperDoorsSound::load(SimpleFile *file) {
-	file->readNumber();
-	_string2 = file->readString();
-
-	CClickResponder::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt_upper_doors_sound.h b/engines/titanic/game/sgt_upper_doors_sound.h
deleted file mode 100644
index ed97627..0000000
--- a/engines/titanic/game/sgt_upper_doors_sound.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_SGT_UPPER_DOORS_SOUND_H
-#define TITANIC_SGT_UPPER_DOORS_SOUND_H
-
-#include "titanic/core/click_responder.h"
-
-namespace Titanic {
-
-class CSGTUpperDoorsSound : public CClickResponder {
-public:
-	CSGTUpperDoorsSound();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSGTUpperDoorsSound"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_SGT_UPPER_DOORS_SOUND_H */
diff --git a/engines/titanic/game/ship_setting_button.cpp b/engines/titanic/game/ship_setting_button.cpp
new file mode 100644
index 0000000..c1318b1
--- /dev/null
+++ b/engines/titanic/game/ship_setting_button.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/ship_setting_button.h"
+
+namespace Titanic {
+
+void CShipSettingButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CShipSettingButton::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/ship_setting_button.h b/engines/titanic/game/ship_setting_button.h
new file mode 100644
index 0000000..008ab78
--- /dev/null
+++ b/engines/titanic/game/ship_setting_button.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SHIP_SETTING_BUTTON_H
+#define TITANIC_SHIP_SETTING_BUTTON_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CShipSettingButton : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CShipSettingButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SHIP_SETTING_BUTTON_H */
diff --git a/engines/titanic/game/show_cell_points.cpp b/engines/titanic/game/show_cell_points.cpp
new file mode 100644
index 0000000..e23d588
--- /dev/null
+++ b/engines/titanic/game/show_cell_points.cpp
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/show_cell_points.h"
+
+namespace Titanic {
+
+void CShowCellpoints::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_strValue, indent);
+	file->writeNumberLine(_numValue, indent);
+	CGameObject::save(file, indent);
+}
+
+void CShowCellpoints::load(SimpleFile *file) {
+	file->readNumber();
+	_strValue = file->readString();
+	_numValue = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/show_cell_points.h b/engines/titanic/game/show_cell_points.h
new file mode 100644
index 0000000..c807cd5
--- /dev/null
+++ b/engines/titanic/game/show_cell_points.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef SHOW_CELL_POINTS_H
+#define SHOW_CELL_POINTS_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CShowCellpoints : public CGameObject {
+public:
+	CString _strValue;
+	int _numValue;
+public:
+	CShowCellpoints() : CGameObject(), _numValue(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CShowCellpoints"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* SHOW_CELL_POINTS_H */
diff --git a/engines/titanic/game/splash_animation.cpp b/engines/titanic/game/splash_animation.cpp
new file mode 100644
index 0000000..16cf067
--- /dev/null
+++ b/engines/titanic/game/splash_animation.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/splash_animation.h"
+
+namespace Titanic {
+
+void CSplashAnimation::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CSplashAnimation::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/splash_animation.h b/engines/titanic/game/splash_animation.h
new file mode 100644
index 0000000..8ac59d9
--- /dev/null
+++ b/engines/titanic/game/splash_animation.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SPLASH_ANIMATION_H
+#define TITANIC_SPLASH_ANIMATION_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CSplashAnimation : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSplashAnimation"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SPLASH_ANIMATION_H */
diff --git a/engines/titanic/game/star_control.cpp b/engines/titanic/game/star_control.cpp
new file mode 100644
index 0000000..0996a0f
--- /dev/null
+++ b/engines/titanic/game/star_control.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/star_control.h"
+
+namespace Titanic {
+
+void CStarControl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CStarControl::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/star_control.h b/engines/titanic/game/star_control.h
new file mode 100644
index 0000000..c76e9be
--- /dev/null
+++ b/engines/titanic/game/star_control.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_H
+#define TITANIC_STAR_CONTROL_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CStarControl : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CStarControl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_H */
diff --git a/engines/titanic/game/starling_puret.cpp b/engines/titanic/game/starling_puret.cpp
new file mode 100644
index 0000000..026128b
--- /dev/null
+++ b/engines/titanic/game/starling_puret.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/starling_puret.h"
+
+namespace Titanic {
+
+void CStarlingPuret::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CStarlingPuret::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/starling_puret.h b/engines/titanic/game/starling_puret.h
new file mode 100644
index 0000000..5c53a53b
--- /dev/null
+++ b/engines/titanic/game/starling_puret.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STARLING_PURET_H
+#define TITANIC_STARLING_PURET_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CStarlingPuret : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CStarlingPuret"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STARLING_PURET_H */
diff --git a/engines/titanic/game/sub_wrapper.cpp b/engines/titanic/game/sub_wrapper.cpp
new file mode 100644
index 0000000..be6b3e2
--- /dev/null
+++ b/engines/titanic/game/sub_wrapper.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sub_wrapper.h"
+
+namespace Titanic {
+
+void CSUBWrapper::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CSUBWrapper::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sub_wrapper.h b/engines/titanic/game/sub_wrapper.h
new file mode 100644
index 0000000..b67d4e5
--- /dev/null
+++ b/engines/titanic/game/sub_wrapper.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SUB_WRAPPER_H
+#define TITANIC_SUB_WRAPPER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CSUBWrapper : public CGameObject {
+public:
+	int _value;
+public:
+	CSUBWrapper() : CGameObject(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSUBWrapper"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SUB_WRAPPER_H */
diff --git a/engines/titanic/game/throw_tv_down_well.cpp b/engines/titanic/game/throw_tv_down_well.cpp
new file mode 100644
index 0000000..d77d776
--- /dev/null
+++ b/engines/titanic/game/throw_tv_down_well.cpp
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/throw_tv_down_well.h"
+
+namespace Titanic {
+
+void CThrowTVDownWell::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_strValue, indent);
+	file->writeNumberLine(_numValue, indent);
+	CGameObject::save(file, indent);
+}
+
+void CThrowTVDownWell::load(SimpleFile *file) {
+	file->readNumber();
+	_strValue = file->readString();
+	_numValue = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/throw_tv_down_well.h b/engines/titanic/game/throw_tv_down_well.h
new file mode 100644
index 0000000..0f8f731
--- /dev/null
+++ b/engines/titanic/game/throw_tv_down_well.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_THROW_TV_DOWN_WELL_H
+#define TITANIC_THROW_TV_DOWN_WELL_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CThrowTVDownWell : public CGameObject {
+public:
+	CString _strValue;
+	int _numValue;
+public:
+	CThrowTVDownWell() : CGameObject(), _numValue(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CThrowTVDownWell"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_THROW_TV_DOWN_WELL_H */
diff --git a/engines/titanic/game/titania_still_control.cpp b/engines/titanic/game/titania_still_control.cpp
new file mode 100644
index 0000000..96c003d
--- /dev/null
+++ b/engines/titanic/game/titania_still_control.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/titania_still_control.h"
+
+namespace Titanic {
+
+void CTitaniaStillControl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CTitaniaStillControl::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/titania_still_control.h b/engines/titanic/game/titania_still_control.h
new file mode 100644
index 0000000..141f0c5
--- /dev/null
+++ b/engines/titanic/game/titania_still_control.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TITANIA_STILL_CONTROL_H
+#define TITANIC_TITANIA_STILL_CONTROL_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CTitaniaStillControl : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTitaniaStillControl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TITANIA_STILL_CONTROL_H */
diff --git a/engines/titanic/game/tow_parrot_nav.cpp b/engines/titanic/game/tow_parrot_nav.cpp
new file mode 100644
index 0000000..d476681
--- /dev/null
+++ b/engines/titanic/game/tow_parrot_nav.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/tow_parrot_nav.h"
+
+namespace Titanic {
+
+void CTOWParrotNav::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CTOWParrotNav::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/tow_parrot_nav.h b/engines/titanic/game/tow_parrot_nav.h
new file mode 100644
index 0000000..6233728
--- /dev/null
+++ b/engines/titanic/game/tow_parrot_nav.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TOW_PARROT_NAV_H
+#define TITANIC_TOW_PARROT_NAV_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CTOWParrotNav : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTOWParrotNav"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TOW_PARROT_NAV_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 111fd25..97fe788 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -45,6 +45,7 @@ MODULE_OBJS := \
 	carry/photograph.o \
 	carry/plug_in.o \
 	carry/sweets.o \
+	carry/test_carry.o \
 	core/background.o \
 	core/click_responder.o \
 	core/dont_save_file_item.o \
@@ -62,42 +63,102 @@ MODULE_OBJS := \
 	core/project_item.o \
 	core/resource_key.o \
 	core/saveable_object.o \
+	core/static_image.o \
 	core/turn_on_object.o \
 	core/turn_on_play_sound.o \
 	core/tree_item.o \
 	core/view_item.o \
 	game/announce.o \
+	game/annoy_barbot.o \
+	game/bar_menu.o \
+	game/bar_menu_button.o \
+	game/bar_bell.o \
+	game/belbot_get_light.o \
+	game/bottom_of_well_monitor.o \
 	game/bowl_unlocker.o \
+	game/brain_slot.o \
+	game/bridge_door.o \
+	game/call_pellerator.o \
 	game/cdrom.o \
 	game/cdrom_computer.o \
 	game/cdrom_tray.o \
+	game/chev_code.o \
+	game/chev_panel.o \
+	game/chicken_cooler.o \
+	game/cookie.o \
 	game/computer_screen.o \
 	game/credits.o \
 	game/credits_button.o \
 	game/dead_area.o \
 	game/desk_click_responder.o \
+	game/doorbot_elevator_handler.o \
 	game/doorbot_home_handler.o \
 	game/drawer.o \
 	game/ear_sweet_bowl.o \
+	game/elevator_action_area.o \
 	game/empty_nut_bowl.o \
+	game/end_credit_text.o \
+	game/end_credits.o \
+	game/end_explode_ship.o \
+	game/end_game_cerdits.o \
+	game/end_sequence_control.o \
+	game/enter_bridge.o \
 	game/enter_exit_first_class_state.o \
+	game/enter_exit_sec_class_mini_lift.o \
+	game/enter_exit_view.o \
+	game/enter_sec_class_state.o \
 	game/hammer_dispensor_button.o \
+	game/exit_lift.o \
+	game/exit_pellerator.o \
+	game/fan.o \
+	game/fan_control.o \
+	game/fan_decrease.o \
+	game/fan_increase.o \
+	game/fan_noises.o \
+	game/floor_indicator.o \
+	game/get_lift_eye2.o \
+	game/glass_smasher.o \
+	game/gondolier_base.o \
+	game/hammer_clip.o \
+	game/head_slot.o \
+	game/head_spinner.o \
+	game/idle_summoner.o \
+	game/leave_sec_class_state.o \
 	game/light.o \
 	game/light_switch.o \
 	game/little_lift_button.o \
+	game/long_stick_dispenser.o \
+	game/mail_man.o \
+	game/missiveomat.o \
+	game/movie_tester.o \
+	game/navigation_computer.o \
 	game/no_nut_bowl.o \
-	game/pet_position.o \
-	game/port_hole.o \
 	game/null_port_hole.o \
 	game/nut_replacer.o \
+	game/pet_controler.o \
+	game/pet_disabler.o \
+	game/pet_graphic2.o \
+	game/pet_graphic.o \
+	game/phonograph_lid.o \
+	game/place_holder.o \
+	game/port_hole.o \
+	game/reserved_table.o \
 	game/room_item.o \
+	game/search_point.o \
 	game/service_elevator_door.o \
-	game/sgt_state_room.o \
-	game/sgt_upper_doors_sound.o \
+	game/ship_setting_button.o \
+	game/show_cell_points.o \
+	game/splash_animation.o \
+	game/star_control.o \
+	game/starling_puret.o \
 	game/start_action.o \
 	game/sub_glass.o \
+	game/sub_wrapper.o \
 	game/sweet_bowl.o \
 	game/television.o \
+	game/tow_parrot_nav.o \
+	game/throw_tv_down_well.o \
+	game/titania_still_control.o \
 	game/parrot/parrot_lobby_controller.o \
 	game/parrot/parrot_lobby_link_updater.o \
 	game/parrot/parrot_lobby_object.o \
@@ -108,6 +169,22 @@ MODULE_OBJS := \
 	game/parrot/parrot_perch_holder.o \
 	game/parrot/parrot_succubus.o \
 	game/parrot/parrot_trigger.o \
+	game/parrot/player_meets_parrot.o \
+	game/pet/pet.o \
+	game/pet/pet_class1.o \
+	game/pet/pet_class2.o \
+	game/pet/pet_class3.o \
+	game/pet/pet_monitor.o \
+	game/pet/pet_position.o \
+	game/pet/pet_sentinal.o \
+	game/pet/pet_sounds.o \
+	game/pet/pet_transition.o \
+	game/pet/pet_transport.o \
+	game/sgt/sgt_doors.o \
+	game/sgt/sgt_navigation.o \
+	game/sgt/sgt_restaurant_doors.o \
+	game/sgt/sgt_state_room.o \
+	game/sgt/sgt_upper_doors_sound.o \
 	gfx/act_button.o \
 	gfx/changes_season_button.o \
 	gfx/chev_left_off.o \
@@ -173,7 +250,12 @@ MODULE_OBJS := \
 	npcs/true_talk_npc.o \
 	sound/auto_music_player.o \
 	sound/auto_music_player_base.o \
-	sound/seasonal_music_player.o
+	sound/auto_sound_player.o \
+	sound/background_sound_maker.o \
+	sound/music_player.o \
+	sound/seasonal_music_player.o \
+	sound/titania_speech.o \
+	sound/trigger_auto_music_player.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/sound/auto_sound_player.cpp b/engines/titanic/sound/auto_sound_player.cpp
new file mode 100644
index 0000000..619c362
--- /dev/null
+++ b/engines/titanic/sound/auto_sound_player.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/auto_sound_player.h"
+
+namespace Titanic {
+
+CAutoSoundPlayer::CAutoSoundPlayer() : CGameObject(),
+	_fieldC8(0), _fieldCC(70), _fieldD0(0), _fieldD4(0), _fieldD8(-1),
+	_fieldDC(0), _fieldE0(-1), _fieldE4(0), _fieldE8(0) {
+}
+
+void CAutoSoundPlayer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CAutoSoundPlayer::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/auto_sound_player.h b/engines/titanic/sound/auto_sound_player.h
new file mode 100644
index 0000000..07ac0ac
--- /dev/null
+++ b/engines/titanic/sound/auto_sound_player.h
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_SOUND_PLAYER_H
+#define TITANIC_AUTO_SOUND_PLAYER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CAutoSoundPlayer : public CGameObject {
+public:
+	CString _string1;
+	int _fieldC8;
+	int _fieldCC;
+	int _fieldD0;
+	int _fieldD4;
+	int _fieldD8;
+	int _fieldDC;
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+public:
+	CAutoSoundPlayer();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoSoundPlayer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUTO_SOUND_PLAYER_H */
diff --git a/engines/titanic/sound/background_sound_maker.cpp b/engines/titanic/sound/background_sound_maker.cpp
new file mode 100644
index 0000000..111e641
--- /dev/null
+++ b/engines/titanic/sound/background_sound_maker.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/background_sound_maker.h"
+
+namespace Titanic {
+
+void CBackgroundSoundMaker::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CBackgroundSoundMaker::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/background_sound_maker.h b/engines/titanic/sound/background_sound_maker.h
new file mode 100644
index 0000000..5a234ae
--- /dev/null
+++ b/engines/titanic/sound/background_sound_maker.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BACKGROUND_SOUND_MAKER_H
+#define TITANIC_BACKGROUND_SOUND_MAKER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CBackgroundSoundMaker : public CGameObject {
+public:
+	int _value;
+public:
+	CBackgroundSoundMaker() : CGameObject(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBackgroundSoundMaker"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BACKGROUND_SOUND_MAKER_H */
diff --git a/engines/titanic/sound/music_player.cpp b/engines/titanic/sound/music_player.cpp
new file mode 100644
index 0000000..39e97ed
--- /dev/null
+++ b/engines/titanic/sound/music_player.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/music_player.h"
+
+namespace Titanic {
+
+void CMusicPlayer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CMusicPlayer::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/music_player.h b/engines/titanic/sound/music_player.h
new file mode 100644
index 0000000..19539c8
--- /dev/null
+++ b/engines/titanic/sound/music_player.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSIC_PLAYER_H
+#define TITANIC_MUSIC_PLAYER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CMusicPlayer : public CGameObject {
+public:
+	int _fieldBC;
+	CString _string1;
+	int _fieldCC;
+	int _fieldD0;
+public:
+	CMusicPlayer() : CGameObject(),
+		_fieldBC(0), _fieldCC(0), _fieldD0(100) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMusicPlayer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_PLAYER_H */
diff --git a/engines/titanic/sound/titania_speech.cpp b/engines/titanic/sound/titania_speech.cpp
new file mode 100644
index 0000000..fac1669
--- /dev/null
+++ b/engines/titanic/sound/titania_speech.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/titania_speech.h"
+
+namespace Titanic {
+
+void CTitaniaSpeech::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CTitaniaSpeech::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/titania_speech.h b/engines/titanic/sound/titania_speech.h
new file mode 100644
index 0000000..a81544a
--- /dev/null
+++ b/engines/titanic/sound/titania_speech.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TITANIA_SPEECH_H
+#define TITANIC_TITANIA_SPEECH_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CTitaniaSpeech : public CGameObject {
+public:
+	int _value1, _value2;
+public:
+	CTitaniaSpeech() : CGameObject(), _value1(1), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTitaniaSpeech"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TITANIA_SPEECH_H */
diff --git a/engines/titanic/sound/trigger_auto_music_player.cpp b/engines/titanic/sound/trigger_auto_music_player.cpp
new file mode 100644
index 0000000..adcc18c
--- /dev/null
+++ b/engines/titanic/sound/trigger_auto_music_player.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/trigger_auto_music_player.h"
+
+namespace Titanic {
+
+void CTriggerAutoMusicPlayer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CTriggerAutoMusicPlayer::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/trigger_auto_music_player.h b/engines/titanic/sound/trigger_auto_music_player.h
new file mode 100644
index 0000000..9cc71ee
--- /dev/null
+++ b/engines/titanic/sound/trigger_auto_music_player.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_MUSIC_PLAYER_H
+#define TITANIC_AUTO_MUSIC_PLAYER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CTriggerAutoMusicPlayer : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTriggerAutoMusicPlayer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUTO_MUSIC_PLAYER_H */


Commit: 95ebd2394bd4bd84f7894a94baf9fa1423345fad
    https://github.com/scummvm/scummvm/commit/95ebd2394bd4bd84f7894a94baf9fa1423345fad
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-28T22:16:02-05:00

Commit Message:
TITANIC: Loading bugfixes and implemented CBrain descendents

Changed paths:
  A engines/titanic/carry/auditory_centre.cpp
  A engines/titanic/carry/auditory_centre.h
  A engines/titanic/carry/central_core.cpp
  A engines/titanic/carry/central_core.h
  A engines/titanic/carry/speech_centre.cpp
  A engines/titanic/carry/speech_centre.h
  A engines/titanic/carry/vision_centre.cpp
  A engines/titanic/carry/vision_centre.h
    engines/titanic/carry/brain.cpp
    engines/titanic/carry/brain.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk
    engines/titanic/moves/move_player_in_parrot_room.cpp



diff --git a/engines/titanic/carry/auditory_centre.cpp b/engines/titanic/carry/auditory_centre.cpp
new file mode 100644
index 0000000..e5dedcd
--- /dev/null
+++ b/engines/titanic/carry/auditory_centre.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/auditory_centre.h"
+
+namespace Titanic {
+
+void CAuditoryCentre::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CBrain::save(file, indent);
+}
+
+void CAuditoryCentre::load(SimpleFile *file) {
+	file->readNumber();
+	CBrain::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/auditory_centre.h b/engines/titanic/carry/auditory_centre.h
new file mode 100644
index 0000000..9708b6f
--- /dev/null
+++ b/engines/titanic/carry/auditory_centre.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUDITORY_CENTRE_H
+#define TITANIC_AUDITORY_CENTRE_H
+
+#include "titanic/carry/brain.h"
+
+namespace Titanic {
+
+class CAuditoryCentre : public CBrain {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAuditoryCentre"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUDITORY_CENTRE_H */
diff --git a/engines/titanic/carry/brain.cpp b/engines/titanic/carry/brain.cpp
index f37549c..0d1cdf7 100644
--- a/engines/titanic/carry/brain.cpp
+++ b/engines/titanic/carry/brain.cpp
@@ -24,13 +24,12 @@
 
 namespace Titanic {
 
-CBrain::CBrain() : CCarry(), _field12C(0),
-		_field130(0), _field134(0), _field138(0) {
+CBrain::CBrain() : CCarry(), _field134(0), _field138(0) {
 }
 
 void CBrain::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_field12C, indent);
+	file->writePoint(_pos1, indent);
 	file->writeNumberLine(_field134, indent);
 	file->writeNumberLine(_field138, indent);
 
@@ -39,7 +38,7 @@ void CBrain::save(SimpleFile *file, int indent) const {
 
 void CBrain::load(SimpleFile *file) {
 	file->readNumber();
-	_field12C = file->readNumber();
+	_pos1 = file->readPoint();
 	_field134 = file->readNumber();
 	_field138 = file->readNumber();
 
diff --git a/engines/titanic/carry/brain.h b/engines/titanic/carry/brain.h
index 9037230..b5ec70e 100644
--- a/engines/titanic/carry/brain.h
+++ b/engines/titanic/carry/brain.h
@@ -29,8 +29,7 @@ namespace Titanic {
 
 class CBrain : public CCarry {
 private:
-	int _field12C;
-	int _field130;
+	Common::Point _pos1;
 	int _field134;
 	int _field138;
 public:
diff --git a/engines/titanic/carry/central_core.cpp b/engines/titanic/carry/central_core.cpp
new file mode 100644
index 0000000..97309e0
--- /dev/null
+++ b/engines/titanic/carry/central_core.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/central_core.h"
+
+namespace Titanic {
+
+void CCentralCore::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CBrain::save(file, indent);
+}
+
+void CCentralCore::load(SimpleFile *file) {
+	file->readNumber();
+	CBrain::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/central_core.h b/engines/titanic/carry/central_core.h
new file mode 100644
index 0000000..277b302
--- /dev/null
+++ b/engines/titanic/carry/central_core.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CENTRAL_CORE_H
+#define TITANIC_CENTRAL_CORE_H
+
+#include "titanic/carry/brain.h"
+
+namespace Titanic {
+
+class CCentralCore : public CBrain {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCentralCore"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CENTRAL_CORE_H */
diff --git a/engines/titanic/carry/speech_centre.cpp b/engines/titanic/carry/speech_centre.cpp
new file mode 100644
index 0000000..c5875bd
--- /dev/null
+++ b/engines/titanic/carry/speech_centre.cpp
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/speech_centre.h"
+
+namespace Titanic {
+
+void CSpeechCentre::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field13C, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_field14C, indent);
+
+	CCarry::save(file, indent);
+}
+
+void CSpeechCentre::load(SimpleFile *file) {
+	file->readNumber();
+	_field13C = file->readNumber();
+	_string1 = file->readString();
+	_field14C = file->readNumber();
+
+	CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/speech_centre.h b/engines/titanic/carry/speech_centre.h
new file mode 100644
index 0000000..4b5ced5
--- /dev/null
+++ b/engines/titanic/carry/speech_centre.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SPEECH_CENTRE_H
+#define TITANIC_SPEECH_CENTRE_H
+
+#include "titanic/carry/brain.h"
+
+namespace Titanic {
+
+class CSpeechCentre : public CBrain {
+private:
+	int _field13C;
+	CString _string1;
+	int _field14C;
+public:
+	CSpeechCentre() : CBrain(), _string1("Summer"),
+		_field13C(1), _field14C(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSpeechCentre"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SPEECH_CENTRE_H */
diff --git a/engines/titanic/carry/vision_centre.cpp b/engines/titanic/carry/vision_centre.cpp
new file mode 100644
index 0000000..b85f99f
--- /dev/null
+++ b/engines/titanic/carry/vision_centre.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/vision_centre.h"
+
+namespace Titanic {
+
+void CVisionCentre::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CBrain::save(file, indent);
+}
+
+void CVisionCentre::load(SimpleFile *file) {
+	file->readNumber();
+	CBrain::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/vision_centre.h b/engines/titanic/carry/vision_centre.h
new file mode 100644
index 0000000..ce21fe5
--- /dev/null
+++ b/engines/titanic/carry/vision_centre.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_VISION_CENTRE_H
+#define TITANIC_VISION_CENTRE_H
+
+#include "titanic/carry/brain.h"
+
+namespace Titanic {
+
+class CVisionCentre : public CBrain {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CVisionCentre"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_VISION_CENTRE_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index f76340c..f36b7ac 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -21,11 +21,13 @@
  */
 
 #include "titanic/carry/arm.h"
+#include "titanic/carry/auditory_centre.h"
 #include "titanic/carry/bowl_ear.h"
 #include "titanic/carry/brain.h"
 #include "titanic/carry/bridge_piece.h"
 #include "titanic/carry/carry.h"
 #include "titanic/carry/carry_parrot.h"
+#include "titanic/carry/central_core.h"
 #include "titanic/carry/chicken.h"
 #include "titanic/carry/crushed_tv.h"
 #include "titanic/carry/eye.h"
@@ -48,7 +50,9 @@
 #include "titanic/carry/phonograph_ear.h"
 #include "titanic/carry/photograph.h"
 #include "titanic/carry/plug_in.h"
+#include "titanic/carry/speech_centre.h"
 #include "titanic/carry/sweets.h"
+#include "titanic/carry/vision_centre.h"
 
 #include "titanic/core/saveable_object.h"
 #include "titanic/core/background.h"
@@ -75,6 +79,7 @@
 #include "titanic/game/cdrom_computer.h"
 #include "titanic/game/cdrom_tray.h"
 #include "titanic/game/computer_screen.h"
+#include "titanic/game/cookie.h"
 #include "titanic/game/credits.h"
 #include "titanic/game/credits_button.h"
 #include "titanic/game/dead_area.h"
@@ -198,10 +203,12 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 #define ADDFN(T) (*_classList)[#T] = Function##T
 
 DEFFN(CArm);
+DEFFN(CAuditoryCentre);
 DEFFN(CBowlEar);
 DEFFN(CBrain);
 DEFFN(CBridgePiece);
 DEFFN(CCarryParrot);
+DEFFN(CCentralCore);
 DEFFN(CChicken);
 DEFFN(CCrushedTV);
 DEFFN(CEar);
@@ -223,7 +230,9 @@ DEFFN(CPhonographCylinder);
 DEFFN(CPhonographEar);
 DEFFN(CPhotograph);
 DEFFN(CPlugIn);
+DEFFN(CSpeechCentre);
 DEFFN(CSweets);
+DEFFN(CVisionCentre);
 
 DEFFN(CBackground);
 DEFFN(CClickResponder);
@@ -248,6 +257,7 @@ DEFFN(CBowlUnlocker);
 DEFFN(CCDROM);
 DEFFN(CCDROMComputer);
 DEFFN(CCDROMTray);
+DEFFN(CCookie);
 DEFFN(CComputerScreen);
 DEFFN(CCredits);
 DEFFN(CCreditsButton);
@@ -535,10 +545,12 @@ DEFFN(CAutoMusicPlayer);
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
 	ADDFN(CArm);
+	ADDFN(CAuditoryCentre);
 	ADDFN(CBowlEar);
 	ADDFN(CBrain);
 	ADDFN(CBridgePiece);
 	ADDFN(CCarryParrot);
+	ADDFN(CCentralCore);
 	ADDFN(CChicken);
 	ADDFN(CCrushedTV);
 	ADDFN(CEar);
@@ -560,7 +572,9 @@ void CSaveableObject::initClassList() {
 	ADDFN(CPhonographEar);
 	ADDFN(CPhotograph);
 	ADDFN(CPlugIn);
+	ADDFN(CSpeechCentre);
 	ADDFN(CSweets);
+	ADDFN(CVisionCentre);
 
 	ADDFN(CBackground);
 	ADDFN(CClickResponder);
@@ -586,6 +600,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CCDROMComputer);
 	ADDFN(CCDROMTray);
 	ADDFN(CComputerScreen);
+	ADDFN(CCookie);
 	ADDFN(CCredits);
 	ADDFN(CCreditsButton);
 	ADDFN(CDeadArea);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 97fe788..a5a5db4 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -15,12 +15,14 @@ MODULE_OBJS := \
 	string.o \
 	titanic.o \
 	video_surface.o \
+	carry/auditory_centre.o \
 	carry/arm.o \
 	carry/bowl_ear.o \
 	carry/brain.o \
 	carry/bridge_piece.o \
 	carry/carry.o \
-	carry/carry_parrot.oo \
+	carry/carry_parrot.o \
+	carry/central_core.o \
 	carry/chicken.o \
 	carry/crushed_tv.o \
 	carry/ear.o \
@@ -44,8 +46,10 @@ MODULE_OBJS := \
 	carry/phonograph_ear.o \
 	carry/photograph.o \
 	carry/plug_in.o \
+	carry/speech_centre.o \
 	carry/sweets.o \
 	carry/test_carry.o \
+	carry/vision_centre.o \
 	core/background.o \
 	core/click_responder.o \
 	core/dont_save_file_item.o \
diff --git a/engines/titanic/moves/move_player_in_parrot_room.cpp b/engines/titanic/moves/move_player_in_parrot_room.cpp
index cfe4cb6..91c1706 100644
--- a/engines/titanic/moves/move_player_in_parrot_room.cpp
+++ b/engines/titanic/moves/move_player_in_parrot_room.cpp
@@ -29,12 +29,12 @@ CMovePlayerInParrotRoom::CMovePlayerInParrotRoom() : CMovePlayerTo() {
 
 void CMovePlayerInParrotRoom::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
+	CMovePlayerTo::save(file, indent);
 }
 
 void CMovePlayerInParrotRoom::load(SimpleFile *file) {
 	file->readNumber();
-	CGameObject::load(file);
+	CMovePlayerTo::load(file);
 }
 
 } // End of namespace Titanic


Commit: a89dd72f2007b00304d0cc01ac4b6dc08ed6625e
    https://github.com/scummvm/scummvm/commit/a89dd72f2007b00304d0cc01ac4b6dc08ed6625e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-29T21:20:33-05:00

Commit Message:
TITANIC: Implemented lots of CBackground descendent classes

Changed paths:
  A engines/titanic/game/arb_background.cpp
  A engines/titanic/game/arb_background.h
  A engines/titanic/game/arboretum_gate.cpp
  A engines/titanic/game/arboretum_gate.h
  A engines/titanic/game/auto_animate.cpp
  A engines/titanic/game/auto_animate.h
  A engines/titanic/game/bomb.cpp
  A engines/titanic/game/bomb.h
  A engines/titanic/game/bridge_view.cpp
  A engines/titanic/game/bridge_view.h
  A engines/titanic/game/broken_pell_base.cpp
  A engines/titanic/game/broken_pell_base.h
  A engines/titanic/game/cage.cpp
  A engines/titanic/game/cage.h
  A engines/titanic/game/captains_wheel.cpp
  A engines/titanic/game/captains_wheel.h
  A engines/titanic/game/cell_point_button.cpp
  A engines/titanic/game/cell_point_button.h
  A engines/titanic/game/chicken_dispensor.cpp
  A engines/titanic/game/chicken_dispensor.h
  A engines/titanic/game/close_broken_pel.cpp
  A engines/titanic/game/close_broken_pel.h
  A engines/titanic/game/computer.cpp
  A engines/titanic/game/computer.h
  A engines/titanic/game/eject_phonograph_button.cpp
  A engines/titanic/game/eject_phonograph_button.h
  A engines/titanic/game/emma_control.cpp
  A engines/titanic/game/emma_control.h
  A engines/titanic/game/games_console.cpp
  A engines/titanic/game/games_console.h
  A engines/titanic/game/head_smash_event.cpp
  A engines/titanic/game/head_smash_event.h
  A engines/titanic/game/head_smash_lever.cpp
  A engines/titanic/game/head_smash_lever.h
  A engines/titanic/game/lemon_dispensor.cpp
  A engines/titanic/game/lemon_dispensor.h
  A engines/titanic/game/musical_instrument.cpp
  A engines/titanic/game/musical_instrument.h
  A engines/titanic/game/play_music_button.cpp
  A engines/titanic/game/play_music_button.h
  A engines/titanic/game/play_on_act.cpp
  A engines/titanic/game/play_on_act.h
  A engines/titanic/game/record_phonograph_button.cpp
  A engines/titanic/game/record_phonograph_button.h
  A engines/titanic/game/replacement_ear.cpp
  A engines/titanic/game/replacement_ear.h
  A engines/titanic/game/sauce_dispensor.cpp
  A engines/titanic/game/sauce_dispensor.h
  A engines/titanic/game/season_background.cpp
  A engines/titanic/game/season_background.h
  A engines/titanic/game/season_barrel.cpp
  A engines/titanic/game/season_barrel.h
  A engines/titanic/game/seasonal_adjustment.cpp
  A engines/titanic/game/seasonal_adjustment.h
  A engines/titanic/game/service_elevator_window.cpp
  A engines/titanic/game/service_elevator_window.h
  A engines/titanic/game/ship_setting.cpp
  A engines/titanic/game/ship_setting.h
  A engines/titanic/game/speech_dispensor.cpp
  A engines/titanic/game/speech_dispensor.h
  A engines/titanic/game/stop_phonograph_button.cpp
  A engines/titanic/game/stop_phonograph_button.h
  A engines/titanic/game/third_class_canal.cpp
  A engines/titanic/game/third_class_canal.h
  A engines/titanic/game/wheel_button.cpp
  A engines/titanic/game/wheel_button.h
  A engines/titanic/game/wheel_hotspot.cpp
  A engines/titanic/game/wheel_hotspot.h
  A engines/titanic/game/wheel_spin.cpp
  A engines/titanic/game/wheel_spin.h
  A engines/titanic/gfx/music_control.cpp
  A engines/titanic/gfx/music_control.h
  A engines/titanic/gfx/music_slider.h
  A engines/titanic/gfx/music_slider_pitch.h
  A engines/titanic/gfx/music_slider_speed.h
  A engines/titanic/gfx/music_switch.h
  A engines/titanic/gfx/music_switch_inversion.h
  A engines/titanic/gfx/music_switch_reverse.h
  A engines/titanic/gfx/music_voice_mute.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/empty_nut_bowl.h
    engines/titanic/module.mk
    engines/titanic/sound/trigger_auto_music_player.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index f36b7ac..20d6fec 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -73,11 +73,23 @@
 #include "titanic/core/view_item.h"
 
 #include "titanic/game/announce.h"
+#include "titanic/game/arb_background.h"
+#include "titanic/game/arboretum_gate.h"
+#include "titanic/game/auto_animate.h"
 #include "titanic/game/belbot_get_light.h"
+#include "titanic/game/bomb.h"
 #include "titanic/game/bowl_unlocker.h"
+#include "titanic/game/bridge_view.h"
+#include "titanic/game/broken_pell_base.h"
+#include "titanic/game/cage.h"
+#include "titanic/game/captains_wheel.h"
 #include "titanic/game/cdrom.h"
 #include "titanic/game/cdrom_computer.h"
 #include "titanic/game/cdrom_tray.h"
+#include "titanic/game/cell_point_button.h"
+#include "titanic/game/chicken_dispensor.h"
+#include "titanic/game/close_broken_pel.h"
+#include "titanic/game/computer.h"
 #include "titanic/game/computer_screen.h"
 #include "titanic/game/cookie.h"
 #include "titanic/game/credits.h"
@@ -87,22 +99,45 @@
 #include "titanic/game/doorbot_home_handler.h"
 #include "titanic/game/drawer.h"
 #include "titanic/game/ear_sweet_bowl.h"
+#include "titanic/game/eject_phonograph_button.h"
+#include "titanic/game/emma_control.h"
 #include "titanic/game/empty_nut_bowl.h"
 #include "titanic/game/enter_exit_first_class_state.h"
+#include "titanic/game/games_console.h"
 #include "titanic/game/hammer_dispensor_button.h"
+#include "titanic/game/head_smash_event.h"
+#include "titanic/game/head_smash_lever.h"
+#include "titanic/game/lemon_dispensor.h"
 #include "titanic/game/light.h"
 #include "titanic/game/light_switch.h"
 #include "titanic/game/little_lift_button.h"
+#include "titanic/game/musical_instrument.h"
 #include "titanic/game/no_nut_bowl.h"
 #include "titanic/game/null_port_hole.h"
 #include "titanic/game/nut_replacer.h"
+#include "titanic/game/play_music_button.h"
+#include "titanic/game/play_on_act.h"
 #include "titanic/game/port_hole.h"
+#include "titanic/game/record_phonograph_button.h"
+#include "titanic/game/replacement_ear.h"
 #include "titanic/game/room_item.h"
+#include "titanic/game/sauce_dispensor.h"
+#include "titanic/game/season_background.h"
+#include "titanic/game/season_barrel.h"
+#include "titanic/game/seasonal_adjustment.h"
 #include "titanic/game/service_elevator_door.h"
+#include "titanic/game/service_elevator_window.h"
+#include "titanic/game/ship_setting.h"
+#include "titanic/game/speech_dispensor.h"
 #include "titanic/game/start_action.h"
+#include "titanic/game/stop_phonograph_button.h"
 #include "titanic/game/sub_glass.h"
 #include "titanic/game/sweet_bowl.h"
 #include "titanic/game/television.h"
+#include "titanic/game/third_class_canal.h"
+#include "titanic/game/wheel_button.h"
+#include "titanic/game/wheel_hotspot.h"
+#include "titanic/game/wheel_spin.h"
 #include "titanic/game/parrot/parrot_lobby_controller.h"
 #include "titanic/game/parrot/parrot_lobby_link_updater.h"
 #include "titanic/game/parrot/parrot_lobby_object.h"
@@ -128,7 +163,6 @@
 #include "titanic/game/sgt/sgt_restaurant_doors.h"
 #include "titanic/game/sgt/sgt_state_room.h"
 #include "titanic/game/sgt/sgt_upper_doors_sound.h"
-
 #include "titanic/gfx/act_button.h"
 #include "titanic/gfx/changes_season_button.h"
 #include "titanic/gfx/chev_left_off.h"
@@ -148,6 +182,13 @@
 #include "titanic/gfx/icon_nav_up.h"
 #include "titanic/gfx/keybrd_butt.h"
 #include "titanic/gfx/move_object_button.h"
+#include "titanic/gfx/music_control.h"
+#include "titanic/gfx/music_slider_pitch.h"
+#include "titanic/gfx/music_slider_speed.h"
+#include "titanic/gfx/music_switch.h"
+#include "titanic/gfx/music_switch_inversion.h"
+#include "titanic/gfx/music_switch_reverse.h"
+#include "titanic/gfx/music_voice_mute.h"
 #include "titanic/gfx/pet_mode_off.h"
 #include "titanic/gfx/pet_mode_on.h"
 #include "titanic/gfx/pet_mode_panel.h"
@@ -160,7 +201,6 @@
 #include "titanic/gfx/status_change_button.h"
 #include "titanic/gfx/st_button.h"
 #include "titanic/gfx/toggle_switch.h"
-
 #include "titanic/messages/messages.h"
 #include "titanic/messages/mouse_messages.h"
 #include "titanic/messages/pet_messages.h"
@@ -193,6 +233,13 @@
 #include "titanic/npcs/titania.h"
 
 #include "titanic/sound/auto_music_player.h"
+#include "titanic/sound/auto_music_player_base.h"
+#include "titanic/sound/auto_sound_player.h"
+#include "titanic/sound/background_sound_maker.h"
+#include "titanic/sound/music_player.h"
+#include "titanic/sound/seasonal_music_player.h"
+#include "titanic/sound/titania_speech.h"
+#include "titanic/sound/trigger_auto_music_player.h"
 
 namespace Titanic {
 
@@ -252,11 +299,23 @@ DEFFN(CTreeItem);
 DEFFN(CViewItem);
 
 DEFFN(CAnnounce);
+DEFFN(CArbBackground);
+DEFFN(CArboretumGate);
+DEFFN(CAutoAnimate);
 DEFFN(CBelbotGetLight);
 DEFFN(CBowlUnlocker);
+DEFFN(CBomb);
+DEFFN(CBridgeView);
+DEFFN(CBrokenPellBase)
+DEFFN(CCage);
+DEFFN(CCaptainsWheel);
 DEFFN(CCDROM);
 DEFFN(CCDROMComputer);
 DEFFN(CCDROMTray);
+DEFFN(CCellPointButton);
+DEFFN(CChickenDispensor);
+DEFFN(CCloseBrokenPel);
+DEFFN(CComputer);
 DEFFN(CCookie);
 DEFFN(CComputerScreen);
 DEFFN(CCredits);
@@ -265,22 +324,45 @@ DEFFN(CDeadArea);
 DEFFN(CDeskClickResponder);
 DEFFN(CDoorbotHomeHandler);
 DEFFN(CEarSweetBowl);
+DEFFN(CEjectPhonographButton);
+DEFFN(CEmmaControl);
 DEFFN(CEmptyNutBowl);
 DEFFN(CEnterExitFirstClassState);
+DEFFN(CGamesConsole);
 DEFFN(CHammerDispensorButton);
+DEFFN(CHeadSmashEvent);
+DEFFN(CHeadSmashLever);
+DEFFN(CLemonDispensor);
 DEFFN(CLight);
 DEFFN(CLightSwitch);
 DEFFN(CLittleLiftButton);
+DEFFN(CMusicalInstrument);
 DEFFN(CNoNutBowl);
 DEFFN(CNullPortHole);
 DEFFN(CNutReplacer);
+DEFFN(CPlayMusicButton);
+DEFFN(CPlayOnAct);
 DEFFN(CPortHole);
+DEFFN(CRecordPhonographButton);
+DEFFN(CReplacementEar);
 DEFFN(CRoomItem);
+DEFFN(CSauceDispensor);
+DEFFN(CSeasonBackground);
+DEFFN(CSeasonBarrel);
+DEFFN(CSeasonalAdjustment);
 DEFFN(CServiceElevatorDoor);
+DEFFN(CServiceElevatorWindow);
+DEFFN(CShipSetting);
+DEFFN(CSpeechDispensor);
 DEFFN(CStartAction);
+DEFFN(CStopPhonographButton);
 DEFFN(CSUBGlass);
 DEFFN(CSweetBowl);
 DEFFN(CTelevision);
+DEFFN(CThirdClassCanal);
+DEFFN(CWheelButton);
+DEFFN(CWheelHotSpot);
+DEFFN(CWheelSpin);
 DEFFN(CParrotLobbyController);
 DEFFN(CParrotLobbyLinkUpdater);
 DEFFN(CParrotLobbyObject);
@@ -326,6 +408,14 @@ DEFFN(CIconNavRight);
 DEFFN(CIconNavUp);
 DEFFN(CKeybrdButt);
 DEFFN(CMoveObjectButton);
+DEFFN(CMusicControl);
+DEFFN(CMusicSlider);
+DEFFN(CMusicSliderPitch);
+DEFFN(CMusicSliderSpeed);
+DEFFN(CMusicSwitch);
+DEFFN(CMusicSwitchInversion);
+DEFFN(CMusicSwitchReverse);
+DEFFN(CMusicVoiceMute);
 DEFFN(CPetModeOff);
 DEFFN(CPetModeOn);
 DEFFN(CPetModePanel);
@@ -539,8 +629,14 @@ DEFFN(CStarlings);
 DEFFN(CSummonBots);
 DEFFN(CSuccUBus);
 DEFFN(CTitania);
-
 DEFFN(CAutoMusicPlayer);
+DEFFN(CAutoMusicPlayerBase);
+DEFFN(CAutoSoundPlayer);
+DEFFN(CBackgroundSoundMaker);
+DEFFN(CMusicPlayer);
+DEFFN(CSeasonalMusicPlayer);
+DEFFN(CTitaniaSpeech);
+DEFFN(CTriggerAutoMusicPlayer);
 
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
@@ -594,12 +690,24 @@ void CSaveableObject::initClassList() {
 	ADDFN(CViewItem);
 
 	ADDFN(CAnnounce);
+	ADDFN(CArbBackground);
+	ADDFN(CArboretumGate);
+	ADDFN(CAutoAnimate);
 	ADDFN(CBelbotGetLight);
+	ADDFN(CBomb);
 	ADDFN(CBowlUnlocker);
+	ADDFN(CBridgeView);
+	ADDFN(CBrokenPellBase);
+	ADDFN(CCage);
+	ADDFN(CCaptainsWheel);
 	ADDFN(CCDROM);
 	ADDFN(CCDROMComputer);
 	ADDFN(CCDROMTray);
+	ADDFN(CCellPointButton);
+	ADDFN(CChickenDispensor);
 	ADDFN(CComputerScreen);
+	ADDFN(CCloseBrokenPel);
+	ADDFN(CComputer);
 	ADDFN(CCookie);
 	ADDFN(CCredits);
 	ADDFN(CCreditsButton);
@@ -608,25 +716,46 @@ void CSaveableObject::initClassList() {
 	ADDFN(CDoorbotHomeHandler);
 	ADDFN(CDropTarget);
 	ADDFN(CEarSweetBowl);
+	ADDFN(CEjectPhonographButton);
+	ADDFN(CEmmaControl);
 	ADDFN(CEmptyNutBowl);
 	ADDFN(CEnterExitFirstClassState);
+	ADDFN(CGamesConsole);
 	ADDFN(CHammerDispensorButton);
+	ADDFN(CHeadSmashEvent);
+	ADDFN(CHeadSmashLever);
+	ADDFN(CLemonDispensor);
 	ADDFN(CLight);
 	ADDFN(CLightSwitch);
 	ADDFN(CLittleLiftButton);
+	ADDFN(CMusicalInstrument);
 	ADDFN(CNoNutBowl);
 	ADDFN(CNullPortHole);
 	ADDFN(CNutReplacer);
 	ADDFN(CPETPosition);
+	ADDFN(CPlayMusicButton);
+	ADDFN(CPlayOnAct);
 	ADDFN(CPortHole);
+	ADDFN(CRecordPhonographButton);
+	ADDFN(CReplacementEar);
 	ADDFN(CRoomItem);
+	ADDFN(CSauceDispensor);
+	ADDFN(CSeasonBackground);
+	ADDFN(CSeasonBarrel);
+	ADDFN(CSeasonalAdjustment);
 	ADDFN(CServiceElevatorDoor);
-	ADDFN(CSGTStateRoom);
-	ADDFN(CSGTUpperDoorsSound);
+	ADDFN(CServiceElevatorWindow);
+	ADDFN(CShipSetting);
+	ADDFN(CSpeechDispensor);
 	ADDFN(CStartAction);
+	ADDFN(CStopPhonographButton);
 	ADDFN(CSUBGlass);
 	ADDFN(CSweetBowl);
 	ADDFN(CTelevision);
+	ADDFN(CThirdClassCanal);
+	ADDFN(CWheelButton);
+	ADDFN(CWheelHotSpot);
+	ADDFN(CWheelSpin);
 	ADDFN(CParrotLobbyController);
 	ADDFN(CParrotLobbyLinkUpdater);
 	ADDFN(CParrotLobbyObject);
@@ -672,6 +801,13 @@ void CSaveableObject::initClassList() {
 	ADDFN(CIconNavUp);
 	ADDFN(CKeybrdButt);
 	ADDFN(CMoveObjectButton);
+	ADDFN(CMusicControl);
+	ADDFN(CMusicSlider);
+	ADDFN(CMusicSliderPitch);
+	ADDFN(CMusicSliderSpeed);
+	ADDFN(CMusicSwitch);
+	ADDFN(CMusicSwitchInversion);
+	ADDFN(CMusicSwitchReverse);
 	ADDFN(CPetModeOff);
 	ADDFN(CPetModeOn);
 	ADDFN(CPetModePanel);
@@ -887,6 +1023,14 @@ void CSaveableObject::initClassList() {
 	ADDFN(CTitania);
 
 	ADDFN(CAutoMusicPlayer);
+	ADDFN(CAutoMusicPlayerBase);
+	ADDFN(CAutoSoundPlayer);
+	ADDFN(CBackgroundSoundMaker);
+	ADDFN(CMusicPlayer);
+	ADDFN(CSeasonalMusicPlayer);
+	ADDFN(CAutoMusicPlayer);
+	ADDFN(CTitaniaSpeech);
+	ADDFN(CTriggerAutoMusicPlayer);
 }
 
 void CSaveableObject::freeClassList() {
diff --git a/engines/titanic/game/arb_background.cpp b/engines/titanic/game/arb_background.cpp
new file mode 100644
index 0000000..54e9c17
--- /dev/null
+++ b/engines/titanic/game/arb_background.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/arb_background.h"
+
+namespace Titanic {
+
+CArbBackground::CArbBackground() : CBackground(),
+	_fieldE0(0), _fieldE4(61), _fieldE8(62), _fieldEC(118) {
+}
+
+void CArbBackground::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CArbBackground::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/arb_background.h b/engines/titanic/game/arb_background.h
new file mode 100644
index 0000000..e443c4b
--- /dev/null
+++ b/engines/titanic/game/arb_background.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ARB_BACKGROUND_H
+#define TITANIC_ARB_BACKGROUND_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CArbBackground : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+public:
+	CArbBackground();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CArbBackground"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ARB_BACKGROUND_H */
diff --git a/engines/titanic/game/arboretum_gate.cpp b/engines/titanic/game/arboretum_gate.cpp
new file mode 100644
index 0000000..3f13676
--- /dev/null
+++ b/engines/titanic/game/arboretum_gate.cpp
@@ -0,0 +1,136 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/arboretum_gate.h"
+
+namespace Titanic {
+
+int CArboretumGate::_v1;
+int CArboretumGate::_v2;
+int CArboretumGate::_v3;
+
+CArboretumGate::CArboretumGate() : CBackground() {
+	_string1 = "NULL";
+	_string2 = "NULL";
+	_fieldE0 = 0;
+	_fieldF0 = 0;
+	_fieldF4 = 244;
+	_fieldF8 = 304;
+	_fieldFC = 122;
+	_field100 = 182;
+	_field104 = 183;
+	_field108 = 243;
+	_field10C = 665;
+	_field110 = 724;
+	_field114 = 61;
+	_field118 = 121;
+	_field11C = 0;
+	_field120 = 60;
+	_field124 = 485;
+	_field128 = 544;
+	_field12C = 425;
+	_field130 = 484;
+	_field134 = 545;
+	_field138 = 604;
+	_field13C = 605;
+	_field140 = 664;
+	_field144 = 305;
+	_field148 = 364;
+	_field14C = 365;
+	_field150 = 424;
+}
+
+void CArboretumGate::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+	file->writeNumberLine(_v3, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_fieldF4, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_fieldFC, indent);
+	file->writeNumberLine(_field100, indent);
+	file->writeNumberLine(_field104, indent);
+	file->writeNumberLine(_field108, indent);
+	file->writeNumberLine(_field10C, indent);
+	file->writeNumberLine(_field110, indent);
+	file->writeNumberLine(_field114, indent);
+	file->writeNumberLine(_field118, indent);
+	file->writeNumberLine(_field11C, indent);
+	file->writeNumberLine(_field120, indent);
+	file->writeNumberLine(_field124, indent);
+	file->writeNumberLine(_field128, indent);
+	file->writeNumberLine(_field12C, indent);
+	file->writeNumberLine(_field130, indent);
+	file->writeNumberLine(_field134, indent);
+	file->writeNumberLine(_field138, indent);
+	file->writeNumberLine(_field13C, indent);
+	file->writeNumberLine(_field140, indent);
+	file->writeNumberLine(_field144, indent);
+	file->writeNumberLine(_field148, indent);
+	file->writeNumberLine(_field14C, indent);
+	file->writeNumberLine(_field150, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CArboretumGate::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+	_v3 = file->readNumber();
+	_string1 = file->readString();
+	_fieldF0 = file->readNumber();
+	_fieldF4 = file->readNumber();
+	_fieldF8 = file->readNumber();
+	_fieldFC = file->readNumber();
+	_field100 = file->readNumber();
+	_field104 = file->readNumber();
+	_field108 = file->readNumber();
+	_field10C = file->readNumber();
+	_field110 = file->readNumber();
+	_field114 = file->readNumber();
+	_field118 = file->readNumber();
+	_field11C = file->readNumber();
+	_field120 = file->readNumber();
+	_field124 = file->readNumber();
+	_field128 = file->readNumber();
+	_field12C = file->readNumber();
+	_field130 = file->readNumber();
+	_field134 = file->readNumber();
+	_field138 = file->readNumber();
+	_field13C = file->readNumber();
+	_field140 = file->readNumber();
+	_field144 = file->readNumber();
+	_field148 = file->readNumber();
+	_field14C = file->readNumber();
+	_field150 = file->readNumber();
+	_string2 = file->readString();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
new file mode 100644
index 0000000..8cbe49b
--- /dev/null
+++ b/engines/titanic/game/arboretum_gate.h
@@ -0,0 +1,87 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ARBORETUM_GATE_H
+#define TITANIC_ARBORETUM_GATE_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CArboretumGate : public CBackground {
+public:
+	static int _v1;
+	static int _v2;
+	static int _v3;
+public:
+	int _fieldE0;
+	CString _string1;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+	int _fieldF4;
+	int _fieldF8;
+	int _fieldFC;
+	int _field100;
+	int _field104;
+	int _field108;
+	int _field10C;
+	int _field110;
+	int _field114;
+	int _field118;
+	int _field11C;
+	int _field120;
+	int _field124;
+	int _field128;
+	int _field12C;
+	int _field130;
+	int _field134;
+	int _field138;
+	int _field13C;
+	int _field140;
+	int _field144;
+	int _field148;
+	int _field14C;
+	int _field150;
+	CString _string2;
+public:
+	CArboretumGate();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CArboretumGate"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ARBORETUM_GATE_H */
diff --git a/engines/titanic/game/auto_animate.cpp b/engines/titanic/game/auto_animate.cpp
new file mode 100644
index 0000000..bbaeebf
--- /dev/null
+++ b/engines/titanic/game/auto_animate.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/auto_animate.h"
+
+namespace Titanic {
+
+void CAutoAnimate::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	CBackground::save(file, indent);
+}
+
+void CAutoAnimate::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/auto_animate.h b/engines/titanic/game/auto_animate.h
new file mode 100644
index 0000000..2afb85b
--- /dev/null
+++ b/engines/titanic/game/auto_animate.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_ANIMATE_H
+#define TITANIC_AUTO_ANIMATE_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CAutoAnimate : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+public:
+	CAutoAnimate() : CBackground(), _fieldE0(1), _fieldE4(1), _fieldE8(0) {}
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoAnimate"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUTO_ANIMATE_H */
diff --git a/engines/titanic/game/bomb.cpp b/engines/titanic/game/bomb.cpp
new file mode 100644
index 0000000..108376e
--- /dev/null
+++ b/engines/titanic/game/bomb.cpp
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/bomb.h"
+
+namespace Titanic {
+
+CBomb::CBomb() : CBackground() {
+	_fieldE0 = 0;
+	_fieldE4 = 0;
+	_fieldE8 = 17;
+	_fieldEC = 9;
+	_fieldF0 = 0;
+	_fieldF4 = 999;
+	_fieldF8 = 0;
+	_fieldFC = 0;
+	_field100 = 0;
+	_field104 = 60;
+}
+
+void CBomb::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_fieldF4, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_fieldFC, indent);
+	file->writeNumberLine(_field100, indent);
+	file->writeNumberLine(_field104, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CBomb::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_fieldF0 = file->readNumber();
+	_fieldF4 = file->readNumber();
+	_fieldF8 = file->readNumber();
+	_fieldFC = file->readNumber();
+	_field100 = file->readNumber();
+	_field104 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/bomb.h b/engines/titanic/game/bomb.h
new file mode 100644
index 0000000..a7294f4
--- /dev/null
+++ b/engines/titanic/game/bomb.h
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BOMB_H
+#define TITANIC_BOMB_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CBomb : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+	int _fieldF4;
+	int _fieldF8;
+	int _fieldFC;
+	int _field100;
+	int _field104;
+public:
+	CBomb();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBomb"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BOMB_H */
diff --git a/engines/titanic/game/bridge_view.cpp b/engines/titanic/game/bridge_view.cpp
new file mode 100644
index 0000000..8afca38
--- /dev/null
+++ b/engines/titanic/game/bridge_view.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/bridge_view.h"
+
+namespace Titanic {
+
+void CBridgeView::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	CBackground::save(file, indent);
+}
+
+void CBridgeView::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/bridge_view.h b/engines/titanic/game/bridge_view.h
new file mode 100644
index 0000000..7a765cf
--- /dev/null
+++ b/engines/titanic/game/bridge_view.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BRIDGE_VIEW_H
+#define TITANIC_BRIDGE_VIEW_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CBridgeView : public CBackground {
+public:
+	int _fieldE0;
+public:
+	CBridgeView() : CBackground(), _fieldE0(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBridgeView"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BRIDGE_VIEW_H */
diff --git a/engines/titanic/game/broken_pell_base.cpp b/engines/titanic/game/broken_pell_base.cpp
new file mode 100644
index 0000000..9e2a974
--- /dev/null
+++ b/engines/titanic/game/broken_pell_base.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/broken_pell_base.h"
+
+namespace Titanic {
+
+void CBrokenPellBase::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	CBackground::save(file, indent);
+}
+
+void CBrokenPellBase::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/broken_pell_base.h b/engines/titanic/game/broken_pell_base.h
new file mode 100644
index 0000000..fa53af3
--- /dev/null
+++ b/engines/titanic/game/broken_pell_base.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BROKEN_PELL_BASE_H
+#define TITANIC_BROKEN_PELL_BASE_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CBrokenPellBase : public CBackground {
+public:
+	int _fieldE0;
+public:
+	CBrokenPellBase() : CBackground(), _fieldE0(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBrokenPellBase"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BROKEN_PELL_BASE_H */
diff --git a/engines/titanic/game/cage.cpp b/engines/titanic/game/cage.cpp
new file mode 100644
index 0000000..480944f
--- /dev/null
+++ b/engines/titanic/game/cage.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/cage.h"
+
+namespace Titanic {
+
+int CCage::_v1;
+int CCage::_v2;
+
+void CCage::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CCage::load(SimpleFile *file) {
+	file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/cage.h b/engines/titanic/game/cage.h
new file mode 100644
index 0000000..4c097f3
--- /dev/null
+++ b/engines/titanic/game/cage.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CAGE_H
+#define TITANIC_CAGE_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CCage : public CBackground {
+public:
+	static int _v1;
+	static int _v2;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCage"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CAGE_H */
diff --git a/engines/titanic/game/captains_wheel.cpp b/engines/titanic/game/captains_wheel.cpp
new file mode 100644
index 0000000..b4e31fd
--- /dev/null
+++ b/engines/titanic/game/captains_wheel.cpp
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/captains_wheel.h"
+
+namespace Titanic {
+
+CCaptainsWheel::CCaptainsWheel() : CBackground(),
+	_fieldE0(0), _fieldE4(0), _fieldE8(0), _fieldEC(0),
+	_fieldF0(0), _fieldF4(0) {
+}
+
+void CCaptainsWheel::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_fieldF4, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CCaptainsWheel::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_fieldF0 = file->readNumber();
+	_fieldF4 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/captains_wheel.h b/engines/titanic/game/captains_wheel.h
new file mode 100644
index 0000000..3d35b9b
--- /dev/null
+++ b/engines/titanic/game/captains_wheel.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CAPTAINS_WHEEL_H
+#define TITANIC_CAPTAINS_WHEEL_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CCaptainsWheel : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+	int _fieldF4;
+public:
+	CCaptainsWheel();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCaptainsWheel"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CAPTAINS_WHEEL_H */
diff --git a/engines/titanic/game/cell_point_button.cpp b/engines/titanic/game/cell_point_button.cpp
new file mode 100644
index 0000000..45ddad8
--- /dev/null
+++ b/engines/titanic/game/cell_point_button.cpp
@@ -0,0 +1,79 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/cell_point_button.h"
+
+namespace Titanic {
+
+CCellPointButton::CCellPointButton() : CBackground() {
+	_fieldE0 = 0;
+	_fieldE4 = 0;
+	_fieldE8 = 0;
+	_fieldEC = 0;
+	_fieldF0 = 0;
+	_fieldF4 = 0;
+	_fieldF8 = 0;
+	_fieldFC = 0;
+	_field100 = 0;
+	_field104 = 0;
+	_field108 = 1;
+}
+
+void CCellPointButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_fieldF4, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_fieldFC, indent);
+	file->writeNumberLine(_field100, indent);
+	file->writeNumberLine(_field104, indent);
+	file->writeNumberLine(_field108, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeNumberLine(_field118, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CCellPointButton::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_fieldF0 = file->readNumber();
+	_fieldF4 = file->readNumber();
+	_fieldF8 = file->readNumber();
+	_fieldFC = file->readNumber();
+	_field100 = file->readNumber();
+	_field104 = file->readNumber();
+	_field108 = file->readNumber();
+	_string3 = file->readString();
+	_field118 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/cell_point_button.h b/engines/titanic/game/cell_point_button.h
new file mode 100644
index 0000000..a16e7ae
--- /dev/null
+++ b/engines/titanic/game/cell_point_button.h
@@ -0,0 +1,66 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CELL_POINT_BUTTON_H
+#define TITANIC_CELL_POINT_BUTTON_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CCellPointButton : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+	int _fieldF4;
+	int _fieldF8;
+	int _fieldFC;
+	int _field100;
+	int _field104;
+	int _field108;
+	CString _string3;
+	int _field118;
+public:
+	CCellPointButton();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCellPointButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CELL_POINT_BUTTON_H */
diff --git a/engines/titanic/game/chicken_dispensor.cpp b/engines/titanic/game/chicken_dispensor.cpp
new file mode 100644
index 0000000..d3660bd
--- /dev/null
+++ b/engines/titanic/game/chicken_dispensor.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/chicken_dispensor.h"
+
+namespace Titanic {
+
+CChickenDispensor::CChickenDispensor() : CBackground(),
+	_fieldE0(0), _fieldE4(0), _fieldE8(0) {
+}
+
+void CChickenDispensor::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	CBackground::save(file, indent);
+}
+
+void CChickenDispensor::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/chicken_dispensor.h b/engines/titanic/game/chicken_dispensor.h
new file mode 100644
index 0000000..10fcba1
--- /dev/null
+++ b/engines/titanic/game/chicken_dispensor.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHICKEN_DISPENSOR_H
+#define TITANIC_CHICKEN_DISPENSOR_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CChickenDispensor : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+public:
+	CChickenDispensor();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNoNutBowl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CHICKEN_DISPENSOR_H */
diff --git a/engines/titanic/game/close_broken_pel.cpp b/engines/titanic/game/close_broken_pel.cpp
new file mode 100644
index 0000000..9cc4eb6
--- /dev/null
+++ b/engines/titanic/game/close_broken_pel.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/close_broken_pel.h"
+
+namespace Titanic {
+
+void CCloseBrokenPel::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string3, indent);
+	CBackground::save(file, indent);
+}
+
+void CCloseBrokenPel::load(SimpleFile *file) {
+	file->readNumber();
+	_string3 = file->readString();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/close_broken_pel.h b/engines/titanic/game/close_broken_pel.h
new file mode 100644
index 0000000..ea174a4
--- /dev/null
+++ b/engines/titanic/game/close_broken_pel.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CLOSE_BROKEN_PEL_H
+#define TITANIC_CLOSE_BROKEN_PEL_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CCloseBrokenPel : public CBackground {
+public:
+	CString _string3;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CCloseBrokenPel"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CLOSE_BROKEN_PEL_H */
diff --git a/engines/titanic/game/computer.cpp b/engines/titanic/game/computer.cpp
new file mode 100644
index 0000000..a282921
--- /dev/null
+++ b/engines/titanic/game/computer.cpp
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/computer.h"
+
+namespace Titanic {
+
+void CComputer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	CBackground::save(file, indent);
+}
+
+void CComputer::load(SimpleFile *file) {
+	file->readNumber();
+	_string3 = file->readString();
+	_fieldEC = file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/computer.h b/engines/titanic/game/computer.h
new file mode 100644
index 0000000..074d17c
--- /dev/null
+++ b/engines/titanic/game/computer.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_COMPUTER_H
+#define TITANIC_COMPUTER_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CComputer : public CBackground {
+public:
+	CString _string3;
+	int _fieldEC;
+public:
+	CComputer() : CBackground(), _string3("None"), _fieldEC(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CComputer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_COMPUTER_H */
diff --git a/engines/titanic/game/eject_phonograph_button.cpp b/engines/titanic/game/eject_phonograph_button.cpp
new file mode 100644
index 0000000..bd444f9
--- /dev/null
+++ b/engines/titanic/game/eject_phonograph_button.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/eject_phonograph_button.h"
+
+namespace Titanic {
+
+void CEjectPhonographButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeQuotedLine(_string4, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CEjectPhonographButton::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_string3 = file->readString();
+	_string4 = file->readString();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/eject_phonograph_button.h b/engines/titanic/game/eject_phonograph_button.h
new file mode 100644
index 0000000..e37a061
--- /dev/null
+++ b/engines/titanic/game/eject_phonograph_button.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EJECT_PHONOGRAPH_BUTTON_H
+#define TITANIC_EJECT_PHONOGRAPH_BUTTON_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CEjectPhonographButton : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+	CString _string3;
+	CString _string4;
+public:
+	CEjectPhonographButton() : CBackground(), _fieldE0(0), _fieldE4(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEjectPhonographButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EJECT_PHONOGRAPH_BUTTON_H */
diff --git a/engines/titanic/game/emma_control.cpp b/engines/titanic/game/emma_control.cpp
new file mode 100644
index 0000000..ce3b325
--- /dev/null
+++ b/engines/titanic/game/emma_control.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/emma_control.h"
+
+namespace Titanic {
+
+void CEmmaControl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_wavFile1, indent);
+	file->writeQuotedLine(_wavFile2, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CEmmaControl::load(SimpleFile *file) {
+	file->readNumber();
+	_wavFile1 = file->readString();
+	_wavFile2 = file->readString();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/emma_control.h b/engines/titanic/game/emma_control.h
new file mode 100644
index 0000000..f61d237
--- /dev/null
+++ b/engines/titanic/game/emma_control.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EMMA_CONTROL_H
+#define TITANIC_EMMA_CONTROL_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CEmmaControl : public CBackground {
+public:
+	CString _wavFile1, _wavFile2;
+public:
+	CEmmaControl() : CBackground(), _wavFile1("b#39.wav"), _wavFile2("b#38.wav") {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEmmaControl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EMMA_CONTROL_H */
diff --git a/engines/titanic/game/empty_nut_bowl.h b/engines/titanic/game/empty_nut_bowl.h
index c1c553a..57668ca 100644
--- a/engines/titanic/game/empty_nut_bowl.h
+++ b/engines/titanic/game/empty_nut_bowl.h
@@ -51,4 +51,4 @@ public:
 
 } // End of namespace Titanic
 
-#endif /* TITANIC_NO_NUT_BOWL_H */
+#endif /* TITANIC_EMPTY_NUT_BOWL_H */
diff --git a/engines/titanic/game/games_console.cpp b/engines/titanic/game/games_console.cpp
new file mode 100644
index 0000000..13a7260
--- /dev/null
+++ b/engines/titanic/game/games_console.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/games_console.h"
+
+namespace Titanic {
+
+void CGamesConsole::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	CBackground::save(file, indent);
+}
+
+void CGamesConsole::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/games_console.h b/engines/titanic/game/games_console.h
new file mode 100644
index 0000000..4caeda8
--- /dev/null
+++ b/engines/titanic/game/games_console.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GAMES_CONSOLE_H
+#define TITANIC_GAMES_CONSOLE_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CGamesConsole : public CBackground {
+public:
+	int _fieldE0;
+public:
+	CGamesConsole() : CBackground(), _fieldE0(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGamesConsole"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GAMES_CONSOLE_H */
diff --git a/engines/titanic/game/head_smash_event.cpp b/engines/titanic/game/head_smash_event.cpp
new file mode 100644
index 0000000..a3d3395
--- /dev/null
+++ b/engines/titanic/game/head_smash_event.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/head_smash_event.h"
+
+namespace Titanic {
+
+void CHeadSmashEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CBackground::save(file, indent);
+}
+
+void CHeadSmashEvent::load(SimpleFile *file) {
+	file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/head_smash_event.h b/engines/titanic/game/head_smash_event.h
new file mode 100644
index 0000000..4032098
--- /dev/null
+++ b/engines/titanic/game/head_smash_event.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_HEAD_SMASH_EVENT_H
+#define TITANIC_HEAD_SMASH_EVENT_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CHeadSmashEvent : public CBackground {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CHeadSmashEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HEAD_SMASH_EVENT_H */
diff --git a/engines/titanic/game/head_smash_lever.cpp b/engines/titanic/game/head_smash_lever.cpp
new file mode 100644
index 0000000..23ca96d
--- /dev/null
+++ b/engines/titanic/game/head_smash_lever.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/head_smash_lever.h"
+
+namespace Titanic {
+
+CHeadSmashLever::CHeadSmashLever() : CBackground(),
+		_fieldE0(0), _fieldE4(0), _fieldE8(0) {}
+
+void CHeadSmashLever::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CHeadSmashLever::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/head_smash_lever.h b/engines/titanic/game/head_smash_lever.h
new file mode 100644
index 0000000..7268cb8
--- /dev/null
+++ b/engines/titanic/game/head_smash_lever.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_HEAD_SMASH_LEVER_H
+#define TITANIC_HEAD_SMASH_LEVER_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CHeadSmashLever : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+public:
+	CHeadSmashLever();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CHeadSmashLever"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HEAD_SMASH_LEVER_H */
diff --git a/engines/titanic/game/lemon_dispensor.cpp b/engines/titanic/game/lemon_dispensor.cpp
new file mode 100644
index 0000000..3cf7cc9
--- /dev/null
+++ b/engines/titanic/game/lemon_dispensor.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/lemon_dispensor.h"
+
+namespace Titanic {
+
+CLemonDispensor::CLemonDispensor() : CBackground(),
+	_fieldE0(0), _fieldE4(9), _fieldE8(15), _fieldEC(0) {
+}
+
+void CLemonDispensor::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CLemonDispensor::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/lemon_dispensor.h b/engines/titanic/game/lemon_dispensor.h
new file mode 100644
index 0000000..7f3164f
--- /dev/null
+++ b/engines/titanic/game/lemon_dispensor.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LEMON_DISPENSOR_H
+#define TITANIC_LEMON_DISPENSOR_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CLemonDispensor : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+public:
+	CLemonDispensor();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLemonDispensor"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LEMON_DISPENSOR_H */
diff --git a/engines/titanic/game/musical_instrument.cpp b/engines/titanic/game/musical_instrument.cpp
new file mode 100644
index 0000000..6695104
--- /dev/null
+++ b/engines/titanic/game/musical_instrument.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/musical_instrument.h"
+
+namespace Titanic {
+
+void CMusicalInstrument::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CBackground::save(file, indent);
+}
+
+void CMusicalInstrument::load(SimpleFile *file) {
+	file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/musical_instrument.h b/engines/titanic/game/musical_instrument.h
new file mode 100644
index 0000000..8eafca5
--- /dev/null
+++ b/engines/titanic/game/musical_instrument.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSICAL_INSTRUMENT_H
+#define TITANIC_MUSICAL_INSTRUMENT_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CMusicalInstrument : public CBackground {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMusicalInstrument"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSICAL_INSTRUMENT_H */
diff --git a/engines/titanic/game/play_music_button.cpp b/engines/titanic/game/play_music_button.cpp
new file mode 100644
index 0000000..49e128c
--- /dev/null
+++ b/engines/titanic/game/play_music_button.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/play_music_button.h"
+
+namespace Titanic {
+
+void CPlayMusicButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CPlayMusicButton::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/play_music_button.h b/engines/titanic/game/play_music_button.h
new file mode 100644
index 0000000..29a13a6
--- /dev/null
+++ b/engines/titanic/game/play_music_button.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PLAY_MUSIC_BUTTON_H
+#define TITANIC_PLAY_MUSIC_BUTTON_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CPlayMusicButton : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+public:
+	CPlayMusicButton() : CBackground(), _fieldE0(0), _fieldE4(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPlayMusicButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PLAY_MUSIC_BUTTON_H */
diff --git a/engines/titanic/game/play_on_act.cpp b/engines/titanic/game/play_on_act.cpp
new file mode 100644
index 0000000..b0236cd
--- /dev/null
+++ b/engines/titanic/game/play_on_act.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/play_on_act.h"
+
+namespace Titanic {
+
+void CPlayOnAct::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CBackground::save(file, indent);
+}
+
+void CPlayOnAct::load(SimpleFile *file) {
+	file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/play_on_act.h b/engines/titanic/game/play_on_act.h
new file mode 100644
index 0000000..b8fdb2a
--- /dev/null
+++ b/engines/titanic/game/play_on_act.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PLAY_ON_ACT_H
+#define TITANIC_PLAY_ON_ACT_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CPlayOnAct : public CBackground {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPlayOnAct"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PLAY_ON_ACT_H */
diff --git a/engines/titanic/game/record_phonograph_button.cpp b/engines/titanic/game/record_phonograph_button.cpp
new file mode 100644
index 0000000..896e9d2
--- /dev/null
+++ b/engines/titanic/game/record_phonograph_button.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/record_phonograph_button.h"
+
+namespace Titanic {
+
+void CRecordPhonographButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CBackground::save(file, indent);
+}
+
+void CRecordPhonographButton::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/record_phonograph_button.h b/engines/titanic/game/record_phonograph_button.h
new file mode 100644
index 0000000..4b2c6c8
--- /dev/null
+++ b/engines/titanic/game/record_phonograph_button.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RECORD_PHONOGRAPH_BUTTON_H
+#define TITANIC_RECORD_PHONOGRAPH_BUTTON_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CRecordPhonographButton : public CBackground {
+public:
+	int _value;
+public:
+	CRecordPhonographButton() : CBackground(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CRecordPhonographButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RECORD_PHONOGRAPH_BUTTON_H */
diff --git a/engines/titanic/game/replacement_ear.cpp b/engines/titanic/game/replacement_ear.cpp
new file mode 100644
index 0000000..4926932
--- /dev/null
+++ b/engines/titanic/game/replacement_ear.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/replacement_ear.h"
+
+namespace Titanic {
+
+void CReplacementEar::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CBackground::save(file, indent);
+}
+
+void CReplacementEar::load(SimpleFile *file) {
+	file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/replacement_ear.h b/engines/titanic/game/replacement_ear.h
new file mode 100644
index 0000000..9c4a8e1
--- /dev/null
+++ b/engines/titanic/game/replacement_ear.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_REPLACEMENT_EAR_H
+#define TITANIC_REPLACEMENT_EAR_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CReplacementEar : public CBackground {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNoNutBowl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_REPLACEMENT_EAR_H */
diff --git a/engines/titanic/game/sauce_dispensor.cpp b/engines/titanic/game/sauce_dispensor.cpp
new file mode 100644
index 0000000..4982df6
--- /dev/null
+++ b/engines/titanic/game/sauce_dispensor.cpp
@@ -0,0 +1,66 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sauce_dispensor.h"
+
+namespace Titanic {
+
+CSauceDispensor::CSauceDispensor() : CBackground() {
+	_fieldEC = 0;
+	_fieldF0 = 0;
+	_fieldF4 = 0;
+	_fieldF8 = 0;
+	_fieldFC = 0;
+	_field100 = 0;
+	_field104 = 0;
+	_field108 = 0;
+}
+
+void CSauceDispensor::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_fieldF4, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_fieldFC, indent);
+	file->writeNumberLine(_field100, indent);
+	file->writeNumberLine(_field104, indent);
+	file->writeNumberLine(_field108, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CSauceDispensor::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldEC = file->readNumber();
+	_fieldF0 = file->readNumber();
+	_fieldF4 = file->readNumber();
+	_fieldF8 = file->readNumber();
+	_fieldFC = file->readNumber();
+	_field100 = file->readNumber();
+	_field104 = file->readNumber();
+	_field108 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sauce_dispensor.h b/engines/titanic/game/sauce_dispensor.h
new file mode 100644
index 0000000..791839d
--- /dev/null
+++ b/engines/titanic/game/sauce_dispensor.h
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SAUCE_DISPENSOR_H
+#define TITANIC_SAUCE_DISPENSOR_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CSauceDispensor : public CBackground {
+public:
+	CString _string3;
+	int _fieldEC;
+	int _fieldF0;
+	int _fieldF4;
+	int _fieldF8;
+	int _fieldFC;
+	int _field100;
+	int _field104;
+	int _field108;
+public:
+	CSauceDispensor();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSauceDispensor"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SAUCE_DISPENSOR_H */
diff --git a/engines/titanic/game/season_background.cpp b/engines/titanic/game/season_background.cpp
new file mode 100644
index 0000000..a4de590
--- /dev/null
+++ b/engines/titanic/game/season_background.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/season_background.h"
+
+namespace Titanic {
+
+CSeasonBackground::CSeasonBackground() : CBackground(),
+	_fieldE0(0), _fieldE4(0), _fieldE8(46), _fieldEC(0) {
+}
+
+void CSeasonBackground::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CSeasonBackground::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/season_background.h b/engines/titanic/game/season_background.h
new file mode 100644
index 0000000..2899853
--- /dev/null
+++ b/engines/titanic/game/season_background.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SEASON_BACKGROUND_H
+#define TITANIC_SEASON_BACKGROUND_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CSeasonBackground : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+public:
+	CSeasonBackground();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSeasonBackground"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SEASON_BACKGROUND_H */
diff --git a/engines/titanic/game/season_barrel.cpp b/engines/titanic/game/season_barrel.cpp
new file mode 100644
index 0000000..8aa7b22
--- /dev/null
+++ b/engines/titanic/game/season_barrel.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/season_barrel.h"
+
+namespace Titanic {
+
+void CSeasonBarrel::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CSeasonBarrel::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/season_barrel.h b/engines/titanic/game/season_barrel.h
new file mode 100644
index 0000000..af22c14
--- /dev/null
+++ b/engines/titanic/game/season_barrel.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SEASON_BARREL_H
+#define TITANIC_SEASON_BARREL_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CSeasonBarrel : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+public:
+	CSeasonBarrel() : CBackground(), _fieldE0(0), _fieldE4(7) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSeasonBarrel"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SEASON_BARREL_H */
diff --git a/engines/titanic/game/seasonal_adjustment.cpp b/engines/titanic/game/seasonal_adjustment.cpp
new file mode 100644
index 0000000..c0c7b2f
--- /dev/null
+++ b/engines/titanic/game/seasonal_adjustment.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/seasonal_adjustment.h"
+
+namespace Titanic {
+
+void CSeasonalAdjustment::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CSeasonalAdjustment::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/seasonal_adjustment.h b/engines/titanic/game/seasonal_adjustment.h
new file mode 100644
index 0000000..2db9403
--- /dev/null
+++ b/engines/titanic/game/seasonal_adjustment.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SEASONAL_ADJUSTMENT_H
+#define TITANIC_SEASONAL_ADJUSTMENT_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CSeasonalAdjustment : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+public:
+	CSeasonalAdjustment() : CBackground(), _fieldE0(0), _fieldE4(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSeasonalAdjustment"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SEASONAL_ADJUSTMENT_H */
diff --git a/engines/titanic/game/service_elevator_window.cpp b/engines/titanic/game/service_elevator_window.cpp
new file mode 100644
index 0000000..1371fb7
--- /dev/null
+++ b/engines/titanic/game/service_elevator_window.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/service_elevator_window.h"
+
+namespace Titanic {
+
+CServiceElevatorWindow::CServiceElevatorWindow() : CBackground(),
+	_fieldE0(0), _fieldE4(0), _fieldE8(0), _fieldEC(0) {
+}
+
+void CServiceElevatorWindow::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CServiceElevatorWindow::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/service_elevator_window.h b/engines/titanic/game/service_elevator_window.h
new file mode 100644
index 0000000..493776c
--- /dev/null
+++ b/engines/titanic/game/service_elevator_window.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SERVICE_ELEVATOR_WINDOW_H
+#define TITANIC_SERVICE_ELEVATOR_WINDOW_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CServiceElevatorWindow : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+public:
+	CServiceElevatorWindow();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CServiceElevatorWindow"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SERVICE_ELEVATOR_WINDOW_H */
diff --git a/engines/titanic/game/ship_setting.cpp b/engines/titanic/game/ship_setting.cpp
new file mode 100644
index 0000000..d53c528
--- /dev/null
+++ b/engines/titanic/game/ship_setting.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/ship_setting.h"
+
+namespace Titanic {
+
+CShipSetting::CShipSetting() : CBackground(),
+	_string4("NULL"), _string5("NULL") {
+}
+
+void CShipSetting::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writePoint(_pos1, indent);
+	file->writeQuotedLine(_string4, indent);
+	file->writeQuotedLine(_string5, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CShipSetting::load(SimpleFile *file) {
+	file->readNumber();
+	_string3 = file->readString();
+	_pos1 = file->readPoint();
+	_string4 = file->readString();
+	_string5 = file->readString();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/ship_setting.h b/engines/titanic/game/ship_setting.h
new file mode 100644
index 0000000..8e57e53
--- /dev/null
+++ b/engines/titanic/game/ship_setting.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SHIP_SETTING_H
+#define TITANIC_SHIP_SETTING_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CShipSetting : public CBackground {
+public:
+	CString _string3;
+	Common::Point _pos1;
+	CString _string4;
+	CString _string5;
+public:
+	CShipSetting();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CShipSetting"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SHIP_SETTING_H */
diff --git a/engines/titanic/game/speech_dispensor.cpp b/engines/titanic/game/speech_dispensor.cpp
new file mode 100644
index 0000000..d8fc66b
--- /dev/null
+++ b/engines/titanic/game/speech_dispensor.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/speech_dispensor.h"
+
+namespace Titanic {
+
+void CSpeechDispensor::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CBackground::save(file, indent);
+}
+
+void CSpeechDispensor::load(SimpleFile *file) {
+	file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/speech_dispensor.h b/engines/titanic/game/speech_dispensor.h
new file mode 100644
index 0000000..857750d
--- /dev/null
+++ b/engines/titanic/game/speech_dispensor.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SPEECH_DISPENSOR_H
+#define TITANIC_SPEECH_DISPENSOR_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CSpeechDispensor : public CBackground {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSpeechDispensor"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SPEECH_DISPENSOR_H */
diff --git a/engines/titanic/game/stop_phonograph_button.cpp b/engines/titanic/game/stop_phonograph_button.cpp
new file mode 100644
index 0000000..7c4367a
--- /dev/null
+++ b/engines/titanic/game/stop_phonograph_button.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/stop_phonograph_button.h"
+
+namespace Titanic {
+
+void CStopPhonographButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CBackground::save(file, indent);
+}
+
+void CStopPhonographButton::load(SimpleFile *file) {
+	file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/stop_phonograph_button.h b/engines/titanic/game/stop_phonograph_button.h
new file mode 100644
index 0000000..945345c
--- /dev/null
+++ b/engines/titanic/game/stop_phonograph_button.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STOP_PHONOGRAPH_BUTTON_H
+#define TITANIC_STOP_PHONOGRAPH_BUTTON_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CStopPhonographButton : public CBackground {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CStopPhonographButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STOP_PHONOGRAPH_BUTTON_H */
diff --git a/engines/titanic/game/third_class_canal.cpp b/engines/titanic/game/third_class_canal.cpp
new file mode 100644
index 0000000..a25d5f2
--- /dev/null
+++ b/engines/titanic/game/third_class_canal.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/third_class_canal.h"
+
+namespace Titanic {
+
+void CThirdClassCanal::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CBackground::save(file, indent);
+}
+
+void CThirdClassCanal::load(SimpleFile *file) {
+	file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/third_class_canal.h b/engines/titanic/game/third_class_canal.h
new file mode 100644
index 0000000..4465cba
--- /dev/null
+++ b/engines/titanic/game/third_class_canal.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_THIRD_CLASS_CANAL_H
+#define TITANIC_THIRD_CLASS_CANAL_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CThirdClassCanal : public CBackground {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CThirdClassCanal"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_THIRD_CLASS_CANAL_H */
diff --git a/engines/titanic/game/wheel_button.cpp b/engines/titanic/game/wheel_button.cpp
new file mode 100644
index 0000000..0fad684
--- /dev/null
+++ b/engines/titanic/game/wheel_button.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/wheel_button.h"
+
+namespace Titanic {
+
+CWheelButton::CWheelButton() : CBackground(),
+	_fieldE0(0), _fieldE4(0), _fieldE8(0) {
+}
+
+void CWheelButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CWheelButton::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/wheel_button.h b/engines/titanic/game/wheel_button.h
new file mode 100644
index 0000000..b1721eb
--- /dev/null
+++ b/engines/titanic/game/wheel_button.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_WHEEL_BUTTON_H
+#define TITANIC_WHEEL_BUTTON_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CWheelButton : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+public:
+	CWheelButton();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CWheelButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_WHEEL_BUTTON_H */
diff --git a/engines/titanic/game/wheel_hotspot.cpp b/engines/titanic/game/wheel_hotspot.cpp
new file mode 100644
index 0000000..8b05f45
--- /dev/null
+++ b/engines/titanic/game/wheel_hotspot.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/wheel_hotspot.h"
+
+namespace Titanic {
+
+void CWheelHotSpot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CWheelHotSpot::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/wheel_hotspot.h b/engines/titanic/game/wheel_hotspot.h
new file mode 100644
index 0000000..6887407
--- /dev/null
+++ b/engines/titanic/game/wheel_hotspot.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_WHEEL_HOTSPOT_H
+#define TITANIC_WHEEL_HOTSPOT_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CWheelHotSpot : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+public:
+	CWheelHotSpot() : CBackground(), _fieldE0(0), _fieldE4(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CWheelHotSpot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_WHEEL_HOTSPOT_H */
diff --git a/engines/titanic/game/wheel_spin.cpp b/engines/titanic/game/wheel_spin.cpp
new file mode 100644
index 0000000..7f16a4c
--- /dev/null
+++ b/engines/titanic/game/wheel_spin.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/wheel_spin.h"
+
+namespace Titanic {
+
+void CWheelSpin::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CBackground::save(file, indent);
+}
+
+void CWheelSpin::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/wheel_spin.h b/engines/titanic/game/wheel_spin.h
new file mode 100644
index 0000000..64006af
--- /dev/null
+++ b/engines/titanic/game/wheel_spin.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_WHEEL_SPIN_H
+#define TITANIC_WHEEL_SPIN_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CWheelSpin : public CBackground {
+public:
+	int _value;
+public:
+	CWheelSpin() : CBackground(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CWheelSpin"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_WHEEL_SPIN_H */
diff --git a/engines/titanic/gfx/music_control.cpp b/engines/titanic/gfx/music_control.cpp
new file mode 100644
index 0000000..5ca079f
--- /dev/null
+++ b/engines/titanic/gfx/music_control.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/music_control.h"
+
+namespace Titanic {
+
+CMusicControl::CMusicControl() : CBackground(),
+	_fieldE0(0), _fieldE4(0), _fieldE8(1), _fieldEC(1) {
+}
+
+void CMusicControl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CMusicControl::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/music_control.h b/engines/titanic/gfx/music_control.h
new file mode 100644
index 0000000..a6063f4
--- /dev/null
+++ b/engines/titanic/gfx/music_control.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSIC_CONTROL_H
+#define TITANIC_MUSIC_CONTROL_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CMusicControl : public CBackground {
+public:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+public:
+	CMusicControl();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMusicControl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_CONTROL_H */
diff --git a/engines/titanic/gfx/music_slider.h b/engines/titanic/gfx/music_slider.h
new file mode 100644
index 0000000..9116986
--- /dev/null
+++ b/engines/titanic/gfx/music_slider.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSIC_SLIDER_H
+#define TITANIC_MUSIC_SLIDER_H
+
+#include "titanic/gfx/music_control.h"
+
+namespace Titanic {
+
+class CMusicSlider : public CMusicControl {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMusicSlider"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const {
+		file->writeNumberLine(1, indent);
+		CMusicControl::save(file, indent);
+	}
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file) {
+		file->readNumber();
+		CMusicControl::load(file);
+	}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_SLIDER_H */
diff --git a/engines/titanic/gfx/music_slider_pitch.h b/engines/titanic/gfx/music_slider_pitch.h
new file mode 100644
index 0000000..ba2514b
--- /dev/null
+++ b/engines/titanic/gfx/music_slider_pitch.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSIC_SLIDER_PITCH_H
+#define TITANIC_MUSIC_SLIDER_PITCH_H
+
+#include "titanic/gfx/music_slider.h"
+
+namespace Titanic {
+
+class CMusicSliderPitch : public CMusicSlider {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMusicSliderPitch"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const {
+		file->writeNumberLine(1, indent);
+		CMusicSlider::save(file, indent);
+	}
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file) {
+		file->readNumber();
+		CMusicSlider::load(file);
+	}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_SLIDER_PITCH_H */
diff --git a/engines/titanic/gfx/music_slider_speed.h b/engines/titanic/gfx/music_slider_speed.h
new file mode 100644
index 0000000..fb3e7e1
--- /dev/null
+++ b/engines/titanic/gfx/music_slider_speed.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+#ifndef TITANIC_MUSIC_SLIDER_SPEED_H
+#define TITANIC_MUSIC_SLIDER_SPEED_H
+
+#include "titanic/gfx/music_slider.h"
+
+namespace Titanic {
+
+	class CMusicSliderSpeed : public CMusicSlider {
+	public:
+		/**
+		* Return the class name
+		*/
+		virtual const char *getClassName() const { return "CMusicSliderSpeed"; }
+
+		/**
+		* Save the data for the class to file
+		*/
+		virtual void save(SimpleFile *file, int indent) const {
+			file->writeNumberLine(1, indent);
+			CMusicSlider::save(file, indent);
+		}
+
+		/**
+		* Load the data for the class from file
+		*/
+		virtual void load(SimpleFile *file) {
+			file->readNumber();
+			CMusicSlider::load(file);
+		}
+	};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_SLIDER_SPEED_H */
diff --git a/engines/titanic/gfx/music_switch.h b/engines/titanic/gfx/music_switch.h
new file mode 100644
index 0000000..0f277c5
--- /dev/null
+++ b/engines/titanic/gfx/music_switch.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSIC_SWITCH_H
+#define TITANIC_MUSIC_SWITCH_H
+
+#include "titanic/gfx/music_control.h"
+
+namespace Titanic {
+
+class CMusicSwitch : public CMusicControl {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMusicSwitch"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const {
+		file->writeNumberLine(1, indent);
+		CMusicControl::save(file, indent);
+	}
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file) {
+		file->readNumber();
+		CMusicControl::load(file);
+	}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_SWITCH_H */
diff --git a/engines/titanic/gfx/music_switch_inversion.h b/engines/titanic/gfx/music_switch_inversion.h
new file mode 100644
index 0000000..2356248
--- /dev/null
+++ b/engines/titanic/gfx/music_switch_inversion.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSIC_SWITCH_INVERSION_H
+#define TITANIC_MUSIC_SWITCH_INVERSION_H
+
+#include "titanic/gfx/music_switch.h"
+
+namespace Titanic {
+
+class CMusicSwitchInversion : public CMusicSwitch {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMusicSwitchInversion"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const {
+		file->writeNumberLine(1, indent);
+		CMusicSwitch::save(file, indent);
+	}
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file) {
+		file->readNumber();
+		CMusicSwitch::load(file);
+	}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_SWITCH_INVERSION_H */
diff --git a/engines/titanic/gfx/music_switch_reverse.h b/engines/titanic/gfx/music_switch_reverse.h
new file mode 100644
index 0000000..5467ede
--- /dev/null
+++ b/engines/titanic/gfx/music_switch_reverse.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+#ifndef TITANIC_MUSIC_SWITCH_REVERSE_H
+#define TITANIC_MUSIC_SWITCH_REVERSE_H
+
+#include "titanic/gfx/music_switch.h"
+
+namespace Titanic {
+
+	class CMusicSwitchReverse : public CMusicSwitch {
+	public:
+		/**
+		 * Return the class name
+		 */
+		virtual const char *getClassName() const { return "CMusicSwitchReverse"; }
+
+		/**
+		 * Save the data for the class to file
+		 */
+		virtual void save(SimpleFile *file, int indent) const {
+			file->writeNumberLine(1, indent);
+			CMusicSwitch::save(file, indent);
+		}
+
+		/**
+		 * Load the data for the class from file
+		 */
+		virtual void load(SimpleFile *file) {
+			file->readNumber();
+			CMusicSwitch::load(file);
+		}
+	};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_SWITCH_REVERSE_H */
diff --git a/engines/titanic/gfx/music_voice_mute.h b/engines/titanic/gfx/music_voice_mute.h
new file mode 100644
index 0000000..2a2acde
--- /dev/null
+++ b/engines/titanic/gfx/music_voice_mute.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSIC_VOICE_MUTE_H
+#define TITANIC_MUSIC_VOICE_MUTE_H
+
+#include "titanic/gfx/music_control.h"
+
+namespace Titanic {
+
+class CMusicVoiceMute : public CMusicControl {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMusicVoiceMute"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const {
+		file->writeNumberLine(1, indent);
+		CMusicControl::save(file, indent);
+	}
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file) {
+		file->readNumber();
+		CMusicControl::load(file);
+	}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_VOICE_MUTE_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index a5a5db4..5894bf3 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -74,6 +74,10 @@ MODULE_OBJS := \
 	core/view_item.o \
 	game/announce.o \
 	game/annoy_barbot.o \
+	game/arb_background.o \
+	game/arboretum_gate.o \
+	game/auto_animate.o \
+	game/bomb.o \
 	game/bar_menu.o \
 	game/bar_menu_button.o \
 	game/bar_bell.o \
@@ -82,14 +86,22 @@ MODULE_OBJS := \
 	game/bowl_unlocker.o \
 	game/brain_slot.o \
 	game/bridge_door.o \
+	game/bridge_view.o \
+	game/broken_pell_base.o \
 	game/call_pellerator.o \
+	game/cage.o \
+	game/captains_wheel.o \
 	game/cdrom.o \
 	game/cdrom_computer.o \
 	game/cdrom_tray.o \
+	game/cell_point_button.o \
 	game/chev_code.o \
 	game/chev_panel.o \
 	game/chicken_cooler.o \
+	game/chicken_dispensor.o \
+	game/close_broken_pel.o \
 	game/cookie.o \
+	game/computer.o \
 	game/computer_screen.o \
 	game/credits.o \
 	game/credits_button.o \
@@ -99,7 +111,9 @@ MODULE_OBJS := \
 	game/doorbot_home_handler.o \
 	game/drawer.o \
 	game/ear_sweet_bowl.o \
+	game/eject_phonograph_button.o \
 	game/elevator_action_area.o \
+	game/emma_control.o \
 	game/empty_nut_bowl.o \
 	game/end_credit_text.o \
 	game/end_credits.o \
@@ -120,14 +134,18 @@ MODULE_OBJS := \
 	game/fan_increase.o \
 	game/fan_noises.o \
 	game/floor_indicator.o \
+	game/games_console.o \
 	game/get_lift_eye2.o \
 	game/glass_smasher.o \
 	game/gondolier_base.o \
 	game/hammer_clip.o \
 	game/head_slot.o \
+	game/head_smash_event.o \
+	game/head_smash_lever.o \
 	game/head_spinner.o \
 	game/idle_summoner.o \
 	game/leave_sec_class_state.o \
+	game/lemon_dispensor.o \
 	game/light.o \
 	game/light_switch.o \
 	game/little_lift_button.o \
@@ -135,6 +153,7 @@ MODULE_OBJS := \
 	game/mail_man.o \
 	game/missiveomat.o \
 	game/movie_tester.o \
+	game/musical_instrument.o \
 	game/navigation_computer.o \
 	game/no_nut_bowl.o \
 	game/null_port_hole.o \
@@ -145,24 +164,40 @@ MODULE_OBJS := \
 	game/pet_graphic.o \
 	game/phonograph_lid.o \
 	game/place_holder.o \
+	game/play_music_button.o \
+	game/play_on_act.o \
 	game/port_hole.o \
+	game/record_phonograph_button.o \
+	game/replacement_ear.o \
 	game/reserved_table.o \
 	game/room_item.o \
+	game/sauce_dispensor.o \
 	game/search_point.o \
+	game/season_background.o \
+	game/season_barrel.o \
+	game/seasonal_adjustment.o \
 	game/service_elevator_door.o \
+	game/service_elevator_window.o \
+	game/ship_setting.o \
 	game/ship_setting_button.o \
 	game/show_cell_points.o \
+	game/speech_dispensor.o \
 	game/splash_animation.o \
 	game/star_control.o \
 	game/starling_puret.o \
 	game/start_action.o \
+	game/stop_phonograph_button.o \
 	game/sub_glass.o \
 	game/sub_wrapper.o \
 	game/sweet_bowl.o \
 	game/television.o \
+	game/third_class_canal.o \
 	game/tow_parrot_nav.o \
 	game/throw_tv_down_well.o \
 	game/titania_still_control.o \
+	game/wheel_button.o \
+	game/wheel_hotspot.o \
+	game/wheel_spin.o \
 	game/parrot/parrot_lobby_controller.o \
 	game/parrot/parrot_lobby_link_updater.o \
 	game/parrot/parrot_lobby_object.o \
@@ -208,6 +243,7 @@ MODULE_OBJS := \
 	gfx/icon_nav_up.o \
 	gfx/keybrd_butt.o \
 	gfx/move_object_button.o \
+	gfx/music_control.o \
 	gfx/pet_mode_off.o \
 	gfx/pet_mode_on.o \
 	gfx/pet_mode_panel.o \
diff --git a/engines/titanic/sound/trigger_auto_music_player.h b/engines/titanic/sound/trigger_auto_music_player.h
index 9cc71ee..d67add2 100644
--- a/engines/titanic/sound/trigger_auto_music_player.h
+++ b/engines/titanic/sound/trigger_auto_music_player.h
@@ -20,8 +20,8 @@
  *
  */
 
-#ifndef TITANIC_AUTO_MUSIC_PLAYER_H
-#define TITANIC_AUTO_MUSIC_PLAYER_H
+#ifndef TITANIC_TRIGGER_AUTO_MUSIC_PLAYER_H
+#define TITANIC_TRIGGER_AUTO_MUSIC_PLAYER_H
 
 #include "titanic/core/game_object.h"
 
@@ -47,4 +47,4 @@ public:
 
 } // End of namespace Titanic
 
-#endif /* TITANIC_AUTO_MUSIC_PLAYER_H */
+#endif /* TITANIC_TRIGGER_AUTO_MUSIC_PLAYER_H */


Commit: 5dd3798ebf8177d9c21d79d4e36b173568c09a70
    https://github.com/scummvm/scummvm/commit/5dd3798ebf8177d9c21d79d4e36b173568c09a70
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-02-29T22:56:16-05:00

Commit Message:
TITANIC: Added a bunch of classes, loading method fixes

Changed paths:
  A engines/titanic/carry/hose_end.cpp
  A engines/titanic/carry/hose_end.h
  A engines/titanic/carry/perch.cpp
  A engines/titanic/carry/perch.h
  A engines/titanic/game/maitred_arm_holder.cpp
  A engines/titanic/game/maitred_arm_holder.h
  A engines/titanic/game/music_system_lock.cpp
  A engines/titanic/game/music_system_lock.h
  A engines/titanic/game/nose_holder.cpp
  A engines/titanic/game/nose_holder.h
  A engines/titanic/game/restaurant_cylinder_holder.cpp
  A engines/titanic/game/restaurant_cylinder_holder.h
  A engines/titanic/game/up_lighter.cpp
  A engines/titanic/game/up_lighter.h
    engines/titanic/carry/hose.cpp
    engines/titanic/carry/hose.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/chicken_cooler.cpp
    engines/titanic/game/sgt/sgt_state_room.cpp
    engines/titanic/game/sgt/sgt_state_room.h
    engines/titanic/module.mk
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/carry/hose.cpp b/engines/titanic/carry/hose.cpp
index bb52ec3..1617fef 100644
--- a/engines/titanic/carry/hose.cpp
+++ b/engines/titanic/carry/hose.cpp
@@ -24,18 +24,32 @@
 
 namespace Titanic {
 
+CHoseStatics *CHose::_statics;
+
+void CHose::init() {
+	_statics = new CHoseStatics();
+}
+
+void CHose::deinit() {
+	delete _statics;
+}
+
 CHose::CHose() : CCarry(),
 	_string6("Succ-U-Bus auxiliary hose attachment incompatible with sliding glass cover.") {
 }
 
 void CHose::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_statics->_v1, indent);
+	file->writeQuotedLine(_statics->_v2, indent);
 	file->writeQuotedLine(_string6, indent);
 	CCarry::save(file, indent);
 }
 
 void CHose::load(SimpleFile *file) {
 	file->readNumber();
+	_statics->_v1 = file->readNumber();
+	_statics->_v2 = file->readString();
 	_string6 = file->readString();
 	CCarry::load(file);
 }
diff --git a/engines/titanic/carry/hose.h b/engines/titanic/carry/hose.h
index 87f47b3..dc60f68 100644
--- a/engines/titanic/carry/hose.h
+++ b/engines/titanic/carry/hose.h
@@ -27,11 +27,20 @@
 
 namespace Titanic {
 
+struct CHoseStatics {
+	int _v1;
+	CString _v2;
+};
+
 class CHose : public CCarry {
-private:
+protected:
+	static CHoseStatics *_statics;
+
 	CString _string6;
 public:
 	CHose();
+	static void init();
+	static void deinit();
 
 	/**
 	 * Return the class name
diff --git a/engines/titanic/carry/hose_end.cpp b/engines/titanic/carry/hose_end.cpp
new file mode 100644
index 0000000..97d75b0
--- /dev/null
+++ b/engines/titanic/carry/hose_end.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/hose_end.h"
+
+namespace Titanic {
+
+CHoseEnd::CHoseEnd() : CHose() {
+	_string6 = "Connection refused by remote hose.";
+}
+
+void CHoseEnd::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string6, indent);
+	CHose::save(file, indent);
+}
+
+void CHoseEnd::load(SimpleFile *file) {
+	file->readNumber();
+	_string6 = file->readString();
+	CHose::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/hose_end.h b/engines/titanic/carry/hose_end.h
new file mode 100644
index 0000000..efce6b8d
--- /dev/null
+++ b/engines/titanic/carry/hose_end.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_HOSE_END_H
+#define TITANIC_HOSE_END_H
+
+#include "titanic/carry/hose.h"
+
+namespace Titanic {
+
+class CHoseEnd : public CHose {
+public:
+	CHoseEnd();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CHoseEnd"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HOSE_END_H */
diff --git a/engines/titanic/carry/perch.cpp b/engines/titanic/carry/perch.cpp
new file mode 100644
index 0000000..976921b
--- /dev/null
+++ b/engines/titanic/carry/perch.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/perch.h"
+
+namespace Titanic {
+
+void CPerch::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CCentralCore::save(file, indent);
+}
+
+void CPerch::load(SimpleFile *file) {
+	file->readNumber();
+	CCentralCore::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/perch.h b/engines/titanic/carry/perch.h
new file mode 100644
index 0000000..ce13dbe
--- /dev/null
+++ b/engines/titanic/carry/perch.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PERCH_H
+#define TITANIC_PERCH_H
+
+#include "titanic/carry/central_core.h"
+
+namespace Titanic {
+
+class CPerch : public CCentralCore {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPerch"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PERCH_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 20d6fec..9267e17 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -37,6 +37,7 @@
 #include "titanic/carry/hammer.h"
 #include "titanic/carry/head_piece.h"
 #include "titanic/carry/hose.h"
+#include "titanic/carry/hose_end.h"
 #include "titanic/carry/key.h"
 #include "titanic/carry/liftbot_head.h"
 #include "titanic/carry/long_stick.h"
@@ -46,6 +47,7 @@
 #include "titanic/carry/nose.h"
 #include "titanic/carry/note.h"
 #include "titanic/carry/parcel.h"
+#include "titanic/carry/perch.h"
 #include "titanic/carry/phonograph_cylinder.h"
 #include "titanic/carry/phonograph_ear.h"
 #include "titanic/carry/photograph.h"
@@ -87,6 +89,7 @@
 #include "titanic/game/cdrom_computer.h"
 #include "titanic/game/cdrom_tray.h"
 #include "titanic/game/cell_point_button.h"
+#include "titanic/game/chicken_cooler.h"
 #include "titanic/game/chicken_dispensor.h"
 #include "titanic/game/close_broken_pel.h"
 #include "titanic/game/computer.h"
@@ -103,6 +106,8 @@
 #include "titanic/game/emma_control.h"
 #include "titanic/game/empty_nut_bowl.h"
 #include "titanic/game/enter_exit_first_class_state.h"
+#include "titanic/game/enter_exit_view.h"
+#include "titanic/game/floor_indicator.h"
 #include "titanic/game/games_console.h"
 #include "titanic/game/hammer_dispensor_button.h"
 #include "titanic/game/head_smash_event.h"
@@ -111,8 +116,11 @@
 #include "titanic/game/light.h"
 #include "titanic/game/light_switch.h"
 #include "titanic/game/little_lift_button.h"
+#include "titanic/game/maitred_arm_holder.h"
 #include "titanic/game/musical_instrument.h"
+#include "titanic/game/music_system_lock.h"
 #include "titanic/game/no_nut_bowl.h"
+#include "titanic/game/nose_holder.h"
 #include "titanic/game/null_port_hole.h"
 #include "titanic/game/nut_replacer.h"
 #include "titanic/game/play_music_button.h"
@@ -120,6 +128,7 @@
 #include "titanic/game/port_hole.h"
 #include "titanic/game/record_phonograph_button.h"
 #include "titanic/game/replacement_ear.h"
+#include "titanic/game/restaurant_cylinder_holder.h"
 #include "titanic/game/room_item.h"
 #include "titanic/game/sauce_dispensor.h"
 #include "titanic/game/season_background.h"
@@ -135,6 +144,8 @@
 #include "titanic/game/sweet_bowl.h"
 #include "titanic/game/television.h"
 #include "titanic/game/third_class_canal.h"
+#include "titanic/game/throw_tv_down_well.h"
+#include "titanic/game/up_lighter.h"
 #include "titanic/game/wheel_button.h"
 #include "titanic/game/wheel_hotspot.h"
 #include "titanic/game/wheel_spin.h"
@@ -148,6 +159,7 @@
 #include "titanic/game/parrot/parrot_perch_holder.h"
 #include "titanic/game/parrot/parrot_succubus.h"
 #include "titanic/game/parrot/parrot_trigger.h"
+#include "titanic/game/parrot/player_meets_parrot.h"
 #include "titanic/game/pet/pet.h"
 #include "titanic/game/pet/pet_class1.h"
 #include "titanic/game/pet/pet_class2.h"
@@ -257,6 +269,7 @@ DEFFN(CBridgePiece);
 DEFFN(CCarryParrot);
 DEFFN(CCentralCore);
 DEFFN(CChicken);
+DEFFN(CChickenCooler);
 DEFFN(CCrushedTV);
 DEFFN(CEar);
 DEFFN(CEye);
@@ -266,13 +279,17 @@ DEFFN(CGlass);
 DEFFN(CHammer);
 DEFFN(CHeadPiece);
 DEFFN(CHose);
+DEFFN(CHoseEnd);
 DEFFN(CKey);
 DEFFN(CLiftbotHead);
 DEFFN(CLongStick);
 DEFFN(CMagazine);
+DEFFN(CMouth);
 DEFFN(CNapkin);
+DEFFN(CNose);
 DEFFN(CNote);
 DEFFN(CParcel);
+DEFFN(CPerch);
 DEFFN(CPhonographCylinder);
 DEFFN(CPhonographEar);
 DEFFN(CPhotograph);
@@ -328,6 +345,8 @@ DEFFN(CEjectPhonographButton);
 DEFFN(CEmmaControl);
 DEFFN(CEmptyNutBowl);
 DEFFN(CEnterExitFirstClassState);
+DEFFN(CEnterExitView);
+DEFFN(CFloorIndicator);
 DEFFN(CGamesConsole);
 DEFFN(CHammerDispensorButton);
 DEFFN(CHeadSmashEvent);
@@ -336,8 +355,11 @@ DEFFN(CLemonDispensor);
 DEFFN(CLight);
 DEFFN(CLightSwitch);
 DEFFN(CLittleLiftButton);
+DEFFN(CMaitreDArmHolder);
 DEFFN(CMusicalInstrument);
+DEFFN(CMusicSystemLock);
 DEFFN(CNoNutBowl);
+DEFFN(CNoseHolder);
 DEFFN(CNullPortHole);
 DEFFN(CNutReplacer);
 DEFFN(CPlayMusicButton);
@@ -345,6 +367,7 @@ DEFFN(CPlayOnAct);
 DEFFN(CPortHole);
 DEFFN(CRecordPhonographButton);
 DEFFN(CReplacementEar);
+DEFFN(CRestaurantCylinderHolder);
 DEFFN(CRoomItem);
 DEFFN(CSauceDispensor);
 DEFFN(CSeasonBackground);
@@ -360,6 +383,8 @@ DEFFN(CSUBGlass);
 DEFFN(CSweetBowl);
 DEFFN(CTelevision);
 DEFFN(CThirdClassCanal);
+DEFFN(CThrowTVDownWell);
+DEFFN(CUpLighter);
 DEFFN(CWheelButton);
 DEFFN(CWheelHotSpot);
 DEFFN(CWheelSpin);
@@ -373,6 +398,7 @@ DEFFN(CParrotNutEater);
 DEFFN(CParrotPerchHolder);
 DEFFN(CParrotSuccUBus);
 DEFFN(CParrotTrigger);
+DEFFN(CPlayerMeetsParrot);
 DEFFN(CPET);
 DEFFN(CPETClass1);
 DEFFN(CPETClass2);
@@ -648,6 +674,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CCarryParrot);
 	ADDFN(CCentralCore);
 	ADDFN(CChicken);
+	ADDFN(CChickenCooler);
 	ADDFN(CCrushedTV);
 	ADDFN(CEar);
 	ADDFN(CEye);
@@ -657,13 +684,17 @@ void CSaveableObject::initClassList() {
 	ADDFN(CHammer);
 	ADDFN(CHeadPiece);
 	ADDFN(CHose);
+	ADDFN(CHoseEnd);
 	ADDFN(CKey);
 	ADDFN(CLiftbotHead);
 	ADDFN(CLongStick);
 	ADDFN(CMagazine);
+	ADDFN(CMouth);
 	ADDFN(CNapkin);
+	ADDFN(CNose);
 	ADDFN(CNote);
 	ADDFN(CParcel);
+	ADDFN(CPerch);
 	ADDFN(CPhonographCylinder);
 	ADDFN(CPhonographEar);
 	ADDFN(CPhotograph);
@@ -720,6 +751,8 @@ void CSaveableObject::initClassList() {
 	ADDFN(CEmmaControl);
 	ADDFN(CEmptyNutBowl);
 	ADDFN(CEnterExitFirstClassState);
+	ADDFN(CEnterExitView);
+	ADDFN(CFloorIndicator);
 	ADDFN(CGamesConsole);
 	ADDFN(CHammerDispensorButton);
 	ADDFN(CHeadSmashEvent);
@@ -728,8 +761,11 @@ void CSaveableObject::initClassList() {
 	ADDFN(CLight);
 	ADDFN(CLightSwitch);
 	ADDFN(CLittleLiftButton);
+	ADDFN(CMaitreDArmHolder);
 	ADDFN(CMusicalInstrument);
+	ADDFN(CMusicSystemLock);
 	ADDFN(CNoNutBowl);
+	ADDFN(CNoseHolder);
 	ADDFN(CNullPortHole);
 	ADDFN(CNutReplacer);
 	ADDFN(CPETPosition);
@@ -738,6 +774,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CPortHole);
 	ADDFN(CRecordPhonographButton);
 	ADDFN(CReplacementEar);
+	ADDFN(CRestaurantCylinderHolder);
 	ADDFN(CRoomItem);
 	ADDFN(CSauceDispensor);
 	ADDFN(CSeasonBackground);
@@ -753,6 +790,8 @@ void CSaveableObject::initClassList() {
 	ADDFN(CSweetBowl);
 	ADDFN(CTelevision);
 	ADDFN(CThirdClassCanal);
+	ADDFN(CThrowTVDownWell);
+	ADDFN(CUpLighter);
 	ADDFN(CWheelButton);
 	ADDFN(CWheelHotSpot);
 	ADDFN(CWheelSpin);
@@ -766,6 +805,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CParrotPerchHolder);
 	ADDFN(CParrotSuccUBus);
 	ADDFN(CParrotTrigger);
+	ADDFN(CPlayerMeetsParrot);
 	ADDFN(CPET);
 	ADDFN(CPETClass1);
 	ADDFN(CPETClass2);
diff --git a/engines/titanic/game/chicken_cooler.cpp b/engines/titanic/game/chicken_cooler.cpp
index feb3b4c..335ed36 100644
--- a/engines/titanic/game/chicken_cooler.cpp
+++ b/engines/titanic/game/chicken_cooler.cpp
@@ -26,11 +26,17 @@ namespace Titanic {
 
 void CChickenCooler::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+
 	CGameObject::save(file, indent);
 }
 
 void CChickenCooler::load(SimpleFile *file) {
 	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/maitred_arm_holder.cpp b/engines/titanic/game/maitred_arm_holder.cpp
new file mode 100644
index 0000000..81ad435
--- /dev/null
+++ b/engines/titanic/game/maitred_arm_holder.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/maitred_arm_holder.h"
+
+namespace Titanic {
+
+void CMaitreDArmHolder::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CDropTarget::save(file, indent);
+}
+
+void CMaitreDArmHolder::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/maitred_arm_holder.h b/engines/titanic/game/maitred_arm_holder.h
new file mode 100644
index 0000000..b838109
--- /dev/null
+++ b/engines/titanic/game/maitred_arm_holder.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MAITRED_ARM_HOLDER_H
+#define TITANIC_MAITRED_ARM_HOLDER_H
+
+#include "titanic/core/drop_target.h"
+
+namespace Titanic {
+
+class CMaitreDArmHolder : public CDropTarget {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMaitreDArmHolder"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MAITRED_ARM_HOLDER_H */
diff --git a/engines/titanic/game/music_system_lock.cpp b/engines/titanic/game/music_system_lock.cpp
new file mode 100644
index 0000000..a5419d9
--- /dev/null
+++ b/engines/titanic/game/music_system_lock.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/music_system_lock.h"
+
+namespace Titanic {
+
+void CMusicSystemLock::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CDropTarget::save(file, indent);
+}
+
+void CMusicSystemLock::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/music_system_lock.h b/engines/titanic/game/music_system_lock.h
new file mode 100644
index 0000000..98dc68b
--- /dev/null
+++ b/engines/titanic/game/music_system_lock.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSIC_SYSTEM_LOCK_H
+#define TITANIC_MUSIC_SYSTEM_LOCK_H
+
+#include "titanic/core/drop_target.h"
+
+namespace Titanic {
+
+class CMusicSystemLock : public CDropTarget {
+private:
+	int _value;
+public:
+	CMusicSystemLock() : CDropTarget(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMusicSystemLock"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_SYSTEM_LOCK_H */
diff --git a/engines/titanic/game/nose_holder.cpp b/engines/titanic/game/nose_holder.cpp
new file mode 100644
index 0000000..ba512d0
--- /dev/null
+++ b/engines/titanic/game/nose_holder.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/nose_holder.h"
+
+namespace Titanic {
+
+CNoseHolder::CNoseHolder() : CDropTarget(), _field118(0), _field11C(0) {
+}
+
+void CNoseHolder::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field11C, indent);
+
+	CDropTarget::save(file, indent);
+}
+
+void CNoseHolder::load(SimpleFile *file) {
+	file->readNumber();
+	_field11C = file->readNumber();
+
+	CDropTarget::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/nose_holder.h b/engines/titanic/game/nose_holder.h
new file mode 100644
index 0000000..3512e62
--- /dev/null
+++ b/engines/titanic/game/nose_holder.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NOSE_HOLDER_H
+#define TITANIC_NOSE_HOLDER_H
+
+#include "titanic/core/drop_target.h"
+
+namespace Titanic {
+
+class CNoseHolder : public CDropTarget {
+private:
+	int _field118;
+	int _field11C;
+public:
+	CNoseHolder();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNoseHolder"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NOSE_HOLDER_H */
diff --git a/engines/titanic/game/restaurant_cylinder_holder.cpp b/engines/titanic/game/restaurant_cylinder_holder.cpp
new file mode 100644
index 0000000..1662064
--- /dev/null
+++ b/engines/titanic/game/restaurant_cylinder_holder.cpp
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/restaurant_cylinder_holder.h"
+
+namespace Titanic {
+
+CRestaurantCylinderHolder::CRestaurantCylinderHolder() : CDropTarget(),
+	_field118(0), _field11C(0), _field12C(0), _field130(0),
+	_string6("z#61.wav"), _field140(1) {
+}
+
+void CRestaurantCylinderHolder::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field118, indent);
+	file->writeNumberLine(_field11C, indent);
+	file->writeQuotedLine(_string5, indent);
+	file->writeNumberLine(_field12C, indent);
+	file->writeNumberLine(_field130, indent);
+	file->writeQuotedLine(_string6, indent);
+	file->writeNumberLine(_field140, indent);
+
+	CDropTarget::save(file, indent);
+}
+
+void CRestaurantCylinderHolder::load(SimpleFile *file) {
+	file->readNumber();
+	_field118 = file->readNumber();
+	_field11C = file->readNumber();
+	_string5 = file->readString();
+	_field12C = file->readNumber();
+	_field130 = file->readNumber();
+	_string6 = file->readString();
+	_field140 = file->readNumber();
+
+	CDropTarget::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/restaurant_cylinder_holder.h b/engines/titanic/game/restaurant_cylinder_holder.h
new file mode 100644
index 0000000..29e2958
--- /dev/null
+++ b/engines/titanic/game/restaurant_cylinder_holder.h
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RESTAURANT_CYLINDER_HOLDER_H
+#define TITANIC_RESTAURANT_CYLINDER_HOLDER_H
+
+#include "titanic/core/drop_target.h"
+
+namespace Titanic {
+
+class CRestaurantCylinderHolder : public CDropTarget {
+private:
+	int _field118;
+	int _field11C;
+	CString _string5;
+	int _field12C;
+	int _field130;
+	CString _string6;
+	int _field140;
+public:
+	CRestaurantCylinderHolder();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CRestaurantCylinderHolder"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RESTAURANT_CYLINDER_HOLDER_H */
diff --git a/engines/titanic/game/sgt/sgt_state_room.cpp b/engines/titanic/game/sgt/sgt_state_room.cpp
index d244309..e0d8de1 100644
--- a/engines/titanic/game/sgt/sgt_state_room.cpp
+++ b/engines/titanic/game/sgt/sgt_state_room.cpp
@@ -24,7 +24,15 @@
 
 namespace Titanic {
 
-CSGTStateRoomStatics *_statics;
+CSGTStateRoomStatics *CSGTStateRoom::_statics;
+
+void CSGTStateRoom::init() {
+	_statics = new CSGTStateRoomStatics();
+}
+
+void CSGTStateRoom::deinit() {
+	delete _statics;
+}
 
 CSGTStateRoom::CSGTStateRoom() : CBackground(), _fieldE0(1),
 	_fieldE4(1), _fieldE8(0), _fieldEC(1), _fieldF0(1) {
diff --git a/engines/titanic/game/sgt/sgt_state_room.h b/engines/titanic/game/sgt/sgt_state_room.h
index ba70e54..f67a916 100644
--- a/engines/titanic/game/sgt/sgt_state_room.h
+++ b/engines/titanic/game/sgt/sgt_state_room.h
@@ -46,7 +46,7 @@ struct CSGTStateRoomStatics {
 
 class CSGTStateRoom : public CBackground {
 private:
-	CSGTStateRoomStatics *_statics;
+	static CSGTStateRoomStatics *_statics;
 private:
 	int _fieldE0;
 	int _fieldE4;
@@ -55,6 +55,8 @@ private:
 	int _fieldF0;
 public:
 	CSGTStateRoom();
+	static void init();
+	static void deinit();
 
 	/**
 	 * Return the class name
diff --git a/engines/titanic/game/up_lighter.cpp b/engines/titanic/game/up_lighter.cpp
new file mode 100644
index 0000000..0e6c4d8
--- /dev/null
+++ b/engines/titanic/game/up_lighter.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/up_lighter.h"
+
+namespace Titanic {
+
+CUpLighter::CUpLighter() : CDropTarget(), _field118(0),
+	_field11C(0), _field120(0), _field124(0) {
+}
+
+void CUpLighter::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field118, indent);
+	file->writeNumberLine(_field11C, indent);
+	file->writeNumberLine(_field120, indent);
+	file->writeNumberLine(_field124, indent);
+
+	CDropTarget::save(file, indent);
+}
+
+void CUpLighter::load(SimpleFile *file) {
+	file->readNumber();
+	_field118 = file->readNumber();
+	_field11C = file->readNumber();
+	_field120 = file->readNumber();
+	_field124 = file->readNumber();
+
+	CDropTarget::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/up_lighter.h b/engines/titanic/game/up_lighter.h
new file mode 100644
index 0000000..e7c6cdf
--- /dev/null
+++ b/engines/titanic/game/up_lighter.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_UP_LIGHTER_H
+#define TITANIC_UP_LIGHTER_H
+
+#include "titanic/core/drop_target.h"
+
+namespace Titanic {
+
+class CUpLighter : public CDropTarget {
+private:
+	int _field118;
+	int _field11C;
+	int _field120;
+	int _field124;
+public:
+	CUpLighter();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CUpLighter"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_UP_LIGHTER_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 5894bf3..f992786 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -33,6 +33,7 @@ MODULE_OBJS := \
 	carry/hammer.o \
 	carry/head_piece.o \
 	carry/hose.o \
+	carry/hose_end.o \
 	carry/key.o \
 	carry/liftbot_head.o \
 	carry/long_stick.o \
@@ -42,6 +43,7 @@ MODULE_OBJS := \
 	carry/nose.o \
 	carry/note.o \
 	carry/parcel.o \
+	carry/perch.o \
 	carry/phonograph_cylinder.o \
 	carry/phonograph_ear.o \
 	carry/photograph.o \
@@ -151,11 +153,14 @@ MODULE_OBJS := \
 	game/little_lift_button.o \
 	game/long_stick_dispenser.o \
 	game/mail_man.o \
+	game/maitred_arm_holder.o \
 	game/missiveomat.o \
 	game/movie_tester.o \
+	game/music_system_lock.o \
 	game/musical_instrument.o \
 	game/navigation_computer.o \
 	game/no_nut_bowl.o \
+	game/nose_holder.o \
 	game/null_port_hole.o \
 	game/nut_replacer.o \
 	game/pet_controler.o \
@@ -170,6 +175,7 @@ MODULE_OBJS := \
 	game/record_phonograph_button.o \
 	game/replacement_ear.o \
 	game/reserved_table.o \
+	game/restaurant_cylinder_holder.o \
 	game/room_item.o \
 	game/sauce_dispensor.o \
 	game/search_point.o \
@@ -195,6 +201,7 @@ MODULE_OBJS := \
 	game/tow_parrot_nav.o \
 	game/throw_tv_down_well.o \
 	game/titania_still_control.o \
+	game/up_lighter.o \
 	game/wheel_button.o \
 	game/wheel_hotspot.o \
 	game/wheel_spin.o \
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index b3aae7b..62a0ae2 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -29,8 +29,10 @@
 #include "graphics/thumbnail.h"
 #include "titanic/titanic.h"
 #include "titanic/core/saveable_object.h"
-#include "titanic/game/parrot/parrot_lobby_object.h"
 #include "titanic/game/enter_exit_first_class_state.h"
+#include "titanic/game/parrot/parrot_lobby_object.h"
+#include "titanic/game/sgt/sgt_state_room.h"
+#include "titanic/carry/hose.h"
 
 namespace Titanic {
 
@@ -56,6 +58,8 @@ void TitanicEngine::initialize() {
 	CSaveableObject::initClassList();
 	CParrotLobbyObject::init();
 	CEnterExitFirstClassState::init();
+	CHose::init();
+	CSGTStateRoom::init();
 
 	_screenManager = new OSScreenManager(this);
 	_window = new CMainGameWindow(this);
@@ -64,6 +68,8 @@ void TitanicEngine::initialize() {
 
 void TitanicEngine::deinitialize() {
 	CEnterExitFirstClassState::deinit();
+	CHose::deinit();
+	CSGTStateRoom::deinit();
 }
 
 Common::Error TitanicEngine::run() {


Commit: 32d84ed33d88e42bc521b3736b35bacdfa5c13e7
    https://github.com/scummvm/scummvm/commit/32d84ed33d88e42bc521b3736b35bacdfa5c13e7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-01T08:07:05-05:00

Commit Message:
TITANIC: Added lots more miscellaneous classes

Changed paths:
  A engines/titanic/game/hammer_dispensor.cpp
  A engines/titanic/game/hammer_dispensor.h
  A engines/titanic/game/music_console_button.cpp
  A engines/titanic/game/music_console_button.h
  A engines/titanic/game/music_room_phonograph.cpp
  A engines/titanic/game/music_room_phonograph.h
  A engines/titanic/game/music_room_stop_phonograph_button.cpp
  A engines/titanic/game/music_room_stop_phonograph_button.h
  A engines/titanic/game/phonograph.cpp
  A engines/titanic/game/phonograph.h
  A engines/titanic/game/restaurant_phonograph.cpp
  A engines/titanic/game/restaurant_phonograph.h
  A engines/titanic/game/sgt/enter_exit_mini_lift.cpp
  A engines/titanic/game/sgt/enter_exit_mini_lift.h
  A engines/titanic/game/transport/gondolier.cpp
  A engines/titanic/game/transport/gondolier.h
  A engines/titanic/game/transport/lift.cpp
  A engines/titanic/game/transport/lift.h
  A engines/titanic/game/transport/lift_indicator.cpp
  A engines/titanic/game/transport/lift_indicator.h
  A engines/titanic/game/transport/pellerator.cpp
  A engines/titanic/game/transport/pellerator.h
  A engines/titanic/game/transport/service_elevator.cpp
  A engines/titanic/game/transport/service_elevator.h
  A engines/titanic/game/transport/transport.cpp
  A engines/titanic/game/transport/transport.h
  A engines/titanic/gfx/volume_control.cpp
  A engines/titanic/gfx/volume_control.h
  A engines/titanic/sound/restricted_auto_music_player.cpp
  A engines/titanic/sound/restricted_auto_music_player.h
    engines/titanic/carry/chicken.cpp
    engines/titanic/carry/phonograph_ear.cpp
    engines/titanic/carry/phonograph_ear.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/hammer_dispensor_button.h
    engines/titanic/game/sauce_dispensor.cpp
    engines/titanic/game/sauce_dispensor.h
    engines/titanic/game/sgt/sgt_navigation.cpp
    engines/titanic/game/sgt/sgt_navigation.h
    engines/titanic/game/sgt/sgt_restaurant_doors.cpp
    engines/titanic/game/sgt/sgt_restaurant_doors.h
    engines/titanic/module.mk
    engines/titanic/sound/music_player.cpp
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/carry/chicken.cpp b/engines/titanic/carry/chicken.cpp
index 972c993..52f3c25 100644
--- a/engines/titanic/carry/chicken.cpp
+++ b/engines/titanic/carry/chicken.cpp
@@ -34,6 +34,7 @@ void CChicken::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field12C, indent);
 	file->writeQuotedLine(_string6, indent);
+	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_field13C, indent);
 	file->writeNumberLine(_field140, indent);
 
@@ -44,6 +45,7 @@ void CChicken::load(SimpleFile *file) {
 	file->readNumber();
 	_field12C = file->readNumber();
 	_string6 = file->readString();
+	_v1 = file->readNumber();
 	_field13C = file->readNumber();
 	_field140 = file->readNumber();
 
diff --git a/engines/titanic/carry/phonograph_ear.cpp b/engines/titanic/carry/phonograph_ear.cpp
index 759356a..0b4142c 100644
--- a/engines/titanic/carry/phonograph_ear.cpp
+++ b/engines/titanic/carry/phonograph_ear.cpp
@@ -26,11 +26,13 @@ namespace Titanic {
 
 void CPhonographEar::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field140, indent);
 	CEar::save(file, indent);
 }
 
 void CPhonographEar::load(SimpleFile *file) {
 	file->readNumber();
+	_field140 = file->readNumber();
 	CEar::load(file);
 }
 
diff --git a/engines/titanic/carry/phonograph_ear.h b/engines/titanic/carry/phonograph_ear.h
index 5904200..ec6cfed 100644
--- a/engines/titanic/carry/phonograph_ear.h
+++ b/engines/titanic/carry/phonograph_ear.h
@@ -20,15 +20,19 @@
  *
  */
 
-#ifndef TITANIC_PHONOGRAPH_EYE_H
-#define TITANIC_PHONOGRAPH_EYE_H
+#ifndef TITANIC_PHONOGRAPH_EAR_H
+#define TITANIC_PHONOGRAPH_EAR_H
 
 #include "titanic/carry/ear.h"
 
 namespace Titanic {
 
 class CPhonographEar : public CEar {
+private:
+	int _field140;
 public:
+	CPhonographEar() : CEar(), _field140(1) {}
+
 	/**
 	 * Return the class name
 	 */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 9267e17..8328aa5 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -69,6 +69,7 @@
 #include "titanic/core/node_item.h"
 #include "titanic/core/project_item.h"
 #include "titanic/core/saveable_object.h"
+#include "titanic/core/static_image.h"
 #include "titanic/core/turn_on_object.h"
 #include "titanic/core/turn_on_play_sound.h"
 #include "titanic/core/tree_item.h"
@@ -84,6 +85,7 @@
 #include "titanic/game/bridge_view.h"
 #include "titanic/game/broken_pell_base.h"
 #include "titanic/game/cage.h"
+#include "titanic/game/call_pellerator.h"
 #include "titanic/game/captains_wheel.h"
 #include "titanic/game/cdrom.h"
 #include "titanic/game/cdrom_computer.h"
@@ -107,8 +109,15 @@
 #include "titanic/game/empty_nut_bowl.h"
 #include "titanic/game/enter_exit_first_class_state.h"
 #include "titanic/game/enter_exit_view.h"
+#include "titanic/game/fan.h"
+#include "titanic/game/fan_control.h"
+#include "titanic/game/fan_decrease.h"
+#include "titanic/game/fan_increase.h"
+#include "titanic/game/fan_noises.h"
 #include "titanic/game/floor_indicator.h"
 #include "titanic/game/games_console.h"
+#include "titanic/game/hammer_clip.h"
+#include "titanic/game/hammer_dispensor.h"
 #include "titanic/game/hammer_dispensor_button.h"
 #include "titanic/game/head_smash_event.h"
 #include "titanic/game/head_smash_lever.h"
@@ -118,17 +127,22 @@
 #include "titanic/game/little_lift_button.h"
 #include "titanic/game/maitred_arm_holder.h"
 #include "titanic/game/musical_instrument.h"
+#include "titanic/game/music_console_button.h"
+#include "titanic/game/music_room_phonograph.h"
+#include "titanic/game/music_room_stop_phonograph_button.h"
 #include "titanic/game/music_system_lock.h"
 #include "titanic/game/no_nut_bowl.h"
 #include "titanic/game/nose_holder.h"
 #include "titanic/game/null_port_hole.h"
 #include "titanic/game/nut_replacer.h"
+#include "titanic/game/phonograph.h"
 #include "titanic/game/play_music_button.h"
 #include "titanic/game/play_on_act.h"
 #include "titanic/game/port_hole.h"
 #include "titanic/game/record_phonograph_button.h"
 #include "titanic/game/replacement_ear.h"
 #include "titanic/game/restaurant_cylinder_holder.h"
+#include "titanic/game/restaurant_phonograph.h"
 #include "titanic/game/room_item.h"
 #include "titanic/game/sauce_dispensor.h"
 #include "titanic/game/season_background.h"
@@ -138,6 +152,7 @@
 #include "titanic/game/service_elevator_window.h"
 #include "titanic/game/ship_setting.h"
 #include "titanic/game/speech_dispensor.h"
+#include "titanic/game/starling_puret.h"
 #include "titanic/game/start_action.h"
 #include "titanic/game/stop_phonograph_button.h"
 #include "titanic/game/sub_glass.h"
@@ -170,11 +185,18 @@
 #include "titanic/game/pet/pet_sounds.h"
 #include "titanic/game/pet/pet_transition.h"
 #include "titanic/game/pet/pet_transport.h"
+#include "titanic/game/sgt/enter_exit_mini_lift.h"
 #include "titanic/game/sgt/sgt_doors.h"
 #include "titanic/game/sgt/sgt_navigation.h"
 #include "titanic/game/sgt/sgt_restaurant_doors.h"
 #include "titanic/game/sgt/sgt_state_room.h"
 #include "titanic/game/sgt/sgt_upper_doors_sound.h"
+#include "titanic/game/transport/gondolier.h"
+#include "titanic/game/transport/lift.h"
+#include "titanic/game/transport/lift_indicator.h"
+#include "titanic/game/transport/pellerator.h"
+#include "titanic/game/transport/service_elevator.h"
+#include "titanic/game/transport/transport.h"
 #include "titanic/gfx/act_button.h"
 #include "titanic/gfx/changes_season_button.h"
 #include "titanic/gfx/chev_left_off.h"
@@ -213,6 +235,7 @@
 #include "titanic/gfx/status_change_button.h"
 #include "titanic/gfx/st_button.h"
 #include "titanic/gfx/toggle_switch.h"
+#include "titanic/gfx/volume_control.h"
 #include "titanic/messages/messages.h"
 #include "titanic/messages/mouse_messages.h"
 #include "titanic/messages/pet_messages.h"
@@ -249,6 +272,7 @@
 #include "titanic/sound/auto_sound_player.h"
 #include "titanic/sound/background_sound_maker.h"
 #include "titanic/sound/music_player.h"
+#include "titanic/sound/restricted_auto_music_player.h"
 #include "titanic/sound/seasonal_music_player.h"
 #include "titanic/sound/titania_speech.h"
 #include "titanic/sound/trigger_auto_music_player.h"
@@ -310,6 +334,7 @@ DEFFN(CMovieClipList);
 DEFFN(CMultiDropTarget);
 DEFFN(CNodeItem);
 DEFFN(CProjectItem);
+DEFFN(CStaticImage);
 DEFFN(CTurnOnObject);
 DEFFN(CTurnOnPlaySound);
 DEFFN(CTreeItem);
@@ -325,6 +350,7 @@ DEFFN(CBomb);
 DEFFN(CBridgeView);
 DEFFN(CBrokenPellBase)
 DEFFN(CCage);
+DEFFN(CCallPellerator);
 DEFFN(CCaptainsWheel);
 DEFFN(CCDROM);
 DEFFN(CCDROMComputer);
@@ -346,8 +372,15 @@ DEFFN(CEmmaControl);
 DEFFN(CEmptyNutBowl);
 DEFFN(CEnterExitFirstClassState);
 DEFFN(CEnterExitView);
+DEFFN(CFan);
+DEFFN(CFanControl);
+DEFFN(CFanDecrease);
+DEFFN(CFanIncrease);
+DEFFN(CFanNoises);
 DEFFN(CFloorIndicator);
 DEFFN(CGamesConsole);
+DEFFN(CHammerClip);
+DEFFN(CHammerDispensor);
 DEFFN(CHammerDispensorButton);
 DEFFN(CHeadSmashEvent);
 DEFFN(CHeadSmashLever);
@@ -357,17 +390,22 @@ DEFFN(CLightSwitch);
 DEFFN(CLittleLiftButton);
 DEFFN(CMaitreDArmHolder);
 DEFFN(CMusicalInstrument);
+DEFFN(CMusicConsoleButton);
+DEFFN(CMusicRoomPhonograph);
+DEFFN(CMusicRoomStopPhonographButton);
 DEFFN(CMusicSystemLock);
 DEFFN(CNoNutBowl);
 DEFFN(CNoseHolder);
 DEFFN(CNullPortHole);
 DEFFN(CNutReplacer);
+DEFFN(CPhonograph);
 DEFFN(CPlayMusicButton);
 DEFFN(CPlayOnAct);
 DEFFN(CPortHole);
 DEFFN(CRecordPhonographButton);
 DEFFN(CReplacementEar);
 DEFFN(CRestaurantCylinderHolder);
+DEFFN(CRestaurantPhonograph);
 DEFFN(CRoomItem);
 DEFFN(CSauceDispensor);
 DEFFN(CSeasonBackground);
@@ -377,6 +415,7 @@ DEFFN(CServiceElevatorDoor);
 DEFFN(CServiceElevatorWindow);
 DEFFN(CShipSetting);
 DEFFN(CSpeechDispensor);
+DEFFN(CStarlingPuret);
 DEFFN(CStartAction);
 DEFFN(CStopPhonographButton);
 DEFFN(CSUBGlass);
@@ -409,11 +448,18 @@ DEFFN(CPETSentinal);
 DEFFN(CPETSounds);
 DEFFN(CPETTransition);
 DEFFN(CPETTransport);
+DEFFN(CEnterExitMiniLift);
 DEFFN(CSGTDoors);
 DEFFN(CSGTNavigation);
 DEFFN(CSGTRestaurantDoors);
 DEFFN(CSGTStateRoom);
 DEFFN(CSGTUpperDoorsSound);
+DEFFN(CGondolier);
+DEFFN(CLift);
+DEFFN(CLiftindicator);
+DEFFN(CPellerator);
+DEFFN(CServiceElevator);
+DEFFN(CTransport);
 
 DEFFN(CActButton);
 DEFFN(CChangesSeasonButton);
@@ -453,6 +499,7 @@ DEFFN(CSmallChevRightOff);
 DEFFN(CSmallChevRightOn);
 DEFFN(CStatusChangeButton);
 DEFFN(CSTButton);
+DEFFN(CVolumeControl);
 
 DEFFN(CActMsg);
 DEFFN(CActivationmsg);
@@ -660,6 +707,7 @@ DEFFN(CAutoMusicPlayerBase);
 DEFFN(CAutoSoundPlayer);
 DEFFN(CBackgroundSoundMaker);
 DEFFN(CMusicPlayer);
+DEFFN(CRestrictedAutoMusicPlayer);
 DEFFN(CSeasonalMusicPlayer);
 DEFFN(CTitaniaSpeech);
 DEFFN(CTriggerAutoMusicPlayer);
@@ -715,6 +763,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CMultiDropTarget);
 	ADDFN(CNodeItem);
 	ADDFN(CProjectItem);
+	ADDFN(CStaticImage);
 	ADDFN(CTreeItem);
 	ADDFN(CTurnOnObject);
 	ADDFN(CTurnOnPlaySound);
@@ -730,6 +779,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CBridgeView);
 	ADDFN(CBrokenPellBase);
 	ADDFN(CCage);
+	ADDFN(CCallPellerator);
 	ADDFN(CCaptainsWheel);
 	ADDFN(CCDROM);
 	ADDFN(CCDROMComputer);
@@ -752,8 +802,15 @@ void CSaveableObject::initClassList() {
 	ADDFN(CEmptyNutBowl);
 	ADDFN(CEnterExitFirstClassState);
 	ADDFN(CEnterExitView);
+	ADDFN(CFan);
+	ADDFN(CFanControl);
+	ADDFN(CFanDecrease);
+	ADDFN(CFanIncrease);
+	ADDFN(CFanNoises);
 	ADDFN(CFloorIndicator);
 	ADDFN(CGamesConsole);
+	ADDFN(CHammerClip);
+	ADDFN(CHammerDispensor);
 	ADDFN(CHammerDispensorButton);
 	ADDFN(CHeadSmashEvent);
 	ADDFN(CHeadSmashLever);
@@ -763,18 +820,22 @@ void CSaveableObject::initClassList() {
 	ADDFN(CLittleLiftButton);
 	ADDFN(CMaitreDArmHolder);
 	ADDFN(CMusicalInstrument);
+	ADDFN(CMusicConsoleButton);
+	ADDFN(CMusicRoomPhonograph);
+	ADDFN(CMusicRoomStopPhonographButton);
 	ADDFN(CMusicSystemLock);
 	ADDFN(CNoNutBowl);
 	ADDFN(CNoseHolder);
 	ADDFN(CNullPortHole);
 	ADDFN(CNutReplacer);
-	ADDFN(CPETPosition);
+	ADDFN(CPhonograph);
 	ADDFN(CPlayMusicButton);
 	ADDFN(CPlayOnAct);
 	ADDFN(CPortHole);
 	ADDFN(CRecordPhonographButton);
 	ADDFN(CReplacementEar);
 	ADDFN(CRestaurantCylinderHolder);
+	ADDFN(CRestaurantPhonograph);
 	ADDFN(CRoomItem);
 	ADDFN(CSauceDispensor);
 	ADDFN(CSeasonBackground);
@@ -784,6 +845,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CServiceElevatorWindow);
 	ADDFN(CShipSetting);
 	ADDFN(CSpeechDispensor);
+	ADDFN(CStarlingPuret);
 	ADDFN(CStartAction);
 	ADDFN(CStopPhonographButton);
 	ADDFN(CSUBGlass);
@@ -816,11 +878,18 @@ void CSaveableObject::initClassList() {
 	ADDFN(CPETSounds);
 	ADDFN(CPETTransition);
 	ADDFN(CPETTransport);
+	ADDFN(CEnterExitMiniLift);
 	ADDFN(CSGTDoors);
 	ADDFN(CSGTNavigation);
 	ADDFN(CSGTRestaurantDoors);
 	ADDFN(CSGTStateRoom);
 	ADDFN(CSGTUpperDoorsSound);
+	ADDFN(CGondolier);
+	ADDFN(CLift);
+	ADDFN(CLiftindicator);
+	ADDFN(CPellerator);
+	ADDFN(CServiceElevator);
+	ADDFN(CTransport);
 
 	ADDFN(CActButton);
 	ADDFN(CChangesSeasonButton);
@@ -848,6 +917,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CMusicSwitch);
 	ADDFN(CMusicSwitchInversion);
 	ADDFN(CMusicSwitchReverse);
+	ADDFN(CMusicVoiceMute);
 	ADDFN(CPetModeOff);
 	ADDFN(CPetModeOn);
 	ADDFN(CPetModePanel);
@@ -859,6 +929,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CSmallChevRightOn);
 	ADDFN(CStatusChangeButton);
 	ADDFN(CSTButton);
+	ADDFN(CVolumeControl);
 
 	ADDFN(CActMsg);
 	ADDFN(CActivationmsg);
@@ -1067,6 +1138,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CAutoSoundPlayer);
 	ADDFN(CBackgroundSoundMaker);
 	ADDFN(CMusicPlayer);
+	ADDFN(CRestrictedAutoMusicPlayer);
 	ADDFN(CSeasonalMusicPlayer);
 	ADDFN(CAutoMusicPlayer);
 	ADDFN(CTitaniaSpeech);
diff --git a/engines/titanic/game/hammer_dispensor.cpp b/engines/titanic/game/hammer_dispensor.cpp
new file mode 100644
index 0000000..d486910
--- /dev/null
+++ b/engines/titanic/game/hammer_dispensor.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/hammer_dispensor.h"
+
+namespace Titanic {
+
+CHammerDispensor::CHammerDispensor() : CBackground(),
+	_fieldE0(0), _fieldE4(0), _fieldE8(0) {
+}
+
+void CHammerDispensor::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CHammerDispensor::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/hammer_dispensor.h b/engines/titanic/game/hammer_dispensor.h
new file mode 100644
index 0000000..60b7054
--- /dev/null
+++ b/engines/titanic/game/hammer_dispensor.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_HAMMER_DISPENSOR_H
+#define TITANIC_HAMMER_DISPENSOR_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CHammerDispensor : public CBackground {
+private:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+public:
+	CHammerDispensor();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CHammerDispensor"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_HAMMER_DISPENSOR_H */
diff --git a/engines/titanic/game/hammer_dispensor_button.h b/engines/titanic/game/hammer_dispensor_button.h
index e4b5fc1..978c1d3 100644
--- a/engines/titanic/game/hammer_dispensor_button.h
+++ b/engines/titanic/game/hammer_dispensor_button.h
@@ -20,8 +20,8 @@
  *
  */
 
-#ifndef TITANIC_HAMMER_DISPENSOR_H
-#define TITANIC_HAMMER_DISPENSOR_H
+#ifndef TITANIC_HAMMER_DISPENSOR_BUTTON_H
+#define TITANIC_HAMMER_DISPENSOR_BUTTON_H
 
 #include "titanic/game/start_action.h"
 
@@ -57,4 +57,4 @@ public:
 
 } // End of namespace Titanic
 
-#endif /* TITANIC_HAMMER_DISPENSOR_H */
+#endif /* TITANIC_HAMMER_DISPENSOR_BUTTON_H */
diff --git a/engines/titanic/game/music_console_button.cpp b/engines/titanic/game/music_console_button.cpp
new file mode 100644
index 0000000..d92dd4d
--- /dev/null
+++ b/engines/titanic/game/music_console_button.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/music_console_button.h"
+
+namespace Titanic {
+
+void CMusicConsoleButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CMusicPlayer::save(file, indent);
+}
+
+void CMusicConsoleButton::load(SimpleFile *file) {
+	file->readNumber();
+	CMusicPlayer::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/music_console_button.h b/engines/titanic/game/music_console_button.h
new file mode 100644
index 0000000..84a7452
--- /dev/null
+++ b/engines/titanic/game/music_console_button.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSIC_CONSOLE_BUTTON_H
+#define TITANIC_MUSIC_CONSOLE_BUTTON_H
+
+#include "titanic/sound/music_player.h"
+
+namespace Titanic {
+
+class CMusicConsoleButton : public CMusicPlayer {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMusicConsoleButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_CONSOLE_BUTTON_H */
diff --git a/engines/titanic/game/music_room_phonograph.cpp b/engines/titanic/game/music_room_phonograph.cpp
new file mode 100644
index 0000000..7fa30f5
--- /dev/null
+++ b/engines/titanic/game/music_room_phonograph.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/music_room_phonograph.h"
+
+namespace Titanic {
+
+void CMusicRoomPhonograph::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field118, indent);
+	CRestaurantPhonograph::save(file, indent);
+}
+
+void CMusicRoomPhonograph::load(SimpleFile *file) {
+	file->readNumber();
+	_field118 = file->readNumber();
+	CRestaurantPhonograph::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/music_room_phonograph.h b/engines/titanic/game/music_room_phonograph.h
new file mode 100644
index 0000000..2d34b16
--- /dev/null
+++ b/engines/titanic/game/music_room_phonograph.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSIC_ROOM_PHONOGRAPH_H
+#define TITANIC_MUSIC_ROOM_PHONOGRAPH_H
+
+#include "titanic/game/restaurant_phonograph.h"
+
+namespace Titanic {
+
+class CMusicRoomPhonograph : public CRestaurantPhonograph {
+private:
+	int _field118;
+public:
+	CMusicRoomPhonograph() : CRestaurantPhonograph(), _field118(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMusicRoomPhonograph"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_ROOM_PHONOGRAPH_H */
diff --git a/engines/titanic/game/music_room_stop_phonograph_button.cpp b/engines/titanic/game/music_room_stop_phonograph_button.cpp
new file mode 100644
index 0000000..7e00bad
--- /dev/null
+++ b/engines/titanic/game/music_room_stop_phonograph_button.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/music_room_stop_phonograph_button.h"
+
+namespace Titanic {
+
+void CMusicRoomStopPhonographButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field100, indent);
+	CEjectPhonographButton::save(file, indent);
+}
+
+void CMusicRoomStopPhonographButton::load(SimpleFile *file) {
+	file->readNumber();
+	_field100 = file->readNumber();
+	CEjectPhonographButton::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/music_room_stop_phonograph_button.h b/engines/titanic/game/music_room_stop_phonograph_button.h
new file mode 100644
index 0000000..4fd4aa6
--- /dev/null
+++ b/engines/titanic/game/music_room_stop_phonograph_button.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSIC_ROOM_STOP_PHONOGRAPH_BUTTON_H
+#define TITANIC_MUSIC_ROOM_STOP_PHONOGRAPH_BUTTON_H
+
+#include "titanic/game/eject_phonograph_button.h"
+
+namespace Titanic {
+
+class CMusicRoomStopPhonographButton : public CEjectPhonographButton {
+private:
+	int _field100;
+public:
+	CMusicRoomStopPhonographButton() : CEjectPhonographButton(), _field100(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMusicRoomStopPhonographButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_ROOM_STOP_PHONOGRAPH_BUTTON_H */
diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp
new file mode 100644
index 0000000..3461e34
--- /dev/null
+++ b/engines/titanic/game/phonograph.cpp
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/phonograph.h"
+
+namespace Titanic {
+
+CPhonograph::CPhonograph() : CMusicPlayer(),
+	_fieldE0(0), _fieldE4(0), _fieldE8(0), _fieldEC(0),
+	_fieldF0(0), _fieldF4(0) {
+}
+
+void CPhonograph::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_fieldF4, indent);
+
+	CMusicPlayer::save(file, indent);
+}
+
+void CPhonograph::load(SimpleFile *file) {
+	file->readNumber();
+	_string2 = file->readString();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_fieldF0 = file->readNumber();
+	_fieldF4 = file->readNumber();
+
+	CMusicPlayer::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/phonograph.h b/engines/titanic/game/phonograph.h
new file mode 100644
index 0000000..e7fcddf
--- /dev/null
+++ b/engines/titanic/game/phonograph.h
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PHONOGRAPH_H
+#define TITANIC_PHONOGRAPH_H
+
+#include "titanic/sound/music_player.h"
+
+namespace Titanic {
+
+class CPhonograph : public CMusicPlayer {
+protected:
+	CString _string2;
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+	int _fieldF4;
+public:
+	CPhonograph();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPhonograph"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_CONSOLE_BUTTON_H */
diff --git a/engines/titanic/game/restaurant_phonograph.cpp b/engines/titanic/game/restaurant_phonograph.cpp
new file mode 100644
index 0000000..c73bd51
--- /dev/null
+++ b/engines/titanic/game/restaurant_phonograph.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/restaurant_phonograph.h"
+
+namespace Titanic {
+
+CRestaurantPhonograph::CRestaurantPhonograph() : CPhonograph(),
+	_fieldF8(1), _field114(0) {}
+
+void CRestaurantPhonograph::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string3, indent);
+
+	file->writeNumberLine(_field114, indent);
+
+	CPhonograph::save(file, indent);
+}
+
+void CRestaurantPhonograph::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldF8 = file->readNumber();
+	_string2 = file->readString();
+	_string3 = file->readString();
+	_field114 = file->readNumber();
+
+	CPhonograph::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/restaurant_phonograph.h b/engines/titanic/game/restaurant_phonograph.h
new file mode 100644
index 0000000..777ec34
--- /dev/null
+++ b/engines/titanic/game/restaurant_phonograph.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RESTAURANT_PHONOGRAPH_H
+#define TITANIC_RESTAURANT_PHONOGRAPH_H
+
+#include "titanic/game/phonograph.h"
+
+namespace Titanic {
+
+class CRestaurantPhonograph : public CPhonograph {
+private:
+	int _fieldF8;
+	CString _string2;
+	CString _string3;
+	int _field114;
+public:
+	CRestaurantPhonograph();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CRestaurantPhonograph"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RESTAURANT_PHONOGRAPH_H */
diff --git a/engines/titanic/game/sauce_dispensor.cpp b/engines/titanic/game/sauce_dispensor.cpp
index 4982df6..6365f6e 100644
--- a/engines/titanic/game/sauce_dispensor.cpp
+++ b/engines/titanic/game/sauce_dispensor.cpp
@@ -24,25 +24,17 @@
 
 namespace Titanic {
 
-CSauceDispensor::CSauceDispensor() : CBackground() {
-	_fieldEC = 0;
-	_fieldF0 = 0;
-	_fieldF4 = 0;
-	_fieldF8 = 0;
-	_fieldFC = 0;
-	_field100 = 0;
-	_field104 = 0;
-	_field108 = 0;
+CSauceDispensor::CSauceDispensor() : CBackground(),
+		_fieldEC(0), _fieldF0(0), _field104(0), _field108(0) {
 }
 
 void CSauceDispensor::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string3, indent);
 	file->writeNumberLine(_fieldEC, indent);
 	file->writeNumberLine(_fieldF0, indent);
-	file->writeNumberLine(_fieldF4, indent);
-	file->writeNumberLine(_fieldF8, indent);
-	file->writeNumberLine(_fieldFC, indent);
-	file->writeNumberLine(_field100, indent);
+	file->writePoint(_pos1, indent);
+	file->writePoint(_pos2, indent);
 	file->writeNumberLine(_field104, indent);
 	file->writeNumberLine(_field108, indent);
 
@@ -51,12 +43,11 @@ void CSauceDispensor::save(SimpleFile *file, int indent) const {
 
 void CSauceDispensor::load(SimpleFile *file) {
 	file->readNumber();
+	_string3 = file->readString();
 	_fieldEC = file->readNumber();
 	_fieldF0 = file->readNumber();
-	_fieldF4 = file->readNumber();
-	_fieldF8 = file->readNumber();
-	_fieldFC = file->readNumber();
-	_field100 = file->readNumber();
+	_pos1 = file->readPoint();
+	_pos2 = file->readPoint();
 	_field104 = file->readNumber();
 	_field108 = file->readNumber();
 
diff --git a/engines/titanic/game/sauce_dispensor.h b/engines/titanic/game/sauce_dispensor.h
index 791839d..fd9afd9 100644
--- a/engines/titanic/game/sauce_dispensor.h
+++ b/engines/titanic/game/sauce_dispensor.h
@@ -32,10 +32,8 @@ public:
 	CString _string3;
 	int _fieldEC;
 	int _fieldF0;
-	int _fieldF4;
-	int _fieldF8;
-	int _fieldFC;
-	int _field100;
+	Common::Point _pos1;
+	Common::Point _pos2;
 	int _field104;
 	int _field108;
 public:
diff --git a/engines/titanic/game/sgt/enter_exit_mini_lift.cpp b/engines/titanic/game/sgt/enter_exit_mini_lift.cpp
new file mode 100644
index 0000000..a7f85b9
--- /dev/null
+++ b/engines/titanic/game/sgt/enter_exit_mini_lift.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/enter_exit_mini_lift.h"
+
+namespace Titanic {
+
+void CEnterExitMiniLift::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	
+	CSGTNavigation::save(file, indent);
+}
+
+void CEnterExitMiniLift::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+
+	CSGTNavigation::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/enter_exit_mini_lift.h b/engines/titanic/game/sgt/enter_exit_mini_lift.h
new file mode 100644
index 0000000..417e25d
--- /dev/null
+++ b/engines/titanic/game/sgt/enter_exit_mini_lift.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_EXIT_MINI_LIFT_H
+#define TITANIC_ENTER_EXIT_MINI_LIFT_H
+
+#include "titanic/game/sgt/sgt_navigation.h"
+
+namespace Titanic {
+
+class CEnterExitMiniLift : public CSGTNavigation {
+private:
+	int _fieldBC;
+	int _fieldC0;
+public:
+	CEnterExitMiniLift() : CSGTNavigation(), _fieldBC(0), _fieldC0(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEnterExitMiniLift"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_EXIT_MINI_LIFT_H */
diff --git a/engines/titanic/game/sgt/sgt_navigation.cpp b/engines/titanic/game/sgt/sgt_navigation.cpp
index eba37fd..666459b 100644
--- a/engines/titanic/game/sgt/sgt_navigation.cpp
+++ b/engines/titanic/game/sgt/sgt_navigation.cpp
@@ -24,13 +24,31 @@
 
 namespace Titanic {
 
+CSGTNavigationStatics *CSGTNavigation::_statics;
+
+void CSGTNavigation::init() {
+	_statics = new CSGTNavigationStatics();
+}
+
+void CSGTNavigation::deinit() {
+	delete _statics;
+}
+
 void CSGTNavigation::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_statics->_v1, indent);
+	file->writeQuotedLine(_statics->_v2, indent);
+	file->writeQuotedLine(_statics->_v3, indent);
+
 	CGameObject::save(file, indent);
 }
 
 void CSGTNavigation::load(SimpleFile *file) {
 	file->readNumber();
+	_statics->_v1 = file->readNumber();
+	_statics->_v2 = file->readString();
+	_statics->_v3 = file->readString();
+
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/sgt/sgt_navigation.h b/engines/titanic/game/sgt/sgt_navigation.h
index 15c903f..539a607 100644
--- a/engines/titanic/game/sgt/sgt_navigation.h
+++ b/engines/titanic/game/sgt/sgt_navigation.h
@@ -27,8 +27,19 @@
 
 namespace Titanic {
 
+struct CSGTNavigationStatics {
+	int _v1;
+	CString _v2;
+	CString _v3;
+};
+
 class CSGTNavigation : public CGameObject {
+private:
+	static CSGTNavigationStatics *_statics;
 public:
+	static void init();
+	static void deinit();
+
 	/**
 	 * Return the class name
 	 */
diff --git a/engines/titanic/game/sgt/sgt_restaurant_doors.cpp b/engines/titanic/game/sgt/sgt_restaurant_doors.cpp
index e7d8f7b..1e4a167 100644
--- a/engines/titanic/game/sgt/sgt_restaurant_doors.cpp
+++ b/engines/titanic/game/sgt/sgt_restaurant_doors.cpp
@@ -26,11 +26,13 @@ namespace Titanic {
 
 void CSGTRestaurantDoors::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
 	CGameObject::save(file, indent);
 }
 
 void CSGTRestaurantDoors::load(SimpleFile *file) {
 	file->readNumber();
+	_fieldBC = file->readNumber();
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/sgt/sgt_restaurant_doors.h b/engines/titanic/game/sgt/sgt_restaurant_doors.h
index 287452e..904c0c6 100644
--- a/engines/titanic/game/sgt/sgt_restaurant_doors.h
+++ b/engines/titanic/game/sgt/sgt_restaurant_doors.h
@@ -28,7 +28,11 @@
 namespace Titanic {
 
 class CSGTRestaurantDoors : public CGameObject {
+private:
+	int _fieldBC;
 public:
+	CSGTRestaurantDoors() : CGameObject(), _fieldBC(0) {}
+
 	/**
 	 * Return the class name
 	 */
diff --git a/engines/titanic/game/transport/gondolier.cpp b/engines/titanic/game/transport/gondolier.cpp
new file mode 100644
index 0000000..f67a3b6
--- /dev/null
+++ b/engines/titanic/game/transport/gondolier.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/transport/gondolier.h"
+
+namespace Titanic {
+
+void CGondolier::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CTransport::save(file, indent);
+}
+
+void CGondolier::load(SimpleFile *file) {
+	file->readNumber();
+	CTransport::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/transport/gondolier.h b/engines/titanic/game/transport/gondolier.h
new file mode 100644
index 0000000..1d874be
--- /dev/null
+++ b/engines/titanic/game/transport/gondolier.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GONDOLIER_H
+#define TITANIC_GONDOLIER_H
+
+#include "titanic/game/transport/transport.h"
+
+namespace Titanic {
+
+class CGondolier : public CTransport {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGondolier"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GONDOLIER_H */
diff --git a/engines/titanic/game/transport/lift.cpp b/engines/titanic/game/transport/lift.cpp
new file mode 100644
index 0000000..1e21b9f
--- /dev/null
+++ b/engines/titanic/game/transport/lift.cpp
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/transport/lift.h"
+
+namespace Titanic {
+
+int CLift::_v1;
+int CLift::_v2;
+int CLift::_v3;
+int CLift::_v4;
+int CLift::_v5;
+int CLift::_v6;
+
+void CLift::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+	file->writeNumberLine(_v3, indent);
+	file->writeNumberLine(_v4, indent);
+	file->writeNumberLine(_v5, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_v6, indent);
+
+	CTransport::save(file, indent);
+}
+
+void CLift::load(SimpleFile *file) {
+	file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+	_v3 = file->readNumber();
+	_v4 = file->readNumber();
+	_v5 = file->readNumber();
+	_fieldF8 = file->readNumber();
+	_v6 = file->readNumber();
+
+	CTransport::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h
new file mode 100644
index 0000000..acb5fde
--- /dev/null
+++ b/engines/titanic/game/transport/lift.h
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+#ifndef TITANIC_LIFT_H
+#define TITANIC_LIFT_H
+
+#include "titanic/game/transport/transport.h"
+
+namespace Titanic {
+
+class CLift : public CTransport {
+private:
+	static int _v1;
+	static int _v2;
+	static int _v3;
+	static int _v4;
+	static int _v5;
+	static int _v6;
+
+	int _fieldF8;
+public:
+	CLift() : CTransport(), _fieldF8(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLift"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LIFT_H */
diff --git a/engines/titanic/game/transport/lift_indicator.cpp b/engines/titanic/game/transport/lift_indicator.cpp
new file mode 100644
index 0000000..ebeaf55
--- /dev/null
+++ b/engines/titanic/game/transport/lift_indicator.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/transport/lift_indicator.h"
+
+namespace Titanic {
+
+CLiftindicator::CLiftindicator() : CLift(),
+		_fieldFC(0), _field108(0), _field10C(0) {
+}
+
+void CLiftindicator::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldFC, indent);
+	file->writePoint(_pos2, indent);
+	file->writeNumberLine(_field108, indent);
+	file->writeNumberLine(_field10C, indent);
+
+	CLift::save(file, indent);
+}
+
+void CLiftindicator::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldFC = file->readNumber();
+	_pos2 = file->readPoint();
+	_field108 = file->readNumber();
+	_field10C = file->readNumber();
+
+	CLift::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/transport/lift_indicator.h b/engines/titanic/game/transport/lift_indicator.h
new file mode 100644
index 0000000..bbd6cb2
--- /dev/null
+++ b/engines/titanic/game/transport/lift_indicator.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LIFT_INDICATOR_H
+#define TITANIC_LIFT_INDICATOR_H
+
+#include "titanic/game/transport/lift.h"
+
+namespace Titanic {
+
+class CLiftindicator : public CLift {
+private:
+	int _fieldFC;
+	Common::Point _pos2;
+	int _field108;
+	int _field10C;
+public:
+	CLiftindicator();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLiftindicator"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LIFT_INDICATOR_H */
diff --git a/engines/titanic/game/transport/pellerator.cpp b/engines/titanic/game/transport/pellerator.cpp
new file mode 100644
index 0000000..1ab8935
--- /dev/null
+++ b/engines/titanic/game/transport/pellerator.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+#include "titanic/game/transport/pellerator.h"
+
+namespace Titanic {
+
+void CPellerator::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CTransport::save(file, indent);
+}
+
+void CPellerator::load(SimpleFile *file) {
+	file->readNumber();
+	CTransport::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/transport/pellerator.h b/engines/titanic/game/transport/pellerator.h
new file mode 100644
index 0000000..6ccc56f
--- /dev/null
+++ b/engines/titanic/game/transport/pellerator.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+#ifndef TITANIC_PELLERATOR_H
+#define TITANIC_PELLERATOR_H
+
+#include "titanic/game/transport/transport.h"
+
+namespace Titanic {
+
+class CPellerator : public CTransport {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPellerator"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PELLERATOR_H */
diff --git a/engines/titanic/game/transport/service_elevator.cpp b/engines/titanic/game/transport/service_elevator.cpp
new file mode 100644
index 0000000..df88c13
--- /dev/null
+++ b/engines/titanic/game/transport/service_elevator.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/transport/service_elevator.h"
+
+namespace Titanic {
+
+CServiceElevator::CServiceElevator() : CTransport(),
+	_fieldF8(0), _fieldFC(0), _field100(0), _field104(0) {
+}
+
+void CServiceElevator::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_fieldFC, indent);
+	file->writeNumberLine(_field100, indent);
+	file->writeNumberLine(_field104, indent);
+
+	CTransport::save(file, indent);
+}
+
+void CServiceElevator::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldF8 = file->readNumber();
+	_fieldFC = file->readNumber();
+	_field100 = file->readNumber();
+	_field104 = file->readNumber();
+
+	CTransport::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/transport/service_elevator.h b/engines/titanic/game/transport/service_elevator.h
new file mode 100644
index 0000000..b41c6b1
--- /dev/null
+++ b/engines/titanic/game/transport/service_elevator.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SERVICE_ELEVATOR_H
+#define TITANIC_SERVICE_ELEVATOR_H
+
+#include "titanic/game/transport/transport.h"
+
+namespace Titanic {
+
+class CServiceElevator : public CTransport {
+public:
+	int _fieldF8;
+	int _fieldFC;
+	int _field100;
+	int _field104;
+public:
+	CServiceElevator();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CServiceElevator"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SERVICE_ELEVATOR_H */
diff --git a/engines/titanic/game/transport/transport.cpp b/engines/titanic/game/transport/transport.cpp
new file mode 100644
index 0000000..ef31a07
--- /dev/null
+++ b/engines/titanic/game/transport/transport.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/transport/transport.h"
+
+namespace Titanic {
+
+CTransport::CTransport() : CMobile(), _string1("*.*.*") {
+}
+
+void CTransport::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	CMobile::save(file, indent);
+}
+
+void CTransport::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+
+	CMobile::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/transport/transport.h b/engines/titanic/game/transport/transport.h
new file mode 100644
index 0000000..6e3f1a2
--- /dev/null
+++ b/engines/titanic/game/transport/transport.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TRANSPORT_H
+#define TITANIC_TRANSPORT_H
+
+#include "titanic/npcs/mobile.h"
+
+namespace Titanic {
+
+class CTransport : public CMobile {
+public:
+	CString _string1;
+	CString _string2;
+public:
+	CTransport();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTransport"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TRANSPORT_H */
diff --git a/engines/titanic/gfx/volume_control.cpp b/engines/titanic/gfx/volume_control.cpp
new file mode 100644
index 0000000..7c82916
--- /dev/null
+++ b/engines/titanic/gfx/volume_control.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/volume_control.h"
+
+namespace Titanic {
+
+CVolumeControl::CVolumeControl() : CGameObject() {
+}
+
+void CVolumeControl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldCC, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CVolumeControl::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_string1 = file->readString();
+	_fieldCC = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/volume_control.h b/engines/titanic/gfx/volume_control.h
new file mode 100644
index 0000000..5ff5c73
--- /dev/null
+++ b/engines/titanic/gfx/volume_control.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_VOLUME_CONTROL_H
+#define TITANIC_VOLUME_CONTROL_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CVolumeControl : public CGameObject {
+private:
+	int _fieldBC;
+	CString _string1;
+	int _fieldCC;
+public:
+	CVolumeControl();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CVolumeControl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_VOLUME_CONTROL_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index f992786..87d5774 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -127,6 +127,7 @@ MODULE_OBJS := \
 	game/enter_exit_sec_class_mini_lift.o \
 	game/enter_exit_view.o \
 	game/enter_sec_class_state.o \
+	game/hammer_dispensor.o \
 	game/hammer_dispensor_button.o \
 	game/exit_lift.o \
 	game/exit_pellerator.o \
@@ -156,6 +157,9 @@ MODULE_OBJS := \
 	game/maitred_arm_holder.o \
 	game/missiveomat.o \
 	game/movie_tester.o \
+	game/music_console_button.o \
+	game/music_room_phonograph.o \
+	game/music_room_stop_phonograph_button.o \
 	game/music_system_lock.o \
 	game/musical_instrument.o \
 	game/navigation_computer.o \
@@ -167,6 +171,7 @@ MODULE_OBJS := \
 	game/pet_disabler.o \
 	game/pet_graphic2.o \
 	game/pet_graphic.o \
+	game/phonograph.o \
 	game/phonograph_lid.o \
 	game/place_holder.o \
 	game/play_music_button.o \
@@ -176,6 +181,7 @@ MODULE_OBJS := \
 	game/replacement_ear.o \
 	game/reserved_table.o \
 	game/restaurant_cylinder_holder.o \
+	game/restaurant_phonograph.o \
 	game/room_item.o \
 	game/sauce_dispensor.o \
 	game/search_point.o \
@@ -226,6 +232,13 @@ MODULE_OBJS := \
 	game/pet/pet_sounds.o \
 	game/pet/pet_transition.o \
 	game/pet/pet_transport.o \
+	game/transport/gondolier.o \
+	game/transport/lift.o \
+	game/transport/lift_indicator.o \
+	game/transport/pellerator.o \
+	game/transport/service_elevator.o \
+	game/transport/transport.o \
+	game/sgt/enter_exit_mini_lift.o \
 	game/sgt/sgt_doors.o \
 	game/sgt/sgt_navigation.o \
 	game/sgt/sgt_restaurant_doors.o \
@@ -263,6 +276,7 @@ MODULE_OBJS := \
 	gfx/status_change_button.o \
 	gfx/st_button.o \
 	gfx/toggle_switch.o \
+	gfx/volume_control.o \
 	messages/auto_sound_event.o \
 	messages/door_auto_sound_event.o \
 	messages/messages.o \
@@ -300,6 +314,7 @@ MODULE_OBJS := \
 	sound/auto_sound_player.o \
 	sound/background_sound_maker.o \
 	sound/music_player.o \
+	sound/restricted_auto_music_player.o \
 	sound/seasonal_music_player.o \
 	sound/titania_speech.o \
 	sound/trigger_auto_music_player.o
diff --git a/engines/titanic/sound/music_player.cpp b/engines/titanic/sound/music_player.cpp
index 39e97ed..6bab2d9 100644
--- a/engines/titanic/sound/music_player.cpp
+++ b/engines/titanic/sound/music_player.cpp
@@ -26,11 +26,21 @@ namespace Titanic {
 
 void CMusicPlayer::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeNumberLine(_fieldD0, indent);
+
 	CGameObject::save(file, indent);
 }
 
 void CMusicPlayer::load(SimpleFile *file) {
 	file->readNumber();
+	_fieldBC = file->readNumber();
+	_string1 = file->readString();
+	_fieldCC = file->readNumber();
+	_fieldD0 = file->readNumber();
+
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/sound/restricted_auto_music_player.cpp b/engines/titanic/sound/restricted_auto_music_player.cpp
new file mode 100644
index 0000000..442dc90
--- /dev/null
+++ b/engines/titanic/sound/restricted_auto_music_player.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/restricted_auto_music_player.h"
+
+namespace Titanic {
+
+void CRestrictedAutoMusicPlayer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeQuotedLine(_string4, indent);
+	file->writeQuotedLine(_string5, indent);
+	file->writeQuotedLine(_string6, indent);
+
+	CAutoMusicPlayer::save(file, indent);
+}
+
+void CRestrictedAutoMusicPlayer::load(SimpleFile *file) {
+	file->readNumber();
+	_string3 = file->readString();
+	_string4 = file->readString();
+	_string5 = file->readString();
+	_string6 = file->readString();
+
+	CAutoMusicPlayer::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/restricted_auto_music_player.h b/engines/titanic/sound/restricted_auto_music_player.h
new file mode 100644
index 0000000..ab8e26e
--- /dev/null
+++ b/engines/titanic/sound/restricted_auto_music_player.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RESTRICTED_AUTO_MUSIC_PLAYER_H
+#define TITANIC_RESTRICTED_AUTO_MUSIC_PLAYER_H
+
+#include "titanic/sound/auto_music_player.h"
+
+namespace Titanic {
+
+class CRestrictedAutoMusicPlayer : public CAutoMusicPlayer {
+private:
+	CString _string3;
+	CString _string4;
+	CString _string5;
+	CString _string6;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CRestrictedAutoMusicPlayer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RESTRICTED_AUTO_MUSIC_PLAYER_H */
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 62a0ae2..03dbacd 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -31,6 +31,7 @@
 #include "titanic/core/saveable_object.h"
 #include "titanic/game/enter_exit_first_class_state.h"
 #include "titanic/game/parrot/parrot_lobby_object.h"
+#include "titanic/game/sgt/sgt_navigation.h"
 #include "titanic/game/sgt/sgt_state_room.h"
 #include "titanic/carry/hose.h"
 
@@ -59,6 +60,7 @@ void TitanicEngine::initialize() {
 	CParrotLobbyObject::init();
 	CEnterExitFirstClassState::init();
 	CHose::init();
+	CSGTNavigation::init();
 	CSGTStateRoom::init();
 
 	_screenManager = new OSScreenManager(this);
@@ -69,6 +71,7 @@ void TitanicEngine::initialize() {
 void TitanicEngine::deinitialize() {
 	CEnterExitFirstClassState::deinit();
 	CHose::deinit();
+	CSGTNavigation::deinit();
 	CSGTStateRoom::deinit();
 }
 


Commit: 9ce8e1130cc32c49e31a2160b2f4034f05430b4b
    https://github.com/scummvm/scummvm/commit/9ce8e1130cc32c49e31a2160b2f4034f05430b4b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-01T20:41:07-05:00

Commit Message:
TITANIC: Lots more miscellaneous classes

Changed paths:
  A engines/titanic/core/turn_on_turn_off.cpp
  A engines/titanic/core/turn_on_turn_off.h
  A engines/titanic/moves/enter_bridge.cpp
  A engines/titanic/moves/enter_bridge.h
  A engines/titanic/moves/enter_exit_first_class_state.cpp
  A engines/titanic/moves/enter_exit_first_class_state.h
  A engines/titanic/moves/enter_exit_mini_lift.cpp
  A engines/titanic/moves/enter_exit_mini_lift.h
  A engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
  A engines/titanic/moves/enter_exit_sec_class_mini_lift.h
  A engines/titanic/moves/enter_exit_view.cpp
  A engines/titanic/moves/enter_exit_view.h
  A engines/titanic/moves/enter_sec_class_state.cpp
  A engines/titanic/moves/enter_sec_class_state.h
  A engines/titanic/moves/exit_lift.cpp
  A engines/titanic/moves/exit_lift.h
  A engines/titanic/moves/exit_pellerator.cpp
  A engines/titanic/moves/exit_pellerator.h
  A engines/titanic/sound/bird_song.cpp
  A engines/titanic/sound/bird_song.h
  A engines/titanic/sound/gondolier_song.cpp
  A engines/titanic/sound/gondolier_song.h
  A engines/titanic/sound/room_auto_sound_player.cpp
  A engines/titanic/sound/room_auto_sound_player.h
  A engines/titanic/sound/water_lapping_sounds.cpp
  A engines/titanic/sound/water_lapping_sounds.h
  R engines/titanic/game/enter_bridge.cpp
  R engines/titanic/game/enter_bridge.h
  R engines/titanic/game/enter_exit_first_class_state.cpp
  R engines/titanic/game/enter_exit_first_class_state.h
  R engines/titanic/game/enter_exit_sec_class_mini_lift.cpp
  R engines/titanic/game/enter_exit_sec_class_mini_lift.h
  R engines/titanic/game/enter_exit_view.cpp
  R engines/titanic/game/enter_exit_view.h
  R engines/titanic/game/enter_sec_class_state.cpp
  R engines/titanic/game/enter_sec_class_state.h
  R engines/titanic/game/exit_lift.cpp
  R engines/titanic/game/exit_lift.h
  R engines/titanic/game/exit_pellerator.cpp
  R engines/titanic/game/exit_pellerator.h
  R engines/titanic/game/sgt/enter_exit_mini_lift.cpp
  R engines/titanic/game/sgt/enter_exit_mini_lift.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/end_credit_text.cpp
    engines/titanic/game/end_credit_text.h
    engines/titanic/game/end_game_credits.cpp
    engines/titanic/game/end_game_credits.h
    engines/titanic/game/get_lift_eye2.cpp
    engines/titanic/game/get_lift_eye2.h
    engines/titanic/game/starling_puret.cpp
    engines/titanic/game/starling_puret.h
    engines/titanic/module.mk
    engines/titanic/sound/auto_sound_player.cpp
    engines/titanic/sound/auto_sound_player.h
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 8328aa5..08a3668 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -72,6 +72,7 @@
 #include "titanic/core/static_image.h"
 #include "titanic/core/turn_on_object.h"
 #include "titanic/core/turn_on_play_sound.h"
+#include "titanic/core/turn_on_turn_off.h"
 #include "titanic/core/tree_item.h"
 #include "titanic/core/view_item.h"
 
@@ -107,8 +108,11 @@
 #include "titanic/game/eject_phonograph_button.h"
 #include "titanic/game/emma_control.h"
 #include "titanic/game/empty_nut_bowl.h"
-#include "titanic/game/enter_exit_first_class_state.h"
-#include "titanic/game/enter_exit_view.h"
+#include "titanic/game/end_credit_text.h"
+#include "titanic/game/end_credits.h"
+#include "titanic/game/end_explode_ship.h"
+#include "titanic/game/end_game_credits.h"
+#include "titanic/game/end_sequence_control.h"
 #include "titanic/game/fan.h"
 #include "titanic/game/fan_control.h"
 #include "titanic/game/fan_decrease.h"
@@ -116,6 +120,7 @@
 #include "titanic/game/fan_noises.h"
 #include "titanic/game/floor_indicator.h"
 #include "titanic/game/games_console.h"
+#include "titanic/game/get_lift_eye2.h"
 #include "titanic/game/hammer_clip.h"
 #include "titanic/game/hammer_dispensor.h"
 #include "titanic/game/hammer_dispensor_button.h"
@@ -185,7 +190,6 @@
 #include "titanic/game/pet/pet_sounds.h"
 #include "titanic/game/pet/pet_transition.h"
 #include "titanic/game/pet/pet_transport.h"
-#include "titanic/game/sgt/enter_exit_mini_lift.h"
 #include "titanic/game/sgt/sgt_doors.h"
 #include "titanic/game/sgt/sgt_navigation.h"
 #include "titanic/game/sgt/sgt_restaurant_doors.h"
@@ -241,8 +245,13 @@
 #include "titanic/messages/pet_messages.h"
 
 #include "titanic/moves/enter_bomb_room.h"
+#include "titanic/moves/enter_bridge.h"
+#include "titanic/moves/enter_exit_first_class_state.h"
+#include "titanic/moves/enter_exit_mini_lift.h"
+#include "titanic/moves/enter_exit_view.h"
 #include "titanic/moves/exit_arboretum.h"
 #include "titanic/moves/exit_bridge.h"
+#include "titanic/moves/exit_lift.h"
 #include "titanic/moves/exit_state_room.h"
 #include "titanic/moves/move_player_in_parrot_room.h"
 #include "titanic/moves/move_player_to.h"
@@ -271,11 +280,14 @@
 #include "titanic/sound/auto_music_player_base.h"
 #include "titanic/sound/auto_sound_player.h"
 #include "titanic/sound/background_sound_maker.h"
+#include "titanic/sound/bird_song.h"
+#include "titanic/sound/gondolier_song.h"
 #include "titanic/sound/music_player.h"
 #include "titanic/sound/restricted_auto_music_player.h"
 #include "titanic/sound/seasonal_music_player.h"
 #include "titanic/sound/titania_speech.h"
 #include "titanic/sound/trigger_auto_music_player.h"
+#include "titanic/sound/water_lapping_sounds.h"
 
 namespace Titanic {
 
@@ -337,6 +349,7 @@ DEFFN(CProjectItem);
 DEFFN(CStaticImage);
 DEFFN(CTurnOnObject);
 DEFFN(CTurnOnPlaySound);
+DEFFN(CTurnOnTurnOff);
 DEFFN(CTreeItem);
 DEFFN(CViewItem);
 
@@ -370,8 +383,11 @@ DEFFN(CEarSweetBowl);
 DEFFN(CEjectPhonographButton);
 DEFFN(CEmmaControl);
 DEFFN(CEmptyNutBowl);
-DEFFN(CEnterExitFirstClassState);
-DEFFN(CEnterExitView);
+DEFFN(CEndCreditText);
+DEFFN(CEndCredits);
+DEFFN(CEndExplodeShip);
+DEFFN(CEndGameCredits);
+DEFFN(CEndSequenceControl);
 DEFFN(CFan);
 DEFFN(CFanControl);
 DEFFN(CFanDecrease);
@@ -379,6 +395,7 @@ DEFFN(CFanIncrease);
 DEFFN(CFanNoises);
 DEFFN(CFloorIndicator);
 DEFFN(CGamesConsole);
+DEFFN(CGetLiftEye2);
 DEFFN(CHammerClip);
 DEFFN(CHammerDispensor);
 DEFFN(CHammerDispensorButton);
@@ -677,8 +694,12 @@ DEFFN(CVirtualKeyCharMsg);
 DEFFN(CVisibleMsg);
 
 DEFFN(CEnterBombRoom);
+DEFFN(CEnterBridge);
+DEFFN(CEnterExitFirstClassState);
+DEFFN(CEnterExitView);
 DEFFN(CExitArboretum);
 DEFFN(CExitBridge);
+DEFFN(CExitLift);
 DEFFN(CExitStateRoom);
 DEFFN(CMovePlayerInParrotRoom);
 DEFFN(CMovePlayerTo);
@@ -706,11 +727,14 @@ DEFFN(CAutoMusicPlayer);
 DEFFN(CAutoMusicPlayerBase);
 DEFFN(CAutoSoundPlayer);
 DEFFN(CBackgroundSoundMaker);
+DEFFN(CBirdSong);
+DEFFN(CGondolierSong);
 DEFFN(CMusicPlayer);
 DEFFN(CRestrictedAutoMusicPlayer);
 DEFFN(CSeasonalMusicPlayer);
 DEFFN(CTitaniaSpeech);
 DEFFN(CTriggerAutoMusicPlayer);
+DEFFN(CWaterLappingSounds);
 
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
@@ -764,9 +788,10 @@ void CSaveableObject::initClassList() {
 	ADDFN(CNodeItem);
 	ADDFN(CProjectItem);
 	ADDFN(CStaticImage);
-	ADDFN(CTreeItem);
 	ADDFN(CTurnOnObject);
+	ADDFN(CTreeItem);
 	ADDFN(CTurnOnPlaySound);
+	ADDFN(CTurnOnTurnOff);
 	ADDFN(CViewItem);
 
 	ADDFN(CAnnounce);
@@ -800,8 +825,11 @@ void CSaveableObject::initClassList() {
 	ADDFN(CEjectPhonographButton);
 	ADDFN(CEmmaControl);
 	ADDFN(CEmptyNutBowl);
-	ADDFN(CEnterExitFirstClassState);
-	ADDFN(CEnterExitView);
+	ADDFN(CEndCreditText);
+	ADDFN(CEndCredits);
+	ADDFN(CEndExplodeShip);
+	ADDFN(CEndGameCredits);
+	ADDFN(CEndSequenceControl);
 	ADDFN(CFan);
 	ADDFN(CFanControl);
 	ADDFN(CFanDecrease);
@@ -809,6 +837,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CFanNoises);
 	ADDFN(CFloorIndicator);
 	ADDFN(CGamesConsole);
+	ADDFN(CGetLiftEye2);
 	ADDFN(CHammerClip);
 	ADDFN(CHammerDispensor);
 	ADDFN(CHammerDispensorButton);
@@ -1107,8 +1136,12 @@ void CSaveableObject::initClassList() {
 	ADDFN(CVisibleMsg);
 
 	ADDFN(CEnterBombRoom);
+	ADDFN(CEnterBridge);
+	ADDFN(CEnterExitFirstClassState);
+	ADDFN(CEnterExitView);
 	ADDFN(CExitArboretum);
 	ADDFN(CExitBridge);
+	ADDFN(CExitLift);
 	ADDFN(CExitStateRoom);
 	ADDFN(CMovePlayerInParrotRoom);
 	ADDFN(CMovePlayerTo);
@@ -1137,12 +1170,15 @@ void CSaveableObject::initClassList() {
 	ADDFN(CAutoMusicPlayerBase);
 	ADDFN(CAutoSoundPlayer);
 	ADDFN(CBackgroundSoundMaker);
+	ADDFN(CBirdSong);
+	ADDFN(CGondolierSong);
 	ADDFN(CMusicPlayer);
 	ADDFN(CRestrictedAutoMusicPlayer);
 	ADDFN(CSeasonalMusicPlayer);
 	ADDFN(CAutoMusicPlayer);
 	ADDFN(CTitaniaSpeech);
 	ADDFN(CTriggerAutoMusicPlayer);
+	ADDFN(CWaterLappingSounds);
 }
 
 void CSaveableObject::freeClassList() {
diff --git a/engines/titanic/core/turn_on_turn_off.cpp b/engines/titanic/core/turn_on_turn_off.cpp
new file mode 100644
index 0000000..a6a65e3
--- /dev/null
+++ b/engines/titanic/core/turn_on_turn_off.cpp
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/turn_on_turn_off.h"
+
+namespace Titanic {
+
+CTurnOnTurnOff::CTurnOnTurnOff() : CBackground(), _fieldE0(0),
+	_fieldE4(0), _fieldE8(0), _fieldEC(0), _fieldF0(0) {
+}
+
+void CTurnOnTurnOff::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_fieldF0, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CTurnOnTurnOff::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_fieldF0 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/turn_on_turn_off.h b/engines/titanic/core/turn_on_turn_off.h
new file mode 100644
index 0000000..41a0156
--- /dev/null
+++ b/engines/titanic/core/turn_on_turn_off.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TURN_ON_TURN_OFF_H
+#define TITANIC_TURN_ON_TURN_OFF_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CTurnOnTurnOff : public CBackground {
+private:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+public:
+	CTurnOnTurnOff();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTurnOnTurnOff"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TURN_ON_TURN_OFF_H */
diff --git a/engines/titanic/game/end_credit_text.cpp b/engines/titanic/game/end_credit_text.cpp
index 949c6e2..8ae83ac 100644
--- a/engines/titanic/game/end_credit_text.cpp
+++ b/engines/titanic/game/end_credit_text.cpp
@@ -26,11 +26,13 @@ namespace Titanic {
 
 void CEndCreditText::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
 }
 
 void CEndCreditText::load(SimpleFile *file) {
 	file->readNumber();
+	_value = file->readNumber();
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/end_credit_text.h b/engines/titanic/game/end_credit_text.h
index 258b1a3..de0e54d 100644
--- a/engines/titanic/game/end_credit_text.h
+++ b/engines/titanic/game/end_credit_text.h
@@ -28,7 +28,11 @@
 namespace Titanic {
 
 class CEndCreditText : public CGameObject {
+private:
+	int _value;
 public:
+	CEndCreditText() : CGameObject(), _value(0) {}
+
 	/**
 	 * Return the class name
 	 */
diff --git a/engines/titanic/game/end_game_credits.cpp b/engines/titanic/game/end_game_credits.cpp
index 36c0510..56b06e6 100644
--- a/engines/titanic/game/end_game_credits.cpp
+++ b/engines/titanic/game/end_game_credits.cpp
@@ -20,17 +20,26 @@
  *
  */
 
-#include "titanic/game/nut_replacer.h"
+#include "titanic/game/end_game_credits.h"
 
 namespace Titanic {
 
-void CNutReplacer::save(SimpleFile *file, int indent) const {
+CEndGameCredits::CEndGameCredits() : CGameObject(), _fieldBC(0) {
+}
+
+void CEndGameCredits::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writePoint(_pos1, indent);
+
 	CGameObject::save(file, indent);
 }
 
-void CNutReplacer::load(SimpleFile *file) {
+void CEndGameCredits::load(SimpleFile *file) {
 	file->readNumber();
+	_fieldBC = file->readNumber();
+	_pos1 = file->readPoint();
+
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/end_game_credits.h b/engines/titanic/game/end_game_credits.h
index c243f9a..f8ec6b0 100644
--- a/engines/titanic/game/end_game_credits.h
+++ b/engines/titanic/game/end_game_credits.h
@@ -20,19 +20,24 @@
  *
  */
 
-#ifndef TITANIC_END_GAME_SHIP_H
-#define TITANIC_END_GAME_SHIP_H
+#ifndef TITANIC_END_GAME_CREDITS_H
+#define TITANIC_END_GAME_CREDITS_H
 
 #include "titanic/core/game_object.h"
 
 namespace Titanic {
 
-class CEndGameShip : public CGameObject {
+class CEndGameCredits : public CGameObject {
+private:
+	int _fieldBC;
+	Common::Point _pos1;
 public:
+	CEndGameCredits();
+
 	/**
 	 * Return the class name
 	 */
-	virtual const char *getClassName() const { return "CEndGameShip"; }
+	virtual const char *getClassName() const { return "CEndGameCredits"; }
 
 	/**
 	 * Save the data for the class to file
@@ -47,4 +52,4 @@ public:
 
 } // End of namespace Titanic
 
-#endif /* TITANIC_END_GAME_SHIP_H */
+#endif /* TITANIC_END_GAME_CREDITS_H */
diff --git a/engines/titanic/game/enter_bridge.cpp b/engines/titanic/game/enter_bridge.cpp
deleted file mode 100644
index 13e4a50..0000000
--- a/engines/titanic/game/enter_bridge.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/enter_bridge.h"
-
-namespace Titanic {
-
-void CEnterBridge::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_value, indent);
-	CGameObject::save(file, indent);
-}
-
-void CEnterBridge::load(SimpleFile *file) {
-	file->readNumber();
-	_value = file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/enter_bridge.h b/engines/titanic/game/enter_bridge.h
deleted file mode 100644
index bbc4cc9..0000000
--- a/engines/titanic/game/enter_bridge.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_ENTER_BRIDGE_H
-#define TITANIC_ENTER_BRIDGE_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CEnterBridge : public CGameObject {
-public:
-	int _value;
-public:
-	CEnterBridge() : CGameObject(), _value(1) {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEnterBridge"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ENTER_BRIDGE_H */
diff --git a/engines/titanic/game/enter_exit_first_class_state.cpp b/engines/titanic/game/enter_exit_first_class_state.cpp
deleted file mode 100644
index 7fa191b..0000000
--- a/engines/titanic/game/enter_exit_first_class_state.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/enter_exit_first_class_state.h"
-
-namespace Titanic {
-
-CString *CEnterExitFirstClassState::_v1;
-
-void CEnterExitFirstClassState::init() {
-	_v1 = new CString();
-}
-
-void CEnterExitFirstClassState::deinit() {
-	delete _v1;
-}
-
-void CEnterExitFirstClassState::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(*_v1, indent);
-	CGameObject::save(file, indent);
-}
-
-void CEnterExitFirstClassState::load(SimpleFile *file) {
-	file->readNumber();
-	*_v1 = file->readString();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/enter_exit_first_class_state.h b/engines/titanic/game/enter_exit_first_class_state.h
deleted file mode 100644
index f7bc4c6..0000000
--- a/engines/titanic/game/enter_exit_first_class_state.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_ENTER_EXIT_FIRST_CLASS_STATE_H
-#define TITANIC_ENTER_EXIT_FIRST_CLASS_STATE_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CEnterExitFirstClassState : public CGameObject {
-public:
-	static CString *_v1;
-
-	/**
-	 * Initialize static data
-	 */
-	static void init();
-
-	/**
-	 * De-initialize static data
-	 */
-	static void deinit();
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBowlUnlocker"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ENTER_EXIT_FIRST_CLASS_STATE_H */
diff --git a/engines/titanic/game/enter_exit_sec_class_mini_lift.cpp b/engines/titanic/game/enter_exit_sec_class_mini_lift.cpp
deleted file mode 100644
index d4162ac..0000000
--- a/engines/titanic/game/enter_exit_sec_class_mini_lift.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/enter_exit_sec_class_mini_lift.h"
-
-namespace Titanic {
-
-void CEnterExitSecClassMiniLift::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
-}
-
-void CEnterExitSecClassMiniLift::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/enter_exit_sec_class_mini_lift.h b/engines/titanic/game/enter_exit_sec_class_mini_lift.h
deleted file mode 100644
index aa3f9b3..0000000
--- a/engines/titanic/game/enter_exit_sec_class_mini_lift.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_ENTER_EXIT_SEC_CLASS_MINI_LIFT_H
-#define TITANIC_ENTER_EXIT_SEC_CLASS_MINI_LIFT_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CEnterExitSecClassMiniLift : public CGameObject {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEnterExitSecClassMiniLift"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ENTER_EXIT_SEC_CLASS_MINI_LIFT_H */
diff --git a/engines/titanic/game/enter_exit_view.cpp b/engines/titanic/game/enter_exit_view.cpp
deleted file mode 100644
index e892161..0000000
--- a/engines/titanic/game/enter_exit_view.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/enter_exit_view.h"
-
-namespace Titanic {
-
-CEnterExitView::CEnterExitView() : CGameObject(), _fieldBC(0),
-	_fieldC0(0), _fieldC4(0), _fieldC8(0), _fieldCC(0) {
-}
-
-void CEnterExitView::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-	file->writeNumberLine(_fieldC4, indent);
-	file->writeNumberLine(_fieldC8, indent);
-	file->writeNumberLine(_fieldCC, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CEnterExitView::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-	_fieldC4 = file->readNumber();
-	_fieldC8 = file->readNumber();
-	_fieldCC = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/enter_exit_view.h b/engines/titanic/game/enter_exit_view.h
deleted file mode 100644
index 05ed63d..0000000
--- a/engines/titanic/game/enter_exit_view.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_ENTER_EXIT_VIEW_H
-#define TITANIC_ENTER_EXIT_VIEW_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CEnterExitView : public CGameObject {
-public:
-	int _fieldBC;
-	int _fieldC0;
-	int _fieldC4;
-	int _fieldC8;
-	int _fieldCC;
-public:
-	CEnterExitView();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEnterExitView"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ENTER_EXIT_VIEW_H */
diff --git a/engines/titanic/game/enter_sec_class_state.cpp b/engines/titanic/game/enter_sec_class_state.cpp
deleted file mode 100644
index 2a18e81..0000000
--- a/engines/titanic/game/enter_sec_class_state.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/enter_sec_class_state.h"
-
-namespace Titanic {
-
-void CEnterSecClassState::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_value1, indent);
-	file->writeNumberLine(_value2, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CEnterSecClassState::load(SimpleFile *file) {
-	file->readNumber();
-	_value1 = file->readNumber();
-	_value2 = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/enter_sec_class_state.h b/engines/titanic/game/enter_sec_class_state.h
deleted file mode 100644
index 5da623d..0000000
--- a/engines/titanic/game/enter_sec_class_state.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_ENTER_SEC_CLASS_STATE_H
-#define TITANIC_ENTER_SEC_CLASS_STATE_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CEnterSecClassState : public CGameObject {
-public:
-	int _value1, _value2;
-public:
-	CEnterSecClassState() : CGameObject(), _value1(0), _value2(0) {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEnterSecClassState"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ENTER_SEC_CLASS_STATE_H */
diff --git a/engines/titanic/game/exit_lift.cpp b/engines/titanic/game/exit_lift.cpp
deleted file mode 100644
index 82e4411..0000000
--- a/engines/titanic/game/exit_lift.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/exit_lift.h"
-
-namespace Titanic {
-
-void CExitLift::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_value1, indent);
-	file->writeNumberLine(_value2, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CExitLift::load(SimpleFile *file) {
-	file->readNumber();
-	_value1 = file->readNumber();
-	_value2 = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/exit_lift.h b/engines/titanic/game/exit_lift.h
deleted file mode 100644
index 9531fd6..0000000
--- a/engines/titanic/game/exit_lift.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_EXIT_LIFT_H
-#define TITANIC_EXIT_LIFT_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CExitLift : public CGameObject {
-public:
-	int _value1, _value2;
-public:
-	CExitLift() : CGameObject(), _value1(0), _value2(0) {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CExitLift"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_EXIT_LIFT_H */
diff --git a/engines/titanic/game/exit_pellerator.cpp b/engines/titanic/game/exit_pellerator.cpp
deleted file mode 100644
index 79754f8..0000000
--- a/engines/titanic/game/exit_pellerator.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/exit_pellerator.h"
-
-namespace Titanic {
-
-void CExitPellerator::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
-}
-
-void CExitPellerator::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/exit_pellerator.h b/engines/titanic/game/exit_pellerator.h
deleted file mode 100644
index 6185f61..0000000
--- a/engines/titanic/game/exit_pellerator.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_EXIT_PELLERATOR_H
-#define TITANIC_EXIT_PELLERATOR_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CExitPellerator : public CGameObject {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CExitPellerator"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_EXIT_PELLERATOR_H */
diff --git a/engines/titanic/game/get_lift_eye2.cpp b/engines/titanic/game/get_lift_eye2.cpp
index 67a7b43..472f884 100644
--- a/engines/titanic/game/get_lift_eye2.cpp
+++ b/engines/titanic/game/get_lift_eye2.cpp
@@ -24,13 +24,25 @@
 
 namespace Titanic {
 
+CString *CGetLiftEye2::_v1;
+
+void CGetLiftEye2::init() {
+	_v1 = new CString();
+}
+
+void CGetLiftEye2::deinit() {
+	delete _v1;
+}
+
 void CGetLiftEye2::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(*_v1, indent);
 	CGameObject::save(file, indent);
 }
 
 void CGetLiftEye2::load(SimpleFile *file) {
 	file->readNumber();
+	*_v1 = file->readString();
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
index baca120..e8149ca 100644
--- a/engines/titanic/game/get_lift_eye2.h
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -28,7 +28,12 @@
 namespace Titanic {
 
 class CGetLiftEye2 : public CGameObject {
+private:
+	static CString *_v1;
 public:
+	static void init();
+	static void deinit();
+
 	/**
 	 * Return the class name
 	 */
diff --git a/engines/titanic/game/sgt/enter_exit_mini_lift.cpp b/engines/titanic/game/sgt/enter_exit_mini_lift.cpp
deleted file mode 100644
index a7f85b9..0000000
--- a/engines/titanic/game/sgt/enter_exit_mini_lift.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/sgt/enter_exit_mini_lift.h"
-
-namespace Titanic {
-
-void CEnterExitMiniLift::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-	
-	CSGTNavigation::save(file, indent);
-}
-
-void CEnterExitMiniLift::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-
-	CSGTNavigation::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/enter_exit_mini_lift.h b/engines/titanic/game/sgt/enter_exit_mini_lift.h
deleted file mode 100644
index 417e25d..0000000
--- a/engines/titanic/game/sgt/enter_exit_mini_lift.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_ENTER_EXIT_MINI_LIFT_H
-#define TITANIC_ENTER_EXIT_MINI_LIFT_H
-
-#include "titanic/game/sgt/sgt_navigation.h"
-
-namespace Titanic {
-
-class CEnterExitMiniLift : public CSGTNavigation {
-private:
-	int _fieldBC;
-	int _fieldC0;
-public:
-	CEnterExitMiniLift() : CSGTNavigation(), _fieldBC(0), _fieldC0(1) {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEnterExitMiniLift"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ENTER_EXIT_MINI_LIFT_H */
diff --git a/engines/titanic/game/starling_puret.cpp b/engines/titanic/game/starling_puret.cpp
index 026128b..1fa0dc8 100644
--- a/engines/titanic/game/starling_puret.cpp
+++ b/engines/titanic/game/starling_puret.cpp
@@ -26,11 +26,13 @@ namespace Titanic {
 
 void CStarlingPuret::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
 }
 
 void CStarlingPuret::load(SimpleFile *file) {
 	file->readNumber();
+	_value = file->readNumber();
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/starling_puret.h b/engines/titanic/game/starling_puret.h
index 5c53a53b..5bfdd66 100644
--- a/engines/titanic/game/starling_puret.h
+++ b/engines/titanic/game/starling_puret.h
@@ -28,7 +28,11 @@
 namespace Titanic {
 
 class CStarlingPuret : public CGameObject {
+private:
+	int _value;
 public:
+	CStarlingPuret() : CGameObject(), _value(0) {}
+
 	/**
 	 * Return the class name
 	 */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 87d5774..d4bbed8 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -72,6 +72,7 @@ MODULE_OBJS := \
 	core/static_image.o \
 	core/turn_on_object.o \
 	core/turn_on_play_sound.o \
+	core/turn_on_turn_off.o \
 	core/tree_item.o \
 	core/view_item.o \
 	game/announce.o \
@@ -120,17 +121,10 @@ MODULE_OBJS := \
 	game/end_credit_text.o \
 	game/end_credits.o \
 	game/end_explode_ship.o \
-	game/end_game_cerdits.o \
+	game/end_game_credits.o \
 	game/end_sequence_control.o \
-	game/enter_bridge.o \
-	game/enter_exit_first_class_state.o \
-	game/enter_exit_sec_class_mini_lift.o \
-	game/enter_exit_view.o \
-	game/enter_sec_class_state.o \
 	game/hammer_dispensor.o \
 	game/hammer_dispensor_button.o \
-	game/exit_lift.o \
-	game/exit_pellerator.o \
 	game/fan.o \
 	game/fan_control.o \
 	game/fan_decrease.o \
@@ -238,7 +232,6 @@ MODULE_OBJS := \
 	game/transport/pellerator.o \
 	game/transport/service_elevator.o \
 	game/transport/transport.o \
-	game/sgt/enter_exit_mini_lift.o \
 	game/sgt/sgt_doors.o \
 	game/sgt/sgt_navigation.o \
 	game/sgt/sgt_restaurant_doors.o \
@@ -281,8 +274,16 @@ MODULE_OBJS := \
 	messages/door_auto_sound_event.o \
 	messages/messages.o \
 	moves/enter_bomb_room.o \
+	moves/enter_bridge.o \
+	moves/enter_exit_first_class_state.o \
+	moves/enter_exit_mini_lift.o \
+	moves/enter_exit_sec_class_mini_lift.o \
+	moves/enter_exit_view.o \
+	moves/enter_sec_class_state.o \
 	moves/exit_arboretum.o \
 	moves/exit_bridge.o \
+	moves/exit_lift.o \
+	moves/exit_pellerator.o \
 	moves/exit_state_room.o \
 	moves/exit_titania.o \
 	moves/move_player_in_parrot_room.o \
@@ -313,11 +314,15 @@ MODULE_OBJS := \
 	sound/auto_music_player_base.o \
 	sound/auto_sound_player.o \
 	sound/background_sound_maker.o \
+	sound/bird_song.o \
+	sound/gondolier_song.o \
 	sound/music_player.o \
 	sound/restricted_auto_music_player.o \
+	sound/room_auto_sound_player.o \
 	sound/seasonal_music_player.o \
 	sound/titania_speech.o \
-	sound/trigger_auto_music_player.o
+	sound/trigger_auto_music_player.o \
+	sound/water_lapping_sounds.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/moves/enter_bridge.cpp b/engines/titanic/moves/enter_bridge.cpp
new file mode 100644
index 0000000..a1e0b7e
--- /dev/null
+++ b/engines/titanic/moves/enter_bridge.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/moves/enter_bridge.h"
+
+namespace Titanic {
+
+void CEnterBridge::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CEnterBridge::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/enter_bridge.h b/engines/titanic/moves/enter_bridge.h
new file mode 100644
index 0000000..bbc4cc9
--- /dev/null
+++ b/engines/titanic/moves/enter_bridge.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_BRIDGE_H
+#define TITANIC_ENTER_BRIDGE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEnterBridge : public CGameObject {
+public:
+	int _value;
+public:
+	CEnterBridge() : CGameObject(), _value(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEnterBridge"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_BRIDGE_H */
diff --git a/engines/titanic/moves/enter_exit_first_class_state.cpp b/engines/titanic/moves/enter_exit_first_class_state.cpp
new file mode 100644
index 0000000..ed80947
--- /dev/null
+++ b/engines/titanic/moves/enter_exit_first_class_state.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/moves/enter_exit_first_class_state.h"
+
+namespace Titanic {
+
+CString *CEnterExitFirstClassState::_v1;
+
+void CEnterExitFirstClassState::init() {
+	_v1 = new CString();
+}
+
+void CEnterExitFirstClassState::deinit() {
+	delete _v1;
+}
+
+void CEnterExitFirstClassState::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(*_v1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CEnterExitFirstClassState::load(SimpleFile *file) {
+	file->readNumber();
+	*_v1 = file->readString();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/enter_exit_first_class_state.h b/engines/titanic/moves/enter_exit_first_class_state.h
new file mode 100644
index 0000000..f7bc4c6
--- /dev/null
+++ b/engines/titanic/moves/enter_exit_first_class_state.h
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_EXIT_FIRST_CLASS_STATE_H
+#define TITANIC_ENTER_EXIT_FIRST_CLASS_STATE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEnterExitFirstClassState : public CGameObject {
+public:
+	static CString *_v1;
+
+	/**
+	 * Initialize static data
+	 */
+	static void init();
+
+	/**
+	 * De-initialize static data
+	 */
+	static void deinit();
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBowlUnlocker"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_EXIT_FIRST_CLASS_STATE_H */
diff --git a/engines/titanic/moves/enter_exit_mini_lift.cpp b/engines/titanic/moves/enter_exit_mini_lift.cpp
new file mode 100644
index 0000000..b6a1423
--- /dev/null
+++ b/engines/titanic/moves/enter_exit_mini_lift.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/moves/enter_exit_mini_lift.h"
+
+namespace Titanic {
+
+void CEnterExitMiniLift::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	
+	CSGTNavigation::save(file, indent);
+}
+
+void CEnterExitMiniLift::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+
+	CSGTNavigation::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/enter_exit_mini_lift.h b/engines/titanic/moves/enter_exit_mini_lift.h
new file mode 100644
index 0000000..417e25d
--- /dev/null
+++ b/engines/titanic/moves/enter_exit_mini_lift.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_EXIT_MINI_LIFT_H
+#define TITANIC_ENTER_EXIT_MINI_LIFT_H
+
+#include "titanic/game/sgt/sgt_navigation.h"
+
+namespace Titanic {
+
+class CEnterExitMiniLift : public CSGTNavigation {
+private:
+	int _fieldBC;
+	int _fieldC0;
+public:
+	CEnterExitMiniLift() : CSGTNavigation(), _fieldBC(0), _fieldC0(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEnterExitMiniLift"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_EXIT_MINI_LIFT_H */
diff --git a/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp b/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
new file mode 100644
index 0000000..11df8d9
--- /dev/null
+++ b/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/moves/enter_exit_sec_class_mini_lift.h"
+
+namespace Titanic {
+
+void CEnterExitSecClassMiniLift::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CEnterExitSecClassMiniLift::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/enter_exit_sec_class_mini_lift.h b/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
new file mode 100644
index 0000000..aa3f9b3
--- /dev/null
+++ b/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_EXIT_SEC_CLASS_MINI_LIFT_H
+#define TITANIC_ENTER_EXIT_SEC_CLASS_MINI_LIFT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEnterExitSecClassMiniLift : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEnterExitSecClassMiniLift"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_EXIT_SEC_CLASS_MINI_LIFT_H */
diff --git a/engines/titanic/moves/enter_exit_view.cpp b/engines/titanic/moves/enter_exit_view.cpp
new file mode 100644
index 0000000..3e5789e
--- /dev/null
+++ b/engines/titanic/moves/enter_exit_view.cpp
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/moves/enter_exit_view.h"
+
+namespace Titanic {
+
+CEnterExitView::CEnterExitView() : CGameObject(), _fieldBC(0),
+	_fieldC0(0), _fieldC4(0), _fieldC8(0), _fieldCC(0) {
+}
+
+void CEnterExitView::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CEnterExitView::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/enter_exit_view.h b/engines/titanic/moves/enter_exit_view.h
new file mode 100644
index 0000000..05ed63d
--- /dev/null
+++ b/engines/titanic/moves/enter_exit_view.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_EXIT_VIEW_H
+#define TITANIC_ENTER_EXIT_VIEW_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEnterExitView : public CGameObject {
+public:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	int _fieldCC;
+public:
+	CEnterExitView();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEnterExitView"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_EXIT_VIEW_H */
diff --git a/engines/titanic/moves/enter_sec_class_state.cpp b/engines/titanic/moves/enter_sec_class_state.cpp
new file mode 100644
index 0000000..74f6176
--- /dev/null
+++ b/engines/titanic/moves/enter_sec_class_state.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/moves/enter_sec_class_state.h"
+
+namespace Titanic {
+
+void CEnterSecClassState::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CEnterSecClassState::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/enter_sec_class_state.h b/engines/titanic/moves/enter_sec_class_state.h
new file mode 100644
index 0000000..5da623d
--- /dev/null
+++ b/engines/titanic/moves/enter_sec_class_state.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_SEC_CLASS_STATE_H
+#define TITANIC_ENTER_SEC_CLASS_STATE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CEnterSecClassState : public CGameObject {
+public:
+	int _value1, _value2;
+public:
+	CEnterSecClassState() : CGameObject(), _value1(0), _value2(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEnterSecClassState"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_SEC_CLASS_STATE_H */
diff --git a/engines/titanic/moves/exit_lift.cpp b/engines/titanic/moves/exit_lift.cpp
new file mode 100644
index 0000000..376b9e0
--- /dev/null
+++ b/engines/titanic/moves/exit_lift.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/moves/exit_lift.h"
+
+namespace Titanic {
+
+void CExitLift::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CExitLift::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readString();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/exit_lift.h b/engines/titanic/moves/exit_lift.h
new file mode 100644
index 0000000..534de1b
--- /dev/null
+++ b/engines/titanic/moves/exit_lift.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXIT_LIFT_H
+#define TITANIC_EXIT_LIFT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CExitLift : public CGameObject {
+public:
+	CString _value;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CExitLift"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EXIT_LIFT_H */
diff --git a/engines/titanic/moves/exit_pellerator.cpp b/engines/titanic/moves/exit_pellerator.cpp
new file mode 100644
index 0000000..81bec82
--- /dev/null
+++ b/engines/titanic/moves/exit_pellerator.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/moves/exit_pellerator.h"
+
+namespace Titanic {
+
+void CExitPellerator::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CExitPellerator::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/exit_pellerator.h b/engines/titanic/moves/exit_pellerator.h
new file mode 100644
index 0000000..6185f61
--- /dev/null
+++ b/engines/titanic/moves/exit_pellerator.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXIT_PELLERATOR_H
+#define TITANIC_EXIT_PELLERATOR_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CExitPellerator : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CExitPellerator"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EXIT_PELLERATOR_H */
diff --git a/engines/titanic/sound/auto_sound_player.cpp b/engines/titanic/sound/auto_sound_player.cpp
index 619c362..7b20f65 100644
--- a/engines/titanic/sound/auto_sound_player.cpp
+++ b/engines/titanic/sound/auto_sound_player.cpp
@@ -25,17 +25,39 @@
 namespace Titanic {
 
 CAutoSoundPlayer::CAutoSoundPlayer() : CGameObject(),
-	_fieldC8(0), _fieldCC(70), _fieldD0(0), _fieldD4(0), _fieldD8(-1),
+	_fieldBC(0), _fieldCC(70), _fieldD0(0), _fieldD4(0), _fieldD8(-1),
 	_fieldDC(0), _fieldE0(-1), _fieldE4(0), _fieldE8(0) {
 }
 
 void CAutoSoundPlayer::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeNumberLine(_fieldD0, indent);
+	file->writeNumberLine(_fieldD4, indent);
+	file->writeNumberLine(_fieldD8, indent);
+	file->writeNumberLine(_fieldDC, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+
 	CGameObject::save(file, indent);
 }
 
 void CAutoSoundPlayer::load(SimpleFile *file) {
 	file->readNumber();
+	_fieldBC = file->readNumber();
+	_string1 = file->readString();
+	_fieldCC = file->readNumber();
+	_fieldD0 = file->readNumber();
+	_fieldD4 = file->readNumber();
+	_fieldD8 = file->readNumber();
+	_fieldDC = file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/sound/auto_sound_player.h b/engines/titanic/sound/auto_sound_player.h
index 07ac0ac..bc84934 100644
--- a/engines/titanic/sound/auto_sound_player.h
+++ b/engines/titanic/sound/auto_sound_player.h
@@ -29,8 +29,8 @@ namespace Titanic {
 
 class CAutoSoundPlayer : public CGameObject {
 public:
+	int _fieldBC;
 	CString _string1;
-	int _fieldC8;
 	int _fieldCC;
 	int _fieldD0;
 	int _fieldD4;
diff --git a/engines/titanic/sound/bird_song.cpp b/engines/titanic/sound/bird_song.cpp
new file mode 100644
index 0000000..f003a4f
--- /dev/null
+++ b/engines/titanic/sound/bird_song.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/bird_song.h"
+
+namespace Titanic {
+
+void CBirdSong::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CRoomAutoSoundPlayer::save(file, indent);
+}
+
+void CBirdSong::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CRoomAutoSoundPlayer::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/bird_song.h b/engines/titanic/sound/bird_song.h
new file mode 100644
index 0000000..50c1f2b
--- /dev/null
+++ b/engines/titanic/sound/bird_song.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BIRD_SONG_H
+#define TITANIC_BIRD_SONG_H
+
+#include "titanic/sound/room_auto_sound_player.h"
+
+namespace Titanic {
+
+class CBirdSong : public CRoomAutoSoundPlayer {
+public:
+	int _value;
+public:
+	CBirdSong() : CRoomAutoSoundPlayer(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBirdSong"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BIRD_SONG_H */
diff --git a/engines/titanic/sound/gondolier_song.cpp b/engines/titanic/sound/gondolier_song.cpp
new file mode 100644
index 0000000..52b7ae0
--- /dev/null
+++ b/engines/titanic/sound/gondolier_song.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+#include "titanic/sound/gondolier_song.h"
+
+namespace Titanic {
+
+void CGondolierSong::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CRoomAutoSoundPlayer::save(file, indent);
+}
+
+void CGondolierSong::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CRoomAutoSoundPlayer::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/gondolier_song.h b/engines/titanic/sound/gondolier_song.h
new file mode 100644
index 0000000..38f7e86
--- /dev/null
+++ b/engines/titanic/sound/gondolier_song.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GONDOLIER_SONG_H
+#define TITANIC_GONDOLIER_SONG_H
+
+#include "titanic/sound/room_auto_sound_player.h"
+
+namespace Titanic {
+
+class CGondolierSong : public CRoomAutoSoundPlayer {
+public:
+	int _value;
+public:
+	CGondolierSong() : CRoomAutoSoundPlayer(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGondolierSong"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GONDOLIER_SONG_H */
diff --git a/engines/titanic/sound/room_auto_sound_player.cpp b/engines/titanic/sound/room_auto_sound_player.cpp
new file mode 100644
index 0000000..8c54726
--- /dev/null
+++ b/engines/titanic/sound/room_auto_sound_player.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/room_auto_sound_player.h"
+
+namespace Titanic {
+
+void CRoomAutoSoundPlayer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CAutoSoundPlayer::save(file, indent);
+}
+
+void CRoomAutoSoundPlayer::load(SimpleFile *file) {
+	file->readNumber();
+	CAutoSoundPlayer::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/room_auto_sound_player.h b/engines/titanic/sound/room_auto_sound_player.h
new file mode 100644
index 0000000..719eddc
--- /dev/null
+++ b/engines/titanic/sound/room_auto_sound_player.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ROOM_AUTO_SOUND_PLAYER_H
+#define TITANIC_ROOM_AUTO_SOUND_PLAYER_H
+
+#include "titanic/sound/auto_sound_player.h"
+
+namespace Titanic {
+
+class CRoomAutoSoundPlayer : public CAutoSoundPlayer {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CRoomAutoSoundPlayer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ROOM_AUTO_SOUND_PLAYER_H */
diff --git a/engines/titanic/sound/water_lapping_sounds.cpp b/engines/titanic/sound/water_lapping_sounds.cpp
new file mode 100644
index 0000000..7222b5a
--- /dev/null
+++ b/engines/titanic/sound/water_lapping_sounds.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+#include "titanic/sound/water_lapping_sounds.h"
+
+namespace Titanic {
+
+void CWaterLappingSounds::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CRoomAutoSoundPlayer::save(file, indent);
+}
+
+void CWaterLappingSounds::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CRoomAutoSoundPlayer::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/water_lapping_sounds.h b/engines/titanic/sound/water_lapping_sounds.h
new file mode 100644
index 0000000..3dd72b5
--- /dev/null
+++ b/engines/titanic/sound/water_lapping_sounds.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_WATER_LAPPING_SOUNDS_H
+#define TITANIC_WATER_LAPPING_SOUNDS_H
+
+#include "titanic/sound/room_auto_sound_player.h"
+
+namespace Titanic {
+
+class CWaterLappingSounds : public CRoomAutoSoundPlayer {
+public:
+	int _value;
+public:
+	CWaterLappingSounds() : CRoomAutoSoundPlayer(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CWaterLappingSounds"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_WATER_LAPPING_SOUNDS_H */
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 03dbacd..d8d4c77 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -28,12 +28,13 @@
 #include "graphics/scaler.h"
 #include "graphics/thumbnail.h"
 #include "titanic/titanic.h"
+#include "titanic/carry/hose.h"
 #include "titanic/core/saveable_object.h"
-#include "titanic/game/enter_exit_first_class_state.h"
+#include "titanic/game/get_lift_eye2.h"
 #include "titanic/game/parrot/parrot_lobby_object.h"
 #include "titanic/game/sgt/sgt_navigation.h"
 #include "titanic/game/sgt/sgt_state_room.h"
-#include "titanic/carry/hose.h"
+#include "titanic/moves/enter_exit_first_class_state.h"
 
 namespace Titanic {
 
@@ -57,9 +58,10 @@ void TitanicEngine::initialize() {
 	DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
 
 	CSaveableObject::initClassList();
-	CParrotLobbyObject::init();
 	CEnterExitFirstClassState::init();
+	CGetLiftEye2::init();
 	CHose::init();
+	CParrotLobbyObject::init();
 	CSGTNavigation::init();
 	CSGTStateRoom::init();
 
@@ -70,6 +72,7 @@ void TitanicEngine::initialize() {
 
 void TitanicEngine::deinitialize() {
 	CEnterExitFirstClassState::deinit();
+	CGetLiftEye2::deinit();
 	CHose::deinit();
 	CSGTNavigation::deinit();
 	CSGTStateRoom::deinit();


Commit: f7e057e4d74a7f38ac40024bba29ebc0071975c5
    https://github.com/scummvm/scummvm/commit/f7e057e4d74a7f38ac40024bba29ebc0071975c5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-01T23:40:59-05:00

Commit Message:
TITANIC: Added more miscellaneous classes

Changed paths:
  A engines/titanic/game/pet/pet_lift.cpp
  A engines/titanic/game/pet/pet_lift.h
  A engines/titanic/game/pet/pet_pellerator.cpp
  A engines/titanic/game/pet/pet_pellerator.h
  A engines/titanic/game/pickup/pick_up.cpp
  A engines/titanic/game/pickup/pick_up.h
  A engines/titanic/game/pickup/pick_up_bar_glass.cpp
  A engines/titanic/game/pickup/pick_up_bar_glass.h
  A engines/titanic/game/pickup/pick_up_hose.cpp
  A engines/titanic/game/pickup/pick_up_hose.h
  A engines/titanic/game/pickup/pick_up_lemon.cpp
  A engines/titanic/game/pickup/pick_up_lemon.h
  A engines/titanic/game/pickup/pick_up_speech_centre.cpp
  A engines/titanic/game/pickup/pick_up_speech_centre.h
  A engines/titanic/game/pickup/pick_up_vis_centre.cpp
  A engines/titanic/game/pickup/pick_up_vis_centre.h
  A engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
  A engines/titanic/game/placeholder/bar_shelf_vis_centre.h
  A engines/titanic/game/placeholder/lemon_on_bar.cpp
  A engines/titanic/game/placeholder/lemon_on_bar.h
  A engines/titanic/game/placeholder/place_holder.cpp
  A engines/titanic/game/placeholder/place_holder.h
  A engines/titanic/game/placeholder/tv_on_bar.cpp
  A engines/titanic/game/placeholder/tv_on_bar.h
  A engines/titanic/game/sgt/armchair.cpp
  A engines/titanic/game/sgt/armchair.h
  A engines/titanic/game/sgt/basin.cpp
  A engines/titanic/game/sgt/basin.h
  A engines/titanic/game/sgt/bedfoot.cpp
  A engines/titanic/game/sgt/bedfoot.h
  A engines/titanic/game/sgt/bedhead.cpp
  A engines/titanic/game/sgt/bedhead.h
  A engines/titanic/game/sgt/chest_of_drawers.cpp
  A engines/titanic/game/sgt/chest_of_drawers.h
  A engines/titanic/game/sgt/desk.cpp
  A engines/titanic/game/sgt/desk.h
  A engines/titanic/game/sgt/deskchair.cpp
  A engines/titanic/game/sgt/deskchair.h
  A engines/titanic/game/sgt/drawer.cpp
  A engines/titanic/game/sgt/drawer.h
  A engines/titanic/game/sgt/sgt_nav.cpp
  A engines/titanic/game/sgt/sgt_nav.h
  A engines/titanic/game/sgt/sgt_state_control.cpp
  A engines/titanic/game/sgt/sgt_state_control.h
  A engines/titanic/game/sgt/sgt_tv.cpp
  A engines/titanic/game/sgt/sgt_tv.h
  A engines/titanic/game/sgt/toilet.cpp
  A engines/titanic/game/sgt/toilet.h
  A engines/titanic/game/sgt/vase.cpp
  A engines/titanic/game/sgt/vase.h
  A engines/titanic/game/sgt/washstand.cpp
  A engines/titanic/game/sgt/washstand.h
  A engines/titanic/game/transport/exit_pellerator.cpp
  A engines/titanic/game/transport/exit_pellerator.h
  R engines/titanic/game/drawer.cpp
  R engines/titanic/game/drawer.h
  R engines/titanic/game/place_holder.cpp
  R engines/titanic/game/place_holder.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/annoy_barbot.cpp
    engines/titanic/game/annoy_barbot.h
    engines/titanic/game/bar_menu.cpp
    engines/titanic/game/doorbot_elevator_handler.cpp
    engines/titanic/game/doorbot_elevator_handler.h
    engines/titanic/game/elevator_action_area.cpp
    engines/titanic/game/emma_control.cpp
    engines/titanic/game/emma_control.h
    engines/titanic/game/long_stick_dispenser.cpp
    engines/titanic/game/long_stick_dispenser.h
    engines/titanic/game/transport/pellerator.cpp
    engines/titanic/game/transport/pellerator.h
    engines/titanic/game/transport/service_elevator.cpp
    engines/titanic/game/transport/service_elevator.h
    engines/titanic/module.mk
    engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
    engines/titanic/moves/enter_exit_sec_class_mini_lift.h
    engines/titanic/moves/exit_pellerator.cpp
    engines/titanic/moves/exit_pellerator.h
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 08a3668..a2273fd 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -77,9 +77,13 @@
 #include "titanic/core/view_item.h"
 
 #include "titanic/game/announce.h"
+#include "titanic/game/annoy_barbot.h"
 #include "titanic/game/arb_background.h"
 #include "titanic/game/arboretum_gate.h"
 #include "titanic/game/auto_animate.h"
+#include "titanic/game/bar_bell.h"
+#include "titanic/game/bar_menu.h"
+#include "titanic/game/bar_menu_button.h"
 #include "titanic/game/belbot_get_light.h"
 #include "titanic/game/bomb.h"
 #include "titanic/game/bowl_unlocker.h"
@@ -102,10 +106,11 @@
 #include "titanic/game/credits_button.h"
 #include "titanic/game/dead_area.h"
 #include "titanic/game/desk_click_responder.h"
+#include "titanic/game/doorbot_elevator_handler.h"
 #include "titanic/game/doorbot_home_handler.h"
-#include "titanic/game/drawer.h"
 #include "titanic/game/ear_sweet_bowl.h"
 #include "titanic/game/eject_phonograph_button.h"
+#include "titanic/game/elevator_action_area.h"
 #include "titanic/game/emma_control.h"
 #include "titanic/game/empty_nut_bowl.h"
 #include "titanic/game/end_credit_text.h"
@@ -121,15 +126,18 @@
 #include "titanic/game/floor_indicator.h"
 #include "titanic/game/games_console.h"
 #include "titanic/game/get_lift_eye2.h"
+#include "titanic/game/glass_smasher.h"
 #include "titanic/game/hammer_clip.h"
 #include "titanic/game/hammer_dispensor.h"
 #include "titanic/game/hammer_dispensor_button.h"
 #include "titanic/game/head_smash_event.h"
 #include "titanic/game/head_smash_lever.h"
+#include "titanic/game/idle_summoner.h"
 #include "titanic/game/lemon_dispensor.h"
 #include "titanic/game/light.h"
 #include "titanic/game/light_switch.h"
 #include "titanic/game/little_lift_button.h"
+#include "titanic/game/long_stick_dispenser.h"
 #include "titanic/game/maitred_arm_holder.h"
 #include "titanic/game/musical_instrument.h"
 #include "titanic/game/music_console_button.h"
@@ -165,6 +173,7 @@
 #include "titanic/game/television.h"
 #include "titanic/game/third_class_canal.h"
 #include "titanic/game/throw_tv_down_well.h"
+#include "titanic/game/tow_parrot_nav.h"
 #include "titanic/game/up_lighter.h"
 #include "titanic/game/wheel_button.h"
 #include "titanic/game/wheel_hotspot.h"
@@ -184,17 +193,43 @@
 #include "titanic/game/pet/pet_class1.h"
 #include "titanic/game/pet/pet_class2.h"
 #include "titanic/game/pet/pet_class3.h"
+#include "titanic/game/pet/pet_lift.h"
 #include "titanic/game/pet/pet_monitor.h"
+#include "titanic/game/pet/pet_pellerator.h"
 #include "titanic/game/pet/pet_position.h"
 #include "titanic/game/pet/pet_sentinal.h"
 #include "titanic/game/pet/pet_sounds.h"
 #include "titanic/game/pet/pet_transition.h"
 #include "titanic/game/pet/pet_transport.h"
+#include "titanic/game/pickup/pick_up.h"
+#include "titanic/game/pickup/pick_up_bar_glass.h"
+#include "titanic/game/pickup/pick_up_hose.h"
+#include "titanic/game/pickup/pick_up_lemon.h"
+#include "titanic/game/pickup/pick_up_speech_centre.h"
+#include "titanic/game/pickup/pick_up_vis_centre.h"
+#include "titanic/game/placeholder/bar_shelf_vis_centre.h"
+#include "titanic/game/placeholder/lemon_on_bar.h"
+#include "titanic/game/placeholder/place_holder.h"
+#include "titanic/game/placeholder/tv_on_bar.h"
+#include "titanic/game/sgt/armchair.h"
+#include "titanic/game/sgt/basin.h"
+#include "titanic/game/sgt/bedfoot.h"
+#include "titanic/game/sgt/bedhead.h"
+#include "titanic/game/sgt/chest_of_drawers.h"
+#include "titanic/game/sgt/desk.h"
+#include "titanic/game/sgt/deskchair.h"
+#include "titanic/game/sgt/drawer.h"
 #include "titanic/game/sgt/sgt_doors.h"
+#include "titanic/game/sgt/sgt_nav.h"
 #include "titanic/game/sgt/sgt_navigation.h"
 #include "titanic/game/sgt/sgt_restaurant_doors.h"
+#include "titanic/game/sgt/sgt_state_control.h"
 #include "titanic/game/sgt/sgt_state_room.h"
+#include "titanic/game/sgt/sgt_tv.h"
 #include "titanic/game/sgt/sgt_upper_doors_sound.h"
+#include "titanic/game/sgt/toilet.h"
+#include "titanic/game/sgt/vase.h"
+#include "titanic/game/sgt/washstand.h"
 #include "titanic/game/transport/gondolier.h"
 #include "titanic/game/transport/lift.h"
 #include "titanic/game/transport/lift_indicator.h"
@@ -248,10 +283,13 @@
 #include "titanic/moves/enter_bridge.h"
 #include "titanic/moves/enter_exit_first_class_state.h"
 #include "titanic/moves/enter_exit_mini_lift.h"
+#include "titanic/moves/enter_exit_sec_class_mini_lift.h"
 #include "titanic/moves/enter_exit_view.h"
+#include "titanic/moves/enter_sec_class_state.h"
 #include "titanic/moves/exit_arboretum.h"
 #include "titanic/moves/exit_bridge.h"
 #include "titanic/moves/exit_lift.h"
+#include "titanic/moves/exit_pellerator.h"
 #include "titanic/moves/exit_state_room.h"
 #include "titanic/moves/move_player_in_parrot_room.h"
 #include "titanic/moves/move_player_to.h"
@@ -354,9 +392,13 @@ DEFFN(CTreeItem);
 DEFFN(CViewItem);
 
 DEFFN(CAnnounce);
+DEFFN(CAnnoyBarbot);
 DEFFN(CArbBackground);
 DEFFN(CArboretumGate);
 DEFFN(CAutoAnimate);
+DEFFN(CBarBell);
+DEFFN(CBarMenu);
+DEFFN(CBarMenuButton);
 DEFFN(CBelbotGetLight);
 DEFFN(CBowlUnlocker);
 DEFFN(CBomb);
@@ -378,9 +420,11 @@ DEFFN(CCredits);
 DEFFN(CCreditsButton);
 DEFFN(CDeadArea);
 DEFFN(CDeskClickResponder);
+DEFFN(CDoorbotElevatorHandler);
 DEFFN(CDoorbotHomeHandler);
 DEFFN(CEarSweetBowl);
 DEFFN(CEjectPhonographButton);
+DEFFN(CElevatorActionArea);
 DEFFN(CEmmaControl);
 DEFFN(CEmptyNutBowl);
 DEFFN(CEndCreditText);
@@ -396,15 +440,18 @@ DEFFN(CFanNoises);
 DEFFN(CFloorIndicator);
 DEFFN(CGamesConsole);
 DEFFN(CGetLiftEye2);
+DEFFN(CGlassSmasher);
 DEFFN(CHammerClip);
 DEFFN(CHammerDispensor);
 DEFFN(CHammerDispensorButton);
 DEFFN(CHeadSmashEvent);
 DEFFN(CHeadSmashLever);
+DEFFN(CIdleSummoner);
 DEFFN(CLemonDispensor);
 DEFFN(CLight);
 DEFFN(CLightSwitch);
 DEFFN(CLittleLiftButton);
+DEFFN(CLongStickDispenser);
 DEFFN(CMaitreDArmHolder);
 DEFFN(CMusicalInstrument);
 DEFFN(CMusicConsoleButton);
@@ -440,6 +487,7 @@ DEFFN(CSweetBowl);
 DEFFN(CTelevision);
 DEFFN(CThirdClassCanal);
 DEFFN(CThrowTVDownWell);
+DEFFN(CTOWParrotNav);
 DEFFN(CUpLighter);
 DEFFN(CWheelButton);
 DEFFN(CWheelHotSpot);
@@ -459,18 +507,44 @@ DEFFN(CPET);
 DEFFN(CPETClass1);
 DEFFN(CPETClass2);
 DEFFN(CPETClass3);
+DEFFN(CPETLift);
 DEFFN(CPETMonitor);
+DEFFN(CPETPellerator);
 DEFFN(CPETPosition);
 DEFFN(CPETSentinal);
 DEFFN(CPETSounds);
 DEFFN(CPETTransition);
 DEFFN(CPETTransport);
-DEFFN(CEnterExitMiniLift);
+DEFFN(CPickUp);
+DEFFN(CPickUpBarGlass);
+DEFFN(CPickUpHose);
+DEFFN(CPickUpLemon);
+DEFFN(CPickUpSpeechCentre);
+DEFFN(CPickUpVisCentre);
+DEFFN(CBarShelfVisCentre);
+DEFFN(CLemonOnBar);
+DEFFN(CPlaceHolder);
+DEFFN(CTVOnBar);
+DEFFN(CArmchair);
+DEFFN(CBasin);
+DEFFN(CBedfoot);
+DEFFN(CBedhead);
+DEFFN(CChestOfDrawers);
+DEFFN(CDesk);
+DEFFN(CDeskchair);
+DEFFN(CDrawer);
 DEFFN(CSGTDoors);
+DEFFN(SGTNav);
 DEFFN(CSGTNavigation);
 DEFFN(CSGTRestaurantDoors);
+DEFFN(CSGTStateControl);
 DEFFN(CSGTStateRoom);
+DEFFN(CSGTTV);
 DEFFN(CSGTUpperDoorsSound);
+DEFFN(CToilet);
+DEFFN(CVase);
+DEFFN(CWashstand);
+
 DEFFN(CGondolier);
 DEFFN(CLift);
 DEFFN(CLiftindicator);
@@ -696,10 +770,14 @@ DEFFN(CVisibleMsg);
 DEFFN(CEnterBombRoom);
 DEFFN(CEnterBridge);
 DEFFN(CEnterExitFirstClassState);
+DEFFN(CEnterExitMiniLift);
+DEFFN(CEnterExitSecClassMiniLift);
 DEFFN(CEnterExitView);
+DEFFN(CEnterSecClassState);
 DEFFN(CExitArboretum);
 DEFFN(CExitBridge);
 DEFFN(CExitLift);
+DEFFN(CExitPellerator);
 DEFFN(CExitStateRoom);
 DEFFN(CMovePlayerInParrotRoom);
 DEFFN(CMovePlayerTo);
@@ -795,9 +873,13 @@ void CSaveableObject::initClassList() {
 	ADDFN(CViewItem);
 
 	ADDFN(CAnnounce);
+	ADDFN(CAnnoyBarbot);
 	ADDFN(CArbBackground);
 	ADDFN(CArboretumGate);
 	ADDFN(CAutoAnimate);
+	ADDFN(CBarBell);
+	ADDFN(CBarMenu);
+	ADDFN(CBarMenuButton);
 	ADDFN(CBelbotGetLight);
 	ADDFN(CBomb);
 	ADDFN(CBowlUnlocker);
@@ -819,10 +901,12 @@ void CSaveableObject::initClassList() {
 	ADDFN(CCreditsButton);
 	ADDFN(CDeadArea);
 	ADDFN(CDeskClickResponder);
+	ADDFN(CDoorbotElevatorHandler);
 	ADDFN(CDoorbotHomeHandler);
 	ADDFN(CDropTarget);
 	ADDFN(CEarSweetBowl);
 	ADDFN(CEjectPhonographButton);
+	ADDFN(CElevatorActionArea);
 	ADDFN(CEmmaControl);
 	ADDFN(CEmptyNutBowl);
 	ADDFN(CEndCreditText);
@@ -838,15 +922,18 @@ void CSaveableObject::initClassList() {
 	ADDFN(CFloorIndicator);
 	ADDFN(CGamesConsole);
 	ADDFN(CGetLiftEye2);
+	ADDFN(CGlassSmasher);
 	ADDFN(CHammerClip);
 	ADDFN(CHammerDispensor);
 	ADDFN(CHammerDispensorButton);
 	ADDFN(CHeadSmashEvent);
 	ADDFN(CHeadSmashLever);
+	ADDFN(CIdleSummoner);
 	ADDFN(CLemonDispensor);
 	ADDFN(CLight);
 	ADDFN(CLightSwitch);
 	ADDFN(CLittleLiftButton);
+	ADDFN(CLongStickDispenser);
 	ADDFN(CMaitreDArmHolder);
 	ADDFN(CMusicalInstrument);
 	ADDFN(CMusicConsoleButton);
@@ -882,6 +969,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CTelevision);
 	ADDFN(CThirdClassCanal);
 	ADDFN(CThrowTVDownWell);
+	ADDFN(CTOWParrotNav);
 	ADDFN(CUpLighter);
 	ADDFN(CWheelButton);
 	ADDFN(CWheelHotSpot);
@@ -901,18 +989,44 @@ void CSaveableObject::initClassList() {
 	ADDFN(CPETClass1);
 	ADDFN(CPETClass2);
 	ADDFN(CPETClass3);
+	ADDFN(CPETLift);
 	ADDFN(CPETMonitor);
+	ADDFN(CPETPellerator);
 	ADDFN(CPETPosition);
 	ADDFN(CPETSentinal);
 	ADDFN(CPETSounds);
 	ADDFN(CPETTransition);
 	ADDFN(CPETTransport);
-	ADDFN(CEnterExitMiniLift);
+	ADDFN(CPickUp);
+	ADDFN(CPickUpBarGlass);
+	ADDFN(CPickUpHose);
+	ADDFN(CPickUpLemon);
+	ADDFN(CPickUpSpeechCentre);
+	ADDFN(CPickUpVisCentre);
+	ADDFN(CBarShelfVisCentre);
+	ADDFN(CLemonOnBar);
+	ADDFN(CPlaceHolder);
+	ADDFN(CTVOnBar);
+	ADDFN(CArmchair);
+	ADDFN(CBasin);
+	ADDFN(CBedfoot);
+	ADDFN(CBedhead);
+	ADDFN(CChestOfDrawers);
+	ADDFN(CDesk);
+	ADDFN(CDeskchair);
+	ADDFN(CDrawer);
 	ADDFN(CSGTDoors);
+	ADDFN(SGTNav);
 	ADDFN(CSGTNavigation);
 	ADDFN(CSGTRestaurantDoors);
+	ADDFN(CSGTStateControl);
 	ADDFN(CSGTStateRoom);
+	ADDFN(CSGTTV);
 	ADDFN(CSGTUpperDoorsSound);
+	ADDFN(CToilet);
+	ADDFN(CVase);
+	ADDFN(CWashstand);
+
 	ADDFN(CGondolier);
 	ADDFN(CLift);
 	ADDFN(CLiftindicator);
@@ -1138,10 +1252,14 @@ void CSaveableObject::initClassList() {
 	ADDFN(CEnterBombRoom);
 	ADDFN(CEnterBridge);
 	ADDFN(CEnterExitFirstClassState);
+	ADDFN(CEnterExitMiniLift);
+	ADDFN(CEnterExitSecClassMiniLift);
 	ADDFN(CEnterExitView);
+	ADDFN(CEnterSecClassState);
 	ADDFN(CExitArboretum);
 	ADDFN(CExitBridge);
 	ADDFN(CExitLift);
+	ADDFN(CExitPellerator);
 	ADDFN(CExitStateRoom);
 	ADDFN(CMovePlayerInParrotRoom);
 	ADDFN(CMovePlayerTo);
diff --git a/engines/titanic/game/annoy_barbot.cpp b/engines/titanic/game/annoy_barbot.cpp
index c21e828..caea823 100644
--- a/engines/titanic/game/annoy_barbot.cpp
+++ b/engines/titanic/game/annoy_barbot.cpp
@@ -24,13 +24,17 @@
 
 namespace Titanic {
 
+int CAnnoyBarbot::_v1;
+
 void CAnnoyBarbot::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
 	CGameObject::save(file, indent);
 }
 
 void CAnnoyBarbot::load(SimpleFile *file) {
 	file->readNumber();
+	_v1 = file->readNumber();
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/annoy_barbot.h b/engines/titanic/game/annoy_barbot.h
index 18be7c1..c1598e1 100644
--- a/engines/titanic/game/annoy_barbot.h
+++ b/engines/titanic/game/annoy_barbot.h
@@ -28,6 +28,8 @@
 namespace Titanic {
 
 class CAnnoyBarbot : public CGameObject {
+private:
+	static int _v1;
 public:
 	/**
 	 * Return the class name
diff --git a/engines/titanic/game/bar_menu.cpp b/engines/titanic/game/bar_menu.cpp
index 53ed48a..25da001 100644
--- a/engines/titanic/game/bar_menu.cpp
+++ b/engines/titanic/game/bar_menu.cpp
@@ -29,11 +29,19 @@ CBarMenu::CBarMenu() : CGameObject(), _fieldBC(0), _fieldC0(0), _fieldC4(6) {
 
 void CBarMenu::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	
 	CGameObject::save(file, indent);
 }
 
 void CBarMenu::load(SimpleFile *file) {
 	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/doorbot_elevator_handler.cpp b/engines/titanic/game/doorbot_elevator_handler.cpp
index 1a85793..e4232c0 100644
--- a/engines/titanic/game/doorbot_elevator_handler.cpp
+++ b/engines/titanic/game/doorbot_elevator_handler.cpp
@@ -24,15 +24,19 @@
 
 namespace Titanic {
 
+int CDoorbotElevatorHandler::_v1;
+
 void CDoorbotElevatorHandler::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
+	file->writeNumberLine(_v1, indent);
 	CGameObject::save(file, indent);
 }
 
 void CDoorbotElevatorHandler::load(SimpleFile *file) {
 	file->readNumber();
 	_value = file->readNumber();
+	_v1 = file->readNumber();
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/doorbot_elevator_handler.h b/engines/titanic/game/doorbot_elevator_handler.h
index 041e2c5..41d6068 100644
--- a/engines/titanic/game/doorbot_elevator_handler.h
+++ b/engines/titanic/game/doorbot_elevator_handler.h
@@ -28,7 +28,8 @@
 namespace Titanic {
 
 class CDoorbotElevatorHandler : public CGameObject {
-public:
+private:
+	static int _v1;
 	int _value;
 public:
 	/**
diff --git a/engines/titanic/game/drawer.cpp b/engines/titanic/game/drawer.cpp
deleted file mode 100644
index 3409522..0000000
--- a/engines/titanic/game/drawer.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/drawer.h"
-
-namespace Titanic {
-
-CDrawer::CDrawer() : CSGTStateRoom(), _fieldF4(0) {
-}
-
-void CDrawer::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldF4, indent);
-	CSGTStateRoom::save(file, indent);
-}
-
-void CDrawer::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldF4 = file->readNumber();
-	CSGTStateRoom::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/drawer.h b/engines/titanic/game/drawer.h
deleted file mode 100644
index 100e27c..0000000
--- a/engines/titanic/game/drawer.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_DRAWER_H
-#define TITANIC_DRAWER_H
-
-#include "titanic/game/sgt/sgt_state_room.h"
-
-namespace Titanic {
-
-class CDrawer : public CSGTStateRoom {
-private:
-	int _fieldF4;
-public:
-	CDrawer();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDrawer"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_DRAWER_H */
diff --git a/engines/titanic/game/elevator_action_area.cpp b/engines/titanic/game/elevator_action_area.cpp
index 3beef1b..c9916bf 100644
--- a/engines/titanic/game/elevator_action_area.cpp
+++ b/engines/titanic/game/elevator_action_area.cpp
@@ -26,11 +26,13 @@ namespace Titanic {
 
 void CElevatorActionArea::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
 }
 
 void CElevatorActionArea::load(SimpleFile *file) {
 	file->readNumber();
+	_value = file->readNumber();
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/emma_control.cpp b/engines/titanic/game/emma_control.cpp
index ce3b325..fac429c 100644
--- a/engines/titanic/game/emma_control.cpp
+++ b/engines/titanic/game/emma_control.cpp
@@ -24,8 +24,11 @@
 
 namespace Titanic {
 
+int CEmmaControl::_v1;
+
 void CEmmaControl::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
 	file->writeQuotedLine(_wavFile1, indent);
 	file->writeQuotedLine(_wavFile2, indent);
 
@@ -34,6 +37,7 @@ void CEmmaControl::save(SimpleFile *file, int indent) const {
 
 void CEmmaControl::load(SimpleFile *file) {
 	file->readNumber();
+	_v1 = file->readNumber();
 	_wavFile1 = file->readString();
 	_wavFile2 = file->readString();
 
diff --git a/engines/titanic/game/emma_control.h b/engines/titanic/game/emma_control.h
index f61d237..590c6f7 100644
--- a/engines/titanic/game/emma_control.h
+++ b/engines/titanic/game/emma_control.h
@@ -28,7 +28,9 @@
 namespace Titanic {
 
 class CEmmaControl : public CBackground {
-public:
+private:
+	static int _v1;
+
 	CString _wavFile1, _wavFile2;
 public:
 	CEmmaControl() : CBackground(), _wavFile1("b#39.wav"), _wavFile2("b#38.wav") {}
diff --git a/engines/titanic/game/long_stick_dispenser.cpp b/engines/titanic/game/long_stick_dispenser.cpp
index bdd6240..97981cc 100644
--- a/engines/titanic/game/long_stick_dispenser.cpp
+++ b/engines/titanic/game/long_stick_dispenser.cpp
@@ -26,11 +26,19 @@ namespace Titanic {
 
 void CLongStickDispenser::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+
 	CGameObject::save(file, indent);
 }
 
 void CLongStickDispenser::load(SimpleFile *file) {
 	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/long_stick_dispenser.h b/engines/titanic/game/long_stick_dispenser.h
index 2e28420..4912ea3 100644
--- a/engines/titanic/game/long_stick_dispenser.h
+++ b/engines/titanic/game/long_stick_dispenser.h
@@ -34,7 +34,7 @@ public:
 	int _fieldC4;
 public:
 	CLongStickDispenser() : CGameObject(), _fieldBC(0),
-		_fieldC0(0), _fieldC4(0) {}
+		_fieldC0(0), _fieldC4(1) {}
 
 	/**
 	 * Return the class name
diff --git a/engines/titanic/game/pet/pet_lift.cpp b/engines/titanic/game/pet/pet_lift.cpp
new file mode 100644
index 0000000..8a16c67
--- /dev/null
+++ b/engines/titanic/game/pet/pet_lift.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_lift.h"
+
+namespace Titanic {
+
+void CPETLift::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPETTransport::save(file, indent);
+}
+
+void CPETLift::load(SimpleFile *file) {
+	file->readNumber();
+	CPETTransport::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_lift.h b/engines/titanic/game/pet/pet_lift.h
new file mode 100644
index 0000000..11207cd
--- /dev/null
+++ b/engines/titanic/game/pet/pet_lift.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_LIFT_H
+#define TITANIC_PET_LIFT_H
+
+#include "titanic/game/pet/pet_transport.h"
+
+namespace Titanic {
+
+class CPETLift : public CPETTransport {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPETLift"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_LIFT_H */
diff --git a/engines/titanic/game/pet/pet_pellerator.cpp b/engines/titanic/game/pet/pet_pellerator.cpp
new file mode 100644
index 0000000..bcddc75
--- /dev/null
+++ b/engines/titanic/game/pet/pet_pellerator.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_pellerator.h"
+
+namespace Titanic {
+
+void CPETPellerator::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPETTransport::save(file, indent);
+}
+
+void CPETPellerator::load(SimpleFile *file) {
+	file->readNumber();
+	CPETTransport::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_pellerator.h b/engines/titanic/game/pet/pet_pellerator.h
new file mode 100644
index 0000000..7314f72
--- /dev/null
+++ b/engines/titanic/game/pet/pet_pellerator.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_PELLERATOR_H
+#define TITANIC_PET_PELLERATOR_H
+
+#include "titanic/game/pet/pet_transport.h"
+
+namespace Titanic {
+
+class CPETPellerator : public CPETTransport {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPETPellerator"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_PELLERATOR_H */
diff --git a/engines/titanic/game/pickup/pick_up.cpp b/engines/titanic/game/pickup/pick_up.cpp
new file mode 100644
index 0000000..58ffc5a
--- /dev/null
+++ b/engines/titanic/game/pickup/pick_up.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pickup/pick_up.h"
+
+namespace Titanic {
+
+void CPickUp::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPickUp::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pickup/pick_up.h b/engines/titanic/game/pickup/pick_up.h
new file mode 100644
index 0000000..e1783ef
--- /dev/null
+++ b/engines/titanic/game/pickup/pick_up.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PICK_UP_H
+#define TITANIC_PICK_UP_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPickUp : public CGameObject {
+private:
+	int _fieldBC;
+public:
+	CPickUp() : CGameObject(), _fieldBC(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAnnoyBarbot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ANNOY_BARBOT_H */
diff --git a/engines/titanic/game/pickup/pick_up_bar_glass.cpp b/engines/titanic/game/pickup/pick_up_bar_glass.cpp
new file mode 100644
index 0000000..1d475c2
--- /dev/null
+++ b/engines/titanic/game/pickup/pick_up_bar_glass.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pickup/pick_up_bar_glass.h"
+
+namespace Titanic {
+
+void CPickUpBarGlass::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPickUp::save(file, indent);
+}
+
+void CPickUpBarGlass::load(SimpleFile *file) {
+	file->readNumber();
+	CPickUp::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pickup/pick_up_bar_glass.h b/engines/titanic/game/pickup/pick_up_bar_glass.h
new file mode 100644
index 0000000..9bec56c
--- /dev/null
+++ b/engines/titanic/game/pickup/pick_up_bar_glass.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PICK_UP_BAR_GLASS_H
+#define TITANIC_PICK_UP_BAR_GLASS_H
+
+#include "titanic/game/pickup/pick_up.h"
+
+namespace Titanic {
+
+class CPickUpBarGlass : public CPickUp {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPickUpBarGlass"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PICK_UP_BAR_GLASS_H */
diff --git a/engines/titanic/game/pickup/pick_up_hose.cpp b/engines/titanic/game/pickup/pick_up_hose.cpp
new file mode 100644
index 0000000..35ac7f8
--- /dev/null
+++ b/engines/titanic/game/pickup/pick_up_hose.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pickup/pick_up_hose.h"
+
+namespace Titanic {
+
+void CPickUpHose::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	CPickUp::save(file, indent);
+}
+
+void CPickUpHose::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	CPickUp::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pickup/pick_up_hose.h b/engines/titanic/game/pickup/pick_up_hose.h
new file mode 100644
index 0000000..56596c5
--- /dev/null
+++ b/engines/titanic/game/pickup/pick_up_hose.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PICK_UP_HOSE_H
+#define TITANIC_PICK_UP_HOSE_H
+
+#include "titanic/game/pickup/pick_up.h"
+
+namespace Titanic {
+
+class CPickUpHose : public CPickUp {
+private:
+	CString _string1;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPickUpHose"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PICK_UP_HOSE_H */
diff --git a/engines/titanic/game/pickup/pick_up_lemon.cpp b/engines/titanic/game/pickup/pick_up_lemon.cpp
new file mode 100644
index 0000000..7364fee
--- /dev/null
+++ b/engines/titanic/game/pickup/pick_up_lemon.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pickup/pick_up_lemon.h"
+
+namespace Titanic {
+
+void CPickUpLemon::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPickUp::save(file, indent);
+}
+
+void CPickUpLemon::load(SimpleFile *file) {
+	file->readNumber();
+	CPickUp::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pickup/pick_up_lemon.h b/engines/titanic/game/pickup/pick_up_lemon.h
new file mode 100644
index 0000000..fee2485
--- /dev/null
+++ b/engines/titanic/game/pickup/pick_up_lemon.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PICK_UP_LEMON_H
+#define TITANIC_PICK_UP_LEMON_H
+
+#include "titanic/game/pickup/pick_up.h"
+
+namespace Titanic {
+
+class CPickUpLemon : public CPickUp {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPickUpLemon"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PICK_UP_LEMON_H */
diff --git a/engines/titanic/game/pickup/pick_up_speech_centre.cpp b/engines/titanic/game/pickup/pick_up_speech_centre.cpp
new file mode 100644
index 0000000..74c4739
--- /dev/null
+++ b/engines/titanic/game/pickup/pick_up_speech_centre.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pickup/pick_up_speech_centre.h"
+
+namespace Titanic {
+
+void CPickUpSpeechCentre::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPickUp::save(file, indent);
+}
+
+void CPickUpSpeechCentre::load(SimpleFile *file) {
+	file->readNumber();
+	CPickUp::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pickup/pick_up_speech_centre.h b/engines/titanic/game/pickup/pick_up_speech_centre.h
new file mode 100644
index 0000000..b68761b
--- /dev/null
+++ b/engines/titanic/game/pickup/pick_up_speech_centre.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PICK_UP_SPEECH_CENTRE_H
+#define TITANIC_PICK_UP_SPEECH_CENTRE_H
+
+#include "titanic/game/pickup/pick_up.h"
+
+namespace Titanic {
+
+class CPickUpSpeechCentre : public CPickUp {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPickUpSpeechCentre"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PICK_UP_SPEECH_CENTRE_H */
diff --git a/engines/titanic/game/pickup/pick_up_vis_centre.cpp b/engines/titanic/game/pickup/pick_up_vis_centre.cpp
new file mode 100644
index 0000000..8fda66f
--- /dev/null
+++ b/engines/titanic/game/pickup/pick_up_vis_centre.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pickup/pick_up_vis_centre.h"
+
+namespace Titanic {
+
+void CPickUpVisCentre::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPickUp::save(file, indent);
+}
+
+void CPickUpVisCentre::load(SimpleFile *file) {
+	file->readNumber();
+	CPickUp::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pickup/pick_up_vis_centre.h b/engines/titanic/game/pickup/pick_up_vis_centre.h
new file mode 100644
index 0000000..16db8f2
--- /dev/null
+++ b/engines/titanic/game/pickup/pick_up_vis_centre.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PICK_UP_VIS_CENTRE_H
+#define TITANIC_PICK_UP_VIS_CENTRE_H
+
+#include "titanic/game/pickup/pick_up.h"
+
+namespace Titanic {
+
+class CPickUpVisCentre : public CPickUp {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPickUpVisCentre"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PICK_UP_VIS_CENTRE_H */
diff --git a/engines/titanic/game/place_holder.cpp b/engines/titanic/game/place_holder.cpp
deleted file mode 100644
index f030880..0000000
--- a/engines/titanic/game/place_holder.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/place_holder.h"
-
-namespace Titanic {
-
-void CPlaceHolder::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
-}
-
-void CPlaceHolder::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/place_holder.h b/engines/titanic/game/place_holder.h
deleted file mode 100644
index dd1c89d..0000000
--- a/engines/titanic/game/place_holder.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PLACE_HOLDER_H
-#define TITANIC_PLACE_HOLDER_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CPlaceHolder : public CGameObject {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPlaceHolder"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PLACE_HOLDER_H */
diff --git a/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp b/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
new file mode 100644
index 0000000..3d3a056
--- /dev/null
+++ b/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/placeholder/bar_shelf_vis_centre.h"
+
+namespace Titanic {
+
+void CBarShelfVisCentre::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CPlaceHolder::save(file, indent);
+}
+
+void CBarShelfVisCentre::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CPlaceHolder::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/placeholder/bar_shelf_vis_centre.h b/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
new file mode 100644
index 0000000..1cd3ca2
--- /dev/null
+++ b/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BAR_SHELF_VIS_CENTRE_H
+#define TITANIC_BAR_SHELF_VIS_CENTRE_H
+
+#include "titanic/game/placeholder/place_holder.h"
+
+namespace Titanic {
+
+class CBarShelfVisCentre : public CPlaceHolder {
+private:
+	int _value;
+public:
+	CBarShelfVisCentre() : CPlaceHolder(), _value(0) {}
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBarShelfVisCentre"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BAR_SHELF_VIS_CENTRE_H */
diff --git a/engines/titanic/game/placeholder/lemon_on_bar.cpp b/engines/titanic/game/placeholder/lemon_on_bar.cpp
new file mode 100644
index 0000000..336933a
--- /dev/null
+++ b/engines/titanic/game/placeholder/lemon_on_bar.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/placeholder/lemon_on_bar.h"
+
+namespace Titanic {
+
+void CLemonOnBar::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writePoint(_pos1, indent);
+	CPlaceHolder::save(file, indent);
+}
+
+void CLemonOnBar::load(SimpleFile *file) {
+	file->readNumber();
+	_pos1 = file->readPoint();
+	CPlaceHolder::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/placeholder/lemon_on_bar.h b/engines/titanic/game/placeholder/lemon_on_bar.h
new file mode 100644
index 0000000..d02f7a9
--- /dev/null
+++ b/engines/titanic/game/placeholder/lemon_on_bar.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LEMON_ON_BAR_H
+#define TITANIC_LEMON_ON_BAR_H
+
+#include "titanic/game/placeholder/place_holder.h"
+
+namespace Titanic {
+
+class CLemonOnBar : public CPlaceHolder {
+private:
+	Common::Point _pos1;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CLemonOnBar"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LEMON_ON_BAR_H */
diff --git a/engines/titanic/game/placeholder/place_holder.cpp b/engines/titanic/game/placeholder/place_holder.cpp
new file mode 100644
index 0000000..d96f551
--- /dev/null
+++ b/engines/titanic/game/placeholder/place_holder.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/placeholder/place_holder.h"
+
+namespace Titanic {
+
+void CPlaceHolder::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPlaceHolder::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/placeholder/place_holder.h b/engines/titanic/game/placeholder/place_holder.h
new file mode 100644
index 0000000..dd1c89d
--- /dev/null
+++ b/engines/titanic/game/placeholder/place_holder.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PLACE_HOLDER_H
+#define TITANIC_PLACE_HOLDER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPlaceHolder : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPlaceHolder"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PLACE_HOLDER_H */
diff --git a/engines/titanic/game/placeholder/tv_on_bar.cpp b/engines/titanic/game/placeholder/tv_on_bar.cpp
new file mode 100644
index 0000000..5b22069
--- /dev/null
+++ b/engines/titanic/game/placeholder/tv_on_bar.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/placeholder/tv_on_bar.h"
+
+namespace Titanic {
+
+void CTVOnBar::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writePoint(_pos1, indent);
+	CPlaceHolder::save(file, indent);
+}
+
+void CTVOnBar::load(SimpleFile *file) {
+	file->readNumber();
+	_pos1 = file->readPoint();
+	CPlaceHolder::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/placeholder/tv_on_bar.h b/engines/titanic/game/placeholder/tv_on_bar.h
new file mode 100644
index 0000000..1583dad
--- /dev/null
+++ b/engines/titanic/game/placeholder/tv_on_bar.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TV_ON_BAR_H
+#define TITANIC_TV_ON_BAR_H
+
+#include "titanic/game/placeholder/place_holder.h"
+
+namespace Titanic {
+
+class CTVOnBar : public CPlaceHolder {
+private:
+	Common::Point _pos1;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTVOnBar"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TV_ON_BAR_H */
diff --git a/engines/titanic/game/sgt/armchair.cpp b/engines/titanic/game/sgt/armchair.cpp
new file mode 100644
index 0000000..3491452
--- /dev/null
+++ b/engines/titanic/game/sgt/armchair.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/armchair.h"
+
+namespace Titanic {
+
+void CArmchair::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void CArmchair::load(SimpleFile *file) {
+	file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/armchair.h b/engines/titanic/game/sgt/armchair.h
new file mode 100644
index 0000000..2157c3c
--- /dev/null
+++ b/engines/titanic/game/sgt/armchair.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ARMCHAIR_H
+#define TITANIC_ARMCHAIR_H
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+class CArmchair : public CSGTStateRoom {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CArmchair"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ARMCHAIR_H */
diff --git a/engines/titanic/game/sgt/basin.cpp b/engines/titanic/game/sgt/basin.cpp
new file mode 100644
index 0000000..75c53bc
--- /dev/null
+++ b/engines/titanic/game/sgt/basin.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/basin.h"
+
+namespace Titanic {
+
+void CBasin::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void CBasin::load(SimpleFile *file) {
+	file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/basin.h b/engines/titanic/game/sgt/basin.h
new file mode 100644
index 0000000..85aaf47
--- /dev/null
+++ b/engines/titanic/game/sgt/basin.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BASIN_H
+#define TITANIC_BASIN_H
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+class CBasin : public CSGTStateRoom {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBasin"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BASIN_H */
diff --git a/engines/titanic/game/sgt/bedfoot.cpp b/engines/titanic/game/sgt/bedfoot.cpp
new file mode 100644
index 0000000..b039f8a
--- /dev/null
+++ b/engines/titanic/game/sgt/bedfoot.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/bedfoot.h"
+
+namespace Titanic {
+
+void CBedfoot::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void CBedfoot::load(SimpleFile *file) {
+	file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/bedfoot.h b/engines/titanic/game/sgt/bedfoot.h
new file mode 100644
index 0000000..7794fc4
--- /dev/null
+++ b/engines/titanic/game/sgt/bedfoot.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BEDFOOT_H
+#define TITANIC_BEDFOOT_H
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+class CBedfoot : public CSGTStateRoom {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBedfoot"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BEDFOOT_H */
diff --git a/engines/titanic/game/sgt/bedhead.cpp b/engines/titanic/game/sgt/bedhead.cpp
new file mode 100644
index 0000000..758c1ff
--- /dev/null
+++ b/engines/titanic/game/sgt/bedhead.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/bedhead.h"
+
+namespace Titanic {
+
+void CBedhead::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void CBedhead::load(SimpleFile *file) {
+	file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/bedhead.h b/engines/titanic/game/sgt/bedhead.h
new file mode 100644
index 0000000..3669163
--- /dev/null
+++ b/engines/titanic/game/sgt/bedhead.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BEDHEAD_H
+#define TITANIC_BEDHEAD_H
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+class CBedhead : public CSGTStateRoom {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBedhead"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BEDHEAD_H */
diff --git a/engines/titanic/game/sgt/chest_of_drawers.cpp b/engines/titanic/game/sgt/chest_of_drawers.cpp
new file mode 100644
index 0000000..5ec98e8
--- /dev/null
+++ b/engines/titanic/game/sgt/chest_of_drawers.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/chest_of_drawers.h"
+
+namespace Titanic {
+
+void CChestOfDrawers::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void CChestOfDrawers::load(SimpleFile *file) {
+	file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/chest_of_drawers.h b/engines/titanic/game/sgt/chest_of_drawers.h
new file mode 100644
index 0000000..17f5cf9
--- /dev/null
+++ b/engines/titanic/game/sgt/chest_of_drawers.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CHEST_OF_DRAWERS_H
+#define TITANIC_CHEST_OF_DRAWERS_H
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+class CChestOfDrawers : public CSGTStateRoom {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CChestOfDrawers"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CHEST_OF_DRAWERS_H */
diff --git a/engines/titanic/game/sgt/desk.cpp b/engines/titanic/game/sgt/desk.cpp
new file mode 100644
index 0000000..ea00c24
--- /dev/null
+++ b/engines/titanic/game/sgt/desk.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/desk.h"
+
+namespace Titanic {
+
+void CDesk::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void CDesk::load(SimpleFile *file) {
+	file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/desk.h b/engines/titanic/game/sgt/desk.h
new file mode 100644
index 0000000..4c89c04
--- /dev/null
+++ b/engines/titanic/game/sgt/desk.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DESK_H
+#define TITANIC_DESK_H
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+class CDesk : public CSGTStateRoom {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDesk"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DESK_H */
diff --git a/engines/titanic/game/sgt/deskchair.cpp b/engines/titanic/game/sgt/deskchair.cpp
new file mode 100644
index 0000000..337b55a
--- /dev/null
+++ b/engines/titanic/game/sgt/deskchair.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/deskchair.h"
+
+namespace Titanic {
+
+void CDeskchair::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void CDeskchair::load(SimpleFile *file) {
+	file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/deskchair.h b/engines/titanic/game/sgt/deskchair.h
new file mode 100644
index 0000000..762b639
--- /dev/null
+++ b/engines/titanic/game/sgt/deskchair.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DESKCHAIR_H
+#define TITANIC_DESKCHAIR_H
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+class CDeskchair : public CSGTStateRoom {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDeskchair"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DESKCHAIR_H */
diff --git a/engines/titanic/game/sgt/drawer.cpp b/engines/titanic/game/sgt/drawer.cpp
new file mode 100644
index 0000000..1d7fad2
--- /dev/null
+++ b/engines/titanic/game/sgt/drawer.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/drawer.h"
+
+namespace Titanic {
+
+CDrawer::CDrawer() : CSGTStateRoom(), _fieldF4(0) {
+}
+
+void CDrawer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldF4, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void CDrawer::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldF4 = file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/drawer.h b/engines/titanic/game/sgt/drawer.h
new file mode 100644
index 0000000..100e27c
--- /dev/null
+++ b/engines/titanic/game/sgt/drawer.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DRAWER_H
+#define TITANIC_DRAWER_H
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+class CDrawer : public CSGTStateRoom {
+private:
+	int _fieldF4;
+public:
+	CDrawer();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDrawer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DRAWER_H */
diff --git a/engines/titanic/game/sgt/sgt_nav.cpp b/engines/titanic/game/sgt/sgt_nav.cpp
new file mode 100644
index 0000000..e40d34d
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_nav.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/sgt_nav.h"
+
+namespace Titanic {
+
+void SGTNav::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void SGTNav::load(SimpleFile *file) {
+	file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/sgt_nav.h b/engines/titanic/game/sgt/sgt_nav.h
new file mode 100644
index 0000000..7f1912d
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_nav.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SGT_NAV_H
+#define TITANIC_SGT_NAV_H
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+class SGTNav : public CSGTStateRoom {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "SGTNav"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SGT_NAV_H */
diff --git a/engines/titanic/game/sgt/sgt_state_control.cpp b/engines/titanic/game/sgt/sgt_state_control.cpp
new file mode 100644
index 0000000..113bd0d
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_state_control.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/sgt_state_control.h"
+
+namespace Titanic {
+
+void CSGTStateControl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	CBackground::save(file, indent);
+}
+
+void CSGTStateControl::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/sgt_state_control.h b/engines/titanic/game/sgt/sgt_state_control.h
new file mode 100644
index 0000000..b22095c
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_state_control.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SGT_STATE_CONTROL_H
+#define TITANIC_SGT_STATE_CONTROL_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CSGTStateControl : public CBackground {
+private:
+	int _fieldE0;
+public:
+	CSGTStateControl() : CBackground(), _fieldE0(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSGTStateControl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SGT_STATE_CONTROL_H */
diff --git a/engines/titanic/game/sgt/sgt_tv.cpp b/engines/titanic/game/sgt/sgt_tv.cpp
new file mode 100644
index 0000000..3165458
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_tv.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/sgt_tv.h"
+
+namespace Titanic {
+
+void CSGTTV::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void CSGTTV::load(SimpleFile *file) {
+	file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/sgt_tv.h b/engines/titanic/game/sgt/sgt_tv.h
new file mode 100644
index 0000000..79e7efd
--- /dev/null
+++ b/engines/titanic/game/sgt/sgt_tv.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SGT_TV_H
+#define TITANIC_SGT_TV_H
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+class CSGTTV : public CSGTStateRoom {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSGTTV"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SGT_TV_H */
diff --git a/engines/titanic/game/sgt/toilet.cpp b/engines/titanic/game/sgt/toilet.cpp
new file mode 100644
index 0000000..ed4ac52
--- /dev/null
+++ b/engines/titanic/game/sgt/toilet.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/toilet.h"
+
+namespace Titanic {
+
+void CToilet::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void CToilet::load(SimpleFile *file) {
+	file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/toilet.h b/engines/titanic/game/sgt/toilet.h
new file mode 100644
index 0000000..a5265e7
--- /dev/null
+++ b/engines/titanic/game/sgt/toilet.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TOILET_H
+#define TITANIC_TOILET_H
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+class CToilet : public CSGTStateRoom {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CToilet"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TOILET_H */
diff --git a/engines/titanic/game/sgt/vase.cpp b/engines/titanic/game/sgt/vase.cpp
new file mode 100644
index 0000000..04c5165
--- /dev/null
+++ b/engines/titanic/game/sgt/vase.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/vase.h"
+
+namespace Titanic {
+
+void CVase::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void CVase::load(SimpleFile *file) {
+	file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/vase.h b/engines/titanic/game/sgt/vase.h
new file mode 100644
index 0000000..37a5818
--- /dev/null
+++ b/engines/titanic/game/sgt/vase.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_VASE_H
+#define TITANIC_VASE_H
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+class CVase : public CSGTStateRoom {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CVase"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_VASE_H */
diff --git a/engines/titanic/game/sgt/washstand.cpp b/engines/titanic/game/sgt/washstand.cpp
new file mode 100644
index 0000000..f361b14
--- /dev/null
+++ b/engines/titanic/game/sgt/washstand.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/sgt/washstand.h"
+
+namespace Titanic {
+
+void CWashstand::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CSGTStateRoom::save(file, indent);
+}
+
+void CWashstand::load(SimpleFile *file) {
+	file->readNumber();
+	CSGTStateRoom::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/washstand.h b/engines/titanic/game/sgt/washstand.h
new file mode 100644
index 0000000..40eb5a4
--- /dev/null
+++ b/engines/titanic/game/sgt/washstand.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_WASHSTAND_H
+#define TITANIC_WASHSTAND_H
+
+#include "titanic/game/sgt/sgt_state_room.h"
+
+namespace Titanic {
+
+class CWashstand : public CSGTStateRoom {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CWashstand"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_WASHSTAND_H */
diff --git a/engines/titanic/game/transport/exit_pellerator.cpp b/engines/titanic/game/transport/exit_pellerator.cpp
new file mode 100644
index 0000000..400214a
--- /dev/null
+++ b/engines/titanic/game/transport/exit_pellerator.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+#include "titanic/game/transport/pellerator.h"
+
+namespace Titanic {
+
+int CPellerator::_v1;
+int CPellerator::_v2;
+
+void CPellerator::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+
+	CTransport::save(file, indent);
+}
+
+void CPellerator::load(SimpleFile *file) {
+	file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+
+	CTransport::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/transport/exit_pellerator.h b/engines/titanic/game/transport/exit_pellerator.h
new file mode 100644
index 0000000..d327ea6
--- /dev/null
+++ b/engines/titanic/game/transport/exit_pellerator.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+#ifndef TITANIC_PELLERATOR_H
+#define TITANIC_PELLERATOR_H
+
+#include "titanic/game/transport/transport.h"
+
+namespace Titanic {
+
+class CPellerator : public CTransport {
+private:
+	static int _v1;
+	static int _v2;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPellerator"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PELLERATOR_H */
diff --git a/engines/titanic/game/transport/pellerator.cpp b/engines/titanic/game/transport/pellerator.cpp
index 1ab8935..400214a 100644
--- a/engines/titanic/game/transport/pellerator.cpp
+++ b/engines/titanic/game/transport/pellerator.cpp
@@ -24,13 +24,22 @@
 
 namespace Titanic {
 
+int CPellerator::_v1;
+int CPellerator::_v2;
+
 void CPellerator::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+
 	CTransport::save(file, indent);
 }
 
 void CPellerator::load(SimpleFile *file) {
 	file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+
 	CTransport::load(file);
 }
 
diff --git a/engines/titanic/game/transport/pellerator.h b/engines/titanic/game/transport/pellerator.h
index 6ccc56f..d327ea6 100644
--- a/engines/titanic/game/transport/pellerator.h
+++ b/engines/titanic/game/transport/pellerator.h
@@ -28,6 +28,9 @@
 namespace Titanic {
 
 class CPellerator : public CTransport {
+private:
+	static int _v1;
+	static int _v2;
 public:
 	/**
 	 * Return the class name
diff --git a/engines/titanic/game/transport/service_elevator.cpp b/engines/titanic/game/transport/service_elevator.cpp
index df88c13..ba68bc8 100644
--- a/engines/titanic/game/transport/service_elevator.cpp
+++ b/engines/titanic/game/transport/service_elevator.cpp
@@ -24,12 +24,19 @@
 
 namespace Titanic {
 
+int CServiceElevator::_v1;
+int CServiceElevator::_v2;
+int CServiceElevator::_v3;
+
 CServiceElevator::CServiceElevator() : CTransport(),
 	_fieldF8(0), _fieldFC(0), _field100(0), _field104(0) {
 }
 
 void CServiceElevator::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+	file->writeNumberLine(_v3, indent);
 	file->writeNumberLine(_fieldF8, indent);
 	file->writeNumberLine(_fieldFC, indent);
 	file->writeNumberLine(_field100, indent);
@@ -40,6 +47,9 @@ void CServiceElevator::save(SimpleFile *file, int indent) const {
 
 void CServiceElevator::load(SimpleFile *file) {
 	file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+	_v3 = file->readNumber();
 	_fieldF8 = file->readNumber();
 	_fieldFC = file->readNumber();
 	_field100 = file->readNumber();
diff --git a/engines/titanic/game/transport/service_elevator.h b/engines/titanic/game/transport/service_elevator.h
index b41c6b1..f97e3bc 100644
--- a/engines/titanic/game/transport/service_elevator.h
+++ b/engines/titanic/game/transport/service_elevator.h
@@ -28,7 +28,11 @@
 namespace Titanic {
 
 class CServiceElevator : public CTransport {
-public:
+private:
+	static int _v1;
+	static int _v2;
+	static int _v3;
+
 	int _fieldF8;
 	int _fieldFC;
 	int _field100;
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index d4bbed8..618c008 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -167,7 +167,6 @@ MODULE_OBJS := \
 	game/pet_graphic.o \
 	game/phonograph.o \
 	game/phonograph_lid.o \
-	game/place_holder.o \
 	game/play_music_button.o \
 	game/play_on_act.o \
 	game/port_hole.o \
@@ -220,23 +219,49 @@ MODULE_OBJS := \
 	game/pet/pet_class1.o \
 	game/pet/pet_class2.o \
 	game/pet/pet_class3.o \
+	game/pet/pet_lift.o \
 	game/pet/pet_monitor.o \
+	game/pet/pet_pellerator.o \
 	game/pet/pet_position.o \
 	game/pet/pet_sentinal.o \
 	game/pet/pet_sounds.o \
 	game/pet/pet_transition.o \
 	game/pet/pet_transport.o \
+	game/pickup/pick_up.o \
+	game/pickup/pick_up_bar_glass.o \
+	game/pickup/pick_up_hose.o \
+	game/pickup/pick_up_lemon.o \
+	game/pickup/pick_up_speech_centre.o \
+	game/pickup/pick_up_vis_centre.o \
+	game/placeholder/bar_shelf_vis_centre.o \
+	game/placeholder/place_holder.o \
+	game/placeholder/lemon_on_bar.o \
+	game/placeholder/tv_on_bar.o \
 	game/transport/gondolier.o \
 	game/transport/lift.o \
 	game/transport/lift_indicator.o \
 	game/transport/pellerator.o \
 	game/transport/service_elevator.o \
 	game/transport/transport.o \
+	game/sgt/armchair.o \
+	game/sgt/basin.o \
+	game/sgt/bedfoot.o \
+	game/sgt/bedhead.o \
+	game/sgt/chest_of_drawers.o \
+	game/sgt/desk.o \
+	game/sgt/deskchair.o \
+	game/sgt/drawer.o \
 	game/sgt/sgt_doors.o \
+	game/sgt/sgt_nav.o \
 	game/sgt/sgt_navigation.o \
 	game/sgt/sgt_restaurant_doors.o \
+	game/sgt/sgt_state_control.o \
 	game/sgt/sgt_state_room.o \
+	game/sgt/sgt_tv.o \
 	game/sgt/sgt_upper_doors_sound.o \
+	game/sgt/toilet.o \
+	game/sgt/vase.o \
+	game/sgt/washstand.o \
 	gfx/act_button.o \
 	gfx/changes_season_button.o \
 	gfx/chev_left_off.o \
diff --git a/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp b/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
index 11df8d9..f993d26 100644
--- a/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
+++ b/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
@@ -24,13 +24,31 @@
 
 namespace Titanic {
 
+CEnterExitSecClassMiniLiftStatics *CEnterExitSecClassMiniLift::_statics;
+
+void CEnterExitSecClassMiniLift::init() {
+	_statics = new CEnterExitSecClassMiniLiftStatics();
+}
+
+void CEnterExitSecClassMiniLift::deinit() {
+	delete _statics;
+}
+
 void CEnterExitSecClassMiniLift::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_statics->_v1, indent);
+	file->writeNumberLine(_statics->_v2, indent);
+	file->writeNumberLine(_value, indent);
+
 	CGameObject::save(file, indent);
 }
 
 void CEnterExitSecClassMiniLift::load(SimpleFile *file) {
 	file->readNumber();
+	_statics->_v1 = file->readString();
+	_statics->_v2 = file->readNumber();
+	_value = file->readNumber();
+
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/moves/enter_exit_sec_class_mini_lift.h b/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
index aa3f9b3..364b2e3 100644
--- a/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
+++ b/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
@@ -27,8 +27,21 @@
 
 namespace Titanic {
 
+struct CEnterExitSecClassMiniLiftStatics {
+	CString _v1;
+	int _v2;
+
+	CEnterExitSecClassMiniLiftStatics() : _v2(1) {}
+};
+
 class CEnterExitSecClassMiniLift : public CGameObject {
+private:
+	static CEnterExitSecClassMiniLiftStatics *_statics;
+	int _value;
 public:
+	CEnterExitSecClassMiniLift() : CGameObject(), _value(0) {}
+	static void init();
+	static void deinit();
 	/**
 	 * Return the class name
 	 */
diff --git a/engines/titanic/moves/exit_pellerator.cpp b/engines/titanic/moves/exit_pellerator.cpp
index 81bec82..7c0a52b 100644
--- a/engines/titanic/moves/exit_pellerator.cpp
+++ b/engines/titanic/moves/exit_pellerator.cpp
@@ -24,13 +24,31 @@
 
 namespace Titanic {
 
+CExitPelleratorStatics *CExitPellerator::_statics;
+
+void CExitPellerator::init() {
+	_statics = new CExitPelleratorStatics();
+}
+
+void CExitPellerator::deinit() {
+	delete _statics;
+}
+
 void CExitPellerator::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_statics->_v1, indent);
+	file->writeNumberLine(_statics->_v2, indent);
+	file->writeNumberLine(_statics->_v3, indent);
+
 	CGameObject::save(file, indent);
 }
 
 void CExitPellerator::load(SimpleFile *file) {
 	file->readNumber();
+	_statics->_v1 = file->readString();
+	_statics->_v2 = file->readNumber();
+	_statics->_v3 = file->readNumber();
+
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/moves/exit_pellerator.h b/engines/titanic/moves/exit_pellerator.h
index 6185f61..7df5657 100644
--- a/engines/titanic/moves/exit_pellerator.h
+++ b/engines/titanic/moves/exit_pellerator.h
@@ -27,8 +27,19 @@
 
 namespace Titanic {
 
+struct CExitPelleratorStatics {
+	CString _v1;
+	int _v2;
+	int _v3;
+};
+
 class CExitPellerator : public CGameObject {
+private:
+	static CExitPelleratorStatics *_statics;
 public:
+	static void init();
+	static void deinit();
+
 	/**
 	 * Return the class name
 	 */
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index d8d4c77..bcccf1b 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -35,6 +35,8 @@
 #include "titanic/game/sgt/sgt_navigation.h"
 #include "titanic/game/sgt/sgt_state_room.h"
 #include "titanic/moves/enter_exit_first_class_state.h"
+#include "titanic/moves/enter_exit_sec_class_mini_lift.h"
+#include "titanic/moves/exit_pellerator.h"
 
 namespace Titanic {
 
@@ -64,6 +66,8 @@ void TitanicEngine::initialize() {
 	CParrotLobbyObject::init();
 	CSGTNavigation::init();
 	CSGTStateRoom::init();
+	CExitPellerator::init();
+	CEnterExitSecClassMiniLift::init();
 
 	_screenManager = new OSScreenManager(this);
 	_window = new CMainGameWindow(this);
@@ -76,6 +80,8 @@ void TitanicEngine::deinitialize() {
 	CHose::deinit();
 	CSGTNavigation::deinit();
 	CSGTStateRoom::deinit();
+	CExitPellerator::deinit();
+	CEnterExitSecClassMiniLift::deinit();
 }
 
 Common::Error TitanicEngine::run() {


Commit: 700b77e1eaea257f322efdb2336b8a46dd3b91ec
    https://github.com/scummvm/scummvm/commit/700b77e1eaea257f322efdb2336b8a46dd3b91ec
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-02T08:01:03-05:00

Commit Message:
TITANIC: Added more miscellaneous classes

Changed paths:
  A engines/titanic/moves/exit_tiania.cpp
  A engines/titanic/moves/exit_tiania.h
  A engines/titanic/sound/auto_sound_player_adsr.cpp
  A engines/titanic/sound/auto_sound_player_adsr.h
  A engines/titanic/sound/enter_view_toggles_other_music.cpp
  A engines/titanic/sound/enter_view_toggles_other_music.h
  A engines/titanic/sound/node_auto_sound_player.cpp
  A engines/titanic/sound/node_auto_sound_player.h
  A engines/titanic/sound/view_auto_sound_player.cpp
  A engines/titanic/sound/view_auto_sound_player.h
  A engines/titanic/sound/view_toggles_other_music.cpp
  A engines/titanic/sound/view_toggles_other_music.h
  R engines/titanic/moves/exit_titania.cpp
  R engines/titanic/moves/exit_titania.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk
    engines/titanic/sound/trigger_auto_music_player.cpp
    engines/titanic/sound/trigger_auto_music_player.h
    engines/titanic/sound/water_lapping_sounds.cpp



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index a2273fd..db058cb 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -291,6 +291,7 @@
 #include "titanic/moves/exit_lift.h"
 #include "titanic/moves/exit_pellerator.h"
 #include "titanic/moves/exit_state_room.h"
+#include "titanic/moves/exit_tiania.h"
 #include "titanic/moves/move_player_in_parrot_room.h"
 #include "titanic/moves/move_player_to.h"
 #include "titanic/moves/move_player_to_from.h"
@@ -317,14 +318,20 @@
 #include "titanic/sound/auto_music_player.h"
 #include "titanic/sound/auto_music_player_base.h"
 #include "titanic/sound/auto_sound_player.h"
+#include "titanic/sound/auto_sound_player_adsr.h"
 #include "titanic/sound/background_sound_maker.h"
 #include "titanic/sound/bird_song.h"
 #include "titanic/sound/gondolier_song.h"
+#include "titanic/sound/enter_view_toggles_other_music.h"
 #include "titanic/sound/music_player.h"
+#include "titanic/sound/node_auto_sound_player.h"
 #include "titanic/sound/restricted_auto_music_player.h"
+#include "titanic/sound/room_auto_sound_player.h"
 #include "titanic/sound/seasonal_music_player.h"
 #include "titanic/sound/titania_speech.h"
 #include "titanic/sound/trigger_auto_music_player.h"
+#include "titanic/sound/view_auto_sound_player.h"
+#include "titanic/sound/view_toggles_other_music.h"
 #include "titanic/sound/water_lapping_sounds.h"
 
 namespace Titanic {
@@ -779,6 +786,7 @@ DEFFN(CExitBridge);
 DEFFN(CExitLift);
 DEFFN(CExitPellerator);
 DEFFN(CExitStateRoom);
+DEFFN(CExitTiania);
 DEFFN(CMovePlayerInParrotRoom);
 DEFFN(CMovePlayerTo);
 DEFFN(CMovePlayerToFrom);
@@ -804,14 +812,20 @@ DEFFN(CTitania);
 DEFFN(CAutoMusicPlayer);
 DEFFN(CAutoMusicPlayerBase);
 DEFFN(CAutoSoundPlayer);
+DEFFN(CAutoSoundPlayerADSR);
 DEFFN(CBackgroundSoundMaker);
 DEFFN(CBirdSong);
+DEFFN(CEnterViewTogglesOtherMusic);
 DEFFN(CGondolierSong);
 DEFFN(CMusicPlayer);
+DEFFN(CNodeAutoSoundPlayer);
 DEFFN(CRestrictedAutoMusicPlayer);
+DEFFN(CRoomAutoSoundPlayer);
 DEFFN(CSeasonalMusicPlayer);
 DEFFN(CTitaniaSpeech);
 DEFFN(CTriggerAutoMusicPlayer);
+DEFFN(CViewAutoSoundPlayer);
+DEFFN(CViewTogglesOtherMusic);
 DEFFN(CWaterLappingSounds);
 
 void CSaveableObject::initClassList() {
@@ -1261,6 +1275,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CExitLift);
 	ADDFN(CExitPellerator);
 	ADDFN(CExitStateRoom);
+	ADDFN(CExitTiania);
 	ADDFN(CMovePlayerInParrotRoom);
 	ADDFN(CMovePlayerTo);
 	ADDFN(CMovePlayerToFrom);
@@ -1287,15 +1302,22 @@ void CSaveableObject::initClassList() {
 	ADDFN(CAutoMusicPlayer);
 	ADDFN(CAutoMusicPlayerBase);
 	ADDFN(CAutoSoundPlayer);
+	ADDFN(CAutoSoundPlayerADSR);
 	ADDFN(CBackgroundSoundMaker);
 	ADDFN(CBirdSong);
 	ADDFN(CGondolierSong);
+	ADDFN(CEnterViewTogglesOtherMusic);
+	ADDFN(CGondolierSong);
 	ADDFN(CMusicPlayer);
+	ADDFN(CNodeAutoSoundPlayer);
 	ADDFN(CRestrictedAutoMusicPlayer);
+	ADDFN(CRoomAutoSoundPlayer);
 	ADDFN(CSeasonalMusicPlayer);
 	ADDFN(CAutoMusicPlayer);
 	ADDFN(CTitaniaSpeech);
 	ADDFN(CTriggerAutoMusicPlayer);
+	ADDFN(CViewAutoSoundPlayer);
+	ADDFN(CViewTogglesOtherMusic);
 	ADDFN(CWaterLappingSounds);
 }
 
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 618c008..0a236d9 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -310,7 +310,7 @@ MODULE_OBJS := \
 	moves/exit_lift.o \
 	moves/exit_pellerator.o \
 	moves/exit_state_room.o \
-	moves/exit_titania.o \
+	moves/exit_tiania.o \
 	moves/move_player_in_parrot_room.o \
 	moves/move_player_to_from.o \
 	moves/move_player_to.o \
@@ -338,15 +338,20 @@ MODULE_OBJS := \
 	sound/auto_music_player.o \
 	sound/auto_music_player_base.o \
 	sound/auto_sound_player.o \
+	sound/auto_sound_player_adsr.o \
 	sound/background_sound_maker.o \
 	sound/bird_song.o \
+	sound/enter_view_toggles_other_music.o \
 	sound/gondolier_song.o \
 	sound/music_player.o \
+	sound/node_auto_sound_player.o \
 	sound/restricted_auto_music_player.o \
 	sound/room_auto_sound_player.o \
 	sound/seasonal_music_player.o \
 	sound/titania_speech.o \
 	sound/trigger_auto_music_player.o \
+	sound/view_auto_sound_player.o \
+	sound/view_toggles_other_music.o \
 	sound/water_lapping_sounds.o
 
 # This module can be built as a plugin
diff --git a/engines/titanic/moves/exit_tiania.cpp b/engines/titanic/moves/exit_tiania.cpp
new file mode 100644
index 0000000..99b6c96
--- /dev/null
+++ b/engines/titanic/moves/exit_tiania.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/moves/exit_tiania.h"
+
+namespace Titanic {
+
+CExitTiania::CExitTiania() : CMovePlayerTo(), _fieldC8(0),
+		_string1("NULL"), _string2("NULL"), _string3("NULL") {
+}
+
+void CExitTiania::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string3, indent);
+
+	CMovePlayerTo::save(file, indent);
+}
+
+void CExitTiania::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldC8 = file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_string3 = file->readString();
+
+	CMovePlayerTo::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/exit_tiania.h b/engines/titanic/moves/exit_tiania.h
new file mode 100644
index 0000000..63e120f
--- /dev/null
+++ b/engines/titanic/moves/exit_tiania.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXIT_TIANIA_H
+#define TITANIC_EXIT_TIANIA_H
+
+#include "titanic/moves/move_player_to.h"
+
+namespace Titanic {
+
+class CExitTiania : public CMovePlayerTo {
+private:
+	int _fieldC8;
+	CString _string1;
+	CString _string2;
+	CString _string3;
+public:
+	CExitTiania();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CExitTiania"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EXIT_TIANIA_H */
diff --git a/engines/titanic/moves/exit_titania.cpp b/engines/titanic/moves/exit_titania.cpp
deleted file mode 100644
index 99585f5..0000000
--- a/engines/titanic/moves/exit_titania.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/moves/exit_titania.h"
-
-namespace Titanic {
-
-CExitTitania::CExitTitania() : CMovePlayerTo(), _fieldC8(0),
-		_string1("NULL"), _string2("NULL"), _string3("NULL") {
-}
-
-void CExitTitania::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldC8, indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeQuotedLine(_string2, indent);
-	file->writeQuotedLine(_string3, indent);
-
-	CMovePlayerTo::save(file, indent);
-}
-
-void CExitTitania::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldC8 = file->readNumber();
-	_string1 = file->readString();
-	_string2 = file->readString();
-	_string3 = file->readString();
-
-	CMovePlayerTo::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/moves/exit_titania.h b/engines/titanic/moves/exit_titania.h
deleted file mode 100644
index 1d2226a..0000000
--- a/engines/titanic/moves/exit_titania.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_EXIT_TITANIA_H
-#define TITANIC_EXIT_TITANIA_H
-
-#include "titanic/moves/move_player_to.h"
-
-namespace Titanic {
-
-class CExitTitania : public CMovePlayerTo {
-private:
-	int _fieldC8;
-	CString _string1;
-	CString _string2;
-	CString _string3;
-public:
-	CExitTitania();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CExitTitania"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_EXIT_TITANIA_H */
diff --git a/engines/titanic/sound/auto_sound_player_adsr.cpp b/engines/titanic/sound/auto_sound_player_adsr.cpp
new file mode 100644
index 0000000..815c1cd
--- /dev/null
+++ b/engines/titanic/sound/auto_sound_player_adsr.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/auto_sound_player_adsr.h"
+
+namespace Titanic {
+
+void CAutoSoundPlayerADSR::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeQuotedLine(_string4, indent);
+	CAutoSoundPlayer::save(file, indent);
+}
+
+void CAutoSoundPlayerADSR::load(SimpleFile *file) {
+	file->readNumber();
+	_string2 = file->readString();
+	_string3 = file->readString();
+	_string4 = file->readString();
+	CAutoSoundPlayer::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/auto_sound_player_adsr.h b/engines/titanic/sound/auto_sound_player_adsr.h
new file mode 100644
index 0000000..9c2a082
--- /dev/null
+++ b/engines/titanic/sound/auto_sound_player_adsr.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_SOUND_PLAYER_ADSR_H
+#define TITANIC_AUTO_SOUND_PLAYER_ADSR_H
+
+#include "titanic/sound/auto_sound_player.h"
+
+namespace Titanic {
+
+class CAutoSoundPlayerADSR : public CAutoSoundPlayer {
+private:
+	CString _string2;
+	CString _string3;
+	CString _string4;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoSoundPlayerADSR"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUTO_SOUND_PLAYER_ADSR_H */
diff --git a/engines/titanic/sound/enter_view_toggles_other_music.cpp b/engines/titanic/sound/enter_view_toggles_other_music.cpp
new file mode 100644
index 0000000..fbf5b4a
--- /dev/null
+++ b/engines/titanic/sound/enter_view_toggles_other_music.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/enter_view_toggles_other_music.h"
+
+namespace Titanic {
+
+CEnterViewTogglesOtherMusic::CEnterViewTogglesOtherMusic() : CTriggerAutoMusicPlayer(), _fieldC8(0) {
+}
+
+void CEnterViewTogglesOtherMusic::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+
+	CTriggerAutoMusicPlayer::save(file, indent);
+}
+
+void CEnterViewTogglesOtherMusic::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldC8 = file->readNumber();
+
+	CTriggerAutoMusicPlayer::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/enter_view_toggles_other_music.h b/engines/titanic/sound/enter_view_toggles_other_music.h
new file mode 100644
index 0000000..3e7976e
--- /dev/null
+++ b/engines/titanic/sound/enter_view_toggles_other_music.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ENTER_VIEW_TOGGLES_OTHER_MUSIC_H
+#define TITANIC_ENTER_VIEW_TOGGLES_OTHER_MUSIC_H
+
+#include "titanic/sound/trigger_auto_music_player.h"
+
+namespace Titanic {
+
+class CEnterViewTogglesOtherMusic : public CTriggerAutoMusicPlayer {
+protected:
+	int _fieldC8;
+public:
+	CEnterViewTogglesOtherMusic();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEnterViewTogglesOtherMusic"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ENTER_VIEW_TOGGLES_OTHER_MUSIC_H */
diff --git a/engines/titanic/sound/node_auto_sound_player.cpp b/engines/titanic/sound/node_auto_sound_player.cpp
new file mode 100644
index 0000000..3a69535
--- /dev/null
+++ b/engines/titanic/sound/node_auto_sound_player.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/node_auto_sound_player.h"
+
+namespace Titanic {
+
+void CNodeAutoSoundPlayer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	CAutoSoundPlayer::save(file, indent);
+}
+
+void CNodeAutoSoundPlayer::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldEC = file->readNumber();
+	CAutoSoundPlayer::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/node_auto_sound_player.h b/engines/titanic/sound/node_auto_sound_player.h
new file mode 100644
index 0000000..5f4b70b
--- /dev/null
+++ b/engines/titanic/sound/node_auto_sound_player.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NODE_AUTO_SOUND_PLAYER_H
+#define TITANIC_NODE_AUTO_SOUND_PLAYER_H
+
+#include "titanic/sound/auto_sound_player.h"
+
+namespace Titanic {
+
+class CNodeAutoSoundPlayer : public CAutoSoundPlayer {
+private:
+	int _fieldEC;
+public:
+	CNodeAutoSoundPlayer() : CAutoSoundPlayer(), _fieldEC(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CViewAutoSoundPlayer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NODE_AUTO_SOUND_PLAYER_H */
diff --git a/engines/titanic/sound/trigger_auto_music_player.cpp b/engines/titanic/sound/trigger_auto_music_player.cpp
index adcc18c..17499a7 100644
--- a/engines/titanic/sound/trigger_auto_music_player.cpp
+++ b/engines/titanic/sound/trigger_auto_music_player.cpp
@@ -26,11 +26,13 @@ namespace Titanic {
 
 void CTriggerAutoMusicPlayer::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_fieldBC, indent);
 	CGameObject::save(file, indent);
 }
 
 void CTriggerAutoMusicPlayer::load(SimpleFile *file) {
 	file->readNumber();
+	_fieldBC = file->readString();
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/sound/trigger_auto_music_player.h b/engines/titanic/sound/trigger_auto_music_player.h
index d67add2..8f7a42c 100644
--- a/engines/titanic/sound/trigger_auto_music_player.h
+++ b/engines/titanic/sound/trigger_auto_music_player.h
@@ -28,6 +28,8 @@
 namespace Titanic {
 
 class CTriggerAutoMusicPlayer : public CGameObject {
+protected:
+	CString _fieldBC;
 public:
 	/**
 	 * Return the class name
diff --git a/engines/titanic/sound/view_auto_sound_player.cpp b/engines/titanic/sound/view_auto_sound_player.cpp
new file mode 100644
index 0000000..3d6c92f
--- /dev/null
+++ b/engines/titanic/sound/view_auto_sound_player.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/view_auto_sound_player.h"
+
+namespace Titanic {
+
+void CViewAutoSoundPlayer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	CAutoSoundPlayer::save(file, indent);
+}
+
+void CViewAutoSoundPlayer::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldEC = file->readNumber();
+	CAutoSoundPlayer::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/view_auto_sound_player.h b/engines/titanic/sound/view_auto_sound_player.h
new file mode 100644
index 0000000..9e87d74
--- /dev/null
+++ b/engines/titanic/sound/view_auto_sound_player.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_VIEW_AUTO_SOUND_PLAYER_H
+#define TITANIC_VIEW_AUTO_SOUND_PLAYER_H
+
+#include "titanic/sound/auto_sound_player.h"
+
+namespace Titanic {
+
+class CViewAutoSoundPlayer : public CAutoSoundPlayer {
+private:
+	int _fieldEC;
+public:
+	CViewAutoSoundPlayer() : CAutoSoundPlayer(), _fieldEC(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CViewAutoSoundPlayer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_VIEW_AUTO_SOUND_PLAYER_H */
diff --git a/engines/titanic/sound/view_toggles_other_music.cpp b/engines/titanic/sound/view_toggles_other_music.cpp
new file mode 100644
index 0000000..262d7de
--- /dev/null
+++ b/engines/titanic/sound/view_toggles_other_music.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/view_toggles_other_music.h"
+
+namespace Titanic {
+
+CViewTogglesOtherMusic::CViewTogglesOtherMusic() : CEnterViewTogglesOtherMusic(), _fieldCC(0) {
+}
+
+void CViewTogglesOtherMusic::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldCC, indent);
+
+	CEnterViewTogglesOtherMusic::save(file, indent);
+}
+
+void CViewTogglesOtherMusic::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldCC = file->readNumber();
+
+	CEnterViewTogglesOtherMusic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/view_toggles_other_music.h b/engines/titanic/sound/view_toggles_other_music.h
new file mode 100644
index 0000000..e0da243
--- /dev/null
+++ b/engines/titanic/sound/view_toggles_other_music.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_VIEW_TOGGLES_OTHER_MUSIC_H
+#define TITANIC_VIEW_TOGGLES_OTHER_MUSIC_H
+
+#include "titanic/sound/enter_view_toggles_other_music.h"
+
+namespace Titanic {
+
+class CViewTogglesOtherMusic : public CEnterViewTogglesOtherMusic {
+private:
+	int _fieldCC;
+public:
+	CViewTogglesOtherMusic();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CViewTogglesOtherMusic"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_VIEW_TOGGLES_OTHER_MUSIC_H */
diff --git a/engines/titanic/sound/water_lapping_sounds.cpp b/engines/titanic/sound/water_lapping_sounds.cpp
index 7222b5a..b3f5d23 100644
--- a/engines/titanic/sound/water_lapping_sounds.cpp
+++ b/engines/titanic/sound/water_lapping_sounds.cpp
@@ -26,13 +26,21 @@ namespace Titanic {
 
 void CWaterLappingSounds::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldD4, indent);
+	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_value, indent);
+
 	CRoomAutoSoundPlayer::save(file, indent);
 }
 
 void CWaterLappingSounds::load(SimpleFile *file) {
 	file->readNumber();
+	_string1 = file->readString();
+	_fieldD4 = file->readNumber();
+	_fieldE0 = file->readNumber();
 	_value = file->readNumber();
+	
 	CRoomAutoSoundPlayer::load(file);
 }
 


Commit: 96825e282392d24e683c0e9cb7b7a1ac9aa4f467
    https://github.com/scummvm/scummvm/commit/96825e282392d24e683c0e9cb7b7a1ac9aa4f467
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-02T18:29:09-05:00

Commit Message:
TITANIC: More saveable classes implemented

Changed paths:
  A engines/titanic/game/code_wheel.cpp
  A engines/titanic/game/code_wheel.h
  A engines/titanic/game/missiveomat_button.cpp
  A engines/titanic/game/missiveomat_button.h
  A engines/titanic/gfx/edit_control.cpp
  A engines/titanic/gfx/edit_control.h
    engines/titanic/carry/bridge_piece.cpp
    engines/titanic/carry/bridge_piece.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/bottom_of_well_monitor.cpp
    engines/titanic/game/bottom_of_well_monitor.h
    engines/titanic/game/brain_slot.cpp
    engines/titanic/game/brain_slot.h
    engines/titanic/game/head_slot.cpp
    engines/titanic/game/ship_setting_button.cpp
    engines/titanic/game/ship_setting_button.h
    engines/titanic/module.mk



diff --git a/engines/titanic/carry/bridge_piece.cpp b/engines/titanic/carry/bridge_piece.cpp
index b9c998d..e93d3c4 100644
--- a/engines/titanic/carry/bridge_piece.cpp
+++ b/engines/titanic/carry/bridge_piece.cpp
@@ -24,14 +24,13 @@
 
 namespace Titanic {
 
-CBridgePiece::CBridgePiece() : CCarry(),
-		_field138(0), _field13C(0), _field140(0) {
+CBridgePiece::CBridgePiece() : CCarry(), _field140(0) {
 }
 
 void CBridgePiece::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string6, indent);
-	file->writeNumberLine(_field138, indent);
+	file->writePoint(_pos3, indent);
 	file->writeNumberLine(_field140, indent);
 
 	CCarry::save(file, indent);
@@ -40,7 +39,7 @@ void CBridgePiece::save(SimpleFile *file, int indent) const {
 void CBridgePiece::load(SimpleFile *file) {
 	file->readNumber();
 	_string6 = file->readString();
-	_field138 = file->readNumber();
+	_pos3 = file->readPoint();
 	_field140 = file->readNumber();
 
 	CCarry::load(file);
diff --git a/engines/titanic/carry/bridge_piece.h b/engines/titanic/carry/bridge_piece.h
index f38e27e..50a26c9 100644
--- a/engines/titanic/carry/bridge_piece.h
+++ b/engines/titanic/carry/bridge_piece.h
@@ -30,8 +30,7 @@ namespace Titanic {
 class CBridgePiece : public CCarry {
 private:
 	CString _string6;
-	int _field138;
-	int _field13C;
+	Common::Point _pos3;
 	int _field140;
 public:
 	CBridgePiece();
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index db058cb..a29bde6 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -86,7 +86,9 @@
 #include "titanic/game/bar_menu_button.h"
 #include "titanic/game/belbot_get_light.h"
 #include "titanic/game/bomb.h"
+#include "titanic/game/bottom_of_well_monitor.h"
 #include "titanic/game/bowl_unlocker.h"
+#include "titanic/game/brain_slot.h"
 #include "titanic/game/bridge_view.h"
 #include "titanic/game/broken_pell_base.h"
 #include "titanic/game/cage.h"
@@ -101,6 +103,7 @@
 #include "titanic/game/close_broken_pel.h"
 #include "titanic/game/computer.h"
 #include "titanic/game/computer_screen.h"
+#include "titanic/game/code_wheel.h"
 #include "titanic/game/cookie.h"
 #include "titanic/game/credits.h"
 #include "titanic/game/credits_button.h"
@@ -130,6 +133,7 @@
 #include "titanic/game/hammer_clip.h"
 #include "titanic/game/hammer_dispensor.h"
 #include "titanic/game/hammer_dispensor_button.h"
+#include "titanic/game/head_slot.h"
 #include "titanic/game/head_smash_event.h"
 #include "titanic/game/head_smash_lever.h"
 #include "titanic/game/idle_summoner.h"
@@ -139,6 +143,8 @@
 #include "titanic/game/little_lift_button.h"
 #include "titanic/game/long_stick_dispenser.h"
 #include "titanic/game/maitred_arm_holder.h"
+#include "titanic/game/missiveomat.h"
+#include "titanic/game/missiveomat_button.h"
 #include "titanic/game/musical_instrument.h"
 #include "titanic/game/music_console_button.h"
 #include "titanic/game/music_room_phonograph.h"
@@ -148,6 +154,9 @@
 #include "titanic/game/nose_holder.h"
 #include "titanic/game/null_port_hole.h"
 #include "titanic/game/nut_replacer.h"
+#include "titanic/game/pet_disabler.h"
+#include "titanic/game/pet_graphic.h"
+#include "titanic/game/pet_graphic2.h"
 #include "titanic/game/phonograph.h"
 #include "titanic/game/play_music_button.h"
 #include "titanic/game/play_on_act.h"
@@ -164,6 +173,7 @@
 #include "titanic/game/service_elevator_door.h"
 #include "titanic/game/service_elevator_window.h"
 #include "titanic/game/ship_setting.h"
+#include "titanic/game/ship_setting_button.h"
 #include "titanic/game/speech_dispensor.h"
 #include "titanic/game/starling_puret.h"
 #include "titanic/game/start_action.h"
@@ -173,6 +183,7 @@
 #include "titanic/game/television.h"
 #include "titanic/game/third_class_canal.h"
 #include "titanic/game/throw_tv_down_well.h"
+#include "titanic/game/titania_still_control.h"
 #include "titanic/game/tow_parrot_nav.h"
 #include "titanic/game/up_lighter.h"
 #include "titanic/game/wheel_button.h"
@@ -244,6 +255,7 @@
 #include "titanic/gfx/chev_right_on.h"
 #include "titanic/gfx/chev_send_rec_switch.h"
 #include "titanic/gfx/chev_switch.h"
+#include "titanic/gfx/edit_control.h"
 #include "titanic/gfx/elevator_button.h"
 #include "titanic/gfx/get_from_succ.h"
 #include "titanic/gfx/helmet_on_off.h"
@@ -407,8 +419,10 @@ DEFFN(CBarBell);
 DEFFN(CBarMenu);
 DEFFN(CBarMenuButton);
 DEFFN(CBelbotGetLight);
-DEFFN(CBowlUnlocker);
 DEFFN(CBomb);
+DEFFN(CBottomOfWellMonitor);
+DEFFN(CBowlUnlocker);
+DEFFN(CBrainSlot);
 DEFFN(CBridgeView);
 DEFFN(CBrokenPellBase)
 DEFFN(CCage);
@@ -420,6 +434,7 @@ DEFFN(CCDROMTray);
 DEFFN(CCellPointButton);
 DEFFN(CChickenDispensor);
 DEFFN(CCloseBrokenPel);
+DEFFN(CodeWheel);
 DEFFN(CComputer);
 DEFFN(CCookie);
 DEFFN(CComputerScreen);
@@ -451,6 +466,7 @@ DEFFN(CGlassSmasher);
 DEFFN(CHammerClip);
 DEFFN(CHammerDispensor);
 DEFFN(CHammerDispensorButton);
+DEFFN(CHeadSlot);
 DEFFN(CHeadSmashEvent);
 DEFFN(CHeadSmashLever);
 DEFFN(CIdleSummoner);
@@ -460,6 +476,8 @@ DEFFN(CLightSwitch);
 DEFFN(CLittleLiftButton);
 DEFFN(CLongStickDispenser);
 DEFFN(CMaitreDArmHolder);
+DEFFN(CMissiveOMat);
+DEFFN(CMissiveOMatButton);
 DEFFN(CMusicalInstrument);
 DEFFN(CMusicConsoleButton);
 DEFFN(CMusicRoomPhonograph);
@@ -469,6 +487,9 @@ DEFFN(CNoNutBowl);
 DEFFN(CNoseHolder);
 DEFFN(CNullPortHole);
 DEFFN(CNutReplacer);
+DEFFN(CPetDisabler);
+DEFFN(CPetGraphic);
+DEFFN(CPetGraphic2);
 DEFFN(CPhonograph);
 DEFFN(CPlayMusicButton);
 DEFFN(CPlayOnAct);
@@ -485,6 +506,7 @@ DEFFN(CSeasonalAdjustment);
 DEFFN(CServiceElevatorDoor);
 DEFFN(CServiceElevatorWindow);
 DEFFN(CShipSetting);
+DEFFN(CShipSettingButton);
 DEFFN(CSpeechDispensor);
 DEFFN(CStarlingPuret);
 DEFFN(CStartAction);
@@ -494,6 +516,7 @@ DEFFN(CSweetBowl);
 DEFFN(CTelevision);
 DEFFN(CThirdClassCanal);
 DEFFN(CThrowTVDownWell);
+DEFFN(CTitaniaStillControl);
 DEFFN(CTOWParrotNav);
 DEFFN(CUpLighter);
 DEFFN(CWheelButton);
@@ -567,6 +590,7 @@ DEFFN(CChevRightOff);
 DEFFN(CChevRightOn);
 DEFFN(CChevSendRecSwitch);
 DEFFN(CChevSwitch);
+DEFFN(CEditControl);
 DEFFN(CElevatorButton);
 DEFFN(CGetFromSucc);
 DEFFN(CHelmetOnOff);
@@ -896,6 +920,8 @@ void CSaveableObject::initClassList() {
 	ADDFN(CBarMenuButton);
 	ADDFN(CBelbotGetLight);
 	ADDFN(CBomb);
+	ADDFN(CBottomOfWellMonitor);
+	ADDFN(CBrainSlot);
 	ADDFN(CBowlUnlocker);
 	ADDFN(CBridgeView);
 	ADDFN(CBrokenPellBase);
@@ -907,6 +933,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CCDROMTray);
 	ADDFN(CCellPointButton);
 	ADDFN(CChickenDispensor);
+	ADDFN(CodeWheel);
 	ADDFN(CComputerScreen);
 	ADDFN(CCloseBrokenPel);
 	ADDFN(CComputer);
@@ -940,6 +967,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CHammerClip);
 	ADDFN(CHammerDispensor);
 	ADDFN(CHammerDispensorButton);
+	ADDFN(CHeadSlot);
 	ADDFN(CHeadSmashEvent);
 	ADDFN(CHeadSmashLever);
 	ADDFN(CIdleSummoner);
@@ -949,6 +977,8 @@ void CSaveableObject::initClassList() {
 	ADDFN(CLittleLiftButton);
 	ADDFN(CLongStickDispenser);
 	ADDFN(CMaitreDArmHolder);
+	ADDFN(CMissiveOMat);
+	ADDFN(CMissiveOMatButton);
 	ADDFN(CMusicalInstrument);
 	ADDFN(CMusicConsoleButton);
 	ADDFN(CMusicRoomPhonograph);
@@ -958,6 +988,9 @@ void CSaveableObject::initClassList() {
 	ADDFN(CNoseHolder);
 	ADDFN(CNullPortHole);
 	ADDFN(CNutReplacer);
+	ADDFN(CPetDisabler);
+	ADDFN(CPetGraphic);
+	ADDFN(CPetGraphic2);
 	ADDFN(CPhonograph);
 	ADDFN(CPlayMusicButton);
 	ADDFN(CPlayOnAct);
@@ -974,6 +1007,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CServiceElevatorDoor);
 	ADDFN(CServiceElevatorWindow);
 	ADDFN(CShipSetting);
+	ADDFN(CShipSettingButton);
 	ADDFN(CSpeechDispensor);
 	ADDFN(CStarlingPuret);
 	ADDFN(CStartAction);
@@ -983,6 +1017,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CTelevision);
 	ADDFN(CThirdClassCanal);
 	ADDFN(CThrowTVDownWell);
+	ADDFN(CTitaniaStillControl);
 	ADDFN(CTOWParrotNav);
 	ADDFN(CUpLighter);
 	ADDFN(CWheelButton);
@@ -1056,6 +1091,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CChevRightOn);
 	ADDFN(CChevSendRecSwitch);
 	ADDFN(CChevSwitch);
+	ADDFN(CEditControl);
 	ADDFN(CElevatorButton);
 	ADDFN(CGetFromSucc);
 	ADDFN(CHelmetOnOff);
diff --git a/engines/titanic/game/bottom_of_well_monitor.cpp b/engines/titanic/game/bottom_of_well_monitor.cpp
index daca5db..b48b5ad 100644
--- a/engines/titanic/game/bottom_of_well_monitor.cpp
+++ b/engines/titanic/game/bottom_of_well_monitor.cpp
@@ -24,14 +24,21 @@
 
 namespace Titanic {
 
+int CBottomOfWellMonitor::_v1;
+int CBottomOfWellMonitor::_v2;
+
 void CBottomOfWellMonitor::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
 }
 
 void CBottomOfWellMonitor::load(SimpleFile *file) {
 	file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
 	_value = file->readNumber();
 	CGameObject::load(file);
 }
diff --git a/engines/titanic/game/bottom_of_well_monitor.h b/engines/titanic/game/bottom_of_well_monitor.h
index de07aac..f1a9f5d 100644
--- a/engines/titanic/game/bottom_of_well_monitor.h
+++ b/engines/titanic/game/bottom_of_well_monitor.h
@@ -29,6 +29,7 @@ namespace Titanic {
 
 class CBottomOfWellMonitor : public CGameObject {
 public:
+	static int _v1, _v2;
 	int _value;
 public:
 	CBottomOfWellMonitor() : _value(1) {}
diff --git a/engines/titanic/game/brain_slot.cpp b/engines/titanic/game/brain_slot.cpp
index f8a029e..f655a96 100644
--- a/engines/titanic/game/brain_slot.cpp
+++ b/engines/titanic/game/brain_slot.cpp
@@ -30,7 +30,7 @@ int CBrainSlot::_v2;
 void CBrainSlot::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value1, indent);
-	file->writeNumberLine(_value2, indent);
+	file->writeQuotedLine(_value2, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
 
@@ -40,7 +40,7 @@ void CBrainSlot::save(SimpleFile *file, int indent) const {
 void CBrainSlot::load(SimpleFile *file) {
 	file->readNumber();
 	_value1 = file->readNumber();
-	_value2 = file->readNumber();
+	_value2 = file->readString();
 	_v1 = file->readNumber();
 	_v2 = file->readNumber();
 
diff --git a/engines/titanic/game/brain_slot.h b/engines/titanic/game/brain_slot.h
index 982541f..fa197a8 100644
--- a/engines/titanic/game/brain_slot.h
+++ b/engines/titanic/game/brain_slot.h
@@ -31,9 +31,10 @@ class CBrainSlot : public CGameObject {
 public:
 	static int _v1, _v2;
 public:
-	int _value1, _value2;
+	int _value1;
+	CString _value2;
 public:
-	CBrainSlot() : CGameObject(), _value1(0), _value2(0) {}
+	CBrainSlot() : CGameObject(), _value1(0) {}
 
 	/**
 	 * Return the class name
diff --git a/engines/titanic/game/code_wheel.cpp b/engines/titanic/game/code_wheel.cpp
new file mode 100644
index 0000000..a10a70c
--- /dev/null
+++ b/engines/titanic/game/code_wheel.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/code_wheel.h"
+
+namespace Titanic {
+
+CodeWheel::CodeWheel() : CBomb(), _field108(0), _field10C(4), _field110(0) {
+}
+
+void CodeWheel::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field108, indent);
+	file->writeNumberLine(_field10C, indent);
+	file->writeNumberLine(_field110, indent);
+
+	CBomb::save(file, indent);
+}
+
+void CodeWheel::load(SimpleFile *file) {
+	file->readNumber();
+	_field108 = file->readNumber();
+	_field10C = file->readNumber();
+	_field110 = file->readNumber();
+
+	CBomb::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/code_wheel.h b/engines/titanic/game/code_wheel.h
new file mode 100644
index 0000000..7087982
--- /dev/null
+++ b/engines/titanic/game/code_wheel.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CODE_WHEEL_H
+#define TITANIC_CODE_WHEEL_H
+
+#include "titanic/game/bomb.h"
+
+namespace Titanic {
+
+class CodeWheel : public CBomb {
+private:
+	int _field108;
+	int _field10C;
+	int _field110;
+public:
+	CodeWheel();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CodeWheel"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CODE_WHEEL_H */
diff --git a/engines/titanic/game/head_slot.cpp b/engines/titanic/game/head_slot.cpp
index c037238..4cb15cc 100644
--- a/engines/titanic/game/head_slot.cpp
+++ b/engines/titanic/game/head_slot.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+int CHeadSlot::_v1;
+
 CHeadSlot::CHeadSlot() : CGameObject(), _string1("NotWorking"), _string2("NULL"),
 	_fieldBC(0), _fieldD8(0), _fieldDC(27), _fieldE0(56),
 	_fieldE4(82), _fieldE8(112), _fieldEC(0) {
diff --git a/engines/titanic/game/missiveomat_button.cpp b/engines/titanic/game/missiveomat_button.cpp
new file mode 100644
index 0000000..8f0918a
--- /dev/null
+++ b/engines/titanic/game/missiveomat_button.cpp
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/missiveomat_button.h"
+
+namespace Titanic {
+
+void CMissiveOMatButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldFC, indent);
+
+	CEditControl::save(file, indent);
+}
+
+void CMissiveOMatButton::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldFC = file->readNumber();
+
+	CEditControl::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/missiveomat_button.h b/engines/titanic/game/missiveomat_button.h
new file mode 100644
index 0000000..f383e88
--- /dev/null
+++ b/engines/titanic/game/missiveomat_button.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MISSIVEOMAT_BUTTON_H
+#define TITANIC_MISSIVEOMAT_BUTTON_H
+
+#include "titanic/gfx/edit_control.h"
+
+namespace Titanic {
+
+class CMissiveOMatButton : public CEditControl {
+public:
+	int _fieldFC;
+public:
+	CMissiveOMatButton() : CEditControl(), _fieldFC(2) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMissiveOMatButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MISSIVEOMAT_BUTTON_H */
diff --git a/engines/titanic/game/ship_setting_button.cpp b/engines/titanic/game/ship_setting_button.cpp
index c1318b1..95507f3 100644
--- a/engines/titanic/game/ship_setting_button.cpp
+++ b/engines/titanic/game/ship_setting_button.cpp
@@ -24,13 +24,24 @@
 
 namespace Titanic {
 
+CShipSettingButton::CShipSettingButton() : CGameObject(), _fieldC8(0), _fieldCC(0) {
+}
+
 void CShipSettingButton::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+
 	CGameObject::save(file, indent);
 }
 
 void CShipSettingButton::load(SimpleFile *file) {
 	file->readNumber();
+	_string1 = file->readString();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/ship_setting_button.h b/engines/titanic/game/ship_setting_button.h
index 008ab78..fb8d533 100644
--- a/engines/titanic/game/ship_setting_button.h
+++ b/engines/titanic/game/ship_setting_button.h
@@ -28,7 +28,13 @@
 namespace Titanic {
 
 class CShipSettingButton : public CGameObject {
+private:
+	CString _string1;
+	int _fieldC8;
+	int _fieldCC;
 public:
+	CShipSettingButton();
+
 	/**
 	 * Return the class name
 	 */
diff --git a/engines/titanic/gfx/edit_control.cpp b/engines/titanic/gfx/edit_control.cpp
new file mode 100644
index 0000000..17a56d6
--- /dev/null
+++ b/engines/titanic/gfx/edit_control.cpp
@@ -0,0 +1,72 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/edit_control.h"
+
+namespace Titanic {
+
+CEditControl::CEditControl() : CGameObject(), _fieldBC(0),  _fieldC0(0),
+		_fieldC4(0), _fieldC8(0), _fieldCC(0), _fieldD0(0), _fieldD4(2),
+		_fieldD8(0), _fieldDC(0), _fieldE0(0), _fieldF0(0), _fieldF4(0)
+
+{
+}
+
+void CEditControl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeNumberLine(_fieldD0, indent);
+	file->writeNumberLine(_fieldD4, indent);
+	file->writeNumberLine(_fieldD8, indent);
+	file->writeNumberLine(_fieldDC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_fieldF4, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CEditControl::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+	_fieldD0 = file->readNumber();
+	_fieldD4 = file->readNumber();
+	_fieldD8 = file->readNumber();
+	_fieldDC = file->readNumber();
+	_fieldE0 = file->readNumber();
+	_string1 = file->readString();
+	_fieldF0 = file->readNumber();
+	_fieldF4 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/edit_control.h b/engines/titanic/gfx/edit_control.h
new file mode 100644
index 0000000..79b20f7
--- /dev/null
+++ b/engines/titanic/gfx/edit_control.h
@@ -0,0 +1,66 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EDIT_CONTROL_H
+#define TITANIC_EDIT_CONTROL_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CEditControl : public CGameObject {
+protected:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	int _fieldCC;
+	int _fieldD0;
+	int _fieldD4;
+	int _fieldD8;
+	int _fieldDC;
+	int _fieldE0;
+	CString _string1;
+	int _fieldF0;
+	int _fieldF4;
+public:
+	CEditControl();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CEditControl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EDIT_CONTROL_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 0a236d9..86ddafd 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -86,6 +86,7 @@ MODULE_OBJS := \
 	game/bar_bell.o \
 	game/belbot_get_light.o \
 	game/bottom_of_well_monitor.o \
+	game/bomb.o \
 	game/bowl_unlocker.o \
 	game/brain_slot.o \
 	game/bridge_door.o \
@@ -103,6 +104,7 @@ MODULE_OBJS := \
 	game/chicken_cooler.o \
 	game/chicken_dispensor.o \
 	game/close_broken_pel.o \
+	game/code_wheel.o \
 	game/cookie.o \
 	game/computer.o \
 	game/computer_screen.o \
@@ -150,6 +152,7 @@ MODULE_OBJS := \
 	game/mail_man.o \
 	game/maitred_arm_holder.o \
 	game/missiveomat.o \
+	game/missiveomat_button.o \
 	game/movie_tester.o \
 	game/music_console_button.o \
 	game/music_room_phonograph.o \
@@ -270,6 +273,7 @@ MODULE_OBJS := \
 	gfx/chev_right_on.o \
 	gfx/chev_send_rec_switch.o \
 	gfx/chev_switch.o \
+	gfx/edit_control.o \
 	gfx/elevator_button.o \
 	gfx/get_from_succ.o \
 	gfx/helmet_on_off.o \


Commit: 5dce31417cd257785b9bbc790a9686e64a4aff37
    https://github.com/scummvm/scummvm/commit/5dce31417cd257785b9bbc790a9686e64a4aff37
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-02T19:21:31-05:00

Commit Message:
TITANIC: More saveable classes implemented

Changed paths:
  A engines/titanic/game/bilge_succubus.cpp
  A engines/titanic/game/bilge_succubus.h
  A engines/titanic/game/nav_helmet.cpp
  A engines/titanic/game/nav_helmet.h
  A engines/titanic/game/useless_lever.cpp
  A engines/titanic/game/useless_lever.h
  A engines/titanic/game/wheel_spin_horn.cpp
  A engines/titanic/game/wheel_spin_horn.h
  A engines/titanic/gfx/toggle_button.cpp
  A engines/titanic/gfx/toggle_button.h
  A engines/titanic/sound/auto_sound_event.cpp
  A engines/titanic/sound/auto_sound_event.h
  A engines/titanic/sound/bilge_auto_sound_event.cpp
  A engines/titanic/sound/bilge_auto_sound_event.h
  A engines/titanic/sound/door_auto_sound_event.cpp
  A engines/titanic/sound/door_auto_sound_event.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/service_elevator_door.h
    engines/titanic/messages/messages.cpp
    engines/titanic/messages/messages.h
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index a29bde6..84f0887 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -85,6 +85,7 @@
 #include "titanic/game/bar_menu.h"
 #include "titanic/game/bar_menu_button.h"
 #include "titanic/game/belbot_get_light.h"
+#include "titanic/game/bilge_succubus.h"
 #include "titanic/game/bomb.h"
 #include "titanic/game/bottom_of_well_monitor.h"
 #include "titanic/game/bowl_unlocker.h"
@@ -150,6 +151,8 @@
 #include "titanic/game/music_room_phonograph.h"
 #include "titanic/game/music_room_stop_phonograph_button.h"
 #include "titanic/game/music_system_lock.h"
+#include "titanic/game/nav_helmet.h"
+#include "titanic/game/navigation_computer.h"
 #include "titanic/game/no_nut_bowl.h"
 #include "titanic/game/nose_holder.h"
 #include "titanic/game/null_port_hole.h"
@@ -174,6 +177,7 @@
 #include "titanic/game/service_elevator_window.h"
 #include "titanic/game/ship_setting.h"
 #include "titanic/game/ship_setting_button.h"
+#include "titanic/game/show_cell_points.h"
 #include "titanic/game/speech_dispensor.h"
 #include "titanic/game/starling_puret.h"
 #include "titanic/game/start_action.h"
@@ -186,9 +190,11 @@
 #include "titanic/game/titania_still_control.h"
 #include "titanic/game/tow_parrot_nav.h"
 #include "titanic/game/up_lighter.h"
+#include "titanic/game/useless_lever.h"
 #include "titanic/game/wheel_button.h"
 #include "titanic/game/wheel_hotspot.h"
 #include "titanic/game/wheel_spin.h"
+#include "titanic/game/wheel_spin_horn.h"
 #include "titanic/game/parrot/parrot_lobby_controller.h"
 #include "titanic/game/parrot/parrot_lobby_link_updater.h"
 #include "titanic/game/parrot/parrot_lobby_object.h"
@@ -285,6 +291,7 @@
 #include "titanic/gfx/small_chev_right_on.h"
 #include "titanic/gfx/status_change_button.h"
 #include "titanic/gfx/st_button.h"
+#include "titanic/gfx/toggle_button.h"
 #include "titanic/gfx/toggle_switch.h"
 #include "titanic/gfx/volume_control.h"
 #include "titanic/messages/messages.h"
@@ -329,10 +336,13 @@
 
 #include "titanic/sound/auto_music_player.h"
 #include "titanic/sound/auto_music_player_base.h"
+#include "titanic/sound/auto_sound_event.h"
 #include "titanic/sound/auto_sound_player.h"
 #include "titanic/sound/auto_sound_player_adsr.h"
 #include "titanic/sound/background_sound_maker.h"
+#include "titanic/sound/bilge_auto_sound_event.h"
 #include "titanic/sound/bird_song.h"
+#include "titanic/sound/door_auto_sound_event.h"
 #include "titanic/sound/gondolier_song.h"
 #include "titanic/sound/enter_view_toggles_other_music.h"
 #include "titanic/sound/music_player.h"
@@ -419,6 +429,7 @@ DEFFN(CBarBell);
 DEFFN(CBarMenu);
 DEFFN(CBarMenuButton);
 DEFFN(CBelbotGetLight);
+DEFFN(CBilgeSuccUBus);
 DEFFN(CBomb);
 DEFFN(CBottomOfWellMonitor);
 DEFFN(CBowlUnlocker);
@@ -483,6 +494,8 @@ DEFFN(CMusicConsoleButton);
 DEFFN(CMusicRoomPhonograph);
 DEFFN(CMusicRoomStopPhonographButton);
 DEFFN(CMusicSystemLock);
+DEFFN(CNavHelmet);
+DEFFN(CNavigationComputer);
 DEFFN(CNoNutBowl);
 DEFFN(CNoseHolder);
 DEFFN(CNullPortHole);
@@ -507,6 +520,7 @@ DEFFN(CServiceElevatorDoor);
 DEFFN(CServiceElevatorWindow);
 DEFFN(CShipSetting);
 DEFFN(CShipSettingButton);
+DEFFN(CShowCellpoints);
 DEFFN(CSpeechDispensor);
 DEFFN(CStarlingPuret);
 DEFFN(CStartAction);
@@ -519,9 +533,11 @@ DEFFN(CThrowTVDownWell);
 DEFFN(CTitaniaStillControl);
 DEFFN(CTOWParrotNav);
 DEFFN(CUpLighter);
+DEFFN(CUselessLever);
 DEFFN(CWheelButton);
 DEFFN(CWheelHotSpot);
 DEFFN(CWheelSpin);
+DEFFN(CWheelSpinHorn);
 DEFFN(CParrotLobbyController);
 DEFFN(CParrotLobbyLinkUpdater);
 DEFFN(CParrotLobbyObject);
@@ -621,6 +637,8 @@ DEFFN(CSmallChevRightOff);
 DEFFN(CSmallChevRightOn);
 DEFFN(CStatusChangeButton);
 DEFFN(CSTButton);
+DEFFN(CToggleButton);
+DEFFN(CToggleSwitch);
 DEFFN(CVolumeControl);
 
 DEFFN(CActMsg);
@@ -629,7 +647,6 @@ DEFFN(CAddHeadPieceMsg);
 DEFFN(CAnimateMaitreDMsg);
 DEFFN(CArboretumGateMsg);
 DEFFN(CArmPickedUpFromTableMsg);
-DEFFN(CAutoSoundEvent);
 DEFFN(CBodyInBilgeRoomMsg);
 DEFFN(CBowlStateChange);
 DEFFN(CCarryObjectArrivedMsg);
@@ -649,7 +666,6 @@ DEFFN(CDisableMaitreDProdReceptor);
 DEFFN(CDismissBotMsg);
 DEFFN(CDoffNavHelmet);
 DEFFN(CDonNavHelmet);
-DEFFN(CDoorAutoSoundEvent);
 DEFFN(CDoorbotNeededInElevatorMsg);
 DEFFN(CDoorbotNeededInHomeMsg);
 DEFFN(CDropobjectMsg);
@@ -834,11 +850,14 @@ DEFFN(CSummonBots);
 DEFFN(CSuccUBus);
 DEFFN(CTitania);
 DEFFN(CAutoMusicPlayer);
+DEFFN(CAutoSoundEvent);
 DEFFN(CAutoMusicPlayerBase);
 DEFFN(CAutoSoundPlayer);
 DEFFN(CAutoSoundPlayerADSR);
 DEFFN(CBackgroundSoundMaker);
+DEFFN(CBilgeAutoSoundEvent);
 DEFFN(CBirdSong);
+DEFFN(CDoorAutoSoundEvent);
 DEFFN(CEnterViewTogglesOtherMusic);
 DEFFN(CGondolierSong);
 DEFFN(CMusicPlayer);
@@ -919,6 +938,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CBarMenu);
 	ADDFN(CBarMenuButton);
 	ADDFN(CBelbotGetLight);
+	ADDFN(CBilgeSuccUBus);
 	ADDFN(CBomb);
 	ADDFN(CBottomOfWellMonitor);
 	ADDFN(CBrainSlot);
@@ -984,6 +1004,8 @@ void CSaveableObject::initClassList() {
 	ADDFN(CMusicRoomPhonograph);
 	ADDFN(CMusicRoomStopPhonographButton);
 	ADDFN(CMusicSystemLock);
+	ADDFN(CNavHelmet);
+	ADDFN(CNavigationComputer);
 	ADDFN(CNoNutBowl);
 	ADDFN(CNoseHolder);
 	ADDFN(CNullPortHole);
@@ -1008,6 +1030,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CServiceElevatorWindow);
 	ADDFN(CShipSetting);
 	ADDFN(CShipSettingButton);
+	ADDFN(CShowCellpoints);
 	ADDFN(CSpeechDispensor);
 	ADDFN(CStarlingPuret);
 	ADDFN(CStartAction);
@@ -1020,9 +1043,11 @@ void CSaveableObject::initClassList() {
 	ADDFN(CTitaniaStillControl);
 	ADDFN(CTOWParrotNav);
 	ADDFN(CUpLighter);
+	ADDFN(CUselessLever);
 	ADDFN(CWheelButton);
 	ADDFN(CWheelHotSpot);
 	ADDFN(CWheelSpin);
+	ADDFN(CWheelSpinHorn);
 	ADDFN(CParrotLobbyController);
 	ADDFN(CParrotLobbyLinkUpdater);
 	ADDFN(CParrotLobbyObject);
@@ -1122,6 +1147,8 @@ void CSaveableObject::initClassList() {
 	ADDFN(CSmallChevRightOn);
 	ADDFN(CStatusChangeButton);
 	ADDFN(CSTButton);
+	ADDFN(CToggleButton);
+	ADDFN(CToggleSwitch);
 	ADDFN(CVolumeControl);
 
 	ADDFN(CActMsg);
@@ -1130,7 +1157,6 @@ void CSaveableObject::initClassList() {
 	ADDFN(CAnimateMaitreDMsg);
 	ADDFN(CArboretumGateMsg);
 	ADDFN(CArmPickedUpFromTableMsg);
-	ADDFN(CAutoSoundEvent);
 	ADDFN(CBodyInBilgeRoomMsg);
 	ADDFN(CBowlStateChange);
 	ADDFN(CCarryObjectArrivedMsg);
@@ -1150,7 +1176,6 @@ void CSaveableObject::initClassList() {
 	ADDFN(CDismissBotMsg);
 	ADDFN(CDoffNavHelmet);
 	ADDFN(CDonNavHelmet);
-	ADDFN(CDoorAutoSoundEvent);
 	ADDFN(CDoorbotNeededInElevatorMsg);
 	ADDFN(CDoorbotNeededInHomeMsg);
 	ADDFN(CDropobjectMsg);
@@ -1336,11 +1361,14 @@ void CSaveableObject::initClassList() {
 	ADDFN(CTitania);
 
 	ADDFN(CAutoMusicPlayer);
+	ADDFN(CAutoSoundEvent);
 	ADDFN(CAutoMusicPlayerBase);
 	ADDFN(CAutoSoundPlayer);
 	ADDFN(CAutoSoundPlayerADSR);
 	ADDFN(CBackgroundSoundMaker);
+	ADDFN(CBilgeAutoSoundEvent);
 	ADDFN(CBirdSong);
+	ADDFN(CDoorAutoSoundEvent);
 	ADDFN(CGondolierSong);
 	ADDFN(CEnterViewTogglesOtherMusic);
 	ADDFN(CGondolierSong);
diff --git a/engines/titanic/game/bilge_succubus.cpp b/engines/titanic/game/bilge_succubus.cpp
new file mode 100644
index 0000000..9c19d81
--- /dev/null
+++ b/engines/titanic/game/bilge_succubus.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/bilge_succubus.h"
+
+namespace Titanic {
+
+CBilgeSuccUBus::CBilgeSuccUBus() : CSuccUBus(), _field1DC(0),
+	_field1E0(0), _field1E4(0), _field1E8(0) {
+}
+
+void CBilgeSuccUBus::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field1DC, indent);
+	file->writeNumberLine(_field1E0, indent);
+	file->writeNumberLine(_field1E4, indent);
+	file->writeNumberLine(_field1E8, indent);
+
+	CSuccUBus::save(file, indent);
+}
+
+void CBilgeSuccUBus::load(SimpleFile *file) {
+	file->readNumber();
+	_field1DC = file->readNumber();
+	_field1E0 = file->readNumber();
+	_field1E4 = file->readNumber();
+	_field1E8 = file->readNumber();
+
+	CSuccUBus::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/bilge_succubus.h b/engines/titanic/game/bilge_succubus.h
new file mode 100644
index 0000000..795fe86
--- /dev/null
+++ b/engines/titanic/game/bilge_succubus.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BILGE_SUCCUBUS_H
+#define TITANIC_BILGE_SUCCUBUS_H
+
+#include "titanic/npcs/succubus.h"
+
+namespace Titanic {
+
+class CBilgeSuccUBus : public CSuccUBus {
+public:
+	int _field1DC;
+	int _field1E0;
+	int _field1E4;
+	int _field1E8;
+public:
+	CBilgeSuccUBus();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBilgeSuccUBus"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BILGE_SUCCUBUS_H */
diff --git a/engines/titanic/game/nav_helmet.cpp b/engines/titanic/game/nav_helmet.cpp
new file mode 100644
index 0000000..c1dbb11
--- /dev/null
+++ b/engines/titanic/game/nav_helmet.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/nav_helmet.h"
+
+namespace Titanic {
+
+void CNavHelmet::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CNavHelmet::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/nav_helmet.h b/engines/titanic/game/nav_helmet.h
new file mode 100644
index 0000000..31eee99
--- /dev/null
+++ b/engines/titanic/game/nav_helmet.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_NAV_HELMET_H
+#define TITANIC_NAV_HELMET_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CNavHelmet : public CGameObject {
+private:
+	int _value;
+public:
+	CNavHelmet() : CGameObject(), _value(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNavHelmet"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_NAV_HELMET_H */
diff --git a/engines/titanic/game/service_elevator_door.h b/engines/titanic/game/service_elevator_door.h
index 616601d..52465d8 100644
--- a/engines/titanic/game/service_elevator_door.h
+++ b/engines/titanic/game/service_elevator_door.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_SERVICE_ELEVATOR_DOOR_H
 #define TITANIC_SERVICE_ELEVATOR_DOOR_H
 
-#include "titanic/messages/messages.h"
+#include "titanic/sound/door_auto_sound_event.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/game/useless_lever.cpp b/engines/titanic/game/useless_lever.cpp
new file mode 100644
index 0000000..afc025b
--- /dev/null
+++ b/engines/titanic/game/useless_lever.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/useless_lever.h"
+
+namespace Titanic {
+
+void CUselessLever::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleButton::save(file, indent);
+}
+
+void CUselessLever::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleButton::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/useless_lever.h b/engines/titanic/game/useless_lever.h
new file mode 100644
index 0000000..444df0c
--- /dev/null
+++ b/engines/titanic/game/useless_lever.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_USELESS_LEVER_H
+#define TITANIC_USELESS_LEVER_H
+
+#include "titanic/gfx/toggle_button.h"
+
+namespace Titanic {
+
+class CUselessLever : public CToggleButton {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CUselessLever"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_UP_LIGHTER_H */
diff --git a/engines/titanic/game/wheel_spin_horn.cpp b/engines/titanic/game/wheel_spin_horn.cpp
new file mode 100644
index 0000000..3bc705d
--- /dev/null
+++ b/engines/titanic/game/wheel_spin_horn.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/wheel_spin_horn.h"
+
+namespace Titanic {
+
+void CWheelSpinHorn::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	CWheelSpin::save(file, indent);
+}
+
+void CWheelSpinHorn::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+
+	CWheelSpin::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/wheel_spin_horn.h b/engines/titanic/game/wheel_spin_horn.h
new file mode 100644
index 0000000..b96b20b
--- /dev/null
+++ b/engines/titanic/game/wheel_spin_horn.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_WHEEL_SPIN_HORN_H
+#define TITANIC_WHEEL_SPIN_HORN_H
+
+#include "titanic/game/wheel_spin.h"
+
+namespace Titanic {
+
+class CWheelSpinHorn : public CWheelSpin {
+public:
+	CString _string1;
+	CString _string2;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CWheelSpinHorn"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_WHEEL_SPIN_HORN_H */
diff --git a/engines/titanic/gfx/toggle_button.cpp b/engines/titanic/gfx/toggle_button.cpp
new file mode 100644
index 0000000..8284d35
--- /dev/null
+++ b/engines/titanic/gfx/toggle_button.cpp
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/toggle_button.h"
+
+namespace Titanic {
+
+void CToggleButton::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+
+	CBackground::save(file, indent);
+}
+
+void CToggleButton::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+
+	CBackground::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/toggle_button.h b/engines/titanic/gfx/toggle_button.h
new file mode 100644
index 0000000..b5113d7
--- /dev/null
+++ b/engines/titanic/gfx/toggle_button.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TOGGLE_BUTTON_H
+#define TITANIC_TOGGLE_BUTTON_H
+
+#include "titanic/core/background.h"
+
+namespace Titanic {
+
+class CToggleButton : public CBackground {
+private:
+	int _fieldE0;
+public:
+	CToggleButton() : CBackground(), _fieldE0(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CToggleButton"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TOGGLE_BUTTON_H */
diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
index f60ad12..c2a6197 100644
--- a/engines/titanic/messages/messages.cpp
+++ b/engines/titanic/messages/messages.cpp
@@ -37,51 +37,4 @@ void CMessage::load(SimpleFile *file) {
 	CSaveableObject::load(file);
 }
 
-/*------------------------------------------------------------------------*/
-
-CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _fieldBC(-1), _fieldC0(0xFFFFFF) {
-}
-
-void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-/*------------------------------------------------------------------------*/
-
-CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(),
-_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
-}
-
-void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeQuotedLine(_string2, indent);
-	file->writeNumberLine(_fieldDC, indent);
-	file->writeNumberLine(_fieldE0, indent);
-
-	CAutoSoundEvent::save(file, indent);
-}
-
-void CDoorAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_string1 = file->readString();
-	_string2 = file->readString();
-	_fieldDC = file->readNumber();
-	_fieldE0 = file->readNumber();
-
-	CAutoSoundEvent::load(file);
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index e9490a8..6b6695d 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -48,56 +48,6 @@ public:
 	virtual void load(SimpleFile *file);
 };
 
-class CAutoSoundEvent : public CGameObject {
-protected:
-	int _fieldBC;
-	int _fieldC0;
-public:
-	CAutoSoundEvent();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-
-class CDoorAutoSoundEvent : public CAutoSoundEvent {
-protected:
-	CString _string1;
-	CString _string2;
-	int _fieldDC;
-	int _fieldE0;
-public:
-	CDoorAutoSoundEvent();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-
 class CEditControlMsg : public CMessage {
 private:
 	int _field4;
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 86ddafd..975d5aa 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -80,6 +80,7 @@ MODULE_OBJS := \
 	game/arb_background.o \
 	game/arboretum_gate.o \
 	game/auto_animate.o \
+	game/bilge_succubus.o \
 	game/bomb.o \
 	game/bar_menu.o \
 	game/bar_menu_button.o \
@@ -159,6 +160,7 @@ MODULE_OBJS := \
 	game/music_room_stop_phonograph_button.o \
 	game/music_system_lock.o \
 	game/musical_instrument.o \
+	game/nav_helmet.o \
 	game/navigation_computer.o \
 	game/no_nut_bowl.o \
 	game/nose_holder.o \
@@ -204,9 +206,11 @@ MODULE_OBJS := \
 	game/throw_tv_down_well.o \
 	game/titania_still_control.o \
 	game/up_lighter.o \
+	game/useless_lever.o \
 	game/wheel_button.o \
 	game/wheel_hotspot.o \
 	game/wheel_spin.o \
+	game/wheel_spin_horn.o \
 	game/parrot/parrot_lobby_controller.o \
 	game/parrot/parrot_lobby_link_updater.o \
 	game/parrot/parrot_lobby_object.o \
@@ -297,10 +301,9 @@ MODULE_OBJS := \
 	gfx/small_chev_right_on.o \
 	gfx/status_change_button.o \
 	gfx/st_button.o \
+	gfx/toggle_button.o \
 	gfx/toggle_switch.o \
 	gfx/volume_control.o \
-	messages/auto_sound_event.o \
-	messages/door_auto_sound_event.o \
 	messages/messages.o \
 	moves/enter_bomb_room.o \
 	moves/enter_bridge.o \
@@ -341,10 +344,13 @@ MODULE_OBJS := \
 	npcs/true_talk_npc.o \
 	sound/auto_music_player.o \
 	sound/auto_music_player_base.o \
+	sound/auto_sound_event.o \
 	sound/auto_sound_player.o \
 	sound/auto_sound_player_adsr.o \
 	sound/background_sound_maker.o \
+	sound/bilge_auto_sound_event.o \
 	sound/bird_song.o \
+	sound/door_auto_sound_event.o \
 	sound/enter_view_toggles_other_music.o \
 	sound/gondolier_song.o \
 	sound/music_player.o \
diff --git a/engines/titanic/sound/auto_sound_event.cpp b/engines/titanic/sound/auto_sound_event.cpp
new file mode 100644
index 0000000..673f35b
--- /dev/null
+++ b/engines/titanic/sound/auto_sound_event.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/auto_sound_event.h"
+
+namespace Titanic {
+
+CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _value1(0), _value2(70) {
+}
+
+void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2  = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/auto_sound_event.h b/engines/titanic/sound/auto_sound_event.h
new file mode 100644
index 0000000..cb5bfee
--- /dev/null
+++ b/engines/titanic/sound/auto_sound_event.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_SOUND_EVENT_H
+#define TITANIC_AUTO_SOUND_EVENT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CAutoSoundEvent : public CGameObject {
+public:
+	int _value1;
+	int _value2;
+public:
+	CAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/sound/bilge_auto_sound_event.cpp b/engines/titanic/sound/bilge_auto_sound_event.cpp
new file mode 100644
index 0000000..2446a5d
--- /dev/null
+++ b/engines/titanic/sound/bilge_auto_sound_event.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/bilge_auto_sound_event.h"
+
+namespace Titanic {
+
+void CBilgeAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CAutoSoundEvent::save(file, indent);
+}
+
+void CBilgeAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	CAutoSoundEvent::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/bilge_auto_sound_event.h b/engines/titanic/sound/bilge_auto_sound_event.h
new file mode 100644
index 0000000..9657283
--- /dev/null
+++ b/engines/titanic/sound/bilge_auto_sound_event.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BILGE_AUTO_SOUND_EVENT_H
+#define TITANIC_BILGE_AUTO_SOUND_EVENT_H
+
+#include "titanic/sound/auto_sound_event.h"
+
+namespace Titanic {
+
+class CBilgeAutoSoundEvent : public CAutoSoundEvent {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBilgeAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BILGE_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/sound/door_auto_sound_event.cpp b/engines/titanic/sound/door_auto_sound_event.cpp
new file mode 100644
index 0000000..f0e77fc
--- /dev/null
+++ b/engines/titanic/sound/door_auto_sound_event.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/door_auto_sound_event.h"
+
+namespace Titanic {
+
+void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldDC, indent);
+	file->writeNumberLine(_fieldE0, indent);
+
+	CAutoSoundEvent::save(file, indent);
+}
+
+void CDoorAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_fieldDC = file->readNumber();
+	_fieldE0 = file->readNumber();
+
+	CAutoSoundEvent::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/door_auto_sound_event.h b/engines/titanic/sound/door_auto_sound_event.h
new file mode 100644
index 0000000..017912d
--- /dev/null
+++ b/engines/titanic/sound/door_auto_sound_event.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DOOR_AUTO_SOUND_EVENT_H
+#define TITANIC_DOOR_AUTO_SOUND_EVENT_H
+
+#include "titanic/sound/auto_sound_event.h"
+
+namespace Titanic {
+
+class CDoorAutoSoundEvent : public CAutoSoundEvent {
+public:
+	CString _string1;
+	CString _string2;
+	int _fieldDC;
+	int _fieldE0;
+public:
+	CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(),
+		_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
+	}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DOOR_AUTO_SOUND_EVENT_H */


Commit: 3ae4e63c80cda635f941370e72536988bde67698
    https://github.com/scummvm/scummvm/commit/3ae4e63c80cda635f941370e72536988bde67698
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-02T22:05:25-05:00

Commit Message:
TITANIC: Implemented more saveable classes

Changed paths:
  A engines/titanic/carry/maitred_left_arm.cpp
  A engines/titanic/carry/maitred_left_arm.h
  A engines/titanic/carry/maitred_right_arm.cpp
  A engines/titanic/carry/maitred_right_arm.h
  A engines/titanic/game/broken_pellerator.cpp
  A engines/titanic/game/broken_pellerator.h
  A engines/titanic/game/broken_pellerator_froz.cpp
  A engines/titanic/game/broken_pellerator_froz.h
  A engines/titanic/game/gondolier_mixer.cpp
  A engines/titanic/game/gondolier_mixer.h
  A engines/titanic/game/maitred/maitred_arm_holder.cpp
  A engines/titanic/game/maitred/maitred_arm_holder.h
  A engines/titanic/game/maitred/maitred_body.cpp
  A engines/titanic/game/maitred/maitred_body.h
  A engines/titanic/game/maitred/maitred_legs.cpp
  A engines/titanic/game/maitred/maitred_legs.h
  A engines/titanic/game/maitred/maitred_prod_receptor.cpp
  A engines/titanic/game/maitred/maitred_prod_receptor.h
  A engines/titanic/messages/auto_sound_event.cpp
  A engines/titanic/messages/auto_sound_event.h
  A engines/titanic/messages/bilge_auto_sound_event.cpp
  A engines/titanic/messages/bilge_auto_sound_event.h
  A engines/titanic/messages/bilge_dispensor_event.cpp
  A engines/titanic/messages/bilge_dispensor_event.h
  A engines/titanic/messages/door_auto_sound_event.cpp
  A engines/titanic/messages/door_auto_sound_event.h
  A engines/titanic/messages/service_elevator_door.cpp
  A engines/titanic/messages/service_elevator_door.h
  A engines/titanic/sound/dome_from_top_of_well.cpp
  A engines/titanic/sound/dome_from_top_of_well.h
  A engines/titanic/sound/season_noises.cpp
  A engines/titanic/sound/season_noises.h
  R engines/titanic/game/maitred_arm_holder.cpp
  R engines/titanic/game/maitred_arm_holder.h
  R engines/titanic/game/service_elevator_door.cpp
  R engines/titanic/game/service_elevator_door.h
  R engines/titanic/sound/auto_sound_event.cpp
  R engines/titanic/sound/auto_sound_event.h
  R engines/titanic/sound/bilge_auto_sound_event.cpp
  R engines/titanic/sound/bilge_auto_sound_event.h
  R engines/titanic/sound/door_auto_sound_event.cpp
  R engines/titanic/sound/door_auto_sound_event.h
    engines/titanic/carry/speech_centre.cpp
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/broken_pell_base.cpp
    engines/titanic/game/broken_pell_base.h
    engines/titanic/game/gondolier_base.cpp
    engines/titanic/game/gondolier_base.h
    engines/titanic/game/lemon_dispensor.cpp
    engines/titanic/game/lemon_dispensor.h
    engines/titanic/game/pickup/pick_up_hose.cpp
    engines/titanic/game/pickup/pick_up_hose.h
    engines/titanic/game/speech_dispensor.cpp
    engines/titanic/game/speech_dispensor.h
    engines/titanic/module.mk



diff --git a/engines/titanic/carry/maitred_left_arm.cpp b/engines/titanic/carry/maitred_left_arm.cpp
new file mode 100644
index 0000000..6fb93ec
--- /dev/null
+++ b/engines/titanic/carry/maitred_left_arm.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/maitred_left_arm.h"
+
+namespace Titanic {
+
+void CMaitreDLeftArm::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_field174, indent);
+	CArm::save(file, indent);
+}
+
+void CMaitreDLeftArm::load(SimpleFile *file) {
+	file->readNumber();
+	_field174 = file->readNumber();
+	CArm::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/maitred_left_arm.h b/engines/titanic/carry/maitred_left_arm.h
new file mode 100644
index 0000000..f6cf698
--- /dev/null
+++ b/engines/titanic/carry/maitred_left_arm.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LEFT_ARM_H
+#define TITANIC_LEFT_ARM_H
+
+#include "titanic/carry/arm.h"
+
+namespace Titanic {
+
+class CMaitreDLeftArm : public CArm {
+private:
+	int _field174;
+public:
+	CMaitreDLeftArm() : CArm(), _field174(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMaitreDLeftArm"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LEFT_ARM_H */
diff --git a/engines/titanic/carry/maitred_right_arm.cpp b/engines/titanic/carry/maitred_right_arm.cpp
new file mode 100644
index 0000000..15767a2
--- /dev/null
+++ b/engines/titanic/carry/maitred_right_arm.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/carry/maitred_right_arm.h"
+
+namespace Titanic {
+
+void CMaitreDRightArm::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CArm::save(file, indent);
+}
+
+void CMaitreDRightArm::load(SimpleFile *file) {
+	file->readNumber();
+	CArm::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/maitred_right_arm.h b/engines/titanic/carry/maitred_right_arm.h
new file mode 100644
index 0000000..a4a4489
--- /dev/null
+++ b/engines/titanic/carry/maitred_right_arm.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MAITRED_RIGHT_ARM_H
+#define TITANIC_MAITRED_RIGHT_ARM_H
+
+#include "titanic/carry/arm.h"
+
+namespace Titanic {
+
+class CMaitreDRightArm : public CArm {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMaitreDRightArm"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MAITRED_RIGHT_ARM_H */
diff --git a/engines/titanic/carry/speech_centre.cpp b/engines/titanic/carry/speech_centre.cpp
index c5875bd..86ed730 100644
--- a/engines/titanic/carry/speech_centre.cpp
+++ b/engines/titanic/carry/speech_centre.cpp
@@ -30,7 +30,7 @@ void CSpeechCentre::save(SimpleFile *file, int indent) const {
 	file->writeQuotedLine(_string1, indent);
 	file->writeNumberLine(_field14C, indent);
 
-	CCarry::save(file, indent);
+	CBrain::save(file, indent);
 }
 
 void CSpeechCentre::load(SimpleFile *file) {
@@ -39,7 +39,7 @@ void CSpeechCentre::load(SimpleFile *file) {
 	_string1 = file->readString();
 	_field14C = file->readNumber();
 
-	CCarry::load(file);
+	CBrain::load(file);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 84f0887..7a41230 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -42,6 +42,8 @@
 #include "titanic/carry/liftbot_head.h"
 #include "titanic/carry/long_stick.h"
 #include "titanic/carry/magazine.h"
+#include "titanic/carry/maitred_left_arm.h"
+#include "titanic/carry/maitred_right_arm.h"
 #include "titanic/carry/mouth.h"
 #include "titanic/carry/napkin.h"
 #include "titanic/carry/nose.h"
@@ -92,6 +94,8 @@
 #include "titanic/game/brain_slot.h"
 #include "titanic/game/bridge_view.h"
 #include "titanic/game/broken_pell_base.h"
+#include "titanic/game/broken_pellerator.h"
+#include "titanic/game/broken_pellerator_froz.h"
 #include "titanic/game/cage.h"
 #include "titanic/game/call_pellerator.h"
 #include "titanic/game/captains_wheel.h"
@@ -131,6 +135,8 @@
 #include "titanic/game/games_console.h"
 #include "titanic/game/get_lift_eye2.h"
 #include "titanic/game/glass_smasher.h"
+#include "titanic/game/gondolier_base.h"
+#include "titanic/game/gondolier_mixer.h"
 #include "titanic/game/hammer_clip.h"
 #include "titanic/game/hammer_dispensor.h"
 #include "titanic/game/hammer_dispensor_button.h"
@@ -143,7 +149,6 @@
 #include "titanic/game/light_switch.h"
 #include "titanic/game/little_lift_button.h"
 #include "titanic/game/long_stick_dispenser.h"
-#include "titanic/game/maitred_arm_holder.h"
 #include "titanic/game/missiveomat.h"
 #include "titanic/game/missiveomat_button.h"
 #include "titanic/game/musical_instrument.h"
@@ -166,14 +171,15 @@
 #include "titanic/game/port_hole.h"
 #include "titanic/game/record_phonograph_button.h"
 #include "titanic/game/replacement_ear.h"
+#include "titanic/game/reserved_table.h"
 #include "titanic/game/restaurant_cylinder_holder.h"
 #include "titanic/game/restaurant_phonograph.h"
 #include "titanic/game/room_item.h"
 #include "titanic/game/sauce_dispensor.h"
+#include "titanic/game/search_point.h"
 #include "titanic/game/season_background.h"
 #include "titanic/game/season_barrel.h"
 #include "titanic/game/seasonal_adjustment.h"
-#include "titanic/game/service_elevator_door.h"
 #include "titanic/game/service_elevator_window.h"
 #include "titanic/game/ship_setting.h"
 #include "titanic/game/ship_setting_button.h"
@@ -195,6 +201,10 @@
 #include "titanic/game/wheel_hotspot.h"
 #include "titanic/game/wheel_spin.h"
 #include "titanic/game/wheel_spin_horn.h"
+#include "titanic/game/maitred/maitred_arm_holder.h"
+#include "titanic/game/maitred/maitred_body.h"
+#include "titanic/game/maitred/maitred_legs.h"
+#include "titanic/game/maitred/maitred_prod_receptor.h"
 #include "titanic/game/parrot/parrot_lobby_controller.h"
 #include "titanic/game/parrot/parrot_lobby_link_updater.h"
 #include "titanic/game/parrot/parrot_lobby_object.h"
@@ -294,9 +304,15 @@
 #include "titanic/gfx/toggle_button.h"
 #include "titanic/gfx/toggle_switch.h"
 #include "titanic/gfx/volume_control.h"
+
 #include "titanic/messages/messages.h"
+#include "titanic/messages/auto_sound_event.h"
+#include "titanic/messages/bilge_auto_sound_event.h"
+#include "titanic/messages/bilge_dispensor_event.h"
+#include "titanic/messages/door_auto_sound_event.h"
 #include "titanic/messages/mouse_messages.h"
 #include "titanic/messages/pet_messages.h"
+#include "titanic/messages/service_elevator_door.h"
 
 #include "titanic/moves/enter_bomb_room.h"
 #include "titanic/moves/enter_bridge.h"
@@ -336,19 +352,17 @@
 
 #include "titanic/sound/auto_music_player.h"
 #include "titanic/sound/auto_music_player_base.h"
-#include "titanic/sound/auto_sound_event.h"
 #include "titanic/sound/auto_sound_player.h"
 #include "titanic/sound/auto_sound_player_adsr.h"
 #include "titanic/sound/background_sound_maker.h"
-#include "titanic/sound/bilge_auto_sound_event.h"
 #include "titanic/sound/bird_song.h"
-#include "titanic/sound/door_auto_sound_event.h"
 #include "titanic/sound/gondolier_song.h"
 #include "titanic/sound/enter_view_toggles_other_music.h"
 #include "titanic/sound/music_player.h"
 #include "titanic/sound/node_auto_sound_player.h"
 #include "titanic/sound/restricted_auto_music_player.h"
 #include "titanic/sound/room_auto_sound_player.h"
+#include "titanic/sound/season_noises.h"
 #include "titanic/sound/seasonal_music_player.h"
 #include "titanic/sound/titania_speech.h"
 #include "titanic/sound/trigger_auto_music_player.h"
@@ -387,6 +401,8 @@ DEFFN(CKey);
 DEFFN(CLiftbotHead);
 DEFFN(CLongStick);
 DEFFN(CMagazine);
+DEFFN(CMaitreDLeftArm);
+DEFFN(CMaitreDRightArm);
 DEFFN(CMouth);
 DEFFN(CNapkin);
 DEFFN(CNose);
@@ -436,6 +452,8 @@ DEFFN(CBowlUnlocker);
 DEFFN(CBrainSlot);
 DEFFN(CBridgeView);
 DEFFN(CBrokenPellBase)
+DEFFN(CBrokenPellerator);
+DEFFN(CBrokenPelleratorFroz);
 DEFFN(CCage);
 DEFFN(CCallPellerator);
 DEFFN(CCaptainsWheel);
@@ -474,6 +492,8 @@ DEFFN(CFloorIndicator);
 DEFFN(CGamesConsole);
 DEFFN(CGetLiftEye2);
 DEFFN(CGlassSmasher);
+DEFFN(CGondolierBase);
+DEFFN(CGondolierMixer);
 DEFFN(CHammerClip);
 DEFFN(CHammerDispensor);
 DEFFN(CHammerDispensorButton);
@@ -486,7 +506,6 @@ DEFFN(CLight);
 DEFFN(CLightSwitch);
 DEFFN(CLittleLiftButton);
 DEFFN(CLongStickDispenser);
-DEFFN(CMaitreDArmHolder);
 DEFFN(CMissiveOMat);
 DEFFN(CMissiveOMatButton);
 DEFFN(CMusicalInstrument);
@@ -509,14 +528,15 @@ DEFFN(CPlayOnAct);
 DEFFN(CPortHole);
 DEFFN(CRecordPhonographButton);
 DEFFN(CReplacementEar);
+DEFFN(CReservedTable);
 DEFFN(CRestaurantCylinderHolder);
 DEFFN(CRestaurantPhonograph);
 DEFFN(CRoomItem);
 DEFFN(CSauceDispensor);
+DEFFN(CSearchPoint);
 DEFFN(CSeasonBackground);
 DEFFN(CSeasonBarrel);
 DEFFN(CSeasonalAdjustment);
-DEFFN(CServiceElevatorDoor);
 DEFFN(CServiceElevatorWindow);
 DEFFN(CShipSetting);
 DEFFN(CShipSettingButton);
@@ -538,6 +558,10 @@ DEFFN(CWheelButton);
 DEFFN(CWheelHotSpot);
 DEFFN(CWheelSpin);
 DEFFN(CWheelSpinHorn);
+DEFFN(CMaitreDArmHolder);
+DEFFN(CMaitreDBody);
+DEFFN(CMaitreDLegs);
+DEFFN(CMaitreDProdReceptor);
 DEFFN(CParrotLobbyController);
 DEFFN(CParrotLobbyLinkUpdater);
 DEFFN(CParrotLobbyObject);
@@ -647,6 +671,9 @@ DEFFN(CAddHeadPieceMsg);
 DEFFN(CAnimateMaitreDMsg);
 DEFFN(CArboretumGateMsg);
 DEFFN(CArmPickedUpFromTableMsg);
+DEFFN(CAutoSoundEvent);
+DEFFN(CBilgeAutoSoundEvent);
+DEFFN(CBilgeDispensorEvent);
 DEFFN(CBodyInBilgeRoomMsg);
 DEFFN(CBowlStateChange);
 DEFFN(CCarryObjectArrivedMsg);
@@ -666,6 +693,7 @@ DEFFN(CDisableMaitreDProdReceptor);
 DEFFN(CDismissBotMsg);
 DEFFN(CDoffNavHelmet);
 DEFFN(CDonNavHelmet);
+DEFFN(CDoorAutoSoundEvent);
 DEFFN(CDoorbotNeededInElevatorMsg);
 DEFFN(CDoorbotNeededInHomeMsg);
 DEFFN(CDropobjectMsg);
@@ -761,6 +789,7 @@ DEFFN(CReplaceBowlAndNutsMsg);
 DEFFN(CRestaurantMusicChanged);
 DEFFN(CSendCCarryMsg);
 DEFFN(CSenseWorkingMsg);
+DEFFN(CServiceElevatorDoor);
 DEFFN(CServiceElevatorFloorChangeMsg);
 DEFFN(CServiceElevatorFloorRequestMsg);
 DEFFN(CServiceElevatorMsg);
@@ -850,20 +879,18 @@ DEFFN(CSummonBots);
 DEFFN(CSuccUBus);
 DEFFN(CTitania);
 DEFFN(CAutoMusicPlayer);
-DEFFN(CAutoSoundEvent);
 DEFFN(CAutoMusicPlayerBase);
 DEFFN(CAutoSoundPlayer);
 DEFFN(CAutoSoundPlayerADSR);
 DEFFN(CBackgroundSoundMaker);
-DEFFN(CBilgeAutoSoundEvent);
 DEFFN(CBirdSong);
-DEFFN(CDoorAutoSoundEvent);
 DEFFN(CEnterViewTogglesOtherMusic);
 DEFFN(CGondolierSong);
 DEFFN(CMusicPlayer);
 DEFFN(CNodeAutoSoundPlayer);
 DEFFN(CRestrictedAutoMusicPlayer);
 DEFFN(CRoomAutoSoundPlayer);
+DEFFN(CSeasonNoises);
 DEFFN(CSeasonalMusicPlayer);
 DEFFN(CTitaniaSpeech);
 DEFFN(CTriggerAutoMusicPlayer);
@@ -896,6 +923,8 @@ void CSaveableObject::initClassList() {
 	ADDFN(CLiftbotHead);
 	ADDFN(CLongStick);
 	ADDFN(CMagazine);
+	ADDFN(CMaitreDLeftArm);
+	ADDFN(CMaitreDRightArm);
 	ADDFN(CMouth);
 	ADDFN(CNapkin);
 	ADDFN(CNose);
@@ -945,6 +974,8 @@ void CSaveableObject::initClassList() {
 	ADDFN(CBowlUnlocker);
 	ADDFN(CBridgeView);
 	ADDFN(CBrokenPellBase);
+	ADDFN(CBrokenPellerator);
+	ADDFN(CBrokenPelleratorFroz);
 	ADDFN(CCage);
 	ADDFN(CCallPellerator);
 	ADDFN(CCaptainsWheel);
@@ -984,6 +1015,8 @@ void CSaveableObject::initClassList() {
 	ADDFN(CGamesConsole);
 	ADDFN(CGetLiftEye2);
 	ADDFN(CGlassSmasher);
+	ADDFN(CGondolierBase);
+	ADDFN(CGondolierMixer);
 	ADDFN(CHammerClip);
 	ADDFN(CHammerDispensor);
 	ADDFN(CHammerDispensorButton);
@@ -996,7 +1029,6 @@ void CSaveableObject::initClassList() {
 	ADDFN(CLightSwitch);
 	ADDFN(CLittleLiftButton);
 	ADDFN(CLongStickDispenser);
-	ADDFN(CMaitreDArmHolder);
 	ADDFN(CMissiveOMat);
 	ADDFN(CMissiveOMatButton);
 	ADDFN(CMusicalInstrument);
@@ -1019,14 +1051,15 @@ void CSaveableObject::initClassList() {
 	ADDFN(CPortHole);
 	ADDFN(CRecordPhonographButton);
 	ADDFN(CReplacementEar);
+	ADDFN(CReservedTable);
 	ADDFN(CRestaurantCylinderHolder);
 	ADDFN(CRestaurantPhonograph);
 	ADDFN(CRoomItem);
 	ADDFN(CSauceDispensor);
+	ADDFN(CSearchPoint);
 	ADDFN(CSeasonBackground);
 	ADDFN(CSeasonBarrel);
 	ADDFN(CSeasonalAdjustment);
-	ADDFN(CServiceElevatorDoor);
 	ADDFN(CServiceElevatorWindow);
 	ADDFN(CShipSetting);
 	ADDFN(CShipSettingButton);
@@ -1048,6 +1081,10 @@ void CSaveableObject::initClassList() {
 	ADDFN(CWheelHotSpot);
 	ADDFN(CWheelSpin);
 	ADDFN(CWheelSpinHorn);
+	ADDFN(CMaitreDArmHolder);
+	ADDFN(CMaitreDBody);
+	ADDFN(CMaitreDLegs);
+	ADDFN(CMaitreDProdReceptor);
 	ADDFN(CParrotLobbyController);
 	ADDFN(CParrotLobbyLinkUpdater);
 	ADDFN(CParrotLobbyObject);
@@ -1271,6 +1308,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CRestaurantMusicChanged);
 	ADDFN(CSendCCarryMsg);
 	ADDFN(CSenseWorkingMsg);
+	ADDFN(CServiceElevatorDoor);
 	ADDFN(CServiceElevatorFloorChangeMsg);
 	ADDFN(CServiceElevatorFloorRequestMsg);
 	ADDFN(CServiceElevatorMsg);
@@ -1367,6 +1405,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CAutoSoundPlayerADSR);
 	ADDFN(CBackgroundSoundMaker);
 	ADDFN(CBilgeAutoSoundEvent);
+	ADDFN(CBilgeDispensorEvent);
 	ADDFN(CBirdSong);
 	ADDFN(CDoorAutoSoundEvent);
 	ADDFN(CGondolierSong);
@@ -1376,6 +1415,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CNodeAutoSoundPlayer);
 	ADDFN(CRestrictedAutoMusicPlayer);
 	ADDFN(CRoomAutoSoundPlayer);
+	ADDFN(CSeasonNoises);
 	ADDFN(CSeasonalMusicPlayer);
 	ADDFN(CAutoMusicPlayer);
 	ADDFN(CTitaniaSpeech);
diff --git a/engines/titanic/game/broken_pell_base.cpp b/engines/titanic/game/broken_pell_base.cpp
index 9e2a974..2d11e54 100644
--- a/engines/titanic/game/broken_pell_base.cpp
+++ b/engines/titanic/game/broken_pell_base.cpp
@@ -24,14 +24,21 @@
 
 namespace Titanic {
 
+int CBrokenPellBase::_v1;
+int CBrokenPellBase::_v2;
+
 void CBrokenPellBase::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	CBackground::save(file, indent);
 }
 
 void CBrokenPellBase::load(SimpleFile *file) {
 	file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
 	_fieldE0 = file->readNumber();
 	CBackground::load(file);
 }
diff --git a/engines/titanic/game/broken_pell_base.h b/engines/titanic/game/broken_pell_base.h
index fa53af3..8e77501 100644
--- a/engines/titanic/game/broken_pell_base.h
+++ b/engines/titanic/game/broken_pell_base.h
@@ -28,7 +28,10 @@
 namespace Titanic {
 
 class CBrokenPellBase : public CBackground {
-public:
+private:
+	static int _v1;
+	static int _v2;
+
 	int _fieldE0;
 public:
 	CBrokenPellBase() : CBackground(), _fieldE0(0) {}
diff --git a/engines/titanic/game/broken_pellerator.cpp b/engines/titanic/game/broken_pellerator.cpp
new file mode 100644
index 0000000..ea16767
--- /dev/null
+++ b/engines/titanic/game/broken_pellerator.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/broken_pellerator.h"
+
+namespace Titanic {
+
+void CBrokenPellerator::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeQuotedLine(_string4, indent);
+	file->writeQuotedLine(_string5, indent);
+
+	CBrokenPellBase::save(file, indent);
+}
+
+void CBrokenPellerator::load(SimpleFile *file) {
+	file->readNumber();
+	_string2 = file->readString();
+	_string3 = file->readString();
+	_string4 = file->readString();
+	_string5 = file->readString();
+
+	CBrokenPellBase::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/broken_pellerator.h b/engines/titanic/game/broken_pellerator.h
new file mode 100644
index 0000000..71bae32
--- /dev/null
+++ b/engines/titanic/game/broken_pellerator.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BROKEN_PELLERATOR_H
+#define TITANIC_BROKEN_PELLERATOR_H
+
+#include "titanic/game/broken_pell_base.h"
+
+namespace Titanic {
+
+class CBrokenPellerator : public CBrokenPellBase {
+private:
+	CString _string2;
+	CString _string3;
+	CString _string4;
+	CString _string5;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBrokenPellerator"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BROKEN_PELLERATOR_H */
diff --git a/engines/titanic/game/broken_pellerator_froz.cpp b/engines/titanic/game/broken_pellerator_froz.cpp
new file mode 100644
index 0000000..6b077d2
--- /dev/null
+++ b/engines/titanic/game/broken_pellerator_froz.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/broken_pellerator_froz.h"
+
+namespace Titanic {
+
+void CBrokenPelleratorFroz::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeQuotedLine(_string4, indent);
+	file->writeQuotedLine(_string5, indent);
+
+	CBrokenPellBase::save(file, indent);
+}
+
+void CBrokenPelleratorFroz::load(SimpleFile *file) {
+	file->readNumber();
+	_string2 = file->readString();
+	_string3 = file->readString();
+	_string4 = file->readString();
+	_string5 = file->readString();
+
+	CBrokenPellBase::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/broken_pellerator_froz.h b/engines/titanic/game/broken_pellerator_froz.h
new file mode 100644
index 0000000..1fded7c
--- /dev/null
+++ b/engines/titanic/game/broken_pellerator_froz.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BROKEN_PELLERATOR_FROZ_H
+#define TITANIC_BROKEN_PELLERATOR_FROZ_H
+
+#include "titanic/game/broken_pell_base.h"
+
+namespace Titanic {
+
+class CBrokenPelleratorFroz : public CBrokenPellBase {
+private:
+	CString _string2;
+	CString _string3;
+	CString _string4;
+	CString _string5;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBrokenPelleratorFroz"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BROKEN_PELLERATOR_FROZ_H */
diff --git a/engines/titanic/game/gondolier_base.cpp b/engines/titanic/game/gondolier_base.cpp
index 32f434e..59c9b5c 100644
--- a/engines/titanic/game/gondolier_base.cpp
+++ b/engines/titanic/game/gondolier_base.cpp
@@ -24,13 +24,46 @@
 
 namespace Titanic {
 
+int CGondolierBase::_v1;
+int CGondolierBase::_v2;
+int CGondolierBase::_v3;
+int CGondolierBase::_v4;
+int CGondolierBase::_v5;
+int CGondolierBase::_v6;
+int CGondolierBase::_v7;
+int CGondolierBase::_v8;
+int CGondolierBase::_v9;
+int CGondolierBase::_v10;
+
 void CGondolierBase::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+	file->writeNumberLine(_v3, indent);
+	file->writeNumberLine(_v4, indent);
+	file->writeNumberLine(_v5, indent);
+	file->writeNumberLine(_v6, indent);
+	file->writeNumberLine(_v7, indent);
+	file->writeNumberLine(_v8, indent);
+	file->writeNumberLine(_v9, indent);
+	file->writeNumberLine(_v10, indent);
+
 	CGameObject::save(file, indent);
 }
 
 void CGondolierBase::load(SimpleFile *file) {
 	file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+	_v3 = file->readNumber();
+	_v4 = file->readNumber();
+	_v5 = file->readNumber();
+	_v6 = file->readNumber();
+	_v7 = file->readNumber();
+	_v8 = file->readNumber();
+	_v9 = file->readNumber();
+	_v10 = file->readNumber();
+
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/gondolier_base.h b/engines/titanic/game/gondolier_base.h
index 99e0c995..3f0cede 100644
--- a/engines/titanic/game/gondolier_base.h
+++ b/engines/titanic/game/gondolier_base.h
@@ -28,6 +28,17 @@
 namespace Titanic {
 
 class CGondolierBase : public CGameObject {
+private:
+	static int _v1;
+	static int _v2;
+	static int _v3;
+	static int _v4;
+	static int _v5;
+	static int _v6;
+	static int _v7;
+	static int _v8;
+	static int _v9;
+	static int _v10;
 public:
 	/**
 	 * Return the class name
diff --git a/engines/titanic/game/gondolier_mixer.cpp b/engines/titanic/game/gondolier_mixer.cpp
new file mode 100644
index 0000000..33cc883
--- /dev/null
+++ b/engines/titanic/game/gondolier_mixer.cpp
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/gondolier_mixer.h"
+
+namespace Titanic {
+
+CGondolierMixer::CGondolierMixer() : CGondolierBase(),
+	_string1("c#0.wav"), _string2("c#1.wav"),
+	_fieldBC(-1), _fieldC0(-1), _fieldC4(0), _fieldC8(0),
+	_fieldE4(0) {
+}
+
+void CGondolierMixer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldE4, indent);
+
+	CGondolierBase::save(file, indent);
+}
+
+void CGondolierMixer::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_fieldE4 = file->readNumber();
+
+	CGondolierBase::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/gondolier_mixer.h b/engines/titanic/game/gondolier_mixer.h
new file mode 100644
index 0000000..dfc4621
--- /dev/null
+++ b/engines/titanic/game/gondolier_mixer.h
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GONDOLIER_MIXER_H
+#define TITANIC_GONDOLIER_MIXER_H
+
+#include "titanic/game/gondolier_base.h"
+
+namespace Titanic {
+
+class CGondolierMixer : public CGondolierBase {
+private:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	CString _string1;
+	CString _string2;
+	int _fieldE4;
+public:
+	CGondolierMixer();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGondolierMixer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GONDOLIER_MIXER_H */
diff --git a/engines/titanic/game/lemon_dispensor.cpp b/engines/titanic/game/lemon_dispensor.cpp
index 3cf7cc9..b13b6d8 100644
--- a/engines/titanic/game/lemon_dispensor.cpp
+++ b/engines/titanic/game/lemon_dispensor.cpp
@@ -24,12 +24,19 @@
 
 namespace Titanic {
 
+int CLemonDispensor::_v1;
+int CLemonDispensor::_v2;
+int CLemonDispensor::_v3;
+
 CLemonDispensor::CLemonDispensor() : CBackground(),
 	_fieldE0(0), _fieldE4(9), _fieldE8(15), _fieldEC(0) {
 }
 
 void CLemonDispensor::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+	file->writeNumberLine(_v3, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
 	file->writeNumberLine(_fieldE8, indent);
@@ -40,6 +47,9 @@ void CLemonDispensor::save(SimpleFile *file, int indent) const {
 
 void CLemonDispensor::load(SimpleFile *file) {
 	file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+	_v3 = file->readNumber();
 	_fieldE0 = file->readNumber();
 	_fieldE4 = file->readNumber();
 	_fieldE8 = file->readNumber();
diff --git a/engines/titanic/game/lemon_dispensor.h b/engines/titanic/game/lemon_dispensor.h
index 7f3164f..c2c76ea 100644
--- a/engines/titanic/game/lemon_dispensor.h
+++ b/engines/titanic/game/lemon_dispensor.h
@@ -28,7 +28,11 @@
 namespace Titanic {
 
 class CLemonDispensor : public CBackground {
-public:
+private:
+	static int _v1;
+	static int _v2;
+	static int _v3;
+
 	int _fieldE0;
 	int _fieldE4;
 	int _fieldE8;
diff --git a/engines/titanic/game/maitred/maitred_arm_holder.cpp b/engines/titanic/game/maitred/maitred_arm_holder.cpp
new file mode 100644
index 0000000..b6fc494
--- /dev/null
+++ b/engines/titanic/game/maitred/maitred_arm_holder.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/maitred/maitred_arm_holder.h"
+
+namespace Titanic {
+
+void CMaitreDArmHolder::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CDropTarget::save(file, indent);
+}
+
+void CMaitreDArmHolder::load(SimpleFile *file) {
+	file->readNumber();
+	CDropTarget::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/maitred/maitred_arm_holder.h b/engines/titanic/game/maitred/maitred_arm_holder.h
new file mode 100644
index 0000000..b838109
--- /dev/null
+++ b/engines/titanic/game/maitred/maitred_arm_holder.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MAITRED_ARM_HOLDER_H
+#define TITANIC_MAITRED_ARM_HOLDER_H
+
+#include "titanic/core/drop_target.h"
+
+namespace Titanic {
+
+class CMaitreDArmHolder : public CDropTarget {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMaitreDArmHolder"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MAITRED_ARM_HOLDER_H */
diff --git a/engines/titanic/game/maitred/maitred_body.cpp b/engines/titanic/game/maitred/maitred_body.cpp
new file mode 100644
index 0000000..4cdd589
--- /dev/null
+++ b/engines/titanic/game/maitred/maitred_body.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/maitred/maitred_legs.h"
+
+namespace Titanic {
+
+void CMaitreDLegs::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	CMaitreDProdReceptor::save(file, indent);
+}
+
+void CMaitreDLegs::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldC8 = file->readNumber();
+	CMaitreDProdReceptor::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/maitred/maitred_body.h b/engines/titanic/game/maitred/maitred_body.h
new file mode 100644
index 0000000..29e528b
--- /dev/null
+++ b/engines/titanic/game/maitred/maitred_body.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MAITRED_BODY_H
+#define TITANIC_MAITRED_BODY_H
+
+#include "titanic/game/maitred/maitred_prod_receptor.h"
+
+namespace Titanic {
+
+class CMaitreDBody : public CMaitreDProdReceptor {
+private:
+	int _fieldC8;
+public:
+	CMaitreDBody() : CMaitreDProdReceptor(), _fieldC8(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMaitreDBody"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MAITRED_BODY_H */
diff --git a/engines/titanic/game/maitred/maitred_legs.cpp b/engines/titanic/game/maitred/maitred_legs.cpp
new file mode 100644
index 0000000..ce7054e
--- /dev/null
+++ b/engines/titanic/game/maitred/maitred_legs.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/maitred/maitred_body.h"
+
+namespace Titanic {
+
+void CMaitreDBody::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	CMaitreDProdReceptor::save(file, indent);
+}
+
+void CMaitreDBody::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldC8 = file->readNumber();
+	CMaitreDProdReceptor::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/maitred/maitred_legs.h b/engines/titanic/game/maitred/maitred_legs.h
new file mode 100644
index 0000000..e3ac93c
--- /dev/null
+++ b/engines/titanic/game/maitred/maitred_legs.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MAITRED_LEGS_H
+#define TITANIC_MAITRED_LEGS_H
+
+#include "titanic/game/maitred/maitred_prod_receptor.h"
+
+namespace Titanic {
+
+class CMaitreDLegs : public CMaitreDProdReceptor {
+private:
+	int _fieldC8;
+public:
+	CMaitreDLegs() : CMaitreDProdReceptor(), _fieldC8(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMaitreDLegs"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MAITRED_LEGS_H */
diff --git a/engines/titanic/game/maitred/maitred_prod_receptor.cpp b/engines/titanic/game/maitred/maitred_prod_receptor.cpp
new file mode 100644
index 0000000..6e6143c
--- /dev/null
+++ b/engines/titanic/game/maitred/maitred_prod_receptor.cpp
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/maitred/maitred_prod_receptor.h"
+
+namespace Titanic {
+
+void CMaitreDProdReceptor::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CMaitreDProdReceptor::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/maitred/maitred_prod_receptor.h b/engines/titanic/game/maitred/maitred_prod_receptor.h
new file mode 100644
index 0000000..130bc54
--- /dev/null
+++ b/engines/titanic/game/maitred/maitred_prod_receptor.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MAITRED_PROD_RECEPTOR_H
+#define TITANIC_MAITRED_PROD_RECEPTOR_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CMaitreDProdReceptor : public CGameObject {
+protected:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+public:
+	CMaitreDProdReceptor() : CGameObject(),
+		_fieldBC(0), _fieldC0(0), _fieldC4(1) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CMaitreDProdReceptor"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MAITRED_PROD_RECEPTOR_H */
diff --git a/engines/titanic/game/maitred_arm_holder.cpp b/engines/titanic/game/maitred_arm_holder.cpp
deleted file mode 100644
index 81ad435..0000000
--- a/engines/titanic/game/maitred_arm_holder.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/maitred_arm_holder.h"
-
-namespace Titanic {
-
-void CMaitreDArmHolder::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CDropTarget::save(file, indent);
-}
-
-void CMaitreDArmHolder::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/maitred_arm_holder.h b/engines/titanic/game/maitred_arm_holder.h
deleted file mode 100644
index b838109..0000000
--- a/engines/titanic/game/maitred_arm_holder.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_MAITRED_ARM_HOLDER_H
-#define TITANIC_MAITRED_ARM_HOLDER_H
-
-#include "titanic/core/drop_target.h"
-
-namespace Titanic {
-
-class CMaitreDArmHolder : public CDropTarget {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMaitreDArmHolder"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_MAITRED_ARM_HOLDER_H */
diff --git a/engines/titanic/game/pickup/pick_up_hose.cpp b/engines/titanic/game/pickup/pick_up_hose.cpp
index 35ac7f8..e6902cb 100644
--- a/engines/titanic/game/pickup/pick_up_hose.cpp
+++ b/engines/titanic/game/pickup/pick_up_hose.cpp
@@ -24,15 +24,21 @@
 
 namespace Titanic {
 
+int CPickUpHose::_v1;
+
 void CPickUpHose::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_v1, indent);
+
 	CPickUp::save(file, indent);
 }
 
 void CPickUpHose::load(SimpleFile *file) {
 	file->readNumber();
 	_string1 = file->readString();
+	_v1 = file->readNumber();
+
 	CPickUp::load(file);
 }
 
diff --git a/engines/titanic/game/pickup/pick_up_hose.h b/engines/titanic/game/pickup/pick_up_hose.h
index 56596c5..13d5810 100644
--- a/engines/titanic/game/pickup/pick_up_hose.h
+++ b/engines/titanic/game/pickup/pick_up_hose.h
@@ -29,6 +29,8 @@ namespace Titanic {
 
 class CPickUpHose : public CPickUp {
 private:
+	static int _v1;
+
 	CString _string1;
 public:
 	/**
diff --git a/engines/titanic/game/service_elevator_door.cpp b/engines/titanic/game/service_elevator_door.cpp
deleted file mode 100644
index 717b61d..0000000
--- a/engines/titanic/game/service_elevator_door.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/service_elevator_door.h"
-
-namespace Titanic {
-
-CServiceElevatorDoor::CServiceElevatorDoor() : CDoorAutoSoundEvent() {
-	_string1 = "z#31.wav";
-	_string2 = "z#32.wav";
-}
-
-void CServiceElevatorDoor::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string2, indent);
-	file->writeQuotedLine(_string1, indent);
-
-	CDoorAutoSoundEvent::save(file, indent);
-}
-
-void CServiceElevatorDoor::load(SimpleFile *file) {
-	file->readNumber();
-	_string2 = file->readString();
-	_string1 = file->readString();
-
-	CDoorAutoSoundEvent::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/service_elevator_door.h b/engines/titanic/game/service_elevator_door.h
deleted file mode 100644
index 52465d8..0000000
--- a/engines/titanic/game/service_elevator_door.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_SERVICE_ELEVATOR_DOOR_H
-#define TITANIC_SERVICE_ELEVATOR_DOOR_H
-
-#include "titanic/sound/door_auto_sound_event.h"
-
-namespace Titanic {
-
-class CServiceElevatorDoor : public CDoorAutoSoundEvent {
-public:
-	CServiceElevatorDoor();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CServiceElevatorDoor"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_SERVICE_ELEVATOR_DOOR_H */
diff --git a/engines/titanic/game/speech_dispensor.cpp b/engines/titanic/game/speech_dispensor.cpp
index d8fc66b..7287339 100644
--- a/engines/titanic/game/speech_dispensor.cpp
+++ b/engines/titanic/game/speech_dispensor.cpp
@@ -26,11 +26,27 @@ namespace Titanic {
 
 void CSpeechDispensor::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_fieldF4, indent);
+	file->writeNumberLine(_fieldF8, indent);
+	file->writeNumberLine(_fieldFC, indent);
+
 	CBackground::save(file, indent);
 }
 
 void CSpeechDispensor::load(SimpleFile *file) {
 	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_fieldF0 = file->readNumber();
+	_fieldF4 = file->readNumber();
+	_fieldF8 = file->readNumber();
+	_fieldFC = file->readNumber();
+
 	CBackground::load(file);
 }
 
diff --git a/engines/titanic/game/speech_dispensor.h b/engines/titanic/game/speech_dispensor.h
index 857750d..19f31fc 100644
--- a/engines/titanic/game/speech_dispensor.h
+++ b/engines/titanic/game/speech_dispensor.h
@@ -28,6 +28,15 @@
 namespace Titanic {
 
 class CSpeechDispensor : public CBackground {
+private:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	int _fieldF0;
+	int _fieldF4;
+	int _fieldF8;
+	int _fieldFC;
 public:
 	/**
 	 * Return the class name
diff --git a/engines/titanic/messages/auto_sound_event.cpp b/engines/titanic/messages/auto_sound_event.cpp
new file mode 100644
index 0000000..006762c
--- /dev/null
+++ b/engines/titanic/messages/auto_sound_event.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/auto_sound_event.h"
+
+namespace Titanic {
+
+CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _value1(0), _value2(70) {
+}
+
+void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value1, indent);
+	file->writeNumberLine(_value2, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_value1 = file->readNumber();
+	_value2  = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/auto_sound_event.h b/engines/titanic/messages/auto_sound_event.h
new file mode 100644
index 0000000..cb5bfee
--- /dev/null
+++ b/engines/titanic/messages/auto_sound_event.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AUTO_SOUND_EVENT_H
+#define TITANIC_AUTO_SOUND_EVENT_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CAutoSoundEvent : public CGameObject {
+public:
+	int _value1;
+	int _value2;
+public:
+	CAutoSoundEvent();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/messages/bilge_auto_sound_event.cpp b/engines/titanic/messages/bilge_auto_sound_event.cpp
new file mode 100644
index 0000000..7bc91da
--- /dev/null
+++ b/engines/titanic/messages/bilge_auto_sound_event.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/bilge_auto_sound_event.h"
+
+namespace Titanic {
+
+void CBilgeAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CAutoSoundEvent::save(file, indent);
+}
+
+void CBilgeAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	CAutoSoundEvent::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/bilge_auto_sound_event.h b/engines/titanic/messages/bilge_auto_sound_event.h
new file mode 100644
index 0000000..94f38d3
--- /dev/null
+++ b/engines/titanic/messages/bilge_auto_sound_event.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BILGE_AUTO_SOUND_EVENT_H
+#define TITANIC_BILGE_AUTO_SOUND_EVENT_H
+
+#include "titanic/messages/auto_sound_event.h"
+
+namespace Titanic {
+
+class CBilgeAutoSoundEvent : public CAutoSoundEvent {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBilgeAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BILGE_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/messages/bilge_dispensor_event.cpp b/engines/titanic/messages/bilge_dispensor_event.cpp
new file mode 100644
index 0000000..9252d12
--- /dev/null
+++ b/engines/titanic/messages/bilge_dispensor_event.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/bilge_dispensor_event.h"
+
+namespace Titanic {
+
+void CBilgeDispensorEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CAutoSoundEvent::save(file, indent);
+}
+
+void CBilgeDispensorEvent::load(SimpleFile *file) {
+	file->readNumber();
+	CAutoSoundEvent::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/bilge_dispensor_event.h b/engines/titanic/messages/bilge_dispensor_event.h
new file mode 100644
index 0000000..8308d47
--- /dev/null
+++ b/engines/titanic/messages/bilge_dispensor_event.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BILGE_DISPENSOR_EVENT_H
+#define TITANIC_BILGE_DISPENSOR_EVENT_H
+
+#include "titanic/messages/auto_sound_event.h"
+
+namespace Titanic {
+
+class CBilgeDispensorEvent : public CAutoSoundEvent {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CBilgeDispensorEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BILGE_DISPENSOR_EVENT_H */
diff --git a/engines/titanic/messages/door_auto_sound_event.cpp b/engines/titanic/messages/door_auto_sound_event.cpp
new file mode 100644
index 0000000..ff9101f
--- /dev/null
+++ b/engines/titanic/messages/door_auto_sound_event.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/door_auto_sound_event.h"
+
+namespace Titanic {
+
+void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldDC, indent);
+	file->writeNumberLine(_fieldE0, indent);
+
+	CAutoSoundEvent::save(file, indent);
+}
+
+void CDoorAutoSoundEvent::load(SimpleFile *file) {
+	file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_fieldDC = file->readNumber();
+	_fieldE0 = file->readNumber();
+
+	CAutoSoundEvent::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/door_auto_sound_event.h b/engines/titanic/messages/door_auto_sound_event.h
new file mode 100644
index 0000000..ef41756
--- /dev/null
+++ b/engines/titanic/messages/door_auto_sound_event.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DOOR_AUTO_SOUND_EVENT_H
+#define TITANIC_DOOR_AUTO_SOUND_EVENT_H
+
+#include "titanic/messages/auto_sound_event.h"
+
+namespace Titanic {
+
+class CDoorAutoSoundEvent : public CAutoSoundEvent {
+public:
+	CString _string1;
+	CString _string2;
+	int _fieldDC;
+	int _fieldE0;
+public:
+	CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(),
+		_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
+	}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DOOR_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/messages/service_elevator_door.cpp b/engines/titanic/messages/service_elevator_door.cpp
new file mode 100644
index 0000000..e771f14
--- /dev/null
+++ b/engines/titanic/messages/service_elevator_door.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/service_elevator_door.h"
+
+namespace Titanic {
+
+CServiceElevatorDoor::CServiceElevatorDoor() : CDoorAutoSoundEvent() {
+	_string1 = "z#31.wav";
+	_string2 = "z#32.wav";
+}
+
+void CServiceElevatorDoor::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string1, indent);
+
+	CDoorAutoSoundEvent::save(file, indent);
+}
+
+void CServiceElevatorDoor::load(SimpleFile *file) {
+	file->readNumber();
+	_string2 = file->readString();
+	_string1 = file->readString();
+
+	CDoorAutoSoundEvent::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/service_elevator_door.h b/engines/titanic/messages/service_elevator_door.h
new file mode 100644
index 0000000..a3a8388
--- /dev/null
+++ b/engines/titanic/messages/service_elevator_door.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SERVICE_ELEVATOR_DOOR_H
+#define TITANIC_SERVICE_ELEVATOR_DOOR_H
+
+#include "titanic/messages/door_auto_sound_event.h"
+
+namespace Titanic {
+
+class CServiceElevatorDoor : public CDoorAutoSoundEvent {
+public:
+	CServiceElevatorDoor();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CServiceElevatorDoor"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SERVICE_ELEVATOR_DOOR_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 975d5aa..191b61b 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -38,6 +38,8 @@ MODULE_OBJS := \
 	carry/liftbot_head.o \
 	carry/long_stick.o \
 	carry/magazine.o \
+	carry/maitred_left_arm.o \
+	carry/maitred_right_arm.o \
 	carry/mouth.o \
 	carry/napkin.o \
 	carry/nose.o \
@@ -93,6 +95,8 @@ MODULE_OBJS := \
 	game/bridge_door.o \
 	game/bridge_view.o \
 	game/broken_pell_base.o \
+	game/broken_pellerator.o \
+	game/broken_pellerator_froz.o \
 	game/call_pellerator.o \
 	game/cage.o \
 	game/captains_wheel.o \
@@ -138,6 +142,7 @@ MODULE_OBJS := \
 	game/get_lift_eye2.o \
 	game/glass_smasher.o \
 	game/gondolier_base.o \
+	game/gondolier_mixer.o \
 	game/hammer_clip.o \
 	game/head_slot.o \
 	game/head_smash_event.o \
@@ -151,7 +156,6 @@ MODULE_OBJS := \
 	game/little_lift_button.o \
 	game/long_stick_dispenser.o \
 	game/mail_man.o \
-	game/maitred_arm_holder.o \
 	game/missiveomat.o \
 	game/missiveomat_button.o \
 	game/movie_tester.o \
@@ -186,7 +190,6 @@ MODULE_OBJS := \
 	game/season_background.o \
 	game/season_barrel.o \
 	game/seasonal_adjustment.o \
-	game/service_elevator_door.o \
 	game/service_elevator_window.o \
 	game/ship_setting.o \
 	game/ship_setting_button.o \
@@ -211,6 +214,10 @@ MODULE_OBJS := \
 	game/wheel_hotspot.o \
 	game/wheel_spin.o \
 	game/wheel_spin_horn.o \
+	game/maitred/maitred_arm_holder.o \
+	game/maitred/maitred_body.o \
+	game/maitred/maitred_legs.o \
+	game/maitred/maitred_prod_receptor.o \
 	game/parrot/parrot_lobby_controller.o \
 	game/parrot/parrot_lobby_link_updater.o \
 	game/parrot/parrot_lobby_object.o \
@@ -304,7 +311,12 @@ MODULE_OBJS := \
 	gfx/toggle_button.o \
 	gfx/toggle_switch.o \
 	gfx/volume_control.o \
+	messages/auto_sound_event.o \
+	messages/bilge_auto_sound_event.o \
+	messages/bilge_dispensor_event.o \
+	messages/door_auto_sound_event.o \
 	messages/messages.o \
+	messages/service_elevator_door.o \
 	moves/enter_bomb_room.o \
 	moves/enter_bridge.o \
 	moves/enter_exit_first_class_state.o \
@@ -344,19 +356,18 @@ MODULE_OBJS := \
 	npcs/true_talk_npc.o \
 	sound/auto_music_player.o \
 	sound/auto_music_player_base.o \
-	sound/auto_sound_event.o \
 	sound/auto_sound_player.o \
 	sound/auto_sound_player_adsr.o \
 	sound/background_sound_maker.o \
-	sound/bilge_auto_sound_event.o \
 	sound/bird_song.o \
-	sound/door_auto_sound_event.o \
+	sound/dome_from_top_of_well.o \
 	sound/enter_view_toggles_other_music.o \
 	sound/gondolier_song.o \
 	sound/music_player.o \
 	sound/node_auto_sound_player.o \
 	sound/restricted_auto_music_player.o \
 	sound/room_auto_sound_player.o \
+	sound/season_noises.o \
 	sound/seasonal_music_player.o \
 	sound/titania_speech.o \
 	sound/trigger_auto_music_player.o \
diff --git a/engines/titanic/sound/auto_sound_event.cpp b/engines/titanic/sound/auto_sound_event.cpp
deleted file mode 100644
index 673f35b..0000000
--- a/engines/titanic/sound/auto_sound_event.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/sound/auto_sound_event.h"
-
-namespace Titanic {
-
-CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _value1(0), _value2(70) {
-}
-
-void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_value1, indent);
-	file->writeNumberLine(_value2, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_value1 = file->readNumber();
-	_value2  = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/sound/auto_sound_event.h b/engines/titanic/sound/auto_sound_event.h
deleted file mode 100644
index cb5bfee..0000000
--- a/engines/titanic/sound/auto_sound_event.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_AUTO_SOUND_EVENT_H
-#define TITANIC_AUTO_SOUND_EVENT_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CAutoSoundEvent : public CGameObject {
-public:
-	int _value1;
-	int _value2;
-public:
-	CAutoSoundEvent();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/sound/bilge_auto_sound_event.cpp b/engines/titanic/sound/bilge_auto_sound_event.cpp
deleted file mode 100644
index 2446a5d..0000000
--- a/engines/titanic/sound/bilge_auto_sound_event.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/sound/bilge_auto_sound_event.h"
-
-namespace Titanic {
-
-void CBilgeAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CAutoSoundEvent::save(file, indent);
-}
-
-void CBilgeAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	CAutoSoundEvent::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/sound/bilge_auto_sound_event.h b/engines/titanic/sound/bilge_auto_sound_event.h
deleted file mode 100644
index 9657283..0000000
--- a/engines/titanic/sound/bilge_auto_sound_event.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_BILGE_AUTO_SOUND_EVENT_H
-#define TITANIC_BILGE_AUTO_SOUND_EVENT_H
-
-#include "titanic/sound/auto_sound_event.h"
-
-namespace Titanic {
-
-class CBilgeAutoSoundEvent : public CAutoSoundEvent {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBilgeAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_BILGE_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/sound/dome_from_top_of_well.cpp b/engines/titanic/sound/dome_from_top_of_well.cpp
new file mode 100644
index 0000000..6e31937
--- /dev/null
+++ b/engines/titanic/sound/dome_from_top_of_well.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/dome_from_top_of_well.h"
+
+namespace Titanic {
+
+void CDomeFromTopOfWell::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CViewAutoSoundPlayer::save(file, indent);
+}
+
+void CDomeFromTopOfWell::load(SimpleFile *file) {
+	file->readNumber();
+	CViewAutoSoundPlayer::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/dome_from_top_of_well.h b/engines/titanic/sound/dome_from_top_of_well.h
new file mode 100644
index 0000000..faea805
--- /dev/null
+++ b/engines/titanic/sound/dome_from_top_of_well.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DOME_FROM_TOP_OF_WELL_H
+#define TITANIC_DOME_FROM_TOP_OF_WELL_H
+
+#include "titanic/sound/view_auto_sound_player.h"
+
+namespace Titanic {
+
+class CDomeFromTopOfWell : public CViewAutoSoundPlayer {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CDomeFromTopOfWell"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DOME_FROM_TOP_OF_WELL_H */
diff --git a/engines/titanic/sound/door_auto_sound_event.cpp b/engines/titanic/sound/door_auto_sound_event.cpp
deleted file mode 100644
index f0e77fc..0000000
--- a/engines/titanic/sound/door_auto_sound_event.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/sound/door_auto_sound_event.h"
-
-namespace Titanic {
-
-void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeQuotedLine(_string2, indent);
-	file->writeNumberLine(_fieldDC, indent);
-	file->writeNumberLine(_fieldE0, indent);
-
-	CAutoSoundEvent::save(file, indent);
-}
-
-void CDoorAutoSoundEvent::load(SimpleFile *file) {
-	file->readNumber();
-	_string1 = file->readString();
-	_string2 = file->readString();
-	_fieldDC = file->readNumber();
-	_fieldE0 = file->readNumber();
-
-	CAutoSoundEvent::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/sound/door_auto_sound_event.h b/engines/titanic/sound/door_auto_sound_event.h
deleted file mode 100644
index 017912d..0000000
--- a/engines/titanic/sound/door_auto_sound_event.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_DOOR_AUTO_SOUND_EVENT_H
-#define TITANIC_DOOR_AUTO_SOUND_EVENT_H
-
-#include "titanic/sound/auto_sound_event.h"
-
-namespace Titanic {
-
-class CDoorAutoSoundEvent : public CAutoSoundEvent {
-public:
-	CString _string1;
-	CString _string2;
-	int _fieldDC;
-	int _fieldE0;
-public:
-	CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(),
-		_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
-	}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_DOOR_AUTO_SOUND_EVENT_H */
diff --git a/engines/titanic/sound/season_noises.cpp b/engines/titanic/sound/season_noises.cpp
new file mode 100644
index 0000000..beacdef
--- /dev/null
+++ b/engines/titanic/sound/season_noises.cpp
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/season_noises.h"
+
+namespace Titanic {
+
+CSeasonNoises::CSeasonNoises() : CViewAutoSoundPlayer(), _fieldF0(0),
+	_string2("NULL"), _string3("NULL"), _string4("NULL"), _string5("NULL") {
+}
+
+void CSeasonNoises::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldF0, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeQuotedLine(_string4, indent);
+	file->writeQuotedLine(_string5, indent);
+
+	CViewAutoSoundPlayer::save(file, indent);
+}
+
+void CSeasonNoises::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldF0 = file->readNumber();
+	_string2 = file->readString();
+	_string3 = file->readString();
+	_string4 = file->readString();
+	_string5 = file->readString();
+
+	CViewAutoSoundPlayer::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/season_noises.h b/engines/titanic/sound/season_noises.h
new file mode 100644
index 0000000..def709c
--- /dev/null
+++ b/engines/titanic/sound/season_noises.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SEASON_NOISES_H
+#define TITANIC_SEASON_NOISES_H
+
+#include "titanic/sound/view_auto_sound_player.h"
+
+namespace Titanic {
+
+class CSeasonNoises : public CViewAutoSoundPlayer {
+private:
+	int _fieldF0;
+	CString _string2;
+	CString _string3;
+	CString _string4;
+	CString _string5;
+public:
+	CSeasonNoises();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSeasonNoises"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SEASON_NOISES_H */


Commit: e688850e932f0c8be6d10a73fe416c90799733b0
    https://github.com/scummvm/scummvm/commit/e688850e932f0c8be6d10a73fe416c90799733b0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-02T23:40:06-05:00

Commit Message:
TITANIC: Implemented more saveable classes

Changed paths:
  A engines/titanic/game/gondolier/gondolier_base.cpp
  A engines/titanic/game/gondolier/gondolier_base.h
  A engines/titanic/game/gondolier/gondolier_chest.cpp
  A engines/titanic/game/gondolier/gondolier_chest.h
  A engines/titanic/game/gondolier/gondolier_face.cpp
  A engines/titanic/game/gondolier/gondolier_face.h
  A engines/titanic/game/gondolier/gondolier_mixer.cpp
  A engines/titanic/game/gondolier/gondolier_mixer.h
  A engines/titanic/game/gondolier/gondolier_slider.cpp
  A engines/titanic/game/gondolier/gondolier_slider.h
  A engines/titanic/gfx/icon_nav_butt.cpp
  A engines/titanic/gfx/icon_nav_butt.h
  A engines/titanic/gfx/icon_nav_image.cpp
  A engines/titanic/gfx/icon_nav_image.h
  A engines/titanic/gfx/icon_nav_receive.cpp
  A engines/titanic/gfx/icon_nav_receive.h
  A engines/titanic/gfx/icon_nav_send.cpp
  A engines/titanic/gfx/icon_nav_send.h
  A engines/titanic/gfx/pet_drag_chev.cpp
  A engines/titanic/gfx/pet_drag_chev.h
  A engines/titanic/gfx/pet_graphic.cpp
  A engines/titanic/gfx/pet_graphic.h
  A engines/titanic/gfx/pet_graphic2.cpp
  A engines/titanic/gfx/pet_graphic2.h
  A engines/titanic/gfx/pet_leaf.cpp
  A engines/titanic/gfx/pet_leaf.h
  A engines/titanic/gfx/pet_pannel1.cpp
  A engines/titanic/gfx/pet_pannel1.h
  A engines/titanic/gfx/pet_pannel2.cpp
  A engines/titanic/gfx/pet_pannel2.h
  A engines/titanic/gfx/pet_pannel3.cpp
  A engines/titanic/gfx/pet_pannel3.h
  A engines/titanic/gfx/sgt_selector.cpp
  A engines/titanic/gfx/sgt_selector.h
  A engines/titanic/gfx/text_down.cpp
  A engines/titanic/gfx/text_down.h
  A engines/titanic/gfx/text_skrew.cpp
  A engines/titanic/gfx/text_skrew.h
  A engines/titanic/gfx/text_up.cpp
  A engines/titanic/gfx/text_up.h
  A engines/titanic/moves/scraliontis_table.cpp
  A engines/titanic/moves/scraliontis_table.h
  R engines/titanic/game/gondolier_base.cpp
  R engines/titanic/game/gondolier_base.h
  R engines/titanic/game/gondolier_mixer.cpp
  R engines/titanic/game/gondolier_mixer.h
  R engines/titanic/game/pet_graphic.cpp
  R engines/titanic/game/pet_graphic.h
  R engines/titanic/game/pet_graphic2.cpp
  R engines/titanic/game/pet_graphic2.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/music_system_lock.cpp
    engines/titanic/game/phonograph_lid.cpp
    engines/titanic/game/phonograph_lid.h
    engines/titanic/module.mk
    engines/titanic/moves/restaurant_pan_handler.cpp
    engines/titanic/moves/restaurant_pan_handler.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 7a41230..8966ea6 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -61,6 +61,7 @@
 #include "titanic/core/saveable_object.h"
 #include "titanic/core/background.h"
 #include "titanic/core/click_responder.h"
+#include "titanic/core/dont_save_file_item.h"
 #include "titanic/core/drop_target.h"
 #include "titanic/core/file_item.h"
 #include "titanic/core/link_item.h"
@@ -69,6 +70,7 @@
 #include "titanic/core/movie_clip.h"
 #include "titanic/core/multi_drop_target.h"
 #include "titanic/core/node_item.h"
+#include "titanic/core/pet_control.h"
 #include "titanic/core/project_item.h"
 #include "titanic/core/saveable_object.h"
 #include "titanic/core/static_image.h"
@@ -135,8 +137,6 @@
 #include "titanic/game/games_console.h"
 #include "titanic/game/get_lift_eye2.h"
 #include "titanic/game/glass_smasher.h"
-#include "titanic/game/gondolier_base.h"
-#include "titanic/game/gondolier_mixer.h"
 #include "titanic/game/hammer_clip.h"
 #include "titanic/game/hammer_dispensor.h"
 #include "titanic/game/hammer_dispensor_button.h"
@@ -163,9 +163,8 @@
 #include "titanic/game/null_port_hole.h"
 #include "titanic/game/nut_replacer.h"
 #include "titanic/game/pet_disabler.h"
-#include "titanic/game/pet_graphic.h"
-#include "titanic/game/pet_graphic2.h"
 #include "titanic/game/phonograph.h"
+#include "titanic/game/phonograph_lid.h"
 #include "titanic/game/play_music_button.h"
 #include "titanic/game/play_on_act.h"
 #include "titanic/game/port_hole.h"
@@ -201,6 +200,11 @@
 #include "titanic/game/wheel_hotspot.h"
 #include "titanic/game/wheel_spin.h"
 #include "titanic/game/wheel_spin_horn.h"
+#include "titanic/game/gondolier/gondolier_base.h"
+#include "titanic/game/gondolier/gondolier_chest.h"
+#include "titanic/game/gondolier/gondolier_face.h"
+#include "titanic/game/gondolier/gondolier_mixer.h"
+#include "titanic/game/gondolier/gondolier_slider.h"
 #include "titanic/game/maitred/maitred_arm_holder.h"
 #include "titanic/game/maitred/maitred_body.h"
 #include "titanic/game/maitred/maitred_legs.h"
@@ -277,9 +281,13 @@
 #include "titanic/gfx/helmet_on_off.h"
 #include "titanic/gfx/home_photo.h"
 #include "titanic/gfx/icon_nav_action.h"
+#include "titanic/gfx/icon_nav_butt.h"
 #include "titanic/gfx/icon_nav_down.h"
+#include "titanic/gfx/icon_nav_image.h"
 #include "titanic/gfx/icon_nav_left.h"
+#include "titanic/gfx/icon_nav_receive.h"
 #include "titanic/gfx/icon_nav_right.h"
+#include "titanic/gfx/icon_nav_send.h"
 #include "titanic/gfx/icon_nav_up.h"
 #include "titanic/gfx/keybrd_butt.h"
 #include "titanic/gfx/move_object_button.h"
@@ -290,10 +298,18 @@
 #include "titanic/gfx/music_switch_inversion.h"
 #include "titanic/gfx/music_switch_reverse.h"
 #include "titanic/gfx/music_voice_mute.h"
+#include "titanic/gfx/pet_drag_chev.h"
+#include "titanic/gfx/pet_graphic.h"
+#include "titanic/gfx/pet_graphic2.h"
+#include "titanic/gfx/pet_leaf.h"
 #include "titanic/gfx/pet_mode_off.h"
 #include "titanic/gfx/pet_mode_on.h"
 #include "titanic/gfx/pet_mode_panel.h"
+#include "titanic/gfx/pet_pannel1.h"
+#include "titanic/gfx/pet_pannel2.h"
+#include "titanic/gfx/pet_pannel3.h"
 #include "titanic/gfx/send_to_succ.h"
+#include "titanic/gfx/sgt_selector.h"
 #include "titanic/gfx/slider_button.h"
 #include "titanic/gfx/small_chev_left_off.h"
 #include "titanic/gfx/small_chev_left_on.h"
@@ -302,6 +318,9 @@
 #include "titanic/gfx/status_change_button.h"
 #include "titanic/gfx/st_button.h"
 #include "titanic/gfx/toggle_button.h"
+#include "titanic/gfx/text_down.h"
+#include "titanic/gfx/text_skrew.h"
+#include "titanic/gfx/text_up.h"
 #include "titanic/gfx/toggle_switch.h"
 #include "titanic/gfx/volume_control.h"
 
@@ -334,6 +353,7 @@
 #include "titanic/moves/pan_from_pel.h"
 #include "titanic/moves/restaurant_pan_handler.h"
 #include "titanic/moves/restricted_move.h"
+#include "titanic/moves/scraliontis_table.h"
 #include "titanic/moves/trip_down_canal.h"
 
 #include "titanic/npcs/barbot.h"
@@ -383,6 +403,7 @@ DEFFN(CAuditoryCentre);
 DEFFN(CBowlEar);
 DEFFN(CBrain);
 DEFFN(CBridgePiece);
+DEFFN(CCarry);
 DEFFN(CCarryParrot);
 DEFFN(CCentralCore);
 DEFFN(CChicken);
@@ -419,6 +440,7 @@ DEFFN(CVisionCentre);
 
 DEFFN(CBackground);
 DEFFN(CClickResponder);
+DEFFN(CDontSaveFileItem);
 DEFFN(CDropTarget);
 DEFFN(CFileItem);
 DEFFN(CFileListItem);
@@ -428,6 +450,7 @@ DEFFN(CMovieClip);
 DEFFN(CMovieClipList);
 DEFFN(CMultiDropTarget);
 DEFFN(CNodeItem);
+DEFFN(CPetControl);
 DEFFN(CProjectItem);
 DEFFN(CStaticImage);
 DEFFN(CTurnOnObject);
@@ -492,8 +515,6 @@ DEFFN(CFloorIndicator);
 DEFFN(CGamesConsole);
 DEFFN(CGetLiftEye2);
 DEFFN(CGlassSmasher);
-DEFFN(CGondolierBase);
-DEFFN(CGondolierMixer);
 DEFFN(CHammerClip);
 DEFFN(CHammerDispensor);
 DEFFN(CHammerDispensorButton);
@@ -520,9 +541,8 @@ DEFFN(CNoseHolder);
 DEFFN(CNullPortHole);
 DEFFN(CNutReplacer);
 DEFFN(CPetDisabler);
-DEFFN(CPetGraphic);
-DEFFN(CPetGraphic2);
 DEFFN(CPhonograph);
+DEFFN(CPhonographLid);
 DEFFN(CPlayMusicButton);
 DEFFN(CPlayOnAct);
 DEFFN(CPortHole);
@@ -558,6 +578,11 @@ DEFFN(CWheelButton);
 DEFFN(CWheelHotSpot);
 DEFFN(CWheelSpin);
 DEFFN(CWheelSpinHorn);
+DEFFN(CGondolierBase);
+DEFFN(CGondolierChest);
+DEFFN(CGondolierFace);
+DEFFN(CGondolierMixer);
+DEFFN(CGondolierSlider);
 DEFFN(CMaitreDArmHolder);
 DEFFN(CMaitreDBody);
 DEFFN(CMaitreDLegs);
@@ -577,6 +602,10 @@ DEFFN(CPET);
 DEFFN(CPETClass1);
 DEFFN(CPETClass2);
 DEFFN(CPETClass3);
+DEFFN(CPetDragChev);
+DEFFN(CPetGraphic);
+DEFFN(CPetGraphic2);
+DEFFN(PETLeaf);
 DEFFN(CPETLift);
 DEFFN(CPETMonitor);
 DEFFN(CPETPellerator);
@@ -636,9 +665,13 @@ DEFFN(CGetFromSucc);
 DEFFN(CHelmetOnOff);
 DEFFN(CHomePhoto);
 DEFFN(CIconNavAction);
+DEFFN(CIconNavButt);
 DEFFN(CIconNavDown);
+DEFFN(CIconNavImage);
 DEFFN(CIconNavLeft);
+DEFFN(CIconNavReceive);
 DEFFN(CIconNavRight);
+DEFFN(CIconNavSend);
 DEFFN(CIconNavUp);
 DEFFN(CKeybrdButt);
 DEFFN(CMoveObjectButton);
@@ -653,7 +686,11 @@ DEFFN(CMusicVoiceMute);
 DEFFN(CPetModeOff);
 DEFFN(CPetModeOn);
 DEFFN(CPetModePanel);
+DEFFN(CPetPannel1);
+DEFFN(CPetPannel2);
+DEFFN(CPetPannel3);
 DEFFN(CSendToSucc);
+DEFFN(CSGTSelector);
 DEFFN(CSliderButton);
 DEFFN(CSmallChevLeftOff);
 DEFFN(CSmallChevLeftOn);
@@ -661,6 +698,9 @@ DEFFN(CSmallChevRightOff);
 DEFFN(CSmallChevRightOn);
 DEFFN(CStatusChangeButton);
 DEFFN(CSTButton);
+DEFFN(CTextDown);
+DEFFN(CTextSkrew);
+DEFFN(CTextUp);
 DEFFN(CToggleButton);
 DEFFN(CToggleSwitch);
 DEFFN(CVolumeControl);
@@ -862,6 +902,7 @@ DEFFN(CMovePlayerToFrom);
 DEFFN(CMultiMove);
 DEFFN(CPanFromPel);
 DEFFN(CRestaurantPanHandler);
+DEFFN(CScraliontisTable);
 DEFFN(CRestrictedMove);
 DEFFN(CTripDownCanal);
 
@@ -905,6 +946,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CBowlEar);
 	ADDFN(CBrain);
 	ADDFN(CBridgePiece);
+	ADDFN(CCarry);
 	ADDFN(CCarryParrot);
 	ADDFN(CCentralCore);
 	ADDFN(CChicken);
@@ -941,6 +983,7 @@ void CSaveableObject::initClassList() {
 
 	ADDFN(CBackground);
 	ADDFN(CClickResponder);
+	ADDFN(CDontSaveFileItem);
 	ADDFN(CDropTarget);
 	ADDFN(CFileItem);
 	ADDFN(CFileListItem);
@@ -950,6 +993,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CMovieClipList);
 	ADDFN(CMultiDropTarget);
 	ADDFN(CNodeItem);
+	ADDFN(CPetControl);
 	ADDFN(CProjectItem);
 	ADDFN(CStaticImage);
 	ADDFN(CTurnOnObject);
@@ -1015,8 +1059,6 @@ void CSaveableObject::initClassList() {
 	ADDFN(CGamesConsole);
 	ADDFN(CGetLiftEye2);
 	ADDFN(CGlassSmasher);
-	ADDFN(CGondolierBase);
-	ADDFN(CGondolierMixer);
 	ADDFN(CHammerClip);
 	ADDFN(CHammerDispensor);
 	ADDFN(CHammerDispensorButton);
@@ -1043,9 +1085,8 @@ void CSaveableObject::initClassList() {
 	ADDFN(CNullPortHole);
 	ADDFN(CNutReplacer);
 	ADDFN(CPetDisabler);
-	ADDFN(CPetGraphic);
-	ADDFN(CPetGraphic2);
 	ADDFN(CPhonograph);
+	ADDFN(CPhonographLid);
 	ADDFN(CPlayMusicButton);
 	ADDFN(CPlayOnAct);
 	ADDFN(CPortHole);
@@ -1081,6 +1122,11 @@ void CSaveableObject::initClassList() {
 	ADDFN(CWheelHotSpot);
 	ADDFN(CWheelSpin);
 	ADDFN(CWheelSpinHorn);
+	ADDFN(CGondolierBase);
+	ADDFN(CGondolierChest);
+	ADDFN(CGondolierFace);
+	ADDFN(CGondolierMixer);
+	ADDFN(CGondolierSlider);
 	ADDFN(CMaitreDArmHolder);
 	ADDFN(CMaitreDBody);
 	ADDFN(CMaitreDLegs);
@@ -1100,6 +1146,10 @@ void CSaveableObject::initClassList() {
 	ADDFN(CPETClass1);
 	ADDFN(CPETClass2);
 	ADDFN(CPETClass3);
+	ADDFN(CPetDragChev);
+	ADDFN(CPetGraphic);
+	ADDFN(CPetGraphic2);
+	ADDFN(PETLeaf);
 	ADDFN(CPETLift);
 	ADDFN(CPETMonitor);
 	ADDFN(CPETPellerator);
@@ -1159,9 +1209,13 @@ void CSaveableObject::initClassList() {
 	ADDFN(CHelmetOnOff);
 	ADDFN(CHomePhoto);
 	ADDFN(CIconNavAction);
+	ADDFN(CIconNavButt);
 	ADDFN(CIconNavDown);
+	ADDFN(CIconNavImage);
 	ADDFN(CIconNavLeft);
+	ADDFN(CIconNavReceive);
 	ADDFN(CIconNavRight);
+	ADDFN(CIconNavSend);
 	ADDFN(CIconNavUp);
 	ADDFN(CKeybrdButt);
 	ADDFN(CMoveObjectButton);
@@ -1176,7 +1230,11 @@ void CSaveableObject::initClassList() {
 	ADDFN(CPetModeOff);
 	ADDFN(CPetModeOn);
 	ADDFN(CPetModePanel);
+	ADDFN(CPetPannel1);
+	ADDFN(CPetPannel2);
+	ADDFN(CPetPannel3);
 	ADDFN(CSendToSucc);
+	ADDFN(CSGTSelector);
 	ADDFN(CSliderButton);
 	ADDFN(CSmallChevLeftOff);
 	ADDFN(CSmallChevLeftOn);
@@ -1184,6 +1242,9 @@ void CSaveableObject::initClassList() {
 	ADDFN(CSmallChevRightOn);
 	ADDFN(CStatusChangeButton);
 	ADDFN(CSTButton);
+	ADDFN(CTextDown);
+	ADDFN(CTextSkrew);
+	ADDFN(CTextUp);
 	ADDFN(CToggleButton);
 	ADDFN(CToggleSwitch);
 	ADDFN(CVolumeControl);
@@ -1381,6 +1442,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CMultiMove);
 	ADDFN(CPanFromPel);
 	ADDFN(CRestaurantPanHandler);
+	ADDFN(CScraliontisTable);
 	ADDFN(CRestrictedMove);
 	ADDFN(CTripDownCanal);
 
diff --git a/engines/titanic/game/gondolier/gondolier_base.cpp b/engines/titanic/game/gondolier/gondolier_base.cpp
new file mode 100644
index 0000000..bf54ed4
--- /dev/null
+++ b/engines/titanic/game/gondolier/gondolier_base.cpp
@@ -0,0 +1,70 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/gondolier/gondolier_base.h"
+
+namespace Titanic {
+
+int CGondolierBase::_v1;
+int CGondolierBase::_v2;
+int CGondolierBase::_v3;
+int CGondolierBase::_v4;
+int CGondolierBase::_v5;
+int CGondolierBase::_v6;
+int CGondolierBase::_v7;
+int CGondolierBase::_v8;
+int CGondolierBase::_v9;
+int CGondolierBase::_v10;
+
+void CGondolierBase::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
+	file->writeNumberLine(_v2, indent);
+	file->writeNumberLine(_v3, indent);
+	file->writeNumberLine(_v4, indent);
+	file->writeNumberLine(_v5, indent);
+	file->writeNumberLine(_v6, indent);
+	file->writeNumberLine(_v7, indent);
+	file->writeNumberLine(_v8, indent);
+	file->writeNumberLine(_v9, indent);
+	file->writeNumberLine(_v10, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CGondolierBase::load(SimpleFile *file) {
+	file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+	_v3 = file->readNumber();
+	_v4 = file->readNumber();
+	_v5 = file->readNumber();
+	_v6 = file->readNumber();
+	_v7 = file->readNumber();
+	_v8 = file->readNumber();
+	_v9 = file->readNumber();
+	_v10 = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/gondolier/gondolier_base.h b/engines/titanic/game/gondolier/gondolier_base.h
new file mode 100644
index 0000000..3f0cede
--- /dev/null
+++ b/engines/titanic/game/gondolier/gondolier_base.h
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GONDOLIER_BASE_H
+#define TITANIC_GONDOLIER_BASE_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CGondolierBase : public CGameObject {
+private:
+	static int _v1;
+	static int _v2;
+	static int _v3;
+	static int _v4;
+	static int _v5;
+	static int _v6;
+	static int _v7;
+	static int _v8;
+	static int _v9;
+	static int _v10;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGondolierBase"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GONDOLIER_BASE_H */
diff --git a/engines/titanic/game/gondolier/gondolier_chest.cpp b/engines/titanic/game/gondolier/gondolier_chest.cpp
new file mode 100644
index 0000000..441a8ba
--- /dev/null
+++ b/engines/titanic/game/gondolier/gondolier_chest.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/gondolier/gondolier_chest.h"
+
+namespace Titanic {
+
+void CGondolierChest::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGondolierBase::save(file, indent);
+}
+
+void CGondolierChest::load(SimpleFile *file) {
+	file->readNumber();
+	CGondolierBase::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/gondolier/gondolier_chest.h b/engines/titanic/game/gondolier/gondolier_chest.h
new file mode 100644
index 0000000..277faf9
--- /dev/null
+++ b/engines/titanic/game/gondolier/gondolier_chest.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GONDOLIER_CHEST_H
+#define TITANIC_GONDOLIER_CHEST_H
+
+#include "titanic/game/gondolier/gondolier_base.h"
+
+namespace Titanic {
+
+class CGondolierChest : public CGondolierBase {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGondolierChest"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GONDOLIER_CHEST_H */
diff --git a/engines/titanic/game/gondolier/gondolier_face.cpp b/engines/titanic/game/gondolier/gondolier_face.cpp
new file mode 100644
index 0000000..6db23d8
--- /dev/null
+++ b/engines/titanic/game/gondolier/gondolier_face.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/gondolier/gondolier_face.h"
+
+namespace Titanic {
+
+void CGondolierFace::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	CGondolierBase::save(file, indent);
+}
+
+void CGondolierFace::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	CGondolierBase::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/gondolier/gondolier_face.h b/engines/titanic/game/gondolier/gondolier_face.h
new file mode 100644
index 0000000..5007431
--- /dev/null
+++ b/engines/titanic/game/gondolier/gondolier_face.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GONDOLIER_FACE_H
+#define TITANIC_GONDOLIER_FACE_H
+
+#include "titanic/game/gondolier/gondolier_base.h"
+
+namespace Titanic {
+
+class CGondolierFace : public CGondolierBase {
+private:
+	int _fieldBC;
+public:
+	CGondolierFace() : CGondolierBase(), _fieldBC(0) {}
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGondolierMixer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GONDOLIER_FACE_H */
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.cpp b/engines/titanic/game/gondolier/gondolier_mixer.cpp
new file mode 100644
index 0000000..e81ad34
--- /dev/null
+++ b/engines/titanic/game/gondolier/gondolier_mixer.cpp
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/gondolier/gondolier_mixer.h"
+
+namespace Titanic {
+
+CGondolierMixer::CGondolierMixer() : CGondolierBase(),
+	_string1("c#0.wav"), _string2("c#1.wav"),
+	_fieldBC(-1), _fieldC0(-1), _fieldC4(0), _fieldC8(0),
+	_fieldE4(0) {
+}
+
+void CGondolierMixer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeNumberLine(_fieldE4, indent);
+
+	CGondolierBase::save(file, indent);
+}
+
+void CGondolierMixer::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_string1 = file->readString();
+	_string2 = file->readString();
+	_fieldE4 = file->readNumber();
+
+	CGondolierBase::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.h b/engines/titanic/game/gondolier/gondolier_mixer.h
new file mode 100644
index 0000000..5b92bc2
--- /dev/null
+++ b/engines/titanic/game/gondolier/gondolier_mixer.h
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GONDOLIER_MIXER_H
+#define TITANIC_GONDOLIER_MIXER_H
+
+#include "titanic/game/gondolier/gondolier_base.h"
+
+namespace Titanic {
+
+class CGondolierMixer : public CGondolierBase {
+private:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	CString _string1;
+	CString _string2;
+	int _fieldE4;
+public:
+	CGondolierMixer();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGondolierMixer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GONDOLIER_MIXER_H */
diff --git a/engines/titanic/game/gondolier/gondolier_slider.cpp b/engines/titanic/game/gondolier/gondolier_slider.cpp
new file mode 100644
index 0000000..dff464c
--- /dev/null
+++ b/engines/titanic/game/gondolier/gondolier_slider.cpp
@@ -0,0 +1,82 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/gondolier/gondolier_slider.h"
+
+namespace Titanic {
+
+CGondolierSlider::CGondolierSlider() : CGondolierBase(),
+	_fieldBC(0), _fieldC0(0), _fieldC4(0), _fieldC8(0),
+	_fieldCC(0), _fieldD0(0), _fieldD4(0), _fieldD8(0),
+	_fieldDC(0), _fieldE0(0), _fieldE4(0), _fieldE8(0),
+	_fieldEC(0), _string1("NULL"), _fieldFC(0), _field118(0) {
+}
+
+void CGondolierSlider::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_fieldC0, indent);
+	file->writeNumberLine(_fieldC4, indent);
+	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeNumberLine(_fieldD0, indent);
+	file->writeNumberLine(_fieldD4, indent);
+	file->writeNumberLine(_fieldD8, indent);
+	file->writeNumberLine(_fieldDC, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldCC, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldFC, indent);
+	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_string3, indent);
+	file->writeNumberLine(_field118, indent);
+
+	CGondolierBase::save(file, indent);
+}
+
+void CGondolierSlider::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_fieldC0 = file->readNumber();
+	_fieldC4 = file->readNumber();
+	_fieldC8 = file->readNumber();
+	_fieldCC = file->readNumber();
+	_fieldD0 = file->readNumber();
+	_fieldD4 = file->readNumber();
+	_fieldD8 = file->readNumber();
+	_fieldDC = file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+	_string1 = file->readString();
+	_fieldFC = file->readNumber();
+	_string2 = file->readString();
+	_string3 = file->readString();
+	_field118 = file->readNumber();
+
+	CGondolierBase::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/gondolier/gondolier_slider.h b/engines/titanic/game/gondolier/gondolier_slider.h
new file mode 100644
index 0000000..9522483
--- /dev/null
+++ b/engines/titanic/game/gondolier/gondolier_slider.h
@@ -0,0 +1,71 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GONDOLIER_SLIDER_H
+#define TITANIC_GONDOLIER_SLIDER_H
+
+#include "titanic/game/gondolier/gondolier_base.h"
+
+namespace Titanic {
+
+class CGondolierSlider : public CGondolierBase {
+private:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	int _fieldCC;
+	int _fieldD0;
+	int _fieldD4;
+	int _fieldD8;
+	int _fieldDC;
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+	CString _string1;
+	int _fieldFC;
+	CString _string2;
+	CString _string3;
+	int _field118;
+public:
+	CGondolierSlider();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CGondolierSlider"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GONDOLIER_SLIDER_H */
diff --git a/engines/titanic/game/gondolier_base.cpp b/engines/titanic/game/gondolier_base.cpp
deleted file mode 100644
index 59c9b5c..0000000
--- a/engines/titanic/game/gondolier_base.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/gondolier_base.h"
-
-namespace Titanic {
-
-int CGondolierBase::_v1;
-int CGondolierBase::_v2;
-int CGondolierBase::_v3;
-int CGondolierBase::_v4;
-int CGondolierBase::_v5;
-int CGondolierBase::_v6;
-int CGondolierBase::_v7;
-int CGondolierBase::_v8;
-int CGondolierBase::_v9;
-int CGondolierBase::_v10;
-
-void CGondolierBase::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_v1, indent);
-	file->writeNumberLine(_v2, indent);
-	file->writeNumberLine(_v3, indent);
-	file->writeNumberLine(_v4, indent);
-	file->writeNumberLine(_v5, indent);
-	file->writeNumberLine(_v6, indent);
-	file->writeNumberLine(_v7, indent);
-	file->writeNumberLine(_v8, indent);
-	file->writeNumberLine(_v9, indent);
-	file->writeNumberLine(_v10, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CGondolierBase::load(SimpleFile *file) {
-	file->readNumber();
-	_v1 = file->readNumber();
-	_v2 = file->readNumber();
-	_v3 = file->readNumber();
-	_v4 = file->readNumber();
-	_v5 = file->readNumber();
-	_v6 = file->readNumber();
-	_v7 = file->readNumber();
-	_v8 = file->readNumber();
-	_v9 = file->readNumber();
-	_v10 = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/gondolier_base.h b/engines/titanic/game/gondolier_base.h
deleted file mode 100644
index 3f0cede..0000000
--- a/engines/titanic/game/gondolier_base.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_GONDOLIER_BASE_H
-#define TITANIC_GONDOLIER_BASE_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CGondolierBase : public CGameObject {
-private:
-	static int _v1;
-	static int _v2;
-	static int _v3;
-	static int _v4;
-	static int _v5;
-	static int _v6;
-	static int _v7;
-	static int _v8;
-	static int _v9;
-	static int _v10;
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGondolierBase"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_GONDOLIER_BASE_H */
diff --git a/engines/titanic/game/gondolier_mixer.cpp b/engines/titanic/game/gondolier_mixer.cpp
deleted file mode 100644
index 33cc883..0000000
--- a/engines/titanic/game/gondolier_mixer.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/gondolier_mixer.h"
-
-namespace Titanic {
-
-CGondolierMixer::CGondolierMixer() : CGondolierBase(),
-	_string1("c#0.wav"), _string2("c#1.wav"),
-	_fieldBC(-1), _fieldC0(-1), _fieldC4(0), _fieldC8(0),
-	_fieldE4(0) {
-}
-
-void CGondolierMixer::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-	file->writeNumberLine(_fieldC4, indent);
-	file->writeNumberLine(_fieldC8, indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeQuotedLine(_string2, indent);
-	file->writeNumberLine(_fieldE4, indent);
-
-	CGondolierBase::save(file, indent);
-}
-
-void CGondolierMixer::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-	_fieldC4 = file->readNumber();
-	_fieldC8 = file->readNumber();
-	_string1 = file->readString();
-	_string2 = file->readString();
-	_fieldE4 = file->readNumber();
-
-	CGondolierBase::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/gondolier_mixer.h b/engines/titanic/game/gondolier_mixer.h
deleted file mode 100644
index dfc4621..0000000
--- a/engines/titanic/game/gondolier_mixer.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_GONDOLIER_MIXER_H
-#define TITANIC_GONDOLIER_MIXER_H
-
-#include "titanic/game/gondolier_base.h"
-
-namespace Titanic {
-
-class CGondolierMixer : public CGondolierBase {
-private:
-	int _fieldBC;
-	int _fieldC0;
-	int _fieldC4;
-	int _fieldC8;
-	CString _string1;
-	CString _string2;
-	int _fieldE4;
-public:
-	CGondolierMixer();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGondolierMixer"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_GONDOLIER_MIXER_H */
diff --git a/engines/titanic/game/music_system_lock.cpp b/engines/titanic/game/music_system_lock.cpp
index a5419d9..6bd83f6 100644
--- a/engines/titanic/game/music_system_lock.cpp
+++ b/engines/titanic/game/music_system_lock.cpp
@@ -33,7 +33,7 @@ void CMusicSystemLock::save(SimpleFile *file, int indent) const {
 void CMusicSystemLock::load(SimpleFile *file) {
 	file->readNumber();
 	_value = file->readNumber();
-	CGameObject::load(file);
+	CDropTarget::load(file);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/pet_graphic.cpp b/engines/titanic/game/pet_graphic.cpp
deleted file mode 100644
index 38226c9..0000000
--- a/engines/titanic/game/pet_graphic.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet_graphic.h"
-
-namespace Titanic {
-
-void CPetGraphic::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
-}
-
-void CPetGraphic::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet_graphic.h b/engines/titanic/game/pet_graphic.h
deleted file mode 100644
index 28b5d9a..0000000
--- a/engines/titanic/game/pet_graphic.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_GRAPHIC_H
-#define TITANIC_PET_GRAPHIC_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CPetGraphic : public CGameObject {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPetGraphic"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_GRAPHIC_H */
diff --git a/engines/titanic/game/pet_graphic2.cpp b/engines/titanic/game/pet_graphic2.cpp
deleted file mode 100644
index a8d244e..0000000
--- a/engines/titanic/game/pet_graphic2.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet_graphic2.h"
-
-namespace Titanic {
-
-void CPetGraphic2::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
-}
-
-void CPetGraphic2::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet_graphic2.h b/engines/titanic/game/pet_graphic2.h
deleted file mode 100644
index aabf058..0000000
--- a/engines/titanic/game/pet_graphic2.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_GRAPHIC2_H
-#define TITANIC_PET_GRAPHIC2_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CPetGraphic2 : public CGameObject {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNutReplacer"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_GRAPHIC2_H */
diff --git a/engines/titanic/game/phonograph_lid.cpp b/engines/titanic/game/phonograph_lid.cpp
index c7c1bd3..a228af8 100644
--- a/engines/titanic/game/phonograph_lid.cpp
+++ b/engines/titanic/game/phonograph_lid.cpp
@@ -26,11 +26,13 @@ namespace Titanic {
 
 void CPhonographLid::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
 }
 
 void CPhonographLid::load(SimpleFile *file) {
 	file->readNumber();
+	_value = file->readNumber();
 	CGameObject::load(file);
 }
 
diff --git a/engines/titanic/game/phonograph_lid.h b/engines/titanic/game/phonograph_lid.h
index 040fec4..2252551 100644
--- a/engines/titanic/game/phonograph_lid.h
+++ b/engines/titanic/game/phonograph_lid.h
@@ -28,7 +28,11 @@
 namespace Titanic {
 
 class CPhonographLid : public CGameObject {
+private:
+	int _value;
 public:
+	CPhonographLid() : CGameObject(), _value(0) {}
+
 	/**
 	 * Return the class name
 	 */
diff --git a/engines/titanic/gfx/icon_nav_butt.cpp b/engines/titanic/gfx/icon_nav_butt.cpp
new file mode 100644
index 0000000..85eb130
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_butt.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/icon_nav_butt.h"
+
+namespace Titanic {
+
+void CIconNavButt::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CIconNavButt::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/icon_nav_butt.h b/engines/titanic/gfx/icon_nav_butt.h
new file mode 100644
index 0000000..018904e
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_butt.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ICON_NAV_BUTT_H
+#define TITANIC_ICON_NAV_BUTT_H
+
+#include "titanic/gfx/pet_graphic.h"
+
+namespace Titanic {
+
+class CIconNavButt : public CPetGraphic {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CIconNavButt"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ICON_NAV_BUTT_H */
diff --git a/engines/titanic/gfx/icon_nav_image.cpp b/engines/titanic/gfx/icon_nav_image.cpp
new file mode 100644
index 0000000..1e8a1ca
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_image.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/icon_nav_image.h"
+
+namespace Titanic {
+
+void CIconNavImage::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CIconNavImage::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/icon_nav_image.h b/engines/titanic/gfx/icon_nav_image.h
new file mode 100644
index 0000000..403936d
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_image.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ICON_NAV_IMAGE_H
+#define TITANIC_ICON_NAV_IMAGE_H
+
+#include "titanic/gfx/pet_graphic.h"
+
+namespace Titanic {
+
+class CIconNavImage : public CPetGraphic {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CIconNavImage"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ICON_NAV_IMAGE_H */
diff --git a/engines/titanic/gfx/icon_nav_receive.cpp b/engines/titanic/gfx/icon_nav_receive.cpp
new file mode 100644
index 0000000..ad7e0e7
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_receive.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/icon_nav_receive.h"
+
+namespace Titanic {
+
+void CIconNavReceive::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CIconNavReceive::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/icon_nav_receive.h b/engines/titanic/gfx/icon_nav_receive.h
new file mode 100644
index 0000000..b158fda
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_receive.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ICON_NAV_RECEIVE_H
+#define TITANIC_ICON_NAV_RECEIVE_H
+
+#include "titanic/gfx/pet_graphic.h"
+
+namespace Titanic {
+
+class CIconNavReceive : public CPetGraphic {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CIconNavReceive"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ICON_NAV_RECEIVE_H */
diff --git a/engines/titanic/gfx/icon_nav_send.cpp b/engines/titanic/gfx/icon_nav_send.cpp
new file mode 100644
index 0000000..856560c
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_send.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/icon_nav_send.h"
+
+namespace Titanic {
+
+void CIconNavSend::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CIconNavSend::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/icon_nav_send.h b/engines/titanic/gfx/icon_nav_send.h
new file mode 100644
index 0000000..59cb670
--- /dev/null
+++ b/engines/titanic/gfx/icon_nav_send.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ICON_NAV_SEND_H
+#define TITANIC_ICON_NAV_SEND_H
+
+#include "titanic/gfx/pet_graphic.h"
+
+namespace Titanic {
+
+class CIconNavSend : public CPetGraphic {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CIconNavSend"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ICON_NAV_SEND_H */
diff --git a/engines/titanic/gfx/pet_drag_chev.cpp b/engines/titanic/gfx/pet_drag_chev.cpp
new file mode 100644
index 0000000..24b4666
--- /dev/null
+++ b/engines/titanic/gfx/pet_drag_chev.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/pet_drag_chev.h"
+
+namespace Titanic {
+
+void CPetDragChev::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic2::save(file, indent);
+}
+
+void CPetDragChev::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic2::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_drag_chev.h b/engines/titanic/gfx/pet_drag_chev.h
new file mode 100644
index 0000000..72f83dd
--- /dev/null
+++ b/engines/titanic/gfx/pet_drag_chev.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_DRAG_CHEV_H
+#define TITANIC_PET_DRAG_CHEV_H
+
+#include "titanic/gfx/pet_graphic2.h"
+
+namespace Titanic {
+
+class CPetDragChev : public CPetGraphic2 {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPetDragChev"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_DRAG_CHEV_H */
diff --git a/engines/titanic/gfx/pet_graphic.cpp b/engines/titanic/gfx/pet_graphic.cpp
new file mode 100644
index 0000000..b625c1d
--- /dev/null
+++ b/engines/titanic/gfx/pet_graphic.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/pet_graphic.h"
+
+namespace Titanic {
+
+void CPetGraphic::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPetGraphic::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_graphic.h b/engines/titanic/gfx/pet_graphic.h
new file mode 100644
index 0000000..28b5d9a
--- /dev/null
+++ b/engines/titanic/gfx/pet_graphic.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_GRAPHIC_H
+#define TITANIC_PET_GRAPHIC_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPetGraphic : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPetGraphic"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_GRAPHIC_H */
diff --git a/engines/titanic/gfx/pet_graphic2.cpp b/engines/titanic/gfx/pet_graphic2.cpp
new file mode 100644
index 0000000..5588c72
--- /dev/null
+++ b/engines/titanic/gfx/pet_graphic2.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/pet_graphic2.h"
+
+namespace Titanic {
+
+void CPetGraphic2::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPetGraphic2::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_graphic2.h b/engines/titanic/gfx/pet_graphic2.h
new file mode 100644
index 0000000..aabf058
--- /dev/null
+++ b/engines/titanic/gfx/pet_graphic2.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_GRAPHIC2_H
+#define TITANIC_PET_GRAPHIC2_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPetGraphic2 : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CNutReplacer"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_GRAPHIC2_H */
diff --git a/engines/titanic/gfx/pet_leaf.cpp b/engines/titanic/gfx/pet_leaf.cpp
new file mode 100644
index 0000000..adb6ccd
--- /dev/null
+++ b/engines/titanic/gfx/pet_leaf.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/pet_leaf.h"
+
+namespace Titanic {
+
+void PETLeaf::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void PETLeaf::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_leaf.h b/engines/titanic/gfx/pet_leaf.h
new file mode 100644
index 0000000..95fe1e6
--- /dev/null
+++ b/engines/titanic/gfx/pet_leaf.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_LEAF_H
+#define TITANIC_PET_LEAF_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class PETLeaf : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "PETLeaf"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_LEAF_H */
diff --git a/engines/titanic/gfx/pet_pannel1.cpp b/engines/titanic/gfx/pet_pannel1.cpp
new file mode 100644
index 0000000..baa7558
--- /dev/null
+++ b/engines/titanic/gfx/pet_pannel1.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/pet_pannel1.h"
+
+namespace Titanic {
+
+void CPetPannel1::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CPetPannel1::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_pannel1.h b/engines/titanic/gfx/pet_pannel1.h
new file mode 100644
index 0000000..3d9b406
--- /dev/null
+++ b/engines/titanic/gfx/pet_pannel1.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_PANNEL1_H
+#define TITANIC_PET_PANNEL1_H
+
+#include "titanic/gfx/pet_graphic.h"
+
+namespace Titanic {
+
+class CPetPannel1 : public CPetGraphic {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPetPannel1"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_PANNEL1_H */
diff --git a/engines/titanic/gfx/pet_pannel2.cpp b/engines/titanic/gfx/pet_pannel2.cpp
new file mode 100644
index 0000000..7376fcc
--- /dev/null
+++ b/engines/titanic/gfx/pet_pannel2.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/pet_pannel2.h"
+
+namespace Titanic {
+
+void CPetPannel2::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CPetPannel2::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_pannel2.h b/engines/titanic/gfx/pet_pannel2.h
new file mode 100644
index 0000000..6fdad87
--- /dev/null
+++ b/engines/titanic/gfx/pet_pannel2.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_PANNEL2_H
+#define TITANIC_PET_PANNEL2_H
+
+#include "titanic/gfx/pet_graphic.h"
+
+namespace Titanic {
+
+class CPetPannel2 : public CPetGraphic {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPetPannel2"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_PANNEL2_H */
diff --git a/engines/titanic/gfx/pet_pannel3.cpp b/engines/titanic/gfx/pet_pannel3.cpp
new file mode 100644
index 0000000..f4bd1fb
--- /dev/null
+++ b/engines/titanic/gfx/pet_pannel3.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/pet_pannel3.h"
+
+namespace Titanic {
+
+void CPetPannel3::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CPetPannel3::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_pannel3.h b/engines/titanic/gfx/pet_pannel3.h
new file mode 100644
index 0000000..521d517
--- /dev/null
+++ b/engines/titanic/gfx/pet_pannel3.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_PANNEL3_H
+#define TITANIC_PET_PANNEL3_H
+
+#include "titanic/gfx/pet_graphic.h"
+
+namespace Titanic {
+
+class CPetPannel3 : public CPetGraphic {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPetPannel3"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_PANNEL3_H */
diff --git a/engines/titanic/gfx/sgt_selector.cpp b/engines/titanic/gfx/sgt_selector.cpp
new file mode 100644
index 0000000..7ad126b
--- /dev/null
+++ b/engines/titanic/gfx/sgt_selector.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/sgt_selector.h"
+
+namespace Titanic {
+
+void CSGTSelector::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CSGTSelector::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/sgt_selector.h b/engines/titanic/gfx/sgt_selector.h
new file mode 100644
index 0000000..9283288
--- /dev/null
+++ b/engines/titanic/gfx/sgt_selector.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SGT_SELECTOR_H
+#define TITANIC_SGT_SELECTOR_H
+
+#include "titanic/gfx/pet_graphic.h"
+
+namespace Titanic {
+
+class CSGTSelector : public CPetGraphic {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CSGTSelector"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SGT_SELECTOR_H */
diff --git a/engines/titanic/gfx/text_down.cpp b/engines/titanic/gfx/text_down.cpp
new file mode 100644
index 0000000..d4bdfdb
--- /dev/null
+++ b/engines/titanic/gfx/text_down.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/text_down.h"
+
+namespace Titanic {
+
+void CTextDown::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CTextDown::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/text_down.h b/engines/titanic/gfx/text_down.h
new file mode 100644
index 0000000..8fc16d8
--- /dev/null
+++ b/engines/titanic/gfx/text_down.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TEXT_DOWN_H
+#define TITANIC_TEXT_DOWN_H
+
+#include "titanic/gfx/pet_graphic.h"
+
+namespace Titanic {
+
+class CTextDown : public CPetGraphic {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTextDown"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TEXT_DOWN_H */
diff --git a/engines/titanic/gfx/text_skrew.cpp b/engines/titanic/gfx/text_skrew.cpp
new file mode 100644
index 0000000..8d1f026
--- /dev/null
+++ b/engines/titanic/gfx/text_skrew.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/text_skrew.h"
+
+namespace Titanic {
+
+void CTextSkrew::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CTextSkrew::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/text_skrew.h b/engines/titanic/gfx/text_skrew.h
new file mode 100644
index 0000000..88a6a9a
--- /dev/null
+++ b/engines/titanic/gfx/text_skrew.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TEXT_SKREW_H
+#define TITANIC_TEXT_SKREW_H
+
+#include "titanic/gfx/pet_graphic.h"
+
+namespace Titanic {
+
+class CTextSkrew : public CPetGraphic {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTextSkrew"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TEXT_SKREW_H */
diff --git a/engines/titanic/gfx/text_up.cpp b/engines/titanic/gfx/text_up.cpp
new file mode 100644
index 0000000..ce3ff10
--- /dev/null
+++ b/engines/titanic/gfx/text_up.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/text_up.h"
+
+namespace Titanic {
+
+void CTextUp::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CTextUp::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/text_up.h b/engines/titanic/gfx/text_up.h
new file mode 100644
index 0000000..cce4c6c
--- /dev/null
+++ b/engines/titanic/gfx/text_up.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TEXT_UP_H
+#define TITANIC_TEXT_UP_H
+
+#include "titanic/gfx/pet_graphic.h"
+
+namespace Titanic {
+
+class CTextUp : public CPetGraphic {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CTextUp"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TEXT_UP_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 191b61b..de45be0 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -141,8 +141,6 @@ MODULE_OBJS := \
 	game/games_console.o \
 	game/get_lift_eye2.o \
 	game/glass_smasher.o \
-	game/gondolier_base.o \
-	game/gondolier_mixer.o \
 	game/hammer_clip.o \
 	game/head_slot.o \
 	game/head_smash_event.o \
@@ -172,8 +170,6 @@ MODULE_OBJS := \
 	game/nut_replacer.o \
 	game/pet_controler.o \
 	game/pet_disabler.o \
-	game/pet_graphic2.o \
-	game/pet_graphic.o \
 	game/phonograph.o \
 	game/phonograph_lid.o \
 	game/play_music_button.o \
@@ -214,6 +210,11 @@ MODULE_OBJS := \
 	game/wheel_hotspot.o \
 	game/wheel_spin.o \
 	game/wheel_spin_horn.o \
+	game/gondolier/gondolier_base.o \
+	game/gondolier/gondolier_chest.o \
+	game/gondolier/gondolier_face.o \
+	game/gondolier/gondolier_mixer.o \
+	game/gondolier/gondolier_slider.o \
 	game/maitred/maitred_arm_holder.o \
 	game/maitred/maitred_body.o \
 	game/maitred/maitred_legs.o \
@@ -290,17 +291,29 @@ MODULE_OBJS := \
 	gfx/helmet_on_off.o \
 	gfx/home_photo.o \
 	gfx/icon_nav_action.o \
+	gfx/icon_nav_butt.o \
 	gfx/icon_nav_down.o \
+	gfx/icon_nav_image.o \
 	gfx/icon_nav_left.o \
+	gfx/icon_nav_receive.o \
 	gfx/icon_nav_right.o \
+	gfx/icon_nav_send.o \
 	gfx/icon_nav_up.o \
 	gfx/keybrd_butt.o \
 	gfx/move_object_button.o \
 	gfx/music_control.o \
+	gfx/pet_drag_chev.o \
+	gfx/pet_graphic2.o \
+	gfx/pet_graphic.o \
+	gfx/pet_leaf.o \
 	gfx/pet_mode_off.o \
 	gfx/pet_mode_on.o \
 	gfx/pet_mode_panel.o \
+	gfx/pet_pannel1.o \
+	gfx/pet_pannel2.o \
+	gfx/pet_pannel3.o \
 	gfx/send_to_succ.o \
+	gfx/sgt_selector.o \
 	gfx/slider_button.o \
 	gfx/small_chev_left_off.o \
 	gfx/small_chev_left_on.o \
@@ -308,6 +321,9 @@ MODULE_OBJS := \
 	gfx/small_chev_right_on.o \
 	gfx/status_change_button.o \
 	gfx/st_button.o \
+	gfx/text_down.o \
+	gfx/text_skrew.o \
+	gfx/text_up.o \
 	gfx/toggle_button.o \
 	gfx/toggle_switch.o \
 	gfx/volume_control.o \
@@ -337,6 +353,7 @@ MODULE_OBJS := \
 	moves/pan_from_pel.o \
 	moves/restaurant_pan_handler.o \
 	moves/restricted_move.o \
+	moves/scraliontis_table.o \
 	moves/trip_down_canal.o \
 	npcs/barbot.o \
 	npcs/bellbot.o \
diff --git a/engines/titanic/moves/restaurant_pan_handler.cpp b/engines/titanic/moves/restaurant_pan_handler.cpp
index b2487a4..8efc5cb 100644
--- a/engines/titanic/moves/restaurant_pan_handler.cpp
+++ b/engines/titanic/moves/restaurant_pan_handler.cpp
@@ -24,11 +24,11 @@
 
 namespace Titanic {
 
-CRestaurantPanHandler::CRestaurantPanHandler() : CMovePlayerTo() {
-}
+int CRestaurantPanHandler::_v1;
 
 void CRestaurantPanHandler::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_v1, indent);
 	file->writeQuotedLine(_string1, indent);
 	file->writeQuotedLine(_string2, indent);
 
@@ -37,6 +37,7 @@ void CRestaurantPanHandler::save(SimpleFile *file, int indent) const {
 
 void CRestaurantPanHandler::load(SimpleFile *file) {
 	file->readNumber();
+	_v1 = file->readNumber();
 	_string1 = file->readString();
 	_string2 = file->readString();
 
diff --git a/engines/titanic/moves/restaurant_pan_handler.h b/engines/titanic/moves/restaurant_pan_handler.h
index f2f2c0c..d2db584 100644
--- a/engines/titanic/moves/restaurant_pan_handler.h
+++ b/engines/titanic/moves/restaurant_pan_handler.h
@@ -29,11 +29,11 @@ namespace Titanic {
 
 class CRestaurantPanHandler : public CMovePlayerTo {
 protected:
+	static int _v1;
+
 	CString _string1;
 	CString _string2;
 public:
-	CRestaurantPanHandler();
-
 	/**
 	 * Return the class name
 	 */
diff --git a/engines/titanic/moves/scraliontis_table.cpp b/engines/titanic/moves/scraliontis_table.cpp
new file mode 100644
index 0000000..d67b2f3
--- /dev/null
+++ b/engines/titanic/moves/scraliontis_table.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/moves/scraliontis_table.h"
+
+namespace Titanic {
+
+CScraliontisTable::CScraliontisTable() : CRestaurantPanHandler(),
+		_fieldE0(0), _fieldE4(0), _fieldE8(0), _fieldEC(0) {
+}
+
+void CScraliontisTable::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldE0, indent);
+	file->writeNumberLine(_fieldE4, indent);
+	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_fieldEC, indent);
+
+	CRestaurantPanHandler::save(file, indent);
+}
+
+void CScraliontisTable::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldE0 = file->readNumber();
+	_fieldE4 = file->readNumber();
+	_fieldE8 = file->readNumber();
+	_fieldEC = file->readNumber();
+
+	CRestaurantPanHandler::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/moves/scraliontis_table.h b/engines/titanic/moves/scraliontis_table.h
new file mode 100644
index 0000000..d7c2ad6
--- /dev/null
+++ b/engines/titanic/moves/scraliontis_table.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SCRALIONTIS_TABLE_H
+#define TITANIC_SCRALIONTIS_TABLE_H
+
+#include "titanic/moves/restaurant_pan_handler.h"
+
+namespace Titanic {
+
+class CScraliontisTable : public CRestaurantPanHandler {
+private:
+	int _fieldE0;
+	int _fieldE4;
+	int _fieldE8;
+	int _fieldEC;
+public:
+	CScraliontisTable();
+
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CScraliontisTable"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SCRALIONTIS_TABLE_H */


Commit: d07fbeb25552b9deaa00f607aaca15e51353f8da
    https://github.com/scummvm/scummvm/commit/d07fbeb25552b9deaa00f607aaca15e51353f8da
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-04T07:46:39-05:00

Commit Message:
TITANIC: Beginnings of CPetControl support classes

Changed paths:
  A engines/titanic/game/pet/pet_control.cpp
  A engines/titanic/game/pet/pet_control.h
  A engines/titanic/game/pet/pet_control_sub1.cpp
  A engines/titanic/game/pet/pet_control_sub1.h
  A engines/titanic/game/pet/pet_control_sub2.cpp
  A engines/titanic/game/pet/pet_control_sub2.h
  A engines/titanic/game/pet/pet_control_sub3.cpp
  A engines/titanic/game/pet/pet_control_sub3.h
  A engines/titanic/game/pet/pet_control_sub4.cpp
  A engines/titanic/game/pet/pet_control_sub4.h
  A engines/titanic/game/pet/pet_control_sub5.cpp
  A engines/titanic/game/pet/pet_control_sub5.h
  A engines/titanic/game/pet/pet_control_sub6.cpp
  A engines/titanic/game/pet/pet_control_sub6.h
  A engines/titanic/game/pet/pet_control_sub7.cpp
  A engines/titanic/game/pet/pet_control_sub7.h
  A engines/titanic/game/pet/pet_control_sub8.cpp
  A engines/titanic/game/pet/pet_control_sub8.h
  A engines/titanic/game/pet/pet_control_sub_base.cpp
  A engines/titanic/game/pet/pet_control_sub_base.h
  A engines/titanic/game/pet/pet_val.cpp
  A engines/titanic/game/pet/pet_val.h
  A engines/titanic/game/pet/pet_val_base.cpp
  A engines/titanic/game/pet/pet_val_base.h
  R engines/titanic/core/pet_control.cpp
  R engines/titanic/core/pet_control.h
    engines/titanic/core/project_item.cpp
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/pet_control.cpp b/engines/titanic/core/pet_control.cpp
deleted file mode 100644
index eee1826..0000000
--- a/engines/titanic/core/pet_control.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/core/pet_control.h"
-
-namespace Titanic {
-
-void CPetControl::gameLoaded() {
-	// TODO
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/core/pet_control.h b/engines/titanic/core/pet_control.h
deleted file mode 100644
index b1dc461..0000000
--- a/engines/titanic/core/pet_control.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_H
-#define TITANIC_PET_CONTROL_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CPetControl : public CGameObject {
-public:
-	/**
-	 * Called after loading a game has finished
-	 */
-	void gameLoaded();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_H */
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 7a8a082..2c3d070 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -25,8 +25,8 @@
 #include "titanic/titanic.h"
 #include "titanic/compressed_file.h"
 #include "titanic/core/dont_save_file_item.h"
-#include "titanic/core/pet_control.h"
 #include "titanic/core/project_item.h"
+#include "titanic/game/pet/pet_control.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 8966ea6..937fef9 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -70,7 +70,6 @@
 #include "titanic/core/movie_clip.h"
 #include "titanic/core/multi_drop_target.h"
 #include "titanic/core/node_item.h"
-#include "titanic/core/pet_control.h"
 #include "titanic/core/project_item.h"
 #include "titanic/core/saveable_object.h"
 #include "titanic/core/static_image.h"
@@ -162,6 +161,9 @@
 #include "titanic/game/nose_holder.h"
 #include "titanic/game/null_port_hole.h"
 #include "titanic/game/nut_replacer.h"
+#include "titanic/game/pet/pet_control.h"
+#include "titanic/game/pet/pet_control_sub_base.h"
+#include "titanic/game/pet/pet_control_sub1.h"
 #include "titanic/game/pet_disabler.h"
 #include "titanic/game/phonograph.h"
 #include "titanic/game/phonograph_lid.h"
@@ -450,7 +452,6 @@ DEFFN(CMovieClip);
 DEFFN(CMovieClipList);
 DEFFN(CMultiDropTarget);
 DEFFN(CNodeItem);
-DEFFN(CPetControl);
 DEFFN(CProjectItem);
 DEFFN(CStaticImage);
 DEFFN(CTurnOnObject);
@@ -602,6 +603,7 @@ DEFFN(CPET);
 DEFFN(CPETClass1);
 DEFFN(CPETClass2);
 DEFFN(CPETClass3);
+DEFFN(CPetControl);
 DEFFN(CPetDragChev);
 DEFFN(CPetGraphic);
 DEFFN(CPetGraphic2);
@@ -993,7 +995,6 @@ void CSaveableObject::initClassList() {
 	ADDFN(CMovieClipList);
 	ADDFN(CMultiDropTarget);
 	ADDFN(CNodeItem);
-	ADDFN(CPetControl);
 	ADDFN(CProjectItem);
 	ADDFN(CStaticImage);
 	ADDFN(CTurnOnObject);
@@ -1146,6 +1147,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CPETClass1);
 	ADDFN(CPETClass2);
 	ADDFN(CPETClass3);
+	ADDFN(CPetControl);
 	ADDFN(CPetDragChev);
 	ADDFN(CPetGraphic);
 	ADDFN(CPetGraphic2);
diff --git a/engines/titanic/game/pet/pet_control.cpp b/engines/titanic/game/pet/pet_control.cpp
new file mode 100644
index 0000000..f85b767
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control.cpp
@@ -0,0 +1,79 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_control.h"
+
+namespace Titanic {
+
+void CPetControl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	saveSubObjects(file, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPetControl::load(SimpleFile *file) {
+	int val = file->readNumber();
+	// TODO: sub_43A9E0
+	
+	if (!val) {
+		_fieldBC = file->readNumber();
+		_string1 = file->readString();
+		_string2 = file->readString();
+		
+		loadSubObjects(file);
+	}
+
+	CGameObject::load(file);
+}
+
+void CPetControl::gameLoaded() {
+	// TODO
+}
+
+void CPetControl::loadSubObjects(SimpleFile *file) {
+	_sub1.load(file);
+	_sub2.load(file);
+	_sub3.load(file);
+	_sub4.load(file);
+	_sub5.load(file);
+	_sub6.load(file);
+	_sub7.load(file);
+	_sub8.load(file);
+}
+
+void CPetControl::saveSubObjects(SimpleFile *file, int indent) const {
+	_sub1.save(file, indent);
+	_sub2.save(file, indent);
+	_sub3.save(file, indent);
+	_sub4.save(file, indent);
+	_sub5.save(file, indent);
+	_sub6.save(file, indent);
+	_sub7.save(file, indent);
+	_sub8.save(file, indent);
+}
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control.h b/engines/titanic/game/pet/pet_control.h
new file mode 100644
index 0000000..33fa11d
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control.h
@@ -0,0 +1,85 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_H
+#define TITANIC_PET_CONTROL_H
+
+#include "titanic/core/game_object.h"
+#include "titanic/game/pet/pet_control_sub1.h"
+#include "titanic/game/pet/pet_control_sub2.h"
+#include "titanic/game/pet/pet_control_sub3.h"
+#include "titanic/game/pet/pet_control_sub4.h"
+#include "titanic/game/pet/pet_control_sub5.h"
+#include "titanic/game/pet/pet_control_sub6.h"
+#include "titanic/game/pet/pet_control_sub7.h"
+#include "titanic/game/pet/pet_control_sub8.h"
+
+namespace Titanic {
+
+class CPetControl : public CGameObject {
+private:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	CPetControlSub1 _sub1;
+	CPetControlSub2 _sub2;
+	CPetControlSub3 _sub3;
+	CPetControlSub4 _sub4;
+	CPetControlSub5 _sub5;
+	CPetControlSub6 _sub6;
+	CPetControlSub7 _sub7;
+	CPetControlSub8 _sub8;
+	int _field1384;
+	CString _string1;
+	int _field1394;
+	CString _string2;
+	int _field13A4;
+private:
+	void loadSubObjects(SimpleFile *file);
+
+	void saveSubObjects(SimpleFile *file, int indent) const;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPetControl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+
+	/**
+	 * Called after loading a game has finished
+	 */
+	void gameLoaded();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_H */
diff --git a/engines/titanic/game/pet/pet_control_sub1.cpp b/engines/titanic/game/pet/pet_control_sub1.cpp
new file mode 100644
index 0000000..5aa84bd
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub1.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_control_sub1.h"
+
+namespace Titanic {
+
+void CPetControlSub1::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub1::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub1.h b/engines/titanic/game/pet/pet_control_sub1.h
new file mode 100644
index 0000000..31e1129
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub1.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB1_H
+#define TITANIC_PET_CONTROL_SUB1_H
+
+#include "titanic/game/pet/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub1 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_H */
diff --git a/engines/titanic/game/pet/pet_control_sub2.cpp b/engines/titanic/game/pet/pet_control_sub2.cpp
new file mode 100644
index 0000000..c8c905e
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub2.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_control_sub2.h"
+
+namespace Titanic {
+
+void CPetControlSub2::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub2::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub2.h b/engines/titanic/game/pet/pet_control_sub2.h
new file mode 100644
index 0000000..c4e2b20
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub2.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB2_H
+#define TITANIC_PET_CONTROL_SUB2_H
+
+#include "titanic/game/pet/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub2 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB2_H */
diff --git a/engines/titanic/game/pet/pet_control_sub3.cpp b/engines/titanic/game/pet/pet_control_sub3.cpp
new file mode 100644
index 0000000..5504b13
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub3.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_control_sub3.h"
+
+namespace Titanic {
+
+void CPetControlSub3::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub3::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub3.h b/engines/titanic/game/pet/pet_control_sub3.h
new file mode 100644
index 0000000..1b67a1e
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub3.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB3_H
+#define TITANIC_PET_CONTROL_SUB3_H
+
+#include "titanic/game/pet/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub3 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB3_H */
diff --git a/engines/titanic/game/pet/pet_control_sub4.cpp b/engines/titanic/game/pet/pet_control_sub4.cpp
new file mode 100644
index 0000000..eb605b8
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub4.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_control_sub4.h"
+
+namespace Titanic {
+
+void CPetControlSub4::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub4::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub4.h b/engines/titanic/game/pet/pet_control_sub4.h
new file mode 100644
index 0000000..426137e
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub4.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB4_H
+#define TITANIC_PET_CONTROL_SUB4_H
+
+#include "titanic/game/pet/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub4 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB4_H */
diff --git a/engines/titanic/game/pet/pet_control_sub5.cpp b/engines/titanic/game/pet/pet_control_sub5.cpp
new file mode 100644
index 0000000..d46b3db
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub5.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_control_sub5.h"
+
+namespace Titanic {
+
+void CPetControlSub5::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub5::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub5.h b/engines/titanic/game/pet/pet_control_sub5.h
new file mode 100644
index 0000000..d76cf8f
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub5.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB5_H
+#define TITANIC_PET_CONTROL_SUB5_H
+
+#include "titanic/game/pet/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub5 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB5_H */
diff --git a/engines/titanic/game/pet/pet_control_sub6.cpp b/engines/titanic/game/pet/pet_control_sub6.cpp
new file mode 100644
index 0000000..2a3f26e
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub6.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_control_sub6.h"
+
+namespace Titanic {
+
+void CPetControlSub6::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub6::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub6.h b/engines/titanic/game/pet/pet_control_sub6.h
new file mode 100644
index 0000000..4417665
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub6.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB6_H
+#define TITANIC_PET_CONTROL_SUB6_H
+
+#include "titanic/game/pet/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub6 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB6_H */
diff --git a/engines/titanic/game/pet/pet_control_sub7.cpp b/engines/titanic/game/pet/pet_control_sub7.cpp
new file mode 100644
index 0000000..7be9b11
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub7.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_control_sub7.h"
+
+namespace Titanic {
+
+void CPetControlSub7::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub7::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub7.h b/engines/titanic/game/pet/pet_control_sub7.h
new file mode 100644
index 0000000..cc42f9e
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub7.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB7_H
+#define TITANIC_PET_CONTROL_SUB7_H
+
+#include "titanic/game/pet/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub7 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB7_H */
diff --git a/engines/titanic/game/pet/pet_control_sub8.cpp b/engines/titanic/game/pet/pet_control_sub8.cpp
new file mode 100644
index 0000000..f88e8fd
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub8.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_control_sub8.h"
+
+namespace Titanic {
+
+void CPetControlSub8::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub8::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub8.h b/engines/titanic/game/pet/pet_control_sub8.h
new file mode 100644
index 0000000..76dc6b1
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub8.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB8_H
+#define TITANIC_PET_CONTROL_SUB8_H
+
+#include "titanic/game/pet/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub8 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB8_H */
diff --git a/engines/titanic/game/pet/pet_control_sub_base.cpp b/engines/titanic/game/pet/pet_control_sub_base.cpp
new file mode 100644
index 0000000..9afb188
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub_base.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_control_sub_base.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub_base.h b/engines/titanic/game/pet/pet_control_sub_base.h
new file mode 100644
index 0000000..b11f5cc
--- /dev/null
+++ b/engines/titanic/game/pet/pet_control_sub_base.h
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB_BASE_H
+#define TITANIC_PET_CONTROL_SUB_BASE_H
+
+#include "titanic/simple_file.h"
+
+namespace Titanic {
+
+class CPetControlSubBase {
+protected:
+	int _field4;
+public:
+	CPetControlSubBase() : _field4(0) {}
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const = 0;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file) = 0;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB_BASE_H */
diff --git a/engines/titanic/game/pet/pet_val.cpp b/engines/titanic/game/pet/pet_val.cpp
new file mode 100644
index 0000000..b978a8b
--- /dev/null
+++ b/engines/titanic/game/pet/pet_val.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_val.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_val.h b/engines/titanic/game/pet/pet_val.h
new file mode 100644
index 0000000..f5cae82
--- /dev/null
+++ b/engines/titanic/game/pet/pet_val.h
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_VAL_H
+#define TITANIC_PET_VAL_H
+
+#include "titanic/game/pet/pet_val_base.h"
+
+namespace Titanic {
+
+class CPetVal: public CPetValBase {
+private:
+	int _field18;
+	int _field1C;
+	int _field20;
+public:
+	CPetVal() : CPetValBase(), _field18(0), _field1C(0), _field20(0) {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_VAL_H */
diff --git a/engines/titanic/game/pet/pet_val_base.cpp b/engines/titanic/game/pet/pet_val_base.cpp
new file mode 100644
index 0000000..d77f366
--- /dev/null
+++ b/engines/titanic/game/pet/pet_val_base.cpp
@@ -0,0 +1,31 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/pet/pet_val_base.h"
+
+namespace Titanic {
+
+CPetValBase::CPetValBase() : _field4(0), _field8(0),
+	_fieldC(0), _field10(0), _field14(0) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_val_base.h b/engines/titanic/game/pet/pet_val_base.h
new file mode 100644
index 0000000..310b067
--- /dev/null
+++ b/engines/titanic/game/pet/pet_val_base.h
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_VAL_BASE_H
+#define TITANIC_PET_VAL_BASE_H
+
+namespace Titanic {
+
+class CPetValBase {
+protected:
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+public:
+	CPetValBase();
+
+	virtual void proc1() {}
+	virtual void proc2() {}
+	virtual void proc3() {}
+	virtual void proc4() {}
+
+	virtual void proc5() {}
+
+	virtual void proc6() {}
+	virtual void proc7() {}
+	virtual void proc8() {}
+	virtual void proc9() {}
+	virtual void proc10() {}
+	virtual void proc11() {}
+	virtual void proc12() {}
+	virtual void proc13() {}
+	virtual void proc14() {}
+	virtual void proc15() {}
+	virtual void proc16() {}
+	virtual void proc17() {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_VAL_BASE_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index de45be0..9edb440 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -67,7 +67,6 @@ MODULE_OBJS := \
 	core/multi_drop_target.o \
 	core/named_item.o \
 	core/node_item.o \
-	core/pet_control.o \
 	core/project_item.o \
 	core/resource_key.o \
 	core/saveable_object.o \
@@ -236,12 +235,24 @@ MODULE_OBJS := \
 	game/pet/pet_class3.o \
 	game/pet/pet_lift.o \
 	game/pet/pet_monitor.o \
+	game/pet/pet_control.o \
+	game/pet/pet_control_sub_base.o \
+	game/pet/pet_control_sub1.o \
+	game/pet/pet_control_sub2.o \
+	game/pet/pet_control_sub3.o \
+	game/pet/pet_control_sub4.o \
+	game/pet/pet_control_sub5.o \
+	game/pet/pet_control_sub6.o \
+	game/pet/pet_control_sub7.o \
+	game/pet/pet_control_sub8.o \
 	game/pet/pet_pellerator.o \
 	game/pet/pet_position.o \
 	game/pet/pet_sentinal.o \
 	game/pet/pet_sounds.o \
 	game/pet/pet_transition.o \
 	game/pet/pet_transport.o \
+	game/pet/pet_val_base.o \
+	game/pet/pet_val.o \
 	game/pickup/pick_up.o \
 	game/pickup/pick_up_bar_glass.o \
 	game/pickup/pick_up_hose.o \


Commit: 61518fb20882d556615a025074659cdd2f89fb69
    https://github.com/scummvm/scummvm/commit/61518fb20882d556615a025074659cdd2f89fb69
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-04T20:21:02-05:00

Commit Message:
TITANIC: Move CPetControl and direct support classes to new folder

Changed paths:
  A engines/titanic/pet_control/pet_control.cpp
  A engines/titanic/pet_control/pet_control.h
  A engines/titanic/pet_control/pet_control_sub1.cpp
  A engines/titanic/pet_control/pet_control_sub1.h
  A engines/titanic/pet_control/pet_control_sub2.cpp
  A engines/titanic/pet_control/pet_control_sub2.h
  A engines/titanic/pet_control/pet_control_sub3.cpp
  A engines/titanic/pet_control/pet_control_sub3.h
  A engines/titanic/pet_control/pet_control_sub4.cpp
  A engines/titanic/pet_control/pet_control_sub4.h
  A engines/titanic/pet_control/pet_control_sub5.cpp
  A engines/titanic/pet_control/pet_control_sub5.h
  A engines/titanic/pet_control/pet_control_sub6.cpp
  A engines/titanic/pet_control/pet_control_sub6.h
  A engines/titanic/pet_control/pet_control_sub7.cpp
  A engines/titanic/pet_control/pet_control_sub7.h
  A engines/titanic/pet_control/pet_control_sub8.cpp
  A engines/titanic/pet_control/pet_control_sub8.h
  A engines/titanic/pet_control/pet_control_sub_base.cpp
  A engines/titanic/pet_control/pet_control_sub_base.h
  R engines/titanic/game/pet/pet_control.cpp
  R engines/titanic/game/pet/pet_control.h
  R engines/titanic/game/pet/pet_control_sub1.cpp
  R engines/titanic/game/pet/pet_control_sub1.h
  R engines/titanic/game/pet/pet_control_sub2.cpp
  R engines/titanic/game/pet/pet_control_sub2.h
  R engines/titanic/game/pet/pet_control_sub3.cpp
  R engines/titanic/game/pet/pet_control_sub3.h
  R engines/titanic/game/pet/pet_control_sub4.cpp
  R engines/titanic/game/pet/pet_control_sub4.h
  R engines/titanic/game/pet/pet_control_sub5.cpp
  R engines/titanic/game/pet/pet_control_sub5.h
  R engines/titanic/game/pet/pet_control_sub6.cpp
  R engines/titanic/game/pet/pet_control_sub6.h
  R engines/titanic/game/pet/pet_control_sub7.cpp
  R engines/titanic/game/pet/pet_control_sub7.h
  R engines/titanic/game/pet/pet_control_sub8.cpp
  R engines/titanic/game/pet/pet_control_sub8.h
  R engines/titanic/game/pet/pet_control_sub_base.cpp
  R engines/titanic/game/pet/pet_control_sub_base.h
    engines/titanic/core/project_item.cpp
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 2c3d070..e759b87 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -26,7 +26,7 @@
 #include "titanic/compressed_file.h"
 #include "titanic/core/dont_save_file_item.h"
 #include "titanic/core/project_item.h"
-#include "titanic/game/pet/pet_control.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 937fef9..dcd47b7 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -161,9 +161,6 @@
 #include "titanic/game/nose_holder.h"
 #include "titanic/game/null_port_hole.h"
 #include "titanic/game/nut_replacer.h"
-#include "titanic/game/pet/pet_control.h"
-#include "titanic/game/pet/pet_control_sub_base.h"
-#include "titanic/game/pet/pet_control_sub1.h"
 #include "titanic/game/pet_disabler.h"
 #include "titanic/game/phonograph.h"
 #include "titanic/game/phonograph_lid.h"
@@ -372,6 +369,8 @@
 #include "titanic/npcs/summon_bots.h"
 #include "titanic/npcs/titania.h"
 
+#include "titanic/pet_control/pet_control.h"
+
 #include "titanic/sound/auto_music_player.h"
 #include "titanic/sound/auto_music_player_base.h"
 #include "titanic/sound/auto_sound_player.h"
diff --git a/engines/titanic/game/pet/pet_control.cpp b/engines/titanic/game/pet/pet_control.cpp
deleted file mode 100644
index f85b767..0000000
--- a/engines/titanic/game/pet/pet_control.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet/pet_control.h"
-
-namespace Titanic {
-
-void CPetControl::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(0, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeQuotedLine(_string2, indent);
-
-	saveSubObjects(file, indent);
-	CGameObject::save(file, indent);
-}
-
-void CPetControl::load(SimpleFile *file) {
-	int val = file->readNumber();
-	// TODO: sub_43A9E0
-	
-	if (!val) {
-		_fieldBC = file->readNumber();
-		_string1 = file->readString();
-		_string2 = file->readString();
-		
-		loadSubObjects(file);
-	}
-
-	CGameObject::load(file);
-}
-
-void CPetControl::gameLoaded() {
-	// TODO
-}
-
-void CPetControl::loadSubObjects(SimpleFile *file) {
-	_sub1.load(file);
-	_sub2.load(file);
-	_sub3.load(file);
-	_sub4.load(file);
-	_sub5.load(file);
-	_sub6.load(file);
-	_sub7.load(file);
-	_sub8.load(file);
-}
-
-void CPetControl::saveSubObjects(SimpleFile *file, int indent) const {
-	_sub1.save(file, indent);
-	_sub2.save(file, indent);
-	_sub3.save(file, indent);
-	_sub4.save(file, indent);
-	_sub5.save(file, indent);
-	_sub6.save(file, indent);
-	_sub7.save(file, indent);
-	_sub8.save(file, indent);
-}
-
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control.h b/engines/titanic/game/pet/pet_control.h
deleted file mode 100644
index 33fa11d..0000000
--- a/engines/titanic/game/pet/pet_control.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_H
-#define TITANIC_PET_CONTROL_H
-
-#include "titanic/core/game_object.h"
-#include "titanic/game/pet/pet_control_sub1.h"
-#include "titanic/game/pet/pet_control_sub2.h"
-#include "titanic/game/pet/pet_control_sub3.h"
-#include "titanic/game/pet/pet_control_sub4.h"
-#include "titanic/game/pet/pet_control_sub5.h"
-#include "titanic/game/pet/pet_control_sub6.h"
-#include "titanic/game/pet/pet_control_sub7.h"
-#include "titanic/game/pet/pet_control_sub8.h"
-
-namespace Titanic {
-
-class CPetControl : public CGameObject {
-private:
-	int _fieldBC;
-	int _fieldC0;
-	int _fieldC4;
-	int _fieldC8;
-	CPetControlSub1 _sub1;
-	CPetControlSub2 _sub2;
-	CPetControlSub3 _sub3;
-	CPetControlSub4 _sub4;
-	CPetControlSub5 _sub5;
-	CPetControlSub6 _sub6;
-	CPetControlSub7 _sub7;
-	CPetControlSub8 _sub8;
-	int _field1384;
-	CString _string1;
-	int _field1394;
-	CString _string2;
-	int _field13A4;
-private:
-	void loadSubObjects(SimpleFile *file);
-
-	void saveSubObjects(SimpleFile *file, int indent) const;
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPetControl"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-
-	/**
-	 * Called after loading a game has finished
-	 */
-	void gameLoaded();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_H */
diff --git a/engines/titanic/game/pet/pet_control_sub1.cpp b/engines/titanic/game/pet/pet_control_sub1.cpp
deleted file mode 100644
index 5aa84bd..0000000
--- a/engines/titanic/game/pet/pet_control_sub1.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet/pet_control_sub1.h"
-
-namespace Titanic {
-
-void CPetControlSub1::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub1::load(SimpleFile *file) {
-
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub1.h b/engines/titanic/game/pet/pet_control_sub1.h
deleted file mode 100644
index 31e1129..0000000
--- a/engines/titanic/game/pet/pet_control_sub1.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB1_H
-#define TITANIC_PET_CONTROL_SUB1_H
-
-#include "titanic/game/pet/pet_control_sub_base.h"
-
-namespace Titanic {
-
-class CPetControlSub1 : public CPetControlSubBase {
-public:
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_H */
diff --git a/engines/titanic/game/pet/pet_control_sub2.cpp b/engines/titanic/game/pet/pet_control_sub2.cpp
deleted file mode 100644
index c8c905e..0000000
--- a/engines/titanic/game/pet/pet_control_sub2.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet/pet_control_sub2.h"
-
-namespace Titanic {
-
-void CPetControlSub2::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub2::load(SimpleFile *file) {
-
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub2.h b/engines/titanic/game/pet/pet_control_sub2.h
deleted file mode 100644
index c4e2b20..0000000
--- a/engines/titanic/game/pet/pet_control_sub2.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB2_H
-#define TITANIC_PET_CONTROL_SUB2_H
-
-#include "titanic/game/pet/pet_control_sub_base.h"
-
-namespace Titanic {
-
-class CPetControlSub2 : public CPetControlSubBase {
-public:
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB2_H */
diff --git a/engines/titanic/game/pet/pet_control_sub3.cpp b/engines/titanic/game/pet/pet_control_sub3.cpp
deleted file mode 100644
index 5504b13..0000000
--- a/engines/titanic/game/pet/pet_control_sub3.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet/pet_control_sub3.h"
-
-namespace Titanic {
-
-void CPetControlSub3::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub3::load(SimpleFile *file) {
-
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub3.h b/engines/titanic/game/pet/pet_control_sub3.h
deleted file mode 100644
index 1b67a1e..0000000
--- a/engines/titanic/game/pet/pet_control_sub3.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB3_H
-#define TITANIC_PET_CONTROL_SUB3_H
-
-#include "titanic/game/pet/pet_control_sub_base.h"
-
-namespace Titanic {
-
-class CPetControlSub3 : public CPetControlSubBase {
-public:
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB3_H */
diff --git a/engines/titanic/game/pet/pet_control_sub4.cpp b/engines/titanic/game/pet/pet_control_sub4.cpp
deleted file mode 100644
index eb605b8..0000000
--- a/engines/titanic/game/pet/pet_control_sub4.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet/pet_control_sub4.h"
-
-namespace Titanic {
-
-void CPetControlSub4::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub4::load(SimpleFile *file) {
-
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub4.h b/engines/titanic/game/pet/pet_control_sub4.h
deleted file mode 100644
index 426137e..0000000
--- a/engines/titanic/game/pet/pet_control_sub4.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB4_H
-#define TITANIC_PET_CONTROL_SUB4_H
-
-#include "titanic/game/pet/pet_control_sub_base.h"
-
-namespace Titanic {
-
-class CPetControlSub4 : public CPetControlSubBase {
-public:
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB4_H */
diff --git a/engines/titanic/game/pet/pet_control_sub5.cpp b/engines/titanic/game/pet/pet_control_sub5.cpp
deleted file mode 100644
index d46b3db..0000000
--- a/engines/titanic/game/pet/pet_control_sub5.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet/pet_control_sub5.h"
-
-namespace Titanic {
-
-void CPetControlSub5::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub5::load(SimpleFile *file) {
-
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub5.h b/engines/titanic/game/pet/pet_control_sub5.h
deleted file mode 100644
index d76cf8f..0000000
--- a/engines/titanic/game/pet/pet_control_sub5.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB5_H
-#define TITANIC_PET_CONTROL_SUB5_H
-
-#include "titanic/game/pet/pet_control_sub_base.h"
-
-namespace Titanic {
-
-class CPetControlSub5 : public CPetControlSubBase {
-public:
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB5_H */
diff --git a/engines/titanic/game/pet/pet_control_sub6.cpp b/engines/titanic/game/pet/pet_control_sub6.cpp
deleted file mode 100644
index 2a3f26e..0000000
--- a/engines/titanic/game/pet/pet_control_sub6.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet/pet_control_sub6.h"
-
-namespace Titanic {
-
-void CPetControlSub6::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub6::load(SimpleFile *file) {
-
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub6.h b/engines/titanic/game/pet/pet_control_sub6.h
deleted file mode 100644
index 4417665..0000000
--- a/engines/titanic/game/pet/pet_control_sub6.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB6_H
-#define TITANIC_PET_CONTROL_SUB6_H
-
-#include "titanic/game/pet/pet_control_sub_base.h"
-
-namespace Titanic {
-
-class CPetControlSub6 : public CPetControlSubBase {
-public:
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB6_H */
diff --git a/engines/titanic/game/pet/pet_control_sub7.cpp b/engines/titanic/game/pet/pet_control_sub7.cpp
deleted file mode 100644
index 7be9b11..0000000
--- a/engines/titanic/game/pet/pet_control_sub7.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet/pet_control_sub7.h"
-
-namespace Titanic {
-
-void CPetControlSub7::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub7::load(SimpleFile *file) {
-
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub7.h b/engines/titanic/game/pet/pet_control_sub7.h
deleted file mode 100644
index cc42f9e..0000000
--- a/engines/titanic/game/pet/pet_control_sub7.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB7_H
-#define TITANIC_PET_CONTROL_SUB7_H
-
-#include "titanic/game/pet/pet_control_sub_base.h"
-
-namespace Titanic {
-
-class CPetControlSub7 : public CPetControlSubBase {
-public:
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB7_H */
diff --git a/engines/titanic/game/pet/pet_control_sub8.cpp b/engines/titanic/game/pet/pet_control_sub8.cpp
deleted file mode 100644
index f88e8fd..0000000
--- a/engines/titanic/game/pet/pet_control_sub8.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet/pet_control_sub8.h"
-
-namespace Titanic {
-
-void CPetControlSub8::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub8::load(SimpleFile *file) {
-
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub8.h b/engines/titanic/game/pet/pet_control_sub8.h
deleted file mode 100644
index 76dc6b1..0000000
--- a/engines/titanic/game/pet/pet_control_sub8.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB8_H
-#define TITANIC_PET_CONTROL_SUB8_H
-
-#include "titanic/game/pet/pet_control_sub_base.h"
-
-namespace Titanic {
-
-class CPetControlSub8 : public CPetControlSubBase {
-public:
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB8_H */
diff --git a/engines/titanic/game/pet/pet_control_sub_base.cpp b/engines/titanic/game/pet/pet_control_sub_base.cpp
deleted file mode 100644
index 9afb188..0000000
--- a/engines/titanic/game/pet/pet_control_sub_base.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet/pet_control_sub_base.h"
-
-namespace Titanic {
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_control_sub_base.h b/engines/titanic/game/pet/pet_control_sub_base.h
deleted file mode 100644
index b11f5cc..0000000
--- a/engines/titanic/game/pet/pet_control_sub_base.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB_BASE_H
-#define TITANIC_PET_CONTROL_SUB_BASE_H
-
-#include "titanic/simple_file.h"
-
-namespace Titanic {
-
-class CPetControlSubBase {
-protected:
-	int _field4;
-public:
-	CPetControlSubBase() : _field4(0) {}
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const = 0;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file) = 0;
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB_BASE_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 9edb440..922878b 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -235,16 +235,6 @@ MODULE_OBJS := \
 	game/pet/pet_class3.o \
 	game/pet/pet_lift.o \
 	game/pet/pet_monitor.o \
-	game/pet/pet_control.o \
-	game/pet/pet_control_sub_base.o \
-	game/pet/pet_control_sub1.o \
-	game/pet/pet_control_sub2.o \
-	game/pet/pet_control_sub3.o \
-	game/pet/pet_control_sub4.o \
-	game/pet/pet_control_sub5.o \
-	game/pet/pet_control_sub6.o \
-	game/pet/pet_control_sub7.o \
-	game/pet/pet_control_sub8.o \
 	game/pet/pet_pellerator.o \
 	game/pet/pet_position.o \
 	game/pet/pet_sentinal.o \
@@ -382,6 +372,16 @@ MODULE_OBJS := \
 	npcs/summon_bots.o \
 	npcs/titania.o \
 	npcs/true_talk_npc.o \
+	pet_control/pet_control.o \
+	pet_control/pet_control_sub_base.o \
+	pet_control/pet_control_sub1.o \
+	pet_control/pet_control_sub2.o \
+	pet_control/pet_control_sub3.o \
+	pet_control/pet_control_sub4.o \
+	pet_control/pet_control_sub5.o \
+	pet_control/pet_control_sub6.o \
+	pet_control/pet_control_sub7.o \
+	pet_control/pet_control_sub8.o \
 	sound/auto_music_player.o \
 	sound/auto_music_player_base.o \
 	sound/auto_sound_player.o \
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
new file mode 100644
index 0000000..354ed39
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -0,0 +1,79 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control.h"
+
+namespace Titanic {
+
+void CPetControl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+
+	saveSubObjects(file, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPetControl::load(SimpleFile *file) {
+	int val = file->readNumber();
+	// TODO: sub_43A9E0
+	
+	if (!val) {
+		_fieldBC = file->readNumber();
+		_string1 = file->readString();
+		_string2 = file->readString();
+		
+		loadSubObjects(file);
+	}
+
+	CGameObject::load(file);
+}
+
+void CPetControl::gameLoaded() {
+	// TODO
+}
+
+void CPetControl::loadSubObjects(SimpleFile *file) {
+	_sub1.load(file);
+	_sub2.load(file);
+	_sub3.load(file);
+	_sub4.load(file);
+	_sub5.load(file);
+	_sub6.load(file);
+	_sub7.load(file);
+	_sub8.load(file);
+}
+
+void CPetControl::saveSubObjects(SimpleFile *file, int indent) const {
+	_sub1.save(file, indent);
+	_sub2.save(file, indent);
+	_sub3.save(file, indent);
+	_sub4.save(file, indent);
+	_sub5.save(file, indent);
+	_sub6.save(file, indent);
+	_sub7.save(file, indent);
+	_sub8.save(file, indent);
+}
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
new file mode 100644
index 0000000..dab4426
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control.h
@@ -0,0 +1,85 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_H
+#define TITANIC_PET_CONTROL_H
+
+#include "titanic/core/game_object.h"
+#include "titanic/pet_control/pet_control_sub1.h"
+#include "titanic/pet_control/pet_control_sub2.h"
+#include "titanic/pet_control/pet_control_sub3.h"
+#include "titanic/pet_control/pet_control_sub4.h"
+#include "titanic/pet_control/pet_control_sub5.h"
+#include "titanic/pet_control/pet_control_sub6.h"
+#include "titanic/pet_control/pet_control_sub7.h"
+#include "titanic/pet_control/pet_control_sub8.h"
+
+namespace Titanic {
+
+class CPetControl : public CGameObject {
+private:
+	int _fieldBC;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	CPetControlSub1 _sub1;
+	CPetControlSub2 _sub2;
+	CPetControlSub3 _sub3;
+	CPetControlSub4 _sub4;
+	CPetControlSub5 _sub5;
+	CPetControlSub6 _sub6;
+	CPetControlSub7 _sub7;
+	CPetControlSub8 _sub8;
+	int _field1384;
+	CString _string1;
+	int _field1394;
+	CString _string2;
+	int _field13A4;
+private:
+	void loadSubObjects(SimpleFile *file);
+
+	void saveSubObjects(SimpleFile *file, int indent) const;
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CPetControl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+
+	/**
+	 * Called after loading a game has finished
+	 */
+	void gameLoaded();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_H */
diff --git a/engines/titanic/pet_control/pet_control_sub1.cpp b/engines/titanic/pet_control/pet_control_sub1.cpp
new file mode 100644
index 0000000..8083586
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub1.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control_sub1.h"
+
+namespace Titanic {
+
+void CPetControlSub1::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub1::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub1.h b/engines/titanic/pet_control/pet_control_sub1.h
new file mode 100644
index 0000000..5e38523
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub1.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB1_H
+#define TITANIC_PET_CONTROL_SUB1_H
+
+#include "titanic/pet_control/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub1 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_H */
diff --git a/engines/titanic/pet_control/pet_control_sub2.cpp b/engines/titanic/pet_control/pet_control_sub2.cpp
new file mode 100644
index 0000000..a48869e
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub2.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control_sub2.h"
+
+namespace Titanic {
+
+void CPetControlSub2::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub2::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub2.h b/engines/titanic/pet_control/pet_control_sub2.h
new file mode 100644
index 0000000..a54142c
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub2.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB2_H
+#define TITANIC_PET_CONTROL_SUB2_H
+
+#include "titanic/pet_control/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub2 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB2_H */
diff --git a/engines/titanic/pet_control/pet_control_sub3.cpp b/engines/titanic/pet_control/pet_control_sub3.cpp
new file mode 100644
index 0000000..2f508be
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub3.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control_sub3.h"
+
+namespace Titanic {
+
+void CPetControlSub3::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub3::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub3.h b/engines/titanic/pet_control/pet_control_sub3.h
new file mode 100644
index 0000000..1b37628
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub3.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB3_H
+#define TITANIC_PET_CONTROL_SUB3_H
+
+#include "titanic/pet_control/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub3 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB3_H */
diff --git a/engines/titanic/pet_control/pet_control_sub4.cpp b/engines/titanic/pet_control/pet_control_sub4.cpp
new file mode 100644
index 0000000..35367a6
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub4.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control_sub4.h"
+
+namespace Titanic {
+
+void CPetControlSub4::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub4::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub4.h b/engines/titanic/pet_control/pet_control_sub4.h
new file mode 100644
index 0000000..b00acff
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub4.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB4_H
+#define TITANIC_PET_CONTROL_SUB4_H
+
+#include "titanic/pet_control/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub4 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB4_H */
diff --git a/engines/titanic/pet_control/pet_control_sub5.cpp b/engines/titanic/pet_control/pet_control_sub5.cpp
new file mode 100644
index 0000000..461fb1e
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub5.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control_sub5.h"
+
+namespace Titanic {
+
+void CPetControlSub5::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub5::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub5.h b/engines/titanic/pet_control/pet_control_sub5.h
new file mode 100644
index 0000000..2142a10
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub5.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB5_H
+#define TITANIC_PET_CONTROL_SUB5_H
+
+#include "titanic/pet_control/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub5 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB5_H */
diff --git a/engines/titanic/pet_control/pet_control_sub6.cpp b/engines/titanic/pet_control/pet_control_sub6.cpp
new file mode 100644
index 0000000..d33ea1f
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub6.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control_sub6.h"
+
+namespace Titanic {
+
+void CPetControlSub6::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub6::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub6.h b/engines/titanic/pet_control/pet_control_sub6.h
new file mode 100644
index 0000000..d26c8f2
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub6.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB6_H
+#define TITANIC_PET_CONTROL_SUB6_H
+
+#include "titanic/pet_control/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub6 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB6_H */
diff --git a/engines/titanic/pet_control/pet_control_sub7.cpp b/engines/titanic/pet_control/pet_control_sub7.cpp
new file mode 100644
index 0000000..8333dc1
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub7.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control_sub7.h"
+
+namespace Titanic {
+
+void CPetControlSub7::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub7::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub7.h b/engines/titanic/pet_control/pet_control_sub7.h
new file mode 100644
index 0000000..660fe2a
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub7.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB7_H
+#define TITANIC_PET_CONTROL_SUB7_H
+
+#include "titanic/pet_control/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub7 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB7_H */
diff --git a/engines/titanic/pet_control/pet_control_sub8.cpp b/engines/titanic/pet_control/pet_control_sub8.cpp
new file mode 100644
index 0000000..4716308
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub8.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control_sub8.h"
+
+namespace Titanic {
+
+void CPetControlSub8::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetControlSub8::load(SimpleFile *file) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub8.h b/engines/titanic/pet_control/pet_control_sub8.h
new file mode 100644
index 0000000..e6de1f8
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub8.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB8_H
+#define TITANIC_PET_CONTROL_SUB8_H
+
+#include "titanic/pet_control/pet_control_sub_base.h"
+
+namespace Titanic {
+
+class CPetControlSub8 : public CPetControlSubBase {
+public:
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB8_H */
diff --git a/engines/titanic/pet_control/pet_control_sub_base.cpp b/engines/titanic/pet_control/pet_control_sub_base.cpp
new file mode 100644
index 0000000..3519431
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub_base.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control_sub_base.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub_base.h b/engines/titanic/pet_control/pet_control_sub_base.h
new file mode 100644
index 0000000..b11f5cc
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub_base.h
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB_BASE_H
+#define TITANIC_PET_CONTROL_SUB_BASE_H
+
+#include "titanic/simple_file.h"
+
+namespace Titanic {
+
+class CPetControlSubBase {
+protected:
+	int _field4;
+public:
+	CPetControlSubBase() : _field4(0) {}
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const = 0;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file) = 0;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB_BASE_H */


Commit: e03a1106628e2d3e954c67c21bada5eae07c5c7d
    https://github.com/scummvm/scummvm/commit/e03a1106628e2d3e954c67c21bada5eae07c5c7d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-04T23:37:40-05:00

Commit Message:
TITANIC: Fleshing out CPetControl support classes

Changed paths:
  A engines/titanic/pet_control/pet_control_list_item.cpp
  A engines/titanic/pet_control/pet_control_list_item.h
  A engines/titanic/pet_control/pet_control_list_item2.cpp
  A engines/titanic/pet_control/pet_control_list_item2.h
  A engines/titanic/pet_control/pet_control_sub10.cpp
  A engines/titanic/pet_control/pet_control_sub10.h
  A engines/titanic/pet_control/pet_control_sub11.cpp
  A engines/titanic/pet_control/pet_control_sub11.h
  A engines/titanic/pet_control/pet_control_sub12.cpp
  A engines/titanic/pet_control/pet_control_sub12.h
  A engines/titanic/pet_control/pet_val.cpp
  A engines/titanic/pet_control/pet_val.h
  A engines/titanic/pet_control/pet_val_base.cpp
  A engines/titanic/pet_control/pet_val_base.h
    engines/titanic/core/link_item.cpp
    engines/titanic/core/link_item.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control_sub1.cpp
    engines/titanic/pet_control/pet_control_sub1.h
    engines/titanic/pet_control/pet_control_sub2.cpp
    engines/titanic/pet_control/pet_control_sub2.h
    engines/titanic/pet_control/pet_control_sub3.h
    engines/titanic/pet_control/pet_control_sub4.cpp
    engines/titanic/pet_control/pet_control_sub4.h
    engines/titanic/pet_control/pet_control_sub5.h
    engines/titanic/pet_control/pet_control_sub6.h
    engines/titanic/pet_control/pet_control_sub7.h
    engines/titanic/pet_control/pet_control_sub8.cpp
    engines/titanic/pet_control/pet_control_sub8.h
    engines/titanic/pet_control/pet_control_sub_base.cpp
    engines/titanic/pet_control/pet_control_sub_base.h



diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp
index 1d85dfa..9a895b7 100644
--- a/engines/titanic/core/link_item.cpp
+++ b/engines/titanic/core/link_item.cpp
@@ -24,9 +24,15 @@
 
 namespace Titanic {
 
-CLinkItemSub::CLinkItemSub() : _field0(0), _field4(0), _field8(0), _fieldC(0) {
+void CLinkItemSub::clear() {
+	_field0 = 0;
+	_field4 = 0;
+	_field8 = 0;
+	_fieldC = 0;
 }
 
+/*------------------------------------------------------------------------*/
+
 CLinkItem::CLinkItem() : CNamedItem() {
 	_field24 = -1;
 	_field28 = -1;
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index 22c07a2..aeb827e 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -34,7 +34,9 @@ public:
 	int _field8;
 	int _fieldC;
 public:
-	CLinkItemSub();
+	CLinkItemSub() { clear(); }
+
+	void clear();
 };
 
 class CLinkItem : public CNamedItem {
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 922878b..62dbdcb 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -373,7 +373,11 @@ MODULE_OBJS := \
 	npcs/titania.o \
 	npcs/true_talk_npc.o \
 	pet_control/pet_control.o \
+	pet_control/pet_control_list_item.o \
+	pet_control/pet_control_list_item2.o \
 	pet_control/pet_control_sub_base.o \
+	pet_control/pet_control_sub_list_item.o \
+	pet_control/pet_control_sub_list_item2.o \
 	pet_control/pet_control_sub1.o \
 	pet_control/pet_control_sub2.o \
 	pet_control/pet_control_sub3.o \
@@ -382,6 +386,11 @@ MODULE_OBJS := \
 	pet_control/pet_control_sub6.o \
 	pet_control/pet_control_sub7.o \
 	pet_control/pet_control_sub8.o \
+	pet_control/pet_control_sub10.o \
+	pet_control/pet_control_sub11.o \
+	pet_control/pet_control_sub12.o \
+	pet_control/pet_val_base.o \
+	pet_control/pet_val.o \
 	sound/auto_music_player.o \
 	sound/auto_music_player_base.o \
 	sound/auto_sound_player.o \
diff --git a/engines/titanic/pet_control/pet_control_list_item.cpp b/engines/titanic/pet_control/pet_control_list_item.cpp
new file mode 100644
index 0000000..ea67875
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_list_item.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control_list_item.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_list_item.h b/engines/titanic/pet_control/pet_control_list_item.h
new file mode 100644
index 0000000..64808c0
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_list_item.h
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_LIST_ITEM_H
+#define TITANIC_PET_CONTROL_LIST_ITEM_H
+
+#include "titanic/core/list.h"
+#include "titanic/pet_control/pet_val.h"
+
+namespace Titanic {
+
+class CPetControlListItem : public ListItem {
+protected:
+	CPetVal _val;
+	int _field30;
+public:
+	CPetControlListItem() : _field30(0) {}
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_LIST_ITEM_H */
diff --git a/engines/titanic/pet_control/pet_control_list_item2.cpp b/engines/titanic/pet_control/pet_control_list_item2.cpp
new file mode 100644
index 0000000..05847a9
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_list_item2.cpp
@@ -0,0 +1,34 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control_list_item2.h"
+
+namespace Titanic {
+/*
+CPetControlListItem2::CPetControlListItem2(),
+	_field34(0), _field38(0), _field3C(0), _field40(0),
+	_field44(0), _field48(0), _field4C(0), _field50(0),
+	_field54(0), _field58(0), _field5C(0) {
+}
+*/
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_list_item2.h b/engines/titanic/pet_control/pet_control_list_item2.h
new file mode 100644
index 0000000..26f32d5
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_list_item2.h
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_LIST_ITEM2_H
+#define TITANIC_PET_CONTROL_LIST_ITEM2_H
+
+#include "titanic/pet_control/pet_control_list_item.h"
+
+namespace Titanic {
+
+class CPetControlListItem2  : public CPetControlListItem {
+protected:
+	int _field34;
+	int _field38;
+	int _field3C;
+	int _field40;
+	int _field44;
+	int _field48;
+	int _field4C;
+	int _field50;
+	int _field54;
+	int _field58;
+	int _field5C;
+public:
+	//CPetControlListItem2();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_LIST_ITEM2_H */
diff --git a/engines/titanic/pet_control/pet_control_sub1.cpp b/engines/titanic/pet_control/pet_control_sub1.cpp
index 8083586..7ca6d6f 100644
--- a/engines/titanic/pet_control/pet_control_sub1.cpp
+++ b/engines/titanic/pet_control/pet_control_sub1.cpp
@@ -24,6 +24,9 @@
 
 namespace Titanic {
 
+CPetControlSub1::CPetControlSub1() : _field414(0), _field418(0) {
+}
+
 void CPetControlSub1::save(SimpleFile *file, int indent) const {
 
 }
diff --git a/engines/titanic/pet_control/pet_control_sub1.h b/engines/titanic/pet_control/pet_control_sub1.h
index 5e38523..fbe1bbb 100644
--- a/engines/titanic/pet_control/pet_control_sub1.h
+++ b/engines/titanic/pet_control/pet_control_sub1.h
@@ -24,11 +24,35 @@
 #define TITANIC_PET_CONTROL_SUB1_H
 
 #include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_val.h"
 
 namespace Titanic {
 
 class CPetControlSub1 : public CPetControlSubBase {
+private:
+	CPetVal _val1;
+	CPetVal _val2;
+	CPetVal _val3;
+	CPetVal _valArray1[3];
+	CPetVal _val4;
+	CPetVal _val5;
+	CPetVal _val6;
+	CPetControlSubData _field14C;
+	CPetVal _val7;
+	CPetVal _val8;
+	CPetVal _val9;
+	CPetVal _valArray2[9];
+	int _field30C;
+	CPetControlSub12 _sub1;
+	CPetControlSub12 _sub2;
+	int _valArray3[3];
+	int _field414;
+	int _field418;
+	CString _string1;
 public:
+	CPetControlSub1();
+
 	/**
 	 * Save the data for the class to file
 	 */
diff --git a/engines/titanic/pet_control/pet_control_sub10.cpp b/engines/titanic/pet_control/pet_control_sub10.cpp
new file mode 100644
index 0000000..226ac4e
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub10.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/pet_control/pet_control_sub10.h"
+
+namespace Titanic {
+
+CPetControlSub10::CPetControlSub10() : _field10(0), _field14(7),
+	_field18(-1), _field1C(-1), _field20(0), _field24(0) {
+}
+
+void CPetControlSub10::proc8() {
+	error("TODO");
+}
+
+void CPetControlSub10::proc9() {
+	error("TODO");
+}
+
+void CPetControlSub10::proc10() {
+	error("TODO");
+}
+
+void CPetControlSub10::proc11() {
+	error("TODO");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub10.h b/engines/titanic/pet_control/pet_control_sub10.h
new file mode 100644
index 0000000..f8534d7
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub10.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB10_H
+#define TITANIC_PET_CONTROL_SUB10_H
+
+#include "titanic/core/list.h"
+#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_control_list_item.h"
+
+namespace Titanic {
+
+class CPetControlSub10 : public List<CPetControlListItem> {
+protected:
+	int _field10;
+	int _field14;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+	CPetVal _val1;
+	CPetVal _val2;
+	CPetVal _val3;
+public:
+	CPetControlSub10();
+
+	virtual void proc8();
+	virtual void proc9();
+	virtual void proc10();
+	virtual void proc11();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB10_H */
diff --git a/engines/titanic/pet_control/pet_control_sub11.cpp b/engines/titanic/pet_control/pet_control_sub11.cpp
new file mode 100644
index 0000000..5148d12
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub11.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control_sub11.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub11.h b/engines/titanic/pet_control/pet_control_sub11.h
new file mode 100644
index 0000000..ebad13b
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub11.h
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB11_H
+#define TITANIC_PET_CONTROL_SUB11_H
+
+#include "titanic/pet_control/pet_control_sub10.h"
+
+namespace Titanic {
+
+class CPetControlSub11 : public CPetControlSub10 {
+public:
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB11_H */
diff --git a/engines/titanic/pet_control/pet_control_sub12.cpp b/engines/titanic/pet_control/pet_control_sub12.cpp
new file mode 100644
index 0000000..1e8d628
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub12.cpp
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software(0), you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation(0), either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY(0), without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program(0), if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_control_sub12.h"
+
+namespace Titanic {
+
+CPetControlSub12::CPetControlSub12() :
+	_field0(0), _field4(0), _field8(0), _field18(0),
+	_field1C(0), _field20(0), _field24(0), _field28(0),
+	_field2C(0), _field30(0), _field34(0), _field38(0),
+	_field3C(0), _field40(0), _field44(0), _field48(0),
+	_field4C(0), _field50(0), _field54(0), _field58(0),
+	_field5C(0), _field60(0), _field64(0), _field68(0),
+	_field6C(0), _field70(0), _field74(0), _field78(0),
+	_field7C(0) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub12.h b/engines/titanic/pet_control/pet_control_sub12.h
new file mode 100644
index 0000000..b90c451
--- /dev/null
+++ b/engines/titanic/pet_control/pet_control_sub12.h
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONTROL_SUB12_H
+#define TITANIC_PET_CONTROL_SUB12_H
+
+#include "titanic/simple_file.h"
+
+namespace Titanic {
+
+class CPetControlSub12 {
+protected:
+	int _field0;
+	int _field4;
+	int _field8;
+	CString _string1;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+	int _field28;
+	int _field2C;
+	int _field30;
+	int _field34;
+	int _field38;
+	int _field3C;
+	int _field40;
+	int _field44;
+	int _field48;
+	int _field4C;
+	int _field50;
+	int _field54;
+	int _field58;
+	int _field5C;
+	int _field60;
+	int _field64;
+	int _field68;
+	int _field6C;
+	int _field70;
+	int _field74;
+	int _field78;
+	int _field7C;
+public:
+	CPetControlSub12();
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONTROL_SUB12_H */
diff --git a/engines/titanic/pet_control/pet_control_sub2.cpp b/engines/titanic/pet_control/pet_control_sub2.cpp
index a48869e..84896bb 100644
--- a/engines/titanic/pet_control/pet_control_sub2.cpp
+++ b/engines/titanic/pet_control/pet_control_sub2.cpp
@@ -24,6 +24,13 @@
 
 namespace Titanic {
 
+CPetControlSub2::CPetControlSub2() :
+	_field100(0), _field104(0), _field108(0), _field10C(0),
+	_field110(0), _field114(0), _field118(0), _field11C(0),
+	_field1C0(0), _field1C4(0), _field1C8(0), _field1CC(0),
+	_field1D0(0), _field1D4(0) {
+}
+
 void CPetControlSub2::save(SimpleFile *file, int indent) const {
 
 }
diff --git a/engines/titanic/pet_control/pet_control_sub2.h b/engines/titanic/pet_control/pet_control_sub2.h
index a54142c..46ad1ac 100644
--- a/engines/titanic/pet_control/pet_control_sub2.h
+++ b/engines/titanic/pet_control/pet_control_sub2.h
@@ -24,11 +24,35 @@
 #define TITANIC_PET_CONTROL_SUB2_H
 
 #include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_control_sub11.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_control_list_item2.h"
 
 namespace Titanic {
 
 class CPetControlSub2 : public CPetControlSubBase {
+private:
+	CPetControlSub11 _sub11;
+	CPetControlListItem2 _listItem;
+	int _field100;
+	int _field104;
+	int _field108;
+	int _field10C;
+	int _field110;
+	int _field114;
+	int _field118;
+	int _field11C;
+	CPetVal _val1;
+	CPetControlSub12 _sub12;
+	int _field1C0;
+	int _field1C4;
+	int _field1C8;
+	int _field1CC;
+	int _field1D0;
+	int _field1D4;
 public:
+	CPetControlSub2();
+
 	/**
 	 * Save the data for the class to file
 	 */
diff --git a/engines/titanic/pet_control/pet_control_sub3.h b/engines/titanic/pet_control/pet_control_sub3.h
index 1b37628..b5eebb1 100644
--- a/engines/titanic/pet_control/pet_control_sub3.h
+++ b/engines/titanic/pet_control/pet_control_sub3.h
@@ -24,10 +24,27 @@
 #define TITANIC_PET_CONTROL_SUB3_H
 
 #include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_val.h"
 
 namespace Titanic {
 
 class CPetControlSub3 : public CPetControlSubBase {
+private:
+	CPetControlSub10 _sub10;
+	CPetVal _val1;
+	CPetVal _val2;
+	CPetVal _val3;
+	CPetVal _val4;
+	CPetVal _val5;
+	CPetVal _val6;
+	CPetVal _val7;
+	CPetVal _val8;
+	CPetVal _val9;
+	CPetVal _val10;
+	CPetVal _val11;
+	CPetControlSub12 _sub12;
 public:
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/pet_control/pet_control_sub4.cpp b/engines/titanic/pet_control/pet_control_sub4.cpp
index 35367a6..49e5cb2 100644
--- a/engines/titanic/pet_control/pet_control_sub4.cpp
+++ b/engines/titanic/pet_control/pet_control_sub4.cpp
@@ -24,6 +24,13 @@
 
 namespace Titanic {
 
+CPetControlSub4::CPetControlSub4() : _field28C(0),
+		_field290(0), _field294(0), _field298(0) {
+	for (int idx = 0; idx < 46; ++idx) {
+		_valArray1[idx] = _valArray2[idx] = 0;
+	}
+}
+
 void CPetControlSub4::save(SimpleFile *file, int indent) const {
 
 }
diff --git a/engines/titanic/pet_control/pet_control_sub4.h b/engines/titanic/pet_control/pet_control_sub4.h
index b00acff..b5de13b 100644
--- a/engines/titanic/pet_control/pet_control_sub4.h
+++ b/engines/titanic/pet_control/pet_control_sub4.h
@@ -23,12 +23,26 @@
 #ifndef TITANIC_PET_CONTROL_SUB4_H
 #define TITANIC_PET_CONTROL_SUB4_H
 
+#include "titanic/simple_file.h"
 #include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_control_sub12.h"
 
 namespace Titanic {
 
 class CPetControlSub4 : public CPetControlSubBase {
+private:
+	CPetControlSub12 _sub12;
+	CPetControlSub10 _sub10;
+	int _valArray1[46];
+	int _valArray2[46];
+	int _field28C;
+	int _field290;
+	int _field294;
+	int _field298;
 public:
+	CPetControlSub4();
+
 	/**
 	 * Save the data for the class to file
 	 */
diff --git a/engines/titanic/pet_control/pet_control_sub5.h b/engines/titanic/pet_control/pet_control_sub5.h
index 2142a10..41b37fd 100644
--- a/engines/titanic/pet_control/pet_control_sub5.h
+++ b/engines/titanic/pet_control/pet_control_sub5.h
@@ -24,10 +24,22 @@
 #define TITANIC_PET_CONTROL_SUB5_H
 
 #include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_val.h"
 
 namespace Titanic {
 
 class CPetControlSub5 : public CPetControlSubBase {
+private:
+	CPetVal _val1;
+	CPetVal _val2;
+	CPetVal _val3;
+	CPetVal _val4;
+	CPetControlSubData _field17C;
+	int _field98;
+	int _field9C;
+	int _fieldA0;
+	CPetVal _valArray1[6];
+
 public:
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/pet_control/pet_control_sub6.h b/engines/titanic/pet_control/pet_control_sub6.h
index d26c8f2..93f83c2 100644
--- a/engines/titanic/pet_control/pet_control_sub6.h
+++ b/engines/titanic/pet_control/pet_control_sub6.h
@@ -24,10 +24,15 @@
 #define TITANIC_PET_CONTROL_SUB6_H
 
 #include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_control_sub12.h"
 
 namespace Titanic {
 
 class CPetControlSub6 : public CPetControlSubBase {
+private:
+	CPetControlSub10 _sub10;
+	CPetControlSub10 _sub12;
 public:
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/pet_control/pet_control_sub7.h b/engines/titanic/pet_control/pet_control_sub7.h
index 660fe2a..d74ac3c 100644
--- a/engines/titanic/pet_control/pet_control_sub7.h
+++ b/engines/titanic/pet_control/pet_control_sub7.h
@@ -24,10 +24,14 @@
 #define TITANIC_PET_CONTROL_SUB7_H
 
 #include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_control_sub12.h"
 
 namespace Titanic {
 
 class CPetControlSub7 : public CPetControlSubBase {
+private:
+	CPetControlSub12 _sub1;
+	CPetControlSub12 _sub2;
 public:
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/pet_control/pet_control_sub8.cpp b/engines/titanic/pet_control/pet_control_sub8.cpp
index 4716308..c2b0f7f 100644
--- a/engines/titanic/pet_control/pet_control_sub8.cpp
+++ b/engines/titanic/pet_control/pet_control_sub8.cpp
@@ -24,6 +24,15 @@
 
 namespace Titanic {
 
+static const int INDEXES[6] = { 1, 0, 2, 3, 4, 5 };
+
+int CPetControlSub8::_indexes[6];
+
+CPetControlSub8::CPetControlSub8() {
+	for (int idx = 0; idx < 6; ++idx)
+		_indexes[INDEXES[idx]] = idx;
+}
+
 void CPetControlSub8::save(SimpleFile *file, int indent) const {
 
 }
diff --git a/engines/titanic/pet_control/pet_control_sub8.h b/engines/titanic/pet_control/pet_control_sub8.h
index e6de1f8..391d4cf 100644
--- a/engines/titanic/pet_control/pet_control_sub8.h
+++ b/engines/titanic/pet_control/pet_control_sub8.h
@@ -24,11 +24,24 @@
 #define TITANIC_PET_CONTROL_SUB8_H
 
 #include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_val.h"
 
 namespace Titanic {
 
 class CPetControlSub8 : public CPetControlSubBase {
+private:
+	static int _indexes[6];
+
+	CPetVal _valArray1[6];
+	CPetVal _valArray2[6];
+	CPetVal _val1;
+	CPetVal _val2;
+	CPetVal _val3;
+	CPetVal _val4;
+	CPetVal _valArray3[7];
 public:
+	CPetControlSub8();
+
 	/**
 	 * Save the data for the class to file
 	 */
diff --git a/engines/titanic/pet_control/pet_control_sub_base.cpp b/engines/titanic/pet_control/pet_control_sub_base.cpp
index 3519431..05a3425 100644
--- a/engines/titanic/pet_control/pet_control_sub_base.cpp
+++ b/engines/titanic/pet_control/pet_control_sub_base.cpp
@@ -20,8 +20,41 @@
  *
  */
 
+#include "common/textconsole.h"
 #include "titanic/pet_control/pet_control_sub_base.h"
 
 namespace Titanic {
 
+void CPetControlSubBase::proc4() {
+	error("TODO");
+}
+
+void CPetControlSubBase::proc16() {
+	error("TODO");
+}
+
+void CPetControlSubBase::proc25() {
+	error("TODO");
+}
+
+void CPetControlSubBase::proc27() {
+	error("TODO");
+}
+
+void CPetControlSubBase::proc28() {
+	error("TODO");
+}
+
+void CPetControlSubBase::proc29() {
+	error("TODO");
+}
+
+void CPetControlSubBase::proc30() {
+	error("TODO");
+}
+
+void CPetControlSubBase::proc31() {
+	error("TODO");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub_base.h b/engines/titanic/pet_control/pet_control_sub_base.h
index b11f5cc..8542382 100644
--- a/engines/titanic/pet_control/pet_control_sub_base.h
+++ b/engines/titanic/pet_control/pet_control_sub_base.h
@@ -27,21 +27,74 @@
 
 namespace Titanic {
 
+struct CPetControlSubData {
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+
+	CPetControlSubData() : _field0(0), _field4(0),
+		_field8(0), _fieldC(0) {}
+};
+
 class CPetControlSubBase {
 protected:
 	int _field4;
 public:
 	CPetControlSubBase() : _field4(0) {}
 
+	virtual int proc1() { return 0; }
+	virtual int proc2() { return 0; }
+	virtual void proc3() {}
+	virtual void proc4();
+	virtual void proc5() {}
+	virtual int proc6() { return 0; }
+	virtual int proc7() { return 0; }
+	virtual int proc8() { return 0; }
+	virtual int proc9() { return 0; }
+	virtual int proc10() { return 0; }
+	virtual int proc11() { return 0; }
+	virtual int proc12() { return 0; }
+	virtual int proc13() { return 0; }
+	virtual int proc14() { return 0; }
+	virtual int proc15() { return 0; }
+	virtual void proc16();
+
 	/**
-	 * Save the data for the class to file
+	 * Returns true if the object is in a valid state
 	 */
-	virtual void save(SimpleFile *file, int indent) const = 0;
+	virtual bool isValid() const { return false; }
 
 	/**
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file) = 0;
+
+	virtual void proc19() {}
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const = 0;
+
+	virtual void proc21() {}
+	virtual void proc22() {}
+	virtual void proc23() {}
+	virtual void proc24() {}
+	virtual void proc25();
+	virtual int proc26() { return 0; }
+	virtual void proc27();
+	virtual void proc28();
+	virtual void proc29();
+	virtual void proc30();
+	virtual void proc31();
+	virtual void proc32() {}
+	virtual void proc33() {}
+	virtual void proc34() {}
+	virtual void proc35() {}
+	virtual void proc36() {}
+	virtual void proc37() {}
+	virtual void proc38() {}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_val.cpp b/engines/titanic/pet_control/pet_val.cpp
new file mode 100644
index 0000000..f3ee2bf
--- /dev/null
+++ b/engines/titanic/pet_control/pet_val.cpp
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/pet_control/pet_val.h"
+
+namespace Titanic {
+
+void CPetVal::proc1() {
+	error("TODO");
+}
+
+void CPetVal::proc2() {
+	error("TODO");
+}
+
+void CPetVal::proc3() {
+	error("TODO");
+}
+
+void CPetVal::proc4() {
+	error("TODO");
+}
+
+void CPetVal::proc5(CLinkItemSub *linkItem) {
+	error("TODO");
+}
+
+int CPetVal::proc16() {
+	switch (!_field14) {
+	case 0:
+		return _field18;
+	case 1:
+		return _field1C;
+	case 2:
+		return _field20;
+	default:
+		return 0;
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_val.h b/engines/titanic/pet_control/pet_val.h
new file mode 100644
index 0000000..f1f9bd1
--- /dev/null
+++ b/engines/titanic/pet_control/pet_val.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_VAL_H
+#define TITANIC_PET_VAL_H
+
+#include "titanic/pet_control/pet_val_base.h"
+
+namespace Titanic {
+
+class CPetVal: public CPetValBase {
+protected:
+	int _field18;
+	int _field1C;
+	int _field20;
+public:
+	CPetVal() : CPetValBase(), _field18(0), _field1C(0), _field20(0) {}
+
+	virtual void proc1();
+	virtual void proc2();
+	virtual void proc3();
+	virtual void proc4();
+
+	virtual void proc5(CLinkItemSub *linkItem);
+
+	virtual int proc16();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_VAL_H */
diff --git a/engines/titanic/pet_control/pet_val_base.cpp b/engines/titanic/pet_control/pet_val_base.cpp
new file mode 100644
index 0000000..fed1b0d
--- /dev/null
+++ b/engines/titanic/pet_control/pet_val_base.cpp
@@ -0,0 +1,73 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/pet_control/pet_val_base.h"
+
+namespace Titanic {
+
+void CPetValBase::proc5(CLinkItemSub *linkItem) {
+	if (linkItem)
+		linkItem->clear();
+}
+
+int CPetValBase::proc6() {
+	error("TODO");
+}
+
+int CPetValBase::proc7() {
+	error("TODO");
+}
+
+void CPetValBase::proc8() {
+	error("TODO");
+}
+
+int CPetValBase::proc9() {
+	error("TODO");
+}
+
+void CPetValBase::proc10() {
+	error("TODO");
+}
+
+void CPetValBase::proc11() {
+	error("TODO");
+}
+
+void CPetValBase::proc12() {
+	error("TODO");
+}
+
+void CPetValBase::proc13() {
+	error("TODO");
+}
+
+void CPetValBase::proc14() {
+	error("TODO");
+}
+
+void CPetValBase::proc15() {
+	error("TODO");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_val_base.h b/engines/titanic/pet_control/pet_val_base.h
new file mode 100644
index 0000000..a270114
--- /dev/null
+++ b/engines/titanic/pet_control/pet_val_base.h
@@ -0,0 +1,67 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_VAL_BASE_H
+#define TITANIC_PET_VAL_BASE_H
+
+#include "titanic/simple_file.h"
+#include "titanic/core/link_item.h"
+
+namespace Titanic {
+
+class CPetValBase {
+protected:
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+public:
+	CPetValBase() : _field4(0), _field8(0), _fieldC(0),
+		_field10(0), _field14(0) {}
+
+	virtual void proc1() {}
+	virtual void proc2() {}
+	virtual void proc3() {}
+	virtual void proc4() {}
+
+	virtual void proc5(CLinkItemSub *linkItem);
+
+	virtual int proc6();
+	virtual int proc7();
+	virtual void proc8();
+	virtual int proc9();
+	virtual void proc10();
+	virtual void proc11();
+	virtual void proc12();
+	virtual void proc13();
+	virtual void proc14();
+	virtual void proc15();
+
+	virtual int proc16() { return 0; }
+
+	virtual void proc17(int v) { _field14 = v; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_VAL_BASE_H */


Commit: 5bdb873c47be734a6086510a6c8ff4cae19db21c
    https://github.com/scummvm/scummvm/commit/5bdb873c47be734a6086510a6c8ff4cae19db21c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-05T00:04:26-05:00

Commit Message:
TITANIC: gcc compilation fixes

Changed paths:
    engines/titanic/core/list.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/saveable_object.h
    engines/titanic/image.h
    engines/titanic/messages/door_auto_sound_event.h
    engines/titanic/messages/pet_messages.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control_sub_base.h
    engines/titanic/pet_control/pet_val_base.h
    engines/titanic/simple_file.cpp



diff --git a/engines/titanic/core/list.h b/engines/titanic/core/list.h
index d990aec..00474b9 100644
--- a/engines/titanic/core/list.h
+++ b/engines/titanic/core/list.h
@@ -70,7 +70,7 @@ public:
 		file->writeNumberLine(Common::List<T *>::size(), indent);
 
 		// Iterate through writing entries
-		Common::List<T *>::const_iterator i;
+		typename Common::List<typename T *>::const_iterator i;
 		for (i = Common::List<T *>::begin(); i != Common::List<T *>::end(); ++i) {
 			const ListItem *item = *i;
 			item->saveHeader(file, indent);
@@ -115,7 +115,8 @@ public:
 	 * Clear the list and destroy any items in it
 	 */
 	void destroyContents() {
-		for (Common::List<T *>::iterator i = Common::List<T *>::begin(); 
+		typename Common::List<T *>::iterator i;
+		for (i = Common::List<T *>::begin(); 
 				i != Common::List<T *>::end(); ++i) {
 			CSaveableObject *obj = *i;
 			delete obj;
@@ -127,7 +128,7 @@ public:
 	/**
 	 * Add a new item to the list of the type the list contains
 	 */
-	T *List::add() {
+	T *add() {
 		T *item = new T();
 		Common::List<T *>::push_back(item);
 		return item;
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index dcd47b7..5a60798 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -399,546 +399,546 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 #define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
 #define ADDFN(T) (*_classList)[#T] = Function##T
 
-DEFFN(CArm);
-DEFFN(CAuditoryCentre);
-DEFFN(CBowlEar);
-DEFFN(CBrain);
-DEFFN(CBridgePiece);
-DEFFN(CCarry);
-DEFFN(CCarryParrot);
-DEFFN(CCentralCore);
-DEFFN(CChicken);
-DEFFN(CChickenCooler);
-DEFFN(CCrushedTV);
-DEFFN(CEar);
-DEFFN(CEye);
-DEFFN(CFeathers);
-DEFFN(CFruit);
-DEFFN(CGlass);
-DEFFN(CHammer);
-DEFFN(CHeadPiece);
-DEFFN(CHose);
-DEFFN(CHoseEnd);
-DEFFN(CKey);
-DEFFN(CLiftbotHead);
-DEFFN(CLongStick);
-DEFFN(CMagazine);
-DEFFN(CMaitreDLeftArm);
-DEFFN(CMaitreDRightArm);
-DEFFN(CMouth);
-DEFFN(CNapkin);
-DEFFN(CNose);
-DEFFN(CNote);
-DEFFN(CParcel);
-DEFFN(CPerch);
-DEFFN(CPhonographCylinder);
-DEFFN(CPhonographEar);
-DEFFN(CPhotograph);
-DEFFN(CPlugIn);
-DEFFN(CSpeechCentre);
-DEFFN(CSweets);
-DEFFN(CVisionCentre);
+DEFFN(CArm)
+DEFFN(CAuditoryCentre)
+DEFFN(CBowlEar)
+DEFFN(CBrain)
+DEFFN(CBridgePiece)
+DEFFN(CCarry)
+DEFFN(CCarryParrot)
+DEFFN(CCentralCore)
+DEFFN(CChicken)
+DEFFN(CChickenCooler)
+DEFFN(CCrushedTV)
+DEFFN(CEar)
+DEFFN(CEye)
+DEFFN(CFeathers)
+DEFFN(CFruit)
+DEFFN(CGlass)
+DEFFN(CHammer)
+DEFFN(CHeadPiece)
+DEFFN(CHose)
+DEFFN(CHoseEnd)
+DEFFN(CKey)
+DEFFN(CLiftbotHead)
+DEFFN(CLongStick)
+DEFFN(CMagazine)
+DEFFN(CMaitreDLeftArm)
+DEFFN(CMaitreDRightArm)
+DEFFN(CMouth)
+DEFFN(CNapkin)
+DEFFN(CNose)
+DEFFN(CNote)
+DEFFN(CParcel)
+DEFFN(CPerch)
+DEFFN(CPhonographCylinder)
+DEFFN(CPhonographEar)
+DEFFN(CPhotograph)
+DEFFN(CPlugIn)
+DEFFN(CSpeechCentre)
+DEFFN(CSweets)
+DEFFN(CVisionCentre)
 
-DEFFN(CBackground);
-DEFFN(CClickResponder);
-DEFFN(CDontSaveFileItem);
-DEFFN(CDropTarget);
-DEFFN(CFileItem);
-DEFFN(CFileListItem);
-DEFFN(CLinkItem);
-DEFFN(CMessageTarget);
-DEFFN(CMovieClip);
-DEFFN(CMovieClipList);
-DEFFN(CMultiDropTarget);
-DEFFN(CNodeItem);
-DEFFN(CProjectItem);
-DEFFN(CStaticImage);
-DEFFN(CTurnOnObject);
-DEFFN(CTurnOnPlaySound);
-DEFFN(CTurnOnTurnOff);
-DEFFN(CTreeItem);
-DEFFN(CViewItem);
+DEFFN(CBackground)
+DEFFN(CClickResponder)
+DEFFN(CDontSaveFileItem)
+DEFFN(CDropTarget)
+DEFFN(CFileItem)
+DEFFN(CFileListItem)
+DEFFN(CLinkItem)
+DEFFN(CMessageTarget)
+DEFFN(CMovieClip)
+DEFFN(CMovieClipList)
+DEFFN(CMultiDropTarget)
+DEFFN(CNodeItem)
+DEFFN(CProjectItem)
+DEFFN(CStaticImage)
+DEFFN(CTurnOnObject)
+DEFFN(CTurnOnPlaySound)
+DEFFN(CTurnOnTurnOff)
+DEFFN(CTreeItem)
+DEFFN(CViewItem)
 
-DEFFN(CAnnounce);
-DEFFN(CAnnoyBarbot);
-DEFFN(CArbBackground);
-DEFFN(CArboretumGate);
-DEFFN(CAutoAnimate);
-DEFFN(CBarBell);
-DEFFN(CBarMenu);
-DEFFN(CBarMenuButton);
-DEFFN(CBelbotGetLight);
-DEFFN(CBilgeSuccUBus);
-DEFFN(CBomb);
-DEFFN(CBottomOfWellMonitor);
-DEFFN(CBowlUnlocker);
-DEFFN(CBrainSlot);
-DEFFN(CBridgeView);
+DEFFN(CAnnounce)
+DEFFN(CAnnoyBarbot)
+DEFFN(CArbBackground)
+DEFFN(CArboretumGate)
+DEFFN(CAutoAnimate)
+DEFFN(CBarBell)
+DEFFN(CBarMenu)
+DEFFN(CBarMenuButton)
+DEFFN(CBelbotGetLight)
+DEFFN(CBilgeSuccUBus)
+DEFFN(CBomb)
+DEFFN(CBottomOfWellMonitor)
+DEFFN(CBowlUnlocker)
+DEFFN(CBrainSlot)
+DEFFN(CBridgeView)
 DEFFN(CBrokenPellBase)
-DEFFN(CBrokenPellerator);
-DEFFN(CBrokenPelleratorFroz);
-DEFFN(CCage);
-DEFFN(CCallPellerator);
-DEFFN(CCaptainsWheel);
-DEFFN(CCDROM);
-DEFFN(CCDROMComputer);
-DEFFN(CCDROMTray);
-DEFFN(CCellPointButton);
-DEFFN(CChickenDispensor);
-DEFFN(CCloseBrokenPel);
-DEFFN(CodeWheel);
-DEFFN(CComputer);
-DEFFN(CCookie);
-DEFFN(CComputerScreen);
-DEFFN(CCredits);
-DEFFN(CCreditsButton);
-DEFFN(CDeadArea);
-DEFFN(CDeskClickResponder);
-DEFFN(CDoorbotElevatorHandler);
-DEFFN(CDoorbotHomeHandler);
-DEFFN(CEarSweetBowl);
-DEFFN(CEjectPhonographButton);
-DEFFN(CElevatorActionArea);
-DEFFN(CEmmaControl);
-DEFFN(CEmptyNutBowl);
-DEFFN(CEndCreditText);
-DEFFN(CEndCredits);
-DEFFN(CEndExplodeShip);
-DEFFN(CEndGameCredits);
-DEFFN(CEndSequenceControl);
-DEFFN(CFan);
-DEFFN(CFanControl);
-DEFFN(CFanDecrease);
-DEFFN(CFanIncrease);
-DEFFN(CFanNoises);
-DEFFN(CFloorIndicator);
-DEFFN(CGamesConsole);
-DEFFN(CGetLiftEye2);
-DEFFN(CGlassSmasher);
-DEFFN(CHammerClip);
-DEFFN(CHammerDispensor);
-DEFFN(CHammerDispensorButton);
-DEFFN(CHeadSlot);
-DEFFN(CHeadSmashEvent);
-DEFFN(CHeadSmashLever);
-DEFFN(CIdleSummoner);
-DEFFN(CLemonDispensor);
-DEFFN(CLight);
-DEFFN(CLightSwitch);
-DEFFN(CLittleLiftButton);
-DEFFN(CLongStickDispenser);
-DEFFN(CMissiveOMat);
-DEFFN(CMissiveOMatButton);
-DEFFN(CMusicalInstrument);
-DEFFN(CMusicConsoleButton);
-DEFFN(CMusicRoomPhonograph);
-DEFFN(CMusicRoomStopPhonographButton);
-DEFFN(CMusicSystemLock);
-DEFFN(CNavHelmet);
-DEFFN(CNavigationComputer);
-DEFFN(CNoNutBowl);
-DEFFN(CNoseHolder);
-DEFFN(CNullPortHole);
-DEFFN(CNutReplacer);
-DEFFN(CPetDisabler);
-DEFFN(CPhonograph);
-DEFFN(CPhonographLid);
-DEFFN(CPlayMusicButton);
-DEFFN(CPlayOnAct);
-DEFFN(CPortHole);
-DEFFN(CRecordPhonographButton);
-DEFFN(CReplacementEar);
-DEFFN(CReservedTable);
-DEFFN(CRestaurantCylinderHolder);
-DEFFN(CRestaurantPhonograph);
-DEFFN(CRoomItem);
-DEFFN(CSauceDispensor);
-DEFFN(CSearchPoint);
-DEFFN(CSeasonBackground);
-DEFFN(CSeasonBarrel);
-DEFFN(CSeasonalAdjustment);
-DEFFN(CServiceElevatorWindow);
-DEFFN(CShipSetting);
-DEFFN(CShipSettingButton);
-DEFFN(CShowCellpoints);
-DEFFN(CSpeechDispensor);
-DEFFN(CStarlingPuret);
-DEFFN(CStartAction);
-DEFFN(CStopPhonographButton);
-DEFFN(CSUBGlass);
-DEFFN(CSweetBowl);
-DEFFN(CTelevision);
-DEFFN(CThirdClassCanal);
-DEFFN(CThrowTVDownWell);
-DEFFN(CTitaniaStillControl);
-DEFFN(CTOWParrotNav);
-DEFFN(CUpLighter);
-DEFFN(CUselessLever);
-DEFFN(CWheelButton);
-DEFFN(CWheelHotSpot);
-DEFFN(CWheelSpin);
-DEFFN(CWheelSpinHorn);
-DEFFN(CGondolierBase);
-DEFFN(CGondolierChest);
-DEFFN(CGondolierFace);
-DEFFN(CGondolierMixer);
-DEFFN(CGondolierSlider);
-DEFFN(CMaitreDArmHolder);
-DEFFN(CMaitreDBody);
-DEFFN(CMaitreDLegs);
-DEFFN(CMaitreDProdReceptor);
-DEFFN(CParrotLobbyController);
-DEFFN(CParrotLobbyLinkUpdater);
-DEFFN(CParrotLobbyObject);
-DEFFN(CParrotLobbyViewObject);
-DEFFN(CParrotLoser);
-DEFFN(CParrotNutBowlActor);
-DEFFN(CParrotNutEater);
-DEFFN(CParrotPerchHolder);
-DEFFN(CParrotSuccUBus);
-DEFFN(CParrotTrigger);
-DEFFN(CPlayerMeetsParrot);
-DEFFN(CPET);
-DEFFN(CPETClass1);
-DEFFN(CPETClass2);
-DEFFN(CPETClass3);
-DEFFN(CPetControl);
-DEFFN(CPetDragChev);
-DEFFN(CPetGraphic);
-DEFFN(CPetGraphic2);
-DEFFN(PETLeaf);
-DEFFN(CPETLift);
-DEFFN(CPETMonitor);
-DEFFN(CPETPellerator);
-DEFFN(CPETPosition);
-DEFFN(CPETSentinal);
-DEFFN(CPETSounds);
-DEFFN(CPETTransition);
-DEFFN(CPETTransport);
-DEFFN(CPickUp);
-DEFFN(CPickUpBarGlass);
-DEFFN(CPickUpHose);
-DEFFN(CPickUpLemon);
-DEFFN(CPickUpSpeechCentre);
-DEFFN(CPickUpVisCentre);
-DEFFN(CBarShelfVisCentre);
-DEFFN(CLemonOnBar);
-DEFFN(CPlaceHolder);
-DEFFN(CTVOnBar);
-DEFFN(CArmchair);
-DEFFN(CBasin);
-DEFFN(CBedfoot);
-DEFFN(CBedhead);
-DEFFN(CChestOfDrawers);
-DEFFN(CDesk);
-DEFFN(CDeskchair);
-DEFFN(CDrawer);
-DEFFN(CSGTDoors);
-DEFFN(SGTNav);
-DEFFN(CSGTNavigation);
-DEFFN(CSGTRestaurantDoors);
-DEFFN(CSGTStateControl);
-DEFFN(CSGTStateRoom);
-DEFFN(CSGTTV);
-DEFFN(CSGTUpperDoorsSound);
-DEFFN(CToilet);
-DEFFN(CVase);
-DEFFN(CWashstand);
+DEFFN(CBrokenPellerator)
+DEFFN(CBrokenPelleratorFroz)
+DEFFN(CCage)
+DEFFN(CCallPellerator)
+DEFFN(CCaptainsWheel)
+DEFFN(CCDROM)
+DEFFN(CCDROMComputer)
+DEFFN(CCDROMTray)
+DEFFN(CCellPointButton)
+DEFFN(CChickenDispensor)
+DEFFN(CCloseBrokenPel)
+DEFFN(CodeWheel)
+DEFFN(CComputer)
+DEFFN(CCookie)
+DEFFN(CComputerScreen)
+DEFFN(CCredits)
+DEFFN(CCreditsButton)
+DEFFN(CDeadArea)
+DEFFN(CDeskClickResponder)
+DEFFN(CDoorbotElevatorHandler)
+DEFFN(CDoorbotHomeHandler)
+DEFFN(CEarSweetBowl)
+DEFFN(CEjectPhonographButton)
+DEFFN(CElevatorActionArea)
+DEFFN(CEmmaControl)
+DEFFN(CEmptyNutBowl)
+DEFFN(CEndCreditText)
+DEFFN(CEndCredits)
+DEFFN(CEndExplodeShip)
+DEFFN(CEndGameCredits)
+DEFFN(CEndSequenceControl)
+DEFFN(CFan)
+DEFFN(CFanControl)
+DEFFN(CFanDecrease)
+DEFFN(CFanIncrease)
+DEFFN(CFanNoises)
+DEFFN(CFloorIndicator)
+DEFFN(CGamesConsole)
+DEFFN(CGetLiftEye2)
+DEFFN(CGlassSmasher)
+DEFFN(CHammerClip)
+DEFFN(CHammerDispensor)
+DEFFN(CHammerDispensorButton)
+DEFFN(CHeadSlot)
+DEFFN(CHeadSmashEvent)
+DEFFN(CHeadSmashLever)
+DEFFN(CIdleSummoner)
+DEFFN(CLemonDispensor)
+DEFFN(CLight)
+DEFFN(CLightSwitch)
+DEFFN(CLittleLiftButton)
+DEFFN(CLongStickDispenser)
+DEFFN(CMissiveOMat)
+DEFFN(CMissiveOMatButton)
+DEFFN(CMusicalInstrument)
+DEFFN(CMusicConsoleButton)
+DEFFN(CMusicRoomPhonograph)
+DEFFN(CMusicRoomStopPhonographButton)
+DEFFN(CMusicSystemLock)
+DEFFN(CNavHelmet)
+DEFFN(CNavigationComputer)
+DEFFN(CNoNutBowl)
+DEFFN(CNoseHolder)
+DEFFN(CNullPortHole)
+DEFFN(CNutReplacer)
+DEFFN(CPetDisabler)
+DEFFN(CPhonograph)
+DEFFN(CPhonographLid)
+DEFFN(CPlayMusicButton)
+DEFFN(CPlayOnAct)
+DEFFN(CPortHole)
+DEFFN(CRecordPhonographButton)
+DEFFN(CReplacementEar)
+DEFFN(CReservedTable)
+DEFFN(CRestaurantCylinderHolder)
+DEFFN(CRestaurantPhonograph)
+DEFFN(CRoomItem)
+DEFFN(CSauceDispensor)
+DEFFN(CSearchPoint)
+DEFFN(CSeasonBackground)
+DEFFN(CSeasonBarrel)
+DEFFN(CSeasonalAdjustment)
+DEFFN(CServiceElevatorWindow)
+DEFFN(CShipSetting)
+DEFFN(CShipSettingButton)
+DEFFN(CShowCellpoints)
+DEFFN(CSpeechDispensor)
+DEFFN(CStarlingPuret)
+DEFFN(CStartAction)
+DEFFN(CStopPhonographButton)
+DEFFN(CSUBGlass)
+DEFFN(CSweetBowl)
+DEFFN(CTelevision)
+DEFFN(CThirdClassCanal)
+DEFFN(CThrowTVDownWell)
+DEFFN(CTitaniaStillControl)
+DEFFN(CTOWParrotNav)
+DEFFN(CUpLighter)
+DEFFN(CUselessLever)
+DEFFN(CWheelButton)
+DEFFN(CWheelHotSpot)
+DEFFN(CWheelSpin)
+DEFFN(CWheelSpinHorn)
+DEFFN(CGondolierBase)
+DEFFN(CGondolierChest)
+DEFFN(CGondolierFace)
+DEFFN(CGondolierMixer)
+DEFFN(CGondolierSlider)
+DEFFN(CMaitreDArmHolder)
+DEFFN(CMaitreDBody)
+DEFFN(CMaitreDLegs)
+DEFFN(CMaitreDProdReceptor)
+DEFFN(CParrotLobbyController)
+DEFFN(CParrotLobbyLinkUpdater)
+DEFFN(CParrotLobbyObject)
+DEFFN(CParrotLobbyViewObject)
+DEFFN(CParrotLoser)
+DEFFN(CParrotNutBowlActor)
+DEFFN(CParrotNutEater)
+DEFFN(CParrotPerchHolder)
+DEFFN(CParrotSuccUBus)
+DEFFN(CParrotTrigger)
+DEFFN(CPlayerMeetsParrot)
+DEFFN(CPET)
+DEFFN(CPETClass1)
+DEFFN(CPETClass2)
+DEFFN(CPETClass3)
+DEFFN(CPetControl)
+DEFFN(CPetDragChev)
+DEFFN(CPetGraphic)
+DEFFN(CPetGraphic2)
+DEFFN(PETLeaf)
+DEFFN(CPETLift)
+DEFFN(CPETMonitor)
+DEFFN(CPETPellerator)
+DEFFN(CPETPosition)
+DEFFN(CPETSentinal)
+DEFFN(CPETSounds)
+DEFFN(CPETTransition)
+DEFFN(CPETTransport)
+DEFFN(CPickUp)
+DEFFN(CPickUpBarGlass)
+DEFFN(CPickUpHose)
+DEFFN(CPickUpLemon)
+DEFFN(CPickUpSpeechCentre)
+DEFFN(CPickUpVisCentre)
+DEFFN(CBarShelfVisCentre)
+DEFFN(CLemonOnBar)
+DEFFN(CPlaceHolder)
+DEFFN(CTVOnBar)
+DEFFN(CArmchair)
+DEFFN(CBasin)
+DEFFN(CBedfoot)
+DEFFN(CBedhead)
+DEFFN(CChestOfDrawers)
+DEFFN(CDesk)
+DEFFN(CDeskchair)
+DEFFN(CDrawer)
+DEFFN(CSGTDoors)
+DEFFN(SGTNav)
+DEFFN(CSGTNavigation)
+DEFFN(CSGTRestaurantDoors)
+DEFFN(CSGTStateControl)
+DEFFN(CSGTStateRoom)
+DEFFN(CSGTTV)
+DEFFN(CSGTUpperDoorsSound)
+DEFFN(CToilet)
+DEFFN(CVase)
+DEFFN(CWashstand)
 
-DEFFN(CGondolier);
-DEFFN(CLift);
-DEFFN(CLiftindicator);
-DEFFN(CPellerator);
-DEFFN(CServiceElevator);
-DEFFN(CTransport);
+DEFFN(CGondolier)
+DEFFN(CLift)
+DEFFN(CLiftindicator)
+DEFFN(CPellerator)
+DEFFN(CServiceElevator)
+DEFFN(CTransport)
 
-DEFFN(CActButton);
-DEFFN(CChangesSeasonButton);
-DEFFN(CChevLeftOff);
-DEFFN(CChevLeftOn);
-DEFFN(CChevRightOff);
-DEFFN(CChevRightOn);
-DEFFN(CChevSendRecSwitch);
-DEFFN(CChevSwitch);
-DEFFN(CEditControl);
-DEFFN(CElevatorButton);
-DEFFN(CGetFromSucc);
-DEFFN(CHelmetOnOff);
-DEFFN(CHomePhoto);
-DEFFN(CIconNavAction);
-DEFFN(CIconNavButt);
-DEFFN(CIconNavDown);
-DEFFN(CIconNavImage);
-DEFFN(CIconNavLeft);
-DEFFN(CIconNavReceive);
-DEFFN(CIconNavRight);
-DEFFN(CIconNavSend);
-DEFFN(CIconNavUp);
-DEFFN(CKeybrdButt);
-DEFFN(CMoveObjectButton);
-DEFFN(CMusicControl);
-DEFFN(CMusicSlider);
-DEFFN(CMusicSliderPitch);
-DEFFN(CMusicSliderSpeed);
-DEFFN(CMusicSwitch);
-DEFFN(CMusicSwitchInversion);
-DEFFN(CMusicSwitchReverse);
-DEFFN(CMusicVoiceMute);
-DEFFN(CPetModeOff);
-DEFFN(CPetModeOn);
-DEFFN(CPetModePanel);
-DEFFN(CPetPannel1);
-DEFFN(CPetPannel2);
-DEFFN(CPetPannel3);
-DEFFN(CSendToSucc);
-DEFFN(CSGTSelector);
-DEFFN(CSliderButton);
-DEFFN(CSmallChevLeftOff);
-DEFFN(CSmallChevLeftOn);
-DEFFN(CSmallChevRightOff);
-DEFFN(CSmallChevRightOn);
-DEFFN(CStatusChangeButton);
-DEFFN(CSTButton);
-DEFFN(CTextDown);
-DEFFN(CTextSkrew);
-DEFFN(CTextUp);
-DEFFN(CToggleButton);
-DEFFN(CToggleSwitch);
-DEFFN(CVolumeControl);
+DEFFN(CActButton)
+DEFFN(CChangesSeasonButton)
+DEFFN(CChevLeftOff)
+DEFFN(CChevLeftOn)
+DEFFN(CChevRightOff)
+DEFFN(CChevRightOn)
+DEFFN(CChevSendRecSwitch)
+DEFFN(CChevSwitch)
+DEFFN(CEditControl)
+DEFFN(CElevatorButton)
+DEFFN(CGetFromSucc)
+DEFFN(CHelmetOnOff)
+DEFFN(CHomePhoto)
+DEFFN(CIconNavAction)
+DEFFN(CIconNavButt)
+DEFFN(CIconNavDown)
+DEFFN(CIconNavImage)
+DEFFN(CIconNavLeft)
+DEFFN(CIconNavReceive)
+DEFFN(CIconNavRight)
+DEFFN(CIconNavSend)
+DEFFN(CIconNavUp)
+DEFFN(CKeybrdButt)
+DEFFN(CMoveObjectButton)
+DEFFN(CMusicControl)
+DEFFN(CMusicSlider)
+DEFFN(CMusicSliderPitch)
+DEFFN(CMusicSliderSpeed)
+DEFFN(CMusicSwitch)
+DEFFN(CMusicSwitchInversion)
+DEFFN(CMusicSwitchReverse)
+DEFFN(CMusicVoiceMute)
+DEFFN(CPetModeOff)
+DEFFN(CPetModeOn)
+DEFFN(CPetModePanel)
+DEFFN(CPetPannel1)
+DEFFN(CPetPannel2)
+DEFFN(CPetPannel3)
+DEFFN(CSendToSucc)
+DEFFN(CSGTSelector)
+DEFFN(CSliderButton)
+DEFFN(CSmallChevLeftOff)
+DEFFN(CSmallChevLeftOn)
+DEFFN(CSmallChevRightOff)
+DEFFN(CSmallChevRightOn)
+DEFFN(CStatusChangeButton)
+DEFFN(CSTButton)
+DEFFN(CTextDown)
+DEFFN(CTextSkrew)
+DEFFN(CTextUp)
+DEFFN(CToggleButton)
+DEFFN(CToggleSwitch)
+DEFFN(CVolumeControl)
 
-DEFFN(CActMsg);
-DEFFN(CActivationmsg);
-DEFFN(CAddHeadPieceMsg);
-DEFFN(CAnimateMaitreDMsg);
-DEFFN(CArboretumGateMsg);
-DEFFN(CArmPickedUpFromTableMsg);
-DEFFN(CAutoSoundEvent);
-DEFFN(CBilgeAutoSoundEvent);
-DEFFN(CBilgeDispensorEvent);
-DEFFN(CBodyInBilgeRoomMsg);
-DEFFN(CBowlStateChange);
-DEFFN(CCarryObjectArrivedMsg);
-DEFFN(CChangeSeasonMsg);
-DEFFN(CCheckAllPossibleCodes);
-DEFFN(CCheckChevCode);
-DEFFN(CChildDragEndMsg);
-DEFFN(CChildDragMoveMsg);
-DEFFN(CChildDragStartMsg);
-DEFFN(CClearChevPanelBits);
-DEFFN(CCorrectMusicPlayedMsg);
-DEFFN(CCreateMusicPlayerMsg);
-DEFFN(CCylinderHolderReadyMsg);
-DEFFN(CDeactivationMsg);
-DEFFN(CDeliverCCarryMsg);
-DEFFN(CDisableMaitreDProdReceptor);
-DEFFN(CDismissBotMsg);
-DEFFN(CDoffNavHelmet);
-DEFFN(CDonNavHelmet);
-DEFFN(CDoorAutoSoundEvent);
-DEFFN(CDoorbotNeededInElevatorMsg);
-DEFFN(CDoorbotNeededInHomeMsg);
-DEFFN(CDropobjectMsg);
-DEFFN(CDropZoneGotObjectMsg);
-DEFFN(CDropZoneLostObjectMsg);
-DEFFN(CEditControlMsg);
-DEFFN(CEjectCylinderMsg);
-DEFFN(CErasePhonographCylinderMsg);
-DEFFN(CFreshenCookieMsg);
-DEFFN(CGetChevClassBits);
-DEFFN(CGetChevClassNum);
-DEFFN(CGetChevCodeFromRoomNameMsg);
-DEFFN(CGetChevFloorBits);
-DEFFN(CGetChevFloorNum);
-DEFFN(CGetChevLiftBits);
-DEFFN(CGetChevLiftNum);
-DEFFN(CGetChevRoomBits);
-DEFFN(CGetChevRoomNum);
-DEFFN(CHoseConnectedMsg);
-DEFFN(CInitializeAnimMsg);
-DEFFN(CIsEarBowlPuzzleDone);
-DEFFN(CIsHookedOnMsg);
-DEFFN(CIsParrotPresentMsg);
-DEFFN(CKeyCharMsg);
-DEFFN(CLemonFallsFromTreeMsg);
-DEFFN(CLightsMsg);
-DEFFN(CLockPhonographMsg);
-DEFFN(CMaitreDDefeatedMsg);
-DEFFN(CMaitreDHappyMsg);
-DEFFN(CMissiveOMatActionMsg);
-DEFFN(CMouseMsg);
-DEFFN(CMouseMoveMsg);
-DEFFN(CMouseButtonMsg);
-DEFFN(CMouseButtonDownMsg);
-DEFFN(CMouseButtonUpMsg);
-DEFFN(CMouseButtonDoubleClickMsg);
-DEFFN(CMouseDragMsg);
-DEFFN(CMouseDragStartMsg);
-DEFFN(CMouseDragMoveMsg);
-DEFFN(CMouseDragEndMsg);
-DEFFN(CMoveToStartPosMsg);
-DEFFN(CMovieEndMsg);
-DEFFN(CMovieFrameMsg);
-DEFFN(CMusicHasStartedMsg);
-DEFFN(CMusicHasStoppedMsg);
-DEFFN(CMusicSettingChangedMsg);
-DEFFN(CNPCPlayAnimationMsg);
-DEFFN(CNPCPlayIdleAnimationMsg);
-DEFFN(CNPCPlayTalkingAnimationMsg);
-DEFFN(CNPCQueueIdleAnimMsg);
-DEFFN(CNutPuzzleMsg);
-DEFFN(COnSummonBotMsg);
-DEFFN(COpeningCreditsMsg);
-DEFFN(CPETDeliverMsg);
-DEFFN(CPETGainedObjectMsg);
-DEFFN(CPETHelmetOnOffMsg);
-DEFFN(CPETKeyboardOnOffMsg);
-DEFFN(CPETLostObjectMsg);
-DEFFN(CPETObjectSelectedMsg);
-DEFFN(CPETObjectStateMsg);
-DEFFN(CPETPhotoOnOffMsg);
-DEFFN(CPETPlaySoundMsg);
-DEFFN(CPETReceiveMsg);
-DEFFN(CPETSetStarDestinationMsg);
-DEFFN(CPETStarFieldLockMsg);
-DEFFN(CPETStereoFieldOnOffMsg);
-DEFFN(CPETTargetMsg);
-DEFFN(CPanningAwayFromParrotMsg);
-DEFFN(CParrotSpeakMsg);
-DEFFN(CParrotTriesChickenMsg);
-DEFFN(CPassOnDragStartMsg);
-DEFFN(CPhonographPlayMsg);
-DEFFN(CPhonographReadyToPlayMsg);
-DEFFN(CPhonographRecordMsg);
-DEFFN(CPhonographStopMsg);
-DEFFN(CPlayRangeMsg);
-DEFFN(CPlayerTriesRestaurantTableMsg);
-DEFFN(CPreSaveMsg);
-DEFFN(CProdMaitreDMsg);
-DEFFN(CPumpingMsg);
-DEFFN(CPutBotBackInHisBoxMsg);
-DEFFN(CPutParrotBackMsg);
-DEFFN(CPuzzleSolvedMsg);
-DEFFN(CQueryCylinderHolderMsg);
-DEFFN(CQueryCylinderMsg);
-DEFFN(CQueryCylinderNameMsg);
-DEFFN(CQueryCylinderTypeMsg);
-DEFFN(CQueryMusicControlSettingMsg);
-DEFFN(CQueryPhonographState);
-DEFFN(CRecordOntoCylinderMsg);
-DEFFN(CRemoveFromGameMsg);
-DEFFN(CReplaceBowlAndNutsMsg);
-DEFFN(CRestaurantMusicChanged);
-DEFFN(CSendCCarryMsg);
-DEFFN(CSenseWorkingMsg);
-DEFFN(CServiceElevatorDoor);
-DEFFN(CServiceElevatorFloorChangeMsg);
-DEFFN(CServiceElevatorFloorRequestMsg);
-DEFFN(CServiceElevatorMsg);
-DEFFN(CSetChevButtonImageMsg);
-DEFFN(CSetChevClassBits);
-DEFFN(CSetChevFloorBits);
-DEFFN(CSetChevLiftBits);
-DEFFN(CSetChevPanelBitMsg);
-DEFFN(CSetChevPanelButtonsMsg);
-DEFFN(CSetChevRoomBits);
-DEFFN(CSetMusicControlsMsg);
-DEFFN(CSetVarMsg);
-DEFFN(CSetVolumeMsg);
-DEFFN(CShipSettingMsg);
-DEFFN(CShowTextMsg);
-DEFFN(CSignalObject);
-DEFFN(CSpeechFallsFromTreeMsg);
-DEFFN(CStartMusicMsg);
-DEFFN(CStatusChangeMsg);
-DEFFN(CStopMusicMsg);
-DEFFN(CSubAcceptCCarryMsg);
-DEFFN(CSubDeliverCCarryMsg);
-DEFFN(CSubSendCCarryMsg);
-DEFFN(CSUBTransition);
-DEFFN(CSubTurnOffMsg);
-DEFFN(CSubTurnOnMsg);
-DEFFN(CSummonBotMsg);
-DEFFN(CSummonBotQuerryMsg);
-DEFFN(CTakeHeadPieceMsg);
-DEFFN(CTextInputMsg);
-DEFFN(CTimeDilationMsg);
-DEFFN(CTimeMsg);
-DEFFN(CTitleSequenceEndedMsg);
-DEFFN(CTransitMsg);
-DEFFN(CTransportMsg);
-DEFFN(CTriggerAutoMusicPlayerMsg);
-DEFFN(CTriggerNPCEvent);
-DEFFN(CTrueTalkGetAnimSetMsg);
-DEFFN(CTrueTalkGetAssetDetailsMsg);
-DEFFN(CTrueTalkGetStateValueMsg);
-DEFFN(CTrueTalkNotifySpeechEndedMsg);
-DEFFN(CTrueTalkNotifySpeechStartedMsg);
-DEFFN(CTrueTalkQueueUpAnimSetMsg);
-DEFFN(CTrueTalkSelfQueueAnimSetMsg);
-DEFFN(CTrueTalkTriggerActionMsg);
-DEFFN(CTurnOff);
-DEFFN(CTurnOn);
-DEFFN(CUse);
-DEFFN(CUseWithCharMsg);
-DEFFN(CUseWithOtherMsg);
-DEFFN(CVirtualKeyCharMsg);
-DEFFN(CVisibleMsg);
+DEFFN(CActMsg)
+DEFFN(CActivationmsg)
+DEFFN(CAddHeadPieceMsg)
+DEFFN(CAnimateMaitreDMsg)
+DEFFN(CArboretumGateMsg)
+DEFFN(CArmPickedUpFromTableMsg)
+DEFFN(CAutoSoundEvent)
+DEFFN(CBilgeAutoSoundEvent)
+DEFFN(CBilgeDispensorEvent)
+DEFFN(CBodyInBilgeRoomMsg)
+DEFFN(CBowlStateChange)
+DEFFN(CCarryObjectArrivedMsg)
+DEFFN(CChangeSeasonMsg)
+DEFFN(CCheckAllPossibleCodes)
+DEFFN(CCheckChevCode)
+DEFFN(CChildDragEndMsg)
+DEFFN(CChildDragMoveMsg)
+DEFFN(CChildDragStartMsg)
+DEFFN(CClearChevPanelBits)
+DEFFN(CCorrectMusicPlayedMsg)
+DEFFN(CCreateMusicPlayerMsg)
+DEFFN(CCylinderHolderReadyMsg)
+DEFFN(CDeactivationMsg)
+DEFFN(CDeliverCCarryMsg)
+DEFFN(CDisableMaitreDProdReceptor)
+DEFFN(CDismissBotMsg)
+DEFFN(CDoffNavHelmet)
+DEFFN(CDonNavHelmet)
+DEFFN(CDoorAutoSoundEvent)
+DEFFN(CDoorbotNeededInElevatorMsg)
+DEFFN(CDoorbotNeededInHomeMsg)
+DEFFN(CDropobjectMsg)
+DEFFN(CDropZoneGotObjectMsg)
+DEFFN(CDropZoneLostObjectMsg)
+DEFFN(CEditControlMsg)
+DEFFN(CEjectCylinderMsg)
+DEFFN(CErasePhonographCylinderMsg)
+DEFFN(CFreshenCookieMsg)
+DEFFN(CGetChevClassBits)
+DEFFN(CGetChevClassNum)
+DEFFN(CGetChevCodeFromRoomNameMsg)
+DEFFN(CGetChevFloorBits)
+DEFFN(CGetChevFloorNum)
+DEFFN(CGetChevLiftBits)
+DEFFN(CGetChevLiftNum)
+DEFFN(CGetChevRoomBits)
+DEFFN(CGetChevRoomNum)
+DEFFN(CHoseConnectedMsg)
+DEFFN(CInitializeAnimMsg)
+DEFFN(CIsEarBowlPuzzleDone)
+DEFFN(CIsHookedOnMsg)
+DEFFN(CIsParrotPresentMsg)
+DEFFN(CKeyCharMsg)
+DEFFN(CLemonFallsFromTreeMsg)
+DEFFN(CLightsMsg)
+DEFFN(CLockPhonographMsg)
+DEFFN(CMaitreDDefeatedMsg)
+DEFFN(CMaitreDHappyMsg)
+DEFFN(CMissiveOMatActionMsg)
+DEFFN(CMouseMsg)
+DEFFN(CMouseMoveMsg)
+DEFFN(CMouseButtonMsg)
+DEFFN(CMouseButtonDownMsg)
+DEFFN(CMouseButtonUpMsg)
+DEFFN(CMouseButtonDoubleClickMsg)
+DEFFN(CMouseDragMsg)
+DEFFN(CMouseDragStartMsg)
+DEFFN(CMouseDragMoveMsg)
+DEFFN(CMouseDragEndMsg)
+DEFFN(CMoveToStartPosMsg)
+DEFFN(CMovieEndMsg)
+DEFFN(CMovieFrameMsg)
+DEFFN(CMusicHasStartedMsg)
+DEFFN(CMusicHasStoppedMsg)
+DEFFN(CMusicSettingChangedMsg)
+DEFFN(CNPCPlayAnimationMsg)
+DEFFN(CNPCPlayIdleAnimationMsg)
+DEFFN(CNPCPlayTalkingAnimationMsg)
+DEFFN(CNPCQueueIdleAnimMsg)
+DEFFN(CNutPuzzleMsg)
+DEFFN(COnSummonBotMsg)
+DEFFN(COpeningCreditsMsg)
+DEFFN(CPETDeliverMsg)
+DEFFN(CPETGainedObjectMsg)
+DEFFN(CPETHelmetOnOffMsg)
+DEFFN(CPETKeyboardOnOffMsg)
+DEFFN(CPETLostObjectMsg)
+DEFFN(CPETObjectSelectedMsg)
+DEFFN(CPETObjectStateMsg)
+DEFFN(CPETPhotoOnOffMsg)
+DEFFN(CPETPlaySoundMsg)
+DEFFN(CPETReceiveMsg)
+DEFFN(CPETSetStarDestinationMsg)
+DEFFN(CPETStarFieldLockMsg)
+DEFFN(CPETStereoFieldOnOffMsg)
+DEFFN(CPETTargetMsg)
+DEFFN(CPanningAwayFromParrotMsg)
+DEFFN(CParrotSpeakMsg)
+DEFFN(CParrotTriesChickenMsg)
+DEFFN(CPassOnDragStartMsg)
+DEFFN(CPhonographPlayMsg)
+DEFFN(CPhonographReadyToPlayMsg)
+DEFFN(CPhonographRecordMsg)
+DEFFN(CPhonographStopMsg)
+DEFFN(CPlayRangeMsg)
+DEFFN(CPlayerTriesRestaurantTableMsg)
+DEFFN(CPreSaveMsg)
+DEFFN(CProdMaitreDMsg)
+DEFFN(CPumpingMsg)
+DEFFN(CPutBotBackInHisBoxMsg)
+DEFFN(CPutParrotBackMsg)
+DEFFN(CPuzzleSolvedMsg)
+DEFFN(CQueryCylinderHolderMsg)
+DEFFN(CQueryCylinderMsg)
+DEFFN(CQueryCylinderNameMsg)
+DEFFN(CQueryCylinderTypeMsg)
+DEFFN(CQueryMusicControlSettingMsg)
+DEFFN(CQueryPhonographState)
+DEFFN(CRecordOntoCylinderMsg)
+DEFFN(CRemoveFromGameMsg)
+DEFFN(CReplaceBowlAndNutsMsg)
+DEFFN(CRestaurantMusicChanged)
+DEFFN(CSendCCarryMsg)
+DEFFN(CSenseWorkingMsg)
+DEFFN(CServiceElevatorDoor)
+DEFFN(CServiceElevatorFloorChangeMsg)
+DEFFN(CServiceElevatorFloorRequestMsg)
+DEFFN(CServiceElevatorMsg)
+DEFFN(CSetChevButtonImageMsg)
+DEFFN(CSetChevClassBits)
+DEFFN(CSetChevFloorBits)
+DEFFN(CSetChevLiftBits)
+DEFFN(CSetChevPanelBitMsg)
+DEFFN(CSetChevPanelButtonsMsg)
+DEFFN(CSetChevRoomBits)
+DEFFN(CSetMusicControlsMsg)
+DEFFN(CSetVarMsg)
+DEFFN(CSetVolumeMsg)
+DEFFN(CShipSettingMsg)
+DEFFN(CShowTextMsg)
+DEFFN(CSignalObject)
+DEFFN(CSpeechFallsFromTreeMsg)
+DEFFN(CStartMusicMsg)
+DEFFN(CStatusChangeMsg)
+DEFFN(CStopMusicMsg)
+DEFFN(CSubAcceptCCarryMsg)
+DEFFN(CSubDeliverCCarryMsg)
+DEFFN(CSubSendCCarryMsg)
+DEFFN(CSUBTransition)
+DEFFN(CSubTurnOffMsg)
+DEFFN(CSubTurnOnMsg)
+DEFFN(CSummonBotMsg)
+DEFFN(CSummonBotQuerryMsg)
+DEFFN(CTakeHeadPieceMsg)
+DEFFN(CTextInputMsg)
+DEFFN(CTimeDilationMsg)
+DEFFN(CTimeMsg)
+DEFFN(CTitleSequenceEndedMsg)
+DEFFN(CTransitMsg)
+DEFFN(CTransportMsg)
+DEFFN(CTriggerAutoMusicPlayerMsg)
+DEFFN(CTriggerNPCEvent)
+DEFFN(CTrueTalkGetAnimSetMsg)
+DEFFN(CTrueTalkGetAssetDetailsMsg)
+DEFFN(CTrueTalkGetStateValueMsg)
+DEFFN(CTrueTalkNotifySpeechEndedMsg)
+DEFFN(CTrueTalkNotifySpeechStartedMsg)
+DEFFN(CTrueTalkQueueUpAnimSetMsg)
+DEFFN(CTrueTalkSelfQueueAnimSetMsg)
+DEFFN(CTrueTalkTriggerActionMsg)
+DEFFN(CTurnOff)
+DEFFN(CTurnOn)
+DEFFN(CUse)
+DEFFN(CUseWithCharMsg)
+DEFFN(CUseWithOtherMsg)
+DEFFN(CVirtualKeyCharMsg)
+DEFFN(CVisibleMsg)
 
-DEFFN(CEnterBombRoom);
-DEFFN(CEnterBridge);
-DEFFN(CEnterExitFirstClassState);
-DEFFN(CEnterExitMiniLift);
-DEFFN(CEnterExitSecClassMiniLift);
-DEFFN(CEnterExitView);
-DEFFN(CEnterSecClassState);
-DEFFN(CExitArboretum);
-DEFFN(CExitBridge);
-DEFFN(CExitLift);
-DEFFN(CExitPellerator);
-DEFFN(CExitStateRoom);
-DEFFN(CExitTiania);
-DEFFN(CMovePlayerInParrotRoom);
-DEFFN(CMovePlayerTo);
-DEFFN(CMovePlayerToFrom);
-DEFFN(CMultiMove);
-DEFFN(CPanFromPel);
-DEFFN(CRestaurantPanHandler);
-DEFFN(CScraliontisTable);
-DEFFN(CRestrictedMove);
-DEFFN(CTripDownCanal);
+DEFFN(CEnterBombRoom)
+DEFFN(CEnterBridge)
+DEFFN(CEnterExitFirstClassState)
+DEFFN(CEnterExitMiniLift)
+DEFFN(CEnterExitSecClassMiniLift)
+DEFFN(CEnterExitView)
+DEFFN(CEnterSecClassState)
+DEFFN(CExitArboretum)
+DEFFN(CExitBridge)
+DEFFN(CExitLift)
+DEFFN(CExitPellerator)
+DEFFN(CExitStateRoom)
+DEFFN(CExitTiania)
+DEFFN(CMovePlayerInParrotRoom)
+DEFFN(CMovePlayerTo)
+DEFFN(CMovePlayerToFrom)
+DEFFN(CMultiMove)
+DEFFN(CPanFromPel)
+DEFFN(CRestaurantPanHandler)
+DEFFN(CScraliontisTable)
+DEFFN(CRestrictedMove)
+DEFFN(CTripDownCanal)
 
-DEFFN(CBarbot);
-DEFFN(CBellBot);
-DEFFN(CCallBot);
-DEFFN(CDeskbot);
-DEFFN(CDoorbot);
-DEFFN(CLiftBot);
-DEFFN(CMaitreD);
-DEFFN(CMobile);
-DEFFN(CParrot);
-DEFFN(CStarlings);
-DEFFN(CSummonBots);
-DEFFN(CSuccUBus);
-DEFFN(CTitania);
-DEFFN(CAutoMusicPlayer);
-DEFFN(CAutoMusicPlayerBase);
-DEFFN(CAutoSoundPlayer);
-DEFFN(CAutoSoundPlayerADSR);
-DEFFN(CBackgroundSoundMaker);
-DEFFN(CBirdSong);
-DEFFN(CEnterViewTogglesOtherMusic);
-DEFFN(CGondolierSong);
-DEFFN(CMusicPlayer);
-DEFFN(CNodeAutoSoundPlayer);
-DEFFN(CRestrictedAutoMusicPlayer);
-DEFFN(CRoomAutoSoundPlayer);
-DEFFN(CSeasonNoises);
-DEFFN(CSeasonalMusicPlayer);
-DEFFN(CTitaniaSpeech);
-DEFFN(CTriggerAutoMusicPlayer);
-DEFFN(CViewAutoSoundPlayer);
-DEFFN(CViewTogglesOtherMusic);
-DEFFN(CWaterLappingSounds);
+DEFFN(CBarbot)
+DEFFN(CBellBot)
+DEFFN(CCallBot)
+DEFFN(CDeskbot)
+DEFFN(CDoorbot)
+DEFFN(CLiftBot)
+DEFFN(CMaitreD)
+DEFFN(CMobile)
+DEFFN(CParrot)
+DEFFN(CStarlings)
+DEFFN(CSummonBots)
+DEFFN(CSuccUBus)
+DEFFN(CTitania)
+DEFFN(CAutoMusicPlayer)
+DEFFN(CAutoMusicPlayerBase)
+DEFFN(CAutoSoundPlayer)
+DEFFN(CAutoSoundPlayerADSR)
+DEFFN(CBackgroundSoundMaker)
+DEFFN(CBirdSong)
+DEFFN(CEnterViewTogglesOtherMusic)
+DEFFN(CGondolierSong)
+DEFFN(CMusicPlayer)
+DEFFN(CNodeAutoSoundPlayer)
+DEFFN(CRestrictedAutoMusicPlayer)
+DEFFN(CRoomAutoSoundPlayer)
+DEFFN(CSeasonNoises)
+DEFFN(CSeasonalMusicPlayer)
+DEFFN(CTitaniaSpeech)
+DEFFN(CTriggerAutoMusicPlayer)
+DEFFN(CViewAutoSoundPlayer)
+DEFFN(CViewTogglesOtherMusic)
+DEFFN(CWaterLappingSounds)
 
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
diff --git a/engines/titanic/core/saveable_object.h b/engines/titanic/core/saveable_object.h
index 4e7d949..ed26163 100644
--- a/engines/titanic/core/saveable_object.h
+++ b/engines/titanic/core/saveable_object.h
@@ -50,6 +50,8 @@ public:
 	 */
 	static CSaveableObject *createInstance(const Common::String &name);
 public:
+	virtual ~CSaveableObject() {}
+
 	/**
 	 * Return the class name
 	 */
diff --git a/engines/titanic/image.h b/engines/titanic/image.h
index adef011..9030e81 100644
--- a/engines/titanic/image.h
+++ b/engines/titanic/image.h
@@ -67,6 +67,7 @@ public:
 	bool _flag;
 public:
 	Image();
+	virtual ~Image() {}
 
 	virtual void proc6();
 	virtual void set(int width, int height);
diff --git a/engines/titanic/messages/door_auto_sound_event.h b/engines/titanic/messages/door_auto_sound_event.h
index ef41756..7eb1d04 100644
--- a/engines/titanic/messages/door_auto_sound_event.h
+++ b/engines/titanic/messages/door_auto_sound_event.h
@@ -34,7 +34,7 @@ public:
 	int _fieldDC;
 	int _fieldE0;
 public:
-	CDoorAutoSoundEvent::CDoorAutoSoundEvent() : CAutoSoundEvent(),
+	CDoorAutoSoundEvent() : CAutoSoundEvent(),
 		_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
 	}
 
diff --git a/engines/titanic/messages/pet_messages.h b/engines/titanic/messages/pet_messages.h
index 1aeaec0..96e52eb 100644
--- a/engines/titanic/messages/pet_messages.h
+++ b/engines/titanic/messages/pet_messages.h
@@ -40,7 +40,7 @@ RAW_MESSAGE(CPETReceiveMsg);
 RAW_MESSAGE(CPETSetStarDestinationMsg);
 NUM_MESSAGE(CPETStarFieldLockMsg, _value);
 RAW_MESSAGE(CPETStereoFieldOnOffMsg);
-SNUM_MESSAGE_VAL(CPETTargetMsg, _strValue, _numValue, nullptr, -1);
+SNUM_MESSAGE_VAL(CPETTargetMsg, _strValue, _numValue, (const char *)nullptr, -1);
 
 } // End of namespace Titanic
 
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 62dbdcb..258dc2e 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -2,7 +2,6 @@ MODULE := engines/titanic
 
 MODULE_OBJS := \
 	compressed_file.o \
-	compression.o \
 	detection.o \
 	direct_draw.o \
 	font.o \
diff --git a/engines/titanic/pet_control/pet_control_sub_base.h b/engines/titanic/pet_control/pet_control_sub_base.h
index 8542382..ead9a6e 100644
--- a/engines/titanic/pet_control/pet_control_sub_base.h
+++ b/engines/titanic/pet_control/pet_control_sub_base.h
@@ -42,6 +42,7 @@ protected:
 	int _field4;
 public:
 	CPetControlSubBase() : _field4(0) {}
+	virtual ~CPetControlSubBase() {}
 
 	virtual int proc1() { return 0; }
 	virtual int proc2() { return 0; }
diff --git a/engines/titanic/pet_control/pet_val_base.h b/engines/titanic/pet_control/pet_val_base.h
index a270114..1d5399b 100644
--- a/engines/titanic/pet_control/pet_val_base.h
+++ b/engines/titanic/pet_control/pet_val_base.h
@@ -38,6 +38,7 @@ protected:
 public:
 	CPetValBase() : _field4(0), _field8(0), _fieldC(0),
 		_field10(0), _field14(0) {}
+	virtual ~CPetValBase() {}
 
 	virtual void proc1() {}
 	virtual void proc2() {}
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index 9bc365b..ef6f26d 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -61,7 +61,7 @@ void SimpleFile::close() {
 
 void SimpleFile::safeRead(void *dst, size_t count) {
 	if (unsafeRead(dst, count) != count)
-		error("Could not read %d bytes", count);
+		error("Could not read %d bytes", (int)count);
 }
 
 size_t SimpleFile::unsafeRead(void *dst, size_t count) {
@@ -229,7 +229,7 @@ void SimpleFile::writeString(const CString &str) {
 	const char *msgP = str.c_str();
 	char c;
 	
-	while (c = *msgP++) {
+	while ((c = *msgP++) != '\0') {
 		switch (c) {
 		case '\r':
 			write("\\r", 2);
@@ -272,7 +272,7 @@ void SimpleFile::writeQuotedLine(const CString &str, int indent) {
 }
 
 void SimpleFile::writeNumber(int val) {
-	CString str = CString::format("%ld ", val);
+	CString str = CString::format("%d ", val);
 	write(str.c_str(), str.size());
 }
 


Commit: 7e966dbc5e9285da69a55312a81ff280845752ea
    https://github.com/scummvm/scummvm/commit/7e966dbc5e9285da69a55312a81ff280845752ea
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-05T00:12:53-05:00

Commit Message:
TITANIC: gcc compilation fixes

Changed paths:
    engines/titanic/core/list.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_val.cpp



diff --git a/engines/titanic/core/list.h b/engines/titanic/core/list.h
index 00474b9..0ede36e 100644
--- a/engines/titanic/core/list.h
+++ b/engines/titanic/core/list.h
@@ -70,7 +70,7 @@ public:
 		file->writeNumberLine(Common::List<T *>::size(), indent);
 
 		// Iterate through writing entries
-		typename Common::List<typename T *>::const_iterator i;
+		typename Common::List<T *>::const_iterator i;
 		for (i = Common::List<T *>::begin(); i != Common::List<T *>::end(); ++i) {
 			const ListItem *item = *i;
 			item->saveHeader(file, indent);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 258dc2e..f11512e 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -117,7 +117,6 @@ MODULE_OBJS := \
 	game/desk_click_responder.o \
 	game/doorbot_elevator_handler.o \
 	game/doorbot_home_handler.o \
-	game/drawer.o \
 	game/ear_sweet_bowl.o \
 	game/eject_phonograph_button.o \
 	game/elevator_action_area.o \
@@ -166,7 +165,6 @@ MODULE_OBJS := \
 	game/nose_holder.o \
 	game/null_port_hole.o \
 	game/nut_replacer.o \
-	game/pet_controler.o \
 	game/pet_disabler.o \
 	game/phonograph.o \
 	game/phonograph_lid.o \
@@ -375,8 +373,6 @@ MODULE_OBJS := \
 	pet_control/pet_control_list_item.o \
 	pet_control/pet_control_list_item2.o \
 	pet_control/pet_control_sub_base.o \
-	pet_control/pet_control_sub_list_item.o \
-	pet_control/pet_control_sub_list_item2.o \
 	pet_control/pet_control_sub1.o \
 	pet_control/pet_control_sub2.o \
 	pet_control/pet_control_sub3.o \
diff --git a/engines/titanic/pet_control/pet_val.cpp b/engines/titanic/pet_control/pet_val.cpp
index f3ee2bf..f0b9b92 100644
--- a/engines/titanic/pet_control/pet_val.cpp
+++ b/engines/titanic/pet_control/pet_val.cpp
@@ -46,7 +46,7 @@ void CPetVal::proc5(CLinkItemSub *linkItem) {
 }
 
 int CPetVal::proc16() {
-	switch (!_field14) {
+	switch (_field14) {
 	case 0:
 		return _field18;
 	case 1:


Commit: 03d3d5b539500a77c894ef4479bbe14e1b392fa3
    https://github.com/scummvm/scummvm/commit/03d3d5b539500a77c894ef4479bbe14e1b392fa3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-05T12:14:52-05:00

Commit Message:
TITANIC: Implemented remaining CPetControl classes loading

Changed paths:
  R engines/titanic/game/pet/pet_val.cpp
  R engines/titanic/game/pet/pet_val.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_control_list_item2.cpp
    engines/titanic/pet_control/pet_control_list_item2.h
    engines/titanic/pet_control/pet_control_sub1.cpp
    engines/titanic/pet_control/pet_control_sub1.h
    engines/titanic/pet_control/pet_control_sub12.cpp
    engines/titanic/pet_control/pet_control_sub12.h
    engines/titanic/pet_control/pet_control_sub2.cpp
    engines/titanic/pet_control/pet_control_sub2.h
    engines/titanic/pet_control/pet_control_sub3.cpp
    engines/titanic/pet_control/pet_control_sub3.h
    engines/titanic/pet_control/pet_control_sub4.cpp
    engines/titanic/pet_control/pet_control_sub4.h
    engines/titanic/pet_control/pet_control_sub5.cpp
    engines/titanic/pet_control/pet_control_sub5.h
    engines/titanic/pet_control/pet_control_sub6.cpp
    engines/titanic/pet_control/pet_control_sub6.h
    engines/titanic/pet_control/pet_control_sub7.cpp
    engines/titanic/pet_control/pet_control_sub7.h
    engines/titanic/pet_control/pet_control_sub8.cpp
    engines/titanic/pet_control/pet_control_sub8.h
    engines/titanic/pet_control/pet_control_sub_base.h
    engines/titanic/pet_control/pet_val_base.cpp
    engines/titanic/pet_control/pet_val_base.h



diff --git a/engines/titanic/game/pet/pet_val.cpp b/engines/titanic/game/pet/pet_val.cpp
deleted file mode 100644
index b978a8b..0000000
--- a/engines/titanic/game/pet/pet_val.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/pet/pet_val.h"
-
-namespace Titanic {
-
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_val.h b/engines/titanic/game/pet/pet_val.h
deleted file mode 100644
index f5cae82..0000000
--- a/engines/titanic/game/pet/pet_val.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_VAL_H
-#define TITANIC_PET_VAL_H
-
-#include "titanic/game/pet/pet_val_base.h"
-
-namespace Titanic {
-
-class CPetVal: public CPetValBase {
-private:
-	int _field18;
-	int _field1C;
-	int _field20;
-public:
-	CPetVal() : CPetValBase(), _field18(0), _field1C(0), _field20(0) {}
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_VAL_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index f11512e..e597860 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -238,8 +238,6 @@ MODULE_OBJS := \
 	game/pet/pet_sounds.o \
 	game/pet/pet_transition.o \
 	game/pet/pet_transport.o \
-	game/pet/pet_val_base.o \
-	game/pet/pet_val.o \
 	game/pickup/pick_up.o \
 	game/pickup/pick_up_bar_glass.o \
 	game/pickup/pick_up_hose.o \
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 354ed39..e123e99 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -36,14 +36,14 @@ void CPetControl::save(SimpleFile *file, int indent) const {
 
 void CPetControl::load(SimpleFile *file) {
 	int val = file->readNumber();
-	// TODO: sub_43A9E0
+	bool valid = isValid();
 	
-	if (!val) {
+	if (!valid) {
 		_fieldBC = file->readNumber();
 		_string1 = file->readString();
 		_string2 = file->readString();
 		
-		loadSubObjects(file);
+		loadSubObjects(file, 0);
 	}
 
 	CGameObject::load(file);
@@ -53,15 +53,22 @@ void CPetControl::gameLoaded() {
 	// TODO
 }
 
-void CPetControl::loadSubObjects(SimpleFile *file) {
-	_sub1.load(file);
-	_sub2.load(file);
-	_sub3.load(file);
-	_sub4.load(file);
-	_sub5.load(file);
-	_sub6.load(file);
-	_sub7.load(file);
-	_sub8.load(file);
+bool CPetControl::isValid() const {
+	return _sub1.isValid() && _sub2.isValid()
+		&& _sub3.isValid() && _sub4.isValid()
+		&& _sub5.isValid() && _sub6.isValid()
+		&& _sub7.isValid() && _sub8.isValid();
+}
+
+void CPetControl::loadSubObjects(SimpleFile *file, int param) {
+	_sub1.load(file, param);
+	_sub2.load(file, param);
+	_sub3.load(file, param);
+	_sub4.load(file, param);
+	_sub5.load(file, param);
+	_sub6.load(file, param);
+	_sub7.load(file, param);
+	_sub8.load(file, param);
 }
 
 void CPetControl::saveSubObjects(SimpleFile *file, int indent) const {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index dab4426..087ecd1 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -55,7 +55,12 @@ private:
 	CString _string2;
 	int _field13A4;
 private:
-	void loadSubObjects(SimpleFile *file);
+	/**
+	 * Returns true if the control is in a valid state
+	 */
+	bool isValid() const;
+
+	void loadSubObjects(SimpleFile *file, int param);
 
 	void saveSubObjects(SimpleFile *file, int indent) const;
 public:
diff --git a/engines/titanic/pet_control/pet_control_list_item2.cpp b/engines/titanic/pet_control/pet_control_list_item2.cpp
index 05847a9..82b5992 100644
--- a/engines/titanic/pet_control/pet_control_list_item2.cpp
+++ b/engines/titanic/pet_control/pet_control_list_item2.cpp
@@ -23,12 +23,15 @@
 #include "titanic/pet_control/pet_control_list_item2.h"
 
 namespace Titanic {
-/*
-CPetControlListItem2::CPetControlListItem2(),
+
+CPetControlListItem2::CPetControlListItem2() :
 	_field34(0), _field38(0), _field3C(0), _field40(0),
 	_field44(0), _field48(0), _field4C(0), _field50(0),
 	_field54(0), _field58(0), _field5C(0) {
 }
-*/
+
+void CPetControlListItem2::setField34(int val) {
+	_field34 = val;
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_list_item2.h b/engines/titanic/pet_control/pet_control_list_item2.h
index 26f32d5..a7f28fa 100644
--- a/engines/titanic/pet_control/pet_control_list_item2.h
+++ b/engines/titanic/pet_control/pet_control_list_item2.h
@@ -41,7 +41,9 @@ protected:
 	int _field58;
 	int _field5C;
 public:
-	//CPetControlListItem2();
+	CPetControlListItem2();
+
+	void setField34(int val);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub1.cpp b/engines/titanic/pet_control/pet_control_sub1.cpp
index 7ca6d6f..0daae06 100644
--- a/engines/titanic/pet_control/pet_control_sub1.cpp
+++ b/engines/titanic/pet_control/pet_control_sub1.cpp
@@ -31,8 +31,12 @@ void CPetControlSub1::save(SimpleFile *file, int indent) const {
 
 }
 
-void CPetControlSub1::load(SimpleFile *file) {
+void CPetControlSub1::load(SimpleFile *file, int param) {
+	_sub2.load(file, param);
+	_sub1.load(file, param);
 
+	for (int idx = 0; idx < 3; ++idx)
+		_valArray3[idx] = file->readNumber();
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub1.h b/engines/titanic/pet_control/pet_control_sub1.h
index fbe1bbb..e826182 100644
--- a/engines/titanic/pet_control/pet_control_sub1.h
+++ b/engines/titanic/pet_control/pet_control_sub1.h
@@ -61,7 +61,7 @@ public:
 	/**
 	 * Load the data for the class from file
 	 */
-	virtual void load(SimpleFile *file);
+	virtual void load(SimpleFile *file, int param);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub12.cpp b/engines/titanic/pet_control/pet_control_sub12.cpp
index 1e8d628..616d692 100644
--- a/engines/titanic/pet_control/pet_control_sub12.cpp
+++ b/engines/titanic/pet_control/pet_control_sub12.cpp
@@ -24,15 +24,57 @@
 
 namespace Titanic {
 
-CPetControlSub12::CPetControlSub12() :
-	_field0(0), _field4(0), _field8(0), _field18(0),
-	_field1C(0), _field20(0), _field24(0), _field28(0),
-	_field2C(0), _field30(0), _field34(0), _field38(0),
-	_field3C(0), _field40(0), _field44(0), _field48(0),
-	_field4C(0), _field50(0), _field54(0), _field58(0),
-	_field5C(0), _field60(0), _field64(0), _field68(0),
-	_field6C(0), _field70(0), _field74(0), _field78(0),
+CPetControlSub12::CPetControlSub12(int count) :
+	_field18(0), _field1C(0), _field20(0), _field24(0),
+	_field28(0), _field30(-1), _field34(0), _field38(-1),
+	_field3C(0), _field40(0), _field44(0), _field48(0xff),
+	_field4C(0xff), _field50(0xff), _field54(0), _field58(0),
+	_field5C(200), _field60(0), _field64(0), _field68(0),
+	_field6C(0), _field70(1), _field74(0), _field78(0),
 	_field7C(0) {
+	setupArrays(count);
 }
 
+void CPetControlSub12::setupArrays(int count) {
+	freeArrays();
+	if (count < 10 || count > 60)
+		count = 10;
+	_array.resize(count);
+}
+
+void CPetControlSub12::freeArrays() {
+	_array.clear();
+}
+
+void CPetControlSub12::load(SimpleFile *file, int param) {
+	if (!param) {
+		int var1 = file->readNumber();
+		int var2 = file->readNumber();
+		uint count = file->readNumber();
+		_field1C = file->readNumber();
+		_field20 = file->readNumber();
+		_field24 = file->readNumber();
+		_field28 = file->readNumber();
+		_field3C = file->readNumber();
+		_field40 = file->readNumber();
+		_field44 = file->readNumber();
+		_field48 = file->readNumber();
+		_field4C = file->readNumber();
+		_field50 = file->readNumber();
+		_field54 = file->readNumber();
+		_field58 = file->readNumber();
+		_field5C = file->readNumber();
+		_field70 = file->readNumber();
+		_field74 = file->readNumber();
+
+		assert(_array.size() >= count);
+		for (uint idx = 0; idx < count; ++idx) {
+			_array[idx]._string1 = file->readString();
+			_array[idx]._string2 = file->readString();
+			_array[idx]._string3 = file->readString();
+		}	
+	}
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub12.h b/engines/titanic/pet_control/pet_control_sub12.h
index b90c451..5c0f0b3 100644
--- a/engines/titanic/pet_control/pet_control_sub12.h
+++ b/engines/titanic/pet_control/pet_control_sub12.h
@@ -28,17 +28,19 @@
 namespace Titanic {
 
 class CPetControlSub12 {
-protected:
-	int _field0;
-	int _field4;
-	int _field8;
+	struct ArrayEntry {
+		CString _string1;
+		CString _string2;
+		CString _string3;
+	};
+private:
+	Common::Array<ArrayEntry> _array;
 	CString _string1;
 	int _field18;
 	int _field1C;
 	int _field20;
 	int _field24;
 	int _field28;
-	int _field2C;
 	int _field30;
 	int _field34;
 	int _field38;
@@ -59,9 +61,14 @@ protected:
 	int _field74;
 	int _field78;
 	int _field7C;
+private:
+	void setupArrays(int count);
+
+	void freeArrays();
 public:
-	CPetControlSub12();
+	CPetControlSub12(int count = 10);
 
+	void load(SimpleFile *file, int param);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub2.cpp b/engines/titanic/pet_control/pet_control_sub2.cpp
index 84896bb..2e8b35e 100644
--- a/engines/titanic/pet_control/pet_control_sub2.cpp
+++ b/engines/titanic/pet_control/pet_control_sub2.cpp
@@ -35,8 +35,25 @@ void CPetControlSub2::save(SimpleFile *file, int indent) const {
 
 }
 
-void CPetControlSub2::load(SimpleFile *file) {
-
+void CPetControlSub2::load(SimpleFile *file, int param) {
+	if (!param) {
+		int count = file->readNumber();
+
+		for (int idx = 0; idx < count; ++idx) {
+			int v1 = file->readNumber();
+			int v2 = file->readNumber();
+			warning("TODO: CPetControlSub2::load - %d,%d", v1, v2);
+		}
+
+		_listItem.setField34(file->readNumber());
+		file->readNumber();
+		_field1C0 = file->readNumber();
+		_field1C4 = file->readNumber();
+		_field1C8 = file->readNumber();
+		_field1CC = file->readNumber();
+		_field1D0 = file->readNumber();
+		_field1D4 = file->readNumber();
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub2.h b/engines/titanic/pet_control/pet_control_sub2.h
index 46ad1ac..d32b30a 100644
--- a/engines/titanic/pet_control/pet_control_sub2.h
+++ b/engines/titanic/pet_control/pet_control_sub2.h
@@ -61,7 +61,7 @@ public:
 	/**
 	 * Load the data for the class from file
 	 */
-	virtual void load(SimpleFile *file);
+	virtual void load(SimpleFile *file, int param);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub3.cpp b/engines/titanic/pet_control/pet_control_sub3.cpp
index 2f508be..d134b1b 100644
--- a/engines/titanic/pet_control/pet_control_sub3.cpp
+++ b/engines/titanic/pet_control/pet_control_sub3.cpp
@@ -24,12 +24,4 @@
 
 namespace Titanic {
 
-void CPetControlSub3::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub3::load(SimpleFile *file) {
-
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub3.h b/engines/titanic/pet_control/pet_control_sub3.h
index b5eebb1..aa53db5 100644
--- a/engines/titanic/pet_control/pet_control_sub3.h
+++ b/engines/titanic/pet_control/pet_control_sub3.h
@@ -46,15 +46,8 @@ private:
 	CPetVal _val11;
 	CPetControlSub12 _sub12;
 public:
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
+
+
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub4.cpp b/engines/titanic/pet_control/pet_control_sub4.cpp
index 49e5cb2..041bf50 100644
--- a/engines/titanic/pet_control/pet_control_sub4.cpp
+++ b/engines/titanic/pet_control/pet_control_sub4.cpp
@@ -35,8 +35,8 @@ void CPetControlSub4::save(SimpleFile *file, int indent) const {
 
 }
 
-void CPetControlSub4::load(SimpleFile *file) {
-
+void CPetControlSub4::load(SimpleFile *file, int param) {
+	_field298 = file->readNumber();
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub4.h b/engines/titanic/pet_control/pet_control_sub4.h
index b5de13b..18dbd7c 100644
--- a/engines/titanic/pet_control/pet_control_sub4.h
+++ b/engines/titanic/pet_control/pet_control_sub4.h
@@ -51,7 +51,7 @@ public:
 	/**
 	 * Load the data for the class from file
 	 */
-	virtual void load(SimpleFile *file);
+	virtual void load(SimpleFile *file, int param);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub5.cpp b/engines/titanic/pet_control/pet_control_sub5.cpp
index 461fb1e..6a9b92e 100644
--- a/engines/titanic/pet_control/pet_control_sub5.cpp
+++ b/engines/titanic/pet_control/pet_control_sub5.cpp
@@ -24,12 +24,20 @@
 
 namespace Titanic {
 
+CPetControlSub5::CPetControlSub5() :
+	_field98(0), _field9C(0), _fieldA0(0),
+	_field18C(0), _field20C(0), _field210(0) {
+}
+
 void CPetControlSub5::save(SimpleFile *file, int indent) const {
 
 }
 
-void CPetControlSub5::load(SimpleFile *file) {
-
+void CPetControlSub5::load(SimpleFile *file, int param) {
+	if (!param) {
+		_field20C = file->readNumber();
+		_field210 = file->readNumber();
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub5.h b/engines/titanic/pet_control/pet_control_sub5.h
index 41b37fd..5ef1b26 100644
--- a/engines/titanic/pet_control/pet_control_sub5.h
+++ b/engines/titanic/pet_control/pet_control_sub5.h
@@ -24,6 +24,7 @@
 #define TITANIC_PET_CONTROL_SUB5_H
 
 #include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_control_sub12.h"
 #include "titanic/pet_control/pet_val.h"
 
 namespace Titanic {
@@ -34,13 +35,18 @@ private:
 	CPetVal _val2;
 	CPetVal _val3;
 	CPetVal _val4;
-	CPetControlSubData _field17C;
 	int _field98;
 	int _field9C;
 	int _fieldA0;
 	CPetVal _valArray1[6];
-
+	CPetControlSubData _field17C;
+	int _field18C;
+	CPetControlSub12 _sub12;
+	int _field20C;
+	int _field210;
 public:
+	CPetControlSub5();
+
 	/**
 	 * Save the data for the class to file
 	 */
@@ -49,7 +55,7 @@ public:
 	/**
 	 * Load the data for the class from file
 	 */
-	virtual void load(SimpleFile *file);
+	virtual void load(SimpleFile *file, int param);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub6.cpp b/engines/titanic/pet_control/pet_control_sub6.cpp
index d33ea1f..d017e81 100644
--- a/engines/titanic/pet_control/pet_control_sub6.cpp
+++ b/engines/titanic/pet_control/pet_control_sub6.cpp
@@ -24,12 +24,4 @@
 
 namespace Titanic {
 
-void CPetControlSub6::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub6::load(SimpleFile *file) {
-
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub6.h b/engines/titanic/pet_control/pet_control_sub6.h
index 93f83c2..420da0c 100644
--- a/engines/titanic/pet_control/pet_control_sub6.h
+++ b/engines/titanic/pet_control/pet_control_sub6.h
@@ -34,15 +34,7 @@ private:
 	CPetControlSub10 _sub10;
 	CPetControlSub10 _sub12;
 public:
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
 
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub7.cpp b/engines/titanic/pet_control/pet_control_sub7.cpp
index 8333dc1..f57454d 100644
--- a/engines/titanic/pet_control/pet_control_sub7.cpp
+++ b/engines/titanic/pet_control/pet_control_sub7.cpp
@@ -24,12 +24,4 @@
 
 namespace Titanic {
 
-void CPetControlSub7::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub7::load(SimpleFile *file) {
-
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub7.h b/engines/titanic/pet_control/pet_control_sub7.h
index d74ac3c..f4a1dec 100644
--- a/engines/titanic/pet_control/pet_control_sub7.h
+++ b/engines/titanic/pet_control/pet_control_sub7.h
@@ -33,15 +33,7 @@ private:
 	CPetControlSub12 _sub1;
 	CPetControlSub12 _sub2;
 public:
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
 
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub8.cpp b/engines/titanic/pet_control/pet_control_sub8.cpp
index c2b0f7f..18c68c7 100644
--- a/engines/titanic/pet_control/pet_control_sub8.cpp
+++ b/engines/titanic/pet_control/pet_control_sub8.cpp
@@ -33,12 +33,4 @@ CPetControlSub8::CPetControlSub8() {
 		_indexes[INDEXES[idx]] = idx;
 }
 
-void CPetControlSub8::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub8::load(SimpleFile *file) {
-
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub8.h b/engines/titanic/pet_control/pet_control_sub8.h
index 391d4cf..115e6d5 100644
--- a/engines/titanic/pet_control/pet_control_sub8.h
+++ b/engines/titanic/pet_control/pet_control_sub8.h
@@ -42,15 +42,6 @@ private:
 public:
 	CPetControlSub8();
 
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub_base.h b/engines/titanic/pet_control/pet_control_sub_base.h
index ead9a6e..b59c85b 100644
--- a/engines/titanic/pet_control/pet_control_sub_base.h
+++ b/engines/titanic/pet_control/pet_control_sub_base.h
@@ -69,14 +69,14 @@ public:
 	/**
 	 * Load the data for the class from file
 	 */
-	virtual void load(SimpleFile *file) = 0;
+	virtual void load(SimpleFile *file, int param) {}
 
 	virtual void proc19() {}
 
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const = 0;
+	virtual void save(SimpleFile *file, int indent) const {}
 
 	virtual void proc21() {}
 	virtual void proc22() {}
diff --git a/engines/titanic/pet_control/pet_val_base.cpp b/engines/titanic/pet_control/pet_val_base.cpp
index fed1b0d..c1d2fa7 100644
--- a/engines/titanic/pet_control/pet_val_base.cpp
+++ b/engines/titanic/pet_control/pet_val_base.cpp
@@ -25,6 +25,9 @@
 
 namespace Titanic {
 
+CPetValBase::CPetValBase() : _field4(0), _field8(0), _fieldC(0),
+		_field10(0), _field14(0) {}
+
 void CPetValBase::proc5(CLinkItemSub *linkItem) {
 	if (linkItem)
 		linkItem->clear();
diff --git a/engines/titanic/pet_control/pet_val_base.h b/engines/titanic/pet_control/pet_val_base.h
index 1d5399b..f5f6e58 100644
--- a/engines/titanic/pet_control/pet_val_base.h
+++ b/engines/titanic/pet_control/pet_val_base.h
@@ -36,8 +36,7 @@ protected:
 	int _field10;
 	int _field14;
 public:
-	CPetValBase() : _field4(0), _field8(0), _fieldC(0),
-		_field10(0), _field14(0) {}
+	CPetValBase();
 	virtual ~CPetValBase() {}
 
 	virtual void proc1() {}


Commit: f01bd1be9f6334a614cdd5ca7a7123b40c4397be
    https://github.com/scummvm/scummvm/commit/f01bd1be9f6334a614cdd5ca7a7123b40c4397be
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-05T15:44:39-05:00

Commit Message:
TITANIC: Create stubs for CStarControl support classes

Changed paths:
  A engines/titanic/star_control/star_control.cpp
  A engines/titanic/star_control/star_control.h
  A engines/titanic/star_control/star_control_sub1.cpp
  A engines/titanic/star_control/star_control_sub1.h
  A engines/titanic/star_control/star_control_sub10.cpp
  A engines/titanic/star_control/star_control_sub10.h
  A engines/titanic/star_control/star_control_sub2.cpp
  A engines/titanic/star_control/star_control_sub2.h
  A engines/titanic/star_control/star_control_sub3.cpp
  A engines/titanic/star_control/star_control_sub3.h
  A engines/titanic/star_control/star_control_sub4.cpp
  A engines/titanic/star_control/star_control_sub4.h
  A engines/titanic/star_control/star_control_sub5.cpp
  A engines/titanic/star_control/star_control_sub5.h
  A engines/titanic/star_control/star_control_sub6.cpp
  A engines/titanic/star_control/star_control_sub6.h
  A engines/titanic/star_control/star_control_sub7.cpp
  A engines/titanic/star_control/star_control_sub7.h
  A engines/titanic/star_control/star_control_sub8.cpp
  A engines/titanic/star_control/star_control_sub8.h
  A engines/titanic/star_control/star_control_sub9.cpp
  A engines/titanic/star_control/star_control_sub9.h
  R engines/titanic/game/star_control.cpp
  R engines/titanic/game/star_control.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 5a60798..8c91c57 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -391,6 +391,8 @@
 #include "titanic/sound/view_toggles_other_music.h"
 #include "titanic/sound/water_lapping_sounds.h"
 
+#include "titanic/star_control/star_control.h"
+
 namespace Titanic {
 
 Common::HashMap<Common::String, CSaveableObject::CreateFunction> * 
@@ -939,6 +941,7 @@ DEFFN(CTriggerAutoMusicPlayer)
 DEFFN(CViewAutoSoundPlayer)
 DEFFN(CViewTogglesOtherMusic)
 DEFFN(CWaterLappingSounds)
+DEFFN(CStarControl);
 
 void CSaveableObject::initClassList() {
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
@@ -1486,6 +1489,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CViewAutoSoundPlayer);
 	ADDFN(CViewTogglesOtherMusic);
 	ADDFN(CWaterLappingSounds);
+	ADDFN(CStarControl);
 }
 
 void CSaveableObject::freeClassList() {
diff --git a/engines/titanic/game/star_control.cpp b/engines/titanic/game/star_control.cpp
deleted file mode 100644
index 0996a0f..0000000
--- a/engines/titanic/game/star_control.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/star_control.h"
-
-namespace Titanic {
-
-void CStarControl::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
-}
-
-void CStarControl::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/star_control.h b/engines/titanic/game/star_control.h
deleted file mode 100644
index c76e9be..0000000
--- a/engines/titanic/game/star_control.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_CONTROL_H
-#define TITANIC_STAR_CONTROL_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CStarControl : public CGameObject {
-public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CStarControl"; }
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index e597860..a8fd6eb 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -188,7 +188,6 @@ MODULE_OBJS := \
 	game/show_cell_points.o \
 	game/speech_dispensor.o \
 	game/splash_animation.o \
-	game/star_control.o \
 	game/starling_puret.o \
 	game/start_action.o \
 	game/stop_phonograph_button.o \
@@ -403,7 +402,18 @@ MODULE_OBJS := \
 	sound/trigger_auto_music_player.o \
 	sound/view_auto_sound_player.o \
 	sound/view_toggles_other_music.o \
-	sound/water_lapping_sounds.o
+	sound/water_lapping_sounds.o \
+	star_control/star_control.o \
+	star_control/star_control_sub1.o \
+	star_control/star_control_sub2.o \
+	star_control/star_control_sub3.o \
+	star_control/star_control_sub4.o \
+	star_control/star_control_sub5.o \
+	star_control/star_control_sub6.o \
+	star_control/star_control_sub7.o \
+	star_control/star_control_sub8.o \
+	star_control/star_control_sub9.o \
+	star_control/star_control_sub10.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
new file mode 100644
index 0000000..d6cd20a
--- /dev/null
+++ b/engines/titanic/star_control/star_control.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control.h"
+
+namespace Titanic {
+
+void CStarControl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CStarControl::load(SimpleFile *file) {
+	int val = file->readNumber();
+	
+	if (!val) {
+
+	}
+	
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
new file mode 100644
index 0000000..c76e9be
--- /dev/null
+++ b/engines/titanic/star_control/star_control.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_H
+#define TITANIC_STAR_CONTROL_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CStarControl : public CGameObject {
+public:
+	/**
+	 * Return the class name
+	 */
+	virtual const char *getClassName() const { return "CStarControl"; }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_H */
diff --git a/engines/titanic/star_control/star_control_sub1.cpp b/engines/titanic/star_control/star_control_sub1.cpp
new file mode 100644
index 0000000..7122347
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub1.cpp
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub1.h"
+
+namespace Titanic {
+
+CStarControlSub1::CStarControlSub1() :
+	_field7DA8(0), _field7DAC(0), _field7DB0(0),
+	_field7DB4(1), _field7DB8(0), _field7DBC(0) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub1.h b/engines/titanic/star_control/star_control_sub1.h
new file mode 100644
index 0000000..ce160eb
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub1.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB1_H
+#define TITANIC_STAR_CONTROL_SUB1_H
+
+#include "titanic/star_control/star_control_sub2.h"
+#include "titanic/star_control/star_control_sub5.h"
+#include "titanic/star_control/star_control_sub7.h"
+#include "titanic/star_control/star_control_sub8.h"
+#include "titanic/star_control/star_control_sub9.h"
+#include "titanic/star_control/star_control_sub10.h"
+
+namespace Titanic {
+
+class CStarControlSub1 : public CStarControlSub2 {
+private:
+	CStarControlSub7 _sub7;
+	CStarControlSub8 _sub8;
+	CStarControlSub9 _sub9;
+	CStarControlSub10 _sub10;
+	CStarControlSub5 _sub5;
+	int _field7DA8;
+	int _field7DAC;
+	int _field7DB0;
+	int _field7DB4;
+	int _field7DB8;
+	int _field7DBC;
+public:
+	CStarControlSub1();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB1_H */
diff --git a/engines/titanic/star_control/star_control_sub10.cpp b/engines/titanic/star_control/star_control_sub10.cpp
new file mode 100644
index 0000000..ca32f5e
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub10.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub10.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub10.h b/engines/titanic/star_control/star_control_sub10.h
new file mode 100644
index 0000000..af4ad17
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub10.h
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB10_H
+#define TITANIC_STAR_CONTROL_SUB10_H
+
+namespace Titanic {
+
+class CStarControlSub10 {
+private:
+	int _field0;
+	int _field4;
+public:
+	CStarControlSub10() : _field0(0), _field4(0) {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB10_H */
diff --git a/engines/titanic/star_control/star_control_sub2.cpp b/engines/titanic/star_control/star_control_sub2.cpp
new file mode 100644
index 0000000..9b9a5f8
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub2.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub2.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub2.h b/engines/titanic/star_control/star_control_sub2.h
new file mode 100644
index 0000000..2bae029
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub2.h
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB2_H
+#define TITANIC_STAR_CONTROL_SUB2_H
+
+#include "titanic/star_control/star_control_sub3.h"
+
+namespace Titanic {
+
+class CStarControlSub2: public CStarControlSub3 {
+public:
+	virtual ~CStarControlSub2() {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB2_H */
diff --git a/engines/titanic/star_control/star_control_sub3.cpp b/engines/titanic/star_control/star_control_sub3.cpp
new file mode 100644
index 0000000..72991b1
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub3.cpp
@@ -0,0 +1,31 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub3.h"
+
+namespace Titanic {
+
+CStarControlSub3::CStarControlSub3() : _field4(0), _field8(0),
+		_fieldC(1), _field28(0), _field2C(0x3F800000) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub3.h b/engines/titanic/star_control/star_control_sub3.h
new file mode 100644
index 0000000..cc214c3
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub3.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB3_H
+#define TITANIC_STAR_CONTROL_SUB3_H
+
+#include "titanic/star_control/star_control_sub4.h"
+
+namespace Titanic {
+
+class CStarControlSub3 {
+protected:
+	int _field4;
+	int _field8;
+	int _fieldC;
+	CStarControlSub4 _sub4;
+	int _field28;
+	int _field2C;
+public:
+	CStarControlSub3();
+	virtual ~CStarControlSub3() {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB3_H */
diff --git a/engines/titanic/star_control/star_control_sub4.cpp b/engines/titanic/star_control/star_control_sub4.cpp
new file mode 100644
index 0000000..27ef859
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub4.cpp
@@ -0,0 +1,31 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub4.h"
+
+namespace Titanic {
+
+CStarControlSub4::CStarControlSub4() : _field0(0), 
+	_field4(0), _fieldC(0), _field10(0), _field14(0) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub4.h b/engines/titanic/star_control/star_control_sub4.h
new file mode 100644
index 0000000..4aa75f8
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub4.h
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB4_H
+#define TITANIC_STAR_CONTROL_SUB4_H
+
+namespace Titanic {
+
+class CStarControlSub4 {
+private:
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+public:
+	CStarControlSub4();
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB4_H */
diff --git a/engines/titanic/star_control/star_control_sub5.cpp b/engines/titanic/star_control/star_control_sub5.cpp
new file mode 100644
index 0000000..64e48e1
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub5.cpp
@@ -0,0 +1,31 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub5.h"
+
+namespace Titanic {
+
+CStarControlSub5::CStarControlSub5() :
+	_field4(1), _field78AC(0), _field78B0(0) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub5.h b/engines/titanic/star_control/star_control_sub5.h
new file mode 100644
index 0000000..c3621e9
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub5.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB5_H
+#define TITANIC_STAR_CONTROL_SUB5_H
+
+#include "titanic/star_control/star_control_sub6.h"
+
+namespace Titanic {
+
+class CStarControlSub5 {
+	struct SubEntry {
+		int _field0;
+		int _field4;
+		int _field8;
+		int _fieldC;
+	};
+private:
+	int _field4;
+	SubEntry _array[5];
+	CStarControlSub6 _sub1, _sub2;
+	int _field7914;
+	int _field78AC;
+	int _field78B0;
+public:
+	CStarControlSub5();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB5_H */
diff --git a/engines/titanic/star_control/star_control_sub6.cpp b/engines/titanic/star_control/star_control_sub6.cpp
new file mode 100644
index 0000000..48285a7
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub6.cpp
@@ -0,0 +1,33 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub6.h"
+
+namespace Titanic {
+
+CStarControlSub6::CStarControlSub6() :
+	_field0(0x3F800000), _field4(0), _field8(0), _fieldC(0),
+	_field10(0x3F800000), _field14(0), _field18(0), _field1C(0),
+	_field20(0x3F800000), _field24(0), _field28(0), _field2C(0) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub6.h b/engines/titanic/star_control/star_control_sub6.h
new file mode 100644
index 0000000..d57b35c
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub6.h
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB6_H
+#define TITANIC_STAR_CONTROL_SUB6_H
+
+namespace Titanic {
+
+class CStarControlSub6 {
+private:
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+	int _field28;
+	int _field2C;
+public:
+	CStarControlSub6();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB6_H */
diff --git a/engines/titanic/star_control/star_control_sub7.cpp b/engines/titanic/star_control/star_control_sub7.cpp
new file mode 100644
index 0000000..0677e33
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub7.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub7.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub7.h b/engines/titanic/star_control/star_control_sub7.h
new file mode 100644
index 0000000..9999423
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub7.h
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB7_H
+#define TITANIC_STAR_CONTROL_SUB7_H
+
+#include "titanic/star_control/star_control_sub3.h"
+namespace Titanic {
+
+class CStarControlSub7 : public CStarControlSub3 {
+public:
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB7_H */
diff --git a/engines/titanic/star_control/star_control_sub8.cpp b/engines/titanic/star_control/star_control_sub8.cpp
new file mode 100644
index 0000000..cdb249b
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub8.cpp
@@ -0,0 +1,31 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub8.h"
+
+namespace Titanic {
+
+CStarControlSub8::CStarControlSub8() :
+	_field0(0), _field4(0), _field8(-1), _fieldC(-1) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub8.h b/engines/titanic/star_control/star_control_sub8.h
new file mode 100644
index 0000000..511bee4
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub8.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB8_H
+#define TITANIC_STAR_CONTROL_SUB8_H
+
+namespace Titanic {
+
+class CStarControlSub8 {
+	struct StructEntry {
+		int _field0;
+		int _field4;
+		int _field8;
+		int _fieldC;
+	};
+private:
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	StructEntry _array[3];
+public:
+	CStarControlSub8();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB8_H */
diff --git a/engines/titanic/star_control/star_control_sub9.cpp b/engines/titanic/star_control/star_control_sub9.cpp
new file mode 100644
index 0000000..92ce8f6
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub9.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub9.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub9.h b/engines/titanic/star_control/star_control_sub9.h
new file mode 100644
index 0000000..67a14a5
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub9.h
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB9_H
+#define TITANIC_STAR_CONTROL_SUB9_H
+
+namespace Titanic {
+
+class CStarControlSub9 {
+	struct ArrayEntry {
+		int _field0;
+		int _field4;
+		int _field8;
+		ArrayEntry() : _field0(0), _field4(0), _field8(0) {}
+	};
+private:
+	ArrayEntry _array[80];
+public:
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB9_H */


Commit: 20725a0edaa8e92d49a59328e6a63bfb97c4a57c
    https://github.com/scummvm/scummvm/commit/20725a0edaa8e92d49a59328e6a63bfb97c4a57c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-05T21:44:57-05:00

Commit Message:
TITANIC: Further work on CStarControl support classes and loading

Changed paths:
  A engines/titanic/star_control/star_control_sub11.cpp
  A engines/titanic/star_control/star_control_sub11.h
  A engines/titanic/star_control/star_control_sub12.cpp
  A engines/titanic/star_control/star_control_sub12.h
  A engines/titanic/star_control/star_control_sub13.cpp
  A engines/titanic/star_control/star_control_sub13.h
  A engines/titanic/star_control/star_control_sub14.cpp
  A engines/titanic/star_control/star_control_sub14.h
  A engines/titanic/star_control/star_control_sub15.cpp
  A engines/titanic/star_control/star_control_sub15.h
    engines/titanic/module.mk
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control.h
    engines/titanic/star_control/star_control_sub1.cpp
    engines/titanic/star_control/star_control_sub1.h
    engines/titanic/star_control/star_control_sub3.cpp
    engines/titanic/star_control/star_control_sub3.h
    engines/titanic/star_control/star_control_sub8.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index a8fd6eb..b9f5b64 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -413,7 +413,12 @@ MODULE_OBJS := \
 	star_control/star_control_sub7.o \
 	star_control/star_control_sub8.o \
 	star_control/star_control_sub9.o \
-	star_control/star_control_sub10.o
+	star_control/star_control_sub10.o \
+	star_control/star_control_sub11.o \
+	star_control/star_control_sub12.o \
+	star_control/star_control_sub13.o \
+	star_control/star_control_sub14.o \
+	star_control/star_control_sub15.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index d6cd20a..c8ee8c2 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -20,10 +20,15 @@
  *
  */
 
+#include "titanic/screen_manager.h"
 #include "titanic/star_control/star_control.h"
 
 namespace Titanic {
 
+CStarControl::CStarControl() : _fieldBC(0), _field80A0(0),
+		_field80A4(0), _field80A8(0), _field80AC(0), _field80B0(0) {
+}
+
 void CStarControl::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
@@ -33,7 +38,16 @@ void CStarControl::load(SimpleFile *file) {
 	int val = file->readNumber();
 	
 	if (!val) {
+		_sub1.load(file, 0);
+		if (!_sub1.initDocument())
+			error("Couldn't initialise the StarField document");
+
+		_sub11.load(file, 0);
+		CScreenManager *screenManager = CScreenManager::setCurrent();
+		if (!screenManager)
+			error("There's no screen  manager during loading");
 
+		warning("TODO");
 	}
 	
 	CGameObject::load(file);
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index c76e9be..2a24e51 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -24,11 +24,24 @@
 #define TITANIC_STAR_CONTROL_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/star_control/star_control_sub1.h"
+#include "titanic/star_control/star_control_sub11.h"
 
 namespace Titanic {
 
 class CStarControl : public CGameObject {
+private:
+	int _fieldBC;
+	CStarControlSub1 _sub1;
+	CStarControlSub11 _sub11;
+	int _field80A0;
+	int _field80A4;
+	int _field80A8;
+	int _field80AC;
+	int _field80B0;
 public:
+	CStarControl();
+
 	/**
 	 * Return the class name
 	 */
diff --git a/engines/titanic/star_control/star_control_sub1.cpp b/engines/titanic/star_control/star_control_sub1.cpp
index 7122347..6adc9a6 100644
--- a/engines/titanic/star_control/star_control_sub1.cpp
+++ b/engines/titanic/star_control/star_control_sub1.cpp
@@ -29,4 +29,21 @@ CStarControlSub1::CStarControlSub1() :
 	_field7DB4(1), _field7DB8(0), _field7DBC(0) {
 }
 
+void CStarControlSub1::load(SimpleFile *file, int param) {
+	if (!param) {
+		_sub7.load(file);
+		_sub8.load(file);
+		_field7DA8 = file->readNumber();
+		_field7DAC = file->readNumber();
+		_field7DB0 = file->readNumber();
+		_field7DB4 = file->readNumber();
+		_field7DBC = file->readNumber();
+	}
+}
+
+bool CStarControlSub1::initDocument() {
+	warning("CStarControlSub1::initDocument");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub1.h b/engines/titanic/star_control/star_control_sub1.h
index ce160eb..2e76a1f 100644
--- a/engines/titanic/star_control/star_control_sub1.h
+++ b/engines/titanic/star_control/star_control_sub1.h
@@ -47,6 +47,13 @@ private:
 	int _field7DBC;
 public:
 	CStarControlSub1();
+
+	/**
+	 * Load the data for the class from file
+	 */
+	void load(SimpleFile *file, int param);
+
+	bool initDocument();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub11.cpp b/engines/titanic/star_control/star_control_sub11.cpp
new file mode 100644
index 0000000..a2bd7b2
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub11.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/screen_manager.h"
+#include "titanic/star_control/star_control_sub11.h"
+
+namespace Titanic {
+
+CStarControlSub11::CStarControlSub11() : 
+		_sub12(nullptr, nullptr), _sub13(nullptr),
+		_field4(0), _field8(0), _field20C(0), _field210(0),
+		_field214(0), _field218(0), _field21C(0) {
+	_sub12.proc3();
+}
+
+void CStarControlSub11::load(SimpleFile *file, int param) {
+	if (!param) {
+		_sub12.load(file, param);
+
+		int val = file->readNumber();
+		if (val)
+			_sub13.load(file, 0);
+
+		_field218 = file->readNumber();
+		_field21C = file->readNumber();
+	}
+}
+
+void CStarControlSub11::save(SimpleFile *file, int indent) const {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub11.h b/engines/titanic/star_control/star_control_sub11.h
new file mode 100644
index 0000000..bff246f
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub11.h
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB11_H
+#define TITANIC_STAR_CONTROL_SUB11_H
+
+#include "titanic/simple_file.h"
+#include "titanic/star_control/star_control_sub12.h"
+#include "titanic/star_control/star_control_sub13.h"
+#include "titanic/star_control/star_control_sub15.h"
+
+namespace Titanic {
+
+class CStarControlSub11 {
+private:
+	int _field0;
+	int _field4;
+	int _field8;
+	CStarControlSub12 _sub12;
+	CStarControlSub13 _sub13;
+	CStarControlSub15 _sub15;
+	int _field20C;
+	int _field210;
+	int _field214;
+	int _field218;
+	int _field21C;
+public:
+	CStarControlSub11();
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB11_H */
diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp
new file mode 100644
index 0000000..3e288e8
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub12.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub12.h"
+
+namespace Titanic {
+
+CStarControlSub12::CStarControlSub12(void *val1, void *val2) : 
+		_field4(-1), _field2C(0), _field108(0),
+		_sub13(val1) {
+}
+
+void CStarControlSub12::load(SimpleFile *file, int param) {
+	_sub13.load(file, param);
+}
+
+void CStarControlSub12::save(SimpleFile *file, int indent) const {
+	_sub13.save(file, indent);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
new file mode 100644
index 0000000..92192ec
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB12_H
+#define TITANIC_STAR_CONTROL_SUB12_H
+
+#include "titanic/simple_file.h"
+#include "titanic/star_control/star_control_sub13.h"
+
+namespace Titanic {
+
+class CStarControlSub12 {
+	struct ArrayEntry {
+		int _field0;
+		int _field4;
+		int _field8;
+		ArrayEntry() : _field0(0), _field4(0), _field8(0) {}
+	};
+private:
+	int _field4;
+	ArrayEntry _array[3];
+	int _field2C;
+	CStarControlSub13 _sub13;
+	int _field108;
+	int _field21C;
+public:
+	CStarControlSub12(void *val1, void *val2);
+
+	virtual void proc3() {}
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB12_H */
diff --git a/engines/titanic/star_control/star_control_sub13.cpp b/engines/titanic/star_control/star_control_sub13.cpp
new file mode 100644
index 0000000..fbe40b9
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub13.cpp
@@ -0,0 +1,75 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub13.h"
+
+namespace Titanic {
+
+CStarControlSub13::CStarControlSub13(void *ptr):
+		_field0(0), _field4(0), _field8(0), _fieldC0(0),
+		_fieldC4(0), _fieldC8(0), _fieldCC(0), _fieldD0(0) {
+	if (ptr) {
+		setup(ptr);
+	} else {
+		_fieldC = 0;
+		_field10 = 0x44480000;
+		_field14 = 0x461C4000;
+		_field18 = 0x41A00000;
+		_field1C = 0x41A00000;
+		_field20 = 600;
+		_field22 = 340;
+		_field24 = 0;
+	}
+
+	_fieldD4 = 0;
+}
+
+void CStarControlSub13::setup(void *ptr) {
+	// TODO
+}
+
+void CStarControlSub13::load(SimpleFile *file, int param) {
+	_field0 = file->readFloat();
+	_field4 = file->readFloat();
+	_field8 = file->readFloat();
+	_fieldC = file->readFloat();
+	_field10 = file->readFloat();
+	_field14 = file->readFloat();
+	_field18 = file->readFloat();
+	_field1C = file->readFloat();
+	_field20 = file->readNumber();
+	_field22 = _field20 >> 16;
+	_field24 = file->readNumber();
+	
+	for (int idx = 0; idx < 5; ++idx)
+		_valArray[idx] = file->readFloat();
+
+	_sub14.load(file, param);
+	_fieldD4 = 0;
+}
+
+void CStarControlSub13::save(SimpleFile *file, int indent) const {
+	_sub14.save(file, indent);
+}
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub13.h b/engines/titanic/star_control/star_control_sub13.h
new file mode 100644
index 0000000..983fa1c
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub13.h
@@ -0,0 +1,73 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB13_H
+#define TITANIC_STAR_CONTROL_SUB13_H
+
+#include "titanic/simple_file.h"
+#include "titanic/star_control/star_control_sub6.h"
+#include "titanic/star_control/star_control_sub14.h"
+
+namespace Titanic {
+
+class CStarControlSub13 {
+private:
+	double _field0;
+	double _field4;
+	double _field8;
+	double _fieldC;
+	double _field10;
+	double _field14;
+	double _field18;
+	double _field1C;
+	int _field20;
+	int _field22;
+	int _field24;
+	double _valArray[5];
+	CStarControlSub14 _sub14;
+	CStarControlSub6 _sub1;
+	CStarControlSub6 _sub2;
+	int _fieldC0;
+	int _fieldC4;
+	int _fieldC8;
+	int _fieldCC;
+	int _fieldD0;
+	int _fieldD4;
+private:
+	void setup(void *ptr);
+public:
+	CStarControlSub13(void *ptr);
+
+	/**
+	 * Load the data for the class from file
+	 */
+	void load(SimpleFile *file, int param);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	void save(SimpleFile *file, int indent) const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB13_H */
diff --git a/engines/titanic/star_control/star_control_sub14.cpp b/engines/titanic/star_control/star_control_sub14.cpp
new file mode 100644
index 0000000..3d02705
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub14.cpp
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub14.h"
+
+namespace Titanic {
+
+CStarControlSub14::CStarControlSub14() :
+	_field0(0x3F800000), _field4(0), _field8(0), _fieldC(0),
+	_field10(0x3F800000), _field14(0), _field18(0), _field1C(0),
+	_field20(0x3F800000) {
+}
+
+void CStarControlSub14::load(SimpleFile *file, int param) {
+	_field0 = file->readFloat();
+	_field4 = file->readFloat();
+	_field8 = file->readFloat();
+	_fieldC = file->readFloat();
+	_field10 = file->readFloat();
+	_field14 = file->readFloat();
+	_field18 = file->readFloat();
+	_field1C = file->readFloat();
+	_field20 = file->readFloat();
+}
+
+void CStarControlSub14::save(SimpleFile *file, int indent) const {
+
+}
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub14.h b/engines/titanic/star_control/star_control_sub14.h
new file mode 100644
index 0000000..63a58bf
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub14.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB14_H
+#define TITANIC_STAR_CONTROL_SUB14_H
+
+#include "titanic/simple_file.h"
+
+namespace Titanic {
+
+class CStarControlSub14 {
+private:
+	double _field0;
+	double _field4;
+	double _field8;
+	double _fieldC;
+	double _field10;
+	double _field14;
+	double _field18;
+	double _field1C;
+	double _field20;
+public:
+	CStarControlSub14();
+
+	/**
+	 * Load the data for the class from file
+	 */
+	void load(SimpleFile *file, int param);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	void save(SimpleFile *file, int indent) const;
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB13_H */
diff --git a/engines/titanic/star_control/star_control_sub15.cpp b/engines/titanic/star_control/star_control_sub15.cpp
new file mode 100644
index 0000000..07ed80c
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub15.cpp
@@ -0,0 +1,31 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub15.h"
+
+namespace Titanic {
+
+CStarControlSub15::CStarControlSub15() : _field4(-1),
+		_field8(32), _fieldC(0), _field10(0), _field14(0) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub15.h b/engines/titanic/star_control/star_control_sub15.h
new file mode 100644
index 0000000..2151c5a
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub15.h
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB15_H
+#define TITANIC_STAR_CONTROL_SUB15_H
+
+#include "titanic/simple_file.h"
+
+namespace Titanic {
+
+class CStarControlSub15 {
+private:
+	double _field4;
+	double _field8;
+	double _fieldC;
+	double _field10;
+	double _field14;
+public:
+	CStarControlSub15();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB15_H */
diff --git a/engines/titanic/star_control/star_control_sub3.cpp b/engines/titanic/star_control/star_control_sub3.cpp
index 72991b1..c65a308 100644
--- a/engines/titanic/star_control/star_control_sub3.cpp
+++ b/engines/titanic/star_control/star_control_sub3.cpp
@@ -28,4 +28,8 @@ CStarControlSub3::CStarControlSub3() : _field4(0), _field8(0),
 		_fieldC(1), _field28(0), _field2C(0x3F800000) {
 }
 
+void CStarControlSub3::proc2() {
+	error("TODO");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub3.h b/engines/titanic/star_control/star_control_sub3.h
index cc214c3..d6d1c30 100644
--- a/engines/titanic/star_control/star_control_sub3.h
+++ b/engines/titanic/star_control/star_control_sub3.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_STAR_CONTROL_SUB3_H
 #define TITANIC_STAR_CONTROL_SUB3_H
 
+#include "titanic/simple_file.h"
 #include "titanic/star_control/star_control_sub4.h"
 
 namespace Titanic {
@@ -38,6 +39,18 @@ protected:
 public:
 	CStarControlSub3();
 	virtual ~CStarControlSub3() {}
+
+	virtual void proc2();
+	virtual int proc3() { return 1; }
+	virtual int proc4() { return 0; }
+	virtual int proc5() { return 0; }
+	virtual int proc6() { return 0; }
+	virtual int proc7() { return 1; }
+
+	virtual void load(SimpleFile *file) {}
+
+	virtual void proc9() {}
+
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub8.h b/engines/titanic/star_control/star_control_sub8.h
index 511bee4..c4b677c 100644
--- a/engines/titanic/star_control/star_control_sub8.h
+++ b/engines/titanic/star_control/star_control_sub8.h
@@ -23,6 +23,8 @@
 #ifndef TITANIC_STAR_CONTROL_SUB8_H
 #define TITANIC_STAR_CONTROL_SUB8_H
 
+#include "titanic/simple_file.h"
+
 namespace Titanic {
 
 class CStarControlSub8 {
@@ -40,6 +42,16 @@ private:
 	StructEntry _array[3];
 public:
 	CStarControlSub8();
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file) {}
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const {}
 };
 
 } // End of namespace Titanic


Commit: ac930083ac701eb21bab1f04cada545ec60211dd
    https://github.com/scummvm/scummvm/commit/ac930083ac701eb21bab1f04cada545ec60211dd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-05T22:46:35-05:00

Commit Message:
TITANIC: Fixes for CStarControl loading

Changed paths:
    engines/titanic/star_control/star_control_sub11.cpp
    engines/titanic/star_control/star_control_sub11.h



diff --git a/engines/titanic/star_control/star_control_sub11.cpp b/engines/titanic/star_control/star_control_sub11.cpp
index a2bd7b2..6c78293 100644
--- a/engines/titanic/star_control/star_control_sub11.cpp
+++ b/engines/titanic/star_control/star_control_sub11.cpp
@@ -27,8 +27,8 @@ namespace Titanic {
 
 CStarControlSub11::CStarControlSub11() : 
 		_sub12(nullptr, nullptr), _sub13(nullptr),
-		_field4(0), _field8(0), _field20C(0), _field210(0),
-		_field214(0), _field218(0), _field21C(0) {
+		_field4(0), _field8(0), _field118(0), _field20C(0),
+		_field210(0), _field214(0), _field218(0), _field21C(0) {
 	_sub12.proc3();
 }
 
@@ -36,8 +36,8 @@ void CStarControlSub11::load(SimpleFile *file, int param) {
 	if (!param) {
 		_sub12.load(file, param);
 
-		int val = file->readNumber();
-		if (val)
+		_field118 = file->readNumber();
+		if (_field118)
 			_sub13.load(file, 0);
 
 		_field218 = file->readNumber();
diff --git a/engines/titanic/star_control/star_control_sub11.h b/engines/titanic/star_control/star_control_sub11.h
index bff246f..6e47f85 100644
--- a/engines/titanic/star_control/star_control_sub11.h
+++ b/engines/titanic/star_control/star_control_sub11.h
@@ -36,6 +36,7 @@ private:
 	int _field4;
 	int _field8;
 	CStarControlSub12 _sub12;
+	int _field118;
 	CStarControlSub13 _sub13;
 	CStarControlSub15 _sub15;
 	int _field20C;


Commit: f423d4d41a0d94067162acf868bc7eba99cd3e17
    https://github.com/scummvm/scummvm/commit/f423d4d41a0d94067162acf868bc7eba99cd3e17
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-05T22:49:12-05:00

Commit Message:
TITANIC: Add missing CMailMan to saveable object list

Changed paths:
    engines/titanic/core/saveable_object.cpp



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 8c91c57..8a1d3c9 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -148,6 +148,7 @@
 #include "titanic/game/light_switch.h"
 #include "titanic/game/little_lift_button.h"
 #include "titanic/game/long_stick_dispenser.h"
+#include "titanic/game/mail_man.h"
 #include "titanic/game/missiveomat.h"
 #include "titanic/game/missiveomat_button.h"
 #include "titanic/game/musical_instrument.h"
@@ -529,6 +530,7 @@ DEFFN(CLight)
 DEFFN(CLightSwitch)
 DEFFN(CLittleLiftButton)
 DEFFN(CLongStickDispenser)
+DEFFN(CMailMan)
 DEFFN(CMissiveOMat)
 DEFFN(CMissiveOMatButton)
 DEFFN(CMusicalInstrument)
@@ -1074,6 +1076,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CLightSwitch);
 	ADDFN(CLittleLiftButton);
 	ADDFN(CLongStickDispenser);
+	ADDFN(CMailMan);
 	ADDFN(CMissiveOMat);
 	ADDFN(CMissiveOMatButton);
 	ADDFN(CMusicalInstrument);


Commit: 7375394b810f3503f168d5770555aa1932d7892d
    https://github.com/scummvm/scummvm/commit/7375394b810f3503f168d5770555aa1932d7892d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-06T19:12:49-05:00

Commit Message:
TITANIC: Converting saveable objects hierarchy to have type data

This is necessary for at least message sending, and probably other
areas, that needs to be able to pass class filtering for message
targets. And I could figure out a clean way to use the built-in RTTI

Changed paths:
    engines/titanic/carry/arm.h
    engines/titanic/carry/auditory_centre.h
    engines/titanic/carry/bowl_ear.h
    engines/titanic/carry/brain.h
    engines/titanic/carry/bridge_piece.h
    engines/titanic/carry/carry.h
    engines/titanic/carry/carry_parrot.h
    engines/titanic/carry/central_core.h
    engines/titanic/carry/chicken.h
    engines/titanic/carry/crushed_tv.h
    engines/titanic/carry/ear.h
    engines/titanic/carry/eye.h
    engines/titanic/carry/feathers.h
    engines/titanic/carry/fruit.h
    engines/titanic/carry/glass.h
    engines/titanic/carry/hammer.h
    engines/titanic/carry/head_piece.h
    engines/titanic/carry/hose.h
    engines/titanic/carry/hose_end.h
    engines/titanic/carry/key.h
    engines/titanic/carry/liftbot_head.h
    engines/titanic/carry/long_stick.h
    engines/titanic/carry/magazine.h
    engines/titanic/carry/maitred_left_arm.h
    engines/titanic/carry/maitred_right_arm.h
    engines/titanic/carry/mouth.h
    engines/titanic/carry/napkin.h
    engines/titanic/carry/nose.h
    engines/titanic/carry/note.h
    engines/titanic/carry/parcel.h
    engines/titanic/carry/perch.h
    engines/titanic/carry/phonograph_cylinder.h
    engines/titanic/carry/phonograph_ear.h
    engines/titanic/carry/photograph.h
    engines/titanic/carry/plug_in.h
    engines/titanic/carry/speech_centre.h
    engines/titanic/carry/sweets.h
    engines/titanic/carry/test_carry.h
    engines/titanic/carry/vision_centre.h
    engines/titanic/core/background.h
    engines/titanic/core/click_responder.h
    engines/titanic/core/dont_save_file_item.h
    engines/titanic/core/drop_target.h
    engines/titanic/core/file_item.h
    engines/titanic/core/game_object.h
    engines/titanic/core/link_item.h
    engines/titanic/core/list.h
    engines/titanic/core/message_target.h
    engines/titanic/core/movie_clip.h
    engines/titanic/core/multi_drop_target.h
    engines/titanic/core/named_item.h
    engines/titanic/core/node_item.h
    engines/titanic/core/project_item.h
    engines/titanic/core/resource_key.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/saveable_object.h
    engines/titanic/core/static_image.h
    engines/titanic/core/tree_item.h
    engines/titanic/core/turn_on_object.h
    engines/titanic/core/turn_on_play_sound.h
    engines/titanic/core/turn_on_turn_off.h
    engines/titanic/core/view_item.h
    engines/titanic/game/announce.h
    engines/titanic/game/annoy_barbot.h
    engines/titanic/game/arb_background.h
    engines/titanic/game/arboretum_gate.h
    engines/titanic/game/auto_animate.h
    engines/titanic/game/bar_bell.h
    engines/titanic/game/bar_menu.h
    engines/titanic/game/bar_menu_button.h
    engines/titanic/game/belbot_get_light.h
    engines/titanic/game/bilge_succubus.h
    engines/titanic/game/bomb.h
    engines/titanic/game/bottom_of_well_monitor.h
    engines/titanic/game/bowl_unlocker.h
    engines/titanic/game/brain_slot.h
    engines/titanic/game/bridge_door.h
    engines/titanic/game/bridge_view.h
    engines/titanic/game/broken_pell_base.h
    engines/titanic/game/broken_pellerator.h
    engines/titanic/game/broken_pellerator_froz.h
    engines/titanic/game/cage.h
    engines/titanic/game/call_pellerator.h
    engines/titanic/game/captains_wheel.h
    engines/titanic/game/cdrom.h
    engines/titanic/game/cdrom_computer.h
    engines/titanic/game/cdrom_tray.h
    engines/titanic/game/cell_point_button.h
    engines/titanic/game/chev_code.h
    engines/titanic/game/chev_panel.h
    engines/titanic/game/chicken_cooler.h
    engines/titanic/game/chicken_dispensor.h
    engines/titanic/game/close_broken_pel.h
    engines/titanic/game/code_wheel.h
    engines/titanic/game/computer.h
    engines/titanic/game/computer_screen.h
    engines/titanic/game/cookie.h
    engines/titanic/game/credits.h
    engines/titanic/game/credits_button.h
    engines/titanic/game/dead_area.h
    engines/titanic/game/desk_click_responder.h
    engines/titanic/game/doorbot_elevator_handler.h
    engines/titanic/game/doorbot_home_handler.h
    engines/titanic/game/ear_sweet_bowl.h
    engines/titanic/game/eject_phonograph_button.h
    engines/titanic/game/elevator_action_area.h
    engines/titanic/game/emma_control.h
    engines/titanic/game/empty_nut_bowl.h
    engines/titanic/game/end_credit_text.h
    engines/titanic/game/end_credits.h
    engines/titanic/game/end_explode_ship.h
    engines/titanic/game/end_game_credits.h
    engines/titanic/game/end_sequence_control.h
    engines/titanic/game/fan.h
    engines/titanic/game/fan_control.h
    engines/titanic/game/fan_decrease.h
    engines/titanic/game/fan_increase.h
    engines/titanic/game/fan_noises.h
    engines/titanic/game/floor_indicator.h
    engines/titanic/game/games_console.h
    engines/titanic/game/get_lift_eye2.h
    engines/titanic/game/glass_smasher.h
    engines/titanic/game/gondolier/gondolier_base.h
    engines/titanic/game/gondolier/gondolier_chest.h
    engines/titanic/game/gondolier/gondolier_face.h
    engines/titanic/game/gondolier/gondolier_mixer.h
    engines/titanic/game/gondolier/gondolier_slider.h
    engines/titanic/game/hammer_clip.h
    engines/titanic/game/hammer_dispensor.h
    engines/titanic/game/hammer_dispensor_button.h
    engines/titanic/game/head_slot.h
    engines/titanic/game/head_smash_event.h
    engines/titanic/game/head_smash_lever.h
    engines/titanic/game/head_spinner.h
    engines/titanic/game/idle_summoner.h
    engines/titanic/game/leave_sec_class_state.h
    engines/titanic/game/lemon_dispensor.h
    engines/titanic/game/light.h
    engines/titanic/game/light_switch.h
    engines/titanic/game/little_lift_button.h
    engines/titanic/game/long_stick_dispenser.h
    engines/titanic/game/mail_man.h
    engines/titanic/game/maitred/maitred_arm_holder.h
    engines/titanic/game/maitred/maitred_body.h
    engines/titanic/game/maitred/maitred_legs.h
    engines/titanic/game/maitred/maitred_prod_receptor.h
    engines/titanic/game/missiveomat.h
    engines/titanic/game/missiveomat_button.h
    engines/titanic/game/movie_tester.h
    engines/titanic/game/music_console_button.h
    engines/titanic/game/music_room_phonograph.h
    engines/titanic/game/music_room_stop_phonograph_button.h
    engines/titanic/game/music_system_lock.h
    engines/titanic/game/musical_instrument.h
    engines/titanic/game/nav_helmet.h
    engines/titanic/game/navigation_computer.h
    engines/titanic/game/no_nut_bowl.h
    engines/titanic/game/nose_holder.h
    engines/titanic/game/null_port_hole.h
    engines/titanic/game/nut_replacer.h
    engines/titanic/game/parrot/parrot_lobby_controller.h
    engines/titanic/game/parrot/parrot_lobby_link_updater.h
    engines/titanic/game/parrot/parrot_lobby_object.h
    engines/titanic/game/parrot/parrot_lobby_view_object.h
    engines/titanic/game/parrot/parrot_loser.h
    engines/titanic/game/parrot/parrot_nut_bowl_actor.h
    engines/titanic/game/parrot/parrot_nut_eater.h
    engines/titanic/game/parrot/parrot_perch_holder.h
    engines/titanic/game/parrot/parrot_succubus.h
    engines/titanic/game/parrot/parrot_trigger.h
    engines/titanic/game/parrot/player_meets_parrot.h
    engines/titanic/game/pet/pet.h
    engines/titanic/game/pet/pet_class1.h
    engines/titanic/game/pet/pet_class2.h
    engines/titanic/game/pet/pet_class3.h
    engines/titanic/game/pet/pet_lift.h
    engines/titanic/game/pet/pet_monitor.h
    engines/titanic/game/pet/pet_pellerator.h
    engines/titanic/game/pet/pet_position.h
    engines/titanic/game/pet/pet_sentinal.h
    engines/titanic/game/pet/pet_sounds.h
    engines/titanic/game/pet/pet_transition.h
    engines/titanic/game/pet/pet_transport.h
    engines/titanic/game/pet_disabler.h
    engines/titanic/game/phonograph.h
    engines/titanic/game/phonograph_lid.h
    engines/titanic/game/pickup/pick_up.h
    engines/titanic/game/pickup/pick_up_bar_glass.h
    engines/titanic/game/pickup/pick_up_hose.h
    engines/titanic/game/pickup/pick_up_lemon.h
    engines/titanic/game/pickup/pick_up_speech_centre.h
    engines/titanic/game/pickup/pick_up_vis_centre.h
    engines/titanic/game/placeholder/bar_shelf_vis_centre.h
    engines/titanic/game/placeholder/lemon_on_bar.h
    engines/titanic/game/placeholder/place_holder.h
    engines/titanic/game/placeholder/tv_on_bar.h
    engines/titanic/game/play_music_button.h
    engines/titanic/game/play_on_act.h
    engines/titanic/game/port_hole.h
    engines/titanic/game/record_phonograph_button.h
    engines/titanic/game/replacement_ear.h
    engines/titanic/game/reserved_table.h
    engines/titanic/game/restaurant_cylinder_holder.h
    engines/titanic/game/restaurant_phonograph.h
    engines/titanic/game/room_item.h
    engines/titanic/game/sauce_dispensor.h
    engines/titanic/game/search_point.h
    engines/titanic/game/season_background.h
    engines/titanic/game/season_barrel.h
    engines/titanic/game/seasonal_adjustment.h
    engines/titanic/game/service_elevator_window.h
    engines/titanic/game/sgt/armchair.h
    engines/titanic/game/sgt/basin.h
    engines/titanic/game/sgt/bedfoot.h
    engines/titanic/game/sgt/bedhead.h
    engines/titanic/game/sgt/chest_of_drawers.h
    engines/titanic/game/sgt/desk.h
    engines/titanic/game/sgt/deskchair.h
    engines/titanic/game/sgt/drawer.h
    engines/titanic/game/sgt/sgt_doors.h
    engines/titanic/game/sgt/sgt_nav.h
    engines/titanic/game/sgt/sgt_navigation.h
    engines/titanic/game/sgt/sgt_restaurant_doors.h
    engines/titanic/game/sgt/sgt_state_control.h
    engines/titanic/game/sgt/sgt_state_room.h
    engines/titanic/game/sgt/sgt_tv.h
    engines/titanic/game/sgt/sgt_upper_doors_sound.h
    engines/titanic/game/sgt/toilet.h
    engines/titanic/game/sgt/vase.h
    engines/titanic/game/sgt/washstand.h
    engines/titanic/game/ship_setting.h
    engines/titanic/game/ship_setting_button.h
    engines/titanic/game/show_cell_points.h
    engines/titanic/game/speech_dispensor.h
    engines/titanic/game/splash_animation.h
    engines/titanic/game/starling_puret.h
    engines/titanic/game/start_action.h
    engines/titanic/game/stop_phonograph_button.h
    engines/titanic/game/sub_glass.h
    engines/titanic/game/sub_wrapper.h
    engines/titanic/game/sweet_bowl.h
    engines/titanic/game/television.h
    engines/titanic/game/third_class_canal.h
    engines/titanic/game/throw_tv_down_well.h
    engines/titanic/game/titania_still_control.h
    engines/titanic/game/tow_parrot_nav.h
    engines/titanic/game/transport/exit_pellerator.h
    engines/titanic/game/transport/gondolier.h
    engines/titanic/game/transport/lift.h
    engines/titanic/game/transport/lift_indicator.h
    engines/titanic/game/transport/pellerator.h
    engines/titanic/game/transport/service_elevator.h
    engines/titanic/game/transport/transport.h
    engines/titanic/game/up_lighter.h
    engines/titanic/game/useless_lever.h
    engines/titanic/game/wheel_button.h
    engines/titanic/game/wheel_hotspot.h
    engines/titanic/game/wheel_spin.h
    engines/titanic/game/wheel_spin_horn.h
    engines/titanic/gfx/act_button.h
    engines/titanic/gfx/changes_season_button.h
    engines/titanic/gfx/chev_left_off.h
    engines/titanic/gfx/chev_left_on.h
    engines/titanic/gfx/chev_right_off.h
    engines/titanic/gfx/chev_right_on.h
    engines/titanic/gfx/chev_send_rec_switch.h
    engines/titanic/gfx/chev_switch.h
    engines/titanic/gfx/edit_control.h
    engines/titanic/gfx/elevator_button.h
    engines/titanic/gfx/get_from_succ.h
    engines/titanic/gfx/helmet_on_off.h
    engines/titanic/gfx/home_photo.h
    engines/titanic/gfx/icon_nav_action.h
    engines/titanic/gfx/icon_nav_butt.h
    engines/titanic/gfx/icon_nav_down.h
    engines/titanic/gfx/icon_nav_image.h
    engines/titanic/gfx/icon_nav_left.h
    engines/titanic/gfx/icon_nav_receive.h
    engines/titanic/gfx/icon_nav_right.h
    engines/titanic/gfx/icon_nav_send.h
    engines/titanic/gfx/icon_nav_up.h
    engines/titanic/gfx/keybrd_butt.h
    engines/titanic/gfx/move_object_button.h
    engines/titanic/gfx/music_control.h
    engines/titanic/gfx/music_slider.h
    engines/titanic/gfx/music_slider_pitch.h
    engines/titanic/gfx/music_slider_speed.h
    engines/titanic/gfx/music_switch.h
    engines/titanic/gfx/music_switch_inversion.h
    engines/titanic/gfx/music_switch_reverse.h
    engines/titanic/gfx/music_voice_mute.h
    engines/titanic/gfx/pet_drag_chev.h
    engines/titanic/gfx/pet_graphic.h
    engines/titanic/gfx/pet_graphic2.h
    engines/titanic/gfx/pet_leaf.h
    engines/titanic/gfx/pet_mode_off.h
    engines/titanic/gfx/pet_mode_on.h
    engines/titanic/gfx/pet_mode_panel.h
    engines/titanic/gfx/pet_pannel1.h
    engines/titanic/gfx/pet_pannel2.h
    engines/titanic/gfx/pet_pannel3.h
    engines/titanic/gfx/send_to_succ.h
    engines/titanic/gfx/sgt_selector.h
    engines/titanic/gfx/slider_button.h
    engines/titanic/gfx/small_chev_left_off.h
    engines/titanic/gfx/small_chev_left_on.h
    engines/titanic/gfx/small_chev_right_off.h
    engines/titanic/gfx/small_chev_right_on.h
    engines/titanic/gfx/st_button.h
    engines/titanic/gfx/status_change_button.h
    engines/titanic/gfx/text_down.h
    engines/titanic/gfx/text_skrew.h
    engines/titanic/gfx/text_up.h
    engines/titanic/gfx/toggle_button.h
    engines/titanic/gfx/toggle_switch.h
    engines/titanic/gfx/volume_control.h
    engines/titanic/messages/auto_sound_event.h
    engines/titanic/messages/bilge_auto_sound_event.h
    engines/titanic/messages/bilge_dispensor_event.h
    engines/titanic/messages/door_auto_sound_event.h
    engines/titanic/messages/messages.h
    engines/titanic/messages/mouse_messages.h
    engines/titanic/messages/pet_messages.h
    engines/titanic/messages/service_elevator_door.h
    engines/titanic/module.mk
    engines/titanic/moves/enter_bomb_room.h
    engines/titanic/moves/enter_bridge.h
    engines/titanic/moves/enter_exit_first_class_state.h
    engines/titanic/moves/enter_exit_mini_lift.h
    engines/titanic/moves/enter_exit_sec_class_mini_lift.h
    engines/titanic/moves/enter_exit_view.h
    engines/titanic/moves/enter_sec_class_state.h
    engines/titanic/moves/exit_arboretum.h
    engines/titanic/moves/exit_bridge.h
    engines/titanic/moves/exit_lift.h
    engines/titanic/moves/exit_pellerator.h
    engines/titanic/moves/exit_state_room.h
    engines/titanic/moves/exit_tiania.h
    engines/titanic/moves/move_player_in_parrot_room.h
    engines/titanic/moves/move_player_to.h
    engines/titanic/moves/move_player_to_from.h
    engines/titanic/moves/multi_move.h
    engines/titanic/moves/pan_from_pel.h
    engines/titanic/moves/restaurant_pan_handler.h
    engines/titanic/moves/restricted_move.h
    engines/titanic/moves/scraliontis_table.h
    engines/titanic/moves/trip_down_canal.h
    engines/titanic/npcs/barbot.h
    engines/titanic/npcs/bellbot.h
    engines/titanic/npcs/callbot.h
    engines/titanic/npcs/character.h
    engines/titanic/npcs/deskbot.h
    engines/titanic/npcs/doorbot.h
    engines/titanic/npcs/liftbot.h
    engines/titanic/npcs/maitre_d.h
    engines/titanic/npcs/mobile.h
    engines/titanic/npcs/parrot.h
    engines/titanic/npcs/robot_controller.h
    engines/titanic/npcs/starlings.h
    engines/titanic/npcs/succubus.h
    engines/titanic/npcs/summon_bots.h
    engines/titanic/npcs/titania.h
    engines/titanic/npcs/true_talk_npc.h
    engines/titanic/pet_control/pet_control.h
    engines/titanic/sound/auto_music_player.h
    engines/titanic/sound/auto_music_player_base.h
    engines/titanic/sound/auto_sound_player.h
    engines/titanic/sound/auto_sound_player_adsr.h
    engines/titanic/sound/background_sound_maker.h
    engines/titanic/sound/bird_song.h
    engines/titanic/sound/dome_from_top_of_well.h
    engines/titanic/sound/enter_view_toggles_other_music.h
    engines/titanic/sound/gondolier_song.h
    engines/titanic/sound/music_player.h
    engines/titanic/sound/node_auto_sound_player.h
    engines/titanic/sound/restricted_auto_music_player.h
    engines/titanic/sound/room_auto_sound_player.h
    engines/titanic/sound/season_noises.h
    engines/titanic/sound/seasonal_music_player.h
    engines/titanic/sound/titania_speech.h
    engines/titanic/sound/trigger_auto_music_player.h
    engines/titanic/sound/view_auto_sound_player.h
    engines/titanic/sound/view_toggles_other_music.h
    engines/titanic/sound/water_lapping_sounds.h
    engines/titanic/star_control/star_control.h



diff --git a/engines/titanic/carry/arm.h b/engines/titanic/carry/arm.h
index 4874707..1f93009 100644
--- a/engines/titanic/carry/arm.h
+++ b/engines/titanic/carry/arm.h
@@ -44,14 +44,10 @@ private:
 	int _field16C;
 	int _field170;
 public:
+	CLASSDEF
 	CArm();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CArm"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/auditory_centre.h b/engines/titanic/carry/auditory_centre.h
index 9708b6f..c429fd7 100644
--- a/engines/titanic/carry/auditory_centre.h
+++ b/engines/titanic/carry/auditory_centre.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CAuditoryCentre : public CBrain {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAuditoryCentre"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/carry/bowl_ear.h b/engines/titanic/carry/bowl_ear.h
index c03446d..1617ced 100644
--- a/engines/titanic/carry/bowl_ear.h
+++ b/engines/titanic/carry/bowl_ear.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CBowlEar : public CEar {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBowlEar"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/carry/brain.h b/engines/titanic/carry/brain.h
index b5ec70e..8cfd491 100644
--- a/engines/titanic/carry/brain.h
+++ b/engines/titanic/carry/brain.h
@@ -33,14 +33,10 @@ private:
 	int _field134;
 	int _field138;
 public:
+	CLASSDEF
 	CBrain();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBrain"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/bridge_piece.h b/engines/titanic/carry/bridge_piece.h
index 50a26c9..b96015a 100644
--- a/engines/titanic/carry/bridge_piece.h
+++ b/engines/titanic/carry/bridge_piece.h
@@ -33,14 +33,10 @@ private:
 	Common::Point _pos3;
 	int _field140;
 public:
+	CLASSDEF
 	CBridgePiece();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBridgePiece"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index b83ecb7..6b3ae23 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -47,14 +47,10 @@ private:
 	int _field124;
 	int _field128;
 public:
+	CLASSDEF
 	CCarry();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCarry"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/carry_parrot.h b/engines/titanic/carry/carry_parrot.h
index d4c7100..a2b1700 100644
--- a/engines/titanic/carry/carry_parrot.h
+++ b/engines/titanic/carry/carry_parrot.h
@@ -38,14 +38,10 @@ private:
 	int _field14C;
 	int _field150;
 public:
+	CLASSDEF
 	CCarryParrot();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCarryParrot"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/central_core.h b/engines/titanic/carry/central_core.h
index 277b302..b397046 100644
--- a/engines/titanic/carry/central_core.h
+++ b/engines/titanic/carry/central_core.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CCentralCore : public CBrain {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCentralCore"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/carry/chicken.h b/engines/titanic/carry/chicken.h
index a2ca321..a81c27c 100644
--- a/engines/titanic/carry/chicken.h
+++ b/engines/titanic/carry/chicken.h
@@ -36,14 +36,10 @@ private:
 	int _field13C;
 	int _field140;
 public:
+	CLASSDEF
 	CChicken();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CChicken"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/crushed_tv.h b/engines/titanic/carry/crushed_tv.h
index ccbeac5..b2bfd75 100644
--- a/engines/titanic/carry/crushed_tv.h
+++ b/engines/titanic/carry/crushed_tv.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CCrushedTV : public CCarry {
 public:
+	CLASSDEF
 	CCrushedTV();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCrushedTV"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/ear.h b/engines/titanic/carry/ear.h
index fbee7d0..2a20620 100644
--- a/engines/titanic/carry/ear.h
+++ b/engines/titanic/carry/ear.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CEar : public CHeadPiece {
 public:
+	CLASSDEF
 	CEar();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEar"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/eye.h b/engines/titanic/carry/eye.h
index 0f0e73b..f7e17fa 100644
--- a/engines/titanic/carry/eye.h
+++ b/engines/titanic/carry/eye.h
@@ -31,14 +31,10 @@ class CEye : public CHeadPiece {
 private:
 	int _eyeNum;
 public:
+	CLASSDEF
 	CEye();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEye"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/feathers.h b/engines/titanic/carry/feathers.h
index 8fc11b7..106e9a0 100644
--- a/engines/titanic/carry/feathers.h
+++ b/engines/titanic/carry/feathers.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CFeathers : public CCarry {
 public:
+	CLASSDEF
 	CFeathers();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CFeathers"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/fruit.h b/engines/titanic/carry/fruit.h
index bc8a109..3d23afd 100644
--- a/engines/titanic/carry/fruit.h
+++ b/engines/titanic/carry/fruit.h
@@ -34,14 +34,10 @@ private:
 	int _field134;
 	int _field138;
 public:
+	CLASSDEF
 	CFruit();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CFruit"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/glass.h b/engines/titanic/carry/glass.h
index 57922c1..55c0322 100644
--- a/engines/titanic/carry/glass.h
+++ b/engines/titanic/carry/glass.h
@@ -31,14 +31,10 @@ class CGlass : public CCarry {
 private:
 	CString _string6;
 public:
+	CLASSDEF
 	CGlass();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGlass"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/hammer.h b/engines/titanic/carry/hammer.h
index ec05435..e3180e7 100644
--- a/engines/titanic/carry/hammer.h
+++ b/engines/titanic/carry/hammer.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CHammer : public CCarry {
 public:
+	CLASSDEF
 	CHammer();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CHammer"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/head_piece.h b/engines/titanic/carry/head_piece.h
index ddadb75..daa59255 100644
--- a/engines/titanic/carry/head_piece.h
+++ b/engines/titanic/carry/head_piece.h
@@ -33,14 +33,10 @@ private:
 	CString _string6;
 	int _field13C;
 public:
+	CLASSDEF
 	CHeadPiece();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CHeadPiece"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/hose.h b/engines/titanic/carry/hose.h
index dc60f68..c16351b 100644
--- a/engines/titanic/carry/hose.h
+++ b/engines/titanic/carry/hose.h
@@ -38,16 +38,12 @@ protected:
 
 	CString _string6;
 public:
+	CLASSDEF
 	CHose();
 	static void init();
 	static void deinit();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CHose"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/hose_end.h b/engines/titanic/carry/hose_end.h
index efce6b8d..d9efb59 100644
--- a/engines/titanic/carry/hose_end.h
+++ b/engines/titanic/carry/hose_end.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CHoseEnd : public CHose {
 public:
+	CLASSDEF
 	CHoseEnd();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CHoseEnd"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/key.h b/engines/titanic/carry/key.h
index 815bb95..e6973b5 100644
--- a/engines/titanic/carry/key.h
+++ b/engines/titanic/carry/key.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CKey : public CCarry {
 public:
+	CLASSDEF
 	CKey();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CKey"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/liftbot_head.h b/engines/titanic/carry/liftbot_head.h
index be4ad58..f2b60c1 100644
--- a/engines/titanic/carry/liftbot_head.h
+++ b/engines/titanic/carry/liftbot_head.h
@@ -31,14 +31,10 @@ class CLiftbotHead : public CCarry {
 private:
 	int _field12C;
 public:
+	CLASSDEF
 	CLiftbotHead();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLiftbotHead"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/long_stick.h b/engines/titanic/carry/long_stick.h
index 3c8646d..e2718a3 100644
--- a/engines/titanic/carry/long_stick.h
+++ b/engines/titanic/carry/long_stick.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CLongStick : public CCarry {
 public:
+	CLASSDEF
 	CLongStick();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLongStick"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/magazine.h b/engines/titanic/carry/magazine.h
index a1a7eee..7621599 100644
--- a/engines/titanic/carry/magazine.h
+++ b/engines/titanic/carry/magazine.h
@@ -32,14 +32,10 @@ private:
 	int _field12C;
 	int _field130;
 public:
+	CLASSDEF
 	CMagazine();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMagazine"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/maitred_left_arm.h b/engines/titanic/carry/maitred_left_arm.h
index f6cf698..e46485c 100644
--- a/engines/titanic/carry/maitred_left_arm.h
+++ b/engines/titanic/carry/maitred_left_arm.h
@@ -31,14 +31,10 @@ class CMaitreDLeftArm : public CArm {
 private:
 	int _field174;
 public:
+	CLASSDEF
 	CMaitreDLeftArm() : CArm(), _field174(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMaitreDLeftArm"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/maitred_right_arm.h b/engines/titanic/carry/maitred_right_arm.h
index a4a4489..c89b7e8 100644
--- a/engines/titanic/carry/maitred_right_arm.h
+++ b/engines/titanic/carry/maitred_right_arm.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CMaitreDRightArm : public CArm {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMaitreDRightArm"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/carry/mouth.h b/engines/titanic/carry/mouth.h
index 837a658..1c446b2 100644
--- a/engines/titanic/carry/mouth.h
+++ b/engines/titanic/carry/mouth.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CMouth : public CHeadPiece {
 public:
+	CLASSDEF
 	CMouth();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMouth"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/napkin.h b/engines/titanic/carry/napkin.h
index 549b292..144189b 100644
--- a/engines/titanic/carry/napkin.h
+++ b/engines/titanic/carry/napkin.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CNapkin : public CCarry {
 public:
+	CLASSDEF
 	CNapkin();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNapkin"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/nose.h b/engines/titanic/carry/nose.h
index 349c0c6..717b639 100644
--- a/engines/titanic/carry/nose.h
+++ b/engines/titanic/carry/nose.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CNose : public CHeadPiece {
 public:
+	CLASSDEF
 	CNose();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNose"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/note.h b/engines/titanic/carry/note.h
index d3923c8..b96e2cf 100644
--- a/engines/titanic/carry/note.h
+++ b/engines/titanic/carry/note.h
@@ -32,14 +32,10 @@ private:
 	CString _string6;
 	int _field138;
 public:
+	CLASSDEF
 	CNote();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNote"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/parcel.h b/engines/titanic/carry/parcel.h
index e16ea9b..59f3ed9 100644
--- a/engines/titanic/carry/parcel.h
+++ b/engines/titanic/carry/parcel.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CParcel : public CCarry {
 public:
+	CLASSDEF
 	CParcel();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CParcel"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/perch.h b/engines/titanic/carry/perch.h
index ce13dbe..1ed2cca 100644
--- a/engines/titanic/carry/perch.h
+++ b/engines/titanic/carry/perch.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPerch : public CCentralCore {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPerch"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/carry/phonograph_cylinder.h b/engines/titanic/carry/phonograph_cylinder.h
index 327ba3e..271ede5 100644
--- a/engines/titanic/carry/phonograph_cylinder.h
+++ b/engines/titanic/carry/phonograph_cylinder.h
@@ -51,14 +51,10 @@ private:
 	int _field180;
 	int _field184;
 public:
+	CLASSDEF
 	CPhonographCylinder();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPhonographCylinder"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/phonograph_ear.h b/engines/titanic/carry/phonograph_ear.h
index ec6cfed..71ef38f 100644
--- a/engines/titanic/carry/phonograph_ear.h
+++ b/engines/titanic/carry/phonograph_ear.h
@@ -31,14 +31,10 @@ class CPhonographEar : public CEar {
 private:
 	int _field140;
 public:
+	CLASSDEF
 	CPhonographEar() : CEar(), _field140(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPhonographEar"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/photograph.h b/engines/titanic/carry/photograph.h
index 1148df1..4141280 100644
--- a/engines/titanic/carry/photograph.h
+++ b/engines/titanic/carry/photograph.h
@@ -34,14 +34,10 @@ private:
 	int _field12C;
 	int _field130;
 public:
+	CLASSDEF
 	CPhotograph();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPhotograph"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/plug_in.h b/engines/titanic/carry/plug_in.h
index aefb3d1..89a4832 100644
--- a/engines/titanic/carry/plug_in.h
+++ b/engines/titanic/carry/plug_in.h
@@ -31,14 +31,10 @@ class CPlugIn : public CCarry {
 private:
 	int _field12C;
 public:
+	CLASSDEF
 	CPlugIn();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPlugIn"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/speech_centre.h b/engines/titanic/carry/speech_centre.h
index 4b5ced5..8f6fdfd 100644
--- a/engines/titanic/carry/speech_centre.h
+++ b/engines/titanic/carry/speech_centre.h
@@ -33,15 +33,11 @@ private:
 	CString _string1;
 	int _field14C;
 public:
+	CLASSDEF
 	CSpeechCentre() : CBrain(), _string1("Summer"),
 		_field13C(1), _field14C(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSpeechCentre"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/sweets.h b/engines/titanic/carry/sweets.h
index 1912e89..a18a1fb 100644
--- a/engines/titanic/carry/sweets.h
+++ b/engines/titanic/carry/sweets.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CSweets : public CCarry {
 public:
+	CLASSDEF
 	CSweets();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSweets"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/test_carry.h b/engines/titanic/carry/test_carry.h
index b542fb7..56526b4 100644
--- a/engines/titanic/carry/test_carry.h
+++ b/engines/titanic/carry/test_carry.h
@@ -31,14 +31,10 @@ class CTestArray : public CGameObject {
 public:
 	int _value1, _value2;
 public:
+	CLASSDEF
 	CTestArray() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTestArray"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/carry/vision_centre.h b/engines/titanic/carry/vision_centre.h
index ce21fe5..ce1d959 100644
--- a/engines/titanic/carry/vision_centre.h
+++ b/engines/titanic/carry/vision_centre.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CVisionCentre : public CBrain {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CVisionCentre"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/background.h b/engines/titanic/core/background.h
index a473525..4ce5651 100644
--- a/engines/titanic/core/background.h
+++ b/engines/titanic/core/background.h
@@ -35,14 +35,10 @@ protected:
 	CString _string2;
 	int _fieldDC;
 public:
+	CLASSDEF
 	CBackground();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBackground"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/core/click_responder.h b/engines/titanic/core/click_responder.h
index 1f2fa72..68d3e34 100644
--- a/engines/titanic/core/click_responder.h
+++ b/engines/titanic/core/click_responder.h
@@ -31,10 +31,7 @@ class CClickResponder : public CGameObject {
 protected:
 	CString _string1, _string2;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CClickResponder"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/dont_save_file_item.h b/engines/titanic/core/dont_save_file_item.h
index f2b321c..d4d5da2 100644
--- a/engines/titanic/core/dont_save_file_item.h
+++ b/engines/titanic/core/dont_save_file_item.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CDontSaveFileItem : public CFileItem {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDontSaveFileItem"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/drop_target.h b/engines/titanic/core/drop_target.h
index b106623..22cb057 100644
--- a/engines/titanic/core/drop_target.h
+++ b/engines/titanic/core/drop_target.h
@@ -44,14 +44,10 @@ private:
 	int _field110;
 	int _field114;
 public:
+	CLASSDEF
 	CDropTarget();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDropTarget"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/core/file_item.h b/engines/titanic/core/file_item.h
index 0795b05..65dbf9d 100644
--- a/engines/titanic/core/file_item.h
+++ b/engines/titanic/core/file_item.h
@@ -33,10 +33,7 @@ class CFileItem: public CTreeItem {
 private:
 	CString _filename;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CFileItem"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 7d15882..0d9f918 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -59,14 +59,10 @@ protected:
 	CString _string;
 	int _fieldB8;
 public:
+	CLASSDEF
 	CGameObject();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGameObject"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index aeb827e..f46f8d3 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -48,14 +48,10 @@ protected:
 	int _field34;
 	CLinkItemSub _sub;
 public:
+	CLASSDEF
 	CLinkItem();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLinkItem"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/core/list.h b/engines/titanic/core/list.h
index 0ede36e..a37bca3 100644
--- a/engines/titanic/core/list.h
+++ b/engines/titanic/core/list.h
@@ -35,10 +35,7 @@ namespace Titanic {
  */
 class ListItem: public CSaveableObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "ListItem"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
@@ -54,10 +51,7 @@ public:
 template<typename T>
 class List : public CSaveableObject, public Common::List<T *> {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return nullptr; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/message_target.h b/engines/titanic/core/message_target.h
index 1afc48b..b099546 100644
--- a/engines/titanic/core/message_target.h
+++ b/engines/titanic/core/message_target.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CMessageTarget: public CSaveableObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMessageTarget"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/movie_clip.h b/engines/titanic/core/movie_clip.h
index f16e3eb..3db24de 100644
--- a/engines/titanic/core/movie_clip.h
+++ b/engines/titanic/core/movie_clip.h
@@ -43,14 +43,10 @@ private:
 	CString _string2;
 	CString _string3;
 public:
+	CLASSDEF
 	CMovieClip();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMovieClip"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
@@ -66,7 +62,7 @@ public:
  */
 class CMovieClipList: public List<CMovieClip> {
 public:
-	virtual const char *getClassName() const { return "CMovieClipList"; }
+	CLASSDEF
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/multi_drop_target.h b/engines/titanic/core/multi_drop_target.h
index db6f605..ddf20e4 100644
--- a/engines/titanic/core/multi_drop_target.h
+++ b/engines/titanic/core/multi_drop_target.h
@@ -32,14 +32,10 @@ public:
 	CString _string5;
 	CString _string6;
 public:
+	CLASSDEF
 	CMultiDropTarget() : CDropTarget(), _string5("1,2") {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMultiDropTarget"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/core/named_item.h b/engines/titanic/core/named_item.h
index 75635fc..c86aae2 100644
--- a/engines/titanic/core/named_item.h
+++ b/engines/titanic/core/named_item.h
@@ -31,10 +31,7 @@ class CNamedItem: public CTreeItem {
 public:
 	CString _name;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNamedItem"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/node_item.h b/engines/titanic/core/node_item.h
index e05c2eb..45309a1 100644
--- a/engines/titanic/core/node_item.h
+++ b/engines/titanic/core/node_item.h
@@ -33,14 +33,10 @@ private:
 	int _field28;
 	int _field2C;
 public:
+	CLASSDEF
 	CNodeItem();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNodeItem"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index 3c33498..f454392 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -39,8 +39,8 @@ class CPetControl;
 class CFileListItem : public ListItem {
 public:
 	CString _name;
-
-	virtual const char *getClassName() const { return "CFileListItem"; }
+public:
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
@@ -59,7 +59,7 @@ public:
  */
 class CFileList: public List<CFileListItem> {
 public:
-	virtual const char *getClassName() const { return "CFileList"; }
+	CLASSDEF
 };
 
 
@@ -92,14 +92,10 @@ private:
 	 */
 	void gameLoaded();
 public:
+	CLASSDEF
 	CProjectItem();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CProjectItem"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/core/resource_key.h b/engines/titanic/core/resource_key.h
index 1b3d900..b38448a 100644
--- a/engines/titanic/core/resource_key.h
+++ b/engines/titanic/core/resource_key.h
@@ -33,10 +33,7 @@ private:
 	CString _key;
 	CString _value;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CResourceKey"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 8a1d3c9..1b56d1b 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -93,6 +93,7 @@
 #include "titanic/game/bottom_of_well_monitor.h"
 #include "titanic/game/bowl_unlocker.h"
 #include "titanic/game/brain_slot.h"
+#include "titanic/game/bridge_door.h"
 #include "titanic/game/bridge_view.h"
 #include "titanic/game/broken_pell_base.h"
 #include "titanic/game/broken_pellerator.h"
@@ -104,6 +105,8 @@
 #include "titanic/game/cdrom_computer.h"
 #include "titanic/game/cdrom_tray.h"
 #include "titanic/game/cell_point_button.h"
+#include "titanic/game/chev_code.h"
+#include "titanic/game/chev_panel.h"
 #include "titanic/game/chicken_cooler.h"
 #include "titanic/game/chicken_dispensor.h"
 #include "titanic/game/close_broken_pel.h"
@@ -142,7 +145,9 @@
 #include "titanic/game/head_slot.h"
 #include "titanic/game/head_smash_event.h"
 #include "titanic/game/head_smash_lever.h"
+#include "titanic/game/head_spinner.h"
 #include "titanic/game/idle_summoner.h"
+#include "titanic/game/leave_sec_class_state.h"
 #include "titanic/game/lemon_dispensor.h"
 #include "titanic/game/light.h"
 #include "titanic/game/light_switch.h"
@@ -151,6 +156,7 @@
 #include "titanic/game/mail_man.h"
 #include "titanic/game/missiveomat.h"
 #include "titanic/game/missiveomat_button.h"
+#include "titanic/game/movie_tester.h"
 #include "titanic/game/musical_instrument.h"
 #include "titanic/game/music_console_button.h"
 #include "titanic/game/music_room_phonograph.h"
@@ -184,10 +190,12 @@
 #include "titanic/game/ship_setting_button.h"
 #include "titanic/game/show_cell_points.h"
 #include "titanic/game/speech_dispensor.h"
+#include "titanic/game/splash_animation.h"
 #include "titanic/game/starling_puret.h"
 #include "titanic/game/start_action.h"
 #include "titanic/game/stop_phonograph_button.h"
 #include "titanic/game/sub_glass.h"
+#include "titanic/game/sub_wrapper.h"
 #include "titanic/game/sweet_bowl.h"
 #include "titanic/game/television.h"
 #include "titanic/game/third_class_canal.h"
@@ -369,6 +377,7 @@
 #include "titanic/npcs/succubus.h"
 #include "titanic/npcs/summon_bots.h"
 #include "titanic/npcs/titania.h"
+#include "titanic/npcs/true_talk_npc.h"
 
 #include "titanic/pet_control/pet_control.h"
 
@@ -378,6 +387,7 @@
 #include "titanic/sound/auto_sound_player_adsr.h"
 #include "titanic/sound/background_sound_maker.h"
 #include "titanic/sound/bird_song.h"
+#include "titanic/sound/dome_from_top_of_well.h"
 #include "titanic/sound/gondolier_song.h"
 #include "titanic/sound/enter_view_toggles_other_music.h"
 #include "titanic/sound/music_player.h"
@@ -398,9 +408,12 @@ namespace Titanic {
 
 Common::HashMap<Common::String, CSaveableObject::CreateFunction> * 
 	CSaveableObject::_classList = nullptr;
+Common::List<ClassDef *> *CSaveableObject::_classDefs;
 
-#define DEFFN(T) CSaveableObject *Function##T() { return new T(); }
-#define ADDFN(T) (*_classList)[#T] = Function##T
+#define DEFFN(T) ClassDef *T::_type; \
+	CSaveableObject *Function##T() { return new T(); }
+#define ADDFN(CHILD, PARENT) (*_classList)[#CHILD] = Function##CHILD; \
+	##CHILD::_type = new TypeTemplate<CHILD>(#CHILD, nullptr)
 
 DEFFN(CArm)
 DEFFN(CAuditoryCentre)
@@ -411,7 +424,6 @@ DEFFN(CCarry)
 DEFFN(CCarryParrot)
 DEFFN(CCentralCore)
 DEFFN(CChicken)
-DEFFN(CChickenCooler)
 DEFFN(CCrushedTV)
 DEFFN(CEar)
 DEFFN(CEye)
@@ -448,13 +460,17 @@ DEFFN(CDontSaveFileItem)
 DEFFN(CDropTarget)
 DEFFN(CFileItem)
 DEFFN(CFileListItem)
+DEFFN(CGameObject)
 DEFFN(CLinkItem)
+DEFFN(ListItem)
 DEFFN(CMessageTarget)
 DEFFN(CMovieClip)
 DEFFN(CMovieClipList)
 DEFFN(CMultiDropTarget)
+DEFFN(CNamedItem)
 DEFFN(CNodeItem)
 DEFFN(CProjectItem)
+DEFFN(CSaveableObject)
 DEFFN(CStaticImage)
 DEFFN(CTurnOnObject)
 DEFFN(CTurnOnPlaySound)
@@ -476,6 +492,7 @@ DEFFN(CBomb)
 DEFFN(CBottomOfWellMonitor)
 DEFFN(CBowlUnlocker)
 DEFFN(CBrainSlot)
+DEFFN(CBridgeDoor)
 DEFFN(CBridgeView)
 DEFFN(CBrokenPellBase)
 DEFFN(CBrokenPellerator)
@@ -487,12 +504,15 @@ DEFFN(CCDROM)
 DEFFN(CCDROMComputer)
 DEFFN(CCDROMTray)
 DEFFN(CCellPointButton)
+DEFFN(CChevCode)
+DEFFN(CChevPanel)
+DEFFN(CChickenCooler)
 DEFFN(CChickenDispensor)
 DEFFN(CCloseBrokenPel)
 DEFFN(CodeWheel)
 DEFFN(CComputer)
-DEFFN(CCookie)
 DEFFN(CComputerScreen)
+DEFFN(CCookie)
 DEFFN(CCredits)
 DEFFN(CCreditsButton)
 DEFFN(CDeadArea)
@@ -524,7 +544,9 @@ DEFFN(CHammerDispensorButton)
 DEFFN(CHeadSlot)
 DEFFN(CHeadSmashEvent)
 DEFFN(CHeadSmashLever)
+DEFFN(CHeadSpinner)
 DEFFN(CIdleSummoner)
+DEFFN(CLeaveSecClassState)
 DEFFN(CLemonDispensor)
 DEFFN(CLight)
 DEFFN(CLightSwitch)
@@ -533,6 +555,7 @@ DEFFN(CLongStickDispenser)
 DEFFN(CMailMan)
 DEFFN(CMissiveOMat)
 DEFFN(CMissiveOMatButton)
+DEFFN(CMovieTester);
 DEFFN(CMusicalInstrument)
 DEFFN(CMusicConsoleButton)
 DEFFN(CMusicRoomPhonograph)
@@ -566,10 +589,12 @@ DEFFN(CShipSetting)
 DEFFN(CShipSettingButton)
 DEFFN(CShowCellpoints)
 DEFFN(CSpeechDispensor)
+DEFFN(CSplashAnimation)
 DEFFN(CStarlingPuret)
 DEFFN(CStartAction)
 DEFFN(CStopPhonographButton)
 DEFFN(CSUBGlass)
+DEFFN(CSUBWrapper)
 DEFFN(CSweetBowl)
 DEFFN(CTelevision)
 DEFFN(CThirdClassCanal)
@@ -914,22 +939,26 @@ DEFFN(CTripDownCanal)
 DEFFN(CBarbot)
 DEFFN(CBellBot)
 DEFFN(CCallBot)
+DEFFN(CCharacter)
 DEFFN(CDeskbot)
 DEFFN(CDoorbot)
 DEFFN(CLiftBot)
 DEFFN(CMaitreD)
 DEFFN(CMobile)
 DEFFN(CParrot)
+DEFFN(CRobotController)
 DEFFN(CStarlings)
 DEFFN(CSummonBots)
 DEFFN(CSuccUBus)
 DEFFN(CTitania)
+DEFFN(CTrueTalkNPC)
 DEFFN(CAutoMusicPlayer)
 DEFFN(CAutoMusicPlayerBase)
 DEFFN(CAutoSoundPlayer)
 DEFFN(CAutoSoundPlayerADSR)
 DEFFN(CBackgroundSoundMaker)
 DEFFN(CBirdSong)
+DEFFN(CDomeFromTopOfWell)
 DEFFN(CEnterViewTogglesOtherMusic)
 DEFFN(CGondolierSong)
 DEFFN(CMusicPlayer)
@@ -946,556 +975,579 @@ DEFFN(CWaterLappingSounds)
 DEFFN(CStarControl);
 
 void CSaveableObject::initClassList() {
+	_classDefs = new Common::List<ClassDef *>();
 	_classList = new Common::HashMap<Common::String, CreateFunction>();
-	ADDFN(CArm);
-	ADDFN(CAuditoryCentre);
-	ADDFN(CBowlEar);
-	ADDFN(CBrain);
-	ADDFN(CBridgePiece);
-	ADDFN(CCarry);
-	ADDFN(CCarryParrot);
-	ADDFN(CCentralCore);
-	ADDFN(CChicken);
-	ADDFN(CChickenCooler);
-	ADDFN(CCrushedTV);
-	ADDFN(CEar);
-	ADDFN(CEye);
-	ADDFN(CFeathers);
-	ADDFN(CFruit);
-	ADDFN(CGlass);
-	ADDFN(CHammer);
-	ADDFN(CHeadPiece);
-	ADDFN(CHose);
-	ADDFN(CHoseEnd);
-	ADDFN(CKey);
-	ADDFN(CLiftbotHead);
-	ADDFN(CLongStick);
-	ADDFN(CMagazine);
-	ADDFN(CMaitreDLeftArm);
-	ADDFN(CMaitreDRightArm);
-	ADDFN(CMouth);
-	ADDFN(CNapkin);
-	ADDFN(CNose);
-	ADDFN(CNote);
-	ADDFN(CParcel);
-	ADDFN(CPerch);
-	ADDFN(CPhonographCylinder);
-	ADDFN(CPhonographEar);
-	ADDFN(CPhotograph);
-	ADDFN(CPlugIn);
-	ADDFN(CSpeechCentre);
-	ADDFN(CSweets);
-	ADDFN(CVisionCentre);
-
-	ADDFN(CBackground);
-	ADDFN(CClickResponder);
-	ADDFN(CDontSaveFileItem);
-	ADDFN(CDropTarget);
-	ADDFN(CFileItem);
-	ADDFN(CFileListItem);
-	ADDFN(CLinkItem);
-	ADDFN(CMessageTarget);
-	ADDFN(CMovieClip);
-	ADDFN(CMovieClipList);
-	ADDFN(CMultiDropTarget);
-	ADDFN(CNodeItem);
-	ADDFN(CProjectItem);
-	ADDFN(CStaticImage);
-	ADDFN(CTurnOnObject);
-	ADDFN(CTreeItem);
-	ADDFN(CTurnOnPlaySound);
-	ADDFN(CTurnOnTurnOff);
-	ADDFN(CViewItem);
+	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(CVisionCentre, CBrain);
 
-	ADDFN(CAnnounce);
-	ADDFN(CAnnoyBarbot);
-	ADDFN(CArbBackground);
-	ADDFN(CArboretumGate);
-	ADDFN(CAutoAnimate);
-	ADDFN(CBarBell);
-	ADDFN(CBarMenu);
-	ADDFN(CBarMenuButton);
-	ADDFN(CBelbotGetLight);
-	ADDFN(CBilgeSuccUBus);
-	ADDFN(CBomb);
-	ADDFN(CBottomOfWellMonitor);
-	ADDFN(CBrainSlot);
-	ADDFN(CBowlUnlocker);
-	ADDFN(CBridgeView);
-	ADDFN(CBrokenPellBase);
-	ADDFN(CBrokenPellerator);
-	ADDFN(CBrokenPelleratorFroz);
-	ADDFN(CCage);
-	ADDFN(CCallPellerator);
-	ADDFN(CCaptainsWheel);
-	ADDFN(CCDROM);
-	ADDFN(CCDROMComputer);
-	ADDFN(CCDROMTray);
-	ADDFN(CCellPointButton);
-	ADDFN(CChickenDispensor);
-	ADDFN(CodeWheel);
-	ADDFN(CComputerScreen);
-	ADDFN(CCloseBrokenPel);
-	ADDFN(CComputer);
-	ADDFN(CCookie);
-	ADDFN(CCredits);
-	ADDFN(CCreditsButton);
-	ADDFN(CDeadArea);
-	ADDFN(CDeskClickResponder);
-	ADDFN(CDoorbotElevatorHandler);
-	ADDFN(CDoorbotHomeHandler);
-	ADDFN(CDropTarget);
-	ADDFN(CEarSweetBowl);
-	ADDFN(CEjectPhonographButton);
-	ADDFN(CElevatorActionArea);
-	ADDFN(CEmmaControl);
-	ADDFN(CEmptyNutBowl);
-	ADDFN(CEndCreditText);
-	ADDFN(CEndCredits);
-	ADDFN(CEndExplodeShip);
-	ADDFN(CEndGameCredits);
-	ADDFN(CEndSequenceControl);
-	ADDFN(CFan);
-	ADDFN(CFanControl);
-	ADDFN(CFanDecrease);
-	ADDFN(CFanIncrease);
-	ADDFN(CFanNoises);
-	ADDFN(CFloorIndicator);
-	ADDFN(CGamesConsole);
-	ADDFN(CGetLiftEye2);
-	ADDFN(CGlassSmasher);
-	ADDFN(CHammerClip);
-	ADDFN(CHammerDispensor);
-	ADDFN(CHammerDispensorButton);
-	ADDFN(CHeadSlot);
-	ADDFN(CHeadSmashEvent);
-	ADDFN(CHeadSmashLever);
-	ADDFN(CIdleSummoner);
-	ADDFN(CLemonDispensor);
-	ADDFN(CLight);
-	ADDFN(CLightSwitch);
-	ADDFN(CLittleLiftButton);
-	ADDFN(CLongStickDispenser);
-	ADDFN(CMailMan);
-	ADDFN(CMissiveOMat);
-	ADDFN(CMissiveOMatButton);
-	ADDFN(CMusicalInstrument);
-	ADDFN(CMusicConsoleButton);
-	ADDFN(CMusicRoomPhonograph);
-	ADDFN(CMusicRoomStopPhonographButton);
-	ADDFN(CMusicSystemLock);
-	ADDFN(CNavHelmet);
-	ADDFN(CNavigationComputer);
-	ADDFN(CNoNutBowl);
-	ADDFN(CNoseHolder);
-	ADDFN(CNullPortHole);
-	ADDFN(CNutReplacer);
-	ADDFN(CPetDisabler);
-	ADDFN(CPhonograph);
-	ADDFN(CPhonographLid);
-	ADDFN(CPlayMusicButton);
-	ADDFN(CPlayOnAct);
-	ADDFN(CPortHole);
-	ADDFN(CRecordPhonographButton);
-	ADDFN(CReplacementEar);
-	ADDFN(CReservedTable);
-	ADDFN(CRestaurantCylinderHolder);
-	ADDFN(CRestaurantPhonograph);
-	ADDFN(CRoomItem);
-	ADDFN(CSauceDispensor);
-	ADDFN(CSearchPoint);
-	ADDFN(CSeasonBackground);
-	ADDFN(CSeasonBarrel);
-	ADDFN(CSeasonalAdjustment);
-	ADDFN(CServiceElevatorWindow);
-	ADDFN(CShipSetting);
-	ADDFN(CShipSettingButton);
-	ADDFN(CShowCellpoints);
-	ADDFN(CSpeechDispensor);
-	ADDFN(CStarlingPuret);
-	ADDFN(CStartAction);
-	ADDFN(CStopPhonographButton);
-	ADDFN(CSUBGlass);
-	ADDFN(CSweetBowl);
-	ADDFN(CTelevision);
-	ADDFN(CThirdClassCanal);
-	ADDFN(CThrowTVDownWell);
-	ADDFN(CTitaniaStillControl);
-	ADDFN(CTOWParrotNav);
-	ADDFN(CUpLighter);
-	ADDFN(CUselessLever);
-	ADDFN(CWheelButton);
-	ADDFN(CWheelHotSpot);
-	ADDFN(CWheelSpin);
-	ADDFN(CWheelSpinHorn);
-	ADDFN(CGondolierBase);
-	ADDFN(CGondolierChest);
-	ADDFN(CGondolierFace);
-	ADDFN(CGondolierMixer);
-	ADDFN(CGondolierSlider);
-	ADDFN(CMaitreDArmHolder);
-	ADDFN(CMaitreDBody);
-	ADDFN(CMaitreDLegs);
-	ADDFN(CMaitreDProdReceptor);
-	ADDFN(CParrotLobbyController);
-	ADDFN(CParrotLobbyLinkUpdater);
-	ADDFN(CParrotLobbyObject);
-	ADDFN(CParrotLobbyViewObject);
-	ADDFN(CParrotLoser);
-	ADDFN(CParrotNutBowlActor);
-	ADDFN(CParrotNutEater);
-	ADDFN(CParrotPerchHolder);
-	ADDFN(CParrotSuccUBus);
-	ADDFN(CParrotTrigger);
-	ADDFN(CPlayerMeetsParrot);
-	ADDFN(CPET);
-	ADDFN(CPETClass1);
-	ADDFN(CPETClass2);
-	ADDFN(CPETClass3);
-	ADDFN(CPetControl);
-	ADDFN(CPetDragChev);
-	ADDFN(CPetGraphic);
-	ADDFN(CPetGraphic2);
-	ADDFN(PETLeaf);
-	ADDFN(CPETLift);
-	ADDFN(CPETMonitor);
-	ADDFN(CPETPellerator);
-	ADDFN(CPETPosition);
-	ADDFN(CPETSentinal);
-	ADDFN(CPETSounds);
-	ADDFN(CPETTransition);
-	ADDFN(CPETTransport);
-	ADDFN(CPickUp);
-	ADDFN(CPickUpBarGlass);
-	ADDFN(CPickUpHose);
-	ADDFN(CPickUpLemon);
-	ADDFN(CPickUpSpeechCentre);
-	ADDFN(CPickUpVisCentre);
-	ADDFN(CBarShelfVisCentre);
-	ADDFN(CLemonOnBar);
-	ADDFN(CPlaceHolder);
-	ADDFN(CTVOnBar);
-	ADDFN(CArmchair);
-	ADDFN(CBasin);
-	ADDFN(CBedfoot);
-	ADDFN(CBedhead);
-	ADDFN(CChestOfDrawers);
-	ADDFN(CDesk);
-	ADDFN(CDeskchair);
-	ADDFN(CDrawer);
-	ADDFN(CSGTDoors);
-	ADDFN(SGTNav);
-	ADDFN(CSGTNavigation);
-	ADDFN(CSGTRestaurantDoors);
-	ADDFN(CSGTStateControl);
-	ADDFN(CSGTStateRoom);
-	ADDFN(CSGTTV);
-	ADDFN(CSGTUpperDoorsSound);
-	ADDFN(CToilet);
-	ADDFN(CVase);
-	ADDFN(CWashstand);
+	ADDFN(CBackground, CGameObject);
+	ADDFN(CClickResponder, CGameObject);
+	ADDFN(CDontSaveFileItem, CFileItem);
+	ADDFN(CDropTarget, CGameObject);
+	ADDFN(CFileItem, CTreeItem);
+	ADDFN(CFileListItem, ListItem);
+	ADDFN(CGameObject, CNamedItem);
+	ADDFN(CLinkItem, CNamedItem);
+	ADDFN(ListItem, CSaveableObject);
+	ADDFN(CMessageTarget, CSaveableObject);
+	ADDFN(CMovieClip, ListItem);
+	ADDFN(CMovieClipList, List);
+	ADDFN(CMultiDropTarget, CDropTarget);
+	ADDFN(CNamedItem, CTreeItem);
+	ADDFN(CNodeItem, CNamedItem);
+	ADDFN(CProjectItem, CFileItem);
+	ADDFN(CSaveableObject, CSaveableObject);
+	ADDFN(CStaticImage, CGameObject);
+	ADDFN(CTurnOnObject, CBackground);
+	ADDFN(CTreeItem, CMessageTarget);
+	ADDFN(CTurnOnPlaySound, CTurnOnObject);
+	ADDFN(CTurnOnTurnOff, CBackground);
+	ADDFN(CViewItem, CNamedItem);
 
-	ADDFN(CGondolier);
-	ADDFN(CLift);
-	ADDFN(CLiftindicator);
-	ADDFN(CPellerator);
-	ADDFN(CServiceElevator);
-	ADDFN(CTransport);
+	ADDFN(CAnnounce, CGameObject);
+	ADDFN(CAnnoyBarbot, CGameObject);
+	ADDFN(CArbBackground, CBackground);
+	ADDFN(CArboretumGate, CBackground);
+	ADDFN(CAutoAnimate, CBackground);
+	ADDFN(CBarBell, CGameObject);
+	ADDFN(CBarMenu, CGameObject);
+	ADDFN(CBarMenuButton, CGameObject);
+	ADDFN(CBelbotGetLight, CGameObject);
+	ADDFN(CBilgeSuccUBus, CSuccUBus);
+	ADDFN(CBomb, CBackground);
+	ADDFN(CBottomOfWellMonitor, CGameObject);
+	ADDFN(CBowlUnlocker, CGameObject);
+	ADDFN(CBrainSlot, CGameObject);
+	ADDFN(CBridgeDoor, CGameObject);
+	ADDFN(CBridgeView, CBackground);
+	ADDFN(CBrokenPellBase, CBackground);
+	ADDFN(CBrokenPellerator, CBrokenPellBase);
+	ADDFN(CBrokenPelleratorFroz, CBrokenPellBase);
+	ADDFN(CCage, CBackground);
+	ADDFN(CCallPellerator, CGameObject);
+	ADDFN(CCaptainsWheel, CBackground);
+	ADDFN(CCDROM, CGameObject);
+	ADDFN(CCDROMComputer, CGameObject);
+	ADDFN(CCDROMTray, CGameObject);
+	ADDFN(CCellPointButton, CBackground);
+	ADDFN(CChevCode, CGameObject);
+	ADDFN(CChevPanel, CGameObject);
+	ADDFN(CChickenCooler, CGameObject);
+	ADDFN(CChickenDispensor, CBackground);
+	ADDFN(CodeWheel, CBomb);
+	ADDFN(CCloseBrokenPel, CBackground);
+	ADDFN(CComputer, CBackground);
+	ADDFN(CComputerScreen, CGameObject);
+	ADDFN(CCookie, CGameObject);
+	ADDFN(CCredits, CGameObject);
+	ADDFN(CCreditsButton, CBackground);
+	ADDFN(CDeadArea, CGameObject);
+	ADDFN(CDeskClickResponder, CClickResponder);
+	ADDFN(CDoorbotElevatorHandler, CGameObject);
+	ADDFN(CDoorbotHomeHandler, CGameObject);
+	ADDFN(CDropTarget, CGameObject);
+	ADDFN(CEarSweetBowl, CSweetBowl);
+	ADDFN(CEjectPhonographButton, CBackground);
+	ADDFN(CElevatorActionArea, CGameObject);
+	ADDFN(CEmmaControl, CBackground);
+	ADDFN(CEmptyNutBowl, CGameObject);
+	ADDFN(CEndCreditText, CGameObject);
+	ADDFN(CEndCredits, CGameObject);
+	ADDFN(CEndExplodeShip, CGameObject);
+	ADDFN(CEndGameCredits, CGameObject);
+	ADDFN(CEndSequenceControl, CGameObject);
+	ADDFN(CFan, CGameObject);
+	ADDFN(CFanControl, CGameObject);
+	ADDFN(CFanDecrease, CGameObject);
+	ADDFN(CFanIncrease, CGameObject);
+	ADDFN(CFanNoises, CGameObject);
+	ADDFN(CFloorIndicator, CGameObject);
+	ADDFN(CGamesConsole, CBackground);
+	ADDFN(CGetLiftEye2, CGameObject);
+	ADDFN(CGlassSmasher, CGameObject);
+	ADDFN(CHammerClip, CGameObject);
+	ADDFN(CHammerDispensor, CBackground);
+	ADDFN(CHammerDispensorButton, CStartAction);
+	ADDFN(CHeadSlot, CGameObject);
+	ADDFN(CHeadSmashEvent, CBackground);
+	ADDFN(CHeadSmashLever, CBackground);
+	ADDFN(CHeadSpinner, CGameObject);
+	ADDFN(CIdleSummoner, CGameObject);
+	ADDFN(CLeaveSecClassState, CGameObject);
+	ADDFN(CLemonDispensor, CBackground);
+	ADDFN(CLight, CBackground);
+	ADDFN(CLightSwitch, CBackground);
+	ADDFN(CLittleLiftButton, CBackground);
+	ADDFN(CLongStickDispenser, CGameObject);
+	ADDFN(CMailMan, CGameObject);
+	ADDFN(CMissiveOMat, CGameObject);
+	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(CNavigationComputer, CGameObject);
+	ADDFN(CNoNutBowl, CBackground);
+	ADDFN(CNoseHolder, CDropTarget);
+	ADDFN(CNullPortHole, CClickResponder);
+	ADDFN(CNutReplacer, CGameObject);
+	ADDFN(CPetDisabler, CGameObject);
+	ADDFN(CPhonograph, CMusicPlayer);
+	ADDFN(CPhonographLid, CGameObject);
+	ADDFN(CPlayMusicButton, CBackground);
+	ADDFN(CPlayOnAct, CBackground);
+	ADDFN(CPortHole, CGameObject);
+	ADDFN(CRecordPhonographButton, CBackground);
+	ADDFN(CReplacementEar, CBackground);
+	ADDFN(CReservedTable, CGameObject);
+	ADDFN(CRestaurantCylinderHolder, CDropTarget);
+	ADDFN(CRestaurantPhonograph, CPhonograph);
+	ADDFN(CRoomItem, CNamedItem);
+	ADDFN(CSauceDispensor, CBackground);
+	ADDFN(CSearchPoint, CGameObject);
+	ADDFN(CSeasonBackground, CBackground);
+	ADDFN(CSeasonBarrel, CBackground);
+	ADDFN(CSeasonalAdjustment, CBackground);
+	ADDFN(CServiceElevatorWindow, CBackground);
+	ADDFN(CShipSetting, CBackground);
+	ADDFN(CShipSettingButton, CGameObject);
+	ADDFN(CShowCellpoints, CGameObject);
+	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(CTelevision, CBackground);
+	ADDFN(CThirdClassCanal, CBackground);
+	ADDFN(CThrowTVDownWell, CGameObject);
+	ADDFN(CTitaniaStillControl, CGameObject);
+	ADDFN(CTOWParrotNav, CGameObject);
+	ADDFN(CUpLighter, CDropTarget);
+	ADDFN(CUselessLever, CToggleButton);
+	ADDFN(CWheelButton, CBackground);
+	ADDFN(CWheelHotSpot, CBackground);
+	ADDFN(CWheelSpin, CBackground);
+	ADDFN(CWheelSpinHorn, CWheelSpin);
+	ADDFN(CGondolierBase, CGameObject);
+	ADDFN(CGondolierChest, CGondolierBase);
+	ADDFN(CGondolierFace, CGondolierBase);
+	ADDFN(CGondolierMixer, CGondolierBase);
+	ADDFN(CGondolierSlider, CGondolierBase);
+	ADDFN(CMaitreDArmHolder, CDropTarget);
+	ADDFN(CMaitreDBody, CMaitreDProdReceptor);
+	ADDFN(CMaitreDLegs, CMaitreDProdReceptor);
+	ADDFN(CMaitreDProdReceptor, CGameObject);
+	ADDFN(CParrotLobbyController, CParrotLobbyObject);
+	ADDFN(CParrotLobbyLinkUpdater, CParrotLobbyObject);
+	ADDFN(CParrotLobbyObject, CGameObject);
+	ADDFN(CParrotLobbyViewObject, CParrotLobbyObject);
+	ADDFN(CParrotLoser, CGameObject);
+	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(CPickUp, CGameObject);
+	ADDFN(CPickUpBarGlass, CPickUp);
+	ADDFN(CPickUpHose, CPickUp);
+	ADDFN(CPickUpLemon, CPickUp);
+	ADDFN(CPickUpSpeechCentre, CPickUp);
+	ADDFN(CPickUpVisCentre, CPickUp);
+	ADDFN(CBarShelfVisCentre, CPlaceHolder);
+	ADDFN(CLemonOnBar, CPlaceHolder);
+	ADDFN(CPlaceHolder, CGameObject);
+	ADDFN(CTVOnBar, CPlaceHolder);
+	ADDFN(CArmchair, CSGTStateRoom);
+	ADDFN(CBasin, CSGTStateRoom);
+	ADDFN(CBedfoot, CSGTStateRoom);
+	ADDFN(CBedhead, CSGTStateRoom);
+	ADDFN(CChestOfDrawers, CSGTStateRoom);
+	ADDFN(CDesk, CSGTStateRoom);
+	ADDFN(CDeskchair, CSGTStateRoom);
+	ADDFN(CDrawer, CSGTStateRoom);
+	ADDFN(CSGTDoors, CGameObject);
+	ADDFN(SGTNav, CSGTStateRoom);
+	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(CActButton);
-	ADDFN(CChangesSeasonButton);
-	ADDFN(CChevLeftOff);
-	ADDFN(CChevLeftOn);
-	ADDFN(CChevRightOff);
-	ADDFN(CChevRightOn);
-	ADDFN(CChevSendRecSwitch);
-	ADDFN(CChevSwitch);
-	ADDFN(CEditControl);
-	ADDFN(CElevatorButton);
-	ADDFN(CGetFromSucc);
-	ADDFN(CHelmetOnOff);
-	ADDFN(CHomePhoto);
-	ADDFN(CIconNavAction);
-	ADDFN(CIconNavButt);
-	ADDFN(CIconNavDown);
-	ADDFN(CIconNavImage);
-	ADDFN(CIconNavLeft);
-	ADDFN(CIconNavReceive);
-	ADDFN(CIconNavRight);
-	ADDFN(CIconNavSend);
-	ADDFN(CIconNavUp);
-	ADDFN(CKeybrdButt);
-	ADDFN(CMoveObjectButton);
-	ADDFN(CMusicControl);
-	ADDFN(CMusicSlider);
-	ADDFN(CMusicSliderPitch);
-	ADDFN(CMusicSliderSpeed);
-	ADDFN(CMusicSwitch);
-	ADDFN(CMusicSwitchInversion);
-	ADDFN(CMusicSwitchReverse);
-	ADDFN(CMusicVoiceMute);
-	ADDFN(CPetModeOff);
-	ADDFN(CPetModeOn);
-	ADDFN(CPetModePanel);
-	ADDFN(CPetPannel1);
-	ADDFN(CPetPannel2);
-	ADDFN(CPetPannel3);
-	ADDFN(CSendToSucc);
-	ADDFN(CSGTSelector);
-	ADDFN(CSliderButton);
-	ADDFN(CSmallChevLeftOff);
-	ADDFN(CSmallChevLeftOn);
-	ADDFN(CSmallChevRightOff);
-	ADDFN(CSmallChevRightOn);
-	ADDFN(CStatusChangeButton);
-	ADDFN(CSTButton);
-	ADDFN(CTextDown);
-	ADDFN(CTextSkrew);
-	ADDFN(CTextUp);
-	ADDFN(CToggleButton);
-	ADDFN(CToggleSwitch);
-	ADDFN(CVolumeControl);
+	ADDFN(CGondolier, CTransport);
+	ADDFN(CLift, CTransport);
+	ADDFN(CLiftindicator, CLift);
+	ADDFN(CPellerator, CTransport);
+	ADDFN(CServiceElevator, CTransport);
+	ADDFN(CTransport, CMobile);
 
-	ADDFN(CActMsg);
-	ADDFN(CActivationmsg);
-	ADDFN(CAddHeadPieceMsg);
-	ADDFN(CAnimateMaitreDMsg);
-	ADDFN(CArboretumGateMsg);
-	ADDFN(CArmPickedUpFromTableMsg);
-	ADDFN(CBodyInBilgeRoomMsg);
-	ADDFN(CBowlStateChange);
-	ADDFN(CCarryObjectArrivedMsg);
-	ADDFN(CChangeSeasonMsg);
-	ADDFN(CCheckAllPossibleCodes);
-	ADDFN(CCheckChevCode);
-	ADDFN(CChildDragEndMsg);
-	ADDFN(CChildDragMoveMsg);
-	ADDFN(CChildDragStartMsg);
-	ADDFN(CClearChevPanelBits);
-	ADDFN(CCorrectMusicPlayedMsg);
-	ADDFN(CCreateMusicPlayerMsg);
-	ADDFN(CCylinderHolderReadyMsg);
-	ADDFN(CDeactivationMsg);
-	ADDFN(CDeliverCCarryMsg);
-	ADDFN(CDisableMaitreDProdReceptor);
-	ADDFN(CDismissBotMsg);
-	ADDFN(CDoffNavHelmet);
-	ADDFN(CDonNavHelmet);
-	ADDFN(CDoorbotNeededInElevatorMsg);
-	ADDFN(CDoorbotNeededInHomeMsg);
-	ADDFN(CDropobjectMsg);
-	ADDFN(CDropZoneGotObjectMsg);
-	ADDFN(CDropZoneLostObjectMsg);
-	ADDFN(CEditControlMsg);
-	ADDFN(CEjectCylinderMsg);
-	ADDFN(CErasePhonographCylinderMsg);
-	ADDFN(CFreshenCookieMsg);
-	ADDFN(CGetChevClassBits);
-	ADDFN(CGetChevClassNum);
-	ADDFN(CGetChevCodeFromRoomNameMsg);
-	ADDFN(CGetChevFloorBits);
-	ADDFN(CGetChevFloorNum);
-	ADDFN(CGetChevLiftBits);
-	ADDFN(CGetChevLiftNum);
-	ADDFN(CGetChevRoomBits);
-	ADDFN(CGetChevRoomNum);
-	ADDFN(CHoseConnectedMsg);
-	ADDFN(CInitializeAnimMsg);
-	ADDFN(CIsEarBowlPuzzleDone);
-	ADDFN(CIsHookedOnMsg);
-	ADDFN(CIsParrotPresentMsg);
-	ADDFN(CKeyCharMsg);
-	ADDFN(CLemonFallsFromTreeMsg);
-	ADDFN(CLightsMsg);
-	ADDFN(CLockPhonographMsg);
-	ADDFN(CMaitreDDefeatedMsg);
-	ADDFN(CMaitreDHappyMsg);
-	ADDFN(CMissiveOMatActionMsg);
-	ADDFN(CMouseMsg);
-	ADDFN(CMouseMoveMsg);
-	ADDFN(CMouseButtonMsg);
-	ADDFN(CMouseButtonDownMsg);
-	ADDFN(CMouseButtonUpMsg);
-	ADDFN(CMouseButtonDoubleClickMsg);
-	ADDFN(CMouseDragMsg);
-	ADDFN(CMouseDragStartMsg);
-	ADDFN(CMouseDragMoveMsg);
-	ADDFN(CMouseDragEndMsg);
-	ADDFN(CMoveToStartPosMsg);
-	ADDFN(CMovieEndMsg);
-	ADDFN(CMovieFrameMsg);
-	ADDFN(CMusicHasStartedMsg);
-	ADDFN(CMusicHasStoppedMsg);
-	ADDFN(CMusicSettingChangedMsg);
-	ADDFN(CNPCPlayAnimationMsg);
-	ADDFN(CNPCPlayIdleAnimationMsg);
-	ADDFN(CNPCPlayTalkingAnimationMsg);
-	ADDFN(CNPCQueueIdleAnimMsg);
-	ADDFN(CNutPuzzleMsg);
-	ADDFN(COnSummonBotMsg);
-	ADDFN(COpeningCreditsMsg);
-	ADDFN(CPETDeliverMsg);
-	ADDFN(CPETGainedObjectMsg);
-	ADDFN(CPETHelmetOnOffMsg);
-	ADDFN(CPETKeyboardOnOffMsg);
-	ADDFN(CPETLostObjectMsg);
-	ADDFN(CPETObjectSelectedMsg);
-	ADDFN(CPETObjectStateMsg);
-	ADDFN(CPETPhotoOnOffMsg);
-	ADDFN(CPETPlaySoundMsg);
-	ADDFN(CPETReceiveMsg);
-	ADDFN(CPETSetStarDestinationMsg);
-	ADDFN(CPETStarFieldLockMsg);
-	ADDFN(CPETStereoFieldOnOffMsg);
-	ADDFN(CPETTargetMsg);
-	ADDFN(CPanningAwayFromParrotMsg);
-	ADDFN(CParrotSpeakMsg);
-	ADDFN(CParrotTriesChickenMsg);
-	ADDFN(CPassOnDragStartMsg);
-	ADDFN(CPhonographPlayMsg);
-	ADDFN(CPhonographReadyToPlayMsg);
-	ADDFN(CPhonographRecordMsg);
-	ADDFN(CPhonographStopMsg);
-	ADDFN(CPlayRangeMsg);
-	ADDFN(CPlayerTriesRestaurantTableMsg);
-	ADDFN(CPreSaveMsg);
-	ADDFN(CProdMaitreDMsg);
-	ADDFN(CPumpingMsg);
-	ADDFN(CPutBotBackInHisBoxMsg);
-	ADDFN(CPutParrotBackMsg);
-	ADDFN(CPuzzleSolvedMsg);
-	ADDFN(CQueryCylinderHolderMsg);
-	ADDFN(CQueryCylinderMsg);
-	ADDFN(CQueryCylinderNameMsg);
-	ADDFN(CQueryCylinderTypeMsg);
-	ADDFN(CQueryMusicControlSettingMsg);
-	ADDFN(CQueryPhonographState);
-	ADDFN(CRecordOntoCylinderMsg);
-	ADDFN(CRemoveFromGameMsg);
-	ADDFN(CReplaceBowlAndNutsMsg);
-	ADDFN(CRestaurantMusicChanged);
-	ADDFN(CSendCCarryMsg);
-	ADDFN(CSenseWorkingMsg);
-	ADDFN(CServiceElevatorDoor);
-	ADDFN(CServiceElevatorFloorChangeMsg);
-	ADDFN(CServiceElevatorFloorRequestMsg);
-	ADDFN(CServiceElevatorMsg);
-	ADDFN(CSetChevButtonImageMsg);
-	ADDFN(CSetChevClassBits);
-	ADDFN(CSetChevFloorBits);
-	ADDFN(CSetChevLiftBits);
-	ADDFN(CSetChevPanelBitMsg);
-	ADDFN(CSetChevPanelButtonsMsg);
-	ADDFN(CSetChevRoomBits);
-	ADDFN(CSetMusicControlsMsg);
-	ADDFN(CSetVarMsg);
-	ADDFN(CSetVolumeMsg);
-	ADDFN(CShipSettingMsg);
-	ADDFN(CShowTextMsg);
-	ADDFN(CSignalObject);
-	ADDFN(CSpeechFallsFromTreeMsg);
-	ADDFN(CStartMusicMsg);
-	ADDFN(CStatusChangeMsg);
-	ADDFN(CStopMusicMsg);
-	ADDFN(CSubAcceptCCarryMsg);
-	ADDFN(CSubDeliverCCarryMsg);
-	ADDFN(CSubSendCCarryMsg);
-	ADDFN(CSUBTransition);
-	ADDFN(CSubTurnOffMsg);
-	ADDFN(CSubTurnOnMsg);
-	ADDFN(CSummonBotMsg);
-	ADDFN(CSummonBotQuerryMsg);
-	ADDFN(CTakeHeadPieceMsg);
-	ADDFN(CTextInputMsg);
-	ADDFN(CTimeDilationMsg);
-	ADDFN(CTimeMsg);
-	ADDFN(CTitleSequenceEndedMsg);
-	ADDFN(CTransitMsg);
-	ADDFN(CTransportMsg);
-	ADDFN(CTriggerAutoMusicPlayerMsg);
-	ADDFN(CTriggerNPCEvent);
-	ADDFN(CTrueTalkGetAnimSetMsg);
-	ADDFN(CTrueTalkGetAssetDetailsMsg);
-	ADDFN(CTrueTalkGetStateValueMsg);
-	ADDFN(CTrueTalkNotifySpeechEndedMsg);
-	ADDFN(CTrueTalkNotifySpeechStartedMsg);
-	ADDFN(CTrueTalkQueueUpAnimSetMsg);
-	ADDFN(CTrueTalkSelfQueueAnimSetMsg);
-	ADDFN(CTrueTalkTriggerActionMsg);
-	ADDFN(CTurnOff);
-	ADDFN(CTurnOn);
-	ADDFN(CUse);
-	ADDFN(CUseWithCharMsg);
-	ADDFN(CUseWithOtherMsg);
-	ADDFN(CVirtualKeyCharMsg);
-	ADDFN(CVisibleMsg);
+	ADDFN(CActButton, CSTButton);
+	ADDFN(CChangesSeasonButton, CSTButton);
+	ADDFN(CChevLeftOff, CToggleSwitch);
+	ADDFN(CChevLeftOn, CToggleSwitch);
+	ADDFN(CChevRightOff, CToggleSwitch);
+	ADDFN(CChevRightOn, CToggleSwitch);
+	ADDFN(CChevSendRecSwitch, CToggleSwitch);
+	ADDFN(CChevSwitch, 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);
+	ADDFN(CMusicControl, CBackground);
+	ADDFN(CMusicSlider, CMusicControl);
+	ADDFN(CMusicSliderPitch, CMusicSlider);
+	ADDFN(CMusicSliderSpeed, CMusicSlider);
+	ADDFN(CMusicSwitch, CMusicControl);
+	ADDFN(CMusicSwitchInversion, CMusicSwitch);
+	ADDFN(CMusicSwitchReverse, CMusicSwitch);
+	ADDFN(CMusicVoiceMute, CMusicControl);
+	ADDFN(CPetControl, CGameObject);
+	ADDFN(CPetDragChev, CPetGraphic2);
+	ADDFN(CPetGraphic, CGameObject);
+	ADDFN(CPetGraphic2, CGameObject);
+	ADDFN(PETLeaf, CGameObject);
+	ADDFN(CPetModeOff, CToggleSwitch);
+	ADDFN(CPetModeOn, CToggleSwitch);
+	ADDFN(CPetModePanel, CToggleSwitch);
+	ADDFN(CPetPannel1, CPetGraphic);
+	ADDFN(CPetPannel2, CPetGraphic);
+	ADDFN(CPetPannel3, CPetGraphic);
+	ADDFN(CSendToSucc, CToggleSwitch);
+	ADDFN(CSGTSelector, CPetGraphic);
+	ADDFN(CSliderButton, CSTButton);
+	ADDFN(CSmallChevLeftOff, CToggleSwitch);
+	ADDFN(CSmallChevLeftOn, CToggleSwitch);
+	ADDFN(CSmallChevRightOff, CToggleSwitch);
+	ADDFN(CSmallChevRightOn, CToggleSwitch);
+	ADDFN(CStatusChangeButton, CSTButtonClass);
+	ADDFN(CSTButton, CBackground);
+	ADDFN(CTextDown, CPetGraphic);
+	ADDFN(CTextSkrew, CPetGraphic);
+	ADDFN(CTextUp, CPetGraphic);
+	ADDFN(CToggleButton, CBackground);
+	ADDFN(CToggleSwitch, CGameObject);
+	ADDFN(CVolumeControl, CGameObject);
+	
+	ADDFN(CActMsg, CMessage);
+	ADDFN(CActivationmsg, CMessage);
+	ADDFN(CAddHeadPieceMsg, CMessage);
+	ADDFN(CAnimateMaitreDMsg, CMessage);
+	ADDFN(CArboretumGateMsg, CMessage);
+	ADDFN(CArmPickedUpFromTableMsg, CMessage);
+	ADDFN(CAutoSoundEvent, CGameObject);
+	ADDFN(CBilgeAutoSoundEvent, CAutoSoundEvent);
+	ADDFN(CBilgeDispensorEvent, CAutoSoundEvent);
+	ADDFN(CBodyInBilgeRoomMsg, CMessage);
+	ADDFN(CBowlStateChange, CMessage);
+	ADDFN(CCarryObjectArrivedMsg, CMessage);
+	ADDFN(CChangeSeasonMsg, CMessage);
+	ADDFN(CCheckAllPossibleCodes, CMessage);
+	ADDFN(CCheckChevCode, CMessage);
+	ADDFN(CChildDragEndMsg, CMessage);
+	ADDFN(CChildDragMoveMsg, CMessage);
+	ADDFN(CChildDragStartMsg, CMessage);
+	ADDFN(CClearChevPanelBits, CMessage);
+	ADDFN(CCorrectMusicPlayedMsg, CMessage);
+	ADDFN(CCreateMusicPlayerMsg, CMessage);
+	ADDFN(CCylinderHolderReadyMsg, CMessage);
+	ADDFN(CDeactivationMsg, CMessage);
+	ADDFN(CDeliverCCarryMsg, CMessage);
+	ADDFN(CDisableMaitreDProdReceptor, CMessage);
+	ADDFN(CDismissBotMsg, CMessage);
+	ADDFN(CDoffNavHelmet, CMessage);
+	ADDFN(CDonNavHelmet, CMessage);
+	ADDFN(CDoorAutoSoundEvent, CAutoSoundEvent);
+	ADDFN(CDoorbotNeededInElevatorMsg, CMessage);
+	ADDFN(CDoorbotNeededInHomeMsg, CMessage);
+	ADDFN(CDropobjectMsg, CMessage);
+	ADDFN(CDropZoneGotObjectMsg, CMessage);
+	ADDFN(CDropZoneLostObjectMsg, CMessage);
+	ADDFN(CEditControlMsg, CMessage);
+	ADDFN(CEjectCylinderMsg, CMessage);
+	ADDFN(CErasePhonographCylinderMsg, CMessage);
+	ADDFN(CFreshenCookieMsg, CMessage);
+	ADDFN(CGetChevClassBits, CMessage);
+	ADDFN(CGetChevClassNum, CMessage);
+	ADDFN(CGetChevCodeFromRoomNameMsg, CMessage);
+	ADDFN(CGetChevFloorBits, CMessage);
+	ADDFN(CGetChevFloorNum, CMessage);
+	ADDFN(CGetChevLiftBits, CMessage);
+	ADDFN(CGetChevLiftNum, CMessage);
+	ADDFN(CGetChevRoomBits, CMessage);
+	ADDFN(CGetChevRoomNum, CMessage);
+	ADDFN(CHoseConnectedMsg, CMessage);
+	ADDFN(CInitializeAnimMsg, CMessage);
+	ADDFN(CIsEarBowlPuzzleDone, CMessage);
+	ADDFN(CIsHookedOnMsg, CMessage);
+	ADDFN(CIsParrotPresentMsg, CMessage);
+	ADDFN(CKeyCharMsg, CMessage);
+	ADDFN(CLemonFallsFromTreeMsg, CMessage);
+	ADDFN(CLightsMsg, CMessage);
+	ADDFN(CLockPhonographMsg, CMessage);
+	ADDFN(CMaitreDDefeatedMsg, CMessage);
+	ADDFN(CMaitreDHappyMsg, CMessage);
+	ADDFN(CMissiveOMatActionMsg, CMessage);
+	ADDFN(CMouseMsg, CMessage);
+	ADDFN(CMouseMoveMsg, CMouseMsg);
+	ADDFN(CMouseButtonMsg, CMouseMsg);
+	ADDFN(CMouseButtonDownMsg, CMouseButtonMsg);
+	ADDFN(CMouseButtonUpMsg, CMouseButtonMsg);
+	ADDFN(CMouseButtonDoubleClickMsg, CMouseButtonMsg);
+	ADDFN(CMouseDragMsg, CMouseMsg);
+	ADDFN(CMouseDragStartMsg, CMouseDragMsg);
+	ADDFN(CMouseDragMoveMsg, CMouseDragMsg);
+	ADDFN(CMouseDragEndMsg, CMouseDragMsg);
+	ADDFN(CMoveToStartPosMsg, CMessage);
+	ADDFN(CMovieEndMsg, CMessage);
+	ADDFN(CMovieFrameMsg, CMessage);
+	ADDFN(CMusicHasStartedMsg, CMessage);
+	ADDFN(CMusicHasStoppedMsg, CMessage);
+	ADDFN(CMusicSettingChangedMsg, CMessage);
+	ADDFN(CNPCPlayAnimationMsg, CMessage);
+	ADDFN(CNPCPlayIdleAnimationMsg, CMessage);
+	ADDFN(CNPCPlayTalkingAnimationMsg, CMessage);
+	ADDFN(CNPCQueueIdleAnimMsg, CMessage);
+	ADDFN(CNutPuzzleMsg, CMessage);
+	ADDFN(COnSummonBotMsg, CMessage);
+	ADDFN(COpeningCreditsMsg, CMessage);
+	ADDFN(CPETDeliverMsg, CMessage);
+	ADDFN(CPETGainedObjectMsg, CMessage);
+	ADDFN(CPETHelmetOnOffMsg, CMessage);
+	ADDFN(CPETKeyboardOnOffMsg, CMessage);
+	ADDFN(CPETLostObjectMsg, CMessage);
+	ADDFN(CPETObjectSelectedMsg, CMessage);
+	ADDFN(CPETObjectStateMsg, CMessage);
+	ADDFN(CPETPhotoOnOffMsg, CMessage);
+	ADDFN(CPETPlaySoundMsg, CMessage);
+	ADDFN(CPETReceiveMsg, CMessage);
+	ADDFN(CPETSetStarDestinationMsg, CMessage);
+	ADDFN(CPETStarFieldLockMsg, CMessage);
+	ADDFN(CPETStereoFieldOnOffMsg, CMessage);
+	ADDFN(CPETTargetMsg, CMessage);
+	ADDFN(CPanningAwayFromParrotMsg, CMessage);
+	ADDFN(CParrotSpeakMsg, CMessage);
+	ADDFN(CParrotTriesChickenMsg, CMessage);
+	ADDFN(CPassOnDragStartMsg, CMessage);
+	ADDFN(CPhonographPlayMsg, CMessage);
+	ADDFN(CPhonographReadyToPlayMsg, CMessage);
+	ADDFN(CPhonographRecordMsg, CMessage);
+	ADDFN(CPhonographStopMsg, CMessage);
+	ADDFN(CPlayRangeMsg, CMessage);
+	ADDFN(CPlayerTriesRestaurantTableMsg, CMessage);
+	ADDFN(CPreSaveMsg, CMessage);
+	ADDFN(CProdMaitreDMsg, CMessage);
+	ADDFN(CPumpingMsg, CMessage);
+	ADDFN(CPutBotBackInHisBoxMsg, CMessage);
+	ADDFN(CPutParrotBackMsg, CMessage);
+	ADDFN(CPuzzleSolvedMsg, CMessage);
+	ADDFN(CQueryCylinderHolderMsg, CMessage);
+	ADDFN(CQueryCylinderMsg, CMessage);
+	ADDFN(CQueryCylinderNameMsg, CMessage);
+	ADDFN(CQueryCylinderTypeMsg, CMessage);
+	ADDFN(CQueryMusicControlSettingMsg, CMessage);
+	ADDFN(CQueryPhonographState, CMessage);
+	ADDFN(CRecordOntoCylinderMsg, CMessage);
+	ADDFN(CRemoveFromGameMsg, CMessage);
+	ADDFN(CReplaceBowlAndNutsMsg, CMessage);
+	ADDFN(CRestaurantMusicChanged, CMessage);
+	ADDFN(CSendCCarryMsg, CMessage);
+	ADDFN(CSenseWorkingMsg, CMessage);
+	ADDFN(CServiceElevatorDoor, CMessage);
+	ADDFN(CServiceElevatorFloorChangeMsg, CMessage);
+	ADDFN(CServiceElevatorFloorRequestMsg, CMessage);
+	ADDFN(CServiceElevatorMsg, CMessage);
+	ADDFN(CSetChevButtonImageMsg, CMessage);
+	ADDFN(CSetChevClassBits, CMessage);
+	ADDFN(CSetChevFloorBits, CMessage);
+	ADDFN(CSetChevLiftBits, CMessage);
+	ADDFN(CSetChevPanelBitMsg, CMessage);
+	ADDFN(CSetChevPanelButtonsMsg, CMessage);
+	ADDFN(CSetChevRoomBits, CMessage);
+	ADDFN(CSetMusicControlsMsg, CMessage);
+	ADDFN(CSetVarMsg, CMessage);
+	ADDFN(CSetVolumeMsg, CMessage);
+	ADDFN(CShipSettingMsg, CMessage);
+	ADDFN(CShowTextMsg, CMessage);
+	ADDFN(CSignalObject, CMessage);
+	ADDFN(CSpeechFallsFromTreeMsg, CMessage);
+	ADDFN(CStartMusicMsg, CMessage);
+	ADDFN(CStatusChangeMsg, CMessage);
+	ADDFN(CStopMusicMsg, CMessage);
+	ADDFN(CSubAcceptCCarryMsg, CMessage);
+	ADDFN(CSubDeliverCCarryMsg, CMessage);
+	ADDFN(CSubSendCCarryMsg, CMessage);
+	ADDFN(CSUBTransition, CMessage);
+	ADDFN(CSubTurnOffMsg, CMessage);
+	ADDFN(CSubTurnOnMsg, CMessage);
+	ADDFN(CSummonBotMsg, CMessage);
+	ADDFN(CSummonBotQuerryMsg, CMessage);
+	ADDFN(CTakeHeadPieceMsg, CMessage);
+	ADDFN(CTextInputMsg, CMessage);
+	ADDFN(CTimeDilationMsg, CMessage);
+	ADDFN(CTimeMsg, CMessage);
+	ADDFN(CTitleSequenceEndedMsg, CMessage);
+	ADDFN(CTransitMsg, CMessage);
+	ADDFN(CTransportMsg, CMessage);
+	ADDFN(CTriggerAutoMusicPlayerMsg, CMessage);
+	ADDFN(CTriggerNPCEvent, CMessage);
+	ADDFN(CTrueTalkGetAnimSetMsg, CMessage);
+	ADDFN(CTrueTalkGetAssetDetailsMsg, CMessage);
+	ADDFN(CTrueTalkGetStateValueMsg, CMessage);
+	ADDFN(CTrueTalkNotifySpeechEndedMsg, CMessage);
+	ADDFN(CTrueTalkNotifySpeechStartedMsg, CMessage);
+	ADDFN(CTrueTalkQueueUpAnimSetMsg, CMessage);
+	ADDFN(CTrueTalkSelfQueueAnimSetMsg, CMessage);
+	ADDFN(CTrueTalkTriggerActionMsg, CMessage);
+	ADDFN(CTurnOff, CMessage);
+	ADDFN(CTurnOn, CMessage);
+	ADDFN(CUse, CMessage);
+	ADDFN(CUseWithCharMsg, CMessage);
+	ADDFN(CUseWithOtherMsg, CMessage);
+	ADDFN(CVirtualKeyCharMsg, CMessage);
+	ADDFN(CVisibleMsg, CMessage);
 
-	ADDFN(CEnterBombRoom);
-	ADDFN(CEnterBridge);
-	ADDFN(CEnterExitFirstClassState);
-	ADDFN(CEnterExitMiniLift);
-	ADDFN(CEnterExitSecClassMiniLift);
-	ADDFN(CEnterExitView);
-	ADDFN(CEnterSecClassState);
-	ADDFN(CExitArboretum);
-	ADDFN(CExitBridge);
-	ADDFN(CExitLift);
-	ADDFN(CExitPellerator);
-	ADDFN(CExitStateRoom);
-	ADDFN(CExitTiania);
-	ADDFN(CMovePlayerInParrotRoom);
-	ADDFN(CMovePlayerTo);
-	ADDFN(CMovePlayerToFrom);
-	ADDFN(CMultiMove);
-	ADDFN(CPanFromPel);
-	ADDFN(CRestaurantPanHandler);
-	ADDFN(CScraliontisTable);
-	ADDFN(CRestrictedMove);
-	ADDFN(CTripDownCanal);
+	ADDFN(CEnterBombRoom, 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(CBarbot);
-	ADDFN(CBellBot);
-	ADDFN(CCallBot);
-	ADDFN(CDeskbot);
-	ADDFN(CDoorbot);
-	ADDFN(CMaitreD);
-	ADDFN(CLiftBot);
-	ADDFN(CMobile);
-	ADDFN(CParrot);
-	ADDFN(CStarlings);
-	ADDFN(CSuccUBus);
-	ADDFN(CSummonBots);
-	ADDFN(CTitania);
+	ADDFN(CBarbot, CTrueTalkNPC);
+	ADDFN(CBellBot, CTrueTalkNPC);
+	ADDFN(CCallBot, CGameObject);
+	ADDFN(CCharacter, CGameObject);
+	ADDFN(CDeskbot, CTrueTalkNPC);
+	ADDFN(CDoorbot, CTrueTalkNPC);
+	ADDFN(CMaitreD, CTrueTalkNPC);
+	ADDFN(CLiftBot, CTrueTalkNPC);
+	ADDFN(CMobile, CCharacter);
+	ADDFN(CParrot, CTrueTalkNPC);
+	ADDFN(CRobotController, CGameObject);
+	ADDFN(CStarlings, CCharacter);
+	ADDFN(CSuccUBus, CTrueTalkNPC);
+	ADDFN(CSummonBots, CRobotController);
+	ADDFN(CTitania, CCharacter);
+	ADDFN(CTrueTalkNPC, CCharacter);
 
-	ADDFN(CAutoMusicPlayer);
-	ADDFN(CAutoSoundEvent);
-	ADDFN(CAutoMusicPlayerBase);
-	ADDFN(CAutoSoundPlayer);
-	ADDFN(CAutoSoundPlayerADSR);
-	ADDFN(CBackgroundSoundMaker);
-	ADDFN(CBilgeAutoSoundEvent);
-	ADDFN(CBilgeDispensorEvent);
-	ADDFN(CBirdSong);
-	ADDFN(CDoorAutoSoundEvent);
-	ADDFN(CGondolierSong);
-	ADDFN(CEnterViewTogglesOtherMusic);
-	ADDFN(CGondolierSong);
-	ADDFN(CMusicPlayer);
-	ADDFN(CNodeAutoSoundPlayer);
-	ADDFN(CRestrictedAutoMusicPlayer);
-	ADDFN(CRoomAutoSoundPlayer);
-	ADDFN(CSeasonNoises);
-	ADDFN(CSeasonalMusicPlayer);
-	ADDFN(CAutoMusicPlayer);
-	ADDFN(CTitaniaSpeech);
-	ADDFN(CTriggerAutoMusicPlayer);
-	ADDFN(CViewAutoSoundPlayer);
-	ADDFN(CViewTogglesOtherMusic);
-	ADDFN(CWaterLappingSounds);
-	ADDFN(CStarControl);
+	ADDFN(CAutoMusicPlayer, CAutoMusicPlayerBase);
+	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(CNodeAutoSoundPlayer, CAutoSoundPlayer);
+	ADDFN(CRestrictedAutoMusicPlayer, CAutoMusicPlayer);
+	ADDFN(CRoomAutoSoundPlayer, CAutoSoundPlayer);
+	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);
 }
 
 void CSaveableObject::freeClassList() {
+	Common::List<ClassDef *>::iterator i;
+	for (i = _classDefs->begin(); i != _classDefs->end(); ++i)
+		delete *i;
+
+	delete _classDefs;
 	delete _classList;
 }
 
@@ -1512,11 +1564,17 @@ void CSaveableObject::load(SimpleFile *file) {
 }
 
 void CSaveableObject::saveHeader(SimpleFile *file, int indent) const {
-	file->writeClassStart(getClassName(), indent);
+	file->writeClassStart(getType()->_className, indent);
 }
 
 void CSaveableObject::saveFooter(SimpleFile *file, int indent) const {
 	file->writeClassEnd(indent);
 }
 
+/*------------------------------------------------------------------------*/
+
+CSaveableObject *ClassDef::create() {
+	return new CSaveableObject();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/saveable_object.h b/engines/titanic/core/saveable_object.h
index ed26163..8368c71 100644
--- a/engines/titanic/core/saveable_object.h
+++ b/engines/titanic/core/saveable_object.h
@@ -30,9 +30,34 @@
 
 namespace Titanic {
 
+class CSaveableObject;
+
+class ClassDef {
+public:
+	const char *_className;
+	ClassDef *_parent;
+public:
+	ClassDef(const char *className, ClassDef *parent) :
+		_className(className), _parent(parent) {}
+	virtual CSaveableObject *create();
+};
+
+template<typename T>
+class TypeTemplate : public ClassDef {
+public:
+	TypeTemplate(const char *className, ClassDef *parent) : 
+		ClassDef(className, parent) {}
+	virtual CSaveableObject *create() { return new T(); }
+};
+
+#define CLASSDEF \
+	static ClassDef *_type; \
+	virtual ClassDef *getType() const { return _type; }
+
 class CSaveableObject {
 	typedef CSaveableObject *(*CreateFunction)();
 private:
+	static Common::List<ClassDef *> *_classDefs;
 	static Common::HashMap<Common::String, CreateFunction> *_classList;
 public:
 	/**
@@ -50,13 +75,9 @@ public:
 	 */
 	static CSaveableObject *createInstance(const Common::String &name);
 public:
+	CLASSDEF
 	virtual ~CSaveableObject() {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSaveableObject"; }
-
+	
 	/**
 	 * Save the data for the class to file
 	 */
diff --git a/engines/titanic/core/static_image.h b/engines/titanic/core/static_image.h
index ac556f2..2b0a3ad 100644
--- a/engines/titanic/core/static_image.h
+++ b/engines/titanic/core/static_image.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CStaticImage : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CStaticImage"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index ea5de32..78a58fa 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -38,14 +38,10 @@ private:
 	CTreeItem *_firstChild;
 	int _field14;
 public:
+	CLASSDEF
 	CTreeItem();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTreeItem"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/core/turn_on_object.h b/engines/titanic/core/turn_on_object.h
index a17d58e..d87e205 100644
--- a/engines/titanic/core/turn_on_object.h
+++ b/engines/titanic/core/turn_on_object.h
@@ -31,14 +31,10 @@ class CTurnOnObject : public CBackground {
 protected:
 	CString _string3;
 public:
+	CLASSDEF
 	CTurnOnObject();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTurnOnObject"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/core/turn_on_play_sound.h b/engines/titanic/core/turn_on_play_sound.h
index a0fc8ee..263709b 100644
--- a/engines/titanic/core/turn_on_play_sound.h
+++ b/engines/titanic/core/turn_on_play_sound.h
@@ -33,14 +33,10 @@ private:
 	int _fieldF8;
 	int _fieldFC;
 public:
+	CLASSDEF
 	CTurnOnPlaySound();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTurnOnPlaySound"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/core/turn_on_turn_off.h b/engines/titanic/core/turn_on_turn_off.h
index 41a0156..5683a0d 100644
--- a/engines/titanic/core/turn_on_turn_off.h
+++ b/engines/titanic/core/turn_on_turn_off.h
@@ -35,14 +35,10 @@ private:
 	int _fieldEC;
 	int _fieldF0;
 public:
+	CLASSDEF
 	CTurnOnTurnOff();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTurnOnTurnOff"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index 592bb21..a5ce575 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -39,14 +39,10 @@ protected:
 	int _field50;
 	int _field54;
 public:
+	CLASSDEF
 	CViewItem();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNamedItem"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/announce.h b/engines/titanic/game/announce.h
index baa5f1a..18702c3 100644
--- a/engines/titanic/game/announce.h
+++ b/engines/titanic/game/announce.h
@@ -34,14 +34,10 @@ private:
 	int _fieldC4;
 	int _fieldC8;
 public:
+	CLASSDEF
 	CAnnounce();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAnnounce"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/annoy_barbot.h b/engines/titanic/game/annoy_barbot.h
index c1598e1..c15b41d 100644
--- a/engines/titanic/game/annoy_barbot.h
+++ b/engines/titanic/game/annoy_barbot.h
@@ -31,10 +31,7 @@ class CAnnoyBarbot : public CGameObject {
 private:
 	static int _v1;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAnnoyBarbot"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/arb_background.h b/engines/titanic/game/arb_background.h
index e443c4b..50a9075 100644
--- a/engines/titanic/game/arb_background.h
+++ b/engines/titanic/game/arb_background.h
@@ -34,14 +34,10 @@ public:
 	int _fieldE8;
 	int _fieldEC;
 public:
+	CLASSDEF
 	CArbBackground();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CArbBackground"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
index 8cbe49b..eb82333 100644
--- a/engines/titanic/game/arboretum_gate.h
+++ b/engines/titanic/game/arboretum_gate.h
@@ -64,14 +64,10 @@ public:
 	int _field150;
 	CString _string2;
 public:
+	CLASSDEF
 	CArboretumGate();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CArboretumGate"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/auto_animate.h b/engines/titanic/game/auto_animate.h
index 2afb85b..0fd4ad7 100644
--- a/engines/titanic/game/auto_animate.h
+++ b/engines/titanic/game/auto_animate.h
@@ -33,11 +33,8 @@ public:
 	int _fieldE4;
 	int _fieldE8;
 public:
+	CLASSDEF
 	CAutoAnimate() : CBackground(), _fieldE0(1), _fieldE4(1), _fieldE8(0) {}
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoAnimate"; }
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/bar_bell.h b/engines/titanic/game/bar_bell.h
index 87c244d..279379f 100644
--- a/engines/titanic/game/bar_bell.h
+++ b/engines/titanic/game/bar_bell.h
@@ -35,14 +35,10 @@ public:
 	int _fieldC8;
 	int _fieldCC;
 public:
+	CLASSDEF
 	CBarBell();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBarBell"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/bar_menu.h b/engines/titanic/game/bar_menu.h
index 69ba0aa..ac253fc 100644
--- a/engines/titanic/game/bar_menu.h
+++ b/engines/titanic/game/bar_menu.h
@@ -33,14 +33,10 @@ public:
 	int _fieldC0;
 	int _fieldC4;
 public:
+	CLASSDEF
 	CBarMenu();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBarMenu"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/bar_menu_button.h b/engines/titanic/game/bar_menu_button.h
index 56b618d..1a9d42c 100644
--- a/engines/titanic/game/bar_menu_button.h
+++ b/engines/titanic/game/bar_menu_button.h
@@ -31,14 +31,10 @@ class CBarMenuButton : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CBarMenuButton() : CGameObject(), _value(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBarMenuButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/belbot_get_light.h b/engines/titanic/game/belbot_get_light.h
index 2c2d547..05c14f5 100644
--- a/engines/titanic/game/belbot_get_light.h
+++ b/engines/titanic/game/belbot_get_light.h
@@ -31,10 +31,7 @@ class CBelbotGetLight : public CGameObject {
 private:
 	CString _value;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBelbotGetLight"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/bilge_succubus.h b/engines/titanic/game/bilge_succubus.h
index 795fe86..4ff72a5 100644
--- a/engines/titanic/game/bilge_succubus.h
+++ b/engines/titanic/game/bilge_succubus.h
@@ -34,14 +34,10 @@ public:
 	int _field1E4;
 	int _field1E8;
 public:
+	CLASSDEF
 	CBilgeSuccUBus();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBilgeSuccUBus"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/bomb.h b/engines/titanic/game/bomb.h
index a7294f4..2e7ba46 100644
--- a/engines/titanic/game/bomb.h
+++ b/engines/titanic/game/bomb.h
@@ -40,14 +40,10 @@ public:
 	int _field100;
 	int _field104;
 public:
+	CLASSDEF
 	CBomb();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBomb"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/bottom_of_well_monitor.h b/engines/titanic/game/bottom_of_well_monitor.h
index f1a9f5d..e063579 100644
--- a/engines/titanic/game/bottom_of_well_monitor.h
+++ b/engines/titanic/game/bottom_of_well_monitor.h
@@ -32,14 +32,10 @@ public:
 	static int _v1, _v2;
 	int _value;
 public:
+	CLASSDEF
 	CBottomOfWellMonitor() : _value(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBottomOfWellMonitor"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/bowl_unlocker.h b/engines/titanic/game/bowl_unlocker.h
index 455b0a7..7b886c4 100644
--- a/engines/titanic/game/bowl_unlocker.h
+++ b/engines/titanic/game/bowl_unlocker.h
@@ -31,14 +31,10 @@ class CBowlUnlocker : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CBowlUnlocker() : CGameObject(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBowlUnlocker"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/brain_slot.h b/engines/titanic/game/brain_slot.h
index fa197a8..ae797eb 100644
--- a/engines/titanic/game/brain_slot.h
+++ b/engines/titanic/game/brain_slot.h
@@ -34,14 +34,10 @@ public:
 	int _value1;
 	CString _value2;
 public:
+	CLASSDEF
 	CBrainSlot() : CGameObject(), _value1(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBrainSlot"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/bridge_door.h b/engines/titanic/game/bridge_door.h
index 96703c1..828562d 100644
--- a/engines/titanic/game/bridge_door.h
+++ b/engines/titanic/game/bridge_door.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CBridgeDoor : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBridgeDoor"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/bridge_view.h b/engines/titanic/game/bridge_view.h
index 7a765cf..35de076 100644
--- a/engines/titanic/game/bridge_view.h
+++ b/engines/titanic/game/bridge_view.h
@@ -31,14 +31,10 @@ class CBridgeView : public CBackground {
 public:
 	int _fieldE0;
 public:
+	CLASSDEF
 	CBridgeView() : CBackground(), _fieldE0(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBridgeView"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/broken_pell_base.h b/engines/titanic/game/broken_pell_base.h
index 8e77501..46e7a70 100644
--- a/engines/titanic/game/broken_pell_base.h
+++ b/engines/titanic/game/broken_pell_base.h
@@ -34,14 +34,10 @@ private:
 
 	int _fieldE0;
 public:
+	CLASSDEF
 	CBrokenPellBase() : CBackground(), _fieldE0(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBrokenPellBase"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/broken_pellerator.h b/engines/titanic/game/broken_pellerator.h
index 71bae32..974d5d2 100644
--- a/engines/titanic/game/broken_pellerator.h
+++ b/engines/titanic/game/broken_pellerator.h
@@ -34,10 +34,7 @@ private:
 	CString _string4;
 	CString _string5;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBrokenPellerator"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/broken_pellerator_froz.h b/engines/titanic/game/broken_pellerator_froz.h
index 1fded7c..c3674f0 100644
--- a/engines/titanic/game/broken_pellerator_froz.h
+++ b/engines/titanic/game/broken_pellerator_froz.h
@@ -34,10 +34,7 @@ private:
 	CString _string4;
 	CString _string5;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBrokenPelleratorFroz"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/cage.h b/engines/titanic/game/cage.h
index 4c097f3..08fc8c8 100644
--- a/engines/titanic/game/cage.h
+++ b/engines/titanic/game/cage.h
@@ -32,10 +32,7 @@ public:
 	static int _v1;
 	static int _v2;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCage"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/call_pellerator.h b/engines/titanic/game/call_pellerator.h
index a6e8ded..dc9afe0 100644
--- a/engines/titanic/game/call_pellerator.h
+++ b/engines/titanic/game/call_pellerator.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CCallPellerator : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCallPellerator"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/captains_wheel.h b/engines/titanic/game/captains_wheel.h
index 3d35b9b..bcfc513 100644
--- a/engines/titanic/game/captains_wheel.h
+++ b/engines/titanic/game/captains_wheel.h
@@ -36,14 +36,10 @@ public:
 	int _fieldF0;
 	int _fieldF4;
 public:
+	CLASSDEF
 	CCaptainsWheel();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCaptainsWheel"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/cdrom.h b/engines/titanic/game/cdrom.h
index cd05c79..f810056 100644
--- a/engines/titanic/game/cdrom.h
+++ b/engines/titanic/game/cdrom.h
@@ -31,14 +31,10 @@ class CCDROM : public CGameObject {
 private:
 	Common::Point _pos1;
 public:
+	CLASSDEF
 	CCDROM();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCDROM"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/cdrom_computer.h b/engines/titanic/game/cdrom_computer.h
index 368c45f..de070b0 100644
--- a/engines/titanic/game/cdrom_computer.h
+++ b/engines/titanic/game/cdrom_computer.h
@@ -34,14 +34,10 @@ private:
 	int _fieldC4;
 	int _fieldC8;
 public:
+	CLASSDEF
 	CCDROMComputer();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCDROMComputer"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/cdrom_tray.h b/engines/titanic/game/cdrom_tray.h
index 371187e..85d26c5 100644
--- a/engines/titanic/game/cdrom_tray.h
+++ b/engines/titanic/game/cdrom_tray.h
@@ -32,14 +32,10 @@ private:
 	int _fieldBC;
 	CString _string1;
 public:
+	CLASSDEF
 	CCDROMTray();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCDROMTray"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/cell_point_button.h b/engines/titanic/game/cell_point_button.h
index a16e7ae..02710f6 100644
--- a/engines/titanic/game/cell_point_button.h
+++ b/engines/titanic/game/cell_point_button.h
@@ -43,14 +43,10 @@ public:
 	CString _string3;
 	int _field118;
 public:
+	CLASSDEF
 	CCellPointButton();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCellPointButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/chev_code.h b/engines/titanic/game/chev_code.h
index 6bd6242..3d5347b 100644
--- a/engines/titanic/game/chev_code.h
+++ b/engines/titanic/game/chev_code.h
@@ -31,14 +31,10 @@ class CChevCode : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CChevCode() : CGameObject(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CChevCode"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/chev_panel.h b/engines/titanic/game/chev_panel.h
index 39ad436..9ddca37 100644
--- a/engines/titanic/game/chev_panel.h
+++ b/engines/titanic/game/chev_panel.h
@@ -33,14 +33,10 @@ public:
 	int _fieldC0;
 	int _fieldC4;
 public:
+	CLASSDEF
 	CChevPanel() : _fieldBC(0), _fieldC0(0), _fieldC4(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CChevPanel"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/chicken_cooler.h b/engines/titanic/game/chicken_cooler.h
index 42e8a27..9e15057 100644
--- a/engines/titanic/game/chicken_cooler.h
+++ b/engines/titanic/game/chicken_cooler.h
@@ -32,14 +32,10 @@ public:
 	int _fieldBC;
 	int _fieldC0;
 public:
+	CLASSDEF
 	CChickenCooler() : CGameObject(), _fieldBC(0), _fieldC0(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CChickenCooler"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/chicken_dispensor.h b/engines/titanic/game/chicken_dispensor.h
index 10fcba1..97e5f86 100644
--- a/engines/titanic/game/chicken_dispensor.h
+++ b/engines/titanic/game/chicken_dispensor.h
@@ -33,14 +33,10 @@ public:
 	int _fieldE4;
 	int _fieldE8;
 public:
+	CLASSDEF
 	CChickenDispensor();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNoNutBowl"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/close_broken_pel.h b/engines/titanic/game/close_broken_pel.h
index ea174a4..ecf38d9 100644
--- a/engines/titanic/game/close_broken_pel.h
+++ b/engines/titanic/game/close_broken_pel.h
@@ -31,10 +31,7 @@ class CCloseBrokenPel : public CBackground {
 public:
 	CString _string3;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCloseBrokenPel"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/code_wheel.h b/engines/titanic/game/code_wheel.h
index 7087982..6080e92 100644
--- a/engines/titanic/game/code_wheel.h
+++ b/engines/titanic/game/code_wheel.h
@@ -33,14 +33,10 @@ private:
 	int _field10C;
 	int _field110;
 public:
+	CLASSDEF
 	CodeWheel();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CodeWheel"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/computer.h b/engines/titanic/game/computer.h
index 074d17c..793fecc 100644
--- a/engines/titanic/game/computer.h
+++ b/engines/titanic/game/computer.h
@@ -32,14 +32,10 @@ public:
 	CString _string3;
 	int _fieldEC;
 public:
+	CLASSDEF
 	CComputer() : CBackground(), _string3("None"), _fieldEC(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CComputer"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/computer_screen.h b/engines/titanic/game/computer_screen.h
index adb8b99..aa47482 100644
--- a/engines/titanic/game/computer_screen.h
+++ b/engines/titanic/game/computer_screen.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CComputerScreen : public CGameObject {
 public:
+	CLASSDEF
 	CComputerScreen();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CComputerScreen"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/cookie.h b/engines/titanic/game/cookie.h
index a1a72c9..bd9d1ff 100644
--- a/engines/titanic/game/cookie.h
+++ b/engines/titanic/game/cookie.h
@@ -32,14 +32,10 @@ public:
 	int _value1;
 	int _value2;
 public:
+	CLASSDEF
 	CCookie() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCookie"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/credits.h b/engines/titanic/game/credits.h
index 0e35a58..dc22912 100644
--- a/engines/titanic/game/credits.h
+++ b/engines/titanic/game/credits.h
@@ -31,14 +31,10 @@ class CCredits : public CGameObject {
 public:
 	int _fieldBC, _fieldC0;
 public:
+	CLASSDEF
 	CCredits();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCredits"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/credits_button.h b/engines/titanic/game/credits_button.h
index b22ce79..fd7a8ad 100644
--- a/engines/titanic/game/credits_button.h
+++ b/engines/titanic/game/credits_button.h
@@ -31,14 +31,10 @@ class CCreditsButton : public CBackground {
 public:
 	int _fieldE0;
 public:
+	CLASSDEF
 	CCreditsButton();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCreditsButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/dead_area.h b/engines/titanic/game/dead_area.h
index 374e45e..4abcd58d 100644
--- a/engines/titanic/game/dead_area.h
+++ b/engines/titanic/game/dead_area.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CDeadArea : public CGameObject {
 public:
+	CLASSDEF
 	CDeadArea();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDeadArea"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/desk_click_responder.h b/engines/titanic/game/desk_click_responder.h
index 94afece..a11d7ae 100644
--- a/engines/titanic/game/desk_click_responder.h
+++ b/engines/titanic/game/desk_click_responder.h
@@ -32,10 +32,7 @@ protected:
 	int _fieldD4;
 	int _fieldD8;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDeskClickResponder"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/doorbot_elevator_handler.h b/engines/titanic/game/doorbot_elevator_handler.h
index 41d6068..e46929d 100644
--- a/engines/titanic/game/doorbot_elevator_handler.h
+++ b/engines/titanic/game/doorbot_elevator_handler.h
@@ -32,10 +32,7 @@ private:
 	static int _v1;
 	int _value;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDoorbotElevatorHandler"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/doorbot_home_handler.h b/engines/titanic/game/doorbot_home_handler.h
index 1557dbf..1e5d128 100644
--- a/engines/titanic/game/doorbot_home_handler.h
+++ b/engines/titanic/game/doorbot_home_handler.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CDoorbotHomeHandler : public CGameObject {
 public:
+	CLASSDEF
 	CDoorbotHomeHandler();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDoorbotHomeHandler"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/ear_sweet_bowl.h b/engines/titanic/game/ear_sweet_bowl.h
index 3e27516..aa276f8 100644
--- a/engines/titanic/game/ear_sweet_bowl.h
+++ b/engines/titanic/game/ear_sweet_bowl.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CEarSweetBowl : public CSweetBowl {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEarSweetBowl"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/eject_phonograph_button.h b/engines/titanic/game/eject_phonograph_button.h
index e37a061..d3e8a50 100644
--- a/engines/titanic/game/eject_phonograph_button.h
+++ b/engines/titanic/game/eject_phonograph_button.h
@@ -34,14 +34,10 @@ public:
 	CString _string3;
 	CString _string4;
 public:
+	CLASSDEF
 	CEjectPhonographButton() : CBackground(), _fieldE0(0), _fieldE4(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEjectPhonographButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/elevator_action_area.h b/engines/titanic/game/elevator_action_area.h
index 07c4f13..570ee80 100644
--- a/engines/titanic/game/elevator_action_area.h
+++ b/engines/titanic/game/elevator_action_area.h
@@ -31,14 +31,10 @@ class CElevatorActionArea : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CElevatorActionArea() : CGameObject(), _value(4) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CElevatorActionArea"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/emma_control.h b/engines/titanic/game/emma_control.h
index 590c6f7..ea30c52 100644
--- a/engines/titanic/game/emma_control.h
+++ b/engines/titanic/game/emma_control.h
@@ -33,14 +33,10 @@ private:
 
 	CString _wavFile1, _wavFile2;
 public:
+	CLASSDEF
 	CEmmaControl() : CBackground(), _wavFile1("b#39.wav"), _wavFile2("b#38.wav") {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEmmaControl"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/empty_nut_bowl.h b/engines/titanic/game/empty_nut_bowl.h
index 57668ca..9645284 100644
--- a/engines/titanic/game/empty_nut_bowl.h
+++ b/engines/titanic/game/empty_nut_bowl.h
@@ -31,14 +31,10 @@ class CEmptyNutBowl : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CEmptyNutBowl() : CGameObject(), _value(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEmptyNutBowl"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/end_credit_text.h b/engines/titanic/game/end_credit_text.h
index de0e54d..0003a8b 100644
--- a/engines/titanic/game/end_credit_text.h
+++ b/engines/titanic/game/end_credit_text.h
@@ -31,14 +31,10 @@ class CEndCreditText : public CGameObject {
 private:
 	int _value;
 public:
+	CLASSDEF
 	CEndCreditText() : CGameObject(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEndCreditText"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/end_credits.h b/engines/titanic/game/end_credits.h
index cf5c45a..a259a21 100644
--- a/engines/titanic/game/end_credits.h
+++ b/engines/titanic/game/end_credits.h
@@ -31,14 +31,10 @@ class CEndCredits : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CEndCredits() : CGameObject(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEndCredits"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/end_explode_ship.h b/engines/titanic/game/end_explode_ship.h
index df2e0b1..a6b053f 100644
--- a/engines/titanic/game/end_explode_ship.h
+++ b/engines/titanic/game/end_explode_ship.h
@@ -31,14 +31,10 @@ class CEndExplodeShip : public CGameObject {
 public:
 	int _value1, _value2;
 public:
+	CLASSDEF
 	CEndExplodeShip() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEndExplodeShip"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/end_game_credits.h b/engines/titanic/game/end_game_credits.h
index f8ec6b0..68e86c6 100644
--- a/engines/titanic/game/end_game_credits.h
+++ b/engines/titanic/game/end_game_credits.h
@@ -32,14 +32,10 @@ private:
 	int _fieldBC;
 	Common::Point _pos1;
 public:
+	CLASSDEF
 	CEndGameCredits();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEndGameCredits"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/end_sequence_control.h b/engines/titanic/game/end_sequence_control.h
index dc84929..5e2ba30 100644
--- a/engines/titanic/game/end_sequence_control.h
+++ b/engines/titanic/game/end_sequence_control.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CEndSequenceControl : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEndSequenceControl"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/fan.h b/engines/titanic/game/fan.h
index 75bdea5..6f23407 100644
--- a/engines/titanic/game/fan.h
+++ b/engines/titanic/game/fan.h
@@ -31,14 +31,10 @@ class CFan : public CGameObject {
 public:
 	int _value1, _value2;
 public:
+	CLASSDEF
 	CFan() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CFan"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/fan_control.h b/engines/titanic/game/fan_control.h
index dfb1ccc..54ebbe2 100644
--- a/engines/titanic/game/fan_control.h
+++ b/engines/titanic/game/fan_control.h
@@ -35,14 +35,10 @@ public:
 	int _fieldC8;
 	int _fieldCC;
 public:
+	CLASSDEF
 	CFanControl();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CFanControl"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/fan_decrease.h b/engines/titanic/game/fan_decrease.h
index 9831873..bac1028 100644
--- a/engines/titanic/game/fan_decrease.h
+++ b/engines/titanic/game/fan_decrease.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CFanDecrease : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CFanDecrease"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/fan_increase.h b/engines/titanic/game/fan_increase.h
index 1b9a0fd..62561f1 100644
--- a/engines/titanic/game/fan_increase.h
+++ b/engines/titanic/game/fan_increase.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CFanIncrease : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CFanIncrease"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/fan_noises.h b/engines/titanic/game/fan_noises.h
index 5e817a3..ba35edc 100644
--- a/engines/titanic/game/fan_noises.h
+++ b/engines/titanic/game/fan_noises.h
@@ -37,14 +37,10 @@ public:
 	int _fieldD0;
 	int _fieldD4;
 public:
+	CLASSDEF
 	CFanNoises();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CFanNoises"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/floor_indicator.h b/engines/titanic/game/floor_indicator.h
index 86a7125..a3511fb 100644
--- a/engines/titanic/game/floor_indicator.h
+++ b/engines/titanic/game/floor_indicator.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CFloorIndicator : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CFloorIndicator"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/games_console.h b/engines/titanic/game/games_console.h
index 4caeda8..67634d8d 100644
--- a/engines/titanic/game/games_console.h
+++ b/engines/titanic/game/games_console.h
@@ -31,14 +31,10 @@ class CGamesConsole : public CBackground {
 public:
 	int _fieldE0;
 public:
+	CLASSDEF
 	CGamesConsole() : CBackground(), _fieldE0(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGamesConsole"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
index e8149ca..6782a56 100644
--- a/engines/titanic/game/get_lift_eye2.h
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -31,15 +31,11 @@ class CGetLiftEye2 : public CGameObject {
 private:
 	static CString *_v1;
 public:
+	CLASSDEF
 	static void init();
 	static void deinit();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGetLiftEye2"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/glass_smasher.h b/engines/titanic/game/glass_smasher.h
index c2b7ee6..9c25065 100644
--- a/engines/titanic/game/glass_smasher.h
+++ b/engines/titanic/game/glass_smasher.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CGlassSmasher : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGlassSmasher"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/gondolier/gondolier_base.h b/engines/titanic/game/gondolier/gondolier_base.h
index 3f0cede..c45e3e2 100644
--- a/engines/titanic/game/gondolier/gondolier_base.h
+++ b/engines/titanic/game/gondolier/gondolier_base.h
@@ -40,10 +40,7 @@ private:
 	static int _v9;
 	static int _v10;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGondolierBase"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/gondolier/gondolier_chest.h b/engines/titanic/game/gondolier/gondolier_chest.h
index 277faf9..d2c1381 100644
--- a/engines/titanic/game/gondolier/gondolier_chest.h
+++ b/engines/titanic/game/gondolier/gondolier_chest.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CGondolierChest : public CGondolierBase {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGondolierChest"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/gondolier/gondolier_face.h b/engines/titanic/game/gondolier/gondolier_face.h
index 5007431..334cab1 100644
--- a/engines/titanic/game/gondolier/gondolier_face.h
+++ b/engines/titanic/game/gondolier/gondolier_face.h
@@ -31,14 +31,10 @@ class CGondolierFace : public CGondolierBase {
 private:
 	int _fieldBC;
 public:
+	CLASSDEF
 	CGondolierFace() : CGondolierBase(), _fieldBC(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGondolierMixer"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.h b/engines/titanic/game/gondolier/gondolier_mixer.h
index 5b92bc2..173bcd8 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.h
+++ b/engines/titanic/game/gondolier/gondolier_mixer.h
@@ -37,14 +37,10 @@ private:
 	CString _string2;
 	int _fieldE4;
 public:
+	CLASSDEF
 	CGondolierMixer();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGondolierMixer"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/gondolier/gondolier_slider.h b/engines/titanic/game/gondolier/gondolier_slider.h
index 9522483..eef4a58 100644
--- a/engines/titanic/game/gondolier/gondolier_slider.h
+++ b/engines/titanic/game/gondolier/gondolier_slider.h
@@ -48,14 +48,10 @@ private:
 	CString _string3;
 	int _field118;
 public:
+	CLASSDEF
 	CGondolierSlider();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGondolierSlider"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/hammer_clip.h b/engines/titanic/game/hammer_clip.h
index 70abae5..d1891d8 100644
--- a/engines/titanic/game/hammer_clip.h
+++ b/engines/titanic/game/hammer_clip.h
@@ -31,14 +31,10 @@ class CHammerClip : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CHammerClip() : CGameObject(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CHammerClip"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/hammer_dispensor.h b/engines/titanic/game/hammer_dispensor.h
index 60b7054..b99045d 100644
--- a/engines/titanic/game/hammer_dispensor.h
+++ b/engines/titanic/game/hammer_dispensor.h
@@ -33,14 +33,10 @@ private:
 	int _fieldE4;
 	int _fieldE8;
 public:
+	CLASSDEF
 	CHammerDispensor();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CHammerDispensor"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/hammer_dispensor_button.h b/engines/titanic/game/hammer_dispensor_button.h
index 978c1d3..3f28360 100644
--- a/engines/titanic/game/hammer_dispensor_button.h
+++ b/engines/titanic/game/hammer_dispensor_button.h
@@ -37,14 +37,10 @@ private:
 	int _field10C;
 	int _field110;
 public:
+	CLASSDEF
 	CHammerDispensorButton();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CHammerDispensorButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/head_slot.h b/engines/titanic/game/head_slot.h
index 210546a..3ba94a6 100644
--- a/engines/titanic/game/head_slot.h
+++ b/engines/titanic/game/head_slot.h
@@ -41,14 +41,10 @@ public:
 	int _fieldE8;
 	int _fieldEC;
 public:
+	CLASSDEF
 	CHeadSlot();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CHeadSlot"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/head_smash_event.h b/engines/titanic/game/head_smash_event.h
index 4032098..847e86e 100644
--- a/engines/titanic/game/head_smash_event.h
+++ b/engines/titanic/game/head_smash_event.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CHeadSmashEvent : public CBackground {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CHeadSmashEvent"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/head_smash_lever.h b/engines/titanic/game/head_smash_lever.h
index 7268cb8..8a67f56 100644
--- a/engines/titanic/game/head_smash_lever.h
+++ b/engines/titanic/game/head_smash_lever.h
@@ -33,14 +33,10 @@ public:
 	int _fieldE4;
 	int _fieldE8;
 public:
+	CLASSDEF
 	CHeadSmashLever();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CHeadSmashLever"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/head_spinner.h b/engines/titanic/game/head_spinner.h
index 8d3de61..3ed3e1f 100644
--- a/engines/titanic/game/head_spinner.h
+++ b/engines/titanic/game/head_spinner.h
@@ -32,11 +32,7 @@ public:
 	int _value1, _value2;
 public:
 	CHeadSpinner() : CGameObject(), _value1(0), _value2(0) {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CHeadSpinner"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/idle_summoner.h b/engines/titanic/game/idle_summoner.h
index 8f251b8..a983684 100644
--- a/engines/titanic/game/idle_summoner.h
+++ b/engines/titanic/game/idle_summoner.h
@@ -40,11 +40,7 @@ public:
 	int _fieldDC;
 public:
 	CIdleSummoner();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CIdleSummoner"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/leave_sec_class_state.h b/engines/titanic/game/leave_sec_class_state.h
index 3bcfe81..34ba31b 100644
--- a/engines/titanic/game/leave_sec_class_state.h
+++ b/engines/titanic/game/leave_sec_class_state.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CLeaveSecClassState : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLeaveSecClassState"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/lemon_dispensor.h b/engines/titanic/game/lemon_dispensor.h
index c2c76ea..091c6d7 100644
--- a/engines/titanic/game/lemon_dispensor.h
+++ b/engines/titanic/game/lemon_dispensor.h
@@ -38,14 +38,10 @@ private:
 	int _fieldE8;
 	int _fieldEC;
 public:
+	CLASSDEF
 	CLemonDispensor();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLemonDispensor"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/light.h b/engines/titanic/game/light.h
index 482d1be..ea6073d 100644
--- a/engines/titanic/game/light.h
+++ b/engines/titanic/game/light.h
@@ -38,14 +38,10 @@ private:
 	int _fieldF8;
 	int _fieldFC;
 public:
+	CLASSDEF
 	CLight();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLight"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/light_switch.h b/engines/titanic/game/light_switch.h
index 0228b10..334cba7 100644
--- a/engines/titanic/game/light_switch.h
+++ b/engines/titanic/game/light_switch.h
@@ -35,14 +35,10 @@ private:
 	int _fieldE4;
 	int _fieldE8;
 public:
+	CLASSDEF
 	CLightSwitch();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLightSwitch"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/little_lift_button.h b/engines/titanic/game/little_lift_button.h
index 475b843..92f084a 100644
--- a/engines/titanic/game/little_lift_button.h
+++ b/engines/titanic/game/little_lift_button.h
@@ -31,14 +31,10 @@ class CLittleLiftButton : public CBackground {
 private:
 	int _value;
 public:
+	CLASSDEF
 	CLittleLiftButton() : CBackground(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLittleLiftButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/long_stick_dispenser.h b/engines/titanic/game/long_stick_dispenser.h
index 4912ea3..30e3541 100644
--- a/engines/titanic/game/long_stick_dispenser.h
+++ b/engines/titanic/game/long_stick_dispenser.h
@@ -33,15 +33,11 @@ public:
 	int _fieldC0;
 	int _fieldC4;
 public:
+	CLASSDEF
 	CLongStickDispenser() : CGameObject(), _fieldBC(0),
 		_fieldC0(0), _fieldC4(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLongStickDispenser"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/mail_man.h b/engines/titanic/game/mail_man.h
index 29ca165..a75d75a 100644
--- a/engines/titanic/game/mail_man.h
+++ b/engines/titanic/game/mail_man.h
@@ -31,14 +31,10 @@ class CMailMan : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CMailMan() : CGameObject(), _value(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMailMan"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/maitred/maitred_arm_holder.h b/engines/titanic/game/maitred/maitred_arm_holder.h
index b838109..e329157 100644
--- a/engines/titanic/game/maitred/maitred_arm_holder.h
+++ b/engines/titanic/game/maitred/maitred_arm_holder.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CMaitreDArmHolder : public CDropTarget {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMaitreDArmHolder"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/maitred/maitred_body.h b/engines/titanic/game/maitred/maitred_body.h
index 29e528b..9dcc2af 100644
--- a/engines/titanic/game/maitred/maitred_body.h
+++ b/engines/titanic/game/maitred/maitred_body.h
@@ -31,14 +31,10 @@ class CMaitreDBody : public CMaitreDProdReceptor {
 private:
 	int _fieldC8;
 public:
+	CLASSDEF
 	CMaitreDBody() : CMaitreDProdReceptor(), _fieldC8(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMaitreDBody"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/maitred/maitred_legs.h b/engines/titanic/game/maitred/maitred_legs.h
index e3ac93c..0dc1b34 100644
--- a/engines/titanic/game/maitred/maitred_legs.h
+++ b/engines/titanic/game/maitred/maitred_legs.h
@@ -31,14 +31,10 @@ class CMaitreDLegs : public CMaitreDProdReceptor {
 private:
 	int _fieldC8;
 public:
+	CLASSDEF
 	CMaitreDLegs() : CMaitreDProdReceptor(), _fieldC8(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMaitreDLegs"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/maitred/maitred_prod_receptor.h b/engines/titanic/game/maitred/maitred_prod_receptor.h
index 130bc54..b82c95b 100644
--- a/engines/titanic/game/maitred/maitred_prod_receptor.h
+++ b/engines/titanic/game/maitred/maitred_prod_receptor.h
@@ -33,15 +33,11 @@ protected:
 	int _fieldC0;
 	int _fieldC4;
 public:
+	CLASSDEF
 	CMaitreDProdReceptor() : CGameObject(),
 		_fieldBC(0), _fieldC0(0), _fieldC4(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMaitreDProdReceptor"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/missiveomat.h b/engines/titanic/game/missiveomat.h
index 77ba4cb..a58c928 100644
--- a/engines/titanic/game/missiveomat.h
+++ b/engines/titanic/game/missiveomat.h
@@ -36,14 +36,10 @@ public:
 	CString _string2;
 	int _fieldE0;
 public:
+	CLASSDEF
 	CMissiveOMat();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMissiveOMat"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/missiveomat_button.h b/engines/titanic/game/missiveomat_button.h
index f383e88..603d2f5 100644
--- a/engines/titanic/game/missiveomat_button.h
+++ b/engines/titanic/game/missiveomat_button.h
@@ -31,14 +31,10 @@ class CMissiveOMatButton : public CEditControl {
 public:
 	int _fieldFC;
 public:
+	CLASSDEF
 	CMissiveOMatButton() : CEditControl(), _fieldFC(2) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMissiveOMatButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/movie_tester.h b/engines/titanic/game/movie_tester.h
index b5e4032..2fffd5d 100644
--- a/engines/titanic/game/movie_tester.h
+++ b/engines/titanic/game/movie_tester.h
@@ -31,14 +31,10 @@ class CMovieTester : public CGameObject {
 public:
 	int _value1, _value2;
 public:
+	CLASSDEF
 	CMovieTester() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMovieTester"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/music_console_button.h b/engines/titanic/game/music_console_button.h
index 84a7452..f6c33a9 100644
--- a/engines/titanic/game/music_console_button.h
+++ b/engines/titanic/game/music_console_button.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CMusicConsoleButton : public CMusicPlayer {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMusicConsoleButton"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/music_room_phonograph.h b/engines/titanic/game/music_room_phonograph.h
index 2d34b16..6660503 100644
--- a/engines/titanic/game/music_room_phonograph.h
+++ b/engines/titanic/game/music_room_phonograph.h
@@ -31,14 +31,10 @@ class CMusicRoomPhonograph : public CRestaurantPhonograph {
 private:
 	int _field118;
 public:
+	CLASSDEF
 	CMusicRoomPhonograph() : CRestaurantPhonograph(), _field118(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMusicRoomPhonograph"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/music_room_stop_phonograph_button.h b/engines/titanic/game/music_room_stop_phonograph_button.h
index 4fd4aa6..c37065f 100644
--- a/engines/titanic/game/music_room_stop_phonograph_button.h
+++ b/engines/titanic/game/music_room_stop_phonograph_button.h
@@ -31,14 +31,10 @@ class CMusicRoomStopPhonographButton : public CEjectPhonographButton {
 private:
 	int _field100;
 public:
+	CLASSDEF
 	CMusicRoomStopPhonographButton() : CEjectPhonographButton(), _field100(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMusicRoomStopPhonographButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/music_system_lock.h b/engines/titanic/game/music_system_lock.h
index 98dc68b..b5f4da5 100644
--- a/engines/titanic/game/music_system_lock.h
+++ b/engines/titanic/game/music_system_lock.h
@@ -31,14 +31,10 @@ class CMusicSystemLock : public CDropTarget {
 private:
 	int _value;
 public:
+	CLASSDEF
 	CMusicSystemLock() : CDropTarget(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMusicSystemLock"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/musical_instrument.h b/engines/titanic/game/musical_instrument.h
index 8eafca5..b4abe4f 100644
--- a/engines/titanic/game/musical_instrument.h
+++ b/engines/titanic/game/musical_instrument.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CMusicalInstrument : public CBackground {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMusicalInstrument"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/nav_helmet.h b/engines/titanic/game/nav_helmet.h
index 31eee99..ff39280 100644
--- a/engines/titanic/game/nav_helmet.h
+++ b/engines/titanic/game/nav_helmet.h
@@ -31,14 +31,10 @@ class CNavHelmet : public CGameObject {
 private:
 	int _value;
 public:
+	CLASSDEF
 	CNavHelmet() : CGameObject(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNavHelmet"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/navigation_computer.h b/engines/titanic/game/navigation_computer.h
index 49e382a..a7077f7 100644
--- a/engines/titanic/game/navigation_computer.h
+++ b/engines/titanic/game/navigation_computer.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CNavigationComputer : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNavigationComputer"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/no_nut_bowl.h b/engines/titanic/game/no_nut_bowl.h
index 40e8fd1..7557491 100644
--- a/engines/titanic/game/no_nut_bowl.h
+++ b/engines/titanic/game/no_nut_bowl.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CNoNutBowl : public CBackground {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNoNutBowl"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/nose_holder.h b/engines/titanic/game/nose_holder.h
index 3512e62..e26c70f 100644
--- a/engines/titanic/game/nose_holder.h
+++ b/engines/titanic/game/nose_holder.h
@@ -32,14 +32,10 @@ private:
 	int _field118;
 	int _field11C;
 public:
+	CLASSDEF
 	CNoseHolder();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNoseHolder"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/null_port_hole.h b/engines/titanic/game/null_port_hole.h
index 2caff27..fb07462 100644
--- a/engines/titanic/game/null_port_hole.h
+++ b/engines/titanic/game/null_port_hole.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CNullPortHole : public CClickResponder {
 public:
+	CLASSDEF
 	CNullPortHole();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNullPortHole"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/nut_replacer.h b/engines/titanic/game/nut_replacer.h
index ef800c7..0917b40 100644
--- a/engines/titanic/game/nut_replacer.h
+++ b/engines/titanic/game/nut_replacer.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CNutReplacer : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNutReplacer"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/parrot/parrot_lobby_controller.h b/engines/titanic/game/parrot/parrot_lobby_controller.h
index 371e31e..6515a23 100644
--- a/engines/titanic/game/parrot/parrot_lobby_controller.h
+++ b/engines/titanic/game/parrot/parrot_lobby_controller.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CParrotLobbyController : public CParrotLobbyObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CParrotLobbyController"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/parrot/parrot_lobby_link_updater.h b/engines/titanic/game/parrot/parrot_lobby_link_updater.h
index d0843fe..2f3ce7b 100644
--- a/engines/titanic/game/parrot/parrot_lobby_link_updater.h
+++ b/engines/titanic/game/parrot/parrot_lobby_link_updater.h
@@ -31,14 +31,10 @@ class CParrotLobbyLinkUpdater : public CParrotLobbyObject {
 public:
 	int _fieldBC;
 public:
+	CLASSDEF
 	CParrotLobbyLinkUpdater() : CParrotLobbyObject(), _fieldBC(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CParrotLobbyLinkUpdater"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/parrot/parrot_lobby_object.h b/engines/titanic/game/parrot/parrot_lobby_object.h
index 85f2c3b..9cc979c 100644
--- a/engines/titanic/game/parrot/parrot_lobby_object.h
+++ b/engines/titanic/game/parrot/parrot_lobby_object.h
@@ -36,10 +36,7 @@ public:
 
 	static void init();
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CParrotLobbyObject"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/parrot/parrot_lobby_view_object.h b/engines/titanic/game/parrot/parrot_lobby_view_object.h
index 00f7bbc..1e3e398 100644
--- a/engines/titanic/game/parrot/parrot_lobby_view_object.h
+++ b/engines/titanic/game/parrot/parrot_lobby_view_object.h
@@ -31,14 +31,10 @@ class CParrotLobbyViewObject : public CParrotLobbyObject {
 public:
 	int _fieldBC;
 public:
+	CLASSDEF
 	CParrotLobbyViewObject() : CParrotLobbyObject(), _fieldBC(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CParrotLobbyViewObject"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/parrot/parrot_loser.h b/engines/titanic/game/parrot/parrot_loser.h
index dac253e..806195d 100644
--- a/engines/titanic/game/parrot/parrot_loser.h
+++ b/engines/titanic/game/parrot/parrot_loser.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CParrotLoser : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CParrotLoser"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/parrot/parrot_nut_bowl_actor.h b/engines/titanic/game/parrot/parrot_nut_bowl_actor.h
index 623918c..d1ccca6 100644
--- a/engines/titanic/game/parrot/parrot_nut_bowl_actor.h
+++ b/engines/titanic/game/parrot/parrot_nut_bowl_actor.h
@@ -31,14 +31,10 @@ class CParrotNutBowlActor : public CGameObject {
 public:
 	int _value1, _value2;
 public:
+	CLASSDEF
 	CParrotNutBowlActor();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CParrotNutBowlActor"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/parrot/parrot_nut_eater.h b/engines/titanic/game/parrot/parrot_nut_eater.h
index 55367af..6a7afd9 100644
--- a/engines/titanic/game/parrot/parrot_nut_eater.h
+++ b/engines/titanic/game/parrot/parrot_nut_eater.h
@@ -35,14 +35,10 @@ public:
 	int _fieldC8;
 	int _fieldCC;
 public:
+	CLASSDEF
 	CParrotNutEater();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CParrotNutEater"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/parrot/parrot_perch_holder.h b/engines/titanic/game/parrot/parrot_perch_holder.h
index 489e124..f355263 100644
--- a/engines/titanic/game/parrot/parrot_perch_holder.h
+++ b/engines/titanic/game/parrot/parrot_perch_holder.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CParrotPerchHolder : public CMultiDropTarget {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CParrotPerchHolder"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/parrot/parrot_succubus.h b/engines/titanic/game/parrot/parrot_succubus.h
index aad8a7f..e60d35c 100644
--- a/engines/titanic/game/parrot/parrot_succubus.h
+++ b/engines/titanic/game/parrot/parrot_succubus.h
@@ -35,14 +35,10 @@ public:
 	int _field1F0;
 	int _field1F4;
 public:
+	CLASSDEF
 	CParrotSuccUBus();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CParrotSuccUBus"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/parrot/parrot_trigger.h b/engines/titanic/game/parrot/parrot_trigger.h
index cb0d59c..33aea15 100644
--- a/engines/titanic/game/parrot/parrot_trigger.h
+++ b/engines/titanic/game/parrot/parrot_trigger.h
@@ -31,14 +31,10 @@ class CParrotTrigger : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CParrotTrigger() : CGameObject(), _value(0x446AB) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CParrotTrigger"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/parrot/player_meets_parrot.h b/engines/titanic/game/parrot/player_meets_parrot.h
index 685e67a..d0c3b9d 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.h
+++ b/engines/titanic/game/parrot/player_meets_parrot.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPlayerMeetsParrot : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPlayerMeetsParrot"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet.h b/engines/titanic/game/pet/pet.h
index 096c1de..58e3577 100644
--- a/engines/titanic/game/pet/pet.h
+++ b/engines/titanic/game/pet/pet.h
@@ -37,14 +37,10 @@ public:
 	int _fieldD8;
 	int _fieldDC;
 public:
+	CLASSDEF
 	CPET();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPET"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/pet/pet_class1.h b/engines/titanic/game/pet/pet_class1.h
index c390a87..12dfb32 100644
--- a/engines/titanic/game/pet/pet_class1.h
+++ b/engines/titanic/game/pet/pet_class1.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPETClass1 : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPETClass1"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_class2.h b/engines/titanic/game/pet/pet_class2.h
index cfa445e..5b96118 100644
--- a/engines/titanic/game/pet/pet_class2.h
+++ b/engines/titanic/game/pet/pet_class2.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPETClass2 : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPETClass2"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_class3.h b/engines/titanic/game/pet/pet_class3.h
index a41a4d5..d68cb09 100644
--- a/engines/titanic/game/pet/pet_class3.h
+++ b/engines/titanic/game/pet/pet_class3.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPETClass3 : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPETClass3"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_lift.h b/engines/titanic/game/pet/pet_lift.h
index 11207cd..1c56b05 100644
--- a/engines/titanic/game/pet/pet_lift.h
+++ b/engines/titanic/game/pet/pet_lift.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPETLift : public CPETTransport {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPETLift"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_monitor.h b/engines/titanic/game/pet/pet_monitor.h
index 544bbde..ff22098 100644
--- a/engines/titanic/game/pet/pet_monitor.h
+++ b/engines/titanic/game/pet/pet_monitor.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPETMonitor : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPETMonitor"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_pellerator.h b/engines/titanic/game/pet/pet_pellerator.h
index 7314f72..1036c93 100644
--- a/engines/titanic/game/pet/pet_pellerator.h
+++ b/engines/titanic/game/pet/pet_pellerator.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPETPellerator : public CPETTransport {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPETPellerator"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_position.h b/engines/titanic/game/pet/pet_position.h
index 6454b1e..407a42f 100644
--- a/engines/titanic/game/pet/pet_position.h
+++ b/engines/titanic/game/pet/pet_position.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPETPosition : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPETPosition"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_sentinal.h b/engines/titanic/game/pet/pet_sentinal.h
index 98f05df..728ddbf 100644
--- a/engines/titanic/game/pet/pet_sentinal.h
+++ b/engines/titanic/game/pet/pet_sentinal.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPETSentinal : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPETSentinal"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_sounds.h b/engines/titanic/game/pet/pet_sounds.h
index cae45ac..f099d9e 100644
--- a/engines/titanic/game/pet/pet_sounds.h
+++ b/engines/titanic/game/pet/pet_sounds.h
@@ -31,14 +31,10 @@ class CPETSounds : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CPETSounds() : CGameObject(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPETSounds"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/pet/pet_transition.h b/engines/titanic/game/pet/pet_transition.h
index 3ccb45f..c8dc153 100644
--- a/engines/titanic/game/pet/pet_transition.h
+++ b/engines/titanic/game/pet/pet_transition.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPETTransition : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPETTransition"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_transport.h b/engines/titanic/game/pet/pet_transport.h
index af821ef..1aa6df8 100644
--- a/engines/titanic/game/pet/pet_transport.h
+++ b/engines/titanic/game/pet/pet_transport.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPETTransport : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPETTransport"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet_disabler.h b/engines/titanic/game/pet_disabler.h
index 3e8c799..5db5d7b 100644
--- a/engines/titanic/game/pet_disabler.h
+++ b/engines/titanic/game/pet_disabler.h
@@ -31,14 +31,10 @@ class CPetDisabler : public CGameObject {
 public:
 	CString _value;
 public:
+	CLASSDEF
 	CPetDisabler() : CGameObject() {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPetDisabler"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/phonograph.h b/engines/titanic/game/phonograph.h
index e7fcddf..14712e5 100644
--- a/engines/titanic/game/phonograph.h
+++ b/engines/titanic/game/phonograph.h
@@ -37,14 +37,10 @@ protected:
 	int _fieldF0;
 	int _fieldF4;
 public:
+	CLASSDEF
 	CPhonograph();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPhonograph"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/phonograph_lid.h b/engines/titanic/game/phonograph_lid.h
index 2252551..38c8924 100644
--- a/engines/titanic/game/phonograph_lid.h
+++ b/engines/titanic/game/phonograph_lid.h
@@ -31,14 +31,10 @@ class CPhonographLid : public CGameObject {
 private:
 	int _value;
 public:
+	CLASSDEF
 	CPhonographLid() : CGameObject(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPhonographLid"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/pickup/pick_up.h b/engines/titanic/game/pickup/pick_up.h
index e1783ef..d5a8580 100644
--- a/engines/titanic/game/pickup/pick_up.h
+++ b/engines/titanic/game/pickup/pick_up.h
@@ -31,14 +31,10 @@ class CPickUp : public CGameObject {
 private:
 	int _fieldBC;
 public:
+	CLASSDEF
 	CPickUp() : CGameObject(), _fieldBC(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAnnoyBarbot"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/pickup/pick_up_bar_glass.h b/engines/titanic/game/pickup/pick_up_bar_glass.h
index 9bec56c..f1c7555 100644
--- a/engines/titanic/game/pickup/pick_up_bar_glass.h
+++ b/engines/titanic/game/pickup/pick_up_bar_glass.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPickUpBarGlass : public CPickUp {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPickUpBarGlass"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pickup/pick_up_hose.h b/engines/titanic/game/pickup/pick_up_hose.h
index 13d5810..9014934 100644
--- a/engines/titanic/game/pickup/pick_up_hose.h
+++ b/engines/titanic/game/pickup/pick_up_hose.h
@@ -33,10 +33,7 @@ private:
 
 	CString _string1;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPickUpHose"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pickup/pick_up_lemon.h b/engines/titanic/game/pickup/pick_up_lemon.h
index fee2485..dc2942f 100644
--- a/engines/titanic/game/pickup/pick_up_lemon.h
+++ b/engines/titanic/game/pickup/pick_up_lemon.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPickUpLemon : public CPickUp {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPickUpLemon"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pickup/pick_up_speech_centre.h b/engines/titanic/game/pickup/pick_up_speech_centre.h
index b68761b..5d7d133 100644
--- a/engines/titanic/game/pickup/pick_up_speech_centre.h
+++ b/engines/titanic/game/pickup/pick_up_speech_centre.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPickUpSpeechCentre : public CPickUp {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPickUpSpeechCentre"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pickup/pick_up_vis_centre.h b/engines/titanic/game/pickup/pick_up_vis_centre.h
index 16db8f2..4345fce 100644
--- a/engines/titanic/game/pickup/pick_up_vis_centre.h
+++ b/engines/titanic/game/pickup/pick_up_vis_centre.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPickUpVisCentre : public CPickUp {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPickUpVisCentre"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/placeholder/bar_shelf_vis_centre.h b/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
index 1cd3ca2..a2d39c3 100644
--- a/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
+++ b/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
@@ -31,12 +31,9 @@ class CBarShelfVisCentre : public CPlaceHolder {
 private:
 	int _value;
 public:
+	CLASSDEF
 	CBarShelfVisCentre() : CPlaceHolder(), _value(0) {}
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBarShelfVisCentre"; }
-
+	
 	/**
 	 * Save the data for the class to file
 	 */
diff --git a/engines/titanic/game/placeholder/lemon_on_bar.h b/engines/titanic/game/placeholder/lemon_on_bar.h
index d02f7a9..c88698f 100644
--- a/engines/titanic/game/placeholder/lemon_on_bar.h
+++ b/engines/titanic/game/placeholder/lemon_on_bar.h
@@ -31,10 +31,7 @@ class CLemonOnBar : public CPlaceHolder {
 private:
 	Common::Point _pos1;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLemonOnBar"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/placeholder/place_holder.h b/engines/titanic/game/placeholder/place_holder.h
index dd1c89d..4d01cd6 100644
--- a/engines/titanic/game/placeholder/place_holder.h
+++ b/engines/titanic/game/placeholder/place_holder.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPlaceHolder : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPlaceHolder"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/placeholder/tv_on_bar.h b/engines/titanic/game/placeholder/tv_on_bar.h
index 1583dad..3358cd6 100644
--- a/engines/titanic/game/placeholder/tv_on_bar.h
+++ b/engines/titanic/game/placeholder/tv_on_bar.h
@@ -31,10 +31,7 @@ class CTVOnBar : public CPlaceHolder {
 private:
 	Common::Point _pos1;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTVOnBar"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/play_music_button.h b/engines/titanic/game/play_music_button.h
index 29a13a6..9e0bb46 100644
--- a/engines/titanic/game/play_music_button.h
+++ b/engines/titanic/game/play_music_button.h
@@ -32,14 +32,10 @@ public:
 	int _fieldE0;
 	int _fieldE4;
 public:
+	CLASSDEF
 	CPlayMusicButton() : CBackground(), _fieldE0(0), _fieldE4(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPlayMusicButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/play_on_act.h b/engines/titanic/game/play_on_act.h
index b8fdb2a..22bb54d 100644
--- a/engines/titanic/game/play_on_act.h
+++ b/engines/titanic/game/play_on_act.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPlayOnAct : public CBackground {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPlayOnAct"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/port_hole.h b/engines/titanic/game/port_hole.h
index 60aab51..2672614 100644
--- a/engines/titanic/game/port_hole.h
+++ b/engines/titanic/game/port_hole.h
@@ -32,14 +32,10 @@ private:
 	int _fieldBC;
 	CString _string1, _string2;
 public:
+	CLASSDEF
 	CPortHole();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPortHole"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/record_phonograph_button.h b/engines/titanic/game/record_phonograph_button.h
index 4b2c6c8..3ae7fb1 100644
--- a/engines/titanic/game/record_phonograph_button.h
+++ b/engines/titanic/game/record_phonograph_button.h
@@ -31,14 +31,10 @@ class CRecordPhonographButton : public CBackground {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CRecordPhonographButton() : CBackground(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CRecordPhonographButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/replacement_ear.h b/engines/titanic/game/replacement_ear.h
index 9c4a8e1..0cff55d 100644
--- a/engines/titanic/game/replacement_ear.h
+++ b/engines/titanic/game/replacement_ear.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CReplacementEar : public CBackground {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNoNutBowl"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/reserved_table.h b/engines/titanic/game/reserved_table.h
index abf3a65..49cd5e8 100644
--- a/engines/titanic/game/reserved_table.h
+++ b/engines/titanic/game/reserved_table.h
@@ -31,14 +31,10 @@ class CReservedTable : public CGameObject {
 public:
 	int _value1, _value2;
 public:
+	CLASSDEF
 	CReservedTable() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CReservedTable"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/restaurant_cylinder_holder.h b/engines/titanic/game/restaurant_cylinder_holder.h
index 29e2958..9f3911d 100644
--- a/engines/titanic/game/restaurant_cylinder_holder.h
+++ b/engines/titanic/game/restaurant_cylinder_holder.h
@@ -37,14 +37,10 @@ private:
 	CString _string6;
 	int _field140;
 public:
+	CLASSDEF
 	CRestaurantCylinderHolder();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CRestaurantCylinderHolder"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/restaurant_phonograph.h b/engines/titanic/game/restaurant_phonograph.h
index 777ec34..40116f5 100644
--- a/engines/titanic/game/restaurant_phonograph.h
+++ b/engines/titanic/game/restaurant_phonograph.h
@@ -34,14 +34,10 @@ private:
 	CString _string3;
 	int _field114;
 public:
+	CLASSDEF
 	CRestaurantPhonograph();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CRestaurantPhonograph"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/room_item.h b/engines/titanic/game/room_item.h
index c213d38..7441ed0 100644
--- a/engines/titanic/game/room_item.h
+++ b/engines/titanic/game/room_item.h
@@ -42,14 +42,10 @@ private:
 
 	void loading();
 public:
+	CLASSDEF
 	CRoomItem();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CRoomItem"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/sauce_dispensor.h b/engines/titanic/game/sauce_dispensor.h
index fd9afd9..6969adb 100644
--- a/engines/titanic/game/sauce_dispensor.h
+++ b/engines/titanic/game/sauce_dispensor.h
@@ -37,14 +37,10 @@ public:
 	int _field104;
 	int _field108;
 public:
+	CLASSDEF
 	CSauceDispensor();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSauceDispensor"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/search_point.h b/engines/titanic/game/search_point.h
index 3908d87..7bd05d8 100644
--- a/engines/titanic/game/search_point.h
+++ b/engines/titanic/game/search_point.h
@@ -31,14 +31,10 @@ class CSearchPoint : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CSearchPoint() : CGameObject(), _value(2) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSearchPoint"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/season_background.h b/engines/titanic/game/season_background.h
index 2899853..709f100 100644
--- a/engines/titanic/game/season_background.h
+++ b/engines/titanic/game/season_background.h
@@ -34,14 +34,10 @@ public:
 	int _fieldE8;
 	int _fieldEC;
 public:
+	CLASSDEF
 	CSeasonBackground();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSeasonBackground"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/season_barrel.h b/engines/titanic/game/season_barrel.h
index af22c14..d3f7b1a 100644
--- a/engines/titanic/game/season_barrel.h
+++ b/engines/titanic/game/season_barrel.h
@@ -32,14 +32,10 @@ public:
 	int _fieldE0;
 	int _fieldE4;
 public:
+	CLASSDEF
 	CSeasonBarrel() : CBackground(), _fieldE0(0), _fieldE4(7) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSeasonBarrel"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/seasonal_adjustment.h b/engines/titanic/game/seasonal_adjustment.h
index 2db9403..4bfec1a 100644
--- a/engines/titanic/game/seasonal_adjustment.h
+++ b/engines/titanic/game/seasonal_adjustment.h
@@ -32,14 +32,10 @@ public:
 	int _fieldE0;
 	int _fieldE4;
 public:
+	CLASSDEF
 	CSeasonalAdjustment() : CBackground(), _fieldE0(0), _fieldE4(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSeasonalAdjustment"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/service_elevator_window.h b/engines/titanic/game/service_elevator_window.h
index 493776c..70c3875 100644
--- a/engines/titanic/game/service_elevator_window.h
+++ b/engines/titanic/game/service_elevator_window.h
@@ -34,14 +34,10 @@ public:
 	int _fieldE8;
 	int _fieldEC;
 public:
+	CLASSDEF
 	CServiceElevatorWindow();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CServiceElevatorWindow"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/sgt/armchair.h b/engines/titanic/game/sgt/armchair.h
index 2157c3c..1ce6955 100644
--- a/engines/titanic/game/sgt/armchair.h
+++ b/engines/titanic/game/sgt/armchair.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CArmchair : public CSGTStateRoom {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CArmchair"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/basin.h b/engines/titanic/game/sgt/basin.h
index 85aaf47..cc9739f 100644
--- a/engines/titanic/game/sgt/basin.h
+++ b/engines/titanic/game/sgt/basin.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CBasin : public CSGTStateRoom {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBasin"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/bedfoot.h b/engines/titanic/game/sgt/bedfoot.h
index 7794fc4..55be4fd 100644
--- a/engines/titanic/game/sgt/bedfoot.h
+++ b/engines/titanic/game/sgt/bedfoot.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CBedfoot : public CSGTStateRoom {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBedfoot"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/bedhead.h b/engines/titanic/game/sgt/bedhead.h
index 3669163..317b7eb 100644
--- a/engines/titanic/game/sgt/bedhead.h
+++ b/engines/titanic/game/sgt/bedhead.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CBedhead : public CSGTStateRoom {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBedhead"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/chest_of_drawers.h b/engines/titanic/game/sgt/chest_of_drawers.h
index 17f5cf9..e0bdd75 100644
--- a/engines/titanic/game/sgt/chest_of_drawers.h
+++ b/engines/titanic/game/sgt/chest_of_drawers.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CChestOfDrawers : public CSGTStateRoom {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CChestOfDrawers"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/desk.h b/engines/titanic/game/sgt/desk.h
index 4c89c04..7fbb65a 100644
--- a/engines/titanic/game/sgt/desk.h
+++ b/engines/titanic/game/sgt/desk.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CDesk : public CSGTStateRoom {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDesk"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/deskchair.h b/engines/titanic/game/sgt/deskchair.h
index 762b639..205209c 100644
--- a/engines/titanic/game/sgt/deskchair.h
+++ b/engines/titanic/game/sgt/deskchair.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CDeskchair : public CSGTStateRoom {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDeskchair"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/drawer.h b/engines/titanic/game/sgt/drawer.h
index 100e27c..8436e5c 100644
--- a/engines/titanic/game/sgt/drawer.h
+++ b/engines/titanic/game/sgt/drawer.h
@@ -31,14 +31,10 @@ class CDrawer : public CSGTStateRoom {
 private:
 	int _fieldF4;
 public:
+	CLASSDEF
 	CDrawer();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDrawer"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/sgt/sgt_doors.h b/engines/titanic/game/sgt/sgt_doors.h
index 9464049..9828708 100644
--- a/engines/titanic/game/sgt/sgt_doors.h
+++ b/engines/titanic/game/sgt/sgt_doors.h
@@ -31,14 +31,10 @@ class CSGTDoors : public CGameObject {
 public:
 	int _value1, _value2;
 public:
+	CLASSDEF
 	CSGTDoors() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSGTDoors"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/sgt/sgt_nav.h b/engines/titanic/game/sgt/sgt_nav.h
index 7f1912d..7d7f57f 100644
--- a/engines/titanic/game/sgt/sgt_nav.h
+++ b/engines/titanic/game/sgt/sgt_nav.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class SGTNav : public CSGTStateRoom {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "SGTNav"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/sgt_navigation.h b/engines/titanic/game/sgt/sgt_navigation.h
index 539a607..083efa8 100644
--- a/engines/titanic/game/sgt/sgt_navigation.h
+++ b/engines/titanic/game/sgt/sgt_navigation.h
@@ -37,15 +37,11 @@ class CSGTNavigation : public CGameObject {
 private:
 	static CSGTNavigationStatics *_statics;
 public:
+	CLASSDEF
 	static void init();
 	static void deinit();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSGTNavigation"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/sgt/sgt_restaurant_doors.h b/engines/titanic/game/sgt/sgt_restaurant_doors.h
index 904c0c6..14677ea 100644
--- a/engines/titanic/game/sgt/sgt_restaurant_doors.h
+++ b/engines/titanic/game/sgt/sgt_restaurant_doors.h
@@ -31,14 +31,10 @@ class CSGTRestaurantDoors : public CGameObject {
 private:
 	int _fieldBC;
 public:
+	CLASSDEF
 	CSGTRestaurantDoors() : CGameObject(), _fieldBC(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSGTRestaurantDoors"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/sgt/sgt_state_control.h b/engines/titanic/game/sgt/sgt_state_control.h
index b22095c..05d8fde 100644
--- a/engines/titanic/game/sgt/sgt_state_control.h
+++ b/engines/titanic/game/sgt/sgt_state_control.h
@@ -31,14 +31,10 @@ class CSGTStateControl : public CBackground {
 private:
 	int _fieldE0;
 public:
+	CLASSDEF
 	CSGTStateControl() : CBackground(), _fieldE0(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSGTStateControl"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/sgt/sgt_state_room.h b/engines/titanic/game/sgt/sgt_state_room.h
index f67a916..dfac689 100644
--- a/engines/titanic/game/sgt/sgt_state_room.h
+++ b/engines/titanic/game/sgt/sgt_state_room.h
@@ -54,16 +54,12 @@ private:
 	int _fieldEC;
 	int _fieldF0;
 public:
+	CLASSDEF
 	CSGTStateRoom();
 	static void init();
 	static void deinit();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSGTStateRoom"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/sgt/sgt_tv.h b/engines/titanic/game/sgt/sgt_tv.h
index 79e7efd..347d2c7 100644
--- a/engines/titanic/game/sgt/sgt_tv.h
+++ b/engines/titanic/game/sgt/sgt_tv.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CSGTTV : public CSGTStateRoom {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSGTTV"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/sgt_upper_doors_sound.h b/engines/titanic/game/sgt/sgt_upper_doors_sound.h
index ed97627..cd62aa5 100644
--- a/engines/titanic/game/sgt/sgt_upper_doors_sound.h
+++ b/engines/titanic/game/sgt/sgt_upper_doors_sound.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CSGTUpperDoorsSound : public CClickResponder {
 public:
+	CLASSDEF
 	CSGTUpperDoorsSound();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSGTUpperDoorsSound"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/sgt/toilet.h b/engines/titanic/game/sgt/toilet.h
index a5265e7..0892651 100644
--- a/engines/titanic/game/sgt/toilet.h
+++ b/engines/titanic/game/sgt/toilet.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CToilet : public CSGTStateRoom {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CToilet"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/vase.h b/engines/titanic/game/sgt/vase.h
index 37a5818..1b2a89f 100644
--- a/engines/titanic/game/sgt/vase.h
+++ b/engines/titanic/game/sgt/vase.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CVase : public CSGTStateRoom {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CVase"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/washstand.h b/engines/titanic/game/sgt/washstand.h
index 40eb5a4..975a4d5 100644
--- a/engines/titanic/game/sgt/washstand.h
+++ b/engines/titanic/game/sgt/washstand.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CWashstand : public CSGTStateRoom {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CWashstand"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/ship_setting.h b/engines/titanic/game/ship_setting.h
index 8e57e53..a3b5d5f 100644
--- a/engines/titanic/game/ship_setting.h
+++ b/engines/titanic/game/ship_setting.h
@@ -34,14 +34,10 @@ public:
 	CString _string4;
 	CString _string5;
 public:
+	CLASSDEF
 	CShipSetting();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CShipSetting"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/ship_setting_button.h b/engines/titanic/game/ship_setting_button.h
index fb8d533..e6a6822 100644
--- a/engines/titanic/game/ship_setting_button.h
+++ b/engines/titanic/game/ship_setting_button.h
@@ -33,14 +33,10 @@ private:
 	int _fieldC8;
 	int _fieldCC;
 public:
+	CLASSDEF
 	CShipSettingButton();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CShipSettingButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/show_cell_points.h b/engines/titanic/game/show_cell_points.h
index c807cd5..a3d7ba2 100644
--- a/engines/titanic/game/show_cell_points.h
+++ b/engines/titanic/game/show_cell_points.h
@@ -32,14 +32,10 @@ public:
 	CString _strValue;
 	int _numValue;
 public:
+	CLASSDEF
 	CShowCellpoints() : CGameObject(), _numValue(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CShowCellpoints"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/speech_dispensor.h b/engines/titanic/game/speech_dispensor.h
index 19f31fc..440746e 100644
--- a/engines/titanic/game/speech_dispensor.h
+++ b/engines/titanic/game/speech_dispensor.h
@@ -38,10 +38,7 @@ private:
 	int _fieldF8;
 	int _fieldFC;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSpeechDispensor"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/splash_animation.h b/engines/titanic/game/splash_animation.h
index 8ac59d9..2f40562 100644
--- a/engines/titanic/game/splash_animation.h
+++ b/engines/titanic/game/splash_animation.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CSplashAnimation : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSplashAnimation"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/starling_puret.h b/engines/titanic/game/starling_puret.h
index 5bfdd66..7299c68 100644
--- a/engines/titanic/game/starling_puret.h
+++ b/engines/titanic/game/starling_puret.h
@@ -31,14 +31,10 @@ class CStarlingPuret : public CGameObject {
 private:
 	int _value;
 public:
+	CLASSDEF
 	CStarlingPuret() : CGameObject(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CStarlingPuret"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/start_action.h b/engines/titanic/game/start_action.h
index 3725dbc..fc7a2ea 100644
--- a/engines/titanic/game/start_action.h
+++ b/engines/titanic/game/start_action.h
@@ -32,14 +32,10 @@ protected:
 	CString _string3;
 	CString _string4;
 public:
+	CLASSDEF
 	CStartAction();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CStartAction"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/stop_phonograph_button.h b/engines/titanic/game/stop_phonograph_button.h
index 945345c..b1accfe 100644
--- a/engines/titanic/game/stop_phonograph_button.h
+++ b/engines/titanic/game/stop_phonograph_button.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CStopPhonographButton : public CBackground {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CStopPhonographButton"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sub_glass.h b/engines/titanic/game/sub_glass.h
index 00ff26f..b7ba513 100644
--- a/engines/titanic/game/sub_glass.h
+++ b/engines/titanic/game/sub_glass.h
@@ -36,14 +36,10 @@ private:
 	int _fieldCC;
 	CString _string;
 public:
+	CLASSDEF
 	CSUBGlass();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSUBGlass"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/sub_wrapper.h b/engines/titanic/game/sub_wrapper.h
index b67d4e5..6b724f8 100644
--- a/engines/titanic/game/sub_wrapper.h
+++ b/engines/titanic/game/sub_wrapper.h
@@ -31,14 +31,10 @@ class CSUBWrapper : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CSUBWrapper() : CGameObject(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSUBWrapper"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/sweet_bowl.h b/engines/titanic/game/sweet_bowl.h
index 8fb20e4..fa607bb 100644
--- a/engines/titanic/game/sweet_bowl.h
+++ b/engines/titanic/game/sweet_bowl.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CSweetBowl : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSweetBowl"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
index 4f39d60..d64c253 100644
--- a/engines/titanic/game/television.h
+++ b/engines/titanic/game/television.h
@@ -42,14 +42,10 @@ private:
 	int _fieldEC;
 	int _fieldF0;
 public:
+	CLASSDEF
 	CTelevision();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTelevision"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/third_class_canal.h b/engines/titanic/game/third_class_canal.h
index 4465cba..7a2c3d4 100644
--- a/engines/titanic/game/third_class_canal.h
+++ b/engines/titanic/game/third_class_canal.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CThirdClassCanal : public CBackground {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CThirdClassCanal"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/throw_tv_down_well.h b/engines/titanic/game/throw_tv_down_well.h
index 0f8f731..dee1450 100644
--- a/engines/titanic/game/throw_tv_down_well.h
+++ b/engines/titanic/game/throw_tv_down_well.h
@@ -32,14 +32,10 @@ public:
 	CString _strValue;
 	int _numValue;
 public:
+	CLASSDEF
 	CThrowTVDownWell() : CGameObject(), _numValue(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CThrowTVDownWell"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/titania_still_control.h b/engines/titanic/game/titania_still_control.h
index 141f0c5..a0f739d 100644
--- a/engines/titanic/game/titania_still_control.h
+++ b/engines/titanic/game/titania_still_control.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CTitaniaStillControl : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTitaniaStillControl"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/tow_parrot_nav.h b/engines/titanic/game/tow_parrot_nav.h
index 6233728..420c29b 100644
--- a/engines/titanic/game/tow_parrot_nav.h
+++ b/engines/titanic/game/tow_parrot_nav.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CTOWParrotNav : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTOWParrotNav"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/transport/exit_pellerator.h b/engines/titanic/game/transport/exit_pellerator.h
index d327ea6..e72cbb4 100644
--- a/engines/titanic/game/transport/exit_pellerator.h
+++ b/engines/titanic/game/transport/exit_pellerator.h
@@ -32,10 +32,7 @@ private:
 	static int _v1;
 	static int _v2;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPellerator"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/transport/gondolier.h b/engines/titanic/game/transport/gondolier.h
index 1d874be..bdfb3e7 100644
--- a/engines/titanic/game/transport/gondolier.h
+++ b/engines/titanic/game/transport/gondolier.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CGondolier : public CTransport {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGondolier"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h
index acb5fde..b1cd489 100644
--- a/engines/titanic/game/transport/lift.h
+++ b/engines/titanic/game/transport/lift.h
@@ -38,14 +38,10 @@ private:
 
 	int _fieldF8;
 public:
+	CLASSDEF
 	CLift() : CTransport(), _fieldF8(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLift"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/transport/lift_indicator.h b/engines/titanic/game/transport/lift_indicator.h
index bbd6cb2..2fe6e1a 100644
--- a/engines/titanic/game/transport/lift_indicator.h
+++ b/engines/titanic/game/transport/lift_indicator.h
@@ -34,14 +34,10 @@ private:
 	int _field108;
 	int _field10C;
 public:
+	CLASSDEF
 	CLiftindicator();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLiftindicator"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/transport/pellerator.h b/engines/titanic/game/transport/pellerator.h
index d327ea6..e72cbb4 100644
--- a/engines/titanic/game/transport/pellerator.h
+++ b/engines/titanic/game/transport/pellerator.h
@@ -32,10 +32,7 @@ private:
 	static int _v1;
 	static int _v2;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPellerator"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/transport/service_elevator.h b/engines/titanic/game/transport/service_elevator.h
index f97e3bc..9edc1f9 100644
--- a/engines/titanic/game/transport/service_elevator.h
+++ b/engines/titanic/game/transport/service_elevator.h
@@ -38,14 +38,10 @@ private:
 	int _field100;
 	int _field104;
 public:
+	CLASSDEF
 	CServiceElevator();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CServiceElevator"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/transport/transport.h b/engines/titanic/game/transport/transport.h
index 6e3f1a2..faa00b4 100644
--- a/engines/titanic/game/transport/transport.h
+++ b/engines/titanic/game/transport/transport.h
@@ -32,14 +32,10 @@ public:
 	CString _string1;
 	CString _string2;
 public:
+	CLASSDEF
 	CTransport();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTransport"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/up_lighter.h b/engines/titanic/game/up_lighter.h
index e7c6cdf..e24e712 100644
--- a/engines/titanic/game/up_lighter.h
+++ b/engines/titanic/game/up_lighter.h
@@ -34,14 +34,10 @@ private:
 	int _field120;
 	int _field124;
 public:
+	CLASSDEF
 	CUpLighter();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CUpLighter"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/useless_lever.h b/engines/titanic/game/useless_lever.h
index 444df0c..f582bde 100644
--- a/engines/titanic/game/useless_lever.h
+++ b/engines/titanic/game/useless_lever.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CUselessLever : public CToggleButton {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CUselessLever"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/wheel_button.h b/engines/titanic/game/wheel_button.h
index b1721eb..75e1268 100644
--- a/engines/titanic/game/wheel_button.h
+++ b/engines/titanic/game/wheel_button.h
@@ -33,14 +33,10 @@ public:
 	int _fieldE4;
 	int _fieldE8;
 public:
+	CLASSDEF
 	CWheelButton();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CWheelButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/wheel_hotspot.h b/engines/titanic/game/wheel_hotspot.h
index 6887407..7164b88 100644
--- a/engines/titanic/game/wheel_hotspot.h
+++ b/engines/titanic/game/wheel_hotspot.h
@@ -32,14 +32,10 @@ public:
 	int _fieldE0;
 	int _fieldE4;
 public:
+	CLASSDEF
 	CWheelHotSpot() : CBackground(), _fieldE0(0), _fieldE4(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CWheelHotSpot"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/wheel_spin.h b/engines/titanic/game/wheel_spin.h
index 64006af..2e21da4 100644
--- a/engines/titanic/game/wheel_spin.h
+++ b/engines/titanic/game/wheel_spin.h
@@ -31,14 +31,10 @@ class CWheelSpin : public CBackground {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CWheelSpin() : CBackground(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CWheelSpin"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/game/wheel_spin_horn.h b/engines/titanic/game/wheel_spin_horn.h
index b96b20b..e4c0bd7 100644
--- a/engines/titanic/game/wheel_spin_horn.h
+++ b/engines/titanic/game/wheel_spin_horn.h
@@ -32,10 +32,7 @@ public:
 	CString _string1;
 	CString _string2;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CWheelSpinHorn"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/act_button.h b/engines/titanic/gfx/act_button.h
index 0ae2d4d..b8f8f21 100644
--- a/engines/titanic/gfx/act_button.h
+++ b/engines/titanic/gfx/act_button.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CActButton : public CSTButton {
 public:
+	CLASSDEF
 	CActButton();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CActButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/changes_season_button.h b/engines/titanic/gfx/changes_season_button.h
index 8a75634..f39cfdc 100644
--- a/engines/titanic/gfx/changes_season_button.h
+++ b/engines/titanic/gfx/changes_season_button.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CChangesSeasonButton : public CSTButton {
 public:
+	CLASSDEF
 	CChangesSeasonButton();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CChangesSeasonButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/chev_left_off.h b/engines/titanic/gfx/chev_left_off.h
index c3ea05d..753aba3 100644
--- a/engines/titanic/gfx/chev_left_off.h
+++ b/engines/titanic/gfx/chev_left_off.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CChevLeftOff : public CToggleSwitch {
 public:
+	CLASSDEF
 	CChevLeftOff();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CChevLeftOff"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/chev_left_on.h b/engines/titanic/gfx/chev_left_on.h
index c2f23c3..99126d7 100644
--- a/engines/titanic/gfx/chev_left_on.h
+++ b/engines/titanic/gfx/chev_left_on.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CChevLeftOn : public CToggleSwitch {
 public:
+	CLASSDEF
 	CChevLeftOn();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CChevLeftOn"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/chev_right_off.h b/engines/titanic/gfx/chev_right_off.h
index da28759..1a31007 100644
--- a/engines/titanic/gfx/chev_right_off.h
+++ b/engines/titanic/gfx/chev_right_off.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CChevRightOff : public CToggleSwitch {
 public:
+	CLASSDEF
 	CChevRightOff();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CChevRightOff"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/chev_right_on.h b/engines/titanic/gfx/chev_right_on.h
index eb307c1..084b02e 100644
--- a/engines/titanic/gfx/chev_right_on.h
+++ b/engines/titanic/gfx/chev_right_on.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CChevRightOn : public CToggleSwitch {
 public:
+	CLASSDEF
 	CChevRightOn();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CChevRightOn"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/chev_send_rec_switch.h b/engines/titanic/gfx/chev_send_rec_switch.h
index 8cd06e6..29d6e7a 100644
--- a/engines/titanic/gfx/chev_send_rec_switch.h
+++ b/engines/titanic/gfx/chev_send_rec_switch.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CChevSendRecSwitch : public CToggleSwitch {
 public:
+	CLASSDEF
 	CChevSendRecSwitch();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSendRecSwitch"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/chev_switch.h b/engines/titanic/gfx/chev_switch.h
index e7b43c3..6c0314b 100644
--- a/engines/titanic/gfx/chev_switch.h
+++ b/engines/titanic/gfx/chev_switch.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CChevSwitch : public CToggleSwitch {
 public:
+	CLASSDEF
 	CChevSwitch();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CChevSwitch"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/edit_control.h b/engines/titanic/gfx/edit_control.h
index 79b20f7..d782b72 100644
--- a/engines/titanic/gfx/edit_control.h
+++ b/engines/titanic/gfx/edit_control.h
@@ -43,14 +43,10 @@ protected:
 	int _fieldF0;
 	int _fieldF4;
 public:
+	CLASSDEF
 	CEditControl();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEditControl"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/elevator_button.h b/engines/titanic/gfx/elevator_button.h
index 1090ea8..dddb707 100644
--- a/engines/titanic/gfx/elevator_button.h
+++ b/engines/titanic/gfx/elevator_button.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CElevatorButton : public CSTButton {
 public:
+	CLASSDEF
 	CElevatorButton();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CElevatorButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/get_from_succ.h b/engines/titanic/gfx/get_from_succ.h
index 810eb31..f0b028a 100644
--- a/engines/titanic/gfx/get_from_succ.h
+++ b/engines/titanic/gfx/get_from_succ.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CGetFromSucc : public CToggleSwitch {
 public:
+	CLASSDEF
 	CGetFromSucc();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGetFromSucc"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/helmet_on_off.h b/engines/titanic/gfx/helmet_on_off.h
index 839c2a5..41621f3 100644
--- a/engines/titanic/gfx/helmet_on_off.h
+++ b/engines/titanic/gfx/helmet_on_off.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CHelmetOnOff : public CToggleSwitch {
 public:
+	CLASSDEF
 	CHelmetOnOff();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CHelmetOnOff"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/home_photo.h b/engines/titanic/gfx/home_photo.h
index f8ad297..6e6f497 100644
--- a/engines/titanic/gfx/home_photo.h
+++ b/engines/titanic/gfx/home_photo.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CHomePhoto : public CToggleSwitch {
 public:
+	CLASSDEF
 	CHomePhoto();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CHomePhoto"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/icon_nav_action.h b/engines/titanic/gfx/icon_nav_action.h
index 812930b..cb8fae9 100644
--- a/engines/titanic/gfx/icon_nav_action.h
+++ b/engines/titanic/gfx/icon_nav_action.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CIconNavAction : public CToggleSwitch {
 public:
+	CLASSDEF
 	CIconNavAction();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CIconNavAction"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/icon_nav_butt.h b/engines/titanic/gfx/icon_nav_butt.h
index 018904e..36d3eb0 100644
--- a/engines/titanic/gfx/icon_nav_butt.h
+++ b/engines/titanic/gfx/icon_nav_butt.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CIconNavButt : public CPetGraphic {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CIconNavButt"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/icon_nav_down.h b/engines/titanic/gfx/icon_nav_down.h
index c6acfa0..b7759e0 100644
--- a/engines/titanic/gfx/icon_nav_down.h
+++ b/engines/titanic/gfx/icon_nav_down.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CIconNavDown : public CToggleSwitch {
 public:
+	CLASSDEF
 	CIconNavDown();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CIconNavDown"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/icon_nav_image.h b/engines/titanic/gfx/icon_nav_image.h
index 403936d..61febfd 100644
--- a/engines/titanic/gfx/icon_nav_image.h
+++ b/engines/titanic/gfx/icon_nav_image.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CIconNavImage : public CPetGraphic {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CIconNavImage"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/icon_nav_left.h b/engines/titanic/gfx/icon_nav_left.h
index 006056b..e507d2c 100644
--- a/engines/titanic/gfx/icon_nav_left.h
+++ b/engines/titanic/gfx/icon_nav_left.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CIconNavLeft : public CToggleSwitch {
 public:
+	CLASSDEF
 	CIconNavLeft();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CIconNavLeft"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/icon_nav_receive.h b/engines/titanic/gfx/icon_nav_receive.h
index b158fda..cce1df2 100644
--- a/engines/titanic/gfx/icon_nav_receive.h
+++ b/engines/titanic/gfx/icon_nav_receive.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CIconNavReceive : public CPetGraphic {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CIconNavReceive"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/icon_nav_right.h b/engines/titanic/gfx/icon_nav_right.h
index 9f319d1..db3bab4 100644
--- a/engines/titanic/gfx/icon_nav_right.h
+++ b/engines/titanic/gfx/icon_nav_right.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CIconNavRight : public CToggleSwitch {
 public:
+	CLASSDEF
 	CIconNavRight();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CIconNavRight"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/icon_nav_send.h b/engines/titanic/gfx/icon_nav_send.h
index 59cb670..1ffb8e9 100644
--- a/engines/titanic/gfx/icon_nav_send.h
+++ b/engines/titanic/gfx/icon_nav_send.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CIconNavSend : public CPetGraphic {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CIconNavSend"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/icon_nav_up.h b/engines/titanic/gfx/icon_nav_up.h
index 010b609..7eeeb77 100644
--- a/engines/titanic/gfx/icon_nav_up.h
+++ b/engines/titanic/gfx/icon_nav_up.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CIconNavUp : public CToggleSwitch {
 public:
+	CLASSDEF
 	CIconNavUp();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CIconNavUp"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/keybrd_butt.h b/engines/titanic/gfx/keybrd_butt.h
index 52fff77..a4f233b 100644
--- a/engines/titanic/gfx/keybrd_butt.h
+++ b/engines/titanic/gfx/keybrd_butt.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CKeybrdButt : public CToggleSwitch {
 public:
+	CLASSDEF
 	CKeybrdButt();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CKeybrdButt"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/move_object_button.h b/engines/titanic/gfx/move_object_button.h
index b00ba7b..70df8f6 100644
--- a/engines/titanic/gfx/move_object_button.h
+++ b/engines/titanic/gfx/move_object_button.h
@@ -32,14 +32,10 @@ private:
 	Common::Point _pos1;
 	int _field11C;
 public:
+	CLASSDEF
 	CMoveObjectButton();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMoveObjectButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/music_control.h b/engines/titanic/gfx/music_control.h
index a6063f4..97a0077 100644
--- a/engines/titanic/gfx/music_control.h
+++ b/engines/titanic/gfx/music_control.h
@@ -34,14 +34,10 @@ public:
 	int _fieldE8;
 	int _fieldEC;
 public:
+	CLASSDEF
 	CMusicControl();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMusicControl"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/music_slider.h b/engines/titanic/gfx/music_slider.h
index 9116986..3fd0ab3 100644
--- a/engines/titanic/gfx/music_slider.h
+++ b/engines/titanic/gfx/music_slider.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CMusicSlider : public CMusicControl {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMusicSlider"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/music_slider_pitch.h b/engines/titanic/gfx/music_slider_pitch.h
index ba2514b..f50958b 100644
--- a/engines/titanic/gfx/music_slider_pitch.h
+++ b/engines/titanic/gfx/music_slider_pitch.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CMusicSliderPitch : public CMusicSlider {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMusicSliderPitch"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/music_slider_speed.h b/engines/titanic/gfx/music_slider_speed.h
index fb3e7e1..8ed1862 100644
--- a/engines/titanic/gfx/music_slider_speed.h
+++ b/engines/titanic/gfx/music_slider_speed.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 	class CMusicSliderSpeed : public CMusicSlider {
 	public:
-		/**
-		* Return the class name
-		*/
-		virtual const char *getClassName() const { return "CMusicSliderSpeed"; }
+		CLASSDEF
 
 		/**
 		* Save the data for the class to file
diff --git a/engines/titanic/gfx/music_switch.h b/engines/titanic/gfx/music_switch.h
index 0f277c5..534eb25 100644
--- a/engines/titanic/gfx/music_switch.h
+++ b/engines/titanic/gfx/music_switch.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CMusicSwitch : public CMusicControl {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMusicSwitch"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/music_switch_inversion.h b/engines/titanic/gfx/music_switch_inversion.h
index 2356248..6aea692 100644
--- a/engines/titanic/gfx/music_switch_inversion.h
+++ b/engines/titanic/gfx/music_switch_inversion.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CMusicSwitchInversion : public CMusicSwitch {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMusicSwitchInversion"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/music_switch_reverse.h b/engines/titanic/gfx/music_switch_reverse.h
index 5467ede..99460f1 100644
--- a/engines/titanic/gfx/music_switch_reverse.h
+++ b/engines/titanic/gfx/music_switch_reverse.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 	class CMusicSwitchReverse : public CMusicSwitch {
 	public:
-		/**
-		 * Return the class name
-		 */
-		virtual const char *getClassName() const { return "CMusicSwitchReverse"; }
+		CLASSDEF
 
 		/**
 		 * Save the data for the class to file
diff --git a/engines/titanic/gfx/music_voice_mute.h b/engines/titanic/gfx/music_voice_mute.h
index 2a2acde..2198b96 100644
--- a/engines/titanic/gfx/music_voice_mute.h
+++ b/engines/titanic/gfx/music_voice_mute.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CMusicVoiceMute : public CMusicControl {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMusicVoiceMute"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/pet_drag_chev.h b/engines/titanic/gfx/pet_drag_chev.h
index 72f83dd..e82afd0 100644
--- a/engines/titanic/gfx/pet_drag_chev.h
+++ b/engines/titanic/gfx/pet_drag_chev.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPetDragChev : public CPetGraphic2 {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPetDragChev"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/pet_graphic.h b/engines/titanic/gfx/pet_graphic.h
index 28b5d9a..112d75a 100644
--- a/engines/titanic/gfx/pet_graphic.h
+++ b/engines/titanic/gfx/pet_graphic.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPetGraphic : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPetGraphic"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/pet_graphic2.h b/engines/titanic/gfx/pet_graphic2.h
index aabf058..d9bb514 100644
--- a/engines/titanic/gfx/pet_graphic2.h
+++ b/engines/titanic/gfx/pet_graphic2.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPetGraphic2 : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CNutReplacer"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/pet_leaf.h b/engines/titanic/gfx/pet_leaf.h
index 95fe1e6..0733749 100644
--- a/engines/titanic/gfx/pet_leaf.h
+++ b/engines/titanic/gfx/pet_leaf.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class PETLeaf : public CGameObject {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "PETLeaf"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/pet_mode_off.h b/engines/titanic/gfx/pet_mode_off.h
index 45b1010..ea88255 100644
--- a/engines/titanic/gfx/pet_mode_off.h
+++ b/engines/titanic/gfx/pet_mode_off.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CPetModeOff : public CToggleSwitch {
 public:
+	CLASSDEF
 	CPetModeOff();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPetModeOff"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/pet_mode_on.h b/engines/titanic/gfx/pet_mode_on.h
index 8ebfd8d..1434fb2 100644
--- a/engines/titanic/gfx/pet_mode_on.h
+++ b/engines/titanic/gfx/pet_mode_on.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CPetModeOn : public CToggleSwitch {
 public:
+	CLASSDEF
 	CPetModeOn();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPetModeOn"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/pet_mode_panel.h b/engines/titanic/gfx/pet_mode_panel.h
index 3a394df..ef68ca8 100644
--- a/engines/titanic/gfx/pet_mode_panel.h
+++ b/engines/titanic/gfx/pet_mode_panel.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CPetModePanel : public CToggleSwitch {
 public:
+	CLASSDEF
 	CPetModePanel();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPetModePanel"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/pet_pannel1.h b/engines/titanic/gfx/pet_pannel1.h
index 3d9b406..9261af9 100644
--- a/engines/titanic/gfx/pet_pannel1.h
+++ b/engines/titanic/gfx/pet_pannel1.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPetPannel1 : public CPetGraphic {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPetPannel1"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/pet_pannel2.h b/engines/titanic/gfx/pet_pannel2.h
index 6fdad87..561c0d7 100644
--- a/engines/titanic/gfx/pet_pannel2.h
+++ b/engines/titanic/gfx/pet_pannel2.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPetPannel2 : public CPetGraphic {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPetPannel2"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/pet_pannel3.h b/engines/titanic/gfx/pet_pannel3.h
index 521d517..5908184 100644
--- a/engines/titanic/gfx/pet_pannel3.h
+++ b/engines/titanic/gfx/pet_pannel3.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CPetPannel3 : public CPetGraphic {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPetPannel3"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/send_to_succ.h b/engines/titanic/gfx/send_to_succ.h
index 971c2e7..fb237f2 100644
--- a/engines/titanic/gfx/send_to_succ.h
+++ b/engines/titanic/gfx/send_to_succ.h
@@ -29,13 +29,9 @@ namespace Titanic {
 
 class CSendToSucc : public CToggleSwitch {
 public:
+	CLASSDEF
 	CSendToSucc();
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSendToSucc"; }
-
+	
 	/**
 	 * Save the data for the class to file
 	 */
diff --git a/engines/titanic/gfx/sgt_selector.h b/engines/titanic/gfx/sgt_selector.h
index 9283288..678ee77 100644
--- a/engines/titanic/gfx/sgt_selector.h
+++ b/engines/titanic/gfx/sgt_selector.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CSGTSelector : public CPetGraphic {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSGTSelector"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/slider_button.h b/engines/titanic/gfx/slider_button.h
index e39a5f8..afb96db 100644
--- a/engines/titanic/gfx/slider_button.h
+++ b/engines/titanic/gfx/slider_button.h
@@ -34,14 +34,10 @@ private:
 	int _field11C;
 	Common::Point _pos1;
 public:
+	CLASSDEF
 	CSliderButton();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSliderButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/small_chev_left_off.h b/engines/titanic/gfx/small_chev_left_off.h
index bf73c74..fc500ce 100644
--- a/engines/titanic/gfx/small_chev_left_off.h
+++ b/engines/titanic/gfx/small_chev_left_off.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CSmallChevLeftOff : public CToggleSwitch {
 public:
+	CLASSDEF
 	CSmallChevLeftOff();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSmallChevLeftOff"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/small_chev_left_on.h b/engines/titanic/gfx/small_chev_left_on.h
index c98108b..8ab9417 100644
--- a/engines/titanic/gfx/small_chev_left_on.h
+++ b/engines/titanic/gfx/small_chev_left_on.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CSmallChevLeftOn : public CToggleSwitch {
 public:
+	CLASSDEF
 	CSmallChevLeftOn();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSmallChevLeftOn"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/small_chev_right_off.h b/engines/titanic/gfx/small_chev_right_off.h
index 5a6f3cc..fae9c3c 100644
--- a/engines/titanic/gfx/small_chev_right_off.h
+++ b/engines/titanic/gfx/small_chev_right_off.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CSmallChevRightOff : public CToggleSwitch {
 public:
+	CLASSDEF
 	CSmallChevRightOff();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSmallChevRightOff"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/small_chev_right_on.h b/engines/titanic/gfx/small_chev_right_on.h
index f010010..c5cb4d7 100644
--- a/engines/titanic/gfx/small_chev_right_on.h
+++ b/engines/titanic/gfx/small_chev_right_on.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CSmallChevRightOn : public CToggleSwitch {
 public:
+	CLASSDEF
 	CSmallChevRightOn();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSmallChevRightOn"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/st_button.h b/engines/titanic/gfx/st_button.h
index 39b3765..e63d1c8 100644
--- a/engines/titanic/gfx/st_button.h
+++ b/engines/titanic/gfx/st_button.h
@@ -37,14 +37,10 @@ private:
 	CString _string5;
 	int _field110;
 public:
+	CLASSDEF
 	CSTButton();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSTButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/status_change_button.h b/engines/titanic/gfx/status_change_button.h
index b3b4125..be0d998 100644
--- a/engines/titanic/gfx/status_change_button.h
+++ b/engines/titanic/gfx/status_change_button.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CStatusChangeButton : public CSTButton {
 public:
+	CLASSDEF
 	CStatusChangeButton();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CStatusChangeButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/text_down.h b/engines/titanic/gfx/text_down.h
index 8fc16d8..6fc55bb 100644
--- a/engines/titanic/gfx/text_down.h
+++ b/engines/titanic/gfx/text_down.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CTextDown : public CPetGraphic {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTextDown"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/text_skrew.h b/engines/titanic/gfx/text_skrew.h
index 88a6a9a..6d7e714 100644
--- a/engines/titanic/gfx/text_skrew.h
+++ b/engines/titanic/gfx/text_skrew.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CTextSkrew : public CPetGraphic {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTextSkrew"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/text_up.h b/engines/titanic/gfx/text_up.h
index cce4c6c..328aeee 100644
--- a/engines/titanic/gfx/text_up.h
+++ b/engines/titanic/gfx/text_up.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CTextUp : public CPetGraphic {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTextUp"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/toggle_button.h b/engines/titanic/gfx/toggle_button.h
index b5113d7..a98a94d 100644
--- a/engines/titanic/gfx/toggle_button.h
+++ b/engines/titanic/gfx/toggle_button.h
@@ -31,14 +31,10 @@ class CToggleButton : public CBackground {
 private:
 	int _fieldE0;
 public:
+	CLASSDEF
 	CToggleButton() : CBackground(), _fieldE0(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CToggleButton"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/toggle_switch.h b/engines/titanic/gfx/toggle_switch.h
index 977661d..9b4fc42 100644
--- a/engines/titanic/gfx/toggle_switch.h
+++ b/engines/titanic/gfx/toggle_switch.h
@@ -32,14 +32,10 @@ private:
 	int _fieldBC;
 	Common::Point _pos1;
 public:
+	CLASSDEF
 	CToggleSwitch();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CToggleSwitch"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/gfx/volume_control.h b/engines/titanic/gfx/volume_control.h
index 5ff5c73..7778bb8 100644
--- a/engines/titanic/gfx/volume_control.h
+++ b/engines/titanic/gfx/volume_control.h
@@ -33,14 +33,10 @@ private:
 	CString _string1;
 	int _fieldCC;
 public:
+	CLASSDEF
 	CVolumeControl();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CVolumeControl"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/messages/auto_sound_event.h b/engines/titanic/messages/auto_sound_event.h
index cb5bfee..03baba3 100644
--- a/engines/titanic/messages/auto_sound_event.h
+++ b/engines/titanic/messages/auto_sound_event.h
@@ -32,14 +32,10 @@ public:
 	int _value1;
 	int _value2;
 public:
+	CLASSDEF
 	CAutoSoundEvent();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoSoundEvent"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/messages/bilge_auto_sound_event.h b/engines/titanic/messages/bilge_auto_sound_event.h
index 94f38d3..e51f74b 100644
--- a/engines/titanic/messages/bilge_auto_sound_event.h
+++ b/engines/titanic/messages/bilge_auto_sound_event.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CBilgeAutoSoundEvent : public CAutoSoundEvent {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBilgeAutoSoundEvent"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/messages/bilge_dispensor_event.h b/engines/titanic/messages/bilge_dispensor_event.h
index 8308d47..fb88a6b 100644
--- a/engines/titanic/messages/bilge_dispensor_event.h
+++ b/engines/titanic/messages/bilge_dispensor_event.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CBilgeDispensorEvent : public CAutoSoundEvent {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBilgeDispensorEvent"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/messages/door_auto_sound_event.h b/engines/titanic/messages/door_auto_sound_event.h
index 7eb1d04..cccc3ff 100644
--- a/engines/titanic/messages/door_auto_sound_event.h
+++ b/engines/titanic/messages/door_auto_sound_event.h
@@ -34,16 +34,12 @@ public:
 	int _fieldDC;
 	int _fieldE0;
 public:
+	CLASSDEF
 	CDoorAutoSoundEvent() : CAutoSoundEvent(),
 		_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
 	}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDoorAutoSoundEvent"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 6b6695d..c11d688 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -30,14 +30,10 @@ namespace Titanic {
 
 class CMessage : public CSaveableObject {
 public:
+	CLASSDEF
 	CMessage();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMessage"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
@@ -57,13 +53,9 @@ private:
 	int _field1C;
 	int _field20;
 public:
+	CLASSDEF
 	CEditControlMsg() : _field4(0), _field8(0), _field18(0),
 		_field1C(0), _field20(0) {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEditControlMsg"; }
 };
 
 class CLightsMsg : public CMessage {
@@ -73,13 +65,9 @@ public:
 	int _fieldC;
 	int _field10;
 public:
+	CLASSDEF
 	CLightsMsg() : CMessage(), _field4(0), _field8(0),
 		_fieldC(0), _field10(0) {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLightsMsg"; }
 };
 
 class CIsHookedOnMsg : public CMessage {
@@ -91,27 +79,18 @@ private:
 	int _field1C;
 	int _field20;
 public:
+	CLASSDEF
 	CIsHookedOnMsg() : CMessage(), _field4(0), _field8(0),
 		_field18(0), _field1C(0), _field20(0) {}
-
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CIsHookedOnMsg"; }
 };
 
-
 class CSubAcceptCCarryMsg : public CMessage {
 public:
 	CString _string1;
 	int _value1, _value2, _value3;
 public:
+	CLASSDEF
 	CSubAcceptCCarryMsg() : _value1(0), _value2(0), _value3(0) {}
-
-	/**
-	* Return the class name
-	*/
-	virtual const char *getClassName() const { return "CSubAcceptCCarryMsg"; }
 };
 
 class CTransportMsg : public CMessage {
@@ -119,216 +98,187 @@ public:
 	CString _string;
 	int _value1, _value2;
 public:
+	CLASSDEF
 	CTransportMsg() : _value1(0), _value2(0) {}
-
-	/**
-	* Return the class name
-	*/
-	virtual const char *getClassName() const { return "CTransportMsg"; }
 };
 
-#define RAW_MESSAGE(NAME) class NAME: public CMessage { \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define STR_MESSAGE(NAME, FIELD) class NAME: public CMessage { \
-	public: CString FIELD; \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define STR2_MESSAGE(NAME, FIELD1, FIELD2) class NAME: public CMessage { \
-	public: CString FIELD1, FIELD2; \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define STR_MESSAGE_VAL(NAME, FIELD, VAL) class NAME: public CMessage { \
-	public: CString FIELD; \
-	NAME(): FIELD(VAL) {} \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define NUM_MESSAGE(NAME, FIELD) class NAME: public CMessage { \
-	public: int FIELD; \
-	NAME(): FIELD(0) {} \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define NUM_MESSAGE_VAL(NAME, FIELD, VAL) class NAME: public CMessage { \
-	public: int FIELD; \
-	NAME(): CMessage(), FIELD(VAL) {} \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define NUM2_MESSAGE(NAME, FIELD1, FIELD2) class NAME: public CMessage { \
-	public: int FIELD1, FIELD2; \
-	NAME(): CMessage(), FIELD1(0), FIELD2(0) {} \
-	virtual const char *getClassName() const { return #NAME; } \
-	}
-#define NUM3_MESSAGE(NAME, FIELD1, FIELD2, FIELD3) class NAME: public CMessage { \
-	public: int FIELD1, FIELD2, FIELD3; \
-	NAME(): CMessage(), FIELD1(0), FIELD2(0), FIELD3(0) {} \
-	virtual const char *getClassName() const { return #NAME; } \
+#define MESSAGE0(NAME) \
+	class NAME: public CMessage { \
+	public: NAME() : CMessage() {} \
+	CLASSDEF \
 	}
-#define NUM4_MESSAGE(NAME, FIELD1, FIELD2, FIELD3, FIELD4) \
+#define MESSAGE1(NAME, F1, N1, V1) \
 	class NAME: public CMessage { \
-	public: int FIELD1, FIELD2, FIELD3, FIELD4; \
-	NAME(): CMessage(), FIELD1(0), FIELD2(0), FIELD3(0), FIELD4(0) {} \
-	virtual const char *getClassName() const { return #NAME; } \
+	public: F1 _N1; \
+	NAME() : CMessage(), _N1(V1) {} \
+	NAME(F1 N1) : CMessage(), _N1(N1) {} \
+	CLASSDEF \
 	}
-#define NUM2_MESSAGE_VAL(NAME, FIELD1, FIELD2, VAL1, VAL2) \
+#define MESSAGE2(NAME, F1, N1, V1, F2, N2, V2) \
 	class NAME: public CMessage { \
-	public: int FIELD1, FIELD2; \
-	NAME(): CMessage(), FIELD1(VAL1), FIELD2(VAL2) {} \
-	virtual const char *getClassName() const { return #NAME; } \
+	public: F1 _N1; F2 _N2; \
+	NAME() : CMessage(), _N1(V1), _N2(V2) {} \
+	NAME(F1 N1, F2 N2) : CMessage(), _N1(N1), _N2(N2) {} \
+	CLASSDEF \
 	}
-#define SNUM_MESSAGE(NAME, SFIELD, NFIELD) class NAME: public CMessage { \
-	public: CString SFIELD; CString NFIELD; \
-	virtual const char *getClassName() const { return #NAME; } \
+#define MESSAGE3(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3) \
+	class NAME: public CMessage { \
+	public: F1 _N1; F2 _N2; F3 _N3; \
+	NAME() : CMessage(), _N1(V1), _N2(V2), _N3(V3) {} \
+	NAME(F1 N1, F2 N2, F3 N3) : CMessage(), _N1(N1), _N2(N2), _N3(N3) {} \
+	CLASSDEF \
 	}
-#define SNUM_MESSAGE_VAL(NAME, SFIELD, NFIELD, SVAL, NVAL) \
+#define MESSAGE4(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3, F4, N4, V4) \
 	class NAME: public CMessage { \
-	public: CString SFIELD; CString NFIELD; \
-	NAME(): CMessage(), SFIELD(SVAL), NFIELD(NVAL) {} \
-	virtual const char *getClassName() const { return #NAME; } \
+	public: F1 _N1; F2 _N2; F3 _N3; F4 _N4; \
+	NAME() : CMessage(), _N1(V1), _N2(V2), _N3(V3), _N4(V4) {} \
+	NAME(F1 N1, F2 N2, F3 N3, F4 N4) : CMessage(), _N1(N1), _N2(N2), _N3(N3), _N4(N4) {} \
+	CLASSDEF \
 	}
 
-STR_MESSAGE(CActMsg, _value);
-STR_MESSAGE(CActivationmsg, _value);
-STR_MESSAGE_VAL(CAddHeadPieceMsg, _value, "NULL");
-NUM_MESSAGE(CAnimateMaitreDMsg, _value);
-NUM_MESSAGE(CArboretumGateMsg, _value);
-RAW_MESSAGE(CArmPickedUpFromTableMsg);
-RAW_MESSAGE(CBodyInBilgeRoomMsg);
-NUM_MESSAGE(CBowlStateChange, _value);
-SNUM_MESSAGE(CCarryObjectArrivedMsg, _strValue, _numValue);
-STR_MESSAGE_VAL(CChangeSeasonMsg, _season, "Summer");
-RAW_MESSAGE(CCheckAllPossibleCodes);
-NUM2_MESSAGE(CCheckChevCode, _value1, _value2);
-NUM_MESSAGE(CChildDragEndMsg, _value);
-NUM2_MESSAGE(CChildDragMoveMsg, _value1, _value2);
-NUM2_MESSAGE(CChildDragStartMsg, _value1, _value2);
-RAW_MESSAGE(CClearChevPanelBits);
-RAW_MESSAGE(CCorrectMusicPlayedMsg);
-RAW_MESSAGE(CCreateMusicPlayerMsg);
-RAW_MESSAGE(CCylinderHolderReadyMsg);
-RAW_MESSAGE(CDeactivationMsg);
-STR_MESSAGE(CDeliverCCarryMsg, _value);
-RAW_MESSAGE(CDisableMaitreDProdReceptor);
-RAW_MESSAGE(CDismissBotMsg);
-RAW_MESSAGE(CDoffNavHelmet);
-RAW_MESSAGE(CDonNavHelmet);
-NUM_MESSAGE(CDoorbotNeededInElevatorMsg, _value);
-RAW_MESSAGE(CDoorbotNeededInHomeMsg);
-NUM_MESSAGE(CDropobjectMsg, _value);
-NUM_MESSAGE(CDropZoneGotObjectMsg, _value);
-NUM_MESSAGE(CDropZoneLostObjectMsg, _value);
-NUM_MESSAGE(CEjectCylinderMsg, _value);
-RAW_MESSAGE(CErasePhonographCylinderMsg);
-NUM2_MESSAGE(CFreshenCookieMsg, _value1, _value2);
-NUM_MESSAGE(CGetChevClassBits, _value);
-NUM_MESSAGE(CGetChevClassNum, _value);
-SNUM_MESSAGE(CGetChevCodeFromRoomNameMsg, _strValue, _numValue);
-NUM_MESSAGE(CGetChevFloorBits, _value);
-NUM_MESSAGE(CGetChevFloorNum, _value);
-NUM_MESSAGE(CGetChevLiftBits, _value);
-NUM_MESSAGE(CGetChevLiftNum, _value);
-NUM_MESSAGE(CGetChevRoomBits, _value);
-NUM_MESSAGE(CGetChevRoomNum, _value);
-NUM2_MESSAGE_VAL(CHoseConnectedMsg, _value1, _value2, 1, 0);
-RAW_MESSAGE(CInitializeAnimMsg);
-NUM_MESSAGE(CIsEarBowlPuzzleDone, _value);
-NUM_MESSAGE(CIsParrotPresentMsg, _value);
-NUM_MESSAGE_VAL(CKeyCharMsg, _value, 32);
-NUM2_MESSAGE(CLemonFallsFromTreeMsg, _value1, _value2);
-NUM_MESSAGE(CLockPhonographMsg, _value);
-RAW_MESSAGE(CMaitreDDefeatedMsg);
-RAW_MESSAGE(CMaitreDHappyMsg);
-NUM_MESSAGE(CMissiveOMatActionMsg, _value);
-RAW_MESSAGE(CMoveToStartPosMsg);
-NUM2_MESSAGE(CMovieEndMsg, _value1, _value2);
-NUM2_MESSAGE(CMovieFrameMsg, _value1, _value2);
-RAW_MESSAGE(CMusicHasStartedMsg);
-RAW_MESSAGE(CMusicHasStoppedMsg);
-RAW_MESSAGE(CMusicSettingChangedMsg);
-NUM2_MESSAGE(CNPCPlayAnimationMsg, _value1, _value2);
-NUM_MESSAGE(CNPCPlayIdleAnimationMsg, _value);
-NUM3_MESSAGE(CNPCPlayTalkingAnimationMsg, _value1, _value2, _value3);
-RAW_MESSAGE(CNPCQueueIdleAnimMsg);
-STR_MESSAGE(CNutPuzzleMsg, _value);
-NUM_MESSAGE(COnSummonBotMsg, _value);
-RAW_MESSAGE(COpeningCreditsMsg);
-NUM_MESSAGE(CPanningAwayFromParrotMsg, _value);
-STR2_MESSAGE(CParrotSpeakMsg, _value1, _value2);
-NUM2_MESSAGE(CParrotTriesChickenMsg, _value1, _value2);
-NUM4_MESSAGE(CPassOnDragStartMsg, _value1, _value2, _value3, _value4);
-NUM_MESSAGE(CPhonographPlayMsg, _value);
-RAW_MESSAGE(CPhonographReadyToPlayMsg);
-NUM_MESSAGE(CPhonographRecordMsg, _value);
-NUM3_MESSAGE(CPhonographStopMsg, _value1, _value2, _value3);
-NUM2_MESSAGE(CPlayRangeMsg, _value1, _value2);
-NUM2_MESSAGE(CPlayerTriesRestaurantTableMsg, _value1, _value2);
-NUM_MESSAGE(CPreSaveMsg, _value);
-NUM_MESSAGE(CProdMaitreDMsg, _value);
-NUM2_MESSAGE(CPumpingMsg, _value1, _value2);
-NUM_MESSAGE(CPutBotBackInHisBoxMsg, _value);
-NUM_MESSAGE(CPutParrotBackMsg, _value);
-RAW_MESSAGE(CPuzzleSolvedMsg);
-NUM3_MESSAGE(CQueryCylinderHolderMsg, _value1, _value2, _value3);
-NUM3_MESSAGE(CQueryCylinderMsg, _value1, _value2, _value3);
-NUM3_MESSAGE(CQueryCylinderNameMsg, _value1, _value2, _value3);
-NUM3_MESSAGE(CQueryCylinderTypeMsg, _value1, _value2, _value3);
-NUM_MESSAGE(CQueryMusicControlSettingMsg, _value);
-NUM_MESSAGE(CQueryPhonographState, _value);
-RAW_MESSAGE(CRecordOntoCylinderMsg);
-RAW_MESSAGE(CRemoveFromGameMsg);
-RAW_MESSAGE(CReplaceBowlAndNutsMsg);
-STR_MESSAGE(CRestaurantMusicChanged, _value);
-SNUM_MESSAGE(CSendCCarryMsg, _strValue, _numValue);
-STR_MESSAGE_VAL(CSenseWorkingMsg, _value, "Not Working");
-NUM2_MESSAGE(CServiceElevatorFloorChangeMsg, _value1, _value2);
-RAW_MESSAGE(CServiceElevatorFloorRequestMsg);
-NUM_MESSAGE_VAL(CServiceElevatorMsg, _value, 4);
-NUM2_MESSAGE(CSetChevButtonImageMsg, _value1, _value2);
-NUM_MESSAGE(CSetChevClassBits, _value);
-NUM_MESSAGE(CSetChevFloorBits, _value);
-NUM_MESSAGE(CSetChevLiftBits, _value);
-NUM2_MESSAGE(CSetChevPanelBitMsg, _value1, _value2);
-NUM_MESSAGE(CSetChevPanelButtonsMsg, _value);
-NUM_MESSAGE(CSetChevRoomBits, _value);
-RAW_MESSAGE(CSetMusicControlsMsg);
-SNUM_MESSAGE(CSetVarMsg, _varName, _value);
-NUM2_MESSAGE_VAL(CSetVolumeMsg, _value1, _value2, 70, 0);
-SNUM_MESSAGE(CShipSettingMsg, _strValue, _numValue);
-STR_MESSAGE_VAL(CShowTextMsg, _value, "NO TEXT INCLUDED!!!");
-SNUM_MESSAGE(CSignalObject, _strValue, _numValue);
-NUM2_MESSAGE(CSpeechFallsFromTreeMsg, _value1, _value2);
-NUM_MESSAGE(CStartMusicMsg, _value);
-NUM3_MESSAGE(CStatusChangeMsg, _value1, _value2, _value3);
-NUM_MESSAGE(CStopMusicMsg, _value);
-RAW_MESSAGE(CSubDeliverCCarryMsg);
-RAW_MESSAGE(CSubSendCCarryMsg);
-RAW_MESSAGE(CSUBTransition);
-RAW_MESSAGE(CSubTurnOffMsg);
-RAW_MESSAGE(CSubTurnOnMsg);
-SNUM_MESSAGE(CSummonBotMsg, _strValue, _numValue);
-STR_MESSAGE(CSummonBotQuerryMsg, _value);
-STR_MESSAGE(CTakeHeadPieceMsg, _value);
-STR2_MESSAGE(CTextInputMsg, _value1, _value2);
-NUM_MESSAGE(CTimeDilationMsg, _value);
-NUM_MESSAGE(CTimeMsg, _value);
-RAW_MESSAGE(CTitleSequenceEndedMsg);
-RAW_MESSAGE(CTransitMsg);
-NUM_MESSAGE(CTriggerAutoMusicPlayerMsg, _value);
-NUM_MESSAGE(CTriggerNPCEvent, _value);
-NUM4_MESSAGE(CTrueTalkGetAnimSetMsg, _value1, _value2, _value3, _value4);
-SNUM_MESSAGE(CTrueTalkGetAssetDetailsMsg, _strValue, _numValue);
-NUM2_MESSAGE_VAL(CTrueTalkGetStateValueMsg, _value1, _value2, 0, -1000);
-NUM2_MESSAGE(CTrueTalkNotifySpeechEndedMsg, _value1, _value2);
-NUM3_MESSAGE(CTrueTalkNotifySpeechStartedMsg, _value1, _value2, _value);
-NUM_MESSAGE(CTrueTalkQueueUpAnimSetMsg, _value);
-RAW_MESSAGE(CTrueTalkSelfQueueAnimSetMsg);
-NUM3_MESSAGE(CTrueTalkTriggerActionMsg, _value1, _value2, _value3);
-RAW_MESSAGE(CTurnOff);
-RAW_MESSAGE(CTurnOn);
-NUM_MESSAGE(CUse, _value);
-NUM_MESSAGE(CUseWithCharMsg, _value);
-NUM_MESSAGE(CUseWithOtherMsg, _value);
-NUM_MESSAGE(CVirtualKeyCharMsg, _value);
-NUM2_MESSAGE_VAL(CVisibleMsg, _value1, _value2, 1, 0);
+MESSAGE1(CActMsg, CString, value, nullptr);
+MESSAGE1(CActivationmsg, CString, value, nullptr);
+MESSAGE1(CAddHeadPieceMsg, CString, value, "NULL");
+MESSAGE1(CAnimateMaitreDMsg, int, value, 0);
+MESSAGE1(CArboretumGateMsg, int, value, 0);
+MESSAGE0(CArmPickedUpFromTableMsg);
+MESSAGE0(CBodyInBilgeRoomMsg);
+MESSAGE1(CBowlStateChange, int, value, 0);
+MESSAGE2(CCarryObjectArrivedMsg, CString, strValue, nullptr, int, numValue, 0);
+MESSAGE1(CChangeSeasonMsg, CString, season, "Summer");
+MESSAGE0(CCheckAllPossibleCodes);
+MESSAGE2(CCheckChevCode, int, value1, 0, int, value2, 0);
+MESSAGE1(CChildDragEndMsg, int, value, 0);
+MESSAGE2(CChildDragMoveMsg, int, value1, 0, int, value2, 0);
+MESSAGE2(CChildDragStartMsg, int, value1, 0, int, value2, 0);
+MESSAGE0(CClearChevPanelBits);
+MESSAGE0(CCorrectMusicPlayedMsg);
+MESSAGE0(CCreateMusicPlayerMsg);
+MESSAGE0(CCylinderHolderReadyMsg);
+MESSAGE0(CDeactivationMsg);
+MESSAGE1(CDeliverCCarryMsg, CString, value, nullptr);
+MESSAGE0(CDisableMaitreDProdReceptor);
+MESSAGE0(CDismissBotMsg);
+MESSAGE0(CDoffNavHelmet);
+MESSAGE0(CDonNavHelmet);
+MESSAGE1(CDoorbotNeededInElevatorMsg, int, value, 0);
+MESSAGE0(CDoorbotNeededInHomeMsg);
+MESSAGE1(CDropobjectMsg, int, value, 0);
+MESSAGE1(CDropZoneGotObjectMsg, int, value, 0);
+MESSAGE1(CDropZoneLostObjectMsg, int, value, 0);
+MESSAGE1(CEjectCylinderMsg, int, value, 0);
+MESSAGE0(CErasePhonographCylinderMsg);
+MESSAGE2(CFreshenCookieMsg, int, value1, 0, int, value2, 0);
+MESSAGE1(CGetChevClassBits, int, value, 0);
+MESSAGE1(CGetChevClassNum, int, value, 0);
+MESSAGE2(CGetChevCodeFromRoomNameMsg, CString, strValue, nullptr, int, numValue, 0);
+MESSAGE1(CGetChevFloorBits, int, value, 0);
+MESSAGE1(CGetChevFloorNum, int, value, 0);
+MESSAGE1(CGetChevLiftBits, int, value, 0);
+MESSAGE1(CGetChevLiftNum, int, value, 0);
+MESSAGE1(CGetChevRoomBits, int, value, 0);
+MESSAGE1(CGetChevRoomNum, int, value, 0);
+MESSAGE2(CHoseConnectedMsg, int, value1, 1, int, value2, 0);
+MESSAGE0(CInitializeAnimMsg);
+MESSAGE1(CIsEarBowlPuzzleDone, int, value, 0);
+MESSAGE1(CIsParrotPresentMsg, int, value, 0);
+MESSAGE1(CKeyCharMsg, int, value, 32);
+MESSAGE2(CLemonFallsFromTreeMsg, int, value1, 0, int, value2, 0);
+MESSAGE1(CLockPhonographMsg, int, value, 0);
+MESSAGE0(CMaitreDDefeatedMsg);
+MESSAGE0(CMaitreDHappyMsg);
+MESSAGE1(CMissiveOMatActionMsg, int, value, 0);
+MESSAGE0(CMoveToStartPosMsg);
+MESSAGE2(CMovieEndMsg, int, value1, 0, int, value2, 0);
+MESSAGE2(CMovieFrameMsg, int, value1, 0, int, value2, 0);
+MESSAGE0(CMusicHasStartedMsg);
+MESSAGE0(CMusicHasStoppedMsg);
+MESSAGE0(CMusicSettingChangedMsg);
+MESSAGE2(CNPCPlayAnimationMsg, int, value1, 0, int, value2, 0);
+MESSAGE1(CNPCPlayIdleAnimationMsg, int, value, 0);
+MESSAGE3(CNPCPlayTalkingAnimationMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE0(CNPCQueueIdleAnimMsg);
+MESSAGE1(CNutPuzzleMsg, CString, value, nullptr);
+MESSAGE1(COnSummonBotMsg, int, value, 0);
+MESSAGE0(COpeningCreditsMsg);
+MESSAGE1(CPanningAwayFromParrotMsg, int, value, 0);
+MESSAGE2(CParrotSpeakMsg, CString, value1, nullptr, CString, value2, nullptr);
+MESSAGE2(CParrotTriesChickenMsg, int, value1, 0, int, value2, 0);
+MESSAGE4(CPassOnDragStartMsg, int, value1, 0, int, value2, 0, int, value3, 0, int, value4, 0);
+MESSAGE1(CPhonographPlayMsg, int, value, 0);
+MESSAGE0(CPhonographReadyToPlayMsg);
+MESSAGE1(CPhonographRecordMsg, int, value, 0);
+MESSAGE3(CPhonographStopMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE2(CPlayRangeMsg, int, value1, 0, int, value2, 0);
+MESSAGE2(CPlayerTriesRestaurantTableMsg, int, value1, 0, int, value2, 0);
+MESSAGE1(CPreSaveMsg, int, value, 0);
+MESSAGE1(CProdMaitreDMsg, int, value, 0);
+MESSAGE2(CPumpingMsg, int, value1, 0, int, value2, 0);
+MESSAGE1(CPutBotBackInHisBoxMsg, int, value, 0);
+MESSAGE1(CPutParrotBackMsg, int, value, 0);
+MESSAGE0(CPuzzleSolvedMsg);
+MESSAGE3(CQueryCylinderHolderMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE3(CQueryCylinderMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE3(CQueryCylinderNameMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE3(CQueryCylinderTypeMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE1(CQueryMusicControlSettingMsg, int, value, 0);
+MESSAGE1(CQueryPhonographState, int, value, 0);
+MESSAGE0(CRecordOntoCylinderMsg);
+MESSAGE0(CRemoveFromGameMsg);
+MESSAGE0(CReplaceBowlAndNutsMsg);
+MESSAGE1(CRestaurantMusicChanged, CString, value, nullptr);
+MESSAGE2(CSendCCarryMsg, CString, strValue, nullptr, int, numValue, 0);
+MESSAGE1(CSenseWorkingMsg, CString, value, "Not Working");
+MESSAGE2(CServiceElevatorFloorChangeMsg, int, value1, 0, int, value2, 0);
+MESSAGE0(CServiceElevatorFloorRequestMsg);
+MESSAGE1(CServiceElevatorMsg, int, value, 4);
+MESSAGE2(CSetChevButtonImageMsg, int, value1, 0, int, value2, 0);
+MESSAGE1(CSetChevClassBits, int, value, 0);
+MESSAGE1(CSetChevFloorBits, int, value, 0);
+MESSAGE1(CSetChevLiftBits, int, value, 0);
+MESSAGE2(CSetChevPanelBitMsg, int, value1, 0, int, value2, 0);
+MESSAGE1(CSetChevPanelButtonsMsg, int, value, 0);
+MESSAGE1(CSetChevRoomBits, int, value, 0);
+MESSAGE0(CSetMusicControlsMsg);
+MESSAGE2(CSetVarMsg, CString, varName, nullptr, int, value, 0);
+MESSAGE2(CSetVolumeMsg, int, value1, 70, int, value2, 0);
+MESSAGE2(CShipSettingMsg, CString, strValue, nullptr, int, numValue, 0);
+MESSAGE1(CShowTextMsg, CString, value, "NO TEXT INCLUDED!!!");
+MESSAGE2(CSignalObject, CString, strValue, nullptr, int, numValue, 0);
+MESSAGE2(CSpeechFallsFromTreeMsg, int, value1, 0, int, value2, 0);
+MESSAGE1(CStartMusicMsg, int, value, 0);
+MESSAGE3(CStatusChangeMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE1(CStopMusicMsg, int, value, 0);
+MESSAGE0(CSubDeliverCCarryMsg);
+MESSAGE0(CSubSendCCarryMsg);
+MESSAGE0(CSUBTransition);
+MESSAGE0(CSubTurnOffMsg);
+MESSAGE0(CSubTurnOnMsg);
+MESSAGE2(CSummonBotMsg, CString, strValue, nullptr, int, numValue, 0);
+MESSAGE1(CSummonBotQuerryMsg, CString, value, nullptr);
+MESSAGE1(CTakeHeadPieceMsg, CString, value, nullptr);
+MESSAGE2(CTextInputMsg, CString, value1, nullptr, CString, value2, nullptr);
+MESSAGE1(CTimeDilationMsg, int, value, 0);
+MESSAGE1(CTimeMsg, int, value, 0);
+MESSAGE0(CTitleSequenceEndedMsg);
+MESSAGE0(CTransitMsg);
+MESSAGE1(CTriggerAutoMusicPlayerMsg, int, value, 0);
+MESSAGE1(CTriggerNPCEvent, int, value, 0);
+MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, int, value2, 0, int, value3, 0, int, value4, 0);
+MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, strValue, nullptr, int, numValue, 0);
+MESSAGE2(CTrueTalkGetStateValueMsg, int, value1, 0, int, value2, -1000);
+MESSAGE2(CTrueTalkNotifySpeechEndedMsg, int, value1, 0, int, value2, 0);
+MESSAGE3(CTrueTalkNotifySpeechStartedMsg, int, value1, 0, int, value2, 0, int, value, 0);
+MESSAGE1(CTrueTalkQueueUpAnimSetMsg, int, value, 0);
+MESSAGE0(CTrueTalkSelfQueueAnimSetMsg);
+MESSAGE3(CTrueTalkTriggerActionMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE0(CTurnOff);
+MESSAGE0(CTurnOn);
+MESSAGE1(CUse, int, value, 0);
+MESSAGE1(CUseWithCharMsg, int, value, 0);
+MESSAGE1(CUseWithOtherMsg, int, value, 0);
+MESSAGE1(CVirtualKeyCharMsg, int, value, 0);
+MESSAGE2(CVisibleMsg, int, value1, 1, int, value2, 0);
 
 } // End of namespace Titanic
 
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 6b46603..d3a0566 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -32,46 +32,46 @@ public:
 	int _buttons;
 	Common::Point _mousePos;
 public:
+	CLASSDEF
 	CMouseMsg() : _buttons(0) {}
-	virtual const char *getClassName() const { return "CMouseMsg"; }
 };
 
 class CMouseMoveMsg : public CMouseMsg {
 public:
-	virtual const char *getClassName() const { return "CMouseMoveMsg"; }
+	CLASSDEF
 };
 
 class CMouseButtonMsg : public CMouseMsg {
 public:
 	int _field10;
 public:
+	CLASSDEF
 	CMouseButtonMsg() : CMouseMsg(), _field10(0) {}
-	virtual const char *getClassName() const { return "CMouseButtonMsg"; }
 };
 
 class CMouseButtonDownMsg : public CMouseButtonMsg {
 public:
-	virtual const char *getClassName() const { return "CMouseButtonDownMsg"; }
+	CLASSDEF
 };
 
 class CMouseButtonUpMsg : public CMouseButtonMsg {
 public:
-	virtual const char *getClassName() const { return "CMouseButtonUpMsg"; }
+	CLASSDEF
 };
 
 class CMouseButtonDoubleClickMsg : public CMouseButtonMsg {
 public:
-	virtual const char *getClassName() const { return "CMouseButtonDoubleClickMsg"; }
+	CLASSDEF
 };
 
 class CMouseDragMsg : public CMouseMsg {
 public:
-	virtual const char *getClassName() const { return "CMouseDragMsg"; }
+	CLASSDEF
 };
 
 class CMouseDragMoveMsg : public CMouseDragMsg {
 public:
-	virtual const char *getClassName() const { return "CMouseDragMoveMsg"; }
+	CLASSDEF
 };
 
 class CMouseDragStartMsg : public CMouseDragMsg {
@@ -79,16 +79,16 @@ public:
 	int _field10;
 	int _field14;
 public:
+	CLASSDEF
 	CMouseDragStartMsg() : CMouseDragMsg(), _field10(0), _field14(0) {}
-	virtual const char *getClassName() const { return "CMouseDragStartMsg"; }
 };
 
 class CMouseDragEndMsg : public CMouseDragMsg {
 public:
 	int _field10;
 public:
+	CLASSDEF
 	CMouseDragEndMsg() : CMouseDragMsg(), _field10(0) {}
-	virtual const char *getClassName() const { return "CMouseDragEndMsg"; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/messages/pet_messages.h b/engines/titanic/messages/pet_messages.h
index 96e52eb..195bf8a 100644
--- a/engines/titanic/messages/pet_messages.h
+++ b/engines/titanic/messages/pet_messages.h
@@ -27,20 +27,20 @@
 
 namespace Titanic {
 
-RAW_MESSAGE(CPETDeliverMsg);
-RAW_MESSAGE(CPETGainedObjectMsg);
-RAW_MESSAGE(CPETHelmetOnOffMsg);
-RAW_MESSAGE(CPETKeyboardOnOffMsg);
-RAW_MESSAGE(CPETLostObjectMsg);
-RAW_MESSAGE(CPETObjectSelectedMsg);
-NUM_MESSAGE(CPETObjectStateMsg, _value);
-RAW_MESSAGE(CPETPhotoOnOffMsg);
-NUM_MESSAGE(CPETPlaySoundMsg, _value);
-RAW_MESSAGE(CPETReceiveMsg);
-RAW_MESSAGE(CPETSetStarDestinationMsg);
-NUM_MESSAGE(CPETStarFieldLockMsg, _value);
-RAW_MESSAGE(CPETStereoFieldOnOffMsg);
-SNUM_MESSAGE_VAL(CPETTargetMsg, _strValue, _numValue, (const char *)nullptr, -1);
+MESSAGE0(CPETDeliverMsg);
+MESSAGE0(CPETGainedObjectMsg);
+MESSAGE0(CPETHelmetOnOffMsg);
+MESSAGE0(CPETKeyboardOnOffMsg);
+MESSAGE0(CPETLostObjectMsg);
+MESSAGE0(CPETObjectSelectedMsg);
+MESSAGE1(CPETObjectStateMsg, int, value, 0);
+MESSAGE0(CPETPhotoOnOffMsg);
+MESSAGE1(CPETPlaySoundMsg, int, value, 0);
+MESSAGE0(CPETReceiveMsg);
+MESSAGE0(CPETSetStarDestinationMsg);
+MESSAGE1(CPETStarFieldLockMsg, int, value, 0);
+MESSAGE0(CPETStereoFieldOnOffMsg);
+MESSAGE2(CPETTargetMsg, CString, strValue, nullptr, int, numValue, -1);
 
 } // End of namespace Titanic
 
diff --git a/engines/titanic/messages/service_elevator_door.h b/engines/titanic/messages/service_elevator_door.h
index a3a8388..ac5cf51 100644
--- a/engines/titanic/messages/service_elevator_door.h
+++ b/engines/titanic/messages/service_elevator_door.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CServiceElevatorDoor : public CDoorAutoSoundEvent {
 public:
+	CLASSDEF
 	CServiceElevatorDoor();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CServiceElevatorDoor"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index b9f5b64..f1d39ec 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -115,6 +115,7 @@ MODULE_OBJS := \
 	game/credits_button.o \
 	game/dead_area.o \
 	game/desk_click_responder.o \
+	game/dome_from_top_of_well.o \
 	game/doorbot_elevator_handler.o \
 	game/doorbot_home_handler.o \
 	game/ear_sweet_bowl.o \
diff --git a/engines/titanic/moves/enter_bomb_room.h b/engines/titanic/moves/enter_bomb_room.h
index fc4d136..dabde2e 100644
--- a/engines/titanic/moves/enter_bomb_room.h
+++ b/engines/titanic/moves/enter_bomb_room.h
@@ -31,14 +31,10 @@ class CEnterBombRoom : public CMovePlayerTo {
 protected:
 	int _fieldC8;
 public:
+	CLASSDEF
 	CEnterBombRoom();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEnterBombRoom"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/enter_bridge.h b/engines/titanic/moves/enter_bridge.h
index bbc4cc9..6a6e716 100644
--- a/engines/titanic/moves/enter_bridge.h
+++ b/engines/titanic/moves/enter_bridge.h
@@ -31,14 +31,10 @@ class CEnterBridge : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CEnterBridge() : CGameObject(), _value(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEnterBridge"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/enter_exit_first_class_state.h b/engines/titanic/moves/enter_exit_first_class_state.h
index f7bc4c6..728395d 100644
--- a/engines/titanic/moves/enter_exit_first_class_state.h
+++ b/engines/titanic/moves/enter_exit_first_class_state.h
@@ -41,10 +41,7 @@ public:
 	 */
 	static void deinit();
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBowlUnlocker"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/moves/enter_exit_mini_lift.h b/engines/titanic/moves/enter_exit_mini_lift.h
index 417e25d..5a91d39 100644
--- a/engines/titanic/moves/enter_exit_mini_lift.h
+++ b/engines/titanic/moves/enter_exit_mini_lift.h
@@ -32,14 +32,10 @@ private:
 	int _fieldBC;
 	int _fieldC0;
 public:
+	CLASSDEF
 	CEnterExitMiniLift() : CSGTNavigation(), _fieldBC(0), _fieldC0(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEnterExitMiniLift"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/enter_exit_sec_class_mini_lift.h b/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
index 364b2e3..a1081c2 100644
--- a/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
+++ b/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
@@ -39,14 +39,11 @@ private:
 	static CEnterExitSecClassMiniLiftStatics *_statics;
 	int _value;
 public:
+	CLASSDEF
 	CEnterExitSecClassMiniLift() : CGameObject(), _value(0) {}
 	static void init();
 	static void deinit();
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEnterExitSecClassMiniLift"; }
-
+	
 	/**
 	 * Save the data for the class to file
 	 */
diff --git a/engines/titanic/moves/enter_exit_view.h b/engines/titanic/moves/enter_exit_view.h
index 05ed63d..e967723 100644
--- a/engines/titanic/moves/enter_exit_view.h
+++ b/engines/titanic/moves/enter_exit_view.h
@@ -35,14 +35,10 @@ public:
 	int _fieldC8;
 	int _fieldCC;
 public:
+	CLASSDEF
 	CEnterExitView();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEnterExitView"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/enter_sec_class_state.h b/engines/titanic/moves/enter_sec_class_state.h
index 5da623d..2e80939 100644
--- a/engines/titanic/moves/enter_sec_class_state.h
+++ b/engines/titanic/moves/enter_sec_class_state.h
@@ -31,14 +31,10 @@ class CEnterSecClassState : public CGameObject {
 public:
 	int _value1, _value2;
 public:
+	CLASSDEF
 	CEnterSecClassState() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEnterSecClassState"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/exit_arboretum.h b/engines/titanic/moves/exit_arboretum.h
index 4e5815d..0da67dd 100644
--- a/engines/titanic/moves/exit_arboretum.h
+++ b/engines/titanic/moves/exit_arboretum.h
@@ -33,14 +33,10 @@ protected:
 	int _fieldCC;
 	int _fieldD0;
 public:
+	CLASSDEF
 	CExitArboretum();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CExitArboretum"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/exit_bridge.h b/engines/titanic/moves/exit_bridge.h
index c85c1bc..9231728 100644
--- a/engines/titanic/moves/exit_bridge.h
+++ b/engines/titanic/moves/exit_bridge.h
@@ -31,14 +31,10 @@ class CExitBridge : public CMovePlayerTo {
 private:
 	CString _string1;
 public:
+	CLASSDEF
 	CExitBridge();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CExitBridge"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/exit_lift.h b/engines/titanic/moves/exit_lift.h
index 534de1b..e97f041 100644
--- a/engines/titanic/moves/exit_lift.h
+++ b/engines/titanic/moves/exit_lift.h
@@ -31,10 +31,7 @@ class CExitLift : public CGameObject {
 public:
 	CString _value;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CExitLift"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/moves/exit_pellerator.h b/engines/titanic/moves/exit_pellerator.h
index 7df5657..3ae70db 100644
--- a/engines/titanic/moves/exit_pellerator.h
+++ b/engines/titanic/moves/exit_pellerator.h
@@ -37,15 +37,11 @@ class CExitPellerator : public CGameObject {
 private:
 	static CExitPelleratorStatics *_statics;
 public:
+	CLASSDEF
 	static void init();
 	static void deinit();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CExitPellerator"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/exit_state_room.h b/engines/titanic/moves/exit_state_room.h
index ecef4f1..ccf52ce 100644
--- a/engines/titanic/moves/exit_state_room.h
+++ b/engines/titanic/moves/exit_state_room.h
@@ -31,14 +31,10 @@ class CExitStateRoom : public CMovePlayerTo {
 protected:
 	int _fieldC8;
 public:
+	CLASSDEF
 	CExitStateRoom();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CExitStateRoom"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/exit_tiania.h b/engines/titanic/moves/exit_tiania.h
index 63e120f..3af5aad 100644
--- a/engines/titanic/moves/exit_tiania.h
+++ b/engines/titanic/moves/exit_tiania.h
@@ -34,14 +34,10 @@ private:
 	CString _string2;
 	CString _string3;
 public:
+	CLASSDEF
 	CExitTiania();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CExitTiania"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/move_player_in_parrot_room.h b/engines/titanic/moves/move_player_in_parrot_room.h
index 91f8b99..5339a60 100644
--- a/engines/titanic/moves/move_player_in_parrot_room.h
+++ b/engines/titanic/moves/move_player_in_parrot_room.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CMovePlayerInParrotRoom : public CMovePlayerTo {
 public:
+	CLASSDEF
 	CMovePlayerInParrotRoom();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMovePlayerInParrotRoom"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/move_player_to.h b/engines/titanic/moves/move_player_to.h
index aa785b9..2617b46 100644
--- a/engines/titanic/moves/move_player_to.h
+++ b/engines/titanic/moves/move_player_to.h
@@ -31,14 +31,10 @@ class CMovePlayerTo : public CGameObject {
 protected:
 	CString _destination;
 public:
+	CLASSDEF
 	CMovePlayerTo();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMovePlayerTo"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/move_player_to_from.h b/engines/titanic/moves/move_player_to_from.h
index 82fe5db..bc1878a 100644
--- a/engines/titanic/moves/move_player_to_from.h
+++ b/engines/titanic/moves/move_player_to_from.h
@@ -31,14 +31,10 @@ class CMovePlayerToFrom : public CGameObject {
 private:
 	CString _string2;
 public:
+	CLASSDEF
 	CMovePlayerToFrom();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMovePlayerToFrom"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/multi_move.h b/engines/titanic/moves/multi_move.h
index 102b4b7..a06632d 100644
--- a/engines/titanic/moves/multi_move.h
+++ b/engines/titanic/moves/multi_move.h
@@ -35,14 +35,10 @@ private:
 	CString _string4;
 	CString _string5;
 public:
+	CLASSDEF
 	CMultiMove();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMultiMove"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/pan_from_pel.h b/engines/titanic/moves/pan_from_pel.h
index 41f3fdb..b94f516 100644
--- a/engines/titanic/moves/pan_from_pel.h
+++ b/engines/titanic/moves/pan_from_pel.h
@@ -32,14 +32,10 @@ protected:
 	int _fieldC8;
 	CString _string1;
 public:
+	CLASSDEF
 	CPanFromPel();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPanFromPel"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/restaurant_pan_handler.h b/engines/titanic/moves/restaurant_pan_handler.h
index d2db584..29f7832 100644
--- a/engines/titanic/moves/restaurant_pan_handler.h
+++ b/engines/titanic/moves/restaurant_pan_handler.h
@@ -34,10 +34,7 @@ protected:
 	CString _string1;
 	CString _string2;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CRestaurantPanHandler"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/moves/restricted_move.h b/engines/titanic/moves/restricted_move.h
index 48ddefe9..ef95e0f 100644
--- a/engines/titanic/moves/restricted_move.h
+++ b/engines/titanic/moves/restricted_move.h
@@ -31,14 +31,10 @@ class CRestrictedMove : public CMovePlayerTo {
 protected:
 	int _fieldC8;
 public:
+	CLASSDEF
 	CRestrictedMove();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CRestrictedMove"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/scraliontis_table.h b/engines/titanic/moves/scraliontis_table.h
index d7c2ad6..53b0006 100644
--- a/engines/titanic/moves/scraliontis_table.h
+++ b/engines/titanic/moves/scraliontis_table.h
@@ -34,14 +34,10 @@ private:
 	int _fieldE8;
 	int _fieldEC;
 public:
+	CLASSDEF
 	CScraliontisTable();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CScraliontisTable"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/moves/trip_down_canal.h b/engines/titanic/moves/trip_down_canal.h
index 0a5f918..80d5dcf 100644
--- a/engines/titanic/moves/trip_down_canal.h
+++ b/engines/titanic/moves/trip_down_canal.h
@@ -29,14 +29,10 @@ namespace Titanic {
 
 class CTripDownCanal : public CMovePlayerTo {
 public:
+	CLASSDEF
 	CTripDownCanal();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTripDownCanal"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h
index d14d5a2..7e2d323 100644
--- a/engines/titanic/npcs/barbot.h
+++ b/engines/titanic/npcs/barbot.h
@@ -173,14 +173,10 @@ private:
 	int _field33C;
 	int _field340;
 public:
+	CLASSDEF
 	CBarbot();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBarbot"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/bellbot.h b/engines/titanic/npcs/bellbot.h
index b47daa1..c3d38f6 100644
--- a/engines/titanic/npcs/bellbot.h
+++ b/engines/titanic/npcs/bellbot.h
@@ -31,14 +31,10 @@ class CBellBot : public CTrueTalkNPC {
 private:
 	int _field108;
 public:
+	CLASSDEF
 	CBellBot();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBellBot"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/callbot.h b/engines/titanic/npcs/callbot.h
index 2f9edd3..299a329 100644
--- a/engines/titanic/npcs/callbot.h
+++ b/engines/titanic/npcs/callbot.h
@@ -32,14 +32,10 @@ protected:
 	CString _string1;
 	int _fieldC8;
 public:
+	CLASSDEF
 	CCallBot();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCallBot"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/character.h b/engines/titanic/npcs/character.h
index 8e1e87e..2fb83e9 100644
--- a/engines/titanic/npcs/character.h
+++ b/engines/titanic/npcs/character.h
@@ -34,14 +34,10 @@ protected:
 	int _fieldC4;
 	CString _charName;
 public:
+	CLASSDEF
 	CCharacter();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CCharacter"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/deskbot.h b/engines/titanic/npcs/deskbot.h
index 2826b01..cb977e4 100644
--- a/engines/titanic/npcs/deskbot.h
+++ b/engines/titanic/npcs/deskbot.h
@@ -35,14 +35,10 @@ private:
 	int _field108;
 	int _field10C;
 public:
+	CLASSDEF
 	CDeskbot();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDeskbot"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/doorbot.h b/engines/titanic/npcs/doorbot.h
index e3ec7e8..f0c46e5 100644
--- a/engines/titanic/npcs/doorbot.h
+++ b/engines/titanic/npcs/doorbot.h
@@ -37,14 +37,10 @@ private:
 	int _field110;
 	int _field114;
 public:
+	CLASSDEF
 	CDoorbot();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDoorbot"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/liftbot.h b/engines/titanic/npcs/liftbot.h
index f18fd7f..27556ed 100644
--- a/engines/titanic/npcs/liftbot.h
+++ b/engines/titanic/npcs/liftbot.h
@@ -34,14 +34,10 @@ private:
 private:
 	int _field108;
 public:
+	CLASSDEF
 	CLiftBot();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CLiftBot"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/maitre_d.h b/engines/titanic/npcs/maitre_d.h
index f44d6ee..bae682b 100644
--- a/engines/titanic/npcs/maitre_d.h
+++ b/engines/titanic/npcs/maitre_d.h
@@ -41,14 +41,10 @@ private:
 	int _field134;
 	int _field138;
 public:
+	CLASSDEF
 	CMaitreD();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMaitreD"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/mobile.h b/engines/titanic/npcs/mobile.h
index 9c74170..512bb9f 100644
--- a/engines/titanic/npcs/mobile.h
+++ b/engines/titanic/npcs/mobile.h
@@ -32,14 +32,10 @@ private:
 	Common::Point _pos1;
 	int _fieldDC;
 public:
+	CLASSDEF
 	CMobile();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMobile"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/parrot.h b/engines/titanic/npcs/parrot.h
index 991066e..b69c872 100644
--- a/engines/titanic/npcs/parrot.h
+++ b/engines/titanic/npcs/parrot.h
@@ -92,14 +92,10 @@ private:
 	int _field1E8;
 	int _field1EC;
 public:
+	CLASSDEF
 	CParrot();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CParrot"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/robot_controller.h b/engines/titanic/npcs/robot_controller.h
index 876285e..998453e 100644
--- a/engines/titanic/npcs/robot_controller.h
+++ b/engines/titanic/npcs/robot_controller.h
@@ -31,14 +31,10 @@ class CRobotController : public CGameObject {
 protected:
 	CString _string1;
 public:
+	CLASSDEF
 	CRobotController();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CRobotController"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/starlings.h b/engines/titanic/npcs/starlings.h
index 472d0f5..f7b1442 100644
--- a/engines/titanic/npcs/starlings.h
+++ b/engines/titanic/npcs/starlings.h
@@ -31,14 +31,10 @@ class CStarlings : public CCharacter {
 private:
 	static int _v1;
 public:
+	CLASSDEF
 	CStarlings();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CStarlings"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/succubus.h b/engines/titanic/npcs/succubus.h
index 2e30b12..e46592c 100644
--- a/engines/titanic/npcs/succubus.h
+++ b/engines/titanic/npcs/succubus.h
@@ -87,14 +87,10 @@ private:
 	int _field1D4;
 	int _field1D8;
 public:
+	CLASSDEF
 	CSuccUBus();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSuccUBus"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/summon_bots.h b/engines/titanic/npcs/summon_bots.h
index d525ff6..80aef73 100644
--- a/engines/titanic/npcs/summon_bots.h
+++ b/engines/titanic/npcs/summon_bots.h
@@ -33,14 +33,10 @@ protected:
 	int _fieldC8;
 	int _fieldCC;
 public:
+	CLASSDEF
 	CSummonBots();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSummonBots"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/titania.h b/engines/titanic/npcs/titania.h
index ee61222..4c4c812 100644
--- a/engines/titanic/npcs/titania.h
+++ b/engines/titanic/npcs/titania.h
@@ -42,14 +42,10 @@ private:
 	int _fieldFC;
 	int _field100;
 public:
+	CLASSDEF
 	CTitania();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTitania"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index aed1ddb..9546f18 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -41,14 +41,10 @@ protected:
 	int _field100;
 	int _field104;
 public:
+	CLASSDEF
 	CTrueTalkNPC();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTrueTalkNPC"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 087ecd1..0eb2034 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -64,10 +64,7 @@ private:
 
 	void saveSubObjects(SimpleFile *file, int indent) const;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CPetControl"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/auto_music_player.h b/engines/titanic/sound/auto_music_player.h
index 11e46b0..cec8117 100644
--- a/engines/titanic/sound/auto_music_player.h
+++ b/engines/titanic/sound/auto_music_player.h
@@ -31,14 +31,10 @@ class CAutoMusicPlayer : public CAutoMusicPlayerBase {
 private:
 	CString _string2;
 public:
+	CLASSDEF
 	CAutoMusicPlayer();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoMusicPlayer"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/auto_music_player_base.h b/engines/titanic/sound/auto_music_player_base.h
index 66ffabb..e762ef4 100644
--- a/engines/titanic/sound/auto_music_player_base.h
+++ b/engines/titanic/sound/auto_music_player_base.h
@@ -35,14 +35,10 @@ protected:
 	int _fieldD0;
 	int _fieldD4;
 public:
+	CLASSDEF
 	CAutoMusicPlayerBase();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoMusicPlayerBase"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/auto_sound_player.h b/engines/titanic/sound/auto_sound_player.h
index bc84934..15f1325 100644
--- a/engines/titanic/sound/auto_sound_player.h
+++ b/engines/titanic/sound/auto_sound_player.h
@@ -40,14 +40,10 @@ public:
 	int _fieldE4;
 	int _fieldE8;
 public:
+	CLASSDEF
 	CAutoSoundPlayer();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoSoundPlayer"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/auto_sound_player_adsr.h b/engines/titanic/sound/auto_sound_player_adsr.h
index 9c2a082..c88a861 100644
--- a/engines/titanic/sound/auto_sound_player_adsr.h
+++ b/engines/titanic/sound/auto_sound_player_adsr.h
@@ -33,10 +33,7 @@ private:
 	CString _string3;
 	CString _string4;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CAutoSoundPlayerADSR"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/background_sound_maker.h b/engines/titanic/sound/background_sound_maker.h
index 5a234ae..68c1d7d 100644
--- a/engines/titanic/sound/background_sound_maker.h
+++ b/engines/titanic/sound/background_sound_maker.h
@@ -31,14 +31,10 @@ class CBackgroundSoundMaker : public CGameObject {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CBackgroundSoundMaker() : CGameObject(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBackgroundSoundMaker"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/bird_song.h b/engines/titanic/sound/bird_song.h
index 50c1f2b..d932cfd 100644
--- a/engines/titanic/sound/bird_song.h
+++ b/engines/titanic/sound/bird_song.h
@@ -31,14 +31,10 @@ class CBirdSong : public CRoomAutoSoundPlayer {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CBirdSong() : CRoomAutoSoundPlayer(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CBirdSong"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/dome_from_top_of_well.h b/engines/titanic/sound/dome_from_top_of_well.h
index faea805..bb8ab63 100644
--- a/engines/titanic/sound/dome_from_top_of_well.h
+++ b/engines/titanic/sound/dome_from_top_of_well.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CDomeFromTopOfWell : public CViewAutoSoundPlayer {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CDomeFromTopOfWell"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/enter_view_toggles_other_music.h b/engines/titanic/sound/enter_view_toggles_other_music.h
index 3e7976e..991a6ad 100644
--- a/engines/titanic/sound/enter_view_toggles_other_music.h
+++ b/engines/titanic/sound/enter_view_toggles_other_music.h
@@ -31,14 +31,10 @@ class CEnterViewTogglesOtherMusic : public CTriggerAutoMusicPlayer {
 protected:
 	int _fieldC8;
 public:
+	CLASSDEF
 	CEnterViewTogglesOtherMusic();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CEnterViewTogglesOtherMusic"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/gondolier_song.h b/engines/titanic/sound/gondolier_song.h
index 38f7e86..6377279 100644
--- a/engines/titanic/sound/gondolier_song.h
+++ b/engines/titanic/sound/gondolier_song.h
@@ -31,14 +31,10 @@ class CGondolierSong : public CRoomAutoSoundPlayer {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CGondolierSong() : CRoomAutoSoundPlayer(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CGondolierSong"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/music_player.h b/engines/titanic/sound/music_player.h
index 19539c8..0a750cc 100644
--- a/engines/titanic/sound/music_player.h
+++ b/engines/titanic/sound/music_player.h
@@ -34,15 +34,11 @@ public:
 	int _fieldCC;
 	int _fieldD0;
 public:
+	CLASSDEF
 	CMusicPlayer() : CGameObject(),
 		_fieldBC(0), _fieldCC(0), _fieldD0(100) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CMusicPlayer"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/node_auto_sound_player.h b/engines/titanic/sound/node_auto_sound_player.h
index 5f4b70b..6fc5609 100644
--- a/engines/titanic/sound/node_auto_sound_player.h
+++ b/engines/titanic/sound/node_auto_sound_player.h
@@ -31,14 +31,10 @@ class CNodeAutoSoundPlayer : public CAutoSoundPlayer {
 private:
 	int _fieldEC;
 public:
+	CLASSDEF
 	CNodeAutoSoundPlayer() : CAutoSoundPlayer(), _fieldEC(1) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CViewAutoSoundPlayer"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/restricted_auto_music_player.h b/engines/titanic/sound/restricted_auto_music_player.h
index ab8e26e..cb6220c 100644
--- a/engines/titanic/sound/restricted_auto_music_player.h
+++ b/engines/titanic/sound/restricted_auto_music_player.h
@@ -34,10 +34,7 @@ private:
 	CString _string5;
 	CString _string6;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CRestrictedAutoMusicPlayer"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/room_auto_sound_player.h b/engines/titanic/sound/room_auto_sound_player.h
index 719eddc..ebee016 100644
--- a/engines/titanic/sound/room_auto_sound_player.h
+++ b/engines/titanic/sound/room_auto_sound_player.h
@@ -29,10 +29,7 @@ namespace Titanic {
 
 class CRoomAutoSoundPlayer : public CAutoSoundPlayer {
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CRoomAutoSoundPlayer"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/season_noises.h b/engines/titanic/sound/season_noises.h
index def709c..7746c16 100644
--- a/engines/titanic/sound/season_noises.h
+++ b/engines/titanic/sound/season_noises.h
@@ -35,14 +35,10 @@ private:
 	CString _string4;
 	CString _string5;
 public:
+	CLASSDEF
 	CSeasonNoises();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSeasonNoises"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/seasonal_music_player.h b/engines/titanic/sound/seasonal_music_player.h
index fe3a60b..da19e1f 100644
--- a/engines/titanic/sound/seasonal_music_player.h
+++ b/engines/titanic/sound/seasonal_music_player.h
@@ -38,14 +38,10 @@ private:
 	int _fieldF0;
 	int _fieldF4;
 public:
+	CLASSDEF
 	CSeasonalMusicPlayer();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CSeasonalMusicPlayer"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/titania_speech.h b/engines/titanic/sound/titania_speech.h
index a81544a..fc55c20 100644
--- a/engines/titanic/sound/titania_speech.h
+++ b/engines/titanic/sound/titania_speech.h
@@ -31,14 +31,10 @@ class CTitaniaSpeech : public CGameObject {
 public:
 	int _value1, _value2;
 public:
+	CLASSDEF
 	CTitaniaSpeech() : CGameObject(), _value1(1), _value2(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTitaniaSpeech"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/trigger_auto_music_player.h b/engines/titanic/sound/trigger_auto_music_player.h
index 8f7a42c..6387236 100644
--- a/engines/titanic/sound/trigger_auto_music_player.h
+++ b/engines/titanic/sound/trigger_auto_music_player.h
@@ -31,10 +31,7 @@ class CTriggerAutoMusicPlayer : public CGameObject {
 protected:
 	CString _fieldBC;
 public:
-	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CTriggerAutoMusicPlayer"; }
+	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/view_auto_sound_player.h b/engines/titanic/sound/view_auto_sound_player.h
index 9e87d74..60de391 100644
--- a/engines/titanic/sound/view_auto_sound_player.h
+++ b/engines/titanic/sound/view_auto_sound_player.h
@@ -31,14 +31,10 @@ class CViewAutoSoundPlayer : public CAutoSoundPlayer {
 private:
 	int _fieldEC;
 public:
+	CLASSDEF
 	CViewAutoSoundPlayer() : CAutoSoundPlayer(), _fieldEC(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CViewAutoSoundPlayer"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/view_toggles_other_music.h b/engines/titanic/sound/view_toggles_other_music.h
index e0da243..68fa47b 100644
--- a/engines/titanic/sound/view_toggles_other_music.h
+++ b/engines/titanic/sound/view_toggles_other_music.h
@@ -31,14 +31,10 @@ class CViewTogglesOtherMusic : public CEnterViewTogglesOtherMusic {
 private:
 	int _fieldCC;
 public:
+	CLASSDEF
 	CViewTogglesOtherMusic();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CViewTogglesOtherMusic"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/sound/water_lapping_sounds.h b/engines/titanic/sound/water_lapping_sounds.h
index 3dd72b5..0d885be 100644
--- a/engines/titanic/sound/water_lapping_sounds.h
+++ b/engines/titanic/sound/water_lapping_sounds.h
@@ -31,14 +31,10 @@ class CWaterLappingSounds : public CRoomAutoSoundPlayer {
 public:
 	int _value;
 public:
+	CLASSDEF
 	CWaterLappingSounds() : CRoomAutoSoundPlayer(), _value(0) {}
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CWaterLappingSounds"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index 2a24e51..9462cee 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -40,14 +40,10 @@ private:
 	int _field80AC;
 	int _field80B0;
 public:
+	CLASSDEF
 	CStarControl();
 
 	/**
-	 * Return the class name
-	 */
-	virtual const char *getClassName() const { return "CStarControl"; }
-
-	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;


Commit: dd5c119f322b8d6462bb5b7a3028d1536c7c3214
    https://github.com/scummvm/scummvm/commit/dd5c119f322b8d6462bb5b7a3028d1536c7c3214
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-06T19:57:01-05:00

Commit Message:
TITANIC: gcc compilation fixes

Changed paths:
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/saveable_object.h
    engines/titanic/messages/messages.h
    engines/titanic/messages/pet_messages.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control_sub10.h
    engines/titanic/star_control/star_control_sub11.h
    engines/titanic/star_control/star_control_sub12.h
    engines/titanic/star_control/star_control_sub8.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 1b56d1b..943715b 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -412,8 +412,8 @@ Common::List<ClassDef *> *CSaveableObject::_classDefs;
 
 #define DEFFN(T) ClassDef *T::_type; \
 	CSaveableObject *Function##T() { return new T(); }
-#define ADDFN(CHILD, PARENT) (*_classList)[#CHILD] = Function##CHILD; \
-	##CHILD::_type = new TypeTemplate<CHILD>(#CHILD, nullptr)
+#define ADDFN(CHILD, PARENT) CHILD::_type = new TypeTemplate<CHILD>(#CHILD, nullptr); \
+	(*_classList)[#CHILD] = Function##CHILD
 
 DEFFN(CArm)
 DEFFN(CAuditoryCentre)
@@ -459,6 +459,7 @@ DEFFN(CClickResponder)
 DEFFN(CDontSaveFileItem)
 DEFFN(CDropTarget)
 DEFFN(CFileItem)
+DEFFN(CFileList)
 DEFFN(CFileListItem)
 DEFFN(CGameObject)
 DEFFN(CLinkItem)
@@ -470,6 +471,7 @@ DEFFN(CMultiDropTarget)
 DEFFN(CNamedItem)
 DEFFN(CNodeItem)
 DEFFN(CProjectItem)
+DEFFN(CResourceKey)
 DEFFN(CSaveableObject)
 DEFFN(CStaticImage)
 DEFFN(CTurnOnObject)
@@ -555,7 +557,7 @@ DEFFN(CLongStickDispenser)
 DEFFN(CMailMan)
 DEFFN(CMissiveOMat)
 DEFFN(CMissiveOMatButton)
-DEFFN(CMovieTester);
+DEFFN(CMovieTester)
 DEFFN(CMusicalInstrument)
 DEFFN(CMusicConsoleButton)
 DEFFN(CMusicRoomPhonograph)
@@ -632,6 +634,7 @@ DEFFN(CPETClass1)
 DEFFN(CPETClass2)
 DEFFN(CPETClass3)
 DEFFN(CPetControl)
+DEFFN(CPetControlSub10)
 DEFFN(CPetDragChev)
 DEFFN(CPetGraphic)
 DEFFN(CPetGraphic2)
@@ -793,6 +796,7 @@ DEFFN(CLightsMsg)
 DEFFN(CLockPhonographMsg)
 DEFFN(CMaitreDDefeatedMsg)
 DEFFN(CMaitreDHappyMsg)
+DEFFN(CMessage)
 DEFFN(CMissiveOMatActionMsg)
 DEFFN(CMouseMsg)
 DEFFN(CMouseMoveMsg)
@@ -972,7 +976,7 @@ DEFFN(CTriggerAutoMusicPlayer)
 DEFFN(CViewAutoSoundPlayer)
 DEFFN(CViewTogglesOtherMusic)
 DEFFN(CWaterLappingSounds)
-DEFFN(CStarControl);
+DEFFN(CStarControl)
 
 void CSaveableObject::initClassList() {
 	_classDefs = new Common::List<ClassDef *>();
@@ -1021,6 +1025,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CDontSaveFileItem, CFileItem);
 	ADDFN(CDropTarget, CGameObject);
 	ADDFN(CFileItem, CTreeItem);
+	ADDFN(CFileList, List);
 	ADDFN(CFileListItem, ListItem);
 	ADDFN(CGameObject, CNamedItem);
 	ADDFN(CLinkItem, CNamedItem);
@@ -1032,6 +1037,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CNamedItem, CTreeItem);
 	ADDFN(CNodeItem, CNamedItem);
 	ADDFN(CProjectItem, CFileItem);
+	ADDFN(CResourceKey, CSaveableObject);
 	ADDFN(CSaveableObject, CSaveableObject);
 	ADDFN(CStaticImage, CGameObject);
 	ADDFN(CTurnOnObject, CBackground);
@@ -1272,6 +1278,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CMusicSwitchReverse, CMusicSwitch);
 	ADDFN(CMusicVoiceMute, CMusicControl);
 	ADDFN(CPetControl, CGameObject);
+	ADDFN(CPetControlSub10, List);
 	ADDFN(CPetDragChev, CPetGraphic2);
 	ADDFN(CPetGraphic, CGameObject);
 	ADDFN(CPetGraphic2, CGameObject);
@@ -1356,6 +1363,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CLockPhonographMsg, CMessage);
 	ADDFN(CMaitreDDefeatedMsg, CMessage);
 	ADDFN(CMaitreDHappyMsg, CMessage);
+	ADDFN(CMessage, CSaveableObject);
 	ADDFN(CMissiveOMatActionMsg, CMessage);
 	ADDFN(CMouseMsg, CMessage);
 	ADDFN(CMouseMoveMsg, CMouseMsg);
diff --git a/engines/titanic/core/saveable_object.h b/engines/titanic/core/saveable_object.h
index 8368c71..32b277f 100644
--- a/engines/titanic/core/saveable_object.h
+++ b/engines/titanic/core/saveable_object.h
@@ -39,6 +39,7 @@ public:
 public:
 	ClassDef(const char *className, ClassDef *parent) :
 		_className(className), _parent(parent) {}
+	virtual ~ClassDef() {}
 	virtual CSaveableObject *create();
 };
 
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index c11d688..5e6e0d7 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -136,15 +136,15 @@ public:
 	CLASSDEF \
 	}
 
-MESSAGE1(CActMsg, CString, value, nullptr);
-MESSAGE1(CActivationmsg, CString, value, nullptr);
+MESSAGE1(CActMsg, CString, value, "");
+MESSAGE1(CActivationmsg, CString, value, "");
 MESSAGE1(CAddHeadPieceMsg, CString, value, "NULL");
 MESSAGE1(CAnimateMaitreDMsg, int, value, 0);
 MESSAGE1(CArboretumGateMsg, int, value, 0);
 MESSAGE0(CArmPickedUpFromTableMsg);
 MESSAGE0(CBodyInBilgeRoomMsg);
 MESSAGE1(CBowlStateChange, int, value, 0);
-MESSAGE2(CCarryObjectArrivedMsg, CString, strValue, nullptr, int, numValue, 0);
+MESSAGE2(CCarryObjectArrivedMsg, CString, strValue, "", int, numValue, 0);
 MESSAGE1(CChangeSeasonMsg, CString, season, "Summer");
 MESSAGE0(CCheckAllPossibleCodes);
 MESSAGE2(CCheckChevCode, int, value1, 0, int, value2, 0);
@@ -156,7 +156,7 @@ MESSAGE0(CCorrectMusicPlayedMsg);
 MESSAGE0(CCreateMusicPlayerMsg);
 MESSAGE0(CCylinderHolderReadyMsg);
 MESSAGE0(CDeactivationMsg);
-MESSAGE1(CDeliverCCarryMsg, CString, value, nullptr);
+MESSAGE1(CDeliverCCarryMsg, CString, value, "");
 MESSAGE0(CDisableMaitreDProdReceptor);
 MESSAGE0(CDismissBotMsg);
 MESSAGE0(CDoffNavHelmet);
@@ -171,7 +171,7 @@ MESSAGE0(CErasePhonographCylinderMsg);
 MESSAGE2(CFreshenCookieMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CGetChevClassBits, int, value, 0);
 MESSAGE1(CGetChevClassNum, int, value, 0);
-MESSAGE2(CGetChevCodeFromRoomNameMsg, CString, strValue, nullptr, int, numValue, 0);
+MESSAGE2(CGetChevCodeFromRoomNameMsg, CString, strValue, "", int, numValue, 0);
 MESSAGE1(CGetChevFloorBits, int, value, 0);
 MESSAGE1(CGetChevFloorNum, int, value, 0);
 MESSAGE1(CGetChevLiftBits, int, value, 0);
@@ -198,11 +198,11 @@ MESSAGE2(CNPCPlayAnimationMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CNPCPlayIdleAnimationMsg, int, value, 0);
 MESSAGE3(CNPCPlayTalkingAnimationMsg, int, value1, 0, int, value2, 0, int, value3, 0);
 MESSAGE0(CNPCQueueIdleAnimMsg);
-MESSAGE1(CNutPuzzleMsg, CString, value, nullptr);
+MESSAGE1(CNutPuzzleMsg, CString, value, "");
 MESSAGE1(COnSummonBotMsg, int, value, 0);
 MESSAGE0(COpeningCreditsMsg);
 MESSAGE1(CPanningAwayFromParrotMsg, int, value, 0);
-MESSAGE2(CParrotSpeakMsg, CString, value1, nullptr, CString, value2, nullptr);
+MESSAGE2(CParrotSpeakMsg, CString, value1, "", CString, value2, "");
 MESSAGE2(CParrotTriesChickenMsg, int, value1, 0, int, value2, 0);
 MESSAGE4(CPassOnDragStartMsg, int, value1, 0, int, value2, 0, int, value3, 0, int, value4, 0);
 MESSAGE1(CPhonographPlayMsg, int, value, 0);
@@ -226,8 +226,8 @@ MESSAGE1(CQueryPhonographState, int, value, 0);
 MESSAGE0(CRecordOntoCylinderMsg);
 MESSAGE0(CRemoveFromGameMsg);
 MESSAGE0(CReplaceBowlAndNutsMsg);
-MESSAGE1(CRestaurantMusicChanged, CString, value, nullptr);
-MESSAGE2(CSendCCarryMsg, CString, strValue, nullptr, int, numValue, 0);
+MESSAGE1(CRestaurantMusicChanged, CString, value, "");
+MESSAGE2(CSendCCarryMsg, CString, strValue, "", int, numValue, 0);
 MESSAGE1(CSenseWorkingMsg, CString, value, "Not Working");
 MESSAGE2(CServiceElevatorFloorChangeMsg, int, value1, 0, int, value2, 0);
 MESSAGE0(CServiceElevatorFloorRequestMsg);
@@ -240,11 +240,11 @@ MESSAGE2(CSetChevPanelBitMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CSetChevPanelButtonsMsg, int, value, 0);
 MESSAGE1(CSetChevRoomBits, int, value, 0);
 MESSAGE0(CSetMusicControlsMsg);
-MESSAGE2(CSetVarMsg, CString, varName, nullptr, int, value, 0);
+MESSAGE2(CSetVarMsg, CString, varName, "", int, value, 0);
 MESSAGE2(CSetVolumeMsg, int, value1, 70, int, value2, 0);
-MESSAGE2(CShipSettingMsg, CString, strValue, nullptr, int, numValue, 0);
+MESSAGE2(CShipSettingMsg, CString, strValue, "", int, numValue, 0);
 MESSAGE1(CShowTextMsg, CString, value, "NO TEXT INCLUDED!!!");
-MESSAGE2(CSignalObject, CString, strValue, nullptr, int, numValue, 0);
+MESSAGE2(CSignalObject, CString, strValue, "", int, numValue, 0);
 MESSAGE2(CSpeechFallsFromTreeMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CStartMusicMsg, int, value, 0);
 MESSAGE3(CStatusChangeMsg, int, value1, 0, int, value2, 0, int, value3, 0);
@@ -254,10 +254,10 @@ MESSAGE0(CSubSendCCarryMsg);
 MESSAGE0(CSUBTransition);
 MESSAGE0(CSubTurnOffMsg);
 MESSAGE0(CSubTurnOnMsg);
-MESSAGE2(CSummonBotMsg, CString, strValue, nullptr, int, numValue, 0);
-MESSAGE1(CSummonBotQuerryMsg, CString, value, nullptr);
-MESSAGE1(CTakeHeadPieceMsg, CString, value, nullptr);
-MESSAGE2(CTextInputMsg, CString, value1, nullptr, CString, value2, nullptr);
+MESSAGE2(CSummonBotMsg, CString, strValue, "", int, numValue, 0);
+MESSAGE1(CSummonBotQuerryMsg, CString, value, "");
+MESSAGE1(CTakeHeadPieceMsg, CString, value, "");
+MESSAGE2(CTextInputMsg, CString, value1, "", CString, value2, "");
 MESSAGE1(CTimeDilationMsg, int, value, 0);
 MESSAGE1(CTimeMsg, int, value, 0);
 MESSAGE0(CTitleSequenceEndedMsg);
@@ -265,7 +265,7 @@ MESSAGE0(CTransitMsg);
 MESSAGE1(CTriggerAutoMusicPlayerMsg, int, value, 0);
 MESSAGE1(CTriggerNPCEvent, int, value, 0);
 MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, int, value2, 0, int, value3, 0, int, value4, 0);
-MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, strValue, nullptr, int, numValue, 0);
+MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, strValue, "", int, numValue, 0);
 MESSAGE2(CTrueTalkGetStateValueMsg, int, value1, 0, int, value2, -1000);
 MESSAGE2(CTrueTalkNotifySpeechEndedMsg, int, value1, 0, int, value2, 0);
 MESSAGE3(CTrueTalkNotifySpeechStartedMsg, int, value1, 0, int, value2, 0, int, value, 0);
diff --git a/engines/titanic/messages/pet_messages.h b/engines/titanic/messages/pet_messages.h
index 195bf8a..ac9c3cc 100644
--- a/engines/titanic/messages/pet_messages.h
+++ b/engines/titanic/messages/pet_messages.h
@@ -40,7 +40,7 @@ MESSAGE0(CPETReceiveMsg);
 MESSAGE0(CPETSetStarDestinationMsg);
 MESSAGE1(CPETStarFieldLockMsg, int, value, 0);
 MESSAGE0(CPETStereoFieldOnOffMsg);
-MESSAGE2(CPETTargetMsg, CString, strValue, nullptr, int, numValue, -1);
+MESSAGE2(CPETTargetMsg, CString, strValue, "", int, numValue, -1);
 
 } // End of namespace Titanic
 
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index f1d39ec..b9f5b64 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -115,7 +115,6 @@ MODULE_OBJS := \
 	game/credits_button.o \
 	game/dead_area.o \
 	game/desk_click_responder.o \
-	game/dome_from_top_of_well.o \
 	game/doorbot_elevator_handler.o \
 	game/doorbot_home_handler.o \
 	game/ear_sweet_bowl.o \
diff --git a/engines/titanic/pet_control/pet_control_sub10.h b/engines/titanic/pet_control/pet_control_sub10.h
index f8534d7..e532f9c 100644
--- a/engines/titanic/pet_control/pet_control_sub10.h
+++ b/engines/titanic/pet_control/pet_control_sub10.h
@@ -41,6 +41,7 @@ protected:
 	CPetVal _val2;
 	CPetVal _val3;
 public:
+	CLASSDEF
 	CPetControlSub10();
 
 	virtual void proc8();
diff --git a/engines/titanic/star_control/star_control_sub11.h b/engines/titanic/star_control/star_control_sub11.h
index 6e47f85..6b68070 100644
--- a/engines/titanic/star_control/star_control_sub11.h
+++ b/engines/titanic/star_control/star_control_sub11.h
@@ -50,12 +50,12 @@ public:
 	/**
 	 * Load the data for the class from file
 	 */
-	virtual void load(SimpleFile *file, int param);
+	void load(SimpleFile *file, int param);
 
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	void save(SimpleFile *file, int indent) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index 92192ec..6bfc415 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -44,18 +44,19 @@ private:
 	int _field21C;
 public:
 	CStarControlSub12(void *val1, void *val2);
+	virtual ~CStarControlSub12() {}
 
 	virtual void proc3() {}
 
 	/**
 	 * Load the data for the class from file
 	 */
-	virtual void load(SimpleFile *file, int param);
+	void load(SimpleFile *file, int param);
 
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	void save(SimpleFile *file, int indent) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub8.h b/engines/titanic/star_control/star_control_sub8.h
index c4b677c..da95f89 100644
--- a/engines/titanic/star_control/star_control_sub8.h
+++ b/engines/titanic/star_control/star_control_sub8.h
@@ -46,12 +46,12 @@ public:
 	/**
 	 * Load the data for the class from file
 	 */
-	virtual void load(SimpleFile *file) {}
+	void load(SimpleFile *file) {}
 
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const {}
+	void save(SimpleFile *file, int indent) const {}
 };
 
 } // End of namespace Titanic


Commit: 2395e5601ca09c001ba5cff7c67a0dd70019f789
    https://github.com/scummvm/scummvm/commit/2395e5601ca09c001ba5cff7c67a0dd70019f789
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-06T20:23:35-05:00

Commit Message:
TITANIC: Further gcc compilation fixes

Changed paths:
    engines/titanic/core/list.h
    engines/titanic/core/movie_clip.h
    engines/titanic/core/project_item.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/pet_control/pet_control_sub10.h



diff --git a/engines/titanic/core/list.h b/engines/titanic/core/list.h
index a37bca3..312405d 100644
--- a/engines/titanic/core/list.h
+++ b/engines/titanic/core/list.h
@@ -51,8 +51,6 @@ public:
 template<typename T>
 class List : public CSaveableObject, public Common::List<T *> {
 public:
-	CLASSDEF
-
 	/**
 	 * Save the data for the class to file
 	 */
diff --git a/engines/titanic/core/movie_clip.h b/engines/titanic/core/movie_clip.h
index 3db24de..cd6125d 100644
--- a/engines/titanic/core/movie_clip.h
+++ b/engines/titanic/core/movie_clip.h
@@ -62,7 +62,6 @@ public:
  */
 class CMovieClipList: public List<CMovieClip> {
 public:
-	CLASSDEF
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index f454392..81b1869 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -59,7 +59,6 @@ public:
  */
 class CFileList: public List<CFileListItem> {
 public:
-	CLASSDEF
 };
 
 
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 943715b..e831cca 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -459,14 +459,12 @@ DEFFN(CClickResponder)
 DEFFN(CDontSaveFileItem)
 DEFFN(CDropTarget)
 DEFFN(CFileItem)
-DEFFN(CFileList)
 DEFFN(CFileListItem)
 DEFFN(CGameObject)
 DEFFN(CLinkItem)
 DEFFN(ListItem)
 DEFFN(CMessageTarget)
 DEFFN(CMovieClip)
-DEFFN(CMovieClipList)
 DEFFN(CMultiDropTarget)
 DEFFN(CNamedItem)
 DEFFN(CNodeItem)
@@ -634,7 +632,6 @@ DEFFN(CPETClass1)
 DEFFN(CPETClass2)
 DEFFN(CPETClass3)
 DEFFN(CPetControl)
-DEFFN(CPetControlSub10)
 DEFFN(CPetDragChev)
 DEFFN(CPetGraphic)
 DEFFN(CPetGraphic2)
@@ -1025,14 +1022,12 @@ void CSaveableObject::initClassList() {
 	ADDFN(CDontSaveFileItem, CFileItem);
 	ADDFN(CDropTarget, CGameObject);
 	ADDFN(CFileItem, CTreeItem);
-	ADDFN(CFileList, List);
 	ADDFN(CFileListItem, ListItem);
 	ADDFN(CGameObject, CNamedItem);
 	ADDFN(CLinkItem, CNamedItem);
 	ADDFN(ListItem, CSaveableObject);
 	ADDFN(CMessageTarget, CSaveableObject);
 	ADDFN(CMovieClip, ListItem);
-	ADDFN(CMovieClipList, List);
 	ADDFN(CMultiDropTarget, CDropTarget);
 	ADDFN(CNamedItem, CTreeItem);
 	ADDFN(CNodeItem, CNamedItem);
@@ -1278,7 +1273,6 @@ void CSaveableObject::initClassList() {
 	ADDFN(CMusicSwitchReverse, CMusicSwitch);
 	ADDFN(CMusicVoiceMute, CMusicControl);
 	ADDFN(CPetControl, CGameObject);
-	ADDFN(CPetControlSub10, List);
 	ADDFN(CPetDragChev, CPetGraphic2);
 	ADDFN(CPetGraphic, CGameObject);
 	ADDFN(CPetGraphic2, CGameObject);
diff --git a/engines/titanic/pet_control/pet_control_sub10.h b/engines/titanic/pet_control/pet_control_sub10.h
index e532f9c..f8534d7 100644
--- a/engines/titanic/pet_control/pet_control_sub10.h
+++ b/engines/titanic/pet_control/pet_control_sub10.h
@@ -41,7 +41,6 @@ protected:
 	CPetVal _val2;
 	CPetVal _val3;
 public:
-	CLASSDEF
 	CPetControlSub10();
 
 	virtual void proc8();


Commit: fbcd4de457cfa18d121158e6be45ade57a3428f1
    https://github.com/scummvm/scummvm/commit/fbcd4de457cfa18d121158e6be45ade57a3428f1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-06T22:57:45-05:00

Commit Message:
TITANIC: Overall message handling method

Changed paths:
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/saveable_object.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/messages/messages.cpp
    engines/titanic/messages/messages.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index e831cca..7ec4f94 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -406,6 +406,12 @@
 
 namespace Titanic {
 
+CSaveableObject *ClassDef::create() {
+	return new CSaveableObject();
+}
+
+/*------------------------------------------------------------------------*/
+
 Common::HashMap<Common::String, CSaveableObject::CreateFunction> * 
 	CSaveableObject::_classList = nullptr;
 Common::List<ClassDef *> *CSaveableObject::_classDefs;
@@ -1573,10 +1579,15 @@ void CSaveableObject::saveFooter(SimpleFile *file, int indent) const {
 	file->writeClassEnd(indent);
 }
 
-/*------------------------------------------------------------------------*/
+bool CSaveableObject::isInstanceOf(const ClassDef &classDef) {
+	for (ClassDef *def = getType(); def != nullptr; def = def->_parent) {
+		if (def == &classDef)
+			return true;
+	}
 
-CSaveableObject *ClassDef::create() {
-	return new CSaveableObject();
+	return false;
 }
 
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/saveable_object.h b/engines/titanic/core/saveable_object.h
index 32b277f..b15dd13 100644
--- a/engines/titanic/core/saveable_object.h
+++ b/engines/titanic/core/saveable_object.h
@@ -79,6 +79,8 @@ public:
 	CLASSDEF
 	virtual ~CSaveableObject() {}
 	
+	bool isInstanceOf(const ClassDef &classDef);
+
 	/**
 	 * Save the data for the class to file
 	 */
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 8c9080f..ee89a05 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -70,6 +70,23 @@ CTreeItem *CTreeItem::getLastChild() {
 	return _firstChild->getLastSibling();
 }
 
+CTreeItem *CTreeItem::scan(CTreeItem *item) {
+	if (_firstChild)
+		return _firstChild;
+
+	CTreeItem *treeItem = this;
+	while (treeItem != item) {
+		if (treeItem->_nextSibling)
+			return treeItem->_nextSibling;
+
+		treeItem = treeItem->_parent;
+		if (!treeItem)
+			break;
+	}
+
+	return nullptr;
+}
+
 CDontSaveFileItem *CTreeItem::getDontSaveFileItem() {
 	CTreeItem *item = getFirstChild();
 	while (item) {
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 78a58fa..eed30a3 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -96,6 +96,8 @@ public:
 	 */
 	CTreeItem *getLastChild();
 
+	CTreeItem *scan(CTreeItem *item);
+
 	/**
 	 * Get any dont save file item in the immediate children
 	 */
diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
index c2a6197..f9648f9 100644
--- a/engines/titanic/messages/messages.cpp
+++ b/engines/titanic/messages/messages.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/messages/messages.h"
 #include "titanic/core/game_object.h"
+#include "titanic/core/tree_item.h"
 
 namespace Titanic {
 
@@ -37,4 +38,32 @@ void CMessage::load(SimpleFile *file) {
 	CSaveableObject::load(file);
 }
 
+bool CMessage::execute(CTreeItem *target, const ClassDef *classDef, int flags) {
+	// If no target was specified, then there's nothing to do
+	if (!target)
+		return false;
+
+	bool result = false;
+	CTreeItem *item = target;
+	CTreeItem *nextItem = nullptr;
+	do {
+		if (flags & MSGFLAG_SCAN)
+			nextItem = item->scan(target);
+
+		if (!(flags & MSGFLAG_CLASS_DEF) || item->isInstanceOf(*classDef)) {
+			bool handled = true; // item->handleEvent(this);
+
+			if (handled) {
+				result = true;
+				if (flags & MSGFLAG_BREAK_IF_HANDLED)
+					return true;
+			}
+		}
+
+		item = nextItem;
+	} while (nextItem);
+
+	return result;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 5e6e0d7..e369157 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -28,11 +28,19 @@
 
 namespace Titanic {
 
+enum MessageFlag { 
+	MSGFLAG_SCAN = 1,
+	MSGFLAG_BREAK_IF_HANDLED = 2,
+	MSGFLAG_CLASS_DEF = 4
+};
+
 class CMessage : public CSaveableObject {
 public:
 	CLASSDEF
 	CMessage();
 
+	bool execute(CTreeItem *target, const ClassDef *classDef, int flags);
+
 	/**
 	 * Save the data for the class to file
 	 */


Commit: 3103c9aaa9d14a5f6ad360eab2637c0be3141428
    https://github.com/scummvm/scummvm/commit/3103c9aaa9d14a5f6ad360eab2637c0be3141428
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-07T08:11:06-05:00

Commit Message:
TITANIC: Implemented message target classes

Changed paths:
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/arboretum_gate.h
    engines/titanic/game_manager.cpp
    engines/titanic/messages/messages.cpp
    engines/titanic/messages/messages.h
    engines/titanic/messages/mouse_messages.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 7ec4f94..8e3ab1e 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -796,6 +796,7 @@ DEFFN(CIsParrotPresentMsg)
 DEFFN(CKeyCharMsg)
 DEFFN(CLemonFallsFromTreeMsg)
 DEFFN(CLightsMsg)
+DEFFN(CLoadSuccessMsg)
 DEFFN(CLockPhonographMsg)
 DEFFN(CMaitreDDefeatedMsg)
 DEFFN(CMaitreDHappyMsg)
@@ -1360,6 +1361,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CKeyCharMsg, CMessage);
 	ADDFN(CLemonFallsFromTreeMsg, CMessage);
 	ADDFN(CLightsMsg, CMessage);
+	ADDFN(CLoadSuccessMsg, CMessage);
 	ADDFN(CLockPhonographMsg, CMessage);
 	ADDFN(CMaitreDDefeatedMsg, CMessage);
 	ADDFN(CMaitreDHappyMsg, CMessage);
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
index eb82333..2c2b81f 100644
--- a/engines/titanic/game/arboretum_gate.h
+++ b/engines/titanic/game/arboretum_gate.h
@@ -24,15 +24,20 @@
 #define TITANIC_ARBORETUM_GATE_H
 
 #include "titanic/core/background.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
 
 namespace Titanic {
 
-class CArboretumGate : public CBackground {
-public:
+class CArboretumGate : public CBackground, public CActMsgTarget,
+	public CLeaveViewMsgTarget, public CTurnOffTarget,
+	public CMouseButtonDownMsgTarget, public CEnterViewMsgTarget,
+	public CTurnOnTarget, public CMovieEndMsgTarget {
+private:
 	static int _v1;
 	static int _v2;
 	static int _v3;
-public:
+private:
 	int _fieldE0;
 	CString _string1;
 	int _fieldE8;
@@ -63,6 +68,14 @@ public:
 	int _field14C;
 	int _field150;
 	CString _string2;
+protected:
+	virtual bool handleEvent(const CActMsg &msg) { return false; }
+	virtual bool handleEvent(const CLeaveViewMsg &msg) { return false; }	
+	virtual bool handleEvent(const CTurnOff &msg) { return false; }
+	virtual bool handleEvent(const CMouseButtonDownMsg &msg) { return false; }
+	virtual bool handleEvent(const CEnterViewMsg &msg) { return false; }
+	virtual bool handleEvent(const CTurnOn &msg) { return false; }
+	virtual bool handleEvent(const CMovieEndMsg &msg) { return false; }
 public:
 	CLASSDEF
 	CArboretumGate();
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 5e64962..6c9d5e1 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/game_manager.h"
+#include "titanic/messages/messages.h"
 #include "titanic/screen_manager.h"
 
 namespace Titanic {
@@ -36,6 +37,9 @@ void CGameManager::load(SimpleFile *file) {
 
 void CGameManager::gameLoaded() {
 	// TODO
+
+	//CLoadSuccessMsg msg(0);
+
 }
 
-} // End of namespace Titanic
+} // End of namespace Titanic z
diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
index f9648f9..1f7a5a0 100644
--- a/engines/titanic/messages/messages.cpp
+++ b/engines/titanic/messages/messages.cpp
@@ -51,7 +51,7 @@ bool CMessage::execute(CTreeItem *target, const ClassDef *classDef, int flags) {
 			nextItem = item->scan(target);
 
 		if (!(flags & MSGFLAG_CLASS_DEF) || item->isInstanceOf(*classDef)) {
-			bool handled = true; // item->handleEvent(this);
+			bool handled = perform(item);
 
 			if (handled) {
 				result = true;
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index e369157..1908b73 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -34,6 +34,9 @@ enum MessageFlag {
 	MSGFLAG_CLASS_DEF = 4
 };
 
+#define MSGTARGET(NAME) class NAME; class NAME##Target { public: \
+	virtual bool handleEvent(const NAME &msg) = 0; }
+
 class CMessage : public CSaveableObject {
 public:
 	CLASSDEF
@@ -41,6 +44,8 @@ public:
 
 	bool execute(CTreeItem *target, const ClassDef *classDef, int flags);
 
+	virtual bool perform(CTreeItem *treeItem) { return false; }
+
 	/**
 	 * Save the data for the class to file
 	 */
@@ -52,8 +57,11 @@ public:
 	virtual void load(SimpleFile *file);
 };
 
+MSGTARGET(CEditControlMsg);
 class CEditControlMsg : public CMessage {
-private:
+protected:
+	virtual bool handleMessage(CEditControlMsg &msg) { return false; }
+public:
 	int _field4;
 	int _field8;
 	CString _string1;
@@ -64,9 +72,17 @@ public:
 	CLASSDEF
 	CEditControlMsg() : _field4(0), _field8(0), _field18(0),
 		_field1C(0), _field20(0) {}
+
+	virtual bool perform(CTreeItem *treeItem) { 
+		CEditControlMsg *dest = dynamic_cast<CEditControlMsg *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
 };
 
+MSGTARGET(CLightsMsg);
 class CLightsMsg : public CMessage {
+protected:
+	virtual bool handleMessage(CLightsMsg &msg) { return false; }
 public:
 	int _field4;
 	int _field8;
@@ -76,10 +92,18 @@ public:
 	CLASSDEF
 	CLightsMsg() : CMessage(), _field4(0), _field8(0),
 		_fieldC(0), _field10(0) {}
+
+	virtual bool perform(CTreeItem *treeItem) {
+		CLightsMsg *dest = dynamic_cast<CLightsMsg *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
 };
 
+MSGTARGET(CIsHookedOnMsg);
 class CIsHookedOnMsg : public CMessage {
-private:
+protected:
+	virtual bool handleMessage(CIsHookedOnMsg &msg) { return false; }
+public:
 	int _field4;
 	int _field8;
 	CString _string1;
@@ -90,59 +114,100 @@ public:
 	CLASSDEF
 	CIsHookedOnMsg() : CMessage(), _field4(0), _field8(0),
 		_field18(0), _field1C(0), _field20(0) {}
+
+	virtual bool perform(CTreeItem *treeItem) {
+		CIsHookedOnMsg *dest = dynamic_cast<CIsHookedOnMsg *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
 };
 
+MSGTARGET(CSubAcceptCCarryMsg);
 class CSubAcceptCCarryMsg : public CMessage {
+protected:
+	virtual bool handleMessage(CSubAcceptCCarryMsg &msg) { return false; }
 public:
 	CString _string1;
 	int _value1, _value2, _value3;
 public:
 	CLASSDEF
 	CSubAcceptCCarryMsg() : _value1(0), _value2(0), _value3(0) {}
+
+	virtual bool perform(CTreeItem *treeItem) {
+		CSubAcceptCCarryMsg *dest = dynamic_cast<CSubAcceptCCarryMsg *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
 };
 
+MSGTARGET(CTransportMsg);
 class CTransportMsg : public CMessage {
+protected:
+	virtual bool handleMessage(CTransportMsg &msg) { return false; }
 public:
 	CString _string;
 	int _value1, _value2;
 public:
 	CLASSDEF
 	CTransportMsg() : _value1(0), _value2(0) {}
+
+	virtual bool perform(CTreeItem *treeItem) {
+		CTransportMsg *dest = dynamic_cast<CTransportMsg *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
 };
 
-#define MESSAGE0(NAME) \
+#define MESSAGE0(NAME) MSGTARGET(NAME); \
 	class NAME: public CMessage { \
 	public: NAME() : CMessage() {} \
 	CLASSDEF \
-	}
-#define MESSAGE1(NAME, F1, N1, V1) \
+	virtual bool handleMessage(NAME &msg) { return false; } \
+	virtual bool perform(CTreeItem *treeItem) { \
+		NAME *dest = dynamic_cast<NAME *>(treeItem); \
+		return dest != nullptr && dest->handleMessage(*this); \
+	} }
+#define MESSAGE1(NAME, F1, N1, V1) MSGTARGET(NAME); \
 	class NAME: public CMessage { \
 	public: F1 _N1; \
 	NAME() : CMessage(), _N1(V1) {} \
 	NAME(F1 N1) : CMessage(), _N1(N1) {} \
 	CLASSDEF \
-	}
-#define MESSAGE2(NAME, F1, N1, V1, F2, N2, V2) \
+	virtual bool handleMessage(NAME &msg) { return false; } \
+	virtual bool perform(CTreeItem *treeItem) { \
+		NAME *dest = dynamic_cast<NAME *>(treeItem); \
+		return dest != nullptr && dest->handleMessage(*this); \
+	} }
+#define MESSAGE2(NAME, F1, N1, V1, F2, N2, V2) MSGTARGET(NAME); \
 	class NAME: public CMessage { \
 	public: F1 _N1; F2 _N2; \
 	NAME() : CMessage(), _N1(V1), _N2(V2) {} \
 	NAME(F1 N1, F2 N2) : CMessage(), _N1(N1), _N2(N2) {} \
 	CLASSDEF \
-	}
-#define MESSAGE3(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3) \
+	virtual bool handleMessage(NAME &msg) { return false; } \
+	virtual bool perform(CTreeItem *treeItem) { \
+		NAME *dest = dynamic_cast<NAME *>(treeItem); \
+		return dest != nullptr && dest->handleMessage(*this); \
+	} }
+#define MESSAGE3(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3) MSGTARGET(NAME); \
 	class NAME: public CMessage { \
 	public: F1 _N1; F2 _N2; F3 _N3; \
 	NAME() : CMessage(), _N1(V1), _N2(V2), _N3(V3) {} \
 	NAME(F1 N1, F2 N2, F3 N3) : CMessage(), _N1(N1), _N2(N2), _N3(N3) {} \
 	CLASSDEF \
-	}
-#define MESSAGE4(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3, F4, N4, V4) \
+	virtual bool handleMessage(NAME &msg) { return false; } \
+	virtual bool perform(CTreeItem *treeItem) { \
+		NAME *dest = dynamic_cast<NAME *>(treeItem); \
+		return dest != nullptr && dest->handleMessage(*this); \
+	} }
+#define MESSAGE4(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3, F4, N4, V4) MSGTARGET(NAME); \
 	class NAME: public CMessage { \
 	public: F1 _N1; F2 _N2; F3 _N3; F4 _N4; \
 	NAME() : CMessage(), _N1(V1), _N2(V2), _N3(V3), _N4(V4) {} \
 	NAME(F1 N1, F2 N2, F3 N3, F4 N4) : CMessage(), _N1(N1), _N2(N2), _N3(N3), _N4(N4) {} \
 	CLASSDEF \
-	}
+	virtual bool handleMessage(NAME &msg) { return false; } \
+	virtual bool perform(CTreeItem *treeItem) { \
+		NAME *dest = dynamic_cast<NAME *>(treeItem); \
+		return dest != nullptr && dest->handleMessage(*this); \
+	} }
 
 MESSAGE1(CActMsg, CString, value, "");
 MESSAGE1(CActivationmsg, CString, value, "");
@@ -175,6 +240,8 @@ MESSAGE1(CDropobjectMsg, int, value, 0);
 MESSAGE1(CDropZoneGotObjectMsg, int, value, 0);
 MESSAGE1(CDropZoneLostObjectMsg, int, value, 0);
 MESSAGE1(CEjectCylinderMsg, int, value, 0);
+MESSAGE0(CEnterNodeMsg);
+MESSAGE0(CEnterViewMsg);
 MESSAGE0(CErasePhonographCylinderMsg);
 MESSAGE2(CFreshenCookieMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CGetChevClassBits, int, value, 0);
@@ -191,7 +258,9 @@ MESSAGE0(CInitializeAnimMsg);
 MESSAGE1(CIsEarBowlPuzzleDone, int, value, 0);
 MESSAGE1(CIsParrotPresentMsg, int, value, 0);
 MESSAGE1(CKeyCharMsg, int, value, 32);
+MESSAGE0(CLeaveViewMsg);
 MESSAGE2(CLemonFallsFromTreeMsg, int, value1, 0, int, value2, 0);
+MESSAGE1(CLoadSuccessMsg, int, ticks, 0);
 MESSAGE1(CLockPhonographMsg, int, value, 0);
 MESSAGE0(CMaitreDDefeatedMsg);
 MESSAGE0(CMaitreDHappyMsg);
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index d3a0566..79c45af 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -36,9 +36,16 @@ public:
 	CMouseMsg() : _buttons(0) {}
 };
 
+MSGTARGET(CMouseMoveMsg);
 class CMouseMoveMsg : public CMouseMsg {
 public:
 	CLASSDEF
+
+	virtual bool handleMessage(CMouseMoveMsg &msg) { return false; }
+	virtual bool perform(CTreeItem *treeItem) { 
+		CMouseMoveMsg *dest = dynamic_cast<CMouseMoveMsg *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
 };
 
 class CMouseButtonMsg : public CMouseMsg {
@@ -49,19 +56,40 @@ public:
 	CMouseButtonMsg() : CMouseMsg(), _field10(0) {}
 };
 
+MSGTARGET(CMouseButtonDownMsg);
 class CMouseButtonDownMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
+
+	virtual bool handleMessage(CMouseButtonDownMsg &msg) { return false; }
+	virtual bool perform(CTreeItem *treeItem) {
+		CMouseButtonDownMsg *dest = dynamic_cast<CMouseButtonDownMsg *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
 };
 
+MSGTARGET(CMouseButtonUpMsg);
 class CMouseButtonUpMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
+
+	virtual bool handleMessage(CMouseButtonUpMsg &msg) { return false; }
+	virtual bool perform(CTreeItem *treeItem) { 
+		CMouseButtonUpMsg *dest = dynamic_cast<CMouseButtonUpMsg *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
 };
 
+MSGTARGET(CMouseButtonDoubleClickMsg);
 class CMouseButtonDoubleClickMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
+
+	virtual bool handleMessage(CMouseButtonDoubleClickMsg &msg) { return false; }
+	virtual bool perform(CTreeItem *treeItem) { 
+		CMouseButtonDoubleClickMsg *dest = dynamic_cast<CMouseButtonDoubleClickMsg *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
 };
 
 class CMouseDragMsg : public CMouseMsg {
@@ -72,8 +100,15 @@ public:
 class CMouseDragMoveMsg : public CMouseDragMsg {
 public:
 	CLASSDEF
+
+	virtual bool handleMessage(CMouseDragMoveMsg &msg) { return false; }
+	virtual bool perform(CTreeItem *treeItem) { 
+		CMouseDragMoveMsg *dest = dynamic_cast<CMouseDragMoveMsg *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
 };
 
+MSGTARGET(CMouseDragStartMsg);
 class CMouseDragStartMsg : public CMouseDragMsg {
 public:
 	int _field10;
@@ -81,14 +116,27 @@ public:
 public:
 	CLASSDEF
 	CMouseDragStartMsg() : CMouseDragMsg(), _field10(0), _field14(0) {}
+
+	virtual bool handleMessage(CMouseDragStartMsg &msg) { return false; }
+	virtual bool perform(CTreeItem *treeItem) { 
+		CMouseDragStartMsg *dest = dynamic_cast<CMouseDragStartMsg *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
 };
 
+MSGTARGET(CMouseDragEndMsg);
 class CMouseDragEndMsg : public CMouseDragMsg {
 public:
 	int _field10;
 public:
 	CLASSDEF
 	CMouseDragEndMsg() : CMouseDragMsg(), _field10(0) {}
+
+	virtual bool handleMessage(CMouseDragEndMsg &msg) { return false; }
+	virtual bool perform(CTreeItem *treeItem) {
+		CMouseDragEndMsg *dest = dynamic_cast<CMouseDragEndMsg *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
 };
 
 } // End of namespace Titanic


Commit: 0645a3dbde92fe4fbd46895cf24470535b7245aa
    https://github.com/scummvm/scummvm/commit/0645a3dbde92fe4fbd46895cf24470535b7245aa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-08T18:48:26-05:00

Commit Message:
TITANIC: Fix crash when compressed newgame.st file was closed

Changed paths:
    engines/titanic/compressed_file.cpp
    engines/titanic/compressed_file.h
    engines/titanic/core/project_item.cpp
    engines/titanic/simple_file.cpp
    engines/titanic/simple_file.h



diff --git a/engines/titanic/compressed_file.cpp b/engines/titanic/compressed_file.cpp
index d0cd376..3db9352 100644
--- a/engines/titanic/compressed_file.cpp
+++ b/engines/titanic/compressed_file.cpp
@@ -24,51 +24,12 @@
 
 namespace Titanic {
 
-#define BUFFER_SIZE 1024
-
-CompressedFile::CompressedFile() : SimpleFile() {
-	_readStream = nullptr;
-	_writeStream = nullptr;
-}
-
-CompressedFile::~CompressedFile() {
-}
-
-void CompressedFile::open(const Common::String &name) {
-	SimpleFile::open(name);
-	_readStream = Common::wrapCompressedReadStream(&_file);
-}
-
 void CompressedFile::open(Common::SeekableReadStream *stream) {
-	SimpleFile::open(stream);
-	_readStream = Common::wrapCompressedReadStream(&_file);
+	SimpleFile::open(Common::wrapCompressedReadStream(stream));
 }
 
 void CompressedFile::open(Common::OutSaveFile *stream) {
-	SimpleFile::open(stream);
-	_writeStream = Common::wrapCompressedWriteStream(stream);
-}
-
-void CompressedFile::close() {
-	delete _readStream;
-	delete _writeStream;
-	_readStream = nullptr;
-	_writeStream = nullptr;
-
-	SimpleFile::close();
-}
-
-size_t CompressedFile::unsafeRead(void *dst, size_t count) {
-	assert(_readStream);
-	if (count == 0)
-		return 0;
-
-	// Read data and decompress
-	return _readStream->read(dst, count);
-}
-
-size_t CompressedFile::write(const void *src, size_t count) {
-	return _writeStream->write(src, count);
+	SimpleFile::open(Common::wrapCompressedWriteStream(stream));
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/compressed_file.h b/engines/titanic/compressed_file.h
index 4b1051b..3be852f 100644
--- a/engines/titanic/compressed_file.h
+++ b/engines/titanic/compressed_file.h
@@ -36,17 +36,9 @@ namespace Titanic {
  * Derived file that handles compressed files
  */
 class CompressedFile : public SimpleFile {
-private:
-	Common::SeekableReadStream *_readStream;
-	Common::WriteStream *_writeStream;
 public:
-	CompressedFile();
-	virtual ~CompressedFile();
-
-	/**
-	 * Open a file for access
-	 */
-	virtual void open(const Common::String &name);
+	CompressedFile() : SimpleFile() {}
+	virtual ~CompressedFile() {}
 
 	/**
 	 * Set up a stream for read access
@@ -57,21 +49,6 @@ public:
 	 * Set up a stream for write access
 	 */
 	virtual void open(Common::OutSaveFile *stream);
-
-	/**
-	 * Close the file
-	 */
-	virtual void close();
-
-	/**
-	 * Read from the file
-	 */
-	virtual size_t unsafeRead(void *dst, size_t count);
-
-	/**
-	 * Write out data
-	 */
-	virtual size_t write(const void *src, size_t count);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index e759b87..2fa65f9 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -134,18 +134,20 @@ void CProjectItem::resetGameManager() {
 
 void CProjectItem::loadGame(int slotId) {
 	CompressedFile file;
-	Common::InSaveFile *saveFile = nullptr;
 
 	// Clear any existing project contents
 	clear();
 
 	// Open either an existing savegame slot or the new game template
 	if (slotId >= 0) {
-		saveFile = g_system->getSavefileManager()->openForLoading(
+		Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(
 			Common::String::format("slot%d.gam", slotId));
 		file.open(saveFile);
 	} else {
-		file.open("newgame.st");
+		Common::File *newFile = new Common::File();
+		if (!newFile->open("newgame.st"))
+			error("Could not open newgame.st");
+		file.open(newFile);
 	}
 
 	// Load the contents in
@@ -165,6 +167,7 @@ void CProjectItem::loadGame(int slotId) {
 		item->detach();
 		item->addUnder(this);
 	}
+
 	// Loaded project instance is no longer needed
 	newProject->destroyAll();
 
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index ef6f26d..4be8bb3 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -29,15 +29,7 @@ SimpleFile::SimpleFile(): _inStream(nullptr), _outStream(nullptr), _lineCount(1)
 }
 
 SimpleFile::~SimpleFile() {
-	_file.close();
-}
-
-void SimpleFile::open(const Common::String &name) {
 	close();
-
-	if (!_file.open(name))
-		error("Could not find file - %s", name.c_str());
-	_inStream = &_file;
 }
 
 void SimpleFile::open(Common::SeekableReadStream *stream) {
@@ -51,12 +43,16 @@ void SimpleFile::open(Common::OutSaveFile *stream) {
 }
 
 void SimpleFile::close() {
-	_file.close();
-	if (_outStream)
+	if (_outStream) {
 		_outStream->finalize();
+		delete _outStream;
+		_outStream = nullptr;
+	}
 
-	_inStream = nullptr;
-	_outStream = nullptr;
+	if (_inStream) {
+		delete _inStream;
+		_inStream = nullptr;
+	}
 }
 
 void SimpleFile::safeRead(void *dst, size_t count) {
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
index 8ea2b5a..4426380 100644
--- a/engines/titanic/simple_file.h
+++ b/engines/titanic/simple_file.h
@@ -35,9 +35,11 @@ namespace Titanic {
 class Decompressor;
 class DecompressorData;
 
+/**
+ * This class implements basic reading and writing to files
+ */
 class SimpleFile {
 protected:
-	Common::File _file;
 	Common::SeekableReadStream *_inStream;
 	Common::OutSaveFile *_outStream;
 	int _lineCount;
@@ -46,11 +48,6 @@ public:
 	virtual ~SimpleFile();
 
 	/**
-	 * Open a file for access
-	 */
-	virtual void open(const Common::String &name);
-
-	/**
 	 * Set up a stream for read access
 	 */
 	virtual void open(Common::SeekableReadStream *stream);


Commit: d1a29a1d1ad3ab60737f3a9a837907cd72562b63
    https://github.com/scummvm/scummvm/commit/d1a29a1d1ad3ab60737f3a9a837907cd72562b63
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-08T18:57:17-05:00

Commit Message:
TITANIC: Moved CompressedFile class into simple_file.h

One of the joys of working with ScummVM was that, using existing
Common functionality, the entirety of the original's CompressedFile
class could be reduced to a couple of lines. As such, CompressedFile
doesn't really need it's own seperate files anymore.

Changed paths:
  R engines/titanic/compressed_file.cpp
  R engines/titanic/compressed_file.h
    engines/titanic/core/project_item.cpp
    engines/titanic/core/saveable_object.h
    engines/titanic/module.mk
    engines/titanic/simple_file.h



diff --git a/engines/titanic/compressed_file.cpp b/engines/titanic/compressed_file.cpp
deleted file mode 100644
index 3db9352..0000000
--- a/engines/titanic/compressed_file.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/compressed_file.h"
-
-namespace Titanic {
-
-void CompressedFile::open(Common::SeekableReadStream *stream) {
-	SimpleFile::open(Common::wrapCompressedReadStream(stream));
-}
-
-void CompressedFile::open(Common::OutSaveFile *stream) {
-	SimpleFile::open(Common::wrapCompressedWriteStream(stream));
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/compressed_file.h b/engines/titanic/compressed_file.h
deleted file mode 100644
index 3be852f..0000000
--- a/engines/titanic/compressed_file.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_COMPRESSED_FILE_H
-#define TITANIC_COMPRESSED_FILE_H
-
-#include "common/scummsys.h"
-#include "common/file.h"
-#include "common/memstream.h"
-#include "common/zlib.h"
-#include "titanic/simple_file.h"
-#include "titanic/string.h"
-
-namespace Titanic {
-
-/**
- * Derived file that handles compressed files
- */
-class CompressedFile : public SimpleFile {
-public:
-	CompressedFile() : SimpleFile() {}
-	virtual ~CompressedFile() {}
-
-	/**
-	 * Set up a stream for read access
-	 */
-	virtual void open(Common::SeekableReadStream *stream);
-
-	/**
-	 * Set up a stream for write access
-	 */
-	virtual void open(Common::OutSaveFile *stream);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_COMPRESSED_FILE_H */
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 2fa65f9..354e373 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -20,10 +20,10 @@
  *
  */
 
+#include "common/file.h"
 #include "common/savefile.h"
 #include "titanic/game_manager.h"
 #include "titanic/titanic.h"
-#include "titanic/compressed_file.h"
 #include "titanic/core/dont_save_file_item.h"
 #include "titanic/core/project_item.h"
 #include "titanic/pet_control/pet_control.h"
diff --git a/engines/titanic/core/saveable_object.h b/engines/titanic/core/saveable_object.h
index b15dd13..c4615c5 100644
--- a/engines/titanic/core/saveable_object.h
+++ b/engines/titanic/core/saveable_object.h
@@ -26,6 +26,7 @@
 #include "common/scummsys.h"
 #include "common/array.h"
 #include "common/hash-str.h"
+#include "common/list.h"
 #include "titanic/simple_file.h"
 
 namespace Titanic {
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index b9f5b64..6309ac8 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -1,7 +1,6 @@
 MODULE := engines/titanic
 
 MODULE_OBJS := \
-	compressed_file.o \
 	detection.o \
 	direct_draw.o \
 	font.o \
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
index 4426380..cc68d2d 100644
--- a/engines/titanic/simple_file.h
+++ b/engines/titanic/simple_file.h
@@ -23,11 +23,10 @@
 #ifndef TITANIC_SIMPLE_FILE_H
 #define TITANIC_SIMPLE_FILE_H
 
-#include "common/scummsys.h"
-#include "common/file.h"
-#include "common/queue.h"
 #include "common/rect.h"
 #include "common/savefile.h"
+#include "common/stream.h"
+#include "common/zlib.h"
 #include "titanic/string.h"
 
 namespace Titanic {
@@ -180,6 +179,29 @@ public:
 	void writeClassEnd(int indent);
 };
 
+/**
+ * Derived file that handles compressed files
+ */
+class CompressedFile : public SimpleFile {
+public:
+	CompressedFile() : SimpleFile() {}
+	virtual ~CompressedFile() {}
+
+	/**
+	 * Set up a stream for read access
+	 */
+	virtual void open(Common::SeekableReadStream *stream) {
+		SimpleFile::open(Common::wrapCompressedReadStream(stream));
+	}
+
+	/**
+	 * Set up a stream for write access
+	 */
+	virtual void open(Common::OutSaveFile *stream) {
+		SimpleFile::open(Common::wrapCompressedWriteStream(stream));
+	}
+};
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_SIMPLE_FILE_H */


Commit: eff4ed1ac1b432744de77014f3a7001753580b0e
    https://github.com/scummvm/scummvm/commit/eff4ed1ac1b432744de77014f3a7001753580b0e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-08T19:35:30-05:00

Commit Message:
TITANIC: Fleshing out CProjectItem methods

Changed paths:
    engines/titanic/core/project_item.cpp
    engines/titanic/core/project_item.h
    engines/titanic/core/tree_item.h



diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 354e373..e1f5ec4 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -294,4 +294,66 @@ CPetControl *CProjectItem::getPetControl() {
 	return nullptr;
 }
 
+CRoomItem *CProjectItem::findFirstRoom() {
+	return dynamic_cast<CRoomItem *>(findChildInstance(*CRoomItem::_type));
+}
+
+CTreeItem *CProjectItem::findChildInstance(ClassDef &classDef) {
+	CTreeItem *treeItem = getFirstChild();
+	if (treeItem == nullptr)
+		return nullptr;
+
+	do {
+		CTreeItem *childItem = treeItem->getFirstChild();
+		if (childItem) {
+			do {
+				if (childItem->isInstanceOf(classDef))
+					return childItem;
+			} while ((childItem = childItem->getNextSibling()) != nullptr);
+		}
+	} while ((treeItem = treeItem->getNextSibling()) != nullptr);
+
+	return nullptr;
+}
+
+CRoomItem *CProjectItem::findNextRoom(CRoomItem *priorRoom) {
+	return dynamic_cast<CRoomItem *>(findSiblingInstanceOf(*CRoomItem::_type, priorRoom));
+}
+
+CTreeItem *CProjectItem::findSiblingInstanceOf(ClassDef &classDef, CTreeItem *startItem) {
+	CTreeItem *treeItem = startItem->getParent()->getNextSibling();
+	if (treeItem == nullptr)
+		return nullptr;
+
+	return findChildInstance(classDef);
+}
+
+CDontSaveFileItem *CProjectItem::getDontSaveFileItem() {
+	for (CTreeItem *treeItem = getFirstChild(); treeItem; treeItem = treeItem->getNextSibling()) {
+		if (treeItem->isInstanceOf(*CDontSaveFileItem::_type))
+			return dynamic_cast<CDontSaveFileItem *>(treeItem);
+	}
+
+	return nullptr;
+}
+
+CRoomItem *CProjectItem::findHiddenRoom() const {
+	return dynamic_cast<CRoomItem *>(findByName("HiddenRoom"));
+}
+
+CNamedItem *CProjectItem::findByName(const CString &name, int maxChars) const {
+	/*
+	CString nameLower = name;
+	nameLower.toLowercase();
+
+	CTreeItem *treeItem = this;
+	while (treeItem) {
+		CString nodeName = treeItem->getName();
+
+	}
+	*/
+	return nullptr;
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index 81b1869..07a5852 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -25,8 +25,10 @@
 
 #include "common/scummsys.h"
 #include "titanic/simple_file.h"
+#include "titanic/core/dont_save_file_item.h"
 #include "titanic/core/file_item.h"
 #include "titanic/core/list.h"
+#include "titanic/game/room_item.h"
 
 namespace Titanic {
 
@@ -75,6 +77,16 @@ private:
 	 * Called during save, iterates through the children to do some stuff
 	 */
 	void buildFilesList();
+
+	/**
+	 * Finds the first child instance of a given class type
+	 */
+	CTreeItem *findChildInstance(ClassDef &classDef);
+
+	/**
+	 * Finds the next sibling occurance of a given class type
+	 */
+	CTreeItem *findSiblingInstanceOf(ClassDef &classDef, CTreeItem *startItem);
 private:
 	/**
 	 * Load project data from the passed file
@@ -138,6 +150,25 @@ public:
 	 * Set the proejct's name
 	 */
 	void setFilename(const CString &name) { _filename = name; }
+
+	/**
+	 * Returns a reference to the first room item in the project
+	 */
+	CRoomItem *findFirstRoom();
+
+	/**
+	 * Returns a reference to the next room following the specified room
+	 */
+	CRoomItem *findNextRoom(CRoomItem *priorRoom);
+
+	/**
+	 * Returns the don't save file item, if it exists in the project
+	 */
+	CDontSaveFileItem *getDontSaveFileItem();
+
+	CRoomItem *findHiddenRoom() const;
+
+	CNamedItem *findByName(const CString &name, int maxChars = 0) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index eed30a3..4e1581b 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -96,6 +96,10 @@ public:
 	 */
 	CTreeItem *getLastChild();
 
+	/**
+	 * Given all the recursive children of the tree item, gives the next
+	 * item in sequence to the passed starting item
+	 */
 	CTreeItem *scan(CTreeItem *item);
 
 	/**


Commit: 34ade1f8cbd964314ebb603ffe4c8a76fbdb32c9
    https://github.com/scummvm/scummvm/commit/34ade1f8cbd964314ebb603ffe4c8a76fbdb32c9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-08T20:33:57-05:00

Commit Message:
TITANIC: Add const suffix to many tree item methods

Changed paths:
    engines/titanic/core/project_item.cpp
    engines/titanic/core/project_item.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h



diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index e1f5ec4..488cdba 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -124,7 +124,7 @@ void CProjectItem::load(SimpleFile *file) {
 	CTreeItem::load(file);
 }
 
-CGameManager *CProjectItem::getGameManager() {
+CGameManager *CProjectItem::getGameManager() const {
 	return _gameManager;
 }
 
@@ -276,7 +276,7 @@ void CProjectItem::gameLoaded() {
 		petControl->gameLoaded();
 }
 
-CPetControl *CProjectItem::getPetControl() {
+CPetControl *CProjectItem::getPetControl() const {
 	CDontSaveFileItem *fileItem = getDontSaveFileItem();
 	CTreeItem *treeItem;
 
@@ -294,11 +294,11 @@ CPetControl *CProjectItem::getPetControl() {
 	return nullptr;
 }
 
-CRoomItem *CProjectItem::findFirstRoom() {
+CRoomItem *CProjectItem::findFirstRoom() const {
 	return dynamic_cast<CRoomItem *>(findChildInstance(*CRoomItem::_type));
 }
 
-CTreeItem *CProjectItem::findChildInstance(ClassDef &classDef) {
+CTreeItem *CProjectItem::findChildInstance(ClassDef &classDef) const {
 	CTreeItem *treeItem = getFirstChild();
 	if (treeItem == nullptr)
 		return nullptr;
@@ -316,11 +316,11 @@ CTreeItem *CProjectItem::findChildInstance(ClassDef &classDef) {
 	return nullptr;
 }
 
-CRoomItem *CProjectItem::findNextRoom(CRoomItem *priorRoom) {
+CRoomItem *CProjectItem::findNextRoom(CRoomItem *priorRoom) const {
 	return dynamic_cast<CRoomItem *>(findSiblingInstanceOf(*CRoomItem::_type, priorRoom));
 }
 
-CTreeItem *CProjectItem::findSiblingInstanceOf(ClassDef &classDef, CTreeItem *startItem) {
+CTreeItem *CProjectItem::findSiblingInstanceOf(ClassDef &classDef, CTreeItem *startItem) const {
 	CTreeItem *treeItem = startItem->getParent()->getNextSibling();
 	if (treeItem == nullptr)
 		return nullptr;
@@ -328,7 +328,7 @@ CTreeItem *CProjectItem::findSiblingInstanceOf(ClassDef &classDef, CTreeItem *st
 	return findChildInstance(classDef);
 }
 
-CDontSaveFileItem *CProjectItem::getDontSaveFileItem() {
+CDontSaveFileItem *CProjectItem::getDontSaveFileItem() const {
 	for (CTreeItem *treeItem = getFirstChild(); treeItem; treeItem = treeItem->getNextSibling()) {
 		if (treeItem->isInstanceOf(*CDontSaveFileItem::_type))
 			return dynamic_cast<CDontSaveFileItem *>(treeItem);
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index 07a5852..2ec3a73 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -81,12 +81,12 @@ private:
 	/**
 	 * Finds the first child instance of a given class type
 	 */
-	CTreeItem *findChildInstance(ClassDef &classDef);
+	CTreeItem *findChildInstance(ClassDef &classDef) const;
 
 	/**
 	 * Finds the next sibling occurance of a given class type
 	 */
-	CTreeItem *findSiblingInstanceOf(ClassDef &classDef, CTreeItem *startItem);
+	CTreeItem *findSiblingInstanceOf(ClassDef &classDef, CTreeItem *startItem) const;
 private:
 	/**
 	 * Load project data from the passed file
@@ -119,12 +119,12 @@ public:
 	/**
 	 * Get the game manager for the project
 	 */
-	virtual CGameManager *getGameManager();
+	virtual CGameManager *getGameManager() const;
 
 	/**
 	 * Get a reference to the PET control
 	 */
-	CPetControl *getPetControl();
+	CPetControl *getPetControl() const;
 
 	/**
 	 * Resets the game manager field
@@ -154,17 +154,17 @@ public:
 	/**
 	 * Returns a reference to the first room item in the project
 	 */
-	CRoomItem *findFirstRoom();
+	CRoomItem *findFirstRoom() const;
 
 	/**
 	 * Returns a reference to the next room following the specified room
 	 */
-	CRoomItem *findNextRoom(CRoomItem *priorRoom);
+	CRoomItem *findNextRoom(CRoomItem *priorRoom) const;
 
 	/**
 	 * Returns the don't save file item, if it exists in the project
 	 */
-	CDontSaveFileItem *getDontSaveFileItem();
+	CDontSaveFileItem *getDontSaveFileItem() const;
 
 	CRoomItem *findHiddenRoom() const;
 
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index ee89a05..22c4e1d 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -40,7 +40,7 @@ void CTreeItem::load(SimpleFile *file) {
 	CMessageTarget::load(file);
 }
 
-CGameManager *CTreeItem::getGameManager() {
+CGameManager *CTreeItem::getGameManager() const {
 	return _parent ? _parent->getGameManager() : nullptr;
 }
 
@@ -64,17 +64,17 @@ CTreeItem *CTreeItem::getLastSibling() {
 	return item;
 }
 
-CTreeItem *CTreeItem::getLastChild() {
+CTreeItem *CTreeItem::getLastChild() const {
 	if (!_firstChild)
 		return nullptr;
 	return _firstChild->getLastSibling();
 }
 
-CTreeItem *CTreeItem::scan(CTreeItem *item) {
+CTreeItem *CTreeItem::scan(CTreeItem *item) const {
 	if (_firstChild)
 		return _firstChild;
 
-	CTreeItem *treeItem = this;
+	const CTreeItem *treeItem = this;
 	while (treeItem != item) {
 		if (treeItem->_nextSibling)
 			return treeItem->_nextSibling;
@@ -87,19 +87,6 @@ CTreeItem *CTreeItem::scan(CTreeItem *item) {
 	return nullptr;
 }
 
-CDontSaveFileItem *CTreeItem::getDontSaveFileItem() {
-	CTreeItem *item = getFirstChild();
-	while (item) {
-		CDontSaveFileItem *fileItem = dynamic_cast<CDontSaveFileItem *>(item);
-		if (fileItem)
-			return fileItem;
-
-		item = item->getNextSibling();
-	}
-
-	return nullptr;
-}
-
 void CTreeItem::addUnder(CTreeItem *newParent) {
 	if (newParent->_firstChild)
 		addSibling(newParent->getLastSibling());
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 4e1581b..acfd8bf 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -54,7 +54,7 @@ public:
 	/**
 	 * Get the game manager for the project
 	 */
-	virtual CGameManager *getGameManager();
+	virtual CGameManager *getGameManager() const;
 
 	/**
 	 * Returns true if the item is a file item
@@ -74,12 +74,12 @@ public:
 	/**
 	 * Get the next sibling
 	 */
-	CTreeItem *getNextSibling() { return _nextSibling; }
+	CTreeItem *getNextSibling() const { return _nextSibling; }
 
 	/**
 	 * Get the prior sibling
 	 */
-	CTreeItem *getPriorSibling() { return _priorSibling; }
+	CTreeItem *getPriorSibling() const { return _priorSibling; }
 
 	/**
 	 * Get the last sibling of this sibling
@@ -89,23 +89,18 @@ public:
 	/**
 	 * Get the first child of the item, if any
 	 */
-	CTreeItem *getFirstChild() { return _firstChild; }
+	CTreeItem *getFirstChild() const { return _firstChild; }
 
 	/**
 	 * Get the last child of the item, if any
 	 */
-	CTreeItem *getLastChild();
+	CTreeItem *getLastChild() const;
 
 	/**
 	 * Given all the recursive children of the tree item, gives the next
 	 * item in sequence to the passed starting item
 	 */
-	CTreeItem *scan(CTreeItem *item);
-
-	/**
-	 * Get any dont save file item in the immediate children
-	 */
-	CDontSaveFileItem *getDontSaveFileItem();
+	CTreeItem *scan(CTreeItem *item) const;
 
 	/**
 	 * Adds the item under another tree item


Commit: 8a404e62aab32a236c77a32804bd934c533d9605
    https://github.com/scummvm/scummvm/commit/8a404e62aab32a236c77a32804bd934c533d9605
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-08T21:13:24-05:00

Commit Message:
TITANIC: Implemented CTreeItem::findByName

Changed paths:
    engines/titanic/core/named_item.cpp
    engines/titanic/core/named_item.h
    engines/titanic/core/project_item.cpp
    engines/titanic/core/project_item.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/string.cpp
    engines/titanic/string.h



diff --git a/engines/titanic/core/named_item.cpp b/engines/titanic/core/named_item.cpp
index 10d9588..641efbd 100644
--- a/engines/titanic/core/named_item.cpp
+++ b/engines/titanic/core/named_item.cpp
@@ -39,4 +39,12 @@ void CNamedItem::load(SimpleFile *file) {
 	CTreeItem::load(file);
 }
 
+int CNamedItem::compareTo(const CString &name, int maxLen) const {
+	if (maxLen) {
+		return getName().left(maxLen).compareToIgnoreCase(name);
+	} else {
+		return getName().compareToIgnoreCase(name);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/named_item.h b/engines/titanic/core/named_item.h
index c86aae2..0afbf70 100644
--- a/engines/titanic/core/named_item.h
+++ b/engines/titanic/core/named_item.h
@@ -42,6 +42,21 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
+
+	/**
+	 * Returns true if the item is a named item
+	 */
+	virtual bool isNamedItem() const { return true; }
+
+	/**
+	 * Gets the name of the item, if any
+	 */
+	virtual const CString getName() const { return _name; }
+
+	/**
+	 * Compares the name of the item to a passed name
+	 */
+	virtual int compareTo(const CString &name, int maxLen) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 488cdba..de43b5b 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -337,23 +337,8 @@ CDontSaveFileItem *CProjectItem::getDontSaveFileItem() const {
 	return nullptr;
 }
 
-CRoomItem *CProjectItem::findHiddenRoom() const {
+CRoomItem *CProjectItem::findHiddenRoom() {
 	return dynamic_cast<CRoomItem *>(findByName("HiddenRoom"));
 }
 
-CNamedItem *CProjectItem::findByName(const CString &name, int maxChars) const {
-	/*
-	CString nameLower = name;
-	nameLower.toLowercase();
-
-	CTreeItem *treeItem = this;
-	while (treeItem) {
-		CString nodeName = treeItem->getName();
-
-	}
-	*/
-	return nullptr;
-}
-
-
 } // End of namespace Titanic
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index 2ec3a73..4271559 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -166,9 +166,7 @@ public:
 	 */
 	CDontSaveFileItem *getDontSaveFileItem() const;
 
-	CRoomItem *findHiddenRoom() const;
-
-	CNamedItem *findByName(const CString &name, int maxChars = 0) const;
+	CRoomItem *findHiddenRoom();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 22c4e1d..31deab8 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -23,6 +23,7 @@
 #include "titanic/core/tree_item.h"
 #include "titanic/core/dont_save_file_item.h"
 #include "titanic/core/file_item.h"
+#include "titanic/core/named_item.h"
 
 namespace Titanic {
 
@@ -154,4 +155,24 @@ void CTreeItem::detach() {
 	_priorSibling = _nextSibling = _parent = nullptr;
 }
 
+CNamedItem *CTreeItem::findByName(const CString &name, int maxLen) {
+	CString nameLower = name;
+	nameLower.toLowercase();
+
+	for (CTreeItem *treeItem = this; treeItem; treeItem = scan(treeItem)) {
+		CString nodeName = treeItem->getName();
+		nodeName.toLowercase();
+
+		if (maxLen) {
+			if (nodeName.left(maxLen).compareTo(nameLower))
+				return dynamic_cast<CNamedItem *>(treeItem);
+		} else {
+			if (nodeName.compareTo(nameLower))
+				return dynamic_cast<CNamedItem *>(treeItem);
+		}
+	}
+
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index acfd8bf..afca525 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -29,6 +29,7 @@ namespace Titanic {
 
 class CGameManager;
 class CDontSaveFileItem;
+class CNamedItem;
 
 class CTreeItem: public CMessageTarget {
 private:
@@ -62,6 +63,21 @@ public:
 	virtual bool isFileItem() const { return false; }
 
 	/**
+	 * Returns true if the item is a named item
+	 */
+	virtual bool isNamedItem() const { return false; }
+
+	/**
+	 * Gets the name of the item, if any
+	 */
+	virtual const CString getName() const { return CString(); }
+
+	/**
+	 * Compares the name of the item to a passed name
+	 */
+	virtual int compareTo(const CString &name, int maxLen) const { return false; }
+
+	/**
 	 * Get the parent for the given item
 	 */
 	CTreeItem *getParent() const { return _parent; }
@@ -131,6 +147,11 @@ public:
 	 * Detach the tree item from any other associated tree items
 	 */
 	void detach();
+
+	/**
+	 * Finds a tree item by name
+	 */
+	CNamedItem *findByName(const CString &name, int maxLen = 0);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp
index 55b7f8c..128a9a3 100644
--- a/engines/titanic/string.cpp
+++ b/engines/titanic/string.cpp
@@ -20,8 +20,24 @@
  *
  */
 
+#include "common/algorithm.h"
 #include "titanic/string.h"
 
 namespace Titanic {
 
+CString CString::left(uint count) const {
+	return (count > size()) ? *this : CString(c_str(), c_str() + count);
+}
+
+CString CString::right(uint count) const {
+	return (count > size()) ? *this : CString(c_str() - count, c_str());
+}
+
+CString CString::mid(uint start, uint count) const {
+	if (start >= size())
+		return CString();
+	else
+		return CString(c_str() + start, MIN(count, size() - start));
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/string.h b/engines/titanic/string.h
index 46cbb02..076cce0 100644
--- a/engines/titanic/string.h
+++ b/engines/titanic/string.h
@@ -36,6 +36,21 @@ public:
 	CString(const char *beginP, const char *endP) : Common::String(beginP, endP) {}
 	CString(const String &str) : Common::String(str) {}
 	explicit CString(char c) : Common::String(c) {}
+
+	/**
+	 * Returns the left n characters of the string
+	 */
+	CString left(uint count) const;
+
+	/**
+	 * Returns the right n characters of the string
+	 */
+	CString right(uint count) const;
+
+	/**
+	 * Returns a substring from within the string
+	 */
+	CString mid(uint start, uint count) const;
 };
 
 } // End of namespace Titanic


Commit: 71c3129ecff1e5e4e847825eba58d1be9594b1c8
    https://github.com/scummvm/scummvm/commit/71c3129ecff1e5e4e847825eba58d1be9594b1c8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-08T22:34:51-05:00

Commit Message:
TITANIC: Added skeletons for game manager support classes

Changed paths:
  A engines/titanic/game_state.cpp
  A engines/titanic/game_state.h
  A engines/titanic/game_state_sub.cpp
  A engines/titanic/game_state_sub.h
  A engines/titanic/input_handler.cpp
  A engines/titanic/input_handler.h
  A engines/titanic/input_translator.cpp
  A engines/titanic/input_translator.h
  A engines/titanic/npcs/true_talk_manager.cpp
  A engines/titanic/npcs/true_talk_manager.h
  A engines/titanic/sound/music_room.cpp
  A engines/titanic/sound/music_room.h
  A engines/titanic/sound/sound.cpp
  A engines/titanic/sound/sound.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/module.mk
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 6c9d5e1..d8e6454 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -27,12 +27,21 @@
 namespace Titanic {
 
 CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
-		_project(project), _gameView(gameView) {
+		_project(project), _gameView(gameView), _trueTalkManager(this),
+		_inputHandler(this), _inputTranslator(&_inputHandler),		
+		_gameState(this), _sound(this), _musicRoom(this),
+		_videoSurface(nullptr), _field30(0), _field34(0), _field48(0),
+		_field4C(0), _field50(0), _field54(0), _tickCount(0) {
 	// TODO
 }
 
 void CGameManager::load(SimpleFile *file) {
-	// TODO
+	file->readNumber();
+
+	//_gameState.load(file);
+	//_list.load(file);
+
+
 }
 
 void CGameManager::gameLoaded() {
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index d776c00..7ba1b3e 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -24,7 +24,14 @@
 #define TITANIC_GAME_MANAGER_H
 
 #include "common/scummsys.h"
+#include "titanic/game_state.h"
+#include "titanic/input_handler.h"
+#include "titanic/input_translator.h"
 #include "titanic/simple_file.h"
+#include "titanic/video_surface.h"
+#include "titanic/npcs/true_talk_manager.h"
+#include "titanic/sound/music_room.h"
+#include "titanic/sound/sound.h"
 
 namespace Titanic {
 
@@ -35,8 +42,24 @@ class CGameManager {
 private:
 	CProjectItem *_project;
 	CGameView *_gameView;
+	CGameState _gameState;
+	CSound _sound;
+	CInputHandler _inputHandler;
+	CInputTranslator _inputTranslator;
+	CMusicRoom _musicRoom;
+	CTrueTalkManager _trueTalkManager;
+	Common::Rect _bounds;
+	int _field30;
+	int _field34;
+	int _field48;
+	int _field4C;
+	int _field50;
+	int _field54;
+	CVideoSurface *_videoSurface;
+	int _tickCount;
 public:
 	CGameManager(CProjectItem *project, CGameView *gameView);
+	~CGameManager();
 
 	/**
 	 * Load data from a save file
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
new file mode 100644
index 0000000..3ead6d1
--- /dev/null
+++ b/engines/titanic/game_state.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game_state.h"
+
+namespace Titanic {
+
+CGameState::CGameState(CGameManager *gameManager) :
+		_gameManager(gameManager), _sub(this),
+		_field8(0), _fieldC(0), _field10(10), _field14(0), _field18(0),
+		_field1C(0), _field20(0), _field24(0), _field28(0), _field2C(0),
+		_field30(0), _field34(0), _field38(0) {
+
+}
+
+} // End of namespace Titanic z
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
new file mode 100644
index 0000000..f52e0d6
--- /dev/null
+++ b/engines/titanic/game_state.h
@@ -0,0 +1,66 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GAME_STATE_H
+#define TITANIC_GAME_STATE_H
+
+#include "titanic/core/list.h"
+#include "titanic/simple_file.h"
+#include "titanic/game_state_sub.h"
+
+namespace Titanic {
+
+class CGameManager;
+
+class CGameStateList : public List<ListItem> {
+public:
+	int _field10;
+	int _field14;
+public:
+	CGameStateList() : List<ListItem>(), _field10(0), _field14(0) {}
+};
+
+class CGameState {
+public:
+	CGameManager *_gameManager;
+	CGameStateSub _sub;
+	CGameStateList _list;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+	int _field28;
+	int _field2C;
+	int _field30;
+	int _field34;
+	int _field38;
+public:
+	CGameState(CGameManager *gameManager);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GAME_STATE_H */
diff --git a/engines/titanic/game_state_sub.cpp b/engines/titanic/game_state_sub.cpp
new file mode 100644
index 0000000..11cea2b
--- /dev/null
+++ b/engines/titanic/game_state_sub.cpp
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game_state_sub.h"
+#include "titanic/game_state.h"
+
+namespace Titanic {
+
+CGameStateSub::CGameStateSub(CGameState *owner) : _gameState(owner),
+		_field0(0), _field4(0), _field8(0), _fieldC(0) {
+}
+
+} // End of namespace Titanic z
diff --git a/engines/titanic/game_state_sub.h b/engines/titanic/game_state_sub.h
new file mode 100644
index 0000000..41f27df
--- /dev/null
+++ b/engines/titanic/game_state_sub.h
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GAME_STATE_SUB_H
+#define TITANIC_GAME_STATE_SUB_H
+
+namespace Titanic {
+
+class CGameState;
+
+class CGameStateSub {
+private:
+	CGameState *_gameState;
+public:
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+public:
+	CGameStateSub(CGameState *owner);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GAME_STATE_SUB_H */
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
new file mode 100644
index 0000000..0c09429
--- /dev/null
+++ b/engines/titanic/input_handler.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/input_handler.h"
+#include "titanic/screen_manager.h"
+
+namespace Titanic {
+
+CInputHandler::CInputHandler(CGameManager *owner) :
+		_gameManager(owner), _inputTranslator(nullptr),
+		_field4(0), _field8(0), _fieldC(0), _field10(0), _field14(0),
+		_field18(0), _field1C(0), _field20(0), _field24(0) {
+	CScreenManager::_screenManagerPtr->_inputHandler = this;
+}
+
+void CInputHandler::setTranslator(CInputTranslator *translator) {
+	_inputTranslator = translator;
+}
+
+} // End of namespace Titanic z
diff --git a/engines/titanic/input_handler.h b/engines/titanic/input_handler.h
new file mode 100644
index 0000000..288630c
--- /dev/null
+++ b/engines/titanic/input_handler.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_INPUT_HANDLER_H
+#define TITANIC_INPUT_HANDLER_H
+
+#include "titanic/input_translator.h"
+
+namespace Titanic {
+
+class CGameManager;
+
+class CInputHandler {
+public:
+	CGameManager *_gameManager;
+	CInputTranslator *_inputTranslator;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+public:
+	CInputHandler(CGameManager *owner);
+
+	void setTranslator(CInputTranslator *translator);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_INPUT_HANDLER_H */
diff --git a/engines/titanic/input_translator.cpp b/engines/titanic/input_translator.cpp
new file mode 100644
index 0000000..b2ee6eb
--- /dev/null
+++ b/engines/titanic/input_translator.cpp
@@ -0,0 +1,33 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/input_handler.h"
+#include "titanic/input_translator.h"
+
+namespace Titanic {
+
+CInputTranslator::CInputTranslator(CInputHandler *inputHandler) :
+		_inputHandler(inputHandler) {
+	inputHandler->setTranslator(this);
+}
+
+} // End of namespace Titanic z
diff --git a/engines/titanic/input_translator.h b/engines/titanic/input_translator.h
new file mode 100644
index 0000000..98cd2bb
--- /dev/null
+++ b/engines/titanic/input_translator.h
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_INPUT_TRANSLATOR_H
+#define TITANIC_INPUT_TRANSLATOR_H
+
+namespace Titanic {
+
+class CInputHandler;
+
+class CInputTranslator {
+public:
+	CInputHandler *_inputHandler;
+public:
+	CInputTranslator(CInputHandler *inputHandler);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_INPUT_TRANSLATOR_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 6309ac8..b150ba2 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -5,8 +5,12 @@ MODULE_OBJS := \
 	direct_draw.o \
 	font.o \
 	game_manager.o \
+	game_state.o \
+	game_state_sub.o \
 	game_view.o \
 	image.o \
+	input_handler.o \
+	input_translator.o \
 	main_game_window.o \
 	screen_manager.o \
 	simple_file.o \
@@ -364,6 +368,7 @@ MODULE_OBJS := \
 	npcs/succubus.o \
 	npcs/summon_bots.o \
 	npcs/titania.o \
+	npcs/true_talk_manager.o \
 	npcs/true_talk_npc.o \
 	pet_control/pet_control.o \
 	pet_control/pet_control_list_item.o \
@@ -391,12 +396,14 @@ MODULE_OBJS := \
 	sound/dome_from_top_of_well.o \
 	sound/enter_view_toggles_other_music.o \
 	sound/gondolier_song.o \
+	sound/music_room.o \
 	sound/music_player.o \
 	sound/node_auto_sound_player.o \
 	sound/restricted_auto_music_player.o \
 	sound/room_auto_sound_player.o \
 	sound/season_noises.o \
 	sound/seasonal_music_player.o \
+	sound/sound.o \
 	sound/titania_speech.o \
 	sound/trigger_auto_music_player.o \
 	sound/view_auto_sound_player.o \
diff --git a/engines/titanic/npcs/true_talk_manager.cpp b/engines/titanic/npcs/true_talk_manager.cpp
new file mode 100644
index 0000000..a9cc829
--- /dev/null
+++ b/engines/titanic/npcs/true_talk_manager.cpp
@@ -0,0 +1,30 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/npcs/true_talk_manager.h"
+
+namespace Titanic {
+
+CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : _gameManager(owner) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/npcs/true_talk_manager.h b/engines/titanic/npcs/true_talk_manager.h
new file mode 100644
index 0000000..decc593
--- /dev/null
+++ b/engines/titanic/npcs/true_talk_manager.h
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TRUE_TALK_MANAGER_H
+#define TITANIC_TRUE_TALK_MANAGER_H
+
+namespace Titanic {
+
+class CGameManager;
+
+class CTrueTalkManager {
+public:
+	CGameManager *_gameManager;
+public:
+	CTrueTalkManager(CGameManager *owner);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TRUE_TALK_MANAGER_H */
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 0846b81..1da9b58 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -44,6 +44,7 @@ CScreenManager::CScreenManager(TitanicEngine *vm): _vm(vm) {
 	_frontRenderSurface = nullptr;
 	_mouseCursor = nullptr;
 	_textCursor = nullptr;
+	_inputHandler = nullptr;
 	_fontNumber = 0;
 	// TODO: Further initialization
 
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index 0b847c2..d56020a 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -27,6 +27,7 @@
 #include "common/array.h"
 #include "titanic/direct_draw.h"
 #include "titanic/font.h"
+#include "titanic/input_handler.h"
 #include "titanic/video_surface.h"
 
 namespace Titanic {
@@ -63,6 +64,7 @@ public:
 	CScreenManagerRec _entries[2];
 	void *_mouseCursor;
 	void *_textCursor;
+	CInputHandler *_inputHandler;
 	int _fontNumber;
 public:
 	CScreenManager(TitanicEngine *vm);
diff --git a/engines/titanic/sound/music_room.cpp b/engines/titanic/sound/music_room.cpp
new file mode 100644
index 0000000..2b959a0
--- /dev/null
+++ b/engines/titanic/sound/music_room.cpp
@@ -0,0 +1,31 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/music_room.h"
+
+namespace Titanic {
+
+CMusicRoom::CMusicRoom(CGameManager *gameManager) :
+		_gameManager(gameManager) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/music_room.h b/engines/titanic/sound/music_room.h
new file mode 100644
index 0000000..7fcd99d
--- /dev/null
+++ b/engines/titanic/sound/music_room.h
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MUSIC_ROOM_H
+#define TITANIC_MUSIC_ROOM_H
+
+namespace Titanic {
+
+class CGameManager;
+
+class CMusicRoom {
+public:
+	CGameManager *_gameManager;
+public:
+	CMusicRoom(CGameManager *owner);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MUSIC_ROOM_H */
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
new file mode 100644
index 0000000..c0fd9fe
--- /dev/null
+++ b/engines/titanic/sound/sound.cpp
@@ -0,0 +1,30 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/sound.h"
+
+namespace Titanic {
+
+CSound::CSound(CGameManager *owner) : _gameManager(owner) {
+}
+
+} // End of namespace Titanic z
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
new file mode 100644
index 0000000..d9db819
--- /dev/null
+++ b/engines/titanic/sound/sound.h
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SOUND_H
+#define TITANIC_SOUND_H
+
+namespace Titanic {
+
+class CGameManager;
+
+class CSound {
+public:
+	CGameManager *_gameManager;
+public:
+	CSound(CGameManager *owner);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SOUND_H */


Commit: 759c0e3b4584d412f12250e0f248bad062581215
    https://github.com/scummvm/scummvm/commit/759c0e3b4584d412f12250e0f248bad062581215
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-08T22:56:34-05:00

Commit Message:
TITANIC: More game manager setup

Changed paths:
    engines/titanic/core/project_item.cpp
    engines/titanic/core/project_item.h
    engines/titanic/game_manager.cpp
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h



diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index de43b5b..18b0c42 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -128,6 +128,11 @@ CGameManager *CProjectItem::getGameManager() const {
 	return _gameManager;
 }
 
+void CProjectItem::setGameManager(CGameManager *gameManager) {
+	if (!_gameManager)
+		_gameManager = gameManager;
+}
+
 void CProjectItem::resetGameManager() {
 	_gameManager = nullptr;
 }
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index 4271559..f4148b0 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -122,6 +122,11 @@ public:
 	virtual CGameManager *getGameManager() const;
 
 	/**
+	 * Sets the game manager for the project, if not already set
+	 */
+	void setGameManager(CGameManager *gameManager);
+
+	/**
 	 * Get a reference to the PET control
 	 */
 	CPetControl *getPetControl() const;
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index d8e6454..b26c9b3 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -21,8 +21,9 @@
  */
 
 #include "titanic/game_manager.h"
-#include "titanic/messages/messages.h"
 #include "titanic/screen_manager.h"
+#include "titanic/core/project_item.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
@@ -30,9 +31,10 @@ CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
 		_project(project), _gameView(gameView), _trueTalkManager(this),
 		_inputHandler(this), _inputTranslator(&_inputHandler),		
 		_gameState(this), _sound(this), _musicRoom(this),
-		_videoSurface(nullptr), _field30(0), _field34(0), _field48(0),
+		_field30(0), _field34(0), _field48(0),
 		_field4C(0), _field50(0), _field54(0), _tickCount(0) {
-	// TODO
+	_videoSurface = CScreenManager::_screenManagerPtr->createSurface(600, 340);
+	_project->setGameManager(this);
 }
 
 void CGameManager::load(SimpleFile *file) {
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 1da9b58..145ba43 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -124,7 +124,11 @@ void OSScreenManager::proc18() {}
 void OSScreenManager::proc19() {}
 void OSScreenManager::proc20() {}
 void OSScreenManager::proc21() {}
-void OSScreenManager::proc22() {}
+
+CVideoSurface *OSScreenManager::createSurface(int w, int h) {
+	error("TODO");
+}
+
 void OSScreenManager::proc23() {}
 void OSScreenManager::proc24() {}
 void OSScreenManager::proc25() {}
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index d56020a..914fc85 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -93,7 +93,7 @@ public:
 	virtual void proc19() = 0;
 	virtual void proc20() = 0;
 	virtual void proc21() = 0;
-	virtual void proc22() = 0;
+	virtual CVideoSurface *createSurface(int w, int h) = 0;
 	virtual void proc23() = 0;
 	virtual void proc24() = 0;
 	virtual void proc25() = 0;
@@ -142,7 +142,7 @@ public:
 	virtual void proc19();
 	virtual void proc20();
 	virtual void proc21();
-	virtual void proc22();
+	virtual CVideoSurface *createSurface(int w, int h);
 	virtual void proc23();
 	virtual void proc24();
 	virtual void proc25();


Commit: 0fead6fe565d6e4a70adc1ab2273b55026e07655
    https://github.com/scummvm/scummvm/commit/0fead6fe565d6e4a70adc1ab2273b55026e07655
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-10T18:44:18-05:00

Commit Message:
TITANIC: Beginnings of game manager data loading

Changed paths:
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/game_state_sub.cpp
    engines/titanic/game_state_sub.h
    engines/titanic/npcs/true_talk_manager.cpp
    engines/titanic/npcs/true_talk_manager.h
    engines/titanic/screen_manager.cpp
    engines/titanic/sound/sound.cpp
    engines/titanic/sound/sound.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index b26c9b3..b677bf2 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -40,9 +40,10 @@ CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
 void CGameManager::load(SimpleFile *file) {
 	file->readNumber();
 
-	//_gameState.load(file);
-	//_list.load(file);
-
+	_gameState.load(file);
+	_list.load(file);
+	_trueTalkManager.load(file);
+	_sound.load(file);
 
 }
 
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 7ba1b3e..200f34f 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -38,6 +38,12 @@ namespace Titanic {
 class CProjectItem;
 class CGameView;
 
+class CGameManagerListItem : public ListItem {
+};
+
+class CGameManagerList : public List<CGameManagerListItem> {
+};
+
 class CGameManager {
 private:
 	CProjectItem *_project;
@@ -49,6 +55,7 @@ private:
 	CMusicRoom _musicRoom;
 	CTrueTalkManager _trueTalkManager;
 	Common::Rect _bounds;
+	CGameManagerList _list;
 	int _field30;
 	int _field34;
 	int _field48;
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 3ead6d1..59e4b7b 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -29,7 +29,30 @@ CGameState::CGameState(CGameManager *gameManager) :
 		_field8(0), _fieldC(0), _field10(10), _field14(0), _field18(0),
 		_field1C(0), _field20(0), _field24(0), _field28(0), _field2C(0),
 		_field30(0), _field34(0), _field38(0) {
+}
+
+void CGameState::save(SimpleFile *file) const {
+	file->writeNumber(_field18);
+	file->writeNumber(_field8);
+	file->writeNumber(_fieldC);
+	file->writeNumber(_field14);
+	file->writeNumber(_field24);
+	file->writeNumber(_field38);
+	_sub.save(file);
+	file->writeNumber(_field1C);
+}
+
+void CGameState::load(SimpleFile *file) {
+	_field18 = file->readNumber();
+	_field8 = file->readNumber();
+	_fieldC = file->readNumber();
+	_field14 = file->readNumber();
+	_field24 = file->readNumber();
+	_field38 = file->readNumber();
+	_sub.load(file);
 
+	_field1C = file->readNumber();
+	_field28 = _field2C = 0;
 }
 
 } // End of namespace Titanic z
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index f52e0d6..e6275de 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -59,6 +59,16 @@ public:
 	int _field38;
 public:
 	CGameState(CGameManager *gameManager);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	void save(SimpleFile *file) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	void load(SimpleFile *file);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_state_sub.cpp b/engines/titanic/game_state_sub.cpp
index 11cea2b..212fcce 100644
--- a/engines/titanic/game_state_sub.cpp
+++ b/engines/titanic/game_state_sub.cpp
@@ -29,4 +29,17 @@ CGameStateSub::CGameStateSub(CGameState *owner) : _gameState(owner),
 		_field0(0), _field4(0), _field8(0), _fieldC(0) {
 }
 
+void CGameStateSub::save(SimpleFile *file) const {
+	file->writeNumber(_field4);
+	file->writeNumber(_field8);
+	file->writeNumber(_fieldC);
+}
+
+void CGameStateSub::load(SimpleFile *file) {
+	_field0 = 0;
+	_field4 = file->readNumber();
+	_field8 = file->readNumber();
+	_fieldC = file->readNumber();
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/game_state_sub.h b/engines/titanic/game_state_sub.h
index 41f27df..2ea6bd6 100644
--- a/engines/titanic/game_state_sub.h
+++ b/engines/titanic/game_state_sub.h
@@ -23,6 +23,8 @@
 #ifndef TITANIC_GAME_STATE_SUB_H
 #define TITANIC_GAME_STATE_SUB_H
 
+#include "titanic/simple_file.h"
+
 namespace Titanic {
 
 class CGameState;
@@ -37,6 +39,16 @@ public:
 	int _fieldC;
 public:
 	CGameStateSub(CGameState *owner);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	void save(SimpleFile *file) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	void load(SimpleFile *file);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/true_talk_manager.cpp b/engines/titanic/npcs/true_talk_manager.cpp
index a9cc829..dbf9712 100644
--- a/engines/titanic/npcs/true_talk_manager.cpp
+++ b/engines/titanic/npcs/true_talk_manager.cpp
@@ -24,7 +24,54 @@
 
 namespace Titanic {
 
+int CTrueTalkManager::_v1;
+int CTrueTalkManager::_v2;
+int CTrueTalkManager::_v3;
+bool CTrueTalkManager::_v4;
+bool CTrueTalkManager::_v5;
+int CTrueTalkManager::_v6;
+int CTrueTalkManager::_v7;
+bool CTrueTalkManager::_v8;
+int CTrueTalkManager::_v9;
+bool CTrueTalkManager::_v10;
+int CTrueTalkManager::_v11[41];
+
 CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : _gameManager(owner) {
 }
 
+void CTrueTalkManager::save(SimpleFile *file) const {
+
+}
+
+void CTrueTalkManager::load(SimpleFile *file) {
+	loadStatics(file);
+
+	int count = file->readNumber();
+	//TODO
+}
+
+void CTrueTalkManager::loadStatics(SimpleFile *file) {
+	int count = file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+	_v3 = file->readNumber();
+	_v4 = file->readNumber() != 0;
+	_v5 = file->readNumber() != 0;
+	_v6 = file->readNumber();
+	_v7 = file->readNumber();
+	_v8 = file->readNumber() != 0;
+	_v9 = file->readNumber();
+	_v10 = file->readNumber() != 0;
+
+	for (int idx = count; count > 10; --idx)
+		file->readNumber();
+
+	int count2 = file->readNumber();
+	for (int idx = 0; idx < count2; ++idx) {
+		int v = file->readNumber();
+		if (idx < 41)
+			_v11[idx] = v;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/true_talk_manager.h b/engines/titanic/npcs/true_talk_manager.h
index decc593..d491a61 100644
--- a/engines/titanic/npcs/true_talk_manager.h
+++ b/engines/titanic/npcs/true_talk_manager.h
@@ -23,15 +23,41 @@
 #ifndef TITANIC_TRUE_TALK_MANAGER_H
 #define TITANIC_TRUE_TALK_MANAGER_H
 
+#include "titanic/simple_file.h"
+
 namespace Titanic {
 
 class CGameManager;
 
 class CTrueTalkManager {
+private:
+	void loadStatics(SimpleFile *file);
+public:
+	static int _v1;
+	static int _v2;
+	static int _v3;
+	static bool _v4;
+	static bool _v5;
+	static int _v6;
+	static int _v7;
+	static bool _v8;
+	static int _v9;
+	static bool _v10;
+	static int _v11[41];
 public:
 	CGameManager *_gameManager;
 public:
 	CTrueTalkManager(CGameManager *owner);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	void save(SimpleFile *file) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	void load(SimpleFile *file);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 145ba43..47e5d3d 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -126,7 +126,8 @@ void OSScreenManager::proc20() {}
 void OSScreenManager::proc21() {}
 
 CVideoSurface *OSScreenManager::createSurface(int w, int h) {
-	error("TODO");
+	warning("TODO");
+	return nullptr;
 }
 
 void OSScreenManager::proc23() {}
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index c0fd9fe..cea377e 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -27,4 +27,12 @@ namespace Titanic {
 CSound::CSound(CGameManager *owner) : _gameManager(owner) {
 }
 
+void CSound::save(SimpleFile *file) const {
+
+}
+
+void CSound::load(SimpleFile *file) {
+
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index d9db819..2d0ccec 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -23,6 +23,8 @@
 #ifndef TITANIC_SOUND_H
 #define TITANIC_SOUND_H
 
+#include "titanic/simple_file.h"
+
 namespace Titanic {
 
 class CGameManager;
@@ -32,6 +34,16 @@ public:
 	CGameManager *_gameManager;
 public:
 	CSound(CGameManager *owner);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	void save(SimpleFile *file) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	void load(SimpleFile *file);
 };
 
 } // End of namespace Titanic


Commit: e68e8334ed1d0516d68e19a716ca0feeed6c3de1
    https://github.com/scummvm/scummvm/commit/e68e8334ed1d0516d68e19a716ca0feeed6c3de1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-11T22:55:14-05:00

Commit Message:
TITANIC: Beginnings of True Talk scripts hierarchy

Changed paths:
  A engines/titanic/true_talk/true_talk_manager.cpp
  A engines/titanic/true_talk/true_talk_manager.h
  A engines/titanic/true_talk/tt_named_script.cpp
  A engines/titanic/true_talk/tt_named_script.h
  A engines/titanic/true_talk/tt_script_base.cpp
  A engines/titanic/true_talk/tt_script_base.h
  A engines/titanic/true_talk/tt_scripts.cpp
  A engines/titanic/true_talk/tt_scripts.h
  A engines/titanic/true_talk/tt_string.cpp
  A engines/titanic/true_talk/tt_string.h
  A engines/titanic/true_talk/tt_unnamed_script.cpp
  A engines/titanic/true_talk/tt_unnamed_script.h
  R engines/titanic/npcs/true_talk_manager.cpp
  R engines/titanic/npcs/true_talk_manager.h
    engines/titanic/game_manager.h
    engines/titanic/module.mk



diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 200f34f..37a4a41 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -29,7 +29,7 @@
 #include "titanic/input_translator.h"
 #include "titanic/simple_file.h"
 #include "titanic/video_surface.h"
-#include "titanic/npcs/true_talk_manager.h"
+#include "titanic/true_talk/true_talk_manager.h"
 #include "titanic/sound/music_room.h"
 #include "titanic/sound/sound.h"
 
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index b150ba2..8a248d1 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -368,7 +368,6 @@ MODULE_OBJS := \
 	npcs/succubus.o \
 	npcs/summon_bots.o \
 	npcs/titania.o \
-	npcs/true_talk_manager.o \
 	npcs/true_talk_npc.o \
 	pet_control/pet_control.o \
 	pet_control/pet_control_list_item.o \
@@ -424,7 +423,13 @@ MODULE_OBJS := \
 	star_control/star_control_sub12.o \
 	star_control/star_control_sub13.o \
 	star_control/star_control_sub14.o \
-	star_control/star_control_sub15.o
+	star_control/star_control_sub15.o \
+	true_talk/true_talk_manager.o \
+	true_talk/tt_script_base.o \
+	true_talk/tt_unnamed_script.o \
+	true_talk/tt_named_script.o \
+	true_talk/tt_scripts.o \
+	true_talk/tt_string.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/npcs/true_talk_manager.cpp b/engines/titanic/npcs/true_talk_manager.cpp
deleted file mode 100644
index dbf9712..0000000
--- a/engines/titanic/npcs/true_talk_manager.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/npcs/true_talk_manager.h"
-
-namespace Titanic {
-
-int CTrueTalkManager::_v1;
-int CTrueTalkManager::_v2;
-int CTrueTalkManager::_v3;
-bool CTrueTalkManager::_v4;
-bool CTrueTalkManager::_v5;
-int CTrueTalkManager::_v6;
-int CTrueTalkManager::_v7;
-bool CTrueTalkManager::_v8;
-int CTrueTalkManager::_v9;
-bool CTrueTalkManager::_v10;
-int CTrueTalkManager::_v11[41];
-
-CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : _gameManager(owner) {
-}
-
-void CTrueTalkManager::save(SimpleFile *file) const {
-
-}
-
-void CTrueTalkManager::load(SimpleFile *file) {
-	loadStatics(file);
-
-	int count = file->readNumber();
-	//TODO
-}
-
-void CTrueTalkManager::loadStatics(SimpleFile *file) {
-	int count = file->readNumber();
-	_v1 = file->readNumber();
-	_v2 = file->readNumber();
-	_v3 = file->readNumber();
-	_v4 = file->readNumber() != 0;
-	_v5 = file->readNumber() != 0;
-	_v6 = file->readNumber();
-	_v7 = file->readNumber();
-	_v8 = file->readNumber() != 0;
-	_v9 = file->readNumber();
-	_v10 = file->readNumber() != 0;
-
-	for (int idx = count; count > 10; --idx)
-		file->readNumber();
-
-	int count2 = file->readNumber();
-	for (int idx = 0; idx < count2; ++idx) {
-		int v = file->readNumber();
-		if (idx < 41)
-			_v11[idx] = v;
-	}
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/npcs/true_talk_manager.h b/engines/titanic/npcs/true_talk_manager.h
deleted file mode 100644
index d491a61..0000000
--- a/engines/titanic/npcs/true_talk_manager.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_TRUE_TALK_MANAGER_H
-#define TITANIC_TRUE_TALK_MANAGER_H
-
-#include "titanic/simple_file.h"
-
-namespace Titanic {
-
-class CGameManager;
-
-class CTrueTalkManager {
-private:
-	void loadStatics(SimpleFile *file);
-public:
-	static int _v1;
-	static int _v2;
-	static int _v3;
-	static bool _v4;
-	static bool _v5;
-	static int _v6;
-	static int _v7;
-	static bool _v8;
-	static int _v9;
-	static bool _v10;
-	static int _v11[41];
-public:
-	CGameManager *_gameManager;
-public:
-	CTrueTalkManager(CGameManager *owner);
-
-	/**
-	 * Save the data for the class to file
-	 */
-	void save(SimpleFile *file) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_TRUE_TALK_MANAGER_H */
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
new file mode 100644
index 0000000..aeaa677
--- /dev/null
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -0,0 +1,77 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/true_talk_manager.h"
+
+namespace Titanic {
+
+int CTrueTalkManager::_v1;
+int CTrueTalkManager::_v2;
+int CTrueTalkManager::_v3;
+bool CTrueTalkManager::_v4;
+bool CTrueTalkManager::_v5;
+int CTrueTalkManager::_v6;
+int CTrueTalkManager::_v7;
+bool CTrueTalkManager::_v8;
+int CTrueTalkManager::_v9;
+bool CTrueTalkManager::_v10;
+int CTrueTalkManager::_v11[41];
+
+CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : _gameManager(owner) {
+}
+
+void CTrueTalkManager::save(SimpleFile *file) const {
+
+}
+
+void CTrueTalkManager::load(SimpleFile *file) {
+	loadStatics(file);
+
+	int count = file->readNumber();
+	//TODO
+}
+
+void CTrueTalkManager::loadStatics(SimpleFile *file) {
+	int count = file->readNumber();
+	_v1 = file->readNumber();
+	_v2 = file->readNumber();
+	_v3 = file->readNumber();
+	_v4 = file->readNumber() != 0;
+	_v5 = file->readNumber() != 0;
+	_v6 = file->readNumber();
+	_v7 = file->readNumber();
+	_v8 = file->readNumber() != 0;
+	_v9 = file->readNumber();
+	_v10 = file->readNumber() != 0;
+
+	for (int idx = count; count > 10; --idx)
+		file->readNumber();
+
+	int count2 = file->readNumber();
+	for (int idx = 0; idx < count2; ++idx) {
+		int v = file->readNumber();
+		if (idx < 41)
+			_v11[idx] = v;
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
new file mode 100644
index 0000000..b61bc3d
--- /dev/null
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -0,0 +1,67 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TRUE_TALK_MANAGER_H
+#define TITANIC_TRUE_TALK_MANAGER_H
+
+#include "titanic/simple_file.h"
+#include "titanic/true_talk/tt_scripts.h"
+
+namespace Titanic {
+
+class CGameManager;
+
+class CTrueTalkManager {
+private:
+	void loadStatics(SimpleFile *file);
+public:
+	static int _v1;
+	static int _v2;
+	static int _v3;
+	static bool _v4;
+	static bool _v5;
+	static int _v6;
+	static int _v7;
+	static bool _v8;
+	static int _v9;
+	static bool _v10;
+	static int _v11[41];
+public:
+	CGameManager *_gameManager;
+	TTScripts _scripts;
+public:
+	CTrueTalkManager(CGameManager *owner);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	void save(SimpleFile *file) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TRUE_TALK_MANAGER_H */
diff --git a/engines/titanic/true_talk/tt_named_script.cpp b/engines/titanic/true_talk/tt_named_script.cpp
new file mode 100644
index 0000000..6f12012
--- /dev/null
+++ b/engines/titanic/true_talk/tt_named_script.cpp
@@ -0,0 +1,171 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/tt_named_script.h"
+
+namespace Titanic {
+
+TTNamedScriptBase::TTNamedScriptBase(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTScriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
+		_val1(val1), _field54(0), _val2(val2) {
+}
+
+/*------------------------------------------------------------------------*/
+
+TTNamedScript::TTNamedScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTNamedScriptBase(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
+
+}
+
+void TTNamedScript::proc4(int v) {
+	warning("TODO");
+}
+
+int TTNamedScript::proc6() const {
+	return 1;
+}
+
+void TTNamedScript::proc7(int v1, int v2) {
+	warning("TODO");
+}
+
+int TTNamedScript::proc8() const {
+	return 0;
+}
+
+int TTNamedScript::proc9() const {
+	return 2;
+}
+
+int TTNamedScript::proc10() const {
+	return 2;
+}
+
+int TTNamedScript::proc11() const {
+	return 2;
+}
+
+int TTNamedScript::proc12() const {
+	return 1;
+}
+
+void TTNamedScript::proc13() const {
+	warning("TODO");
+}
+
+void TTNamedScript::proc14(int v) {
+	warning("TODO");
+}
+
+int TTNamedScript::proc15() const {
+	return 0;
+}
+
+int TTNamedScript::proc16() const {
+	return 1;
+}
+
+int TTNamedScript::proc17() const {
+	return 1;
+}
+
+int TTNamedScript::proc18() const {
+	return 1;
+}
+
+void TTNamedScript::proc19(int v) {
+	warning("TODO");
+}
+
+void TTNamedScript::proc20(int v) {
+	warning("TODO");
+}
+
+int TTNamedScript::proc21(int v) {
+	return v;
+}
+
+int TTNamedScript::proc22() const {
+	return 0;
+}
+
+int TTNamedScript::proc23() const {
+	return 0;
+}
+
+int TTNamedScript::proc25() const {
+	return 0;
+}
+
+void TTNamedScript::proc26() {
+}
+
+void TTNamedScript::save1(SimpleFile *file) {
+	error("TODO");
+}
+
+void TTNamedScript::proc28(int v) {
+	warning("TODO");
+}
+
+void TTNamedScript::save2(SimpleFile *file) {
+	error("TODO");
+}
+
+void TTNamedScript::proc30(int v) {
+	warning("TODO");
+}
+
+void TTNamedScript::proc31() {
+	warning("TODO");
+}
+
+void TTNamedScript::proc32() {
+	warning("TODO");
+}
+
+void TTNamedScript::proc33(int v1, int v2) {
+	warning("TODO");
+}
+
+int TTNamedScript::proc34() {
+	warning("TODO");
+	return 0;
+}
+
+int TTNamedScript::proc35(int v1, int v2) {
+	warning("TODO");
+	return 0;
+}
+
+int TTNamedScript::proc36() const {
+	return 0;
+}
+
+int TTNamedScript::proc37() const {
+	return 0;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_named_script.h b/engines/titanic/true_talk/tt_named_script.h
new file mode 100644
index 0000000..cdff448
--- /dev/null
+++ b/engines/titanic/true_talk/tt_named_script.h
@@ -0,0 +1,104 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_NAMED_SCRIPT_H
+#define TITANIC_TT_NAMED_SCRIPT_H
+
+#include "titanic/simple_file.h"
+#include "titanic/true_talk/tt_script_base.h"
+
+namespace Titanic {
+
+
+class TTNamedScriptBase : public TTScriptBase {
+protected:
+	int _val1;
+	int _field54;
+	int _val2;
+public:
+	TTNamedScriptBase(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4,
+		int v5, int v6, int v7);
+
+	virtual void proc6() = 0;
+	virtual void proc7() = 0;
+	virtual void proc8() = 0;
+	virtual void proc9() = 0;
+	virtual void proc10() = 0;
+	virtual void proc11() = 0;
+	virtual void proc12() = 0;
+};
+class TTNamedScript : public TTNamedScriptBase {
+private:
+	int _field5C;
+	int _field60;
+	int _field64;
+	int _field68;
+	int _field6C;
+	int _field70;
+	int _field74;
+	int _field78;
+	int _field7C;
+	int _field80;
+public:
+	TTNamedScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4,
+		int v5, int v6, int v7);
+
+	virtual void proc4(int v);
+	virtual int proc6() const;
+	virtual void proc7(int v1, int v2);
+	virtual int proc8() const;
+	virtual int proc9() const;
+	virtual int proc10() const;
+	virtual int proc11() const;
+	virtual int proc12() const;
+	virtual void proc13() const;
+	virtual void proc14(int v);
+	virtual int proc15() const;
+	virtual int proc16() const;
+	virtual int proc17() const;
+	virtual int proc18() const;
+	virtual void proc19(int v);
+	virtual void proc20(int v);
+	virtual int proc21(int v);
+	virtual int proc22() const;
+	virtual int proc23() const;
+	virtual void proc24() = 0;
+	virtual int proc25() const;
+	virtual void proc26();
+	virtual void save1(SimpleFile *file);
+	virtual void proc28(int v);
+	virtual void save2(SimpleFile *file);
+	virtual void proc30(int v);
+	virtual void proc31();
+	virtual void proc32();
+	virtual void proc33(int v1, int v2);
+	virtual int proc34();
+	virtual int proc35(int v1, int v2);
+	virtual int proc36() const;
+	virtual int proc37() const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_CHARACTER1_H */
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
new file mode 100644
index 0000000..1430f03
--- /dev/null
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -0,0 +1,92 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/tt_script_base.h"
+
+namespace Titanic {
+
+TTScriptBase::TTScriptBase(int v1, const char *charClass, int v2,
+		const char *charName, int v3, int v4, int v5, int v6, int v7) :
+		_charName(charName), _charClass(charClass), 
+		_field4(0), _field8(0), _fieldC(0),
+		_field20(0), _field24(0), _field28(0), _field2C(0),
+		_field30(0), _field34(0), _field38(0), _field3C(0),
+		_field40(0), _field44(0), _field48(0), _status(0) {
+	if (!areNamesValid()) {
+		if (!v7 || !getStatus()) {
+			_field8 = v1;
+			_field20 = v3;
+			_field24 = v4;
+			_field28 = v5;
+			_field2C = v6;
+			_field30 = v7;
+			_field34 = v2;
+		} else {
+			_status = 5;
+		}
+	}
+
+	if (_status)
+		reset();
+}
+
+bool TTScriptBase::areNamesValid() {
+	bool result = !_charName.isValid() && !_charClass.isValid();
+	_status = result ? 0 : 11;
+	return result;
+}
+
+void TTScriptBase::reset() {
+	_field4 = 0;
+	_field8 = 4;
+	_fieldC = 0;
+	_field20 = 0;
+	_field24 = -1;
+	_field28 = -1;
+	_field2C = -1;
+	_field30 = 0;
+	_field34 = 0;
+	_field38 = 0;
+	_field3C = 0;
+	_field40 = 0;
+	_field44 = 0;
+	_field48 = 0;
+}
+
+void TTScriptBase::proc2(int v) {
+	warning("TODO");
+}
+
+void TTScriptBase::proc3(int v) {
+	warning("TODO");
+}
+
+void TTScriptBase::proc4(int v) {
+	warning("TODO");
+}
+
+void TTScriptBase::proc5() {
+	warning("TODO");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
new file mode 100644
index 0000000..4021a0b
--- /dev/null
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -0,0 +1,70 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_SCRIPT_BASE_H
+#define TITANIC_TT_SCRIPT_BASE_H
+
+#include "titanic/true_talk/tt_string.h"
+
+namespace Titanic {
+
+class TTScriptBase {
+private:
+	void reset();
+protected:
+	int _field4;
+	int _field8;
+	int _fieldC;
+	TTString _charName, _charClass;
+	int _field20;
+	int _field24;
+	int _field28;
+	int _field2C;
+	int _field30;
+	int _field34;
+	int _field38;
+	int _field3C;
+	int _field40;
+	int _field44;
+	int _field48;
+	int _status;
+public:
+	TTScriptBase(int v1, const char *charClass, int v2, const char *charName,
+		int v3, int v4, int v5, int v6, int v7);
+
+	bool areNamesValid();
+
+	int getStatus() const { return _status; }
+
+	virtual void proc2(int v);
+
+	virtual void proc3(int v);
+
+	virtual void proc4(int v);
+
+	virtual void proc5();
+};
+
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_SCRIPT_BASE_H */
diff --git a/engines/titanic/true_talk/tt_scripts.cpp b/engines/titanic/true_talk/tt_scripts.cpp
new file mode 100644
index 0000000..52368ad
--- /dev/null
+++ b/engines/titanic/true_talk/tt_scripts.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_scripts.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_scripts.h b/engines/titanic/true_talk/tt_scripts.h
new file mode 100644
index 0000000..b87a7c2
--- /dev/null
+++ b/engines/titanic/true_talk/tt_scripts.h
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_SCRIPTS_H
+#define TITANIC_TT_SCRIPTS_H
+
+namespace Titanic {
+
+class TTScripts {
+public:
+	TTScripts() {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_CHARACTERS_H */
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
new file mode 100644
index 0000000..f9ae5d6
--- /dev/null
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_string.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
new file mode 100644
index 0000000..8f42e62
--- /dev/null
+++ b/engines/titanic/true_talk/tt_string.h
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_STRING_H
+#define TITANIC_TT_STRING_H
+
+#include "titanic/string.h"
+
+namespace Titanic {
+
+class TTString: public CString {
+public:
+	int _status;
+public:
+	TTString() : CString(), _status(0) {}
+	TTString(const char *str) : CString(str), _status(0) {}
+	~TTString();
+
+	bool isValid() const { return !_status; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_OBJ8_H */
diff --git a/engines/titanic/true_talk/tt_unnamed_script.cpp b/engines/titanic/true_talk/tt_unnamed_script.cpp
new file mode 100644
index 0000000..8c91290
--- /dev/null
+++ b/engines/titanic/true_talk/tt_unnamed_script.cpp
@@ -0,0 +1,64 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/tt_unnamed_script.h"
+
+namespace Titanic {
+
+TTUnnamedScriptBase::TTUnnamedScriptBase(int scriptId,
+		const char *charClass, const char *charName,
+		int v3, int v4, int v5, int v6, int v2, int v7) : _scriptId(scriptId),
+		TTScriptBase(3, charClass, v2, charName, v3, v4, v5, v6, v7) {
+}
+
+/*------------------------------------------------------------------------*/
+
+TTUnnamedScript::TTUnnamedScript(int scriptId) :
+	TTUnnamedScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) {
+}
+
+void TTUnnamedScript::proc6() {
+	warning("TODO");
+}
+
+void TTUnnamedScript::proc7() {
+	warning("TODO");
+}
+
+void TTUnnamedScript::proc8() {
+	warning("TODO");
+}
+
+void TTUnnamedScript::proc9() {
+	warning("TODO");
+}
+
+void TTUnnamedScript::proc10() {
+	warning("TODO");
+}
+
+void TTUnnamedScript::proc11() {
+	warning("TODO");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_unnamed_script.h b/engines/titanic/true_talk/tt_unnamed_script.h
new file mode 100644
index 0000000..f470216
--- /dev/null
+++ b/engines/titanic/true_talk/tt_unnamed_script.h
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_UNNAMED_SCRIPT_H
+#define TITANIC_TT_UNNAMED_SCRIPT_H
+
+#include "titanic/true_talk/tt_script_base.h"
+
+namespace Titanic {
+
+class TTUnnamedScriptBase : public TTScriptBase {
+protected:
+	int _scriptId;
+public:
+	TTUnnamedScriptBase(int scriptId, const char *charClass, const char *charName,
+		int v3, int v4, int v5, int v6, int v2, int v7);
+
+	virtual void proc6() = 0;
+	virtual void proc7() = 0;
+	virtual void proc8() = 0;
+	virtual void proc9() = 0;
+	virtual void proc10() = 0;
+	virtual void proc11() = 0;
+};
+
+
+class TTUnnamedScript : public TTUnnamedScriptBase {
+private:
+	int _field54;
+public:
+	TTUnnamedScript(int scriptId);
+
+	virtual void proc6();
+	virtual void proc7();
+	virtual void proc8();
+	virtual void proc9();
+	virtual void proc10();
+	virtual void proc11();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_UNNAMED_SCRIPT_H */


Commit: c0de794584e1e4689db48eb1c94dc9d9aa7726c7
    https://github.com/scummvm/scummvm/commit/c0de794584e1e4689db48eb1c94dc9d9aa7726c7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-12T07:59:44-05:00

Commit Message:
TITANIC: Added stubs for the different script classes

Changed paths:
  A engines/titanic/true_talk/barbot_script.cpp
  A engines/titanic/true_talk/barbot_script.h
  A engines/titanic/true_talk/bellbot_script.cpp
  A engines/titanic/true_talk/bellbot_script.h
  A engines/titanic/true_talk/deskbot_script.cpp
  A engines/titanic/true_talk/deskbot_script.h
  A engines/titanic/true_talk/doorbot_script.cpp
  A engines/titanic/true_talk/doorbot_script.h
  A engines/titanic/true_talk/liftbot_script.cpp
  A engines/titanic/true_talk/liftbot_script.h
  A engines/titanic/true_talk/maitred_script.cpp
  A engines/titanic/true_talk/maitred_script.h
  A engines/titanic/true_talk/parrot_script.cpp
  A engines/titanic/true_talk/parrot_script.h
  A engines/titanic/true_talk/succubus_script.cpp
  A engines/titanic/true_talk/succubus_script.h
  A engines/titanic/true_talk/title_engine.cpp
  A engines/titanic/true_talk/title_engine.h
    engines/titanic/core/list.h
    engines/titanic/module.mk
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_named_script.cpp
    engines/titanic/true_talk/tt_named_script.h
    engines/titanic/true_talk/tt_scripts.cpp
    engines/titanic/true_talk/tt_scripts.h
    engines/titanic/true_talk/tt_string.h



diff --git a/engines/titanic/core/list.h b/engines/titanic/core/list.h
index 312405d..e3623c1 100644
--- a/engines/titanic/core/list.h
+++ b/engines/titanic/core/list.h
@@ -48,6 +48,26 @@ public:
 	virtual void load(SimpleFile *file);
 };
 
+/**
+ * List item macro for managed pointers an item
+ */
+#define PTR_LIST_ITEM(T) class T##ListItem : public ListItem { \
+	public: T *_item; \
+	T##ListItem() : _item(nullptr) {} \
+	T##ListItem(T *item) : _item(item) {} \
+	virtual ~T##ListItem() { delete _item; } \
+	}
+
+template<typename T>
+class PtrListItem : public ListItem {
+public:
+	T *_item;
+public:
+	PtrListItem() : _item(nullptr) {}
+	PtrListItem(T *item) : _item(item) {}
+	virtual ~PtrListItem() { delete _item; }
+};
+
 template<typename T>
 class List : public CSaveableObject, public Common::List<T *> {
 public:
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 8a248d1..bfb9317 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -424,6 +424,15 @@ MODULE_OBJS := \
 	star_control/star_control_sub13.o \
 	star_control/star_control_sub14.o \
 	star_control/star_control_sub15.o \
+	true_talk/barbot_script.o \
+	true_talk/bellbot_script.o \
+	true_talk/deskbot_script.o \
+	true_talk/doorbot_script.o \
+	true_talk/liftbot_script.o \
+	true_talk/maitred_script.o \
+	true_talk/parrot_script.o \
+	true_talk/succubus_script.o \
+	true_talk/title_engine.o \
 	true_talk/true_talk_manager.o \
 	true_talk/tt_script_base.o \
 	true_talk/tt_unnamed_script.o \
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
new file mode 100644
index 0000000..a9a0be1
--- /dev/null
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -0,0 +1,103 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/barbot_script.h"
+
+namespace Titanic {
+
+int BarbotScript::proc6() const {
+	warning("TODO");
+	return 2;
+}
+
+void BarbotScript::proc7(int v1, int v2) {
+	warning("TODO");
+}
+
+int BarbotScript::proc10() const {
+	warning("TODO");
+	return 0;
+}
+
+int BarbotScript::proc15() const {
+	warning("TODO");
+	return 0;
+}
+
+int BarbotScript::proc16() const {
+	warning("TODO");
+	return 0;
+}
+
+int BarbotScript::proc17() const {
+	warning("TODO");
+	return 0;
+}
+
+int BarbotScript::proc18() const {
+	warning("TODO");
+	return 0;
+}
+
+int BarbotScript::proc21(int v) {
+	warning("TODO");
+	return 0;
+}
+
+int BarbotScript::proc22() const {
+	warning("TODO");
+	return 0;
+}
+
+int BarbotScript::proc23() const {
+	warning("TODO");
+	return 0;
+}
+
+void BarbotScript::proc24() {
+	warning("TODO");
+}
+
+int BarbotScript::proc25() const {
+	warning("TODO");
+	return 0;
+}
+
+void BarbotScript::proc26() {
+}
+
+void BarbotScript::proc32() {
+	warning("TODO");
+}
+
+int BarbotScript::proc36() const {
+	warning("TODO");
+	return 0;
+}
+
+int BarbotScript::proc37() const {
+	warning("TODO");
+	return 0;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
new file mode 100644
index 0000000..f40c67d
--- /dev/null
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BARBOT_SCRIPT_H
+#define TITANIC_BARBOT_SCRIPT_H
+
+#include "titanic/true_talk/tt_named_script.h"
+
+namespace Titanic {
+
+class BarbotScript : public TTNamedScript {
+public:
+	BarbotScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTNamedScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+
+	virtual int proc6() const;
+	virtual void proc7(int v1, int v2);
+	virtual int proc10() const;
+	virtual int proc15() const;
+	virtual int proc16() const;
+	virtual int proc17() const;
+	virtual int proc18() const;
+	virtual int proc21(int v);
+	virtual int proc22() const;
+	virtual int proc23() const;
+	virtual void proc24();
+	virtual int proc25() const;
+	virtual void proc26();
+	virtual void proc32();
+	virtual int proc36() const;
+	virtual int proc37() const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BARBOT_SCRIPT_H */
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
new file mode 100644
index 0000000..a296752
--- /dev/null
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -0,0 +1,114 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/bellbot_script.h"
+#include "titanic/true_talk/true_talk_manager.h"
+
+namespace Titanic {
+
+BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2) :
+		TTNamedScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
+		_field2D0(0), _field2D4(0), _field2D8(0), _field2DC(0) {
+	CTrueTalkManager::setFlags(25, 0);
+	CTrueTalkManager::setFlags(24, 0);
+	CTrueTalkManager::setFlags(40, 0);
+	CTrueTalkManager::setFlags(26, 0);
+
+	randomizeFlags();
+	_array[0] = 100;
+	_array[1] = 0;
+}
+
+int BellbotScript::proc6() const {
+	warning("TODO");
+	return 2;
+}
+
+void BellbotScript::proc7(int v1, int v2) {
+	warning("TODO");
+}
+
+int BellbotScript::proc10() const {
+	warning("TODO");
+	return 0;
+}
+
+int BellbotScript::proc15() const {
+	warning("TODO");
+	return 0;
+}
+
+int BellbotScript::proc16() const {
+	warning("TODO");
+	return 0;
+}
+
+int BellbotScript::proc17() const {
+	warning("TODO");
+	return 0;
+}
+
+int BellbotScript::proc18() const {
+	warning("TODO");
+	return 0;
+}
+
+int BellbotScript::proc21(int v) {
+	warning("TODO");
+	return 0;
+}
+
+int BellbotScript::proc22() const {
+	warning("TODO");
+	return 0;
+}
+
+int BellbotScript::proc23() const {
+	warning("TODO");
+	return 0;
+}
+
+void BellbotScript::proc24() {
+	warning("TODO");
+}
+
+int BellbotScript::proc25() const {
+	warning("TODO");
+	return 0;
+}
+
+void BellbotScript::proc26() {
+}
+
+int BellbotScript::proc36() const {
+	warning("TODO");
+	return 0;
+}
+
+int BellbotScript::proc37() const {
+	warning("TODO");
+	return 0;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
new file mode 100644
index 0000000..e792d16
--- /dev/null
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_BELLBOT_SCRIPT_H
+#define TITANIC_BELLBOT_SCRIPT_H
+
+#include "titanic/true_talk/tt_named_script.h"
+
+namespace Titanic {
+
+class BellbotScript : public TTNamedScript {
+private:
+	int _array[150];
+	int _field2D0;
+	int _field2D4;
+	int _field2D8;
+	int _field2DC;
+public:
+	BellbotScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2);
+
+	virtual int proc6() const;
+	virtual void proc7(int v1, int v2);
+	virtual int proc10() const;
+	virtual int proc15() const;
+	virtual int proc16() const;
+	virtual int proc17() const;
+	virtual int proc18() const;
+	virtual int proc21(int v);
+	virtual int proc22() const;
+	virtual int proc23() const;
+	virtual void proc24();
+	virtual int proc25() const;
+	virtual void proc26();
+	virtual int proc36() const;
+	virtual int proc37() const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_BELLBOT_SCRIPT_H */
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
new file mode 100644
index 0000000..b79714e
--- /dev/null
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -0,0 +1,131 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/deskbot_script.h"
+#include "titanic/true_talk/true_talk_manager.h"
+
+namespace Titanic {
+
+DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2) :
+		TTNamedScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
+	CTrueTalkManager::setFlags(18, 0);
+	CTrueTalkManager::setFlags(19, 0);
+	CTrueTalkManager::setFlags(20, 0);
+	CTrueTalkManager::setFlags(21, 0);
+	CTrueTalkManager::setFlags(22, 0);
+
+	randomizeFlags();
+	_array[0] = 100;
+	if (_field74 == 1)
+		_field74 = 0;
+}
+
+int DeskbotScript::proc6() const {
+	warning("TODO");
+	return 2;
+}
+
+void DeskbotScript::proc7(int v1, int v2) {
+	warning("TODO");
+}
+
+int DeskbotScript::proc10() const {
+	warning("TODO");
+	return 0;
+}
+
+int DeskbotScript::proc15() const {
+	warning("TODO");
+	return 0;
+}
+
+int DeskbotScript::proc16() const {
+	warning("TODO");
+	return 0;
+}
+
+int DeskbotScript::proc17() const {
+	warning("TODO");
+	return 0;
+}
+
+int DeskbotScript::proc18() const {
+	warning("TODO");
+	return 0;
+}
+
+int DeskbotScript::proc21(int v) {
+	warning("TODO");
+	return 0;
+}
+
+int DeskbotScript::proc22() const {
+	warning("TODO");
+	return 0;
+}
+
+int DeskbotScript::proc23() const {
+	warning("TODO");
+	return 0;
+}
+
+void DeskbotScript::proc24() {
+	warning("TODO");
+}
+
+int DeskbotScript::proc25() const {
+	warning("TODO");
+	return 0;
+}
+
+void DeskbotScript::proc26() {
+}
+
+int DeskbotScript::proc36() const {
+	warning("TODO");
+	return 0;
+}
+
+int DeskbotScript::proc37() const {
+	warning("TODO");
+	return 0;
+}
+
+void DeskbotScript::proc38() {
+	warning("TODO");
+}
+
+void DeskbotScript::proc39() {
+	warning("TODO");
+}
+
+void DeskbotScript::proc40() {
+	warning("TODO");
+}
+
+void DeskbotScript::proc41() {
+	warning("TODO");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
new file mode 100644
index 0000000..c40aca9
--- /dev/null
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DESKBOT_SCRIPT_H
+#define TITANIC_DESKBOT_SCRIPT_H
+
+#include "titanic/true_talk/tt_named_script.h"
+
+namespace Titanic {
+
+class DeskbotScript : public TTNamedScript {
+public:
+	DeskbotScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2);
+
+	virtual int proc6() const;
+	virtual void proc7(int v1, int v2);
+	virtual int proc10() const;
+	virtual int proc15() const;
+	virtual int proc16() const;
+	virtual int proc17() const;
+	virtual int proc18() const;
+	virtual int proc21(int v);
+	virtual int proc22() const;
+	virtual int proc23() const;
+	virtual void proc24();
+	virtual int proc25() const;
+	virtual void proc26();
+	virtual int proc36() const;
+	virtual int proc37() const;
+
+	virtual void proc38();
+	virtual void proc39();
+	virtual void proc40();
+	virtual void proc41();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DESKBOT_SCRIPT_H */
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
new file mode 100644
index 0000000..4bca9a6
--- /dev/null
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -0,0 +1,103 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/doorbot_script.h"
+
+namespace Titanic {
+
+int DoorbotScript::proc6() const {
+	warning("TODO");
+	return 2;
+}
+
+void DoorbotScript::proc7(int v1, int v2) {
+	warning("TODO");
+}
+
+int DoorbotScript::proc10() const {
+	warning("TODO");
+	return 0;
+}
+
+int DoorbotScript::proc15() const {
+	warning("TODO");
+	return 0;
+}
+
+int DoorbotScript::proc16() const {
+	warning("TODO");
+	return 0;
+}
+
+int DoorbotScript::proc17() const {
+	warning("TODO");
+	return 0;
+}
+
+int DoorbotScript::proc18() const {
+	warning("TODO");
+	return 0;
+}
+
+int DoorbotScript::proc21(int v) {
+	warning("TODO");
+	return 0;
+}
+
+int DoorbotScript::proc22() const {
+	warning("TODO");
+	return 0;
+}
+
+int DoorbotScript::proc23() const {
+	warning("TODO");
+	return 0;
+}
+
+void DoorbotScript::proc24() {
+	warning("TODO");
+}
+
+int DoorbotScript::proc25() const {
+	warning("TODO");
+	return 0;
+}
+
+void DoorbotScript::proc26() {
+}
+
+void DoorbotScript::proc32() {
+	warning("TODO");
+}
+
+int DoorbotScript::proc36() const {
+	warning("TODO");
+	return 0;
+}
+
+int DoorbotScript::proc37() const {
+	warning("TODO");
+	return 0;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
new file mode 100644
index 0000000..5494760
--- /dev/null
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DOORBOT_SCRIPT_H
+#define TITANIC_DOORBOT_SCRIPT_H
+
+#include "titanic/true_talk/tt_named_script.h"
+
+namespace Titanic {
+
+class DoorbotScript : public TTNamedScript {
+private:
+	int _array[148];
+public:
+	DoorbotScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTNamedScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+
+	virtual int proc6() const;
+	virtual void proc7(int v1, int v2);
+	virtual int proc10() const;
+	virtual int proc15() const;
+	virtual int proc16() const;
+	virtual int proc17() const;
+	virtual int proc18() const;
+	virtual int proc21(int v);
+	virtual int proc22() const;
+	virtual int proc23() const;
+	virtual void proc24();
+	virtual int proc25() const;
+	virtual void proc26();
+	virtual void proc32();
+	virtual int proc36() const;
+	virtual int proc37() const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_CHARACTER1_H */
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
new file mode 100644
index 0000000..4bd994f
--- /dev/null
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -0,0 +1,103 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/liftbot_script.h"
+
+namespace Titanic {
+
+int LiftbotScript::proc6() const {
+	warning("TODO");
+	return 2;
+}
+
+void LiftbotScript::proc7(int v1, int v2) {
+	warning("TODO");
+}
+
+int LiftbotScript::proc9() const {
+	warning("TODO");
+	return 0;
+}
+
+int LiftbotScript::proc10() const {
+	warning("TODO");
+	return 0;
+}
+
+int LiftbotScript::proc15() const {
+	warning("TODO");
+	return 0;
+}
+
+int LiftbotScript::proc16() const {
+	warning("TODO");
+	return 0;
+}
+
+int LiftbotScript::proc17() const {
+	warning("TODO");
+	return 0;
+}
+
+int LiftbotScript::proc18() const {
+	warning("TODO");
+	return 0;
+}
+
+int LiftbotScript::proc21(int v) {
+	warning("TODO");
+	return 0;
+}
+
+int LiftbotScript::proc22() const {
+	warning("TODO");
+	return 0;
+}
+
+int LiftbotScript::proc23() const {
+	warning("TODO");
+	return 0;
+}
+
+void LiftbotScript::proc24() {
+	warning("TODO");
+}
+
+int LiftbotScript::proc25() const {
+	warning("TODO");
+	return 0;
+}
+
+void LiftbotScript::proc26() {
+}
+
+void LiftbotScript::proc32() {
+	warning("TODO");
+}
+
+int LiftbotScript::proc37() const {
+	warning("TODO");
+	return 0;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
new file mode 100644
index 0000000..ddbdabb
--- /dev/null
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_LIFTBOT_SCRIPT_H
+#define TITANIC_LIFTBOT_SCRIPT_H
+
+#include "titanic/true_talk/tt_named_script.h"
+
+namespace Titanic {
+
+class LiftbotScript : public TTNamedScript {
+public:
+	LiftbotScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTNamedScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+
+	virtual int proc6() const;
+	virtual void proc7(int v1, int v2);
+	virtual int proc9() const;
+	virtual int proc10() const;
+	virtual int proc15() const;
+	virtual int proc16() const;
+	virtual int proc17() const;
+	virtual int proc18() const;
+	virtual int proc21(int v);
+	virtual int proc22() const;
+	virtual int proc23() const;
+	virtual void proc24();
+	virtual int proc25() const;
+	virtual void proc26();
+	virtual void proc32();
+	virtual int proc37() const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_LIFTBOT_SCRIPT_H */
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
new file mode 100644
index 0000000..1caec62
--- /dev/null
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -0,0 +1,103 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/maitred_script.h"
+#include "titanic/true_talk/true_talk_manager.h"
+
+namespace Titanic {
+
+MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
+	const char *charName, int v3, int val2) :
+	TTNamedScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
+	CTrueTalkManager::setFlags(9, 1);
+	CTrueTalkManager::setFlags(10, 0);
+	CTrueTalkManager::setFlags(11, 0);
+	CTrueTalkManager::setFlags(12, 0);
+	CTrueTalkManager::setFlags(13, 0);
+	CTrueTalkManager::setFlags(14, 0);
+	CTrueTalkManager::setFlags(15, 0);
+	CTrueTalkManager::setFlags(16, 0);
+}
+
+int MaitreDScript::proc6() const {
+	warning("TODO");
+	return 2;
+}
+
+void MaitreDScript::proc7(int v1, int v2) {
+	warning("TODO");
+}
+
+int MaitreDScript::proc10() const {
+	warning("TODO");
+	return 0;
+}
+
+int MaitreDScript::proc16() const {
+	warning("TODO");
+	return 0;
+}
+
+int MaitreDScript::proc17() const {
+	warning("TODO");
+	return 0;
+}
+
+int MaitreDScript::proc18() const {
+	warning("TODO");
+	return 0;
+}
+
+int MaitreDScript::proc21(int v) {
+	warning("TODO");
+	return 0;
+}
+
+int MaitreDScript::proc22() const {
+	warning("TODO");
+	return 0;
+}
+
+int MaitreDScript::proc23() const {
+	warning("TODO");
+	return 0;
+}
+
+void MaitreDScript::proc24() {
+	warning("TODO");
+}
+
+int MaitreDScript::proc25() const {
+	warning("TODO");
+	return 0;
+}
+
+void MaitreDScript::proc26() {
+}
+
+int MaitreDScript::proc37() const {
+	warning("TODO");
+	return 0;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
new file mode 100644
index 0000000..2af3f42
--- /dev/null
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MAITRED_SCRIPT_H
+#define TITANIC_MAITRED_SCRIPT_H
+
+#include "titanic/true_talk/tt_named_script.h"
+
+namespace Titanic {
+
+class MaitreDScript : public TTNamedScript {
+public:
+	MaitreDScript(int val1, const char *charClass, int v2,
+			const char *charName, int v3, int val2);
+
+	virtual int proc6() const;
+	virtual void proc7(int v1, int v2);
+	virtual int proc10() const;
+	virtual int proc16() const;
+	virtual int proc17() const;
+	virtual int proc18() const;
+	virtual int proc21(int v);
+	virtual int proc22() const;
+	virtual int proc23() const;
+	virtual void proc24();
+	virtual int proc25() const;
+	virtual void proc26();
+	virtual int proc37() const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MAITRED_SCRIPT_H */
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
new file mode 100644
index 0000000..9772f21
--- /dev/null
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/parrot_script.h"
+
+namespace Titanic {
+
+int ParrotScript::proc6() const {
+	warning("TODO");
+	return 2;
+}
+
+void ParrotScript::proc7(int v1, int v2) {
+	warning("TODO");
+}
+
+int ParrotScript::proc10() const {
+	warning("TODO");
+	return 0;
+}
+
+int ParrotScript::proc17() const {
+	warning("TODO");
+	return 0;
+}
+
+int ParrotScript::proc18() const {
+	warning("TODO");
+	return 0;
+}
+
+int ParrotScript::proc23() const {
+	warning("TODO");
+	return 0;
+}
+
+void ParrotScript::proc24() {
+	warning("TODO");
+}
+
+int ParrotScript::proc25() const {
+	warning("TODO");
+	return 0;
+}
+
+void ParrotScript::proc26() {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
new file mode 100644
index 0000000..0dde14d
--- /dev/null
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PARROT_SCRIPT_H
+#define TITANIC_PARROT_SCRIPT_H
+
+#include "titanic/true_talk/tt_named_script.h"
+
+namespace Titanic {
+
+class ParrotScript : public TTNamedScript {
+public:
+	ParrotScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTNamedScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+
+	virtual int proc6() const;
+	virtual void proc7(int v1, int v2);
+	virtual int proc10() const;
+	virtual int proc17() const;
+	virtual int proc18() const;
+	virtual int proc23() const;
+	virtual void proc24();
+	virtual int proc25() const;
+	virtual void proc26();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PARROT_SCRIPT_H */
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
new file mode 100644
index 0000000..c21edef
--- /dev/null
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -0,0 +1,74 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/succubus_script.h"
+
+namespace Titanic {
+
+int SuccUBusScript::proc6() const {
+	warning("TODO");
+	return 2;
+}
+
+void SuccUBusScript::proc7(int v1, int v2) {
+	warning("TODO");
+}
+
+int SuccUBusScript::proc10() const {
+	warning("TODO");
+	return 0;
+}
+
+int SuccUBusScript::proc17() const {
+	warning("TODO");
+	return 0;
+}
+
+int SuccUBusScript::proc18() const {
+	warning("TODO");
+	return 0;
+}
+
+int SuccUBusScript::proc21(int v) {
+	warning("TODO");
+	return 0;
+}
+
+int SuccUBusScript::proc23() const {
+	warning("TODO");
+	return 0;
+}
+
+void SuccUBusScript::proc24() {
+	warning("TODO");
+}
+
+int SuccUBusScript::proc25() const {
+	warning("TODO");
+	return 0;
+}
+
+void SuccUBusScript::proc26() {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
new file mode 100644
index 0000000..595657b
--- /dev/null
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SUCCUBUS_SCRIPT_H
+#define TITANIC_SUCCUBUS_SCRIPT_H
+
+#include "titanic/true_talk/tt_named_script.h"
+
+namespace Titanic {
+
+class SuccUBusScript : public TTNamedScript {
+private:
+	int _field2D0;
+public:
+	SuccUBusScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTNamedScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
+		_field2D0(0) {}
+
+	virtual int proc6() const;
+	virtual void proc7(int v1, int v2);
+	virtual int proc10() const;
+	virtual int proc17() const;
+	virtual int proc18() const;
+	virtual int proc21(int v);
+	virtual int proc23() const;
+	virtual void proc24();
+	virtual int proc25() const;
+	virtual void proc26();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SUCCUBUS_SCRIPT_H */
diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
new file mode 100644
index 0000000..1369af6
--- /dev/null
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/title_engine.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
new file mode 100644
index 0000000..c854704
--- /dev/null
+++ b/engines/titanic/true_talk/title_engine.h
@@ -0,0 +1,33 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TITLE_ENGINE_H
+#define TITANIC_TITLE_ENGINE_H
+
+namespace Titanic {
+
+class CTitleEngine {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TITLE_ENGINE_H */
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index aeaa677..d48a4d3 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -36,7 +36,8 @@ int CTrueTalkManager::_v9;
 bool CTrueTalkManager::_v10;
 int CTrueTalkManager::_v11[41];
 
-CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : _gameManager(owner) {
+CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : 
+		_gameManager(owner), _scripts(&_titleEngine) {
 }
 
 void CTrueTalkManager::save(SimpleFile *file) const {
@@ -74,4 +75,40 @@ void CTrueTalkManager::loadStatics(SimpleFile *file) {
 	}
 }
 
+void CTrueTalkManager::setFlags(int index, int val) {
+	switch (index) {
+	case 1:
+		if (val >= 1 && val <= 3)
+			_v3 = val;
+		break;
+
+	case 2:
+		_v4 = !val;
+		break;
+
+	case 3:
+		_v5 = val != 0;
+		break;
+
+	case 4:
+		if (val >= 0 && val <= 3)
+			_v6 = val;
+		break;
+
+	case 5:
+		_v7 = val;
+		break;
+
+	case 6:
+		_v8 = val != 0;
+		break;
+
+	default:
+		if (index < 41)
+			_v11[index] = val;
+		break;
+	}
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index b61bc3d..7bf0f5f 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -24,6 +24,7 @@
 #define TITANIC_TRUE_TALK_MANAGER_H
 
 #include "titanic/simple_file.h"
+#include "titanic/true_talk/title_engine.h"
 #include "titanic/true_talk/tt_scripts.h"
 
 namespace Titanic {
@@ -32,6 +33,10 @@ class CGameManager;
 
 class CTrueTalkManager {
 private:
+	CGameManager *_gameManager;
+	CTitleEngine _titleEngine;
+	TTScripts _scripts;
+private:
 	void loadStatics(SimpleFile *file);
 public:
 	static int _v1;
@@ -45,9 +50,8 @@ public:
 	static int _v9;
 	static bool _v10;
 	static int _v11[41];
-public:
-	CGameManager *_gameManager;
-	TTScripts _scripts;
+
+	static void setFlags(int index, int val);
 public:
 	CTrueTalkManager(CGameManager *owner);
 
diff --git a/engines/titanic/true_talk/tt_named_script.cpp b/engines/titanic/true_talk/tt_named_script.cpp
index 6f12012..8d225f1 100644
--- a/engines/titanic/true_talk/tt_named_script.cpp
+++ b/engines/titanic/true_talk/tt_named_script.cpp
@@ -22,6 +22,7 @@
 
 #include "common/textconsole.h"
 #include "titanic/true_talk/tt_named_script.h"
+#include "titanic/true_talk/true_talk_manager.h"
 
 namespace Titanic {
 
@@ -36,7 +37,23 @@ TTNamedScriptBase::TTNamedScriptBase(int val1, const char *charClass, int v2,
 TTNamedScript::TTNamedScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTNamedScriptBase(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
+	CTrueTalkManager::_v2 = 0;
+	Common::fill(&_array[0], &_array[147], 0);
 
+	if (!CTrueTalkManager::_v10) {
+		Common::fill(&CTrueTalkManager::_v11[0], &CTrueTalkManager::_v11[41], 0);
+		CTrueTalkManager::_v10 = true;
+	}
+
+	resetFlags();
+}
+
+void TTNamedScript::resetFlags() {
+	Common::fill(&_array[26], &_array[146], 0);
+}
+
+void TTNamedScript::randomizeFlags() {
+	warning("TODO");
 }
 
 void TTNamedScript::proc4(int v) {
diff --git a/engines/titanic/true_talk/tt_named_script.h b/engines/titanic/true_talk/tt_named_script.h
index cdff448..b747cee 100644
--- a/engines/titanic/true_talk/tt_named_script.h
+++ b/engines/titanic/true_talk/tt_named_script.h
@@ -39,16 +39,17 @@ public:
 		const char *charName, int v3, int val2, int v4,
 		int v5, int v6, int v7);
 
-	virtual void proc6() = 0;
-	virtual void proc7() = 0;
-	virtual void proc8() = 0;
-	virtual void proc9() = 0;
-	virtual void proc10() = 0;
-	virtual void proc11() = 0;
-	virtual void proc12() = 0;
+	virtual int proc6() const = 0;
+	virtual void proc7(int v1, int v2) = 0;
+	virtual int proc8() const = 0;
+	virtual int proc9() const = 0;
+	virtual int proc10() const = 0;
+	virtual int proc11() const = 0;
+	virtual int proc12() const = 0;
 };
+
 class TTNamedScript : public TTNamedScriptBase {
-private:
+protected:
 	int _field5C;
 	int _field60;
 	int _field64;
@@ -59,6 +60,11 @@ private:
 	int _field78;
 	int _field7C;
 	int _field80;
+	int _array[147];
+protected:
+	void resetFlags();
+
+	void randomizeFlags();
 public:
 	TTNamedScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,
diff --git a/engines/titanic/true_talk/tt_scripts.cpp b/engines/titanic/true_talk/tt_scripts.cpp
index 52368ad..981fe66 100644
--- a/engines/titanic/true_talk/tt_scripts.cpp
+++ b/engines/titanic/true_talk/tt_scripts.cpp
@@ -21,8 +21,42 @@
  */
 
 #include "titanic/true_talk/tt_scripts.h"
+#include "titanic/true_talk/title_engine.h"
+#include "titanic/true_talk/barbot_script.h"
+#include "titanic/true_talk/bellbot_script.h"
+#include "titanic/true_talk/deskbot_script.h"
+#include "titanic/true_talk/doorbot_script.h"
+#include "titanic/true_talk/liftbot_script.h"
+#include "titanic/true_talk/maitred_script.h"
+#include "titanic/true_talk/parrot_script.h"
+#include "titanic/true_talk/succubus_script.h"
 
 namespace Titanic {
 
+TTScripts::TTScripts(CTitleEngine *titleEngine) :
+		_titleEngine(titleEngine), _field24(0), _field28(0) {
+	// Load unnamed scripts
+	for (int scriptNum = 100; scriptNum < 133; ++scriptNum)
+		addScript(new TTUnnamedScript(scriptNum));
+
+	// Load named scripts
+	addScript(new DoorbotScript(104, "Doorbot", 0, "Fentible", 11, 1, -1, -1, -1, 0));
+	addScript(new BellbotScript(101, "Bellbot", 0, "Krage", 8, 1));
+	addScript(new LiftbotScript(105, "LiftBot", 0, "Nobby", 11, 1, -1, -1, -1, 0));
+	addScript(new DeskbotScript(103, "DeskBot", 0, "Marsinta", 11, 2));
+	addScript(new BarbotScript(100, "Barbot", 0, "Fortillian", 9, 1, -1, -1, -1, 0));
+	addScript(new ParrotScript(107, "Parrot", 0, "The Parrot", 5, 1, -1, -1, -1, 0));
+	addScript(new MaitreDScript(112, "MaitreDBot", 0, "Dastrogaaar", 8, 1));
+	addScript(new SuccUBusScript(111, "Succubus", 0, "Shorbert", 9, 1, -1, -1, -1, 0));
+}
+
+void TTScripts::addScript(TTNamedScript *script) {
+	script->proc13();
+	_namedScripts.push_back(new TTNamedScriptListItem(script));
+}
+
+void TTScripts::addScript(TTUnnamedScript *script) {
+	_unnamedScripts.push_back(new TTUnnamedScriptListItem(script));
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_scripts.h b/engines/titanic/true_talk/tt_scripts.h
index b87a7c2..e47a7b2 100644
--- a/engines/titanic/true_talk/tt_scripts.h
+++ b/engines/titanic/true_talk/tt_scripts.h
@@ -23,11 +23,42 @@
 #ifndef TITANIC_TT_SCRIPTS_H
 #define TITANIC_TT_SCRIPTS_H
 
+#include "titanic/core/list.h"
+#include "titanic/true_talk/tt_named_script.h"
+#include "titanic/true_talk/tt_unnamed_script.h"
+
 namespace Titanic {
 
+class CTitleEngine;
+
+PTR_LIST_ITEM(TTNamedScript);
+PTR_LIST_ITEM(TTUnnamedScript);
+
+class TTNamedScriptList : public List<TTNamedScriptListItem> {
+};
+
+class TTUnamedScriptList : public List<TTUnnamedScriptListItem> {
+};
+
 class TTScripts {
+private:
+	TTNamedScriptList _namedScripts;
+	TTUnamedScriptList _unnamedScripts;
+	CTitleEngine *_titleEngine;
+	int _field24;
+	int _field28;
+private:
+	/**
+	 * Add a named script to the named scripts list
+	 */
+	void addScript(TTNamedScript *script);
+
+	/**
+	 * Add an unnamed script to the unnamed scripts list
+	 */
+	void addScript(TTUnnamedScript *script);
 public:
-	TTScripts() {}
+	TTScripts(CTitleEngine *titleEngine);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 8f42e62..cf940a4 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -33,7 +33,7 @@ public:
 public:
 	TTString() : CString(), _status(0) {}
 	TTString(const char *str) : CString(str), _status(0) {}
-	~TTString();
+	virtual ~TTString() {}
 
 	bool isValid() const { return !_status; }
 };


Commit: 60e137c65121bd284b200d97cc930c4d1e15114c
    https://github.com/scummvm/scummvm/commit/60e137c65121bd284b200d97cc930c4d1e15114c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-12T10:51:34-05:00

Commit Message:
TITANIC: Implemented true talk manager & script loading

Changed paths:
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_named_script.cpp
    engines/titanic/true_talk/tt_named_script.h
    engines/titanic/true_talk/tt_scripts.cpp
    engines/titanic/true_talk/tt_scripts.h
    engines/titanic/true_talk/tt_unnamed_script.h



diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index d48a4d3..416a4e2 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -22,6 +22,8 @@
 
 #include "titanic/true_talk/true_talk_manager.h"
 
+#define MKTAG_BE(a3,a2,a1,a0) ((uint32)((a3) | ((a2) << 8) | ((a1) << 16) | ((a0) << 24)))
+
 namespace Titanic {
 
 int CTrueTalkManager::_v1;
@@ -41,14 +43,31 @@ CTrueTalkManager::CTrueTalkManager(CGameManager *owner) :
 }
 
 void CTrueTalkManager::save(SimpleFile *file) const {
-
+	saveStatics(file);
+
+	saveNPC(file, 101);
+	saveNPC(file, 103);
+	saveNPC(file, 104);
+	saveNPC(file, 105);
+	saveNPC(file, 111);
+	saveNPC(file, 100);
+	saveNPC(file, 112);
+	saveNPC(file, 107);
+	file->writeNumber(0);
 }
 
 void CTrueTalkManager::load(SimpleFile *file) {
 	loadStatics(file);
 
-	int count = file->readNumber();
-	//TODO
+	// Iterate through loading characters
+	int charId = file->readNumber();
+	while (charId) {
+		uint ident = MKTAG_BE('U', 'R', 'A', 'H');
+
+		do {
+
+		} while (1);
+	}
 }
 
 void CTrueTalkManager::loadStatics(SimpleFile *file) {
@@ -75,6 +94,24 @@ void CTrueTalkManager::loadStatics(SimpleFile *file) {
 	}
 }
 
+void CTrueTalkManager::saveStatics(SimpleFile *file) {
+	file->writeNumber(10);
+	file->writeNumber(_v1);
+	file->writeNumber(_v2);
+	file->writeNumber(_v3);
+	file->writeNumber(_v4 ? 1 : 0);
+	file->writeNumber(_v5 ? 1 : 0);
+	file->writeNumber(_v6);
+	file->writeNumber(_v7);
+	file->writeNumber(_v8 ? 1 : 0);
+	file->writeNumber(_v9);
+	file->writeNumber(_v10 ? 1 : 0);
+
+	file->writeNumber(41);
+	for (int idx = 0; idx < 41; ++idx)
+		file->writeNumber(_v11[idx]);
+}
+
 void CTrueTalkManager::setFlags(int index, int val) {
 	switch (index) {
 	case 1:
@@ -110,5 +147,13 @@ void CTrueTalkManager::setFlags(int index, int val) {
 	}
 }
 
+void CTrueTalkManager::saveNPC(SimpleFile *file, int charId) const {
+	TTNamedScript *script = _scripts.getNamedScript(charId);
+	if (script) {
+		script->save(file);
+		file->writeNumber(MKTAG_BE('U', 'R', 'A', 'H'));
+		file->writeNumber(MKTAG_BE('A', 'K', 'E', 'R'));
+	}
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 7bf0f5f..cd70af3 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -37,7 +37,17 @@ private:
 	CTitleEngine _titleEngine;
 	TTScripts _scripts;
 private:
-	void loadStatics(SimpleFile *file);
+	/**
+	 * Loads the statics for the class
+	 */
+	static void loadStatics(SimpleFile *file);
+
+	/**
+	 * Saves the statics associated with the class
+	 */
+	static void saveStatics(SimpleFile *file);
+
+	void saveNPC(SimpleFile *file, int charId) const;
 public:
 	static int _v1;
 	static int _v2;
@@ -64,6 +74,11 @@ public:
 	 * Load the data for the class from file
 	 */
 	void load(SimpleFile *file);
+
+	/**
+	 * Returns the scripts for the manager
+	 */
+	TTScripts &getScripts() { return _scripts; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_named_script.cpp b/engines/titanic/true_talk/tt_named_script.cpp
index 8d225f1..129727c 100644
--- a/engines/titanic/true_talk/tt_named_script.cpp
+++ b/engines/titanic/true_talk/tt_named_script.cpp
@@ -26,17 +26,17 @@
 
 namespace Titanic {
 
-TTNamedScriptBase::TTNamedScriptBase(int val1, const char *charClass, int v2,
+TTNamedScriptBase::TTNamedScriptBase(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTScriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
-		_val1(val1), _field54(0), _val2(val2) {
+		_charId(charId), _field54(0), _val2(val2) {
 }
 
 /*------------------------------------------------------------------------*/
 
-TTNamedScript::TTNamedScript(int val1, const char *charClass, int v2,
+TTNamedScript::TTNamedScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNamedScriptBase(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
+		TTNamedScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
 	CTrueTalkManager::_v2 = 0;
 	Common::fill(&_array[0], &_array[147], 0);
 
@@ -139,24 +139,66 @@ int TTNamedScript::proc25() const {
 void TTNamedScript::proc26() {
 }
 
-void TTNamedScript::save1(SimpleFile *file) {
-	error("TODO");
+void TTNamedScript::save(SimpleFile *file) {
+	file->writeNumber(charId());
+	saveBody(file);
+
+	file->writeNumber(4);
+	file->writeNumber(_field70);
+	file->writeNumber(_field74);
+	file->writeNumber(_field78);
+	file->writeNumber(_field7C);
+	
+	file->writeNumber(10);
+	for (int idx = 0; idx < 10; ++idx)
+		file->writeNumber(_array[idx]);
 }
 
-void TTNamedScript::proc28(int v) {
-	warning("TODO");
+void TTNamedScript::load(SimpleFile *file) {
+	loadBody(file);
+
+	int count = file->readNumber();
+	_field70 = file->readNumber();
+	_field74 = file->readNumber();
+	_field78 = file->readNumber();
+	_field7C = file->readNumber();
+
+	for (int idx = count; idx > 4; --idx)
+		file->readNumber();
+
+	count = file->readNumber();
+	for (int idx = 0; idx < count; ++idx) {
+		int v = file->readNumber();
+		if (idx < 10)
+			_array[idx] = v;
+	}
 }
 
-void TTNamedScript::save2(SimpleFile *file) {
-	error("TODO");
+void TTNamedScript::saveBody(SimpleFile *file) {
+	int v = proc31();
+	file->writeNumber(v);
+
+	if (v > 0 && _subPtr) {
+		warning("TODO");
+	}
 }
 
-void TTNamedScript::proc30(int v) {
-	warning("TODO");
+void TTNamedScript::loadBody(SimpleFile *file) {
+	int count = file->readNumber();
+	preLoad();
+
+	for (int index = 0; index < count; index += 2) {
+		int v = file->readNumber();
+
+		if (_subPtr) {
+			error("TODO - %d", v);
+		}
+	}
 }
 
-void TTNamedScript::proc31() {
+int TTNamedScript::proc31() {
 	warning("TODO");
+	return 0;
 }
 
 void TTNamedScript::proc32() {
@@ -185,4 +227,10 @@ int TTNamedScript::proc37() const {
 	return 0;
 }
 
+void TTNamedScript::preLoad() {
+	if (_subPtr) {
+		error("TODO");
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_named_script.h b/engines/titanic/true_talk/tt_named_script.h
index b747cee..968ec22 100644
--- a/engines/titanic/true_talk/tt_named_script.h
+++ b/engines/titanic/true_talk/tt_named_script.h
@@ -31,11 +31,12 @@ namespace Titanic {
 
 class TTNamedScriptBase : public TTScriptBase {
 protected:
-	int _val1;
 	int _field54;
 	int _val2;
 public:
-	TTNamedScriptBase(int val1, const char *charClass, int v2,
+	int _charId;
+public:
+	TTNamedScriptBase(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,
 		int v5, int v6, int v7);
 
@@ -46,11 +47,13 @@ public:
 	virtual int proc10() const = 0;
 	virtual int proc11() const = 0;
 	virtual int proc12() const = 0;
+
+	int charId() const { return _charId; }
 };
 
 class TTNamedScript : public TTNamedScriptBase {
 protected:
-	int _field5C;
+	byte *_subPtr;
 	int _field60;
 	int _field64;
 	int _field68;
@@ -66,7 +69,7 @@ protected:
 
 	void randomizeFlags();
 public:
-	TTNamedScript(int val1, const char *charClass, int v2,
+	TTNamedScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,
 		int v5, int v6, int v7);
 
@@ -92,17 +95,19 @@ public:
 	virtual void proc24() = 0;
 	virtual int proc25() const;
 	virtual void proc26();
-	virtual void save1(SimpleFile *file);
-	virtual void proc28(int v);
-	virtual void save2(SimpleFile *file);
-	virtual void proc30(int v);
-	virtual void proc31();
+	virtual void save(SimpleFile *file);
+	virtual void load(SimpleFile *file);
+	virtual void saveBody(SimpleFile *file);
+	virtual void loadBody(SimpleFile *file);
+	virtual int proc31();
 	virtual void proc32();
 	virtual void proc33(int v1, int v2);
 	virtual int proc34();
 	virtual int proc35(int v1, int v2);
 	virtual int proc36() const;
 	virtual int proc37() const;
+
+	void preLoad();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_scripts.cpp b/engines/titanic/true_talk/tt_scripts.cpp
index 981fe66..8e34ec5 100644
--- a/engines/titanic/true_talk/tt_scripts.cpp
+++ b/engines/titanic/true_talk/tt_scripts.cpp
@@ -32,6 +32,30 @@
 #include "titanic/true_talk/succubus_script.h"
 
 namespace Titanic {
+	
+TTNamedScript *TTNamedScriptList::findById(int charId) const {
+	for (TTNamedScriptList::const_iterator i = begin(); i != end(); ++i) {
+		const TTNamedScriptListItem *item = *i;
+		if (item->_script->_charId == charId)
+			return item->_script;
+	}
+
+	return nullptr;
+}
+
+/*------------------------------------------------------------------------*/
+
+TTUnnamedScript *TTUnnamedScriptList::findById(int scriptId) const {
+	for (TTUnnamedScriptList::const_iterator i = begin(); i != end(); ++i) {
+		const TTUnnamedScriptListItem *item = *i;
+		if (item->_item->_scriptId == scriptId)
+			return item->_item;
+	}
+
+	return nullptr;
+}
+
+/*------------------------------------------------------------------------*/
 
 TTScripts::TTScripts(CTitleEngine *titleEngine) :
 		_titleEngine(titleEngine), _field24(0), _field28(0) {
@@ -40,23 +64,36 @@ TTScripts::TTScripts(CTitleEngine *titleEngine) :
 		addScript(new TTUnnamedScript(scriptNum));
 
 	// Load named scripts
-	addScript(new DoorbotScript(104, "Doorbot", 0, "Fentible", 11, 1, -1, -1, -1, 0));
-	addScript(new BellbotScript(101, "Bellbot", 0, "Krage", 8, 1));
-	addScript(new LiftbotScript(105, "LiftBot", 0, "Nobby", 11, 1, -1, -1, -1, 0));
-	addScript(new DeskbotScript(103, "DeskBot", 0, "Marsinta", 11, 2));
-	addScript(new BarbotScript(100, "Barbot", 0, "Fortillian", 9, 1, -1, -1, -1, 0));
-	addScript(new ParrotScript(107, "Parrot", 0, "The Parrot", 5, 1, -1, -1, -1, 0));
-	addScript(new MaitreDScript(112, "MaitreDBot", 0, "Dastrogaaar", 8, 1));
-	addScript(new SuccUBusScript(111, "Succubus", 0, "Shorbert", 9, 1, -1, -1, -1, 0));
+	addScript(new DoorbotScript(104, "Doorbot", 0, "Fentible", 11, 1, -1, -1, -1, 0), 100);
+	addScript(new BellbotScript(101, "Bellbot", 0, "Krage", 8, 1), 110);
+	addScript(new LiftbotScript(105, "LiftBot", 0, "Nobby", 11, 1, -1, -1, -1, 0), 103);
+	addScript(new DeskbotScript(103, "DeskBot", 0, "Marsinta", 11, 2), 110);
+	addScript(new BarbotScript(100, "Barbot", 0, "Fortillian", 9, 1, -1, -1, -1, 0), 112);
+	addScript(new ParrotScript(107, "Parrot", 0, "The Parrot", 5, 1, -1, -1, -1, 0), 111);
+	addScript(new MaitreDScript(112, "MaitreDBot", 0, "Dastrogaaar", 8, 1), 132);
+	addScript(new SuccUBusScript(111, "Succubus", 0, "Shorbert", 9, 1, -1, -1, -1, 0), 110);
 }
 
-void TTScripts::addScript(TTNamedScript *script) {
+void TTScripts::addScript(TTNamedScript *script, int scriptId) {
 	script->proc13();
-	_namedScripts.push_back(new TTNamedScriptListItem(script));
+	
+	// Find the unnamed script this is associated with
+	TTUnnamedScript *unnamedScript = getUnnamedScript(scriptId);
+	assert(unnamedScript);
+
+	_namedScripts.push_back(new TTNamedScriptListItem(script, unnamedScript));
 }
 
 void TTScripts::addScript(TTUnnamedScript *script) {
 	_unnamedScripts.push_back(new TTUnnamedScriptListItem(script));
 }
 
+TTUnnamedScript *TTScripts::getUnnamedScript(int scriptId) const {
+	return _unnamedScripts.findById(scriptId);
+}
+
+TTNamedScript *TTScripts::getNamedScript(int charId) const {
+	return _namedScripts.findById(charId);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_scripts.h b/engines/titanic/true_talk/tt_scripts.h
index e47a7b2..5934eb3 100644
--- a/engines/titanic/true_talk/tt_scripts.h
+++ b/engines/titanic/true_talk/tt_scripts.h
@@ -31,19 +31,33 @@ namespace Titanic {
 
 class CTitleEngine;
 
-PTR_LIST_ITEM(TTNamedScript);
+class TTNamedScriptListItem : public ListItem {
+public:
+	TTNamedScript *_script;
+	TTUnnamedScript *_unnamedScript;
+public:
+	TTNamedScriptListItem() : _script(nullptr), _unnamedScript(nullptr) {}
+	TTNamedScriptListItem(TTNamedScript *script, TTUnnamedScript *unnamedScript) :
+		_script(script), _unnamedScript(unnamedScript) {}
+	virtual ~TTNamedScriptListItem() { delete _script; }
+};
+
 PTR_LIST_ITEM(TTUnnamedScript);
 
 class TTNamedScriptList : public List<TTNamedScriptListItem> {
+public:
+	TTNamedScript *findById(int charId) const;
 };
 
-class TTUnamedScriptList : public List<TTUnnamedScriptListItem> {
+class TTUnnamedScriptList : public List<TTUnnamedScriptListItem> {
+public:
+	TTUnnamedScript *findById(int scriptId) const;
 };
 
 class TTScripts {
 private:
 	TTNamedScriptList _namedScripts;
-	TTUnamedScriptList _unnamedScripts;
+	TTUnnamedScriptList _unnamedScripts;
 	CTitleEngine *_titleEngine;
 	int _field24;
 	int _field28;
@@ -51,7 +65,7 @@ private:
 	/**
 	 * Add a named script to the named scripts list
 	 */
-	void addScript(TTNamedScript *script);
+	void addScript(TTNamedScript *script, int charId);
 
 	/**
 	 * Add an unnamed script to the unnamed scripts list
@@ -59,6 +73,16 @@ private:
 	void addScript(TTUnnamedScript *script);
 public:
 	TTScripts(CTitleEngine *titleEngine);
+
+	/**
+	 * Return a pointer to the specified script
+	 */
+	TTUnnamedScript *getUnnamedScript(int scriptId) const;
+
+	/**
+	 * Return a pointer to the specified named character script
+	 */
+	TTNamedScript *getNamedScript(int charId) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_unnamed_script.h b/engines/titanic/true_talk/tt_unnamed_script.h
index f470216..eeba200 100644
--- a/engines/titanic/true_talk/tt_unnamed_script.h
+++ b/engines/titanic/true_talk/tt_unnamed_script.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class TTUnnamedScriptBase : public TTScriptBase {
-protected:
+public:
 	int _scriptId;
 public:
 	TTUnnamedScriptBase(int scriptId, const char *charClass, const char *charName,


Commit: c269c770ac27cbc845c06dfec8c7ac99d4fe657d
    https://github.com/scummvm/scummvm/commit/c269c770ac27cbc845c06dfec8c7ac99d4fe657d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-12T12:35:41-05:00

Commit Message:
TITANIC: Implemented sound manager loading

Changed paths:
  A engines/titanic/sound/sound_manager.cpp
  A engines/titanic/sound/sound_manager.h
    engines/titanic/module.mk
    engines/titanic/sound/sound.cpp
    engines/titanic/sound/sound.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_named_script.cpp



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index bfb9317..e95977a 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -403,6 +403,7 @@ MODULE_OBJS := \
 	sound/season_noises.o \
 	sound/seasonal_music_player.o \
 	sound/sound.o \
+	sound/sound_manager.o \
 	sound/titania_speech.o \
 	sound/trigger_auto_music_player.o \
 	sound/view_auto_sound_player.o \
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index cea377e..35c1c70 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -28,11 +28,11 @@ CSound::CSound(CGameManager *owner) : _gameManager(owner) {
 }
 
 void CSound::save(SimpleFile *file) const {
-
+	_soundManager.save(file);
 }
 
 void CSound::load(SimpleFile *file) {
-
+	_soundManager.load(file);
 }
 
 } // End of namespace Titanic z
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index 2d0ccec..6ae4019 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -24,14 +24,16 @@
 #define TITANIC_SOUND_H
 
 #include "titanic/simple_file.h"
+#include "titanic/sound/sound_manager.h"
 
 namespace Titanic {
 
 class CGameManager;
 
 class CSound {
-public:
+private:
 	CGameManager *_gameManager;
+	QSoundManager _soundManager;
 public:
 	CSound(CGameManager *owner);
 
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
new file mode 100644
index 0000000..143dd83
--- /dev/null
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -0,0 +1,127 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/sound_manager.h"
+
+namespace Titanic {
+
+SoundManager::SoundManager() : _field4(0), _field8(0),
+	_fieldC(0), _field10(0), _field14(1) {
+}
+
+/*------------------------------------------------------------------------*/
+
+QSoundManager::QSoundManager() : _field18(0), _field1C(0) {
+	Common::fill(&_field4A0[0], &_field4A0[16], 0);
+}
+
+int QSoundManager::proc3() {
+	warning("TODO");
+	return 0;
+}
+
+int QSoundManager::proc4() {
+	warning("TODO");
+	return 0;
+}
+
+int QSoundManager::proc5() {
+	warning("TODO");
+	return 0;
+}
+
+void QSoundManager::proc6() {
+	warning("TODO");
+}
+
+void QSoundManager::proc7() {
+	warning("TODO");
+}
+
+void QSoundManager::proc8() {
+	warning("TODO");
+}
+
+void QSoundManager::proc9() {
+	warning("TODO");
+}
+
+void QSoundManager::proc10() {
+	warning("TODO");
+}
+
+void QSoundManager::proc11() {
+	warning("TODO");
+}
+
+void QSoundManager::proc12() {
+	warning("TODO");
+}
+
+void QSoundManager::proc13() {
+	warning("TODO");
+}
+
+void QSoundManager::proc14() {
+	warning("TODO");
+}
+
+int QSoundManager::proc15() {
+	warning("TODO");
+	return 0;
+}
+
+int QSoundManager::proc16() {
+	warning("TODO");
+	return 0;
+}
+
+void QSoundManager::WaveMixPump() {
+	warning("TODO");
+}
+
+int QSoundManager::proc18() const {
+	warning("TODO");
+	return 0;
+}
+
+void QSoundManager::proc19(int v) {
+	warning("TODO");
+}
+
+void QSoundManager::proc20(int v) {
+	warning("TODO");
+}
+
+void QSoundManager::proc21(int v) {
+	warning("TODO");
+}
+
+void QSoundManager::proc29() {
+	warning("TODO");
+}
+
+void QSoundManager::proc30() {
+	warning("TODO");
+}
+
+} // End of namespace Titanic z
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
new file mode 100644
index 0000000..4936625
--- /dev/null
+++ b/engines/titanic/sound/sound_manager.h
@@ -0,0 +1,118 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SOUND_MANAGER_H
+#define TITANIC_SOUND_MANAGER_H
+
+#include "titanic/simple_file.h"
+
+namespace Titanic {
+
+class SoundManager {
+protected:
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+public:
+	SoundManager();
+	
+	virtual int proc3() const { return 0; }
+	virtual int proc4() const { return 0; }
+	virtual int proc5() const { return 0; }
+	virtual void proc6() = 0;
+	virtual void proc7() = 0;
+	virtual void proc8() = 0;
+	virtual void proc9() {}
+	virtual void proc10() = 0;
+	virtual void proc11() = 0;
+	virtual void proc12() {}
+	virtual void proc13() {}
+	virtual void proc14() = 0;
+	virtual int proc15() const { return 0; }
+	virtual int proc16() const { return 0; }
+	virtual void WaveMixPump() {}
+	virtual int proc18() const { return 0; }
+	virtual void proc19(int v) { _field4 = v; }
+	virtual void proc20(int v) { _field8 = v; }
+	virtual void proc21(int v) { _fieldC = v; }
+	virtual void proc22(int v) { _field10 = v; }
+	virtual void proc23() { proc10(); }
+
+	/**
+	 * Load the data for the class from file
+	 */
+	void load(SimpleFile *file) {}
+
+	virtual void proc25() {}
+	virtual void proc26() {}
+
+	/**
+	 * Save the data for the class to file
+	 */
+	void save(SimpleFile *file) const {}
+
+	/**
+	 * Called after saving is complete
+	 */
+	virtual void postSave() {}
+	
+	virtual void proc29() {}
+};
+
+class QSoundManager : public SoundManager {
+public:
+	int _field18;
+	int _field1C;
+
+	int _field4A0[16];
+public:
+	QSoundManager();
+
+	virtual int proc3();
+	virtual int proc4();
+	virtual int proc5();
+	virtual void proc6();
+	virtual void proc7();
+	virtual void proc8();
+	virtual void proc9();
+	virtual void proc10();
+	virtual void proc11();
+	virtual void proc12();
+	virtual void proc13();
+	virtual void proc14();
+	virtual int proc15();
+	virtual int proc16();
+	virtual void WaveMixPump();
+	virtual int proc18() const;
+	virtual void proc19(int v);
+	virtual void proc20(int v);
+	virtual void proc21(int v);
+
+	virtual void proc29();
+	virtual void proc30();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_QSOUND_MANAGER_H */
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 416a4e2..f176b2f 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -62,11 +62,24 @@ void CTrueTalkManager::load(SimpleFile *file) {
 	// Iterate through loading characters
 	int charId = file->readNumber();
 	while (charId) {
-		uint ident = MKTAG_BE('U', 'R', 'A', 'H');
+		loadNPC(file, charId);
 
-		do {
+		int ident1 = file->readNumber();
+		int ident2 = file->readNumber();
+		int v = 0;
 
-		} while (1);
+		if (ident1 != MKTAG_BE('U', 'R', 'A', 'H')) {
+			while (ident2 != MKTAG_BE('A', 'K', 'E', 'R')) {
+				ident1 = ident2;
+				ident2 = file->readNumber();
+
+				if (!ident1)
+					break;
+			}
+		}
+
+		// Get start of next character
+		charId = file->readNumber();
 	}
 }
 
@@ -147,6 +160,12 @@ void CTrueTalkManager::setFlags(int index, int val) {
 	}
 }
 
+void CTrueTalkManager::loadNPC(SimpleFile *file, int charId) {
+	TTNamedScript *script = _scripts.getNamedScript(charId);
+	if (script)
+		script->load(file);
+}
+
 void CTrueTalkManager::saveNPC(SimpleFile *file, int charId) const {
 	TTNamedScript *script = _scripts.getNamedScript(charId);
 	if (script) {
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index cd70af3..274b5cc 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -47,6 +47,8 @@ private:
 	 */
 	static void saveStatics(SimpleFile *file);
 
+	void loadNPC(SimpleFile *file, int charId);
+
 	void saveNPC(SimpleFile *file, int charId) const;
 public:
 	static int _v1;
diff --git a/engines/titanic/true_talk/tt_named_script.cpp b/engines/titanic/true_talk/tt_named_script.cpp
index 129727c..dfc5bb2 100644
--- a/engines/titanic/true_talk/tt_named_script.cpp
+++ b/engines/titanic/true_talk/tt_named_script.cpp
@@ -36,7 +36,10 @@ TTNamedScriptBase::TTNamedScriptBase(int charId, const char *charClass, int v2,
 
 TTNamedScript::TTNamedScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNamedScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
+		TTNamedScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
+		_subPtr(nullptr), _field60(0), _field64(0), _field68(0),
+		_field6C(0), _field70(0), _field74(0), _field78(0),
+		_field7C(0), _field80(0) {
 	CTrueTalkManager::_v2 = 0;
 	Common::fill(&_array[0], &_array[147], 0);
 


Commit: bad72e2ae491cb99843f3af971725231e3defb2e
    https://github.com/scummvm/scummvm/commit/bad72e2ae491cb99843f3af971725231e3defb2e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-12T19:23:00-05:00

Commit Message:
TITANIC: Implement various post-load methods

Changed paths:
    engines/titanic/core/node_item.cpp
    engines/titanic/core/node_item.h
    engines/titanic/core/project_item.cpp
    engines/titanic/core/project_item.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/saveable_object.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/core/view_item.cpp
    engines/titanic/core/view_item.h
    engines/titanic/game/room_item.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/game_state_sub.cpp
    engines/titanic/game_state_sub.h
    engines/titanic/game_view.cpp
    engines/titanic/game_view.h
    engines/titanic/main_game_window.cpp
    engines/titanic/main_game_window.h
    engines/titanic/messages/messages.cpp
    engines/titanic/messages/messages.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/sound/sound.h
    engines/titanic/sound/sound_manager.h
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/core/node_item.cpp b/engines/titanic/core/node_item.cpp
index f44be6d..22c9b9b 100644
--- a/engines/titanic/core/node_item.cpp
+++ b/engines/titanic/core/node_item.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-CNodeItem::CNodeItem() : CNamedItem(), _field24(0), _field28(0), _field2C(0) {
+CNodeItem::CNodeItem() : CNamedItem(), _field24(0), _field28(0), _nodeNumber(0) {
 }
 
 void CNodeItem::save(SimpleFile *file, int indent) const {
@@ -34,7 +34,7 @@ void CNodeItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_field28, indent + 1);
 
 	file->writeQuotedLine("N", indent);
-	file->writeNumberLine(_field2C, indent + 1);
+	file->writeNumberLine(_nodeNumber, indent + 1);
 
 	CNamedItem::save(file, indent);
 }
@@ -46,7 +46,7 @@ void CNodeItem::load(SimpleFile *file) {
 	_field28 = file->readNumber();
 
 	file->readBuffer();
-	_field2C = file->readNumber();
+	_nodeNumber = file->readNumber();
 
 	CNamedItem::load(file);
 }
diff --git a/engines/titanic/core/node_item.h b/engines/titanic/core/node_item.h
index 45309a1..4f0391a 100644
--- a/engines/titanic/core/node_item.h
+++ b/engines/titanic/core/node_item.h
@@ -28,10 +28,11 @@
 namespace Titanic {
 
 class CNodeItem : public CNamedItem {
-private:
+protected:
 	int _field24;
 	int _field28;
-	int _field2C;
+public:
+	int _nodeNumber;
 public:
 	CLASSDEF
 	CNodeItem();
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 18b0c42..bf31388 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -25,7 +25,9 @@
 #include "titanic/game_manager.h"
 #include "titanic/titanic.h"
 #include "titanic/core/dont_save_file_item.h"
+#include "titanic/core/node_item.h"
 #include "titanic/core/project_item.h"
+#include "titanic/core/view_item.h"
 #include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
@@ -177,7 +179,7 @@ void CProjectItem::loadGame(int slotId) {
 	newProject->destroyAll();
 
 	// Post-load processing
-	gameLoaded();
+	postLoad();
 }
 
 void CProjectItem::saveGame(int slotId) {
@@ -251,7 +253,6 @@ void CProjectItem::saveData(SimpleFile *file, CTreeItem *item) const {
 		item->saveHeader(file, 0);
 		item->save(file, 1);
 		item->saveFooter(file, 0);
-
 	
 		CTreeItem *child = item->getFirstChild();
 		if (child) {
@@ -271,14 +272,14 @@ void CProjectItem::saveData(SimpleFile *file, CTreeItem *item) const {
 	}
 }
 
-void CProjectItem::gameLoaded() {
+void CProjectItem::postLoad() {
 	CGameManager *gameManager = getGameManager();
 	if (gameManager)
-		gameManager->gameLoaded();
+		gameManager->postLoad(this);
 
 	CPetControl *petControl = getPetControl();
 	if (petControl)
-		petControl->gameLoaded();
+		petControl->postLoad();
 }
 
 CPetControl *CProjectItem::getPetControl() const {
@@ -300,10 +301,10 @@ CPetControl *CProjectItem::getPetControl() const {
 }
 
 CRoomItem *CProjectItem::findFirstRoom() const {
-	return dynamic_cast<CRoomItem *>(findChildInstance(*CRoomItem::_type));
+	return dynamic_cast<CRoomItem *>(findChildInstance(CRoomItem::_type));
 }
 
-CTreeItem *CProjectItem::findChildInstance(ClassDef &classDef) const {
+CTreeItem *CProjectItem::findChildInstance(ClassDef *classDef) const {
 	CTreeItem *treeItem = getFirstChild();
 	if (treeItem == nullptr)
 		return nullptr;
@@ -322,10 +323,10 @@ CTreeItem *CProjectItem::findChildInstance(ClassDef &classDef) const {
 }
 
 CRoomItem *CProjectItem::findNextRoom(CRoomItem *priorRoom) const {
-	return dynamic_cast<CRoomItem *>(findSiblingInstanceOf(*CRoomItem::_type, priorRoom));
+	return dynamic_cast<CRoomItem *>(findSiblingInstanceOf(CRoomItem::_type, priorRoom));
 }
 
-CTreeItem *CProjectItem::findSiblingInstanceOf(ClassDef &classDef, CTreeItem *startItem) const {
+CTreeItem *CProjectItem::findSiblingInstanceOf(ClassDef *classDef, CTreeItem *startItem) const {
 	CTreeItem *treeItem = startItem->getParent()->getNextSibling();
 	if (treeItem == nullptr)
 		return nullptr;
@@ -335,7 +336,7 @@ CTreeItem *CProjectItem::findSiblingInstanceOf(ClassDef &classDef, CTreeItem *st
 
 CDontSaveFileItem *CProjectItem::getDontSaveFileItem() const {
 	for (CTreeItem *treeItem = getFirstChild(); treeItem; treeItem = treeItem->getNextSibling()) {
-		if (treeItem->isInstanceOf(*CDontSaveFileItem::_type))
+		if (treeItem->isInstanceOf(CDontSaveFileItem::_type))
 			return dynamic_cast<CDontSaveFileItem *>(treeItem);
 	}
 
@@ -346,4 +347,47 @@ CRoomItem *CProjectItem::findHiddenRoom() {
 	return dynamic_cast<CRoomItem *>(findByName("HiddenRoom"));
 }
 
+CViewItem *CProjectItem::findView(int roomNumber, int nodeNumber, int viewNumber) {
+	CTreeItem *treeItem = getFirstChild();
+	CRoomItem *roomItem = nullptr;
+
+	// Scan for the specified room
+	if (treeItem) {
+		do {
+			CTreeItem *childItem = treeItem->getFirstChild();
+			CRoomItem *rItem = dynamic_cast<CRoomItem *>(childItem);
+			if (rItem && rItem->_roomNumber == roomNumber) {
+				roomItem = rItem;
+				break;
+			}
+		} while ((treeItem = treeItem->getNextSibling()) != nullptr);
+	}
+	if (!roomItem)
+		return nullptr;
+
+	// Scan for the specified node within the room
+	CNodeItem *nodeItem = nullptr;
+
+	CNodeItem *nItem = dynamic_cast<CNodeItem *>(
+		roomItem->findChildInstanceOf(CNodeItem::_type));
+	for (; nItem && !nodeItem; nItem = dynamic_cast<CNodeItem *>(
+			findNextInstanceOf(CNodeItem::_type, nItem))) {
+		if (nItem->_nodeNumber == nodeNumber)
+			nodeItem = nItem;
+	}
+	if (!nodeItem)
+		return nullptr;
+
+	// Scan for the specified view within the node
+	CViewItem *viewItem = dynamic_cast<CViewItem *>(
+		nodeItem->findChildInstanceOf(CViewItem::_type));
+	for (; viewItem; viewItem = dynamic_cast<CViewItem *>(
+			findNextInstanceOf(CViewItem::_type, viewItem))) {
+		if (viewItem->_viewNumber == viewNumber)
+			return viewItem;
+	}
+
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index f4148b0..65fe8b8 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -34,6 +34,7 @@ namespace Titanic {
 
 class CGameManager;
 class CPetControl;
+class CViewItem;
 
 /**
  * File list item
@@ -81,12 +82,12 @@ private:
 	/**
 	 * Finds the first child instance of a given class type
 	 */
-	CTreeItem *findChildInstance(ClassDef &classDef) const;
+	CTreeItem *findChildInstance(ClassDef *classDef) const;
 
 	/**
 	 * Finds the next sibling occurance of a given class type
 	 */
-	CTreeItem *findSiblingInstanceOf(ClassDef &classDef, CTreeItem *startItem) const;
+	CTreeItem *findSiblingInstanceOf(ClassDef *classDef, CTreeItem *startItem) const;
 private:
 	/**
 	 * Load project data from the passed file
@@ -101,7 +102,7 @@ private:
 	/**
 	 * Does post-loading processing
 	 */
-	void gameLoaded();
+	void postLoad();
 public:
 	CLASSDEF
 	CProjectItem();
@@ -171,7 +172,15 @@ public:
 	 */
 	CDontSaveFileItem *getDontSaveFileItem() const;
 
+	/**
+	 * Finds the hidden room node of the project
+	 */
 	CRoomItem *findHiddenRoom();
+
+	/**
+	 * Finds a view
+	 */
+	CViewItem *findView(int roomNumber, int nodeNumber, int viewNumber);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 8e3ab1e..8e9ec4e 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -1581,9 +1581,9 @@ void CSaveableObject::saveFooter(SimpleFile *file, int indent) const {
 	file->writeClassEnd(indent);
 }
 
-bool CSaveableObject::isInstanceOf(const ClassDef &classDef) {
+bool CSaveableObject::isInstanceOf(const ClassDef *classDef) {
 	for (ClassDef *def = getType(); def != nullptr; def = def->_parent) {
-		if (def == &classDef)
+		if (def == classDef)
 			return true;
 	}
 
diff --git a/engines/titanic/core/saveable_object.h b/engines/titanic/core/saveable_object.h
index c4615c5..1fb509b 100644
--- a/engines/titanic/core/saveable_object.h
+++ b/engines/titanic/core/saveable_object.h
@@ -80,7 +80,7 @@ public:
 	CLASSDEF
 	virtual ~CSaveableObject() {}
 	
-	bool isInstanceOf(const ClassDef &classDef);
+	bool isInstanceOf(const ClassDef *classDef);
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 31deab8..ffcee40 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -88,6 +88,26 @@ CTreeItem *CTreeItem::scan(CTreeItem *item) const {
 	return nullptr;
 }
 
+CTreeItem *CTreeItem::findChildInstanceOf(ClassDef *classDef) const {
+	for (CTreeItem *treeItem = _firstChild; treeItem; treeItem = treeItem->getNextSibling()) {
+		if (treeItem->isInstanceOf(classDef))
+			return treeItem;
+	}
+
+	return nullptr;
+}
+
+CTreeItem *CTreeItem::findNextInstanceOf(ClassDef *classDef, CTreeItem *startItem) const {
+	CTreeItem *treeItem = startItem ? startItem->getNextSibling() : getFirstChild();
+
+	for (; treeItem; treeItem = treeItem->getNextSibling()) {
+		if (treeItem->isInstanceOf(classDef))
+			return treeItem;
+	}
+
+	return nullptr;
+}
+
 void CTreeItem::addUnder(CTreeItem *newParent) {
 	if (newParent->_firstChild)
 		addSibling(newParent->getLastSibling());
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index afca525..e218cf3 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -119,6 +119,16 @@ public:
 	CTreeItem *scan(CTreeItem *item) const;
 
 	/**
+	 * Find the first child item that is of a given type
+	 */
+	CTreeItem *findChildInstanceOf(ClassDef *classDef) const;
+
+	/**
+	 * Find the next sibling item that is of the given type
+	 */
+	CTreeItem *findNextInstanceOf(ClassDef *classDef, CTreeItem *startItem) const;
+
+	/**
 	 * Adds the item under another tree item
 	 */
 	void addUnder(CTreeItem *newParent);
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index e64229e..5253f24 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CViewItem::CViewItem() : CNamedItem() {
 	_field24 = 0;
 	_field28 = 0.0;
-	_field30 = 0;
+	_viewNumber = 0;
 	_field50 = 0;
 	_field54 = 0;
 	setData(0.0);
@@ -44,7 +44,7 @@ void CViewItem::save(SimpleFile *file, int indent) const {
 	_resourceKey.save(file, indent);
 	file->writeQuotedLine("V", indent);
 	file->writeFloatLine(_field28, indent + 1);
-	file->writeNumberLine(_field30, indent + 1);
+	file->writeNumberLine(_viewNumber, indent + 1);
 
 	CNamedItem::save(file, indent);
 }
@@ -60,7 +60,7 @@ void CViewItem::load(SimpleFile *file) {
 	default:
 		file->readBuffer();
 		setData(file->readFloat());
-		_field30 = file->readNumber();
+		_viewNumber = file->readNumber();
 		break;
 	}
 
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index a5ce575..805b7a4 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -34,11 +34,12 @@ private:
 protected:
 	int _field24;
 	double _field28;
-	int _field30;
 	CResourceKey _resourceKey;
 	int _field50;
 	int _field54;
 public:
+	int _viewNumber;
+public:
 	CLASSDEF
 	CViewItem();
 
diff --git a/engines/titanic/game/room_item.h b/engines/titanic/game/room_item.h
index 7441ed0..2235f6a 100644
--- a/engines/titanic/game/room_item.h
+++ b/engines/titanic/game/room_item.h
@@ -32,7 +32,7 @@
 namespace Titanic {
 
 class CRoomItem : public CNamedItem {
-private:
+public:
 	Common::Rect _roomRect;
 	CMovieClipList _clipList;
 	int _roomNumber;
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index b677bf2..d8409e6 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -21,18 +21,33 @@
  */
 
 #include "titanic/game_manager.h"
+#include "titanic/game_view.h"
 #include "titanic/screen_manager.h"
 #include "titanic/core/project_item.h"
 #include "titanic/messages/messages.h"
 
+
 namespace Titanic {
 
+void CGameManagerList::postLoad(uint ticks, CProjectItem *project) {
+	for (iterator i = begin(); i != end(); ++i)
+		(*i)->postLoad(ticks, project);
+}
+
+/*------------------------------------------------------------------------*/
+
+void CGameManagerListItem::postLoad(uint ticks, CProjectItem *project) {
+	warning("TODO");
+}
+
+/*------------------------------------------------------------------------*/
+
 CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
 		_project(project), _gameView(gameView), _trueTalkManager(this),
 		_inputHandler(this), _inputTranslator(&_inputHandler),		
 		_gameState(this), _sound(this), _musicRoom(this),
-		_field30(0), _field34(0), _field48(0),
-		_field4C(0), _field50(0), _field54(0), _tickCount(0) {
+		_field30(0), _field34(0), _field48(0), _field4C(0), 
+		_field50(0), _field54(0), _tickCount1(0), _tickCount2(0) {
 	_videoSurface = CScreenManager::_screenManagerPtr->createSurface(600, 340);
 	_project->setGameManager(this);
 }
@@ -44,14 +59,29 @@ void CGameManager::load(SimpleFile *file) {
 	_list.load(file);
 	_trueTalkManager.load(file);
 	_sound.load(file);
-
 }
 
-void CGameManager::gameLoaded() {
-	// TODO
+void CGameManager::postLoad(CProjectItem *project) {
+	if (_gameView) {
+		_gameView->postLoad();
+
+		if (!_gameView->_fieldC) {
+			int v = fn2();
+			if (v)
+				_gameView->proc3(v);
+		}
+	}
+	
+	// Signal to anything interested that the game has been loaded
+	CLoadSuccessMsg msg(_tickCount1 - _tickCount2);
+	msg.execute(project, nullptr, MSGFLAG_SCAN);
 
-	//CLoadSuccessMsg msg(0);
+	// Signal to any registered list items
+	_list.postLoad(_tickCount1, _project);
 
+	// Signal the true talk manager and sound
+	_trueTalkManager.postLoad();
+	_sound.postLoad();
 }
 
-} // End of namespace Titanic z
+} // End of namespace Titanic
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 37a4a41..1d2a88e 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -39,14 +39,19 @@ class CProjectItem;
 class CGameView;
 
 class CGameManagerListItem : public ListItem {
+private:
+	static int _v1;
+public:
+	void postLoad(uint ticks, CProjectItem *project);
 };
 
 class CGameManagerList : public List<CGameManagerListItem> {
+public:
+	void postLoad(uint ticks, CProjectItem *project);
 };
 
 class CGameManager {
 private:
-	CProjectItem *_project;
 	CGameView *_gameView;
 	CGameState _gameState;
 	CSound _sound;
@@ -63,7 +68,10 @@ private:
 	int _field50;
 	int _field54;
 	CVideoSurface *_videoSurface;
-	int _tickCount;
+	uint _tickCount1;
+	uint _tickCount2;
+public:
+	CProjectItem *_project;
 public:
 	CGameManager(CProjectItem *project, CGameView *gameView);
 	~CGameManager();
@@ -76,7 +84,9 @@ public:
 	/**
 	 * Called after loading a game has finished
 	 */
-	void gameLoaded();
+	void postLoad(CProjectItem *project);
+
+	int fn2() { return _gameState._sub.fn2(); }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_state_sub.cpp b/engines/titanic/game_state_sub.cpp
index 212fcce..2e379a0 100644
--- a/engines/titanic/game_state_sub.cpp
+++ b/engines/titanic/game_state_sub.cpp
@@ -42,4 +42,9 @@ void CGameStateSub::load(SimpleFile *file) {
 	_fieldC = file->readNumber();
 }
 
+int CGameStateSub::fn2() {
+	warning("TODO");
+	return 0;
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/game_state_sub.h b/engines/titanic/game_state_sub.h
index 2ea6bd6..82917d9 100644
--- a/engines/titanic/game_state_sub.h
+++ b/engines/titanic/game_state_sub.h
@@ -49,6 +49,8 @@ public:
 	 * Load the data for the class from file
 	 */
 	void load(SimpleFile *file);
+
+	int fn2();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index d8410f1..a0542b5 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -22,20 +22,44 @@
 
 #include "titanic/game_view.h"
 #include "titanic/game_manager.h"
+#include "titanic/main_game_window.h"
 
 namespace Titanic {
 
-CGameView::CGameView() : _gameManager(nullptr), _field8(0), _fieldC(0) {
+CGameView::CGameView() : _gameManager(nullptr), _fieldC(nullptr),
+		_field8(0) {
 }
 
 void CGameView::setGameManager(CGameManager *gameManager) {
 	_gameManager = gameManager;
 }
 
+void CGameView::postLoad() {
+	if (_fieldC)
+		warning("TODO");
+	
+	_fieldC = nullptr;
+}
+
+void CGameView::deleteView(int roomNumber, int nodeNumber, int viewNumber) {
+	CViewItem *view = _gameManager->_project->findView(roomNumber, nodeNumber, viewNumber);
+	if (view)
+		delete view;
+}
+
+
 /*------------------------------------------------------------------------*/
 
-CTitanicGameView::CTitanicGameView(CMainGameWindow *gameWindow) : 
+CSTGameView::CSTGameView(CMainGameWindow *gameWindow) :
 		CGameView(), _gameWindow(gameWindow) {
 }
 
+void CSTGameView::proc3(int v) {
+	_gameWindow->fn1(v);
+}
+
+void CSTGameView::proc4() {
+	_gameWindow->fn2();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h
index 588cf93..5a2c04a 100644
--- a/engines/titanic/game_view.h
+++ b/engines/titanic/game_view.h
@@ -24,6 +24,7 @@
 #define TITANIC_GAME_VIEW_H
 
 #include "common/scummsys.h"
+#include "titanic/core/view_item.h"
 
 namespace Titanic {
 
@@ -34,7 +35,8 @@ class CGameView {
 protected:
 	CGameManager *_gameManager;
 	int _field8;
-	int _fieldC;
+public:
+	void *_fieldC;
 public:
 	CGameView();
 
@@ -42,13 +44,26 @@ public:
 	 * Set the game manager
 	 */
 	void setGameManager(CGameManager *gameManager);
+
+	/**
+	 * Called after loading a game has finished
+	 */
+	void postLoad();
+
+	virtual void deleteView(int roomNumber, int nodeNumber, int viewNumber);
+
+	virtual void proc3(int v) = 0;
+	virtual void proc4() = 0;
 };
 
-class CTitanicGameView: public CGameView {
+class CSTGameView: public CGameView {
 private:
 	CMainGameWindow *_gameWindow;
 public:
-	CTitanicGameView(CMainGameWindow *gameWindow);
+	CSTGameView(CMainGameWindow *gameWindow);
+
+	virtual void proc3(int v);
+	virtual void proc4();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index c4eec39..3264705 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -58,7 +58,7 @@ void CMainGameWindow::applicationStarting() {
 	// TODO: Clear surfaces
 
 	// Create game view and manager
-	_gameView = new CTitanicGameView(this);
+	_gameView = new CSTGameView(this);
 	_gameManager = new CGameManager(_project, _gameView);
 	_gameView->setGameManager(_gameManager);
 
@@ -80,4 +80,12 @@ int CMainGameWindow::selectSavegame() {
 	return -1;
 }
 
+void CMainGameWindow::fn1(int v) {
+	warning("TODO");
+}
+
+void CMainGameWindow::fn2() {
+	warning("TODO");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 4796a4f..e6e7241 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -68,6 +68,10 @@ public:
 	 * Called when the application starts
 	 */
 	void applicationStarting();
+
+	void fn1(int v);
+
+	void fn2();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
index 1f7a5a0..1e49994 100644
--- a/engines/titanic/messages/messages.cpp
+++ b/engines/titanic/messages/messages.cpp
@@ -50,7 +50,7 @@ bool CMessage::execute(CTreeItem *target, const ClassDef *classDef, int flags) {
 		if (flags & MSGFLAG_SCAN)
 			nextItem = item->scan(target);
 
-		if (!(flags & MSGFLAG_CLASS_DEF) || item->isInstanceOf(*classDef)) {
+		if (!(flags & MSGFLAG_CLASS_DEF) || item->isInstanceOf(classDef)) {
 			bool handled = perform(item);
 
 			if (handled) {
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 1908b73..80ce590 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -42,7 +42,8 @@ public:
 	CLASSDEF
 	CMessage();
 
-	bool execute(CTreeItem *target, const ClassDef *classDef, int flags);
+	bool execute(CTreeItem *target, const ClassDef *classDef = nullptr,
+		int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED);
 
 	virtual bool perform(CTreeItem *treeItem) { return false; }
 
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index e123e99..7ed223d 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -49,7 +49,7 @@ void CPetControl::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-void CPetControl::gameLoaded() {
+void CPetControl::postLoad() {
 	// TODO
 }
 
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 0eb2034..70f6850 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -79,7 +79,7 @@ public:
 	/**
 	 * Called after loading a game has finished
 	 */
-	void gameLoaded();
+	void postLoad();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index 6ae4019..a78bc79 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -46,6 +46,11 @@ public:
 	 * Load the data for the class from file
 	 */
 	void load(SimpleFile *file);
+
+	/**
+	 * Called when loading a game is complete
+	 */
+	void postLoad() { _soundManager.postLoad(); }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index 4936625..cb88b66 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -64,7 +64,11 @@ public:
 	 */
 	void load(SimpleFile *file) {}
 
-	virtual void proc25() {}
+	/**
+	 * Called after loading of a game is completed
+	 */
+	virtual void postLoad() {}
+
 	virtual void proc26() {}
 
 	/**
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 274b5cc..904f3c4 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -78,6 +78,11 @@ public:
 	void load(SimpleFile *file);
 
 	/**
+	 * Called when loading a game is complete
+	 */
+	void postLoad() {}
+
+	/**
 	 * Returns the scripts for the manager
 	 */
 	TTScripts &getScripts() { return _scripts; }


Commit: c6b07dcdd7d2ec629d0287922f47e48de90dfc97
    https://github.com/scummvm/scummvm/commit/c6b07dcdd7d2ec629d0287922f47e48de90dfc97
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-12T22:03:01-05:00

Commit Message:
TITANIC: Added CGameObjectDescItem class

Changed paths:
  A engines/titanic/core/game_object_desc_item.cpp
  A engines/titanic/core/game_object_desc_item.h
    engines/titanic/core/game_object.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/saveable_object.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control_sub1.h



diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 0d9f918..3809ae3 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -75,4 +75,4 @@ public:
 
 } // End of namespace Titanic
 
-#endif /* TITANIC_PET_CONTROL_H */
+#endif /* TITANIC_GAME_OBJECT_H */
diff --git a/engines/titanic/core/game_object_desc_item.cpp b/engines/titanic/core/game_object_desc_item.cpp
new file mode 100644
index 0000000..77174e5
--- /dev/null
+++ b/engines/titanic/core/game_object_desc_item.cpp
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/game_object_desc_item.h"
+
+namespace Titanic {
+
+CGameObjectDescItem::CGameObjectDescItem(): CTreeItem() {
+}
+
+void CGameObjectDescItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	_clipList.save(file, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_string2, indent);
+	_list1.save(file, indent);
+	_list2.save(file, indent);
+
+	CTreeItem::save(file, indent);
+}
+
+void CGameObjectDescItem::load(SimpleFile *file) {
+	int val = file->readNumber();
+
+	if (val != 1) {
+		if (val)
+			_clipList.load(file);
+
+		_string1 = file->readString();
+		_string2 = file->readString();
+		_list1.load(file);
+		_list1.load(file);
+	}
+
+	CTreeItem::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/game_object_desc_item.h b/engines/titanic/core/game_object_desc_item.h
new file mode 100644
index 0000000..4ac5816
--- /dev/null
+++ b/engines/titanic/core/game_object_desc_item.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GAME_OBJECT_DESK_ITEM_H
+#define TITANIC_GAME_OBJECT_DESK_ITEM_H
+
+#include "titanic/core/movie_clip.h"
+#include "titanic/core/tree_item.h"
+#include "titanic/core/list.h"
+
+namespace Titanic {
+
+class CGameObjectDescItem : public CTreeItem {
+protected:
+	CString _string1;
+	CString _string2;
+	List<ListItem> _list1;
+	List<ListItem> _list2;
+	CMovieClipList _clipList;
+public:
+	CLASSDEF
+	CGameObjectDescItem();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GAME_OBJECT_DESK_ITEM_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 8e9ec4e..95175ca 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -64,6 +64,8 @@
 #include "titanic/core/dont_save_file_item.h"
 #include "titanic/core/drop_target.h"
 #include "titanic/core/file_item.h"
+#include "titanic/core/game_object.h"
+#include "titanic/core/game_object_desc_item.h"
 #include "titanic/core/link_item.h"
 #include "titanic/core/list.h"
 #include "titanic/core/message_target.h"
@@ -467,6 +469,7 @@ DEFFN(CDropTarget)
 DEFFN(CFileItem)
 DEFFN(CFileListItem)
 DEFFN(CGameObject)
+DEFFN(CGameObjectDescItem)
 DEFFN(CLinkItem)
 DEFFN(ListItem)
 DEFFN(CMessageTarget)
@@ -1031,6 +1034,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CFileItem, CTreeItem);
 	ADDFN(CFileListItem, ListItem);
 	ADDFN(CGameObject, CNamedItem);
+	ADDFN(CGameObjectDescItem, CTreeItem);
 	ADDFN(CLinkItem, CNamedItem);
 	ADDFN(ListItem, CSaveableObject);
 	ADDFN(CMessageTarget, CSaveableObject);
@@ -1581,7 +1585,7 @@ void CSaveableObject::saveFooter(SimpleFile *file, int indent) const {
 	file->writeClassEnd(indent);
 }
 
-bool CSaveableObject::isInstanceOf(const ClassDef *classDef) {
+bool CSaveableObject::isInstanceOf(const ClassDef *classDef) const {
 	for (ClassDef *def = getType(); def != nullptr; def = def->_parent) {
 		if (def == classDef)
 			return true;
@@ -1590,6 +1594,4 @@ bool CSaveableObject::isInstanceOf(const ClassDef *classDef) {
 	return false;
 }
 
-
-
 } // End of namespace Titanic
diff --git a/engines/titanic/core/saveable_object.h b/engines/titanic/core/saveable_object.h
index 1fb509b..5a6e4c9 100644
--- a/engines/titanic/core/saveable_object.h
+++ b/engines/titanic/core/saveable_object.h
@@ -80,7 +80,7 @@ public:
 	CLASSDEF
 	virtual ~CSaveableObject() {}
 	
-	bool isInstanceOf(const ClassDef *classDef);
+	bool isInstanceOf(const ClassDef *classDef) const;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index ffcee40..127a950 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -23,7 +23,13 @@
 #include "titanic/core/tree_item.h"
 #include "titanic/core/dont_save_file_item.h"
 #include "titanic/core/file_item.h"
+#include "titanic/core/game_object.h"
+#include "titanic/core/game_object_desc_item.h"
+#include "titanic/core/link_item.h"
 #include "titanic/core/named_item.h"
+#include "titanic/core/node_item.h"
+#include "titanic/core/view_item.h"
+#include "titanic/game/room_item.h"
 
 namespace Titanic {
 
@@ -31,6 +37,38 @@ CTreeItem::CTreeItem() : _parent(nullptr), _firstChild(nullptr),
 	_nextSibling(nullptr), _priorSibling(nullptr), _field14(0) {
 }
 
+bool CTreeItem::isFileItem() const {
+	return isInstanceOf(CFileItem::_type);
+}
+
+bool CTreeItem::isRoomItem() const {
+	return isInstanceOf(CRoomItem::_type);
+}
+
+bool CTreeItem::isNodeItem() const {
+	return isInstanceOf(CNodeItem::_type);
+}
+
+bool CTreeItem::isViewItem() const {
+	return isInstanceOf(CViewItem::_type);
+}
+
+bool CTreeItem::isLinkItem() const {
+	return isInstanceOf(CLinkItem::_type);
+}
+
+bool CTreeItem::isNamedItem() const {
+	return isInstanceOf(CNamedItem::_type);
+}
+
+bool CTreeItem::isGameObject() const {
+	return isInstanceOf(CGameObject::_type);
+}
+
+bool CTreeItem::isGameObjectDescItem() const {
+	return isInstanceOf(CGameObjectDescItem::_type);
+}
+
 void CTreeItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(0, indent);
 	CMessageTarget::save(file, indent);
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index e218cf3..32b76c9 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -60,12 +60,42 @@ public:
 	/**
 	 * Returns true if the item is a file item
 	 */
-	virtual bool isFileItem() const { return false; }
+	virtual bool isFileItem() const;
+
+	/**
+	 * Returns true if the item is a room item
+	 */
+	virtual bool isRoomItem() const;
+
+	/**
+	 * Returns true if the item is a node item
+	 */
+	virtual bool isNodeItem() const;
+
+	/**
+	 * Returns true if the item is a view item
+	 */
+	virtual bool isViewItem() const;
+
+	/**
+	 * Returns true if the item is a link item
+	 */
+	virtual bool isLinkItem() const;
 
 	/**
 	 * Returns true if the item is a named item
 	 */
-	virtual bool isNamedItem() const { return false; }
+	virtual bool isNamedItem() const;
+
+	/**
+	 * Returns true if the item is a game object
+	 */
+	virtual bool isGameObject() const;
+
+	/**
+	 * Returns true if the item is a game object desc item
+	 */
+	virtual bool isGameObjectDescItem() const;
 
 	/**
 	 * Gets the name of the item, if any
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index e95977a..3c82bdb 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -62,6 +62,7 @@ MODULE_OBJS := \
 	core/drop_target.o \
 	core/file_item.o \
 	core/game_object.o \
+	core/game_object_desc_item.o \
 	core/link_item.o \
 	core/list.o \
 	core/message_target.o \
diff --git a/engines/titanic/pet_control/pet_control_sub1.h b/engines/titanic/pet_control/pet_control_sub1.h
index e826182..5d0edb6 100644
--- a/engines/titanic/pet_control/pet_control_sub1.h
+++ b/engines/titanic/pet_control/pet_control_sub1.h
@@ -66,4 +66,4 @@ public:
 
 } // End of namespace Titanic
 
-#endif /* TITANIC_PET_CONTROL_H */
+#endif /* TITANIC_PET_CONTROL_SUB1_H */


Commit: f0d992d8548ee8bacae72ecc15e69f9de4187549
    https://github.com/scummvm/scummvm/commit/f0d992d8548ee8bacae72ecc15e69f9de4187549
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-13T10:28:45-04:00

Commit Message:
TITANIC: Implemented setMode method for game state

Changed paths:
    engines/titanic/game_manager.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/input_handler.cpp
    engines/titanic/input_handler.h
    engines/titanic/screen_manager.h



diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 1d2a88e..d53a611 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -87,6 +87,16 @@ public:
 	void postLoad(CProjectItem *project);
 
 	int fn2() { return _gameState._sub.fn2(); }
+
+	/**
+	 * Lock the input handler
+	 */
+	void lockInputHandler() { _inputHandler.incLockCount(); }
+
+	/**
+	 * Unlock the input handler
+	 */
+	void unlockInputHandler() { _inputHandler.decLockCount(); }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 59e4b7b..41c4388 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -21,12 +21,14 @@
  */
 
 #include "titanic/game_state.h"
+#include "titanic/game_manager.h"
+#include "titanic/screen_manager.h"
 
 namespace Titanic {
 
 CGameState::CGameState(CGameManager *gameManager) :
 		_gameManager(gameManager), _sub(this),
-		_field8(0), _fieldC(0), _field10(10), _field14(0), _field18(0),
+		_field8(0), _fieldC(0), _mode(10), _field14(0), _field18(0),
 		_field1C(0), _field20(0), _field24(0), _field28(0), _field2C(0),
 		_field30(0), _field34(0), _field38(0) {
 }
@@ -55,4 +57,25 @@ void CGameState::load(SimpleFile *file) {
 	_field28 = _field2C = 0;
 }
 
+void CGameState::setMode(int newMode) {
+	CScreenManager *sm = CScreenManager::_screenManagerPtr;
+
+	if (newMode == 2 && newMode != _mode) {
+		if (_gameManager)
+			_gameManager->lockInputHandler();
+
+		if (sm && sm->_mouseCursor)
+			sm->_mouseCursor->hide();
+
+	} else if (newMode != 2 && newMode != _mode) {
+		if (sm && sm->_mouseCursor)
+			sm->_mouseCursor->show();
+	
+		if (_gameManager)
+			_gameManager->unlockInputHandler();
+	}
+
+	_mode = newMode;
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index e6275de..1f93f69 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -46,7 +46,7 @@ public:
 	CGameStateList _list;
 	int _field8;
 	int _fieldC;
-	int _field10;
+	int _mode;
 	int _field14;
 	int _field18;
 	int _field1C;
@@ -69,6 +69,11 @@ public:
 	 * Load the data for the class from file
 	 */
 	void load(SimpleFile *file);
+
+	/**
+	 * Sets a new mode
+	 */
+	void setMode(int newMode);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index 0c09429..d5825c0 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 CInputHandler::CInputHandler(CGameManager *owner) :
 		_gameManager(owner), _inputTranslator(nullptr),
 		_field4(0), _field8(0), _fieldC(0), _field10(0), _field14(0),
-		_field18(0), _field1C(0), _field20(0), _field24(0) {
+		_lockCount(0), _field24(0) {
 	CScreenManager::_screenManagerPtr->_inputHandler = this;
 }
 
@@ -36,4 +36,14 @@ void CInputHandler::setTranslator(CInputTranslator *translator) {
 	_inputTranslator = translator;
 }
 
+void CInputHandler::incLockCount() {
+	++_lockCount;
+}
+
+void CInputHandler::decLockCount() {
+	if (--_lockCount == 0 && _inputTranslator) {
+		warning("TODO");
+	}
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/input_handler.h b/engines/titanic/input_handler.h
index 288630c..1bc6dc9 100644
--- a/engines/titanic/input_handler.h
+++ b/engines/titanic/input_handler.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_INPUT_HANDLER_H
 #define TITANIC_INPUT_HANDLER_H
 
+#include "common/rect.h"
 #include "titanic/input_translator.h"
 
 namespace Titanic {
@@ -38,14 +39,23 @@ public:
 	int _fieldC;
 	int _field10;
 	int _field14;
-	int _field18;
-	int _field1C;
-	int _field20;
+	Common::Point _mousePos;
+	int _lockCount;
 	int _field24;
 public:
 	CInputHandler(CGameManager *owner);
 
 	void setTranslator(CInputTranslator *translator);
+
+	/**
+	 * Increment the lock count
+	 */
+	void incLockCount();
+
+	/**
+	 * Decrement the lock count on the input handler
+	 */
+	void decLockCount();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index 914fc85..d0bcc5d 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -47,6 +47,11 @@ public:
 	CScreenManagerRec();
 };
 
+struct MouseCursor {
+	void show() {}
+	void hide() {}
+};
+
 class CScreenManager {
 protected:
 	TitanicEngine *_vm;
@@ -62,7 +67,7 @@ public:
 	Common::Array<CVideoSurface *> _backSurfaces;
 	CVideoSurface *_frontRenderSurface;
 	CScreenManagerRec _entries[2];
-	void *_mouseCursor;
+	MouseCursor *_mouseCursor;
 	void *_textCursor;
 	CInputHandler *_inputHandler;
 	int _fontNumber;


Commit: c92bf22f0331fbdbc7e440b43ae1973b679befb3
    https://github.com/scummvm/scummvm/commit/c92bf22f0331fbdbc7e440b43ae1973b679befb3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-13T15:07:27-04:00

Commit Message:
TITANIC: Changed CGameStateSub to CGameLocation, properly implemented it

Changed paths:
  A engines/titanic/core/room_item.cpp
  A engines/titanic/core/room_item.h
  A engines/titanic/game_location.cpp
  A engines/titanic/game_location.h
  R engines/titanic/game/room_item.cpp
  R engines/titanic/game/room_item.h
  R engines/titanic/game_state_sub.cpp
  R engines/titanic/game_state_sub.h
    engines/titanic/core/named_item.cpp
    engines/titanic/core/named_item.h
    engines/titanic/core/project_item.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/tree_item.cpp
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/game_view.cpp
    engines/titanic/game_view.h
    engines/titanic/main_game_window.cpp
    engines/titanic/main_game_window.h
    engines/titanic/module.mk



diff --git a/engines/titanic/core/named_item.cpp b/engines/titanic/core/named_item.cpp
index 641efbd..cd798a2 100644
--- a/engines/titanic/core/named_item.cpp
+++ b/engines/titanic/core/named_item.cpp
@@ -21,6 +21,8 @@
  */
 
 #include "titanic/core/named_item.h"
+#include "titanic/core/node_item.h"
+#include "titanic/core/room_item.h"
 
 namespace Titanic {
 
@@ -47,4 +49,24 @@ int CNamedItem::compareTo(const CString &name, int maxLen) const {
 	}
 }
 
+CNodeItem *CNamedItem::findNode() const {
+	for (CTreeItem *parent = getParent(); parent; parent = parent->getParent()) {
+		CNodeItem *node = dynamic_cast<CNodeItem *>(parent);
+		if (node)
+			return node;
+	}
+
+	error("Couldn't find parent node");
+}
+
+CRoomItem *CNamedItem::findRoom() const {
+	for (CTreeItem *parent = getParent(); parent; parent = parent->getParent()) {
+		CRoomItem *room = dynamic_cast<CRoomItem *>(parent);
+		if (room)
+			return room;
+	}
+
+	error("Couldn't find parent node");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/named_item.h b/engines/titanic/core/named_item.h
index 0afbf70..6e6178e 100644
--- a/engines/titanic/core/named_item.h
+++ b/engines/titanic/core/named_item.h
@@ -27,6 +27,9 @@
 
 namespace Titanic {
 
+class CNodeItem;
+class CRoomItem;
+
 class CNamedItem: public CTreeItem {
 public:
 	CString _name;
@@ -44,11 +47,6 @@ public:
 	virtual void load(SimpleFile *file);
 
 	/**
-	 * Returns true if the item is a named item
-	 */
-	virtual bool isNamedItem() const { return true; }
-
-	/**
 	 * Gets the name of the item, if any
 	 */
 	virtual const CString getName() const { return _name; }
@@ -57,6 +55,16 @@ public:
 	 * Compares the name of the item to a passed name
 	 */
 	virtual int compareTo(const CString &name, int maxLen) const;
+
+	/**
+	 * Find a parent node for the item
+	 */
+	virtual CNodeItem *findNode() const;
+
+	/**
+	 * Find a parent room item for the item
+	 */
+	virtual CRoomItem *findRoom() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index 65fe8b8..bb96f81 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -28,7 +28,7 @@
 #include "titanic/core/dont_save_file_item.h"
 #include "titanic/core/file_item.h"
 #include "titanic/core/list.h"
-#include "titanic/game/room_item.h"
+#include "titanic/core/room_item.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp
new file mode 100644
index 0000000..b0cefca
--- /dev/null
+++ b/engines/titanic/core/room_item.cpp
@@ -0,0 +1,106 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/room_item.h"
+
+namespace Titanic {
+
+CRoomItem::CRoomItem() : CNamedItem(), _roomNumber(0),
+		_roomDimensionX(0.0), _roomDimensionY(0.0) {
+}
+
+void CRoomItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(3, indent);
+	file->writeQuotedLine("Exit Movies", indent);
+	_exitMovieKey.save(file, indent);
+
+	file->writeNumberLine(_roomDimensionX * 1000.0, indent + 1);
+	file->writeNumberLine(_roomDimensionY * 1000.0, indent + 1);
+
+	file->writeQuotedLine("Transition Movie", indent);
+	_transitionMovieKey.save(file, indent);
+
+	file->writeQuotedLine("Movie Clip list", indent);
+	_clipList.save(file, indent + 1);
+
+	file->writeQuotedLine("Room Rect", indent);
+	file->writeNumberLine(_roomRect.left, indent + 1);
+	file->writeNumberLine(_roomRect.top, indent + 1);
+	file->writeNumberLine(_roomRect.right, indent + 1);
+	file->writeNumberLine(_roomRect.bottom, indent + 1);
+
+	file->writeQuotedLine("Room Number", indent);
+	file->writeNumberLine(_roomNumber, indent);
+
+	CNamedItem::save(file, indent);
+}
+
+void CRoomItem::load(SimpleFile *file) {
+	int val = file->readNumber();
+	
+	switch (val) {
+	case 3:
+		// Read exit movie
+		file->readBuffer();
+		_exitMovieKey.load(file);
+		// Deliberate fall-through
+
+	case 2:
+		// Read room dimensions
+		file->readBuffer();
+		_roomDimensionX = (double)file->readNumber() / 1000.0;
+		_roomDimensionY = (double)file->readNumber() / 1000.0;
+		// Deliberate fall-through
+
+	case 1:
+		// Read transition movie key and clip list
+		file->readBuffer();
+		_transitionMovieKey.load(file);
+
+		file->readBuffer();
+		_clipList.load(file);
+		loading();
+		// Deliberate fall-through
+
+	case 0:
+		// Read room rect
+		file->readBuffer();
+		_roomRect.left = file->readNumber();
+		_roomRect.top = file->readNumber();
+		_roomRect.right = file->readNumber();
+		_roomRect.bottom = file->readNumber();
+		file->readBuffer();
+		_roomNumber = file->readNumber();
+		break;
+
+	default:
+		break;
+	}
+
+	CNamedItem::load(file);
+}
+
+void CRoomItem::loading() {
+	// TODO
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
new file mode 100644
index 0000000..2235f6a
--- /dev/null
+++ b/engines/titanic/core/room_item.h
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ROOM_ITEM_H
+#define TITANIC_ROOM_ITEM_H
+
+#include "common/rect.h"
+#include "titanic/core/list.h"
+#include "titanic/core/movie_clip.h"
+#include "titanic/core/named_item.h"
+#include "titanic/core/resource_key.h"
+
+namespace Titanic {
+
+class CRoomItem : public CNamedItem {
+public:
+	Common::Rect _roomRect;
+	CMovieClipList _clipList;
+	int _roomNumber;
+	CResourceKey _transitionMovieKey;
+	CResourceKey _exitMovieKey;
+	double _roomDimensionX, _roomDimensionY;
+
+	void loading();
+public:
+	CLASSDEF
+	CRoomItem();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ROOM_ITEM_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 95175ca..449eb9a 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -73,6 +73,7 @@
 #include "titanic/core/multi_drop_target.h"
 #include "titanic/core/node_item.h"
 #include "titanic/core/project_item.h"
+#include "titanic/core/room_item.h"
 #include "titanic/core/saveable_object.h"
 #include "titanic/core/static_image.h"
 #include "titanic/core/turn_on_object.h"
@@ -181,7 +182,6 @@
 #include "titanic/game/reserved_table.h"
 #include "titanic/game/restaurant_cylinder_holder.h"
 #include "titanic/game/restaurant_phonograph.h"
-#include "titanic/game/room_item.h"
 #include "titanic/game/sauce_dispensor.h"
 #include "titanic/game/search_point.h"
 #include "titanic/game/season_background.h"
@@ -479,6 +479,7 @@ DEFFN(CNamedItem)
 DEFFN(CNodeItem)
 DEFFN(CProjectItem)
 DEFFN(CResourceKey)
+DEFFN(CRoomItem)
 DEFFN(CSaveableObject)
 DEFFN(CStaticImage)
 DEFFN(CTurnOnObject)
@@ -587,7 +588,6 @@ DEFFN(CReplacementEar)
 DEFFN(CReservedTable)
 DEFFN(CRestaurantCylinderHolder)
 DEFFN(CRestaurantPhonograph)
-DEFFN(CRoomItem)
 DEFFN(CSauceDispensor)
 DEFFN(CSearchPoint)
 DEFFN(CSeasonBackground)
@@ -1044,6 +1044,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CNodeItem, CNamedItem);
 	ADDFN(CProjectItem, CFileItem);
 	ADDFN(CResourceKey, CSaveableObject);
+	ADDFN(CRoomItem, CNamedItem);
 	ADDFN(CSaveableObject, CSaveableObject);
 	ADDFN(CStaticImage, CGameObject);
 	ADDFN(CTurnOnObject, CBackground);
@@ -1153,7 +1154,6 @@ void CSaveableObject::initClassList() {
 	ADDFN(CReservedTable, CGameObject);
 	ADDFN(CRestaurantCylinderHolder, CDropTarget);
 	ADDFN(CRestaurantPhonograph, CPhonograph);
-	ADDFN(CRoomItem, CNamedItem);
 	ADDFN(CSauceDispensor, CBackground);
 	ADDFN(CSearchPoint, CGameObject);
 	ADDFN(CSeasonBackground, CBackground);
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 127a950..3599732 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -29,7 +29,7 @@
 #include "titanic/core/named_item.h"
 #include "titanic/core/node_item.h"
 #include "titanic/core/view_item.h"
-#include "titanic/game/room_item.h"
+#include "titanic/core/room_item.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/game/room_item.cpp b/engines/titanic/game/room_item.cpp
deleted file mode 100644
index 17e0ffc..0000000
--- a/engines/titanic/game/room_item.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/room_item.h"
-
-namespace Titanic {
-
-CRoomItem::CRoomItem() : CNamedItem(), _roomNumber(0),
-		_roomDimensionX(0.0), _roomDimensionY(0.0) {
-}
-
-void CRoomItem::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(3, indent);
-	file->writeQuotedLine("Exit Movies", indent);
-	_exitMovieKey.save(file, indent);
-
-	file->writeNumberLine(_roomDimensionX * 1000.0, indent + 1);
-	file->writeNumberLine(_roomDimensionY * 1000.0, indent + 1);
-
-	file->writeQuotedLine("Transition Movie", indent);
-	_transitionMovieKey.save(file, indent);
-
-	file->writeQuotedLine("Movie Clip list", indent);
-	_clipList.save(file, indent + 1);
-
-	file->writeQuotedLine("Room Rect", indent);
-	file->writeNumberLine(_roomRect.left, indent + 1);
-	file->writeNumberLine(_roomRect.top, indent + 1);
-	file->writeNumberLine(_roomRect.right, indent + 1);
-	file->writeNumberLine(_roomRect.bottom, indent + 1);
-
-	file->writeQuotedLine("Room Number", indent);
-	file->writeNumberLine(_roomNumber, indent);
-
-	CNamedItem::save(file, indent);
-}
-
-void CRoomItem::load(SimpleFile *file) {
-	int val = file->readNumber();
-	
-	switch (val) {
-	case 3:
-		// Read exit movie
-		file->readBuffer();
-		_exitMovieKey.load(file);
-		// Deliberate fall-through
-
-	case 2:
-		// Read room dimensions
-		file->readBuffer();
-		_roomDimensionX = (double)file->readNumber() / 1000.0;
-		_roomDimensionY = (double)file->readNumber() / 1000.0;
-		// Deliberate fall-through
-
-	case 1:
-		// Read transition movie key and clip list
-		file->readBuffer();
-		_transitionMovieKey.load(file);
-
-		file->readBuffer();
-		_clipList.load(file);
-		loading();
-		// Deliberate fall-through
-
-	case 0:
-		// Read room rect
-		file->readBuffer();
-		_roomRect.left = file->readNumber();
-		_roomRect.top = file->readNumber();
-		_roomRect.right = file->readNumber();
-		_roomRect.bottom = file->readNumber();
-		file->readBuffer();
-		_roomNumber = file->readNumber();
-		break;
-
-	default:
-		break;
-	}
-
-	CNamedItem::load(file);
-}
-
-void CRoomItem::loading() {
-	// TODO
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/room_item.h b/engines/titanic/game/room_item.h
deleted file mode 100644
index 2235f6a..0000000
--- a/engines/titanic/game/room_item.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_ROOM_ITEM_H
-#define TITANIC_ROOM_ITEM_H
-
-#include "common/rect.h"
-#include "titanic/core/list.h"
-#include "titanic/core/movie_clip.h"
-#include "titanic/core/named_item.h"
-#include "titanic/core/resource_key.h"
-
-namespace Titanic {
-
-class CRoomItem : public CNamedItem {
-public:
-	Common::Rect _roomRect;
-	CMovieClipList _clipList;
-	int _roomNumber;
-	CResourceKey _transitionMovieKey;
-	CResourceKey _exitMovieKey;
-	double _roomDimensionX, _roomDimensionY;
-
-	void loading();
-public:
-	CLASSDEF
-	CRoomItem();
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ROOM_ITEM_H */
diff --git a/engines/titanic/game_location.cpp b/engines/titanic/game_location.cpp
new file mode 100644
index 0000000..cd4481e
--- /dev/null
+++ b/engines/titanic/game_location.cpp
@@ -0,0 +1,94 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game_location.h"
+#include "titanic/game_manager.h"
+#include "titanic/game_state.h"
+#include "titanic/core/project_item.h"
+
+namespace Titanic {
+
+#define STARTING_ROOM 3
+#define STARTING_NODE 1
+#define STARTING_VIEW 4
+
+CGameLocation::CGameLocation(CGameState *owner) : _gameState(owner),
+	_view(nullptr), _roomNumber(STARTING_ROOM),
+	_nodeNumber(STARTING_NODE), _viewNumber(STARTING_VIEW) {
+}
+
+void CGameLocation::save(SimpleFile *file) const {
+	file->writeNumber(_roomNumber);
+	file->writeNumber(_nodeNumber);
+	file->writeNumber(_viewNumber);
+}
+
+void CGameLocation::load(SimpleFile *file) {
+	_view = nullptr;
+	_roomNumber = file->readNumber();
+	_nodeNumber = file->readNumber();
+	_viewNumber = file->readNumber();
+}
+
+CViewItem *CGameLocation::getView() {
+	if (!_view) {
+		CGameManager *gm = _gameState->_gameManager;
+		_view = gm->_project->findView(_roomNumber, _nodeNumber, _viewNumber);
+
+		if (!_view) {
+			// Fallback if view not found
+			_view = gm->_project->findView(STARTING_ROOM,
+				STARTING_NODE, STARTING_VIEW);
+
+			if (!_view) {
+				// Fallback for the fallback
+				for (int idx = 0; idx < 99 && !_view; ++idx) {
+					_view = gm->_project->findView(idx, 1, 1);
+				}
+			}
+		}
+	}
+
+	if (!_view) {
+		// Okay seriously, yet another fallback if view not found
+		_viewNumber = _nodeNumber = _roomNumber = -1;
+		_view = nullptr;
+	} else {
+		_viewNumber = _view->_viewNumber;
+		_nodeNumber = getNode()->_nodeNumber;
+		_roomNumber = getRoom()->_roomNumber;
+	}
+
+	return _view;
+}
+
+CNodeItem *CGameLocation::getNode() {
+	CViewItem *view = getView();
+	return !view ? nullptr : view->findNode();
+}
+
+CRoomItem *CGameLocation::getRoom() {
+	CViewItem *view = getView();
+	return !view ? nullptr : view->findRoom();
+}
+
+} // End of namespace Titanic z
diff --git a/engines/titanic/game_location.h b/engines/titanic/game_location.h
new file mode 100644
index 0000000..94cea79
--- /dev/null
+++ b/engines/titanic/game_location.h
@@ -0,0 +1,74 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_GAME_LOCATION_H
+#define TITANIC_GAME_LOCATION_H
+
+#include "titanic/simple_file.h"
+#include "titanic/core/node_item.h"
+#include "titanic/core/room_item.h"
+#include "titanic/core/view_item.h"
+
+namespace Titanic {
+
+class CGameState;
+
+class CGameLocation {
+private:
+	CGameState *_gameState;
+	CViewItem *_view;
+
+	int _roomNumber;
+	int _nodeNumber;
+	int _viewNumber;
+public:
+	CGameLocation(CGameState *owner);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	void save(SimpleFile *file) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	void load(SimpleFile *file);
+
+	/**
+	 * Get the current view
+	 */
+	CViewItem *getView();
+
+	/**
+	 * Get the current node
+	 */
+	CNodeItem *getNode();
+
+	/**
+	 * Get the current room
+	 */
+	CRoomItem *getRoom();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_GAME_LOCATION_H */
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index d8409e6..53e7b34 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -66,9 +66,9 @@ void CGameManager::postLoad(CProjectItem *project) {
 		_gameView->postLoad();
 
 		if (!_gameView->_fieldC) {
-			int v = fn2();
-			if (v)
-				_gameView->proc3(v);
+			CViewItem *view = getView();
+			if (view)
+				_gameView->setView(view);
 		}
 	}
 	
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index d53a611..394bb67 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -86,7 +86,7 @@ public:
 	 */
 	void postLoad(CProjectItem *project);
 
-	int fn2() { return _gameState._sub.fn2(); }
+	CViewItem *getView() { return _gameState._gameLocation.getView(); }
 
 	/**
 	 * Lock the input handler
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 41c4388..b8b5ec1 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -27,7 +27,7 @@
 namespace Titanic {
 
 CGameState::CGameState(CGameManager *gameManager) :
-		_gameManager(gameManager), _sub(this),
+		_gameManager(gameManager), _gameLocation(this),
 		_field8(0), _fieldC(0), _mode(10), _field14(0), _field18(0),
 		_field1C(0), _field20(0), _field24(0), _field28(0), _field2C(0),
 		_field30(0), _field34(0), _field38(0) {
@@ -40,7 +40,7 @@ void CGameState::save(SimpleFile *file) const {
 	file->writeNumber(_field14);
 	file->writeNumber(_field24);
 	file->writeNumber(_field38);
-	_sub.save(file);
+	_gameLocation.save(file);
 	file->writeNumber(_field1C);
 }
 
@@ -51,7 +51,7 @@ void CGameState::load(SimpleFile *file) {
 	_field14 = file->readNumber();
 	_field24 = file->readNumber();
 	_field38 = file->readNumber();
-	_sub.load(file);
+	_gameLocation.load(file);
 
 	_field1C = file->readNumber();
 	_field28 = _field2C = 0;
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 1f93f69..f082163 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -25,7 +25,7 @@
 
 #include "titanic/core/list.h"
 #include "titanic/simple_file.h"
-#include "titanic/game_state_sub.h"
+#include "titanic/game_location.h"
 
 namespace Titanic {
 
@@ -42,7 +42,7 @@ public:
 class CGameState {
 public:
 	CGameManager *_gameManager;
-	CGameStateSub _sub;
+	CGameLocation _gameLocation;
 	CGameStateList _list;
 	int _field8;
 	int _fieldC;
diff --git a/engines/titanic/game_state_sub.cpp b/engines/titanic/game_state_sub.cpp
deleted file mode 100644
index 2e379a0..0000000
--- a/engines/titanic/game_state_sub.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game_state_sub.h"
-#include "titanic/game_state.h"
-
-namespace Titanic {
-
-CGameStateSub::CGameStateSub(CGameState *owner) : _gameState(owner),
-		_field0(0), _field4(0), _field8(0), _fieldC(0) {
-}
-
-void CGameStateSub::save(SimpleFile *file) const {
-	file->writeNumber(_field4);
-	file->writeNumber(_field8);
-	file->writeNumber(_fieldC);
-}
-
-void CGameStateSub::load(SimpleFile *file) {
-	_field0 = 0;
-	_field4 = file->readNumber();
-	_field8 = file->readNumber();
-	_fieldC = file->readNumber();
-}
-
-int CGameStateSub::fn2() {
-	warning("TODO");
-	return 0;
-}
-
-} // End of namespace Titanic z
diff --git a/engines/titanic/game_state_sub.h b/engines/titanic/game_state_sub.h
deleted file mode 100644
index 82917d9..0000000
--- a/engines/titanic/game_state_sub.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_GAME_STATE_SUB_H
-#define TITANIC_GAME_STATE_SUB_H
-
-#include "titanic/simple_file.h"
-
-namespace Titanic {
-
-class CGameState;
-
-class CGameStateSub {
-private:
-	CGameState *_gameState;
-public:
-	int _field0;
-	int _field4;
-	int _field8;
-	int _fieldC;
-public:
-	CGameStateSub(CGameState *owner);
-
-	/**
-	 * Save the data for the class to file
-	 */
-	void save(SimpleFile *file) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	void load(SimpleFile *file);
-
-	int fn2();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_GAME_STATE_SUB_H */
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index a0542b5..a8b8a02 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -54,8 +54,8 @@ CSTGameView::CSTGameView(CMainGameWindow *gameWindow) :
 		CGameView(), _gameWindow(gameWindow) {
 }
 
-void CSTGameView::proc3(int v) {
-	_gameWindow->fn1(v);
+void CSTGameView::setView(CViewItem *view) {
+	_gameWindow->setActiveView(view);
 }
 
 void CSTGameView::proc4() {
diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h
index 5a2c04a..2e4f700 100644
--- a/engines/titanic/game_view.h
+++ b/engines/titanic/game_view.h
@@ -52,7 +52,11 @@ public:
 
 	virtual void deleteView(int roomNumber, int nodeNumber, int viewNumber);
 
-	virtual void proc3(int v) = 0;
+	/**
+	 * Set the currently active view
+	 */
+	virtual void setView(CViewItem *item) = 0;
+	
 	virtual void proc4() = 0;
 };
 
@@ -62,7 +66,11 @@ private:
 public:
 	CSTGameView(CMainGameWindow *gameWindow);
 
-	virtual void proc3(int v);
+	/**
+	 * Set the currently active view
+	 */
+	virtual void setView(CViewItem *item);
+
 	virtual void proc4();
 };
 
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 3264705..18f8dca 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -80,7 +80,7 @@ int CMainGameWindow::selectSavegame() {
 	return -1;
 }
 
-void CMainGameWindow::fn1(int v) {
+void CMainGameWindow::setActiveView(CViewItem *view) {
 	warning("TODO");
 }
 
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index e6e7241..ec8eff3 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -69,7 +69,10 @@ public:
 	 */
 	void applicationStarting();
 
-	void fn1(int v);
+	/**
+	 * Sets the view to be shown
+	 */
+	void setActiveView(CViewItem *view);
 
 	void fn2();
 };
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 3c82bdb..48f6ce6 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -4,9 +4,9 @@ MODULE_OBJS := \
 	detection.o \
 	direct_draw.o \
 	font.o \
+	game_location.o \
 	game_manager.o \
 	game_state.o \
-	game_state_sub.o \
 	game_view.o \
 	image.o \
 	input_handler.o \
@@ -72,6 +72,7 @@ MODULE_OBJS := \
 	core/node_item.o \
 	core/project_item.o \
 	core/resource_key.o \
+	core/room_item.o \
 	core/saveable_object.o \
 	core/static_image.o \
 	core/turn_on_object.o \
@@ -180,7 +181,6 @@ MODULE_OBJS := \
 	game/reserved_table.o \
 	game/restaurant_cylinder_holder.o \
 	game/restaurant_phonograph.o \
-	game/room_item.o \
 	game/sauce_dispensor.o \
 	game/search_point.o \
 	game/season_background.o \


Commit: 819b773491b728ab0be933ffdcfc333e20d582d3
    https://github.com/scummvm/scummvm/commit/819b773491b728ab0be933ffdcfc333e20d582d3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-13T15:30:12-04:00

Commit Message:
TITANIC: Add message generation at end of applicationStarting

Changed paths:
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/main_game_window.cpp
    engines/titanic/messages/messages.h
    engines/titanic/titanic.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 449eb9a..3144e60 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -779,6 +779,9 @@ DEFFN(CDropobjectMsg)
 DEFFN(CDropZoneGotObjectMsg)
 DEFFN(CDropZoneLostObjectMsg)
 DEFFN(CEditControlMsg)
+DEFFN(CEnterNodeMsg);
+DEFFN(CEnterRoomMsg);
+DEFFN(CEnterViewMsg);
 DEFFN(CEjectCylinderMsg)
 DEFFN(CErasePhonographCylinderMsg)
 DEFFN(CFreshenCookieMsg)
@@ -1345,6 +1348,9 @@ void CSaveableObject::initClassList() {
 	ADDFN(CDropZoneGotObjectMsg, CMessage);
 	ADDFN(CDropZoneLostObjectMsg, CMessage);
 	ADDFN(CEditControlMsg, CMessage);
+	ADDFN(CEnterNodeMsg, CMessage);
+	ADDFN(CEnterRoomMsg, CMessage);
+	ADDFN(CEnterViewMsg, CMessage);
 	ADDFN(CEjectCylinderMsg, CMessage);
 	ADDFN(CErasePhonographCylinderMsg, CMessage);
 	ADDFN(CFreshenCookieMsg, CMessage);
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 53e7b34..0495d08 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -20,6 +20,7 @@
  *
  */
 
+#include "titanic/titanic.h"
 #include "titanic/game_manager.h"
 #include "titanic/game_view.h"
 #include "titanic/screen_manager.h"
@@ -84,4 +85,8 @@ void CGameManager::postLoad(CProjectItem *project) {
 	_sound.postLoad();
 }
 
+void CGameManager::initBounds() {
+	_bounds = Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 394bb67..a9bdaaa 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -53,7 +53,6 @@ public:
 class CGameManager {
 private:
 	CGameView *_gameView;
-	CGameState _gameState;
 	CSound _sound;
 	CInputHandler _inputHandler;
 	CInputTranslator _inputTranslator;
@@ -72,6 +71,7 @@ private:
 	uint _tickCount2;
 public:
 	CProjectItem *_project;
+	CGameState _gameState;
 public:
 	CGameManager(CProjectItem *project, CGameView *gameView);
 	~CGameManager();
@@ -97,6 +97,11 @@ public:
 	 * Unlock the input handler
 	 */
 	void unlockInputHandler() { _inputHandler.decLockCount(); }
+
+	/**
+	 * Set default screen bounds
+	 */
+	void initBounds();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 18f8dca..01996e6 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -24,6 +24,7 @@
 #include "titanic/main_game_window.h"
 #include "titanic/game_manager.h"
 #include "titanic/game_view.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
@@ -65,7 +66,22 @@ void CMainGameWindow::applicationStarting() {
 	// Load either a new game or selected existing save
 	_project->loadGame(saveSlot);
 
-	// TODO: Cursor/image and message generation
+	// TODO: Cursor/image
+
+	// Generate starting messages
+	CViewItem *view = _gameManager->_gameState._gameLocation.getView();
+	CEnterViewMsg enterViewMsg(view);
+	enterViewMsg.execute(view, nullptr, MSGFLAG_SCAN);
+
+	CNodeItem *node = view->findNode();
+	CEnterNodeMsg enterNodeMsg(node);
+	enterNodeMsg.execute(node, nullptr, MSGFLAG_SCAN);
+
+	CRoomItem *room = view->findRoom();
+	CEnterRoomMsg enterRoomMsg(room);
+	enterRoomMsg.execute(room, nullptr, MSGFLAG_SCAN);
+
+	_gameManager->initBounds();
 }
 
 int CMainGameWindow::loadGame() {
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 80ce590..5331881 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -25,6 +25,9 @@
 
 #include "titanic/core/saveable_object.h"
 #include "titanic/core/game_object.h"
+#include "titanic/core/node_item.h"
+#include "titanic/core/room_item.h"
+#include "titanic/core/view_item.h"
 
 namespace Titanic {
 
@@ -241,8 +244,9 @@ MESSAGE1(CDropobjectMsg, int, value, 0);
 MESSAGE1(CDropZoneGotObjectMsg, int, value, 0);
 MESSAGE1(CDropZoneLostObjectMsg, int, value, 0);
 MESSAGE1(CEjectCylinderMsg, int, value, 0);
-MESSAGE0(CEnterNodeMsg);
-MESSAGE0(CEnterViewMsg);
+MESSAGE1(CEnterNodeMsg, CNodeItem *, node, nullptr);
+MESSAGE1(CEnterRoomMsg, CRoomItem *, room, nullptr);
+MESSAGE1(CEnterViewMsg, CViewItem *, view, nullptr);
 MESSAGE0(CErasePhonographCylinderMsg);
 MESSAGE2(CFreshenCookieMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CGetChevClassBits, int, value, 0);
@@ -259,7 +263,9 @@ MESSAGE0(CInitializeAnimMsg);
 MESSAGE1(CIsEarBowlPuzzleDone, int, value, 0);
 MESSAGE1(CIsParrotPresentMsg, int, value, 0);
 MESSAGE1(CKeyCharMsg, int, value, 32);
-MESSAGE0(CLeaveViewMsg);
+MESSAGE1(CLeaveNodeMsg, CNodeItem *, node, nullptr);
+MESSAGE1(CLeaveRoomMsg, CRoomItem *, room, nullptr);
+MESSAGE1(CLeaveViewMsg, CViewItem *, view, nullptr);
 MESSAGE2(CLemonFallsFromTreeMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CLoadSuccessMsg, int, ticks, 0);
 MESSAGE1(CLockPhonographMsg, int, value, 0);
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 3a95e86..978f9b3 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -50,6 +50,9 @@ enum TitanicDebugChannels {
 
 #define TITANIC_SAVEGAME_VERSION 1
 
+#define SCREEN_WIDTH 640
+#define SCREEN_HEIGHT 480
+
 #define ERROR_BASIC 1
 #define ERROR_INTERMEDIATE 2
 #define ERROR_DETAILED 3


Commit: b57805bd4b5f9beca9fe6e8e697744c89cad09f3
    https://github.com/scummvm/scummvm/commit/b57805bd4b5f9beca9fe6e8e697744c89cad09f3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-13T15:39:35-04:00

Commit Message:
TITANIC: Added main game event loop

Changed paths:
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index bcccf1b..b00e1c3 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -87,7 +87,20 @@ void TitanicEngine::deinitialize() {
 Common::Error TitanicEngine::run() {
 	initialize();
 
+	// Main event loop
+	while (!shouldQuit()) {
+		processEvents();
+		g_system->delayMillis(5);		
+	}
+
+	deinitialize();
 	return Common::kNoError;
 }
 
+void TitanicEngine::processEvents() {
+	Common::Event evt;
+	g_system->getEventManager()->pollEvent(evt);
+
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 978f9b3..ad0ed75 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -80,6 +80,11 @@ private:
 	 * Handles game deinitialization
 	 */
 	void deinitialize();
+
+	/**
+	 * Processes pending events
+	 */
+	void processEvents();
 protected:
 	const TitanicGameDescription *_gameDescription;
 	int _loadSaveSlot;


Commit: 0cc014d06ba3b2588dfb7cb46366aa3d0a875d04
    https://github.com/scummvm/scummvm/commit/0cc014d06ba3b2588dfb7cb46366aa3d0a875d04
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-13T16:25:25-04:00

Commit Message:
TITANIC: Implemented dumping of the project hierarchy

Changed paths:
    engines/titanic/core/named_item.cpp
    engines/titanic/core/named_item.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/main_game_window.cpp



diff --git a/engines/titanic/core/named_item.cpp b/engines/titanic/core/named_item.cpp
index cd798a2..49cfdb4 100644
--- a/engines/titanic/core/named_item.cpp
+++ b/engines/titanic/core/named_item.cpp
@@ -26,6 +26,13 @@
 
 namespace Titanic {
 
+CString CNamedItem::dumpItem(int indent) const {
+	CString result = CTreeItem::dumpItem(indent);
+	result += " " + _name;
+
+	return result;
+}
+
 void CNamedItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(0, indent);
 	file->writeQuotedLine(_name, indent);
diff --git a/engines/titanic/core/named_item.h b/engines/titanic/core/named_item.h
index 6e6178e..aac81ec 100644
--- a/engines/titanic/core/named_item.h
+++ b/engines/titanic/core/named_item.h
@@ -37,6 +37,11 @@ public:
 	CLASSDEF
 
 	/**
+	 * Dump the item
+	 */
+	virtual CString dumpItem(int indent) const;
+
+	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 3599732..cda3ca4 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -37,6 +37,27 @@ CTreeItem::CTreeItem() : _parent(nullptr), _firstChild(nullptr),
 	_nextSibling(nullptr), _priorSibling(nullptr), _field14(0) {
 }
 
+void CTreeItem::dump(int indent) {
+	CString line = dumpItem(indent);
+	debug("%s", line.c_str());
+
+	CTreeItem *item = getFirstChild();
+	while (item) {
+		item->dump(indent + 1);
+		
+		item = item->getNextSibling();
+	}
+}
+
+CString CTreeItem::dumpItem(int indent) const {
+	CString result;
+	for (int idx = 0; idx < indent; ++idx)
+		result += '\t';
+	result += getType()->_className;
+
+	return result;
+}
+
 bool CTreeItem::isFileItem() const {
 	return isInstanceOf(CFileItem::_type);
 }
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 32b76c9..be381c5 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -42,6 +42,17 @@ public:
 	CLASSDEF
 	CTreeItem();
 
+
+	/**
+	 * Dump the item and any of it's children
+	 */
+	void dump(int indent);
+
+	/**
+	 * Dump the item
+	 */
+	virtual CString dumpItem(int indent) const;
+
 	/**
 	 * Save the data for the class to file
 	 */
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 01996e6..18b033f 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -67,6 +67,9 @@ void CMainGameWindow::applicationStarting() {
 	_project->loadGame(saveSlot);
 
 	// TODO: Cursor/image
+	//***DEBUG****
+	_project->dump(0);
+	return;
 
 	// Generate starting messages
 	CViewItem *view = _gameManager->_gameState._gameLocation.getView();


Commit: 75286e83212111bfb0d53ff7ea175559afd64963
    https://github.com/scummvm/scummvm/commit/75286e83212111bfb0d53ff7ea175559afd64963
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-13T18:00:30-04:00

Commit Message:
TITANIC: Fix loading project data

Changed paths:
    engines/titanic/core/tree_item.cpp
    engines/titanic/game_location.cpp
    engines/titanic/main_game_window.cpp



diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index cda3ca4..b476777 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -169,7 +169,7 @@ CTreeItem *CTreeItem::findNextInstanceOf(ClassDef *classDef, CTreeItem *startIte
 
 void CTreeItem::addUnder(CTreeItem *newParent) {
 	if (newParent->_firstChild)
-		addSibling(newParent->getLastSibling());
+		addSibling(newParent->_firstChild->getLastSibling());
 	else
 		setParent(newParent);
 }
diff --git a/engines/titanic/game_location.cpp b/engines/titanic/game_location.cpp
index cd4481e..5f87d3b 100644
--- a/engines/titanic/game_location.cpp
+++ b/engines/titanic/game_location.cpp
@@ -74,8 +74,8 @@ CViewItem *CGameLocation::getView() {
 		_view = nullptr;
 	} else {
 		_viewNumber = _view->_viewNumber;
-		_nodeNumber = getNode()->_nodeNumber;
-		_roomNumber = getRoom()->_roomNumber;
+		_nodeNumber = _view->findNode()->_nodeNumber;
+		_roomNumber = _view->findRoom()->_roomNumber;
 	}
 
 	return _view;
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 18b033f..01996e6 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -67,9 +67,6 @@ void CMainGameWindow::applicationStarting() {
 	_project->loadGame(saveSlot);
 
 	// TODO: Cursor/image
-	//***DEBUG****
-	_project->dump(0);
-	return;
 
 	// Generate starting messages
 	CViewItem *view = _gameManager->_gameState._gameLocation.getView();


Commit: bc1585ccee0fe156a4f6d2e6e721c606ac6dd8a9
    https://github.com/scummvm/scummvm/commit/bc1585ccee0fe156a4f6d2e6e721c606ac6dd8a9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-13T18:21:12-04:00

Commit Message:
TITANIC: Change some script method return types

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_named_script.cpp
    engines/titanic/true_talk/tt_named_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index a9a0be1..ab4fbb2 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -44,19 +44,19 @@ int BarbotScript::proc15() const {
 	return 0;
 }
 
-int BarbotScript::proc16() const {
+bool BarbotScript::proc16() const {
 	warning("TODO");
-	return 0;
+	return false;
 }
 
-int BarbotScript::proc17() const {
+bool BarbotScript::proc17() const {
 	warning("TODO");
-	return 0;
+	return false;
 }
 
-int BarbotScript::proc18() const {
+bool BarbotScript::proc18() const {
 	warning("TODO");
-	return 0;
+	return false;
 }
 
 int BarbotScript::proc21(int v) {
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index f40c67d..2ea86f0 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -37,9 +37,9 @@ public:
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
-	virtual int proc16() const;
-	virtual int proc17() const;
-	virtual int proc18() const;
+	virtual bool proc16() const;
+	virtual bool proc17() const;
+	virtual bool proc18() const;
 	virtual int proc21(int v);
 	virtual int proc22() const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index a296752..52d8a19 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -59,17 +59,17 @@ int BellbotScript::proc15() const {
 	return 0;
 }
 
-int BellbotScript::proc16() const {
+bool BellbotScript::proc16() const {
 	warning("TODO");
 	return 0;
 }
 
-int BellbotScript::proc17() const {
+bool BellbotScript::proc17() const {
 	warning("TODO");
 	return 0;
 }
 
-int BellbotScript::proc18() const {
+bool BellbotScript::proc18() const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index e792d16..cc71c26 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -42,9 +42,9 @@ public:
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
-	virtual int proc16() const;
-	virtual int proc17() const;
-	virtual int proc18() const;
+	virtual bool proc16() const;
+	virtual bool proc17() const;
+	virtual bool proc18() const;
 	virtual int proc21(int v);
 	virtual int proc22() const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index b79714e..f17c041 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -60,17 +60,17 @@ int DeskbotScript::proc15() const {
 	return 0;
 }
 
-int DeskbotScript::proc16() const {
+bool DeskbotScript::proc16() const {
 	warning("TODO");
 	return 0;
 }
 
-int DeskbotScript::proc17() const {
+bool DeskbotScript::proc17() const {
 	warning("TODO");
 	return 0;
 }
 
-int DeskbotScript::proc18() const {
+bool DeskbotScript::proc18() const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index c40aca9..dcab218 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -36,9 +36,9 @@ public:
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
-	virtual int proc16() const;
-	virtual int proc17() const;
-	virtual int proc18() const;
+	virtual bool proc16() const;
+	virtual bool proc17() const;
+	virtual bool proc18() const;
 	virtual int proc21(int v);
 	virtual int proc22() const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 4bca9a6..43b9e46 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -44,17 +44,17 @@ int DoorbotScript::proc15() const {
 	return 0;
 }
 
-int DoorbotScript::proc16() const {
+bool DoorbotScript::proc16() const {
 	warning("TODO");
 	return 0;
 }
 
-int DoorbotScript::proc17() const {
+bool DoorbotScript::proc17() const {
 	warning("TODO");
 	return 0;
 }
 
-int DoorbotScript::proc18() const {
+bool DoorbotScript::proc18() const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 5494760..37722d4 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -39,9 +39,9 @@ public:
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
-	virtual int proc16() const;
-	virtual int proc17() const;
-	virtual int proc18() const;
+	virtual bool proc16() const;
+	virtual bool proc17() const;
+	virtual bool proc18() const;
 	virtual int proc21(int v);
 	virtual int proc22() const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 4bd994f..c30d226 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -49,17 +49,17 @@ int LiftbotScript::proc15() const {
 	return 0;
 }
 
-int LiftbotScript::proc16() const {
+bool LiftbotScript::proc16() const {
 	warning("TODO");
 	return 0;
 }
 
-int LiftbotScript::proc17() const {
+bool LiftbotScript::proc17() const {
 	warning("TODO");
 	return 0;
 }
 
-int LiftbotScript::proc18() const {
+bool LiftbotScript::proc18() const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index ddbdabb..8564bb5 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -38,9 +38,9 @@ public:
 	virtual int proc9() const;
 	virtual int proc10() const;
 	virtual int proc15() const;
-	virtual int proc16() const;
-	virtual int proc17() const;
-	virtual int proc18() const;
+	virtual bool proc16() const;
+	virtual bool proc17() const;
+	virtual bool proc18() const;
 	virtual int proc21(int v);
 	virtual int proc22() const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 1caec62..b88dfc6 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -53,17 +53,17 @@ int MaitreDScript::proc10() const {
 	return 0;
 }
 
-int MaitreDScript::proc16() const {
+bool MaitreDScript::proc16() const {
 	warning("TODO");
 	return 0;
 }
 
-int MaitreDScript::proc17() const {
+bool MaitreDScript::proc17() const {
 	warning("TODO");
 	return 0;
 }
 
-int MaitreDScript::proc18() const {
+bool MaitreDScript::proc18() const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 2af3f42..a5fbb72 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -35,9 +35,9 @@ public:
 	virtual int proc6() const;
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
-	virtual int proc16() const;
-	virtual int proc17() const;
-	virtual int proc18() const;
+	virtual bool proc16() const;
+	virtual bool proc17() const;
+	virtual bool proc18() const;
 	virtual int proc21(int v);
 	virtual int proc22() const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index 9772f21..e97d32d 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -39,12 +39,12 @@ int ParrotScript::proc10() const {
 	return 0;
 }
 
-int ParrotScript::proc17() const {
+bool ParrotScript::proc17() const {
 	warning("TODO");
 	return 0;
 }
 
-int ParrotScript::proc18() const {
+bool ParrotScript::proc18() const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index 0dde14d..ac0b08c 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -36,8 +36,8 @@ public:
 	virtual int proc6() const;
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
-	virtual int proc17() const;
-	virtual int proc18() const;
+	virtual bool proc17() const;
+	virtual bool proc18() const;
 	virtual int proc23() const;
 	virtual void proc24();
 	virtual int proc25() const;
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index c21edef..0c1f670 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -39,12 +39,12 @@ int SuccUBusScript::proc10() const {
 	return 0;
 }
 
-int SuccUBusScript::proc17() const {
+bool SuccUBusScript::proc17() const {
 	warning("TODO");
 	return 0;
 }
 
-int SuccUBusScript::proc18() const {
+bool SuccUBusScript::proc18() const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 595657b..2131775 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -39,8 +39,8 @@ public:
 	virtual int proc6() const;
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
-	virtual int proc17() const;
-	virtual int proc18() const;
+	virtual bool proc17() const;
+	virtual bool proc18() const;
 	virtual int proc21(int v);
 	virtual int proc23() const;
 	virtual void proc24();
diff --git a/engines/titanic/true_talk/tt_named_script.cpp b/engines/titanic/true_talk/tt_named_script.cpp
index dfc5bb2..89adb16 100644
--- a/engines/titanic/true_talk/tt_named_script.cpp
+++ b/engines/titanic/true_talk/tt_named_script.cpp
@@ -91,7 +91,7 @@ int TTNamedScript::proc12() const {
 	return 1;
 }
 
-void TTNamedScript::proc13() const {
+bool TTNamedScript::proc13() const {
 	warning("TODO");
 }
 
@@ -103,16 +103,16 @@ int TTNamedScript::proc15() const {
 	return 0;
 }
 
-int TTNamedScript::proc16() const {
-	return 1;
+bool TTNamedScript::proc16() const {
+	return true;
 }
 
-int TTNamedScript::proc17() const {
-	return 1;
+bool TTNamedScript::proc17() const {
+	return true;
 }
 
-int TTNamedScript::proc18() const {
-	return 1;
+bool TTNamedScript::proc18() const {
+	return true;
 }
 
 void TTNamedScript::proc19(int v) {
diff --git a/engines/titanic/true_talk/tt_named_script.h b/engines/titanic/true_talk/tt_named_script.h
index 968ec22..9186507 100644
--- a/engines/titanic/true_talk/tt_named_script.h
+++ b/engines/titanic/true_talk/tt_named_script.h
@@ -81,12 +81,12 @@ public:
 	virtual int proc10() const;
 	virtual int proc11() const;
 	virtual int proc12() const;
-	virtual void proc13() const;
+	virtual bool proc13() const;
 	virtual void proc14(int v);
 	virtual int proc15() const;
-	virtual int proc16() const;
-	virtual int proc17() const;
-	virtual int proc18() const;
+	virtual bool proc16() const;
+	virtual bool proc17() const;
+	virtual bool proc18() const;
 	virtual void proc19(int v);
 	virtual void proc20(int v);
 	virtual int proc21(int v);


Commit: 041c6475d6dd86f563dae2e19ae732b16ec34ce6
    https://github.com/scummvm/scummvm/commit/041c6475d6dd86f563dae2e19ae732b16ec34ce6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-14T20:03:32-04:00

Commit Message:
TITANIC: Fleshed out DirectDrawSurface creation

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/direct_draw.cpp
    engines/titanic/direct_draw.h
    engines/titanic/game_location.cpp
    engines/titanic/game_location.h
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h
    engines/titanic/true_talk/tt_named_script.cpp
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 3238258..f5e9806 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -118,4 +118,8 @@ void CGameObject::load(SimpleFile *file) {
 	CNamedItem::load(file);
 }
 
+void CGameObject::fn2() {
+	error("TODO");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 3809ae3..c284fb4 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -71,6 +71,8 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
+
+	void fn2();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/direct_draw.cpp b/engines/titanic/direct_draw.cpp
index d503938..9691ea9 100644
--- a/engines/titanic/direct_draw.cpp
+++ b/engines/titanic/direct_draw.cpp
@@ -22,6 +22,7 @@
 
 #include "common/debug.h"
 #include "engines/util.h"
+#include "graphics/pixelformat.h"
 #include "titanic/titanic.h"
 #include "titanic/direct_draw.h"
 
@@ -48,6 +49,13 @@ void DirectDraw::diagnostics() {
 	debugC(ERROR_BASIC, kDebugGraphics, "Running DirectDraw Diagnostic...");
 }
 
+DirectDrawSurface *DirectDraw::createSurfaceFromDesc(const DDSurfaceDesc &desc) {
+	DirectDrawSurface *surface = new DirectDrawSurface();
+	surface->create(desc._w, desc._h, Graphics::PixelFormat::createFormatCLUT8());
+
+	return surface;
+}
+
 /*------------------------------------------------------------------------*/
 
 DirectDrawManager::DirectDrawManager(TitanicEngine *vm, int v) : _directDraw(vm) {
@@ -87,12 +95,20 @@ void DirectDrawManager::initSurface() {
 	_directDraw.setDisplayMode(_directDraw._width, _directDraw._height,
 		_directDraw._bpp, 0);
 
-	_mainSurface = new Graphics::Surface();
+	_mainSurface = new DirectDrawSurface();
 	_mainSurface->create(_directDraw._width, _directDraw._height,
 		Graphics::PixelFormat::createFormatCLUT8());
-	_backSurfaces[0] = new Graphics::Surface();
+	_backSurfaces[0] = new DirectDrawSurface();
 	_backSurfaces[0]->create(_directDraw._width, _directDraw._height,
 		Graphics::PixelFormat::createFormatCLUT8());
 }
 
+DirectDrawSurface *DirectDrawManager::createSurface(int w, int h, int surfaceNum) {
+	if (surfaceNum)
+		return nullptr;
+
+	assert(_mainSurface);
+	return _directDraw.createSurfaceFromDesc(DDSurfaceDesc(w, h));
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/direct_draw.h b/engines/titanic/direct_draw.h
index cb49efa..728094e 100644
--- a/engines/titanic/direct_draw.h
+++ b/engines/titanic/direct_draw.h
@@ -31,6 +31,18 @@ namespace Titanic {
 
 class TitanicEngine;
 
+struct DDSurfaceDesc {
+	int _w;
+	int _h;
+	int _flags;
+	int _caps;
+
+	DDSurfaceDesc(int w, int h) : _w(w), _h(h), _flags(0x1006), _caps(64) {}
+};
+
+class DirectDrawSurface : public Graphics::Surface {
+};
+
 class DirectDraw {
 private:
 	TitanicEngine *_vm;
@@ -54,13 +66,18 @@ public:
 	 * Logs diagnostic information
 	 */
 	void diagnostics();
+
+	/**
+	 * Create a surface from a passed description record
+	 */
+	DirectDrawSurface *createSurfaceFromDesc(const DDSurfaceDesc &desc);
 };
 
 class DirectDrawManager {
 public:
 	DirectDraw _directDraw;
-	Graphics::Surface *_mainSurface;
-	Graphics::Surface *_backSurfaces[2];
+	DirectDrawSurface *_mainSurface;
+	DirectDrawSurface *_backSurfaces[2];
 public:
 	DirectDrawManager(TitanicEngine *vm, int v);
 
@@ -83,6 +100,11 @@ public:
 	 * Initializes the surface for the screen
 	 */
 	void initSurface();
+
+	/**
+	 * Create a surface
+	 */
+	DirectDrawSurface *createSurface(int w, int h, int surfaceNum);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_location.cpp b/engines/titanic/game_location.cpp
index 5f87d3b..2a01bbf 100644
--- a/engines/titanic/game_location.cpp
+++ b/engines/titanic/game_location.cpp
@@ -23,6 +23,7 @@
 #include "titanic/game_location.h"
 #include "titanic/game_manager.h"
 #include "titanic/game_state.h"
+#include "titanic/core/game_object.h"
 #include "titanic/core/project_item.h"
 
 namespace Titanic {
@@ -49,6 +50,26 @@ void CGameLocation::load(SimpleFile *file) {
 	_viewNumber = file->readNumber();
 }
 
+void CGameLocation::setView(CViewItem *view) {
+	if (_view) {
+		for (CTreeItem *treeItem = view; treeItem; 
+				treeItem = treeItem->scan(_view)) {
+			CGameObject *obj = dynamic_cast<CGameObject *>(treeItem);
+			if (obj)
+				obj->fn2();
+		}
+	}
+
+	_view = view;
+	if (_view) {
+		_viewNumber = _view->_viewNumber;
+		_nodeNumber = _view->findNode()->_nodeNumber;
+		_roomNumber = _view->findRoom()->_roomNumber;
+	} else {
+		_viewNumber = _nodeNumber = _roomNumber = -1;
+	}
+}
+
 CViewItem *CGameLocation::getView() {
 	if (!_view) {
 		CGameManager *gm = _gameState->_gameManager;
diff --git a/engines/titanic/game_location.h b/engines/titanic/game_location.h
index 94cea79..a64a824 100644
--- a/engines/titanic/game_location.h
+++ b/engines/titanic/game_location.h
@@ -54,6 +54,11 @@ public:
 	void load(SimpleFile *file);
 
 	/**
+	 * Set the current view
+	 */
+	void setView(CViewItem *view);
+
+	/**
 	 * Get the current view
 	 */
 	CViewItem *getView();
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 47e5d3d..ebde0e0 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -126,8 +126,12 @@ void OSScreenManager::proc20() {}
 void OSScreenManager::proc21() {}
 
 CVideoSurface *OSScreenManager::createSurface(int w, int h) {
-	warning("TODO");
-	return nullptr;
+	DirectDrawSurface *ddSurface = _directDrawManager.createSurface(w, h, 0);
+	return new OSVideoSurface(this, ddSurface);
+}
+
+CVideoSurface *OSScreenManager::createSurface(const CResourceKey &key) {
+	return new OSVideoSurface(this, key);
 }
 
 void OSScreenManager::proc23() {}
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index d0bcc5d..0fd6bfa 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -29,6 +29,7 @@
 #include "titanic/font.h"
 #include "titanic/input_handler.h"
 #include "titanic/video_surface.h"
+#include "titanic/core/resource_key.h"
 
 namespace Titanic {
 
@@ -78,6 +79,8 @@ public:
 	void fn1() {}
 	void fn2() {}
 
+
+
 	virtual void setWindowHandle(int v);
 	virtual bool resetWindowHandle(int v);
 	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) = 0;
@@ -98,8 +101,17 @@ public:
 	virtual void proc19() = 0;
 	virtual void proc20() = 0;
 	virtual void proc21() = 0;
+
+	/**
+	 * Creates a surface of a given size
+	 */
 	virtual CVideoSurface *createSurface(int w, int h) = 0;
-	virtual void proc23() = 0;
+	
+	/**
+	 * Creates a surface from a specified resource
+	 */
+	virtual CVideoSurface *createSurface(const CResourceKey &key) = 0;
+	
 	virtual void proc24() = 0;
 	virtual void proc25() = 0;
 	virtual void showCursor() = 0;
@@ -147,7 +159,17 @@ public:
 	virtual void proc19();
 	virtual void proc20();
 	virtual void proc21();
+
+	/**
+	 * Creates a surface of a given size
+	 */
 	virtual CVideoSurface *createSurface(int w, int h);
+	
+	/**
+	 * Creates a surface from a specified resource
+	 */
+	virtual CVideoSurface *createSurface(const CResourceKey &key);
+
 	virtual void proc23();
 	virtual void proc24();
 	virtual void proc25();
diff --git a/engines/titanic/true_talk/tt_named_script.cpp b/engines/titanic/true_talk/tt_named_script.cpp
index 89adb16..7f4bb5b 100644
--- a/engines/titanic/true_talk/tt_named_script.cpp
+++ b/engines/titanic/true_talk/tt_named_script.cpp
@@ -93,6 +93,7 @@ int TTNamedScript::proc12() const {
 
 bool TTNamedScript::proc13() const {
 	warning("TODO");
+	return true;
 }
 
 void TTNamedScript::proc14(int v) {
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index d03e2f4..780ea2b 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -24,19 +24,46 @@
 
 namespace Titanic {
 
-CVideoSurface::CVideoSurface(CScreenManager *screenManager, Graphics::Surface *surface):
-			_screenManager(screenManager), _surface(surface) {
+int CVideoSurface::_videoSurfaceCounter = 0;
+
+CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
+		_screenManager(screenManager), _field2C(0),
+		_field34(0), _field38(0), _field3C(0), _field40(0),
+		_field44(4), _field48(0), _field50(1) {
+	_videoSurfaceNum = _videoSurfaceCounter++;
 }
 
-void CVideoSurface::setSurface(CScreenManager *screenManager, Graphics::Surface *surface) {
+void CVideoSurface::setSurface(CScreenManager *screenManager, DirectDrawSurface *surface) {
 	_screenManager = screenManager;
 	_surface = surface;
 }
 
 /*------------------------------------------------------------------------*/
 
-OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, Graphics::Surface *surface):
-		CVideoSurface(screenManager, surface) {
+OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface) :
+		CVideoSurface(screenManager) {
+	_surface = surface;
+}
+
+OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool flag) :
+		CVideoSurface(screenManager) {
+	_surface = nullptr;
+	_field38 = flag;
+	
+	if (_field38) {
+		proc8(key);
+	} else {
+		_resourceKey = key;
+		proc43();
+	}
+}
+
+void OSVideoSurface::proc8(const CResourceKey &key) {
+	warning("TODO");
+}
+
+void OSVideoSurface::proc43() {
+	warning("TODO");
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 978eacf..04d9fa8 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -25,26 +25,50 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
-#include "graphics/surface.h"
 #include "titanic/font.h"
+#include "titanic/direct_draw.h"
+#include "titanic/core/list.h"
+#include "titanic/core/resource_key.h"
 
 namespace Titanic {
 
 class CScreenManager;
 
-class CVideoSurface {
+class CVideoSurface : public ListItem {
 private:
+	static int _videoSurfaceCounter;
+protected:
 	CScreenManager *_screenManager;
-	Graphics::Surface *_surface;
+	CResourceKey _resourceKey;
+	DirectDrawSurface *_surface;
+	int _field2C;
+	int _field34;
+	bool _field38;
+	int _field3C;
+	int _field40;
+	int _field44;
+	int _field48;
+	int _videoSurfaceNum;
+	int _field50;
+	int _accessCtr;
 public:
-	CVideoSurface(CScreenManager *screenManager, Graphics::Surface *surface);
+	CVideoSurface(CScreenManager *screenManager);
 
-	void setSurface(CScreenManager *screenManager, Graphics::Surface *surface);
+	void setSurface(CScreenManager *screenManager, DirectDrawSurface *surface);
+
+	virtual void proc8(const CResourceKey &key) = 0;
+
+	virtual void proc43() = 0;
 };
 
 class OSVideoSurface : public CVideoSurface {
 public:
-	OSVideoSurface(CScreenManager *screenManager, Graphics::Surface *surface);
+	OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface);
+	OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool flag = false);
+
+	virtual void proc8(const CResourceKey &key);
+
+	virtual void proc43();
 };
 
 } // End of namespace Titanic


Commit: 3c29a101309b2d74cedf345c2d7314ef82fd9367
    https://github.com/scummvm/scummvm/commit/3c29a101309b2d74cedf345c2d7314ef82fd9367
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-14T23:09:57-04:00

Commit Message:
TITANIC: Further graphics setup, beginnings of files manager

Changed paths:
  A engines/titanic/files_manager.cpp
  A engines/titanic/files_manager.h
    engines/titanic/direct_draw.cpp
    engines/titanic/direct_draw.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/main_game_window.cpp
    engines/titanic/module.mk
    engines/titanic/screen_manager.cpp
    engines/titanic/string.cpp
    engines/titanic/string.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/direct_draw.cpp b/engines/titanic/direct_draw.cpp
index 9691ea9..71f0d35 100644
--- a/engines/titanic/direct_draw.cpp
+++ b/engines/titanic/direct_draw.cpp
@@ -28,21 +28,18 @@
 
 namespace Titanic {
 
-DirectDraw::DirectDraw(TitanicEngine *vm) : _vm(vm) {
-	_field8 = 0;
-	_fieldC = 0;
-	_width = 0;
-	_height = 0;
-	_bpp = 0;
-	_numBackSurfaces = 0;
-	_field24 = 0;
+DirectDraw::DirectDraw(TitanicEngine *vm) : _vm(vm),
+		_windowed(false), _fieldC(0), _width(0), _height(0),
+		_bpp(0), _numBackSurfaces(0), _field24(0) {
 }
 
 void DirectDraw::setDisplayMode(int width, int height, int bpp, int refreshRate) {
 	debugC(ERROR_BASIC, kDebugGraphics, "DirectDraw::SetDisplayMode (%d x %d), %d bpp",
 		width, height, bpp);
-	assert(bpp == 8);
-	initGraphics(width, height, true);
+	assert(bpp == 16);
+
+	Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
+	initGraphics(width, height, true, &pixelFormat);
 }
 
 void DirectDraw::diagnostics() {
@@ -58,10 +55,10 @@ DirectDrawSurface *DirectDraw::createSurfaceFromDesc(const DDSurfaceDesc &desc)
 
 /*------------------------------------------------------------------------*/
 
-DirectDrawManager::DirectDrawManager(TitanicEngine *vm, int v) : _directDraw(vm) {
+DirectDrawManager::DirectDrawManager(TitanicEngine *vm, bool windowed) : _directDraw(vm) {
 	_mainSurface = nullptr;
 	_backSurfaces[0] = _backSurfaces[1] = nullptr;
-	_directDraw._field8 = v;
+	_directDraw._windowed = windowed;
 }
 
 void DirectDrawManager::initVideo(int width, int height, int bpp, int numBackSurfaces) {
@@ -71,10 +68,10 @@ void DirectDrawManager::initVideo(int width, int height, int bpp, int numBackSur
 	_directDraw._height = height;
 	_directDraw._bpp = bpp;
 
-	if (numBackSurfaces) {
-		setResolution();
+	if (_directDraw._windowed) {
+		initWindowed();
 	} else {
-		initSurface();
+		initFullScreen();
 	}
 }
 
@@ -90,7 +87,7 @@ void DirectDrawManager::proc3() {
 
 }
 
-void DirectDrawManager::initSurface() {
+void DirectDrawManager::initFullScreen() {
 	debugC(ERROR_BASIC, kDebugGraphics, "Creating surfaces");
 	_directDraw.setDisplayMode(_directDraw._width, _directDraw._height,
 		_directDraw._bpp, 0);
diff --git a/engines/titanic/direct_draw.h b/engines/titanic/direct_draw.h
index 728094e..6dedcd0 100644
--- a/engines/titanic/direct_draw.h
+++ b/engines/titanic/direct_draw.h
@@ -47,7 +47,7 @@ class DirectDraw {
 private:
 	TitanicEngine *_vm;
 public:
-	int _field8;
+	bool _windowed;
 	int _fieldC;
 	int _width;
 	int _height;
@@ -79,7 +79,7 @@ public:
 	DirectDrawSurface *_mainSurface;
 	DirectDrawSurface *_backSurfaces[2];
 public:
-	DirectDrawManager(TitanicEngine *vm, int v);
+	DirectDrawManager(TitanicEngine *vm, bool windowed);
 
 	/**
 	 * Initializes video surfaces
@@ -97,9 +97,14 @@ public:
 	void proc3();
 
 	/**
-	 * Initializes the surface for the screen
+	 * Initializes the surfaces in windowed mode
 	 */
-	void initSurface();
+	void initWindowed() { initFullScreen(); }
+
+	/**
+	 * Initializes the surfaces for the screen
+	 */
+	void initFullScreen();
 
 	/**
 	 * Create a surface
diff --git a/engines/titanic/files_manager.cpp b/engines/titanic/files_manager.cpp
new file mode 100644
index 0000000..4dcee2e
--- /dev/null
+++ b/engines/titanic/files_manager.cpp
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/files_manager.h"
+#include "titanic/game_manager.h"
+
+namespace Titanic {
+
+CFilesManager::CFilesManager() : _gameManager(nullptr), 
+		_field0(0), _field14(0), _field18(0), _field1C(0), _field3C(0) {
+}
+
+int CFilesManager::fn1(const CString &name) {
+	if (name.empty())
+		return 0;
+
+	CString str = name;
+	str.toLowercase();
+	
+	if (str[0] == 'z' || str[0] == 'y') {
+		return 1;
+	} else if (str[0] < 'a' || str[0] > 'c') {
+		return 0;
+	}
+
+	CString tempStr = str;
+	int idx = tempStr.indexOf('#');
+	if (idx >= 0) {
+		tempStr = tempStr.left(idx);
+		str = str.c_str() + idx + 1;
+		str += ".st";
+	}
+
+	return 0;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/files_manager.h b/engines/titanic/files_manager.h
new file mode 100644
index 0000000..29a67e6
--- /dev/null
+++ b/engines/titanic/files_manager.h
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FILES_MANAGER_H
+#define TITANIC_FILES_MANAGER_H
+
+#include "titanic/core/list.h"
+
+namespace Titanic {
+
+class CGameManager;
+
+class CFilesManagerList : public List<ListItem> {
+};
+
+class CFilesManager {
+private:
+	CGameManager *_gameManager;
+	CFilesManagerList _list;
+	CString _string1;
+	CString _string2;
+	int _field0;
+	int _field14;
+	int _field18;
+	int _field1C;
+	int _field3C;
+public:
+	CFilesManager();
+
+	/**
+	 * Sets the game manager
+	 */
+	void setGameManager(CGameManager *gameManager) {
+		_gameManager = gameManager;
+	}
+
+	int fn1(const CString &name);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FILES_MANAGER_H */
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 0495d08..2f71862 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -47,10 +47,13 @@ CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
 		_project(project), _gameView(gameView), _trueTalkManager(this),
 		_inputHandler(this), _inputTranslator(&_inputHandler),		
 		_gameState(this), _sound(this), _musicRoom(this),
-		_field30(0), _field34(0), _field48(0), _field4C(0), 
+		_field30(0), _field34(0), _field4C(0), 
 		_field50(0), _field54(0), _tickCount1(0), _tickCount2(0) {
-	_videoSurface = CScreenManager::_screenManagerPtr->createSurface(600, 340);
+	
+	_videoSurface1 = nullptr;
+	_videoSurface2 = CScreenManager::_screenManagerPtr->createSurface(600, 340);
 	_project->setGameManager(this);
+	g_vm->_filesManager.setGameManager(this);
 }
 
 void CGameManager::load(SimpleFile *file) {
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index a9bdaaa..82ab6d1 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -62,11 +62,11 @@ private:
 	CGameManagerList _list;
 	int _field30;
 	int _field34;
-	int _field48;
+	CVideoSurface *_videoSurface1;
 	int _field4C;
 	int _field50;
 	int _field54;
-	CVideoSurface *_videoSurface;
+	CVideoSurface *_videoSurface2;
 	uint _tickCount1;
 	uint _tickCount2;
 public:
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 01996e6..e9fb423 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -54,7 +54,7 @@ void CMainGameWindow::applicationStarting() {
 	
 	// Set the video mode
 	CScreenManager *screenManager = CScreenManager::setCurrent();
-	screenManager->setMode(640, 480, 1, 1, false);
+	screenManager->setMode(640, 480, 16, 1, true);
 
 	// TODO: Clear surfaces
 
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 48f6ce6..664dc0a 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -3,6 +3,7 @@ MODULE := engines/titanic
 MODULE_OBJS := \
 	detection.o \
 	direct_draw.o \
+	files_manager.o \
 	font.o \
 	game_location.o \
 	game_manager.o \
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index ebde0e0..e2d62be 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -74,7 +74,7 @@ CScreenManager *CScreenManager::setCurrent() {
 /*------------------------------------------------------------------------*/
 
 OSScreenManager::OSScreenManager(TitanicEngine *vm): CScreenManager(vm),
-		_directDrawManager(vm, 0) {
+		_directDrawManager(vm, false) {
 	_field48 = 0;
 	_field4C = 0;
 	_field50 = 0;
diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp
index 128a9a3..f726f78 100644
--- a/engines/titanic/string.cpp
+++ b/engines/titanic/string.cpp
@@ -40,4 +40,9 @@ CString CString::mid(uint start, uint count) const {
 		return CString(c_str() + start, MIN(count, size() - start));
 }
 
+int CString::indexOf(char c) {
+	const char *charP = strchr(c_str(), c);
+	return charP ? charP - c_str() : -1;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/string.h b/engines/titanic/string.h
index 076cce0..de44264 100644
--- a/engines/titanic/string.h
+++ b/engines/titanic/string.h
@@ -51,6 +51,11 @@ public:
 	 * Returns a substring from within the string
 	 */
 	CString mid(uint start, uint count) const;
+
+	/**
+	 * Returns the index of the first occurance of a given character
+	 */
+	int indexOf(char c);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index b00e1c3..d1d8386 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -40,8 +40,11 @@
 
 namespace Titanic {
 
+TitanicEngine *g_vm;
+
 TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc)
 		: _gameDescription(gameDesc), Engine(syst) {
+	g_vm = this;
 	_window = nullptr;
 	_screenManager = nullptr;
 }
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index ad0ed75..9513f8d 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -28,6 +28,7 @@
 #include "common/serializer.h"
 #include "engines/advancedDetector.h"
 #include "engines/engine.h"
+#include "titanic/files_manager.h"
 #include "titanic/screen_manager.h"
 #include "titanic/main_game_window.h"
 
@@ -93,6 +94,7 @@ protected:
 	virtual Common::Error run();
 	virtual bool hasFeature(EngineFeature f) const;
 public:
+	CFilesManager _filesManager;
 	OSScreenManager *_screenManager;
 	CMainGameWindow *_window;
 public:
@@ -104,6 +106,8 @@ public:
 	Common::Language getLanguage() const;
 };
 
+extern TitanicEngine *g_vm;
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_TITANIC_H */
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 780ea2b..c7643cf 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -59,7 +59,15 @@ OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, const CResourceKey
 }
 
 void OSVideoSurface::proc8(const CResourceKey &key) {
-	warning("TODO");
+	_resourceKey = key;
+	_field38 = 1;
+
+	if (hasSurface())
+		proc43();
+}
+
+bool OSVideoSurface::hasSurface() {
+	return _surface != nullptr;
 }
 
 void OSVideoSurface::proc43() {
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 04d9fa8..71a2fd6 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -57,7 +57,7 @@ public:
 	void setSurface(CScreenManager *screenManager, DirectDrawSurface *surface);
 
 	virtual void proc8(const CResourceKey &key) = 0;
-
+	virtual bool hasSurface() = 0;
 	virtual void proc43() = 0;
 };
 
@@ -67,7 +67,7 @@ public:
 	OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool flag = false);
 
 	virtual void proc8(const CResourceKey &key);
-
+	virtual bool hasSurface();
 	virtual void proc43();
 };
 


Commit: 6a26539abbf7951f4783935b336dcabfbf548055
    https://github.com/scummvm/scummvm/commit/6a26539abbf7951f4783935b336dcabfbf548055
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-15T23:49:18-04:00

Commit Message:
TITANIC: Fleshing out resource key and view loading

Changed paths:
    engines/titanic/core/resource_key.cpp
    engines/titanic/core/resource_key.h
    engines/titanic/core/view_item.cpp
    engines/titanic/core/view_item.h
    engines/titanic/files_manager.cpp
    engines/titanic/files_manager.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/main_game_window.cpp
    engines/titanic/main_game_window.h
    engines/titanic/string.cpp
    engines/titanic/string.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/core/resource_key.cpp b/engines/titanic/core/resource_key.cpp
index eee749f..685e026 100644
--- a/engines/titanic/core/resource_key.cpp
+++ b/engines/titanic/core/resource_key.cpp
@@ -20,6 +20,7 @@
  *
  */
 
+#include "common/file.h"
 #include "titanic/simple_file.h"
 #include "titanic/core/resource_key.h"
 
@@ -36,12 +37,41 @@ void CResourceKey::save(SimpleFile *file, int indent) const {
 void CResourceKey::load(SimpleFile *file) {
 	int val = file->readNumber();
 	
-	if (val == 1) {
+	if (val == 0 || val == 1) {
 		file->readBuffer();
-		_value = file->readString();
+		CString str = file->readString();
+		setValue(str);
 	}
 
 	CSaveableObject::load(file);
 }
 
+void CResourceKey::setValue(const CString &name) {
+	CString nameStr = name;
+	nameStr.toLowercase();
+	_key = nameStr;
+
+	_value = nameStr;
+	int idx = _value.lastIndexOf('\\');
+	if (idx >= 0)
+		_value = _value.mid(idx + 1);
+}
+
+CString CResourceKey::exists() {
+	CString name = _key;
+
+	// Check for the resource being within an ST container file
+	int idx = name.indexOf('#');
+	if (idx >= 0) {
+		CString str = name.left(idx);
+		name = name.mid(idx + 1);
+		name += ".st";
+	}
+
+	// The original did tests for the file in the different
+	// asset paths, which aren't needed in ScummVM
+	Common::File f;
+	return f.exists(name) ? name : CString();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/resource_key.h b/engines/titanic/core/resource_key.h
index b38448a..a165a11 100644
--- a/engines/titanic/core/resource_key.h
+++ b/engines/titanic/core/resource_key.h
@@ -32,6 +32,8 @@ class CResourceKey: public CSaveableObject {
 private:
 	CString _key;
 	CString _value;
+
+	void setValue(const CString &name);
 public:
 	CLASSDEF
 
@@ -45,7 +47,16 @@ public:
 	 */
 	virtual void load(SimpleFile *file);
 
+	/**
+	 * Return the key
+	 */
 	const CString &getString() const { return _key; }
+
+	/**
+	 * Checks whether a file for the given key exists,
+	 * and returns it's filename if it does
+	 */
+	CString exists();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 5253f24..7038e94 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -67,4 +67,10 @@ void CViewItem::load(SimpleFile *file) {
 	CNamedItem::load(file);
 }
 
+bool CViewItem::getResourceKey(CResourceKey *key) {
+	*key = _resourceKey;
+	CString filename = key->exists();
+	return !filename.empty();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index 805b7a4..106c795 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -52,6 +52,11 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
+
+	/**
+	 * Get the resource key for the view
+	 */
+	bool getResourceKey(CResourceKey *key);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/files_manager.cpp b/engines/titanic/files_manager.cpp
index 4dcee2e..b7562b6 100644
--- a/engines/titanic/files_manager.cpp
+++ b/engines/titanic/files_manager.cpp
@@ -20,16 +20,18 @@
  *
  */
 
+#include "common/file.h"
 #include "titanic/files_manager.h"
 #include "titanic/game_manager.h"
 
 namespace Titanic {
 
 CFilesManager::CFilesManager() : _gameManager(nullptr), 
-		_field0(0), _field14(0), _field18(0), _field1C(0), _field3C(0) {
+		_assetsPath("Assets"), _field0(0), _field14(0), 
+		_field18(0), _field1C(0), _field3C(0) {
 }
 
-int CFilesManager::fn1(const CString &name) {
+bool CFilesManager::fn1(const CString &name) {
 	if (name.empty())
 		return 0;
 
@@ -50,7 +52,14 @@ int CFilesManager::fn1(const CString &name) {
 		str += ".st";
 	}
 
-	return 0;
+
+
+	return true;
+}
+
+bool CFilesManager::fileExists(const CString &name) {
+	Common::File f;
+	return f.exists(name);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/files_manager.h b/engines/titanic/files_manager.h
index 29a67e6..63eda5e 100644
--- a/engines/titanic/files_manager.h
+++ b/engines/titanic/files_manager.h
@@ -43,6 +43,7 @@ private:
 	int _field18;
 	int _field1C;
 	int _field3C;
+	const CString _assetsPath;
 public:
 	CFilesManager();
 
@@ -53,7 +54,12 @@ public:
 		_gameManager = gameManager;
 	}
 
-	int fn1(const CString &name);
+	bool fn1(const CString &name);
+
+	/**
+	 * Returns true if a file of the given name exists
+	 */
+	static bool fileExists(const CString &name);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 2f71862..5d5dc16 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -92,4 +92,8 @@ void CGameManager::initBounds() {
 	_bounds = Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
 }
 
+void CGameManager::fn2() {
+	warning("TODO");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 82ab6d1..6a49052 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -102,6 +102,8 @@ public:
 	 * Set default screen bounds
 	 */
 	void initBounds();
+
+	void fn2();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index e9fb423..bf5ec6e 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -96,8 +96,13 @@ int CMainGameWindow::selectSavegame() {
 	return -1;
 }
 
-void CMainGameWindow::setActiveView(CViewItem *view) {
-	warning("TODO");
+void CMainGameWindow::setActiveView(CViewItem *viewItem) {
+	_gameManager->_gameState._gameLocation.setView(viewItem);
+	
+	CResourceKey key;
+	if (viewItem->getResourceKey(&key)) {
+		// TODO
+	}
 }
 
 void CMainGameWindow::fn2() {
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index ec8eff3..eedac23 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -72,7 +72,7 @@ public:
 	/**
 	 * Sets the view to be shown
 	 */
-	void setActiveView(CViewItem *view);
+	void setActiveView(CViewItem *viewItem);
 
 	void fn2();
 };
diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp
index f726f78..c1afb4f 100644
--- a/engines/titanic/string.cpp
+++ b/engines/titanic/string.cpp
@@ -40,9 +40,20 @@ CString CString::mid(uint start, uint count) const {
 		return CString(c_str() + start, MIN(count, size() - start));
 }
 
+CString CString::mid(uint start) const {
+	uint strSize = size();
+	assert(start <= strSize);
+	return mid(start, strSize - start);
+}
+
 int CString::indexOf(char c) {
 	const char *charP = strchr(c_str(), c);
 	return charP ? charP - c_str() : -1;
 }
 
+int CString::lastIndexOf(char c) {
+	const char *charP = strrchr(c_str(), c);
+	return charP ? charP - c_str() : -1;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/string.h b/engines/titanic/string.h
index de44264..d70e23d 100644
--- a/engines/titanic/string.h
+++ b/engines/titanic/string.h
@@ -53,9 +53,19 @@ public:
 	CString mid(uint start, uint count) const;
 
 	/**
+	 * Returns a substring from within the string
+	 */
+	CString mid(uint start) const;
+
+	/**
 	 * Returns the index of the first occurance of a given character
 	 */
 	int indexOf(char c);
+
+	/**
+	 * Returns the index of the last occurance of a given character
+	 */
+	int lastIndexOf(char c);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index d1d8386..a9d0cc9 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "common/scummsys.h"
+#include "common/archive.h"
 #include "common/config-manager.h"
 #include "common/debug-channels.h"
 #include "common/events.h"
@@ -55,6 +56,11 @@ TitanicEngine::~TitanicEngine() {
 	CSaveableObject::freeClassList();
 }
 
+void TitanicEngine::initializePath(const Common::FSNode &gamePath) {
+	Engine::initializePath(gamePath);
+	SearchMan.addSubDirectoryMatching(gamePath, "assets");
+}
+
 void TitanicEngine::initialize() {
 	// Set up debug channels
 	DebugMan.addDebugChannel(kDebugCore, "core", "Core engine debug level");
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 9513f8d..112d6d6 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -91,6 +91,7 @@ protected:
 	int _loadSaveSlot;
 
 	// Engine APIs
+	virtual void initializePath(const Common::FSNode &gamePath);
 	virtual Common::Error run();
 	virtual bool hasFeature(EngineFeature f) const;
 public:


Commit: eaead0c6aee10f1fdd347a723bd9b816f80abff6
    https://github.com/scummvm/scummvm/commit/eaead0c6aee10f1fdd347a723bd9b816f80abff6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-16T07:56:26-04:00

Commit Message:
TITANIC: Starting to implement game view loading

Changed paths:
    engines/titanic/core/resource_key.cpp
    engines/titanic/game_view.cpp
    engines/titanic/game_view.h
    engines/titanic/main_game_window.cpp



diff --git a/engines/titanic/core/resource_key.cpp b/engines/titanic/core/resource_key.cpp
index 685e026..4788f7a 100644
--- a/engines/titanic/core/resource_key.cpp
+++ b/engines/titanic/core/resource_key.cpp
@@ -60,11 +60,10 @@ void CResourceKey::setValue(const CString &name) {
 CString CResourceKey::exists() {
 	CString name = _key;
 
-	// Check for the resource being within an ST container file
+	// Check for a resource being specified within an ST container
 	int idx = name.indexOf('#');
 	if (idx >= 0) {
-		CString str = name.left(idx);
-		name = name.mid(idx + 1);
+		name = name.left(idx);
 		name += ".st";
 	}
 
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index a8b8a02..a2905d1 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -47,6 +47,9 @@ void CGameView::deleteView(int roomNumber, int nodeNumber, int viewNumber) {
 		delete view;
 }
 
+void CGameView::createSurface(const CResourceKey &key) {
+
+}
 
 /*------------------------------------------------------------------------*/
 
diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h
index 2e4f700..bf406b5 100644
--- a/engines/titanic/game_view.h
+++ b/engines/titanic/game_view.h
@@ -58,6 +58,11 @@ public:
 	virtual void setView(CViewItem *item) = 0;
 	
 	virtual void proc4() = 0;
+
+	/**
+	 * Creates a surface from a specified resource
+	 */
+	void createSurface(const CResourceKey &key);
 };
 
 class CSTGameView: public CGameView {
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index bf5ec6e..6bde296 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -101,7 +101,8 @@ void CMainGameWindow::setActiveView(CViewItem *viewItem) {
 	
 	CResourceKey key;
 	if (viewItem->getResourceKey(&key)) {
-		// TODO
+		// Create a surface based on the key
+		_gameView->createSurface(key);
 	}
 }
 


Commit: 8ec499c177d88e11930b8550c47c352d65dc603a
    https://github.com/scummvm/scummvm/commit/8ec499c177d88e11930b8550c47c352d65dc603a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-16T19:05:16-04:00

Commit Message:
TITANIC: Implementing setActiveView, surface clearing

Changed paths:
    engines/titanic/direct_draw.cpp
    engines/titanic/direct_draw.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/game_view.cpp
    engines/titanic/game_view.h
    engines/titanic/main_game_window.cpp
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/direct_draw.cpp b/engines/titanic/direct_draw.cpp
index 71f0d35..17e1361 100644
--- a/engines/titanic/direct_draw.cpp
+++ b/engines/titanic/direct_draw.cpp
@@ -108,4 +108,22 @@ DirectDrawSurface *DirectDrawManager::createSurface(int w, int h, int surfaceNum
 	return _directDraw.createSurfaceFromDesc(DDSurfaceDesc(w, h));
 }
 
+/*------------------------------------------------------------------------*/
+
+void DirectDrawSurface::fill(const Common::Rect *bounds, uint32 color) {
+	Common::Rect tempBounds;
+
+	if (bounds) {
+		// Bounds are provided, clip them to the bounds of this surface
+		tempBounds = *bounds;
+		tempBounds.clip(Common::Rect(0, 0, this->w, this->h));
+	} else {
+		// No bounds provided, so use the entire surface
+		tempBounds = Common::Rect(0, 0, this->w, this->h);
+	}
+
+	// Fill the area
+	fillRect(tempBounds, color);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/direct_draw.h b/engines/titanic/direct_draw.h
index 6dedcd0..bd6a77d 100644
--- a/engines/titanic/direct_draw.h
+++ b/engines/titanic/direct_draw.h
@@ -41,6 +41,12 @@ struct DDSurfaceDesc {
 };
 
 class DirectDrawSurface : public Graphics::Surface {
+public:
+	/**
+	 * Fills an area of the surfae with the specified color. If no bounds are passed,
+	 * then the entire surface is filled
+	 */
+	void fill(const Common::Rect *bounds, uint32 color);
 };
 
 class DirectDraw {
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 5d5dc16..efa816d 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -69,7 +69,7 @@ void CGameManager::postLoad(CProjectItem *project) {
 	if (_gameView) {
 		_gameView->postLoad();
 
-		if (!_gameView->_fieldC) {
+		if (!_gameView->_surface) {
 			CViewItem *view = getView();
 			if (view)
 				_gameView->setView(view);
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 6a49052..1509554 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -58,7 +58,6 @@ private:
 	CInputTranslator _inputTranslator;
 	CMusicRoom _musicRoom;
 	CTrueTalkManager _trueTalkManager;
-	Common::Rect _bounds;
 	CGameManagerList _list;
 	int _field30;
 	int _field34;
@@ -72,6 +71,7 @@ private:
 public:
 	CProjectItem *_project;
 	CGameState _gameState;
+	Common::Rect _bounds;
 public:
 	CGameManager(CProjectItem *project, CGameView *gameView);
 	~CGameManager();
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index b8b5ec1..3ce8b2b 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 
 CGameState::CGameState(CGameManager *gameManager) :
 		_gameManager(gameManager), _gameLocation(this),
-		_field8(0), _fieldC(0), _mode(10), _field14(0), _field18(0),
+		_field8(0), _fieldC(0), _mode(GSMODE_0), _field14(0), _field18(0),
 		_field1C(0), _field20(0), _field24(0), _field28(0), _field2C(0),
 		_field30(0), _field34(0), _field38(0) {
 }
@@ -57,17 +57,17 @@ void CGameState::load(SimpleFile *file) {
 	_field28 = _field2C = 0;
 }
 
-void CGameState::setMode(int newMode) {
+void CGameState::setMode(GameStateMode newMode) {
 	CScreenManager *sm = CScreenManager::_screenManagerPtr;
 
-	if (newMode == 2 && newMode != _mode) {
+	if (newMode == GSMODE_2 && newMode != _mode) {
 		if (_gameManager)
 			_gameManager->lockInputHandler();
 
 		if (sm && sm->_mouseCursor)
 			sm->_mouseCursor->hide();
 
-	} else if (newMode != 2 && newMode != _mode) {
+	} else if (newMode != GSMODE_2 && newMode != _mode) {
 		if (sm && sm->_mouseCursor)
 			sm->_mouseCursor->show();
 	
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index f082163..3c3b720 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -31,6 +31,8 @@ namespace Titanic {
 
 class CGameManager;
 
+enum GameStateMode { GSMODE_0 = 0, GSMODE_1 = 1, GSMODE_2 = 2, GSMODE_3 = 3, GSMODE_4 = 4, GSMODE_5 = 5 };
+
 class CGameStateList : public List<ListItem> {
 public:
 	int _field10;
@@ -46,7 +48,7 @@ public:
 	CGameStateList _list;
 	int _field8;
 	int _fieldC;
-	int _mode;
+	GameStateMode _mode;
 	int _field14;
 	int _field18;
 	int _field1C;
@@ -73,7 +75,7 @@ public:
 	/**
 	 * Sets a new mode
 	 */
-	void setMode(int newMode);
+	void setMode(GameStateMode newMode);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index a2905d1..315b2a8 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -23,11 +23,11 @@
 #include "titanic/game_view.h"
 #include "titanic/game_manager.h"
 #include "titanic/main_game_window.h"
+#include "titanic/screen_manager.h"
 
 namespace Titanic {
 
-CGameView::CGameView() : _gameManager(nullptr), _fieldC(nullptr),
-		_field8(0) {
+CGameView::CGameView() : _gameManager(nullptr), _surface(nullptr) {
 }
 
 void CGameView::setGameManager(CGameManager *gameManager) {
@@ -35,10 +35,8 @@ void CGameView::setGameManager(CGameManager *gameManager) {
 }
 
 void CGameView::postLoad() {
-	if (_fieldC)
-		warning("TODO");
-	
-	_fieldC = nullptr;
+	delete _surface;
+	_surface = nullptr;
 }
 
 void CGameView::deleteView(int roomNumber, int nodeNumber, int viewNumber) {
@@ -48,7 +46,14 @@ void CGameView::deleteView(int roomNumber, int nodeNumber, int viewNumber) {
 }
 
 void CGameView::createSurface(const CResourceKey &key) {
-
+	// Reset any current view surface
+	_gameManager->initBounds();
+	delete _surface;
+	_surface = nullptr;
+	
+	// Create a fresh surface
+	CScreenManager::setCurrent();
+	_surface = CScreenManager::_currentScreenManagerPtr->createSurface(key);
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h
index bf406b5..9ede9d6 100644
--- a/engines/titanic/game_view.h
+++ b/engines/titanic/game_view.h
@@ -25,6 +25,7 @@
 
 #include "common/scummsys.h"
 #include "titanic/core/view_item.h"
+#include "titanic/video_surface.h"
 
 namespace Titanic {
 
@@ -34,9 +35,8 @@ class CGameManager;
 class CGameView {
 protected:
 	CGameManager *_gameManager;
-	int _field8;
 public:
-	void *_fieldC;
+	CVideoSurface *_surface;
 public:
 	CGameView();
 
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 6bde296..a964f92 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -107,7 +107,31 @@ void CMainGameWindow::setActiveView(CViewItem *viewItem) {
 }
 
 void CMainGameWindow::fn2() {
-	warning("TODO");
+	if (_gameManager) {
+		if (_gameView->_surface) {
+			CViewItem *view = _gameManager->getView();
+			if (view)
+				setActiveView(view);
+		}
+
+		CScreenManager *scrManager = CScreenManager::setCurrent();
+		scrManager->clearSurface(0, &_gameManager->_bounds);
+
+		switch (_gameManager->_gameState._mode) {
+		case GSMODE_1:
+		case GSMODE_2:
+			if (_gameManager->_gameState._field18)
+				warning("TODO: Field18_fn1(this)");
+			warning("TODO: Stuff");
+
+		case GSMODE_5:
+			warning("TODO: FilesManager::fn1");
+			break;
+
+		default:
+			break;
+		}
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index e2d62be..f64468e 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -122,7 +122,14 @@ void OSScreenManager::proc16() {}
 void OSScreenManager::getFont() {}
 void OSScreenManager::proc18() {}
 void OSScreenManager::proc19() {}
-void OSScreenManager::proc20() {}
+
+void OSScreenManager::clearSurface(int surfaceNum, Common::Rect *bounds) {
+	if (surfaceNum == -1)
+		_directDrawManager._mainSurface->fill(bounds, 0);
+	else if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
+		_directDrawManager._backSurfaces[surfaceNum]->fill(bounds, 0);
+}
+
 void OSScreenManager::proc21() {}
 
 CVideoSurface *OSScreenManager::createSurface(int w, int h) {
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index 0fd6bfa..075e36c 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -99,7 +99,12 @@ public:
 	virtual void getFont() = 0;
 	virtual void proc18() = 0;
 	virtual void proc19() = 0;
-	virtual void proc20() = 0;
+
+	/**
+	 * Clear a portion of a specified surface
+	 */
+	virtual void clearSurface(int surfaceNum, Common::Rect *_bounds) = 0;
+
 	virtual void proc21() = 0;
 
 	/**
@@ -157,7 +162,12 @@ public:
 	virtual void getFont();
 	virtual void proc18();
 	virtual void proc19();
-	virtual void proc20();
+
+	/**
+	 * Clear a portion of the screen surface
+	 */
+	virtual void clearSurface(int surfaceNum, Common::Rect *bounds);
+	
 	virtual void proc21();
 
 	/**
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index c7643cf..1db2383 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -35,19 +35,19 @@ CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
 
 void CVideoSurface::setSurface(CScreenManager *screenManager, DirectDrawSurface *surface) {
 	_screenManager = screenManager;
-	_surface = surface;
+	_ddSurface = surface;
 }
 
 /*------------------------------------------------------------------------*/
 
 OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface) :
 		CVideoSurface(screenManager) {
-	_surface = surface;
+	_ddSurface = surface;
 }
 
 OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool flag) :
 		CVideoSurface(screenManager) {
-	_surface = nullptr;
+	_ddSurface = nullptr;
 	_field38 = flag;
 	
 	if (_field38) {
@@ -67,7 +67,7 @@ void OSVideoSurface::proc8(const CResourceKey &key) {
 }
 
 bool OSVideoSurface::hasSurface() {
-	return _surface != nullptr;
+	return _ddSurface != nullptr;
 }
 
 void OSVideoSurface::proc43() {
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 71a2fd6..d0fa54b 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -40,7 +40,7 @@ private:
 protected:
 	CScreenManager *_screenManager;
 	CResourceKey _resourceKey;
-	DirectDrawSurface *_surface;
+	DirectDrawSurface *_ddSurface;
 	int _field2C;
 	int _field34;
 	bool _field38;


Commit: 6be64df2f0c0bf50e551187c2ba989d756f2dd36
    https://github.com/scummvm/scummvm/commit/6be64df2f0c0bf50e551187c2ba989d756f2dd36
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-16T21:01:01-04:00

Commit Message:
TITANIC: Implemented overall surface loading method

Changed paths:
    engines/titanic/core/resource_key.cpp
    engines/titanic/core/resource_key.h
    engines/titanic/files_manager.cpp
    engines/titanic/files_manager.h
    engines/titanic/string.cpp
    engines/titanic/string.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/core/resource_key.cpp b/engines/titanic/core/resource_key.cpp
index 4788f7a..4b52082 100644
--- a/engines/titanic/core/resource_key.cpp
+++ b/engines/titanic/core/resource_key.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "common/file.h"
+#include "titanic/titanic.h"
 #include "titanic/simple_file.h"
 #include "titanic/core/resource_key.h"
 
@@ -73,4 +74,16 @@ CString CResourceKey::exists() {
 	return f.exists(name) ? name : CString();
 }
 
+bool CResourceKey::scanForFile() const {
+	return g_vm->_filesManager.scanForFile(_value);
+}
+
+FileType CResourceKey::fileTypeSuffix() const {
+	return _value.fileTypeSuffix();
+}
+
+ImageType CResourceKey::imageTypeSuffix() const {
+	return _value.imageTypeSuffix();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/resource_key.h b/engines/titanic/core/resource_key.h
index a165a11..111cec5 100644
--- a/engines/titanic/core/resource_key.h
+++ b/engines/titanic/core/resource_key.h
@@ -57,6 +57,21 @@ public:
 	 * and returns it's filename if it does
 	 */
 	CString exists();
+
+	/**
+	 * Scans for a file with a matching name
+	 */
+	bool scanForFile() const;
+
+	/**
+	 * Returns the type of the resource based on it's extension
+	 */
+	FileType fileTypeSuffix() const;
+
+	/**
+	 * Returns the type of the resource based on it's extension
+	 */
+	ImageType imageTypeSuffix() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/files_manager.cpp b/engines/titanic/files_manager.cpp
index b7562b6..662a882 100644
--- a/engines/titanic/files_manager.cpp
+++ b/engines/titanic/files_manager.cpp
@@ -31,35 +31,35 @@ CFilesManager::CFilesManager() : _gameManager(nullptr),
 		_field18(0), _field1C(0), _field3C(0) {
 }
 
-bool CFilesManager::fn1(const CString &name) {
+bool CFilesManager::fileExists(const CString &name) {
+	Common::File f;
+	return f.exists(name);
+}
+
+bool CFilesManager::scanForFile(const CString &name) {
 	if (name.empty())
-		return 0;
+		return false;
 
-	CString str = name;
-	str.toLowercase();
+	CString filename = name;
+	filename.toLowercase();
 	
-	if (str[0] == 'z' || str[0] == 'y') {
-		return 1;
-	} else if (str[0] < 'a' || str[0] > 'c') {
-		return 0;
-	}
+	if (filename[0] == 'y' || filename[0] == 'z')
+		return true;
+	else if (filename[0] < 'a' || filename[0] > 'c')
+		return false;
 
-	CString tempStr = str;
-	int idx = tempStr.indexOf('#');
+	CString fname = filename;
+	int idx = fname.indexOf('#');
 	if (idx >= 0) {
-		tempStr = tempStr.left(idx);
-		str = str.c_str() + idx + 1;
-		str += ".st";
+		fname = fname.left(idx);
+		fname += ".st";
 	}
 
-
-
-	return true;
-}
-
-bool CFilesManager::fileExists(const CString &name) {
-	Common::File f;
-	return f.exists(name);
+	// The original had a bunch of code here handling determining
+	// which asset path, if any, the filename was present for,
+	// and storing the "active asset path" it was found on.
+	// This is redundant for ScummVM, which takes care of the paths
+	return fileExists(fname);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/files_manager.h b/engines/titanic/files_manager.h
index 63eda5e..9350523 100644
--- a/engines/titanic/files_manager.h
+++ b/engines/titanic/files_manager.h
@@ -54,12 +54,15 @@ public:
 		_gameManager = gameManager;
 	}
 
-	bool fn1(const CString &name);
-
 	/**
 	 * Returns true if a file of the given name exists
 	 */
 	static bool fileExists(const CString &name);
+
+	/**
+	 * Scans for a file with a matching name
+	 */
+	bool scanForFile(const CString &name);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp
index c1afb4f..dbe0617 100644
--- a/engines/titanic/string.cpp
+++ b/engines/titanic/string.cpp
@@ -56,4 +56,42 @@ int CString::lastIndexOf(char c) {
 	return charP ? charP - c_str() : -1;
 }
 
+FileType CString::fileTypeSuffix() const {
+	CString ext = right(1);
+	if (ext == "0" || ext == "4")
+		return FILETYPE_IMAGE;
+	else if (ext == "1")
+		return FILETYPE_WAV;
+	else if (ext == "2" || ext == "3")
+		return FILETYPE_MOVIE;
+	
+	ext = right(3);
+	if (ext == "tga" || ext == "jpg")
+		return FILETYPE_IMAGE;
+	else if (ext == "wav")
+		return FILETYPE_WAV;
+	else if (ext == "avi" || ext == "mov")
+		return FILETYPE_MOVIE;
+	else if (ext == "dlg")
+		return FILETYPE_DLG;
+	else
+		return FILETYPE_UNKNOWN;
+}
+
+ImageType CString::imageTypeSuffix() const {
+	CString ext = right(1);
+	if (ext == "0")
+		return IMAGETYPE_TARGA;
+	else if (ext == "4")
+		return IMAGETYPE_JPEG;
+
+	ext = right(3);
+	if (ext == "tga")
+		return IMAGETYPE_TARGA;
+	else if (ext == "jpg")
+		return IMAGETYPE_JPEG;
+	else
+		return IMAGETYPE_UNKNOWN;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/string.h b/engines/titanic/string.h
index d70e23d..6b8e4b7 100644
--- a/engines/titanic/string.h
+++ b/engines/titanic/string.h
@@ -28,6 +28,15 @@
 
 namespace Titanic {
 
+enum FileType {
+	FILETYPE_UNKNOWN = 0, FILETYPE_IMAGE = 1, FILETYPE_MOVIE = 2,
+	FILETYPE_WAV = 3, FILETYPE_DLG = 4
+};
+
+enum ImageType {
+	IMAGETYPE_UNKNOWN = 0, IMAGETYPE_TARGA = 1, IMAGETYPE_JPEG = 2
+};
+
 class CString : public Common::String {
 public:
 	CString() : Common::String() {}
@@ -66,6 +75,16 @@ public:
 	 * Returns the index of the last occurance of a given character
 	 */
 	int lastIndexOf(char c);
+
+	/**
+	 * Returns the type of a filename based on it's extension
+	 */
+	FileType fileTypeSuffix() const;
+
+	/**
+	 * Returns the type of an image filename based on it's extension
+	 */
+	ImageType imageTypeSuffix() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 1db2383..e649532 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/video_surface.h"
+#include "titanic/screen_manager.h"
 
 namespace Titanic {
 
@@ -51,27 +52,78 @@ OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, const CResourceKey
 	_field38 = flag;
 	
 	if (_field38) {
-		proc8(key);
+		loadResource(key);
 	} else {
 		_resourceKey = key;
-		proc43();
+		load();
 	}
 }
 
-void OSVideoSurface::proc8(const CResourceKey &key) {
+void OSVideoSurface::loadResource(const CResourceKey &key) {
 	_resourceKey = key;
 	_field38 = 1;
 
 	if (hasSurface())
-		proc43();
+		load();
+}
+
+void OSVideoSurface::loadTarga() {
+	warning("TODO");
+}
+
+void OSVideoSurface::loadJPEG() {
+	warning("TODO");
+}
+
+void OSVideoSurface::loadMovie() {
+	warning("TODO");
 }
 
 bool OSVideoSurface::hasSurface() {
 	return _ddSurface != nullptr;
 }
 
-void OSVideoSurface::proc43() {
-	warning("TODO");
+int OSVideoSurface::getWidth() const {
+	assert(_ddSurface);
+	return _ddSurface->w;
+}
+
+int OSVideoSurface::getHeight() const {
+	assert(_ddSurface);
+	return _ddSurface->h;
+}
+
+int OSVideoSurface::getPitch() const {
+	assert(_ddSurface);
+	return _ddSurface->pitch;
+}
+
+void OSVideoSurface::load() {
+	if (!_resourceKey.scanForFile())
+		return;
+
+	bool result = true;
+	switch (_resourceKey.fileTypeSuffix()) {
+	case FILETYPE_IMAGE:
+		switch (_resourceKey.imageTypeSuffix()) {
+		case IMAGETYPE_TARGA:
+			loadTarga();
+			break;
+		case IMAGETYPE_JPEG:
+			loadJPEG();
+			break;
+		default:
+			break;
+		}
+		return true;
+
+	case FILETYPE_MOVIE:
+		loadMovie();
+		return true;
+
+	default:
+		return false;
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index d0fa54b..1c4bf32 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -54,11 +54,64 @@ protected:
 public:
 	CVideoSurface(CScreenManager *screenManager);
 
+	/**
+	 * Set the underlying surface for this video surface
+	 */
 	void setSurface(CScreenManager *screenManager, DirectDrawSurface *surface);
 
-	virtual void proc8(const CResourceKey &key) = 0;
+	/**
+	 * Load the surface with the passed resource
+	 */
+	virtual void loadResource(const CResourceKey &key) = 0;
+
+	/**
+	 * Loads a Targa image file specified by the resource key
+	 */
+	virtual void loadTarga() = 0;
+
+	/**
+	 * Loads a JPEG image file specified by the resource key
+	 */
+	virtual void loadJPEG() = 0;
+
+	/**
+	 * Loads a movie file specified by the resource key
+	 */
+	virtual void loadMovie() = 0;
+
+	/**
+	 * Lock the surface for direct access to the pixels
+	 */
+	virtual void lock() = 0;
+
+	/**
+	 * Unlocks the surface after prior calls to lock()
+	 */
+	virtual void unlock() = 0;
+
+	/**
+	 * Returns true if an underlying raw surface has been set
+	 */
 	virtual bool hasSurface() = 0;
-	virtual void proc43() = 0;
+
+	/**
+	 * Returns the width of the surface
+	 */
+	virtual int getWidth() = 0;
+
+	/**
+	 * Returns the height of the surface
+	 */
+	virtual int getHeight() const = 0;
+
+	/**
+	 * Returns the pitch of the surface in bytes
+	 */
+	virtual int getPitch() const = 0;
+	/**
+	 * Loads the surface data based on the currently set resource key
+	 */
+	virtual void load() const = 0;
 };
 
 class OSVideoSurface : public CVideoSurface {
@@ -66,9 +119,60 @@ public:
 	OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface);
 	OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool flag = false);
 
-	virtual void proc8(const CResourceKey &key);
+	/**
+	 * Load the surface with the passed resource
+	 */
+	virtual void loadResource(const CResourceKey &key);
+
+	/**
+	 * Loads a Targa image file specified by the resource key
+	 */
+	virtual void loadTarga();
+
+	/**
+	 * Loads a JPEG image file specified by the resource key
+	 */
+	virtual void loadJPEG();
+
+	/**
+	 * Loads a movie file specified by the resource key
+	 */
+	virtual void loadMovie();
+
+	/**
+	 * Lock the surface for direct access to the pixels
+	 */
+	virtual void lock();
+
+	/**
+	 * Unlocks the surface after prior calls to lock()
+	 */
+	virtual void unlock();
+
+	/**
+	 * Returns true if an underlying raw surface has been set
+	 */
 	virtual bool hasSurface();
-	virtual void proc43();
+
+	/**
+	 * Returns the width of the surface
+	 */
+	virtual int getWidth() const;
+
+	/**
+	 * Returns the height of the surface
+	 */
+	virtual int getHeight() const;
+
+	/**
+	 * Returns the pitch of the surface in bytes
+	 */
+	virtual int getPitch() const;
+
+	/**
+	 * Loads the surface data based on the currently set resource key
+	 */
+	virtual void load();
 };
 
 } // End of namespace Titanic


Commit: c78e2fefd9f7a36b17c0206539536be95fca20f3
    https://github.com/scummvm/scummvm/commit/c78e2fefd9f7a36b17c0206539536be95fca20f3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-16T21:27:58-04:00

Commit Message:
TITANIC: Implement surface lock and unlocking

Changed paths:
    engines/titanic/direct_draw.cpp
    engines/titanic/direct_draw.h
    engines/titanic/simple_file.cpp
    engines/titanic/simple_file.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/direct_draw.cpp b/engines/titanic/direct_draw.cpp
index 17e1361..1d0ddab 100644
--- a/engines/titanic/direct_draw.cpp
+++ b/engines/titanic/direct_draw.cpp
@@ -110,6 +110,15 @@ DirectDrawSurface *DirectDrawManager::createSurface(int w, int h, int surfaceNum
 
 /*------------------------------------------------------------------------*/
 
+void *DirectDrawSurface::lock(const Common::Rect *bounds, int flags) {
+	assert(w != 0 && h != 0);
+	return getPixels();
+}
+
+void DirectDrawSurface::unlock() {
+	assert(w != 0 && h != 0);
+}
+
 void DirectDrawSurface::fill(const Common::Rect *bounds, uint32 color) {
 	Common::Rect tempBounds;
 
diff --git a/engines/titanic/direct_draw.h b/engines/titanic/direct_draw.h
index bd6a77d..71210f1 100644
--- a/engines/titanic/direct_draw.h
+++ b/engines/titanic/direct_draw.h
@@ -43,6 +43,16 @@ struct DDSurfaceDesc {
 class DirectDrawSurface : public Graphics::Surface {
 public:
 	/**
+	 * Lock the surface for access
+	 */
+	void *lock(const Common::Rect *bounds, int flags);
+
+	/**
+	 * Unlocks the surface at the end of direct accesses
+	 */
+	void unlock();
+
+	/**
 	 * Fills an area of the surfae with the specified color. If no bounds are passed,
 	 * then the entire surface is filled
 	 */
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index 4be8bb3..f2fdf4e 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -331,4 +331,13 @@ void SimpleFile::writeClassEnd(int indent) {
 	write("}\n", 2);
 }
 
+/*------------------------------------------------------------------------*/
+
+StdCWadFile::StdCWadFile(const CString &name): SimpleFile() {
+	if (!_file.open(name))
+		error("Could not open file - %s", name.c_str());
+
+	open(&_file);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
index cc68d2d..0a452e4 100644
--- a/engines/titanic/simple_file.h
+++ b/engines/titanic/simple_file.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_SIMPLE_FILE_H
 #define TITANIC_SIMPLE_FILE_H
 
+#include "common/file.h"
 #include "common/rect.h"
 #include "common/savefile.h"
 #include "common/stream.h"
@@ -202,6 +203,13 @@ public:
 	}
 };
 
+class StdCWadFile : public SimpleFile {
+private:
+	Common::File _file;
+public:
+	StdCWadFile(const CString &name);
+};
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_SIMPLE_FILE_H */
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index e649532..771c777 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 int CVideoSurface::_videoSurfaceCounter = 0;
 
 CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
-		_screenManager(screenManager), _field2C(0),
+		_screenManager(screenManager), _pixels(nullptr),
 		_field34(0), _field38(0), _field3C(0), _field40(0),
 		_field44(4), _field48(0), _field50(1) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
@@ -79,6 +79,22 @@ void OSVideoSurface::loadMovie() {
 	warning("TODO");
 }
 
+bool OSVideoSurface::lock() {
+	if (!proc42())
+		return false;
+
+	++_lockCount;
+	_pixels = (uint16 *)_ddSurface->lock(nullptr, 0);
+	return true;
+}
+
+void OSVideoSurface::unlock() {
+	if (_pixels)
+		_ddSurface->unlock();
+	_pixels = nullptr;
+	--_lockCount;
+}
+
 bool OSVideoSurface::hasSurface() {
 	return _ddSurface != nullptr;
 }
@@ -98,11 +114,10 @@ int OSVideoSurface::getPitch() const {
 	return _ddSurface->pitch;
 }
 
-void OSVideoSurface::load() {
+bool OSVideoSurface::load() {
 	if (!_resourceKey.scanForFile())
-		return;
+		return false;
 
-	bool result = true;
 	switch (_resourceKey.fileTypeSuffix()) {
 	case FILETYPE_IMAGE:
 		switch (_resourceKey.imageTypeSuffix()) {
@@ -126,4 +141,18 @@ void OSVideoSurface::load() {
 	}
 }
 
+bool OSVideoSurface::proc42() {
+	_videoSurfaceNum = _videoSurfaceCounter;
+
+	if (hasSurface()) {
+		return true;
+	} else if (_field38) {
+		_field50 = 1;
+		load();
+		return true;
+	} else {
+		return false;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 1c4bf32..445165c 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -35,13 +35,13 @@ namespace Titanic {
 class CScreenManager;
 
 class CVideoSurface : public ListItem {
-private:
+protected:
 	static int _videoSurfaceCounter;
 protected:
 	CScreenManager *_screenManager;
 	CResourceKey _resourceKey;
 	DirectDrawSurface *_ddSurface;
-	int _field2C;
+	uint16 *_pixels;
 	int _field34;
 	bool _field38;
 	int _field3C;
@@ -50,7 +50,7 @@ protected:
 	int _field48;
 	int _videoSurfaceNum;
 	int _field50;
-	int _accessCtr;
+	int _lockCount;
 public:
 	CVideoSurface(CScreenManager *screenManager);
 
@@ -82,7 +82,7 @@ public:
 	/**
 	 * Lock the surface for direct access to the pixels
 	 */
-	virtual void lock() = 0;
+	virtual bool lock() = 0;
 
 	/**
 	 * Unlocks the surface after prior calls to lock()
@@ -97,7 +97,7 @@ public:
 	/**
 	 * Returns the width of the surface
 	 */
-	virtual int getWidth() = 0;
+	virtual int getWidth() const = 0;
 
 	/**
 	 * Returns the height of the surface
@@ -108,10 +108,13 @@ public:
 	 * Returns the pitch of the surface in bytes
 	 */
 	virtual int getPitch() const = 0;
+	
 	/**
 	 * Loads the surface data based on the currently set resource key
 	 */
-	virtual void load() const = 0;
+	virtual bool load() = 0;
+
+	virtual bool proc42() = 0;
 };
 
 class OSVideoSurface : public CVideoSurface {
@@ -142,7 +145,7 @@ public:
 	/**
 	 * Lock the surface for direct access to the pixels
 	 */
-	virtual void lock();
+	virtual bool lock();
 
 	/**
 	 * Unlocks the surface after prior calls to lock()
@@ -172,7 +175,9 @@ public:
 	/**
 	 * Loads the surface data based on the currently set resource key
 	 */
-	virtual void load();
+	virtual bool load();
+
+	virtual bool proc42();
 };
 
 } // End of namespace Titanic


Commit: b5d64f9c20611eb99b4d908d72e6cfd05f1a4c65
    https://github.com/scummvm/scummvm/commit/b5d64f9c20611eb99b4d908d72e6cfd05f1a4c65
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-16T21:35:41-04:00

Commit Message:
TITANIC: Renames/fixes for OSVideoSurface methods

Changed paths:
    engines/titanic/string.cpp
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp
index dbe0617..44e0e62 100644
--- a/engines/titanic/string.cpp
+++ b/engines/titanic/string.cpp
@@ -26,11 +26,13 @@
 namespace Titanic {
 
 CString CString::left(uint count) const {
-	return (count > size()) ? *this : CString(c_str(), c_str() + count);
+	return (count > size()) ? CString() : CString(c_str(), c_str() + count);
 }
 
 CString CString::right(uint count) const {
-	return (count > size()) ? *this : CString(c_str() - count, c_str());
+	int strSize = size();
+	return (count > strSize) ? CString() : 
+		CString(c_str() + strSize - count, c_str() + strSize);
 }
 
 CString CString::mid(uint start, uint count) const {
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 771c777..44b91c0 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -29,7 +29,7 @@ int CVideoSurface::_videoSurfaceCounter = 0;
 
 CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
 		_screenManager(screenManager), _pixels(nullptr),
-		_field34(0), _field38(0), _field3C(0), _field40(0),
+		_field34(0), _pendingLoad(false), _field3C(0), _field40(0),
 		_field44(4), _field48(0), _field50(1) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
 }
@@ -46,12 +46,12 @@ OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface
 	_ddSurface = surface;
 }
 
-OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool flag) :
+OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool pendingLoad) :
 		CVideoSurface(screenManager) {
 	_ddSurface = nullptr;
-	_field38 = flag;
+	_pendingLoad = pendingLoad;
 	
-	if (_field38) {
+	if (_pendingLoad) {
 		loadResource(key);
 	} else {
 		_resourceKey = key;
@@ -61,7 +61,7 @@ OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, const CResourceKey
 
 void OSVideoSurface::loadResource(const CResourceKey &key) {
 	_resourceKey = key;
-	_field38 = 1;
+	_pendingLoad = true;
 
 	if (hasSurface())
 		load();
@@ -80,7 +80,7 @@ void OSVideoSurface::loadMovie() {
 }
 
 bool OSVideoSurface::lock() {
-	if (!proc42())
+	if (!loadIfReady())
 		return false;
 
 	++_lockCount;
@@ -141,12 +141,12 @@ bool OSVideoSurface::load() {
 	}
 }
 
-bool OSVideoSurface::proc42() {
+bool OSVideoSurface::loadIfReady() {
 	_videoSurfaceNum = _videoSurfaceCounter;
 
 	if (hasSurface()) {
 		return true;
-	} else if (_field38) {
+	} else if (_pendingLoad) {
 		_field50 = 1;
 		load();
 		return true;
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 445165c..d03e322 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -43,7 +43,7 @@ protected:
 	DirectDrawSurface *_ddSurface;
 	uint16 *_pixels;
 	int _field34;
-	bool _field38;
+	bool _pendingLoad;
 	int _field3C;
 	int _field40;
 	int _field44;
@@ -114,7 +114,10 @@ public:
 	 */
 	virtual bool load() = 0;
 
-	virtual bool proc42() = 0;
+	/**
+	 * Loads the surface's resource if there's one pending
+	 */
+	virtual bool loadIfReady() = 0;
 };
 
 class OSVideoSurface : public CVideoSurface {
@@ -177,7 +180,10 @@ public:
 	 */
 	virtual bool load();
 
-	virtual bool proc42();
+	/**
+	 * Loads the surface's resource if there's one pending
+	 */
+	virtual bool loadIfReady();
 };
 
 } // End of namespace Titanic


Commit: 103f3b524eecc8714f27670e49c414a2198fca90
    https://github.com/scummvm/scummvm/commit/103f3b524eecc8714f27670e49c414a2198fca90
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-16T22:40:50-04:00

Commit Message:
TITANIC: Implemented surface resizing and freeing

Changed paths:
  A engines/titanic/image_decoders.cpp
  A engines/titanic/image_decoders.h
    engines/titanic/direct_draw.h
    engines/titanic/module.mk
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/direct_draw.h b/engines/titanic/direct_draw.h
index 71210f1..4bd723b 100644
--- a/engines/titanic/direct_draw.h
+++ b/engines/titanic/direct_draw.h
@@ -43,6 +43,11 @@ struct DDSurfaceDesc {
 class DirectDrawSurface : public Graphics::Surface {
 public:
 	/**
+	 * Return the size of the surface in ytes
+	 */
+	int getSize() const { return pitch * h; }
+
+	/**
 	 * Lock the surface for access
 	 */
 	void *lock(const Common::Rect *bounds, int flags);
diff --git a/engines/titanic/image_decoders.cpp b/engines/titanic/image_decoders.cpp
new file mode 100644
index 0000000..896155d
--- /dev/null
+++ b/engines/titanic/image_decoders.cpp
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/image_decoders.h"
+
+namespace Titanic {
+
+CJPEGDecode::CJPEGDecode(const CString &name): _file(name),
+		_width(0), _height(0) {
+}
+
+void CJPEGDecode::decode(OSVideoSurface &surface) {
+
+}
+
+/*------------------------------------------------------------------------*/
+
+
+CTargaDecode::CTargaDecode(const CString &name) : _file(name),
+		_width(0), _height(0) {
+}
+
+void CTargaDecode::decode(OSVideoSurface &surface) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/image_decoders.h b/engines/titanic/image_decoders.h
new file mode 100644
index 0000000..2585958
--- /dev/null
+++ b/engines/titanic/image_decoders.h
@@ -0,0 +1,81 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_IMAGE_DECODERS_H
+#define TITANIC_IMAGE_DECODERS_H
+
+#include "titanic/string.h"
+#include "titanic/simple_file.h"
+#include "titanic/video_surface.h"
+
+namespace Titanic {
+
+class CJPEGDecode {
+private:
+	StdCWadFile _file;
+	int _width, _height;
+public:
+	CJPEGDecode(const CString &name);
+
+	/**
+	 * Return the width of the JPEG
+	 */
+	int getWidth() const { return _width; }
+
+	/**
+	 * Return the height of the JPEG
+	 */
+	int getHeight() const { return _height; }
+
+	/**
+	 * Decode the image onto the passed surface
+	 */
+	void decode(OSVideoSurface &surface);
+};
+
+class CTargaDecode {
+private:
+	StdCWadFile _file;
+	int _width, _height;
+public:
+	CTargaDecode(const CString &name);
+
+	/**
+	* Return the width of the JPEG
+	*/
+	int getWidth() const { return _width; }
+
+	/**
+	* Return the height of the JPEG
+	*/
+	int getHeight() const { return _height; }
+
+	/**
+	 * Decode the image onto the passed surface
+	 */
+	void decode(OSVideoSurface &surface);
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_IMAGE_DECODERS_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 664dc0a..ec55392 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -10,6 +10,7 @@ MODULE_OBJS := \
 	game_state.o \
 	game_view.o \
 	image.o \
+	image_decoders.o \
 	input_handler.o \
 	input_translator.o \
 	main_game_window.o \
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index f64468e..9c88dc6 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -130,7 +130,10 @@ void OSScreenManager::clearSurface(int surfaceNum, Common::Rect *bounds) {
 		_directDrawManager._backSurfaces[surfaceNum]->fill(bounds, 0);
 }
 
-void OSScreenManager::proc21() {}
+void OSScreenManager::resizeSurface(CVideoSurface *surface, int width, int height) {
+	DirectDrawSurface *ddSurface = _directDrawManager.createSurface(width, height, 0);
+	surface->setSurface(this, ddSurface);
+}
 
 CVideoSurface *OSScreenManager::createSurface(int w, int h) {
 	DirectDrawSurface *ddSurface = _directDrawManager.createSurface(w, h, 0);
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index 075e36c..caaefc8 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -105,7 +105,10 @@ public:
 	 */
 	virtual void clearSurface(int surfaceNum, Common::Rect *_bounds) = 0;
 
-	virtual void proc21() = 0;
+	/**
+	 * Resize the passed surface
+	 */
+	virtual void resizeSurface(CVideoSurface *surface, int width, int height) = 0;
 
 	/**
 	 * Creates a surface of a given size
@@ -167,8 +170,11 @@ public:
 	 * Clear a portion of the screen surface
 	 */
 	virtual void clearSurface(int surfaceNum, Common::Rect *bounds);
-	
-	virtual void proc21();
+
+	/**
+	 * Resize the passed surface
+	 */
+	virtual void resizeSurface(CVideoSurface *surface, int width, int height);
 
 	/**
 	 * Creates a surface of a given size
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 44b91c0..4f79cd81 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/video_surface.h"
+#include "titanic/image_decoders.h"
 #include "titanic/screen_manager.h"
 
 namespace Titanic {
@@ -29,11 +30,19 @@ int CVideoSurface::_videoSurfaceCounter = 0;
 
 CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
 		_screenManager(screenManager), _pixels(nullptr),
-		_field34(0), _pendingLoad(false), _field3C(0), _field40(0),
+		_field34(nullptr), _pendingLoad(false), _field3C(0), _field40(0),
 		_field44(4), _field48(0), _field50(1) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
 }
 
+
+CVideoSurface::~CVideoSurface() {
+	if (_ddSurface)
+		_videoSurfaceCounter -= freeSurface();
+	--_videoSurfaceCounter;
+}
+
+
 void CVideoSurface::setSurface(CScreenManager *screenManager, DirectDrawSurface *surface) {
 	_screenManager = screenManager;
 	_ddSurface = surface;
@@ -72,6 +81,10 @@ void OSVideoSurface::loadTarga() {
 }
 
 void OSVideoSurface::loadJPEG() {
+	CString filename = _resourceKey.exists();
+	CJPEGDecode decoder(filename);
+
+
 	warning("TODO");
 }
 
@@ -114,6 +127,14 @@ int OSVideoSurface::getPitch() const {
 	return _ddSurface->pitch;
 }
 
+void OSVideoSurface::resize(int width, int height) {
+	freeSurface();
+
+	_screenManager->resizeSurface(this, width, height);
+	if (_ddSurface)
+		_videoSurfaceCounter += _ddSurface->getSize();
+}
+
 bool OSVideoSurface::load() {
 	if (!_resourceKey.scanForFile())
 		return false;
@@ -155,4 +176,17 @@ bool OSVideoSurface::loadIfReady() {
 	}
 }
 
+int OSVideoSurface::freeSurface() {
+	if (!_ddSurface)
+		return 0;
+	int surfaceSize = _ddSurface->getSize();
+
+	delete _field34;
+	_field34 = nullptr;
+	delete _ddSurface;
+	_ddSurface = nullptr;
+
+	return surfaceSize;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index d03e322..cd1fc2e 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -42,7 +42,7 @@ protected:
 	CResourceKey _resourceKey;
 	DirectDrawSurface *_ddSurface;
 	uint16 *_pixels;
-	int _field34;
+	void *_field34;
 	bool _pendingLoad;
 	int _field3C;
 	int _field40;
@@ -53,6 +53,7 @@ protected:
 	int _lockCount;
 public:
 	CVideoSurface(CScreenManager *screenManager);
+	virtual ~CVideoSurface();
 
 	/**
 	 * Set the underlying surface for this video surface
@@ -110,6 +111,11 @@ public:
 	virtual int getPitch() const = 0;
 	
 	/**
+	 * Reiszes the surface
+	 */
+	virtual void resize(int width, int height) = 0;
+
+	/**
 	 * Loads the surface data based on the currently set resource key
 	 */
 	virtual bool load() = 0;
@@ -118,6 +124,11 @@ public:
 	 * Loads the surface's resource if there's one pending
 	 */
 	virtual bool loadIfReady() = 0;
+
+	/**
+	 * Frees the underlying surface
+	 */
+	virtual int freeSurface() { return 0; }
 };
 
 class OSVideoSurface : public CVideoSurface {
@@ -176,6 +187,11 @@ public:
 	virtual int getPitch() const;
 
 	/**
+	 * Reiszes the surface
+	 */
+	virtual void resize(int width, int height);
+
+	/**
 	 * Loads the surface data based on the currently set resource key
 	 */
 	virtual bool load();
@@ -184,6 +200,11 @@ public:
 	 * Loads the surface's resource if there's one pending
 	 */
 	virtual bool loadIfReady();
+
+	/**
+	 * Frees the underlying surface
+	 */
+	virtual int freeSurface();
 };
 
 } // End of namespace Titanic


Commit: c1f2912fc464dd17a840d74a7e545ee2dcfd485f
    https://github.com/scummvm/scummvm/commit/c1f2912fc464dd17a840d74a7e545ee2dcfd485f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-16T23:06:01-04:00

Commit Message:
TITANIC: Implemented surface shiftColors

Changed paths:
    engines/titanic/core/resource_key.cpp
    engines/titanic/core/resource_key.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/core/resource_key.cpp b/engines/titanic/core/resource_key.cpp
index 4b52082..089df98 100644
--- a/engines/titanic/core/resource_key.cpp
+++ b/engines/titanic/core/resource_key.cpp
@@ -58,7 +58,7 @@ void CResourceKey::setValue(const CString &name) {
 		_value = _value.mid(idx + 1);
 }
 
-CString CResourceKey::exists() {
+CString CResourceKey::exists() const {
 	CString name = _key;
 
 	// Check for a resource being specified within an ST container
diff --git a/engines/titanic/core/resource_key.h b/engines/titanic/core/resource_key.h
index 111cec5..dc4c791 100644
--- a/engines/titanic/core/resource_key.h
+++ b/engines/titanic/core/resource_key.h
@@ -56,7 +56,7 @@ public:
 	 * Checks whether a file for the given key exists,
 	 * and returns it's filename if it does
 	 */
-	CString exists();
+	CString exists() const;
 
 	/**
 	 * Scans for a file with a matching name
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 4f79cd81..19dcf25 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -35,14 +35,12 @@ CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
 	_videoSurfaceNum = _videoSurfaceCounter++;
 }
 
-
 CVideoSurface::~CVideoSurface() {
 	if (_ddSurface)
 		_videoSurfaceCounter -= freeSurface();
 	--_videoSurfaceCounter;
 }
 
-
 void CVideoSurface::setSurface(CScreenManager *screenManager, DirectDrawSurface *surface) {
 	_screenManager = screenManager;
 	_ddSurface = surface;
@@ -76,16 +74,21 @@ void OSVideoSurface::loadResource(const CResourceKey &key) {
 		load();
 }
 
-void OSVideoSurface::loadTarga() {
+void OSVideoSurface::loadTarga(const CResourceKey &key) {
 	warning("TODO");
 }
 
-void OSVideoSurface::loadJPEG() {
-	CString filename = _resourceKey.exists();
+void OSVideoSurface::loadJPEG(const CResourceKey &key) {
+	CString filename = key.exists();
+
+	// Decode the image
 	CJPEGDecode decoder(filename);
+	decoder.decode(*this);
 
+	if (proc26() == 2)
+		shiftColors();
 
-	warning("TODO");
+	_resourceKey = key;
 }
 
 void OSVideoSurface::loadMovie() {
@@ -135,6 +138,14 @@ void OSVideoSurface::resize(int width, int height) {
 		_videoSurfaceCounter += _ddSurface->getSize();
 }
 
+int OSVideoSurface::proc26() {
+	if (!loadIfReady())
+		assert(0);
+
+	warning("TODO");
+	return 0;
+}
+
 bool OSVideoSurface::load() {
 	if (!_resourceKey.scanForFile())
 		return false;
@@ -143,10 +154,10 @@ bool OSVideoSurface::load() {
 	case FILETYPE_IMAGE:
 		switch (_resourceKey.imageTypeSuffix()) {
 		case IMAGETYPE_TARGA:
-			loadTarga();
+			loadTarga(_resourceKey);
 			break;
 		case IMAGETYPE_JPEG:
-			loadJPEG();
+			loadJPEG(_resourceKey);
 			break;
 		default:
 			break;
@@ -162,6 +173,29 @@ bool OSVideoSurface::load() {
 	}
 }
 
+void OSVideoSurface::shiftColors() {
+	if (!loadIfReady())
+		return;
+
+	if (!lock())
+		assert(0);
+
+	int width = getWidth();
+	int height = getHeight();
+	int pitch = getPitch();
+	uint16 *pixels = _pixels;
+	uint16 *p;
+	int x, y;
+
+	for (y = 0; y < height; ++y, pixels += pitch) {
+		for (x = 0, p = pixels; x < width; ++x, ++p) {
+			*p = ((*p & 0xFFE0) * 2) | (*p & 0x1F);
+		}
+	}
+
+	unlock();
+}
+
 bool OSVideoSurface::loadIfReady() {
 	_videoSurfaceNum = _videoSurfaceCounter;
 
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index cd1fc2e..838529f 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -68,12 +68,12 @@ public:
 	/**
 	 * Loads a Targa image file specified by the resource key
 	 */
-	virtual void loadTarga() = 0;
+	virtual void loadTarga(const CResourceKey &key) = 0;
 
 	/**
 	 * Loads a JPEG image file specified by the resource key
 	 */
-	virtual void loadJPEG() = 0;
+	virtual void loadJPEG(const CResourceKey &key) = 0;
 
 	/**
 	 * Loads a movie file specified by the resource key
@@ -115,10 +115,12 @@ public:
 	 */
 	virtual void resize(int width, int height) = 0;
 
+	virtual int proc26() = 0;
+
 	/**
-	 * Loads the surface data based on the currently set resource key
+	 * Shifts the colors of the surface.. maybe greys it out?
 	 */
-	virtual bool load() = 0;
+	virtual void shiftColors() = 0;
 
 	/**
 	 * Loads the surface's resource if there's one pending
@@ -126,6 +128,11 @@ public:
 	virtual bool loadIfReady() = 0;
 
 	/**
+	 * Loads the surface data based on the currently set resource key
+	 */
+	virtual bool load() = 0;
+
+	/**
 	 * Frees the underlying surface
 	 */
 	virtual int freeSurface() { return 0; }
@@ -144,12 +151,12 @@ public:
 	/**
 	 * Loads a Targa image file specified by the resource key
 	 */
-	virtual void loadTarga();
+	virtual void loadTarga(const CResourceKey &key);
 
 	/**
 	 * Loads a JPEG image file specified by the resource key
 	 */
-	virtual void loadJPEG();
+	virtual void loadJPEG(const CResourceKey &key);
 
 	/**
 	 * Loads a movie file specified by the resource key
@@ -191,10 +198,12 @@ public:
 	 */
 	virtual void resize(int width, int height);
 
+	virtual int proc26();
+
 	/**
-	 * Loads the surface data based on the currently set resource key
+	 * Shifts the colors of the surface.. maybe greys it out?
 	 */
-	virtual bool load();
+	virtual void shiftColors();
 
 	/**
 	 * Loads the surface's resource if there's one pending
@@ -202,6 +211,11 @@ public:
 	virtual bool loadIfReady();
 
 	/**
+	 * Loads the surface data based on the currently set resource key
+	 */
+	virtual bool load();
+
+	/**
 	 * Frees the underlying surface
 	 */
 	virtual int freeSurface();


Commit: 5a3aa81ab628fce76a33a07dc97010bd4d439a4e
    https://github.com/scummvm/scummvm/commit/5a3aa81ab628fce76a33a07dc97010bd4d439a4e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-17T07:28:58-04:00

Commit Message:
TITANIC: Implemented CStdCWADFile class

Changed paths:
    engines/titanic/image_decoders.cpp
    engines/titanic/simple_file.cpp
    engines/titanic/simple_file.h
    engines/titanic/string.cpp
    engines/titanic/string.h
    engines/titanic/video_surface.cpp



diff --git a/engines/titanic/image_decoders.cpp b/engines/titanic/image_decoders.cpp
index 896155d..bf941f8 100644
--- a/engines/titanic/image_decoders.cpp
+++ b/engines/titanic/image_decoders.cpp
@@ -24,8 +24,8 @@
 
 namespace Titanic {
 
-CJPEGDecode::CJPEGDecode(const CString &name): _file(name),
-		_width(0), _height(0) {
+CJPEGDecode::CJPEGDecode(const CString &name) : _width(0), _height(0) {
+	_file.open(name);
 }
 
 void CJPEGDecode::decode(OSVideoSurface &surface) {
@@ -35,8 +35,7 @@ void CJPEGDecode::decode(OSVideoSurface &surface) {
 /*------------------------------------------------------------------------*/
 
 
-CTargaDecode::CTargaDecode(const CString &name) : _file(name),
-		_width(0), _height(0) {
+CTargaDecode::CTargaDecode(const CString &name) : _width(0), _height(0) {
 }
 
 void CTargaDecode::decode(OSVideoSurface &surface) {
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index f2fdf4e..c975a27 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -25,6 +25,13 @@
 
 namespace Titanic {
 
+bool File::open(const Common::String &name) {
+	if (!Common::File::open(name))
+		error("Could not open file - %s", name.c_str());
+}
+
+/*------------------------------------------------------------------------*/
+
 SimpleFile::SimpleFile(): _inStream(nullptr), _outStream(nullptr), _lineCount(1) {
 }
 
@@ -333,11 +340,45 @@ void SimpleFile::writeClassEnd(int indent) {
 
 /*------------------------------------------------------------------------*/
 
-StdCWadFile::StdCWadFile(const CString &name): SimpleFile() {
-	if (!_file.open(name))
-		error("Could not open file - %s", name.c_str());
+void StdCWadFile::open(const CString &name) {
+	File f;
+
+	// Check for whether it is indeed a file/resource pair
+	int idx = name.indexOf('#');
+
+	if (idx < 0) {
+		// Nope, so open up file for standard reading
+		assert(!name.empty());
+		f.open(name);
+
+		SimpleFile::open(f.readStream(f.size()));
+		return;
+	}
 
-	open(&_file);
+	// Split up the name and resource, and get the resource index
+	CString filename = name.left(idx) + ".st";
+	int extPos = name.lastIndexOf('.');
+	CString resStr = name.mid(idx + 1, extPos - idx - 1);
+	int resIndex = resStr.readInt();
+
+	// Open up the index for access 
+	f.open(filename);
+	int indexSize = f.readUint32LE() / 4;
+	assert(resIndex < indexSize);
+
+	// Get the specific resource's offset, and size by also
+	// getting the offset of the following resource
+	f.seek(resIndex * 4);
+	uint resOffset = f.readUint32LE();
+	uint nextOffset = (resIndex == (indexSize - 1)) ? f.size() :
+		f.readUint32LE();
+
+	// Read in the resource
+	f.seek(resOffset);
+	Common::SeekableReadStream *stream = f.readStream(nextOffset - resOffset);
+	SimpleFile::open(stream);
+
+	f.close();
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
index 0a452e4..b779fd0 100644
--- a/engines/titanic/simple_file.h
+++ b/engines/titanic/simple_file.h
@@ -36,6 +36,15 @@ class Decompressor;
 class DecompressorData;
 
 /**
+ * Simple ScummVM File descendent that throws a wobbly if
+ * the file it tries to open isn't present
+ */
+class File : public Common::File {
+public:
+	virtual bool open(const Common::String &name);
+};
+
+/**
  * This class implements basic reading and writing to files
  */
 class SimpleFile {
@@ -203,11 +212,18 @@ public:
 	}
 };
 
+/**
+ * Derived file that handles WAD archives containing multiple files
+ */
 class StdCWadFile : public SimpleFile {
-private:
-	Common::File _file;
 public:
-	StdCWadFile(const CString &name);
+	StdCWadFile() : SimpleFile() {}
+	virtual ~StdCWadFile() {}
+
+	/**
+	 * Open up the specified file
+	 */
+	void open(const CString &name);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp
index 44e0e62..ed5379b 100644
--- a/engines/titanic/string.cpp
+++ b/engines/titanic/string.cpp
@@ -48,12 +48,12 @@ CString CString::mid(uint start) const {
 	return mid(start, strSize - start);
 }
 
-int CString::indexOf(char c) {
+int CString::indexOf(char c) const {
 	const char *charP = strchr(c_str(), c);
 	return charP ? charP - c_str() : -1;
 }
 
-int CString::lastIndexOf(char c) {
+int CString::lastIndexOf(char c) const {
 	const char *charP = strrchr(c_str(), c);
 	return charP ? charP - c_str() : -1;
 }
diff --git a/engines/titanic/string.h b/engines/titanic/string.h
index 6b8e4b7..08b5649 100644
--- a/engines/titanic/string.h
+++ b/engines/titanic/string.h
@@ -69,12 +69,12 @@ public:
 	/**
 	 * Returns the index of the first occurance of a given character
 	 */
-	int indexOf(char c);
+	int indexOf(char c) const;
 
 	/**
 	 * Returns the index of the last occurance of a given character
 	 */
-	int lastIndexOf(char c);
+	int lastIndexOf(char c) const;
 
 	/**
 	 * Returns the type of a filename based on it's extension
@@ -85,6 +85,13 @@ public:
 	 * Returns the type of an image filename based on it's extension
 	 */
 	ImageType imageTypeSuffix() const;
+
+	/**
+	 * Parses the string as an integer and returns the value
+	 */
+	int readInt() const {
+		return atoi(c_str());
+	}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 19dcf25..8406800 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -79,10 +79,8 @@ void OSVideoSurface::loadTarga(const CResourceKey &key) {
 }
 
 void OSVideoSurface::loadJPEG(const CResourceKey &key) {
-	CString filename = key.exists();
-
 	// Decode the image
-	CJPEGDecode decoder(filename);
+	CJPEGDecode decoder(key.getString());
 	decoder.decode(*this);
 
 	if (proc26() == 2)


Commit: 8a1d238fd59a6aef21f74721f039cc0375c18a24
    https://github.com/scummvm/scummvm/commit/8a1d238fd59a6aef21f74721f039cc0375c18a24
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-17T13:11:01-04:00

Commit Message:
TITANIC: Implemented the CJPEGDecode and CTargaDecode classes

Thank goodness for the existing ScummVM image decoders for these types..
it made implementing the classes sooooo much easier

Changed paths:
    engines/titanic/direct_draw.cpp
    engines/titanic/direct_draw.h
    engines/titanic/image_decoders.cpp
    engines/titanic/image_decoders.h
    engines/titanic/simple_file.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/direct_draw.cpp b/engines/titanic/direct_draw.cpp
index 1d0ddab..d5a8cf2 100644
--- a/engines/titanic/direct_draw.cpp
+++ b/engines/titanic/direct_draw.cpp
@@ -110,9 +110,9 @@ DirectDrawSurface *DirectDrawManager::createSurface(int w, int h, int surfaceNum
 
 /*------------------------------------------------------------------------*/
 
-void *DirectDrawSurface::lock(const Common::Rect *bounds, int flags) {
+Graphics::Surface *DirectDrawSurface::lock(const Common::Rect *bounds, int flags) {
 	assert(w != 0 && h != 0);
-	return getPixels();
+	return this;
 }
 
 void DirectDrawSurface::unlock() {
diff --git a/engines/titanic/direct_draw.h b/engines/titanic/direct_draw.h
index 4bd723b..5ec0f3d 100644
--- a/engines/titanic/direct_draw.h
+++ b/engines/titanic/direct_draw.h
@@ -50,7 +50,7 @@ public:
 	/**
 	 * Lock the surface for access
 	 */
-	void *lock(const Common::Rect *bounds, int flags);
+	Graphics::Surface *lock(const Common::Rect *bounds, int flags);
 
 	/**
 	 * Unlocks the surface at the end of direct accesses
diff --git a/engines/titanic/image_decoders.cpp b/engines/titanic/image_decoders.cpp
index bf941f8..e6e547f 100644
--- a/engines/titanic/image_decoders.cpp
+++ b/engines/titanic/image_decoders.cpp
@@ -24,21 +24,54 @@
 
 namespace Titanic {
 
-CJPEGDecode::CJPEGDecode(const CString &name) : _width(0), _height(0) {
-	_file.open(name);
-}
+void CJPEGDecode::decode(OSVideoSurface &surface, const CString &name) {
+	// Open up the resource
+	StdCWadFile file;
+	file.open(name);
+
+	// Use the ScucmmVM deoder to decode it
+	loadStream(*file.readStream());
+	const Graphics::Surface *srcSurf = getSurface();
+	
+	// Resize the surface if necessary
+	if (surface.getWidth() != srcSurf->w || surface.getHeight() != srcSurf->h)
+		surface.resize(srcSurf->w, srcSurf->h);
 
-void CJPEGDecode::decode(OSVideoSurface &surface) {
+	// Convert the decoded surface to the correct pixel format, and then copy it over
+	surface.lock();
+	Graphics::Surface *convertedSurface = srcSurf->convertTo(surface._rawSurface->format);
 
+	Common::copy((byte *)convertedSurface->getPixels(), (byte *)convertedSurface->getPixels() +
+		surface.getPitch() * surface.getHeight(), (byte *)surface._rawSurface->getPixels());
+
+	delete convertedSurface;
+	surface.unlock();
 }
 
 /*------------------------------------------------------------------------*/
 
+void CTargaDecode::decode(OSVideoSurface &surface, const CString &name) {
+	// Open up the resource
+	StdCWadFile file;
+	file.open(name);
 
-CTargaDecode::CTargaDecode(const CString &name) : _width(0), _height(0) {
-}
+	// Use the ScucmmVM deoder to decode it
+	loadStream(*file.readStream());
+	const Graphics::Surface *srcSurf = getSurface();
+
+	// Resize the surface if necessary
+	if (surface.getWidth() != srcSurf->w || surface.getHeight() != srcSurf->h)
+		surface.resize(srcSurf->w, srcSurf->h);
+
+	// Convert the decoded surface to the correct pixel format, and then copy it over
+	surface.lock();
+	Graphics::Surface *convertedSurface = srcSurf->convertTo(surface._rawSurface->format);
+
+	Common::copy((byte *)convertedSurface->getPixels(), (byte *)convertedSurface->getPixels() +
+		surface.getPitch() * surface.getHeight(), (byte *)surface._rawSurface->getPixels());
 
-void CTargaDecode::decode(OSVideoSurface &surface) {
+	delete convertedSurface;
+	surface.unlock();
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/image_decoders.h b/engines/titanic/image_decoders.h
index 2585958..d72d6fe 100644
--- a/engines/titanic/image_decoders.h
+++ b/engines/titanic/image_decoders.h
@@ -23,57 +23,28 @@
 #ifndef TITANIC_IMAGE_DECODERS_H
 #define TITANIC_IMAGE_DECODERS_H
 
+#include "image/jpeg.h"
+#include "image/tga.h"
 #include "titanic/string.h"
 #include "titanic/simple_file.h"
 #include "titanic/video_surface.h"
 
 namespace Titanic {
 
-class CJPEGDecode {
-private:
-	StdCWadFile _file;
-	int _width, _height;
+class CJPEGDecode : public Image::JPEGDecoder {
 public:
-	CJPEGDecode(const CString &name);
-
-	/**
-	 * Return the width of the JPEG
-	 */
-	int getWidth() const { return _width; }
-
 	/**
-	 * Return the height of the JPEG
+	 * Decode the image file onto the passed surface
 	 */
-	int getHeight() const { return _height; }
-
-	/**
-	 * Decode the image onto the passed surface
-	 */
-	void decode(OSVideoSurface &surface);
+	void decode(OSVideoSurface &surface, const CString &name);
 };
 
-class CTargaDecode {
-private:
-	StdCWadFile _file;
-	int _width, _height;
+class CTargaDecode : public Image::TGADecoder {
 public:
-	CTargaDecode(const CString &name);
-
 	/**
-	* Return the width of the JPEG
+	* Decode the image file onto the passed surface
 	*/
-	int getWidth() const { return _width; }
-
-	/**
-	* Return the height of the JPEG
-	*/
-	int getHeight() const { return _height; }
-
-	/**
-	 * Decode the image onto the passed surface
-	 */
-	void decode(OSVideoSurface &surface);
-
+	void decode(OSVideoSurface &surface, const CString &name);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
index b779fd0..815896f 100644
--- a/engines/titanic/simple_file.h
+++ b/engines/titanic/simple_file.h
@@ -224,6 +224,11 @@ public:
 	 * Open up the specified file
 	 */
 	void open(const CString &name);
+
+	/**
+	 * Return a reference to the read stream
+	 */
+	Common::SeekableReadStream *readStream() const { return _inStream; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 8406800..fdb9224 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -29,7 +29,7 @@ namespace Titanic {
 int CVideoSurface::_videoSurfaceCounter = 0;
 
 CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
-		_screenManager(screenManager), _pixels(nullptr),
+		_screenManager(screenManager), _rawSurface(nullptr),
 		_field34(nullptr), _pendingLoad(false), _field3C(0), _field40(0),
 		_field44(4), _field48(0), _field50(1) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
@@ -75,13 +75,21 @@ void OSVideoSurface::loadResource(const CResourceKey &key) {
 }
 
 void OSVideoSurface::loadTarga(const CResourceKey &key) {
-	warning("TODO");
+	// Decode the image
+	CTargaDecode decoder;
+	decoder.decode(*this, key.getString());
+
+	if (proc26() == 2)
+		shiftColors();
+
+	_resourceKey = key;
+
 }
 
 void OSVideoSurface::loadJPEG(const CResourceKey &key) {
 	// Decode the image
-	CJPEGDecode decoder(key.getString());
-	decoder.decode(*this);
+	CJPEGDecode decoder;
+	decoder.decode(*this, key.getString());
 
 	if (proc26() == 2)
 		shiftColors();
@@ -98,14 +106,14 @@ bool OSVideoSurface::lock() {
 		return false;
 
 	++_lockCount;
-	_pixels = (uint16 *)_ddSurface->lock(nullptr, 0);
+	_rawSurface = _ddSurface->lock(nullptr, 0);
 	return true;
 }
 
 void OSVideoSurface::unlock() {
-	if (_pixels)
+	if (_rawSurface)
 		_ddSurface->unlock();
-	_pixels = nullptr;
+	_rawSurface = nullptr;
 	--_lockCount;
 }
 
@@ -181,7 +189,7 @@ void OSVideoSurface::shiftColors() {
 	int width = getWidth();
 	int height = getHeight();
 	int pitch = getPitch();
-	uint16 *pixels = _pixels;
+	uint16 *pixels = (uint16 *)_rawSurface->getPixels();
 	uint16 *p;
 	int x, y;
 
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 838529f..412b50f 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -33,15 +33,19 @@
 namespace Titanic {
 
 class CScreenManager;
+class CJPEGDecode;
+class CTargaDecode;
 
 class CVideoSurface : public ListItem {
+	friend class CJPEGDecode;
+	friend class CTargaDecode;
 protected:
 	static int _videoSurfaceCounter;
 protected:
 	CScreenManager *_screenManager;
 	CResourceKey _resourceKey;
 	DirectDrawSurface *_ddSurface;
-	uint16 *_pixels;
+	Graphics::Surface *_rawSurface;
 	void *_field34;
 	bool _pendingLoad;
 	int _field3C;


Commit: e80a15170640a495b5c7861abeea71d0325684cd
    https://github.com/scummvm/scummvm/commit/e80a15170640a495b5c7861abeea71d0325684cd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-17T19:13:05-04:00

Commit Message:
TITANIC: Fix image decoders

Changed paths:
    engines/titanic/direct_draw.cpp
    engines/titanic/game_view.cpp
    engines/titanic/image_decoders.cpp
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/direct_draw.cpp b/engines/titanic/direct_draw.cpp
index d5a8cf2..551be5b 100644
--- a/engines/titanic/direct_draw.cpp
+++ b/engines/titanic/direct_draw.cpp
@@ -48,7 +48,9 @@ void DirectDraw::diagnostics() {
 
 DirectDrawSurface *DirectDraw::createSurfaceFromDesc(const DDSurfaceDesc &desc) {
 	DirectDrawSurface *surface = new DirectDrawSurface();
-	surface->create(desc._w, desc._h, Graphics::PixelFormat::createFormatCLUT8());
+
+	Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
+	surface->create(desc._w, desc._h, pixelFormat);
 
 	return surface;
 }
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index 315b2a8..bf901bb 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -54,6 +54,7 @@ void CGameView::createSurface(const CResourceKey &key) {
 	// Create a fresh surface
 	CScreenManager::setCurrent();
 	_surface = CScreenManager::_currentScreenManagerPtr->createSurface(key);
+	_surface->_field3C = true;
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/titanic/image_decoders.cpp b/engines/titanic/image_decoders.cpp
index e6e547f..721342e 100644
--- a/engines/titanic/image_decoders.cpp
+++ b/engines/titanic/image_decoders.cpp
@@ -34,7 +34,8 @@ void CJPEGDecode::decode(OSVideoSurface &surface, const CString &name) {
 	const Graphics::Surface *srcSurf = getSurface();
 	
 	// Resize the surface if necessary
-	if (surface.getWidth() != srcSurf->w || surface.getHeight() != srcSurf->h)
+	if (!surface.hasSurface() || surface.getWidth() != srcSurf->w 
+			|| surface.getHeight() != srcSurf->h)
 		surface.resize(srcSurf->w, srcSurf->h);
 
 	// Convert the decoded surface to the correct pixel format, and then copy it over
@@ -60,7 +61,8 @@ void CTargaDecode::decode(OSVideoSurface &surface, const CString &name) {
 	const Graphics::Surface *srcSurf = getSurface();
 
 	// Resize the surface if necessary
-	if (surface.getWidth() != srcSurf->w || surface.getHeight() != srcSurf->h)
+	if (!surface.hasSurface() || surface.getWidth() != srcSurf->w
+			|| surface.getHeight() != srcSurf->h)
 		surface.resize(srcSurf->w, srcSurf->h);
 
 	// Convert the decoded surface to the correct pixel format, and then copy it over
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index fdb9224..08ba64a 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -30,7 +30,7 @@ int CVideoSurface::_videoSurfaceCounter = 0;
 
 CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
 		_screenManager(screenManager), _rawSurface(nullptr),
-		_field34(nullptr), _pendingLoad(false), _field3C(0), _field40(0),
+		_field34(nullptr), _pendingLoad(false), _field3C(false), _field40(0),
 		_field44(4), _field48(0), _field50(1) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
 }
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 412b50f..47caffd 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -48,7 +48,6 @@ protected:
 	Graphics::Surface *_rawSurface;
 	void *_field34;
 	bool _pendingLoad;
-	int _field3C;
 	int _field40;
 	int _field44;
 	int _field48;
@@ -56,6 +55,8 @@ protected:
 	int _field50;
 	int _lockCount;
 public:
+	bool _field3C;
+public:
 	CVideoSurface(CScreenManager *screenManager);
 	virtual ~CVideoSurface();
 


Commit: a8d94d448ea977bdd5b1171e177de6dd714792a2
    https://github.com/scummvm/scummvm/commit/a8d94d448ea977bdd5b1171e177de6dd714792a2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-17T19:58:59-04:00

Commit Message:
TITANIC: Fixes to make message handling const, adding CEnterRoomMsg handlers

Changed paths:
    engines/titanic/game/bar_bell.cpp
    engines/titanic/game/bar_bell.h
    engines/titanic/game/bomb.cpp
    engines/titanic/game/bomb.h
    engines/titanic/game/chicken_cooler.cpp
    engines/titanic/game/chicken_cooler.h
    engines/titanic/game/end_sequence_control.cpp
    engines/titanic/game/end_sequence_control.h
    engines/titanic/game/fan_noises.cpp
    engines/titanic/game/fan_noises.h
    engines/titanic/game/get_lift_eye2.cpp
    engines/titanic/game/get_lift_eye2.h
    engines/titanic/game/gondolier/gondolier_mixer.cpp
    engines/titanic/game/gondolier/gondolier_mixer.h
    engines/titanic/messages/bilge_dispensor_event.cpp
    engines/titanic/messages/bilge_dispensor_event.h
    engines/titanic/messages/messages.cpp
    engines/titanic/messages/messages.h
    engines/titanic/messages/mouse_messages.h
    engines/titanic/moves/enter_bridge.cpp
    engines/titanic/moves/enter_bridge.h
    engines/titanic/npcs/barbot.cpp
    engines/titanic/npcs/barbot.h
    engines/titanic/sound/auto_music_player.cpp
    engines/titanic/sound/auto_music_player.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/game/bar_bell.cpp b/engines/titanic/game/bar_bell.cpp
index 71f0e87..1639b7d 100644
--- a/engines/titanic/game/bar_bell.cpp
+++ b/engines/titanic/game/bar_bell.cpp
@@ -50,4 +50,9 @@ void CBarBell::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CBarBell::handleEvent(const CEnterRoomMsg &msg) {
+	_fieldBC = 0;
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/bar_bell.h b/engines/titanic/game/bar_bell.h
index 279379f..432bf3a 100644
--- a/engines/titanic/game/bar_bell.h
+++ b/engines/titanic/game/bar_bell.h
@@ -24,16 +24,19 @@
 #define TITANIC_BAR_BELL_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CBarBell : public CGameObject {
+class CBarBell : public CGameObject, CEnterRoomMsgTarget {
 public:
 	int _fieldBC;
 	int _fieldC0;
 	int _fieldC4;
 	int _fieldC8;
 	int _fieldCC;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CBarBell();
diff --git a/engines/titanic/game/bomb.cpp b/engines/titanic/game/bomb.cpp
index 108376e..429f254 100644
--- a/engines/titanic/game/bomb.cpp
+++ b/engines/titanic/game/bomb.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/game/bomb.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -33,7 +34,7 @@ CBomb::CBomb() : CBackground() {
 	_fieldF4 = 999;
 	_fieldF8 = 0;
 	_fieldFC = 0;
-	_field100 = 0;
+	_startingTicks = 0;
 	_field104 = 60;
 }
 
@@ -47,7 +48,7 @@ void CBomb::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_fieldF4, indent);
 	file->writeNumberLine(_fieldF8, indent);
 	file->writeNumberLine(_fieldFC, indent);
-	file->writeNumberLine(_field100, indent);
+	file->writeNumberLine(_startingTicks, indent);
 	file->writeNumberLine(_field104, indent);
 
 	CBackground::save(file, indent);
@@ -63,10 +64,18 @@ void CBomb::load(SimpleFile *file) {
 	_fieldF4 = file->readNumber();
 	_fieldF8 = file->readNumber();
 	_fieldFC = file->readNumber();
-	_field100 = file->readNumber();
+	_startingTicks = file->readNumber();
 	_field104 = file->readNumber();
 
 	CBackground::load(file);
 }
 
+bool CBomb::handleEvent(const CEnterRoomMsg &msg) {
+	_fieldE8 = 12;
+	_fieldEC = 9;
+	_fieldF0 = 0;
+	_startingTicks = g_vm->_ticksCount;
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/bomb.h b/engines/titanic/game/bomb.h
index 2e7ba46..4c7c952 100644
--- a/engines/titanic/game/bomb.h
+++ b/engines/titanic/game/bomb.h
@@ -24,11 +24,12 @@
 #define TITANIC_BOMB_H
 
 #include "titanic/core/background.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CBomb : public CBackground {
-public:
+class CBomb : public CBackground, CEnterRoomMsgTarget {
+private:
 	int _fieldE0;
 	int _fieldE4;
 	int _fieldE8;
@@ -37,8 +38,10 @@ public:
 	int _fieldF4;
 	int _fieldF8;
 	int _fieldFC;
-	int _field100;
+	int _startingTicks;
 	int _field104;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CBomb();
diff --git a/engines/titanic/game/chicken_cooler.cpp b/engines/titanic/game/chicken_cooler.cpp
index 335ed36..54acc40 100644
--- a/engines/titanic/game/chicken_cooler.cpp
+++ b/engines/titanic/game/chicken_cooler.cpp
@@ -40,4 +40,9 @@ void CChickenCooler::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CChickenCooler::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CChickenCoolor::handlEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/chicken_cooler.h b/engines/titanic/game/chicken_cooler.h
index 9e15057..6f75649 100644
--- a/engines/titanic/game/chicken_cooler.h
+++ b/engines/titanic/game/chicken_cooler.h
@@ -24,13 +24,16 @@
 #define TITANIC_CHICKEN_COOLER_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CChickenCooler : public CGameObject {
-public:
+class CChickenCooler : public CGameObject, CEnterRoomMsgTarget {
+private:
 	int _fieldBC;
 	int _fieldC0;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CChickenCooler() : CGameObject(), _fieldBC(0), _fieldC0(0) {}
diff --git a/engines/titanic/game/end_sequence_control.cpp b/engines/titanic/game/end_sequence_control.cpp
index 1432435..f930d61 100644
--- a/engines/titanic/game/end_sequence_control.cpp
+++ b/engines/titanic/game/end_sequence_control.cpp
@@ -34,4 +34,9 @@ void CEndSequenceControl::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CEndSequenceControl::handleEvent(const CEnterRoomMsg &msg) {
+	warning("TODO: CEndSequenceControl::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/end_sequence_control.h b/engines/titanic/game/end_sequence_control.h
index 5e2ba30..fb1fa3a 100644
--- a/engines/titanic/game/end_sequence_control.h
+++ b/engines/titanic/game/end_sequence_control.h
@@ -24,10 +24,13 @@
 #define TITANIC_END_SEQUENCE_CONTROL_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CEndSequenceControl : public CGameObject {
+class CEndSequenceControl : public CGameObject, CEnterRoomMsgTarget {
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/fan_noises.cpp b/engines/titanic/game/fan_noises.cpp
index ed77dc6..6627332 100644
--- a/engines/titanic/game/fan_noises.cpp
+++ b/engines/titanic/game/fan_noises.cpp
@@ -55,4 +55,9 @@ void CFanNoises::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CFanNoises::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CFanNoises::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/fan_noises.h b/engines/titanic/game/fan_noises.h
index ba35edc..2cd96a3 100644
--- a/engines/titanic/game/fan_noises.h
+++ b/engines/titanic/game/fan_noises.h
@@ -24,11 +24,12 @@
 #define TITANIC_FAN_NOISES_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CFanNoises : public CGameObject {
-public:
+class CFanNoises : public CGameObject, CEnterRoomMsgTarget {
+private:
 	int _fieldBC;
 	int _fieldC0;
 	int _fieldC4;
@@ -36,6 +37,8 @@ public:
 	int _fieldCC;
 	int _fieldD0;
 	int _fieldD4;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CFanNoises();
diff --git a/engines/titanic/game/get_lift_eye2.cpp b/engines/titanic/game/get_lift_eye2.cpp
index 472f884..bc51f7c 100644
--- a/engines/titanic/game/get_lift_eye2.cpp
+++ b/engines/titanic/game/get_lift_eye2.cpp
@@ -46,4 +46,9 @@ void CGetLiftEye2::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CGetLiftEye2::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CGetLiftEye2::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
index 6782a56..d9465b4 100644
--- a/engines/titanic/game/get_lift_eye2.h
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -24,12 +24,14 @@
 #define TITANIC_GET_LIFT_EYE2_H
 
 #include "titanic/core/game_object.h"
-
+#include "titanic/messages/messages.h"
 namespace Titanic {
 
-class CGetLiftEye2 : public CGameObject {
+class CGetLiftEye2 : public CGameObject, CEnterRoomMsgTarget {
 private:
 	static CString *_v1;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	static void init();
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.cpp b/engines/titanic/game/gondolier/gondolier_mixer.cpp
index e81ad34..391c513 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.cpp
+++ b/engines/titanic/game/gondolier/gondolier_mixer.cpp
@@ -56,4 +56,12 @@ void CGondolierMixer::load(SimpleFile *file) {
 	CGondolierBase::load(file);
 }
 
+bool CGondolierMixer::handleEvent(const CEnterRoomMsg &msg) {
+	CTreeItem *parent = getParent();
+	if (parent == msg._room)
+		msg.execute(parent);
+	
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.h b/engines/titanic/game/gondolier/gondolier_mixer.h
index 173bcd8..ce8959b 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.h
+++ b/engines/titanic/game/gondolier/gondolier_mixer.h
@@ -24,10 +24,11 @@
 #define TITANIC_GONDOLIER_MIXER_H
 
 #include "titanic/game/gondolier/gondolier_base.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CGondolierMixer : public CGondolierBase {
+class CGondolierMixer : public CGondolierBase, CEnterRoomMsgTarget {
 private:
 	int _fieldBC;
 	int _fieldC0;
@@ -36,6 +37,8 @@ private:
 	CString _string1;
 	CString _string2;
 	int _fieldE4;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CGondolierMixer();
diff --git a/engines/titanic/messages/bilge_dispensor_event.cpp b/engines/titanic/messages/bilge_dispensor_event.cpp
index 9252d12..c4c8375 100644
--- a/engines/titanic/messages/bilge_dispensor_event.cpp
+++ b/engines/titanic/messages/bilge_dispensor_event.cpp
@@ -34,4 +34,9 @@ void CBilgeDispensorEvent::load(SimpleFile *file) {
 	CAutoSoundEvent::load(file);
 }
 
+bool CBilgeDispensorEvent::handleEvent(const CEnterRoomMsg &msg) {
+	_value1 = 0;
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/messages/bilge_dispensor_event.h b/engines/titanic/messages/bilge_dispensor_event.h
index fb88a6b..4334465 100644
--- a/engines/titanic/messages/bilge_dispensor_event.h
+++ b/engines/titanic/messages/bilge_dispensor_event.h
@@ -24,10 +24,13 @@
 #define TITANIC_BILGE_DISPENSOR_EVENT_H
 
 #include "titanic/messages/auto_sound_event.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
 class CBilgeDispensorEvent : public CAutoSoundEvent {
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
index 1e49994..00debc5 100644
--- a/engines/titanic/messages/messages.cpp
+++ b/engines/titanic/messages/messages.cpp
@@ -38,7 +38,7 @@ void CMessage::load(SimpleFile *file) {
 	CSaveableObject::load(file);
 }
 
-bool CMessage::execute(CTreeItem *target, const ClassDef *classDef, int flags) {
+bool CMessage::execute(CTreeItem *target, const ClassDef *classDef, int flags) const {
 	// If no target was specified, then there's nothing to do
 	if (!target)
 		return false;
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 5331881..9582758 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -46,9 +46,9 @@ public:
 	CMessage();
 
 	bool execute(CTreeItem *target, const ClassDef *classDef = nullptr,
-		int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED);
+		int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED) const;
 
-	virtual bool perform(CTreeItem *treeItem) { return false; }
+	virtual bool perform(CTreeItem *treeItem) const { return false; }
 
 	/**
 	 * Save the data for the class to file
@@ -64,7 +64,7 @@ public:
 MSGTARGET(CEditControlMsg);
 class CEditControlMsg : public CMessage {
 protected:
-	virtual bool handleMessage(CEditControlMsg &msg) { return false; }
+	virtual bool handleMessage(const CEditControlMsg &msg) { return false; }
 public:
 	int _field4;
 	int _field8;
@@ -77,7 +77,7 @@ public:
 	CEditControlMsg() : _field4(0), _field8(0), _field18(0),
 		_field1C(0), _field20(0) {}
 
-	virtual bool perform(CTreeItem *treeItem) { 
+	virtual bool perform(CTreeItem *treeItem) const { 
 		CEditControlMsg *dest = dynamic_cast<CEditControlMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
@@ -86,7 +86,7 @@ public:
 MSGTARGET(CLightsMsg);
 class CLightsMsg : public CMessage {
 protected:
-	virtual bool handleMessage(CLightsMsg &msg) { return false; }
+	virtual bool handleMessage(const CLightsMsg &msg) { return false; }
 public:
 	int _field4;
 	int _field8;
@@ -97,7 +97,7 @@ public:
 	CLightsMsg() : CMessage(), _field4(0), _field8(0),
 		_fieldC(0), _field10(0) {}
 
-	virtual bool perform(CTreeItem *treeItem) {
+	virtual bool perform(CTreeItem *treeItem) const {
 		CLightsMsg *dest = dynamic_cast<CLightsMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
@@ -106,7 +106,7 @@ public:
 MSGTARGET(CIsHookedOnMsg);
 class CIsHookedOnMsg : public CMessage {
 protected:
-	virtual bool handleMessage(CIsHookedOnMsg &msg) { return false; }
+	virtual bool handleMessage(const CIsHookedOnMsg &msg) { return false; }
 public:
 	int _field4;
 	int _field8;
@@ -119,7 +119,7 @@ public:
 	CIsHookedOnMsg() : CMessage(), _field4(0), _field8(0),
 		_field18(0), _field1C(0), _field20(0) {}
 
-	virtual bool perform(CTreeItem *treeItem) {
+	virtual bool perform(CTreeItem *treeItem) const {
 		CIsHookedOnMsg *dest = dynamic_cast<CIsHookedOnMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
@@ -128,7 +128,7 @@ public:
 MSGTARGET(CSubAcceptCCarryMsg);
 class CSubAcceptCCarryMsg : public CMessage {
 protected:
-	virtual bool handleMessage(CSubAcceptCCarryMsg &msg) { return false; }
+	virtual bool handleMessage(const CSubAcceptCCarryMsg &msg) { return false; }
 public:
 	CString _string1;
 	int _value1, _value2, _value3;
@@ -136,7 +136,7 @@ public:
 	CLASSDEF
 	CSubAcceptCCarryMsg() : _value1(0), _value2(0), _value3(0) {}
 
-	virtual bool perform(CTreeItem *treeItem) {
+	virtual bool perform(CTreeItem *treeItem) const {
 		CSubAcceptCCarryMsg *dest = dynamic_cast<CSubAcceptCCarryMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
@@ -145,7 +145,7 @@ public:
 MSGTARGET(CTransportMsg);
 class CTransportMsg : public CMessage {
 protected:
-	virtual bool handleMessage(CTransportMsg &msg) { return false; }
+	virtual bool handleMessage(const CTransportMsg &msg) { return false; }
 public:
 	CString _string;
 	int _value1, _value2;
@@ -153,7 +153,7 @@ public:
 	CLASSDEF
 	CTransportMsg() : _value1(0), _value2(0) {}
 
-	virtual bool perform(CTreeItem *treeItem) {
+	virtual bool perform(CTreeItem *treeItem) const {
 		CTransportMsg *dest = dynamic_cast<CTransportMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
@@ -163,18 +163,18 @@ public:
 	class NAME: public CMessage { \
 	public: NAME() : CMessage() {} \
 	CLASSDEF \
-	virtual bool handleMessage(NAME &msg) { return false; } \
-	virtual bool perform(CTreeItem *treeItem) { \
+	virtual bool handleMessage(const NAME &msg) { return false; } \
+	virtual bool perform(CTreeItem *treeItem) const { \
 		NAME *dest = dynamic_cast<NAME *>(treeItem); \
 		return dest != nullptr && dest->handleMessage(*this); \
 	} }
 #define MESSAGE1(NAME, F1, N1, V1) MSGTARGET(NAME); \
 	class NAME: public CMessage { \
-	public: F1 _N1; \
-	NAME() : CMessage(), _N1(V1) {} \
-	NAME(F1 N1) : CMessage(), _N1(N1) {} \
+	public: F1 _##N1; \
+	NAME() : CMessage(), _##N1(V1) {} \
+	NAME(F1 N1) : CMessage(), _##N1(N1) {} \
 	CLASSDEF \
-	virtual bool handleMessage(NAME &msg) { return false; } \
+	virtual bool handleMessage(const NAME &msg) { return false; } \
 	virtual bool perform(CTreeItem *treeItem) { \
 		NAME *dest = dynamic_cast<NAME *>(treeItem); \
 		return dest != nullptr && dest->handleMessage(*this); \
@@ -185,7 +185,7 @@ public:
 	NAME() : CMessage(), _N1(V1), _N2(V2) {} \
 	NAME(F1 N1, F2 N2) : CMessage(), _N1(N1), _N2(N2) {} \
 	CLASSDEF \
-	virtual bool handleMessage(NAME &msg) { return false; } \
+	virtual bool handleMessage(const NAME &msg) { return false; } \
 	virtual bool perform(CTreeItem *treeItem) { \
 		NAME *dest = dynamic_cast<NAME *>(treeItem); \
 		return dest != nullptr && dest->handleMessage(*this); \
@@ -196,7 +196,7 @@ public:
 	NAME() : CMessage(), _N1(V1), _N2(V2), _N3(V3) {} \
 	NAME(F1 N1, F2 N2, F3 N3) : CMessage(), _N1(N1), _N2(N2), _N3(N3) {} \
 	CLASSDEF \
-	virtual bool handleMessage(NAME &msg) { return false; } \
+	virtual bool handleMessage(const NAME &msg) { return false; } \
 	virtual bool perform(CTreeItem *treeItem) { \
 		NAME *dest = dynamic_cast<NAME *>(treeItem); \
 		return dest != nullptr && dest->handleMessage(*this); \
@@ -207,7 +207,7 @@ public:
 	NAME() : CMessage(), _N1(V1), _N2(V2), _N3(V3), _N4(V4) {} \
 	NAME(F1 N1, F2 N2, F3 N3, F4 N4) : CMessage(), _N1(N1), _N2(N2), _N3(N3), _N4(N4) {} \
 	CLASSDEF \
-	virtual bool handleMessage(NAME &msg) { return false; } \
+	virtual bool handleMessage(const NAME &msg) { return false; } \
 	virtual bool perform(CTreeItem *treeItem) { \
 		NAME *dest = dynamic_cast<NAME *>(treeItem); \
 		return dest != nullptr && dest->handleMessage(*this); \
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 79c45af..0386eb6 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -41,7 +41,7 @@ class CMouseMoveMsg : public CMouseMsg {
 public:
 	CLASSDEF
 
-	virtual bool handleMessage(CMouseMoveMsg &msg) { return false; }
+	virtual bool handleMessage(const CMouseMoveMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
 		CMouseMoveMsg *dest = dynamic_cast<CMouseMoveMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
@@ -61,7 +61,7 @@ class CMouseButtonDownMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
 
-	virtual bool handleMessage(CMouseButtonDownMsg &msg) { return false; }
+	virtual bool handleMessage(const CMouseButtonDownMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) {
 		CMouseButtonDownMsg *dest = dynamic_cast<CMouseButtonDownMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
@@ -73,7 +73,7 @@ class CMouseButtonUpMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
 
-	virtual bool handleMessage(CMouseButtonUpMsg &msg) { return false; }
+	virtual bool handleMessage(const CMouseButtonUpMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
 		CMouseButtonUpMsg *dest = dynamic_cast<CMouseButtonUpMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
@@ -85,7 +85,7 @@ class CMouseButtonDoubleClickMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
 
-	virtual bool handleMessage(CMouseButtonDoubleClickMsg &msg) { return false; }
+	virtual bool handleMessage(const CMouseButtonDoubleClickMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
 		CMouseButtonDoubleClickMsg *dest = dynamic_cast<CMouseButtonDoubleClickMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
@@ -101,7 +101,7 @@ class CMouseDragMoveMsg : public CMouseDragMsg {
 public:
 	CLASSDEF
 
-	virtual bool handleMessage(CMouseDragMoveMsg &msg) { return false; }
+	virtual bool handleMessage(const CMouseDragMoveMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
 		CMouseDragMoveMsg *dest = dynamic_cast<CMouseDragMoveMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
@@ -117,7 +117,7 @@ public:
 	CLASSDEF
 	CMouseDragStartMsg() : CMouseDragMsg(), _field10(0), _field14(0) {}
 
-	virtual bool handleMessage(CMouseDragStartMsg &msg) { return false; }
+	virtual bool handleMessage(const CMouseDragStartMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
 		CMouseDragStartMsg *dest = dynamic_cast<CMouseDragStartMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
@@ -132,7 +132,7 @@ public:
 	CLASSDEF
 	CMouseDragEndMsg() : CMouseDragMsg(), _field10(0) {}
 
-	virtual bool handleMessage(CMouseDragEndMsg &msg) { return false; }
+	virtual bool handleMessage(const CMouseDragEndMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) {
 		CMouseDragEndMsg *dest = dynamic_cast<CMouseDragEndMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
diff --git a/engines/titanic/moves/enter_bridge.cpp b/engines/titanic/moves/enter_bridge.cpp
index a1e0b7e..6f8ba4c 100644
--- a/engines/titanic/moves/enter_bridge.cpp
+++ b/engines/titanic/moves/enter_bridge.cpp
@@ -36,4 +36,9 @@ void CEnterBridge::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CEnterBridge::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CEnterBridge::handlEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/moves/enter_bridge.h b/engines/titanic/moves/enter_bridge.h
index 6a6e716..3685bed 100644
--- a/engines/titanic/moves/enter_bridge.h
+++ b/engines/titanic/moves/enter_bridge.h
@@ -24,12 +24,15 @@
 #define TITANIC_ENTER_BRIDGE_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CEnterBridge : public CGameObject {
-public:
+class CEnterBridge : public CGameObject, CEnterRoomMsgTarget {
+private:
 	int _value;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CEnterBridge() : CGameObject(), _value(1) {}
diff --git a/engines/titanic/npcs/barbot.cpp b/engines/titanic/npcs/barbot.cpp
index a460bdb..c9a96b9 100644
--- a/engines/titanic/npcs/barbot.cpp
+++ b/engines/titanic/npcs/barbot.cpp
@@ -233,4 +233,9 @@ void CBarbot::load(SimpleFile *file) {
 	CTrueTalkNPC::load(file);
 }
 
+bool CBarbot::handleEvent(const CEnterRoomMsg &msg) {
+	warning("TODO: Barbot::CEnterRoomMsg");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h
index 7e2d323..160edd6 100644
--- a/engines/titanic/npcs/barbot.h
+++ b/engines/titanic/npcs/barbot.h
@@ -24,10 +24,11 @@
 #define TITANIC_BARBOT_H
 
 #include "titanic/npcs/true_talk_npc.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CBarbot : public CTrueTalkNPC {
+class CBarbot : public CTrueTalkNPC, CEnterRoomMsgTarget {
 private:
 	static int _v0;
 private:
@@ -172,6 +173,8 @@ private:
 	int _field338;
 	int _field33C;
 	int _field340;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CBarbot();
diff --git a/engines/titanic/sound/auto_music_player.cpp b/engines/titanic/sound/auto_music_player.cpp
index 2040bfc..97c59d0 100644
--- a/engines/titanic/sound/auto_music_player.cpp
+++ b/engines/titanic/sound/auto_music_player.cpp
@@ -41,4 +41,12 @@ void CAutoMusicPlayer::load(SimpleFile *file) {
 	CAutoMusicPlayerBase::load(file);
 }
 
+bool CAutoMusicPlayer::handleEvent(const CEnterRoomMsg &msg) {
+	if (!_fieldCC) {
+		warning("TODO");
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/auto_music_player.h b/engines/titanic/sound/auto_music_player.h
index cec8117..6fdf376 100644
--- a/engines/titanic/sound/auto_music_player.h
+++ b/engines/titanic/sound/auto_music_player.h
@@ -24,12 +24,15 @@
 #define TITANIC_AUTO_MUSIC_PLAYER_H
 
 #include "titanic/sound/auto_music_player_base.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CAutoMusicPlayer : public CAutoMusicPlayerBase {
+class CAutoMusicPlayer : public CAutoMusicPlayerBase, CEnterRoomMsgTarget {
 private:
 	CString _string2;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CAutoMusicPlayer();
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index a9d0cc9..e7bbd84 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -44,7 +44,8 @@ namespace Titanic {
 TitanicEngine *g_vm;
 
 TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc)
-		: _gameDescription(gameDesc), Engine(syst) {
+		: _gameDescription(gameDesc), Engine(syst), _randomSource("Titanic"),
+		_ticksCount(0), _frameCounter(0) {
 	g_vm = this;
 	_window = nullptr;
 	_screenManager = nullptr;
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 112d6d6..c5c6426 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -24,6 +24,7 @@
 #define TITANIC_TITANIC_H
 
 #include "common/scummsys.h"
+#include "common/random.h"
 #include "common/system.h"
 #include "common/serializer.h"
 #include "engines/advancedDetector.h"
@@ -98,6 +99,9 @@ public:
 	CFilesManager _filesManager;
 	OSScreenManager *_screenManager;
 	CMainGameWindow *_window;
+	Common::RandomSource _randomSource;
+	uint _frameCounter;
+	uint _ticksCount;
 public:
 	TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
 	virtual ~TitanicEngine();


Commit: 12ae5e10f3a20b1b909a6ec40257e39e063b78c5
    https://github.com/scummvm/scummvm/commit/12ae5e10f3a20b1b909a6ec40257e39e063b78c5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-17T20:55:32-04:00

Commit Message:
TITANIC: Added stubbed CEnterRoomMsg event handlers as needed

Changed paths:
  A engines/titanic/sound/room_trigger_auto_music_player.cpp
  A engines/titanic/sound/room_trigger_auto_music_player.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/light.cpp
    engines/titanic/game/light.h
    engines/titanic/game/light_switch.cpp
    engines/titanic/game/light_switch.h
    engines/titanic/game/long_stick_dispenser.cpp
    engines/titanic/game/long_stick_dispenser.h
    engines/titanic/game/parrot/player_meets_parrot.cpp
    engines/titanic/game/parrot/player_meets_parrot.h
    engines/titanic/game/pet/pet_monitor.cpp
    engines/titanic/game/pet/pet_monitor.h
    engines/titanic/game/pet/pet_position.cpp
    engines/titanic/game/pet/pet_position.h
    engines/titanic/game/pet/pet_transport.cpp
    engines/titanic/game/pet/pet_transport.h
    engines/titanic/game/phonograph.cpp
    engines/titanic/game/phonograph.h
    engines/titanic/game/sgt/sgt_state_room.cpp
    engines/titanic/game/sgt/sgt_state_room.h
    engines/titanic/game/ship_setting.cpp
    engines/titanic/game/ship_setting.h
    engines/titanic/game/transport/lift.cpp
    engines/titanic/game/transport/lift.h
    engines/titanic/game/transport/lift_indicator.h
    engines/titanic/game/transport/pellerator.cpp
    engines/titanic/game/transport/pellerator.h
    engines/titanic/game/up_lighter.cpp
    engines/titanic/game/up_lighter.h
    engines/titanic/module.mk
    engines/titanic/npcs/liftbot.cpp
    engines/titanic/npcs/liftbot.h
    engines/titanic/sound/music_player.cpp
    engines/titanic/sound/music_player.h
    engines/titanic/sound/restricted_auto_music_player.cpp
    engines/titanic/sound/restricted_auto_music_player.h
    engines/titanic/sound/room_auto_sound_player.cpp
    engines/titanic/sound/room_auto_sound_player.h
    engines/titanic/sound/titania_speech.cpp
    engines/titanic/sound/titania_speech.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 3144e60..e833a05 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -396,6 +396,7 @@
 #include "titanic/sound/node_auto_sound_player.h"
 #include "titanic/sound/restricted_auto_music_player.h"
 #include "titanic/sound/room_auto_sound_player.h"
+#include "titanic/sound/room_trigger_auto_music_player.h"
 #include "titanic/sound/season_noises.h"
 #include "titanic/sound/seasonal_music_player.h"
 #include "titanic/sound/titania_speech.h"
@@ -979,6 +980,7 @@ DEFFN(CMusicPlayer)
 DEFFN(CNodeAutoSoundPlayer)
 DEFFN(CRestrictedAutoMusicPlayer)
 DEFFN(CRoomAutoSoundPlayer)
+DEFFN(CRoomTriggerAutoMusicPlayer);
 DEFFN(CSeasonNoises)
 DEFFN(CSeasonalMusicPlayer)
 DEFFN(CTitaniaSpeech)
@@ -1550,6 +1552,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CNodeAutoSoundPlayer, CAutoSoundPlayer);
 	ADDFN(CRestrictedAutoMusicPlayer, CAutoMusicPlayer);
 	ADDFN(CRoomAutoSoundPlayer, CAutoSoundPlayer);
+	ADDFN(CRoomTriggerAutoMusicPlayer, CTriggerAutoMusicPlayer);
 	ADDFN(CSeasonNoises, CViewAutoSoundPlayer);
 	ADDFN(CSeasonalMusicPlayer, CAutoMusicPlayerBase);
 	ADDFN(CAutoMusicPlayer, CAutoMusicPlayerBase);
diff --git a/engines/titanic/game/light.cpp b/engines/titanic/game/light.cpp
index 4f5a492..7a24391 100644
--- a/engines/titanic/game/light.cpp
+++ b/engines/titanic/game/light.cpp
@@ -57,4 +57,9 @@ void CLight::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
+bool CLight::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CLight::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/light.h b/engines/titanic/game/light.h
index ea6073d..650e6ba 100644
--- a/engines/titanic/game/light.h
+++ b/engines/titanic/game/light.h
@@ -24,10 +24,11 @@
 #define TITANIC_LIGHT_H
 
 #include "titanic/core/background.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CLight : public CBackground {
+class CLight : public CBackground, CEnterRoomMsgTarget {
 private:
 	int _fieldE0;
 	int _fieldE4;
@@ -37,6 +38,8 @@ private:
 	int _fieldF4;
 	int _fieldF8;
 	int _fieldFC;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLight();
diff --git a/engines/titanic/game/light_switch.cpp b/engines/titanic/game/light_switch.cpp
index 605fab3..5e1b94a 100644
--- a/engines/titanic/game/light_switch.cpp
+++ b/engines/titanic/game/light_switch.cpp
@@ -50,4 +50,9 @@ void CLightSwitch::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
+bool CLightSwitch::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CLightSwitch::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/light_switch.h b/engines/titanic/game/light_switch.h
index 334cba7..fd2c392 100644
--- a/engines/titanic/game/light_switch.h
+++ b/engines/titanic/game/light_switch.h
@@ -24,16 +24,19 @@
 #define TITANIC_LIGHT_SWITCH_H
 
 #include "titanic/core/background.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CLightSwitch : public CBackground {
+class CLightSwitch : public CBackground, CEnterRoomMsgTarget {
 public:
 	static int _v1;
 private:
 	int _fieldE0;
 	int _fieldE4;
 	int _fieldE8;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLightSwitch();
diff --git a/engines/titanic/game/long_stick_dispenser.cpp b/engines/titanic/game/long_stick_dispenser.cpp
index 97981cc..237c1f6 100644
--- a/engines/titanic/game/long_stick_dispenser.cpp
+++ b/engines/titanic/game/long_stick_dispenser.cpp
@@ -42,4 +42,10 @@ void CLongStickDispenser::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CLongStickDispenser::handleEvent(const CEnterRoomMsg &msg) {
+	_fieldC0 = 0;
+	_fieldC4 = 1;
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/long_stick_dispenser.h b/engines/titanic/game/long_stick_dispenser.h
index 30e3541..75ada29 100644
--- a/engines/titanic/game/long_stick_dispenser.h
+++ b/engines/titanic/game/long_stick_dispenser.h
@@ -24,14 +24,17 @@
 #define TITANIC_LONG_STICK_DISPENSER_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
 class CLongStickDispenser : public CGameObject {
-public:
+private:
 	int _fieldBC;
 	int _fieldC0;
 	int _fieldC4;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLongStickDispenser() : CGameObject(), _fieldBC(0),
diff --git a/engines/titanic/game/parrot/player_meets_parrot.cpp b/engines/titanic/game/parrot/player_meets_parrot.cpp
index 1d7bd65..70628b3 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.cpp
+++ b/engines/titanic/game/parrot/player_meets_parrot.cpp
@@ -34,4 +34,9 @@ void CPlayerMeetsParrot::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CPlayerMeetsParrot::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CPlayerMeetsParrot::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/parrot/player_meets_parrot.h b/engines/titanic/game/parrot/player_meets_parrot.h
index d0c3b9d..8572fd7 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.h
+++ b/engines/titanic/game/parrot/player_meets_parrot.h
@@ -24,10 +24,13 @@
 #define TITANIC_PLAYER_MEETS_PARROT_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CPlayerMeetsParrot : public CGameObject {
+class CPlayerMeetsParrot : public CGameObject, CEnterRoomMsgTarget {
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_monitor.cpp b/engines/titanic/game/pet/pet_monitor.cpp
index 534fb3f..649ac97 100644
--- a/engines/titanic/game/pet/pet_monitor.cpp
+++ b/engines/titanic/game/pet/pet_monitor.cpp
@@ -34,4 +34,9 @@ void CPETMonitor::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CPETMonitor::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CPETMonitor::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_monitor.h b/engines/titanic/game/pet/pet_monitor.h
index ff22098..97961ee 100644
--- a/engines/titanic/game/pet/pet_monitor.h
+++ b/engines/titanic/game/pet/pet_monitor.h
@@ -24,10 +24,13 @@
 #define TITANIC_PET_MONITOR_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CPETMonitor : public CGameObject {
+class CPETMonitor : public CGameObject, CEnterRoomMsgTarget {
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_position.cpp b/engines/titanic/game/pet/pet_position.cpp
index 80ccec7..aafc21b 100644
--- a/engines/titanic/game/pet/pet_position.cpp
+++ b/engines/titanic/game/pet/pet_position.cpp
@@ -34,4 +34,9 @@ void CPETPosition::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CPETPosition::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CPETPosition::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_position.h b/engines/titanic/game/pet/pet_position.h
index 407a42f..d72f42c 100644
--- a/engines/titanic/game/pet/pet_position.h
+++ b/engines/titanic/game/pet/pet_position.h
@@ -24,10 +24,13 @@
 #define TITANIC_PET_POSITION_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CPETPosition : public CGameObject {
+class CPETPosition : public CGameObject, CEnterRoomMsgTarget {
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_transport.cpp b/engines/titanic/game/pet/pet_transport.cpp
index 037e0b3..40cc155 100644
--- a/engines/titanic/game/pet/pet_transport.cpp
+++ b/engines/titanic/game/pet/pet_transport.cpp
@@ -34,4 +34,9 @@ void CPETTransport::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CPETTransport::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CPETTransport::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_transport.h b/engines/titanic/game/pet/pet_transport.h
index 1aa6df8..1eb4832 100644
--- a/engines/titanic/game/pet/pet_transport.h
+++ b/engines/titanic/game/pet/pet_transport.h
@@ -24,10 +24,13 @@
 #define TITANIC_PET_TRANSPORT_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CPETTransport : public CGameObject {
+class CPETTransport : public CGameObject, CEnterRoomMsgTarget {
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp
index 3461e34..2ff8ca9 100644
--- a/engines/titanic/game/phonograph.cpp
+++ b/engines/titanic/game/phonograph.cpp
@@ -55,4 +55,9 @@ void CPhonograph::load(SimpleFile *file) {
 	CMusicPlayer::load(file);
 }
 
+bool CPhonograph::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CPhonograph::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/phonograph.h b/engines/titanic/game/phonograph.h
index 14712e5..3ba2d1c 100644
--- a/engines/titanic/game/phonograph.h
+++ b/engines/titanic/game/phonograph.h
@@ -24,10 +24,11 @@
 #define TITANIC_PHONOGRAPH_H
 
 #include "titanic/sound/music_player.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CPhonograph : public CMusicPlayer {
+class CPhonograph : public CMusicPlayer, CEnterRoomMsgTarget {
 protected:
 	CString _string2;
 	int _fieldE0;
@@ -36,6 +37,8 @@ protected:
 	int _fieldEC;
 	int _fieldF0;
 	int _fieldF4;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CPhonograph();
diff --git a/engines/titanic/game/sgt/sgt_state_room.cpp b/engines/titanic/game/sgt/sgt_state_room.cpp
index e0d8de1..a6dc523 100644
--- a/engines/titanic/game/sgt/sgt_state_room.cpp
+++ b/engines/titanic/game/sgt/sgt_state_room.cpp
@@ -90,4 +90,9 @@ void CSGTStateRoom::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
+bool CSGTStateRoom::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CSGTStateRoom::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/sgt/sgt_state_room.h b/engines/titanic/game/sgt/sgt_state_room.h
index dfac689..dbe4538 100644
--- a/engines/titanic/game/sgt/sgt_state_room.h
+++ b/engines/titanic/game/sgt/sgt_state_room.h
@@ -24,6 +24,7 @@
 #define TITANIC_SGT_STATE_ROOM_H
 
 #include "titanic/core/background.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
@@ -44,7 +45,7 @@ struct CSGTStateRoomStatics {
 	int _v14;
 };
 
-class CSGTStateRoom : public CBackground {
+class CSGTStateRoom : public CBackground, CEnterRoomMsgTarget {
 private:
 	static CSGTStateRoomStatics *_statics;
 private:
@@ -53,6 +54,8 @@ private:
 	int _fieldE8;
 	int _fieldEC;
 	int _fieldF0;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CSGTStateRoom();
diff --git a/engines/titanic/game/ship_setting.cpp b/engines/titanic/game/ship_setting.cpp
index d53c528..7a3951d 100644
--- a/engines/titanic/game/ship_setting.cpp
+++ b/engines/titanic/game/ship_setting.cpp
@@ -48,4 +48,9 @@ void CShipSetting::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
+bool CShipSetting::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CShipSetting::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/ship_setting.h b/engines/titanic/game/ship_setting.h
index a3b5d5f..30780fd 100644
--- a/engines/titanic/game/ship_setting.h
+++ b/engines/titanic/game/ship_setting.h
@@ -24,15 +24,18 @@
 #define TITANIC_SHIP_SETTING_H
 
 #include "titanic/core/background.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CShipSetting : public CBackground {
-public:
+class CShipSetting : public CBackground, CEnterRoomMsgTarget {
+private:
 	CString _string3;
 	Common::Point _pos1;
 	CString _string4;
 	CString _string5;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CShipSetting();
diff --git a/engines/titanic/game/transport/lift.cpp b/engines/titanic/game/transport/lift.cpp
index 1e21b9f..2220129 100644
--- a/engines/titanic/game/transport/lift.cpp
+++ b/engines/titanic/game/transport/lift.cpp
@@ -57,4 +57,9 @@ void CLift::load(SimpleFile *file) {
 	CTransport::load(file);
 }
 
+bool CLift::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CLift::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h
index b1cd489..42a340c 100644
--- a/engines/titanic/game/transport/lift.h
+++ b/engines/titanic/game/transport/lift.h
@@ -24,10 +24,11 @@
 #define TITANIC_LIFT_H
 
 #include "titanic/game/transport/transport.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CLift : public CTransport {
+class CLift : public CTransport, CEnterRoomMsgTarget {
 private:
 	static int _v1;
 	static int _v2;
@@ -37,6 +38,8 @@ private:
 	static int _v6;
 
 	int _fieldF8;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLift() : CTransport(), _fieldF8(1) {}
diff --git a/engines/titanic/game/transport/lift_indicator.h b/engines/titanic/game/transport/lift_indicator.h
index 2fe6e1a..de913c5 100644
--- a/engines/titanic/game/transport/lift_indicator.h
+++ b/engines/titanic/game/transport/lift_indicator.h
@@ -24,15 +24,18 @@
 #define TITANIC_LIFT_INDICATOR_H
 
 #include "titanic/game/transport/lift.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CLiftindicator : public CLift {
+class CLiftindicator : public CLift, CEnterRoomMsgTarget {
 private:
 	int _fieldFC;
 	Common::Point _pos2;
 	int _field108;
 	int _field10C;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg) { return true; }
 public:
 	CLASSDEF
 	CLiftindicator();
diff --git a/engines/titanic/game/transport/pellerator.cpp b/engines/titanic/game/transport/pellerator.cpp
index 400214a..99c4db3 100644
--- a/engines/titanic/game/transport/pellerator.cpp
+++ b/engines/titanic/game/transport/pellerator.cpp
@@ -43,4 +43,9 @@ void CPellerator::load(SimpleFile *file) {
 	CTransport::load(file);
 }
 
+bool CPellerator::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CPellerator::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/transport/pellerator.h b/engines/titanic/game/transport/pellerator.h
index e72cbb4..502af24 100644
--- a/engines/titanic/game/transport/pellerator.h
+++ b/engines/titanic/game/transport/pellerator.h
@@ -24,13 +24,16 @@
 #define TITANIC_PELLERATOR_H
 
 #include "titanic/game/transport/transport.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CPellerator : public CTransport {
+class CPellerator : public CTransport, CEnterRoomMsgTarget {
 private:
 	static int _v1;
 	static int _v2;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/up_lighter.cpp b/engines/titanic/game/up_lighter.cpp
index 0e6c4d8..beb159f 100644
--- a/engines/titanic/game/up_lighter.cpp
+++ b/engines/titanic/game/up_lighter.cpp
@@ -48,4 +48,9 @@ void CUpLighter::load(SimpleFile *file) {
 	CDropTarget::load(file);
 }
 
+bool CUpLighter::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CUpLighter::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/up_lighter.h b/engines/titanic/game/up_lighter.h
index e24e712..15fa14c 100644
--- a/engines/titanic/game/up_lighter.h
+++ b/engines/titanic/game/up_lighter.h
@@ -24,15 +24,18 @@
 #define TITANIC_UP_LIGHTER_H
 
 #include "titanic/core/drop_target.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CUpLighter : public CDropTarget {
+class CUpLighter : public CDropTarget, CEnterRoomMsgTarget {
 private:
 	int _field118;
 	int _field11C;
 	int _field120;
 	int _field124;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CUpLighter();
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index ec55392..23ac750 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -403,6 +403,7 @@ MODULE_OBJS := \
 	sound/node_auto_sound_player.o \
 	sound/restricted_auto_music_player.o \
 	sound/room_auto_sound_player.o \
+	sound/room_trigger_auto_music_player.o \
 	sound/season_noises.o \
 	sound/seasonal_music_player.o \
 	sound/sound.o \
diff --git a/engines/titanic/npcs/liftbot.cpp b/engines/titanic/npcs/liftbot.cpp
index 3a0040d..76a48f0 100644
--- a/engines/titanic/npcs/liftbot.cpp
+++ b/engines/titanic/npcs/liftbot.cpp
@@ -48,4 +48,9 @@ void CLiftBot::load(SimpleFile *file) {
 	CTrueTalkNPC::load(file);
 }
 
+bool CLiftBot::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CLiftBot::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/liftbot.h b/engines/titanic/npcs/liftbot.h
index 27556ed..81c5399 100644
--- a/engines/titanic/npcs/liftbot.h
+++ b/engines/titanic/npcs/liftbot.h
@@ -24,15 +24,18 @@
 #define TITANIC_LIFTBOT_H
 
 #include "titanic/npcs/true_talk_npc.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CLiftBot : public CTrueTalkNPC {
+class CLiftBot : public CTrueTalkNPC, CEnterRoomMsgTarget {
 private:
 	static int _v1;
 	static int _v2;
 private:
 	int _field108;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLiftBot();
diff --git a/engines/titanic/sound/music_player.cpp b/engines/titanic/sound/music_player.cpp
index 6bab2d9..e2299e6 100644
--- a/engines/titanic/sound/music_player.cpp
+++ b/engines/titanic/sound/music_player.cpp
@@ -44,4 +44,9 @@ void CMusicPlayer::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CMusicPlayer::handleEvent(const CEnterRoomMsg &msg) {
+	warning("TODO: CMusicPlayer::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/music_player.h b/engines/titanic/sound/music_player.h
index 0a750cc..1796a25 100644
--- a/engines/titanic/sound/music_player.h
+++ b/engines/titanic/sound/music_player.h
@@ -24,15 +24,18 @@
 #define TITANIC_MUSIC_PLAYER_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CMusicPlayer : public CGameObject {
-public:
+class CMusicPlayer : public CGameObject, CEnterRoomMsgTarget {
+protected:
 	int _fieldBC;
 	CString _string1;
 	int _fieldCC;
 	int _fieldD0;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CMusicPlayer() : CGameObject(),
diff --git a/engines/titanic/sound/restricted_auto_music_player.cpp b/engines/titanic/sound/restricted_auto_music_player.cpp
index 442dc90..a57769b 100644
--- a/engines/titanic/sound/restricted_auto_music_player.cpp
+++ b/engines/titanic/sound/restricted_auto_music_player.cpp
@@ -44,4 +44,9 @@ void CRestrictedAutoMusicPlayer::load(SimpleFile *file) {
 	CAutoMusicPlayer::load(file);
 }
 
+bool CRestrictedAutoMusicPlayer::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CRestrictedAutoMusicPlayer::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/restricted_auto_music_player.h b/engines/titanic/sound/restricted_auto_music_player.h
index cb6220c..60dcc68 100644
--- a/engines/titanic/sound/restricted_auto_music_player.h
+++ b/engines/titanic/sound/restricted_auto_music_player.h
@@ -24,15 +24,18 @@
 #define TITANIC_RESTRICTED_AUTO_MUSIC_PLAYER_H
 
 #include "titanic/sound/auto_music_player.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CRestrictedAutoMusicPlayer : public CAutoMusicPlayer {
+class CRestrictedAutoMusicPlayer : public CAutoMusicPlayer, CEnterRoomMsgTarget {
 private:
 	CString _string3;
 	CString _string4;
 	CString _string5;
 	CString _string6;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/sound/room_auto_sound_player.cpp b/engines/titanic/sound/room_auto_sound_player.cpp
index 8c54726..b8557aa 100644
--- a/engines/titanic/sound/room_auto_sound_player.cpp
+++ b/engines/titanic/sound/room_auto_sound_player.cpp
@@ -34,4 +34,9 @@ void CRoomAutoSoundPlayer::load(SimpleFile *file) {
 	CAutoSoundPlayer::load(file);
 }
 
+bool CRoomAutoSoundPlayer::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CRoomAutoSoundPlayer::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/room_auto_sound_player.h b/engines/titanic/sound/room_auto_sound_player.h
index ebee016..bda9727 100644
--- a/engines/titanic/sound/room_auto_sound_player.h
+++ b/engines/titanic/sound/room_auto_sound_player.h
@@ -24,10 +24,13 @@
 #define TITANIC_ROOM_AUTO_SOUND_PLAYER_H
 
 #include "titanic/sound/auto_sound_player.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CRoomAutoSoundPlayer : public CAutoSoundPlayer {
+class CRoomAutoSoundPlayer : public CAutoSoundPlayer, CEnterRoomMsgTarget {
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/sound/room_trigger_auto_music_player.cpp b/engines/titanic/sound/room_trigger_auto_music_player.cpp
new file mode 100644
index 0000000..9e4da68
--- /dev/null
+++ b/engines/titanic/sound/room_trigger_auto_music_player.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/room_trigger_auto_music_player.h"
+
+namespace Titanic {
+
+void CRoomTriggerAutoMusicPlayer::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CTriggerAutoMusicPlayer::save(file, indent);
+}
+
+void CRoomTriggerAutoMusicPlayer::load(SimpleFile *file) {
+	file->readNumber();
+	CTriggerAutoMusicPlayer::load(file);
+}
+
+bool CRoomTriggerAutoMusicPlayer::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CRoomTriggerAutoMusicPlayer::handleEvent");
+	return true;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/sound/room_trigger_auto_music_player.h b/engines/titanic/sound/room_trigger_auto_music_player.h
new file mode 100644
index 0000000..1915f92
--- /dev/null
+++ b/engines/titanic/sound/room_trigger_auto_music_player.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ROOM_TRIGGER_AUTO_MUSIC_PLAYER_H
+#define TITANIC_ROOM_TRIGGER_AUTO_MUSIC_PLAYER_H
+
+#include "titanic/sound/trigger_auto_music_player.h"
+#include "titanic/messages/messages.h"
+
+namespace Titanic {
+
+class CRoomTriggerAutoMusicPlayer : public CTriggerAutoMusicPlayer, CEnterRoomMsgTarget {
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
+public:
+	CLASSDEF
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ROOM_TRIGGER_AUTO_MUSIC_PLAYER_H */
diff --git a/engines/titanic/sound/titania_speech.cpp b/engines/titanic/sound/titania_speech.cpp
index fac1669..87ab18a 100644
--- a/engines/titanic/sound/titania_speech.cpp
+++ b/engines/titanic/sound/titania_speech.cpp
@@ -40,4 +40,9 @@ void CTitaniaSpeech::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CTitaniaSpeech::handleEvent(const CEnterRoomMsg &msg) {
+	warning("CTitaniaSpeech::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/titania_speech.h b/engines/titanic/sound/titania_speech.h
index fc55c20..a981029 100644
--- a/engines/titanic/sound/titania_speech.h
+++ b/engines/titanic/sound/titania_speech.h
@@ -24,12 +24,15 @@
 #define TITANIC_TITANIA_SPEECH_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
 class CTitaniaSpeech : public CGameObject {
-public:
+private:
 	int _value1, _value2;
+protected:
+	virtual bool handleEvent(const CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CTitaniaSpeech() : CGameObject(), _value1(1), _value2(0) {}


Commit: 13a8e5f822a9a77c5bee1d7f60adfdb32decfb1d
    https://github.com/scummvm/scummvm/commit/13a8e5f822a9a77c5bee1d7f60adfdb32decfb1d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-17T22:29:16-04:00

Commit Message:
TITANIC: Implement debugger with dump and room commands

Changed paths:
  A engines/titanic/debugger.cpp
  A engines/titanic/debugger.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/module.mk
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index b476777..39c3fe1 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -238,7 +238,7 @@ CNamedItem *CTreeItem::findByName(const CString &name, int maxLen) {
 	CString nameLower = name;
 	nameLower.toLowercase();
 
-	for (CTreeItem *treeItem = this; treeItem; treeItem = scan(treeItem)) {
+	for (CTreeItem *treeItem = this; treeItem; treeItem = treeItem->scan(this)) {
 		CString nodeName = treeItem->getName();
 		nodeName.toLowercase();
 
@@ -246,7 +246,7 @@ CNamedItem *CTreeItem::findByName(const CString &name, int maxLen) {
 			if (nodeName.left(maxLen).compareTo(nameLower))
 				return dynamic_cast<CNamedItem *>(treeItem);
 		} else {
-			if (nodeName.compareTo(nameLower))
+			if (!nodeName.compareTo(nameLower))
 				return dynamic_cast<CNamedItem *>(treeItem);
 		}
 	}
diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp
new file mode 100644
index 0000000..b759b12
--- /dev/null
+++ b/engines/titanic/debugger.cpp
@@ -0,0 +1,175 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/debugger.h"
+#include "titanic/titanic.h"
+#include "titanic/core/tree_item.h"
+
+namespace Titanic {
+
+Debugger::Debugger(TitanicEngine *vm) : GUI::Debugger(), _vm(vm) {
+	registerCmd("continue",	     WRAP_METHOD(Debugger, cmdExit));
+	registerCmd("dump",         WRAP_METHOD(Debugger, cmdDump));
+	registerCmd("room",          WRAP_METHOD(Debugger, cmdRoom));
+}
+
+int Debugger::strToInt(const char *s) {
+	if (!*s)
+		// No string at all
+		return 0;
+	else if (toupper(s[strlen(s) - 1]) != 'H')
+		// Standard decimal string
+		return atoi(s);
+
+	// Hexadecimal string
+	uint tmp = 0;
+	int read = sscanf(s, "%xh", &tmp);
+	if (read < 1)
+		error("strToInt failed on string \"%s\"", s);
+	return (int)tmp;
+}
+
+CRoomItem *Debugger::findRoom(const char *name) {
+	CTreeItem *root = g_vm->_window->_gameManager->_project;
+	CRoomItem *roomItem = dynamic_cast<CRoomItem *>(root->findByName(name));
+	if (roomItem)
+		return roomItem;
+
+	int roomNumber = strToInt(name);
+	for (CTreeItem *treeItem = root; treeItem; treeItem = treeItem->scan(root)) {
+		roomItem = dynamic_cast<CRoomItem *>(treeItem);
+		if (roomItem && roomItem->_roomNumber == roomNumber)
+			return roomItem;
+	}
+
+	return nullptr;
+}
+
+CNodeItem *Debugger::findNode(CRoomItem *room, const char *name) {
+	CNodeItem *nodeItem = dynamic_cast<CNodeItem *>(room->findByName(name));
+	if (nodeItem)
+		return nodeItem;
+
+	int nodeNumber = strToInt(name);
+	nodeItem = dynamic_cast<CNodeItem *>(room->findChildInstanceOf(CNodeItem::_type));
+	while (nodeItem) {
+		if (nodeItem->_nodeNumber == nodeNumber)
+			return nodeItem;
+
+		nodeItem = dynamic_cast<CNodeItem *>(room->findNextInstanceOf(CNodeItem::_type, nodeItem));
+	}
+
+	return nullptr;
+}
+
+CViewItem *Debugger::findView(CNodeItem *node, const char *name) {
+	CViewItem *viewItem = dynamic_cast<CViewItem *>(node->findByName(name));
+	if (viewItem)
+		return viewItem;
+
+	int viewNumber = strToInt(name);
+	viewItem = dynamic_cast<CViewItem *>(node->findChildInstanceOf(CViewItem::_type));
+	while (viewItem) {
+		if (viewItem->_viewNumber == viewNumber)
+			return viewItem;
+
+		viewItem = dynamic_cast<CViewItem *>(node->findNextInstanceOf(CViewItem::_type, viewItem));
+	}
+
+	return nullptr;
+}
+
+void Debugger::listRooms() {
+	CTreeItem *root = g_vm->_window->_gameManager->_project;
+
+	for (CTreeItem *treeItem = root; treeItem; treeItem = treeItem->scan(root)) {
+		CRoomItem *roomItem = dynamic_cast<CRoomItem *>(treeItem);
+		if (roomItem)
+			debugPrintf("%s\n", roomItem->_name.c_str());
+	}
+}
+
+void Debugger::listRoom(CRoomItem *room) {
+	for (CTreeItem *treeItem = room; treeItem; treeItem = treeItem->scan(room)) {
+		CNodeItem *nodeItem = dynamic_cast<CNodeItem *>(treeItem);
+		if (nodeItem)
+			debugPrintf("%s\n", nodeItem->_name.c_str());
+	}
+}
+
+void Debugger::listNode(CNodeItem *node) {
+	for (CTreeItem *treeItem = node; treeItem; treeItem = treeItem->scan(node)) {
+		CViewItem *viewItem = dynamic_cast<CViewItem *>(treeItem);
+		if (viewItem)
+			debugPrintf("%s\n", viewItem->_name.c_str());
+	}
+}
+
+bool Debugger::cmdDump(int argc, const char **argv) {
+	// Get the starting node
+	CTreeItem *root = g_vm->_window->_gameManager->_project;
+	if (argc == 2)
+		root = root->findByName(argv[1]);
+	
+	if (root == nullptr) {
+		debugPrintf("Could not find item\n");
+	} else {
+		root->dump(0);
+		debugPrintf("Item and it's content were dumped to stdout\n");
+	}
+
+	return true;
+}
+
+bool Debugger::cmdRoom(int argc, const char **argv) {
+	if (argc == 1) {
+		listRooms();
+	} else if (argc >= 2) {
+		CRoomItem *roomItem = findRoom(argv[1]);
+
+		if (!roomItem)
+			debugPrintf("Could not find room - %s\n", argv[1]);
+		else if (argc == 2)
+			listRoom(roomItem);
+		else {
+			CNodeItem *nodeItem = findNode(roomItem, argv[2]);
+
+			if (!nodeItem)
+				debugPrintf("Could not find node - %s\n", argv[2]);
+			else if (argc == 3)
+				listNode(nodeItem);
+			else {
+				CViewItem *viewItem = findView(nodeItem, argv[3]);
+
+				if (!viewItem)
+					debugPrintf("Could not find view - %s\n", argv[3]);
+				else {
+					debugPrintf("Found view. TODO: Jump to it\n");
+				}
+			}
+		}
+	}
+
+	return true;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/debugger.h b/engines/titanic/debugger.h
new file mode 100644
index 0000000..2f3bb91
--- /dev/null
+++ b/engines/titanic/debugger.h
@@ -0,0 +1,91 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DEBUGGER_H
+#define TITANIC_DEBUGGER_H
+
+#include "common/scummsys.h"
+#include "gui/debugger.h"
+#include "titanic/core/room_item.h"
+#include "titanic/core/node_item.h"
+#include "titanic/core/view_item.h"
+
+namespace Titanic {
+
+class TitanicEngine;
+
+class Debugger : public GUI::Debugger {
+private:
+	/**
+	 * Converts a decimal or hexadecimal string into a number
+	 */
+	int strToInt(const char *s);
+
+	/**
+	 * Find a room by name or number
+	 */
+	CRoomItem *findRoom(const char *name);
+	
+	/**
+	 * Find a node within a room by name or number
+	 */
+	CNodeItem *findNode(CRoomItem *room, const char *name);
+	
+	/**
+	 * Find a view within a room node by name or number
+	 */
+	CViewItem *findView(CNodeItem *node, const char *name);
+	
+	/**
+	 * List all the rooms in the game
+	 */
+	void listRooms();
+	
+	/**
+	 * List the nodes within a room
+	 */
+	void listRoom(CRoomItem *room);
+	
+	/**
+	 * List the views within a room node
+	 */
+	void listNode(CNodeItem *node);
+
+	/**
+	 * Dump a portion of the game project
+	 */
+	bool cmdDump(int argc, const char **argv);
+
+	/**
+	 * List room details, or jump to a specific view
+	 */
+	bool cmdRoom(int argc, const char **argv);
+protected:
+	TitanicEngine *_vm;
+public:
+	Debugger(TitanicEngine *vm);
+	virtual ~Debugger() {}
+};
+
+} // End of namespace Titanic
+
+#endif	/* TITANIC_DEBUGGER_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 23ac750..7f9adaa 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -1,6 +1,7 @@
 MODULE := engines/titanic
 
 MODULE_OBJS := \
+	debugger.o \
 	detection.o \
 	direct_draw.o \
 	files_manager.o \
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index e7bbd84..e5417c1 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -29,6 +29,7 @@
 #include "graphics/scaler.h"
 #include "graphics/thumbnail.h"
 #include "titanic/titanic.h"
+#include "titanic/debugger.h"
 #include "titanic/carry/hose.h"
 #include "titanic/core/saveable_object.h"
 #include "titanic/game/get_lift_eye2.h"
@@ -47,11 +48,13 @@ TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDe
 		: _gameDescription(gameDesc), Engine(syst), _randomSource("Titanic"),
 		_ticksCount(0), _frameCounter(0) {
 	g_vm = this;
+	_debugger = nullptr;
 	_window = nullptr;
 	_screenManager = nullptr;
 }
 
 TitanicEngine::~TitanicEngine() {
+	delete _debugger;
 	delete _window;
 	delete _screenManager;
 	CSaveableObject::freeClassList();
@@ -79,6 +82,7 @@ void TitanicEngine::initialize() {
 	CExitPellerator::init();
 	CEnterExitSecClassMiniLift::init();
 
+	_debugger = new Debugger(this);
 	_screenManager = new OSScreenManager(this);
 	_window = new CMainGameWindow(this);
 	_window->applicationStarting();
@@ -108,9 +112,24 @@ Common::Error TitanicEngine::run() {
 }
 
 void TitanicEngine::processEvents() {
-	Common::Event evt;
-	g_system->getEventManager()->pollEvent(evt);
-
+	Common::Event event;
+	g_system->getEventManager()->pollEvent(event);
+
+	// Give time to the debugger
+	_debugger->onFrame();
+
+	switch (event.type) {
+	case Common::EVENT_KEYDOWN:
+		if (event.kbd.keycode == Common::KEYCODE_d && (event.kbd.flags & Common::KBD_CTRL)) {
+			// Attach to the debugger
+			_debugger->attach();
+			_debugger->onFrame();
+		}
+		break;
+
+	default:
+		break;
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index c5c6426..c2a66fb 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -29,6 +29,7 @@
 #include "common/serializer.h"
 #include "engines/advancedDetector.h"
 #include "engines/engine.h"
+#include "titanic/debugger.h"
 #include "titanic/files_manager.h"
 #include "titanic/screen_manager.h"
 #include "titanic/main_game_window.h"
@@ -97,6 +98,7 @@ protected:
 	virtual bool hasFeature(EngineFeature f) const;
 public:
 	CFilesManager _filesManager;
+	Debugger *_debugger;
 	OSScreenManager *_screenManager;
 	CMainGameWindow *_window;
 	Common::RandomSource _randomSource;


Commit: 39a4db06fa00c994ac225b68a9e236ca6cf39a35
    https://github.com/scummvm/scummvm/commit/39a4db06fa00c994ac225b68a9e236ca6cf39a35
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-17T22:32:39-04:00

Commit Message:
TITANIC: Add room number to debugger rooms listing

Changed paths:
    engines/titanic/debugger.cpp



diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp
index b759b12..7af86fc 100644
--- a/engines/titanic/debugger.cpp
+++ b/engines/titanic/debugger.cpp
@@ -104,7 +104,7 @@ void Debugger::listRooms() {
 	for (CTreeItem *treeItem = root; treeItem; treeItem = treeItem->scan(root)) {
 		CRoomItem *roomItem = dynamic_cast<CRoomItem *>(treeItem);
 		if (roomItem)
-			debugPrintf("%s\n", roomItem->_name.c_str());
+			debugPrintf("%d - %s\n", roomItem->_roomNumber, roomItem->_name.c_str());
 	}
 }
 


Commit: 04b8c75a9371d0ad353cbf4cc86da6087e94c7df
    https://github.com/scummvm/scummvm/commit/04b8c75a9371d0ad353cbf4cc86da6087e94c7df
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-17T22:51:29-04:00

Commit Message:
TITANIC: Add stubs for CEnterNodeMsg message handlers

Changed paths:
  A engines/titanic/game/volume_control.cpp
  A engines/titanic/game/volume_control.h
  R engines/titanic/gfx/volume_control.cpp
  R engines/titanic/gfx/volume_control.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/doorbot_elevator_handler.cpp
    engines/titanic/game/doorbot_elevator_handler.h
    engines/titanic/game/phonograph.h
    engines/titanic/game/transport/lift_indicator.h
    engines/titanic/module.mk
    engines/titanic/sound/node_auto_sound_player.cpp
    engines/titanic/sound/node_auto_sound_player.h
    engines/titanic/sound/restricted_auto_music_player.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index e833a05..3e9dad3 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -206,6 +206,7 @@
 #include "titanic/game/tow_parrot_nav.h"
 #include "titanic/game/up_lighter.h"
 #include "titanic/game/useless_lever.h"
+#include "titanic/game/volume_control.h"
 #include "titanic/game/wheel_button.h"
 #include "titanic/game/wheel_hotspot.h"
 #include "titanic/game/wheel_spin.h"
@@ -332,7 +333,6 @@
 #include "titanic/gfx/text_skrew.h"
 #include "titanic/gfx/text_up.h"
 #include "titanic/gfx/toggle_switch.h"
-#include "titanic/gfx/volume_control.h"
 
 #include "titanic/messages/messages.h"
 #include "titanic/messages/auto_sound_event.h"
@@ -613,6 +613,7 @@ DEFFN(CTitaniaStillControl)
 DEFFN(CTOWParrotNav)
 DEFFN(CUpLighter)
 DEFFN(CUselessLever)
+DEFFN(CVolumeControl)
 DEFFN(CWheelButton)
 DEFFN(CWheelHotSpot)
 DEFFN(CWheelSpin)
@@ -743,7 +744,6 @@ DEFFN(CTextSkrew)
 DEFFN(CTextUp)
 DEFFN(CToggleButton)
 DEFFN(CToggleSwitch)
-DEFFN(CVolumeControl)
 
 DEFFN(CActMsg)
 DEFFN(CActivationmsg)
@@ -1183,6 +1183,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CTOWParrotNav, CGameObject);
 	ADDFN(CUpLighter, CDropTarget);
 	ADDFN(CUselessLever, CToggleButton);
+	ADDFN(CVolumeControl, CGameObject);
 	ADDFN(CWheelButton, CBackground);
 	ADDFN(CWheelHotSpot, CBackground);
 	ADDFN(CWheelSpin, CBackground);
@@ -1313,7 +1314,6 @@ void CSaveableObject::initClassList() {
 	ADDFN(CTextUp, CPetGraphic);
 	ADDFN(CToggleButton, CBackground);
 	ADDFN(CToggleSwitch, CGameObject);
-	ADDFN(CVolumeControl, CGameObject);
 	
 	ADDFN(CActMsg, CMessage);
 	ADDFN(CActivationmsg, CMessage);
diff --git a/engines/titanic/game/doorbot_elevator_handler.cpp b/engines/titanic/game/doorbot_elevator_handler.cpp
index e4232c0..b8cec40 100644
--- a/engines/titanic/game/doorbot_elevator_handler.cpp
+++ b/engines/titanic/game/doorbot_elevator_handler.cpp
@@ -40,4 +40,9 @@ void CDoorbotElevatorHandler::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CDoorbotElevatorHandler::handleEvent(const CEnterNodeMsg &msg) {
+	warning("CDoorbotElevatorHandler::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/doorbot_elevator_handler.h b/engines/titanic/game/doorbot_elevator_handler.h
index e46929d..4c34248 100644
--- a/engines/titanic/game/doorbot_elevator_handler.h
+++ b/engines/titanic/game/doorbot_elevator_handler.h
@@ -24,13 +24,16 @@
 #define TITANIC_DOORBOT_ELEVATOR_HANDLER_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CDoorbotElevatorHandler : public CGameObject {
+class CDoorbotElevatorHandler : public CGameObject, CEnterNodeMsgTarget {
 private:
 	static int _v1;
 	int _value;
+protected:
+	virtual bool handleEvent(const CEnterNodeMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/phonograph.h b/engines/titanic/game/phonograph.h
index 3ba2d1c..157bd44 100644
--- a/engines/titanic/game/phonograph.h
+++ b/engines/titanic/game/phonograph.h
@@ -28,7 +28,7 @@
 
 namespace Titanic {
 
-class CPhonograph : public CMusicPlayer, CEnterRoomMsgTarget {
+class CPhonograph : public CMusicPlayer {
 protected:
 	CString _string2;
 	int _fieldE0;
diff --git a/engines/titanic/game/transport/lift_indicator.h b/engines/titanic/game/transport/lift_indicator.h
index de913c5..b707fbb 100644
--- a/engines/titanic/game/transport/lift_indicator.h
+++ b/engines/titanic/game/transport/lift_indicator.h
@@ -28,7 +28,7 @@
 
 namespace Titanic {
 
-class CLiftindicator : public CLift, CEnterRoomMsgTarget {
+class CLiftindicator : public CLift {
 private:
 	int _fieldFC;
 	Common::Point _pos2;
diff --git a/engines/titanic/game/volume_control.cpp b/engines/titanic/game/volume_control.cpp
new file mode 100644
index 0000000..26f89a7
--- /dev/null
+++ b/engines/titanic/game/volume_control.cpp
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/volume_control.h"
+
+namespace Titanic {
+
+CVolumeControl::CVolumeControl() : CGameObject() {
+}
+
+void CVolumeControl::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_fieldBC, indent);
+	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_fieldCC, indent);
+
+	CGameObject::save(file, indent);
+}
+
+void CVolumeControl::load(SimpleFile *file) {
+	file->readNumber();
+	_fieldBC = file->readNumber();
+	_string1 = file->readString();
+	_fieldCC = file->readNumber();
+
+	CGameObject::load(file);
+}
+
+bool CVolumeControl::handleEvent(const CEnterNodeMsg &msg) {
+	warning("CVolumeControl::handleEvent");
+	return true;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/volume_control.h b/engines/titanic/game/volume_control.h
new file mode 100644
index 0000000..8fa7d01
--- /dev/null
+++ b/engines/titanic/game/volume_control.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_VOLUME_CONTROL_H
+#define TITANIC_VOLUME_CONTROL_H
+
+#include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
+
+namespace Titanic {
+
+class CVolumeControl : public CGameObject, CEnterNodeMsgTarget {
+private:
+	int _fieldBC;
+	CString _string1;
+	int _fieldCC;
+protected:
+	virtual bool handleEvent(const CEnterNodeMsg &msg);
+public:
+	CLASSDEF
+	CVolumeControl();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_VOLUME_CONTROL_H */
diff --git a/engines/titanic/gfx/volume_control.cpp b/engines/titanic/gfx/volume_control.cpp
deleted file mode 100644
index 7c82916..0000000
--- a/engines/titanic/gfx/volume_control.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/gfx/volume_control.h"
-
-namespace Titanic {
-
-CVolumeControl::CVolumeControl() : CGameObject() {
-}
-
-void CVolumeControl::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeQuotedLine(_string1, indent);
-	file->writeNumberLine(_fieldCC, indent);
-
-	CGameObject::save(file, indent);
-}
-
-void CVolumeControl::load(SimpleFile *file) {
-	file->readNumber();
-	_fieldBC = file->readNumber();
-	_string1 = file->readString();
-	_fieldCC = file->readNumber();
-
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/gfx/volume_control.h b/engines/titanic/gfx/volume_control.h
deleted file mode 100644
index 7778bb8..0000000
--- a/engines/titanic/gfx/volume_control.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_VOLUME_CONTROL_H
-#define TITANIC_VOLUME_CONTROL_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CVolumeControl : public CGameObject {
-private:
-	int _fieldBC;
-	CString _string1;
-	int _fieldCC;
-public:
-	CLASSDEF
-	CVolumeControl();
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_VOLUME_CONTROL_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 7f9adaa..0fc6d3b 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -208,6 +208,7 @@ MODULE_OBJS := \
 	game/titania_still_control.o \
 	game/up_lighter.o \
 	game/useless_lever.o \
+	game/volume_control.o \
 	game/wheel_button.o \
 	game/wheel_hotspot.o \
 	game/wheel_spin.o \
@@ -328,7 +329,6 @@ MODULE_OBJS := \
 	gfx/text_up.o \
 	gfx/toggle_button.o \
 	gfx/toggle_switch.o \
-	gfx/volume_control.o \
 	messages/auto_sound_event.o \
 	messages/bilge_auto_sound_event.o \
 	messages/bilge_dispensor_event.o \
diff --git a/engines/titanic/sound/node_auto_sound_player.cpp b/engines/titanic/sound/node_auto_sound_player.cpp
index 3a69535..5709cf5 100644
--- a/engines/titanic/sound/node_auto_sound_player.cpp
+++ b/engines/titanic/sound/node_auto_sound_player.cpp
@@ -36,4 +36,9 @@ void CNodeAutoSoundPlayer::load(SimpleFile *file) {
 	CAutoSoundPlayer::load(file);
 }
 
+bool CNodeAutoSoundPlayer::handleEvent(const CEnterNodeMsg &msg) {
+	warning("CNodeAutoSoundPlayer::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/node_auto_sound_player.h b/engines/titanic/sound/node_auto_sound_player.h
index 6fc5609..c635d7e 100644
--- a/engines/titanic/sound/node_auto_sound_player.h
+++ b/engines/titanic/sound/node_auto_sound_player.h
@@ -24,12 +24,15 @@
 #define TITANIC_NODE_AUTO_SOUND_PLAYER_H
 
 #include "titanic/sound/auto_sound_player.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CNodeAutoSoundPlayer : public CAutoSoundPlayer {
+class CNodeAutoSoundPlayer : public CAutoSoundPlayer, CEnterNodeMsgTarget {
 private:
 	int _fieldEC;
+protected:
+	virtual bool handleEvent(const CEnterNodeMsg &msg);
 public:
 	CLASSDEF
 	CNodeAutoSoundPlayer() : CAutoSoundPlayer(), _fieldEC(1) {}
diff --git a/engines/titanic/sound/restricted_auto_music_player.h b/engines/titanic/sound/restricted_auto_music_player.h
index 60dcc68..a9f17d8 100644
--- a/engines/titanic/sound/restricted_auto_music_player.h
+++ b/engines/titanic/sound/restricted_auto_music_player.h
@@ -28,7 +28,7 @@
 
 namespace Titanic {
 
-class CRestrictedAutoMusicPlayer : public CAutoMusicPlayer, CEnterRoomMsgTarget {
+class CRestrictedAutoMusicPlayer : public CAutoMusicPlayer {
 private:
 	CString _string3;
 	CString _string4;


Commit: ea585b0aa53544e114cdb0080cacbcb324e6e1ff
    https://github.com/scummvm/scummvm/commit/ea585b0aa53544e114cdb0080cacbcb324e6e1ff
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-17T23:01:46-04:00

Commit Message:
TITANIC: Add some CEnterViewMsg stubs

Changed paths:
    engines/titanic/game/arboretum_gate.cpp
    engines/titanic/game/arboretum_gate.h
    engines/titanic/game/auto_animate.cpp
    engines/titanic/game/auto_animate.h



diff --git a/engines/titanic/game/arboretum_gate.cpp b/engines/titanic/game/arboretum_gate.cpp
index 3f13676..f4193b0 100644
--- a/engines/titanic/game/arboretum_gate.cpp
+++ b/engines/titanic/game/arboretum_gate.cpp
@@ -133,4 +133,17 @@ void CArboretumGate::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
+bool CArboretumGate::handleEvent(const CActMsg &msg) { return false; }
+bool CArboretumGate::handleEvent(const CLeaveViewMsg &msg) { return false; }
+bool CArboretumGate::handleEvent(const CTurnOff &msg) { return false; }
+bool CArboretumGate::handleEvent(const CMouseButtonDownMsg &msg) { return false; }
+
+bool CArboretumGate::handleEvent(const CEnterViewMsg &msg) {
+	warning("CArboretumGate::handleEvent");
+	return false;
+}
+
+bool CArboretumGate::handleEvent(const CTurnOn &msg) { return false; }
+bool CArboretumGate::handleEvent(const CMovieEndMsg &msg) { return false; }
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
index 2c2b81f..514192e 100644
--- a/engines/titanic/game/arboretum_gate.h
+++ b/engines/titanic/game/arboretum_gate.h
@@ -69,13 +69,13 @@ private:
 	int _field150;
 	CString _string2;
 protected:
-	virtual bool handleEvent(const CActMsg &msg) { return false; }
-	virtual bool handleEvent(const CLeaveViewMsg &msg) { return false; }	
-	virtual bool handleEvent(const CTurnOff &msg) { return false; }
-	virtual bool handleEvent(const CMouseButtonDownMsg &msg) { return false; }
-	virtual bool handleEvent(const CEnterViewMsg &msg) { return false; }
-	virtual bool handleEvent(const CTurnOn &msg) { return false; }
-	virtual bool handleEvent(const CMovieEndMsg &msg) { return false; }
+	virtual bool handleEvent(const CActMsg &msg);
+	virtual bool handleEvent(const CLeaveViewMsg &msg);	
+	virtual bool handleEvent(const CTurnOff &msg);
+	virtual bool handleEvent(const CMouseButtonDownMsg &msg);
+	virtual bool handleEvent(const CEnterViewMsg &msg);
+	virtual bool handleEvent(const CTurnOn &msg);
+	virtual bool handleEvent(const CMovieEndMsg &msg);
 public:
 	CLASSDEF
 	CArboretumGate();
diff --git a/engines/titanic/game/auto_animate.cpp b/engines/titanic/game/auto_animate.cpp
index bbaeebf..c79fa74 100644
--- a/engines/titanic/game/auto_animate.cpp
+++ b/engines/titanic/game/auto_animate.cpp
@@ -40,4 +40,9 @@ void CAutoAnimate::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
+bool CAutoAnimate::handleEvent(const CEnterViewMsg &msg) {
+	warning("CAutoAnimate::handleEvent");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/auto_animate.h b/engines/titanic/game/auto_animate.h
index 0fd4ad7..160fe09 100644
--- a/engines/titanic/game/auto_animate.h
+++ b/engines/titanic/game/auto_animate.h
@@ -24,14 +24,17 @@
 #define TITANIC_AUTO_ANIMATE_H
 
 #include "titanic/core/background.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
 class CAutoAnimate : public CBackground {
-public:
+private:
 	int _fieldE0;
 	int _fieldE4;
 	int _fieldE8;
+protected:
+	virtual bool handleEvent(const CEnterViewMsg &msg);
 public:
 	CLASSDEF
 	CAutoAnimate() : CBackground(), _fieldE0(1), _fieldE4(1), _fieldE8(0) {}


Commit: 8b9f3dc0b8929d920cb101a06cef8ba14fee59f0
    https://github.com/scummvm/scummvm/commit/8b9f3dc0b8929d920cb101a06cef8ba14fee59f0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-17T23:58:24-04:00

Commit Message:
TITANIC: Fleshing out CLinkItem class

Changed paths:
    engines/titanic/core/link_item.cpp
    engines/titanic/core/link_item.h
    engines/titanic/core/named_item.cpp
    engines/titanic/core/named_item.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/pet_control/pet_val.cpp
    engines/titanic/pet_control/pet_val.h
    engines/titanic/pet_control/pet_val_base.cpp
    engines/titanic/pet_control/pet_val_base.h



diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp
index 9a895b7..175c11f 100644
--- a/engines/titanic/core/link_item.cpp
+++ b/engines/titanic/core/link_item.cpp
@@ -21,10 +21,13 @@
  */
 
 #include "titanic/core/link_item.h"
+#include "titanic/core/node_item.h"
+#include "titanic/core/project_item.h"
+#include "titanic/core/view_item.h"
 
 namespace Titanic {
 
-void CLinkItemSub::clear() {
+void CLinkItemHotspot::clear() {
 	_field0 = 0;
 	_field4 = 0;
 	_field8 = 0;
@@ -34,28 +37,33 @@ void CLinkItemSub::clear() {
 /*------------------------------------------------------------------------*/
 
 CLinkItem::CLinkItem() : CNamedItem() {
-	_field24 = -1;
-	_field28 = -1;
-	_field2C = -1;
+	_roomNumber = -1;
+	_nodeNumber = -1;
+	_viewNumber = -1;
 	_field30 = 0;
 	_field34 = 1;
 	_name = "Link";
 }
 
+CString CLinkItem::formName() {
+	warning("TODO: CLinkItem::formName");
+	return "";
+}
+
 void CLinkItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(2, indent);
 	file->writeQuotedLine("L", indent);
 	file->writeNumberLine(_field34, indent + 1);
 	file->writeNumberLine(_field30, indent + 1);
-	file->writeNumberLine(_field24, indent + 1);
-	file->writeNumberLine(_field28, indent + 1);
-	file->writeNumberLine(_field2C, indent + 1);
+	file->writeNumberLine(_roomNumber, indent + 1);
+	file->writeNumberLine(_nodeNumber, indent + 1);
+	file->writeNumberLine(_viewNumber, indent + 1);
 
 	file->writeQuotedLine("Hotspot", indent + 1);
-	file->writeNumberLine(_sub._field0, indent + 2);
-	file->writeNumberLine(_sub._field4, indent + 2);
-	file->writeNumberLine(_sub._field8, indent + 2);
-	file->writeNumberLine(_sub._fieldC, indent + 2);
+	file->writeNumberLine(_hotspot._field0, indent + 2);
+	file->writeNumberLine(_hotspot._field4, indent + 2);
+	file->writeNumberLine(_hotspot._field8, indent + 2);
+	file->writeNumberLine(_hotspot._fieldC, indent + 2);
 
 	CNamedItem::save(file, indent);
 }
@@ -74,15 +82,15 @@ void CLinkItem::load(SimpleFile *file) {
 		// Deliberate fall-through
 
 	case 0:
-		_field24 = file->readNumber();
-		_field28 = file->readNumber();
-		_field2C = file->readNumber();
+		_roomNumber = file->readNumber();
+		_nodeNumber = file->readNumber();
+		_viewNumber = file->readNumber();
 
 		file->readBuffer();
-		_sub._field0 = file->readNumber();
-		_sub._field4 = file->readNumber();
-		_sub._field8 = file->readNumber();
-		_sub._fieldC = file->readNumber();
+		_hotspot._field0 = file->readNumber();
+		_hotspot._field4 = file->readNumber();
+		_hotspot._field8 = file->readNumber();
+		_hotspot._fieldC = file->readNumber();
 		break;
 
 	default:
@@ -109,4 +117,26 @@ void CLinkItem::load(SimpleFile *file) {
 	}
 }
 
+void CLinkItem::setDestination(int roomNumber, int nodeNumber,
+		int viewNumber, int v) {
+	_roomNumber = roomNumber;
+	_nodeNumber = nodeNumber;
+	_viewNumber = viewNumber;
+	_field30 = v;
+
+	_name = formName();
+}
+
+CViewItem *CLinkItem::getDestView() const {
+	return getRoot()->findView(_roomNumber, _nodeNumber, _viewNumber);
+}
+
+CNodeItem *CLinkItem::getDestNode() const {
+	return getDestView()->findNode();
+}
+
+CRoomItem *CLinkItem::getDestRoom() const {
+	return getDestNode()->findRoom();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index f46f8d3..06d55f3 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -27,26 +27,36 @@
 
 namespace Titanic {
 
-class CLinkItemSub {
+class CViewItem;
+class CNodeItem;
+class CRoomItem;
+
+class CLinkItemHotspot {
 public:
 	int _field0;
 	int _field4;
 	int _field8;
 	int _fieldC;
 public:
-	CLinkItemSub() { clear(); }
+	CLinkItemHotspot() { clear(); }
 
 	void clear();
 };
 
 class CLinkItem : public CNamedItem {
+private:
+	/**
+	 * Returns a new name for the link item, based on the
+	 * current values for it's destination
+	 */
+	CString formName();
 protected:
-	int _field24;
-	int _field28;
-	int _field2C;
+	int _roomNumber;
+	int _nodeNumber;
+	int _viewNumber;
 	int _field30;
 	int _field34;
-	CLinkItemSub _sub;
+	CLinkItemHotspot _hotspot;
 public:
 	CLASSDEF
 	CLinkItem();
@@ -60,6 +70,27 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
+
+	/**
+	 * Set the destination for the link item
+	 */
+	virtual void setDestination(int roomNumber, int nodeNumber,
+		int viewNumber, int v);
+
+	/**
+	 * Get the destination view for the link item
+	 */
+	virtual CViewItem *getDestView() const;
+
+	/**
+	 * Get the destination node for the link item
+	 */
+	virtual CNodeItem *getDestNode() const;
+
+	/**
+	 * Get the destination view for the link item
+	 */
+	virtual CRoomItem *getDestRoom() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/named_item.cpp b/engines/titanic/core/named_item.cpp
index 49cfdb4..02e7504 100644
--- a/engines/titanic/core/named_item.cpp
+++ b/engines/titanic/core/named_item.cpp
@@ -23,6 +23,7 @@
 #include "titanic/core/named_item.h"
 #include "titanic/core/node_item.h"
 #include "titanic/core/room_item.h"
+#include "titanic/core/view_item.h"
 
 namespace Titanic {
 
@@ -56,6 +57,16 @@ int CNamedItem::compareTo(const CString &name, int maxLen) const {
 	}
 }
 
+CViewItem *CNamedItem::findView() const {
+	for (CTreeItem *parent = getParent(); parent; parent = parent->getParent()) {
+		CViewItem *view = dynamic_cast<CViewItem *>(parent);
+		if (view)
+			return view;
+	}
+
+	error("Couldn't find parent view");
+}
+
 CNodeItem *CNamedItem::findNode() const {
 	for (CTreeItem *parent = getParent(); parent; parent = parent->getParent()) {
 		CNodeItem *node = dynamic_cast<CNodeItem *>(parent);
diff --git a/engines/titanic/core/named_item.h b/engines/titanic/core/named_item.h
index aac81ec..6ee11e9 100644
--- a/engines/titanic/core/named_item.h
+++ b/engines/titanic/core/named_item.h
@@ -27,6 +27,7 @@
 
 namespace Titanic {
 
+class CViewItem;
 class CNodeItem;
 class CRoomItem;
 
@@ -64,6 +65,11 @@ public:
 	/**
 	 * Find a parent node for the item
 	 */
+	virtual CViewItem *findView() const;
+
+	/**
+	 * Find a parent node for the item
+	 */
 	virtual CNodeItem *findNode() const;
 
 	/**
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 39c3fe1..72c158d 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -28,6 +28,7 @@
 #include "titanic/core/link_item.h"
 #include "titanic/core/named_item.h"
 #include "titanic/core/node_item.h"
+#include "titanic/core/project_item.h"
 #include "titanic/core/view_item.h"
 #include "titanic/core/room_item.h"
 
@@ -104,7 +105,7 @@ CGameManager *CTreeItem::getGameManager() const {
 	return _parent ? _parent->getGameManager() : nullptr;
 }
 
-CTreeItem *CTreeItem::getRoot() const {
+CProjectItem *CTreeItem::getRoot() const {
 	CTreeItem *parent = getParent();
 
 	if (parent) {
@@ -113,7 +114,7 @@ CTreeItem *CTreeItem::getRoot() const {
 		} while (parent->getParent());
 	}
 
-	return parent;
+	return dynamic_cast<CProjectItem *>(parent);
 }
 
 CTreeItem *CTreeItem::getLastSibling() {
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index be381c5..aea22ff 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -30,6 +30,7 @@ namespace Titanic {
 class CGameManager;
 class CDontSaveFileItem;
 class CNamedItem;
+class CProjectItem;
 
 class CTreeItem: public CMessageTarget {
 private:
@@ -124,9 +125,9 @@ public:
 	CTreeItem *getParent() const { return _parent; }
 
 	/**
-	 * Jumps up through the parents to find the sub-root item
+	 * Jumps up through the parents to find the root item
 	 */
-	CTreeItem *getRoot() const;
+	CProjectItem *getRoot() const;
 
 	/**
 	 * Get the next sibling
diff --git a/engines/titanic/pet_control/pet_val.cpp b/engines/titanic/pet_control/pet_val.cpp
index f0b9b92..31494e1 100644
--- a/engines/titanic/pet_control/pet_val.cpp
+++ b/engines/titanic/pet_control/pet_val.cpp
@@ -41,7 +41,7 @@ void CPetVal::proc4() {
 	error("TODO");
 }
 
-void CPetVal::proc5(CLinkItemSub *linkItem) {
+void CPetVal::proc5(CLinkItemHotspot *linkItem) {
 	error("TODO");
 }
 
diff --git a/engines/titanic/pet_control/pet_val.h b/engines/titanic/pet_control/pet_val.h
index f1f9bd1..2bf082f 100644
--- a/engines/titanic/pet_control/pet_val.h
+++ b/engines/titanic/pet_control/pet_val.h
@@ -40,7 +40,7 @@ public:
 	virtual void proc3();
 	virtual void proc4();
 
-	virtual void proc5(CLinkItemSub *linkItem);
+	virtual void proc5(CLinkItemHotspot *linkItem);
 
 	virtual int proc16();
 };
diff --git a/engines/titanic/pet_control/pet_val_base.cpp b/engines/titanic/pet_control/pet_val_base.cpp
index c1d2fa7..2eb9339 100644
--- a/engines/titanic/pet_control/pet_val_base.cpp
+++ b/engines/titanic/pet_control/pet_val_base.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 CPetValBase::CPetValBase() : _field4(0), _field8(0), _fieldC(0),
 		_field10(0), _field14(0) {}
 
-void CPetValBase::proc5(CLinkItemSub *linkItem) {
+void CPetValBase::proc5(CLinkItemHotspot *linkItem) {
 	if (linkItem)
 		linkItem->clear();
 }
diff --git a/engines/titanic/pet_control/pet_val_base.h b/engines/titanic/pet_control/pet_val_base.h
index f5f6e58..e6e78ae 100644
--- a/engines/titanic/pet_control/pet_val_base.h
+++ b/engines/titanic/pet_control/pet_val_base.h
@@ -44,7 +44,7 @@ public:
 	virtual void proc3() {}
 	virtual void proc4() {}
 
-	virtual void proc5(CLinkItemSub *linkItem);
+	virtual void proc5(CLinkItemHotspot *linkItem);
 
 	virtual int proc6();
 	virtual int proc7();


Commit: 61947ef56b77ab4778adafde93388fb526911eb7
    https://github.com/scummvm/scummvm/commit/61947ef56b77ab4778adafde93388fb526911eb7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-18T20:04:54-04:00

Commit Message:
TITANIC: Create Event manager class

Changed paths:
  A engines/titanic/events.cpp
  A engines/titanic/events.h
    engines/titanic/game/bomb.cpp
    engines/titanic/module.mk
    engines/titanic/string.cpp
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
new file mode 100644
index 0000000..c9e4e5d
--- /dev/null
+++ b/engines/titanic/events.cpp
@@ -0,0 +1,88 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/scummsys.h"
+#include "common/events.h"
+#include "common/system.h"
+#include "engines/util.h"
+#include "titanic/events.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+Events::Events(TitanicEngine *vm): _vm(vm),
+		_frameCounter(1), _priorFrameTime(0) {
+}
+
+void Events::pollEvents() {
+	checkForNextFrameCounter();
+
+	Common::Event event;
+	g_system->getEventManager()->pollEvent(event);
+
+	// Give time to the debugger
+	_vm->_debugger->onFrame();
+
+	switch (event.type) {
+	case Common::EVENT_KEYDOWN:
+		if (event.kbd.keycode == Common::KEYCODE_d && (event.kbd.flags & Common::KBD_CTRL)) {
+			// Attach to the debugger
+			_vm->_debugger->attach();
+			_vm->_debugger->onFrame();
+		}
+		break;
+
+	default:
+		break;
+	}
+}
+
+void Events::pollEventsAndWait() {
+	pollEvents();
+	g_system->delayMillis(10);
+}
+
+bool Events::checkForNextFrameCounter() {
+	// Check for next game frame
+	uint32 milli = g_system->getMillis();
+	if ((milli - _priorFrameTime) >= GAME_FRAME_TIME) {
+		++_frameCounter;
+		_priorFrameTime = milli;
+
+		// Give time to the debugger
+		_vm->_debugger->onFrame();
+
+		// Display the frame
+		//_vm->_screen->update();
+
+		return true;
+	}
+
+	return false;
+}
+
+uint32 Events::getTicksCount() const {
+	return g_system->getMillis();
+}
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/events.h b/engines/titanic/events.h
new file mode 100644
index 0000000..2de04d4
--- /dev/null
+++ b/engines/titanic/events.h
@@ -0,0 +1,74 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EVENTS_H
+#define TITANIC_EVENTS_H
+
+#include "common/scummsys.h"
+#include "common/events.h"
+
+namespace Titanic {
+
+#define GAME_FRAME_RATE 30
+#define GAME_FRAME_TIME (1000 / GAME_FRAME_RATE)
+
+class TitanicEngine;
+
+class Events {
+private:
+	TitanicEngine *_vm;
+	uint32 _frameCounter;
+	uint32 _priorFrameTime;
+
+	/**
+	 * Check whether it's time to display the next screen frame
+	 */
+	bool checkForNextFrameCounter();
+public:
+	Events(TitanicEngine *vm);
+	~Events() {}
+
+	/**
+	 * Check for any pending events
+	 */
+	void pollEvents();
+
+	/**
+	 * Poll for events and introduce a small delay, to allow the system to
+	 * yield to other running programs
+	 */
+	void pollEventsAndWait();
+
+	/**
+	 * Return the current game frame number
+	 */
+	uint32 getFrameCounter() const { return _frameCounter; }
+
+	/**
+	 * Get the elapsed playtime
+	 */
+	uint32 getTicksCount() const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EVENTS_H */
diff --git a/engines/titanic/game/bomb.cpp b/engines/titanic/game/bomb.cpp
index 429f254..e4cf1b3 100644
--- a/engines/titanic/game/bomb.cpp
+++ b/engines/titanic/game/bomb.cpp
@@ -74,7 +74,7 @@ bool CBomb::handleEvent(const CEnterRoomMsg &msg) {
 	_fieldE8 = 12;
 	_fieldEC = 9;
 	_fieldF0 = 0;
-	_startingTicks = g_vm->_ticksCount;
+	_startingTicks = g_vm->_events->getTicksCount();
 	return true;
 }
 
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 0fc6d3b..da194bf 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -4,6 +4,7 @@ MODULE_OBJS := \
 	debugger.o \
 	detection.o \
 	direct_draw.o \
+	events.o \
 	files_manager.o \
 	font.o \
 	game_location.o \
diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp
index ed5379b..5831b7d 100644
--- a/engines/titanic/string.cpp
+++ b/engines/titanic/string.cpp
@@ -30,7 +30,7 @@ CString CString::left(uint count) const {
 }
 
 CString CString::right(uint count) const {
-	int strSize = size();
+	uint strSize = size();
 	return (count > strSize) ? CString() : 
 		CString(c_str() + strSize - count, c_str() + strSize);
 }
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index e5417c1..f29e776 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -45,16 +45,17 @@ namespace Titanic {
 TitanicEngine *g_vm;
 
 TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc)
-		: _gameDescription(gameDesc), Engine(syst), _randomSource("Titanic"),
-		_ticksCount(0), _frameCounter(0) {
+		: _gameDescription(gameDesc), Engine(syst), _randomSource("Titanic") {
 	g_vm = this;
 	_debugger = nullptr;
+	_events = nullptr;
 	_window = nullptr;
 	_screenManager = nullptr;
 }
 
 TitanicEngine::~TitanicEngine() {
 	delete _debugger;
+	delete _events;
 	delete _window;
 	delete _screenManager;
 	CSaveableObject::freeClassList();
@@ -83,6 +84,7 @@ void TitanicEngine::initialize() {
 	CEnterExitSecClassMiniLift::init();
 
 	_debugger = new Debugger(this);
+	_events = new Events(this);
 	_screenManager = new OSScreenManager(this);
 	_window = new CMainGameWindow(this);
 	_window->applicationStarting();
@@ -103,33 +105,11 @@ Common::Error TitanicEngine::run() {
 
 	// Main event loop
 	while (!shouldQuit()) {
-		processEvents();
-		g_system->delayMillis(5);		
+		_events->pollEventsAndWait();
 	}
 
 	deinitialize();
 	return Common::kNoError;
 }
 
-void TitanicEngine::processEvents() {
-	Common::Event event;
-	g_system->getEventManager()->pollEvent(event);
-
-	// Give time to the debugger
-	_debugger->onFrame();
-
-	switch (event.type) {
-	case Common::EVENT_KEYDOWN:
-		if (event.kbd.keycode == Common::KEYCODE_d && (event.kbd.flags & Common::KBD_CTRL)) {
-			// Attach to the debugger
-			_debugger->attach();
-			_debugger->onFrame();
-		}
-		break;
-
-	default:
-		break;
-	}
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index c2a66fb..8ed353f 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -30,6 +30,7 @@
 #include "engines/advancedDetector.h"
 #include "engines/engine.h"
 #include "titanic/debugger.h"
+#include "titanic/events.h"
 #include "titanic/files_manager.h"
 #include "titanic/screen_manager.h"
 #include "titanic/main_game_window.h"
@@ -83,11 +84,6 @@ private:
 	 * Handles game deinitialization
 	 */
 	void deinitialize();
-
-	/**
-	 * Processes pending events
-	 */
-	void processEvents();
 protected:
 	const TitanicGameDescription *_gameDescription;
 	int _loadSaveSlot;
@@ -99,11 +95,10 @@ protected:
 public:
 	CFilesManager _filesManager;
 	Debugger *_debugger;
+	Events *_events;
 	OSScreenManager *_screenManager;
 	CMainGameWindow *_window;
 	Common::RandomSource _randomSource;
-	uint _frameCounter;
-	uint _ticksCount;
 public:
 	TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
 	virtual ~TitanicEngine();


Commit: 9565fbaeac8f48ea0090ebbd751a18eacc6d1230
    https://github.com/scummvm/scummvm/commit/9565fbaeac8f48ea0090ebbd751a18eacc6d1230
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-18T21:34:04-04:00

Commit Message:
TITANIC: Implement input translator event methods

Changed paths:
    engines/titanic/core/saveable_object.cpp
    engines/titanic/events.cpp
    engines/titanic/events.h
    engines/titanic/files_manager.cpp
    engines/titanic/files_manager.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/input_handler.cpp
    engines/titanic/input_handler.h
    engines/titanic/input_translator.cpp
    engines/titanic/input_translator.h
    engines/titanic/main_game_window.cpp
    engines/titanic/main_game_window.h
    engines/titanic/messages/messages.cpp
    engines/titanic/messages/messages.h
    engines/titanic/messages/mouse_messages.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 3e9dad3..4ad9938 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -856,6 +856,9 @@ DEFFN(CPhonographRecordMsg)
 DEFFN(CPhonographStopMsg)
 DEFFN(CPlayRangeMsg)
 DEFFN(CPlayerTriesRestaurantTableMsg)
+DEFFN(CPreEnterNodeMsg);
+DEFFN(CPreEnterRoomMsg);
+DEFFN(CPreEnterViewMsg);
 DEFFN(CPreSaveMsg)
 DEFFN(CProdMaitreDMsg)
 DEFFN(CPumpingMsg)
@@ -1426,6 +1429,9 @@ void CSaveableObject::initClassList() {
 	ADDFN(CPhonographStopMsg, CMessage);
 	ADDFN(CPlayRangeMsg, CMessage);
 	ADDFN(CPlayerTriesRestaurantTableMsg, CMessage);
+	ADDFN(CEnterNodeMsg, CMessage);
+	ADDFN(CEnterRoomMsg, CMessage);
+	ADDFN(CEnterViewMsg, CMessage);
 	ADDFN(CPreSaveMsg, CMessage);
 	ADDFN(CProdMaitreDMsg, CMessage);
 	ADDFN(CPumpingMsg, CMessage);
diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index c9e4e5d..09ec3e5 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -26,31 +26,46 @@
 #include "engines/util.h"
 #include "titanic/events.h"
 #include "titanic/titanic.h"
+#include "titanic/main_game_window.h"
 
 namespace Titanic {
 
-Events::Events(TitanicEngine *vm): _vm(vm),
-		_frameCounter(1), _priorFrameTime(0) {
+Events::Events(TitanicEngine *vm): _vm(vm), _specialButtons(0),
+		_frameCounter(1), _priorFrameTime(0), _priorLeftDownTime(0),
+		_priorMiddleDownTime(0), _priorRightDownTime(0) {
 }
 
 void Events::pollEvents() {
 	checkForNextFrameCounter();
 
 	Common::Event event;
-	g_system->getEventManager()->pollEvent(event);
-
-	// Give time to the debugger
-	_vm->_debugger->onFrame();
+	if (!g_system->getEventManager()->pollEvent(event))
+		return;
 
 	switch (event.type) {
+	case Common::EVENT_MOUSEMOVE:
+		_mousePos = event.mouse;
+		mouseMove();
+		break;
+	case Common::EVENT_LBUTTONDOWN:
+		_mousePos = event.mouse;
+		leftButtonDown();
+		break;
+	case Common::EVENT_LBUTTONUP:
+		_mousePos = event.mouse;
+		leftButtonUp();
+		break;
+	case Common::EVENT_MBUTTONDOWN:
+		_mousePos = event.mouse;
+		middleButtonDown();
+		break;
+	case Common::EVENT_MBUTTONUP:
+		_mousePos = event.mouse;
+		middleButtonUp();
+		break;
 	case Common::EVENT_KEYDOWN:
-		if (event.kbd.keycode == Common::KEYCODE_d && (event.kbd.flags & Common::KBD_CTRL)) {
-			// Attach to the debugger
-			_vm->_debugger->attach();
-			_vm->_debugger->onFrame();
-		}
+		keyDown(event.kbd);
 		break;
-
 	default:
 		break;
 	}
@@ -84,5 +99,89 @@ uint32 Events::getTicksCount() const {
 	return g_system->getMillis();
 }
 
+#define HANDLE_MESSAGE(method) 	if (_vm->_window->_inputAllowed) { \
+	_vm->_window->_gameManager->_inputTranslator.leftButtonDown(_specialButtons, _mousePos); \
+	_vm->_window->mouseChanged(); \
+	}
+
+
+void Events::mouseMove() {
+	HANDLE_MESSAGE(mouseMove)
+}
+
+void Events::leftButtonDown() {
+	_specialButtons |= MK_LBUTTON;
+
+	if ((getTicksCount() - _priorLeftDownTime) < DOUBLE_CLICK_TIME) {
+		_priorLeftDownTime = 0;
+		leftButtonDoubleClick();
+	} else {
+		_priorLeftDownTime = getTicksCount();
+		HANDLE_MESSAGE(leftButtonDown)
+	}
+}
+
+void Events::leftButtonUp() {
+	_specialButtons &= ~MK_LBUTTON;
+	HANDLE_MESSAGE(leftButtonUp)
+}
+
+void Events::leftButtonDoubleClick() {
+	HANDLE_MESSAGE(leftButtonDoubleClick)
+}
+
+void Events::middleButtonDown() {
+	_specialButtons |= MK_MBUTTON;
+
+	if ((getTicksCount() - _priorMiddleDownTime) < DOUBLE_CLICK_TIME) {
+		_priorMiddleDownTime = 0;
+		middleButtonDoubleClick();
+	} else {
+		_priorMiddleDownTime = getTicksCount();
+		HANDLE_MESSAGE(middleButtonDown)
+	}
+}
+
+void Events::middleButtonUp() {
+	_specialButtons &= ~MK_MBUTTON;
+	HANDLE_MESSAGE(middleButtonUp)
+}
+
+void Events::middleButtonDoubleClick() {
+	HANDLE_MESSAGE(middleButtonDoubleClick)
+}
+
+void Events::rightButtonDown() {
+	_specialButtons |= MK_RBUTTON;
+
+	if ((getTicksCount() - _priorRightDownTime) < DOUBLE_CLICK_TIME) {
+		_priorRightDownTime = 0;
+		rightButtonDoubleClick();
+	} else {
+		_priorRightDownTime = getTicksCount();
+		HANDLE_MESSAGE(rightButtonDown)
+	}
+}
+
+void Events::rightButtonUp() {
+	_specialButtons &= ~MK_RBUTTON;
+	HANDLE_MESSAGE(rightButtonUp)
+}
+
+void Events::rightButtonDoubleClick() {
+	HANDLE_MESSAGE(rightButtonDoubleClick)
+}
+
+void Events::charPress(char c) {
+
+}
+
+void Events::keyDown(Common::KeyState keyState) {
+	if (keyState.keycode == Common::KEYCODE_d && (keyState.flags & Common::KBD_CTRL)) {
+		// Attach to the debugger
+		_vm->_debugger->attach();
+		_vm->_debugger->onFrame();
+	}
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/events.h b/engines/titanic/events.h
index 2de04d4..dc1781f 100644
--- a/engines/titanic/events.h
+++ b/engines/titanic/events.h
@@ -30,6 +30,12 @@ namespace Titanic {
 
 #define GAME_FRAME_RATE 30
 #define GAME_FRAME_TIME (1000 / GAME_FRAME_RATE)
+#define DOUBLE_CLICK_TIME 100
+
+enum SpecialButtons { 
+	MK_LBUTTON = 1, MK_RBUTTON = 2, MK_SHIFT = 4, MK_CONTROL = 8, 
+	MK_MBUTTON = 0x10
+};
 
 class TitanicEngine;
 
@@ -38,11 +44,29 @@ private:
 	TitanicEngine *_vm;
 	uint32 _frameCounter;
 	uint32 _priorFrameTime;
+	uint32 _priorLeftDownTime;
+	uint32 _priorMiddleDownTime;
+	uint32 _priorRightDownTime;
+	Common::Point _mousePos;
+	int _specialButtons;
 
 	/**
 	 * Check whether it's time to display the next screen frame
 	 */
 	bool checkForNextFrameCounter();
+
+	void mouseMove();
+	void leftButtonDown();
+	void leftButtonUp();
+	void leftButtonDoubleClick();
+	void middleButtonDown();
+	void middleButtonUp();
+	void middleButtonDoubleClick();
+	void rightButtonDown();
+	void rightButtonUp();
+	void rightButtonDoubleClick();
+	void charPress(char c);
+	void keyDown(Common::KeyState keyState);
 public:
 	Events(TitanicEngine *vm);
 	~Events() {}
diff --git a/engines/titanic/files_manager.cpp b/engines/titanic/files_manager.cpp
index 662a882..d668563 100644
--- a/engines/titanic/files_manager.cpp
+++ b/engines/titanic/files_manager.cpp
@@ -62,4 +62,8 @@ bool CFilesManager::scanForFile(const CString &name) {
 	return fileExists(fname);
 }
 
+void CFilesManager::fn1() {
+	warning("TODO: CFilesManager::fn1");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/files_manager.h b/engines/titanic/files_manager.h
index 9350523..ae57033 100644
--- a/engines/titanic/files_manager.h
+++ b/engines/titanic/files_manager.h
@@ -63,6 +63,8 @@ public:
 	 * Scans for a file with a matching name
 	 */
 	bool scanForFile(const CString &name);
+
+	void fn1();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index efa816d..aeacd73 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -96,4 +96,8 @@ void CGameManager::fn2() {
 	warning("TODO");
 }
 
+void CGameManager::update() {
+	warning("TODO: CGameManager::update");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 1509554..d132ff3 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -54,8 +54,6 @@ class CGameManager {
 private:
 	CGameView *_gameView;
 	CSound _sound;
-	CInputHandler _inputHandler;
-	CInputTranslator _inputTranslator;
 	CMusicRoom _musicRoom;
 	CTrueTalkManager _trueTalkManager;
 	CGameManagerList _list;
@@ -72,6 +70,8 @@ public:
 	CProjectItem *_project;
 	CGameState _gameState;
 	Common::Rect _bounds;
+	CInputHandler _inputHandler;
+	CInputTranslator _inputTranslator;
 public:
 	CGameManager(CProjectItem *project, CGameView *gameView);
 	~CGameManager();
@@ -104,6 +104,11 @@ public:
 	void initBounds();
 
 	void fn2();
+
+	/**
+	 * Updates the state of the manager
+	 */
+	void update();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index d5825c0..d719921 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -21,7 +21,9 @@
  */
 
 #include "titanic/input_handler.h"
+#include "titanic/game_manager.h"
 #include "titanic/screen_manager.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -46,4 +48,18 @@ void CInputHandler::decLockCount() {
 	}
 }
 
+void CInputHandler::handleMessage(const CMessage &msg, bool respectLock) {
+	if (!respectLock || _lockCount <= 0) {
+		if (_gameManager->_gameState._mode == GSMODE_1) {
+			processMessage(msg);
+		} else if (!msg.isMouseMsg()) {
+			g_vm->_filesManager.fn1();
+		}
+	}
+}
+
+void CInputHandler::processMessage(const CMessage &msg) {
+	warning("TODO: CInputHandler::processMessage");
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/input_handler.h b/engines/titanic/input_handler.h
index 1bc6dc9..461011f 100644
--- a/engines/titanic/input_handler.h
+++ b/engines/titanic/input_handler.h
@@ -31,6 +31,11 @@ namespace Titanic {
 class CGameManager;
 
 class CInputHandler {
+private:
+	/**
+	 * Process and dispatch a passed message
+	 */
+	void processMessage(const CMessage &msg);
 public:
 	CGameManager *_gameManager;
 	CInputTranslator *_inputTranslator;
@@ -56,6 +61,11 @@ public:
 	 * Decrement the lock count on the input handler
 	 */
 	void decLockCount();
+
+	/**
+	 * Handles a genereated mouse message
+	 */
+	void handleMessage(const CMessage &msg, bool respectLock = true);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/input_translator.cpp b/engines/titanic/input_translator.cpp
index b2ee6eb..8b12646 100644
--- a/engines/titanic/input_translator.cpp
+++ b/engines/titanic/input_translator.cpp
@@ -22,6 +22,8 @@
 
 #include "titanic/input_handler.h"
 #include "titanic/input_translator.h"
+#include "titanic/events.h"
+#include "titanic/messages/mouse_messages.h"
 
 namespace Titanic {
 
@@ -30,4 +32,57 @@ CInputTranslator::CInputTranslator(CInputHandler *inputHandler) :
 	inputHandler->setTranslator(this);
 }
 
-} // End of namespace Titanic z
+int CInputTranslator::getButtons(int special) const {
+	int buttons = 0;
+	if (special & MK_LBUTTON)
+		buttons |= MB_LEFT;
+	if (special & MK_MBUTTON)
+		buttons |= MB_MIDDLE;
+	if (special & MK_RBUTTON)
+		buttons |= MB_RIGHT;
+
+	return buttons;
+}
+
+void CInputTranslator::mouseMove(int special, const Common::Point &pt) {
+	CMouseMoveMsg msg(pt, getButtons(special));
+	_inputHandler->handleMessage(msg);
+}
+
+void CInputTranslator::leftButtonDown(int special, const Common::Point &pt) {
+
+}
+
+void CInputTranslator::leftButtonUp(int special, const Common::Point &pt) {
+
+}
+
+void CInputTranslator::leftButtonDoubleClick(int special, const Common::Point &pt) {
+
+}
+
+void CInputTranslator::middleButtonDown(int special, const Common::Point &pt) {
+
+}
+
+void CInputTranslator::middleButtonUp(int special, const Common::Point &pt) {
+
+}
+
+void CInputTranslator::middleButtonDoubleClick(int special, const Common::Point &pt) {
+
+}
+
+void CInputTranslator::rightButtonDown(int special, const Common::Point &pt) {
+
+}
+
+void CInputTranslator::rightButtonUp(int special, const Common::Point &pt) {
+
+}
+
+void CInputTranslator::rightButtonDoubleClick(int special, const Common::Point &pt) {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/input_translator.h b/engines/titanic/input_translator.h
index 98cd2bb..2748ca4 100644
--- a/engines/titanic/input_translator.h
+++ b/engines/titanic/input_translator.h
@@ -23,15 +23,33 @@
 #ifndef TITANIC_INPUT_TRANSLATOR_H
 #define TITANIC_INPUT_TRANSLATOR_H
 
+#include "titanic/messages/mouse_messages.h"
+
 namespace Titanic {
 
 class CInputHandler;
 
 class CInputTranslator {
+private:
+	/**
+	 * Converts the special buttons bitset into a buttons bitset
+	 */
+	int getButtons(int special) const;
 public:
 	CInputHandler *_inputHandler;
 public:
 	CInputTranslator(CInputHandler *inputHandler);
+
+	void mouseMove(int special, const Common::Point &pt);
+	void leftButtonDown(int special, const Common::Point &pt);
+	void leftButtonUp(int special, const Common::Point &pt);
+	void leftButtonDoubleClick(int special, const Common::Point &pt);
+	void middleButtonDown(int special, const Common::Point &pt);
+	void middleButtonUp(int special, const Common::Point &pt);
+	void middleButtonDoubleClick(int special, const Common::Point &pt);
+	void rightButtonDown(int special, const Common::Point &pt);
+	void rightButtonUp(int special, const Common::Point &pt);
+	void rightButtonDoubleClick(int special, const Common::Point &pt);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index a964f92..429991d 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -32,7 +32,7 @@ CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) {
 	_gameView = nullptr;
 	_gameManager = nullptr;
 	_project = nullptr;
-	_field50 = 0;
+	_inputAllowed = false;
 	_image = nullptr;
 	_cursor = nullptr;
 }
@@ -134,4 +134,9 @@ void CMainGameWindow::fn2() {
 	}
 }
 
+void CMainGameWindow::mouseChanged() {
+	if (_gameManager->_gameState._mode != GSMODE_5)
+		_gameManager->update();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index eedac23..6a72dbf 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -53,7 +53,7 @@ public:
 	CGameView *_gameView;
 	CGameManager *_gameManager;
 	CProjectItem *_project;
-	int _field50;
+	bool _inputAllowed;
 	Image *_image;
 	void *_cursor;
 public:
@@ -75,6 +75,11 @@ public:
 	void setActiveView(CViewItem *viewItem);
 
 	void fn2();
+
+	/**
+	 * Called by the event handler when a mouse event has been generated
+	 */
+	void mouseChanged();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
index 00debc5..b44748d 100644
--- a/engines/titanic/messages/messages.cpp
+++ b/engines/titanic/messages/messages.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
 #include "titanic/core/game_object.h"
 #include "titanic/core/tree_item.h"
 
@@ -66,4 +67,60 @@ bool CMessage::execute(CTreeItem *target, const ClassDef *classDef, int flags) c
 	return result;
 }
 
+bool CMessage::isMouseMsg() const {
+	return dynamic_cast<const CMouseMsg *>(this) != nullptr;
+}
+
+bool CMessage::isButtonDownMsg() const {
+	return dynamic_cast<const CMouseButtonDownMsg *>(this) != nullptr;
+}
+
+bool CMessage::isButtonUpMsg() const {
+	return dynamic_cast<const CMouseButtonUpMsg *>(this) != nullptr;
+}
+
+bool CMessage::isMouseMoveMsg() const {
+	return dynamic_cast<const CMouseMoveMsg *>(this) != nullptr;
+}
+
+bool CMessage::isDoubleClickMsg() const {
+	return dynamic_cast<const CMouseButtonDoubleClickMsg *>(this) != nullptr;
+}
+
+bool CMessage::isEnterRoomMsg() const {
+	return dynamic_cast<const CEnterRoomMsg *>(this) != nullptr;
+}
+
+bool CMessage::isPreEnterRoomMsg() const {
+	return dynamic_cast<const CPreEnterRoomMsg *>(this) != nullptr;
+}
+
+bool CMessage::isleaveRoomMsg() const {
+	return dynamic_cast<const CLeaveRoomMsg *>(this) != nullptr;
+}
+
+bool CMessage::isEnterNodeMsg() const {
+	return dynamic_cast<const CEnterNodeMsg *>(this) != nullptr;
+}
+
+bool CMessage::isPreEnterNodeMsg() const {
+	return dynamic_cast<const CPreEnterNodeMsg *>(this) != nullptr;
+}
+
+bool CMessage::isLeaveNodeMsg() const {
+	return dynamic_cast<const CLeaveNodeMsg *>(this) != nullptr;
+}
+
+bool CMessage::isEnterViewMsg() const {
+	return dynamic_cast<const CEnterViewMsg *>(this) != nullptr;
+}
+
+bool CMessage::isPreEnterViewMsg() const {
+	return dynamic_cast<const CPreEnterViewMsg *>(this) != nullptr;
+}
+
+bool CMessage::isLeaveViewMsg() const {
+	return dynamic_cast<const CLeaveViewMsg *>(this) != nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 9582758..d221443 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -59,6 +59,21 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
+
+	virtual bool isMouseMsg() const;
+	virtual bool isButtonDownMsg() const;
+	virtual bool isButtonUpMsg() const;
+	virtual bool isMouseMoveMsg() const;
+	virtual bool isDoubleClickMsg() const;
+	virtual bool isEnterRoomMsg() const;
+	virtual bool isPreEnterRoomMsg() const;
+	virtual bool isleaveRoomMsg() const;
+	virtual bool isEnterNodeMsg() const;
+	virtual bool isPreEnterNodeMsg() const;
+	virtual bool isLeaveNodeMsg() const;
+	virtual bool isEnterViewMsg() const;
+	virtual bool isPreEnterViewMsg() const;
+	virtual bool isLeaveViewMsg() const;
 };
 
 MSGTARGET(CEditControlMsg);
@@ -244,6 +259,9 @@ MESSAGE1(CDropobjectMsg, int, value, 0);
 MESSAGE1(CDropZoneGotObjectMsg, int, value, 0);
 MESSAGE1(CDropZoneLostObjectMsg, int, value, 0);
 MESSAGE1(CEjectCylinderMsg, int, value, 0);
+MESSAGE1(CPreEnterNodeMsg, CNodeItem *, node, nullptr);
+MESSAGE1(CPreEnterRoomMsg, CRoomItem *, room, nullptr);
+MESSAGE1(CPreEnterViewMsg, CViewItem *, view, nullptr);
 MESSAGE1(CEnterNodeMsg, CNodeItem *, node, nullptr);
 MESSAGE1(CEnterRoomMsg, CRoomItem *, room, nullptr);
 MESSAGE1(CEnterViewMsg, CViewItem *, view, nullptr);
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 0386eb6..e36b54d 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -23,10 +23,13 @@
 #ifndef TITANIC_MOUSE_MESSAGES_H
 #define TITANIC_MOUSE_MESSAGES_H
 
+#include "common/rect.h"
 #include "titanic/messages/messages.h"
 
 namespace Titanic {
 
+enum MouseButton { MB_LEFT = 1, MB_MIDDLE = 2, MB_RIGHT = 4 };
+
 class CMouseMsg : public CMessage {
 public:
 	int _buttons;
@@ -34,12 +37,16 @@ public:
 public:
 	CLASSDEF
 	CMouseMsg() : _buttons(0) {}
+	CMouseMsg(const Common::Point &pt, int buttons) :
+		_mousePos(pt), _buttons(buttons) {}
 };
 
 MSGTARGET(CMouseMoveMsg);
 class CMouseMoveMsg : public CMouseMsg {
 public:
 	CLASSDEF
+	CMouseMoveMsg() : CMouseMsg() {}
+	CMouseMoveMsg(const Common::Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
 
 	virtual bool handleMessage(const CMouseMoveMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
@@ -54,12 +61,15 @@ public:
 public:
 	CLASSDEF
 	CMouseButtonMsg() : CMouseMsg(), _field10(0) {}
+	CMouseButtonMsg(const Common::Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
 };
 
 MSGTARGET(CMouseButtonDownMsg);
 class CMouseButtonDownMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
+	CMouseButtonDownMsg() : CMouseButtonMsg() {}
+	CMouseButtonDownMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
 	virtual bool handleMessage(const CMouseButtonDownMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) {
@@ -72,6 +82,8 @@ MSGTARGET(CMouseButtonUpMsg);
 class CMouseButtonUpMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
+	CMouseButtonUpMsg() : CMouseButtonMsg() {}
+	CMouseButtonUpMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
 	virtual bool handleMessage(const CMouseButtonUpMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
@@ -84,6 +96,8 @@ MSGTARGET(CMouseButtonDoubleClickMsg);
 class CMouseButtonDoubleClickMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
+	CMouseButtonDoubleClickMsg() : CMouseButtonMsg() {}
+	CMouseButtonDoubleClickMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
 	virtual bool handleMessage(const CMouseButtonDoubleClickMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 


Commit: 7a38b51357ba581fe51a392a031d09dd238039e8
    https://github.com/scummvm/scummvm/commit/7a38b51357ba581fe51a392a031d09dd238039e8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-18T23:15:31-04:00

Commit Message:
TITANIC: Implemented drag/drop handling

Changed paths:
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/input_handler.cpp
    engines/titanic/input_handler.h
    engines/titanic/messages/mouse_messages.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index aeacd73..a2732d8 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -48,7 +48,7 @@ CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
 		_inputHandler(this), _inputTranslator(&_inputHandler),		
 		_gameState(this), _sound(this), _musicRoom(this),
 		_field30(0), _field34(0), _field4C(0), 
-		_field50(0), _field54(0), _tickCount1(0), _tickCount2(0) {
+		_dragItem(nullptr), _field54(0), _tickCount1(0), _tickCount2(0) {
 	
 	_videoSurface1 = nullptr;
 	_videoSurface2 = CScreenManager::_screenManagerPtr->createSurface(600, 340);
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index d132ff3..a331f3a 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -61,7 +61,6 @@ private:
 	int _field34;
 	CVideoSurface *_videoSurface1;
 	int _field4C;
-	int _field50;
 	int _field54;
 	CVideoSurface *_videoSurface2;
 	uint _tickCount1;
@@ -72,6 +71,7 @@ public:
 	Common::Rect _bounds;
 	CInputHandler _inputHandler;
 	CInputTranslator _inputTranslator;
+	CTreeItem *_dragItem;
 public:
 	CGameManager(CProjectItem *project, CGameView *gameView);
 	~CGameManager();
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 3ce8b2b..30185fc 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -30,7 +30,7 @@ CGameState::CGameState(CGameManager *gameManager) :
 		_gameManager(gameManager), _gameLocation(this),
 		_field8(0), _fieldC(0), _mode(GSMODE_0), _field14(0), _field18(0),
 		_field1C(0), _field20(0), _field24(0), _field28(0), _field2C(0),
-		_field30(0), _field34(0), _field38(0) {
+		_field38(0) {
 }
 
 void CGameState::save(SimpleFile *file) const {
@@ -78,4 +78,8 @@ void CGameState::setMode(GameStateMode newMode) {
 	_mode = newMode;
 }
 
+void CGameState::setMousePos(const Common::Point &pt) {
+	_mousePos = pt;
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 3c3b720..1c0b750 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -56,8 +56,7 @@ public:
 	int _field24;
 	int _field28;
 	int _field2C;
-	int _field30;
-	int _field34;
+	Common::Point _mousePos;
 	int _field38;
 public:
 	CGameState(CGameManager *gameManager);
@@ -76,6 +75,11 @@ public:
 	 * Sets a new mode
 	 */
 	void setMode(GameStateMode newMode);
+
+	/**
+	 * Sets the current mouse position
+	 */
+	void setMousePos(const Common::Point &pt);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index d719921..5d50c00 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -24,13 +24,13 @@
 #include "titanic/game_manager.h"
 #include "titanic/screen_manager.h"
 #include "titanic/titanic.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
 CInputHandler::CInputHandler(CGameManager *owner) :
-		_gameManager(owner), _inputTranslator(nullptr),
-		_field4(0), _field8(0), _fieldC(0), _field10(0), _field14(0),
-		_lockCount(0), _field24(0) {
+		_gameManager(owner), _inputTranslator(nullptr), _dragging(false),
+		_buttonDown(false), _dragItem(nullptr),  _lockCount(0), _field24(0) {
 	CScreenManager::_screenManagerPtr->_inputHandler = this;
 }
 
@@ -51,15 +51,91 @@ void CInputHandler::decLockCount() {
 void CInputHandler::handleMessage(const CMessage &msg, bool respectLock) {
 	if (!respectLock || _lockCount <= 0) {
 		if (_gameManager->_gameState._mode == GSMODE_1) {
-			processMessage(msg);
+			processMessage(&msg);
 		} else if (!msg.isMouseMsg()) {
 			g_vm->_filesManager.fn1();
 		}
 	}
 }
 
-void CInputHandler::processMessage(const CMessage &msg) {
-	warning("TODO: CInputHandler::processMessage");
+void CInputHandler::processMessage(const CMessage *msg) {
+	const CMouseMsg *mouseMsg = dynamic_cast<const CMouseMsg *>(msg);
+	_field24 = 0;
+	dispatchMessage(msg);
+
+	if (_field24) {
+		_field24 = 0;
+	} else if (mouseMsg) {
+		// Keep the game state mouse position up to date
+		if (_mousePos != mouseMsg->_mousePos) {
+			_mousePos = mouseMsg->_mousePos;
+			_gameManager->_gameState.setMousePos(mouseMsg->_mousePos);
+		}
+
+		// Set flag for whether a mouse button is currently being pressed
+		if (mouseMsg->isButtonDownMsg())
+			_buttonDown = true;
+		else if (mouseMsg->isButtonUpMsg())
+			_buttonDown = false;
+
+		// Drag events generation
+		if (_dragging) {
+			if (mouseMsg->isMouseMoveMsg()) {
+				if (_dragItem) {
+					CMouseDragMoveMsg moveMsg(_mousePos);
+					moveMsg.execute(_dragItem);
+				}
+			} else {
+				if (mouseMsg->isButtonUpMsg() && _dragItem) {
+					// Mouse drag ended
+					dragEnd(_mousePos, _dragItem);
+					CMouseDragEndMsg endMsg(_mousePos, _dragItem);
+					endMsg.execute(_dragItem);
+				}
+
+				_dragging = false;
+				_dragItem = nullptr;
+			}
+		} else if (_buttonDown) {
+			if (!mouseMsg->isMouseMoveMsg()) {
+				// Save where the drag movement started from
+				_dragStartPos = _mousePos;
+			} else {
+				Common::Point delta = mouseMsg->_mousePos - _dragStartPos;
+				int distance = (int)sqrt(double(delta.x * delta.x + delta.y * delta.y));
+
+				if (distance > 4) {
+					// We've moved far enough with the mouse button held down
+					// to trigger an official dragging operation
+					CMouseDragStartMsg startMsg(_dragStartPos);
+					dispatchMessage(&startMsg);
+
+					// Set the drag item, if any, that a handler will have set on the message
+					_dragItem = startMsg._dragItem;
+					_gameManager->_dragItem = startMsg._dragItem;
+
+					if (_dragItem) {
+						CMouseDragMoveMsg moveMsg(_dragStartPos);
+						dispatchMessage(&moveMsg);
+					}
+
+					_dragging = true;
+				}
+			}
+		}
+	}
+}
+
+void CInputHandler::dispatchMessage(const CMessage *msg) {
+	CPetControl *pet = _gameManager->_project->getPetControl();
+	if (!pet || !msg->execute(pet, nullptr, MSGFLAG_BREAK_IF_HANDLED)) {
+		CViewItem *view = _gameManager->getView();
+		msg->execute(view);
+	}
+}
+
+void CInputHandler::dragEnd(const Common::Point &mousePos, CTreeItem *dragItem) {
+	warning("TODO CInputHandler::dragEnd");
 }
 
 } // End of namespace Titanic z
diff --git a/engines/titanic/input_handler.h b/engines/titanic/input_handler.h
index 461011f..ad1ba86 100644
--- a/engines/titanic/input_handler.h
+++ b/engines/titanic/input_handler.h
@@ -25,6 +25,7 @@
 
 #include "common/rect.h"
 #include "titanic/input_translator.h"
+#include "titanic/core/tree_item.h"
 
 namespace Titanic {
 
@@ -35,15 +36,24 @@ private:
 	/**
 	 * Process and dispatch a passed message
 	 */
-	void processMessage(const CMessage &msg);
+	void processMessage(const CMessage *msg);
+
+	/**
+	 * Dispatches a message to the project
+	 */
+	void dispatchMessage(const CMessage *msg);
+
+	/**
+	 * Called when a drag operation has ended
+	 */
+	void dragEnd(const Common::Point &mousePos, CTreeItem *dragItem);
 public:
 	CGameManager *_gameManager;
 	CInputTranslator *_inputTranslator;
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
-	int _field14;
+	bool _dragging;
+	bool _buttonDown;
+	CTreeItem *_dragItem;
+	Common::Point _dragStartPos;
 	Common::Point _mousePos;
 	int _lockCount;
 	int _field24;
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index e36b54d..fff392e 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -109,11 +109,15 @@ public:
 class CMouseDragMsg : public CMouseMsg {
 public:
 	CLASSDEF
+	CMouseDragMsg() : CMouseMsg() {}
+	CMouseDragMsg(const Common::Point &pt) : CMouseMsg(pt, 0) {}
 };
 
 class CMouseDragMoveMsg : public CMouseDragMsg {
 public:
 	CLASSDEF
+	CMouseDragMoveMsg() : CMouseDragMsg() {}
+	CMouseDragMoveMsg(const Common::Point &pt) : CMouseDragMsg(pt) {}
 
 	virtual bool handleMessage(const CMouseDragMoveMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
@@ -125,11 +129,13 @@ public:
 MSGTARGET(CMouseDragStartMsg);
 class CMouseDragStartMsg : public CMouseDragMsg {
 public:
-	int _field10;
+	CTreeItem *_dragItem;
 	int _field14;
 public:
 	CLASSDEF
-	CMouseDragStartMsg() : CMouseDragMsg(), _field10(0), _field14(0) {}
+	CMouseDragStartMsg() : CMouseDragMsg(), _dragItem(nullptr), _field14(0) {}
+	CMouseDragStartMsg(const Common::Point &pt) : CMouseDragMsg(pt),
+		_dragItem(nullptr), _field14(0) {}
 
 	virtual bool handleMessage(const CMouseDragStartMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
@@ -141,10 +147,12 @@ public:
 MSGTARGET(CMouseDragEndMsg);
 class CMouseDragEndMsg : public CMouseDragMsg {
 public:
-	int _field10;
+	CTreeItem *_dragItem;
 public:
 	CLASSDEF
-	CMouseDragEndMsg() : CMouseDragMsg(), _field10(0) {}
+	CMouseDragEndMsg() : CMouseDragMsg(), _dragItem(nullptr) {}
+	CMouseDragEndMsg(const Common::Point &pt, CTreeItem *dragItem = nullptr) :
+		CMouseDragMsg(pt), _dragItem(dragItem) {}
 
 	virtual bool handleMessage(const CMouseDragEndMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) {


Commit: 4f5202f958d55ccfda6e67a6b8933630de240e87
    https://github.com/scummvm/scummvm/commit/4f5202f958d55ccfda6e67a6b8933630de240e87
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-18T23:18:59-04:00

Commit Message:
TITANIC: Remove const prefix from passed messages

Turns out that some of the messages have properties that the objects
that handle them can set. For example, the CMouseDragStartMsg has a
_dragItem property that an item that allows dragging will explicitly
set, allowing the input handler to keep track of what was dragged.

Changed paths:
    engines/titanic/game/arboretum_gate.cpp
    engines/titanic/game/arboretum_gate.h
    engines/titanic/game/auto_animate.cpp
    engines/titanic/game/auto_animate.h
    engines/titanic/game/bar_bell.cpp
    engines/titanic/game/bar_bell.h
    engines/titanic/game/bomb.cpp
    engines/titanic/game/bomb.h
    engines/titanic/game/chicken_cooler.cpp
    engines/titanic/game/chicken_cooler.h
    engines/titanic/game/doorbot_elevator_handler.cpp
    engines/titanic/game/doorbot_elevator_handler.h
    engines/titanic/game/end_sequence_control.cpp
    engines/titanic/game/end_sequence_control.h
    engines/titanic/game/fan_noises.cpp
    engines/titanic/game/fan_noises.h
    engines/titanic/game/get_lift_eye2.cpp
    engines/titanic/game/get_lift_eye2.h
    engines/titanic/game/gondolier/gondolier_mixer.cpp
    engines/titanic/game/gondolier/gondolier_mixer.h
    engines/titanic/game/light.cpp
    engines/titanic/game/light.h
    engines/titanic/game/light_switch.cpp
    engines/titanic/game/light_switch.h
    engines/titanic/game/long_stick_dispenser.cpp
    engines/titanic/game/long_stick_dispenser.h
    engines/titanic/game/parrot/player_meets_parrot.cpp
    engines/titanic/game/parrot/player_meets_parrot.h
    engines/titanic/game/pet/pet_monitor.cpp
    engines/titanic/game/pet/pet_monitor.h
    engines/titanic/game/pet/pet_position.cpp
    engines/titanic/game/pet/pet_position.h
    engines/titanic/game/pet/pet_transport.cpp
    engines/titanic/game/pet/pet_transport.h
    engines/titanic/game/phonograph.cpp
    engines/titanic/game/phonograph.h
    engines/titanic/game/sgt/sgt_state_room.cpp
    engines/titanic/game/sgt/sgt_state_room.h
    engines/titanic/game/ship_setting.cpp
    engines/titanic/game/ship_setting.h
    engines/titanic/game/transport/lift.cpp
    engines/titanic/game/transport/lift.h
    engines/titanic/game/transport/lift_indicator.h
    engines/titanic/game/transport/pellerator.cpp
    engines/titanic/game/transport/pellerator.h
    engines/titanic/game/up_lighter.cpp
    engines/titanic/game/up_lighter.h
    engines/titanic/game/volume_control.cpp
    engines/titanic/game/volume_control.h
    engines/titanic/messages/bilge_dispensor_event.cpp
    engines/titanic/messages/bilge_dispensor_event.h
    engines/titanic/messages/messages.h
    engines/titanic/moves/enter_bridge.cpp
    engines/titanic/moves/enter_bridge.h
    engines/titanic/npcs/barbot.cpp
    engines/titanic/npcs/barbot.h
    engines/titanic/npcs/liftbot.cpp
    engines/titanic/npcs/liftbot.h
    engines/titanic/sound/auto_music_player.cpp
    engines/titanic/sound/auto_music_player.h
    engines/titanic/sound/music_player.cpp
    engines/titanic/sound/music_player.h
    engines/titanic/sound/node_auto_sound_player.cpp
    engines/titanic/sound/node_auto_sound_player.h
    engines/titanic/sound/restricted_auto_music_player.cpp
    engines/titanic/sound/restricted_auto_music_player.h
    engines/titanic/sound/room_auto_sound_player.cpp
    engines/titanic/sound/room_auto_sound_player.h
    engines/titanic/sound/room_trigger_auto_music_player.cpp
    engines/titanic/sound/room_trigger_auto_music_player.h
    engines/titanic/sound/titania_speech.cpp
    engines/titanic/sound/titania_speech.h



diff --git a/engines/titanic/game/arboretum_gate.cpp b/engines/titanic/game/arboretum_gate.cpp
index f4193b0..a892e65 100644
--- a/engines/titanic/game/arboretum_gate.cpp
+++ b/engines/titanic/game/arboretum_gate.cpp
@@ -133,17 +133,17 @@ void CArboretumGate::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CArboretumGate::handleEvent(const CActMsg &msg) { return false; }
-bool CArboretumGate::handleEvent(const CLeaveViewMsg &msg) { return false; }
-bool CArboretumGate::handleEvent(const CTurnOff &msg) { return false; }
-bool CArboretumGate::handleEvent(const CMouseButtonDownMsg &msg) { return false; }
+bool CArboretumGate::handleEvent(CActMsg &msg) { return false; }
+bool CArboretumGate::handleEvent(CLeaveViewMsg &msg) { return false; }
+bool CArboretumGate::handleEvent(CTurnOff &msg) { return false; }
+bool CArboretumGate::handleEvent(CMouseButtonDownMsg &msg) { return false; }
 
-bool CArboretumGate::handleEvent(const CEnterViewMsg &msg) {
+bool CArboretumGate::handleEvent(CEnterViewMsg &msg) {
 	warning("CArboretumGate::handleEvent");
 	return false;
 }
 
-bool CArboretumGate::handleEvent(const CTurnOn &msg) { return false; }
-bool CArboretumGate::handleEvent(const CMovieEndMsg &msg) { return false; }
+bool CArboretumGate::handleEvent(CTurnOn &msg) { return false; }
+bool CArboretumGate::handleEvent(CMovieEndMsg &msg) { return false; }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
index 514192e..7432799 100644
--- a/engines/titanic/game/arboretum_gate.h
+++ b/engines/titanic/game/arboretum_gate.h
@@ -69,13 +69,13 @@ private:
 	int _field150;
 	CString _string2;
 protected:
-	virtual bool handleEvent(const CActMsg &msg);
-	virtual bool handleEvent(const CLeaveViewMsg &msg);	
-	virtual bool handleEvent(const CTurnOff &msg);
-	virtual bool handleEvent(const CMouseButtonDownMsg &msg);
-	virtual bool handleEvent(const CEnterViewMsg &msg);
-	virtual bool handleEvent(const CTurnOn &msg);
-	virtual bool handleEvent(const CMovieEndMsg &msg);
+	virtual bool handleEvent(CActMsg &msg);
+	virtual bool handleEvent(CLeaveViewMsg &msg);	
+	virtual bool handleEvent(CTurnOff &msg);
+	virtual bool handleEvent(CMouseButtonDownMsg &msg);
+	virtual bool handleEvent(CEnterViewMsg &msg);
+	virtual bool handleEvent(CTurnOn &msg);
+	virtual bool handleEvent(CMovieEndMsg &msg);
 public:
 	CLASSDEF
 	CArboretumGate();
diff --git a/engines/titanic/game/auto_animate.cpp b/engines/titanic/game/auto_animate.cpp
index c79fa74..958200f 100644
--- a/engines/titanic/game/auto_animate.cpp
+++ b/engines/titanic/game/auto_animate.cpp
@@ -40,7 +40,7 @@ void CAutoAnimate::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CAutoAnimate::handleEvent(const CEnterViewMsg &msg) {
+bool CAutoAnimate::handleEvent(CEnterViewMsg &msg) {
 	warning("CAutoAnimate::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/auto_animate.h b/engines/titanic/game/auto_animate.h
index 160fe09..56e40a4 100644
--- a/engines/titanic/game/auto_animate.h
+++ b/engines/titanic/game/auto_animate.h
@@ -34,7 +34,7 @@ private:
 	int _fieldE4;
 	int _fieldE8;
 protected:
-	virtual bool handleEvent(const CEnterViewMsg &msg);
+	virtual bool handleEvent(CEnterViewMsg &msg);
 public:
 	CLASSDEF
 	CAutoAnimate() : CBackground(), _fieldE0(1), _fieldE4(1), _fieldE8(0) {}
diff --git a/engines/titanic/game/bar_bell.cpp b/engines/titanic/game/bar_bell.cpp
index 1639b7d..1ac7568 100644
--- a/engines/titanic/game/bar_bell.cpp
+++ b/engines/titanic/game/bar_bell.cpp
@@ -50,7 +50,7 @@ void CBarBell::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CBarBell::handleEvent(const CEnterRoomMsg &msg) {
+bool CBarBell::handleEvent(CEnterRoomMsg &msg) {
 	_fieldBC = 0;
 	return true;
 }
diff --git a/engines/titanic/game/bar_bell.h b/engines/titanic/game/bar_bell.h
index 432bf3a..111b0ac 100644
--- a/engines/titanic/game/bar_bell.h
+++ b/engines/titanic/game/bar_bell.h
@@ -36,7 +36,7 @@ public:
 	int _fieldC8;
 	int _fieldCC;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CBarBell();
diff --git a/engines/titanic/game/bomb.cpp b/engines/titanic/game/bomb.cpp
index e4cf1b3..a8bf15e 100644
--- a/engines/titanic/game/bomb.cpp
+++ b/engines/titanic/game/bomb.cpp
@@ -70,7 +70,7 @@ void CBomb::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CBomb::handleEvent(const CEnterRoomMsg &msg) {
+bool CBomb::handleEvent(CEnterRoomMsg &msg) {
 	_fieldE8 = 12;
 	_fieldEC = 9;
 	_fieldF0 = 0;
diff --git a/engines/titanic/game/bomb.h b/engines/titanic/game/bomb.h
index 4c7c952..9cbdf84 100644
--- a/engines/titanic/game/bomb.h
+++ b/engines/titanic/game/bomb.h
@@ -41,7 +41,7 @@ private:
 	int _startingTicks;
 	int _field104;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CBomb();
diff --git a/engines/titanic/game/chicken_cooler.cpp b/engines/titanic/game/chicken_cooler.cpp
index 54acc40..4ece0d6 100644
--- a/engines/titanic/game/chicken_cooler.cpp
+++ b/engines/titanic/game/chicken_cooler.cpp
@@ -40,7 +40,7 @@ void CChickenCooler::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CChickenCooler::handleEvent(const CEnterRoomMsg &msg) {
+bool CChickenCooler::handleEvent(CEnterRoomMsg &msg) {
 	warning("CChickenCoolor::handlEvent");
 	return true;
 }
diff --git a/engines/titanic/game/chicken_cooler.h b/engines/titanic/game/chicken_cooler.h
index 6f75649..210183a 100644
--- a/engines/titanic/game/chicken_cooler.h
+++ b/engines/titanic/game/chicken_cooler.h
@@ -33,7 +33,7 @@ private:
 	int _fieldBC;
 	int _fieldC0;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CChickenCooler() : CGameObject(), _fieldBC(0), _fieldC0(0) {}
diff --git a/engines/titanic/game/doorbot_elevator_handler.cpp b/engines/titanic/game/doorbot_elevator_handler.cpp
index b8cec40..718a464 100644
--- a/engines/titanic/game/doorbot_elevator_handler.cpp
+++ b/engines/titanic/game/doorbot_elevator_handler.cpp
@@ -40,7 +40,7 @@ void CDoorbotElevatorHandler::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CDoorbotElevatorHandler::handleEvent(const CEnterNodeMsg &msg) {
+bool CDoorbotElevatorHandler::handleEvent(CEnterNodeMsg &msg) {
 	warning("CDoorbotElevatorHandler::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/doorbot_elevator_handler.h b/engines/titanic/game/doorbot_elevator_handler.h
index 4c34248..04f3a75 100644
--- a/engines/titanic/game/doorbot_elevator_handler.h
+++ b/engines/titanic/game/doorbot_elevator_handler.h
@@ -33,7 +33,7 @@ private:
 	static int _v1;
 	int _value;
 protected:
-	virtual bool handleEvent(const CEnterNodeMsg &msg);
+	virtual bool handleEvent(CEnterNodeMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/end_sequence_control.cpp b/engines/titanic/game/end_sequence_control.cpp
index f930d61..c3f5a2a 100644
--- a/engines/titanic/game/end_sequence_control.cpp
+++ b/engines/titanic/game/end_sequence_control.cpp
@@ -34,7 +34,7 @@ void CEndSequenceControl::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CEndSequenceControl::handleEvent(const CEnterRoomMsg &msg) {
+bool CEndSequenceControl::handleEvent(CEnterRoomMsg &msg) {
 	warning("TODO: CEndSequenceControl::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/end_sequence_control.h b/engines/titanic/game/end_sequence_control.h
index fb1fa3a..d0ddd9c 100644
--- a/engines/titanic/game/end_sequence_control.h
+++ b/engines/titanic/game/end_sequence_control.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CEndSequenceControl : public CGameObject, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/fan_noises.cpp b/engines/titanic/game/fan_noises.cpp
index 6627332..7ec55c4 100644
--- a/engines/titanic/game/fan_noises.cpp
+++ b/engines/titanic/game/fan_noises.cpp
@@ -55,7 +55,7 @@ void CFanNoises::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CFanNoises::handleEvent(const CEnterRoomMsg &msg) {
+bool CFanNoises::handleEvent(CEnterRoomMsg &msg) {
 	warning("CFanNoises::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/fan_noises.h b/engines/titanic/game/fan_noises.h
index 2cd96a3..835d853 100644
--- a/engines/titanic/game/fan_noises.h
+++ b/engines/titanic/game/fan_noises.h
@@ -38,7 +38,7 @@ private:
 	int _fieldD0;
 	int _fieldD4;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CFanNoises();
diff --git a/engines/titanic/game/get_lift_eye2.cpp b/engines/titanic/game/get_lift_eye2.cpp
index bc51f7c..7894c5e 100644
--- a/engines/titanic/game/get_lift_eye2.cpp
+++ b/engines/titanic/game/get_lift_eye2.cpp
@@ -46,7 +46,7 @@ void CGetLiftEye2::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CGetLiftEye2::handleEvent(const CEnterRoomMsg &msg) {
+bool CGetLiftEye2::handleEvent(CEnterRoomMsg &msg) {
 	warning("CGetLiftEye2::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
index d9465b4..5803ad0 100644
--- a/engines/titanic/game/get_lift_eye2.h
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -31,7 +31,7 @@ class CGetLiftEye2 : public CGameObject, CEnterRoomMsgTarget {
 private:
 	static CString *_v1;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	static void init();
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.cpp b/engines/titanic/game/gondolier/gondolier_mixer.cpp
index 391c513..f4fb655 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.cpp
+++ b/engines/titanic/game/gondolier/gondolier_mixer.cpp
@@ -56,7 +56,7 @@ void CGondolierMixer::load(SimpleFile *file) {
 	CGondolierBase::load(file);
 }
 
-bool CGondolierMixer::handleEvent(const CEnterRoomMsg &msg) {
+bool CGondolierMixer::handleEvent(CEnterRoomMsg &msg) {
 	CTreeItem *parent = getParent();
 	if (parent == msg._room)
 		msg.execute(parent);
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.h b/engines/titanic/game/gondolier/gondolier_mixer.h
index ce8959b..1288290 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.h
+++ b/engines/titanic/game/gondolier/gondolier_mixer.h
@@ -38,7 +38,7 @@ private:
 	CString _string2;
 	int _fieldE4;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CGondolierMixer();
diff --git a/engines/titanic/game/light.cpp b/engines/titanic/game/light.cpp
index 7a24391..856e6a4 100644
--- a/engines/titanic/game/light.cpp
+++ b/engines/titanic/game/light.cpp
@@ -57,7 +57,7 @@ void CLight::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CLight::handleEvent(const CEnterRoomMsg &msg) {
+bool CLight::handleEvent(CEnterRoomMsg &msg) {
 	warning("CLight::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/light.h b/engines/titanic/game/light.h
index 650e6ba..42e7224 100644
--- a/engines/titanic/game/light.h
+++ b/engines/titanic/game/light.h
@@ -39,7 +39,7 @@ private:
 	int _fieldF8;
 	int _fieldFC;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLight();
diff --git a/engines/titanic/game/light_switch.cpp b/engines/titanic/game/light_switch.cpp
index 5e1b94a..b857bfb 100644
--- a/engines/titanic/game/light_switch.cpp
+++ b/engines/titanic/game/light_switch.cpp
@@ -50,7 +50,7 @@ void CLightSwitch::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CLightSwitch::handleEvent(const CEnterRoomMsg &msg) {
+bool CLightSwitch::handleEvent(CEnterRoomMsg &msg) {
 	warning("CLightSwitch::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/light_switch.h b/engines/titanic/game/light_switch.h
index fd2c392..1cda539 100644
--- a/engines/titanic/game/light_switch.h
+++ b/engines/titanic/game/light_switch.h
@@ -36,7 +36,7 @@ private:
 	int _fieldE4;
 	int _fieldE8;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLightSwitch();
diff --git a/engines/titanic/game/long_stick_dispenser.cpp b/engines/titanic/game/long_stick_dispenser.cpp
index 237c1f6..5d7df1d 100644
--- a/engines/titanic/game/long_stick_dispenser.cpp
+++ b/engines/titanic/game/long_stick_dispenser.cpp
@@ -42,7 +42,7 @@ void CLongStickDispenser::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CLongStickDispenser::handleEvent(const CEnterRoomMsg &msg) {
+bool CLongStickDispenser::handleEvent(CEnterRoomMsg &msg) {
 	_fieldC0 = 0;
 	_fieldC4 = 1;
 	return true;
diff --git a/engines/titanic/game/long_stick_dispenser.h b/engines/titanic/game/long_stick_dispenser.h
index 75ada29..14785a7 100644
--- a/engines/titanic/game/long_stick_dispenser.h
+++ b/engines/titanic/game/long_stick_dispenser.h
@@ -34,7 +34,7 @@ private:
 	int _fieldC0;
 	int _fieldC4;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLongStickDispenser() : CGameObject(), _fieldBC(0),
diff --git a/engines/titanic/game/parrot/player_meets_parrot.cpp b/engines/titanic/game/parrot/player_meets_parrot.cpp
index 70628b3..adb2dc5 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.cpp
+++ b/engines/titanic/game/parrot/player_meets_parrot.cpp
@@ -34,7 +34,7 @@ void CPlayerMeetsParrot::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CPlayerMeetsParrot::handleEvent(const CEnterRoomMsg &msg) {
+bool CPlayerMeetsParrot::handleEvent(CEnterRoomMsg &msg) {
 	warning("CPlayerMeetsParrot::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/parrot/player_meets_parrot.h b/engines/titanic/game/parrot/player_meets_parrot.h
index 8572fd7..9b8138f 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.h
+++ b/engines/titanic/game/parrot/player_meets_parrot.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CPlayerMeetsParrot : public CGameObject, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_monitor.cpp b/engines/titanic/game/pet/pet_monitor.cpp
index 649ac97..44d24f2 100644
--- a/engines/titanic/game/pet/pet_monitor.cpp
+++ b/engines/titanic/game/pet/pet_monitor.cpp
@@ -34,7 +34,7 @@ void CPETMonitor::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CPETMonitor::handleEvent(const CEnterRoomMsg &msg) {
+bool CPETMonitor::handleEvent(CEnterRoomMsg &msg) {
 	warning("CPETMonitor::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/pet/pet_monitor.h b/engines/titanic/game/pet/pet_monitor.h
index 97961ee..1d66a58 100644
--- a/engines/titanic/game/pet/pet_monitor.h
+++ b/engines/titanic/game/pet/pet_monitor.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CPETMonitor : public CGameObject, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_position.cpp b/engines/titanic/game/pet/pet_position.cpp
index aafc21b..b25111f 100644
--- a/engines/titanic/game/pet/pet_position.cpp
+++ b/engines/titanic/game/pet/pet_position.cpp
@@ -34,7 +34,7 @@ void CPETPosition::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CPETPosition::handleEvent(const CEnterRoomMsg &msg) {
+bool CPETPosition::handleEvent(CEnterRoomMsg &msg) {
 	warning("CPETPosition::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/pet/pet_position.h b/engines/titanic/game/pet/pet_position.h
index d72f42c..8a06239 100644
--- a/engines/titanic/game/pet/pet_position.h
+++ b/engines/titanic/game/pet/pet_position.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CPETPosition : public CGameObject, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_transport.cpp b/engines/titanic/game/pet/pet_transport.cpp
index 40cc155..a88b703 100644
--- a/engines/titanic/game/pet/pet_transport.cpp
+++ b/engines/titanic/game/pet/pet_transport.cpp
@@ -34,7 +34,7 @@ void CPETTransport::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CPETTransport::handleEvent(const CEnterRoomMsg &msg) {
+bool CPETTransport::handleEvent(CEnterRoomMsg &msg) {
 	warning("CPETTransport::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/pet/pet_transport.h b/engines/titanic/game/pet/pet_transport.h
index 1eb4832..3dc856d 100644
--- a/engines/titanic/game/pet/pet_transport.h
+++ b/engines/titanic/game/pet/pet_transport.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CPETTransport : public CGameObject, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp
index 2ff8ca9..f7a696e 100644
--- a/engines/titanic/game/phonograph.cpp
+++ b/engines/titanic/game/phonograph.cpp
@@ -55,7 +55,7 @@ void CPhonograph::load(SimpleFile *file) {
 	CMusicPlayer::load(file);
 }
 
-bool CPhonograph::handleEvent(const CEnterRoomMsg &msg) {
+bool CPhonograph::handleEvent(CEnterRoomMsg &msg) {
 	warning("CPhonograph::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/phonograph.h b/engines/titanic/game/phonograph.h
index 157bd44..6efe10b 100644
--- a/engines/titanic/game/phonograph.h
+++ b/engines/titanic/game/phonograph.h
@@ -38,7 +38,7 @@ protected:
 	int _fieldF0;
 	int _fieldF4;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CPhonograph();
diff --git a/engines/titanic/game/sgt/sgt_state_room.cpp b/engines/titanic/game/sgt/sgt_state_room.cpp
index a6dc523..cf735dd 100644
--- a/engines/titanic/game/sgt/sgt_state_room.cpp
+++ b/engines/titanic/game/sgt/sgt_state_room.cpp
@@ -90,7 +90,7 @@ void CSGTStateRoom::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CSGTStateRoom::handleEvent(const CEnterRoomMsg &msg) {
+bool CSGTStateRoom::handleEvent(CEnterRoomMsg &msg) {
 	warning("CSGTStateRoom::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/sgt/sgt_state_room.h b/engines/titanic/game/sgt/sgt_state_room.h
index dbe4538..4ec1617 100644
--- a/engines/titanic/game/sgt/sgt_state_room.h
+++ b/engines/titanic/game/sgt/sgt_state_room.h
@@ -55,7 +55,7 @@ private:
 	int _fieldEC;
 	int _fieldF0;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CSGTStateRoom();
diff --git a/engines/titanic/game/ship_setting.cpp b/engines/titanic/game/ship_setting.cpp
index 7a3951d..6d12e59 100644
--- a/engines/titanic/game/ship_setting.cpp
+++ b/engines/titanic/game/ship_setting.cpp
@@ -48,7 +48,7 @@ void CShipSetting::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CShipSetting::handleEvent(const CEnterRoomMsg &msg) {
+bool CShipSetting::handleEvent(CEnterRoomMsg &msg) {
 	warning("CShipSetting::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/ship_setting.h b/engines/titanic/game/ship_setting.h
index 30780fd..cbf4e9f 100644
--- a/engines/titanic/game/ship_setting.h
+++ b/engines/titanic/game/ship_setting.h
@@ -35,7 +35,7 @@ private:
 	CString _string4;
 	CString _string5;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CShipSetting();
diff --git a/engines/titanic/game/transport/lift.cpp b/engines/titanic/game/transport/lift.cpp
index 2220129..edf69fe 100644
--- a/engines/titanic/game/transport/lift.cpp
+++ b/engines/titanic/game/transport/lift.cpp
@@ -57,7 +57,7 @@ void CLift::load(SimpleFile *file) {
 	CTransport::load(file);
 }
 
-bool CLift::handleEvent(const CEnterRoomMsg &msg) {
+bool CLift::handleEvent(CEnterRoomMsg &msg) {
 	warning("CLift::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h
index 42a340c..439e65b 100644
--- a/engines/titanic/game/transport/lift.h
+++ b/engines/titanic/game/transport/lift.h
@@ -39,7 +39,7 @@ private:
 
 	int _fieldF8;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLift() : CTransport(), _fieldF8(1) {}
diff --git a/engines/titanic/game/transport/lift_indicator.h b/engines/titanic/game/transport/lift_indicator.h
index b707fbb..161f032 100644
--- a/engines/titanic/game/transport/lift_indicator.h
+++ b/engines/titanic/game/transport/lift_indicator.h
@@ -35,7 +35,7 @@ private:
 	int _field108;
 	int _field10C;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg) { return true; }
+	virtual bool handleEvent(CEnterRoomMsg &msg) { return true; }
 public:
 	CLASSDEF
 	CLiftindicator();
diff --git a/engines/titanic/game/transport/pellerator.cpp b/engines/titanic/game/transport/pellerator.cpp
index 99c4db3..16f4277 100644
--- a/engines/titanic/game/transport/pellerator.cpp
+++ b/engines/titanic/game/transport/pellerator.cpp
@@ -43,7 +43,7 @@ void CPellerator::load(SimpleFile *file) {
 	CTransport::load(file);
 }
 
-bool CPellerator::handleEvent(const CEnterRoomMsg &msg) {
+bool CPellerator::handleEvent(CEnterRoomMsg &msg) {
 	warning("CPellerator::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/transport/pellerator.h b/engines/titanic/game/transport/pellerator.h
index 502af24..c997373 100644
--- a/engines/titanic/game/transport/pellerator.h
+++ b/engines/titanic/game/transport/pellerator.h
@@ -33,7 +33,7 @@ private:
 	static int _v1;
 	static int _v2;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/up_lighter.cpp b/engines/titanic/game/up_lighter.cpp
index beb159f..817b179 100644
--- a/engines/titanic/game/up_lighter.cpp
+++ b/engines/titanic/game/up_lighter.cpp
@@ -48,7 +48,7 @@ void CUpLighter::load(SimpleFile *file) {
 	CDropTarget::load(file);
 }
 
-bool CUpLighter::handleEvent(const CEnterRoomMsg &msg) {
+bool CUpLighter::handleEvent(CEnterRoomMsg &msg) {
 	warning("CUpLighter::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/up_lighter.h b/engines/titanic/game/up_lighter.h
index 15fa14c..6c722dd 100644
--- a/engines/titanic/game/up_lighter.h
+++ b/engines/titanic/game/up_lighter.h
@@ -35,7 +35,7 @@ private:
 	int _field120;
 	int _field124;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CUpLighter();
diff --git a/engines/titanic/game/volume_control.cpp b/engines/titanic/game/volume_control.cpp
index 26f89a7..801dfd1 100644
--- a/engines/titanic/game/volume_control.cpp
+++ b/engines/titanic/game/volume_control.cpp
@@ -45,7 +45,7 @@ void CVolumeControl::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CVolumeControl::handleEvent(const CEnterNodeMsg &msg) {
+bool CVolumeControl::handleEvent(CEnterNodeMsg &msg) {
 	warning("CVolumeControl::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/volume_control.h b/engines/titanic/game/volume_control.h
index 8fa7d01..f3f6a75 100644
--- a/engines/titanic/game/volume_control.h
+++ b/engines/titanic/game/volume_control.h
@@ -34,7 +34,7 @@ private:
 	CString _string1;
 	int _fieldCC;
 protected:
-	virtual bool handleEvent(const CEnterNodeMsg &msg);
+	virtual bool handleEvent(CEnterNodeMsg &msg);
 public:
 	CLASSDEF
 	CVolumeControl();
diff --git a/engines/titanic/messages/bilge_dispensor_event.cpp b/engines/titanic/messages/bilge_dispensor_event.cpp
index c4c8375..c20fe10 100644
--- a/engines/titanic/messages/bilge_dispensor_event.cpp
+++ b/engines/titanic/messages/bilge_dispensor_event.cpp
@@ -34,7 +34,7 @@ void CBilgeDispensorEvent::load(SimpleFile *file) {
 	CAutoSoundEvent::load(file);
 }
 
-bool CBilgeDispensorEvent::handleEvent(const CEnterRoomMsg &msg) {
+bool CBilgeDispensorEvent::handleEvent(CEnterRoomMsg &msg) {
 	_value1 = 0;
 	return true;
 }
diff --git a/engines/titanic/messages/bilge_dispensor_event.h b/engines/titanic/messages/bilge_dispensor_event.h
index 4334465..9f91b61 100644
--- a/engines/titanic/messages/bilge_dispensor_event.h
+++ b/engines/titanic/messages/bilge_dispensor_event.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CBilgeDispensorEvent : public CAutoSoundEvent {
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index d221443..d89b0e1 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -38,7 +38,7 @@ enum MessageFlag {
 };
 
 #define MSGTARGET(NAME) class NAME; class NAME##Target { public: \
-	virtual bool handleEvent(const NAME &msg) = 0; }
+	virtual bool handleEvent(NAME &msg) = 0; }
 
 class CMessage : public CSaveableObject {
 public:
diff --git a/engines/titanic/moves/enter_bridge.cpp b/engines/titanic/moves/enter_bridge.cpp
index 6f8ba4c..359cfcb 100644
--- a/engines/titanic/moves/enter_bridge.cpp
+++ b/engines/titanic/moves/enter_bridge.cpp
@@ -36,7 +36,7 @@ void CEnterBridge::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CEnterBridge::handleEvent(const CEnterRoomMsg &msg) {
+bool CEnterBridge::handleEvent(CEnterRoomMsg &msg) {
 	warning("CEnterBridge::handlEvent");
 	return true;
 }
diff --git a/engines/titanic/moves/enter_bridge.h b/engines/titanic/moves/enter_bridge.h
index 3685bed..39343ef 100644
--- a/engines/titanic/moves/enter_bridge.h
+++ b/engines/titanic/moves/enter_bridge.h
@@ -32,7 +32,7 @@ class CEnterBridge : public CGameObject, CEnterRoomMsgTarget {
 private:
 	int _value;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CEnterBridge() : CGameObject(), _value(1) {}
diff --git a/engines/titanic/npcs/barbot.cpp b/engines/titanic/npcs/barbot.cpp
index c9a96b9..907d3c0 100644
--- a/engines/titanic/npcs/barbot.cpp
+++ b/engines/titanic/npcs/barbot.cpp
@@ -233,7 +233,7 @@ void CBarbot::load(SimpleFile *file) {
 	CTrueTalkNPC::load(file);
 }
 
-bool CBarbot::handleEvent(const CEnterRoomMsg &msg) {
+bool CBarbot::handleEvent(CEnterRoomMsg &msg) {
 	warning("TODO: Barbot::CEnterRoomMsg");
 	return true;
 }
diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h
index 160edd6..442578e 100644
--- a/engines/titanic/npcs/barbot.h
+++ b/engines/titanic/npcs/barbot.h
@@ -174,7 +174,7 @@ private:
 	int _field33C;
 	int _field340;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CBarbot();
diff --git a/engines/titanic/npcs/liftbot.cpp b/engines/titanic/npcs/liftbot.cpp
index 76a48f0..dfc0a4f 100644
--- a/engines/titanic/npcs/liftbot.cpp
+++ b/engines/titanic/npcs/liftbot.cpp
@@ -48,7 +48,7 @@ void CLiftBot::load(SimpleFile *file) {
 	CTrueTalkNPC::load(file);
 }
 
-bool CLiftBot::handleEvent(const CEnterRoomMsg &msg) {
+bool CLiftBot::handleEvent(CEnterRoomMsg &msg) {
 	warning("CLiftBot::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/npcs/liftbot.h b/engines/titanic/npcs/liftbot.h
index 81c5399..3a41bf3 100644
--- a/engines/titanic/npcs/liftbot.h
+++ b/engines/titanic/npcs/liftbot.h
@@ -35,7 +35,7 @@ private:
 private:
 	int _field108;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLiftBot();
diff --git a/engines/titanic/sound/auto_music_player.cpp b/engines/titanic/sound/auto_music_player.cpp
index 97c59d0..638cac8 100644
--- a/engines/titanic/sound/auto_music_player.cpp
+++ b/engines/titanic/sound/auto_music_player.cpp
@@ -41,7 +41,7 @@ void CAutoMusicPlayer::load(SimpleFile *file) {
 	CAutoMusicPlayerBase::load(file);
 }
 
-bool CAutoMusicPlayer::handleEvent(const CEnterRoomMsg &msg) {
+bool CAutoMusicPlayer::handleEvent(CEnterRoomMsg &msg) {
 	if (!_fieldCC) {
 		warning("TODO");
 	}
diff --git a/engines/titanic/sound/auto_music_player.h b/engines/titanic/sound/auto_music_player.h
index 6fdf376..d2f42ac 100644
--- a/engines/titanic/sound/auto_music_player.h
+++ b/engines/titanic/sound/auto_music_player.h
@@ -32,7 +32,7 @@ class CAutoMusicPlayer : public CAutoMusicPlayerBase, CEnterRoomMsgTarget {
 private:
 	CString _string2;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CAutoMusicPlayer();
diff --git a/engines/titanic/sound/music_player.cpp b/engines/titanic/sound/music_player.cpp
index e2299e6..25f73b0 100644
--- a/engines/titanic/sound/music_player.cpp
+++ b/engines/titanic/sound/music_player.cpp
@@ -44,7 +44,7 @@ void CMusicPlayer::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CMusicPlayer::handleEvent(const CEnterRoomMsg &msg) {
+bool CMusicPlayer::handleEvent(CEnterRoomMsg &msg) {
 	warning("TODO: CMusicPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/music_player.h b/engines/titanic/sound/music_player.h
index 1796a25..96a6968 100644
--- a/engines/titanic/sound/music_player.h
+++ b/engines/titanic/sound/music_player.h
@@ -35,7 +35,7 @@ protected:
 	int _fieldCC;
 	int _fieldD0;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CMusicPlayer() : CGameObject(),
diff --git a/engines/titanic/sound/node_auto_sound_player.cpp b/engines/titanic/sound/node_auto_sound_player.cpp
index 5709cf5..0ef6c8d 100644
--- a/engines/titanic/sound/node_auto_sound_player.cpp
+++ b/engines/titanic/sound/node_auto_sound_player.cpp
@@ -36,7 +36,7 @@ void CNodeAutoSoundPlayer::load(SimpleFile *file) {
 	CAutoSoundPlayer::load(file);
 }
 
-bool CNodeAutoSoundPlayer::handleEvent(const CEnterNodeMsg &msg) {
+bool CNodeAutoSoundPlayer::handleEvent(CEnterNodeMsg &msg) {
 	warning("CNodeAutoSoundPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/node_auto_sound_player.h b/engines/titanic/sound/node_auto_sound_player.h
index c635d7e..258aa47 100644
--- a/engines/titanic/sound/node_auto_sound_player.h
+++ b/engines/titanic/sound/node_auto_sound_player.h
@@ -32,7 +32,7 @@ class CNodeAutoSoundPlayer : public CAutoSoundPlayer, CEnterNodeMsgTarget {
 private:
 	int _fieldEC;
 protected:
-	virtual bool handleEvent(const CEnterNodeMsg &msg);
+	virtual bool handleEvent(CEnterNodeMsg &msg);
 public:
 	CLASSDEF
 	CNodeAutoSoundPlayer() : CAutoSoundPlayer(), _fieldEC(1) {}
diff --git a/engines/titanic/sound/restricted_auto_music_player.cpp b/engines/titanic/sound/restricted_auto_music_player.cpp
index a57769b..2ee8f2d 100644
--- a/engines/titanic/sound/restricted_auto_music_player.cpp
+++ b/engines/titanic/sound/restricted_auto_music_player.cpp
@@ -44,7 +44,7 @@ void CRestrictedAutoMusicPlayer::load(SimpleFile *file) {
 	CAutoMusicPlayer::load(file);
 }
 
-bool CRestrictedAutoMusicPlayer::handleEvent(const CEnterRoomMsg &msg) {
+bool CRestrictedAutoMusicPlayer::handleEvent(CEnterRoomMsg &msg) {
 	warning("CRestrictedAutoMusicPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/restricted_auto_music_player.h b/engines/titanic/sound/restricted_auto_music_player.h
index a9f17d8..efb3dc2 100644
--- a/engines/titanic/sound/restricted_auto_music_player.h
+++ b/engines/titanic/sound/restricted_auto_music_player.h
@@ -35,7 +35,7 @@ private:
 	CString _string5;
 	CString _string6;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/sound/room_auto_sound_player.cpp b/engines/titanic/sound/room_auto_sound_player.cpp
index b8557aa..549f27b 100644
--- a/engines/titanic/sound/room_auto_sound_player.cpp
+++ b/engines/titanic/sound/room_auto_sound_player.cpp
@@ -34,7 +34,7 @@ void CRoomAutoSoundPlayer::load(SimpleFile *file) {
 	CAutoSoundPlayer::load(file);
 }
 
-bool CRoomAutoSoundPlayer::handleEvent(const CEnterRoomMsg &msg) {
+bool CRoomAutoSoundPlayer::handleEvent(CEnterRoomMsg &msg) {
 	warning("CRoomAutoSoundPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/room_auto_sound_player.h b/engines/titanic/sound/room_auto_sound_player.h
index bda9727..a3ec35c 100644
--- a/engines/titanic/sound/room_auto_sound_player.h
+++ b/engines/titanic/sound/room_auto_sound_player.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CRoomAutoSoundPlayer : public CAutoSoundPlayer, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/sound/room_trigger_auto_music_player.cpp b/engines/titanic/sound/room_trigger_auto_music_player.cpp
index 9e4da68..3c0ac05 100644
--- a/engines/titanic/sound/room_trigger_auto_music_player.cpp
+++ b/engines/titanic/sound/room_trigger_auto_music_player.cpp
@@ -34,7 +34,7 @@ void CRoomTriggerAutoMusicPlayer::load(SimpleFile *file) {
 	CTriggerAutoMusicPlayer::load(file);
 }
 
-bool CRoomTriggerAutoMusicPlayer::handleEvent(const CEnterRoomMsg &msg) {
+bool CRoomTriggerAutoMusicPlayer::handleEvent(CEnterRoomMsg &msg) {
 	warning("CRoomTriggerAutoMusicPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/room_trigger_auto_music_player.h b/engines/titanic/sound/room_trigger_auto_music_player.h
index 1915f92..9a478a0 100644
--- a/engines/titanic/sound/room_trigger_auto_music_player.h
+++ b/engines/titanic/sound/room_trigger_auto_music_player.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CRoomTriggerAutoMusicPlayer : public CTriggerAutoMusicPlayer, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/sound/titania_speech.cpp b/engines/titanic/sound/titania_speech.cpp
index 87ab18a..16a88e4 100644
--- a/engines/titanic/sound/titania_speech.cpp
+++ b/engines/titanic/sound/titania_speech.cpp
@@ -40,7 +40,7 @@ void CTitaniaSpeech::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CTitaniaSpeech::handleEvent(const CEnterRoomMsg &msg) {
+bool CTitaniaSpeech::handleEvent(CEnterRoomMsg &msg) {
 	warning("CTitaniaSpeech::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/titania_speech.h b/engines/titanic/sound/titania_speech.h
index a981029..09a8495 100644
--- a/engines/titanic/sound/titania_speech.h
+++ b/engines/titanic/sound/titania_speech.h
@@ -32,7 +32,7 @@ class CTitaniaSpeech : public CGameObject {
 private:
 	int _value1, _value2;
 protected:
-	virtual bool handleEvent(const CEnterRoomMsg &msg);
+	virtual bool handleEvent(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CTitaniaSpeech() : CGameObject(), _value1(1), _value2(0) {}


Commit: c864deee1cdafdfd9201af3706dafff644e39908
    https://github.com/scummvm/scummvm/commit/c864deee1cdafdfd9201af3706dafff644e39908
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-18T23:28:11-04:00

Commit Message:
TITANIC: Implement more events in CInputTranslator

Changed paths:
    engines/titanic/input_translator.cpp



diff --git a/engines/titanic/input_translator.cpp b/engines/titanic/input_translator.cpp
index 8b12646..bd33f20 100644
--- a/engines/titanic/input_translator.cpp
+++ b/engines/titanic/input_translator.cpp
@@ -50,39 +50,48 @@ void CInputTranslator::mouseMove(int special, const Common::Point &pt) {
 }
 
 void CInputTranslator::leftButtonDown(int special, const Common::Point &pt) {
-
+	CMouseButtonDownMsg msg(pt, getButtons(special));
+	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::leftButtonUp(int special, const Common::Point &pt) {
-
+	CMouseButtonUpMsg msg(pt, getButtons(special));
+	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::leftButtonDoubleClick(int special, const Common::Point &pt) {
-
+	CMouseButtonDoubleClickMsg msg(pt, getButtons(special));
+	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::middleButtonDown(int special, const Common::Point &pt) {
-
+	CMouseButtonDownMsg msg(pt, getButtons(special));
+	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::middleButtonUp(int special, const Common::Point &pt) {
-
+	CMouseButtonUpMsg msg(pt, getButtons(special));
+	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::middleButtonDoubleClick(int special, const Common::Point &pt) {
-
+	CMouseButtonDoubleClickMsg msg(pt, getButtons(special));
+	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::rightButtonDown(int special, const Common::Point &pt) {
-
+	CMouseButtonDownMsg msg(pt, getButtons(special));
+	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::rightButtonUp(int special, const Common::Point &pt) {
-
+	CMouseButtonUpMsg msg(pt, getButtons(special));
+	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::rightButtonDoubleClick(int special, const Common::Point &pt) {
-
+	CMouseButtonDoubleClickMsg msg(pt, getButtons(special));
+	_inputHandler->handleMessage(msg);
 }
 
 } // End of namespace Titanic


Commit: abb9a549c86b9c83925cd41f02b27e3e88162b9b
    https://github.com/scummvm/scummvm/commit/abb9a549c86b9c83925cd41f02b27e3e88162b9b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-18T23:36:54-04:00

Commit Message:
TITANIC: Enable event handlng

Changed paths:
    engines/titanic/main_game_window.cpp



diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 429991d..a6a5dca 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -55,8 +55,10 @@ void CMainGameWindow::applicationStarting() {
 	// Set the video mode
 	CScreenManager *screenManager = CScreenManager::setCurrent();
 	screenManager->setMode(640, 480, 16, 1, true);
+	_inputAllowed = true;
+
+	// TODO: Remove initial background and palette
 
-	// TODO: Clear surfaces
 
 	// Create game view and manager
 	_gameView = new CSTGameView(this);


Commit: 3a42c8ca449248dfc67a98f3bedd65c237d06fa0
    https://github.com/scummvm/scummvm/commit/3a42c8ca449248dfc67a98f3bedd65c237d06fa0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-19T07:48:23-04:00

Commit Message:
TITANIC: Added various preLoad methods

Changed paths:
    engines/titanic/core/project_item.cpp
    engines/titanic/core/project_item.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/sound/music_room.cpp
    engines/titanic/sound/music_room.h
    engines/titanic/sound/sound.cpp
    engines/titanic/sound/sound.h
    engines/titanic/sound/sound_manager.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index bf31388..90e6d06 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -142,8 +142,9 @@ void CProjectItem::resetGameManager() {
 void CProjectItem::loadGame(int slotId) {
 	CompressedFile file;
 
-	// Clear any existing project contents
+	// Clear any existing project contents and call preload code
 	clear();
+	preLoad();
 
 	// Open either an existing savegame slot or the new game template
 	if (slotId >= 0) {
@@ -272,6 +273,11 @@ void CProjectItem::saveData(SimpleFile *file, CTreeItem *item) const {
 	}
 }
 
+void CProjectItem::preLoad() {
+	if (_gameManager)
+		_gameManager->preLoad();
+}
+
 void CProjectItem::postLoad() {
 	CGameManager *gameManager = getGameManager();
 	if (gameManager)
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index bb96f81..87dfc3f 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -54,7 +54,6 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);	
-	
 };
 
 /**
@@ -78,6 +77,16 @@ private:
 	 * Called during save, iterates through the children to do some stuff
 	 */
 	void buildFilesList();
+	
+	/**
+	 * Called at the beginning of loading a game
+	 */
+	void preLoad();
+
+	/**
+	 * Does post-loading processing
+	 */
+	void postLoad();
 
 	/**
 	 * Finds the first child instance of a given class type
@@ -98,11 +107,6 @@ private:
 	 * Save project data to the passed file
 	 */
 	void saveData(SimpleFile *file, CTreeItem *item) const;
-
-	/**
-	 * Does post-loading processing
-	 */
-	void postLoad();
 public:
 	CLASSDEF
 	CProjectItem();
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index a2732d8..b181edc 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -48,7 +48,7 @@ CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
 		_inputHandler(this), _inputTranslator(&_inputHandler),		
 		_gameState(this), _sound(this), _musicRoom(this),
 		_field30(0), _field34(0), _field4C(0), 
-		_dragItem(nullptr), _field54(0), _tickCount1(0), _tickCount2(0) {
+		_dragItem(nullptr), _field54(0), _lastDiskTicksCount(0), _tickCount2(0) {
 	
 	_videoSurface1 = nullptr;
 	_videoSurface2 = CScreenManager::_screenManagerPtr->createSurface(600, 340);
@@ -65,6 +65,15 @@ void CGameManager::load(SimpleFile *file) {
 	_sound.load(file);
 }
 
+void CGameManager::preLoad() {
+	updateDiskTicksCount();
+	_list.destroyContents();
+	_field34 = 0;
+
+	_trueTalkManager.preLoad();
+	_sound.preLoad();
+}
+
 void CGameManager::postLoad(CProjectItem *project) {
 	if (_gameView) {
 		_gameView->postLoad();
@@ -77,11 +86,11 @@ void CGameManager::postLoad(CProjectItem *project) {
 	}
 	
 	// Signal to anything interested that the game has been loaded
-	CLoadSuccessMsg msg(_tickCount1 - _tickCount2);
+	CLoadSuccessMsg msg(_lastDiskTicksCount - _tickCount2);
 	msg.execute(project, nullptr, MSGFLAG_SCAN);
 
 	// Signal to any registered list items
-	_list.postLoad(_tickCount1, _project);
+	_list.postLoad(_lastDiskTicksCount, _project);
 
 	// Signal the true talk manager and sound
 	_trueTalkManager.postLoad();
@@ -100,4 +109,8 @@ void CGameManager::update() {
 	warning("TODO: CGameManager::update");
 }
 
+void CGameManager::updateDiskTicksCount() {
+	_lastDiskTicksCount = g_vm->_events->getTicksCount();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index a331f3a..4380e4f 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -54,7 +54,6 @@ class CGameManager {
 private:
 	CGameView *_gameView;
 	CSound _sound;
-	CMusicRoom _musicRoom;
 	CTrueTalkManager _trueTalkManager;
 	CGameManagerList _list;
 	int _field30;
@@ -63,7 +62,7 @@ private:
 	int _field4C;
 	int _field54;
 	CVideoSurface *_videoSurface2;
-	uint _tickCount1;
+	uint _lastDiskTicksCount;
 	uint _tickCount2;
 public:
 	CProjectItem *_project;
@@ -72,6 +71,7 @@ public:
 	CInputHandler _inputHandler;
 	CInputTranslator _inputTranslator;
 	CTreeItem *_dragItem;
+	CMusicRoom _musicRoom;
 public:
 	CGameManager(CProjectItem *project, CGameView *gameView);
 	~CGameManager();
@@ -82,10 +82,20 @@ public:
 	void load(SimpleFile *file);
 
 	/**
+	 * Called when a game is about to be loaded
+	 */
+	void preLoad();
+
+	/**
 	 * Called after loading a game has finished
 	 */
 	void postLoad(CProjectItem *project);
 
+	/**
+	 * Updates the game time when the last disk access started
+	 */
+	void updateDiskTicksCount();
+
 	CViewItem *getView() { return _gameState._gameLocation.getView(); }
 
 	/**
diff --git a/engines/titanic/sound/music_room.cpp b/engines/titanic/sound/music_room.cpp
index 2b959a0..593c572 100644
--- a/engines/titanic/sound/music_room.cpp
+++ b/engines/titanic/sound/music_room.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/sound/music_room.h"
+#include "common/textconsole.h"
 
 namespace Titanic {
 
@@ -28,4 +29,8 @@ CMusicRoom::CMusicRoom(CGameManager *gameManager) :
 		_gameManager(gameManager) {
 }
 
+void CMusicRoom::preLoad() {
+	warning("TODO: CMusicRoom::preLoad");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/music_room.h b/engines/titanic/sound/music_room.h
index 7fcd99d..ce262a2 100644
--- a/engines/titanic/sound/music_room.h
+++ b/engines/titanic/sound/music_room.h
@@ -32,6 +32,11 @@ public:
 	CGameManager *_gameManager;
 public:
 	CMusicRoom(CGameManager *owner);
+
+	/**
+	 * Called when a game is about to be loaded
+	 */
+	void preLoad();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index 35c1c70..062e43d 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/sound/sound.h"
+#include "titanic/game_manager.h"
 
 namespace Titanic {
 
@@ -35,4 +36,11 @@ void CSound::load(SimpleFile *file) {
 	_soundManager.load(file);
 }
 
+void CSound::preLoad() {
+	_soundManager.preLoad();
+
+	if (_gameManager)
+		_gameManager->_musicRoom.preLoad();
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index a78bc79..1b98507 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -48,6 +48,11 @@ public:
 	void load(SimpleFile *file);
 
 	/**
+	 * Called when a game is about to be loaded
+	 */
+	void preLoad();
+
+	/**
 	 * Called when loading a game is complete
 	 */
 	void postLoad() { _soundManager.postLoad(); }
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index cb88b66..6a2e5a7 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -57,7 +57,11 @@ public:
 	virtual void proc20(int v) { _field8 = v; }
 	virtual void proc21(int v) { _fieldC = v; }
 	virtual void proc22(int v) { _field10 = v; }
-	virtual void proc23() { proc10(); }
+
+	/**
+	 * Called when a game is about to be loaded
+	 */
+	virtual void preLoad() { proc10(); }
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index f176b2f..5afaeb3 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -175,4 +175,8 @@ void CTrueTalkManager::saveNPC(SimpleFile *file, int charId) const {
 	}
 }
 
+void CTrueTalkManager::preLoad() {
+	warning("TODO: CTrueTalkManager::preLoad");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 904f3c4..ac36102 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -78,6 +78,11 @@ public:
 	void load(SimpleFile *file);
 
 	/**
+	 * Called when a game is about to be loaded
+	 */
+	void preLoad();
+
+	/**
 	 * Called when loading a game is complete
 	 */
 	void postLoad() {}


Commit: 2665e0e08f0f1c8e70738dad793de20176e0d9c4
    https://github.com/scummvm/scummvm/commit/2665e0e08f0f1c8e70738dad793de20176e0d9c4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-19T08:08:01-04:00

Commit Message:
TITANIC: Added various preSave and postSave methods

Changed paths:
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/sound/sound.h
    engines/titanic/sound/sound_manager.h
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index b181edc..1d34650 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -27,7 +27,6 @@
 #include "titanic/core/project_item.h"
 #include "titanic/messages/messages.h"
 
-
 namespace Titanic {
 
 void CGameManagerList::postLoad(uint ticks, CProjectItem *project) {
@@ -35,12 +34,30 @@ void CGameManagerList::postLoad(uint ticks, CProjectItem *project) {
 		(*i)->postLoad(ticks, project);
 }
 
+void CGameManagerList::preSave() {
+	for (iterator i = begin(); i != end(); ++i)
+		(*i)->preSave();
+}
+
+void CGameManagerList::postSave() {
+	for (iterator i = begin(); i != end(); ++i)
+		(*i)->postSave();
+}
+
 /*------------------------------------------------------------------------*/
 
 void CGameManagerListItem::postLoad(uint ticks, CProjectItem *project) {
 	warning("TODO");
 }
 
+void CGameManagerListItem::preSave() {
+	warning("TODO: CGameManagerListItem::preSave");
+}
+
+void CGameManagerListItem::postSave() {
+	warning("TODO: CGameManagerListItem::postSave");
+}
+
 /*------------------------------------------------------------------------*/
 
 CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
@@ -97,6 +114,23 @@ void CGameManager::postLoad(CProjectItem *project) {
 	_sound.postLoad();
 }
 
+void CGameManager::preSave(CProjectItem *project) {
+	// Generate a message that a save is being done
+	updateDiskTicksCount();
+	CPreSaveMsg msg(_lastDiskTicksCount);
+	msg.execute(project, nullptr, MSGFLAG_SCAN);
+
+	// Notify sub-objects of the save
+	_list.preSave();
+	_trueTalkManager.preSave();
+	_sound.preSave();
+}
+
+void CGameManager::postSave() {
+	_list.postSave();
+	_trueTalkManager.postSave();
+}
+
 void CGameManager::initBounds() {
 	_bounds = Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
 }
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 4380e4f..43d0dff 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -42,12 +42,38 @@ class CGameManagerListItem : public ListItem {
 private:
 	static int _v1;
 public:
+	/**
+	 * Called after loading a game has finished
+	 */
 	void postLoad(uint ticks, CProjectItem *project);
+
+	/**
+	 * Called when a game is about to be saved
+	 */
+	void preSave();
+
+	/**
+	 * Called when a game has finished being saved
+	 */
+	void postSave();
 };
 
 class CGameManagerList : public List<CGameManagerListItem> {
 public:
+	/**
+	 * Called after loading a game has finished
+	 */
 	void postLoad(uint ticks, CProjectItem *project);
+
+	/**
+	 * Called when a game is about to be saved
+	 */
+	void preSave();
+
+	/**
+	 * Called when a game has finished being saved
+	 */
+	void postSave();
 };
 
 class CGameManager {
@@ -92,6 +118,16 @@ public:
 	void postLoad(CProjectItem *project);
 
 	/**
+	 * Called when a game is about to be saved
+	 */
+	void preSave(CProjectItem *project);
+
+	/**
+	 * Called when a game has finished being saved
+	 */
+	void postSave();
+
+	/**
 	 * Updates the game time when the last disk access started
 	 */
 	void updateDiskTicksCount();
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index 1b98507..fce29eb 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -56,6 +56,16 @@ public:
 	 * Called when loading a game is complete
 	 */
 	void postLoad() { _soundManager.postLoad(); }
+
+	/**
+	 * Called when a game is about to be saved
+	 */
+	void preSave() { _soundManager.preSave(); }
+
+	/**
+	 * Called when a game has finished being saved
+	 */
+	void postSave() { _soundManager.postSave(); }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index 6a2e5a7..99513ae 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -73,7 +73,10 @@ public:
 	 */
 	virtual void postLoad() {}
 
-	virtual void proc26() {}
+	/**
+	 * Called when a game is about to be saved
+	 */
+	virtual void preSave() {}
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index ac36102..8a59655 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -88,6 +88,16 @@ public:
 	void postLoad() {}
 
 	/**
+	 * Called when a game is about to be saved
+	 */
+	void preSave() {}
+
+	/**
+	 * Called when a game has finished being saved
+	 */
+	void postSave() {}
+
+	/**
 	 * Returns the scripts for the manager
 	 */
 	TTScripts &getScripts() { return _scripts; }


Commit: abb5e0a5c123ada15d77380a1a9d5253306c36bb
    https://github.com/scummvm/scummvm/commit/abb5e0a5c123ada15d77380a1a9d5253306c36bb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-19T09:29:11-04:00

Commit Message:
TITANIC: Added CGameManager::viewChange

Changed paths:
    engines/titanic/core/project_item.cpp
    engines/titanic/core/project_item.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 90e6d06..7546f20 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -189,10 +189,15 @@ void CProjectItem::saveGame(int slotId) {
 		Common::String::format("slot%d.gam", slotId));
 	file.open(saveFile);
 
+	// Signal the game is being saved
+	preSave();
+
 	// Save the contents out
 	saveData(&file, this);
 
+	// Close the file and signal that the saving has finished
 	file.close();
+	postSave();
 }
 
 void CProjectItem::clear() {
@@ -288,6 +293,16 @@ void CProjectItem::postLoad() {
 		petControl->postLoad();
 }
 
+void CProjectItem::preSave() {
+	if (_gameManager)
+		_gameManager->preSave(this);
+}
+
+void CProjectItem::postSave() {
+	if (_gameManager)
+		_gameManager->postSave();
+}
+
 CPetControl *CProjectItem::getPetControl() const {
 	CDontSaveFileItem *fileItem = getDontSaveFileItem();
 	CTreeItem *treeItem;
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index 87dfc3f..ef7ccb6 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -89,6 +89,16 @@ private:
 	void postLoad();
 
 	/**
+	 * Called when a game is about to be saved
+	 */
+	void preSave();
+
+	/**
+	 * Called when a game has finished being saved
+	 */
+	void postSave();
+
+	/**
 	 * Finds the first child instance of a given class type
 	 */
 	CTreeItem *findChildInstance(ClassDef *classDef) const;
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 72c158d..a1dcce1 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -59,6 +59,16 @@ CString CTreeItem::dumpItem(int indent) const {
 	return result;
 }
 
+void CTreeItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	CMessageTarget::save(file, indent);
+}
+
+void CTreeItem::load(SimpleFile *file) {
+	file->readNumber();
+	CMessageTarget::load(file);
+}
+
 bool CTreeItem::isFileItem() const {
 	return isInstanceOf(CFileItem::_type);
 }
@@ -91,16 +101,6 @@ bool CTreeItem::isGameObjectDescItem() const {
 	return isInstanceOf(CGameObjectDescItem::_type);
 }
 
-void CTreeItem::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(0, indent);
-	CMessageTarget::save(file, indent);
-}
-
-void CTreeItem::load(SimpleFile *file) {
-	file->readNumber();
-	CMessageTarget::load(file);
-}
-
 CGameManager *CTreeItem::getGameManager() const {
 	return _parent ? _parent->getGameManager() : nullptr;
 }
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index aea22ff..a4156d6 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -120,6 +120,16 @@ public:
 	virtual int compareTo(const CString &name, int maxLen) const { return false; }
 
 	/**
+	 * Gets the bounds occupied by the item
+	 */
+	virtual Common::Rect getBounds() { return Common::Rect(); }
+
+	/**
+	 * Called when the view changes
+	 */
+	virtual void viewChange() {}
+
+	/**
 	 * Get the parent for the given item
 	 */
 	CTreeItem *getParent() const { return _parent; }
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 1d34650..296299a 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -147,4 +147,18 @@ void CGameManager::updateDiskTicksCount() {
 	_lastDiskTicksCount = g_vm->_events->getTicksCount();
 }
 
+void CGameManager::viewChange() {
+	delete _videoSurface1;
+	delete _videoSurface2;
+
+	_videoSurface1 = nullptr;
+	_videoSurface2 = CScreenManager::_screenManagerPtr->createSurface(600, 340);
+	_trueTalkManager.viewChange();
+
+	for (CTreeItem *treeItem = _project; treeItem; treeItem = treeItem->scan(_project))
+		treeItem->viewChange();
+
+	initBounds();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 43d0dff..6404845 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -155,6 +155,11 @@ public:
 	 * Updates the state of the manager
 	 */
 	void update();
+
+	/**
+	 * Called when the view changes
+	 */
+	void viewChange();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 5afaeb3..3d4a8ec 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -179,4 +179,8 @@ void CTrueTalkManager::preLoad() {
 	warning("TODO: CTrueTalkManager::preLoad");
 }
 
+void CTrueTalkManager::viewChange() {
+	warning("CTrueTalkManager::viewChange");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 8a59655..4c74ac2 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -98,6 +98,11 @@ public:
 	void postSave() {}
 
 	/**
+	 * Called when the view changes
+	 */
+	void viewChange();
+
+	/**
 	 * Returns the scripts for the manager
 	 */
 	TTScripts &getScripts() { return _scripts; }


Commit: f1d674c745ba117e1e62ff6fa3ebb8a7cace3615
    https://github.com/scummvm/scummvm/commit/f1d674c745ba117e1e62ff6fa3ebb8a7cace3615
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-19T09:50:47-04:00

Commit Message:
TITANIC: Implemented CViewItem::viewChange

Changed paths:
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/view_item.cpp
    engines/titanic/core/view_item.h
    engines/titanic/messages/messages.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 4ad9938..5fbe888 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -801,6 +801,9 @@ DEFFN(CIsEarBowlPuzzleDone)
 DEFFN(CIsHookedOnMsg)
 DEFFN(CIsParrotPresentMsg)
 DEFFN(CKeyCharMsg)
+DEFFN(CLeaveNodeMsg);
+DEFFN(CLeaveRoomMsg);
+DEFFN(CLeaveViewMsg);
 DEFFN(CLemonFallsFromTreeMsg)
 DEFFN(CLightsMsg)
 DEFFN(CLoadSuccessMsg)
@@ -1374,6 +1377,9 @@ void CSaveableObject::initClassList() {
 	ADDFN(CIsHookedOnMsg, CMessage);
 	ADDFN(CIsParrotPresentMsg, CMessage);
 	ADDFN(CKeyCharMsg, CMessage);
+	ADDFN(CLeaveNodeMsg, CMessage);
+	ADDFN(CLeaveRoomMsg, CMessage);
+	ADDFN(CLeaveViewMsg, CMessage);
 	ADDFN(CLemonFallsFromTreeMsg, CMessage);
 	ADDFN(CLightsMsg, CMessage);
 	ADDFN(CLoadSuccessMsg, CMessage);
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 7038e94..6046354 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -21,6 +21,8 @@
  */
 
 #include "titanic/core/view_item.h"
+#include "titanic/messages/messages.h"
+#include "titanic/game_manager.h"
 
 namespace Titanic {
 
@@ -73,4 +75,30 @@ bool CViewItem::getResourceKey(CResourceKey *key) {
 	return !filename.empty();
 }
 
+void CViewItem::viewChange(CViewItem *newView) {
+	// Only do the processing if we've been passed a view, and it's not the same 
+	if (newView && newView != this) {
+		CLeaveViewMsg viewMsg(this, newView);
+		viewMsg.execute(this, nullptr, MSGFLAG_SCAN);
+
+		CNodeItem *oldNode = findNode();
+		CNodeItem *newNode = newView->findNode();
+		if (newNode != oldNode) {
+			CLeaveNodeMsg nodeMsg(oldNode, newNode);
+			nodeMsg.execute(oldNode, nullptr, MSGFLAG_SCAN);
+
+			CRoomItem *oldRoom = oldNode->findRoom();
+			CRoomItem *newRoom = newNode->findRoom();
+			if (newRoom != oldRoom) {
+				CGameManager *gm = getGameManager();
+				if (gm)
+					gm->viewChange();
+
+				CLeaveRoomMsg roomMsg(oldRoom, newRoom);
+				roomMsg.execute(oldRoom, nullptr, MSGFLAG_SCAN);
+			}
+		}
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index 106c795..632c8e7 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -57,6 +57,11 @@ public:
 	 * Get the resource key for the view
 	 */
 	bool getResourceKey(CResourceKey *key);
+
+	/**
+	 * Called when changing from one view to another
+	 */
+	void viewChange(CViewItem *newView);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index d89b0e1..4e00648 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -281,9 +281,9 @@ MESSAGE0(CInitializeAnimMsg);
 MESSAGE1(CIsEarBowlPuzzleDone, int, value, 0);
 MESSAGE1(CIsParrotPresentMsg, int, value, 0);
 MESSAGE1(CKeyCharMsg, int, value, 32);
-MESSAGE1(CLeaveNodeMsg, CNodeItem *, node, nullptr);
-MESSAGE1(CLeaveRoomMsg, CRoomItem *, room, nullptr);
-MESSAGE1(CLeaveViewMsg, CViewItem *, view, nullptr);
+MESSAGE2(CLeaveNodeMsg, CNodeItem *, oldNode, nullptr, CNodeItem *, newNode, nullptr);
+MESSAGE2(CLeaveRoomMsg, CRoomItem *, oldRoom, nullptr, CRoomItem *, newRoom, nullptr);
+MESSAGE2(CLeaveViewMsg, CViewItem *, oldView, nullptr, CViewItem *, newView, nullptr);
 MESSAGE2(CLemonFallsFromTreeMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CLoadSuccessMsg, int, ticks, 0);
 MESSAGE1(CLockPhonographMsg, int, value, 0);


Commit: d86941f8c6b497f2d3d8409c2628af88bc600dae
    https://github.com/scummvm/scummvm/commit/d86941f8c6b497f2d3d8409c2628af88bc600dae
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-19T11:03:03-04:00

Commit Message:
TITANIC: Implement preEnterView and enterView

Changed paths:
    engines/titanic/core/view_item.cpp
    engines/titanic/core/view_item.h
    engines/titanic/game/gondolier/gondolier_mixer.cpp
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/main_game_window.cpp
    engines/titanic/messages/messages.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_control_sub_base.h



diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 6046354..c632458 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -20,9 +20,12 @@
  *
  */
 
+#include "titanic/game_manager.h"
+#include "titanic/core/project_item.h"
+#include "titanic/core/room_item.h"
 #include "titanic/core/view_item.h"
 #include "titanic/messages/messages.h"
-#include "titanic/game_manager.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -75,7 +78,7 @@ bool CViewItem::getResourceKey(CResourceKey *key) {
 	return !filename.empty();
 }
 
-void CViewItem::viewChange(CViewItem *newView) {
+void CViewItem::leaveView(CViewItem *newView) {
 	// Only do the processing if we've been passed a view, and it's not the same 
 	if (newView && newView != this) {
 		CLeaveViewMsg viewMsg(this, newView);
@@ -101,4 +104,58 @@ void CViewItem::viewChange(CViewItem *newView) {
 	}
 }
 
+void CViewItem::preEnterView(CViewItem *newView) {
+	// Only do the processing if we've been passed a view, and it's not the same 
+	if (newView && newView != this) {
+		CPreEnterViewMsg viewMsg(this, newView);
+		viewMsg.execute(this, nullptr, MSGFLAG_SCAN);
+
+		CNodeItem *oldNode = findNode();
+		CNodeItem *newNode = newView->findNode();
+		if (newNode != oldNode) {
+			CPreEnterNodeMsg nodeMsg(oldNode, newNode);
+			nodeMsg.execute(oldNode, nullptr, MSGFLAG_SCAN);
+
+			CRoomItem *oldRoom = oldNode->findRoom();
+			CRoomItem *newRoom = newNode->findRoom();
+			if (newRoom != oldRoom) {
+				CPreEnterRoomMsg roomMsg(oldRoom, newRoom);
+				roomMsg.execute(oldRoom, nullptr, MSGFLAG_SCAN);
+			}
+		}
+	}
+}
+
+void CViewItem::enterView(CViewItem *newView) {
+	// Only do the processing if we've been passed a view, and it's not the same 
+	if (newView && newView != this) {
+		CEnterViewMsg viewMsg(this, newView);
+		viewMsg.execute(this, nullptr, MSGFLAG_SCAN);
+
+		CNodeItem *oldNode = findNode();
+		CNodeItem *newNode = newView->findNode();
+		if (newNode != oldNode) {
+			CEnterNodeMsg nodeMsg(oldNode, newNode);
+			nodeMsg.execute(oldNode, nullptr, MSGFLAG_SCAN);
+
+			CRoomItem *oldRoom = oldNode->findRoom();
+			CRoomItem *newRoom = newNode->findRoom();
+
+			CPetControl *petControl = nullptr;
+			if (newRoom != nullptr) {
+				petControl = newRoom->getRoot()->getPetControl();
+				petControl->enterNode(newNode);
+			}
+
+			if (newRoom != oldRoom) {
+				CEnterRoomMsg roomMsg(oldRoom, newRoom);
+				roomMsg.execute(oldRoom, nullptr, MSGFLAG_SCAN);
+
+				if (petControl)
+					petControl->enterRoom(newRoom);
+			}
+		}
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index 632c8e7..ad09ed6 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -59,9 +59,19 @@ public:
 	bool getResourceKey(CResourceKey *key);
 
 	/**
-	 * Called when changing from one view to another
+	 * Called when leaving the view
 	 */
-	void viewChange(CViewItem *newView);
+	void leaveView(CViewItem *newView);
+
+	/**
+	 * Called on an old view just left, and about to enter a new view
+	 */
+	void preEnterView(CViewItem *newView);
+
+	/**
+	 * Called when a new view is being entered
+	 */
+	void enterView(CViewItem *newView);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.cpp b/engines/titanic/game/gondolier/gondolier_mixer.cpp
index f4fb655..b647a31 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.cpp
+++ b/engines/titanic/game/gondolier/gondolier_mixer.cpp
@@ -57,9 +57,9 @@ void CGondolierMixer::load(SimpleFile *file) {
 }
 
 bool CGondolierMixer::handleEvent(CEnterRoomMsg &msg) {
-	CTreeItem *parent = getParent();
-	if (parent == msg._room)
-		msg.execute(parent);
+	CTreeItem *parentRoom = getParent();
+	if (parentRoom == msg._newRoom)
+		msg.execute(parentRoom);
 	
 	return true;
 }
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 30185fc..d0baf21 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/game_state.h"
+#include "titanic/titanic.h"
 #include "titanic/game_manager.h"
 #include "titanic/screen_manager.h"
 
@@ -29,8 +30,8 @@ namespace Titanic {
 CGameState::CGameState(CGameManager *gameManager) :
 		_gameManager(gameManager), _gameLocation(this),
 		_field8(0), _fieldC(0), _mode(GSMODE_0), _field14(0), _field18(0),
-		_field1C(0), _field20(0), _field24(0), _field28(0), _field2C(0),
-		_field38(0) {
+		_field1C(0), _field20(0), _field24(0), _nodeChangeCtr(0),
+		_nodeEnterTicks(0), _field38(0) {
 }
 
 void CGameState::save(SimpleFile *file) const {
@@ -54,7 +55,8 @@ void CGameState::load(SimpleFile *file) {
 	_gameLocation.load(file);
 
 	_field1C = file->readNumber();
-	_field28 = _field2C = 0;
+	_nodeChangeCtr = 0;
+	_nodeEnterTicks = 0;
 }
 
 void CGameState::setMode(GameStateMode newMode) {
@@ -82,4 +84,9 @@ void CGameState::setMousePos(const Common::Point &pt) {
 	_mousePos = pt;
 }
 
+void CGameState::enterNode() {
+	++_nodeChangeCtr;
+	_nodeEnterTicks = g_vm->_events->getTicksCount();
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 1c0b750..10b87b5 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -54,8 +54,8 @@ public:
 	int _field1C;
 	int _field20;
 	int _field24;
-	int _field28;
-	int _field2C;
+	uint _nodeChangeCtr;
+	uint32 _nodeEnterTicks;
 	Common::Point _mousePos;
 	int _field38;
 public:
@@ -80,6 +80,11 @@ public:
 	 * Sets the current mouse position
 	 */
 	void setMousePos(const Common::Point &pt);
+
+	/**
+	 * Called by the PET when a new node is entered
+	 */
+	void enterNode();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index a6a5dca..0c80149 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -70,17 +70,18 @@ void CMainGameWindow::applicationStarting() {
 
 	// TODO: Cursor/image
 
-	// Generate starting messages
+	// Generate starting messages for entering the view, node, and room.
+	// Note the old fields are nullptr, since there's no previous view/node/room
 	CViewItem *view = _gameManager->_gameState._gameLocation.getView();
-	CEnterViewMsg enterViewMsg(view);
+	CEnterViewMsg enterViewMsg(nullptr, view);
 	enterViewMsg.execute(view, nullptr, MSGFLAG_SCAN);
 
 	CNodeItem *node = view->findNode();
-	CEnterNodeMsg enterNodeMsg(node);
+	CEnterNodeMsg enterNodeMsg(nullptr, node);
 	enterNodeMsg.execute(node, nullptr, MSGFLAG_SCAN);
 
 	CRoomItem *room = view->findRoom();
-	CEnterRoomMsg enterRoomMsg(room);
+	CEnterRoomMsg enterRoomMsg(nullptr, room);
 	enterRoomMsg.execute(room, nullptr, MSGFLAG_SCAN);
 
 	_gameManager->initBounds();
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 4e00648..0776ab9 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -196,9 +196,9 @@ public:
 	} }
 #define MESSAGE2(NAME, F1, N1, V1, F2, N2, V2) MSGTARGET(NAME); \
 	class NAME: public CMessage { \
-	public: F1 _N1; F2 _N2; \
-	NAME() : CMessage(), _N1(V1), _N2(V2) {} \
-	NAME(F1 N1, F2 N2) : CMessage(), _N1(N1), _N2(N2) {} \
+	public: F1 _##N1; F2 _##N2; \
+	NAME() : CMessage(), _##N1(V1), _##N2(V2) {} \
+	NAME(F1 N1, F2 N2) : CMessage(), _##N1(N1), _##N2(N2) {} \
 	CLASSDEF \
 	virtual bool handleMessage(const NAME &msg) { return false; } \
 	virtual bool perform(CTreeItem *treeItem) { \
@@ -207,9 +207,9 @@ public:
 	} }
 #define MESSAGE3(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3) MSGTARGET(NAME); \
 	class NAME: public CMessage { \
-	public: F1 _N1; F2 _N2; F3 _N3; \
-	NAME() : CMessage(), _N1(V1), _N2(V2), _N3(V3) {} \
-	NAME(F1 N1, F2 N2, F3 N3) : CMessage(), _N1(N1), _N2(N2), _N3(N3) {} \
+	public: F1 _##N1; F2 _##N2; F3 _##N3; \
+	NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3) {} \
+	NAME(F1 N1, F2 N2, F3 N3) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3) {} \
 	CLASSDEF \
 	virtual bool handleMessage(const NAME &msg) { return false; } \
 	virtual bool perform(CTreeItem *treeItem) { \
@@ -218,9 +218,9 @@ public:
 	} }
 #define MESSAGE4(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3, F4, N4, V4) MSGTARGET(NAME); \
 	class NAME: public CMessage { \
-	public: F1 _N1; F2 _N2; F3 _N3; F4 _N4; \
-	NAME() : CMessage(), _N1(V1), _N2(V2), _N3(V3), _N4(V4) {} \
-	NAME(F1 N1, F2 N2, F3 N3, F4 N4) : CMessage(), _N1(N1), _N2(N2), _N3(N3), _N4(N4) {} \
+	public: F1 _##N1; F2 _##N2; F3 _##N3; F4 _##N4; \
+	NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3), _##N4(V4) {} \
+	NAME(F1 N1, F2 N2, F3 N3, F4 N4) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3), _##N4(N4) {} \
 	CLASSDEF \
 	virtual bool handleMessage(const NAME &msg) { return false; } \
 	virtual bool perform(CTreeItem *treeItem) { \
@@ -259,12 +259,12 @@ MESSAGE1(CDropobjectMsg, int, value, 0);
 MESSAGE1(CDropZoneGotObjectMsg, int, value, 0);
 MESSAGE1(CDropZoneLostObjectMsg, int, value, 0);
 MESSAGE1(CEjectCylinderMsg, int, value, 0);
-MESSAGE1(CPreEnterNodeMsg, CNodeItem *, node, nullptr);
-MESSAGE1(CPreEnterRoomMsg, CRoomItem *, room, nullptr);
-MESSAGE1(CPreEnterViewMsg, CViewItem *, view, nullptr);
-MESSAGE1(CEnterNodeMsg, CNodeItem *, node, nullptr);
-MESSAGE1(CEnterRoomMsg, CRoomItem *, room, nullptr);
-MESSAGE1(CEnterViewMsg, CViewItem *, view, nullptr);
+MESSAGE2(CPreEnterNodeMsg, CNodeItem *, oldNode, nullptr, CNodeItem *, newNode, nullptr);
+MESSAGE2(CPreEnterRoomMsg, CRoomItem *, oldRoom, nullptr, CRoomItem *, newRoom, nullptr);
+MESSAGE2(CPreEnterViewMsg, CViewItem *, oldView, nullptr, CViewItem *, newView, nullptr);
+MESSAGE2(CEnterNodeMsg, CNodeItem *, oldNode, nullptr, CNodeItem *, newNode, nullptr);
+MESSAGE2(CEnterRoomMsg, CRoomItem *, oldRoom, nullptr, CRoomItem *, newRoom, nullptr);
+MESSAGE2(CEnterViewMsg, CViewItem *, oldView, nullptr, CViewItem *, newView, nullptr);
 MESSAGE0(CErasePhonographCylinderMsg);
 MESSAGE2(CFreshenCookieMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CGetChevClassBits, int, value, 0);
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 7ed223d..a61773d 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -21,6 +21,8 @@
  */
 
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/game_manager.h"
+#include "titanic/game_state.h"
 
 namespace Titanic {
 
@@ -49,10 +51,6 @@ void CPetControl::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-void CPetControl::postLoad() {
-	// TODO
-}
-
 bool CPetControl::isValid() const {
 	return _sub1.isValid() && _sub2.isValid()
 		&& _sub3.isValid() && _sub4.isValid()
@@ -82,5 +80,17 @@ void CPetControl::saveSubObjects(SimpleFile *file, int indent) const {
 	_sub8.save(file, indent);
 }
 
+void CPetControl::postLoad() {
+	warning("TODO: CPetControl::postLoad");
+}
+
+void CPetControl::enterNode(CNodeItem *node) {
+	getGameManager()->_gameState.enterNode();
+}
+
+void CPetControl::enterRoom(CRoomItem *room) {
+	_sub2.enterRoom(room);
+	_sub3.enterRoom(room);
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 70f6850..f1e4bb2 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -24,6 +24,8 @@
 #define TITANIC_PET_CONTROL_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/core/node_item.h"
+#include "titanic/core/room_item.h"
 #include "titanic/pet_control/pet_control_sub1.h"
 #include "titanic/pet_control/pet_control_sub2.h"
 #include "titanic/pet_control/pet_control_sub3.h"
@@ -80,6 +82,16 @@ public:
 	 * Called after loading a game has finished
 	 */
 	void postLoad();
+
+	/**
+	 * Called when a new node is entered
+	 */
+	void enterNode(CNodeItem *node);
+
+	/**
+	 * Called when a new room is entered
+	 */
+	void enterRoom(CRoomItem *room);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub_base.h b/engines/titanic/pet_control/pet_control_sub_base.h
index b59c85b..f95e1a9 100644
--- a/engines/titanic/pet_control/pet_control_sub_base.h
+++ b/engines/titanic/pet_control/pet_control_sub_base.h
@@ -24,6 +24,7 @@
 #define TITANIC_PET_CONTROL_SUB_BASE_H
 
 #include "titanic/simple_file.h"
+#include "titanic/core/room_item.h"
 
 namespace Titanic {
 
@@ -81,7 +82,12 @@ public:
 	virtual void proc21() {}
 	virtual void proc22() {}
 	virtual void proc23() {}
-	virtual void proc24() {}
+
+	/**
+	 * Called when a new room is entered
+	 */
+	virtual void enterRoom(CRoomItem *room) {}
+
 	virtual void proc25();
 	virtual int proc26() { return 0; }
 	virtual void proc27();


Commit: 4704d72d6af60db97959c3d170a2ea524a0f0f1f
    https://github.com/scummvm/scummvm/commit/4704d72d6af60db97959c3d170a2ea524a0f0f1f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-19T18:19:45-04:00

Commit Message:
TITANIC: Implementing view item message handling

Changed paths:
  A engines/titanic/mouse_cursor.cpp
  A engines/titanic/mouse_cursor.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/link_item.cpp
    engines/titanic/core/link_item.h
    engines/titanic/core/view_item.cpp
    engines/titanic/core/view_item.h
    engines/titanic/files_manager.cpp
    engines/titanic/files_manager.h
    engines/titanic/game/gondolier/gondolier_mixer.cpp
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/main_game_window.cpp
    engines/titanic/messages/messages.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_val.cpp
    engines/titanic/pet_control/pet_val.h
    engines/titanic/pet_control/pet_val_base.cpp
    engines/titanic/pet_control/pet_val_base.h
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index f5e9806..884873e 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -39,7 +39,7 @@ CGameObject::CGameObject(): CNamedItem() {
 	_field58 = 0;
 	_field5C = 1;
 	_field60 = 0;
-	_field74 = 1;
+	_cursorId = 1;
 	_field78 = 0;
 	_field8C = -1;
 	_field90 = 0;
@@ -70,7 +70,7 @@ void CGameObject::load(SimpleFile *file) {
 		// Deliberate fall-through
 
 	case 6:
-		val = _field74 = file->readNumber();
+		val = _cursorId = file->readNumber();
 		// Deliberate fall-through
 
 	case 5:
@@ -122,4 +122,9 @@ void CGameObject::fn2() {
 	error("TODO");
 }
 
+bool CGameObject::checkPoint(const Common::Point &pt, int v0, int v1) {
+	warning("TODO: CGameObject::checkPoint");
+	return false;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index c284fb4..693f334 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -43,9 +43,7 @@ protected:
 	int _field54;
 	int _field58;
 	int _field5C;
-	int _field60;
 	CMovieClipList _clipList1;
-	int _field74;
 	int _field78;
 	CMovieClipList _clipList2;
 	int _field8C;
@@ -59,6 +57,9 @@ protected:
 	CString _string;
 	int _fieldB8;
 public:
+	int _field60;
+	int _cursorId;
+public:
 	CLASSDEF
 	CGameObject();
 
@@ -73,6 +74,8 @@ public:
 	virtual void load(SimpleFile *file);
 
 	void fn2();
+
+	bool checkPoint(const Common::Point &pt, int v0, int v1);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp
index 175c11f..8d077d0 100644
--- a/engines/titanic/core/link_item.cpp
+++ b/engines/titanic/core/link_item.cpp
@@ -27,15 +27,6 @@
 
 namespace Titanic {
 
-void CLinkItemHotspot::clear() {
-	_field0 = 0;
-	_field4 = 0;
-	_field8 = 0;
-	_fieldC = 0;
-}
-
-/*------------------------------------------------------------------------*/
-
 CLinkItem::CLinkItem() : CNamedItem() {
 	_roomNumber = -1;
 	_nodeNumber = -1;
@@ -60,10 +51,10 @@ void CLinkItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_viewNumber, indent + 1);
 
 	file->writeQuotedLine("Hotspot", indent + 1);
-	file->writeNumberLine(_hotspot._field0, indent + 2);
-	file->writeNumberLine(_hotspot._field4, indent + 2);
-	file->writeNumberLine(_hotspot._field8, indent + 2);
-	file->writeNumberLine(_hotspot._fieldC, indent + 2);
+	file->writeNumberLine(_hotspot.left, indent + 2);
+	file->writeNumberLine(_hotspot.top, indent + 2);
+	file->writeNumberLine(_hotspot.right, indent + 2);
+	file->writeNumberLine(_hotspot.bottom, indent + 2);
 
 	CNamedItem::save(file, indent);
 }
@@ -87,10 +78,10 @@ void CLinkItem::load(SimpleFile *file) {
 		_viewNumber = file->readNumber();
 
 		file->readBuffer();
-		_hotspot._field0 = file->readNumber();
-		_hotspot._field4 = file->readNumber();
-		_hotspot._field8 = file->readNumber();
-		_hotspot._fieldC = file->readNumber();
+		_hotspot.left = file->readNumber();
+		_hotspot.top = file->readNumber();
+		_hotspot.right = file->readNumber();
+		_hotspot.bottom = file->readNumber();
 		break;
 
 	default:
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index 06d55f3..55219c0 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -31,18 +31,6 @@ class CViewItem;
 class CNodeItem;
 class CRoomItem;
 
-class CLinkItemHotspot {
-public:
-	int _field0;
-	int _field4;
-	int _field8;
-	int _fieldC;
-public:
-	CLinkItemHotspot() { clear(); }
-
-	void clear();
-};
-
 class CLinkItem : public CNamedItem {
 private:
 	/**
@@ -56,7 +44,7 @@ protected:
 	int _viewNumber;
 	int _field30;
 	int _field34;
-	CLinkItemHotspot _hotspot;
+	Common::Rect _hotspot;
 public:
 	CLASSDEF
 	CLinkItem();
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index c632458..485062d 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/game_manager.h"
+#include "titanic/screen_manager.h"
 #include "titanic/core/project_item.h"
 #include "titanic/core/room_item.h"
 #include "titanic/core/view_item.h"
@@ -30,6 +31,7 @@
 namespace Titanic {
 
 CViewItem::CViewItem() : CNamedItem() {
+	Common::fill(&_buttonUpTargets[0], &_buttonUpTargets[3], nullptr);
 	_field24 = 0;
 	_field28 = 0.0;
 	_viewNumber = 0;
@@ -158,4 +160,69 @@ void CViewItem::enterView(CViewItem *newView) {
 	}
 }
 
+bool CViewItem::handleEvent(CMouseButtonDownMsg &msg) {
+	if (msg._buttons & MB_LEFT) {
+		mouseChange(&msg, true);
+		// TODO
+	}
+
+	return true;
+}
+
+bool CViewItem::mouseChange(const CMouseMsg *msg, bool flag) {
+	const CMouseButtonUpMsg *upMsg = dynamic_cast<const CMouseButtonUpMsg *>(msg);
+	if (msg->isButtonUpMsg()) {
+		mouseButtonUp(upMsg);
+		return true;
+	}
+
+	Common::Array<CGameObject *> gameObjects;
+	CTreeItem *treeItem = scan(this);
+	while (treeItem) {
+		CGameObject *gameObject = dynamic_cast<CGameObject *>(treeItem);
+		if (gameObject) {
+			if (gameObject->checkPoint(msg->_mousePos, 0, 1) &&
+					(!flag || !gameObject->_field60)) {
+				if (gameObjects.size() < 256)
+					gameObjects.push_back(gameObject);
+			}
+		}
+	}
+
+	const CMouseMoveMsg *moveMsg = dynamic_cast<const CMouseMoveMsg *>(msg);
+	if (moveMsg) {
+		if (gameObjects.size() == 0)
+			return false;
+
+		for (int idx = (int)gameObjects.size() - 1; idx >= 0; ++idx) {
+			if (gameObjects[idx]->_cursorId != 12) {
+				CScreenManager::_screenManagerPtr->_mouseCursor->setCursorId(gameObjects[idx]->_cursorId);
+				break;
+			}
+		}
+	}
+
+	bool result = false;
+	for (int idx = (int)gameObjects.size() - 1; idx >= 0; --idx) {
+		if (msg->execute(gameObjects[idx])) {
+			if (msg->isButtonDownMsg())
+				_buttonUpTargets[msg->_buttons >> 1] = gameObjects[idx];
+			return true;
+		}
+
+		// TODO
+	}
+
+	return result;
+}
+
+void CViewItem::mouseButtonUp(const CMouseButtonUpMsg *msg) {
+	CTreeItem *&target = _buttonUpTargets[msg->_buttons >> 1];
+
+	if (target) {
+		msg->execute(target);
+		target = nullptr;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index ad09ed6..9994ec6 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -25,18 +25,33 @@
 
 #include "titanic/core/named_item.h"
 #include "titanic/core/resource_key.h"
+#include "titanic/messages/mouse_messages.h"
 
 namespace Titanic {
 
-class CViewItem : public CNamedItem {
+class CViewItem : public CNamedItem { //, CMouseButtonDownMsgTarget  {
+private:
+	CTreeItem *_buttonUpTargets[4];
 private:
 	void setData(double v);
+
+	/**
+	 * Called to handle mouse messagaes on the view
+	 */
+	bool mouseChange(const CMouseMsg *msg, bool flag);
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	void mouseButtonUp(const CMouseButtonUpMsg *msg);
 protected:
 	int _field24;
 	double _field28;
 	CResourceKey _resourceKey;
 	int _field50;
 	int _field54;
+protected:
+	virtual bool handleEvent(CMouseButtonDownMsg &msg);
 public:
 	int _viewNumber;
 public:
diff --git a/engines/titanic/files_manager.cpp b/engines/titanic/files_manager.cpp
index d668563..47da8e5 100644
--- a/engines/titanic/files_manager.cpp
+++ b/engines/titanic/files_manager.cpp
@@ -55,6 +55,9 @@ bool CFilesManager::scanForFile(const CString &name) {
 		fname += ".st";
 	}
 
+	if (_gameManager)
+		_gameManager->viewChange();
+
 	// The original had a bunch of code here handling determining
 	// which asset path, if any, the filename was present for,
 	// and storing the "active asset path" it was found on.
@@ -66,4 +69,8 @@ void CFilesManager::fn1() {
 	warning("TODO: CFilesManager::fn1");
 }
 
+void CFilesManager::debug(CScreenManager *screenManager) {
+	warning("TODO: CFilesManager::debug");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/files_manager.h b/engines/titanic/files_manager.h
index ae57033..a767056 100644
--- a/engines/titanic/files_manager.h
+++ b/engines/titanic/files_manager.h
@@ -24,6 +24,7 @@
 #define TITANIC_FILES_MANAGER_H
 
 #include "titanic/core/list.h"
+#include "titanic/screen_manager.h"
 
 namespace Titanic {
 
@@ -65,6 +66,8 @@ public:
 	bool scanForFile(const CString &name);
 
 	void fn1();
+
+	void debug(CScreenManager *screenManager);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.cpp b/engines/titanic/game/gondolier/gondolier_mixer.cpp
index b647a31..3d0a0e1 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.cpp
+++ b/engines/titanic/game/gondolier/gondolier_mixer.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/game/gondolier/gondolier_mixer.h"
+#include "titanic/core/room_item.h"
 
 namespace Titanic {
 
@@ -57,7 +58,7 @@ void CGondolierMixer::load(SimpleFile *file) {
 }
 
 bool CGondolierMixer::handleEvent(CEnterRoomMsg &msg) {
-	CTreeItem *parentRoom = getParent();
+	CRoomItem *parentRoom = dynamic_cast<CRoomItem *>(getParent());
 	if (parentRoom == msg._newRoom)
 		msg.execute(parentRoom);
 	
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 296299a..1177ca8 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -139,6 +139,10 @@ void CGameManager::fn2() {
 	warning("TODO");
 }
 
+void CGameManager::fn10(void *param1, CRoomItem *oldRoom, CRoomItem *newRoom) {
+	warning("TODO: CGameManager::fn10");
+}
+
 void CGameManager::update() {
 	warning("TODO: CGameManager::update");
 }
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 6404845..3e33e7a 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -78,7 +78,6 @@ public:
 
 class CGameManager {
 private:
-	CGameView *_gameView;
 	CSound _sound;
 	CTrueTalkManager _trueTalkManager;
 	CGameManagerList _list;
@@ -92,6 +91,7 @@ private:
 	uint _tickCount2;
 public:
 	CProjectItem *_project;
+	CGameView *_gameView;
 	CGameState _gameState;
 	Common::Rect _bounds;
 	CInputHandler _inputHandler;
@@ -151,6 +151,8 @@ public:
 
 	void fn2();
 
+	void fn10(void *param1, CRoomItem *oldRoom, CRoomItem *newRoom);
+
 	/**
 	 * Updates the state of the manager
 	 */
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index d0baf21..ad91a5a 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -89,4 +89,15 @@ void CGameState::enterNode() {
 	_nodeEnterTicks = g_vm->_events->getTicksCount();
 }
 
+void CGameState::enterView() {
+	CViewItem *oldView = _gameLocation.getView();
+	CViewItem *newView = _list._view;
+	oldView->preEnterView(newView);
+
+	_gameManager->_gameView->setView(newView);
+	CRoomItem *oldRoom = oldView->findNode()->findRoom();
+	CRoomItem *newRoom = newView->findNode()->findRoom();
+	_gameManager->fn10(_list._field14, oldRoom, newRoom);
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 10b87b5..19a59f8 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -35,10 +35,10 @@ enum GameStateMode { GSMODE_0 = 0, GSMODE_1 = 1, GSMODE_2 = 2, GSMODE_3 = 3, GSM
 
 class CGameStateList : public List<ListItem> {
 public:
-	int _field10;
-	int _field14;
+	CViewItem *_view;
+	void *_field14;
 public:
-	CGameStateList() : List<ListItem>(), _field10(0), _field14(0) {}
+	CGameStateList() : List<ListItem>(), _view(nullptr), _field14(nullptr) {}
 };
 
 class CGameState {
@@ -85,6 +85,11 @@ public:
 	 * Called by the PET when a new node is entered
 	 */
 	void enterNode();
+
+	/**
+	 * Enters a new view
+	 */
+	void enterView();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 0c80149..2c148c8 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -128,7 +128,7 @@ void CMainGameWindow::fn2() {
 			warning("TODO: Stuff");
 
 		case GSMODE_5:
-			warning("TODO: FilesManager::fn1");
+			g_vm->_filesManager.fn1();
 			break;
 
 		default:
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 0776ab9..54581a7 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -24,10 +24,7 @@
 #define TITANIC_MESSAGES_H
 
 #include "titanic/core/saveable_object.h"
-#include "titanic/core/game_object.h"
-#include "titanic/core/node_item.h"
-#include "titanic/core/room_item.h"
-#include "titanic/core/view_item.h"
+#include "titanic/core/tree_item.h"
 
 namespace Titanic {
 
@@ -40,6 +37,11 @@ enum MessageFlag {
 #define MSGTARGET(NAME) class NAME; class NAME##Target { public: \
 	virtual bool handleEvent(NAME &msg) = 0; }
 
+class CGameObject;
+class CRoomItem;
+class CNodeItem;
+class CViewItem;
+
 class CMessage : public CSaveableObject {
 public:
 	CLASSDEF
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index da194bf..af5c89c 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -16,6 +16,7 @@ MODULE_OBJS := \
 	input_handler.o \
 	input_translator.o \
 	main_game_window.o \
+	mouse_cursor.o \
 	screen_manager.o \
 	simple_file.o \
 	string.o \
diff --git a/engines/titanic/mouse_cursor.cpp b/engines/titanic/mouse_cursor.cpp
new file mode 100644
index 0000000..ee252cc
--- /dev/null
+++ b/engines/titanic/mouse_cursor.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/mouse_cursor.h"
+
+namespace Titanic {
+
+void CMouseCursor::show() {
+	warning("CMouseCursor::show");
+}
+
+void CMouseCursor::hide() {
+	warning("CMouseCursor::hide");
+}
+
+void CMouseCursor::setCursorId(int id) {
+	warning("CMouseCursor::setCursorId");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/mouse_cursor.h b/engines/titanic/mouse_cursor.h
new file mode 100644
index 0000000..ecbee85
--- /dev/null
+++ b/engines/titanic/mouse_cursor.h
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOUSE_CURSOR_H
+#define TITANIC_MOUSE_CURSOR_H
+
+#include "common/scummsys.h"
+
+namespace Titanic {
+
+class CMouseCursor {
+public:
+	void show();
+	void hide();
+	void setCursorId(int id);
+};
+
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOUSE_CURSOR_H */
diff --git a/engines/titanic/pet_control/pet_val.cpp b/engines/titanic/pet_control/pet_val.cpp
index 31494e1..96b82f1 100644
--- a/engines/titanic/pet_control/pet_val.cpp
+++ b/engines/titanic/pet_control/pet_val.cpp
@@ -41,7 +41,7 @@ void CPetVal::proc4() {
 	error("TODO");
 }
 
-void CPetVal::proc5(CLinkItemHotspot *linkItem) {
+void CPetVal::proc5(Common::Rect *rect) {
 	error("TODO");
 }
 
diff --git a/engines/titanic/pet_control/pet_val.h b/engines/titanic/pet_control/pet_val.h
index 2bf082f..bd1fb9e 100644
--- a/engines/titanic/pet_control/pet_val.h
+++ b/engines/titanic/pet_control/pet_val.h
@@ -40,7 +40,7 @@ public:
 	virtual void proc3();
 	virtual void proc4();
 
-	virtual void proc5(CLinkItemHotspot *linkItem);
+	virtual void proc5(Common::Rect *linkItem);
 
 	virtual int proc16();
 };
diff --git a/engines/titanic/pet_control/pet_val_base.cpp b/engines/titanic/pet_control/pet_val_base.cpp
index 2eb9339..c798c37 100644
--- a/engines/titanic/pet_control/pet_val_base.cpp
+++ b/engines/titanic/pet_control/pet_val_base.cpp
@@ -28,9 +28,9 @@ namespace Titanic {
 CPetValBase::CPetValBase() : _field4(0), _field8(0), _fieldC(0),
 		_field10(0), _field14(0) {}
 
-void CPetValBase::proc5(CLinkItemHotspot *linkItem) {
-	if (linkItem)
-		linkItem->clear();
+void CPetValBase::proc5(Common::Rect *rect) {
+	if (rect)
+		*rect = Common::Rect();
 }
 
 int CPetValBase::proc6() {
diff --git a/engines/titanic/pet_control/pet_val_base.h b/engines/titanic/pet_control/pet_val_base.h
index e6e78ae..c4ff665 100644
--- a/engines/titanic/pet_control/pet_val_base.h
+++ b/engines/titanic/pet_control/pet_val_base.h
@@ -44,7 +44,7 @@ public:
 	virtual void proc3() {}
 	virtual void proc4() {}
 
-	virtual void proc5(CLinkItemHotspot *linkItem);
+	virtual void proc5(Common::Rect *rect);
 
 	virtual int proc6();
 	virtual int proc7();
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 9c88dc6..0c3ab6f 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -110,7 +110,16 @@ void OSScreenManager::setMode(int width, int height, int bpp, uint numBackSurfac
 void OSScreenManager::proc5() {}
 void OSScreenManager::proc6() {}
 void OSScreenManager::proc7() {}
-void OSScreenManager::proc8() {}
+
+CVideoSurface *OSScreenManager::getSurface(int surfaceNum) const {
+	if (surfaceNum == -1)
+		return _frontRenderSurface;
+	else if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
+		return _backSurfaces[surfaceNum];
+	else
+		return nullptr;
+}
+
 void OSScreenManager::proc9() {}
 void OSScreenManager::proc10() {}
 void OSScreenManager::proc11() {}
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index caaefc8..1be2de9 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -28,6 +28,7 @@
 #include "titanic/direct_draw.h"
 #include "titanic/font.h"
 #include "titanic/input_handler.h"
+#include "titanic/mouse_cursor.h"
 #include "titanic/video_surface.h"
 #include "titanic/core/resource_key.h"
 
@@ -48,11 +49,6 @@ public:
 	CScreenManagerRec();
 };
 
-struct MouseCursor {
-	void show() {}
-	void hide() {}
-};
-
 class CScreenManager {
 protected:
 	TitanicEngine *_vm;
@@ -68,7 +64,7 @@ public:
 	Common::Array<CVideoSurface *> _backSurfaces;
 	CVideoSurface *_frontRenderSurface;
 	CScreenManagerRec _entries[2];
-	MouseCursor *_mouseCursor;
+	CMouseCursor *_mouseCursor;
 	void *_textCursor;
 	CInputHandler *_inputHandler;
 	int _fontNumber;
@@ -79,15 +75,13 @@ public:
 	void fn1() {}
 	void fn2() {}
 
-
-
 	virtual void setWindowHandle(int v);
 	virtual bool resetWindowHandle(int v);
 	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) = 0;
 	virtual void proc5() = 0;
 	virtual void proc6() = 0;
 	virtual void proc7() = 0;
-	virtual void proc8() = 0;
+	virtual CVideoSurface *getSurface(int surfaceNum) const = 0;
 	virtual void proc9() = 0;
 	virtual void proc10() = 0;
 	virtual void proc11() = 0;
@@ -153,7 +147,7 @@ public:
 	virtual void proc5();
 	virtual void proc6();
 	virtual void proc7();
-	virtual void proc8();
+	virtual CVideoSurface *getSurface(int surfaceNum) const;
 	virtual void proc9();
 	virtual void proc10();
 	virtual void proc11();


Commit: 46d5af527d5731eee812a18a57c4105bc01447c6
    https://github.com/scummvm/scummvm/commit/46d5af527d5731eee812a18a57c4105bc01447c6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-19T18:31:56-04:00

Commit Message:
TITANIC: Finished CViewItem::mouseChange

Changed paths:
    engines/titanic/core/view_item.cpp
    engines/titanic/messages/messages.h
    engines/titanic/messages/mouse_messages.h



diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 485062d..cc8ba49 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -210,7 +210,8 @@ bool CViewItem::mouseChange(const CMouseMsg *msg, bool flag) {
 			return true;
 		}
 
-		// TODO
+		if (CMouseMsg::isSupportedBy(gameObjects[idx]))
+			result = true;
 	}
 
 	return result;
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 54581a7..317cde5 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -94,6 +94,10 @@ public:
 	CEditControlMsg() : _field4(0), _field8(0), _field18(0),
 		_field1C(0), _field20(0) {}
 
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CEditControlMsg *>(item) != nullptr;
+	}
+
 	virtual bool perform(CTreeItem *treeItem) const { 
 		CEditControlMsg *dest = dynamic_cast<CEditControlMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
@@ -114,6 +118,10 @@ public:
 	CLightsMsg() : CMessage(), _field4(0), _field8(0),
 		_fieldC(0), _field10(0) {}
 
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CLightsMsg *>(item) != nullptr;
+	}
+
 	virtual bool perform(CTreeItem *treeItem) const {
 		CLightsMsg *dest = dynamic_cast<CLightsMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
@@ -136,6 +144,10 @@ public:
 	CIsHookedOnMsg() : CMessage(), _field4(0), _field8(0),
 		_field18(0), _field1C(0), _field20(0) {}
 
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CIsHookedOnMsg *>(item) != nullptr;
+	}
+
 	virtual bool perform(CTreeItem *treeItem) const {
 		CIsHookedOnMsg *dest = dynamic_cast<CIsHookedOnMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
@@ -153,6 +165,10 @@ public:
 	CLASSDEF
 	CSubAcceptCCarryMsg() : _value1(0), _value2(0), _value3(0) {}
 
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CSubAcceptCCarryMsg *>(item) != nullptr;
+	}
+
 	virtual bool perform(CTreeItem *treeItem) const {
 		CSubAcceptCCarryMsg *dest = dynamic_cast<CSubAcceptCCarryMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
@@ -170,6 +186,10 @@ public:
 	CLASSDEF
 	CTransportMsg() : _value1(0), _value2(0) {}
 
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CTransportMsg *>(item) != nullptr;
+	}
+
 	virtual bool perform(CTreeItem *treeItem) const {
 		CTransportMsg *dest = dynamic_cast<CTransportMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
@@ -180,6 +200,8 @@ public:
 	class NAME: public CMessage { \
 	public: NAME() : CMessage() {} \
 	CLASSDEF \
+	static bool isSupportedBy(const CTreeItem *item) { \
+		return dynamic_cast<const NAME *>(item) != nullptr; } \
 	virtual bool handleMessage(const NAME &msg) { return false; } \
 	virtual bool perform(CTreeItem *treeItem) const { \
 		NAME *dest = dynamic_cast<NAME *>(treeItem); \
@@ -191,6 +213,8 @@ public:
 	NAME() : CMessage(), _##N1(V1) {} \
 	NAME(F1 N1) : CMessage(), _##N1(N1) {} \
 	CLASSDEF \
+	static bool isSupportedBy(const CTreeItem *item) { \
+		return dynamic_cast<const NAME *>(item) != nullptr; } \
 	virtual bool handleMessage(const NAME &msg) { return false; } \
 	virtual bool perform(CTreeItem *treeItem) { \
 		NAME *dest = dynamic_cast<NAME *>(treeItem); \
@@ -202,6 +226,8 @@ public:
 	NAME() : CMessage(), _##N1(V1), _##N2(V2) {} \
 	NAME(F1 N1, F2 N2) : CMessage(), _##N1(N1), _##N2(N2) {} \
 	CLASSDEF \
+	static bool isSupportedBy(const CTreeItem *item) { \
+		return dynamic_cast<const NAME *>(item) != nullptr; } \
 	virtual bool handleMessage(const NAME &msg) { return false; } \
 	virtual bool perform(CTreeItem *treeItem) { \
 		NAME *dest = dynamic_cast<NAME *>(treeItem); \
@@ -213,6 +239,8 @@ public:
 	NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3) {} \
 	NAME(F1 N1, F2 N2, F3 N3) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3) {} \
 	CLASSDEF \
+	static bool isSupportedBy(const CTreeItem *item) { \
+		return dynamic_cast<const NAME *>(item) != nullptr; } \
 	virtual bool handleMessage(const NAME &msg) { return false; } \
 	virtual bool perform(CTreeItem *treeItem) { \
 		NAME *dest = dynamic_cast<NAME *>(treeItem); \
@@ -224,6 +252,8 @@ public:
 	NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3), _##N4(V4) {} \
 	NAME(F1 N1, F2 N2, F3 N3, F4 N4) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3), _##N4(N4) {} \
 	CLASSDEF \
+	static bool isSupportedBy(const CTreeItem *item) { \
+		return dynamic_cast<const NAME *>(item) != nullptr; } \
 	virtual bool handleMessage(const NAME &msg) { return false; } \
 	virtual bool perform(CTreeItem *treeItem) { \
 		NAME *dest = dynamic_cast<NAME *>(treeItem); \
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index fff392e..84d7b8f 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -36,6 +36,9 @@ public:
 	Common::Point _mousePos;
 public:
 	CLASSDEF
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CMouseMsg *>(item) != nullptr;
+	}
 	CMouseMsg() : _buttons(0) {}
 	CMouseMsg(const Common::Point &pt, int buttons) :
 		_mousePos(pt), _buttons(buttons) {}
@@ -48,6 +51,9 @@ public:
 	CMouseMoveMsg() : CMouseMsg() {}
 	CMouseMoveMsg(const Common::Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
 
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CMouseMoveMsg *>(item) != nullptr;
+	}
 	virtual bool handleMessage(const CMouseMoveMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
 		CMouseMoveMsg *dest = dynamic_cast<CMouseMoveMsg *>(treeItem);
@@ -62,6 +68,10 @@ public:
 	CLASSDEF
 	CMouseButtonMsg() : CMouseMsg(), _field10(0) {}
 	CMouseButtonMsg(const Common::Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
+
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CMouseButtonMsg *>(item) != nullptr;
+	}
 };
 
 MSGTARGET(CMouseButtonDownMsg);
@@ -71,6 +81,9 @@ public:
 	CMouseButtonDownMsg() : CMouseButtonMsg() {}
 	CMouseButtonDownMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CMouseButtonDownMsg *>(item) != nullptr;
+	}
 	virtual bool handleMessage(const CMouseButtonDownMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) {
 		CMouseButtonDownMsg *dest = dynamic_cast<CMouseButtonDownMsg *>(treeItem);
@@ -85,6 +98,9 @@ public:
 	CMouseButtonUpMsg() : CMouseButtonMsg() {}
 	CMouseButtonUpMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CMouseButtonUpMsg *>(item) != nullptr;
+	}
 	virtual bool handleMessage(const CMouseButtonUpMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
 		CMouseButtonUpMsg *dest = dynamic_cast<CMouseButtonUpMsg *>(treeItem);
@@ -99,6 +115,9 @@ public:
 	CMouseButtonDoubleClickMsg() : CMouseButtonMsg() {}
 	CMouseButtonDoubleClickMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CMouseButtonDoubleClickMsg *>(item) != nullptr;
+	}
 	virtual bool handleMessage(const CMouseButtonDoubleClickMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
 		CMouseButtonDoubleClickMsg *dest = dynamic_cast<CMouseButtonDoubleClickMsg *>(treeItem);
@@ -111,6 +130,10 @@ public:
 	CLASSDEF
 	CMouseDragMsg() : CMouseMsg() {}
 	CMouseDragMsg(const Common::Point &pt) : CMouseMsg(pt, 0) {}
+
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CMouseDragMsg *>(item) != nullptr;
+	}
 };
 
 class CMouseDragMoveMsg : public CMouseDragMsg {
@@ -119,6 +142,9 @@ public:
 	CMouseDragMoveMsg() : CMouseDragMsg() {}
 	CMouseDragMoveMsg(const Common::Point &pt) : CMouseDragMsg(pt) {}
 
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CMouseDragMoveMsg *>(item) != nullptr;
+	}
 	virtual bool handleMessage(const CMouseDragMoveMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
 		CMouseDragMoveMsg *dest = dynamic_cast<CMouseDragMoveMsg *>(treeItem);
@@ -137,6 +163,9 @@ public:
 	CMouseDragStartMsg(const Common::Point &pt) : CMouseDragMsg(pt),
 		_dragItem(nullptr), _field14(0) {}
 
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CMouseDragStartMsg *>(item) != nullptr;
+	}
 	virtual bool handleMessage(const CMouseDragStartMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
 		CMouseDragStartMsg *dest = dynamic_cast<CMouseDragStartMsg *>(treeItem);
@@ -154,6 +183,9 @@ public:
 	CMouseDragEndMsg(const Common::Point &pt, CTreeItem *dragItem = nullptr) :
 		CMouseDragMsg(pt), _dragItem(dragItem) {}
 
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CMouseDragEndMsg *>(item) != nullptr;
+	}
 	virtual bool handleMessage(const CMouseDragEndMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) {
 		CMouseDragEndMsg *dest = dynamic_cast<CMouseDragEndMsg *>(treeItem);


Commit: dbd8ab0f1c11f1e749c74fe70e5fc2496332a1c5
    https://github.com/scummvm/scummvm/commit/dbd8ab0f1c11f1e749c74fe70e5fc2496332a1c5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-19T20:56:29-04:00

Commit Message:
TITANIC: Implement view change logic

Changed paths:
    engines/titanic/core/link_item.cpp
    engines/titanic/core/link_item.h
    engines/titanic/core/movie_clip.cpp
    engines/titanic/core/movie_clip.h
    engines/titanic/core/room_item.h
    engines/titanic/core/view_item.cpp
    engines/titanic/core/view_item.h
    engines/titanic/debugger.cpp
    engines/titanic/events.cpp
    engines/titanic/events.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/sound/sound.cpp
    engines/titanic/sound/sound.h



diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp
index 8d077d0..02b4215 100644
--- a/engines/titanic/core/link_item.cpp
+++ b/engines/titanic/core/link_item.cpp
@@ -51,10 +51,10 @@ void CLinkItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_viewNumber, indent + 1);
 
 	file->writeQuotedLine("Hotspot", indent + 1);
-	file->writeNumberLine(_hotspot.left, indent + 2);
-	file->writeNumberLine(_hotspot.top, indent + 2);
-	file->writeNumberLine(_hotspot.right, indent + 2);
-	file->writeNumberLine(_hotspot.bottom, indent + 2);
+	file->writeNumberLine(_bounds.left, indent + 2);
+	file->writeNumberLine(_bounds.top, indent + 2);
+	file->writeNumberLine(_bounds.right, indent + 2);
+	file->writeNumberLine(_bounds.bottom, indent + 2);
 
 	CNamedItem::save(file, indent);
 }
@@ -78,10 +78,10 @@ void CLinkItem::load(SimpleFile *file) {
 		_viewNumber = file->readNumber();
 
 		file->readBuffer();
-		_hotspot.left = file->readNumber();
-		_hotspot.top = file->readNumber();
-		_hotspot.right = file->readNumber();
-		_hotspot.bottom = file->readNumber();
+		_bounds.left = file->readNumber();
+		_bounds.top = file->readNumber();
+		_bounds.right = file->readNumber();
+		_bounds.bottom = file->readNumber();
 		break;
 
 	default:
@@ -130,4 +130,8 @@ CRoomItem *CLinkItem::getDestRoom() const {
 	return getDestNode()->findRoom();
 }
 
+CMovieClip *CLinkItem::getClip() const {
+	return findRoom()->findClip(getName());
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index 55219c0..733a4c9 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -24,6 +24,7 @@
 #define TITANIC_LINK_ITEM_H
 
 #include "titanic/core/named_item.h"
+#include "titanic/core/movie_clip.h"
 
 namespace Titanic {
 
@@ -44,7 +45,8 @@ protected:
 	int _viewNumber;
 	int _field30;
 	int _field34;
-	Common::Rect _hotspot;
+public:
+	Common::Rect _bounds;
 public:
 	CLASSDEF
 	CLinkItem();
@@ -79,6 +81,11 @@ public:
 	 * Get the destination view for the link item
 	 */
 	virtual CRoomItem *getDestRoom() const;
+
+	/**
+	 * Get the movie clip, if any, that's used when the link is used
+	 */
+	CMovieClip *getClip() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/movie_clip.cpp b/engines/titanic/core/movie_clip.cpp
index fec09f6..9a787e2 100644
--- a/engines/titanic/core/movie_clip.cpp
+++ b/engines/titanic/core/movie_clip.cpp
@@ -30,7 +30,7 @@ CMovieClip::CMovieClip() {
 void CMovieClip::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(2, indent);
 	file->writeQuotedLine("Clip", indent);
-	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_name, indent);
 	file->writeNumberLine(_field18, indent);
 	file->writeNumberLine(_field1C, indent);
 
@@ -42,7 +42,7 @@ void CMovieClip::load(SimpleFile *file) {
 
 	switch (val) {
 	case 1:
-		_string1 = file->readString();
+		_name = file->readString();
 		_field18 = file->readNumber();
 		_field1C = file->readNumber();
 		_field20 = file->readNumber();
@@ -54,7 +54,7 @@ void CMovieClip::load(SimpleFile *file) {
 
 	case 2:
 		file->readString();
-		_string1 = file->readString();
+		_name = file->readString();
 		_field18 = file->readNumber();
 		_field1C = file->readNumber();
 		break;
@@ -66,4 +66,14 @@ void CMovieClip::load(SimpleFile *file) {
 	ListItem::load(file);
 }
 
+CMovieClip *CMovieClipList::findByName(const Common::String &name) const {
+	for (const_iterator i = begin(); i != end(); ++i) {
+		CMovieClip *clip = *i;
+		if (clip->_name == name)
+			return clip;
+	}
+
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/movie_clip.h b/engines/titanic/core/movie_clip.h
index cd6125d..0abda94 100644
--- a/engines/titanic/core/movie_clip.h
+++ b/engines/titanic/core/movie_clip.h
@@ -32,7 +32,6 @@ namespace Titanic {
  */
 class CMovieClip : public ListItem {
 private:
-	CString _string1;
 	int _field18;
 	int _field1C;
 	int _field20;
@@ -43,6 +42,8 @@ private:
 	CString _string2;
 	CString _string3;
 public:
+	CString _name;
+public:
 	CLASSDEF
 	CMovieClip();
 
@@ -62,6 +63,7 @@ public:
  */
 class CMovieClipList: public List<CMovieClip> {
 public:
+	CMovieClip *findByName(const Common::String &name) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index 2235f6a..a42ffab 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -54,6 +54,11 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
+
+	/**
+	 * Return a movie clip for the room by name
+	 */
+	CMovieClip *findClip(const CString &name) { return _clipList.findByName(name); }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index cc8ba49..a80f25b 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -162,17 +162,34 @@ void CViewItem::enterView(CViewItem *newView) {
 
 bool CViewItem::handleEvent(CMouseButtonDownMsg &msg) {
 	if (msg._buttons & MB_LEFT) {
-		mouseChange(&msg, true);
+		if (!handleMouseMsg(&msg, true)) {
+			CGameManager *gm = getGameManager();
+			if (gm->test54()) {
+				findNode()->findRoom();
+
+				CLinkItem *linkItem = dynamic_cast<CLinkItem *>(
+					findChildInstanceOf(CLinkItem::_type));
+				while (linkItem) {
+					if (linkItem->_bounds.contains(msg._mousePos)) {
+						gm->_gameState.triggerLink(linkItem);
+						return true;
+					}
+
+					linkItem = dynamic_cast<CLinkItem *>(
+						findNextInstanceOf(CLinkItem::_type, linkItem));
+				}
+			}
+		}
 		// TODO
 	}
 
 	return true;
 }
 
-bool CViewItem::mouseChange(const CMouseMsg *msg, bool flag) {
+bool CViewItem::handleMouseMsg(const CMouseMsg *msg, bool flag) {
 	const CMouseButtonUpMsg *upMsg = dynamic_cast<const CMouseButtonUpMsg *>(msg);
 	if (msg->isButtonUpMsg()) {
-		mouseButtonUp(upMsg);
+		handleButtonUpMsg(upMsg);
 		return true;
 	}
 
@@ -217,7 +234,7 @@ bool CViewItem::mouseChange(const CMouseMsg *msg, bool flag) {
 	return result;
 }
 
-void CViewItem::mouseButtonUp(const CMouseButtonUpMsg *msg) {
+void CViewItem::handleButtonUpMsg(const CMouseButtonUpMsg *msg) {
 	CTreeItem *&target = _buttonUpTargets[msg->_buttons >> 1];
 
 	if (target) {
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index 9994ec6..b1de0bb 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -38,12 +38,12 @@ private:
 	/**
 	 * Called to handle mouse messagaes on the view
 	 */
-	bool mouseChange(const CMouseMsg *msg, bool flag);
+	bool handleMouseMsg(const CMouseMsg *msg, bool flag);
 
 	/**
 	 * Handles mouse button up messages
 	 */
-	void mouseButtonUp(const CMouseButtonUpMsg *msg);
+	void handleButtonUpMsg(const CMouseButtonUpMsg *msg);
 protected:
 	int _field24;
 	double _field28;
diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp
index 7af86fc..87ce07d 100644
--- a/engines/titanic/debugger.cpp
+++ b/engines/titanic/debugger.cpp
@@ -160,10 +160,12 @@ bool Debugger::cmdRoom(int argc, const char **argv) {
 			else {
 				CViewItem *viewItem = findView(nodeItem, argv[3]);
 
-				if (!viewItem)
+				if (!viewItem) {
 					debugPrintf("Could not find view - %s\n", argv[3]);
-				else {
-					debugPrintf("Found view. TODO: Jump to it\n");
+				} else {
+					// Change to the specified view
+					g_vm->_window->_gameManager->_gameState.changeView(viewItem, nullptr);
+					return false;
 				}
 			}
 		}
diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index 09ec3e5..346b43c 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -66,6 +66,9 @@ void Events::pollEvents() {
 	case Common::EVENT_KEYDOWN:
 		keyDown(event.kbd);
 		break;
+	case Common::EVENT_KEYUP:
+		keyUp(event.kbd);
+		break;
 	default:
 		break;
 	}
@@ -177,6 +180,8 @@ void Events::charPress(char c) {
 }
 
 void Events::keyDown(Common::KeyState keyState) {
+	handleKbdSpecial(keyState);
+
 	if (keyState.keycode == Common::KEYCODE_d && (keyState.flags & Common::KBD_CTRL)) {
 		// Attach to the debugger
 		_vm->_debugger->attach();
@@ -184,4 +189,20 @@ void Events::keyDown(Common::KeyState keyState) {
 	}
 }
 
+void Events::keyUp(Common::KeyState keyState) {
+	handleKbdSpecial(keyState);
+}
+
+void Events::handleKbdSpecial(Common::KeyState keyState) {
+	if (keyState.flags & Common::KBD_CTRL)
+		_specialButtons |= MK_CONTROL;
+	else
+		_specialButtons &= ~MK_CONTROL;
+
+	if (keyState.flags & Common::KBD_SHIFT)
+		_specialButtons |= MK_SHIFT;
+	else
+		_specialButtons &= ~MK_SHIFT;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/events.h b/engines/titanic/events.h
index dc1781f..fe2c751 100644
--- a/engines/titanic/events.h
+++ b/engines/titanic/events.h
@@ -67,6 +67,8 @@ private:
 	void rightButtonDoubleClick();
 	void charPress(char c);
 	void keyDown(Common::KeyState keyState);
+	void keyUp(Common::KeyState keyState);
+	void handleKbdSpecial(Common::KeyState keyState);
 public:
 	Events(TitanicEngine *vm);
 	~Events() {}
@@ -91,6 +93,11 @@ public:
 	 * Get the elapsed playtime
 	 */
 	uint32 getTicksCount() const;
+
+	/**
+	 * Return whether a given special key is currently pressed
+	 */
+	bool isSpecialPressed(SpecialButtons btn) const { return _specialButtons; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 1177ca8..4a45fa5 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -139,8 +139,8 @@ void CGameManager::fn2() {
 	warning("TODO");
 }
 
-void CGameManager::fn10(void *param1, CRoomItem *oldRoom, CRoomItem *newRoom) {
-	warning("TODO: CGameManager::fn10");
+void CGameManager::playClip(CMovieClip *clip, CRoomItem *oldRoom, CRoomItem *newRoom) {
+	warning("TODO: CGameManager::playClip");
 }
 
 void CGameManager::update() {
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 3e33e7a..38edc6e 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -78,7 +78,6 @@ public:
 
 class CGameManager {
 private:
-	CSound _sound;
 	CTrueTalkManager _trueTalkManager;
 	CGameManagerList _list;
 	int _field30;
@@ -98,6 +97,7 @@ public:
 	CInputTranslator _inputTranslator;
 	CTreeItem *_dragItem;
 	CMusicRoom _musicRoom;
+	CSound _sound;
 public:
 	CGameManager(CProjectItem *project, CGameView *gameView);
 	~CGameManager();
@@ -151,7 +151,10 @@ public:
 
 	void fn2();
 
-	void fn10(void *param1, CRoomItem *oldRoom, CRoomItem *newRoom);
+	/**
+	 * Plays a movie clip
+	 */
+	void playClip(CMovieClip *clip, CRoomItem *oldRoom, CRoomItem *newRoom);
 
 	/**
 	 * Updates the state of the manager
@@ -162,6 +165,8 @@ public:
 	 * Called when the view changes
 	 */
 	void viewChange();
+
+	bool test54() const { return !_field54; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index ad91a5a..f10f945 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -97,7 +97,39 @@ void CGameState::enterView() {
 	_gameManager->_gameView->setView(newView);
 	CRoomItem *oldRoom = oldView->findNode()->findRoom();
 	CRoomItem *newRoom = newView->findNode()->findRoom();
-	_gameManager->fn10(_list._field14, oldRoom, newRoom);
+	_gameManager->playClip(_list._movieClip, oldRoom, newRoom);
 }
 
-} // End of namespace Titanic z
+void CGameState::triggerLink(CLinkItem *link) {
+	changeView(link->getDestView(), link->getClip());
+}
+
+void CGameState::changeView(CViewItem *newView, CMovieClip *clip) {
+	// Signal the old view that it's being left
+	CViewItem *oldView = _gameLocation.getView();
+	oldView->leaveView(newView);
+
+	// If Shift key is pressed, skip showing the transition clip
+	if (g_vm->_events->isSpecialPressed(MK_SHIFT))
+		clip = nullptr;
+
+	if (_mode == GSMODE_2) {
+		_list._view = newView;
+		_list._movieClip = clip;
+	} else {
+		oldView->preEnterView(newView);
+		_gameManager->_gameView->setView(newView);
+		CRoomItem *oldRoom = newView->findNode()->findRoom();
+		CRoomItem *newRoom = newView->findNode()->findRoom();
+
+		// If a transition clip is defined, play it
+		if (clip)
+			_gameManager->playClip(clip, oldRoom, newRoom);
+
+		// Final view change handling
+		_gameManager->_sound.viewChanged(newView, newRoom != oldRoom);
+		oldView->enterView(newView);
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 19a59f8..b9d25e9 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -24,6 +24,7 @@
 #define TITANIC_GAME_STATE_H
 
 #include "titanic/core/list.h"
+#include "titanic/core/link_item.h"
 #include "titanic/simple_file.h"
 #include "titanic/game_location.h"
 
@@ -36,9 +37,9 @@ enum GameStateMode { GSMODE_0 = 0, GSMODE_1 = 1, GSMODE_2 = 2, GSMODE_3 = 3, GSM
 class CGameStateList : public List<ListItem> {
 public:
 	CViewItem *_view;
-	void *_field14;
+	CMovieClip *_movieClip;
 public:
-	CGameStateList() : List<ListItem>(), _view(nullptr), _field14(nullptr) {}
+	CGameStateList() : List<ListItem>(), _view(nullptr), _movieClip(nullptr) {}
 };
 
 class CGameState {
@@ -90,6 +91,16 @@ public:
 	 * Enters a new view
 	 */
 	void enterView();
+
+	/**
+	 * Triggers a link item in a view
+	 */
+	void triggerLink(CLinkItem *link);
+
+	/**
+	 * Changes the current view
+	 */
+	void changeView(CViewItem *newView, CMovieClip *clip);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index a61773d..f549888 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -38,9 +38,9 @@ void CPetControl::save(SimpleFile *file, int indent) const {
 
 void CPetControl::load(SimpleFile *file) {
 	int val = file->readNumber();
-	bool valid = isValid();
+	isValid();
 	
-	if (!valid) {
+	if (!val) {
 		_fieldBC = file->readNumber();
 		_string1 = file->readString();
 		_string2 = file->readString();
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index 062e43d..54c1450 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -43,4 +43,8 @@ void CSound::preLoad() {
 		_gameManager->_musicRoom.preLoad();
 }
 
+void CSound::viewChanged(CViewItem *newView, bool isNewRoom) {
+	warning("CSound::viewChanged");
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index fce29eb..0bfd3f2 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -25,6 +25,7 @@
 
 #include "titanic/simple_file.h"
 #include "titanic/sound/sound_manager.h"
+#include "titanic/core/view_item.h"
 
 namespace Titanic {
 
@@ -66,6 +67,11 @@ public:
 	 * Called when a game has finished being saved
 	 */
 	void postSave() { _soundManager.postSave(); }
+
+	/**
+	 * Called when the view has been changed
+	 */
+	void viewChanged(CViewItem *newView, bool isNewRoom);
 };
 
 } // End of namespace Titanic


Commit: c6b239bdac7c193bc4d0fe8cfc6fbb610d1ca1ca
    https://github.com/scummvm/scummvm/commit/c6b239bdac7c193bc4d0fe8cfc6fbb610d1ca1ca
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-19T22:43:02-04:00

Commit Message:
TITANIC: Implemented CGameManager::update

Changed paths:
  A engines/titanic/text_cursor.cpp
  A engines/titanic/text_cursor.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game_location.cpp
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/game_view.cpp
    engines/titanic/game_view.h
    engines/titanic/messages/messages.h
    engines/titanic/module.mk
    engines/titanic/mouse_cursor.cpp
    engines/titanic/mouse_cursor.h
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h
    engines/titanic/sound/sound.cpp
    engines/titanic/sound/sound.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 5fbe888..2c4eea5 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -785,6 +785,7 @@ DEFFN(CEnterRoomMsg);
 DEFFN(CEnterViewMsg);
 DEFFN(CEjectCylinderMsg)
 DEFFN(CErasePhonographCylinderMsg)
+DEFFN(CFrameMsg)
 DEFFN(CFreshenCookieMsg)
 DEFFN(CGetChevClassBits)
 DEFFN(CGetChevClassNum)
@@ -1361,6 +1362,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CEnterViewMsg, CMessage);
 	ADDFN(CEjectCylinderMsg, CMessage);
 	ADDFN(CErasePhonographCylinderMsg, CMessage);
+	ADDFN(CFrameMsg, CMessage);
 	ADDFN(CFreshenCookieMsg, CMessage);
 	ADDFN(CGetChevClassBits, CMessage);
 	ADDFN(CGetChevClassNum, CMessage);
diff --git a/engines/titanic/game_location.cpp b/engines/titanic/game_location.cpp
index 2a01bbf..23c2ae2 100644
--- a/engines/titanic/game_location.cpp
+++ b/engines/titanic/game_location.cpp
@@ -112,4 +112,4 @@ CRoomItem *CGameLocation::getRoom() {
 	return !view ? nullptr : view->findRoom();
 }
 
-} // End of namespace Titanic z
+} // End of namespace Titanic
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 4a45fa5..1c480e5 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -26,6 +26,7 @@
 #include "titanic/screen_manager.h"
 #include "titanic/core/project_item.h"
 #include "titanic/messages/messages.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -44,6 +45,10 @@ void CGameManagerList::postSave() {
 		(*i)->postSave();
 }
 
+void CGameManagerList::update(uint ticks) {
+	warning("TODO: CGameManagerList::update");
+}
+
 /*------------------------------------------------------------------------*/
 
 void CGameManagerListItem::postLoad(uint ticks, CProjectItem *project) {
@@ -64,7 +69,7 @@ CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
 		_project(project), _gameView(gameView), _trueTalkManager(this),
 		_inputHandler(this), _inputTranslator(&_inputHandler),		
 		_gameState(this), _sound(this), _musicRoom(this),
-		_field30(0), _field34(0), _field4C(0), 
+		_field30(0), _soundMaker(nullptr), _field4C(0),
 		_dragItem(nullptr), _field54(0), _lastDiskTicksCount(0), _tickCount2(0) {
 	
 	_videoSurface1 = nullptr;
@@ -85,7 +90,7 @@ void CGameManager::load(SimpleFile *file) {
 void CGameManager::preLoad() {
 	updateDiskTicksCount();
 	_list.destroyContents();
-	_field34 = 0;
+	_soundMaker = nullptr;
 
 	_trueTalkManager.preLoad();
 	_sound.preLoad();
@@ -144,7 +149,49 @@ void CGameManager::playClip(CMovieClip *clip, CRoomItem *oldRoom, CRoomItem *new
 }
 
 void CGameManager::update() {
-	warning("TODO: CGameManager::update");
+	handleMovies();
+	frameMessage(getRoom());
+	_list.update(g_vm->_events->getTicksCount());
+	_trueTalkManager.update1();
+	_trueTalkManager.update2();
+	CScreenManager::_screenManagerPtr->_mouseCursor->update();
+
+	CViewItem *view = getView();
+	if (view) {
+		// Expand the game manager's bounds to encompass all the view's items
+		for (CTreeItem *item = view; item; item = item->scan(view)) {
+			Common::Rect r = item->getBounds();
+			if (!r.isEmpty())
+				_bounds.extend(r);
+		}
+
+		// Also include the PET control in the bounds
+		if (_project) {
+			CPetControl *pet = _project->getPetControl();
+			if (pet)
+				_bounds.extend(pet->getBounds());
+		}
+
+		// And the text cursor
+		CScreenManager *screenManager = CScreenManager::_screenManagerPtr;
+		CTextCursor *textCursor = screenManager->_textCursor;
+		if (textCursor->_active)
+			_bounds.extend(textCursor->getBounds());
+		
+		// Set the surface bounds
+		screenManager->setSurfaceBounds(0, _bounds);
+
+		if (!_bounds.isEmpty()) {
+			_gameView->proc4(_bounds);
+			_bounds = Common::Rect();
+		}
+
+		_gameState.checkForViewChange();
+	}
+}
+
+void CGameManager::handleMovies() {
+	warning("TODO: CGameManager::handleMovies");
 }
 
 void CGameManager::updateDiskTicksCount() {
@@ -165,4 +212,26 @@ void CGameManager::viewChange() {
 	initBounds();
 }
 
+CRoomItem *CGameManager::getRoom() {
+	return _gameState._gameLocation.getRoom();
+}
+
+void CGameManager::frameMessage(CRoomItem *room) {
+	if (room) {
+		// Signal the next frame
+		CFrameMsg frameMsg(g_vm->_events->getTicksCount());
+		frameMsg.execute(room, nullptr, MSGFLAG_SCAN);
+
+		if (!_soundMaker) {
+			// Check for a sound maker in the room
+			_soundMaker = dynamic_cast<CBackgroundSoundMaker *>(
+				_project->findByName("zBackgroundSoundMaker"));
+		}
+
+		// If there's a sound maker, dispatch the event to it as well
+		if (_soundMaker)
+			frameMsg.execute(_soundMaker);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 38edc6e..f63b571 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -30,6 +30,7 @@
 #include "titanic/simple_file.h"
 #include "titanic/video_surface.h"
 #include "titanic/true_talk/true_talk_manager.h"
+#include "titanic/sound/background_sound_maker.h"
 #include "titanic/sound/music_room.h"
 #include "titanic/sound/sound.h"
 
@@ -74,6 +75,11 @@ public:
 	 * Called when a game has finished being saved
 	 */
 	void postSave();
+
+	/**
+	 * Handles an update
+	 */
+	void update(uint ticks);
 };
 
 class CGameManager {
@@ -81,13 +87,28 @@ private:
 	CTrueTalkManager _trueTalkManager;
 	CGameManagerList _list;
 	int _field30;
-	int _field34;
+	CBackgroundSoundMaker *_soundMaker;
 	CVideoSurface *_videoSurface1;
 	int _field4C;
 	int _field54;
 	CVideoSurface *_videoSurface2;
 	uint _lastDiskTicksCount;
 	uint _tickCount2;
+private:
+	/**
+	 * Return the current room
+	 */
+	CRoomItem *getRoom();
+
+	/**
+	 * Generates a message for the next game frame
+	 */
+	void frameMessage(CRoomItem *room);
+
+	/**
+	 * Handles any ongoing movie playback
+	 */
+	void handleMovies();
 public:
 	CProjectItem *_project;
 	CGameView *_gameView;
@@ -167,6 +188,10 @@ public:
 	void viewChange();
 
 	bool test54() const { return !_field54; }
+
+	void inc54() { ++_field54; }
+
+	void dec54() { --_field54; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index f10f945..f906ff6 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -27,6 +27,13 @@
 
 namespace Titanic {
 
+bool CGameStateList::isViewChanging() const {
+	warning("TODO: CGameStateList::isViewChanging");
+	return false;
+}
+
+/*------------------------------------------------------------------------*/
+
 CGameState::CGameState(CGameManager *gameManager) :
 		_gameManager(gameManager), _gameLocation(this),
 		_field8(0), _fieldC(0), _mode(GSMODE_0), _field14(0), _field18(0),
@@ -98,6 +105,13 @@ void CGameState::enterView() {
 	CRoomItem *oldRoom = oldView->findNode()->findRoom();
 	CRoomItem *newRoom = newView->findNode()->findRoom();
 	_gameManager->playClip(_list._movieClip, oldRoom, newRoom);
+
+	_gameManager->_sound.preEnterView(newView, newRoom != oldRoom);
+	_gameManager->dec54();
+	oldView->enterView(newView);
+
+	_list._view = nullptr;
+	_list._movieClip = nullptr;
 }
 
 void CGameState::triggerLink(CLinkItem *link) {
@@ -127,9 +141,17 @@ void CGameState::changeView(CViewItem *newView, CMovieClip *clip) {
 			_gameManager->playClip(clip, oldRoom, newRoom);
 
 		// Final view change handling
-		_gameManager->_sound.viewChanged(newView, newRoom != oldRoom);
+		_gameManager->_sound.preEnterView(newView, newRoom != oldRoom);
 		oldView->enterView(newView);
 	}
 }
 
+void CGameState::checkForViewChange() {
+	if (_mode == GSMODE_2 && _list.isViewChanging()) {
+		setMode(GSMODE_1);
+		if (_list._view)
+			enterView();
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index b9d25e9..37bb603 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -40,6 +40,8 @@ public:
 	CMovieClip *_movieClip;
 public:
 	CGameStateList() : List<ListItem>(), _view(nullptr), _movieClip(nullptr) {}
+
+	bool isViewChanging() const;
 };
 
 class CGameState {
@@ -101,6 +103,11 @@ public:
 	 * Changes the current view
 	 */
 	void changeView(CViewItem *newView, CMovieClip *clip);
+
+	/**
+	 * Check for whether it's time to change the active view
+	 */
+	void checkForViewChange();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index bf901bb..86ad072 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -67,7 +67,7 @@ void CSTGameView::setView(CViewItem *view) {
 	_gameWindow->setActiveView(view);
 }
 
-void CSTGameView::proc4() {
+void CSTGameView::proc4(const Common::Rect &bounds) {
 	_gameWindow->fn2();
 }
 
diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h
index 9ede9d6..be4d934 100644
--- a/engines/titanic/game_view.h
+++ b/engines/titanic/game_view.h
@@ -57,7 +57,7 @@ public:
 	 */
 	virtual void setView(CViewItem *item) = 0;
 	
-	virtual void proc4() = 0;
+	virtual void proc4(const Common::Rect &bounds) = 0;
 
 	/**
 	 * Creates a surface from a specified resource
@@ -76,7 +76,7 @@ public:
 	 */
 	virtual void setView(CViewItem *item);
 
-	virtual void proc4();
+	virtual void proc4(const Common::Rect &bounds);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 317cde5..ccea453 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -298,6 +298,7 @@ MESSAGE2(CEnterNodeMsg, CNodeItem *, oldNode, nullptr, CNodeItem *, newNode, nul
 MESSAGE2(CEnterRoomMsg, CRoomItem *, oldRoom, nullptr, CRoomItem *, newRoom, nullptr);
 MESSAGE2(CEnterViewMsg, CViewItem *, oldView, nullptr, CViewItem *, newView, nullptr);
 MESSAGE0(CErasePhonographCylinderMsg);
+MESSAGE1(CFrameMsg, uint, ticks, 0);
 MESSAGE2(CFreshenCookieMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CGetChevClassBits, int, value, 0);
 MESSAGE1(CGetChevClassNum, int, value, 0);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index af5c89c..f62ef96 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -20,6 +20,7 @@ MODULE_OBJS := \
 	screen_manager.o \
 	simple_file.o \
 	string.o \
+	text_cursor.o \
 	titanic.o \
 	video_surface.o \
 	carry/auditory_centre.o \
diff --git a/engines/titanic/mouse_cursor.cpp b/engines/titanic/mouse_cursor.cpp
index ee252cc..578bf99 100644
--- a/engines/titanic/mouse_cursor.cpp
+++ b/engines/titanic/mouse_cursor.cpp
@@ -37,4 +37,8 @@ void CMouseCursor::setCursorId(int id) {
 	warning("CMouseCursor::setCursorId");
 }
 
+void CMouseCursor::update() {
+	warning("CMouseCursor::update");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/mouse_cursor.h b/engines/titanic/mouse_cursor.h
index ecbee85..c6df65d 100644
--- a/engines/titanic/mouse_cursor.h
+++ b/engines/titanic/mouse_cursor.h
@@ -32,6 +32,11 @@ public:
 	void show();
 	void hide();
 	void setCursorId(int id);
+	
+	/**
+	 * Updates the mouse cursor
+	 */
+	void update();
 };
 
 
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 0c3ab6f..59a322e 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -25,15 +25,6 @@
 
 namespace Titanic {
 
-CScreenManagerRec::CScreenManagerRec() {
-	_field0 = 0;
-	_field4 = 0;
-	_field8 = 0;
-	_fieldC = 0;
-}
-
-/*------------------------------------------------------------------------*/
-
 CScreenManager *CScreenManager::_screenManagerPtr;
 CScreenManager *CScreenManager::_currentScreenManagerPtr;
 
@@ -71,6 +62,11 @@ CScreenManager *CScreenManager::setCurrent() {
 	return _currentScreenManagerPtr;
 }
 
+void CScreenManager::setSurfaceBounds(int surfaceNum, const Common::Rect &r) {
+	if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
+		_backSurfaces[surfaceNum]._bounds = r;
+}
+
 /*------------------------------------------------------------------------*/
 
 OSScreenManager::OSScreenManager(TitanicEngine *vm): CScreenManager(vm),
@@ -115,7 +111,7 @@ CVideoSurface *OSScreenManager::getSurface(int surfaceNum) const {
 	if (surfaceNum == -1)
 		return _frontRenderSurface;
 	else if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
-		return _backSurfaces[surfaceNum];
+		return _backSurfaces[surfaceNum]._surface;
 	else
 		return nullptr;
 }
@@ -164,7 +160,7 @@ void OSScreenManager::destroyFrontAndBackBuffers() {
 	_frontRenderSurface = nullptr;
 
 	for (uint idx = 0; idx < _backSurfaces.size(); ++idx)
-		delete _backSurfaces[idx];
+		delete _backSurfaces[idx]._surface;
 	_backSurfaces.clear();
 }
 
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index 1be2de9..a8b7ee4 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -29,6 +29,7 @@
 #include "titanic/font.h"
 #include "titanic/input_handler.h"
 #include "titanic/mouse_cursor.h"
+#include "titanic/text_cursor.h"
 #include "titanic/video_surface.h"
 #include "titanic/core/resource_key.h"
 
@@ -36,20 +37,11 @@ namespace Titanic {
 
 class TitanicEngine;
 
-class CSurface {
-};
-
-class CScreenManagerRec {
-public:
-	int _field0;
-	int _field4;
-	int _field8;
-	int _fieldC;
-public:
-	CScreenManagerRec();
-};
-
 class CScreenManager {
+	struct VideoSurfaceEntry {
+		CVideoSurface *_surface;
+		Common::Rect _bounds;
+	};
 protected:
 	TitanicEngine *_vm;
 public:
@@ -61,11 +53,10 @@ public:
 	 */
 	static CScreenManager *setCurrent();
 public:
-	Common::Array<CVideoSurface *> _backSurfaces;
+	Common::Array<VideoSurfaceEntry> _backSurfaces;
 	CVideoSurface *_frontRenderSurface;
-	CScreenManagerRec _entries[2];
 	CMouseCursor *_mouseCursor;
-	void *_textCursor;
+	CTextCursor *_textCursor;
 	CInputHandler *_inputHandler;
 	int _fontNumber;
 public:
@@ -118,6 +109,8 @@ public:
 	virtual void proc25() = 0;
 	virtual void showCursor() = 0;
 	virtual void proc27() = 0;
+
+	void setSurfaceBounds(int surfaceNum, const Common::Rect &r);
 };
 
 class OSScreenManager: CScreenManager {
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index 54c1450..14dba2e 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -43,8 +43,8 @@ void CSound::preLoad() {
 		_gameManager->_musicRoom.preLoad();
 }
 
-void CSound::viewChanged(CViewItem *newView, bool isNewRoom) {
-	warning("CSound::viewChanged");
+void CSound::preEnterView(CViewItem *newView, bool isNewRoom) {
+	warning("CSound::preEnterView");
 }
 
 } // End of namespace Titanic z
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index 0bfd3f2..4c0dab5 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -71,7 +71,7 @@ public:
 	/**
 	 * Called when the view has been changed
 	 */
-	void viewChanged(CViewItem *newView, bool isNewRoom);
+	void preEnterView(CViewItem *newView, bool isNewRoom);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/text_cursor.cpp b/engines/titanic/text_cursor.cpp
new file mode 100644
index 0000000..e591dc3
--- /dev/null
+++ b/engines/titanic/text_cursor.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/rect.h"
+#include "common/textconsole.h"
+#include "titanic/text_cursor.h"
+
+namespace Titanic {
+
+CTextCursor::CTextCursor() : _active(false) {
+}
+
+Common::Rect CTextCursor::getBounds() {
+	warning("CTextCursor::getBounds");
+	return Common::Rect();
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/text_cursor.h b/engines/titanic/text_cursor.h
new file mode 100644
index 0000000..1b03abd
--- /dev/null
+++ b/engines/titanic/text_cursor.h
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TEXT_CURSOR_H
+#define TITANIC_TEXT_CURSOR_H
+
+#include "common/scummsys.h"
+
+namespace Titanic {
+
+class CTextCursor {
+public:
+	bool _active;
+public:
+	CTextCursor();
+
+	Common::Rect getBounds();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TEXT_CURSOR_H */
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 3d4a8ec..d13356b 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -183,4 +183,12 @@ void CTrueTalkManager::viewChange() {
 	warning("CTrueTalkManager::viewChange");
 }
 
+void CTrueTalkManager::update1() {
+	warning("CTrueTalkManager::update1");
+}
+
+void CTrueTalkManager::update2() {
+	warning("CTrueTalkManager::update2");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 4c74ac2..6724baa 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -106,6 +106,10 @@ public:
 	 * Returns the scripts for the manager
 	 */
 	TTScripts &getScripts() { return _scripts; }
+
+	void update1();
+
+	void update2();
 };
 
 } // End of namespace Titanic


Commit: 8b5ad45f4a2881d5f72b03855c2d8c1c0f63d70d
    https://github.com/scummvm/scummvm/commit/8b5ad45f4a2881d5f72b03855c2d8c1c0f63d70d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-19T23:02:41-04:00

Commit Message:
TITANIC: Minor fixes executing game manager update

Changed paths:
    engines/titanic/core/view_item.cpp
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h



diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index a80f25b..c481666 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -31,7 +31,7 @@
 namespace Titanic {
 
 CViewItem::CViewItem() : CNamedItem() {
-	Common::fill(&_buttonUpTargets[0], &_buttonUpTargets[3], nullptr);
+	Common::fill(&_buttonUpTargets[0], &_buttonUpTargets[4], nullptr);
 	_field24 = 0;
 	_field28 = 0.0;
 	_viewNumber = 0;
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 1c480e5..6753231 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -175,7 +175,7 @@ void CGameManager::update() {
 		// And the text cursor
 		CScreenManager *screenManager = CScreenManager::_screenManagerPtr;
 		CTextCursor *textCursor = screenManager->_textCursor;
-		if (textCursor->_active)
+		if (textCursor && textCursor->_active)
 			_bounds.extend(textCursor->getBounds());
 		
 		// Set the surface bounds
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index f63b571..f18696b 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -178,7 +178,7 @@ public:
 	void playClip(CMovieClip *clip, CRoomItem *oldRoom, CRoomItem *newRoom);
 
 	/**
-	 * Updates the state of the manager
+	 * Main frame update method for the game
 	 */
 	void update();
 


Commit: ea54e6244e75c609e6886ba210f80fb22c479d3f
    https://github.com/scummvm/scummvm/commit/ea54e6244e75c609e6886ba210f80fb22c479d3f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-20T00:01:40-04:00

Commit Message:
TITANIC: Fixes/renames for files manager

Changed paths:
    engines/titanic/files_manager.cpp
    engines/titanic/files_manager.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_view.cpp
    engines/titanic/game_view.h
    engines/titanic/input_handler.cpp
    engines/titanic/main_game_window.cpp
    engines/titanic/main_game_window.h
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h



diff --git a/engines/titanic/files_manager.cpp b/engines/titanic/files_manager.cpp
index 47da8e5..7ff0b51 100644
--- a/engines/titanic/files_manager.cpp
+++ b/engines/titanic/files_manager.cpp
@@ -27,7 +27,7 @@
 namespace Titanic {
 
 CFilesManager::CFilesManager() : _gameManager(nullptr), 
-		_assetsPath("Assets"), _field0(0), _field14(0), 
+		_assetsPath("Assets"), _field0(0), _drive(-1), 
 		_field18(0), _field1C(0), _field3C(0) {
 }
 
@@ -65,12 +65,20 @@ bool CFilesManager::scanForFile(const CString &name) {
 	return fileExists(fname);
 }
 
-void CFilesManager::fn1() {
-	warning("TODO: CFilesManager::fn1");
+void CFilesManager::loadDrive() {
+	assert(_drive == -1);
+	resetView();
 }
 
 void CFilesManager::debug(CScreenManager *screenManager) {
 	warning("TODO: CFilesManager::debug");
 }
 
+void CFilesManager::resetView() {
+	if (_gameManager) {
+		_gameManager->_gameState.setMode(GSMODE_1);
+		_gameManager->initBounds();
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/files_manager.h b/engines/titanic/files_manager.h
index a767056..ab92151 100644
--- a/engines/titanic/files_manager.h
+++ b/engines/titanic/files_manager.h
@@ -40,7 +40,7 @@ private:
 	CString _string1;
 	CString _string2;
 	int _field0;
-	int _field14;
+	int _drive;
 	int _field18;
 	int _field1C;
 	int _field3C;
@@ -65,9 +65,17 @@ public:
 	 */
 	bool scanForFile(const CString &name);
 
-	void fn1();
+	/**
+	 * Handles displaying a load drive view if necessary
+	 */
+	void loadDrive();
 
 	void debug(CScreenManager *screenManager);
+
+	/**
+	 * Resets the view being displayed
+	 */
+	void resetView();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 6753231..49a881d 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -181,8 +181,9 @@ void CGameManager::update() {
 		// Set the surface bounds
 		screenManager->setSurfaceBounds(0, _bounds);
 
+		// Handle redrawing the view
 		if (!_bounds.isEmpty()) {
-			_gameView->proc4(_bounds);
+			_gameView->draw(_bounds);
 			_bounds = Common::Rect();
 		}
 
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index 86ad072..d04c3e1 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -67,8 +67,8 @@ void CSTGameView::setView(CViewItem *view) {
 	_gameWindow->setActiveView(view);
 }
 
-void CSTGameView::proc4(const Common::Rect &bounds) {
-	_gameWindow->fn2();
+void CSTGameView::draw(const Common::Rect &bounds) {
+	_gameWindow->draw();
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h
index be4d934..a3e1fe7 100644
--- a/engines/titanic/game_view.h
+++ b/engines/titanic/game_view.h
@@ -57,7 +57,7 @@ public:
 	 */
 	virtual void setView(CViewItem *item) = 0;
 	
-	virtual void proc4(const Common::Rect &bounds) = 0;
+	virtual void draw(const Common::Rect &bounds) = 0;
 
 	/**
 	 * Creates a surface from a specified resource
@@ -76,7 +76,10 @@ public:
 	 */
 	virtual void setView(CViewItem *item);
 
-	virtual void proc4(const Common::Rect &bounds);
+	/**
+	 * Handles drawing the view
+	 */
+	virtual void draw(const Common::Rect &bounds);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index 5d50c00..c710374 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -53,7 +53,7 @@ void CInputHandler::handleMessage(const CMessage &msg, bool respectLock) {
 		if (_gameManager->_gameState._mode == GSMODE_1) {
 			processMessage(&msg);
 		} else if (!msg.isMouseMsg()) {
-			g_vm->_filesManager.fn1();
+			g_vm->_filesManager.loadDrive();
 		}
 	}
 }
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 2c148c8..6a6a46e 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -55,7 +55,6 @@ void CMainGameWindow::applicationStarting() {
 	// Set the video mode
 	CScreenManager *screenManager = CScreenManager::setCurrent();
 	screenManager->setMode(640, 480, 16, 1, true);
-	_inputAllowed = true;
 
 	// TODO: Remove initial background and palette
 
@@ -67,6 +66,8 @@ void CMainGameWindow::applicationStarting() {
 
 	// Load either a new game or selected existing save
 	_project->loadGame(saveSlot);
+	_inputAllowed = true;
+	_gameManager->_gameState.setMode(GSMODE_1);
 
 	// TODO: Cursor/image
 
@@ -109,7 +110,7 @@ void CMainGameWindow::setActiveView(CViewItem *viewItem) {
 	}
 }
 
-void CMainGameWindow::fn2() {
+void CMainGameWindow::draw() {
 	if (_gameManager) {
 		if (_gameView->_surface) {
 			CViewItem *view = _gameManager->getView();
@@ -128,7 +129,7 @@ void CMainGameWindow::fn2() {
 			warning("TODO: Stuff");
 
 		case GSMODE_5:
-			g_vm->_filesManager.fn1();
+			g_vm->_filesManager.debug(scrManager);
 			break;
 
 		default:
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 6a72dbf..8f6fb81 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -74,7 +74,10 @@ public:
 	 */
 	void setActiveView(CViewItem *viewItem);
 
-	void fn2();
+	/**
+	 * Main draw method for the window
+	 */
+	void draw();
 
 	/**
 	 * Called by the event handler when a mouse event has been generated
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 59a322e..fe15d9a 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -51,7 +51,7 @@ void CScreenManager::setWindowHandle(int v) {
 }
 
 bool CScreenManager::resetWindowHandle(int v) {
-	proc27();
+	hideCursor();
 	return true;
 }
 
@@ -79,6 +79,8 @@ OSScreenManager::OSScreenManager(TitanicEngine *vm): CScreenManager(vm),
 
 OSScreenManager::~OSScreenManager() {
 	destroyFrontAndBackBuffers();
+	delete _mouseCursor;
+	delete _textCursor;
 }
 
 void OSScreenManager::setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) {
@@ -152,8 +154,14 @@ CVideoSurface *OSScreenManager::createSurface(const CResourceKey &key) {
 void OSScreenManager::proc23() {}
 void OSScreenManager::proc24() {}
 void OSScreenManager::proc25() {}
-void OSScreenManager::showCursor() {}
-void OSScreenManager::proc27() {}
+
+void OSScreenManager::showCursor() {
+
+}
+
+void OSScreenManager::hideCursor() {
+
+}
 
 void OSScreenManager::destroyFrontAndBackBuffers() {
 	delete _frontRenderSurface;
@@ -165,7 +173,16 @@ void OSScreenManager::destroyFrontAndBackBuffers() {
 }
 
 void OSScreenManager::loadCursors() {
-	// TODO
+	if (_mouseCursor) {
+		hideCursor();
+		delete _mouseCursor;
+	}
+	_mouseCursor = new CMouseCursor();
+	showCursor();
+
+	if (!_textCursor) {
+		_textCursor = new CTextCursor();
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index a8b7ee4..a5fa562 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -108,7 +108,7 @@ public:
 	virtual void proc24() = 0;
 	virtual void proc25() = 0;
 	virtual void showCursor() = 0;
-	virtual void proc27() = 0;
+	virtual void hideCursor() = 0;
 
 	void setSurfaceBounds(int surfaceNum, const Common::Rect &r);
 };
@@ -177,7 +177,7 @@ public:
 	virtual void proc24();
 	virtual void proc25();
 	virtual void showCursor();
-	virtual void proc27();
+	virtual void hideCursor();
 };
 
 } // End of namespace Titanic


Commit: 3c852cc240221785598023de56e5a71a0d8806fa
    https://github.com/scummvm/scummvm/commit/3c852cc240221785598023de56e5a71a0d8806fa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-20T14:55:41-04:00

Commit Message:
Merge branch 'master' into titanic

Changed paths:
  A backends/platform/dingux/README.GCW0
  A backends/platform/dingux/build.gcw0.sh
  A devtools/create_wage/create_wage.sh
  A engines/agi/appleIIgs_timedelay_overwrite.h
  A engines/avalanche/POTFILES
  A engines/hugo/POTFILES
  A engines/sci/graphics/celobj32.cpp
  A engines/sci/graphics/celobj32.h
  A engines/sci/graphics/lists32.h
  A engines/sci/graphics/plane32.cpp
  A engines/sci/graphics/plane32.h
  A engines/sci/graphics/remap.cpp
  A engines/sci/graphics/remap.h
  A engines/sci/graphics/screen_item32.cpp
  A engines/sci/graphics/screen_item32.h
  A engines/sherlock/POTFILES
  A engines/sherlock/scalpel/3do/scalpel_3do_screen.cpp
  A engines/sherlock/scalpel/3do/scalpel_3do_screen.h
  A engines/sherlock/tattoo/tattoo_screen.cpp
  A engines/sherlock/tattoo/tattoo_screen.h
  A engines/sword25/POTFILES
  A engines/toon/POTFILES
  A engines/tsage/screen.cpp
  A engines/tsage/screen.h
  A engines/voyeur/screen.cpp
  A engines/voyeur/screen.h
  A engines/wage/combat.cpp
  A engines/wage/configure.engine
  A engines/wage/debugger.cpp
  A engines/wage/debugger.h
  A engines/wage/design.cpp
  A engines/wage/design.h
  A engines/wage/detection.cpp
  A engines/wage/detection_tables.h
  A engines/wage/dialog.cpp
  A engines/wage/dialog.h
  A engines/wage/entities.cpp
  A engines/wage/entities.h
  A engines/wage/gui-console.cpp
  A engines/wage/gui.cpp
  A engines/wage/gui.h
  A engines/wage/menu.cpp
  A engines/wage/menu.h
  A engines/wage/module.mk
  A engines/wage/randomhat.cpp
  A engines/wage/randomhat.h
  A engines/wage/script.cpp
  A engines/wage/script.h
  A engines/wage/sound.cpp
  A engines/wage/sound.h
  A engines/wage/util.cpp
  A engines/wage/wage.cpp
  A engines/wage/wage.h
  A engines/wage/world.cpp
  A engines/wage/world.h
  A graphics/managed_surface.cpp
  A graphics/managed_surface.h
  A graphics/screen.cpp
  A graphics/screen.h
  A po/da_DK.po
  A po/sv_SE.po
  A po/zh-Latn_CN.po
  R engines/voyeur/graphics.cpp
  R engines/voyeur/graphics.h
  R po/da_DA.po
  R po/se_SE.po
    AUTHORS
    COPYRIGHT
    NEWS
    README
    audio/mods/maxtrax.cpp
    audio/softsynth/mt32.cpp
    backends/events/dinguxsdl/dinguxsdl-events.cpp
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp
    backends/graphics/surfacesdl/surfacesdl-graphics.h
    backends/midi/windows.cpp
    backends/platform/android/gfx.cpp
    backends/platform/dc/vmsave.cpp
    backends/platform/dingux/dingux.mk
    backends/platform/ios7/ios7_osys_main.cpp
    backends/platform/ios7/ios7_osys_main.h
    backends/platform/maemo/debian/changelog
    backends/platform/maemo/debian/rules
    backends/platform/sdl/amigaos/amigaos.mk
    backends/platform/sdl/sdl-sys.h
    backends/platform/sdl/win32/win32-main.cpp
    backends/platform/tizen/system.cpp
    backends/platform/wince/wince-sdl.cpp
    backends/plugins/win32/win32-provider.cpp
    backends/saves/default/default-saves.cpp
    backends/saves/default/default-saves.h
    backends/taskbar/win32/win32-taskbar.cpp
    base/commandLine.cpp
    common/archive.cpp
    common/array.h
    common/dcl.cpp
    common/macresman.cpp
    common/macresman.h
    common/rational.h
    common/rect.h
    common/savefile.h
    common/taskbar.h
    configure
    devtools/create_project/create_project.cpp
    devtools/create_project/msbuild.cpp
    devtools/create_project/scripts/postbuild.cmd
    devtools/create_project/scripts/prebuild.cmd
    devtools/credits.pl
    dists/gcw0/default.gcw0.desktop
    dists/ios7/Info.plist
    dists/ios7/Info.plist.in
    dists/macosx/DS_Store
    dists/openpandora/pnd_make.sh
    dists/samsungtv/README-SamsungTV
    dists/win32/ScummVM.iss
    doc/cz/PrectiMe
    doc/de/Liesmich
    doc/de/Neues
    engines/access/access.cpp
    engines/access/asurface.cpp
    engines/access/asurface.h
    engines/access/detection.cpp
    engines/access/detection_tables.h
    engines/access/events.cpp
    engines/access/events.h
    engines/access/files.cpp
    engines/access/files.h
    engines/access/font.cpp
    engines/access/screen.cpp
    engines/access/screen.h
    engines/access/scripts.cpp
    engines/access/video.cpp
    engines/access/video/movie_decoder.cpp
    engines/advancedDetector.cpp
    engines/advancedDetector.h
    engines/agi/agi.cpp
    engines/agi/agi.h
    engines/agi/checks.cpp
    engines/agi/console.cpp
    engines/agi/console.h
    engines/agi/cycle.cpp
    engines/agi/detection.cpp
    engines/agi/detection_tables.h
    engines/agi/font.cpp
    engines/agi/font.h
    engines/agi/global.cpp
    engines/agi/graphics.cpp
    engines/agi/graphics.h
    engines/agi/inv.cpp
    engines/agi/keyboard.cpp
    engines/agi/menu.cpp
    engines/agi/menu.h
    engines/agi/motion.cpp
    engines/agi/op_cmd.cpp
    engines/agi/opcodes.cpp
    engines/agi/palette.h
    engines/agi/picture.cpp
    engines/agi/preagi.cpp
    engines/agi/preagi_mickey.cpp
    engines/agi/saveload.cpp
    engines/agi/sound_2gs.cpp
    engines/agi/sprite.cpp
    engines/agi/systemui.cpp
    engines/agi/systemui.h
    engines/agi/text.cpp
    engines/agi/text.h
    engines/agi/view.cpp
    engines/agi/view.h
    engines/agi/words.cpp
    engines/agi/words.h
    engines/agos/configure.engine
    engines/agos/detection.cpp
    engines/agos/sound.cpp
    engines/avalanche/configure.engine
    engines/avalanche/detection.cpp
    engines/avalanche/parser.cpp
    engines/bbvs/bbvs.cpp
    engines/bbvs/detection.cpp
    engines/bbvs/dialogs.cpp
    engines/cge/POTFILES
    engines/cge/detection.cpp
    engines/cge/events.cpp
    engines/cge2/POTFILES
    engines/cge2/detection.cpp
    engines/cge2/events.cpp
    engines/cge2/vga13h.cpp
    engines/cine/anim.cpp
    engines/cine/detection.cpp
    engines/cine/saveload.cpp
    engines/cine/script_fw.cpp
    engines/composer/configure.engine
    engines/composer/detection.cpp
    engines/cruise/detection.cpp
    engines/draci/detection.cpp
    engines/drascula/detection.cpp
    engines/dreamweb/detection.cpp
    engines/engine.cpp
    engines/fullpipe/configure.engine
    engines/fullpipe/detection.cpp
    engines/game.cpp
    engines/game.h
    engines/gob/detection/detection.cpp
    engines/gob/script.cpp
    engines/gob/sound/adlib.cpp
    engines/groovie/configure.engine
    engines/groovie/detection.cpp
    engines/groovie/groovie.cpp
    engines/hopkins/configure.engine
    engines/hopkins/detection.cpp
    engines/hugo/detection.cpp
    engines/hugo/file.cpp
    engines/kyra/debugger.cpp
    engines/kyra/detection.cpp
    engines/kyra/detection_tables.h
    engines/kyra/gui_lol.cpp
    engines/kyra/gui_v1.cpp
    engines/kyra/sound.cpp
    engines/lab/configure.engine
    engines/lab/detection.cpp
    engines/lab/lab.cpp
    engines/lab/processroom.cpp
    engines/lab/savegame.cpp
    engines/lastexpress/configure.engine
    engines/lastexpress/detection.cpp
    engines/lure/detection.cpp
    engines/made/detection.cpp
    engines/mads/debugger.cpp
    engines/mads/detection.cpp
    engines/mads/dialogs.cpp
    engines/mads/dragonsphere/dragonsphere_scenes.cpp
    engines/mads/events.cpp
    engines/mads/font.cpp
    engines/mads/game.cpp
    engines/mads/mads.cpp
    engines/mads/mads.h
    engines/mads/menu_views.cpp
    engines/mads/msurface.cpp
    engines/mads/msurface.h
    engines/mads/nebular/dialogs_nebular.cpp
    engines/mads/nebular/game_nebular.cpp
    engines/mads/nebular/menu_nebular.cpp
    engines/mads/nebular/nebular_scenes.cpp
    engines/mads/nebular/nebular_scenes3.cpp
    engines/mads/nebular/nebular_scenes5.cpp
    engines/mads/phantom/phantom_scenes.cpp
    engines/mads/rails.cpp
    engines/mads/scene.cpp
    engines/mads/scene_data.cpp
    engines/mads/screen.cpp
    engines/mads/screen.h
    engines/mads/sequence.cpp
    engines/mads/sprites.cpp
    engines/mads/user_interface.cpp
    engines/mads/user_interface.h
    engines/metaengine.h
    engines/mohawk/configure.engine
    engines/mohawk/console.cpp
    engines/mohawk/console.h
    engines/mohawk/detection.cpp
    engines/mohawk/detection_tables.h
    engines/mohawk/dialogs.cpp
    engines/mohawk/dialogs.h
    engines/mohawk/myst.cpp
    engines/mohawk/myst.h
    engines/mohawk/myst_areas.cpp
    engines/mohawk/myst_areas.h
    engines/mohawk/myst_graphics.cpp
    engines/mohawk/myst_graphics.h
    engines/mohawk/myst_scripts.cpp
    engines/mohawk/myst_scripts.h
    engines/mohawk/myst_stacks/channelwood.cpp
    engines/mohawk/myst_stacks/channelwood.h
    engines/mohawk/myst_stacks/credits.cpp
    engines/mohawk/myst_stacks/credits.h
    engines/mohawk/myst_stacks/demo.h
    engines/mohawk/myst_stacks/dni.h
    engines/mohawk/myst_stacks/intro.cpp
    engines/mohawk/myst_stacks/intro.h
    engines/mohawk/myst_stacks/makingof.h
    engines/mohawk/myst_stacks/mechanical.cpp
    engines/mohawk/myst_stacks/mechanical.h
    engines/mohawk/myst_stacks/myst.cpp
    engines/mohawk/myst_stacks/myst.h
    engines/mohawk/myst_stacks/preview.cpp
    engines/mohawk/myst_stacks/preview.h
    engines/mohawk/myst_stacks/selenitic.cpp
    engines/mohawk/myst_stacks/selenitic.h
    engines/mohawk/myst_stacks/slides.h
    engines/mohawk/myst_stacks/stoneship.cpp
    engines/mohawk/myst_stacks/stoneship.h
    engines/mohawk/myst_state.cpp
    engines/mohawk/myst_state.h
    engines/mohawk/sound.cpp
    engines/mohawk/sound.h
    engines/mohawk/video.cpp
    engines/mohawk/video.h
    engines/mortevielle/configure.engine
    engines/mortevielle/detection.cpp
    engines/neverhood/configure.engine
    engines/neverhood/detection.cpp
    engines/parallaction/detection.cpp
    engines/parallaction/saveload.cpp
    engines/pegasus/configure.engine
    engines/pegasus/detection.cpp
    engines/prince/configure.engine
    engines/prince/detection.cpp
    engines/prince/detection.h
    engines/prince/graphics.cpp
    engines/queen/detection.cpp
    engines/saga/configure.engine
    engines/saga/detection.cpp
    engines/saga/interface.cpp
    engines/saga/music.cpp
    engines/saga/puzzle.cpp
    engines/saga/render.cpp
    engines/saga/saga.cpp
    engines/savestate.h
    engines/sci/configure.engine
    engines/sci/console.cpp
    engines/sci/console.h
    engines/sci/decompressor.cpp
    engines/sci/detection.cpp
    engines/sci/detection_tables.h
    engines/sci/engine/kernel.cpp
    engines/sci/engine/kernel.h
    engines/sci/engine/kernel_tables.h
    engines/sci/engine/kevent.cpp
    engines/sci/engine/kfile.cpp
    engines/sci/engine/kgraphics.cpp
    engines/sci/engine/kgraphics32.cpp
    engines/sci/engine/kmisc.cpp
    engines/sci/engine/kpathing.cpp
    engines/sci/engine/ksound.cpp
    engines/sci/engine/kstring.cpp
    engines/sci/engine/object.cpp
    engines/sci/engine/object.h
    engines/sci/engine/savegame.cpp
    engines/sci/engine/savegame.h
    engines/sci/engine/script_patches.cpp
    engines/sci/engine/script_patches.h
    engines/sci/engine/scriptdebug.cpp
    engines/sci/engine/seg_manager.cpp
    engines/sci/engine/segment.h
    engines/sci/engine/selector.cpp
    engines/sci/engine/selector.h
    engines/sci/engine/state.cpp
    engines/sci/engine/state.h
    engines/sci/engine/vm.cpp
    engines/sci/engine/vm_types.cpp
    engines/sci/engine/vm_types.h
    engines/sci/engine/workarounds.cpp
    engines/sci/engine/workarounds.h
    engines/sci/event.cpp
    engines/sci/event.h
    engines/sci/graphics/animate.cpp
    engines/sci/graphics/animate.h
    engines/sci/graphics/cache.cpp
    engines/sci/graphics/cache.h
    engines/sci/graphics/compare.cpp
    engines/sci/graphics/compare.h
    engines/sci/graphics/controls16.cpp
    engines/sci/graphics/controls32.cpp
    engines/sci/graphics/controls32.h
    engines/sci/graphics/cursor.cpp
    engines/sci/graphics/cursor.h
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/frameout.h
    engines/sci/graphics/helpers.h
    engines/sci/graphics/palette.cpp
    engines/sci/graphics/palette.h
    engines/sci/graphics/palette32.cpp
    engines/sci/graphics/palette32.h
    engines/sci/graphics/picture.cpp
    engines/sci/graphics/picture.h
    engines/sci/graphics/screen.cpp
    engines/sci/graphics/screen.h
    engines/sci/graphics/text32.cpp
    engines/sci/graphics/text32.h
    engines/sci/graphics/view.cpp
    engines/sci/graphics/view.h
    engines/sci/module.mk
    engines/sci/parser/vocabulary.cpp
    engines/sci/parser/vocabulary.h
    engines/sci/resource.cpp
    engines/sci/resource.h
    engines/sci/resource_audio.cpp
    engines/sci/sci.cpp
    engines/sci/sci.h
    engines/sci/sound/drivers/amigamac.cpp
    engines/sci/sound/soundcmd.cpp
    engines/sci/util.cpp
    engines/sci/util.h
    engines/scumm/actor.cpp
    engines/scumm/charset-fontdata.cpp
    engines/scumm/configure.engine
    engines/scumm/detection.cpp
    engines/scumm/he/sound_he.cpp
    engines/scumm/imuse_digi/dimuse_track.cpp
    engines/scumm/players/player_ad.cpp
    engines/scumm/players/player_ad.h
    engines/scumm/players/player_v4a.cpp
    engines/scumm/saveload.cpp
    engines/scumm/scumm.cpp
    engines/scumm/scumm_v4.h
    engines/scumm/sound.cpp
    engines/sherlock/animation.cpp
    engines/sherlock/events.cpp
    engines/sherlock/fixed_text.cpp
    engines/sherlock/fixed_text.h
    engines/sherlock/fonts.cpp
    engines/sherlock/fonts.h
    engines/sherlock/image_file.h
    engines/sherlock/journal.cpp
    engines/sherlock/module.mk
    engines/sherlock/objects.cpp
    engines/sherlock/scalpel/scalpel.cpp
    engines/sherlock/scalpel/scalpel_darts.cpp
    engines/sherlock/scalpel/scalpel_fixed_text.cpp
    engines/sherlock/scalpel/scalpel_fixed_text.h
    engines/sherlock/scalpel/scalpel_inventory.cpp
    engines/sherlock/scalpel/scalpel_map.cpp
    engines/sherlock/scalpel/scalpel_scene.cpp
    engines/sherlock/scalpel/scalpel_screen.cpp
    engines/sherlock/scalpel/scalpel_screen.h
    engines/sherlock/scalpel/scalpel_user_interface.cpp
    engines/sherlock/scalpel/tsage/logo.cpp
    engines/sherlock/scene.cpp
    engines/sherlock/screen.cpp
    engines/sherlock/screen.h
    engines/sherlock/sherlock.h
    engines/sherlock/sound.cpp
    engines/sherlock/surface.cpp
    engines/sherlock/surface.h
    engines/sherlock/tattoo/tattoo_darts.cpp
    engines/sherlock/tattoo/tattoo_fixed_text.cpp
    engines/sherlock/tattoo/tattoo_fixed_text.h
    engines/sherlock/tattoo/tattoo_journal.cpp
    engines/sherlock/tattoo/tattoo_journal.h
    engines/sherlock/tattoo/tattoo_map.cpp
    engines/sherlock/tattoo/tattoo_people.cpp
    engines/sherlock/tattoo/tattoo_scene.cpp
    engines/sherlock/tattoo/tattoo_talk.cpp
    engines/sherlock/tattoo/tattoo_user_interface.cpp
    engines/sherlock/tattoo/widget_base.cpp
    engines/sherlock/tattoo/widget_credits.cpp
    engines/sherlock/tattoo/widget_files.cpp
    engines/sherlock/tattoo/widget_foolscap.cpp
    engines/sherlock/tattoo/widget_inventory.cpp
    engines/sherlock/tattoo/widget_options.cpp
    engines/sherlock/tattoo/widget_password.cpp
    engines/sherlock/tattoo/widget_quit.cpp
    engines/sherlock/tattoo/widget_talk.cpp
    engines/sherlock/tattoo/widget_text.cpp
    engines/sherlock/tattoo/widget_tooltip.cpp
    engines/sherlock/tattoo/widget_verbs.cpp
    engines/sky/detection.cpp
    engines/sword1/configure.engine
    engines/sword1/detection.cpp
    engines/sword1/objectman.cpp
    engines/sword1/objectman.h
    engines/sword1/router.cpp
    engines/sword2/configure.engine
    engines/sword2/router.cpp
    engines/sword2/sword2.cpp
    engines/sword25/configure.engine
    engines/sword25/detection.cpp
    engines/sword25/detection_tables.h
    engines/sword25/fmv/movieplayer.cpp
    engines/sword25/fmv/movieplayer.h
    engines/sword25/gfx/animationresource.cpp
    engines/sword25/gfx/fontresource.cpp
    engines/sword25/gfx/text.cpp
    engines/sword25/kernel/kernel_script.cpp
    engines/sword25/package/packagemanager.cpp
    engines/sword25/package/packagemanager.h
    engines/sword25/script/luacallback.cpp
    engines/sword25/script/luascript.cpp
    engines/sword25/sword25.cpp
    engines/sword25/util/lua/lbaselib.cpp
    engines/sword25/util/lua/ldo.cpp
    engines/sword25/util/lua/luaconf.h
    engines/teenagent/detection.cpp
    engines/testbed/detection.cpp
    engines/tinsel/detection.cpp
    engines/tinsel/graphics.cpp
    engines/tinsel/music.cpp
    engines/tinsel/tinsel.cpp
    engines/toltecs/configure.engine
    engines/toltecs/detection.cpp
    engines/tony/configure.engine
    engines/tony/detection.cpp
    engines/toon/configure.engine
    engines/toon/detection.cpp
    engines/toon/toon.cpp
    engines/touche/configure.engine
    engines/touche/detection.cpp
    engines/tsage/blue_force/blueforce_dialogs.cpp
    engines/tsage/blue_force/blueforce_logic.cpp
    engines/tsage/blue_force/blueforce_scenes6.cpp
    engines/tsage/converse.cpp
    engines/tsage/core.cpp
    engines/tsage/detection.cpp
    engines/tsage/detection_tables.h
    engines/tsage/events.cpp
    engines/tsage/globals.cpp
    engines/tsage/globals.h
    engines/tsage/graphics.cpp
    engines/tsage/graphics.h
    engines/tsage/module.mk
    engines/tsage/ringworld/ringworld_dialogs.cpp
    engines/tsage/ringworld/ringworld_logic.cpp
    engines/tsage/ringworld/ringworld_scenes3.cpp
    engines/tsage/ringworld/ringworld_scenes5.cpp
    engines/tsage/ringworld2/ringworld2_dialogs.cpp
    engines/tsage/ringworld2/ringworld2_logic.cpp
    engines/tsage/ringworld2/ringworld2_outpost.cpp
    engines/tsage/ringworld2/ringworld2_scenes0.cpp
    engines/tsage/saveload.cpp
    engines/tsage/scenes.cpp
    engines/tsage/tsage.h
    engines/tsage/user_interface.cpp
    engines/tucker/detection.cpp
    engines/tucker/resource.cpp
    engines/tucker/sequences.cpp
    engines/tucker/tucker.cpp
    engines/tucker/tucker.h
    engines/voyeur/animation.cpp
    engines/voyeur/data.cpp
    engines/voyeur/debugger.cpp
    engines/voyeur/detection.cpp
    engines/voyeur/events.cpp
    engines/voyeur/files.cpp
    engines/voyeur/files.h
    engines/voyeur/files_threads.cpp
    engines/voyeur/module.mk
    engines/voyeur/voyeur.cpp
    engines/voyeur/voyeur.h
    engines/voyeur/voyeur_game.cpp
    engines/wintermute/ad/ad_actor.cpp
    engines/wintermute/base/base_engine.h
    engines/wintermute/base/base_persistence_manager.cpp
    engines/wintermute/base/base_persistence_manager.h
    engines/wintermute/base/base_sub_frame.cpp
    engines/wintermute/base/file/base_disk_file.cpp
    engines/wintermute/configure.engine
    engines/wintermute/detection.cpp
    engines/wintermute/detection_tables.h
    engines/wintermute/wintermute.cpp
    engines/zvision/configure.engine
    engines/zvision/detection.cpp
    graphics/VectorRendererSpec.cpp
    graphics/VectorRendererSpec.h
    graphics/font.cpp
    graphics/font.h
    graphics/module.mk
    graphics/primitives.cpp
    graphics/primitives.h
    graphics/thumbnail.cpp
    gui/credits.h
    gui/predictivedialog.cpp
    gui/predictivedialog.h
    gui/themes/translations.dat
    image/codecs/indeo3.cpp
    image/codecs/rpza.cpp
    po/be_BY.po
    po/ca_ES.po
    po/cs_CZ.po
    po/de_DE.po
    po/es_ES.po
    po/eu.po
    po/fi_FI.po
    po/fr_FR.po
    po/gl_ES.po
    po/hu_HU.po
    po/it_IT.po
    po/nb_NO.po
    po/nl_NL.po
    po/nn_NO.po
    po/pl_PL.po
    po/pt_BR.po
    po/ru_RU.po
    po/scummvm.pot
    po/uk_UA.po
    ports.mk
    test/common/array.h
    test/common/rational.h
    video/qt_decoder.cpp





Commit: 6ebb0312ffa87316e816c4ebc31e17564450d48e
    https://github.com/scummvm/scummvm/commit/6ebb0312ffa87316e816c4ebc31e17564450d48e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-20T17:07:23-04:00

Commit Message:
TITANIC: Refactor out DirectDrawSurface to it's own class

Changed paths:
  A engines/titanic/direct_draw_surface.cpp
  A engines/titanic/direct_draw_surface.h
    engines/titanic/direct_draw.cpp
    engines/titanic/direct_draw.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control_sub12.cpp
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/direct_draw.cpp b/engines/titanic/direct_draw.cpp
index 551be5b..79ca968 100644
--- a/engines/titanic/direct_draw.cpp
+++ b/engines/titanic/direct_draw.cpp
@@ -48,9 +48,7 @@ void DirectDraw::diagnostics() {
 
 DirectDrawSurface *DirectDraw::createSurfaceFromDesc(const DDSurfaceDesc &desc) {
 	DirectDrawSurface *surface = new DirectDrawSurface();
-
-	Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
-	surface->create(desc._w, desc._h, pixelFormat);
+	surface->create(desc._w, desc._h);
 
 	return surface;
 }
@@ -95,11 +93,9 @@ void DirectDrawManager::initFullScreen() {
 		_directDraw._bpp, 0);
 
 	_mainSurface = new DirectDrawSurface();
-	_mainSurface->create(_directDraw._width, _directDraw._height,
-		Graphics::PixelFormat::createFormatCLUT8());
+	_mainSurface->create(_directDraw._width, _directDraw._height);
 	_backSurfaces[0] = new DirectDrawSurface();
-	_backSurfaces[0]->create(_directDraw._width, _directDraw._height,
-		Graphics::PixelFormat::createFormatCLUT8());
+	_backSurfaces[0]->create(_directDraw._width, _directDraw._height);
 }
 
 DirectDrawSurface *DirectDrawManager::createSurface(int w, int h, int surfaceNum) {
@@ -110,31 +106,4 @@ DirectDrawSurface *DirectDrawManager::createSurface(int w, int h, int surfaceNum
 	return _directDraw.createSurfaceFromDesc(DDSurfaceDesc(w, h));
 }
 
-/*------------------------------------------------------------------------*/
-
-Graphics::Surface *DirectDrawSurface::lock(const Common::Rect *bounds, int flags) {
-	assert(w != 0 && h != 0);
-	return this;
-}
-
-void DirectDrawSurface::unlock() {
-	assert(w != 0 && h != 0);
-}
-
-void DirectDrawSurface::fill(const Common::Rect *bounds, uint32 color) {
-	Common::Rect tempBounds;
-
-	if (bounds) {
-		// Bounds are provided, clip them to the bounds of this surface
-		tempBounds = *bounds;
-		tempBounds.clip(Common::Rect(0, 0, this->w, this->h));
-	} else {
-		// No bounds provided, so use the entire surface
-		tempBounds = Common::Rect(0, 0, this->w, this->h);
-	}
-
-	// Fill the area
-	fillRect(tempBounds, color);
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/direct_draw.h b/engines/titanic/direct_draw.h
index 5ec0f3d..cf21c98 100644
--- a/engines/titanic/direct_draw.h
+++ b/engines/titanic/direct_draw.h
@@ -25,45 +25,12 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
-#include "graphics/surface.h"
+#include "titanic/direct_draw_surface.h"
 
 namespace Titanic {
 
 class TitanicEngine;
 
-struct DDSurfaceDesc {
-	int _w;
-	int _h;
-	int _flags;
-	int _caps;
-
-	DDSurfaceDesc(int w, int h) : _w(w), _h(h), _flags(0x1006), _caps(64) {}
-};
-
-class DirectDrawSurface : public Graphics::Surface {
-public:
-	/**
-	 * Return the size of the surface in ytes
-	 */
-	int getSize() const { return pitch * h; }
-
-	/**
-	 * Lock the surface for access
-	 */
-	Graphics::Surface *lock(const Common::Rect *bounds, int flags);
-
-	/**
-	 * Unlocks the surface at the end of direct accesses
-	 */
-	void unlock();
-
-	/**
-	 * Fills an area of the surfae with the specified color. If no bounds are passed,
-	 * then the entire surface is filled
-	 */
-	void fill(const Common::Rect *bounds, uint32 color);
-};
-
 class DirectDraw {
 private:
 	TitanicEngine *_vm;
diff --git a/engines/titanic/direct_draw_surface.cpp b/engines/titanic/direct_draw_surface.cpp
new file mode 100644
index 0000000..6ce6f24
--- /dev/null
+++ b/engines/titanic/direct_draw_surface.cpp
@@ -0,0 +1,87 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/rect.h"
+#include "titanic/direct_draw_surface.h"
+
+namespace Titanic {
+
+DirectDrawSurface::DirectDrawSurface() : _surface(nullptr),
+		_disposeAfterUse(DisposeAfterUse::YES) {
+}
+
+DirectDrawSurface::~DirectDrawSurface() {
+	free();
+}
+
+void DirectDrawSurface::create(Graphics::ManagedSurface *surface) {
+	free();
+	_surface = surface;
+	_disposeAfterUse = DisposeAfterUse::NO;
+}
+
+void DirectDrawSurface::create(int w, int h) {
+	Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
+	_surface = new Graphics::ManagedSurface(w, h, pixelFormat);
+	_disposeAfterUse = DisposeAfterUse::YES;
+}
+
+void DirectDrawSurface::free() {
+	if (_disposeAfterUse == DisposeAfterUse::YES)
+		delete _surface;
+	_surface = nullptr;
+	_disposeAfterUse = DisposeAfterUse::NO;
+}
+
+Graphics::ManagedSurface *DirectDrawSurface::lock(const Common::Rect *bounds, int flags) {
+	assert(!_surface->empty());
+	return _surface;
+}
+
+void DirectDrawSurface::unlock() {
+	assert(_surface->w != 0 && _surface->h != 0);
+}
+
+void DirectDrawSurface::fill(const Common::Rect *bounds, uint32 color) {
+	Common::Rect tempBounds;
+
+	if (bounds) {
+		// Bounds are provided, clip them to the bounds of this surface
+		tempBounds = *bounds;
+		tempBounds.clip(Common::Rect(0, 0, _surface->w, _surface->h));
+	} else {
+		// No bounds provided, so use the entire surface
+		tempBounds = Common::Rect(0, 0, _surface->w, _surface->h);
+	}
+
+	// Fill the area
+	_surface->fillRect(tempBounds, color);
+}
+
+void DirectDrawSurface::blitFast(const Common::Point &destPos, DirectDrawSurface *srcSurface, Common::Rect *bounds) {
+	if (bounds)
+		_surface->blitFrom(*srcSurface->_surface, *bounds, destPos);
+	else
+		_surface->blitFrom(*srcSurface->_surface, destPos);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/direct_draw_surface.h b/engines/titanic/direct_draw_surface.h
new file mode 100644
index 0000000..1498858
--- /dev/null
+++ b/engines/titanic/direct_draw_surface.h
@@ -0,0 +1,110 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DIRECT_DRAW_SURFACE_H
+#define TITANIC_DIRECT_DRAW_SURFACE_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "graphics/managed_surface.h"
+
+namespace Titanic {
+
+class TitanicEngine;
+
+struct DDSurfaceDesc {
+	int _w;
+	int _h;
+	int _flags;
+	int _caps;
+
+	DDSurfaceDesc(int w, int h) : _w(w), _h(h), _flags(0x1006), _caps(64) {}
+};
+
+class DirectDrawSurface {
+private:
+	Graphics::ManagedSurface *_surface;
+	DisposeAfterUse::Flag _disposeAfterUse;
+public:
+	DirectDrawSurface();
+	~DirectDrawSurface();
+
+	/**
+	 * Create a surface
+	 */
+	void create(int w, int h);
+
+	/**
+	 * Create a surface based on a passed surface
+	 */
+	void create(Graphics::ManagedSurface *surface);
+
+	/**
+	 * Frees the surface
+	 */
+	void free();
+
+	/**
+	 * Return the size of the surface in ytes
+	 */
+	int getSize() const { return _surface->pitch * _surface->h; }
+
+	/**
+	 * Return the surface width
+	 */
+	int getWidth() const { return _surface->w; }
+
+	/**
+	 * Return the surface width
+	 */
+	int getHeight() const { return _surface->h; }
+
+	/**
+	 * Return the surface pitch
+	 */
+	int getPitch() const { return _surface->pitch; }
+
+	/**
+	 * Lock the surface for access
+	 */
+	Graphics::ManagedSurface *lock(const Common::Rect *bounds, int flags);
+
+	/**
+	 * Unlocks the surface at the end of direct accesses
+	 */
+	void unlock();
+
+	/**
+	 * Fills an area of the surfae with the specified color. If no bounds are passed,
+	 * then the entire surface is filled
+	 */
+	void fill(const Common::Rect *bounds, uint32 color);
+
+	/**
+	 * Copy data from a source surfcae into this one
+	 */
+	void blitFast(const Common::Point &destPos, DirectDrawSurface *srcSurface, Common::Rect *bounds);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DIRECT_DRAW_SURFACE_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index f62ef96..285a1c8 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -4,6 +4,7 @@ MODULE_OBJS := \
 	debugger.o \
 	detection.o \
 	direct_draw.o \
+	direct_draw_surface.o \
 	events.o \
 	files_manager.o \
 	font.o \
diff --git a/engines/titanic/pet_control/pet_control_sub12.cpp b/engines/titanic/pet_control/pet_control_sub12.cpp
index 616d692..5daf826 100644
--- a/engines/titanic/pet_control/pet_control_sub12.cpp
+++ b/engines/titanic/pet_control/pet_control_sub12.cpp
@@ -67,6 +67,7 @@ void CPetControlSub12::load(SimpleFile *file, int param) {
 		_field70 = file->readNumber();
 		_field74 = file->readNumber();
 
+		warning("TODO: CPetControlSub12::load %d,%d", var1, var2);
 		assert(_array.size() >= count);
 		for (uint idx = 0; idx < count; ++idx) {
 			_array[idx]._string1 = file->readString();
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 08ba64a..503fd6b 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -123,17 +123,17 @@ bool OSVideoSurface::hasSurface() {
 
 int OSVideoSurface::getWidth() const {
 	assert(_ddSurface);
-	return _ddSurface->w;
+	return _ddSurface->getWidth();
 }
 
 int OSVideoSurface::getHeight() const {
 	assert(_ddSurface);
-	return _ddSurface->h;
+	return _ddSurface->getHeight();
 }
 
 int OSVideoSurface::getPitch() const {
 	assert(_ddSurface);
-	return _ddSurface->pitch;
+	return _ddSurface->getPitch();
 }
 
 void OSVideoSurface::resize(int width, int height) {
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 47caffd..7efd8b5 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -45,7 +45,7 @@ protected:
 	CScreenManager *_screenManager;
 	CResourceKey _resourceKey;
 	DirectDrawSurface *_ddSurface;
-	Graphics::Surface *_rawSurface;
+	Graphics::ManagedSurface *_rawSurface;
 	void *_field34;
 	bool _pendingLoad;
 	int _field40;


Commit: fbc46ed5b41633c1a8dc6e54591fe4dd028dbc04
    https://github.com/scummvm/scummvm/commit/fbc46ed5b41633c1a8dc6e54591fe4dd028dbc04
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-20T17:29:58-04:00

Commit Message:
TITANIC: Starting on frame rendering

Changed paths:
    engines/titanic/game_view.cpp
    engines/titanic/game_view.h
    engines/titanic/main_game_window.cpp
    engines/titanic/main_game_window.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h



diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index d04c3e1..88ad095 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -57,6 +57,17 @@ void CGameView::createSurface(const CResourceKey &key) {
 	_surface->_field3C = true;
 }
 
+void CGameView::draw1() {
+	CScreenManager::setCurrent();
+	Common::Rect rect1 = _gameManager->_bounds;
+	Common::Rect rect2(0, 0, 600, 340);
+	rect2.translate(20, 10);
+
+
+
+	warning("TODO: CGameView_Draw1");
+}
+
 /*------------------------------------------------------------------------*/
 
 CSTGameView::CSTGameView(CMainGameWindow *gameWindow) :
diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h
index a3e1fe7..1441203 100644
--- a/engines/titanic/game_view.h
+++ b/engines/titanic/game_view.h
@@ -63,6 +63,8 @@ public:
 	 * Creates a surface from a specified resource
 	 */
 	void createSurface(const CResourceKey &key);
+
+	void draw1();
 };
 
 class CSTGameView: public CGameView {
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 6a6a46e..c282787 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -25,6 +25,7 @@
 #include "titanic/game_manager.h"
 #include "titanic/game_view.h"
 #include "titanic/messages/messages.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -125,8 +126,12 @@ void CMainGameWindow::draw() {
 		case GSMODE_1:
 		case GSMODE_2:
 			if (_gameManager->_gameState._field18)
-				warning("TODO: Field18_fn1(this)");
-			warning("TODO: Stuff");
+				drawPet(scrManager);
+
+			draw1();
+			draw2(scrManager);
+			scrManager->drawCursors();
+			break;
 
 		case GSMODE_5:
 			g_vm->_filesManager.debug(scrManager);
@@ -138,6 +143,23 @@ void CMainGameWindow::draw() {
 	}
 }
 
+void CMainGameWindow::drawPet(CScreenManager *screenManager) {
+	if (_gameView && _gameView->_surface) {
+		CPetControl *petControl = _gameManager->_project->getPetControl();
+		if (petControl)
+			petControl->proc26();
+	}
+}
+
+void CMainGameWindow::draw1() {
+	if (_gameView->_surface)
+		_gameView->draw1();
+}
+
+void CMainGameWindow::draw2(CScreenManager *screenManager) {
+
+}
+
 void CMainGameWindow::mouseChanged() {
 	if (_gameManager->_gameState._mode != GSMODE_5)
 		_gameManager->update();
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 8f6fb81..549637b 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -49,6 +49,15 @@ private:
 	 * to use
 	 */
 	int selectSavegame();
+
+	/**
+	 * Used for drawing the PET fullscreen? maybe
+	 */
+	void drawPet(CScreenManager *screenManager);
+
+	void draw1();
+
+	void draw2(CScreenManager *screenManager);
 public:
 	CGameView *_gameView;
 	CGameManager *_gameManager;
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index f549888..5886ce4 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -80,6 +80,10 @@ void CPetControl::saveSubObjects(SimpleFile *file, int indent) const {
 	_sub8.save(file, indent);
 }
 
+void CPetControl::proc26() {
+	warning("TODO: CPetControl::proc26");
+}
+
 void CPetControl::postLoad() {
 	warning("TODO: CPetControl::postLoad");
 }
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index f1e4bb2..df529ae 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -78,6 +78,8 @@ public:
 	 */
 	virtual void load(SimpleFile *file);
 
+	virtual void proc26();
+
 	/**
 	 * Called after loading a game has finished
 	 */
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index fe15d9a..f87ad66 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -105,7 +105,10 @@ void OSScreenManager::setMode(int width, int height, int bpp, uint numBackSurfac
 	loadCursors();
 }
 
-void OSScreenManager::proc5() {}
+void OSScreenManager::drawCursors() {
+	warning("OSScreenManager::drawCursors");
+}
+
 void OSScreenManager::proc6() {}
 void OSScreenManager::proc7() {}
 
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index a5fa562..8fe51c5 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -68,8 +68,17 @@ public:
 
 	virtual void setWindowHandle(int v);
 	virtual bool resetWindowHandle(int v);
+	
+	/**
+	 * Sets the video mode
+	 */
 	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) = 0;
-	virtual void proc5() = 0;
+
+	/**
+	 * Handles drawing the cursors
+	 */
+	virtual void drawCursors() = 0;
+	
 	virtual void proc6() = 0;
 	virtual void proc7() = 0;
 	virtual CVideoSurface *getSurface(int surfaceNum) const = 0;
@@ -136,8 +145,16 @@ public:
 	OSScreenManager(TitanicEngine *vm);
 	virtual ~OSScreenManager();
 
-	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2);
-	virtual void proc5();
+	/**
+	 * Sets the video mode
+	 */
+	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) = 0;
+
+	/**
+	 * Handles drawing the cursors
+	 */
+	virtual void drawCursors();
+
 	virtual void proc6();
 	virtual void proc7();
 	virtual CVideoSurface *getSurface(int surfaceNum) const;


Commit: 9a66bc2e9e3638af940053ac58df36b489b3e345
    https://github.com/scummvm/scummvm/commit/9a66bc2e9e3638af940053ac58df36b489b3e345
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-20T20:47:25-04:00

Commit Message:
TITANIC: More graphics code, clipBounds method

Changed paths:
    engines/titanic/direct_draw_surface.cpp
    engines/titanic/direct_draw_surface.h
    engines/titanic/game_view.cpp
    engines/titanic/screen_manager.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h
    graphics/managed_surface.cpp



diff --git a/engines/titanic/direct_draw_surface.cpp b/engines/titanic/direct_draw_surface.cpp
index 6ce6f24..cf7639c 100644
--- a/engines/titanic/direct_draw_surface.cpp
+++ b/engines/titanic/direct_draw_surface.cpp
@@ -77,7 +77,13 @@ void DirectDrawSurface::fill(const Common::Rect *bounds, uint32 color) {
 	_surface->fillRect(tempBounds, color);
 }
 
-void DirectDrawSurface::blitFast(const Common::Point &destPos, DirectDrawSurface *srcSurface, Common::Rect *bounds) {
+void DirectDrawSurface::blit(const Common::Rect &destRect, DirectDrawSurface *srcSurface, Common::Rect &srcRect) {
+	assert(srcSurface);
+	if (!destRect.isEmpty())
+		_surface->transBlitFrom(*srcSurface->_surface, srcRect, destRect, (uint)-1);
+}
+
+void DirectDrawSurface::blit(const Common::Point &destPos, DirectDrawSurface *srcSurface, Common::Rect *bounds) {
 	if (bounds)
 		_surface->blitFrom(*srcSurface->_surface, *bounds, destPos);
 	else
diff --git a/engines/titanic/direct_draw_surface.h b/engines/titanic/direct_draw_surface.h
index 1498858..9a93316 100644
--- a/engines/titanic/direct_draw_surface.h
+++ b/engines/titanic/direct_draw_surface.h
@@ -102,7 +102,12 @@ public:
 	/**
 	 * Copy data from a source surfcae into this one
 	 */
-	void blitFast(const Common::Point &destPos, DirectDrawSurface *srcSurface, Common::Rect *bounds);
+	void blit(const Common::Rect &destRect, DirectDrawSurface *srcSurface, Common::Rect &srcRect);
+
+	/**
+	 * Copy data from a source surfcae into this one
+	 */
+	void blit(const Common::Point &destPos, DirectDrawSurface *srcSurface, Common::Rect *bounds);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index 88ad095..ecdeb85 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -54,7 +54,7 @@ void CGameView::createSurface(const CResourceKey &key) {
 	// Create a fresh surface
 	CScreenManager::setCurrent();
 	_surface = CScreenManager::_currentScreenManagerPtr->createSurface(key);
-	_surface->_field3C = true;
+	_surface->_blitFlag = true;
 }
 
 void CGameView::draw1() {
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index 8fe51c5..ae3424d 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -148,7 +148,7 @@ public:
 	/**
 	 * Sets the video mode
 	 */
-	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) = 0;
+	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2);
 
 	/**
 	 * Handles drawing the cursors
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 503fd6b..b38a862 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -30,8 +30,8 @@ int CVideoSurface::_videoSurfaceCounter = 0;
 
 CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
 		_screenManager(screenManager), _rawSurface(nullptr),
-		_field34(nullptr), _pendingLoad(false), _field3C(false), _field40(0),
-		_field44(4), _field48(0), _field50(1) {
+		_field34(nullptr), _pendingLoad(false), _blitFlag(false),
+		_field40(0), _field44(4), _field48(0), _field50(1) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
 }
 
@@ -46,6 +46,74 @@ void CVideoSurface::setSurface(CScreenManager *screenManager, DirectDrawSurface
 	_ddSurface = surface;
 }
 
+void CVideoSurface::blitFrom(const Common::Rect &srcRect, const Common::Rect &destRect, CVideoSurface *srcSurface) {
+	// TODO: Cases when _blitFlag is false
+	assert(_blitFlag);
+	error("TODO");
+}
+
+void CVideoSurface::clipBounds(Common::Rect &srcRect, Common::Rect &destRect,
+		CVideoSurface *srcSurface, Common::Rect *subRect, Common::Point *pt) {
+	if (pt) {
+		srcRect.left = pt->x;
+		srcRect.top = pt->y;
+	} else {
+		srcRect.left = srcRect.top = 0;
+	}
+
+	if (subRect) {
+		destRect.right = destRect.left + subRect->width();
+		destRect.bottom = destRect.top + subRect->height();
+		srcRect = *subRect;
+	} else {
+		srcRect.right = srcRect.left + srcSurface->getWidth();
+		srcRect.bottom = srcRect.top + srcSurface->getHeight();
+		srcRect = Common::Rect(0, 0, srcSurface->getWidth(), srcSurface->getHeight());
+	}
+
+	// Clip destination rect to be on-screen
+	if (destRect.left < 0) {
+		srcRect.left -= destRect.left;
+		destRect.left = 0;
+	}
+	if (destRect.top < 0) {
+		srcRect.top -= destRect.top;
+		destRect.top = 0;
+	}
+	if (destRect.right > getWidth()) {
+		srcRect.right += getWidth() - destRect.right;
+		destRect.right = getWidth();
+	}
+	if (destRect.bottom > getHeight()) {
+		srcRect.bottom += getHeight() - destRect.bottom;
+		destRect.bottom = getHeight();
+	}
+
+	// Clip source rect to be within the source surface
+	if (srcRect.left < 0) {
+		destRect.left -= srcRect.left;
+		srcRect.left = 0;
+	}
+	if (srcRect.top < 0) {
+		destRect.top -= srcRect.top;
+		srcRect.top = 0;
+	}
+	if (srcRect.right > srcSurface->getWidth()) {
+		destRect.right += srcSurface->getWidth() - srcRect.right;
+		srcRect.right = srcSurface->getWidth();
+	}
+	if (srcRect.bottom > srcSurface->getHeight()) {
+		destRect.bottom += srcSurface->getHeight() - srcRect.bottom;
+		srcRect.bottom = srcSurface->getHeight();
+	}
+
+	// Validate that the resulting rects are valid
+	if (destRect.left >= destRect.right || destRect.top >= destRect.bottom
+		|| srcRect.left >= srcRect.right || srcRect.top >= srcRect.bottom)
+		error("Invalid rect");
+}
+
+
 /*------------------------------------------------------------------------*/
 
 OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface) :
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 7efd8b5..88ab2e4 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -39,6 +39,12 @@ class CTargaDecode;
 class CVideoSurface : public ListItem {
 	friend class CJPEGDecode;
 	friend class CTargaDecode;
+private:
+	/**
+	 * Calculates blitting bounds
+	 */
+	void clipBounds(Common::Rect &destRect, Common::Rect &srcRect,
+		CVideoSurface *srcSurface, Common::Rect *bounds2, Common::Point *pt);
 protected:
 	static int _videoSurfaceCounter;
 protected:
@@ -55,7 +61,7 @@ protected:
 	int _field50;
 	int _lockCount;
 public:
-	bool _field3C;
+	bool _blitFlag;
 public:
 	CVideoSurface(CScreenManager *screenManager);
 	virtual ~CVideoSurface();
@@ -141,6 +147,11 @@ public:
 	 * Frees the underlying surface
 	 */
 	virtual int freeSurface() { return 0; }
+
+	/**
+	 * Blit from another surface
+	 */
+	void blitFrom(const Common::Rect &srcRect, const Common::Rect &destRect, CVideoSurface *srcSurface);
 };
 
 class OSVideoSurface : public CVideoSurface {
diff --git a/graphics/managed_surface.cpp b/graphics/managed_surface.cpp
index e493ab9..f3d8813 100644
--- a/graphics/managed_surface.cpp
+++ b/graphics/managed_surface.cpp
@@ -48,7 +48,7 @@ ManagedSurface::ManagedSurface(int width, int height) :
 ManagedSurface::ManagedSurface(int width, int height, const Graphics::PixelFormat &pixelFormat) :
 		w(_innerSurface.w), h(_innerSurface.h), pitch(_innerSurface.pitch), format(_innerSurface.format),
 		_disposeAfterUse(DisposeAfterUse::NO), _owner(nullptr) {
-	create(width, height, format);
+	create(width, height, pixelFormat);
 }
 
 ManagedSurface::ManagedSurface(ManagedSurface &surf, const Common::Rect &bounds) :


Commit: 217360d0c5a0b8289c16b22fc46782c475fcc9f5
    https://github.com/scummvm/scummvm/commit/217360d0c5a0b8289c16b22fc46782c475fcc9f5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-21T20:53:49-04:00

Commit Message:
TITANIC: Add new derived Rect and Point classes

Changed paths:
  A engines/titanic/movie.cpp
  A engines/titanic/movie.h
  A engines/titanic/rect.cpp
  A engines/titanic/rect.h
    engines/titanic/carry/brain.h
    engines/titanic/carry/bridge_piece.h
    engines/titanic/carry/carry.h
    engines/titanic/core/drop_target.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/link_item.h
    engines/titanic/core/room_item.h
    engines/titanic/core/tree_item.h
    engines/titanic/direct_draw_surface.cpp
    engines/titanic/direct_draw_surface.h
    engines/titanic/events.cpp
    engines/titanic/game/cdrom.h
    engines/titanic/game/end_game_credits.h
    engines/titanic/game/placeholder/lemon_on_bar.h
    engines/titanic/game/placeholder/tv_on_bar.h
    engines/titanic/game/sauce_dispensor.h
    engines/titanic/game/ship_setting.h
    engines/titanic/game/transport/lift_indicator.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/game_view.cpp
    engines/titanic/game_view.h
    engines/titanic/gfx/move_object_button.h
    engines/titanic/gfx/slider_button.h
    engines/titanic/gfx/toggle_switch.h
    engines/titanic/input_handler.cpp
    engines/titanic/input_handler.h
    engines/titanic/input_translator.cpp
    engines/titanic/input_translator.h
    engines/titanic/main_game_window.cpp
    engines/titanic/main_game_window.h
    engines/titanic/messages/mouse_messages.h
    engines/titanic/module.mk
    engines/titanic/npcs/mobile.h
    engines/titanic/pet_control/pet_val.cpp
    engines/titanic/pet_control/pet_val.h
    engines/titanic/pet_control/pet_val_base.cpp
    engines/titanic/pet_control/pet_val_base.h
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h
    engines/titanic/simple_file.cpp
    engines/titanic/simple_file.h
    engines/titanic/text_cursor.cpp
    engines/titanic/text_cursor.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/carry/brain.h b/engines/titanic/carry/brain.h
index 8cfd491..14f9b63 100644
--- a/engines/titanic/carry/brain.h
+++ b/engines/titanic/carry/brain.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CBrain : public CCarry {
 private:
-	Common::Point _pos1;
+	Point _pos1;
 	int _field134;
 	int _field138;
 public:
diff --git a/engines/titanic/carry/bridge_piece.h b/engines/titanic/carry/bridge_piece.h
index b96015a..a641eb4 100644
--- a/engines/titanic/carry/bridge_piece.h
+++ b/engines/titanic/carry/bridge_piece.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CBridgePiece : public CCarry {
 private:
 	CString _string6;
-	Common::Point _pos3;
+	Point _pos3;
 	int _field140;
 public:
 	CLASSDEF
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index 6b3ae23..309b8a8 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -30,13 +30,13 @@ namespace Titanic {
 class CCarry : public CGameObject {
 private:
 	CString _string1;
-	Common::Point _pos1;
+	Point _pos1;
 	CString _string2;
 	int _fieldDC;
 	int _fieldE0;
 	CString _string3;
 	CString _string4;
-	Common::Point _pos2;
+	Point _pos2;
 	int _field100;
 	int _field104;
 	int _field108;
diff --git a/engines/titanic/core/drop_target.h b/engines/titanic/core/drop_target.h
index 22cb057..6c1cdcf 100644
--- a/engines/titanic/core/drop_target.h
+++ b/engines/titanic/core/drop_target.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CDropTarget : public CGameObject {
 private:
-	Common::Point _pos1;
+	Point _pos1;
 	int _fieldC4;
 	CString _string1;
 	int _fieldD4;
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 884873e..06f2ce7 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -26,7 +26,7 @@
 namespace Titanic {
 
 CGameObject::CGameObject(): CNamedItem() {
-	_bounds = Common::Rect(0, 0, 15, 15);
+	_bounds = Rect(0, 0, 15, 15);
 	_field34 = 0;
 	_field38 = 0;
 	_field3C = 0;
@@ -122,7 +122,7 @@ void CGameObject::fn2() {
 	error("TODO");
 }
 
-bool CGameObject::checkPoint(const Common::Point &pt, int v0, int v1) {
+bool CGameObject::checkPoint(const Point &pt, int v0, int v1) {
 	warning("TODO: CGameObject::checkPoint");
 	return false;
 }
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 693f334..809f7b8 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_GAME_OBJECT_H
 #define TITANIC_GAME_OBJECT_H
 
-#include "common/rect.h"
+#include "titanic/rect.h"
 #include "titanic/core/movie_clip.h"
 #include "titanic/core/named_item.h"
 
@@ -31,7 +31,7 @@ namespace Titanic {
 
 class CGameObject : public CNamedItem {
 protected:
-	Common::Rect _bounds;
+	Rect _bounds;
 	double _field34;
 	double _field38;
 	double _field3C;
@@ -75,7 +75,7 @@ public:
 
 	void fn2();
 
-	bool checkPoint(const Common::Point &pt, int v0, int v1);
+	bool checkPoint(const Point &pt, int v0, int v1);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index 733a4c9..bbeef2c 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -46,7 +46,7 @@ protected:
 	int _field30;
 	int _field34;
 public:
-	Common::Rect _bounds;
+	Rect _bounds;
 public:
 	CLASSDEF
 	CLinkItem();
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index a42ffab..7248b4a 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_ROOM_ITEM_H
 #define TITANIC_ROOM_ITEM_H
 
-#include "common/rect.h"
+#include "titanic/rect.h"
 #include "titanic/core/list.h"
 #include "titanic/core/movie_clip.h"
 #include "titanic/core/named_item.h"
@@ -33,7 +33,7 @@ namespace Titanic {
 
 class CRoomItem : public CNamedItem {
 public:
-	Common::Rect _roomRect;
+	Rect _roomRect;
 	CMovieClipList _clipList;
 	int _roomNumber;
 	CResourceKey _transitionMovieKey;
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index a4156d6..5669784 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -122,7 +122,7 @@ public:
 	/**
 	 * Gets the bounds occupied by the item
 	 */
-	virtual Common::Rect getBounds() { return Common::Rect(); }
+	virtual Rect getBounds() { return Rect(); }
 
 	/**
 	 * Called when the view changes
diff --git a/engines/titanic/direct_draw_surface.cpp b/engines/titanic/direct_draw_surface.cpp
index cf7639c..4e7311a 100644
--- a/engines/titanic/direct_draw_surface.cpp
+++ b/engines/titanic/direct_draw_surface.cpp
@@ -52,7 +52,7 @@ void DirectDrawSurface::free() {
 	_disposeAfterUse = DisposeAfterUse::NO;
 }
 
-Graphics::ManagedSurface *DirectDrawSurface::lock(const Common::Rect *bounds, int flags) {
+Graphics::ManagedSurface *DirectDrawSurface::lock(const Rect *bounds, int flags) {
 	assert(!_surface->empty());
 	return _surface;
 }
@@ -61,29 +61,29 @@ void DirectDrawSurface::unlock() {
 	assert(_surface->w != 0 && _surface->h != 0);
 }
 
-void DirectDrawSurface::fill(const Common::Rect *bounds, uint32 color) {
-	Common::Rect tempBounds;
+void DirectDrawSurface::fill(const Rect *bounds, uint32 color) {
+	Rect tempBounds;
 
 	if (bounds) {
 		// Bounds are provided, clip them to the bounds of this surface
 		tempBounds = *bounds;
-		tempBounds.clip(Common::Rect(0, 0, _surface->w, _surface->h));
+		tempBounds.clip(Rect(0, 0, _surface->w, _surface->h));
 	} else {
 		// No bounds provided, so use the entire surface
-		tempBounds = Common::Rect(0, 0, _surface->w, _surface->h);
+		tempBounds = Rect(0, 0, _surface->w, _surface->h);
 	}
 
 	// Fill the area
 	_surface->fillRect(tempBounds, color);
 }
 
-void DirectDrawSurface::blit(const Common::Rect &destRect, DirectDrawSurface *srcSurface, Common::Rect &srcRect) {
+void DirectDrawSurface::blit(const Rect &destRect, DirectDrawSurface *srcSurface, Rect &srcRect) {
 	assert(srcSurface);
 	if (!destRect.isEmpty())
 		_surface->transBlitFrom(*srcSurface->_surface, srcRect, destRect, (uint)-1);
 }
 
-void DirectDrawSurface::blit(const Common::Point &destPos, DirectDrawSurface *srcSurface, Common::Rect *bounds) {
+void DirectDrawSurface::blit(const Point &destPos, DirectDrawSurface *srcSurface, Rect *bounds) {
 	if (bounds)
 		_surface->blitFrom(*srcSurface->_surface, *bounds, destPos);
 	else
diff --git a/engines/titanic/direct_draw_surface.h b/engines/titanic/direct_draw_surface.h
index 9a93316..dfcdccb 100644
--- a/engines/titanic/direct_draw_surface.h
+++ b/engines/titanic/direct_draw_surface.h
@@ -26,6 +26,7 @@
 #include "common/scummsys.h"
 #include "common/array.h"
 #include "graphics/managed_surface.h"
+#include "titanic/rect.h"
 
 namespace Titanic {
 
@@ -86,7 +87,7 @@ public:
 	/**
 	 * Lock the surface for access
 	 */
-	Graphics::ManagedSurface *lock(const Common::Rect *bounds, int flags);
+	Graphics::ManagedSurface *lock(const Rect *bounds, int flags);
 
 	/**
 	 * Unlocks the surface at the end of direct accesses
@@ -97,17 +98,17 @@ public:
 	 * Fills an area of the surfae with the specified color. If no bounds are passed,
 	 * then the entire surface is filled
 	 */
-	void fill(const Common::Rect *bounds, uint32 color);
+	void fill(const Rect *bounds, uint32 color);
 
 	/**
 	 * Copy data from a source surfcae into this one
 	 */
-	void blit(const Common::Rect &destRect, DirectDrawSurface *srcSurface, Common::Rect &srcRect);
+	void blit(const Rect &destRect, DirectDrawSurface *srcSurface, Rect &srcRect);
 
 	/**
 	 * Copy data from a source surfcae into this one
 	 */
-	void blit(const Common::Point &destPos, DirectDrawSurface *srcSurface, Common::Rect *bounds);
+	void blit(const Point &destPos, DirectDrawSurface *srcSurface, Rect *bounds);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index 346b43c..6fae102 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -103,7 +103,7 @@ uint32 Events::getTicksCount() const {
 }
 
 #define HANDLE_MESSAGE(method) 	if (_vm->_window->_inputAllowed) { \
-	_vm->_window->_gameManager->_inputTranslator.leftButtonDown(_specialButtons, _mousePos); \
+	_vm->_window->_gameManager->_inputTranslator.leftButtonDown(_specialButtons, Point(_mousePos.x, _mousePos.y)); \
 	_vm->_window->mouseChanged(); \
 	}
 
diff --git a/engines/titanic/game/cdrom.h b/engines/titanic/game/cdrom.h
index f810056..c1280f6 100644
--- a/engines/titanic/game/cdrom.h
+++ b/engines/titanic/game/cdrom.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CCDROM : public CGameObject {
 private:
-	Common::Point _pos1;
+	Point _pos1;
 public:
 	CLASSDEF
 	CCDROM();
diff --git a/engines/titanic/game/end_game_credits.h b/engines/titanic/game/end_game_credits.h
index 68e86c6..ab14f26 100644
--- a/engines/titanic/game/end_game_credits.h
+++ b/engines/titanic/game/end_game_credits.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CEndGameCredits : public CGameObject {
 private:
 	int _fieldBC;
-	Common::Point _pos1;
+	Point _pos1;
 public:
 	CLASSDEF
 	CEndGameCredits();
diff --git a/engines/titanic/game/placeholder/lemon_on_bar.h b/engines/titanic/game/placeholder/lemon_on_bar.h
index c88698f..18559b0 100644
--- a/engines/titanic/game/placeholder/lemon_on_bar.h
+++ b/engines/titanic/game/placeholder/lemon_on_bar.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CLemonOnBar : public CPlaceHolder {
 private:
-	Common::Point _pos1;
+	Point _pos1;
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/placeholder/tv_on_bar.h b/engines/titanic/game/placeholder/tv_on_bar.h
index 3358cd6..3af59de 100644
--- a/engines/titanic/game/placeholder/tv_on_bar.h
+++ b/engines/titanic/game/placeholder/tv_on_bar.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CTVOnBar : public CPlaceHolder {
 private:
-	Common::Point _pos1;
+	Point _pos1;
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/sauce_dispensor.h b/engines/titanic/game/sauce_dispensor.h
index 6969adb..8a5cc96 100644
--- a/engines/titanic/game/sauce_dispensor.h
+++ b/engines/titanic/game/sauce_dispensor.h
@@ -32,8 +32,8 @@ public:
 	CString _string3;
 	int _fieldEC;
 	int _fieldF0;
-	Common::Point _pos1;
-	Common::Point _pos2;
+	Point _pos1;
+	Point _pos2;
 	int _field104;
 	int _field108;
 public:
diff --git a/engines/titanic/game/ship_setting.h b/engines/titanic/game/ship_setting.h
index cbf4e9f..2525224 100644
--- a/engines/titanic/game/ship_setting.h
+++ b/engines/titanic/game/ship_setting.h
@@ -31,7 +31,7 @@ namespace Titanic {
 class CShipSetting : public CBackground, CEnterRoomMsgTarget {
 private:
 	CString _string3;
-	Common::Point _pos1;
+	Point _pos1;
 	CString _string4;
 	CString _string5;
 protected:
diff --git a/engines/titanic/game/transport/lift_indicator.h b/engines/titanic/game/transport/lift_indicator.h
index 161f032..80f8b0d 100644
--- a/engines/titanic/game/transport/lift_indicator.h
+++ b/engines/titanic/game/transport/lift_indicator.h
@@ -31,7 +31,7 @@ namespace Titanic {
 class CLiftindicator : public CLift {
 private:
 	int _fieldFC;
-	Common::Point _pos2;
+	Point _pos2;
 	int _field108;
 	int _field10C;
 protected:
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 49a881d..a80e871 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -137,7 +137,7 @@ void CGameManager::postSave() {
 }
 
 void CGameManager::initBounds() {
-	_bounds = Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
+	_bounds = Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
 }
 
 void CGameManager::fn2() {
@@ -160,7 +160,7 @@ void CGameManager::update() {
 	if (view) {
 		// Expand the game manager's bounds to encompass all the view's items
 		for (CTreeItem *item = view; item; item = item->scan(view)) {
-			Common::Rect r = item->getBounds();
+			Rect r = item->getBounds();
 			if (!r.isEmpty())
 				_bounds.extend(r);
 		}
@@ -184,7 +184,7 @@ void CGameManager::update() {
 		// Handle redrawing the view
 		if (!_bounds.isEmpty()) {
 			_gameView->draw(_bounds);
-			_bounds = Common::Rect();
+			_bounds = Rect();
 		}
 
 		_gameState.checkForViewChange();
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index f18696b..51e1c3d 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -113,7 +113,7 @@ public:
 	CProjectItem *_project;
 	CGameView *_gameView;
 	CGameState _gameState;
-	Common::Rect _bounds;
+	Rect _bounds;
 	CInputHandler _inputHandler;
 	CInputTranslator _inputTranslator;
 	CTreeItem *_dragItem;
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index f906ff6..2885b3a 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -36,13 +36,13 @@ bool CGameStateList::isViewChanging() const {
 
 CGameState::CGameState(CGameManager *gameManager) :
 		_gameManager(gameManager), _gameLocation(this),
-		_field8(0), _fieldC(0), _mode(GSMODE_0), _field14(0), _field18(0),
+		_field8(0), _fieldC(0), _mode(GSMODE_0), _field14(0), _petActive(false),
 		_field1C(0), _field20(0), _field24(0), _nodeChangeCtr(0),
 		_nodeEnterTicks(0), _field38(0) {
 }
 
 void CGameState::save(SimpleFile *file) const {
-	file->writeNumber(_field18);
+	file->writeNumber(_petActive);
 	file->writeNumber(_field8);
 	file->writeNumber(_fieldC);
 	file->writeNumber(_field14);
@@ -53,7 +53,7 @@ void CGameState::save(SimpleFile *file) const {
 }
 
 void CGameState::load(SimpleFile *file) {
-	_field18 = file->readNumber();
+	_petActive = file->readNumber() != 0;
 	_field8 = file->readNumber();
 	_fieldC = file->readNumber();
 	_field14 = file->readNumber();
@@ -87,7 +87,7 @@ void CGameState::setMode(GameStateMode newMode) {
 	_mode = newMode;
 }
 
-void CGameState::setMousePos(const Common::Point &pt) {
+void CGameState::setMousePos(const Point &pt) {
 	_mousePos = pt;
 }
 
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 37bb603..49bcbcd 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -53,13 +53,13 @@ public:
 	int _fieldC;
 	GameStateMode _mode;
 	int _field14;
-	int _field18;
+	bool _petActive;
 	int _field1C;
 	int _field20;
 	int _field24;
 	uint _nodeChangeCtr;
 	uint32 _nodeEnterTicks;
-	Common::Point _mousePos;
+	Point _mousePos;
 	int _field38;
 public:
 	CGameState(CGameManager *gameManager);
@@ -82,7 +82,7 @@ public:
 	/**
 	 * Sets the current mouse position
 	 */
-	void setMousePos(const Common::Point &pt);
+	void setMousePos(const Point &pt);
 
 	/**
 	 * Called by the PET when a new node is entered
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index ecdeb85..505e489 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -57,10 +57,10 @@ void CGameView::createSurface(const CResourceKey &key) {
 	_surface->_blitFlag = true;
 }
 
-void CGameView::draw1() {
+void CGameView::drawView() {
 	CScreenManager::setCurrent();
-	Common::Rect rect1 = _gameManager->_bounds;
-	Common::Rect rect2(0, 0, 600, 340);
+	Rect rect1 = _gameManager->_bounds;
+	Rect rect2(0, 0, 600, 340);
 	rect2.translate(20, 10);
 
 
@@ -78,7 +78,7 @@ void CSTGameView::setView(CViewItem *view) {
 	_gameWindow->setActiveView(view);
 }
 
-void CSTGameView::draw(const Common::Rect &bounds) {
+void CSTGameView::draw(const Rect &bounds) {
 	_gameWindow->draw();
 }
 
diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h
index 1441203..c1d1a00 100644
--- a/engines/titanic/game_view.h
+++ b/engines/titanic/game_view.h
@@ -57,14 +57,17 @@ public:
 	 */
 	virtual void setView(CViewItem *item) = 0;
 	
-	virtual void draw(const Common::Rect &bounds) = 0;
+	virtual void draw(const Rect &bounds) = 0;
 
 	/**
 	 * Creates a surface from a specified resource
 	 */
 	void createSurface(const CResourceKey &key);
 
-	void draw1();
+	/**
+	 * Draws the background of a view
+	 */
+	void drawView();
 };
 
 class CSTGameView: public CGameView {
@@ -81,7 +84,7 @@ public:
 	/**
 	 * Handles drawing the view
 	 */
-	virtual void draw(const Common::Rect &bounds);
+	virtual void draw(const Rect &bounds);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/gfx/move_object_button.h b/engines/titanic/gfx/move_object_button.h
index 70df8f6..3873db6 100644
--- a/engines/titanic/gfx/move_object_button.h
+++ b/engines/titanic/gfx/move_object_button.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CMoveObjectButton : public CSTButton {
 private:
-	Common::Point _pos1;
+	Point _pos1;
 	int _field11C;
 public:
 	CLASSDEF
diff --git a/engines/titanic/gfx/slider_button.h b/engines/titanic/gfx/slider_button.h
index afb96db..2fdf448 100644
--- a/engines/titanic/gfx/slider_button.h
+++ b/engines/titanic/gfx/slider_button.h
@@ -32,7 +32,7 @@ private:
 	int _field114;
 	int _field118;
 	int _field11C;
-	Common::Point _pos1;
+	Point _pos1;
 public:
 	CLASSDEF
 	CSliderButton();
diff --git a/engines/titanic/gfx/toggle_switch.h b/engines/titanic/gfx/toggle_switch.h
index 9b4fc42..cc369f6 100644
--- a/engines/titanic/gfx/toggle_switch.h
+++ b/engines/titanic/gfx/toggle_switch.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CToggleSwitch : public CGameObject {
 private:
 	int _fieldBC;
-	Common::Point _pos1;
+	Point _pos1;
 public:
 	CLASSDEF
 	CToggleSwitch();
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index c710374..110bddf 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -101,7 +101,7 @@ void CInputHandler::processMessage(const CMessage *msg) {
 				// Save where the drag movement started from
 				_dragStartPos = _mousePos;
 			} else {
-				Common::Point delta = mouseMsg->_mousePos - _dragStartPos;
+				Point delta = mouseMsg->_mousePos - _dragStartPos;
 				int distance = (int)sqrt(double(delta.x * delta.x + delta.y * delta.y));
 
 				if (distance > 4) {
@@ -134,7 +134,7 @@ void CInputHandler::dispatchMessage(const CMessage *msg) {
 	}
 }
 
-void CInputHandler::dragEnd(const Common::Point &mousePos, CTreeItem *dragItem) {
+void CInputHandler::dragEnd(const Point &mousePos, CTreeItem *dragItem) {
 	warning("TODO CInputHandler::dragEnd");
 }
 
diff --git a/engines/titanic/input_handler.h b/engines/titanic/input_handler.h
index ad1ba86..a81874f 100644
--- a/engines/titanic/input_handler.h
+++ b/engines/titanic/input_handler.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_INPUT_HANDLER_H
 #define TITANIC_INPUT_HANDLER_H
 
-#include "common/rect.h"
+#include "titanic/rect.h"
 #include "titanic/input_translator.h"
 #include "titanic/core/tree_item.h"
 
@@ -46,15 +46,15 @@ private:
 	/**
 	 * Called when a drag operation has ended
 	 */
-	void dragEnd(const Common::Point &mousePos, CTreeItem *dragItem);
+	void dragEnd(const Point &mousePos, CTreeItem *dragItem);
 public:
 	CGameManager *_gameManager;
 	CInputTranslator *_inputTranslator;
 	bool _dragging;
 	bool _buttonDown;
 	CTreeItem *_dragItem;
-	Common::Point _dragStartPos;
-	Common::Point _mousePos;
+	Point _dragStartPos;
+	Point _mousePos;
 	int _lockCount;
 	int _field24;
 public:
diff --git a/engines/titanic/input_translator.cpp b/engines/titanic/input_translator.cpp
index bd33f20..ceb2be8 100644
--- a/engines/titanic/input_translator.cpp
+++ b/engines/titanic/input_translator.cpp
@@ -44,52 +44,52 @@ int CInputTranslator::getButtons(int special) const {
 	return buttons;
 }
 
-void CInputTranslator::mouseMove(int special, const Common::Point &pt) {
+void CInputTranslator::mouseMove(int special, const Point &pt) {
 	CMouseMoveMsg msg(pt, getButtons(special));
 	_inputHandler->handleMessage(msg);
 }
 
-void CInputTranslator::leftButtonDown(int special, const Common::Point &pt) {
+void CInputTranslator::leftButtonDown(int special, const Point &pt) {
 	CMouseButtonDownMsg msg(pt, getButtons(special));
 	_inputHandler->handleMessage(msg);
 }
 
-void CInputTranslator::leftButtonUp(int special, const Common::Point &pt) {
+void CInputTranslator::leftButtonUp(int special, const Point &pt) {
 	CMouseButtonUpMsg msg(pt, getButtons(special));
 	_inputHandler->handleMessage(msg);
 }
 
-void CInputTranslator::leftButtonDoubleClick(int special, const Common::Point &pt) {
+void CInputTranslator::leftButtonDoubleClick(int special, const Point &pt) {
 	CMouseButtonDoubleClickMsg msg(pt, getButtons(special));
 	_inputHandler->handleMessage(msg);
 }
 
-void CInputTranslator::middleButtonDown(int special, const Common::Point &pt) {
+void CInputTranslator::middleButtonDown(int special, const Point &pt) {
 	CMouseButtonDownMsg msg(pt, getButtons(special));
 	_inputHandler->handleMessage(msg);
 }
 
-void CInputTranslator::middleButtonUp(int special, const Common::Point &pt) {
+void CInputTranslator::middleButtonUp(int special, const Point &pt) {
 	CMouseButtonUpMsg msg(pt, getButtons(special));
 	_inputHandler->handleMessage(msg);
 }
 
-void CInputTranslator::middleButtonDoubleClick(int special, const Common::Point &pt) {
+void CInputTranslator::middleButtonDoubleClick(int special, const Point &pt) {
 	CMouseButtonDoubleClickMsg msg(pt, getButtons(special));
 	_inputHandler->handleMessage(msg);
 }
 
-void CInputTranslator::rightButtonDown(int special, const Common::Point &pt) {
+void CInputTranslator::rightButtonDown(int special, const Point &pt) {
 	CMouseButtonDownMsg msg(pt, getButtons(special));
 	_inputHandler->handleMessage(msg);
 }
 
-void CInputTranslator::rightButtonUp(int special, const Common::Point &pt) {
+void CInputTranslator::rightButtonUp(int special, const Point &pt) {
 	CMouseButtonUpMsg msg(pt, getButtons(special));
 	_inputHandler->handleMessage(msg);
 }
 
-void CInputTranslator::rightButtonDoubleClick(int special, const Common::Point &pt) {
+void CInputTranslator::rightButtonDoubleClick(int special, const Point &pt) {
 	CMouseButtonDoubleClickMsg msg(pt, getButtons(special));
 	_inputHandler->handleMessage(msg);
 }
diff --git a/engines/titanic/input_translator.h b/engines/titanic/input_translator.h
index 2748ca4..ad4f2d9 100644
--- a/engines/titanic/input_translator.h
+++ b/engines/titanic/input_translator.h
@@ -40,16 +40,16 @@ public:
 public:
 	CInputTranslator(CInputHandler *inputHandler);
 
-	void mouseMove(int special, const Common::Point &pt);
-	void leftButtonDown(int special, const Common::Point &pt);
-	void leftButtonUp(int special, const Common::Point &pt);
-	void leftButtonDoubleClick(int special, const Common::Point &pt);
-	void middleButtonDown(int special, const Common::Point &pt);
-	void middleButtonUp(int special, const Common::Point &pt);
-	void middleButtonDoubleClick(int special, const Common::Point &pt);
-	void rightButtonDown(int special, const Common::Point &pt);
-	void rightButtonUp(int special, const Common::Point &pt);
-	void rightButtonDoubleClick(int special, const Common::Point &pt);
+	void mouseMove(int special, const Point &pt);
+	void leftButtonDown(int special, const Point &pt);
+	void leftButtonUp(int special, const Point &pt);
+	void leftButtonDoubleClick(int special, const Point &pt);
+	void middleButtonDown(int special, const Point &pt);
+	void middleButtonUp(int special, const Point &pt);
+	void middleButtonDoubleClick(int special, const Point &pt);
+	void rightButtonDown(int special, const Point &pt);
+	void rightButtonUp(int special, const Point &pt);
+	void rightButtonDoubleClick(int special, const Point &pt);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index c282787..839c2fc 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -125,11 +125,11 @@ void CMainGameWindow::draw() {
 		switch (_gameManager->_gameState._mode) {
 		case GSMODE_1:
 		case GSMODE_2:
-			if (_gameManager->_gameState._field18)
+			if (_gameManager->_gameState._petActive)
 				drawPet(scrManager);
 
-			draw1();
-			draw2(scrManager);
+			drawView();
+			drawViewContents(scrManager);
 			scrManager->drawCursors();
 			break;
 
@@ -151,12 +151,12 @@ void CMainGameWindow::drawPet(CScreenManager *screenManager) {
 	}
 }
 
-void CMainGameWindow::draw1() {
+void CMainGameWindow::drawView() {
 	if (_gameView->_surface)
-		_gameView->draw1();
+		_gameView->drawView();
 }
 
-void CMainGameWindow::draw2(CScreenManager *screenManager) {
+void CMainGameWindow::drawViewContents(CScreenManager *screenManager) {
 
 }
 
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 549637b..42517f5 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -55,9 +55,15 @@ private:
 	 */
 	void drawPet(CScreenManager *screenManager);
 
-	void draw1();
+	/**
+	 * Draws the background for the view
+	 */
+	void drawView();
 
-	void draw2(CScreenManager *screenManager);
+	/**
+	 * Draws all the items within the view
+	 */
+	void drawViewContents(CScreenManager *screenManager);
 public:
 	CGameView *_gameView;
 	CGameManager *_gameManager;
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 84d7b8f..77343fa 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_MOUSE_MESSAGES_H
 #define TITANIC_MOUSE_MESSAGES_H
 
-#include "common/rect.h"
+#include "titanic/rect.h"
 #include "titanic/messages/messages.h"
 
 namespace Titanic {
@@ -33,14 +33,14 @@ enum MouseButton { MB_LEFT = 1, MB_MIDDLE = 2, MB_RIGHT = 4 };
 class CMouseMsg : public CMessage {
 public:
 	int _buttons;
-	Common::Point _mousePos;
+	Point _mousePos;
 public:
 	CLASSDEF
 	static bool isSupportedBy(const CTreeItem *item) {
 		return dynamic_cast<const CMouseMsg *>(item) != nullptr;
 	}
 	CMouseMsg() : _buttons(0) {}
-	CMouseMsg(const Common::Point &pt, int buttons) :
+	CMouseMsg(const Point &pt, int buttons) :
 		_mousePos(pt), _buttons(buttons) {}
 };
 
@@ -49,7 +49,7 @@ class CMouseMoveMsg : public CMouseMsg {
 public:
 	CLASSDEF
 	CMouseMoveMsg() : CMouseMsg() {}
-	CMouseMoveMsg(const Common::Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
+	CMouseMoveMsg(const Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return dynamic_cast<const CMouseMoveMsg *>(item) != nullptr;
@@ -67,7 +67,7 @@ public:
 public:
 	CLASSDEF
 	CMouseButtonMsg() : CMouseMsg(), _field10(0) {}
-	CMouseButtonMsg(const Common::Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
+	CMouseButtonMsg(const Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return dynamic_cast<const CMouseButtonMsg *>(item) != nullptr;
@@ -79,7 +79,7 @@ class CMouseButtonDownMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
 	CMouseButtonDownMsg() : CMouseButtonMsg() {}
-	CMouseButtonDownMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
+	CMouseButtonDownMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return dynamic_cast<const CMouseButtonDownMsg *>(item) != nullptr;
@@ -96,7 +96,7 @@ class CMouseButtonUpMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
 	CMouseButtonUpMsg() : CMouseButtonMsg() {}
-	CMouseButtonUpMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
+	CMouseButtonUpMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return dynamic_cast<const CMouseButtonUpMsg *>(item) != nullptr;
@@ -113,7 +113,7 @@ class CMouseButtonDoubleClickMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
 	CMouseButtonDoubleClickMsg() : CMouseButtonMsg() {}
-	CMouseButtonDoubleClickMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
+	CMouseButtonDoubleClickMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return dynamic_cast<const CMouseButtonDoubleClickMsg *>(item) != nullptr;
@@ -129,7 +129,7 @@ class CMouseDragMsg : public CMouseMsg {
 public:
 	CLASSDEF
 	CMouseDragMsg() : CMouseMsg() {}
-	CMouseDragMsg(const Common::Point &pt) : CMouseMsg(pt, 0) {}
+	CMouseDragMsg(const Point &pt) : CMouseMsg(pt, 0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return dynamic_cast<const CMouseDragMsg *>(item) != nullptr;
@@ -140,7 +140,7 @@ class CMouseDragMoveMsg : public CMouseDragMsg {
 public:
 	CLASSDEF
 	CMouseDragMoveMsg() : CMouseDragMsg() {}
-	CMouseDragMoveMsg(const Common::Point &pt) : CMouseDragMsg(pt) {}
+	CMouseDragMoveMsg(const Point &pt) : CMouseDragMsg(pt) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return dynamic_cast<const CMouseDragMoveMsg *>(item) != nullptr;
@@ -160,7 +160,7 @@ public:
 public:
 	CLASSDEF
 	CMouseDragStartMsg() : CMouseDragMsg(), _dragItem(nullptr), _field14(0) {}
-	CMouseDragStartMsg(const Common::Point &pt) : CMouseDragMsg(pt),
+	CMouseDragStartMsg(const Point &pt) : CMouseDragMsg(pt),
 		_dragItem(nullptr), _field14(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
@@ -180,7 +180,7 @@ public:
 public:
 	CLASSDEF
 	CMouseDragEndMsg() : CMouseDragMsg(), _dragItem(nullptr) {}
-	CMouseDragEndMsg(const Common::Point &pt, CTreeItem *dragItem = nullptr) :
+	CMouseDragEndMsg(const Point &pt, CTreeItem *dragItem = nullptr) :
 		CMouseDragMsg(pt), _dragItem(dragItem) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 285a1c8..afd8453 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -18,6 +18,8 @@ MODULE_OBJS := \
 	input_translator.o \
 	main_game_window.o \
 	mouse_cursor.o \
+	movie.o \
+	rect.o \
 	screen_manager.o \
 	simple_file.o \
 	string.o \
diff --git a/engines/titanic/movie.cpp b/engines/titanic/movie.cpp
new file mode 100644
index 0000000..1eaeac6
--- /dev/null
+++ b/engines/titanic/movie.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/movie.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/movie.h b/engines/titanic/movie.h
new file mode 100644
index 0000000..a213b7b
--- /dev/null
+++ b/engines/titanic/movie.h
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVIE_H
+#define TITANIC_MOVIE_H
+
+#include "titanic/core/list.h"
+
+namespace Titanic {
+
+class CMovie : public ListItem {
+public:
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVIE_H */
diff --git a/engines/titanic/npcs/mobile.h b/engines/titanic/npcs/mobile.h
index 512bb9f..4979d54 100644
--- a/engines/titanic/npcs/mobile.h
+++ b/engines/titanic/npcs/mobile.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CMobile : public CCharacter {
 private:
-	Common::Point _pos1;
+	Point _pos1;
 	int _fieldDC;
 public:
 	CLASSDEF
diff --git a/engines/titanic/pet_control/pet_val.cpp b/engines/titanic/pet_control/pet_val.cpp
index 96b82f1..5bc2375 100644
--- a/engines/titanic/pet_control/pet_val.cpp
+++ b/engines/titanic/pet_control/pet_val.cpp
@@ -41,7 +41,7 @@ void CPetVal::proc4() {
 	error("TODO");
 }
 
-void CPetVal::proc5(Common::Rect *rect) {
+void CPetVal::proc5(Rect *rect) {
 	error("TODO");
 }
 
diff --git a/engines/titanic/pet_control/pet_val.h b/engines/titanic/pet_control/pet_val.h
index bd1fb9e..0e909d4 100644
--- a/engines/titanic/pet_control/pet_val.h
+++ b/engines/titanic/pet_control/pet_val.h
@@ -40,7 +40,7 @@ public:
 	virtual void proc3();
 	virtual void proc4();
 
-	virtual void proc5(Common::Rect *linkItem);
+	virtual void proc5(Rect *linkItem);
 
 	virtual int proc16();
 };
diff --git a/engines/titanic/pet_control/pet_val_base.cpp b/engines/titanic/pet_control/pet_val_base.cpp
index c798c37..9a23854 100644
--- a/engines/titanic/pet_control/pet_val_base.cpp
+++ b/engines/titanic/pet_control/pet_val_base.cpp
@@ -28,9 +28,9 @@ namespace Titanic {
 CPetValBase::CPetValBase() : _field4(0), _field8(0), _fieldC(0),
 		_field10(0), _field14(0) {}
 
-void CPetValBase::proc5(Common::Rect *rect) {
+void CPetValBase::proc5(Rect *rect) {
 	if (rect)
-		*rect = Common::Rect();
+		*rect = Rect();
 }
 
 int CPetValBase::proc6() {
diff --git a/engines/titanic/pet_control/pet_val_base.h b/engines/titanic/pet_control/pet_val_base.h
index c4ff665..637e95f 100644
--- a/engines/titanic/pet_control/pet_val_base.h
+++ b/engines/titanic/pet_control/pet_val_base.h
@@ -44,7 +44,7 @@ public:
 	virtual void proc3() {}
 	virtual void proc4() {}
 
-	virtual void proc5(Common::Rect *rect);
+	virtual void proc5(Rect *rect);
 
 	virtual int proc6();
 	virtual int proc7();
diff --git a/engines/titanic/rect.cpp b/engines/titanic/rect.cpp
new file mode 100644
index 0000000..deb896f
--- /dev/null
+++ b/engines/titanic/rect.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/rect.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/rect.h b/engines/titanic/rect.h
new file mode 100644
index 0000000..ffd251b
--- /dev/null
+++ b/engines/titanic/rect.h
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RECT_H
+#define TITANIC_RECT_H
+
+#include "common/rect.h"
+
+namespace Titanic {
+
+typedef Common::Point Point;
+
+class Rect : public Common::Rect {
+public:
+	Rect() : Common::Rect() {}
+	Rect(int16 w, int16 h) : Common::Rect(w, h) {}
+	Rect(int16 x1, int16 y1, int16 x2, int16 y2) : Common::Rect(x1, y1, x2, y2) {}
+
+	operator const Point() { return Point(left, top); }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RECT_H */
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index f87ad66..942bb41 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -62,7 +62,7 @@ CScreenManager *CScreenManager::setCurrent() {
 	return _currentScreenManagerPtr;
 }
 
-void CScreenManager::setSurfaceBounds(int surfaceNum, const Common::Rect &r) {
+void CScreenManager::setSurfaceBounds(int surfaceNum, const Rect &r) {
 	if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
 		_backSurfaces[surfaceNum]._bounds = r;
 }
@@ -133,7 +133,7 @@ void OSScreenManager::getFont() {}
 void OSScreenManager::proc18() {}
 void OSScreenManager::proc19() {}
 
-void OSScreenManager::clearSurface(int surfaceNum, Common::Rect *bounds) {
+void OSScreenManager::clearSurface(int surfaceNum, Rect *bounds) {
 	if (surfaceNum == -1)
 		_directDrawManager._mainSurface->fill(bounds, 0);
 	else if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index ae3424d..023aa8e 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -40,7 +40,7 @@ class TitanicEngine;
 class CScreenManager {
 	struct VideoSurfaceEntry {
 		CVideoSurface *_surface;
-		Common::Rect _bounds;
+		Rect _bounds;
 	};
 protected:
 	TitanicEngine *_vm;
@@ -97,7 +97,7 @@ public:
 	/**
 	 * Clear a portion of a specified surface
 	 */
-	virtual void clearSurface(int surfaceNum, Common::Rect *_bounds) = 0;
+	virtual void clearSurface(int surfaceNum, Rect *_bounds) = 0;
 
 	/**
 	 * Resize the passed surface
@@ -119,7 +119,7 @@ public:
 	virtual void showCursor() = 0;
 	virtual void hideCursor() = 0;
 
-	void setSurfaceBounds(int surfaceNum, const Common::Rect &r);
+	void setSurfaceBounds(int surfaceNum, const Rect &r);
 };
 
 class OSScreenManager: CScreenManager {
@@ -173,7 +173,7 @@ public:
 	/**
 	 * Clear a portion of the screen surface
 	 */
-	virtual void clearSurface(int surfaceNum, Common::Rect *bounds);
+	virtual void clearSurface(int surfaceNum, Rect *bounds);
 
 	/**
 	 * Resize the passed surface
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index c975a27..3cd0ef7 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -194,16 +194,16 @@ double SimpleFile::readFloat() {
 	return floatValue;
 }
 
-Common::Point SimpleFile::readPoint() {
-	Common::Point pt;
+Point SimpleFile::readPoint() {
+	Point pt;
 	pt.x = readNumber();
 	pt.y = readNumber();
 
 	return pt;
 }
 
-Common::Rect SimpleFile::readRect() {
-	Common::Rect r;
+Rect SimpleFile::readRect() {
+	Rect r;
 	r.left = readNumber();
 	r.top = readNumber();
 	r.right = readNumber();
@@ -296,16 +296,16 @@ void SimpleFile::writeFloatLine(double val, int indent) {
 	write("\n", 1);
 }
 
-void SimpleFile::writePoint(const Common::Point &pt, int indent) {
+void SimpleFile::writePoint(const Point &pt, int indent) {
 	writeIndent(indent);
 	writeNumber(pt.x);
 	writeNumber(pt.y);
 	write("\n", 1);
 }
 
-void SimpleFile::writeRect(const Common::Rect &r, int indent) {
-	writePoint(Common::Point(r.left, r.top), indent);
-	writePoint(Common::Point(r.right, r.bottom), indent);
+void SimpleFile::writeRect(const Rect &r, int indent) {
+	writePoint(Point(r.left, r.top), indent);
+	writePoint(Point(r.right, r.bottom), indent);
 }
 
 void SimpleFile::writeIndent(uint indent) {
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
index 815896f..0568092 100644
--- a/engines/titanic/simple_file.h
+++ b/engines/titanic/simple_file.h
@@ -24,7 +24,7 @@
 #define TITANIC_SIMPLE_FILE_H
 
 #include "common/file.h"
-#include "common/rect.h"
+#include "titanic/rect.h"
 #include "common/savefile.h"
 #include "common/stream.h"
 #include "common/zlib.h"
@@ -104,12 +104,12 @@ public:
 	/**
 	 * Read in a point
 	 */
-	Common::Point readPoint();
+	Point readPoint();
 
 	/**
 	 * Read in a rect
 	 */
-	Common::Rect readRect();
+	Rect readRect();
 
 	/**
 	 * Read a string and copy it into an optionally passed buffer
@@ -159,12 +159,12 @@ public:
 	/**
 	 * Write out a point line
 	 */
-	void writePoint(const Common::Point &pt, int indent);
+	void writePoint(const Point &pt, int indent);
 
 	/**
 	 * Write out a rect line
 	 */
-	void writeRect(const Common::Rect &r, int indent);
+	void writeRect(const Rect &r, int indent);
 
 	/**
 	 * Write out a number of tabs to form an indent in the output
diff --git a/engines/titanic/text_cursor.cpp b/engines/titanic/text_cursor.cpp
index e591dc3..ae1f842 100644
--- a/engines/titanic/text_cursor.cpp
+++ b/engines/titanic/text_cursor.cpp
@@ -20,7 +20,6 @@
  *
  */
 
-#include "common/rect.h"
 #include "common/textconsole.h"
 #include "titanic/text_cursor.h"
 
@@ -29,9 +28,9 @@ namespace Titanic {
 CTextCursor::CTextCursor() : _active(false) {
 }
 
-Common::Rect CTextCursor::getBounds() {
+Rect CTextCursor::getBounds() {
 	warning("CTextCursor::getBounds");
-	return Common::Rect();
+	return Rect();
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/text_cursor.h b/engines/titanic/text_cursor.h
index 1b03abd..4b6be8f 100644
--- a/engines/titanic/text_cursor.h
+++ b/engines/titanic/text_cursor.h
@@ -24,6 +24,7 @@
 #define TITANIC_TEXT_CURSOR_H
 
 #include "common/scummsys.h"
+#include "titanic/rect.h"
 
 namespace Titanic {
 
@@ -33,7 +34,7 @@ public:
 public:
 	CTextCursor();
 
-	Common::Rect getBounds();
+	Rect getBounds();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index b38a862..17e8f0a 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -46,14 +46,14 @@ void CVideoSurface::setSurface(CScreenManager *screenManager, DirectDrawSurface
 	_ddSurface = surface;
 }
 
-void CVideoSurface::blitFrom(const Common::Rect &srcRect, const Common::Rect &destRect, CVideoSurface *srcSurface) {
+void CVideoSurface::blitFrom(const Rect &srcRect, const Rect &destRect, CVideoSurface *srcSurface) {
 	// TODO: Cases when _blitFlag is false
 	assert(_blitFlag);
 	error("TODO");
 }
 
-void CVideoSurface::clipBounds(Common::Rect &srcRect, Common::Rect &destRect,
-		CVideoSurface *srcSurface, Common::Rect *subRect, Common::Point *pt) {
+void CVideoSurface::clipBounds(Rect &srcRect, Rect &destRect,
+		CVideoSurface *srcSurface, Rect *subRect, Point *pt) {
 	if (pt) {
 		srcRect.left = pt->x;
 		srcRect.top = pt->y;
@@ -68,7 +68,7 @@ void CVideoSurface::clipBounds(Common::Rect &srcRect, Common::Rect &destRect,
 	} else {
 		srcRect.right = srcRect.left + srcSurface->getWidth();
 		srcRect.bottom = srcRect.top + srcSurface->getHeight();
-		srcRect = Common::Rect(0, 0, srcSurface->getWidth(), srcSurface->getHeight());
+		srcRect = Rect(0, 0, srcSurface->getWidth(), srcSurface->getHeight());
 	}
 
 	// Clip destination rect to be on-screen
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 88ab2e4..3538b1d 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -27,6 +27,7 @@
 #include "common/array.h"
 #include "titanic/font.h"
 #include "titanic/direct_draw.h"
+#include "titanic/rect.h"
 #include "titanic/core/list.h"
 #include "titanic/core/resource_key.h"
 
@@ -43,8 +44,8 @@ private:
 	/**
 	 * Calculates blitting bounds
 	 */
-	void clipBounds(Common::Rect &destRect, Common::Rect &srcRect,
-		CVideoSurface *srcSurface, Common::Rect *bounds2, Common::Point *pt);
+	void clipBounds(Rect &destRect, Rect &srcRect,
+		CVideoSurface *srcSurface, Rect *bounds2, Point *pt);
 protected:
 	static int _videoSurfaceCounter;
 protected:
@@ -151,7 +152,7 @@ public:
 	/**
 	 * Blit from another surface
 	 */
-	void blitFrom(const Common::Rect &srcRect, const Common::Rect &destRect, CVideoSurface *srcSurface);
+	void blitFrom(const Rect &srcRect, const Rect &destRect, CVideoSurface *srcSurface);
 };
 
 class OSVideoSurface : public CVideoSurface {


Commit: 1e6a32001088d790be2b1f909f90d55bb688ad6d
    https://github.com/scummvm/scummvm/commit/1e6a32001088d790be2b1f909f90d55bb688ad6d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-21T21:51:29-04:00

Commit Message:
TITANIC: Implementing view draw code

Changed paths:
    engines/titanic/events.cpp
    engines/titanic/game_view.cpp
    engines/titanic/rect.cpp
    engines/titanic/rect.h
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index 6fae102..1f8ccce 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -90,7 +90,7 @@ bool Events::checkForNextFrameCounter() {
 		_vm->_debugger->onFrame();
 
 		// Display the frame
-		//_vm->_screen->update();
+		_vm->_screen->update();
 
 		return true;
 	}
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index 505e489..d780b8b 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -59,13 +59,16 @@ void CGameView::createSurface(const CResourceKey &key) {
 
 void CGameView::drawView() {
 	CScreenManager::setCurrent();
-	Rect rect1 = _gameManager->_bounds;
+	Rect srcRect = _gameManager->_bounds;
+
 	Rect rect2(0, 0, 600, 340);
 	rect2.translate(20, 10);
+	srcRect.combine2(rect2);
+	srcRect.translate(-20, -10);
+	Common::Point destPos(srcRect.left, srcRect.top);
 
-
-
-	warning("TODO: CGameView_Draw1");
+	CScreenManager::_currentScreenManagerPtr->blitFrom(0, _surface,
+		&destPos, &srcRect);
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/titanic/rect.cpp b/engines/titanic/rect.cpp
index deb896f..4642b34 100644
--- a/engines/titanic/rect.cpp
+++ b/engines/titanic/rect.cpp
@@ -24,4 +24,21 @@
 
 namespace Titanic {
 
+void Rect::combine1(const Rect &r) {
+	if (isEmpty() || r.isEmpty())
+		return;
+
+	Common::Rect::extend(r);
+}
+
+void Rect::combine2(const Rect &r) {
+	if (!isEmpty()) {
+		if (r.isEmpty()) {
+			clear();
+		} else {
+			Common::Rect::extend(r);
+		}
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/rect.h b/engines/titanic/rect.h
index ffd251b..b70550a 100644
--- a/engines/titanic/rect.h
+++ b/engines/titanic/rect.h
@@ -35,7 +35,25 @@ public:
 	Rect(int16 w, int16 h) : Common::Rect(w, h) {}
 	Rect(int16 x1, int16 y1, int16 x2, int16 y2) : Common::Rect(x1, y1, x2, y2) {}
 
+	/**
+	 * Returns the top/left corner of the rect as a point
+	 */
 	operator const Point() { return Point(left, top); }
+
+	/**
+	 * Clear the rect
+	 */
+	void clear() { left = top = right = bottom = 0; }
+
+	/**
+	 * Combine another rect into this one
+	 */
+	void combine1(const Rect &r);
+
+	/**
+	 * Combine another rect into this one
+	 */
+	void combine2(const Rect &r);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 942bb41..4f9fbc2 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -123,7 +123,45 @@ CVideoSurface *OSScreenManager::getSurface(int surfaceNum) const {
 
 void OSScreenManager::proc9() {}
 void OSScreenManager::proc10() {}
-void OSScreenManager::proc11() {}
+
+void OSScreenManager::blitFrom(int surfaceNum, CVideoSurface *src,
+	const Point *destPos, const Rect *srcRect) {
+	// Get the dest surface
+	CVideoSurface *destSurface = _frontRenderSurface;
+	if (surfaceNum < -1)
+		return;
+	if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
+		destSurface = _backSurfaces[surfaceNum]._surface;
+	if (!destSurface->hasSurface())
+		return;
+	
+	Point destPoint = destPos ? *destPos : Point(0, 0);
+	Rect srcBounds = srcRect ? *srcRect : Rect(0, 0, src->getWidth(), src->getHeight());
+	Rect *bounds = &srcBounds;
+	Rect rect2;
+
+	if (surfaceNum >= 0 && !_backSurfaces[surfaceNum]._bounds.isEmpty()) {
+		// Perform clipping to the bounds of the back surface
+		rect2 = srcBounds;
+		rect2.translate(-srcBounds.left, -srcBounds.top);
+		rect2.translate(destPoint.x, destPoint.y);
+		rect2.combine2(_backSurfaces[surfaceNum]._bounds);
+
+		rect2.translate(-destPoint.x, -destPoint.y);
+		rect2.translate(srcBounds.left, srcBounds.top);
+
+		if (rect2.isEmpty())
+			return;
+
+		destPoint.x += rect2.left - srcBounds.left;
+		destPoint.y += rect2.top - srcBounds.top;
+		bounds = &rect2;
+	}
+
+	if (!bounds->isEmpty())
+		destSurface->blitFrom(destPoint, src, bounds);
+}
+
 void OSScreenManager::proc12() {}
 void OSScreenManager::proc13() {}
 void OSScreenManager::proc14() {}
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index 023aa8e..dc5a042 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -84,7 +84,13 @@ public:
 	virtual CVideoSurface *getSurface(int surfaceNum) const = 0;
 	virtual void proc9() = 0;
 	virtual void proc10() = 0;
-	virtual void proc11() = 0;
+
+	/**
+	 * Blits a surface onto one of the screen surfaces
+	 */
+	virtual void blitFrom(int surfaceNum, CVideoSurface *src, const Point *destPos = nullptr,
+		const Rect *srcRect = nullptr) = 0;
+
 	virtual void proc12() = 0;
 	virtual void proc13() = 0;
 	virtual void proc14() = 0;
@@ -160,7 +166,13 @@ public:
 	virtual CVideoSurface *getSurface(int surfaceNum) const;
 	virtual void proc9();
 	virtual void proc10();
-	virtual void proc11();
+
+	/**
+	 * Blits a surface onto one of the screen surfaces
+	 */
+	virtual void blitFrom(int surfaceNum, CVideoSurface *src, const Point *destPos,
+		const Rect *srcRect = nullptr);
+
 	virtual void proc12();
 	virtual void proc13();
 	virtual void proc14();
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index f29e776..3c31731 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -50,12 +50,14 @@ TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDe
 	_debugger = nullptr;
 	_events = nullptr;
 	_window = nullptr;
+	_screen = nullptr;
 	_screenManager = nullptr;
 }
 
 TitanicEngine::~TitanicEngine() {
 	delete _debugger;
 	delete _events;
+	delete _screen;
 	delete _window;
 	delete _screenManager;
 	CSaveableObject::freeClassList();
@@ -85,6 +87,7 @@ void TitanicEngine::initialize() {
 
 	_debugger = new Debugger(this);
 	_events = new Events(this);
+	_screen = new Graphics::Screen();
 	_screenManager = new OSScreenManager(this);
 	_window = new CMainGameWindow(this);
 	_window->applicationStarting();
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 8ed353f..94ba316 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -29,6 +29,7 @@
 #include "common/serializer.h"
 #include "engines/advancedDetector.h"
 #include "engines/engine.h"
+#include "graphics/screen.h"
 #include "titanic/debugger.h"
 #include "titanic/events.h"
 #include "titanic/files_manager.h"
@@ -96,6 +97,7 @@ public:
 	CFilesManager _filesManager;
 	Debugger *_debugger;
 	Events *_events;
+	Graphics::Screen *_screen;
 	OSScreenManager *_screenManager;
 	CMainGameWindow *_window;
 	Common::RandomSource _randomSource;
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 17e8f0a..ab5bf7d 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -29,8 +29,8 @@ namespace Titanic {
 int CVideoSurface::_videoSurfaceCounter = 0;
 
 CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
-		_screenManager(screenManager), _rawSurface(nullptr),
-		_field34(nullptr), _pendingLoad(false), _blitFlag(false),
+		_screenManager(screenManager), _rawSurface(nullptr), _field34(nullptr),
+		_pendingLoad(false), _blitStyleFlag(false), _blitFlag(false),
 		_field40(0), _field44(4), _field48(0), _field50(1) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
 }
@@ -46,14 +46,20 @@ void CVideoSurface::setSurface(CScreenManager *screenManager, DirectDrawSurface
 	_ddSurface = surface;
 }
 
-void CVideoSurface::blitFrom(const Rect &srcRect, const Rect &destRect, CVideoSurface *srcSurface) {
-	// TODO: Cases when _blitFlag is false
-	assert(_blitFlag);
-	error("TODO");
+void CVideoSurface::blitFrom(const Point &destPos, CVideoSurface *src, const Rect *srcRect) {
+	if (loadIfReady() && src->loadIfReady() && _ddSurface && src->_ddSurface) {
+		Rect srcBounds, destBounds;
+		clipBounds(srcBounds, destBounds, src, srcRect, &destPos);
+
+		if (_blitStyleFlag)
+			blitRect2(srcBounds, destBounds, src);
+		else
+			blitRect1(srcBounds, destBounds, src);
+	}
 }
 
 void CVideoSurface::clipBounds(Rect &srcRect, Rect &destRect,
-		CVideoSurface *srcSurface, Rect *subRect, Point *pt) {
+		CVideoSurface *srcSurface, const Rect *subRect, const Point *pt) {
 	if (pt) {
 		srcRect.left = pt->x;
 		srcRect.top = pt->y;
@@ -113,6 +119,21 @@ void CVideoSurface::clipBounds(Rect &srcRect, Rect &destRect,
 		error("Invalid rect");
 }
 
+void CVideoSurface::blitRect1(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
+	src->lock();
+	lock();
+
+	// TODO: Do it like the original does it
+	this->_rawSurface->blitFrom(*src->_rawSurface, srcRect, Point(destRect.left, destRect.top));
+	
+	src->unlock();
+	unlock();
+}
+
+void CVideoSurface::blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
+	// TODO: Do it like the original does it
+	blitRect1(srcRect, destRect, src);
+}
 
 /*------------------------------------------------------------------------*/
 
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 3538b1d..39431f1 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -44,8 +44,11 @@ private:
 	/**
 	 * Calculates blitting bounds
 	 */
-	void clipBounds(Rect &destRect, Rect &srcRect,
-		CVideoSurface *srcSurface, Rect *bounds2, Point *pt);
+	void clipBounds(Rect &srcRect, Rect &destRect,
+		CVideoSurface *srcSurface, const Rect *subRect, const Point *pt);
+
+	void blitRect1(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
+	void blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
 protected:
 	static int _videoSurfaceCounter;
 protected:
@@ -63,6 +66,7 @@ protected:
 	int _lockCount;
 public:
 	bool _blitFlag;
+	bool _blitStyleFlag;
 public:
 	CVideoSurface(CScreenManager *screenManager);
 	virtual ~CVideoSurface();
@@ -152,7 +156,7 @@ public:
 	/**
 	 * Blit from another surface
 	 */
-	void blitFrom(const Rect &srcRect, const Rect &destRect, CVideoSurface *srcSurface);
+	void blitFrom(const Point &destPos, CVideoSurface *src, const Rect *srcRect = nullptr);
 };
 
 class OSVideoSurface : public CVideoSurface {


Commit: 6a118677ed76a9a4dc1f4eb38c19b99e1b3a2e60
    https://github.com/scummvm/scummvm/commit/6a118677ed76a9a4dc1f4eb38c19b99e1b3a2e60
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-21T22:05:08-04:00

Commit Message:
TITANIC: Fix initialization of screen manager surfaces

Changed paths:
    engines/titanic/direct_draw.cpp
    engines/titanic/screen_manager.cpp
    engines/titanic/video_surface.cpp



diff --git a/engines/titanic/direct_draw.cpp b/engines/titanic/direct_draw.cpp
index 79ca968..1c19911 100644
--- a/engines/titanic/direct_draw.cpp
+++ b/engines/titanic/direct_draw.cpp
@@ -93,7 +93,7 @@ void DirectDrawManager::initFullScreen() {
 		_directDraw._bpp, 0);
 
 	_mainSurface = new DirectDrawSurface();
-	_mainSurface->create(_directDraw._width, _directDraw._height);
+	_mainSurface->create(g_vm->_screen);
 	_backSurfaces[0] = new DirectDrawSurface();
 	_backSurfaces[0]->create(_directDraw._width, _directDraw._height);
 }
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 4f9fbc2..4d37b45 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -90,9 +90,10 @@ void OSScreenManager::setMode(int width, int height, int bpp, uint numBackSurfac
 	_frontRenderSurface = new OSVideoSurface(this, nullptr);
 	_frontRenderSurface->setSurface(this, _directDrawManager._mainSurface);
 
+	_backSurfaces.resize(numBackSurfaces);
 	for (uint idx = 0; idx < numBackSurfaces; ++idx) {
-		OSVideoSurface videoSurface(this, nullptr);
-		videoSurface.setSurface(this, _directDrawManager._backSurfaces[idx]);
+		_backSurfaces[idx]._surface = new OSVideoSurface(this, nullptr);
+		_backSurfaces[idx]._surface->setSurface(this, _directDrawManager._backSurfaces[idx]);
 	}
 
 	// Load fonts
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index ab5bf7d..e833e1c 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -124,8 +124,9 @@ void CVideoSurface::blitRect1(const Rect &srcRect, const Rect &destRect, CVideoS
 	lock();
 
 	// TODO: Do it like the original does it
-	this->_rawSurface->blitFrom(*src->_rawSurface, srcRect, Point(destRect.left, destRect.top));
-	
+//	this->_rawSurface->blitFrom(*src->_rawSurface, srcRect, Point(destRect.left, destRect.top));
+	this->_rawSurface->blitFrom(*src->_rawSurface);
+
 	src->unlock();
 	unlock();
 }


Commit: b7746eff425dde0fac89684281541a609ca8e294
    https://github.com/scummvm/scummvm/commit/b7746eff425dde0fac89684281541a609ca8e294
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-21T22:44:55-04:00

Commit Message:
TITANIC: Implement method for rendering view contents

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/node_item.cpp
    engines/titanic/core/node_item.h
    engines/titanic/core/room_item.cpp
    engines/titanic/core/room_item.h
    engines/titanic/core/tree_item.h
    engines/titanic/main_game_window.cpp



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 06f2ce7..db1e9ef 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -127,4 +127,8 @@ bool CGameObject::checkPoint(const Point &pt, int v0, int v1) {
 	return false;
 }
 
+void CGameObject::draw(CScreenManager *screenManager) {
+	warning("TODO: CGameObject::draw");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 809f7b8..675339e 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -73,6 +73,11 @@ public:
 	 */
 	virtual void load(SimpleFile *file);
 
+	/**
+	 * Allows the item to draw itself
+	 */
+	virtual void draw(CScreenManager *screenManager);
+
 	void fn2();
 
 	bool checkPoint(const Point &pt, int v0, int v1);
diff --git a/engines/titanic/core/node_item.cpp b/engines/titanic/core/node_item.cpp
index 22c9b9b..6b7d645 100644
--- a/engines/titanic/core/node_item.cpp
+++ b/engines/titanic/core/node_item.cpp
@@ -24,14 +24,14 @@
 
 namespace Titanic {
 
-CNodeItem::CNodeItem() : CNamedItem(), _field24(0), _field28(0), _nodeNumber(0) {
+CNodeItem::CNodeItem() : CNamedItem(), _nodeNumber(0) {
 }
 
 void CNodeItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(0, indent);
 	file->writeQuotedLine("N", indent);
-	file->writeNumberLine(_field24, indent + 1);
-	file->writeNumberLine(_field28, indent + 1);
+	file->writeNumberLine(_nodePos.x, indent + 1);
+	file->writeNumberLine(_nodePos.y, indent + 1);
 
 	file->writeQuotedLine("N", indent);
 	file->writeNumberLine(_nodeNumber, indent + 1);
@@ -42,8 +42,8 @@ void CNodeItem::save(SimpleFile *file, int indent) const {
 void CNodeItem::load(SimpleFile *file) {
 	file->readNumber();
 	file->readBuffer();
-	_field24 = file->readNumber();
-	_field28 = file->readNumber();
+	_nodePos.x = file->readNumber();
+	_nodePos.y = file->readNumber();
 
 	file->readBuffer();
 	_nodeNumber = file->readNumber();
diff --git a/engines/titanic/core/node_item.h b/engines/titanic/core/node_item.h
index 4f0391a..32db1c1 100644
--- a/engines/titanic/core/node_item.h
+++ b/engines/titanic/core/node_item.h
@@ -28,11 +28,9 @@
 namespace Titanic {
 
 class CNodeItem : public CNamedItem {
-protected:
-	int _field24;
-	int _field28;
 public:
 	int _nodeNumber;
+	Point _nodePos;
 public:
 	CLASSDEF
 	CNodeItem();
diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp
index b0cefca..7a6dfd9 100644
--- a/engines/titanic/core/room_item.cpp
+++ b/engines/titanic/core/room_item.cpp
@@ -103,4 +103,16 @@ void CRoomItem::loading() {
 	// TODO
 }
 
+void CRoomItem::calcNodePosition(const Point &nodePos, double &xVal, double &yVal) const {
+	xVal = yVal = 0.0;
+	
+	if (_roomDimensionX >= 0.0 && _roomDimensionY >= 0.0) {
+		xVal = _roomRect.width() / _roomDimensionX;
+		yVal = _roomRect.height() / _roomDimensionY;
+
+		xVal = (nodePos.x - _roomRect.left) / xVal;
+		yVal = (nodePos.y - _roomRect.top) / yVal;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index 7248b4a..9e7f553 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -59,6 +59,11 @@ public:
 	 * Return a movie clip for the room by name
 	 */
 	CMovieClip *findClip(const CString &name) { return _clipList.findByName(name); }
+
+	/**
+	 * Calculates the positioning of a node within the overall room
+	 */
+	void calcNodePosition(const Point &nodePos, double &xVal, double &yVal) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 5669784..e870ad1 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -31,6 +31,7 @@ class CGameManager;
 class CDontSaveFileItem;
 class CNamedItem;
 class CProjectItem;
+class CScreenManager;
 
 class CTreeItem: public CMessageTarget {
 private:
@@ -120,6 +121,11 @@ public:
 	virtual int compareTo(const CString &name, int maxLen) const { return false; }
 
 	/**
+	 * Allows the item to draw itself
+	 */
+	virtual void draw(CScreenManager *screenManager) {}
+
+	/**
 	 * Gets the bounds occupied by the item
 	 */
 	virtual Rect getBounds() { return Rect(); }
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 839c2fc..6fa240d 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -157,7 +157,32 @@ void CMainGameWindow::drawView() {
 }
 
 void CMainGameWindow::drawViewContents(CScreenManager *screenManager) {
+	// Get a reference to the reference, validating that it's present
+	if (!screenManager)
+		return;
+	CViewItem *view = _gameManager->getView();
+	if (!view)
+		return;
+	CNodeItem *node = view->findNode();
+	if (!node)
+		return;
+	CRoomItem *room = node->findRoom();
+	if (!room)
+		return;
+
+	double xVal = 0.0, yVal = 0.0;
+	room->calcNodePosition(node->_nodePos, xVal, yVal);
+
+	// Iterate through drawing all the items in the scene except any item
+	// that's currently being dragged
+	for (CTreeItem *treeItem = view; treeItem; treeItem = treeItem->scan(view)) {
+		if (treeItem != _gameManager->_dragItem)
+			treeItem->draw(screenManager);
+	}
 
+	// Finally draw the drag item if there is one
+	if (_gameManager->_dragItem)
+		_gameManager->_dragItem->draw(screenManager);
 }
 
 void CMainGameWindow::mouseChanged() {


Commit: 5cec3b3bd80f6f6ac601ba81175316f6e0d145e2
    https://github.com/scummvm/scummvm/commit/5cec3b3bd80f6f6ac601ba81175316f6e0d145e2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-22T07:44:45-04:00

Commit Message:
TITANIC: Implement object image loading and drawing

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/resource_key.h
    engines/titanic/files_manager.cpp
    engines/titanic/files_manager.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index db1e9ef..acd34de 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -20,11 +20,18 @@
  *
  */
 
+#include "titanic/files_manager.h"
+#include "titanic/game_manager.h"
+#include "titanic/screen_manager.h"
+#include "titanic/titanic.h"
+#include "titanic/video_surface.h"
 #include "titanic/core/game_object.h"
 #include "titanic/core/resource_key.h"
 
 namespace Titanic {
 
+void *CGameObject::_v1 = nullptr;
+
 CGameObject::CGameObject(): CNamedItem() {
 	_bounds = Rect(0, 0, 15, 15);
 	_field34 = 0;
@@ -41,14 +48,14 @@ CGameObject::CGameObject(): CNamedItem() {
 	_field60 = 0;
 	_cursorId = 1;
 	_field78 = 0;
-	_field8C = -1;
+	_frameNumber = -1;
 	_field90 = 0;
 	_field94 = 0;
 	_field98 = 0;
 	_field9C = 0;
 	_fieldA0 = 0;
 	_fieldA4 = 0;
-	_fieldA8 = nullptr;
+	_surface = nullptr;
 	_fieldB8 = 0;
 }
 
@@ -66,7 +73,7 @@ void CGameObject::load(SimpleFile *file) {
 	switch (val) {
 	case 7:
 		_clipList2.load(file);
-		_field8C = file->readNumber();
+		_frameNumber = file->readNumber();
 		// Deliberate fall-through
 
 	case 6:
@@ -86,7 +93,7 @@ void CGameObject::load(SimpleFile *file) {
 		// Deliberate fall-through
 
 	case 2:
-		_string = file->readString();
+		_resource = file->readString();
 		// Deliberate fall-through
 
 	case 1:
@@ -104,10 +111,10 @@ void CGameObject::load(SimpleFile *file) {
 		_field58 = file->readNumber();
 
 		resourceKey.load(file);		
-		_fieldA8 = nullptr;
+		_surface = nullptr;
 		val = file->readNumber();
 		if (val) {
-			_string = resourceKey.getString();
+			_resource = resourceKey.getString();
 		}
 		break;
 
@@ -128,7 +135,115 @@ bool CGameObject::checkPoint(const Point &pt, int v0, int v1) {
 }
 
 void CGameObject::draw(CScreenManager *screenManager) {
-	warning("TODO: CGameObject::draw");
+	if (!_field5C)
+		return;
+	if (_v1) {
+		error("TODO: Block in CGameObject::draw");
+	}
+
+	if (_field40) {
+		if (_field90) {
+			if (_bounds.intersects(getGameManager()->_bounds))
+				warning("TODO: _field90(screenManager);");
+		}
+	} else {
+		if (!_surface) {
+			if (!_resource.empty()) {
+				loadResource(_resource);
+				_resource = "";
+			}
+		}
+
+		if (_surface) {
+			_bounds.right = _surface->getWidth();
+			_bounds.bottom = _surface->getHeight();
+
+			if (!_bounds.right || !_bounds.bottom)
+				return;
+
+			if (_frameNumber >= 0) {
+				loadFrame(_frameNumber);
+				_frameNumber = -1;
+			}
+
+			if (!_clipList2.empty())
+				processClipList2();
+
+			if (_bounds.intersects(getGameManager()->_bounds)) {
+				if (_surface) {
+					Point destPos(_bounds.left, _bounds.top);
+					screenManager->blitFrom(0, _surface, &destPos);
+				}
+
+				if (_field90)
+					warning("TODO: sub_415f80(screenManager);");
+			}
+		}
+	}
+}
+
+void CGameObject::loadResource(const CString &name) {
+	switch (name.imageTypeSuffix()) {
+	case FILETYPE_IMAGE:
+		loadImage(name);
+		break;
+	case FILETYPE_MOVIE:
+		loadMovie(name);
+		break;
+	}
+}
+
+void CGameObject::loadMovie(const CString &name, bool pendingFlag) {
+	warning("TODO: CGameObject::loadMovie");
+}
+
+void CGameObject::loadImage(const CString &name, bool pendingFlag) {
+	// Get a refernce to the game and screen managers
+	CGameManager *gameManager = getGameManager();
+	CScreenManager *screenManager;
+
+	if (gameManager && (screenManager = CScreenManager::setCurrent()) != nullptr) {
+		// Destroy the object's surface if it already had one
+		if (_surface) {
+			delete _surface;
+			_surface = nullptr;
+		}
+
+		g_vm->_filesManager.fn5(name);
+
+		if (!name.empty()) {
+			_surface = new OSVideoSurface(screenManager, CResourceKey(name), pendingFlag);
+		}
+
+		if (_surface && !pendingFlag) {
+			_bounds.right = _surface->getWidth();
+			_bounds.bottom = _surface->getHeight();
+		}
+
+		// Mark the object's area as dirty, so that on the next frame rendering
+		// this object will be redrawn
+		makeDirty();
+	}
+
+	_field78 = 0;
+}
+
+void CGameObject::loadFrame(int frameNumber) {
+	warning("CGameObject::loadFrame");
+}
+
+void CGameObject::processClipList2() {
+	warning("CGameObject::processClipList2");
+}
+
+void CGameObject::makeDirty(const Rect &r) {
+	CGameManager *gameManager = getGameManager();
+	if (gameManager)
+		gameManager->extendBounds(r);
+}
+
+void CGameObject::makeDirty() {
+	makeDirty(_bounds);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 675339e..b327671 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -29,7 +29,43 @@
 
 namespace Titanic {
 
+class CVideoSurface;
+
 class CGameObject : public CNamedItem {
+public:
+	static void *_v1;
+private:
+	/**
+	 * Load a visual resource for the object
+	 */
+	void loadResource(const CString &name);
+
+	/**
+	 * Loads a movie
+	 */
+	void loadMovie(const CString &name, bool pendingFlag = true);
+
+	/**
+	 * Loads an image
+	 */
+	void loadImage(const CString &name, bool pendingFlag = true);
+
+	/**
+	 * Loads a frame
+	 */
+	void loadFrame(int frameNumber);
+
+	void processClipList2();
+
+	/**
+	 * Marks the area in the passed rect as dirty, and requiring re-rendering
+	 */
+	void makeDirty(const Rect &r);
+
+	/**
+	 * Marks the area occupied by the object as dirty, requiring re-rendering
+	 */
+	void makeDirty();
 protected:
 	Rect _bounds;
 	double _field34;
@@ -46,15 +82,15 @@ protected:
 	CMovieClipList _clipList1;
 	int _field78;
 	CMovieClipList _clipList2;
-	int _field8C;
+	int _frameNumber;
 	int _field90;
 	int _field94;
 	int _field98;
 	int _field9C;
 	int _fieldA0;
 	int _fieldA4;
-	void *_fieldA8;
-	CString _string;
+	CVideoSurface *_surface;
+	CString _resource;
 	int _fieldB8;
 public:
 	int _field60;
diff --git a/engines/titanic/core/resource_key.h b/engines/titanic/core/resource_key.h
index dc4c791..ab49cb8 100644
--- a/engines/titanic/core/resource_key.h
+++ b/engines/titanic/core/resource_key.h
@@ -36,6 +36,8 @@ private:
 	void setValue(const CString &name);
 public:
 	CLASSDEF
+	CResourceKey() {}
+	CResourceKey(const CString &name) { setValue(name); }
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/files_manager.cpp b/engines/titanic/files_manager.cpp
index 7ff0b51..f56c9c5 100644
--- a/engines/titanic/files_manager.cpp
+++ b/engines/titanic/files_manager.cpp
@@ -81,4 +81,8 @@ void CFilesManager::resetView() {
 	}
 }
 
+void CFilesManager::fn5(const CString &name) {
+	warning("TODO: CFilesManager::fn5");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/files_manager.h b/engines/titanic/files_manager.h
index ab92151..0785bfc 100644
--- a/engines/titanic/files_manager.h
+++ b/engines/titanic/files_manager.h
@@ -76,6 +76,8 @@ public:
 	 * Resets the view being displayed
 	 */
 	void resetView();
+
+	void fn5(const CString &name);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index a80e871..a3c241c 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -235,4 +235,11 @@ void CGameManager::frameMessage(CRoomItem *room) {
 	}
 }
 
+void CGameManager::extendBounds(const Rect &r) {
+	if (_bounds.isEmpty())
+		_bounds = r;
+	else
+		_bounds.combine1(r);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 51e1c3d..610c438 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -192,6 +192,12 @@ public:
 	void inc54() { ++_field54; }
 
 	void dec54() { --_field54; }
+
+	/**
+	 * Extends the bounds of the currently affected game display area
+	 * to include the passed rect
+	 */
+	void extendBounds(const Rect &r);
 };
 
 } // End of namespace Titanic


Commit: 46e554b981fce68e62e1573881fce1a0fcfed806
    https://github.com/scummvm/scummvm/commit/46e554b981fce68e62e1573881fce1a0fcfed806
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-22T20:51:59-04:00

Commit Message:
GRAPHICS: Set parameterless Screen constructor to use screen format

Changed paths:
    graphics/screen.cpp



diff --git a/graphics/screen.cpp b/graphics/screen.cpp
index 4169c98..ccf651f 100644
--- a/graphics/screen.cpp
+++ b/graphics/screen.cpp
@@ -28,7 +28,7 @@
 namespace Graphics {
 
 Screen::Screen(): ManagedSurface() {
-	create(g_system->getWidth(), g_system->getHeight());
+	create(g_system->getWidth(), g_system->getHeight(), g_system->getScreenFormat());
 }
 
 Screen::Screen(int width, int height): ManagedSurface() {


Commit: 06bd62fed403684afe00c018647cb4febeeddcce
    https://github.com/scummvm/scummvm/commit/06bd62fed403684afe00c018647cb4febeeddcce
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-22T21:54:26-04:00

Commit Message:
TITANIC: First scene starting to be displayed

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/direct_draw_surface.cpp
    engines/titanic/game_manager.cpp
    engines/titanic/game_view.cpp
    engines/titanic/main_game_window.cpp
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index acd34de..8f2b333 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -172,7 +172,7 @@ void CGameObject::draw(CScreenManager *screenManager) {
 			if (_bounds.intersects(getGameManager()->_bounds)) {
 				if (_surface) {
 					Point destPos(_bounds.left, _bounds.top);
-					screenManager->blitFrom(0, _surface, &destPos);
+					screenManager->blitFrom(SURFACE_BACKBUFFER, _surface, &destPos);
 				}
 
 				if (_field90)
diff --git a/engines/titanic/direct_draw_surface.cpp b/engines/titanic/direct_draw_surface.cpp
index 4e7311a..b432245 100644
--- a/engines/titanic/direct_draw_surface.cpp
+++ b/engines/titanic/direct_draw_surface.cpp
@@ -64,6 +64,7 @@ void DirectDrawSurface::unlock() {
 void DirectDrawSurface::fill(const Rect *bounds, uint32 color) {
 	Rect tempBounds;
 
+	assert(_surface);
 	if (bounds) {
 		// Bounds are provided, clip them to the bounds of this surface
 		tempBounds = *bounds;
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index a3c241c..d0c1ad5 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -179,7 +179,7 @@ void CGameManager::update() {
 			_bounds.extend(textCursor->getBounds());
 		
 		// Set the surface bounds
-		screenManager->setSurfaceBounds(0, _bounds);
+		screenManager->setSurfaceBounds(SURFACE_BACKBUFFER, _bounds);
 
 		// Handle redrawing the view
 		if (!_bounds.isEmpty()) {
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index d780b8b..e93e8f0 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -67,8 +67,8 @@ void CGameView::drawView() {
 	srcRect.translate(-20, -10);
 	Common::Point destPos(srcRect.left, srcRect.top);
 
-	CScreenManager::_currentScreenManagerPtr->blitFrom(0, _surface,
-		&destPos, &srcRect);
+	CScreenManager::_currentScreenManagerPtr->blitFrom(SURFACE_BACKBUFFER,
+		_surface, &destPos, &srcRect);
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 6fa240d..e1efae8 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -55,7 +55,7 @@ void CMainGameWindow::applicationStarting() {
 	
 	// Set the video mode
 	CScreenManager *screenManager = CScreenManager::setCurrent();
-	screenManager->setMode(640, 480, 16, 1, true);
+	screenManager->setMode(640, 480, 16, 0, true);
 
 	// TODO: Remove initial background and palette
 
@@ -120,7 +120,7 @@ void CMainGameWindow::draw() {
 		}
 
 		CScreenManager *scrManager = CScreenManager::setCurrent();
-		scrManager->clearSurface(0, &_gameManager->_bounds);
+		scrManager->clearSurface(SURFACE_BACKBUFFER, &_gameManager->_bounds);
 
 		switch (_gameManager->_gameState._mode) {
 		case GSMODE_1:
@@ -129,7 +129,7 @@ void CMainGameWindow::draw() {
 				drawPet(scrManager);
 
 			drawView();
-			drawViewContents(scrManager);
+//			drawViewContents(scrManager);
 			scrManager->drawCursors();
 			break;
 
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 4d37b45..f13ecdd 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/screen_manager.h"
+#include "titanic/titanic.h"
 #include "titanic/video_surface.h"
 
 namespace Titanic {
@@ -62,7 +63,7 @@ CScreenManager *CScreenManager::setCurrent() {
 	return _currentScreenManagerPtr;
 }
 
-void CScreenManager::setSurfaceBounds(int surfaceNum, const Rect &r) {
+void CScreenManager::setSurfaceBounds(SurfaceNum surfaceNum, const Rect &r) {
 	if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
 		_backSurfaces[surfaceNum]._bounds = r;
 }
@@ -84,9 +85,11 @@ OSScreenManager::~OSScreenManager() {
 }
 
 void OSScreenManager::setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) {
+	assert(bpp == 16);
 	destroyFrontAndBackBuffers();
 	_directDrawManager.initVideo(width, height, bpp, numBackSurfaces);
 
+	_vm->_screen->create(width, height, g_system->getScreenFormat());
 	_frontRenderSurface = new OSVideoSurface(this, nullptr);
 	_frontRenderSurface->setSurface(this, _directDrawManager._mainSurface);
 
@@ -113,7 +116,7 @@ void OSScreenManager::drawCursors() {
 void OSScreenManager::proc6() {}
 void OSScreenManager::proc7() {}
 
-CVideoSurface *OSScreenManager::getSurface(int surfaceNum) const {
+CVideoSurface *OSScreenManager::getSurface(SurfaceNum surfaceNum) const {
 	if (surfaceNum == -1)
 		return _frontRenderSurface;
 	else if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
@@ -125,7 +128,7 @@ CVideoSurface *OSScreenManager::getSurface(int surfaceNum) const {
 void OSScreenManager::proc9() {}
 void OSScreenManager::proc10() {}
 
-void OSScreenManager::blitFrom(int surfaceNum, CVideoSurface *src,
+void OSScreenManager::blitFrom(SurfaceNum surfaceNum, CVideoSurface *src,
 	const Point *destPos, const Rect *srcRect) {
 	// Get the dest surface
 	CVideoSurface *destSurface = _frontRenderSurface;
@@ -172,7 +175,7 @@ void OSScreenManager::getFont() {}
 void OSScreenManager::proc18() {}
 void OSScreenManager::proc19() {}
 
-void OSScreenManager::clearSurface(int surfaceNum, Rect *bounds) {
+void OSScreenManager::clearSurface(SurfaceNum surfaceNum, Rect *bounds) {
 	if (surfaceNum == -1)
 		_directDrawManager._mainSurface->fill(bounds, 0);
 	else if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index dc5a042..1b926fc 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -35,6 +35,16 @@
 
 namespace Titanic {
 
+/**
+ * The original used page flipping with one primary and one back buffer.
+ * Since we don't need that in ScummVM, the back buffer number below is
+ * remapped to the primary surface
+ */
+enum SurfaceNum {
+	SURFACE_PRIMARY = -1,
+	SURFACE_BACKBUFFER = -1
+};
+
 class TitanicEngine;
 
 class CScreenManager {
@@ -81,14 +91,14 @@ public:
 	
 	virtual void proc6() = 0;
 	virtual void proc7() = 0;
-	virtual CVideoSurface *getSurface(int surfaceNum) const = 0;
+	virtual CVideoSurface *getSurface(SurfaceNum surfaceNum) const = 0;
 	virtual void proc9() = 0;
 	virtual void proc10() = 0;
 
 	/**
 	 * Blits a surface onto one of the screen surfaces
 	 */
-	virtual void blitFrom(int surfaceNum, CVideoSurface *src, const Point *destPos = nullptr,
+	virtual void blitFrom(SurfaceNum surfaceNum, CVideoSurface *src, const Point *destPos = nullptr,
 		const Rect *srcRect = nullptr) = 0;
 
 	virtual void proc12() = 0;
@@ -103,7 +113,7 @@ public:
 	/**
 	 * Clear a portion of a specified surface
 	 */
-	virtual void clearSurface(int surfaceNum, Rect *_bounds) = 0;
+	virtual void clearSurface(SurfaceNum surfaceNum, Rect *_bounds) = 0;
 
 	/**
 	 * Resize the passed surface
@@ -125,7 +135,7 @@ public:
 	virtual void showCursor() = 0;
 	virtual void hideCursor() = 0;
 
-	void setSurfaceBounds(int surfaceNum, const Rect &r);
+	void setSurfaceBounds(SurfaceNum surfaceNum, const Rect &r);
 };
 
 class OSScreenManager: CScreenManager {
@@ -163,14 +173,14 @@ public:
 
 	virtual void proc6();
 	virtual void proc7();
-	virtual CVideoSurface *getSurface(int surfaceNum) const;
+	virtual CVideoSurface *getSurface(SurfaceNum surfaceNum) const;
 	virtual void proc9();
 	virtual void proc10();
 
 	/**
 	 * Blits a surface onto one of the screen surfaces
 	 */
-	virtual void blitFrom(int surfaceNum, CVideoSurface *src, const Point *destPos,
+	virtual void blitFrom(SurfaceNum surfaceNum, CVideoSurface *src, const Point *destPos,
 		const Rect *srcRect = nullptr);
 
 	virtual void proc12();
@@ -185,7 +195,7 @@ public:
 	/**
 	 * Clear a portion of the screen surface
 	 */
-	virtual void clearSurface(int surfaceNum, Rect *bounds);
+	virtual void clearSurface(SurfaceNum surfaceNum, Rect *bounds);
 
 	/**
 	 * Resize the passed surface
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 3c31731..4d43199 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -87,7 +87,7 @@ void TitanicEngine::initialize() {
 
 	_debugger = new Debugger(this);
 	_events = new Events(this);
-	_screen = new Graphics::Screen();
+	_screen = new Graphics::Screen(0, 0);
 	_screenManager = new OSScreenManager(this);
 	_window = new CMainGameWindow(this);
 	_window->applicationStarting();


Commit: bfcf006bbbec047c973f2008711e005ffb40acff
    https://github.com/scummvm/scummvm/commit/bfcf006bbbec047c973f2008711e005ffb40acff
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-22T22:36:49-04:00

Commit Message:
TITANIC: Fixes for correct positioning of view background

Changed paths:
    engines/titanic/game_manager.cpp
    engines/titanic/game_view.cpp
    engines/titanic/rect.cpp
    engines/titanic/rect.h
    engines/titanic/screen_manager.cpp
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index d0c1ad5..23cb26e 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -239,7 +239,7 @@ void CGameManager::extendBounds(const Rect &r) {
 	if (_bounds.isEmpty())
 		_bounds = r;
 	else
-		_bounds.combine1(r);
+		_bounds.combine(r);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index e93e8f0..22da0c4 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -27,6 +27,9 @@
 
 namespace Titanic {
 
+#define VIEW_OFFSET_X 20
+#define VIEW_OFFSET_Y 10
+
 CGameView::CGameView() : _gameManager(nullptr), _surface(nullptr) {
 }
 
@@ -62,10 +65,10 @@ void CGameView::drawView() {
 	Rect srcRect = _gameManager->_bounds;
 
 	Rect rect2(0, 0, 600, 340);
-	rect2.translate(20, 10);
-	srcRect.combine2(rect2);
-	srcRect.translate(-20, -10);
+	rect2.translate(VIEW_OFFSET_X, VIEW_OFFSET_Y);
+	srcRect.constrain(rect2);
 	Common::Point destPos(srcRect.left, srcRect.top);
+	srcRect.translate(-VIEW_OFFSET_X, -VIEW_OFFSET_Y);
 
 	CScreenManager::_currentScreenManagerPtr->blitFrom(SURFACE_BACKBUFFER,
 		_surface, &destPos, &srcRect);
diff --git a/engines/titanic/rect.cpp b/engines/titanic/rect.cpp
index 4642b34..228a2ae 100644
--- a/engines/titanic/rect.cpp
+++ b/engines/titanic/rect.cpp
@@ -24,19 +24,19 @@
 
 namespace Titanic {
 
-void Rect::combine1(const Rect &r) {
+void Rect::combine(const Rect &r) {
 	if (isEmpty() || r.isEmpty())
 		return;
 
 	Common::Rect::extend(r);
 }
 
-void Rect::combine2(const Rect &r) {
+void Rect::constrain(const Rect &r) {
 	if (!isEmpty()) {
 		if (r.isEmpty()) {
 			clear();
 		} else {
-			Common::Rect::extend(r);
+			Common::Rect::clip(r);
 		}
 	}
 }
diff --git a/engines/titanic/rect.h b/engines/titanic/rect.h
index b70550a..1661711 100644
--- a/engines/titanic/rect.h
+++ b/engines/titanic/rect.h
@@ -48,12 +48,12 @@ public:
 	/**
 	 * Combine another rect into this one
 	 */
-	void combine1(const Rect &r);
+	void combine(const Rect &r);
 
 	/**
-	 * Combine another rect into this one
+	 * Constrains/clips to the intersection area of the given rect
 	 */
-	void combine2(const Rect &r);
+	void constrain(const Rect &r);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index f13ecdd..11063be 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -149,7 +149,7 @@ void OSScreenManager::blitFrom(SurfaceNum surfaceNum, CVideoSurface *src,
 		rect2 = srcBounds;
 		rect2.translate(-srcBounds.left, -srcBounds.top);
 		rect2.translate(destPoint.x, destPoint.y);
-		rect2.combine2(_backSurfaces[surfaceNum]._bounds);
+		rect2.constrain(_backSurfaces[surfaceNum]._bounds);
 
 		rect2.translate(-destPoint.x, -destPoint.y);
 		rect2.translate(srcBounds.left, srcBounds.top);
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index e833e1c..0b93529 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -59,12 +59,14 @@ void CVideoSurface::blitFrom(const Point &destPos, CVideoSurface *src, const Rec
 }
 
 void CVideoSurface::clipBounds(Rect &srcRect, Rect &destRect,
-		CVideoSurface *srcSurface, const Rect *subRect, const Point *pt) {
-	if (pt) {
-		srcRect.left = pt->x;
-		srcRect.top = pt->y;
+		CVideoSurface *srcSurface, const Rect *subRect, const Point *destPos) {
+	// Figure out initial source rect and dest rect, based on whether
+	// specific subRect and/or destPos have been passed
+	if (destPos) {
+		destRect.left = destPos->x;
+		destRect.top = destPos->y;
 	} else {
-		srcRect.left = srcRect.top = 0;
+		destRect.left = destRect.top = 0;
 	}
 
 	if (subRect) {
@@ -124,8 +126,7 @@ void CVideoSurface::blitRect1(const Rect &srcRect, const Rect &destRect, CVideoS
 	lock();
 
 	// TODO: Do it like the original does it
-//	this->_rawSurface->blitFrom(*src->_rawSurface, srcRect, Point(destRect.left, destRect.top));
-	this->_rawSurface->blitFrom(*src->_rawSurface);
+	_rawSurface->blitFrom(*src->_rawSurface, srcRect, Point(destRect.left, destRect.top));
 
 	src->unlock();
 	unlock();
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 39431f1..d89d320 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -44,8 +44,8 @@ private:
 	/**
 	 * Calculates blitting bounds
 	 */
-	void clipBounds(Rect &srcRect, Rect &destRect,
-		CVideoSurface *srcSurface, const Rect *subRect, const Point *pt);
+	void clipBounds(Rect &srcRect, Rect &destRect, CVideoSurface *srcSurface,
+		const Rect *subRect = nullptr, const Point *destPos = nullptr);
 
 	void blitRect1(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
 	void blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);


Commit: 42208769f7ac199f2b436164795f5ea7ac03fed4
    https://github.com/scummvm/scummvm/commit/42208769f7ac199f2b436164795f5ea7ac03fed4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-22T22:39:37-04:00

Commit Message:
TITANIC: Enable drawing of view contents

Changed paths:
    engines/titanic/main_game_window.cpp



diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index e1efae8..0b0bb92 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -129,7 +129,7 @@ void CMainGameWindow::draw() {
 				drawPet(scrManager);
 
 			drawView();
-//			drawViewContents(scrManager);
+			drawViewContents(scrManager);
 			scrManager->drawCursors();
 			break;
 


Commit: 7d2d624908e9265be108d650a161a378add9d40d
    https://github.com/scummvm/scummvm/commit/7d2d624908e9265be108d650a161a378add9d40d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-23T20:51:42-04:00

Commit Message:
TITANIC: More view event handling, beginnings of mouse cursor loading

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/link_item.cpp
    engines/titanic/core/link_item.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/view_item.cpp
    engines/titanic/core/view_item.h
    engines/titanic/files_manager.cpp
    engines/titanic/files_manager.h
    engines/titanic/input_translator.cpp
    engines/titanic/messages/messages.cpp
    engines/titanic/messages/mouse_messages.h
    engines/titanic/mouse_cursor.cpp
    engines/titanic/mouse_cursor.h
    engines/titanic/movie.cpp
    engines/titanic/movie.h
    engines/titanic/screen_manager.cpp
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 8f2b333..e4ad4cc 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -46,7 +46,7 @@ CGameObject::CGameObject(): CNamedItem() {
 	_field58 = 0;
 	_field5C = 1;
 	_field60 = 0;
-	_cursorId = 1;
+	_cursorId = CURSOR_1;
 	_field78 = 0;
 	_frameNumber = -1;
 	_field90 = 0;
@@ -77,7 +77,7 @@ void CGameObject::load(SimpleFile *file) {
 		// Deliberate fall-through
 
 	case 6:
-		val = _cursorId = file->readNumber();
+		_cursorId = (CursorId)file->readNumber();
 		// Deliberate fall-through
 
 	case 5:
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index b327671..66aa9c4 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_GAME_OBJECT_H
 #define TITANIC_GAME_OBJECT_H
 
+#include "titanic/mouse_cursor.h"
 #include "titanic/rect.h"
 #include "titanic/core/movie_clip.h"
 #include "titanic/core/named_item.h"
@@ -94,7 +95,7 @@ protected:
 	int _fieldB8;
 public:
 	int _field60;
-	int _cursorId;
+	CursorId _cursorId;
 public:
 	CLASSDEF
 	CGameObject();
diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp
index 02b4215..5ca64b1 100644
--- a/engines/titanic/core/link_item.cpp
+++ b/engines/titanic/core/link_item.cpp
@@ -32,7 +32,7 @@ CLinkItem::CLinkItem() : CNamedItem() {
 	_nodeNumber = -1;
 	_viewNumber = -1;
 	_field30 = 0;
-	_field34 = 1;
+	_cursorId = CURSOR_1;
 	_name = "Link";
 }
 
@@ -44,7 +44,7 @@ CString CLinkItem::formName() {
 void CLinkItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(2, indent);
 	file->writeQuotedLine("L", indent);
-	file->writeNumberLine(_field34, indent + 1);
+	file->writeNumberLine(_cursorId, indent + 1);
 	file->writeNumberLine(_field30, indent + 1);
 	file->writeNumberLine(_roomNumber, indent + 1);
 	file->writeNumberLine(_nodeNumber, indent + 1);
@@ -65,7 +65,7 @@ void CLinkItem::load(SimpleFile *file) {
 
 	switch (val) {
 	case 2:
-		_field34 = file->readNumber();
+		_cursorId = (CursorId)file->readNumber();
 		// Deliberate fall-through
 
 	case 1:
@@ -93,16 +93,16 @@ void CLinkItem::load(SimpleFile *file) {
 	if (val < 2) {
 		switch (_field30) {
 		case 2:
-			_field34 = 2;
+			_cursorId = CURSOR_2;
 			break;
 		case 3:
-			_field34 = 3;
+			_cursorId = CURSOR_3;
 			break;
 		case 5:
-			_field34 = 7;
+			_cursorId = CURSOR_7;
 			break;
 		default:
-			_field34 = 4;
+			_cursorId = CURSOR_4;
 			break;
 		}
 	}
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index bbeef2c..83b2ce4 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_LINK_ITEM_H
 #define TITANIC_LINK_ITEM_H
 
+#include "titanic/mouse_cursor.h"
 #include "titanic/core/named_item.h"
 #include "titanic/core/movie_clip.h"
 
@@ -44,9 +45,9 @@ protected:
 	int _nodeNumber;
 	int _viewNumber;
 	int _field30;
-	int _field34;
 public:
 	Rect _bounds;
+	CursorId _cursorId;
 public:
 	CLASSDEF
 	CLinkItem();
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 2c4eea5..1f7448f 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -818,7 +818,7 @@ DEFFN(CMouseMoveMsg)
 DEFFN(CMouseButtonMsg)
 DEFFN(CMouseButtonDownMsg)
 DEFFN(CMouseButtonUpMsg)
-DEFFN(CMouseButtonDoubleClickMsg)
+DEFFN(CMouseDoubleClickMsg)
 DEFFN(CMouseDragMsg)
 DEFFN(CMouseDragStartMsg)
 DEFFN(CMouseDragMoveMsg)
@@ -1395,7 +1395,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CMouseButtonMsg, CMouseMsg);
 	ADDFN(CMouseButtonDownMsg, CMouseButtonMsg);
 	ADDFN(CMouseButtonUpMsg, CMouseButtonMsg);
-	ADDFN(CMouseButtonDoubleClickMsg, CMouseButtonMsg);
+	ADDFN(CMouseDoubleClickMsg, CMouseButtonMsg);
 	ADDFN(CMouseDragMsg, CMouseMsg);
 	ADDFN(CMouseDragStartMsg, CMouseDragMsg);
 	ADDFN(CMouseDragMoveMsg, CMouseDragMsg);
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index c481666..1b9a1dd 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -180,7 +180,45 @@ bool CViewItem::handleEvent(CMouseButtonDownMsg &msg) {
 				}
 			}
 		}
-		// TODO
+	}
+
+	return true;
+}
+
+bool CViewItem::handleEvent(CMouseButtonUpMsg &msg) {
+	if (msg._buttons & MB_LEFT)
+		handleMouseMsg(&msg, false);
+
+	return true;
+}
+
+bool CViewItem::handleEvent(CMouseDoubleClickMsg &msg) {
+	if (msg._buttons & MB_LEFT)
+		handleMouseMsg(&msg, false);
+
+	return true;
+}
+
+bool CViewItem::handleEvent(CMouseMoveMsg &msg) {
+	CScreenManager *screenManager = CScreenManager::_screenManagerPtr;
+
+	if (handleMouseMsg(&msg, true)) {
+		screenManager->_mouseCursor->setCursor(CURSOR_1);
+	} else {
+		// Iterate through each link item, and if any is highlighted,
+		// change the mouse cursor to the designated cursor for the item
+		CLinkItem *linkItem = dynamic_cast<CLinkItem *>(getFirstChild());
+		while (linkItem) {
+			if (linkItem->_bounds.contains(msg._mousePos)) {
+				screenManager->_mouseCursor->setCursor(linkItem->_cursorId);
+				return true;
+			}
+
+			linkItem = dynamic_cast<CLinkItem *>(linkItem->getNextSibling());
+		}
+
+		if (!handleMouseMsg(&msg, false))
+			screenManager->_mouseCursor->setCursor(CURSOR_1);
 	}
 
 	return true;
@@ -212,8 +250,8 @@ bool CViewItem::handleMouseMsg(const CMouseMsg *msg, bool flag) {
 			return false;
 
 		for (int idx = (int)gameObjects.size() - 1; idx >= 0; ++idx) {
-			if (gameObjects[idx]->_cursorId != 12) {
-				CScreenManager::_screenManagerPtr->_mouseCursor->setCursorId(gameObjects[idx]->_cursorId);
+			if (gameObjects[idx]->_cursorId != CURSOR_12) {
+				CScreenManager::_screenManagerPtr->_mouseCursor->setCursor(gameObjects[idx]->_cursorId);
 				break;
 			}
 		}
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index b1de0bb..bc66122 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -29,7 +29,8 @@
 
 namespace Titanic {
 
-class CViewItem : public CNamedItem { //, CMouseButtonDownMsgTarget  {
+class CViewItem : public CNamedItem, CMouseButtonDownMsgTarget,
+	CMouseButtonUpMsgTarget, CMouseMoveMsgTarget, CMouseDoubleClickMsgTarget {
 private:
 	CTreeItem *_buttonUpTargets[4];
 private:
@@ -52,6 +53,9 @@ protected:
 	int _field54;
 protected:
 	virtual bool handleEvent(CMouseButtonDownMsg &msg);
+	virtual bool handleEvent(CMouseButtonUpMsg &msg);
+	virtual bool handleEvent(CMouseMoveMsg &msg);
+	virtual bool handleEvent(CMouseDoubleClickMsg &msg);
 public:
 	int _viewNumber;
 public:
diff --git a/engines/titanic/files_manager.cpp b/engines/titanic/files_manager.cpp
index f56c9c5..5db75cd 100644
--- a/engines/titanic/files_manager.cpp
+++ b/engines/titanic/files_manager.cpp
@@ -81,6 +81,10 @@ void CFilesManager::resetView() {
 	}
 }
 
+void CFilesManager::fn4(const CString &name) {
+	warning("TODO: CFilesManager::fn4");
+}
+
 void CFilesManager::fn5(const CString &name) {
 	warning("TODO: CFilesManager::fn5");
 }
diff --git a/engines/titanic/files_manager.h b/engines/titanic/files_manager.h
index 0785bfc..74895d7 100644
--- a/engines/titanic/files_manager.h
+++ b/engines/titanic/files_manager.h
@@ -77,6 +77,8 @@ public:
 	 */
 	void resetView();
 
+	void fn4(const CString &name);
+
 	void fn5(const CString &name);
 };
 
diff --git a/engines/titanic/input_translator.cpp b/engines/titanic/input_translator.cpp
index ceb2be8..2251c2f 100644
--- a/engines/titanic/input_translator.cpp
+++ b/engines/titanic/input_translator.cpp
@@ -60,7 +60,7 @@ void CInputTranslator::leftButtonUp(int special, const Point &pt) {
 }
 
 void CInputTranslator::leftButtonDoubleClick(int special, const Point &pt) {
-	CMouseButtonDoubleClickMsg msg(pt, getButtons(special));
+	CMouseDoubleClickMsg msg(pt, getButtons(special));
 	_inputHandler->handleMessage(msg);
 }
 
@@ -75,7 +75,7 @@ void CInputTranslator::middleButtonUp(int special, const Point &pt) {
 }
 
 void CInputTranslator::middleButtonDoubleClick(int special, const Point &pt) {
-	CMouseButtonDoubleClickMsg msg(pt, getButtons(special));
+	CMouseDoubleClickMsg msg(pt, getButtons(special));
 	_inputHandler->handleMessage(msg);
 }
 
@@ -90,7 +90,7 @@ void CInputTranslator::rightButtonUp(int special, const Point &pt) {
 }
 
 void CInputTranslator::rightButtonDoubleClick(int special, const Point &pt) {
-	CMouseButtonDoubleClickMsg msg(pt, getButtons(special));
+	CMouseDoubleClickMsg msg(pt, getButtons(special));
 	_inputHandler->handleMessage(msg);
 }
 
diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
index b44748d..9202305 100644
--- a/engines/titanic/messages/messages.cpp
+++ b/engines/titanic/messages/messages.cpp
@@ -84,7 +84,7 @@ bool CMessage::isMouseMoveMsg() const {
 }
 
 bool CMessage::isDoubleClickMsg() const {
-	return dynamic_cast<const CMouseButtonDoubleClickMsg *>(this) != nullptr;
+	return dynamic_cast<const CMouseDoubleClickMsg *>(this) != nullptr;
 }
 
 bool CMessage::isEnterRoomMsg() const {
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 77343fa..6e2a74a 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -108,19 +108,19 @@ public:
 	}
 };
 
-MSGTARGET(CMouseButtonDoubleClickMsg);
-class CMouseButtonDoubleClickMsg : public CMouseButtonMsg {
+MSGTARGET(CMouseDoubleClickMsg);
+class CMouseDoubleClickMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
-	CMouseButtonDoubleClickMsg() : CMouseButtonMsg() {}
-	CMouseButtonDoubleClickMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
+	CMouseDoubleClickMsg() : CMouseButtonMsg() {}
+	CMouseDoubleClickMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseButtonDoubleClickMsg *>(item) != nullptr;
+		return dynamic_cast<const CMouseDoubleClickMsg *>(item) != nullptr;
 	}
-	virtual bool handleMessage(const CMouseButtonDoubleClickMsg &msg) { return false; }
+	virtual bool handleMessage(const CMouseDoubleClickMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
-		CMouseButtonDoubleClickMsg *dest = dynamic_cast<CMouseButtonDoubleClickMsg *>(treeItem);
+		CMouseDoubleClickMsg *dest = dynamic_cast<CMouseDoubleClickMsg *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
 };
diff --git a/engines/titanic/mouse_cursor.cpp b/engines/titanic/mouse_cursor.cpp
index 578bf99..54c9ce8 100644
--- a/engines/titanic/mouse_cursor.cpp
+++ b/engines/titanic/mouse_cursor.cpp
@@ -20,25 +20,80 @@
  *
  */
 
+#include "graphics/cursorman.h"
 #include "common/textconsole.h"
 #include "titanic/mouse_cursor.h"
+#include "titanic/movie.h"
+#include "titanic/screen_manager.h"
+#include "titanic/titanic.h"
+#include "titanic/video_surface.h"
+#include "titanic/core/resource_key.h"
 
 namespace Titanic {
 
+static const int CURSOR_DATA[NUM_CURSORS][4] = {
+	{ 1, 136, 19, 18 },
+	{ 2, 139, 1, 1 },
+	{ 3, 140, 32, 1 },
+	{ 4, 137, 13, 0 },
+	{ 5, 145, 13, 0 },
+	{ 6, 144, 13, 22 },
+	{ 7, 137, 14, 0 },
+	{ 8, 148, 22, 40 },
+	{ 9, 136, 19, 18 },
+	{ 10, 143, 11, 11 },
+	{ 11, 146, 11, 11 },
+	{ 12, 136, 19, 18 },
+	{ 13, 136, 19, 25 },
+	{ 14, 136, 13, 22 },
+	{ 15, 138, 20, 28 }
+};
+
+CMouseCursor::CMouseCursor(CScreenManager *screenManager) : 
+		_screenManager(screenManager), _cursorId(CURSOR_1) {
+	loadCursorImages();
+}
+
+CMouseCursor::~CMouseCursor() {
+	for (int idx = 0; idx < NUM_CURSORS; ++idx)
+		delete _cursors[idx]._videoSurface;
+}
+
+void CMouseCursor::loadCursorImages() {
+	const CString name("ycursors.avi");
+	const CResourceKey key(name);
+	g_vm->_filesManager.fn4(name);
+
+	// Iterate through each cursor
+	for (int idx = 0; idx < NUM_CURSORS; ++idx) {
+		assert(CURSOR_DATA[idx][0] == (idx + 1));
+		_cursors[idx]._centroid = Common::Point(CURSOR_DATA[idx][2],
+			CURSOR_DATA[idx][3]);
+
+		CVideoSurface *surface = _screenManager->createSurface(64, 64);
+		_cursors[idx]._videoSurface = surface;
+
+		OSMovie movie(key, surface);
+		movie.setFrame(idx);
+		_cursors[idx]._ptrUnknown = movie.proc21();
+		surface->set40(_cursors[idx]._ptrUnknown);
+	}
+}
+
 void CMouseCursor::show() {
-	warning("CMouseCursor::show");
+	CursorMan.showMouse(true);
 }
 
 void CMouseCursor::hide() {
-	warning("CMouseCursor::hide");
+	CursorMan.showMouse(false);
 }
 
-void CMouseCursor::setCursorId(int id) {
-	warning("CMouseCursor::setCursorId");
+void CMouseCursor::setCursor(CursorId cursorId) {
+	warning("CMouseCursor::setCursor");
 }
 
 void CMouseCursor::update() {
-	warning("CMouseCursor::update");
+	// No implementation needed
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/mouse_cursor.h b/engines/titanic/mouse_cursor.h
index c6df65d..507f4ec 100644
--- a/engines/titanic/mouse_cursor.h
+++ b/engines/titanic/mouse_cursor.h
@@ -24,14 +24,66 @@
 #define TITANIC_MOUSE_CURSOR_H
 
 #include "common/scummsys.h"
+#include "common/rect.h"
 
 namespace Titanic {
 
+#define NUM_CURSORS 15
+
+enum CursorId {
+	CURSOR_1 = 1,
+	CURSOR_2 = 3,
+	CURSOR_3 = 3,
+	CURSOR_4 = 4,
+	CURSOR_5 = 5,
+	CURSOR_6 = 6,
+	CURSOR_7 = 7,
+	CURSOR_8 = 8,
+	CURSOR_9 = 9,
+	CURSOR_10 = 10,
+	CURSOR_11 = 11,
+	CURSOR_12 = 12,
+	CURSOR_13 = 13,
+	CURSOR_14 = 14,
+	CURSOR_15 = 15
+};
+
+class CScreenManager;
+class CVideoSurface;
+
 class CMouseCursor {
+	struct CursorEntry {
+		CVideoSurface *_videoSurface;
+		void *_ptrUnknown;
+		Common::Point _centroid;
+	};
+private:
+	CScreenManager *_screenManager;
+	CursorId _cursorId;
+	CursorEntry _cursors[NUM_CURSORS];
+
+	/**
+	 * Load the images for each cursor
+	 */
+	void loadCursorImages();
 public:
+	CMouseCursor(CScreenManager *screenManager);
+	~CMouseCursor();
+
+	/**
+	 * Make the mouse cursor visible
+	 */
 	void show();
+
+	/**
+	 * Hide the mouse cursor
+	 */
 	void hide();
-	void setCursorId(int id);
+	
+	/**
+	 * Set the cursor
+	 */
+	void setCursor(CursorId cursorId);
 	
 	/**
 	 * Updates the mouse cursor
diff --git a/engines/titanic/movie.cpp b/engines/titanic/movie.cpp
index 1eaeac6..a41f0f4 100644
--- a/engines/titanic/movie.cpp
+++ b/engines/titanic/movie.cpp
@@ -24,5 +24,69 @@
 
 namespace Titanic {
 
+OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) {
+
+}
+
+void OSMovie::proc8() {
+	warning("TODO: OSMovie::proc8");
+}
+
+void OSMovie::proc9() {
+	warning("TODO: OSMovie::proc9");
+}
+
+void OSMovie::proc10() {
+	warning("TODO: OSMovie::proc10");
+}
+
+void OSMovie::proc11() {
+	warning("TODO: OSMovie::proc11");
+}
+
+void OSMovie::proc12() {
+	warning("TODO: OSMovie::proc12");
+}
+
+void OSMovie::proc13() {
+	warning("TODO: OSMovie::proc13");
+}
+
+void OSMovie::proc14() {
+	warning("TODO: OSMovie::proc14");
+}
+
+void OSMovie::proc15() {
+	warning("TODO: OSMovie::proc15");
+}
+
+void OSMovie::proc16() {
+	warning("TODO: OSMovie::proc16");
+}
+
+void OSMovie::proc17() {
+	warning("TODO: OSMovie::proc17");
+}
+
+void OSMovie::proc18() {
+	warning("TODO: OSMovie::proc18");
+}
+
+void OSMovie::proc19() {
+	warning("TODO: OSMovie::proc19");
+}
+
+void OSMovie::proc20() {
+	warning("TODO: OSMovie::proc20");
+}
+
+void *OSMovie::proc21() {
+	warning("TODO: OSMovie::proc21");
+	return nullptr;
+}
+
+void OSMovie::setFrame(uint frameNumber) {
+
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/movie.h b/engines/titanic/movie.h
index a213b7b..1430e24 100644
--- a/engines/titanic/movie.h
+++ b/engines/titanic/movie.h
@@ -24,11 +24,52 @@
 #define TITANIC_MOVIE_H
 
 #include "titanic/core/list.h"
+#include "titanic/core/resource_key.h"
+#include "titanic/video_surface.h"
 
 namespace Titanic {
 
 class CMovie : public ListItem {
 public:
+	virtual void proc8() = 0;
+	virtual void proc9() = 0;
+	virtual void proc10() = 0;
+	virtual void proc11() = 0;
+	virtual void proc12() = 0;
+	virtual void proc13() = 0;
+	virtual void proc14() = 0;
+	virtual void proc15() = 0;
+	virtual void proc16() = 0;
+	virtual void proc17() = 0;
+	virtual void proc18() = 0;
+	virtual void proc19() = 0;
+	virtual void proc20() = 0;
+	virtual void *proc21() = 0;
+};
+
+class OSMovie : public CMovie {
+public:
+	OSMovie(const CResourceKey &name, CVideoSurface *surface);
+
+	virtual void proc8();
+	virtual void proc9();
+	virtual void proc10();
+	virtual void proc11();
+	virtual void proc12();
+	virtual void proc13();
+	virtual void proc14();
+	virtual void proc15();
+	virtual void proc16();
+	virtual void proc17();
+	virtual void proc18();
+	virtual void proc19();
+	virtual void proc20();
+	virtual void *proc21();
+
+	/**
+	 * Set the current frame number
+	 */
+	void setFrame(uint frameNumber);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 11063be..5e38eca 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -222,7 +222,7 @@ void OSScreenManager::loadCursors() {
 		hideCursor();
 		delete _mouseCursor;
 	}
-	_mouseCursor = new CMouseCursor();
+	_mouseCursor = new CMouseCursor(this);
 	showCursor();
 
 	if (!_textCursor) {
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 0b93529..ef8d7a8 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -31,7 +31,7 @@ int CVideoSurface::_videoSurfaceCounter = 0;
 CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
 		_screenManager(screenManager), _rawSurface(nullptr), _field34(nullptr),
 		_pendingLoad(false), _blitStyleFlag(false), _blitFlag(false),
-		_field40(0), _field44(4), _field48(0), _field50(1) {
+		_field40(nullptr), _field44(4), _field48(0), _field50(1) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
 }
 
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index d89d320..8d0b312 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -58,7 +58,7 @@ protected:
 	Graphics::ManagedSurface *_rawSurface;
 	void *_field34;
 	bool _pendingLoad;
-	int _field40;
+	void *_field40;
 	int _field44;
 	int _field48;
 	int _videoSurfaceNum;
@@ -157,6 +157,8 @@ public:
 	 * Blit from another surface
 	 */
 	void blitFrom(const Point &destPos, CVideoSurface *src, const Rect *srcRect = nullptr);
+
+	void set40(void *v) { _field40 = v; }
 };
 
 class OSVideoSurface : public CVideoSurface {


Commit: 2f532c086d5cd466a54763fc4fee14d0940e0abb
    https://github.com/scummvm/scummvm/commit/2f532c086d5cd466a54763fc4fee14d0940e0abb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-23T21:41:36-04:00

Commit Message:
TITANIC: Unsuccessful initial attempt to load ycursors.avi file

Unfortunately, whilst the cursors video plays fine in standard video
players, the ScummVM AVIDecoder can't seem to handle it. So for now
I've left the decode in place but commented out, and I'm setting up
a dummy cursor

Changed paths:
    engines/titanic/mouse_cursor.cpp
    engines/titanic/movie.cpp
    engines/titanic/movie.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/mouse_cursor.cpp b/engines/titanic/mouse_cursor.cpp
index 54c9ce8..3acd871 100644
--- a/engines/titanic/mouse_cursor.cpp
+++ b/engines/titanic/mouse_cursor.cpp
@@ -50,8 +50,9 @@ static const int CURSOR_DATA[NUM_CURSORS][4] = {
 };
 
 CMouseCursor::CMouseCursor(CScreenManager *screenManager) : 
-		_screenManager(screenManager), _cursorId(CURSOR_1) {
+		_screenManager(screenManager), _cursorId(CURSOR_15) {
 	loadCursorImages();
+	setCursor(CURSOR_1);
 }
 
 CMouseCursor::~CMouseCursor() {
@@ -89,7 +90,20 @@ void CMouseCursor::hide() {
 }
 
 void CMouseCursor::setCursor(CursorId cursorId) {
-	warning("CMouseCursor::setCursor");
+	if (cursorId != _cursorId) {
+		CursorEntry &ce = _cursors[cursorId - 1];
+		CVideoSurface &surface = *ce._videoSurface;
+		surface.lock();
+
+		// ***DEBUG*** Dummy cursor
+		Common::fill(surface.getPixels(), surface.getPixels() + 128, 0x5555);
+
+		CursorMan.replaceCursor(surface.getPixels(), surface.getWidth(), surface.getHeight(),
+			ce._centroid.x, ce._centroid.y, 0, false, &g_vm->_screen->format);
+		surface.unlock();
+
+		_cursorId = cursorId;
+	}
 }
 
 void CMouseCursor::update() {
diff --git a/engines/titanic/movie.cpp b/engines/titanic/movie.cpp
index a41f0f4..d7a54d3 100644
--- a/engines/titanic/movie.cpp
+++ b/engines/titanic/movie.cpp
@@ -24,8 +24,8 @@
 
 namespace Titanic {
 
-OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) {
-
+OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) : _videoSurface(surface) {
+//	_aviDecoder.loadFile(name.getString());
 }
 
 void OSMovie::proc8() {
@@ -86,7 +86,12 @@ void *OSMovie::proc21() {
 }
 
 void OSMovie::setFrame(uint frameNumber) {
-
+	/*
+	_aviDecoder.seekToFrame(frameNumber);
+	const Graphics::Surface *s = _aviDecoder.decodeNextFrame();
+	
+	_videoSurface->blitFrom(Common::Point(0, 0), s);
+	*/
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/movie.h b/engines/titanic/movie.h
index 1430e24..5285508 100644
--- a/engines/titanic/movie.h
+++ b/engines/titanic/movie.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_MOVIE_H
 #define TITANIC_MOVIE_H
 
+#include "video/avi_decoder.h"
 #include "titanic/core/list.h"
 #include "titanic/core/resource_key.h"
 #include "titanic/video_surface.h"
@@ -48,6 +49,9 @@ public:
 };
 
 class OSMovie : public CMovie {
+private:
+	Video::AVIDecoder _aviDecoder;
+	CVideoSurface *_videoSurface;
 public:
 	OSMovie(const CResourceKey &name, CVideoSurface *surface);
 
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index ef8d7a8..5cab6d1 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -58,6 +58,12 @@ void CVideoSurface::blitFrom(const Point &destPos, CVideoSurface *src, const Rec
 	}
 }
 
+void CVideoSurface::blitFrom(const Point &destPos, const Graphics::Surface *src) {
+	lock();
+	_rawSurface->blitFrom(*src, destPos);
+	unlock();
+}
+
 void CVideoSurface::clipBounds(Rect &srcRect, Rect &destRect,
 		CVideoSurface *srcSurface, const Rect *subRect, const Point *destPos) {
 	// Figure out initial source rect and dest rect, based on whether
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 8d0b312..c6ecf1a 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -158,7 +158,14 @@ public:
 	 */
 	void blitFrom(const Point &destPos, CVideoSurface *src, const Rect *srcRect = nullptr);
 
+	/**
+	 * Blit from another surface
+	 */
+	void blitFrom(const Point &destPos, const Graphics::Surface *src);
+
 	void set40(void *v) { _field40 = v; }
+
+	uint16 *getPixels() { return (uint16 *)_rawSurface->getPixels(); }
 };
 
 class OSVideoSurface : public CVideoSurface {


Commit: 66e198d665a8aacd1724848a40e6533f3d5cfebc
    https://github.com/scummvm/scummvm/commit/66e198d665a8aacd1724848a40e6533f3d5cfebc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-24T07:49:59-04:00

Commit Message:
TITANIC: Cleanup and fixes for message hierarchy

Changed paths:
    engines/titanic/core/view_item.cpp
    engines/titanic/core/view_item.h
    engines/titanic/game/arboretum_gate.cpp
    engines/titanic/game/arboretum_gate.h
    engines/titanic/game/auto_animate.cpp
    engines/titanic/game/auto_animate.h
    engines/titanic/game/bar_bell.cpp
    engines/titanic/game/bar_bell.h
    engines/titanic/game/bomb.cpp
    engines/titanic/game/bomb.h
    engines/titanic/game/chicken_cooler.cpp
    engines/titanic/game/chicken_cooler.h
    engines/titanic/game/doorbot_elevator_handler.cpp
    engines/titanic/game/doorbot_elevator_handler.h
    engines/titanic/game/end_sequence_control.cpp
    engines/titanic/game/end_sequence_control.h
    engines/titanic/game/fan_noises.cpp
    engines/titanic/game/fan_noises.h
    engines/titanic/game/get_lift_eye2.cpp
    engines/titanic/game/get_lift_eye2.h
    engines/titanic/game/gondolier/gondolier_mixer.cpp
    engines/titanic/game/gondolier/gondolier_mixer.h
    engines/titanic/game/light.cpp
    engines/titanic/game/light.h
    engines/titanic/game/light_switch.cpp
    engines/titanic/game/light_switch.h
    engines/titanic/game/long_stick_dispenser.cpp
    engines/titanic/game/long_stick_dispenser.h
    engines/titanic/game/parrot/player_meets_parrot.cpp
    engines/titanic/game/parrot/player_meets_parrot.h
    engines/titanic/game/pet/pet_monitor.cpp
    engines/titanic/game/pet/pet_monitor.h
    engines/titanic/game/pet/pet_position.cpp
    engines/titanic/game/pet/pet_position.h
    engines/titanic/game/pet/pet_transport.cpp
    engines/titanic/game/pet/pet_transport.h
    engines/titanic/game/phonograph.cpp
    engines/titanic/game/phonograph.h
    engines/titanic/game/sgt/sgt_state_room.cpp
    engines/titanic/game/sgt/sgt_state_room.h
    engines/titanic/game/ship_setting.cpp
    engines/titanic/game/ship_setting.h
    engines/titanic/game/transport/lift.cpp
    engines/titanic/game/transport/lift.h
    engines/titanic/game/transport/lift_indicator.h
    engines/titanic/game/transport/pellerator.cpp
    engines/titanic/game/transport/pellerator.h
    engines/titanic/game/up_lighter.cpp
    engines/titanic/game/up_lighter.h
    engines/titanic/game/volume_control.cpp
    engines/titanic/game/volume_control.h
    engines/titanic/input_handler.cpp
    engines/titanic/input_handler.h
    engines/titanic/messages/bilge_dispensor_event.cpp
    engines/titanic/messages/bilge_dispensor_event.h
    engines/titanic/messages/messages.cpp
    engines/titanic/messages/messages.h
    engines/titanic/messages/mouse_messages.h
    engines/titanic/moves/enter_bridge.cpp
    engines/titanic/moves/enter_bridge.h
    engines/titanic/npcs/barbot.cpp
    engines/titanic/npcs/barbot.h
    engines/titanic/npcs/liftbot.cpp
    engines/titanic/npcs/liftbot.h
    engines/titanic/sound/auto_music_player.cpp
    engines/titanic/sound/auto_music_player.h
    engines/titanic/sound/music_player.cpp
    engines/titanic/sound/music_player.h
    engines/titanic/sound/node_auto_sound_player.cpp
    engines/titanic/sound/node_auto_sound_player.h
    engines/titanic/sound/restricted_auto_music_player.cpp
    engines/titanic/sound/restricted_auto_music_player.h
    engines/titanic/sound/room_auto_sound_player.cpp
    engines/titanic/sound/room_auto_sound_player.h
    engines/titanic/sound/room_trigger_auto_music_player.cpp
    engines/titanic/sound/room_trigger_auto_music_player.h
    engines/titanic/sound/titania_speech.cpp
    engines/titanic/sound/titania_speech.h



diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 1b9a1dd..414cf30 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -160,7 +160,7 @@ void CViewItem::enterView(CViewItem *newView) {
 	}
 }
 
-bool CViewItem::handleEvent(CMouseButtonDownMsg &msg) {
+bool CViewItem::handleMessage(CMouseButtonDownMsg &msg) {
 	if (msg._buttons & MB_LEFT) {
 		if (!handleMouseMsg(&msg, true)) {
 			CGameManager *gm = getGameManager();
@@ -185,21 +185,21 @@ bool CViewItem::handleEvent(CMouseButtonDownMsg &msg) {
 	return true;
 }
 
-bool CViewItem::handleEvent(CMouseButtonUpMsg &msg) {
+bool CViewItem::handleMessage(CMouseButtonUpMsg &msg) {
 	if (msg._buttons & MB_LEFT)
 		handleMouseMsg(&msg, false);
 
 	return true;
 }
 
-bool CViewItem::handleEvent(CMouseDoubleClickMsg &msg) {
+bool CViewItem::handleMessage(CMouseDoubleClickMsg &msg) {
 	if (msg._buttons & MB_LEFT)
 		handleMouseMsg(&msg, false);
 
 	return true;
 }
 
-bool CViewItem::handleEvent(CMouseMoveMsg &msg) {
+bool CViewItem::handleMessage(CMouseMoveMsg &msg) {
 	CScreenManager *screenManager = CScreenManager::_screenManagerPtr;
 
 	if (handleMouseMsg(&msg, true)) {
@@ -224,8 +224,8 @@ bool CViewItem::handleEvent(CMouseMoveMsg &msg) {
 	return true;
 }
 
-bool CViewItem::handleMouseMsg(const CMouseMsg *msg, bool flag) {
-	const CMouseButtonUpMsg *upMsg = dynamic_cast<const CMouseButtonUpMsg *>(msg);
+bool CViewItem::handleMouseMsg(CMouseMsg *msg, bool flag) {
+	CMouseButtonUpMsg *upMsg = dynamic_cast<CMouseButtonUpMsg *>(msg);
 	if (msg->isButtonUpMsg()) {
 		handleButtonUpMsg(upMsg);
 		return true;
@@ -272,7 +272,7 @@ bool CViewItem::handleMouseMsg(const CMouseMsg *msg, bool flag) {
 	return result;
 }
 
-void CViewItem::handleButtonUpMsg(const CMouseButtonUpMsg *msg) {
+void CViewItem::handleButtonUpMsg(CMouseButtonUpMsg *msg) {
 	CTreeItem *&target = _buttonUpTargets[msg->_buttons >> 1];
 
 	if (target) {
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index bc66122..3b071e5 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -39,12 +39,12 @@ private:
 	/**
 	 * Called to handle mouse messagaes on the view
 	 */
-	bool handleMouseMsg(const CMouseMsg *msg, bool flag);
+	bool handleMouseMsg(CMouseMsg *msg, bool flag);
 
 	/**
 	 * Handles mouse button up messages
 	 */
-	void handleButtonUpMsg(const CMouseButtonUpMsg *msg);
+	void handleButtonUpMsg(CMouseButtonUpMsg *msg);
 protected:
 	int _field24;
 	double _field28;
@@ -52,10 +52,10 @@ protected:
 	int _field50;
 	int _field54;
 protected:
-	virtual bool handleEvent(CMouseButtonDownMsg &msg);
-	virtual bool handleEvent(CMouseButtonUpMsg &msg);
-	virtual bool handleEvent(CMouseMoveMsg &msg);
-	virtual bool handleEvent(CMouseDoubleClickMsg &msg);
+	virtual bool handleMessage(CMouseButtonDownMsg &msg);
+	virtual bool handleMessage(CMouseButtonUpMsg &msg);
+	virtual bool handleMessage(CMouseMoveMsg &msg);
+	virtual bool handleMessage(CMouseDoubleClickMsg &msg);
 public:
 	int _viewNumber;
 public:
diff --git a/engines/titanic/game/arboretum_gate.cpp b/engines/titanic/game/arboretum_gate.cpp
index a892e65..6770430 100644
--- a/engines/titanic/game/arboretum_gate.cpp
+++ b/engines/titanic/game/arboretum_gate.cpp
@@ -133,17 +133,17 @@ void CArboretumGate::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CArboretumGate::handleEvent(CActMsg &msg) { return false; }
-bool CArboretumGate::handleEvent(CLeaveViewMsg &msg) { return false; }
-bool CArboretumGate::handleEvent(CTurnOff &msg) { return false; }
-bool CArboretumGate::handleEvent(CMouseButtonDownMsg &msg) { return false; }
+bool CArboretumGate::handleMessage(CActMsg &msg) { return false; }
+bool CArboretumGate::handleMessage(CLeaveViewMsg &msg) { return false; }
+bool CArboretumGate::handleMessage(CTurnOff &msg) { return false; }
+bool CArboretumGate::handleMessage(CMouseButtonDownMsg &msg) { return false; }
 
-bool CArboretumGate::handleEvent(CEnterViewMsg &msg) {
+bool CArboretumGate::handleMessage(CEnterViewMsg &msg) {
 	warning("CArboretumGate::handleEvent");
 	return false;
 }
 
-bool CArboretumGate::handleEvent(CTurnOn &msg) { return false; }
-bool CArboretumGate::handleEvent(CMovieEndMsg &msg) { return false; }
+bool CArboretumGate::handleMessage(CTurnOn &msg) { return false; }
+bool CArboretumGate::handleMessage(CMovieEndMsg &msg) { return false; }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
index 7432799..34569a0 100644
--- a/engines/titanic/game/arboretum_gate.h
+++ b/engines/titanic/game/arboretum_gate.h
@@ -69,13 +69,13 @@ private:
 	int _field150;
 	CString _string2;
 protected:
-	virtual bool handleEvent(CActMsg &msg);
-	virtual bool handleEvent(CLeaveViewMsg &msg);	
-	virtual bool handleEvent(CTurnOff &msg);
-	virtual bool handleEvent(CMouseButtonDownMsg &msg);
-	virtual bool handleEvent(CEnterViewMsg &msg);
-	virtual bool handleEvent(CTurnOn &msg);
-	virtual bool handleEvent(CMovieEndMsg &msg);
+	virtual bool handleMessage(CActMsg &msg);
+	virtual bool handleMessage(CLeaveViewMsg &msg);	
+	virtual bool handleMessage(CTurnOff &msg);
+	virtual bool handleMessage(CMouseButtonDownMsg &msg);
+	virtual bool handleMessage(CEnterViewMsg &msg);
+	virtual bool handleMessage(CTurnOn &msg);
+	virtual bool handleMessage(CMovieEndMsg &msg);
 public:
 	CLASSDEF
 	CArboretumGate();
diff --git a/engines/titanic/game/auto_animate.cpp b/engines/titanic/game/auto_animate.cpp
index 958200f..2a3f371 100644
--- a/engines/titanic/game/auto_animate.cpp
+++ b/engines/titanic/game/auto_animate.cpp
@@ -40,7 +40,7 @@ void CAutoAnimate::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CAutoAnimate::handleEvent(CEnterViewMsg &msg) {
+bool CAutoAnimate::handleMessage(CEnterViewMsg &msg) {
 	warning("CAutoAnimate::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/auto_animate.h b/engines/titanic/game/auto_animate.h
index 56e40a4..6fb8511 100644
--- a/engines/titanic/game/auto_animate.h
+++ b/engines/titanic/game/auto_animate.h
@@ -34,7 +34,7 @@ private:
 	int _fieldE4;
 	int _fieldE8;
 protected:
-	virtual bool handleEvent(CEnterViewMsg &msg);
+	virtual bool handleMessage(CEnterViewMsg &msg);
 public:
 	CLASSDEF
 	CAutoAnimate() : CBackground(), _fieldE0(1), _fieldE4(1), _fieldE8(0) {}
diff --git a/engines/titanic/game/bar_bell.cpp b/engines/titanic/game/bar_bell.cpp
index 1ac7568..84a4d04 100644
--- a/engines/titanic/game/bar_bell.cpp
+++ b/engines/titanic/game/bar_bell.cpp
@@ -50,7 +50,7 @@ void CBarBell::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CBarBell::handleEvent(CEnterRoomMsg &msg) {
+bool CBarBell::handleMessage(CEnterRoomMsg &msg) {
 	_fieldBC = 0;
 	return true;
 }
diff --git a/engines/titanic/game/bar_bell.h b/engines/titanic/game/bar_bell.h
index 111b0ac..30d7195 100644
--- a/engines/titanic/game/bar_bell.h
+++ b/engines/titanic/game/bar_bell.h
@@ -36,7 +36,7 @@ public:
 	int _fieldC8;
 	int _fieldCC;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CBarBell();
diff --git a/engines/titanic/game/bomb.cpp b/engines/titanic/game/bomb.cpp
index a8bf15e..390ac2c 100644
--- a/engines/titanic/game/bomb.cpp
+++ b/engines/titanic/game/bomb.cpp
@@ -70,7 +70,7 @@ void CBomb::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CBomb::handleEvent(CEnterRoomMsg &msg) {
+bool CBomb::handleMessage(CEnterRoomMsg &msg) {
 	_fieldE8 = 12;
 	_fieldEC = 9;
 	_fieldF0 = 0;
diff --git a/engines/titanic/game/bomb.h b/engines/titanic/game/bomb.h
index 9cbdf84..8e9dcdf 100644
--- a/engines/titanic/game/bomb.h
+++ b/engines/titanic/game/bomb.h
@@ -41,7 +41,7 @@ private:
 	int _startingTicks;
 	int _field104;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CBomb();
diff --git a/engines/titanic/game/chicken_cooler.cpp b/engines/titanic/game/chicken_cooler.cpp
index 4ece0d6..ff7aae7 100644
--- a/engines/titanic/game/chicken_cooler.cpp
+++ b/engines/titanic/game/chicken_cooler.cpp
@@ -40,7 +40,7 @@ void CChickenCooler::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CChickenCooler::handleEvent(CEnterRoomMsg &msg) {
+bool CChickenCooler::handleMessage(CEnterRoomMsg &msg) {
 	warning("CChickenCoolor::handlEvent");
 	return true;
 }
diff --git a/engines/titanic/game/chicken_cooler.h b/engines/titanic/game/chicken_cooler.h
index 210183a..176c8c9 100644
--- a/engines/titanic/game/chicken_cooler.h
+++ b/engines/titanic/game/chicken_cooler.h
@@ -33,7 +33,7 @@ private:
 	int _fieldBC;
 	int _fieldC0;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CChickenCooler() : CGameObject(), _fieldBC(0), _fieldC0(0) {}
diff --git a/engines/titanic/game/doorbot_elevator_handler.cpp b/engines/titanic/game/doorbot_elevator_handler.cpp
index 718a464..257b663 100644
--- a/engines/titanic/game/doorbot_elevator_handler.cpp
+++ b/engines/titanic/game/doorbot_elevator_handler.cpp
@@ -40,7 +40,7 @@ void CDoorbotElevatorHandler::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CDoorbotElevatorHandler::handleEvent(CEnterNodeMsg &msg) {
+bool CDoorbotElevatorHandler::handleMessage(CEnterNodeMsg &msg) {
 	warning("CDoorbotElevatorHandler::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/doorbot_elevator_handler.h b/engines/titanic/game/doorbot_elevator_handler.h
index 04f3a75..d6c5be9 100644
--- a/engines/titanic/game/doorbot_elevator_handler.h
+++ b/engines/titanic/game/doorbot_elevator_handler.h
@@ -33,7 +33,7 @@ private:
 	static int _v1;
 	int _value;
 protected:
-	virtual bool handleEvent(CEnterNodeMsg &msg);
+	virtual bool handleMessage(CEnterNodeMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/end_sequence_control.cpp b/engines/titanic/game/end_sequence_control.cpp
index c3f5a2a..41bbc9d 100644
--- a/engines/titanic/game/end_sequence_control.cpp
+++ b/engines/titanic/game/end_sequence_control.cpp
@@ -34,7 +34,7 @@ void CEndSequenceControl::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CEndSequenceControl::handleEvent(CEnterRoomMsg &msg) {
+bool CEndSequenceControl::handleMessage(CEnterRoomMsg &msg) {
 	warning("TODO: CEndSequenceControl::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/end_sequence_control.h b/engines/titanic/game/end_sequence_control.h
index d0ddd9c..5eb3694 100644
--- a/engines/titanic/game/end_sequence_control.h
+++ b/engines/titanic/game/end_sequence_control.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CEndSequenceControl : public CGameObject, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/fan_noises.cpp b/engines/titanic/game/fan_noises.cpp
index 7ec55c4..d7dd4e2 100644
--- a/engines/titanic/game/fan_noises.cpp
+++ b/engines/titanic/game/fan_noises.cpp
@@ -55,7 +55,7 @@ void CFanNoises::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CFanNoises::handleEvent(CEnterRoomMsg &msg) {
+bool CFanNoises::handleMessage(CEnterRoomMsg &msg) {
 	warning("CFanNoises::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/fan_noises.h b/engines/titanic/game/fan_noises.h
index 835d853..6daf802 100644
--- a/engines/titanic/game/fan_noises.h
+++ b/engines/titanic/game/fan_noises.h
@@ -38,7 +38,7 @@ private:
 	int _fieldD0;
 	int _fieldD4;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CFanNoises();
diff --git a/engines/titanic/game/get_lift_eye2.cpp b/engines/titanic/game/get_lift_eye2.cpp
index 7894c5e..5f3fac3 100644
--- a/engines/titanic/game/get_lift_eye2.cpp
+++ b/engines/titanic/game/get_lift_eye2.cpp
@@ -46,7 +46,7 @@ void CGetLiftEye2::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CGetLiftEye2::handleEvent(CEnterRoomMsg &msg) {
+bool CGetLiftEye2::handleMessage(CEnterRoomMsg &msg) {
 	warning("CGetLiftEye2::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
index 5803ad0..8ce181f 100644
--- a/engines/titanic/game/get_lift_eye2.h
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -31,7 +31,7 @@ class CGetLiftEye2 : public CGameObject, CEnterRoomMsgTarget {
 private:
 	static CString *_v1;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	static void init();
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.cpp b/engines/titanic/game/gondolier/gondolier_mixer.cpp
index 3d0a0e1..2bd3313 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.cpp
+++ b/engines/titanic/game/gondolier/gondolier_mixer.cpp
@@ -57,7 +57,7 @@ void CGondolierMixer::load(SimpleFile *file) {
 	CGondolierBase::load(file);
 }
 
-bool CGondolierMixer::handleEvent(CEnterRoomMsg &msg) {
+bool CGondolierMixer::handleMessage(CEnterRoomMsg &msg) {
 	CRoomItem *parentRoom = dynamic_cast<CRoomItem *>(getParent());
 	if (parentRoom == msg._newRoom)
 		msg.execute(parentRoom);
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.h b/engines/titanic/game/gondolier/gondolier_mixer.h
index 1288290..dd72883 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.h
+++ b/engines/titanic/game/gondolier/gondolier_mixer.h
@@ -38,7 +38,7 @@ private:
 	CString _string2;
 	int _fieldE4;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CGondolierMixer();
diff --git a/engines/titanic/game/light.cpp b/engines/titanic/game/light.cpp
index 856e6a4..c0b7df3 100644
--- a/engines/titanic/game/light.cpp
+++ b/engines/titanic/game/light.cpp
@@ -57,7 +57,7 @@ void CLight::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CLight::handleEvent(CEnterRoomMsg &msg) {
+bool CLight::handleMessage(CEnterRoomMsg &msg) {
 	warning("CLight::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/light.h b/engines/titanic/game/light.h
index 42e7224..66d60be 100644
--- a/engines/titanic/game/light.h
+++ b/engines/titanic/game/light.h
@@ -39,7 +39,7 @@ private:
 	int _fieldF8;
 	int _fieldFC;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLight();
diff --git a/engines/titanic/game/light_switch.cpp b/engines/titanic/game/light_switch.cpp
index b857bfb..0e68dda 100644
--- a/engines/titanic/game/light_switch.cpp
+++ b/engines/titanic/game/light_switch.cpp
@@ -50,7 +50,7 @@ void CLightSwitch::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CLightSwitch::handleEvent(CEnterRoomMsg &msg) {
+bool CLightSwitch::handleMessage(CEnterRoomMsg &msg) {
 	warning("CLightSwitch::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/light_switch.h b/engines/titanic/game/light_switch.h
index 1cda539..2c43edd 100644
--- a/engines/titanic/game/light_switch.h
+++ b/engines/titanic/game/light_switch.h
@@ -36,7 +36,7 @@ private:
 	int _fieldE4;
 	int _fieldE8;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLightSwitch();
diff --git a/engines/titanic/game/long_stick_dispenser.cpp b/engines/titanic/game/long_stick_dispenser.cpp
index 5d7df1d..9511d7b 100644
--- a/engines/titanic/game/long_stick_dispenser.cpp
+++ b/engines/titanic/game/long_stick_dispenser.cpp
@@ -42,7 +42,7 @@ void CLongStickDispenser::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CLongStickDispenser::handleEvent(CEnterRoomMsg &msg) {
+bool CLongStickDispenser::handleMessage(CEnterRoomMsg &msg) {
 	_fieldC0 = 0;
 	_fieldC4 = 1;
 	return true;
diff --git a/engines/titanic/game/long_stick_dispenser.h b/engines/titanic/game/long_stick_dispenser.h
index 14785a7..5e43bfa 100644
--- a/engines/titanic/game/long_stick_dispenser.h
+++ b/engines/titanic/game/long_stick_dispenser.h
@@ -34,7 +34,7 @@ private:
 	int _fieldC0;
 	int _fieldC4;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLongStickDispenser() : CGameObject(), _fieldBC(0),
diff --git a/engines/titanic/game/parrot/player_meets_parrot.cpp b/engines/titanic/game/parrot/player_meets_parrot.cpp
index adb2dc5..16c8f48 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.cpp
+++ b/engines/titanic/game/parrot/player_meets_parrot.cpp
@@ -34,7 +34,7 @@ void CPlayerMeetsParrot::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CPlayerMeetsParrot::handleEvent(CEnterRoomMsg &msg) {
+bool CPlayerMeetsParrot::handleMessage(CEnterRoomMsg &msg) {
 	warning("CPlayerMeetsParrot::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/parrot/player_meets_parrot.h b/engines/titanic/game/parrot/player_meets_parrot.h
index 9b8138f..960b679 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.h
+++ b/engines/titanic/game/parrot/player_meets_parrot.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CPlayerMeetsParrot : public CGameObject, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_monitor.cpp b/engines/titanic/game/pet/pet_monitor.cpp
index 44d24f2..afe0836 100644
--- a/engines/titanic/game/pet/pet_monitor.cpp
+++ b/engines/titanic/game/pet/pet_monitor.cpp
@@ -34,7 +34,7 @@ void CPETMonitor::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CPETMonitor::handleEvent(CEnterRoomMsg &msg) {
+bool CPETMonitor::handleMessage(CEnterRoomMsg &msg) {
 	warning("CPETMonitor::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/pet/pet_monitor.h b/engines/titanic/game/pet/pet_monitor.h
index 1d66a58..f8a3529 100644
--- a/engines/titanic/game/pet/pet_monitor.h
+++ b/engines/titanic/game/pet/pet_monitor.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CPETMonitor : public CGameObject, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_position.cpp b/engines/titanic/game/pet/pet_position.cpp
index b25111f..e1dab22 100644
--- a/engines/titanic/game/pet/pet_position.cpp
+++ b/engines/titanic/game/pet/pet_position.cpp
@@ -34,7 +34,7 @@ void CPETPosition::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CPETPosition::handleEvent(CEnterRoomMsg &msg) {
+bool CPETPosition::handleMessage(CEnterRoomMsg &msg) {
 	warning("CPETPosition::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/pet/pet_position.h b/engines/titanic/game/pet/pet_position.h
index 8a06239..fe28a13 100644
--- a/engines/titanic/game/pet/pet_position.h
+++ b/engines/titanic/game/pet/pet_position.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CPETPosition : public CGameObject, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_transport.cpp b/engines/titanic/game/pet/pet_transport.cpp
index a88b703..3668567 100644
--- a/engines/titanic/game/pet/pet_transport.cpp
+++ b/engines/titanic/game/pet/pet_transport.cpp
@@ -34,7 +34,7 @@ void CPETTransport::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CPETTransport::handleEvent(CEnterRoomMsg &msg) {
+bool CPETTransport::handleMessage(CEnterRoomMsg &msg) {
 	warning("CPETTransport::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/pet/pet_transport.h b/engines/titanic/game/pet/pet_transport.h
index 3dc856d..e43cbef 100644
--- a/engines/titanic/game/pet/pet_transport.h
+++ b/engines/titanic/game/pet/pet_transport.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CPETTransport : public CGameObject, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp
index f7a696e..749bf33 100644
--- a/engines/titanic/game/phonograph.cpp
+++ b/engines/titanic/game/phonograph.cpp
@@ -55,7 +55,7 @@ void CPhonograph::load(SimpleFile *file) {
 	CMusicPlayer::load(file);
 }
 
-bool CPhonograph::handleEvent(CEnterRoomMsg &msg) {
+bool CPhonograph::handleMessage(CEnterRoomMsg &msg) {
 	warning("CPhonograph::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/phonograph.h b/engines/titanic/game/phonograph.h
index 6efe10b..102edd2 100644
--- a/engines/titanic/game/phonograph.h
+++ b/engines/titanic/game/phonograph.h
@@ -38,7 +38,7 @@ protected:
 	int _fieldF0;
 	int _fieldF4;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CPhonograph();
diff --git a/engines/titanic/game/sgt/sgt_state_room.cpp b/engines/titanic/game/sgt/sgt_state_room.cpp
index cf735dd..9baae69 100644
--- a/engines/titanic/game/sgt/sgt_state_room.cpp
+++ b/engines/titanic/game/sgt/sgt_state_room.cpp
@@ -90,7 +90,7 @@ void CSGTStateRoom::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CSGTStateRoom::handleEvent(CEnterRoomMsg &msg) {
+bool CSGTStateRoom::handleMessage(CEnterRoomMsg &msg) {
 	warning("CSGTStateRoom::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/sgt/sgt_state_room.h b/engines/titanic/game/sgt/sgt_state_room.h
index 4ec1617..a730473 100644
--- a/engines/titanic/game/sgt/sgt_state_room.h
+++ b/engines/titanic/game/sgt/sgt_state_room.h
@@ -55,7 +55,7 @@ private:
 	int _fieldEC;
 	int _fieldF0;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CSGTStateRoom();
diff --git a/engines/titanic/game/ship_setting.cpp b/engines/titanic/game/ship_setting.cpp
index 6d12e59..1da2792 100644
--- a/engines/titanic/game/ship_setting.cpp
+++ b/engines/titanic/game/ship_setting.cpp
@@ -48,7 +48,7 @@ void CShipSetting::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CShipSetting::handleEvent(CEnterRoomMsg &msg) {
+bool CShipSetting::handleMessage(CEnterRoomMsg &msg) {
 	warning("CShipSetting::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/ship_setting.h b/engines/titanic/game/ship_setting.h
index 2525224..6ea38be 100644
--- a/engines/titanic/game/ship_setting.h
+++ b/engines/titanic/game/ship_setting.h
@@ -35,7 +35,7 @@ private:
 	CString _string4;
 	CString _string5;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CShipSetting();
diff --git a/engines/titanic/game/transport/lift.cpp b/engines/titanic/game/transport/lift.cpp
index edf69fe..a795a15 100644
--- a/engines/titanic/game/transport/lift.cpp
+++ b/engines/titanic/game/transport/lift.cpp
@@ -57,7 +57,7 @@ void CLift::load(SimpleFile *file) {
 	CTransport::load(file);
 }
 
-bool CLift::handleEvent(CEnterRoomMsg &msg) {
+bool CLift::handleMessage(CEnterRoomMsg &msg) {
 	warning("CLift::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h
index 439e65b..4f62823 100644
--- a/engines/titanic/game/transport/lift.h
+++ b/engines/titanic/game/transport/lift.h
@@ -39,7 +39,7 @@ private:
 
 	int _fieldF8;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLift() : CTransport(), _fieldF8(1) {}
diff --git a/engines/titanic/game/transport/lift_indicator.h b/engines/titanic/game/transport/lift_indicator.h
index 80f8b0d..7cc5585 100644
--- a/engines/titanic/game/transport/lift_indicator.h
+++ b/engines/titanic/game/transport/lift_indicator.h
@@ -35,7 +35,7 @@ private:
 	int _field108;
 	int _field10C;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg) { return true; }
+	virtual bool handleMessage(CEnterRoomMsg &msg) { return true; }
 public:
 	CLASSDEF
 	CLiftindicator();
diff --git a/engines/titanic/game/transport/pellerator.cpp b/engines/titanic/game/transport/pellerator.cpp
index 16f4277..eca1037 100644
--- a/engines/titanic/game/transport/pellerator.cpp
+++ b/engines/titanic/game/transport/pellerator.cpp
@@ -43,7 +43,7 @@ void CPellerator::load(SimpleFile *file) {
 	CTransport::load(file);
 }
 
-bool CPellerator::handleEvent(CEnterRoomMsg &msg) {
+bool CPellerator::handleMessage(CEnterRoomMsg &msg) {
 	warning("CPellerator::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/transport/pellerator.h b/engines/titanic/game/transport/pellerator.h
index c997373..03e4575 100644
--- a/engines/titanic/game/transport/pellerator.h
+++ b/engines/titanic/game/transport/pellerator.h
@@ -33,7 +33,7 @@ private:
 	static int _v1;
 	static int _v2;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/up_lighter.cpp b/engines/titanic/game/up_lighter.cpp
index 817b179..819dc94 100644
--- a/engines/titanic/game/up_lighter.cpp
+++ b/engines/titanic/game/up_lighter.cpp
@@ -48,7 +48,7 @@ void CUpLighter::load(SimpleFile *file) {
 	CDropTarget::load(file);
 }
 
-bool CUpLighter::handleEvent(CEnterRoomMsg &msg) {
+bool CUpLighter::handleMessage(CEnterRoomMsg &msg) {
 	warning("CUpLighter::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/up_lighter.h b/engines/titanic/game/up_lighter.h
index 6c722dd..add941f 100644
--- a/engines/titanic/game/up_lighter.h
+++ b/engines/titanic/game/up_lighter.h
@@ -35,7 +35,7 @@ private:
 	int _field120;
 	int _field124;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CUpLighter();
diff --git a/engines/titanic/game/volume_control.cpp b/engines/titanic/game/volume_control.cpp
index 801dfd1..bb58dee 100644
--- a/engines/titanic/game/volume_control.cpp
+++ b/engines/titanic/game/volume_control.cpp
@@ -45,7 +45,7 @@ void CVolumeControl::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CVolumeControl::handleEvent(CEnterNodeMsg &msg) {
+bool CVolumeControl::handleMessage(CEnterNodeMsg &msg) {
 	warning("CVolumeControl::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/volume_control.h b/engines/titanic/game/volume_control.h
index f3f6a75..5586c9c 100644
--- a/engines/titanic/game/volume_control.h
+++ b/engines/titanic/game/volume_control.h
@@ -34,7 +34,7 @@ private:
 	CString _string1;
 	int _fieldCC;
 protected:
-	virtual bool handleEvent(CEnterNodeMsg &msg);
+	virtual bool handleMessage(CEnterNodeMsg &msg);
 public:
 	CLASSDEF
 	CVolumeControl();
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index 110bddf..2eb4427 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -48,7 +48,7 @@ void CInputHandler::decLockCount() {
 	}
 }
 
-void CInputHandler::handleMessage(const CMessage &msg, bool respectLock) {
+void CInputHandler::handleMessage(CMessage &msg, bool respectLock) {
 	if (!respectLock || _lockCount <= 0) {
 		if (_gameManager->_gameState._mode == GSMODE_1) {
 			processMessage(&msg);
@@ -58,7 +58,7 @@ void CInputHandler::handleMessage(const CMessage &msg, bool respectLock) {
 	}
 }
 
-void CInputHandler::processMessage(const CMessage *msg) {
+void CInputHandler::processMessage(CMessage *msg) {
 	const CMouseMsg *mouseMsg = dynamic_cast<const CMouseMsg *>(msg);
 	_field24 = 0;
 	dispatchMessage(msg);
@@ -126,7 +126,7 @@ void CInputHandler::processMessage(const CMessage *msg) {
 	}
 }
 
-void CInputHandler::dispatchMessage(const CMessage *msg) {
+void CInputHandler::dispatchMessage(CMessage *msg) {
 	CPetControl *pet = _gameManager->_project->getPetControl();
 	if (!pet || !msg->execute(pet, nullptr, MSGFLAG_BREAK_IF_HANDLED)) {
 		CViewItem *view = _gameManager->getView();
diff --git a/engines/titanic/input_handler.h b/engines/titanic/input_handler.h
index a81874f..7495082 100644
--- a/engines/titanic/input_handler.h
+++ b/engines/titanic/input_handler.h
@@ -36,12 +36,12 @@ private:
 	/**
 	 * Process and dispatch a passed message
 	 */
-	void processMessage(const CMessage *msg);
+	void processMessage(CMessage *msg);
 
 	/**
 	 * Dispatches a message to the project
 	 */
-	void dispatchMessage(const CMessage *msg);
+	void dispatchMessage(CMessage *msg);
 
 	/**
 	 * Called when a drag operation has ended
@@ -75,7 +75,7 @@ public:
 	/**
 	 * Handles a genereated mouse message
 	 */
-	void handleMessage(const CMessage &msg, bool respectLock = true);
+	void handleMessage(CMessage &msg, bool respectLock = true);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/messages/bilge_dispensor_event.cpp b/engines/titanic/messages/bilge_dispensor_event.cpp
index c20fe10..e17494c 100644
--- a/engines/titanic/messages/bilge_dispensor_event.cpp
+++ b/engines/titanic/messages/bilge_dispensor_event.cpp
@@ -34,7 +34,7 @@ void CBilgeDispensorEvent::load(SimpleFile *file) {
 	CAutoSoundEvent::load(file);
 }
 
-bool CBilgeDispensorEvent::handleEvent(CEnterRoomMsg &msg) {
+bool CBilgeDispensorEvent::handleMessage(CEnterRoomMsg &msg) {
 	_value1 = 0;
 	return true;
 }
diff --git a/engines/titanic/messages/bilge_dispensor_event.h b/engines/titanic/messages/bilge_dispensor_event.h
index 9f91b61..de8705f 100644
--- a/engines/titanic/messages/bilge_dispensor_event.h
+++ b/engines/titanic/messages/bilge_dispensor_event.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CBilgeDispensorEvent : public CAutoSoundEvent {
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
index 9202305..28b8856 100644
--- a/engines/titanic/messages/messages.cpp
+++ b/engines/titanic/messages/messages.cpp
@@ -39,7 +39,7 @@ void CMessage::load(SimpleFile *file) {
 	CSaveableObject::load(file);
 }
 
-bool CMessage::execute(CTreeItem *target, const ClassDef *classDef, int flags) const {
+bool CMessage::execute(CTreeItem *target, const ClassDef *classDef, int flags) {
 	// If no target was specified, then there's nothing to do
 	if (!target)
 		return false;
@@ -51,7 +51,7 @@ bool CMessage::execute(CTreeItem *target, const ClassDef *classDef, int flags) c
 		if (flags & MSGFLAG_SCAN)
 			nextItem = item->scan(target);
 
-		if (!(flags & MSGFLAG_CLASS_DEF) || item->isInstanceOf(classDef)) {
+		if (!classDef || item->isInstanceOf(classDef)) {
 			bool handled = perform(item);
 
 			if (handled) {
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index ccea453..c945ad7 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -35,7 +35,7 @@ enum MessageFlag {
 };
 
 #define MSGTARGET(NAME) class NAME; class NAME##Target { public: \
-	virtual bool handleEvent(NAME &msg) = 0; }
+	virtual bool handleMessage(NAME &msg) = 0; }
 
 class CGameObject;
 class CRoomItem;
@@ -47,10 +47,14 @@ public:
 	CLASSDEF
 	CMessage();
 
+	/**
+	 * Executes the message, passing it on to the designated target,
+	 * and optionally it's children
+	 */
 	bool execute(CTreeItem *target, const ClassDef *classDef = nullptr,
-		int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED) const;
+		int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED);
 
-	virtual bool perform(CTreeItem *treeItem) const { return false; }
+	virtual bool perform(CTreeItem *treeItem) { return false; }
 
 	/**
 	 * Save the data for the class to file
@@ -80,8 +84,6 @@ public:
 
 MSGTARGET(CEditControlMsg);
 class CEditControlMsg : public CMessage {
-protected:
-	virtual bool handleMessage(const CEditControlMsg &msg) { return false; }
 public:
 	int _field4;
 	int _field8;
@@ -95,19 +97,17 @@ public:
 		_field1C(0), _field20(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CEditControlMsg *>(item) != nullptr;
+		return dynamic_cast<const CEditControlMsgTarget *>(item) != nullptr;
 	}
 
-	virtual bool perform(CTreeItem *treeItem) const { 
-		CEditControlMsg *dest = dynamic_cast<CEditControlMsg *>(treeItem);
+	virtual bool perform(CTreeItem *treeItem) { 
+		CEditControlMsgTarget *dest = dynamic_cast<CEditControlMsgTarget *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
 };
 
 MSGTARGET(CLightsMsg);
 class CLightsMsg : public CMessage {
-protected:
-	virtual bool handleMessage(const CLightsMsg &msg) { return false; }
 public:
 	int _field4;
 	int _field8;
@@ -119,19 +119,16 @@ public:
 		_fieldC(0), _field10(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CLightsMsg *>(item) != nullptr;
+		return dynamic_cast<const CLightsMsgTarget *>(item) != nullptr;
 	}
-
-	virtual bool perform(CTreeItem *treeItem) const {
-		CLightsMsg *dest = dynamic_cast<CLightsMsg *>(treeItem);
+	virtual bool perform(CTreeItem *treeItem) {
+		CLightsMsgTarget *dest = dynamic_cast<CLightsMsgTarget *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
 };
 
 MSGTARGET(CIsHookedOnMsg);
 class CIsHookedOnMsg : public CMessage {
-protected:
-	virtual bool handleMessage(const CIsHookedOnMsg &msg) { return false; }
 public:
 	int _field4;
 	int _field8;
@@ -145,19 +142,16 @@ public:
 		_field18(0), _field1C(0), _field20(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CIsHookedOnMsg *>(item) != nullptr;
+		return dynamic_cast<const CIsHookedOnMsgTarget *>(item) != nullptr;
 	}
-
-	virtual bool perform(CTreeItem *treeItem) const {
-		CIsHookedOnMsg *dest = dynamic_cast<CIsHookedOnMsg *>(treeItem);
+	virtual bool perform(CTreeItem *treeItem) {
+		CIsHookedOnMsgTarget *dest = dynamic_cast<CIsHookedOnMsgTarget *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
 };
 
 MSGTARGET(CSubAcceptCCarryMsg);
 class CSubAcceptCCarryMsg : public CMessage {
-protected:
-	virtual bool handleMessage(const CSubAcceptCCarryMsg &msg) { return false; }
 public:
 	CString _string1;
 	int _value1, _value2, _value3;
@@ -166,19 +160,16 @@ public:
 	CSubAcceptCCarryMsg() : _value1(0), _value2(0), _value3(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CSubAcceptCCarryMsg *>(item) != nullptr;
+		return dynamic_cast<const CSubAcceptCCarryMsgTarget *>(item) != nullptr;
 	}
-
-	virtual bool perform(CTreeItem *treeItem) const {
-		CSubAcceptCCarryMsg *dest = dynamic_cast<CSubAcceptCCarryMsg *>(treeItem);
+	virtual bool perform(CTreeItem *treeItem) {
+		CSubAcceptCCarryMsgTarget *dest = dynamic_cast<CSubAcceptCCarryMsgTarget *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
 };
 
 MSGTARGET(CTransportMsg);
 class CTransportMsg : public CMessage {
-protected:
-	virtual bool handleMessage(const CTransportMsg &msg) { return false; }
 public:
 	CString _string;
 	int _value1, _value2;
@@ -187,11 +178,10 @@ public:
 	CTransportMsg() : _value1(0), _value2(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CTransportMsg *>(item) != nullptr;
+		return dynamic_cast<const CTransportMsgTarget *>(item) != nullptr;
 	}
-
-	virtual bool perform(CTreeItem *treeItem) const {
-		CTransportMsg *dest = dynamic_cast<CTransportMsg *>(treeItem);
+	virtual bool perform(CTreeItem *treeItem) {
+		CTransportMsgTarget *dest = dynamic_cast<CTransportMsgTarget *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
 };
@@ -201,10 +191,9 @@ public:
 	public: NAME() : CMessage() {} \
 	CLASSDEF \
 	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME *>(item) != nullptr; } \
-	virtual bool handleMessage(const NAME &msg) { return false; } \
-	virtual bool perform(CTreeItem *treeItem) const { \
-		NAME *dest = dynamic_cast<NAME *>(treeItem); \
+		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
+	virtual bool perform(CTreeItem *treeItem) { \
+		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
 		return dest != nullptr && dest->handleMessage(*this); \
 	} }
 #define MESSAGE1(NAME, F1, N1, V1) MSGTARGET(NAME); \
@@ -214,10 +203,9 @@ public:
 	NAME(F1 N1) : CMessage(), _##N1(N1) {} \
 	CLASSDEF \
 	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME *>(item) != nullptr; } \
-	virtual bool handleMessage(const NAME &msg) { return false; } \
+		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
 	virtual bool perform(CTreeItem *treeItem) { \
-		NAME *dest = dynamic_cast<NAME *>(treeItem); \
+		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
 		return dest != nullptr && dest->handleMessage(*this); \
 	} }
 #define MESSAGE2(NAME, F1, N1, V1, F2, N2, V2) MSGTARGET(NAME); \
@@ -227,10 +215,9 @@ public:
 	NAME(F1 N1, F2 N2) : CMessage(), _##N1(N1), _##N2(N2) {} \
 	CLASSDEF \
 	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME *>(item) != nullptr; } \
-	virtual bool handleMessage(const NAME &msg) { return false; } \
+		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
 	virtual bool perform(CTreeItem *treeItem) { \
-		NAME *dest = dynamic_cast<NAME *>(treeItem); \
+		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
 		return dest != nullptr && dest->handleMessage(*this); \
 	} }
 #define MESSAGE3(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3) MSGTARGET(NAME); \
@@ -240,10 +227,9 @@ public:
 	NAME(F1 N1, F2 N2, F3 N3) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3) {} \
 	CLASSDEF \
 	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME *>(item) != nullptr; } \
-	virtual bool handleMessage(const NAME &msg) { return false; } \
+		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
 	virtual bool perform(CTreeItem *treeItem) { \
-		NAME *dest = dynamic_cast<NAME *>(treeItem); \
+		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
 		return dest != nullptr && dest->handleMessage(*this); \
 	} }
 #define MESSAGE4(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3, F4, N4, V4) MSGTARGET(NAME); \
@@ -253,10 +239,9 @@ public:
 	NAME(F1 N1, F2 N2, F3 N3, F4 N4) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3), _##N4(N4) {} \
 	CLASSDEF \
 	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME *>(item) != nullptr; } \
-	virtual bool handleMessage(const NAME &msg) { return false; } \
+		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
 	virtual bool perform(CTreeItem *treeItem) { \
-		NAME *dest = dynamic_cast<NAME *>(treeItem); \
+		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
 		return dest != nullptr && dest->handleMessage(*this); \
 	} }
 
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 6e2a74a..7fe7ef9 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -30,6 +30,7 @@ namespace Titanic {
 
 enum MouseButton { MB_LEFT = 1, MB_MIDDLE = 2, MB_RIGHT = 4 };
 
+MSGTARGET(CMouseMsg);
 class CMouseMsg : public CMessage {
 public:
 	int _buttons;
@@ -39,6 +40,11 @@ public:
 	static bool isSupportedBy(const CTreeItem *item) {
 		return dynamic_cast<const CMouseMsg *>(item) != nullptr;
 	}
+	virtual bool perform(CTreeItem *treeItem) {
+		CMouseMsgTarget *dest = dynamic_cast<CMouseMsgTarget *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
+
 	CMouseMsg() : _buttons(0) {}
 	CMouseMsg(const Point &pt, int buttons) :
 		_mousePos(pt), _buttons(buttons) {}
@@ -52,15 +58,15 @@ public:
 	CMouseMoveMsg(const Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseMoveMsg *>(item) != nullptr;
+		return dynamic_cast<const CMouseMoveMsgTarget *>(item) != nullptr;
 	}
-	virtual bool handleMessage(const CMouseMoveMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
-		CMouseMoveMsg *dest = dynamic_cast<CMouseMoveMsg *>(treeItem);
+		CMouseMoveMsgTarget *dest = dynamic_cast<CMouseMoveMsgTarget *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
 };
 
+MSGTARGET(CMouseButtonMsg);
 class CMouseButtonMsg : public CMouseMsg {
 public:
 	int _field10;
@@ -70,7 +76,7 @@ public:
 	CMouseButtonMsg(const Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseButtonMsg *>(item) != nullptr;
+		return dynamic_cast<const CMouseButtonMsgTarget *>(item) != nullptr;
 	}
 };
 
@@ -82,11 +88,10 @@ public:
 	CMouseButtonDownMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseButtonDownMsg *>(item) != nullptr;
+		return dynamic_cast<const CMouseButtonDownMsgTarget *>(item) != nullptr;
 	}
-	virtual bool handleMessage(const CMouseButtonDownMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) {
-		CMouseButtonDownMsg *dest = dynamic_cast<CMouseButtonDownMsg *>(treeItem);
+		CMouseButtonDownMsgTarget *dest = dynamic_cast<CMouseButtonDownMsgTarget *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
 };
@@ -101,9 +106,8 @@ public:
 	static bool isSupportedBy(const CTreeItem *item) {
 		return dynamic_cast<const CMouseButtonUpMsg *>(item) != nullptr;
 	}
-	virtual bool handleMessage(const CMouseButtonUpMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
-		CMouseButtonUpMsg *dest = dynamic_cast<CMouseButtonUpMsg *>(treeItem);
+		CMouseButtonUpMsgTarget *dest = dynamic_cast<CMouseButtonUpMsgTarget *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
 };
@@ -116,15 +120,15 @@ public:
 	CMouseDoubleClickMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseDoubleClickMsg *>(item) != nullptr;
+		return dynamic_cast<const CMouseDoubleClickMsgTarget *>(item) != nullptr;
 	}
-	virtual bool handleMessage(const CMouseDoubleClickMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
-		CMouseDoubleClickMsg *dest = dynamic_cast<CMouseDoubleClickMsg *>(treeItem);
+		CMouseDoubleClickMsgTarget *dest = dynamic_cast<CMouseDoubleClickMsgTarget *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
 };
 
+MSGTARGET(CMouseDragMsg);
 class CMouseDragMsg : public CMouseMsg {
 public:
 	CLASSDEF
@@ -136,6 +140,7 @@ public:
 	}
 };
 
+MSGTARGET(CMouseDragMoveMsg);
 class CMouseDragMoveMsg : public CMouseDragMsg {
 public:
 	CLASSDEF
@@ -143,11 +148,10 @@ public:
 	CMouseDragMoveMsg(const Point &pt) : CMouseDragMsg(pt) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseDragMoveMsg *>(item) != nullptr;
+		return dynamic_cast<const CMouseDragMoveMsgTarget *>(item) != nullptr;
 	}
-	virtual bool handleMessage(const CMouseDragMoveMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
-		CMouseDragMoveMsg *dest = dynamic_cast<CMouseDragMoveMsg *>(treeItem);
+		CMouseDragMoveMsgTarget *dest = dynamic_cast<CMouseDragMoveMsgTarget *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
 };
@@ -164,11 +168,10 @@ public:
 		_dragItem(nullptr), _field14(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseDragStartMsg *>(item) != nullptr;
+		return dynamic_cast<const CMouseDragStartMsgTarget *>(item) != nullptr;
 	}
-	virtual bool handleMessage(const CMouseDragStartMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) { 
-		CMouseDragStartMsg *dest = dynamic_cast<CMouseDragStartMsg *>(treeItem);
+		CMouseDragStartMsgTarget *dest = dynamic_cast<CMouseDragStartMsgTarget *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
 };
@@ -184,11 +187,10 @@ public:
 		CMouseDragMsg(pt), _dragItem(dragItem) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseDragEndMsg *>(item) != nullptr;
+		return dynamic_cast<const CMouseDragEndMsgTarget *>(item) != nullptr;
 	}
-	virtual bool handleMessage(const CMouseDragEndMsg &msg) { return false; }
 	virtual bool perform(CTreeItem *treeItem) {
-		CMouseDragEndMsg *dest = dynamic_cast<CMouseDragEndMsg *>(treeItem);
+		CMouseDragEndMsgTarget *dest = dynamic_cast<CMouseDragEndMsgTarget *>(treeItem);
 		return dest != nullptr && dest->handleMessage(*this);
 	}
 };
diff --git a/engines/titanic/moves/enter_bridge.cpp b/engines/titanic/moves/enter_bridge.cpp
index 359cfcb..8916fa9 100644
--- a/engines/titanic/moves/enter_bridge.cpp
+++ b/engines/titanic/moves/enter_bridge.cpp
@@ -36,7 +36,7 @@ void CEnterBridge::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CEnterBridge::handleEvent(CEnterRoomMsg &msg) {
+bool CEnterBridge::handleMessage(CEnterRoomMsg &msg) {
 	warning("CEnterBridge::handlEvent");
 	return true;
 }
diff --git a/engines/titanic/moves/enter_bridge.h b/engines/titanic/moves/enter_bridge.h
index 39343ef..9f7a64c 100644
--- a/engines/titanic/moves/enter_bridge.h
+++ b/engines/titanic/moves/enter_bridge.h
@@ -32,7 +32,7 @@ class CEnterBridge : public CGameObject, CEnterRoomMsgTarget {
 private:
 	int _value;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CEnterBridge() : CGameObject(), _value(1) {}
diff --git a/engines/titanic/npcs/barbot.cpp b/engines/titanic/npcs/barbot.cpp
index 907d3c0..e487dc1 100644
--- a/engines/titanic/npcs/barbot.cpp
+++ b/engines/titanic/npcs/barbot.cpp
@@ -233,7 +233,7 @@ void CBarbot::load(SimpleFile *file) {
 	CTrueTalkNPC::load(file);
 }
 
-bool CBarbot::handleEvent(CEnterRoomMsg &msg) {
+bool CBarbot::handleMessage(CEnterRoomMsg &msg) {
 	warning("TODO: Barbot::CEnterRoomMsg");
 	return true;
 }
diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h
index 442578e..d407ef7 100644
--- a/engines/titanic/npcs/barbot.h
+++ b/engines/titanic/npcs/barbot.h
@@ -174,7 +174,7 @@ private:
 	int _field33C;
 	int _field340;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CBarbot();
diff --git a/engines/titanic/npcs/liftbot.cpp b/engines/titanic/npcs/liftbot.cpp
index dfc0a4f..a412d43 100644
--- a/engines/titanic/npcs/liftbot.cpp
+++ b/engines/titanic/npcs/liftbot.cpp
@@ -48,7 +48,7 @@ void CLiftBot::load(SimpleFile *file) {
 	CTrueTalkNPC::load(file);
 }
 
-bool CLiftBot::handleEvent(CEnterRoomMsg &msg) {
+bool CLiftBot::handleMessage(CEnterRoomMsg &msg) {
 	warning("CLiftBot::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/npcs/liftbot.h b/engines/titanic/npcs/liftbot.h
index 3a41bf3..373147b 100644
--- a/engines/titanic/npcs/liftbot.h
+++ b/engines/titanic/npcs/liftbot.h
@@ -35,7 +35,7 @@ private:
 private:
 	int _field108;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLiftBot();
diff --git a/engines/titanic/sound/auto_music_player.cpp b/engines/titanic/sound/auto_music_player.cpp
index 638cac8..5981a70 100644
--- a/engines/titanic/sound/auto_music_player.cpp
+++ b/engines/titanic/sound/auto_music_player.cpp
@@ -41,7 +41,7 @@ void CAutoMusicPlayer::load(SimpleFile *file) {
 	CAutoMusicPlayerBase::load(file);
 }
 
-bool CAutoMusicPlayer::handleEvent(CEnterRoomMsg &msg) {
+bool CAutoMusicPlayer::handleMessage(CEnterRoomMsg &msg) {
 	if (!_fieldCC) {
 		warning("TODO");
 	}
diff --git a/engines/titanic/sound/auto_music_player.h b/engines/titanic/sound/auto_music_player.h
index d2f42ac..bcf4126 100644
--- a/engines/titanic/sound/auto_music_player.h
+++ b/engines/titanic/sound/auto_music_player.h
@@ -32,7 +32,7 @@ class CAutoMusicPlayer : public CAutoMusicPlayerBase, CEnterRoomMsgTarget {
 private:
 	CString _string2;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CAutoMusicPlayer();
diff --git a/engines/titanic/sound/music_player.cpp b/engines/titanic/sound/music_player.cpp
index 25f73b0..eaad635 100644
--- a/engines/titanic/sound/music_player.cpp
+++ b/engines/titanic/sound/music_player.cpp
@@ -44,7 +44,7 @@ void CMusicPlayer::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CMusicPlayer::handleEvent(CEnterRoomMsg &msg) {
+bool CMusicPlayer::handleMessage(CEnterRoomMsg &msg) {
 	warning("TODO: CMusicPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/music_player.h b/engines/titanic/sound/music_player.h
index 96a6968..6b8bc83 100644
--- a/engines/titanic/sound/music_player.h
+++ b/engines/titanic/sound/music_player.h
@@ -35,7 +35,7 @@ protected:
 	int _fieldCC;
 	int _fieldD0;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CMusicPlayer() : CGameObject(),
diff --git a/engines/titanic/sound/node_auto_sound_player.cpp b/engines/titanic/sound/node_auto_sound_player.cpp
index 0ef6c8d..5af8ca2 100644
--- a/engines/titanic/sound/node_auto_sound_player.cpp
+++ b/engines/titanic/sound/node_auto_sound_player.cpp
@@ -36,7 +36,7 @@ void CNodeAutoSoundPlayer::load(SimpleFile *file) {
 	CAutoSoundPlayer::load(file);
 }
 
-bool CNodeAutoSoundPlayer::handleEvent(CEnterNodeMsg &msg) {
+bool CNodeAutoSoundPlayer::handleMessage(CEnterNodeMsg &msg) {
 	warning("CNodeAutoSoundPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/node_auto_sound_player.h b/engines/titanic/sound/node_auto_sound_player.h
index 258aa47..acc766a 100644
--- a/engines/titanic/sound/node_auto_sound_player.h
+++ b/engines/titanic/sound/node_auto_sound_player.h
@@ -32,7 +32,7 @@ class CNodeAutoSoundPlayer : public CAutoSoundPlayer, CEnterNodeMsgTarget {
 private:
 	int _fieldEC;
 protected:
-	virtual bool handleEvent(CEnterNodeMsg &msg);
+	virtual bool handleMessage(CEnterNodeMsg &msg);
 public:
 	CLASSDEF
 	CNodeAutoSoundPlayer() : CAutoSoundPlayer(), _fieldEC(1) {}
diff --git a/engines/titanic/sound/restricted_auto_music_player.cpp b/engines/titanic/sound/restricted_auto_music_player.cpp
index 2ee8f2d..7b5ba70 100644
--- a/engines/titanic/sound/restricted_auto_music_player.cpp
+++ b/engines/titanic/sound/restricted_auto_music_player.cpp
@@ -44,7 +44,7 @@ void CRestrictedAutoMusicPlayer::load(SimpleFile *file) {
 	CAutoMusicPlayer::load(file);
 }
 
-bool CRestrictedAutoMusicPlayer::handleEvent(CEnterRoomMsg &msg) {
+bool CRestrictedAutoMusicPlayer::handleMessage(CEnterRoomMsg &msg) {
 	warning("CRestrictedAutoMusicPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/restricted_auto_music_player.h b/engines/titanic/sound/restricted_auto_music_player.h
index efb3dc2..3553d1c 100644
--- a/engines/titanic/sound/restricted_auto_music_player.h
+++ b/engines/titanic/sound/restricted_auto_music_player.h
@@ -35,7 +35,7 @@ private:
 	CString _string5;
 	CString _string6;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/sound/room_auto_sound_player.cpp b/engines/titanic/sound/room_auto_sound_player.cpp
index 549f27b..c24ef2a 100644
--- a/engines/titanic/sound/room_auto_sound_player.cpp
+++ b/engines/titanic/sound/room_auto_sound_player.cpp
@@ -34,7 +34,7 @@ void CRoomAutoSoundPlayer::load(SimpleFile *file) {
 	CAutoSoundPlayer::load(file);
 }
 
-bool CRoomAutoSoundPlayer::handleEvent(CEnterRoomMsg &msg) {
+bool CRoomAutoSoundPlayer::handleMessage(CEnterRoomMsg &msg) {
 	warning("CRoomAutoSoundPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/room_auto_sound_player.h b/engines/titanic/sound/room_auto_sound_player.h
index a3ec35c..82d23a7 100644
--- a/engines/titanic/sound/room_auto_sound_player.h
+++ b/engines/titanic/sound/room_auto_sound_player.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CRoomAutoSoundPlayer : public CAutoSoundPlayer, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/sound/room_trigger_auto_music_player.cpp b/engines/titanic/sound/room_trigger_auto_music_player.cpp
index 3c0ac05..5ec35c3 100644
--- a/engines/titanic/sound/room_trigger_auto_music_player.cpp
+++ b/engines/titanic/sound/room_trigger_auto_music_player.cpp
@@ -34,7 +34,7 @@ void CRoomTriggerAutoMusicPlayer::load(SimpleFile *file) {
 	CTriggerAutoMusicPlayer::load(file);
 }
 
-bool CRoomTriggerAutoMusicPlayer::handleEvent(CEnterRoomMsg &msg) {
+bool CRoomTriggerAutoMusicPlayer::handleMessage(CEnterRoomMsg &msg) {
 	warning("CRoomTriggerAutoMusicPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/room_trigger_auto_music_player.h b/engines/titanic/sound/room_trigger_auto_music_player.h
index 9a478a0..4ce4bae 100644
--- a/engines/titanic/sound/room_trigger_auto_music_player.h
+++ b/engines/titanic/sound/room_trigger_auto_music_player.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CRoomTriggerAutoMusicPlayer : public CTriggerAutoMusicPlayer, CEnterRoomMsgTarget {
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/sound/titania_speech.cpp b/engines/titanic/sound/titania_speech.cpp
index 16a88e4..c530a9a 100644
--- a/engines/titanic/sound/titania_speech.cpp
+++ b/engines/titanic/sound/titania_speech.cpp
@@ -40,7 +40,7 @@ void CTitaniaSpeech::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CTitaniaSpeech::handleEvent(CEnterRoomMsg &msg) {
+bool CTitaniaSpeech::handleMessage(CEnterRoomMsg &msg) {
 	warning("CTitaniaSpeech::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/titania_speech.h b/engines/titanic/sound/titania_speech.h
index 09a8495..b894eee 100644
--- a/engines/titanic/sound/titania_speech.h
+++ b/engines/titanic/sound/titania_speech.h
@@ -32,7 +32,7 @@ class CTitaniaSpeech : public CGameObject {
 private:
 	int _value1, _value2;
 protected:
-	virtual bool handleEvent(CEnterRoomMsg &msg);
+	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CTitaniaSpeech() : CGameObject(), _value1(1), _value2(0) {}


Commit: d9cc2908f8a9a7fa2d196c82571d32b5ef20ad9b
    https://github.com/scummvm/scummvm/commit/d9cc2908f8a9a7fa2d196c82571d32b5ef20ad9b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-24T12:51:44-04:00

Commit Message:
TITANIC: Make all use of message targets public inheritance

Changed paths:
    engines/titanic/core/view_item.h
    engines/titanic/game/arboretum_gate.h
    engines/titanic/game/bar_bell.h
    engines/titanic/game/bomb.h
    engines/titanic/game/chicken_cooler.h
    engines/titanic/game/doorbot_elevator_handler.h
    engines/titanic/game/end_sequence_control.h
    engines/titanic/game/fan_noises.h
    engines/titanic/game/get_lift_eye2.h
    engines/titanic/game/gondolier/gondolier_mixer.h
    engines/titanic/game/light.h
    engines/titanic/game/light_switch.h
    engines/titanic/game/parrot/player_meets_parrot.h
    engines/titanic/game/pet/pet_monitor.h
    engines/titanic/game/pet/pet_position.h
    engines/titanic/game/pet/pet_transport.h
    engines/titanic/game/sgt/sgt_state_room.h
    engines/titanic/game/ship_setting.h
    engines/titanic/game/transport/lift.h
    engines/titanic/game/transport/pellerator.h
    engines/titanic/game/up_lighter.h
    engines/titanic/moves/enter_bridge.h
    engines/titanic/npcs/barbot.h
    engines/titanic/npcs/liftbot.h
    engines/titanic/sound/auto_music_player.h
    engines/titanic/sound/music_player.h
    engines/titanic/sound/node_auto_sound_player.h
    engines/titanic/sound/room_auto_sound_player.h



diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index 3b071e5..fc4089f 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -29,8 +29,11 @@
 
 namespace Titanic {
 
-class CViewItem : public CNamedItem, CMouseButtonDownMsgTarget,
-	CMouseButtonUpMsgTarget, CMouseMoveMsgTarget, CMouseDoubleClickMsgTarget {
+class CViewItem : public CNamedItem,
+	public CMouseButtonDownMsgTarget,
+	public CMouseButtonUpMsgTarget,
+	public CMouseMoveMsgTarget,
+	public CMouseDoubleClickMsgTarget {
 private:
 	CTreeItem *_buttonUpTargets[4];
 private:
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
index 34569a0..a176e93 100644
--- a/engines/titanic/game/arboretum_gate.h
+++ b/engines/titanic/game/arboretum_gate.h
@@ -29,10 +29,14 @@
 
 namespace Titanic {
 
-class CArboretumGate : public CBackground, public CActMsgTarget,
-	public CLeaveViewMsgTarget, public CTurnOffTarget,
-	public CMouseButtonDownMsgTarget, public CEnterViewMsgTarget,
-	public CTurnOnTarget, public CMovieEndMsgTarget {
+class CArboretumGate : public CBackground,
+	public CActMsgTarget,
+	public CLeaveViewMsgTarget,
+	public CTurnOffTarget,
+	public CMouseButtonDownMsgTarget,
+	public CEnterViewMsgTarget,
+	public CTurnOnTarget,
+	public CMovieEndMsgTarget {
 private:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/game/bar_bell.h b/engines/titanic/game/bar_bell.h
index 30d7195..865e446 100644
--- a/engines/titanic/game/bar_bell.h
+++ b/engines/titanic/game/bar_bell.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CBarBell : public CGameObject, CEnterRoomMsgTarget {
+class CBarBell : public CGameObject,
+	public CEnterRoomMsgTarget {
 public:
 	int _fieldBC;
 	int _fieldC0;
diff --git a/engines/titanic/game/bomb.h b/engines/titanic/game/bomb.h
index 8e9dcdf..9f33189 100644
--- a/engines/titanic/game/bomb.h
+++ b/engines/titanic/game/bomb.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CBomb : public CBackground, CEnterRoomMsgTarget {
+class CBomb : public CBackground,
+	public CEnterRoomMsgTarget {
 private:
 	int _fieldE0;
 	int _fieldE4;
diff --git a/engines/titanic/game/chicken_cooler.h b/engines/titanic/game/chicken_cooler.h
index 176c8c9..6f57cdd 100644
--- a/engines/titanic/game/chicken_cooler.h
+++ b/engines/titanic/game/chicken_cooler.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CChickenCooler : public CGameObject, CEnterRoomMsgTarget {
+class CChickenCooler : public CGameObject,
+	public CEnterRoomMsgTarget {
 private:
 	int _fieldBC;
 	int _fieldC0;
diff --git a/engines/titanic/game/doorbot_elevator_handler.h b/engines/titanic/game/doorbot_elevator_handler.h
index d6c5be9..bd33747 100644
--- a/engines/titanic/game/doorbot_elevator_handler.h
+++ b/engines/titanic/game/doorbot_elevator_handler.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CDoorbotElevatorHandler : public CGameObject, CEnterNodeMsgTarget {
+class CDoorbotElevatorHandler : public CGameObject,
+	public CEnterNodeMsgTarget {
 private:
 	static int _v1;
 	int _value;
diff --git a/engines/titanic/game/end_sequence_control.h b/engines/titanic/game/end_sequence_control.h
index 5eb3694..87eaf17 100644
--- a/engines/titanic/game/end_sequence_control.h
+++ b/engines/titanic/game/end_sequence_control.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CEndSequenceControl : public CGameObject, CEnterRoomMsgTarget {
+class CEndSequenceControl : public CGameObject,
+	public CEnterRoomMsgTarget {
 protected:
 	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
diff --git a/engines/titanic/game/fan_noises.h b/engines/titanic/game/fan_noises.h
index 6daf802..495ac39 100644
--- a/engines/titanic/game/fan_noises.h
+++ b/engines/titanic/game/fan_noises.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CFanNoises : public CGameObject, CEnterRoomMsgTarget {
+class CFanNoises : public CGameObject,
+	public CEnterRoomMsgTarget {
 private:
 	int _fieldBC;
 	int _fieldC0;
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
index 8ce181f..7ca0b4d 100644
--- a/engines/titanic/game/get_lift_eye2.h
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -27,7 +27,8 @@
 #include "titanic/messages/messages.h"
 namespace Titanic {
 
-class CGetLiftEye2 : public CGameObject, CEnterRoomMsgTarget {
+class CGetLiftEye2 : public CGameObject,
+	public CEnterRoomMsgTarget {
 private:
 	static CString *_v1;
 protected:
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.h b/engines/titanic/game/gondolier/gondolier_mixer.h
index dd72883..c6ea840 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.h
+++ b/engines/titanic/game/gondolier/gondolier_mixer.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CGondolierMixer : public CGondolierBase, CEnterRoomMsgTarget {
+class CGondolierMixer : public CGondolierBase, 
+	public CEnterRoomMsgTarget {
 private:
 	int _fieldBC;
 	int _fieldC0;
diff --git a/engines/titanic/game/light.h b/engines/titanic/game/light.h
index 66d60be..a2e562c 100644
--- a/engines/titanic/game/light.h
+++ b/engines/titanic/game/light.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CLight : public CBackground, CEnterRoomMsgTarget {
+class CLight : public CBackground,
+	public CEnterRoomMsgTarget {
 private:
 	int _fieldE0;
 	int _fieldE4;
diff --git a/engines/titanic/game/light_switch.h b/engines/titanic/game/light_switch.h
index 2c43edd..3e44590 100644
--- a/engines/titanic/game/light_switch.h
+++ b/engines/titanic/game/light_switch.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CLightSwitch : public CBackground, CEnterRoomMsgTarget {
+class CLightSwitch : public CBackground,
+	public CEnterRoomMsgTarget {
 public:
 	static int _v1;
 private:
diff --git a/engines/titanic/game/parrot/player_meets_parrot.h b/engines/titanic/game/parrot/player_meets_parrot.h
index 960b679..9e47a0a 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.h
+++ b/engines/titanic/game/parrot/player_meets_parrot.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CPlayerMeetsParrot : public CGameObject, CEnterRoomMsgTarget {
+class CPlayerMeetsParrot : public CGameObject,
+	public CEnterRoomMsgTarget {
 protected:
 	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
diff --git a/engines/titanic/game/pet/pet_monitor.h b/engines/titanic/game/pet/pet_monitor.h
index f8a3529..5cf14f3 100644
--- a/engines/titanic/game/pet/pet_monitor.h
+++ b/engines/titanic/game/pet/pet_monitor.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CPETMonitor : public CGameObject, CEnterRoomMsgTarget {
+class CPETMonitor : public CGameObject,
+	public CEnterRoomMsgTarget {
 protected:
 	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
diff --git a/engines/titanic/game/pet/pet_position.h b/engines/titanic/game/pet/pet_position.h
index fe28a13..820df41 100644
--- a/engines/titanic/game/pet/pet_position.h
+++ b/engines/titanic/game/pet/pet_position.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CPETPosition : public CGameObject, CEnterRoomMsgTarget {
+class CPETPosition : public CGameObject,
+	public CEnterRoomMsgTarget {
 protected:
 	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
diff --git a/engines/titanic/game/pet/pet_transport.h b/engines/titanic/game/pet/pet_transport.h
index e43cbef..8dd3f3a 100644
--- a/engines/titanic/game/pet/pet_transport.h
+++ b/engines/titanic/game/pet/pet_transport.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CPETTransport : public CGameObject, CEnterRoomMsgTarget {
+class CPETTransport : public CGameObject,
+	public CEnterRoomMsgTarget {
 protected:
 	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
diff --git a/engines/titanic/game/sgt/sgt_state_room.h b/engines/titanic/game/sgt/sgt_state_room.h
index a730473..6e53ad3 100644
--- a/engines/titanic/game/sgt/sgt_state_room.h
+++ b/engines/titanic/game/sgt/sgt_state_room.h
@@ -45,7 +45,8 @@ struct CSGTStateRoomStatics {
 	int _v14;
 };
 
-class CSGTStateRoom : public CBackground, CEnterRoomMsgTarget {
+class CSGTStateRoom : public CBackground,
+	public CEnterRoomMsgTarget {
 private:
 	static CSGTStateRoomStatics *_statics;
 private:
diff --git a/engines/titanic/game/ship_setting.h b/engines/titanic/game/ship_setting.h
index 6ea38be..878feba 100644
--- a/engines/titanic/game/ship_setting.h
+++ b/engines/titanic/game/ship_setting.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CShipSetting : public CBackground, CEnterRoomMsgTarget {
+class CShipSetting : public CBackground,
+	public CEnterRoomMsgTarget {
 private:
 	CString _string3;
 	Point _pos1;
diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h
index 4f62823..c2a18df 100644
--- a/engines/titanic/game/transport/lift.h
+++ b/engines/titanic/game/transport/lift.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CLift : public CTransport, CEnterRoomMsgTarget {
+class CLift : public CTransport,
+	public CEnterRoomMsgTarget {
 private:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/game/transport/pellerator.h b/engines/titanic/game/transport/pellerator.h
index 03e4575..b97d17f 100644
--- a/engines/titanic/game/transport/pellerator.h
+++ b/engines/titanic/game/transport/pellerator.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CPellerator : public CTransport, CEnterRoomMsgTarget {
+class CPellerator : public CTransport,
+	public CEnterRoomMsgTarget {
 private:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/game/up_lighter.h b/engines/titanic/game/up_lighter.h
index add941f..589e279 100644
--- a/engines/titanic/game/up_lighter.h
+++ b/engines/titanic/game/up_lighter.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CUpLighter : public CDropTarget, CEnterRoomMsgTarget {
+class CUpLighter : public CDropTarget,
+	public CEnterRoomMsgTarget {
 private:
 	int _field118;
 	int _field11C;
diff --git a/engines/titanic/moves/enter_bridge.h b/engines/titanic/moves/enter_bridge.h
index 9f7a64c..743960d 100644
--- a/engines/titanic/moves/enter_bridge.h
+++ b/engines/titanic/moves/enter_bridge.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CEnterBridge : public CGameObject, CEnterRoomMsgTarget {
+class CEnterBridge : public CGameObject,
+	public CEnterRoomMsgTarget {
 private:
 	int _value;
 protected:
diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h
index d407ef7..0cad69a 100644
--- a/engines/titanic/npcs/barbot.h
+++ b/engines/titanic/npcs/barbot.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CBarbot : public CTrueTalkNPC, CEnterRoomMsgTarget {
+class CBarbot : public CTrueTalkNPC,
+	public CEnterRoomMsgTarget {
 private:
 	static int _v0;
 private:
diff --git a/engines/titanic/npcs/liftbot.h b/engines/titanic/npcs/liftbot.h
index 373147b..03867cc 100644
--- a/engines/titanic/npcs/liftbot.h
+++ b/engines/titanic/npcs/liftbot.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CLiftBot : public CTrueTalkNPC, CEnterRoomMsgTarget {
+class CLiftBot : public CTrueTalkNPC,
+	public CEnterRoomMsgTarget {
 private:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/sound/auto_music_player.h b/engines/titanic/sound/auto_music_player.h
index bcf4126..da8a386 100644
--- a/engines/titanic/sound/auto_music_player.h
+++ b/engines/titanic/sound/auto_music_player.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CAutoMusicPlayer : public CAutoMusicPlayerBase, CEnterRoomMsgTarget {
+class CAutoMusicPlayer : public CAutoMusicPlayerBase,
+	public CEnterRoomMsgTarget {
 private:
 	CString _string2;
 protected:
diff --git a/engines/titanic/sound/music_player.h b/engines/titanic/sound/music_player.h
index 6b8bc83..4cc510c 100644
--- a/engines/titanic/sound/music_player.h
+++ b/engines/titanic/sound/music_player.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CMusicPlayer : public CGameObject, CEnterRoomMsgTarget {
+class CMusicPlayer : public CGameObject,
+	public CEnterRoomMsgTarget {
 protected:
 	int _fieldBC;
 	CString _string1;
diff --git a/engines/titanic/sound/node_auto_sound_player.h b/engines/titanic/sound/node_auto_sound_player.h
index acc766a..fee4d3d 100644
--- a/engines/titanic/sound/node_auto_sound_player.h
+++ b/engines/titanic/sound/node_auto_sound_player.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CNodeAutoSoundPlayer : public CAutoSoundPlayer, CEnterNodeMsgTarget {
+class CNodeAutoSoundPlayer : public CAutoSoundPlayer,
+	public CEnterNodeMsgTarget {
 private:
 	int _fieldEC;
 protected:
diff --git a/engines/titanic/sound/room_auto_sound_player.h b/engines/titanic/sound/room_auto_sound_player.h
index 82d23a7..c72aff1 100644
--- a/engines/titanic/sound/room_auto_sound_player.h
+++ b/engines/titanic/sound/room_auto_sound_player.h
@@ -28,7 +28,8 @@
 
 namespace Titanic {
 
-class CRoomAutoSoundPlayer : public CAutoSoundPlayer, CEnterRoomMsgTarget {
+class CRoomAutoSoundPlayer : public CAutoSoundPlayer,
+	public CEnterRoomMsgTarget {
 protected:
 	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:


Commit: 83c6ebb46668841310cae3766b57c391f459b05f
    https://github.com/scummvm/scummvm/commit/83c6ebb46668841310cae3766b57c391f459b05f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-24T12:58:00-04:00

Commit Message:
TITANIC: Fix view message handling

Changed paths:
    engines/titanic/core/view_item.cpp
    engines/titanic/events.cpp



diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 414cf30..8b6586f 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -232,8 +232,7 @@ bool CViewItem::handleMouseMsg(CMouseMsg *msg, bool flag) {
 	}
 
 	Common::Array<CGameObject *> gameObjects;
-	CTreeItem *treeItem = scan(this);
-	while (treeItem) {
+	for (CTreeItem *treeItem = scan(this); treeItem; treeItem = treeItem->scan(this)) {
 		CGameObject *gameObject = dynamic_cast<CGameObject *>(treeItem);
 		if (gameObject) {
 			if (gameObject->checkPoint(msg->_mousePos, 0, 1) &&
diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index 1f8ccce..5202d7c 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -102,8 +102,8 @@ uint32 Events::getTicksCount() const {
 	return g_system->getMillis();
 }
 
-#define HANDLE_MESSAGE(method) 	if (_vm->_window->_inputAllowed) { \
-	_vm->_window->_gameManager->_inputTranslator.leftButtonDown(_specialButtons, Point(_mousePos.x, _mousePos.y)); \
+#define HANDLE_MESSAGE(METHOD) 	if (_vm->_window->_inputAllowed) { \
+	_vm->_window->_gameManager->_inputTranslator.METHOD(_specialButtons, Point(_mousePos.x, _mousePos.y)); \
 	_vm->_window->mouseChanged(); \
 	}
 


Commit: 71c0ad236e4a5f9c957c936a6084e4c519e626c7
    https://github.com/scummvm/scummvm/commit/71c0ad236e4a5f9c957c936a6084e4c519e626c7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-24T13:16:21-04:00

Commit Message:
TITANIC: Implement CGameObject::stopMovie

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game_location.cpp
    engines/titanic/movie.cpp
    engines/titanic/movie.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index e4ad4cc..810e439 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -125,8 +125,9 @@ void CGameObject::load(SimpleFile *file) {
 	CNamedItem::load(file);
 }
 
-void CGameObject::fn2() {
-	error("TODO");
+void CGameObject::stopMovie() {
+	if (_surface)
+		_surface->stopMovie();
 }
 
 bool CGameObject::checkPoint(const Point &pt, int v0, int v1) {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 66aa9c4..9d24f8e 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -115,7 +115,10 @@ public:
 	 */
 	virtual void draw(CScreenManager *screenManager);
 
-	void fn2();
+	/**
+	 * Stops any movie currently playing for the object
+	 */
+	void stopMovie();
 
 	bool checkPoint(const Point &pt, int v0, int v1);
 };
diff --git a/engines/titanic/game_location.cpp b/engines/titanic/game_location.cpp
index 23c2ae2..3a1d0c9 100644
--- a/engines/titanic/game_location.cpp
+++ b/engines/titanic/game_location.cpp
@@ -52,11 +52,11 @@ void CGameLocation::load(SimpleFile *file) {
 
 void CGameLocation::setView(CViewItem *view) {
 	if (_view) {
-		for (CTreeItem *treeItem = view; treeItem; 
+		for (CTreeItem *treeItem = _view; treeItem; 
 				treeItem = treeItem->scan(_view)) {
 			CGameObject *obj = dynamic_cast<CGameObject *>(treeItem);
 			if (obj)
-				obj->fn2();
+				obj->stopMovie();
 		}
 	}
 
diff --git a/engines/titanic/movie.cpp b/engines/titanic/movie.cpp
index d7a54d3..04d5723 100644
--- a/engines/titanic/movie.cpp
+++ b/engines/titanic/movie.cpp
@@ -48,7 +48,7 @@ void OSMovie::proc12() {
 	warning("TODO: OSMovie::proc12");
 }
 
-void OSMovie::proc13() {
+void OSMovie::stop() {
 	warning("TODO: OSMovie::proc13");
 }
 
diff --git a/engines/titanic/movie.h b/engines/titanic/movie.h
index 5285508..7752fd8 100644
--- a/engines/titanic/movie.h
+++ b/engines/titanic/movie.h
@@ -26,10 +26,11 @@
 #include "video/avi_decoder.h"
 #include "titanic/core/list.h"
 #include "titanic/core/resource_key.h"
-#include "titanic/video_surface.h"
 
 namespace Titanic {
 
+class CVideoSurface;
+
 class CMovie : public ListItem {
 public:
 	virtual void proc8() = 0;
@@ -37,7 +38,7 @@ public:
 	virtual void proc10() = 0;
 	virtual void proc11() = 0;
 	virtual void proc12() = 0;
-	virtual void proc13() = 0;
+	virtual void stop() = 0;
 	virtual void proc14() = 0;
 	virtual void proc15() = 0;
 	virtual void proc16() = 0;
@@ -60,7 +61,7 @@ public:
 	virtual void proc10();
 	virtual void proc11();
 	virtual void proc12();
-	virtual void proc13();
+	virtual void stop();
 	virtual void proc14();
 	virtual void proc15();
 	virtual void proc16();
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 5cab6d1..864eb6b 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -29,7 +29,7 @@ namespace Titanic {
 int CVideoSurface::_videoSurfaceCounter = 0;
 
 CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
-		_screenManager(screenManager), _rawSurface(nullptr), _field34(nullptr),
+		_screenManager(screenManager), _rawSurface(nullptr), _movie(nullptr),
 		_pendingLoad(false), _blitStyleFlag(false), _blitFlag(false),
 		_field40(nullptr), _field44(4), _field48(0), _field50(1) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
@@ -299,6 +299,11 @@ void OSVideoSurface::shiftColors() {
 	unlock();
 }
 
+void OSVideoSurface::stopMovie() {
+	if (_movie)
+		_movie->stop();
+}
+
 bool OSVideoSurface::loadIfReady() {
 	_videoSurfaceNum = _videoSurfaceCounter;
 
@@ -318,8 +323,8 @@ int OSVideoSurface::freeSurface() {
 		return 0;
 	int surfaceSize = _ddSurface->getSize();
 
-	delete _field34;
-	_field34 = nullptr;
+	delete _movie;
+	_movie = nullptr;
 	delete _ddSurface;
 	_ddSurface = nullptr;
 
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index c6ecf1a..dd150ab 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -27,6 +27,7 @@
 #include "common/array.h"
 #include "titanic/font.h"
 #include "titanic/direct_draw.h"
+#include "titanic/movie.h"
 #include "titanic/rect.h"
 #include "titanic/core/list.h"
 #include "titanic/core/resource_key.h"
@@ -56,7 +57,7 @@ protected:
 	CResourceKey _resourceKey;
 	DirectDrawSurface *_ddSurface;
 	Graphics::ManagedSurface *_rawSurface;
-	void *_field34;
+	CMovie *_movie;
 	bool _pendingLoad;
 	void *_field40;
 	int _field44;
@@ -139,6 +140,11 @@ public:
 	virtual void shiftColors() = 0;
 
 	/**
+	 * Stops any movie currently attached to the surface
+	 */
+	virtual void stopMovie() = 0;
+
+	/**
 	 * Loads the surface's resource if there's one pending
 	 */
 	virtual bool loadIfReady() = 0;
@@ -153,6 +159,8 @@ public:
 	 */
 	virtual int freeSurface() { return 0; }
 
+
+
 	/**
 	 * Blit from another surface
 	 */
@@ -236,6 +244,11 @@ public:
 	virtual void shiftColors();
 
 	/**
+	 * Stops any movie currently attached to the surface
+	 */
+	virtual void stopMovie();
+
+	/**
 	 * Loads the surface's resource if there's one pending
 	 */
 	virtual bool loadIfReady();


Commit: bbc810e909cd3403593be447cfa39db8b7bcefd1
    https://github.com/scummvm/scummvm/commit/bbc810e909cd3403593be447cfa39db8b7bcefd1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-24T13:19:29-04:00

Commit Message:
TITANIC: Fix crash when looking at television

Changed paths:
    engines/titanic/core/view_item.cpp



diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 8b6586f..b0e30f5 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -146,7 +146,8 @@ void CViewItem::enterView(CViewItem *newView) {
 			CPetControl *petControl = nullptr;
 			if (newRoom != nullptr) {
 				petControl = newRoom->getRoot()->getPetControl();
-				petControl->enterNode(newNode);
+				if (petControl)
+					petControl->enterNode(newNode);
 			}
 
 			if (newRoom != oldRoom) {


Commit: fd78a874ccfdbc652241dc4402f6ca96ca188170
    https://github.com/scummvm/scummvm/commit/fd78a874ccfdbc652241dc4402f6ca96ca188170
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-24T13:27:04-04:00

Commit Message:
TITANIC: Added current location display to debugger room command

Changed paths:
    engines/titanic/debugger.cpp



diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp
index 87ce07d..3bd2d0f 100644
--- a/engines/titanic/debugger.cpp
+++ b/engines/titanic/debugger.cpp
@@ -99,8 +99,15 @@ CViewItem *Debugger::findView(CNodeItem *node, const char *name) {
 }
 
 void Debugger::listRooms() {
-	CTreeItem *root = g_vm->_window->_gameManager->_project;
-
+	CGameManager &gm = *g_vm->_window->_gameManager;
+	CTreeItem *root = gm._project;
+	CViewItem *view = gm._gameState._gameLocation.getView();
+	CNodeItem *node = gm._gameState._gameLocation.getNode();
+	CRoomItem *room = gm._gameState._gameLocation.getRoom();
+	debugPrintf("Current location: %s, %s, %s\n", room->getName().c_str(),
+		node->getName().c_str(), view->getName().c_str());
+	
+	debugPrintf("Available rooms:\n");
 	for (CTreeItem *treeItem = root; treeItem; treeItem = treeItem->scan(root)) {
 		CRoomItem *roomItem = dynamic_cast<CRoomItem *>(treeItem);
 		if (roomItem)


Commit: c948e8812ebb619f22adb7794da6dcfb6d5d6b9e
    https://github.com/scummvm/scummvm/commit/c948e8812ebb619f22adb7794da6dcfb6d5d6b9e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-24T21:02:25-04:00

Commit Message:
TITANIC: Support methods needed by CTelevision

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/game/television.cpp
    engines/titanic/game/television.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/messages/messages.cpp
    engines/titanic/messages/messages.h
    engines/titanic/messages/pet_messages.h
    engines/titanic/movie.cpp
    engines/titanic/movie.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/sound/sound.cpp
    engines/titanic/sound/sound.h
    engines/titanic/sound/sound_manager.cpp
    engines/titanic/sound/sound_manager.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 810e439..a1fde3f 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -230,7 +230,13 @@ void CGameObject::loadImage(const CString &name, bool pendingFlag) {
 }
 
 void CGameObject::loadFrame(int frameNumber) {
-	warning("CGameObject::loadFrame");
+	if (frameNumber != -1 && !_resource.empty())
+		loadResource(_resource);
+	
+	if (_surface)
+		_surface->setMovieFrame(frameNumber);
+
+	makeDirty();
 }
 
 void CGameObject::processClipList2() {
@@ -247,4 +253,33 @@ void CGameObject::makeDirty() {
 	makeDirty(_bounds);
 }
 
+bool CGameObject::soundFn1(int val) {
+	if (val != 0 && val != -1) {
+		CGameManager *gameManager = getGameManager();
+		if (gameManager)
+			return gameManager->_sound.fn1(val);
+	}
+
+	return false;
+}
+
+void CGameObject::soundFn2(int val, int val2) {
+	if (val != 0 && val != -1) {
+		CGameManager *gameManager = getGameManager();
+		if (gameManager) {
+			if (val2)
+				gameManager->_sound.fn3(val, 0, val2);
+			else
+				gameManager->_sound.fn2(val);
+		}
+	}
+}
+
+void CGameObject::set5C(int val) {
+	if (val != _field5C) {
+		_field5C = val;
+		makeDirty();
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 9d24f8e..88ea841 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -93,6 +93,10 @@ protected:
 	CVideoSurface *_surface;
 	CString _resource;
 	int _fieldB8;
+protected:
+	bool soundFn1(int val);
+	void soundFn2(int val, int val2);
+	void set5C(int val);
 public:
 	int _field60;
 	CursorId _cursorId;
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 1f7448f..f7c715f 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -850,6 +850,11 @@ DEFFN(CPETSetStarDestinationMsg)
 DEFFN(CPETStarFieldLockMsg)
 DEFFN(CPETStereoFieldOnOffMsg)
 DEFFN(CPETTargetMsg)
+DEFFN(CPETUpMsg)
+DEFFN(CPETDownMsg)
+DEFFN(CPETLeftMsg)
+DEFFN(CPETRightMsg)
+DEFFN(CPETActivateMsg)
 DEFFN(CPanningAwayFromParrotMsg)
 DEFFN(CParrotSpeakMsg)
 DEFFN(CParrotTriesChickenMsg)
@@ -1427,6 +1432,11 @@ void CSaveableObject::initClassList() {
 	ADDFN(CPETStarFieldLockMsg, CMessage);
 	ADDFN(CPETStereoFieldOnOffMsg, CMessage);
 	ADDFN(CPETTargetMsg, CMessage);
+	ADDFN(CPETUpMsg, CPETTargetMsg);
+	ADDFN(CPETDownMsg, CPETTargetMsg);
+	ADDFN(CPETLeftMsg, CPETTargetMsg);
+	ADDFN(CPETRightMsg, CPETTargetMsg);
+	ADDFN(CPETActivateMsg, CPETTargetMsg);
 	ADDFN(CPanningAwayFromParrotMsg, CMessage);
 	ADDFN(CParrotSpeakMsg, CMessage);
 	ADDFN(CParrotTriesChickenMsg, CMessage);
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index a1dcce1..2c985bf 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -31,6 +31,8 @@
 #include "titanic/core/project_item.h"
 #include "titanic/core/view_item.h"
 #include "titanic/core/room_item.h"
+#include "titanic/pet_control/pet_control.h"
+#include "titanic/game_manager.h"
 
 namespace Titanic {
 
@@ -255,4 +257,31 @@ CNamedItem *CTreeItem::findByName(const CString &name, int maxLen) {
 	return nullptr;
 }
 
+int CTreeItem::compareRoomNameTo(const CString &name) {
+	CRoomItem *room = getGameManager()->getRoom();
+	return room->getName().compareToIgnoreCase(name);
+}
+
+void CTreeItem::clearPet() const {
+	CPetControl *petControl = getPetControl();
+	if (petControl)
+		petControl->clear();
+}
+
+CPetControl *CTreeItem::getPetControl() const {
+	return dynamic_cast<CPetControl *>(getDontSaveChild(CPetControl::_type));
+}
+
+CTreeItem *CTreeItem::getDontSaveChild(ClassDef *classDef) const {
+	CProjectItem *root = getRoot();
+	if (!root)
+		return nullptr;
+
+	CDontSaveFileItem *dontSave = root->getDontSaveFileItem();
+	if (!dontSave)
+		return nullptr;
+
+	return dontSave->findChildInstanceOf(classDef);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index e870ad1..a6c09b8 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -30,6 +30,7 @@ namespace Titanic {
 class CGameManager;
 class CDontSaveFileItem;
 class CNamedItem;
+class CPetControl;
 class CProjectItem;
 class CScreenManager;
 
@@ -220,6 +221,27 @@ public:
 	 * Finds a tree item by name
 	 */
 	CNamedItem *findByName(const CString &name, int maxLen = 0);
+
+	/**
+	 * Compare the name of the parent room to the item to a passed string
+	 */
+	int compareRoomNameTo(const CString &name);
+
+	/**
+	 * Clear the PET display
+	 */
+	void clearPet() const;
+	
+	/**
+	 * Returns the PET control
+	 */
+	CPetControl *getPetControl() const;
+
+	/**
+	 * Returns a child of the Dont Save area of the project of the given class
+	 */
+	CTreeItem *getDontSaveChild(ClassDef *classDef) const;
+
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 4c6b38a..102049a 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -69,4 +69,56 @@ void CTelevision::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
+bool CTelevision::handleMessage(CLeaveViewMsg &msg) {
+	return true;
+}
+
+bool CTelevision::handleMessage(CChangeSeasonMsg &msg) {
+	return true; 
+}
+
+bool CTelevision::handleMessage(CEnterViewMsg &msg) {
+	return true;
+}
+
+bool CTelevision::handleMessage(CPETUpMsg &msg) {
+	return true;
+}
+
+bool CTelevision::handleMessage(CPETDownMsg &msg) {
+	return true; 
+}
+
+bool CTelevision::handleMessage(CStatusChangeMsg &msg) {
+	return true;
+}
+
+bool CTelevision::handleMessage(CActMsg &msg) {
+	return true;
+}
+
+bool CTelevision::handleMessage(CPETActivateMsg &msg) {
+	return true;
+}
+
+bool CTelevision::handleMessage(CMovieEndMsg &msg) {
+	return true;
+}
+
+bool CTelevision::handleMessage(CShipSettingMsg &msg) {
+	return true;
+}
+
+bool CTelevision::handleMessage(CTurnOff &msg) {
+	return true;
+}
+
+bool CTelevision::handleMessage(CTurnOn &msg) {
+	return true;
+}
+
+bool CTelevision::handleMessage(CLightsMsg &msg) {
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
index d64c253..04c201e 100644
--- a/engines/titanic/game/television.h
+++ b/engines/titanic/game/television.h
@@ -24,10 +24,25 @@
 #define TITANIC_TELEVISION_H
 
 #include "titanic/core/background.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/pet_messages.h"
 
 namespace Titanic {
 
-class CTelevision : public CBackground {
+class CTelevision : public CBackground,
+	public CLeaveViewMsgTarget,
+	public CChangeSeasonMsgTarget,
+	public CEnterViewMsgTarget,
+	public CPETUpMsgTarget,
+	public CPETDownMsgTarget,
+	public CStatusChangeMsgTarget,
+	public CActMsgTarget,
+	public CPETActivateMsgTarget,
+	public CMovieEndMsgTarget,
+	public CShipSettingMsgTarget,
+	public CTurnOffTarget,
+	public CTurnOnTarget,
+	public CLightsMsgTarget {
 private:
 	static int _v1;
 	static int _v2;
@@ -41,6 +56,20 @@ private:
 	int _fieldE8;
 	int _fieldEC;
 	int _fieldF0;
+protected:
+	virtual bool handleMessage(CLeaveViewMsg &msg);
+	virtual bool handleMessage(CChangeSeasonMsg &msg);
+	virtual bool handleMessage(CEnterViewMsg &msg);
+	virtual bool handleMessage(CPETUpMsg &msg);
+	virtual bool handleMessage(CPETDownMsg &msg);
+	virtual bool handleMessage(CStatusChangeMsg &msg);
+	virtual bool handleMessage(CActMsg &msg);
+	virtual bool handleMessage(CPETActivateMsg &msg);
+	virtual bool handleMessage(CMovieEndMsg &msg);
+	virtual bool handleMessage(CShipSettingMsg &msg);
+	virtual bool handleMessage(CTurnOff &msg);
+	virtual bool handleMessage(CTurnOn &msg);
+	virtual bool handleMessage(CLightsMsg &msg);
 public:
 	CLASSDEF
 	CTelevision();
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 23cb26e..d5547a3 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -213,10 +213,6 @@ void CGameManager::viewChange() {
 	initBounds();
 }
 
-CRoomItem *CGameManager::getRoom() {
-	return _gameState._gameLocation.getRoom();
-}
-
 void CGameManager::frameMessage(CRoomItem *room) {
 	if (room) {
 		// Signal the next frame
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 610c438..6ad0843 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -96,11 +96,6 @@ private:
 	uint _tickCount2;
 private:
 	/**
-	 * Return the current room
-	 */
-	CRoomItem *getRoom();
-
-	/**
 	 * Generates a message for the next game frame
 	 */
 	void frameMessage(CRoomItem *room);
@@ -153,9 +148,22 @@ public:
 	 */
 	void updateDiskTicksCount();
 
+	/**
+	 * Gets the current view
+	 */
 	CViewItem *getView() { return _gameState._gameLocation.getView(); }
 
 	/**
+	 * Gets the current room node
+	 */
+	CNodeItem *getNode() { return _gameState._gameLocation.getNode(); }
+
+	/**
+	 * Gets the current room
+	 */
+	CRoomItem *getRoom() { return _gameState._gameLocation.getRoom(); }
+
+	/**
 	 * Lock the input handler
 	 */
 	void lockInputHandler() { _inputHandler.incLockCount(); }
diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
index 28b8856..1c3d406 100644
--- a/engines/titanic/messages/messages.cpp
+++ b/engines/titanic/messages/messages.cpp
@@ -24,6 +24,7 @@
 #include "titanic/messages/mouse_messages.h"
 #include "titanic/core/game_object.h"
 #include "titanic/core/tree_item.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -67,6 +68,17 @@ bool CMessage::execute(CTreeItem *target, const ClassDef *classDef, int flags) {
 	return result;
 }
 
+bool CMessage::execute(const CString &target, const ClassDef *classDef, int flags) {
+	// Scan for the target by name
+	CProjectItem *project = g_vm->_window->_project;
+	for (CTreeItem *treeItem = project; treeItem; treeItem = treeItem->scan(project)) {
+		if (treeItem->getName().compareToIgnoreCase(target))
+			return execute(treeItem, classDef, flags);
+	}
+
+	return false;
+}
+
 bool CMessage::isMouseMsg() const {
 	return dynamic_cast<const CMouseMsg *>(this) != nullptr;
 }
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index c945ad7..b7a7cd6 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -54,6 +54,13 @@ public:
 	bool execute(CTreeItem *target, const ClassDef *classDef = nullptr,
 		int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED);
 
+	/**
+	 * Executes the message, passing it on to the designated target,
+	 * and optionally it's children
+	 */
+	bool execute(const CString &target, const ClassDef *classDef = nullptr,
+		int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED);
+
 	virtual bool perform(CTreeItem *treeItem) { return false; }
 
 	/**
diff --git a/engines/titanic/messages/pet_messages.h b/engines/titanic/messages/pet_messages.h
index ac9c3cc..caca53d 100644
--- a/engines/titanic/messages/pet_messages.h
+++ b/engines/titanic/messages/pet_messages.h
@@ -42,6 +42,25 @@ MESSAGE1(CPETStarFieldLockMsg, int, value, 0);
 MESSAGE0(CPETStereoFieldOnOffMsg);
 MESSAGE2(CPETTargetMsg, CString, strValue, "", int, numValue, -1);
 
+#define PET_MESSAGE(NAME) MSGTARGET(NAME); \
+	class NAME: public CPETTargetMsg { \
+	public: \
+	NAME() : CPETTargetMsg() {} \
+	NAME(const CString &name, int num) : CPETTargetMsg(name, num) {} \
+	CLASSDEF \
+	static bool isSupportedBy(const CTreeItem *item) { \
+		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
+	virtual bool perform(CTreeItem *treeItem) { \
+		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
+		return dest != nullptr && dest->handleMessage(*this); \
+	} }
+
+PET_MESSAGE(CPETDownMsg);
+PET_MESSAGE(CPETUpMsg);
+PET_MESSAGE(CPETLeftMsg);
+PET_MESSAGE(CPETRightMsg);
+PET_MESSAGE(CPETActivateMsg);
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_PET_MESSAGES_H */
diff --git a/engines/titanic/movie.cpp b/engines/titanic/movie.cpp
index 04d5723..58da09e 100644
--- a/engines/titanic/movie.cpp
+++ b/engines/titanic/movie.cpp
@@ -56,8 +56,14 @@ void OSMovie::proc14() {
 	warning("TODO: OSMovie::proc14");
 }
 
-void OSMovie::proc15() {
-	warning("TODO: OSMovie::proc15");
+void OSMovie::setFrame(uint frameNumber) {
+	warning("TODO: OSMovie::setFrame");
+	/*
+	_aviDecoder.seekToFrame(frameNumber);
+	const Graphics::Surface *s = _aviDecoder.decodeNextFrame();
+
+	_videoSurface->blitFrom(Common::Point(0, 0), s);
+	*/
 }
 
 void OSMovie::proc16() {
@@ -85,13 +91,4 @@ void *OSMovie::proc21() {
 	return nullptr;
 }
 
-void OSMovie::setFrame(uint frameNumber) {
-	/*
-	_aviDecoder.seekToFrame(frameNumber);
-	const Graphics::Surface *s = _aviDecoder.decodeNextFrame();
-	
-	_videoSurface->blitFrom(Common::Point(0, 0), s);
-	*/
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/movie.h b/engines/titanic/movie.h
index 7752fd8..4409712 100644
--- a/engines/titanic/movie.h
+++ b/engines/titanic/movie.h
@@ -40,7 +40,7 @@ public:
 	virtual void proc12() = 0;
 	virtual void stop() = 0;
 	virtual void proc14() = 0;
-	virtual void proc15() = 0;
+	virtual void setFrame(uint frameNumber) = 0;
 	virtual void proc16() = 0;
 	virtual void proc17() = 0;
 	virtual void proc18() = 0;
@@ -63,18 +63,18 @@ public:
 	virtual void proc12();
 	virtual void stop();
 	virtual void proc14();
-	virtual void proc15();
+
+	/**
+	 * Set the current frame number
+	 */
+	virtual void setFrame(uint frameNumber);
+	
 	virtual void proc16();
 	virtual void proc17();
 	virtual void proc18();
 	virtual void proc19();
 	virtual void proc20();
 	virtual void *proc21();
-
-	/**
-	 * Set the current frame number
-	 */
-	void setFrame(uint frameNumber);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 5886ce4..097c72d 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -97,4 +97,9 @@ void CPetControl::enterRoom(CRoomItem *room) {
 	_sub3.enterRoom(room);
 }
 
+void CPetControl::clear() {
+	_field1394 = 0;
+	_string2.clear();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index df529ae..e2b31be 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -94,6 +94,11 @@ public:
 	 * Called when a new room is entered
 	 */
 	void enterRoom(CRoomItem *room);
+
+	/**
+	 * Called to clear the PET display
+	 */
+	void clear();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index 14dba2e..b3b783d 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -47,4 +47,21 @@ void CSound::preEnterView(CViewItem *newView, bool isNewRoom) {
 	warning("CSound::preEnterView");
 }
 
+bool CSound::fn1(int val) {
+	if (val == 0 || val == -1) {
+		if (!_soundManager.proc14())
+			return true;
+	}
+
+	return false;
+}
+
+void CSound::fn2(int val) {
+	warning("TODO: CSound::fn3");
+}
+
+void CSound::fn3(int val, int val2, int val3) {
+	warning("TODO: CSound::fn3");
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index 4c0dab5..fe115f7 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -72,6 +72,10 @@ public:
 	 * Called when the view has been changed
 	 */
 	void preEnterView(CViewItem *newView, bool isNewRoom);
+
+	bool fn1(int val);
+	void fn2(int val);
+	void fn3(int val, int val2, int val3);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index 143dd83..f575411 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -81,8 +81,9 @@ void QSoundManager::proc13() {
 	warning("TODO");
 }
 
-void QSoundManager::proc14() {
+bool QSoundManager::proc14() {
 	warning("TODO");
+	return false;
 }
 
 int QSoundManager::proc15() {
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index 99513ae..29fbb5a 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -48,7 +48,7 @@ public:
 	virtual void proc11() = 0;
 	virtual void proc12() {}
 	virtual void proc13() {}
-	virtual void proc14() = 0;
+	virtual bool proc14() = 0;
 	virtual int proc15() const { return 0; }
 	virtual int proc16() const { return 0; }
 	virtual void WaveMixPump() {}
@@ -111,7 +111,7 @@ public:
 	virtual void proc11();
 	virtual void proc12();
 	virtual void proc13();
-	virtual void proc14();
+	virtual bool proc14();
 	virtual int proc15();
 	virtual int proc16();
 	virtual void WaveMixPump();
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 864eb6b..7a4aba5 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -304,6 +304,11 @@ void OSVideoSurface::stopMovie() {
 		_movie->stop();
 }
 
+void OSVideoSurface::setMovieFrame(uint frameNumber) {
+	if (loadIfReady() && _movie)
+		_movie->setFrame(frameNumber);
+}
+
 bool OSVideoSurface::loadIfReady() {
 	_videoSurfaceNum = _videoSurfaceCounter;
 
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index dd150ab..f3459b4 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -145,6 +145,11 @@ public:
 	virtual void stopMovie() = 0;
 
 	/**
+	 * Sets the movie to the specified frame number
+	 */
+	virtual void setMovieFrame(uint frameNumber) = 0;
+
+	/**
 	 * Loads the surface's resource if there's one pending
 	 */
 	virtual bool loadIfReady() = 0;
@@ -249,6 +254,11 @@ public:
 	virtual void stopMovie();
 
 	/**
+	 * Sets the movie to the specified frame number
+	 */
+	virtual void setMovieFrame(uint frameNumber);
+
+	/**
 	 * Loads the surface's resource if there's one pending
 	 */
 	virtual bool loadIfReady();


Commit: f0a6cf38cff8e79a579454af5bf22d264de3d7f7
    https://github.com/scummvm/scummvm/commit/f0a6cf38cff8e79a579454af5bf22d264de3d7f7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-24T21:12:30-04:00

Commit Message:
TITANIC: Implement television CLeaveViewMsg handler

Changed paths:
    engines/titanic/core/game_object.h
    engines/titanic/game/television.cpp



diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 88ea841..1ccbb7d 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -51,11 +51,6 @@ private:
 	 */
 	void loadImage(const CString &name, bool pendingFlag = true);
 
-	/**
-	 * Loads a frame
-	 */
-	void loadFrame(int frameNumber);
-
 	void processClipList2();
 
 	/**
@@ -94,6 +89,11 @@ protected:
 	CString _resource;
 	int _fieldB8;
 protected:
+	/**
+	 * Loads a frame
+	 */
+	void loadFrame(int frameNumber);
+
 	bool soundFn1(int val);
 	void soundFn2(int val, int val2);
 	void set5C(int val);
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 102049a..08f29df 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -70,6 +70,22 @@ void CTelevision::load(SimpleFile *file) {
 }
 
 bool CTelevision::handleMessage(CLeaveViewMsg &msg) {
+	clearPet();
+	if (_fieldE8) {
+		if (soundFn1(_fieldF0))
+			soundFn2(_fieldF0, 0);
+
+		loadFrame(622);
+		stopMovie();
+		set5C(0);
+		_fieldE8 = 0;
+
+		if (compareRoomNameTo("CSGState")) {
+			CVisibleMsg visibleMsg(1, 0);
+			visibleMsg.execute("Tellypic");
+		}
+	}
+
 	return true;
 }
 


Commit: 02b46202bec88eb21b322fb9480de9eb8965dd01
    https://github.com/scummvm/scummvm/commit/02b46202bec88eb21b322fb9480de9eb8965dd01
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-24T22:09:49-04:00

Commit Message:
TITANIC: Implementing more CTelevision message handlers

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/television.cpp
    engines/titanic/game/television.h
    engines/titanic/messages/messages.h
    engines/titanic/messages/pet_messages.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index a1fde3f..a442f09 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -27,6 +27,7 @@
 #include "titanic/video_surface.h"
 #include "titanic/core/game_object.h"
 #include "titanic/core/resource_key.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -44,7 +45,7 @@ CGameObject::CGameObject(): CNamedItem() {
 	_field50 = 0;
 	_field54 = 0;
 	_field58 = 0;
-	_field5C = 1;
+	_field5C = true;
 	_field60 = 0;
 	_cursorId = CURSOR_1;
 	_field78 = 0;
@@ -105,7 +106,7 @@ void CGameObject::load(SimpleFile *file) {
 		_field48 = file->readNumber();
 		_field4C = file->readNumber();
 		_fieldB8 = file->readNumber();
-		_field5C = file->readNumber();
+		_field5C = file->readNumber() != 0;
 		_field50 = file->readNumber();
 		_field54 = file->readNumber();
 		_field58 = file->readNumber();
@@ -275,11 +276,32 @@ void CGameObject::soundFn2(int val, int val2) {
 	}
 }
 
-void CGameObject::set5C(int val) {
+void CGameObject::set5C(bool val) {
 	if (val != _field5C) {
 		_field5C = val;
 		makeDirty();
 	}
 }
 
+bool CGameObject::petFn1(int val) {
+	CPetControl *pet = getPetControl();
+	return pet ? pet->fn1(val) : true;
+}
+
+void CGameObject::petFn2(int val) {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->fn2(val);
+}
+
+void CGameObject::petFn3(int val) {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->fn3(val);
+}
+
+void CGameObject::fn1(int val1, int val2, int val3) {
+	warning("TODO: CGameObject::fn1");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 1ccbb7d..46ec502 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -74,7 +74,7 @@ protected:
 	int _field50;
 	int _field54;
 	int _field58;
-	int _field5C;
+	bool _field5C;
 	CMovieClipList _clipList1;
 	int _field78;
 	CMovieClipList _clipList2;
@@ -96,7 +96,10 @@ protected:
 
 	bool soundFn1(int val);
 	void soundFn2(int val, int val2);
-	void set5C(int val);
+	void set5C(bool val);
+	bool petFn1(int val);
+	void petFn2(int val);
+	void petFn3(int val);
 public:
 	int _field60;
 	CursorId _cursorId;
@@ -125,6 +128,8 @@ public:
 	void stopMovie();
 
 	bool checkPoint(const Point &pt, int v0, int v1);
+
+	void fn1(int val1, int val2, int val3);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 08f29df..e7a1b8d 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -32,7 +32,7 @@ int CTelevision::_v5;
 int CTelevision::_v6;
 
 CTelevision::CTelevision() : CBackground(), _fieldE0(1),
-	_fieldE4(7), _fieldE8(0), _fieldEC(0), _fieldF0(0) {
+	_fieldE4(7), _isOn(false), _fieldEC(0), _fieldF0(0) {
 }
 
 void CTelevision::save(SimpleFile *file, int indent) const {
@@ -41,7 +41,7 @@ void CTelevision::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_fieldE4, indent);
 	file->writeNumberLine(_v2, indent);
-	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_isOn, indent);
 	file->writeNumberLine(_v3, indent);
 	file->writeNumberLine(_fieldEC, indent);
 	file->writeNumberLine(_v4, indent);
@@ -58,7 +58,7 @@ void CTelevision::load(SimpleFile *file) {
 	_v1 = file->readNumber();
 	_fieldE4 = file->readNumber();
 	_v2 = file->readNumber();
-	_fieldE8 = file->readNumber();
+	_isOn = file->readNumber() != 0;
 	_v3 = file->readNumber();
 	_fieldEC = file->readNumber();
 	_v4 = file->readNumber();
@@ -71,14 +71,14 @@ void CTelevision::load(SimpleFile *file) {
 
 bool CTelevision::handleMessage(CLeaveViewMsg &msg) {
 	clearPet();
-	if (_fieldE8) {
+	if (_isOn) {
 		if (soundFn1(_fieldF0))
 			soundFn2(_fieldF0, 0);
 
 		loadFrame(622);
 		stopMovie();
 		set5C(0);
-		_fieldE8 = 0;
+		_isOn = false;
 
 		if (compareRoomNameTo("CSGState")) {
 			CVisibleMsg visibleMsg(1, 0);
@@ -90,26 +90,88 @@ bool CTelevision::handleMessage(CLeaveViewMsg &msg) {
 }
 
 bool CTelevision::handleMessage(CChangeSeasonMsg &msg) {
+	if (msg._season.compareTo("Autumn")) {
+		_v1 = 545;
+		_v3 = 0;
+	} else if (msg._season.compareTo("Winter")) {
+		_v1 = 503;
+		_v3 = 0;
+	} else if (msg._season.compareTo("Spring")) {
+		_v1 = 517;
+		_v3 = 0;
+	} else if (msg._season.compareTo("Winter")) {
+		_v1 = 531;
+		_v3 = 0;
+	}
+
 	return true; 
 }
 
 bool CTelevision::handleMessage(CEnterViewMsg &msg) {
+	petFn1(2);
+	petFn2(2);
+	petFn3(0);
+	set5C(0);
+	_fieldE0 = 1;
+
 	return true;
 }
 
+static const int FRAMES1[9] = { 0, 0, 56, 112, 168, 224, 280, 336, 392 };
+static const int FRAMES2[8] = { 0, 55, 111, 167, 223, 279, 335, 391 };
+
 bool CTelevision::handleMessage(CPETUpMsg &msg) {
+	if (msg._name == "Television" && _isOn) {
+		if (soundFn1(_fieldF0))
+			soundFn2(_fieldF0, 0);
+
+		_fieldE0 = _fieldE0 % _fieldE4 + 1;
+		stopMovie();
+		fn1(FRAMES1[_fieldE0], FRAMES2[_fieldE0], 4);
+	}
+
 	return true;
 }
 
 bool CTelevision::handleMessage(CPETDownMsg &msg) {
-	return true; 
+	if (msg._name == "Television" && _isOn) {
+		if (soundFn1(_fieldF0))
+			soundFn2(_fieldF0, 0);
+		if (--_fieldE0 < 1)
+			_fieldE0 += _fieldE4;
+
+		_fieldE0 = _fieldE0 % _fieldE4 + 1;
+		stopMovie();
+		fn1(FRAMES1[_fieldE0], FRAMES2[_fieldE0], 4);
+	}
+
+	return true;
 }
 
 bool CTelevision::handleMessage(CStatusChangeMsg &msg) {
+	if (_isOn) {
+		stopMovie();
+		// TODO:
+	}
+	warning("TODO");
+
 	return true;
 }
 
 bool CTelevision::handleMessage(CActMsg &msg) {
+	if (msg._action == "TurnTVOnOff") {
+		_isOn = !_isOn;
+		if (_isOn) {
+			set5C(true);
+			CStatusChangeMsg changeMsg;
+			changeMsg.execute(this);
+		} else {
+			// TODO: Should 5C be a boolean?
+			set5C(_isOn);
+			stopMovie();
+		}
+	}
+
 	return true;
 }
 
diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
index 04c201e..ed41606 100644
--- a/engines/titanic/game/television.h
+++ b/engines/titanic/game/television.h
@@ -53,7 +53,7 @@ private:
 private:
 	int _fieldE0;
 	int _fieldE4;
-	int _fieldE8;
+	bool _isOn;
 	int _fieldEC;
 	int _fieldF0;
 protected:
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index b7a7cd6..493152b 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -252,7 +252,7 @@ public:
 		return dest != nullptr && dest->handleMessage(*this); \
 	} }
 
-MESSAGE1(CActMsg, CString, value, "");
+MESSAGE1(CActMsg, CString, action, "");
 MESSAGE1(CActivationmsg, CString, value, "");
 MESSAGE1(CAddHeadPieceMsg, CString, value, "NULL");
 MESSAGE1(CAnimateMaitreDMsg, int, value, 0);
diff --git a/engines/titanic/messages/pet_messages.h b/engines/titanic/messages/pet_messages.h
index caca53d..7e39056 100644
--- a/engines/titanic/messages/pet_messages.h
+++ b/engines/titanic/messages/pet_messages.h
@@ -40,7 +40,7 @@ MESSAGE0(CPETReceiveMsg);
 MESSAGE0(CPETSetStarDestinationMsg);
 MESSAGE1(CPETStarFieldLockMsg, int, value, 0);
 MESSAGE0(CPETStereoFieldOnOffMsg);
-MESSAGE2(CPETTargetMsg, CString, strValue, "", int, numValue, -1);
+MESSAGE2(CPETTargetMsg, CString, name, "", int, numValue, -1);
 
 #define PET_MESSAGE(NAME) MSGTARGET(NAME); \
 	class NAME: public CPETTargetMsg { \
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 097c72d..920e6b2 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -102,4 +102,17 @@ void CPetControl::clear() {
 	_string2.clear();
 }
 
+bool CPetControl::fn1(int val) {
+	warning("TODO: CPetControl::fn1");
+	return false;
+}
+
+void CPetControl::fn2(int val) {
+	warning("TODO: CPetControl::fn2");
+}
+
+void CPetControl::fn3(int val) {
+	warning("TODO: CPetControl::fn3");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index e2b31be..1beded2 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -99,6 +99,12 @@ public:
 	 * Called to clear the PET display
 	 */
 	void clear();
+
+	bool fn1(int val);
+
+	void fn2(int val);
+
+	void fn3(int val);
 };
 
 } // End of namespace Titanic


Commit: 0b37ac18693c7f51212f250b8a9990071a1dda2b
    https://github.com/scummvm/scummvm/commit/0b37ac18693c7f51212f250b8a9990071a1dda2b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-24T22:40:07-04:00

Commit Message:
TITANIC: Implementing more CTelevision message handlers

Changed paths:
    engines/titanic/game/television.cpp
    engines/titanic/game/television.h
    engines/titanic/messages/messages.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index e7a1b8d..cb59647 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -21,11 +21,12 @@
  */
 
 #include "titanic/game/television.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
 int CTelevision::_v1;
-int CTelevision::_v2;
+bool CTelevision::_turnOn;
 int CTelevision::_v3;
 int CTelevision::_v4;
 int CTelevision::_v5;
@@ -35,12 +36,24 @@ CTelevision::CTelevision() : CBackground(), _fieldE0(1),
 	_fieldE4(7), _isOn(false), _fieldEC(0), _fieldF0(0) {
 }
 
+void CTelevision::init() {
+	_v1 = 531;
+	_turnOn = true;
+	_v3 = 0;
+	_v4 = 27;
+	_v5 = 1;
+	_v6 = 1;
+}
+
+void CTelevision::deinit() {
+}
+
 void CTelevision::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_fieldE4, indent);
-	file->writeNumberLine(_v2, indent);
+	file->writeNumberLine(_turnOn, indent);
 	file->writeNumberLine(_isOn, indent);
 	file->writeNumberLine(_v3, indent);
 	file->writeNumberLine(_fieldEC, indent);
@@ -57,7 +70,7 @@ void CTelevision::load(SimpleFile *file) {
 	_fieldE0 = file->readNumber();
 	_v1 = file->readNumber();
 	_fieldE4 = file->readNumber();
-	_v2 = file->readNumber();
+	_turnOn = file->readNumber() != 0;
 	_isOn = file->readNumber() != 0;
 	_v3 = file->readNumber();
 	_fieldEC = file->readNumber();
@@ -81,7 +94,7 @@ bool CTelevision::handleMessage(CLeaveViewMsg &msg) {
 		_isOn = false;
 
 		if (compareRoomNameTo("CSGState")) {
-			CVisibleMsg visibleMsg(1, 0);
+			CVisibleMsg visibleMsg(true);
 			visibleMsg.execute("Tellypic");
 		}
 	}
@@ -176,26 +189,57 @@ bool CTelevision::handleMessage(CActMsg &msg) {
 }
 
 bool CTelevision::handleMessage(CPETActivateMsg &msg) {
+	if (msg._name == "Television") {
+		CVisibleMsg visibleMsg(_isOn);
+		_isOn = !_isOn;
+
+		if (_isOn) {
+			set5C(true);
+			fn1(0, 55, 0);
+			_fieldE0 = 1;
+		} else {
+			stopMovie();
+			if (soundFn1(_fieldF0))
+				soundFn2(_fieldF0, 0);
+			
+			set5C(false);
+		}
+
+		if (compareRoomNameTo("SGTState"))
+			visibleMsg.execute("Tellypic");
+	}
+
 	return true;
 }
 
 bool CTelevision::handleMessage(CMovieEndMsg &msg) {
+	warning("TODO: CMovieEndMsg");
 	return true;
 }
 
 bool CTelevision::handleMessage(CShipSettingMsg &msg) {
+	_v4 = msg._value;
 	return true;
 }
 
 bool CTelevision::handleMessage(CTurnOff &msg) {
+	_turnOn = false;
 	return true;
 }
 
 bool CTelevision::handleMessage(CTurnOn &msg) {
+	_turnOn = true;
 	return true;
 }
 
 bool CTelevision::handleMessage(CLightsMsg &msg) {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->fn4();
+
+	if (msg._field8 || !_turnOn)
+		_turnOn = true;
+
 	return true;
 }
 
diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
index ed41606..3b44f80 100644
--- a/engines/titanic/game/television.h
+++ b/engines/titanic/game/television.h
@@ -45,7 +45,7 @@ class CTelevision : public CBackground,
 	public CLightsMsgTarget {
 private:
 	static int _v1;
-	static int _v2;
+	static bool _turnOn;
 	static int _v3;
 	static int _v4;
 	static int _v5;
@@ -73,6 +73,8 @@ protected:
 public:
 	CLASSDEF
 	CTelevision();
+	static void init();
+	static void deinit();
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 493152b..77d53f2 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -369,7 +369,7 @@ MESSAGE1(CSetChevRoomBits, int, value, 0);
 MESSAGE0(CSetMusicControlsMsg);
 MESSAGE2(CSetVarMsg, CString, varName, "", int, value, 0);
 MESSAGE2(CSetVolumeMsg, int, value1, 70, int, value2, 0);
-MESSAGE2(CShipSettingMsg, CString, strValue, "", int, numValue, 0);
+MESSAGE2(CShipSettingMsg, int, value, 0, CString, name, "");
 MESSAGE1(CShowTextMsg, CString, value, "NO TEXT INCLUDED!!!");
 MESSAGE2(CSignalObject, CString, strValue, "", int, numValue, 0);
 MESSAGE2(CSpeechFallsFromTreeMsg, int, value1, 0, int, value2, 0);
@@ -405,7 +405,7 @@ MESSAGE1(CUse, int, value, 0);
 MESSAGE1(CUseWithCharMsg, int, value, 0);
 MESSAGE1(CUseWithOtherMsg, int, value, 0);
 MESSAGE1(CVirtualKeyCharMsg, int, value, 0);
-MESSAGE2(CVisibleMsg, int, value1, 1, int, value2, 0);
+MESSAGE1(CVisibleMsg, bool, visible, true);
 
 } // End of namespace Titanic
 
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 920e6b2..f3e78a2 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -115,4 +115,8 @@ void CPetControl::fn3(int val) {
 	warning("TODO: CPetControl::fn3");
 }
 
+void CPetControl::fn4() {
+	warning("TODO: CPetControl::fn4");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 1beded2..b076273 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -105,6 +105,8 @@ public:
 	void fn2(int val);
 
 	void fn3(int val);
+
+	void fn4();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 4d43199..82d0997 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -33,6 +33,7 @@
 #include "titanic/carry/hose.h"
 #include "titanic/core/saveable_object.h"
 #include "titanic/game/get_lift_eye2.h"
+#include "titanic/game/television.h"
 #include "titanic/game/parrot/parrot_lobby_object.h"
 #include "titanic/game/sgt/sgt_navigation.h"
 #include "titanic/game/sgt/sgt_state_room.h"
@@ -84,6 +85,7 @@ void TitanicEngine::initialize() {
 	CSGTStateRoom::init();
 	CExitPellerator::init();
 	CEnterExitSecClassMiniLift::init();
+	CTelevision::init();
 
 	_debugger = new Debugger(this);
 	_events = new Events(this);
@@ -101,6 +103,7 @@ void TitanicEngine::deinitialize() {
 	CSGTStateRoom::deinit();
 	CExitPellerator::deinit();
 	CEnterExitSecClassMiniLift::deinit();
+	CTelevision::deinit();
 }
 
 Common::Error TitanicEngine::run() {


Commit: 73204984098c96ecc28a1367a5da9613e7103a35
    https://github.com/scummvm/scummvm/commit/73204984098c96ecc28a1367a5da9613e7103a35
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-25T00:01:15-04:00

Commit Message:
TITANIC: Implementing more CTelevision code, CGameState movie list

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/list.h
    engines/titanic/game/television.cpp
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/movie.cpp
    engines/titanic/movie.h
    engines/titanic/titanic.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index a442f09..a215633 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -304,4 +304,20 @@ void CGameObject::fn1(int val1, int val2, int val3) {
 	warning("TODO: CGameObject::fn1");
 }
 
+void CGameObject::changeStatus(int newStatus) {
+	if (_frameNumber == -1 && !_resource.empty()) {
+		loadResource(_resource);
+		_resource.clear();
+	}
+
+	CVideoSurface *surface = (newStatus & 4) ? _surface : nullptr;
+	if (_surface) {
+		_surface->proc32(newStatus, surface);
+		
+		if (newStatus & 0x10) {
+			getGameManager()->_gameState.addMovie(_surface->_movie);
+		}
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 46ec502..2f56f59 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -130,6 +130,11 @@ public:
 	bool checkPoint(const Point &pt, int v0, int v1);
 
 	void fn1(int val1, int val2, int val3);
+
+	/**
+	 * Change the object's status
+	 */
+	void changeStatus(int newStatus);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/list.h b/engines/titanic/core/list.h
index e3623c1..63bd622 100644
--- a/engines/titanic/core/list.h
+++ b/engines/titanic/core/list.h
@@ -71,6 +71,8 @@ public:
 template<typename T>
 class List : public CSaveableObject, public Common::List<T *> {
 public:
+	virtual ~List() { destroyContents(); }
+
 	/**
 	 * Save the data for the class to file
 	 */
@@ -145,6 +147,16 @@ public:
 		Common::List<T *>::push_back(item);
 		return item;
 	}
+
+	bool contains(const T *item) const {
+		for (Common::List<T *>::const_iterator i = Common::List<T *>::begin(); 
+				i != Common::List<T *>::end(); ++i) {
+			if (*i == item)
+				return true;
+		}
+
+		return false;
+	}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index cb59647..8149b8d 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -164,7 +164,7 @@ bool CTelevision::handleMessage(CPETDownMsg &msg) {
 bool CTelevision::handleMessage(CStatusChangeMsg &msg) {
 	if (_isOn) {
 		stopMovie();
-		// TODO:
+		changeStatus(1);
 	}
 	warning("TODO");
 
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 2885b3a..d191d98 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -27,9 +27,18 @@
 
 namespace Titanic {
 
-bool CGameStateList::isViewChanging() const {
-	warning("TODO: CGameStateList::isViewChanging");
-	return false;
+bool CGameStateMovieList::clear() {
+	for (iterator i = begin(); i != end(); ) {
+		CMovieListItem *listItem = *i;
+		++i;
+
+		if (!g_vm->_movieList.contains(listItem->_item)) {
+			remove(listItem);
+			delete listItem;
+		}
+	}
+
+	return size() > 0;
 }
 
 /*------------------------------------------------------------------------*/
@@ -98,20 +107,20 @@ void CGameState::enterNode() {
 
 void CGameState::enterView() {
 	CViewItem *oldView = _gameLocation.getView();
-	CViewItem *newView = _list._view;
+	CViewItem *newView = _movieList._view;
 	oldView->preEnterView(newView);
 
 	_gameManager->_gameView->setView(newView);
 	CRoomItem *oldRoom = oldView->findNode()->findRoom();
 	CRoomItem *newRoom = newView->findNode()->findRoom();
-	_gameManager->playClip(_list._movieClip, oldRoom, newRoom);
+	_gameManager->playClip(_movieList._movieClip, oldRoom, newRoom);
 
 	_gameManager->_sound.preEnterView(newView, newRoom != oldRoom);
 	_gameManager->dec54();
 	oldView->enterView(newView);
 
-	_list._view = nullptr;
-	_list._movieClip = nullptr;
+	_movieList._view = nullptr;
+	_movieList._movieClip = nullptr;
 }
 
 void CGameState::triggerLink(CLinkItem *link) {
@@ -128,8 +137,8 @@ void CGameState::changeView(CViewItem *newView, CMovieClip *clip) {
 		clip = nullptr;
 
 	if (_mode == GSMODE_2) {
-		_list._view = newView;
-		_list._movieClip = clip;
+		_movieList._view = newView;
+		_movieList._movieClip = clip;
 	} else {
 		oldView->preEnterView(newView);
 		_gameManager->_gameView->setView(newView);
@@ -147,11 +156,16 @@ void CGameState::changeView(CViewItem *newView, CMovieClip *clip) {
 }
 
 void CGameState::checkForViewChange() {
-	if (_mode == GSMODE_2 && _list.isViewChanging()) {
+	if (_mode == GSMODE_2 && _movieList.clear()) {
 		setMode(GSMODE_1);
-		if (_list._view)
+		if (_movieList._view)
 			enterView();
 	}
 }
 
+void CGameState::addMovie(CMovie *movie) {
+	_movieList.push_back(new CMovieListItem(movie));
+	setMode(GSMODE_2);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 49bcbcd..49180aa 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -27,6 +27,7 @@
 #include "titanic/core/link_item.h"
 #include "titanic/simple_file.h"
 #include "titanic/game_location.h"
+#include "titanic/movie.h"
 
 namespace Titanic {
 
@@ -34,21 +35,25 @@ class CGameManager;
 
 enum GameStateMode { GSMODE_0 = 0, GSMODE_1 = 1, GSMODE_2 = 2, GSMODE_3 = 3, GSMODE_4 = 4, GSMODE_5 = 5 };
 
-class CGameStateList : public List<ListItem> {
+PTR_LIST_ITEM(CMovie);
+class CGameStateMovieList : public List<CMovieListItem> {
 public:
 	CViewItem *_view;
 	CMovieClip *_movieClip;
 public:
-	CGameStateList() : List<ListItem>(), _view(nullptr), _movieClip(nullptr) {}
+	CGameStateMovieList() : List<CMovieListItem>(), _view(nullptr), _movieClip(nullptr) {}
 
-	bool isViewChanging() const;
+	/**
+	 * Clear the movie list
+	 */
+	bool clear();
 };
 
 class CGameState {
 public:
 	CGameManager *_gameManager;
 	CGameLocation _gameLocation;
-	CGameStateList _list;
+	CGameStateMovieList _movieList;
 	int _field8;
 	int _fieldC;
 	GameStateMode _mode;
@@ -108,6 +113,11 @@ public:
 	 * Check for whether it's time to change the active view
 	 */
 	void checkForViewChange();
+
+	/**
+	 * Adds a movie to the movie list
+	 */
+	void addMovie(CMovie *movie);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/movie.cpp b/engines/titanic/movie.cpp
index 58da09e..09c02a7 100644
--- a/engines/titanic/movie.cpp
+++ b/engines/titanic/movie.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/movie.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -28,7 +29,7 @@ OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) : _videoSurfa
 //	_aviDecoder.loadFile(name.getString());
 }
 
-void OSMovie::proc8() {
+void OSMovie::proc8(int v1, CVideoSurface *surface) {
 	warning("TODO: OSMovie::proc8");
 }
 
@@ -91,4 +92,10 @@ void *OSMovie::proc21() {
 	return nullptr;
 }
 
+bool OSMovie::isInGlobalList() const {
+	return g_vm->_movieList.contains(this);
+}
+
+/*------------------------------------------------------------------------*/
+
 } // End of namespace Titanic
diff --git a/engines/titanic/movie.h b/engines/titanic/movie.h
index 4409712..4a5777a 100644
--- a/engines/titanic/movie.h
+++ b/engines/titanic/movie.h
@@ -33,7 +33,7 @@ class CVideoSurface;
 
 class CMovie : public ListItem {
 public:
-	virtual void proc8() = 0;
+	virtual void proc8(int v1, CVideoSurface *surface) = 0;
 	virtual void proc9() = 0;
 	virtual void proc10() = 0;
 	virtual void proc11() = 0;
@@ -56,7 +56,7 @@ private:
 public:
 	OSMovie(const CResourceKey &name, CVideoSurface *surface);
 
-	virtual void proc8();
+	virtual void proc8(int v1, CVideoSurface *surface);
 	virtual void proc9();
 	virtual void proc10();
 	virtual void proc11();
@@ -75,6 +75,12 @@ public:
 	virtual void proc19();
 	virtual void proc20();
 	virtual void *proc21();
+
+	bool isInGlobalList() const;
+};
+
+class CGlobalMovies : public List<CMovie> {
+public:
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 94ba316..512dfc3 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -33,6 +33,7 @@
 #include "titanic/debugger.h"
 #include "titanic/events.h"
 #include "titanic/files_manager.h"
+#include "titanic/movie.h"
 #include "titanic/screen_manager.h"
 #include "titanic/main_game_window.h"
 
@@ -101,6 +102,7 @@ public:
 	OSScreenManager *_screenManager;
 	CMainGameWindow *_window;
 	Common::RandomSource _randomSource;
+	CGlobalMovies _movieList;
 public:
 	TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
 	virtual ~TitanicEngine();
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 7a4aba5..e8f0e03 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -299,6 +299,11 @@ void OSVideoSurface::shiftColors() {
 	unlock();
 }
 
+void OSVideoSurface::proc32(int v1, CVideoSurface *surface) {
+	if (loadIfReady() && _movie)
+		_movie->proc8(v1, surface);
+}
+
 void OSVideoSurface::stopMovie() {
 	if (_movie)
 		_movie->stop();
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index f3459b4..b2390fb 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -57,7 +57,6 @@ protected:
 	CResourceKey _resourceKey;
 	DirectDrawSurface *_ddSurface;
 	Graphics::ManagedSurface *_rawSurface;
-	CMovie *_movie;
 	bool _pendingLoad;
 	void *_field40;
 	int _field44;
@@ -66,6 +65,7 @@ protected:
 	int _field50;
 	int _lockCount;
 public:
+	CMovie *_movie;
 	bool _blitFlag;
 	bool _blitStyleFlag;
 public:
@@ -139,6 +139,8 @@ public:
 	 */
 	virtual void shiftColors() = 0;
 
+	virtual void proc32(int v1, CVideoSurface *surface) = 0;
+
 	/**
 	 * Stops any movie currently attached to the surface
 	 */
@@ -248,6 +250,8 @@ public:
 	 */
 	virtual void shiftColors();
 
+	virtual void proc32(int v1, CVideoSurface *surface);
+
 	/**
 	 * Stops any movie currently attached to the surface
 	 */


Commit: 448cc158c7569e56f692294b97f4fc7a7ffc5baa
    https://github.com/scummvm/scummvm/commit/448cc158c7569e56f692294b97f4fc7a7ffc5baa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-28T18:38:17-04:00

Commit Message:
TITANIC: Fleshed out CStartAction class

Changed paths:
    engines/titanic/game/start_action.cpp
    engines/titanic/game/start_action.h



diff --git a/engines/titanic/game/start_action.cpp b/engines/titanic/game/start_action.cpp
index 9bafd01..05ceb9d 100644
--- a/engines/titanic/game/start_action.cpp
+++ b/engines/titanic/game/start_action.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/game/start_action.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
@@ -29,18 +30,30 @@ CStartAction::CStartAction() : CBackground() {
 
 void CStartAction::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string3, indent);
-	file->writeQuotedLine(_string4, indent);
+	file->writeQuotedLine(_msgTarget, indent);
+	file->writeQuotedLine(_msgAction, indent);
 
 	CBackground::save(file, indent);
 }
 
 void CStartAction::load(SimpleFile *file) {
 	file->readNumber();
-	_string3 = file->readString();
-	_string4 = file->readString();
+	_msgTarget = file->readString();
+	_msgAction = file->readString();
 
 	CBackground::load(file);
 }
 
+bool CStartAction::handleMessage(CMouseButtonDownMsg &msg) {
+	// Dispatch the desired action to the desired target
+	CActMsg actMsg(_msgAction);
+	actMsg.execute(_msgTarget);
+
+	return true;
+}
+
+bool CStartAction::handleMessage(CMouseButtonUpMsg &msg) {
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/start_action.h b/engines/titanic/game/start_action.h
index fc7a2ea..2b19e77 100644
--- a/engines/titanic/game/start_action.h
+++ b/engines/titanic/game/start_action.h
@@ -24,13 +24,19 @@
 #define TITANIC_START_ACTION_H
 
 #include "titanic/core/background.h"
+#include "titanic/messages/mouse_messages.h"
 
 namespace Titanic {
 
-class CStartAction : public CBackground {
+class CStartAction : public CBackground,
+	public CMouseButtonDownMsgTarget,
+	public CMouseButtonUpMsgTarget {
 protected:
-	CString _string3;
-	CString _string4;
+	CString _msgTarget;
+	CString _msgAction;
+protected:
+	virtual bool handleMessage(CMouseButtonDownMsg &msg);
+	virtual bool handleMessage(CMouseButtonUpMsg &msg);
 public:
 	CLASSDEF
 	CStartAction();


Commit: 447eb31a6c6abebcd72ff07bd5539aa17db86057
    https://github.com/scummvm/scummvm/commit/447eb31a6c6abebcd72ff07bd5539aa17db86057
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-28T18:46:41-04:00

Commit Message:
TITANIC: Fleshed out CDeadArea class

Changed paths:
    engines/titanic/game/dead_area.h



diff --git a/engines/titanic/game/dead_area.h b/engines/titanic/game/dead_area.h
index 4abcd58d..c696c84 100644
--- a/engines/titanic/game/dead_area.h
+++ b/engines/titanic/game/dead_area.h
@@ -24,10 +24,19 @@
 #define TITANIC_DEAD_AREA_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/mouse_messages.h"
 
 namespace Titanic {
 
-class CDeadArea : public CGameObject {
+/**
+ * Implements a non-responsive screen area
+ */
+class CDeadArea : public CGameObject,
+	public CMouseButtonDownMsgTarget,
+	public CMouseButtonUpMsgTarget {
+protected:
+	virtual bool handleMessage(CMouseButtonDownMsg &msg) { return true; }
+	virtual bool handleMessage(CMouseButtonUpMsg &msg) { return true; }
 public:
 	CLASSDEF
 	CDeadArea();


Commit: 471737a41a4f75a65ed0f7e49f6b30e361232bae
    https://github.com/scummvm/scummvm/commit/471737a41a4f75a65ed0f7e49f6b30e361232bae
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-28T22:25:15-04:00

Commit Message:
TITANIC: Implemented CCDROM and various support stuff

Changed paths:
    engines/titanic/core/background.cpp
    engines/titanic/core/background.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/game/cdrom.cpp
    engines/titanic/game/cdrom.h
    engines/titanic/game/cdrom_tray.cpp
    engines/titanic/game/cdrom_tray.h
    engines/titanic/game/television.cpp
    engines/titanic/messages/messages.h
    engines/titanic/messages/mouse_messages.h



diff --git a/engines/titanic/core/background.cpp b/engines/titanic/core/background.cpp
index 63aaf30..ea3bdb0 100644
--- a/engines/titanic/core/background.cpp
+++ b/engines/titanic/core/background.cpp
@@ -49,4 +49,16 @@ void CBackground::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CBackground::handleMessage(CStatusChangeMsg &msg) {
+	error("TODO: CBackground::handleMessage");
+}
+
+bool CBackground::handleMessage(CSetFrameMsg &msg) {
+	error("TODO: CBackground::handleMessage");
+}
+
+bool CBackground::handleMessage(CVisibleMsg &msg) {
+	error("TODO: CBackground::handleMessage");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/background.h b/engines/titanic/core/background.h
index 4ce5651..bd8f949 100644
--- a/engines/titanic/core/background.h
+++ b/engines/titanic/core/background.h
@@ -24,16 +24,24 @@
 #define TITANIC_BACKGROUND_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CBackground : public CGameObject {
+class CBackground : public CGameObject,
+	public CStatusChangeMsgTarget,
+	public CSetFrameMsgTarget,
+	public CVisibleMsgTarget {
 protected:
 	int _fieldBC;
 	int _fieldC0;
 	CString _string1;
 	CString _string2;
 	int _fieldDC;
+protected:
+	virtual bool handleMessage(CStatusChangeMsg &msg);
+	virtual bool handleMessage(CSetFrameMsg &msg);
+	virtual bool handleMessage(CVisibleMsg &msg);
 public:
 	CLASSDEF
 	CBackground();
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index a215633..8343645 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -45,7 +45,7 @@ CGameObject::CGameObject(): CNamedItem() {
 	_field50 = 0;
 	_field54 = 0;
 	_field58 = 0;
-	_field5C = true;
+	_visible = true;
 	_field60 = 0;
 	_cursorId = CURSOR_1;
 	_field78 = 0;
@@ -54,8 +54,6 @@ CGameObject::CGameObject(): CNamedItem() {
 	_field94 = 0;
 	_field98 = 0;
 	_field9C = 0;
-	_fieldA0 = 0;
-	_fieldA4 = 0;
 	_surface = nullptr;
 	_fieldB8 = 0;
 }
@@ -106,7 +104,7 @@ void CGameObject::load(SimpleFile *file) {
 		_field48 = file->readNumber();
 		_field4C = file->readNumber();
 		_fieldB8 = file->readNumber();
-		_field5C = file->readNumber() != 0;
+		_visible = file->readNumber() != 0;
 		_field50 = file->readNumber();
 		_field54 = file->readNumber();
 		_field58 = file->readNumber();
@@ -137,7 +135,7 @@ bool CGameObject::checkPoint(const Point &pt, int v0, int v1) {
 }
 
 void CGameObject::draw(CScreenManager *screenManager) {
-	if (!_field5C)
+	if (!_visible)
 		return;
 	if (_v1) {
 		error("TODO: Block in CGameObject::draw");
@@ -276,9 +274,9 @@ void CGameObject::soundFn2(int val, int val2) {
 	}
 }
 
-void CGameObject::set5C(bool val) {
-	if (val != _field5C) {
-		_field5C = val;
+void CGameObject::setVisible(bool val) {
+	if (val != _visible) {
+		_visible = val;
 		makeDirty();
 	}
 }
@@ -320,4 +318,28 @@ void CGameObject::changeStatus(int newStatus) {
 	}
 }
 
+void CGameObject::savePosition() {
+	_savedPos = _bounds;
+}
+
+void CGameObject::resetPosition() {
+	setPosition(_savedPos);
+}
+
+void CGameObject::setPosition(const Common::Point &newPos) {
+	makeDirty();
+	_bounds.moveTo(newPos);
+	makeDirty();
+}
+
+bool CGameObject::checkStartDragging(CMouseDragStartMsg *msg) {
+	if (_visible && checkPoint(msg->_mousePos, msg->_field14, 1)) {
+		savePosition();
+		msg->_dragItem = this;
+		return true;
+	} else {
+		return false;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 2f56f59..ced8663 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -31,6 +31,7 @@
 namespace Titanic {
 
 class CVideoSurface;
+class CMouseDragStartMsg;
 
 class CGameObject : public CNamedItem {
 public:
@@ -74,7 +75,7 @@ protected:
 	int _field50;
 	int _field54;
 	int _field58;
-	bool _field5C;
+	bool _visible;
 	CMovieClipList _clipList1;
 	int _field78;
 	CMovieClipList _clipList2;
@@ -83,8 +84,7 @@ protected:
 	int _field94;
 	int _field98;
 	int _field9C;
-	int _fieldA0;
-	int _fieldA4;
+	Common::Point _savedPos;
 	CVideoSurface *_surface;
 	CString _resource;
 	int _fieldB8;
@@ -94,9 +94,24 @@ protected:
 	 */
 	void loadFrame(int frameNumber);
 
+	/**
+	 * Saves the current position the object is located at
+	 */
+	void savePosition();
+
+	/**
+	 * Resets the object back to the previously saved starting position
+	 */
+	void resetPosition();
+
+	/**
+	 * Check for starting to drag the object
+	 */
+	bool checkStartDragging(CMouseDragStartMsg *msg);
+
 	bool soundFn1(int val);
 	void soundFn2(int val, int val2);
-	void set5C(bool val);
+	void setVisible(bool val);
 	bool petFn1(int val);
 	void petFn2(int val);
 	void petFn3(int val);
@@ -135,6 +150,11 @@ public:
 	 * Change the object's status
 	 */
 	void changeStatus(int newStatus);
+
+	/**
+	 * Set the position of the object
+	 */
+	void setPosition(const Common::Point &newPos);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index f7c715f..022a72b 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -897,6 +897,7 @@ DEFFN(CSetChevLiftBits)
 DEFFN(CSetChevPanelBitMsg)
 DEFFN(CSetChevPanelButtonsMsg)
 DEFFN(CSetChevRoomBits)
+DEFFN(CSetFrameMsg);
 DEFFN(CSetMusicControlsMsg)
 DEFFN(CSetVarMsg)
 DEFFN(CSetVolumeMsg)
@@ -1479,6 +1480,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CSetChevPanelBitMsg, CMessage);
 	ADDFN(CSetChevPanelButtonsMsg, CMessage);
 	ADDFN(CSetChevRoomBits, CMessage);
+	ADDFN(CSetFrameMsg, CMessage);
 	ADDFN(CSetMusicControlsMsg, CMessage);
 	ADDFN(CSetVarMsg, CMessage);
 	ADDFN(CSetVolumeMsg, CMessage);
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 2c985bf..081c580 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -284,4 +284,9 @@ CTreeItem *CTreeItem::getDontSaveChild(ClassDef *classDef) const {
 	return dontSave->findChildInstanceOf(classDef);
 }
 
+CRoomItem *CTreeItem::getRoom() const {
+	CGameManager *gameManager = getGameManager();
+	return gameManager ? gameManager->getRoom() : nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index a6c09b8..f5e28f1 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -33,6 +33,7 @@ class CNamedItem;
 class CPetControl;
 class CProjectItem;
 class CScreenManager;
+class CRoomItem;
 
 class CTreeItem: public CMessageTarget {
 private:
@@ -242,6 +243,10 @@ public:
 	 */
 	CTreeItem *getDontSaveChild(ClassDef *classDef) const;
 
+	/**
+	 * Return the current room
+	 */
+	CRoomItem *getRoom() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/cdrom.cpp b/engines/titanic/game/cdrom.cpp
index 40e8ed0..d4e4eac 100644
--- a/engines/titanic/game/cdrom.cpp
+++ b/engines/titanic/game/cdrom.cpp
@@ -21,6 +21,8 @@
  */
 
 #include "titanic/game/cdrom.h"
+#include "titanic/core/room_item.h"
+#include "titanic/game/cdrom_tray.h"
 
 namespace Titanic {
 
@@ -29,14 +31,50 @@ CCDROM::CCDROM() : CGameObject() {
 
 void CCDROM::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
-	file->writePoint(_pos1, indent);
+	file->writePoint(_tempPos, indent);
 	CGameObject::save(file, indent);
 }
 
 void CCDROM::load(SimpleFile *file) {
 	file->readNumber();
-	_pos1 = file->readPoint();
+	_tempPos = file->readPoint();
 	CGameObject::load(file);
 }
 
+bool CCDROM::handleMessage(CMouseDragStartMsg &msg) {
+	if (checkStartDragging(&msg)) {
+		_tempPos = msg._mousePos - _bounds;
+		setPosition(msg._mousePos - _tempPos);
+		return true;
+	} else {
+		return false;
+	}
+}
+
+bool CCDROM::handleMessage(CMouseDragEndMsg &msg) {
+	if (msg._dropTarget && msg._dropTarget->getName() == "newComputer") {
+		CCDROMTray *newTray = dynamic_cast<CCDROMTray *>(getRoom()->findByName("newTray"));
+
+		if (newTray->_state && newTray->_string1 == "None") {
+			CActMsg actMsg(getName());
+			actMsg.execute(newTray);
+		}
+	}
+
+	resetPosition();
+	return true;
+}
+
+bool CCDROM::handleMessage(CMouseDragMoveMsg &msg) {
+	setPosition(msg._mousePos - _tempPos);
+	return true;
+}
+
+bool CCDROM::handleMessage(CActMsg &msg) {
+	if (msg._action == "Ejected")
+		setVisible(true);
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/cdrom.h b/engines/titanic/game/cdrom.h
index c1280f6..61bada0 100644
--- a/engines/titanic/game/cdrom.h
+++ b/engines/titanic/game/cdrom.h
@@ -24,12 +24,23 @@
 #define TITANIC_CDROM_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
 
 namespace Titanic {
 
-class CCDROM : public CGameObject {
+class CCDROM : public CGameObject,
+	public CMouseDragStartMsgTarget,
+	public CMouseDragEndMsgTarget,
+	public CMouseDragMoveMsgTarget,
+	public CActMsgTarget {
 private:
-	Point _pos1;
+	Point _tempPos;
+protected:
+	virtual bool handleMessage(CMouseDragStartMsg &msg);
+	virtual bool handleMessage(CMouseDragEndMsg &msg);
+	virtual bool handleMessage(CMouseDragMoveMsg &msg);
+	virtual bool handleMessage(CActMsg &msg);
 public:
 	CLASSDEF
 	CCDROM();
diff --git a/engines/titanic/game/cdrom_tray.cpp b/engines/titanic/game/cdrom_tray.cpp
index 32eea06..fcb65fd 100644
--- a/engines/titanic/game/cdrom_tray.cpp
+++ b/engines/titanic/game/cdrom_tray.cpp
@@ -24,12 +24,12 @@
 
 namespace Titanic {
 
-CCDROMTray::CCDROMTray() : CGameObject(), _fieldBC(0) {
+CCDROMTray::CCDROMTray() : CGameObject(), _state(0) {
 }
 
 void CCDROMTray::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_state, indent);
 	file->writeQuotedLine(_string1, indent);
 
 	CGameObject::save(file, indent);
@@ -37,7 +37,7 @@ void CCDROMTray::save(SimpleFile *file, int indent) const {
 
 void CCDROMTray::load(SimpleFile *file) {
 	file->readNumber();
-	_fieldBC = file->readNumber();
+	_state = file->readNumber();
 	_string1 = file->readString();
 
 	CGameObject::load(file);
diff --git a/engines/titanic/game/cdrom_tray.h b/engines/titanic/game/cdrom_tray.h
index 85d26c5..b5c4b37 100644
--- a/engines/titanic/game/cdrom_tray.h
+++ b/engines/titanic/game/cdrom_tray.h
@@ -28,8 +28,8 @@
 namespace Titanic {
 
 class CCDROMTray : public CGameObject {
-private:
-	int _fieldBC;
+public:
+	int _state;
 	CString _string1;
 public:
 	CLASSDEF
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 8149b8d..ffec1bc 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -90,7 +90,7 @@ bool CTelevision::handleMessage(CLeaveViewMsg &msg) {
 
 		loadFrame(622);
 		stopMovie();
-		set5C(0);
+		setVisible(0);
 		_isOn = false;
 
 		if (compareRoomNameTo("CSGState")) {
@@ -124,7 +124,7 @@ bool CTelevision::handleMessage(CEnterViewMsg &msg) {
 	petFn1(2);
 	petFn2(2);
 	petFn3(0);
-	set5C(0);
+	setVisible(0);
 	_fieldE0 = 1;
 
 	return true;
@@ -175,12 +175,12 @@ bool CTelevision::handleMessage(CActMsg &msg) {
 	if (msg._action == "TurnTVOnOff") {
 		_isOn = !_isOn;
 		if (_isOn) {
-			set5C(true);
+			setVisible(true);
 			CStatusChangeMsg changeMsg;
 			changeMsg.execute(this);
 		} else {
 			// TODO: Should 5C be a boolean?
-			set5C(_isOn);
+			setVisible(_isOn);
 			stopMovie();
 		}
 	}
@@ -194,7 +194,7 @@ bool CTelevision::handleMessage(CPETActivateMsg &msg) {
 		_isOn = !_isOn;
 
 		if (_isOn) {
-			set5C(true);
+			setVisible(true);
 			fn1(0, 55, 0);
 			_fieldE0 = 1;
 		} else {
@@ -202,7 +202,7 @@ bool CTelevision::handleMessage(CPETActivateMsg &msg) {
 			if (soundFn1(_fieldF0))
 				soundFn2(_fieldF0, 0);
 			
-			set5C(false);
+			setVisible(false);
 		}
 
 		if (compareRoomNameTo("SGTState"))
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 77d53f2..99df239 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -366,6 +366,7 @@ MESSAGE1(CSetChevLiftBits, int, value, 0);
 MESSAGE2(CSetChevPanelBitMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CSetChevPanelButtonsMsg, int, value, 0);
 MESSAGE1(CSetChevRoomBits, int, value, 0);
+MESSAGE1(CSetFrameMsg, int, frameNumber, 0);
 MESSAGE0(CSetMusicControlsMsg);
 MESSAGE2(CSetVarMsg, CString, varName, "", int, value, 0);
 MESSAGE2(CSetVolumeMsg, int, value1, 70, int, value2, 0);
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 7fe7ef9..4194381 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -179,12 +179,12 @@ public:
 MSGTARGET(CMouseDragEndMsg);
 class CMouseDragEndMsg : public CMouseDragMsg {
 public:
-	CTreeItem *_dragItem;
+	CTreeItem *_dropTarget;
 public:
 	CLASSDEF
-	CMouseDragEndMsg() : CMouseDragMsg(), _dragItem(nullptr) {}
+	CMouseDragEndMsg() : CMouseDragMsg(), _dropTarget(nullptr) {}
 	CMouseDragEndMsg(const Point &pt, CTreeItem *dragItem = nullptr) :
-		CMouseDragMsg(pt), _dragItem(dragItem) {}
+		CMouseDragMsg(pt), _dropTarget(dragItem) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return dynamic_cast<const CMouseDragEndMsgTarget *>(item) != nullptr;


Commit: d810e626ae70554bbc994393811b5b8a13cfeeb0
    https://github.com/scummvm/scummvm/commit/d810e626ae70554bbc994393811b5b8a13cfeeb0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-28T22:48:44-04:00

Commit Message:
TITANIC: Implemented CGameObject::checkPoint

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 8343645..ac02f62 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -129,9 +129,29 @@ void CGameObject::stopMovie() {
 		_surface->stopMovie();
 }
 
-bool CGameObject::checkPoint(const Point &pt, int v0, int v1) {
-	warning("TODO: CGameObject::checkPoint");
-	return false;
+bool CGameObject::checkPoint(const Point &pt, bool ignore40, bool visibleOnly) {
+	if ((!_visible && visibleOnly) || !_bounds.contains(pt))
+		return false;
+
+	if (ignore40 || _field40)
+		return true;
+
+	if (!_surface) {
+		if (_frameNumber == -1)
+			return true;
+		loadFrame(_frameNumber);
+		if (!_surface)
+			return true;
+	}
+
+	Common::Point pixelPos = pt - _bounds;
+	if (_surface->_blitStyleFlag) {
+		pixelPos.y = ((_bounds.height() - _bounds.top) / 2) * 2 - pixelPos.y;
+	}
+
+	uint transColor = _surface->getTransparencyColor();
+	uint pixel = _surface->getPixel(pixelPos);
+	return pixel != transColor;
 }
 
 void CGameObject::draw(CScreenManager *screenManager) {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index ced8663..dccef71 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -142,7 +142,11 @@ public:
 	 */
 	void stopMovie();
 
-	bool checkPoint(const Point &pt, int v0, int v1);
+	/**
+	 * Checks the passed point is validly in the object,
+	 * with extra checking of object flags status
+	 */
+	bool checkPoint(const Point &pt, bool ignore40 = false, bool visibleOnly = false);
 
 	void fn1(int val1, int val2, int val3);
 
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index e8f0e03..1708504 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -143,6 +143,11 @@ void CVideoSurface::blitRect2(const Rect &srcRect, const Rect &destRect, CVideoS
 	blitRect1(srcRect, destRect, src);
 }
 
+uint16 CVideoSurface::getTransparencyColor() const {
+	// TODO: Do like the original
+	return 0xF81F;
+}
+
 /*------------------------------------------------------------------------*/
 
 OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface) :
@@ -276,6 +281,20 @@ bool OSVideoSurface::load() {
 	}
 }
 
+uint16 OSVideoSurface::getPixel(const Common::Point &pt) {
+	if (!loadIfReady())
+		return 0;
+
+	if (pt.x >= 0 && pt.y >= 0 && pt.x < getWidth() && pt.y < getHeight()) {
+		lock();
+		uint16 pixel = *(uint16 *)_rawSurface->getBasePtr(pt.x, pt.y);
+		unlock();
+		return pixel;
+	} else {
+		return getTransparencyColor();
+	}
+}
+
 void OSVideoSurface::shiftColors() {
 	if (!loadIfReady())
 		return;
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index b2390fb..6090861 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -135,6 +135,11 @@ public:
 	virtual int proc26() = 0;
 
 	/**
+	 * Gets the pixel at the specified position within the surface
+	 */
+	virtual uint16 getPixel(const Common::Point &pt) = 0;
+
+	/**
 	 * Shifts the colors of the surface.. maybe greys it out?
 	 */
 	virtual void shiftColors() = 0;
@@ -181,6 +186,11 @@ public:
 	void set40(void *v) { _field40 = v; }
 
 	uint16 *getPixels() { return (uint16 *)_rawSurface->getPixels(); }
+
+	/**
+	 * Returns the transparent color
+	 */
+	uint16 getTransparencyColor() const;
 };
 
 class OSVideoSurface : public CVideoSurface {
@@ -246,6 +256,11 @@ public:
 	virtual int proc26();
 
 	/**
+	 * Gets the pixel at the specified position within the surface
+	 */
+	virtual uint16 getPixel(const Common::Point &pt);
+
+	/**
 	 * Shifts the colors of the surface.. maybe greys it out?
 	 */
 	virtual void shiftColors();


Commit: d183a7b4f98b2b0d1c51e80c40bf16e61b0f604e
    https://github.com/scummvm/scummvm/commit/d183a7b4f98b2b0d1c51e80c40bf16e61b0f604e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-29T07:35:56-04:00

Commit Message:
TITANIC: Fix initial loading of game object images

Changed paths:
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 1708504..8a723cc 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -223,18 +223,24 @@ bool OSVideoSurface::hasSurface() {
 	return _ddSurface != nullptr;
 }
 
-int OSVideoSurface::getWidth() const {
-	assert(_ddSurface);
+int OSVideoSurface::getWidth() {
+	if (!loadIfReady())
+		error("Could not load resource");
+
 	return _ddSurface->getWidth();
 }
 
-int OSVideoSurface::getHeight() const {
-	assert(_ddSurface);
+int OSVideoSurface::getHeight() {
+	if (!loadIfReady())
+		error("Could not load resource");
+
 	return _ddSurface->getHeight();
 }
 
-int OSVideoSurface::getPitch() const {
-	assert(_ddSurface);
+int OSVideoSurface::getPitch() {
+	if (!loadIfReady())
+		error("Could not load resource");
+
 	return _ddSurface->getPitch();
 }
 
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 6090861..ad8cb34 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -115,17 +115,17 @@ public:
 	/**
 	 * Returns the width of the surface
 	 */
-	virtual int getWidth() const = 0;
+	virtual int getWidth() = 0;
 
 	/**
 	 * Returns the height of the surface
 	 */
-	virtual int getHeight() const = 0;
+	virtual int getHeight() = 0;
 
 	/**
 	 * Returns the pitch of the surface in bytes
 	 */
-	virtual int getPitch() const = 0;
+	virtual int getPitch() = 0;
 	
 	/**
 	 * Reiszes the surface
@@ -236,17 +236,17 @@ public:
 	/**
 	 * Returns the width of the surface
 	 */
-	virtual int getWidth() const;
+	virtual int getWidth();
 
 	/**
 	 * Returns the height of the surface
 	 */
-	virtual int getHeight() const;
+	virtual int getHeight();
 
 	/**
 	 * Returns the pitch of the surface in bytes
 	 */
-	virtual int getPitch() const;
+	virtual int getPitch();
 
 	/**
 	 * Reiszes the surface


Commit: f64657b44d80a7ec7c19d058ea9d13666cc1c690
    https://github.com/scummvm/scummvm/commit/f64657b44d80a7ec7c19d058ea9d13666cc1c690
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-29T20:35:12-04:00

Commit Message:
TITANIC: Fix handling of transparency

Changed paths:
    engines/titanic/game/television.h
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
index 3b44f80..c6c920b 100644
--- a/engines/titanic/game/television.h
+++ b/engines/titanic/game/television.h
@@ -35,7 +35,6 @@ class CTelevision : public CBackground,
 	public CEnterViewMsgTarget,
 	public CPETUpMsgTarget,
 	public CPETDownMsgTarget,
-	public CStatusChangeMsgTarget,
 	public CActMsgTarget,
 	public CPETActivateMsgTarget,
 	public CMovieEndMsgTarget,
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 8a723cc..6cbea17 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -132,7 +132,8 @@ void CVideoSurface::blitRect1(const Rect &srcRect, const Rect &destRect, CVideoS
 	lock();
 
 	// TODO: Do it like the original does it
-	_rawSurface->blitFrom(*src->_rawSurface, srcRect, Point(destRect.left, destRect.top));
+	_rawSurface->transBlitFrom(*src->_rawSurface, srcRect, destRect,
+		getTransparencyColor());
 
 	src->unlock();
 	unlock();
@@ -143,9 +144,11 @@ void CVideoSurface::blitRect2(const Rect &srcRect, const Rect &destRect, CVideoS
 	blitRect1(srcRect, destRect, src);
 }
 
-uint16 CVideoSurface::getTransparencyColor() const {
-	// TODO: Do like the original
-	return 0xF81F;
+uint CVideoSurface::getTransparencyColor() {
+	uint32 val = -(getPixelDepth() - 2);
+	val &= 0xFFFF8400;
+	val += 0xF81F;
+	return val;
 }
 
 /*------------------------------------------------------------------------*/
@@ -181,7 +184,7 @@ void OSVideoSurface::loadTarga(const CResourceKey &key) {
 	CTargaDecode decoder;
 	decoder.decode(*this, key.getString());
 
-	if (proc26() == 2)
+	if (getPixelDepth() == 2)
 		shiftColors();
 
 	_resourceKey = key;
@@ -193,7 +196,7 @@ void OSVideoSurface::loadJPEG(const CResourceKey &key) {
 	CJPEGDecode decoder;
 	decoder.decode(*this, key.getString());
 
-	if (proc26() == 2)
+	if (getPixelDepth() == 2)
 		shiftColors();
 
 	_resourceKey = key;
@@ -213,10 +216,11 @@ bool OSVideoSurface::lock() {
 }
 
 void OSVideoSurface::unlock() {
-	if (_rawSurface)
-		_ddSurface->unlock();
-	_rawSurface = nullptr;
-	--_lockCount;
+	if (!--_lockCount) {
+		if (_rawSurface)
+			_ddSurface->unlock();
+		_rawSurface = nullptr;
+	}
 }
 
 bool OSVideoSurface::hasSurface() {
@@ -252,12 +256,19 @@ void OSVideoSurface::resize(int width, int height) {
 		_videoSurfaceCounter += _ddSurface->getSize();
 }
 
-int OSVideoSurface::proc26() {
+int OSVideoSurface::getPixelDepth() {
 	if (!loadIfReady())
 		assert(0);
 
-	warning("TODO");
-	return 0;
+	lock();
+	
+	int result = _rawSurface->format.bytesPerPixel;
+	if (result == 1)
+		// Paletted 8-bit images don't store the color directly in the pixels
+		result = 0;
+
+	unlock();
+	return result;
 }
 
 bool OSVideoSurface::load() {
@@ -305,23 +316,8 @@ void OSVideoSurface::shiftColors() {
 	if (!loadIfReady())
 		return;
 
-	if (!lock())
-		assert(0);
-
-	int width = getWidth();
-	int height = getHeight();
-	int pitch = getPitch();
-	uint16 *pixels = (uint16 *)_rawSurface->getPixels();
-	uint16 *p;
-	int x, y;
-
-	for (y = 0; y < height; ++y, pixels += pitch) {
-		for (x = 0, p = pixels; x < width; ++x, ++p) {
-			*p = ((*p & 0xFFE0) * 2) | (*p & 0x1F);
-		}
-	}
-
-	unlock();
+	// Currently no further processing is needed, since for ScummVM,
+	// we already convert 16-bit surfaces as soon as they're loaded
 }
 
 void OSVideoSurface::proc32(int v1, CVideoSurface *surface) {
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index ad8cb34..5a5ee5d 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -132,7 +132,10 @@ public:
 	 */
 	virtual void resize(int width, int height) = 0;
 
-	virtual int proc26() = 0;
+	/**
+	 * Returns the number of bytes per pixel in the surface
+	 */
+	virtual int getPixelDepth() = 0;
 
 	/**
 	 * Gets the pixel at the specified position within the surface
@@ -190,7 +193,7 @@ public:
 	/**
 	 * Returns the transparent color
 	 */
-	uint16 getTransparencyColor() const;
+	uint getTransparencyColor();
 };
 
 class OSVideoSurface : public CVideoSurface {
@@ -253,7 +256,10 @@ public:
 	 */
 	virtual void resize(int width, int height);
 
-	virtual int proc26();
+	/**
+	 * Returns the number of bytes per pixel in the surface
+	 */
+	virtual int getPixelDepth();
 
 	/**
 	 * Gets the pixel at the specified position within the surface


Commit: 8bb9679be0877f728628609f218832bea3c103d4
    https://github.com/scummvm/scummvm/commit/8bb9679be0877f728628609f218832bea3c103d4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-29T21:03:34-04:00

Commit Message:
TITANIC: Renaming for PET inventory section

Changed paths:
  A engines/titanic/pet_control/pet_inventory_section.cpp
  A engines/titanic/pet_control/pet_inventory_section.h
  A engines/titanic/pet_control/pet_section.cpp
  A engines/titanic/pet_control/pet_section.h
  R engines/titanic/pet_control/pet_control_sub4.cpp
  R engines/titanic/pet_control/pet_control_sub4.h
  R engines/titanic/pet_control/pet_control_sub_base.cpp
  R engines/titanic/pet_control/pet_control_sub_base.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_control_sub1.h
    engines/titanic/pet_control/pet_control_sub2.h
    engines/titanic/pet_control/pet_control_sub3.h
    engines/titanic/pet_control/pet_control_sub5.h
    engines/titanic/pet_control/pet_control_sub6.h
    engines/titanic/pet_control/pet_control_sub7.h
    engines/titanic/pet_control/pet_control_sub8.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index afd8453..914df8c 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -382,11 +382,11 @@ MODULE_OBJS := \
 	pet_control/pet_control.o \
 	pet_control/pet_control_list_item.o \
 	pet_control/pet_control_list_item2.o \
-	pet_control/pet_control_sub_base.o \
+	pet_control/pet_section.o \
 	pet_control/pet_control_sub1.o \
 	pet_control/pet_control_sub2.o \
 	pet_control/pet_control_sub3.o \
-	pet_control/pet_control_sub4.o \
+	pet_control/pet_inventory_section.o \
 	pet_control/pet_control_sub5.o \
 	pet_control/pet_control_sub6.o \
 	pet_control/pet_control_sub7.o \
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index b076273..e4ea16e 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -29,7 +29,7 @@
 #include "titanic/pet_control/pet_control_sub1.h"
 #include "titanic/pet_control/pet_control_sub2.h"
 #include "titanic/pet_control/pet_control_sub3.h"
-#include "titanic/pet_control/pet_control_sub4.h"
+#include "titanic/pet_control/pet_inventory_section.h"
 #include "titanic/pet_control/pet_control_sub5.h"
 #include "titanic/pet_control/pet_control_sub6.h"
 #include "titanic/pet_control/pet_control_sub7.h"
@@ -46,7 +46,7 @@ private:
 	CPetControlSub1 _sub1;
 	CPetControlSub2 _sub2;
 	CPetControlSub3 _sub3;
-	CPetControlSub4 _sub4;
+	CPetInventorySection _sub4;
 	CPetControlSub5 _sub5;
 	CPetControlSub6 _sub6;
 	CPetControlSub7 _sub7;
diff --git a/engines/titanic/pet_control/pet_control_sub1.h b/engines/titanic/pet_control/pet_control_sub1.h
index 5d0edb6..8812581 100644
--- a/engines/titanic/pet_control/pet_control_sub1.h
+++ b/engines/titanic/pet_control/pet_control_sub1.h
@@ -23,13 +23,13 @@
 #ifndef TITANIC_PET_CONTROL_SUB1_H
 #define TITANIC_PET_CONTROL_SUB1_H
 
-#include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub12.h"
 #include "titanic/pet_control/pet_val.h"
 
 namespace Titanic {
 
-class CPetControlSub1 : public CPetControlSubBase {
+class CPetControlSub1 : public CPetSection {
 private:
 	CPetVal _val1;
 	CPetVal _val2;
@@ -38,7 +38,7 @@ private:
 	CPetVal _val4;
 	CPetVal _val5;
 	CPetVal _val6;
-	CPetControlSubData _field14C;
+	int  _field14C;
 	CPetVal _val7;
 	CPetVal _val8;
 	CPetVal _val9;
diff --git a/engines/titanic/pet_control/pet_control_sub2.h b/engines/titanic/pet_control/pet_control_sub2.h
index d32b30a..a3eb834 100644
--- a/engines/titanic/pet_control/pet_control_sub2.h
+++ b/engines/titanic/pet_control/pet_control_sub2.h
@@ -23,14 +23,14 @@
 #ifndef TITANIC_PET_CONTROL_SUB2_H
 #define TITANIC_PET_CONTROL_SUB2_H
 
-#include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub11.h"
 #include "titanic/pet_control/pet_control_sub12.h"
 #include "titanic/pet_control/pet_control_list_item2.h"
 
 namespace Titanic {
 
-class CPetControlSub2 : public CPetControlSubBase {
+class CPetControlSub2 : public CPetSection {
 private:
 	CPetControlSub11 _sub11;
 	CPetControlListItem2 _listItem;
diff --git a/engines/titanic/pet_control/pet_control_sub3.h b/engines/titanic/pet_control/pet_control_sub3.h
index aa53db5..4143697 100644
--- a/engines/titanic/pet_control/pet_control_sub3.h
+++ b/engines/titanic/pet_control/pet_control_sub3.h
@@ -23,14 +23,14 @@
 #ifndef TITANIC_PET_CONTROL_SUB3_H
 #define TITANIC_PET_CONTROL_SUB3_H
 
-#include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub10.h"
 #include "titanic/pet_control/pet_control_sub12.h"
 #include "titanic/pet_control/pet_val.h"
 
 namespace Titanic {
 
-class CPetControlSub3 : public CPetControlSubBase {
+class CPetControlSub3 : public CPetSection {
 private:
 	CPetControlSub10 _sub10;
 	CPetVal _val1;
diff --git a/engines/titanic/pet_control/pet_control_sub4.cpp b/engines/titanic/pet_control/pet_control_sub4.cpp
deleted file mode 100644
index 041bf50..0000000
--- a/engines/titanic/pet_control/pet_control_sub4.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_control_sub4.h"
-
-namespace Titanic {
-
-CPetControlSub4::CPetControlSub4() : _field28C(0),
-		_field290(0), _field294(0), _field298(0) {
-	for (int idx = 0; idx < 46; ++idx) {
-		_valArray1[idx] = _valArray2[idx] = 0;
-	}
-}
-
-void CPetControlSub4::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub4::load(SimpleFile *file, int param) {
-	_field298 = file->readNumber();
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub4.h b/engines/titanic/pet_control/pet_control_sub4.h
deleted file mode 100644
index 18dbd7c..0000000
--- a/engines/titanic/pet_control/pet_control_sub4.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB4_H
-#define TITANIC_PET_CONTROL_SUB4_H
-
-#include "titanic/simple_file.h"
-#include "titanic/pet_control/pet_control_sub_base.h"
-#include "titanic/pet_control/pet_control_sub10.h"
-#include "titanic/pet_control/pet_control_sub12.h"
-
-namespace Titanic {
-
-class CPetControlSub4 : public CPetControlSubBase {
-private:
-	CPetControlSub12 _sub12;
-	CPetControlSub10 _sub10;
-	int _valArray1[46];
-	int _valArray2[46];
-	int _field28C;
-	int _field290;
-	int _field294;
-	int _field298;
-public:
-	CPetControlSub4();
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file, int param);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB4_H */
diff --git a/engines/titanic/pet_control/pet_control_sub5.h b/engines/titanic/pet_control/pet_control_sub5.h
index 5ef1b26..1da1822 100644
--- a/engines/titanic/pet_control/pet_control_sub5.h
+++ b/engines/titanic/pet_control/pet_control_sub5.h
@@ -23,13 +23,13 @@
 #ifndef TITANIC_PET_CONTROL_SUB5_H
 #define TITANIC_PET_CONTROL_SUB5_H
 
-#include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub12.h"
 #include "titanic/pet_control/pet_val.h"
 
 namespace Titanic {
 
-class CPetControlSub5 : public CPetControlSubBase {
+class CPetControlSub5 : public CPetSection {
 private:
 	CPetVal _val1;
 	CPetVal _val2;
@@ -39,7 +39,7 @@ private:
 	int _field9C;
 	int _fieldA0;
 	CPetVal _valArray1[6];
-	CPetControlSubData _field17C;
+	int _field17C;
 	int _field18C;
 	CPetControlSub12 _sub12;
 	int _field20C;
diff --git a/engines/titanic/pet_control/pet_control_sub6.h b/engines/titanic/pet_control/pet_control_sub6.h
index 420da0c..208d6f2 100644
--- a/engines/titanic/pet_control/pet_control_sub6.h
+++ b/engines/titanic/pet_control/pet_control_sub6.h
@@ -23,13 +23,13 @@
 #ifndef TITANIC_PET_CONTROL_SUB6_H
 #define TITANIC_PET_CONTROL_SUB6_H
 
-#include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub10.h"
 #include "titanic/pet_control/pet_control_sub12.h"
 
 namespace Titanic {
 
-class CPetControlSub6 : public CPetControlSubBase {
+class CPetControlSub6 : public CPetSection {
 private:
 	CPetControlSub10 _sub10;
 	CPetControlSub10 _sub12;
diff --git a/engines/titanic/pet_control/pet_control_sub7.h b/engines/titanic/pet_control/pet_control_sub7.h
index f4a1dec..fba7d2d 100644
--- a/engines/titanic/pet_control/pet_control_sub7.h
+++ b/engines/titanic/pet_control/pet_control_sub7.h
@@ -23,12 +23,12 @@
 #ifndef TITANIC_PET_CONTROL_SUB7_H
 #define TITANIC_PET_CONTROL_SUB7_H
 
-#include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub12.h"
 
 namespace Titanic {
 
-class CPetControlSub7 : public CPetControlSubBase {
+class CPetControlSub7 : public CPetSection {
 private:
 	CPetControlSub12 _sub1;
 	CPetControlSub12 _sub2;
diff --git a/engines/titanic/pet_control/pet_control_sub8.h b/engines/titanic/pet_control/pet_control_sub8.h
index 115e6d5..a3d9fab 100644
--- a/engines/titanic/pet_control/pet_control_sub8.h
+++ b/engines/titanic/pet_control/pet_control_sub8.h
@@ -23,12 +23,12 @@
 #ifndef TITANIC_PET_CONTROL_SUB8_H
 #define TITANIC_PET_CONTROL_SUB8_H
 
-#include "titanic/pet_control/pet_control_sub_base.h"
+#include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_val.h"
 
 namespace Titanic {
 
-class CPetControlSub8 : public CPetControlSubBase {
+class CPetControlSub8 : public CPetSection {
 private:
 	static int _indexes[6];
 
diff --git a/engines/titanic/pet_control/pet_control_sub_base.cpp b/engines/titanic/pet_control/pet_control_sub_base.cpp
deleted file mode 100644
index 05a3425..0000000
--- a/engines/titanic/pet_control/pet_control_sub_base.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/textconsole.h"
-#include "titanic/pet_control/pet_control_sub_base.h"
-
-namespace Titanic {
-
-void CPetControlSubBase::proc4() {
-	error("TODO");
-}
-
-void CPetControlSubBase::proc16() {
-	error("TODO");
-}
-
-void CPetControlSubBase::proc25() {
-	error("TODO");
-}
-
-void CPetControlSubBase::proc27() {
-	error("TODO");
-}
-
-void CPetControlSubBase::proc28() {
-	error("TODO");
-}
-
-void CPetControlSubBase::proc29() {
-	error("TODO");
-}
-
-void CPetControlSubBase::proc30() {
-	error("TODO");
-}
-
-void CPetControlSubBase::proc31() {
-	error("TODO");
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub_base.h b/engines/titanic/pet_control/pet_control_sub_base.h
deleted file mode 100644
index f95e1a9..0000000
--- a/engines/titanic/pet_control/pet_control_sub_base.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB_BASE_H
-#define TITANIC_PET_CONTROL_SUB_BASE_H
-
-#include "titanic/simple_file.h"
-#include "titanic/core/room_item.h"
-
-namespace Titanic {
-
-struct CPetControlSubData {
-	int _field0;
-	int _field4;
-	int _field8;
-	int _fieldC;
-
-	CPetControlSubData() : _field0(0), _field4(0),
-		_field8(0), _fieldC(0) {}
-};
-
-class CPetControlSubBase {
-protected:
-	int _field4;
-public:
-	CPetControlSubBase() : _field4(0) {}
-	virtual ~CPetControlSubBase() {}
-
-	virtual int proc1() { return 0; }
-	virtual int proc2() { return 0; }
-	virtual void proc3() {}
-	virtual void proc4();
-	virtual void proc5() {}
-	virtual int proc6() { return 0; }
-	virtual int proc7() { return 0; }
-	virtual int proc8() { return 0; }
-	virtual int proc9() { return 0; }
-	virtual int proc10() { return 0; }
-	virtual int proc11() { return 0; }
-	virtual int proc12() { return 0; }
-	virtual int proc13() { return 0; }
-	virtual int proc14() { return 0; }
-	virtual int proc15() { return 0; }
-	virtual void proc16();
-
-	/**
-	 * Returns true if the object is in a valid state
-	 */
-	virtual bool isValid() const { return false; }
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file, int param) {}
-
-	virtual void proc19() {}
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const {}
-
-	virtual void proc21() {}
-	virtual void proc22() {}
-	virtual void proc23() {}
-
-	/**
-	 * Called when a new room is entered
-	 */
-	virtual void enterRoom(CRoomItem *room) {}
-
-	virtual void proc25();
-	virtual int proc26() { return 0; }
-	virtual void proc27();
-	virtual void proc28();
-	virtual void proc29();
-	virtual void proc30();
-	virtual void proc31();
-	virtual void proc32() {}
-	virtual void proc33() {}
-	virtual void proc34() {}
-	virtual void proc35() {}
-	virtual void proc36() {}
-	virtual void proc37() {}
-	virtual void proc38() {}
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB_BASE_H */
diff --git a/engines/titanic/pet_control/pet_inventory_section.cpp b/engines/titanic/pet_control/pet_inventory_section.cpp
new file mode 100644
index 0000000..d859576
--- /dev/null
+++ b/engines/titanic/pet_control/pet_inventory_section.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_inventory_section.h"
+
+namespace Titanic {
+
+CPetInventorySection::CPetInventorySection() : CPetSection(),
+		_field28C(0), _field290(0), _field294(0), _field298(0) {
+	for (int idx = 0; idx < 46; ++idx) {
+		_valArray1[idx] = _valArray2[idx] = 0;
+	}
+}
+
+void CPetInventorySection::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(_field298, indent);
+}
+
+void CPetInventorySection::load(SimpleFile *file, int param) {
+	_field298 = file->readNumber();
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory_section.h b/engines/titanic/pet_control/pet_inventory_section.h
new file mode 100644
index 0000000..4adad46
--- /dev/null
+++ b/engines/titanic/pet_control/pet_inventory_section.h
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_INVENTORY_SECTION_H
+#define TITANIC_PET_INVENTORY_SECTION_H
+
+#include "titanic/simple_file.h"
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+
+namespace Titanic {
+
+class CPetInventorySection : public CPetSection {
+private:
+	CPetControlSub12 _sub12;
+	CPetControlSub10 _sub10;
+	int _valArray1[46];
+	int _valArray2[46];
+	int _field28C;
+	int _field290;
+	int _field294;
+	int _field298;
+public:
+	CPetInventorySection();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_INVENTORY_SECTION_H */
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp
new file mode 100644
index 0000000..321f1fb
--- /dev/null
+++ b/engines/titanic/pet_control/pet_section.cpp
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/pet_control/pet_section.h"
+
+namespace Titanic {
+
+void CPetSection::proc4() {
+	error("TODO");
+}
+
+void CPetSection::proc16() {
+	error("TODO");
+}
+
+void CPetSection::proc25() {
+	error("TODO");
+}
+
+void CPetSection::proc27() {
+	error("TODO");
+}
+
+void CPetSection::proc28() {
+	error("TODO");
+}
+
+void CPetSection::proc29() {
+	error("TODO");
+}
+
+void CPetSection::proc30() {
+	error("TODO");
+}
+
+void CPetSection::proc31() {
+	error("TODO");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
new file mode 100644
index 0000000..d3006f5
--- /dev/null
+++ b/engines/titanic/pet_control/pet_section.h
@@ -0,0 +1,109 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_SECTION_H
+#define TITANIC_PET_SECTION_H
+
+#include "titanic/simple_file.h"
+#include "titanic/core/room_item.h"
+
+namespace Titanic {
+
+struct CPetSectionSubData {
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+
+	CPetSectionSubData() : _field0(0), _field4(0), _field8(0),
+		_fieldC(0) {}
+};
+
+class CPetSection {
+protected:
+	int _field4;
+public:
+	CPetSection() : _field4(0) {}
+	virtual ~CPetSection() {}
+
+	virtual int proc1() { return 0; }
+	virtual int proc2() { return 0; }
+	virtual void proc3() {}
+	virtual void proc4();
+	virtual void proc5() {}
+	virtual int proc6() { return 0; }
+	virtual int proc7() { return 0; }
+	virtual int proc8() { return 0; }
+	virtual int proc9() { return 0; }
+	virtual int proc10() { return 0; }
+	virtual int proc11() { return 0; }
+	virtual int proc12() { return 0; }
+	virtual int proc13() { return 0; }
+	virtual int proc14() { return 0; }
+	virtual int proc15() { return 0; }
+	virtual void proc16();
+
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid() const { return false; }
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param) {}
+
+	virtual void proc19() {}
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const {}
+
+	virtual void proc21() {}
+	virtual void proc22() {}
+	virtual void proc23() {}
+
+	/**
+	 * Called when a new room is entered
+	 */
+	virtual void enterRoom(CRoomItem *room) {}
+
+	virtual void proc25();
+	virtual int proc26() { return 0; }
+	virtual void proc27();
+	virtual void proc28();
+	virtual void proc29();
+	virtual void proc30();
+	virtual void proc31();
+	virtual void proc32() {}
+	virtual void proc33() {}
+	virtual void proc34() {}
+	virtual void proc35() {}
+	virtual void proc36() {}
+	virtual void proc37() {}
+	virtual void proc38() {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_SECTION_H */


Commit: 8a45f47c2e1e483b5a17b2d4abe22473eaf1e143
    https://github.com/scummvm/scummvm/commit/8a45f47c2e1e483b5a17b2d4abe22473eaf1e143
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-29T21:19:12-04:00

Commit Message:
TITANIC: More renamings of PET sections

Changed paths:
  A engines/titanic/pet_control/pet_conversation_section.cpp
  A engines/titanic/pet_control/pet_conversation_section.h
  A engines/titanic/pet_control/pet_remote_section.cpp
  A engines/titanic/pet_control/pet_remote_section.h
  A engines/titanic/pet_control/pet_rooms_section.cpp
  A engines/titanic/pet_control/pet_rooms_section.h
  R engines/titanic/pet_control/pet_control_sub1.cpp
  R engines/titanic/pet_control/pet_control_sub1.h
  R engines/titanic/pet_control/pet_control_sub2.cpp
  R engines/titanic/pet_control/pet_control_sub2.h
  R engines/titanic/pet_control/pet_control_sub3.cpp
  R engines/titanic/pet_control/pet_control_sub3.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 914df8c..3e018a2 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -382,10 +382,10 @@ MODULE_OBJS := \
 	pet_control/pet_control.o \
 	pet_control/pet_control_list_item.o \
 	pet_control/pet_control_list_item2.o \
+	pet_control/pet_conversation_section.o \
 	pet_control/pet_section.o \
-	pet_control/pet_control_sub1.o \
-	pet_control/pet_control_sub2.o \
-	pet_control/pet_control_sub3.o \
+	pet_control/pet_rooms_section.o \
+	pet_control/pet_remote_section.o \
 	pet_control/pet_inventory_section.o \
 	pet_control/pet_control_sub5.o \
 	pet_control/pet_control_sub6.o \
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index f3e78a2..7ef4c14 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -52,17 +52,17 @@ void CPetControl::load(SimpleFile *file) {
 }
 
 bool CPetControl::isValid() const {
-	return _sub1.isValid() && _sub2.isValid()
-		&& _sub3.isValid() && _sub4.isValid()
+	return _convSection.isValid() && _roomsSection.isValid()
+		&& _remoteSection.isValid() && _invSection.isValid()
 		&& _sub5.isValid() && _sub6.isValid()
 		&& _sub7.isValid() && _sub8.isValid();
 }
 
 void CPetControl::loadSubObjects(SimpleFile *file, int param) {
-	_sub1.load(file, param);
-	_sub2.load(file, param);
-	_sub3.load(file, param);
-	_sub4.load(file, param);
+	_convSection.load(file, param);
+	_roomsSection.load(file, param);
+	_remoteSection.load(file, param);
+	_invSection.load(file, param);
 	_sub5.load(file, param);
 	_sub6.load(file, param);
 	_sub7.load(file, param);
@@ -70,10 +70,10 @@ void CPetControl::loadSubObjects(SimpleFile *file, int param) {
 }
 
 void CPetControl::saveSubObjects(SimpleFile *file, int indent) const {
-	_sub1.save(file, indent);
-	_sub2.save(file, indent);
-	_sub3.save(file, indent);
-	_sub4.save(file, indent);
+	_convSection.save(file, indent);
+	_roomsSection.save(file, indent);
+	_remoteSection.save(file, indent);
+	_invSection.save(file, indent);
 	_sub5.save(file, indent);
 	_sub6.save(file, indent);
 	_sub7.save(file, indent);
@@ -93,8 +93,8 @@ void CPetControl::enterNode(CNodeItem *node) {
 }
 
 void CPetControl::enterRoom(CRoomItem *room) {
-	_sub2.enterRoom(room);
-	_sub3.enterRoom(room);
+	_roomsSection.enterRoom(room);
+	_remoteSection.enterRoom(room);
 }
 
 void CPetControl::clear() {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index e4ea16e..d6fc9d0 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -26,10 +26,10 @@
 #include "titanic/core/game_object.h"
 #include "titanic/core/node_item.h"
 #include "titanic/core/room_item.h"
-#include "titanic/pet_control/pet_control_sub1.h"
-#include "titanic/pet_control/pet_control_sub2.h"
-#include "titanic/pet_control/pet_control_sub3.h"
+#include "titanic/pet_control/pet_conversation_section.h"
 #include "titanic/pet_control/pet_inventory_section.h"
+#include "titanic/pet_control/pet_remote_section.h"
+#include "titanic/pet_control/pet_rooms_section.h"
 #include "titanic/pet_control/pet_control_sub5.h"
 #include "titanic/pet_control/pet_control_sub6.h"
 #include "titanic/pet_control/pet_control_sub7.h"
@@ -43,10 +43,10 @@ private:
 	int _fieldC0;
 	int _fieldC4;
 	int _fieldC8;
-	CPetControlSub1 _sub1;
-	CPetControlSub2 _sub2;
-	CPetControlSub3 _sub3;
-	CPetInventorySection _sub4;
+	CPetConversationSection _convSection;
+	CPetInventorySection _invSection;
+	CPetRemoteSection _remoteSection;
+	CPetRoomsSection _roomsSection;
 	CPetControlSub5 _sub5;
 	CPetControlSub6 _sub6;
 	CPetControlSub7 _sub7;
diff --git a/engines/titanic/pet_control/pet_control_sub1.cpp b/engines/titanic/pet_control/pet_control_sub1.cpp
deleted file mode 100644
index 0daae06..0000000
--- a/engines/titanic/pet_control/pet_control_sub1.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_control_sub1.h"
-
-namespace Titanic {
-
-CPetControlSub1::CPetControlSub1() : _field414(0), _field418(0) {
-}
-
-void CPetControlSub1::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub1::load(SimpleFile *file, int param) {
-	_sub2.load(file, param);
-	_sub1.load(file, param);
-
-	for (int idx = 0; idx < 3; ++idx)
-		_valArray3[idx] = file->readNumber();
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub1.h b/engines/titanic/pet_control/pet_control_sub1.h
deleted file mode 100644
index 8812581..0000000
--- a/engines/titanic/pet_control/pet_control_sub1.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB1_H
-#define TITANIC_PET_CONTROL_SUB1_H
-
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub12.h"
-#include "titanic/pet_control/pet_val.h"
-
-namespace Titanic {
-
-class CPetControlSub1 : public CPetSection {
-private:
-	CPetVal _val1;
-	CPetVal _val2;
-	CPetVal _val3;
-	CPetVal _valArray1[3];
-	CPetVal _val4;
-	CPetVal _val5;
-	CPetVal _val6;
-	int  _field14C;
-	CPetVal _val7;
-	CPetVal _val8;
-	CPetVal _val9;
-	CPetVal _valArray2[9];
-	int _field30C;
-	CPetControlSub12 _sub1;
-	CPetControlSub12 _sub2;
-	int _valArray3[3];
-	int _field414;
-	int _field418;
-	CString _string1;
-public:
-	CPetControlSub1();
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file, int param);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB1_H */
diff --git a/engines/titanic/pet_control/pet_control_sub2.cpp b/engines/titanic/pet_control/pet_control_sub2.cpp
deleted file mode 100644
index 2e8b35e..0000000
--- a/engines/titanic/pet_control/pet_control_sub2.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_control_sub2.h"
-
-namespace Titanic {
-
-CPetControlSub2::CPetControlSub2() :
-	_field100(0), _field104(0), _field108(0), _field10C(0),
-	_field110(0), _field114(0), _field118(0), _field11C(0),
-	_field1C0(0), _field1C4(0), _field1C8(0), _field1CC(0),
-	_field1D0(0), _field1D4(0) {
-}
-
-void CPetControlSub2::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub2::load(SimpleFile *file, int param) {
-	if (!param) {
-		int count = file->readNumber();
-
-		for (int idx = 0; idx < count; ++idx) {
-			int v1 = file->readNumber();
-			int v2 = file->readNumber();
-			warning("TODO: CPetControlSub2::load - %d,%d", v1, v2);
-		}
-
-		_listItem.setField34(file->readNumber());
-		file->readNumber();
-		_field1C0 = file->readNumber();
-		_field1C4 = file->readNumber();
-		_field1C8 = file->readNumber();
-		_field1CC = file->readNumber();
-		_field1D0 = file->readNumber();
-		_field1D4 = file->readNumber();
-	}
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub2.h b/engines/titanic/pet_control/pet_control_sub2.h
deleted file mode 100644
index a3eb834..0000000
--- a/engines/titanic/pet_control/pet_control_sub2.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB2_H
-#define TITANIC_PET_CONTROL_SUB2_H
-
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub11.h"
-#include "titanic/pet_control/pet_control_sub12.h"
-#include "titanic/pet_control/pet_control_list_item2.h"
-
-namespace Titanic {
-
-class CPetControlSub2 : public CPetSection {
-private:
-	CPetControlSub11 _sub11;
-	CPetControlListItem2 _listItem;
-	int _field100;
-	int _field104;
-	int _field108;
-	int _field10C;
-	int _field110;
-	int _field114;
-	int _field118;
-	int _field11C;
-	CPetVal _val1;
-	CPetControlSub12 _sub12;
-	int _field1C0;
-	int _field1C4;
-	int _field1C8;
-	int _field1CC;
-	int _field1D0;
-	int _field1D4;
-public:
-	CPetControlSub2();
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file, int param);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB2_H */
diff --git a/engines/titanic/pet_control/pet_control_sub3.cpp b/engines/titanic/pet_control/pet_control_sub3.cpp
deleted file mode 100644
index d134b1b..0000000
--- a/engines/titanic/pet_control/pet_control_sub3.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_control_sub3.h"
-
-namespace Titanic {
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub3.h b/engines/titanic/pet_control/pet_control_sub3.h
deleted file mode 100644
index 4143697..0000000
--- a/engines/titanic/pet_control/pet_control_sub3.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB3_H
-#define TITANIC_PET_CONTROL_SUB3_H
-
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub10.h"
-#include "titanic/pet_control/pet_control_sub12.h"
-#include "titanic/pet_control/pet_val.h"
-
-namespace Titanic {
-
-class CPetControlSub3 : public CPetSection {
-private:
-	CPetControlSub10 _sub10;
-	CPetVal _val1;
-	CPetVal _val2;
-	CPetVal _val3;
-	CPetVal _val4;
-	CPetVal _val5;
-	CPetVal _val6;
-	CPetVal _val7;
-	CPetVal _val8;
-	CPetVal _val9;
-	CPetVal _val10;
-	CPetVal _val11;
-	CPetControlSub12 _sub12;
-public:
-
-
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB3_H */
diff --git a/engines/titanic/pet_control/pet_conversation_section.cpp b/engines/titanic/pet_control/pet_conversation_section.cpp
new file mode 100644
index 0000000..890a03d
--- /dev/null
+++ b/engines/titanic/pet_control/pet_conversation_section.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_conversation_section.h"
+
+namespace Titanic {
+
+CPetConversationSection::CPetConversationSection() : CPetSection(),
+		_field414(0), _field418(0) {
+}
+
+void CPetConversationSection::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetConversationSection::load(SimpleFile *file, int param) {
+	_sub2.load(file, param);
+	_sub1.load(file, param);
+
+	for (int idx = 0; idx < 3; ++idx)
+		_valArray3[idx] = file->readNumber();
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversation_section.h b/engines/titanic/pet_control/pet_conversation_section.h
new file mode 100644
index 0000000..c9f4547
--- /dev/null
+++ b/engines/titanic/pet_control/pet_conversation_section.h
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONVERSATION_SECTION_H
+#define TITANIC_PET_CONVERSATION_SECTION_H
+
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_val.h"
+
+namespace Titanic {
+
+class CPetConversationSection : public CPetSection {
+private:
+	CPetVal _val1;
+	CPetVal _val2;
+	CPetVal _val3;
+	CPetVal _valArray1[3];
+	CPetVal _val4;
+	CPetVal _val5;
+	CPetVal _val6;
+	int  _field14C;
+	CPetVal _val7;
+	CPetVal _val8;
+	CPetVal _val9;
+	CPetVal _valArray2[9];
+	int _field30C;
+	CPetControlSub12 _sub1;
+	CPetControlSub12 _sub2;
+	int _valArray3[3];
+	int _field414;
+	int _field418;
+	CString _string1;
+public:
+	CPetConversationSection();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONVERSATION_SECTION_H */
diff --git a/engines/titanic/pet_control/pet_remote_section.cpp b/engines/titanic/pet_control/pet_remote_section.cpp
new file mode 100644
index 0000000..7cdde01
--- /dev/null
+++ b/engines/titanic/pet_control/pet_remote_section.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_remote_section.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_section.h b/engines/titanic/pet_control/pet_remote_section.h
new file mode 100644
index 0000000..e3b543c
--- /dev/null
+++ b/engines/titanic/pet_control/pet_remote_section.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_REMOTE_SECTION_H
+#define TITANIC_PET_REMOTE_SECTION_H
+
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_val.h"
+
+namespace Titanic {
+
+class CPetRemoteSection : public CPetSection {
+private:
+	CPetControlSub10 _sub10;
+	CPetVal _val1;
+	CPetVal _val2;
+	CPetVal _val3;
+	CPetVal _val4;
+	CPetVal _val5;
+	CPetVal _val6;
+	CPetVal _val7;
+	CPetVal _val8;
+	CPetVal _val9;
+	CPetVal _val10;
+	CPetVal _val11;
+	CPetControlSub12 _sub12;
+public:
+
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_REMOTE_SECTION_H */
diff --git a/engines/titanic/pet_control/pet_rooms_section.cpp b/engines/titanic/pet_control/pet_rooms_section.cpp
new file mode 100644
index 0000000..b866fb3
--- /dev/null
+++ b/engines/titanic/pet_control/pet_rooms_section.cpp
@@ -0,0 +1,59 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_rooms_section.h"
+
+namespace Titanic {
+
+CPetRoomsSection::CPetRoomsSection() :
+	_field100(0), _field104(0), _field108(0), _field10C(0),
+	_field110(0), _field114(0), _field118(0), _field11C(0),
+	_field1C0(0), _field1C4(0), _field1C8(0), _field1CC(0),
+	_field1D0(0), _field1D4(0) {
+}
+
+void CPetRoomsSection::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetRoomsSection::load(SimpleFile *file, int param) {
+	if (!param) {
+		int count = file->readNumber();
+
+		for (int idx = 0; idx < count; ++idx) {
+			int v1 = file->readNumber();
+			int v2 = file->readNumber();
+			warning("TODO: CPetRoomsSection::load - %d,%d", v1, v2);
+		}
+
+		_listItem.setField34(file->readNumber());
+		file->readNumber();
+		_field1C0 = file->readNumber();
+		_field1C4 = file->readNumber();
+		_field1C8 = file->readNumber();
+		_field1CC = file->readNumber();
+		_field1D0 = file->readNumber();
+		_field1D4 = file->readNumber();
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms_section.h b/engines/titanic/pet_control/pet_rooms_section.h
new file mode 100644
index 0000000..54996fa
--- /dev/null
+++ b/engines/titanic/pet_control/pet_rooms_section.h
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_ROOMS_SECTION_H
+#define TITANIC_PET_ROOMS_SECTION_H
+
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_control_sub11.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_control_list_item2.h"
+
+namespace Titanic {
+
+class CPetRoomsSection : public CPetSection {
+private:
+	CPetControlSub11 _sub11;
+	CPetControlListItem2 _listItem;
+	int _field100;
+	int _field104;
+	int _field108;
+	int _field10C;
+	int _field110;
+	int _field114;
+	int _field118;
+	int _field11C;
+	CPetVal _val1;
+	CPetControlSub12 _sub12;
+	int _field1C0;
+	int _field1C4;
+	int _field1C8;
+	int _field1CC;
+	int _field1D0;
+	int _field1D4;
+public:
+	CPetRoomsSection();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_ROOMS_SECTION_H */


Commit: e0602c4851ab42763cc66858fed8d05496040498
    https://github.com/scummvm/scummvm/commit/e0602c4851ab42763cc66858fed8d05496040498
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-29T21:57:09-04:00

Commit Message:
TITANIC: More PET renaming, implemented setArea

Changed paths:
  A engines/titanic/pet_control/pet_save_section.cpp
  A engines/titanic/pet_control/pet_save_section.h
  R engines/titanic/pet_control/pet_control_sub6.cpp
  R engines/titanic/pet_control/pet_control_sub6.h
    engines/titanic/core/game_object.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_control_sub8.cpp
    engines/titanic/pet_control/pet_control_sub8.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index dccef71..9a07cd1 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -53,16 +53,6 @@ private:
 	void loadImage(const CString &name, bool pendingFlag = true);
 
 	void processClipList2();
-
-	/**
-	 * Marks the area in the passed rect as dirty, and requiring re-rendering
-	 */
-	void makeDirty(const Rect &r);
-
-	/**
-	 * Marks the area occupied by the object as dirty, requiring re-rendering
-	 */
-	void makeDirty();
 protected:
 	Rect _bounds;
 	double _field34;
@@ -109,6 +99,16 @@ protected:
 	 */
 	bool checkStartDragging(CMouseDragStartMsg *msg);
 
+	/**
+	 * Marks the area in the passed rect as dirty, and requiring re-rendering
+	 */
+	void makeDirty(const Rect &r);
+
+	/**
+	 * Marks the area occupied by the object as dirty, requiring re-rendering
+	 */
+	void makeDirty();
+
 	bool soundFn1(int val);
 	void soundFn2(int val, int val2);
 	void setVisible(bool val);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 3e018a2..a72e80d 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -383,12 +383,12 @@ MODULE_OBJS := \
 	pet_control/pet_control_list_item.o \
 	pet_control/pet_control_list_item2.o \
 	pet_control/pet_conversation_section.o \
-	pet_control/pet_section.o \
+	pet_control/pet_inventory_section.o \
 	pet_control/pet_rooms_section.o \
 	pet_control/pet_remote_section.o \
-	pet_control/pet_inventory_section.o \
+	pet_control/pet_save_section.o \
+	pet_control/pet_section.o \
 	pet_control/pet_control_sub5.o \
-	pet_control/pet_control_sub6.o \
 	pet_control/pet_control_sub7.o \
 	pet_control/pet_control_sub8.o \
 	pet_control/pet_control_sub10.o \
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 7ef4c14..63a1da4 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 
 void CPetControl::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(0, indent);
-	file->writeNumberLine(_fieldBC, indent);
+	file->writeNumberLine(_currentArea, indent);
 	file->writeQuotedLine(_string1, indent);
 	file->writeQuotedLine(_string2, indent);
 
@@ -41,7 +41,7 @@ void CPetControl::load(SimpleFile *file) {
 	isValid();
 	
 	if (!val) {
-		_fieldBC = file->readNumber();
+		_currentArea = (PetArea)file->readNumber();
 		_string1 = file->readString();
 		_string2 = file->readString();
 		
@@ -54,7 +54,7 @@ void CPetControl::load(SimpleFile *file) {
 bool CPetControl::isValid() const {
 	return _convSection.isValid() && _roomsSection.isValid()
 		&& _remoteSection.isValid() && _invSection.isValid()
-		&& _sub5.isValid() && _sub6.isValid()
+		&& _sub5.isValid() && _saveSection.isValid()
 		&& _sub7.isValid() && _sub8.isValid();
 }
 
@@ -64,7 +64,7 @@ void CPetControl::loadSubObjects(SimpleFile *file, int param) {
 	_remoteSection.load(file, param);
 	_invSection.load(file, param);
 	_sub5.load(file, param);
-	_sub6.load(file, param);
+	_saveSection.load(file, param);
 	_sub7.load(file, param);
 	_sub8.load(file, param);
 }
@@ -75,7 +75,7 @@ void CPetControl::saveSubObjects(SimpleFile *file, int indent) const {
 	_remoteSection.save(file, indent);
 	_invSection.save(file, indent);
 	_sub5.save(file, indent);
-	_sub6.save(file, indent);
+	_saveSection.save(file, indent);
 	_sub7.save(file, indent);
 	_sub8.save(file, indent);
 }
@@ -119,4 +119,71 @@ void CPetControl::fn4() {
 	warning("TODO: CPetControl::fn4");
 }
 
+PetArea CPetControl::setArea(PetArea newArea) {
+	if (newArea == _currentArea || !canChangeArea())
+		return _currentArea;
+
+	// Signal the currently active area that it's being left
+	switch (_currentArea) {
+	case PET_INVENTORY:
+		_invSection.leave();
+		break;
+	case PET_CONVERSATION:
+		_convSection.leave();
+		break;
+	case PET_REMOTE:
+		_remoteSection.leave();
+		break;
+	case PET_ROOMS:
+		_roomsSection.leave();
+		break;
+	case PET_SAVE:
+		_saveSection.leave();
+		break;
+	case PET_5:
+		_sub5.leave();
+		break;
+	case PET_6:
+		_sub7.leave();
+		break;
+	default:
+		break;
+	}
+
+	// Change the current area
+	PetArea oldArea = _currentArea;
+	_sub8.setArea(newArea);
+	_currentArea = newArea;
+
+	// Signal to the new view that it's been activated
+	switch (newArea) {
+	case PET_INVENTORY:
+		_invSection.enter(oldArea);
+		
+		break;
+	case PET_CONVERSATION:
+		_convSection.enter(oldArea);
+		break;
+	case PET_REMOTE:
+		_remoteSection.enter(oldArea);
+		break;
+	case PET_ROOMS:
+		_roomsSection.enter(oldArea);
+		break;
+	case PET_SAVE:
+		_saveSection.enter(oldArea);
+		break;
+	case PET_5:
+		_sub5.enter(oldArea);
+		break;
+	case PET_6:
+		_sub7.enter(oldArea);
+		break;
+	default:
+		break;
+	}
+
+	makeDirty();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index d6fc9d0..ce40eba 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -30,8 +30,8 @@
 #include "titanic/pet_control/pet_inventory_section.h"
 #include "titanic/pet_control/pet_remote_section.h"
 #include "titanic/pet_control/pet_rooms_section.h"
+#include "titanic/pet_control/pet_save_section.h"
 #include "titanic/pet_control/pet_control_sub5.h"
-#include "titanic/pet_control/pet_control_sub6.h"
 #include "titanic/pet_control/pet_control_sub7.h"
 #include "titanic/pet_control/pet_control_sub8.h"
 
@@ -39,16 +39,16 @@ namespace Titanic {
 
 class CPetControl : public CGameObject {
 private:
-	int _fieldBC;
+	PetArea _currentArea;
 	int _fieldC0;
-	int _fieldC4;
+	int _locked;
 	int _fieldC8;
 	CPetConversationSection _convSection;
 	CPetInventorySection _invSection;
 	CPetRemoteSection _remoteSection;
 	CPetRoomsSection _roomsSection;
+	CPetSaveSection _saveSection;
 	CPetControlSub5 _sub5;
-	CPetControlSub6 _sub6;
 	CPetControlSub7 _sub7;
 	CPetControlSub8 _sub8;
 	int _field1384;
@@ -107,6 +107,16 @@ public:
 	void fn3(int val);
 
 	void fn4();
+
+	/**
+	 * Sets the currently viewed area within the PET
+	 */
+	PetArea setArea(PetArea newSection);
+
+	/**
+	 * Returns true if the current area can be changed
+	 */
+	bool canChangeArea() const { return _locked == 0; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub6.cpp b/engines/titanic/pet_control/pet_control_sub6.cpp
deleted file mode 100644
index d017e81..0000000
--- a/engines/titanic/pet_control/pet_control_sub6.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_control_sub6.h"
-
-namespace Titanic {
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub6.h b/engines/titanic/pet_control/pet_control_sub6.h
deleted file mode 100644
index 208d6f2..0000000
--- a/engines/titanic/pet_control/pet_control_sub6.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB6_H
-#define TITANIC_PET_CONTROL_SUB6_H
-
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub10.h"
-#include "titanic/pet_control/pet_control_sub12.h"
-
-namespace Titanic {
-
-class CPetControlSub6 : public CPetSection {
-private:
-	CPetControlSub10 _sub10;
-	CPetControlSub10 _sub12;
-public:
-
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB6_H */
diff --git a/engines/titanic/pet_control/pet_control_sub8.cpp b/engines/titanic/pet_control/pet_control_sub8.cpp
index 18c68c7..bc577e3 100644
--- a/engines/titanic/pet_control/pet_control_sub8.cpp
+++ b/engines/titanic/pet_control/pet_control_sub8.cpp
@@ -33,4 +33,8 @@ CPetControlSub8::CPetControlSub8() {
 		_indexes[INDEXES[idx]] = idx;
 }
 
+void CPetControlSub8::setArea(PetArea newArea) {
+	warning("TODO: CPetControlSub8::setArea");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub8.h b/engines/titanic/pet_control/pet_control_sub8.h
index a3d9fab..20d260d 100644
--- a/engines/titanic/pet_control/pet_control_sub8.h
+++ b/engines/titanic/pet_control/pet_control_sub8.h
@@ -42,6 +42,7 @@ private:
 public:
 	CPetControlSub8();
 
+	void setArea(PetArea newArea);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_save_section.cpp b/engines/titanic/pet_control/pet_save_section.cpp
new file mode 100644
index 0000000..e513dd3
--- /dev/null
+++ b/engines/titanic/pet_control/pet_save_section.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_save_section.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_save_section.h b/engines/titanic/pet_control/pet_save_section.h
new file mode 100644
index 0000000..fb9004f
--- /dev/null
+++ b/engines/titanic/pet_control/pet_save_section.h
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_SAVE_SECTION_H
+#define TITANIC_PET_SAVE_SECTION_H
+
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+
+namespace Titanic {
+
+class CPetSaveSection : public CPetSection {
+private:
+	CPetControlSub10 _sub10;
+	CPetControlSub10 _sub12;
+public:
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_SAVE_SECTION_H */
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index d3006f5..ceada29 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -28,6 +28,11 @@
 
 namespace Titanic {
 
+enum PetArea {
+	PET_INVENTORY = 0, PET_CONVERSATION = 1, PET_REMOTE = 2,
+	PET_ROOMS = 3, PET_SAVE = 4, PET_5 = 5, PET_6 = 6
+};
+
 struct CPetSectionSubData {
 	int _field0;
 	int _field4;
@@ -79,8 +84,16 @@ public:
 	 */
 	virtual void save(SimpleFile *file, int indent) const {}
 
-	virtual void proc21() {}
-	virtual void proc22() {}
+	/**
+	 * Called when a section is switched to
+	 */
+	virtual void enter(PetArea oldArea) {}
+	
+	/**
+	 * Called when a section is being left, to switch to another area
+	 */
+	virtual void leave() {}
+	
 	virtual void proc23() {}
 
 	/**


Commit: a1e959b4986914bd42bdbd4587cdfc2bd57ca3a0
    https://github.com/scummvm/scummvm/commit/a1e959b4986914bd42bdbd4587cdfc2bd57ca3a0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-29T22:21:55-04:00

Commit Message:
TITANIC: Fix PET post-loading

Changed paths:
    engines/titanic/core/tree_item.cpp
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 081c580..61fcf97 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -188,7 +188,7 @@ void CTreeItem::setParent(CTreeItem *newParent) {
 }
 
 void CTreeItem::addSibling(CTreeItem *item) {
-	_priorSibling = item->_nextSibling;
+	_priorSibling = item;
 	_nextSibling = item->_nextSibling;
 	_parent = item->_parent;
 
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 63a1da4..db053ca 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/core/project_item.h"
 #include "titanic/game_manager.h"
 #include "titanic/game_state.h"
 
@@ -32,7 +33,7 @@ void CPetControl::save(SimpleFile *file, int indent) const {
 	file->writeQuotedLine(_string1, indent);
 	file->writeQuotedLine(_string2, indent);
 
-	saveSubObjects(file, indent);
+	saveAreas(file, indent);
 	CGameObject::save(file, indent);
 }
 
@@ -45,7 +46,7 @@ void CPetControl::load(SimpleFile *file) {
 		_string1 = file->readString();
 		_string2 = file->readString();
 		
-		loadSubObjects(file, 0);
+		loadAreas(file, 0);
 	}
 
 	CGameObject::load(file);
@@ -58,7 +59,7 @@ bool CPetControl::isValid() const {
 		&& _sub7.isValid() && _sub8.isValid();
 }
 
-void CPetControl::loadSubObjects(SimpleFile *file, int param) {
+void CPetControl::loadAreas(SimpleFile *file, int param) {
 	_convSection.load(file, param);
 	_roomsSection.load(file, param);
 	_remoteSection.load(file, param);
@@ -69,7 +70,7 @@ void CPetControl::loadSubObjects(SimpleFile *file, int param) {
 	_sub8.load(file, param);
 }
 
-void CPetControl::saveSubObjects(SimpleFile *file, int indent) const {
+void CPetControl::saveAreas(SimpleFile *file, int indent) const {
 	_convSection.save(file, indent);
 	_roomsSection.save(file, indent);
 	_remoteSection.save(file, indent);
@@ -85,7 +86,26 @@ void CPetControl::proc26() {
 }
 
 void CPetControl::postLoad() {
-	warning("TODO: CPetControl::postLoad");
+	CProjectItem *root = getRoot();
+
+	if (!_string1.empty() && root)
+		_treeItem1 = root->findByName(_string1);
+	if (!_string2.empty() && root)
+		_treeItem2 = root->findByName(_string2);
+
+	setArea(_currentArea);
+	loaded();
+}
+
+void CPetControl::loaded() {
+	_convSection.postLoad();
+	_roomsSection.postLoad();
+	_remoteSection.postLoad();
+	_invSection.postLoad();
+	_sub5.postLoad();
+	_saveSection.postLoad();
+	_sub7.postLoad();
+	_sub8.postLoad();
 }
 
 void CPetControl::enterNode(CNodeItem *node) {
@@ -98,7 +118,7 @@ void CPetControl::enterRoom(CRoomItem *room) {
 }
 
 void CPetControl::clear() {
-	_field1394 = 0;
+	_treeItem2 = nullptr;
 	_string2.clear();
 }
 
@@ -184,6 +204,7 @@ PetArea CPetControl::setArea(PetArea newArea) {
 	}
 
 	makeDirty();
+	return newArea;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index ce40eba..02a59fd 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -51,9 +51,9 @@ private:
 	CPetControlSub5 _sub5;
 	CPetControlSub7 _sub7;
 	CPetControlSub8 _sub8;
-	int _field1384;
+	CTreeItem *_treeItem1;
 	CString _string1;
-	int _field1394;
+	CTreeItem *_treeItem2;
 	CString _string2;
 	int _field13A4;
 private:
@@ -62,9 +62,20 @@ private:
 	 */
 	bool isValid() const;
 
-	void loadSubObjects(SimpleFile *file, int param);
+	/**
+	 * Loads data for the individual areas
+	 */
+	void loadAreas(SimpleFile *file, int param);
 
-	void saveSubObjects(SimpleFile *file, int indent) const;
+	/**
+	 * Saves data for the individual areas
+	 */
+	void saveAreas(SimpleFile *file, int indent) const;
+
+	/**
+	 * Called at the end of the post game-load handling
+	 */
+	void loaded();
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index ceada29..4a13352 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -77,7 +77,10 @@ public:
 	 */
 	virtual void load(SimpleFile *file, int param) {}
 
-	virtual void proc19() {}
+	/**
+	 * Called after a game has been loaded
+	 */
+	virtual void postLoad() {}
 
 	/**
 	 * Save the data for the class to file


Commit: fe79317bdefe9594561cf45afe2ad476b1ac06ff
    https://github.com/scummvm/scummvm/commit/fe79317bdefe9594561cf45afe2ad476b1ac06ff
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-29T22:57:22-04:00

Commit Message:
TITANIC: Beginnings of PET drawing

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/television.cpp
    engines/titanic/main_game_window.cpp
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_control_sub8.cpp
    engines/titanic/pet_control/pet_control_sub8.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index ac02f62..1cdc6cd 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -301,21 +301,16 @@ void CGameObject::setVisible(bool val) {
 	}
 }
 
-bool CGameObject::petFn1(int val) {
-	CPetControl *pet = getPetControl();
-	return pet ? pet->fn1(val) : true;
-}
-
 void CGameObject::petFn2(int val) {
 	CPetControl *pet = getPetControl();
 	if (pet)
 		pet->fn2(val);
 }
 
-void CGameObject::petFn3(int val) {
+void CGameObject::petFn3(CTreeItem *item) {
 	CPetControl *pet = getPetControl();
 	if (pet)
-		pet->fn3(val);
+		pet->fn3(item);
 }
 
 void CGameObject::fn1(int val1, int val2, int val3) {
@@ -362,4 +357,10 @@ bool CGameObject::checkStartDragging(CMouseDragStartMsg *msg) {
 	}
 }
 
+void CGameObject::setPetArea(PetArea newArea) const {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->setArea(newArea);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 9a07cd1..3f12123 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -27,6 +27,7 @@
 #include "titanic/rect.h"
 #include "titanic/core/movie_clip.h"
 #include "titanic/core/named_item.h"
+#include "titanic/pet_control/pet_section.h"
 
 namespace Titanic {
 
@@ -109,12 +110,16 @@ protected:
 	 */
 	void makeDirty();
 
+	/**
+	 * Sets a new area in the PET
+	 */
+	void setPetArea(PetArea newArea) const;
+
 	bool soundFn1(int val);
 	void soundFn2(int val, int val2);
 	void setVisible(bool val);
-	bool petFn1(int val);
 	void petFn2(int val);
-	void petFn3(int val);
+	void petFn3(CTreeItem *item);
 public:
 	int _field60;
 	CursorId _cursorId;
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index ffec1bc..c11d446 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -121,7 +121,7 @@ bool CTelevision::handleMessage(CChangeSeasonMsg &msg) {
 }
 
 bool CTelevision::handleMessage(CEnterViewMsg &msg) {
-	petFn1(2);
+	setPetArea(PET_REMOTE);
 	petFn2(2);
 	petFn3(0);
 	setVisible(0);
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 0b0bb92..6abe83b 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -147,7 +147,7 @@ void CMainGameWindow::drawPet(CScreenManager *screenManager) {
 	if (_gameView && _gameView->_surface) {
 		CPetControl *petControl = _gameManager->_project->getPetControl();
 		if (petControl)
-			petControl->proc26();
+			petControl->draw(screenManager);
 	}
 }
 
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index db053ca..9f24b4b 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -81,8 +81,46 @@ void CPetControl::saveAreas(SimpleFile *file, int indent) const {
 	_sub8.save(file, indent);
 }
 
-void CPetControl::proc26() {
-	warning("TODO: CPetControl::proc26");
+void CPetControl::draw(CScreenManager *screenManager) {
+	CGameManager *gameManager = getGameManager();
+	Rect bounds = _oldBounds;
+	bounds.constrain(gameManager->_bounds);
+
+	if (!bounds.isEmpty()) {
+		if (_fieldC8 >= 0) {
+			_invSection.proc5(_fieldC8);
+			_fieldC8 = -1;
+		}
+
+		_sub8.drawFrame(screenManager);
+
+		// Draw the specific area that's currently active
+		switch (_currentArea) {
+		case PET_INVENTORY:
+			_invSection.draw(screenManager);
+			break;
+		case PET_CONVERSATION:
+			_convSection.draw(screenManager);
+			break;
+		case PET_REMOTE:
+			_remoteSection.draw(screenManager);
+			break;
+		case PET_ROOMS:
+			_roomsSection.draw(screenManager);
+			break;
+		case PET_SAVE:
+			_saveSection.draw(screenManager);
+			break;
+		case PET_5:
+			_sub5.draw(screenManager);
+			break;
+		case PET_6:
+			_sub7.draw(screenManager);
+			break;
+		default:
+			break;
+		}
+	}
 }
 
 void CPetControl::postLoad() {
@@ -127,14 +165,6 @@ bool CPetControl::fn1(int val) {
 	return false;
 }
 
-void CPetControl::fn2(int val) {
-	warning("TODO: CPetControl::fn2");
-}
-
-void CPetControl::fn3(int val) {
-	warning("TODO: CPetControl::fn3");
-}
-
 void CPetControl::fn4() {
 	warning("TODO: CPetControl::fn4");
 }
@@ -207,4 +237,40 @@ PetArea CPetControl::setArea(PetArea newArea) {
 	return newArea;
 }
 
+void CPetControl::fn2(int val) {
+	switch (_currentArea) {
+	case PET_INVENTORY:
+		_invSection.proc38(val);
+		break;
+	case PET_CONVERSATION:
+		_convSection.proc38(val);
+		break;
+	case PET_REMOTE:
+		_remoteSection.proc38(val);
+		break;
+	case PET_ROOMS:
+		_roomsSection.proc38(val);
+		break;
+	case PET_SAVE:
+		_saveSection.proc38(val);
+		break;
+	case PET_5:
+		_sub5.proc38(val);
+		break;
+	case PET_6:
+		_sub7.proc38(val);
+		break;
+	default:
+		break;
+	}
+}
+
+void CPetControl::fn3(CTreeItem *item) {
+	_treeItem2 = item;
+	if (item)
+		_string2 = item->getName();
+	else
+		_string2.clear();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 02a59fd..fa21d4b 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -56,6 +56,7 @@ private:
 	CTreeItem *_treeItem2;
 	CString _string2;
 	int _field13A4;
+	Rect _oldBounds;
 private:
 	/**
 	 * Returns true if the control is in a valid state
@@ -89,7 +90,10 @@ public:
 	 */
 	virtual void load(SimpleFile *file);
 
-	virtual void proc26();
+	/**
+	 * Allows the item to draw itself
+	 */
+	virtual void draw(CScreenManager *screenManager);
 
 	/**
 	 * Called after loading a game has finished
@@ -115,7 +119,7 @@ public:
 
 	void fn2(int val);
 
-	void fn3(int val);
+	void fn3(CTreeItem *item);
 
 	void fn4();
 
diff --git a/engines/titanic/pet_control/pet_control_sub8.cpp b/engines/titanic/pet_control/pet_control_sub8.cpp
index bc577e3..7d54b87 100644
--- a/engines/titanic/pet_control/pet_control_sub8.cpp
+++ b/engines/titanic/pet_control/pet_control_sub8.cpp
@@ -37,4 +37,8 @@ void CPetControlSub8::setArea(PetArea newArea) {
 	warning("TODO: CPetControlSub8::setArea");
 }
 
+void CPetControlSub8::drawFrame(CScreenManager *screenManager) {
+	warning("TODO: CPetControlSub8::drawFrame");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub8.h b/engines/titanic/pet_control/pet_control_sub8.h
index 20d260d..716a026 100644
--- a/engines/titanic/pet_control/pet_control_sub8.h
+++ b/engines/titanic/pet_control/pet_control_sub8.h
@@ -43,6 +43,8 @@ public:
 	CPetControlSub8();
 
 	void setArea(PetArea newArea);
+
+	void drawFrame(CScreenManager *screenManager);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 4a13352..12e4626 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -24,7 +24,6 @@
 #define TITANIC_PET_SECTION_H
 
 #include "titanic/simple_file.h"
-#include "titanic/core/room_item.h"
 
 namespace Titanic {
 
@@ -33,6 +32,9 @@ enum PetArea {
 	PET_ROOMS = 3, PET_SAVE = 4, PET_5 = 5, PET_6 = 6
 };
 
+class CScreenManager;
+class CRoomItem;
+
 struct CPetSectionSubData {
 	int _field0;
 	int _field4;
@@ -52,9 +54,9 @@ public:
 
 	virtual int proc1() { return 0; }
 	virtual int proc2() { return 0; }
-	virtual void proc3() {}
+	virtual void draw(CScreenManager *screenManager) {}
 	virtual void proc4();
-	virtual void proc5() {}
+	virtual void proc5(int val) {}
 	virtual int proc6() { return 0; }
 	virtual int proc7() { return 0; }
 	virtual int proc8() { return 0; }
@@ -117,7 +119,7 @@ public:
 	virtual void proc35() {}
 	virtual void proc36() {}
 	virtual void proc37() {}
-	virtual void proc38() {}
+	virtual void proc38(int val) {}
 };
 
 } // End of namespace Titanic


Commit: fee937c6ef5a47d3fdb3dd33af16fee1928c2691
    https://github.com/scummvm/scummvm/commit/fee937c6ef5a47d3fdb3dd33af16fee1928c2691
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-29T23:08:37-04:00

Commit Message:
TITANIC: Debugger command to turn PET on or off

Changed paths:
    engines/titanic/debugger.cpp
    engines/titanic/debugger.h



diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp
index 3bd2d0f..84f961e 100644
--- a/engines/titanic/debugger.cpp
+++ b/engines/titanic/debugger.cpp
@@ -27,9 +27,10 @@
 namespace Titanic {
 
 Debugger::Debugger(TitanicEngine *vm) : GUI::Debugger(), _vm(vm) {
-	registerCmd("continue",	     WRAP_METHOD(Debugger, cmdExit));
-	registerCmd("dump",         WRAP_METHOD(Debugger, cmdDump));
-	registerCmd("room",          WRAP_METHOD(Debugger, cmdRoom));
+	registerCmd("continue",		WRAP_METHOD(Debugger, cmdExit));
+	registerCmd("dump",			WRAP_METHOD(Debugger, cmdDump));
+	registerCmd("room",			WRAP_METHOD(Debugger, cmdRoom));
+	registerCmd("pet",			WRAP_METHOD(Debugger, cmdPET));
 }
 
 int Debugger::strToInt(const char *s) {
@@ -181,4 +182,29 @@ bool Debugger::cmdRoom(int argc, const char **argv) {
 	return true;
 }
 
+bool Debugger::cmdPET(int argc, const char **argv) {
+	CGameManager &gameManager = *g_vm->_window->_gameManager;
+	CGameState &gameState = gameManager._gameState;
+
+	if (argc == 2) {
+		CString s(argv[1]);
+		s.toLowercase();
+
+		if (s == "on") {
+			gameState._petActive = true;
+			gameManager.update();
+			debugPrintf("PET is now on\n");
+			return true;
+		} else if (s == "off") {
+			gameState._petActive = false;
+			gameManager.update();
+			debugPrintf("PET is now off\n");
+			return true;
+		}
+	}
+	
+	debugPrintf("%s [on | off]\n", argv[0]);
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/debugger.h b/engines/titanic/debugger.h
index 2f3bb91..29e82d6 100644
--- a/engines/titanic/debugger.h
+++ b/engines/titanic/debugger.h
@@ -79,6 +79,11 @@ private:
 	 * List room details, or jump to a specific view
 	 */
 	bool cmdRoom(int argc, const char **argv);
+
+	/**
+	 * Turn the PET on or off
+	 */
+	bool cmdPET(int argc, const char **argv);
 protected:
 	TitanicEngine *_vm;
 public:


Commit: 08a801b1128d63e5c2cedee218a6dce7d6f04f28
    https://github.com/scummvm/scummvm/commit/08a801b1128d63e5c2cedee218a6dce7d6f04f28
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-30T20:11:02-04:00

Commit Message:
TITANIC: Flesh out the CPETElement class

Changed paths:
  A engines/titanic/pet_control/pet_element.cpp
  A engines/titanic/pet_control/pet_element.h
  R engines/titanic/pet_control/pet_val_base.cpp
  R engines/titanic/pet_control/pet_val_base.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/pet/pet_val_base.h
    engines/titanic/module.mk
    engines/titanic/movie.cpp
    engines/titanic/movie.h
    engines/titanic/pet_control/pet_val.cpp
    engines/titanic/pet_control/pet_val.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 1cdc6cd..759c853 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -363,4 +363,16 @@ void CGameObject::setPetArea(PetArea newArea) const {
 		pet->setArea(newArea);
 }
 
+bool CGameObject::hasActiveMovie() const {
+	if (_surface && _surface->_movie)
+		return _surface->_movie->isActive();
+	return false;
+}
+
+int CGameObject::getMovie19() const {
+	if (_surface && _surface->_movie)
+		return _surface->_movie->proc19();
+	return _field78;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 3f12123..68ddf97 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -81,11 +81,6 @@ protected:
 	int _fieldB8;
 protected:
 	/**
-	 * Loads a frame
-	 */
-	void loadFrame(int frameNumber);
-
-	/**
 	 * Saves the current position the object is located at
 	 */
 	void savePosition();
@@ -164,6 +159,18 @@ public:
 	 * Set the position of the object
 	 */
 	void setPosition(const Common::Point &newPos);
+
+	/**
+	 * Returns true if the object has a currently active movie
+	 */
+	bool hasActiveMovie() const;
+
+	int getMovie19() const;
+
+	/**
+	 * Loads a frame
+	 */
+	void loadFrame(int frameNumber);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/pet/pet_val_base.h b/engines/titanic/game/pet/pet_val_base.h
index 310b067..cdb2808 100644
--- a/engines/titanic/game/pet/pet_val_base.h
+++ b/engines/titanic/game/pet/pet_val_base.h
@@ -20,12 +20,12 @@
  *
  */
 
-#ifndef TITANIC_PET_VAL_BASE_H
-#define TITANIC_PET_VAL_BASE_H
+#ifndef TITANIC_pet_element_H
+#define TITANIC_pet_element_H
 
 namespace Titanic {
 
-class CPetValBase {
+class CPetElement {
 protected:
 	int _field4;
 	int _field8;
@@ -33,7 +33,7 @@ protected:
 	int _field10;
 	int _field14;
 public:
-	CPetValBase();
+	CPetElement();
 
 	virtual void proc1() {}
 	virtual void proc2() {}
@@ -58,4 +58,4 @@ public:
 
 } // End of namespace Titanic
 
-#endif /* TITANIC_PET_VAL_BASE_H */
+#endif /* TITANIC_pet_element_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index a72e80d..d0e4164 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -383,6 +383,7 @@ MODULE_OBJS := \
 	pet_control/pet_control_list_item.o \
 	pet_control/pet_control_list_item2.o \
 	pet_control/pet_conversation_section.o \
+	pet_control/pet_element.o \
 	pet_control/pet_inventory_section.o \
 	pet_control/pet_rooms_section.o \
 	pet_control/pet_remote_section.o \
@@ -394,7 +395,6 @@ MODULE_OBJS := \
 	pet_control/pet_control_sub10.o \
 	pet_control/pet_control_sub11.o \
 	pet_control/pet_control_sub12.o \
-	pet_control/pet_val_base.o \
 	pet_control/pet_val.o \
 	sound/auto_music_player.o \
 	sound/auto_music_player_base.o \
diff --git a/engines/titanic/movie.cpp b/engines/titanic/movie.cpp
index 09c02a7..28284f9 100644
--- a/engines/titanic/movie.cpp
+++ b/engines/titanic/movie.cpp
@@ -25,6 +25,12 @@
 
 namespace Titanic {
 
+bool CMovie::isActive() const {
+	return g_vm->_movieList.contains(this);
+}
+
+/*------------------------------------------------------------------------*/
+
 OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) : _videoSurface(surface) {
 //	_aviDecoder.loadFile(name.getString());
 }
@@ -79,8 +85,9 @@ void OSMovie::proc18() {
 	warning("TODO: OSMovie::proc18");
 }
 
-void OSMovie::proc19() {
+int OSMovie::proc19() {
 	warning("TODO: OSMovie::proc19");
+	return 0;
 }
 
 void OSMovie::proc20() {
@@ -92,10 +99,4 @@ void *OSMovie::proc21() {
 	return nullptr;
 }
 
-bool OSMovie::isInGlobalList() const {
-	return g_vm->_movieList.contains(this);
-}
-
-/*------------------------------------------------------------------------*/
-
 } // End of namespace Titanic
diff --git a/engines/titanic/movie.h b/engines/titanic/movie.h
index 4a5777a..ea0b1ea 100644
--- a/engines/titanic/movie.h
+++ b/engines/titanic/movie.h
@@ -44,9 +44,11 @@ public:
 	virtual void proc16() = 0;
 	virtual void proc17() = 0;
 	virtual void proc18() = 0;
-	virtual void proc19() = 0;
+	virtual int proc19() = 0;
 	virtual void proc20() = 0;
 	virtual void *proc21() = 0;
+
+	bool isActive() const;
 };
 
 class OSMovie : public CMovie {
@@ -72,11 +74,9 @@ public:
 	virtual void proc16();
 	virtual void proc17();
 	virtual void proc18();
-	virtual void proc19();
+	virtual int proc19();
 	virtual void proc20();
 	virtual void *proc21();
-
-	bool isInGlobalList() const;
 };
 
 class CGlobalMovies : public List<CMovie> {
diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
new file mode 100644
index 0000000..39d8fea
--- /dev/null
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -0,0 +1,100 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/pet_control/pet_element.h"
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+CPetElement::CPetElement() : _mode(MODE_0) {}
+
+void CPetElement::getBounds(Rect *rect) {
+	if (rect)
+		*rect = Rect();
+}
+
+bool CPetElement::proc6(const Common::Point &pt) {
+	bool result = _bounds.contains(pt);
+	if (result)
+		setMode(MODE_1);
+	return result;
+}
+
+bool CPetElement::proc7(const Common::Point &pt) {
+	bool result = _bounds.contains(pt);
+	if (result)
+		setMode(MODE_0);
+	return result;
+}
+
+bool CPetElement::contains1(const Common::Point &pt) const {
+	return _bounds.contains(pt);
+}
+
+int CPetElement::proc9(const Common::Point &pt) {
+	bool result = _bounds.contains(pt);
+	if (result)
+		setMode(MODE_2);
+	return result;
+}
+
+bool CPetElement::contains2(const Common::Point &pt) const {
+	return _bounds.contains(pt);
+}
+
+void CPetElement::proc11(int val1, int val2) const {
+	CGameObject *gameObject = getObject();
+
+	if (gameObject)
+		gameObject->fn1(val1, val2, 0);
+}
+
+void CPetElement::changeStatus(int newStatus) const {
+	CGameObject *gameObject = getObject();
+
+	if (gameObject)
+		gameObject->changeStatus(newStatus);
+}
+
+bool CPetElement::hasActiveMovie() const {
+	CGameObject *gameObject = getObject();
+	return gameObject ? gameObject->hasActiveMovie() : false;
+}
+
+void CPetElement::loadFrame(int frameNumber) {
+	CGameObject *gameObject = getObject();
+	if (gameObject)
+		gameObject->loadFrame(frameNumber);
+}
+
+int CPetElement::proc15() {
+	CGameObject *gameObject = getObject();
+	return gameObject ? gameObject->getMovie19() : 0;
+}
+
+void CPetElement::setMode(PetElementMode newMode) {
+	if (newMode >= MODE_0 && newMode <= MODE_2)
+		changeMode(newMode);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
new file mode 100644
index 0000000..66f57c4
--- /dev/null
+++ b/engines/titanic/pet_control/pet_element.h
@@ -0,0 +1,104 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_ELEMENT_H
+#define TITANIC_PET_ELEMENT_H
+
+#include "titanic/simple_file.h"
+#include "titanic/core/link_item.h"
+
+namespace Titanic {
+
+enum PetElementMode { MODE_0 = 0, MODE_1 = 1, MODE_2 = 2 };
+
+class CGameObject;
+
+class CPetElement {
+protected:
+	Common::Rect _bounds;
+	PetElementMode _mode;
+public:
+	CPetElement();
+	virtual ~CPetElement() {}
+
+	virtual void proc1() {}
+	virtual void proc2() {}
+	
+	/**
+	 * Draw the item
+	 */
+	virtual void draw() {}
+	
+	virtual void proc4() {}
+
+	/**
+	 * Get the bounds for the element
+	 */
+	virtual void getBounds(Rect *rect);
+
+	virtual bool proc6(const Common::Point &pt);
+	virtual bool proc7(const Common::Point &pt);
+
+	/**
+	 * Returns whether the passed point falls inside the item
+	 */
+	virtual bool contains1(const Common::Point &pt) const;
+
+	virtual int proc9(const Common::Point &pt);
+
+	/**
+	 * Returns whether the passed point falls inside the item
+	 */
+	virtual bool contains2(const Common::Point &pt) const;
+
+	virtual void proc11(int val1, int val2) const;
+
+	/**
+	 * Change the status of the associated object
+	 */
+	virtual void changeStatus(int newStatus) const;
+
+	/**
+	 * Returns true if the object associated with the item has an active movie
+	 */
+	virtual bool hasActiveMovie() const;
+
+	/**
+	 * Loads a frame
+	 */
+	virtual void loadFrame(int frameNumber);
+
+	virtual int proc15();
+
+	/**
+	 * Get the game object associated with this item
+	 */
+	virtual CGameObject *getObject() const { return nullptr; }
+
+	virtual void changeMode(PetElementMode newMode) { _mode = newMode; }
+
+	void setMode(PetElementMode mode);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_ELEMENT_H */
diff --git a/engines/titanic/pet_control/pet_val.cpp b/engines/titanic/pet_control/pet_val.cpp
index 5bc2375..754bda5 100644
--- a/engines/titanic/pet_control/pet_val.cpp
+++ b/engines/titanic/pet_control/pet_val.cpp
@@ -46,12 +46,12 @@ void CPetVal::proc5(Rect *rect) {
 }
 
 int CPetVal::proc16() {
-	switch (_field14) {
-	case 0:
+	switch (_mode) {
+	case MODE_0:
 		return _field18;
-	case 1:
+	case MODE_1:
 		return _field1C;
-	case 2:
+	case MODE_2:
 		return _field20;
 	default:
 		return 0;
diff --git a/engines/titanic/pet_control/pet_val.h b/engines/titanic/pet_control/pet_val.h
index 0e909d4..6d19ddb 100644
--- a/engines/titanic/pet_control/pet_val.h
+++ b/engines/titanic/pet_control/pet_val.h
@@ -23,17 +23,17 @@
 #ifndef TITANIC_PET_VAL_H
 #define TITANIC_PET_VAL_H
 
-#include "titanic/pet_control/pet_val_base.h"
+#include "titanic/pet_control/pet_element.h"
 
 namespace Titanic {
 
-class CPetVal: public CPetValBase {
+class CPetVal: public CPetElement {
 protected:
 	int _field18;
 	int _field1C;
 	int _field20;
 public:
-	CPetVal() : CPetValBase(), _field18(0), _field1C(0), _field20(0) {}
+	CPetVal() : CPetElement(), _field18(0), _field1C(0), _field20(0) {}
 
 	virtual void proc1();
 	virtual void proc2();
diff --git a/engines/titanic/pet_control/pet_val_base.cpp b/engines/titanic/pet_control/pet_val_base.cpp
deleted file mode 100644
index 9a23854..0000000
--- a/engines/titanic/pet_control/pet_val_base.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/textconsole.h"
-#include "titanic/pet_control/pet_val_base.h"
-
-namespace Titanic {
-
-CPetValBase::CPetValBase() : _field4(0), _field8(0), _fieldC(0),
-		_field10(0), _field14(0) {}
-
-void CPetValBase::proc5(Rect *rect) {
-	if (rect)
-		*rect = Rect();
-}
-
-int CPetValBase::proc6() {
-	error("TODO");
-}
-
-int CPetValBase::proc7() {
-	error("TODO");
-}
-
-void CPetValBase::proc8() {
-	error("TODO");
-}
-
-int CPetValBase::proc9() {
-	error("TODO");
-}
-
-void CPetValBase::proc10() {
-	error("TODO");
-}
-
-void CPetValBase::proc11() {
-	error("TODO");
-}
-
-void CPetValBase::proc12() {
-	error("TODO");
-}
-
-void CPetValBase::proc13() {
-	error("TODO");
-}
-
-void CPetValBase::proc14() {
-	error("TODO");
-}
-
-void CPetValBase::proc15() {
-	error("TODO");
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_val_base.h b/engines/titanic/pet_control/pet_val_base.h
deleted file mode 100644
index 637e95f..0000000
--- a/engines/titanic/pet_control/pet_val_base.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_VAL_BASE_H
-#define TITANIC_PET_VAL_BASE_H
-
-#include "titanic/simple_file.h"
-#include "titanic/core/link_item.h"
-
-namespace Titanic {
-
-class CPetValBase {
-protected:
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
-	int _field14;
-public:
-	CPetValBase();
-	virtual ~CPetValBase() {}
-
-	virtual void proc1() {}
-	virtual void proc2() {}
-	virtual void proc3() {}
-	virtual void proc4() {}
-
-	virtual void proc5(Rect *rect);
-
-	virtual int proc6();
-	virtual int proc7();
-	virtual void proc8();
-	virtual int proc9();
-	virtual void proc10();
-	virtual void proc11();
-	virtual void proc12();
-	virtual void proc13();
-	virtual void proc14();
-	virtual void proc15();
-
-	virtual int proc16() { return 0; }
-
-	virtual void proc17(int v) { _field14 = v; }
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_VAL_BASE_H */


Commit: 348b2d4b4bf9c6e8c6ca134ce7968eb9e9521a9c
    https://github.com/scummvm/scummvm/commit/348b2d4b4bf9c6e8c6ca134ce7968eb9e9521a9c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-30T21:01:51-04:00

Commit Message:
TITANIC: Fleshing out CPetVal

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/movie.cpp
    engines/titanic/movie.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_val.cpp
    engines/titanic/pet_control/pet_val.h
    engines/titanic/simple_file.cpp
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 759c853..bb1541c 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -375,4 +375,8 @@ int CGameObject::getMovie19() const {
 	return _field78;
 }
 
+int CGameObject::getSurface45() const {
+	return _surface ? _surface->proc45() : 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 68ddf97..bacb730 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -166,6 +166,7 @@ public:
 	bool hasActiveMovie() const;
 
 	int getMovie19() const;
+	int getSurface45() const;
 
 	/**
 	 * Loads a frame
diff --git a/engines/titanic/movie.cpp b/engines/titanic/movie.cpp
index 28284f9..193b2ca 100644
--- a/engines/titanic/movie.cpp
+++ b/engines/titanic/movie.cpp
@@ -25,10 +25,22 @@
 
 namespace Titanic {
 
+CMovie::CMovie() : ListItem(), _state(0), _field10(0) {
+}
+
 bool CMovie::isActive() const {
 	return g_vm->_movieList.contains(this);
 }
 
+bool CMovie::get10() {
+	if (_field10) {
+		_field10 = 0;
+		return true;
+	} else {
+		return false;
+	}
+}
+
 /*------------------------------------------------------------------------*/
 
 OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) : _videoSurface(surface) {
diff --git a/engines/titanic/movie.h b/engines/titanic/movie.h
index ea0b1ea..3529409 100644
--- a/engines/titanic/movie.h
+++ b/engines/titanic/movie.h
@@ -32,7 +32,12 @@ namespace Titanic {
 class CVideoSurface;
 
 class CMovie : public ListItem {
+protected:
+	int _state;
+	int _field10;
 public:
+	CMovie();
+
 	virtual void proc8(int v1, CVideoSurface *surface) = 0;
 	virtual void proc9() = 0;
 	virtual void proc10() = 0;
@@ -49,6 +54,8 @@ public:
 	virtual void *proc21() = 0;
 
 	bool isActive() const;
+
+	bool get10();
 };
 
 class OSMovie : public CMovie {
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 9f24b4b..ad1d0b6 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -27,6 +27,11 @@
 
 namespace Titanic {
 
+CPetControl::CPetControl() : CGameObject(), 
+	_currentArea(PET_CONVERSATION), _fieldC0(0), _locked(0), _fieldC8(0),
+	_treeItem1(nullptr), _treeItem2(nullptr), _hiddenRoom(nullptr) {
+}
+
 void CPetControl::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(0, indent);
 	file->writeNumberLine(_currentArea, indent);
@@ -273,4 +278,31 @@ void CPetControl::fn3(CTreeItem *item) {
 		_string2.clear();
 }
 
+CRoomItem *CPetControl::getHiddenRoom() {
+	if (!_hiddenRoom)
+		_hiddenRoom = getHiddenRoom();
+
+	return _hiddenRoom;
+}
+
+CGameObject *CPetControl::findItemInRoom(CRoomItem *room, 
+		const CString &name) const {
+	if (!room)
+		return nullptr;
+
+	for (CTreeItem *treeItem = room->getFirstChild(); treeItem;
+			treeItem = treeItem->scan(room)) {
+		if (!treeItem->getName().compareTo(name)) {
+			return dynamic_cast<CGameObject *>(treeItem);
+		}
+	}
+
+	return nullptr;
+}
+
+CGameObject *CPetControl::getHiddenObject(const CString &name) {
+	CRoomItem *room = getHiddenRoom();
+	return room ? findItemInRoom(room, name) : nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index fa21d4b..1bb2088 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -55,7 +55,7 @@ private:
 	CString _string1;
 	CTreeItem *_treeItem2;
 	CString _string2;
-	int _field13A4;
+	CRoomItem *_hiddenRoom;
 	Rect _oldBounds;
 private:
 	/**
@@ -77,8 +77,19 @@ private:
 	 * Called at the end of the post game-load handling
 	 */
 	void loaded();
+
+	/**
+	 * Scan the specified room for an item by name
+	 */
+	CGameObject *findItemInRoom(CRoomItem *room, const CString &name) const;
+
+	/**
+	 * Returns a reference to the special hidden room container
+	 */
+	CRoomItem *getHiddenRoom();
 public:
 	CLASSDEF
+	CPetControl();
 
 	/**
 	 * Save the data for the class to file
@@ -132,6 +143,12 @@ public:
 	 * Returns true if the current area can be changed
 	 */
 	bool canChangeArea() const { return _locked == 0; }
+
+	/**
+	 * Returns a game object used by the PET by name from within the
+	 * special hidden room container
+	 */
+	CGameObject *getHiddenObject(const CString &name);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index 66f57c4..19a94c2 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -24,6 +24,7 @@
 #define TITANIC_PET_ELEMENT_H
 
 #include "titanic/simple_file.h"
+#include "titanic/string.h"
 #include "titanic/core/link_item.h"
 
 namespace Titanic {
@@ -31,16 +32,22 @@ namespace Titanic {
 enum PetElementMode { MODE_0 = 0, MODE_1 = 1, MODE_2 = 2 };
 
 class CGameObject;
+class CPetControl;
 
 class CPetElement {
 protected:
-	Common::Rect _bounds;
+	Rect _bounds;
 	PetElementMode _mode;
 public:
 	CPetElement();
 	virtual ~CPetElement() {}
 
-	virtual void proc1() {}
+	/**
+	 * Load an object into the element
+	 */
+	virtual void loadObject(PetElementMode mode, const CString &name,
+		CPetControl *petControl) {}
+
 	virtual void proc2() {}
 	
 	/**
diff --git a/engines/titanic/pet_control/pet_val.cpp b/engines/titanic/pet_control/pet_val.cpp
index 754bda5..cc48dc3 100644
--- a/engines/titanic/pet_control/pet_val.cpp
+++ b/engines/titanic/pet_control/pet_val.cpp
@@ -21,12 +21,27 @@
  */
 
 #include "common/textconsole.h"
+#include "titanic/core/game_object.h"
 #include "titanic/pet_control/pet_val.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
-void CPetVal::proc1() {
-	error("TODO");
+void CPetVal::loadObject(PetElementMode mode, const CString &name,
+		CPetControl *petControl) {
+	switch (mode) {
+	case MODE_0:
+		_object0 = petControl->getHiddenObject(name);
+		break;
+	case MODE_1:
+		_object1 = petControl->getHiddenObject(name);
+		break;
+	case MODE_2:
+		_object2 = petControl->getHiddenObject(name);
+		break;
+	default:
+		break;
+	}
 }
 
 void CPetVal::proc2() {
@@ -41,20 +56,30 @@ void CPetVal::proc4() {
 	error("TODO");
 }
 
-void CPetVal::proc5(Rect *rect) {
-	error("TODO");
+
+void CPetVal::getBounds(Rect *rect) {
+	if (rect) {
+		CGameObject *obj = getObject();
+		if (!obj)
+			obj = _object0;
+
+		if (obj && obj->getSurface45())
+			*rect = _bounds;
+		else
+			rect->clear();
+	}
 }
 
-int CPetVal::proc16() {
+CGameObject *CPetVal::getObject() const {
 	switch (_mode) {
 	case MODE_0:
-		return _field18;
+		return _object0;
 	case MODE_1:
-		return _field1C;
+		return _object1;
 	case MODE_2:
-		return _field20;
+		return _object2;
 	default:
-		return 0;
+		return nullptr;
 	}
 }
 
diff --git a/engines/titanic/pet_control/pet_val.h b/engines/titanic/pet_control/pet_val.h
index 6d19ddb..90e8cfa 100644
--- a/engines/titanic/pet_control/pet_val.h
+++ b/engines/titanic/pet_control/pet_val.h
@@ -29,20 +29,32 @@ namespace Titanic {
 
 class CPetVal: public CPetElement {
 protected:
-	int _field18;
-	int _field1C;
-	int _field20;
+	CGameObject *_object0;
+	CGameObject *_object1;
+	CGameObject *_object2;
 public:
-	CPetVal() : CPetElement(), _field18(0), _field1C(0), _field20(0) {}
+	CPetVal() : CPetElement(), _object0(nullptr), _object1(nullptr),
+		_object2(nullptr) {}
+
+	/**
+	 * Load an object into the element
+	 */
+	virtual void loadObject(PetElementMode mode, const CString &name,
+		CPetControl *petControl);
 
-	virtual void proc1();
 	virtual void proc2();
 	virtual void proc3();
 	virtual void proc4();
 
-	virtual void proc5(Rect *linkItem);
+	/**
+	 * Get the bounds for the element
+	 */
+	virtual void getBounds(Rect *rect);
 
-	virtual int proc16();
+	/**
+	 * Get the game object associated with this item
+	 */
+	virtual CGameObject *getObject() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index 3cd0ef7..acf02e8 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -28,6 +28,7 @@ namespace Titanic {
 bool File::open(const Common::String &name) {
 	if (!Common::File::open(name))
 		error("Could not open file - %s", name.c_str());
+	return true;
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index d13356b..6f42346 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -66,7 +66,6 @@ void CTrueTalkManager::load(SimpleFile *file) {
 
 		int ident1 = file->readNumber();
 		int ident2 = file->readNumber();
-		int v = 0;
 
 		if (ident1 != MKTAG_BE('U', 'R', 'A', 'H')) {
 			while (ident2 != MKTAG_BE('A', 'K', 'E', 'R')) {
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index 6cbea17..520193f 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -151,6 +151,17 @@ uint CVideoSurface::getTransparencyColor() {
 	return val;
 }
 
+bool CVideoSurface::proc45() {
+	if (_field50) {
+		_field50 = 0;
+		return true;
+	} else if (_movie) {
+		return _movie->get10();
+	} else {
+		return false;
+	}
+}
+
 /*------------------------------------------------------------------------*/
 
 OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface) :
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 5a5ee5d..de18158 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -169,6 +169,8 @@ public:
 	 */
 	virtual bool load() = 0;
 
+	virtual bool proc45();
+
 	/**
 	 * Frees the underlying surface
 	 */


Commit: 948fb5bcca3a8d8594fd9e1f5470dac0448f74a9
    https://github.com/scummvm/scummvm/commit/948fb5bcca3a8d8594fd9e1f5470dac0448f74a9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-30T21:43:07-04:00

Commit Message:
TITANIC: Implement CPetVal drawing

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_val.cpp
    engines/titanic/pet_control/pet_val.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index bb1541c..ee7e071 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -202,6 +202,22 @@ void CGameObject::draw(CScreenManager *screenManager) {
 	}
 }
 
+void CGameObject::draw(CScreenManager *screenManager, const Common::Point &destPos) {
+	if (!_surface && !_resource.empty()) {
+		loadResource(_resource);
+		_resource.clear();
+	}
+
+	if (_surface) {
+		int xSize = _surface->getWidth();
+		int ySize = _surface->getHeight();
+
+		if (xSize > 0 && ySize > 0) {
+			screenManager->blitFrom(SURFACE_BACKBUFFER, _surface, &destPos);
+		}
+	}
+}
+
 void CGameObject::loadResource(const CString &name) {
 	switch (name.imageTypeSuffix()) {
 	case FILETYPE_IMAGE:
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index bacb730..b221a7e 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -138,6 +138,11 @@ public:
 	virtual void draw(CScreenManager *screenManager);
 
 	/**
+	 * Allows the item to draw itself
+	 */
+	virtual void draw(CScreenManager *screenManager, const Common::Point &destPos);
+
+	/**
 	 * Stops any movie currently playing for the object
 	 */
 	void stopMovie();
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index 19a94c2..330fbf2 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -53,9 +53,12 @@ public:
 	/**
 	 * Draw the item
 	 */
-	virtual void draw() {}
-	
-	virtual void proc4() {}
+	virtual void draw(CScreenManager *screenManager) {}
+
+	/**
+	 * Draw the item
+	 */
+	virtual void draw(CScreenManager *screenManager, const Common::Point &destPos) {}
 
 	/**
 	 * Get the bounds for the element
diff --git a/engines/titanic/pet_control/pet_val.cpp b/engines/titanic/pet_control/pet_val.cpp
index cc48dc3..096b284 100644
--- a/engines/titanic/pet_control/pet_val.cpp
+++ b/engines/titanic/pet_control/pet_val.cpp
@@ -48,14 +48,18 @@ void CPetVal::proc2() {
 	error("TODO");
 }
 
-void CPetVal::proc3() {
-	error("TODO");
+void CPetVal::draw(CScreenManager *screenManager) {
+	draw(screenManager, Common::Point(_bounds.left, _bounds.top));
 }
 
-void CPetVal::proc4() {
-	error("TODO");
-}
+void CPetVal::draw(CScreenManager *screenManager, const Common::Point &destPos) {
+	CGameObject *obj = getObject();
+	if (!obj)
+		obj = _object0;
 
+	if (obj)
+		obj->draw(screenManager, destPos);
+}
 
 void CPetVal::getBounds(Rect *rect) {
 	if (rect) {
diff --git a/engines/titanic/pet_control/pet_val.h b/engines/titanic/pet_control/pet_val.h
index 90e8cfa..90b7a2e 100644
--- a/engines/titanic/pet_control/pet_val.h
+++ b/engines/titanic/pet_control/pet_val.h
@@ -43,8 +43,16 @@ public:
 		CPetControl *petControl);
 
 	virtual void proc2();
-	virtual void proc3();
-	virtual void proc4();
+
+	/**
+	 * Draw the item
+	 */
+	virtual void draw(CScreenManager *screenManager);
+
+	/**
+	 * Draw the item
+	 */
+	virtual void draw(CScreenManager *screenManager, const Common::Point &destPos);
 
 	/**
 	 * Get the bounds for the element


Commit: c33bdcc09ff9949dec9330fc245bb8f97546875a
    https://github.com/scummvm/scummvm/commit/c33bdcc09ff9949dec9330fc245bb8f97546875a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-30T23:55:15-04:00

Commit Message:
TITANIC: Fleshing out CPetFrame

Changed paths:
  A engines/titanic/pet_control/pet_frame.cpp
  A engines/titanic/pet_control/pet_frame.h
  R engines/titanic/pet_control/pet_control_sub8.cpp
  R engines/titanic/pet_control/pet_control_sub8.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index d0e4164..cc3c186 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -384,6 +384,7 @@ MODULE_OBJS := \
 	pet_control/pet_control_list_item2.o \
 	pet_control/pet_conversation_section.o \
 	pet_control/pet_element.o \
+	pet_control/pet_frame.o \
 	pet_control/pet_inventory_section.o \
 	pet_control/pet_rooms_section.o \
 	pet_control/pet_remote_section.o \
@@ -391,7 +392,6 @@ MODULE_OBJS := \
 	pet_control/pet_section.o \
 	pet_control/pet_control_sub5.o \
 	pet_control/pet_control_sub7.o \
-	pet_control/pet_control_sub8.o \
 	pet_control/pet_control_sub10.o \
 	pet_control/pet_control_sub11.o \
 	pet_control/pet_control_sub12.o \
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index ad1d0b6..4fe0c1d 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -57,11 +57,15 @@ void CPetControl::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CPetControl::isValid() const {
-	return _convSection.isValid() && _roomsSection.isValid()
-		&& _remoteSection.isValid() && _invSection.isValid()
-		&& _sub5.isValid() && _saveSection.isValid()
-		&& _sub7.isValid() && _sub8.isValid();
+bool CPetControl::isValid() {
+	return _convSection.isValid(this) &&
+		_roomsSection.isValid(this) && 
+		_remoteSection.isValid(this) &&
+		_invSection.isValid(this) &&
+		_sub5.isValid(this) &&
+		_saveSection.isValid(this) &&
+		_sub7.isValid(this) &&
+		_frame.isValid(this);
 }
 
 void CPetControl::loadAreas(SimpleFile *file, int param) {
@@ -72,7 +76,7 @@ void CPetControl::loadAreas(SimpleFile *file, int param) {
 	_sub5.load(file, param);
 	_saveSection.load(file, param);
 	_sub7.load(file, param);
-	_sub8.load(file, param);
+	_frame.load(file, param);
 }
 
 void CPetControl::saveAreas(SimpleFile *file, int indent) const {
@@ -83,7 +87,7 @@ void CPetControl::saveAreas(SimpleFile *file, int indent) const {
 	_sub5.save(file, indent);
 	_saveSection.save(file, indent);
 	_sub7.save(file, indent);
-	_sub8.save(file, indent);
+	_frame.save(file, indent);
 }
 
 void CPetControl::draw(CScreenManager *screenManager) {
@@ -97,7 +101,7 @@ void CPetControl::draw(CScreenManager *screenManager) {
 			_fieldC8 = -1;
 		}
 
-		_sub8.drawFrame(screenManager);
+		_frame.drawFrame(screenManager);
 
 		// Draw the specific area that's currently active
 		switch (_currentArea) {
@@ -148,7 +152,7 @@ void CPetControl::loaded() {
 	_sub5.postLoad();
 	_saveSection.postLoad();
 	_sub7.postLoad();
-	_sub8.postLoad();
+	_frame.postLoad();
 }
 
 void CPetControl::enterNode(CNodeItem *node) {
@@ -207,7 +211,7 @@ PetArea CPetControl::setArea(PetArea newArea) {
 
 	// Change the current area
 	PetArea oldArea = _currentArea;
-	_sub8.setArea(newArea);
+	_frame.setArea(newArea);
 	_currentArea = newArea;
 
 	// Signal to the new view that it's been activated
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 1bb2088..4f101ca 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -27,13 +27,13 @@
 #include "titanic/core/node_item.h"
 #include "titanic/core/room_item.h"
 #include "titanic/pet_control/pet_conversation_section.h"
+#include "titanic/pet_control/pet_frame.h"
 #include "titanic/pet_control/pet_inventory_section.h"
 #include "titanic/pet_control/pet_remote_section.h"
 #include "titanic/pet_control/pet_rooms_section.h"
 #include "titanic/pet_control/pet_save_section.h"
 #include "titanic/pet_control/pet_control_sub5.h"
 #include "titanic/pet_control/pet_control_sub7.h"
-#include "titanic/pet_control/pet_control_sub8.h"
 
 namespace Titanic {
 
@@ -50,7 +50,7 @@ private:
 	CPetSaveSection _saveSection;
 	CPetControlSub5 _sub5;
 	CPetControlSub7 _sub7;
-	CPetControlSub8 _sub8;
+	CPetFrame _frame;
 	CTreeItem *_treeItem1;
 	CString _string1;
 	CTreeItem *_treeItem2;
@@ -61,7 +61,7 @@ private:
 	/**
 	 * Returns true if the control is in a valid state
 	 */
-	bool isValid() const;
+	bool isValid();
 
 	/**
 	 * Loads data for the individual areas
diff --git a/engines/titanic/pet_control/pet_control_sub8.cpp b/engines/titanic/pet_control/pet_control_sub8.cpp
deleted file mode 100644
index 7d54b87..0000000
--- a/engines/titanic/pet_control/pet_control_sub8.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_control_sub8.h"
-
-namespace Titanic {
-
-static const int INDEXES[6] = { 1, 0, 2, 3, 4, 5 };
-
-int CPetControlSub8::_indexes[6];
-
-CPetControlSub8::CPetControlSub8() {
-	for (int idx = 0; idx < 6; ++idx)
-		_indexes[INDEXES[idx]] = idx;
-}
-
-void CPetControlSub8::setArea(PetArea newArea) {
-	warning("TODO: CPetControlSub8::setArea");
-}
-
-void CPetControlSub8::drawFrame(CScreenManager *screenManager) {
-	warning("TODO: CPetControlSub8::drawFrame");
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub8.h b/engines/titanic/pet_control/pet_control_sub8.h
deleted file mode 100644
index 716a026..0000000
--- a/engines/titanic/pet_control/pet_control_sub8.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB8_H
-#define TITANIC_PET_CONTROL_SUB8_H
-
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_val.h"
-
-namespace Titanic {
-
-class CPetControlSub8 : public CPetSection {
-private:
-	static int _indexes[6];
-
-	CPetVal _valArray1[6];
-	CPetVal _valArray2[6];
-	CPetVal _val1;
-	CPetVal _val2;
-	CPetVal _val3;
-	CPetVal _val4;
-	CPetVal _valArray3[7];
-public:
-	CPetControlSub8();
-
-	void setArea(PetArea newArea);
-
-	void drawFrame(CScreenManager *screenManager);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB8_H */
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index 330fbf2..e5ab8d3 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -43,12 +43,15 @@ public:
 	virtual ~CPetElement() {}
 
 	/**
-	 * Load an object into the element
+	 * Sets up the element
 	 */
-	virtual void loadObject(PetElementMode mode, const CString &name,
+	virtual void setup(PetElementMode mode, const CString &name,
 		CPetControl *petControl) {}
 
-	virtual void proc2() {}
+	/**
+	 * Sets up the element
+	 */
+	virtual void setup() {}
 	
 	/**
 	 * Draw the item
@@ -107,6 +110,16 @@ public:
 	virtual void changeMode(PetElementMode newMode) { _mode = newMode; }
 
 	void setMode(PetElementMode mode);
+
+	/**
+	 * Set the bounds for the element
+	 */
+	void setBounds(const Rect &r) { _bounds = r; }
+
+	/**
+	 * Translate the position of the element
+	 */
+	void translate(int deltaX, int deltaY) { _bounds.translate(deltaX, deltaY); }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
new file mode 100644
index 0000000..e94bc6c
--- /dev/null
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -0,0 +1,104 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_frame.h"
+
+namespace Titanic {
+
+static const int INDEXES[6] = { 1, 0, 2, 3, 4, 5 };
+
+int CPetFrame::_indexes[6];
+
+CPetFrame::CPetFrame() {
+	for (int idx = 0; idx < 6; ++idx)
+		_indexes[INDEXES[idx]] = idx;
+}
+
+bool CPetFrame::setup(CPetControl *petControl) {
+	if (setPetControl(petControl))
+		return setup();
+	return false;
+}
+
+bool CPetFrame::setup() {
+	if (_petControl) {
+		// TODO
+	}
+
+	return true;
+}
+
+bool CPetFrame::isValid(CPetControl *petControl) {
+	bool result = setPetControl(petControl);
+	if (result) {
+		_modeButtons[_indexes[0]].setMode(MODE_0);
+		_modeButtons[_indexes[4]].setMode(MODE_1);
+	}
+
+	return result;
+}
+
+void CPetFrame::postLoad() {
+	setup();
+}
+
+bool CPetFrame::setPetControl(CPetControl *petControl) {
+	if (petControl) {
+		_petControl = petControl;
+
+		// Set the bounds of the individual elements
+		_background.setBounds(Rect(20, 350, 620, 480));
+		_modeBackground.setBounds(Rect(590, 365, 611, 467));
+
+		Rect r(35, 373, 91, 429);
+		for (int idx = 0, xp = 0; xp < 490; ++idx, xp += 70) {
+			_indent[idx].setBounds(r);
+			_indent[idx].translate(xp, 0);
+		}
+
+		r = Rect(590, 365, 606, 381);
+		const int YLIST[] = { 7, 27, 45, 66, 84 };
+		for (int idx = 0; idx < 5; ++idx) {
+			_modeButtons[idx].setBounds(r);
+			_modeButtons[idx].translate(0, YLIST[idx]);
+		}
+		_modeButtons[_indexes[0]].setMode(MODE_1);
+		
+		const int XLIST[] = { 73, 54, 85, 109, 38, 71 };
+		for (int idx = 0; idx < 6; ++idx) {
+			_titles[idx].setBounds(Rect(0, 0, 110, 11));
+			_titles[idx].translate(XLIST[idx], 471);
+		}
+	}
+
+	return true;
+}
+
+void CPetFrame::setArea(PetArea newArea) {
+	warning("TODO: CPetFrame::setArea");
+}
+
+void CPetFrame::drawFrame(CScreenManager *screenManager) {
+	warning("TODO: CPetFrame::drawFrame");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_frame.h b/engines/titanic/pet_control/pet_frame.h
new file mode 100644
index 0000000..53adf1b
--- /dev/null
+++ b/engines/titanic/pet_control/pet_frame.h
@@ -0,0 +1,83 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_FRAME_H
+#define TITANIC_PET_FRAME_H
+
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_val.h"
+
+namespace Titanic {
+
+class CPetFrame : public CPetSection {
+private:
+	static int _indexes[6];
+
+	CPetVal _modeButtons[6];
+	CPetVal _titles[6];
+	CPetVal _modeBackground;
+	CPetVal _val2;
+	CPetVal _val3;
+	CPetVal _background;
+	CPetVal _indent[7];
+private:
+	/**
+	 * Called to set the owning PET instance and set some initial state
+	 */
+	bool setPetControl(CPetControl *petControl);
+public:
+	CPetFrame();
+
+	/**
+	 * Sets up the section
+	 */
+	virtual bool setup(CPetControl *petControl);
+	
+	/**
+	 * Sets up the section
+	 */
+	virtual bool setup();
+
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
+
+	/**
+	 * Called after a game has been loaded
+	 */
+	virtual void postLoad();
+
+	/**
+	 * Called when the current PET area changes
+	 */
+	void setArea(PetArea newArea);
+
+	/**
+	 * Draws the PET frame
+	 */
+	void drawFrame(CScreenManager *screenManager);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_FRAME_H */
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 12e4626..7753566 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -32,6 +32,7 @@ enum PetArea {
 	PET_ROOMS = 3, PET_SAVE = 4, PET_5 = 5, PET_6 = 6
 };
 
+class CPetControl;
 class CScreenManager;
 class CRoomItem;
 
@@ -47,14 +48,26 @@ struct CPetSectionSubData {
 
 class CPetSection {
 protected:
-	int _field4;
+	CPetControl *_petControl;
 public:
-	CPetSection() : _field4(0) {}
+	CPetSection() : _petControl(nullptr) {}
 	virtual ~CPetSection() {}
 
-	virtual int proc1() { return 0; }
-	virtual int proc2() { return 0; }
+	/**
+	 * Sets up the section
+	 */
+	virtual bool setup(CPetControl *petControl) { return false; }
+	
+	/**
+	 * Sets up the section
+	 */
+	virtual bool setup() { return false; }
+
+	/**
+	 * Draw the section
+	 */
 	virtual void draw(CScreenManager *screenManager) {}
+	
 	virtual void proc4();
 	virtual void proc5(int val) {}
 	virtual int proc6() { return 0; }
@@ -72,7 +85,7 @@ public:
 	/**
 	 * Returns true if the object is in a valid state
 	 */
-	virtual bool isValid() const { return false; }
+	virtual bool isValid(CPetControl *petControl) { return false; }
 
 	/**
 	 * Load the data for the class from file


Commit: 39ef1e3edb03d0ea6ae47649951c308b646992ad
    https://github.com/scummvm/scummvm/commit/39ef1e3edb03d0ea6ae47649951c308b646992ad
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-31T07:58:41-04:00

Commit Message:
TITANIC: Renamed CPetVal to CPetGraphic

Changed paths:
  A engines/titanic/pet_control/pet_graphic.cpp
  A engines/titanic/pet_control/pet_graphic.h
  R engines/titanic/pet_control/pet_val.cpp
  R engines/titanic/pet_control/pet_val.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control_list_item.h
    engines/titanic/pet_control/pet_control_sub10.h
    engines/titanic/pet_control/pet_control_sub5.h
    engines/titanic/pet_control/pet_conversation_section.h
    engines/titanic/pet_control/pet_frame.h
    engines/titanic/pet_control/pet_remote_section.h
    engines/titanic/pet_control/pet_rooms_section.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index cc3c186..4eebf04 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -385,6 +385,7 @@ MODULE_OBJS := \
 	pet_control/pet_conversation_section.o \
 	pet_control/pet_element.o \
 	pet_control/pet_frame.o \
+	pet_control/pet_graphic.o \
 	pet_control/pet_inventory_section.o \
 	pet_control/pet_rooms_section.o \
 	pet_control/pet_remote_section.o \
@@ -395,7 +396,6 @@ MODULE_OBJS := \
 	pet_control/pet_control_sub10.o \
 	pet_control/pet_control_sub11.o \
 	pet_control/pet_control_sub12.o \
-	pet_control/pet_val.o \
 	sound/auto_music_player.o \
 	sound/auto_music_player_base.o \
 	sound/auto_sound_player.o \
diff --git a/engines/titanic/pet_control/pet_control_list_item.h b/engines/titanic/pet_control/pet_control_list_item.h
index 64808c0..e821071 100644
--- a/engines/titanic/pet_control/pet_control_list_item.h
+++ b/engines/titanic/pet_control/pet_control_list_item.h
@@ -24,13 +24,13 @@
 #define TITANIC_PET_CONTROL_LIST_ITEM_H
 
 #include "titanic/core/list.h"
-#include "titanic/pet_control/pet_val.h"
+#include "titanic/pet_control/pet_graphic.h"
 
 namespace Titanic {
 
 class CPetControlListItem : public ListItem {
 protected:
-	CPetVal _val;
+	CPetGraphic _val;
 	int _field30;
 public:
 	CPetControlListItem() : _field30(0) {}
diff --git a/engines/titanic/pet_control/pet_control_sub10.h b/engines/titanic/pet_control/pet_control_sub10.h
index f8534d7..a6f863c 100644
--- a/engines/titanic/pet_control/pet_control_sub10.h
+++ b/engines/titanic/pet_control/pet_control_sub10.h
@@ -37,9 +37,9 @@ protected:
 	int _field1C;
 	int _field20;
 	int _field24;
-	CPetVal _val1;
-	CPetVal _val2;
-	CPetVal _val3;
+	CPetGraphic _val1;
+	CPetGraphic _val2;
+	CPetGraphic _val3;
 public:
 	CPetControlSub10();
 
diff --git a/engines/titanic/pet_control/pet_control_sub5.h b/engines/titanic/pet_control/pet_control_sub5.h
index 1da1822..f82a1eb 100644
--- a/engines/titanic/pet_control/pet_control_sub5.h
+++ b/engines/titanic/pet_control/pet_control_sub5.h
@@ -25,20 +25,20 @@
 
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub12.h"
-#include "titanic/pet_control/pet_val.h"
+#include "titanic/pet_control/pet_graphic.h"
 
 namespace Titanic {
 
 class CPetControlSub5 : public CPetSection {
 private:
-	CPetVal _val1;
-	CPetVal _val2;
-	CPetVal _val3;
-	CPetVal _val4;
+	CPetGraphic _val1;
+	CPetGraphic _val2;
+	CPetGraphic _val3;
+	CPetGraphic _val4;
 	int _field98;
 	int _field9C;
 	int _fieldA0;
-	CPetVal _valArray1[6];
+	CPetGraphic _valArray1[6];
 	int _field17C;
 	int _field18C;
 	CPetControlSub12 _sub12;
diff --git a/engines/titanic/pet_control/pet_conversation_section.h b/engines/titanic/pet_control/pet_conversation_section.h
index c9f4547..15d57e7 100644
--- a/engines/titanic/pet_control/pet_conversation_section.h
+++ b/engines/titanic/pet_control/pet_conversation_section.h
@@ -25,24 +25,24 @@
 
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub12.h"
-#include "titanic/pet_control/pet_val.h"
+#include "titanic/pet_control/pet_graphic.h"
 
 namespace Titanic {
 
 class CPetConversationSection : public CPetSection {
 private:
-	CPetVal _val1;
-	CPetVal _val2;
-	CPetVal _val3;
-	CPetVal _valArray1[3];
-	CPetVal _val4;
-	CPetVal _val5;
-	CPetVal _val6;
+	CPetGraphic _val1;
+	CPetGraphic _val2;
+	CPetGraphic _val3;
+	CPetGraphic _valArray1[3];
+	CPetGraphic _val4;
+	CPetGraphic _val5;
+	CPetGraphic _val6;
 	int  _field14C;
-	CPetVal _val7;
-	CPetVal _val8;
-	CPetVal _val9;
-	CPetVal _valArray2[9];
+	CPetGraphic _val7;
+	CPetGraphic _val8;
+	CPetGraphic _val9;
+	CPetGraphic _valArray2[9];
 	int _field30C;
 	CPetControlSub12 _sub1;
 	CPetControlSub12 _sub2;
diff --git a/engines/titanic/pet_control/pet_frame.h b/engines/titanic/pet_control/pet_frame.h
index 53adf1b..e307a73 100644
--- a/engines/titanic/pet_control/pet_frame.h
+++ b/engines/titanic/pet_control/pet_frame.h
@@ -24,7 +24,7 @@
 #define TITANIC_PET_FRAME_H
 
 #include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_val.h"
+#include "titanic/pet_control/pet_graphic.h"
 
 namespace Titanic {
 
@@ -32,13 +32,13 @@ class CPetFrame : public CPetSection {
 private:
 	static int _indexes[6];
 
-	CPetVal _modeButtons[6];
-	CPetVal _titles[6];
-	CPetVal _modeBackground;
-	CPetVal _val2;
-	CPetVal _val3;
-	CPetVal _background;
-	CPetVal _indent[7];
+	CPetGraphic _modeButtons[6];
+	CPetGraphic _titles[6];
+	CPetGraphic _modeBackground;
+	CPetGraphic _val2;
+	CPetGraphic _val3;
+	CPetGraphic _background;
+	CPetGraphic _indent[7];
 private:
 	/**
 	 * Called to set the owning PET instance and set some initial state
diff --git a/engines/titanic/pet_control/pet_graphic.cpp b/engines/titanic/pet_control/pet_graphic.cpp
new file mode 100644
index 0000000..c9fd5f5
--- /dev/null
+++ b/engines/titanic/pet_control/pet_graphic.cpp
@@ -0,0 +1,90 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/core/game_object.h"
+#include "titanic/pet_control/pet_graphic.h"
+#include "titanic/pet_control/pet_control.h"
+
+namespace Titanic {
+
+void CPetGraphic::loadObject(PetElementMode mode, const CString &name,
+		CPetControl *petControl) {
+	switch (mode) {
+	case MODE_0:
+		_object0 = petControl->getHiddenObject(name);
+		break;
+	case MODE_1:
+		_object1 = petControl->getHiddenObject(name);
+		break;
+	case MODE_2:
+		_object2 = petControl->getHiddenObject(name);
+		break;
+	default:
+		break;
+	}
+}
+
+void CPetGraphic::proc2() {
+	error("TODO");
+}
+
+void CPetGraphic::draw(CScreenManager *screenManager) {
+	draw(screenManager, Common::Point(_bounds.left, _bounds.top));
+}
+
+void CPetGraphic::draw(CScreenManager *screenManager, const Common::Point &destPos) {
+	CGameObject *obj = getObject();
+	if (!obj)
+		obj = _object0;
+
+	if (obj)
+		obj->draw(screenManager, destPos);
+}
+
+void CPetGraphic::getBounds(Rect *rect) {
+	if (rect) {
+		CGameObject *obj = getObject();
+		if (!obj)
+			obj = _object0;
+
+		if (obj && obj->getSurface45())
+			*rect = _bounds;
+		else
+			rect->clear();
+	}
+}
+
+CGameObject *CPetGraphic::getObject() const {
+	switch (_mode) {
+	case MODE_0:
+		return _object0;
+	case MODE_1:
+		return _object1;
+	case MODE_2:
+		return _object2;
+	default:
+		return nullptr;
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_graphic.h b/engines/titanic/pet_control/pet_graphic.h
new file mode 100644
index 0000000..8b9c495
--- /dev/null
+++ b/engines/titanic/pet_control/pet_graphic.h
@@ -0,0 +1,70 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_GRAPHIC_H
+#define TITANIC_PET_GRAPHIC_H
+
+#include "titanic/pet_control/pet_element.h"
+
+namespace Titanic {
+
+class CPetGraphic: public CPetElement {
+protected:
+	CGameObject *_object0;
+	CGameObject *_object1;
+	CGameObject *_object2;
+public:
+	CPetGraphic() : CPetElement(), _object0(nullptr), _object1(nullptr),
+		_object2(nullptr) {}
+
+	/**
+	 * Load an object into the element
+	 */
+	virtual void loadObject(PetElementMode mode, const CString &name,
+		CPetControl *petControl);
+
+	virtual void proc2();
+
+	/**
+	 * Draw the item
+	 */
+	virtual void draw(CScreenManager *screenManager);
+
+	/**
+	 * Draw the item
+	 */
+	virtual void draw(CScreenManager *screenManager, const Common::Point &destPos);
+
+	/**
+	 * Get the bounds for the element
+	 */
+	virtual void getBounds(Rect *rect);
+
+	/**
+	 * Get the game object associated with this item
+	 */
+	virtual CGameObject *getObject() const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_GRAPHIC_H */
diff --git a/engines/titanic/pet_control/pet_remote_section.h b/engines/titanic/pet_control/pet_remote_section.h
index e3b543c..6a3d1cd 100644
--- a/engines/titanic/pet_control/pet_remote_section.h
+++ b/engines/titanic/pet_control/pet_remote_section.h
@@ -26,24 +26,24 @@
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub10.h"
 #include "titanic/pet_control/pet_control_sub12.h"
-#include "titanic/pet_control/pet_val.h"
+#include "titanic/pet_control/pet_graphic.h"
 
 namespace Titanic {
 
 class CPetRemoteSection : public CPetSection {
 private:
 	CPetControlSub10 _sub10;
-	CPetVal _val1;
-	CPetVal _val2;
-	CPetVal _val3;
-	CPetVal _val4;
-	CPetVal _val5;
-	CPetVal _val6;
-	CPetVal _val7;
-	CPetVal _val8;
-	CPetVal _val9;
-	CPetVal _val10;
-	CPetVal _val11;
+	CPetGraphic _val1;
+	CPetGraphic _val2;
+	CPetGraphic _val3;
+	CPetGraphic _val4;
+	CPetGraphic _val5;
+	CPetGraphic _val6;
+	CPetGraphic _val7;
+	CPetGraphic _val8;
+	CPetGraphic _val9;
+	CPetGraphic _val10;
+	CPetGraphic _val11;
 	CPetControlSub12 _sub12;
 public:
 
diff --git a/engines/titanic/pet_control/pet_rooms_section.h b/engines/titanic/pet_control/pet_rooms_section.h
index 54996fa..fc26c34 100644
--- a/engines/titanic/pet_control/pet_rooms_section.h
+++ b/engines/titanic/pet_control/pet_rooms_section.h
@@ -42,7 +42,7 @@ private:
 	int _field114;
 	int _field118;
 	int _field11C;
-	CPetVal _val1;
+	CPetGraphic _val1;
 	CPetControlSub12 _sub12;
 	int _field1C0;
 	int _field1C4;
diff --git a/engines/titanic/pet_control/pet_val.cpp b/engines/titanic/pet_control/pet_val.cpp
deleted file mode 100644
index 096b284..0000000
--- a/engines/titanic/pet_control/pet_val.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/textconsole.h"
-#include "titanic/core/game_object.h"
-#include "titanic/pet_control/pet_val.h"
-#include "titanic/pet_control/pet_control.h"
-
-namespace Titanic {
-
-void CPetVal::loadObject(PetElementMode mode, const CString &name,
-		CPetControl *petControl) {
-	switch (mode) {
-	case MODE_0:
-		_object0 = petControl->getHiddenObject(name);
-		break;
-	case MODE_1:
-		_object1 = petControl->getHiddenObject(name);
-		break;
-	case MODE_2:
-		_object2 = petControl->getHiddenObject(name);
-		break;
-	default:
-		break;
-	}
-}
-
-void CPetVal::proc2() {
-	error("TODO");
-}
-
-void CPetVal::draw(CScreenManager *screenManager) {
-	draw(screenManager, Common::Point(_bounds.left, _bounds.top));
-}
-
-void CPetVal::draw(CScreenManager *screenManager, const Common::Point &destPos) {
-	CGameObject *obj = getObject();
-	if (!obj)
-		obj = _object0;
-
-	if (obj)
-		obj->draw(screenManager, destPos);
-}
-
-void CPetVal::getBounds(Rect *rect) {
-	if (rect) {
-		CGameObject *obj = getObject();
-		if (!obj)
-			obj = _object0;
-
-		if (obj && obj->getSurface45())
-			*rect = _bounds;
-		else
-			rect->clear();
-	}
-}
-
-CGameObject *CPetVal::getObject() const {
-	switch (_mode) {
-	case MODE_0:
-		return _object0;
-	case MODE_1:
-		return _object1;
-	case MODE_2:
-		return _object2;
-	default:
-		return nullptr;
-	}
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_val.h b/engines/titanic/pet_control/pet_val.h
deleted file mode 100644
index 90b7a2e..0000000
--- a/engines/titanic/pet_control/pet_val.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_VAL_H
-#define TITANIC_PET_VAL_H
-
-#include "titanic/pet_control/pet_element.h"
-
-namespace Titanic {
-
-class CPetVal: public CPetElement {
-protected:
-	CGameObject *_object0;
-	CGameObject *_object1;
-	CGameObject *_object2;
-public:
-	CPetVal() : CPetElement(), _object0(nullptr), _object1(nullptr),
-		_object2(nullptr) {}
-
-	/**
-	 * Load an object into the element
-	 */
-	virtual void loadObject(PetElementMode mode, const CString &name,
-		CPetControl *petControl);
-
-	virtual void proc2();
-
-	/**
-	 * Draw the item
-	 */
-	virtual void draw(CScreenManager *screenManager);
-
-	/**
-	 * Draw the item
-	 */
-	virtual void draw(CScreenManager *screenManager, const Common::Point &destPos);
-
-	/**
-	 * Get the bounds for the element
-	 */
-	virtual void getBounds(Rect *rect);
-
-	/**
-	 * Get the game object associated with this item
-	 */
-	virtual CGameObject *getObject() const;
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_VAL_H */


Commit: 6d852165e97d4a22e029446b1a97417af38175fb
    https://github.com/scummvm/scummvm/commit/6d852165e97d4a22e029446b1a97417af38175fb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-31T12:36:56-04:00

Commit Message:
Merge branch 'titanic' of https://github.com/dreammaster/scummvm into titanic

Changed paths:
  A engines/titanic/pet_control/pet_conversation_section.cpp
  A engines/titanic/pet_control/pet_conversation_section.h
  A engines/titanic/pet_control/pet_element.cpp
  A engines/titanic/pet_control/pet_element.h
  A engines/titanic/pet_control/pet_frame.cpp
  A engines/titanic/pet_control/pet_frame.h
  A engines/titanic/pet_control/pet_graphic.cpp
  A engines/titanic/pet_control/pet_graphic.h
  A engines/titanic/pet_control/pet_inventory_section.cpp
  A engines/titanic/pet_control/pet_inventory_section.h
  A engines/titanic/pet_control/pet_remote_section.cpp
  A engines/titanic/pet_control/pet_remote_section.h
  A engines/titanic/pet_control/pet_rooms_section.cpp
  A engines/titanic/pet_control/pet_rooms_section.h
  A engines/titanic/pet_control/pet_save_section.cpp
  A engines/titanic/pet_control/pet_save_section.h
  A engines/titanic/pet_control/pet_section.cpp
  A engines/titanic/pet_control/pet_section.h
  R engines/titanic/pet_control/pet_control_sub1.cpp
  R engines/titanic/pet_control/pet_control_sub1.h
  R engines/titanic/pet_control/pet_control_sub2.cpp
  R engines/titanic/pet_control/pet_control_sub2.h
  R engines/titanic/pet_control/pet_control_sub3.cpp
  R engines/titanic/pet_control/pet_control_sub3.h
  R engines/titanic/pet_control/pet_control_sub4.cpp
  R engines/titanic/pet_control/pet_control_sub4.h
  R engines/titanic/pet_control/pet_control_sub6.cpp
  R engines/titanic/pet_control/pet_control_sub6.h
  R engines/titanic/pet_control/pet_control_sub8.cpp
  R engines/titanic/pet_control/pet_control_sub8.h
  R engines/titanic/pet_control/pet_control_sub_base.cpp
  R engines/titanic/pet_control/pet_control_sub_base.h
  R engines/titanic/pet_control/pet_val.cpp
  R engines/titanic/pet_control/pet_val.h
  R engines/titanic/pet_control/pet_val_base.cpp
  R engines/titanic/pet_control/pet_val_base.h
    engines/titanic/core/background.cpp
    engines/titanic/core/background.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/debugger.cpp
    engines/titanic/debugger.h
    engines/titanic/game/cdrom.cpp
    engines/titanic/game/cdrom.h
    engines/titanic/game/cdrom_tray.cpp
    engines/titanic/game/cdrom_tray.h
    engines/titanic/game/pet/pet_val_base.h
    engines/titanic/game/television.cpp
    engines/titanic/game/television.h
    engines/titanic/main_game_window.cpp
    engines/titanic/messages/messages.h
    engines/titanic/messages/mouse_messages.h
    engines/titanic/module.mk
    engines/titanic/movie.cpp
    engines/titanic/movie.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_control_list_item.h
    engines/titanic/pet_control/pet_control_sub10.h
    engines/titanic/pet_control/pet_control_sub5.h
    engines/titanic/pet_control/pet_control_sub7.h
    engines/titanic/simple_file.cpp
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/video_surface.cpp
    engines/titanic/video_surface.h





Commit: 6a1b452e163a5ebdf77e4753fc647e390a48b4fb
    https://github.com/scummvm/scummvm/commit/6a1b452e163a5ebdf77e4753fc647e390a48b4fb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-31T12:49:10-04:00

Commit Message:
TITANIC: Work on implementing CDROM Tray class

Changed paths:
    engines/titanic/game/cdrom_tray.cpp
    engines/titanic/game/cdrom_tray.h



diff --git a/engines/titanic/game/cdrom_tray.cpp b/engines/titanic/game/cdrom_tray.cpp
index fcb65fd..7265332 100644
--- a/engines/titanic/game/cdrom_tray.cpp
+++ b/engines/titanic/game/cdrom_tray.cpp
@@ -43,4 +43,19 @@ void CCDROMTray::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CCDROMTray::handleMessage(CActMsg &msg) {
+	// TODO
+	return true;
+}
+
+bool CCDROMTray::handleMessage(CMovieEndMsg &msg) {
+	// TODO
+	return true;
+}
+
+bool CCDROMTray::handleMessage(CStatusChangeMsg &msg) {
+	// TODO
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/cdrom_tray.h b/engines/titanic/game/cdrom_tray.h
index b5c4b37..b1893c5 100644
--- a/engines/titanic/game/cdrom_tray.h
+++ b/engines/titanic/game/cdrom_tray.h
@@ -24,13 +24,21 @@
 #define TITANIC_CDROM_TRAY_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CCDROMTray : public CGameObject {
+class CCDROMTray : public CGameObject,
+	public CActMsgTarget,
+	public CMovieEndMsgTarget,
+	public CStatusChangeMsgTarget {
 public:
 	int _state;
 	CString _string1;
+protected:
+	virtual bool handleMessage(CActMsg &msg);
+	virtual bool handleMessage(CMovieEndMsg &msg);
+	virtual bool handleMessage(CStatusChangeMsg &msg);
 public:
 	CLASSDEF
 	CCDROMTray();


Commit: 5c902685fc2f3f97ee3fd9250480801ac849bf02
    https://github.com/scummvm/scummvm/commit/5c902685fc2f3f97ee3fd9250480801ac849bf02
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-31T13:05:17-04:00

Commit Message:
TITANIC: Rename CPetGraphic to CPetGfxElement to avoid naming clash

Changed paths:
  A engines/titanic/pet_control/pet_gfx_element.cpp
  A engines/titanic/pet_control/pet_gfx_element.h
  R engines/titanic/pet_control/pet_graphic.cpp
  R engines/titanic/pet_control/pet_graphic.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control_list_item.h
    engines/titanic/pet_control/pet_control_sub10.h
    engines/titanic/pet_control/pet_control_sub5.h
    engines/titanic/pet_control/pet_conversation_section.h
    engines/titanic/pet_control/pet_frame.h
    engines/titanic/pet_control/pet_remote_section.h
    engines/titanic/pet_control/pet_rooms_section.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 4eebf04..9f9257d 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -385,7 +385,7 @@ MODULE_OBJS := \
 	pet_control/pet_conversation_section.o \
 	pet_control/pet_element.o \
 	pet_control/pet_frame.o \
-	pet_control/pet_graphic.o \
+	pet_control/pet_gfx_element.o \
 	pet_control/pet_inventory_section.o \
 	pet_control/pet_rooms_section.o \
 	pet_control/pet_remote_section.o \
diff --git a/engines/titanic/pet_control/pet_control_list_item.h b/engines/titanic/pet_control/pet_control_list_item.h
index e821071..caa9a0d 100644
--- a/engines/titanic/pet_control/pet_control_list_item.h
+++ b/engines/titanic/pet_control/pet_control_list_item.h
@@ -24,13 +24,13 @@
 #define TITANIC_PET_CONTROL_LIST_ITEM_H
 
 #include "titanic/core/list.h"
-#include "titanic/pet_control/pet_graphic.h"
+#include "titanic/pet_control/pet_gfx_element.h"
 
 namespace Titanic {
 
 class CPetControlListItem : public ListItem {
 protected:
-	CPetGraphic _val;
+	CPetGfxElement _val;
 	int _field30;
 public:
 	CPetControlListItem() : _field30(0) {}
diff --git a/engines/titanic/pet_control/pet_control_sub10.h b/engines/titanic/pet_control/pet_control_sub10.h
index a6f863c..e319378 100644
--- a/engines/titanic/pet_control/pet_control_sub10.h
+++ b/engines/titanic/pet_control/pet_control_sub10.h
@@ -37,9 +37,9 @@ protected:
 	int _field1C;
 	int _field20;
 	int _field24;
-	CPetGraphic _val1;
-	CPetGraphic _val2;
-	CPetGraphic _val3;
+	CPetGfxElement _val1;
+	CPetGfxElement _val2;
+	CPetGfxElement _val3;
 public:
 	CPetControlSub10();
 
diff --git a/engines/titanic/pet_control/pet_control_sub5.h b/engines/titanic/pet_control/pet_control_sub5.h
index f82a1eb..088ba6f 100644
--- a/engines/titanic/pet_control/pet_control_sub5.h
+++ b/engines/titanic/pet_control/pet_control_sub5.h
@@ -25,20 +25,20 @@
 
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub12.h"
-#include "titanic/pet_control/pet_graphic.h"
+#include "titanic/pet_control/pet_gfx_element.h"
 
 namespace Titanic {
 
 class CPetControlSub5 : public CPetSection {
 private:
-	CPetGraphic _val1;
-	CPetGraphic _val2;
-	CPetGraphic _val3;
-	CPetGraphic _val4;
+	CPetGfxElement _val1;
+	CPetGfxElement _val2;
+	CPetGfxElement _val3;
+	CPetGfxElement _val4;
 	int _field98;
 	int _field9C;
 	int _fieldA0;
-	CPetGraphic _valArray1[6];
+	CPetGfxElement _valArray1[6];
 	int _field17C;
 	int _field18C;
 	CPetControlSub12 _sub12;
diff --git a/engines/titanic/pet_control/pet_conversation_section.h b/engines/titanic/pet_control/pet_conversation_section.h
index 15d57e7..863a0d9 100644
--- a/engines/titanic/pet_control/pet_conversation_section.h
+++ b/engines/titanic/pet_control/pet_conversation_section.h
@@ -25,24 +25,24 @@
 
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub12.h"
-#include "titanic/pet_control/pet_graphic.h"
+#include "titanic/pet_control/pet_gfx_element.h"
 
 namespace Titanic {
 
 class CPetConversationSection : public CPetSection {
 private:
-	CPetGraphic _val1;
-	CPetGraphic _val2;
-	CPetGraphic _val3;
-	CPetGraphic _valArray1[3];
-	CPetGraphic _val4;
-	CPetGraphic _val5;
-	CPetGraphic _val6;
+	CPetGfxElement _val1;
+	CPetGfxElement _val2;
+	CPetGfxElement _val3;
+	CPetGfxElement _valArray1[3];
+	CPetGfxElement _val4;
+	CPetGfxElement _val5;
+	CPetGfxElement _val6;
 	int  _field14C;
-	CPetGraphic _val7;
-	CPetGraphic _val8;
-	CPetGraphic _val9;
-	CPetGraphic _valArray2[9];
+	CPetGfxElement _val7;
+	CPetGfxElement _val8;
+	CPetGfxElement _val9;
+	CPetGfxElement _valArray2[9];
 	int _field30C;
 	CPetControlSub12 _sub1;
 	CPetControlSub12 _sub2;
diff --git a/engines/titanic/pet_control/pet_frame.h b/engines/titanic/pet_control/pet_frame.h
index e307a73..83543ef 100644
--- a/engines/titanic/pet_control/pet_frame.h
+++ b/engines/titanic/pet_control/pet_frame.h
@@ -24,7 +24,7 @@
 #define TITANIC_PET_FRAME_H
 
 #include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_graphic.h"
+#include "titanic/pet_control/pet_gfx_element.h"
 
 namespace Titanic {
 
@@ -32,13 +32,13 @@ class CPetFrame : public CPetSection {
 private:
 	static int _indexes[6];
 
-	CPetGraphic _modeButtons[6];
-	CPetGraphic _titles[6];
-	CPetGraphic _modeBackground;
-	CPetGraphic _val2;
-	CPetGraphic _val3;
-	CPetGraphic _background;
-	CPetGraphic _indent[7];
+	CPetGfxElement _modeButtons[6];
+	CPetGfxElement _titles[6];
+	CPetGfxElement _modeBackground;
+	CPetGfxElement _val2;
+	CPetGfxElement _val3;
+	CPetGfxElement _background;
+	CPetGfxElement _indent[7];
 private:
 	/**
 	 * Called to set the owning PET instance and set some initial state
diff --git a/engines/titanic/pet_control/pet_gfx_element.cpp b/engines/titanic/pet_control/pet_gfx_element.cpp
new file mode 100644
index 0000000..bec54b9
--- /dev/null
+++ b/engines/titanic/pet_control/pet_gfx_element.cpp
@@ -0,0 +1,90 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/core/game_object.h"
+#include "titanic/pet_control/pet_element.h"
+#include "titanic/pet_control/pet_control.h"
+
+namespace Titanic {
+
+void CPetGfxElement::setup(PetElementMode mode, const CString &name,
+		CPetControl *petControl) {
+	switch (mode) {
+	case MODE_0:
+		_object0 = petControl->getHiddenObject(name);
+		break;
+	case MODE_1:
+		_object1 = petControl->getHiddenObject(name);
+		break;
+	case MODE_2:
+		_object2 = petControl->getHiddenObject(name);
+		break;
+	default:
+		break;
+	}
+}
+
+void CPetGfxElement::setup() {
+	error("TODO");
+}
+
+void CPetGfxElement::draw(CScreenManager *screenManager) {
+	draw(screenManager, Common::Point(_bounds.left, _bounds.top));
+}
+
+void CPetGfxElement::draw(CScreenManager *screenManager, const Common::Point &destPos) {
+	CGameObject *obj = getObject();
+	if (!obj)
+		obj = _object0;
+
+	if (obj)
+		obj->draw(screenManager, destPos);
+}
+
+void CPetGfxElement::getBounds(Rect *rect) {
+	if (rect) {
+		CGameObject *obj = getObject();
+		if (!obj)
+			obj = _object0;
+
+		if (obj && obj->getSurface45())
+			*rect = _bounds;
+		else
+			rect->clear();
+	}
+}
+
+CGameObject *CPetGfxElement::getObject() const {
+	switch (_mode) {
+	case MODE_0:
+		return _object0;
+	case MODE_1:
+		return _object1;
+	case MODE_2:
+		return _object2;
+	default:
+		return nullptr;
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_gfx_element.h b/engines/titanic/pet_control/pet_gfx_element.h
new file mode 100644
index 0000000..47720cf
--- /dev/null
+++ b/engines/titanic/pet_control/pet_gfx_element.h
@@ -0,0 +1,70 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_GFX_ELEMENT_H
+#define TITANIC_PET_GFX_ELEMENT_H
+
+#include "titanic/pet_control/pet_element.h"
+
+namespace Titanic {
+
+class CPetGfxElement: public CPetElement {
+protected:
+	CGameObject *_object0;
+	CGameObject *_object1;
+	CGameObject *_object2;
+public:
+	CPetGfxElement() : CPetElement(), _object0(nullptr), _object1(nullptr),
+		_object2(nullptr) {}
+
+	/**
+	 * Load an object into the element
+	 */
+	virtual void setup(PetElementMode mode, const CString &name,
+		CPetControl *petControl);
+
+	virtual void setup();
+
+	/**
+	 * Draw the item
+	 */
+	virtual void draw(CScreenManager *screenManager);
+
+	/**
+	 * Draw the item
+	 */
+	virtual void draw(CScreenManager *screenManager, const Common::Point &destPos);
+
+	/**
+	 * Get the bounds for the element
+	 */
+	virtual void getBounds(Rect *rect);
+
+	/**
+	 * Get the game object associated with this item
+	 */
+	virtual CGameObject *getObject() const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_GFX_ELEMENT_H */
diff --git a/engines/titanic/pet_control/pet_graphic.cpp b/engines/titanic/pet_control/pet_graphic.cpp
deleted file mode 100644
index c9fd5f5..0000000
--- a/engines/titanic/pet_control/pet_graphic.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/textconsole.h"
-#include "titanic/core/game_object.h"
-#include "titanic/pet_control/pet_graphic.h"
-#include "titanic/pet_control/pet_control.h"
-
-namespace Titanic {
-
-void CPetGraphic::loadObject(PetElementMode mode, const CString &name,
-		CPetControl *petControl) {
-	switch (mode) {
-	case MODE_0:
-		_object0 = petControl->getHiddenObject(name);
-		break;
-	case MODE_1:
-		_object1 = petControl->getHiddenObject(name);
-		break;
-	case MODE_2:
-		_object2 = petControl->getHiddenObject(name);
-		break;
-	default:
-		break;
-	}
-}
-
-void CPetGraphic::proc2() {
-	error("TODO");
-}
-
-void CPetGraphic::draw(CScreenManager *screenManager) {
-	draw(screenManager, Common::Point(_bounds.left, _bounds.top));
-}
-
-void CPetGraphic::draw(CScreenManager *screenManager, const Common::Point &destPos) {
-	CGameObject *obj = getObject();
-	if (!obj)
-		obj = _object0;
-
-	if (obj)
-		obj->draw(screenManager, destPos);
-}
-
-void CPetGraphic::getBounds(Rect *rect) {
-	if (rect) {
-		CGameObject *obj = getObject();
-		if (!obj)
-			obj = _object0;
-
-		if (obj && obj->getSurface45())
-			*rect = _bounds;
-		else
-			rect->clear();
-	}
-}
-
-CGameObject *CPetGraphic::getObject() const {
-	switch (_mode) {
-	case MODE_0:
-		return _object0;
-	case MODE_1:
-		return _object1;
-	case MODE_2:
-		return _object2;
-	default:
-		return nullptr;
-	}
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_graphic.h b/engines/titanic/pet_control/pet_graphic.h
deleted file mode 100644
index 8b9c495..0000000
--- a/engines/titanic/pet_control/pet_graphic.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_GRAPHIC_H
-#define TITANIC_PET_GRAPHIC_H
-
-#include "titanic/pet_control/pet_element.h"
-
-namespace Titanic {
-
-class CPetGraphic: public CPetElement {
-protected:
-	CGameObject *_object0;
-	CGameObject *_object1;
-	CGameObject *_object2;
-public:
-	CPetGraphic() : CPetElement(), _object0(nullptr), _object1(nullptr),
-		_object2(nullptr) {}
-
-	/**
-	 * Load an object into the element
-	 */
-	virtual void loadObject(PetElementMode mode, const CString &name,
-		CPetControl *petControl);
-
-	virtual void proc2();
-
-	/**
-	 * Draw the item
-	 */
-	virtual void draw(CScreenManager *screenManager);
-
-	/**
-	 * Draw the item
-	 */
-	virtual void draw(CScreenManager *screenManager, const Common::Point &destPos);
-
-	/**
-	 * Get the bounds for the element
-	 */
-	virtual void getBounds(Rect *rect);
-
-	/**
-	 * Get the game object associated with this item
-	 */
-	virtual CGameObject *getObject() const;
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_GRAPHIC_H */
diff --git a/engines/titanic/pet_control/pet_remote_section.h b/engines/titanic/pet_control/pet_remote_section.h
index 6a3d1cd..562579d 100644
--- a/engines/titanic/pet_control/pet_remote_section.h
+++ b/engines/titanic/pet_control/pet_remote_section.h
@@ -26,24 +26,24 @@
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub10.h"
 #include "titanic/pet_control/pet_control_sub12.h"
-#include "titanic/pet_control/pet_graphic.h"
+#include "titanic/pet_control/pet_gfx_element.h"
 
 namespace Titanic {
 
 class CPetRemoteSection : public CPetSection {
 private:
 	CPetControlSub10 _sub10;
-	CPetGraphic _val1;
-	CPetGraphic _val2;
-	CPetGraphic _val3;
-	CPetGraphic _val4;
-	CPetGraphic _val5;
-	CPetGraphic _val6;
-	CPetGraphic _val7;
-	CPetGraphic _val8;
-	CPetGraphic _val9;
-	CPetGraphic _val10;
-	CPetGraphic _val11;
+	CPetGfxElement _val1;
+	CPetGfxElement _val2;
+	CPetGfxElement _val3;
+	CPetGfxElement _val4;
+	CPetGfxElement _val5;
+	CPetGfxElement _val6;
+	CPetGfxElement _val7;
+	CPetGfxElement _val8;
+	CPetGfxElement _val9;
+	CPetGfxElement _val10;
+	CPetGfxElement _val11;
 	CPetControlSub12 _sub12;
 public:
 
diff --git a/engines/titanic/pet_control/pet_rooms_section.h b/engines/titanic/pet_control/pet_rooms_section.h
index fc26c34..66c6e8c 100644
--- a/engines/titanic/pet_control/pet_rooms_section.h
+++ b/engines/titanic/pet_control/pet_rooms_section.h
@@ -42,7 +42,7 @@ private:
 	int _field114;
 	int _field118;
 	int _field11C;
-	CPetGraphic _val1;
+	CPetGfxElement _val1;
 	CPetControlSub12 _sub12;
 	int _field1C0;
 	int _field1C4;


Commit: d94b1dc7bb68ee1641edcbbd31fd40ef7e5dc442
    https://github.com/scummvm/scummvm/commit/d94b1dc7bb68ee1641edcbbd31fd40ef7e5dc442
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-31T19:55:45-04:00

Commit Message:
TITANIC: Implemented CPetGfxElement setup method

Changed paths:
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_gfx_element.cpp
    engines/titanic/pet_control/pet_gfx_element.h
    engines/titanic/string.cpp
    engines/titanic/string.h



diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 61fcf97..55deee0 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -289,4 +289,14 @@ CRoomItem *CTreeItem::getRoom() const {
 	return gameManager ? gameManager->getRoom() : nullptr;
 }
 
+int CTreeItem::getState8() const {
+	CGameManager *gameManager = getGameManager();
+	return gameManager ? gameManager->_gameState._field8 : 3;
+}
+
+int CTreeItem::getStateC() const {
+	CGameManager *gameManager = getGameManager();
+	return gameManager ? gameManager->_gameState._fieldC : 3;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index f5e28f1..d710fcf 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -247,6 +247,9 @@ public:
 	 * Return the current room
 	 */
 	CRoomItem *getRoom() const;
+
+	int getState8() const;
+	int getStateC() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index e5ab8d3..c6b0054 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -51,7 +51,7 @@ public:
 	/**
 	 * Sets up the element
 	 */
-	virtual void setup() {}
+	virtual void setup(int val, const CString &name, CPetControl *petControl) {}
 	
 	/**
 	 * Draw the item
diff --git a/engines/titanic/pet_control/pet_gfx_element.cpp b/engines/titanic/pet_control/pet_gfx_element.cpp
index bec54b9..5f2f05e 100644
--- a/engines/titanic/pet_control/pet_gfx_element.cpp
+++ b/engines/titanic/pet_control/pet_gfx_element.cpp
@@ -44,8 +44,23 @@ void CPetGfxElement::setup(PetElementMode mode, const CString &name,
 	}
 }
 
-void CPetGfxElement::setup() {
-	error("TODO");
+void CPetGfxElement::setup(const CString &name, CPetControl *petControl) {
+	if (!petControl)
+		return;
+
+	CString numString(3);	
+	int state8 = petControl->getState8();
+
+	if (state8 >= 1 && state8 <= 3) {
+		numString = CString(state8);
+	} else if (state8 == 4) {
+		int stateC = petControl->getStateC();
+		if (stateC == 1)
+			numString = CString(stateC);
+	}
+
+	CString resName = numString + name;
+	setup(resName, petControl);
 }
 
 void CPetGfxElement::draw(CScreenManager *screenManager) {
diff --git a/engines/titanic/pet_control/pet_gfx_element.h b/engines/titanic/pet_control/pet_gfx_element.h
index 47720cf..b0bf6e4 100644
--- a/engines/titanic/pet_control/pet_gfx_element.h
+++ b/engines/titanic/pet_control/pet_gfx_element.h
@@ -37,12 +37,15 @@ public:
 		_object2(nullptr) {}
 
 	/**
-	 * Load an object into the element
+	 * Setup the element
 	 */
 	virtual void setup(PetElementMode mode, const CString &name,
 		CPetControl *petControl);
 
-	virtual void setup();
+	/**
+	 * Setup the element
+	 */
+	virtual void setup(const CString &name, CPetControl *petControl);
 
 	/**
 	 * Draw the item
diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp
index 5831b7d..f29d2c7 100644
--- a/engines/titanic/string.cpp
+++ b/engines/titanic/string.cpp
@@ -25,6 +25,12 @@
 
 namespace Titanic {
 
+CString::CString(char c, uint32 len) : Common::String() {
+	ensureCapacity(len, false);
+	for (uint idx = 0; idx < len; ++idx)
+		(*this) += c;
+}
+
 CString CString::left(uint count) const {
 	return (count > size()) ? CString() : CString(c_str(), c_str() + count);
 }
diff --git a/engines/titanic/string.h b/engines/titanic/string.h
index 08b5649..0c0c64e 100644
--- a/engines/titanic/string.h
+++ b/engines/titanic/string.h
@@ -44,7 +44,9 @@ public:
 	CString(const char *str, uint32 len) : Common::String(str, len) {}
 	CString(const char *beginP, const char *endP) : Common::String(beginP, endP) {}
 	CString(const String &str) : Common::String(str) {}
+	CString(char c, uint32 len);
 	explicit CString(char c) : Common::String(c) {}
+	explicit CString(int val) : Common::String(Common::String::format("%d", val)) {}
 
 	/**
 	 * Returns the left n characters of the string


Commit: 24a2fc7e853d826f184bcd977e69a0d906f327a7
    https://github.com/scummvm/scummvm/commit/24a2fc7e853d826f184bcd977e69a0d906f327a7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-31T20:27:28-04:00

Commit Message:
TITANIC: Implement CPetFrame setup and drawing code

Changed paths:
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_frame.cpp
    engines/titanic/pet_control/pet_gfx_element.cpp
    engines/titanic/pet_control/pet_gfx_element.h
    engines/titanic/pet_control/pet_section.h
    engines/titanic/string.cpp
    engines/titanic/string.h



diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 4f101ca..4fcfe6e 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -39,7 +39,6 @@ namespace Titanic {
 
 class CPetControl : public CGameObject {
 private:
-	PetArea _currentArea;
 	int _fieldC0;
 	int _locked;
 	int _fieldC8;
@@ -88,6 +87,8 @@ private:
 	 */
 	CRoomItem *getHiddenRoom();
 public:
+	PetArea _currentArea;
+public:
 	CLASSDEF
 	CPetControl();
 
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index e94bc6c..48a05cd 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/pet_control/pet_frame.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -41,7 +42,23 @@ bool CPetFrame::setup(CPetControl *petControl) {
 
 bool CPetFrame::setup() {
 	if (_petControl) {
-		// TODO
+		_background.setup("PetBackground", _petControl, MODE_0);
+		_modeBackground.setup("PetModeBackground", _petControl, MODE_0);
+
+		for (int idx = 0; idx < 5; ++idx) {
+			CString resName = Common::String::format("PetMode%d", idx);
+			_modeButtons[idx].setup(resName, _petControl, MODE_0);
+		}
+
+		for (int idx = 0; idx < 6; ++idx) {
+			CString resName = Common::String::format("3Pettitle%d", idx);
+			_titles[idx].setup(resName, _petControl, MODE_0);
+		}
+
+		for (int idx = 0; idx < 7; ++idx) {
+			CString resName = Common::String::format("PetIndent%d", idx);
+			_titles[idx].setup(resName, _petControl, MODE_0);
+		}
 	}
 
 	return true;
@@ -98,7 +115,13 @@ void CPetFrame::setArea(PetArea newArea) {
 }
 
 void CPetFrame::drawFrame(CScreenManager *screenManager) {
-	warning("TODO: CPetFrame::drawFrame");
+	_background.draw(screenManager);
+	_modeBackground.draw(screenManager);
+
+	for (int idx = 0; idx < 5; ++idx)
+		_modeButtons[idx].draw(screenManager);
+
+	_titles[_petControl->_currentArea].draw(screenManager);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_gfx_element.cpp b/engines/titanic/pet_control/pet_gfx_element.cpp
index 5f2f05e..616db72 100644
--- a/engines/titanic/pet_control/pet_gfx_element.cpp
+++ b/engines/titanic/pet_control/pet_gfx_element.cpp
@@ -44,7 +44,7 @@ void CPetGfxElement::setup(PetElementMode mode, const CString &name,
 	}
 }
 
-void CPetGfxElement::setup(const CString &name, CPetControl *petControl) {
+void CPetGfxElement::setup(const CString &name, CPetControl *petControl, PetElementMode mode) {
 	if (!petControl)
 		return;
 
@@ -60,7 +60,7 @@ void CPetGfxElement::setup(const CString &name, CPetControl *petControl) {
 	}
 
 	CString resName = numString + name;
-	setup(resName, petControl);
+	setup(mode, resName, petControl);
 }
 
 void CPetGfxElement::draw(CScreenManager *screenManager) {
diff --git a/engines/titanic/pet_control/pet_gfx_element.h b/engines/titanic/pet_control/pet_gfx_element.h
index b0bf6e4..a4c39c6 100644
--- a/engines/titanic/pet_control/pet_gfx_element.h
+++ b/engines/titanic/pet_control/pet_gfx_element.h
@@ -45,7 +45,7 @@ public:
 	/**
 	 * Setup the element
 	 */
-	virtual void setup(const CString &name, CPetControl *petControl);
+	virtual void setup(const CString &name, CPetControl *petControl, PetElementMode mode);
 
 	/**
 	 * Draw the item
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 7753566..2612d64 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -85,7 +85,10 @@ public:
 	/**
 	 * Returns true if the object is in a valid state
 	 */
-	virtual bool isValid(CPetControl *petControl) { return false; }
+	virtual bool isValid(CPetControl *petControl) {
+		// TODO: Switch back to false after implementing all sections
+		return true;
+	}
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp
index f29d2c7..6b43e79 100644
--- a/engines/titanic/string.cpp
+++ b/engines/titanic/string.cpp
@@ -31,6 +31,12 @@ CString::CString(char c, uint32 len) : Common::String() {
 		(*this) += c;
 }
 
+CString::CString(int val) : Common::String() {
+	char buffer[16];
+	itoa(val, buffer, 10);
+	*this += buffer;
+}
+
 CString CString::left(uint count) const {
 	return (count > size()) ? CString() : CString(c_str(), c_str() + count);
 }
diff --git a/engines/titanic/string.h b/engines/titanic/string.h
index 0c0c64e..c411303 100644
--- a/engines/titanic/string.h
+++ b/engines/titanic/string.h
@@ -46,7 +46,7 @@ public:
 	CString(const String &str) : Common::String(str) {}
 	CString(char c, uint32 len);
 	explicit CString(char c) : Common::String(c) {}
-	explicit CString(int val) : Common::String(Common::String::format("%d", val)) {}
+	explicit CString(int val);
 
 	/**
 	 * Returns the left n characters of the string


Commit: 3149cd1a341f6001922e6bddce1a376db1fea49c
    https://github.com/scummvm/scummvm/commit/3149cd1a341f6001922e6bddce1a376db1fea49c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-31T20:53:41-04:00

Commit Message:
TITANIC: Implement CTreeItem::getHiddenRoom

Changed paths:
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h



diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 55deee0..e7b61dc 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -289,6 +289,11 @@ CRoomItem *CTreeItem::getRoom() const {
 	return gameManager ? gameManager->getRoom() : nullptr;
 }
 
+CRoomItem *CTreeItem::getHiddenRoom() const {
+	CProjectItem *root = getRoot();
+	return root ? root->findHiddenRoom() : nullptr;
+}
+
 int CTreeItem::getState8() const {
 	CGameManager *gameManager = getGameManager();
 	return gameManager ? gameManager->_gameState._field8 : 3;
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index d710fcf..9710a25 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -248,6 +248,11 @@ public:
 	 */
 	CRoomItem *getRoom() const;
 
+	/**
+	 * Returns the special hidden room container
+	 */
+	CRoomItem *getHiddenRoom() const;
+
 	int getState8() const;
 	int getStateC() const;
 };
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 4fe0c1d..8376f4a 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -284,7 +284,7 @@ void CPetControl::fn3(CTreeItem *item) {
 
 CRoomItem *CPetControl::getHiddenRoom() {
 	if (!_hiddenRoom)
-		_hiddenRoom = getHiddenRoom();
+		_hiddenRoom = CTreeItem::getHiddenRoom();
 
 	return _hiddenRoom;
 }
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 4fcfe6e..ea7c684 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -81,11 +81,6 @@ private:
 	 * Scan the specified room for an item by name
 	 */
 	CGameObject *findItemInRoom(CRoomItem *room, const CString &name) const;
-
-	/**
-	 * Returns a reference to the special hidden room container
-	 */
-	CRoomItem *getHiddenRoom();
 public:
 	PetArea _currentArea;
 public:
@@ -150,6 +145,11 @@ public:
 	 * special hidden room container
 	 */
 	CGameObject *getHiddenObject(const CString &name);
+
+	/**
+	 * Returns a reference to the special hidden room container
+	 */
+	CRoomItem *getHiddenRoom();
 };
 
 } // End of namespace Titanic


Commit: 7d819f71f7d9fdd794b12ac55bd2177f12069c1b
    https://github.com/scummvm/scummvm/commit/7d819f71f7d9fdd794b12ac55bd2177f12069c1b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-31T21:40:36-04:00

Commit Message:
TITANIC: PET frame is now showing

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_control_sub5.cpp
    engines/titanic/pet_control/pet_control_sub5.h
    engines/titanic/pet_control/pet_control_sub7.cpp
    engines/titanic/pet_control/pet_control_sub7.h
    engines/titanic/pet_control/pet_conversation_section.cpp
    engines/titanic/pet_control/pet_conversation_section.h
    engines/titanic/pet_control/pet_frame.h
    engines/titanic/pet_control/pet_inventory_section.cpp
    engines/titanic/pet_control/pet_inventory_section.h
    engines/titanic/pet_control/pet_remote_section.cpp
    engines/titanic/pet_control/pet_remote_section.h
    engines/titanic/pet_control/pet_rooms_section.cpp
    engines/titanic/pet_control/pet_rooms_section.h
    engines/titanic/pet_control/pet_save_section.cpp
    engines/titanic/pet_control/pet_save_section.h
    engines/titanic/pet_control/pet_section.cpp
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 8376f4a..6df688e 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -29,7 +29,8 @@ namespace Titanic {
 
 CPetControl::CPetControl() : CGameObject(), 
 	_currentArea(PET_CONVERSATION), _fieldC0(0), _locked(0), _fieldC8(0),
-	_treeItem1(nullptr), _treeItem2(nullptr), _hiddenRoom(nullptr) {
+	_treeItem1(nullptr), _treeItem2(nullptr), _hiddenRoom(nullptr),
+	_drawBounds(20, 350, 620, 480) {
 }
 
 void CPetControl::save(SimpleFile *file, int indent) const {
@@ -58,46 +59,46 @@ void CPetControl::load(SimpleFile *file) {
 }
 
 bool CPetControl::isValid() {
-	return _convSection.isValid(this) &&
-		_roomsSection.isValid(this) && 
-		_remoteSection.isValid(this) &&
-		_invSection.isValid(this) &&
+	return _conversations.isValid(this) &&
+		_rooms.isValid(this) && 
+		_remote.isValid(this) &&
+		_inventory.isValid(this) &&
 		_sub5.isValid(this) &&
-		_saveSection.isValid(this) &&
+		_saves.isValid(this) &&
 		_sub7.isValid(this) &&
 		_frame.isValid(this);
 }
 
 void CPetControl::loadAreas(SimpleFile *file, int param) {
-	_convSection.load(file, param);
-	_roomsSection.load(file, param);
-	_remoteSection.load(file, param);
-	_invSection.load(file, param);
+	_conversations.load(file, param);
+	_rooms.load(file, param);
+	_remote.load(file, param);
+	_inventory.load(file, param);
 	_sub5.load(file, param);
-	_saveSection.load(file, param);
+	_saves.load(file, param);
 	_sub7.load(file, param);
 	_frame.load(file, param);
 }
 
 void CPetControl::saveAreas(SimpleFile *file, int indent) const {
-	_convSection.save(file, indent);
-	_roomsSection.save(file, indent);
-	_remoteSection.save(file, indent);
-	_invSection.save(file, indent);
+	_conversations.save(file, indent);
+	_rooms.save(file, indent);
+	_remote.save(file, indent);
+	_inventory.save(file, indent);
 	_sub5.save(file, indent);
-	_saveSection.save(file, indent);
+	_saves.save(file, indent);
 	_sub7.save(file, indent);
 	_frame.save(file, indent);
 }
 
 void CPetControl::draw(CScreenManager *screenManager) {
 	CGameManager *gameManager = getGameManager();
-	Rect bounds = _oldBounds;
+	Rect bounds = _drawBounds;
 	bounds.constrain(gameManager->_bounds);
 
 	if (!bounds.isEmpty()) {
 		if (_fieldC8 >= 0) {
-			_invSection.proc5(_fieldC8);
+			_inventory.proc5(_fieldC8);
 			_fieldC8 = -1;
 		}
 
@@ -106,19 +107,19 @@ void CPetControl::draw(CScreenManager *screenManager) {
 		// Draw the specific area that's currently active
 		switch (_currentArea) {
 		case PET_INVENTORY:
-			_invSection.draw(screenManager);
+			_inventory.draw(screenManager);
 			break;
 		case PET_CONVERSATION:
-			_convSection.draw(screenManager);
+			_conversations.draw(screenManager);
 			break;
 		case PET_REMOTE:
-			_remoteSection.draw(screenManager);
+			_remote.draw(screenManager);
 			break;
 		case PET_ROOMS:
-			_roomsSection.draw(screenManager);
+			_rooms.draw(screenManager);
 			break;
 		case PET_SAVE:
-			_saveSection.draw(screenManager);
+			_saves.draw(screenManager);
 			break;
 		case PET_5:
 			_sub5.draw(screenManager);
@@ -132,6 +133,34 @@ void CPetControl::draw(CScreenManager *screenManager) {
 	}
 }
 
+Rect CPetControl::getBounds() {
+	switch (_currentArea) {
+	case PET_INVENTORY:
+		return _inventory.getBounds();
+		break;
+	case PET_CONVERSATION:
+		return _conversations.getBounds();
+		break;
+	case PET_REMOTE:
+		return _remote.getBounds();
+		break;
+	case PET_ROOMS:
+		return _rooms.getBounds();
+		break;
+	case PET_SAVE:
+		return _saves.getBounds();
+		break;
+	case PET_5:
+		return _sub5.getBounds();
+		break;
+	case PET_6:
+		return _sub7.getBounds();
+		break;
+	default:
+		break;
+	}
+}
+
 void CPetControl::postLoad() {
 	CProjectItem *root = getRoot();
 
@@ -145,12 +174,12 @@ void CPetControl::postLoad() {
 }
 
 void CPetControl::loaded() {
-	_convSection.postLoad();
-	_roomsSection.postLoad();
-	_remoteSection.postLoad();
-	_invSection.postLoad();
+	_conversations.postLoad();
+	_rooms.postLoad();
+	_remote.postLoad();
+	_inventory.postLoad();
 	_sub5.postLoad();
-	_saveSection.postLoad();
+	_saves.postLoad();
 	_sub7.postLoad();
 	_frame.postLoad();
 }
@@ -160,8 +189,8 @@ void CPetControl::enterNode(CNodeItem *node) {
 }
 
 void CPetControl::enterRoom(CRoomItem *room) {
-	_roomsSection.enterRoom(room);
-	_remoteSection.enterRoom(room);
+	_rooms.enterRoom(room);
+	_remote.enterRoom(room);
 }
 
 void CPetControl::clear() {
@@ -185,19 +214,19 @@ PetArea CPetControl::setArea(PetArea newArea) {
 	// Signal the currently active area that it's being left
 	switch (_currentArea) {
 	case PET_INVENTORY:
-		_invSection.leave();
+		_inventory.leave();
 		break;
 	case PET_CONVERSATION:
-		_convSection.leave();
+		_conversations.leave();
 		break;
 	case PET_REMOTE:
-		_remoteSection.leave();
+		_remote.leave();
 		break;
 	case PET_ROOMS:
-		_roomsSection.leave();
+		_rooms.leave();
 		break;
 	case PET_SAVE:
-		_saveSection.leave();
+		_saves.leave();
 		break;
 	case PET_5:
 		_sub5.leave();
@@ -217,20 +246,20 @@ PetArea CPetControl::setArea(PetArea newArea) {
 	// Signal to the new view that it's been activated
 	switch (newArea) {
 	case PET_INVENTORY:
-		_invSection.enter(oldArea);
+		_inventory.enter(oldArea);
 		
 		break;
 	case PET_CONVERSATION:
-		_convSection.enter(oldArea);
+		_conversations.enter(oldArea);
 		break;
 	case PET_REMOTE:
-		_remoteSection.enter(oldArea);
+		_remote.enter(oldArea);
 		break;
 	case PET_ROOMS:
-		_roomsSection.enter(oldArea);
+		_rooms.enter(oldArea);
 		break;
 	case PET_SAVE:
-		_saveSection.enter(oldArea);
+		_saves.enter(oldArea);
 		break;
 	case PET_5:
 		_sub5.enter(oldArea);
@@ -249,19 +278,19 @@ PetArea CPetControl::setArea(PetArea newArea) {
 void CPetControl::fn2(int val) {
 	switch (_currentArea) {
 	case PET_INVENTORY:
-		_invSection.proc38(val);
+		_inventory.proc38(val);
 		break;
 	case PET_CONVERSATION:
-		_convSection.proc38(val);
+		_conversations.proc38(val);
 		break;
 	case PET_REMOTE:
-		_remoteSection.proc38(val);
+		_remote.proc38(val);
 		break;
 	case PET_ROOMS:
-		_roomsSection.proc38(val);
+		_rooms.proc38(val);
 		break;
 	case PET_SAVE:
-		_saveSection.proc38(val);
+		_saves.proc38(val);
 		break;
 	case PET_5:
 		_sub5.proc38(val);
@@ -309,4 +338,8 @@ CGameObject *CPetControl::getHiddenObject(const CString &name) {
 	return room ? findItemInRoom(room, name) : nullptr;
 }
 
+bool CPetControl::containsPt(const Common::Point &pt) const {
+	return _drawBounds.contains(pt);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index ea7c684..24ab78a 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -42,11 +42,11 @@ private:
 	int _fieldC0;
 	int _locked;
 	int _fieldC8;
-	CPetConversationSection _convSection;
-	CPetInventorySection _invSection;
-	CPetRemoteSection _remoteSection;
-	CPetRoomsSection _roomsSection;
-	CPetSaveSection _saveSection;
+	CPetConversationSection _conversations;
+	CPetInventorySection _inventory;
+	CPetRemoteSection _remote;
+	CPetRoomsSection _rooms;
+	CPetSaveSection _saves;
 	CPetControlSub5 _sub5;
 	CPetControlSub7 _sub7;
 	CPetFrame _frame;
@@ -55,7 +55,7 @@ private:
 	CTreeItem *_treeItem2;
 	CString _string2;
 	CRoomItem *_hiddenRoom;
-	Rect _oldBounds;
+	Rect _drawBounds;
 private:
 	/**
 	 * Returns true if the control is in a valid state
@@ -81,6 +81,11 @@ private:
 	 * Scan the specified room for an item by name
 	 */
 	CGameObject *findItemInRoom(CRoomItem *room, const CString &name) const;
+
+	/**
+	 * Returns true if the draw bounds contains the specified point
+	 */
+	bool containsPt(const Common::Point &pt) const;
 public:
 	PetArea _currentArea;
 public:
@@ -103,6 +108,11 @@ public:
 	virtual void draw(CScreenManager *screenManager);
 
 	/**
+	 * Gets the bounds occupied by the item
+	 */
+	virtual Rect getBounds();
+
+	/**
 	 * Called after loading a game has finished
 	 */
 	void postLoad();
diff --git a/engines/titanic/pet_control/pet_control_sub5.cpp b/engines/titanic/pet_control/pet_control_sub5.cpp
index 6a9b92e..0b43853 100644
--- a/engines/titanic/pet_control/pet_control_sub5.cpp
+++ b/engines/titanic/pet_control/pet_control_sub5.cpp
@@ -40,4 +40,9 @@ void CPetControlSub5::load(SimpleFile *file, int param) {
 	}
 }
 
+bool CPetControlSub5::isValid(CPetControl *petControl) {
+	// TODO
+	return true; 
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub5.h b/engines/titanic/pet_control/pet_control_sub5.h
index 088ba6f..4997bf1 100644
--- a/engines/titanic/pet_control/pet_control_sub5.h
+++ b/engines/titanic/pet_control/pet_control_sub5.h
@@ -56,6 +56,11 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file, int param);
+
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub7.cpp b/engines/titanic/pet_control/pet_control_sub7.cpp
index f57454d..5b03322 100644
--- a/engines/titanic/pet_control/pet_control_sub7.cpp
+++ b/engines/titanic/pet_control/pet_control_sub7.cpp
@@ -24,4 +24,9 @@
 
 namespace Titanic {
 
+bool CPetControlSub7::isValid(CPetControl *petControl) {
+	// TODO
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub7.h b/engines/titanic/pet_control/pet_control_sub7.h
index fba7d2d..5ad0ba7 100644
--- a/engines/titanic/pet_control/pet_control_sub7.h
+++ b/engines/titanic/pet_control/pet_control_sub7.h
@@ -33,7 +33,10 @@ private:
 	CPetControlSub12 _sub1;
 	CPetControlSub12 _sub2;
 public:
-
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversation_section.cpp b/engines/titanic/pet_control/pet_conversation_section.cpp
index 890a03d..166c8ec 100644
--- a/engines/titanic/pet_control/pet_conversation_section.cpp
+++ b/engines/titanic/pet_control/pet_conversation_section.cpp
@@ -40,4 +40,9 @@ void CPetConversationSection::load(SimpleFile *file, int param) {
 		_valArray3[idx] = file->readNumber();
 }
 
+bool CPetConversationSection::isValid(CPetControl *petControl) {
+	// TODO
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversation_section.h b/engines/titanic/pet_control/pet_conversation_section.h
index 863a0d9..55492ce 100644
--- a/engines/titanic/pet_control/pet_conversation_section.h
+++ b/engines/titanic/pet_control/pet_conversation_section.h
@@ -62,6 +62,11 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file, int param);
+
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_frame.h b/engines/titanic/pet_control/pet_frame.h
index 83543ef..2bf9f2a 100644
--- a/engines/titanic/pet_control/pet_frame.h
+++ b/engines/titanic/pet_control/pet_frame.h
@@ -28,6 +28,10 @@
 
 namespace Titanic {
 
+/**
+ * This implements the frame and background for the PET display.
+ * This includes the area buttons and title
+ */
 class CPetFrame : public CPetSection {
 private:
 	static int _indexes[6];
diff --git a/engines/titanic/pet_control/pet_inventory_section.cpp b/engines/titanic/pet_control/pet_inventory_section.cpp
index d859576..675d603 100644
--- a/engines/titanic/pet_control/pet_inventory_section.cpp
+++ b/engines/titanic/pet_control/pet_inventory_section.cpp
@@ -39,4 +39,9 @@ void CPetInventorySection::load(SimpleFile *file, int param) {
 	_field298 = file->readNumber();
 }
 
+bool CPetInventorySection::isValid(CPetControl *petControl) {
+	// TODO
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory_section.h b/engines/titanic/pet_control/pet_inventory_section.h
index 4adad46..4d36e2f 100644
--- a/engines/titanic/pet_control/pet_inventory_section.h
+++ b/engines/titanic/pet_control/pet_inventory_section.h
@@ -52,6 +52,11 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file, int param);
+
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_section.cpp b/engines/titanic/pet_control/pet_remote_section.cpp
index 7cdde01..3772084 100644
--- a/engines/titanic/pet_control/pet_remote_section.cpp
+++ b/engines/titanic/pet_control/pet_remote_section.cpp
@@ -24,4 +24,9 @@
 
 namespace Titanic {
 
+bool CPetRemoteSection::isValid(CPetControl *petControl) {
+	// TODO
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_section.h b/engines/titanic/pet_control/pet_remote_section.h
index 562579d..f3063bd 100644
--- a/engines/titanic/pet_control/pet_remote_section.h
+++ b/engines/titanic/pet_control/pet_remote_section.h
@@ -46,8 +46,10 @@ private:
 	CPetGfxElement _val11;
 	CPetControlSub12 _sub12;
 public:
-
-
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms_section.cpp b/engines/titanic/pet_control/pet_rooms_section.cpp
index b866fb3..d0d0985 100644
--- a/engines/titanic/pet_control/pet_rooms_section.cpp
+++ b/engines/titanic/pet_control/pet_rooms_section.cpp
@@ -56,4 +56,10 @@ void CPetRoomsSection::load(SimpleFile *file, int param) {
 	}
 }
 
+bool CPetRoomsSection::isValid(CPetControl *petControl) {
+	// TODO
+	return true;
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms_section.h b/engines/titanic/pet_control/pet_rooms_section.h
index 66c6e8c..a4bcefe 100644
--- a/engines/titanic/pet_control/pet_rooms_section.h
+++ b/engines/titanic/pet_control/pet_rooms_section.h
@@ -62,6 +62,11 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file, int param);
+
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_save_section.cpp b/engines/titanic/pet_control/pet_save_section.cpp
index e513dd3..8d24fed 100644
--- a/engines/titanic/pet_control/pet_save_section.cpp
+++ b/engines/titanic/pet_control/pet_save_section.cpp
@@ -24,4 +24,9 @@
 
 namespace Titanic {
 
+bool CPetSaveSection::isValid(CPetControl *petControl) {
+	// TODO
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_save_section.h b/engines/titanic/pet_control/pet_save_section.h
index fb9004f..5023382 100644
--- a/engines/titanic/pet_control/pet_save_section.h
+++ b/engines/titanic/pet_control/pet_save_section.h
@@ -34,7 +34,10 @@ private:
 	CPetControlSub10 _sub10;
 	CPetControlSub10 _sub12;
 public:
-
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp
index 321f1fb..d531b5d 100644
--- a/engines/titanic/pet_control/pet_section.cpp
+++ b/engines/titanic/pet_control/pet_section.cpp
@@ -25,10 +25,6 @@
 
 namespace Titanic {
 
-void CPetSection::proc4() {
-	error("TODO");
-}
-
 void CPetSection::proc16() {
 	error("TODO");
 }
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 2612d64..b08e4d6 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -68,7 +68,11 @@ public:
 	 */
 	virtual void draw(CScreenManager *screenManager) {}
 	
-	virtual void proc4();
+	/**
+	 * Get the bounds for the section
+	 */
+	virtual Rect getBounds() { return Rect(); }
+	
 	virtual void proc5(int val) {}
 	virtual int proc6() { return 0; }
 	virtual int proc7() { return 0; }
@@ -85,10 +89,7 @@ public:
 	/**
 	 * Returns true if the object is in a valid state
 	 */
-	virtual bool isValid(CPetControl *petControl) {
-		// TODO: Switch back to false after implementing all sections
-		return true;
-	}
+	virtual bool isValid(CPetControl *petControl) { return false; }
 
 	/**
 	 * Load the data for the class from file


Commit: 5923ee5001af91d1ca9294b1fead56ec04ece7df
    https://github.com/scummvm/scummvm/commit/5923ee5001af91d1ca9294b1fead56ec04ece7df
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-31T22:31:13-04:00

Commit Message:
TITANIC: Implement CPetFrame::setArea

Changed paths:
    engines/titanic/files_manager.cpp
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/input_handler.cpp
    engines/titanic/main_game_window.cpp
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_frame.cpp
    engines/titanic/pet_control/pet_frame.h
    engines/titanic/pet_control/pet_gfx_element.cpp



diff --git a/engines/titanic/files_manager.cpp b/engines/titanic/files_manager.cpp
index 5db75cd..617b71b 100644
--- a/engines/titanic/files_manager.cpp
+++ b/engines/titanic/files_manager.cpp
@@ -76,7 +76,7 @@ void CFilesManager::debug(CScreenManager *screenManager) {
 
 void CFilesManager::resetView() {
 	if (_gameManager) {
-		_gameManager->_gameState.setMode(GSMODE_1);
+		_gameManager->_gameState.setMode(GSMODE_SELECTED);
 		_gameManager->initBounds();
 	}
 }
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index d191d98..cef8ed9 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -45,7 +45,7 @@ bool CGameStateMovieList::clear() {
 
 CGameState::CGameState(CGameManager *gameManager) :
 		_gameManager(gameManager), _gameLocation(this),
-		_field8(0), _fieldC(0), _mode(GSMODE_0), _field14(0), _petActive(false),
+		_field8(0), _fieldC(0), _mode(GSMODE_UNSELECTED), _field14(0), _petActive(false),
 		_field1C(0), _field20(0), _field24(0), _nodeChangeCtr(0),
 		_nodeEnterTicks(0), _field38(0) {
 }
@@ -157,7 +157,7 @@ void CGameState::changeView(CViewItem *newView, CMovieClip *clip) {
 
 void CGameState::checkForViewChange() {
 	if (_mode == GSMODE_2 && _movieList.clear()) {
-		setMode(GSMODE_1);
+		setMode(GSMODE_SELECTED);
 		if (_movieList._view)
 			enterView();
 	}
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 49180aa..ec6ef44 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -33,7 +33,7 @@ namespace Titanic {
 
 class CGameManager;
 
-enum GameStateMode { GSMODE_0 = 0, GSMODE_1 = 1, GSMODE_2 = 2, GSMODE_3 = 3, GSMODE_4 = 4, GSMODE_5 = 5 };
+enum GameStateMode { GSMODE_UNSELECTED = 0, GSMODE_SELECTED = 1, GSMODE_2 = 2, GSMODE_3 = 3, GSMODE_4 = 4, GSMODE_5 = 5 };
 
 PTR_LIST_ITEM(CMovie);
 class CGameStateMovieList : public List<CMovieListItem> {
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index 2eb4427..8323531 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -50,7 +50,7 @@ void CInputHandler::decLockCount() {
 
 void CInputHandler::handleMessage(CMessage &msg, bool respectLock) {
 	if (!respectLock || _lockCount <= 0) {
-		if (_gameManager->_gameState._mode == GSMODE_1) {
+		if (_gameManager->_gameState._mode == GSMODE_SELECTED) {
 			processMessage(&msg);
 		} else if (!msg.isMouseMsg()) {
 			g_vm->_filesManager.loadDrive();
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 6abe83b..5b8cba3 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -68,7 +68,7 @@ void CMainGameWindow::applicationStarting() {
 	// Load either a new game or selected existing save
 	_project->loadGame(saveSlot);
 	_inputAllowed = true;
-	_gameManager->_gameState.setMode(GSMODE_1);
+	_gameManager->_gameState.setMode(GSMODE_SELECTED);
 
 	// TODO: Cursor/image
 
@@ -123,7 +123,7 @@ void CMainGameWindow::draw() {
 		scrManager->clearSurface(SURFACE_BACKBUFFER, &_gameManager->_bounds);
 
 		switch (_gameManager->_gameState._mode) {
-		case GSMODE_1:
+		case GSMODE_SELECTED:
 		case GSMODE_2:
 			if (_gameManager->_gameState._petActive)
 				drawPet(scrManager);
diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index 39d8fea..a4c5b27 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -26,7 +26,7 @@
 
 namespace Titanic {
 
-CPetElement::CPetElement() : _mode(MODE_0) {}
+CPetElement::CPetElement() : _mode(MODE_UNSELECTED) {}
 
 void CPetElement::getBounds(Rect *rect) {
 	if (rect)
@@ -36,14 +36,14 @@ void CPetElement::getBounds(Rect *rect) {
 bool CPetElement::proc6(const Common::Point &pt) {
 	bool result = _bounds.contains(pt);
 	if (result)
-		setMode(MODE_1);
+		setMode(MODE_SELECTED);
 	return result;
 }
 
 bool CPetElement::proc7(const Common::Point &pt) {
 	bool result = _bounds.contains(pt);
 	if (result)
-		setMode(MODE_0);
+		setMode(MODE_UNSELECTED);
 	return result;
 }
 
@@ -93,7 +93,7 @@ int CPetElement::proc15() {
 }
 
 void CPetElement::setMode(PetElementMode newMode) {
-	if (newMode >= MODE_0 && newMode <= MODE_2)
+	if (newMode >= MODE_UNSELECTED && newMode <= MODE_2)
 		changeMode(newMode);
 }
 
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index c6b0054..fdb8ca5 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -29,7 +29,7 @@
 
 namespace Titanic {
 
-enum PetElementMode { MODE_0 = 0, MODE_1 = 1, MODE_2 = 2 };
+enum PetElementMode { MODE_UNSELECTED = 0, MODE_SELECTED = 1, MODE_2 = 2 };
 
 class CGameObject;
 class CPetControl;
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index 48a05cd..def6bca 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -42,22 +42,22 @@ bool CPetFrame::setup(CPetControl *petControl) {
 
 bool CPetFrame::setup() {
 	if (_petControl) {
-		_background.setup("PetBackground", _petControl, MODE_0);
-		_modeBackground.setup("PetModeBackground", _petControl, MODE_0);
+		_background.setup("PetBackground", _petControl, MODE_UNSELECTED);
+		_modeBackground.setup("PetModeBackground", _petControl, MODE_UNSELECTED);
 
 		for (int idx = 0; idx < 5; ++idx) {
 			CString resName = Common::String::format("PetMode%d", idx);
-			_modeButtons[idx].setup(resName, _petControl, MODE_0);
+			_modeButtons[idx].setup(resName, _petControl, MODE_UNSELECTED);
 		}
 
 		for (int idx = 0; idx < 6; ++idx) {
 			CString resName = Common::String::format("3Pettitle%d", idx);
-			_titles[idx].setup(resName, _petControl, MODE_0);
+			_titles[idx].setup(resName, _petControl, MODE_UNSELECTED);
 		}
 
 		for (int idx = 0; idx < 7; ++idx) {
 			CString resName = Common::String::format("PetIndent%d", idx);
-			_titles[idx].setup(resName, _petControl, MODE_0);
+			_indent[idx].setup(resName, _petControl, MODE_UNSELECTED);
 		}
 	}
 
@@ -67,8 +67,8 @@ bool CPetFrame::setup() {
 bool CPetFrame::isValid(CPetControl *petControl) {
 	bool result = setPetControl(petControl);
 	if (result) {
-		_modeButtons[_indexes[0]].setMode(MODE_0);
-		_modeButtons[_indexes[4]].setMode(MODE_1);
+		_modeButtons[_indexes[0]].setMode(MODE_UNSELECTED);
+		_modeButtons[_indexes[4]].setMode(MODE_SELECTED);
 	}
 
 	return result;
@@ -98,12 +98,12 @@ bool CPetFrame::setPetControl(CPetControl *petControl) {
 			_modeButtons[idx].setBounds(r);
 			_modeButtons[idx].translate(0, YLIST[idx]);
 		}
-		_modeButtons[_indexes[0]].setMode(MODE_1);
+		_modeButtons[_indexes[0]].setMode(MODE_SELECTED);
 		
 		const int XLIST[] = { 73, 54, 85, 109, 38, 71 };
 		for (int idx = 0; idx < 6; ++idx) {
 			_titles[idx].setBounds(Rect(0, 0, 110, 11));
-			_titles[idx].translate(XLIST[idx], 471);
+			_titles[idx].translate(600 - XLIST[idx], 471);
 		}
 	}
 
@@ -111,7 +111,14 @@ bool CPetFrame::setPetControl(CPetControl *petControl) {
 }
 
 void CPetFrame::setArea(PetArea newArea) {
-	warning("TODO: CPetFrame::setArea");
+	resetArea();
+	if (newArea < PET_6)
+		_modeButtons[_indexes[newArea]].setMode(MODE_SELECTED);
+}
+
+void CPetFrame::resetArea() {
+	for (int idx = 0; idx < 6; ++idx)
+		_modeButtons[idx].setMode(MODE_UNSELECTED);
 }
 
 void CPetFrame::drawFrame(CScreenManager *screenManager) {
diff --git a/engines/titanic/pet_control/pet_frame.h b/engines/titanic/pet_control/pet_frame.h
index 2bf9f2a..683f629 100644
--- a/engines/titanic/pet_control/pet_frame.h
+++ b/engines/titanic/pet_control/pet_frame.h
@@ -77,6 +77,11 @@ public:
 	void setArea(PetArea newArea);
 
 	/**
+	 * Reset the currently selected area
+	 */
+	void resetArea();
+
+	/**
 	 * Draws the PET frame
 	 */
 	void drawFrame(CScreenManager *screenManager);
diff --git a/engines/titanic/pet_control/pet_gfx_element.cpp b/engines/titanic/pet_control/pet_gfx_element.cpp
index 616db72..7f249f0 100644
--- a/engines/titanic/pet_control/pet_gfx_element.cpp
+++ b/engines/titanic/pet_control/pet_gfx_element.cpp
@@ -30,10 +30,10 @@ namespace Titanic {
 void CPetGfxElement::setup(PetElementMode mode, const CString &name,
 		CPetControl *petControl) {
 	switch (mode) {
-	case MODE_0:
+	case MODE_UNSELECTED:
 		_object0 = petControl->getHiddenObject(name);
 		break;
-	case MODE_1:
+	case MODE_SELECTED:
 		_object1 = petControl->getHiddenObject(name);
 		break;
 	case MODE_2:
@@ -91,9 +91,9 @@ void CPetGfxElement::getBounds(Rect *rect) {
 
 CGameObject *CPetGfxElement::getObject() const {
 	switch (_mode) {
-	case MODE_0:
+	case MODE_UNSELECTED:
 		return _object0;
-	case MODE_1:
+	case MODE_SELECTED:
 		return _object1;
 	case MODE_2:
 		return _object2;


Commit: 18fabbb2d40ce9456d4673c0b7c602f50458b583
    https://github.com/scummvm/scummvm/commit/18fabbb2d40ce9456d4673c0b7c602f50458b583
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-31T23:25:19-04:00

Commit Message:
TITANIC: Beginnings of PET event handling code

Changed paths:
    engines/titanic/core/saveable_object.cpp
    engines/titanic/messages/messages.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 022a72b..c77bd2b 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -920,6 +920,7 @@ DEFFN(CTakeHeadPieceMsg)
 DEFFN(CTextInputMsg)
 DEFFN(CTimeDilationMsg)
 DEFFN(CTimeMsg)
+DEFFN(CTimerMsg)
 DEFFN(CTitleSequenceEndedMsg)
 DEFFN(CTransitMsg)
 DEFFN(CTransportMsg)
@@ -1503,6 +1504,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CTextInputMsg, CMessage);
 	ADDFN(CTimeDilationMsg, CMessage);
 	ADDFN(CTimeMsg, CMessage);
+	ADDFN(CTimerMsg, CTimeMsg);
 	ADDFN(CTitleSequenceEndedMsg, CMessage);
 	ADDFN(CTransitMsg, CMessage);
 	ADDFN(CTransportMsg, CMessage);
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 99df239..b78fac4 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_MESSAGES_H
 #define TITANIC_MESSAGES_H
 
+#include "common/keyboard.h"
 #include "titanic/core/saveable_object.h"
 #include "titanic/core/tree_item.h"
 
@@ -37,6 +38,65 @@ enum MessageFlag {
 #define MSGTARGET(NAME) class NAME; class NAME##Target { public: \
 	virtual bool handleMessage(NAME &msg) = 0; }
 
+#define MESSAGE0(NAME) MSGTARGET(NAME); \
+	class NAME: public CMessage { \
+	public: NAME() : CMessage() {} \
+	CLASSDEF \
+	static bool isSupportedBy(const CTreeItem *item) { \
+		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
+	virtual bool perform(CTreeItem *treeItem) { \
+		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
+		return dest != nullptr && dest->handleMessage(*this); \
+	} }
+#define MESSAGE1(NAME, F1, N1, V1) MSGTARGET(NAME); \
+	class NAME: public CMessage { \
+	public: F1 _##N1; \
+	NAME() : CMessage(), _##N1(V1) {} \
+	NAME(F1 N1) : CMessage(), _##N1(N1) {} \
+	CLASSDEF \
+	static bool isSupportedBy(const CTreeItem *item) { \
+		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
+	virtual bool perform(CTreeItem *treeItem) { \
+		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
+		return dest != nullptr && dest->handleMessage(*this); \
+	} }
+#define MESSAGE2(NAME, F1, N1, V1, F2, N2, V2) MSGTARGET(NAME); \
+	class NAME: public CMessage { \
+	public: F1 _##N1; F2 _##N2; \
+	NAME() : CMessage(), _##N1(V1), _##N2(V2) {} \
+	NAME(F1 N1, F2 N2) : CMessage(), _##N1(N1), _##N2(N2) {} \
+	CLASSDEF \
+	static bool isSupportedBy(const CTreeItem *item) { \
+		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
+	virtual bool perform(CTreeItem *treeItem) { \
+		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
+		return dest != nullptr && dest->handleMessage(*this); \
+	} }
+#define MESSAGE3(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3) MSGTARGET(NAME); \
+	class NAME: public CMessage { \
+	public: F1 _##N1; F2 _##N2; F3 _##N3; \
+	NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3) {} \
+	NAME(F1 N1, F2 N2, F3 N3) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3) {} \
+	CLASSDEF \
+	static bool isSupportedBy(const CTreeItem *item) { \
+		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
+	virtual bool perform(CTreeItem *treeItem) { \
+		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
+		return dest != nullptr && dest->handleMessage(*this); \
+	} }
+#define MESSAGE4(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3, F4, N4, V4) MSGTARGET(NAME); \
+	class NAME: public CMessage { \
+	public: F1 _##N1; F2 _##N2; F3 _##N3; F4 _##N4; \
+	NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3), _##N4(V4) {} \
+	NAME(F1 N1, F2 N2, F3 N3, F4 N4) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3), _##N4(N4) {} \
+	CLASSDEF \
+	static bool isSupportedBy(const CTreeItem *item) { \
+		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
+	virtual bool perform(CTreeItem *treeItem) { \
+		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
+		return dest != nullptr && dest->handleMessage(*this); \
+	} }
+
 class CGameObject;
 class CRoomItem;
 class CNodeItem;
@@ -193,64 +253,26 @@ public:
 	}
 };
 
-#define MESSAGE0(NAME) MSGTARGET(NAME); \
-	class NAME: public CMessage { \
-	public: NAME() : CMessage() {} \
-	CLASSDEF \
-	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
-	virtual bool perform(CTreeItem *treeItem) { \
-		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
-		return dest != nullptr && dest->handleMessage(*this); \
-	} }
-#define MESSAGE1(NAME, F1, N1, V1) MSGTARGET(NAME); \
-	class NAME: public CMessage { \
-	public: F1 _##N1; \
-	NAME() : CMessage(), _##N1(V1) {} \
-	NAME(F1 N1) : CMessage(), _##N1(N1) {} \
-	CLASSDEF \
-	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
-	virtual bool perform(CTreeItem *treeItem) { \
-		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
-		return dest != nullptr && dest->handleMessage(*this); \
-	} }
-#define MESSAGE2(NAME, F1, N1, V1, F2, N2, V2) MSGTARGET(NAME); \
-	class NAME: public CMessage { \
-	public: F1 _##N1; F2 _##N2; \
-	NAME() : CMessage(), _##N1(V1), _##N2(V2) {} \
-	NAME(F1 N1, F2 N2) : CMessage(), _##N1(N1), _##N2(N2) {} \
-	CLASSDEF \
-	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
-	virtual bool perform(CTreeItem *treeItem) { \
-		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
-		return dest != nullptr && dest->handleMessage(*this); \
-	} }
-#define MESSAGE3(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3) MSGTARGET(NAME); \
-	class NAME: public CMessage { \
-	public: F1 _##N1; F2 _##N2; F3 _##N3; \
-	NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3) {} \
-	NAME(F1 N1, F2 N2, F3 N3) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3) {} \
-	CLASSDEF \
-	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
-	virtual bool perform(CTreeItem *treeItem) { \
-		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
-		return dest != nullptr && dest->handleMessage(*this); \
-	} }
-#define MESSAGE4(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3, F4, N4, V4) MSGTARGET(NAME); \
-	class NAME: public CMessage { \
-	public: F1 _##N1; F2 _##N2; F3 _##N3; F4 _##N4; \
-	NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3), _##N4(V4) {} \
-	NAME(F1 N1, F2 N2, F3 N3, F4 N4) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3), _##N4(N4) {} \
-	CLASSDEF \
-	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
-	virtual bool perform(CTreeItem *treeItem) { \
-		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
-		return dest != nullptr && dest->handleMessage(*this); \
-	} }
+MESSAGE1(CTimeMsg, int, value, 0);
+
+MSGTARGET(CTimerMsg);
+class CTimerMsg : public CTimeMsg {
+public:
+	int _field8;
+	int _fieldC;
+	CString _string1;
+public:
+	CLASSDEF
+	CTimerMsg() : CTimeMsg(), _field8(0), _fieldC(0) {}
+
+	static bool isSupportedBy(const CTreeItem *item) {
+		return dynamic_cast<const CTimerMsgTarget *>(item) != nullptr;
+	}
+	virtual bool perform(CTreeItem *treeItem) {
+		CTimerMsgTarget *dest = dynamic_cast<CTimerMsgTarget *>(treeItem);
+		return dest != nullptr && dest->handleMessage(*this);
+	}
+};
 
 MESSAGE1(CActMsg, CString, action, "");
 MESSAGE1(CActivationmsg, CString, value, "");
@@ -387,7 +409,6 @@ MESSAGE1(CSummonBotQuerryMsg, CString, value, "");
 MESSAGE1(CTakeHeadPieceMsg, CString, value, "");
 MESSAGE2(CTextInputMsg, CString, value1, "", CString, value2, "");
 MESSAGE1(CTimeDilationMsg, int, value, 0);
-MESSAGE1(CTimeMsg, int, value, 0);
 MESSAGE0(CTitleSequenceEndedMsg);
 MESSAGE0(CTransitMsg);
 MESSAGE1(CTriggerAutoMusicPlayerMsg, int, value, 0);
@@ -405,7 +426,7 @@ MESSAGE0(CTurnOn);
 MESSAGE1(CUse, int, value, 0);
 MESSAGE1(CUseWithCharMsg, int, value, 0);
 MESSAGE1(CUseWithOtherMsg, int, value, 0);
-MESSAGE1(CVirtualKeyCharMsg, int, value, 0);
+MESSAGE1(CVirtualKeyCharMsg, Common::KeyState, keyState, Common::KeyState());
 MESSAGE1(CVisibleMsg, bool, visible, true);
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 6df688e..9d2622f 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -157,7 +157,7 @@ Rect CPetControl::getBounds() {
 		return _sub7.getBounds();
 		break;
 	default:
-		break;
+		return Rect();
 	}
 }
 
@@ -342,4 +342,101 @@ bool CPetControl::containsPt(const Common::Point &pt) const {
 	return _drawBounds.contains(pt);
 }
 
+bool CPetControl::getC0() const {
+	return _fieldC0 > 0;
+}
+
+bool CPetControl::handleMessage(CMouseButtonDownMsg &msg) {
+	return true;
+}
+
+bool CPetControl::handleMessage(CMouseDragStartMsg &msg) {
+	return true;
+}
+
+bool CPetControl::handleMessage(CMouseDragMoveMsg &msg) {
+	return true;
+}
+
+bool CPetControl::handleMessage(CMouseDragEndMsg &msg) {
+	return true;
+}
+
+bool CPetControl::handleMessage(CMouseButtonUpMsg &msg) {
+	return true;
+}
+
+bool CPetControl::handleMessage(CMouseDoubleClickMsg &msg) {
+	return true;
+}
+
+bool CPetControl::handleMessage(CKeyCharMsg &msg) {
+	return true;
+}
+
+bool CPetControl::handleMessage(CVirtualKeyCharMsg &msg) {
+	if (getC0())
+		return false;
+
+	bool result = false;
+	switch (_currentArea) {
+	case PET_INVENTORY:
+		result = _inventory.handleMessage(msg);
+		break;
+	case PET_CONVERSATION:
+		result = _conversations.handleMessage(msg);
+		break;
+	case PET_REMOTE:
+		result = _remote.handleMessage(msg);
+		break;
+	case PET_ROOMS:
+		result = _rooms.handleMessage(msg);
+		break;
+	case PET_SAVE:
+		result = _saves.handleMessage(msg);
+		break;
+	case PET_5:
+		result = _sub5.handleMessage(msg);
+		break;
+	case PET_6:
+		result = _sub7.handleMessage(msg);
+		break;
+	default:
+		break;
+	}
+
+	if (!result) {
+		switch (msg._keyState.keycode) {
+		case Common::KEYCODE_F1:
+			result = true;
+			setArea(PET_INVENTORY);
+			break;
+		case Common::KEYCODE_F2:
+			result = true;
+			setArea(PET_CONVERSATION);
+			break;
+		case Common::KEYCODE_F3:
+			result = true;
+			setArea(PET_REMOTE);
+			break;
+		case Common::KEYCODE_F4:
+			result = true;
+			setArea(PET_ROOMS);
+			break;
+		case Common::KEYCODE_F5:
+			result = true;
+			setArea(PET_SAVE);
+			break;
+		default:
+			break;
+		}
+	}
+
+	return result;
+}
+
+bool CPetControl::handleMessage(CTimerMsg &msg) {
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 24ab78a..be3b4a6 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -26,6 +26,8 @@
 #include "titanic/core/game_object.h"
 #include "titanic/core/node_item.h"
 #include "titanic/core/room_item.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
 #include "titanic/pet_control/pet_conversation_section.h"
 #include "titanic/pet_control/pet_frame.h"
 #include "titanic/pet_control/pet_inventory_section.h"
@@ -37,7 +39,16 @@
 
 namespace Titanic {
 
-class CPetControl : public CGameObject {
+class CPetControl : public CGameObject,
+	public CMouseButtonDownMsgTarget,
+	public CMouseDragStartMsgTarget,
+	public CMouseDragMoveMsgTarget,
+	public CMouseDragEndMsgTarget,
+	public CMouseButtonUpMsgTarget,
+	public CMouseDoubleClickMsgTarget,
+	public CKeyCharMsgTarget,
+	public CVirtualKeyCharMsgTarget,
+	public CTimerMsgTarget {
 private:
 	int _fieldC0;
 	int _locked;
@@ -86,6 +97,18 @@ private:
 	 * Returns true if the draw bounds contains the specified point
 	 */
 	bool containsPt(const Common::Point &pt) const;
+
+	bool getC0() const;
+protected:
+	bool handleMessage(CMouseButtonDownMsg &msg);
+	bool handleMessage(CMouseDragStartMsg &msg);
+	bool handleMessage(CMouseDragMoveMsg &msg);
+	bool handleMessage(CMouseDragEndMsg &msg);
+	bool handleMessage(CMouseButtonUpMsg &msg);
+	bool handleMessage(CMouseDoubleClickMsg &msg);
+	bool handleMessage(CKeyCharMsg &msg);
+	bool handleMessage(CVirtualKeyCharMsg &msg);
+	bool handleMessage(CTimerMsg &msg);
 public:
 	PetArea _currentArea;
 public:
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index b08e4d6..f81e8d0 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_PET_SECTION_H
 #define TITANIC_PET_SECTION_H
 
+#include "titanic/messages/messages.h"
 #include "titanic/simple_file.h"
 
 namespace Titanic {
@@ -81,7 +82,12 @@ public:
 	virtual int proc10() { return 0; }
 	virtual int proc11() { return 0; }
 	virtual int proc12() { return 0; }
-	virtual int proc13() { return 0; }
+
+	/**
+	 * Handles special keypresses
+	 */
+	virtual bool handleMessage(CVirtualKeyCharMsg &msg) { return false; }
+
 	virtual int proc14() { return 0; }
 	virtual int proc15() { return 0; }
 	virtual void proc16();


Commit: 43f183c207023c4398548ae385c9f3cbf853d9a9
    https://github.com/scummvm/scummvm/commit/43f183c207023c4398548ae385c9f3cbf853d9a9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-03-31T23:40:30-04:00

Commit Message:
TITANIC: Implement keyboard event handling

Changed paths:
    engines/titanic/events.cpp
    engines/titanic/input_translator.cpp
    engines/titanic/input_translator.h



diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index 5202d7c..038bc8b 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -187,6 +187,9 @@ void Events::keyDown(Common::KeyState keyState) {
 		_vm->_debugger->attach();
 		_vm->_debugger->onFrame();
 	}
+
+	if (_vm->_window->_inputAllowed)
+		_vm->_window->_gameManager->_inputTranslator.keyDown(keyState);
 }
 
 void Events::keyUp(Common::KeyState keyState) {
diff --git a/engines/titanic/input_translator.cpp b/engines/titanic/input_translator.cpp
index 2251c2f..9769076 100644
--- a/engines/titanic/input_translator.cpp
+++ b/engines/titanic/input_translator.cpp
@@ -94,4 +94,16 @@ void CInputTranslator::rightButtonDoubleClick(int special, const Point &pt) {
 	_inputHandler->handleMessage(msg);
 }
 
+void CInputTranslator::keyDown(const Common::KeyState &keyState) {
+	if (keyState.keycode >= Common::KEYCODE_F1 && keyState.keycode <= Common::KEYCODE_F5) {
+		CVirtualKeyCharMsg msg(keyState);
+		_inputHandler->handleMessage(msg);
+	}
+
+	if (keyState.ascii >= 32 && keyState.ascii <= 127) {
+		CKeyCharMsg msg(keyState.ascii);
+		_inputHandler->handleMessage(msg);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/input_translator.h b/engines/titanic/input_translator.h
index ad4f2d9..7ca2a78 100644
--- a/engines/titanic/input_translator.h
+++ b/engines/titanic/input_translator.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_INPUT_TRANSLATOR_H
 #define TITANIC_INPUT_TRANSLATOR_H
 
+#include "common/keyboard.h"
 #include "titanic/messages/mouse_messages.h"
 
 namespace Titanic {
@@ -50,6 +51,7 @@ public:
 	void rightButtonDown(int special, const Point &pt);
 	void rightButtonUp(int special, const Point &pt);
 	void rightButtonDoubleClick(int special, const Point &pt);
+	void keyDown(const Common::KeyState &keyState);
 };
 
 } // End of namespace Titanic


Commit: 883e198eb3c5e54c2c3bc9b01f65f3420840873f
    https://github.com/scummvm/scummvm/commit/883e198eb3c5e54c2c3bc9b01f65f3420840873f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-01T08:32:30-04:00

Commit Message:
TITANIC: Implement PET CMouseButtonDownMsg handling

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 9d2622f..f316cff 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -208,7 +208,7 @@ void CPetControl::fn4() {
 }
 
 PetArea CPetControl::setArea(PetArea newArea) {
-	if (newArea == _currentArea || !canChangeArea())
+	if (newArea == _currentArea || !isUnlocked())
 		return _currentArea;
 
 	// Signal the currently active area that it's being left
@@ -347,7 +347,42 @@ bool CPetControl::getC0() const {
 }
 
 bool CPetControl::handleMessage(CMouseButtonDownMsg &msg) {
-	return true;
+	if (!containsPt(msg._mousePos) || getC0())
+		return false;
+
+	bool result = false;
+	if (isUnlocked())
+		result = _frame.handleMessage(msg);
+
+	if (!result) {
+		switch (_currentArea) {
+		case PET_INVENTORY:
+			result = _inventory.handleMessage(msg);
+			break;
+		case PET_CONVERSATION:
+			result = _conversations.handleMessage(msg);
+			break;
+		case PET_REMOTE:
+			result = _remote.handleMessage(msg);
+			break;
+		case PET_ROOMS:
+			result = _rooms.handleMessage(msg);
+			break;
+		case PET_SAVE:
+			result = _saves.handleMessage(msg);
+			break;
+		case PET_5:
+			result = _sub5.handleMessage(msg);
+			break;
+		case PET_6:
+			result = _sub7.handleMessage(msg);
+			break;
+		default:
+			break;
+		}
+	}
+
+	makeDirty();
 }
 
 bool CPetControl::handleMessage(CMouseDragStartMsg &msg) {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index be3b4a6..26b3583 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -169,9 +169,9 @@ public:
 	PetArea setArea(PetArea newSection);
 
 	/**
-	 * Returns true if the current area can be changed
+	 * Returns true if the PET is currently unlocked
 	 */
-	bool canChangeArea() const { return _locked == 0; }
+	bool isUnlocked() const { return _locked == 0; }
 
 	/**
 	 * Returns a game object used by the PET by name from within the
diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index a4c5b27..423c79a 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -40,8 +40,8 @@ bool CPetElement::proc6(const Common::Point &pt) {
 	return result;
 }
 
-bool CPetElement::proc7(const Common::Point &pt) {
-	bool result = _bounds.contains(pt);
+bool CPetElement::handleMessage(CMouseButtonDownMsg &msg) {
+	bool result = _bounds.contains(msg._mousePos);
 	if (result)
 		setMode(MODE_UNSELECTED);
 	return result;
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index fdb8ca5..13f209c 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -26,6 +26,7 @@
 #include "titanic/simple_file.h"
 #include "titanic/string.h"
 #include "titanic/core/link_item.h"
+#include "titanic/messages/mouse_messages.h"
 
 namespace Titanic {
 
@@ -69,7 +70,7 @@ public:
 	virtual void getBounds(Rect *rect);
 
 	virtual bool proc6(const Common::Point &pt);
-	virtual bool proc7(const Common::Point &pt);
+	virtual bool handleMessage(CMouseButtonDownMsg &msg);
 
 	/**
 	 * Returns whether the passed point falls inside the item
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index f81e8d0..1355a54 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_PET_SECTION_H
 #define TITANIC_PET_SECTION_H
 
-#include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
 #include "titanic/simple_file.h"
 
 namespace Titanic {
@@ -75,7 +75,8 @@ public:
 	virtual Rect getBounds() { return Rect(); }
 	
 	virtual void proc5(int val) {}
-	virtual int proc6() { return 0; }
+	
+	virtual bool handleMessage(CMouseButtonDownMsg &msg) { return false; }
 	virtual int proc7() { return 0; }
 	virtual int proc8() { return 0; }
 	virtual int proc9() { return 0; }


Commit: 9affb67a3c83ead5ed4e3be2ea4d369a9c61d6f3
    https://github.com/scummvm/scummvm/commit/9affb67a3c83ead5ed4e3be2ea4d369a9c61d6f3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-01T13:40:20-04:00

Commit Message:
TITANIC: Implement PET message handlers

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index f316cff..2faefb3 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -28,9 +28,10 @@
 namespace Titanic {
 
 CPetControl::CPetControl() : CGameObject(), 
-	_currentArea(PET_CONVERSATION), _fieldC0(0), _locked(0), _fieldC8(0),
-	_treeItem1(nullptr), _treeItem2(nullptr), _hiddenRoom(nullptr),
-	_drawBounds(20, 350, 620, 480) {
+		_currentArea(PET_CONVERSATION), _fieldC0(0), _locked(0), _fieldC8(0),
+		_treeItem1(nullptr), _treeItem2(nullptr), _hiddenRoom(nullptr),
+		_drawBounds(20, 350, 620, 480) {
+	_timers[0] = _timers[1] = nullptr;
 }
 
 void CPetControl::save(SimpleFile *file, int indent) const {
@@ -383,30 +384,196 @@ bool CPetControl::handleMessage(CMouseButtonDownMsg &msg) {
 	}
 
 	makeDirty();
+	return result;
 }
 
 bool CPetControl::handleMessage(CMouseDragStartMsg &msg) {
-	return true;
+	if (!containsPt(msg._mousePos) || getC0())
+		return false;
+
+	switch (_currentArea) {
+	case PET_INVENTORY:
+		return _inventory.handleMessage(msg);
+		break;
+	case PET_CONVERSATION:
+		return _conversations.handleMessage(msg);
+		break;
+	case PET_REMOTE:
+		return _remote.handleMessage(msg);
+		break;
+	case PET_ROOMS:
+		return _rooms.handleMessage(msg);
+		break;
+	case PET_SAVE:
+		return _saves.handleMessage(msg);
+		break;
+	case PET_5:
+		return _sub5.handleMessage(msg);
+		break;
+	case PET_6:
+		return _sub7.handleMessage(msg);
+		break;
+	default:
+		return false;
+	}
 }
 
 bool CPetControl::handleMessage(CMouseDragMoveMsg &msg) {
-	return true;
+	switch (_currentArea) {
+	case PET_INVENTORY:
+		return _inventory.handleMessage(msg);
+		break;
+	case PET_CONVERSATION:
+		return _conversations.handleMessage(msg);
+		break;
+	case PET_REMOTE:
+		return _remote.handleMessage(msg);
+		break;
+	case PET_ROOMS:
+		return _rooms.handleMessage(msg);
+		break;
+	case PET_SAVE:
+		return _saves.handleMessage(msg);
+		break;
+	case PET_5:
+		return _sub5.handleMessage(msg);
+		break;
+	case PET_6:
+		return _sub7.handleMessage(msg);
+		break;
+	default:
+		return false;
+	}
 }
 
 bool CPetControl::handleMessage(CMouseDragEndMsg &msg) {
-	return true;
+	switch (_currentArea) {
+	case PET_INVENTORY:
+		return _inventory.handleMessage(msg);
+		break;
+	case PET_CONVERSATION:
+		return _conversations.handleMessage(msg);
+		break;
+	case PET_REMOTE:
+		return _remote.handleMessage(msg);
+		break;
+	case PET_ROOMS:
+		return _rooms.handleMessage(msg);
+		break;
+	case PET_SAVE:
+		return _saves.handleMessage(msg);
+		break;
+	case PET_5:
+		return _sub5.handleMessage(msg);
+		break;
+	case PET_6:
+		return _sub7.handleMessage(msg);
+		break;
+	default:
+		return false;
+	}
 }
 
 bool CPetControl::handleMessage(CMouseButtonUpMsg &msg) {
-	return true;
+	if (!containsPt(msg._mousePos) || getC0())
+		return false;
+
+	bool result = false;
+	if (isUnlocked())
+		result = _frame.handleMessage(msg);
+
+	if (!result) {
+		switch (_currentArea) {
+		case PET_INVENTORY:
+			result = _inventory.handleMessage(msg);
+			break;
+		case PET_CONVERSATION:
+			result = _conversations.handleMessage(msg);
+			break;
+		case PET_REMOTE:
+			result = _remote.handleMessage(msg);
+			break;
+		case PET_ROOMS:
+			result = _rooms.handleMessage(msg);
+			break;
+		case PET_SAVE:
+			result = _saves.handleMessage(msg);
+			break;
+		case PET_5:
+			result = _sub5.handleMessage(msg);
+			break;
+		case PET_6:
+			result = _sub7.handleMessage(msg);
+			break;
+		default:
+			break;
+		}
+	}
+
+	makeDirty();
+	return result;
 }
 
 bool CPetControl::handleMessage(CMouseDoubleClickMsg &msg) {
-	return true;
+	if (!containsPt(msg._mousePos) || getC0())
+		return false;
+
+	switch (_currentArea) {
+	case PET_INVENTORY:
+		return _inventory.handleMessage(msg);
+		break;
+	case PET_CONVERSATION:
+		return _conversations.handleMessage(msg);
+		break;
+	case PET_REMOTE:
+		return _remote.handleMessage(msg);
+		break;
+	case PET_ROOMS:
+		return _rooms.handleMessage(msg);
+		break;
+	case PET_SAVE:
+		return _saves.handleMessage(msg);
+		break;
+	case PET_5:
+		return _sub5.handleMessage(msg);
+		break;
+	case PET_6:
+		return _sub7.handleMessage(msg);
+		break;
+	default:
+		return false;
+	}
 }
 
 bool CPetControl::handleMessage(CKeyCharMsg &msg) {
-	return true;
+	if (getC0())
+		return false;
+
+	switch (_currentArea) {
+	case PET_INVENTORY:
+		return _inventory.handleMessage(msg);
+		break;
+	case PET_CONVERSATION:
+		return _conversations.handleMessage(msg);
+		break;
+	case PET_REMOTE:
+		return _remote.handleMessage(msg);
+		break;
+	case PET_ROOMS:
+		return _rooms.handleMessage(msg);
+		break;
+	case PET_SAVE:
+		return _saves.handleMessage(msg);
+		break;
+	case PET_5:
+		return _sub5.handleMessage(msg);
+		break;
+	case PET_6:
+		return _sub7.handleMessage(msg);
+		break;
+	default:
+		return false;
+	}
 }
 
 bool CPetControl::handleMessage(CVirtualKeyCharMsg &msg) {
@@ -471,6 +638,7 @@ bool CPetControl::handleMessage(CVirtualKeyCharMsg &msg) {
 }
 
 bool CPetControl::handleMessage(CTimerMsg &msg) {
+	warning("TODO: CPetControl::CTimerMsg");
 	return true;
 }
 
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 26b3583..285d4f0 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -67,6 +67,7 @@ private:
 	CString _string2;
 	CRoomItem *_hiddenRoom;
 	Rect _drawBounds;
+	void *_timers[2];
 private:
 	/**
 	 * Returns true if the control is in a valid state
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 1355a54..352e224 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -76,17 +76,17 @@ public:
 	
 	virtual void proc5(int val) {}
 	
-	virtual bool handleMessage(CMouseButtonDownMsg &msg) { return false; }
-	virtual int proc7() { return 0; }
-	virtual int proc8() { return 0; }
-	virtual int proc9() { return 0; }
-	virtual int proc10() { return 0; }
-	virtual int proc11() { return 0; }
-	virtual int proc12() { return 0; }
-
 	/**
-	 * Handles special keypresses
+	 * Following are handlers for the various messages that the PET can
+	 * pass onto the currently active section/area
 	 */
+	virtual bool handleMessage(CMouseButtonDownMsg &msg) { return false; }
+	virtual bool handleMessage(CMouseDragStartMsg &msg) { return false; }
+	virtual bool handleMessage(CMouseDragMoveMsg &msg) { return false; }
+	virtual bool handleMessage(CMouseDragEndMsg &msg) { return false; }
+	virtual bool handleMessage(CMouseButtonUpMsg &msg) { return false; }
+	virtual bool handleMessage(CMouseDoubleClickMsg &msg) { return false; }
+	virtual bool handleMessage(CKeyCharMsg &msg) { return false; }
 	virtual bool handleMessage(CVirtualKeyCharMsg &msg) { return false; }
 
 	virtual int proc14() { return 0; }


Commit: 52905fdea9223713cbca6775e94dc7c64745f560
    https://github.com/scummvm/scummvm/commit/52905fdea9223713cbca6775e94dc7c64745f560
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-01T18:51:18-04:00

Commit Message:
TITANIC: Simplify the area switches used in PET control methods

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 2faefb3..1ea9977 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -32,6 +32,13 @@ CPetControl::CPetControl() : CGameObject(),
 		_treeItem1(nullptr), _treeItem2(nullptr), _hiddenRoom(nullptr),
 		_drawBounds(20, 350, 620, 480) {
 	_timers[0] = _timers[1] = nullptr;
+	_sections[PET_INVENTORY] = &_inventory;
+	_sections[PET_CONVERSATION] = &_conversations;
+	_sections[PET_REMOTE] = &_remote;
+	_sections[PET_ROOMS] = &_rooms;
+	_sections[PET_SAVE] = &_saves;
+	_sections[PET_5] = &_sub5;
+	_sections[PET_6] = &_sub7;
 }
 
 void CPetControl::save(SimpleFile *file, int indent) const {
@@ -106,60 +113,12 @@ void CPetControl::draw(CScreenManager *screenManager) {
 		_frame.drawFrame(screenManager);
 
 		// Draw the specific area that's currently active
-		switch (_currentArea) {
-		case PET_INVENTORY:
-			_inventory.draw(screenManager);
-			break;
-		case PET_CONVERSATION:
-			_conversations.draw(screenManager);
-			break;
-		case PET_REMOTE:
-			_remote.draw(screenManager);
-			break;
-		case PET_ROOMS:
-			_rooms.draw(screenManager);
-			break;
-		case PET_SAVE:
-			_saves.draw(screenManager);
-			break;
-		case PET_5:
-			_sub5.draw(screenManager);
-			break;
-		case PET_6:
-			_sub7.draw(screenManager);
-			break;
-		default:
-			break;
-		}
+		_sections[_currentArea]->draw(screenManager);
 	}
 }
 
 Rect CPetControl::getBounds() {
-	switch (_currentArea) {
-	case PET_INVENTORY:
-		return _inventory.getBounds();
-		break;
-	case PET_CONVERSATION:
-		return _conversations.getBounds();
-		break;
-	case PET_REMOTE:
-		return _remote.getBounds();
-		break;
-	case PET_ROOMS:
-		return _rooms.getBounds();
-		break;
-	case PET_SAVE:
-		return _saves.getBounds();
-		break;
-	case PET_5:
-		return _sub5.getBounds();
-		break;
-	case PET_6:
-		return _sub7.getBounds();
-		break;
-	default:
-		return Rect();
-	}
+	return _sections[_currentArea]->getBounds();
 }
 
 void CPetControl::postLoad() {
@@ -213,31 +172,7 @@ PetArea CPetControl::setArea(PetArea newArea) {
 		return _currentArea;
 
 	// Signal the currently active area that it's being left
-	switch (_currentArea) {
-	case PET_INVENTORY:
-		_inventory.leave();
-		break;
-	case PET_CONVERSATION:
-		_conversations.leave();
-		break;
-	case PET_REMOTE:
-		_remote.leave();
-		break;
-	case PET_ROOMS:
-		_rooms.leave();
-		break;
-	case PET_SAVE:
-		_saves.leave();
-		break;
-	case PET_5:
-		_sub5.leave();
-		break;
-	case PET_6:
-		_sub7.leave();
-		break;
-	default:
-		break;
-	}
+	_sections[_currentArea]->leave();
 
 	// Change the current area
 	PetArea oldArea = _currentArea;
@@ -245,63 +180,14 @@ PetArea CPetControl::setArea(PetArea newArea) {
 	_currentArea = newArea;
 
 	// Signal to the new view that it's been activated
-	switch (newArea) {
-	case PET_INVENTORY:
-		_inventory.enter(oldArea);
-		
-		break;
-	case PET_CONVERSATION:
-		_conversations.enter(oldArea);
-		break;
-	case PET_REMOTE:
-		_remote.enter(oldArea);
-		break;
-	case PET_ROOMS:
-		_rooms.enter(oldArea);
-		break;
-	case PET_SAVE:
-		_saves.enter(oldArea);
-		break;
-	case PET_5:
-		_sub5.enter(oldArea);
-		break;
-	case PET_6:
-		_sub7.enter(oldArea);
-		break;
-	default:
-		break;
-	}
+	_sections[_currentArea]->enter(oldArea);
 
 	makeDirty();
 	return newArea;
 }
 
 void CPetControl::fn2(int val) {
-	switch (_currentArea) {
-	case PET_INVENTORY:
-		_inventory.proc38(val);
-		break;
-	case PET_CONVERSATION:
-		_conversations.proc38(val);
-		break;
-	case PET_REMOTE:
-		_remote.proc38(val);
-		break;
-	case PET_ROOMS:
-		_rooms.proc38(val);
-		break;
-	case PET_SAVE:
-		_saves.proc38(val);
-		break;
-	case PET_5:
-		_sub5.proc38(val);
-		break;
-	case PET_6:
-		_sub7.proc38(val);
-		break;
-	default:
-		break;
-	}
+	_sections[_currentArea]->proc38(val);
 }
 
 void CPetControl::fn3(CTreeItem *item) {
@@ -356,31 +242,7 @@ bool CPetControl::handleMessage(CMouseButtonDownMsg &msg) {
 		result = _frame.handleMessage(msg);
 
 	if (!result) {
-		switch (_currentArea) {
-		case PET_INVENTORY:
-			result = _inventory.handleMessage(msg);
-			break;
-		case PET_CONVERSATION:
-			result = _conversations.handleMessage(msg);
-			break;
-		case PET_REMOTE:
-			result = _remote.handleMessage(msg);
-			break;
-		case PET_ROOMS:
-			result = _rooms.handleMessage(msg);
-			break;
-		case PET_SAVE:
-			result = _saves.handleMessage(msg);
-			break;
-		case PET_5:
-			result = _sub5.handleMessage(msg);
-			break;
-		case PET_6:
-			result = _sub7.handleMessage(msg);
-			break;
-		default:
-			break;
-		}
+		result = _sections[_currentArea]->handleMessage(msg);
 	}
 
 	makeDirty();
@@ -391,87 +253,15 @@ bool CPetControl::handleMessage(CMouseDragStartMsg &msg) {
 	if (!containsPt(msg._mousePos) || getC0())
 		return false;
 
-	switch (_currentArea) {
-	case PET_INVENTORY:
-		return _inventory.handleMessage(msg);
-		break;
-	case PET_CONVERSATION:
-		return _conversations.handleMessage(msg);
-		break;
-	case PET_REMOTE:
-		return _remote.handleMessage(msg);
-		break;
-	case PET_ROOMS:
-		return _rooms.handleMessage(msg);
-		break;
-	case PET_SAVE:
-		return _saves.handleMessage(msg);
-		break;
-	case PET_5:
-		return _sub5.handleMessage(msg);
-		break;
-	case PET_6:
-		return _sub7.handleMessage(msg);
-		break;
-	default:
-		return false;
-	}
+	return _sections[_currentArea]->handleMessage(msg);
 }
 
 bool CPetControl::handleMessage(CMouseDragMoveMsg &msg) {
-	switch (_currentArea) {
-	case PET_INVENTORY:
-		return _inventory.handleMessage(msg);
-		break;
-	case PET_CONVERSATION:
-		return _conversations.handleMessage(msg);
-		break;
-	case PET_REMOTE:
-		return _remote.handleMessage(msg);
-		break;
-	case PET_ROOMS:
-		return _rooms.handleMessage(msg);
-		break;
-	case PET_SAVE:
-		return _saves.handleMessage(msg);
-		break;
-	case PET_5:
-		return _sub5.handleMessage(msg);
-		break;
-	case PET_6:
-		return _sub7.handleMessage(msg);
-		break;
-	default:
-		return false;
-	}
+	return _sections[_currentArea]->handleMessage(msg);
 }
 
 bool CPetControl::handleMessage(CMouseDragEndMsg &msg) {
-	switch (_currentArea) {
-	case PET_INVENTORY:
-		return _inventory.handleMessage(msg);
-		break;
-	case PET_CONVERSATION:
-		return _conversations.handleMessage(msg);
-		break;
-	case PET_REMOTE:
-		return _remote.handleMessage(msg);
-		break;
-	case PET_ROOMS:
-		return _rooms.handleMessage(msg);
-		break;
-	case PET_SAVE:
-		return _saves.handleMessage(msg);
-		break;
-	case PET_5:
-		return _sub5.handleMessage(msg);
-		break;
-	case PET_6:
-		return _sub7.handleMessage(msg);
-		break;
-	default:
-		return false;
-	}
+	return _sections[_currentArea]->handleMessage(msg);
 }
 
 bool CPetControl::handleMessage(CMouseButtonUpMsg &msg) {
@@ -482,33 +272,8 @@ bool CPetControl::handleMessage(CMouseButtonUpMsg &msg) {
 	if (isUnlocked())
 		result = _frame.handleMessage(msg);
 
-	if (!result) {
-		switch (_currentArea) {
-		case PET_INVENTORY:
-			result = _inventory.handleMessage(msg);
-			break;
-		case PET_CONVERSATION:
-			result = _conversations.handleMessage(msg);
-			break;
-		case PET_REMOTE:
-			result = _remote.handleMessage(msg);
-			break;
-		case PET_ROOMS:
-			result = _rooms.handleMessage(msg);
-			break;
-		case PET_SAVE:
-			result = _saves.handleMessage(msg);
-			break;
-		case PET_5:
-			result = _sub5.handleMessage(msg);
-			break;
-		case PET_6:
-			result = _sub7.handleMessage(msg);
-			break;
-		default:
-			break;
-		}
-	}
+	if (!result)
+		result = _sections[_currentArea]->handleMessage(msg);
 
 	makeDirty();
 	return result;
@@ -518,94 +283,21 @@ bool CPetControl::handleMessage(CMouseDoubleClickMsg &msg) {
 	if (!containsPt(msg._mousePos) || getC0())
 		return false;
 
-	switch (_currentArea) {
-	case PET_INVENTORY:
-		return _inventory.handleMessage(msg);
-		break;
-	case PET_CONVERSATION:
-		return _conversations.handleMessage(msg);
-		break;
-	case PET_REMOTE:
-		return _remote.handleMessage(msg);
-		break;
-	case PET_ROOMS:
-		return _rooms.handleMessage(msg);
-		break;
-	case PET_SAVE:
-		return _saves.handleMessage(msg);
-		break;
-	case PET_5:
-		return _sub5.handleMessage(msg);
-		break;
-	case PET_6:
-		return _sub7.handleMessage(msg);
-		break;
-	default:
-		return false;
-	}
+	return _sections[_currentArea]->handleMessage(msg);
 }
 
 bool CPetControl::handleMessage(CKeyCharMsg &msg) {
 	if (getC0())
 		return false;
 
-	switch (_currentArea) {
-	case PET_INVENTORY:
-		return _inventory.handleMessage(msg);
-		break;
-	case PET_CONVERSATION:
-		return _conversations.handleMessage(msg);
-		break;
-	case PET_REMOTE:
-		return _remote.handleMessage(msg);
-		break;
-	case PET_ROOMS:
-		return _rooms.handleMessage(msg);
-		break;
-	case PET_SAVE:
-		return _saves.handleMessage(msg);
-		break;
-	case PET_5:
-		return _sub5.handleMessage(msg);
-		break;
-	case PET_6:
-		return _sub7.handleMessage(msg);
-		break;
-	default:
-		return false;
-	}
+	return _sections[_currentArea]->handleMessage(msg);
 }
 
 bool CPetControl::handleMessage(CVirtualKeyCharMsg &msg) {
 	if (getC0())
 		return false;
 
-	bool result = false;
-	switch (_currentArea) {
-	case PET_INVENTORY:
-		result = _inventory.handleMessage(msg);
-		break;
-	case PET_CONVERSATION:
-		result = _conversations.handleMessage(msg);
-		break;
-	case PET_REMOTE:
-		result = _remote.handleMessage(msg);
-		break;
-	case PET_ROOMS:
-		result = _rooms.handleMessage(msg);
-		break;
-	case PET_SAVE:
-		result = _saves.handleMessage(msg);
-		break;
-	case PET_5:
-		result = _sub5.handleMessage(msg);
-		break;
-	case PET_6:
-		result = _sub7.handleMessage(msg);
-		break;
-	default:
-		break;
-	}
+	bool result = _sections[_currentArea]->handleMessage(msg);
 
 	if (!result) {
 		switch (msg._keyState.keycode) {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 285d4f0..d966960 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -53,6 +53,7 @@ private:
 	int _fieldC0;
 	int _locked;
 	int _fieldC8;
+	CPetSection *_sections[7];
 	CPetConversationSection _conversations;
 	CPetInventorySection _inventory;
 	CPetRemoteSection _remote;


Commit: 08e8f105dcca1400120574f794d770c03198ef3a
    https://github.com/scummvm/scummvm/commit/08e8f105dcca1400120574f794d770c03198ef3a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-01T19:01:53-04:00

Commit Message:
TITANIC: Implement CPetFrame event handling

Changed paths:
    engines/titanic/pet_control/pet_frame.cpp
    engines/titanic/pet_control/pet_frame.h



diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index def6bca..3e464a0 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -25,13 +25,12 @@
 
 namespace Titanic {
 
-static const int INDEXES[6] = { 1, 0, 2, 3, 4, 5 };
+static const PetArea PET_AREAS[6] = {
+	PET_CONVERSATION, PET_INVENTORY, PET_REMOTE,
+	PET_ROOMS, PET_SAVE, PET_5
+};
 
-int CPetFrame::_indexes[6];
-
-CPetFrame::CPetFrame() {
-	for (int idx = 0; idx < 6; ++idx)
-		_indexes[INDEXES[idx]] = idx;
+CPetFrame::CPetFrame() : CPetSection() {
 }
 
 bool CPetFrame::setup(CPetControl *petControl) {
@@ -64,11 +63,24 @@ bool CPetFrame::setup() {
 	return true;
 }
 
+bool CPetFrame::handleMessage(CMouseButtonDownMsg &msg) {
+	for (int idx = 0; idx < 5; ++idx) {
+		if (_modeButtons[idx].handleMessage(msg)) {
+			_petControl->setArea(PET_AREAS[idx]);
+			resetArea();
+			_modeButtons[idx].setMode(MODE_SELECTED);
+			return true;
+		}
+	}
+
+	return false;
+}
+
 bool CPetFrame::isValid(CPetControl *petControl) {
 	bool result = setPetControl(petControl);
 	if (result) {
-		_modeButtons[_indexes[0]].setMode(MODE_UNSELECTED);
-		_modeButtons[_indexes[4]].setMode(MODE_SELECTED);
+		_modeButtons[PET_AREAS[0]].setMode(MODE_UNSELECTED);
+		_modeButtons[PET_AREAS[4]].setMode(MODE_SELECTED);
 	}
 
 	return result;
@@ -98,7 +110,7 @@ bool CPetFrame::setPetControl(CPetControl *petControl) {
 			_modeButtons[idx].setBounds(r);
 			_modeButtons[idx].translate(0, YLIST[idx]);
 		}
-		_modeButtons[_indexes[0]].setMode(MODE_SELECTED);
+		_modeButtons[PET_AREAS[0]].setMode(MODE_SELECTED);
 		
 		const int XLIST[] = { 73, 54, 85, 109, 38, 71 };
 		for (int idx = 0; idx < 6; ++idx) {
@@ -113,7 +125,7 @@ bool CPetFrame::setPetControl(CPetControl *petControl) {
 void CPetFrame::setArea(PetArea newArea) {
 	resetArea();
 	if (newArea < PET_6)
-		_modeButtons[_indexes[newArea]].setMode(MODE_SELECTED);
+		_modeButtons[PET_AREAS[newArea]].setMode(MODE_SELECTED);
 }
 
 void CPetFrame::resetArea() {
diff --git a/engines/titanic/pet_control/pet_frame.h b/engines/titanic/pet_control/pet_frame.h
index 683f629..5b90fd2 100644
--- a/engines/titanic/pet_control/pet_frame.h
+++ b/engines/titanic/pet_control/pet_frame.h
@@ -34,8 +34,6 @@ namespace Titanic {
  */
 class CPetFrame : public CPetSection {
 private:
-	static int _indexes[6];
-
 	CPetGfxElement _modeButtons[6];
 	CPetGfxElement _titles[6];
 	CPetGfxElement _modeBackground;
@@ -60,6 +58,11 @@ public:
 	 * Sets up the section
 	 */
 	virtual bool setup();
+	
+	/**
+	 * Handles mouse down messages
+	 */
+	virtual bool handleMessage(CMouseButtonDownMsg &msg);
 
 	/**
 	 * Returns true if the object is in a valid state


Commit: 3f3f4d910d5185ff74396e989babd4fce27bfff5
    https://github.com/scummvm/scummvm/commit/3f3f4d910d5185ff74396e989babd4fce27bfff5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-01T19:42:53-04:00

Commit Message:
TITANIC: Moved gfx/ pet classes into pet_control/

Changed paths:
  A engines/titanic/pet_control/pet_conversations.cpp
  A engines/titanic/pet_control/pet_conversations.h
  A engines/titanic/pet_control/pet_drag_chev.cpp
  A engines/titanic/pet_control/pet_drag_chev.h
  A engines/titanic/pet_control/pet_graphic.cpp
  A engines/titanic/pet_control/pet_graphic.h
  A engines/titanic/pet_control/pet_graphic2.cpp
  A engines/titanic/pet_control/pet_graphic2.h
  A engines/titanic/pet_control/pet_inventory.cpp
  A engines/titanic/pet_control/pet_inventory.h
  A engines/titanic/pet_control/pet_leaf.cpp
  A engines/titanic/pet_control/pet_leaf.h
  A engines/titanic/pet_control/pet_mode_off.cpp
  A engines/titanic/pet_control/pet_mode_off.h
  A engines/titanic/pet_control/pet_mode_on.cpp
  A engines/titanic/pet_control/pet_mode_on.h
  A engines/titanic/pet_control/pet_mode_panel.cpp
  A engines/titanic/pet_control/pet_mode_panel.h
  A engines/titanic/pet_control/pet_pannel1.cpp
  A engines/titanic/pet_control/pet_pannel1.h
  A engines/titanic/pet_control/pet_pannel2.cpp
  A engines/titanic/pet_control/pet_pannel2.h
  A engines/titanic/pet_control/pet_pannel3.cpp
  A engines/titanic/pet_control/pet_pannel3.h
  A engines/titanic/pet_control/pet_remote.cpp
  A engines/titanic/pet_control/pet_remote.h
  A engines/titanic/pet_control/pet_rooms.cpp
  A engines/titanic/pet_control/pet_rooms.h
  A engines/titanic/pet_control/pet_saves.cpp
  A engines/titanic/pet_control/pet_saves.h
  R engines/titanic/gfx/pet_drag_chev.cpp
  R engines/titanic/gfx/pet_drag_chev.h
  R engines/titanic/gfx/pet_graphic.cpp
  R engines/titanic/gfx/pet_graphic.h
  R engines/titanic/gfx/pet_graphic2.cpp
  R engines/titanic/gfx/pet_graphic2.h
  R engines/titanic/gfx/pet_leaf.cpp
  R engines/titanic/gfx/pet_leaf.h
  R engines/titanic/gfx/pet_mode_off.cpp
  R engines/titanic/gfx/pet_mode_off.h
  R engines/titanic/gfx/pet_mode_on.cpp
  R engines/titanic/gfx/pet_mode_on.h
  R engines/titanic/gfx/pet_mode_panel.cpp
  R engines/titanic/gfx/pet_mode_panel.h
  R engines/titanic/gfx/pet_pannel1.cpp
  R engines/titanic/gfx/pet_pannel1.h
  R engines/titanic/gfx/pet_pannel2.cpp
  R engines/titanic/gfx/pet_pannel2.h
  R engines/titanic/gfx/pet_pannel3.cpp
  R engines/titanic/gfx/pet_pannel3.h
  R engines/titanic/pet_control/pet_conversation_section.cpp
  R engines/titanic/pet_control/pet_conversation_section.h
  R engines/titanic/pet_control/pet_inventory_section.cpp
  R engines/titanic/pet_control/pet_inventory_section.h
  R engines/titanic/pet_control/pet_remote_section.cpp
  R engines/titanic/pet_control/pet_remote_section.h
  R engines/titanic/pet_control/pet_rooms_section.cpp
  R engines/titanic/pet_control/pet_rooms_section.h
  R engines/titanic/pet_control/pet_save_section.cpp
  R engines/titanic/pet_control/pet_save_section.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/gfx/icon_nav_butt.h
    engines/titanic/gfx/icon_nav_image.h
    engines/titanic/gfx/icon_nav_receive.h
    engines/titanic/gfx/icon_nav_send.h
    engines/titanic/gfx/sgt_selector.h
    engines/titanic/gfx/text_down.h
    engines/titanic/gfx/text_skrew.h
    engines/titanic/gfx/text_up.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_frame.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index c77bd2b..1e35983 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -309,16 +309,6 @@
 #include "titanic/gfx/music_switch_inversion.h"
 #include "titanic/gfx/music_switch_reverse.h"
 #include "titanic/gfx/music_voice_mute.h"
-#include "titanic/gfx/pet_drag_chev.h"
-#include "titanic/gfx/pet_graphic.h"
-#include "titanic/gfx/pet_graphic2.h"
-#include "titanic/gfx/pet_leaf.h"
-#include "titanic/gfx/pet_mode_off.h"
-#include "titanic/gfx/pet_mode_on.h"
-#include "titanic/gfx/pet_mode_panel.h"
-#include "titanic/gfx/pet_pannel1.h"
-#include "titanic/gfx/pet_pannel2.h"
-#include "titanic/gfx/pet_pannel3.h"
 #include "titanic/gfx/send_to_succ.h"
 #include "titanic/gfx/sgt_selector.h"
 #include "titanic/gfx/slider_button.h"
@@ -382,6 +372,16 @@
 #include "titanic/npcs/true_talk_npc.h"
 
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/pet_control/pet_drag_chev.h"
+#include "titanic/pet_control/pet_graphic.h"
+#include "titanic/pet_control/pet_graphic2.h"
+#include "titanic/pet_control/pet_leaf.h"
+#include "titanic/pet_control/pet_mode_off.h"
+#include "titanic/pet_control/pet_mode_on.h"
+#include "titanic/pet_control/pet_mode_panel.h"
+#include "titanic/pet_control/pet_pannel1.h"
+#include "titanic/pet_control/pet_pannel2.h"
+#include "titanic/pet_control/pet_pannel3.h"
 
 #include "titanic/sound/auto_music_player.h"
 #include "titanic/sound/auto_music_player_base.h"
diff --git a/engines/titanic/gfx/icon_nav_butt.h b/engines/titanic/gfx/icon_nav_butt.h
index 36d3eb0..b2db4c7 100644
--- a/engines/titanic/gfx/icon_nav_butt.h
+++ b/engines/titanic/gfx/icon_nav_butt.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_ICON_NAV_BUTT_H
 #define TITANIC_ICON_NAV_BUTT_H
 
-#include "titanic/gfx/pet_graphic.h"
+#include "titanic/pet_control/pet_graphic.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/gfx/icon_nav_image.h b/engines/titanic/gfx/icon_nav_image.h
index 61febfd..295ffe7 100644
--- a/engines/titanic/gfx/icon_nav_image.h
+++ b/engines/titanic/gfx/icon_nav_image.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_ICON_NAV_IMAGE_H
 #define TITANIC_ICON_NAV_IMAGE_H
 
-#include "titanic/gfx/pet_graphic.h"
+#include "titanic/pet_control/pet_graphic.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/gfx/icon_nav_receive.h b/engines/titanic/gfx/icon_nav_receive.h
index cce1df2..36eed53 100644
--- a/engines/titanic/gfx/icon_nav_receive.h
+++ b/engines/titanic/gfx/icon_nav_receive.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_ICON_NAV_RECEIVE_H
 #define TITANIC_ICON_NAV_RECEIVE_H
 
-#include "titanic/gfx/pet_graphic.h"
+#include "titanic/pet_control/pet_graphic.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/gfx/icon_nav_send.h b/engines/titanic/gfx/icon_nav_send.h
index 1ffb8e9..d25d0b9 100644
--- a/engines/titanic/gfx/icon_nav_send.h
+++ b/engines/titanic/gfx/icon_nav_send.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_ICON_NAV_SEND_H
 #define TITANIC_ICON_NAV_SEND_H
 
-#include "titanic/gfx/pet_graphic.h"
+#include "titanic/pet_control/pet_graphic.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/gfx/pet_drag_chev.cpp b/engines/titanic/gfx/pet_drag_chev.cpp
deleted file mode 100644
index 24b4666..0000000
--- a/engines/titanic/gfx/pet_drag_chev.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/gfx/pet_drag_chev.h"
-
-namespace Titanic {
-
-void CPetDragChev::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CPetGraphic2::save(file, indent);
-}
-
-void CPetDragChev::load(SimpleFile *file) {
-	file->readNumber();
-	CPetGraphic2::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_drag_chev.h b/engines/titanic/gfx/pet_drag_chev.h
deleted file mode 100644
index e82afd0..0000000
--- a/engines/titanic/gfx/pet_drag_chev.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_DRAG_CHEV_H
-#define TITANIC_PET_DRAG_CHEV_H
-
-#include "titanic/gfx/pet_graphic2.h"
-
-namespace Titanic {
-
-class CPetDragChev : public CPetGraphic2 {
-public:
-	CLASSDEF
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_DRAG_CHEV_H */
diff --git a/engines/titanic/gfx/pet_graphic.cpp b/engines/titanic/gfx/pet_graphic.cpp
deleted file mode 100644
index b625c1d..0000000
--- a/engines/titanic/gfx/pet_graphic.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/gfx/pet_graphic.h"
-
-namespace Titanic {
-
-void CPetGraphic::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
-}
-
-void CPetGraphic::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_graphic.h b/engines/titanic/gfx/pet_graphic.h
deleted file mode 100644
index 112d75a..0000000
--- a/engines/titanic/gfx/pet_graphic.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_GRAPHIC_H
-#define TITANIC_PET_GRAPHIC_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CPetGraphic : public CGameObject {
-public:
-	CLASSDEF
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_GRAPHIC_H */
diff --git a/engines/titanic/gfx/pet_graphic2.cpp b/engines/titanic/gfx/pet_graphic2.cpp
deleted file mode 100644
index 5588c72..0000000
--- a/engines/titanic/gfx/pet_graphic2.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/gfx/pet_graphic2.h"
-
-namespace Titanic {
-
-void CPetGraphic2::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
-}
-
-void CPetGraphic2::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_graphic2.h b/engines/titanic/gfx/pet_graphic2.h
deleted file mode 100644
index d9bb514..0000000
--- a/engines/titanic/gfx/pet_graphic2.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_GRAPHIC2_H
-#define TITANIC_PET_GRAPHIC2_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CPetGraphic2 : public CGameObject {
-public:
-	CLASSDEF
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_GRAPHIC2_H */
diff --git a/engines/titanic/gfx/pet_leaf.cpp b/engines/titanic/gfx/pet_leaf.cpp
deleted file mode 100644
index adb6ccd..0000000
--- a/engines/titanic/gfx/pet_leaf.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/gfx/pet_leaf.h"
-
-namespace Titanic {
-
-void PETLeaf::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
-}
-
-void PETLeaf::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_leaf.h b/engines/titanic/gfx/pet_leaf.h
deleted file mode 100644
index 0733749..0000000
--- a/engines/titanic/gfx/pet_leaf.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_LEAF_H
-#define TITANIC_PET_LEAF_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class PETLeaf : public CGameObject {
-public:
-	CLASSDEF
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_LEAF_H */
diff --git a/engines/titanic/gfx/pet_mode_off.cpp b/engines/titanic/gfx/pet_mode_off.cpp
deleted file mode 100644
index d94ced0..0000000
--- a/engines/titanic/gfx/pet_mode_off.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/gfx/pet_mode_off.h"
-
-namespace Titanic {
-
-CPetModeOff::CPetModeOff() : CToggleSwitch() {
-}
-
-void CPetModeOff::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CToggleSwitch::save(file, indent);
-}
-
-void CPetModeOff::load(SimpleFile *file) {
-	file->readNumber();
-	CToggleSwitch::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_mode_off.h b/engines/titanic/gfx/pet_mode_off.h
deleted file mode 100644
index ea88255..0000000
--- a/engines/titanic/gfx/pet_mode_off.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_MODE_OFF_H
-#define TITANIC_PET_MODE_OFF_H
-
-#include "titanic/gfx/toggle_switch.h"
-
-namespace Titanic {
-
-class CPetModeOff : public CToggleSwitch {
-public:
-	CLASSDEF
-	CPetModeOff();
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_MODE_OFF_H */
diff --git a/engines/titanic/gfx/pet_mode_on.cpp b/engines/titanic/gfx/pet_mode_on.cpp
deleted file mode 100644
index 2de0745..0000000
--- a/engines/titanic/gfx/pet_mode_on.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/gfx/pet_mode_on.h"
-
-namespace Titanic {
-
-CPetModeOn::CPetModeOn() : CToggleSwitch() {
-}
-
-void CPetModeOn::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CToggleSwitch::save(file, indent);
-}
-
-void CPetModeOn::load(SimpleFile *file) {
-	file->readNumber();
-	CToggleSwitch::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_mode_on.h b/engines/titanic/gfx/pet_mode_on.h
deleted file mode 100644
index 1434fb2..0000000
--- a/engines/titanic/gfx/pet_mode_on.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_MODE_ON_H
-#define TITANIC_PET_MODE_ON_H
-
-#include "titanic/gfx/toggle_switch.h"
-
-namespace Titanic {
-
-class CPetModeOn : public CToggleSwitch {
-public:
-	CLASSDEF
-	CPetModeOn();
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_MODE_ON_H */
diff --git a/engines/titanic/gfx/pet_mode_panel.cpp b/engines/titanic/gfx/pet_mode_panel.cpp
deleted file mode 100644
index 050cb76..0000000
--- a/engines/titanic/gfx/pet_mode_panel.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/gfx/pet_mode_panel.h"
-
-namespace Titanic {
-
-CPetModePanel::CPetModePanel() : CToggleSwitch() {
-}
-
-void CPetModePanel::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CToggleSwitch::save(file, indent);
-}
-
-void CPetModePanel::load(SimpleFile *file) {
-	file->readNumber();
-	CToggleSwitch::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_mode_panel.h b/engines/titanic/gfx/pet_mode_panel.h
deleted file mode 100644
index ef68ca8..0000000
--- a/engines/titanic/gfx/pet_mode_panel.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_MODE_PANEL_H
-#define TITANIC_PET_MODE_PANEL_H
-
-#include "titanic/gfx/toggle_switch.h"
-
-namespace Titanic {
-
-class CPetModePanel : public CToggleSwitch {
-public:
-	CLASSDEF
-	CPetModePanel();
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_MODE_PANEL_H */
diff --git a/engines/titanic/gfx/pet_pannel1.cpp b/engines/titanic/gfx/pet_pannel1.cpp
deleted file mode 100644
index baa7558..0000000
--- a/engines/titanic/gfx/pet_pannel1.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/gfx/pet_pannel1.h"
-
-namespace Titanic {
-
-void CPetPannel1::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CPetGraphic::save(file, indent);
-}
-
-void CPetPannel1::load(SimpleFile *file) {
-	file->readNumber();
-	CPetGraphic::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_pannel1.h b/engines/titanic/gfx/pet_pannel1.h
deleted file mode 100644
index 9261af9..0000000
--- a/engines/titanic/gfx/pet_pannel1.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_PANNEL1_H
-#define TITANIC_PET_PANNEL1_H
-
-#include "titanic/gfx/pet_graphic.h"
-
-namespace Titanic {
-
-class CPetPannel1 : public CPetGraphic {
-public:
-	CLASSDEF
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_PANNEL1_H */
diff --git a/engines/titanic/gfx/pet_pannel2.cpp b/engines/titanic/gfx/pet_pannel2.cpp
deleted file mode 100644
index 7376fcc..0000000
--- a/engines/titanic/gfx/pet_pannel2.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/gfx/pet_pannel2.h"
-
-namespace Titanic {
-
-void CPetPannel2::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CPetGraphic::save(file, indent);
-}
-
-void CPetPannel2::load(SimpleFile *file) {
-	file->readNumber();
-	CPetGraphic::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_pannel2.h b/engines/titanic/gfx/pet_pannel2.h
deleted file mode 100644
index 561c0d7..0000000
--- a/engines/titanic/gfx/pet_pannel2.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_PANNEL2_H
-#define TITANIC_PET_PANNEL2_H
-
-#include "titanic/gfx/pet_graphic.h"
-
-namespace Titanic {
-
-class CPetPannel2 : public CPetGraphic {
-public:
-	CLASSDEF
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_PANNEL2_H */
diff --git a/engines/titanic/gfx/pet_pannel3.cpp b/engines/titanic/gfx/pet_pannel3.cpp
deleted file mode 100644
index f4bd1fb..0000000
--- a/engines/titanic/gfx/pet_pannel3.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/gfx/pet_pannel3.h"
-
-namespace Titanic {
-
-void CPetPannel3::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CPetGraphic::save(file, indent);
-}
-
-void CPetPannel3::load(SimpleFile *file) {
-	file->readNumber();
-	CPetGraphic::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/gfx/pet_pannel3.h b/engines/titanic/gfx/pet_pannel3.h
deleted file mode 100644
index 5908184..0000000
--- a/engines/titanic/gfx/pet_pannel3.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_PANNEL3_H
-#define TITANIC_PET_PANNEL3_H
-
-#include "titanic/gfx/pet_graphic.h"
-
-namespace Titanic {
-
-class CPetPannel3 : public CPetGraphic {
-public:
-	CLASSDEF
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_PANNEL3_H */
diff --git a/engines/titanic/gfx/sgt_selector.h b/engines/titanic/gfx/sgt_selector.h
index 678ee77..8ebd7ae 100644
--- a/engines/titanic/gfx/sgt_selector.h
+++ b/engines/titanic/gfx/sgt_selector.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_SGT_SELECTOR_H
 #define TITANIC_SGT_SELECTOR_H
 
-#include "titanic/gfx/pet_graphic.h"
+#include "titanic/pet_control/pet_graphic.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/gfx/text_down.h b/engines/titanic/gfx/text_down.h
index 6fc55bb..189f795 100644
--- a/engines/titanic/gfx/text_down.h
+++ b/engines/titanic/gfx/text_down.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_TEXT_DOWN_H
 #define TITANIC_TEXT_DOWN_H
 
-#include "titanic/gfx/pet_graphic.h"
+#include "titanic/pet_control/pet_graphic.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/gfx/text_skrew.h b/engines/titanic/gfx/text_skrew.h
index 6d7e714..aa6c375 100644
--- a/engines/titanic/gfx/text_skrew.h
+++ b/engines/titanic/gfx/text_skrew.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_TEXT_SKREW_H
 #define TITANIC_TEXT_SKREW_H
 
-#include "titanic/gfx/pet_graphic.h"
+#include "titanic/pet_control/pet_graphic.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/gfx/text_up.h b/engines/titanic/gfx/text_up.h
index 328aeee..103f621 100644
--- a/engines/titanic/gfx/text_up.h
+++ b/engines/titanic/gfx/text_up.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_TEXT_UP_H
 #define TITANIC_TEXT_UP_H
 
-#include "titanic/gfx/pet_graphic.h"
+#include "titanic/pet_control/pet_graphic.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 9f9257d..4ab5caf 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -311,16 +311,6 @@ MODULE_OBJS := \
 	gfx/keybrd_butt.o \
 	gfx/move_object_button.o \
 	gfx/music_control.o \
-	gfx/pet_drag_chev.o \
-	gfx/pet_graphic2.o \
-	gfx/pet_graphic.o \
-	gfx/pet_leaf.o \
-	gfx/pet_mode_off.o \
-	gfx/pet_mode_on.o \
-	gfx/pet_mode_panel.o \
-	gfx/pet_pannel1.o \
-	gfx/pet_pannel2.o \
-	gfx/pet_pannel3.o \
 	gfx/send_to_succ.o \
 	gfx/sgt_selector.o \
 	gfx/slider_button.o \
@@ -382,20 +372,30 @@ MODULE_OBJS := \
 	pet_control/pet_control.o \
 	pet_control/pet_control_list_item.o \
 	pet_control/pet_control_list_item2.o \
-	pet_control/pet_conversation_section.o \
+	pet_control/pet_conversations.o \
 	pet_control/pet_element.o \
 	pet_control/pet_frame.o \
 	pet_control/pet_gfx_element.o \
-	pet_control/pet_inventory_section.o \
-	pet_control/pet_rooms_section.o \
-	pet_control/pet_remote_section.o \
-	pet_control/pet_save_section.o \
+	pet_control/pet_inventory.o \
+	pet_control/pet_rooms.o \
+	pet_control/pet_remote.o \
+	pet_control/pet_saves.o \
 	pet_control/pet_section.o \
 	pet_control/pet_control_sub5.o \
 	pet_control/pet_control_sub7.o \
 	pet_control/pet_control_sub10.o \
 	pet_control/pet_control_sub11.o \
 	pet_control/pet_control_sub12.o \
+	pet_control/pet_drag_chev.o \
+	pet_control/pet_graphic2.o \
+	pet_control/pet_graphic.o \
+	pet_control/pet_leaf.o \
+	pet_control/pet_mode_off.o \
+	pet_control/pet_mode_on.o \
+	pet_control/pet_mode_panel.o \
+	pet_control/pet_pannel1.o \
+	pet_control/pet_pannel2.o \
+	pet_control/pet_pannel3.o \
 	sound/auto_music_player.o \
 	sound/auto_music_player_base.o \
 	sound/auto_sound_player.o \
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index d966960..40c6b31 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -28,12 +28,12 @@
 #include "titanic/core/room_item.h"
 #include "titanic/messages/messages.h"
 #include "titanic/messages/mouse_messages.h"
-#include "titanic/pet_control/pet_conversation_section.h"
+#include "titanic/pet_control/pet_conversations.h"
 #include "titanic/pet_control/pet_frame.h"
-#include "titanic/pet_control/pet_inventory_section.h"
-#include "titanic/pet_control/pet_remote_section.h"
-#include "titanic/pet_control/pet_rooms_section.h"
-#include "titanic/pet_control/pet_save_section.h"
+#include "titanic/pet_control/pet_inventory.h"
+#include "titanic/pet_control/pet_remote.h"
+#include "titanic/pet_control/pet_rooms.h"
+#include "titanic/pet_control/pet_saves.h"
 #include "titanic/pet_control/pet_control_sub5.h"
 #include "titanic/pet_control/pet_control_sub7.h"
 
@@ -54,11 +54,11 @@ private:
 	int _locked;
 	int _fieldC8;
 	CPetSection *_sections[7];
-	CPetConversationSection _conversations;
-	CPetInventorySection _inventory;
-	CPetRemoteSection _remote;
+	CPetConversations _conversations;
+	CPetInventory _inventory;
+	CPetRemote _remote;
 	CPetRoomsSection _rooms;
-	CPetSaveSection _saves;
+	CPetSaves _saves;
 	CPetControlSub5 _sub5;
 	CPetControlSub7 _sub7;
 	CPetFrame _frame;
diff --git a/engines/titanic/pet_control/pet_conversation_section.cpp b/engines/titanic/pet_control/pet_conversation_section.cpp
deleted file mode 100644
index 166c8ec..0000000
--- a/engines/titanic/pet_control/pet_conversation_section.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_conversation_section.h"
-
-namespace Titanic {
-
-CPetConversationSection::CPetConversationSection() : CPetSection(),
-		_field414(0), _field418(0) {
-}
-
-void CPetConversationSection::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetConversationSection::load(SimpleFile *file, int param) {
-	_sub2.load(file, param);
-	_sub1.load(file, param);
-
-	for (int idx = 0; idx < 3; ++idx)
-		_valArray3[idx] = file->readNumber();
-}
-
-bool CPetConversationSection::isValid(CPetControl *petControl) {
-	// TODO
-	return true;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversation_section.h b/engines/titanic/pet_control/pet_conversation_section.h
deleted file mode 100644
index 55492ce..0000000
--- a/engines/titanic/pet_control/pet_conversation_section.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONVERSATION_SECTION_H
-#define TITANIC_PET_CONVERSATION_SECTION_H
-
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub12.h"
-#include "titanic/pet_control/pet_gfx_element.h"
-
-namespace Titanic {
-
-class CPetConversationSection : public CPetSection {
-private:
-	CPetGfxElement _val1;
-	CPetGfxElement _val2;
-	CPetGfxElement _val3;
-	CPetGfxElement _valArray1[3];
-	CPetGfxElement _val4;
-	CPetGfxElement _val5;
-	CPetGfxElement _val6;
-	int  _field14C;
-	CPetGfxElement _val7;
-	CPetGfxElement _val8;
-	CPetGfxElement _val9;
-	CPetGfxElement _valArray2[9];
-	int _field30C;
-	CPetControlSub12 _sub1;
-	CPetControlSub12 _sub2;
-	int _valArray3[3];
-	int _field414;
-	int _field418;
-	CString _string1;
-public:
-	CPetConversationSection();
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file, int param);
-
-	/**
-	 * Returns true if the object is in a valid state
-	 */
-	virtual bool isValid(CPetControl *petControl);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONVERSATION_SECTION_H */
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
new file mode 100644
index 0000000..a4936e5
--- /dev/null
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_conversations.h"
+
+namespace Titanic {
+
+CPetConversations::CPetConversations() : CPetSection(),
+		_field414(0), _field418(0) {
+}
+
+void CPetConversations::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetConversations::load(SimpleFile *file, int param) {
+	_sub2.load(file, param);
+	_sub1.load(file, param);
+
+	for (int idx = 0; idx < 3; ++idx)
+		_valArray3[idx] = file->readNumber();
+}
+
+bool CPetConversations::isValid(CPetControl *petControl) {
+	// TODO
+	return true;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
new file mode 100644
index 0000000..a511c3d
--- /dev/null
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -0,0 +1,74 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_CONVERSATIONS_H
+#define TITANIC_PET_CONVERSATIONS_H
+
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_gfx_element.h"
+
+namespace Titanic {
+
+class CPetConversations : public CPetSection {
+private:
+	CPetGfxElement _val1;
+	CPetGfxElement _val2;
+	CPetGfxElement _val3;
+	CPetGfxElement _valArray1[3];
+	CPetGfxElement _val4;
+	CPetGfxElement _val5;
+	CPetGfxElement _val6;
+	int  _field14C;
+	CPetGfxElement _val7;
+	CPetGfxElement _val8;
+	CPetGfxElement _val9;
+	CPetGfxElement _valArray2[9];
+	int _field30C;
+	CPetControlSub12 _sub1;
+	CPetControlSub12 _sub2;
+	int _valArray3[3];
+	int _field414;
+	int _field418;
+	CString _string1;
+public:
+	CPetConversations();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param);
+
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_CONVERSATIONS_H */
diff --git a/engines/titanic/pet_control/pet_drag_chev.cpp b/engines/titanic/pet_control/pet_drag_chev.cpp
new file mode 100644
index 0000000..3c15698
--- /dev/null
+++ b/engines/titanic/pet_control/pet_drag_chev.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_drag_chev.h"
+
+namespace Titanic {
+
+void CPetDragChev::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic2::save(file, indent);
+}
+
+void CPetDragChev::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic2::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_drag_chev.h b/engines/titanic/pet_control/pet_drag_chev.h
new file mode 100644
index 0000000..92f3883
--- /dev/null
+++ b/engines/titanic/pet_control/pet_drag_chev.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_DRAG_CHEV_H
+#define TITANIC_PET_DRAG_CHEV_H
+
+#include "titanic/pet_control/pet_graphic2.h"
+
+namespace Titanic {
+
+class CPetDragChev : public CPetGraphic2 {
+public:
+	CLASSDEF
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_DRAG_CHEV_H */
diff --git a/engines/titanic/pet_control/pet_frame.h b/engines/titanic/pet_control/pet_frame.h
index 5b90fd2..f14e6ea 100644
--- a/engines/titanic/pet_control/pet_frame.h
+++ b/engines/titanic/pet_control/pet_frame.h
@@ -63,6 +63,7 @@ public:
 	 * Handles mouse down messages
 	 */
 	virtual bool handleMessage(CMouseButtonDownMsg &msg);
+	virtual bool handleMessage(CMouseButtonUpMsg &msg) { return false; }
 
 	/**
 	 * Returns true if the object is in a valid state
diff --git a/engines/titanic/pet_control/pet_graphic.cpp b/engines/titanic/pet_control/pet_graphic.cpp
new file mode 100644
index 0000000..3586c4d
--- /dev/null
+++ b/engines/titanic/pet_control/pet_graphic.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_graphic.h"
+
+namespace Titanic {
+
+void CPetGraphic::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPetGraphic::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_graphic.h b/engines/titanic/pet_control/pet_graphic.h
new file mode 100644
index 0000000..112d75a
--- /dev/null
+++ b/engines/titanic/pet_control/pet_graphic.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_GRAPHIC_H
+#define TITANIC_PET_GRAPHIC_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPetGraphic : public CGameObject {
+public:
+	CLASSDEF
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_GRAPHIC_H */
diff --git a/engines/titanic/pet_control/pet_graphic2.cpp b/engines/titanic/pet_control/pet_graphic2.cpp
new file mode 100644
index 0000000..d4871e8
--- /dev/null
+++ b/engines/titanic/pet_control/pet_graphic2.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_graphic2.h"
+
+namespace Titanic {
+
+void CPetGraphic2::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPetGraphic2::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_graphic2.h b/engines/titanic/pet_control/pet_graphic2.h
new file mode 100644
index 0000000..d9bb514
--- /dev/null
+++ b/engines/titanic/pet_control/pet_graphic2.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_GRAPHIC2_H
+#define TITANIC_PET_GRAPHIC2_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPetGraphic2 : public CGameObject {
+public:
+	CLASSDEF
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_GRAPHIC2_H */
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
new file mode 100644
index 0000000..c0a93fa
--- /dev/null
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_inventory.h"
+
+namespace Titanic {
+
+CPetInventory::CPetInventory() : CPetSection(),
+		_field28C(0), _field290(0), _field294(0), _field298(0) {
+	for (int idx = 0; idx < 46; ++idx) {
+		_valArray1[idx] = _valArray2[idx] = 0;
+	}
+}
+
+void CPetInventory::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(_field298, indent);
+}
+
+void CPetInventory::load(SimpleFile *file, int param) {
+	_field298 = file->readNumber();
+}
+
+bool CPetInventory::isValid(CPetControl *petControl) {
+	// TODO
+	return true;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
new file mode 100644
index 0000000..ef295f1
--- /dev/null
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -0,0 +1,64 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_INVENTORY_H
+#define TITANIC_PET_INVENTORY_H
+
+#include "titanic/simple_file.h"
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+
+namespace Titanic {
+
+class CPetInventory : public CPetSection {
+private:
+	CPetControlSub12 _sub12;
+	CPetControlSub10 _sub10;
+	int _valArray1[46];
+	int _valArray2[46];
+	int _field28C;
+	int _field290;
+	int _field294;
+	int _field298;
+public:
+	CPetInventory();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param);
+
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_INVENTORY_H */
diff --git a/engines/titanic/pet_control/pet_inventory_section.cpp b/engines/titanic/pet_control/pet_inventory_section.cpp
deleted file mode 100644
index 675d603..0000000
--- a/engines/titanic/pet_control/pet_inventory_section.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_inventory_section.h"
-
-namespace Titanic {
-
-CPetInventorySection::CPetInventorySection() : CPetSection(),
-		_field28C(0), _field290(0), _field294(0), _field298(0) {
-	for (int idx = 0; idx < 46; ++idx) {
-		_valArray1[idx] = _valArray2[idx] = 0;
-	}
-}
-
-void CPetInventorySection::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(_field298, indent);
-}
-
-void CPetInventorySection::load(SimpleFile *file, int param) {
-	_field298 = file->readNumber();
-}
-
-bool CPetInventorySection::isValid(CPetControl *petControl) {
-	// TODO
-	return true;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory_section.h b/engines/titanic/pet_control/pet_inventory_section.h
deleted file mode 100644
index 4d36e2f..0000000
--- a/engines/titanic/pet_control/pet_inventory_section.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_INVENTORY_SECTION_H
-#define TITANIC_PET_INVENTORY_SECTION_H
-
-#include "titanic/simple_file.h"
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub10.h"
-#include "titanic/pet_control/pet_control_sub12.h"
-
-namespace Titanic {
-
-class CPetInventorySection : public CPetSection {
-private:
-	CPetControlSub12 _sub12;
-	CPetControlSub10 _sub10;
-	int _valArray1[46];
-	int _valArray2[46];
-	int _field28C;
-	int _field290;
-	int _field294;
-	int _field298;
-public:
-	CPetInventorySection();
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file, int param);
-
-	/**
-	 * Returns true if the object is in a valid state
-	 */
-	virtual bool isValid(CPetControl *petControl);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_INVENTORY_SECTION_H */
diff --git a/engines/titanic/pet_control/pet_leaf.cpp b/engines/titanic/pet_control/pet_leaf.cpp
new file mode 100644
index 0000000..77b0d42
--- /dev/null
+++ b/engines/titanic/pet_control/pet_leaf.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_leaf.h"
+
+namespace Titanic {
+
+void PETLeaf::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void PETLeaf::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_leaf.h b/engines/titanic/pet_control/pet_leaf.h
new file mode 100644
index 0000000..0733749
--- /dev/null
+++ b/engines/titanic/pet_control/pet_leaf.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_LEAF_H
+#define TITANIC_PET_LEAF_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class PETLeaf : public CGameObject {
+public:
+	CLASSDEF
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_LEAF_H */
diff --git a/engines/titanic/pet_control/pet_mode_off.cpp b/engines/titanic/pet_control/pet_mode_off.cpp
new file mode 100644
index 0000000..f4eac74
--- /dev/null
+++ b/engines/titanic/pet_control/pet_mode_off.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_mode_off.h"
+
+namespace Titanic {
+
+CPetModeOff::CPetModeOff() : CToggleSwitch() {
+}
+
+void CPetModeOff::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CPetModeOff::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_mode_off.h b/engines/titanic/pet_control/pet_mode_off.h
new file mode 100644
index 0000000..ea88255
--- /dev/null
+++ b/engines/titanic/pet_control/pet_mode_off.h
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_MODE_OFF_H
+#define TITANIC_PET_MODE_OFF_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CPetModeOff : public CToggleSwitch {
+public:
+	CLASSDEF
+	CPetModeOff();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_MODE_OFF_H */
diff --git a/engines/titanic/pet_control/pet_mode_on.cpp b/engines/titanic/pet_control/pet_mode_on.cpp
new file mode 100644
index 0000000..8eb839f
--- /dev/null
+++ b/engines/titanic/pet_control/pet_mode_on.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_mode_on.h"
+
+namespace Titanic {
+
+CPetModeOn::CPetModeOn() : CToggleSwitch() {
+}
+
+void CPetModeOn::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CPetModeOn::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_mode_on.h b/engines/titanic/pet_control/pet_mode_on.h
new file mode 100644
index 0000000..1434fb2
--- /dev/null
+++ b/engines/titanic/pet_control/pet_mode_on.h
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_MODE_ON_H
+#define TITANIC_PET_MODE_ON_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CPetModeOn : public CToggleSwitch {
+public:
+	CLASSDEF
+	CPetModeOn();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_MODE_ON_H */
diff --git a/engines/titanic/pet_control/pet_mode_panel.cpp b/engines/titanic/pet_control/pet_mode_panel.cpp
new file mode 100644
index 0000000..1919d88
--- /dev/null
+++ b/engines/titanic/pet_control/pet_mode_panel.cpp
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_mode_panel.h"
+
+namespace Titanic {
+
+CPetModePanel::CPetModePanel() : CToggleSwitch() {
+}
+
+void CPetModePanel::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CToggleSwitch::save(file, indent);
+}
+
+void CPetModePanel::load(SimpleFile *file) {
+	file->readNumber();
+	CToggleSwitch::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_mode_panel.h b/engines/titanic/pet_control/pet_mode_panel.h
new file mode 100644
index 0000000..ef68ca8
--- /dev/null
+++ b/engines/titanic/pet_control/pet_mode_panel.h
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_MODE_PANEL_H
+#define TITANIC_PET_MODE_PANEL_H
+
+#include "titanic/gfx/toggle_switch.h"
+
+namespace Titanic {
+
+class CPetModePanel : public CToggleSwitch {
+public:
+	CLASSDEF
+	CPetModePanel();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_MODE_PANEL_H */
diff --git a/engines/titanic/pet_control/pet_pannel1.cpp b/engines/titanic/pet_control/pet_pannel1.cpp
new file mode 100644
index 0000000..8245d7e
--- /dev/null
+++ b/engines/titanic/pet_control/pet_pannel1.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_pannel1.h"
+
+namespace Titanic {
+
+void CPetPannel1::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CPetPannel1::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_pannel1.h b/engines/titanic/pet_control/pet_pannel1.h
new file mode 100644
index 0000000..7a16d8c
--- /dev/null
+++ b/engines/titanic/pet_control/pet_pannel1.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_PANNEL1_H
+#define TITANIC_PET_PANNEL1_H
+
+#include "titanic/pet_control/pet_graphic.h"
+
+namespace Titanic {
+
+class CPetPannel1 : public CPetGraphic {
+public:
+	CLASSDEF
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_PANNEL1_H */
diff --git a/engines/titanic/pet_control/pet_pannel2.cpp b/engines/titanic/pet_control/pet_pannel2.cpp
new file mode 100644
index 0000000..a04f63f
--- /dev/null
+++ b/engines/titanic/pet_control/pet_pannel2.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_pannel2.h"
+
+namespace Titanic {
+
+void CPetPannel2::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CPetPannel2::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_pannel2.h b/engines/titanic/pet_control/pet_pannel2.h
new file mode 100644
index 0000000..7296eab
--- /dev/null
+++ b/engines/titanic/pet_control/pet_pannel2.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_PANNEL2_H
+#define TITANIC_PET_PANNEL2_H
+
+#include "titanic/pet_control/pet_graphic.h"
+
+namespace Titanic {
+
+class CPetPannel2 : public CPetGraphic {
+public:
+	CLASSDEF
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_PANNEL2_H */
diff --git a/engines/titanic/pet_control/pet_pannel3.cpp b/engines/titanic/pet_control/pet_pannel3.cpp
new file mode 100644
index 0000000..5d0fd93
--- /dev/null
+++ b/engines/titanic/pet_control/pet_pannel3.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_pannel3.h"
+
+namespace Titanic {
+
+void CPetPannel3::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CPetGraphic::save(file, indent);
+}
+
+void CPetPannel3::load(SimpleFile *file) {
+	file->readNumber();
+	CPetGraphic::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_pannel3.h b/engines/titanic/pet_control/pet_pannel3.h
new file mode 100644
index 0000000..2bdbf1f
--- /dev/null
+++ b/engines/titanic/pet_control/pet_pannel3.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_PANNEL3_H
+#define TITANIC_PET_PANNEL3_H
+
+#include "titanic/pet_control/pet_graphic.h"
+
+namespace Titanic {
+
+class CPetPannel3 : public CPetGraphic {
+public:
+	CLASSDEF
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_PANNEL3_H */
diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
new file mode 100644
index 0000000..4463c31
--- /dev/null
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_remote.h"
+
+namespace Titanic {
+
+bool CPetRemote::isValid(CPetControl *petControl) {
+	// TODO
+	return true;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote.h b/engines/titanic/pet_control/pet_remote.h
new file mode 100644
index 0000000..410a5ff
--- /dev/null
+++ b/engines/titanic/pet_control/pet_remote.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_REMOTE_H
+#define TITANIC_PET_REMOTE_H
+
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_gfx_element.h"
+
+namespace Titanic {
+
+class CPetRemote : public CPetSection {
+private:
+	CPetControlSub10 _sub10;
+	CPetGfxElement _val1;
+	CPetGfxElement _val2;
+	CPetGfxElement _val3;
+	CPetGfxElement _val4;
+	CPetGfxElement _val5;
+	CPetGfxElement _val6;
+	CPetGfxElement _val7;
+	CPetGfxElement _val8;
+	CPetGfxElement _val9;
+	CPetGfxElement _val10;
+	CPetGfxElement _val11;
+	CPetControlSub12 _sub12;
+public:
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_REMOTE_H */
diff --git a/engines/titanic/pet_control/pet_remote_section.cpp b/engines/titanic/pet_control/pet_remote_section.cpp
deleted file mode 100644
index 3772084..0000000
--- a/engines/titanic/pet_control/pet_remote_section.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_remote_section.h"
-
-namespace Titanic {
-
-bool CPetRemoteSection::isValid(CPetControl *petControl) {
-	// TODO
-	return true;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_section.h b/engines/titanic/pet_control/pet_remote_section.h
deleted file mode 100644
index f3063bd..0000000
--- a/engines/titanic/pet_control/pet_remote_section.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_REMOTE_SECTION_H
-#define TITANIC_PET_REMOTE_SECTION_H
-
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub10.h"
-#include "titanic/pet_control/pet_control_sub12.h"
-#include "titanic/pet_control/pet_gfx_element.h"
-
-namespace Titanic {
-
-class CPetRemoteSection : public CPetSection {
-private:
-	CPetControlSub10 _sub10;
-	CPetGfxElement _val1;
-	CPetGfxElement _val2;
-	CPetGfxElement _val3;
-	CPetGfxElement _val4;
-	CPetGfxElement _val5;
-	CPetGfxElement _val6;
-	CPetGfxElement _val7;
-	CPetGfxElement _val8;
-	CPetGfxElement _val9;
-	CPetGfxElement _val10;
-	CPetGfxElement _val11;
-	CPetControlSub12 _sub12;
-public:
-	/**
-	 * Returns true if the object is in a valid state
-	 */
-	virtual bool isValid(CPetControl *petControl);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_REMOTE_SECTION_H */
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
new file mode 100644
index 0000000..ea81dd8
--- /dev/null
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -0,0 +1,65 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_rooms.h"
+
+namespace Titanic {
+
+CPetRoomsSection::CPetRoomsSection() :
+	_field100(0), _field104(0), _field108(0), _field10C(0),
+	_field110(0), _field114(0), _field118(0), _field11C(0),
+	_field1C0(0), _field1C4(0), _field1C8(0), _field1CC(0),
+	_field1D0(0), _field1D4(0) {
+}
+
+void CPetRoomsSection::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetRoomsSection::load(SimpleFile *file, int param) {
+	if (!param) {
+		int count = file->readNumber();
+
+		for (int idx = 0; idx < count; ++idx) {
+			int v1 = file->readNumber();
+			int v2 = file->readNumber();
+			warning("TODO: CPetRoomsSection::load - %d,%d", v1, v2);
+		}
+
+		_listItem.setField34(file->readNumber());
+		file->readNumber();
+		_field1C0 = file->readNumber();
+		_field1C4 = file->readNumber();
+		_field1C8 = file->readNumber();
+		_field1CC = file->readNumber();
+		_field1D0 = file->readNumber();
+		_field1D4 = file->readNumber();
+	}
+}
+
+bool CPetRoomsSection::isValid(CPetControl *petControl) {
+	// TODO
+	return true;
+}
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
new file mode 100644
index 0000000..a4bcefe
--- /dev/null
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -0,0 +1,74 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_ROOMS_SECTION_H
+#define TITANIC_PET_ROOMS_SECTION_H
+
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_control_sub11.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_control_list_item2.h"
+
+namespace Titanic {
+
+class CPetRoomsSection : public CPetSection {
+private:
+	CPetControlSub11 _sub11;
+	CPetControlListItem2 _listItem;
+	int _field100;
+	int _field104;
+	int _field108;
+	int _field10C;
+	int _field110;
+	int _field114;
+	int _field118;
+	int _field11C;
+	CPetGfxElement _val1;
+	CPetControlSub12 _sub12;
+	int _field1C0;
+	int _field1C4;
+	int _field1C8;
+	int _field1CC;
+	int _field1D0;
+	int _field1D4;
+public:
+	CPetRoomsSection();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param);
+
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_ROOMS_SECTION_H */
diff --git a/engines/titanic/pet_control/pet_rooms_section.cpp b/engines/titanic/pet_control/pet_rooms_section.cpp
deleted file mode 100644
index d0d0985..0000000
--- a/engines/titanic/pet_control/pet_rooms_section.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_rooms_section.h"
-
-namespace Titanic {
-
-CPetRoomsSection::CPetRoomsSection() :
-	_field100(0), _field104(0), _field108(0), _field10C(0),
-	_field110(0), _field114(0), _field118(0), _field11C(0),
-	_field1C0(0), _field1C4(0), _field1C8(0), _field1CC(0),
-	_field1D0(0), _field1D4(0) {
-}
-
-void CPetRoomsSection::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetRoomsSection::load(SimpleFile *file, int param) {
-	if (!param) {
-		int count = file->readNumber();
-
-		for (int idx = 0; idx < count; ++idx) {
-			int v1 = file->readNumber();
-			int v2 = file->readNumber();
-			warning("TODO: CPetRoomsSection::load - %d,%d", v1, v2);
-		}
-
-		_listItem.setField34(file->readNumber());
-		file->readNumber();
-		_field1C0 = file->readNumber();
-		_field1C4 = file->readNumber();
-		_field1C8 = file->readNumber();
-		_field1CC = file->readNumber();
-		_field1D0 = file->readNumber();
-		_field1D4 = file->readNumber();
-	}
-}
-
-bool CPetRoomsSection::isValid(CPetControl *petControl) {
-	// TODO
-	return true;
-}
-
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms_section.h b/engines/titanic/pet_control/pet_rooms_section.h
deleted file mode 100644
index a4bcefe..0000000
--- a/engines/titanic/pet_control/pet_rooms_section.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_ROOMS_SECTION_H
-#define TITANIC_PET_ROOMS_SECTION_H
-
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub11.h"
-#include "titanic/pet_control/pet_control_sub12.h"
-#include "titanic/pet_control/pet_control_list_item2.h"
-
-namespace Titanic {
-
-class CPetRoomsSection : public CPetSection {
-private:
-	CPetControlSub11 _sub11;
-	CPetControlListItem2 _listItem;
-	int _field100;
-	int _field104;
-	int _field108;
-	int _field10C;
-	int _field110;
-	int _field114;
-	int _field118;
-	int _field11C;
-	CPetGfxElement _val1;
-	CPetControlSub12 _sub12;
-	int _field1C0;
-	int _field1C4;
-	int _field1C8;
-	int _field1CC;
-	int _field1D0;
-	int _field1D4;
-public:
-	CPetRoomsSection();
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file, int param);
-
-	/**
-	 * Returns true if the object is in a valid state
-	 */
-	virtual bool isValid(CPetControl *petControl);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_ROOMS_SECTION_H */
diff --git a/engines/titanic/pet_control/pet_save_section.cpp b/engines/titanic/pet_control/pet_save_section.cpp
deleted file mode 100644
index 8d24fed..0000000
--- a/engines/titanic/pet_control/pet_save_section.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_save_section.h"
-
-namespace Titanic {
-
-bool CPetSaveSection::isValid(CPetControl *petControl) {
-	// TODO
-	return true;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_save_section.h b/engines/titanic/pet_control/pet_save_section.h
deleted file mode 100644
index 5023382..0000000
--- a/engines/titanic/pet_control/pet_save_section.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_SAVE_SECTION_H
-#define TITANIC_PET_SAVE_SECTION_H
-
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub10.h"
-#include "titanic/pet_control/pet_control_sub12.h"
-
-namespace Titanic {
-
-class CPetSaveSection : public CPetSection {
-private:
-	CPetControlSub10 _sub10;
-	CPetControlSub10 _sub12;
-public:
-	/**
-	 * Returns true if the object is in a valid state
-	 */
-	virtual bool isValid(CPetControl *petControl);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_SAVE_SECTION_H */
diff --git a/engines/titanic/pet_control/pet_saves.cpp b/engines/titanic/pet_control/pet_saves.cpp
new file mode 100644
index 0000000..0a90cc2
--- /dev/null
+++ b/engines/titanic/pet_control/pet_saves.cpp
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_saves.h"
+
+namespace Titanic {
+
+bool CPetSaves::isValid(CPetControl *petControl) {
+	// TODO
+	return true;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_saves.h b/engines/titanic/pet_control/pet_saves.h
new file mode 100644
index 0000000..f11eef6
--- /dev/null
+++ b/engines/titanic/pet_control/pet_saves.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_SAVES_H
+#define TITANIC_PET_SAVES_H
+
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+
+namespace Titanic {
+
+class CPetSaves : public CPetSection {
+private:
+	CPetControlSub10 _sub10;
+	CPetControlSub10 _sub12;
+public:
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_SAVES_H */


Commit: 845e25d118bc81bcea7e1c65a3ef0936ead6fbcf
    https://github.com/scummvm/scummvm/commit/845e25d118bc81bcea7e1c65a3ef0936ead6fbcf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-01T20:37:44-04:00

Commit Message:
TITANIC: Added item strings

Changed paths:
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 82d0997..ad91d70 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -76,6 +76,7 @@ void TitanicEngine::initialize() {
 	DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
 	DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
 
+	setItemNames();
 	CSaveableObject::initClassList();
 	CEnterExitFirstClassState::init();
 	CGetLiftEye2::init();
@@ -118,4 +119,145 @@ Common::Error TitanicEngine::run() {
 	return Common::kNoError;
 }
 
+void TitanicEngine::setItemNames() {
+	// Names
+	_itemNames[0] = "LeftArmWith";
+	_itemNames[1] = "LeftArmWithout";
+	_itemNames[2] = "RightArmWith";
+	_itemNames[3] = "RightArmWithout";
+	_itemNames[4] = "BridgeRed";
+	_itemNames[5] = "BridgeYellow";
+	_itemNames[6] = "BridgeBlue";
+	_itemNames[7] = "BridgeGreen";
+	_itemNames[8] = "Parrot";
+	_itemNames[9] = "CentralCore";
+	_itemNames[10] = "BrainGreen";
+	_itemNames[11] = "BrainYellow";
+	_itemNames[12] = "BrainRed";
+	_itemNames[13] = "BrainBlue";
+	_itemNames[14] = "ChickenGreasy";
+	_itemNames[15] = "ChickenPlain";
+	_itemNames[16] = "ChickenPurple";
+	_itemNames[17] = "ChickenRed";
+	_itemNames[18] = "ChickenYellow";
+	_itemNames[19] = "CrushedTV";
+	_itemNames[20] = "Ear";
+	_itemNames[21] = "Ear1";
+	_itemNames[22] = "Eyeball";
+	_itemNames[23] = "Eyeball1";
+	_itemNames[24] = "Feather";
+	_itemNames[25] = "Lemon";
+	_itemNames[26] = "GlassEmpty";
+	_itemNames[27] = "GlassPurple";
+	_itemNames[28] = "GlassRed";
+	_itemNames[29] = "GlassYellow";
+	_itemNames[30] = "Hammer";
+	_itemNames[31] = "Hose";
+	_itemNames[32] = "HoseEnd";
+	_itemNames[33] = "LiftHead";
+	_itemNames[34] = "LongStick";
+	_itemNames[35] = "Magazine";
+	_itemNames[36] = "Mouth";
+	_itemNames[37] = "MusicKey";
+	_itemNames[38] = "Napkin";
+	_itemNames[39] = "Nose";
+	_itemNames[40] = "Perch";
+	_itemNames[41] = "PhonoCylinder";
+	_itemNames[42] = "PhonoCylinder1";
+	_itemNames[43] = "PhonoCylinder2";
+	_itemNames[44] = "PhonoCylinder3";
+	_itemNames[45] = "Photo";
+
+	// Item long descriptions
+	_itemDescriptions[0] = "The Maitre d'Bot's left arm holding a key";
+	_itemDescriptions[1] = "The Maitre d'Bot's left arm";
+	_itemDescriptions[2] = "The Maitre d'Bot's right arm holding Titania's auditory center";
+	_itemDescriptions[3] = "The Maitre d'Bot's right arm";
+	_itemDescriptions[4] = "Red Fuse";
+	_itemDescriptions[5] = "Yellow Fuse";
+	_itemDescriptions[6] = "Blue Fuse";
+	_itemDescriptions[7] = "Green Fuse";
+	_itemDescriptions[8] = "The Parrot";
+	_itemDescriptions[9] = "Titania's central intelligence core";
+	_itemDescriptions[10] = "Titania's auditory center";
+	_itemDescriptions[11] = "Titania's olfactory center";
+	_itemDescriptions[12] = "Titania's speech center";
+	_itemDescriptions[13] = "Titania's vision center";
+	_itemDescriptions[14] = "rather greasy chicken";
+	_itemDescriptions[15] = "very plain chicken";
+	_itemDescriptions[16] = "chicken smeared with starling pur$e";
+	_itemDescriptions[17] = "chicken covered with tomato sauce";
+	_itemDescriptions[18] = "chicken coated in mustard sauce";
+	_itemDescriptions[19] = "A crushed television set";
+	_itemDescriptions[20] = "Titania's ear";
+	_itemDescriptions[21] = "Titania's ear";
+	_itemDescriptions[22] = "Titania's eye";
+	_itemDescriptions[23] = "Titania's eye";
+	_itemDescriptions[24] = "A parrot feather";
+	_itemDescriptions[25] = "A nice fat juicy lemon";
+	_itemDescriptions[26] = "An empty beer glass";
+	_itemDescriptions[27] = "A beer glass containing pur$ed flock of starlings";
+	_itemDescriptions[28] = "A beer glass containing tomato sauce";
+	_itemDescriptions[29] = "A beer glass containing mustard sauce";
+	_itemDescriptions[30] = "A hammer";
+	_itemDescriptions[31] = "A hose";
+	_itemDescriptions[32] = "The other end of a hose";
+	_itemDescriptions[33] = "The LiftBot's head";
+	_itemDescriptions[34] = "A rather long stick";
+	_itemDescriptions[35] = "A magazine";
+	_itemDescriptions[36] = "Titania's mouth";
+	_itemDescriptions[37] = "A key";
+	_itemDescriptions[38] = "A super-absorbent napkin";
+	_itemDescriptions[39] = "Titania's nose";
+	_itemDescriptions[40] = "A perch";
+	_itemDescriptions[41] = "A phonograph cylinder";
+	_itemDescriptions[42] = "A phonograph cylinder";
+	_itemDescriptions[43] = "A phonograph cylinder";
+	_itemDescriptions[44] = "A phonograph cylinder";
+	_itemDescriptions[45] = "A photograph";
+
+	// Short descriptions.. maybe?
+	_itemShortDesc[0] = "MaitreD Left Arm";
+	_itemShortDesc[1] = "MaitreD Right Arm";
+	_itemShortDesc[2] = "OlfactoryCentre";
+	_itemShortDesc[3] = "AuditoryCentre";
+	_itemShortDesc[4] = "SpeechCentre";
+	_itemShortDesc[5] = "VisionCentre";
+	_itemShortDesc[6] = "CentralCore";
+	_itemShortDesc[7] = "Perch";
+	_itemShortDesc[8] = "SeasonBridge";
+	_itemShortDesc[9] = "FanBridge";
+	_itemShortDesc[10] = "BeamBridge";
+	_itemShortDesc[11] = "ChickenBridge";
+	_itemShortDesc[12] = "CarryParrot";
+	_itemShortDesc[13] = "Chicken";
+	_itemShortDesc[14] = "CrushedTV";
+	_itemShortDesc[15] = "Feathers";
+	_itemShortDesc[16] = "Lemon";
+	_itemShortDesc[17] = "BeerGlass";
+	_itemShortDesc[18] = "BigHammer";
+	_itemShortDesc[19] = "Ear1";
+	_itemShortDesc[20] = "Ear 2";
+	_itemShortDesc[21] = "Eye1";
+	_itemShortDesc[22] = "Eye2";
+	_itemShortDesc[23] = "Mouth";
+	_itemShortDesc[24] = "Nose";
+	_itemShortDesc[25] = "NoseSpare";
+	_itemShortDesc[26] = "Hose";
+	_itemShortDesc[27] = "DeadHoseSpare";
+	_itemShortDesc[28] = "HoseEnd";
+	_itemShortDesc[29] = "DeadHoseEndSpare";
+	_itemShortDesc[30] = "BrokenLiftbotHead";
+	_itemShortDesc[31] = "LongStick";
+	_itemShortDesc[32] = "Magazine";
+	_itemShortDesc[33] = "Napkin";
+	_itemShortDesc[34] = "Phonograph Cylinder";
+	_itemShortDesc[35] = "Phonograph Cylinder 1";
+	_itemShortDesc[36] = "Phonograph Cylinder 2";
+	_itemShortDesc[37] = "Phonograph Cylinder 3";
+	_itemShortDesc[38] = "Photograph";
+	_itemShortDesc[39] = "Music System Key";
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 512dfc3..fff8865 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -33,9 +33,10 @@
 #include "titanic/debugger.h"
 #include "titanic/events.h"
 #include "titanic/files_manager.h"
+#include "titanic/main_game_window.h"
 #include "titanic/movie.h"
 #include "titanic/screen_manager.h"
-#include "titanic/main_game_window.h"
+#include "titanic/string.h"
 
 /**
  * This is the namespace of the Titanic engine.
@@ -86,6 +87,11 @@ private:
 	 * Handles game deinitialization
 	 */
 	void deinitialize();
+
+	/**
+	 * Sets up the item names, short, and long descriptions
+	 */
+	void setItemNames();
 protected:
 	const TitanicGameDescription *_gameDescription;
 	int _loadSaveSlot;
@@ -103,6 +109,9 @@ public:
 	CMainGameWindow *_window;
 	Common::RandomSource _randomSource;
 	CGlobalMovies _movieList;
+	CString _itemNames[46];
+	CString _itemDescriptions[46];
+	CString _itemShortDesc[40];
 public:
 	TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
 	virtual ~TitanicEngine();


Commit: 2c16d68f458517dd2494b6231c98b6632c4105e7
    https://github.com/scummvm/scummvm/commit/2c16d68f458517dd2494b6231c98b6632c4105e7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-01T20:49:13-04:00

Commit Message:
TITANIC: Simplified item strings setup

Changed paths:
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index ad91d70..9e24bbd 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -120,143 +120,55 @@ Common::Error TitanicEngine::run() {
 }
 
 void TitanicEngine::setItemNames() {
-	// Names
-	_itemNames[0] = "LeftArmWith";
-	_itemNames[1] = "LeftArmWithout";
-	_itemNames[2] = "RightArmWith";
-	_itemNames[3] = "RightArmWithout";
-	_itemNames[4] = "BridgeRed";
-	_itemNames[5] = "BridgeYellow";
-	_itemNames[6] = "BridgeBlue";
-	_itemNames[7] = "BridgeGreen";
-	_itemNames[8] = "Parrot";
-	_itemNames[9] = "CentralCore";
-	_itemNames[10] = "BrainGreen";
-	_itemNames[11] = "BrainYellow";
-	_itemNames[12] = "BrainRed";
-	_itemNames[13] = "BrainBlue";
-	_itemNames[14] = "ChickenGreasy";
-	_itemNames[15] = "ChickenPlain";
-	_itemNames[16] = "ChickenPurple";
-	_itemNames[17] = "ChickenRed";
-	_itemNames[18] = "ChickenYellow";
-	_itemNames[19] = "CrushedTV";
-	_itemNames[20] = "Ear";
-	_itemNames[21] = "Ear1";
-	_itemNames[22] = "Eyeball";
-	_itemNames[23] = "Eyeball1";
-	_itemNames[24] = "Feather";
-	_itemNames[25] = "Lemon";
-	_itemNames[26] = "GlassEmpty";
-	_itemNames[27] = "GlassPurple";
-	_itemNames[28] = "GlassRed";
-	_itemNames[29] = "GlassYellow";
-	_itemNames[30] = "Hammer";
-	_itemNames[31] = "Hose";
-	_itemNames[32] = "HoseEnd";
-	_itemNames[33] = "LiftHead";
-	_itemNames[34] = "LongStick";
-	_itemNames[35] = "Magazine";
-	_itemNames[36] = "Mouth";
-	_itemNames[37] = "MusicKey";
-	_itemNames[38] = "Napkin";
-	_itemNames[39] = "Nose";
-	_itemNames[40] = "Perch";
-	_itemNames[41] = "PhonoCylinder";
-	_itemNames[42] = "PhonoCylinder1";
-	_itemNames[43] = "PhonoCylinder2";
-	_itemNames[44] = "PhonoCylinder3";
-	_itemNames[45] = "Photo";
-
-	// Item long descriptions
-	_itemDescriptions[0] = "The Maitre d'Bot's left arm holding a key";
-	_itemDescriptions[1] = "The Maitre d'Bot's left arm";
-	_itemDescriptions[2] = "The Maitre d'Bot's right arm holding Titania's auditory center";
-	_itemDescriptions[3] = "The Maitre d'Bot's right arm";
-	_itemDescriptions[4] = "Red Fuse";
-	_itemDescriptions[5] = "Yellow Fuse";
-	_itemDescriptions[6] = "Blue Fuse";
-	_itemDescriptions[7] = "Green Fuse";
-	_itemDescriptions[8] = "The Parrot";
-	_itemDescriptions[9] = "Titania's central intelligence core";
-	_itemDescriptions[10] = "Titania's auditory center";
-	_itemDescriptions[11] = "Titania's olfactory center";
-	_itemDescriptions[12] = "Titania's speech center";
-	_itemDescriptions[13] = "Titania's vision center";
-	_itemDescriptions[14] = "rather greasy chicken";
-	_itemDescriptions[15] = "very plain chicken";
-	_itemDescriptions[16] = "chicken smeared with starling pur$e";
-	_itemDescriptions[17] = "chicken covered with tomato sauce";
-	_itemDescriptions[18] = "chicken coated in mustard sauce";
-	_itemDescriptions[19] = "A crushed television set";
-	_itemDescriptions[20] = "Titania's ear";
-	_itemDescriptions[21] = "Titania's ear";
-	_itemDescriptions[22] = "Titania's eye";
-	_itemDescriptions[23] = "Titania's eye";
-	_itemDescriptions[24] = "A parrot feather";
-	_itemDescriptions[25] = "A nice fat juicy lemon";
-	_itemDescriptions[26] = "An empty beer glass";
-	_itemDescriptions[27] = "A beer glass containing pur$ed flock of starlings";
-	_itemDescriptions[28] = "A beer glass containing tomato sauce";
-	_itemDescriptions[29] = "A beer glass containing mustard sauce";
-	_itemDescriptions[30] = "A hammer";
-	_itemDescriptions[31] = "A hose";
-	_itemDescriptions[32] = "The other end of a hose";
-	_itemDescriptions[33] = "The LiftBot's head";
-	_itemDescriptions[34] = "A rather long stick";
-	_itemDescriptions[35] = "A magazine";
-	_itemDescriptions[36] = "Titania's mouth";
-	_itemDescriptions[37] = "A key";
-	_itemDescriptions[38] = "A super-absorbent napkin";
-	_itemDescriptions[39] = "Titania's nose";
-	_itemDescriptions[40] = "A perch";
-	_itemDescriptions[41] = "A phonograph cylinder";
-	_itemDescriptions[42] = "A phonograph cylinder";
-	_itemDescriptions[43] = "A phonograph cylinder";
-	_itemDescriptions[44] = "A phonograph cylinder";
-	_itemDescriptions[45] = "A photograph";
+	static const char *const NAMES[46] = {
+		"LeftArmWith", "LeftArmWithout", "RightArmWith", "RightArmWithout", "BridgeRed",
+		"BridgeYellow", "BridgeBlue", "BridgeGreen", "Parrot", "CentralCore", "BrainGreen",
+		"BrainYellow", "BrainRed", "BrainBlue", "ChickenGreasy", "ChickenPlain", "ChickenPurple",
+		"ChickenRed", "ChickenYellow", "CrushedTV", "Ear", "Ear1", "Eyeball", "Eyeball1",
+		"Feather", "Lemon", "GlassEmpty", "GlassPurple", "GlassRed", "GlassYellow", "Hammer",
+		"Hose", "HoseEnd", "LiftHead", "LongStick", "Magazine", "Mouth", "MusicKey", "Napkin",
+		"Nose", "Perch", "PhonoCylinder", "PhonoCylinder1", "PhonoCylinder2", "PhonoCylinder3",
+		"Photo"
+	};
+	for (uint idx = 0; idx < 46; ++idx)
+		_itemNames[idx] = NAMES[idx];
+
+	// Item descriptions
+	static const char *const DESCRIPTIONS[46] = {
+		"The Maitre d'Bot's left arm holding a key", "The Maitre d'Bot's left arm",
+		"The Maitre d'Bot's right arm holding Titania's auditory center",
+		"The Maitre d'Bot's right arm", "Red Fuse", "Yellow Fuse", "Blue Fuse",
+		"Green Fuse", "The Parrot", "Titania's central intelligence core",
+		"Titania's auditory center", "Titania's olfactory center",
+		"Titania's speech center", "Titania's vision center", "rather greasy chicken",
+		"very plain chicken", "chicken smeared with starling pur$e",
+		"chicken covered with tomato sauce", "chicken coated in mustard sauce",
+		"A crushed television set", "Titania's ear", "Titania's ear", "Titania's eye",
+		"Titania's eye", "A parrot feather", "A nice fat juicy lemon",
+		"An empty beer glass", "A beer glass containing pur$ed flock of starlings",
+		"A beer glass containing tomato sauce", "A beer glass containing mustard sauce",
+		"A hammer", "A hose", "The other end of a hose", "The LiftBot's head",
+		"A rather long stick", "A magazine", "Titania's mouth", "A key",
+		"A super-absorbent napkin", "Titania's nose", "A perch", "A phonograph cylinder",
+		"A phonograph cylinder", "A phonograph cylinder", "A phonograph cylinder",
+		"A photograph"
+	};
+	for (uint idx = 0; idx < 46; ++idx)
+		_itemDescriptions[idx] = DESCRIPTIONS[idx];
 
 	// Short descriptions.. maybe?
-	_itemShortDesc[0] = "MaitreD Left Arm";
-	_itemShortDesc[1] = "MaitreD Right Arm";
-	_itemShortDesc[2] = "OlfactoryCentre";
-	_itemShortDesc[3] = "AuditoryCentre";
-	_itemShortDesc[4] = "SpeechCentre";
-	_itemShortDesc[5] = "VisionCentre";
-	_itemShortDesc[6] = "CentralCore";
-	_itemShortDesc[7] = "Perch";
-	_itemShortDesc[8] = "SeasonBridge";
-	_itemShortDesc[9] = "FanBridge";
-	_itemShortDesc[10] = "BeamBridge";
-	_itemShortDesc[11] = "ChickenBridge";
-	_itemShortDesc[12] = "CarryParrot";
-	_itemShortDesc[13] = "Chicken";
-	_itemShortDesc[14] = "CrushedTV";
-	_itemShortDesc[15] = "Feathers";
-	_itemShortDesc[16] = "Lemon";
-	_itemShortDesc[17] = "BeerGlass";
-	_itemShortDesc[18] = "BigHammer";
-	_itemShortDesc[19] = "Ear1";
-	_itemShortDesc[20] = "Ear 2";
-	_itemShortDesc[21] = "Eye1";
-	_itemShortDesc[22] = "Eye2";
-	_itemShortDesc[23] = "Mouth";
-	_itemShortDesc[24] = "Nose";
-	_itemShortDesc[25] = "NoseSpare";
-	_itemShortDesc[26] = "Hose";
-	_itemShortDesc[27] = "DeadHoseSpare";
-	_itemShortDesc[28] = "HoseEnd";
-	_itemShortDesc[29] = "DeadHoseEndSpare";
-	_itemShortDesc[30] = "BrokenLiftbotHead";
-	_itemShortDesc[31] = "LongStick";
-	_itemShortDesc[32] = "Magazine";
-	_itemShortDesc[33] = "Napkin";
-	_itemShortDesc[34] = "Phonograph Cylinder";
-	_itemShortDesc[35] = "Phonograph Cylinder 1";
-	_itemShortDesc[36] = "Phonograph Cylinder 2";
-	_itemShortDesc[37] = "Phonograph Cylinder 3";
-	_itemShortDesc[38] = "Photograph";
-	_itemShortDesc[39] = "Music System Key";
+	static const char *const SHORT_DESC[40] = {
+		"MaitreD Left Arm", "MaitreD Right Arm", "OlfactoryCentre", "AuditoryCentre",
+		"SpeechCentre", "VisionCentre", "CentralCore", "Perch", "SeasonBridge",
+		"FanBridge", "BeamBridge", "ChickenBridge", "CarryParrot", "Chicken",
+		"CrushedTV", "Feathers", "Lemon", "BeerGlass", "BigHammer", "Ear1", "Ear 2",
+		"Eye1", "Eye2", "Mouth", "Nose", "NoseSpare", "Hose", "DeadHoseSpare",
+		"HoseEnd", "DeadHoseEndSpare", "BrokenLiftbotHead", "LongStick", "Magazine",
+		"Napkin", "Phonograph Cylinder", "Phonograph Cylinder 1", "Phonograph Cylinder 2",
+		"Phonograph Cylinder 3", "Photograph", "Music System Key"
+	};
+	for (uint idx = 0; idx < 40; ++idx)
+		_itemShortDesc[idx] = SHORT_DESC[idx];
 }
 
 


Commit: 7ef899f18d17bebf0bec01a8455cd6e23b94268c
    https://github.com/scummvm/scummvm/commit/7ef899f18d17bebf0bec01a8455cd6e23b94268c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-01T21:58:39-04:00

Commit Message:
TITANIC: Implementing CPetInventory setup

Changed paths:
    engines/titanic/pet_control/pet_control_sub10.cpp
    engines/titanic/pet_control/pet_control_sub10.h
    engines/titanic/pet_control/pet_control_sub12.cpp
    engines/titanic/pet_control/pet_control_sub12.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/pet_control/pet_control_sub10.cpp b/engines/titanic/pet_control/pet_control_sub10.cpp
index 226ac4e..59b9648 100644
--- a/engines/titanic/pet_control/pet_control_sub10.cpp
+++ b/engines/titanic/pet_control/pet_control_sub10.cpp
@@ -33,8 +33,8 @@ void CPetControlSub10::proc8() {
 	error("TODO");
 }
 
-void CPetControlSub10::proc9() {
-	error("TODO");
+void CPetControlSub10::setup() {
+	warning("TODO: CPetControlSub10::setup");
 }
 
 void CPetControlSub10::proc10() {
diff --git a/engines/titanic/pet_control/pet_control_sub10.h b/engines/titanic/pet_control/pet_control_sub10.h
index e319378..625100a 100644
--- a/engines/titanic/pet_control/pet_control_sub10.h
+++ b/engines/titanic/pet_control/pet_control_sub10.h
@@ -37,16 +37,23 @@ protected:
 	int _field1C;
 	int _field20;
 	int _field24;
-	CPetGfxElement _val1;
-	CPetGfxElement _val2;
-	CPetGfxElement _val3;
+	CPetGfxElement _selection;
+	CPetGfxElement _scrollLeft;
+	CPetGfxElement _scrollRight;
 public:
 	CPetControlSub10();
 
 	virtual void proc8();
-	virtual void proc9();
+
+	/**
+	 * Set up the control
+	 */
+	virtual void setup();
+
 	virtual void proc10();
 	virtual void proc11();
+
+	void set20(int val) { _field20 = val; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub12.cpp b/engines/titanic/pet_control/pet_control_sub12.cpp
index 5daf826..2bba674 100644
--- a/engines/titanic/pet_control/pet_control_sub12.cpp
+++ b/engines/titanic/pet_control/pet_control_sub12.cpp
@@ -25,8 +25,7 @@
 namespace Titanic {
 
 CPetControlSub12::CPetControlSub12(int count) :
-	_field18(0), _field1C(0), _field20(0), _field24(0),
-	_field28(0), _field30(-1), _field34(0), _field38(-1),
+	_field18(0), _field30(-1), _field34(0), _field38(-1),
 	_field3C(0), _field40(0), _field44(0), _field48(0xff),
 	_field4C(0xff), _field50(0xff), _field54(0), _field58(0),
 	_field5C(200), _field60(0), _field64(0), _field68(0),
@@ -46,15 +45,44 @@ void CPetControlSub12::freeArrays() {
 	_array.clear();
 }
 
+void CPetControlSub12::setup() {
+	for (int idx = 0; idx < (int)_array.size(); ++idx) {
+		_array[idx]._string1.clear();
+		setArrayStr2(idx, _field54, _field58, _field5C);
+		_array[idx]._string3.clear();
+	}
+
+	_field34 = 0;
+	_field18 = 0;
+}
+
+void CPetControlSub12::setArrayStr2(uint idx, int val1, int val2, int val3) {
+	char buffer[6];
+	if (!val1)
+		val1 = 1;
+	if (!val2)
+		val2 = 1;
+	if (!val3)
+		val3 = 1;
+
+	buffer[0] = 27;
+	buffer[1] = val1;
+	buffer[2] = val2;
+	buffer[3] = val3;
+	buffer[4] = 27;
+	buffer[5] = '\0';
+	_array[idx]._string2 = buffer;
+}
+
 void CPetControlSub12::load(SimpleFile *file, int param) {
 	if (!param) {
 		int var1 = file->readNumber();
 		int var2 = file->readNumber();
 		uint count = file->readNumber();
-		_field1C = file->readNumber();
-		_field20 = file->readNumber();
-		_field24 = file->readNumber();
-		_field28 = file->readNumber();
+		_bounds.left = file->readNumber();
+		_bounds.top = file->readNumber();
+		_bounds.right = file->readNumber();
+		_bounds.bottom = file->readNumber();
 		_field3C = file->readNumber();
 		_field40 = file->readNumber();
 		_field44 = file->readNumber();
@@ -77,5 +105,4 @@ void CPetControlSub12::load(SimpleFile *file, int param) {
 	}
 }
 
-
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub12.h b/engines/titanic/pet_control/pet_control_sub12.h
index 5c0f0b3..b5ff1b0 100644
--- a/engines/titanic/pet_control/pet_control_sub12.h
+++ b/engines/titanic/pet_control/pet_control_sub12.h
@@ -37,10 +37,7 @@ private:
 	Common::Array<ArrayEntry> _array;
 	CString _string1;
 	int _field18;
-	int _field1C;
-	int _field20;
-	int _field24;
-	int _field28;
+	Rect _bounds;
 	int _field30;
 	int _field34;
 	int _field38;
@@ -65,10 +62,27 @@ private:
 	void setupArrays(int count);
 
 	void freeArrays();
+
+	void setArrayStr2(uint idx, int val1, int val2, int val3);
 public:
 	CPetControlSub12(int count = 10);
 
+	/**
+	 * Set up the control
+	 */
+	void setup();
+
+	/**
+	 * Load the data for the control
+	 */
 	void load(SimpleFile *file, int param);
+
+	/**
+	 * Set the bounds for the control
+	 */
+	void setBounds(const Rect &bounds) { _bounds = bounds; }
+
+	void set70(int val) { _field70 = val; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index c0a93fa..0417092 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -21,16 +21,58 @@
  */
 
 #include "titanic/pet_control/pet_inventory.h"
+#include "titanic/pet_control/pet_control.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
 CPetInventory::CPetInventory() : CPetSection(),
 		_field28C(0), _field290(0), _field294(0), _field298(0) {
-	for (int idx = 0; idx < 46; ++idx) {
-		_valArray1[idx] = _valArray2[idx] = 0;
+	for (int idx = 0; idx < TOTAL_ITEMS; ++idx) {
+		_itemBackgrounds[idx] = _itemGlyphs[idx] = nullptr;
 	}
 }
 
+bool CPetInventory::setup(CPetControl *petControl) {
+	return setPetControl(petControl) && setup();
+}
+
+bool CPetInventory::setup() {
+	_sub10.setup();
+	_sub12.setup();
+
+	// TODO
+	return true;
+}
+
+bool CPetInventory::setPetControl(CPetControl *petControl) {
+	if (!petControl)
+		return false;
+
+	_petControl = petControl;
+	_sub10.proc8();
+	_sub10.set20(28);
+
+	Rect tempRect(0, 0, 52, 52);
+	for (uint idx = 0; idx < TOTAL_ITEMS; ++idx) {
+		if (!g_vm->_itemNames[idx].empty()) {
+			CString name = "3Pet" + g_vm->_itemNames[idx];
+			_itemBackgrounds[idx] = petControl->getHiddenObject(name);
+		}
+
+		if (!g_vm->_itemObjects[idx].empty()) {
+			_itemGlyphs[idx] = petControl->getHiddenObject(g_vm->_itemObjects[idx]);
+		}
+	}
+
+	tempRect = Rect(0, 0, 580, 15);
+	tempRect.translate(32, 445);
+	_sub12.setBounds(tempRect);
+	_sub12.set70(0);
+	
+	return true;
+}
+
 void CPetInventory::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_field298, indent);
 }
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index ef295f1..6f3fd62 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -30,20 +30,38 @@
 
 namespace Titanic {
 
+/**
+ * Handles displaying the player's inventory in the PET
+ */
 class CPetInventory : public CPetSection {
 private:
 	CPetControlSub12 _sub12;
 	CPetControlSub10 _sub10;
-	int _valArray1[46];
-	int _valArray2[46];
+	CGameObject *_itemBackgrounds[46];
+	CGameObject *_itemGlyphs[46];
 	int _field28C;
 	int _field290;
 	int _field294;
 	int _field298;
+private:
+	/**
+	 * Handles initial setup
+	 */
+	bool setPetControl(CPetControl *petControl);
 public:
 	CPetInventory();
 
 	/**
+	 * Sets up the section
+	 */
+	virtual bool setup(CPetControl *petControl);
+	
+	/**
+	 * Sets up the section
+	 */
+	virtual bool setup();
+
+	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 9e24bbd..03d50f6 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -120,7 +120,7 @@ Common::Error TitanicEngine::run() {
 }
 
 void TitanicEngine::setItemNames() {
-	static const char *const NAMES[46] = {
+	static const char *const NAMES[TOTAL_ITEMS] = {
 		"LeftArmWith", "LeftArmWithout", "RightArmWith", "RightArmWithout", "BridgeRed",
 		"BridgeYellow", "BridgeBlue", "BridgeGreen", "Parrot", "CentralCore", "BrainGreen",
 		"BrainYellow", "BrainRed", "BrainBlue", "ChickenGreasy", "ChickenPlain", "ChickenPurple",
@@ -130,11 +130,11 @@ void TitanicEngine::setItemNames() {
 		"Nose", "Perch", "PhonoCylinder", "PhonoCylinder1", "PhonoCylinder2", "PhonoCylinder3",
 		"Photo"
 	};
-	for (uint idx = 0; idx < 46; ++idx)
+	for (uint idx = 0; idx < TOTAL_ITEMS; ++idx)
 		_itemNames[idx] = NAMES[idx];
 
 	// Item descriptions
-	static const char *const DESCRIPTIONS[46] = {
+	static const char *const DESCRIPTIONS[TOTAL_ITEMS] = {
 		"The Maitre d'Bot's left arm holding a key", "The Maitre d'Bot's left arm",
 		"The Maitre d'Bot's right arm holding Titania's auditory center",
 		"The Maitre d'Bot's right arm", "Red Fuse", "Yellow Fuse", "Blue Fuse",
@@ -153,7 +153,7 @@ void TitanicEngine::setItemNames() {
 		"A phonograph cylinder", "A phonograph cylinder", "A phonograph cylinder",
 		"A photograph"
 	};
-	for (uint idx = 0; idx < 46; ++idx)
+	for (uint idx = 0; idx < TOTAL_ITEMS; ++idx)
 		_itemDescriptions[idx] = DESCRIPTIONS[idx];
 
 	// Short descriptions.. maybe?
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index fff8865..6b85211 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -64,6 +64,8 @@ enum TitanicDebugChannels {
 #define ERROR_INTERMEDIATE 2
 #define ERROR_DETAILED 3
 
+#define TOTAL_ITEMS 46
+
 struct TitanicGameDescription;
 class TitanicEngine;
 
@@ -109,8 +111,9 @@ public:
 	CMainGameWindow *_window;
 	Common::RandomSource _randomSource;
 	CGlobalMovies _movieList;
-	CString _itemNames[46];
-	CString _itemDescriptions[46];
+	CString _itemNames[TOTAL_ITEMS];
+	CString _itemDescriptions[TOTAL_ITEMS];
+	CString _itemObjects[TOTAL_ITEMS];
 	CString _itemShortDesc[40];
 public:
 	TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);


Commit: 1b8ffff10e164d1fe7c03ef9a35aeb8f7ca3c5e5
    https://github.com/scummvm/scummvm/commit/1b8ffff10e164d1fe7c03ef9a35aeb8f7ca3c5e5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-01T22:17:37-04:00

Commit Message:
TITANIC: Implement overall PET inventory draw method

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_control_sub10.cpp
    engines/titanic/pet_control/pet_control_sub10.h
    engines/titanic/pet_control/pet_control_sub12.cpp
    engines/titanic/pet_control/pet_control_sub12.h
    engines/titanic/pet_control/pet_frame.cpp
    engines/titanic/pet_control/pet_frame.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 1ea9977..fbb9efc 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -334,4 +334,8 @@ bool CPetControl::handleMessage(CTimerMsg &msg) {
 	return true;
 }
 
+void CPetControl::drawIndent(CScreenManager *screenManager, int indent) {
+	_frame.drawIndent(screenManager, indent);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 40c6b31..6f5b794 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -185,6 +185,11 @@ public:
 	 * Returns a reference to the special hidden room container
 	 */
 	CRoomItem *getHiddenRoom();
+
+	/**
+	 * Draws the indent
+	 */
+	void drawIndent(CScreenManager *screenManager, int indent);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub10.cpp b/engines/titanic/pet_control/pet_control_sub10.cpp
index 59b9648..a50ad11 100644
--- a/engines/titanic/pet_control/pet_control_sub10.cpp
+++ b/engines/titanic/pet_control/pet_control_sub10.cpp
@@ -45,4 +45,8 @@ void CPetControlSub10::proc11() {
 	error("TODO");
 }
 
+void CPetControlSub10::draw(CScreenManager *screenManager) {
+	warning("TODO: CPetControlSub10::draw");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub10.h b/engines/titanic/pet_control/pet_control_sub10.h
index 625100a..aabb596 100644
--- a/engines/titanic/pet_control/pet_control_sub10.h
+++ b/engines/titanic/pet_control/pet_control_sub10.h
@@ -26,6 +26,7 @@
 #include "titanic/core/list.h"
 #include "titanic/pet_control/pet_control_sub10.h"
 #include "titanic/pet_control/pet_control_list_item.h"
+#include "titanic/screen_manager.h"
 
 namespace Titanic {
 
@@ -54,6 +55,11 @@ public:
 	virtual void proc11();
 
 	void set20(int val) { _field20 = val; }
+
+	/**
+	 * Draw the control
+	 */
+	void draw(CScreenManager *screenManager);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub12.cpp b/engines/titanic/pet_control/pet_control_sub12.cpp
index 2bba674..44335f3 100644
--- a/engines/titanic/pet_control/pet_control_sub12.cpp
+++ b/engines/titanic/pet_control/pet_control_sub12.cpp
@@ -105,4 +105,8 @@ void CPetControlSub12::load(SimpleFile *file, int param) {
 	}
 }
 
+void CPetControlSub12::draw(CScreenManager *screenManager) {
+	warning("TODO: CPetControlSub12::draw");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub12.h b/engines/titanic/pet_control/pet_control_sub12.h
index b5ff1b0..a189bc2 100644
--- a/engines/titanic/pet_control/pet_control_sub12.h
+++ b/engines/titanic/pet_control/pet_control_sub12.h
@@ -24,6 +24,7 @@
 #define TITANIC_PET_CONTROL_SUB12_H
 
 #include "titanic/simple_file.h"
+#include "titanic/screen_manager.h"
 
 namespace Titanic {
 
@@ -83,6 +84,12 @@ public:
 	void setBounds(const Rect &bounds) { _bounds = bounds; }
 
 	void set70(int val) { _field70 = val; }
+
+	/**
+	 * Draw the control
+	 */
+	void draw(CScreenManager *screenManager);
+
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index 3e464a0..6e3ff4f 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -143,4 +143,10 @@ void CPetFrame::drawFrame(CScreenManager *screenManager) {
 	_titles[_petControl->_currentArea].draw(screenManager);
 }
 
+void CPetFrame::drawIndent(CScreenManager *screenManager, int indent) {
+	indent = CLIP(indent, 0, 7);
+	for (int idx = 0; idx < indent; ++indent)
+		_indent[idx].draw(screenManager);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_frame.h b/engines/titanic/pet_control/pet_frame.h
index f14e6ea..f26a2bf 100644
--- a/engines/titanic/pet_control/pet_frame.h
+++ b/engines/titanic/pet_control/pet_frame.h
@@ -89,6 +89,11 @@ public:
 	 * Draws the PET frame
 	 */
 	void drawFrame(CScreenManager *screenManager);
+
+	/**
+	 * Draws the indent
+	 */
+	void drawIndent(CScreenManager *screenManager, int indent);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 0417092..6e0bb22 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -45,6 +45,30 @@ bool CPetInventory::setup() {
 	return true;
 }
 
+void CPetInventory::draw(CScreenManager *screenManager) {
+	_petControl->drawIndent(screenManager, 7);
+	_sub10.draw(screenManager);
+	_sub12.draw(screenManager);
+}
+
+Rect CPetInventory::getBounds() { 
+	// TODO
+	return Rect(); 
+}
+
+void CPetInventory::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(_field298, indent);
+}
+
+void CPetInventory::load(SimpleFile *file, int param) {
+	_field298 = file->readNumber();
+}
+
+bool CPetInventory::isValid(CPetControl *petControl) {
+	// TODO
+	return true;
+}
+
 bool CPetInventory::setPetControl(CPetControl *petControl) {
 	if (!petControl)
 		return false;
@@ -69,20 +93,7 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
 	tempRect.translate(32, 445);
 	_sub12.setBounds(tempRect);
 	_sub12.set70(0);
-	
-	return true;
-}
 
-void CPetInventory::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(_field298, indent);
-}
-
-void CPetInventory::load(SimpleFile *file, int param) {
-	_field298 = file->readNumber();
-}
-
-bool CPetInventory::isValid(CPetControl *petControl) {
-	// TODO
 	return true;
 }
 
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 6f3fd62..3f1d26d 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -62,6 +62,16 @@ public:
 	virtual bool setup();
 
 	/**
+	 * Draw the section
+	 */
+	virtual void draw(CScreenManager *screenManager);
+	
+	/**
+	 * Get the bounds for the section
+	 */
+	virtual Rect getBounds();
+	
+	/**
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;


Commit: 5795ec0c9712c48912842570ef4c2bf70f793c91
    https://github.com/scummvm/scummvm/commit/5795ec0c9712c48912842570ef4c2bf70f793c91
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-02T08:52:07-04:00

Commit Message:
TITANIC: Implemented ScreenManager fillRect

Changed paths:
    engines/titanic/direct_draw_surface.cpp
    engines/titanic/direct_draw_surface.h
    engines/titanic/pet_control/pet_control_sub12.cpp
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h



diff --git a/engines/titanic/direct_draw_surface.cpp b/engines/titanic/direct_draw_surface.cpp
index b432245..05fe68a 100644
--- a/engines/titanic/direct_draw_surface.cpp
+++ b/engines/titanic/direct_draw_surface.cpp
@@ -78,6 +78,13 @@ void DirectDrawSurface::fill(const Rect *bounds, uint32 color) {
 	_surface->fillRect(tempBounds, color);
 }
 
+void DirectDrawSurface::fillRect(Rect *rect, byte r, byte g, byte b) {
+	uint color = _surface->format.RGBToColor(r, g, b);
+	Rect tempRect = rect ? *rect : Rect(0, 0, getWidth(), getHeight());
+
+	_surface->fillRect(tempRect, color);
+}
+
 void DirectDrawSurface::blit(const Rect &destRect, DirectDrawSurface *srcSurface, Rect &srcRect) {
 	assert(srcSurface);
 	if (!destRect.isEmpty())
diff --git a/engines/titanic/direct_draw_surface.h b/engines/titanic/direct_draw_surface.h
index dfcdccb..28ff6a8 100644
--- a/engines/titanic/direct_draw_surface.h
+++ b/engines/titanic/direct_draw_surface.h
@@ -101,6 +101,11 @@ public:
 	void fill(const Rect *bounds, uint32 color);
 
 	/**
+	 * Fill an area with a specific color
+	 */
+	void fillRect(Rect *rect, byte r, byte g, byte b);
+
+	/**
 	 * Copy data from a source surfcae into this one
 	 */
 	void blit(const Rect &destRect, DirectDrawSurface *srcSurface, Rect &srcRect);
diff --git a/engines/titanic/pet_control/pet_control_sub12.cpp b/engines/titanic/pet_control/pet_control_sub12.cpp
index 44335f3..79a53ec 100644
--- a/engines/titanic/pet_control/pet_control_sub12.cpp
+++ b/engines/titanic/pet_control/pet_control_sub12.cpp
@@ -106,6 +106,12 @@ void CPetControlSub12::load(SimpleFile *file, int param) {
 }
 
 void CPetControlSub12::draw(CScreenManager *screenManager) {
+	Rect tempRect = _bounds;
+
+	if (_field70) {
+
+	}
+
 	warning("TODO: CPetControlSub12::draw");
 }
 
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index 5e38eca..f74c97b 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -113,11 +113,20 @@ void OSScreenManager::drawCursors() {
 	warning("OSScreenManager::drawCursors");
 }
 
+DirectDrawSurface *OSScreenManager::getDDSurface(SurfaceNum surfaceNum) {
+	if (surfaceNum == SURFACE_PRIMARY)
+		return _directDrawManager._mainSurface;
+	else if (surfaceNum < (int)_backSurfaces.size())
+		return _directDrawManager._backSurfaces[surfaceNum];
+	else
+		return nullptr;
+}
+
 void OSScreenManager::proc6() {}
 void OSScreenManager::proc7() {}
 
 CVideoSurface *OSScreenManager::getSurface(SurfaceNum surfaceNum) const {
-	if (surfaceNum == -1)
+	if (surfaceNum == SURFACE_PRIMARY)
 		return _frontRenderSurface;
 	else if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
 		return _backSurfaces[surfaceNum]._surface;
@@ -126,7 +135,26 @@ CVideoSurface *OSScreenManager::getSurface(SurfaceNum surfaceNum) const {
 }
 
 void OSScreenManager::proc9() {}
-void OSScreenManager::proc10() {}
+
+void OSScreenManager::fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g, byte b) {
+	DirectDrawSurface *surface = getDDSurface(surfaceNum);
+	if (!surface)
+		return;
+
+	// If bounds are provided, clip and use them. Otherwise, use entire surface area
+	Rect surfaceRect(0, 0, surface->getWidth(), surface->getHeight());
+	Rect tempRect;
+
+	if (rect) {
+		tempRect = *rect;
+		tempRect.clip(surfaceRect);
+	} else {
+		tempRect = surfaceRect;
+	}
+
+	if (tempRect.isValidRect())
+		surface->fillRect(&tempRect, r, g, b);
+}
 
 void OSScreenManager::blitFrom(SurfaceNum surfaceNum, CVideoSurface *src,
 	const Point *destPos, const Rect *srcRect) {
@@ -176,7 +204,7 @@ void OSScreenManager::proc18() {}
 void OSScreenManager::proc19() {}
 
 void OSScreenManager::clearSurface(SurfaceNum surfaceNum, Rect *bounds) {
-	if (surfaceNum == -1)
+	if (surfaceNum == SURFACE_PRIMARY)
 		_directDrawManager._mainSurface->fill(bounds, 0);
 	else if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
 		_directDrawManager._backSurfaces[surfaceNum]->fill(bounds, 0);
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index 1b926fc..8ca1752 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -93,7 +93,11 @@ public:
 	virtual void proc7() = 0;
 	virtual CVideoSurface *getSurface(SurfaceNum surfaceNum) const = 0;
 	virtual void proc9() = 0;
-	virtual void proc10() = 0;
+	
+	/**
+	 * Fill an area with a specific color
+	 */
+	virtual void fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g, byte b) = 0;
 
 	/**
 	 * Blits a surface onto one of the screen surfaces
@@ -151,6 +155,11 @@ private:
 	 * Load game cursors
 	 */
 	void loadCursors();
+
+	/**
+	 * Gets an underlying surface
+	 */
+	DirectDrawSurface *getDDSurface(SurfaceNum surfaceNum);
 public:
 	int _field48;
 	int _field4C;
@@ -175,7 +184,11 @@ public:
 	virtual void proc7();
 	virtual CVideoSurface *getSurface(SurfaceNum surfaceNum) const;
 	virtual void proc9();
-	virtual void proc10();
+
+	/**
+	 * Fill an area with a specific color
+	 */
+	virtual void fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g, byte b);
 
 	/**
 	 * Blits a surface onto one of the screen surfaces


Commit: 32f7fcc7a0a74bcb3ffeb6899bf209099f9b55d5
    https://github.com/scummvm/scummvm/commit/32f7fcc7a0a74bcb3ffeb6899bf209099f9b55d5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-02T22:25:09-04:00

Commit Message:
TITANIC: Further work on CPetControlSub12 drawing

Changed paths:
    engines/titanic/font.cpp
    engines/titanic/font.h
    engines/titanic/pet_control/pet_control_sub12.cpp
    engines/titanic/pet_control/pet_control_sub12.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/screen_manager.cpp
    engines/titanic/screen_manager.h



diff --git a/engines/titanic/font.cpp b/engines/titanic/font.cpp
index bb8f2e0..962d665 100644
--- a/engines/titanic/font.cpp
+++ b/engines/titanic/font.cpp
@@ -20,6 +20,7 @@
  *
  */
 
+#include "common/textconsole.h"
 #include "titanic/font.h"
 
 namespace Titanic {
@@ -31,4 +32,8 @@ void STFont::load(int fontNumber) {
 	// TODO
 }
 
+void STFont::writeString(int maxWidth, const CString &text, int *v1, int *v2) {
+	warning("TODO: STFont::writeString");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/font.h b/engines/titanic/font.h
index 2948505..db06987 100644
--- a/engines/titanic/font.h
+++ b/engines/titanic/font.h
@@ -24,6 +24,7 @@
 #define TITANIC_FONT_H
 
 #include "common/scummsys.h"
+#include "titanic/string.h"
 
 namespace Titanic {
 
@@ -32,7 +33,16 @@ public:
 public:
 	STFont();
 
+	/**
+	 * Load a specified font
+	 */
 	void load(int fontNumber);
+
+	/**
+	 * Write out a string
+	 * TODO: Verify this
+	 */
+	void writeString(int maxWidth, const CString &text, int *v1, int *v2);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub12.cpp b/engines/titanic/pet_control/pet_control_sub12.cpp
index 79a53ec..59097e3 100644
--- a/engines/titanic/pet_control/pet_control_sub12.cpp
+++ b/engines/titanic/pet_control/pet_control_sub12.cpp
@@ -25,11 +25,11 @@
 namespace Titanic {
 
 CPetControlSub12::CPetControlSub12(int count) :
-	_field18(0), _field30(-1), _field34(0), _field38(-1),
-	_field3C(0), _field40(0), _field44(0), _field48(0xff),
-	_field4C(0xff), _field50(0xff), _field54(0), _field58(0),
+	_stringsMerged(false), _field30(-1), _lineCount(0), _field38(-1),
+	_field3C(0), _field40(0), _field44(0), _backR(0xff),
+	_backG(0xff), _backB(0xff), _field54(0), _field58(0),
 	_field5C(200), _field60(0), _field64(0), _field68(0),
-	_field6C(0), _field70(1), _field74(0), _field78(0),
+	_field6C(0), _hasBorder(true), _field74(0), _field78(0),
 	_field7C(0) {
 	setupArrays(count);
 }
@@ -52,8 +52,8 @@ void CPetControlSub12::setup() {
 		_array[idx]._string3.clear();
 	}
 
-	_field34 = 0;
-	_field18 = 0;
+	_lineCount = 0;
+	_stringsMerged = false;
 }
 
 void CPetControlSub12::setArrayStr2(uint idx, int val1, int val2, int val3) {
@@ -86,13 +86,13 @@ void CPetControlSub12::load(SimpleFile *file, int param) {
 		_field3C = file->readNumber();
 		_field40 = file->readNumber();
 		_field44 = file->readNumber();
-		_field48 = file->readNumber();
-		_field4C = file->readNumber();
-		_field50 = file->readNumber();
+		_backR = file->readNumber();
+		_backG = file->readNumber();
+		_backB = file->readNumber();
 		_field54 = file->readNumber();
 		_field58 = file->readNumber();
 		_field5C = file->readNumber();
-		_field70 = file->readNumber();
+		_hasBorder = file->readNumber() != 0;
 		_field74 = file->readNumber();
 
 		warning("TODO: CPetControlSub12::load %d,%d", var1, var2);
@@ -108,11 +108,44 @@ void CPetControlSub12::load(SimpleFile *file, int param) {
 void CPetControlSub12::draw(CScreenManager *screenManager) {
 	Rect tempRect = _bounds;
 
-	if (_field70) {
-
+	if (_hasBorder) {
+		// Create border effect
+		// Top edge
+		tempRect.bottom = tempRect.top + 1;
+		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
+
+		// Bottom edge
+		tempRect.top = _bounds.bottom - 1;
+		tempRect.bottom = _bounds.bottom;
+		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
+
+		// Left edge
+		tempRect = _bounds;
+		tempRect.right = tempRect.left + 1;
+		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
+
+		// Right edge
+		tempRect = _bounds;
+		tempRect.left = tempRect.right - 1;
+		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
 	}
 
 	warning("TODO: CPetControlSub12::draw");
 }
 
+void CPetControlSub12::mergeStrings() {
+	if (!_stringsMerged) {
+		_lines.clear();
+
+		for (int idx = 0; idx < _lineCount; ++idx) {
+			CString line = _array[idx]._string2 + _array[idx]._string3 +
+				_array[idx]._string1 + "\n";
+			_lines += line;
+
+		}
+
+		_stringsMerged = true;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub12.h b/engines/titanic/pet_control/pet_control_sub12.h
index a189bc2..88faf3d 100644
--- a/engines/titanic/pet_control/pet_control_sub12.h
+++ b/engines/titanic/pet_control/pet_control_sub12.h
@@ -36,18 +36,18 @@ class CPetControlSub12 {
 	};
 private:
 	Common::Array<ArrayEntry> _array;
-	CString _string1;
-	int _field18;
+	CString _lines;
+	bool _stringsMerged;
 	Rect _bounds;
 	int _field30;
-	int _field34;
+	int _lineCount;
 	int _field38;
 	int _field3C;
 	int _field40;
 	int _field44;
-	int _field48;
-	int _field4C;
-	int _field50;
+	int _backR;
+	int _backG;
+	int _backB;
 	int _field54;
 	int _field58;
 	int _field5C;
@@ -55,7 +55,7 @@ private:
 	int _field64;
 	int _field68;
 	int _field6C;
-	int _field70;
+	bool _hasBorder;
 	int _field74;
 	int _field78;
 	int _field7C;
@@ -65,6 +65,11 @@ private:
 	void freeArrays();
 
 	void setArrayStr2(uint idx, int val1, int val2, int val3);
+
+	/**
+	 * Merges the strings in the strings array
+	 */
+	void mergeStrings();
 public:
 	CPetControlSub12(int count = 10);
 
@@ -83,7 +88,10 @@ public:
 	 */
 	void setBounds(const Rect &bounds) { _bounds = bounds; }
 
-	void set70(int val) { _field70 = val; }
+	/**
+	 * Sets the flag for whether to draw a frame border around the control
+	 */
+	void setHasBorder(bool val) { _hasBorder = val; }
 
 	/**
 	 * Draw the control
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 6e0bb22..66d093f 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -92,7 +92,7 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
 	tempRect = Rect(0, 0, 580, 15);
 	tempRect.translate(32, 445);
 	_sub12.setBounds(tempRect);
-	_sub12.set70(0);
+	_sub12.setHasBorder(false);
 
 	return true;
 }
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index f74c97b..99de75a 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -198,7 +198,11 @@ void OSScreenManager::proc12() {}
 void OSScreenManager::proc13() {}
 void OSScreenManager::proc14() {}
 void OSScreenManager::proc15() {}
-void OSScreenManager::proc16() {}
+
+void OSScreenManager::writeString(int maxWidth, const CString &text, int *v1, int *v2) {
+	_fonts[_fontNumber].writeString(maxWidth, text, v1, v2);
+}
+
 void OSScreenManager::getFont() {}
 void OSScreenManager::proc18() {}
 void OSScreenManager::proc19() {}
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index 8ca1752..e39151b 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -109,7 +109,13 @@ public:
 	virtual void proc13() = 0;
 	virtual void proc14() = 0;
 	virtual void proc15() = 0;
-	virtual void proc16() = 0;
+
+
+	/**
+	 * Write out a string
+	 */
+	virtual void writeString(int maxWidth, const CString &text, int *v1, int *v2) = 0;
+
 	virtual void getFont() = 0;
 	virtual void proc18() = 0;
 	virtual void proc19() = 0;
@@ -200,7 +206,12 @@ public:
 	virtual void proc13();
 	virtual void proc14();
 	virtual void proc15();
-	virtual void proc16();
+
+	/**
+	 * Write out a string
+	 */
+	virtual void writeString(int maxWidth, const CString &text, int *v1, int *v2);
+
 	virtual void getFont();
 	virtual void proc18();
 	virtual void proc19();


Commit: 432153274385295a9a4eb01e56bfcc72cc5f202e
    https://github.com/scummvm/scummvm/commit/432153274385295a9a4eb01e56bfcc72cc5f202e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-03T15:51:42-04:00

Commit Message:
TITANIC: Working on font loading

Changed paths:
    engines/titanic/files_manager.cpp
    engines/titanic/files_manager.h
    engines/titanic/font.cpp
    engines/titanic/font.h
    engines/titanic/string.cpp
    engines/titanic/string.h



diff --git a/engines/titanic/files_manager.cpp b/engines/titanic/files_manager.cpp
index 617b71b..1089890 100644
--- a/engines/titanic/files_manager.cpp
+++ b/engines/titanic/files_manager.cpp
@@ -27,8 +27,12 @@
 namespace Titanic {
 
 CFilesManager::CFilesManager() : _gameManager(nullptr), 
-		_assetsPath("Assets"), _field0(0), _drive(-1), 
-		_field18(0), _field1C(0), _field3C(0) {
+		_assetsPath("Assets"), _exeResources(nullptr), _field0(0),
+		_drive(-1), _field18(0), _field1C(0), _field3C(0) {
+}
+
+CFilesManager::~CFilesManager() {
+	delete _exeResources;
 }
 
 bool CFilesManager::fileExists(const CString &name) {
@@ -89,4 +93,14 @@ void CFilesManager::fn5(const CString &name) {
 	warning("TODO: CFilesManager::fn5");
 }
 
+Common::SeekableReadStream *CFilesManager::getResource(const CString &name,
+		const CString &area) {
+	if (!_exeResources) {
+		_exeResources = new Common::NEResources();
+		_exeResources->loadFromEXE("st.exe");
+	}
+	
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/files_manager.h b/engines/titanic/files_manager.h
index 74895d7..6c6b544 100644
--- a/engines/titanic/files_manager.h
+++ b/engines/titanic/files_manager.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_FILES_MANAGER_H
 #define TITANIC_FILES_MANAGER_H
 
+#include "common/winexe_ne.h"
 #include "titanic/core/list.h"
 #include "titanic/screen_manager.h"
 
@@ -36,6 +37,7 @@ class CFilesManagerList : public List<ListItem> {
 class CFilesManager {
 private:
 	CGameManager *_gameManager;
+	Common::NEResources *_exeResources;
 	CFilesManagerList _list;
 	CString _string1;
 	CString _string2;
@@ -47,6 +49,7 @@ private:
 	const CString _assetsPath;
 public:
 	CFilesManager();
+	~CFilesManager();
 
 	/**
 	 * Sets the game manager
@@ -80,6 +83,12 @@ public:
 	void fn4(const CString &name);
 
 	void fn5(const CString &name);
+
+	/**
+	 * Get a resource from the executable
+	 */
+	Common::SeekableReadStream *getResource(const CString &name,
+		const CString &area);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/font.cpp b/engines/titanic/font.cpp
index 962d665..fd6bd54 100644
--- a/engines/titanic/font.cpp
+++ b/engines/titanic/font.cpp
@@ -22,14 +22,45 @@
 
 #include "common/textconsole.h"
 #include "titanic/font.h"
+#include "titanic/files_manager.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
 STFont::STFont() {
+	_dataPtr = nullptr;
+	_dataSize = 0;
+	_field8 = 0;
+	_maxCharWidth = 0;
+	_field810 = 0;
+	_field814 = 0;
+	_field818 = 0;
+}
+
+STFont::~STFont() {
+	delete[] _dataPtr;
 }
 
 void STFont::load(int fontNumber) {
-	// TODO
+	assert(!_dataPtr);
+	CString fontNumStr = CString::format("%d", fontNumber);
+	Common::SeekableReadStream *stream = g_vm->_filesManager.getResource(
+		fontNumStr, "STFont");
+	if (!stream)
+		return;
+
+	_field8 = stream->readUint32LE();
+	_maxCharWidth = stream->readUint32LE();
+	for (uint idx = 0; idx < 256; ++idx)
+		_chars[idx]._charWidth = stream->readUint32LE();
+	for (uint idx = 0; idx < 256; ++idx)
+		_chars[idx]._offset = stream->readUint32LE();
+
+	_dataSize = stream->readUint32LE();
+	_dataPtr = new byte[_dataSize];
+	stream->read(_dataPtr, _dataSize);
+
+	delete stream;
 }
 
 void STFont::writeString(int maxWidth, const CString &text, int *v1, int *v2) {
diff --git a/engines/titanic/font.h b/engines/titanic/font.h
index db06987..20b9602 100644
--- a/engines/titanic/font.h
+++ b/engines/titanic/font.h
@@ -24,14 +24,28 @@
 #define TITANIC_FONT_H
 
 #include "common/scummsys.h"
+#include "common/array.h"
 #include "titanic/string.h"
 
 namespace Titanic {
 
 class STFont {
+	struct CharEntry {
+		uint _charWidth;
+		uint _offset;
+	};
 public:
+	byte *_dataPtr;
+	size_t _dataSize;
+	int _field8;
+	int _maxCharWidth;
+	Common::Array<CharEntry> _chars;
+	int _field810;
+	int _field814;
+	int _field818;
 public:
 	STFont();
+	~STFont();
 
 	/**
 	 * Load a specified font
diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp
index 6b43e79..b4af920 100644
--- a/engines/titanic/string.cpp
+++ b/engines/titanic/string.cpp
@@ -108,4 +108,15 @@ ImageType CString::imageTypeSuffix() const {
 		return IMAGETYPE_UNKNOWN;
 }
 
+CString CString::format(const char *fmt, ...) {
+	String output;
+
+	va_list va;
+	va_start(va, fmt);
+	output = String::vformat(fmt, va);
+	va_end(va);
+
+	return output;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/string.h b/engines/titanic/string.h
index c411303..02775de 100644
--- a/engines/titanic/string.h
+++ b/engines/titanic/string.h
@@ -94,6 +94,11 @@ public:
 	int readInt() const {
 		return atoi(c_str());
 	}
+
+	/**
+	 * Format a string
+	 */
+	static CString format(const char *fmt, ...);
 };
 
 } // End of namespace Titanic


Commit: 1efbed540948edcbf3ac2c72c0984def044274cf
    https://github.com/scummvm/scummvm/commit/1efbed540948edcbf3ac2c72c0984def044274cf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-03T16:16:35-04:00

Commit Message:
TITANIC: Move most of the root classes into new support/ folder

Changed paths:
  A engines/titanic/support/direct_draw.cpp
  A engines/titanic/support/direct_draw.h
  A engines/titanic/support/direct_draw_surface.cpp
  A engines/titanic/support/direct_draw_surface.h
  A engines/titanic/support/files_manager.cpp
  A engines/titanic/support/files_manager.h
  A engines/titanic/support/font.cpp
  A engines/titanic/support/font.h
  A engines/titanic/support/image.cpp
  A engines/titanic/support/image.h
  A engines/titanic/support/image_decoders.cpp
  A engines/titanic/support/image_decoders.h
  A engines/titanic/support/mouse_cursor.cpp
  A engines/titanic/support/mouse_cursor.h
  A engines/titanic/support/movie.cpp
  A engines/titanic/support/movie.h
  A engines/titanic/support/rect.cpp
  A engines/titanic/support/rect.h
  A engines/titanic/support/screen_manager.cpp
  A engines/titanic/support/screen_manager.h
  A engines/titanic/support/simple_file.cpp
  A engines/titanic/support/simple_file.h
  A engines/titanic/support/string.cpp
  A engines/titanic/support/string.h
  A engines/titanic/support/text_cursor.cpp
  A engines/titanic/support/text_cursor.h
  A engines/titanic/support/video_surface.cpp
  A engines/titanic/support/video_surface.h
  R engines/titanic/direct_draw.cpp
  R engines/titanic/direct_draw.h
  R engines/titanic/direct_draw_surface.cpp
  R engines/titanic/direct_draw_surface.h
  R engines/titanic/files_manager.cpp
  R engines/titanic/files_manager.h
  R engines/titanic/font.cpp
  R engines/titanic/font.h
  R engines/titanic/image.cpp
  R engines/titanic/image.h
  R engines/titanic/image_decoders.cpp
  R engines/titanic/image_decoders.h
  R engines/titanic/mouse_cursor.cpp
  R engines/titanic/mouse_cursor.h
  R engines/titanic/movie.cpp
  R engines/titanic/movie.h
  R engines/titanic/rect.cpp
  R engines/titanic/rect.h
  R engines/titanic/screen_manager.cpp
  R engines/titanic/screen_manager.h
  R engines/titanic/simple_file.cpp
  R engines/titanic/simple_file.h
  R engines/titanic/string.cpp
  R engines/titanic/string.h
  R engines/titanic/text_cursor.cpp
  R engines/titanic/text_cursor.h
  R engines/titanic/video_surface.cpp
  R engines/titanic/video_surface.h
    engines/titanic/core/file_item.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/link_item.h
    engines/titanic/core/list.h
    engines/titanic/core/project_item.h
    engines/titanic/core/resource_key.cpp
    engines/titanic/core/resource_key.h
    engines/titanic/core/room_item.h
    engines/titanic/core/saveable_object.h
    engines/titanic/core/view_item.cpp
    engines/titanic/game_location.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/game_view.cpp
    engines/titanic/game_view.h
    engines/titanic/input_handler.cpp
    engines/titanic/input_handler.h
    engines/titanic/main_game_window.h
    engines/titanic/messages/mouse_messages.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control_sub10.h
    engines/titanic/pet_control/pet_control_sub12.h
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_section.h
    engines/titanic/sound/sound.h
    engines/titanic/sound/sound_manager.h
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control_sub11.cpp
    engines/titanic/star_control/star_control_sub11.h
    engines/titanic/star_control/star_control_sub12.h
    engines/titanic/star_control/star_control_sub13.h
    engines/titanic/star_control/star_control_sub14.h
    engines/titanic/star_control/star_control_sub15.h
    engines/titanic/star_control/star_control_sub3.h
    engines/titanic/star_control/star_control_sub8.h
    engines/titanic/titanic.h
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_named_script.h
    engines/titanic/true_talk/tt_string.h



diff --git a/engines/titanic/core/file_item.h b/engines/titanic/core/file_item.h
index 65dbf9d..34ba0ae 100644
--- a/engines/titanic/core/file_item.h
+++ b/engines/titanic/core/file_item.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_FILE_ITEM_H
 #define TITANIC_FILE_ITEM_H
 
-#include "titanic/string.h"
+#include "titanic/support/string.h"
 #include "titanic/core/list.h"
 #include "titanic/core/tree_item.h"
 
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index ee7e071..26b7824 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -20,11 +20,11 @@
  *
  */
 
-#include "titanic/files_manager.h"
+#include "titanic/support/files_manager.h"
 #include "titanic/game_manager.h"
-#include "titanic/screen_manager.h"
+#include "titanic/support/screen_manager.h"
 #include "titanic/titanic.h"
-#include "titanic/video_surface.h"
+#include "titanic/support/video_surface.h"
 #include "titanic/core/game_object.h"
 #include "titanic/core/resource_key.h"
 #include "titanic/pet_control/pet_control.h"
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index b221a7e..d8d3a0b 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -23,8 +23,8 @@
 #ifndef TITANIC_GAME_OBJECT_H
 #define TITANIC_GAME_OBJECT_H
 
-#include "titanic/mouse_cursor.h"
-#include "titanic/rect.h"
+#include "titanic/support/mouse_cursor.h"
+#include "titanic/support/rect.h"
 #include "titanic/core/movie_clip.h"
 #include "titanic/core/named_item.h"
 #include "titanic/pet_control/pet_section.h"
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index 83b2ce4..7282972 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_LINK_ITEM_H
 #define TITANIC_LINK_ITEM_H
 
-#include "titanic/mouse_cursor.h"
+#include "titanic/support/mouse_cursor.h"
 #include "titanic/core/named_item.h"
 #include "titanic/core/movie_clip.h"
 
diff --git a/engines/titanic/core/list.h b/engines/titanic/core/list.h
index 63bd622..1905c0f 100644
--- a/engines/titanic/core/list.h
+++ b/engines/titanic/core/list.h
@@ -25,7 +25,7 @@
 
 #include "common/scummsys.h"
 #include "common/list.h"
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/core/saveable_object.h"
 
 namespace Titanic {
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index ef7ccb6..0807460 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -24,7 +24,7 @@
 #define TITANIC_PROJECT_ITEM_H
 
 #include "common/scummsys.h"
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/core/dont_save_file_item.h"
 #include "titanic/core/file_item.h"
 #include "titanic/core/list.h"
diff --git a/engines/titanic/core/resource_key.cpp b/engines/titanic/core/resource_key.cpp
index 089df98..537dd43 100644
--- a/engines/titanic/core/resource_key.cpp
+++ b/engines/titanic/core/resource_key.cpp
@@ -22,7 +22,7 @@
 
 #include "common/file.h"
 #include "titanic/titanic.h"
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/core/resource_key.h"
 
 namespace Titanic {
diff --git a/engines/titanic/core/resource_key.h b/engines/titanic/core/resource_key.h
index ab49cb8..8a6f86f 100644
--- a/engines/titanic/core/resource_key.h
+++ b/engines/titanic/core/resource_key.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_RESOURCE_KEY_H
 #define TITANIC_RESOURCE_KEY_H
 
-#include "titanic/string.h"
+#include "titanic/support/string.h"
 #include "titanic/core/saveable_object.h"
 
 namespace Titanic {
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index 9e7f553..f14c3ae 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_ROOM_ITEM_H
 #define TITANIC_ROOM_ITEM_H
 
-#include "titanic/rect.h"
+#include "titanic/support/rect.h"
 #include "titanic/core/list.h"
 #include "titanic/core/movie_clip.h"
 #include "titanic/core/named_item.h"
diff --git a/engines/titanic/core/saveable_object.h b/engines/titanic/core/saveable_object.h
index 5a6e4c9..e067df2 100644
--- a/engines/titanic/core/saveable_object.h
+++ b/engines/titanic/core/saveable_object.h
@@ -27,7 +27,7 @@
 #include "common/array.h"
 #include "common/hash-str.h"
 #include "common/list.h"
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index b0e30f5..666d7e7 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -21,7 +21,7 @@
  */
 
 #include "titanic/game_manager.h"
-#include "titanic/screen_manager.h"
+#include "titanic/support/screen_manager.h"
 #include "titanic/core/project_item.h"
 #include "titanic/core/room_item.h"
 #include "titanic/core/view_item.h"
diff --git a/engines/titanic/direct_draw.cpp b/engines/titanic/direct_draw.cpp
deleted file mode 100644
index 1c19911..0000000
--- a/engines/titanic/direct_draw.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/debug.h"
-#include "engines/util.h"
-#include "graphics/pixelformat.h"
-#include "titanic/titanic.h"
-#include "titanic/direct_draw.h"
-
-namespace Titanic {
-
-DirectDraw::DirectDraw(TitanicEngine *vm) : _vm(vm),
-		_windowed(false), _fieldC(0), _width(0), _height(0),
-		_bpp(0), _numBackSurfaces(0), _field24(0) {
-}
-
-void DirectDraw::setDisplayMode(int width, int height, int bpp, int refreshRate) {
-	debugC(ERROR_BASIC, kDebugGraphics, "DirectDraw::SetDisplayMode (%d x %d), %d bpp",
-		width, height, bpp);
-	assert(bpp == 16);
-
-	Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
-	initGraphics(width, height, true, &pixelFormat);
-}
-
-void DirectDraw::diagnostics() {
-	debugC(ERROR_BASIC, kDebugGraphics, "Running DirectDraw Diagnostic...");
-}
-
-DirectDrawSurface *DirectDraw::createSurfaceFromDesc(const DDSurfaceDesc &desc) {
-	DirectDrawSurface *surface = new DirectDrawSurface();
-	surface->create(desc._w, desc._h);
-
-	return surface;
-}
-
-/*------------------------------------------------------------------------*/
-
-DirectDrawManager::DirectDrawManager(TitanicEngine *vm, bool windowed) : _directDraw(vm) {
-	_mainSurface = nullptr;
-	_backSurfaces[0] = _backSurfaces[1] = nullptr;
-	_directDraw._windowed = windowed;
-}
-
-void DirectDrawManager::initVideo(int width, int height, int bpp, int numBackSurfaces) {
-	debugC(ERROR_BASIC, kDebugGraphics, "Initialising video surfaces");
-	_directDraw._width = width;
-	_directDraw._numBackSurfaces = numBackSurfaces;
-	_directDraw._height = height;
-	_directDraw._bpp = bpp;
-
-	if (_directDraw._windowed) {
-		initWindowed();
-	} else {
-		initFullScreen();
-	}
-}
-
-void DirectDrawManager::setResolution() {
-	// TODO
-}
-
-void DirectDrawManager::proc2() {
-
-}
-
-void DirectDrawManager::proc3() {
-
-}
-
-void DirectDrawManager::initFullScreen() {
-	debugC(ERROR_BASIC, kDebugGraphics, "Creating surfaces");
-	_directDraw.setDisplayMode(_directDraw._width, _directDraw._height,
-		_directDraw._bpp, 0);
-
-	_mainSurface = new DirectDrawSurface();
-	_mainSurface->create(g_vm->_screen);
-	_backSurfaces[0] = new DirectDrawSurface();
-	_backSurfaces[0]->create(_directDraw._width, _directDraw._height);
-}
-
-DirectDrawSurface *DirectDrawManager::createSurface(int w, int h, int surfaceNum) {
-	if (surfaceNum)
-		return nullptr;
-
-	assert(_mainSurface);
-	return _directDraw.createSurfaceFromDesc(DDSurfaceDesc(w, h));
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/direct_draw.h b/engines/titanic/direct_draw.h
deleted file mode 100644
index cf21c98..0000000
--- a/engines/titanic/direct_draw.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_DIRECT_DRAW_H
-#define TITANIC_DIRECT_DRAW_H
-
-#include "common/scummsys.h"
-#include "common/array.h"
-#include "titanic/direct_draw_surface.h"
-
-namespace Titanic {
-
-class TitanicEngine;
-
-class DirectDraw {
-private:
-	TitanicEngine *_vm;
-public:
-	bool _windowed;
-	int _fieldC;
-	int _width;
-	int _height;
-	int _bpp;
-	int _numBackSurfaces;
-	int _field24;
-public:
-	DirectDraw(TitanicEngine *vm);
-
-	/**
-	 * Sets a new display mode
-	 */
-	void setDisplayMode(int width, int height, int bpp, int refreshRate);
-
-	/**
-	 * Logs diagnostic information
-	 */
-	void diagnostics();
-
-	/**
-	 * Create a surface from a passed description record
-	 */
-	DirectDrawSurface *createSurfaceFromDesc(const DDSurfaceDesc &desc);
-};
-
-class DirectDrawManager {
-public:
-	DirectDraw _directDraw;
-	DirectDrawSurface *_mainSurface;
-	DirectDrawSurface *_backSurfaces[2];
-public:
-	DirectDrawManager(TitanicEngine *vm, bool windowed);
-
-	/**
-	 * Initializes video surfaces
-	 * @param width				Screen width
-	 * @param height			Screen height
-	 * @param bpp				Bits per pixel
-	 * @param numBackSurfaces	Number of back surfaces	
-	 */
-	void initVideo(int width, int height, int bpp, int numBackSurfaces);
-
-	void setResolution();
-
-	void proc2();
-
-	void proc3();
-
-	/**
-	 * Initializes the surfaces in windowed mode
-	 */
-	void initWindowed() { initFullScreen(); }
-
-	/**
-	 * Initializes the surfaces for the screen
-	 */
-	void initFullScreen();
-
-	/**
-	 * Create a surface
-	 */
-	DirectDrawSurface *createSurface(int w, int h, int surfaceNum);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_DIRECT_DRAW_H */
diff --git a/engines/titanic/direct_draw_surface.cpp b/engines/titanic/direct_draw_surface.cpp
deleted file mode 100644
index 05fe68a..0000000
--- a/engines/titanic/direct_draw_surface.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/rect.h"
-#include "titanic/direct_draw_surface.h"
-
-namespace Titanic {
-
-DirectDrawSurface::DirectDrawSurface() : _surface(nullptr),
-		_disposeAfterUse(DisposeAfterUse::YES) {
-}
-
-DirectDrawSurface::~DirectDrawSurface() {
-	free();
-}
-
-void DirectDrawSurface::create(Graphics::ManagedSurface *surface) {
-	free();
-	_surface = surface;
-	_disposeAfterUse = DisposeAfterUse::NO;
-}
-
-void DirectDrawSurface::create(int w, int h) {
-	Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
-	_surface = new Graphics::ManagedSurface(w, h, pixelFormat);
-	_disposeAfterUse = DisposeAfterUse::YES;
-}
-
-void DirectDrawSurface::free() {
-	if (_disposeAfterUse == DisposeAfterUse::YES)
-		delete _surface;
-	_surface = nullptr;
-	_disposeAfterUse = DisposeAfterUse::NO;
-}
-
-Graphics::ManagedSurface *DirectDrawSurface::lock(const Rect *bounds, int flags) {
-	assert(!_surface->empty());
-	return _surface;
-}
-
-void DirectDrawSurface::unlock() {
-	assert(_surface->w != 0 && _surface->h != 0);
-}
-
-void DirectDrawSurface::fill(const Rect *bounds, uint32 color) {
-	Rect tempBounds;
-
-	assert(_surface);
-	if (bounds) {
-		// Bounds are provided, clip them to the bounds of this surface
-		tempBounds = *bounds;
-		tempBounds.clip(Rect(0, 0, _surface->w, _surface->h));
-	} else {
-		// No bounds provided, so use the entire surface
-		tempBounds = Rect(0, 0, _surface->w, _surface->h);
-	}
-
-	// Fill the area
-	_surface->fillRect(tempBounds, color);
-}
-
-void DirectDrawSurface::fillRect(Rect *rect, byte r, byte g, byte b) {
-	uint color = _surface->format.RGBToColor(r, g, b);
-	Rect tempRect = rect ? *rect : Rect(0, 0, getWidth(), getHeight());
-
-	_surface->fillRect(tempRect, color);
-}
-
-void DirectDrawSurface::blit(const Rect &destRect, DirectDrawSurface *srcSurface, Rect &srcRect) {
-	assert(srcSurface);
-	if (!destRect.isEmpty())
-		_surface->transBlitFrom(*srcSurface->_surface, srcRect, destRect, (uint)-1);
-}
-
-void DirectDrawSurface::blit(const Point &destPos, DirectDrawSurface *srcSurface, Rect *bounds) {
-	if (bounds)
-		_surface->blitFrom(*srcSurface->_surface, *bounds, destPos);
-	else
-		_surface->blitFrom(*srcSurface->_surface, destPos);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/direct_draw_surface.h b/engines/titanic/direct_draw_surface.h
deleted file mode 100644
index 28ff6a8..0000000
--- a/engines/titanic/direct_draw_surface.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_DIRECT_DRAW_SURFACE_H
-#define TITANIC_DIRECT_DRAW_SURFACE_H
-
-#include "common/scummsys.h"
-#include "common/array.h"
-#include "graphics/managed_surface.h"
-#include "titanic/rect.h"
-
-namespace Titanic {
-
-class TitanicEngine;
-
-struct DDSurfaceDesc {
-	int _w;
-	int _h;
-	int _flags;
-	int _caps;
-
-	DDSurfaceDesc(int w, int h) : _w(w), _h(h), _flags(0x1006), _caps(64) {}
-};
-
-class DirectDrawSurface {
-private:
-	Graphics::ManagedSurface *_surface;
-	DisposeAfterUse::Flag _disposeAfterUse;
-public:
-	DirectDrawSurface();
-	~DirectDrawSurface();
-
-	/**
-	 * Create a surface
-	 */
-	void create(int w, int h);
-
-	/**
-	 * Create a surface based on a passed surface
-	 */
-	void create(Graphics::ManagedSurface *surface);
-
-	/**
-	 * Frees the surface
-	 */
-	void free();
-
-	/**
-	 * Return the size of the surface in ytes
-	 */
-	int getSize() const { return _surface->pitch * _surface->h; }
-
-	/**
-	 * Return the surface width
-	 */
-	int getWidth() const { return _surface->w; }
-
-	/**
-	 * Return the surface width
-	 */
-	int getHeight() const { return _surface->h; }
-
-	/**
-	 * Return the surface pitch
-	 */
-	int getPitch() const { return _surface->pitch; }
-
-	/**
-	 * Lock the surface for access
-	 */
-	Graphics::ManagedSurface *lock(const Rect *bounds, int flags);
-
-	/**
-	 * Unlocks the surface at the end of direct accesses
-	 */
-	void unlock();
-
-	/**
-	 * Fills an area of the surfae with the specified color. If no bounds are passed,
-	 * then the entire surface is filled
-	 */
-	void fill(const Rect *bounds, uint32 color);
-
-	/**
-	 * Fill an area with a specific color
-	 */
-	void fillRect(Rect *rect, byte r, byte g, byte b);
-
-	/**
-	 * Copy data from a source surfcae into this one
-	 */
-	void blit(const Rect &destRect, DirectDrawSurface *srcSurface, Rect &srcRect);
-
-	/**
-	 * Copy data from a source surfcae into this one
-	 */
-	void blit(const Point &destPos, DirectDrawSurface *srcSurface, Rect *bounds);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_DIRECT_DRAW_SURFACE_H */
diff --git a/engines/titanic/files_manager.cpp b/engines/titanic/files_manager.cpp
deleted file mode 100644
index 1089890..0000000
--- a/engines/titanic/files_manager.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/file.h"
-#include "titanic/files_manager.h"
-#include "titanic/game_manager.h"
-
-namespace Titanic {
-
-CFilesManager::CFilesManager() : _gameManager(nullptr), 
-		_assetsPath("Assets"), _exeResources(nullptr), _field0(0),
-		_drive(-1), _field18(0), _field1C(0), _field3C(0) {
-}
-
-CFilesManager::~CFilesManager() {
-	delete _exeResources;
-}
-
-bool CFilesManager::fileExists(const CString &name) {
-	Common::File f;
-	return f.exists(name);
-}
-
-bool CFilesManager::scanForFile(const CString &name) {
-	if (name.empty())
-		return false;
-
-	CString filename = name;
-	filename.toLowercase();
-	
-	if (filename[0] == 'y' || filename[0] == 'z')
-		return true;
-	else if (filename[0] < 'a' || filename[0] > 'c')
-		return false;
-
-	CString fname = filename;
-	int idx = fname.indexOf('#');
-	if (idx >= 0) {
-		fname = fname.left(idx);
-		fname += ".st";
-	}
-
-	if (_gameManager)
-		_gameManager->viewChange();
-
-	// The original had a bunch of code here handling determining
-	// which asset path, if any, the filename was present for,
-	// and storing the "active asset path" it was found on.
-	// This is redundant for ScummVM, which takes care of the paths
-	return fileExists(fname);
-}
-
-void CFilesManager::loadDrive() {
-	assert(_drive == -1);
-	resetView();
-}
-
-void CFilesManager::debug(CScreenManager *screenManager) {
-	warning("TODO: CFilesManager::debug");
-}
-
-void CFilesManager::resetView() {
-	if (_gameManager) {
-		_gameManager->_gameState.setMode(GSMODE_SELECTED);
-		_gameManager->initBounds();
-	}
-}
-
-void CFilesManager::fn4(const CString &name) {
-	warning("TODO: CFilesManager::fn4");
-}
-
-void CFilesManager::fn5(const CString &name) {
-	warning("TODO: CFilesManager::fn5");
-}
-
-Common::SeekableReadStream *CFilesManager::getResource(const CString &name,
-		const CString &area) {
-	if (!_exeResources) {
-		_exeResources = new Common::NEResources();
-		_exeResources->loadFromEXE("st.exe");
-	}
-	
-	return nullptr;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/files_manager.h b/engines/titanic/files_manager.h
deleted file mode 100644
index 6c6b544..0000000
--- a/engines/titanic/files_manager.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_FILES_MANAGER_H
-#define TITANIC_FILES_MANAGER_H
-
-#include "common/winexe_ne.h"
-#include "titanic/core/list.h"
-#include "titanic/screen_manager.h"
-
-namespace Titanic {
-
-class CGameManager;
-
-class CFilesManagerList : public List<ListItem> {
-};
-
-class CFilesManager {
-private:
-	CGameManager *_gameManager;
-	Common::NEResources *_exeResources;
-	CFilesManagerList _list;
-	CString _string1;
-	CString _string2;
-	int _field0;
-	int _drive;
-	int _field18;
-	int _field1C;
-	int _field3C;
-	const CString _assetsPath;
-public:
-	CFilesManager();
-	~CFilesManager();
-
-	/**
-	 * Sets the game manager
-	 */
-	void setGameManager(CGameManager *gameManager) {
-		_gameManager = gameManager;
-	}
-
-	/**
-	 * Returns true if a file of the given name exists
-	 */
-	static bool fileExists(const CString &name);
-
-	/**
-	 * Scans for a file with a matching name
-	 */
-	bool scanForFile(const CString &name);
-
-	/**
-	 * Handles displaying a load drive view if necessary
-	 */
-	void loadDrive();
-
-	void debug(CScreenManager *screenManager);
-
-	/**
-	 * Resets the view being displayed
-	 */
-	void resetView();
-
-	void fn4(const CString &name);
-
-	void fn5(const CString &name);
-
-	/**
-	 * Get a resource from the executable
-	 */
-	Common::SeekableReadStream *getResource(const CString &name,
-		const CString &area);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_FILES_MANAGER_H */
diff --git a/engines/titanic/font.cpp b/engines/titanic/font.cpp
deleted file mode 100644
index fd6bd54..0000000
--- a/engines/titanic/font.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/textconsole.h"
-#include "titanic/font.h"
-#include "titanic/files_manager.h"
-#include "titanic/titanic.h"
-
-namespace Titanic {
-
-STFont::STFont() {
-	_dataPtr = nullptr;
-	_dataSize = 0;
-	_field8 = 0;
-	_maxCharWidth = 0;
-	_field810 = 0;
-	_field814 = 0;
-	_field818 = 0;
-}
-
-STFont::~STFont() {
-	delete[] _dataPtr;
-}
-
-void STFont::load(int fontNumber) {
-	assert(!_dataPtr);
-	CString fontNumStr = CString::format("%d", fontNumber);
-	Common::SeekableReadStream *stream = g_vm->_filesManager.getResource(
-		fontNumStr, "STFont");
-	if (!stream)
-		return;
-
-	_field8 = stream->readUint32LE();
-	_maxCharWidth = stream->readUint32LE();
-	for (uint idx = 0; idx < 256; ++idx)
-		_chars[idx]._charWidth = stream->readUint32LE();
-	for (uint idx = 0; idx < 256; ++idx)
-		_chars[idx]._offset = stream->readUint32LE();
-
-	_dataSize = stream->readUint32LE();
-	_dataPtr = new byte[_dataSize];
-	stream->read(_dataPtr, _dataSize);
-
-	delete stream;
-}
-
-void STFont::writeString(int maxWidth, const CString &text, int *v1, int *v2) {
-	warning("TODO: STFont::writeString");
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/font.h b/engines/titanic/font.h
deleted file mode 100644
index 20b9602..0000000
--- a/engines/titanic/font.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_FONT_H
-#define TITANIC_FONT_H
-
-#include "common/scummsys.h"
-#include "common/array.h"
-#include "titanic/string.h"
-
-namespace Titanic {
-
-class STFont {
-	struct CharEntry {
-		uint _charWidth;
-		uint _offset;
-	};
-public:
-	byte *_dataPtr;
-	size_t _dataSize;
-	int _field8;
-	int _maxCharWidth;
-	Common::Array<CharEntry> _chars;
-	int _field810;
-	int _field814;
-	int _field818;
-public:
-	STFont();
-	~STFont();
-
-	/**
-	 * Load a specified font
-	 */
-	void load(int fontNumber);
-
-	/**
-	 * Write out a string
-	 * TODO: Verify this
-	 */
-	void writeString(int maxWidth, const CString &text, int *v1, int *v2);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_FONT_H */
diff --git a/engines/titanic/game_location.h b/engines/titanic/game_location.h
index a64a824..f145d36 100644
--- a/engines/titanic/game_location.h
+++ b/engines/titanic/game_location.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_GAME_LOCATION_H
 #define TITANIC_GAME_LOCATION_H
 
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/core/node_item.h"
 #include "titanic/core/room_item.h"
 #include "titanic/core/view_item.h"
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index d5547a3..b6eac3e 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -23,7 +23,7 @@
 #include "titanic/titanic.h"
 #include "titanic/game_manager.h"
 #include "titanic/game_view.h"
-#include "titanic/screen_manager.h"
+#include "titanic/support/screen_manager.h"
 #include "titanic/core/project_item.h"
 #include "titanic/messages/messages.h"
 #include "titanic/pet_control/pet_control.h"
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 6ad0843..b8f5d02 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -27,8 +27,8 @@
 #include "titanic/game_state.h"
 #include "titanic/input_handler.h"
 #include "titanic/input_translator.h"
-#include "titanic/simple_file.h"
-#include "titanic/video_surface.h"
+#include "titanic/support/simple_file.h"
+#include "titanic/support/video_surface.h"
 #include "titanic/true_talk/true_talk_manager.h"
 #include "titanic/sound/background_sound_maker.h"
 #include "titanic/sound/music_room.h"
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index cef8ed9..280c917 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -23,7 +23,7 @@
 #include "titanic/game_state.h"
 #include "titanic/titanic.h"
 #include "titanic/game_manager.h"
-#include "titanic/screen_manager.h"
+#include "titanic/support/screen_manager.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index ec6ef44..5a53d21 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -25,9 +25,9 @@
 
 #include "titanic/core/list.h"
 #include "titanic/core/link_item.h"
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/game_location.h"
-#include "titanic/movie.h"
+#include "titanic/support/movie.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index 22da0c4..2f0e74a 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -23,7 +23,7 @@
 #include "titanic/game_view.h"
 #include "titanic/game_manager.h"
 #include "titanic/main_game_window.h"
-#include "titanic/screen_manager.h"
+#include "titanic/support/screen_manager.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h
index c1d1a00..0bba5cf 100644
--- a/engines/titanic/game_view.h
+++ b/engines/titanic/game_view.h
@@ -25,7 +25,7 @@
 
 #include "common/scummsys.h"
 #include "titanic/core/view_item.h"
-#include "titanic/video_surface.h"
+#include "titanic/support/video_surface.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/image.cpp b/engines/titanic/image.cpp
deleted file mode 100644
index 0a13041..0000000
--- a/engines/titanic/image.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/file.h"
-#include "titanic/image.h"
-
-namespace Titanic {
-
-BITMAPINFOHEADER::BITMAPINFOHEADER() {
-	_biSize = 0;
-	_biWidth = 0;
-	_biHeight = 0;
-	_biPlanes = 0;
-	_biBitCount = 0;
-	_biCompression = 0;
-	_biSizeImage = 0;
-	_biXPelsPerMeter = 0;
-	_biYPelsPerMeter = 0;
-	_biClrUsed = 0;
-	_biClrImportant = 0;
-}
-
-/*------------------------------------------------------------------------*/
-
-RGBQuad::RGBQuad() : _rgbRed(0), _rgbGreen(0), _rgbBlue(0), _rgbReserved(0) {}
-
-/*------------------------------------------------------------------------*/
-
-Image::Image() {
-	_bitmapInfo = nullptr;
-	_bits = nullptr;
-	_flag = true;
-
-	set(16, 16);
-}
-
-void Image::proc6() {
-
-}
-
-void Image::set(int width, int height) {
-	delete _bitmapInfo;
-	if (_flag && _bitmapInfo)
-		delete[] _bits;
-
-	_bitmapInfo = new tagBITMAPINFO;
-	_bits = new byte[(width + 3) & 0xFFFC * height];
-
-	tagBITMAPINFO &bi = *_bitmapInfo;
-	bi._bmiHeader._biWidth = width;
-	bi._bmiHeader._biHeight = height;
-	bi._bmiHeader._biPlanes = 1;
-	bi._bmiHeader._biBitCount = 8;
-}
-
-void Image::proc8() {
-
-}
-
-bool Image::loadResource(const Common::String &name) {
-	// This method is hardcoded for the Titanic splash screen resource
-	assert(name == "TITANIC");
-
-	Common::File f;
-	if (!f.open("ST.exe"))
-		return false;
-
-	// The ST.exe executable has a bitmap called "TITANIC". Since we can't use
-	// the Windows FindResource function in ScummVM, this is hardcoded for now
-	f.seek(0x29B660);
-	uint size = f.readUint32LE();
-	if (size != 40)
-		return false;
-
-	loadBitmap(f);
-
-	return true;
-}
-
-void Image::proc10() {
-
-}
-
-void Image::draw() {
-
-}
-
-void Image::loadBitmap(Common::SeekableReadStream &s) {
-	_bitmapInfo->_bmiHeader._biWidth = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biHeight = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biPlanes = s.readUint16LE();
-	_bitmapInfo->_bmiHeader._biBitCount = s.readUint16LE();
-	_bitmapInfo->_bmiHeader._biCompression = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biSizeImage = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biXPelsPerMeter = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biYPelsPerMeter = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biClrUsed = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biClrImportant = s.readUint32LE();
-
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/image.h b/engines/titanic/image.h
deleted file mode 100644
index 9030e81..0000000
--- a/engines/titanic/image.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_IMAGE_H
-#define TITANIC_IMAGE_H
-
-#include "common/scummsys.h"
-#include "common/array.h"
-
-namespace Titanic {
-
-struct BITMAPINFOHEADER {
-	int _biSize;
-	int _biWidth;
-	int _biHeight;
-	int _biPlanes;
-	int _biBitCount;
-	int _biCompression;
-	int _biSizeImage;
-	int _biXPelsPerMeter;
-	int _biYPelsPerMeter;
-	int _biClrUsed;
-	int _biClrImportant;
-
-	BITMAPINFOHEADER();
-};
-
-struct RGBQuad {
-	byte _rgbRed;
-	byte _rgbGreen;
-	byte _rgbBlue;
-	byte _rgbReserved;
-
-	RGBQuad();
-};
-
-struct tagBITMAPINFO {
-	BITMAPINFOHEADER _bmiHeader;
-	RGBQuad _bmiColors[256];
-};
-
-class Image {
-private:
-	void loadBitmap(Common::SeekableReadStream &s);
-public:
-	tagBITMAPINFO *_bitmapInfo;
-	byte *_bits;
-	bool _flag;
-public:
-	Image();
-	virtual ~Image() {}
-
-	virtual void proc6();
-	virtual void set(int width, int height);
-	virtual void proc8();
-	virtual bool loadResource(const Common::String &name);
-	virtual void proc10();
-	virtual void draw();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_IMAGE_H */
diff --git a/engines/titanic/image_decoders.cpp b/engines/titanic/image_decoders.cpp
deleted file mode 100644
index 721342e..0000000
--- a/engines/titanic/image_decoders.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/image_decoders.h"
-
-namespace Titanic {
-
-void CJPEGDecode::decode(OSVideoSurface &surface, const CString &name) {
-	// Open up the resource
-	StdCWadFile file;
-	file.open(name);
-
-	// Use the ScucmmVM deoder to decode it
-	loadStream(*file.readStream());
-	const Graphics::Surface *srcSurf = getSurface();
-	
-	// Resize the surface if necessary
-	if (!surface.hasSurface() || surface.getWidth() != srcSurf->w 
-			|| surface.getHeight() != srcSurf->h)
-		surface.resize(srcSurf->w, srcSurf->h);
-
-	// Convert the decoded surface to the correct pixel format, and then copy it over
-	surface.lock();
-	Graphics::Surface *convertedSurface = srcSurf->convertTo(surface._rawSurface->format);
-
-	Common::copy((byte *)convertedSurface->getPixels(), (byte *)convertedSurface->getPixels() +
-		surface.getPitch() * surface.getHeight(), (byte *)surface._rawSurface->getPixels());
-
-	delete convertedSurface;
-	surface.unlock();
-}
-
-/*------------------------------------------------------------------------*/
-
-void CTargaDecode::decode(OSVideoSurface &surface, const CString &name) {
-	// Open up the resource
-	StdCWadFile file;
-	file.open(name);
-
-	// Use the ScucmmVM deoder to decode it
-	loadStream(*file.readStream());
-	const Graphics::Surface *srcSurf = getSurface();
-
-	// Resize the surface if necessary
-	if (!surface.hasSurface() || surface.getWidth() != srcSurf->w
-			|| surface.getHeight() != srcSurf->h)
-		surface.resize(srcSurf->w, srcSurf->h);
-
-	// Convert the decoded surface to the correct pixel format, and then copy it over
-	surface.lock();
-	Graphics::Surface *convertedSurface = srcSurf->convertTo(surface._rawSurface->format);
-
-	Common::copy((byte *)convertedSurface->getPixels(), (byte *)convertedSurface->getPixels() +
-		surface.getPitch() * surface.getHeight(), (byte *)surface._rawSurface->getPixels());
-
-	delete convertedSurface;
-	surface.unlock();
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/image_decoders.h b/engines/titanic/image_decoders.h
deleted file mode 100644
index d72d6fe..0000000
--- a/engines/titanic/image_decoders.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_IMAGE_DECODERS_H
-#define TITANIC_IMAGE_DECODERS_H
-
-#include "image/jpeg.h"
-#include "image/tga.h"
-#include "titanic/string.h"
-#include "titanic/simple_file.h"
-#include "titanic/video_surface.h"
-
-namespace Titanic {
-
-class CJPEGDecode : public Image::JPEGDecoder {
-public:
-	/**
-	 * Decode the image file onto the passed surface
-	 */
-	void decode(OSVideoSurface &surface, const CString &name);
-};
-
-class CTargaDecode : public Image::TGADecoder {
-public:
-	/**
-	* Decode the image file onto the passed surface
-	*/
-	void decode(OSVideoSurface &surface, const CString &name);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_IMAGE_DECODERS_H */
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index 8323531..0657ebe 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -22,7 +22,7 @@
 
 #include "titanic/input_handler.h"
 #include "titanic/game_manager.h"
-#include "titanic/screen_manager.h"
+#include "titanic/support/screen_manager.h"
 #include "titanic/titanic.h"
 #include "titanic/pet_control/pet_control.h"
 
diff --git a/engines/titanic/input_handler.h b/engines/titanic/input_handler.h
index 7495082..4e8966f 100644
--- a/engines/titanic/input_handler.h
+++ b/engines/titanic/input_handler.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_INPUT_HANDLER_H
 #define TITANIC_INPUT_HANDLER_H
 
-#include "titanic/rect.h"
+#include "titanic/support/rect.h"
 #include "titanic/input_translator.h"
 #include "titanic/core/tree_item.h"
 
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 42517f5..78f01b9 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -27,7 +27,7 @@
 #include "common/array.h"
 #include "titanic/game_manager.h"
 #include "titanic/game_view.h"
-#include "titanic/image.h"
+#include "titanic/support/image.h"
 #include "titanic/core/project_item.h"
 
 namespace Titanic {
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 4194381..1bc77b6 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_MOUSE_MESSAGES_H
 #define TITANIC_MOUSE_MESSAGES_H
 
-#include "titanic/rect.h"
+#include "titanic/support/rect.h"
 #include "titanic/messages/messages.h"
 
 namespace Titanic {
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 4ab5caf..441de8c 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -3,29 +3,15 @@ MODULE := engines/titanic
 MODULE_OBJS := \
 	debugger.o \
 	detection.o \
-	direct_draw.o \
-	direct_draw_surface.o \
 	events.o \
-	files_manager.o \
-	font.o \
 	game_location.o \
 	game_manager.o \
 	game_state.o \
 	game_view.o \
-	image.o \
-	image_decoders.o \
 	input_handler.o \
 	input_translator.o \
 	main_game_window.o \
-	mouse_cursor.o \
-	movie.o \
-	rect.o \
-	screen_manager.o \
-	simple_file.o \
-	string.o \
-	text_cursor.o \
 	titanic.o \
-	video_surface.o \
 	carry/auditory_centre.o \
 	carry/arm.o \
 	carry/bowl_ear.o \
@@ -436,6 +422,20 @@ MODULE_OBJS := \
 	star_control/star_control_sub13.o \
 	star_control/star_control_sub14.o \
 	star_control/star_control_sub15.o \
+	support/direct_draw.o \
+	support/direct_draw_surface.o \
+	support/files_manager.o \
+	support/font.o \
+	support/image.o \
+	support/image_decoders.o \
+	support/mouse_cursor.o \
+	support/movie.o \
+	support/rect.o \
+	support/screen_manager.o \
+	support/simple_file.o \
+	support/string.o \
+	support/text_cursor.o \
+	support/video_surface.o \
 	true_talk/barbot_script.o \
 	true_talk/bellbot_script.o \
 	true_talk/deskbot_script.o \
diff --git a/engines/titanic/mouse_cursor.cpp b/engines/titanic/mouse_cursor.cpp
deleted file mode 100644
index 3acd871..0000000
--- a/engines/titanic/mouse_cursor.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "graphics/cursorman.h"
-#include "common/textconsole.h"
-#include "titanic/mouse_cursor.h"
-#include "titanic/movie.h"
-#include "titanic/screen_manager.h"
-#include "titanic/titanic.h"
-#include "titanic/video_surface.h"
-#include "titanic/core/resource_key.h"
-
-namespace Titanic {
-
-static const int CURSOR_DATA[NUM_CURSORS][4] = {
-	{ 1, 136, 19, 18 },
-	{ 2, 139, 1, 1 },
-	{ 3, 140, 32, 1 },
-	{ 4, 137, 13, 0 },
-	{ 5, 145, 13, 0 },
-	{ 6, 144, 13, 22 },
-	{ 7, 137, 14, 0 },
-	{ 8, 148, 22, 40 },
-	{ 9, 136, 19, 18 },
-	{ 10, 143, 11, 11 },
-	{ 11, 146, 11, 11 },
-	{ 12, 136, 19, 18 },
-	{ 13, 136, 19, 25 },
-	{ 14, 136, 13, 22 },
-	{ 15, 138, 20, 28 }
-};
-
-CMouseCursor::CMouseCursor(CScreenManager *screenManager) : 
-		_screenManager(screenManager), _cursorId(CURSOR_15) {
-	loadCursorImages();
-	setCursor(CURSOR_1);
-}
-
-CMouseCursor::~CMouseCursor() {
-	for (int idx = 0; idx < NUM_CURSORS; ++idx)
-		delete _cursors[idx]._videoSurface;
-}
-
-void CMouseCursor::loadCursorImages() {
-	const CString name("ycursors.avi");
-	const CResourceKey key(name);
-	g_vm->_filesManager.fn4(name);
-
-	// Iterate through each cursor
-	for (int idx = 0; idx < NUM_CURSORS; ++idx) {
-		assert(CURSOR_DATA[idx][0] == (idx + 1));
-		_cursors[idx]._centroid = Common::Point(CURSOR_DATA[idx][2],
-			CURSOR_DATA[idx][3]);
-
-		CVideoSurface *surface = _screenManager->createSurface(64, 64);
-		_cursors[idx]._videoSurface = surface;
-
-		OSMovie movie(key, surface);
-		movie.setFrame(idx);
-		_cursors[idx]._ptrUnknown = movie.proc21();
-		surface->set40(_cursors[idx]._ptrUnknown);
-	}
-}
-
-void CMouseCursor::show() {
-	CursorMan.showMouse(true);
-}
-
-void CMouseCursor::hide() {
-	CursorMan.showMouse(false);
-}
-
-void CMouseCursor::setCursor(CursorId cursorId) {
-	if (cursorId != _cursorId) {
-		CursorEntry &ce = _cursors[cursorId - 1];
-		CVideoSurface &surface = *ce._videoSurface;
-		surface.lock();
-
-		// ***DEBUG*** Dummy cursor
-		Common::fill(surface.getPixels(), surface.getPixels() + 128, 0x5555);
-
-		CursorMan.replaceCursor(surface.getPixels(), surface.getWidth(), surface.getHeight(),
-			ce._centroid.x, ce._centroid.y, 0, false, &g_vm->_screen->format);
-		surface.unlock();
-
-		_cursorId = cursorId;
-	}
-}
-
-void CMouseCursor::update() {
-	// No implementation needed
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/mouse_cursor.h b/engines/titanic/mouse_cursor.h
deleted file mode 100644
index 507f4ec..0000000
--- a/engines/titanic/mouse_cursor.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_MOUSE_CURSOR_H
-#define TITANIC_MOUSE_CURSOR_H
-
-#include "common/scummsys.h"
-#include "common/rect.h"
-
-namespace Titanic {
-
-#define NUM_CURSORS 15
-
-enum CursorId {
-	CURSOR_1 = 1,
-	CURSOR_2 = 3,
-	CURSOR_3 = 3,
-	CURSOR_4 = 4,
-	CURSOR_5 = 5,
-	CURSOR_6 = 6,
-	CURSOR_7 = 7,
-	CURSOR_8 = 8,
-	CURSOR_9 = 9,
-	CURSOR_10 = 10,
-	CURSOR_11 = 11,
-	CURSOR_12 = 12,
-	CURSOR_13 = 13,
-	CURSOR_14 = 14,
-	CURSOR_15 = 15
-};
-
-class CScreenManager;
-class CVideoSurface;
-
-class CMouseCursor {
-	struct CursorEntry {
-		CVideoSurface *_videoSurface;
-		void *_ptrUnknown;
-		Common::Point _centroid;
-	};
-private:
-	CScreenManager *_screenManager;
-	CursorId _cursorId;
-	CursorEntry _cursors[NUM_CURSORS];
-
-	/**
-	 * Load the images for each cursor
-	 */
-	void loadCursorImages();
-public:
-	CMouseCursor(CScreenManager *screenManager);
-	~CMouseCursor();
-
-	/**
-	 * Make the mouse cursor visible
-	 */
-	void show();
-
-	/**
-	 * Hide the mouse cursor
-	 */
-	void hide();
-	
-	/**
-	 * Set the cursor
-	 */
-	void setCursor(CursorId cursorId);
-	
-	/**
-	 * Updates the mouse cursor
-	 */
-	void update();
-};
-
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_MOUSE_CURSOR_H */
diff --git a/engines/titanic/movie.cpp b/engines/titanic/movie.cpp
deleted file mode 100644
index 193b2ca..0000000
--- a/engines/titanic/movie.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/movie.h"
-#include "titanic/titanic.h"
-
-namespace Titanic {
-
-CMovie::CMovie() : ListItem(), _state(0), _field10(0) {
-}
-
-bool CMovie::isActive() const {
-	return g_vm->_movieList.contains(this);
-}
-
-bool CMovie::get10() {
-	if (_field10) {
-		_field10 = 0;
-		return true;
-	} else {
-		return false;
-	}
-}
-
-/*------------------------------------------------------------------------*/
-
-OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) : _videoSurface(surface) {
-//	_aviDecoder.loadFile(name.getString());
-}
-
-void OSMovie::proc8(int v1, CVideoSurface *surface) {
-	warning("TODO: OSMovie::proc8");
-}
-
-void OSMovie::proc9() {
-	warning("TODO: OSMovie::proc9");
-}
-
-void OSMovie::proc10() {
-	warning("TODO: OSMovie::proc10");
-}
-
-void OSMovie::proc11() {
-	warning("TODO: OSMovie::proc11");
-}
-
-void OSMovie::proc12() {
-	warning("TODO: OSMovie::proc12");
-}
-
-void OSMovie::stop() {
-	warning("TODO: OSMovie::proc13");
-}
-
-void OSMovie::proc14() {
-	warning("TODO: OSMovie::proc14");
-}
-
-void OSMovie::setFrame(uint frameNumber) {
-	warning("TODO: OSMovie::setFrame");
-	/*
-	_aviDecoder.seekToFrame(frameNumber);
-	const Graphics::Surface *s = _aviDecoder.decodeNextFrame();
-
-	_videoSurface->blitFrom(Common::Point(0, 0), s);
-	*/
-}
-
-void OSMovie::proc16() {
-	warning("TODO: OSMovie::proc16");
-}
-
-void OSMovie::proc17() {
-	warning("TODO: OSMovie::proc17");
-}
-
-void OSMovie::proc18() {
-	warning("TODO: OSMovie::proc18");
-}
-
-int OSMovie::proc19() {
-	warning("TODO: OSMovie::proc19");
-	return 0;
-}
-
-void OSMovie::proc20() {
-	warning("TODO: OSMovie::proc20");
-}
-
-void *OSMovie::proc21() {
-	warning("TODO: OSMovie::proc21");
-	return nullptr;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/movie.h b/engines/titanic/movie.h
deleted file mode 100644
index 3529409..0000000
--- a/engines/titanic/movie.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_MOVIE_H
-#define TITANIC_MOVIE_H
-
-#include "video/avi_decoder.h"
-#include "titanic/core/list.h"
-#include "titanic/core/resource_key.h"
-
-namespace Titanic {
-
-class CVideoSurface;
-
-class CMovie : public ListItem {
-protected:
-	int _state;
-	int _field10;
-public:
-	CMovie();
-
-	virtual void proc8(int v1, CVideoSurface *surface) = 0;
-	virtual void proc9() = 0;
-	virtual void proc10() = 0;
-	virtual void proc11() = 0;
-	virtual void proc12() = 0;
-	virtual void stop() = 0;
-	virtual void proc14() = 0;
-	virtual void setFrame(uint frameNumber) = 0;
-	virtual void proc16() = 0;
-	virtual void proc17() = 0;
-	virtual void proc18() = 0;
-	virtual int proc19() = 0;
-	virtual void proc20() = 0;
-	virtual void *proc21() = 0;
-
-	bool isActive() const;
-
-	bool get10();
-};
-
-class OSMovie : public CMovie {
-private:
-	Video::AVIDecoder _aviDecoder;
-	CVideoSurface *_videoSurface;
-public:
-	OSMovie(const CResourceKey &name, CVideoSurface *surface);
-
-	virtual void proc8(int v1, CVideoSurface *surface);
-	virtual void proc9();
-	virtual void proc10();
-	virtual void proc11();
-	virtual void proc12();
-	virtual void stop();
-	virtual void proc14();
-
-	/**
-	 * Set the current frame number
-	 */
-	virtual void setFrame(uint frameNumber);
-	
-	virtual void proc16();
-	virtual void proc17();
-	virtual void proc18();
-	virtual int proc19();
-	virtual void proc20();
-	virtual void *proc21();
-};
-
-class CGlobalMovies : public List<CMovie> {
-public:
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_MOVIE_H */
diff --git a/engines/titanic/pet_control/pet_control_sub10.h b/engines/titanic/pet_control/pet_control_sub10.h
index aabb596..ef8d02f 100644
--- a/engines/titanic/pet_control/pet_control_sub10.h
+++ b/engines/titanic/pet_control/pet_control_sub10.h
@@ -26,7 +26,7 @@
 #include "titanic/core/list.h"
 #include "titanic/pet_control/pet_control_sub10.h"
 #include "titanic/pet_control/pet_control_list_item.h"
-#include "titanic/screen_manager.h"
+#include "titanic/support/screen_manager.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/pet_control/pet_control_sub12.h b/engines/titanic/pet_control/pet_control_sub12.h
index 88faf3d..70010f0 100644
--- a/engines/titanic/pet_control/pet_control_sub12.h
+++ b/engines/titanic/pet_control/pet_control_sub12.h
@@ -23,8 +23,8 @@
 #ifndef TITANIC_PET_CONTROL_SUB12_H
 #define TITANIC_PET_CONTROL_SUB12_H
 
-#include "titanic/simple_file.h"
-#include "titanic/screen_manager.h"
+#include "titanic/support/simple_file.h"
+#include "titanic/support/screen_manager.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index 13f209c..2d56b57 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -23,8 +23,8 @@
 #ifndef TITANIC_PET_ELEMENT_H
 #define TITANIC_PET_ELEMENT_H
 
-#include "titanic/simple_file.h"
-#include "titanic/string.h"
+#include "titanic/support/simple_file.h"
+#include "titanic/support/string.h"
 #include "titanic/core/link_item.h"
 #include "titanic/messages/mouse_messages.h"
 
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 3f1d26d..01f9ebb 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_PET_INVENTORY_H
 #define TITANIC_PET_INVENTORY_H
 
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub10.h"
 #include "titanic/pet_control/pet_control_sub12.h"
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 352e224..169f0c0 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -24,7 +24,7 @@
 #define TITANIC_PET_SECTION_H
 
 #include "titanic/messages/mouse_messages.h"
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/rect.cpp b/engines/titanic/rect.cpp
deleted file mode 100644
index 228a2ae..0000000
--- a/engines/titanic/rect.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/rect.h"
-
-namespace Titanic {
-
-void Rect::combine(const Rect &r) {
-	if (isEmpty() || r.isEmpty())
-		return;
-
-	Common::Rect::extend(r);
-}
-
-void Rect::constrain(const Rect &r) {
-	if (!isEmpty()) {
-		if (r.isEmpty()) {
-			clear();
-		} else {
-			Common::Rect::clip(r);
-		}
-	}
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/rect.h b/engines/titanic/rect.h
deleted file mode 100644
index 1661711..0000000
--- a/engines/titanic/rect.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_RECT_H
-#define TITANIC_RECT_H
-
-#include "common/rect.h"
-
-namespace Titanic {
-
-typedef Common::Point Point;
-
-class Rect : public Common::Rect {
-public:
-	Rect() : Common::Rect() {}
-	Rect(int16 w, int16 h) : Common::Rect(w, h) {}
-	Rect(int16 x1, int16 y1, int16 x2, int16 y2) : Common::Rect(x1, y1, x2, y2) {}
-
-	/**
-	 * Returns the top/left corner of the rect as a point
-	 */
-	operator const Point() { return Point(left, top); }
-
-	/**
-	 * Clear the rect
-	 */
-	void clear() { left = top = right = bottom = 0; }
-
-	/**
-	 * Combine another rect into this one
-	 */
-	void combine(const Rect &r);
-
-	/**
-	 * Constrains/clips to the intersection area of the given rect
-	 */
-	void constrain(const Rect &r);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_RECT_H */
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
deleted file mode 100644
index 99de75a..0000000
--- a/engines/titanic/screen_manager.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/screen_manager.h"
-#include "titanic/titanic.h"
-#include "titanic/video_surface.h"
-
-namespace Titanic {
-
-CScreenManager *CScreenManager::_screenManagerPtr;
-CScreenManager *CScreenManager::_currentScreenManagerPtr;
-
-CScreenManager::CScreenManager(TitanicEngine *vm): _vm(vm) {
-	_screenManagerPtr = nullptr;
-	_currentScreenManagerPtr = nullptr;
-
-	_frontRenderSurface = nullptr;
-	_mouseCursor = nullptr;
-	_textCursor = nullptr;
-	_inputHandler = nullptr;
-	_fontNumber = 0;
-	// TODO: Further initialization
-
-	_screenManagerPtr = this;
-}
-
-CScreenManager::~CScreenManager() {
-	_screenManagerPtr = nullptr;
-}
-
-void CScreenManager::setWindowHandle(int v) {
-	// Not needed
-}
-
-bool CScreenManager::resetWindowHandle(int v) {
-	hideCursor();
-	return true;
-}
-
-CScreenManager *CScreenManager::setCurrent() {
-	if (!_currentScreenManagerPtr)
-		_currentScreenManagerPtr = _screenManagerPtr;
-
-	return _currentScreenManagerPtr;
-}
-
-void CScreenManager::setSurfaceBounds(SurfaceNum surfaceNum, const Rect &r) {
-	if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
-		_backSurfaces[surfaceNum]._bounds = r;
-}
-
-/*------------------------------------------------------------------------*/
-
-OSScreenManager::OSScreenManager(TitanicEngine *vm): CScreenManager(vm),
-		_directDrawManager(vm, false) {
-	_field48 = 0;
-	_field4C = 0;
-	_field50 = 0;
-	_field54 = 0;
-}
-
-OSScreenManager::~OSScreenManager() {
-	destroyFrontAndBackBuffers();
-	delete _mouseCursor;
-	delete _textCursor;
-}
-
-void OSScreenManager::setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) {
-	assert(bpp == 16);
-	destroyFrontAndBackBuffers();
-	_directDrawManager.initVideo(width, height, bpp, numBackSurfaces);
-
-	_vm->_screen->create(width, height, g_system->getScreenFormat());
-	_frontRenderSurface = new OSVideoSurface(this, nullptr);
-	_frontRenderSurface->setSurface(this, _directDrawManager._mainSurface);
-
-	_backSurfaces.resize(numBackSurfaces);
-	for (uint idx = 0; idx < numBackSurfaces; ++idx) {
-		_backSurfaces[idx]._surface = new OSVideoSurface(this, nullptr);
-		_backSurfaces[idx]._surface->setSurface(this, _directDrawManager._backSurfaces[idx]);
-	}
-
-	// Load fonts
-	_fonts[0].load(149);
-	_fonts[1].load(151);
-	_fonts[2].load(152);
-	_fonts[3].load(153);
-
-	// Load the cursors
-	loadCursors();
-}
-
-void OSScreenManager::drawCursors() {
-	warning("OSScreenManager::drawCursors");
-}
-
-DirectDrawSurface *OSScreenManager::getDDSurface(SurfaceNum surfaceNum) {
-	if (surfaceNum == SURFACE_PRIMARY)
-		return _directDrawManager._mainSurface;
-	else if (surfaceNum < (int)_backSurfaces.size())
-		return _directDrawManager._backSurfaces[surfaceNum];
-	else
-		return nullptr;
-}
-
-void OSScreenManager::proc6() {}
-void OSScreenManager::proc7() {}
-
-CVideoSurface *OSScreenManager::getSurface(SurfaceNum surfaceNum) const {
-	if (surfaceNum == SURFACE_PRIMARY)
-		return _frontRenderSurface;
-	else if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
-		return _backSurfaces[surfaceNum]._surface;
-	else
-		return nullptr;
-}
-
-void OSScreenManager::proc9() {}
-
-void OSScreenManager::fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g, byte b) {
-	DirectDrawSurface *surface = getDDSurface(surfaceNum);
-	if (!surface)
-		return;
-
-	// If bounds are provided, clip and use them. Otherwise, use entire surface area
-	Rect surfaceRect(0, 0, surface->getWidth(), surface->getHeight());
-	Rect tempRect;
-
-	if (rect) {
-		tempRect = *rect;
-		tempRect.clip(surfaceRect);
-	} else {
-		tempRect = surfaceRect;
-	}
-
-	if (tempRect.isValidRect())
-		surface->fillRect(&tempRect, r, g, b);
-}
-
-void OSScreenManager::blitFrom(SurfaceNum surfaceNum, CVideoSurface *src,
-	const Point *destPos, const Rect *srcRect) {
-	// Get the dest surface
-	CVideoSurface *destSurface = _frontRenderSurface;
-	if (surfaceNum < -1)
-		return;
-	if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
-		destSurface = _backSurfaces[surfaceNum]._surface;
-	if (!destSurface->hasSurface())
-		return;
-	
-	Point destPoint = destPos ? *destPos : Point(0, 0);
-	Rect srcBounds = srcRect ? *srcRect : Rect(0, 0, src->getWidth(), src->getHeight());
-	Rect *bounds = &srcBounds;
-	Rect rect2;
-
-	if (surfaceNum >= 0 && !_backSurfaces[surfaceNum]._bounds.isEmpty()) {
-		// Perform clipping to the bounds of the back surface
-		rect2 = srcBounds;
-		rect2.translate(-srcBounds.left, -srcBounds.top);
-		rect2.translate(destPoint.x, destPoint.y);
-		rect2.constrain(_backSurfaces[surfaceNum]._bounds);
-
-		rect2.translate(-destPoint.x, -destPoint.y);
-		rect2.translate(srcBounds.left, srcBounds.top);
-
-		if (rect2.isEmpty())
-			return;
-
-		destPoint.x += rect2.left - srcBounds.left;
-		destPoint.y += rect2.top - srcBounds.top;
-		bounds = &rect2;
-	}
-
-	if (!bounds->isEmpty())
-		destSurface->blitFrom(destPoint, src, bounds);
-}
-
-void OSScreenManager::proc12() {}
-void OSScreenManager::proc13() {}
-void OSScreenManager::proc14() {}
-void OSScreenManager::proc15() {}
-
-void OSScreenManager::writeString(int maxWidth, const CString &text, int *v1, int *v2) {
-	_fonts[_fontNumber].writeString(maxWidth, text, v1, v2);
-}
-
-void OSScreenManager::getFont() {}
-void OSScreenManager::proc18() {}
-void OSScreenManager::proc19() {}
-
-void OSScreenManager::clearSurface(SurfaceNum surfaceNum, Rect *bounds) {
-	if (surfaceNum == SURFACE_PRIMARY)
-		_directDrawManager._mainSurface->fill(bounds, 0);
-	else if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
-		_directDrawManager._backSurfaces[surfaceNum]->fill(bounds, 0);
-}
-
-void OSScreenManager::resizeSurface(CVideoSurface *surface, int width, int height) {
-	DirectDrawSurface *ddSurface = _directDrawManager.createSurface(width, height, 0);
-	surface->setSurface(this, ddSurface);
-}
-
-CVideoSurface *OSScreenManager::createSurface(int w, int h) {
-	DirectDrawSurface *ddSurface = _directDrawManager.createSurface(w, h, 0);
-	return new OSVideoSurface(this, ddSurface);
-}
-
-CVideoSurface *OSScreenManager::createSurface(const CResourceKey &key) {
-	return new OSVideoSurface(this, key);
-}
-
-void OSScreenManager::proc23() {}
-void OSScreenManager::proc24() {}
-void OSScreenManager::proc25() {}
-
-void OSScreenManager::showCursor() {
-
-}
-
-void OSScreenManager::hideCursor() {
-
-}
-
-void OSScreenManager::destroyFrontAndBackBuffers() {
-	delete _frontRenderSurface;
-	_frontRenderSurface = nullptr;
-
-	for (uint idx = 0; idx < _backSurfaces.size(); ++idx)
-		delete _backSurfaces[idx]._surface;
-	_backSurfaces.clear();
-}
-
-void OSScreenManager::loadCursors() {
-	if (_mouseCursor) {
-		hideCursor();
-		delete _mouseCursor;
-	}
-	_mouseCursor = new CMouseCursor(this);
-	showCursor();
-
-	if (!_textCursor) {
-		_textCursor = new CTextCursor();
-	}
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
deleted file mode 100644
index e39151b..0000000
--- a/engines/titanic/screen_manager.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_SCREEN_MANAGER_H
-#define TITANIC_SCREEN_MANAGER_H
-
-#include "common/scummsys.h"
-#include "common/array.h"
-#include "titanic/direct_draw.h"
-#include "titanic/font.h"
-#include "titanic/input_handler.h"
-#include "titanic/mouse_cursor.h"
-#include "titanic/text_cursor.h"
-#include "titanic/video_surface.h"
-#include "titanic/core/resource_key.h"
-
-namespace Titanic {
-
-/**
- * The original used page flipping with one primary and one back buffer.
- * Since we don't need that in ScummVM, the back buffer number below is
- * remapped to the primary surface
- */
-enum SurfaceNum {
-	SURFACE_PRIMARY = -1,
-	SURFACE_BACKBUFFER = -1
-};
-
-class TitanicEngine;
-
-class CScreenManager {
-	struct VideoSurfaceEntry {
-		CVideoSurface *_surface;
-		Rect _bounds;
-	};
-protected:
-	TitanicEngine *_vm;
-public:
-	static CScreenManager *_screenManagerPtr;
-	static CScreenManager *_currentScreenManagerPtr;
-
-	/**
-	 * Set the current screen manager
-	 */
-	static CScreenManager *setCurrent();
-public:
-	Common::Array<VideoSurfaceEntry> _backSurfaces;
-	CVideoSurface *_frontRenderSurface;
-	CMouseCursor *_mouseCursor;
-	CTextCursor *_textCursor;
-	CInputHandler *_inputHandler;
-	int _fontNumber;
-public:
-	CScreenManager(TitanicEngine *vm);
-	virtual ~CScreenManager();
-
-	void fn1() {}
-	void fn2() {}
-
-	virtual void setWindowHandle(int v);
-	virtual bool resetWindowHandle(int v);
-	
-	/**
-	 * Sets the video mode
-	 */
-	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) = 0;
-
-	/**
-	 * Handles drawing the cursors
-	 */
-	virtual void drawCursors() = 0;
-	
-	virtual void proc6() = 0;
-	virtual void proc7() = 0;
-	virtual CVideoSurface *getSurface(SurfaceNum surfaceNum) const = 0;
-	virtual void proc9() = 0;
-	
-	/**
-	 * Fill an area with a specific color
-	 */
-	virtual void fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g, byte b) = 0;
-
-	/**
-	 * Blits a surface onto one of the screen surfaces
-	 */
-	virtual void blitFrom(SurfaceNum surfaceNum, CVideoSurface *src, const Point *destPos = nullptr,
-		const Rect *srcRect = nullptr) = 0;
-
-	virtual void proc12() = 0;
-	virtual void proc13() = 0;
-	virtual void proc14() = 0;
-	virtual void proc15() = 0;
-
-
-	/**
-	 * Write out a string
-	 */
-	virtual void writeString(int maxWidth, const CString &text, int *v1, int *v2) = 0;
-
-	virtual void getFont() = 0;
-	virtual void proc18() = 0;
-	virtual void proc19() = 0;
-
-	/**
-	 * Clear a portion of a specified surface
-	 */
-	virtual void clearSurface(SurfaceNum surfaceNum, Rect *_bounds) = 0;
-
-	/**
-	 * Resize the passed surface
-	 */
-	virtual void resizeSurface(CVideoSurface *surface, int width, int height) = 0;
-
-	/**
-	 * Creates a surface of a given size
-	 */
-	virtual CVideoSurface *createSurface(int w, int h) = 0;
-	
-	/**
-	 * Creates a surface from a specified resource
-	 */
-	virtual CVideoSurface *createSurface(const CResourceKey &key) = 0;
-	
-	virtual void proc24() = 0;
-	virtual void proc25() = 0;
-	virtual void showCursor() = 0;
-	virtual void hideCursor() = 0;
-
-	void setSurfaceBounds(SurfaceNum surfaceNum, const Rect &r);
-};
-
-class OSScreenManager: CScreenManager {
-private:
-	DirectDrawManager _directDrawManager;
-
-	/**
-	 * Frees any surface buffers
-	 */
-	void destroyFrontAndBackBuffers();
-
-	/**
-	 * Load game cursors
-	 */
-	void loadCursors();
-
-	/**
-	 * Gets an underlying surface
-	 */
-	DirectDrawSurface *getDDSurface(SurfaceNum surfaceNum);
-public:
-	int _field48;
-	int _field4C;
-	int _field50;
-	int _field54;
-	STFont _fonts[4];
-public:
-	OSScreenManager(TitanicEngine *vm);
-	virtual ~OSScreenManager();
-
-	/**
-	 * Sets the video mode
-	 */
-	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2);
-
-	/**
-	 * Handles drawing the cursors
-	 */
-	virtual void drawCursors();
-
-	virtual void proc6();
-	virtual void proc7();
-	virtual CVideoSurface *getSurface(SurfaceNum surfaceNum) const;
-	virtual void proc9();
-
-	/**
-	 * Fill an area with a specific color
-	 */
-	virtual void fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g, byte b);
-
-	/**
-	 * Blits a surface onto one of the screen surfaces
-	 */
-	virtual void blitFrom(SurfaceNum surfaceNum, CVideoSurface *src, const Point *destPos,
-		const Rect *srcRect = nullptr);
-
-	virtual void proc12();
-	virtual void proc13();
-	virtual void proc14();
-	virtual void proc15();
-
-	/**
-	 * Write out a string
-	 */
-	virtual void writeString(int maxWidth, const CString &text, int *v1, int *v2);
-
-	virtual void getFont();
-	virtual void proc18();
-	virtual void proc19();
-
-	/**
-	 * Clear a portion of the screen surface
-	 */
-	virtual void clearSurface(SurfaceNum surfaceNum, Rect *bounds);
-
-	/**
-	 * Resize the passed surface
-	 */
-	virtual void resizeSurface(CVideoSurface *surface, int width, int height);
-
-	/**
-	 * Creates a surface of a given size
-	 */
-	virtual CVideoSurface *createSurface(int w, int h);
-	
-	/**
-	 * Creates a surface from a specified resource
-	 */
-	virtual CVideoSurface *createSurface(const CResourceKey &key);
-
-	virtual void proc23();
-	virtual void proc24();
-	virtual void proc25();
-	virtual void showCursor();
-	virtual void hideCursor();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_SCREEN_MANAGER_H */
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
deleted file mode 100644
index acf02e8..0000000
--- a/engines/titanic/simple_file.cpp
+++ /dev/null
@@ -1,385 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/util.h"
-#include "titanic/simple_file.h"
-
-namespace Titanic {
-
-bool File::open(const Common::String &name) {
-	if (!Common::File::open(name))
-		error("Could not open file - %s", name.c_str());
-	return true;
-}
-
-/*------------------------------------------------------------------------*/
-
-SimpleFile::SimpleFile(): _inStream(nullptr), _outStream(nullptr), _lineCount(1) {
-}
-
-SimpleFile::~SimpleFile() {
-	close();
-}
-
-void SimpleFile::open(Common::SeekableReadStream *stream) {
-	close();	
-	_inStream = stream;
-}
-
-void SimpleFile::open(Common::OutSaveFile *stream) {
-	close();
-	_outStream = stream;
-}
-
-void SimpleFile::close() {
-	if (_outStream) {
-		_outStream->finalize();
-		delete _outStream;
-		_outStream = nullptr;
-	}
-
-	if (_inStream) {
-		delete _inStream;
-		_inStream = nullptr;
-	}
-}
-
-void SimpleFile::safeRead(void *dst, size_t count) {
-	if (unsafeRead(dst, count) != count)
-		error("Could not read %d bytes", (int)count);
-}
-
-size_t SimpleFile::unsafeRead(void *dst, size_t count) {
-	assert(_inStream);
-	return _inStream->read(dst, count);
-}
-
-size_t SimpleFile::write(const void *src, size_t count) {
-	assert(_outStream);
-	return _outStream->write(src, count);
-}
-
-CString SimpleFile::readString() {
-	char c;
-	CString result;
-	bool backslashFlag = false;
-
-	// First skip any spaces
-	do {
-		safeRead(&c, 1);
-	} while (Common::isSpace(c));
-
-	// Ensure we've found a starting quote for the string
-	if (c != '"')
-		error("Could not find starting quote");
-
-	bool endFlag = false;
-	while (!endFlag) {
-		// Read the next character
-		safeRead(&c, 1);
-
-		if (backslashFlag) {
-			backslashFlag = false;
-			switch (c) {
-			case 'n':
-				result += '\n';
-				break;
-			case 'r':
-				result += '\r';
-				break;
-			case '\t':
-				result += '\t';
-				break;
-			default:
-				result += c;
-				break;
-			}
-		} else {
-			switch (c) {
-			case '"':
-				endFlag = true;
-				break;
-			case '\\':
-				backslashFlag = true;
-				break;
-			default:
-				result += c;
-				break;
-			}
-		}
-	}
-
-	// Return the string
-	return result;
-}
-
-int SimpleFile::readNumber() {
-	char c;
-	int result = 0;
-	bool minusFlag = false;
-
-	// First skip any spaces
-	do {
-		safeRead(&c, 1);
-	} while (Common::isSpace(c));
-
-	// Check for prefix sign
-	if (c == '+' || c == '-') {
-		minusFlag = c == '-';
-		safeRead(&c, 1);
-	}
-
-	// Read in the number
-	if (!Common::isDigit(c))
-		error("Invalid number");
-
-	while (Common::isDigit(c)) {
-		result = result * 10 + (c - '0');
-		safeRead(&c, 1);
-	}
-
-	// Finally, if it's a minus value, then negate it
-	if (minusFlag)
-		result = -result;
-
-	return result;
-}
-
-double SimpleFile::readFloat() {
-	char c;
-	Common::String result;
-
-	// First skip any spaces
-	do {
-		safeRead(&c, 1);
-	} while (Common::isSpace(c));
-
-	// Check for prefix sign
-	if (c == '+' || c == '-') {
-		result += c;
-		safeRead(&c, 1);
-	}
-
-	// Read in the number
-	if (!Common::isDigit(c))
-		error("Invalid number");
-
-	while (Common::isDigit(c) || c == '.') {
-		result += c;
-		safeRead(&c, 1);
-	}
-
-	// Convert to a float and return it
-	float floatValue;
-	sscanf(result.c_str(), "%f", &floatValue);
-
-	return floatValue;
-}
-
-Point SimpleFile::readPoint() {
-	Point pt;
-	pt.x = readNumber();
-	pt.y = readNumber();
-
-	return pt;
-}
-
-Rect SimpleFile::readRect() {
-	Rect r;
-	r.left = readNumber();
-	r.top = readNumber();
-	r.right = readNumber();
-	r.bottom = readNumber();
-
-	return r;
-}
-
-void SimpleFile::readBuffer(char *buffer, size_t count) {
-	CString tempString = readString();
-	if (buffer) {
-		strncpy(buffer, tempString.c_str(), count);
-		buffer[count - 1] = '\0';
-	}
-}
-
-void SimpleFile::writeLine(const CString &str) {
-	write(str.c_str(), str.size());
-	write("\r\n", 2);
-}
-
-void SimpleFile::writeString(const CString &str) {
-	if (str.empty())
-		return;
-
-	const char *msgP = str.c_str();
-	char c;
-	
-	while ((c = *msgP++) != '\0') {
-		switch (c) {
-		case '\r':
-			write("\\r", 2);
-			break;
-		case '\n':
-			write("\\n", 2);
-			break;
-		case '\t':
-			write("\\t", 2);
-			break;
-		case '\"':
-			write("\\\"", 2);
-			break;
-		case '\\':
-			write("\\\\", 2);
-			break;
-		case '{':
-			write("\\{", 2);
-			break;
-		case '}':
-			write("\\}", 2);
-			break;
-		default:
-			write(&c, 1);
-			break;
-		}
-	}
-}
-
-void SimpleFile::writeQuotedString(const CString &str) {
-	write("\"", 1);
-	writeString(str);
-	write("\" ", 2);
-}
-
-void SimpleFile::writeQuotedLine(const CString &str, int indent) {
-	writeIndent(indent);
-	writeQuotedString(str);
-	write("\n", 1);
-}
-
-void SimpleFile::writeNumber(int val) {
-	CString str = CString::format("%d ", val);
-	write(str.c_str(), str.size());
-}
-
-void SimpleFile::writeNumberLine(int val, int indent) {
-	writeIndent(indent);
-	writeNumber(val);
-	write("\n", 1);
-}
-
-void SimpleFile::writeFloat(double val) {
-	Common::String valStr = Common::String::format("%f ", val);
-	write(valStr.c_str(), valStr.size());
-}
-
-void SimpleFile::writeFloatLine(double val, int indent) {
-	writeIndent(indent);
-	writeFloat(val);
-	write("\n", 1);
-}
-
-void SimpleFile::writePoint(const Point &pt, int indent) {
-	writeIndent(indent);
-	writeNumber(pt.x);
-	writeNumber(pt.y);
-	write("\n", 1);
-}
-
-void SimpleFile::writeRect(const Rect &r, int indent) {
-	writePoint(Point(r.left, r.top), indent);
-	writePoint(Point(r.right, r.bottom), indent);
-}
-
-void SimpleFile::writeIndent(uint indent) {
-	for (uint idx = 0; idx < indent; ++idx)
-		write("\t", 1);
-}
-
-bool SimpleFile::IsClassStart() {
-	char c;
-
-	do {
-		safeRead(&c, 1);
-	} while (Common::isSpace(c));
-
-	assert(c == '{' || c == '}');
-	return c == '{';
-}
-
-void SimpleFile::writeClassStart(const CString &classStr, int indent) {
-	write("\n", 1);
-	writeIndent(indent);
-	write("{\n", 2);
-	writeIndent(indent + 1);
-	writeQuotedString(classStr);
-	write("\n", 1);
-}
-
-void SimpleFile::writeClassEnd(int indent) {
-	writeIndent(indent);
-	write("}\n", 2);
-}
-
-/*------------------------------------------------------------------------*/
-
-void StdCWadFile::open(const CString &name) {
-	File f;
-
-	// Check for whether it is indeed a file/resource pair
-	int idx = name.indexOf('#');
-
-	if (idx < 0) {
-		// Nope, so open up file for standard reading
-		assert(!name.empty());
-		f.open(name);
-
-		SimpleFile::open(f.readStream(f.size()));
-		return;
-	}
-
-	// Split up the name and resource, and get the resource index
-	CString filename = name.left(idx) + ".st";
-	int extPos = name.lastIndexOf('.');
-	CString resStr = name.mid(idx + 1, extPos - idx - 1);
-	int resIndex = resStr.readInt();
-
-	// Open up the index for access 
-	f.open(filename);
-	int indexSize = f.readUint32LE() / 4;
-	assert(resIndex < indexSize);
-
-	// Get the specific resource's offset, and size by also
-	// getting the offset of the following resource
-	f.seek(resIndex * 4);
-	uint resOffset = f.readUint32LE();
-	uint nextOffset = (resIndex == (indexSize - 1)) ? f.size() :
-		f.readUint32LE();
-
-	// Read in the resource
-	f.seek(resOffset);
-	Common::SeekableReadStream *stream = f.readStream(nextOffset - resOffset);
-	SimpleFile::open(stream);
-
-	f.close();
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
deleted file mode 100644
index 0568092..0000000
--- a/engines/titanic/simple_file.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_SIMPLE_FILE_H
-#define TITANIC_SIMPLE_FILE_H
-
-#include "common/file.h"
-#include "titanic/rect.h"
-#include "common/savefile.h"
-#include "common/stream.h"
-#include "common/zlib.h"
-#include "titanic/string.h"
-
-namespace Titanic {
-
-class Decompressor;
-class DecompressorData;
-
-/**
- * Simple ScummVM File descendent that throws a wobbly if
- * the file it tries to open isn't present
- */
-class File : public Common::File {
-public:
-	virtual bool open(const Common::String &name);
-};
-
-/**
- * This class implements basic reading and writing to files
- */
-class SimpleFile {
-protected:
-	Common::SeekableReadStream *_inStream;
-	Common::OutSaveFile *_outStream;
-	int _lineCount;
-public:
-	SimpleFile();
-	virtual ~SimpleFile();
-
-	/**
-	 * Set up a stream for read access
-	 */
-	virtual void open(Common::SeekableReadStream *stream);
-
-	/**
-	 * Set up a stream for write access
-	 */
-	virtual void open(Common::OutSaveFile *stream);
-
-	/**
-	 * Close the file
-	 */
-	virtual void close();
-
-	/**
-	 * Read from the file with validation
-	 */
-	virtual void safeRead(void *dst, size_t count);
-
-	/**
-	 * Read from the file
-	 */
-	virtual size_t unsafeRead(void *dst, size_t count);
-
-	/**
-	 * Write out data
-	 */
-	virtual size_t write(const void *src, size_t count);
-
-	/**
-	 * Read a string from the file
-	 */
-	CString readString();
-
-	/**
-	 * Read a number from the file
-	 */
-	int readNumber();
-
-	/**
-	 * Read a floating point number from the file
-	 */
-	double readFloat();
-
-	/**
-	 * Read in a point
-	 */
-	Point readPoint();
-
-	/**
-	 * Read in a rect
-	 */
-	Rect readRect();
-
-	/**
-	 * Read a string and copy it into an optionally passed buffer
-	 */
-	void readBuffer(char *buffer = nullptr, size_t count = 0);
-
-	/**
-	 * Write a string line
-	 */
-	void writeLine(const CString &str);
-
-	/**
-	 * Write a string
-	 */
-	void writeString(const CString &str);
-
-	/**
-	 * Write a quoted string
-	 */
-	void writeQuotedString(const CString &str);
-
-	/**
-	 * Write a quoted string line
-	 */
-	void writeQuotedLine(const CString &str, int indent);
-
-	/**
-	 * Write a number to file
-	 */
-	void writeNumber(int val);
-
-	/**
-	 * Write a number line to file
-	 */
-	void writeNumberLine(int val, int indent);
-
-	/**
-	 * Write a floating point number
-	 */
-	void writeFloat(double val);
-
-	/**
-	 * Write a floating point number as a line
-	 */
-	void writeFloatLine(double val, int indent);
-
-	/**
-	 * Write out a point line
-	 */
-	void writePoint(const Point &pt, int indent);
-
-	/**
-	 * Write out a rect line
-	 */
-	void writeRect(const Rect &r, int indent);
-
-	/**
-	 * Write out a number of tabs to form an indent in the output
-	 */
-	void writeIndent(uint indent);
-
-	/**
-	 * Validates that the following non-space character is either
-	 * an opening or closing squiggly bracket denoting a class
-	 * definition start or end. Returns true if it's a class start
-	 */
-	bool IsClassStart();
-
-	/**
-	 * Write the starting header for a class definition
-	 */
-	void writeClassStart(const CString &classStr, int indent);
-
-	/**
-	 * Write out the ending footer for a class definition
-	 */
-	void writeClassEnd(int indent);
-};
-
-/**
- * Derived file that handles compressed files
- */
-class CompressedFile : public SimpleFile {
-public:
-	CompressedFile() : SimpleFile() {}
-	virtual ~CompressedFile() {}
-
-	/**
-	 * Set up a stream for read access
-	 */
-	virtual void open(Common::SeekableReadStream *stream) {
-		SimpleFile::open(Common::wrapCompressedReadStream(stream));
-	}
-
-	/**
-	 * Set up a stream for write access
-	 */
-	virtual void open(Common::OutSaveFile *stream) {
-		SimpleFile::open(Common::wrapCompressedWriteStream(stream));
-	}
-};
-
-/**
- * Derived file that handles WAD archives containing multiple files
- */
-class StdCWadFile : public SimpleFile {
-public:
-	StdCWadFile() : SimpleFile() {}
-	virtual ~StdCWadFile() {}
-
-	/**
-	 * Open up the specified file
-	 */
-	void open(const CString &name);
-
-	/**
-	 * Return a reference to the read stream
-	 */
-	Common::SeekableReadStream *readStream() const { return _inStream; }
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_SIMPLE_FILE_H */
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index fe115f7..804263c 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_SOUND_H
 #define TITANIC_SOUND_H
 
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/sound/sound_manager.h"
 #include "titanic/core/view_item.h"
 
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index 29fbb5a..f741f97 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_SOUND_MANAGER_H
 #define TITANIC_SOUND_MANAGER_H
 
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index c8ee8c2..4465798 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/screen_manager.h"
+#include "titanic/support/screen_manager.h"
 #include "titanic/star_control/star_control.h"
 
 namespace Titanic {
diff --git a/engines/titanic/star_control/star_control_sub11.cpp b/engines/titanic/star_control/star_control_sub11.cpp
index 6c78293..f590ee6 100644
--- a/engines/titanic/star_control/star_control_sub11.cpp
+++ b/engines/titanic/star_control/star_control_sub11.cpp
@@ -20,7 +20,7 @@
  *
  */
 
-#include "titanic/screen_manager.h"
+#include "titanic/support/screen_manager.h"
 #include "titanic/star_control/star_control_sub11.h"
 
 namespace Titanic {
diff --git a/engines/titanic/star_control/star_control_sub11.h b/engines/titanic/star_control/star_control_sub11.h
index 6b68070..9cb9cbe 100644
--- a/engines/titanic/star_control/star_control_sub11.h
+++ b/engines/titanic/star_control/star_control_sub11.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_STAR_CONTROL_SUB11_H
 #define TITANIC_STAR_CONTROL_SUB11_H
 
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/star_control/star_control_sub12.h"
 #include "titanic/star_control/star_control_sub13.h"
 #include "titanic/star_control/star_control_sub15.h"
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index 6bfc415..586e138 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_STAR_CONTROL_SUB12_H
 #define TITANIC_STAR_CONTROL_SUB12_H
 
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/star_control/star_control_sub13.h"
 
 namespace Titanic {
diff --git a/engines/titanic/star_control/star_control_sub13.h b/engines/titanic/star_control/star_control_sub13.h
index 983fa1c..1ec841a 100644
--- a/engines/titanic/star_control/star_control_sub13.h
+++ b/engines/titanic/star_control/star_control_sub13.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_STAR_CONTROL_SUB13_H
 #define TITANIC_STAR_CONTROL_SUB13_H
 
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/star_control/star_control_sub6.h"
 #include "titanic/star_control/star_control_sub14.h"
 
diff --git a/engines/titanic/star_control/star_control_sub14.h b/engines/titanic/star_control/star_control_sub14.h
index 63a58bf..2d02d13 100644
--- a/engines/titanic/star_control/star_control_sub14.h
+++ b/engines/titanic/star_control/star_control_sub14.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_STAR_CONTROL_SUB14_H
 #define TITANIC_STAR_CONTROL_SUB14_H
 
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/star_control/star_control_sub15.h b/engines/titanic/star_control/star_control_sub15.h
index 2151c5a..0e0d2e4 100644
--- a/engines/titanic/star_control/star_control_sub15.h
+++ b/engines/titanic/star_control/star_control_sub15.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_STAR_CONTROL_SUB15_H
 #define TITANIC_STAR_CONTROL_SUB15_H
 
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/star_control/star_control_sub3.h b/engines/titanic/star_control/star_control_sub3.h
index d6d1c30..08d0835 100644
--- a/engines/titanic/star_control/star_control_sub3.h
+++ b/engines/titanic/star_control/star_control_sub3.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_STAR_CONTROL_SUB3_H
 #define TITANIC_STAR_CONTROL_SUB3_H
 
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/star_control/star_control_sub4.h"
 
 namespace Titanic {
diff --git a/engines/titanic/star_control/star_control_sub8.h b/engines/titanic/star_control/star_control_sub8.h
index da95f89..6dcd147 100644
--- a/engines/titanic/star_control/star_control_sub8.h
+++ b/engines/titanic/star_control/star_control_sub8.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_STAR_CONTROL_SUB8_H
 #define TITANIC_STAR_CONTROL_SUB8_H
 
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/string.cpp b/engines/titanic/string.cpp
deleted file mode 100644
index b4af920..0000000
--- a/engines/titanic/string.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/algorithm.h"
-#include "titanic/string.h"
-
-namespace Titanic {
-
-CString::CString(char c, uint32 len) : Common::String() {
-	ensureCapacity(len, false);
-	for (uint idx = 0; idx < len; ++idx)
-		(*this) += c;
-}
-
-CString::CString(int val) : Common::String() {
-	char buffer[16];
-	itoa(val, buffer, 10);
-	*this += buffer;
-}
-
-CString CString::left(uint count) const {
-	return (count > size()) ? CString() : CString(c_str(), c_str() + count);
-}
-
-CString CString::right(uint count) const {
-	uint strSize = size();
-	return (count > strSize) ? CString() : 
-		CString(c_str() + strSize - count, c_str() + strSize);
-}
-
-CString CString::mid(uint start, uint count) const {
-	if (start >= size())
-		return CString();
-	else
-		return CString(c_str() + start, MIN(count, size() - start));
-}
-
-CString CString::mid(uint start) const {
-	uint strSize = size();
-	assert(start <= strSize);
-	return mid(start, strSize - start);
-}
-
-int CString::indexOf(char c) const {
-	const char *charP = strchr(c_str(), c);
-	return charP ? charP - c_str() : -1;
-}
-
-int CString::lastIndexOf(char c) const {
-	const char *charP = strrchr(c_str(), c);
-	return charP ? charP - c_str() : -1;
-}
-
-FileType CString::fileTypeSuffix() const {
-	CString ext = right(1);
-	if (ext == "0" || ext == "4")
-		return FILETYPE_IMAGE;
-	else if (ext == "1")
-		return FILETYPE_WAV;
-	else if (ext == "2" || ext == "3")
-		return FILETYPE_MOVIE;
-	
-	ext = right(3);
-	if (ext == "tga" || ext == "jpg")
-		return FILETYPE_IMAGE;
-	else if (ext == "wav")
-		return FILETYPE_WAV;
-	else if (ext == "avi" || ext == "mov")
-		return FILETYPE_MOVIE;
-	else if (ext == "dlg")
-		return FILETYPE_DLG;
-	else
-		return FILETYPE_UNKNOWN;
-}
-
-ImageType CString::imageTypeSuffix() const {
-	CString ext = right(1);
-	if (ext == "0")
-		return IMAGETYPE_TARGA;
-	else if (ext == "4")
-		return IMAGETYPE_JPEG;
-
-	ext = right(3);
-	if (ext == "tga")
-		return IMAGETYPE_TARGA;
-	else if (ext == "jpg")
-		return IMAGETYPE_JPEG;
-	else
-		return IMAGETYPE_UNKNOWN;
-}
-
-CString CString::format(const char *fmt, ...) {
-	String output;
-
-	va_list va;
-	va_start(va, fmt);
-	output = String::vformat(fmt, va);
-	va_end(va);
-
-	return output;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/string.h b/engines/titanic/string.h
deleted file mode 100644
index 02775de..0000000
--- a/engines/titanic/string.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STRING_H
-#define TITANIC_STRING_H
-
-#include "common/scummsys.h"
-#include "common/str.h"
-
-namespace Titanic {
-
-enum FileType {
-	FILETYPE_UNKNOWN = 0, FILETYPE_IMAGE = 1, FILETYPE_MOVIE = 2,
-	FILETYPE_WAV = 3, FILETYPE_DLG = 4
-};
-
-enum ImageType {
-	IMAGETYPE_UNKNOWN = 0, IMAGETYPE_TARGA = 1, IMAGETYPE_JPEG = 2
-};
-
-class CString : public Common::String {
-public:
-	CString() : Common::String() {}
-	CString(const char *str) : Common::String(str) {}
-	CString(const char *str, uint32 len) : Common::String(str, len) {}
-	CString(const char *beginP, const char *endP) : Common::String(beginP, endP) {}
-	CString(const String &str) : Common::String(str) {}
-	CString(char c, uint32 len);
-	explicit CString(char c) : Common::String(c) {}
-	explicit CString(int val);
-
-	/**
-	 * Returns the left n characters of the string
-	 */
-	CString left(uint count) const;
-
-	/**
-	 * Returns the right n characters of the string
-	 */
-	CString right(uint count) const;
-
-	/**
-	 * Returns a substring from within the string
-	 */
-	CString mid(uint start, uint count) const;
-
-	/**
-	 * Returns a substring from within the string
-	 */
-	CString mid(uint start) const;
-
-	/**
-	 * Returns the index of the first occurance of a given character
-	 */
-	int indexOf(char c) const;
-
-	/**
-	 * Returns the index of the last occurance of a given character
-	 */
-	int lastIndexOf(char c) const;
-
-	/**
-	 * Returns the type of a filename based on it's extension
-	 */
-	FileType fileTypeSuffix() const;
-
-	/**
-	 * Returns the type of an image filename based on it's extension
-	 */
-	ImageType imageTypeSuffix() const;
-
-	/**
-	 * Parses the string as an integer and returns the value
-	 */
-	int readInt() const {
-		return atoi(c_str());
-	}
-
-	/**
-	 * Format a string
-	 */
-	static CString format(const char *fmt, ...);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STRING_H */
diff --git a/engines/titanic/support/direct_draw.cpp b/engines/titanic/support/direct_draw.cpp
new file mode 100644
index 0000000..5ddb25b
--- /dev/null
+++ b/engines/titanic/support/direct_draw.cpp
@@ -0,0 +1,109 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/debug.h"
+#include "engines/util.h"
+#include "graphics/pixelformat.h"
+#include "titanic/titanic.h"
+#include "titanic/support/direct_draw.h"
+
+namespace Titanic {
+
+DirectDraw::DirectDraw(TitanicEngine *vm) : _vm(vm),
+		_windowed(false), _fieldC(0), _width(0), _height(0),
+		_bpp(0), _numBackSurfaces(0), _field24(0) {
+}
+
+void DirectDraw::setDisplayMode(int width, int height, int bpp, int refreshRate) {
+	debugC(ERROR_BASIC, kDebugGraphics, "DirectDraw::SetDisplayMode (%d x %d), %d bpp",
+		width, height, bpp);
+	assert(bpp == 16);
+
+	Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
+	initGraphics(width, height, true, &pixelFormat);
+}
+
+void DirectDraw::diagnostics() {
+	debugC(ERROR_BASIC, kDebugGraphics, "Running DirectDraw Diagnostic...");
+}
+
+DirectDrawSurface *DirectDraw::createSurfaceFromDesc(const DDSurfaceDesc &desc) {
+	DirectDrawSurface *surface = new DirectDrawSurface();
+	surface->create(desc._w, desc._h);
+
+	return surface;
+}
+
+/*------------------------------------------------------------------------*/
+
+DirectDrawManager::DirectDrawManager(TitanicEngine *vm, bool windowed) : _directDraw(vm) {
+	_mainSurface = nullptr;
+	_backSurfaces[0] = _backSurfaces[1] = nullptr;
+	_directDraw._windowed = windowed;
+}
+
+void DirectDrawManager::initVideo(int width, int height, int bpp, int numBackSurfaces) {
+	debugC(ERROR_BASIC, kDebugGraphics, "Initialising video surfaces");
+	_directDraw._width = width;
+	_directDraw._numBackSurfaces = numBackSurfaces;
+	_directDraw._height = height;
+	_directDraw._bpp = bpp;
+
+	if (_directDraw._windowed) {
+		initWindowed();
+	} else {
+		initFullScreen();
+	}
+}
+
+void DirectDrawManager::setResolution() {
+	// TODO
+}
+
+void DirectDrawManager::proc2() {
+
+}
+
+void DirectDrawManager::proc3() {
+
+}
+
+void DirectDrawManager::initFullScreen() {
+	debugC(ERROR_BASIC, kDebugGraphics, "Creating surfaces");
+	_directDraw.setDisplayMode(_directDraw._width, _directDraw._height,
+		_directDraw._bpp, 0);
+
+	_mainSurface = new DirectDrawSurface();
+	_mainSurface->create(g_vm->_screen);
+	_backSurfaces[0] = new DirectDrawSurface();
+	_backSurfaces[0]->create(_directDraw._width, _directDraw._height);
+}
+
+DirectDrawSurface *DirectDrawManager::createSurface(int w, int h, int surfaceNum) {
+	if (surfaceNum)
+		return nullptr;
+
+	assert(_mainSurface);
+	return _directDraw.createSurfaceFromDesc(DDSurfaceDesc(w, h));
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/direct_draw.h b/engines/titanic/support/direct_draw.h
new file mode 100644
index 0000000..85c344c
--- /dev/null
+++ b/engines/titanic/support/direct_draw.h
@@ -0,0 +1,105 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DIRECT_DRAW_H
+#define TITANIC_DIRECT_DRAW_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "titanic/support/direct_draw_surface.h"
+
+namespace Titanic {
+
+class TitanicEngine;
+
+class DirectDraw {
+private:
+	TitanicEngine *_vm;
+public:
+	bool _windowed;
+	int _fieldC;
+	int _width;
+	int _height;
+	int _bpp;
+	int _numBackSurfaces;
+	int _field24;
+public:
+	DirectDraw(TitanicEngine *vm);
+
+	/**
+	 * Sets a new display mode
+	 */
+	void setDisplayMode(int width, int height, int bpp, int refreshRate);
+
+	/**
+	 * Logs diagnostic information
+	 */
+	void diagnostics();
+
+	/**
+	 * Create a surface from a passed description record
+	 */
+	DirectDrawSurface *createSurfaceFromDesc(const DDSurfaceDesc &desc);
+};
+
+class DirectDrawManager {
+public:
+	DirectDraw _directDraw;
+	DirectDrawSurface *_mainSurface;
+	DirectDrawSurface *_backSurfaces[2];
+public:
+	DirectDrawManager(TitanicEngine *vm, bool windowed);
+
+	/**
+	 * Initializes video surfaces
+	 * @param width				Screen width
+	 * @param height			Screen height
+	 * @param bpp				Bits per pixel
+	 * @param numBackSurfaces	Number of back surfaces	
+	 */
+	void initVideo(int width, int height, int bpp, int numBackSurfaces);
+
+	void setResolution();
+
+	void proc2();
+
+	void proc3();
+
+	/**
+	 * Initializes the surfaces in windowed mode
+	 */
+	void initWindowed() { initFullScreen(); }
+
+	/**
+	 * Initializes the surfaces for the screen
+	 */
+	void initFullScreen();
+
+	/**
+	 * Create a surface
+	 */
+	DirectDrawSurface *createSurface(int w, int h, int surfaceNum);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DIRECT_DRAW_H */
diff --git a/engines/titanic/support/direct_draw_surface.cpp b/engines/titanic/support/direct_draw_surface.cpp
new file mode 100644
index 0000000..9ebda15
--- /dev/null
+++ b/engines/titanic/support/direct_draw_surface.cpp
@@ -0,0 +1,100 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/direct_draw_surface.h"
+
+namespace Titanic {
+
+DirectDrawSurface::DirectDrawSurface() : _surface(nullptr),
+		_disposeAfterUse(DisposeAfterUse::YES) {
+}
+
+DirectDrawSurface::~DirectDrawSurface() {
+	free();
+}
+
+void DirectDrawSurface::create(Graphics::ManagedSurface *surface) {
+	free();
+	_surface = surface;
+	_disposeAfterUse = DisposeAfterUse::NO;
+}
+
+void DirectDrawSurface::create(int w, int h) {
+	Graphics::PixelFormat pixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
+	_surface = new Graphics::ManagedSurface(w, h, pixelFormat);
+	_disposeAfterUse = DisposeAfterUse::YES;
+}
+
+void DirectDrawSurface::free() {
+	if (_disposeAfterUse == DisposeAfterUse::YES)
+		delete _surface;
+	_surface = nullptr;
+	_disposeAfterUse = DisposeAfterUse::NO;
+}
+
+Graphics::ManagedSurface *DirectDrawSurface::lock(const Rect *bounds, int flags) {
+	assert(!_surface->empty());
+	return _surface;
+}
+
+void DirectDrawSurface::unlock() {
+	assert(_surface->w != 0 && _surface->h != 0);
+}
+
+void DirectDrawSurface::fill(const Rect *bounds, uint32 color) {
+	Rect tempBounds;
+
+	assert(_surface);
+	if (bounds) {
+		// Bounds are provided, clip them to the bounds of this surface
+		tempBounds = *bounds;
+		tempBounds.clip(Rect(0, 0, _surface->w, _surface->h));
+	} else {
+		// No bounds provided, so use the entire surface
+		tempBounds = Rect(0, 0, _surface->w, _surface->h);
+	}
+
+	// Fill the area
+	_surface->fillRect(tempBounds, color);
+}
+
+void DirectDrawSurface::fillRect(Rect *rect, byte r, byte g, byte b) {
+	uint color = _surface->format.RGBToColor(r, g, b);
+	Rect tempRect = rect ? *rect : Rect(0, 0, getWidth(), getHeight());
+
+	_surface->fillRect(tempRect, color);
+}
+
+void DirectDrawSurface::blit(const Rect &destRect, DirectDrawSurface *srcSurface, Rect &srcRect) {
+	assert(srcSurface);
+	if (!destRect.isEmpty())
+		_surface->transBlitFrom(*srcSurface->_surface, srcRect, destRect, (uint)-1);
+}
+
+void DirectDrawSurface::blit(const Point &destPos, DirectDrawSurface *srcSurface, Rect *bounds) {
+	if (bounds)
+		_surface->blitFrom(*srcSurface->_surface, *bounds, destPos);
+	else
+		_surface->blitFrom(*srcSurface->_surface, destPos);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/direct_draw_surface.h b/engines/titanic/support/direct_draw_surface.h
new file mode 100644
index 0000000..12848b1
--- /dev/null
+++ b/engines/titanic/support/direct_draw_surface.h
@@ -0,0 +1,121 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DIRECT_DRAW_SURFACE_H
+#define TITANIC_DIRECT_DRAW_SURFACE_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "graphics/managed_surface.h"
+#include "titanic/support/rect.h"
+
+namespace Titanic {
+
+class TitanicEngine;
+
+struct DDSurfaceDesc {
+	int _w;
+	int _h;
+	int _flags;
+	int _caps;
+
+	DDSurfaceDesc(int w, int h) : _w(w), _h(h), _flags(0x1006), _caps(64) {}
+};
+
+class DirectDrawSurface {
+private:
+	Graphics::ManagedSurface *_surface;
+	DisposeAfterUse::Flag _disposeAfterUse;
+public:
+	DirectDrawSurface();
+	~DirectDrawSurface();
+
+	/**
+	 * Create a surface
+	 */
+	void create(int w, int h);
+
+	/**
+	 * Create a surface based on a passed surface
+	 */
+	void create(Graphics::ManagedSurface *surface);
+
+	/**
+	 * Frees the surface
+	 */
+	void free();
+
+	/**
+	 * Return the size of the surface in ytes
+	 */
+	int getSize() const { return _surface->pitch * _surface->h; }
+
+	/**
+	 * Return the surface width
+	 */
+	int getWidth() const { return _surface->w; }
+
+	/**
+	 * Return the surface width
+	 */
+	int getHeight() const { return _surface->h; }
+
+	/**
+	 * Return the surface pitch
+	 */
+	int getPitch() const { return _surface->pitch; }
+
+	/**
+	 * Lock the surface for access
+	 */
+	Graphics::ManagedSurface *lock(const Rect *bounds, int flags);
+
+	/**
+	 * Unlocks the surface at the end of direct accesses
+	 */
+	void unlock();
+
+	/**
+	 * Fills an area of the surfae with the specified color. If no bounds are passed,
+	 * then the entire surface is filled
+	 */
+	void fill(const Rect *bounds, uint32 color);
+
+	/**
+	 * Fill an area with a specific color
+	 */
+	void fillRect(Rect *rect, byte r, byte g, byte b);
+
+	/**
+	 * Copy data from a source surfcae into this one
+	 */
+	void blit(const Rect &destRect, DirectDrawSurface *srcSurface, Rect &srcRect);
+
+	/**
+	 * Copy data from a source surfcae into this one
+	 */
+	void blit(const Point &destPos, DirectDrawSurface *srcSurface, Rect *bounds);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DIRECT_DRAW_SURFACE_H */
diff --git a/engines/titanic/support/files_manager.cpp b/engines/titanic/support/files_manager.cpp
new file mode 100644
index 0000000..179d77f
--- /dev/null
+++ b/engines/titanic/support/files_manager.cpp
@@ -0,0 +1,106 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/file.h"
+#include "titanic/support/files_manager.h"
+#include "titanic/game_manager.h"
+
+namespace Titanic {
+
+CFilesManager::CFilesManager() : _gameManager(nullptr), 
+		_assetsPath("Assets"), _exeResources(nullptr), _field0(0),
+		_drive(-1), _field18(0), _field1C(0), _field3C(0) {
+}
+
+CFilesManager::~CFilesManager() {
+	delete _exeResources;
+}
+
+bool CFilesManager::fileExists(const CString &name) {
+	Common::File f;
+	return f.exists(name);
+}
+
+bool CFilesManager::scanForFile(const CString &name) {
+	if (name.empty())
+		return false;
+
+	CString filename = name;
+	filename.toLowercase();
+	
+	if (filename[0] == 'y' || filename[0] == 'z')
+		return true;
+	else if (filename[0] < 'a' || filename[0] > 'c')
+		return false;
+
+	CString fname = filename;
+	int idx = fname.indexOf('#');
+	if (idx >= 0) {
+		fname = fname.left(idx);
+		fname += ".st";
+	}
+
+	if (_gameManager)
+		_gameManager->viewChange();
+
+	// The original had a bunch of code here handling determining
+	// which asset path, if any, the filename was present for,
+	// and storing the "active asset path" it was found on.
+	// This is redundant for ScummVM, which takes care of the paths
+	return fileExists(fname);
+}
+
+void CFilesManager::loadDrive() {
+	assert(_drive == -1);
+	resetView();
+}
+
+void CFilesManager::debug(CScreenManager *screenManager) {
+	warning("TODO: CFilesManager::debug");
+}
+
+void CFilesManager::resetView() {
+	if (_gameManager) {
+		_gameManager->_gameState.setMode(GSMODE_SELECTED);
+		_gameManager->initBounds();
+	}
+}
+
+void CFilesManager::fn4(const CString &name) {
+	warning("TODO: CFilesManager::fn4");
+}
+
+void CFilesManager::fn5(const CString &name) {
+	warning("TODO: CFilesManager::fn5");
+}
+
+Common::SeekableReadStream *CFilesManager::getResource(const CString &name,
+		const CString &area) {
+	if (!_exeResources) {
+		_exeResources = new Common::NEResources();
+		_exeResources->loadFromEXE("st.exe");
+	}
+	
+	return nullptr;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/files_manager.h b/engines/titanic/support/files_manager.h
new file mode 100644
index 0000000..7915149
--- /dev/null
+++ b/engines/titanic/support/files_manager.h
@@ -0,0 +1,96 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FILES_MANAGER_H
+#define TITANIC_FILES_MANAGER_H
+
+#include "common/winexe_ne.h"
+#include "titanic/core/list.h"
+#include "titanic/support/screen_manager.h"
+
+namespace Titanic {
+
+class CGameManager;
+
+class CFilesManagerList : public List<ListItem> {
+};
+
+class CFilesManager {
+private:
+	CGameManager *_gameManager;
+	Common::NEResources *_exeResources;
+	CFilesManagerList _list;
+	CString _string1;
+	CString _string2;
+	int _field0;
+	int _drive;
+	int _field18;
+	int _field1C;
+	int _field3C;
+	const CString _assetsPath;
+public:
+	CFilesManager();
+	~CFilesManager();
+
+	/**
+	 * Sets the game manager
+	 */
+	void setGameManager(CGameManager *gameManager) {
+		_gameManager = gameManager;
+	}
+
+	/**
+	 * Returns true if a file of the given name exists
+	 */
+	static bool fileExists(const CString &name);
+
+	/**
+	 * Scans for a file with a matching name
+	 */
+	bool scanForFile(const CString &name);
+
+	/**
+	 * Handles displaying a load drive view if necessary
+	 */
+	void loadDrive();
+
+	void debug(CScreenManager *screenManager);
+
+	/**
+	 * Resets the view being displayed
+	 */
+	void resetView();
+
+	void fn4(const CString &name);
+
+	void fn5(const CString &name);
+
+	/**
+	 * Get a resource from the executable
+	 */
+	Common::SeekableReadStream *getResource(const CString &name,
+		const CString &area);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FILES_MANAGER_H */
diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
new file mode 100644
index 0000000..6862baf
--- /dev/null
+++ b/engines/titanic/support/font.cpp
@@ -0,0 +1,70 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/support/font.h"
+#include "titanic/support/files_manager.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+STFont::STFont() {
+	_dataPtr = nullptr;
+	_dataSize = 0;
+	_field8 = 0;
+	_maxCharWidth = 0;
+	_field810 = 0;
+	_field814 = 0;
+	_field818 = 0;
+}
+
+STFont::~STFont() {
+	delete[] _dataPtr;
+}
+
+void STFont::load(int fontNumber) {
+	assert(!_dataPtr);
+	CString fontNumStr = CString::format("%d", fontNumber);
+	Common::SeekableReadStream *stream = g_vm->_filesManager.getResource(
+		fontNumStr, "STFont");
+	if (!stream)
+		return;
+
+	_field8 = stream->readUint32LE();
+	_maxCharWidth = stream->readUint32LE();
+	for (uint idx = 0; idx < 256; ++idx)
+		_chars[idx]._charWidth = stream->readUint32LE();
+	for (uint idx = 0; idx < 256; ++idx)
+		_chars[idx]._offset = stream->readUint32LE();
+
+	_dataSize = stream->readUint32LE();
+	_dataPtr = new byte[_dataSize];
+	stream->read(_dataPtr, _dataSize);
+
+	delete stream;
+}
+
+void STFont::writeString(int maxWidth, const CString &text, int *v1, int *v2) {
+	warning("TODO: STFont::writeString");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/font.h b/engines/titanic/support/font.h
new file mode 100644
index 0000000..0fff512
--- /dev/null
+++ b/engines/titanic/support/font.h
@@ -0,0 +1,64 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FONT_H
+#define TITANIC_FONT_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "titanic/support/string.h"
+
+namespace Titanic {
+
+class STFont {
+	struct CharEntry {
+		uint _charWidth;
+		uint _offset;
+	};
+public:
+	byte *_dataPtr;
+	size_t _dataSize;
+	int _field8;
+	int _maxCharWidth;
+	Common::Array<CharEntry> _chars;
+	int _field810;
+	int _field814;
+	int _field818;
+public:
+	STFont();
+	~STFont();
+
+	/**
+	 * Load a specified font
+	 */
+	void load(int fontNumber);
+
+	/**
+	 * Write out a string
+	 * TODO: Verify this
+	 */
+	void writeString(int maxWidth, const CString &text, int *v1, int *v2);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FONT_H */
diff --git a/engines/titanic/support/image.cpp b/engines/titanic/support/image.cpp
new file mode 100644
index 0000000..cabdd64
--- /dev/null
+++ b/engines/titanic/support/image.cpp
@@ -0,0 +1,121 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/file.h"
+#include "titanic/support/image.h"
+
+namespace Titanic {
+
+BITMAPINFOHEADER::BITMAPINFOHEADER() {
+	_biSize = 0;
+	_biWidth = 0;
+	_biHeight = 0;
+	_biPlanes = 0;
+	_biBitCount = 0;
+	_biCompression = 0;
+	_biSizeImage = 0;
+	_biXPelsPerMeter = 0;
+	_biYPelsPerMeter = 0;
+	_biClrUsed = 0;
+	_biClrImportant = 0;
+}
+
+/*------------------------------------------------------------------------*/
+
+RGBQuad::RGBQuad() : _rgbRed(0), _rgbGreen(0), _rgbBlue(0), _rgbReserved(0) {}
+
+/*------------------------------------------------------------------------*/
+
+Image::Image() {
+	_bitmapInfo = nullptr;
+	_bits = nullptr;
+	_flag = true;
+
+	set(16, 16);
+}
+
+void Image::proc6() {
+
+}
+
+void Image::set(int width, int height) {
+	delete _bitmapInfo;
+	if (_flag && _bitmapInfo)
+		delete[] _bits;
+
+	_bitmapInfo = new tagBITMAPINFO;
+	_bits = new byte[(width + 3) & 0xFFFC * height];
+
+	tagBITMAPINFO &bi = *_bitmapInfo;
+	bi._bmiHeader._biWidth = width;
+	bi._bmiHeader._biHeight = height;
+	bi._bmiHeader._biPlanes = 1;
+	bi._bmiHeader._biBitCount = 8;
+}
+
+void Image::proc8() {
+
+}
+
+bool Image::loadResource(const Common::String &name) {
+	// This method is hardcoded for the Titanic splash screen resource
+	assert(name == "TITANIC");
+
+	Common::File f;
+	if (!f.open("ST.exe"))
+		return false;
+
+	// The ST.exe executable has a bitmap called "TITANIC". Since we can't use
+	// the Windows FindResource function in ScummVM, this is hardcoded for now
+	f.seek(0x29B660);
+	uint size = f.readUint32LE();
+	if (size != 40)
+		return false;
+
+	loadBitmap(f);
+
+	return true;
+}
+
+void Image::proc10() {
+
+}
+
+void Image::draw() {
+
+}
+
+void Image::loadBitmap(Common::SeekableReadStream &s) {
+	_bitmapInfo->_bmiHeader._biWidth = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biHeight = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biPlanes = s.readUint16LE();
+	_bitmapInfo->_bmiHeader._biBitCount = s.readUint16LE();
+	_bitmapInfo->_bmiHeader._biCompression = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biSizeImage = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biXPelsPerMeter = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biYPelsPerMeter = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biClrUsed = s.readUint32LE();
+	_bitmapInfo->_bmiHeader._biClrImportant = s.readUint32LE();
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/image.h b/engines/titanic/support/image.h
new file mode 100644
index 0000000..9030e81
--- /dev/null
+++ b/engines/titanic/support/image.h
@@ -0,0 +1,82 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_IMAGE_H
+#define TITANIC_IMAGE_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+
+namespace Titanic {
+
+struct BITMAPINFOHEADER {
+	int _biSize;
+	int _biWidth;
+	int _biHeight;
+	int _biPlanes;
+	int _biBitCount;
+	int _biCompression;
+	int _biSizeImage;
+	int _biXPelsPerMeter;
+	int _biYPelsPerMeter;
+	int _biClrUsed;
+	int _biClrImportant;
+
+	BITMAPINFOHEADER();
+};
+
+struct RGBQuad {
+	byte _rgbRed;
+	byte _rgbGreen;
+	byte _rgbBlue;
+	byte _rgbReserved;
+
+	RGBQuad();
+};
+
+struct tagBITMAPINFO {
+	BITMAPINFOHEADER _bmiHeader;
+	RGBQuad _bmiColors[256];
+};
+
+class Image {
+private:
+	void loadBitmap(Common::SeekableReadStream &s);
+public:
+	tagBITMAPINFO *_bitmapInfo;
+	byte *_bits;
+	bool _flag;
+public:
+	Image();
+	virtual ~Image() {}
+
+	virtual void proc6();
+	virtual void set(int width, int height);
+	virtual void proc8();
+	virtual bool loadResource(const Common::String &name);
+	virtual void proc10();
+	virtual void draw();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_IMAGE_H */
diff --git a/engines/titanic/support/image_decoders.cpp b/engines/titanic/support/image_decoders.cpp
new file mode 100644
index 0000000..9fe55eb
--- /dev/null
+++ b/engines/titanic/support/image_decoders.cpp
@@ -0,0 +1,79 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/image_decoders.h"
+
+namespace Titanic {
+
+void CJPEGDecode::decode(OSVideoSurface &surface, const CString &name) {
+	// Open up the resource
+	StdCWadFile file;
+	file.open(name);
+
+	// Use the ScucmmVM deoder to decode it
+	loadStream(*file.readStream());
+	const Graphics::Surface *srcSurf = getSurface();
+	
+	// Resize the surface if necessary
+	if (!surface.hasSurface() || surface.getWidth() != srcSurf->w 
+			|| surface.getHeight() != srcSurf->h)
+		surface.resize(srcSurf->w, srcSurf->h);
+
+	// Convert the decoded surface to the correct pixel format, and then copy it over
+	surface.lock();
+	Graphics::Surface *convertedSurface = srcSurf->convertTo(surface._rawSurface->format);
+
+	Common::copy((byte *)convertedSurface->getPixels(), (byte *)convertedSurface->getPixels() +
+		surface.getPitch() * surface.getHeight(), (byte *)surface._rawSurface->getPixels());
+
+	delete convertedSurface;
+	surface.unlock();
+}
+
+/*------------------------------------------------------------------------*/
+
+void CTargaDecode::decode(OSVideoSurface &surface, const CString &name) {
+	// Open up the resource
+	StdCWadFile file;
+	file.open(name);
+
+	// Use the ScucmmVM deoder to decode it
+	loadStream(*file.readStream());
+	const Graphics::Surface *srcSurf = getSurface();
+
+	// Resize the surface if necessary
+	if (!surface.hasSurface() || surface.getWidth() != srcSurf->w
+			|| surface.getHeight() != srcSurf->h)
+		surface.resize(srcSurf->w, srcSurf->h);
+
+	// Convert the decoded surface to the correct pixel format, and then copy it over
+	surface.lock();
+	Graphics::Surface *convertedSurface = srcSurf->convertTo(surface._rawSurface->format);
+
+	Common::copy((byte *)convertedSurface->getPixels(), (byte *)convertedSurface->getPixels() +
+		surface.getPitch() * surface.getHeight(), (byte *)surface._rawSurface->getPixels());
+
+	delete convertedSurface;
+	surface.unlock();
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/image_decoders.h b/engines/titanic/support/image_decoders.h
new file mode 100644
index 0000000..b824b78
--- /dev/null
+++ b/engines/titanic/support/image_decoders.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_IMAGE_DECODERS_H
+#define TITANIC_IMAGE_DECODERS_H
+
+#include "image/jpeg.h"
+#include "image/tga.h"
+#include "titanic/support/string.h"
+#include "titanic/support/simple_file.h"
+#include "titanic/support/video_surface.h"
+
+namespace Titanic {
+
+class CJPEGDecode : public Image::JPEGDecoder {
+public:
+	/**
+	 * Decode the image file onto the passed surface
+	 */
+	void decode(OSVideoSurface &surface, const CString &name);
+};
+
+class CTargaDecode : public Image::TGADecoder {
+public:
+	/**
+	* Decode the image file onto the passed surface
+	*/
+	void decode(OSVideoSurface &surface, const CString &name);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_IMAGE_DECODERS_H */
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
new file mode 100644
index 0000000..dda16c3
--- /dev/null
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -0,0 +1,113 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "graphics/cursorman.h"
+#include "common/textconsole.h"
+#include "titanic/support/mouse_cursor.h"
+#include "titanic/support/movie.h"
+#include "titanic/support/screen_manager.h"
+#include "titanic/titanic.h"
+#include "titanic/support/video_surface.h"
+#include "titanic/core/resource_key.h"
+
+namespace Titanic {
+
+static const int CURSOR_DATA[NUM_CURSORS][4] = {
+	{ 1, 136, 19, 18 },
+	{ 2, 139, 1, 1 },
+	{ 3, 140, 32, 1 },
+	{ 4, 137, 13, 0 },
+	{ 5, 145, 13, 0 },
+	{ 6, 144, 13, 22 },
+	{ 7, 137, 14, 0 },
+	{ 8, 148, 22, 40 },
+	{ 9, 136, 19, 18 },
+	{ 10, 143, 11, 11 },
+	{ 11, 146, 11, 11 },
+	{ 12, 136, 19, 18 },
+	{ 13, 136, 19, 25 },
+	{ 14, 136, 13, 22 },
+	{ 15, 138, 20, 28 }
+};
+
+CMouseCursor::CMouseCursor(CScreenManager *screenManager) : 
+		_screenManager(screenManager), _cursorId(CURSOR_15) {
+	loadCursorImages();
+	setCursor(CURSOR_1);
+}
+
+CMouseCursor::~CMouseCursor() {
+	for (int idx = 0; idx < NUM_CURSORS; ++idx)
+		delete _cursors[idx]._videoSurface;
+}
+
+void CMouseCursor::loadCursorImages() {
+	const CString name("ycursors.avi");
+	const CResourceKey key(name);
+	g_vm->_filesManager.fn4(name);
+
+	// Iterate through each cursor
+	for (int idx = 0; idx < NUM_CURSORS; ++idx) {
+		assert(CURSOR_DATA[idx][0] == (idx + 1));
+		_cursors[idx]._centroid = Common::Point(CURSOR_DATA[idx][2],
+			CURSOR_DATA[idx][3]);
+
+		CVideoSurface *surface = _screenManager->createSurface(64, 64);
+		_cursors[idx]._videoSurface = surface;
+
+		OSMovie movie(key, surface);
+		movie.setFrame(idx);
+		_cursors[idx]._ptrUnknown = movie.proc21();
+		surface->set40(_cursors[idx]._ptrUnknown);
+	}
+}
+
+void CMouseCursor::show() {
+	CursorMan.showMouse(true);
+}
+
+void CMouseCursor::hide() {
+	CursorMan.showMouse(false);
+}
+
+void CMouseCursor::setCursor(CursorId cursorId) {
+	if (cursorId != _cursorId) {
+		CursorEntry &ce = _cursors[cursorId - 1];
+		CVideoSurface &surface = *ce._videoSurface;
+		surface.lock();
+
+		// ***DEBUG*** Dummy cursor
+		Common::fill(surface.getPixels(), surface.getPixels() + 128, 0x5555);
+
+		CursorMan.replaceCursor(surface.getPixels(), surface.getWidth(), surface.getHeight(),
+			ce._centroid.x, ce._centroid.y, 0, false, &g_vm->_screen->format);
+		surface.unlock();
+
+		_cursorId = cursorId;
+	}
+}
+
+void CMouseCursor::update() {
+	// No implementation needed
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h
new file mode 100644
index 0000000..507f4ec
--- /dev/null
+++ b/engines/titanic/support/mouse_cursor.h
@@ -0,0 +1,97 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOUSE_CURSOR_H
+#define TITANIC_MOUSE_CURSOR_H
+
+#include "common/scummsys.h"
+#include "common/rect.h"
+
+namespace Titanic {
+
+#define NUM_CURSORS 15
+
+enum CursorId {
+	CURSOR_1 = 1,
+	CURSOR_2 = 3,
+	CURSOR_3 = 3,
+	CURSOR_4 = 4,
+	CURSOR_5 = 5,
+	CURSOR_6 = 6,
+	CURSOR_7 = 7,
+	CURSOR_8 = 8,
+	CURSOR_9 = 9,
+	CURSOR_10 = 10,
+	CURSOR_11 = 11,
+	CURSOR_12 = 12,
+	CURSOR_13 = 13,
+	CURSOR_14 = 14,
+	CURSOR_15 = 15
+};
+
+class CScreenManager;
+class CVideoSurface;
+
+class CMouseCursor {
+	struct CursorEntry {
+		CVideoSurface *_videoSurface;
+		void *_ptrUnknown;
+		Common::Point _centroid;
+	};
+private:
+	CScreenManager *_screenManager;
+	CursorId _cursorId;
+	CursorEntry _cursors[NUM_CURSORS];
+
+	/**
+	 * Load the images for each cursor
+	 */
+	void loadCursorImages();
+public:
+	CMouseCursor(CScreenManager *screenManager);
+	~CMouseCursor();
+
+	/**
+	 * Make the mouse cursor visible
+	 */
+	void show();
+
+	/**
+	 * Hide the mouse cursor
+	 */
+	void hide();
+	
+	/**
+	 * Set the cursor
+	 */
+	void setCursor(CursorId cursorId);
+	
+	/**
+	 * Updates the mouse cursor
+	 */
+	void update();
+};
+
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOUSE_CURSOR_H */
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
new file mode 100644
index 0000000..ed5cffa
--- /dev/null
+++ b/engines/titanic/support/movie.cpp
@@ -0,0 +1,114 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/movie.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+CMovie::CMovie() : ListItem(), _state(0), _field10(0) {
+}
+
+bool CMovie::isActive() const {
+	return g_vm->_movieList.contains(this);
+}
+
+bool CMovie::get10() {
+	if (_field10) {
+		_field10 = 0;
+		return true;
+	} else {
+		return false;
+	}
+}
+
+/*------------------------------------------------------------------------*/
+
+OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) : _videoSurface(surface) {
+//	_aviDecoder.loadFile(name.getString());
+}
+
+void OSMovie::proc8(int v1, CVideoSurface *surface) {
+	warning("TODO: OSMovie::proc8");
+}
+
+void OSMovie::proc9() {
+	warning("TODO: OSMovie::proc9");
+}
+
+void OSMovie::proc10() {
+	warning("TODO: OSMovie::proc10");
+}
+
+void OSMovie::proc11() {
+	warning("TODO: OSMovie::proc11");
+}
+
+void OSMovie::proc12() {
+	warning("TODO: OSMovie::proc12");
+}
+
+void OSMovie::stop() {
+	warning("TODO: OSMovie::proc13");
+}
+
+void OSMovie::proc14() {
+	warning("TODO: OSMovie::proc14");
+}
+
+void OSMovie::setFrame(uint frameNumber) {
+	warning("TODO: OSMovie::setFrame");
+	/*
+	_aviDecoder.seekToFrame(frameNumber);
+	const Graphics::Surface *s = _aviDecoder.decodeNextFrame();
+
+	_videoSurface->blitFrom(Common::Point(0, 0), s);
+	*/
+}
+
+void OSMovie::proc16() {
+	warning("TODO: OSMovie::proc16");
+}
+
+void OSMovie::proc17() {
+	warning("TODO: OSMovie::proc17");
+}
+
+void OSMovie::proc18() {
+	warning("TODO: OSMovie::proc18");
+}
+
+int OSMovie::proc19() {
+	warning("TODO: OSMovie::proc19");
+	return 0;
+}
+
+void OSMovie::proc20() {
+	warning("TODO: OSMovie::proc20");
+}
+
+void *OSMovie::proc21() {
+	warning("TODO: OSMovie::proc21");
+	return nullptr;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
new file mode 100644
index 0000000..3529409
--- /dev/null
+++ b/engines/titanic/support/movie.h
@@ -0,0 +1,95 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVIE_H
+#define TITANIC_MOVIE_H
+
+#include "video/avi_decoder.h"
+#include "titanic/core/list.h"
+#include "titanic/core/resource_key.h"
+
+namespace Titanic {
+
+class CVideoSurface;
+
+class CMovie : public ListItem {
+protected:
+	int _state;
+	int _field10;
+public:
+	CMovie();
+
+	virtual void proc8(int v1, CVideoSurface *surface) = 0;
+	virtual void proc9() = 0;
+	virtual void proc10() = 0;
+	virtual void proc11() = 0;
+	virtual void proc12() = 0;
+	virtual void stop() = 0;
+	virtual void proc14() = 0;
+	virtual void setFrame(uint frameNumber) = 0;
+	virtual void proc16() = 0;
+	virtual void proc17() = 0;
+	virtual void proc18() = 0;
+	virtual int proc19() = 0;
+	virtual void proc20() = 0;
+	virtual void *proc21() = 0;
+
+	bool isActive() const;
+
+	bool get10();
+};
+
+class OSMovie : public CMovie {
+private:
+	Video::AVIDecoder _aviDecoder;
+	CVideoSurface *_videoSurface;
+public:
+	OSMovie(const CResourceKey &name, CVideoSurface *surface);
+
+	virtual void proc8(int v1, CVideoSurface *surface);
+	virtual void proc9();
+	virtual void proc10();
+	virtual void proc11();
+	virtual void proc12();
+	virtual void stop();
+	virtual void proc14();
+
+	/**
+	 * Set the current frame number
+	 */
+	virtual void setFrame(uint frameNumber);
+	
+	virtual void proc16();
+	virtual void proc17();
+	virtual void proc18();
+	virtual int proc19();
+	virtual void proc20();
+	virtual void *proc21();
+};
+
+class CGlobalMovies : public List<CMovie> {
+public:
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVIE_H */
diff --git a/engines/titanic/support/rect.cpp b/engines/titanic/support/rect.cpp
new file mode 100644
index 0000000..5fce440
--- /dev/null
+++ b/engines/titanic/support/rect.cpp
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/rect.h"
+
+namespace Titanic {
+
+void Rect::combine(const Rect &r) {
+	if (isEmpty() || r.isEmpty())
+		return;
+
+	Common::Rect::extend(r);
+}
+
+void Rect::constrain(const Rect &r) {
+	if (!isEmpty()) {
+		if (r.isEmpty()) {
+			clear();
+		} else {
+			Common::Rect::clip(r);
+		}
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/rect.h b/engines/titanic/support/rect.h
new file mode 100644
index 0000000..1661711
--- /dev/null
+++ b/engines/titanic/support/rect.h
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RECT_H
+#define TITANIC_RECT_H
+
+#include "common/rect.h"
+
+namespace Titanic {
+
+typedef Common::Point Point;
+
+class Rect : public Common::Rect {
+public:
+	Rect() : Common::Rect() {}
+	Rect(int16 w, int16 h) : Common::Rect(w, h) {}
+	Rect(int16 x1, int16 y1, int16 x2, int16 y2) : Common::Rect(x1, y1, x2, y2) {}
+
+	/**
+	 * Returns the top/left corner of the rect as a point
+	 */
+	operator const Point() { return Point(left, top); }
+
+	/**
+	 * Clear the rect
+	 */
+	void clear() { left = top = right = bottom = 0; }
+
+	/**
+	 * Combine another rect into this one
+	 */
+	void combine(const Rect &r);
+
+	/**
+	 * Constrains/clips to the intersection area of the given rect
+	 */
+	void constrain(const Rect &r);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RECT_H */
diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp
new file mode 100644
index 0000000..05dfa66
--- /dev/null
+++ b/engines/titanic/support/screen_manager.cpp
@@ -0,0 +1,265 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/screen_manager.h"
+#include "titanic/titanic.h"
+#include "titanic/support/video_surface.h"
+
+namespace Titanic {
+
+CScreenManager *CScreenManager::_screenManagerPtr;
+CScreenManager *CScreenManager::_currentScreenManagerPtr;
+
+CScreenManager::CScreenManager(TitanicEngine *vm): _vm(vm) {
+	_screenManagerPtr = nullptr;
+	_currentScreenManagerPtr = nullptr;
+
+	_frontRenderSurface = nullptr;
+	_mouseCursor = nullptr;
+	_textCursor = nullptr;
+	_inputHandler = nullptr;
+	_fontNumber = 0;
+	// TODO: Further initialization
+
+	_screenManagerPtr = this;
+}
+
+CScreenManager::~CScreenManager() {
+	_screenManagerPtr = nullptr;
+}
+
+void CScreenManager::setWindowHandle(int v) {
+	// Not needed
+}
+
+bool CScreenManager::resetWindowHandle(int v) {
+	hideCursor();
+	return true;
+}
+
+CScreenManager *CScreenManager::setCurrent() {
+	if (!_currentScreenManagerPtr)
+		_currentScreenManagerPtr = _screenManagerPtr;
+
+	return _currentScreenManagerPtr;
+}
+
+void CScreenManager::setSurfaceBounds(SurfaceNum surfaceNum, const Rect &r) {
+	if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
+		_backSurfaces[surfaceNum]._bounds = r;
+}
+
+/*------------------------------------------------------------------------*/
+
+OSScreenManager::OSScreenManager(TitanicEngine *vm): CScreenManager(vm),
+		_directDrawManager(vm, false) {
+	_field48 = 0;
+	_field4C = 0;
+	_field50 = 0;
+	_field54 = 0;
+}
+
+OSScreenManager::~OSScreenManager() {
+	destroyFrontAndBackBuffers();
+	delete _mouseCursor;
+	delete _textCursor;
+}
+
+void OSScreenManager::setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) {
+	assert(bpp == 16);
+	destroyFrontAndBackBuffers();
+	_directDrawManager.initVideo(width, height, bpp, numBackSurfaces);
+
+	_vm->_screen->create(width, height, g_system->getScreenFormat());
+	_frontRenderSurface = new OSVideoSurface(this, nullptr);
+	_frontRenderSurface->setSurface(this, _directDrawManager._mainSurface);
+
+	_backSurfaces.resize(numBackSurfaces);
+	for (uint idx = 0; idx < numBackSurfaces; ++idx) {
+		_backSurfaces[idx]._surface = new OSVideoSurface(this, nullptr);
+		_backSurfaces[idx]._surface->setSurface(this, _directDrawManager._backSurfaces[idx]);
+	}
+
+	// Load fonts
+	_fonts[0].load(149);
+	_fonts[1].load(151);
+	_fonts[2].load(152);
+	_fonts[3].load(153);
+
+	// Load the cursors
+	loadCursors();
+}
+
+void OSScreenManager::drawCursors() {
+	warning("OSScreenManager::drawCursors");
+}
+
+DirectDrawSurface *OSScreenManager::getDDSurface(SurfaceNum surfaceNum) {
+	if (surfaceNum == SURFACE_PRIMARY)
+		return _directDrawManager._mainSurface;
+	else if (surfaceNum < (int)_backSurfaces.size())
+		return _directDrawManager._backSurfaces[surfaceNum];
+	else
+		return nullptr;
+}
+
+void OSScreenManager::proc6() {}
+void OSScreenManager::proc7() {}
+
+CVideoSurface *OSScreenManager::getSurface(SurfaceNum surfaceNum) const {
+	if (surfaceNum == SURFACE_PRIMARY)
+		return _frontRenderSurface;
+	else if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
+		return _backSurfaces[surfaceNum]._surface;
+	else
+		return nullptr;
+}
+
+void OSScreenManager::proc9() {}
+
+void OSScreenManager::fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g, byte b) {
+	DirectDrawSurface *surface = getDDSurface(surfaceNum);
+	if (!surface)
+		return;
+
+	// If bounds are provided, clip and use them. Otherwise, use entire surface area
+	Rect surfaceRect(0, 0, surface->getWidth(), surface->getHeight());
+	Rect tempRect;
+
+	if (rect) {
+		tempRect = *rect;
+		tempRect.clip(surfaceRect);
+	} else {
+		tempRect = surfaceRect;
+	}
+
+	if (tempRect.isValidRect())
+		surface->fillRect(&tempRect, r, g, b);
+}
+
+void OSScreenManager::blitFrom(SurfaceNum surfaceNum, CVideoSurface *src,
+	const Point *destPos, const Rect *srcRect) {
+	// Get the dest surface
+	CVideoSurface *destSurface = _frontRenderSurface;
+	if (surfaceNum < -1)
+		return;
+	if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
+		destSurface = _backSurfaces[surfaceNum]._surface;
+	if (!destSurface->hasSurface())
+		return;
+	
+	Point destPoint = destPos ? *destPos : Point(0, 0);
+	Rect srcBounds = srcRect ? *srcRect : Rect(0, 0, src->getWidth(), src->getHeight());
+	Rect *bounds = &srcBounds;
+	Rect rect2;
+
+	if (surfaceNum >= 0 && !_backSurfaces[surfaceNum]._bounds.isEmpty()) {
+		// Perform clipping to the bounds of the back surface
+		rect2 = srcBounds;
+		rect2.translate(-srcBounds.left, -srcBounds.top);
+		rect2.translate(destPoint.x, destPoint.y);
+		rect2.constrain(_backSurfaces[surfaceNum]._bounds);
+
+		rect2.translate(-destPoint.x, -destPoint.y);
+		rect2.translate(srcBounds.left, srcBounds.top);
+
+		if (rect2.isEmpty())
+			return;
+
+		destPoint.x += rect2.left - srcBounds.left;
+		destPoint.y += rect2.top - srcBounds.top;
+		bounds = &rect2;
+	}
+
+	if (!bounds->isEmpty())
+		destSurface->blitFrom(destPoint, src, bounds);
+}
+
+void OSScreenManager::proc12() {}
+void OSScreenManager::proc13() {}
+void OSScreenManager::proc14() {}
+void OSScreenManager::proc15() {}
+
+void OSScreenManager::writeString(int maxWidth, const CString &text, int *v1, int *v2) {
+	_fonts[_fontNumber].writeString(maxWidth, text, v1, v2);
+}
+
+void OSScreenManager::getFont() {}
+void OSScreenManager::proc18() {}
+void OSScreenManager::proc19() {}
+
+void OSScreenManager::clearSurface(SurfaceNum surfaceNum, Rect *bounds) {
+	if (surfaceNum == SURFACE_PRIMARY)
+		_directDrawManager._mainSurface->fill(bounds, 0);
+	else if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
+		_directDrawManager._backSurfaces[surfaceNum]->fill(bounds, 0);
+}
+
+void OSScreenManager::resizeSurface(CVideoSurface *surface, int width, int height) {
+	DirectDrawSurface *ddSurface = _directDrawManager.createSurface(width, height, 0);
+	surface->setSurface(this, ddSurface);
+}
+
+CVideoSurface *OSScreenManager::createSurface(int w, int h) {
+	DirectDrawSurface *ddSurface = _directDrawManager.createSurface(w, h, 0);
+	return new OSVideoSurface(this, ddSurface);
+}
+
+CVideoSurface *OSScreenManager::createSurface(const CResourceKey &key) {
+	return new OSVideoSurface(this, key);
+}
+
+void OSScreenManager::proc23() {}
+void OSScreenManager::proc24() {}
+void OSScreenManager::proc25() {}
+
+void OSScreenManager::showCursor() {
+
+}
+
+void OSScreenManager::hideCursor() {
+
+}
+
+void OSScreenManager::destroyFrontAndBackBuffers() {
+	delete _frontRenderSurface;
+	_frontRenderSurface = nullptr;
+
+	for (uint idx = 0; idx < _backSurfaces.size(); ++idx)
+		delete _backSurfaces[idx]._surface;
+	_backSurfaces.clear();
+}
+
+void OSScreenManager::loadCursors() {
+	if (_mouseCursor) {
+		hideCursor();
+		delete _mouseCursor;
+	}
+	_mouseCursor = new CMouseCursor(this);
+	showCursor();
+
+	if (!_textCursor) {
+		_textCursor = new CTextCursor();
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/screen_manager.h b/engines/titanic/support/screen_manager.h
new file mode 100644
index 0000000..affe2ec
--- /dev/null
+++ b/engines/titanic/support/screen_manager.h
@@ -0,0 +1,248 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SCREEN_MANAGER_H
+#define TITANIC_SCREEN_MANAGER_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "titanic/support/direct_draw.h"
+#include "titanic/support/font.h"
+#include "titanic/input_handler.h"
+#include "titanic/support/mouse_cursor.h"
+#include "titanic/support/text_cursor.h"
+#include "titanic/support/video_surface.h"
+#include "titanic/core/resource_key.h"
+
+namespace Titanic {
+
+/**
+ * The original used page flipping with one primary and one back buffer.
+ * Since we don't need that in ScummVM, the back buffer number below is
+ * remapped to the primary surface
+ */
+enum SurfaceNum {
+	SURFACE_PRIMARY = -1,
+	SURFACE_BACKBUFFER = -1
+};
+
+class TitanicEngine;
+
+class CScreenManager {
+	struct VideoSurfaceEntry {
+		CVideoSurface *_surface;
+		Rect _bounds;
+	};
+protected:
+	TitanicEngine *_vm;
+public:
+	static CScreenManager *_screenManagerPtr;
+	static CScreenManager *_currentScreenManagerPtr;
+
+	/**
+	 * Set the current screen manager
+	 */
+	static CScreenManager *setCurrent();
+public:
+	Common::Array<VideoSurfaceEntry> _backSurfaces;
+	CVideoSurface *_frontRenderSurface;
+	CMouseCursor *_mouseCursor;
+	CTextCursor *_textCursor;
+	CInputHandler *_inputHandler;
+	int _fontNumber;
+public:
+	CScreenManager(TitanicEngine *vm);
+	virtual ~CScreenManager();
+
+	void fn1() {}
+	void fn2() {}
+
+	virtual void setWindowHandle(int v);
+	virtual bool resetWindowHandle(int v);
+	
+	/**
+	 * Sets the video mode
+	 */
+	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2) = 0;
+
+	/**
+	 * Handles drawing the cursors
+	 */
+	virtual void drawCursors() = 0;
+	
+	virtual void proc6() = 0;
+	virtual void proc7() = 0;
+	virtual CVideoSurface *getSurface(SurfaceNum surfaceNum) const = 0;
+	virtual void proc9() = 0;
+	
+	/**
+	 * Fill an area with a specific color
+	 */
+	virtual void fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g, byte b) = 0;
+
+	/**
+	 * Blits a surface onto one of the screen surfaces
+	 */
+	virtual void blitFrom(SurfaceNum surfaceNum, CVideoSurface *src, const Point *destPos = nullptr,
+		const Rect *srcRect = nullptr) = 0;
+
+	virtual void proc12() = 0;
+	virtual void proc13() = 0;
+	virtual void proc14() = 0;
+	virtual void proc15() = 0;
+
+
+	/**
+	 * Write out a string
+	 */
+	virtual void writeString(int maxWidth, const CString &text, int *v1, int *v2) = 0;
+
+	virtual void getFont() = 0;
+	virtual void proc18() = 0;
+	virtual void proc19() = 0;
+
+	/**
+	 * Clear a portion of a specified surface
+	 */
+	virtual void clearSurface(SurfaceNum surfaceNum, Rect *_bounds) = 0;
+
+	/**
+	 * Resize the passed surface
+	 */
+	virtual void resizeSurface(CVideoSurface *surface, int width, int height) = 0;
+
+	/**
+	 * Creates a surface of a given size
+	 */
+	virtual CVideoSurface *createSurface(int w, int h) = 0;
+	
+	/**
+	 * Creates a surface from a specified resource
+	 */
+	virtual CVideoSurface *createSurface(const CResourceKey &key) = 0;
+	
+	virtual void proc24() = 0;
+	virtual void proc25() = 0;
+	virtual void showCursor() = 0;
+	virtual void hideCursor() = 0;
+
+	void setSurfaceBounds(SurfaceNum surfaceNum, const Rect &r);
+};
+
+class OSScreenManager: CScreenManager {
+private:
+	DirectDrawManager _directDrawManager;
+
+	/**
+	 * Frees any surface buffers
+	 */
+	void destroyFrontAndBackBuffers();
+
+	/**
+	 * Load game cursors
+	 */
+	void loadCursors();
+
+	/**
+	 * Gets an underlying surface
+	 */
+	DirectDrawSurface *getDDSurface(SurfaceNum surfaceNum);
+public:
+	int _field48;
+	int _field4C;
+	int _field50;
+	int _field54;
+	STFont _fonts[4];
+public:
+	OSScreenManager(TitanicEngine *vm);
+	virtual ~OSScreenManager();
+
+	/**
+	 * Sets the video mode
+	 */
+	virtual void setMode(int width, int height, int bpp, uint numBackSurfaces, bool flag2);
+
+	/**
+	 * Handles drawing the cursors
+	 */
+	virtual void drawCursors();
+
+	virtual void proc6();
+	virtual void proc7();
+	virtual CVideoSurface *getSurface(SurfaceNum surfaceNum) const;
+	virtual void proc9();
+
+	/**
+	 * Fill an area with a specific color
+	 */
+	virtual void fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g, byte b);
+
+	/**
+	 * Blits a surface onto one of the screen surfaces
+	 */
+	virtual void blitFrom(SurfaceNum surfaceNum, CVideoSurface *src, const Point *destPos,
+		const Rect *srcRect = nullptr);
+
+	virtual void proc12();
+	virtual void proc13();
+	virtual void proc14();
+	virtual void proc15();
+
+	/**
+	 * Write out a string
+	 */
+	virtual void writeString(int maxWidth, const CString &text, int *v1, int *v2);
+
+	virtual void getFont();
+	virtual void proc18();
+	virtual void proc19();
+
+	/**
+	 * Clear a portion of the screen surface
+	 */
+	virtual void clearSurface(SurfaceNum surfaceNum, Rect *bounds);
+
+	/**
+	 * Resize the passed surface
+	 */
+	virtual void resizeSurface(CVideoSurface *surface, int width, int height);
+
+	/**
+	 * Creates a surface of a given size
+	 */
+	virtual CVideoSurface *createSurface(int w, int h);
+	
+	/**
+	 * Creates a surface from a specified resource
+	 */
+	virtual CVideoSurface *createSurface(const CResourceKey &key);
+
+	virtual void proc23();
+	virtual void proc24();
+	virtual void proc25();
+	virtual void showCursor();
+	virtual void hideCursor();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SCREEN_MANAGER_H */
diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp
new file mode 100644
index 0000000..fccf6c5
--- /dev/null
+++ b/engines/titanic/support/simple_file.cpp
@@ -0,0 +1,385 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/util.h"
+#include "titanic/support/simple_file.h"
+
+namespace Titanic {
+
+bool File::open(const Common::String &name) {
+	if (!Common::File::open(name))
+		error("Could not open file - %s", name.c_str());
+	return true;
+}
+
+/*------------------------------------------------------------------------*/
+
+SimpleFile::SimpleFile(): _inStream(nullptr), _outStream(nullptr), _lineCount(1) {
+}
+
+SimpleFile::~SimpleFile() {
+	close();
+}
+
+void SimpleFile::open(Common::SeekableReadStream *stream) {
+	close();	
+	_inStream = stream;
+}
+
+void SimpleFile::open(Common::OutSaveFile *stream) {
+	close();
+	_outStream = stream;
+}
+
+void SimpleFile::close() {
+	if (_outStream) {
+		_outStream->finalize();
+		delete _outStream;
+		_outStream = nullptr;
+	}
+
+	if (_inStream) {
+		delete _inStream;
+		_inStream = nullptr;
+	}
+}
+
+void SimpleFile::safeRead(void *dst, size_t count) {
+	if (unsafeRead(dst, count) != count)
+		error("Could not read %d bytes", (int)count);
+}
+
+size_t SimpleFile::unsafeRead(void *dst, size_t count) {
+	assert(_inStream);
+	return _inStream->read(dst, count);
+}
+
+size_t SimpleFile::write(const void *src, size_t count) {
+	assert(_outStream);
+	return _outStream->write(src, count);
+}
+
+CString SimpleFile::readString() {
+	char c;
+	CString result;
+	bool backslashFlag = false;
+
+	// First skip any spaces
+	do {
+		safeRead(&c, 1);
+	} while (Common::isSpace(c));
+
+	// Ensure we've found a starting quote for the string
+	if (c != '"')
+		error("Could not find starting quote");
+
+	bool endFlag = false;
+	while (!endFlag) {
+		// Read the next character
+		safeRead(&c, 1);
+
+		if (backslashFlag) {
+			backslashFlag = false;
+			switch (c) {
+			case 'n':
+				result += '\n';
+				break;
+			case 'r':
+				result += '\r';
+				break;
+			case '\t':
+				result += '\t';
+				break;
+			default:
+				result += c;
+				break;
+			}
+		} else {
+			switch (c) {
+			case '"':
+				endFlag = true;
+				break;
+			case '\\':
+				backslashFlag = true;
+				break;
+			default:
+				result += c;
+				break;
+			}
+		}
+	}
+
+	// Return the string
+	return result;
+}
+
+int SimpleFile::readNumber() {
+	char c;
+	int result = 0;
+	bool minusFlag = false;
+
+	// First skip any spaces
+	do {
+		safeRead(&c, 1);
+	} while (Common::isSpace(c));
+
+	// Check for prefix sign
+	if (c == '+' || c == '-') {
+		minusFlag = c == '-';
+		safeRead(&c, 1);
+	}
+
+	// Read in the number
+	if (!Common::isDigit(c))
+		error("Invalid number");
+
+	while (Common::isDigit(c)) {
+		result = result * 10 + (c - '0');
+		safeRead(&c, 1);
+	}
+
+	// Finally, if it's a minus value, then negate it
+	if (minusFlag)
+		result = -result;
+
+	return result;
+}
+
+double SimpleFile::readFloat() {
+	char c;
+	Common::String result;
+
+	// First skip any spaces
+	do {
+		safeRead(&c, 1);
+	} while (Common::isSpace(c));
+
+	// Check for prefix sign
+	if (c == '+' || c == '-') {
+		result += c;
+		safeRead(&c, 1);
+	}
+
+	// Read in the number
+	if (!Common::isDigit(c))
+		error("Invalid number");
+
+	while (Common::isDigit(c) || c == '.') {
+		result += c;
+		safeRead(&c, 1);
+	}
+
+	// Convert to a float and return it
+	float floatValue;
+	sscanf(result.c_str(), "%f", &floatValue);
+
+	return floatValue;
+}
+
+Point SimpleFile::readPoint() {
+	Point pt;
+	pt.x = readNumber();
+	pt.y = readNumber();
+
+	return pt;
+}
+
+Rect SimpleFile::readRect() {
+	Rect r;
+	r.left = readNumber();
+	r.top = readNumber();
+	r.right = readNumber();
+	r.bottom = readNumber();
+
+	return r;
+}
+
+void SimpleFile::readBuffer(char *buffer, size_t count) {
+	CString tempString = readString();
+	if (buffer) {
+		strncpy(buffer, tempString.c_str(), count);
+		buffer[count - 1] = '\0';
+	}
+}
+
+void SimpleFile::writeLine(const CString &str) {
+	write(str.c_str(), str.size());
+	write("\r\n", 2);
+}
+
+void SimpleFile::writeString(const CString &str) {
+	if (str.empty())
+		return;
+
+	const char *msgP = str.c_str();
+	char c;
+	
+	while ((c = *msgP++) != '\0') {
+		switch (c) {
+		case '\r':
+			write("\\r", 2);
+			break;
+		case '\n':
+			write("\\n", 2);
+			break;
+		case '\t':
+			write("\\t", 2);
+			break;
+		case '\"':
+			write("\\\"", 2);
+			break;
+		case '\\':
+			write("\\\\", 2);
+			break;
+		case '{':
+			write("\\{", 2);
+			break;
+		case '}':
+			write("\\}", 2);
+			break;
+		default:
+			write(&c, 1);
+			break;
+		}
+	}
+}
+
+void SimpleFile::writeQuotedString(const CString &str) {
+	write("\"", 1);
+	writeString(str);
+	write("\" ", 2);
+}
+
+void SimpleFile::writeQuotedLine(const CString &str, int indent) {
+	writeIndent(indent);
+	writeQuotedString(str);
+	write("\n", 1);
+}
+
+void SimpleFile::writeNumber(int val) {
+	CString str = CString::format("%d ", val);
+	write(str.c_str(), str.size());
+}
+
+void SimpleFile::writeNumberLine(int val, int indent) {
+	writeIndent(indent);
+	writeNumber(val);
+	write("\n", 1);
+}
+
+void SimpleFile::writeFloat(double val) {
+	Common::String valStr = Common::String::format("%f ", val);
+	write(valStr.c_str(), valStr.size());
+}
+
+void SimpleFile::writeFloatLine(double val, int indent) {
+	writeIndent(indent);
+	writeFloat(val);
+	write("\n", 1);
+}
+
+void SimpleFile::writePoint(const Point &pt, int indent) {
+	writeIndent(indent);
+	writeNumber(pt.x);
+	writeNumber(pt.y);
+	write("\n", 1);
+}
+
+void SimpleFile::writeRect(const Rect &r, int indent) {
+	writePoint(Point(r.left, r.top), indent);
+	writePoint(Point(r.right, r.bottom), indent);
+}
+
+void SimpleFile::writeIndent(uint indent) {
+	for (uint idx = 0; idx < indent; ++idx)
+		write("\t", 1);
+}
+
+bool SimpleFile::IsClassStart() {
+	char c;
+
+	do {
+		safeRead(&c, 1);
+	} while (Common::isSpace(c));
+
+	assert(c == '{' || c == '}');
+	return c == '{';
+}
+
+void SimpleFile::writeClassStart(const CString &classStr, int indent) {
+	write("\n", 1);
+	writeIndent(indent);
+	write("{\n", 2);
+	writeIndent(indent + 1);
+	writeQuotedString(classStr);
+	write("\n", 1);
+}
+
+void SimpleFile::writeClassEnd(int indent) {
+	writeIndent(indent);
+	write("}\n", 2);
+}
+
+/*------------------------------------------------------------------------*/
+
+void StdCWadFile::open(const CString &name) {
+	File f;
+
+	// Check for whether it is indeed a file/resource pair
+	int idx = name.indexOf('#');
+
+	if (idx < 0) {
+		// Nope, so open up file for standard reading
+		assert(!name.empty());
+		f.open(name);
+
+		SimpleFile::open(f.readStream(f.size()));
+		return;
+	}
+
+	// Split up the name and resource, and get the resource index
+	CString filename = name.left(idx) + ".st";
+	int extPos = name.lastIndexOf('.');
+	CString resStr = name.mid(idx + 1, extPos - idx - 1);
+	int resIndex = resStr.readInt();
+
+	// Open up the index for access 
+	f.open(filename);
+	int indexSize = f.readUint32LE() / 4;
+	assert(resIndex < indexSize);
+
+	// Get the specific resource's offset, and size by also
+	// getting the offset of the following resource
+	f.seek(resIndex * 4);
+	uint resOffset = f.readUint32LE();
+	uint nextOffset = (resIndex == (indexSize - 1)) ? f.size() :
+		f.readUint32LE();
+
+	// Read in the resource
+	f.seek(resOffset);
+	Common::SeekableReadStream *stream = f.readStream(nextOffset - resOffset);
+	SimpleFile::open(stream);
+
+	f.close();
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/simple_file.h b/engines/titanic/support/simple_file.h
new file mode 100644
index 0000000..0ba7699
--- /dev/null
+++ b/engines/titanic/support/simple_file.h
@@ -0,0 +1,236 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SIMPLE_FILE_H
+#define TITANIC_SIMPLE_FILE_H
+
+#include "common/file.h"
+#include "titanic/support/rect.h"
+#include "common/savefile.h"
+#include "common/stream.h"
+#include "common/zlib.h"
+#include "titanic/support/string.h"
+
+namespace Titanic {
+
+class Decompressor;
+class DecompressorData;
+
+/**
+ * Simple ScummVM File descendent that throws a wobbly if
+ * the file it tries to open isn't present
+ */
+class File : public Common::File {
+public:
+	virtual bool open(const Common::String &name);
+};
+
+/**
+ * This class implements basic reading and writing to files
+ */
+class SimpleFile {
+protected:
+	Common::SeekableReadStream *_inStream;
+	Common::OutSaveFile *_outStream;
+	int _lineCount;
+public:
+	SimpleFile();
+	virtual ~SimpleFile();
+
+	/**
+	 * Set up a stream for read access
+	 */
+	virtual void open(Common::SeekableReadStream *stream);
+
+	/**
+	 * Set up a stream for write access
+	 */
+	virtual void open(Common::OutSaveFile *stream);
+
+	/**
+	 * Close the file
+	 */
+	virtual void close();
+
+	/**
+	 * Read from the file with validation
+	 */
+	virtual void safeRead(void *dst, size_t count);
+
+	/**
+	 * Read from the file
+	 */
+	virtual size_t unsafeRead(void *dst, size_t count);
+
+	/**
+	 * Write out data
+	 */
+	virtual size_t write(const void *src, size_t count);
+
+	/**
+	 * Read a string from the file
+	 */
+	CString readString();
+
+	/**
+	 * Read a number from the file
+	 */
+	int readNumber();
+
+	/**
+	 * Read a floating point number from the file
+	 */
+	double readFloat();
+
+	/**
+	 * Read in a point
+	 */
+	Point readPoint();
+
+	/**
+	 * Read in a rect
+	 */
+	Rect readRect();
+
+	/**
+	 * Read a string and copy it into an optionally passed buffer
+	 */
+	void readBuffer(char *buffer = nullptr, size_t count = 0);
+
+	/**
+	 * Write a string line
+	 */
+	void writeLine(const CString &str);
+
+	/**
+	 * Write a string
+	 */
+	void writeString(const CString &str);
+
+	/**
+	 * Write a quoted string
+	 */
+	void writeQuotedString(const CString &str);
+
+	/**
+	 * Write a quoted string line
+	 */
+	void writeQuotedLine(const CString &str, int indent);
+
+	/**
+	 * Write a number to file
+	 */
+	void writeNumber(int val);
+
+	/**
+	 * Write a number line to file
+	 */
+	void writeNumberLine(int val, int indent);
+
+	/**
+	 * Write a floating point number
+	 */
+	void writeFloat(double val);
+
+	/**
+	 * Write a floating point number as a line
+	 */
+	void writeFloatLine(double val, int indent);
+
+	/**
+	 * Write out a point line
+	 */
+	void writePoint(const Point &pt, int indent);
+
+	/**
+	 * Write out a rect line
+	 */
+	void writeRect(const Rect &r, int indent);
+
+	/**
+	 * Write out a number of tabs to form an indent in the output
+	 */
+	void writeIndent(uint indent);
+
+	/**
+	 * Validates that the following non-space character is either
+	 * an opening or closing squiggly bracket denoting a class
+	 * definition start or end. Returns true if it's a class start
+	 */
+	bool IsClassStart();
+
+	/**
+	 * Write the starting header for a class definition
+	 */
+	void writeClassStart(const CString &classStr, int indent);
+
+	/**
+	 * Write out the ending footer for a class definition
+	 */
+	void writeClassEnd(int indent);
+};
+
+/**
+ * Derived file that handles compressed files
+ */
+class CompressedFile : public SimpleFile {
+public:
+	CompressedFile() : SimpleFile() {}
+	virtual ~CompressedFile() {}
+
+	/**
+	 * Set up a stream for read access
+	 */
+	virtual void open(Common::SeekableReadStream *stream) {
+		SimpleFile::open(Common::wrapCompressedReadStream(stream));
+	}
+
+	/**
+	 * Set up a stream for write access
+	 */
+	virtual void open(Common::OutSaveFile *stream) {
+		SimpleFile::open(Common::wrapCompressedWriteStream(stream));
+	}
+};
+
+/**
+ * Derived file that handles WAD archives containing multiple files
+ */
+class StdCWadFile : public SimpleFile {
+public:
+	StdCWadFile() : SimpleFile() {}
+	virtual ~StdCWadFile() {}
+
+	/**
+	 * Open up the specified file
+	 */
+	void open(const CString &name);
+
+	/**
+	 * Return a reference to the read stream
+	 */
+	Common::SeekableReadStream *readStream() const { return _inStream; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SIMPLE_FILE_H */
diff --git a/engines/titanic/support/string.cpp b/engines/titanic/support/string.cpp
new file mode 100644
index 0000000..86dc0be
--- /dev/null
+++ b/engines/titanic/support/string.cpp
@@ -0,0 +1,122 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/algorithm.h"
+#include "titanic/support/string.h"
+
+namespace Titanic {
+
+CString::CString(char c, uint32 len) : Common::String() {
+	ensureCapacity(len, false);
+	for (uint idx = 0; idx < len; ++idx)
+		(*this) += c;
+}
+
+CString::CString(int val) : Common::String() {
+	char buffer[16];
+	itoa(val, buffer, 10);
+	*this += buffer;
+}
+
+CString CString::left(uint count) const {
+	return (count > size()) ? CString() : CString(c_str(), c_str() + count);
+}
+
+CString CString::right(uint count) const {
+	uint strSize = size();
+	return (count > strSize) ? CString() : 
+		CString(c_str() + strSize - count, c_str() + strSize);
+}
+
+CString CString::mid(uint start, uint count) const {
+	if (start >= size())
+		return CString();
+	else
+		return CString(c_str() + start, MIN(count, size() - start));
+}
+
+CString CString::mid(uint start) const {
+	uint strSize = size();
+	assert(start <= strSize);
+	return mid(start, strSize - start);
+}
+
+int CString::indexOf(char c) const {
+	const char *charP = strchr(c_str(), c);
+	return charP ? charP - c_str() : -1;
+}
+
+int CString::lastIndexOf(char c) const {
+	const char *charP = strrchr(c_str(), c);
+	return charP ? charP - c_str() : -1;
+}
+
+FileType CString::fileTypeSuffix() const {
+	CString ext = right(1);
+	if (ext == "0" || ext == "4")
+		return FILETYPE_IMAGE;
+	else if (ext == "1")
+		return FILETYPE_WAV;
+	else if (ext == "2" || ext == "3")
+		return FILETYPE_MOVIE;
+	
+	ext = right(3);
+	if (ext == "tga" || ext == "jpg")
+		return FILETYPE_IMAGE;
+	else if (ext == "wav")
+		return FILETYPE_WAV;
+	else if (ext == "avi" || ext == "mov")
+		return FILETYPE_MOVIE;
+	else if (ext == "dlg")
+		return FILETYPE_DLG;
+	else
+		return FILETYPE_UNKNOWN;
+}
+
+ImageType CString::imageTypeSuffix() const {
+	CString ext = right(1);
+	if (ext == "0")
+		return IMAGETYPE_TARGA;
+	else if (ext == "4")
+		return IMAGETYPE_JPEG;
+
+	ext = right(3);
+	if (ext == "tga")
+		return IMAGETYPE_TARGA;
+	else if (ext == "jpg")
+		return IMAGETYPE_JPEG;
+	else
+		return IMAGETYPE_UNKNOWN;
+}
+
+CString CString::format(const char *fmt, ...) {
+	String output;
+
+	va_list va;
+	va_start(va, fmt);
+	output = String::vformat(fmt, va);
+	va_end(va);
+
+	return output;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/string.h b/engines/titanic/support/string.h
new file mode 100644
index 0000000..02775de
--- /dev/null
+++ b/engines/titanic/support/string.h
@@ -0,0 +1,106 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STRING_H
+#define TITANIC_STRING_H
+
+#include "common/scummsys.h"
+#include "common/str.h"
+
+namespace Titanic {
+
+enum FileType {
+	FILETYPE_UNKNOWN = 0, FILETYPE_IMAGE = 1, FILETYPE_MOVIE = 2,
+	FILETYPE_WAV = 3, FILETYPE_DLG = 4
+};
+
+enum ImageType {
+	IMAGETYPE_UNKNOWN = 0, IMAGETYPE_TARGA = 1, IMAGETYPE_JPEG = 2
+};
+
+class CString : public Common::String {
+public:
+	CString() : Common::String() {}
+	CString(const char *str) : Common::String(str) {}
+	CString(const char *str, uint32 len) : Common::String(str, len) {}
+	CString(const char *beginP, const char *endP) : Common::String(beginP, endP) {}
+	CString(const String &str) : Common::String(str) {}
+	CString(char c, uint32 len);
+	explicit CString(char c) : Common::String(c) {}
+	explicit CString(int val);
+
+	/**
+	 * Returns the left n characters of the string
+	 */
+	CString left(uint count) const;
+
+	/**
+	 * Returns the right n characters of the string
+	 */
+	CString right(uint count) const;
+
+	/**
+	 * Returns a substring from within the string
+	 */
+	CString mid(uint start, uint count) const;
+
+	/**
+	 * Returns a substring from within the string
+	 */
+	CString mid(uint start) const;
+
+	/**
+	 * Returns the index of the first occurance of a given character
+	 */
+	int indexOf(char c) const;
+
+	/**
+	 * Returns the index of the last occurance of a given character
+	 */
+	int lastIndexOf(char c) const;
+
+	/**
+	 * Returns the type of a filename based on it's extension
+	 */
+	FileType fileTypeSuffix() const;
+
+	/**
+	 * Returns the type of an image filename based on it's extension
+	 */
+	ImageType imageTypeSuffix() const;
+
+	/**
+	 * Parses the string as an integer and returns the value
+	 */
+	int readInt() const {
+		return atoi(c_str());
+	}
+
+	/**
+	 * Format a string
+	 */
+	static CString format(const char *fmt, ...);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STRING_H */
diff --git a/engines/titanic/support/text_cursor.cpp b/engines/titanic/support/text_cursor.cpp
new file mode 100644
index 0000000..fd0c1d2
--- /dev/null
+++ b/engines/titanic/support/text_cursor.cpp
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/support/text_cursor.h"
+
+namespace Titanic {
+
+CTextCursor::CTextCursor() : _active(false) {
+}
+
+Rect CTextCursor::getBounds() {
+	warning("CTextCursor::getBounds");
+	return Rect();
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/text_cursor.h b/engines/titanic/support/text_cursor.h
new file mode 100644
index 0000000..b648067
--- /dev/null
+++ b/engines/titanic/support/text_cursor.h
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TEXT_CURSOR_H
+#define TITANIC_TEXT_CURSOR_H
+
+#include "common/scummsys.h"
+#include "titanic/support/rect.h"
+
+namespace Titanic {
+
+class CTextCursor {
+public:
+	bool _active;
+public:
+	CTextCursor();
+
+	Rect getBounds();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TEXT_CURSOR_H */
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
new file mode 100644
index 0000000..6bba24d
--- /dev/null
+++ b/engines/titanic/support/video_surface.cpp
@@ -0,0 +1,376 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/video_surface.h"
+#include "titanic/support/image_decoders.h"
+#include "titanic/support/screen_manager.h"
+
+namespace Titanic {
+
+int CVideoSurface::_videoSurfaceCounter = 0;
+
+CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
+		_screenManager(screenManager), _rawSurface(nullptr), _movie(nullptr),
+		_pendingLoad(false), _blitStyleFlag(false), _blitFlag(false),
+		_field40(nullptr), _field44(4), _field48(0), _field50(1) {
+	_videoSurfaceNum = _videoSurfaceCounter++;
+}
+
+CVideoSurface::~CVideoSurface() {
+	if (_ddSurface)
+		_videoSurfaceCounter -= freeSurface();
+	--_videoSurfaceCounter;
+}
+
+void CVideoSurface::setSurface(CScreenManager *screenManager, DirectDrawSurface *surface) {
+	_screenManager = screenManager;
+	_ddSurface = surface;
+}
+
+void CVideoSurface::blitFrom(const Point &destPos, CVideoSurface *src, const Rect *srcRect) {
+	if (loadIfReady() && src->loadIfReady() && _ddSurface && src->_ddSurface) {
+		Rect srcBounds, destBounds;
+		clipBounds(srcBounds, destBounds, src, srcRect, &destPos);
+
+		if (_blitStyleFlag)
+			blitRect2(srcBounds, destBounds, src);
+		else
+			blitRect1(srcBounds, destBounds, src);
+	}
+}
+
+void CVideoSurface::blitFrom(const Point &destPos, const Graphics::Surface *src) {
+	lock();
+	_rawSurface->blitFrom(*src, destPos);
+	unlock();
+}
+
+void CVideoSurface::clipBounds(Rect &srcRect, Rect &destRect,
+		CVideoSurface *srcSurface, const Rect *subRect, const Point *destPos) {
+	// Figure out initial source rect and dest rect, based on whether
+	// specific subRect and/or destPos have been passed
+	if (destPos) {
+		destRect.left = destPos->x;
+		destRect.top = destPos->y;
+	} else {
+		destRect.left = destRect.top = 0;
+	}
+
+	if (subRect) {
+		destRect.right = destRect.left + subRect->width();
+		destRect.bottom = destRect.top + subRect->height();
+		srcRect = *subRect;
+	} else {
+		srcRect.right = srcRect.left + srcSurface->getWidth();
+		srcRect.bottom = srcRect.top + srcSurface->getHeight();
+		srcRect = Rect(0, 0, srcSurface->getWidth(), srcSurface->getHeight());
+	}
+
+	// Clip destination rect to be on-screen
+	if (destRect.left < 0) {
+		srcRect.left -= destRect.left;
+		destRect.left = 0;
+	}
+	if (destRect.top < 0) {
+		srcRect.top -= destRect.top;
+		destRect.top = 0;
+	}
+	if (destRect.right > getWidth()) {
+		srcRect.right += getWidth() - destRect.right;
+		destRect.right = getWidth();
+	}
+	if (destRect.bottom > getHeight()) {
+		srcRect.bottom += getHeight() - destRect.bottom;
+		destRect.bottom = getHeight();
+	}
+
+	// Clip source rect to be within the source surface
+	if (srcRect.left < 0) {
+		destRect.left -= srcRect.left;
+		srcRect.left = 0;
+	}
+	if (srcRect.top < 0) {
+		destRect.top -= srcRect.top;
+		srcRect.top = 0;
+	}
+	if (srcRect.right > srcSurface->getWidth()) {
+		destRect.right += srcSurface->getWidth() - srcRect.right;
+		srcRect.right = srcSurface->getWidth();
+	}
+	if (srcRect.bottom > srcSurface->getHeight()) {
+		destRect.bottom += srcSurface->getHeight() - srcRect.bottom;
+		srcRect.bottom = srcSurface->getHeight();
+	}
+
+	// Validate that the resulting rects are valid
+	if (destRect.left >= destRect.right || destRect.top >= destRect.bottom
+		|| srcRect.left >= srcRect.right || srcRect.top >= srcRect.bottom)
+		error("Invalid rect");
+}
+
+void CVideoSurface::blitRect1(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
+	src->lock();
+	lock();
+
+	// TODO: Do it like the original does it
+	_rawSurface->transBlitFrom(*src->_rawSurface, srcRect, destRect,
+		getTransparencyColor());
+
+	src->unlock();
+	unlock();
+}
+
+void CVideoSurface::blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
+	// TODO: Do it like the original does it
+	blitRect1(srcRect, destRect, src);
+}
+
+uint CVideoSurface::getTransparencyColor() {
+	uint32 val = -(getPixelDepth() - 2);
+	val &= 0xFFFF8400;
+	val += 0xF81F;
+	return val;
+}
+
+bool CVideoSurface::proc45() {
+	if (_field50) {
+		_field50 = 0;
+		return true;
+	} else if (_movie) {
+		return _movie->get10();
+	} else {
+		return false;
+	}
+}
+
+/*------------------------------------------------------------------------*/
+
+OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface) :
+		CVideoSurface(screenManager) {
+	_ddSurface = surface;
+}
+
+OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool pendingLoad) :
+		CVideoSurface(screenManager) {
+	_ddSurface = nullptr;
+	_pendingLoad = pendingLoad;
+	
+	if (_pendingLoad) {
+		loadResource(key);
+	} else {
+		_resourceKey = key;
+		load();
+	}
+}
+
+void OSVideoSurface::loadResource(const CResourceKey &key) {
+	_resourceKey = key;
+	_pendingLoad = true;
+
+	if (hasSurface())
+		load();
+}
+
+void OSVideoSurface::loadTarga(const CResourceKey &key) {
+	// Decode the image
+	CTargaDecode decoder;
+	decoder.decode(*this, key.getString());
+
+	if (getPixelDepth() == 2)
+		shiftColors();
+
+	_resourceKey = key;
+
+}
+
+void OSVideoSurface::loadJPEG(const CResourceKey &key) {
+	// Decode the image
+	CJPEGDecode decoder;
+	decoder.decode(*this, key.getString());
+
+	if (getPixelDepth() == 2)
+		shiftColors();
+
+	_resourceKey = key;
+}
+
+void OSVideoSurface::loadMovie() {
+	warning("TODO");
+}
+
+bool OSVideoSurface::lock() {
+	if (!loadIfReady())
+		return false;
+
+	++_lockCount;
+	_rawSurface = _ddSurface->lock(nullptr, 0);
+	return true;
+}
+
+void OSVideoSurface::unlock() {
+	if (!--_lockCount) {
+		if (_rawSurface)
+			_ddSurface->unlock();
+		_rawSurface = nullptr;
+	}
+}
+
+bool OSVideoSurface::hasSurface() {
+	return _ddSurface != nullptr;
+}
+
+int OSVideoSurface::getWidth() {
+	if (!loadIfReady())
+		error("Could not load resource");
+
+	return _ddSurface->getWidth();
+}
+
+int OSVideoSurface::getHeight() {
+	if (!loadIfReady())
+		error("Could not load resource");
+
+	return _ddSurface->getHeight();
+}
+
+int OSVideoSurface::getPitch() {
+	if (!loadIfReady())
+		error("Could not load resource");
+
+	return _ddSurface->getPitch();
+}
+
+void OSVideoSurface::resize(int width, int height) {
+	freeSurface();
+
+	_screenManager->resizeSurface(this, width, height);
+	if (_ddSurface)
+		_videoSurfaceCounter += _ddSurface->getSize();
+}
+
+int OSVideoSurface::getPixelDepth() {
+	if (!loadIfReady())
+		assert(0);
+
+	lock();
+	
+	int result = _rawSurface->format.bytesPerPixel;
+	if (result == 1)
+		// Paletted 8-bit images don't store the color directly in the pixels
+		result = 0;
+
+	unlock();
+	return result;
+}
+
+bool OSVideoSurface::load() {
+	if (!_resourceKey.scanForFile())
+		return false;
+
+	switch (_resourceKey.fileTypeSuffix()) {
+	case FILETYPE_IMAGE:
+		switch (_resourceKey.imageTypeSuffix()) {
+		case IMAGETYPE_TARGA:
+			loadTarga(_resourceKey);
+			break;
+		case IMAGETYPE_JPEG:
+			loadJPEG(_resourceKey);
+			break;
+		default:
+			break;
+		}
+		return true;
+
+	case FILETYPE_MOVIE:
+		loadMovie();
+		return true;
+
+	default:
+		return false;
+	}
+}
+
+uint16 OSVideoSurface::getPixel(const Common::Point &pt) {
+	if (!loadIfReady())
+		return 0;
+
+	if (pt.x >= 0 && pt.y >= 0 && pt.x < getWidth() && pt.y < getHeight()) {
+		lock();
+		uint16 pixel = *(uint16 *)_rawSurface->getBasePtr(pt.x, pt.y);
+		unlock();
+		return pixel;
+	} else {
+		return getTransparencyColor();
+	}
+}
+
+void OSVideoSurface::shiftColors() {
+	if (!loadIfReady())
+		return;
+
+	// Currently no further processing is needed, since for ScummVM,
+	// we already convert 16-bit surfaces as soon as they're loaded
+}
+
+void OSVideoSurface::proc32(int v1, CVideoSurface *surface) {
+	if (loadIfReady() && _movie)
+		_movie->proc8(v1, surface);
+}
+
+void OSVideoSurface::stopMovie() {
+	if (_movie)
+		_movie->stop();
+}
+
+void OSVideoSurface::setMovieFrame(uint frameNumber) {
+	if (loadIfReady() && _movie)
+		_movie->setFrame(frameNumber);
+}
+
+bool OSVideoSurface::loadIfReady() {
+	_videoSurfaceNum = _videoSurfaceCounter;
+
+	if (hasSurface()) {
+		return true;
+	} else if (_pendingLoad) {
+		_field50 = 1;
+		load();
+		return true;
+	} else {
+		return false;
+	}
+}
+
+int OSVideoSurface::freeSurface() {
+	if (!_ddSurface)
+		return 0;
+	int surfaceSize = _ddSurface->getSize();
+
+	delete _movie;
+	_movie = nullptr;
+	delete _ddSurface;
+	_ddSurface = nullptr;
+
+	return surfaceSize;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
new file mode 100644
index 0000000..1de6a1d
--- /dev/null
+++ b/engines/titanic/support/video_surface.h
@@ -0,0 +1,306 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_VIDEO_SURFACE_H
+#define TITANIC_VIDEO_SURFACE_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "titanic/support/font.h"
+#include "titanic/support/direct_draw.h"
+#include "titanic/support/movie.h"
+#include "titanic/support/rect.h"
+#include "titanic/core/list.h"
+#include "titanic/core/resource_key.h"
+
+namespace Titanic {
+
+class CScreenManager;
+class CJPEGDecode;
+class CTargaDecode;
+
+class CVideoSurface : public ListItem {
+	friend class CJPEGDecode;
+	friend class CTargaDecode;
+private:
+	/**
+	 * Calculates blitting bounds
+	 */
+	void clipBounds(Rect &srcRect, Rect &destRect, CVideoSurface *srcSurface,
+		const Rect *subRect = nullptr, const Point *destPos = nullptr);
+
+	void blitRect1(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
+	void blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
+protected:
+	static int _videoSurfaceCounter;
+protected:
+	CScreenManager *_screenManager;
+	CResourceKey _resourceKey;
+	DirectDrawSurface *_ddSurface;
+	Graphics::ManagedSurface *_rawSurface;
+	bool _pendingLoad;
+	void *_field40;
+	int _field44;
+	int _field48;
+	int _videoSurfaceNum;
+	int _field50;
+	int _lockCount;
+public:
+	CMovie *_movie;
+	bool _blitFlag;
+	bool _blitStyleFlag;
+public:
+	CVideoSurface(CScreenManager *screenManager);
+	virtual ~CVideoSurface();
+
+	/**
+	 * Set the underlying surface for this video surface
+	 */
+	void setSurface(CScreenManager *screenManager, DirectDrawSurface *surface);
+
+	/**
+	 * Load the surface with the passed resource
+	 */
+	virtual void loadResource(const CResourceKey &key) = 0;
+
+	/**
+	 * Loads a Targa image file specified by the resource key
+	 */
+	virtual void loadTarga(const CResourceKey &key) = 0;
+
+	/**
+	 * Loads a JPEG image file specified by the resource key
+	 */
+	virtual void loadJPEG(const CResourceKey &key) = 0;
+
+	/**
+	 * Loads a movie file specified by the resource key
+	 */
+	virtual void loadMovie() = 0;
+
+	/**
+	 * Lock the surface for direct access to the pixels
+	 */
+	virtual bool lock() = 0;
+
+	/**
+	 * Unlocks the surface after prior calls to lock()
+	 */
+	virtual void unlock() = 0;
+
+	/**
+	 * Returns true if an underlying raw surface has been set
+	 */
+	virtual bool hasSurface() = 0;
+
+	/**
+	 * Returns the width of the surface
+	 */
+	virtual int getWidth() = 0;
+
+	/**
+	 * Returns the height of the surface
+	 */
+	virtual int getHeight() = 0;
+
+	/**
+	 * Returns the pitch of the surface in bytes
+	 */
+	virtual int getPitch() = 0;
+	
+	/**
+	 * Reiszes the surface
+	 */
+	virtual void resize(int width, int height) = 0;
+
+	/**
+	 * Returns the number of bytes per pixel in the surface
+	 */
+	virtual int getPixelDepth() = 0;
+
+	/**
+	 * Gets the pixel at the specified position within the surface
+	 */
+	virtual uint16 getPixel(const Common::Point &pt) = 0;
+
+	/**
+	 * Shifts the colors of the surface.. maybe greys it out?
+	 */
+	virtual void shiftColors() = 0;
+
+	virtual void proc32(int v1, CVideoSurface *surface) = 0;
+
+	/**
+	 * Stops any movie currently attached to the surface
+	 */
+	virtual void stopMovie() = 0;
+
+	/**
+	 * Sets the movie to the specified frame number
+	 */
+	virtual void setMovieFrame(uint frameNumber) = 0;
+
+	/**
+	 * Loads the surface's resource if there's one pending
+	 */
+	virtual bool loadIfReady() = 0;
+
+	/**
+	 * Loads the surface data based on the currently set resource key
+	 */
+	virtual bool load() = 0;
+
+	virtual bool proc45();
+
+	/**
+	 * Frees the underlying surface
+	 */
+	virtual int freeSurface() { return 0; }
+
+
+
+	/**
+	 * Blit from another surface
+	 */
+	void blitFrom(const Point &destPos, CVideoSurface *src, const Rect *srcRect = nullptr);
+
+	/**
+	 * Blit from another surface
+	 */
+	void blitFrom(const Point &destPos, const Graphics::Surface *src);
+
+	void set40(void *v) { _field40 = v; }
+
+	uint16 *getPixels() { return (uint16 *)_rawSurface->getPixels(); }
+
+	/**
+	 * Returns the transparent color
+	 */
+	uint getTransparencyColor();
+};
+
+class OSVideoSurface : public CVideoSurface {
+public:
+	OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface);
+	OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool flag = false);
+
+	/**
+	 * Load the surface with the passed resource
+	 */
+	virtual void loadResource(const CResourceKey &key);
+
+	/**
+	 * Loads a Targa image file specified by the resource key
+	 */
+	virtual void loadTarga(const CResourceKey &key);
+
+	/**
+	 * Loads a JPEG image file specified by the resource key
+	 */
+	virtual void loadJPEG(const CResourceKey &key);
+
+	/**
+	 * Loads a movie file specified by the resource key
+	 */
+	virtual void loadMovie();
+
+	/**
+	 * Lock the surface for direct access to the pixels
+	 */
+	virtual bool lock();
+
+	/**
+	 * Unlocks the surface after prior calls to lock()
+	 */
+	virtual void unlock();
+
+	/**
+	 * Returns true if an underlying raw surface has been set
+	 */
+	virtual bool hasSurface();
+
+	/**
+	 * Returns the width of the surface
+	 */
+	virtual int getWidth();
+
+	/**
+	 * Returns the height of the surface
+	 */
+	virtual int getHeight();
+
+	/**
+	 * Returns the pitch of the surface in bytes
+	 */
+	virtual int getPitch();
+
+	/**
+	 * Reiszes the surface
+	 */
+	virtual void resize(int width, int height);
+
+	/**
+	 * Returns the number of bytes per pixel in the surface
+	 */
+	virtual int getPixelDepth();
+
+	/**
+	 * Gets the pixel at the specified position within the surface
+	 */
+	virtual uint16 getPixel(const Common::Point &pt);
+
+	/**
+	 * Shifts the colors of the surface.. maybe greys it out?
+	 */
+	virtual void shiftColors();
+
+	virtual void proc32(int v1, CVideoSurface *surface);
+
+	/**
+	 * Stops any movie currently attached to the surface
+	 */
+	virtual void stopMovie();
+
+	/**
+	 * Sets the movie to the specified frame number
+	 */
+	virtual void setMovieFrame(uint frameNumber);
+
+	/**
+	 * Loads the surface's resource if there's one pending
+	 */
+	virtual bool loadIfReady();
+
+	/**
+	 * Loads the surface data based on the currently set resource key
+	 */
+	virtual bool load();
+
+	/**
+	 * Frees the underlying surface
+	 */
+	virtual int freeSurface();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_VIDEO_SURFACE_H */
diff --git a/engines/titanic/text_cursor.cpp b/engines/titanic/text_cursor.cpp
deleted file mode 100644
index ae1f842..0000000
--- a/engines/titanic/text_cursor.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/textconsole.h"
-#include "titanic/text_cursor.h"
-
-namespace Titanic {
-
-CTextCursor::CTextCursor() : _active(false) {
-}
-
-Rect CTextCursor::getBounds() {
-	warning("CTextCursor::getBounds");
-	return Rect();
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/text_cursor.h b/engines/titanic/text_cursor.h
deleted file mode 100644
index 4b6be8f..0000000
--- a/engines/titanic/text_cursor.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_TEXT_CURSOR_H
-#define TITANIC_TEXT_CURSOR_H
-
-#include "common/scummsys.h"
-#include "titanic/rect.h"
-
-namespace Titanic {
-
-class CTextCursor {
-public:
-	bool _active;
-public:
-	CTextCursor();
-
-	Rect getBounds();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_TEXT_CURSOR_H */
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 6b85211..a5549e4 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -32,11 +32,11 @@
 #include "graphics/screen.h"
 #include "titanic/debugger.h"
 #include "titanic/events.h"
-#include "titanic/files_manager.h"
+#include "titanic/support/files_manager.h"
 #include "titanic/main_game_window.h"
-#include "titanic/movie.h"
-#include "titanic/screen_manager.h"
-#include "titanic/string.h"
+#include "titanic/support/movie.h"
+#include "titanic/support/screen_manager.h"
+#include "titanic/support/string.h"
 
 /**
  * This is the namespace of the Titanic engine.
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 6724baa..4cd892c 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_TRUE_TALK_MANAGER_H
 #define TITANIC_TRUE_TALK_MANAGER_H
 
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/true_talk/title_engine.h"
 #include "titanic/true_talk/tt_scripts.h"
 
diff --git a/engines/titanic/true_talk/tt_named_script.h b/engines/titanic/true_talk/tt_named_script.h
index 9186507..ec5c35c 100644
--- a/engines/titanic/true_talk/tt_named_script.h
+++ b/engines/titanic/true_talk/tt_named_script.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_TT_NAMED_SCRIPT_H
 #define TITANIC_TT_NAMED_SCRIPT_H
 
-#include "titanic/simple_file.h"
+#include "titanic/support/simple_file.h"
 #include "titanic/true_talk/tt_script_base.h"
 
 namespace Titanic {
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index cf940a4..60fdde0 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_TT_STRING_H
 #define TITANIC_TT_STRING_H
 
-#include "titanic/string.h"
+#include "titanic/support/string.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
deleted file mode 100644
index 520193f..0000000
--- a/engines/titanic/video_surface.cpp
+++ /dev/null
@@ -1,376 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/video_surface.h"
-#include "titanic/image_decoders.h"
-#include "titanic/screen_manager.h"
-
-namespace Titanic {
-
-int CVideoSurface::_videoSurfaceCounter = 0;
-
-CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
-		_screenManager(screenManager), _rawSurface(nullptr), _movie(nullptr),
-		_pendingLoad(false), _blitStyleFlag(false), _blitFlag(false),
-		_field40(nullptr), _field44(4), _field48(0), _field50(1) {
-	_videoSurfaceNum = _videoSurfaceCounter++;
-}
-
-CVideoSurface::~CVideoSurface() {
-	if (_ddSurface)
-		_videoSurfaceCounter -= freeSurface();
-	--_videoSurfaceCounter;
-}
-
-void CVideoSurface::setSurface(CScreenManager *screenManager, DirectDrawSurface *surface) {
-	_screenManager = screenManager;
-	_ddSurface = surface;
-}
-
-void CVideoSurface::blitFrom(const Point &destPos, CVideoSurface *src, const Rect *srcRect) {
-	if (loadIfReady() && src->loadIfReady() && _ddSurface && src->_ddSurface) {
-		Rect srcBounds, destBounds;
-		clipBounds(srcBounds, destBounds, src, srcRect, &destPos);
-
-		if (_blitStyleFlag)
-			blitRect2(srcBounds, destBounds, src);
-		else
-			blitRect1(srcBounds, destBounds, src);
-	}
-}
-
-void CVideoSurface::blitFrom(const Point &destPos, const Graphics::Surface *src) {
-	lock();
-	_rawSurface->blitFrom(*src, destPos);
-	unlock();
-}
-
-void CVideoSurface::clipBounds(Rect &srcRect, Rect &destRect,
-		CVideoSurface *srcSurface, const Rect *subRect, const Point *destPos) {
-	// Figure out initial source rect and dest rect, based on whether
-	// specific subRect and/or destPos have been passed
-	if (destPos) {
-		destRect.left = destPos->x;
-		destRect.top = destPos->y;
-	} else {
-		destRect.left = destRect.top = 0;
-	}
-
-	if (subRect) {
-		destRect.right = destRect.left + subRect->width();
-		destRect.bottom = destRect.top + subRect->height();
-		srcRect = *subRect;
-	} else {
-		srcRect.right = srcRect.left + srcSurface->getWidth();
-		srcRect.bottom = srcRect.top + srcSurface->getHeight();
-		srcRect = Rect(0, 0, srcSurface->getWidth(), srcSurface->getHeight());
-	}
-
-	// Clip destination rect to be on-screen
-	if (destRect.left < 0) {
-		srcRect.left -= destRect.left;
-		destRect.left = 0;
-	}
-	if (destRect.top < 0) {
-		srcRect.top -= destRect.top;
-		destRect.top = 0;
-	}
-	if (destRect.right > getWidth()) {
-		srcRect.right += getWidth() - destRect.right;
-		destRect.right = getWidth();
-	}
-	if (destRect.bottom > getHeight()) {
-		srcRect.bottom += getHeight() - destRect.bottom;
-		destRect.bottom = getHeight();
-	}
-
-	// Clip source rect to be within the source surface
-	if (srcRect.left < 0) {
-		destRect.left -= srcRect.left;
-		srcRect.left = 0;
-	}
-	if (srcRect.top < 0) {
-		destRect.top -= srcRect.top;
-		srcRect.top = 0;
-	}
-	if (srcRect.right > srcSurface->getWidth()) {
-		destRect.right += srcSurface->getWidth() - srcRect.right;
-		srcRect.right = srcSurface->getWidth();
-	}
-	if (srcRect.bottom > srcSurface->getHeight()) {
-		destRect.bottom += srcSurface->getHeight() - srcRect.bottom;
-		srcRect.bottom = srcSurface->getHeight();
-	}
-
-	// Validate that the resulting rects are valid
-	if (destRect.left >= destRect.right || destRect.top >= destRect.bottom
-		|| srcRect.left >= srcRect.right || srcRect.top >= srcRect.bottom)
-		error("Invalid rect");
-}
-
-void CVideoSurface::blitRect1(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
-	src->lock();
-	lock();
-
-	// TODO: Do it like the original does it
-	_rawSurface->transBlitFrom(*src->_rawSurface, srcRect, destRect,
-		getTransparencyColor());
-
-	src->unlock();
-	unlock();
-}
-
-void CVideoSurface::blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
-	// TODO: Do it like the original does it
-	blitRect1(srcRect, destRect, src);
-}
-
-uint CVideoSurface::getTransparencyColor() {
-	uint32 val = -(getPixelDepth() - 2);
-	val &= 0xFFFF8400;
-	val += 0xF81F;
-	return val;
-}
-
-bool CVideoSurface::proc45() {
-	if (_field50) {
-		_field50 = 0;
-		return true;
-	} else if (_movie) {
-		return _movie->get10();
-	} else {
-		return false;
-	}
-}
-
-/*------------------------------------------------------------------------*/
-
-OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface) :
-		CVideoSurface(screenManager) {
-	_ddSurface = surface;
-}
-
-OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool pendingLoad) :
-		CVideoSurface(screenManager) {
-	_ddSurface = nullptr;
-	_pendingLoad = pendingLoad;
-	
-	if (_pendingLoad) {
-		loadResource(key);
-	} else {
-		_resourceKey = key;
-		load();
-	}
-}
-
-void OSVideoSurface::loadResource(const CResourceKey &key) {
-	_resourceKey = key;
-	_pendingLoad = true;
-
-	if (hasSurface())
-		load();
-}
-
-void OSVideoSurface::loadTarga(const CResourceKey &key) {
-	// Decode the image
-	CTargaDecode decoder;
-	decoder.decode(*this, key.getString());
-
-	if (getPixelDepth() == 2)
-		shiftColors();
-
-	_resourceKey = key;
-
-}
-
-void OSVideoSurface::loadJPEG(const CResourceKey &key) {
-	// Decode the image
-	CJPEGDecode decoder;
-	decoder.decode(*this, key.getString());
-
-	if (getPixelDepth() == 2)
-		shiftColors();
-
-	_resourceKey = key;
-}
-
-void OSVideoSurface::loadMovie() {
-	warning("TODO");
-}
-
-bool OSVideoSurface::lock() {
-	if (!loadIfReady())
-		return false;
-
-	++_lockCount;
-	_rawSurface = _ddSurface->lock(nullptr, 0);
-	return true;
-}
-
-void OSVideoSurface::unlock() {
-	if (!--_lockCount) {
-		if (_rawSurface)
-			_ddSurface->unlock();
-		_rawSurface = nullptr;
-	}
-}
-
-bool OSVideoSurface::hasSurface() {
-	return _ddSurface != nullptr;
-}
-
-int OSVideoSurface::getWidth() {
-	if (!loadIfReady())
-		error("Could not load resource");
-
-	return _ddSurface->getWidth();
-}
-
-int OSVideoSurface::getHeight() {
-	if (!loadIfReady())
-		error("Could not load resource");
-
-	return _ddSurface->getHeight();
-}
-
-int OSVideoSurface::getPitch() {
-	if (!loadIfReady())
-		error("Could not load resource");
-
-	return _ddSurface->getPitch();
-}
-
-void OSVideoSurface::resize(int width, int height) {
-	freeSurface();
-
-	_screenManager->resizeSurface(this, width, height);
-	if (_ddSurface)
-		_videoSurfaceCounter += _ddSurface->getSize();
-}
-
-int OSVideoSurface::getPixelDepth() {
-	if (!loadIfReady())
-		assert(0);
-
-	lock();
-	
-	int result = _rawSurface->format.bytesPerPixel;
-	if (result == 1)
-		// Paletted 8-bit images don't store the color directly in the pixels
-		result = 0;
-
-	unlock();
-	return result;
-}
-
-bool OSVideoSurface::load() {
-	if (!_resourceKey.scanForFile())
-		return false;
-
-	switch (_resourceKey.fileTypeSuffix()) {
-	case FILETYPE_IMAGE:
-		switch (_resourceKey.imageTypeSuffix()) {
-		case IMAGETYPE_TARGA:
-			loadTarga(_resourceKey);
-			break;
-		case IMAGETYPE_JPEG:
-			loadJPEG(_resourceKey);
-			break;
-		default:
-			break;
-		}
-		return true;
-
-	case FILETYPE_MOVIE:
-		loadMovie();
-		return true;
-
-	default:
-		return false;
-	}
-}
-
-uint16 OSVideoSurface::getPixel(const Common::Point &pt) {
-	if (!loadIfReady())
-		return 0;
-
-	if (pt.x >= 0 && pt.y >= 0 && pt.x < getWidth() && pt.y < getHeight()) {
-		lock();
-		uint16 pixel = *(uint16 *)_rawSurface->getBasePtr(pt.x, pt.y);
-		unlock();
-		return pixel;
-	} else {
-		return getTransparencyColor();
-	}
-}
-
-void OSVideoSurface::shiftColors() {
-	if (!loadIfReady())
-		return;
-
-	// Currently no further processing is needed, since for ScummVM,
-	// we already convert 16-bit surfaces as soon as they're loaded
-}
-
-void OSVideoSurface::proc32(int v1, CVideoSurface *surface) {
-	if (loadIfReady() && _movie)
-		_movie->proc8(v1, surface);
-}
-
-void OSVideoSurface::stopMovie() {
-	if (_movie)
-		_movie->stop();
-}
-
-void OSVideoSurface::setMovieFrame(uint frameNumber) {
-	if (loadIfReady() && _movie)
-		_movie->setFrame(frameNumber);
-}
-
-bool OSVideoSurface::loadIfReady() {
-	_videoSurfaceNum = _videoSurfaceCounter;
-
-	if (hasSurface()) {
-		return true;
-	} else if (_pendingLoad) {
-		_field50 = 1;
-		load();
-		return true;
-	} else {
-		return false;
-	}
-}
-
-int OSVideoSurface::freeSurface() {
-	if (!_ddSurface)
-		return 0;
-	int surfaceSize = _ddSurface->getSize();
-
-	delete _movie;
-	_movie = nullptr;
-	delete _ddSurface;
-	_ddSurface = nullptr;
-
-	return surfaceSize;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
deleted file mode 100644
index de18158..0000000
--- a/engines/titanic/video_surface.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_VIDEO_SURFACE_H
-#define TITANIC_VIDEO_SURFACE_H
-
-#include "common/scummsys.h"
-#include "common/array.h"
-#include "titanic/font.h"
-#include "titanic/direct_draw.h"
-#include "titanic/movie.h"
-#include "titanic/rect.h"
-#include "titanic/core/list.h"
-#include "titanic/core/resource_key.h"
-
-namespace Titanic {
-
-class CScreenManager;
-class CJPEGDecode;
-class CTargaDecode;
-
-class CVideoSurface : public ListItem {
-	friend class CJPEGDecode;
-	friend class CTargaDecode;
-private:
-	/**
-	 * Calculates blitting bounds
-	 */
-	void clipBounds(Rect &srcRect, Rect &destRect, CVideoSurface *srcSurface,
-		const Rect *subRect = nullptr, const Point *destPos = nullptr);
-
-	void blitRect1(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
-	void blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
-protected:
-	static int _videoSurfaceCounter;
-protected:
-	CScreenManager *_screenManager;
-	CResourceKey _resourceKey;
-	DirectDrawSurface *_ddSurface;
-	Graphics::ManagedSurface *_rawSurface;
-	bool _pendingLoad;
-	void *_field40;
-	int _field44;
-	int _field48;
-	int _videoSurfaceNum;
-	int _field50;
-	int _lockCount;
-public:
-	CMovie *_movie;
-	bool _blitFlag;
-	bool _blitStyleFlag;
-public:
-	CVideoSurface(CScreenManager *screenManager);
-	virtual ~CVideoSurface();
-
-	/**
-	 * Set the underlying surface for this video surface
-	 */
-	void setSurface(CScreenManager *screenManager, DirectDrawSurface *surface);
-
-	/**
-	 * Load the surface with the passed resource
-	 */
-	virtual void loadResource(const CResourceKey &key) = 0;
-
-	/**
-	 * Loads a Targa image file specified by the resource key
-	 */
-	virtual void loadTarga(const CResourceKey &key) = 0;
-
-	/**
-	 * Loads a JPEG image file specified by the resource key
-	 */
-	virtual void loadJPEG(const CResourceKey &key) = 0;
-
-	/**
-	 * Loads a movie file specified by the resource key
-	 */
-	virtual void loadMovie() = 0;
-
-	/**
-	 * Lock the surface for direct access to the pixels
-	 */
-	virtual bool lock() = 0;
-
-	/**
-	 * Unlocks the surface after prior calls to lock()
-	 */
-	virtual void unlock() = 0;
-
-	/**
-	 * Returns true if an underlying raw surface has been set
-	 */
-	virtual bool hasSurface() = 0;
-
-	/**
-	 * Returns the width of the surface
-	 */
-	virtual int getWidth() = 0;
-
-	/**
-	 * Returns the height of the surface
-	 */
-	virtual int getHeight() = 0;
-
-	/**
-	 * Returns the pitch of the surface in bytes
-	 */
-	virtual int getPitch() = 0;
-	
-	/**
-	 * Reiszes the surface
-	 */
-	virtual void resize(int width, int height) = 0;
-
-	/**
-	 * Returns the number of bytes per pixel in the surface
-	 */
-	virtual int getPixelDepth() = 0;
-
-	/**
-	 * Gets the pixel at the specified position within the surface
-	 */
-	virtual uint16 getPixel(const Common::Point &pt) = 0;
-
-	/**
-	 * Shifts the colors of the surface.. maybe greys it out?
-	 */
-	virtual void shiftColors() = 0;
-
-	virtual void proc32(int v1, CVideoSurface *surface) = 0;
-
-	/**
-	 * Stops any movie currently attached to the surface
-	 */
-	virtual void stopMovie() = 0;
-
-	/**
-	 * Sets the movie to the specified frame number
-	 */
-	virtual void setMovieFrame(uint frameNumber) = 0;
-
-	/**
-	 * Loads the surface's resource if there's one pending
-	 */
-	virtual bool loadIfReady() = 0;
-
-	/**
-	 * Loads the surface data based on the currently set resource key
-	 */
-	virtual bool load() = 0;
-
-	virtual bool proc45();
-
-	/**
-	 * Frees the underlying surface
-	 */
-	virtual int freeSurface() { return 0; }
-
-
-
-	/**
-	 * Blit from another surface
-	 */
-	void blitFrom(const Point &destPos, CVideoSurface *src, const Rect *srcRect = nullptr);
-
-	/**
-	 * Blit from another surface
-	 */
-	void blitFrom(const Point &destPos, const Graphics::Surface *src);
-
-	void set40(void *v) { _field40 = v; }
-
-	uint16 *getPixels() { return (uint16 *)_rawSurface->getPixels(); }
-
-	/**
-	 * Returns the transparent color
-	 */
-	uint getTransparencyColor();
-};
-
-class OSVideoSurface : public CVideoSurface {
-public:
-	OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface);
-	OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool flag = false);
-
-	/**
-	 * Load the surface with the passed resource
-	 */
-	virtual void loadResource(const CResourceKey &key);
-
-	/**
-	 * Loads a Targa image file specified by the resource key
-	 */
-	virtual void loadTarga(const CResourceKey &key);
-
-	/**
-	 * Loads a JPEG image file specified by the resource key
-	 */
-	virtual void loadJPEG(const CResourceKey &key);
-
-	/**
-	 * Loads a movie file specified by the resource key
-	 */
-	virtual void loadMovie();
-
-	/**
-	 * Lock the surface for direct access to the pixels
-	 */
-	virtual bool lock();
-
-	/**
-	 * Unlocks the surface after prior calls to lock()
-	 */
-	virtual void unlock();
-
-	/**
-	 * Returns true if an underlying raw surface has been set
-	 */
-	virtual bool hasSurface();
-
-	/**
-	 * Returns the width of the surface
-	 */
-	virtual int getWidth();
-
-	/**
-	 * Returns the height of the surface
-	 */
-	virtual int getHeight();
-
-	/**
-	 * Returns the pitch of the surface in bytes
-	 */
-	virtual int getPitch();
-
-	/**
-	 * Reiszes the surface
-	 */
-	virtual void resize(int width, int height);
-
-	/**
-	 * Returns the number of bytes per pixel in the surface
-	 */
-	virtual int getPixelDepth();
-
-	/**
-	 * Gets the pixel at the specified position within the surface
-	 */
-	virtual uint16 getPixel(const Common::Point &pt);
-
-	/**
-	 * Shifts the colors of the surface.. maybe greys it out?
-	 */
-	virtual void shiftColors();
-
-	virtual void proc32(int v1, CVideoSurface *surface);
-
-	/**
-	 * Stops any movie currently attached to the surface
-	 */
-	virtual void stopMovie();
-
-	/**
-	 * Sets the movie to the specified frame number
-	 */
-	virtual void setMovieFrame(uint frameNumber);
-
-	/**
-	 * Loads the surface's resource if there's one pending
-	 */
-	virtual bool loadIfReady();
-
-	/**
-	 * Loads the surface data based on the currently set resource key
-	 */
-	virtual bool load();
-
-	/**
-	 * Frees the underlying surface
-	 */
-	virtual int freeSurface();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_VIDEO_SURFACE_H */


Commit: 2699efd633334be7fade6e890c0a9b32edc08677
    https://github.com/scummvm/scummvm/commit/2699efd633334be7fade6e890c0a9b32edc08677
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-03T17:44:08-04:00

Commit Message:
TITANIC: Fix reading resources from game executable

Changed paths:
    engines/titanic/support/files_manager.cpp
    engines/titanic/support/files_manager.h
    engines/titanic/support/font.cpp



diff --git a/engines/titanic/support/files_manager.cpp b/engines/titanic/support/files_manager.cpp
index 179d77f..6cd6bfb 100644
--- a/engines/titanic/support/files_manager.cpp
+++ b/engines/titanic/support/files_manager.cpp
@@ -93,14 +93,14 @@ void CFilesManager::fn5(const CString &name) {
 	warning("TODO: CFilesManager::fn5");
 }
 
-Common::SeekableReadStream *CFilesManager::getResource(const CString &name,
-		const CString &area) {
+Common::SeekableReadStream *CFilesManager::getResource(
+	Common::WinResourceID area, Common::WinResourceID name) {
 	if (!_exeResources) {
-		_exeResources = new Common::NEResources();
+		_exeResources = new Common::PEResources();
 		_exeResources->loadFromEXE("st.exe");
 	}
 	
-	return nullptr;
+	return _exeResources->getResource(area, name);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/files_manager.h b/engines/titanic/support/files_manager.h
index 7915149..ae66469 100644
--- a/engines/titanic/support/files_manager.h
+++ b/engines/titanic/support/files_manager.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_FILES_MANAGER_H
 #define TITANIC_FILES_MANAGER_H
 
-#include "common/winexe_ne.h"
+#include "common/winexe_pe.h"
 #include "titanic/core/list.h"
 #include "titanic/support/screen_manager.h"
 
@@ -37,7 +37,7 @@ class CFilesManagerList : public List<ListItem> {
 class CFilesManager {
 private:
 	CGameManager *_gameManager;
-	Common::NEResources *_exeResources;
+	Common::PEResources *_exeResources;
 	CFilesManagerList _list;
 	CString _string1;
 	CString _string2;
@@ -87,8 +87,8 @@ public:
 	/**
 	 * Get a resource from the executable
 	 */
-	Common::SeekableReadStream *getResource(const CString &name,
-		const CString &area);
+	Common::SeekableReadStream *getResource(Common::WinResourceID area,
+		Common::WinResourceID name);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index 6862baf..3b48e5e 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -43,11 +43,10 @@ STFont::~STFont() {
 
 void STFont::load(int fontNumber) {
 	assert(!_dataPtr);
-	CString fontNumStr = CString::format("%d", fontNumber);
 	Common::SeekableReadStream *stream = g_vm->_filesManager.getResource(
-		fontNumStr, "STFont");
+		Common::WinResourceID("STFONT"), fontNumber);
 	if (!stream)
-		return;
+		error("Could not locate the specified font");
 
 	_field8 = stream->readUint32LE();
 	_maxCharWidth = stream->readUint32LE();


Commit: ebdc773247fb1e6a41f58ee8336986dcdc8e75d6
    https://github.com/scummvm/scummvm/commit/ebdc773247fb1e6a41f58ee8336986dcdc8e75d6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-03T18:10:25-04:00

Commit Message:
TITANIC: Implement font loading

Changed paths:
    engines/titanic/support/font.cpp
    engines/titanic/support/font.h



diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index 3b48e5e..6636a84 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -66,4 +66,26 @@ void STFont::writeString(int maxWidth, const CString &text, int *v1, int *v2) {
 	warning("TODO: STFont::writeString");
 }
 
+int STFont::stringWidth(const CString &text) const {
+	if (text.empty())
+		return 0;
+
+	const char *srcP = text.c_str();
+	int total = 0;
+	char c;
+	while (c = *srcP++) {
+		if (c == 26) {
+			// Skip over command parameter bytes
+			srcP += 3;
+		} else if (c == 27) {
+			// Skip over command parameter bytes
+			srcP += 4;
+		} else if (c != '\n') {
+			total += _chars[c]._charWidth;
+		}
+	}
+
+	return total;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/support/font.h b/engines/titanic/support/font.h
index 0fff512..c41f4dc 100644
--- a/engines/titanic/support/font.h
+++ b/engines/titanic/support/font.h
@@ -39,7 +39,7 @@ public:
 	size_t _dataSize;
 	int _field8;
 	int _maxCharWidth;
-	Common::Array<CharEntry> _chars;
+	CharEntry _chars[256];
 	int _field810;
 	int _field814;
 	int _field818;
@@ -53,6 +53,11 @@ public:
 	void load(int fontNumber);
 
 	/**
+	 * Return the width in pixels of the specified text
+	 */
+	int stringWidth(const CString &text) const;
+
+	/**
 	 * Write out a string
 	 * TODO: Verify this
 	 */


Commit: 56b29987443075faba0495d84eeaf42b443d577f
    https://github.com/scummvm/scummvm/commit/56b29987443075faba0495d84eeaf42b443d577f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-04T00:07:50-04:00

Commit Message:
TITANIC: Further work on STFont character drawing

Changed paths:
    engines/titanic/support/font.cpp
    engines/titanic/support/font.h
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index 6636a84..3265258 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -30,11 +30,9 @@ namespace Titanic {
 STFont::STFont() {
 	_dataPtr = nullptr;
 	_dataSize = 0;
-	_field8 = 0;
-	_maxCharWidth = 0;
-	_field810 = 0;
-	_field814 = 0;
-	_field818 = 0;
+	_fontHeight = 0;
+	_dataWidth = 0;
+	_fontR = _fontG = _fontB = 0;
 }
 
 STFont::~STFont() {
@@ -48,10 +46,10 @@ void STFont::load(int fontNumber) {
 	if (!stream)
 		error("Could not locate the specified font");
 
-	_field8 = stream->readUint32LE();
-	_maxCharWidth = stream->readUint32LE();
+	_fontHeight = stream->readUint32LE();
+	_dataWidth = stream->readUint32LE();
 	for (uint idx = 0; idx < 256; ++idx)
-		_chars[idx]._charWidth = stream->readUint32LE();
+		_chars[idx]._width = stream->readUint32LE();
 	for (uint idx = 0; idx < 256; ++idx)
 		_chars[idx]._offset = stream->readUint32LE();
 
@@ -62,6 +60,16 @@ void STFont::load(int fontNumber) {
 	delete stream;
 }
 
+void STFont::setColor(byte r, byte g, byte b) {
+	_fontR = r;
+	_fontG = g;
+	_fontB = b;
+}
+
+uint16 STFont::getColor() const {
+	return g_system->getScreenFormat().RGBToColor(_fontR, _fontG, _fontB);
+}
+
 void STFont::writeString(int maxWidth, const CString &text, int *v1, int *v2) {
 	warning("TODO: STFont::writeString");
 }
@@ -81,11 +89,67 @@ int STFont::stringWidth(const CString &text) const {
 			// Skip over command parameter bytes
 			srcP += 4;
 		} else if (c != '\n') {
-			total += _chars[c]._charWidth;
+			total += _chars[c]._width;
 		}
 	}
 
 	return total;
 }
 
+int STFont::writeChar(CVideoSurface *surface, unsigned char c, const Common::Point &pt, Rect *destRect, Rect *srcRect) {
+	if (c == 233)
+		c = '$';
+
+	Rect tempRect;
+	tempRect.left = _chars[c]._offset;
+	tempRect.right = _chars[c]._offset + _chars[c]._width;
+	tempRect.top = 0;
+	tempRect.bottom = _fontHeight;
+	Point destPos(pt.x + destRect->left, pt.y + destRect->top);
+
+	if (srcRect->isEmpty())
+		srcRect = destRect;
+	if (destPos.y > srcRect->bottom)
+		return -2;
+
+	if ((destPos.y + tempRect.height()) > srcRect->bottom) {
+		tempRect.bottom += tempRect.top - destPos.y;
+	}
+
+	if (destPos.y < srcRect->top) {
+		if ((tempRect.height() + destPos.y) < srcRect->top)
+			return -1;
+
+		tempRect.top += srcRect->top - destPos.y;
+		destPos.y = srcRect->top;
+	}
+
+	if (destPos.x < srcRect->left) {
+		if ((tempRect.width() + destPos.x) < srcRect->left)
+			return -3;
+
+		tempRect.left += srcRect->left - destPos.x;
+		destPos.x = srcRect->left;
+	} else {
+		if ((tempRect.width() + destPos.x) > srcRect->right) {
+			if (destPos.x > srcRect->right)
+				return -4;
+
+			tempRect.right += srcRect->left - destPos.x;
+		}
+	}
+
+	copyRect(surface, destPos, tempRect);
+	return 0;
+}
+
+void STFont::copyRect(CVideoSurface *surface, const Common::Point &pt, Rect &rect) {
+	if (surface->lock()) {
+		uint16 *lineP = surface->getBasePtr(pt.x, pt.y);
+		uint16 color = getColor();
+
+		surface->unlock();
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/support/font.h b/engines/titanic/support/font.h
index c41f4dc..5ed0b5b 100644
--- a/engines/titanic/support/font.h
+++ b/engines/titanic/support/font.h
@@ -25,24 +25,38 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
+#include "titanic/support/rect.h"
 #include "titanic/support/string.h"
 
 namespace Titanic {
 
+class CVideoSurface;
+
 class STFont {
 	struct CharEntry {
-		uint _charWidth;
+		uint _width;
 		uint _offset;
 	};
+private:
+	/**
+	 * Copys a rectangle representing a character in the font data to
+	 * a given destination position in the surface
+	 */
+	void copyRect(CVideoSurface *surface, const Common::Point &destPos, 
+		Rect &srcRect);
+
+	/**
+	 * Write a character
+	 */
+	int writeChar(CVideoSurface *surface, unsigned char c, 
+		const Common::Point &pt, Rect *destRect, Rect *srcRect);
 public:
 	byte *_dataPtr;
 	size_t _dataSize;
-	int _field8;
-	int _maxCharWidth;
+	int _fontHeight;
+	uint _dataWidth;
 	CharEntry _chars[256];
-	int _field810;
-	int _field814;
-	int _field818;
+	byte _fontR, _fontG, _fontB;
 public:
 	STFont();
 	~STFont();
@@ -62,6 +76,16 @@ public:
 	 * TODO: Verify this
 	 */
 	void writeString(int maxWidth, const CString &text, int *v1, int *v2);
+
+	/**
+	 * Sets the font color
+	 */
+	void setColor(byte r, byte g, byte b);
+
+	/**
+	 * Gets the font color
+	 */
+	uint16 getColor() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 6bba24d..ebe552a 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -373,4 +373,9 @@ int OSVideoSurface::freeSurface() {
 	return surfaceSize;
 }
 
+uint16 *OSVideoSurface::getBasePtr(int x, int y) {
+	assert(_rawSurface);
+	return (uint16 *)_rawSurface->getBasePtr(x, y);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 1de6a1d..da53270 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -176,7 +176,10 @@ public:
 	 */
 	virtual int freeSurface() { return 0; }
 
-
+	/**
+	 * Get a pointer into the underlying surface
+	 */
+	virtual uint16 *getBasePtr(int x, int y) = 0;
 
 	/**
 	 * Blit from another surface
@@ -299,6 +302,11 @@ public:
 	 * Frees the underlying surface
 	 */
 	virtual int freeSurface();
+
+	/**
+	 * Get a pointer into the underlying surface
+	 */
+	virtual uint16 *getBasePtr(int x, int y);
 };
 
 } // End of namespace Titanic


Commit: 3acf1116cd7eff2f98538f8457f724ac25b28df1
    https://github.com/scummvm/scummvm/commit/3acf1116cd7eff2f98538f8457f724ac25b28df1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-04T07:54:02-04:00

Commit Message:
TITANIC: Implemented STFont::copyRect

Changed paths:
    engines/titanic/support/font.cpp



diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index 3265258..55865e7 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -148,6 +148,14 @@ void STFont::copyRect(CVideoSurface *surface, const Common::Point &pt, Rect &rec
 		uint16 *lineP = surface->getBasePtr(pt.x, pt.y);
 		uint16 color = getColor();
 
+		for (int yp = rect.top; yp < rect.bottom; ++yp, lineP += surface->getPitch()) {
+			uint16 *destP = lineP;
+			for (int xp = rect.left; xp < rect.right; ++xp, ++destP) {
+				const byte *srcP = _dataPtr + yp * _dataWidth + xp;
+				//surface->changePixel(destP, color, *srcP >> 3, 1);
+			}
+		}
+
 		surface->unlock();
 	}
 }


Commit: 572301a33efc8c574d7ab2fc9b243050b2db1492
    https://github.com/scummvm/scummvm/commit/572301a33efc8c574d7ab2fc9b243050b2db1492
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-04T18:15:02-04:00

Commit Message:
TITANIC: Implement OSVideoSurface::setupMap

Changed paths:
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index ebe552a..a1b2638 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -182,6 +182,34 @@ OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, const CResourceKey
 	}
 }
 
+void OSVideoSurface::setupMap(byte map[0x400], byte val) {
+	byte *pBase = map;
+	int incr = 0;
+
+	for (uint idx1 = 0; idx1 < 32; ++idx1, pBase += 32) {
+		for (uint idx2 = 0, base = 0; idx2 < 32; ++idx2, base += incr) {
+			int64 v = 0x84210843;
+			v *= base;
+			v = ((v >> 32) + base) >> 4;
+			v += (v >> 31);
+			pBase[idx2] = v;
+
+			if (val != 0xff) {
+				v &= 0xff;
+				if (v != idx2) {
+					v = 0x80808081 * val * v * val;
+					v = (v >> 32) + incr;
+					incr = idx1;
+
+					v >>= 7;
+					v += (v >> 31);
+					pBase[idx2] = v;
+				}
+			}
+		}
+	}
+}
+
 void OSVideoSurface::loadResource(const CResourceKey &key) {
 	_resourceKey = key;
 	_pendingLoad = true;
@@ -323,6 +351,10 @@ uint16 OSVideoSurface::getPixel(const Common::Point &pt) {
 	}
 }
 
+void OSVideoSurface::changePixel(uint16 *pixelP, uint16 color, int val3, int val5) {
+	// TODO
+}
+
 void OSVideoSurface::shiftColors() {
 	if (!loadIfReady())
 		return;
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index da53270..e1ddde8 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -143,6 +143,11 @@ public:
 	virtual uint16 getPixel(const Common::Point &pt) = 0;
 
 	/**
+	 * Change a pixel
+	 */
+	virtual void changePixel(uint16 *pixelP, uint16 color, int val3, int val5) = 0;
+
+	/**
 	 * Shifts the colors of the surface.. maybe greys it out?
 	 */
 	virtual void shiftColors() = 0;
@@ -202,6 +207,18 @@ public:
 };
 
 class OSVideoSurface : public CVideoSurface {
+private:
+	static byte _map[0x400];
+
+	/**
+	 * Setup the color mapping table
+	 */
+	static void setupMap(byte map[0x400], byte val);
+public:
+	/**
+	 * Setup statics
+	 */
+	static void setup() { setupMap(_map, 0xff); }
 public:
 	OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface);
 	OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool flag = false);
@@ -272,6 +289,11 @@ public:
 	virtual uint16 getPixel(const Common::Point &pt);
 
 	/**
+	 * Change a pixel
+	 */
+	virtual void changePixel(uint16 *pixelP, uint16 color, int val3, int val5);
+
+	/**
 	 * Shifts the colors of the surface.. maybe greys it out?
 	 */
 	virtual void shiftColors();


Commit: 303f577c4f9b36cd78f5104a2971a27263fb051c
    https://github.com/scummvm/scummvm/commit/303f577c4f9b36cd78f5104a2971a27263fb051c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-04T22:18:18-04:00

Commit Message:
TITANIC: Hacked copy of AVIDecoder to handle ycursors.avi

Mouse cursor is now somewhat correctly showing

Changed paths:
  A engines/titanic/support/avi_decoder.cpp
  A engines/titanic/support/avi_decoder.h
    engines/titanic/module.mk
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 441de8c..a29d3df 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -422,6 +422,7 @@ MODULE_OBJS := \
 	star_control/star_control_sub13.o \
 	star_control/star_control_sub14.o \
 	star_control/star_control_sub15.o \
+	support/avi_decoder.o \
 	support/direct_draw.o \
 	support/direct_draw_surface.o \
 	support/files_manager.o \
diff --git a/engines/titanic/support/avi_decoder.cpp b/engines/titanic/support/avi_decoder.cpp
new file mode 100644
index 0000000..81d8a58
--- /dev/null
+++ b/engines/titanic/support/avi_decoder.cpp
@@ -0,0 +1,946 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/stream.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+
+#include "audio/audiostream.h"
+#include "audio/mixer.h"
+
+#include "titanic/support/avi_decoder.h"
+
+// Audio Codecs
+#include "audio/decoders/adpcm.h"
+#include "audio/decoders/mp3.h"
+#include "audio/decoders/raw.h"
+
+// Video Codecs
+#include "image/codecs/codec.h"
+
+namespace Titanic {
+
+#define UNKNOWN_HEADER(a) error("Unknown header found -- \'%s\'", tag2str(a))
+
+// IDs used throughout the AVI files
+// that will be handled by this player
+#define ID_RIFF MKTAG('R','I','F','F')
+#define ID_AVI  MKTAG('A','V','I',' ')
+#define ID_LIST MKTAG('L','I','S','T')
+#define ID_HDRL MKTAG('h','d','r','l')
+#define ID_AVIH MKTAG('a','v','i','h')
+#define ID_STRL MKTAG('s','t','r','l')
+#define ID_STRH MKTAG('s','t','r','h')
+#define ID_VIDS MKTAG('v','i','d','s')
+#define ID_AUDS MKTAG('a','u','d','s')
+#define ID_MIDS MKTAG('m','i','d','s')
+#define ID_TXTS MKTAG('t','x','t','s')
+#define ID_JUNK MKTAG('J','U','N','K')
+#define ID_JUNQ MKTAG('J','U','N','Q')
+#define ID_DMLH MKTAG('d','m','l','h')
+#define ID_STRF MKTAG('s','t','r','f')
+#define ID_MOVI MKTAG('m','o','v','i')
+#define ID_REC  MKTAG('r','e','c',' ')
+#define ID_VEDT MKTAG('v','e','d','t')
+#define ID_IDX1 MKTAG('i','d','x','1')
+#define ID_STRD MKTAG('s','t','r','d')
+#define ID_INFO MKTAG('I','N','F','O')
+#define ID_ISFT MKTAG('I','S','F','T')
+#define ID_DISP MKTAG('D','I','S','P')
+#define ID_PRMI MKTAG('P','R','M','I')
+#define ID_STRN MKTAG('s','t','r','n')
+
+// Stream Types
+enum {
+	kStreamTypePaletteChange = MKTAG16('p', 'c'),
+	kStreamTypeAudio         = MKTAG16('w', 'b')
+};
+
+
+AVIDecoder::AVIDecoder(Audio::Mixer::SoundType soundType) : _frameRateOverride(0), _soundType(soundType) {
+	initCommon();
+}
+
+AVIDecoder::AVIDecoder(const Common::Rational &frameRateOverride, Audio::Mixer::SoundType soundType)
+		: _frameRateOverride(frameRateOverride), _soundType(soundType) {
+	initCommon();
+}
+
+AVIDecoder::~AVIDecoder() {
+	close();
+}
+
+AVIDecoder::AVIAudioTrack *AVIDecoder::createAudioTrack(AVIStreamHeader sHeader, PCMWaveFormat wvInfo) {
+	return new AVIAudioTrack(sHeader, wvInfo, _soundType);
+}
+
+void AVIDecoder::initCommon() {
+	_decodedHeader = false;
+	_foundMovieList = false;
+	_movieListStart = 0;
+	_movieListEnd = 0;
+	_fileStream = 0;
+	memset(&_header, 0, sizeof(_header));
+}
+
+bool AVIDecoder::isSeekable() const {
+	// Only videos with an index can seek
+	// Anyone else who wants to seek is crazy.
+	return isVideoLoaded() && !_indexEntries.empty();
+}
+
+bool AVIDecoder::parseNextChunk() {
+	uint32 tag = _fileStream->readUint32BE();
+	uint32 size = _fileStream->readUint32LE();
+
+	if (_fileStream->eos())
+		return false;
+
+	debug(3, "Decoding tag %s", tag2str(tag));
+
+	switch (tag) {
+	case ID_LIST:
+		handleList(size);
+		break;
+	case ID_AVIH:
+		_header.size = size;
+		_header.microSecondsPerFrame = _fileStream->readUint32LE();
+		_header.maxBytesPerSecond = _fileStream->readUint32LE();
+		_header.padding = _fileStream->readUint32LE();
+		_header.flags = _fileStream->readUint32LE();
+		_header.totalFrames = _fileStream->readUint32LE();
+		_header.initialFrames = _fileStream->readUint32LE();
+		_header.streams = _fileStream->readUint32LE();
+		_header.bufferSize = _fileStream->readUint32LE();
+		_header.width = _fileStream->readUint32LE();
+		_header.height = _fileStream->readUint32LE();
+		// Ignore 16 bytes of reserved data
+		_fileStream->skip(16);
+		break;
+	case ID_STRH:
+		handleStreamHeader(size);
+		break;
+	case ID_STRD: // Extra stream info, safe to ignore
+	case ID_VEDT: // Unknown, safe to ignore
+	case ID_JUNK: // Alignment bytes, should be ignored
+	case ID_JUNQ: // Same as JUNK, safe to ignore
+	case ID_ISFT: // Metadata, safe to ignore
+	case ID_DISP: // Metadata, should be safe to ignore
+	case ID_STRN: // Metadata, safe to ignore
+	case ID_DMLH: // OpenDML extension, contains an extra total frames field, safe to ignore
+		skipChunk(size);
+		break;
+	case ID_IDX1:
+		readOldIndex(size);
+		break;
+	case 0:
+		return false;
+	default:
+		error("Unknown tag \'%s\' found", tag2str(tag));
+	}
+
+	return true;
+}
+
+void AVIDecoder::skipChunk(uint32 size) {
+	// Make sure we're aligned on a word boundary
+	_fileStream->skip(size + (size & 1));
+}
+
+void AVIDecoder::handleList(uint32 listSize) {
+	uint32 listType = _fileStream->readUint32BE();
+	listSize -= 4; // Subtract away listType's 4 bytes
+	uint32 curPos = _fileStream->pos();
+
+	debug(0, "Found LIST of type %s", tag2str(listType));
+
+	switch (listType) {
+	case ID_MOVI: // Movie List
+		// We found the movie block
+		_foundMovieList = true;
+		_movieListStart = curPos;
+		_movieListEnd = _movieListStart + listSize + (listSize & 1);
+		_fileStream->skip(listSize);
+		return;
+	case ID_HDRL: // Header List
+		// Mark the header as decoded
+		_decodedHeader = true;
+		break;
+	case ID_INFO: // Metadata
+	case ID_PRMI: // Adobe Premiere metadata, safe to ignore
+		// Ignore metadata
+		_fileStream->skip(listSize);
+		return;
+	case ID_STRL: // Stream list
+	default:      // (Just hope we can parse it!)
+		break;
+	}
+
+	while ((_fileStream->pos() - curPos) < listSize)
+		parseNextChunk();
+}
+
+void AVIDecoder::handleStreamHeader(uint32 size) {
+	AVIStreamHeader sHeader;
+	sHeader.size = size;
+	sHeader.streamType = _fileStream->readUint32BE();
+
+	if (sHeader.streamType == ID_MIDS || sHeader.streamType == ID_TXTS)
+		error("Unhandled MIDI/Text stream");
+
+	sHeader.streamHandler = _fileStream->readUint32BE();
+	sHeader.flags = _fileStream->readUint32LE();
+	sHeader.priority = _fileStream->readUint16LE();
+	sHeader.language = _fileStream->readUint16LE();
+	sHeader.initialFrames = _fileStream->readUint32LE();
+	sHeader.scale = _fileStream->readUint32LE();
+	sHeader.rate = _fileStream->readUint32LE();
+	sHeader.start = _fileStream->readUint32LE();
+	sHeader.length = _fileStream->readUint32LE();
+	sHeader.bufferSize = _fileStream->readUint32LE();
+	sHeader.quality = _fileStream->readUint32LE();
+	sHeader.sampleSize = _fileStream->readUint32LE();
+
+	_fileStream->skip(sHeader.size - 48); // Skip over the remainder of the chunk (frame)
+
+	if (_fileStream->readUint32BE() != ID_STRF)
+		error("Could not find STRF tag");
+
+	uint32 strfSize = _fileStream->readUint32LE();
+	uint32 startPos = _fileStream->pos();
+
+	if (sHeader.streamType == ID_VIDS) {
+		if (_frameRateOverride != 0) {
+			sHeader.rate = _frameRateOverride.getNumerator();
+			sHeader.scale = _frameRateOverride.getDenominator();
+		}
+
+		BitmapInfoHeader bmInfo;
+		bmInfo.size = _fileStream->readUint32LE();
+		bmInfo.width = _fileStream->readUint32LE();
+		bmInfo.height = _fileStream->readUint32LE();
+		bmInfo.planes = _fileStream->readUint16LE();
+		bmInfo.bitCount = _fileStream->readUint16LE();
+		bmInfo.compression = _fileStream->readUint32BE();
+		bmInfo.sizeImage = _fileStream->readUint32LE();
+		bmInfo.xPelsPerMeter = _fileStream->readUint32LE();
+		bmInfo.yPelsPerMeter = _fileStream->readUint32LE();
+		bmInfo.clrUsed = _fileStream->readUint32LE();
+		bmInfo.clrImportant = _fileStream->readUint32LE();
+
+		if (bmInfo.clrUsed == 0)
+			bmInfo.clrUsed = 256;
+
+		byte *initialPalette = 0;
+
+		if (bmInfo.bitCount == 8) {
+			initialPalette = new byte[256 * 3];
+			memset(initialPalette, 0, 256 * 3);
+
+			byte *palette = initialPalette;
+			for (uint32 i = 0; i < bmInfo.clrUsed; i++) {
+				palette[i * 3 + 2] = _fileStream->readByte();
+				palette[i * 3 + 1] = _fileStream->readByte();
+				palette[i * 3] = _fileStream->readByte();
+				_fileStream->readByte();
+			}
+		}
+
+		addTrack(new AVIVideoTrack(_header.totalFrames, sHeader, bmInfo, initialPalette));
+	} else if (sHeader.streamType == ID_AUDS) {
+		PCMWaveFormat wvInfo;
+		wvInfo.tag = _fileStream->readUint16LE();
+		wvInfo.channels = _fileStream->readUint16LE();
+		wvInfo.samplesPerSec = _fileStream->readUint32LE();
+		wvInfo.avgBytesPerSec = _fileStream->readUint32LE();
+		wvInfo.blockAlign = _fileStream->readUint16LE();
+		wvInfo.size = _fileStream->readUint16LE();
+
+		// AVI seems to treat the sampleSize as including the second
+		// channel as well, so divide for our sake.
+		if (wvInfo.channels == 2)
+			sHeader.sampleSize /= 2;
+
+		AVIAudioTrack *track = createAudioTrack(sHeader, wvInfo);
+		track->createAudioStream();
+		addTrack(track);
+	}
+
+	// Ensure that we're at the end of the chunk
+	_fileStream->seek(startPos + strfSize);
+}
+
+bool AVIDecoder::loadStream(Common::SeekableReadStream *stream) {
+	close();
+
+	uint32 riffTag = stream->readUint32BE();
+	if (riffTag != ID_RIFF) {
+		warning("Failed to find RIFF header");
+		return false;
+	}
+
+	/* uint32 fileSize = */ stream->readUint32LE();
+	uint32 riffType = stream->readUint32BE();
+
+	if (riffType != ID_AVI) {
+		warning("RIFF not an AVI file");
+		return false;
+	}
+
+	_fileStream = stream;
+
+	// Go through all chunks in the file
+	while (parseNextChunk())
+		;
+
+	if (!_decodedHeader) {
+		warning("Failed to parse AVI header");
+		close();
+		return false;
+	}
+
+	if (!_foundMovieList) {
+		warning("Failed to find 'MOVI' list");
+		close();
+		return false;
+	}
+
+	// Create the status entries
+	uint32 index = 0;
+	for (TrackListIterator it = getTrackListBegin(); it != getTrackListEnd(); it++, index++) {
+		TrackStatus status;
+		status.track = *it;
+		status.index = index;
+		status.chunkSearchOffset = _movieListStart;
+
+		if ((*it)->getTrackType() == Track::kTrackTypeVideo) {
+			if (_videoTracks.size() == 0)
+				_videoTracks.push_back(status);
+		} else {
+			if (_audioTracks.size() == 0)
+				_audioTracks.push_back(status);
+		}
+	}
+
+	if (_videoTracks.size() != 1) {
+		warning("Unhandled AVI video track count: %d", _videoTracks.size());
+		close();
+		return false;
+	}
+
+	// Check if this is a special Duck Truemotion video
+	checkTruemotion1();
+
+	return true;
+}
+
+void AVIDecoder::close() {
+	VideoDecoder::close();
+
+	delete _fileStream;
+	_fileStream = 0;
+	_decodedHeader = false;
+	_foundMovieList = false;
+	_movieListStart = 0;
+	_movieListEnd = 0;
+
+	_indexEntries.clear();
+	memset(&_header, 0, sizeof(_header));
+
+	_videoTracks.clear();
+	_audioTracks.clear();
+}
+
+void AVIDecoder::readNextPacket() {
+	// Shouldn't get this unless called on a non-open video
+	if (_videoTracks.empty())
+		return;
+
+	// Get the video frame first
+	handleNextPacket(_videoTracks[0]);
+
+	// Handle audio tracks next
+	for (uint32 i = 0; i < _audioTracks.size(); i++)
+		handleNextPacket(_audioTracks[i]);
+}
+
+void AVIDecoder::handleNextPacket(TrackStatus &status) {
+	// If there's no more to search, bail out
+	if (status.chunkSearchOffset + 8 >= _movieListEnd) {
+		if (status.track->getTrackType() == Track::kTrackTypeVideo) {
+			// Horrible AVI video has a premature end
+			// Force the frame to be the last frame
+			debug(0, "Forcing end of AVI video");
+			((AVIVideoTrack *)status.track)->forceTrackEnd();
+		}
+
+		return;
+	}
+
+	// See if audio needs to be buffered and break out if not
+	if (status.track->getTrackType() == Track::kTrackTypeAudio && !shouldQueueAudio(status))
+		return;
+
+	// Seek to where we shall start searching
+	_fileStream->seek(status.chunkSearchOffset);
+
+	for (;;) {
+		// If there's no more to search, bail out
+		if ((uint32)_fileStream->pos() + 8 >= _movieListEnd) {
+			if (status.track->getTrackType() == Track::kTrackTypeVideo) {
+				// Horrible AVI video has a premature end
+				// Force the frame to be the last frame
+				debug(0, "Forcing end of AVI video");
+				((AVIVideoTrack *)status.track)->forceTrackEnd();
+			}
+
+			break;
+		}
+
+		uint32 nextTag = _fileStream->readUint32BE();
+		uint32 size = _fileStream->readUint32LE();
+
+		if (nextTag == ID_LIST) {
+			// A list of audio/video chunks
+			if (_fileStream->readUint32BE() != ID_REC)
+				error("Expected 'rec ' LIST");
+
+			continue;
+		} else if (nextTag == ID_JUNK || nextTag == ID_IDX1) {
+			skipChunk(size);
+			continue;
+		}
+
+		// Only accept chunks for this stream
+		uint32 streamIndex = getStreamIndex(nextTag);
+		if (streamIndex != status.index) {
+			skipChunk(size);
+			continue;
+		}
+
+		Common::SeekableReadStream *chunk = 0;
+
+		if (size != 0) {
+			chunk = _fileStream->readStream(size);
+			_fileStream->skip(size & 1);
+		}
+
+		if (status.track->getTrackType() == Track::kTrackTypeAudio) {
+			if (getStreamType(nextTag) != kStreamTypeAudio)
+				error("Invalid audio track tag '%s'", tag2str(nextTag));
+
+			assert(chunk);
+			((AVIAudioTrack *)status.track)->queueSound(chunk);
+
+			// Break out if we have enough audio
+			if (!shouldQueueAudio(status))
+				break;
+		} else {
+			AVIVideoTrack *videoTrack = (AVIVideoTrack *)status.track;
+
+			if (getStreamType(nextTag) == kStreamTypePaletteChange) {
+				// Palette Change
+				videoTrack->loadPaletteFromChunk(chunk);
+			} else {
+				// Otherwise, assume it's a compressed frame
+				videoTrack->decodeFrame(chunk);
+				break;
+			}
+		}
+	}
+
+	// Start us off in this position next time
+	status.chunkSearchOffset = _fileStream->pos();
+}
+
+bool AVIDecoder::shouldQueueAudio(TrackStatus& status) {
+	// Sanity check:
+	if (status.track->getTrackType() != Track::kTrackTypeAudio)
+		return false;
+
+	// If video is done, make sure that the rest of the audio is queued
+	// (I guess this is also really a sanity check)
+	AVIVideoTrack *videoTrack = (AVIVideoTrack *)_videoTracks[0].track;
+	if (videoTrack->endOfTrack())
+		return true;
+
+	// Being three frames ahead should be enough for any video.
+	return ((AVIAudioTrack *)status.track)->getCurChunk() < (uint32)(videoTrack->getCurFrame() + 3);
+}
+
+bool AVIDecoder::rewind() {
+	if (!VideoDecoder::rewind())
+		return false;
+
+	for (uint32 i = 0; i < _videoTracks.size(); i++)
+		_videoTracks[i].chunkSearchOffset = _movieListStart;
+
+	for (uint32 i = 0; i < _audioTracks.size(); i++)
+		_audioTracks[i].chunkSearchOffset = _movieListStart;
+
+	return true;
+}
+
+bool AVIDecoder::seekIntern(const Audio::Timestamp &time) {
+	// Can't seek beyond the end
+	if (time > getDuration())
+		return false;
+
+	// Get our video
+	AVIVideoTrack *videoTrack = (AVIVideoTrack *)_videoTracks[0].track;
+	uint32 videoIndex = _videoTracks[0].index;
+
+	// If we seek directly to the end, just mark the tracks as over
+	if (time == getDuration()) {
+		videoTrack->setCurFrame(videoTrack->getFrameCount() - 1);
+
+		for (TrackListIterator it = getTrackListBegin(); it != getTrackListEnd(); it++)
+			if ((*it)->getTrackType() == Track::kTrackTypeAudio)
+				((AVIAudioTrack *)*it)->resetStream();
+
+		return true;
+	}
+
+	// Get the frame we should be on at this time
+	uint frame = videoTrack->getFrameAtTime(time);
+
+	// Reset any palette, if necessary
+	videoTrack->useInitialPalette();
+
+	int lastKeyFrame = -1;
+	int frameIndex = -1;
+	uint curFrame = 0;
+
+	// Go through and figure out where we should be
+	// If there's a palette, we need to find the palette too
+	for (uint32 i = 0; i < _indexEntries.size(); i++) {
+		const OldIndex &index = _indexEntries[i];
+
+		// We don't care about RECs
+		if (index.id == ID_REC)
+			continue;
+
+		// We're only looking at entries for this track
+		if (getStreamIndex(index.id) != videoIndex)
+			continue;
+
+		uint16 streamType = getStreamType(index.id);
+
+		if (streamType == kStreamTypePaletteChange) {
+			// We need to handle any palette change we see since there's no
+			// flag to tell if this is a "key" palette.
+			// Decode the palette
+			_fileStream->seek(_indexEntries[i].offset + 8);
+			Common::SeekableReadStream *chunk = 0;
+
+			if (_indexEntries[i].size != 0)
+				chunk = _fileStream->readStream(_indexEntries[i].size);
+
+			videoTrack->loadPaletteFromChunk(chunk);
+		} else {
+			// Check to see if this is a keyframe
+			// The first frame has to be a keyframe
+			if ((_indexEntries[i].flags & AVIIF_INDEX) || curFrame == 0)
+				lastKeyFrame = i;
+
+			// Did we find the target frame?
+			if (frame == curFrame) {
+				frameIndex = i;
+				break;
+			}
+
+			curFrame++;
+		}
+	}
+
+	if (frameIndex < 0) // This shouldn't happen.
+		return false;
+
+	// Update all the audio tracks
+	for (uint32 i = 0; i < _audioTracks.size(); i++) {
+		AVIAudioTrack *audioTrack = (AVIAudioTrack *)_audioTracks[i].track;
+
+		// Recreate the audio stream
+		audioTrack->resetStream();
+
+		// Set the chunk index for the track
+		audioTrack->setCurChunk(frame);
+
+		uint32 chunksFound = 0;
+		for (uint32 j = 0; j < _indexEntries.size(); j++) {
+			const OldIndex &index = _indexEntries[j];
+
+			// Continue ignoring RECs
+			if (index.id == ID_REC)
+				continue;
+
+			if (getStreamIndex(index.id) == _audioTracks[i].index) {
+				if (chunksFound == frame) {
+					_fileStream->seek(index.offset + 8);
+					Common::SeekableReadStream *audioChunk = _fileStream->readStream(index.size);
+					audioTrack->queueSound(audioChunk);
+					_audioTracks[i].chunkSearchOffset = (j == _indexEntries.size() - 1) ? _movieListEnd : _indexEntries[j + 1].offset;
+					break;
+				}
+
+				chunksFound++;
+			}
+		}
+
+		// Skip any audio to bring us to the right time
+		audioTrack->skipAudio(time, videoTrack->getFrameTime(frame));
+	}
+
+	// Decode from keyFrame to curFrame - 1
+	for (int i = lastKeyFrame; i < frameIndex; i++) {
+		if (_indexEntries[i].id == ID_REC)
+			continue;
+
+		if (getStreamIndex(_indexEntries[i].id) != videoIndex)
+			continue;
+
+		uint16 streamType = getStreamType(_indexEntries[i].id);
+
+		// Ignore palettes, they were already handled
+		if (streamType == kStreamTypePaletteChange)
+			continue;
+
+		// Frame, hopefully
+		_fileStream->seek(_indexEntries[i].offset + 8);
+		Common::SeekableReadStream *chunk = 0;
+
+		if (_indexEntries[i].size != 0)
+			chunk = _fileStream->readStream(_indexEntries[i].size);
+
+		videoTrack->decodeFrame(chunk);
+	}
+
+	// Set the video track's frame
+	videoTrack->setCurFrame((int)frame - 1);
+
+	// Set the video track's search offset to the right spot
+	_videoTracks[0].chunkSearchOffset = _indexEntries[frameIndex].offset;
+	return true;
+}
+
+byte AVIDecoder::getStreamIndex(uint32 tag) const {
+	char string[3];
+	WRITE_BE_UINT16(string, tag >> 16);
+	string[2] = 0;
+	return strtol(string, 0, 16);
+}
+
+void AVIDecoder::readOldIndex(uint32 size) {
+	uint32 entryCount = size / 16;
+
+	debug(0, "Old Index: %d entries", entryCount);
+
+	if (entryCount == 0)
+		return;
+
+	// Read the first index separately
+	OldIndex firstEntry;
+	firstEntry.id = _fileStream->readUint32BE();
+	firstEntry.flags = _fileStream->readUint32LE();
+	firstEntry.offset = _fileStream->readUint32LE();
+	firstEntry.size = _fileStream->readUint32LE();
+
+	// Check if the offset is already absolute
+	// If it's absolute, the offset will equal the start of the movie list
+	bool isAbsolute = firstEntry.offset == _movieListStart;
+
+	debug(1, "Old index is %s", isAbsolute ? "absolute" : "relative");
+
+	if (!isAbsolute)
+		firstEntry.offset += _movieListStart - 4;
+
+	debug(0, "Index 0: Tag '%s', Offset = %d, Size = %d (Flags = %d)", tag2str(firstEntry.id), firstEntry.offset, firstEntry.size, firstEntry.flags);
+	_indexEntries.push_back(firstEntry);
+
+	for (uint32 i = 1; i < entryCount; i++) {
+		OldIndex indexEntry;
+		indexEntry.id = _fileStream->readUint32BE();
+		indexEntry.flags = _fileStream->readUint32LE();
+		indexEntry.offset = _fileStream->readUint32LE();
+		indexEntry.size = _fileStream->readUint32LE();
+
+		// Adjust to absolute, if necessary
+		if (!isAbsolute)
+			indexEntry.offset += _movieListStart - 4;
+
+		_indexEntries.push_back(indexEntry);
+		debug(0, "Index %d: Tag '%s', Offset = %d, Size = %d (Flags = %d)", i, tag2str(indexEntry.id), indexEntry.offset, indexEntry.size, indexEntry.flags);
+	}
+}
+
+void AVIDecoder::checkTruemotion1() {
+	// If we got here from loadStream(), we know the track is valid
+	assert(!_videoTracks.empty());
+
+	TrackStatus &status = _videoTracks[0];
+	AVIVideoTrack *track = (AVIVideoTrack *)status.track;
+
+	// Ignore non-truemotion tracks
+	if (!track->isTruemotion1())
+		return;
+
+	// Read the next video packet
+	handleNextPacket(status);
+
+	const Graphics::Surface *frame = track->decodeNextFrame();
+	if (!frame) {
+		rewind();
+		return;
+	}
+
+	// Fill in the width/height based on the frame's width/height
+	_header.width = frame->w;
+	_header.height = frame->h;
+	track->forceDimensions(frame->w, frame->h);
+
+	// Rewind us back to the beginning
+	rewind();
+}
+
+Video::VideoDecoder::AudioTrack *AVIDecoder::getAudioTrack(int index) {
+	// AVI audio track indexes are relative to the first track
+	Track *track = getTrack(index);
+
+	if (!track || track->getTrackType() != Track::kTrackTypeAudio)
+		return 0;
+
+	return (AudioTrack *)track;
+}
+
+AVIDecoder::AVIVideoTrack::AVIVideoTrack(int frameCount, const AVIStreamHeader &streamHeader, const BitmapInfoHeader &bitmapInfoHeader, byte *initialPalette)
+		: _frameCount(frameCount), _vidsHeader(streamHeader), _bmInfo(bitmapInfoHeader), _initialPalette(initialPalette) {
+	_videoCodec = createCodec();
+	_lastFrame = 0;
+	_curFrame = -1;
+
+	useInitialPalette();
+}
+
+AVIDecoder::AVIVideoTrack::~AVIVideoTrack() {
+	delete _videoCodec;
+	delete[] _initialPalette;
+}
+
+void AVIDecoder::AVIVideoTrack::decodeFrame(Common::SeekableReadStream *stream) {
+	if (stream) {
+		if (_videoCodec)
+			_lastFrame = _videoCodec->decodeFrame(*stream);
+	} else {
+		// Empty frame
+		_lastFrame = 0;
+	}
+
+	delete stream;
+	_curFrame++;
+}
+
+Graphics::PixelFormat AVIDecoder::AVIVideoTrack::getPixelFormat() const {
+	if (_videoCodec)
+		return _videoCodec->getPixelFormat();
+
+	return Graphics::PixelFormat();
+}
+
+void AVIDecoder::AVIVideoTrack::loadPaletteFromChunk(Common::SeekableReadStream *chunk) {
+	assert(chunk);
+	byte firstEntry = chunk->readByte();
+	uint16 numEntries = chunk->readByte();
+	chunk->readUint16LE(); // Reserved
+
+	// 0 entries means all colors are going to be changed
+	if (numEntries == 0)
+		numEntries = 256;
+
+	for (uint16 i = firstEntry; i < numEntries + firstEntry; i++) {
+		_palette[i * 3] = chunk->readByte();
+		_palette[i * 3 + 1] = chunk->readByte();
+		_palette[i * 3 + 2] = chunk->readByte();
+		chunk->readByte(); // Flags that don't serve us any purpose
+	}
+
+	delete chunk;
+	_dirtyPalette = true;
+}
+
+void AVIDecoder::AVIVideoTrack::useInitialPalette() {
+	_dirtyPalette = false;
+
+	if (_initialPalette) {
+		memcpy(_palette, _initialPalette, sizeof(_palette));
+		_dirtyPalette = true;
+	}
+}
+
+bool AVIDecoder::AVIVideoTrack::isTruemotion1() const {
+	return _bmInfo.compression == MKTAG('D', 'U', 'C', 'K') || _bmInfo.compression == MKTAG('d', 'u', 'c', 'k');
+}
+
+void AVIDecoder::AVIVideoTrack::forceDimensions(uint16 width, uint16 height) {
+	_bmInfo.width = width;
+	_bmInfo.height = height;
+}
+
+bool AVIDecoder::AVIVideoTrack::rewind() {
+	_curFrame = -1;
+
+	useInitialPalette();
+
+	delete _videoCodec;
+	_videoCodec = createCodec();
+	_lastFrame = 0;
+	return true;
+}
+
+Image::Codec *AVIDecoder::AVIVideoTrack::createCodec() {
+	return Image::createBitmapCodec(_bmInfo.compression, _bmInfo.width, _bmInfo.height, _bmInfo.bitCount);
+}
+
+void AVIDecoder::AVIVideoTrack::forceTrackEnd() {
+	_curFrame = _frameCount - 1;
+}
+
+const byte *AVIDecoder::AVIVideoTrack::getPalette() const {
+	if (_videoCodec && _videoCodec->containsPalette())
+		return _videoCodec->getPalette();
+
+	_dirtyPalette = false;
+	return _palette;
+}
+
+bool AVIDecoder::AVIVideoTrack::hasDirtyPalette() const {
+	if (_videoCodec && _videoCodec->containsPalette())
+		return _videoCodec->hasDirtyPalette();
+
+	return _dirtyPalette;
+}
+
+bool AVIDecoder::AVIVideoTrack::canDither() const {
+	return _videoCodec && _videoCodec->canDither(Image::Codec::kDitherTypeVFW);
+}
+
+void AVIDecoder::AVIVideoTrack::setDither(const byte *palette) {
+	assert(_videoCodec);
+	_videoCodec->setDither(Image::Codec::kDitherTypeVFW, palette);
+}
+
+AVIDecoder::AVIAudioTrack::AVIAudioTrack(const AVIStreamHeader &streamHeader, const PCMWaveFormat &waveFormat, Audio::Mixer::SoundType soundType)
+		: _audsHeader(streamHeader), _wvInfo(waveFormat), _soundType(soundType), _audioStream(0), _packetStream(0), _curChunk(0) {
+}
+
+AVIDecoder::AVIAudioTrack::~AVIAudioTrack() {
+	delete _audioStream;
+}
+
+void AVIDecoder::AVIAudioTrack::queueSound(Common::SeekableReadStream *stream) {
+	if (_packetStream)
+		_packetStream->queuePacket(stream);
+	else
+		delete stream;
+
+	_curChunk++;
+}
+
+void AVIDecoder::AVIAudioTrack::skipAudio(const Audio::Timestamp &time, const Audio::Timestamp &frameTime) {
+	Audio::Timestamp timeDiff = time.convertToFramerate(_wvInfo.samplesPerSec) - frameTime.convertToFramerate(_wvInfo.samplesPerSec);
+	int skipFrames = timeDiff.totalNumberOfFrames();
+
+	if (skipFrames <= 0)
+		return;
+
+	Audio::AudioStream *audioStream = getAudioStream();
+	if (!audioStream)
+		return;
+
+	if (audioStream->isStereo())
+		skipFrames *= 2;
+
+	int16 *tempBuffer = new int16[skipFrames];
+	audioStream->readBuffer(tempBuffer, skipFrames);
+	delete[] tempBuffer;
+}
+
+void AVIDecoder::AVIAudioTrack::resetStream() {
+	delete _audioStream;
+	createAudioStream();
+	_curChunk = 0;
+}
+
+bool AVIDecoder::AVIAudioTrack::rewind() {
+	resetStream();
+	return true;
+}
+
+void AVIDecoder::AVIAudioTrack::createAudioStream() {
+	_packetStream = 0;
+
+	switch (_wvInfo.tag) {
+	case kWaveFormatPCM: {
+		byte flags = 0;
+		if (_audsHeader.sampleSize == 2)
+			flags |= Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN;
+		else
+			flags |= Audio::FLAG_UNSIGNED;
+
+		if (_wvInfo.channels == 2)
+			flags |= Audio::FLAG_STEREO;
+
+		_packetStream = Audio::makePacketizedRawStream(_wvInfo.samplesPerSec, flags);
+		break;
+	}
+	case kWaveFormatMSADPCM:
+		_packetStream = Audio::makePacketizedADPCMStream(Audio::kADPCMMS, _wvInfo.samplesPerSec, _wvInfo.channels, _wvInfo.blockAlign);
+		break;
+	case kWaveFormatMSIMAADPCM:
+		_packetStream = Audio::makePacketizedADPCMStream(Audio::kADPCMMSIma, _wvInfo.samplesPerSec, _wvInfo.channels, _wvInfo.blockAlign);
+		break;
+	case kWaveFormatDK3:
+		_packetStream = Audio::makePacketizedADPCMStream(Audio::kADPCMDK3, _wvInfo.samplesPerSec, _wvInfo.channels, _wvInfo.blockAlign);
+		break;
+	case kWaveFormatMP3:
+#ifdef USE_MAD
+		_packetStream = Audio::makePacketizedMP3Stream(_wvInfo.channels, _wvInfo.samplesPerSec);
+#else
+		warning("AVI MP3 stream found, but no libmad support compiled in");
+#endif
+		break;
+	case kWaveFormatNone:
+		break;
+	default:
+		warning("Unsupported AVI audio format %d", _wvInfo.tag);
+		break;
+	}
+
+	if (_packetStream)
+		_audioStream = _packetStream;
+	else
+		_audioStream = Audio::makeNullAudioStream();
+}
+
+AVIDecoder::TrackStatus::TrackStatus() : track(0), chunkSearchOffset(0) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/avi_decoder.h b/engines/titanic/support/avi_decoder.h
new file mode 100644
index 0000000..acc33cb
--- /dev/null
+++ b/engines/titanic/support/avi_decoder.h
@@ -0,0 +1,285 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AVI_DECODER_H
+#define TITANIC_AVI_DECODER_H
+
+#include "common/array.h"
+#include "common/rational.h"
+#include "common/rect.h"
+#include "common/str.h"
+
+#include "video/video_decoder.h"
+#include "audio/mixer.h"
+
+namespace Audio {
+class AudioStream;
+class PacketizedAudioStream;
+}
+
+namespace Common {
+class SeekableReadStream;
+}
+
+namespace Graphics {
+struct PixelFormat;
+}
+
+namespace Image {
+class Codec;
+}
+
+namespace Titanic {
+
+/**
+ * Modified AVI Decoder used by Titanic engine.
+ */
+class AVIDecoder : public Video::VideoDecoder {
+public:
+	AVIDecoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType);
+	AVIDecoder(const Common::Rational &frameRateOverride, Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType);
+	virtual ~AVIDecoder();
+
+	bool loadStream(Common::SeekableReadStream *stream);
+	void close();
+	uint16 getWidth() const { return _header.width; }
+	uint16 getHeight() const { return _header.height; }
+
+	bool rewind();
+	bool isRewindable() const { return true; }
+	bool isSeekable() const;
+
+protected:
+	// VideoDecoder API
+	void readNextPacket();
+	bool seekIntern(const Audio::Timestamp &time);
+	bool supportsAudioTrackSwitching() const { return true; }
+	AudioTrack *getAudioTrack(int index);
+
+	struct BitmapInfoHeader {
+		uint32 size;
+		uint32 width;
+		uint32 height;
+		uint16 planes;
+		uint16 bitCount;
+		uint32 compression;
+		uint32 sizeImage;
+		uint32 xPelsPerMeter;
+		uint32 yPelsPerMeter;
+		uint32 clrUsed;
+		uint32 clrImportant;
+	};
+
+	struct WaveFormat {
+		uint16 tag;
+		uint16 channels;
+		uint32 samplesPerSec;
+		uint32 avgBytesPerSec;
+		uint16 blockAlign;
+	};
+
+	struct PCMWaveFormat : public WaveFormat {
+		uint16 size;
+	};
+
+	struct WaveFormatEX : public WaveFormat {
+		uint16 bitsPerSample;
+		uint16 size;
+	};
+
+	struct OldIndex {
+		uint32 id;
+		uint32 flags;
+		uint32 offset;
+		uint32 size;
+	};
+
+	// Index Flags
+	enum IndexFlags {
+		AVIIF_INDEX = 0x10
+	};
+
+	struct AVIHeader {
+		uint32 size;
+		uint32 microSecondsPerFrame;
+		uint32 maxBytesPerSecond;
+		uint32 padding;
+		uint32 flags;
+		uint32 totalFrames;
+		uint32 initialFrames;
+		uint32 streams;
+		uint32 bufferSize;
+		uint32 width;
+		uint32 height;
+	};
+
+	// Flags from the AVIHeader
+	enum AVIFlags {
+		AVIF_HASINDEX = 0x00000010,
+		AVIF_MUSTUSEINDEX = 0x00000020,
+		AVIF_ISINTERLEAVED = 0x00000100,
+		AVIF_TRUSTCKTYPE = 0x00000800,
+		AVIF_WASCAPTUREFILE = 0x00010000,
+		AVIF_WASCOPYRIGHTED = 0x00020000
+	};
+
+	struct AVIStreamHeader {
+		uint32 size;
+		uint32 streamType;
+		uint32 streamHandler;
+		uint32 flags;
+		uint16 priority;
+		uint16 language;
+		uint32 initialFrames;
+		uint32 scale;
+		uint32 rate;
+		uint32 start;
+		uint32 length;
+		uint32 bufferSize;
+		uint32 quality;
+		uint32 sampleSize;
+		Common::Rect frame;
+	};
+
+	class AVIVideoTrack : public FixedRateVideoTrack {
+	public:
+		AVIVideoTrack(int frameCount, const AVIStreamHeader &streamHeader, const BitmapInfoHeader &bitmapInfoHeader, byte *initialPalette = 0);
+		~AVIVideoTrack();
+
+		void decodeFrame(Common::SeekableReadStream *stream);
+		void forceTrackEnd();
+
+		uint16 getWidth() const { return _bmInfo.width; }
+		uint16 getHeight() const { return _bmInfo.height; }
+		Graphics::PixelFormat getPixelFormat() const;
+		int getCurFrame() const { return _curFrame; }
+		int getFrameCount() const { return _frameCount; }
+		const Graphics::Surface *decodeNextFrame() { return _lastFrame; }
+
+		const byte *getPalette() const;
+		bool hasDirtyPalette() const;
+		void setCurFrame(int frame) { _curFrame = frame; }
+		void loadPaletteFromChunk(Common::SeekableReadStream *chunk);
+		void useInitialPalette();
+		bool canDither() const;
+		void setDither(const byte *palette);
+
+		bool isTruemotion1() const;
+		void forceDimensions(uint16 width, uint16 height);
+
+		bool isRewindable() const { return true; }
+		bool rewind();
+
+	protected:
+		Common::Rational getFrameRate() const { return Common::Rational(_vidsHeader.rate, _vidsHeader.scale); }
+
+	private:
+		AVIStreamHeader _vidsHeader;
+		BitmapInfoHeader _bmInfo;
+		byte _palette[3 * 256];
+		byte *_initialPalette;
+		mutable bool _dirtyPalette;
+		int _frameCount, _curFrame;
+
+		Image::Codec *_videoCodec;
+		const Graphics::Surface *_lastFrame;
+		Image::Codec *createCodec();
+	};
+
+	class AVIAudioTrack : public AudioTrack {
+	public:
+		AVIAudioTrack(const AVIStreamHeader &streamHeader, const PCMWaveFormat &waveFormat, Audio::Mixer::SoundType soundType);
+		~AVIAudioTrack();
+
+		virtual void createAudioStream();
+		virtual void queueSound(Common::SeekableReadStream *stream);
+		Audio::Mixer::SoundType getSoundType() const { return _soundType; }
+		void skipAudio(const Audio::Timestamp &time, const Audio::Timestamp &frameTime);
+		virtual void resetStream();
+		uint32 getCurChunk() const { return _curChunk; }
+		void setCurChunk(uint32 chunk) { _curChunk = chunk; }
+
+		bool isRewindable() const { return true; }
+		bool rewind();
+
+	protected:
+		Audio::AudioStream *getAudioStream() const { return _audioStream; }
+
+		// Audio Codecs
+		enum {
+			kWaveFormatNone = 0,
+			kWaveFormatPCM = 1,
+			kWaveFormatMSADPCM = 2,
+			kWaveFormatMSIMAADPCM = 17,
+			kWaveFormatMP3 = 85,
+			kWaveFormatDK3 = 98		// rogue format number
+		};
+
+		AVIStreamHeader _audsHeader;
+		PCMWaveFormat _wvInfo;
+		Audio::Mixer::SoundType _soundType;
+		Audio::AudioStream *_audioStream;
+		Audio::PacketizedAudioStream *_packetStream;
+		uint32 _curChunk;
+	};
+
+	struct TrackStatus {
+		TrackStatus();
+
+		Track *track;
+		uint32 index;
+		uint32 chunkSearchOffset;
+	};
+
+	AVIHeader _header;
+
+	void readOldIndex(uint32 size);
+	Common::Array<OldIndex> _indexEntries;
+
+	Common::SeekableReadStream *_fileStream;
+	bool _decodedHeader;
+	bool _foundMovieList;
+	uint32 _movieListStart, _movieListEnd;
+
+	Audio::Mixer::SoundType _soundType;
+	Common::Rational _frameRateOverride;
+	void initCommon();
+
+	bool parseNextChunk();
+	void skipChunk(uint32 size);
+	void handleList(uint32 listSize);
+	void handleStreamHeader(uint32 size);
+	uint16 getStreamType(uint32 tag) const { return tag & 0xFFFF; }
+	byte getStreamIndex(uint32 tag) const;
+	void checkTruemotion1();
+
+	void handleNextPacket(TrackStatus& status);
+	bool shouldQueueAudio(TrackStatus& status);
+	Common::Array<TrackStatus> _videoTracks, _audioTracks;
+
+public:
+	virtual AVIAudioTrack *createAudioTrack(AVIStreamHeader sHeader, PCMWaveFormat wvInfo);
+};
+
+} // End of namespace Titanic
+
+#endif
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index ed5cffa..2590918 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -20,6 +20,8 @@
  *
  */
 
+#include "image/codecs/cinepak.h"
+#include "titanic/support/avi_decoder.h"
 #include "titanic/support/movie.h"
 #include "titanic/titanic.h"
 
@@ -44,7 +46,13 @@ bool CMovie::get10() {
 /*------------------------------------------------------------------------*/
 
 OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) : _videoSurface(surface) {
-//	_aviDecoder.loadFile(name.getString());
+	_video = new AVIDecoder();
+	if (!_video->loadFile(name.getString()))
+		error("Could not open video - %s", name.getString().c_str());
+}
+
+OSMovie::~OSMovie() {
+	delete _video;
 }
 
 void OSMovie::proc8(int v1, CVideoSurface *surface) {
@@ -76,13 +84,12 @@ void OSMovie::proc14() {
 }
 
 void OSMovie::setFrame(uint frameNumber) {
-	warning("TODO: OSMovie::setFrame");
-	/*
-	_aviDecoder.seekToFrame(frameNumber);
-	const Graphics::Surface *s = _aviDecoder.decodeNextFrame();
+	_video->seekToFrame(frameNumber);
+	const Graphics::Surface *s = _video->decodeNextFrame();
+	Graphics::Surface *surf = s->convertTo(g_system->getScreenFormat());
 
-	_videoSurface->blitFrom(Common::Point(0, 0), s);
-	*/
+	_videoSurface->blitFrom(Common::Point(0, 0), surf);
+	delete surf;
 }
 
 void OSMovie::proc16() {
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index 3529409..e84e283 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_MOVIE_H
 #define TITANIC_MOVIE_H
 
-#include "video/avi_decoder.h"
+#include "video/video_decoder.h"
 #include "titanic/core/list.h"
 #include "titanic/core/resource_key.h"
 
@@ -37,6 +37,7 @@ protected:
 	int _field10;
 public:
 	CMovie();
+	virtual ~CMovie() {}
 
 	virtual void proc8(int v1, CVideoSurface *surface) = 0;
 	virtual void proc9() = 0;
@@ -60,10 +61,11 @@ public:
 
 class OSMovie : public CMovie {
 private:
-	Video::AVIDecoder _aviDecoder;
+	Video::VideoDecoder *_video;
 	CVideoSurface *_videoSurface;
 public:
 	OSMovie(const CResourceKey &name, CVideoSurface *surface);
+	virtual ~OSMovie();
 
 	virtual void proc8(int v1, CVideoSurface *surface);
 	virtual void proc9();


Commit: f65849084cc88d61168742b02553fb269a9f064e
    https://github.com/scummvm/scummvm/commit/f65849084cc88d61168742b02553fb269a9f064e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-05T13:01:53-04:00

Commit Message:
TITANIC: Fix display of initial cursor

Changed paths:
    engines/titanic/support/mouse_cursor.cpp



diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index dda16c3..6db3618 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -95,9 +95,6 @@ void CMouseCursor::setCursor(CursorId cursorId) {
 		CVideoSurface &surface = *ce._videoSurface;
 		surface.lock();
 
-		// ***DEBUG*** Dummy cursor
-		Common::fill(surface.getPixels(), surface.getPixels() + 128, 0x5555);
-
 		CursorMan.replaceCursor(surface.getPixels(), surface.getWidth(), surface.getHeight(),
 			ce._centroid.x, ce._centroid.y, 0, false, &g_vm->_screen->format);
 		surface.unlock();


Commit: 6f8de06ddb210f71f611e2cfcee106832d100a78
    https://github.com/scummvm/scummvm/commit/6f8de06ddb210f71f611e2cfcee106832d100a78
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-05T13:19:43-04:00

Commit Message:
TITANIC: Fix loading of ycursors.avi video that contains mouse cursors

The mouse ccursor is now working correctly in-game, and correctly changing
when different areas of the view are highlighted

Changed paths:
    engines/titanic/support/avi_decoder.cpp



diff --git a/engines/titanic/support/avi_decoder.cpp b/engines/titanic/support/avi_decoder.cpp
index 81d8a58..578e3a9 100644
--- a/engines/titanic/support/avi_decoder.cpp
+++ b/engines/titanic/support/avi_decoder.cpp
@@ -265,7 +265,10 @@ void AVIDecoder::handleStreamHeader(uint32 size) {
 			}
 		}
 
-		addTrack(new AVIVideoTrack(_header.totalFrames, sHeader, bmInfo, initialPalette));
+		// WORKAROUND: For Titanic engine, the ycursors.avi file has two video tracks,
+		// so we do an explicit check below to ignore any second video track
+		if (getFrameCount() == 0)
+			addTrack(new AVIVideoTrack(_header.totalFrames, sHeader, bmInfo, initialPalette));
 	} else if (sHeader.streamType == ID_AUDS) {
 		PCMWaveFormat wvInfo;
 		wvInfo.tag = _fileStream->readUint16LE();


Commit: 4f46928444acb1da4e7cd31ac816ad6c9e7c265d
    https://github.com/scummvm/scummvm/commit/4f46928444acb1da4e7cd31ac816ad6c9e7c265d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-05T20:15:14-04:00

Commit Message:
TITANIC: Fix loading of game object bounds

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/support/simple_file.cpp
    engines/titanic/support/simple_file.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 26b7824..510e455 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -96,7 +96,7 @@ void CGameObject::load(SimpleFile *file) {
 		// Deliberate fall-through
 
 	case 1:
-		_bounds = file->readRect();
+		_bounds = file->readBounds();
 		_field34 = file->readFloat();
 		_field38 = file->readFloat();
 		_field3C = file->readFloat();
diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp
index fccf6c5..88d74a9 100644
--- a/engines/titanic/support/simple_file.cpp
+++ b/engines/titanic/support/simple_file.cpp
@@ -213,6 +213,16 @@ Rect SimpleFile::readRect() {
 	return r;
 }
 
+Rect SimpleFile::readBounds() {
+	Rect r;
+	r.left = readNumber();
+	r.top = readNumber();
+	r.setWidth(readNumber());
+	r.setHeight(readNumber());
+
+	return r;
+}
+
 void SimpleFile::readBuffer(char *buffer, size_t count) {
 	CString tempString = readString();
 	if (buffer) {
@@ -309,6 +319,11 @@ void SimpleFile::writeRect(const Rect &r, int indent) {
 	writePoint(Point(r.right, r.bottom), indent);
 }
 
+void SimpleFile::writeBounds(const Rect &r, int indent) {
+	writePoint(Point(r.left, r.top), indent);
+	writePoint(Point(r.width(), r.height()), indent);
+}
+
 void SimpleFile::writeIndent(uint indent) {
 	for (uint idx = 0; idx < indent; ++idx)
 		write("\t", 1);
diff --git a/engines/titanic/support/simple_file.h b/engines/titanic/support/simple_file.h
index 0ba7699..115e380 100644
--- a/engines/titanic/support/simple_file.h
+++ b/engines/titanic/support/simple_file.h
@@ -112,6 +112,11 @@ public:
 	Rect readRect();
 
 	/**
+	 * Rect in a bounds
+	 */
+	Rect readBounds();
+
+	/**
 	 * Read a string and copy it into an optionally passed buffer
 	 */
 	void readBuffer(char *buffer = nullptr, size_t count = 0);
@@ -167,6 +172,11 @@ public:
 	void writeRect(const Rect &r, int indent);
 
 	/**
+	 * Write out a bounds line
+	 */
+	void writeBounds(const Rect &r, int indent);
+
+	/**
 	 * Write out a number of tabs to form an indent in the output
 	 */
 	void writeIndent(uint indent);


Commit: 4e3ae0cf5642e62885e19ada83f922dd2fb91e1c
    https://github.com/scummvm/scummvm/commit/4e3ae0cf5642e62885e19ada83f922dd2fb91e1c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-05T20:44:20-04:00

Commit Message:
TITANIC: Fix setting cursor when highlighting object

Changed paths:
    engines/titanic/core/view_item.cpp



diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 666d7e7..47cdabb 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -252,7 +252,7 @@ bool CViewItem::handleMouseMsg(CMouseMsg *msg, bool flag) {
 		for (int idx = (int)gameObjects.size() - 1; idx >= 0; ++idx) {
 			if (gameObjects[idx]->_cursorId != CURSOR_12) {
 				CScreenManager::_screenManagerPtr->_mouseCursor->setCursor(gameObjects[idx]->_cursorId);
-				break;
+				return true;
 			}
 		}
 	}


Commit: 19e4bca41c6ecc1f4f71f04d919af75bc14f2d58
    https://github.com/scummvm/scummvm/commit/19e4bca41c6ecc1f4f71f04d919af75bc14f2d58
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-05T21:14:34-04:00

Commit Message:
TITANIC: Set up cursors enum with better names

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/link_item.cpp
    engines/titanic/core/view_item.cpp
    engines/titanic/support/mouse_cursor.cpp
    engines/titanic/support/mouse_cursor.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 510e455..d66fa58 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -47,7 +47,7 @@ CGameObject::CGameObject(): CNamedItem() {
 	_field58 = 0;
 	_visible = true;
 	_field60 = 0;
-	_cursorId = CURSOR_1;
+	_cursorId = CURSOR_ARROW;
 	_field78 = 0;
 	_frameNumber = -1;
 	_field90 = 0;
diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp
index 5ca64b1..285838b 100644
--- a/engines/titanic/core/link_item.cpp
+++ b/engines/titanic/core/link_item.cpp
@@ -32,7 +32,7 @@ CLinkItem::CLinkItem() : CNamedItem() {
 	_nodeNumber = -1;
 	_viewNumber = -1;
 	_field30 = 0;
-	_cursorId = CURSOR_1;
+	_cursorId = CURSOR_ARROW;
 	_name = "Link";
 }
 
@@ -93,16 +93,16 @@ void CLinkItem::load(SimpleFile *file) {
 	if (val < 2) {
 		switch (_field30) {
 		case 2:
-			_cursorId = CURSOR_2;
+			_cursorId = CURSOR_MOVE_LEFT;
 			break;
 		case 3:
-			_cursorId = CURSOR_3;
+			_cursorId = CURSOR_MOVE_RIGHT;
 			break;
 		case 5:
-			_cursorId = CURSOR_7;
+			_cursorId = CURSOR_MOVE_FORWARD;
 			break;
 		default:
-			_cursorId = CURSOR_4;
+			_cursorId = CURSOR_MOVE_FORWARD2;
 			break;
 		}
 	}
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 47cdabb..c5cd778 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -204,7 +204,7 @@ bool CViewItem::handleMessage(CMouseMoveMsg &msg) {
 	CScreenManager *screenManager = CScreenManager::_screenManagerPtr;
 
 	if (handleMouseMsg(&msg, true)) {
-		screenManager->_mouseCursor->setCursor(CURSOR_1);
+		screenManager->_mouseCursor->setCursor(CURSOR_ARROW);
 	} else {
 		// Iterate through each link item, and if any is highlighted,
 		// change the mouse cursor to the designated cursor for the item
@@ -219,7 +219,7 @@ bool CViewItem::handleMessage(CMouseMoveMsg &msg) {
 		}
 
 		if (!handleMouseMsg(&msg, false))
-			screenManager->_mouseCursor->setCursor(CURSOR_1);
+			screenManager->_mouseCursor->setCursor(CURSOR_ARROW);
 	}
 
 	return true;
@@ -250,7 +250,7 @@ bool CViewItem::handleMouseMsg(CMouseMsg *msg, bool flag) {
 			return false;
 
 		for (int idx = (int)gameObjects.size() - 1; idx >= 0; ++idx) {
-			if (gameObjects[idx]->_cursorId != CURSOR_12) {
+			if (gameObjects[idx]->_cursorId != CURSOR_ARROW2) {
 				CScreenManager::_screenManagerPtr->_mouseCursor->setCursor(gameObjects[idx]->_cursorId);
 				return true;
 			}
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index 6db3618..c4c57c6 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -50,9 +50,9 @@ static const int CURSOR_DATA[NUM_CURSORS][4] = {
 };
 
 CMouseCursor::CMouseCursor(CScreenManager *screenManager) : 
-		_screenManager(screenManager), _cursorId(CURSOR_15) {
+		_screenManager(screenManager), _cursorId(CURSOR_HOURGLASS) {
 	loadCursorImages();
-	setCursor(CURSOR_1);
+	setCursor(CURSOR_ARROW);
 }
 
 CMouseCursor::~CMouseCursor() {
diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h
index 507f4ec..28e13a8 100644
--- a/engines/titanic/support/mouse_cursor.h
+++ b/engines/titanic/support/mouse_cursor.h
@@ -31,21 +31,21 @@ namespace Titanic {
 #define NUM_CURSORS 15
 
 enum CursorId {
-	CURSOR_1 = 1,
-	CURSOR_2 = 3,
-	CURSOR_3 = 3,
-	CURSOR_4 = 4,
-	CURSOR_5 = 5,
-	CURSOR_6 = 6,
-	CURSOR_7 = 7,
-	CURSOR_8 = 8,
-	CURSOR_9 = 9,
-	CURSOR_10 = 10,
-	CURSOR_11 = 11,
-	CURSOR_12 = 12,
-	CURSOR_13 = 13,
-	CURSOR_14 = 14,
-	CURSOR_15 = 15
+	CURSOR_ARROW = 1,
+	CURSOR_MOVE_LEFT = 2,
+	CURSOR_MOVE_RIGHT = 3,
+	CURSOR_MOVE_FORWARD = 4,
+	CURSOR_MOVE_UP = 5,
+	CURSOR_MOVE_DOWN1 = 6,
+	CURSOR_MOVE_FORWARD2 = 7,
+	CURSOR_HAND = 8,
+	CURSOR_STAR = 9,
+	CURSOR_INVALID = 10,
+	CURSOR_MAGNIFIER = 11,
+	CURSOR_ARROW2 = 12,
+	CURSOR_BACKWARDS = 13,
+	CURSOR_DOWN = 14,
+	CURSOR_HOURGLASS = 15
 };
 
 class CScreenManager;


Commit: cb2dc0c8c8ab5b73f1ea863105a514202513de35
    https://github.com/scummvm/scummvm/commit/cb2dc0c8c8ab5b73f1ea863105a514202513de35
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-05T21:58:53-04:00

Commit Message:
TITANIC: Implementing CSTButton

Changed paths:
    engines/titanic/gfx/st_button.cpp
    engines/titanic/gfx/st_button.h



diff --git a/engines/titanic/gfx/st_button.cpp b/engines/titanic/gfx/st_button.cpp
index 44aa5cb..0d17331 100644
--- a/engines/titanic/gfx/st_button.cpp
+++ b/engines/titanic/gfx/st_button.cpp
@@ -25,39 +25,66 @@
 namespace Titanic {
 
 CSTButton::CSTButton() : CBackground() {
-	_fieldE0 = 0;
-	_string3 = "NULL";
+	_statusInc = 0;
+	_statusTarget = "NULL";
 	_fieldF0 = 0;
-	_fieldF4 = 0;
+	_newStatus = 0;
 	_string4 = "NULL";
 	_string5 = "NULL";
-	_field110 = 0;
+	_buttonFrame = 0;
 }
 
 void CSTButton::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldE0, indent);
-	file->writeQuotedLine(_string3, indent);
+	file->writeNumberLine(_statusInc, indent);
+	file->writeQuotedLine(_statusTarget, indent);
 	file->writeNumberLine(_fieldF0, indent);
-	file->writeNumberLine(_fieldF4, indent);
+	file->writeNumberLine(_newStatus, indent);
 	file->writeQuotedLine(_string4, indent);
 	file->writeQuotedLine(_string5, indent);
-	file->writeNumberLine(_field110, indent);
+	file->writeNumberLine(_buttonFrame, indent);
 
 	CBackground::save(file, indent);
 }
 
 void CSTButton::load(SimpleFile *file) {
 	file->readNumber();
-	_fieldE0 = file->readNumber();
-	_string3 = file->readString();
+	_statusInc = file->readNumber();
+	_statusTarget = file->readString();
 	_fieldF0 = file->readNumber();
-	_fieldF4 = file->readNumber();
+	_newStatus = file->readNumber();
 	_string4 = file->readString();
 	_string5 = file->readString();
-	_field110 = file->readNumber();
+	_buttonFrame = file->readNumber() != 0;
 
 	CBackground::load(file);
 }
 
+bool CSTButton::handleMessage(CMouseButtonDownMsg &msg) {
+	changeStatus(0);
+	// TODO: Obj6c stuff
+
+	return true;
+}
+
+bool CSTButton::handleMessage(CMouseButtonUpMsg &msg) {
+	int value1 = _newStatus;
+	int value2 = _newStatus + _statusInc;
+
+	CStatusChangeMsg statusMsg(value1, value2, 0);
+	_newStatus = value2;
+	statusMsg.execute(_statusTarget);
+
+	if (statusMsg._value3) {
+		_newStatus -= _statusInc;
+	}
+
+	return true;
+}
+
+bool CSTButton::handleMessage(CEnterViewMsg &msg) {
+	loadFrame(_buttonFrame);
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/gfx/st_button.h b/engines/titanic/gfx/st_button.h
index e63d1c8..3e2ebe0 100644
--- a/engines/titanic/gfx/st_button.h
+++ b/engines/titanic/gfx/st_button.h
@@ -24,18 +24,27 @@
 #define TITANIC_ST_BUTTON_H
 
 #include "titanic/core/background.h"
+#include "titanic/messages/mouse_messages.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
-class CSTButton : public CBackground {
+class CSTButton : public CBackground,
+	public CMouseButtonDownMsgTarget,
+	public CMouseButtonUpMsgTarget,
+	public CEnterViewMsgTarget {
 private:
-	int _fieldE0;
-	CString _string3;
+	int _statusInc;
+	CString _statusTarget;
 	int _fieldF0;
-	int _fieldF4;
+	int _newStatus;
 	CString _string4;
 	CString _string5;
-	int _field110;
+	int _buttonFrame;
+protected:
+	virtual bool handleMessage(CMouseButtonDownMsg &msg);
+	virtual bool handleMessage(CMouseButtonUpMsg &msg);
+	virtual bool handleMessage(CEnterViewMsg &msg);
 public:
 	CLASSDEF
 	CSTButton();


Commit: 08ed54f6c9fd72313e759d494a0b92cace2218e8
    https://github.com/scummvm/scummvm/commit/08ed54f6c9fd72313e759d494a0b92cace2218e8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-06T07:55:55-04:00

Commit Message:
TITANIC: Beginnings of CProximity class

Changed paths:
  A engines/titanic/support/proximity.cpp
  A engines/titanic/support/proximity.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/television.cpp
    engines/titanic/gfx/st_button.cpp
    engines/titanic/gfx/st_button.h
    engines/titanic/messages/messages.h
    engines/titanic/module.mk



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index d66fa58..c855fd9 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -395,4 +395,18 @@ int CGameObject::getSurface45() const {
 	return _surface ? _surface->proc45() : 0;
 }
 
+void CGameObject::calcProximity(const CString &name, int val2, int val3, int val4) {
+	CProximity prox;
+	prox._field8 = val2;
+	prox._fieldC = val3;
+	prox._field20 = val4;
+	calcProximity(name, prox);
+}
+
+void CGameObject::calcProximity(const CString &name, CProximity &prox) {
+	if (prox._field28 == 2) {
+		// TODO
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index d8d3a0b..495fc8a 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -24,6 +24,7 @@
 #define TITANIC_GAME_OBJECT_H
 
 #include "titanic/support/mouse_cursor.h"
+#include "titanic/support/proximity.h"
 #include "titanic/support/rect.h"
 #include "titanic/core/movie_clip.h"
 #include "titanic/core/named_item.h"
@@ -54,6 +55,7 @@ private:
 	void loadImage(const CString &name, bool pendingFlag = true);
 
 	void processClipList2();
+	void calcProximity(const CString &name, CProximity &obj6C);
 protected:
 	Rect _bounds;
 	double _field34;
@@ -177,6 +179,8 @@ public:
 	 * Loads a frame
 	 */
 	void loadFrame(int frameNumber);
+
+	void calcProximity(const CString &name, int val2, int val3, int val4);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index c11d446..610a3f0 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -164,9 +164,8 @@ bool CTelevision::handleMessage(CPETDownMsg &msg) {
 bool CTelevision::handleMessage(CStatusChangeMsg &msg) {
 	if (_isOn) {
 		stopMovie();
-		changeStatus(1);
+		changeStatus(0);
 	}
-	warning("TODO");
 
 	return true;
 }
@@ -179,7 +178,6 @@ bool CTelevision::handleMessage(CActMsg &msg) {
 			CStatusChangeMsg changeMsg;
 			changeMsg.execute(this);
 		} else {
-			// TODO: Should 5C be a boolean?
 			setVisible(_isOn);
 			stopMovie();
 		}
diff --git a/engines/titanic/gfx/st_button.cpp b/engines/titanic/gfx/st_button.cpp
index 0d17331..3878004 100644
--- a/engines/titanic/gfx/st_button.cpp
+++ b/engines/titanic/gfx/st_button.cpp
@@ -28,7 +28,7 @@ CSTButton::CSTButton() : CBackground() {
 	_statusInc = 0;
 	_statusTarget = "NULL";
 	_fieldF0 = 0;
-	_newStatus = 0;
+	_currentStatus = 0;
 	_string4 = "NULL";
 	_string5 = "NULL";
 	_buttonFrame = 0;
@@ -39,7 +39,7 @@ void CSTButton::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_statusInc, indent);
 	file->writeQuotedLine(_statusTarget, indent);
 	file->writeNumberLine(_fieldF0, indent);
-	file->writeNumberLine(_newStatus, indent);
+	file->writeNumberLine(_currentStatus, indent);
 	file->writeQuotedLine(_string4, indent);
 	file->writeQuotedLine(_string5, indent);
 	file->writeNumberLine(_buttonFrame, indent);
@@ -52,7 +52,7 @@ void CSTButton::load(SimpleFile *file) {
 	_statusInc = file->readNumber();
 	_statusTarget = file->readString();
 	_fieldF0 = file->readNumber();
-	_newStatus = file->readNumber();
+	_currentStatus = file->readNumber();
 	_string4 = file->readString();
 	_string5 = file->readString();
 	_buttonFrame = file->readNumber() != 0;
@@ -68,15 +68,15 @@ bool CSTButton::handleMessage(CMouseButtonDownMsg &msg) {
 }
 
 bool CSTButton::handleMessage(CMouseButtonUpMsg &msg) {
-	int value1 = _newStatus;
-	int value2 = _newStatus + _statusInc;
+	int oldStatus = _currentStatus;
+	int newStatus = _currentStatus + _statusInc;
 
-	CStatusChangeMsg statusMsg(value1, value2, 0);
-	_newStatus = value2;
+	CStatusChangeMsg statusMsg(oldStatus, newStatus, false);
+	_currentStatus = newStatus;
 	statusMsg.execute(_statusTarget);
 
-	if (statusMsg._value3) {
-		_newStatus -= _statusInc;
+	if (!statusMsg._success) {
+		_currentStatus -= _statusInc;
 	}
 
 	return true;
diff --git a/engines/titanic/gfx/st_button.h b/engines/titanic/gfx/st_button.h
index 3e2ebe0..d613ad0 100644
--- a/engines/titanic/gfx/st_button.h
+++ b/engines/titanic/gfx/st_button.h
@@ -37,7 +37,7 @@ private:
 	int _statusInc;
 	CString _statusTarget;
 	int _fieldF0;
-	int _newStatus;
+	int _currentStatus;
 	CString _string4;
 	CString _string5;
 	int _buttonFrame;
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index b78fac4..f4c16f5 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -397,7 +397,7 @@ MESSAGE1(CShowTextMsg, CString, value, "NO TEXT INCLUDED!!!");
 MESSAGE2(CSignalObject, CString, strValue, "", int, numValue, 0);
 MESSAGE2(CSpeechFallsFromTreeMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CStartMusicMsg, int, value, 0);
-MESSAGE3(CStatusChangeMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE3(CStatusChangeMsg, int, oldStatus, 0, int, newStatus, 0, bool, success, false);
 MESSAGE1(CStopMusicMsg, int, value, 0);
 MESSAGE0(CSubDeliverCCarryMsg);
 MESSAGE0(CSubSendCCarryMsg);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index a29d3df..80abc1a 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -431,6 +431,7 @@ MODULE_OBJS := \
 	support/image_decoders.o \
 	support/mouse_cursor.o \
 	support/movie.o \
+	support/proximity.o \
 	support/rect.o \
 	support/screen_manager.o \
 	support/simple_file.o \
diff --git a/engines/titanic/support/proximity.cpp b/engines/titanic/support/proximity.cpp
new file mode 100644
index 0000000..f7c90f7
--- /dev/null
+++ b/engines/titanic/support/proximity.cpp
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/proximity.h"
+
+namespace Titanic {
+
+CProximity::CProximity() : _field4(0), _field8(100), _fieldC(0),
+		_field10(-1), _field14(0), _field18(0), _field1C(0x3FF00000),
+		_field20(0), _field24(10), _field28(0), _field2C(0),
+		_field30(0x3F000000), _field34(0), _double1(0.0), _double2(0.0),
+		_double3(0.0), _field44(0), _field48(0), _field4C(0),
+		_field50(0), _field54(0), _field58(0), _field5C(0),
+		_field60(0), _field64(0), _field68(0) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/proximity.h b/engines/titanic/support/proximity.h
new file mode 100644
index 0000000..69979ea
--- /dev/null
+++ b/engines/titanic/support/proximity.h
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PROXIMITY_H
+#define TITANIC_PROXIMITY_H
+
+namespace Titanic {
+
+class CProximity {
+public:
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+	int _field28;
+	int _field2C;
+	int _field30;
+	int _field34;
+	double _double1;
+	double _double2;
+	double _double3;
+	int _field44;
+	int _field48;
+	int _field4C;
+	int _field50;
+	int _field54;
+	int _field58;
+	int _field5C;
+	int _field60;
+	int _field64;
+	int _field68;
+public:
+	CProximity();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PROXIMITY_H */


Commit: 71a278791a25d039c39a818f27d1106db1fa0e6e
    https://github.com/scummvm/scummvm/commit/71a278791a25d039c39a818f27d1106db1fa0e6e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-06T19:02:09-04:00

Commit Message:
TITANIC: Fix setting of buttons in mouse messages

Changed paths:
    engines/titanic/input_translator.cpp



diff --git a/engines/titanic/input_translator.cpp b/engines/titanic/input_translator.cpp
index 9769076..499d0f6 100644
--- a/engines/titanic/input_translator.cpp
+++ b/engines/titanic/input_translator.cpp
@@ -50,47 +50,47 @@ void CInputTranslator::mouseMove(int special, const Point &pt) {
 }
 
 void CInputTranslator::leftButtonDown(int special, const Point &pt) {
-	CMouseButtonDownMsg msg(pt, getButtons(special));
+	CMouseButtonDownMsg msg(pt, MB_LEFT);
 	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::leftButtonUp(int special, const Point &pt) {
-	CMouseButtonUpMsg msg(pt, getButtons(special));
+	CMouseButtonUpMsg msg(pt, MB_LEFT);
 	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::leftButtonDoubleClick(int special, const Point &pt) {
-	CMouseDoubleClickMsg msg(pt, getButtons(special));
+	CMouseDoubleClickMsg msg(pt, MB_LEFT);
 	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::middleButtonDown(int special, const Point &pt) {
-	CMouseButtonDownMsg msg(pt, getButtons(special));
+	CMouseButtonDownMsg msg(pt, MB_MIDDLE);
 	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::middleButtonUp(int special, const Point &pt) {
-	CMouseButtonUpMsg msg(pt, getButtons(special));
+	CMouseButtonUpMsg msg(pt, MB_MIDDLE);
 	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::middleButtonDoubleClick(int special, const Point &pt) {
-	CMouseDoubleClickMsg msg(pt, getButtons(special));
+	CMouseDoubleClickMsg msg(pt, MB_MIDDLE);
 	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::rightButtonDown(int special, const Point &pt) {
-	CMouseButtonDownMsg msg(pt, getButtons(special));
+	CMouseButtonDownMsg msg(pt, MB_RIGHT);
 	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::rightButtonUp(int special, const Point &pt) {
-	CMouseButtonUpMsg msg(pt, getButtons(special));
+	CMouseButtonUpMsg msg(pt, MB_RIGHT);
 	_inputHandler->handleMessage(msg);
 }
 
 void CInputTranslator::rightButtonDoubleClick(int special, const Point &pt) {
-	CMouseDoubleClickMsg msg(pt, getButtons(special));
+	CMouseDoubleClickMsg msg(pt, MB_RIGHT);
 	_inputHandler->handleMessage(msg);
 }
 


Commit: ac59f58c8a65e9e27a696da4536693c7d6ec6bc9
    https://github.com/scummvm/scummvm/commit/ac59f58c8a65e9e27a696da4536693c7d6ec6bc9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-06T19:42:45-04:00

Commit Message:
TITANIC: Implement CBackground message handlers

Changed paths:
    engines/titanic/core/background.cpp
    engines/titanic/core/game_object.cpp
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/core/background.cpp b/engines/titanic/core/background.cpp
index ea3bdb0..cb8e264 100644
--- a/engines/titanic/core/background.cpp
+++ b/engines/titanic/core/background.cpp
@@ -50,15 +50,23 @@ void CBackground::load(SimpleFile *file) {
 }
 
 bool CBackground::handleMessage(CStatusChangeMsg &msg) {
-	error("TODO: CBackground::handleMessage");
+	setVisible(true);
+	if (_fieldDC) {
+		fn1(_fieldBC, _fieldC0, 16);
+	} else {
+		fn1(_fieldBC, _fieldC0, 0);
+	}
+	return true;
 }
 
 bool CBackground::handleMessage(CSetFrameMsg &msg) {
-	error("TODO: CBackground::handleMessage");
+	loadFrame(msg._frameNumber);
+	return true;
 }
 
 bool CBackground::handleMessage(CVisibleMsg &msg) {
-	error("TODO: CBackground::handleMessage");
+	setVisible(msg._visible);
+	return true;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index c855fd9..d2b1c29 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -330,7 +330,19 @@ void CGameObject::petFn3(CTreeItem *item) {
 }
 
 void CGameObject::fn1(int val1, int val2, int val3) {
-	warning("TODO: CGameObject::fn1");
+	_frameNumber = -1;
+	if (!_surface) {
+		if (!_resource.empty())
+			loadResource(_resource);
+		_resource.clear();
+	}
+
+	if (_surface) {
+		_surface->proc34(val1, val2, val3, val3 != 0);
+
+		if (val3 & 0x10)
+			getGameManager()->_gameState.addMovie(_surface->_movie);
+	}
 }
 
 void CGameObject::changeStatus(int newStatus) {
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 2590918..846dc09 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -59,7 +59,7 @@ void OSMovie::proc8(int v1, CVideoSurface *surface) {
 	warning("TODO: OSMovie::proc8");
 }
 
-void OSMovie::proc9() {
+void OSMovie::proc9(int v1, int v2, int v3, bool v4) {
 	warning("TODO: OSMovie::proc9");
 }
 
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index e84e283..b5ae70d 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -40,7 +40,7 @@ public:
 	virtual ~CMovie() {}
 
 	virtual void proc8(int v1, CVideoSurface *surface) = 0;
-	virtual void proc9() = 0;
+	virtual void proc9(int v1, int v2, int v3, bool v4) = 0;
 	virtual void proc10() = 0;
 	virtual void proc11() = 0;
 	virtual void proc12() = 0;
@@ -68,7 +68,7 @@ public:
 	virtual ~OSMovie();
 
 	virtual void proc8(int v1, CVideoSurface *surface);
-	virtual void proc9();
+	virtual void proc9(int v1, int v2, int v3, bool v4);
 	virtual void proc10();
 	virtual void proc11();
 	virtual void proc12();
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index a1b2638..1a0d48b 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -368,6 +368,12 @@ void OSVideoSurface::proc32(int v1, CVideoSurface *surface) {
 		_movie->proc8(v1, surface);
 }
 
+void OSVideoSurface::proc34(int v1, int v2, int v3, bool v4) {
+	if (loadIfReady() && _movie) {
+		_movie->proc9(v1, v2, v3, v4);
+	}
+}
+
 void OSVideoSurface::stopMovie() {
 	if (_movie)
 		_movie->stop();
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index e1ddde8..767306c 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -153,6 +153,7 @@ public:
 	virtual void shiftColors() = 0;
 
 	virtual void proc32(int v1, CVideoSurface *surface) = 0;
+	virtual void proc34(int v1, int v2, int v3, bool v4) = 0;
 
 	/**
 	 * Stops any movie currently attached to the surface
@@ -299,6 +300,7 @@ public:
 	virtual void shiftColors();
 
 	virtual void proc32(int v1, CVideoSurface *surface);
+	virtual void proc34(int v1, int v2, int v3, bool v4);
 
 	/**
 	 * Stops any movie currently attached to the surface


Commit: e728e901d02aca51858f91ac29b1a177e5e80a07
    https://github.com/scummvm/scummvm/commit/e728e901d02aca51858f91ac29b1a177e5e80a07
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-06T20:32:18-04:00

Commit Message:
TITANIC: Fix for showing link cursors in some screens

Changed paths:
    engines/titanic/core/view_item.cpp
    engines/titanic/support/mouse_cursor.h



diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index c5cd778..098adc0 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -208,14 +208,15 @@ bool CViewItem::handleMessage(CMouseMoveMsg &msg) {
 	} else {
 		// Iterate through each link item, and if any is highlighted,
 		// change the mouse cursor to the designated cursor for the item
-		CLinkItem *linkItem = dynamic_cast<CLinkItem *>(getFirstChild());
-		while (linkItem) {
-			if (linkItem->_bounds.contains(msg._mousePos)) {
+		CTreeItem *treeItem = getFirstChild();
+		while (treeItem) {
+			CLinkItem *linkItem = dynamic_cast<CLinkItem *>(treeItem);
+			if (linkItem && linkItem->_bounds.contains(msg._mousePos)) {
 				screenManager->_mouseCursor->setCursor(linkItem->_cursorId);
 				return true;
 			}
 
-			linkItem = dynamic_cast<CLinkItem *>(linkItem->getNextSibling());
+			treeItem = treeItem->getNextSibling();
 		}
 
 		if (!handleMouseMsg(&msg, false))
@@ -252,10 +253,12 @@ bool CViewItem::handleMouseMsg(CMouseMsg *msg, bool flag) {
 		for (int idx = (int)gameObjects.size() - 1; idx >= 0; ++idx) {
 			if (gameObjects[idx]->_cursorId != CURSOR_ARROW2) {
 				CScreenManager::_screenManagerPtr->_mouseCursor->setCursor(gameObjects[idx]->_cursorId);
-				return true;
+				break;
 			}
 		}
 	}
+	if (gameObjects.size() == 0)
+		return false;
 
 	bool result = false;
 	for (int idx = (int)gameObjects.size() - 1; idx >= 0; --idx) {
diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h
index 28e13a8..831e207 100644
--- a/engines/titanic/support/mouse_cursor.h
+++ b/engines/titanic/support/mouse_cursor.h
@@ -39,7 +39,7 @@ enum CursorId {
 	CURSOR_MOVE_DOWN1 = 6,
 	CURSOR_MOVE_FORWARD2 = 7,
 	CURSOR_HAND = 8,
-	CURSOR_STAR = 9,
+	CURSOR_ACTIVATE = 9,
 	CURSOR_INVALID = 10,
 	CURSOR_MAGNIFIER = 11,
 	CURSOR_ARROW2 = 12,


Commit: 51df4d98d3a066e092f34cf7968c436a3e430df2
    https://github.com/scummvm/scummvm/commit/51df4d98d3a066e092f34cf7968c436a3e430df2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-06T22:17:26-04:00

Commit Message:
TITANIC: In-progress converting message handling to be more like original

I currently was using multiple inheritance to define the message classes
that a class supports, but this caused problems when, for example, a
class tested to see if an object supported CMouseMsg. The class in
question supported several mouse messages, but a standard dynamic_cast
returned nullptr for the class, since it didn't directly support it

Changed paths:
    engines/titanic/core/background.cpp
    engines/titanic/core/background.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/message_target.cpp
    engines/titanic/core/message_target.h
    engines/titanic/core/named_item.cpp
    engines/titanic/core/named_item.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/core/view_item.cpp
    engines/titanic/core/view_item.h
    engines/titanic/game/gondolier/gondolier_mixer.h
    engines/titanic/game/television.h



diff --git a/engines/titanic/core/background.cpp b/engines/titanic/core/background.cpp
index cb8e264..5859719 100644
--- a/engines/titanic/core/background.cpp
+++ b/engines/titanic/core/background.cpp
@@ -24,6 +24,12 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CBackground, CGameObject)
+	ON_MESSAGE(StatusChangeMsg)
+	ON_MESSAGE(SetFrameMsg)
+	ON_MESSAGE(VisibleMsg)
+END_MESSAGE_MAP()
+
 CBackground::CBackground() : CGameObject(), _fieldBC(0), _fieldC0(0), _fieldDC(0) {
 }
 
@@ -49,7 +55,7 @@ void CBackground::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CBackground::handleMessage(CStatusChangeMsg &msg) {
+bool CBackground::StatusChangeMsg(CStatusChangeMsg *msg) {
 	setVisible(true);
 	if (_fieldDC) {
 		fn1(_fieldBC, _fieldC0, 16);
@@ -59,13 +65,13 @@ bool CBackground::handleMessage(CStatusChangeMsg &msg) {
 	return true;
 }
 
-bool CBackground::handleMessage(CSetFrameMsg &msg) {
-	loadFrame(msg._frameNumber);
+bool CBackground::SetFrameMsg(CSetFrameMsg *msg) {
+	loadFrame(msg->_frameNumber);
 	return true;
 }
 
-bool CBackground::handleMessage(CVisibleMsg &msg) {
-	setVisible(msg._visible);
+bool CBackground::VisibleMsg(CVisibleMsg *msg) {
+	setVisible(msg->_visible);
 	return true;
 }
 
diff --git a/engines/titanic/core/background.h b/engines/titanic/core/background.h
index bd8f949..91c3407 100644
--- a/engines/titanic/core/background.h
+++ b/engines/titanic/core/background.h
@@ -28,10 +28,7 @@
 
 namespace Titanic {
 
-class CBackground : public CGameObject,
-	public CStatusChangeMsgTarget,
-	public CSetFrameMsgTarget,
-	public CVisibleMsgTarget {
+class CBackground : public CGameObject {
 protected:
 	int _fieldBC;
 	int _fieldC0;
@@ -39,9 +36,11 @@ protected:
 	CString _string2;
 	int _fieldDC;
 protected:
-	virtual bool handleMessage(CStatusChangeMsg &msg);
-	virtual bool handleMessage(CSetFrameMsg &msg);
-	virtual bool handleMessage(CVisibleMsg &msg);
+	DECLARE_MESSAGE_MAP
+
+	virtual bool StatusChangeMsg(CStatusChangeMsg *msg);
+	virtual bool SetFrameMsg(CSetFrameMsg *msg);
+	virtual bool VisibleMsg(CVisibleMsg *msg);
 public:
 	CLASSDEF
 	CBackground();
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index d2b1c29..2bac988 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -31,6 +31,9 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CGameObject, CNamedItem)
+END_MESSAGE_MAP()
+
 void *CGameObject::_v1 = nullptr;
 
 CGameObject::CGameObject(): CNamedItem() {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 495fc8a..7391a6b 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -36,6 +36,7 @@ class CVideoSurface;
 class CMouseDragStartMsg;
 
 class CGameObject : public CNamedItem {
+	DECLARE_MESSAGE_MAP
 public:
 	static void *_v1;
 private:
diff --git a/engines/titanic/core/message_target.cpp b/engines/titanic/core/message_target.cpp
index a7dd3a0..b99fa5c 100644
--- a/engines/titanic/core/message_target.cpp
+++ b/engines/titanic/core/message_target.cpp
@@ -23,7 +23,20 @@
 #include "titanic/core/message_target.h"
 
 namespace Titanic {
-	
+
+const MSGMAP *CMessageTarget::getMessageMap() const { 
+	return getThisMessageMap();
+}
+
+const MSGMAP *CMessageTarget::getThisMessageMap() {
+	static const MSGMAP_ENTRY _messageEntries[] = {
+		{ (PMSG)nullptr, nullptr }
+	};
+
+	static const MSGMAP messageMap = { nullptr, &_messageEntries[0] };
+	return &messageMap;
+}
+
 void CMessageTarget::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(0, indent);
 	CSaveableObject::save(file, indent);
diff --git a/engines/titanic/core/message_target.h b/engines/titanic/core/message_target.h
index b099546..0f43bcd 100644
--- a/engines/titanic/core/message_target.h
+++ b/engines/titanic/core/message_target.h
@@ -27,7 +27,49 @@
 
 namespace Titanic {
 
+class CMessageTarget;
+class CMessage;
+
+typedef bool (CMessageTarget::*PMSG)(CMessage *msg);
+
+struct MSGMAP_ENTRY {
+	PMSG _fn;
+	ClassDef *_class;
+};
+
+struct MSGMAP {
+	const MSGMAP *(* pFnGetBaseMap)();
+	const MSGMAP_ENTRY *lpEntries;
+};
+
+#define DECLARE_MESSAGE_MAP \
+protected: \
+	static const MSGMAP *getThisMessageMap(); \
+	virtual const MSGMAP *getMessageMap() const;
+
+#define BEGIN_MESSAGE_MAP(theClass, baseClass) \
+	const MSGMAP *theClass::getMessageMap() const \
+		{ return getThisMessageMap(); } \
+	const MSGMAP *theClass::getThisMessageMap() \
+	{ \
+		typedef theClass ThisClass;						   \
+		typedef baseClass TheBaseClass;					   \
+		typedef bool (theClass::*FNPTR)(CMessage *msg);    \
+		static const MSGMAP_ENTRY _messageEntries[] = {
+
+#define ON_MESSAGE(msgClass) \
+	{ static_cast<PMSG>((FNPTR)&ThisClass::msgClass), C##msgClass::_type },
+
+#define END_MESSAGE_MAP() \
+		{ (PMSG)nullptr, nullptr } \
+	}; \
+		static const MSGMAP messageMap = \
+		{ &TheBaseClass::getThisMessageMap, &_messageEntries[0] }; \
+		return &messageMap; \
+	}
+
 class CMessageTarget: public CSaveableObject {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
@@ -40,7 +82,6 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
-
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/named_item.cpp b/engines/titanic/core/named_item.cpp
index 02e7504..72d3fd9 100644
--- a/engines/titanic/core/named_item.cpp
+++ b/engines/titanic/core/named_item.cpp
@@ -27,6 +27,9 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CNamedItem, CTreeItem)
+END_MESSAGE_MAP()
+
 CString CNamedItem::dumpItem(int indent) const {
 	CString result = CTreeItem::dumpItem(indent);
 	result += " " + _name;
diff --git a/engines/titanic/core/named_item.h b/engines/titanic/core/named_item.h
index 6ee11e9..9763e1b 100644
--- a/engines/titanic/core/named_item.h
+++ b/engines/titanic/core/named_item.h
@@ -32,6 +32,7 @@ class CNodeItem;
 class CRoomItem;
 
 class CNamedItem: public CTreeItem {
+	DECLARE_MESSAGE_MAP
 public:
 	CString _name;
 public:
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index e7b61dc..80eac81 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -36,6 +36,9 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CTreeItem, CMessageTarget)
+END_MESSAGE_MAP()
+
 CTreeItem::CTreeItem() : _parent(nullptr), _firstChild(nullptr),
 	_nextSibling(nullptr), _priorSibling(nullptr), _field14(0) {
 }
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 9710a25..f5b1407 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -36,6 +36,7 @@ class CScreenManager;
 class CRoomItem;
 
 class CTreeItem: public CMessageTarget {
+	DECLARE_MESSAGE_MAP
 private:
 	CTreeItem *_parent;
 	CTreeItem *_nextSibling;
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 098adc0..26e0d86 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -30,6 +30,13 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CViewItem, CNamedItem)
+	ON_MESSAGE(MouseButtonDownMsg)
+	ON_MESSAGE(MouseButtonUpMsg)
+	ON_MESSAGE(MouseDoubleClickMsg)
+	ON_MESSAGE(MouseMoveMsg)
+END_MESSAGE_MAP()
+
 CViewItem::CViewItem() : CNamedItem() {
 	Common::fill(&_buttonUpTargets[0], &_buttonUpTargets[4], nullptr);
 	_field24 = 0;
@@ -161,7 +168,7 @@ void CViewItem::enterView(CViewItem *newView) {
 	}
 }
 
-bool CViewItem::handleMessage(CMouseButtonDownMsg &msg) {
+bool CViewItem::MouseButtonDownMsg(CMouseButtonDownMsg &msg) {
 	if (msg._buttons & MB_LEFT) {
 		if (!handleMouseMsg(&msg, true)) {
 			CGameManager *gm = getGameManager();
@@ -186,21 +193,21 @@ bool CViewItem::handleMessage(CMouseButtonDownMsg &msg) {
 	return true;
 }
 
-bool CViewItem::handleMessage(CMouseButtonUpMsg &msg) {
+bool CViewItem::MouseButtonUpMsg(CMouseButtonUpMsg &msg) {
 	if (msg._buttons & MB_LEFT)
 		handleMouseMsg(&msg, false);
 
 	return true;
 }
 
-bool CViewItem::handleMessage(CMouseDoubleClickMsg &msg) {
+bool CViewItem::MouseDoubleClickMsg(CMouseDoubleClickMsg &msg) {
 	if (msg._buttons & MB_LEFT)
 		handleMouseMsg(&msg, false);
 
 	return true;
 }
 
-bool CViewItem::handleMessage(CMouseMoveMsg &msg) {
+bool CViewItem::MouseMoveMsg(CMouseMoveMsg &msg) {
 	CScreenManager *screenManager = CScreenManager::_screenManagerPtr;
 
 	if (handleMouseMsg(&msg, true)) {
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index fc4089f..f439929 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -29,11 +29,8 @@
 
 namespace Titanic {
 
-class CViewItem : public CNamedItem,
-	public CMouseButtonDownMsgTarget,
-	public CMouseButtonUpMsgTarget,
-	public CMouseMoveMsgTarget,
-	public CMouseDoubleClickMsgTarget {
+class CViewItem : public CNamedItem {
+	DECLARE_MESSAGE_MAP
 private:
 	CTreeItem *_buttonUpTargets[4];
 private:
@@ -55,10 +52,10 @@ protected:
 	int _field50;
 	int _field54;
 protected:
-	virtual bool handleMessage(CMouseButtonDownMsg &msg);
-	virtual bool handleMessage(CMouseButtonUpMsg &msg);
-	virtual bool handleMessage(CMouseMoveMsg &msg);
-	virtual bool handleMessage(CMouseDoubleClickMsg &msg);
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg &msg);
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg &msg);
+	virtual bool MouseMoveMsg(CMouseMoveMsg &msg);
+	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg &msg);
 public:
 	int _viewNumber;
 public:
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.h b/engines/titanic/game/gondolier/gondolier_mixer.h
index c6ea840..1186393 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.h
+++ b/engines/titanic/game/gondolier/gondolier_mixer.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CGondolierMixer : public CGondolierBase, 
-	public CEnterRoomMsgTarget {
+class CGondolierMixer : public CGondolierBase {
 private:
 	int _fieldBC;
 	int _fieldC0;
diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
index c6c920b..9fb3394 100644
--- a/engines/titanic/game/television.h
+++ b/engines/titanic/game/television.h
@@ -29,19 +29,7 @@
 
 namespace Titanic {
 
-class CTelevision : public CBackground,
-	public CLeaveViewMsgTarget,
-	public CChangeSeasonMsgTarget,
-	public CEnterViewMsgTarget,
-	public CPETUpMsgTarget,
-	public CPETDownMsgTarget,
-	public CActMsgTarget,
-	public CPETActivateMsgTarget,
-	public CMovieEndMsgTarget,
-	public CShipSettingMsgTarget,
-	public CTurnOffTarget,
-	public CTurnOnTarget,
-	public CLightsMsgTarget {
+class CTelevision : public CBackground {
 private:
 	static int _v1;
 	static bool _turnOn;


Commit: 51dc36a9a52f95815b4b1109b080d070247bf247
    https://github.com/scummvm/scummvm/commit/51dc36a9a52f95815b4b1109b080d070247bf247
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-06T23:28:42-04:00

Commit Message:
TITANIC: Furhter in-progress message handling conversion

Changed paths:
    engines/titanic/core/tree_item.h
    engines/titanic/core/view_item.cpp
    engines/titanic/core/view_item.h
    engines/titanic/game/arboretum_gate.cpp
    engines/titanic/game/arboretum_gate.h
    engines/titanic/game/bar_bell.h
    engines/titanic/game/bomb.h
    engines/titanic/game/cdrom.h
    engines/titanic/game/cdrom_tray.h
    engines/titanic/game/chicken_cooler.h
    engines/titanic/game/dead_area.h
    engines/titanic/game/doorbot_elevator_handler.h
    engines/titanic/game/end_sequence_control.h
    engines/titanic/game/fan_noises.h
    engines/titanic/game/get_lift_eye2.h
    engines/titanic/game/light.h
    engines/titanic/game/light_switch.h
    engines/titanic/game/parrot/player_meets_parrot.h
    engines/titanic/game/pet/pet_monitor.h
    engines/titanic/game/pet/pet_position.h
    engines/titanic/game/pet/pet_transport.h
    engines/titanic/game/sgt/sgt_state_room.h
    engines/titanic/game/ship_setting.h
    engines/titanic/game/start_action.h
    engines/titanic/game/transport/lift.h
    engines/titanic/game/transport/pellerator.h
    engines/titanic/game/up_lighter.h
    engines/titanic/game/volume_control.h
    engines/titanic/gfx/st_button.cpp
    engines/titanic/gfx/st_button.h
    engines/titanic/messages/messages.cpp
    engines/titanic/messages/messages.h
    engines/titanic/messages/mouse_messages.h
    engines/titanic/messages/pet_messages.h
    engines/titanic/moves/enter_bridge.h
    engines/titanic/npcs/barbot.h
    engines/titanic/npcs/liftbot.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_frame.cpp
    engines/titanic/pet_control/pet_frame.h
    engines/titanic/pet_control/pet_section.h
    engines/titanic/sound/auto_music_player.h
    engines/titanic/sound/music_player.h
    engines/titanic/sound/node_auto_sound_player.h
    engines/titanic/sound/room_auto_sound_player.h
    engines/titanic/sound/room_trigger_auto_music_player.h



diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index f5b1407..d34f963 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -29,6 +29,7 @@ namespace Titanic {
 
 class CGameManager;
 class CDontSaveFileItem;
+class CMessage;
 class CNamedItem;
 class CPetControl;
 class CProjectItem;
@@ -36,6 +37,7 @@ class CScreenManager;
 class CRoomItem;
 
 class CTreeItem: public CMessageTarget {
+	friend class CMessage;
 	DECLARE_MESSAGE_MAP
 private:
 	CTreeItem *_parent;
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 26e0d86..8120b3c 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -168,9 +168,9 @@ void CViewItem::enterView(CViewItem *newView) {
 	}
 }
 
-bool CViewItem::MouseButtonDownMsg(CMouseButtonDownMsg &msg) {
-	if (msg._buttons & MB_LEFT) {
-		if (!handleMouseMsg(&msg, true)) {
+bool CViewItem::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	if (msg->_buttons & MB_LEFT) {
+		if (!handleMouseMsg(msg, true)) {
 			CGameManager *gm = getGameManager();
 			if (gm->test54()) {
 				findNode()->findRoom();
@@ -178,7 +178,7 @@ bool CViewItem::MouseButtonDownMsg(CMouseButtonDownMsg &msg) {
 				CLinkItem *linkItem = dynamic_cast<CLinkItem *>(
 					findChildInstanceOf(CLinkItem::_type));
 				while (linkItem) {
-					if (linkItem->_bounds.contains(msg._mousePos)) {
+					if (linkItem->_bounds.contains(msg->_mousePos)) {
 						gm->_gameState.triggerLink(linkItem);
 						return true;
 					}
@@ -193,24 +193,24 @@ bool CViewItem::MouseButtonDownMsg(CMouseButtonDownMsg &msg) {
 	return true;
 }
 
-bool CViewItem::MouseButtonUpMsg(CMouseButtonUpMsg &msg) {
-	if (msg._buttons & MB_LEFT)
-		handleMouseMsg(&msg, false);
+bool CViewItem::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+	if (msg->_buttons & MB_LEFT)
+		handleMouseMsg(msg, false);
 
 	return true;
 }
 
-bool CViewItem::MouseDoubleClickMsg(CMouseDoubleClickMsg &msg) {
-	if (msg._buttons & MB_LEFT)
-		handleMouseMsg(&msg, false);
+bool CViewItem::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
+	if (msg->_buttons & MB_LEFT)
+		handleMouseMsg(msg, false);
 
 	return true;
 }
 
-bool CViewItem::MouseMoveMsg(CMouseMoveMsg &msg) {
+bool CViewItem::MouseMoveMsg(CMouseMoveMsg *msg) {
 	CScreenManager *screenManager = CScreenManager::_screenManagerPtr;
 
-	if (handleMouseMsg(&msg, true)) {
+	if (handleMouseMsg(msg, true)) {
 		screenManager->_mouseCursor->setCursor(CURSOR_ARROW);
 	} else {
 		// Iterate through each link item, and if any is highlighted,
@@ -218,7 +218,7 @@ bool CViewItem::MouseMoveMsg(CMouseMoveMsg &msg) {
 		CTreeItem *treeItem = getFirstChild();
 		while (treeItem) {
 			CLinkItem *linkItem = dynamic_cast<CLinkItem *>(treeItem);
-			if (linkItem && linkItem->_bounds.contains(msg._mousePos)) {
+			if (linkItem && linkItem->_bounds.contains(msg->_mousePos)) {
 				screenManager->_mouseCursor->setCursor(linkItem->_cursorId);
 				return true;
 			}
@@ -226,7 +226,7 @@ bool CViewItem::MouseMoveMsg(CMouseMoveMsg &msg) {
 			treeItem = treeItem->getNextSibling();
 		}
 
-		if (!handleMouseMsg(&msg, false))
+		if (!handleMouseMsg(msg, false))
 			screenManager->_mouseCursor->setCursor(CURSOR_ARROW);
 	}
 
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index f439929..95edc7a 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -52,10 +52,10 @@ protected:
 	int _field50;
 	int _field54;
 protected:
-	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg &msg);
-	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg &msg);
-	virtual bool MouseMoveMsg(CMouseMoveMsg &msg);
-	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg &msg);
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+	virtual bool MouseMoveMsg(CMouseMoveMsg *msg);
+	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
 public:
 	int _viewNumber;
 public:
diff --git a/engines/titanic/game/arboretum_gate.cpp b/engines/titanic/game/arboretum_gate.cpp
index 6770430..f3e3301 100644
--- a/engines/titanic/game/arboretum_gate.cpp
+++ b/engines/titanic/game/arboretum_gate.cpp
@@ -24,6 +24,16 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CArboretumGate, CBackground)
+	ON_MESSAGE(ActMsg)
+	ON_MESSAGE(LeaveViewMsg)
+	ON_MESSAGE(TurnOff)
+	ON_MESSAGE(MouseButtonDownMsg)
+	ON_MESSAGE(EnterViewMsg)
+	ON_MESSAGE(TurnOn)
+	ON_MESSAGE(MovieEndMsg)
+END_MESSAGE_MAP()
+
 int CArboretumGate::_v1;
 int CArboretumGate::_v2;
 int CArboretumGate::_v3;
@@ -133,17 +143,17 @@ void CArboretumGate::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CArboretumGate::handleMessage(CActMsg &msg) { return false; }
-bool CArboretumGate::handleMessage(CLeaveViewMsg &msg) { return false; }
-bool CArboretumGate::handleMessage(CTurnOff &msg) { return false; }
-bool CArboretumGate::handleMessage(CMouseButtonDownMsg &msg) { return false; }
+bool CArboretumGate::ActMsg(CActMsg *msg) { return false; }
+bool CArboretumGate::LeaveViewMsg(CLeaveViewMsg *msg) { return false; }
+bool CArboretumGate::TurnOff(CTurnOff *msg) { return false; }
+bool CArboretumGate::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return false; }
 
-bool CArboretumGate::handleMessage(CEnterViewMsg &msg) {
+bool CArboretumGate::EnterViewMsg(CEnterViewMsg *msg) {
 	warning("CArboretumGate::handleEvent");
 	return false;
 }
 
-bool CArboretumGate::handleMessage(CTurnOn &msg) { return false; }
-bool CArboretumGate::handleMessage(CMovieEndMsg &msg) { return false; }
+bool CArboretumGate::TurnOn(CTurnOn *msg) { return false; }
+bool CArboretumGate::MovieEndMsg(CMovieEndMsg *msg) { return false; }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
index a176e93..9b0674f 100644
--- a/engines/titanic/game/arboretum_gate.h
+++ b/engines/titanic/game/arboretum_gate.h
@@ -29,14 +29,8 @@
 
 namespace Titanic {
 
-class CArboretumGate : public CBackground,
-	public CActMsgTarget,
-	public CLeaveViewMsgTarget,
-	public CTurnOffTarget,
-	public CMouseButtonDownMsgTarget,
-	public CEnterViewMsgTarget,
-	public CTurnOnTarget,
-	public CMovieEndMsgTarget {
+class CArboretumGate : public CBackground {
+	DECLARE_MESSAGE_MAP
 private:
 	static int _v1;
 	static int _v2;
@@ -73,13 +67,13 @@ private:
 	int _field150;
 	CString _string2;
 protected:
-	virtual bool handleMessage(CActMsg &msg);
-	virtual bool handleMessage(CLeaveViewMsg &msg);	
-	virtual bool handleMessage(CTurnOff &msg);
-	virtual bool handleMessage(CMouseButtonDownMsg &msg);
-	virtual bool handleMessage(CEnterViewMsg &msg);
-	virtual bool handleMessage(CTurnOn &msg);
-	virtual bool handleMessage(CMovieEndMsg &msg);
+	virtual bool ActMsg(CActMsg *msg);
+	virtual bool LeaveViewMsg(CLeaveViewMsg *msg);
+	virtual bool TurnOff(CTurnOff *msg);
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	virtual bool EnterViewMsg(CEnterViewMsg *msg);
+	virtual bool TurnOn(CTurnOn *msg);
+	virtual bool MovieEndMsg(CMovieEndMsg *msg);
 public:
 	CLASSDEF
 	CArboretumGate();
diff --git a/engines/titanic/game/bar_bell.h b/engines/titanic/game/bar_bell.h
index 865e446..2d8a36b 100644
--- a/engines/titanic/game/bar_bell.h
+++ b/engines/titanic/game/bar_bell.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CBarBell : public CGameObject,
-	public CEnterRoomMsgTarget {
+class CBarBell : public CGameObject {
 public:
 	int _fieldBC;
 	int _fieldC0;
diff --git a/engines/titanic/game/bomb.h b/engines/titanic/game/bomb.h
index 9f33189..bd3852e 100644
--- a/engines/titanic/game/bomb.h
+++ b/engines/titanic/game/bomb.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CBomb : public CBackground,
-	public CEnterRoomMsgTarget {
+class CBomb : public CBackground {
 private:
 	int _fieldE0;
 	int _fieldE4;
diff --git a/engines/titanic/game/cdrom.h b/engines/titanic/game/cdrom.h
index 61bada0..fa1c803 100644
--- a/engines/titanic/game/cdrom.h
+++ b/engines/titanic/game/cdrom.h
@@ -29,11 +29,7 @@
 
 namespace Titanic {
 
-class CCDROM : public CGameObject,
-	public CMouseDragStartMsgTarget,
-	public CMouseDragEndMsgTarget,
-	public CMouseDragMoveMsgTarget,
-	public CActMsgTarget {
+class CCDROM : public CGameObject {
 private:
 	Point _tempPos;
 protected:
diff --git a/engines/titanic/game/cdrom_tray.h b/engines/titanic/game/cdrom_tray.h
index b1893c5..0833847 100644
--- a/engines/titanic/game/cdrom_tray.h
+++ b/engines/titanic/game/cdrom_tray.h
@@ -28,10 +28,7 @@
 
 namespace Titanic {
 
-class CCDROMTray : public CGameObject,
-	public CActMsgTarget,
-	public CMovieEndMsgTarget,
-	public CStatusChangeMsgTarget {
+class CCDROMTray : public CGameObject {
 public:
 	int _state;
 	CString _string1;
diff --git a/engines/titanic/game/chicken_cooler.h b/engines/titanic/game/chicken_cooler.h
index 6f57cdd..f15bba4 100644
--- a/engines/titanic/game/chicken_cooler.h
+++ b/engines/titanic/game/chicken_cooler.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CChickenCooler : public CGameObject,
-	public CEnterRoomMsgTarget {
+class CChickenCooler : public CGameObject {
 private:
 	int _fieldBC;
 	int _fieldC0;
diff --git a/engines/titanic/game/dead_area.h b/engines/titanic/game/dead_area.h
index c696c84..6390475 100644
--- a/engines/titanic/game/dead_area.h
+++ b/engines/titanic/game/dead_area.h
@@ -31,9 +31,7 @@ namespace Titanic {
 /**
  * Implements a non-responsive screen area
  */
-class CDeadArea : public CGameObject,
-	public CMouseButtonDownMsgTarget,
-	public CMouseButtonUpMsgTarget {
+class CDeadArea : public CGameObject {
 protected:
 	virtual bool handleMessage(CMouseButtonDownMsg &msg) { return true; }
 	virtual bool handleMessage(CMouseButtonUpMsg &msg) { return true; }
diff --git a/engines/titanic/game/doorbot_elevator_handler.h b/engines/titanic/game/doorbot_elevator_handler.h
index bd33747..351fb1f 100644
--- a/engines/titanic/game/doorbot_elevator_handler.h
+++ b/engines/titanic/game/doorbot_elevator_handler.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CDoorbotElevatorHandler : public CGameObject,
-	public CEnterNodeMsgTarget {
+class CDoorbotElevatorHandler : public CGameObject {
 private:
 	static int _v1;
 	int _value;
diff --git a/engines/titanic/game/end_sequence_control.h b/engines/titanic/game/end_sequence_control.h
index 87eaf17..61165e3 100644
--- a/engines/titanic/game/end_sequence_control.h
+++ b/engines/titanic/game/end_sequence_control.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CEndSequenceControl : public CGameObject,
-	public CEnterRoomMsgTarget {
+class CEndSequenceControl : public CGameObject {
 protected:
 	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
diff --git a/engines/titanic/game/fan_noises.h b/engines/titanic/game/fan_noises.h
index 495ac39..778891e 100644
--- a/engines/titanic/game/fan_noises.h
+++ b/engines/titanic/game/fan_noises.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CFanNoises : public CGameObject,
-	public CEnterRoomMsgTarget {
+class CFanNoises : public CGameObject {
 private:
 	int _fieldBC;
 	int _fieldC0;
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
index 7ca0b4d..f719587 100644
--- a/engines/titanic/game/get_lift_eye2.h
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -27,8 +27,7 @@
 #include "titanic/messages/messages.h"
 namespace Titanic {
 
-class CGetLiftEye2 : public CGameObject,
-	public CEnterRoomMsgTarget {
+class CGetLiftEye2 : public CGameObject {
 private:
 	static CString *_v1;
 protected:
diff --git a/engines/titanic/game/light.h b/engines/titanic/game/light.h
index a2e562c..e419a3b 100644
--- a/engines/titanic/game/light.h
+++ b/engines/titanic/game/light.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CLight : public CBackground,
-	public CEnterRoomMsgTarget {
+class CLight : public CBackground {
 private:
 	int _fieldE0;
 	int _fieldE4;
diff --git a/engines/titanic/game/light_switch.h b/engines/titanic/game/light_switch.h
index 3e44590..f2132c9 100644
--- a/engines/titanic/game/light_switch.h
+++ b/engines/titanic/game/light_switch.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CLightSwitch : public CBackground,
-	public CEnterRoomMsgTarget {
+class CLightSwitch : public CBackground {
 public:
 	static int _v1;
 private:
diff --git a/engines/titanic/game/parrot/player_meets_parrot.h b/engines/titanic/game/parrot/player_meets_parrot.h
index 9e47a0a..bc96cb8 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.h
+++ b/engines/titanic/game/parrot/player_meets_parrot.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CPlayerMeetsParrot : public CGameObject,
-	public CEnterRoomMsgTarget {
+class CPlayerMeetsParrot : public CGameObject {
 protected:
 	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
diff --git a/engines/titanic/game/pet/pet_monitor.h b/engines/titanic/game/pet/pet_monitor.h
index 5cf14f3..56116d8 100644
--- a/engines/titanic/game/pet/pet_monitor.h
+++ b/engines/titanic/game/pet/pet_monitor.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CPETMonitor : public CGameObject,
-	public CEnterRoomMsgTarget {
+class CPETMonitor : public CGameObject {
 protected:
 	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
diff --git a/engines/titanic/game/pet/pet_position.h b/engines/titanic/game/pet/pet_position.h
index 820df41..589f2b6 100644
--- a/engines/titanic/game/pet/pet_position.h
+++ b/engines/titanic/game/pet/pet_position.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CPETPosition : public CGameObject,
-	public CEnterRoomMsgTarget {
+class CPETPosition : public CGameObject {
 protected:
 	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
diff --git a/engines/titanic/game/pet/pet_transport.h b/engines/titanic/game/pet/pet_transport.h
index 8dd3f3a..2c94bb6 100644
--- a/engines/titanic/game/pet/pet_transport.h
+++ b/engines/titanic/game/pet/pet_transport.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CPETTransport : public CGameObject,
-	public CEnterRoomMsgTarget {
+class CPETTransport : public CGameObject {
 protected:
 	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
diff --git a/engines/titanic/game/sgt/sgt_state_room.h b/engines/titanic/game/sgt/sgt_state_room.h
index 6e53ad3..7ae9611 100644
--- a/engines/titanic/game/sgt/sgt_state_room.h
+++ b/engines/titanic/game/sgt/sgt_state_room.h
@@ -45,8 +45,7 @@ struct CSGTStateRoomStatics {
 	int _v14;
 };
 
-class CSGTStateRoom : public CBackground,
-	public CEnterRoomMsgTarget {
+class CSGTStateRoom : public CBackground {
 private:
 	static CSGTStateRoomStatics *_statics;
 private:
diff --git a/engines/titanic/game/ship_setting.h b/engines/titanic/game/ship_setting.h
index 878feba..5b5ea68 100644
--- a/engines/titanic/game/ship_setting.h
+++ b/engines/titanic/game/ship_setting.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CShipSetting : public CBackground,
-	public CEnterRoomMsgTarget {
+class CShipSetting : public CBackground {
 private:
 	CString _string3;
 	Point _pos1;
diff --git a/engines/titanic/game/start_action.h b/engines/titanic/game/start_action.h
index 2b19e77..ebdc4ab 100644
--- a/engines/titanic/game/start_action.h
+++ b/engines/titanic/game/start_action.h
@@ -28,9 +28,7 @@
 
 namespace Titanic {
 
-class CStartAction : public CBackground,
-	public CMouseButtonDownMsgTarget,
-	public CMouseButtonUpMsgTarget {
+class CStartAction : public CBackground {
 protected:
 	CString _msgTarget;
 	CString _msgAction;
diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h
index c2a18df..dc324e1 100644
--- a/engines/titanic/game/transport/lift.h
+++ b/engines/titanic/game/transport/lift.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CLift : public CTransport,
-	public CEnterRoomMsgTarget {
+class CLift : public CTransport {
 private:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/game/transport/pellerator.h b/engines/titanic/game/transport/pellerator.h
index b97d17f..82809a0 100644
--- a/engines/titanic/game/transport/pellerator.h
+++ b/engines/titanic/game/transport/pellerator.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CPellerator : public CTransport,
-	public CEnterRoomMsgTarget {
+class CPellerator : public CTransport {
 private:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/game/up_lighter.h b/engines/titanic/game/up_lighter.h
index 589e279..27b1d7b 100644
--- a/engines/titanic/game/up_lighter.h
+++ b/engines/titanic/game/up_lighter.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CUpLighter : public CDropTarget,
-	public CEnterRoomMsgTarget {
+class CUpLighter : public CDropTarget {
 private:
 	int _field118;
 	int _field11C;
diff --git a/engines/titanic/game/volume_control.h b/engines/titanic/game/volume_control.h
index 5586c9c..ae10d97 100644
--- a/engines/titanic/game/volume_control.h
+++ b/engines/titanic/game/volume_control.h
@@ -28,7 +28,7 @@
 
 namespace Titanic {
 
-class CVolumeControl : public CGameObject, CEnterNodeMsgTarget {
+class CVolumeControl : public CGameObject {
 private:
 	int _fieldBC;
 	CString _string1;
diff --git a/engines/titanic/gfx/st_button.cpp b/engines/titanic/gfx/st_button.cpp
index 3878004..154122e 100644
--- a/engines/titanic/gfx/st_button.cpp
+++ b/engines/titanic/gfx/st_button.cpp
@@ -24,6 +24,12 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CSTButton, CBackground)
+	ON_MESSAGE(MouseButtonDownMsg)
+	ON_MESSAGE(MouseButtonUpMsg)
+	ON_MESSAGE(EnterViewMsg)
+END_MESSAGE_MAP()
+
 CSTButton::CSTButton() : CBackground() {
 	_statusInc = 0;
 	_statusTarget = "NULL";
@@ -60,14 +66,14 @@ void CSTButton::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CSTButton::handleMessage(CMouseButtonDownMsg &msg) {
+bool CSTButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	changeStatus(0);
 	// TODO: Obj6c stuff
 
 	return true;
 }
 
-bool CSTButton::handleMessage(CMouseButtonUpMsg &msg) {
+bool CSTButton::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
 	int oldStatus = _currentStatus;
 	int newStatus = _currentStatus + _statusInc;
 
@@ -82,7 +88,7 @@ bool CSTButton::handleMessage(CMouseButtonUpMsg &msg) {
 	return true;
 }
 
-bool CSTButton::handleMessage(CEnterViewMsg &msg) {
+bool CSTButton::EnterViewMsg(CEnterViewMsg *msg) {
 	loadFrame(_buttonFrame);
 	return true;
 }
diff --git a/engines/titanic/gfx/st_button.h b/engines/titanic/gfx/st_button.h
index d613ad0..fd2b0fa 100644
--- a/engines/titanic/gfx/st_button.h
+++ b/engines/titanic/gfx/st_button.h
@@ -29,10 +29,8 @@
 
 namespace Titanic {
 
-class CSTButton : public CBackground,
-	public CMouseButtonDownMsgTarget,
-	public CMouseButtonUpMsgTarget,
-	public CEnterViewMsgTarget {
+class CSTButton : public CBackground {
+	DECLARE_MESSAGE_MAP
 private:
 	int _statusInc;
 	CString _statusTarget;
@@ -42,9 +40,9 @@ private:
 	CString _string5;
 	int _buttonFrame;
 protected:
-	virtual bool handleMessage(CMouseButtonDownMsg &msg);
-	virtual bool handleMessage(CMouseButtonUpMsg &msg);
-	virtual bool handleMessage(CEnterViewMsg &msg);
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+	virtual bool EnterViewMsg(CEnterViewMsg *msg);
 public:
 	CLASSDEF
 	CSTButton();
diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
index 1c3d406..9f46fef 100644
--- a/engines/titanic/messages/messages.cpp
+++ b/engines/titanic/messages/messages.cpp
@@ -23,6 +23,7 @@
 #include "titanic/messages/messages.h"
 #include "titanic/messages/mouse_messages.h"
 #include "titanic/core/game_object.h"
+#include "titanic/core/message_target.h"
 #include "titanic/core/tree_item.h"
 #include "titanic/titanic.h"
 
@@ -79,6 +80,33 @@ bool CMessage::execute(const CString &target, const ClassDef *classDef, int flag
 	return false;
 }
 
+const MSGMAP_ENTRY *CMessage::findMapEntry(const CTreeItem *treeItem, const ClassDef *classDef) {
+	// Iterate through the class and any parent classes
+	for (const MSGMAP *msgMap = treeItem->getMessageMap(); msgMap->pFnGetBaseMap;
+			msgMap = msgMap->pFnGetBaseMap()) {
+		// Iterate through the map entries for this class
+		for (const MSGMAP_ENTRY *entry = msgMap->lpEntries;
+				entry->_class != nullptr; ++entry) {
+			// Check if the class or any of it's ancesotrs is handled by this entry
+			for (const ClassDef *entryDef = entry->_class; entryDef; entryDef = entryDef->_parent) {
+				if (entryDef == classDef)
+					return entry;
+			}			
+		}
+	}
+
+	return nullptr;
+}
+
+bool CMessage::perform(CTreeItem *treeItem) {
+	const MSGMAP_ENTRY *entry = findMapEntry(treeItem, getType());
+	return entry && (*treeItem.*(entry->_fn))(this);
+}
+
+bool CMessage::supports(const CTreeItem *treeItem, ClassDef *classDef) {
+	return findMapEntry(treeItem, classDef) != nullptr;
+}
+
 bool CMessage::isMouseMsg() const {
 	return dynamic_cast<const CMouseMsg *>(this) != nullptr;
 }
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index f4c16f5..e566b5d 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -35,67 +35,49 @@ enum MessageFlag {
 	MSGFLAG_CLASS_DEF = 4
 };
 
-#define MSGTARGET(NAME) class NAME; class NAME##Target { public: \
-	virtual bool handleMessage(NAME &msg) = 0; }
-
-#define MESSAGE0(NAME) MSGTARGET(NAME); \
+#define MESSAGE0(NAME) \
 	class NAME: public CMessage { \
 	public: NAME() : CMessage() {} \
 	CLASSDEF \
 	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
-	virtual bool perform(CTreeItem *treeItem) { \
-		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
-		return dest != nullptr && dest->handleMessage(*this); \
-	} }
-#define MESSAGE1(NAME, F1, N1, V1) MSGTARGET(NAME); \
+		return supports(item, _type); } \
+}
+#define MESSAGE1(NAME, F1, N1, V1) \
 	class NAME: public CMessage { \
 	public: F1 _##N1; \
 	NAME() : CMessage(), _##N1(V1) {} \
 	NAME(F1 N1) : CMessage(), _##N1(N1) {} \
 	CLASSDEF \
 	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
-	virtual bool perform(CTreeItem *treeItem) { \
-		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
-		return dest != nullptr && dest->handleMessage(*this); \
-	} }
-#define MESSAGE2(NAME, F1, N1, V1, F2, N2, V2) MSGTARGET(NAME); \
+		return supports(item, _type); } \
+}
+#define MESSAGE2(NAME, F1, N1, V1, F2, N2, V2) \
 	class NAME: public CMessage { \
 	public: F1 _##N1; F2 _##N2; \
 	NAME() : CMessage(), _##N1(V1), _##N2(V2) {} \
 	NAME(F1 N1, F2 N2) : CMessage(), _##N1(N1), _##N2(N2) {} \
 	CLASSDEF \
 	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
-	virtual bool perform(CTreeItem *treeItem) { \
-		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
-		return dest != nullptr && dest->handleMessage(*this); \
-	} }
-#define MESSAGE3(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3) MSGTARGET(NAME); \
+		return supports(item, _type); } \
+}
+#define MESSAGE3(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3) \
 	class NAME: public CMessage { \
 	public: F1 _##N1; F2 _##N2; F3 _##N3; \
 	NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3) {} \
 	NAME(F1 N1, F2 N2, F3 N3) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3) {} \
 	CLASSDEF \
 	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
-	virtual bool perform(CTreeItem *treeItem) { \
-		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
-		return dest != nullptr && dest->handleMessage(*this); \
-	} }
-#define MESSAGE4(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3, F4, N4, V4) MSGTARGET(NAME); \
+		return supports(item, _type); } \
+}
+#define MESSAGE4(NAME, F1, N1, V1, F2, N2, V2, F3, N3, V3, F4, N4, V4) \
 	class NAME: public CMessage { \
 	public: F1 _##N1; F2 _##N2; F3 _##N3; F4 _##N4; \
 	NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3), _##N4(V4) {} \
 	NAME(F1 N1, F2 N2, F3 N3, F4 N4) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3), _##N4(N4) {} \
 	CLASSDEF \
 	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
-	virtual bool perform(CTreeItem *treeItem) { \
-		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
-		return dest != nullptr && dest->handleMessage(*this); \
-	} }
+		return supports(item, _type); } \
+}
 
 class CGameObject;
 class CRoomItem;
@@ -103,6 +85,11 @@ class CNodeItem;
 class CViewItem;
 
 class CMessage : public CSaveableObject {
+private:
+	/**
+	 * Find a map entry that supports the given class
+	 */
+	static const MSGMAP_ENTRY *findMapEntry(const CTreeItem *treeItem, const ClassDef *classDef);
 public:
 	CLASSDEF
 	CMessage();
@@ -121,7 +108,15 @@ public:
 	bool execute(const CString &target, const ClassDef *classDef = nullptr,
 		int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED);
 
-	virtual bool perform(CTreeItem *treeItem) { return false; }
+	/**
+	 * Makes the passed item execute the message
+	 */
+	virtual bool perform(CTreeItem *treeItem);
+
+	/**
+	 * Returns true if the passed item supports the specified message class
+	 */
+	static bool supports(const CTreeItem *treeItem, ClassDef *classDef);
 
 	/**
 	 * Save the data for the class to file
@@ -149,7 +144,6 @@ public:
 	virtual bool isLeaveViewMsg() const;
 };
 
-MSGTARGET(CEditControlMsg);
 class CEditControlMsg : public CMessage {
 public:
 	int _field4;
@@ -164,16 +158,10 @@ public:
 		_field1C(0), _field20(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CEditControlMsgTarget *>(item) != nullptr;
-	}
-
-	virtual bool perform(CTreeItem *treeItem) { 
-		CEditControlMsgTarget *dest = dynamic_cast<CEditControlMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return CMessage::supports(item, _type);
 	}
 };
 
-MSGTARGET(CLightsMsg);
 class CLightsMsg : public CMessage {
 public:
 	int _field4;
@@ -186,15 +174,10 @@ public:
 		_fieldC(0), _field10(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CLightsMsgTarget *>(item) != nullptr;
-	}
-	virtual bool perform(CTreeItem *treeItem) {
-		CLightsMsgTarget *dest = dynamic_cast<CLightsMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return supports(item, _type);
 	}
 };
 
-MSGTARGET(CIsHookedOnMsg);
 class CIsHookedOnMsg : public CMessage {
 public:
 	int _field4;
@@ -209,15 +192,10 @@ public:
 		_field18(0), _field1C(0), _field20(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CIsHookedOnMsgTarget *>(item) != nullptr;
-	}
-	virtual bool perform(CTreeItem *treeItem) {
-		CIsHookedOnMsgTarget *dest = dynamic_cast<CIsHookedOnMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return supports(item, _type);
 	}
 };
 
-MSGTARGET(CSubAcceptCCarryMsg);
 class CSubAcceptCCarryMsg : public CMessage {
 public:
 	CString _string1;
@@ -227,15 +205,10 @@ public:
 	CSubAcceptCCarryMsg() : _value1(0), _value2(0), _value3(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CSubAcceptCCarryMsgTarget *>(item) != nullptr;
-	}
-	virtual bool perform(CTreeItem *treeItem) {
-		CSubAcceptCCarryMsgTarget *dest = dynamic_cast<CSubAcceptCCarryMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return supports(item, _type);
 	}
 };
 
-MSGTARGET(CTransportMsg);
 class CTransportMsg : public CMessage {
 public:
 	CString _string;
@@ -245,17 +218,12 @@ public:
 	CTransportMsg() : _value1(0), _value2(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CTransportMsgTarget *>(item) != nullptr;
-	}
-	virtual bool perform(CTreeItem *treeItem) {
-		CTransportMsgTarget *dest = dynamic_cast<CTransportMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return supports(item, _type);
 	}
 };
 
 MESSAGE1(CTimeMsg, int, value, 0);
 
-MSGTARGET(CTimerMsg);
 class CTimerMsg : public CTimeMsg {
 public:
 	int _field8;
@@ -266,11 +234,7 @@ public:
 	CTimerMsg() : CTimeMsg(), _field8(0), _fieldC(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CTimerMsgTarget *>(item) != nullptr;
-	}
-	virtual bool perform(CTreeItem *treeItem) {
-		CTimerMsgTarget *dest = dynamic_cast<CTimerMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return supports(item, _type);
 	}
 };
 
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 1bc77b6..811fdf0 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -30,7 +30,6 @@ namespace Titanic {
 
 enum MouseButton { MB_LEFT = 1, MB_MIDDLE = 2, MB_RIGHT = 4 };
 
-MSGTARGET(CMouseMsg);
 class CMouseMsg : public CMessage {
 public:
 	int _buttons;
@@ -38,11 +37,7 @@ public:
 public:
 	CLASSDEF
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseMsg *>(item) != nullptr;
-	}
-	virtual bool perform(CTreeItem *treeItem) {
-		CMouseMsgTarget *dest = dynamic_cast<CMouseMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return supports(item, _type);
 	}
 
 	CMouseMsg() : _buttons(0) {}
@@ -50,7 +45,6 @@ public:
 		_mousePos(pt), _buttons(buttons) {}
 };
 
-MSGTARGET(CMouseMoveMsg);
 class CMouseMoveMsg : public CMouseMsg {
 public:
 	CLASSDEF
@@ -58,15 +52,10 @@ public:
 	CMouseMoveMsg(const Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseMoveMsgTarget *>(item) != nullptr;
-	}
-	virtual bool perform(CTreeItem *treeItem) { 
-		CMouseMoveMsgTarget *dest = dynamic_cast<CMouseMoveMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return supports(item, _type);
 	}
 };
 
-MSGTARGET(CMouseButtonMsg);
 class CMouseButtonMsg : public CMouseMsg {
 public:
 	int _field10;
@@ -76,11 +65,10 @@ public:
 	CMouseButtonMsg(const Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseButtonMsgTarget *>(item) != nullptr;
+		return supports(item, _type);
 	}
 };
 
-MSGTARGET(CMouseButtonDownMsg);
 class CMouseButtonDownMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
@@ -88,15 +76,10 @@ public:
 	CMouseButtonDownMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseButtonDownMsgTarget *>(item) != nullptr;
-	}
-	virtual bool perform(CTreeItem *treeItem) {
-		CMouseButtonDownMsgTarget *dest = dynamic_cast<CMouseButtonDownMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return supports(item, _type);
 	}
 };
 
-MSGTARGET(CMouseButtonUpMsg);
 class CMouseButtonUpMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
@@ -104,15 +87,10 @@ public:
 	CMouseButtonUpMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseButtonUpMsg *>(item) != nullptr;
-	}
-	virtual bool perform(CTreeItem *treeItem) { 
-		CMouseButtonUpMsgTarget *dest = dynamic_cast<CMouseButtonUpMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return supports(item, _type);
 	}
 };
 
-MSGTARGET(CMouseDoubleClickMsg);
 class CMouseDoubleClickMsg : public CMouseButtonMsg {
 public:
 	CLASSDEF
@@ -120,15 +98,10 @@ public:
 	CMouseDoubleClickMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseDoubleClickMsgTarget *>(item) != nullptr;
-	}
-	virtual bool perform(CTreeItem *treeItem) { 
-		CMouseDoubleClickMsgTarget *dest = dynamic_cast<CMouseDoubleClickMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return supports(item, _type);
 	}
 };
 
-MSGTARGET(CMouseDragMsg);
 class CMouseDragMsg : public CMouseMsg {
 public:
 	CLASSDEF
@@ -136,11 +109,10 @@ public:
 	CMouseDragMsg(const Point &pt) : CMouseMsg(pt, 0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseDragMsg *>(item) != nullptr;
+		return supports(item, _type);
 	}
 };
 
-MSGTARGET(CMouseDragMoveMsg);
 class CMouseDragMoveMsg : public CMouseDragMsg {
 public:
 	CLASSDEF
@@ -148,15 +120,10 @@ public:
 	CMouseDragMoveMsg(const Point &pt) : CMouseDragMsg(pt) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseDragMoveMsgTarget *>(item) != nullptr;
-	}
-	virtual bool perform(CTreeItem *treeItem) { 
-		CMouseDragMoveMsgTarget *dest = dynamic_cast<CMouseDragMoveMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return supports(item, _type);
 	}
 };
 
-MSGTARGET(CMouseDragStartMsg);
 class CMouseDragStartMsg : public CMouseDragMsg {
 public:
 	CTreeItem *_dragItem;
@@ -168,15 +135,10 @@ public:
 		_dragItem(nullptr), _field14(0) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseDragStartMsgTarget *>(item) != nullptr;
-	}
-	virtual bool perform(CTreeItem *treeItem) { 
-		CMouseDragStartMsgTarget *dest = dynamic_cast<CMouseDragStartMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return supports(item, _type);
 	}
 };
 
-MSGTARGET(CMouseDragEndMsg);
 class CMouseDragEndMsg : public CMouseDragMsg {
 public:
 	CTreeItem *_dropTarget;
@@ -187,11 +149,7 @@ public:
 		CMouseDragMsg(pt), _dropTarget(dragItem) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
-		return dynamic_cast<const CMouseDragEndMsgTarget *>(item) != nullptr;
-	}
-	virtual bool perform(CTreeItem *treeItem) {
-		CMouseDragEndMsgTarget *dest = dynamic_cast<CMouseDragEndMsgTarget *>(treeItem);
-		return dest != nullptr && dest->handleMessage(*this);
+		return supports(item, _type);
 	}
 };
 
diff --git a/engines/titanic/messages/pet_messages.h b/engines/titanic/messages/pet_messages.h
index 7e39056..f7d9c30 100644
--- a/engines/titanic/messages/pet_messages.h
+++ b/engines/titanic/messages/pet_messages.h
@@ -42,18 +42,16 @@ MESSAGE1(CPETStarFieldLockMsg, int, value, 0);
 MESSAGE0(CPETStereoFieldOnOffMsg);
 MESSAGE2(CPETTargetMsg, CString, name, "", int, numValue, -1);
 
-#define PET_MESSAGE(NAME) MSGTARGET(NAME); \
+#define PET_MESSAGE(NAME) \
 	class NAME: public CPETTargetMsg { \
 	public: \
 	NAME() : CPETTargetMsg() {} \
 	NAME(const CString &name, int num) : CPETTargetMsg(name, num) {} \
 	CLASSDEF \
 	static bool isSupportedBy(const CTreeItem *item) { \
-		return dynamic_cast<const NAME##Target *>(item) != nullptr; } \
-	virtual bool perform(CTreeItem *treeItem) { \
-		NAME##Target *dest = dynamic_cast<NAME##Target *>(treeItem); \
-		return dest != nullptr && dest->handleMessage(*this); \
-	} }
+		return supports(item, _type); \
+	} \
+}
 
 PET_MESSAGE(CPETDownMsg);
 PET_MESSAGE(CPETUpMsg);
diff --git a/engines/titanic/moves/enter_bridge.h b/engines/titanic/moves/enter_bridge.h
index 743960d..0920443 100644
--- a/engines/titanic/moves/enter_bridge.h
+++ b/engines/titanic/moves/enter_bridge.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CEnterBridge : public CGameObject,
-	public CEnterRoomMsgTarget {
+class CEnterBridge : public CGameObject {
 private:
 	int _value;
 protected:
diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h
index 0cad69a..158db10 100644
--- a/engines/titanic/npcs/barbot.h
+++ b/engines/titanic/npcs/barbot.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CBarbot : public CTrueTalkNPC,
-	public CEnterRoomMsgTarget {
+class CBarbot : public CTrueTalkNPC {
 private:
 	static int _v0;
 private:
diff --git a/engines/titanic/npcs/liftbot.h b/engines/titanic/npcs/liftbot.h
index 03867cc..a984ea8 100644
--- a/engines/titanic/npcs/liftbot.h
+++ b/engines/titanic/npcs/liftbot.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CLiftBot : public CTrueTalkNPC,
-	public CEnterRoomMsgTarget {
+class CLiftBot : public CTrueTalkNPC {
 private:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index fbb9efc..5bc3edc 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -27,6 +27,18 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPetControl, CGameObject)
+	ON_MESSAGE(MouseButtonDownMsg)
+	ON_MESSAGE(MouseDragStartMsg)
+	ON_MESSAGE(MouseDragMoveMsg)
+	ON_MESSAGE(MouseDragEndMsg)
+	ON_MESSAGE(MouseButtonUpMsg)
+	ON_MESSAGE(MouseDoubleClickMsg)
+	ON_MESSAGE(KeyCharMsg)
+	ON_MESSAGE(VirtualKeyCharMsg)
+	ON_MESSAGE(TimerMsg)
+END_MESSAGE_MAP()
+
 CPetControl::CPetControl() : CGameObject(), 
 		_currentArea(PET_CONVERSATION), _fieldC0(0), _locked(0), _fieldC8(0),
 		_treeItem1(nullptr), _treeItem2(nullptr), _hiddenRoom(nullptr),
@@ -233,74 +245,74 @@ bool CPetControl::getC0() const {
 	return _fieldC0 > 0;
 }
 
-bool CPetControl::handleMessage(CMouseButtonDownMsg &msg) {
-	if (!containsPt(msg._mousePos) || getC0())
+bool CPetControl::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	if (!containsPt(msg->_mousePos) || getC0())
 		return false;
 
 	bool result = false;
 	if (isUnlocked())
-		result = _frame.handleMessage(msg);
+		result = _frame.MouseButtonDownMsg(msg);
 
 	if (!result) {
-		result = _sections[_currentArea]->handleMessage(msg);
+		result = _sections[_currentArea]->MouseButtonDownMsg(msg);
 	}
 
 	makeDirty();
 	return result;
 }
 
-bool CPetControl::handleMessage(CMouseDragStartMsg &msg) {
-	if (!containsPt(msg._mousePos) || getC0())
+bool CPetControl::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+	if (!containsPt(msg->_mousePos) || getC0())
 		return false;
 
-	return _sections[_currentArea]->handleMessage(msg);
+	return _sections[_currentArea]->MouseDragStartMsg(msg);
 }
 
-bool CPetControl::handleMessage(CMouseDragMoveMsg &msg) {
-	return _sections[_currentArea]->handleMessage(msg);
+bool CPetControl::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
+	return _sections[_currentArea]->MouseDragMoveMsg(msg);
 }
 
-bool CPetControl::handleMessage(CMouseDragEndMsg &msg) {
-	return _sections[_currentArea]->handleMessage(msg);
+bool CPetControl::MouseDragEndMsg(CMouseDragEndMsg *msg) {
+	return _sections[_currentArea]->MouseDragEndMsg(msg);
 }
 
-bool CPetControl::handleMessage(CMouseButtonUpMsg &msg) {
-	if (!containsPt(msg._mousePos) || getC0())
+bool CPetControl::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+	if (!containsPt(msg->_mousePos) || getC0())
 		return false;
 
 	bool result = false;
 	if (isUnlocked())
-		result = _frame.handleMessage(msg);
+		result = _frame.MouseButtonUpMsg(msg);
 
 	if (!result)
-		result = _sections[_currentArea]->handleMessage(msg);
+		result = _sections[_currentArea]->MouseButtonUpMsg(msg);
 
 	makeDirty();
 	return result;
 }
 
-bool CPetControl::handleMessage(CMouseDoubleClickMsg &msg) {
-	if (!containsPt(msg._mousePos) || getC0())
+bool CPetControl::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
+	if (!containsPt(msg->_mousePos) || getC0())
 		return false;
 
-	return _sections[_currentArea]->handleMessage(msg);
+	return _sections[_currentArea]->MouseDoubleClickMsg(msg);
 }
 
-bool CPetControl::handleMessage(CKeyCharMsg &msg) {
+bool CPetControl::KeyCharMsg(CKeyCharMsg *msg) {
 	if (getC0())
 		return false;
 
-	return _sections[_currentArea]->handleMessage(msg);
+	return _sections[_currentArea]->KeyCharMsg(msg);
 }
 
-bool CPetControl::handleMessage(CVirtualKeyCharMsg &msg) {
+bool CPetControl::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
 	if (getC0())
 		return false;
 
-	bool result = _sections[_currentArea]->handleMessage(msg);
+	bool result = _sections[_currentArea]->VirtualKeyCharMsg(msg);
 
 	if (!result) {
-		switch (msg._keyState.keycode) {
+		switch (msg->_keyState.keycode) {
 		case Common::KEYCODE_F1:
 			result = true;
 			setArea(PET_INVENTORY);
@@ -329,7 +341,7 @@ bool CPetControl::handleMessage(CVirtualKeyCharMsg &msg) {
 	return result;
 }
 
-bool CPetControl::handleMessage(CTimerMsg &msg) {
+bool CPetControl::TimerMsg(CTimerMsg *msg) {
 	warning("TODO: CPetControl::CTimerMsg");
 	return true;
 }
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 6f5b794..172cec9 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -39,16 +39,8 @@
 
 namespace Titanic {
 
-class CPetControl : public CGameObject,
-	public CMouseButtonDownMsgTarget,
-	public CMouseDragStartMsgTarget,
-	public CMouseDragMoveMsgTarget,
-	public CMouseDragEndMsgTarget,
-	public CMouseButtonUpMsgTarget,
-	public CMouseDoubleClickMsgTarget,
-	public CKeyCharMsgTarget,
-	public CVirtualKeyCharMsgTarget,
-	public CTimerMsgTarget {
+class CPetControl : public CGameObject {
+	DECLARE_MESSAGE_MAP
 private:
 	int _fieldC0;
 	int _locked;
@@ -102,15 +94,15 @@ private:
 
 	bool getC0() const;
 protected:
-	bool handleMessage(CMouseButtonDownMsg &msg);
-	bool handleMessage(CMouseDragStartMsg &msg);
-	bool handleMessage(CMouseDragMoveMsg &msg);
-	bool handleMessage(CMouseDragEndMsg &msg);
-	bool handleMessage(CMouseButtonUpMsg &msg);
-	bool handleMessage(CMouseDoubleClickMsg &msg);
-	bool handleMessage(CKeyCharMsg &msg);
-	bool handleMessage(CVirtualKeyCharMsg &msg);
-	bool handleMessage(CTimerMsg &msg);
+	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
+	bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
+	bool MouseDragEndMsg(CMouseDragEndMsg *msg);
+	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+	bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
+	bool KeyCharMsg(CKeyCharMsg *msg);
+	bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg);
+	bool TimerMsg(CTimerMsg *msg);
 public:
 	PetArea _currentArea;
 public:
diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index 423c79a..68c258c 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -40,8 +40,8 @@ bool CPetElement::proc6(const Common::Point &pt) {
 	return result;
 }
 
-bool CPetElement::handleMessage(CMouseButtonDownMsg &msg) {
-	bool result = _bounds.contains(msg._mousePos);
+bool CPetElement::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	bool result = _bounds.contains(msg->_mousePos);
 	if (result)
 		setMode(MODE_UNSELECTED);
 	return result;
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index 2d56b57..a53715d 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -70,7 +70,7 @@ public:
 	virtual void getBounds(Rect *rect);
 
 	virtual bool proc6(const Common::Point &pt);
-	virtual bool handleMessage(CMouseButtonDownMsg &msg);
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 
 	/**
 	 * Returns whether the passed point falls inside the item
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index 6e3ff4f..1859b0d 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -63,9 +63,9 @@ bool CPetFrame::setup() {
 	return true;
 }
 
-bool CPetFrame::handleMessage(CMouseButtonDownMsg &msg) {
+bool CPetFrame::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	for (int idx = 0; idx < 5; ++idx) {
-		if (_modeButtons[idx].handleMessage(msg)) {
+		if (_modeButtons[idx].MouseButtonDownMsg(msg)) {
 			_petControl->setArea(PET_AREAS[idx]);
 			resetArea();
 			_modeButtons[idx].setMode(MODE_SELECTED);
diff --git a/engines/titanic/pet_control/pet_frame.h b/engines/titanic/pet_control/pet_frame.h
index f26a2bf..ec8bd1e 100644
--- a/engines/titanic/pet_control/pet_frame.h
+++ b/engines/titanic/pet_control/pet_frame.h
@@ -62,8 +62,8 @@ public:
 	/**
 	 * Handles mouse down messages
 	 */
-	virtual bool handleMessage(CMouseButtonDownMsg &msg);
-	virtual bool handleMessage(CMouseButtonUpMsg &msg) { return false; }
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) { return false; }
 
 	/**
 	 * Returns true if the object is in a valid state
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 169f0c0..e20c03c 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -80,14 +80,14 @@ public:
 	 * Following are handlers for the various messages that the PET can
 	 * pass onto the currently active section/area
 	 */
-	virtual bool handleMessage(CMouseButtonDownMsg &msg) { return false; }
-	virtual bool handleMessage(CMouseDragStartMsg &msg) { return false; }
-	virtual bool handleMessage(CMouseDragMoveMsg &msg) { return false; }
-	virtual bool handleMessage(CMouseDragEndMsg &msg) { return false; }
-	virtual bool handleMessage(CMouseButtonUpMsg &msg) { return false; }
-	virtual bool handleMessage(CMouseDoubleClickMsg &msg) { return false; }
-	virtual bool handleMessage(CKeyCharMsg &msg) { return false; }
-	virtual bool handleMessage(CVirtualKeyCharMsg &msg) { return false; }
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return false; }
+	virtual bool MouseDragStartMsg(CMouseDragStartMsg *msg) { return false; }
+	virtual bool MouseDragMoveMsg(CMouseDragMoveMsg *msg) { return false; }
+	virtual bool MouseDragEndMsg(CMouseDragEndMsg *msg) { return false; }
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) { return false; }
+	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) { return false; }
+	virtual bool KeyCharMsg(CKeyCharMsg *msg) { return false; }
+	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) { return false; }
 
 	virtual int proc14() { return 0; }
 	virtual int proc15() { return 0; }
diff --git a/engines/titanic/sound/auto_music_player.h b/engines/titanic/sound/auto_music_player.h
index da8a386..0848439 100644
--- a/engines/titanic/sound/auto_music_player.h
+++ b/engines/titanic/sound/auto_music_player.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CAutoMusicPlayer : public CAutoMusicPlayerBase,
-	public CEnterRoomMsgTarget {
+class CAutoMusicPlayer : public CAutoMusicPlayerBase {
 private:
 	CString _string2;
 protected:
diff --git a/engines/titanic/sound/music_player.h b/engines/titanic/sound/music_player.h
index 4cc510c..614fa37 100644
--- a/engines/titanic/sound/music_player.h
+++ b/engines/titanic/sound/music_player.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CMusicPlayer : public CGameObject,
-	public CEnterRoomMsgTarget {
+class CMusicPlayer : public CGameObject {
 protected:
 	int _fieldBC;
 	CString _string1;
diff --git a/engines/titanic/sound/node_auto_sound_player.h b/engines/titanic/sound/node_auto_sound_player.h
index fee4d3d..451b946 100644
--- a/engines/titanic/sound/node_auto_sound_player.h
+++ b/engines/titanic/sound/node_auto_sound_player.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CNodeAutoSoundPlayer : public CAutoSoundPlayer,
-	public CEnterNodeMsgTarget {
+class CNodeAutoSoundPlayer : public CAutoSoundPlayer {
 private:
 	int _fieldEC;
 protected:
diff --git a/engines/titanic/sound/room_auto_sound_player.h b/engines/titanic/sound/room_auto_sound_player.h
index c72aff1..70d3dfe 100644
--- a/engines/titanic/sound/room_auto_sound_player.h
+++ b/engines/titanic/sound/room_auto_sound_player.h
@@ -28,8 +28,7 @@
 
 namespace Titanic {
 
-class CRoomAutoSoundPlayer : public CAutoSoundPlayer,
-	public CEnterRoomMsgTarget {
+class CRoomAutoSoundPlayer : public CAutoSoundPlayer {
 protected:
 	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
diff --git a/engines/titanic/sound/room_trigger_auto_music_player.h b/engines/titanic/sound/room_trigger_auto_music_player.h
index 4ce4bae..c3e4d0f 100644
--- a/engines/titanic/sound/room_trigger_auto_music_player.h
+++ b/engines/titanic/sound/room_trigger_auto_music_player.h
@@ -28,7 +28,7 @@
 
 namespace Titanic {
 
-class CRoomTriggerAutoMusicPlayer : public CTriggerAutoMusicPlayer, CEnterRoomMsgTarget {
+class CRoomTriggerAutoMusicPlayer : public CTriggerAutoMusicPlayer {
 protected:
 	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:


Commit: 826dcf1f42fc1a5c5a4e7c34f395e51c6f5944df
    https://github.com/scummvm/scummvm/commit/826dcf1f42fc1a5c5a4e7c34f395e51c6f5944df
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-06T23:38:46-04:00

Commit Message:
TITANIC: Fix class hierarchy in ClassDef structures

Changed paths:
    engines/titanic/core/saveable_object.cpp



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 1e35983..9f0ac32 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -421,7 +421,8 @@ Common::List<ClassDef *> *CSaveableObject::_classDefs;
 
 #define DEFFN(T) ClassDef *T::_type; \
 	CSaveableObject *Function##T() { return new T(); }
-#define ADDFN(CHILD, PARENT) CHILD::_type = new TypeTemplate<CHILD>(#CHILD, nullptr); \
+#define ADDFN(CHILD, PARENT) \
+	CHILD::_type = new TypeTemplate<CHILD>(#CHILD, PARENT::_type); \
 	(*_classList)[#CHILD] = Function##CHILD
 
 DEFFN(CArm)
@@ -1321,7 +1322,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CSmallChevLeftOn, CToggleSwitch);
 	ADDFN(CSmallChevRightOff, CToggleSwitch);
 	ADDFN(CSmallChevRightOn, CToggleSwitch);
-	ADDFN(CStatusChangeButton, CSTButtonClass);
+	ADDFN(CStatusChangeButton, CSTButton);
 	ADDFN(CSTButton, CBackground);
 	ADDFN(CTextDown, CPetGraphic);
 	ADDFN(CTextSkrew, CPetGraphic);


Commit: bc7a7deb775568cdbe205e3f8c4f5ebd03e34141
    https://github.com/scummvm/scummvm/commit/bc7a7deb775568cdbe205e3f8c4f5ebd03e34141
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-07T00:06:18-04:00

Commit Message:
TITANIC: Fix showing custom cursors when highlighting objects

Changed paths:
    engines/titanic/core/view_item.cpp
    engines/titanic/support/mouse_cursor.cpp
    engines/titanic/support/mouse_cursor.h



diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 8120b3c..d747f06 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -209,9 +209,13 @@ bool CViewItem::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
 
 bool CViewItem::MouseMoveMsg(CMouseMoveMsg *msg) {
 	CScreenManager *screenManager = CScreenManager::_screenManagerPtr;
+	uint changeCount = screenManager->_mouseCursor->getChangeCount();
 
 	if (handleMouseMsg(msg, true)) {
-		screenManager->_mouseCursor->setCursor(CURSOR_ARROW);
+		// If the cursor hasn't been set in the call to handleMouseMsg,
+		// then reset it back to the default arrow cursor
+		if (screenManager->_mouseCursor->getChangeCount() == changeCount)
+			screenManager->_mouseCursor->setCursor(CURSOR_ARROW);
 	} else {
 		// Iterate through each link item, and if any is highlighted,
 		// change the mouse cursor to the designated cursor for the item
@@ -226,7 +230,7 @@ bool CViewItem::MouseMoveMsg(CMouseMoveMsg *msg) {
 			treeItem = treeItem->getNextSibling();
 		}
 
-		if (!handleMouseMsg(msg, false))
+		if (!handleMouseMsg(msg, false) || (screenManager->_mouseCursor->getChangeCount() == changeCount))
 			screenManager->_mouseCursor->setCursor(CURSOR_ARROW);
 	}
 
@@ -244,7 +248,7 @@ bool CViewItem::handleMouseMsg(CMouseMsg *msg, bool flag) {
 	for (CTreeItem *treeItem = scan(this); treeItem; treeItem = treeItem->scan(this)) {
 		CGameObject *gameObject = dynamic_cast<CGameObject *>(treeItem);
 		if (gameObject) {
-			if (gameObject->checkPoint(msg->_mousePos, 0, 1) &&
+			if (gameObject->checkPoint(msg->_mousePos, false, true) &&
 					(!flag || !gameObject->_field60)) {
 				if (gameObjects.size() < 256)
 					gameObjects.push_back(gameObject);
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index c4c57c6..a2bd116 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -50,7 +50,7 @@ static const int CURSOR_DATA[NUM_CURSORS][4] = {
 };
 
 CMouseCursor::CMouseCursor(CScreenManager *screenManager) : 
-		_screenManager(screenManager), _cursorId(CURSOR_HOURGLASS) {
+		_screenManager(screenManager), _cursorId(CURSOR_HOURGLASS), _setCursorCount(0) {
 	loadCursorImages();
 	setCursor(CURSOR_ARROW);
 }
@@ -90,6 +90,8 @@ void CMouseCursor::hide() {
 }
 
 void CMouseCursor::setCursor(CursorId cursorId) {
+	++_setCursorCount;
+
 	if (cursorId != _cursorId) {
 		CursorEntry &ce = _cursors[cursorId - 1];
 		CVideoSurface &surface = *ce._videoSurface;
diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h
index 831e207..6e1e6f7 100644
--- a/engines/titanic/support/mouse_cursor.h
+++ b/engines/titanic/support/mouse_cursor.h
@@ -61,6 +61,7 @@ private:
 	CScreenManager *_screenManager;
 	CursorId _cursorId;
 	CursorEntry _cursors[NUM_CURSORS];
+	uint _setCursorCount;
 
 	/**
 	 * Load the images for each cursor
@@ -89,6 +90,11 @@ public:
 	 * Updates the mouse cursor
 	 */
 	void update();
+
+	/**
+	 * Returns the number of times the cursor has been set
+	 */
+	uint getChangeCount() const { return _setCursorCount; }
 };
 
 


Commit: cdfd9f3703050a36e16455f4bf8c343b36dd4b39
    https://github.com/scummvm/scummvm/commit/cdfd9f3703050a36e16455f4bf8c343b36dd4b39
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-07T00:13:22-04:00

Commit Message:
TITANIC: Fix message map for CTelevision

Changed paths:
    engines/titanic/game/television.cpp
    engines/titanic/game/television.h



diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 610a3f0..5585cfc 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -25,6 +25,22 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CTelevision, CGameObject)
+	ON_MESSAGE(LeaveViewMsg)
+	ON_MESSAGE(ChangeSeasonMsg)
+	ON_MESSAGE(EnterViewMsg)
+	ON_MESSAGE(PETUpMsg)
+	ON_MESSAGE(PETDownMsg)
+	ON_MESSAGE(StatusChangeMsg)
+	ON_MESSAGE(ActMsg)
+	ON_MESSAGE(PETActivateMsg)
+	ON_MESSAGE(MovieEndMsg)
+	ON_MESSAGE(ShipSettingMsg)
+	ON_MESSAGE(TurnOff)
+	ON_MESSAGE(TurnOn)
+	ON_MESSAGE(LightsMsg)
+END_MESSAGE_MAP()
+
 int CTelevision::_v1;
 bool CTelevision::_turnOn;
 int CTelevision::_v3;
@@ -82,7 +98,7 @@ void CTelevision::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CTelevision::handleMessage(CLeaveViewMsg &msg) {
+bool CTelevision::LeaveViewMsg(CLeaveViewMsg *msg) {
 	clearPet();
 	if (_isOn) {
 		if (soundFn1(_fieldF0))
@@ -102,17 +118,17 @@ bool CTelevision::handleMessage(CLeaveViewMsg &msg) {
 	return true;
 }
 
-bool CTelevision::handleMessage(CChangeSeasonMsg &msg) {
-	if (msg._season.compareTo("Autumn")) {
+bool CTelevision::ChangeSeasonMsg(CChangeSeasonMsg *msg) {
+	if (msg->_season.compareTo("Autumn")) {
 		_v1 = 545;
 		_v3 = 0;
-	} else if (msg._season.compareTo("Winter")) {
+	} else if (msg->_season.compareTo("Winter")) {
 		_v1 = 503;
 		_v3 = 0;
-	} else if (msg._season.compareTo("Spring")) {
+	} else if (msg->_season.compareTo("Spring")) {
 		_v1 = 517;
 		_v3 = 0;
-	} else if (msg._season.compareTo("Winter")) {
+	} else if (msg->_season.compareTo("Winter")) {
 		_v1 = 531;
 		_v3 = 0;
 	}
@@ -120,7 +136,7 @@ bool CTelevision::handleMessage(CChangeSeasonMsg &msg) {
 	return true; 
 }
 
-bool CTelevision::handleMessage(CEnterViewMsg &msg) {
+bool CTelevision::EnterViewMsg(CEnterViewMsg *msg) {
 	setPetArea(PET_REMOTE);
 	petFn2(2);
 	petFn3(0);
@@ -133,8 +149,8 @@ bool CTelevision::handleMessage(CEnterViewMsg &msg) {
 static const int FRAMES1[9] = { 0, 0, 56, 112, 168, 224, 280, 336, 392 };
 static const int FRAMES2[8] = { 0, 55, 111, 167, 223, 279, 335, 391 };
 
-bool CTelevision::handleMessage(CPETUpMsg &msg) {
-	if (msg._name == "Television" && _isOn) {
+bool CTelevision::PETUpMsg(CPETUpMsg *msg) {
+	if (msg->_name == "Television" && _isOn) {
 		if (soundFn1(_fieldF0))
 			soundFn2(_fieldF0, 0);
 
@@ -146,8 +162,8 @@ bool CTelevision::handleMessage(CPETUpMsg &msg) {
 	return true;
 }
 
-bool CTelevision::handleMessage(CPETDownMsg &msg) {
-	if (msg._name == "Television" && _isOn) {
+bool CTelevision::PETDownMsg(CPETDownMsg *msg) {
+	if (msg->_name == "Television" && _isOn) {
 		if (soundFn1(_fieldF0))
 			soundFn2(_fieldF0, 0);
 		if (--_fieldE0 < 1)
@@ -161,7 +177,7 @@ bool CTelevision::handleMessage(CPETDownMsg &msg) {
 	return true;
 }
 
-bool CTelevision::handleMessage(CStatusChangeMsg &msg) {
+bool CTelevision::StatusChangeMsg(CStatusChangeMsg *msg) {
 	if (_isOn) {
 		stopMovie();
 		changeStatus(0);
@@ -170,8 +186,8 @@ bool CTelevision::handleMessage(CStatusChangeMsg &msg) {
 	return true;
 }
 
-bool CTelevision::handleMessage(CActMsg &msg) {
-	if (msg._action == "TurnTVOnOff") {
+bool CTelevision::ActMsg(CActMsg *msg) {
+	if (msg->_action == "TurnTVOnOff") {
 		_isOn = !_isOn;
 		if (_isOn) {
 			setVisible(true);
@@ -186,8 +202,8 @@ bool CTelevision::handleMessage(CActMsg &msg) {
 	return true;
 }
 
-bool CTelevision::handleMessage(CPETActivateMsg &msg) {
-	if (msg._name == "Television") {
+bool CTelevision::PETActivateMsg(CPETActivateMsg *msg) {
+	if (msg->_name == "Television") {
 		CVisibleMsg visibleMsg(_isOn);
 		_isOn = !_isOn;
 
@@ -210,32 +226,32 @@ bool CTelevision::handleMessage(CPETActivateMsg &msg) {
 	return true;
 }
 
-bool CTelevision::handleMessage(CMovieEndMsg &msg) {
+bool CTelevision::MovieEndMsg(CMovieEndMsg *msg) {
 	warning("TODO: CMovieEndMsg");
 	return true;
 }
 
-bool CTelevision::handleMessage(CShipSettingMsg &msg) {
-	_v4 = msg._value;
+bool CTelevision::ShipSettingMsg(CShipSettingMsg *msg) {
+	_v4 = msg->_value;
 	return true;
 }
 
-bool CTelevision::handleMessage(CTurnOff &msg) {
+bool CTelevision::TurnOff(CTurnOff *msg) {
 	_turnOn = false;
 	return true;
 }
 
-bool CTelevision::handleMessage(CTurnOn &msg) {
+bool CTelevision::TurnOn(CTurnOn *msg) {
 	_turnOn = true;
 	return true;
 }
 
-bool CTelevision::handleMessage(CLightsMsg &msg) {
+bool CTelevision::LightsMsg(CLightsMsg *msg) {
 	CPetControl *pet = getPetControl();
 	if (pet)
 		pet->fn4();
 
-	if (msg._field8 || !_turnOn)
+	if (msg->_field8 || !_turnOn)
 		_turnOn = true;
 
 	return true;
diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
index 9fb3394..54e8663 100644
--- a/engines/titanic/game/television.h
+++ b/engines/titanic/game/television.h
@@ -30,6 +30,7 @@
 namespace Titanic {
 
 class CTelevision : public CBackground {
+	DECLARE_MESSAGE_MAP
 private:
 	static int _v1;
 	static bool _turnOn;
@@ -44,19 +45,19 @@ private:
 	int _fieldEC;
 	int _fieldF0;
 protected:
-	virtual bool handleMessage(CLeaveViewMsg &msg);
-	virtual bool handleMessage(CChangeSeasonMsg &msg);
-	virtual bool handleMessage(CEnterViewMsg &msg);
-	virtual bool handleMessage(CPETUpMsg &msg);
-	virtual bool handleMessage(CPETDownMsg &msg);
-	virtual bool handleMessage(CStatusChangeMsg &msg);
-	virtual bool handleMessage(CActMsg &msg);
-	virtual bool handleMessage(CPETActivateMsg &msg);
-	virtual bool handleMessage(CMovieEndMsg &msg);
-	virtual bool handleMessage(CShipSettingMsg &msg);
-	virtual bool handleMessage(CTurnOff &msg);
-	virtual bool handleMessage(CTurnOn &msg);
-	virtual bool handleMessage(CLightsMsg &msg);
+	virtual bool LeaveViewMsg(CLeaveViewMsg *msg);
+	virtual bool ChangeSeasonMsg(CChangeSeasonMsg *msg);
+	virtual bool EnterViewMsg(CEnterViewMsg *msg);
+	virtual bool PETUpMsg(CPETUpMsg *msg);
+	virtual bool PETDownMsg(CPETDownMsg *msg);
+	virtual bool StatusChangeMsg(CStatusChangeMsg *msg);
+	virtual bool ActMsg(CActMsg *msg);
+	virtual bool PETActivateMsg(CPETActivateMsg *msg);
+	virtual bool MovieEndMsg(CMovieEndMsg *msg);
+	virtual bool ShipSettingMsg(CShipSettingMsg *msg);
+	virtual bool TurnOff(CTurnOff *msg);
+	virtual bool TurnOn(CTurnOn *msg);
+	virtual bool LightsMsg(CLightsMsg *msg);
 public:
 	CLASSDEF
 	CTelevision();


Commit: 31934ac4ba62546d66e565e6caa0da0caa666d23
    https://github.com/scummvm/scummvm/commit/31934ac4ba62546d66e565e6caa0da0caa666d23
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-07T19:14:25-04:00

Commit Message:
TITANIC: Fleshed out CCDROMTray class

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/cdrom.cpp
    engines/titanic/game/cdrom_tray.cpp
    engines/titanic/game/cdrom_tray.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 2bac988..0570008 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -410,15 +410,15 @@ int CGameObject::getSurface45() const {
 	return _surface ? _surface->proc45() : 0;
 }
 
-void CGameObject::calcProximity(const CString &name, int val2, int val3, int val4) {
+void CGameObject::soundProximity(const CString &name, int val2, int val3, int val4) {
 	CProximity prox;
 	prox._field8 = val2;
 	prox._fieldC = val3;
 	prox._field20 = val4;
-	calcProximity(name, prox);
+	soundProximity(name, prox);
 }
 
-void CGameObject::calcProximity(const CString &name, CProximity &prox) {
+void CGameObject::soundProximity(const CString &name, CProximity &prox) {
 	if (prox._field28 == 2) {
 		// TODO
 	}
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 7391a6b..7219242 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -56,7 +56,6 @@ private:
 	void loadImage(const CString &name, bool pendingFlag = true);
 
 	void processClipList2();
-	void calcProximity(const CString &name, CProximity &obj6C);
 protected:
 	Rect _bounds;
 	double _field34;
@@ -181,7 +180,8 @@ public:
 	 */
 	void loadFrame(int frameNumber);
 
-	void calcProximity(const CString &name, int val2, int val3, int val4);
+	void soundProximity(const CString &name, int val2, int val3, int val4);
+	void soundProximity(const CString &name, CProximity &obj6C);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/cdrom.cpp b/engines/titanic/game/cdrom.cpp
index d4e4eac..4f4089d 100644
--- a/engines/titanic/game/cdrom.cpp
+++ b/engines/titanic/game/cdrom.cpp
@@ -55,7 +55,7 @@ bool CCDROM::handleMessage(CMouseDragEndMsg &msg) {
 	if (msg._dropTarget && msg._dropTarget->getName() == "newComputer") {
 		CCDROMTray *newTray = dynamic_cast<CCDROMTray *>(getRoom()->findByName("newTray"));
 
-		if (newTray->_state && newTray->_string1 == "None") {
+		if (newTray->_state && newTray->_insertedCD == "None") {
 			CActMsg actMsg(getName());
 			actMsg.execute(newTray);
 		}
diff --git a/engines/titanic/game/cdrom_tray.cpp b/engines/titanic/game/cdrom_tray.cpp
index 7265332..77ee539 100644
--- a/engines/titanic/game/cdrom_tray.cpp
+++ b/engines/titanic/game/cdrom_tray.cpp
@@ -20,17 +20,26 @@
  *
  */
 
+#include "titanic/core/room_item.h"
 #include "titanic/game/cdrom_tray.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CCDROMTray, CGameObject)
+	ON_MESSAGE(ActMsg)
+	ON_MESSAGE(MovieEndMsg)
+	ON_MESSAGE(StatusChangeMsg)
+END_MESSAGE_MAP()
+
+
 CCDROMTray::CCDROMTray() : CGameObject(), _state(0) {
 }
 
 void CCDROMTray::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_state, indent);
-	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_insertedCD, indent);
 
 	CGameObject::save(file, indent);
 }
@@ -38,23 +47,72 @@ void CCDROMTray::save(SimpleFile *file, int indent) const {
 void CCDROMTray::load(SimpleFile *file) {
 	file->readNumber();
 	_state = file->readNumber();
-	_string1 = file->readString();
+	_insertedCD = file->readString();
 
 	CGameObject::load(file);
 }
 
-bool CCDROMTray::handleMessage(CActMsg &msg) {
-	// TODO
+bool CCDROMTray::ActMsg(CActMsg *msg) {
+	if (msg->_action == "ClickedOn") {
+		if (_state) {
+			if (_insertedCD == "None") {
+				fn1(55, 65, 0);
+				soundProximity("a#35.wav", 50, 0, 0);
+				_state = 0;
+			} else {
+				CTreeItem *treeItem = getRoom()->findByName(_insertedCD);
+				if (treeItem) {
+					CActMsg actMsg("Ejected");
+					actMsg.execute(treeItem);
+				}
+
+				_insertedCD = "None";
+				loadFrame(52);
+			}
+		} else if (_insertedCD == "None") {
+			fn1(44, 54, 0);
+			soundProximity("a#34.wav", 50, 0, 0);
+			_state = 1;
+		} else if (_insertedCD == "newCD1" || _insertedCD == "newCD2") {
+			fn1(22, 32, 0);
+			soundProximity("a#34.wav", 50, 0, 0);
+			_state = 1;
+		} else if (_insertedCD == "newSTCD") {
+			fn1(0, 10, 0);
+			soundProximity("a#34.wav", 50, 0, 0);
+			_state = 1;
+		}
+	} else if (_state) {
+		if (msg->_action == "newCD1" || msg->_action == "newCD2") {
+			fn1(33, 43, 4);
+			soundProximity("a#35.wav", 50, 0, 0);
+		} else if (msg->_action == "newSTCD") {
+			fn1(11, 21, 4);
+			soundProximity("a#35.wav", 50, 0, 0);
+		} else {
+			return true;
+		}
+
+		_insertedCD = msg->_action;
+		_state = 0;
+	}
+
 	return true;
 }
 
-bool CCDROMTray::handleMessage(CMovieEndMsg &msg) {
-	// TODO
+bool CCDROMTray::MovieEndMsg(CMovieEndMsg *msg) {
+	CTreeItem *treeItem = getRoom()->findByName("newScreen");
+	
+	if (treeItem) {
+		CActMsg actMsg(_insertedCD);
+		actMsg.execute(treeItem);
+	}
+
 	return true;
 }
 
-bool CCDROMTray::handleMessage(CStatusChangeMsg &msg) {
-	// TODO
+bool CCDROMTray::StatusChangeMsg(CStatusChangeMsg *msg) {
+	msg->_success = _state;
 	return true;
 }
 
diff --git a/engines/titanic/game/cdrom_tray.h b/engines/titanic/game/cdrom_tray.h
index 0833847..728471c 100644
--- a/engines/titanic/game/cdrom_tray.h
+++ b/engines/titanic/game/cdrom_tray.h
@@ -29,13 +29,14 @@
 namespace Titanic {
 
 class CCDROMTray : public CGameObject {
+	DECLARE_MESSAGE_MAP
 public:
 	int _state;
-	CString _string1;
+	CString _insertedCD;
 protected:
-	virtual bool handleMessage(CActMsg &msg);
-	virtual bool handleMessage(CMovieEndMsg &msg);
-	virtual bool handleMessage(CStatusChangeMsg &msg);
+	virtual bool ActMsg(CActMsg *msg);
+	virtual bool MovieEndMsg(CMovieEndMsg *msg);
+	virtual bool StatusChangeMsg(CStatusChangeMsg *msg);
 public:
 	CLASSDEF
 	CCDROMTray();


Commit: 6fd32e6dc10e8b3332b0438c069a61f009185441
    https://github.com/scummvm/scummvm/commit/6fd32e6dc10e8b3332b0438c069a61f009185441
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-07T19:50:16-04:00

Commit Message:
TITANIC: Minor change to Cursor enum

Changed paths:
    engines/titanic/core/view_item.cpp
    engines/titanic/support/mouse_cursor.h



diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index d747f06..3f6d5d5 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -262,7 +262,7 @@ bool CViewItem::handleMouseMsg(CMouseMsg *msg, bool flag) {
 			return false;
 
 		for (int idx = (int)gameObjects.size() - 1; idx >= 0; ++idx) {
-			if (gameObjects[idx]->_cursorId != CURSOR_ARROW2) {
+			if (gameObjects[idx]->_cursorId != CURSOR_IGNORE) {
 				CScreenManager::_screenManagerPtr->_mouseCursor->setCursor(gameObjects[idx]->_cursorId);
 				break;
 			}
diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h
index 6e1e6f7..ac5da26 100644
--- a/engines/titanic/support/mouse_cursor.h
+++ b/engines/titanic/support/mouse_cursor.h
@@ -42,7 +42,7 @@ enum CursorId {
 	CURSOR_ACTIVATE = 9,
 	CURSOR_INVALID = 10,
 	CURSOR_MAGNIFIER = 11,
-	CURSOR_ARROW2 = 12,
+	CURSOR_IGNORE = 12,
 	CURSOR_BACKWARDS = 13,
 	CURSOR_DOWN = 14,
 	CURSOR_HOURGLASS = 15


Commit: 41c08d186adc91111e9beccfeef80efb3fcc0fd6
    https://github.com/scummvm/scummvm/commit/41c08d186adc91111e9beccfeef80efb3fcc0fd6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-07T19:55:27-04:00

Commit Message:
TITANIC: Implement CDeadArea messages

Changed paths:
    engines/titanic/game/dead_area.cpp
    engines/titanic/game/dead_area.h



diff --git a/engines/titanic/game/dead_area.cpp b/engines/titanic/game/dead_area.cpp
index 1692d6b..5d5b2d0 100644
--- a/engines/titanic/game/dead_area.cpp
+++ b/engines/titanic/game/dead_area.cpp
@@ -24,6 +24,11 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CDeadArea, CGameObject)
+	ON_MESSAGE(MouseButtonDownMsg)
+	ON_MESSAGE(MouseButtonUpMsg)
+END_MESSAGE_MAP()
+
 CDeadArea::CDeadArea() : CGameObject() {
 }
 
diff --git a/engines/titanic/game/dead_area.h b/engines/titanic/game/dead_area.h
index 6390475..9a9de3a 100644
--- a/engines/titanic/game/dead_area.h
+++ b/engines/titanic/game/dead_area.h
@@ -32,9 +32,10 @@ namespace Titanic {
  * Implements a non-responsive screen area
  */
 class CDeadArea : public CGameObject {
+	DECLARE_MESSAGE_MAP
 protected:
-	virtual bool handleMessage(CMouseButtonDownMsg &msg) { return true; }
-	virtual bool handleMessage(CMouseButtonUpMsg &msg) { return true; }
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return true; }
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) { return true; }
 public:
 	CLASSDEF
 	CDeadArea();


Commit: 9f1bab55972b8a6f88b83c2391c40a038ffb509d
    https://github.com/scummvm/scummvm/commit/9f1bab55972b8a6f88b83c2391c40a038ffb509d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-07T22:03:35-04:00

Commit Message:
TITANIC: Converting other message stubs to new format

Changed paths:
    engines/titanic/core/background.h
    engines/titanic/core/view_item.h
    engines/titanic/game/arboretum_gate.h
    engines/titanic/game/auto_animate.cpp
    engines/titanic/game/auto_animate.h
    engines/titanic/game/bar_bell.cpp
    engines/titanic/game/bar_bell.h
    engines/titanic/game/bomb.cpp
    engines/titanic/game/bomb.h
    engines/titanic/game/cdrom.cpp
    engines/titanic/game/cdrom.h
    engines/titanic/game/cdrom_tray.h
    engines/titanic/game/chicken_cooler.cpp
    engines/titanic/game/chicken_cooler.h
    engines/titanic/game/dead_area.h
    engines/titanic/game/doorbot_elevator_handler.cpp
    engines/titanic/game/doorbot_elevator_handler.h
    engines/titanic/game/end_sequence_control.cpp
    engines/titanic/game/end_sequence_control.h
    engines/titanic/game/fan_noises.cpp
    engines/titanic/game/fan_noises.h
    engines/titanic/game/get_lift_eye2.cpp
    engines/titanic/game/get_lift_eye2.h
    engines/titanic/game/gondolier/gondolier_mixer.cpp
    engines/titanic/game/gondolier/gondolier_mixer.h
    engines/titanic/game/light.cpp
    engines/titanic/game/light.h
    engines/titanic/game/light_switch.cpp
    engines/titanic/game/light_switch.h
    engines/titanic/game/long_stick_dispenser.cpp
    engines/titanic/game/long_stick_dispenser.h
    engines/titanic/game/parrot/player_meets_parrot.cpp
    engines/titanic/game/parrot/player_meets_parrot.h
    engines/titanic/game/pet/pet_monitor.cpp
    engines/titanic/game/pet/pet_monitor.h
    engines/titanic/game/pet/pet_position.cpp
    engines/titanic/game/pet/pet_position.h
    engines/titanic/game/pet/pet_transport.cpp
    engines/titanic/game/pet/pet_transport.h
    engines/titanic/game/phonograph.cpp
    engines/titanic/game/phonograph.h
    engines/titanic/game/sgt/sgt_state_room.cpp
    engines/titanic/game/sgt/sgt_state_room.h
    engines/titanic/game/ship_setting.cpp
    engines/titanic/game/ship_setting.h
    engines/titanic/game/start_action.cpp
    engines/titanic/game/start_action.h
    engines/titanic/game/television.h
    engines/titanic/game/transport/lift.cpp
    engines/titanic/game/transport/lift.h
    engines/titanic/game/transport/lift_indicator.cpp
    engines/titanic/game/transport/lift_indicator.h
    engines/titanic/game/transport/pellerator.cpp
    engines/titanic/game/transport/pellerator.h
    engines/titanic/game/up_lighter.cpp
    engines/titanic/game/up_lighter.h
    engines/titanic/game/volume_control.cpp
    engines/titanic/game/volume_control.h
    engines/titanic/gfx/st_button.h
    engines/titanic/messages/bilge_dispensor_event.cpp
    engines/titanic/messages/bilge_dispensor_event.h
    engines/titanic/moves/enter_bridge.cpp
    engines/titanic/moves/enter_bridge.h
    engines/titanic/npcs/barbot.cpp
    engines/titanic/npcs/barbot.h
    engines/titanic/npcs/liftbot.cpp
    engines/titanic/npcs/liftbot.h
    engines/titanic/sound/auto_music_player.cpp
    engines/titanic/sound/auto_music_player.h
    engines/titanic/sound/music_player.cpp
    engines/titanic/sound/music_player.h
    engines/titanic/sound/node_auto_sound_player.cpp
    engines/titanic/sound/node_auto_sound_player.h
    engines/titanic/sound/restricted_auto_music_player.cpp
    engines/titanic/sound/restricted_auto_music_player.h
    engines/titanic/sound/room_auto_sound_player.cpp
    engines/titanic/sound/room_auto_sound_player.h
    engines/titanic/sound/room_trigger_auto_music_player.cpp
    engines/titanic/sound/room_trigger_auto_music_player.h
    engines/titanic/sound/titania_speech.cpp
    engines/titanic/sound/titania_speech.h



diff --git a/engines/titanic/core/background.h b/engines/titanic/core/background.h
index 91c3407..f4969d4 100644
--- a/engines/titanic/core/background.h
+++ b/engines/titanic/core/background.h
@@ -29,18 +29,16 @@
 namespace Titanic {
 
 class CBackground : public CGameObject {
+	DECLARE_MESSAGE_MAP
+	bool StatusChangeMsg(CStatusChangeMsg *msg);
+	bool SetFrameMsg(CSetFrameMsg *msg);
+	bool VisibleMsg(CVisibleMsg *msg);
 protected:
 	int _fieldBC;
 	int _fieldC0;
 	CString _string1;
 	CString _string2;
 	int _fieldDC;
-protected:
-	DECLARE_MESSAGE_MAP
-
-	virtual bool StatusChangeMsg(CStatusChangeMsg *msg);
-	virtual bool SetFrameMsg(CSetFrameMsg *msg);
-	virtual bool VisibleMsg(CVisibleMsg *msg);
 public:
 	CLASSDEF
 	CBackground();
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index 95edc7a..5abcf1d 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -31,6 +31,10 @@ namespace Titanic {
 
 class CViewItem : public CNamedItem {
 	DECLARE_MESSAGE_MAP
+	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+	bool MouseMoveMsg(CMouseMoveMsg *msg);
+	bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
 private:
 	CTreeItem *_buttonUpTargets[4];
 private:
@@ -51,11 +55,6 @@ protected:
 	CResourceKey _resourceKey;
 	int _field50;
 	int _field54;
-protected:
-	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
-	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
-	virtual bool MouseMoveMsg(CMouseMoveMsg *msg);
-	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
 public:
 	int _viewNumber;
 public:
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
index 9b0674f..736f67b 100644
--- a/engines/titanic/game/arboretum_gate.h
+++ b/engines/titanic/game/arboretum_gate.h
@@ -31,6 +31,13 @@ namespace Titanic {
 
 class CArboretumGate : public CBackground {
 	DECLARE_MESSAGE_MAP
+	bool ActMsg(CActMsg *msg);
+	bool LeaveViewMsg(CLeaveViewMsg *msg);
+	bool TurnOff(CTurnOff *msg);
+	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	bool EnterViewMsg(CEnterViewMsg *msg);
+	bool TurnOn(CTurnOn *msg);
+	bool MovieEndMsg(CMovieEndMsg *msg);
 private:
 	static int _v1;
 	static int _v2;
@@ -66,14 +73,6 @@ private:
 	int _field14C;
 	int _field150;
 	CString _string2;
-protected:
-	virtual bool ActMsg(CActMsg *msg);
-	virtual bool LeaveViewMsg(CLeaveViewMsg *msg);
-	virtual bool TurnOff(CTurnOff *msg);
-	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
-	virtual bool EnterViewMsg(CEnterViewMsg *msg);
-	virtual bool TurnOn(CTurnOn *msg);
-	virtual bool MovieEndMsg(CMovieEndMsg *msg);
 public:
 	CLASSDEF
 	CArboretumGate();
diff --git a/engines/titanic/game/auto_animate.cpp b/engines/titanic/game/auto_animate.cpp
index 2a3f371..8bd332a 100644
--- a/engines/titanic/game/auto_animate.cpp
+++ b/engines/titanic/game/auto_animate.cpp
@@ -40,7 +40,7 @@ void CAutoAnimate::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CAutoAnimate::handleMessage(CEnterViewMsg &msg) {
+bool CAutoAnimate::EnterViewMsg(CEnterViewMsg *msg) {
 	warning("CAutoAnimate::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/auto_animate.h b/engines/titanic/game/auto_animate.h
index 6fb8511..7130d6a 100644
--- a/engines/titanic/game/auto_animate.h
+++ b/engines/titanic/game/auto_animate.h
@@ -29,12 +29,11 @@
 namespace Titanic {
 
 class CAutoAnimate : public CBackground {
+	bool EnterViewMsg(CEnterViewMsg *msg);
 private:
 	int _fieldE0;
 	int _fieldE4;
 	int _fieldE8;
-protected:
-	virtual bool handleMessage(CEnterViewMsg &msg);
 public:
 	CLASSDEF
 	CAutoAnimate() : CBackground(), _fieldE0(1), _fieldE4(1), _fieldE8(0) {}
diff --git a/engines/titanic/game/bar_bell.cpp b/engines/titanic/game/bar_bell.cpp
index 84a4d04..adb563c 100644
--- a/engines/titanic/game/bar_bell.cpp
+++ b/engines/titanic/game/bar_bell.cpp
@@ -50,7 +50,7 @@ void CBarBell::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CBarBell::handleMessage(CEnterRoomMsg &msg) {
+bool CBarBell::EnterRoomMsg(CEnterRoomMsg *msg) {
 	_fieldBC = 0;
 	return true;
 }
diff --git a/engines/titanic/game/bar_bell.h b/engines/titanic/game/bar_bell.h
index 2d8a36b..b17d808 100644
--- a/engines/titanic/game/bar_bell.h
+++ b/engines/titanic/game/bar_bell.h
@@ -29,14 +29,13 @@
 namespace Titanic {
 
 class CBarBell : public CGameObject {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
 	int _fieldBC;
 	int _fieldC0;
 	int _fieldC4;
 	int _fieldC8;
 	int _fieldCC;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CBarBell();
diff --git a/engines/titanic/game/bomb.cpp b/engines/titanic/game/bomb.cpp
index 390ac2c..a6086a2 100644
--- a/engines/titanic/game/bomb.cpp
+++ b/engines/titanic/game/bomb.cpp
@@ -70,7 +70,7 @@ void CBomb::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CBomb::handleMessage(CEnterRoomMsg &msg) {
+bool CBomb::EnterRoomMsg(CEnterRoomMsg *msg) {
 	_fieldE8 = 12;
 	_fieldEC = 9;
 	_fieldF0 = 0;
diff --git a/engines/titanic/game/bomb.h b/engines/titanic/game/bomb.h
index bd3852e..76799da 100644
--- a/engines/titanic/game/bomb.h
+++ b/engines/titanic/game/bomb.h
@@ -29,6 +29,7 @@
 namespace Titanic {
 
 class CBomb : public CBackground {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	int _fieldE0;
 	int _fieldE4;
@@ -40,8 +41,6 @@ private:
 	int _fieldFC;
 	int _startingTicks;
 	int _field104;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CBomb();
diff --git a/engines/titanic/game/cdrom.cpp b/engines/titanic/game/cdrom.cpp
index 4f4089d..0d89319 100644
--- a/engines/titanic/game/cdrom.cpp
+++ b/engines/titanic/game/cdrom.cpp
@@ -26,6 +26,13 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CCDROM, CGameObject)
+	ON_MESSAGE(MouseDragStartMsg)
+	ON_MESSAGE(MouseDragEndMsg)
+	ON_MESSAGE(MouseDragMoveMsg)
+	ON_MESSAGE(ActMsg)
+END_MESSAGE_MAP()
+
 CCDROM::CCDROM() : CGameObject() {
 }
 
@@ -41,18 +48,18 @@ void CCDROM::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CCDROM::handleMessage(CMouseDragStartMsg &msg) {
-	if (checkStartDragging(&msg)) {
-		_tempPos = msg._mousePos - _bounds;
-		setPosition(msg._mousePos - _tempPos);
+bool CCDROM::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+	if (checkStartDragging(msg)) {
+		_tempPos = msg->_mousePos - _bounds;
+		setPosition(msg->_mousePos - _tempPos);
 		return true;
 	} else {
 		return false;
 	}
 }
 
-bool CCDROM::handleMessage(CMouseDragEndMsg &msg) {
-	if (msg._dropTarget && msg._dropTarget->getName() == "newComputer") {
+bool CCDROM::MouseDragEndMsg(CMouseDragEndMsg *msg) {
+	if (msg->_dropTarget && msg->_dropTarget->getName() == "newComputer") {
 		CCDROMTray *newTray = dynamic_cast<CCDROMTray *>(getRoom()->findByName("newTray"));
 
 		if (newTray->_state && newTray->_insertedCD == "None") {
@@ -65,13 +72,13 @@ bool CCDROM::handleMessage(CMouseDragEndMsg &msg) {
 	return true;
 }
 
-bool CCDROM::handleMessage(CMouseDragMoveMsg &msg) {
-	setPosition(msg._mousePos - _tempPos);
+bool CCDROM::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
+	setPosition(msg->_mousePos - _tempPos);
 	return true;
 }
 
-bool CCDROM::handleMessage(CActMsg &msg) {
-	if (msg._action == "Ejected")
+bool CCDROM::ActMsg(CActMsg *msg) {
+	if (msg->_action == "Ejected")
 		setVisible(true);
 
 	return true;
diff --git a/engines/titanic/game/cdrom.h b/engines/titanic/game/cdrom.h
index fa1c803..44e1e82 100644
--- a/engines/titanic/game/cdrom.h
+++ b/engines/titanic/game/cdrom.h
@@ -30,13 +30,13 @@
 namespace Titanic {
 
 class CCDROM : public CGameObject {
+	DECLARE_MESSAGE_MAP
+	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
+	bool MouseDragEndMsg(CMouseDragEndMsg *msg);
+	bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
+	bool ActMsg(CActMsg *msg);
 private:
 	Point _tempPos;
-protected:
-	virtual bool handleMessage(CMouseDragStartMsg &msg);
-	virtual bool handleMessage(CMouseDragEndMsg &msg);
-	virtual bool handleMessage(CMouseDragMoveMsg &msg);
-	virtual bool handleMessage(CActMsg &msg);
 public:
 	CLASSDEF
 	CCDROM();
diff --git a/engines/titanic/game/cdrom_tray.h b/engines/titanic/game/cdrom_tray.h
index 728471c..96faf64 100644
--- a/engines/titanic/game/cdrom_tray.h
+++ b/engines/titanic/game/cdrom_tray.h
@@ -30,13 +30,12 @@ namespace Titanic {
 
 class CCDROMTray : public CGameObject {
 	DECLARE_MESSAGE_MAP
+	bool ActMsg(CActMsg *msg);
+	bool MovieEndMsg(CMovieEndMsg *msg);
+	bool StatusChangeMsg(CStatusChangeMsg *msg);
 public:
 	int _state;
 	CString _insertedCD;
-protected:
-	virtual bool ActMsg(CActMsg *msg);
-	virtual bool MovieEndMsg(CMovieEndMsg *msg);
-	virtual bool StatusChangeMsg(CStatusChangeMsg *msg);
 public:
 	CLASSDEF
 	CCDROMTray();
diff --git a/engines/titanic/game/chicken_cooler.cpp b/engines/titanic/game/chicken_cooler.cpp
index ff7aae7..aa39f04 100644
--- a/engines/titanic/game/chicken_cooler.cpp
+++ b/engines/titanic/game/chicken_cooler.cpp
@@ -40,7 +40,7 @@ void CChickenCooler::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CChickenCooler::handleMessage(CEnterRoomMsg &msg) {
+bool CChickenCooler::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CChickenCoolor::handlEvent");
 	return true;
 }
diff --git a/engines/titanic/game/chicken_cooler.h b/engines/titanic/game/chicken_cooler.h
index f15bba4..220dba0 100644
--- a/engines/titanic/game/chicken_cooler.h
+++ b/engines/titanic/game/chicken_cooler.h
@@ -29,11 +29,10 @@
 namespace Titanic {
 
 class CChickenCooler : public CGameObject {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	int _fieldBC;
 	int _fieldC0;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CChickenCooler() : CGameObject(), _fieldBC(0), _fieldC0(0) {}
diff --git a/engines/titanic/game/dead_area.h b/engines/titanic/game/dead_area.h
index 9a9de3a..367308e 100644
--- a/engines/titanic/game/dead_area.h
+++ b/engines/titanic/game/dead_area.h
@@ -33,9 +33,8 @@ namespace Titanic {
  */
 class CDeadArea : public CGameObject {
 	DECLARE_MESSAGE_MAP
-protected:
-	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return true; }
-	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) { return true; }
+	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return true; }
+	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) { return true; }
 public:
 	CLASSDEF
 	CDeadArea();
diff --git a/engines/titanic/game/doorbot_elevator_handler.cpp b/engines/titanic/game/doorbot_elevator_handler.cpp
index 257b663..ae1894d 100644
--- a/engines/titanic/game/doorbot_elevator_handler.cpp
+++ b/engines/titanic/game/doorbot_elevator_handler.cpp
@@ -40,7 +40,7 @@ void CDoorbotElevatorHandler::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CDoorbotElevatorHandler::handleMessage(CEnterNodeMsg &msg) {
+bool CDoorbotElevatorHandler::EnterNodeMsg(CEnterNodeMsg *msg) {
 	warning("CDoorbotElevatorHandler::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/doorbot_elevator_handler.h b/engines/titanic/game/doorbot_elevator_handler.h
index 351fb1f..2bbfab9 100644
--- a/engines/titanic/game/doorbot_elevator_handler.h
+++ b/engines/titanic/game/doorbot_elevator_handler.h
@@ -29,11 +29,10 @@
 namespace Titanic {
 
 class CDoorbotElevatorHandler : public CGameObject {
+	bool EnterNodeMsg(CEnterNodeMsg *msg);
 private:
 	static int _v1;
 	int _value;
-protected:
-	virtual bool handleMessage(CEnterNodeMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/end_sequence_control.cpp b/engines/titanic/game/end_sequence_control.cpp
index 41bbc9d..2417214 100644
--- a/engines/titanic/game/end_sequence_control.cpp
+++ b/engines/titanic/game/end_sequence_control.cpp
@@ -34,7 +34,7 @@ void CEndSequenceControl::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CEndSequenceControl::handleMessage(CEnterRoomMsg &msg) {
+bool CEndSequenceControl::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("TODO: CEndSequenceControl::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/end_sequence_control.h b/engines/titanic/game/end_sequence_control.h
index 61165e3..64bafcb 100644
--- a/engines/titanic/game/end_sequence_control.h
+++ b/engines/titanic/game/end_sequence_control.h
@@ -29,8 +29,7 @@
 namespace Titanic {
 
 class CEndSequenceControl : public CGameObject {
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/fan_noises.cpp b/engines/titanic/game/fan_noises.cpp
index d7dd4e2..18a6ef7 100644
--- a/engines/titanic/game/fan_noises.cpp
+++ b/engines/titanic/game/fan_noises.cpp
@@ -55,7 +55,7 @@ void CFanNoises::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CFanNoises::handleMessage(CEnterRoomMsg &msg) {
+bool CFanNoises::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CFanNoises::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/fan_noises.h b/engines/titanic/game/fan_noises.h
index 778891e..a78b3ca 100644
--- a/engines/titanic/game/fan_noises.h
+++ b/engines/titanic/game/fan_noises.h
@@ -29,6 +29,7 @@
 namespace Titanic {
 
 class CFanNoises : public CGameObject {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	int _fieldBC;
 	int _fieldC0;
@@ -37,8 +38,6 @@ private:
 	int _fieldCC;
 	int _fieldD0;
 	int _fieldD4;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CFanNoises();
diff --git a/engines/titanic/game/get_lift_eye2.cpp b/engines/titanic/game/get_lift_eye2.cpp
index 5f3fac3..76e6d2a 100644
--- a/engines/titanic/game/get_lift_eye2.cpp
+++ b/engines/titanic/game/get_lift_eye2.cpp
@@ -46,7 +46,7 @@ void CGetLiftEye2::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CGetLiftEye2::handleMessage(CEnterRoomMsg &msg) {
+bool CGetLiftEye2::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CGetLiftEye2::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
index f719587..16ccf83 100644
--- a/engines/titanic/game/get_lift_eye2.h
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -28,10 +28,9 @@
 namespace Titanic {
 
 class CGetLiftEye2 : public CGameObject {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	static CString *_v1;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	static void init();
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.cpp b/engines/titanic/game/gondolier/gondolier_mixer.cpp
index 2bd3313..76bf259 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.cpp
+++ b/engines/titanic/game/gondolier/gondolier_mixer.cpp
@@ -57,10 +57,10 @@ void CGondolierMixer::load(SimpleFile *file) {
 	CGondolierBase::load(file);
 }
 
-bool CGondolierMixer::handleMessage(CEnterRoomMsg &msg) {
+bool CGondolierMixer::EnterRoomMsg(CEnterRoomMsg *msg) {
 	CRoomItem *parentRoom = dynamic_cast<CRoomItem *>(getParent());
-	if (parentRoom == msg._newRoom)
-		msg.execute(parentRoom);
+	if (parentRoom == msg->_newRoom)
+		msg->execute(parentRoom);
 	
 	return true;
 }
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.h b/engines/titanic/game/gondolier/gondolier_mixer.h
index 1186393..2202d24 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.h
+++ b/engines/titanic/game/gondolier/gondolier_mixer.h
@@ -29,6 +29,7 @@
 namespace Titanic {
 
 class CGondolierMixer : public CGondolierBase {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	int _fieldBC;
 	int _fieldC0;
@@ -37,8 +38,6 @@ private:
 	CString _string1;
 	CString _string2;
 	int _fieldE4;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CGondolierMixer();
diff --git a/engines/titanic/game/light.cpp b/engines/titanic/game/light.cpp
index c0b7df3..6b5ff51 100644
--- a/engines/titanic/game/light.cpp
+++ b/engines/titanic/game/light.cpp
@@ -57,7 +57,7 @@ void CLight::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CLight::handleMessage(CEnterRoomMsg &msg) {
+bool CLight::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CLight::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/light.h b/engines/titanic/game/light.h
index e419a3b..625e256 100644
--- a/engines/titanic/game/light.h
+++ b/engines/titanic/game/light.h
@@ -29,6 +29,7 @@
 namespace Titanic {
 
 class CLight : public CBackground {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	int _fieldE0;
 	int _fieldE4;
@@ -38,8 +39,6 @@ private:
 	int _fieldF4;
 	int _fieldF8;
 	int _fieldFC;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLight();
diff --git a/engines/titanic/game/light_switch.cpp b/engines/titanic/game/light_switch.cpp
index 0e68dda..78a0548 100644
--- a/engines/titanic/game/light_switch.cpp
+++ b/engines/titanic/game/light_switch.cpp
@@ -50,7 +50,7 @@ void CLightSwitch::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CLightSwitch::handleMessage(CEnterRoomMsg &msg) {
+bool CLightSwitch::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CLightSwitch::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/light_switch.h b/engines/titanic/game/light_switch.h
index f2132c9..80adf81 100644
--- a/engines/titanic/game/light_switch.h
+++ b/engines/titanic/game/light_switch.h
@@ -29,14 +29,13 @@
 namespace Titanic {
 
 class CLightSwitch : public CBackground {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
 	static int _v1;
 private:
 	int _fieldE0;
 	int _fieldE4;
 	int _fieldE8;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLightSwitch();
diff --git a/engines/titanic/game/long_stick_dispenser.cpp b/engines/titanic/game/long_stick_dispenser.cpp
index 9511d7b..cf11096 100644
--- a/engines/titanic/game/long_stick_dispenser.cpp
+++ b/engines/titanic/game/long_stick_dispenser.cpp
@@ -42,7 +42,7 @@ void CLongStickDispenser::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CLongStickDispenser::handleMessage(CEnterRoomMsg &msg) {
+bool CLongStickDispenser::EnterRoomMsg(CEnterRoomMsg *msg) {
 	_fieldC0 = 0;
 	_fieldC4 = 1;
 	return true;
diff --git a/engines/titanic/game/long_stick_dispenser.h b/engines/titanic/game/long_stick_dispenser.h
index 5e43bfa..bf5db20 100644
--- a/engines/titanic/game/long_stick_dispenser.h
+++ b/engines/titanic/game/long_stick_dispenser.h
@@ -29,12 +29,11 @@
 namespace Titanic {
 
 class CLongStickDispenser : public CGameObject {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	int _fieldBC;
 	int _fieldC0;
 	int _fieldC4;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLongStickDispenser() : CGameObject(), _fieldBC(0),
diff --git a/engines/titanic/game/parrot/player_meets_parrot.cpp b/engines/titanic/game/parrot/player_meets_parrot.cpp
index 16c8f48..15dd2900 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.cpp
+++ b/engines/titanic/game/parrot/player_meets_parrot.cpp
@@ -34,7 +34,7 @@ void CPlayerMeetsParrot::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CPlayerMeetsParrot::handleMessage(CEnterRoomMsg &msg) {
+bool CPlayerMeetsParrot::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CPlayerMeetsParrot::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/parrot/player_meets_parrot.h b/engines/titanic/game/parrot/player_meets_parrot.h
index bc96cb8..53fa63a 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.h
+++ b/engines/titanic/game/parrot/player_meets_parrot.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CPlayerMeetsParrot : public CGameObject {
 protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_monitor.cpp b/engines/titanic/game/pet/pet_monitor.cpp
index afe0836..ebbddd8 100644
--- a/engines/titanic/game/pet/pet_monitor.cpp
+++ b/engines/titanic/game/pet/pet_monitor.cpp
@@ -24,6 +24,10 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPETMonitor, CGameObject)
+	ON_MESSAGE(EnterRoomMsg)
+END_MESSAGE_MAP()
+
 void CPETMonitor::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
@@ -34,7 +38,7 @@ void CPETMonitor::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CPETMonitor::handleMessage(CEnterRoomMsg &msg) {
+bool CPETMonitor::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CPETMonitor::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/pet/pet_monitor.h b/engines/titanic/game/pet/pet_monitor.h
index 56116d8..a53f360 100644
--- a/engines/titanic/game/pet/pet_monitor.h
+++ b/engines/titanic/game/pet/pet_monitor.h
@@ -29,8 +29,8 @@
 namespace Titanic {
 
 class CPETMonitor : public CGameObject {
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
+	DECLARE_MESSAGE_MAP
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_position.cpp b/engines/titanic/game/pet/pet_position.cpp
index e1dab22..66e8e36 100644
--- a/engines/titanic/game/pet/pet_position.cpp
+++ b/engines/titanic/game/pet/pet_position.cpp
@@ -24,6 +24,10 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPETPosition, CGameObject)
+	ON_MESSAGE(EnterRoomMsg)
+END_MESSAGE_MAP()
+
 void CPETPosition::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
@@ -34,7 +38,7 @@ void CPETPosition::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CPETPosition::handleMessage(CEnterRoomMsg &msg) {
+bool CPETPosition::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CPETPosition::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/pet/pet_position.h b/engines/titanic/game/pet/pet_position.h
index 589f2b6..f4f0fd5 100644
--- a/engines/titanic/game/pet/pet_position.h
+++ b/engines/titanic/game/pet/pet_position.h
@@ -29,8 +29,8 @@
 namespace Titanic {
 
 class CPETPosition : public CGameObject {
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
+	DECLARE_MESSAGE_MAP
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_transport.cpp b/engines/titanic/game/pet/pet_transport.cpp
index 3668567..bcbf319 100644
--- a/engines/titanic/game/pet/pet_transport.cpp
+++ b/engines/titanic/game/pet/pet_transport.cpp
@@ -24,6 +24,10 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPETTransport, CGameObject)
+	ON_MESSAGE(EnterRoomMsg)
+END_MESSAGE_MAP()
+
 void CPETTransport::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
@@ -34,7 +38,7 @@ void CPETTransport::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CPETTransport::handleMessage(CEnterRoomMsg &msg) {
+bool CPETTransport::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CPETTransport::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/pet/pet_transport.h b/engines/titanic/game/pet/pet_transport.h
index 2c94bb6..052fd7b 100644
--- a/engines/titanic/game/pet/pet_transport.h
+++ b/engines/titanic/game/pet/pet_transport.h
@@ -29,8 +29,8 @@
 namespace Titanic {
 
 class CPETTransport : public CGameObject {
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
+	DECLARE_MESSAGE_MAP
+	virtual bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp
index 749bf33..f086376 100644
--- a/engines/titanic/game/phonograph.cpp
+++ b/engines/titanic/game/phonograph.cpp
@@ -55,7 +55,7 @@ void CPhonograph::load(SimpleFile *file) {
 	CMusicPlayer::load(file);
 }
 
-bool CPhonograph::handleMessage(CEnterRoomMsg &msg) {
+bool CPhonograph::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CPhonograph::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/phonograph.h b/engines/titanic/game/phonograph.h
index 102edd2..c5f5a90 100644
--- a/engines/titanic/game/phonograph.h
+++ b/engines/titanic/game/phonograph.h
@@ -29,6 +29,7 @@
 namespace Titanic {
 
 class CPhonograph : public CMusicPlayer {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 protected:
 	CString _string2;
 	int _fieldE0;
@@ -37,8 +38,6 @@ protected:
 	int _fieldEC;
 	int _fieldF0;
 	int _fieldF4;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CPhonograph();
diff --git a/engines/titanic/game/sgt/sgt_state_room.cpp b/engines/titanic/game/sgt/sgt_state_room.cpp
index 9baae69..1a68131 100644
--- a/engines/titanic/game/sgt/sgt_state_room.cpp
+++ b/engines/titanic/game/sgt/sgt_state_room.cpp
@@ -24,6 +24,10 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CSGTStateRoom, CBackground)
+	ON_MESSAGE(EnterRoomMsg)
+END_MESSAGE_MAP()
+
 CSGTStateRoomStatics *CSGTStateRoom::_statics;
 
 void CSGTStateRoom::init() {
@@ -90,7 +94,7 @@ void CSGTStateRoom::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CSGTStateRoom::handleMessage(CEnterRoomMsg &msg) {
+bool CSGTStateRoom::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CSGTStateRoom::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/sgt/sgt_state_room.h b/engines/titanic/game/sgt/sgt_state_room.h
index 7ae9611..7b2b5a8 100644
--- a/engines/titanic/game/sgt/sgt_state_room.h
+++ b/engines/titanic/game/sgt/sgt_state_room.h
@@ -46,6 +46,8 @@ struct CSGTStateRoomStatics {
 };
 
 class CSGTStateRoom : public CBackground {
+	DECLARE_MESSAGE_MAP
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	static CSGTStateRoomStatics *_statics;
 private:
@@ -54,8 +56,6 @@ private:
 	int _fieldE8;
 	int _fieldEC;
 	int _fieldF0;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CSGTStateRoom();
diff --git a/engines/titanic/game/ship_setting.cpp b/engines/titanic/game/ship_setting.cpp
index 1da2792..037a199 100644
--- a/engines/titanic/game/ship_setting.cpp
+++ b/engines/titanic/game/ship_setting.cpp
@@ -48,7 +48,7 @@ void CShipSetting::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CShipSetting::handleMessage(CEnterRoomMsg &msg) {
+bool CShipSetting::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CShipSetting::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/ship_setting.h b/engines/titanic/game/ship_setting.h
index 5b5ea68..9783e69 100644
--- a/engines/titanic/game/ship_setting.h
+++ b/engines/titanic/game/ship_setting.h
@@ -29,13 +29,12 @@
 namespace Titanic {
 
 class CShipSetting : public CBackground {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	CString _string3;
 	Point _pos1;
 	CString _string4;
 	CString _string5;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CShipSetting();
diff --git a/engines/titanic/game/start_action.cpp b/engines/titanic/game/start_action.cpp
index 05ceb9d..e41b7df 100644
--- a/engines/titanic/game/start_action.cpp
+++ b/engines/titanic/game/start_action.cpp
@@ -25,6 +25,11 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CStartAction, CBackground)
+	ON_MESSAGE(MouseButtonDownMsg)
+	ON_MESSAGE(MouseButtonUpMsg)
+END_MESSAGE_MAP()
+
 CStartAction::CStartAction() : CBackground() {
 }
 
@@ -44,7 +49,7 @@ void CStartAction::load(SimpleFile *file) {
 	CBackground::load(file);
 }
 
-bool CStartAction::handleMessage(CMouseButtonDownMsg &msg) {
+bool CStartAction::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	// Dispatch the desired action to the desired target
 	CActMsg actMsg(_msgAction);
 	actMsg.execute(_msgTarget);
@@ -52,7 +57,7 @@ bool CStartAction::handleMessage(CMouseButtonDownMsg &msg) {
 	return true;
 }
 
-bool CStartAction::handleMessage(CMouseButtonUpMsg &msg) {
+bool CStartAction::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
 	return true;
 }
 
diff --git a/engines/titanic/game/start_action.h b/engines/titanic/game/start_action.h
index ebdc4ab..de3c488 100644
--- a/engines/titanic/game/start_action.h
+++ b/engines/titanic/game/start_action.h
@@ -29,12 +29,12 @@
 namespace Titanic {
 
 class CStartAction : public CBackground {
+	DECLARE_MESSAGE_MAP
+	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
 protected:
 	CString _msgTarget;
 	CString _msgAction;
-protected:
-	virtual bool handleMessage(CMouseButtonDownMsg &msg);
-	virtual bool handleMessage(CMouseButtonUpMsg &msg);
 public:
 	CLASSDEF
 	CStartAction();
diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
index 54e8663..4c16a32 100644
--- a/engines/titanic/game/television.h
+++ b/engines/titanic/game/television.h
@@ -31,6 +31,19 @@ namespace Titanic {
 
 class CTelevision : public CBackground {
 	DECLARE_MESSAGE_MAP
+	bool LeaveViewMsg(CLeaveViewMsg *msg);
+	bool ChangeSeasonMsg(CChangeSeasonMsg *msg);
+	bool EnterViewMsg(CEnterViewMsg *msg);
+	bool PETUpMsg(CPETUpMsg *msg);
+	bool PETDownMsg(CPETDownMsg *msg);
+	bool StatusChangeMsg(CStatusChangeMsg *msg);
+	bool ActMsg(CActMsg *msg);
+	bool PETActivateMsg(CPETActivateMsg *msg);
+	bool MovieEndMsg(CMovieEndMsg *msg);
+	bool ShipSettingMsg(CShipSettingMsg *msg);
+	bool TurnOff(CTurnOff *msg);
+	bool TurnOn(CTurnOn *msg);
+	bool LightsMsg(CLightsMsg *msg);
 private:
 	static int _v1;
 	static bool _turnOn;
@@ -44,20 +57,6 @@ private:
 	bool _isOn;
 	int _fieldEC;
 	int _fieldF0;
-protected:
-	virtual bool LeaveViewMsg(CLeaveViewMsg *msg);
-	virtual bool ChangeSeasonMsg(CChangeSeasonMsg *msg);
-	virtual bool EnterViewMsg(CEnterViewMsg *msg);
-	virtual bool PETUpMsg(CPETUpMsg *msg);
-	virtual bool PETDownMsg(CPETDownMsg *msg);
-	virtual bool StatusChangeMsg(CStatusChangeMsg *msg);
-	virtual bool ActMsg(CActMsg *msg);
-	virtual bool PETActivateMsg(CPETActivateMsg *msg);
-	virtual bool MovieEndMsg(CMovieEndMsg *msg);
-	virtual bool ShipSettingMsg(CShipSettingMsg *msg);
-	virtual bool TurnOff(CTurnOff *msg);
-	virtual bool TurnOn(CTurnOn *msg);
-	virtual bool LightsMsg(CLightsMsg *msg);
 public:
 	CLASSDEF
 	CTelevision();
diff --git a/engines/titanic/game/transport/lift.cpp b/engines/titanic/game/transport/lift.cpp
index a795a15..e978762 100644
--- a/engines/titanic/game/transport/lift.cpp
+++ b/engines/titanic/game/transport/lift.cpp
@@ -24,6 +24,10 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CLift, CTransport)
+	ON_MESSAGE(EnterRoomMsg)
+END_MESSAGE_MAP()
+
 int CLift::_v1;
 int CLift::_v2;
 int CLift::_v3;
@@ -57,7 +61,7 @@ void CLift::load(SimpleFile *file) {
 	CTransport::load(file);
 }
 
-bool CLift::handleMessage(CEnterRoomMsg &msg) {
+bool CLift::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CLift::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h
index dc324e1..161061c 100644
--- a/engines/titanic/game/transport/lift.h
+++ b/engines/titanic/game/transport/lift.h
@@ -29,6 +29,8 @@
 namespace Titanic {
 
 class CLift : public CTransport {
+	DECLARE_MESSAGE_MAP
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	static int _v1;
 	static int _v2;
@@ -38,8 +40,6 @@ private:
 	static int _v6;
 
 	int _fieldF8;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLift() : CTransport(), _fieldF8(1) {}
diff --git a/engines/titanic/game/transport/lift_indicator.cpp b/engines/titanic/game/transport/lift_indicator.cpp
index ebeaf55..eb7f6bf 100644
--- a/engines/titanic/game/transport/lift_indicator.cpp
+++ b/engines/titanic/game/transport/lift_indicator.cpp
@@ -24,6 +24,10 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CLiftindicator, CLift)
+	ON_MESSAGE(EnterRoomMsg)
+END_MESSAGE_MAP()
+
 CLiftindicator::CLiftindicator() : CLift(),
 		_fieldFC(0), _field108(0), _field10C(0) {
 }
diff --git a/engines/titanic/game/transport/lift_indicator.h b/engines/titanic/game/transport/lift_indicator.h
index 7cc5585..c73d1f4 100644
--- a/engines/titanic/game/transport/lift_indicator.h
+++ b/engines/titanic/game/transport/lift_indicator.h
@@ -29,13 +29,13 @@
 namespace Titanic {
 
 class CLiftindicator : public CLift {
+	DECLARE_MESSAGE_MAP
+	bool EnterRoomMsg(CEnterRoomMsg *msg) { return true; }
 private:
 	int _fieldFC;
 	Point _pos2;
 	int _field108;
 	int _field10C;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg) { return true; }
 public:
 	CLASSDEF
 	CLiftindicator();
diff --git a/engines/titanic/game/transport/pellerator.cpp b/engines/titanic/game/transport/pellerator.cpp
index eca1037..ed82aa9 100644
--- a/engines/titanic/game/transport/pellerator.cpp
+++ b/engines/titanic/game/transport/pellerator.cpp
@@ -24,6 +24,10 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPellerator, CTransport)
+	ON_MESSAGE(EnterRoomMsg)
+END_MESSAGE_MAP()
+
 int CPellerator::_v1;
 int CPellerator::_v2;
 
@@ -43,7 +47,7 @@ void CPellerator::load(SimpleFile *file) {
 	CTransport::load(file);
 }
 
-bool CPellerator::handleMessage(CEnterRoomMsg &msg) {
+bool CPellerator::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CPellerator::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/transport/pellerator.h b/engines/titanic/game/transport/pellerator.h
index 82809a0..0539b5c 100644
--- a/engines/titanic/game/transport/pellerator.h
+++ b/engines/titanic/game/transport/pellerator.h
@@ -29,11 +29,11 @@
 namespace Titanic {
 
 class CPellerator : public CTransport {
+	DECLARE_MESSAGE_MAP
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	static int _v1;
 	static int _v2;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/up_lighter.cpp b/engines/titanic/game/up_lighter.cpp
index 819dc94..50cd1d4 100644
--- a/engines/titanic/game/up_lighter.cpp
+++ b/engines/titanic/game/up_lighter.cpp
@@ -48,7 +48,7 @@ void CUpLighter::load(SimpleFile *file) {
 	CDropTarget::load(file);
 }
 
-bool CUpLighter::handleMessage(CEnterRoomMsg &msg) {
+bool CUpLighter::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CUpLighter::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/up_lighter.h b/engines/titanic/game/up_lighter.h
index 27b1d7b..a3f8b2a 100644
--- a/engines/titanic/game/up_lighter.h
+++ b/engines/titanic/game/up_lighter.h
@@ -29,13 +29,12 @@
 namespace Titanic {
 
 class CUpLighter : public CDropTarget {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	int _field118;
 	int _field11C;
 	int _field120;
 	int _field124;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CUpLighter();
diff --git a/engines/titanic/game/volume_control.cpp b/engines/titanic/game/volume_control.cpp
index bb58dee..e9b66c7 100644
--- a/engines/titanic/game/volume_control.cpp
+++ b/engines/titanic/game/volume_control.cpp
@@ -45,7 +45,7 @@ void CVolumeControl::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CVolumeControl::handleMessage(CEnterNodeMsg &msg) {
+bool CVolumeControl::EnterNodeMsg(CEnterNodeMsg *msg) {
 	warning("CVolumeControl::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/game/volume_control.h b/engines/titanic/game/volume_control.h
index ae10d97..cef5ac4 100644
--- a/engines/titanic/game/volume_control.h
+++ b/engines/titanic/game/volume_control.h
@@ -29,12 +29,11 @@
 namespace Titanic {
 
 class CVolumeControl : public CGameObject {
+	bool EnterNodeMsg(CEnterNodeMsg *msg);
 private:
 	int _fieldBC;
 	CString _string1;
 	int _fieldCC;
-protected:
-	virtual bool handleMessage(CEnterNodeMsg &msg);
 public:
 	CLASSDEF
 	CVolumeControl();
diff --git a/engines/titanic/gfx/st_button.h b/engines/titanic/gfx/st_button.h
index fd2b0fa..d3dd5c4 100644
--- a/engines/titanic/gfx/st_button.h
+++ b/engines/titanic/gfx/st_button.h
@@ -31,6 +31,9 @@ namespace Titanic {
 
 class CSTButton : public CBackground {
 	DECLARE_MESSAGE_MAP
+	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+	bool EnterViewMsg(CEnterViewMsg *msg);
 private:
 	int _statusInc;
 	CString _statusTarget;
@@ -39,10 +42,6 @@ private:
 	CString _string4;
 	CString _string5;
 	int _buttonFrame;
-protected:
-	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
-	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
-	virtual bool EnterViewMsg(CEnterViewMsg *msg);
 public:
 	CLASSDEF
 	CSTButton();
diff --git a/engines/titanic/messages/bilge_dispensor_event.cpp b/engines/titanic/messages/bilge_dispensor_event.cpp
index e17494c..f0daa7a 100644
--- a/engines/titanic/messages/bilge_dispensor_event.cpp
+++ b/engines/titanic/messages/bilge_dispensor_event.cpp
@@ -34,7 +34,7 @@ void CBilgeDispensorEvent::load(SimpleFile *file) {
 	CAutoSoundEvent::load(file);
 }
 
-bool CBilgeDispensorEvent::handleMessage(CEnterRoomMsg &msg) {
+bool CBilgeDispensorEvent::EnterRoomMsg(CEnterRoomMsg *msg) {
 	_value1 = 0;
 	return true;
 }
diff --git a/engines/titanic/messages/bilge_dispensor_event.h b/engines/titanic/messages/bilge_dispensor_event.h
index de8705f..df6e112 100644
--- a/engines/titanic/messages/bilge_dispensor_event.h
+++ b/engines/titanic/messages/bilge_dispensor_event.h
@@ -29,8 +29,7 @@
 namespace Titanic {
 
 class CBilgeDispensorEvent : public CAutoSoundEvent {
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/moves/enter_bridge.cpp b/engines/titanic/moves/enter_bridge.cpp
index 8916fa9..f526934 100644
--- a/engines/titanic/moves/enter_bridge.cpp
+++ b/engines/titanic/moves/enter_bridge.cpp
@@ -36,7 +36,7 @@ void CEnterBridge::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CEnterBridge::handleMessage(CEnterRoomMsg &msg) {
+bool CEnterBridge::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CEnterBridge::handlEvent");
 	return true;
 }
diff --git a/engines/titanic/moves/enter_bridge.h b/engines/titanic/moves/enter_bridge.h
index 0920443..fee299a 100644
--- a/engines/titanic/moves/enter_bridge.h
+++ b/engines/titanic/moves/enter_bridge.h
@@ -29,10 +29,9 @@
 namespace Titanic {
 
 class CEnterBridge : public CGameObject {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	int _value;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CEnterBridge() : CGameObject(), _value(1) {}
diff --git a/engines/titanic/npcs/barbot.cpp b/engines/titanic/npcs/barbot.cpp
index e487dc1..8abf41d 100644
--- a/engines/titanic/npcs/barbot.cpp
+++ b/engines/titanic/npcs/barbot.cpp
@@ -233,7 +233,7 @@ void CBarbot::load(SimpleFile *file) {
 	CTrueTalkNPC::load(file);
 }
 
-bool CBarbot::handleMessage(CEnterRoomMsg &msg) {
+bool CBarbot::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("TODO: Barbot::CEnterRoomMsg");
 	return true;
 }
diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h
index 158db10..fa06f8f 100644
--- a/engines/titanic/npcs/barbot.h
+++ b/engines/titanic/npcs/barbot.h
@@ -29,6 +29,7 @@
 namespace Titanic {
 
 class CBarbot : public CTrueTalkNPC {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	static int _v0;
 private:
@@ -173,8 +174,6 @@ private:
 	int _field338;
 	int _field33C;
 	int _field340;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CBarbot();
diff --git a/engines/titanic/npcs/liftbot.cpp b/engines/titanic/npcs/liftbot.cpp
index a412d43..0125406 100644
--- a/engines/titanic/npcs/liftbot.cpp
+++ b/engines/titanic/npcs/liftbot.cpp
@@ -48,7 +48,7 @@ void CLiftBot::load(SimpleFile *file) {
 	CTrueTalkNPC::load(file);
 }
 
-bool CLiftBot::handleMessage(CEnterRoomMsg &msg) {
+bool CLiftBot::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CLiftBot::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/npcs/liftbot.h b/engines/titanic/npcs/liftbot.h
index a984ea8..d0db94e 100644
--- a/engines/titanic/npcs/liftbot.h
+++ b/engines/titanic/npcs/liftbot.h
@@ -29,13 +29,12 @@
 namespace Titanic {
 
 class CLiftBot : public CTrueTalkNPC {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	static int _v1;
 	static int _v2;
 private:
 	int _field108;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CLiftBot();
diff --git a/engines/titanic/sound/auto_music_player.cpp b/engines/titanic/sound/auto_music_player.cpp
index 5981a70..309c57b 100644
--- a/engines/titanic/sound/auto_music_player.cpp
+++ b/engines/titanic/sound/auto_music_player.cpp
@@ -41,7 +41,7 @@ void CAutoMusicPlayer::load(SimpleFile *file) {
 	CAutoMusicPlayerBase::load(file);
 }
 
-bool CAutoMusicPlayer::handleMessage(CEnterRoomMsg &msg) {
+bool CAutoMusicPlayer::EnterRoomMsg(CEnterRoomMsg *msg) {
 	if (!_fieldCC) {
 		warning("TODO");
 	}
diff --git a/engines/titanic/sound/auto_music_player.h b/engines/titanic/sound/auto_music_player.h
index 0848439..063778c 100644
--- a/engines/titanic/sound/auto_music_player.h
+++ b/engines/titanic/sound/auto_music_player.h
@@ -29,10 +29,9 @@
 namespace Titanic {
 
 class CAutoMusicPlayer : public CAutoMusicPlayerBase {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	CString _string2;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CAutoMusicPlayer();
diff --git a/engines/titanic/sound/music_player.cpp b/engines/titanic/sound/music_player.cpp
index eaad635..193527b 100644
--- a/engines/titanic/sound/music_player.cpp
+++ b/engines/titanic/sound/music_player.cpp
@@ -44,7 +44,7 @@ void CMusicPlayer::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CMusicPlayer::handleMessage(CEnterRoomMsg &msg) {
+bool CMusicPlayer::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("TODO: CMusicPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/music_player.h b/engines/titanic/sound/music_player.h
index 614fa37..1b928fa 100644
--- a/engines/titanic/sound/music_player.h
+++ b/engines/titanic/sound/music_player.h
@@ -29,13 +29,12 @@
 namespace Titanic {
 
 class CMusicPlayer : public CGameObject {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 protected:
 	int _fieldBC;
 	CString _string1;
 	int _fieldCC;
 	int _fieldD0;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CMusicPlayer() : CGameObject(),
diff --git a/engines/titanic/sound/node_auto_sound_player.cpp b/engines/titanic/sound/node_auto_sound_player.cpp
index 5af8ca2..ee403ba 100644
--- a/engines/titanic/sound/node_auto_sound_player.cpp
+++ b/engines/titanic/sound/node_auto_sound_player.cpp
@@ -36,7 +36,7 @@ void CNodeAutoSoundPlayer::load(SimpleFile *file) {
 	CAutoSoundPlayer::load(file);
 }
 
-bool CNodeAutoSoundPlayer::handleMessage(CEnterNodeMsg &msg) {
+bool CNodeAutoSoundPlayer::EnterNodeMsg(CEnterNodeMsg *msg) {
 	warning("CNodeAutoSoundPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/node_auto_sound_player.h b/engines/titanic/sound/node_auto_sound_player.h
index 451b946..2f961dd 100644
--- a/engines/titanic/sound/node_auto_sound_player.h
+++ b/engines/titanic/sound/node_auto_sound_player.h
@@ -29,10 +29,9 @@
 namespace Titanic {
 
 class CNodeAutoSoundPlayer : public CAutoSoundPlayer {
+	bool EnterNodeMsg(CEnterNodeMsg *msg);
 private:
 	int _fieldEC;
-protected:
-	virtual bool handleMessage(CEnterNodeMsg &msg);
 public:
 	CLASSDEF
 	CNodeAutoSoundPlayer() : CAutoSoundPlayer(), _fieldEC(1) {}
diff --git a/engines/titanic/sound/restricted_auto_music_player.cpp b/engines/titanic/sound/restricted_auto_music_player.cpp
index 7b5ba70..cd1b193 100644
--- a/engines/titanic/sound/restricted_auto_music_player.cpp
+++ b/engines/titanic/sound/restricted_auto_music_player.cpp
@@ -44,7 +44,7 @@ void CRestrictedAutoMusicPlayer::load(SimpleFile *file) {
 	CAutoMusicPlayer::load(file);
 }
 
-bool CRestrictedAutoMusicPlayer::handleMessage(CEnterRoomMsg &msg) {
+bool CRestrictedAutoMusicPlayer::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CRestrictedAutoMusicPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/restricted_auto_music_player.h b/engines/titanic/sound/restricted_auto_music_player.h
index 3553d1c..b288296 100644
--- a/engines/titanic/sound/restricted_auto_music_player.h
+++ b/engines/titanic/sound/restricted_auto_music_player.h
@@ -29,13 +29,12 @@
 namespace Titanic {
 
 class CRestrictedAutoMusicPlayer : public CAutoMusicPlayer {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	CString _string3;
 	CString _string4;
 	CString _string5;
 	CString _string6;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/sound/room_auto_sound_player.cpp b/engines/titanic/sound/room_auto_sound_player.cpp
index c24ef2a..4393d41 100644
--- a/engines/titanic/sound/room_auto_sound_player.cpp
+++ b/engines/titanic/sound/room_auto_sound_player.cpp
@@ -34,7 +34,7 @@ void CRoomAutoSoundPlayer::load(SimpleFile *file) {
 	CAutoSoundPlayer::load(file);
 }
 
-bool CRoomAutoSoundPlayer::handleMessage(CEnterRoomMsg &msg) {
+bool CRoomAutoSoundPlayer::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CRoomAutoSoundPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/room_auto_sound_player.h b/engines/titanic/sound/room_auto_sound_player.h
index 70d3dfe..c17d983 100644
--- a/engines/titanic/sound/room_auto_sound_player.h
+++ b/engines/titanic/sound/room_auto_sound_player.h
@@ -29,8 +29,7 @@
 namespace Titanic {
 
 class CRoomAutoSoundPlayer : public CAutoSoundPlayer {
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/sound/room_trigger_auto_music_player.cpp b/engines/titanic/sound/room_trigger_auto_music_player.cpp
index 5ec35c3..8c20097 100644
--- a/engines/titanic/sound/room_trigger_auto_music_player.cpp
+++ b/engines/titanic/sound/room_trigger_auto_music_player.cpp
@@ -34,7 +34,7 @@ void CRoomTriggerAutoMusicPlayer::load(SimpleFile *file) {
 	CTriggerAutoMusicPlayer::load(file);
 }
 
-bool CRoomTriggerAutoMusicPlayer::handleMessage(CEnterRoomMsg &msg) {
+bool CRoomTriggerAutoMusicPlayer::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CRoomTriggerAutoMusicPlayer::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/room_trigger_auto_music_player.h b/engines/titanic/sound/room_trigger_auto_music_player.h
index c3e4d0f..26823ce 100644
--- a/engines/titanic/sound/room_trigger_auto_music_player.h
+++ b/engines/titanic/sound/room_trigger_auto_music_player.h
@@ -29,8 +29,7 @@
 namespace Titanic {
 
 class CRoomTriggerAutoMusicPlayer : public CTriggerAutoMusicPlayer {
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/sound/titania_speech.cpp b/engines/titanic/sound/titania_speech.cpp
index c530a9a..8c60626 100644
--- a/engines/titanic/sound/titania_speech.cpp
+++ b/engines/titanic/sound/titania_speech.cpp
@@ -40,7 +40,7 @@ void CTitaniaSpeech::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
-bool CTitaniaSpeech::handleMessage(CEnterRoomMsg &msg) {
+bool CTitaniaSpeech::EnterRoomMsg(CEnterRoomMsg *msg) {
 	warning("CTitaniaSpeech::handleEvent");
 	return true;
 }
diff --git a/engines/titanic/sound/titania_speech.h b/engines/titanic/sound/titania_speech.h
index b894eee..78c4098 100644
--- a/engines/titanic/sound/titania_speech.h
+++ b/engines/titanic/sound/titania_speech.h
@@ -29,10 +29,9 @@
 namespace Titanic {
 
 class CTitaniaSpeech : public CGameObject {
+	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	int _value1, _value2;
-protected:
-	virtual bool handleMessage(CEnterRoomMsg &msg);
 public:
 	CLASSDEF
 	CTitaniaSpeech() : CGameObject(), _value1(1), _value2(0) {}


Commit: e7f2cb1ecbf2637db8dd7be3fe97d485a7c56bc8
    https://github.com/scummvm/scummvm/commit/e7f2cb1ecbf2637db8dd7be3fe97d485a7c56bc8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-07T23:39:26-04:00

Commit Message:
TITANIC: Add CComputer messages, more view change logic

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/link_item.cpp
    engines/titanic/core/link_item.h
    engines/titanic/core/tree_item.h
    engines/titanic/core/view_item.cpp
    engines/titanic/core/view_item.h
    engines/titanic/game/computer.cpp
    engines/titanic/game/computer.h
    engines/titanic/support/screen_manager.cpp



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 0570008..02a64dc 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -424,4 +424,77 @@ void CGameObject::soundProximity(const CString &name, CProximity &prox) {
 	}
 }
 
+void CGameObject::gotoView(const CString &viewName, const CString &clipName) {
+	CViewItem *newView = parseView(viewName);
+	CGameManager *gameManager = getGameManager();
+	CViewItem *oldView = gameManager ? gameManager->getView() : newView;
+	if (!oldView || !newView)
+		return;
+
+	CMovieClip *clip = nullptr;
+	if (clipName.empty()) {
+		CLinkItem *link = oldView->findLink(newView);
+		if (link)
+			clip = link->getClip();
+	} else {
+		clip = oldView->findNode()->findRoom()->findClip(clipName);
+	}
+
+	// Change the view
+	gameManager->_gameState.changeView(newView, clip);
+}
+
+CViewItem *CGameObject::parseView(const CString &viewString) {
+	int firstIndex = viewString.indexOf('.');
+	int lastIndex = viewString.lastIndexOf('.');
+	CString roomName, nodeName, viewName;
+
+	if (firstIndex == -1) {
+		roomName = viewString;
+	} else {
+		roomName = viewString.left(firstIndex);
+
+		if (lastIndex > firstIndex) {
+			nodeName = viewString.mid(firstIndex + 1, lastIndex - firstIndex - 1);
+			viewName = viewString.mid(lastIndex + 1);
+		} else {
+			nodeName = viewString.mid(firstIndex + 1);
+		}
+	}
+
+	CGameManager *gameManager = getGameManager();
+	if (!gameManager)
+		return nullptr;
+
+	CRoomItem *room = gameManager->getRoom();
+	CProjectItem *project = room->getRoot();
+	
+	// Ensure we have the specified room
+	if (project) {
+		if (room->getName() != roomName) {
+			// Scan for the correct room
+			for (room = project->findFirstRoom(); room && room->getName() != roomName;
+					room = project->findNextRoom(room)) ;
+		}			
+	}
+	if (!room)
+		return nullptr;
+
+	// Find the designated node within the room
+	CNodeItem *node = static_cast<CNodeItem *>(room->findChildInstanceOf(CNodeItem::_type));
+	while (node && node->getName() != nodeName)
+		node = static_cast<CNodeItem *>(room->findNextInstanceOf(CNodeItem::_type, node));
+	if (!node)
+		return nullptr;
+
+	CViewItem *view = static_cast<CViewItem *>(node->findChildInstanceOf(CViewItem::_type));
+	while (view && view->getName() != viewName)
+		view = static_cast<CViewItem *>(node->findNextInstanceOf(CViewItem::_type, view));
+	if (!view)
+		return nullptr;
+
+	// Find the view, so return it
+	return view;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 7219242..2fc047e 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -112,6 +112,17 @@ protected:
 	 */
 	void setPetArea(PetArea newArea) const;
 
+	/**
+	 * Goto a new view
+	 */
+	void gotoView(const CString &viewName, const CString &clipName);
+
+	/**
+	 * Parses a view into it's components of room, node, and view,
+	 * and locates the designated view
+	 */
+	CViewItem * parseView(const CString &viewString);
+
 	bool soundFn1(int val);
 	void soundFn2(int val, int val2);
 	void setVisible(bool val);
diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp
index 285838b..b172b9b 100644
--- a/engines/titanic/core/link_item.cpp
+++ b/engines/titanic/core/link_item.cpp
@@ -108,6 +108,15 @@ void CLinkItem::load(SimpleFile *file) {
 	}
 }
 
+bool CLinkItem::connectsTo(CViewItem *destView) const {
+	CNodeItem *destNode = destView->findNode();
+	CRoomItem *destRoom = destNode->findRoom();
+
+	return _viewNumber == destView->_viewNumber &&
+		_nodeNumber == destNode->_nodeNumber &&
+		_roomNumber == destRoom->_roomNumber;
+}
+
 void CLinkItem::setDestination(int roomNumber, int nodeNumber,
 		int viewNumber, int v) {
 	_roomNumber = roomNumber;
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index 7282972..25de741 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -63,6 +63,11 @@ public:
 	virtual void load(SimpleFile *file);
 
 	/**
+	 * Returns true if the given item connects to another specified view
+	 */
+	virtual bool connectsTo(CViewItem *destView) const;
+
+	/**
 	 * Set the destination for the link item
 	 */
 	virtual void setDestination(int roomNumber, int nodeNumber,
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index d34f963..4de030f 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -35,6 +35,7 @@ class CPetControl;
 class CProjectItem;
 class CScreenManager;
 class CRoomItem;
+class CViewItem;
 
 class CTreeItem: public CMessageTarget {
 	friend class CMessage;
@@ -126,6 +127,11 @@ public:
 	virtual int compareTo(const CString &name, int maxLen) const { return false; }
 
 	/**
+	 * Returns true if the given item connects to another specified view
+	 */
+	virtual bool connectsTo(CViewItem *destView) const { return false; }
+
+	/**
 	 * Allows the item to draw itself
 	 */
 	virtual void draw(CScreenManager *screenManager) {}
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 3f6d5d5..b829ae5 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -168,6 +168,17 @@ void CViewItem::enterView(CViewItem *newView) {
 	}
 }
 
+CLinkItem *CViewItem::findLink(CViewItem *newView) {
+	for (CTreeItem *treeItem = getFirstChild(); treeItem;
+			treeItem = scan(treeItem)) {
+		CLinkItem *link = static_cast<CLinkItem *>(treeItem);
+		if (link && link->connectsTo(newView))
+			return link;
+	}
+
+	return nullptr;
+}
+
 bool CViewItem::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	if (msg->_buttons & MB_LEFT) {
 		if (!handleMouseMsg(msg, true)) {
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index 5abcf1d..67b2113 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_VIEW_ITEM_H
 #define TITANIC_VIEW_ITEM_H
 
+#include "titanic/core/link_item.h"
 #include "titanic/core/named_item.h"
 #include "titanic/core/resource_key.h"
 #include "titanic/messages/mouse_messages.h"
@@ -90,6 +91,11 @@ public:
 	 * Called when a new view is being entered
 	 */
 	void enterView(CViewItem *newView);
+
+	/**
+	 * Finds a link which connects to another designated view
+	 */
+	CLinkItem *findLink(CViewItem *newView);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/computer.cpp b/engines/titanic/game/computer.cpp
index a282921..2b0f776 100644
--- a/engines/titanic/game/computer.cpp
+++ b/engines/titanic/game/computer.cpp
@@ -24,18 +24,83 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CComputer, CBackground)
+	ON_MESSAGE(ActMsg)
+	ON_MESSAGE(MouseButtonDownMsg)
+	ON_MESSAGE(MovieEndMsg)
+END_MESSAGE_MAP()
+
 void CComputer::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string3, indent);
-	file->writeNumberLine(_fieldEC, indent);
+	file->writeQuotedLine(_currentCD, indent);
+	file->writeNumberLine(_state, indent);
 	CBackground::save(file, indent);
 }
 
 void CComputer::load(SimpleFile *file) {
 	file->readNumber();
-	_string3 = file->readString();
-	_fieldEC = file->readNumber();
+	_currentCD = file->readString();
+	_state = file->readNumber();
 	CBackground::load(file);
 }
 
+bool CComputer::ActMsg(CActMsg *msg) {
+	if (_state) {
+		soundProximity("a#35.wav", 100, 0, 0);
+		fn1(32, 42, 0);
+
+		if (msg->_action == "CD1")
+			fn1(43, 49, 0);
+		else if (msg->_action == "CD2")
+			fn1(50, 79, 0);
+		else if (msg->_action == "STCD")
+			fn1(80, 90, 4);
+
+		_currentCD = msg->_action;
+		_state = 0;
+	}
+
+	return true;
+}
+
+bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	if (_currentCD == "None") {
+		if (_state) {
+			soundProximity("a#35.wav", 100, 0, 0);
+			fn1(11, 21, 0);
+			_state = 0;
+		} else {
+			soundProximity("a#34.wav", 100, 0, 0);
+			fn1(0, 10, 0);
+			_state = 1;
+		}
+	} else {
+		if (_state) {
+			loadFrame(11);
+			CActMsg actMsg("EjectCD");
+			actMsg.execute(_currentCD);
+			_currentCD = "None";
+		} else {
+			soundProximity("a#34.wav", 100, 0, 0);
+			fn1(21, 31, 0);
+			_state = 1;
+		}
+	}
+
+	return true;
+}
+
+bool CComputer::MovieEndMsg(CMovieEndMsg *msg) {
+	if (msg->_value2 == 90) {
+		soundProximity("a#32.wav", 100, 0, 0);
+		soundProximity("a#33.wav", 100, 0, 0);
+		soundProximity("a#31.wav", 100, 0, 0);
+		soundProximity("a#0.wav", 100, 0, 0);
+
+		gotoView("Home.Node 4.E", "_TRACK,3,e-cu,4,E");
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/computer.h b/engines/titanic/game/computer.h
index 793fecc..3db0ee1 100644
--- a/engines/titanic/game/computer.h
+++ b/engines/titanic/game/computer.h
@@ -28,12 +28,16 @@
 namespace Titanic {
 
 class CComputer : public CBackground {
+	DECLARE_MESSAGE_MAP
+	bool ActMsg(CActMsg *msg);
+	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	bool MovieEndMsg(CMovieEndMsg *msg);
 public:
-	CString _string3;
-	int _fieldEC;
+	CString _currentCD;
+	int _state;
 public:
 	CLASSDEF
-	CComputer() : CBackground(), _string3("None"), _fieldEC(0) {}
+	CComputer() : CBackground(), _currentCD("None"), _state(0) {}
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp
index 05dfa66..d2f2468 100644
--- a/engines/titanic/support/screen_manager.cpp
+++ b/engines/titanic/support/screen_manager.cpp
@@ -110,7 +110,7 @@ void OSScreenManager::setMode(int width, int height, int bpp, uint numBackSurfac
 }
 
 void OSScreenManager::drawCursors() {
-	warning("OSScreenManager::drawCursors");
+	// Nothing needed here, since ScummVM handles cursor drawing
 }
 
 DirectDrawSurface *OSScreenManager::getDDSurface(SurfaceNum surfaceNum) {


Commit: b27d57c25bdbb4c4f69eaefc6ce7c79f03526abe
    https://github.com/scummvm/scummvm/commit/b27d57c25bdbb4c4f69eaefc6ce7c79f03526abe
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-08T18:42:18-04:00

Commit Message:
TITANIC: Implemented CCDROMComputer

Changed paths:
    engines/titanic/game/cdrom_computer.cpp
    engines/titanic/game/cdrom_computer.h



diff --git a/engines/titanic/game/cdrom_computer.cpp b/engines/titanic/game/cdrom_computer.cpp
index e67e4fb..a25706a 100644
--- a/engines/titanic/game/cdrom_computer.cpp
+++ b/engines/titanic/game/cdrom_computer.cpp
@@ -21,31 +21,58 @@
  */
 
 #include "titanic/game/cdrom_computer.h"
+#include "titanic/core/room_item.h"
 
 namespace Titanic {
 
-CCDROMComputer::CCDROMComputer() : CGameObject(),
-		_fieldBC(0), _fieldC0(3), _fieldC4(55), _fieldC8(32) {
+BEGIN_MESSAGE_MAP(CCDROMComputer, CGameObject)
+	ON_MESSAGE(MouseButtonDownMsg)
+END_MESSAGE_MAP()
+
+CCDROMComputer::CCDROMComputer() : CGameObject(), 
+		_clickRect(0, 3, 55, 32) {
 }
 
 void CCDROMComputer::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldBC, indent);
-	file->writeNumberLine(_fieldC0, indent);
-	file->writeNumberLine(_fieldC4, indent);
-	file->writeNumberLine(_fieldC8, indent);
+	file->writeNumberLine(_clickRect.left, indent);
+	file->writeNumberLine(_clickRect.top, indent);
+	file->writeNumberLine(_clickRect.right, indent);
+	file->writeNumberLine(_clickRect.bottom, indent);
 
 	CGameObject::save(file, indent);
 }
 
 void CCDROMComputer::load(SimpleFile *file) {
 	file->readNumber();
-	_fieldBC = file->readNumber();
-	_fieldC0 = file->readNumber();
-	_fieldC4 = file->readNumber();
-	_fieldC8 = file->readNumber();
+	_clickRect.left = file->readNumber();
+	_clickRect.top = file->readNumber();
+	_clickRect.right = file->readNumber();
+	_clickRect.bottom = file->readNumber();
 
 	CGameObject::load(file);
 }
 
+bool CCDROMComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	CTreeItem *tray = getRoom()->findByName("newTray");
+	if (tray) {
+		CStatusChangeMsg statusMsg;
+		statusMsg.execute(tray);
+		
+		if (!statusMsg._success) {
+			// Check if the mouse is within the clickable area
+			Rect tempRect = _clickRect;
+			tempRect.translate(_bounds.left, _bounds.top);
+
+			if (!tempRect.contains(msg->_mousePos))
+				return true;
+		}
+
+		CActMsg actMsg("ClickedOn");
+		actMsg.execute(tray);
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/cdrom_computer.h b/engines/titanic/game/cdrom_computer.h
index de070b0..4ea2f4d 100644
--- a/engines/titanic/game/cdrom_computer.h
+++ b/engines/titanic/game/cdrom_computer.h
@@ -24,15 +24,15 @@
 #define TITANIC_CDROM_COMPUTER_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/mouse_messages.h"
 
 namespace Titanic {
 
 class CCDROMComputer : public CGameObject {
+	DECLARE_MESSAGE_MAP
+	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 private:
-	int _fieldBC;
-	int _fieldC0;
-	int _fieldC4;
-	int _fieldC8;
+	Rect _clickRect;
 public:
 	CLASSDEF
 	CCDROMComputer();


Commit: c5b73db7b9704a18c9c250f01c2eec8104b3713e
    https://github.com/scummvm/scummvm/commit/c5b73db7b9704a18c9c250f01c2eec8104b3713e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-08T18:49:57-04:00

Commit Message:
TITANIC: Implement onIdle method for regular game updates

Changed paths:
    engines/titanic/events.cpp
    engines/titanic/events.h



diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index 038bc8b..d6f12f5 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -86,6 +86,9 @@ bool Events::checkForNextFrameCounter() {
 		++_frameCounter;
 		_priorFrameTime = milli;
 
+		// Handle any idle updates
+		onIdle();
+
 		// Give time to the debugger
 		_vm->_debugger->onFrame();
 
@@ -102,6 +105,22 @@ uint32 Events::getTicksCount() const {
 	return g_system->getMillis();
 }
 
+void Events::onIdle() {
+	if (!_vm->_window->_inputAllowed)
+		return;
+	CGameManager *gameManager = _vm->_window->_gameManager;
+	if (!gameManager)
+		return;
+
+	// Let the game manager perform any game updates
+	gameManager->update();
+
+	if (gameManager->_gameState._field20) {
+		// Game needs to shut down
+		_vm->quitGame();
+	}
+}
+
 #define HANDLE_MESSAGE(METHOD) 	if (_vm->_window->_inputAllowed) { \
 	_vm->_window->_gameManager->_inputTranslator.METHOD(_specialButtons, Point(_mousePos.x, _mousePos.y)); \
 	_vm->_window->mouseChanged(); \
diff --git a/engines/titanic/events.h b/engines/titanic/events.h
index fe2c751..f85a3d9 100644
--- a/engines/titanic/events.h
+++ b/engines/titanic/events.h
@@ -55,6 +55,11 @@ private:
 	 */
 	bool checkForNextFrameCounter();
 
+	/**
+	 * Called to handle any regular updates the game requires
+	 */
+	void onIdle();
+
 	void mouseMove();
 	void leftButtonDown();
 	void leftButtonUp();


Commit: 63e2a01ecf2d5d5c56f657a87c48c761a88c5eb7
    https://github.com/scummvm/scummvm/commit/63e2a01ecf2d5d5c56f657a87c48c761a88c5eb7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-08T18:53:05-04:00

Commit Message:
TITANIC: Rename field in CGameState

Changed paths:
    engines/titanic/events.cpp
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h



diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index d6f12f5..480cc91 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -115,7 +115,7 @@ void Events::onIdle() {
 	// Let the game manager perform any game updates
 	gameManager->update();
 
-	if (gameManager->_gameState._field20) {
+	if (gameManager->_gameState._quitGame) {
 		// Game needs to shut down
 		_vm->quitGame();
 	}
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 280c917..92a0e3d 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -46,7 +46,7 @@ bool CGameStateMovieList::clear() {
 CGameState::CGameState(CGameManager *gameManager) :
 		_gameManager(gameManager), _gameLocation(this),
 		_field8(0), _fieldC(0), _mode(GSMODE_UNSELECTED), _field14(0), _petActive(false),
-		_field1C(0), _field20(0), _field24(0), _nodeChangeCtr(0),
+		_field1C(0), _quitGame(false), _field24(0), _nodeChangeCtr(0),
 		_nodeEnterTicks(0), _field38(0) {
 }
 
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 5a53d21..5d4b686 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -60,7 +60,7 @@ public:
 	int _field14;
 	bool _petActive;
 	int _field1C;
-	int _field20;
+	bool _quitGame;
 	int _field24;
 	uint _nodeChangeCtr;
 	uint32 _nodeEnterTicks;


Commit: e3d02532f7a64f194a802e29abef4b03eb6395b4
    https://github.com/scummvm/scummvm/commit/e3d02532f7a64f194a802e29abef4b03eb6395b4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-08T20:46:03-04:00

Commit Message:
TITANIC: Implementing preliminary video playback code

Changed paths:
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/game_state.cpp
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/video_surface.h
    engines/titanic/titanic.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index b6eac3e..3e15bb0 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -149,7 +149,7 @@ void CGameManager::playClip(CMovieClip *clip, CRoomItem *oldRoom, CRoomItem *new
 }
 
 void CGameManager::update() {
-	handleMovies();
+	updateMovies();
 	frameMessage(getRoom());
 	_list.update(g_vm->_events->getTicksCount());
 	_trueTalkManager.update1();
@@ -191,8 +191,15 @@ void CGameManager::update() {
 	}
 }
 
-void CGameManager::handleMovies() {
-	warning("TODO: CGameManager::handleMovies");
+void CGameManager::updateMovies() {
+	// TODO: Make this more like the original, if I can figuring out
+	// what's it doing with temporary lists and the OSMovie methods
+	for (CMovieList::iterator i = g_vm->_activeMovies.begin();
+			i != g_vm->_activeMovies.end(); ++i) {
+
+	}
+
+	
 }
 
 void CGameManager::updateDiskTicksCount() {
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index b8f5d02..5004c77 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -103,7 +103,7 @@ private:
 	/**
 	 * Handles any ongoing movie playback
 	 */
-	void handleMovies();
+	void updateMovies();
 public:
 	CProjectItem *_project;
 	CGameView *_gameView;
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 92a0e3d..fab7d11 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -32,7 +32,7 @@ bool CGameStateMovieList::clear() {
 		CMovieListItem *listItem = *i;
 		++i;
 
-		if (!g_vm->_movieList.contains(listItem->_item)) {
+		if (!g_vm->_activeMovies.contains(listItem->_item)) {
 			remove(listItem);
 			delete listItem;
 		}
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 846dc09..4fccc57 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -27,11 +27,11 @@
 
 namespace Titanic {
 
-CMovie::CMovie() : ListItem(), _state(0), _field10(0) {
+CMovie::CMovie() : ListItem(), _state(MOVIE_STOPPED), _field10(0) {
 }
 
 bool CMovie::isActive() const {
-	return g_vm->_movieList.contains(this);
+	return g_vm->_activeMovies.contains(this);
 }
 
 bool CMovie::get10() {
@@ -52,6 +52,7 @@ OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) : _videoSurfa
 }
 
 OSMovie::~OSMovie() {
+	g_vm->_activeMovies.remove(this);
 	delete _video;
 }
 
@@ -61,6 +62,10 @@ void OSMovie::proc8(int v1, CVideoSurface *surface) {
 
 void OSMovie::proc9(int v1, int v2, int v3, bool v4) {
 	warning("TODO: OSMovie::proc9");
+	//setFrame(v1); ?
+	_video->start();
+	g_vm->_activeMovies.push_back(this);
+	_state = MOVIE_NONE;
 }
 
 void OSMovie::proc10() {
@@ -85,11 +90,7 @@ void OSMovie::proc14() {
 
 void OSMovie::setFrame(uint frameNumber) {
 	_video->seekToFrame(frameNumber);
-	const Graphics::Surface *s = _video->decodeNextFrame();
-	Graphics::Surface *surf = s->convertTo(g_system->getScreenFormat());
-
-	_videoSurface->blitFrom(Common::Point(0, 0), surf);
-	delete surf;
+	decodeFrame();
 }
 
 void OSMovie::proc16() {
@@ -118,4 +119,48 @@ void *OSMovie::proc21() {
 	return nullptr;
 }
 
+MovieState OSMovie::getState() {
+	if (!_video)
+		_state = MOVIE_STOPPED;
+	return _state;
+}
+
+void OSMovie::update() {
+	if (_state != MOVIE_STOPPED) {
+		if (_video->isPlaying()) {
+			if (_video->needsUpdate()) {
+				decodeFrame();
+				_state = MOVIE_FRAME;
+			} else {
+				_state = MOVIE_NONE;
+			}
+		} else {
+			_state = MOVIE_STOPPED;
+		}
+	}
+}
+
+void OSMovie::decodeFrame() {
+	const Graphics::Surface *frame = _video->decodeNextFrame();
+	OSVideoSurface *videoSurface = static_cast<OSVideoSurface *>(_videoSurface);
+	assert(videoSurface);
+
+	videoSurface->lock();
+	assert(videoSurface->_rawSurface);
+
+	if (frame->format == videoSurface->_rawSurface->format) {
+		// Matching format, so we can copy straight from the video frame
+		videoSurface->_rawSurface->blitFrom(*frame);
+	} else {
+		// Different formats so we have to convert it first
+		Graphics::Surface *s = frame->convertTo(videoSurface->_rawSurface->format);
+		videoSurface->_rawSurface->blitFrom(*s);
+
+		s->free();
+		delete s;
+	}
+
+	videoSurface->unlock();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index b5ae70d..dfb0ca1 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -29,11 +29,20 @@
 
 namespace Titanic {
 
+enum MovieState { 
+	MOVIE_STOPPED = -1, MOVIE_NONE = 0, MOVIE_FINISHED = 1, MOVIE_FRAME = 2
+};
+
 class CVideoSurface;
+class CMovie;
+
+class CMovieList : public List<CMovie> {
+public:
+};
 
 class CMovie : public ListItem {
 protected:
-	int _state;
+	MovieState _state;
 	int _field10;
 public:
 	CMovie();
@@ -57,12 +66,20 @@ public:
 	bool isActive() const;
 
 	bool get10();
+
+	virtual MovieState getState() = 0;
+	virtual void update() = 0;
 };
 
 class OSMovie : public CMovie {
 private:
 	Video::VideoDecoder *_video;
 	CVideoSurface *_videoSurface;
+
+	/**
+	 * Decodes the next frame
+	 */
+	void decodeFrame();
 public:
 	OSMovie(const CResourceKey &name, CVideoSurface *surface);
 	virtual ~OSMovie();
@@ -86,10 +103,10 @@ public:
 	virtual int proc19();
 	virtual void proc20();
 	virtual void *proc21();
-};
 
-class CGlobalMovies : public List<CMovie> {
-public:
+
+	virtual MovieState getState();
+	virtual void update();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 767306c..d39dea6 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -208,6 +208,7 @@ public:
 };
 
 class OSVideoSurface : public CVideoSurface {
+	friend class OSMovie;
 private:
 	static byte _map[0x400];
 
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index a5549e4..e83d7d9 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -110,7 +110,7 @@ public:
 	OSScreenManager *_screenManager;
 	CMainGameWindow *_window;
 	Common::RandomSource _randomSource;
-	CGlobalMovies _movieList;
+	CMovieList _activeMovies;
 	CString _itemNames[TOTAL_ITEMS];
 	CString _itemDescriptions[TOTAL_ITEMS];
 	CString _itemObjects[TOTAL_ITEMS];


Commit: 09a3ca07287b77d4abd5713b6c34548ebd8b84a8
    https://github.com/scummvm/scummvm/commit/09a3ca07287b77d4abd5713b6c34548ebd8b84a8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-08T23:01:02-04:00

Commit Message:
TITANIC: Implement movie loading

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 02a64dc..d7c93b9 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -20,14 +20,14 @@
  *
  */
 
-#include "titanic/support/files_manager.h"
-#include "titanic/game_manager.h"
-#include "titanic/support/screen_manager.h"
-#include "titanic/titanic.h"
-#include "titanic/support/video_surface.h"
 #include "titanic/core/game_object.h"
 #include "titanic/core/resource_key.h"
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/support/files_manager.h"
+#include "titanic/support/screen_manager.h"
+#include "titanic/support/video_surface.h"
+#include "titanic/game_manager.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -51,7 +51,7 @@ CGameObject::CGameObject(): CNamedItem() {
 	_visible = true;
 	_field60 = 0;
 	_cursorId = CURSOR_ARROW;
-	_field78 = 0;
+	_initialFrame = 0;
 	_frameNumber = -1;
 	_field90 = 0;
 	_field94 = 0;
@@ -222,7 +222,7 @@ void CGameObject::draw(CScreenManager *screenManager, const Common::Point &destP
 }
 
 void CGameObject::loadResource(const CString &name) {
-	switch (name.imageTypeSuffix()) {
+	switch (name.fileTypeSuffix()) {
 	case FILETYPE_IMAGE:
 		loadImage(name);
 		break;
@@ -233,7 +233,25 @@ void CGameObject::loadResource(const CString &name) {
 }
 
 void CGameObject::loadMovie(const CString &name, bool pendingFlag) {
-	warning("TODO: CGameObject::loadMovie");
+	g_vm->_filesManager.fn5(name);
+
+	// Create the surface if it doesn't already exist
+	if (!_surface) {
+		CGameManager *gameManager = getGameManager();
+		_surface = new OSVideoSurface(CScreenManager::setCurrent(), nullptr);		
+	}
+
+	// Load the new movie resource
+	CResourceKey key(name);
+	_surface->loadResource(key);
+
+	if (_surface->hasSurface() && !pendingFlag) {
+		_bounds.setWidth(_surface->getWidth());
+		_bounds.setHeight(_surface->getHeight());
+	}
+
+	if (_initialFrame)
+		loadFrame(_initialFrame);
 }
 
 void CGameObject::loadImage(const CString &name, bool pendingFlag) {
@@ -264,7 +282,7 @@ void CGameObject::loadImage(const CString &name, bool pendingFlag) {
 		makeDirty();
 	}
 
-	_field78 = 0;
+	_initialFrame = 0;
 }
 
 void CGameObject::loadFrame(int frameNumber) {
@@ -403,7 +421,7 @@ bool CGameObject::hasActiveMovie() const {
 int CGameObject::getMovie19() const {
 	if (_surface && _surface->_movie)
 		return _surface->_movie->proc19();
-	return _field78;
+	return _initialFrame;
 }
 
 int CGameObject::getSurface45() const {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 2fc047e..3914c54 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -70,7 +70,7 @@ protected:
 	int _field58;
 	bool _visible;
 	CMovieClipList _clipList1;
-	int _field78;
+	int _initialFrame;
 	CMovieClipList _clipList2;
 	int _frameNumber;
 	int _field90;
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 4fccc57..d614ea7 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -145,6 +145,11 @@ void OSMovie::decodeFrame() {
 	OSVideoSurface *videoSurface = static_cast<OSVideoSurface *>(_videoSurface);
 	assert(videoSurface);
 
+	// If the video surface doesn't yet have an underlying surface, create it
+	if (!videoSurface->hasSurface())
+		videoSurface->resize(frame->w, frame->h);
+
+	// Lock access to the surface
 	videoSurface->lock();
 	assert(videoSurface->_rawSurface);
 
@@ -160,6 +165,7 @@ void OSMovie::decodeFrame() {
 		delete s;
 	}
 
+	// Unlock the surface
 	videoSurface->unlock();
 }
 
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 1a0d48b..c7b437e 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -241,8 +241,24 @@ void OSVideoSurface::loadJPEG(const CResourceKey &key) {
 	_resourceKey = key;
 }
 
-void OSVideoSurface::loadMovie() {
-	warning("TODO");
+void OSVideoSurface::loadMovie(const CResourceKey &key, bool destroyFlag) {
+	// Delete any prior movie
+	if (_movie) {
+		delete _movie;
+		_movie = nullptr;
+	}
+
+	// Create the new movie and load the first frame to the video surface
+	_movie = new OSMovie(key, this);
+	_movie->setFrame(0);
+
+	// If flagged to destroy, then immediately destroy movie instance
+	if (destroyFlag) {
+		delete _movie;
+		_movie = nullptr;
+	}
+
+	_resourceKey = key;
 }
 
 bool OSVideoSurface::lock() {
@@ -329,7 +345,7 @@ bool OSVideoSurface::load() {
 		return true;
 
 	case FILETYPE_MOVIE:
-		loadMovie();
+		loadMovie(_resourceKey);
 		return true;
 
 	default:
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index d39dea6..335215d 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -93,9 +93,11 @@ public:
 	virtual void loadJPEG(const CResourceKey &key) = 0;
 
 	/**
-	 * Loads a movie file specified by the resource key
+	 * Loads a movie file specified by the resource key.
+	 * @param key			Resource key for movie to load
+	 * @param destroyFlag	Immediately destroy movie after decoding first frame
 	 */
-	virtual void loadMovie() = 0;
+	virtual void loadMovie(const CResourceKey &key, bool destroyFlag = false) = 0;
 
 	/**
 	 * Lock the surface for direct access to the pixels
@@ -241,9 +243,11 @@ public:
 	virtual void loadJPEG(const CResourceKey &key);
 
 	/**
-	 * Loads a movie file specified by the resource key
+	 * Loads a movie file specified by the resource key.
+	 * @param key			Resource key for movie to load
+	 * @param destroyFlag	Immediately destroy movie after decoding first frame
 	 */
-	virtual void loadMovie();
+	virtual void loadMovie(const CResourceKey &key, bool destroyFlag = false);
 
 	/**
 	 * Lock the surface for direct access to the pixels


Commit: 3d166fb8a91a4d56bc1abac6f1e3899a0379cd31
    https://github.com/scummvm/scummvm/commit/3d166fb8a91a4d56bc1abac6f1e3899a0379cd31
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-09T14:24:52-04:00

Commit Message:
TITANIC: More implementation code for movie playback

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index d7c93b9..a7bbbd8 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -238,7 +238,7 @@ void CGameObject::loadMovie(const CString &name, bool pendingFlag) {
 	// Create the surface if it doesn't already exist
 	if (!_surface) {
 		CGameManager *gameManager = getGameManager();
-		_surface = new OSVideoSurface(CScreenManager::setCurrent(), nullptr);		
+		_surface = new OSVideoSurface(gameManager->setScreenManager(), nullptr);		
 	}
 
 	// Load the new movie resource
@@ -359,6 +359,9 @@ void CGameObject::fn1(int val1, int val2, int val3) {
 	}
 
 	if (_surface) {
+		// TODO: Figure out where to do this legitimately
+		static_cast<OSMovie *>(_surface->_movie)->_gameObject = this;
+
 		_surface->proc34(val1, val2, val3, val3 != 0);
 
 		if (val3 & 0x10)
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 3e15bb0..a4e3420 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -195,11 +195,32 @@ void CGameManager::updateMovies() {
 	// TODO: Make this more like the original, if I can figuring out
 	// what's it doing with temporary lists and the OSMovie methods
 	for (CMovieList::iterator i = g_vm->_activeMovies.begin();
-			i != g_vm->_activeMovies.end(); ++i) {
+			i != g_vm->_activeMovies.end(); ) {
+		OSMovie *movie = static_cast<OSMovie *>(*i);
+		assert(movie && movie->_gameObject);
+
+		movie->update();
+		switch (movie->getState()) {
+		case MOVIE_FINISHED: {
+			CMovieEndMsg endMsg;
+			endMsg.execute(movie->_gameObject);
+
+			i = g_vm->_activeMovies.erase(i);
+			continue;
+		}
 
-	}
+		case MOVIE_FRAME: {
+			CMovieFrameMsg frameMsg;
+			frameMsg.execute(movie->_gameObject);
+			break;
+		}
 
-	
+		default:
+			break;
+		}
+
+		++i;
+	}
 }
 
 void CGameManager::updateDiskTicksCount() {
@@ -245,4 +266,8 @@ void CGameManager::extendBounds(const Rect &r) {
 		_bounds.combine(r);
 }
 
+CScreenManager *CGameManager::setScreenManager() const {
+	return CScreenManager::setCurrent();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 5004c77..5a2787d 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -206,6 +206,11 @@ public:
 	 * to include the passed rect
 	 */
 	void extendBounds(const Rect &r);
+
+	/**
+	 * Set and return the current screen manager
+	 */
+	CScreenManager *setScreenManager() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index d614ea7..f2c5643 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -45,7 +45,8 @@ bool CMovie::get10() {
 
 /*------------------------------------------------------------------------*/
 
-OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) : _videoSurface(surface) {
+OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) :
+		_videoSurface(surface), _gameObject(nullptr) {
 	_video = new AVIDecoder();
 	if (!_video->loadFile(name.getString()))
 		error("Could not open video - %s", name.getString().c_str());
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index dfb0ca1..0772635 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -35,6 +35,7 @@ enum MovieState {
 
 class CVideoSurface;
 class CMovie;
+class CGameObject;
 
 class CMovieList : public List<CMovie> {
 public:
@@ -81,6 +82,8 @@ private:
 	 */
 	void decodeFrame();
 public:
+	CGameObject *_gameObject;
+public:
 	OSMovie(const CResourceKey &name, CVideoSurface *surface);
 	virtual ~OSMovie();
 


Commit: 6405ba6ecbbec9a8e45e6093bcacf2cab7f3b94b
    https://github.com/scummvm/scummvm/commit/6405ba6ecbbec9a8e45e6093bcacf2cab7f3b94b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-09T17:12:41-04:00

Commit Message:
TITANIC: Starting to flesh out timers

Changed paths:
  A engines/titanic/support/timer.cpp
  A engines/titanic/support/timer.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/module.mk



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index a4e3420..56355dc 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -30,41 +30,6 @@
 
 namespace Titanic {
 
-void CGameManagerList::postLoad(uint ticks, CProjectItem *project) {
-	for (iterator i = begin(); i != end(); ++i)
-		(*i)->postLoad(ticks, project);
-}
-
-void CGameManagerList::preSave() {
-	for (iterator i = begin(); i != end(); ++i)
-		(*i)->preSave();
-}
-
-void CGameManagerList::postSave() {
-	for (iterator i = begin(); i != end(); ++i)
-		(*i)->postSave();
-}
-
-void CGameManagerList::update(uint ticks) {
-	warning("TODO: CGameManagerList::update");
-}
-
-/*------------------------------------------------------------------------*/
-
-void CGameManagerListItem::postLoad(uint ticks, CProjectItem *project) {
-	warning("TODO");
-}
-
-void CGameManagerListItem::preSave() {
-	warning("TODO: CGameManagerListItem::preSave");
-}
-
-void CGameManagerListItem::postSave() {
-	warning("TODO: CGameManagerListItem::postSave");
-}
-
-/*------------------------------------------------------------------------*/
-
 CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
 		_project(project), _gameView(gameView), _trueTalkManager(this),
 		_inputHandler(this), _inputTranslator(&_inputHandler),		
@@ -82,14 +47,14 @@ void CGameManager::load(SimpleFile *file) {
 	file->readNumber();
 
 	_gameState.load(file);
-	_list.load(file);
+	_timers.load(file);
 	_trueTalkManager.load(file);
 	_sound.load(file);
 }
 
 void CGameManager::preLoad() {
 	updateDiskTicksCount();
-	_list.destroyContents();
+	_timers.destroyContents();
 	_soundMaker = nullptr;
 
 	_trueTalkManager.preLoad();
@@ -111,8 +76,8 @@ void CGameManager::postLoad(CProjectItem *project) {
 	CLoadSuccessMsg msg(_lastDiskTicksCount - _tickCount2);
 	msg.execute(project, nullptr, MSGFLAG_SCAN);
 
-	// Signal to any registered list items
-	_list.postLoad(_lastDiskTicksCount, _project);
+	// Signal to any registered timers
+	_timers.postLoad(_lastDiskTicksCount, _project);
 
 	// Signal the true talk manager and sound
 	_trueTalkManager.postLoad();
@@ -126,13 +91,13 @@ void CGameManager::preSave(CProjectItem *project) {
 	msg.execute(project, nullptr, MSGFLAG_SCAN);
 
 	// Notify sub-objects of the save
-	_list.preSave();
+	_timers.preSave();
 	_trueTalkManager.preSave();
 	_sound.preSave();
 }
 
 void CGameManager::postSave() {
-	_list.postSave();
+	_timers.postSave();
 	_trueTalkManager.postSave();
 }
 
@@ -151,7 +116,7 @@ void CGameManager::playClip(CMovieClip *clip, CRoomItem *oldRoom, CRoomItem *new
 void CGameManager::update() {
 	updateMovies();
 	frameMessage(getRoom());
-	_list.update(g_vm->_events->getTicksCount());
+	_timers.update(g_vm->_events->getTicksCount());
 	_trueTalkManager.update1();
 	_trueTalkManager.update2();
 	CScreenManager::_screenManagerPtr->_mouseCursor->update();
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 5a2787d..8b4c0be 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -28,6 +28,7 @@
 #include "titanic/input_handler.h"
 #include "titanic/input_translator.h"
 #include "titanic/support/simple_file.h"
+#include "titanic/support/timer.h"
 #include "titanic/support/video_surface.h"
 #include "titanic/true_talk/true_talk_manager.h"
 #include "titanic/sound/background_sound_maker.h"
@@ -39,53 +40,10 @@ namespace Titanic {
 class CProjectItem;
 class CGameView;
 
-class CGameManagerListItem : public ListItem {
-private:
-	static int _v1;
-public:
-	/**
-	 * Called after loading a game has finished
-	 */
-	void postLoad(uint ticks, CProjectItem *project);
-
-	/**
-	 * Called when a game is about to be saved
-	 */
-	void preSave();
-
-	/**
-	 * Called when a game has finished being saved
-	 */
-	void postSave();
-};
-
-class CGameManagerList : public List<CGameManagerListItem> {
-public:
-	/**
-	 * Called after loading a game has finished
-	 */
-	void postLoad(uint ticks, CProjectItem *project);
-
-	/**
-	 * Called when a game is about to be saved
-	 */
-	void preSave();
-
-	/**
-	 * Called when a game has finished being saved
-	 */
-	void postSave();
-
-	/**
-	 * Handles an update
-	 */
-	void update(uint ticks);
-};
-
 class CGameManager {
 private:
 	CTrueTalkManager _trueTalkManager;
-	CGameManagerList _list;
+	CTimerList _timers;
 	int _field30;
 	CBackgroundSoundMaker *_soundMaker;
 	CVideoSurface *_videoSurface1;
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 80abc1a..74dfbfb 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -437,6 +437,7 @@ MODULE_OBJS := \
 	support/simple_file.o \
 	support/string.o \
 	support/text_cursor.o \
+	support/timer.o \
 	support/video_surface.o \
 	true_talk/barbot_script.o \
 	true_talk/bellbot_script.o \
diff --git a/engines/titanic/support/timer.cpp b/engines/titanic/support/timer.cpp
new file mode 100644
index 0000000..6f99a67
--- /dev/null
+++ b/engines/titanic/support/timer.cpp
@@ -0,0 +1,109 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/timer.h"
+#include "titanic/core/project_item.h"
+
+namespace Titanic {
+
+void CTimerList::postLoad(uint ticks, CProjectItem *project) {
+	for (iterator i = begin(); i != end(); ++i)
+		(*i)->postLoad(ticks, project);
+}
+
+void CTimerList::preSave() {
+	for (iterator i = begin(); i != end(); ++i)
+		(*i)->preSave();
+}
+
+void CTimerList::postSave() {
+	for (iterator i = begin(); i != end(); ++i)
+		(*i)->postSave();
+}
+
+void CTimerList::update(uint ticks) {
+	// Remove any items that are done
+	for (iterator i = begin(); i != end(); ) {
+		CTimer *item = *i;
+		if (item->_done) {
+			i = erase(i);
+			delete item;
+		} else {
+			++i;
+		}
+	}
+
+	// Handle updating the items
+	for (iterator i = begin(); i != end(); ) {
+		CTimer *item = *i;
+		if (!item->update(ticks)) {
+			++i;
+		} else {
+			i = erase(i);
+			delete item;
+		}
+	}
+}
+
+void CTimerList::stop(uint id) {
+	for (iterator i = begin(); i != end(); ++i) {
+		CTimer *item = *i;
+		if (item->_id == id) {
+			item->_done = true;
+			return;
+		}
+	}
+}
+
+void CTimerList::set44(uint id, uint val) {
+	for (iterator i = begin(); i != end(); ++i) {
+		CTimer *item = *i;
+		if (item->_id == id) {
+			item->set44(val);
+			return;
+		}
+	}
+}
+
+/*------------------------------------------------------------------------*/
+
+CTimer::CTimer() : _id(0), _done(false),
+		_field44(0) {
+}
+
+void CTimer::postLoad(uint ticks, CProjectItem *project) {
+	warning("TODO");
+}
+
+void CTimer::preSave() {
+	warning("TODO: CTimer::preSave");
+}
+
+void CTimer::postSave() {
+	warning("TODO: CTimer::postSave");
+}
+
+bool CTimer::update(uint ticks) {
+	return false;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/timer.h b/engines/titanic/support/timer.h
new file mode 100644
index 0000000..4d74bae
--- /dev/null
+++ b/engines/titanic/support/timer.h
@@ -0,0 +1,94 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TIMER_H
+#define TITANIC_TIMER_H
+
+#include "titanic/core/list.h"
+
+namespace Titanic {
+
+class CProjectItem;
+
+class CTimer : public ListItem {
+private:
+	static int _v1;
+public:
+	uint _id;
+	bool _done;
+	uint _field44;
+public:
+	CTimer();
+
+	/**
+	 * Called after loading a game has finished
+	 */
+	void postLoad(uint ticks, CProjectItem *project);
+
+	/**
+	 * Called when a game is about to be saved
+	 */
+	void preSave();
+
+	/**
+	 * Called when a game has finished being saved
+	 */
+	void postSave();
+
+	bool update(uint ticks);
+
+	void set44(uint val) { _field44 = val; }
+};
+
+class CTimerList : public List<CTimer> {
+public:
+	/**
+	 * Called after loading a game has finished
+	 */
+	void postLoad(uint ticks, CProjectItem *project);
+
+	/**
+	 * Called when a game is about to be saved
+	 */
+	void preSave();
+
+	/**
+	 * Called when a game has finished being saved
+	 */
+	void postSave();
+
+	/**
+	 * Handles an update
+	 */
+	void update(uint ticks);
+
+	/**
+	 * Remove an item with the given Id
+	 */
+	void stop(uint id);
+
+	void set44(uint id, uint val);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TIMER_H */


Commit: f7748622faa71729d12f3d0ec063417bdca60eb6
    https://github.com/scummvm/scummvm/commit/f7748622faa71729d12f3d0ec063417bdca60eb6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-09T19:36:12-04:00

Commit Message:
TITANIC: Further implementation of timers

Changed paths:
  A engines/titanic/support/time_event_info.cpp
  A engines/titanic/support/time_event_info.h
  R engines/titanic/support/timer.cpp
  R engines/titanic/support/timer.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/messages/messages.h
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 9f0ac32..4ef6a4a 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -406,6 +406,7 @@
 #include "titanic/sound/water_lapping_sounds.h"
 
 #include "titanic/star_control/star_control.h"
+#include "titanic/support/time_event_info.h"
 
 namespace Titanic {
 
@@ -1004,6 +1005,7 @@ DEFFN(CViewAutoSoundPlayer)
 DEFFN(CViewTogglesOtherMusic)
 DEFFN(CWaterLappingSounds)
 DEFFN(CStarControl)
+DEFFN(CTimeEventInfo)
 
 void CSaveableObject::initClassList() {
 	_classDefs = new Common::List<ClassDef *>();
@@ -1592,6 +1594,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CViewTogglesOtherMusic, CEnterViewTogglesOtherMusic);
 	ADDFN(CWaterLappingSounds, CRoomAutoSoundPlayer);
 	ADDFN(CStarControl, CGameObject);
+	ADDFN(CTimeEventInfo, ListItem);
 }
 
 void CSaveableObject::freeClassList() {
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 56355dc..31bb427 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -37,6 +37,7 @@ CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
 		_field30(0), _soundMaker(nullptr), _field4C(0),
 		_dragItem(nullptr), _field54(0), _lastDiskTicksCount(0), _tickCount2(0) {
 	
+	CTimeEventInfo::_nextId = 0;
 	_videoSurface1 = nullptr;
 	_videoSurface2 = CScreenManager::_screenManagerPtr->createSurface(600, 340);
 	_project->setGameManager(this);
@@ -91,7 +92,7 @@ void CGameManager::preSave(CProjectItem *project) {
 	msg.execute(project, nullptr, MSGFLAG_SCAN);
 
 	// Notify sub-objects of the save
-	_timers.preSave();
+	_timers.preSave(_lastDiskTicksCount);
 	_trueTalkManager.preSave();
 	_sound.preSave();
 }
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 8b4c0be..6e5782f 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -28,7 +28,7 @@
 #include "titanic/input_handler.h"
 #include "titanic/input_translator.h"
 #include "titanic/support/simple_file.h"
-#include "titanic/support/timer.h"
+#include "titanic/support/time_event_info.h"
 #include "titanic/support/video_surface.h"
 #include "titanic/true_talk/true_talk_manager.h"
 #include "titanic/sound/background_sound_maker.h"
@@ -43,7 +43,7 @@ class CGameView;
 class CGameManager {
 private:
 	CTrueTalkManager _trueTalkManager;
-	CTimerList _timers;
+	CTimeEventInfoList _timers;
 	int _field30;
 	CBackgroundSoundMaker *_soundMaker;
 	CVideoSurface *_videoSurface1;
@@ -169,6 +169,18 @@ public:
 	 * Set and return the current screen manager
 	 */
 	CScreenManager *setScreenManager() const;
+
+	/**
+	 * Adds a timer
+	 */
+	void addTimer(CTimeEventInfo *timer) { _timers.push_back(timer); }
+
+	/**
+	 * Stops a timer
+	 */
+	void stopTimer(uint id) { _timers.stop(id); }
+
+	void setTimer44(uint id, uint val) { _timers.set44(id, val); }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index e566b5d..82601e5 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -222,16 +222,18 @@ public:
 	}
 };
 
-MESSAGE1(CTimeMsg, int, value, 0);
+MESSAGE1(CTimeMsg, uint, _ticks, 0);
 
 class CTimerMsg : public CTimeMsg {
 public:
-	int _field8;
+	uint _timerCtr;
 	int _fieldC;
-	CString _string1;
+	CString _action;
 public:
 	CLASSDEF
-	CTimerMsg() : CTimeMsg(), _field8(0), _fieldC(0) {}
+	CTimerMsg() : CTimeMsg(), _timerCtr(0), _fieldC(0) {}
+	CTimerMsg(uint ticks, uint timerCtr, int val2, const CString &action) :
+		CTimeMsg(ticks), _timerCtr(timerCtr), _fieldC(val2), _action(action) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return supports(item, _type);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 74dfbfb..7a142ea 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -437,7 +437,7 @@ MODULE_OBJS := \
 	support/simple_file.o \
 	support/string.o \
 	support/text_cursor.o \
-	support/timer.o \
+	support/time_event_info.o \
 	support/video_surface.o \
 	true_talk/barbot_script.o \
 	true_talk/bellbot_script.o \
diff --git a/engines/titanic/support/time_event_info.cpp b/engines/titanic/support/time_event_info.cpp
new file mode 100644
index 0000000..c3312de
--- /dev/null
+++ b/engines/titanic/support/time_event_info.cpp
@@ -0,0 +1,206 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/time_event_info.h"
+#include "titanic/core/game_object.h"
+#include "titanic/core/project_item.h"
+#include "titanic/messages/messages.h"
+
+namespace Titanic {
+
+void CTimeEventInfoList::postLoad(uint ticks, CProjectItem *project) {
+	for (iterator i = begin(); i != end(); ++i)
+		(*i)->postLoad(ticks, project);
+}
+
+void CTimeEventInfoList::preSave(uint ticks) {
+	for (iterator i = begin(); i != end(); ++i)
+		(*i)->preSave(ticks);
+}
+
+void CTimeEventInfoList::postSave() {
+	for (iterator i = begin(); i != end(); ++i)
+		(*i)->postSave();
+}
+
+void CTimeEventInfoList::update(uint ticks) {
+	// Remove any items that are done
+	for (iterator i = begin(); i != end(); ) {
+		CTimeEventInfo *item = *i;
+		if (item->_done) {
+			i = erase(i);
+			delete item;
+		} else {
+			++i;
+		}
+	}
+
+	// Handle updating the items
+	for (iterator i = begin(); i != end(); ) {
+		CTimeEventInfo *item = *i;
+		if (!item->update(ticks)) {
+			++i;
+		} else {
+			i = erase(i);
+			delete item;
+		}
+	}
+}
+
+void CTimeEventInfoList::stop(uint id) {
+	for (iterator i = begin(); i != end(); ++i) {
+		CTimeEventInfo *item = *i;
+		if (item->_id == id) {
+			item->_done = true;
+			return;
+		}
+	}
+}
+
+void CTimeEventInfoList::set44(uint id, uint val) {
+	for (iterator i = begin(); i != end(); ++i) {
+		CTimeEventInfo *item = *i;
+		if (item->_id == id) {
+			item->set44(val);
+			return;
+		}
+	}
+}
+
+/*------------------------------------------------------------------------*/
+
+uint CTimeEventInfo::_nextId;
+
+CTimeEventInfo::CTimeEventInfo() : ListItem(), _lockCounter(0), 
+		_field14(0), _firstDuration(0), _duration(0), _target(nullptr),
+		_actionVal(0), _field2C(0), _field30(0), _timerCtr(0),
+		_lastTimerTicks(0), _field3C(0), _done(false), _field44(0) {
+	_id = _nextId++;
+}
+
+CTimeEventInfo::CTimeEventInfo(uint ticks, uint f14, uint firstDuration,
+		uint duration, CTreeItem *target, int timerVal3, const CString &action) :
+		ListItem(), _lockCounter(0), _field14(f14), _firstDuration(firstDuration),
+		_duration(duration), _target(target), _field2C(0), _field30(0),
+		_timerCtr(0), _lastTimerTicks(ticks), _field3C(0), _done(false),
+		_field44(true) {
+	_id = _nextId++;
+}
+
+void CTimeEventInfo::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+
+	CString targetName;
+	if (_target)
+		targetName = _target->getName();
+	file->writeQuotedLine(targetName, indent);
+	file->writeNumberLine(_id, indent);
+	file->writeNumberLine(_field14, indent);
+	file->writeNumberLine(_firstDuration, indent);
+	file->writeNumberLine(_duration, indent);
+	file->writeNumberLine(_actionVal, indent);
+	file->writeQuotedLine(_action, indent);
+	file->writeNumberLine(_timerCtr, indent);
+	file->writeNumberLine(_field3C, indent);
+	file->writeNumberLine(_done, indent);
+	file->writeNumberLine(_field44, indent);
+}
+
+void CTimeEventInfo::load(SimpleFile *file) {
+	lock();
+	int val = file->readNumber();
+
+	if (!val) {
+		_targetName = file->readString();
+		_id = file->readNumber();
+		_field14 = file->readNumber();
+		_firstDuration = file->readNumber();
+		_duration = file->readNumber();
+		_actionVal = file->readNumber();
+		_action = file->readString();
+		_timerCtr = file->readNumber();
+		_field3C = file->readNumber();
+		_done = file->readNumber() != 0;
+		_field44 = file->readNumber();
+		_target = nullptr;
+	}
+}
+
+void CTimeEventInfo::postLoad(uint ticks, CProjectItem *project) {
+	if (!_field44 || _targetName.empty())
+		_done = true;
+	
+	// Get the timer's target
+	if (project)
+		_target = project->findByName(_targetName);
+	if (!_target)
+		_done = true;
+
+	_lastTimerTicks = ticks + _field3C;
+	if (_id >= _nextId)
+		_nextId = _id + 1;
+
+	unlock();
+}
+
+void CTimeEventInfo::preSave(uint ticks) {
+	_field3C = _lastTimerTicks - ticks;
+	lock();
+}
+
+void CTimeEventInfo::postSave() {
+	unlock();
+}
+
+bool CTimeEventInfo::update(uint ticks) {
+	if (_lockCounter)
+		return false;
+
+	if (_timerCtr) {
+		if (ticks > (_lastTimerTicks + _duration)) {
+			++_timerCtr;
+			_lastTimerTicks = ticks;
+
+			if (_target) {
+				CTimerMsg timerMsg(ticks, _timerCtr, _actionVal, _action);
+				timerMsg.execute(_target);
+			}
+		}
+	} else {
+		if (ticks > (_lastTimerTicks + _firstDuration)) {
+			_timerCtr = 1;
+			_lastTimerTicks = ticks;
+
+			if (_target) {
+				CTimerMsg timerMsg(ticks, _timerCtr, _actionVal, _action);
+				timerMsg.execute(_target);
+			}
+
+			if (!_field14)
+				return true;
+		}
+	}
+
+	return false;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/time_event_info.h b/engines/titanic/support/time_event_info.h
new file mode 100644
index 0000000..ee923f5
--- /dev/null
+++ b/engines/titanic/support/time_event_info.h
@@ -0,0 +1,134 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TIMER_H
+#define TITANIC_TIMER_H
+
+#include "common/algorithm.h"
+#include "titanic/core/list.h"
+
+namespace Titanic {
+
+class CTreeItem;
+class CProjectItem;
+
+class CTimeEventInfo : public ListItem {
+private:
+	/**
+	 * Increments the counter
+	 */
+	void lock() { ++_lockCounter; }
+
+	/**
+	 * Called at the end of both post load and post save actions
+	 */
+	void unlock() {
+		_lockCounter = MAX(_lockCounter - 1, 0);
+	}
+public:
+	static uint _nextId;
+public:
+	int _lockCounter;
+	uint _id;
+	uint _field14;
+	uint _firstDuration;
+	uint _duration;
+	CTreeItem *_target;
+	uint _actionVal;
+	CString _action;
+	uint _field2C;
+	uint _field30;
+	uint _timerCtr;
+	uint _lastTimerTicks;
+	uint _field3C;
+	bool _done;
+	uint _field44;
+	CString _targetName;
+public:
+	CLASSDEF
+	CTimeEventInfo();
+	CTimeEventInfo(uint ticks, uint f14, uint firstDuration, uint duration,
+		CTreeItem *target, int timerVal3, const CString &action);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+
+	/**
+	 * Called after loading a game has finished
+	 */
+	void postLoad(uint ticks, CProjectItem *project);
+
+	/**
+	 * Called when a game is about to be saved
+	 */
+	void preSave(uint ticks);
+
+	/**
+	 * Called when a game has finished being saved
+	 */
+	void postSave();
+
+	bool update(uint ticks);
+
+	void set44(uint val) { _field44 = val; }
+};
+
+class CTimeEventInfoList : public List<CTimeEventInfo> {
+public:
+	/**
+	 * Called after loading a game has finished
+	 */
+	void postLoad(uint ticks, CProjectItem *project);
+
+	/**
+	 * Called when a game is about to be saved
+	 */
+	void preSave(uint ticks);
+
+	/**
+	 * Called when a game has finished being saved
+	 */
+	void postSave();
+
+	/**
+	 * Handles an update
+	 */
+	void update(uint ticks);
+
+	/**
+	 * Remove an item with the given Id
+	 */
+	void stop(uint id);
+
+	void set44(uint id, uint val);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TIMER_H */
diff --git a/engines/titanic/support/timer.cpp b/engines/titanic/support/timer.cpp
deleted file mode 100644
index 6f99a67..0000000
--- a/engines/titanic/support/timer.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/support/timer.h"
-#include "titanic/core/project_item.h"
-
-namespace Titanic {
-
-void CTimerList::postLoad(uint ticks, CProjectItem *project) {
-	for (iterator i = begin(); i != end(); ++i)
-		(*i)->postLoad(ticks, project);
-}
-
-void CTimerList::preSave() {
-	for (iterator i = begin(); i != end(); ++i)
-		(*i)->preSave();
-}
-
-void CTimerList::postSave() {
-	for (iterator i = begin(); i != end(); ++i)
-		(*i)->postSave();
-}
-
-void CTimerList::update(uint ticks) {
-	// Remove any items that are done
-	for (iterator i = begin(); i != end(); ) {
-		CTimer *item = *i;
-		if (item->_done) {
-			i = erase(i);
-			delete item;
-		} else {
-			++i;
-		}
-	}
-
-	// Handle updating the items
-	for (iterator i = begin(); i != end(); ) {
-		CTimer *item = *i;
-		if (!item->update(ticks)) {
-			++i;
-		} else {
-			i = erase(i);
-			delete item;
-		}
-	}
-}
-
-void CTimerList::stop(uint id) {
-	for (iterator i = begin(); i != end(); ++i) {
-		CTimer *item = *i;
-		if (item->_id == id) {
-			item->_done = true;
-			return;
-		}
-	}
-}
-
-void CTimerList::set44(uint id, uint val) {
-	for (iterator i = begin(); i != end(); ++i) {
-		CTimer *item = *i;
-		if (item->_id == id) {
-			item->set44(val);
-			return;
-		}
-	}
-}
-
-/*------------------------------------------------------------------------*/
-
-CTimer::CTimer() : _id(0), _done(false),
-		_field44(0) {
-}
-
-void CTimer::postLoad(uint ticks, CProjectItem *project) {
-	warning("TODO");
-}
-
-void CTimer::preSave() {
-	warning("TODO: CTimer::preSave");
-}
-
-void CTimer::postSave() {
-	warning("TODO: CTimer::postSave");
-}
-
-bool CTimer::update(uint ticks) {
-	return false;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/support/timer.h b/engines/titanic/support/timer.h
deleted file mode 100644
index 4d74bae..0000000
--- a/engines/titanic/support/timer.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_TIMER_H
-#define TITANIC_TIMER_H
-
-#include "titanic/core/list.h"
-
-namespace Titanic {
-
-class CProjectItem;
-
-class CTimer : public ListItem {
-private:
-	static int _v1;
-public:
-	uint _id;
-	bool _done;
-	uint _field44;
-public:
-	CTimer();
-
-	/**
-	 * Called after loading a game has finished
-	 */
-	void postLoad(uint ticks, CProjectItem *project);
-
-	/**
-	 * Called when a game is about to be saved
-	 */
-	void preSave();
-
-	/**
-	 * Called when a game has finished being saved
-	 */
-	void postSave();
-
-	bool update(uint ticks);
-
-	void set44(uint val) { _field44 = val; }
-};
-
-class CTimerList : public List<CTimer> {
-public:
-	/**
-	 * Called after loading a game has finished
-	 */
-	void postLoad(uint ticks, CProjectItem *project);
-
-	/**
-	 * Called when a game is about to be saved
-	 */
-	void preSave();
-
-	/**
-	 * Called when a game has finished being saved
-	 */
-	void postSave();
-
-	/**
-	 * Handles an update
-	 */
-	void update(uint ticks);
-
-	/**
-	 * Remove an item with the given Id
-	 */
-	void stop(uint id);
-
-	void set44(uint id, uint val);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_TIMER_H */


Commit: c8eb5a7734bae63572384d3b3972d904525ce254
    https://github.com/scummvm/scummvm/commit/c8eb5a7734bae63572384d3b3972d904525ce254
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-09T21:00:26-04:00

Commit Message:
TITANIC: Fix setting object bounds when drawing

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/true_talk/true_talk_manager.cpp



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index a7bbbd8..b2df9f6 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -178,10 +178,10 @@ void CGameObject::draw(CScreenManager *screenManager) {
 		}
 
 		if (_surface) {
-			_bounds.right = _surface->getWidth();
-			_bounds.bottom = _surface->getHeight();
+			_bounds.setWidth(_surface->getWidth());
+			_bounds.setHeight(_surface->getHeight());
 
-			if (!_bounds.right || !_bounds.bottom)
+			if (!_bounds.width() || !_bounds.height())
 				return;
 
 			if (_frameNumber >= 0) {
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 6f42346..68818db 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -183,11 +183,11 @@ void CTrueTalkManager::viewChange() {
 }
 
 void CTrueTalkManager::update1() {
-	warning("CTrueTalkManager::update1");
+	//warning("CTrueTalkManager::update1");
 }
 
 void CTrueTalkManager::update2() {
-	warning("CTrueTalkManager::update2");
+	//warning("CTrueTalkManager::update2");
 }
 
 } // End of namespace Titanic


Commit: d5e346681f3019a2394eec23f566b347f82edcf6
    https://github.com/scummvm/scummvm/commit/d5e346681f3019a2394eec23f566b347f82edcf6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-09T21:45:13-04:00

Commit Message:
TITANIC: Fix deleting movies

Changed paths:
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index f2c5643..79e0a7b 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -30,6 +30,10 @@ namespace Titanic {
 CMovie::CMovie() : ListItem(), _state(MOVIE_STOPPED), _field10(0) {
 }
 
+CMovie::~CMovie() {
+	g_vm->_activeMovies.remove(this);
+}
+
 bool CMovie::isActive() const {
 	return g_vm->_activeMovies.contains(this);
 }
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index 0772635..08d2940 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -47,7 +47,7 @@ protected:
 	int _field10;
 public:
 	CMovie();
-	virtual ~CMovie() {}
+	virtual ~CMovie();
 
 	virtual void proc8(int v1, CVideoSurface *surface) = 0;
 	virtual void proc9(int v1, int v2, int v3, bool v4) = 0;
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 03d50f6..8e079d5 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -62,6 +62,7 @@ TitanicEngine::~TitanicEngine() {
 	delete _window;
 	delete _screenManager;
 	CSaveableObject::freeClassList();
+	_activeMovies.clear();
 }
 
 void TitanicEngine::initializePath(const Common::FSNode &gamePath) {


Commit: c9f322887c257c4a1c4eb54dfc4746bf0219a6e6
    https://github.com/scummvm/scummvm/commit/c9f322887c257c4a1c4eb54dfc4746bf0219a6e6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-10T08:20:35-04:00

Commit Message:
TITANIC: Fix CGameObject::changeStatus

Changed paths:
    engines/titanic/core/game_object.cpp



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index b2df9f6..feeabdb 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -360,7 +360,9 @@ void CGameObject::fn1(int val1, int val2, int val3) {
 
 	if (_surface) {
 		// TODO: Figure out where to do this legitimately
-		static_cast<OSMovie *>(_surface->_movie)->_gameObject = this;
+		OSMovie *movie = static_cast<OSMovie *>(_surface->_movie);
+		if (movie)
+			movie->_gameObject = this;
 
 		_surface->proc34(val1, val2, val3, val3 != 0);
 
@@ -370,7 +372,8 @@ void CGameObject::fn1(int val1, int val2, int val3) {
 }
 
 void CGameObject::changeStatus(int newStatus) {
-	if (_frameNumber == -1 && !_resource.empty()) {
+	_frameNumber = -1;
+	if (!_surface && !_resource.empty()) {
 		loadResource(_resource);
 		_resource.clear();
 	}


Commit: c96164dde01f6336615528d2a7c930c37c696be2
    https://github.com/scummvm/scummvm/commit/c96164dde01f6336615528d2a7c930c37c696be2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-10T08:20:51-04:00

Commit Message:
TITANIC: Cleanup of CSTButton

Changed paths:
    engines/titanic/core/game_object.h
    engines/titanic/gfx/st_button.cpp
    engines/titanic/gfx/st_button.h



diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 3914c54..1086509 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -192,7 +192,7 @@ public:
 	void loadFrame(int frameNumber);
 
 	void soundProximity(const CString &name, int val2, int val3, int val4);
-	void soundProximity(const CString &name, CProximity &obj6C);
+	void soundProximity(const CString &name, CProximity &prox);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/gfx/st_button.cpp b/engines/titanic/gfx/st_button.cpp
index 154122e..9a39581 100644
--- a/engines/titanic/gfx/st_button.cpp
+++ b/engines/titanic/gfx/st_button.cpp
@@ -36,7 +36,7 @@ CSTButton::CSTButton() : CBackground() {
 	_fieldF0 = 0;
 	_currentStatus = 0;
 	_string4 = "NULL";
-	_string5 = "NULL";
+	_soundName = "NULL";
 	_buttonFrame = 0;
 }
 
@@ -47,7 +47,7 @@ void CSTButton::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_fieldF0, indent);
 	file->writeNumberLine(_currentStatus, indent);
 	file->writeQuotedLine(_string4, indent);
-	file->writeQuotedLine(_string5, indent);
+	file->writeQuotedLine(_soundName, indent);
 	file->writeNumberLine(_buttonFrame, indent);
 
 	CBackground::save(file, indent);
@@ -60,7 +60,7 @@ void CSTButton::load(SimpleFile *file) {
 	_fieldF0 = file->readNumber();
 	_currentStatus = file->readNumber();
 	_string4 = file->readString();
-	_string5 = file->readString();
+	_soundName = file->readString();
 	_buttonFrame = file->readNumber() != 0;
 
 	CBackground::load(file);
@@ -68,7 +68,7 @@ void CSTButton::load(SimpleFile *file) {
 
 bool CSTButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	changeStatus(0);
-	// TODO: Obj6c stuff
+	soundProximity(_soundName, 100, 0, 0);
 
 	return true;
 }
diff --git a/engines/titanic/gfx/st_button.h b/engines/titanic/gfx/st_button.h
index d3dd5c4..e2f9aa3 100644
--- a/engines/titanic/gfx/st_button.h
+++ b/engines/titanic/gfx/st_button.h
@@ -40,7 +40,7 @@ private:
 	int _fieldF0;
 	int _currentStatus;
 	CString _string4;
-	CString _string5;
+	CString _soundName;
 	int _buttonFrame;
 public:
 	CLASSDEF


Commit: 78d03f9784d17f65b29e5b6836d23d8f494d3c7c
    https://github.com/scummvm/scummvm/commit/78d03f9784d17f65b29e5b6836d23d8f494d3c7c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-10T09:19:37-04:00

Commit Message:
TITANIC: Television video is now playing

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index feeabdb..cdc2db6 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -364,7 +364,7 @@ void CGameObject::fn1(int val1, int val2, int val3) {
 		if (movie)
 			movie->_gameObject = this;
 
-		_surface->proc34(val1, val2, val3, val3 != 0);
+		_surface->playMovie(val1, val2, val3, val3 != 0);
 
 		if (val3 & 0x10)
 			getGameManager()->_gameState.addMovie(_surface->_movie);
@@ -380,8 +380,13 @@ void CGameObject::changeStatus(int newStatus) {
 
 	CVideoSurface *surface = (newStatus & 4) ? _surface : nullptr;
 	if (_surface) {
-		_surface->proc32(newStatus, surface);
+		_surface->playMovie(newStatus, surface);
 		
+		// TODO: Figure out where to do this legitimately
+		OSMovie *movie = static_cast<OSMovie *>(_surface->_movie);
+		if (movie)
+			movie->_gameObject = this;
+
 		if (newStatus & 0x10) {
 			getGameManager()->_gameState.addMovie(_surface->_movie);
 		}
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 1086509..0ea67a1 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -34,8 +34,10 @@ namespace Titanic {
 
 class CVideoSurface;
 class CMouseDragStartMsg;
+class OSMovie;
 
 class CGameObject : public CNamedItem {
+	friend class OSMovie;
 	DECLARE_MESSAGE_MAP
 public:
 	static void *_v1;
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 79e0a7b..7593c74 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -61,12 +61,13 @@ OSMovie::~OSMovie() {
 	delete _video;
 }
 
-void OSMovie::proc8(int v1, CVideoSurface *surface) {
+void OSMovie::play(int v1, CVideoSurface *surface) {
 	warning("TODO: OSMovie::proc8");
+	play(0, 0, 0, 0);
 }
 
-void OSMovie::proc9(int v1, int v2, int v3, bool v4) {
-	warning("TODO: OSMovie::proc9");
+void OSMovie::play(int v1, int v2, int v3, bool v4) {
+	warning("TODO: OSMovie::play properly");
 	//setFrame(v1); ?
 	_video->start();
 	g_vm->_activeMovies.push_back(this);
@@ -172,6 +173,9 @@ void OSMovie::decodeFrame() {
 
 	// Unlock the surface
 	videoSurface->unlock();
+
+	if (_gameObject)
+		_gameObject->makeDirty();
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index 08d2940..b488d26 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -49,8 +49,16 @@ public:
 	CMovie();
 	virtual ~CMovie();
 
-	virtual void proc8(int v1, CVideoSurface *surface) = 0;
-	virtual void proc9(int v1, int v2, int v3, bool v4) = 0;
+	/**
+	 * Plays the movie
+	 */
+	virtual void play(int v1, CVideoSurface *surface) = 0;
+	
+	/**
+	 * Plays the movie
+	 */
+	virtual void play(int v1, int v2, int v3, bool v4) = 0;
+	
 	virtual void proc10() = 0;
 	virtual void proc11() = 0;
 	virtual void proc12() = 0;
@@ -87,8 +95,16 @@ public:
 	OSMovie(const CResourceKey &name, CVideoSurface *surface);
 	virtual ~OSMovie();
 
-	virtual void proc8(int v1, CVideoSurface *surface);
-	virtual void proc9(int v1, int v2, int v3, bool v4);
+	/**
+	 * Plays the movie
+	 */
+	virtual void play(int v1, CVideoSurface *surface);
+	
+	/**
+	 * Plays the movie
+	 */
+	virtual void play(int v1, int v2, int v3, bool v4);
+	
 	virtual void proc10();
 	virtual void proc11();
 	virtual void proc12();
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index c7b437e..3fb513c 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -379,14 +379,14 @@ void OSVideoSurface::shiftColors() {
 	// we already convert 16-bit surfaces as soon as they're loaded
 }
 
-void OSVideoSurface::proc32(int v1, CVideoSurface *surface) {
+void OSVideoSurface::playMovie(int newStatus, CVideoSurface *surface) {
 	if (loadIfReady() && _movie)
-		_movie->proc8(v1, surface);
+		_movie->play(newStatus, surface);
 }
 
-void OSVideoSurface::proc34(int v1, int v2, int v3, bool v4) {
+void OSVideoSurface::playMovie(int v1, int v2, int v3, bool v4) {
 	if (loadIfReady() && _movie) {
-		_movie->proc9(v1, v2, v3, v4);
+		_movie->play(v1, v2, v3, v4);
 	}
 }
 
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 335215d..c4947ca 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -154,8 +154,17 @@ public:
 	 */
 	virtual void shiftColors() = 0;
 
-	virtual void proc32(int v1, CVideoSurface *surface) = 0;
-	virtual void proc34(int v1, int v2, int v3, bool v4) = 0;
+	/**
+	 * Plays a movie, loading it from the specified _resource
+	 * if not already loaded
+	 */
+	virtual void playMovie(int newStatus, CVideoSurface *surface) = 0;
+
+	/**
+	 * Plays a movie, loading it from the specified _resource
+	 * if not already loaded
+	 */
+	virtual void playMovie(int v1, int v2, int v3, bool v4) = 0;
 
 	/**
 	 * Stops any movie currently attached to the surface
@@ -304,8 +313,17 @@ public:
 	 */
 	virtual void shiftColors();
 
-	virtual void proc32(int v1, CVideoSurface *surface);
-	virtual void proc34(int v1, int v2, int v3, bool v4);
+	/**
+	 * Plays a movie, loading it from the specified _resource
+	 * if not already loaded
+	 */
+	virtual void playMovie(int newStatus, CVideoSurface *surface);
+
+	/**
+	 * Plays a movie, loading it from the specified _resource
+	 * if not already loaded
+	 */
+	virtual void playMovie(int v1, int v2, int v3, bool v4);
 
 	/**
 	 * Stops any movie currently attached to the surface


Commit: 62b087adce4a0fdd0ff6a99ed5a9843ec0b722be
    https://github.com/scummvm/scummvm/commit/62b087adce4a0fdd0ff6a99ed5a9843ec0b722be
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-10T10:20:06-04:00

Commit Message:
TITANIC: Fleshing out CTelevision::MovieEndMsg

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/cdrom_tray.cpp
    engines/titanic/game/computer.cpp
    engines/titanic/game/get_lift_eye2.h
    engines/titanic/game/television.cpp
    engines/titanic/gfx/st_button.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index cdc2db6..425c227 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -439,18 +439,20 @@ int CGameObject::getSurface45() const {
 	return _surface ? _surface->proc45() : 0;
 }
 
-void CGameObject::soundProximity(const CString &name, int val2, int val3, int val4) {
+bool CGameObject::playSound(const CString &name, int val2, int val3, int val4) {
 	CProximity prox;
 	prox._field8 = val2;
 	prox._fieldC = val3;
 	prox._field20 = val4;
-	soundProximity(name, prox);
+	return playSound(name, prox);
 }
 
-void CGameObject::soundProximity(const CString &name, CProximity &prox) {
+bool CGameObject::playSound(const CString &name, CProximity &prox) {
 	if (prox._field28 == 2) {
 		// TODO
 	}
+
+	return false;
 }
 
 void CGameObject::gotoView(const CString &viewName, const CString &clipName) {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 0ea67a1..6acaeff 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -130,6 +130,16 @@ protected:
 	void setVisible(bool val);
 	void petFn2(int val);
 	void petFn3(CTreeItem *item);
+
+	/**
+	 * Plays a sound
+	 */
+	bool playSound(const CString &name, int val2, int val3, int val4);
+
+	/**
+	 * Plays a sound
+	 */
+	bool playSound(const CString &name, CProximity &prox);
 public:
 	int _field60;
 	CursorId _cursorId;
@@ -192,9 +202,6 @@ public:
 	 * Loads a frame
 	 */
 	void loadFrame(int frameNumber);
-
-	void soundProximity(const CString &name, int val2, int val3, int val4);
-	void soundProximity(const CString &name, CProximity &prox);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/cdrom_tray.cpp b/engines/titanic/game/cdrom_tray.cpp
index 77ee539..5f576d1 100644
--- a/engines/titanic/game/cdrom_tray.cpp
+++ b/engines/titanic/game/cdrom_tray.cpp
@@ -57,7 +57,7 @@ bool CCDROMTray::ActMsg(CActMsg *msg) {
 		if (_state) {
 			if (_insertedCD == "None") {
 				fn1(55, 65, 0);
-				soundProximity("a#35.wav", 50, 0, 0);
+				playSound("a#35.wav", 50, 0, 0);
 				_state = 0;
 			} else {
 				CTreeItem *treeItem = getRoom()->findByName(_insertedCD);
@@ -71,24 +71,24 @@ bool CCDROMTray::ActMsg(CActMsg *msg) {
 			}
 		} else if (_insertedCD == "None") {
 			fn1(44, 54, 0);
-			soundProximity("a#34.wav", 50, 0, 0);
+			playSound("a#34.wav", 50, 0, 0);
 			_state = 1;
 		} else if (_insertedCD == "newCD1" || _insertedCD == "newCD2") {
 			fn1(22, 32, 0);
-			soundProximity("a#34.wav", 50, 0, 0);
+			playSound("a#34.wav", 50, 0, 0);
 			_state = 1;
 		} else if (_insertedCD == "newSTCD") {
 			fn1(0, 10, 0);
-			soundProximity("a#34.wav", 50, 0, 0);
+			playSound("a#34.wav", 50, 0, 0);
 			_state = 1;
 		}
 	} else if (_state) {
 		if (msg->_action == "newCD1" || msg->_action == "newCD2") {
 			fn1(33, 43, 4);
-			soundProximity("a#35.wav", 50, 0, 0);
+			playSound("a#35.wav", 50, 0, 0);
 		} else if (msg->_action == "newSTCD") {
 			fn1(11, 21, 4);
-			soundProximity("a#35.wav", 50, 0, 0);
+			playSound("a#35.wav", 50, 0, 0);
 		} else {
 			return true;
 		}
diff --git a/engines/titanic/game/computer.cpp b/engines/titanic/game/computer.cpp
index 2b0f776..95330f6 100644
--- a/engines/titanic/game/computer.cpp
+++ b/engines/titanic/game/computer.cpp
@@ -46,7 +46,7 @@ void CComputer::load(SimpleFile *file) {
 
 bool CComputer::ActMsg(CActMsg *msg) {
 	if (_state) {
-		soundProximity("a#35.wav", 100, 0, 0);
+		playSound("a#35.wav", 100, 0, 0);
 		fn1(32, 42, 0);
 
 		if (msg->_action == "CD1")
@@ -66,11 +66,11 @@ bool CComputer::ActMsg(CActMsg *msg) {
 bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	if (_currentCD == "None") {
 		if (_state) {
-			soundProximity("a#35.wav", 100, 0, 0);
+			playSound("a#35.wav", 100, 0, 0);
 			fn1(11, 21, 0);
 			_state = 0;
 		} else {
-			soundProximity("a#34.wav", 100, 0, 0);
+			playSound("a#34.wav", 100, 0, 0);
 			fn1(0, 10, 0);
 			_state = 1;
 		}
@@ -81,7 +81,7 @@ bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 			actMsg.execute(_currentCD);
 			_currentCD = "None";
 		} else {
-			soundProximity("a#34.wav", 100, 0, 0);
+			playSound("a#34.wav", 100, 0, 0);
 			fn1(21, 31, 0);
 			_state = 1;
 		}
@@ -92,10 +92,10 @@ bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 
 bool CComputer::MovieEndMsg(CMovieEndMsg *msg) {
 	if (msg->_value2 == 90) {
-		soundProximity("a#32.wav", 100, 0, 0);
-		soundProximity("a#33.wav", 100, 0, 0);
-		soundProximity("a#31.wav", 100, 0, 0);
-		soundProximity("a#0.wav", 100, 0, 0);
+		playSound("a#32.wav", 100, 0, 0);
+		playSound("a#33.wav", 100, 0, 0);
+		playSound("a#31.wav", 100, 0, 0);
+		playSound("a#0.wav", 100, 0, 0);
 
 		gotoView("Home.Node 4.E", "_TRACK,3,e-cu,4,E");
 	}
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
index 16ccf83..d936559 100644
--- a/engines/titanic/game/get_lift_eye2.h
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CGetLiftEye2 : public CGameObject {
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
-private:
+public:
 	static CString *_v1;
 public:
 	CLASSDEF
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 5585cfc..2ad84d3 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -20,8 +20,10 @@
  *
  */
 
+#include "titanic/titanic.h"
 #include "titanic/game/television.h"
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/game/get_lift_eye2.h"
 
 namespace Titanic {
 
@@ -227,7 +229,34 @@ bool CTelevision::PETActivateMsg(CPETActivateMsg *msg) {
 }
 
 bool CTelevision::MovieEndMsg(CMovieEndMsg *msg) {
-	warning("TODO: CMovieEndMsg");
+	if (g_vm->getRandomNumber(6) == 0) {
+		CParrotSpeakMsg parrotMsg("Television", "");
+		parrotMsg.execute("PerchedParrot");
+	}
+
+	if (_fieldE0 == 3 && compareRoomNameTo("SGTState") && !getState8()) {
+		playSound("z#47.wav", 100, 0, 0);
+		_fieldF0 = playSound("b#20.wav", 100, 0, 0);
+		CTreeItem *magazine = getRoot()->findByName("Magazine");
+
+		if (magazine) {
+			warning("TODO: CTelevision::MovieEndMsg");
+		}
+
+		loadFrame(561);
+	} else if (_fieldE0 == 2) {
+		loadFrame(_v1);
+	} else if (_fieldE0 == 4 && _v5) {
+		if (_turnOn)
+			loadFrame(502);
+		else
+			warning("There is currently nothing available for your viewing pleasure on this channel.");
+	} else if (_fieldE0 == 5 && *CGetLiftEye2::_v1 != "NULL") {
+		loadFrame(393 + _v4);
+	} else {
+		warning("There is currently nothing available for your viewing pleasure on this channel.");
+	}
+
 	return true;
 }
 
diff --git a/engines/titanic/gfx/st_button.cpp b/engines/titanic/gfx/st_button.cpp
index 9a39581..827fb4a 100644
--- a/engines/titanic/gfx/st_button.cpp
+++ b/engines/titanic/gfx/st_button.cpp
@@ -68,7 +68,7 @@ void CSTButton::load(SimpleFile *file) {
 
 bool CSTButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	changeStatus(0);
-	soundProximity(_soundName, 100, 0, 0);
+	playSound(_soundName, 100, 0, 0);
 
 	return true;
 }
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index e83d7d9..f83e728 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -122,6 +122,11 @@ public:
 	uint32 getFeatures() const;
 	bool isDemo() const;
 	Common::Language getLanguage() const;
+
+	/**
+	 * Gets a random number
+	 */
+	uint getRandomNumber(uint max) { return _randomSource.getRandomNumber(max); }
 };
 
 extern TitanicEngine *g_vm;


Commit: 1ee3f334d39be6944e643c22cd376d5ae4ffaaf5
    https://github.com/scummvm/scummvm/commit/1ee3f334d39be6944e643c22cd376d5ae4ffaaf5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-04-10T14:40:59-04:00

Commit Message:
TITANIC: Change back to using original AVIDecoder

Changed paths:
  R engines/titanic/support/avi_decoder.cpp
  R engines/titanic/support/avi_decoder.h
    engines/titanic/module.mk
    engines/titanic/support/mouse_cursor.cpp
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 7a142ea..be9a467 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -422,7 +422,6 @@ MODULE_OBJS := \
 	star_control/star_control_sub13.o \
 	star_control/star_control_sub14.o \
 	star_control/star_control_sub15.o \
-	support/avi_decoder.o \
 	support/direct_draw.o \
 	support/direct_draw_surface.o \
 	support/files_manager.o \
diff --git a/engines/titanic/support/avi_decoder.cpp b/engines/titanic/support/avi_decoder.cpp
deleted file mode 100644
index 578e3a9..0000000
--- a/engines/titanic/support/avi_decoder.cpp
+++ /dev/null
@@ -1,949 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/stream.h"
-#include "common/system.h"
-#include "common/textconsole.h"
-
-#include "audio/audiostream.h"
-#include "audio/mixer.h"
-
-#include "titanic/support/avi_decoder.h"
-
-// Audio Codecs
-#include "audio/decoders/adpcm.h"
-#include "audio/decoders/mp3.h"
-#include "audio/decoders/raw.h"
-
-// Video Codecs
-#include "image/codecs/codec.h"
-
-namespace Titanic {
-
-#define UNKNOWN_HEADER(a) error("Unknown header found -- \'%s\'", tag2str(a))
-
-// IDs used throughout the AVI files
-// that will be handled by this player
-#define ID_RIFF MKTAG('R','I','F','F')
-#define ID_AVI  MKTAG('A','V','I',' ')
-#define ID_LIST MKTAG('L','I','S','T')
-#define ID_HDRL MKTAG('h','d','r','l')
-#define ID_AVIH MKTAG('a','v','i','h')
-#define ID_STRL MKTAG('s','t','r','l')
-#define ID_STRH MKTAG('s','t','r','h')
-#define ID_VIDS MKTAG('v','i','d','s')
-#define ID_AUDS MKTAG('a','u','d','s')
-#define ID_MIDS MKTAG('m','i','d','s')
-#define ID_TXTS MKTAG('t','x','t','s')
-#define ID_JUNK MKTAG('J','U','N','K')
-#define ID_JUNQ MKTAG('J','U','N','Q')
-#define ID_DMLH MKTAG('d','m','l','h')
-#define ID_STRF MKTAG('s','t','r','f')
-#define ID_MOVI MKTAG('m','o','v','i')
-#define ID_REC  MKTAG('r','e','c',' ')
-#define ID_VEDT MKTAG('v','e','d','t')
-#define ID_IDX1 MKTAG('i','d','x','1')
-#define ID_STRD MKTAG('s','t','r','d')
-#define ID_INFO MKTAG('I','N','F','O')
-#define ID_ISFT MKTAG('I','S','F','T')
-#define ID_DISP MKTAG('D','I','S','P')
-#define ID_PRMI MKTAG('P','R','M','I')
-#define ID_STRN MKTAG('s','t','r','n')
-
-// Stream Types
-enum {
-	kStreamTypePaletteChange = MKTAG16('p', 'c'),
-	kStreamTypeAudio         = MKTAG16('w', 'b')
-};
-
-
-AVIDecoder::AVIDecoder(Audio::Mixer::SoundType soundType) : _frameRateOverride(0), _soundType(soundType) {
-	initCommon();
-}
-
-AVIDecoder::AVIDecoder(const Common::Rational &frameRateOverride, Audio::Mixer::SoundType soundType)
-		: _frameRateOverride(frameRateOverride), _soundType(soundType) {
-	initCommon();
-}
-
-AVIDecoder::~AVIDecoder() {
-	close();
-}
-
-AVIDecoder::AVIAudioTrack *AVIDecoder::createAudioTrack(AVIStreamHeader sHeader, PCMWaveFormat wvInfo) {
-	return new AVIAudioTrack(sHeader, wvInfo, _soundType);
-}
-
-void AVIDecoder::initCommon() {
-	_decodedHeader = false;
-	_foundMovieList = false;
-	_movieListStart = 0;
-	_movieListEnd = 0;
-	_fileStream = 0;
-	memset(&_header, 0, sizeof(_header));
-}
-
-bool AVIDecoder::isSeekable() const {
-	// Only videos with an index can seek
-	// Anyone else who wants to seek is crazy.
-	return isVideoLoaded() && !_indexEntries.empty();
-}
-
-bool AVIDecoder::parseNextChunk() {
-	uint32 tag = _fileStream->readUint32BE();
-	uint32 size = _fileStream->readUint32LE();
-
-	if (_fileStream->eos())
-		return false;
-
-	debug(3, "Decoding tag %s", tag2str(tag));
-
-	switch (tag) {
-	case ID_LIST:
-		handleList(size);
-		break;
-	case ID_AVIH:
-		_header.size = size;
-		_header.microSecondsPerFrame = _fileStream->readUint32LE();
-		_header.maxBytesPerSecond = _fileStream->readUint32LE();
-		_header.padding = _fileStream->readUint32LE();
-		_header.flags = _fileStream->readUint32LE();
-		_header.totalFrames = _fileStream->readUint32LE();
-		_header.initialFrames = _fileStream->readUint32LE();
-		_header.streams = _fileStream->readUint32LE();
-		_header.bufferSize = _fileStream->readUint32LE();
-		_header.width = _fileStream->readUint32LE();
-		_header.height = _fileStream->readUint32LE();
-		// Ignore 16 bytes of reserved data
-		_fileStream->skip(16);
-		break;
-	case ID_STRH:
-		handleStreamHeader(size);
-		break;
-	case ID_STRD: // Extra stream info, safe to ignore
-	case ID_VEDT: // Unknown, safe to ignore
-	case ID_JUNK: // Alignment bytes, should be ignored
-	case ID_JUNQ: // Same as JUNK, safe to ignore
-	case ID_ISFT: // Metadata, safe to ignore
-	case ID_DISP: // Metadata, should be safe to ignore
-	case ID_STRN: // Metadata, safe to ignore
-	case ID_DMLH: // OpenDML extension, contains an extra total frames field, safe to ignore
-		skipChunk(size);
-		break;
-	case ID_IDX1:
-		readOldIndex(size);
-		break;
-	case 0:
-		return false;
-	default:
-		error("Unknown tag \'%s\' found", tag2str(tag));
-	}
-
-	return true;
-}
-
-void AVIDecoder::skipChunk(uint32 size) {
-	// Make sure we're aligned on a word boundary
-	_fileStream->skip(size + (size & 1));
-}
-
-void AVIDecoder::handleList(uint32 listSize) {
-	uint32 listType = _fileStream->readUint32BE();
-	listSize -= 4; // Subtract away listType's 4 bytes
-	uint32 curPos = _fileStream->pos();
-
-	debug(0, "Found LIST of type %s", tag2str(listType));
-
-	switch (listType) {
-	case ID_MOVI: // Movie List
-		// We found the movie block
-		_foundMovieList = true;
-		_movieListStart = curPos;
-		_movieListEnd = _movieListStart + listSize + (listSize & 1);
-		_fileStream->skip(listSize);
-		return;
-	case ID_HDRL: // Header List
-		// Mark the header as decoded
-		_decodedHeader = true;
-		break;
-	case ID_INFO: // Metadata
-	case ID_PRMI: // Adobe Premiere metadata, safe to ignore
-		// Ignore metadata
-		_fileStream->skip(listSize);
-		return;
-	case ID_STRL: // Stream list
-	default:      // (Just hope we can parse it!)
-		break;
-	}
-
-	while ((_fileStream->pos() - curPos) < listSize)
-		parseNextChunk();
-}
-
-void AVIDecoder::handleStreamHeader(uint32 size) {
-	AVIStreamHeader sHeader;
-	sHeader.size = size;
-	sHeader.streamType = _fileStream->readUint32BE();
-
-	if (sHeader.streamType == ID_MIDS || sHeader.streamType == ID_TXTS)
-		error("Unhandled MIDI/Text stream");
-
-	sHeader.streamHandler = _fileStream->readUint32BE();
-	sHeader.flags = _fileStream->readUint32LE();
-	sHeader.priority = _fileStream->readUint16LE();
-	sHeader.language = _fileStream->readUint16LE();
-	sHeader.initialFrames = _fileStream->readUint32LE();
-	sHeader.scale = _fileStream->readUint32LE();
-	sHeader.rate = _fileStream->readUint32LE();
-	sHeader.start = _fileStream->readUint32LE();
-	sHeader.length = _fileStream->readUint32LE();
-	sHeader.bufferSize = _fileStream->readUint32LE();
-	sHeader.quality = _fileStream->readUint32LE();
-	sHeader.sampleSize = _fileStream->readUint32LE();
-
-	_fileStream->skip(sHeader.size - 48); // Skip over the remainder of the chunk (frame)
-
-	if (_fileStream->readUint32BE() != ID_STRF)
-		error("Could not find STRF tag");
-
-	uint32 strfSize = _fileStream->readUint32LE();
-	uint32 startPos = _fileStream->pos();
-
-	if (sHeader.streamType == ID_VIDS) {
-		if (_frameRateOverride != 0) {
-			sHeader.rate = _frameRateOverride.getNumerator();
-			sHeader.scale = _frameRateOverride.getDenominator();
-		}
-
-		BitmapInfoHeader bmInfo;
-		bmInfo.size = _fileStream->readUint32LE();
-		bmInfo.width = _fileStream->readUint32LE();
-		bmInfo.height = _fileStream->readUint32LE();
-		bmInfo.planes = _fileStream->readUint16LE();
-		bmInfo.bitCount = _fileStream->readUint16LE();
-		bmInfo.compression = _fileStream->readUint32BE();
-		bmInfo.sizeImage = _fileStream->readUint32LE();
-		bmInfo.xPelsPerMeter = _fileStream->readUint32LE();
-		bmInfo.yPelsPerMeter = _fileStream->readUint32LE();
-		bmInfo.clrUsed = _fileStream->readUint32LE();
-		bmInfo.clrImportant = _fileStream->readUint32LE();
-
-		if (bmInfo.clrUsed == 0)
-			bmInfo.clrUsed = 256;
-
-		byte *initialPalette = 0;
-
-		if (bmInfo.bitCount == 8) {
-			initialPalette = new byte[256 * 3];
-			memset(initialPalette, 0, 256 * 3);
-
-			byte *palette = initialPalette;
-			for (uint32 i = 0; i < bmInfo.clrUsed; i++) {
-				palette[i * 3 + 2] = _fileStream->readByte();
-				palette[i * 3 + 1] = _fileStream->readByte();
-				palette[i * 3] = _fileStream->readByte();
-				_fileStream->readByte();
-			}
-		}
-
-		// WORKAROUND: For Titanic engine, the ycursors.avi file has two video tracks,
-		// so we do an explicit check below to ignore any second video track
-		if (getFrameCount() == 0)
-			addTrack(new AVIVideoTrack(_header.totalFrames, sHeader, bmInfo, initialPalette));
-	} else if (sHeader.streamType == ID_AUDS) {
-		PCMWaveFormat wvInfo;
-		wvInfo.tag = _fileStream->readUint16LE();
-		wvInfo.channels = _fileStream->readUint16LE();
-		wvInfo.samplesPerSec = _fileStream->readUint32LE();
-		wvInfo.avgBytesPerSec = _fileStream->readUint32LE();
-		wvInfo.blockAlign = _fileStream->readUint16LE();
-		wvInfo.size = _fileStream->readUint16LE();
-
-		// AVI seems to treat the sampleSize as including the second
-		// channel as well, so divide for our sake.
-		if (wvInfo.channels == 2)
-			sHeader.sampleSize /= 2;
-
-		AVIAudioTrack *track = createAudioTrack(sHeader, wvInfo);
-		track->createAudioStream();
-		addTrack(track);
-	}
-
-	// Ensure that we're at the end of the chunk
-	_fileStream->seek(startPos + strfSize);
-}
-
-bool AVIDecoder::loadStream(Common::SeekableReadStream *stream) {
-	close();
-
-	uint32 riffTag = stream->readUint32BE();
-	if (riffTag != ID_RIFF) {
-		warning("Failed to find RIFF header");
-		return false;
-	}
-
-	/* uint32 fileSize = */ stream->readUint32LE();
-	uint32 riffType = stream->readUint32BE();
-
-	if (riffType != ID_AVI) {
-		warning("RIFF not an AVI file");
-		return false;
-	}
-
-	_fileStream = stream;
-
-	// Go through all chunks in the file
-	while (parseNextChunk())
-		;
-
-	if (!_decodedHeader) {
-		warning("Failed to parse AVI header");
-		close();
-		return false;
-	}
-
-	if (!_foundMovieList) {
-		warning("Failed to find 'MOVI' list");
-		close();
-		return false;
-	}
-
-	// Create the status entries
-	uint32 index = 0;
-	for (TrackListIterator it = getTrackListBegin(); it != getTrackListEnd(); it++, index++) {
-		TrackStatus status;
-		status.track = *it;
-		status.index = index;
-		status.chunkSearchOffset = _movieListStart;
-
-		if ((*it)->getTrackType() == Track::kTrackTypeVideo) {
-			if (_videoTracks.size() == 0)
-				_videoTracks.push_back(status);
-		} else {
-			if (_audioTracks.size() == 0)
-				_audioTracks.push_back(status);
-		}
-	}
-
-	if (_videoTracks.size() != 1) {
-		warning("Unhandled AVI video track count: %d", _videoTracks.size());
-		close();
-		return false;
-	}
-
-	// Check if this is a special Duck Truemotion video
-	checkTruemotion1();
-
-	return true;
-}
-
-void AVIDecoder::close() {
-	VideoDecoder::close();
-
-	delete _fileStream;
-	_fileStream = 0;
-	_decodedHeader = false;
-	_foundMovieList = false;
-	_movieListStart = 0;
-	_movieListEnd = 0;
-
-	_indexEntries.clear();
-	memset(&_header, 0, sizeof(_header));
-
-	_videoTracks.clear();
-	_audioTracks.clear();
-}
-
-void AVIDecoder::readNextPacket() {
-	// Shouldn't get this unless called on a non-open video
-	if (_videoTracks.empty())
-		return;
-
-	// Get the video frame first
-	handleNextPacket(_videoTracks[0]);
-
-	// Handle audio tracks next
-	for (uint32 i = 0; i < _audioTracks.size(); i++)
-		handleNextPacket(_audioTracks[i]);
-}
-
-void AVIDecoder::handleNextPacket(TrackStatus &status) {
-	// If there's no more to search, bail out
-	if (status.chunkSearchOffset + 8 >= _movieListEnd) {
-		if (status.track->getTrackType() == Track::kTrackTypeVideo) {
-			// Horrible AVI video has a premature end
-			// Force the frame to be the last frame
-			debug(0, "Forcing end of AVI video");
-			((AVIVideoTrack *)status.track)->forceTrackEnd();
-		}
-
-		return;
-	}
-
-	// See if audio needs to be buffered and break out if not
-	if (status.track->getTrackType() == Track::kTrackTypeAudio && !shouldQueueAudio(status))
-		return;
-
-	// Seek to where we shall start searching
-	_fileStream->seek(status.chunkSearchOffset);
-
-	for (;;) {
-		// If there's no more to search, bail out
-		if ((uint32)_fileStream->pos() + 8 >= _movieListEnd) {
-			if (status.track->getTrackType() == Track::kTrackTypeVideo) {
-				// Horrible AVI video has a premature end
-				// Force the frame to be the last frame
-				debug(0, "Forcing end of AVI video");
-				((AVIVideoTrack *)status.track)->forceTrackEnd();
-			}
-
-			break;
-		}
-
-		uint32 nextTag = _fileStream->readUint32BE();
-		uint32 size = _fileStream->readUint32LE();
-
-		if (nextTag == ID_LIST) {
-			// A list of audio/video chunks
-			if (_fileStream->readUint32BE() != ID_REC)
-				error("Expected 'rec ' LIST");
-
-			continue;
-		} else if (nextTag == ID_JUNK || nextTag == ID_IDX1) {
-			skipChunk(size);
-			continue;
-		}
-
-		// Only accept chunks for this stream
-		uint32 streamIndex = getStreamIndex(nextTag);
-		if (streamIndex != status.index) {
-			skipChunk(size);
-			continue;
-		}
-
-		Common::SeekableReadStream *chunk = 0;
-
-		if (size != 0) {
-			chunk = _fileStream->readStream(size);
-			_fileStream->skip(size & 1);
-		}
-
-		if (status.track->getTrackType() == Track::kTrackTypeAudio) {
-			if (getStreamType(nextTag) != kStreamTypeAudio)
-				error("Invalid audio track tag '%s'", tag2str(nextTag));
-
-			assert(chunk);
-			((AVIAudioTrack *)status.track)->queueSound(chunk);
-
-			// Break out if we have enough audio
-			if (!shouldQueueAudio(status))
-				break;
-		} else {
-			AVIVideoTrack *videoTrack = (AVIVideoTrack *)status.track;
-
-			if (getStreamType(nextTag) == kStreamTypePaletteChange) {
-				// Palette Change
-				videoTrack->loadPaletteFromChunk(chunk);
-			} else {
-				// Otherwise, assume it's a compressed frame
-				videoTrack->decodeFrame(chunk);
-				break;
-			}
-		}
-	}
-
-	// Start us off in this position next time
-	status.chunkSearchOffset = _fileStream->pos();
-}
-
-bool AVIDecoder::shouldQueueAudio(TrackStatus& status) {
-	// Sanity check:
-	if (status.track->getTrackType() != Track::kTrackTypeAudio)
-		return false;
-
-	// If video is done, make sure that the rest of the audio is queued
-	// (I guess this is also really a sanity check)
-	AVIVideoTrack *videoTrack = (AVIVideoTrack *)_videoTracks[0].track;
-	if (videoTrack->endOfTrack())
-		return true;
-
-	// Being three frames ahead should be enough for any video.
-	return ((AVIAudioTrack *)status.track)->getCurChunk() < (uint32)(videoTrack->getCurFrame() + 3);
-}
-
-bool AVIDecoder::rewind() {
-	if (!VideoDecoder::rewind())
-		return false;
-
-	for (uint32 i = 0; i < _videoTracks.size(); i++)
-		_videoTracks[i].chunkSearchOffset = _movieListStart;
-
-	for (uint32 i = 0; i < _audioTracks.size(); i++)
-		_audioTracks[i].chunkSearchOffset = _movieListStart;
-
-	return true;
-}
-
-bool AVIDecoder::seekIntern(const Audio::Timestamp &time) {
-	// Can't seek beyond the end
-	if (time > getDuration())
-		return false;
-
-	// Get our video
-	AVIVideoTrack *videoTrack = (AVIVideoTrack *)_videoTracks[0].track;
-	uint32 videoIndex = _videoTracks[0].index;
-
-	// If we seek directly to the end, just mark the tracks as over
-	if (time == getDuration()) {
-		videoTrack->setCurFrame(videoTrack->getFrameCount() - 1);
-
-		for (TrackListIterator it = getTrackListBegin(); it != getTrackListEnd(); it++)
-			if ((*it)->getTrackType() == Track::kTrackTypeAudio)
-				((AVIAudioTrack *)*it)->resetStream();
-
-		return true;
-	}
-
-	// Get the frame we should be on at this time
-	uint frame = videoTrack->getFrameAtTime(time);
-
-	// Reset any palette, if necessary
-	videoTrack->useInitialPalette();
-
-	int lastKeyFrame = -1;
-	int frameIndex = -1;
-	uint curFrame = 0;
-
-	// Go through and figure out where we should be
-	// If there's a palette, we need to find the palette too
-	for (uint32 i = 0; i < _indexEntries.size(); i++) {
-		const OldIndex &index = _indexEntries[i];
-
-		// We don't care about RECs
-		if (index.id == ID_REC)
-			continue;
-
-		// We're only looking at entries for this track
-		if (getStreamIndex(index.id) != videoIndex)
-			continue;
-
-		uint16 streamType = getStreamType(index.id);
-
-		if (streamType == kStreamTypePaletteChange) {
-			// We need to handle any palette change we see since there's no
-			// flag to tell if this is a "key" palette.
-			// Decode the palette
-			_fileStream->seek(_indexEntries[i].offset + 8);
-			Common::SeekableReadStream *chunk = 0;
-
-			if (_indexEntries[i].size != 0)
-				chunk = _fileStream->readStream(_indexEntries[i].size);
-
-			videoTrack->loadPaletteFromChunk(chunk);
-		} else {
-			// Check to see if this is a keyframe
-			// The first frame has to be a keyframe
-			if ((_indexEntries[i].flags & AVIIF_INDEX) || curFrame == 0)
-				lastKeyFrame = i;
-
-			// Did we find the target frame?
-			if (frame == curFrame) {
-				frameIndex = i;
-				break;
-			}
-
-			curFrame++;
-		}
-	}
-
-	if (frameIndex < 0) // This shouldn't happen.
-		return false;
-
-	// Update all the audio tracks
-	for (uint32 i = 0; i < _audioTracks.size(); i++) {
-		AVIAudioTrack *audioTrack = (AVIAudioTrack *)_audioTracks[i].track;
-
-		// Recreate the audio stream
-		audioTrack->resetStream();
-
-		// Set the chunk index for the track
-		audioTrack->setCurChunk(frame);
-
-		uint32 chunksFound = 0;
-		for (uint32 j = 0; j < _indexEntries.size(); j++) {
-			const OldIndex &index = _indexEntries[j];
-
-			// Continue ignoring RECs
-			if (index.id == ID_REC)
-				continue;
-
-			if (getStreamIndex(index.id) == _audioTracks[i].index) {
-				if (chunksFound == frame) {
-					_fileStream->seek(index.offset + 8);
-					Common::SeekableReadStream *audioChunk = _fileStream->readStream(index.size);
-					audioTrack->queueSound(audioChunk);
-					_audioTracks[i].chunkSearchOffset = (j == _indexEntries.size() - 1) ? _movieListEnd : _indexEntries[j + 1].offset;
-					break;
-				}
-
-				chunksFound++;
-			}
-		}
-
-		// Skip any audio to bring us to the right time
-		audioTrack->skipAudio(time, videoTrack->getFrameTime(frame));
-	}
-
-	// Decode from keyFrame to curFrame - 1
-	for (int i = lastKeyFrame; i < frameIndex; i++) {
-		if (_indexEntries[i].id == ID_REC)
-			continue;
-
-		if (getStreamIndex(_indexEntries[i].id) != videoIndex)
-			continue;
-
-		uint16 streamType = getStreamType(_indexEntries[i].id);
-
-		// Ignore palettes, they were already handled
-		if (streamType == kStreamTypePaletteChange)
-			continue;
-
-		// Frame, hopefully
-		_fileStream->seek(_indexEntries[i].offset + 8);
-		Common::SeekableReadStream *chunk = 0;
-
-		if (_indexEntries[i].size != 0)
-			chunk = _fileStream->readStream(_indexEntries[i].size);
-
-		videoTrack->decodeFrame(chunk);
-	}
-
-	// Set the video track's frame
-	videoTrack->setCurFrame((int)frame - 1);
-
-	// Set the video track's search offset to the right spot
-	_videoTracks[0].chunkSearchOffset = _indexEntries[frameIndex].offset;
-	return true;
-}
-
-byte AVIDecoder::getStreamIndex(uint32 tag) const {
-	char string[3];
-	WRITE_BE_UINT16(string, tag >> 16);
-	string[2] = 0;
-	return strtol(string, 0, 16);
-}
-
-void AVIDecoder::readOldIndex(uint32 size) {
-	uint32 entryCount = size / 16;
-
-	debug(0, "Old Index: %d entries", entryCount);
-
-	if (entryCount == 0)
-		return;
-
-	// Read the first index separately
-	OldIndex firstEntry;
-	firstEntry.id = _fileStream->readUint32BE();
-	firstEntry.flags = _fileStream->readUint32LE();
-	firstEntry.offset = _fileStream->readUint32LE();
-	firstEntry.size = _fileStream->readUint32LE();
-
-	// Check if the offset is already absolute
-	// If it's absolute, the offset will equal the start of the movie list
-	bool isAbsolute = firstEntry.offset == _movieListStart;
-
-	debug(1, "Old index is %s", isAbsolute ? "absolute" : "relative");
-
-	if (!isAbsolute)
-		firstEntry.offset += _movieListStart - 4;
-
-	debug(0, "Index 0: Tag '%s', Offset = %d, Size = %d (Flags = %d)", tag2str(firstEntry.id), firstEntry.offset, firstEntry.size, firstEntry.flags);
-	_indexEntries.push_back(firstEntry);
-
-	for (uint32 i = 1; i < entryCount; i++) {
-		OldIndex indexEntry;
-		indexEntry.id = _fileStream->readUint32BE();
-		indexEntry.flags = _fileStream->readUint32LE();
-		indexEntry.offset = _fileStream->readUint32LE();
-		indexEntry.size = _fileStream->readUint32LE();
-
-		// Adjust to absolute, if necessary
-		if (!isAbsolute)
-			indexEntry.offset += _movieListStart - 4;
-
-		_indexEntries.push_back(indexEntry);
-		debug(0, "Index %d: Tag '%s', Offset = %d, Size = %d (Flags = %d)", i, tag2str(indexEntry.id), indexEntry.offset, indexEntry.size, indexEntry.flags);
-	}
-}
-
-void AVIDecoder::checkTruemotion1() {
-	// If we got here from loadStream(), we know the track is valid
-	assert(!_videoTracks.empty());
-
-	TrackStatus &status = _videoTracks[0];
-	AVIVideoTrack *track = (AVIVideoTrack *)status.track;
-
-	// Ignore non-truemotion tracks
-	if (!track->isTruemotion1())
-		return;
-
-	// Read the next video packet
-	handleNextPacket(status);
-
-	const Graphics::Surface *frame = track->decodeNextFrame();
-	if (!frame) {
-		rewind();
-		return;
-	}
-
-	// Fill in the width/height based on the frame's width/height
-	_header.width = frame->w;
-	_header.height = frame->h;
-	track->forceDimensions(frame->w, frame->h);
-
-	// Rewind us back to the beginning
-	rewind();
-}
-
-Video::VideoDecoder::AudioTrack *AVIDecoder::getAudioTrack(int index) {
-	// AVI audio track indexes are relative to the first track
-	Track *track = getTrack(index);
-
-	if (!track || track->getTrackType() != Track::kTrackTypeAudio)
-		return 0;
-
-	return (AudioTrack *)track;
-}
-
-AVIDecoder::AVIVideoTrack::AVIVideoTrack(int frameCount, const AVIStreamHeader &streamHeader, const BitmapInfoHeader &bitmapInfoHeader, byte *initialPalette)
-		: _frameCount(frameCount), _vidsHeader(streamHeader), _bmInfo(bitmapInfoHeader), _initialPalette(initialPalette) {
-	_videoCodec = createCodec();
-	_lastFrame = 0;
-	_curFrame = -1;
-
-	useInitialPalette();
-}
-
-AVIDecoder::AVIVideoTrack::~AVIVideoTrack() {
-	delete _videoCodec;
-	delete[] _initialPalette;
-}
-
-void AVIDecoder::AVIVideoTrack::decodeFrame(Common::SeekableReadStream *stream) {
-	if (stream) {
-		if (_videoCodec)
-			_lastFrame = _videoCodec->decodeFrame(*stream);
-	} else {
-		// Empty frame
-		_lastFrame = 0;
-	}
-
-	delete stream;
-	_curFrame++;
-}
-
-Graphics::PixelFormat AVIDecoder::AVIVideoTrack::getPixelFormat() const {
-	if (_videoCodec)
-		return _videoCodec->getPixelFormat();
-
-	return Graphics::PixelFormat();
-}
-
-void AVIDecoder::AVIVideoTrack::loadPaletteFromChunk(Common::SeekableReadStream *chunk) {
-	assert(chunk);
-	byte firstEntry = chunk->readByte();
-	uint16 numEntries = chunk->readByte();
-	chunk->readUint16LE(); // Reserved
-
-	// 0 entries means all colors are going to be changed
-	if (numEntries == 0)
-		numEntries = 256;
-
-	for (uint16 i = firstEntry; i < numEntries + firstEntry; i++) {
-		_palette[i * 3] = chunk->readByte();
-		_palette[i * 3 + 1] = chunk->readByte();
-		_palette[i * 3 + 2] = chunk->readByte();
-		chunk->readByte(); // Flags that don't serve us any purpose
-	}
-
-	delete chunk;
-	_dirtyPalette = true;
-}
-
-void AVIDecoder::AVIVideoTrack::useInitialPalette() {
-	_dirtyPalette = false;
-
-	if (_initialPalette) {
-		memcpy(_palette, _initialPalette, sizeof(_palette));
-		_dirtyPalette = true;
-	}
-}
-
-bool AVIDecoder::AVIVideoTrack::isTruemotion1() const {
-	return _bmInfo.compression == MKTAG('D', 'U', 'C', 'K') || _bmInfo.compression == MKTAG('d', 'u', 'c', 'k');
-}
-
-void AVIDecoder::AVIVideoTrack::forceDimensions(uint16 width, uint16 height) {
-	_bmInfo.width = width;
-	_bmInfo.height = height;
-}
-
-bool AVIDecoder::AVIVideoTrack::rewind() {
-	_curFrame = -1;
-
-	useInitialPalette();
-
-	delete _videoCodec;
-	_videoCodec = createCodec();
-	_lastFrame = 0;
-	return true;
-}
-
-Image::Codec *AVIDecoder::AVIVideoTrack::createCodec() {
-	return Image::createBitmapCodec(_bmInfo.compression, _bmInfo.width, _bmInfo.height, _bmInfo.bitCount);
-}
-
-void AVIDecoder::AVIVideoTrack::forceTrackEnd() {
-	_curFrame = _frameCount - 1;
-}
-
-const byte *AVIDecoder::AVIVideoTrack::getPalette() const {
-	if (_videoCodec && _videoCodec->containsPalette())
-		return _videoCodec->getPalette();
-
-	_dirtyPalette = false;
-	return _palette;
-}
-
-bool AVIDecoder::AVIVideoTrack::hasDirtyPalette() const {
-	if (_videoCodec && _videoCodec->containsPalette())
-		return _videoCodec->hasDirtyPalette();
-
-	return _dirtyPalette;
-}
-
-bool AVIDecoder::AVIVideoTrack::canDither() const {
-	return _videoCodec && _videoCodec->canDither(Image::Codec::kDitherTypeVFW);
-}
-
-void AVIDecoder::AVIVideoTrack::setDither(const byte *palette) {
-	assert(_videoCodec);
-	_videoCodec->setDither(Image::Codec::kDitherTypeVFW, palette);
-}
-
-AVIDecoder::AVIAudioTrack::AVIAudioTrack(const AVIStreamHeader &streamHeader, const PCMWaveFormat &waveFormat, Audio::Mixer::SoundType soundType)
-		: _audsHeader(streamHeader), _wvInfo(waveFormat), _soundType(soundType), _audioStream(0), _packetStream(0), _curChunk(0) {
-}
-
-AVIDecoder::AVIAudioTrack::~AVIAudioTrack() {
-	delete _audioStream;
-}
-
-void AVIDecoder::AVIAudioTrack::queueSound(Common::SeekableReadStream *stream) {
-	if (_packetStream)
-		_packetStream->queuePacket(stream);
-	else
-		delete stream;
-
-	_curChunk++;
-}
-
-void AVIDecoder::AVIAudioTrack::skipAudio(const Audio::Timestamp &time, const Audio::Timestamp &frameTime) {
-	Audio::Timestamp timeDiff = time.convertToFramerate(_wvInfo.samplesPerSec) - frameTime.convertToFramerate(_wvInfo.samplesPerSec);
-	int skipFrames = timeDiff.totalNumberOfFrames();
-
-	if (skipFrames <= 0)
-		return;
-
-	Audio::AudioStream *audioStream = getAudioStream();
-	if (!audioStream)
-		return;
-
-	if (audioStream->isStereo())
-		skipFrames *= 2;
-
-	int16 *tempBuffer = new int16[skipFrames];
-	audioStream->readBuffer(tempBuffer, skipFrames);
-	delete[] tempBuffer;
-}
-
-void AVIDecoder::AVIAudioTrack::resetStream() {
-	delete _audioStream;
-	createAudioStream();
-	_curChunk = 0;
-}
-
-bool AVIDecoder::AVIAudioTrack::rewind() {
-	resetStream();
-	return true;
-}
-
-void AVIDecoder::AVIAudioTrack::createAudioStream() {
-	_packetStream = 0;
-
-	switch (_wvInfo.tag) {
-	case kWaveFormatPCM: {
-		byte flags = 0;
-		if (_audsHeader.sampleSize == 2)
-			flags |= Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN;
-		else
-			flags |= Audio::FLAG_UNSIGNED;
-
-		if (_wvInfo.channels == 2)
-			flags |= Audio::FLAG_STEREO;
-
-		_packetStream = Audio::makePacketizedRawStream(_wvInfo.samplesPerSec, flags);
-		break;
-	}
-	case kWaveFormatMSADPCM:
-		_packetStream = Audio::makePacketizedADPCMStream(Audio::kADPCMMS, _wvInfo.samplesPerSec, _wvInfo.channels, _wvInfo.blockAlign);
-		break;
-	case kWaveFormatMSIMAADPCM:
-		_packetStream = Audio::makePacketizedADPCMStream(Audio::kADPCMMSIma, _wvInfo.samplesPerSec, _wvInfo.channels, _wvInfo.blockAlign);
-		break;
-	case kWaveFormatDK3:
-		_packetStream = Audio::makePacketizedADPCMStream(Audio::kADPCMDK3, _wvInfo.samplesPerSec, _wvInfo.channels, _wvInfo.blockAlign);
-		break;
-	case kWaveFormatMP3:
-#ifdef USE_MAD
-		_packetStream = Audio::makePacketizedMP3Stream(_wvInfo.channels, _wvInfo.samplesPerSec);
-#else
-		warning("AVI MP3 stream found, but no libmad support compiled in");
-#endif
-		break;
-	case kWaveFormatNone:
-		break;
-	default:
-		warning("Unsupported AVI audio format %d", _wvInfo.tag);
-		break;
-	}
-
-	if (_packetStream)
-		_audioStream = _packetStream;
-	else
-		_audioStream = Audio::makeNullAudioStream();
-}
-
-AVIDecoder::TrackStatus::TrackStatus() : track(0), chunkSearchOffset(0) {
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/support/avi_decoder.h b/engines/titanic/support/avi_decoder.h
deleted file mode 100644
index acc33cb..0000000
--- a/engines/titanic/support/avi_decoder.h
+++ /dev/null
@@ -1,285 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_AVI_DECODER_H
-#define TITANIC_AVI_DECODER_H
-
-#include "common/array.h"
-#include "common/rational.h"
-#include "common/rect.h"
-#include "common/str.h"
-
-#include "video/video_decoder.h"
-#include "audio/mixer.h"
-
-namespace Audio {
-class AudioStream;
-class PacketizedAudioStream;
-}
-
-namespace Common {
-class SeekableReadStream;
-}
-
-namespace Graphics {
-struct PixelFormat;
-}
-
-namespace Image {
-class Codec;
-}
-
-namespace Titanic {
-
-/**
- * Modified AVI Decoder used by Titanic engine.
- */
-class AVIDecoder : public Video::VideoDecoder {
-public:
-	AVIDecoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType);
-	AVIDecoder(const Common::Rational &frameRateOverride, Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType);
-	virtual ~AVIDecoder();
-
-	bool loadStream(Common::SeekableReadStream *stream);
-	void close();
-	uint16 getWidth() const { return _header.width; }
-	uint16 getHeight() const { return _header.height; }
-
-	bool rewind();
-	bool isRewindable() const { return true; }
-	bool isSeekable() const;
-
-protected:
-	// VideoDecoder API
-	void readNextPacket();
-	bool seekIntern(const Audio::Timestamp &time);
-	bool supportsAudioTrackSwitching() const { return true; }
-	AudioTrack *getAudioTrack(int index);
-
-	struct BitmapInfoHeader {
-		uint32 size;
-		uint32 width;
-		uint32 height;
-		uint16 planes;
-		uint16 bitCount;
-		uint32 compression;
-		uint32 sizeImage;
-		uint32 xPelsPerMeter;
-		uint32 yPelsPerMeter;
-		uint32 clrUsed;
-		uint32 clrImportant;
-	};
-
-	struct WaveFormat {
-		uint16 tag;
-		uint16 channels;
-		uint32 samplesPerSec;
-		uint32 avgBytesPerSec;
-		uint16 blockAlign;
-	};
-
-	struct PCMWaveFormat : public WaveFormat {
-		uint16 size;
-	};
-
-	struct WaveFormatEX : public WaveFormat {
-		uint16 bitsPerSample;
-		uint16 size;
-	};
-
-	struct OldIndex {
-		uint32 id;
-		uint32 flags;
-		uint32 offset;
-		uint32 size;
-	};
-
-	// Index Flags
-	enum IndexFlags {
-		AVIIF_INDEX = 0x10
-	};
-
-	struct AVIHeader {
-		uint32 size;
-		uint32 microSecondsPerFrame;
-		uint32 maxBytesPerSecond;
-		uint32 padding;
-		uint32 flags;
-		uint32 totalFrames;
-		uint32 initialFrames;
-		uint32 streams;
-		uint32 bufferSize;
-		uint32 width;
-		uint32 height;
-	};
-
-	// Flags from the AVIHeader
-	enum AVIFlags {
-		AVIF_HASINDEX = 0x00000010,
-		AVIF_MUSTUSEINDEX = 0x00000020,
-		AVIF_ISINTERLEAVED = 0x00000100,
-		AVIF_TRUSTCKTYPE = 0x00000800,
-		AVIF_WASCAPTUREFILE = 0x00010000,
-		AVIF_WASCOPYRIGHTED = 0x00020000
-	};
-
-	struct AVIStreamHeader {
-		uint32 size;
-		uint32 streamType;
-		uint32 streamHandler;
-		uint32 flags;
-		uint16 priority;
-		uint16 language;
-		uint32 initialFrames;
-		uint32 scale;
-		uint32 rate;
-		uint32 start;
-		uint32 length;
-		uint32 bufferSize;
-		uint32 quality;
-		uint32 sampleSize;
-		Common::Rect frame;
-	};
-
-	class AVIVideoTrack : public FixedRateVideoTrack {
-	public:
-		AVIVideoTrack(int frameCount, const AVIStreamHeader &streamHeader, const BitmapInfoHeader &bitmapInfoHeader, byte *initialPalette = 0);
-		~AVIVideoTrack();
-
-		void decodeFrame(Common::SeekableReadStream *stream);
-		void forceTrackEnd();
-
-		uint16 getWidth() const { return _bmInfo.width; }
-		uint16 getHeight() const { return _bmInfo.height; }
-		Graphics::PixelFormat getPixelFormat() const;
-		int getCurFrame() const { return _curFrame; }
-		int getFrameCount() const { return _frameCount; }
-		const Graphics::Surface *decodeNextFrame() { return _lastFrame; }
-
-		const byte *getPalette() const;
-		bool hasDirtyPalette() const;
-		void setCurFrame(int frame) { _curFrame = frame; }
-		void loadPaletteFromChunk(Common::SeekableReadStream *chunk);
-		void useInitialPalette();
-		bool canDither() const;
-		void setDither(const byte *palette);
-
-		bool isTruemotion1() const;
-		void forceDimensions(uint16 width, uint16 height);
-
-		bool isRewindable() const { return true; }
-		bool rewind();
-
-	protected:
-		Common::Rational getFrameRate() const { return Common::Rational(_vidsHeader.rate, _vidsHeader.scale); }
-
-	private:
-		AVIStreamHeader _vidsHeader;
-		BitmapInfoHeader _bmInfo;
-		byte _palette[3 * 256];
-		byte *_initialPalette;
-		mutable bool _dirtyPalette;
-		int _frameCount, _curFrame;
-
-		Image::Codec *_videoCodec;
-		const Graphics::Surface *_lastFrame;
-		Image::Codec *createCodec();
-	};
-
-	class AVIAudioTrack : public AudioTrack {
-	public:
-		AVIAudioTrack(const AVIStreamHeader &streamHeader, const PCMWaveFormat &waveFormat, Audio::Mixer::SoundType soundType);
-		~AVIAudioTrack();
-
-		virtual void createAudioStream();
-		virtual void queueSound(Common::SeekableReadStream *stream);
-		Audio::Mixer::SoundType getSoundType() const { return _soundType; }
-		void skipAudio(const Audio::Timestamp &time, const Audio::Timestamp &frameTime);
-		virtual void resetStream();
-		uint32 getCurChunk() const { return _curChunk; }
-		void setCurChunk(uint32 chunk) { _curChunk = chunk; }
-
-		bool isRewindable() const { return true; }
-		bool rewind();
-
-	protected:
-		Audio::AudioStream *getAudioStream() const { return _audioStream; }
-
-		// Audio Codecs
-		enum {
-			kWaveFormatNone = 0,
-			kWaveFormatPCM = 1,
-			kWaveFormatMSADPCM = 2,
-			kWaveFormatMSIMAADPCM = 17,
-			kWaveFormatMP3 = 85,
-			kWaveFormatDK3 = 98		// rogue format number
-		};
-
-		AVIStreamHeader _audsHeader;
-		PCMWaveFormat _wvInfo;
-		Audio::Mixer::SoundType _soundType;
-		Audio::AudioStream *_audioStream;
-		Audio::PacketizedAudioStream *_packetStream;
-		uint32 _curChunk;
-	};
-
-	struct TrackStatus {
-		TrackStatus();
-
-		Track *track;
-		uint32 index;
-		uint32 chunkSearchOffset;
-	};
-
-	AVIHeader _header;
-
-	void readOldIndex(uint32 size);
-	Common::Array<OldIndex> _indexEntries;
-
-	Common::SeekableReadStream *_fileStream;
-	bool _decodedHeader;
-	bool _foundMovieList;
-	uint32 _movieListStart, _movieListEnd;
-
-	Audio::Mixer::SoundType _soundType;
-	Common::Rational _frameRateOverride;
-	void initCommon();
-
-	bool parseNextChunk();
-	void skipChunk(uint32 size);
-	void handleList(uint32 listSize);
-	void handleStreamHeader(uint32 size);
-	uint16 getStreamType(uint32 tag) const { return tag & 0xFFFF; }
-	byte getStreamIndex(uint32 tag) const;
-	void checkTruemotion1();
-
-	void handleNextPacket(TrackStatus& status);
-	bool shouldQueueAudio(TrackStatus& status);
-	Common::Array<TrackStatus> _videoTracks, _audioTracks;
-
-public:
-	virtual AVIAudioTrack *createAudioTrack(AVIStreamHeader sHeader, PCMWaveFormat wvInfo);
-};
-
-} // End of namespace Titanic
-
-#endif
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index a2bd116..6ddfecf 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -20,8 +20,9 @@
  *
  */
 
-#include "graphics/cursorman.h"
+#include "common/memstream.h"
 #include "common/textconsole.h"
+#include "graphics/cursorman.h"
 #include "titanic/support/mouse_cursor.h"
 #include "titanic/support/movie.h"
 #include "titanic/support/screen_manager.h"
@@ -62,20 +63,39 @@ CMouseCursor::~CMouseCursor() {
 
 void CMouseCursor::loadCursorImages() {
 	const CString name("ycursors.avi");
-	const CResourceKey key(name);
 	g_vm->_filesManager.fn4(name);
 
+	// WORKAROUND: We need to manipulate ycursors.avi file so it can be read
+	// by the ScummVM AVIDecoder, by removing the redundant second video track
+	Common::File f;
+	if (!f.open(name))
+		error("Could not open cursors file");
+
+	// Read in the entire file
+	byte *movieData = (byte *)malloc(f.size());
+	f.read(movieData, f.size());
+
+	if (READ_BE_UINT32(movieData + 254) == MKTAG('s', 't', 'r', 'h')) {
+		// Change the second video chunk to junk data so it gets ignored
+		WRITE_BE_UINT32(movieData + 254, MKTAG('J', 'U', 'N', 'K'));
+		WRITE_LE_UINT32(movieData + 258, 1128);
+	}
+
 	// Iterate through each cursor
 	for (int idx = 0; idx < NUM_CURSORS; ++idx) {
 		assert(CURSOR_DATA[idx][0] == (idx + 1));
 		_cursors[idx]._centroid = Common::Point(CURSOR_DATA[idx][2],
 			CURSOR_DATA[idx][3]);
 
+		// Create the surface
 		CVideoSurface *surface = _screenManager->createSurface(64, 64);
 		_cursors[idx]._videoSurface = surface;
 
-		OSMovie movie(key, surface);
+		Common::SeekableReadStream *stream = new Common::MemoryReadStream(
+			movieData, f.size(), DisposeAfterUse::NO);
+		OSMovie movie(stream, surface);
 		movie.setFrame(idx);
+
 		_cursors[idx]._ptrUnknown = movie.proc21();
 		surface->set40(_cursors[idx]._ptrUnknown);
 	}
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 7593c74..6599093 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -20,8 +20,7 @@
  *
  */
 
-#include "image/codecs/cinepak.h"
-#include "titanic/support/avi_decoder.h"
+#include "video/avi_decoder.h"
 #include "titanic/support/movie.h"
 #include "titanic/titanic.h"
 
@@ -51,11 +50,18 @@ bool CMovie::get10() {
 
 OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) :
 		_videoSurface(surface), _gameObject(nullptr) {
-	_video = new AVIDecoder();
+	_video = new Video::AVIDecoder();
 	if (!_video->loadFile(name.getString()))
 		error("Could not open video - %s", name.getString().c_str());
 }
 
+OSMovie::OSMovie(Common::SeekableReadStream *stream, CVideoSurface *surface) :
+		_videoSurface(surface), _gameObject(nullptr) {
+	_video = new Video::AVIDecoder();
+	if (!_video->loadStream(stream))
+		error("Could not parse movie stream");
+}
+
 OSMovie::~OSMovie() {
 	g_vm->_activeMovies.remove(this);
 	delete _video;
@@ -134,7 +140,9 @@ MovieState OSMovie::getState() {
 void OSMovie::update() {
 	if (_state != MOVIE_STOPPED) {
 		if (_video->isPlaying()) {
-			if (_video->needsUpdate()) {
+			if (_video->endOfVideo()) {
+				_state = MOVIE_FINISHED;
+			} else if (_video->needsUpdate()) {
 				decodeFrame();
 				_state = MOVIE_FRAME;
 			} else {
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index b488d26..2751f2d 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -93,6 +93,7 @@ public:
 	CGameObject *_gameObject;
 public:
 	OSMovie(const CResourceKey &name, CVideoSurface *surface);
+	OSMovie(Common::SeekableReadStream *stream, CVideoSurface *surface);
 	virtual ~OSMovie();
 
 	/**


Commit: 9db15f6967c8f559e34824213707ed76b45d666e
    https://github.com/scummvm/scummvm/commit/9db15f6967c8f559e34824213707ed76b45d666e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:10:49-04:00

Commit Message:
TITANIC: Allow television video to play multiple times

Changed paths:
    engines/titanic/support/movie.cpp



diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 6599093..dd0792c 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -75,6 +75,7 @@ void OSMovie::play(int v1, CVideoSurface *surface) {
 void OSMovie::play(int v1, int v2, int v3, bool v4) {
 	warning("TODO: OSMovie::play properly");
 	//setFrame(v1); ?
+	_video->seek(0);
 	_video->start();
 	g_vm->_activeMovies.push_back(this);
 	_state = MOVIE_NONE;


Commit: 8e5f7a9453deff3436fc937292a0ff825acd7454
    https://github.com/scummvm/scummvm/commit/8e5f7a9453deff3436fc937292a0ff825acd7454
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:10:50-04:00

Commit Message:
TITANIC: Fix stopping movies

Changed paths:
    engines/titanic/main_game_window.cpp
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h



diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 5b8cba3..a524529 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -113,7 +113,7 @@ void CMainGameWindow::setActiveView(CViewItem *viewItem) {
 
 void CMainGameWindow::draw() {
 	if (_gameManager) {
-		if (_gameView->_surface) {
+		if (!_gameView->_surface) {
 			CViewItem *view = _gameManager->getView();
 			if (view)
 				setActiveView(view);
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index dd0792c..0627da8 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -94,7 +94,8 @@ void OSMovie::proc12() {
 }
 
 void OSMovie::stop() {
-	warning("TODO: OSMovie::proc13");
+	_video->stop();
+	_state = MOVIE_STOPPED;
 }
 
 void OSMovie::proc14() {
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index 2751f2d..d88c7b0 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -62,7 +62,12 @@ public:
 	virtual void proc10() = 0;
 	virtual void proc11() = 0;
 	virtual void proc12() = 0;
+
+	/**
+	 * Stops the movie
+	 */
 	virtual void stop() = 0;
+
 	virtual void proc14() = 0;
 	virtual void setFrame(uint frameNumber) = 0;
 	virtual void proc16() = 0;
@@ -109,7 +114,12 @@ public:
 	virtual void proc10();
 	virtual void proc11();
 	virtual void proc12();
+
+	/**
+	 * Stops the movie
+	 */
 	virtual void stop();
+	
 	virtual void proc14();
 
 	/**


Commit: 91336a86115f600e626c333441aa1369b435ab92
    https://github.com/scummvm/scummvm/commit/91336a86115f600e626c333441aa1369b435ab92
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:10:51-04:00

Commit Message:
TITANIC: Implement playing a range of frames within movie

Changed paths:
    engines/titanic/core/background.cpp
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/cdrom_tray.cpp
    engines/titanic/game/computer.cpp
    engines/titanic/game/television.cpp
    engines/titanic/gfx/st_button.cpp
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/core/background.cpp b/engines/titanic/core/background.cpp
index 5859719..52ff4c4 100644
--- a/engines/titanic/core/background.cpp
+++ b/engines/titanic/core/background.cpp
@@ -58,9 +58,9 @@ void CBackground::load(SimpleFile *file) {
 bool CBackground::StatusChangeMsg(CStatusChangeMsg *msg) {
 	setVisible(true);
 	if (_fieldDC) {
-		fn1(_fieldBC, _fieldC0, 16);
+		playMovie(_fieldBC, _fieldC0, 16);
 	} else {
-		fn1(_fieldBC, _fieldC0, 0);
+		playMovie(_fieldBC, _fieldC0, 0);
 	}
 	return true;
 }
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 425c227..a798c4d 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -350,7 +350,7 @@ void CGameObject::petFn3(CTreeItem *item) {
 		pet->fn3(item);
 }
 
-void CGameObject::fn1(int val1, int val2, int val3) {
+void CGameObject::playMovie(uint startFrame, uint endFrame, int val3) {
 	_frameNumber = -1;
 	if (!_surface) {
 		if (!_resource.empty())
@@ -364,30 +364,30 @@ void CGameObject::fn1(int val1, int val2, int val3) {
 		if (movie)
 			movie->_gameObject = this;
 
-		_surface->playMovie(val1, val2, val3, val3 != 0);
+		_surface->playMovie(startFrame, endFrame, val3, val3 != 0);
 
 		if (val3 & 0x10)
 			getGameManager()->_gameState.addMovie(_surface->_movie);
 	}
 }
 
-void CGameObject::changeStatus(int newStatus) {
+void CGameObject::playMovie(uint flags) {
 	_frameNumber = -1;
 	if (!_surface && !_resource.empty()) {
 		loadResource(_resource);
 		_resource.clear();
 	}
 
-	CVideoSurface *surface = (newStatus & 4) ? _surface : nullptr;
+	CVideoSurface *surface = (flags & 4) ? _surface : nullptr;
 	if (_surface) {
-		_surface->playMovie(newStatus, surface);
+		_surface->playMovie(flags, surface);
 		
 		// TODO: Figure out where to do this legitimately
 		OSMovie *movie = static_cast<OSMovie *>(_surface->_movie);
 		if (movie)
 			movie->_gameObject = this;
 
-		if (newStatus & 0x10) {
+		if (flags & 0x10) {
 			getGameManager()->_gameState.addMovie(_surface->_movie);
 		}
 	}
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 6acaeff..ab18339 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -178,13 +178,6 @@ public:
 	 */
 	bool checkPoint(const Point &pt, bool ignore40 = false, bool visibleOnly = false);
 
-	void fn1(int val1, int val2, int val3);
-
-	/**
-	 * Change the object's status
-	 */
-	void changeStatus(int newStatus);
-
 	/**
 	 * Set the position of the object
 	 */
@@ -202,6 +195,16 @@ public:
 	 * Loads a frame
 	 */
 	void loadFrame(int frameNumber);
+
+	/**
+	 * Change the object's status
+	 */
+	void playMovie(uint flags);
+
+	/**
+	 * Play the movie specified in _resource
+	 */
+	void playMovie(uint startFrame, uint endFrame, int val3);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/cdrom_tray.cpp b/engines/titanic/game/cdrom_tray.cpp
index 5f576d1..1b2d6ba 100644
--- a/engines/titanic/game/cdrom_tray.cpp
+++ b/engines/titanic/game/cdrom_tray.cpp
@@ -56,7 +56,7 @@ bool CCDROMTray::ActMsg(CActMsg *msg) {
 	if (msg->_action == "ClickedOn") {
 		if (_state) {
 			if (_insertedCD == "None") {
-				fn1(55, 65, 0);
+				playMovie(55, 65, 0);
 				playSound("a#35.wav", 50, 0, 0);
 				_state = 0;
 			} else {
@@ -70,24 +70,24 @@ bool CCDROMTray::ActMsg(CActMsg *msg) {
 				loadFrame(52);
 			}
 		} else if (_insertedCD == "None") {
-			fn1(44, 54, 0);
+			playMovie(44, 54, 0);
 			playSound("a#34.wav", 50, 0, 0);
 			_state = 1;
 		} else if (_insertedCD == "newCD1" || _insertedCD == "newCD2") {
-			fn1(22, 32, 0);
+			playMovie(22, 32, 0);
 			playSound("a#34.wav", 50, 0, 0);
 			_state = 1;
 		} else if (_insertedCD == "newSTCD") {
-			fn1(0, 10, 0);
+			playMovie(0, 10, 0);
 			playSound("a#34.wav", 50, 0, 0);
 			_state = 1;
 		}
 	} else if (_state) {
 		if (msg->_action == "newCD1" || msg->_action == "newCD2") {
-			fn1(33, 43, 4);
+			playMovie(33, 43, 4);
 			playSound("a#35.wav", 50, 0, 0);
 		} else if (msg->_action == "newSTCD") {
-			fn1(11, 21, 4);
+			playMovie(11, 21, 4);
 			playSound("a#35.wav", 50, 0, 0);
 		} else {
 			return true;
diff --git a/engines/titanic/game/computer.cpp b/engines/titanic/game/computer.cpp
index 95330f6..d2a2cc1 100644
--- a/engines/titanic/game/computer.cpp
+++ b/engines/titanic/game/computer.cpp
@@ -47,14 +47,14 @@ void CComputer::load(SimpleFile *file) {
 bool CComputer::ActMsg(CActMsg *msg) {
 	if (_state) {
 		playSound("a#35.wav", 100, 0, 0);
-		fn1(32, 42, 0);
+		playMovie(32, 42, 0);
 
 		if (msg->_action == "CD1")
-			fn1(43, 49, 0);
+			playMovie(43, 49, 0);
 		else if (msg->_action == "CD2")
-			fn1(50, 79, 0);
+			playMovie(50, 79, 0);
 		else if (msg->_action == "STCD")
-			fn1(80, 90, 4);
+			playMovie(80, 90, 4);
 
 		_currentCD = msg->_action;
 		_state = 0;
@@ -67,11 +67,11 @@ bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	if (_currentCD == "None") {
 		if (_state) {
 			playSound("a#35.wav", 100, 0, 0);
-			fn1(11, 21, 0);
+			playMovie(11, 21, 0);
 			_state = 0;
 		} else {
 			playSound("a#34.wav", 100, 0, 0);
-			fn1(0, 10, 0);
+			playMovie(0, 10, 0);
 			_state = 1;
 		}
 	} else {
@@ -82,7 +82,7 @@ bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 			_currentCD = "None";
 		} else {
 			playSound("a#34.wav", 100, 0, 0);
-			fn1(21, 31, 0);
+			playMovie(21, 31, 0);
 			_state = 1;
 		}
 	}
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 2ad84d3..6e1f5ca 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -148,8 +148,8 @@ bool CTelevision::EnterViewMsg(CEnterViewMsg *msg) {
 	return true;
 }
 
-static const int FRAMES1[9] = { 0, 0, 56, 112, 168, 224, 280, 336, 392 };
-static const int FRAMES2[8] = { 0, 55, 111, 167, 223, 279, 335, 391 };
+static const int START_FRAMES[9] = { 0, 0, 56, 112, 168, 224, 280, 336, 392 };
+static const int END_FRAMES[8] = { 0, 55, 111, 167, 223, 279, 335, 391 };
 
 bool CTelevision::PETUpMsg(CPETUpMsg *msg) {
 	if (msg->_name == "Television" && _isOn) {
@@ -158,7 +158,7 @@ bool CTelevision::PETUpMsg(CPETUpMsg *msg) {
 
 		_fieldE0 = _fieldE0 % _fieldE4 + 1;
 		stopMovie();
-		fn1(FRAMES1[_fieldE0], FRAMES2[_fieldE0], 4);
+		playMovie(START_FRAMES[_fieldE0], END_FRAMES[_fieldE0], 4);
 	}
 
 	return true;
@@ -173,7 +173,7 @@ bool CTelevision::PETDownMsg(CPETDownMsg *msg) {
 
 		_fieldE0 = _fieldE0 % _fieldE4 + 1;
 		stopMovie();
-		fn1(FRAMES1[_fieldE0], FRAMES2[_fieldE0], 4);
+		playMovie(START_FRAMES[_fieldE0], END_FRAMES[_fieldE0], 4);
 	}
 
 	return true;
@@ -182,7 +182,7 @@ bool CTelevision::PETDownMsg(CPETDownMsg *msg) {
 bool CTelevision::StatusChangeMsg(CStatusChangeMsg *msg) {
 	if (_isOn) {
 		stopMovie();
-		changeStatus(0);
+		playMovie(0);
 	}
 
 	return true;
@@ -211,7 +211,7 @@ bool CTelevision::PETActivateMsg(CPETActivateMsg *msg) {
 
 		if (_isOn) {
 			setVisible(true);
-			fn1(0, 55, 0);
+			playMovie(0, 55, 0);
 			_fieldE0 = 1;
 		} else {
 			stopMovie();
diff --git a/engines/titanic/gfx/st_button.cpp b/engines/titanic/gfx/st_button.cpp
index 827fb4a..b45d990 100644
--- a/engines/titanic/gfx/st_button.cpp
+++ b/engines/titanic/gfx/st_button.cpp
@@ -67,7 +67,7 @@ void CSTButton::load(SimpleFile *file) {
 }
 
 bool CSTButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
-	changeStatus(0);
+	playMovie(0);
 	playSound(_soundName, 100, 0, 0);
 
 	return true;
diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index 68c258c..625415f 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -62,18 +62,18 @@ bool CPetElement::contains2(const Common::Point &pt) const {
 	return _bounds.contains(pt);
 }
 
-void CPetElement::proc11(int val1, int val2) const {
+void CPetElement::playMovie(uint startFrame, uint endFrame) const {
 	CGameObject *gameObject = getObject();
 
 	if (gameObject)
-		gameObject->fn1(val1, val2, 0);
+		gameObject->playMovie(startFrame, endFrame, 0);
 }
 
-void CPetElement::changeStatus(int newStatus) const {
+void CPetElement::changeStatus(int val) const {
 	CGameObject *gameObject = getObject();
 
 	if (gameObject)
-		gameObject->changeStatus(newStatus);
+		gameObject->playMovie(val);
 }
 
 bool CPetElement::hasActiveMovie() const {
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index a53715d..de9f552 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -84,7 +84,10 @@ public:
 	 */
 	virtual bool contains2(const Common::Point &pt) const;
 
-	virtual void proc11(int val1, int val2) const;
+	/**
+	 * Plays back a range of frames in the loaded video file for the element
+	 */
+	virtual void playMovie(uint startFrame, uint endFrame) const;
 
 	/**
 	 * Change the status of the associated object
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 0627da8..6f66bec 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -49,14 +49,14 @@ bool CMovie::get10() {
 /*------------------------------------------------------------------------*/
 
 OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) :
-		_videoSurface(surface), _gameObject(nullptr) {
+		_videoSurface(surface), _gameObject(nullptr), _endFrame(-1) {
 	_video = new Video::AVIDecoder();
 	if (!_video->loadFile(name.getString()))
 		error("Could not open video - %s", name.getString().c_str());
 }
 
 OSMovie::OSMovie(Common::SeekableReadStream *stream, CVideoSurface *surface) :
-		_videoSurface(surface), _gameObject(nullptr) {
+		_videoSurface(surface), _gameObject(nullptr), _endFrame(-1) {
 	_video = new Video::AVIDecoder();
 	if (!_video->loadStream(stream))
 		error("Could not parse movie stream");
@@ -67,16 +67,18 @@ OSMovie::~OSMovie() {
 	delete _video;
 }
 
-void OSMovie::play(int v1, CVideoSurface *surface) {
-	warning("TODO: OSMovie::proc8");
-	play(0, 0, 0, 0);
+void OSMovie::play(uint flags, CVideoSurface *surface) {
+	uint endFrame = _video->getFrameCount();
+	play(0, endFrame, 0, 0);
 }
 
-void OSMovie::play(int v1, int v2, int v3, bool v4) {
+void OSMovie::play(uint startFrame, uint endFrame, int v3, bool v4) {
 	warning("TODO: OSMovie::play properly");
-	//setFrame(v1); ?
-	_video->seek(0);
+
 	_video->start();
+	_video->seekToFrame(startFrame);
+	_endFrame = endFrame;
+
 	g_vm->_activeMovies.push_back(this);
 	_state = MOVIE_NONE;
 }
@@ -142,7 +144,8 @@ MovieState OSMovie::getState() {
 void OSMovie::update() {
 	if (_state != MOVIE_STOPPED) {
 		if (_video->isPlaying()) {
-			if (_video->endOfVideo()) {
+			if (_video->getCurFrame() >= _endFrame) {
+				_video->stop();
 				_state = MOVIE_FINISHED;
 			} else if (_video->needsUpdate()) {
 				decodeFrame();
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index d88c7b0..a871af6 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -52,12 +52,12 @@ public:
 	/**
 	 * Plays the movie
 	 */
-	virtual void play(int v1, CVideoSurface *surface) = 0;
+	virtual void play(uint flags, CVideoSurface *surface) = 0;
 	
 	/**
 	 * Plays the movie
 	 */
-	virtual void play(int v1, int v2, int v3, bool v4) = 0;
+	virtual void play(uint startFrame, uint endFrame, int v3, bool v4) = 0;
 	
 	virtual void proc10() = 0;
 	virtual void proc11() = 0;
@@ -89,6 +89,7 @@ class OSMovie : public CMovie {
 private:
 	Video::VideoDecoder *_video;
 	CVideoSurface *_videoSurface;
+	int _endFrame;
 
 	/**
 	 * Decodes the next frame
@@ -104,12 +105,12 @@ public:
 	/**
 	 * Plays the movie
 	 */
-	virtual void play(int v1, CVideoSurface *surface);
+	virtual void play(uint flags, CVideoSurface *surface);
 	
 	/**
 	 * Plays the movie
 	 */
-	virtual void play(int v1, int v2, int v3, bool v4);
+	virtual void play(uint startFrame, uint endFrame, int v3, bool v4);
 	
 	virtual void proc10();
 	virtual void proc11();
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 3fb513c..089b216 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -379,14 +379,14 @@ void OSVideoSurface::shiftColors() {
 	// we already convert 16-bit surfaces as soon as they're loaded
 }
 
-void OSVideoSurface::playMovie(int newStatus, CVideoSurface *surface) {
+void OSVideoSurface::playMovie(uint flags, CVideoSurface *surface) {
 	if (loadIfReady() && _movie)
-		_movie->play(newStatus, surface);
+		_movie->play(flags, surface);
 }
 
-void OSVideoSurface::playMovie(int v1, int v2, int v3, bool v4) {
+void OSVideoSurface::playMovie(uint startFrame, uint endFrame, int v3, bool v4) {
 	if (loadIfReady() && _movie) {
-		_movie->play(v1, v2, v3, v4);
+		_movie->play(startFrame, endFrame, v3, v4);
 	}
 }
 
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index c4947ca..2ec2c9d 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -158,13 +158,13 @@ public:
 	 * Plays a movie, loading it from the specified _resource
 	 * if not already loaded
 	 */
-	virtual void playMovie(int newStatus, CVideoSurface *surface) = 0;
+	virtual void playMovie(uint flags, CVideoSurface *surface) = 0;
 
 	/**
 	 * Plays a movie, loading it from the specified _resource
 	 * if not already loaded
 	 */
-	virtual void playMovie(int v1, int v2, int v3, bool v4) = 0;
+	virtual void playMovie(uint startFrame, uint endFrame, int v3, bool v4) = 0;
 
 	/**
 	 * Stops any movie currently attached to the surface
@@ -317,13 +317,13 @@ public:
 	 * Plays a movie, loading it from the specified _resource
 	 * if not already loaded
 	 */
-	virtual void playMovie(int newStatus, CVideoSurface *surface);
+	virtual void playMovie(uint flags, CVideoSurface *surface);
 
 	/**
 	 * Plays a movie, loading it from the specified _resource
 	 * if not already loaded
 	 */
-	virtual void playMovie(int v1, int v2, int v3, bool v4);
+	virtual void playMovie(uint startFrame, uint endFrame, int v3, bool v4);
 
 	/**
 	 * Stops any movie currently attached to the surface


Commit: cf785a19e3dbe52eb71b253a5dcdcd7ba77b47ca
    https://github.com/scummvm/scummvm/commit/cf785a19e3dbe52eb71b253a5dcdcd7ba77b47ca
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:10:52-04:00

Commit Message:
TITANIC: Implement drag&drop dropping

Changed paths:
    engines/titanic/input_handler.cpp
    engines/titanic/input_handler.h
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index 0657ebe..082bdd0 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -88,8 +88,8 @@ void CInputHandler::processMessage(CMessage *msg) {
 			} else {
 				if (mouseMsg->isButtonUpMsg() && _dragItem) {
 					// Mouse drag ended
-					dragEnd(_mousePos, _dragItem);
-					CMouseDragEndMsg endMsg(_mousePos, _dragItem);
+					CTreeItem *target = dragEnd(_mousePos, _dragItem);
+					CMouseDragEndMsg endMsg(_mousePos, target);
 					endMsg.execute(_dragItem);
 				}
 
@@ -134,8 +134,36 @@ void CInputHandler::dispatchMessage(CMessage *msg) {
 	}
 }
 
-void CInputHandler::dragEnd(const Point &mousePos, CTreeItem *dragItem) {
-	warning("TODO CInputHandler::dragEnd");
+CTreeItem *CInputHandler::dragEnd(const Point &pt, CTreeItem *dragItem) {
+	CViewItem *view = _gameManager->getView();
+	if (!view)
+		return nullptr;
+
+	// Scan through the view items to find the item being dropped on
+	CTreeItem *target = nullptr;
+	for (CTreeItem *treeItem = view->scan(view); treeItem; treeItem = treeItem->scan(view)) {
+		CGameObject *gameObject = static_cast<CGameObject *>(treeItem);
+		if (gameObject && gameObject != dragItem) {
+			if (gameObject->checkPoint(pt))
+				target = gameObject;
+		}
+	}
+
+	if (target) {
+		// Check if the cursor is on the PET. If so, pass to the PET
+		// to see what specific element the drag ended on
+		CProjectItem *project = view->getRoot();		
+		if (project) {
+			CPetControl *petControl = project->getPetControl();
+			if (petControl && petControl->contains(pt)) {
+				target = petControl->dragEnd(pt);
+				if (!target)
+					target = petControl;
+			}
+		}
+	}
+
+	return target;
 }
 
-} // End of namespace Titanic z
+} // End of namespace Titanic
diff --git a/engines/titanic/input_handler.h b/engines/titanic/input_handler.h
index 4e8966f..05838e8 100644
--- a/engines/titanic/input_handler.h
+++ b/engines/titanic/input_handler.h
@@ -46,7 +46,7 @@ private:
 	/**
 	 * Called when a drag operation has ended
 	 */
-	void dragEnd(const Point &mousePos, CTreeItem *dragItem);
+	CTreeItem *dragEnd(const Point &pt, CTreeItem *dragItem);
 public:
 	CGameManager *_gameManager;
 	CInputTranslator *_inputTranslator;
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 172cec9..39bc5fb 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -182,6 +182,20 @@ public:
 	 * Draws the indent
 	 */
 	void drawIndent(CScreenManager *screenManager, int indent);
+
+	/**
+	 * Returns true if the point is within the PET's draw bounds
+	 */
+	bool contains(const Point &pt) const {
+		return _drawBounds.contains(pt);
+	}
+
+	/**
+	 * Handles drag ends within the PET
+	 */
+	CTreeItem *dragEnd(const Point &pt) const {
+		return _currentArea == PET_INVENTORY ? _inventory.dragEnd(pt) : nullptr;
+	}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 66d093f..79923bd 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -64,6 +64,11 @@ void CPetInventory::load(SimpleFile *file, int param) {
 	_field298 = file->readNumber();
 }
 
+CTreeItem *CPetInventory::dragEnd(const Point &pt) const {
+	warning("TODO: CPetInventory::dragEnd");
+	return nullptr;
+}
+
 bool CPetInventory::isValid(CPetControl *petControl) {
 	// TODO
 	return true;
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 01f9ebb..a0a9304 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -82,6 +82,11 @@ public:
 	virtual void load(SimpleFile *file, int param);
 
 	/**
+	 * Returns item a drag-drop operation has dropped on, if any
+	 */
+	virtual CTreeItem *dragEnd(const Point &pt) const;
+
+	/**
 	 * Returns true if the object is in a valid state
 	 */
 	virtual bool isValid(CPetControl *petControl);
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index e20c03c..bc24737 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -90,7 +90,12 @@ public:
 	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) { return false; }
 
 	virtual int proc14() { return 0; }
-	virtual int proc15() { return 0; }
+	
+	/**
+	 * Returns item a drag-drop operation has dropped on, if any
+	 */
+	virtual CTreeItem *dragEnd(const Point &pt) const { return nullptr; }
+	
 	virtual void proc16();
 
 	/**


Commit: ad6ea25c99654b93c712a64fe322dce42e7fd0e8
    https://github.com/scummvm/scummvm/commit/ad6ea25c99654b93c712a64fe322dce42e7fd0e8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:10:53-04:00

Commit Message:
TITANIC: Added CCarry message handler stubs

Changed paths:
    engines/titanic/carry/carry.cpp
    engines/titanic/carry/carry.h



diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index 7454489..b075444 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -24,6 +24,21 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CCarry, CGameObject)
+	ON_MESSAGE(MouseDragStartMsg)
+	ON_MESSAGE(MouseDragMoveMsg)
+	ON_MESSAGE(MouseDragEndMsg)
+	ON_MESSAGE(UseWithCharMsg)
+	ON_MESSAGE(LeaveViewMsg)
+	ON_MESSAGE(UseWithOtherMsg)
+	ON_MESSAGE(VisibleMsg)
+	ON_MESSAGE(MouseButtonDownMsg)
+	ON_MESSAGE(RemoveFromGameMsg)
+	ON_MESSAGE(MoveToStartPosMsg)
+	ON_MESSAGE(EnterViewMsg)
+	ON_MESSAGE(PassOnDragStartMsg)
+END_MESSAGE_MAP()
+
 CCarry::CCarry() : CGameObject(), _fieldDC(0), _fieldE0(1),
 	_field100(0), _field104(0), _field108(0), _field10C(0),
 	_field110(0), _field120(0), _field124(0), _field128(0),
@@ -77,4 +92,52 @@ void CCarry::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CCarry::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+	return true;
+}
+
+bool CCarry::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
+	return true;
+}
+
+bool CCarry::MouseDragEndMsg(CMouseDragEndMsg *msg) {
+	return true;
+}
+
+bool CCarry::UseWithCharMsg(CUseWithCharMsg *msg) {
+	return true;
+}
+
+bool CCarry::LeaveViewMsg(CLeaveViewMsg *msg) {
+	return true;
+}
+
+bool CCarry::UseWithOtherMsg(CUseWithOtherMsg *msg) {
+	return true;
+}
+
+bool CCarry::VisibleMsg(CVisibleMsg *msg) {
+	return true;
+}
+
+bool CCarry::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	return true;
+}
+
+bool CCarry::RemoveFromGameMsg(CRemoveFromGameMsg *msg) {
+	return true;
+}
+
+bool CCarry::MoveToStartPosMsg(CMoveToStartPosMsg *msg) {
+	return true;
+}
+
+bool CCarry::EnterViewMsg(CEnterViewMsg *msg) {
+	return true;
+}
+
+bool CCarry::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index 309b8a8..9788b25 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -24,10 +24,25 @@
 #define TITANIC_CARRY_H
 
 #include "titanic/core/game_object.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
 
 namespace Titanic {
 
 class CCarry : public CGameObject {
+	DECLARE_MESSAGE_MAP
+	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
+	bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
+	bool MouseDragEndMsg(CMouseDragEndMsg *msg);
+	bool UseWithCharMsg(CUseWithCharMsg *msg);
+	bool LeaveViewMsg(CLeaveViewMsg *msg);
+	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
+	bool VisibleMsg(CVisibleMsg *msg);
+	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	bool RemoveFromGameMsg(CRemoveFromGameMsg *msg);
+	bool MoveToStartPosMsg(CMoveToStartPosMsg *msg);
+	bool EnterViewMsg(CEnterViewMsg *msg);
+	bool PassOnDragStartMsg(CPassOnDragStartMsg *msg);
 private:
 	CString _string1;
 	Point _pos1;


Commit: 7e1f802abdab1442bd49f1c398c0aab6d81d452b
    https://github.com/scummvm/scummvm/commit/7e1f802abdab1442bd49f1c398c0aab6d81d452b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:10:54-04:00

Commit Message:
TITANIC: CCarry drag & move msg handlers

Changed paths:
    engines/titanic/carry/carry.cpp
    engines/titanic/carry/carry.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/input_handler.cpp
    engines/titanic/input_handler.h
    engines/titanic/messages/messages.h
    engines/titanic/messages/mouse_messages.h
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index b075444..eefb13f 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -57,7 +57,7 @@ void CCarry::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeQuotedLine(_string3, indent);
 	file->writeQuotedLine(_string4, indent);
-	file->writePoint(_pos2, indent);
+	file->writePoint(_tempPos, indent);
 	file->writeNumberLine(_field104, indent);
 	file->writeNumberLine(_field108, indent);
 	file->writeNumberLine(_field10C, indent);
@@ -79,7 +79,7 @@ void CCarry::load(SimpleFile *file) {
 	_fieldE0 = file->readNumber();
 	_string3 = file->readString();
 	_string4 = file->readString();
-	_pos2 = file->readPoint();
+	_tempPos = file->readPoint();
 	_field104 = file->readNumber();
 	_field108 = file->readNumber();
 	_field10C = file->readNumber();
@@ -93,14 +93,34 @@ void CCarry::load(SimpleFile *file) {
 }
 
 bool CCarry::MouseDragStartMsg(CMouseDragStartMsg *msg) {
-	return true;
+	CString name = getName();
+
+	if (_fieldE0) {
+		if (_visible) {
+			CShowTextMsg textMsg("You can't get this.");
+			textMsg.execute("PET");
+		}
+	} else {
+		if (checkStartDragging(msg)) {
+			CPassOnDragStartMsg startMsg(msg->_mousePos);
+			startMsg.execute(this);
+			return true;
+		}
+	}
+
+	return false;
 }
 
 bool CCarry::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
+	setPosition(msg->_mousePos - _tempPos);
 	return true;
 }
 
 bool CCarry::MouseDragEndMsg(CMouseDragEndMsg *msg) {
+	if (msg->_dropTarget) {
+		// TODO
+	}
+
 	return true;
 }
 
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index 9788b25..b98a7be 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -51,7 +51,7 @@ private:
 	int _fieldE0;
 	CString _string3;
 	CString _string4;
-	Point _pos2;
+	Point _tempPos;
 	int _field100;
 	int _field104;
 	int _field108;
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index a798c4d..c179ed8 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -221,6 +221,10 @@ void CGameObject::draw(CScreenManager *screenManager, const Common::Point &destP
 	}
 }
 
+bool CGameObject::isPet() const {
+	return isInstanceOf(CPetControl::_type);
+}
+
 void CGameObject::loadResource(const CString &name) {
 	switch (name.fileTypeSuffix()) {
 	case FILETYPE_IMAGE:
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index ab18339..a8d8513 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -168,6 +168,11 @@ public:
 	virtual void draw(CScreenManager *screenManager, const Common::Point &destPos);
 
 	/**
+	 * Returns true if the item is the PET control
+	 */
+	virtual bool isPet() const;
+
+	/**
 	 * Stops any movie currently playing for the object
 	 */
 	void stopMovie();
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index 082bdd0..3d3541b 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -88,7 +88,7 @@ void CInputHandler::processMessage(CMessage *msg) {
 			} else {
 				if (mouseMsg->isButtonUpMsg() && _dragItem) {
 					// Mouse drag ended
-					CTreeItem *target = dragEnd(_mousePos, _dragItem);
+					CGameObject *target = dragEnd(_mousePos, _dragItem);
 					CMouseDragEndMsg endMsg(_mousePos, target);
 					endMsg.execute(_dragItem);
 				}
@@ -134,13 +134,13 @@ void CInputHandler::dispatchMessage(CMessage *msg) {
 	}
 }
 
-CTreeItem *CInputHandler::dragEnd(const Point &pt, CTreeItem *dragItem) {
+CGameObject *CInputHandler::dragEnd(const Point &pt, CTreeItem *dragItem) {
 	CViewItem *view = _gameManager->getView();
 	if (!view)
 		return nullptr;
 
 	// Scan through the view items to find the item being dropped on
-	CTreeItem *target = nullptr;
+	CGameObject *target = nullptr;
 	for (CTreeItem *treeItem = view->scan(view); treeItem; treeItem = treeItem->scan(view)) {
 		CGameObject *gameObject = static_cast<CGameObject *>(treeItem);
 		if (gameObject && gameObject != dragItem) {
diff --git a/engines/titanic/input_handler.h b/engines/titanic/input_handler.h
index 05838e8..2d62127 100644
--- a/engines/titanic/input_handler.h
+++ b/engines/titanic/input_handler.h
@@ -46,7 +46,7 @@ private:
 	/**
 	 * Called when a drag operation has ended
 	 */
-	CTreeItem *dragEnd(const Point &pt, CTreeItem *dragItem);
+	CGameObject *dragEnd(const Point &pt, CTreeItem *dragItem);
 public:
 	CGameManager *_gameManager;
 	CInputTranslator *_inputTranslator;
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 82601e5..e74c26f 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -319,7 +319,6 @@ MESSAGE0(COpeningCreditsMsg);
 MESSAGE1(CPanningAwayFromParrotMsg, int, value, 0);
 MESSAGE2(CParrotSpeakMsg, CString, value1, "", CString, value2, "");
 MESSAGE2(CParrotTriesChickenMsg, int, value1, 0, int, value2, 0);
-MESSAGE4(CPassOnDragStartMsg, int, value1, 0, int, value2, 0, int, value3, 0, int, value4, 0);
 MESSAGE1(CPhonographPlayMsg, int, value, 0);
 MESSAGE0(CPhonographReadyToPlayMsg);
 MESSAGE1(CPhonographRecordMsg, int, value, 0);
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 811fdf0..705247a 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -139,14 +139,27 @@ public:
 	}
 };
 
+class CPassOnDragStartMsg : public CMessage {
+public:
+	Point _mousePos;
+public:
+	CLASSDEF
+	CPassOnDragStartMsg() : CMessage() {}
+	CPassOnDragStartMsg(const Point &pt) : CMessage(), _mousePos(pt) {}
+
+	static bool isSupportedBy(const CTreeItem *item) {
+		return supports(item, _type);
+	}
+};
+
 class CMouseDragEndMsg : public CMouseDragMsg {
 public:
-	CTreeItem *_dropTarget;
+	CGameObject *_dropTarget;
 public:
 	CLASSDEF
 	CMouseDragEndMsg() : CMouseDragMsg(), _dropTarget(nullptr) {}
-	CMouseDragEndMsg(const Point &pt, CTreeItem *dragItem = nullptr) :
-		CMouseDragMsg(pt), _dropTarget(dragItem) {}
+	CMouseDragEndMsg(const Point &pt, CGameObject *dropTarget = nullptr) :
+		CMouseDragMsg(pt), _dropTarget(dropTarget) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return supports(item, _type);
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 39bc5fb..f357c29 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -193,7 +193,7 @@ public:
 	/**
 	 * Handles drag ends within the PET
 	 */
-	CTreeItem *dragEnd(const Point &pt) const {
+	CGameObject *dragEnd(const Point &pt) const {
 		return _currentArea == PET_INVENTORY ? _inventory.dragEnd(pt) : nullptr;
 	}
 };
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 79923bd..1104b65 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -64,7 +64,7 @@ void CPetInventory::load(SimpleFile *file, int param) {
 	_field298 = file->readNumber();
 }
 
-CTreeItem *CPetInventory::dragEnd(const Point &pt) const {
+CGameObject *CPetInventory::dragEnd(const Point &pt) const {
 	warning("TODO: CPetInventory::dragEnd");
 	return nullptr;
 }
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index a0a9304..16dfd22 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -84,7 +84,7 @@ public:
 	/**
 	 * Returns item a drag-drop operation has dropped on, if any
 	 */
-	virtual CTreeItem *dragEnd(const Point &pt) const;
+	virtual CGameObject *dragEnd(const Point &pt) const;
 
 	/**
 	 * Returns true if the object is in a valid state
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index bc24737..93a9145 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -94,7 +94,7 @@ public:
 	/**
 	 * Returns item a drag-drop operation has dropped on, if any
 	 */
-	virtual CTreeItem *dragEnd(const Point &pt) const { return nullptr; }
+	virtual CGameObject *dragEnd(const Point &pt) const { return nullptr; }
 	
 	virtual void proc16();
 


Commit: 54b055bcf58e8cbcf472ea6838f3ed7ecf377e37
    https://github.com/scummvm/scummvm/commit/54b055bcf58e8cbcf472ea6838f3ed7ecf377e37
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:10:55-04:00

Commit Message:
TITANIC: Implementing CCarry drag end handler

Changed paths:
    engines/titanic/carry/carry.cpp
    engines/titanic/carry/carry.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/messages/messages.h



diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index eefb13f..dbb7189 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -21,6 +21,8 @@
  */
 
 #include "titanic/carry/carry.h"
+#include "titanic/messages/messages.h"
+#include "titanic/npcs/character.h"
 
 namespace Titanic {
 
@@ -118,9 +120,30 @@ bool CCarry::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
 
 bool CCarry::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 	if (msg->_dropTarget) {
-		// TODO
+		if (msg->_dropTarget->isPet()) {
+			dropOnPet();
+			return true;
+		}
+
+		CCharacter *npc = static_cast<CCharacter *>(msg->_dropTarget);
+		if (npc) {
+			CUseWithCharMsg charMsg(npc);
+			charMsg.execute(this, nullptr, 0);
+			return true;
+		}
+
+		CDropObjectMsg dropMsg(this);
+		if (dropMsg.execute(msg->_dropTarget))
+			return true;
+
+		// Fall back on a use with other message
+		CUseWithOtherMsg otherMsg(msg->_dropTarget);
+		if (otherMsg.execute(this, nullptr, 0))
+			return true;
 	}
 
+	// TODO
+
 	return true;
 }
 
@@ -160,4 +183,8 @@ bool CCarry::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
 	return true;
 }
 
+void CCarry::dropOnPet() {
+	warning("TODO: dropOnPet");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index b98a7be..33e3ac3 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -61,6 +61,11 @@ private:
 	int _field120;
 	int _field124;
 	int _field128;
+protected:
+	/**
+	 * Called when an item is dropped onto the PET
+	 */
+	void dropOnPet();
 public:
 	CLASSDEF
 	CCarry();
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 4ef6a4a..5b04537 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -778,7 +778,7 @@ DEFFN(CDonNavHelmet)
 DEFFN(CDoorAutoSoundEvent)
 DEFFN(CDoorbotNeededInElevatorMsg)
 DEFFN(CDoorbotNeededInHomeMsg)
-DEFFN(CDropobjectMsg)
+DEFFN(CDropObjectMsg)
 DEFFN(CDropZoneGotObjectMsg)
 DEFFN(CDropZoneLostObjectMsg)
 DEFFN(CEditControlMsg)
@@ -1363,7 +1363,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CDoorAutoSoundEvent, CAutoSoundEvent);
 	ADDFN(CDoorbotNeededInElevatorMsg, CMessage);
 	ADDFN(CDoorbotNeededInHomeMsg, CMessage);
-	ADDFN(CDropobjectMsg, CMessage);
+	ADDFN(CDropObjectMsg, CMessage);
 	ADDFN(CDropZoneGotObjectMsg, CMessage);
 	ADDFN(CDropZoneLostObjectMsg, CMessage);
 	ADDFN(CEditControlMsg, CMessage);
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index e74c26f..474565a 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -79,6 +79,8 @@ enum MessageFlag {
 		return supports(item, _type); } \
 }
 
+class CCarry;
+class CCharacter;
 class CGameObject;
 class CRoomItem;
 class CNodeItem;
@@ -267,7 +269,7 @@ MESSAGE0(CDoffNavHelmet);
 MESSAGE0(CDonNavHelmet);
 MESSAGE1(CDoorbotNeededInElevatorMsg, int, value, 0);
 MESSAGE0(CDoorbotNeededInHomeMsg);
-MESSAGE1(CDropobjectMsg, int, value, 0);
+MESSAGE1(CDropObjectMsg, CCarry *, item, nullptr);
 MESSAGE1(CDropZoneGotObjectMsg, int, value, 0);
 MESSAGE1(CDropZoneLostObjectMsg, int, value, 0);
 MESSAGE1(CEjectCylinderMsg, int, value, 0);
@@ -389,8 +391,8 @@ MESSAGE3(CTrueTalkTriggerActionMsg, int, value1, 0, int, value2, 0, int, value3,
 MESSAGE0(CTurnOff);
 MESSAGE0(CTurnOn);
 MESSAGE1(CUse, int, value, 0);
-MESSAGE1(CUseWithCharMsg, int, value, 0);
-MESSAGE1(CUseWithOtherMsg, int, value, 0);
+MESSAGE1(CUseWithCharMsg, CCharacter *, character, nullptr);
+MESSAGE1(CUseWithOtherMsg, CGameObject *, other, 0);
 MESSAGE1(CVirtualKeyCharMsg, Common::KeyState, keyState, Common::KeyState());
 MESSAGE1(CVisibleMsg, bool, visible, true);
 


Commit: 7ac4f7c3aa26831f771418472472735cf73bade9
    https://github.com/scummvm/scummvm/commit/7ac4f7c3aa26831f771418472472735cf73bade9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:10:56-04:00

Commit Message:
TITANIC: Implementing CComputerScreen messages

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/cdrom.cpp
    engines/titanic/game/computer_screen.cpp
    engines/titanic/game/computer_screen.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index c179ed8..7e731bdb 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -459,6 +459,14 @@ bool CGameObject::playSound(const CString &name, CProximity &prox) {
 	return false;
 }
 
+int CGameObject::addTimer(int endVal, uint firstDuration, uint duration) {
+	CTimeEventInfo *timer = new CTimeEventInfo(g_vm->_events->getTicksCount(),
+		duration != 0, firstDuration, duration, this, endVal, CString());
+
+	getGameManager()->addTimer(timer);
+	return timer->_id;
+}
+
 void CGameObject::gotoView(const CString &viewName, const CString &clipName) {
 	CViewItem *newView = parseView(viewName);
 	CGameManager *gameManager = getGameManager();
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index a8d8513..bc1020d 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -140,6 +140,11 @@ protected:
 	 * Plays a sound
 	 */
 	bool playSound(const CString &name, CProximity &prox);
+
+	/**
+	 * Adds a timer
+	 */
+	int addTimer(int endVal, uint firstDuration, uint duration);
 public:
 	int _field60;
 	CursorId _cursorId;
diff --git a/engines/titanic/game/cdrom.cpp b/engines/titanic/game/cdrom.cpp
index 0d89319..0fd7eb5 100644
--- a/engines/titanic/game/cdrom.cpp
+++ b/engines/titanic/game/cdrom.cpp
@@ -65,6 +65,7 @@ bool CCDROM::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 		if (newTray->_state && newTray->_insertedCD == "None") {
 			CActMsg actMsg(getName());
 			actMsg.execute(newTray);
+			setVisible(false);
 		}
 	}
 
diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp
index 04de5e5..f0fab26 100644
--- a/engines/titanic/game/computer_screen.cpp
+++ b/engines/titanic/game/computer_screen.cpp
@@ -24,6 +24,13 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CComputerScreen, CGameObject)
+	ON_MESSAGE(ActMsg)
+	ON_MESSAGE(MovieEndMsg)
+	ON_MESSAGE(EnterViewMsg)
+	ON_MESSAGE(TimerMsg)
+END_MESSAGE_MAP()
+
 CComputerScreen::CComputerScreen() : CGameObject() {
 }
 
@@ -37,4 +44,35 @@ void CComputerScreen::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CComputerScreen::ActMsg(CActMsg *msg) {
+	if (msg->_action == "newCD1" || msg->_action == "newCD2") {
+		playMovie(27, 53, 16);
+		playMovie(19, 26, 16);
+	} else if (msg->_action == "newSTCD") {
+		playMovie(0, 18, 20);
+	}
+
+	return true;
+}
+
+bool CComputerScreen::MovieEndMsg(CMovieEndMsg *msg) {
+	playSound("z#47.wav", 100, 0, 0);
+	addTimer(0, 3000, 0);
+
+	for (int idx = 0; idx < 10; ++idx)
+		playMovie(0, 18, 0);
+	return true;
+}
+
+bool CComputerScreen::EnterViewMsg(CEnterViewMsg *msg) {
+	loadFrame(26);
+	return true;
+}
+
+bool CComputerScreen::TimerMsg(CTimerMsg *msg) {
+	// TODO
+	warning("TODO: CComputerScreen::TimerMsg");
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game/computer_screen.h b/engines/titanic/game/computer_screen.h
index aa47482..fa02ef5 100644
--- a/engines/titanic/game/computer_screen.h
+++ b/engines/titanic/game/computer_screen.h
@@ -28,6 +28,11 @@
 namespace Titanic {
 
 class CComputerScreen : public CGameObject {
+	DECLARE_MESSAGE_MAP
+	bool ActMsg(CActMsg *msg);
+	bool MovieEndMsg(CMovieEndMsg *msg);
+	bool EnterViewMsg(CEnterViewMsg *msg);
+	bool TimerMsg(CTimerMsg *msg);
 public:
 	CLASSDEF
 	CComputerScreen();


Commit: 36d60d7476b62aef07914325adb6f9fd7b30132f
    https://github.com/scummvm/scummvm/commit/36d60d7476b62aef07914325adb6f9fd7b30132f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:10:57-04:00

Commit Message:
TITANIC: Added remainder of CCarry msg handlers

Changed paths:
    engines/titanic/carry/carry.cpp
    engines/titanic/carry/carry.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/events.cpp
    engines/titanic/events.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/messages/messages.h
    engines/titanic/messages/mouse_messages.h



diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index dbb7189..cc12fd1 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -23,6 +23,7 @@
 #include "titanic/carry/carry.h"
 #include "titanic/messages/messages.h"
 #include "titanic/npcs/character.h"
+#include "titanic/npcs/succubus.h"
 
 namespace Titanic {
 
@@ -43,9 +44,9 @@ END_MESSAGE_MAP()
 
 CCarry::CCarry() : CGameObject(), _fieldDC(0), _fieldE0(1),
 	_field100(0), _field104(0), _field108(0), _field10C(0),
-	_field110(0), _field120(0), _field124(0), _field128(0),
+	_itemFrame(0), _enterFrame(0), _enterFrameSet(false), _visibleFrame(0),
 	_string1("None"),
-	_string2("NULL"),
+	_fullViewName("NULL"),
 	_string3("That doesn't seem to do anything."),
 	_string4("It doesn't seem to want this.") {
 }
@@ -53,8 +54,8 @@ CCarry::CCarry() : CGameObject(), _fieldDC(0), _fieldE0(1),
 void CCarry::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
-	file->writePoint(_pos1, indent);
-	file->writeQuotedLine(_string2, indent);
+	file->writePoint(_origPos, indent);
+	file->writeQuotedLine(_fullViewName, indent);
 	file->writeNumberLine(_fieldDC, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeQuotedLine(_string3, indent);
@@ -63,11 +64,11 @@ void CCarry::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_field104, indent);
 	file->writeNumberLine(_field108, indent);
 	file->writeNumberLine(_field10C, indent);
-	file->writeNumberLine(_field110, indent);
+	file->writeNumberLine(_itemFrame, indent);
 	file->writeQuotedLine(_string5, indent);
-	file->writeNumberLine(_field120, indent);
-	file->writeNumberLine(_field124, indent);
-	file->writeNumberLine(_field128, indent);
+	file->writeNumberLine(_enterFrame, indent);
+	file->writeNumberLine(_enterFrameSet, indent);
+	file->writeNumberLine(_visibleFrame, indent);
 
 	CGameObject::save(file, indent);
 }
@@ -75,8 +76,8 @@ void CCarry::save(SimpleFile *file, int indent) const {
 void CCarry::load(SimpleFile *file) {
 	file->readNumber();
 	_string1 = file->readString();
-	_pos1 = file->readPoint();
-	_string2 = file->readString();
+	_origPos = file->readPoint();
+	_fullViewName = file->readString();
 	_fieldDC = file->readNumber();
 	_fieldE0 = file->readNumber();
 	_string3 = file->readString();
@@ -85,11 +86,11 @@ void CCarry::load(SimpleFile *file) {
 	_field104 = file->readNumber();
 	_field108 = file->readNumber();
 	_field10C = file->readNumber();
-	_field110 = file->readNumber();
+	_itemFrame = file->readNumber();
 	_string5 = file->readString();
-	_field120 = file->readNumber();
-	_field124 = file->readNumber();
-	_field128 = file->readNumber();
+	_enterFrame = file->readNumber();
+	_enterFrameSet = file->readNumber();
+	_visibleFrame = file->readNumber();
 
 	CGameObject::load(file);
 }
@@ -142,12 +143,30 @@ bool CCarry::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 			return true;
 	}
 
-	// TODO
+	CString viewName = getViewFullName();
+	if (viewName.empty() || msg->_mousePos.y >= 360) {
+		sleep(250);
+		dropOnPet();
+	} else {
+		setPosition(_origPos);
+		loadFrame(_itemFrame);
+	}
 
 	return true;
 }
 
 bool CCarry::UseWithCharMsg(CUseWithCharMsg *msg) {
+	CSuccUBus *succubus = static_cast<CSuccUBus *>(msg->_character);
+	if (succubus) {
+		CSubAcceptCCarryMsg carryMsg;
+		carryMsg._item = this;
+		carryMsg.execute(succubus);
+	} else {
+		CShowTextMsg textMsg(_string4);
+		textMsg.execute("PET");
+		dropOnPet();
+	}
+
 	return true;
 }
 
@@ -156,10 +175,25 @@ bool CCarry::LeaveViewMsg(CLeaveViewMsg *msg) {
 }
 
 bool CCarry::UseWithOtherMsg(CUseWithOtherMsg *msg) {
+	CShowTextMsg textMsg(_string3);
+	textMsg.execute("PET");
+
+	_fullViewName = getViewFullName();
+	if (_fullViewName.empty() || _bounds.top >= 360) {
+		sleep(250);
+		dropOnPet();
+	} else {
+		setPosition(_origPos);
+	}
+
 	return true;
 }
 
 bool CCarry::VisibleMsg(CVisibleMsg *msg) {
+	setVisible(msg->_visible);
+	if (msg->_visible && _visibleFrame != -1)
+		loadFrame(_visibleFrame);
+
 	return true;
 }
 
@@ -168,18 +202,38 @@ bool CCarry::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 }
 
 bool CCarry::RemoveFromGameMsg(CRemoveFromGameMsg *msg) {
+	setPosition(Point(0, 0));
+	setVisible(false);
+
 	return true;
 }
 
 bool CCarry::MoveToStartPosMsg(CMoveToStartPosMsg *msg) {
+	setPosition(_origPos);
 	return true;
 }
 
 bool CCarry::EnterViewMsg(CEnterViewMsg *msg) {
+	if (!_enterFrameSet) {
+		loadFrame(_enterFrame);
+		_enterFrameSet = true;
+	}
+
 	return true;
 }
 
 bool CCarry::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
+	if (_visibleFrame != -1)
+		loadFrame(_visibleFrame);
+
+	if (msg->_value3) {
+		_tempPos.x = _bounds.width() / 2;
+		_tempPos.y = _bounds.height() / 2;
+	} else {
+		_tempPos = msg->_mousePos - _bounds;
+	}
+
+	setPosition(_tempPos - getMousePos());
 	return true;
 }
 
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index 33e3ac3..e292eb2 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -45,8 +45,8 @@ class CCarry : public CGameObject {
 	bool PassOnDragStartMsg(CPassOnDragStartMsg *msg);
 private:
 	CString _string1;
-	Point _pos1;
-	CString _string2;
+	Point _origPos;
+	CString _fullViewName;
 	int _fieldDC;
 	int _fieldE0;
 	CString _string3;
@@ -56,11 +56,11 @@ private:
 	int _field104;
 	int _field108;
 	int _field10C;
-	int _field110;
+	int _itemFrame;
 	CString _string5;
-	int _field120;
-	int _field124;
-	int _field128;
+	int _enterFrame;
+	bool _enterFrameSet;
+	int _visibleFrame;
 protected:
 	/**
 	 * Called when an item is dropped onto the PET
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 7e731bdb..0bd246d 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -405,7 +405,7 @@ void CGameObject::resetPosition() {
 	setPosition(_savedPos);
 }
 
-void CGameObject::setPosition(const Common::Point &newPos) {
+void CGameObject::setPosition(const Point &newPos) {
 	makeDirty();
 	_bounds.moveTo(newPos);
 	makeDirty();
@@ -540,4 +540,22 @@ CViewItem *CGameObject::parseView(const CString &viewString) {
 	return view;
 }
 
+CString CGameObject::getViewFullName() const {
+	CGameManager *gameManager = getGameManager();
+	CViewItem *view = gameManager->getView();
+	CNodeItem *node = view->findNode();
+	CRoomItem *room = node->findRoom();
+
+	return CString::format("%s.%s.%s", room->getName().c_str(),
+		node->getName().c_str(), view->getName().c_str());
+}
+
+void CGameObject::sleep(uint milli) {
+	g_vm->_events->sleep(milli);
+}
+
+Point CGameObject::getMousePos() const {
+	return getGameManager()->_gameState.getMousePos();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index bc1020d..9e84a45 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -145,6 +145,16 @@ protected:
 	 * Adds a timer
 	 */
 	int addTimer(int endVal, uint firstDuration, uint duration);
+
+	/**
+	 * Causes the game to sleep for the specified time
+	 */
+	void sleep(uint milli);
+
+	/**
+	 * Get the current mouse cursor position
+	 */
+	Point getMousePos() const;
 public:
 	int _field60;
 	CursorId _cursorId;
@@ -191,7 +201,7 @@ public:
 	/**
 	 * Set the position of the object
 	 */
-	void setPosition(const Common::Point &newPos);
+	void setPosition(const Point &newPos);
 
 	/**
 	 * Returns true if the object has a currently active movie
@@ -215,6 +225,11 @@ public:
 	 * Play the movie specified in _resource
 	 */
 	void playMovie(uint startFrame, uint endFrame, int val3);
+
+	/**
+	 * Return the current view/node/room as a single string
+	 */
+	CString getViewFullName() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index 480cc91..5901073 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -227,4 +227,12 @@ void Events::handleKbdSpecial(Common::KeyState keyState) {
 		_specialButtons &= ~MK_SHIFT;
 }
 
+void Events::sleep(uint time) {
+	uint32 delayEnd = g_system->getMillis() + time;
+
+	while (!_vm->shouldQuit() && g_system->getMillis() < delayEnd) {
+		pollEventsAndWait();
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/events.h b/engines/titanic/events.h
index f85a3d9..4cbba17 100644
--- a/engines/titanic/events.h
+++ b/engines/titanic/events.h
@@ -103,6 +103,11 @@ public:
 	 * Return whether a given special key is currently pressed
 	 */
 	bool isSpecialPressed(SpecialButtons btn) const { return _specialButtons; }
+
+	/**
+	 * Sleep for a specified period of time
+	 */
+	void sleep(uint time);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index fab7d11..7c59aaf 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -96,10 +96,6 @@ void CGameState::setMode(GameStateMode newMode) {
 	_mode = newMode;
 }
 
-void CGameState::setMousePos(const Point &pt) {
-	_mousePos = pt;
-}
-
 void CGameState::enterNode() {
 	++_nodeChangeCtr;
 	_nodeEnterTicks = g_vm->_events->getTicksCount();
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 5d4b686..0fe8e6a 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -87,7 +87,12 @@ public:
 	/**
 	 * Sets the current mouse position
 	 */
-	void setMousePos(const Point &pt);
+	void setMousePos(const Point &pt) { _mousePos = pt; }
+
+	/**
+	 * Gets the current mouse position
+	 */
+	Point getMousePos() const { return _mousePos; }
 
 	/**
 	 * Called by the PET when a new node is entered
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 474565a..ab3078d 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -198,19 +198,6 @@ public:
 	}
 };
 
-class CSubAcceptCCarryMsg : public CMessage {
-public:
-	CString _string1;
-	int _value1, _value2, _value3;
-public:
-	CLASSDEF
-	CSubAcceptCCarryMsg() : _value1(0), _value2(0), _value3(0) {}
-
-	static bool isSupportedBy(const CTreeItem *item) {
-		return supports(item, _type);
-	}
-};
-
 class CTransportMsg : public CMessage {
 public:
 	CString _string;
@@ -366,6 +353,7 @@ MESSAGE2(CSpeechFallsFromTreeMsg, int, value1, 0, int, value2, 0);
 MESSAGE1(CStartMusicMsg, int, value, 0);
 MESSAGE3(CStatusChangeMsg, int, oldStatus, 0, int, newStatus, 0, bool, success, false);
 MESSAGE1(CStopMusicMsg, int, value, 0);
+MESSAGE4(CSubAcceptCCarryMsg, CString, string1, "", int, value1, 0, int, value2, 0, CCarry *, item, nullptr);
 MESSAGE0(CSubDeliverCCarryMsg);
 MESSAGE0(CSubSendCCarryMsg);
 MESSAGE0(CSUBTransition);
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 705247a..ce02e1d 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -142,10 +142,13 @@ public:
 class CPassOnDragStartMsg : public CMessage {
 public:
 	Point _mousePos;
+	int _value3;
+	int _value4;
 public:
 	CLASSDEF
 	CPassOnDragStartMsg() : CMessage() {}
-	CPassOnDragStartMsg(const Point &pt) : CMessage(), _mousePos(pt) {}
+	CPassOnDragStartMsg(const Point &pt, int v3 = 0, int v4 = 0) : 
+		CMessage(), _mousePos(pt), _value3(v3), _value4(v4) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return supports(item, _type);


Commit: c096bfa5d89f43e68fffbe390e73bad08e4f1745
    https://github.com/scummvm/scummvm/commit/c096bfa5d89f43e68fffbe390e73bad08e4f1745
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:10:59-04:00

Commit Message:
TITANIC: Implementing CArm message handlers

Changed paths:
    engines/titanic/carry/arm.cpp
    engines/titanic/carry/arm.h
    engines/titanic/carry/carry.cpp
    engines/titanic/carry/carry.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/messages/messages.h



diff --git a/engines/titanic/carry/arm.cpp b/engines/titanic/carry/arm.cpp
index fdf73e9..f2c7d52 100644
--- a/engines/titanic/carry/arm.cpp
+++ b/engines/titanic/carry/arm.cpp
@@ -24,10 +24,20 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CArm, CCarry)
+	ON_MESSAGE(PuzzleSolvedMsg)
+	ON_MESSAGE(TranslateObjectMsg)
+	ON_MESSAGE(UseWithOtherMsg)
+	ON_MESSAGE(MouseDragStartMsg)
+	ON_MESSAGE(MaitreDHappyMsg)
+	ON_MESSAGE(PETGainedObjectMsg)
+	ON_MESSAGE(MouseDragMoveMsg)
+END_MESSAGE_MAP()
+
 CArm::CArm() : CCarry(), _string6("Key"),
 	_field138(0), _field13C(0), _field140(0), _field144(0),
-	_field148(0), _field158(0), _field15C(220), _field160(208),
-	_field164(409), _field168(350), _field16C(3), _field170(0) {
+	_field148(0), _field158(0), _armRect(220, 208, 409, 350),
+	_field16C(3), _field170(0) {
 }
 
 void CArm::save(SimpleFile *file, int indent) const {
@@ -41,10 +51,10 @@ void CArm::save(SimpleFile *file, int indent) const {
 
 	file->writeQuotedLine(_string7, indent);
 	file->writeNumberLine(_field158, indent);
-	file->writeNumberLine(_field15C, indent);
-	file->writeNumberLine(_field160, indent);
-	file->writeNumberLine(_field164, indent);
-	file->writeNumberLine(_field168, indent);
+	file->writeNumberLine(_armRect.left, indent);
+	file->writeNumberLine(_armRect.top, indent);
+	file->writeNumberLine(_armRect.right, indent);
+	file->writeNumberLine(_armRect.bottom, indent);
 	file->writeNumberLine(_field16C, indent);
 	file->writeNumberLine(_field170, indent);
 
@@ -62,14 +72,80 @@ void CArm::load(SimpleFile *file) {
 
 	_string7 = file->readString();
 	_field158 = file->readNumber();
-	_field15C = file->readNumber();
-	_field160 = file->readNumber();
-	_field164 = file->readNumber();
-	_field168 = file->readNumber();
+	_armRect.left = file->readNumber();
+	_armRect.top = file->readNumber();
+	_armRect.right = file->readNumber();
+	_armRect.bottom = file->readNumber();
 	_field16C = file->readNumber();
 	_field170 = file->readNumber();
 
 	CCarry::load(file);
 }
 
+bool CArm::PuzzleSolvedMsg(CPuzzleSolvedMsg *msg) {
+	_field138 = 0;
+	_fieldE0 = 1;
+
+	CString name = getName();
+	if (name == "Arm1") {
+		CActMsg actMsg("LoseArm");
+		actMsg.execute("MaitreD");
+		CPuzzleSolvedMsg solvedMsg;
+		solvedMsg.execute("AuditoryCentre");
+	} else if (name == "Arm2") {
+		CPuzzleSolvedMsg solvedMsg;
+		solvedMsg.execute("Key");
+	}
+
+	return true;
+}
+
+bool CArm::TranslateObjectMsg(CTranslateObjectMsg *msg) {
+	Point newPos(_bounds.left - msg->_delta.x, _bounds.top - msg->_delta.y);
+	setPosition(newPos);
+	return true;
+}
+
+bool CArm::UseWithOtherMsg(CUseWithOtherMsg *msg) {
+	return true;
+}
+
+bool CArm::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+	return true;
+}
+
+bool CArm::MaitreDHappyMsg(CMaitreDHappyMsg *msg) {
+	// TODO
+	return true;
+}
+
+bool CArm::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
+	if (_field158) {
+		if (_string6 == "Key" || _string6 == "AuditoryCentre") {
+			CCarry *child = static_cast<CCarry *>(getFirstChild());
+			if (child) {
+				_visibleFrame = _field170;
+				loadFrame(_visibleFrame);
+				child->setVisible(true);
+				child->dropOnPet();
+			}
+
+			_string6 = "None";
+		}
+	}
+
+	return true;
+}
+
+bool CArm::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
+	setPosition(msg->_mousePos - _tempPos);
+
+	if (_string6 != "None" && compareViewNameTo("FrozenArboretum.Node 5.S")) {
+		loadFrame(_armRect.contains(msg->_mousePos) ?
+			_field16C : _visibleFrame);
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/arm.h b/engines/titanic/carry/arm.h
index 1f93009..60f597e 100644
--- a/engines/titanic/carry/arm.h
+++ b/engines/titanic/carry/arm.h
@@ -24,10 +24,21 @@
 #define TITANIC_ARM_H
 
 #include "titanic/carry/carry.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
+#include "titanic/messages/pet_messages.h"
 
 namespace Titanic {
 
 class CArm : public CCarry {
+	DECLARE_MESSAGE_MAP
+	bool PuzzleSolvedMsg(CPuzzleSolvedMsg *msg);
+	bool TranslateObjectMsg(CTranslateObjectMsg *msg);
+	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
+	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
+	bool MaitreDHappyMsg(CMaitreDHappyMsg *msg);
+	bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
+	bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
 private:
 	CString _string6;
 	int _field138;
@@ -37,10 +48,7 @@ private:
 	int _field148;
 	CString _string7;
 	int _field158;
-	int _field15C;
-	int _field160;
-	int _field164;
-	int _field168;
+	Rect _armRect;
 	int _field16C;
 	int _field170;
 public:
diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index cc12fd1..9968c52 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -43,8 +43,8 @@ BEGIN_MESSAGE_MAP(CCarry, CGameObject)
 END_MESSAGE_MAP()
 
 CCarry::CCarry() : CGameObject(), _fieldDC(0), _fieldE0(1),
-	_field100(0), _field104(0), _field108(0), _field10C(0),
-	_itemFrame(0), _enterFrame(0), _enterFrameSet(false), _visibleFrame(0),
+		_field100(0), _field104(0), _field108(0), _field10C(0),
+		_itemFrame(0), _enterFrame(0), _enterFrameSet(false), _visibleFrame(0),
 	_string1("None"),
 	_fullViewName("NULL"),
 	_string3("That doesn't seem to do anything."),
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index e292eb2..b14ba05 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -43,7 +43,7 @@ class CCarry : public CGameObject {
 	bool MoveToStartPosMsg(CMoveToStartPosMsg *msg);
 	bool EnterViewMsg(CEnterViewMsg *msg);
 	bool PassOnDragStartMsg(CPassOnDragStartMsg *msg);
-private:
+protected:
 	CString _string1;
 	Point _origPos;
 	CString _fullViewName;
@@ -62,10 +62,7 @@ private:
 	bool _enterFrameSet;
 	int _visibleFrame;
 protected:
-	/**
-	 * Called when an item is dropped onto the PET
-	 */
-	void dropOnPet();
+
 public:
 	CLASSDEF
 	CCarry();
@@ -79,6 +76,11 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
+
+	/**
+	 * Called to drop an item into the PET
+	 */
+	void dropOnPet();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 0bd246d..4628ccc 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -558,4 +558,8 @@ Point CGameObject::getMousePos() const {
 	return getGameManager()->_gameState.getMousePos();
 }
 
+bool CGameObject::compareViewNameTo(const CString &name) const {
+	return getViewFullName().compareToIgnoreCase(name);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 9e84a45..658c844 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -127,7 +127,6 @@ protected:
 
 	bool soundFn1(int val);
 	void soundFn2(int val, int val2);
-	void setVisible(bool val);
 	void petFn2(int val);
 	void petFn3(CTreeItem *item);
 
@@ -155,6 +154,12 @@ protected:
 	 * Get the current mouse cursor position
 	 */
 	Point getMousePos() const;
+
+	/*
+	 * Compares the current view's name in a Room.Node.View tuplet
+	 * string form to the passed string
+	 */
+	bool compareViewNameTo(const CString &name) const;
 public:
 	int _field60;
 	CursorId _cursorId;
@@ -230,6 +235,11 @@ public:
 	 * Return the current view/node/room as a single string
 	 */
 	CString getViewFullName() const;
+
+	/**
+	 * Sets whether the object is visible
+	 */
+	void setVisible(bool val);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 5b04537..2eacbba 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -925,6 +925,7 @@ DEFFN(CTimeMsg)
 DEFFN(CTimerMsg)
 DEFFN(CTitleSequenceEndedMsg)
 DEFFN(CTransitMsg)
+DEFFN(CTranslateObjectMsg)
 DEFFN(CTransportMsg)
 DEFFN(CTriggerAutoMusicPlayerMsg)
 DEFFN(CTriggerNPCEvent)
@@ -1510,6 +1511,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CTimerMsg, CTimeMsg);
 	ADDFN(CTitleSequenceEndedMsg, CMessage);
 	ADDFN(CTransitMsg, CMessage);
+	ADDFN(CTranslateObjectMsg, CMessage);
 	ADDFN(CTransportMsg, CMessage);
 	ADDFN(CTriggerAutoMusicPlayerMsg, CMessage);
 	ADDFN(CTriggerNPCEvent, CMessage);
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index ab3078d..6d0df5b 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -366,6 +366,7 @@ MESSAGE2(CTextInputMsg, CString, value1, "", CString, value2, "");
 MESSAGE1(CTimeDilationMsg, int, value, 0);
 MESSAGE0(CTitleSequenceEndedMsg);
 MESSAGE0(CTransitMsg);
+MESSAGE1(CTranslateObjectMsg, Point, delta, Point());
 MESSAGE1(CTriggerAutoMusicPlayerMsg, int, value, 0);
 MESSAGE1(CTriggerNPCEvent, int, value, 0);
 MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, int, value2, 0, int, value3, 0, int, value4, 0);


Commit: 5cd3dd0d69dead3ca795468716353f9d7d4da7a8
    https://github.com/scummvm/scummvm/commit/5cd3dd0d69dead3ca795468716353f9d7d4da7a8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:00-04:00

Commit Message:
TITANIC: Adding CCarry descendent msg handlers

Changed paths:
    engines/titanic/carry/phonograph_cylinder.cpp
    engines/titanic/carry/phonograph_cylinder.h
    engines/titanic/carry/photograph.cpp
    engines/titanic/carry/photograph.h
    engines/titanic/carry/plug_in.cpp
    engines/titanic/carry/plug_in.h
    engines/titanic/carry/sweets.cpp
    engines/titanic/carry/sweets.h



diff --git a/engines/titanic/carry/phonograph_cylinder.cpp b/engines/titanic/carry/phonograph_cylinder.cpp
index fb58c32..18e646d 100644
--- a/engines/titanic/carry/phonograph_cylinder.cpp
+++ b/engines/titanic/carry/phonograph_cylinder.cpp
@@ -21,9 +21,18 @@
  */
 
 #include "titanic/carry/phonograph_cylinder.h"
+#include "titanic/game/phonograph.h"
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPhonographCylinder, CCarry)
+	ON_MESSAGE(UseWithOtherMsg)
+	ON_MESSAGE(QueryCylinderMsg)
+	ON_MESSAGE(RecordOntoCylinderMsg)
+	ON_MESSAGE(SetMusicControlsMsg)
+	ON_MESSAGE(ErasePhonographCylinderMsg)
+END_MESSAGE_MAP()
+
 CPhonographCylinder::CPhonographCylinder() : CCarry(),
 	_field138(0), _field13C(0), _field140(0),  _field144(0), 
 	_field148(0), _field14C(0), _field150(0), _field154(0), 
@@ -86,4 +95,30 @@ void CPhonographCylinder::load(SimpleFile *file) {
 	CCarry::load(file);
 }
 
+bool CPhonographCylinder::UseWithOtherMsg(CUseWithOtherMsg *msg) {
+	CPhonograph *phonograph = static_cast<CPhonograph *>(msg->_other);
+	if (phonograph) {
+		CSetVarMsg varMsg("m_RecordStatus", 1);
+		return true;
+	} else {
+		return CCarry::UseWithOtherMsg(msg);
+	}
+}
+
+bool CPhonographCylinder::QueryCylinderMsg(CQueryCylinderMsg *msg) {
+	msg->_
+}
+
+bool CPhonographCylinder::RecordOntoCylinderMsg(CRecordOntoCylinderMsg *msg) {
+
+}
+
+bool CPhonographCylinder::SetMusicControlsMsg(CSetMusicControlsMsg *msg) {
+
+}
+
+bool CPhonographCylinder::ErasePhonographCylinderMsg(CErasePhonographCylinderMsg *msg) {
+
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/phonograph_cylinder.h b/engines/titanic/carry/phonograph_cylinder.h
index 271ede5..08db4b2 100644
--- a/engines/titanic/carry/phonograph_cylinder.h
+++ b/engines/titanic/carry/phonograph_cylinder.h
@@ -28,6 +28,12 @@
 namespace Titanic {
 
 class CPhonographCylinder : public CCarry {
+	DECLARE_MESSAGE_MAP
+	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
+	bool QueryCylinderMsg(CQueryCylinderMsg *msg);
+	bool RecordOntoCylinderMsg(CRecordOntoCylinderMsg *msg);
+	bool SetMusicControlsMsg(CSetMusicControlsMsg *msg);
+	bool ErasePhonographCylinderMsg(CErasePhonographCylinderMsg *msg);
 private:
 	CString _string6;
 	int _field138;
diff --git a/engines/titanic/carry/photograph.cpp b/engines/titanic/carry/photograph.cpp
index 92549b3..a7c5d8d 100644
--- a/engines/titanic/carry/photograph.cpp
+++ b/engines/titanic/carry/photograph.cpp
@@ -21,9 +21,17 @@
  */
 
 #include "titanic/carry/photograph.h"
+#include "titanic/core/room_item.h"
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPhotograph, CCarry)
+	ON_MESSAGE(MouseDragStartMsg)
+	ON_MESSAGE(MouseDragEndMsg)
+	ON_MESSAGE(PETGainedObjectMsg)
+	ON_MESSAGE(ActMsg)
+END_MESSAGE_MAP()
+
 int CPhotograph::_v1;
 
 CPhotograph::CPhotograph() : CCarry(), _field12C(0), _field130(0) {
@@ -47,4 +55,43 @@ void CPhotograph::load(SimpleFile *file) {
 	CCarry::load(file);
 }
 
+bool CPhotograph::MouseDragEndMsg(CMouseDragEndMsg *msg) {
+	_v1 = 0;
+	CGameObject *target = msg->_dropTarget;
+
+	if (target && target->getName() != "NavigationComputer") {
+		warning("TODO: CPhotograph::MouseDragEndMsg");
+	} else {
+		return CCarry::MouseDragEndMsg(msg);
+	}
+}
+
+bool CPhotograph::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+	if (checkPoint(msg->_mousePos, true, true)) {
+		_v1 = true;
+		CActMsg actMsg("PlayerPicksUpPhoto");
+		actMsg.execute("Doorbot");
+	}
+
+	return CCarry::MouseDragStartMsg(msg);
+}
+
+bool CPhotograph::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
+	if (getRoom()->getName() == "Home") {
+		CActMsg actMsg("PlayerPutsPhotoInPET");
+		actMsg.execute("Doorbot");
+	}
+
+	return true;
+}
+
+bool CPhotograph::ActMsg(CActMsg *msg) {
+	if (msg->_action == "BecomeGettable") {
+		_fieldE0 = 1;
+		_cursorId = CURSOR_HAND;
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/photograph.h b/engines/titanic/carry/photograph.h
index 4141280..b7ce488 100644
--- a/engines/titanic/carry/photograph.h
+++ b/engines/titanic/carry/photograph.h
@@ -24,10 +24,18 @@
 #define TITANIC_PHOTOGRAPH_H
 
 #include "titanic/carry/carry.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
+#include "titanic/messages/pet_messages.h"
 
 namespace Titanic {
 
 class CPhotograph : public CCarry {
+	DECLARE_MESSAGE_MAP
+	bool MouseDragEndMsg(CMouseDragEndMsg *msg);
+	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
+	bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
+	bool ActMsg(CActMsg *msg);
 private:
 	static int _v1;
 private:
diff --git a/engines/titanic/carry/plug_in.cpp b/engines/titanic/carry/plug_in.cpp
index ff8d9b1..e4fe54d 100644
--- a/engines/titanic/carry/plug_in.cpp
+++ b/engines/titanic/carry/plug_in.cpp
@@ -24,6 +24,10 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPlugIn, CCarry)
+	ON_MESSAGE(UseWithOtherMsg)
+END_MESSAGE_MAP()
+
 CPlugIn::CPlugIn() : CCarry(), _field12C(0) {
 }
 
@@ -37,4 +41,28 @@ void CPlugIn::load(SimpleFile *file) {
 	CCarry::load(file);
 }
 
+bool CPlugIn::UseWithOtherMsg(CUseWithOtherMsg *msg) {
+	CGameObject *other = msg->_other;
+	CString otherName = other->getName();
+
+	if (otherName == "PET") {
+		return CCarry::UseWithOtherMsg(msg);
+	} else if (otherName == "DatasideTransporter") {
+		CString name = getName();
+		if (name == "DatasideTransporter") {
+			// TODO
+			if (name != "SendYourself") {
+				// TODO
+			}
+		} else {
+			// TODO	
+		}
+	} else {
+		CShowTextMsg textMsg("This item is incorrectly calibrated.");
+		textMsg.execute("PET");
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/plug_in.h b/engines/titanic/carry/plug_in.h
index 89a4832..f48a74b 100644
--- a/engines/titanic/carry/plug_in.h
+++ b/engines/titanic/carry/plug_in.h
@@ -28,6 +28,8 @@
 namespace Titanic {
 
 class CPlugIn : public CCarry {
+	DECLARE_MESSAGE_MAP
+	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
 private:
 	int _field12C;
 public:
diff --git a/engines/titanic/carry/sweets.cpp b/engines/titanic/carry/sweets.cpp
index faf3ad9..71295a3 100644
--- a/engines/titanic/carry/sweets.cpp
+++ b/engines/titanic/carry/sweets.cpp
@@ -24,6 +24,10 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CSweets, CCarry)
+	ON_MESSAGE(MouseButtonUpMsg)
+END_MESSAGE_MAP()
+
 CSweets::CSweets() : CCarry() {
 }
 
@@ -37,4 +41,8 @@ void CSweets::load(SimpleFile *file) {
 	CCarry::load(file);
 }
 
+bool CSweets::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/sweets.h b/engines/titanic/carry/sweets.h
index a18a1fb..7fc0787 100644
--- a/engines/titanic/carry/sweets.h
+++ b/engines/titanic/carry/sweets.h
@@ -24,10 +24,13 @@
 #define TITANIC_SWEETS_H
 
 #include "titanic/carry/carry.h"
+#include "titanic/messages/mouse_messages.h"
 
 namespace Titanic {
 
 class CSweets : public CCarry {
+	DECLARE_MESSAGE_MAP
+	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
 public:
 	CLASSDEF
 	CSweets();


Commit: fdbb1868e4838248cc69302046c04700635beb55
    https://github.com/scummvm/scummvm/commit/fdbb1868e4838248cc69302046c04700635beb55
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:01-04:00

Commit Message:
TITANIC: Implemented CPhonographCylinder msg handlers

Changed paths:
    engines/titanic/carry/phonograph_cylinder.cpp
    engines/titanic/carry/phonograph_cylinder.h
    engines/titanic/carry/photograph.cpp
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/messages/messages.h



diff --git a/engines/titanic/carry/phonograph_cylinder.cpp b/engines/titanic/carry/phonograph_cylinder.cpp
index 18e646d..e2a7a99 100644
--- a/engines/titanic/carry/phonograph_cylinder.cpp
+++ b/engines/titanic/carry/phonograph_cylinder.cpp
@@ -34,63 +34,66 @@ BEGIN_MESSAGE_MAP(CPhonographCylinder, CCarry)
 END_MESSAGE_MAP()
 
 CPhonographCylinder::CPhonographCylinder() : CCarry(),
-	_field138(0), _field13C(0), _field140(0),  _field144(0), 
-	_field148(0), _field14C(0), _field150(0), _field154(0), 
-	_field158(0), _field15C(0), _field160(0), _field164(0), 
-	_field168(0), _field16C(0), _field170(0), _field174(0), 
-	_field178(0), _field17C(0), _field180(0), _field184(0) {
+		_bellsMuteControl(false), _bellsPitchControl(false),
+		_bellsSpeedControl(false), _bellsDirectionControl(false),
+		_bellsInversionControl(false), _snakeMuteControl(false),
+		_snakeSpeedControl(false), _snakePitchControl(false),
+		_snakeInversionControl(false), _snakeDirectionControl(false),
+		_pianoMuteControl(false), _pianoSpeedControl(false),
+		_pianoPitchControl(false), _pianoInversionControl(false),
+		_pianoDirectionControl(false), _bassMuteControl(false),
+		_bassSpeedControl(false), _bassPitchControl(false),
+		_bassInversionControl(false) {
 }
 
 void CPhonographCylinder::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string6, indent);
-	file->writeNumberLine(_field138, indent);
-	file->writeNumberLine(_field13C, indent);
-	file->writeNumberLine(_field140, indent);
-	file->writeNumberLine(_field144, indent);
-	file->writeNumberLine(_field148, indent);
-	file->writeNumberLine(_field14C, indent);
-	file->writeNumberLine(_field150, indent);
-	file->writeNumberLine(_field154, indent);
-	file->writeNumberLine(_field158, indent);
-	file->writeNumberLine(_field15C, indent);
-	file->writeNumberLine(_field160, indent);
-	file->writeNumberLine(_field164, indent);
-	file->writeNumberLine(_field168, indent);
-	file->writeNumberLine(_field16C, indent);
-	file->writeNumberLine(_field170, indent);
-	file->writeNumberLine(_field174, indent);
-	file->writeNumberLine(_field178, indent);
-	file->writeNumberLine(_field17C, indent);
-	file->writeNumberLine(_field180, indent);
-	file->writeNumberLine(_field184, indent);
+	file->writeQuotedLine(_itemName, indent);
+	file->writeNumberLine(_bellsMuteControl, indent);
+	file->writeNumberLine(_bellsPitchControl, indent);
+	file->writeNumberLine(_bellsSpeedControl, indent);
+	file->writeNumberLine(_bellsDirectionControl, indent);
+	file->writeNumberLine(_bellsInversionControl, indent);
+	file->writeNumberLine(_snakeMuteControl, indent);
+	file->writeNumberLine(_snakeSpeedControl, indent);
+	file->writeNumberLine(_snakePitchControl, indent);
+	file->writeNumberLine(_snakeInversionControl, indent);
+	file->writeNumberLine(_snakeDirectionControl, indent);
+	file->writeNumberLine(_pianoMuteControl, indent);
+	file->writeNumberLine(_pianoSpeedControl, indent);
+	file->writeNumberLine(_pianoPitchControl, indent);
+	file->writeNumberLine(_pianoInversionControl, indent);
+	file->writeNumberLine(_pianoDirectionControl, indent);
+	file->writeNumberLine(_bassMuteControl, indent);
+	file->writeNumberLine(_bassSpeedControl, indent);
+	file->writeNumberLine(_bassPitchControl, indent);
+	file->writeNumberLine(_bassInversionControl, indent);
 
 	CCarry::save(file, indent);
 }
 
 void CPhonographCylinder::load(SimpleFile *file) {
 	file->readNumber();
-	_string6 = file->readString();
-	_field138 = file->readNumber();
-	_field13C = file->readNumber();
-	_field140 = file->readNumber();
-	_field144 = file->readNumber();
-	_field148 = file->readNumber();
-	_field14C = file->readNumber();
-	_field150 = file->readNumber();
-	_field154 = file->readNumber();
-	_field158 = file->readNumber();
-	_field15C = file->readNumber();
-	_field160 = file->readNumber();
-	_field164 = file->readNumber();
-	_field168 = file->readNumber();
-	_field16C = file->readNumber();
-	_field170 = file->readNumber();
-	_field174 = file->readNumber();
-	_field178 = file->readNumber();
-	_field17C = file->readNumber();
-	_field180 = file->readNumber();
-	_field184 = file->readNumber();
+	_itemName = file->readString();
+	_bellsMuteControl = file->readNumber();
+	_bellsPitchControl = file->readNumber();
+	_bellsSpeedControl = file->readNumber();
+	_bellsDirectionControl = file->readNumber();
+	_bellsInversionControl = file->readNumber();
+	_snakeMuteControl = file->readNumber();
+	_snakeSpeedControl = file->readNumber();
+	_snakePitchControl = file->readNumber();
+	_snakeInversionControl = file->readNumber();
+	_snakeDirectionControl = file->readNumber();
+	_pianoMuteControl = file->readNumber();
+	_pianoSpeedControl = file->readNumber();
+	_pianoPitchControl = file->readNumber();
+	_pianoInversionControl = file->readNumber();
+	_pianoDirectionControl = file->readNumber();
+	_bassMuteControl = file->readNumber();
+	_bassSpeedControl = file->readNumber();
+	_bassPitchControl = file->readNumber();
+	_bassInversionControl = file->readNumber();
 
 	CCarry::load(file);
 }
@@ -106,19 +109,68 @@ bool CPhonographCylinder::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 }
 
 bool CPhonographCylinder::QueryCylinderMsg(CQueryCylinderMsg *msg) {
-	msg->_
+	msg->_name = _itemName;
+	return true;
 }
 
 bool CPhonographCylinder::RecordOntoCylinderMsg(CRecordOntoCylinderMsg *msg) {
-
+	_itemName = "STMusic";
+	
+	CQueryMusicControlSettingMsg queryMsg;
+	queryMsg.execute("Bells Mute Control");
+	_bellsMuteControl = queryMsg._value;
+	queryMsg.execute("Bells Pitch Control");
+	_bellsPitchControl = queryMsg._value;
+	queryMsg.execute("Bells Speed Control");
+	_bellsSpeedControl = queryMsg._value;
+	queryMsg.execute("Bells Direction Control");
+	_bellsDirectionControl = queryMsg._value;
+	queryMsg.execute("Bells Inversion Control");
+	_bellsInversionControl = queryMsg._value;
+	queryMsg.execute("Snake Mute Control");
+	_snakeMuteControl = queryMsg._value;
+	queryMsg.execute("Snake Speed Control");
+	_snakeSpeedControl = queryMsg._value;
+	queryMsg.execute("Snake Pitch Control");
+	_snakePitchControl = queryMsg._value;
+	queryMsg.execute("Snake Inversion Control");
+	_snakeInversionControl = queryMsg._value;
+	queryMsg.execute("Snake Direction Control");
+	_snakeDirectionControl = queryMsg._value;
+	queryMsg.execute("Piano Mute Control");
+	_pianoMuteControl = queryMsg._value;
+	queryMsg.execute("Piano Speed Control");
+	_pianoSpeedControl = queryMsg._value;
+	queryMsg.execute("Piano Pitch Control");
+	_pianoPitchControl = queryMsg._value;	
+	queryMsg.execute("Piano Inversion Control");
+	_pianoInversionControl = queryMsg._value;
+	queryMsg.execute("Piano Direction Control");
+	_pianoDirectionControl = queryMsg._value;
+	queryMsg.execute("Bass Mute Control");
+	_bassMuteControl = queryMsg._value;
+	queryMsg.execute("Bass Speed Control");
+	_bassSpeedControl = queryMsg._value;
+	queryMsg.execute("Bass Pitch Control");
+	_bassPitchControl = queryMsg._value;
+	queryMsg.execute("Bass Inversion Control");
+	_bassInversionControl = queryMsg._value;
+
+	return true;
 }
 
 bool CPhonographCylinder::SetMusicControlsMsg(CSetMusicControlsMsg *msg) {
+	if (_itemName.left(7) == "STMusic") {
+		//todo
+		warning("TODO");
+	}
 
+	return true;
 }
 
 bool CPhonographCylinder::ErasePhonographCylinderMsg(CErasePhonographCylinderMsg *msg) {
-
+	_itemName.clear();
+	return true;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/phonograph_cylinder.h b/engines/titanic/carry/phonograph_cylinder.h
index 08db4b2..8c4ca64 100644
--- a/engines/titanic/carry/phonograph_cylinder.h
+++ b/engines/titanic/carry/phonograph_cylinder.h
@@ -35,27 +35,27 @@ class CPhonographCylinder : public CCarry {
 	bool SetMusicControlsMsg(CSetMusicControlsMsg *msg);
 	bool ErasePhonographCylinderMsg(CErasePhonographCylinderMsg *msg);
 private:
-	CString _string6;
-	int _field138;
-	int _field13C;
-	int _field140;
-	int _field144;
-	int _field148;
-	int _field14C;
-	int _field150;
-	int _field154;
-	int _field158;
-	int _field15C;
-	int _field160;
-	int _field164;
-	int _field168;
-	int _field16C;
-	int _field170;
-	int _field174;
-	int _field178;
-	int _field17C;
-	int _field180;
-	int _field184;
+	CString _itemName;
+	bool _bellsMuteControl;
+	bool _bellsPitchControl;
+	bool _bellsSpeedControl;
+	bool _bellsDirectionControl;
+	bool _bellsInversionControl;
+	bool _snakeMuteControl;
+	bool _snakeSpeedControl;
+	bool _snakePitchControl;
+	bool _snakeInversionControl;
+	bool _snakeDirectionControl;
+	bool _pianoMuteControl;
+	bool _pianoSpeedControl;
+	bool _pianoPitchControl;
+	bool _pianoInversionControl;
+	bool _pianoDirectionControl;
+	bool _bassMuteControl;
+	bool _bassSpeedControl;
+	bool _bassPitchControl;
+	bool _bassInversionControl;
+	bool _bassDirectionControl;
 public:
 	CLASSDEF
 	CPhonographCylinder();
diff --git a/engines/titanic/carry/photograph.cpp b/engines/titanic/carry/photograph.cpp
index a7c5d8d..7f76f39 100644
--- a/engines/titanic/carry/photograph.cpp
+++ b/engines/titanic/carry/photograph.cpp
@@ -61,6 +61,7 @@ bool CPhotograph::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 
 	if (target && target->getName() != "NavigationComputer") {
 		warning("TODO: CPhotograph::MouseDragEndMsg");
+		return true;
 	} else {
 		return CCarry::MouseDragEndMsg(msg);
 	}
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 80eac81..d86e9b2 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -297,6 +297,11 @@ CRoomItem *CTreeItem::getHiddenRoom() const {
 	return root ? root->findHiddenRoom() : nullptr;
 }
 
+CMusicRoom *CTreeItem::getMusicRoom() const {
+	CGameManager *gameManager = getGameManager();
+	return gameManager ? &gameManager->_musicRoom : nullptr;
+}
+
 int CTreeItem::getState8() const {
 	CGameManager *gameManager = getGameManager();
 	return gameManager ? gameManager->_gameState._field8 : 3;
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 4de030f..c44825f 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -30,6 +30,7 @@ namespace Titanic {
 class CGameManager;
 class CDontSaveFileItem;
 class CMessage;
+class CMusicRoom;
 class CNamedItem;
 class CPetControl;
 class CProjectItem;
@@ -262,6 +263,11 @@ public:
 	 */
 	CRoomItem *getHiddenRoom() const;
 
+	/**
+	 * Returns the music room instance from the game manager
+	 */
+	CMusicRoom *getMusicRoom() const;
+
 	int getState8() const;
 	int getStateC() const;
 };
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 6d0df5b..96749b7 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -321,8 +321,8 @@ MESSAGE1(CPutBotBackInHisBoxMsg, int, value, 0);
 MESSAGE1(CPutParrotBackMsg, int, value, 0);
 MESSAGE0(CPuzzleSolvedMsg);
 MESSAGE3(CQueryCylinderHolderMsg, int, value1, 0, int, value2, 0, int, value3, 0);
-MESSAGE3(CQueryCylinderMsg, int, value1, 0, int, value2, 0, int, value3, 0);
-MESSAGE3(CQueryCylinderNameMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE1(CQueryCylinderMsg, CString, name, "");
+MESSAGE1(CQueryCylinderNameMsg, CString, name, "");
 MESSAGE3(CQueryCylinderTypeMsg, int, value1, 0, int, value2, 0, int, value3, 0);
 MESSAGE1(CQueryMusicControlSettingMsg, int, value, 0);
 MESSAGE1(CQueryPhonographState, int, value, 0);


Commit: 18a38c84e9ddeeb063621c290b8be6dce72daaf1
    https://github.com/scummvm/scummvm/commit/18a38c84e9ddeeb063621c290b8be6dce72daaf1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:02-04:00

Commit Message:
TITANIC: Implementing CCarry classes msg handlers

Changed paths:
    engines/titanic/carry/chicken.h
    engines/titanic/carry/napkin.cpp
    engines/titanic/carry/napkin.h
    engines/titanic/carry/note.cpp
    engines/titanic/carry/note.h
    engines/titanic/carry/parcel.cpp
    engines/titanic/carry/parcel.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_section.cpp
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/carry/chicken.h b/engines/titanic/carry/chicken.h
index a81c27c..bbc46f8 100644
--- a/engines/titanic/carry/chicken.h
+++ b/engines/titanic/carry/chicken.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CChicken : public CCarry {
 private:
 	static int _v1;
-private:
+public:
 	int _field12C;
 	CString _string6;
 	int _field13C;
diff --git a/engines/titanic/carry/napkin.cpp b/engines/titanic/carry/napkin.cpp
index 48d0381..c998c13 100644
--- a/engines/titanic/carry/napkin.cpp
+++ b/engines/titanic/carry/napkin.cpp
@@ -21,9 +21,14 @@
  */
 
 #include "titanic/carry/napkin.h"
+#include "titanic/carry/chicken.h"
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CNapkin, CCarry)
+	ON_MESSAGE(UseWithOtherMsg)
+END_MESSAGE_MAP()
+
 CNapkin::CNapkin() : CCarry() {
 }
 
@@ -37,4 +42,20 @@ void CNapkin::load(SimpleFile *file) {
 	CCarry::load(file);
 }
 
+bool CNapkin::UseWithOtherMsg(CUseWithOtherMsg *msg) {
+	CChicken *chicken = static_cast<CChicken *>(msg->_other);
+	if (chicken) {
+		if (chicken->_string6 == "None" || chicken->_field12C) {
+			CActMsg actMsg("Clean");
+			actMsg.execute("Chicken");
+		} else {
+			petDisplayMsg("The Chicken is already quite clean enough, thank you.");
+		}
+	}
+
+	dropOnPet();
+	return CCarry::UseWithOtherMsg(msg);
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/napkin.h b/engines/titanic/carry/napkin.h
index 144189b..ac14b70 100644
--- a/engines/titanic/carry/napkin.h
+++ b/engines/titanic/carry/napkin.h
@@ -24,10 +24,13 @@
 #define TITANIC_NAPKIN_H
 
 #include "titanic/carry/carry.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
 class CNapkin : public CCarry {
+	DECLARE_MESSAGE_MAP
+	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
 public:
 	CLASSDEF
 	CNapkin();
diff --git a/engines/titanic/carry/note.cpp b/engines/titanic/carry/note.cpp
index e840012..78286d7 100644
--- a/engines/titanic/carry/note.cpp
+++ b/engines/titanic/carry/note.cpp
@@ -24,6 +24,10 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CNote, CCarry)
+	ON_MESSAGE(MouseDoubleClickMsg)
+END_MESSAGE_MAP()
+
 CNote::CNote() : CCarry(), _field138(1) {
 }
 
@@ -43,4 +47,8 @@ void CNote::load(SimpleFile *file) {
 	CCarry::load(file);
 }
 
+bool CNote::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/note.h b/engines/titanic/carry/note.h
index b96e2cf..22a95b0 100644
--- a/engines/titanic/carry/note.h
+++ b/engines/titanic/carry/note.h
@@ -24,10 +24,13 @@
 #define TITANIC_NOTE_H
 
 #include "titanic/carry/carry.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
 class CNote : public CCarry {
+	DECLARE_MESSAGE_MAP
+	bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
 private:
 	CString _string6;
 	int _field138;
diff --git a/engines/titanic/carry/parcel.cpp b/engines/titanic/carry/parcel.cpp
index b450d88..275c982 100644
--- a/engines/titanic/carry/parcel.cpp
+++ b/engines/titanic/carry/parcel.cpp
@@ -24,6 +24,9 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CParcel, CCarry)
+END_MESSAGE_MAP()
+
 CParcel::CParcel() : CCarry() {
 }
 
diff --git a/engines/titanic/carry/parcel.h b/engines/titanic/carry/parcel.h
index 59f3ed9..cb36bed 100644
--- a/engines/titanic/carry/parcel.h
+++ b/engines/titanic/carry/parcel.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CParcel : public CCarry {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CParcel();
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 4628ccc..0a541bf 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -562,4 +562,10 @@ bool CGameObject::compareViewNameTo(const CString &name) const {
 	return getViewFullName().compareToIgnoreCase(name);
 }
 
+void CGameObject::petDisplayMsg(const CString &msg) const {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->displayMessage(msg);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 658c844..09a00e3 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -160,6 +160,11 @@ protected:
 	 * string form to the passed string
 	 */
 	bool compareViewNameTo(const CString &name) const;
+
+	/**
+	* Display a message in the PET
+	*/
+	void petDisplayMsg(const CString &msg) const;
 public:
 	int _field60;
 	CursorId _cursorId;
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 5bc3edc..a588550 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -350,4 +350,8 @@ void CPetControl::drawIndent(CScreenManager *screenManager, int indent) {
 	_frame.drawIndent(screenManager, indent);
 }
 
+void CPetControl::displayMessage(const CString &msg) {
+	error("TODO: CPetControl::displayMessage");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index f357c29..401f5de 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -196,6 +196,11 @@ public:
 	CGameObject *dragEnd(const Point &pt) const {
 		return _currentArea == PET_INVENTORY ? _inventory.dragEnd(pt) : nullptr;
 	}
+
+	/**
+	 * Display a message
+	 */
+	void displayMessage(const CString &msg);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp
index d531b5d..349fa40 100644
--- a/engines/titanic/pet_control/pet_section.cpp
+++ b/engines/titanic/pet_control/pet_section.cpp
@@ -25,7 +25,7 @@
 
 namespace Titanic {
 
-void CPetSection::proc16() {
+void CPetSection::displayMessage(const CString &msg) {
 	error("TODO");
 }
 
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 93a9145..43ae623 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -96,7 +96,10 @@ public:
 	 */
 	virtual CGameObject *dragEnd(const Point &pt) const { return nullptr; }
 	
-	virtual void proc16();
+	/**
+	 * Display a message
+	 */
+	virtual void displayMessage(const CString &msg);
 
 	/**
 	 * Returns true if the object is in a valid state


Commit: 57d75d19cfc0801211b3d22c292f1585c8ca1c5a
    https://github.com/scummvm/scummvm/commit/57d75d19cfc0801211b3d22c292f1585c8ca1c5a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:03-04:00

Commit Message:
TITANIC: Add CMagazine msg handler stubs

Changed paths:
    engines/titanic/carry/magazine.cpp
    engines/titanic/carry/magazine.h



diff --git a/engines/titanic/carry/magazine.cpp b/engines/titanic/carry/magazine.cpp
index efb68c1..20e0b16 100644
--- a/engines/titanic/carry/magazine.cpp
+++ b/engines/titanic/carry/magazine.cpp
@@ -24,6 +24,13 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CMagazine, CCarry)
+	ON_MESSAGE(UseWithCharMsg)
+	ON_MESSAGE(MouseDoubleClickMsg)
+	ON_MESSAGE(VisibleMsg)
+	ON_MESSAGE(UseWithOtherMsg)
+END_MESSAGE_MAP()
+
 CMagazine::CMagazine() : CCarry() {
 }
 
@@ -43,4 +50,24 @@ void CMagazine::load(SimpleFile *file) {
 	CCarry::load(file);
 }
 
+bool CMagazine::UseWithCharMsg(CUseWithCharMsg *msg) {
+	// todo
+	return true;
+}
+
+bool CMagazine::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
+	// todo
+	return true;
+}
+
+bool CMagazine::VisibleMsg(CVisibleMsg *msg) {
+	// todo
+	return true;
+}
+
+bool CMagazine::UseWithOtherMsg(CUseWithOtherMsg *msg) {
+	// todo
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/magazine.h b/engines/titanic/carry/magazine.h
index 7621599..16ef4bb 100644
--- a/engines/titanic/carry/magazine.h
+++ b/engines/titanic/carry/magazine.h
@@ -24,10 +24,17 @@
 #define TITANIC_MAGAZINE_H
 
 #include "titanic/carry/carry.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
 
 namespace Titanic {
 
 class CMagazine : public CCarry {
+	DECLARE_MESSAGE_MAP
+	bool UseWithCharMsg(CUseWithCharMsg *msg);
+	bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
+	bool VisibleMsg(CVisibleMsg *msg);
+	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
 private:
 	int _field12C;
 	int _field130;


Commit: a6d03a15c9b305afab75d5b89b9c818249031ec7
    https://github.com/scummvm/scummvm/commit/a6d03a15c9b305afab75d5b89b9c818249031ec7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:04-04:00

Commit Message:
TITANIC: More CMagazine message handlers

Changed paths:
    engines/titanic/carry/magazine.cpp
    engines/titanic/npcs/deskbot.h



diff --git a/engines/titanic/carry/magazine.cpp b/engines/titanic/carry/magazine.cpp
index 20e0b16..ac74da8 100644
--- a/engines/titanic/carry/magazine.cpp
+++ b/engines/titanic/carry/magazine.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/carry/magazine.h"
+#include "titanic/npcs/deskbot.h"
 
 namespace Titanic {
 
@@ -51,22 +52,41 @@ void CMagazine::load(SimpleFile *file) {
 }
 
 bool CMagazine::UseWithCharMsg(CUseWithCharMsg *msg) {
-	// todo
-	return true;
+	CDeskbot *deskbot = static_cast<CDeskbot *>(msg->_character);
+	if (deskbot) {
+		if (deskbot->_field108) {
+			setVisible(false);
+			setPosition(Point(1000, 1000));
+			CActMsg actMsg("2ndClassUpgrade");
+			actMsg.execute("Deskbot");
+		}
+
+		return true;
+	} else {
+		return CCarry::UseWithCharMsg(msg);
+	}
 }
 
 bool CMagazine::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
-	// todo
 	return true;
 }
 
 bool CMagazine::VisibleMsg(CVisibleMsg *msg) {
-	// todo
+	setVisible(msg->_visible);
 	return true;
 }
 
 bool CMagazine::UseWithOtherMsg(CUseWithOtherMsg *msg) {
-	// todo
+	if (msg->_other->getName() == "SwitchOnDeskbot") {
+		// TODO: other _field108 if
+		if (false) {
+			setVisible(false);
+			setPosition(Point(1000, 1000));
+			CActMsg actMsg("2ndClassUpgrade");
+			actMsg.execute("Deskbot");
+		}
+	}
+
 	return true;
 }
 
diff --git a/engines/titanic/npcs/deskbot.h b/engines/titanic/npcs/deskbot.h
index cb977e4..50c3e3f 100644
--- a/engines/titanic/npcs/deskbot.h
+++ b/engines/titanic/npcs/deskbot.h
@@ -31,7 +31,7 @@ class CDeskbot : public CTrueTalkNPC {
 private:
 	static int _v1;
 	static int _v2;
-private:
+public:
 	int _field108;
 	int _field10C;
 public:


Commit: a5e90526355a421d23175bd0ac25f7c2bc0d3276
    https://github.com/scummvm/scummvm/commit/a5e90526355a421d23175bd0ac25f7c2bc0d3276
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:05-04:00

Commit Message:
TITANIC: More CArm message handlers

Changed paths:
    engines/titanic/carry/arm.cpp
    engines/titanic/carry/arm.h
    engines/titanic/carry/phonograph_cylinder.cpp
    engines/titanic/messages/messages.h



diff --git a/engines/titanic/carry/arm.cpp b/engines/titanic/carry/arm.cpp
index f2c7d52..0098c6f 100644
--- a/engines/titanic/carry/arm.cpp
+++ b/engines/titanic/carry/arm.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/carry/arm.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
@@ -35,19 +36,18 @@ BEGIN_MESSAGE_MAP(CArm, CCarry)
 END_MESSAGE_MAP()
 
 CArm::CArm() : CCarry(), _string6("Key"),
-	_field138(0), _field13C(0), _field140(0), _field144(0),
-	_field148(0), _field158(0), _armRect(220, 208, 409, 350),
-	_field16C(3), _field170(0) {
+	_field138(0), _field158(0), _field16C(3), _field170(0),
+	_armRect(220, 208, 409, 350) {
 }
 
 void CArm::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string6, indent);
 	file->writeNumberLine(_field138, indent);
-	file->writeNumberLine(_field13C, indent);
-	file->writeNumberLine(_field140, indent);
-	file->writeNumberLine(_field144, indent);
-	file->writeNumberLine(_field148, indent);
+	file->writeNumberLine(_hookedRect.left, indent);
+	file->writeNumberLine(_hookedRect.top, indent);
+	file->writeNumberLine(_hookedRect.right, indent);
+	file->writeNumberLine(_hookedRect.bottom, indent);
 
 	file->writeQuotedLine(_string7, indent);
 	file->writeNumberLine(_field158, indent);
@@ -65,10 +65,10 @@ void CArm::load(SimpleFile *file) {
 	file->readNumber();
 	_string6 = file->readString();
 	_field138 = file->readNumber();
-	_field13C = file->readNumber();
-	_field140 = file->readNumber();
-	_field144 = file->readNumber();
-	_field148 = file->readNumber();
+	_hookedRect.left = file->readNumber();
+	_hookedRect.top = file->readNumber();
+	_hookedRect.right = file->readNumber();
+	_hookedRect.bottom = file->readNumber();
 
 	_string7 = file->readString();
 	_field158 = file->readNumber();
@@ -107,14 +107,58 @@ bool CArm::TranslateObjectMsg(CTranslateObjectMsg *msg) {
 }
 
 bool CArm::UseWithOtherMsg(CUseWithOtherMsg *msg) {
+	if (_string6 != "None") {
+		CShowTextMsg textMsg("The arm is already holding something.");
+		textMsg.execute("PET");
+		return false;
+	} else if (msg->_other->getName() == "GondolierLeftLever") {
+		CIsHookedOnMsg hookedMsg(_hookedRect, 0, getName());
+		hookedMsg._rect.translate(_bounds.left, _bounds.top);
+		hookedMsg.execute("GondolierLeftLever");
+
+		if (hookedMsg._result) {
+			_string7 = "GondolierLeftLever";
+		} else {
+			dropOnPet();
+		}
+	} else if (msg->_other->getName() == "GondolierRightLever") {
+		CIsHookedOnMsg hookedMsg(_hookedRect, 0, getName());
+		hookedMsg._rect.translate(_bounds.left, _bounds.top);
+		hookedMsg.execute("GondolierRightLever");
+
+		if (hookedMsg._result) {
+			_string7 = "GondolierRightLever";
+		} else {
+			dropOnPet();
+		}
+	}
+
 	return true;
 }
 
 bool CArm::MouseDragStartMsg(CMouseDragStartMsg *msg) {
-	return true;
+	if (!_fieldE0) {
+		CShowTextMsg textMsg("You can't get this.");
+		textMsg.execute("PET");
+	} else if (checkStartDragging(msg)) {
+		_tempPos = msg->_mousePos - _bounds;
+		setPosition(msg->_mousePos - _tempPos);
+
+		if (!_string7.empty()) {
+			CActMsg actMsg("Unhook");
+			actMsg.execute(_string7);
+			_string7.clear();
+		}
+
+		loadFrame(_visibleFrame);
+		return true;
+	}
+
+	return false;
 }
 
 bool CArm::MaitreDHappyMsg(CMaitreDHappyMsg *msg) {
+
 	// TODO
 	return true;
 }
diff --git a/engines/titanic/carry/arm.h b/engines/titanic/carry/arm.h
index 60f597e..f19943d 100644
--- a/engines/titanic/carry/arm.h
+++ b/engines/titanic/carry/arm.h
@@ -42,10 +42,7 @@ class CArm : public CCarry {
 private:
 	CString _string6;
 	int _field138;
-	int _field13C;
-	int _field140;
-	int _field144;
-	int _field148;
+	Rect _hookedRect;
 	CString _string7;
 	int _field158;
 	Rect _armRect;
diff --git a/engines/titanic/carry/phonograph_cylinder.cpp b/engines/titanic/carry/phonograph_cylinder.cpp
index e2a7a99..d7b9fe6 100644
--- a/engines/titanic/carry/phonograph_cylinder.cpp
+++ b/engines/titanic/carry/phonograph_cylinder.cpp
@@ -68,6 +68,7 @@ void CPhonographCylinder::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_bassSpeedControl, indent);
 	file->writeNumberLine(_bassPitchControl, indent);
 	file->writeNumberLine(_bassInversionControl, indent);
+	file->writeNumberLine(_bassDirectionControl, indent);
 
 	CCarry::save(file, indent);
 }
@@ -94,6 +95,7 @@ void CPhonographCylinder::load(SimpleFile *file) {
 	_bassSpeedControl = file->readNumber();
 	_bassPitchControl = file->readNumber();
 	_bassInversionControl = file->readNumber();
+	_bassDirectionControl = file->readNumber();
 
 	CCarry::load(file);
 }
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 96749b7..4c26ec5 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -180,24 +180,6 @@ public:
 	}
 };
 
-class CIsHookedOnMsg : public CMessage {
-public:
-	int _field4;
-	int _field8;
-	CString _string1;
-	int _field18;
-	int _field1C;
-	int _field20;
-public:
-	CLASSDEF
-	CIsHookedOnMsg() : CMessage(), _field4(0), _field8(0),
-		_field18(0), _field1C(0), _field20(0) {}
-
-	static bool isSupportedBy(const CTreeItem *item) {
-		return supports(item, _type);
-	}
-};
-
 class CTransportMsg : public CMessage {
 public:
 	CString _string;
@@ -281,6 +263,7 @@ MESSAGE1(CGetChevRoomNum, int, value, 0);
 MESSAGE2(CHoseConnectedMsg, int, value1, 1, int, value2, 0);
 MESSAGE0(CInitializeAnimMsg);
 MESSAGE1(CIsEarBowlPuzzleDone, int, value, 0);
+MESSAGE3(CIsHookedOnMsg, Rect, rect, Rect(), bool, result, false, CString, string1, "");
 MESSAGE1(CIsParrotPresentMsg, int, value, 0);
 MESSAGE1(CKeyCharMsg, int, value, 32);
 MESSAGE2(CLeaveNodeMsg, CNodeItem *, oldNode, nullptr, CNodeItem *, newNode, nullptr);


Commit: 1babcc10cfce1458ac07c8e1027c321962cf8f09
    https://github.com/scummvm/scummvm/commit/1babcc10cfce1458ac07c8e1027c321962cf8f09
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:06-04:00

Commit Message:
TITANIC: Implemented PET methods for iterating sub-objects

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index a588550..c7dc8d2 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -354,4 +354,15 @@ void CPetControl::displayMessage(const CString &msg) {
 	error("TODO: CPetControl::displayMessage");
 }
 
+CGameObject *CPetControl::getFirstObject() const {
+	return static_cast<CGameObject *>(getFirstChild());
+}
+
+CGameObject *CPetControl::getNextObject(CGameObject *prior) const {
+	if (!prior || prior->getParent() != this)
+		return nullptr;
+
+	return static_cast<CGameObject *>(prior->getNextSibling());
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 401f5de..c22f555 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -201,6 +201,17 @@ public:
 	 * Display a message
 	 */
 	void displayMessage(const CString &msg);
+
+	/**
+	 * Get the first game object stored in the PET
+	 */
+	CGameObject *getFirstObject() const;
+
+	/**
+	 * Get the next game object stored in the PET following
+	 * the passed game object
+	 */
+	CGameObject *getNextObject(CGameObject *prior) const;
 };
 
 } // End of namespace Titanic


Commit: f77a8a63cde7b40dd6fb4dfc23f11cc654c7e9a5
    https://github.com/scummvm/scummvm/commit/f77a8a63cde7b40dd6fb4dfc23f11cc654c7e9a5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:07-04:00

Commit Message:
TITANIC: Implemented CGameObject::find

Changed paths:
  A engines/titanic/core/mail_man.cpp
  A engines/titanic/core/mail_man.h
  R engines/titanic/game/mail_man.cpp
  R engines/titanic/game/mail_man.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/module.mk



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 0a541bf..ba8ab42 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -21,7 +21,9 @@
  */
 
 #include "titanic/core/game_object.h"
+#include "titanic/core/mail_man.h"
 #include "titanic/core/resource_key.h"
+#include "titanic/core/room_item.h"
 #include "titanic/pet_control/pet_control.h"
 #include "titanic/support/files_manager.h"
 #include "titanic/support/screen_manager.h"
@@ -568,4 +570,60 @@ void CGameObject::petDisplayMsg(const CString &msg) const {
 		pet->displayMessage(msg);
 }
 
+CGameObject *CGameObject::getMailManFirstObject() const {
+	CMailMan *mailMan = getMailMan();
+	return mailMan ? mailMan->getFirstObject() : nullptr;
+}
+
+CGameObject *CGameObject::getMailManNextObject(CGameObject *prior) const {
+	CMailMan *mailMan = getMailMan();
+	return mailMan ? mailMan->getNextObject(prior) : nullptr;
+}
+
+CGameObject *CGameObject::findRoomObject(const CString &name) const {
+	return static_cast<CGameObject *>(findRoom()->findByName(name));
+}
+
+Found CGameObject::find(const CString &name, CGameObject **item, int findAreas) {
+	CGameObject *go;
+	*item = nullptr;
+
+	// Scan under PET if flagged
+	if (findAreas & FIND_PET) {
+		for (go = getPetControl()->getFirstObject(); go; go = getPetControl()->getNextObject(go)) {
+			if (go->getName() == name) {
+				*item = go;
+				return FOUND_PET;
+			}
+		}
+	}
+
+	if (findAreas & FIND_MAILMAN) {
+		for (go = getMailManFirstObject(); go; go = getMailManNextObject(go)) {
+			if (go->getName() == name) {
+				*item = go;
+				return FOUND_MAILMAN;
+			}
+		}
+	}
+
+	if (findAreas & FIND_GLOBAL) {
+		go = static_cast<CGameObject *>(getRoot()->findByName(name));
+		if (go) {
+			*item = go;
+			return FOUND_GLOBAL;
+		}
+	}
+
+	if (findAreas & FIND_ROOM) {
+		go = findRoomObject(name);
+		if (go) {
+			*item = go;
+			return FOUND_ROOM;
+		}
+	}
+
+	return FOUND_NONE;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 09a00e3..8668730 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -32,6 +32,9 @@
 
 namespace Titanic {
 
+enum Find { FIND_GLOBAL = 1, FIND_ROOM = 2, FIND_PET = 4, FIND_MAILMAN = 8 };
+enum Found { FOUND_NONE = 0, FOUND_GLOBAL = 1, FOUND_ROOM = 2, FOUND_PET = 3, FOUND_MAILMAN = 4 };
+
 class CVideoSurface;
 class CMouseDragStartMsg;
 class OSMovie;
@@ -165,6 +168,26 @@ protected:
 	* Display a message in the PET
 	*/
 	void petDisplayMsg(const CString &msg) const;
+
+	/**
+	 * Gets the first object under the system MailMan
+	 */
+	CGameObject *getMailManFirstObject() const;
+
+	/**
+	 * Gets the next object under the system MailMan
+	 */
+	CGameObject *getMailManNextObject(CGameObject *prior) const;
+
+	/**
+	 * Finds an object by name within the object's room
+	 */
+	CGameObject *findRoomObject(const CString &name) const;
+
+	/**
+	 * Finds an item in various system areas
+	 */
+	Found find(const CString &name, CGameObject **item, int findAreas);
 public:
 	int _field60;
 	CursorId _cursorId;
diff --git a/engines/titanic/core/mail_man.cpp b/engines/titanic/core/mail_man.cpp
new file mode 100644
index 0000000..cb95924
--- /dev/null
+++ b/engines/titanic/core/mail_man.cpp
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/core/mail_man.h"
+
+namespace Titanic {
+
+void CMailMan::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	file->writeNumberLine(_value, indent);
+	CGameObject::save(file, indent);
+}
+
+void CMailMan::load(SimpleFile *file) {
+	file->readNumber();
+	_value = file->readNumber();
+	CGameObject::load(file);
+}
+
+CGameObject *CMailMan::getFirstObject() const {
+	return static_cast<CGameObject *>(getFirstChild());
+}
+
+CGameObject *CMailMan::getNextObject(CGameObject *prior) const {
+	if (!prior || prior->getParent() != this)
+		return nullptr;
+
+	return static_cast<CGameObject *>(prior->getNextSibling());
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/core/mail_man.h b/engines/titanic/core/mail_man.h
new file mode 100644
index 0000000..d1c84e2
--- /dev/null
+++ b/engines/titanic/core/mail_man.h
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MAIL_MAN_H
+#define TITANIC_MAIL_MAN_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CMailMan : public CGameObject {
+public:
+	int _value;
+public:
+	CLASSDEF
+	CMailMan() : CGameObject(), _value(1) {}
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+
+	/**
+	 * Get the first game object stored in the PET
+	 */
+	CGameObject *getFirstObject() const;
+
+	/**
+	 * Get the next game object stored in the PET following
+	 * the passed game object
+	 */
+	CGameObject *getNextObject(CGameObject *prior) const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MAIL_MAN_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 2eacbba..4a57959 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -68,6 +68,7 @@
 #include "titanic/core/game_object_desc_item.h"
 #include "titanic/core/link_item.h"
 #include "titanic/core/list.h"
+#include "titanic/core/mail_man.h"
 #include "titanic/core/message_target.h"
 #include "titanic/core/movie_clip.h"
 #include "titanic/core/multi_drop_target.h"
@@ -156,7 +157,6 @@
 #include "titanic/game/light_switch.h"
 #include "titanic/game/little_lift_button.h"
 #include "titanic/game/long_stick_dispenser.h"
-#include "titanic/game/mail_man.h"
 #include "titanic/game/missiveomat.h"
 #include "titanic/game/missiveomat_button.h"
 #include "titanic/game/movie_tester.h"
@@ -475,6 +475,7 @@ DEFFN(CGameObject)
 DEFFN(CGameObjectDescItem)
 DEFFN(CLinkItem)
 DEFFN(ListItem)
+DEFFN(CMailMan)
 DEFFN(CMessageTarget)
 DEFFN(CMovieClip)
 DEFFN(CMultiDropTarget)
@@ -565,7 +566,6 @@ DEFFN(CLight)
 DEFFN(CLightSwitch)
 DEFFN(CLittleLiftButton)
 DEFFN(CLongStickDispenser)
-DEFFN(CMailMan)
 DEFFN(CMissiveOMat)
 DEFFN(CMissiveOMatButton)
 DEFFN(CMovieTester)
@@ -1061,6 +1061,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CLinkItem, CNamedItem);
 	ADDFN(ListItem, CSaveableObject);
 	ADDFN(CMessageTarget, CSaveableObject);
+	ADDFN(CMailMan, CGameObject);
 	ADDFN(CMovieClip, ListItem);
 	ADDFN(CMultiDropTarget, CDropTarget);
 	ADDFN(CNamedItem, CTreeItem);
@@ -1151,7 +1152,6 @@ void CSaveableObject::initClassList() {
 	ADDFN(CLightSwitch, CBackground);
 	ADDFN(CLittleLiftButton, CBackground);
 	ADDFN(CLongStickDispenser, CGameObject);
-	ADDFN(CMailMan, CGameObject);
 	ADDFN(CMissiveOMat, CGameObject);
 	ADDFN(CMissiveOMatButton, CEditControl);
 	ADDFN(CMovieTester, CGameObject);
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index d86e9b2..03bf0e7 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -26,6 +26,7 @@
 #include "titanic/core/game_object.h"
 #include "titanic/core/game_object_desc_item.h"
 #include "titanic/core/link_item.h"
+#include "titanic/core/mail_man.h"
 #include "titanic/core/named_item.h"
 #include "titanic/core/node_item.h"
 #include "titanic/core/project_item.h"
@@ -275,6 +276,10 @@ CPetControl *CTreeItem::getPetControl() const {
 	return dynamic_cast<CPetControl *>(getDontSaveChild(CPetControl::_type));
 }
 
+CMailMan *CTreeItem::getMailMan() const {
+	return dynamic_cast<CMailMan *>(getDontSaveChild(CMailMan::_type));
+}
+
 CTreeItem *CTreeItem::getDontSaveChild(ClassDef *classDef) const {
 	CProjectItem *root = getRoot();
 	if (!root)
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index c44825f..2f4ebc3 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -29,6 +29,7 @@ namespace Titanic {
 
 class CGameManager;
 class CDontSaveFileItem;
+class CMailMan;
 class CMessage;
 class CMusicRoom;
 class CNamedItem;
@@ -249,6 +250,11 @@ public:
 	CPetControl *getPetControl() const;
 
 	/**
+	 * Returns the MailMan
+	 */
+	CMailMan *getMailMan() const;
+
+	/**
 	 * Returns a child of the Dont Save area of the project of the given class
 	 */
 	CTreeItem *getDontSaveChild(ClassDef *classDef) const;
diff --git a/engines/titanic/game/mail_man.cpp b/engines/titanic/game/mail_man.cpp
deleted file mode 100644
index 9096fc5..0000000
--- a/engines/titanic/game/mail_man.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/mail_man.h"
-
-namespace Titanic {
-
-void CMailMan::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_value, indent);
-	CGameObject::save(file, indent);
-}
-
-void CMailMan::load(SimpleFile *file) {
-	file->readNumber();
-	_value = file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/mail_man.h b/engines/titanic/game/mail_man.h
deleted file mode 100644
index a75d75a..0000000
--- a/engines/titanic/game/mail_man.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_MAIL_MAN_H
-#define TITANIC_MAIL_MAN_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CMailMan : public CGameObject {
-public:
-	int _value;
-public:
-	CLASSDEF
-	CMailMan() : CGameObject(), _value(1) {}
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_MAIL_MAN_H */
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index be9a467..8f3126b 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -60,6 +60,7 @@ MODULE_OBJS := \
 	core/game_object_desc_item.o \
 	core/link_item.o \
 	core/list.o \
+	core/mail_man.o \
 	core/message_target.o \
 	core/movie_clip.o \
 	core/multi_drop_target.o \
@@ -150,7 +151,6 @@ MODULE_OBJS := \
 	game/light_switch.o \
 	game/little_lift_button.o \
 	game/long_stick_dispenser.o \
-	game/mail_man.o \
 	game/missiveomat.o \
 	game/missiveomat_button.o \
 	game/movie_tester.o \


Commit: 7ddd5d1a8b97bda75e4eece9c91ff3286e3c3eca
    https://github.com/scummvm/scummvm/commit/7ddd5d1a8b97bda75e4eece9c91ff3286e3c3eca
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:08-04:00

Commit Message:
TITANIC: Finished CArm msg handlers, stubs for adding to inventory

Changed paths:
    engines/titanic/carry/arm.cpp
    engines/titanic/carry/carry.cpp
    engines/titanic/carry/carry.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h



diff --git a/engines/titanic/carry/arm.cpp b/engines/titanic/carry/arm.cpp
index 0098c6f..b6e125a 100644
--- a/engines/titanic/carry/arm.cpp
+++ b/engines/titanic/carry/arm.cpp
@@ -158,8 +158,26 @@ bool CArm::MouseDragStartMsg(CMouseDragStartMsg *msg) {
 }
 
 bool CArm::MaitreDHappyMsg(CMaitreDHappyMsg *msg) {
+	CGameObject *petItem;
+	if (find(getName(), &petItem, FIND_PET)) {
+		if (!_field158)
+			playSound("z#47.wav", 100, 0, 0);
+		if (_string6 == "Key" || _string6 == "AuditoryCentre") {
+			CGameObject *child = static_cast<CGameObject *>(getFirstChild());
+			if (child) {
+				child->setVisible(true);
+				dropOnPet();
+			}
 
-	// TODO
+			_visibleFrame = _field170;
+			loadFrame(_visibleFrame);
+			_string6 = "None";
+			addToInventory();
+		}
+	}
+
+	_field158 = 1;
+	_fieldE0 = 1;
 	return true;
 }
 
diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index 9968c52..1bb81fb 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -24,6 +24,7 @@
 #include "titanic/messages/messages.h"
 #include "titanic/npcs/character.h"
 #include "titanic/npcs/succubus.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -241,4 +242,10 @@ void CCarry::dropOnPet() {
 	warning("TODO: dropOnPet");
 }
 
+void CCarry::addToInventory() {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->addToInventory(this);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index b14ba05..9fd7679 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -62,7 +62,10 @@ protected:
 	bool _enterFrameSet;
 	int _visibleFrame;
 protected:
-
+	/**
+	 * Add the item to the PET inventory
+	 */
+	void addToInventory();
 public:
 	CLASSDEF
 	CCarry();
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index c7dc8d2..2f119be 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -365,4 +365,8 @@ CGameObject *CPetControl::getNextObject(CGameObject *prior) const {
 	return static_cast<CGameObject *>(prior->getNextSibling());
 }
 
+void CPetControl::addToInventory(CCarry *item) {
+	_inventory.addItem(item);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index c22f555..73dc69b 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -212,6 +212,11 @@ public:
 	 * the passed game object
 	 */
 	CGameObject *getNextObject(CGameObject *prior) const;
+
+	/**
+	 * Adds an item to the PET inventory
+	 */
+	void addToInventory(CCarry *item);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 1104b65..a073a37 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -102,4 +102,8 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
 	return true;
 }
 
+void CPetInventory::addItem(CCarry *item) {
+	warning("TODO: CPetInventory::addItem");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 16dfd22..3700854 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -90,6 +90,11 @@ public:
 	 * Returns true if the object is in a valid state
 	 */
 	virtual bool isValid(CPetControl *petControl);
+
+	/**
+	 * Add an item to the inventory
+	 */
+	void addItem(CCarry *item);
 };
 
 } // End of namespace Titanic


Commit: 2dcda26eb1253d884d6a921a3f2ead76021b9bc4
    https://github.com/scummvm/scummvm/commit/2dcda26eb1253d884d6a921a3f2ead76021b9bc4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:09-04:00

Commit Message:
TITANIC: Implement CBridgePiece message handlers

Changed paths:
    engines/titanic/carry/brain.cpp
    engines/titanic/carry/brain.h
    engines/titanic/carry/bridge_piece.cpp
    engines/titanic/carry/bridge_piece.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/ship_setting.h
    engines/titanic/game_state.h
    engines/titanic/messages/messages.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h



diff --git a/engines/titanic/carry/brain.cpp b/engines/titanic/carry/brain.cpp
index 0d1cdf7..acc29b3 100644
--- a/engines/titanic/carry/brain.cpp
+++ b/engines/titanic/carry/brain.cpp
@@ -21,9 +21,18 @@
  */
 
 #include "titanic/carry/brain.h"
+#include "titanic/game/brain_slot.h"
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CBrain, CCarry)
+	ON_MESSAGE(UseWithOtherMsg)
+	ON_MESSAGE(VisibleMsg)
+	ON_MESSAGE(MouseDragStartMsg)
+	ON_MESSAGE(PassOnDragStartMsg)
+	ON_MESSAGE(PETGainedObjectMsg)
+END_MESSAGE_MAP()
+
 CBrain::CBrain() : CCarry(), _field134(0), _field138(0) {
 }
 
@@ -45,4 +54,81 @@ void CBrain::load(SimpleFile *file) {
 	CCarry::load(file);
 }
 
+bool CBrain::UseWithOtherMsg(CUseWithOtherMsg *msg) {
+	CBrainSlot *slot = static_cast<CBrainSlot *>(msg->_other);
+	if (slot) {
+		if (slot->getName() == "CentralCore") {
+			setVisible(false);
+			moveToHiddenRoom();
+			CAddHeadPieceMsg headpieceMsg(getName());
+			headpieceMsg.execute("CentralCoreSlot");
+		}
+		else if (!slot->_value1 && slot->getName() == "CentralCoreSlot") {
+			setVisible(false);
+			moveToHiddenRoom();
+			CAddHeadPieceMsg headpieceMsg(getName());
+			headpieceMsg.execute(msg->_other);
+			playSound("z#116.wav", 100, 0, 0);
+			setPosition(Point(0, 0));
+			setVisible(false);
+			_field134 = 1;
+		}
+
+		return true;
+	}
+	else {
+		return CCarry::UseWithOtherMsg(msg);
+	}
+}
+
+bool CBrain::VisibleMsg(CVisibleMsg *msg) {
+	setVisible(msg->_visible);
+	return true;
+}
+
+bool CBrain::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+	if (!checkStartDragging(msg))
+		return false;
+
+	if (_field134) {
+		CTakeHeadPieceMsg headpieceMsg(getName());
+		headpieceMsg.execute("TitaniaControl");
+
+		_field134 = 0;
+		setVisible(true);
+		moveToView();
+
+		setPosition(Point(msg->_mousePos.x - _bounds.width() / 2,
+			msg->_mousePos.y - _bounds.height() / 2));
+	}
+
+	return CCarry::MouseDragStartMsg(msg);
+}
+
+bool CBrain::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
+	if (_field134) {
+		CTakeHeadPieceMsg headpieceMsg(getName());
+		headpieceMsg.execute("TitaniaControl");
+		_field134 = 0;
+
+		setVisible(true);
+		moveToView();
+		setPosition(Point(msg->_mousePos.x - _bounds.width() / 2,
+			msg->_mousePos.y - _bounds.height() / 2));
+	}
+
+	return CCarry::PassOnDragStartMsg(msg);
+}
+
+bool CBrain::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
+	if (!_field138) {
+		if (getName() == "Perch") {
+			incState38();
+			_field138 = 1;
+		}
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/brain.h b/engines/titanic/carry/brain.h
index 14f9b63..3e24f52 100644
--- a/engines/titanic/carry/brain.h
+++ b/engines/titanic/carry/brain.h
@@ -24,10 +24,19 @@
 #define TITANIC_BRAIN_H
 
 #include "titanic/carry/carry.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
+#include "titanic/messages/pet_messages.h"
 
 namespace Titanic {
 
 class CBrain : public CCarry {
+	DECLARE_MESSAGE_MAP
+	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
+	bool VisibleMsg(CVisibleMsg *msg);
+	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
+	bool PassOnDragStartMsg(CPassOnDragStartMsg *msg);
+	bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
 private:
 	Point _pos1;
 	int _field134;
diff --git a/engines/titanic/carry/bridge_piece.cpp b/engines/titanic/carry/bridge_piece.cpp
index e93d3c4..0ed8ae6 100644
--- a/engines/titanic/carry/bridge_piece.cpp
+++ b/engines/titanic/carry/bridge_piece.cpp
@@ -21,9 +21,15 @@
  */
 
 #include "titanic/carry/bridge_piece.h"
+#include "titanic/game/ship_setting.h"
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CBridgePiece, CCarry)
+	ON_MESSAGE(UseWithOtherMsg)
+	ON_MESSAGE(PassOnDragStartMsg)
+END_MESSAGE_MAP()
+
 CBridgePiece::CBridgePiece() : CCarry(), _field140(0) {
 }
 
@@ -45,4 +51,45 @@ void CBridgePiece::load(SimpleFile *file) {
 	CCarry::load(file);
 }
 
+bool CBridgePiece::UseWithOtherMsg(CUseWithOtherMsg *msg) {
+	CShipSetting *shipSetting = static_cast<CShipSetting *>(msg->_other);
+	if (!shipSetting) {
+		return CCarry::UseWithOtherMsg(msg);
+	} else if (shipSetting->_string4 == "NULL") {
+		dropOnPet();
+		return true;
+	} else {
+		setVisible(false);
+		playSound("z#54.wav", 100, 0, 0);
+		setPosition(shipSetting->_pos1);
+		shipSetting->_string4 = getName();
+		moveToHiddenRoom();
+
+		CAddHeadPieceMsg headpieceMsg(shipSetting->getName() == _string6 ?
+			"Enable" : "Disable");
+		CSetFrameMsg frameMsg;
+
+		CString name = getName();
+		if (name == "ChickenBridge") {
+			frameMsg._frameNumber = 1;
+		} else if (name == "FanBridge") {
+			frameMsg._frameNumber = 2;
+		} else if (name == "SeasonBridge") {
+			frameMsg._frameNumber = 3;
+		} else if (name == "BeamBridge") {
+			frameMsg._frameNumber = 0;
+		}
+
+		frameMsg.execute(shipSetting);
+		headpieceMsg.execute(shipSetting);
+		return true;
+	}
+}
+
+bool CBridgePiece::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
+	setVisible(true);
+	moveToView();
+	return CCarry::PassOnDragStartMsg(msg);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/bridge_piece.h b/engines/titanic/carry/bridge_piece.h
index a641eb4..5041cbc 100644
--- a/engines/titanic/carry/bridge_piece.h
+++ b/engines/titanic/carry/bridge_piece.h
@@ -28,6 +28,9 @@
 namespace Titanic {
 
 class CBridgePiece : public CCarry {
+	DECLARE_MESSAGE_MAP
+	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
+	bool PassOnDragStartMsg(CPassOnDragStartMsg *msg);
 private:
 	CString _string6;
 	Point _pos3;
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index ba8ab42..e0ca5ff 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -626,4 +626,22 @@ Found CGameObject::find(const CString &name, CGameObject **item, int findAreas)
 	return FOUND_NONE;
 }
 
+void CGameObject::moveToHiddenRoom() {
+	CPetControl *pet = getPetControl();
+	if (pet) {
+		makeDirty();
+		pet->moveToHiddenRoom(this);
+	}
+}
+
+void CGameObject::moveToView() {
+	CViewItem *view = getGameManager()->getView();
+	detach();
+	view->addUnder(this);
+}
+
+void CGameObject::incState38() {
+	getGameManager()->_gameState.inc38();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 8668730..3848222 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -132,6 +132,7 @@ protected:
 	void soundFn2(int val, int val2);
 	void petFn2(int val);
 	void petFn3(CTreeItem *item);
+	void incState38();
 
 	/**
 	 * Plays a sound
@@ -188,6 +189,16 @@ protected:
 	 * Finds an item in various system areas
 	 */
 	Found find(const CString &name, CGameObject **item, int findAreas);
+
+	/**
+	 * Moves the item from it's original position to be under the hidden room
+	 */
+	void moveToHiddenRoom();
+
+	/**
+	 * Moves the item from it's original position to be under the current view
+	 */
+	void moveToView();
 public:
 	int _field60;
 	CursorId _cursorId;
diff --git a/engines/titanic/game/ship_setting.h b/engines/titanic/game/ship_setting.h
index 9783e69..acc06d1 100644
--- a/engines/titanic/game/ship_setting.h
+++ b/engines/titanic/game/ship_setting.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CShipSetting : public CBackground {
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
-private:
+public:
 	CString _string3;
 	Point _pos1;
 	CString _string4;
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 0fe8e6a..1176b2f 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -123,6 +123,8 @@ public:
 	 * Adds a movie to the movie list
 	 */
 	void addMovie(CMovie *movie);
+
+	void inc38() { ++_field38; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 4c26ec5..f1b782b 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -344,7 +344,7 @@ MESSAGE0(CSubTurnOffMsg);
 MESSAGE0(CSubTurnOnMsg);
 MESSAGE2(CSummonBotMsg, CString, strValue, "", int, numValue, 0);
 MESSAGE1(CSummonBotQuerryMsg, CString, value, "");
-MESSAGE1(CTakeHeadPieceMsg, CString, value, "");
+MESSAGE1(CTakeHeadPieceMsg, CString, value, "NULL");
 MESSAGE2(CTextInputMsg, CString, value1, "", CString, value2, "");
 MESSAGE1(CTimeDilationMsg, int, value, 0);
 MESSAGE0(CTitleSequenceEndedMsg);
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 2f119be..a955b08 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -369,4 +369,12 @@ void CPetControl::addToInventory(CCarry *item) {
 	_inventory.addItem(item);
 }
 
+void CPetControl::moveToHiddenRoom(CTreeItem *item) {
+	CRoomItem *room = getHiddenRoom();
+	if (room) {
+		item->detach();
+		room->addUnder(item);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 73dc69b..88a738f 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -217,6 +217,11 @@ public:
 	 * Adds an item to the PET inventory
 	 */
 	void addToInventory(CCarry *item);
+
+	/**
+	 * Moves a tree item from it's original position to be under the hidden room
+	 */
+	void moveToHiddenRoom(CTreeItem *item);
 };
 
 } // End of namespace Titanic


Commit: 95c885f877ac1fa243479d113b59e6f83a360c71
    https://github.com/scummvm/scummvm/commit/95c885f877ac1fa243479d113b59e6f83a360c71
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:10-04:00

Commit Message:
TITANIC: Implementing CCarryParrot msg handlers

Changed paths:
    engines/titanic/carry/carry_parrot.cpp
    engines/titanic/carry/carry_parrot.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/messages/messages.h
    engines/titanic/npcs/parrot.h
    engines/titanic/sound/sound.h
    engines/titanic/sound/sound_manager.cpp
    engines/titanic/sound/sound_manager.h



diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index 80c8332..1081980 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -21,9 +21,23 @@
  */
 
 #include "titanic/carry/carry_parrot.h"
+#include "titanic/game/cage.h"
+#include "titanic/npcs/parrot.h"
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CCarryParrot, CCarry)
+	ON_MESSAGE(PETGainedObjectMsg)
+	ON_MESSAGE(TimerMsg)
+	ON_MESSAGE(IsParrotPresentMsg)
+	ON_MESSAGE(LeaveViewMsg)
+	ON_MESSAGE(MouseDragEndMsg)
+	ON_MESSAGE(PassOnDragStartMsg)
+	ON_MESSAGE(PreEnterViewMsg)
+	ON_MESSAGE(UseWithCharMsg)
+	ON_MESSAGE(ActMsg)
+END_MESSAGE_MAP()
+
 CCarryParrot::CCarryParrot() : CCarry(), _string6("PerchedParrot"),
 		_field138(0), _field13C(0), _field140(0), _field144(10),
 		_field148(25), _field14C(0), _field150(8) {
@@ -49,4 +63,81 @@ void CCarryParrot::load(SimpleFile *file) {
 	CCarry::load(file);
 }
 
+bool CCarryParrot::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
+	CParrot::_v4 = 4;
+	CActMsg actMsg("Shut");
+	actMsg.execute("ParrotCage");
+
+	return true;
+}
+
+bool CCarryParrot::TimerMsg(CTimerMsg *msg) {
+	if (CParrot::_v4 == 1 || CParrot::_v4 == 4) {
+		if (++_field13C >= 30) {
+			CActMsg actMsg("FreeParrot");
+			actMsg.execute(this);
+		}
+	}
+
+	return true;
+}
+
+bool CCarryParrot::IsParrotPresentMsg(CIsParrotPresentMsg *msg) {
+	msg->_value = true;
+	return true;
+}
+
+bool CCarryParrot::LeaveViewMsg(CLeaveViewMsg *msg) {
+	if (_visible) {
+		setVisible(false);
+		_fieldE0 = 0;
+		CParrot::_v4 = 2;
+	}
+
+	return true;
+}
+
+bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
+	stopMovie();
+
+	if (msg->_mousePos.y >= 360) {
+		dropOnPet();
+		return true;
+	}
+
+	if (compareViewNameTo("ParrotLobby.Node 1.N")) {
+		if (msg->_mousePos.x >= 75 && msg->_mousePos.x <= 565 &&
+				!CParrot::_v2 && !CCage::_v2) {
+			setVisible(false);
+			// TODO
+		} else {
+			// TODO
+		}
+	} else {
+		// TODO
+	}
+
+	return true;
+}
+
+bool CCarryParrot::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
+	// TODO
+	return true;
+}
+
+bool CCarryParrot::PreEnterViewMsg(CPreEnterViewMsg *msg) {
+	// TODO
+	return true;
+}
+
+bool CCarryParrot::UseWithCharMsg(CUseWithCharMsg *msg) {
+	// TODO
+	return true;
+}
+
+bool CCarryParrot::ActMsg(CActMsg *msg) {
+	// TODO
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/carry_parrot.h b/engines/titanic/carry/carry_parrot.h
index a2b1700..fc1bbba 100644
--- a/engines/titanic/carry/carry_parrot.h
+++ b/engines/titanic/carry/carry_parrot.h
@@ -24,10 +24,23 @@
 #define TITANIC_CARRY_PARROT_H
 
 #include "titanic/carry/carry.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
+#include "titanic/messages/pet_messages.h"
 
 namespace Titanic {
 
 class CCarryParrot : public CCarry {
+	DECLARE_MESSAGE_MAP
+	bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
+	bool TimerMsg(CTimerMsg *msg);
+	bool IsParrotPresentMsg(CIsParrotPresentMsg *msg);
+	bool LeaveViewMsg(CLeaveViewMsg *msg);
+	bool MouseDragEndMsg(CMouseDragEndMsg *msg);
+	bool PassOnDragStartMsg(CPassOnDragStartMsg *msg);
+	bool PreEnterViewMsg(CPreEnterViewMsg *msg);
+	bool UseWithCharMsg(CUseWithCharMsg *msg);
+	bool ActMsg(CActMsg *msg);
 private:
 	CString _string6;
 	int _field138;
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index e0ca5ff..362dbfe 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -445,6 +445,10 @@ int CGameObject::getSurface45() const {
 	return _surface ? _surface->proc45() : 0;
 }
 
+void CGameObject::sound8(bool flag) const {
+	getGameManager()->_sound.managerProc8(flag ? 3 : 0);
+}
+
 bool CGameObject::playSound(const CString &name, int val2, int val3, int val4) {
 	CProximity prox;
 	prox._field8 = val2;
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 3848222..653230a 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -254,6 +254,7 @@ public:
 
 	int getMovie19() const;
 	int getSurface45() const;
+	void sound8(bool flag) const;
 
 	/**
 	 * Loads a frame
@@ -279,6 +280,8 @@ public:
 	 * Sets whether the object is visible
 	 */
 	void setVisible(bool val);
+
+	
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 03bf0e7..abd6f6c 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -201,6 +201,13 @@ void CTreeItem::addSibling(CTreeItem *item) {
 	item->_nextSibling = this;
 }
 
+void CTreeItem::moveUnder(CTreeItem *newParent) {
+	if (newParent) {
+		detach();
+		addUnder(newParent);
+	}
+}
+
 void CTreeItem::destroyAll() {
 	destroyOthers();
 	detach();
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 2f4ebc3..151adde 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -215,6 +215,11 @@ public:
 	void addSibling(CTreeItem *item);
 
 	/**
+	 * Moves the tree item to be under another parent
+	 */
+	void moveUnder(CTreeItem *newParent);
+
+	/**
 	 * Destroys both the item as well as any of it's children
 	 */
 	void destroyAll();
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index f1b782b..76469a8 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -264,7 +264,7 @@ MESSAGE2(CHoseConnectedMsg, int, value1, 1, int, value2, 0);
 MESSAGE0(CInitializeAnimMsg);
 MESSAGE1(CIsEarBowlPuzzleDone, int, value, 0);
 MESSAGE3(CIsHookedOnMsg, Rect, rect, Rect(), bool, result, false, CString, string1, "");
-MESSAGE1(CIsParrotPresentMsg, int, value, 0);
+MESSAGE1(CIsParrotPresentMsg, bool, value, false);
 MESSAGE1(CKeyCharMsg, int, value, 32);
 MESSAGE2(CLeaveNodeMsg, CNodeItem *, oldNode, nullptr, CNodeItem *, newNode, nullptr);
 MESSAGE2(CLeaveRoomMsg, CRoomItem *, oldRoom, nullptr, CRoomItem *, newRoom, nullptr);
diff --git a/engines/titanic/npcs/parrot.h b/engines/titanic/npcs/parrot.h
index b69c872..0019437 100644
--- a/engines/titanic/npcs/parrot.h
+++ b/engines/titanic/npcs/parrot.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CParrot : public CTrueTalkNPC {
-private:
+public:
 	static int _v1;
 	static int _v2;
 	static int _v3;
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index 804263c..0730026 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -76,6 +76,7 @@ public:
 	bool fn1(int val);
 	void fn2(int val);
 	void fn3(int val, int val2, int val3);
+	void managerProc8(int v) { _soundManager.proc8(v); }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index f575411..9b78a9e 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -57,7 +57,7 @@ void QSoundManager::proc7() {
 	warning("TODO");
 }
 
-void QSoundManager::proc8() {
+void QSoundManager::proc8(int v) {
 	warning("TODO");
 }
 
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index f741f97..d37db60 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -42,7 +42,7 @@ public:
 	virtual int proc5() const { return 0; }
 	virtual void proc6() = 0;
 	virtual void proc7() = 0;
-	virtual void proc8() = 0;
+	virtual void proc8(int v) = 0;
 	virtual void proc9() {}
 	virtual void proc10() = 0;
 	virtual void proc11() = 0;
@@ -105,7 +105,7 @@ public:
 	virtual int proc5();
 	virtual void proc6();
 	virtual void proc7();
-	virtual void proc8();
+	virtual void proc8(int v);
 	virtual void proc9();
 	virtual void proc10();
 	virtual void proc11();


Commit: bc716fda4b11b69eecfc0931afd3b12ef0afb589
    https://github.com/scummvm/scummvm/commit/bc716fda4b11b69eecfc0931afd3b12ef0afb589
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:11-04:00

Commit Message:
TITANIC: Implemented CCarryParrot msg handlers and support methods

Changed paths:
    engines/titanic/carry/carry_parrot.cpp
    engines/titanic/carry/carry_parrot.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/movie_clip.cpp
    engines/titanic/core/movie_clip.h
    engines/titanic/game_manager.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index 1081980..4b2b637 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -21,8 +21,12 @@
  */
 
 #include "titanic/carry/carry_parrot.h"
+#include "titanic/core/project_item.h"
+#include "titanic/core/room_item.h"
 #include "titanic/game/cage.h"
 #include "titanic/npcs/parrot.h"
+#include "titanic/npcs/succubus.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -39,14 +43,14 @@ BEGIN_MESSAGE_MAP(CCarryParrot, CCarry)
 END_MESSAGE_MAP()
 
 CCarryParrot::CCarryParrot() : CCarry(), _string6("PerchedParrot"),
-		_field138(0), _field13C(0), _field140(0), _field144(10),
+		_timerId(0), _field13C(0), _field140(false), _field144(10),
 		_field148(25), _field14C(0), _field150(8) {
 }
 
 void CCarryParrot::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string6, indent);
-	file->writeNumberLine(_field138, indent);
+	file->writeNumberLine(_timerId, indent);
 	file->writeNumberLine(_field13C, indent);
 	file->writeNumberLine(_field140, indent);
 
@@ -56,7 +60,7 @@ void CCarryParrot::save(SimpleFile *file, int indent) const {
 void CCarryParrot::load(SimpleFile *file) {
 	file->readNumber();
 	_string6 = file->readString();
-	_field138 = file->readNumber();
+	_timerId = file->readNumber();
 	_field13C = file->readNumber();
 	_field140 = file->readNumber();
 
@@ -109,34 +113,124 @@ bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 		if (msg->_mousePos.x >= 75 && msg->_mousePos.x <= 565 &&
 				!CParrot::_v2 && !CCage::_v2) {
 			setVisible(false);
-			// TODO
+			_fieldE0 = 0;
+			CTreeItem *perchedParrot = findUnder(getRoot(), "PerchedParrot");
+			detach();
+			addUnder(perchedParrot);
+			sound8(true);
+
+			CPutParrotBackMsg backMsg(msg->_mousePos.x);
+			backMsg.execute(perchedParrot);
 		} else {
-			// TODO
+			setVisible(false);
+			_fieldE0 = 0;
+			CParrot::_v4 = 2;
+			playSound("z#475.wav", 100, 0, 0);
+			sound8(true);
+			moveUnder(findRoom());
+
+			CActMsg actMsg("Shut");
+			actMsg.execute("ParrotCage");
 		}
 	} else {
-		// TODO
+		CCharacter *character = static_cast<CCharacter *>(msg->_dropTarget);
+		if (character) {
+			CUseWithCharMsg charMsg(character);
+			charMsg.execute(this, nullptr, 0);
+		} else {
+			setVisible(false);
+			_fieldE0 = 0;
+			playSound("z#475.wav", 100, 0, 0);
+			sound8(true);
+			moveUnder(findRoom());
+		}
 	}
 
 	return true;
 }
 
 bool CCarryParrot::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
-	// TODO
+	if (CParrot::_v4 != 3) {
+		moveToView();
+		setPosition(Point(0, 0));
+		setVisible(true);
+		playClip("Pick Up", 2);
+		playClip("Flapping", 1);
+
+		stopTimer(_timerId);
+		_timerId = addTimer(1000, 1000);
+
+		_field13C = 0;
+		CParrot::_v4 = 1;
+		msg->_value3 = 1;
+
+		return CCarry::PassOnDragStartMsg(msg);
+	}
+
+	CTreeItem *treeItem = getRoot()->findByName(_string6);
+	if (treeItem)
+		trueTalkFn1(treeItem, 0x446BF, 0);
+
+	_fieldE0 = 0;
+	playSound("z#475.wav", 100, 0, 0);
+	moveUnder(findRoom());
+	msg->_value4 = 1;
+
 	return true;
 }
 
 bool CCarryParrot::PreEnterViewMsg(CPreEnterViewMsg *msg) {
-	// TODO
+	loadSurface();
+	CCarryParrot *parrot = static_cast<CCarryParrot *>(getRoot()->findByName("CarryParrot"));
+	if (parrot)
+		parrot->_fieldE0 = 0;
+
 	return true;
 }
 
 bool CCarryParrot::UseWithCharMsg(CUseWithCharMsg *msg) {
-	// TODO
-	return true;
+	CSuccUBus *succubus = static_cast<CSuccUBus *>(msg->_character);
+	if (succubus)
+		CParrot::_v4 = 3;
+
+	return CCarry::UseWithCharMsg(msg);
 }
 
 bool CCarryParrot::ActMsg(CActMsg *msg) {
-	// TODO
+	if (msg->_action == "FreeParrot" && (CParrot::_v4 == 4 || CParrot::_v4 == 1)) {
+		CTreeItem *treeItem = getRoot()->findByName(_string6);
+		if (treeItem)
+			trueTalkFn1(treeItem, 0x446BF, 0);
+
+		setVisible(false);
+		_fieldE0 = 0;
+
+		if (CParrot::_v4 == 4) {
+			CActMsg actMsg("Shut");
+			actMsg.execute("ParrotCage");
+		} else {
+			playSound("z#475.wav", 100, 0, 0);
+
+			if (!_field140) {
+				CCarry *feathers = static_cast<CCarry *>(getRoot()->findByName("Feathers"));
+				if (feathers) {
+					feathers->setVisible(true);
+					feathers->dropOnPet();
+				}
+
+				_field140 = true;
+			}
+
+			getPetControl()->removeFromInventory(this);
+			getPetControl()->setC8(true);
+			moveUnder(getRoom());
+		}
+
+		CParrot::_v4 = 2;
+		stopTimer(_timerId);
+		_timerId = 0;
+	}
+
 	return true;
 }
 
diff --git a/engines/titanic/carry/carry_parrot.h b/engines/titanic/carry/carry_parrot.h
index fc1bbba..1c5cc2e 100644
--- a/engines/titanic/carry/carry_parrot.h
+++ b/engines/titanic/carry/carry_parrot.h
@@ -43,9 +43,9 @@ class CCarryParrot : public CCarry {
 	bool ActMsg(CActMsg *msg);
 private:
 	CString _string6;
-	int _field138;
+	int _timerId;
 	int _field13C;
-	int _field140;
+	bool _field140;
 	int _field144;
 	int _field148;
 	int _field14C;
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 362dbfe..016903b 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -377,6 +377,13 @@ void CGameObject::playMovie(uint startFrame, uint endFrame, int val3) {
 	}
 }
 
+void CGameObject::playClip(const CString &name, uint flags) {
+	_frameNumber = -1;
+	CMovieClip *clip = _clipList1.findByName(name);
+	if (clip)
+		playMovie(clip->_startFrame, clip->_endFrame, flags);
+}
+
 void CGameObject::playMovie(uint flags) {
 	_frameNumber = -1;
 	if (!_surface && !_resource.empty()) {
@@ -473,6 +480,18 @@ int CGameObject::addTimer(int endVal, uint firstDuration, uint duration) {
 	return timer->_id;
 }
 
+int CGameObject::addTimer(uint firstDuration, uint duration) {
+	CTimeEventInfo *timer = new CTimeEventInfo(g_vm->_events->getTicksCount(),
+		duration != 0, firstDuration, duration, this, 0, CString());
+
+	getGameManager()->addTimer(timer);
+	return timer->_id;
+}
+
+void CGameObject::stopTimer(int id) {
+	getGameManager()->stopTimer(id);
+}
+
 void CGameObject::gotoView(const CString &viewName, const CString &clipName) {
 	CViewItem *newView = parseView(viewName);
 	CGameManager *gameManager = getGameManager();
@@ -588,6 +607,20 @@ CGameObject *CGameObject::findRoomObject(const CString &name) const {
 	return static_cast<CGameObject *>(findRoom()->findByName(name));
 }
 
+CGameObject *CGameObject::findUnder(CTreeItem *parent, const CString &name) {
+	if (!parent)
+		return nullptr;
+
+	for (CTreeItem *treeItem = parent->getFirstChild(); treeItem;
+	treeItem = treeItem->scan(parent)) {
+		if (!treeItem->getName().compareTo(name)) {
+			return dynamic_cast<CGameObject *>(treeItem);
+		}
+	}
+
+	return nullptr;
+}
+
 Found CGameObject::find(const CString &name, CGameObject **item, int findAreas) {
 	CGameObject *go;
 	*item = nullptr;
@@ -648,4 +681,23 @@ void CGameObject::incState38() {
 	getGameManager()->_gameState.inc38();
 }
 
+void CGameObject::trueTalkFn1(CTreeItem *item, int val2, int val3) {
+	CGameManager *gameManager = getGameManager();
+	if (gameManager) {
+		CTrueTalkManager *talkManager = gameManager->getTalkManager();
+		if (talkManager)
+			talkManager->fn1(item, val2, val3);
+	}
+}
+
+void CGameObject::loadSurface() {
+	if (!_surface && !_resource.empty()) {
+		loadResource(_resource);
+		_resource.clear();
+	}
+
+	if (_surface)
+		_surface->loadIfReady();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 653230a..6047203 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -150,6 +150,16 @@ protected:
 	int addTimer(int endVal, uint firstDuration, uint duration);
 
 	/**
+	 * Adds a timer
+	 */
+	int addTimer(uint firstDuration, uint duration);
+
+	/**
+	 * Stops a timer
+	 */
+	void stopTimer(int id);
+
+	/**
 	 * Causes the game to sleep for the specified time
 	 */
 	void sleep(uint milli);
@@ -191,6 +201,11 @@ protected:
 	Found find(const CString &name, CGameObject **item, int findAreas);
 
 	/**
+	 * Scan the specified room for an item by name
+	 */
+	static CGameObject *findUnder(CTreeItem *parent, const CString &name);
+
+	/**
 	 * Moves the item from it's original position to be under the hidden room
 	 */
 	void moveToHiddenRoom();
@@ -199,6 +214,13 @@ protected:
 	 * Moves the item from it's original position to be under the current view
 	 */
 	void moveToView();
+
+	void trueTalkFn1(CTreeItem *item, int val2, int val3);
+
+	/**
+	 * Load the surface
+	 */
+	void loadSurface();
 public:
 	int _field60;
 	CursorId _cursorId;
@@ -272,6 +294,11 @@ public:
 	void playMovie(uint startFrame, uint endFrame, int val3);
 
 	/**
+	 * Play an arbitrary clip
+	 */
+	void playClip(const CString &name, uint flags);
+
+	/**
 	 * Return the current view/node/room as a single string
 	 */
 	CString getViewFullName() const;
diff --git a/engines/titanic/core/movie_clip.cpp b/engines/titanic/core/movie_clip.cpp
index 9a787e2..fdf329a 100644
--- a/engines/titanic/core/movie_clip.cpp
+++ b/engines/titanic/core/movie_clip.cpp
@@ -31,8 +31,8 @@ void CMovieClip::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(2, indent);
 	file->writeQuotedLine("Clip", indent);
 	file->writeQuotedLine(_name, indent);
-	file->writeNumberLine(_field18, indent);
-	file->writeNumberLine(_field1C, indent);
+	file->writeNumberLine(_startFrame, indent);
+	file->writeNumberLine(_endFrame, indent);
 
 	ListItem::save(file, indent);
 }
@@ -43,8 +43,8 @@ void CMovieClip::load(SimpleFile *file) {
 	switch (val) {
 	case 1:
 		_name = file->readString();
-		_field18 = file->readNumber();
-		_field1C = file->readNumber();
+		_startFrame = file->readNumber();
+		_endFrame = file->readNumber();
 		_field20 = file->readNumber();
 		_field24 = file->readNumber();
 		_field28 = file->readNumber();
@@ -55,8 +55,8 @@ void CMovieClip::load(SimpleFile *file) {
 	case 2:
 		file->readString();
 		_name = file->readString();
-		_field18 = file->readNumber();
-		_field1C = file->readNumber();
+		_startFrame = file->readNumber();
+		_endFrame = file->readNumber();
 		break;
 
 	default:
diff --git a/engines/titanic/core/movie_clip.h b/engines/titanic/core/movie_clip.h
index 0abda94..7eccc47 100644
--- a/engines/titanic/core/movie_clip.h
+++ b/engines/titanic/core/movie_clip.h
@@ -32,8 +32,6 @@ namespace Titanic {
  */
 class CMovieClip : public ListItem {
 private:
-	int _field18;
-	int _field1C;
 	int _field20;
 	int _field24;
 	int _field28;
@@ -43,6 +41,8 @@ private:
 	CString _string3;
 public:
 	CString _name;
+	int _startFrame;
+	int _endFrame;
 public:
 	CLASSDEF
 	CMovieClip();
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 6e5782f..102cc40 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -181,6 +181,11 @@ public:
 	void stopTimer(uint id) { _timers.stop(id); }
 
 	void setTimer44(uint id, uint val) { _timers.set44(id, val); }
+
+	/**
+	 * Return the true talk manager
+	 */
+	CTrueTalkManager *getTalkManager() { return &_trueTalkManager; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index a955b08..bb320f2 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -21,7 +21,9 @@
  */
 
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/carry/carry.h"
 #include "titanic/core/project_item.h"
+#include "titanic/messages/pet_messages.h"
 #include "titanic/game_manager.h"
 #include "titanic/game_state.h"
 
@@ -217,24 +219,9 @@ CRoomItem *CPetControl::getHiddenRoom() {
 	return _hiddenRoom;
 }
 
-CGameObject *CPetControl::findItemInRoom(CRoomItem *room, 
-		const CString &name) const {
-	if (!room)
-		return nullptr;
-
-	for (CTreeItem *treeItem = room->getFirstChild(); treeItem;
-			treeItem = treeItem->scan(room)) {
-		if (!treeItem->getName().compareTo(name)) {
-			return dynamic_cast<CGameObject *>(treeItem);
-		}
-	}
-
-	return nullptr;
-}
-
 CGameObject *CPetControl::getHiddenObject(const CString &name) {
 	CRoomItem *room = getHiddenRoom();
-	return room ? findItemInRoom(room, name) : nullptr;
+	return room ? findUnder(room, name) : nullptr;
 }
 
 bool CPetControl::containsPt(const Common::Point &pt) const {
@@ -369,6 +356,26 @@ void CPetControl::addToInventory(CCarry *item) {
 	_inventory.addItem(item);
 }
 
+void CPetControl::removeFromInventory(CCarry *item, CTreeItem *newParent,
+		bool refreshUI, bool sendMsg) {
+	if (item && newParent) {
+		item->detach();
+		item->addUnder(newParent);
+
+		if (refreshUI)
+			_inventory.itemRemoved(item);
+		if (sendMsg) {
+			CPETLostObjectMsg lostMsg;
+			lostMsg.execute(item);
+		}
+	}
+}
+
+void CPetControl::removeFromInventory(CCarry *item, bool refreshUI, bool sendMsg) {
+	CViewItem *view = getGameManager()->getView();
+	removeFromInventory(item, view, refreshUI, sendMsg);
+}
+
 void CPetControl::moveToHiddenRoom(CTreeItem *item) {
 	CRoomItem *room = getHiddenRoom();
 	if (room) {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 88a738f..27b0a2b 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -83,11 +83,6 @@ private:
 	void loaded();
 
 	/**
-	 * Scan the specified room for an item by name
-	 */
-	CGameObject *findItemInRoom(CRoomItem *room, const CString &name) const;
-
-	/**
 	 * Returns true if the draw bounds contains the specified point
 	 */
 	bool containsPt(const Common::Point &pt) const;
@@ -219,9 +214,22 @@ public:
 	void addToInventory(CCarry *item);
 
 	/**
+	 * Remove an item from the inventory
+	 */
+	void removeFromInventory(CCarry *item, CTreeItem *newParent,
+		bool refreshUI = true, bool sendMsg = true);
+
+	/**
+	 * Remove an item from the inventory
+	 */
+	void removeFromInventory(CCarry *item, bool refreshUI = true, bool sendMsg = true);
+
+	/**
 	 * Moves a tree item from it's original position to be under the hidden room
 	 */
 	void moveToHiddenRoom(CTreeItem *item);
+
+	void setC8(int val) { _fieldC8 = val; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index a073a37..6ea844a 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -106,4 +106,8 @@ void CPetInventory::addItem(CCarry *item) {
 	warning("TODO: CPetInventory::addItem");
 }
 
+void CPetInventory::itemRemoved(CCarry *item) {
+	warning("TODO: CPetInventory::itemRemoved");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 3700854..8f40200 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -95,6 +95,11 @@ public:
 	 * Add an item to the inventory
 	 */
 	void addItem(CCarry *item);
+
+	/**
+	 * Called when an item has been removed from the PET
+	 */
+	void itemRemoved(CCarry *item);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 68818db..03f8ac5 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/true_talk/true_talk_manager.h"
+#include "titanic/core/tree_item.h"
 
 #define MKTAG_BE(a3,a2,a1,a0) ((uint32)((a3) | ((a2) << 8) | ((a1) << 16) | ((a0) << 24)))
 
@@ -190,4 +191,8 @@ void CTrueTalkManager::update2() {
 	//warning("CTrueTalkManager::update2");
 }
 
+void CTrueTalkManager::fn1(CTreeItem *item, int val2, int val3) {
+	warning("CTrueTalkManager::fn1");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 4cd892c..2e366a6 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -30,6 +30,7 @@
 namespace Titanic {
 
 class CGameManager;
+class CTreeItem;
 
 class CTrueTalkManager {
 private:
@@ -110,6 +111,8 @@ public:
 	void update1();
 
 	void update2();
+
+	void fn1(CTreeItem *item, int val2, int val3);
 };
 
 } // End of namespace Titanic


Commit: ee2a70f466057eaebfc05118374d3def81eca6f3
    https://github.com/scummvm/scummvm/commit/ee2a70f466057eaebfc05118374d3def81eca6f3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:12-04:00

Commit Message:
TITANIC: Implemented CChicken message handlers

Changed paths:
    engines/titanic/carry/chicken.cpp
    engines/titanic/carry/chicken.h
    engines/titanic/messages/messages.h



diff --git a/engines/titanic/carry/chicken.cpp b/engines/titanic/carry/chicken.cpp
index 52f3c25..50fcb8f 100644
--- a/engines/titanic/carry/chicken.cpp
+++ b/engines/titanic/carry/chicken.cpp
@@ -21,13 +21,28 @@
  */
 
 #include "titanic/carry/chicken.h"
+#include "titanic/game/sauce_dispensor.h"
+#include "titanic/npcs/succubus.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CChicken, CCarry)
+	ON_MESSAGE(UseWithCharMsg)
+	ON_MESSAGE(ActMsg)
+	ON_MESSAGE(VisibleMsg)
+	ON_MESSAGE(TimerMsg)
+	ON_MESSAGE(PETGainedObjectMsg)
+	ON_MESSAGE(ParrotTriesChickenMsg)
+	ON_MESSAGE(MouseDragEndMsg)
+	ON_MESSAGE(PETObjectStateMsg)
+	ON_MESSAGE(PETLostObjectMsg)
+END_MESSAGE_MAP()
+
 int CChicken::_v1;
 
 CChicken::CChicken() : CCarry(), _string6("None"),
-		_field12C(1), _field13C(0), _field140(0) {
+		_field12C(1), _field13C(0), _timerId(0) {
 }
 
 void CChicken::save(SimpleFile *file, int indent) const {
@@ -36,7 +51,7 @@ void CChicken::save(SimpleFile *file, int indent) const {
 	file->writeQuotedLine(_string6, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_field13C, indent);
-	file->writeNumberLine(_field140, indent);
+	file->writeNumberLine(_timerId, indent);
 
 	CCarry::save(file, indent);
 }
@@ -47,9 +62,164 @@ void CChicken::load(SimpleFile *file) {
 	_string6 = file->readString();
 	_v1 = file->readNumber();
 	_field13C = file->readNumber();
-	_field140 = file->readNumber();
+	_timerId = file->readNumber();
 
 	CCarry::load(file);
 }
 
+bool CChicken::UseWithOtherMsg(CUseWithOtherMsg *msg) {
+	if (msg->_other->getName() == "Napkin") {
+		if (_field12C || _string6 == "None") {
+			CActMsg actMsg("Clean");
+			actMsg.execute(this);
+			dropOnPet();
+		} else {
+			CShowTextMsg textMsg("The chicken is already clean.");
+			textMsg.execute("PET");
+		}
+
+		dropOnPet();
+	} else {
+		CSauceDispensor *dispensor = static_cast<CSauceDispensor *>(msg->_other);
+		if (!dispensor || _string6 == "None") {
+			return CCarry::UseWithOtherMsg(msg);
+		} else {
+			setVisible(false);
+			CUse use(this);
+			use.execute(msg->_other);
+		}
+	}
+
+	return true;
+}
+
+bool CChicken::UseWithCharMsg(CUseWithCharMsg *msg) {
+	CSuccUBus *succubus = static_cast<CSuccUBus *>(msg->_character);
+	if (succubus) {
+		setPosition(Point(330, 300));
+		CSubAcceptCCarryMsg acceptMsg;
+		acceptMsg._item = this;
+		acceptMsg.execute(succubus);
+	} else {
+		dropOnPet();
+	}
+
+	return true;
+}
+
+bool CChicken::ActMsg(CActMsg *msg) {
+	if (msg->_action == "GoToPET") {
+		setVisible(true);
+		dropOnPet();
+	} else if (msg->_action == "Tomato") {
+		_string6 = "Tomato";
+		loadFrame(4);
+		_visibleFrame = 4;
+	} else if (msg->_action == "Mustard") {
+		_string6 = "Mustard";
+		loadFrame(5);
+		_visibleFrame = 5;
+	} else if (msg->_action == "Bird") {
+		_string6 = "Bird";
+		loadFrame(2);
+		_visibleFrame = 2;
+	} else if (msg->_action == "None") {
+		setVisible(false);
+	} else if (msg->_action == "Clean") {
+		_string6 = "None";
+		loadFrame(3);
+		_field12C = 0;
+		_visibleFrame = 3;
+	}
+	else if (msg->_action == "Dispense Chicken") {
+		_string6 = "None";
+		_field13C = 0;
+		_field12C = 1;
+		loadFrame(1);
+		_visibleFrame = 1;
+		_v1 = 120;
+	} else if (msg->_action == "Hot") {
+		_v1 = 120;
+	} else if (msg->_action == "Eaten") {
+		setVisible(false);
+		moveToHiddenRoom();
+		_field13C = 1;
+	}
+
+	return true;
+}
+
+bool CChicken::VisibleMsg(CVisibleMsg *msg) {
+	setVisible(msg->_visible);
+	if (msg->_visible)
+		loadFrame(_visibleFrame);
+
+	return true;
+}
+
+bool CChicken::TimerMsg(CTimerMsg *msg) {
+	CGameObject *obj = getMailManFirstObject();
+	while (obj && obj->getName() != "Chicken")
+		obj = getMailManNextObject(obj);
+
+	bool flag = false;
+	if (obj) {
+		flag = _v1;
+	} else if (_v1 > 0) {
+		--_v1;
+		flag = _v1;
+	}
+
+	if (flag) {
+		addToInventory();
+		stopTimer(_timerId);
+	}
+
+	return true;
+}
+
+bool CChicken::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
+	stopTimer(_timerId);
+	_timerId = addTimer(1000, 1000);
+	return true;
+}
+
+bool CChicken::ParrotTriesChickenMsg(CParrotTriesChickenMsg *msg) {
+	if (_v1 > 0)
+		msg->_value1 = 1;
+
+	if (_string6 == "Tomato") {
+		msg->_value2 = 1;
+	} else if (_string6 == "Mustard") {
+		msg->_value2 = 2;
+	} else if (_string6 == "Bird") {
+		msg->_value2 = 3;
+	}
+
+	return true;
+}
+
+bool CChicken::MouseDragEndMsg(CMouseDragEndMsg *msg) {
+	if (_field13C)
+		return true;
+	else
+		return CCarry::MouseDragEndMsg(msg);
+}
+
+bool CChicken::PETObjectStateMsg(CPETObjectStateMsg *msg) {
+	if (_v1 > 0)
+		msg->_value = 2;
+
+	return true;
+}
+
+bool CChicken::PETLostObjectMsg(CPETLostObjectMsg *msg) {
+	if (compareViewNameTo("ParrotLobby.Node 1.N")) {
+		CActMsg actMsg("StartChickenDrag");
+		actMsg.execute("PerchedParrot");
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/chicken.h b/engines/titanic/carry/chicken.h
index bbc46f8..946c102 100644
--- a/engines/titanic/carry/chicken.h
+++ b/engines/titanic/carry/chicken.h
@@ -24,17 +24,30 @@
 #define TITANIC_CHICKEN_H
 
 #include "titanic/carry/carry.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/pet_messages.h"
 
 namespace Titanic {
 
 class CChicken : public CCarry {
+	DECLARE_MESSAGE_MAP
+	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
+	bool UseWithCharMsg(CUseWithCharMsg *msg);
+	bool ActMsg(CActMsg *msg);
+	bool VisibleMsg(CVisibleMsg *msg);
+	bool TimerMsg(CTimerMsg *msg);
+	bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
+	bool ParrotTriesChickenMsg(CParrotTriesChickenMsg *msg);
+	bool MouseDragEndMsg(CMouseDragEndMsg *msg);
+	bool PETObjectStateMsg(CPETObjectStateMsg *msg);
+	bool PETLostObjectMsg(CPETLostObjectMsg *msg);
 private:
 	static int _v1;
 public:
 	int _field12C;
 	CString _string6;
 	int _field13C;
-	int _field140;
+	int _timerId;
 public:
 	CLASSDEF
 	CChicken();
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 76469a8..649b20b 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -362,7 +362,7 @@ MESSAGE0(CTrueTalkSelfQueueAnimSetMsg);
 MESSAGE3(CTrueTalkTriggerActionMsg, int, value1, 0, int, value2, 0, int, value3, 0);
 MESSAGE0(CTurnOff);
 MESSAGE0(CTurnOn);
-MESSAGE1(CUse, int, value, 0);
+MESSAGE1(CUse, CCarry *, item, nullptr);
 MESSAGE1(CUseWithCharMsg, CCharacter *, character, nullptr);
 MESSAGE1(CUseWithOtherMsg, CGameObject *, other, 0);
 MESSAGE1(CVirtualKeyCharMsg, Common::KeyState, keyState, Common::KeyState());


Commit: 6a4e7c3d731fba108b1da34413f60a3490529291
    https://github.com/scummvm/scummvm/commit/6a4e7c3d731fba108b1da34413f60a3490529291
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:13-04:00

Commit Message:
TITANIC: Implement CCrushedTV message handlers

Changed paths:
    engines/titanic/carry/crushed_tv.cpp
    engines/titanic/carry/crushed_tv.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h



diff --git a/engines/titanic/carry/crushed_tv.cpp b/engines/titanic/carry/crushed_tv.cpp
index a0a7ee7..5abc8fa 100644
--- a/engines/titanic/carry/crushed_tv.cpp
+++ b/engines/titanic/carry/crushed_tv.cpp
@@ -21,9 +21,16 @@
  */
 
 #include "titanic/carry/crushed_tv.h"
+#include "titanic/npcs/character.h"
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CCrushedTV, CCarry)
+	ON_MESSAGE(ActMsg)
+	ON_MESSAGE(UseWithCharMsg)
+	ON_MESSAGE(MouseDragStartMsg)
+END_MESSAGE_MAP()
+
 CCrushedTV::CCrushedTV() : CCarry() {
 }
 
@@ -37,4 +44,37 @@ void CCrushedTV::load(SimpleFile *file) {
 	CCarry::load(file);
 }
 
+bool CCrushedTV::ActMsg(CActMsg *msg) {
+	if (msg->_action == "SmashTV") {
+		setVisible(true);
+		_fieldE0 = 1;
+	}
+
+	return true;
+}
+
+bool CCrushedTV::UseWithCharMsg(CUseWithCharMsg *msg) {
+	if (msg->_character->getName() == "Barbot" && msg->_character->_visible) {
+		setVisible(false);
+		CActMsg actMsg("CrushedTV");
+		actMsg.execute(msg->_character);
+		return true;
+	} else {
+		return CCarry::UseWithCharMsg(msg);
+	}
+}
+
+bool CCrushedTV::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+	if (!checkStartDragging(msg)) {
+		return false;
+	} else if (compareViewNameTo("BottomOfWell.Node 7.N")) {
+		changeView("BottomOfWell.Node 12.N", "");
+		CActMsg actMsg("TelevisionTaken");
+		actMsg.execute("BOWTelevisionMonitor");
+	}
+
+	return CCarry::MouseDragStartMsg(msg);
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/crushed_tv.h b/engines/titanic/carry/crushed_tv.h
index b2bfd75..3e77534 100644
--- a/engines/titanic/carry/crushed_tv.h
+++ b/engines/titanic/carry/crushed_tv.h
@@ -24,10 +24,16 @@
 #define TITANIC_CRUSHED_TV_H
 
 #include "titanic/carry/carry.h"
+#include "titanic/messages/messages.h"
+#include "titanic/messages/mouse_messages.h"
 
 namespace Titanic {
 
 class CCrushedTV : public CCarry {
+	DECLARE_MESSAGE_MAP
+	bool ActMsg(CActMsg *msg);
+	bool UseWithCharMsg(CUseWithCharMsg *msg);
+	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
 public:
 	CLASSDEF
 	CCrushedTV();
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 016903b..7549797 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -700,4 +700,24 @@ void CGameObject::loadSurface() {
 		_surface->loadIfReady();
 }
 
+bool CGameObject::changeView(const CString &viewName, const CString &clipName) {
+	CViewItem *newView = parseView(viewName);
+	CGameManager *gameManager = getGameManager();
+	CViewItem *oldView = gameManager->getView();
+
+	if (!oldView || !newView)
+		return false;
+	
+	CMovieClip *clip = nullptr;
+	if (!clipName.empty()) {
+		clip = oldView->findNode()->findRoom()->findClip(clipName);
+	} else {
+		CLinkItem *link = oldView->findLink(newView);
+		if (link)
+			clip = link->getClip();
+	}
+
+	gameManager->_gameState.changeView(newView, clip);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 6047203..db1ed90 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -73,7 +73,6 @@ protected:
 	int _field50;
 	int _field54;
 	int _field58;
-	bool _visible;
 	CMovieClipList _clipList1;
 	int _initialFrame;
 	CMovieClipList _clipList2;
@@ -221,9 +220,15 @@ protected:
 	 * Load the surface
 	 */
 	void loadSurface();
+
+	/**
+	 * Change the view
+	 */
+	bool changeView(const CString &viewName, const CString &clipName);
 public:
 	int _field60;
 	CursorId _cursorId;
+	bool _visible;
 public:
 	CLASSDEF
 	CGameObject();


Commit: fb5565679bf701293a73abfd03b76515f7bcb8ab
    https://github.com/scummvm/scummvm/commit/fb5565679bf701293a73abfd03b76515f7bcb8ab
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:15-04:00

Commit Message:
TITANIC: Added CFeathers message map

Changed paths:
    engines/titanic/carry/feathers.cpp
    engines/titanic/carry/feathers.h



diff --git a/engines/titanic/carry/feathers.cpp b/engines/titanic/carry/feathers.cpp
index c03b738..a738d74 100644
--- a/engines/titanic/carry/feathers.cpp
+++ b/engines/titanic/carry/feathers.cpp
@@ -24,6 +24,9 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CFeathers, CCarry)
+END_MESSAGE_MAP()
+
 CFeathers::CFeathers() : CCarry() {
 }
 
diff --git a/engines/titanic/carry/feathers.h b/engines/titanic/carry/feathers.h
index 106e9a0..f90de11 100644
--- a/engines/titanic/carry/feathers.h
+++ b/engines/titanic/carry/feathers.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CFeathers : public CCarry {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CFeathers();


Commit: daaa458d64df42f113b7badd65cdfaf0da0504ff
    https://github.com/scummvm/scummvm/commit/daaa458d64df42f113b7badd65cdfaf0da0504ff
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:16-04:00

Commit Message:
TITANIC: Restructuring PET list classes, beginning of inventory

Changed paths:
  A engines/titanic/pet_control/pet_inventory_glyphs.cpp
  A engines/titanic/pet_control/pet_inventory_glyphs.h
  R engines/titanic/pet_control/pet_control_list_item.cpp
  R engines/titanic/pet_control/pet_control_list_item.h
  R engines/titanic/pet_control/pet_control_sub10.cpp
  R engines/titanic/pet_control/pet_control_sub10.h
    engines/titanic/carry/arm.cpp
    engines/titanic/carry/bridge_piece.cpp
    engines/titanic/carry/carry.cpp
    engines/titanic/carry/carry.h
    engines/titanic/carry/carry_parrot.cpp
    engines/titanic/carry/chicken.cpp
    engines/titanic/carry/napkin.cpp
    engines/titanic/core/game_object.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_control_list_item2.h
    engines/titanic/pet_control/pet_control_sub11.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_remote.h
    engines/titanic/pet_control/pet_saves.h



diff --git a/engines/titanic/carry/arm.cpp b/engines/titanic/carry/arm.cpp
index b6e125a..c39812f 100644
--- a/engines/titanic/carry/arm.cpp
+++ b/engines/titanic/carry/arm.cpp
@@ -119,7 +119,7 @@ bool CArm::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 		if (hookedMsg._result) {
 			_string7 = "GondolierLeftLever";
 		} else {
-			dropOnPet();
+			addToInventory();
 		}
 	} else if (msg->_other->getName() == "GondolierRightLever") {
 		CIsHookedOnMsg hookedMsg(_hookedRect, 0, getName());
@@ -129,7 +129,7 @@ bool CArm::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 		if (hookedMsg._result) {
 			_string7 = "GondolierRightLever";
 		} else {
-			dropOnPet();
+			addToInventory();
 		}
 	}
 
@@ -166,13 +166,13 @@ bool CArm::MaitreDHappyMsg(CMaitreDHappyMsg *msg) {
 			CGameObject *child = static_cast<CGameObject *>(getFirstChild());
 			if (child) {
 				child->setVisible(true);
-				dropOnPet();
+				addToInventory();
 			}
 
 			_visibleFrame = _field170;
 			loadFrame(_visibleFrame);
 			_string6 = "None";
-			addToInventory();
+			invFn3();
 		}
 	}
 
@@ -189,7 +189,7 @@ bool CArm::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
 				_visibleFrame = _field170;
 				loadFrame(_visibleFrame);
 				child->setVisible(true);
-				child->dropOnPet();
+				child->addToInventory();
 			}
 
 			_string6 = "None";
diff --git a/engines/titanic/carry/bridge_piece.cpp b/engines/titanic/carry/bridge_piece.cpp
index 0ed8ae6..4fafac2 100644
--- a/engines/titanic/carry/bridge_piece.cpp
+++ b/engines/titanic/carry/bridge_piece.cpp
@@ -56,7 +56,7 @@ bool CBridgePiece::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 	if (!shipSetting) {
 		return CCarry::UseWithOtherMsg(msg);
 	} else if (shipSetting->_string4 == "NULL") {
-		dropOnPet();
+		addToInventory();
 		return true;
 	} else {
 		setVisible(false);
diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index 1bb81fb..31d0ff0 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -123,7 +123,7 @@ bool CCarry::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
 bool CCarry::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 	if (msg->_dropTarget) {
 		if (msg->_dropTarget->isPet()) {
-			dropOnPet();
+			addToInventory();
 			return true;
 		}
 
@@ -147,7 +147,7 @@ bool CCarry::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 	CString viewName = getViewFullName();
 	if (viewName.empty() || msg->_mousePos.y >= 360) {
 		sleep(250);
-		dropOnPet();
+		addToInventory();
 	} else {
 		setPosition(_origPos);
 		loadFrame(_itemFrame);
@@ -165,7 +165,7 @@ bool CCarry::UseWithCharMsg(CUseWithCharMsg *msg) {
 	} else {
 		CShowTextMsg textMsg(_string4);
 		textMsg.execute("PET");
-		dropOnPet();
+		addToInventory();
 	}
 
 	return true;
@@ -182,7 +182,7 @@ bool CCarry::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 	_fullViewName = getViewFullName();
 	if (_fullViewName.empty() || _bounds.top >= 360) {
 		sleep(250);
-		dropOnPet();
+		addToInventory();
 	} else {
 		setPosition(_origPos);
 	}
@@ -238,14 +238,16 @@ bool CCarry::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
 	return true;
 }
 
-void CCarry::dropOnPet() {
-	warning("TODO: dropOnPet");
-}
-
 void CCarry::addToInventory() {
 	CPetControl *pet = getPetControl();
 	if (pet)
 		pet->addToInventory(this);
 }
 
+void CCarry::invFn3() {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->invFn3(this);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index 9fd7679..2370556 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -63,9 +63,9 @@ protected:
 	int _visibleFrame;
 protected:
 	/**
-	 * Add the item to the PET inventory
+	 *
 	 */
-	void addToInventory();
+	void invFn3();
 public:
 	CLASSDEF
 	CCarry();
@@ -81,9 +81,9 @@ public:
 	virtual void load(SimpleFile *file);
 
 	/**
-	 * Called to drop an item into the PET
+	 * Add the item to the inventory
 	 */
-	void dropOnPet();
+	void addToInventory();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index 4b2b637..598393b 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -105,7 +105,7 @@ bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 	stopMovie();
 
 	if (msg->_mousePos.y >= 360) {
-		dropOnPet();
+		addToInventory();
 		return true;
 	}
 
@@ -215,7 +215,7 @@ bool CCarryParrot::ActMsg(CActMsg *msg) {
 				CCarry *feathers = static_cast<CCarry *>(getRoot()->findByName("Feathers"));
 				if (feathers) {
 					feathers->setVisible(true);
-					feathers->dropOnPet();
+					feathers->addToInventory();
 				}
 
 				_field140 = true;
diff --git a/engines/titanic/carry/chicken.cpp b/engines/titanic/carry/chicken.cpp
index 50fcb8f..74b42aa 100644
--- a/engines/titanic/carry/chicken.cpp
+++ b/engines/titanic/carry/chicken.cpp
@@ -72,13 +72,13 @@ bool CChicken::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 		if (_field12C || _string6 == "None") {
 			CActMsg actMsg("Clean");
 			actMsg.execute(this);
-			dropOnPet();
+			addToInventory();
 		} else {
 			CShowTextMsg textMsg("The chicken is already clean.");
 			textMsg.execute("PET");
 		}
 
-		dropOnPet();
+		addToInventory();
 	} else {
 		CSauceDispensor *dispensor = static_cast<CSauceDispensor *>(msg->_other);
 		if (!dispensor || _string6 == "None") {
@@ -101,7 +101,7 @@ bool CChicken::UseWithCharMsg(CUseWithCharMsg *msg) {
 		acceptMsg._item = this;
 		acceptMsg.execute(succubus);
 	} else {
-		dropOnPet();
+		addToInventory();
 	}
 
 	return true;
@@ -110,7 +110,7 @@ bool CChicken::UseWithCharMsg(CUseWithCharMsg *msg) {
 bool CChicken::ActMsg(CActMsg *msg) {
 	if (msg->_action == "GoToPET") {
 		setVisible(true);
-		dropOnPet();
+		addToInventory();
 	} else if (msg->_action == "Tomato") {
 		_string6 = "Tomato";
 		loadFrame(4);
@@ -171,7 +171,7 @@ bool CChicken::TimerMsg(CTimerMsg *msg) {
 	}
 
 	if (flag) {
-		addToInventory();
+		invFn3();
 		stopTimer(_timerId);
 	}
 
diff --git a/engines/titanic/carry/napkin.cpp b/engines/titanic/carry/napkin.cpp
index c998c13..a8ceaad 100644
--- a/engines/titanic/carry/napkin.cpp
+++ b/engines/titanic/carry/napkin.cpp
@@ -53,7 +53,7 @@ bool CNapkin::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 		}
 	}
 
-	dropOnPet();
+	addToInventory();
 	return CCarry::UseWithOtherMsg(msg);
 }
 
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index db1ed90..430f705 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -205,11 +205,6 @@ protected:
 	static CGameObject *findUnder(CTreeItem *parent, const CString &name);
 
 	/**
-	 * Moves the item from it's original position to be under the hidden room
-	 */
-	void moveToHiddenRoom();
-
-	/**
 	 * Moves the item from it's original position to be under the current view
 	 */
 	void moveToView();
@@ -313,7 +308,10 @@ public:
 	 */
 	void setVisible(bool val);
 
-	
+	/**
+	 * Moves the item from it's original position to be under the hidden room
+	 */
+	void moveToHiddenRoom();	
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 8f3126b..da642f9 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -356,25 +356,25 @@ MODULE_OBJS := \
 	npcs/titania.o \
 	npcs/true_talk_npc.o \
 	pet_control/pet_control.o \
-	pet_control/pet_control_list_item.o \
 	pet_control/pet_control_list_item2.o \
 	pet_control/pet_conversations.o \
 	pet_control/pet_element.o \
 	pet_control/pet_frame.o \
 	pet_control/pet_gfx_element.o \
 	pet_control/pet_inventory.o \
+	pet_control/pet_inventory_glyphs.o \
 	pet_control/pet_rooms.o \
 	pet_control/pet_remote.o \
 	pet_control/pet_saves.o \
 	pet_control/pet_section.o \
 	pet_control/pet_control_sub5.o \
 	pet_control/pet_control_sub7.o \
-	pet_control/pet_control_sub10.o \
 	pet_control/pet_control_sub11.o \
 	pet_control/pet_control_sub12.o \
 	pet_control/pet_drag_chev.o \
 	pet_control/pet_graphic2.o \
 	pet_control/pet_graphic.o \
+	pet_control/pet_glyphs.o \
 	pet_control/pet_leaf.o \
 	pet_control/pet_mode_off.o \
 	pet_control/pet_mode_on.o \
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index bb320f2..b9f1359 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -353,7 +353,30 @@ CGameObject *CPetControl::getNextObject(CGameObject *prior) const {
 }
 
 void CPetControl::addToInventory(CCarry *item) {
-	_inventory.addItem(item);
+	item->detach();
+
+	if (item->getName() == "CarryParcel") {
+		CCarry *child = static_cast<CCarry *>(getLastChild());
+		if (child)
+			child->detach();
+
+		item->moveToHiddenRoom();
+		if (!child)
+			return;
+
+		item = child;
+	}
+
+	item->addUnder(this);
+	_inventory.itemsChanged();
+
+	setArea(PET_INVENTORY);
+	if (_currentArea != PET_INVENTORY)
+		_inventory.couldntShowInventory(item);
+	
+	makeDirty();
+	CPETGainedObjectMsg msg;
+	msg.execute(item);
 }
 
 void CPetControl::removeFromInventory(CCarry *item, CTreeItem *newParent,
@@ -376,6 +399,10 @@ void CPetControl::removeFromInventory(CCarry *item, bool refreshUI, bool sendMsg
 	removeFromInventory(item, view, refreshUI, sendMsg);
 }
 
+void CPetControl::invFn3(CCarry *item) {
+	_inventory.fn3(item);
+}
+
 void CPetControl::moveToHiddenRoom(CTreeItem *item) {
 	CRoomItem *room = getHiddenRoom();
 	if (room) {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 27b0a2b..4192d9e 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -224,6 +224,8 @@ public:
 	 */
 	void removeFromInventory(CCarry *item, bool refreshUI = true, bool sendMsg = true);
 
+	void invFn3(CCarry *item);
+
 	/**
 	 * Moves a tree item from it's original position to be under the hidden room
 	 */
diff --git a/engines/titanic/pet_control/pet_control_list_item.cpp b/engines/titanic/pet_control/pet_control_list_item.cpp
deleted file mode 100644
index ea67875..0000000
--- a/engines/titanic/pet_control/pet_control_list_item.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_control_list_item.h"
-
-namespace Titanic {
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_list_item.h b/engines/titanic/pet_control/pet_control_list_item.h
deleted file mode 100644
index caa9a0d..0000000
--- a/engines/titanic/pet_control/pet_control_list_item.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_LIST_ITEM_H
-#define TITANIC_PET_CONTROL_LIST_ITEM_H
-
-#include "titanic/core/list.h"
-#include "titanic/pet_control/pet_gfx_element.h"
-
-namespace Titanic {
-
-class CPetControlListItem : public ListItem {
-protected:
-	CPetGfxElement _val;
-	int _field30;
-public:
-	CPetControlListItem() : _field30(0) {}
-
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_LIST_ITEM_H */
diff --git a/engines/titanic/pet_control/pet_control_list_item2.h b/engines/titanic/pet_control/pet_control_list_item2.h
index a7f28fa..70feb30 100644
--- a/engines/titanic/pet_control/pet_control_list_item2.h
+++ b/engines/titanic/pet_control/pet_control_list_item2.h
@@ -23,11 +23,11 @@
 #ifndef TITANIC_PET_CONTROL_LIST_ITEM2_H
 #define TITANIC_PET_CONTROL_LIST_ITEM2_H
 
-#include "titanic/pet_control/pet_control_list_item.h"
+#include "titanic/pet_control/pet_glyphs.h"
 
 namespace Titanic {
 
-class CPetControlListItem2  : public CPetControlListItem {
+class CPetControlListItem2  : public CPetGlyph {
 protected:
 	int _field34;
 	int _field38;
diff --git a/engines/titanic/pet_control/pet_control_sub10.cpp b/engines/titanic/pet_control/pet_control_sub10.cpp
deleted file mode 100644
index a50ad11..0000000
--- a/engines/titanic/pet_control/pet_control_sub10.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/textconsole.h"
-#include "titanic/pet_control/pet_control_sub10.h"
-
-namespace Titanic {
-
-CPetControlSub10::CPetControlSub10() : _field10(0), _field14(7),
-	_field18(-1), _field1C(-1), _field20(0), _field24(0) {
-}
-
-void CPetControlSub10::proc8() {
-	error("TODO");
-}
-
-void CPetControlSub10::setup() {
-	warning("TODO: CPetControlSub10::setup");
-}
-
-void CPetControlSub10::proc10() {
-	error("TODO");
-}
-
-void CPetControlSub10::proc11() {
-	error("TODO");
-}
-
-void CPetControlSub10::draw(CScreenManager *screenManager) {
-	warning("TODO: CPetControlSub10::draw");
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub10.h b/engines/titanic/pet_control/pet_control_sub10.h
deleted file mode 100644
index ef8d02f..0000000
--- a/engines/titanic/pet_control/pet_control_sub10.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB10_H
-#define TITANIC_PET_CONTROL_SUB10_H
-
-#include "titanic/core/list.h"
-#include "titanic/pet_control/pet_control_sub10.h"
-#include "titanic/pet_control/pet_control_list_item.h"
-#include "titanic/support/screen_manager.h"
-
-namespace Titanic {
-
-class CPetControlSub10 : public List<CPetControlListItem> {
-protected:
-	int _field10;
-	int _field14;
-	int _field18;
-	int _field1C;
-	int _field20;
-	int _field24;
-	CPetGfxElement _selection;
-	CPetGfxElement _scrollLeft;
-	CPetGfxElement _scrollRight;
-public:
-	CPetControlSub10();
-
-	virtual void proc8();
-
-	/**
-	 * Set up the control
-	 */
-	virtual void setup();
-
-	virtual void proc10();
-	virtual void proc11();
-
-	void set20(int val) { _field20 = val; }
-
-	/**
-	 * Draw the control
-	 */
-	void draw(CScreenManager *screenManager);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB10_H */
diff --git a/engines/titanic/pet_control/pet_control_sub11.h b/engines/titanic/pet_control/pet_control_sub11.h
index ebad13b..e3f8c3d 100644
--- a/engines/titanic/pet_control/pet_control_sub11.h
+++ b/engines/titanic/pet_control/pet_control_sub11.h
@@ -23,11 +23,11 @@
 #ifndef TITANIC_PET_CONTROL_SUB11_H
 #define TITANIC_PET_CONTROL_SUB11_H
 
-#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_glyphs.h"
 
 namespace Titanic {
 
-class CPetControlSub11 : public CPetControlSub10 {
+class CPetControlSub11 : public CPetGlyphs<CPetGlyph> {
 public:
 };
 
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 6ea844a..89eb692 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -38,7 +38,7 @@ bool CPetInventory::setup(CPetControl *petControl) {
 }
 
 bool CPetInventory::setup() {
-	_sub10.setup();
+	_items.setup();
 	_sub12.setup();
 
 	// TODO
@@ -47,7 +47,7 @@ bool CPetInventory::setup() {
 
 void CPetInventory::draw(CScreenManager *screenManager) {
 	_petControl->drawIndent(screenManager, 7);
-	_sub10.draw(screenManager);
+	_items.draw(screenManager);
 	_sub12.draw(screenManager);
 }
 
@@ -79,8 +79,8 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
 		return false;
 
 	_petControl = petControl;
-	_sub10.proc8();
-	_sub10.set20(28);
+	_items.proc8();
+	_items.set20(28);
 
 	Rect tempRect(0, 0, 52, 52);
 	for (uint idx = 0; idx < TOTAL_ITEMS; ++idx) {
@@ -103,6 +103,10 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
 }
 
 void CPetInventory::addItem(CCarry *item) {
+	if (item) {
+		CPetCarry glyphItem(item, 2);
+
+	}
 	warning("TODO: CPetInventory::addItem");
 }
 
@@ -110,4 +114,20 @@ void CPetInventory::itemRemoved(CCarry *item) {
 	warning("TODO: CPetInventory::itemRemoved");
 }
 
+void CPetInventory::fn3(CCarry *item) {
+	warning("TODO: CPetInventory::fn3");
+}
+
+void CPetInventory::itemsChanged() {
+	_items.clear();
+
+	//CGameObject *item = static_cast<CGameObject *>(_petControl->getFirstObject());
+
+
+}
+
+void CPetInventory::couldntShowInventory(CCarry *item) {
+
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 8f40200..4a08c1c 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -25,7 +25,7 @@
 
 #include "titanic/support/simple_file.h"
 #include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_inventory_glyphs.h"
 #include "titanic/pet_control/pet_control_sub12.h"
 
 namespace Titanic {
@@ -36,7 +36,7 @@ namespace Titanic {
 class CPetInventory : public CPetSection {
 private:
 	CPetControlSub12 _sub12;
-	CPetControlSub10 _sub10;
+	CPetInventoryGlyphs _items;
 	CGameObject *_itemBackgrounds[46];
 	CGameObject *_itemGlyphs[46];
 	int _field28C;
@@ -100,6 +100,18 @@ public:
 	 * Called when an item has been removed from the PET
 	 */
 	void itemRemoved(CCarry *item);
+
+	void fn3(CCarry *item);
+
+	/**
+	 * Called when the items under the PET have changed
+	 */
+	void itemsChanged();
+
+	/**
+	 * Called when the inventory can't be shown after adding an item
+	 */
+	void couldntShowInventory(CCarry *item);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
new file mode 100644
index 0000000..6fc58ff
--- /dev/null
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
@@ -0,0 +1,68 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/pet_control/pet_inventory_glyphs.h"
+
+namespace Titanic {
+
+CPetInventoryGlyphs::CPetInventoryGlyphs() : _field10(0), _field14(7),
+	_field18(-1), _field1C(-1), _field20(0), _field24(0) {
+}
+
+void CPetInventoryGlyphs::proc8() {
+	error("TODO");
+}
+
+void CPetInventoryGlyphs::setup() {
+	warning("TODO: CPetInventoryGlyphs::setup");
+}
+
+void CPetInventoryGlyphs::proc10() {
+	error("TODO");
+}
+
+void CPetInventoryGlyphs::proc11() {
+	error("TODO");
+}
+
+void CPetInventoryGlyphs::draw(CScreenManager *screenManager) {
+	warning("TODO: CPetInventoryGlyphs::draw");
+}
+
+void CPetInventoryGlyphs::addItem(CPetCarry *item) {
+
+
+	warning("TODO");
+}
+
+void CPetInventoryGlyphs::clear() {
+	fn1(-1);
+	destroyContents();
+	_field10 = 0;
+}
+
+void CPetInventoryGlyphs::fn1(int val) {
+	warning("TODO: CPetInventoryGlyphs::fn1");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h
new file mode 100644
index 0000000..f8d4d7f
--- /dev/null
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.h
@@ -0,0 +1,97 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_INVENTORY_GLYPHS_H
+#define TITANIC_PET_INVENTORY_GLYPHS_H
+
+#include "titanic/pet_control/pet_glyphs.h"
+#include "titanic/support/screen_manager.h"
+
+namespace Titanic {
+
+class CPetInventoryGlyph : public CPetGlyph {
+public:
+	CCarry *_item;
+	int _field34;
+	int _field38;
+	int _field3C;
+	int _field40;
+public:
+	CPetInventoryGlyph(CCarry *item, int val) : _item(item),
+		_field34(val), _field38(0), _field3C(0), _field40(0) {}
+};
+
+class CPetCarry {
+public:
+	int _val;
+	CCarry *_item;
+public:
+	CPetCarry(CCarry *item, int val) : _item(item), _val(val) {}
+};
+
+class CPetInventoryGlyphs : public CPetGlyphs<CPetInventoryGlyph> {
+private:
+	void fn1(int val);
+protected:
+	int _field10;
+	int _field14;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+	CPetGfxElement _selection;
+	CPetGfxElement _scrollLeft;
+	CPetGfxElement _scrollRight;
+public:
+	CPetInventoryGlyphs();
+
+	virtual void proc8();
+
+	/**
+	 * Set up the control
+	 */
+	virtual void setup();
+
+	virtual void proc10();
+	virtual void proc11();
+
+	void set20(int val) { _field20 = val; }
+
+	/**
+	 * Draw the control
+	 */
+	void draw(CScreenManager *screenManager);
+
+	/**
+	 * Add a new item to the list
+	 */
+	void addItem(CPetCarry *item);
+
+	/**
+	 * Clears the glyph list
+	 */
+	void clear();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_INVENTORY_GLYPHS_H */
diff --git a/engines/titanic/pet_control/pet_remote.h b/engines/titanic/pet_control/pet_remote.h
index 410a5ff..953f012 100644
--- a/engines/titanic/pet_control/pet_remote.h
+++ b/engines/titanic/pet_control/pet_remote.h
@@ -24,15 +24,18 @@
 #define TITANIC_PET_REMOTE_H
 
 #include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_glyphs.h"
 #include "titanic/pet_control/pet_control_sub12.h"
 #include "titanic/pet_control/pet_gfx_element.h"
 
 namespace Titanic {
 
+class CPetRemoteGlyphs : public CPetGlyphs<CPetGlyph> {
+};
+
 class CPetRemote : public CPetSection {
 private:
-	CPetControlSub10 _sub10;
+	CPetRemoteGlyphs _items;
 	CPetGfxElement _val1;
 	CPetGfxElement _val2;
 	CPetGfxElement _val3;
diff --git a/engines/titanic/pet_control/pet_saves.h b/engines/titanic/pet_control/pet_saves.h
index f11eef6..d100e8f 100644
--- a/engines/titanic/pet_control/pet_saves.h
+++ b/engines/titanic/pet_control/pet_saves.h
@@ -24,15 +24,18 @@
 #define TITANIC_PET_SAVES_H
 
 #include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub10.h"
+#include "titanic/pet_control/pet_glyphs.h"
 #include "titanic/pet_control/pet_control_sub12.h"
 
 namespace Titanic {
 
+class CPetSaveGlyphs : public CPetGlyphs<CPetGlyph> {
+};
+
 class CPetSaves : public CPetSection {
 private:
-	CPetControlSub10 _sub10;
-	CPetControlSub10 _sub12;
+	CPetSaveGlyphs _sub10;
+	CPetSaveGlyphs _sub12;
 public:
 	/**
 	 * Returns true if the object is in a valid state


Commit: 066dd4f5cd1b0f5408cd0da5ef9050a738edc4b0
    https://github.com/scummvm/scummvm/commit/066dd4f5cd1b0f5408cd0da5ef9050a738edc4b0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:17-04:00

Commit Message:
TITANIC: Implementing PET inventory population

Changed paths:
  A engines/titanic/pet_control/pet_glyphs.cpp
  A engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/pet_control/pet_control_sub11.h
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory_glyphs.cpp
    engines/titanic/pet_control/pet_inventory_glyphs.h
    engines/titanic/pet_control/pet_remote.h
    engines/titanic/pet_control/pet_saves.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 7549797..d2af519 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -442,9 +442,9 @@ bool CGameObject::hasActiveMovie() const {
 	return false;
 }
 
-int CGameObject::getMovie19() const {
+int CGameObject::getMovieFrame() const {
 	if (_surface && _surface->_movie)
-		return _surface->_movie->proc19();
+		return _surface->_movie->getFrame();
 	return _initialFrame;
 }
 
@@ -718,6 +718,7 @@ bool CGameObject::changeView(const CString &viewName, const CString &clipName) {
 	}
 
 	gameManager->_gameState.changeView(newView, clip);
+	return true;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 430f705..b987606 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -274,7 +274,11 @@ public:
 	 */
 	bool hasActiveMovie() const;
 
-	int getMovie19() const;
+	/**
+	 * Get the current movie frame
+	 */
+	int getMovieFrame() const;
+	
 	int getSurface45() const;
 	void sound8(bool flag) const;
 
@@ -311,7 +315,12 @@ public:
 	/**
 	 * Moves the item from it's original position to be under the hidden room
 	 */
-	void moveToHiddenRoom();	
+	void moveToHiddenRoom();
+
+	/**
+	 * Returns the object's frame number
+	 */
+	int getFrameNumber() const { return _frameNumber; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub11.h b/engines/titanic/pet_control/pet_control_sub11.h
index e3f8c3d..eeeb8bf 100644
--- a/engines/titanic/pet_control/pet_control_sub11.h
+++ b/engines/titanic/pet_control/pet_control_sub11.h
@@ -27,7 +27,7 @@
 
 namespace Titanic {
 
-class CPetControlSub11 : public CPetGlyphs<CPetGlyph> {
+class CPetControlSub11 : public CPetGlyphs {
 public:
 };
 
diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index 625415f..48c853c 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -87,9 +87,9 @@ void CPetElement::loadFrame(int frameNumber) {
 		gameObject->loadFrame(frameNumber);
 }
 
-int CPetElement::proc15() {
+int CPetElement::getFrame() {
 	CGameObject *gameObject = getObject();
-	return gameObject ? gameObject->getMovie19() : 0;
+	return gameObject ? gameObject->getMovieFrame() : 0;
 }
 
 void CPetElement::setMode(PetElementMode newMode) {
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index de9f552..d4ca580 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -104,7 +104,10 @@ public:
 	 */
 	virtual void loadFrame(int frameNumber);
 
-	virtual int proc15();
+	/**
+	 * Get the current frame
+	 */
+	virtual int getFrame();
 
 	/**
 	 * Get the game object associated with this item
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
new file mode 100644
index 0000000..057025c
--- /dev/null
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -0,0 +1,82 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_glyphs.h"
+
+namespace Titanic {
+
+void CPetGlyph::setOwner(CPetControl *petControl, CPetGlyphs *owner) {
+	_element.setBounds(Rect(0, 0, 52, 50));
+	_owner = owner;
+}
+
+void CPetGlyph::translateDraw(CScreenManager *screenManager, int deltaX, int deltaY) {
+	_element.translate(deltaX, deltaY);
+	_element.draw(screenManager);
+	_element.translate(-deltaX, -deltaY);
+}
+
+void CPetGlyph::proc14() {
+	warning("TODO: CPetGlyph::proc14");
+}
+
+bool CPetGlyph::translateContains(const Point &delta, const Point &pt) {
+	translate(delta);
+	bool result = _element.contains2(pt);
+	translateBack(delta);
+
+	return result;
+}
+
+/*------------------------------------------------------------------------*/
+
+void CPetGlyphs::clear() {
+	fn1(-1);
+	destroyContents();
+	_field10 = 0;
+}
+
+void CPetGlyphs::proc8() {
+	error("TODO");
+}
+
+void CPetGlyphs::setup() {
+	warning("TODO: CPetGlyphs::setup");
+}
+
+void CPetGlyphs::proc10() {
+	error("TODO");
+}
+
+void CPetGlyphs::proc11() {
+	error("TODO");
+}
+
+void CPetGlyphs::draw(CScreenManager *screenManager) {
+	warning("TODO: CPetGlyphs::draw");
+}
+
+void CPetGlyphs::fn1(int val) {
+	warning("TODO: CPetGlyphs::fn1");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
new file mode 100644
index 0000000..796b165
--- /dev/null
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -0,0 +1,152 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_GLYPHS_H
+#define TITANIC_PET_GLYPHS_H
+
+#include "titanic/core/list.h"
+#include "titanic/pet_control/pet_gfx_element.h"
+#include "titanic/support/rect.h"
+
+namespace Titanic {
+
+class CPetGlyphs;
+
+class CPetGlyph : public ListItem {
+public:
+	CPetGfxElement _element;
+	CPetGlyphs *_owner;
+public:
+	CPetGlyph() : ListItem(), _owner(nullptr) {}
+
+	/**
+	 * Translate the glyph's position
+	 */
+	void translate(const Point &pt) { _element.translate(pt.x, pt.y); }
+
+	/**
+	 * Translate the glyph's position back
+	 */
+	void translateBack(const Point &pt) { _element.translate(-pt.x, -pt.y); }
+
+	/**
+	 * Set the glyph
+	 */
+	virtual void setOwner(CPetControl *petControl, CPetGlyphs *owner);
+
+	virtual int proc9() { return 0; }
+
+	virtual void proc10() {}
+	virtual void proc11() {}
+
+	/**
+	 * Draw the glyph at a translated position without permanently
+	 * changing the position
+	 */
+	virtual void translateDraw(CScreenManager *screenManager, int deltaX, int deltaY);
+
+	virtual void proc13() {}
+
+	virtual void proc14();
+
+	/**
+	 * Get the bounds for the glyph
+	 */
+	virtual Rect getBounds() { return Rect(); }
+
+	virtual int proc16() { return 0; }
+	virtual int proc17() { return 0; }
+	virtual int proc18() { return 0; }
+	virtual int proc19() { return 0; }
+	virtual int proc20() { return 0; }
+	virtual int proc21() { return 0; }
+	virtual int proc22() { return 0; }
+	virtual int proc23() { return 0; }
+	virtual int proc24() { return 0; }
+	virtual void proc25() {}
+	virtual void proc26() {}
+	virtual void proc27() {}
+	virtual void proc28() {}
+	virtual int proc29() { return 0; }
+
+	/**
+	 * Returns true if the glyph's bounds, shifted by a given delta,
+	 * will contain the specified point
+	 */
+	virtual bool translateContains(const Point &delta, const Point &pt);
+
+	virtual void proc31() {}
+	virtual void proc32() {}
+
+	virtual int proc33() { return 1; }
+	virtual int proc34() { return 1; }
+	virtual int proc35() { return 0; }
+	virtual void proc36() {}
+	virtual int proc37() { return 0; }
+	virtual int proc38() { return 1; }
+};
+		
+class CPetGlyphs : public List<CPetGlyph> {
+protected:
+	int _field10;
+	int _field14;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+	CPetGfxElement _selection;
+	CPetGfxElement _scrollLeft;
+	CPetGfxElement _scrollRight;
+protected:
+	void fn1(int val);
+public:
+	CPetGlyphs::CPetGlyphs() : _field10(0), _field14(7),
+		_field18(-1), _field1C(-1), _field20(0), _field24(0) {
+	}
+
+	/**
+	 * Clears the glyph list
+	 */
+	void clear();
+
+
+	virtual void proc8();
+
+	/**
+	 * Set up the control
+	 */
+	virtual void setup();
+
+	virtual void proc10();
+	virtual void proc11();
+
+	void set20(int val) { _field20 = val; }
+
+	/**
+	 * Draw the control
+	 */
+	void draw(CScreenManager *screenManager);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_GLYPHS_H */
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 89eb692..f143e24 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/pet_control/pet_inventory.h"
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/carry/carry.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
@@ -121,9 +122,15 @@ void CPetInventory::fn3(CCarry *item) {
 void CPetInventory::itemsChanged() {
 	_items.clear();
 
-	//CGameObject *item = static_cast<CGameObject *>(_petControl->getFirstObject());
-
+	CGameObject *item = _petControl->getFirstObject();
+	while (item) {
+		CPetInventoryGlyph *glyph = new CPetInventoryGlyph();
+		glyph->setOwner(_petControl, &_items);
+		glyph->setItem(item, _field290);
 
+		_items.push_back(glyph);
+		item = _petControl->getNextObject(item);
+	}
 }
 
 void CPetInventory::couldntShowInventory(CCarry *item) {
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
index 6fc58ff..2614306 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
@@ -22,47 +22,117 @@
 
 #include "common/textconsole.h"
 #include "titanic/pet_control/pet_inventory_glyphs.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
-CPetInventoryGlyphs::CPetInventoryGlyphs() : _field10(0), _field14(7),
-	_field18(-1), _field1C(-1), _field20(0), _field24(0) {
-}
+const uint ITEM_MODES[40] = {
+	0, 2, 11, 10, 12, 13, 9, 40, 7, 6,
+	4, 5, 8, 15, 19, 24, 25, 26, 30, 20,
+	21, 22, 23, 36, 39, 39, 31, 31, 32, 32,
+	33, 34, 35, 38, 41, 42, 43, 44, 45, 37
+};
 
-void CPetInventoryGlyphs::proc8() {
-	error("TODO");
-}
+void CPetInventoryGlyph::setItem(CGameObject *item, int val) {
+	_item = item;
 
-void CPetInventoryGlyphs::setup() {
-	warning("TODO: CPetInventoryGlyphs::setup");
+	if (_owner && item) {
+		int v1 = populateItem(item, val);
+		_field3C = static_cast<CPetInventoryGlyphs *>(_owner)->fn1(v1);
+		warning("TODO: CPetInventoryGlyph::setItem");
+	}
 }
 
-void CPetInventoryGlyphs::proc10() {
-	error("TODO");
-}
+int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
+	// Scan the master item names list
+	CString itemName = item->getName();
+	int itemIndex = -1;
+	for (int idx = 0; idx < 40 && itemIndex == -1; ++idx) {
+		if (itemName == g_vm->_itemIds[idx])
+			itemIndex = idx;
+	}
+	if (itemIndex == -1)
+		return -1;
 
-void CPetInventoryGlyphs::proc11() {
-	error("TODO");
-}
+	switch (ITEM_MODES[itemIndex]) {
+	case 0:
+		switch (subMode(item, val)) {
+		case 0:
+		case 1:
+			return 0;
+		case 2:
+		case 3:
+			return 1;
+		default:
+			return 0;
+		}
+
+	case 2:
+		switch (subMode(item, val)) {
+		case 0:
+			return 2;
+		default:
+			return 3;
+		}
+		break;
+
+	case 15:
+		switch (subMode(item, val)) {
+		case 0:
+		case 1:
+			return 14;
+		case 2:
+			return 16;
+		case 3:
+			return 15;
+		case 4:
+			return 17;
+		case 5:
+			return 18;
+		default:
+			return 15;
+		}
+		break;
 
-void CPetInventoryGlyphs::draw(CScreenManager *screenManager) {
-	warning("TODO: CPetInventoryGlyphs::draw");
+	case 26:
+		switch (subMode(item, val)) {
+		case 0:
+			return 26;
+		case 1:
+			return 29;
+		case 2:
+			return 28;
+		case 3:
+			return 27;
+		default:
+			return 26;
+		}
+		break;
+
+	default:
+		return ITEM_MODES[itemIndex];
+	}
 }
 
-void CPetInventoryGlyphs::addItem(CPetCarry *item) {
+int CPetInventoryGlyph::subMode(CGameObject *item, int val) {
+	int frameNum = item->getFrameNumber();
+	int movieFrame = item->getMovieFrame();
 
+	if (val && frameNum != -1 && frameNum != movieFrame)
+		item->loadFrame(frameNum);
 
-	warning("TODO");
+	return frameNum;
 }
 
-void CPetInventoryGlyphs::clear() {
-	fn1(-1);
-	destroyContents();
-	_field10 = 0;
+/*------------------------------------------------------------------------*/
+
+void CPetInventoryGlyphs::addItem(CPetCarry *item) {
+
 }
 
-void CPetInventoryGlyphs::fn1(int val) {
+int CPetInventoryGlyphs::fn1(int val) {
 	warning("TODO: CPetInventoryGlyphs::fn1");
+	return 0;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h
index f8d4d7f..8c483ea 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.h
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.h
@@ -23,21 +23,35 @@
 #ifndef TITANIC_PET_INVENTORY_GLYPHS_H
 #define TITANIC_PET_INVENTORY_GLYPHS_H
 
+#include "titanic/carry/carry.h"
 #include "titanic/pet_control/pet_glyphs.h"
 #include "titanic/support/screen_manager.h"
 
 namespace Titanic {
 
 class CPetInventoryGlyph : public CPetGlyph {
+private:
+	/**
+	 * Populate the details for an item
+	 */
+	int populateItem(CGameObject *item, int val);
+
+	int subMode(CGameObject *item, int val);
 public:
-	CCarry *_item;
+	CGameObject *_item;
 	int _field34;
-	int _field38;
 	int _field3C;
 	int _field40;
 public:
+	CPetInventoryGlyph() : _item(nullptr), _field34(0), 
+		_field3C(0), _field40(0) {}
 	CPetInventoryGlyph(CCarry *item, int val) : _item(item),
-		_field34(val), _field38(0), _field3C(0), _field40(0) {}
+		_field34(val), _field3C(0), _field40(0) {}
+
+	/**
+	 * Set the inventory item
+	 */
+	void setItem(CGameObject *item, int val);
 };
 
 class CPetCarry {
@@ -48,48 +62,15 @@ public:
 	CPetCarry(CCarry *item, int val) : _item(item), _val(val) {}
 };
 
-class CPetInventoryGlyphs : public CPetGlyphs<CPetInventoryGlyph> {
+class CPetInventoryGlyphs : public CPetGlyphs {
+	friend class CPetInventoryGlyph;
 private:
-	void fn1(int val);
-protected:
-	int _field10;
-	int _field14;
-	int _field18;
-	int _field1C;
-	int _field20;
-	int _field24;
-	CPetGfxElement _selection;
-	CPetGfxElement _scrollLeft;
-	CPetGfxElement _scrollRight;
+	int fn1(int val);
 public:
-	CPetInventoryGlyphs();
-
-	virtual void proc8();
-
-	/**
-	 * Set up the control
-	 */
-	virtual void setup();
-
-	virtual void proc10();
-	virtual void proc11();
-
-	void set20(int val) { _field20 = val; }
-
-	/**
-	 * Draw the control
-	 */
-	void draw(CScreenManager *screenManager);
-
 	/**
 	 * Add a new item to the list
 	 */
 	void addItem(CPetCarry *item);
-
-	/**
-	 * Clears the glyph list
-	 */
-	void clear();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote.h b/engines/titanic/pet_control/pet_remote.h
index 953f012..85cff3f 100644
--- a/engines/titanic/pet_control/pet_remote.h
+++ b/engines/titanic/pet_control/pet_remote.h
@@ -30,7 +30,7 @@
 
 namespace Titanic {
 
-class CPetRemoteGlyphs : public CPetGlyphs<CPetGlyph> {
+class CPetRemoteGlyphs : public CPetGlyphs {
 };
 
 class CPetRemote : public CPetSection {
diff --git a/engines/titanic/pet_control/pet_saves.h b/engines/titanic/pet_control/pet_saves.h
index d100e8f..8366ab6 100644
--- a/engines/titanic/pet_control/pet_saves.h
+++ b/engines/titanic/pet_control/pet_saves.h
@@ -29,7 +29,7 @@
 
 namespace Titanic {
 
-class CPetSaveGlyphs : public CPetGlyphs<CPetGlyph> {
+class CPetSaveGlyphs : public CPetGlyphs {
 };
 
 class CPetSaves : public CPetSection {
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 6f66bec..3ae2636 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -121,9 +121,9 @@ void OSMovie::proc18() {
 	warning("TODO: OSMovie::proc18");
 }
 
-int OSMovie::proc19() {
-	warning("TODO: OSMovie::proc19");
-	return 0;
+int OSMovie::getFrame() {
+	assert(_video);
+	return _video->getCurFrame();
 }
 
 void OSMovie::proc20() {
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index a871af6..644f582 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -73,7 +73,12 @@ public:
 	virtual void proc16() = 0;
 	virtual void proc17() = 0;
 	virtual void proc18() = 0;
-	virtual int proc19() = 0;
+
+	/**
+	 * Get the current movie frame
+	 */
+	virtual int getFrame() = 0;
+	
 	virtual void proc20() = 0;
 	virtual void *proc21() = 0;
 
@@ -131,7 +136,12 @@ public:
 	virtual void proc16();
 	virtual void proc17();
 	virtual void proc18();
-	virtual int proc19();
+
+	/**
+	 * Get the current movie frame
+	 */
+	virtual int getFrame();
+
 	virtual void proc20();
 	virtual void *proc21();
 
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 8e079d5..3660ce1 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -157,8 +157,8 @@ void TitanicEngine::setItemNames() {
 	for (uint idx = 0; idx < TOTAL_ITEMS; ++idx)
 		_itemDescriptions[idx] = DESCRIPTIONS[idx];
 
-	// Short descriptions.. maybe?
-	static const char *const SHORT_DESC[40] = {
+	// Item identifiers
+	static const char *const ITEM_IDS[40] = {
 		"MaitreD Left Arm", "MaitreD Right Arm", "OlfactoryCentre", "AuditoryCentre",
 		"SpeechCentre", "VisionCentre", "CentralCore", "Perch", "SeasonBridge",
 		"FanBridge", "BeamBridge", "ChickenBridge", "CarryParrot", "Chicken",
@@ -169,7 +169,7 @@ void TitanicEngine::setItemNames() {
 		"Phonograph Cylinder 3", "Photograph", "Music System Key"
 	};
 	for (uint idx = 0; idx < 40; ++idx)
-		_itemShortDesc[idx] = SHORT_DESC[idx];
+		_itemIds[idx] = ITEM_IDS[idx];
 }
 
 
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index f83e728..f639a9c 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -114,7 +114,7 @@ public:
 	CString _itemNames[TOTAL_ITEMS];
 	CString _itemDescriptions[TOTAL_ITEMS];
 	CString _itemObjects[TOTAL_ITEMS];
-	CString _itemShortDesc[40];
+	CString _itemIds[40];
 public:
 	TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
 	virtual ~TitanicEngine();


Commit: d971edf02ea8074b71be852fdcee48e095ff49a9
    https://github.com/scummvm/scummvm/commit/d971edf02ea8074b71be852fdcee48e095ff49a9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:18-04:00

Commit Message:
TITANIC: Stubs for selecting highlighted PET glyph

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index b9f1359..25ab972 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -371,8 +371,8 @@ void CPetControl::addToInventory(CCarry *item) {
 	_inventory.itemsChanged();
 
 	setArea(PET_INVENTORY);
-	if (_currentArea != PET_INVENTORY)
-		_inventory.couldntShowInventory(item);
+	if (_currentArea == PET_INVENTORY)
+		_inventory.highlightItem(item);
 	
 	makeDirty();
 	CPETGainedObjectMsg msg;
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 057025c..41ac4ae 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -50,7 +50,7 @@ bool CPetGlyph::translateContains(const Point &delta, const Point &pt) {
 /*------------------------------------------------------------------------*/
 
 void CPetGlyphs::clear() {
-	fn1(-1);
+	changeHighlight(-1);
 	destroyContents();
 	_field10 = 0;
 }
@@ -75,8 +75,12 @@ void CPetGlyphs::draw(CScreenManager *screenManager) {
 	warning("TODO: CPetGlyphs::draw");
 }
 
-void CPetGlyphs::fn1(int val) {
-	warning("TODO: CPetGlyphs::fn1");
+void CPetGlyphs::changeHighlight(int index) {
+	warning("TODO: CPetGlyphs::changeHighlight");
+}
+
+void CPetGlyphs::highlight(int index) {
+	warning("TODO: CPetGlyphs::highlight");
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 796b165..a342766 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -117,7 +117,10 @@ protected:
 	CPetGfxElement _scrollLeft;
 	CPetGfxElement _scrollRight;
 protected:
-	void fn1(int val);
+	/**
+	 * Change the currently selected glyph
+	 */
+	void changeHighlight(int index);
 public:
 	CPetGlyphs::CPetGlyphs() : _field10(0), _field14(7),
 		_field18(-1), _field1C(-1), _field20(0), _field24(0) {
@@ -145,6 +148,11 @@ public:
 	 * Draw the control
 	 */
 	void draw(CScreenManager *screenManager);
+
+	/**
+	 * Highlight a specific glyph
+	 */
+	void highlight(int index);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index f143e24..e765db6 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -133,8 +133,19 @@ void CPetInventory::itemsChanged() {
 	}
 }
 
-void CPetInventory::couldntShowInventory(CCarry *item) {
+void CPetInventory::highlightItem(CGameObject *item) {
+	int itemIndex = getItemIndex(item);
+	_items.highlight(itemIndex);
+}
+
+int CPetInventory::getItemIndex(CGameObject *item) const {
+	int index = 0;
+	for (CGameObject *obj = _petControl->getFirstObject(); obj && obj != item;
+			++index, obj = _petControl->getNextObject(obj)) {
+	}
 
+	return index;
 }
 
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 4a08c1c..f228840 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -48,6 +48,11 @@ private:
 	 * Handles initial setup
 	 */
 	bool setPetControl(CPetControl *petControl);
+
+	/**
+	 * Get the index of an item added to the PET
+	 */
+	int getItemIndex(CGameObject *item) const;
 public:
 	CPetInventory();
 
@@ -111,7 +116,7 @@ public:
 	/**
 	 * Called when the inventory can't be shown after adding an item
 	 */
-	void couldntShowInventory(CCarry *item);
+	void highlightItem(CGameObject *item);
 };
 
 } // End of namespace Titanic


Commit: 22248ccbf20535d9c14da2e376ae7ff3c9b4081b
    https://github.com/scummvm/scummvm/commit/22248ccbf20535d9c14da2e376ae7ff3c9b4081b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:19-04:00

Commit Message:
TITANIC: Implement glyphs drawing

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 41ac4ae..fc3fcc5 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -29,10 +29,10 @@ void CPetGlyph::setOwner(CPetControl *petControl, CPetGlyphs *owner) {
 	_owner = owner;
 }
 
-void CPetGlyph::translateDraw(CScreenManager *screenManager, int deltaX, int deltaY) {
-	_element.translate(deltaX, deltaY);
+void CPetGlyph::drawAt(CScreenManager *screenManager, int x, int y) {
+	_element.translate(x, y);
 	_element.draw(screenManager);
-	_element.translate(-deltaX, -deltaY);
+	_element.translate(-x, -y);
 }
 
 void CPetGlyph::proc14() {
@@ -49,10 +49,14 @@ bool CPetGlyph::translateContains(const Point &delta, const Point &pt) {
 
 /*------------------------------------------------------------------------*/
 
+CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0),  _numVisibleGlyphs(7),
+		_highlightIndex(-1), _field1C(-1), _field20(0), _field24(0) {
+}
+
 void CPetGlyphs::clear() {
 	changeHighlight(-1);
 	destroyContents();
-	_field10 = 0;
+	_firstVisibleIndex = 0;
 }
 
 void CPetGlyphs::proc8() {
@@ -72,7 +76,51 @@ void CPetGlyphs::proc11() {
 }
 
 void CPetGlyphs::draw(CScreenManager *screenManager) {
-	warning("TODO: CPetGlyphs::draw");
+	if (_highlightIndex != -1) {
+		int index = getHighlightedIndex(_highlightIndex);
+		if (index != -1) {
+			Point tempPoint;
+			Point pt = getPosition(index);
+			pt -= Point(12, 13);
+			_selection.translate(pt.x, pt.y);
+			_selection.draw(screenManager);
+			_selection.translate(-pt.x, -pt.y);
+		}
+	}
+
+	// Iterate through displaying glyphs on the screen 
+	int listSize = size();
+	for (int index = 0; index < _numVisibleGlyphs; ++index) {
+		int itemIndex = getItemIndex(index);
+
+		if (itemIndex >= 0 && itemIndex < listSize) {
+			Point pt = getPosition(itemIndex);
+			CPetGlyph *glyph = getGlyph(itemIndex);
+
+			if (glyph) {
+				// TODO: Comparison with highlighted index, and a redundant push?
+				glyph->drawAt(screenManager, pt.x, pt.y);
+			}
+		}
+	}
+
+	// Draw scrolling arrows if more than a screen's worth of items are showing
+	if (listSize > _numVisibleGlyphs || _field20 != 16) {
+		_scrollLeft.draw(screenManager);
+		_scrollRight.draw(screenManager);
+	}
+
+	// Handle secondary highlight
+	if (_highlightIndex != -1) {
+		CPetGlyph *glyph = getGlyph(_highlightIndex);
+		if (glyph)
+			glyph->drawHighlight();
+	}
+}
+
+Point CPetGlyphs::getPosition(int index) {
+	Point tempPoint(37 + index * 58, 375);
+	return tempPoint;
 }
 
 void CPetGlyphs::changeHighlight(int index) {
@@ -83,4 +131,22 @@ void CPetGlyphs::highlight(int index) {
 	warning("TODO: CPetGlyphs::highlight");
 }
 
+int CPetGlyphs::getHighlightedIndex(int index) {
+	int idx = index - _firstVisibleIndex;
+	return (idx >= 0 && idx < _numVisibleGlyphs) ? idx : -1;
+}
+
+int CPetGlyphs::getItemIndex(int index) {
+	return _firstVisibleIndex + index;
+}
+
+CPetGlyph *CPetGlyphs::getGlyph(int index) {
+	for (iterator i = begin(); i != end(); ++i) {
+		if (index-- == 0)
+			return *i;
+	}
+
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index a342766..6160c45 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -62,9 +62,12 @@ public:
 	 * Draw the glyph at a translated position without permanently
 	 * changing the position
 	 */
-	virtual void translateDraw(CScreenManager *screenManager, int deltaX, int deltaY);
+	virtual void drawAt(CScreenManager *screenManager, int x, int y);
 
-	virtual void proc13() {}
+	/**
+	 * Handles any secondary drawing of a glyph as highlighted
+	 */
+	virtual void drawHighlight() {}
 
 	virtual void proc14();
 
@@ -106,10 +109,31 @@ public:
 };
 		
 class CPetGlyphs : public List<CPetGlyph> {
+private:
+	/**
+	 * Get a position for the glyph
+	 */
+	Point getPosition(int index);
+
+	/**
+	 * Returns the on-screen index for the highlight to be shown at
+	 */
+	int getHighlightedIndex(int index);
+
+	/**
+	 * Returns the index of a glyph given the visible on-screen glyph number
+	 */
+	int getItemIndex(int index);
+
+	/**
+	 * Return a specified glyph
+	 */
+	CPetGlyph *getGlyph(int index);
 protected:
-	int _field10;
-	int _field14;
-	int _field18;
+	int _firstVisibleIndex;
+	int _totalGlyphs;
+	int _numVisibleGlyphs;
+	int _highlightIndex;
 	int _field1C;
 	int _field20;
 	int _field24;
@@ -122,9 +146,7 @@ protected:
 	 */
 	void changeHighlight(int index);
 public:
-	CPetGlyphs::CPetGlyphs() : _field10(0), _field14(7),
-		_field18(-1), _field1C(-1), _field20(0), _field24(0) {
-	}
+	CPetGlyphs();
 
 	/**
 	 * Clears the glyph list


Commit: a11e677494d7cb3c6b8ed2c56095873d46a00ab8
    https://github.com/scummvm/scummvm/commit/a11e677494d7cb3c6b8ed2c56095873d46a00ab8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:20-04:00

Commit Message:
TITANIC: Added item debugger command

Changed paths:
    engines/titanic/debugger.cpp
    engines/titanic/debugger.h



diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp
index 84f961e..f525f4f 100644
--- a/engines/titanic/debugger.cpp
+++ b/engines/titanic/debugger.cpp
@@ -23,6 +23,7 @@
 #include "titanic/debugger.h"
 #include "titanic/titanic.h"
 #include "titanic/core/tree_item.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -31,6 +32,7 @@ Debugger::Debugger(TitanicEngine *vm) : GUI::Debugger(), _vm(vm) {
 	registerCmd("dump",			WRAP_METHOD(Debugger, cmdDump));
 	registerCmd("room",			WRAP_METHOD(Debugger, cmdRoom));
 	registerCmd("pet",			WRAP_METHOD(Debugger, cmdPET));
+	registerCmd("item",			WRAP_METHOD(Debugger, cmdItem));
 }
 
 int Debugger::strToInt(const char *s) {
@@ -207,4 +209,50 @@ bool Debugger::cmdPET(int argc, const char **argv) {
 	return true;
 }
 
+bool Debugger::cmdItem(int argc, const char **argv) {
+	if (argc == 1) {
+		// No parameters, so list the available items
+		debugPrintf("item [<name> [ add ]]\n");
+		for (int idx = 0; idx < 40; ++idx)
+			debugPrintf("%s\n", g_vm->_itemIds[idx].c_str());
+	} else {
+		// Ensure the specified name is a valid inventory item
+		int itemIndex;
+		for (itemIndex = 0; itemIndex < 40; ++itemIndex) {
+			if (g_vm->_itemIds[itemIndex] == argv[1])
+				break;
+		}
+		if (itemIndex == 40) {
+			debugPrintf("Could not find item with that name\n");
+			return true;
+		}
+
+		// Get the item
+		CCarry *item = static_cast<CCarry *>(
+			g_vm->_window->_project->findByName(argv[1]));
+		assert(item);
+
+		if (argc == 2) {
+			// List it's details
+			CTreeItem *treeItem = item;
+			CString fullName;
+			while ((treeItem = treeItem->getParent()) != nullptr) {
+				if (!treeItem->getName().empty())
+					fullName = treeItem->getName() + "." + fullName;
+			}
+
+			debugPrintf("Current location: %s\n", fullName.c_str());
+		} else if (CString(argv[2]) == "add") {
+			CPetControl *pet = item->getPetControl();
+			pet->_visible = true;
+			item->addToInventory();
+			return false;
+		} else {
+			debugPrintf("Unknown command\n");
+		}
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/debugger.h b/engines/titanic/debugger.h
index 29e82d6..5edb7cb 100644
--- a/engines/titanic/debugger.h
+++ b/engines/titanic/debugger.h
@@ -84,6 +84,11 @@ private:
 	 * Turn the PET on or off
 	 */
 	bool cmdPET(int argc, const char **argv);
+
+	/**
+	 * Item handling
+	 */
+	bool cmdItem(int argc, const char **argv);
 protected:
 	TitanicEngine *_vm;
 public:


Commit: 46a30255b0e5a7f5dad4fd032388d31a69208b62
    https://github.com/scummvm/scummvm/commit/46a30255b0e5a7f5dad4fd032388d31a69208b62
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:21-04:00

Commit Message:
TITANIC: Seperate PET classes setup and reset methods

Changed paths:
    engines/titanic/carry/arm.cpp
    engines/titanic/carry/carry.cpp
    engines/titanic/carry/carry.h
    engines/titanic/carry/chicken.cpp
    engines/titanic/core/tree_item.cpp
    engines/titanic/debugger.cpp
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_frame.cpp
    engines/titanic/pet_control/pet_frame.h
    engines/titanic/pet_control/pet_gfx_element.cpp
    engines/titanic/pet_control/pet_gfx_element.h
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_inventory_glyphs.cpp
    engines/titanic/pet_control/pet_inventory_glyphs.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/carry/arm.cpp b/engines/titanic/carry/arm.cpp
index c39812f..d662b43 100644
--- a/engines/titanic/carry/arm.cpp
+++ b/engines/titanic/carry/arm.cpp
@@ -172,7 +172,7 @@ bool CArm::MaitreDHappyMsg(CMaitreDHappyMsg *msg) {
 			_visibleFrame = _field170;
 			loadFrame(_visibleFrame);
 			_string6 = "None";
-			invFn3();
+			invChange();
 		}
 	}
 
diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index 31d0ff0..cb87b94 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -240,14 +240,16 @@ bool CCarry::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
 
 void CCarry::addToInventory() {
 	CPetControl *pet = getPetControl();
-	if (pet)
+	if (pet) {
+		makeDirty();
 		pet->addToInventory(this);
+	}
 }
 
-void CCarry::invFn3() {
+void CCarry::invChange() {
 	CPetControl *pet = getPetControl();
 	if (pet)
-		pet->invFn3(this);
+		pet->invChange(this);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index 2370556..ba782fd 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -65,7 +65,7 @@ protected:
 	/**
 	 *
 	 */
-	void invFn3();
+	void invChange();
 public:
 	CLASSDEF
 	CCarry();
diff --git a/engines/titanic/carry/chicken.cpp b/engines/titanic/carry/chicken.cpp
index 74b42aa..8483a3f 100644
--- a/engines/titanic/carry/chicken.cpp
+++ b/engines/titanic/carry/chicken.cpp
@@ -171,7 +171,7 @@ bool CChicken::TimerMsg(CTimerMsg *msg) {
 	}
 
 	if (flag) {
-		invFn3();
+		invChange();
 		stopTimer(_timerId);
 	}
 
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index abd6f6c..039d597 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -280,7 +280,7 @@ void CTreeItem::clearPet() const {
 }
 
 CPetControl *CTreeItem::getPetControl() const {
-	return dynamic_cast<CPetControl *>(getDontSaveChild(CPetControl::_type));
+	return static_cast<CPetControl *>(getDontSaveChild(CPetControl::_type));
 }
 
 CMailMan *CTreeItem::getMailMan() const {
diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp
index f525f4f..d643a87 100644
--- a/engines/titanic/debugger.cpp
+++ b/engines/titanic/debugger.cpp
@@ -244,6 +244,8 @@ bool Debugger::cmdItem(int argc, const char **argv) {
 			debugPrintf("Current location: %s\n", fullName.c_str());
 		} else if (CString(argv[2]) == "add") {
 			CPetControl *pet = item->getPetControl();
+			assert(pet);
+
 			pet->_visible = true;
 			item->addToInventory();
 			return false;
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 25ab972..31f95d1 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -45,6 +45,7 @@ CPetControl::CPetControl() : CGameObject(),
 		_currentArea(PET_CONVERSATION), _fieldC0(0), _locked(0), _fieldC8(0),
 		_treeItem1(nullptr), _treeItem2(nullptr), _hiddenRoom(nullptr),
 		_drawBounds(20, 350, 620, 480) {
+	setup();
 	_timers[0] = _timers[1] = nullptr;
 	_sections[PET_INVENTORY] = &_inventory;
 	_sections[PET_CONVERSATION] = &_conversations;
@@ -80,6 +81,17 @@ void CPetControl::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+void CPetControl::setup() {
+	warning("TODO: CPetControl::setup");
+	_rooms.setup(this);
+	_remote.setup(this);
+	_inventory.setup(this);
+	_sub5.setup(this);
+	_saves.setup(this);
+	_sub7.setup(this);
+	_frame.setup(this);
+}
+
 bool CPetControl::isValid() {
 	return _conversations.isValid(this) &&
 		_rooms.isValid(this) && 
@@ -399,8 +411,8 @@ void CPetControl::removeFromInventory(CCarry *item, bool refreshUI, bool sendMsg
 	removeFromInventory(item, view, refreshUI, sendMsg);
 }
 
-void CPetControl::invFn3(CCarry *item) {
-	_inventory.fn3(item);
+void CPetControl::invChange(CCarry *item) {
+	_inventory.change(item);
 }
 
 void CPetControl::moveToHiddenRoom(CTreeItem *item) {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 4192d9e..1e98e3f 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -125,6 +125,11 @@ public:
 	virtual Rect getBounds();
 
 	/**
+	 * Setups the sections within the PET
+	 */
+	void setup();
+
+	/**
 	 * Called after loading a game has finished
 	 */
 	void postLoad();
@@ -224,7 +229,10 @@ public:
 	 */
 	void removeFromInventory(CCarry *item, bool refreshUI = true, bool sendMsg = true);
 
-	void invFn3(CCarry *item);
+	/**
+	 * Called when the status of an item in the inventory has changed
+	 */
+	void invChange(CCarry *item);
 
 	/**
 	 * Moves a tree item from it's original position to be under the hidden room
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index d4ca580..a8f5000 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -50,10 +50,10 @@ public:
 		CPetControl *petControl) {}
 
 	/**
-	 * Sets up the element
+	 * Reset the element
 	 */
-	virtual void setup(int val, const CString &name, CPetControl *petControl) {}
-	
+	virtual void reset(const CString &name, CPetControl *petControl, PetElementMode mode) {}
+
 	/**
 	 * Draw the item
 	 */
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index 1859b0d..25d67fb 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -35,28 +35,28 @@ CPetFrame::CPetFrame() : CPetSection() {
 
 bool CPetFrame::setup(CPetControl *petControl) {
 	if (setPetControl(petControl))
-		return setup();
+		return reset();
 	return false;
 }
 
-bool CPetFrame::setup() {
+bool CPetFrame::reset() {
 	if (_petControl) {
-		_background.setup("PetBackground", _petControl, MODE_UNSELECTED);
-		_modeBackground.setup("PetModeBackground", _petControl, MODE_UNSELECTED);
+		_background.reset("PetBackground", _petControl, MODE_UNSELECTED);
+		_modeBackground.reset("PetModeBackground", _petControl, MODE_UNSELECTED);
 
 		for (int idx = 0; idx < 5; ++idx) {
 			CString resName = Common::String::format("PetMode%d", idx);
-			_modeButtons[idx].setup(resName, _petControl, MODE_UNSELECTED);
+			_modeButtons[idx].reset(resName, _petControl, MODE_UNSELECTED);
 		}
 
 		for (int idx = 0; idx < 6; ++idx) {
 			CString resName = Common::String::format("3Pettitle%d", idx);
-			_titles[idx].setup(resName, _petControl, MODE_UNSELECTED);
+			_titles[idx].reset(resName, _petControl, MODE_UNSELECTED);
 		}
 
 		for (int idx = 0; idx < 7; ++idx) {
 			CString resName = Common::String::format("PetIndent%d", idx);
-			_indent[idx].setup(resName, _petControl, MODE_UNSELECTED);
+			_indent[idx].reset(resName, _petControl, MODE_UNSELECTED);
 		}
 	}
 
@@ -87,7 +87,7 @@ bool CPetFrame::isValid(CPetControl *petControl) {
 }
 
 void CPetFrame::postLoad() {
-	setup();
+	reset();
 }
 
 bool CPetFrame::setPetControl(CPetControl *petControl) {
diff --git a/engines/titanic/pet_control/pet_frame.h b/engines/titanic/pet_control/pet_frame.h
index ec8bd1e..0bc872a 100644
--- a/engines/titanic/pet_control/pet_frame.h
+++ b/engines/titanic/pet_control/pet_frame.h
@@ -57,7 +57,7 @@ public:
 	/**
 	 * Sets up the section
 	 */
-	virtual bool setup();
+	virtual bool reset();
 	
 	/**
 	 * Handles mouse down messages
diff --git a/engines/titanic/pet_control/pet_gfx_element.cpp b/engines/titanic/pet_control/pet_gfx_element.cpp
index 7f249f0..fbe9e6d 100644
--- a/engines/titanic/pet_control/pet_gfx_element.cpp
+++ b/engines/titanic/pet_control/pet_gfx_element.cpp
@@ -44,7 +44,7 @@ void CPetGfxElement::setup(PetElementMode mode, const CString &name,
 	}
 }
 
-void CPetGfxElement::setup(const CString &name, CPetControl *petControl, PetElementMode mode) {
+void CPetGfxElement::reset(const CString &name, CPetControl *petControl, PetElementMode mode) {
 	if (!petControl)
 		return;
 
diff --git a/engines/titanic/pet_control/pet_gfx_element.h b/engines/titanic/pet_control/pet_gfx_element.h
index a4c39c6..bc9150e 100644
--- a/engines/titanic/pet_control/pet_gfx_element.h
+++ b/engines/titanic/pet_control/pet_gfx_element.h
@@ -43,9 +43,9 @@ public:
 		CPetControl *petControl);
 
 	/**
-	 * Setup the element
+	 * Reset the element
 	 */
-	virtual void setup(const CString &name, CPetControl *petControl, PetElementMode mode);
+	virtual void reset(const CString &name, CPetControl *petControl, PetElementMode mode);
 
 	/**
 	 * Draw the item
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index fc3fcc5..a9a15c5 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -53,18 +53,24 @@ CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0),  _numVisibleGlyphs(7),
 		_highlightIndex(-1), _field1C(-1), _field20(0), _field24(0) {
 }
 
+void CPetGlyphs::setNumVisible(int total) {
+	if (total > 0)
+		_numVisibleGlyphs = total;
+}
+
 void CPetGlyphs::clear() {
 	changeHighlight(-1);
 	destroyContents();
 	_firstVisibleIndex = 0;
 }
 
-void CPetGlyphs::proc8() {
+void CPetGlyphs::setup(int numVisible, CPetSection *owner) {
 	error("TODO");
 }
 
-void CPetGlyphs::setup() {
-	warning("TODO: CPetGlyphs::setup");
+void CPetGlyphs::reset() {
+
+	warning("TODO: CPetGlyphs::reset");
 }
 
 void CPetGlyphs::proc10() {
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 6160c45..fceca4d 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -30,6 +30,19 @@
 namespace Titanic {
 
 class CPetGlyphs;
+class CPetSection;
+
+enum GlyphActionMode { ACTION_REMOVE = 0, ACTION_REMOVED = 1, ACTION_CHANGE = 2 };
+
+class CGlyphAction {
+protected:
+	GlyphActionMode _mode;
+public:
+	CGlyphAction() : _mode(ACTION_REMOVED) {}
+	CGlyphAction(GlyphActionMode mode) : _mode(mode) {}
+
+	GlyphActionMode getMode() const { return _mode; }
+};
 
 class CPetGlyph : public ListItem {
 public:
@@ -105,7 +118,11 @@ public:
 	virtual int proc35() { return 0; }
 	virtual void proc36() {}
 	virtual int proc37() { return 0; }
-	virtual int proc38() { return 1; }
+
+	/**
+	 * Does a processing action on the glyph
+	 */
+	virtual bool doAction(CGlyphAction *action) { return true; }
 };
 		
 class CPetGlyphs : public List<CPetGlyph> {
@@ -149,17 +166,25 @@ public:
 	CPetGlyphs();
 
 	/**
+	 * Set the number of visible glyphs
+	 */
+	void setNumVisible(int total);
+
+	/**
 	 * Clears the glyph list
 	 */
 	void clear();
 
 
-	virtual void proc8();
+	/**
+	 * The visual dimensions for the control and it's components
+	 */
+	virtual void setup(int numVisible, CPetSection *owner);
 
 	/**
 	 * Set up the control
 	 */
-	virtual void setup();
+	virtual void reset();
 
 	virtual void proc10();
 	virtual void proc11();
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index e765db6..ff333ed 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -35,11 +35,11 @@ CPetInventory::CPetInventory() : CPetSection(),
 }
 
 bool CPetInventory::setup(CPetControl *petControl) {
-	return setPetControl(petControl) && setup();
+	return setPetControl(petControl) && reset();
 }
 
-bool CPetInventory::setup() {
-	_items.setup();
+bool CPetInventory::reset() {
+	_items.reset();
 	_sub12.setup();
 
 	// TODO
@@ -80,7 +80,7 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
 		return false;
 
 	_petControl = petControl;
-	_items.proc8();
+	_items.setup(7,  this);
 	_items.set20(28);
 
 	Rect tempRect(0, 0, 52, 52);
@@ -103,20 +103,18 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
 	return true;
 }
 
-void CPetInventory::addItem(CCarry *item) {
+void CPetInventory::change(CCarry *item) {
 	if (item) {
-		CPetCarry glyphItem(item, 2);
-
+		CInventoryGlyphAction action(item, ACTION_CHANGE);
+		_items.change(&action);
 	}
-	warning("TODO: CPetInventory::addItem");
 }
 
 void CPetInventory::itemRemoved(CCarry *item) {
-	warning("TODO: CPetInventory::itemRemoved");
-}
-
-void CPetInventory::fn3(CCarry *item) {
-	warning("TODO: CPetInventory::fn3");
+	if (item) {
+		CInventoryGlyphAction action(item, ACTION_REMOVED);
+		_items.change(&action);
+	}
 }
 
 void CPetInventory::itemsChanged() {
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index f228840..e192bf8 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -64,7 +64,7 @@ public:
 	/**
 	 * Sets up the section
 	 */
-	virtual bool setup();
+	virtual bool reset();
 
 	/**
 	 * Draw the section
@@ -97,17 +97,15 @@ public:
 	virtual bool isValid(CPetControl *petControl);
 
 	/**
-	 * Add an item to the inventory
+	 * 
 	 */
-	void addItem(CCarry *item);
+	void change(CCarry *item);
 
 	/**
 	 * Called when an item has been removed from the PET
 	 */
 	void itemRemoved(CCarry *item);
 
-	void fn3(CCarry *item);
-
 	/**
 	 * Called when the items under the PET have changed
 	 */
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
index 2614306..a269199 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
@@ -124,10 +124,39 @@ int CPetInventoryGlyph::subMode(CGameObject *item, int val) {
 	return frameNum;
 }
 
+bool CPetInventoryGlyph::doAction(CGlyphAction *action) {
+	CInventoryGlyphAction *invAction = static_cast<CInventoryGlyphAction *>(action);
+	CPetInventoryGlyphs *owner = static_cast<CPetInventoryGlyphs *>(_owner);
+	if (!invAction)
+		return false; 
+
+	switch (invAction->getMode()) {
+	case ACTION_REMOVED:
+		if (invAction->_item == _item) {
+			_item = nullptr;
+			_field3C = 0;
+			_field34 = 0;
+		}
+		break;
+
+	case ACTION_REMOVE:
+		if (_item == invAction->_item && _owner) {
+			int v = populateItem(_item, 0);
+			_field3C = owner->fn1(v);
+		}
+	}
+
+	return true;
+}
+
 /*------------------------------------------------------------------------*/
 
-void CPetInventoryGlyphs::addItem(CPetCarry *item) {
+bool CPetInventoryGlyphs::change(CInventoryGlyphAction *action) {
+	for (iterator i = begin(); i != end(); ++i) {
+		(*i)->doAction(action);
+	}
 
+	return true;
 }
 
 int CPetInventoryGlyphs::fn1(int val) {
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h
index 8c483ea..633aee1 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.h
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.h
@@ -52,14 +52,19 @@ public:
 	 * Set the inventory item
 	 */
 	void setItem(CGameObject *item, int val);
+
+	/**
+	 * Does a processing action on the glyph
+	 */
+	virtual bool doAction(CGlyphAction *action);
 };
 
-class CPetCarry {
+class CInventoryGlyphAction : public CGlyphAction {
 public:
-	int _val;
 	CCarry *_item;
 public:
-	CPetCarry(CCarry *item, int val) : _item(item), _val(val) {}
+	CInventoryGlyphAction(CCarry *item, GlyphActionMode mode) : 
+		CGlyphAction(mode), _item(item) {}
 };
 
 class CPetInventoryGlyphs : public CPetGlyphs {
@@ -68,9 +73,9 @@ private:
 	int fn1(int val);
 public:
 	/**
-	 * Add a new item to the list
+	 * 
 	 */
-	void addItem(CPetCarry *item);
+	bool change(CInventoryGlyphAction *item);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 43ae623..606aac1 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -60,9 +60,9 @@ public:
 	virtual bool setup(CPetControl *petControl) { return false; }
 	
 	/**
-	 * Sets up the section
+	 * Reset the section
 	 */
-	virtual bool setup() { return false; }
+	virtual bool reset() { return false; }
 
 	/**
 	 * Draw the section


Commit: 11cde7b4138906c050efef73ce011777d6298cfb
    https://github.com/scummvm/scummvm/commit/11cde7b4138906c050efef73ce011777d6298cfb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:22-04:00

Commit Message:
TITANIC: Implement CPetGlyphs setup

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index a9a15c5..1964241 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -50,7 +50,7 @@ bool CPetGlyph::translateContains(const Point &delta, const Point &pt) {
 /*------------------------------------------------------------------------*/
 
 CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0),  _numVisibleGlyphs(7),
-		_highlightIndex(-1), _field1C(-1), _field20(0), _field24(0) {
+		_highlightIndex(-1), _field1C(-1), _field20(0), _owner(nullptr) {
 }
 
 void CPetGlyphs::setNumVisible(int total) {
@@ -65,7 +65,16 @@ void CPetGlyphs::clear() {
 }
 
 void CPetGlyphs::setup(int numVisible, CPetSection *owner) {
-	error("TODO");
+	setNumVisible(numVisible);
+	_owner = owner;
+	_selection.setBounds(Rect(0, 0, 76, 76));
+
+	int buttonsLeft = numVisible * 7 * 5 + 21;
+
+	_scrollLeft.setBounds(Rect(0, 0, 31, 15));
+	_scrollLeft.translate(buttonsLeft, 373);
+	_scrollRight.setBounds(Rect(0, 0, 31, 15));
+	_scrollRight.translate(buttonsLeft, 413);
 }
 
 void CPetGlyphs::reset() {
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index fceca4d..88b6e40 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -153,7 +153,7 @@ protected:
 	int _highlightIndex;
 	int _field1C;
 	int _field20;
-	int _field24;
+	CPetSection *_owner;
 	CPetGfxElement _selection;
 	CPetGfxElement _scrollLeft;
 	CPetGfxElement _scrollRight;


Commit: fc33bc4182056864b479e4abd0387deab0670ec6
    https://github.com/scummvm/scummvm/commit/fc33bc4182056864b479e4abd0387deab0670ec6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:23-04:00

Commit Message:
TITANIC: Fix showing PET immediately when turned on via debugger

Changed paths:
    engines/titanic/debugger.cpp



diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp
index d643a87..e532a9b 100644
--- a/engines/titanic/debugger.cpp
+++ b/engines/titanic/debugger.cpp
@@ -194,7 +194,7 @@ bool Debugger::cmdPET(int argc, const char **argv) {
 
 		if (s == "on") {
 			gameState._petActive = true;
-			gameManager.update();
+			gameManager.initBounds();
 			debugPrintf("PET is now on\n");
 			return true;
 		} else if (s == "off") {


Commit: ca68e85f3791aa35e5ccc0f3d6cc33a9f71f7f48
    https://github.com/scummvm/scummvm/commit/ca68e85f3791aa35e5ccc0f3d6cc33a9f71f7f48
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:24-04:00

Commit Message:
TITANIC: Fix to partially display PET inventory

Changed paths:
    engines/titanic/pet_control/pet_frame.cpp



diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index 25d67fb..ec604a2 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -145,7 +145,7 @@ void CPetFrame::drawFrame(CScreenManager *screenManager) {
 
 void CPetFrame::drawIndent(CScreenManager *screenManager, int indent) {
 	indent = CLIP(indent, 0, 7);
-	for (int idx = 0; idx < indent; ++indent)
+	for (int idx = 0; idx < indent; ++idx)
 		_indent[idx].draw(screenManager);
 }
 


Commit: b6e093d668e9e782cc6a08a787d48c857cf53430
    https://github.com/scummvm/scummvm/commit/b6e093d668e9e782cc6a08a787d48c857cf53430
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:25-04:00

Commit Message:
TITANIC: Fix drawing glyph squares in PET inventory tab

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_frame.cpp
    engines/titanic/pet_control/pet_frame.h
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_inventory.cpp



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 31f95d1..fed17d5 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -345,8 +345,8 @@ bool CPetControl::TimerMsg(CTimerMsg *msg) {
 	return true;
 }
 
-void CPetControl::drawIndent(CScreenManager *screenManager, int indent) {
-	_frame.drawIndent(screenManager, indent);
+void CPetControl::drawSquares(CScreenManager *screenManager, int count) {
+	_frame.drawSquares(screenManager, count);
 }
 
 void CPetControl::displayMessage(const CString &msg) {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 1e98e3f..3726fc3 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -179,9 +179,9 @@ public:
 	CRoomItem *getHiddenRoom();
 
 	/**
-	 * Draws the indent
+	 * Draws squares for showing glyphs inside
 	 */
-	void drawIndent(CScreenManager *screenManager, int indent);
+	void drawSquares(CScreenManager *screenManager, int count);
 
 	/**
 	 * Returns true if the point is within the PET's draw bounds
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index ec604a2..3269b9f 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -54,9 +54,9 @@ bool CPetFrame::reset() {
 			_titles[idx].reset(resName, _petControl, MODE_UNSELECTED);
 		}
 
-		for (int idx = 0; idx < 7; ++idx) {
-			CString resName = Common::String::format("PetIndent%d", idx);
-			_indent[idx].reset(resName, _petControl, MODE_UNSELECTED);
+		for (int idx = 0; idx < TOTAL_GLYPHS; ++idx) {
+			CString resName = Common::String::format("PetIndent%d", idx + 1);
+			_squares[idx].reset(resName, _petControl, MODE_UNSELECTED);
 		}
 	}
 
@@ -97,13 +97,15 @@ bool CPetFrame::setPetControl(CPetControl *petControl) {
 		// Set the bounds of the individual elements
 		_background.setBounds(Rect(20, 350, 620, 480));
 		_modeBackground.setBounds(Rect(590, 365, 611, 467));
-
+		
+		// Squares used for holding glyphs in various tabs
 		Rect r(35, 373, 91, 429);
-		for (int idx = 0, xp = 0; xp < 490; ++idx, xp += 70) {
-			_indent[idx].setBounds(r);
-			_indent[idx].translate(xp, 0);
+		for (int idx = 0, xp = 0; idx < TOTAL_GLYPHS; ++idx, xp += 70) {
+			_squares[idx].setBounds(r);
+			_squares[idx].translate(xp, 0);
 		}
 
+		// Draw the mode buttons vertically on the right edge of the PET
 		r = Rect(590, 365, 606, 381);
 		const int YLIST[] = { 7, 27, 45, 66, 84 };
 		for (int idx = 0; idx < 5; ++idx) {
@@ -143,10 +145,10 @@ void CPetFrame::drawFrame(CScreenManager *screenManager) {
 	_titles[_petControl->_currentArea].draw(screenManager);
 }
 
-void CPetFrame::drawIndent(CScreenManager *screenManager, int indent) {
-	indent = CLIP(indent, 0, 7);
-	for (int idx = 0; idx < indent; ++idx)
-		_indent[idx].draw(screenManager);
+void CPetFrame::drawSquares(CScreenManager *screenManager, int count) {
+	count = CLIP(count, 0, TOTAL_GLYPHS);
+	for (int idx = 0; idx < count; ++idx)
+		_squares[idx].draw(screenManager);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_frame.h b/engines/titanic/pet_control/pet_frame.h
index 0bc872a..d8924e8 100644
--- a/engines/titanic/pet_control/pet_frame.h
+++ b/engines/titanic/pet_control/pet_frame.h
@@ -40,7 +40,7 @@ private:
 	CPetGfxElement _val2;
 	CPetGfxElement _val3;
 	CPetGfxElement _background;
-	CPetGfxElement _indent[7];
+	CPetGfxElement _squares[7];
 private:
 	/**
 	 * Called to set the owning PET instance and set some initial state
@@ -93,7 +93,7 @@ public:
 	/**
 	 * Draws the indent
 	 */
-	void drawIndent(CScreenManager *screenManager, int indent);
+	void drawSquares(CScreenManager *screenManager, int count);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 1964241..e38efdd 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -49,7 +49,7 @@ bool CPetGlyph::translateContains(const Point &delta, const Point &pt) {
 
 /*------------------------------------------------------------------------*/
 
-CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0),  _numVisibleGlyphs(7),
+CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0),  _numVisibleGlyphs(TOTAL_GLYPHS),
 		_highlightIndex(-1), _field1C(-1), _field20(0), _owner(nullptr) {
 }
 
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 88b6e40..54abe9d 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -29,6 +29,8 @@
 
 namespace Titanic {
 
+#define TOTAL_GLYPHS 7
+
 class CPetGlyphs;
 class CPetSection;
 
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index ff333ed..5dd2078 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -47,7 +47,7 @@ bool CPetInventory::reset() {
 }
 
 void CPetInventory::draw(CScreenManager *screenManager) {
-	_petControl->drawIndent(screenManager, 7);
+	_petControl->drawSquares(screenManager, 7);
 	_items.draw(screenManager);
 	_sub12.draw(screenManager);
 }


Commit: 456287945099266e624dd2802a567579c4d355ea
    https://github.com/scummvm/scummvm/commit/456287945099266e624dd2802a567579c4d355ea
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:26-04:00

Commit Message:
TITANIC: Fix highlighting selected PET area button

Changed paths:
    engines/titanic/pet_control/pet_frame.cpp



diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index 3269b9f..f243054 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -45,12 +45,12 @@ bool CPetFrame::reset() {
 		_modeBackground.reset("PetModeBackground", _petControl, MODE_UNSELECTED);
 
 		for (int idx = 0; idx < 5; ++idx) {
-			CString resName = Common::String::format("PetMode%d", idx);
-			_modeButtons[idx].reset(resName, _petControl, MODE_UNSELECTED);
+			CString resName = Common::String::format("PetMode%d", idx + 1);
+			_modeButtons[idx].reset(resName, _petControl, MODE_SELECTED);
 		}
 
 		for (int idx = 0; idx < 6; ++idx) {
-			CString resName = Common::String::format("3Pettitle%d", idx);
+			CString resName = Common::String::format("3Pettitle%d", idx + 1);
 			_titles[idx].reset(resName, _petControl, MODE_UNSELECTED);
 		}
 
@@ -110,7 +110,7 @@ bool CPetFrame::setPetControl(CPetControl *petControl) {
 		const int YLIST[] = { 7, 27, 45, 66, 84 };
 		for (int idx = 0; idx < 5; ++idx) {
 			_modeButtons[idx].setBounds(r);
-			_modeButtons[idx].translate(0, YLIST[idx]);
+			_modeButtons[idx].translate(4, YLIST[idx]);
 		}
 		_modeButtons[PET_AREAS[0]].setMode(MODE_SELECTED);
 		


Commit: 5316951ba6e4403a388e49a1e23fc7858d1c3980
    https://github.com/scummvm/scummvm/commit/5316951ba6e4403a388e49a1e23fc7858d1c3980
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:27-04:00

Commit Message:
TITANIC: Fix item debugger command to immediately show PET inventory

Changed paths:
    engines/titanic/debugger.cpp



diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp
index e532a9b..e02f1c8 100644
--- a/engines/titanic/debugger.cpp
+++ b/engines/titanic/debugger.cpp
@@ -210,6 +210,9 @@ bool Debugger::cmdPET(int argc, const char **argv) {
 }
 
 bool Debugger::cmdItem(int argc, const char **argv) {
+	CGameManager &gameManager = *g_vm->_window->_gameManager;
+	CGameState &gameState = gameManager._gameState;
+
 	if (argc == 1) {
 		// No parameters, so list the available items
 		debugPrintf("item [<name> [ add ]]\n");
@@ -243,11 +246,11 @@ bool Debugger::cmdItem(int argc, const char **argv) {
 
 			debugPrintf("Current location: %s\n", fullName.c_str());
 		} else if (CString(argv[2]) == "add") {
-			CPetControl *pet = item->getPetControl();
-			assert(pet);
-
-			pet->_visible = true;
+			// Ensure the PET is active and add the item to the inventory
+			gameState._petActive = true;
+			gameManager.initBounds();
 			item->addToInventory();
+
 			return false;
 		} else {
 			debugPrintf("Unknown command\n");


Commit: 47024115941c125452bb787758091686c91fc4fb
    https://github.com/scummvm/scummvm/commit/47024115941c125452bb787758091686c91fc4fb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:29-04:00

Commit Message:
TITANIC: Further cleanup of pet element setups

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_inventory_glyphs.cpp
    engines/titanic/pet_control/pet_inventory_glyphs.h
    engines/titanic/pet_control/pet_section.cpp
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index e38efdd..2bf73d9 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -21,10 +21,11 @@
  */
 
 #include "titanic/pet_control/pet_glyphs.h"
+#include "titanic/pet_control/pet_section.h"
 
 namespace Titanic {
 
-void CPetGlyph::setOwner(CPetControl *petControl, CPetGlyphs *owner) {
+void CPetGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	_element.setBounds(Rect(0, 0, 52, 50));
 	_owner = owner;
 }
@@ -47,6 +48,10 @@ bool CPetGlyph::translateContains(const Point &delta, const Point &pt) {
 	return result;
 }
 
+CPetSection *CPetGlyph::getPetSection() const {
+	return _owner ? _owner->getOwner() : nullptr;
+}
+
 /*------------------------------------------------------------------------*/
 
 CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0),  _numVisibleGlyphs(TOTAL_GLYPHS),
@@ -78,8 +83,17 @@ void CPetGlyphs::setup(int numVisible, CPetSection *owner) {
 }
 
 void CPetGlyphs::reset() {
+	if (_owner && _owner->_petControl) {
+		CPetControl *pet = _owner->_petControl;
+
+		_scrollLeft.reset("PetScrollLeft", pet, MODE_UNSELECTED);
+		_scrollRight.reset("PetScrollRight", pet, MODE_UNSELECTED);
+		_selection.reset("PetSelection", pet, MODE_UNSELECTED);
 
-	warning("TODO: CPetGlyphs::reset");
+		for (iterator i = begin(); i != end(); ++i) {
+			(*i)->reset();
+		}
+	}
 }
 
 void CPetGlyphs::proc10() {
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 54abe9d..c9962bd 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -47,6 +47,11 @@ public:
 };
 
 class CPetGlyph : public ListItem {
+protected:
+	/**
+	 * Get the overall pet section owner
+	 */
+	CPetSection *getPetSection() const;
 public:
 	CPetGfxElement _element;
 	CPetGlyphs *_owner;
@@ -64,11 +69,14 @@ public:
 	void translateBack(const Point &pt) { _element.translate(-pt.x, -pt.y); }
 
 	/**
-	 * Set the glyph
+	 * Setup the glyph
 	 */
-	virtual void setOwner(CPetControl *petControl, CPetGlyphs *owner);
+	virtual void setup(CPetControl *petControl, CPetGlyphs *owner);
 
-	virtual int proc9() { return 0; }
+	/**
+	 * Reset the glyph
+	 */
+	virtual bool reset() { return false; }
 
 	virtual void proc10() {}
 	virtual void proc11() {}
@@ -202,6 +210,11 @@ public:
 	 * Highlight a specific glyph
 	 */
 	void highlight(int index);
+
+	/**
+	 * Get the owning section for the glyphs
+	 */
+	CPetSection *getOwner() const { return _owner; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 5dd2078..2d11bc1 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -123,7 +123,7 @@ void CPetInventory::itemsChanged() {
 	CGameObject *item = _petControl->getFirstObject();
 	while (item) {
 		CPetInventoryGlyph *glyph = new CPetInventoryGlyph();
-		glyph->setOwner(_petControl, &_items);
+		glyph->setup(_petControl, &_items);
 		glyph->setItem(item, _field290);
 
 		_items.push_back(glyph);
@@ -145,5 +145,40 @@ int CPetInventory::getItemIndex(CGameObject *item) const {
 	return index;
 }
 
+CGameObject *CPetInventory::getImage(int index) {
+	if (index >= 0 && index < 46) {
+		int offset = index - 20;
+		int bits;
+		switch (offset) {
+		case 0:
+			bits = 4;
+			break;
+		case 1:
+			bits = 8;
+			break;
+		case 2:
+			bits = 1;
+			break;
+		case 23:
+			bits = 2;
+			break;
+		case 36:
+			bits = 32;
+			break;
+		case 39:
+			bits = 16;
+			break;
+		default:
+			break;
+		}
+
+		if (!(bits & _field298)) {
+			_field298 = bits | _field298;
+			return _itemGlyphs[index];
+		}
+	}
+	
+	return nullptr;
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index e192bf8..fca9ded 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -96,6 +96,10 @@ public:
 	 */
 	virtual bool isValid(CPetControl *petControl);
 
+	virtual CGameObject *getBackground(int index) const {
+		return (index >= 0 && index < 46) ? _itemBackgrounds[index] : nullptr;
+	}
+
 	/**
 	 * 
 	 */
@@ -115,6 +119,8 @@ public:
 	 * Called when the inventory can't be shown after adding an item
 	 */
 	void highlightItem(CGameObject *item);
+
+	CGameObject *getImage(int index);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
index a269199..6ce130f 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
@@ -22,6 +22,7 @@
 
 #include "common/textconsole.h"
 #include "titanic/pet_control/pet_inventory_glyphs.h"
+#include "titanic/pet_control/pet_inventory.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
@@ -38,8 +39,8 @@ void CPetInventoryGlyph::setItem(CGameObject *item, int val) {
 
 	if (_owner && item) {
 		int v1 = populateItem(item, val);
-		_field3C = static_cast<CPetInventoryGlyphs *>(_owner)->fn1(v1);
-		warning("TODO: CPetInventoryGlyph::setItem");
+		_background = static_cast<CPetInventoryGlyphs *>(_owner)->getBackground(v1);
+		_image = static_cast<CPetInventory *>(getPetSection())->getImage(v1);
 	}
 }
 
@@ -134,7 +135,7 @@ bool CPetInventoryGlyph::doAction(CGlyphAction *action) {
 	case ACTION_REMOVED:
 		if (invAction->_item == _item) {
 			_item = nullptr;
-			_field3C = 0;
+			_background = nullptr;
 			_field34 = 0;
 		}
 		break;
@@ -142,7 +143,7 @@ bool CPetInventoryGlyph::doAction(CGlyphAction *action) {
 	case ACTION_REMOVE:
 		if (_item == invAction->_item && _owner) {
 			int v = populateItem(_item, 0);
-			_field3C = owner->fn1(v);
+			_background = owner->getBackground(v);
 		}
 	}
 
@@ -159,9 +160,8 @@ bool CPetInventoryGlyphs::change(CInventoryGlyphAction *action) {
 	return true;
 }
 
-int CPetInventoryGlyphs::fn1(int val) {
-	warning("TODO: CPetInventoryGlyphs::fn1");
-	return 0;
+CGameObject *CPetInventoryGlyphs::getBackground(int index) {
+	return _owner ? _owner->getBackground(index) : nullptr;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h
index 633aee1..190bce7 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.h
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.h
@@ -40,13 +40,13 @@ private:
 public:
 	CGameObject *_item;
 	int _field34;
-	int _field3C;
-	int _field40;
+	CGameObject *_background;
+	CGameObject *_image;
 public:
 	CPetInventoryGlyph() : _item(nullptr), _field34(0), 
-		_field3C(0), _field40(0) {}
+		_background(nullptr), _image(nullptr) {}
 	CPetInventoryGlyph(CCarry *item, int val) : _item(item),
-		_field34(val), _field3C(0), _field40(0) {}
+		_field34(val), _background(nullptr), _image(nullptr) {}
 
 	/**
 	 * Set the inventory item
@@ -70,7 +70,7 @@ public:
 class CPetInventoryGlyphs : public CPetGlyphs {
 	friend class CPetInventoryGlyph;
 private:
-	int fn1(int val);
+	CGameObject *getBackground(int index);
 public:
 	/**
 	 * 
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp
index 349fa40..f913ac6 100644
--- a/engines/titanic/pet_control/pet_section.cpp
+++ b/engines/titanic/pet_control/pet_section.cpp
@@ -49,8 +49,4 @@ void CPetSection::proc30() {
 	error("TODO");
 }
 
-void CPetSection::proc31() {
-	error("TODO");
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 606aac1..07b935a 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -48,7 +48,7 @@ struct CPetSectionSubData {
 };
 
 class CPetSection {
-protected:
+public:
 	CPetControl *_petControl;
 public:
 	CPetSection() : _petControl(nullptr) {}
@@ -144,7 +144,9 @@ public:
 	virtual void proc28();
 	virtual void proc29();
 	virtual void proc30();
-	virtual void proc31();
+
+	virtual CGameObject *getBackground(int index) const { return nullptr; }
+
 	virtual void proc32() {}
 	virtual void proc33() {}
 	virtual void proc34() {}


Commit: 42206332d0d7474dfead288c643ef4980c739773
    https://github.com/scummvm/scummvm/commit/42206332d0d7474dfead288c643ef4980c739773
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:30-04:00

Commit Message:
TITANIC: Adding new class stubs for PET Real Life btns & elements

Changed paths:
  A engines/titanic/pet_control/pet_load.cpp
  A engines/titanic/pet_control/pet_load.h
  A engines/titanic/pet_control/pet_load_save.cpp
  A engines/titanic/pet_control/pet_load_save.h
  A engines/titanic/pet_control/pet_quit.cpp
  A engines/titanic/pet_control/pet_quit.h
  A engines/titanic/pet_control/pet_real_life.cpp
  A engines/titanic/pet_control/pet_real_life.h
  A engines/titanic/pet_control/pet_save.cpp
  A engines/titanic/pet_control/pet_save.h
  A engines/titanic/pet_control/pet_slider.cpp
  A engines/titanic/pet_control/pet_slider.h
  A engines/titanic/pet_control/pet_sound.cpp
  A engines/titanic/pet_control/pet_sound.h
  R engines/titanic/pet_control/pet_saves.cpp
  R engines/titanic/pet_control/pet_saves.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_frame.cpp
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index da642f9..fc2b4ef 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -365,7 +365,7 @@ MODULE_OBJS := \
 	pet_control/pet_inventory_glyphs.o \
 	pet_control/pet_rooms.o \
 	pet_control/pet_remote.o \
-	pet_control/pet_saves.o \
+	pet_control/pet_real_life.o \
 	pet_control/pet_section.o \
 	pet_control/pet_control_sub5.o \
 	pet_control/pet_control_sub7.o \
@@ -376,12 +376,18 @@ MODULE_OBJS := \
 	pet_control/pet_graphic.o \
 	pet_control/pet_glyphs.o \
 	pet_control/pet_leaf.o \
+	pet_control/pet_load.o \
+	pet_control/pet_load_save.o \
 	pet_control/pet_mode_off.o \
 	pet_control/pet_mode_on.o \
 	pet_control/pet_mode_panel.o \
 	pet_control/pet_pannel1.o \
 	pet_control/pet_pannel2.o \
 	pet_control/pet_pannel3.o \
+	pet_control/pet_quit.o \
+	pet_control/pet_save.o \
+	pet_control/pet_slider.o \
+	pet_control/pet_sound.o \
 	sound/auto_music_player.o \
 	sound/auto_music_player_base.o \
 	sound/auto_sound_player.o \
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index fed17d5..0bba2c2 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -51,7 +51,7 @@ CPetControl::CPetControl() : CGameObject(),
 	_sections[PET_CONVERSATION] = &_conversations;
 	_sections[PET_REMOTE] = &_remote;
 	_sections[PET_ROOMS] = &_rooms;
-	_sections[PET_SAVE] = &_saves;
+	_sections[PET_REAL_LIFE] = &_realLife;
 	_sections[PET_5] = &_sub5;
 	_sections[PET_6] = &_sub7;
 }
@@ -87,7 +87,7 @@ void CPetControl::setup() {
 	_remote.setup(this);
 	_inventory.setup(this);
 	_sub5.setup(this);
-	_saves.setup(this);
+	_realLife.setup(this);
 	_sub7.setup(this);
 	_frame.setup(this);
 }
@@ -98,7 +98,7 @@ bool CPetControl::isValid() {
 		_remote.isValid(this) &&
 		_inventory.isValid(this) &&
 		_sub5.isValid(this) &&
-		_saves.isValid(this) &&
+		_realLife.isValid(this) &&
 		_sub7.isValid(this) &&
 		_frame.isValid(this);
 }
@@ -109,7 +109,7 @@ void CPetControl::loadAreas(SimpleFile *file, int param) {
 	_remote.load(file, param);
 	_inventory.load(file, param);
 	_sub5.load(file, param);
-	_saves.load(file, param);
+	_realLife.load(file, param);
 	_sub7.load(file, param);
 	_frame.load(file, param);
 }
@@ -120,7 +120,7 @@ void CPetControl::saveAreas(SimpleFile *file, int indent) const {
 	_remote.save(file, indent);
 	_inventory.save(file, indent);
 	_sub5.save(file, indent);
-	_saves.save(file, indent);
+	_realLife.save(file, indent);
 	_sub7.save(file, indent);
 	_frame.save(file, indent);
 }
@@ -165,7 +165,7 @@ void CPetControl::loaded() {
 	_remote.postLoad();
 	_inventory.postLoad();
 	_sub5.postLoad();
-	_saves.postLoad();
+	_realLife.postLoad();
 	_sub7.postLoad();
 	_frame.postLoad();
 }
@@ -330,7 +330,7 @@ bool CPetControl::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
 			break;
 		case Common::KEYCODE_F5:
 			result = true;
-			setArea(PET_SAVE);
+			setArea(PET_REAL_LIFE);
 			break;
 		default:
 			break;
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 3726fc3..e7ec993 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -31,9 +31,9 @@
 #include "titanic/pet_control/pet_conversations.h"
 #include "titanic/pet_control/pet_frame.h"
 #include "titanic/pet_control/pet_inventory.h"
+#include "titanic/pet_control/pet_real_life.h"
 #include "titanic/pet_control/pet_remote.h"
 #include "titanic/pet_control/pet_rooms.h"
-#include "titanic/pet_control/pet_saves.h"
 #include "titanic/pet_control/pet_control_sub5.h"
 #include "titanic/pet_control/pet_control_sub7.h"
 
@@ -50,7 +50,7 @@ private:
 	CPetInventory _inventory;
 	CPetRemote _remote;
 	CPetRoomsSection _rooms;
-	CPetSaves _saves;
+	CPetRealLife _realLife;
 	CPetControlSub5 _sub5;
 	CPetControlSub7 _sub7;
 	CPetFrame _frame;
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index f243054..a9f45fa 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 
 static const PetArea PET_AREAS[6] = {
 	PET_CONVERSATION, PET_INVENTORY, PET_REMOTE,
-	PET_ROOMS, PET_SAVE, PET_5
+	PET_ROOMS, PET_REAL_LIFE, PET_5
 };
 
 CPetFrame::CPetFrame() : CPetSection() {
diff --git a/engines/titanic/pet_control/pet_load.cpp b/engines/titanic/pet_control/pet_load.cpp
new file mode 100644
index 0000000..1008425
--- /dev/null
+++ b/engines/titanic/pet_control/pet_load.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_load.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_load.h b/engines/titanic/pet_control/pet_load.h
new file mode 100644
index 0000000..297cb97
--- /dev/null
+++ b/engines/titanic/pet_control/pet_load.h
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_LOAD_H
+#define TITANIC_PET_LOAD_H
+
+#include "titanic/pet_control/pet_load_save.h"
+
+namespace Titanic {
+
+class CPetLoad : public CPetLoadSave {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_LOAD_H */
diff --git a/engines/titanic/pet_control/pet_load_save.cpp b/engines/titanic/pet_control/pet_load_save.cpp
new file mode 100644
index 0000000..7660b71
--- /dev/null
+++ b/engines/titanic/pet_control/pet_load_save.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_load_save.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_load_save.h b/engines/titanic/pet_control/pet_load_save.h
new file mode 100644
index 0000000..780fd75
--- /dev/null
+++ b/engines/titanic/pet_control/pet_load_save.h
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_LOAD_SAVE_H
+#define TITANIC_PET_LOAD_SAVE_H
+
+#include "titanic/pet_control/pet_glyphs.h"
+
+namespace Titanic {
+
+class CPetLoadSave : public CPetGlyph {
+protected:
+	CPetGfxElement _element1;
+	CPetGfxElement _element2;
+public:
+};
+
+} // End of namespace Titanic
+
+#endif
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
new file mode 100644
index 0000000..da757f5
--- /dev/null
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_quit.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_quit.h b/engines/titanic/pet_control/pet_quit.h
new file mode 100644
index 0000000..28b4b87
--- /dev/null
+++ b/engines/titanic/pet_control/pet_quit.h
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_QUIT_H
+#define TITANIC_PET_QUIT_H
+
+#include "titanic/pet_control/pet_gfx_element.h"
+#include "titanic/pet_control/pet_glyphs.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+
+namespace Titanic {
+
+class CPetQuit : public CPetGlyph {
+private:
+	CPetControlSub12 _sub12;
+	CPetGfxElement _element;
+public:
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_QUIT_H */
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
new file mode 100644
index 0000000..3ec3317
--- /dev/null
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_real_life.h"
+#include "titanic/pet_control/pet_control.h"
+
+namespace Titanic {
+
+bool CPetRealLife::setup(CPetControl *petControl) {
+	if (petControl && setupControl(petControl))
+		return reset();
+	return false;
+}
+
+bool CPetRealLife::reset() {
+	return true;
+}
+
+void CPetRealLife::draw(CScreenManager *screenManager) {
+	_petControl->drawSquares(screenManager, 4);
+	_glyphs.draw(screenManager);
+	_sub12.draw(screenManager);
+}
+
+bool CPetRealLife::setupControl(CPetControl *petControl) {
+	if (petControl) {
+
+	}
+
+	return true;
+}
+
+bool CPetRealLife::isValid(CPetControl *petControl) {
+	setupControl(petControl);
+	return true;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_real_life.h b/engines/titanic/pet_control/pet_real_life.h
new file mode 100644
index 0000000..57d0b31
--- /dev/null
+++ b/engines/titanic/pet_control/pet_real_life.h
@@ -0,0 +1,135 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_REAL_LIFE_H
+#define TITANIC_PET_REAL_LIFE_H
+
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_glyphs.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+
+namespace Titanic {
+
+class CPetSaveGlyphs : public CPetGlyphs {
+};
+
+class CPetRealLife : public CPetSection {
+private:
+	CPetGlyphs _glyphs;
+	CPetSaveGlyphs _sub12;
+private:
+	/**
+	 * Does setup
+	 */
+	bool setupControl(CPetControl *petControl);
+public:
+	virtual ~CPetRealLife() {}
+
+	/**
+	 * Sets up the section
+	 */
+	virtual bool setup(CPetControl *petControl);
+	
+	/**
+	 * Reset the section
+	 */
+	virtual bool reset();
+
+	/**
+	 * Draw the section
+	 */
+	virtual void draw(CScreenManager *screenManager);
+	
+	/**
+	 * Get the bounds for the section
+	 */
+	virtual Rect getBounds() { return Rect(); }
+	
+	virtual void proc5(int val) {}
+	
+	/**
+	 * Following are handlers for the various messages that the PET can
+	 * pass onto the currently active section/area
+	 */
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return false; }
+	virtual bool MouseDragStartMsg(CMouseDragStartMsg *msg) { return false; }
+	virtual bool MouseDragMoveMsg(CMouseDragMoveMsg *msg) { return false; }
+	virtual bool MouseDragEndMsg(CMouseDragEndMsg *msg) { return false; }
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) { return false; }
+	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) { return false; }
+	virtual bool KeyCharMsg(CKeyCharMsg *msg) { return false; }
+	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) { return false; }
+
+	virtual int proc14() { return 0; }
+	
+	/**
+	 * Returns item a drag-drop operation has dropped on, if any
+	 */
+	virtual CGameObject *dragEnd(const Point &pt) const { return nullptr; }
+	
+	/**
+	 * Display a message
+	 */
+	virtual void displayMessage(const CString &msg) {}
+
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param) {}
+
+	/**
+	 * Called after a game has been loaded
+	 */
+	virtual void postLoad() {}
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const {}
+
+	/**
+	 * Called when a section is switched to
+	 */
+	virtual void enter(PetArea oldArea) {}
+	
+	/**
+	 * Called when a section is being left, to switch to another area
+	 */
+	virtual void leave() {}
+	
+	virtual void proc23() {}
+
+	/**
+	 * Called when a new room is entered
+	 */
+	virtual void enterRoom(CRoomItem *room) {}
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_REAL_LIFE_H */
diff --git a/engines/titanic/pet_control/pet_save.cpp b/engines/titanic/pet_control/pet_save.cpp
new file mode 100644
index 0000000..d8835e1
--- /dev/null
+++ b/engines/titanic/pet_control/pet_save.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_save.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_save.h b/engines/titanic/pet_control/pet_save.h
new file mode 100644
index 0000000..21e59cb
--- /dev/null
+++ b/engines/titanic/pet_control/pet_save.h
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_SAVE_H
+#define TITANIC_PET_SAVE_H
+
+#include "titanic/pet_control/pet_load_save.h"
+
+namespace Titanic {
+
+class CPetSave : public CPetLoadSave {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_SAVE_H */
diff --git a/engines/titanic/pet_control/pet_saves.cpp b/engines/titanic/pet_control/pet_saves.cpp
deleted file mode 100644
index 0a90cc2..0000000
--- a/engines/titanic/pet_control/pet_saves.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_saves.h"
-
-namespace Titanic {
-
-bool CPetSaves::isValid(CPetControl *petControl) {
-	// TODO
-	return true;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_saves.h b/engines/titanic/pet_control/pet_saves.h
deleted file mode 100644
index 8366ab6..0000000
--- a/engines/titanic/pet_control/pet_saves.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_SAVES_H
-#define TITANIC_PET_SAVES_H
-
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_glyphs.h"
-#include "titanic/pet_control/pet_control_sub12.h"
-
-namespace Titanic {
-
-class CPetSaveGlyphs : public CPetGlyphs {
-};
-
-class CPetSaves : public CPetSection {
-private:
-	CPetSaveGlyphs _sub10;
-	CPetSaveGlyphs _sub12;
-public:
-	/**
-	 * Returns true if the object is in a valid state
-	 */
-	virtual bool isValid(CPetControl *petControl);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_SAVES_H */
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 07b935a..728fb49 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 enum PetArea {
 	PET_INVENTORY = 0, PET_CONVERSATION = 1, PET_REMOTE = 2,
-	PET_ROOMS = 3, PET_SAVE = 4, PET_5 = 5, PET_6 = 6
+	PET_ROOMS = 3, PET_REAL_LIFE = 4, PET_5 = 5, PET_6 = 6
 };
 
 class CPetControl;
diff --git a/engines/titanic/pet_control/pet_slider.cpp b/engines/titanic/pet_control/pet_slider.cpp
new file mode 100644
index 0000000..dad78d6
--- /dev/null
+++ b/engines/titanic/pet_control/pet_slider.cpp
@@ -0,0 +1,89 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_slider.h"
+
+namespace Titanic {
+
+CPetSlider::CPetSlider() {
+	_field4 = 0;
+	_field8 = 0;
+	_field1C = 0;
+	_field20 = 0;
+	_field24 = 0;
+	_field28 = 0;
+	_field2C = 0;
+	_field30 = 0;
+	_field34 = 0;
+}
+
+void CPetSlider::initBounds(Rect *rect) {
+	if (rect)
+		*rect = _bounds2;
+	_bounds2.clear();
+}
+
+void CPetSlider::proc8() {
+
+}
+
+void CPetSlider::proc9() {
+
+}
+
+void CPetSlider::proc10() {
+
+}
+
+void CPetSlider::proc11() {
+
+}
+
+void CPetSlider::proc12() {
+
+}
+
+void CPetSlider::proc13() {
+
+}
+
+void CPetSlider::proc14() {
+
+}
+
+void CPetSlider::proc15() {
+
+}
+
+void CPetSlider::proc16() {
+
+}
+
+void CPetSlider::proc17() {
+
+}
+
+void CPetSlider::proc18() {
+
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_slider.h b/engines/titanic/pet_control/pet_slider.h
new file mode 100644
index 0000000..acad55c
--- /dev/null
+++ b/engines/titanic/pet_control/pet_slider.h
@@ -0,0 +1,85 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_SLIDER_H
+#define TITANIC_PET_SLIDER_H
+
+#include "titanic/support/rect.h"
+
+namespace Titanic {
+
+class CPetSlider {
+private:
+	int _field4;
+	int _field8;
+	Rect _bounds;
+	int _field1C;
+	int _field20;
+	int _field24;
+	int _field28;
+	int _field2C;
+	int _field30;
+	int _field34;
+	Rect _bounds2;
+public:
+	CPetSlider();
+
+	virtual void proc1() {}
+	virtual void proc2() {}
+	virtual void proc3() {}
+	virtual void proc4() {}
+	virtual void proc5() {}
+	virtual void proc6() {}
+	
+	/**
+	 * Reset the bounds of the slider
+	 */
+	virtual void initBounds(Rect *rect);
+	
+	virtual void proc8();
+	virtual void proc9();
+	virtual void proc10();
+	virtual void proc11();
+	virtual void proc12();
+	virtual void proc13();
+	virtual void proc14();
+	virtual void proc15();
+	virtual void proc16();
+	virtual void proc17();
+	virtual void proc18();
+
+	/**
+	 * Returns true if the passed point falls within the slider's bounds
+	 */
+	bool contains(const Point &pt) const { return _bounds.contains(pt); }
+};
+
+class CPetSoundSlider : public CPetSlider {
+public:
+
+public:
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_SLIDER_H */
diff --git a/engines/titanic/pet_control/pet_sound.cpp b/engines/titanic/pet_control/pet_sound.cpp
new file mode 100644
index 0000000..b236b1a
--- /dev/null
+++ b/engines/titanic/pet_control/pet_sound.cpp
@@ -0,0 +1,29 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_real_life.h"
+#include "titanic/pet_control/pet_control.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h
new file mode 100644
index 0000000..7607f95
--- /dev/null
+++ b/engines/titanic/pet_control/pet_sound.h
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_SOUND_H
+#define TITANIC_PET_SOUND_H
+
+#include "titanic/pet_control/pet_glyphs.h"
+#include "titanic/pet_control/pet_gfx_element.h"
+#include "titanic/pet_control/pet_control_sub12.h"
+
+namespace Titanic {
+
+class CPetQuit : public CPetGlyph {
+private:
+	CPetControlSub12 _sub12;
+	CPetGfxElement _element;
+public:
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_SOUND_H */


Commit: 225af470883f7e8e90ea18faf6b26b29342accb9
    https://github.com/scummvm/scummvm/commit/225af470883f7e8e90ea18faf6b26b29342accb9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:31-04:00

Commit Message:
TITANIC: Beginnings of PET RealLife Quit button

Changed paths:
    engines/titanic/pet_control/pet_control_sub12.cpp
    engines/titanic/pet_control/pet_control_sub12.h
    engines/titanic/pet_control/pet_gfx_element.h
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_quit.cpp
    engines/titanic/pet_control/pet_quit.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/pet_control/pet_control_sub12.cpp b/engines/titanic/pet_control/pet_control_sub12.cpp
index 59097e3..cc8d6ad 100644
--- a/engines/titanic/pet_control/pet_control_sub12.cpp
+++ b/engines/titanic/pet_control/pet_control_sub12.cpp
@@ -148,4 +148,12 @@ void CPetControlSub12::mergeStrings() {
 	}
 }
 
+void CPetControlSub12::resize(uint count) {
+	if (!count || _array.size() == count)
+		return;
+	_array.clear();
+	_array.resize(count);
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub12.h b/engines/titanic/pet_control/pet_control_sub12.h
index 70010f0..a5296ea 100644
--- a/engines/titanic/pet_control/pet_control_sub12.h
+++ b/engines/titanic/pet_control/pet_control_sub12.h
@@ -98,6 +98,7 @@ public:
 	 */
 	void draw(CScreenManager *screenManager);
 
+	void resize(uint count);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_gfx_element.h b/engines/titanic/pet_control/pet_gfx_element.h
index bc9150e..5bfeca1 100644
--- a/engines/titanic/pet_control/pet_gfx_element.h
+++ b/engines/titanic/pet_control/pet_gfx_element.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPetGfxElement: public CPetElement {
-protected:
+public:
 	CGameObject *_object0;
 	CGameObject *_object1;
 	CGameObject *_object2;
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 2bf73d9..b121a17 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -52,6 +52,16 @@ CPetSection *CPetGlyph::getPetSection() const {
 	return _owner ? _owner->getOwner() : nullptr;
 }
 
+CPetControl *CPetGlyph::getPetControl() const {
+	return _owner ? _owner->getPetControl() : nullptr;
+}
+
+void CPetGlyph::setName(const CString &name, CPetControl *petControl) {
+	Rect r(0, 0, 52, 52);
+	_element.setBounds(r);
+	_element.reset(name, petControl, MODE_UNSELECTED);
+}
+
 /*------------------------------------------------------------------------*/
 
 CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0),  _numVisibleGlyphs(TOTAL_GLYPHS),
@@ -178,4 +188,8 @@ CPetGlyph *CPetGlyphs::getGlyph(int index) {
 	return nullptr;
 }
 
+CPetControl *CPetGlyphs::getPetControl() const {
+	return _owner ? _owner->getPetControl() : nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index c9962bd..2360bfa 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -69,6 +69,16 @@ public:
 	void translateBack(const Point &pt) { _element.translate(-pt.x, -pt.y); }
 
 	/**
+	 * Get the PET control
+	 */
+	CPetControl *getPetControl() const;
+
+	/**
+	 * Sets new name and default bounds for glyph
+	 */
+	void setName(const CString &name, CPetControl *petControl);
+
+	/**
 	 * Setup the glyph
 	 */
 	virtual void setup(CPetControl *petControl, CPetGlyphs *owner);
@@ -215,6 +225,11 @@ public:
 	 * Get the owning section for the glyphs
 	 */
 	CPetSection *getOwner() const { return _owner; }
+
+	/**
+	 * Get the PET control
+	 */
+	CPetControl *getPetControl() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index da757f5..a68452d 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -21,8 +21,34 @@
  */
 
 #include "titanic/pet_control/pet_quit.h"
+#include "titanic/pet_control/pet_real_life.h"
+#include "titanic/support/rect.h"
 
 namespace Titanic {
 
+void CPetQuit::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CPetGlyph::setup(petControl, owner);
+	Rect tempRect(0, 0, 280, 16);
+	tempRect.moveTo(32, 407);
+	_sub12.setBounds(tempRect);
+	_sub12.resize(3);
+	_sub12.setHasBorder(true);
+	_sub12.setup();
+
+	Rect elementRect(0, 0, 496, 388);
+	elementRect.moveTo(496, 388);
+	_element.setBounds(elementRect);
+}
+
+bool CPetQuit::reset() {
+	CPetControl *pet = getPetControl();
+	if (!pet)
+		return false;
+
+	setName("PetExit", pet);
+	// TODO
+
+	return true;
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_quit.h b/engines/titanic/pet_control/pet_quit.h
index 28b4b87..6c54abb 100644
--- a/engines/titanic/pet_control/pet_quit.h
+++ b/engines/titanic/pet_control/pet_quit.h
@@ -34,6 +34,15 @@ private:
 	CPetControlSub12 _sub12;
 	CPetGfxElement _element;
 public:
+	/**
+	 * Setup the glyph
+	 */
+	virtual void setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Reset the glyph
+	 */
+	virtual bool reset();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 728fb49..1227813 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -154,6 +154,11 @@ public:
 	virtual void proc36() {}
 	virtual void proc37() {}
 	virtual void proc38(int val) {}
+
+	/**
+	 * Get the PET control
+	 */
+	CPetControl *getPetControl() const { return _petControl; }
 };
 
 } // End of namespace Titanic


Commit: 79c10ee30a5b4c8e41dc12806f432df88ff9af6f
    https://github.com/scummvm/scummvm/commit/79c10ee30a5b4c8e41dc12806f432df88ff9af6f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:32-04:00

Commit Message:
TITANIC: Rename CPetControlSub12 to CPetText

Changed paths:
  A engines/titanic/pet_control/pet_text.cpp
  A engines/titanic/pet_control/pet_text.h
  R engines/titanic/pet_control/pet_control_sub12.cpp
  R engines/titanic/pet_control/pet_control_sub12.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control_sub5.h
    engines/titanic/pet_control/pet_control_sub7.h
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_quit.cpp
    engines/titanic/pet_control/pet_quit.h
    engines/titanic/pet_control/pet_real_life.cpp
    engines/titanic/pet_control/pet_real_life.h
    engines/titanic/pet_control/pet_remote.h
    engines/titanic/pet_control/pet_rooms.h
    engines/titanic/pet_control/pet_sound.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index fc2b4ef..65afeba 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -370,7 +370,6 @@ MODULE_OBJS := \
 	pet_control/pet_control_sub5.o \
 	pet_control/pet_control_sub7.o \
 	pet_control/pet_control_sub11.o \
-	pet_control/pet_control_sub12.o \
 	pet_control/pet_drag_chev.o \
 	pet_control/pet_graphic2.o \
 	pet_control/pet_graphic.o \
@@ -388,6 +387,7 @@ MODULE_OBJS := \
 	pet_control/pet_save.o \
 	pet_control/pet_slider.o \
 	pet_control/pet_sound.o \
+	pet_control/pet_text.o \
 	sound/auto_music_player.o \
 	sound/auto_music_player_base.o \
 	sound/auto_sound_player.o \
@@ -424,7 +424,7 @@ MODULE_OBJS := \
 	star_control/star_control_sub9.o \
 	star_control/star_control_sub10.o \
 	star_control/star_control_sub11.o \
-	star_control/star_control_sub12.o \
+	star_control/star_control_text.o \
 	star_control/star_control_sub13.o \
 	star_control/star_control_sub14.o \
 	star_control/star_control_sub15.o \
diff --git a/engines/titanic/pet_control/pet_control_sub12.cpp b/engines/titanic/pet_control/pet_control_sub12.cpp
deleted file mode 100644
index cc8d6ad..0000000
--- a/engines/titanic/pet_control/pet_control_sub12.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software(0), you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation(0), either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY(0), without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program(0), if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_control_sub12.h"
-
-namespace Titanic {
-
-CPetControlSub12::CPetControlSub12(int count) :
-	_stringsMerged(false), _field30(-1), _lineCount(0), _field38(-1),
-	_field3C(0), _field40(0), _field44(0), _backR(0xff),
-	_backG(0xff), _backB(0xff), _field54(0), _field58(0),
-	_field5C(200), _field60(0), _field64(0), _field68(0),
-	_field6C(0), _hasBorder(true), _field74(0), _field78(0),
-	_field7C(0) {
-	setupArrays(count);
-}
-
-void CPetControlSub12::setupArrays(int count) {
-	freeArrays();
-	if (count < 10 || count > 60)
-		count = 10;
-	_array.resize(count);
-}
-
-void CPetControlSub12::freeArrays() {
-	_array.clear();
-}
-
-void CPetControlSub12::setup() {
-	for (int idx = 0; idx < (int)_array.size(); ++idx) {
-		_array[idx]._string1.clear();
-		setArrayStr2(idx, _field54, _field58, _field5C);
-		_array[idx]._string3.clear();
-	}
-
-	_lineCount = 0;
-	_stringsMerged = false;
-}
-
-void CPetControlSub12::setArrayStr2(uint idx, int val1, int val2, int val3) {
-	char buffer[6];
-	if (!val1)
-		val1 = 1;
-	if (!val2)
-		val2 = 1;
-	if (!val3)
-		val3 = 1;
-
-	buffer[0] = 27;
-	buffer[1] = val1;
-	buffer[2] = val2;
-	buffer[3] = val3;
-	buffer[4] = 27;
-	buffer[5] = '\0';
-	_array[idx]._string2 = buffer;
-}
-
-void CPetControlSub12::load(SimpleFile *file, int param) {
-	if (!param) {
-		int var1 = file->readNumber();
-		int var2 = file->readNumber();
-		uint count = file->readNumber();
-		_bounds.left = file->readNumber();
-		_bounds.top = file->readNumber();
-		_bounds.right = file->readNumber();
-		_bounds.bottom = file->readNumber();
-		_field3C = file->readNumber();
-		_field40 = file->readNumber();
-		_field44 = file->readNumber();
-		_backR = file->readNumber();
-		_backG = file->readNumber();
-		_backB = file->readNumber();
-		_field54 = file->readNumber();
-		_field58 = file->readNumber();
-		_field5C = file->readNumber();
-		_hasBorder = file->readNumber() != 0;
-		_field74 = file->readNumber();
-
-		warning("TODO: CPetControlSub12::load %d,%d", var1, var2);
-		assert(_array.size() >= count);
-		for (uint idx = 0; idx < count; ++idx) {
-			_array[idx]._string1 = file->readString();
-			_array[idx]._string2 = file->readString();
-			_array[idx]._string3 = file->readString();
-		}	
-	}
-}
-
-void CPetControlSub12::draw(CScreenManager *screenManager) {
-	Rect tempRect = _bounds;
-
-	if (_hasBorder) {
-		// Create border effect
-		// Top edge
-		tempRect.bottom = tempRect.top + 1;
-		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
-
-		// Bottom edge
-		tempRect.top = _bounds.bottom - 1;
-		tempRect.bottom = _bounds.bottom;
-		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
-
-		// Left edge
-		tempRect = _bounds;
-		tempRect.right = tempRect.left + 1;
-		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
-
-		// Right edge
-		tempRect = _bounds;
-		tempRect.left = tempRect.right - 1;
-		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
-	}
-
-	warning("TODO: CPetControlSub12::draw");
-}
-
-void CPetControlSub12::mergeStrings() {
-	if (!_stringsMerged) {
-		_lines.clear();
-
-		for (int idx = 0; idx < _lineCount; ++idx) {
-			CString line = _array[idx]._string2 + _array[idx]._string3 +
-				_array[idx]._string1 + "\n";
-			_lines += line;
-
-		}
-
-		_stringsMerged = true;
-	}
-}
-
-void CPetControlSub12::resize(uint count) {
-	if (!count || _array.size() == count)
-		return;
-	_array.clear();
-	_array.resize(count);
-}
-
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub12.h b/engines/titanic/pet_control/pet_control_sub12.h
deleted file mode 100644
index a5296ea..0000000
--- a/engines/titanic/pet_control/pet_control_sub12.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB12_H
-#define TITANIC_PET_CONTROL_SUB12_H
-
-#include "titanic/support/simple_file.h"
-#include "titanic/support/screen_manager.h"
-
-namespace Titanic {
-
-class CPetControlSub12 {
-	struct ArrayEntry {
-		CString _string1;
-		CString _string2;
-		CString _string3;
-	};
-private:
-	Common::Array<ArrayEntry> _array;
-	CString _lines;
-	bool _stringsMerged;
-	Rect _bounds;
-	int _field30;
-	int _lineCount;
-	int _field38;
-	int _field3C;
-	int _field40;
-	int _field44;
-	int _backR;
-	int _backG;
-	int _backB;
-	int _field54;
-	int _field58;
-	int _field5C;
-	int _field60;
-	int _field64;
-	int _field68;
-	int _field6C;
-	bool _hasBorder;
-	int _field74;
-	int _field78;
-	int _field7C;
-private:
-	void setupArrays(int count);
-
-	void freeArrays();
-
-	void setArrayStr2(uint idx, int val1, int val2, int val3);
-
-	/**
-	 * Merges the strings in the strings array
-	 */
-	void mergeStrings();
-public:
-	CPetControlSub12(int count = 10);
-
-	/**
-	 * Set up the control
-	 */
-	void setup();
-
-	/**
-	 * Load the data for the control
-	 */
-	void load(SimpleFile *file, int param);
-
-	/**
-	 * Set the bounds for the control
-	 */
-	void setBounds(const Rect &bounds) { _bounds = bounds; }
-
-	/**
-	 * Sets the flag for whether to draw a frame border around the control
-	 */
-	void setHasBorder(bool val) { _hasBorder = val; }
-
-	/**
-	 * Draw the control
-	 */
-	void draw(CScreenManager *screenManager);
-
-	void resize(uint count);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB12_H */
diff --git a/engines/titanic/pet_control/pet_control_sub5.h b/engines/titanic/pet_control/pet_control_sub5.h
index 4997bf1..560803d 100644
--- a/engines/titanic/pet_control/pet_control_sub5.h
+++ b/engines/titanic/pet_control/pet_control_sub5.h
@@ -24,7 +24,7 @@
 #define TITANIC_PET_CONTROL_SUB5_H
 
 #include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
 #include "titanic/pet_control/pet_gfx_element.h"
 
 namespace Titanic {
@@ -41,7 +41,7 @@ private:
 	CPetGfxElement _valArray1[6];
 	int _field17C;
 	int _field18C;
-	CPetControlSub12 _sub12;
+	CPetText _text;
 	int _field20C;
 	int _field210;
 public:
diff --git a/engines/titanic/pet_control/pet_control_sub7.h b/engines/titanic/pet_control/pet_control_sub7.h
index 5ad0ba7..367ce84 100644
--- a/engines/titanic/pet_control/pet_control_sub7.h
+++ b/engines/titanic/pet_control/pet_control_sub7.h
@@ -24,14 +24,14 @@
 #define TITANIC_PET_CONTROL_SUB7_H
 
 #include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
 
 namespace Titanic {
 
 class CPetControlSub7 : public CPetSection {
 private:
-	CPetControlSub12 _sub1;
-	CPetControlSub12 _sub2;
+	CPetText _text1;
+	CPetText _text2;
 public:
 	/**
 	 * Returns true if the object is in a valid state
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index a4936e5..2fbee9e 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -33,8 +33,8 @@ void CPetConversations::save(SimpleFile *file, int indent) const {
 }
 
 void CPetConversations::load(SimpleFile *file, int param) {
-	_sub2.load(file, param);
-	_sub1.load(file, param);
+	_text2.load(file, param);
+	_text1.load(file, param);
 
 	for (int idx = 0; idx < 3; ++idx)
 		_valArray3[idx] = file->readNumber();
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index a511c3d..a79a513 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -24,7 +24,7 @@
 #define TITANIC_PET_CONVERSATIONS_H
 
 #include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
 #include "titanic/pet_control/pet_gfx_element.h"
 
 namespace Titanic {
@@ -44,8 +44,8 @@ private:
 	CPetGfxElement _val9;
 	CPetGfxElement _valArray2[9];
 	int _field30C;
-	CPetControlSub12 _sub1;
-	CPetControlSub12 _sub2;
+	CPetText _text1;
+	CPetText _text2;
 	int _valArray3[3];
 	int _field414;
 	int _field418;
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 2d11bc1..9a3ee83 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -40,7 +40,7 @@ bool CPetInventory::setup(CPetControl *petControl) {
 
 bool CPetInventory::reset() {
 	_items.reset();
-	_sub12.setup();
+	_text.setup();
 
 	// TODO
 	return true;
@@ -49,7 +49,7 @@ bool CPetInventory::reset() {
 void CPetInventory::draw(CScreenManager *screenManager) {
 	_petControl->drawSquares(screenManager, 7);
 	_items.draw(screenManager);
-	_sub12.draw(screenManager);
+	_text.draw(screenManager);
 }
 
 Rect CPetInventory::getBounds() { 
@@ -97,8 +97,8 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
 
 	tempRect = Rect(0, 0, 580, 15);
 	tempRect.translate(32, 445);
-	_sub12.setBounds(tempRect);
-	_sub12.setHasBorder(false);
+	_text.setBounds(tempRect);
+	_text.setHasBorder(false);
 
 	return true;
 }
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index fca9ded..32cb47e 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -26,7 +26,7 @@
 #include "titanic/support/simple_file.h"
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_inventory_glyphs.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
 
 namespace Titanic {
 
@@ -35,7 +35,7 @@ namespace Titanic {
  */
 class CPetInventory : public CPetSection {
 private:
-	CPetControlSub12 _sub12;
+	CPetText _text;
 	CPetInventoryGlyphs _items;
 	CGameObject *_itemBackgrounds[46];
 	CGameObject *_itemGlyphs[46];
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index a68452d..912789e 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -30,10 +30,10 @@ void CPetQuit::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	CPetGlyph::setup(petControl, owner);
 	Rect tempRect(0, 0, 280, 16);
 	tempRect.moveTo(32, 407);
-	_sub12.setBounds(tempRect);
-	_sub12.resize(3);
-	_sub12.setHasBorder(true);
-	_sub12.setup();
+	_text.setBounds(tempRect);
+	_text.resize(3);
+	_text.setHasBorder(true);
+	_text.setup();
 
 	Rect elementRect(0, 0, 496, 388);
 	elementRect.moveTo(496, 388);
diff --git a/engines/titanic/pet_control/pet_quit.h b/engines/titanic/pet_control/pet_quit.h
index 6c54abb..c7843e2 100644
--- a/engines/titanic/pet_control/pet_quit.h
+++ b/engines/titanic/pet_control/pet_quit.h
@@ -25,13 +25,13 @@
 
 #include "titanic/pet_control/pet_gfx_element.h"
 #include "titanic/pet_control/pet_glyphs.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
 
 namespace Titanic {
 
 class CPetQuit : public CPetGlyph {
 private:
-	CPetControlSub12 _sub12;
+	CPetText _text;
 	CPetGfxElement _element;
 public:
 	/**
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
index 3ec3317..0c7c4bd 100644
--- a/engines/titanic/pet_control/pet_real_life.cpp
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -38,7 +38,7 @@ bool CPetRealLife::reset() {
 void CPetRealLife::draw(CScreenManager *screenManager) {
 	_petControl->drawSquares(screenManager, 4);
 	_glyphs.draw(screenManager);
-	_sub12.draw(screenManager);
+	_text.draw(screenManager);
 }
 
 bool CPetRealLife::setupControl(CPetControl *petControl) {
diff --git a/engines/titanic/pet_control/pet_real_life.h b/engines/titanic/pet_control/pet_real_life.h
index 57d0b31..6281735 100644
--- a/engines/titanic/pet_control/pet_real_life.h
+++ b/engines/titanic/pet_control/pet_real_life.h
@@ -25,7 +25,7 @@
 
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_glyphs.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
 
 namespace Titanic {
 
@@ -35,7 +35,7 @@ class CPetSaveGlyphs : public CPetGlyphs {
 class CPetRealLife : public CPetSection {
 private:
 	CPetGlyphs _glyphs;
-	CPetSaveGlyphs _sub12;
+	CPetText _text;
 private:
 	/**
 	 * Does setup
diff --git a/engines/titanic/pet_control/pet_remote.h b/engines/titanic/pet_control/pet_remote.h
index 85cff3f..70f6c32 100644
--- a/engines/titanic/pet_control/pet_remote.h
+++ b/engines/titanic/pet_control/pet_remote.h
@@ -25,7 +25,7 @@
 
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_glyphs.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
 #include "titanic/pet_control/pet_gfx_element.h"
 
 namespace Titanic {
@@ -47,7 +47,7 @@ private:
 	CPetGfxElement _val9;
 	CPetGfxElement _val10;
 	CPetGfxElement _val11;
-	CPetControlSub12 _sub12;
+	CPetText _text;
 public:
 	/**
 	 * Returns true if the object is in a valid state
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index a4bcefe..1e68873 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -25,7 +25,7 @@
 
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_control_sub11.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
 #include "titanic/pet_control/pet_control_list_item2.h"
 
 namespace Titanic {
@@ -43,7 +43,7 @@ private:
 	int _field118;
 	int _field11C;
 	CPetGfxElement _val1;
-	CPetControlSub12 _sub12;
+	CPetText _text;
 	int _field1C0;
 	int _field1C4;
 	int _field1C8;
diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h
index 7607f95..d0a0fe1 100644
--- a/engines/titanic/pet_control/pet_sound.h
+++ b/engines/titanic/pet_control/pet_sound.h
@@ -25,7 +25,7 @@
 
 #include "titanic/pet_control/pet_glyphs.h"
 #include "titanic/pet_control/pet_gfx_element.h"
-#include "titanic/pet_control/pet_control_sub12.h"
+#include "titanic/pet_control/pet_text.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
new file mode 100644
index 0000000..ed297a8
--- /dev/null
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -0,0 +1,167 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software(0), you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation(0), either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY(0), without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program(0), if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_text.h"
+
+namespace Titanic {
+
+CPetText::CPetText(uint count) :
+	_stringsMerged(false), _field30(-1), _lineCount(0), _field38(-1),
+	_field3C(0), _field40(0), _field44(0), _backR(0xff),
+	_backG(0xff), _backB(0xff), _field54(0), _field58(0),
+	_field5C(200), _field60(0), _field64(0), _field68(0),
+	_field6C(0), _hasBorder(true), _field74(0), _field78(0),
+	_field7C(0) {
+	setupArrays(count);
+}
+
+void CPetText::setupArrays(int count) {
+	freeArrays();
+	if (count < 10 || count > 60)
+		count = 10;
+	_array.resize(count);
+}
+
+void CPetText::freeArrays() {
+	_array.clear();
+}
+
+void CPetText::setup() {
+	for (int idx = 0; idx < (int)_array.size(); ++idx) {
+		_array[idx]._string1.clear();
+		setArrayStr2(idx, _field54, _field58, _field5C);
+		_array[idx]._string3.clear();
+	}
+
+	_lineCount = 0;
+	_stringsMerged = false;
+}
+
+void CPetText::setArrayStr2(uint idx, int val1, int val2, int val3) {
+	char buffer[6];
+	if (!val1)
+		val1 = 1;
+	if (!val2)
+		val2 = 1;
+	if (!val3)
+		val3 = 1;
+
+	buffer[0] = 27;
+	buffer[1] = val1;
+	buffer[2] = val2;
+	buffer[3] = val3;
+	buffer[4] = 27;
+	buffer[5] = '\0';
+	_array[idx]._string2 = buffer;
+}
+
+void CPetText::load(SimpleFile *file, int param) {
+	if (!param) {
+		int var1 = file->readNumber();
+		int var2 = file->readNumber();
+		uint count = file->readNumber();
+		_bounds.left = file->readNumber();
+		_bounds.top = file->readNumber();
+		_bounds.right = file->readNumber();
+		_bounds.bottom = file->readNumber();
+		_field3C = file->readNumber();
+		_field40 = file->readNumber();
+		_field44 = file->readNumber();
+		_backR = file->readNumber();
+		_backG = file->readNumber();
+		_backB = file->readNumber();
+		_field54 = file->readNumber();
+		_field58 = file->readNumber();
+		_field5C = file->readNumber();
+		_hasBorder = file->readNumber() != 0;
+		_field74 = file->readNumber();
+
+		warning("TODO: CPetText::load %d,%d", var1, var2);
+		assert(_array.size() >= count);
+		for (uint idx = 0; idx < count; ++idx) {
+			_array[idx]._string1 = file->readString();
+			_array[idx]._string2 = file->readString();
+			_array[idx]._string3 = file->readString();
+		}	
+	}
+}
+
+void CPetText::draw(CScreenManager *screenManager) {
+	Rect tempRect = _bounds;
+
+	if (_hasBorder) {
+		// Create border effect
+		// Top edge
+		tempRect.bottom = tempRect.top + 1;
+		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
+
+		// Bottom edge
+		tempRect.top = _bounds.bottom - 1;
+		tempRect.bottom = _bounds.bottom;
+		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
+
+		// Left edge
+		tempRect = _bounds;
+		tempRect.right = tempRect.left + 1;
+		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
+
+		// Right edge
+		tempRect = _bounds;
+		tempRect.left = tempRect.right - 1;
+		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
+	}
+
+	warning("TODO: CPetText::draw");
+}
+
+void CPetText::mergeStrings() {
+	if (!_stringsMerged) {
+		_lines.clear();
+
+		for (int idx = 0; idx < _lineCount; ++idx) {
+			CString line = _array[idx]._string2 + _array[idx]._string3 +
+				_array[idx]._string1 + "\n";
+			_lines += line;
+
+		}
+
+		_stringsMerged = true;
+	}
+}
+
+void CPetText::resize(uint count) {
+	if (!count || _array.size() == count)
+		return;
+	_array.clear();
+	_array.resize(count);
+}
+
+void CPetText::setText(const CString &str) {
+	setup();
+	changeText(str);
+}
+
+void CPetText::changeText(const CString &str) {
+	warning("TODO: CPetText::changeText");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
new file mode 100644
index 0000000..2cd45c6
--- /dev/null
+++ b/engines/titanic/pet_control/pet_text.h
@@ -0,0 +1,116 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_TEXT_H
+#define TITANIC_PET_TEXT_H
+
+#include "titanic/support/simple_file.h"
+#include "titanic/support/screen_manager.h"
+
+namespace Titanic {
+
+class CPetText {
+	struct ArrayEntry {
+		CString _string1;
+		CString _string2;
+		CString _string3;
+	};
+private:
+	Common::Array<ArrayEntry> _array;
+	CString _lines;
+	bool _stringsMerged;
+	Rect _bounds;
+	int _field30;
+	int _lineCount;
+	int _field38;
+	int _field3C;
+	int _field40;
+	int _field44;
+	int _backR;
+	int _backG;
+	int _backB;
+	int _field54;
+	int _field58;
+	int _field5C;
+	int _field60;
+	int _field64;
+	int _field68;
+	int _field6C;
+	bool _hasBorder;
+	int _field74;
+	int _field78;
+	int _field7C;
+private:
+	void setupArrays(int count);
+
+	void freeArrays();
+
+	void setArrayStr2(uint idx, int val1, int val2, int val3);
+
+	/**
+	 * Merges the strings in the strings array
+	 */
+	void mergeStrings();
+
+	/**
+	 * Change the text
+	 */
+	void changeText(const CString &str);
+public:
+	CPetText(uint count = 10);
+
+	/**
+	 * Set up the control
+	 */
+	void setup();
+
+	/**
+	 * Load the data for the control
+	 */
+	void load(SimpleFile *file, int param);
+
+	/**
+	 * Set the bounds for the control
+	 */
+	void setBounds(const Rect &bounds) { _bounds = bounds; }
+
+	/**
+	 * Sets the flag for whether to draw a frame border around the control
+	 */
+	void setHasBorder(bool val) { _hasBorder = val; }
+
+	/**
+	 * Draw the control
+	 */
+	void draw(CScreenManager *screenManager);
+
+	void resize(uint count);
+
+	/**
+	 * Set the text
+	 */
+	void setText(const CString &str);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_TEXT_H */


Commit: 9317035ab7736818afa65deda34a9f4f47cc4590
    https://github.com/scummvm/scummvm/commit/9317035ab7736818afa65deda34a9f4f47cc4590
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:33-04:00

Commit Message:
TITANIC: Fix accidental rename in Makefile

Changed paths:
    engines/titanic/module.mk



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 65afeba..3a47bed 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -424,7 +424,7 @@ MODULE_OBJS := \
 	star_control/star_control_sub9.o \
 	star_control/star_control_sub10.o \
 	star_control/star_control_sub11.o \
-	star_control/star_control_text.o \
+	star_control/star_control_sub12.o \
 	star_control/star_control_sub13.o \
 	star_control/star_control_sub14.o \
 	star_control/star_control_sub15.o \


Commit: c74b975081b844f90c9d43230a31005934593ff4
    https://github.com/scummvm/scummvm/commit/c74b975081b844f90c9d43230a31005934593ff4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:34-04:00

Commit Message:
TITANIC: Implement CPetSection data table methods

Changed paths:
    engines/titanic/pet_control/pet_quit.cpp
    engines/titanic/pet_control/pet_section.cpp
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index 912789e..c31db26 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -46,6 +46,8 @@ bool CPetQuit::reset() {
 		return false;
 
 	setName("PetExit", pet);
+	uint v = getPetSection()->getDataIndex(0);
+
 	// TODO
 
 	return true;
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp
index f913ac6..3d26fc4 100644
--- a/engines/titanic/pet_control/pet_section.cpp
+++ b/engines/titanic/pet_control/pet_section.cpp
@@ -22,9 +22,22 @@
 
 #include "common/textconsole.h"
 #include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
+static const uint ARRAY1[6] = {
+	0xA7C0DB, 0x9CFFFE, 0x73AEFF, 0xA7C0DB, 0x9CFFFE, 0
+};
+
+static const uint ARRAY2[6] = {
+	0x10101, 0x1013C, 0xC80101, 0x10101, 0x800101, 0
+};
+
+static const uint ARRAY3[5] = {
+	0x10101, 0x1013C, 0xC80101, 0x10101, 0x800101
+};
+
 void CPetSection::displayMessage(const CString &msg) {
 	error("TODO");
 }
@@ -49,4 +62,21 @@ void CPetSection::proc30() {
 	error("TODO");
 }
 
+uint CPetSection::getDataIndex(int index) {
+	return getDataTable()[index];
+}
+
+const uint *CPetSection::getDataTable(int index) {
+	if (index == -1) {
+		CPetControl *pet = getPetControl();
+		index = pet ? pet->getState8() : 3;
+	}
+
+	switch (index) {
+	case 1: return ARRAY1;
+	case 2: return ARRAY2;
+	default: return ARRAY3;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 1227813..40a3151 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -159,6 +159,9 @@ public:
 	 * Get the PET control
 	 */
 	CPetControl *getPetControl() const { return _petControl; }
+
+	uint getDataIndex(int index);
+	const uint *getDataTable(int index = -1);
 };
 
 } // End of namespace Titanic


Commit: 5e16f0b6b3da1e06bb3bc25c65f6e10536760291
    https://github.com/scummvm/scummvm/commit/5e16f0b6b3da1e06bb3bc25c65f6e10536760291
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:35-04:00

Commit Message:
TITANIC: Implement CPetQuit reset method

Changed paths:
    engines/titanic/pet_control/pet_quit.cpp
    engines/titanic/pet_control/pet_quit.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index c31db26..c489fd9 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -46,9 +46,13 @@ bool CPetQuit::reset() {
 		return false;
 
 	setName("PetExit", pet);
-	uint v = getPetSection()->getDataIndex(0);
 
-	// TODO
+	uint col = getPetSection()->getDataIndex(0);	
+	_text.setText("Are you sure you want to quit?");
+	_text.setColor(0, col);
+
+	_btnYes.reset("PetQuitOut", pet, MODE_UNSELECTED);
+	_btnYes.reset("PetQuitIn", pet, MODE_SELECTED);
 
 	return true;
 }
diff --git a/engines/titanic/pet_control/pet_quit.h b/engines/titanic/pet_control/pet_quit.h
index c7843e2..e1551dc 100644
--- a/engines/titanic/pet_control/pet_quit.h
+++ b/engines/titanic/pet_control/pet_quit.h
@@ -32,7 +32,7 @@ namespace Titanic {
 class CPetQuit : public CPetGlyph {
 private:
 	CPetText _text;
-	CPetGfxElement _element;
+	CPetGfxElement _btnYes;
 public:
 	/**
 	 * Setup the glyph
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index ed297a8..cda637a 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -164,4 +164,8 @@ void CPetText::changeText(const CString &str) {
 	warning("TODO: CPetText::changeText");
 }
 
+void CPetText::setColor(int val1, int val2) {
+	warning("CPetText::setColor");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 2cd45c6..d43345c 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -109,6 +109,8 @@ public:
 	 * Set the text
 	 */
 	void setText(const CString &str);
+
+	void setColor(int val1, int val2);
 };
 
 } // End of namespace Titanic


Commit: a6e76530b248c6ad61aac0fc4496e126ca6cd77b
    https://github.com/scummvm/scummvm/commit/a6e76530b248c6ad61aac0fc4496e126ca6cd77b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:36-04:00

Commit Message:
TITANIC: Implement RealLife tab setup

Changed paths:
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_quit.cpp
    engines/titanic/pet_control/pet_quit.h
    engines/titanic/pet_control/pet_real_life.cpp
    engines/titanic/pet_control/pet_real_life.h
    engines/titanic/pet_control/pet_sound.h



diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index 48c853c..032e7fc 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -33,7 +33,7 @@ void CPetElement::getBounds(Rect *rect) {
 		*rect = Rect();
 }
 
-bool CPetElement::proc6(const Common::Point &pt) {
+bool CPetElement::proc6(const Point &pt) {
 	bool result = _bounds.contains(pt);
 	if (result)
 		setMode(MODE_SELECTED);
@@ -47,18 +47,18 @@ bool CPetElement::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	return result;
 }
 
-bool CPetElement::contains1(const Common::Point &pt) const {
+bool CPetElement::contains1(const Point &pt) const {
 	return _bounds.contains(pt);
 }
 
-int CPetElement::proc9(const Common::Point &pt) {
+int CPetElement::proc9(const Point &pt) {
 	bool result = _bounds.contains(pt);
 	if (result)
 		setMode(MODE_2);
 	return result;
 }
 
-bool CPetElement::contains2(const Common::Point &pt) const {
+bool CPetElement::contains2(const Point &pt) const {
 	return _bounds.contains(pt);
 }
 
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index a8f5000..8aec1fb 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -62,27 +62,27 @@ public:
 	/**
 	 * Draw the item
 	 */
-	virtual void draw(CScreenManager *screenManager, const Common::Point &destPos) {}
+	virtual void draw(CScreenManager *screenManager, const Point &destPos) {}
 
 	/**
 	 * Get the bounds for the element
 	 */
 	virtual void getBounds(Rect *rect);
 
-	virtual bool proc6(const Common::Point &pt);
+	virtual bool proc6(const Point &pt);
 	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 
 	/**
 	 * Returns whether the passed point falls inside the item
 	 */
-	virtual bool contains1(const Common::Point &pt) const;
+	virtual bool contains1(const Point &pt) const;
 
-	virtual int proc9(const Common::Point &pt);
+	virtual int proc9(const Point &pt);
 
 	/**
 	 * Returns whether the passed point falls inside the item
 	 */
-	virtual bool contains2(const Common::Point &pt) const;
+	virtual bool contains2(const Point &pt) const;
 
 	/**
 	 * Plays back a range of frames in the loaded video file for the element
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index b121a17..9e588bf 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -30,17 +30,17 @@ void CPetGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	_owner = owner;
 }
 
-void CPetGlyph::drawAt(CScreenManager *screenManager, int x, int y) {
-	_element.translate(x, y);
+void CPetGlyph::drawAt(CScreenManager *screenManager, const Point &pt) {
+	_element.translate(pt.x, pt.y);
 	_element.draw(screenManager);
-	_element.translate(-x, -y);
+	_element.translate(-pt.x, -pt.y);
 }
 
 void CPetGlyph::proc14() {
 	warning("TODO: CPetGlyph::proc14");
 }
 
-bool CPetGlyph::translateContains(const Point &delta, const Point &pt) {
+bool CPetGlyph::contains(const Point &delta, const Point &pt) {
 	translate(delta);
 	bool result = _element.contains2(pt);
 	translateBack(delta);
@@ -138,7 +138,7 @@ void CPetGlyphs::draw(CScreenManager *screenManager) {
 
 			if (glyph) {
 				// TODO: Comparison with highlighted index, and a redundant push?
-				glyph->drawAt(screenManager, pt.x, pt.y);
+				glyph->drawAt(screenManager, pt);
 			}
 		}
 	}
@@ -153,7 +153,7 @@ void CPetGlyphs::draw(CScreenManager *screenManager) {
 	if (_highlightIndex != -1) {
 		CPetGlyph *glyph = getGlyph(_highlightIndex);
 		if (glyph)
-			glyph->drawHighlight();
+			glyph->draw2(screenManager);
 	}
 }
 
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 2360bfa..48351c9 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -33,6 +33,7 @@ namespace Titanic {
 
 class CPetGlyphs;
 class CPetSection;
+class CPetText;
 
 enum GlyphActionMode { ACTION_REMOVE = 0, ACTION_REMOVED = 1, ACTION_CHANGE = 2 };
 
@@ -92,15 +93,14 @@ public:
 	virtual void proc11() {}
 
 	/**
-	 * Draw the glyph at a translated position without permanently
-	 * changing the position
+	 * Draw the glyph at a specified position
 	 */
-	virtual void drawAt(CScreenManager *screenManager, int x, int y);
+	virtual void drawAt(CScreenManager *screenManager, const Point &pt);
 
 	/**
-	 * Handles any secondary drawing of a glyph as highlighted
+	 * Handles any secondary drawing of the glyph
 	 */
-	virtual void drawHighlight() {}
+	virtual void draw2(CScreenManager *screenManager) {}
 
 	virtual void proc14();
 
@@ -113,7 +113,7 @@ public:
 	virtual int proc17() { return 0; }
 	virtual int proc18() { return 0; }
 	virtual int proc19() { return 0; }
-	virtual int proc20() { return 0; }
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return false; }
 	virtual int proc21() { return 0; }
 	virtual int proc22() { return 0; }
 	virtual int proc23() { return 0; }
@@ -125,12 +125,16 @@ public:
 	virtual int proc29() { return 0; }
 
 	/**
-	 * Returns true if the glyph's bounds, shifted by a given delta,
+	 * Returns true if the glyph's bounds, shifted to a given position,
 	 * will contain the specified point
 	 */
-	virtual bool translateContains(const Point &delta, const Point &pt);
+	virtual bool contains(const Point &delta, const Point &pt);
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text) {}
 
-	virtual void proc31() {}
 	virtual void proc32() {}
 
 	virtual int proc33() { return 1; }
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 9a3ee83..063f019 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -148,7 +148,7 @@ int CPetInventory::getItemIndex(CGameObject *item) const {
 CGameObject *CPetInventory::getImage(int index) {
 	if (index >= 0 && index < 46) {
 		int offset = index - 20;
-		int bits;
+		int bits = 0;
 		switch (offset) {
 		case 0:
 			bits = 4;
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index c489fd9..562a63f 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -21,8 +21,10 @@
  */
 
 #include "titanic/pet_control/pet_quit.h"
+#include "titanic/pet_control/pet_control.h"
 #include "titanic/pet_control/pet_real_life.h"
 #include "titanic/support/rect.h"
+#include "titanic/game_manager.h"
 
 namespace Titanic {
 
@@ -57,4 +59,29 @@ bool CPetQuit::reset() {
 	return true;
 }
 
+void CPetQuit::draw2(CScreenManager *screenManager) {
+	_text.draw(screenManager);
+	_btnYes.draw(screenManager);
+}
+
+bool CPetQuit::proc16(const Point &pt) {
+	return !_btnYes.proc6(pt);
+}
+
+bool CPetQuit::mouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	CPetControl *pet = getPetControl();
+	if (_btnYes.MouseButtonDownMsg(msg) && pet) {
+		CGameManager *gameManager = pet->getGameManager();
+		if (gameManager)
+			gameManager->_gameState._quitGame = true;
+		return true;
+	} else {
+		return false;
+	}
+}
+
+void CPetQuit::getTooltip(CPetText *text) {
+	text->setText("Quit the game.");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_quit.h b/engines/titanic/pet_control/pet_quit.h
index e1551dc..ca207f6 100644
--- a/engines/titanic/pet_control/pet_quit.h
+++ b/engines/titanic/pet_control/pet_quit.h
@@ -43,6 +43,20 @@ public:
 	 * Reset the glyph
 	 */
 	virtual bool reset();
+
+	/**
+	 * Handles any secondary drawing of the glyph
+	 */
+	virtual void draw2(CScreenManager *screenManager);
+
+	virtual bool proc16(const Point &pt);
+
+	virtual bool mouseButtonDownMsg(CMouseButtonDownMsg *msg);
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
index 0c7c4bd..8d439e9 100644
--- a/engines/titanic/pet_control/pet_real_life.cpp
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -22,6 +22,10 @@
 
 #include "titanic/pet_control/pet_real_life.h"
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/pet_control/pet_load.h"
+#include "titanic/pet_control/pet_save.h"
+#include "titanic/pet_control/pet_sound.h"
+#include "titanic/pet_control/pet_quit.h"
 
 namespace Titanic {
 
@@ -43,15 +47,34 @@ void CPetRealLife::draw(CScreenManager *screenManager) {
 
 bool CPetRealLife::setupControl(CPetControl *petControl) {
 	if (petControl) {
+		_petControl = petControl;
+		_glyphs.setup(4, this);
+		_glyphs.set20(6);
 
+		addButton(new CPetLoad());
+		addButton(new CPetSave());
+		addButton(new CPetSound());
+		addButton(new CPetQuit());
+
+		Rect textRect(0, 0, 32, 436);
+		textRect.moveTo(32, 436);
+		_text.setBounds(textRect);
+		_text.setHasBorder(false);
+		_text.setup();
 	}
 
 	return true;
 }
 
+void CPetRealLife::addButton(CPetGlyph *glyph) {
+
+}
+
 bool CPetRealLife::isValid(CPetControl *petControl) {
 	setupControl(petControl);
 	return true;
 }
 
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_real_life.h b/engines/titanic/pet_control/pet_real_life.h
index 6281735..c4c597c 100644
--- a/engines/titanic/pet_control/pet_real_life.h
+++ b/engines/titanic/pet_control/pet_real_life.h
@@ -41,6 +41,11 @@ private:
 	 * Does setup
 	 */
 	bool setupControl(CPetControl *petControl);
+
+	/**
+	 * Adds one of the four button glyphs for display
+	 */
+	void addButton(CPetGlyph *glyph);
 public:
 	virtual ~CPetRealLife() {}
 
diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h
index d0a0fe1..fcd8e9a 100644
--- a/engines/titanic/pet_control/pet_sound.h
+++ b/engines/titanic/pet_control/pet_sound.h
@@ -29,10 +29,8 @@
 
 namespace Titanic {
 
-class CPetQuit : public CPetGlyph {
+class CPetSound : public CPetGlyph {
 private:
-	CPetControlSub12 _sub12;
-	CPetGfxElement _element;
 public:
 };
 


Commit: a8f8e4b69eab768f38d5cd73ceecce03bd096a4d
    https://github.com/scummvm/scummvm/commit/a8f8e4b69eab768f38d5cd73ceecce03bd096a4d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:37-04:00

Commit Message:
TITANIC: Clarified UI color methods & tables

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_quit.cpp
    engines/titanic/pet_control/pet_quit.h
    engines/titanic/pet_control/pet_real_life.cpp
    engines/titanic/pet_control/pet_section.cpp
    engines/titanic/pet_control/pet_section.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 9e588bf..4669a1f 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -25,9 +25,10 @@
 
 namespace Titanic {
 
-void CPetGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+bool CPetGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	_element.setBounds(Rect(0, 0, 52, 50));
 	_owner = owner;
+	return true;
 }
 
 void CPetGlyph::drawAt(CScreenManager *screenManager, const Point &pt) {
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 48351c9..adc7ceb 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -82,7 +82,7 @@ public:
 	/**
 	 * Setup the glyph
 	 */
-	virtual void setup(CPetControl *petControl, CPetGlyphs *owner);
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
 
 	/**
 	 * Reset the glyph
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index 562a63f..c3d6e4e 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -28,7 +28,7 @@
 
 namespace Titanic {
 
-void CPetQuit::setup(CPetControl *petControl, CPetGlyphs *owner) {
+bool CPetQuit::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	CPetGlyph::setup(petControl, owner);
 	Rect tempRect(0, 0, 280, 16);
 	tempRect.moveTo(32, 407);
@@ -40,6 +40,8 @@ void CPetQuit::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	Rect elementRect(0, 0, 496, 388);
 	elementRect.moveTo(496, 388);
 	_element.setBounds(elementRect);
+	
+	return true;
 }
 
 bool CPetQuit::reset() {
@@ -49,7 +51,7 @@ bool CPetQuit::reset() {
 
 	setName("PetExit", pet);
 
-	uint col = getPetSection()->getDataIndex(0);	
+	uint col = getPetSection()->getColor(0);	
 	_text.setText("Are you sure you want to quit?");
 	_text.setColor(0, col);
 
diff --git a/engines/titanic/pet_control/pet_quit.h b/engines/titanic/pet_control/pet_quit.h
index ca207f6..213ed45 100644
--- a/engines/titanic/pet_control/pet_quit.h
+++ b/engines/titanic/pet_control/pet_quit.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Setup the glyph
 	 */
-	virtual void setup(CPetControl *petControl, CPetGlyphs *owner);
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
 
 	/**
 	 * Reset the glyph
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
index 8d439e9..38b7125 100644
--- a/engines/titanic/pet_control/pet_real_life.cpp
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -36,6 +36,11 @@ bool CPetRealLife::setup(CPetControl *petControl) {
 }
 
 bool CPetRealLife::reset() {
+	_glyphs.reset();
+	uint col = getColor(0);
+	_text.setColor(col);
+	_text.setColor(0, col);
+
 	return true;
 }
 
@@ -67,7 +72,10 @@ bool CPetRealLife::setupControl(CPetControl *petControl) {
 }
 
 void CPetRealLife::addButton(CPetGlyph *glyph) {
-
+	if (glyph) {
+		if (glyph->setup(_petControl, &_glyphs))
+			_glyphs.push_back(glyph);
+	}
 }
 
 bool CPetRealLife::isValid(CPetControl *petControl) {
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp
index 3d26fc4..a41118b 100644
--- a/engines/titanic/pet_control/pet_section.cpp
+++ b/engines/titanic/pet_control/pet_section.cpp
@@ -26,15 +26,15 @@
 
 namespace Titanic {
 
-static const uint ARRAY1[6] = {
+static const uint PALETTE1[6] = {
 	0xA7C0DB, 0x9CFFFE, 0x73AEFF, 0xA7C0DB, 0x9CFFFE, 0
 };
 
-static const uint ARRAY2[6] = {
+static const uint PALETTE2[6] = {
 	0x10101, 0x1013C, 0xC80101, 0x10101, 0x800101, 0
 };
 
-static const uint ARRAY3[5] = {
+static const uint PALETTE3[5] = {
 	0x10101, 0x1013C, 0xC80101, 0x10101, 0x800101
 };
 
@@ -62,20 +62,20 @@ void CPetSection::proc30() {
 	error("TODO");
 }
 
-uint CPetSection::getDataIndex(int index) {
-	return getDataTable()[index];
+uint CPetSection::getColor(uint index) {
+	return getColorTable()[index];
 }
 
-const uint *CPetSection::getDataTable(int index) {
-	if (index == -1) {
+const uint *CPetSection::getColorTable(int tableNum) {
+	if (tableNum == -1) {
 		CPetControl *pet = getPetControl();
-		index = pet ? pet->getState8() : 3;
+		tableNum = pet ? pet->getState8() : 3;
 	}
 
-	switch (index) {
-	case 1: return ARRAY1;
-	case 2: return ARRAY2;
-	default: return ARRAY3;
+	switch (tableNum) {
+	case 1: return PALETTE1;
+	case 2: return PALETTE2;
+	default: return PALETTE3;
 	}
 }
 
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 40a3151..6cc1c10 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -160,8 +160,16 @@ public:
 	 */
 	CPetControl *getPetControl() const { return _petControl; }
 
-	uint getDataIndex(int index);
-	const uint *getDataTable(int index = -1);
+	/**
+	 * Get a specified color in the currently active UI color table
+	 */
+	uint getColor(uint index);
+	
+	/**
+	 * Get one of the game's three UI color tables. If the default
+	 * tableNum of -1 is used, the table is taken from the game state
+	 */
+	const uint *getColorTable(int tableNum = -1);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index cda637a..af00473 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -25,12 +25,12 @@
 namespace Titanic {
 
 CPetText::CPetText(uint count) :
-	_stringsMerged(false), _field30(-1), _lineCount(0), _field38(-1),
-	_field3C(0), _field40(0), _field44(0), _backR(0xff),
-	_backG(0xff), _backB(0xff), _field54(0), _field58(0),
-	_field5C(200), _field60(0), _field64(0), _field68(0),
-	_field6C(0), _hasBorder(true), _field74(0), _field78(0),
-	_field7C(0) {
+		_stringsMerged(false), _field30(-1), _lineCount(0),
+		_field38(-1), _field3C(0), _field40(0), _field44(0),
+		_backR(0xff), _backG(0xff), _backB(0xff), 
+		_textR(0), _textG(0), _textB(200),
+		_field60(0), _field64(0), _field68(0), _field6C(0),
+		_hasBorder(true), _field74(0), _field78(0), _field7C(0) {
 	setupArrays(count);
 }
 
@@ -48,7 +48,7 @@ void CPetText::freeArrays() {
 void CPetText::setup() {
 	for (int idx = 0; idx < (int)_array.size(); ++idx) {
 		_array[idx]._string1.clear();
-		setArrayStr2(idx, _field54, _field58, _field5C);
+		setArrayStr2(idx, _textR, _textG, _textB);
 		_array[idx]._string3.clear();
 	}
 
@@ -89,9 +89,9 @@ void CPetText::load(SimpleFile *file, int param) {
 		_backR = file->readNumber();
 		_backG = file->readNumber();
 		_backB = file->readNumber();
-		_field54 = file->readNumber();
-		_field58 = file->readNumber();
-		_field5C = file->readNumber();
+		_textR = file->readNumber();
+		_textG = file->readNumber();
+		_textB = file->readNumber();
 		_hasBorder = file->readNumber() != 0;
 		_field74 = file->readNumber();
 
@@ -164,8 +164,14 @@ void CPetText::changeText(const CString &str) {
 	warning("TODO: CPetText::changeText");
 }
 
-void CPetText::setColor(int val1, int val2) {
+void CPetText::setColor(int val1, uint col) {
 	warning("CPetText::setColor");
 }
 
+void CPetText::setColor(uint col) {
+	_textR = col & 0xff;
+	_textG = (col >> 8) & 0xff;
+	_textB = (col >> 16) & 0xff;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index d43345c..55416fd 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -48,9 +48,9 @@ private:
 	int _backR;
 	int _backG;
 	int _backB;
-	int _field54;
-	int _field58;
-	int _field5C;
+	int _textR;
+	int _textG;
+	int _textB;
 	int _field60;
 	int _field64;
 	int _field68;
@@ -110,7 +110,15 @@ public:
 	 */
 	void setText(const CString &str);
 
-	void setColor(int val1, int val2);
+	/**
+	 * Set text color
+	 */
+	void setColor(int val1, uint col);
+
+	/**
+	 * Set text color
+	 */
+	void setColor(uint col);
 };
 
 } // End of namespace Titanic


Commit: b398a5001bb128c5e53d6ac5426b926de6b73893
    https://github.com/scummvm/scummvm/commit/b398a5001bb128c5e53d6ac5426b926de6b73893
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:38-04:00

Commit Message:
TITANIC: Implementing CPetLoad and CPetSave

Changed paths:
    engines/titanic/core/game_object.h
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_load.cpp
    engines/titanic/pet_control/pet_load.h
    engines/titanic/pet_control/pet_load_save.cpp
    engines/titanic/pet_control/pet_load_save.h
    engines/titanic/pet_control/pet_quit.cpp
    engines/titanic/pet_control/pet_quit.h
    engines/titanic/pet_control/pet_save.cpp
    engines/titanic/pet_control/pet_save.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index b987606..94c3e54 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -107,11 +107,6 @@ protected:
 	void makeDirty(const Rect &r);
 
 	/**
-	 * Marks the area occupied by the object as dirty, requiring re-rendering
-	 */
-	void makeDirty();
-
-	/**
 	 * Sets a new area in the PET
 	 */
 	void setPetArea(PetArea newArea) const;
@@ -321,6 +316,11 @@ public:
 	 * Returns the object's frame number
 	 */
 	int getFrameNumber() const { return _frameNumber; }
+
+	/**
+	 * Marks the area occupied by the object as dirty, requiring re-rendering
+	 */
+	void makeDirty();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index 032e7fc..db6b122 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -33,7 +33,7 @@ void CPetElement::getBounds(Rect *rect) {
 		*rect = Rect();
 }
 
-bool CPetElement::proc6(const Point &pt) {
+bool CPetElement::highlightBounds(const Point &pt) {
 	bool result = _bounds.contains(pt);
 	if (result)
 		setMode(MODE_SELECTED);
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index 8aec1fb..7ee2836 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -69,7 +69,14 @@ public:
 	 */
 	virtual void getBounds(Rect *rect);
 
-	virtual bool proc6(const Point &pt);
+	/**
+	 * Highlights the element if the cursor is on it
+	 */
+	virtual bool highlightBounds(const Point &pt);
+
+	/**
+	 * Handles processing mouse button messages
+	 */
 	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 
 	/**
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index adc7ceb..9d2f283 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_PET_GLYPHS_H
 #define TITANIC_PET_GLYPHS_H
 
+#include "common/keyboard.h"
 #include "titanic/core/list.h"
 #include "titanic/pet_control/pet_gfx_element.h"
 #include "titanic/support/rect.h"
@@ -109,17 +110,41 @@ public:
 	 */
 	virtual Rect getBounds() { return Rect(); }
 
-	virtual int proc16() { return 0; }
+	/**
+	 * Checks and updates any highlight of the glyph or any contextual
+	 * information it displays
+	 */
+	virtual bool checkHighlight(const Point &pt) { return false; }
+
 	virtual int proc17() { return 0; }
 	virtual int proc18() { return 0; }
 	virtual int proc19() { return 0; }
+
+	/**
+	 * Handles mouse button messages
+	 */
 	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return false; }
+	
 	virtual int proc21() { return 0; }
 	virtual int proc22() { return 0; }
-	virtual int proc23() { return 0; }
+
+	/**
+	 * Handles keypresses when the glyph is focused
+	 */
+	virtual bool KeyCharMsg(Common::KeyCode key) { return false; }
+	
 	virtual int proc24() { return 0; }
-	virtual void proc25() {}
-	virtual void proc26() {}
+
+	/**
+	 * Unhighlight any currently highlighted element
+	 */
+	virtual void unhighlightCurrent() {}
+
+	/**
+	 * Highlight any currently highlighted element
+	 */
+	virtual void highlightCurrent() {}
+
 	virtual void proc27() {}
 	virtual void proc28() {}
 	virtual int proc29() { return 0; }
diff --git a/engines/titanic/pet_control/pet_load.cpp b/engines/titanic/pet_control/pet_load.cpp
index 1008425..f4be690 100644
--- a/engines/titanic/pet_control/pet_load.cpp
+++ b/engines/titanic/pet_control/pet_load.cpp
@@ -21,8 +21,29 @@
  */
 
 #include "titanic/pet_control/pet_load.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
+bool CPetLoad::reset() {
+	CPetLoadSave::reset();
+	
+	CPetControl *pet = getPetControl();
+	if (pet) {
+		setName("PetLoad", pet);
+		_btnLoadSave.reset("PetLoadOut", pet, MODE_UNSELECTED);
+		_btnLoadSave.reset("PetLoadIn", pet, MODE_SELECTED);
+	}
+
+	return true;
+}
+
+void CPetLoad::getTooltip(CPetText *text) {
+	text->setText("Load the game.");
+}
+
+void CPetLoad::execute() {
+	warning("TODO: CPetLoad::execute");
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_load.h b/engines/titanic/pet_control/pet_load.h
index 297cb97..093fca0 100644
--- a/engines/titanic/pet_control/pet_load.h
+++ b/engines/titanic/pet_control/pet_load.h
@@ -28,6 +28,37 @@
 namespace Titanic {
 
 class CPetLoad : public CPetLoadSave {
+public:
+	/**
+	 * Reset the glyph
+	 */
+	virtual bool reset();
+	
+	/**
+	 * Highlight any currently highlighted element
+	 */
+	virtual void highlightCurrent() { resetSlots(); }
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+
+	/**
+	 * Highlights a save slot
+	 */
+	virtual void highlightSave(int index) {}
+
+	/**
+	 * Unhighlight a save slot
+	 */
+	virtual void unhighlightSave(int index) {}
+
+	/**
+	 * Executes the loading or saving
+	 */
+	virtual void execute();
+
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_load_save.cpp b/engines/titanic/pet_control/pet_load_save.cpp
index 7660b71..4ebe9d0 100644
--- a/engines/titanic/pet_control/pet_load_save.cpp
+++ b/engines/titanic/pet_control/pet_load_save.cpp
@@ -21,8 +21,163 @@
  */
 
 #include "titanic/pet_control/pet_load_save.h"
+#include "titanic/pet_control/pet_control.h"
+#include "titanic/core/project_item.h"
 
 namespace Titanic {
 
+int CPetLoadSave::_savegameSlotNum;
+
+bool CPetLoadSave::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CPetGlyph::setup(petControl, owner);
+	_savegameSlotNum = -1;
+
+	for (int idx = 0; idx < SAVEGAME_SLOTS_COUNT; ++idx) {
+		Rect slotRect = getSlotBounds(idx);
+		_slotNames[idx].setBounds(slotRect);
+		_slotNames[idx].resize(3);
+		_slotNames[idx].set30(22);
+		_slotNames[idx].setHasBorder(false);
+		_slotNames[idx].setup();
+	}
+
+	Rect r1(0, 0, 68, 52);
+	r1.moveTo(496, 388);
+	_btnLoadSave.setBounds(r1);
+
+	Rect r2(0, 0, 168, 78);
+	r2.moveTo(309, 377);
+	_gutter.setBounds(r2);
+	return true;
+}
+
+bool CPetLoadSave::reset() {
+	highlightChange();
+
+	CPetControl *pet = getPetControl();
+	if (pet) {
+		_gutter.reset("PetSaveGutter", pet, MODE_UNSELECTED);
+	}
+
+	return true;
+}
+
+void CPetLoadSave::draw2(CScreenManager *screenManager) {
+	_gutter.draw(screenManager);
+
+	for (int idx = 0; idx < SAVEGAME_SLOTS_COUNT; ++idx)
+		_slotNames[idx].draw(screenManager);
+
+	_btnLoadSave.draw(screenManager);
+}
+
+bool CPetLoadSave::checkHighlight(const Point &pt) {
+	if (_btnLoadSave.highlightBounds(pt))
+		return true;
+	
+	checkSlotsHighlight(pt);
+	return false;
+}
+
+bool CPetLoadSave::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	if (_btnLoadSave.MouseButtonDownMsg(msg)) {
+		execute();
+		resetSlots();
+		return true;
+	} else {
+		return false;
+	}
+}
+
+bool CPetLoadSave::KeyCharMsg(Common::KeyCode key) {
+	switch (key) {
+	case Common::KEYCODE_TAB:
+	case Common::KEYCODE_DOWN:
+	case Common::KEYCODE_KP2:
+		if (_savegameSlotNum != -1) {
+			highlightSlot((_savegameSlotNum + 1) % 5);
+			getPetControl()->makeDirty();
+		}
+		return true;
+
+	case Common::KEYCODE_UP:
+	case Common::KEYCODE_KP8:
+		if (_savegameSlotNum != -1) {
+			int slotNum = --_savegameSlotNum;			
+			highlightSlot((slotNum == -1) ? SAVEGAME_SLOTS_COUNT - 1 : slotNum);
+			getPetControl()->makeDirty();
+		}
+		return true;
+
+	case Common::KEYCODE_RETURN:
+	case Common::KEYCODE_KP_ENTER:
+		execute();
+		return true;
+
+	default:
+		return false;
+	}
+}
+
+Rect CPetLoadSave::getSlotBounds(int index) {
+	return Rect(323, 376 + index * 16, 473, 392 + index * 16);
+}
+
+void CPetLoadSave::resetSlots() {
+	CPetControl *pet = getPetControl();
+	CProjectItem *project = pet ? pet->getRoot() : nullptr;
+
+	for (int idx = 0; idx < SAVEGAME_SLOTS_COUNT; ++idx) {
+		_slotNames[idx].setText("Empty");
+
+		if (project) {
+			warning("TODO: Get savegame name");
+		}
+	}
+
+	highlightSlot(_savegameSlotNum);
+}
+
+void CPetLoadSave::highlightSlot(int index) {
+	unhighlightSave(_savegameSlotNum);
+	_savegameSlotNum = index;
+	highlightChange();
+	highlightSave(_savegameSlotNum);
+}
+
+void CPetLoadSave::highlightChange() {
+	CPetSection *section = getPetSection();
+
+	uint col = section ? section->getColor(3) : 0;
+	for (int idx = 0; idx < SAVEGAME_SLOTS_COUNT; ++idx)
+		_slotNames[idx].setColor(col);
+
+	// TODO: Unknown if check
+	if (true) {
+		col = section ? section->getColor(4) : 0;
+		_slotNames[_savegameSlotNum].setColor(0, col);
+	}
+}
+
+bool CPetLoadSave::checkSlotsHighlight(const Point &pt) {
+	for (int idx = 0; idx < SAVEGAME_SLOTS_COUNT; ++idx) {
+		if (isSlotHighlighted(idx, pt)) {
+			highlightSlot(idx);
+			return true;
+		}
+	}
+
+	return false;
+}
+
+bool CPetLoadSave::isSlotHighlighted(int index, const Point &pt) {
+	Rect r = getSlotBounds(index);
+	if (r.contains(pt)) {
+		highlightSlot(index);
+		return true;
+	} else {
+		return false;
+	}
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_load_save.h b/engines/titanic/pet_control/pet_load_save.h
index 780fd75..ef7e54a 100644
--- a/engines/titanic/pet_control/pet_load_save.h
+++ b/engines/titanic/pet_control/pet_load_save.h
@@ -24,14 +24,96 @@
 #define TITANIC_PET_LOAD_SAVE_H
 
 #include "titanic/pet_control/pet_glyphs.h"
+#include "titanic/pet_control/pet_text.h"
 
 namespace Titanic {
 
+#define SAVEGAME_SLOTS_COUNT 5
+
 class CPetLoadSave : public CPetGlyph {
+private:
+	/**
+	 * Get the rect area for a given savegame name will be displayed in
+	 */
+	Rect getSlotBounds(int index);
+
+	/**
+	 * Highlight one of the slots
+	 */
+	void highlightSlot(int index);
+
+	/**
+	 * Called when savegame slot highlight changes or the view is reset
+	 */
+	void highlightChange();
+
+	/**
+	 * Check for whether a slot is under the passed point
+	 */
+	bool checkSlotsHighlight(const Point &pt);
+
+	/**
+	 * Checks if a point is within a given saveame slot
+	 */
+	bool isSlotHighlighted(int index, const Point &pt);
+protected:
+	CPetText _slotNames[SAVEGAME_SLOTS_COUNT];
+	CPetGfxElement _btnLoadSave;
+	CPetGfxElement _gutter;
+	static int _savegameSlotNum;
 protected:
-	CPetGfxElement _element1;
-	CPetGfxElement _element2;
+	/**
+	 * Reset the slot names list
+	 */
+	void resetSlots();
 public:
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Reset the glyph
+	 */
+	virtual bool reset();
+
+	/**
+	 * Handles any secondary drawing of the glyph
+	 */
+	virtual void draw2(CScreenManager *screenManager);
+
+	/**
+	 * Checks and updates any highlight of the glyph or any contextual
+	 * information it displays
+	 */
+	virtual bool checkHighlight(const Point &pt);
+
+	/**
+	 * Handles mouse button messages
+	 */
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+
+	/**
+	 * Handles keypresses when the glyph is focused
+	 */
+	virtual bool KeyCharMsg(Common::KeyCode key);
+
+	virtual void resetSaves() { resetSlots(); }
+
+	/**
+	 * Highlights a save slot
+	 */
+	virtual void highlightSave(int index) = 0;
+
+	/**
+	 * Unhighlight a save slot
+	 */
+	virtual void unhighlightSave(int index) = 0;
+
+	/**
+	 * Executes the loading or saving
+	 */
+	virtual void execute() = 0;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index c3d6e4e..be7257f 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -66,8 +66,8 @@ void CPetQuit::draw2(CScreenManager *screenManager) {
 	_btnYes.draw(screenManager);
 }
 
-bool CPetQuit::proc16(const Point &pt) {
-	return !_btnYes.proc6(pt);
+bool CPetQuit::checkHighlight(const Point &pt) {
+	return !_btnYes.highlightBounds(pt);
 }
 
 bool CPetQuit::mouseButtonDownMsg(CMouseButtonDownMsg *msg) {
diff --git a/engines/titanic/pet_control/pet_quit.h b/engines/titanic/pet_control/pet_quit.h
index 213ed45..cfe3e6f 100644
--- a/engines/titanic/pet_control/pet_quit.h
+++ b/engines/titanic/pet_control/pet_quit.h
@@ -49,7 +49,11 @@ public:
 	 */
 	virtual void draw2(CScreenManager *screenManager);
 
-	virtual bool proc16(const Point &pt);
+	/**
+	 * Checks and updates any highlight of the glyph or any contextual
+	 * information it displays
+	 */
+	virtual bool checkHighlight(const Point &pt);
 
 	virtual bool mouseButtonDownMsg(CMouseButtonDownMsg *msg);
 
diff --git a/engines/titanic/pet_control/pet_save.cpp b/engines/titanic/pet_control/pet_save.cpp
index d8835e1..a2e458b 100644
--- a/engines/titanic/pet_control/pet_save.cpp
+++ b/engines/titanic/pet_control/pet_save.cpp
@@ -21,7 +21,37 @@
  */
 
 #include "titanic/pet_control/pet_save.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
+bool CPetSave::reset() {
+	CPetLoadSave::reset();
+	
+	CPetControl *pet = getPetControl();
+	if (pet) {
+		setName("PetSave", pet);
+		_btnLoadSave.reset("PetSaveOut", pet, MODE_UNSELECTED);
+		_btnLoadSave.reset("PetSaveIn", pet, MODE_SELECTED);
+	}
+
+	return true;
+}
+
+void CPetSave::getTooltip(CPetText *text) {
+	text->setText("Save the game.");
+}
+
+void CPetSave::highlightSave(int index) {
+	warning("TODO: CPetSave::highlightSave");
+}
+
+void CPetSave::unhighlightSave(int index) {
+	warning("TODO: CPetSave::unhighlightSave");
+}
+
+void CPetSave::execute() {
+	warning("TODO: CPetSave::execute");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_save.h b/engines/titanic/pet_control/pet_save.h
index 21e59cb..006b2cd 100644
--- a/engines/titanic/pet_control/pet_save.h
+++ b/engines/titanic/pet_control/pet_save.h
@@ -28,6 +28,41 @@
 namespace Titanic {
 
 class CPetSave : public CPetLoadSave {
+public:
+	/**
+	 * Reset the glyph
+	 */
+	virtual bool reset();
+
+	/**
+	 * Unhighlight any currently highlighted element
+	 */
+	virtual void unhighlightCurrent() { unhighlightSave(_savegameSlotNum); }
+
+	/**
+	 * Highlight any currently highlighted element
+	 */
+	virtual void highlightCurrent() { highlightSave(_savegameSlotNum); }
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+
+	/**
+	 * Highlights a save slot
+	 */
+	virtual void highlightSave(int index);
+
+	/**
+	 * Unhighlight a save slot
+	 */
+	virtual void unhighlightSave(int index);
+
+	/**
+	 * Executes the loading or saving
+	 */
+	virtual void execute();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index af00473..faa25d0 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -174,4 +174,9 @@ void CPetText::setColor(uint col) {
 	_textB = (col >> 16) & 0xff;
 }
 
+void CPetText::set30(int val) {
+	if (val >= -1 && val < 257)
+		_field30 = val;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 55416fd..1770711 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -119,6 +119,8 @@ public:
 	 * Set text color
 	 */
 	void setColor(uint col);
+
+	void set30(int val);
 };
 
 } // End of namespace Titanic


Commit: 282ed45c77e81f1a5d2f0663c516d455dd7a8032
    https://github.com/scummvm/scummvm/commit/282ed45c77e81f1a5d2f0663c516d455dd7a8032
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:39-04:00

Commit Message:
TITANIC: Beginnings of CPetSound

Changed paths:
    engines/titanic/pet_control/pet_slider.h
    engines/titanic/pet_control/pet_sound.cpp
    engines/titanic/pet_control/pet_sound.h



diff --git a/engines/titanic/pet_control/pet_slider.h b/engines/titanic/pet_control/pet_slider.h
index acad55c..b3ba60f 100644
--- a/engines/titanic/pet_control/pet_slider.h
+++ b/engines/titanic/pet_control/pet_slider.h
@@ -24,6 +24,7 @@
 #define TITANIC_PET_SLIDER_H
 
 #include "titanic/support/rect.h"
+#include "titanic/support/string.h"
 
 namespace Titanic {
 
@@ -46,7 +47,12 @@ public:
 	virtual void proc1() {}
 	virtual void proc2() {}
 	virtual void proc3() {}
-	virtual void proc4() {}
+
+	/**
+	 * Reset the slider
+	 */
+	virtual void reset(const CString &name) {}
+	
 	virtual void proc5() {}
 	virtual void proc6() {}
 	
diff --git a/engines/titanic/pet_control/pet_sound.cpp b/engines/titanic/pet_control/pet_sound.cpp
index b236b1a..6c6c2ea 100644
--- a/engines/titanic/pet_control/pet_sound.cpp
+++ b/engines/titanic/pet_control/pet_sound.cpp
@@ -20,10 +20,39 @@
  *
  */
 
-#include "titanic/pet_control/pet_real_life.h"
+#include "titanic/pet_control/pet_sound.h"
 #include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
+CPetSound::CPetSound() : CPetGlyph(), _field198(0), _field19C(0) {
+}
+
+bool CPetSound::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CPetGlyph::setup(petControl, owner);
+	// TODO
+
+	return true;
+}
+
+bool CPetSound::reset() {
+	CPetControl *pet = getPetControl();
+	if (pet) {
+		setName("PetSound", pet);
+		_element.reset("PetVolChannels", pet, MODE_UNSELECTED);
+		_slider1.reset("PetVolSlug");
+		_slider2.reset("PetVolSlug");
+		_slider3.reset("PetVolSlug");
+		_slider4.reset("PetVolSlug");
+
+		CPetSection *section = getPetSection();
+		uint col = section->getColor(0);
+		for (int idx = 0; idx < 4; ++idx)
+			_text[idx].setColor(0, col);
+	}
+
+	return false;
+}
+
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h
index fcd8e9a..e52ccca 100644
--- a/engines/titanic/pet_control/pet_sound.h
+++ b/engines/titanic/pet_control/pet_sound.h
@@ -26,12 +26,32 @@
 #include "titanic/pet_control/pet_glyphs.h"
 #include "titanic/pet_control/pet_gfx_element.h"
 #include "titanic/pet_control/pet_text.h"
+#include "titanic/pet_control/pet_slider.h"
 
 namespace Titanic {
 
 class CPetSound : public CPetGlyph {
 private:
+	CPetGfxElement _element;
+	CPetSlider _slider1;
+	CPetSlider _slider2;
+	CPetSlider _slider3;
+	CPetSlider _slider4;
+	CPetText _text[4];
+	int _field198;
+	int _field19C;
 public:
+	CPetSound();
+
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Reset the glyph
+	 */
+	virtual bool reset();
 };
 
 } // End of namespace Titanic


Commit: e4bc0b260155009918efa736f4f859571ebd671e
    https://github.com/scummvm/scummvm/commit/e4bc0b260155009918efa736f4f859571ebd671e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:40-04:00

Commit Message:
TITANIC: Fix horizontal placement of PET glyphs

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 4669a1f..af4679f 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -159,7 +159,7 @@ void CPetGlyphs::draw(CScreenManager *screenManager) {
 }
 
 Point CPetGlyphs::getPosition(int index) {
-	Point tempPoint(37 + index * 58, 375);
+	Point tempPoint(37 + index * 70, 375);
 	return tempPoint;
 }
 


Commit: 48e9387f2dacc09fff656d8c493a048c520a5c13
    https://github.com/scummvm/scummvm/commit/48e9387f2dacc09fff656d8c493a048c520a5c13
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:42-04:00

Commit Message:
TITANIC: Fix placement of PET glyphs scroll buttons

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index af4679f..eedd94d 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -85,7 +85,7 @@ void CPetGlyphs::setup(int numVisible, CPetSection *owner) {
 	_owner = owner;
 	_selection.setBounds(Rect(0, 0, 76, 76));
 
-	int buttonsLeft = numVisible * 7 * 5 + 21;
+	int buttonsLeft = numVisible * 70 + 21;
 
 	_scrollLeft.setBounds(Rect(0, 0, 31, 15));
 	_scrollLeft.translate(buttonsLeft, 373);


Commit: a719b0585fed6bcbce48e924d65cca5d9ff80bf8
    https://github.com/scummvm/scummvm/commit/a719b0585fed6bcbce48e924d65cca5d9ff80bf8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:43-04:00

Commit Message:
TITANIC: Beginnings of slider logic

Changed paths:
    engines/titanic/pet_control/pet_slider.cpp
    engines/titanic/pet_control/pet_slider.h



diff --git a/engines/titanic/pet_control/pet_slider.cpp b/engines/titanic/pet_control/pet_slider.cpp
index dad78d6..4abf022 100644
--- a/engines/titanic/pet_control/pet_slider.cpp
+++ b/engines/titanic/pet_control/pet_slider.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/pet_control/pet_slider.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -86,4 +87,18 @@ void CPetSlider::proc18() {
 
 }
 
+/*------------------------------------------------------------------------*/
+
+void CPetSoundSlider::setupBackground(const CString &name, CPetControl *petControl) {
+	if (petControl) {
+		_background = petControl->getHiddenObject(name);
+	}
+}
+
+void CPetSoundSlider::setupThumb(const CString &name, CPetControl *petControl) {
+	if (petControl) {
+		_thumb = petControl->getHiddenObject(name);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_slider.h b/engines/titanic/pet_control/pet_slider.h
index b3ba60f..a30697a 100644
--- a/engines/titanic/pet_control/pet_slider.h
+++ b/engines/titanic/pet_control/pet_slider.h
@@ -25,9 +25,12 @@
 
 #include "titanic/support/rect.h"
 #include "titanic/support/string.h"
+#include "titanic/core/game_object.h"
 
 namespace Titanic {
 
+class CPetControl;
+
 class CPetSlider {
 private:
 	int _field4;
@@ -44,9 +47,25 @@ private:
 public:
 	CPetSlider();
 
-	virtual void proc1() {}
-	virtual void proc2() {}
-	virtual void proc3() {}
+	/**
+	 * Setup the background
+	 */
+	virtual void setupBackground(const CString &name, CPetControl *petControl) {}
+
+	/**
+	 * Setup the thumb
+	 */
+	virtual void setupThumb(const CString &name, CPetControl *petControl) {}
+
+	/**
+	 * Setup the background
+	 */
+	virtual void setupBackground(const CString &name, CTreeItem *treeItem) {}
+
+	/**
+	 * Setup the thumb
+	 */
+	virtual void setupThumb(const CString &name, CTreeItem *treeItem) {}
 
 	/**
 	 * Reset the slider
@@ -81,9 +100,21 @@ public:
 
 class CPetSoundSlider : public CPetSlider {
 public:
-
+	CGameObject *_background;
+	CGameObject *_thumb;
 public:
+	CPetSoundSlider() : CPetSlider(), _background(nullptr),
+		_thumb(0) {}
 
+	/**
+	 * Setup the background
+	 */
+	virtual void setupBackground(const CString &name, CPetControl *petControl);
+
+	/**
+	 * Setup the thumb
+	 */
+	virtual void setupThumb(const CString &name, CPetControl *petControl);
 };
 
 } // End of namespace Titanic


Commit: 4915f8900aff374b2a71545e788cb95d9da7138a
    https://github.com/scummvm/scummvm/commit/4915f8900aff374b2a71545e788cb95d9da7138a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:44-04:00

Commit Message:
TITANIC: Implement more slider functions

Changed paths:
    engines/titanic/pet_control/pet_slider.cpp
    engines/titanic/pet_control/pet_slider.h



diff --git a/engines/titanic/pet_control/pet_slider.cpp b/engines/titanic/pet_control/pet_slider.cpp
index 4abf022..bb43cf5 100644
--- a/engines/titanic/pet_control/pet_slider.cpp
+++ b/engines/titanic/pet_control/pet_slider.cpp
@@ -26,29 +26,31 @@
 namespace Titanic {
 
 CPetSlider::CPetSlider() {
-	_field4 = 0;
-	_field8 = 0;
-	_field1C = 0;
-	_field20 = 0;
-	_field24 = 0;
-	_field28 = 0;
-	_field2C = 0;
-	_field30 = 0;
-	_field34 = 0;
+	_flags = 0;
+	_thumbWidth = 0;
+	_thumbHeight = 0;
+	_sliderOffset = 0;
+	_thumbFocused = false;
 }
 
-void CPetSlider::initBounds(Rect *rect) {
-	if (rect)
-		*rect = _bounds2;
-	_bounds2.clear();
+Rect CPetSlider::clearDirtyArea() {
+	Rect result = _dirtyArea;
+	_dirtyArea.clear();
+	return result;
 }
 
-void CPetSlider::proc8() {
-
+bool CPetSlider::checkThumb(const Point &pt) {
+	_thumbFocused = thumbContains(pt);
+	if (_thumbFocused)
+		return true;
+	else
+		return containsPt(pt);
 }
 
-void CPetSlider::proc9() {
-
+bool CPetSlider::resetThumbFocus() {
+	bool result = _thumbFocused;
+	_thumbFocused = false;
+	return result;
 }
 
 void CPetSlider::proc10() {
@@ -59,8 +61,15 @@ void CPetSlider::proc11() {
 
 }
 
-void CPetSlider::proc12() {
+bool CPetSlider::proc12(const Point &pt) {
+	if (thumbContains(pt))
+		return true;
+	if (!containsPt(pt))
+		return false;
 
+	int newOffset = calcSliderOffset(pt);
+	setSliderOffset(newOffset);
+	return true;
 }
 
 void CPetSlider::proc13() {
@@ -71,20 +80,99 @@ void CPetSlider::proc14() {
 
 }
 
-void CPetSlider::proc15() {
+bool CPetSlider::contains(const Point &pt) const {
+	return thumbContains(pt) || containsPt(pt);
+}
+
+double CPetSlider::getOffsetPixels() const {
+	int maxVal = 0, minVal = 0;
+	if (_flags & ORIENTATION_HORIZONTAL) {
+		maxVal = _slidingRect.right;
+		minVal = _slidingRect.left;
+	}
 
+	if (_flags & ORIENTATION_VERTICAL) {
+		maxVal = _slidingRect.bottom;
+		minVal = _slidingRect.top;
+	}
+
+	if (minVal == maxVal)
+		return 0.0;
+
+	return _sliderOffset / (maxVal - minVal);
 }
 
-void CPetSlider::proc16() {
+void CPetSlider::setSliderOffset(double offset) {
+	if (_flags & ORIENTATION_HORIZONTAL)
+		_sliderOffset = offset * (_slidingRect.right - _slidingRect.left);
 
+	if (_flags & ORIENTATION_VERTICAL)
+		_sliderOffset = offset * (_slidingRect.bottom - _slidingRect.top);
 }
 
-void CPetSlider::proc17() {
+void CPetSlider::setOffsetPixels(int offset) {
+	// Add the slider's old position to the dirty area
+	Rect tempRect = getThumbRect();
+	_dirtyArea.combine(tempRect);
+
+	// Set the new offset
+	_sliderOffset = offset;
 
+	// Add the thumb's new location to the dirty area
+	tempRect = getThumbRect();
+	_dirtyArea.combine(tempRect);
 }
 
-void CPetSlider::proc18() {
+Point CPetSlider::getBackgroundDrawPos() {
+	return Point(_bounds.left, _bounds.top);
+}
 
+Point CPetSlider::getThumbDrawPos() {
+	Point thumbPos = getThumbCentroidPos();
+	thumbPos -= Point(_thumbWidth / 2, _thumbHeight / 2);
+	return thumbPos;
+}
+
+Point CPetSlider::getThumbCentroidPos() const {
+	Point pt;
+
+	if (_flags & ORIENTATION_HORIZONTAL) {
+		pt = Point(_slidingRect.left + _sliderOffset,
+			_slidingRect.top + _slidingRect.height() / 2);
+	}
+
+	if (_flags & ORIENTATION_VERTICAL) {
+		pt = Point(_slidingRect.left + _slidingRect.width() / 2,
+			_slidingRect.top + _sliderOffset);
+	}
+
+	return pt;
+}
+
+bool CPetSlider::thumbContains(const Point &pt) const {
+	return getThumbRect().contains(pt);
+}
+
+Rect CPetSlider::getThumbRect() const {
+	Rect thumbRect(0, 0, _thumbWidth, _thumbHeight);
+	Point centroid = getThumbCentroidPos();
+	thumbRect.moveTo(centroid.x - _thumbWidth / 2, centroid.y - _thumbHeight / 2);
+
+	return thumbRect;
+}
+
+int CPetSlider::calcSliderOffset(const Point &pt) const {
+	int result = 0;
+
+	if (_flags & ORIENTATION_HORIZONTAL) {
+		result = CLIP(pt.x, _slidingRect.left, _slidingRect.right) - _slidingRect.left;
+	}
+	
+	if (_flags & ORIENTATION_VERTICAL) {
+		result = CLIP(pt.y, _slidingRect.top, _slidingRect.bottom) - _slidingRect.top;
+	}
+
+	return result;
 }
 
 /*------------------------------------------------------------------------*/
@@ -101,4 +189,53 @@ void CPetSoundSlider::setupThumb(const CString &name, CPetControl *petControl) {
 	}
 }
 
+void CPetSoundSlider::setupBackground2(const CString &name, CPetControl *petControl) {
+	if (petControl) {
+		CString numStr = "3";
+		int mode = petControl->getState8();
+		if (mode <= 3) {
+			numStr = CString(mode);			
+		} else if (mode == 4) {
+			mode = petControl->getStateC();
+			if (mode == 1) {
+				numStr = CString(mode);
+			}
+		}
+
+		CString fullName = numStr + name;
+		setupBackground(fullName, petControl);
+	}
+}
+
+void CPetSoundSlider::setupThumb2(const CString &name, CPetControl *petControl) {
+	if (petControl) {
+		CString numStr = "3";
+		int mode = petControl->getState8();
+		if (mode <= 3) {
+			numStr = CString(mode);
+		}
+		else if (mode == 4) {
+			mode = petControl->getStateC();
+			if (mode == 1) {
+				numStr = CString(mode);
+			}
+		}
+
+		CString fullName = numStr + name;
+		setupThumb(fullName, petControl);
+	}
+}
+
+void CPetSoundSlider::draw(CScreenManager *screenManager) {
+	if (_background) {
+		Point pt = getBackgroundDrawPos();
+		_background->draw(screenManager, pt);
+	}
+
+	if (_thumb) {
+		Point pt = getThumbDrawPos();
+		_thumb->draw(screenManager, pt);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_slider.h b/engines/titanic/pet_control/pet_slider.h
index a30697a..a8ef3cb 100644
--- a/engines/titanic/pet_control/pet_slider.h
+++ b/engines/titanic/pet_control/pet_slider.h
@@ -29,21 +29,55 @@
 
 namespace Titanic {
 
+enum SliderOrientation { ORIENTATION_HORIZONTAL = 1, ORIENTATION_VERTICAL = 2 };
+
 class CPetControl;
 
 class CPetSlider {
 private:
-	int _field4;
-	int _field8;
+	int _flags;
 	Rect _bounds;
-	int _field1C;
-	int _field20;
-	int _field24;
-	int _field28;
-	int _field2C;
-	int _field30;
-	int _field34;
-	Rect _bounds2;
+	Rect _slidingRect;
+	int _thumbWidth;
+	int _thumbHeight;
+	int _sliderOffset;
+	bool _thumbFocused;
+	Rect _dirtyArea;
+private:
+	/**
+	 * Center the center position of the slider's thumb
+	 */
+	Point getThumbCentroidPos() const;
+
+	/**
+	 * Returns true if the passed point is within the thumb
+	 */
+	bool thumbContains(const Point &pt) const;
+
+	/**
+	 * Gets the area the slider's thumbnail covers
+	 */
+	Rect getThumbRect() const;
+
+	/**
+	 * Calculates the slider offset at the specificed position
+	 */
+	int calcSliderOffset(const Point &pt) const;
+protected:
+	/**
+	 * Get the position to draw the background at
+	 */
+	Point getBackgroundDrawPos();
+
+	/**
+	 * Get the position to draw the slider thumbnail at
+	 */
+	Point getThumbDrawPos();
+
+	/**
+	 * Returns true if the passed point falls within the slider's bounds
+	 */
+	bool containsPt(const Point &pt) const { return _bounds.contains(pt); }
 public:
 	CPetSlider();
 
@@ -60,42 +94,61 @@ public:
 	/**
 	 * Setup the background
 	 */
-	virtual void setupBackground(const CString &name, CTreeItem *treeItem) {}
+	virtual void setupBackground2(const CString &name, CPetControl *petControl) {}
 
 	/**
 	 * Setup the thumb
 	 */
-	virtual void setupThumb(const CString &name, CTreeItem *treeItem) {}
+	virtual void setupThumb2(const CString &name, CPetControl *petControl) {}
 
 	/**
 	 * Reset the slider
 	 */
 	virtual void reset(const CString &name) {}
 	
-	virtual void proc5() {}
-	virtual void proc6() {}
-	
 	/**
-	 * Reset the bounds of the slider
+	 * Draw the slider
+	 */
+	virtual void draw(CScreenManager *screenManager) {}
+
+	/**
+	 * Reset the dirty area
 	 */
-	virtual void initBounds(Rect *rect);
+	virtual Rect clearDirtyArea();
 	
-	virtual void proc8();
-	virtual void proc9();
+	/**
+	 * Checks whether the slider is highlighted
+	 */
+	virtual bool checkThumb(const Point &pt);
+
+	/**
+	 * Resets the thumb focused flag
+	 */
+	virtual bool resetThumbFocus();
+
 	virtual void proc10();
 	virtual void proc11();
-	virtual void proc12();
+	virtual bool proc12(const Point &pt);
 	virtual void proc13();
 	virtual void proc14();
-	virtual void proc15();
-	virtual void proc16();
-	virtual void proc17();
-	virtual void proc18();
+	
+	
+	virtual bool contains(const Point &pt) const;
 
 	/**
-	 * Returns true if the passed point falls within the slider's bounds
+	 * Returns the slider offset in pixels
+	 */
+	virtual double getOffsetPixels() const;
+
+	/**
+	 * Sets the slider offset
+	 */
+	virtual void setSliderOffset(double offset);
+
+	/**
+	 * Set a new slider offset in pixels
 	 */
-	bool contains(const Point &pt) const { return _bounds.contains(pt); }
+	virtual void setOffsetPixels(int offset);
 };
 
 class CPetSoundSlider : public CPetSlider {
@@ -115,6 +168,21 @@ public:
 	 * Setup the thumb
 	 */
 	virtual void setupThumb(const CString &name, CPetControl *petControl);
+
+	/**
+	 * Setup the background
+	 */
+	virtual void setupBackground2(const CString &name, CPetControl *petControl);
+
+	/**
+	 * Setup the thumb
+	 */
+	virtual void setupThumb2(const CString &name, CPetControl *petControl);
+
+	/**
+	 * Draw the slider
+	 */
+	virtual void draw(CScreenManager *screenManager);
 };
 
 } // End of namespace Titanic


Commit: f79ebfa3e26cc748ef495a96da8acb9e005b3324
    https://github.com/scummvm/scummvm/commit/f79ebfa3e26cc748ef495a96da8acb9e005b3324
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:45-04:00

Commit Message:
TITANIC: Added PET Sound tab setup

Changed paths:
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_slider.cpp
    engines/titanic/pet_control/pet_slider.h
    engines/titanic/pet_control/pet_sound.cpp
    engines/titanic/pet_control/pet_sound.h



diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index 7ee2836..17e5881 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -134,6 +134,11 @@ public:
 	 * Translate the position of the element
 	 */
 	void translate(int deltaX, int deltaY) { _bounds.translate(deltaX, deltaY); }
+
+	/**
+	 * Translate the position of the element
+	 */
+	void translate(const Point &delta) { _bounds.translate(delta.x, delta.y); }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_slider.cpp b/engines/titanic/pet_control/pet_slider.cpp
index bb43cf5..3e579a4 100644
--- a/engines/titanic/pet_control/pet_slider.cpp
+++ b/engines/titanic/pet_control/pet_slider.cpp
@@ -26,7 +26,7 @@
 namespace Titanic {
 
 CPetSlider::CPetSlider() {
-	_flags = 0;
+	_orientation = 0;
 	_thumbWidth = 0;
 	_thumbHeight = 0;
 	_sliderOffset = 0;
@@ -53,12 +53,9 @@ bool CPetSlider::resetThumbFocus() {
 	return result;
 }
 
-void CPetSlider::proc10() {
-
-}
-
-void CPetSlider::proc11() {
-
+void CPetSlider::proc10(const Point &pt) {
+	int newOffset = calcSliderOffset(pt);
+	setOffsetPixels(newOffset);
 }
 
 bool CPetSlider::proc12(const Point &pt) {
@@ -68,30 +65,22 @@ bool CPetSlider::proc12(const Point &pt) {
 		return false;
 
 	int newOffset = calcSliderOffset(pt);
-	setSliderOffset(newOffset);
+	setOffsetPixels(newOffset);
 	return true;
 }
 
-void CPetSlider::proc13() {
-
-}
-
-void CPetSlider::proc14() {
-
-}
-
 bool CPetSlider::contains(const Point &pt) const {
 	return thumbContains(pt) || containsPt(pt);
 }
 
 double CPetSlider::getOffsetPixels() const {
 	int maxVal = 0, minVal = 0;
-	if (_flags & ORIENTATION_HORIZONTAL) {
+	if (_orientation & ORIENTATION_HORIZONTAL) {
 		maxVal = _slidingRect.right;
 		minVal = _slidingRect.left;
 	}
 
-	if (_flags & ORIENTATION_VERTICAL) {
+	if (_orientation & ORIENTATION_VERTICAL) {
 		maxVal = _slidingRect.bottom;
 		minVal = _slidingRect.top;
 	}
@@ -103,10 +92,10 @@ double CPetSlider::getOffsetPixels() const {
 }
 
 void CPetSlider::setSliderOffset(double offset) {
-	if (_flags & ORIENTATION_HORIZONTAL)
+	if (_orientation & ORIENTATION_HORIZONTAL)
 		_sliderOffset = offset * (_slidingRect.right - _slidingRect.left);
 
-	if (_flags & ORIENTATION_VERTICAL)
+	if (_orientation & ORIENTATION_VERTICAL)
 		_sliderOffset = offset * (_slidingRect.bottom - _slidingRect.top);
 }
 
@@ -136,12 +125,12 @@ Point CPetSlider::getThumbDrawPos() {
 Point CPetSlider::getThumbCentroidPos() const {
 	Point pt;
 
-	if (_flags & ORIENTATION_HORIZONTAL) {
+	if (_orientation & ORIENTATION_HORIZONTAL) {
 		pt = Point(_slidingRect.left + _sliderOffset,
 			_slidingRect.top + _slidingRect.height() / 2);
 	}
 
-	if (_flags & ORIENTATION_VERTICAL) {
+	if (_orientation & ORIENTATION_VERTICAL) {
 		pt = Point(_slidingRect.left + _slidingRect.width() / 2,
 			_slidingRect.top + _sliderOffset);
 	}
@@ -164,17 +153,21 @@ Rect CPetSlider::getThumbRect() const {
 int CPetSlider::calcSliderOffset(const Point &pt) const {
 	int result = 0;
 
-	if (_flags & ORIENTATION_HORIZONTAL) {
+	if (_orientation & ORIENTATION_HORIZONTAL) {
 		result = CLIP(pt.x, _slidingRect.left, _slidingRect.right) - _slidingRect.left;
 	}
 	
-	if (_flags & ORIENTATION_VERTICAL) {
+	if (_orientation & ORIENTATION_VERTICAL) {
 		result = CLIP(pt.y, _slidingRect.top, _slidingRect.bottom) - _slidingRect.top;
 	}
 
 	return result;
 }
 
+void CPetSlider::setOrientation(SliderOrientation orientation) {
+	_orientation |= orientation;
+}
+
 /*------------------------------------------------------------------------*/
 
 void CPetSoundSlider::setupBackground(const CString &name, CPetControl *petControl) {
diff --git a/engines/titanic/pet_control/pet_slider.h b/engines/titanic/pet_control/pet_slider.h
index a8ef3cb..7a61741 100644
--- a/engines/titanic/pet_control/pet_slider.h
+++ b/engines/titanic/pet_control/pet_slider.h
@@ -35,7 +35,7 @@ class CPetControl;
 
 class CPetSlider {
 private:
-	int _flags;
+	int _orientation;
 	Rect _bounds;
 	Rect _slidingRect;
 	int _thumbWidth;
@@ -126,11 +126,11 @@ public:
 	 */
 	virtual bool resetThumbFocus();
 
-	virtual void proc10();
-	virtual void proc11();
+	virtual void proc10(const Point &pt);
+	virtual bool proc11() { return true; }
 	virtual bool proc12(const Point &pt);
-	virtual void proc13();
-	virtual void proc14();
+	virtual bool proc13() { return false; }
+	virtual bool proc14() { return false; }
 	
 	
 	virtual bool contains(const Point &pt) const;
@@ -149,6 +149,37 @@ public:
 	 * Set a new slider offset in pixels
 	 */
 	virtual void setOffsetPixels(int offset);
+
+	/**
+	 * Enables a given orientation
+	 */
+	void setOrientation(SliderOrientation orientation);
+
+	/**
+	 * Set the bounds for the slider
+	 */
+	void setBounds(const Rect &r) { _bounds = r; }
+
+	/**
+	 * Set the sliding bounds for the slider
+	 */
+	void setSlidingBounds(const Rect &r) { _slidingRect = r; }
+
+	/**
+	 * Set the size of the slider thumb
+	 */
+	void setThumbSize(const Point &pt) {
+		_thumbWidth = pt.x;
+		_thumbHeight = pt.y;
+	}
+
+	/**
+	 * Move the slider
+	 */
+	void translate(const Point &pt) {
+		_bounds.translate(pt.x, pt.y);
+		_slidingRect.translate(pt.x, pt.y);
+	}
 };
 
 class CPetSoundSlider : public CPetSlider {
diff --git a/engines/titanic/pet_control/pet_sound.cpp b/engines/titanic/pet_control/pet_sound.cpp
index 6c6c2ea..75dff34 100644
--- a/engines/titanic/pet_control/pet_sound.cpp
+++ b/engines/titanic/pet_control/pet_sound.cpp
@@ -30,7 +30,58 @@ CPetSound::CPetSound() : CPetGlyph(), _field198(0), _field19C(0) {
 
 bool CPetSound::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	CPetGlyph::setup(petControl, owner);
-	// TODO
+
+	_masterVolume.setOrientation(ORIENTATION_HORIZONTAL);
+	_masterVolume.setBounds(Rect(17, 0, 147, 15));
+	_masterVolume.setSlidingBounds(Rect(35, 5, 127, 11));
+	_masterVolume.setThumbSize(Point(25, 15));
+	_masterVolume.translate(Point(415, 376));
+
+	_musicVolume.setOrientation(ORIENTATION_HORIZONTAL);
+	_musicVolume.setBounds(Rect(17, 20, 147, 35));
+	_musicVolume.setSlidingBounds(Rect(35, 25, 127, 31));
+	_musicVolume.setThumbSize(Point(25, 15));
+	_musicVolume.translate(Point(415, 376));
+
+	_parrotVolume.setOrientation(ORIENTATION_HORIZONTAL);
+	_parrotVolume.setBounds(Rect(17, 40, 147, 55));
+	_parrotVolume.setSlidingBounds(Rect(35, 45, 127, 51));
+	_parrotVolume.setThumbSize(Point(25, 15));
+	_parrotVolume.translate(Point(415, 376));
+
+	_parrotVolume.setOrientation(ORIENTATION_HORIZONTAL);
+	_parrotVolume.setBounds(Rect(17, 60, 147, 75));
+	_parrotVolume.setSlidingBounds(Rect(35, 65, 127, 71));
+	_parrotVolume.setThumbSize(Point(25, 15));
+	_parrotVolume.translate(Point(415, 376));
+
+	_element.setBounds(Rect(0, 0, 165, 77));
+	_element.translate(Point(415, 376));
+
+	Rect rect(0, 0, 88, 16);
+	rect.translate(320, 376);
+	_textMasterVolume.setBounds(rect);
+	_textMasterVolume.resize(3);
+	_textMasterVolume.setHasBorder(false);
+	_textMasterVolume.setText("Master volume");
+
+	rect.translate(0, 20);
+	_textMusicVolume.setBounds(rect);
+	_textMusicVolume.resize(3);
+	_textMusicVolume.setHasBorder(false);
+	_textMusicVolume.setText("Music volume");
+
+	rect.translate(0, 20);
+	_textParrotVolume.setBounds(rect);
+	_textParrotVolume.resize(3);
+	_textParrotVolume.setHasBorder(false);
+	_textParrotVolume.setText("Parrot volume");
+
+	rect.translate(0, 20);
+	_textSpeechVolume.setBounds(rect);
+	_textSpeechVolume.resize(3);
+	_textSpeechVolume.setHasBorder(false);
+	_textSpeechVolume.setText("Speech volume");
 
 	return true;
 }
@@ -40,15 +91,17 @@ bool CPetSound::reset() {
 	if (pet) {
 		setName("PetSound", pet);
 		_element.reset("PetVolChannels", pet, MODE_UNSELECTED);
-		_slider1.reset("PetVolSlug");
-		_slider2.reset("PetVolSlug");
-		_slider3.reset("PetVolSlug");
-		_slider4.reset("PetVolSlug");
+		_musicVolume.reset("PetVolSlug");
+		_masterVolume.reset("PetVolSlug");
+		_parrotVolume.reset("PetVolSlug");
+		_speechVolume.reset("PetVolSlug");
 
 		CPetSection *section = getPetSection();
 		uint col = section->getColor(0);
-		for (int idx = 0; idx < 4; ++idx)
-			_text[idx].setColor(0, col);
+		_textMusicVolume.setColor(0, col);
+		_textMasterVolume.setColor(0, col);
+		_textParrotVolume.setColor(0, col);
+		_textSpeechVolume.setColor(0, col);
 	}
 
 	return false;
diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h
index e52ccca..de6c637 100644
--- a/engines/titanic/pet_control/pet_sound.h
+++ b/engines/titanic/pet_control/pet_sound.h
@@ -33,11 +33,14 @@ namespace Titanic {
 class CPetSound : public CPetGlyph {
 private:
 	CPetGfxElement _element;
-	CPetSlider _slider1;
-	CPetSlider _slider2;
-	CPetSlider _slider3;
-	CPetSlider _slider4;
-	CPetText _text[4];
+	CPetSlider _masterVolume;
+	CPetSlider _musicVolume;
+	CPetSlider _parrotVolume;
+	CPetSlider _speechVolume;
+	CPetText _textMasterVolume;
+	CPetText _textMusicVolume;
+	CPetText _textParrotVolume;
+	CPetText _textSpeechVolume;
 	int _field198;
 	int _field19C;
 public:


Commit: 990f7b87c1b328b0cb2b663d37f4a1de50edf56c
    https://github.com/scummvm/scummvm/commit/990f7b87c1b328b0cb2b663d37f4a1de50edf56c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:46-04:00

Commit Message:
TITANIC: Sort out PET enter and leave methods

Changed paths:
    engines/titanic/messages/messages.h
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_real_life.cpp
    engines/titanic/pet_control/pet_real_life.h
    engines/titanic/pet_control/pet_section.h
    engines/titanic/pet_control/pet_sound.cpp
    engines/titanic/pet_control/pet_sound.h



diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 649b20b..ae66af1 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -265,7 +265,7 @@ MESSAGE0(CInitializeAnimMsg);
 MESSAGE1(CIsEarBowlPuzzleDone, int, value, 0);
 MESSAGE3(CIsHookedOnMsg, Rect, rect, Rect(), bool, result, false, CString, string1, "");
 MESSAGE1(CIsParrotPresentMsg, bool, value, false);
-MESSAGE1(CKeyCharMsg, int, value, 32);
+MESSAGE1(CKeyCharMsg, int, key, 32);
 MESSAGE2(CLeaveNodeMsg, CNodeItem *, oldNode, nullptr, CNodeItem *, newNode, nullptr);
 MESSAGE2(CLeaveRoomMsg, CRoomItem *, oldRoom, nullptr, CRoomItem *, newRoom, nullptr);
 MESSAGE2(CLeaveViewMsg, CViewItem *, oldView, nullptr, CViewItem *, newView, nullptr);
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index eedd94d..1ab7d7e 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/pet_control/pet_glyphs.h"
 #include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -37,7 +38,7 @@ void CPetGlyph::drawAt(CScreenManager *screenManager, const Point &pt) {
 	_element.translate(-pt.x, -pt.y);
 }
 
-void CPetGlyph::proc14() {
+void CPetGlyph::proc14(const Point &pt) {
 	warning("TODO: CPetGlyph::proc14");
 }
 
@@ -66,7 +67,8 @@ void CPetGlyph::setName(const CString &name, CPetControl *petControl) {
 /*------------------------------------------------------------------------*/
 
 CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0),  _numVisibleGlyphs(TOTAL_GLYPHS),
-		_highlightIndex(-1), _field1C(-1), _field20(0), _owner(nullptr) {
+		_highlightIndex(-1), _field1C(-1), _field20(0),
+		_field94(nullptr), _owner(nullptr) {
 }
 
 void CPetGlyphs::setNumVisible(int total) {
@@ -107,12 +109,24 @@ void CPetGlyphs::reset() {
 	}
 }
 
-void CPetGlyphs::proc10() {
-	error("TODO");
+bool CPetGlyphs::enter() {
+	if (_highlightIndex != -1) {
+		CPetGlyph *glyph = getGlyph(_highlightIndex);
+		if (glyph && glyph->enter())
+			return true;
+	}
+
+	return false;
 }
 
-void CPetGlyphs::proc11() {
-	error("TODO");
+bool CPetGlyphs::leave() {
+	if (_highlightIndex != -1) {
+		CPetGlyph *glyph = getGlyph(_highlightIndex);
+		if (glyph && glyph->leave())
+			return true;
+	}
+
+	return false;
 }
 
 void CPetGlyphs::draw(CScreenManager *screenManager) {
@@ -163,6 +177,11 @@ Point CPetGlyphs::getPosition(int index) {
 	return tempPoint;
 }
 
+Rect CPetGlyphs::getRect(int index) {
+	Point pt = getPosition(index);
+	return Rect(pt.x, pt.y, pt.x + 52, pt.y + 52);
+}
+
 void CPetGlyphs::changeHighlight(int index) {
 	warning("TODO: CPetGlyphs::changeHighlight");
 }
@@ -193,4 +212,184 @@ CPetControl *CPetGlyphs::getPetControl() const {
 	return _owner ? _owner->getPetControl() : nullptr;
 }
 
+void CPetGlyphs::setFirstVisible(int index) {
+	if (index != _firstVisibleIndex) {
+		_firstVisibleIndex = index;
+
+		if ((_field20 & 8) && _highlightIndex != -1) {
+			CPetGlyph *glyph = getGlyph(_highlightIndex);
+			
+			if (glyph) {
+				int idx = getHighlightedIndex(_highlightIndex);
+				if (idx != -1) {
+					Point tempPt = getPosition(idx);
+					glyph->proc27(tempPt, true);
+				}
+			}
+		}
+	}
+}
+
+void CPetGlyphs::scrollLeft() {
+	if (_firstVisibleIndex > 0) {
+		setFirstVisible(_firstVisibleIndex - 1);
+		if (_highlightIndex != -1) {
+			int index = getHighlightedIndex(_highlightIndex);
+			if (index == -1)
+				changeHighlight(_highlightIndex - 1);
+		}
+
+		makePetDirty();
+	}
+}
+
+void CPetGlyphs::scrollRight() {
+	int count = size();
+	int right = count - _numVisibleGlyphs;
+
+	if (_firstVisibleIndex < right) {
+		setFirstVisible(_firstVisibleIndex + 1);
+		if (_highlightIndex != -1) {
+			int index = getHighlightedIndex(_highlightIndex);
+			if (index == -1)
+				changeHighlight(_highlightIndex + 1);
+		}
+
+		makePetDirty();
+	}
+}
+
+void CPetGlyphs::makePetDirty() {
+	if (_owner && _owner->_petControl)
+		_owner->_petControl->makeDirty();
+}
+
+bool CPetGlyphs::mouseButtonDown(const Point &pt) {
+	if (_scrollLeft.contains2(pt)) {
+		scrollLeft();
+		return true;
+	}
+
+	if (_scrollRight.contains2(pt)) {
+		scrollRight();
+		return true;
+	}
+
+	for (int idx = 0; idx < _numVisibleGlyphs; ++idx) {
+		Rect glyphRect = getRect(idx);
+		if (glyphRect.contains(pt)) {
+			int index = getItemIndex(idx);
+			CPetGlyph *glyph = getGlyph(index);
+			if (glyph) {
+				if (index == _highlightIndex) {
+					glyph->proc28(glyphRect);
+					glyph->proc14(pt);
+					return true;
+				} else {
+					changeHighlight(index);
+					makePetDirty();
+					return true;
+				}
+			}
+		}
+	}
+
+	if (_highlightIndex != -1) {
+		CPetGlyph *glyph = getGlyph(_highlightIndex);
+
+		if (glyph) {
+			if (glyph->checkHighlight(pt))
+				return true;
+
+			if (!(_field20 & 2)) {
+				changeHighlight(-1);
+				makePetDirty();
+			}
+		}
+	}
+
+	return false;
+}
+
+bool CPetGlyphs::mouseButtonUp(const Point &pt) {
+	if (_highlightIndex >= 0) {
+		CPetGlyph *glyph = getGlyph(_highlightIndex);
+		if (glyph) {
+			if (glyph->MouseButtonMsg(pt))
+				return true;
+		}
+	}
+
+	return false;
+}
+
+bool CPetGlyphs::mouseDragStart(CMouseDragStartMsg *msg) {
+	if (!(_field20 & 1) && _highlightIndex >= 0) {
+		CPetGlyph *glyph = getGlyph(_highlightIndex);
+		int index = getHighlightedIndex(_highlightIndex);
+		Rect glyphRect = getRect(index);
+
+		if (glyphRect.contains(msg->_mousePos))
+			return glyph->proc29(glyphRect);
+		else
+			return glyph->MouseDragStartMsg(msg);
+	}
+
+	return false;
+}
+
+bool CPetGlyphs::mouseDragMove(CMouseDragMoveMsg *msg) {
+	if (_field94) {
+		error("TODO");
+	} else {
+		return false;
+	}
+}
+
+bool CPetGlyphs::mouseDragEnd(CMouseDragEndMsg *msg) {
+	if (_field94) {
+		error("TODO");
+	} else {
+		return false;
+	}
+}
+
+bool CPetGlyphs::keyCharMsg(int key) {
+	if (_highlightIndex >= 0) {
+		CPetGlyph *glyph = getGlyph(_highlightIndex);
+
+		if (glyph && glyph->KeyCharMsg(key))
+			return true;
+	}
+
+	return false;
+}
+
+bool CPetGlyphs::virtualKeyCharMsg(int key) {
+	bool handled = false;
+	warning("TODO: CPetGlyphs::virtualKeyCharMsg");
+
+	if (!handled && _highlightIndex >= 0) {
+		CPetGlyph *glyph = getGlyph(_highlightIndex);
+		if (glyph && glyph->VirtualKeyCharMsg(key))
+			handled = true;
+	}
+
+	return handled;
+}
+
+bool CPetGlyphs::enterHighlighted() {
+	if (_highlightIndex >= 0)
+		return getGlyph(_highlightIndex)->enterHighlighted();
+	else
+		return false;
+}
+
+bool CPetGlyphs::leaveHighlighted() {
+	if (_highlightIndex >= 0)
+		return getGlyph(_highlightIndex)->leaveHighlighted();
+	else
+		return false;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 9d2f283..4966547 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -90,8 +90,15 @@ public:
 	 */
 	virtual bool reset() { return false; }
 
-	virtual void proc10() {}
-	virtual void proc11() {}
+	/**
+	 * Called when the PET area is entered
+	 */
+	virtual bool enter() { return false; }
+	
+	/**
+	 * Called when the PET area is left
+	 */
+	virtual bool leave() { return false; }
 
 	/**
 	 * Draw the glyph at a specified position
@@ -103,7 +110,7 @@ public:
 	 */
 	virtual void draw2(CScreenManager *screenManager) {}
 
-	virtual void proc14();
+	virtual void proc14(const Point &pt);
 
 	/**
 	 * Get the bounds for the glyph
@@ -116,14 +123,14 @@ public:
 	 */
 	virtual bool checkHighlight(const Point &pt) { return false; }
 
-	virtual int proc17() { return 0; }
+	virtual bool MouseDragStartMsg(const CMouseDragStartMsg *msg) { return false; }
 	virtual int proc18() { return 0; }
 	virtual int proc19() { return 0; }
 
 	/**
 	 * Handles mouse button messages
 	 */
-	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return false; }
+	virtual bool MouseButtonMsg(const Point &pt) { return false; }
 	
 	virtual int proc21() { return 0; }
 	virtual int proc22() { return 0; }
@@ -131,9 +138,9 @@ public:
 	/**
 	 * Handles keypresses when the glyph is focused
 	 */
-	virtual bool KeyCharMsg(Common::KeyCode key) { return false; }
+	virtual bool KeyCharMsg(int key) { return false; }
 	
-	virtual int proc24() { return 0; }
+	virtual bool VirtualKeyCharMsg(int key) { return false; }
 
 	/**
 	 * Unhighlight any currently highlighted element
@@ -145,9 +152,9 @@ public:
 	 */
 	virtual void highlightCurrent() {}
 
-	virtual void proc27() {}
-	virtual void proc28() {}
-	virtual int proc29() { return 0; }
+	virtual void proc27(const Point &pt, bool flag) {}
+	virtual void proc28(const Point &pt) {}
+	virtual int proc29(const Point &pt) { return 0; }
 
 	/**
 	 * Returns true if the glyph's bounds, shifted to a given position,
@@ -164,8 +171,17 @@ public:
 
 	virtual int proc33() { return 1; }
 	virtual int proc34() { return 1; }
-	virtual int proc35() { return 0; }
-	virtual void proc36() {}
+
+	/**
+	 * Called on a highlighted item when PET area is entered
+	 */
+	virtual bool enterHighlighted() { return false; }
+	
+	/**
+	 * Called on a highlighted item when PET area is left
+	 */
+	virtual bool leaveHighlighted() { return false; }
+
 	virtual int proc37() { return 0; }
 
 	/**
@@ -182,6 +198,11 @@ private:
 	Point getPosition(int index);
 
 	/**
+	 * Get a rect for the glyph
+	 */
+	Rect getRect(int index);
+
+	/**
 	 * Returns the on-screen index for the highlight to be shown at
 	 */
 	int getHighlightedIndex(int index);
@@ -195,6 +216,26 @@ private:
 	 * Return a specified glyph
 	 */
 	CPetGlyph *getGlyph(int index);
+
+	/**
+	 * Scrolls the glyphs to the left
+	 */
+	void scrollLeft();
+
+	/**
+	 * Scrolls the glyphs to the right
+	 */
+	void scrollRight();
+
+	/**
+	 * Set the first visible glyph index
+	 */
+	void setFirstVisible(int index);
+
+	/**
+	 * Make the PET dirty
+	 */
+	void makePetDirty();
 protected:
 	int _firstVisibleIndex;
 	int _totalGlyphs;
@@ -202,6 +243,7 @@ protected:
 	int _highlightIndex;
 	int _field1C;
 	int _field20;
+	void *_field94;
 	CPetSection *_owner;
 	CPetGfxElement _selection;
 	CPetGfxElement _scrollLeft;
@@ -235,8 +277,15 @@ public:
 	 */
 	virtual void reset();
 
-	virtual void proc10();
-	virtual void proc11();
+	/**
+	 * Called when PET area is entered
+	 */
+	virtual bool enter();
+
+	/**
+	 * Called when PET area is left
+	 */
+	virtual bool leave();
 
 	void set20(int val) { _field20 = val; }
 
@@ -259,6 +308,53 @@ public:
 	 * Get the PET control
 	 */
 	CPetControl *getPetControl() const;
+
+	/**
+	 * Mouse button down message
+	 */
+	bool mouseButtonDown(const Point &pt);
+
+	/**
+	 * Mouse button up message
+	 */
+	bool mouseButtonUp(const Point &pt);
+
+	/**
+	 * Mouse drag start messagge
+	 */
+	bool mouseDragStart(CMouseDragStartMsg *msg);
+
+	/**
+	 * Mouse drag move message
+	 */
+	bool mouseDragMove(CMouseDragMoveMsg *msg);
+
+	/**
+	 * Mouse drag end message
+	 */
+	bool mouseDragEnd(CMouseDragEndMsg *msg);
+
+	/**
+	 * Key character message
+	 */
+	bool keyCharMsg(int key);
+
+	/**
+	 * Virtual key message
+	 */
+	bool virtualKeyCharMsg(int key);
+
+	/**
+	 * When the PET section is entered, passes onto the highlighted
+	 * glyph, if any
+	 */
+	bool enterHighlighted();
+
+	/**
+	 * When the PET section is left, passes onto the highlighted
+	 * glyph, if any
+	 */
+	bool leaveHighlighted();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 063f019..b27b664 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -57,22 +57,37 @@ Rect CPetInventory::getBounds() {
 	return Rect(); 
 }
 
-void CPetInventory::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(_field298, indent);
+CGameObject *CPetInventory::dragEnd(const Point &pt) const {
+	warning("TODO: CPetInventory::dragEnd");
+	return nullptr;
+}
+
+bool CPetInventory::isValid(CPetControl *petControl) {
+	setPetControl(petControl);
+	return true;
 }
 
 void CPetInventory::load(SimpleFile *file, int param) {
 	_field298 = file->readNumber();
 }
 
-CGameObject *CPetInventory::dragEnd(const Point &pt) const {
-	warning("TODO: CPetInventory::dragEnd");
-	return nullptr;
+void CPetInventory::postLoad() {
+	reset();
+	_field290 = 1;
+	itemsChanged();
+	_field290 = 0;
 }
 
-bool CPetInventory::isValid(CPetControl *petControl) {
-	// TODO
-	return true;
+void CPetInventory::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(_field298, indent);
+}
+
+void CPetInventory::enter(PetArea oldArea) {
+	_items.enter();
+}
+
+void CPetInventory::leave() {
+	_items.leave();
 }
 
 bool CPetInventory::setPetControl(CPetControl *petControl) {
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 32cb47e..ed1b679 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -91,11 +91,27 @@ public:
 	 */
 	virtual CGameObject *dragEnd(const Point &pt) const;
 
+
 	/**
 	 * Returns true if the object is in a valid state
 	 */
 	virtual bool isValid(CPetControl *petControl);
 
+	/**
+	 * Called after a game has been loaded
+	 */
+	virtual void postLoad();
+
+	/**
+	 * Called when a section is switched to
+	 */
+	virtual void enter(PetArea oldArea);
+	
+	/**
+	 * Called when a section is being left, to switch to another area
+	 */
+	virtual void leave();
+	
 	virtual CGameObject *getBackground(int index) const {
 		return (index >= 0 && index < 46) ? _itemBackgrounds[index] : nullptr;
 	}
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
index 38b7125..ec1ea2c 100644
--- a/engines/titanic/pet_control/pet_real_life.cpp
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -50,6 +50,52 @@ void CPetRealLife::draw(CScreenManager *screenManager) {
 	_text.draw(screenManager);
 }
 
+bool CPetRealLife::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	return _glyphs.mouseButtonDown(msg->_mousePos);
+}
+
+bool CPetRealLife::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+	return _glyphs.mouseDragStart(msg);
+}
+
+bool CPetRealLife::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
+	return _glyphs.mouseDragMove(msg);
+}
+
+bool CPetRealLife::MouseDragEndMsg(CMouseDragEndMsg *msg) {
+	return _glyphs.mouseDragEnd(msg);
+}
+
+bool CPetRealLife::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+	return _glyphs.mouseButtonUp(msg->_mousePos);
+}
+
+bool CPetRealLife::KeyCharMsg(CKeyCharMsg *msg) {
+	_glyphs.keyCharMsg(msg->_key);
+	return true;
+}
+
+bool CPetRealLife::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
+	return _glyphs.virtualKeyCharMsg(msg->_keyState.keycode);
+}
+
+void CPetRealLife::postLoad() {
+	reset();
+}
+
+bool CPetRealLife::isValid(CPetControl *petControl) {
+	setupControl(petControl);
+	return true;
+}
+
+void CPetRealLife::enter(PetArea oldArea) {
+	_glyphs.enterHighlighted();
+}
+
+void CPetRealLife::leave() {
+	_glyphs.leaveHighlighted();
+}
+
 bool CPetRealLife::setupControl(CPetControl *petControl) {
 	if (petControl) {
 		_petControl = petControl;
@@ -78,11 +124,6 @@ void CPetRealLife::addButton(CPetGlyph *glyph) {
 	}
 }
 
-bool CPetRealLife::isValid(CPetControl *petControl) {
-	setupControl(petControl);
-	return true;
-}
-
 
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_real_life.h b/engines/titanic/pet_control/pet_real_life.h
index c4c597c..b00c7c1 100644
--- a/engines/titanic/pet_control/pet_real_life.h
+++ b/engines/titanic/pet_control/pet_real_life.h
@@ -75,14 +75,13 @@ public:
 	 * Following are handlers for the various messages that the PET can
 	 * pass onto the currently active section/area
 	 */
-	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return false; }
-	virtual bool MouseDragStartMsg(CMouseDragStartMsg *msg) { return false; }
-	virtual bool MouseDragMoveMsg(CMouseDragMoveMsg *msg) { return false; }
-	virtual bool MouseDragEndMsg(CMouseDragEndMsg *msg) { return false; }
-	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) { return false; }
-	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) { return false; }
-	virtual bool KeyCharMsg(CKeyCharMsg *msg) { return false; }
-	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) { return false; }
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	virtual bool MouseDragStartMsg(CMouseDragStartMsg *msg);
+	virtual bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
+	virtual bool MouseDragEndMsg(CMouseDragEndMsg *msg);
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+	virtual bool KeyCharMsg(CKeyCharMsg *msg);
+	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg);
 
 	virtual int proc14() { return 0; }
 	
@@ -109,7 +108,7 @@ public:
 	/**
 	 * Called after a game has been loaded
 	 */
-	virtual void postLoad() {}
+	virtual void postLoad();
 
 	/**
 	 * Save the data for the class to file
@@ -119,20 +118,23 @@ public:
 	/**
 	 * Called when a section is switched to
 	 */
-	virtual void enter(PetArea oldArea) {}
+	virtual void enter(PetArea oldArea);
 	
 	/**
 	 * Called when a section is being left, to switch to another area
 	 */
-	virtual void leave() {}
-	
-	virtual void proc23() {}
+	virtual void leave();
 
 	/**
 	 * Called when a new room is entered
 	 */
 	virtual void enterRoom(CRoomItem *room) {}
 
+	/**
+	 * Get a reference to the tooltip text associated with the section
+	 */
+	virtual CPetText *getText() { return &_text; }
+
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 6cc1c10..0911fd4 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -34,6 +34,7 @@ enum PetArea {
 };
 
 class CPetControl;
+class CPetText;
 class CScreenManager;
 class CRoomItem;
 
@@ -139,7 +140,12 @@ public:
 	virtual void enterRoom(CRoomItem *room) {}
 
 	virtual void proc25();
-	virtual int proc26() { return 0; }
+
+	/**
+	 * Get a reference to the tooltip text associated with the section
+	 */
+	virtual CPetText *getText() { return nullptr; }
+
 	virtual void proc27();
 	virtual void proc28();
 	virtual void proc29();
diff --git a/engines/titanic/pet_control/pet_sound.cpp b/engines/titanic/pet_control/pet_sound.cpp
index 75dff34..d4c6fb3 100644
--- a/engines/titanic/pet_control/pet_sound.cpp
+++ b/engines/titanic/pet_control/pet_sound.cpp
@@ -107,5 +107,18 @@ bool CPetSound::reset() {
 	return false;
 }
 
+void CPetSound::draw2(CScreenManager *screenManager) {
+	_element.draw(screenManager);
+	
+	_musicVolume.draw(screenManager);
+	_masterVolume.draw(screenManager);
+	_parrotVolume.draw(screenManager);
+	_speechVolume.draw(screenManager);
+
+	_textMusicVolume.draw(screenManager);
+	_textMasterVolume.draw(screenManager);
+	_textParrotVolume.draw(screenManager);
+	_textSpeechVolume.draw(screenManager);
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h
index de6c637..55e1f8a 100644
--- a/engines/titanic/pet_control/pet_sound.h
+++ b/engines/titanic/pet_control/pet_sound.h
@@ -55,6 +55,11 @@ public:
 	 * Reset the glyph
 	 */
 	virtual bool reset();
+
+	/**
+	 * Handles any secondary drawing of the glyph
+	 */
+	virtual void draw2(CScreenManager *screenManager);
 };
 
 } // End of namespace Titanic


Commit: 58e1a807f3c7c9e0342ef1edd964d6d13de57dc3
    https://github.com/scummvm/scummvm/commit/58e1a807f3c7c9e0342ef1edd964d6d13de57dc3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:47-04:00

Commit Message:
TITANIC: Clean up on element highlighting

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 1ab7d7e..7144378 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -38,7 +38,7 @@ void CPetGlyph::drawAt(CScreenManager *screenManager, const Point &pt) {
 	_element.translate(-pt.x, -pt.y);
 }
 
-void CPetGlyph::proc14(const Point &pt) {
+void CPetGlyph::proc14() {
 	warning("TODO: CPetGlyph::proc14");
 }
 
@@ -183,7 +183,34 @@ Rect CPetGlyphs::getRect(int index) {
 }
 
 void CPetGlyphs::changeHighlight(int index) {
-	warning("TODO: CPetGlyphs::changeHighlight");
+	if (index == _highlightIndex)
+		return;
+
+	if (_highlightIndex >= 0 && (_field20 & 4)) {
+		CPetGlyph *glyph = getGlyph(_highlightIndex);
+		if (glyph)
+			glyph->unhighlightCurrent();
+	}
+
+	_highlightIndex = index;
+	if (index >= 0) {
+		CPetGlyph *glyph = getGlyph(_highlightIndex);
+
+		if (glyph) {
+			if (_field20 & 4) {
+				Point pt;
+				int idx = getHighlightedIndex(_highlightIndex);
+				if (idx >= 0)
+					pt = getPosition(idx);
+
+				glyph->highlightCurrent(pt);
+			}
+
+			glyph->proc14();
+		}
+	} else if (_owner) {
+		_owner->proc28();
+	}
 }
 
 void CPetGlyphs::highlight(int index) {
@@ -281,11 +308,10 @@ bool CPetGlyphs::mouseButtonDown(const Point &pt) {
 			int index = getItemIndex(idx);
 			CPetGlyph *glyph = getGlyph(index);
 			if (glyph) {
-				if (index == _highlightIndex) {
-					glyph->proc28(glyphRect);
-					glyph->proc14(pt);
+				if (glyph->checkHighlight(pt))
 					return true;
-				} else {
+
+				if (!(_field20 & 2)) {
 					changeHighlight(index);
 					makePetDirty();
 					return true;
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 4966547..24d0a08 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -110,7 +110,7 @@ public:
 	 */
 	virtual void draw2(CScreenManager *screenManager) {}
 
-	virtual void proc14(const Point &pt);
+	virtual void proc14();
 
 	/**
 	 * Get the bounds for the glyph
@@ -150,7 +150,7 @@ public:
 	/**
 	 * Highlight any currently highlighted element
 	 */
-	virtual void highlightCurrent() {}
+	virtual void highlightCurrent(const Point &pt) {}
 
 	virtual void proc27(const Point &pt, bool flag) {}
 	virtual void proc28(const Point &pt) {}
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index b27b664..621bf2d 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -90,6 +90,10 @@ void CPetInventory::leave() {
 	_items.leave();
 }
 
+CGameObject *CPetInventory::getBackground(int index) const {
+	return (index >= 0 && index < 46) ? _itemBackgrounds[index] : nullptr;
+}
+
 bool CPetInventory::setPetControl(CPetControl *petControl) {
 	if (!petControl)
 		return false;
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index ed1b679..969e253 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -112,9 +112,7 @@ public:
 	 */
 	virtual void leave();
 	
-	virtual CGameObject *getBackground(int index) const {
-		return (index >= 0 && index < 46) ? _itemBackgrounds[index] : nullptr;
-	}
+	virtual CGameObject *getBackground(int index) const;
 
 	/**
 	 * 


Commit: 631d979fb3c213a2de8bf32a72236ab76e3ad1d8
    https://github.com/scummvm/scummvm/commit/631d979fb3c213a2de8bf32a72236ab76e3ad1d8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:48-04:00

Commit Message:
TITANIC: Fix mouse presses on PET glyphs

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_quit.cpp



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 7144378..632c8a3 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -308,14 +308,15 @@ bool CPetGlyphs::mouseButtonDown(const Point &pt) {
 			int index = getItemIndex(idx);
 			CPetGlyph *glyph = getGlyph(index);
 			if (glyph) {
-				if (glyph->checkHighlight(pt))
-					return true;
-
-				if (!(_field20 & 2)) {
+				if (_highlightIndex == index) {
+					glyph->proc28(glyphRect);
+					glyph->proc14();
+				} else {
 					changeHighlight(index);
 					makePetDirty();
-					return true;
 				}
+
+				return true;
 			}
 		}
 	}
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index be7257f..2f515a3 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -37,9 +37,9 @@ bool CPetQuit::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	_text.setHasBorder(true);
 	_text.setup();
 
-	Rect elementRect(0, 0, 496, 388);
-	elementRect.moveTo(496, 388);
-	_element.setBounds(elementRect);
+	Rect btnRect(0, 0, 496, 388);
+	btnRect.moveTo(496, 388);
+	_btnYes.setBounds(btnRect);
 	
 	return true;
 }


Commit: d11a95068c2566564e0372bad0ad5c656af79298
    https://github.com/scummvm/scummvm/commit/d11a95068c2566564e0372bad0ad5c656af79298
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:49-04:00

Commit Message:
TITANIC: Standardizing PET mouse button methods, quit is now working

Changed paths:
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_frame.cpp
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_load_save.cpp
    engines/titanic/pet_control/pet_quit.cpp
    engines/titanic/pet_control/pet_quit.h
    engines/titanic/pet_control/pet_real_life.cpp



diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index db6b122..3e9c991 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -40,8 +40,8 @@ bool CPetElement::highlightBounds(const Point &pt) {
 	return result;
 }
 
-bool CPetElement::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
-	bool result = _bounds.contains(msg->_mousePos);
+bool CPetElement::MouseButtonDownMsg(const Point &pt) {
+	bool result = _bounds.contains(pt);
 	if (result)
 		setMode(MODE_UNSELECTED);
 	return result;
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index 17e5881..effc575 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -77,7 +77,7 @@ public:
 	/**
 	 * Handles processing mouse button messages
 	 */
-	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	virtual bool MouseButtonDownMsg(const Point &pt);
 
 	/**
 	 * Returns whether the passed point falls inside the item
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index a9f45fa..827874f 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -65,7 +65,7 @@ bool CPetFrame::reset() {
 
 bool CPetFrame::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	for (int idx = 0; idx < 5; ++idx) {
-		if (_modeButtons[idx].MouseButtonDownMsg(msg)) {
+		if (_modeButtons[idx].MouseButtonDownMsg(msg->_mousePos)) {
 			_petControl->setArea(PET_AREAS[idx]);
 			resetArea();
 			_modeButtons[idx].setMode(MODE_SELECTED);
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 632c8a3..20f864d 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -291,7 +291,7 @@ void CPetGlyphs::makePetDirty() {
 		_owner->_petControl->makeDirty();
 }
 
-bool CPetGlyphs::mouseButtonDown(const Point &pt) {
+bool CPetGlyphs::MouseButtonDownMsg(const Point &pt) {
 	if (_scrollLeft.contains2(pt)) {
 		scrollLeft();
 		return true;
@@ -338,11 +338,11 @@ bool CPetGlyphs::mouseButtonDown(const Point &pt) {
 	return false;
 }
 
-bool CPetGlyphs::mouseButtonUp(const Point &pt) {
+bool CPetGlyphs::MouseButtonUpMsg(const Point &pt) {
 	if (_highlightIndex >= 0) {
 		CPetGlyph *glyph = getGlyph(_highlightIndex);
 		if (glyph) {
-			if (glyph->MouseButtonMsg(pt))
+			if (glyph->MouseButtonUpMsg(pt))
 				return true;
 		}
 	}
@@ -350,7 +350,7 @@ bool CPetGlyphs::mouseButtonUp(const Point &pt) {
 	return false;
 }
 
-bool CPetGlyphs::mouseDragStart(CMouseDragStartMsg *msg) {
+bool CPetGlyphs::MouseDragStartMsg(CMouseDragStartMsg *msg) {
 	if (!(_field20 & 1) && _highlightIndex >= 0) {
 		CPetGlyph *glyph = getGlyph(_highlightIndex);
 		int index = getHighlightedIndex(_highlightIndex);
@@ -365,7 +365,7 @@ bool CPetGlyphs::mouseDragStart(CMouseDragStartMsg *msg) {
 	return false;
 }
 
-bool CPetGlyphs::mouseDragMove(CMouseDragMoveMsg *msg) {
+bool CPetGlyphs::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
 	if (_field94) {
 		error("TODO");
 	} else {
@@ -373,7 +373,7 @@ bool CPetGlyphs::mouseDragMove(CMouseDragMoveMsg *msg) {
 	}
 }
 
-bool CPetGlyphs::mouseDragEnd(CMouseDragEndMsg *msg) {
+bool CPetGlyphs::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 	if (_field94) {
 		error("TODO");
 	} else {
@@ -381,7 +381,7 @@ bool CPetGlyphs::mouseDragEnd(CMouseDragEndMsg *msg) {
 	}
 }
 
-bool CPetGlyphs::keyCharMsg(int key) {
+bool CPetGlyphs::KeyCharMsg(int key) {
 	if (_highlightIndex >= 0) {
 		CPetGlyph *glyph = getGlyph(_highlightIndex);
 
@@ -392,7 +392,7 @@ bool CPetGlyphs::keyCharMsg(int key) {
 	return false;
 }
 
-bool CPetGlyphs::virtualKeyCharMsg(int key) {
+bool CPetGlyphs::VirtualKeyCharMsg(int key) {
 	bool handled = false;
 	warning("TODO: CPetGlyphs::virtualKeyCharMsg");
 
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 24d0a08..80c2153 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -128,9 +128,9 @@ public:
 	virtual int proc19() { return 0; }
 
 	/**
-	 * Handles mouse button messages
+	 * Handles mouse button up messages
 	 */
-	virtual bool MouseButtonMsg(const Point &pt) { return false; }
+	virtual bool MouseButtonUpMsg(const Point &pt) { return false; }
 	
 	virtual int proc21() { return 0; }
 	virtual int proc22() { return 0; }
@@ -312,37 +312,37 @@ public:
 	/**
 	 * Mouse button down message
 	 */
-	bool mouseButtonDown(const Point &pt);
+	bool MouseButtonDownMsg(const Point &pt);
 
 	/**
 	 * Mouse button up message
 	 */
-	bool mouseButtonUp(const Point &pt);
+	bool MouseButtonUpMsg(const Point &pt);
 
 	/**
 	 * Mouse drag start messagge
 	 */
-	bool mouseDragStart(CMouseDragStartMsg *msg);
+	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
 
 	/**
 	 * Mouse drag move message
 	 */
-	bool mouseDragMove(CMouseDragMoveMsg *msg);
+	bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
 
 	/**
 	 * Mouse drag end message
 	 */
-	bool mouseDragEnd(CMouseDragEndMsg *msg);
+	bool MouseDragEndMsg(CMouseDragEndMsg *msg);
 
 	/**
 	 * Key character message
 	 */
-	bool keyCharMsg(int key);
+	bool KeyCharMsg(int key);
 
 	/**
 	 * Virtual key message
 	 */
-	bool virtualKeyCharMsg(int key);
+	bool VirtualKeyCharMsg(int key);
 
 	/**
 	 * When the PET section is entered, passes onto the highlighted
diff --git a/engines/titanic/pet_control/pet_load_save.cpp b/engines/titanic/pet_control/pet_load_save.cpp
index 4ebe9d0..f777f12 100644
--- a/engines/titanic/pet_control/pet_load_save.cpp
+++ b/engines/titanic/pet_control/pet_load_save.cpp
@@ -80,7 +80,7 @@ bool CPetLoadSave::checkHighlight(const Point &pt) {
 }
 
 bool CPetLoadSave::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
-	if (_btnLoadSave.MouseButtonDownMsg(msg)) {
+	if (_btnLoadSave.MouseButtonDownMsg(msg->_mousePos)) {
 		execute();
 		resetSlots();
 		return true;
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index 2f515a3..e6c354a 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -70,9 +70,9 @@ bool CPetQuit::checkHighlight(const Point &pt) {
 	return !_btnYes.highlightBounds(pt);
 }
 
-bool CPetQuit::mouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+bool CPetQuit::MouseButtonUpMsg(const Point &pt) {
 	CPetControl *pet = getPetControl();
-	if (_btnYes.MouseButtonDownMsg(msg) && pet) {
+	if (_btnYes.MouseButtonDownMsg(pt) && pet) {
 		CGameManager *gameManager = pet->getGameManager();
 		if (gameManager)
 			gameManager->_gameState._quitGame = true;
diff --git a/engines/titanic/pet_control/pet_quit.h b/engines/titanic/pet_control/pet_quit.h
index cfe3e6f..72b93c1 100644
--- a/engines/titanic/pet_control/pet_quit.h
+++ b/engines/titanic/pet_control/pet_quit.h
@@ -55,8 +55,11 @@ public:
 	 */
 	virtual bool checkHighlight(const Point &pt);
 
-	virtual bool mouseButtonDownMsg(CMouseButtonDownMsg *msg);
-
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt);
+	
 	/**
 	 * Returns the tooltip text for when the glyph is selected
 	 */
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
index ec1ea2c..5970204 100644
--- a/engines/titanic/pet_control/pet_real_life.cpp
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -51,32 +51,32 @@ void CPetRealLife::draw(CScreenManager *screenManager) {
 }
 
 bool CPetRealLife::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
-	return _glyphs.mouseButtonDown(msg->_mousePos);
+	return _glyphs.MouseButtonDownMsg(msg->_mousePos);
 }
 
 bool CPetRealLife::MouseDragStartMsg(CMouseDragStartMsg *msg) {
-	return _glyphs.mouseDragStart(msg);
+	return _glyphs.MouseDragStartMsg(msg);
 }
 
 bool CPetRealLife::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
-	return _glyphs.mouseDragMove(msg);
+	return _glyphs.MouseDragMoveMsg(msg);
 }
 
 bool CPetRealLife::MouseDragEndMsg(CMouseDragEndMsg *msg) {
-	return _glyphs.mouseDragEnd(msg);
+	return _glyphs.MouseDragEndMsg(msg);
 }
 
 bool CPetRealLife::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
-	return _glyphs.mouseButtonUp(msg->_mousePos);
+	return _glyphs.MouseButtonUpMsg(msg->_mousePos);
 }
 
 bool CPetRealLife::KeyCharMsg(CKeyCharMsg *msg) {
-	_glyphs.keyCharMsg(msg->_key);
+	_glyphs.KeyCharMsg(msg->_key);
 	return true;
 }
 
 bool CPetRealLife::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
-	return _glyphs.virtualKeyCharMsg(msg->_keyState.keycode);
+	return _glyphs.VirtualKeyCharMsg(msg->_keyState.keycode);
 }
 
 void CPetRealLife::postLoad() {


Commit: fc3f2952b097cd0d465efe0216b11602c5ab0191
    https://github.com/scummvm/scummvm/commit/fc3f2952b097cd0d465efe0216b11602c5ab0191
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:50-04:00

Commit Message:
TITANIC: Define Glyph flags enum

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_quit.cpp
    engines/titanic/pet_control/pet_real_life.cpp



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 20f864d..6c54548 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -67,7 +67,7 @@ void CPetGlyph::setName(const CString &name, CPetControl *petControl) {
 /*------------------------------------------------------------------------*/
 
 CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0),  _numVisibleGlyphs(TOTAL_GLYPHS),
-		_highlightIndex(-1), _field1C(-1), _field20(0),
+		_highlightIndex(-1), _field1C(-1), _flags(0),
 		_field94(nullptr), _owner(nullptr) {
 }
 
@@ -159,7 +159,7 @@ void CPetGlyphs::draw(CScreenManager *screenManager) {
 	}
 
 	// Draw scrolling arrows if more than a screen's worth of items are showing
-	if (listSize > _numVisibleGlyphs || _field20 != 16) {
+	if (listSize > _numVisibleGlyphs || (_flags & GFLAG_16)) {
 		_scrollLeft.draw(screenManager);
 		_scrollRight.draw(screenManager);
 	}
@@ -186,7 +186,7 @@ void CPetGlyphs::changeHighlight(int index) {
 	if (index == _highlightIndex)
 		return;
 
-	if (_highlightIndex >= 0 && (_field20 & 4)) {
+	if (_highlightIndex >= 0 && (_flags & GFLAG_4)) {
 		CPetGlyph *glyph = getGlyph(_highlightIndex);
 		if (glyph)
 			glyph->unhighlightCurrent();
@@ -197,7 +197,7 @@ void CPetGlyphs::changeHighlight(int index) {
 		CPetGlyph *glyph = getGlyph(_highlightIndex);
 
 		if (glyph) {
-			if (_field20 & 4) {
+			if (_flags & GFLAG_4) {
 				Point pt;
 				int idx = getHighlightedIndex(_highlightIndex);
 				if (idx >= 0)
@@ -243,7 +243,7 @@ void CPetGlyphs::setFirstVisible(int index) {
 	if (index != _firstVisibleIndex) {
 		_firstVisibleIndex = index;
 
-		if ((_field20 & 8) && _highlightIndex != -1) {
+		if ((_flags & GFLAG_8) && _highlightIndex != -1) {
 			CPetGlyph *glyph = getGlyph(_highlightIndex);
 			
 			if (glyph) {
@@ -328,7 +328,7 @@ bool CPetGlyphs::MouseButtonDownMsg(const Point &pt) {
 			if (glyph->checkHighlight(pt))
 				return true;
 
-			if (!(_field20 & 2)) {
+			if (!(_flags & GFLAG_2)) {
 				changeHighlight(-1);
 				makePetDirty();
 			}
@@ -351,7 +351,7 @@ bool CPetGlyphs::MouseButtonUpMsg(const Point &pt) {
 }
 
 bool CPetGlyphs::MouseDragStartMsg(CMouseDragStartMsg *msg) {
-	if (!(_field20 & 1) && _highlightIndex >= 0) {
+	if (!(_flags & GFLAG_1) && _highlightIndex >= 0) {
 		CPetGlyph *glyph = getGlyph(_highlightIndex);
 		int index = getHighlightedIndex(_highlightIndex);
 		Rect glyphRect = getRect(index);
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 80c2153..c7966e5 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -38,6 +38,8 @@ class CPetText;
 
 enum GlyphActionMode { ACTION_REMOVE = 0, ACTION_REMOVED = 1, ACTION_CHANGE = 2 };
 
+enum GlyphFlag { GFLAG_1 = 1, GFLAG_2 = 2, GFLAG_4 = 4, GFLAG_8 = 8, GFLAG_16 = 16 };
+
 class CGlyphAction {
 protected:
 	GlyphActionMode _mode;
@@ -242,7 +244,7 @@ protected:
 	int _numVisibleGlyphs;
 	int _highlightIndex;
 	int _field1C;
-	int _field20;
+	int _flags;
 	void *_field94;
 	CPetSection *_owner;
 	CPetGfxElement _selection;
@@ -287,7 +289,7 @@ public:
 	 */
 	virtual bool leave();
 
-	void set20(int val) { _field20 = val; }
+	void setFlags(int flags) { _flags = flags; }
 
 	/**
 	 * Draw the control
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 621bf2d..c7c6dfd 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -100,7 +100,7 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
 
 	_petControl = petControl;
 	_items.setup(7,  this);
-	_items.set20(28);
+	_items.setFlags(28);
 
 	Rect tempRect(0, 0, 52, 52);
 	for (uint idx = 0; idx < TOTAL_ITEMS; ++idx) {
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index e6c354a..c191e30 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -62,7 +62,7 @@ bool CPetQuit::reset() {
 }
 
 void CPetQuit::draw2(CScreenManager *screenManager) {
-	_text.draw(screenManager);
+//	_text.draw(screenManager);
 	_btnYes.draw(screenManager);
 }
 
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
index 5970204..27a5c22 100644
--- a/engines/titanic/pet_control/pet_real_life.cpp
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -100,7 +100,7 @@ bool CPetRealLife::setupControl(CPetControl *petControl) {
 	if (petControl) {
 		_petControl = petControl;
 		_glyphs.setup(4, this);
-		_glyphs.set20(6);
+		_glyphs.setFlags(6);
 
 		addButton(new CPetLoad());
 		addButton(new CPetSave());


Commit: a8d4e827d23110e978319a2a6d7f036d16c7f66a
    https://github.com/scummvm/scummvm/commit/a8d4e827d23110e978319a2a6d7f036d16c7f66a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:51-04:00

Commit Message:
TITANIC: Correct coordinates in CPetQuit setup

Changed paths:
    engines/titanic/pet_control/pet_quit.cpp



diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index c191e30..7dcaba8 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -30,14 +30,15 @@ namespace Titanic {
 
 bool CPetQuit::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	CPetGlyph::setup(petControl, owner);
+
 	Rect tempRect(0, 0, 280, 16);
-	tempRect.moveTo(32, 407);
+	tempRect.moveTo(322, 407);
 	_text.setBounds(tempRect);
 	_text.resize(3);
 	_text.setHasBorder(true);
 	_text.setup();
 
-	Rect btnRect(0, 0, 496, 388);
+	Rect btnRect(0, 0, 68, 52);
 	btnRect.moveTo(496, 388);
 	_btnYes.setBounds(btnRect);
 	
@@ -62,7 +63,7 @@ bool CPetQuit::reset() {
 }
 
 void CPetQuit::draw2(CScreenManager *screenManager) {
-//	_text.draw(screenManager);
+	_text.draw(screenManager);
 	_btnYes.draw(screenManager);
 }
 


Commit: f6f68e547d39957fc4678859a95cbec839cc41e4
    https://github.com/scummvm/scummvm/commit/f6f68e547d39957fc4678859a95cbec839cc41e4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:52-04:00

Commit Message:
TITANIC: Implement changing sound slider percentages

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_slider.cpp
    engines/titanic/pet_control/pet_slider.h
    engines/titanic/pet_control/pet_sound.cpp
    engines/titanic/pet_control/pet_sound.h
    engines/titanic/sound/sound.h
    engines/titanic/sound/sound_manager.cpp
    engines/titanic/sound/sound_manager.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 0bba2c2..145543f 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -423,4 +423,12 @@ void CPetControl::moveToHiddenRoom(CTreeItem *item) {
 	}
 }
 
+void CPetControl::playSound(int soundNum) {
+	CTreeItem *player = getHiddenObject("PETSoundPlayer");
+	if (player) {
+		CPETPlaySoundMsg playMsg(soundNum);
+		playMsg.execute(player);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index e7ec993..e4f0710 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -240,6 +240,11 @@ public:
 	void moveToHiddenRoom(CTreeItem *item);
 
 	void setC8(int val) { _fieldC8 = val; }
+
+	/**
+	 * Play a sound
+	 */
+	void playSound(int soundNum);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_slider.cpp b/engines/titanic/pet_control/pet_slider.cpp
index 3e579a4..1bbad96 100644
--- a/engines/titanic/pet_control/pet_slider.cpp
+++ b/engines/titanic/pet_control/pet_slider.cpp
@@ -168,6 +168,18 @@ void CPetSlider::setOrientation(SliderOrientation orientation) {
 	_orientation |= orientation;
 }
 
+void CPetSlider::stepPosition(int direction) {
+	double val = getOffsetPixels();
+
+	if (direction == -1) {
+		val = MAX(val - 0.1, 0.0);
+	} else if (direction == 1) {
+		val = MIN(val + 0.1, 1.0);
+	}
+
+	setSliderOffset(val);
+}
+
 /*------------------------------------------------------------------------*/
 
 void CPetSoundSlider::setupBackground(const CString &name, CPetControl *petControl) {
diff --git a/engines/titanic/pet_control/pet_slider.h b/engines/titanic/pet_control/pet_slider.h
index 7a61741..58b2aa6 100644
--- a/engines/titanic/pet_control/pet_slider.h
+++ b/engines/titanic/pet_control/pet_slider.h
@@ -180,6 +180,11 @@ public:
 		_bounds.translate(pt.x, pt.y);
 		_slidingRect.translate(pt.x, pt.y);
 	}
+
+	/**
+	 * Change the current position of a slider by a step amount
+	 */
+	void stepPosition(int direction);
 };
 
 class CPetSoundSlider : public CPetSlider {
diff --git a/engines/titanic/pet_control/pet_sound.cpp b/engines/titanic/pet_control/pet_sound.cpp
index d4c6fb3..2305f42 100644
--- a/engines/titanic/pet_control/pet_sound.cpp
+++ b/engines/titanic/pet_control/pet_sound.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/pet_control/pet_sound.h"
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/game_manager.h"
 
 namespace Titanic {
 
@@ -121,4 +122,80 @@ void CPetSound::draw2(CScreenManager *screenManager) {
 	_textSpeechVolume.draw(screenManager);
 }
 
+bool CPetSound::checkHighlight(const Point &pt) {
+	if (_musicVolume.checkThumb(pt) || _masterVolume.checkThumb(pt) ||
+		_speechVolume.checkThumb(pt))
+		return true;
+
+	if (_parrotVolume.checkThumb(pt)) {
+		CPetControl *pet = getPetControl();
+		if (pet)
+			pet->playSound(2);
+
+		return true;
+	}
+
+	Rect rectLeft(0, 0, 10, 11);
+	Rect rectRight(0, 0, 10, 11);
+	rectLeft.translate(415, 379);
+	rectRight.translate(567, 378);
+
+	CPetSlider *sliders[4] = { &_masterVolume, &_musicVolume, &_parrotVolume, &_speechVolume };
+	for (int idx = 0; idx < 4; ++idx) {
+		CPetSlider *slider = sliders[idx];
+		bool isLeft = rectLeft.contains(pt);
+		bool isRight = rectRight.contains(pt);
+		int offset;
+
+		if (isLeft) {
+			slider->stepPosition(-1);
+			offset = slider->getOffsetPixels();
+		} else if (isRight) {
+			slider->stepPosition(1);
+			offset = slider->getOffsetPixels();
+		}
+
+		if (isLeft || isRight) {
+			sliderChanged(offset, idx);
+			return true;
+		}
+
+		// Move to next slider row
+		rectLeft.translate(0, 20);
+		rectRight.translate(0, 20);
+	}
+
+	return false;
+}
+
+void CPetSound::sliderChanged(double offset, int sliderNum) {
+	CPetControl *pet = getPetControl();
+	if (!pet)
+		return;
+	
+	CGameManager *gameManager = pet->getGameManager();
+	if (!gameManager)
+		return;
+
+	QSoundManager &soundManager = gameManager->_sound._soundManager;
+	double percent = offset * 100.0;
+
+	switch (sliderNum) {
+	case 0:
+		soundManager.setMasterPercent(percent);
+		break;
+	case 1:
+		soundManager.setMusicPercent(percent);
+		break;
+	case 2:
+		soundManager.setParrotPercent(percent);
+		break;
+	case 3:
+		soundManager.setSpeechPercent(percent);
+		break;
+	default:
+		break;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h
index 55e1f8a..36b6a8b 100644
--- a/engines/titanic/pet_control/pet_sound.h
+++ b/engines/titanic/pet_control/pet_sound.h
@@ -43,6 +43,11 @@ private:
 	CPetText _textSpeechVolume;
 	int _field198;
 	int _field19C;
+private:
+	/**
+	 * Called when a slider has changed
+	 */
+	void sliderChanged(double offset, int sliderNum);
 public:
 	CPetSound();
 
@@ -60,6 +65,12 @@ public:
 	 * Handles any secondary drawing of the glyph
 	 */
 	virtual void draw2(CScreenManager *screenManager);
+
+	/**
+	 * Checks and updates any highlight of the glyph or any contextual
+	 * information it displays
+	 */
+	virtual bool checkHighlight(const Point &pt);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index 0730026..488d4de 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -34,6 +34,7 @@ class CGameManager;
 class CSound {
 private:
 	CGameManager *_gameManager;
+public:
 	QSoundManager _soundManager;
 public:
 	CSound(CGameManager *owner);
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index 9b78a9e..53e5a3d 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -24,8 +24,8 @@
 
 namespace Titanic {
 
-SoundManager::SoundManager() : _field4(0), _field8(0),
-	_fieldC(0), _field10(0), _field14(1) {
+SoundManager::SoundManager() : _musicPercent(75.0), _speechPercent(75.0),
+	_masterPercent(75.0), _parrotPercent(75.0), _field14(1) {
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index d37db60..68843dd 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -29,10 +29,10 @@ namespace Titanic {
 
 class SoundManager {
 protected:
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
+	double _musicPercent;
+	double _speechPercent;
+	double _masterPercent;
+	double _parrotPercent;
 	int _field14;
 public:
 	SoundManager();
@@ -53,10 +53,10 @@ public:
 	virtual int proc16() const { return 0; }
 	virtual void WaveMixPump() {}
 	virtual int proc18() const { return 0; }
-	virtual void proc19(int v) { _field4 = v; }
-	virtual void proc20(int v) { _field8 = v; }
-	virtual void proc21(int v) { _fieldC = v; }
-	virtual void proc22(int v) { _field10 = v; }
+	virtual void setMusicPercent(double percent) { _musicPercent = percent; }
+	virtual void setSpeechPercent(double percent) { _speechPercent = percent; }
+	virtual void setMasterPercent(double percent) { _masterPercent = percent; }
+	virtual void setParrotPercent(double percent) { _parrotPercent = percent; }
 
 	/**
 	 * Called when a game is about to be loaded


Commit: 2b1e045b5c57f1bae61bd3ffbd05577062f6f34c
    https://github.com/scummvm/scummvm/commit/2b1e045b5c57f1bae61bd3ffbd05577062f6f34c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:53-04:00

Commit Message:
TITANIC: Implemented remainder of CPetSound methods

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_slider.cpp
    engines/titanic/pet_control/pet_slider.h
    engines/titanic/pet_control/pet_sound.cpp
    engines/titanic/pet_control/pet_sound.h



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 6c54548..fd4828a 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -68,7 +68,7 @@ void CPetGlyph::setName(const CString &name, CPetControl *petControl) {
 
 CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0),  _numVisibleGlyphs(TOTAL_GLYPHS),
 		_highlightIndex(-1), _field1C(-1), _flags(0),
-		_field94(nullptr), _owner(nullptr) {
+		_dragGlyph(nullptr), _owner(nullptr) {
 }
 
 void CPetGlyphs::setNumVisible(int total) {
@@ -366,16 +366,16 @@ bool CPetGlyphs::MouseDragStartMsg(CMouseDragStartMsg *msg) {
 }
 
 bool CPetGlyphs::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
-	if (_field94) {
-		error("TODO");
+	if (_dragGlyph) {
+		return _dragGlyph->MouseDragMoveMsg(msg);
 	} else {
 		return false;
 	}
 }
 
 bool CPetGlyphs::MouseDragEndMsg(CMouseDragEndMsg *msg) {
-	if (_field94) {
-		error("TODO");
+	if (_dragGlyph) {
+		return _dragGlyph->MouseDragEndMsg(msg);
 	} else {
 		return false;
 	}
@@ -419,4 +419,15 @@ bool CPetGlyphs::leaveHighlighted() {
 		return false;
 }
 
+void CPetGlyphs::startDragging(CPetGlyph *glyph, CMouseDragStartMsg *msg) {
+	if (glyph) {
+		_dragGlyph = glyph;
+		msg->_dragItem = getPetControl();
+	}
+}
+
+void CPetGlyphs::endDragging() {
+	_dragGlyph = nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index c7966e5..e4f4b1f 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -25,6 +25,7 @@
 
 #include "common/keyboard.h"
 #include "titanic/core/list.h"
+#include "titanic/messages/mouse_messages.h"
 #include "titanic/pet_control/pet_gfx_element.h"
 #include "titanic/support/rect.h"
 
@@ -125,9 +126,20 @@ public:
 	 */
 	virtual bool checkHighlight(const Point &pt) { return false; }
 
-	virtual bool MouseDragStartMsg(const CMouseDragStartMsg *msg) { return false; }
-	virtual int proc18() { return 0; }
-	virtual int proc19() { return 0; }
+	/**
+	 * Called when mouse drag starts
+	 */
+	virtual bool MouseDragStartMsg(CMouseDragStartMsg *msg) { return false; }
+
+	/**
+	 * Called during mouse drags
+	 */
+	virtual bool MouseDragMoveMsg(CMouseDragMoveMsg *msg) { return false; }
+
+	/**
+	 * Called when mouse drag ends
+	 */
+	virtual bool MouseDragEndMsg(CMouseDragEndMsg *msg) { return false; }
 
 	/**
 	 * Handles mouse button up messages
@@ -245,7 +257,7 @@ protected:
 	int _highlightIndex;
 	int _field1C;
 	int _flags;
-	void *_field94;
+	CPetGlyph *_dragGlyph;
 	CPetSection *_owner;
 	CPetGfxElement _selection;
 	CPetGfxElement _scrollLeft;
@@ -357,6 +369,16 @@ public:
 	 * glyph, if any
 	 */
 	bool leaveHighlighted();
+
+	/**
+	 * Called when a dragging operation starts
+	 */
+	void startDragging(CPetGlyph *glyph, CMouseDragStartMsg *msg);
+
+	/**
+	 * Called when a dragging operation ends
+	 */
+	void endDragging();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_slider.cpp b/engines/titanic/pet_control/pet_slider.cpp
index 1bbad96..e8f31a7 100644
--- a/engines/titanic/pet_control/pet_slider.cpp
+++ b/engines/titanic/pet_control/pet_slider.cpp
@@ -53,12 +53,13 @@ bool CPetSlider::resetThumbFocus() {
 	return result;
 }
 
-void CPetSlider::proc10(const Point &pt) {
+bool CPetSlider::MouseDragMoveMsg(const Point &pt) {
 	int newOffset = calcSliderOffset(pt);
 	setOffsetPixels(newOffset);
+	return true;
 }
 
-bool CPetSlider::proc12(const Point &pt) {
+bool CPetSlider::MouseButtonUpMsg(const Point &pt) {
 	if (thumbContains(pt))
 		return true;
 	if (!containsPt(pt))
diff --git a/engines/titanic/pet_control/pet_slider.h b/engines/titanic/pet_control/pet_slider.h
index 58b2aa6..93390a5 100644
--- a/engines/titanic/pet_control/pet_slider.h
+++ b/engines/titanic/pet_control/pet_slider.h
@@ -126,9 +126,21 @@ public:
 	 */
 	virtual bool resetThumbFocus();
 
-	virtual void proc10(const Point &pt);
-	virtual bool proc11() { return true; }
-	virtual bool proc12(const Point &pt);
+	/**
+	 * Handles dragging the slider
+	 */
+	virtual bool MouseDragMoveMsg(const Point &pt);
+	
+	/**
+	 * Called when a slider drag ends
+	 */
+	virtual bool MouseDragEndMsg(const Point &pt) { return true; }
+
+	/**
+	 * Handles mouse button up messaes
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt);
+
 	virtual bool proc13() { return false; }
 	virtual bool proc14() { return false; }
 	
diff --git a/engines/titanic/pet_control/pet_sound.cpp b/engines/titanic/pet_control/pet_sound.cpp
index 2305f42..736b966 100644
--- a/engines/titanic/pet_control/pet_sound.cpp
+++ b/engines/titanic/pet_control/pet_sound.cpp
@@ -22,11 +22,12 @@
 
 #include "titanic/pet_control/pet_sound.h"
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/pet_control/pet_real_life.h"
 #include "titanic/game_manager.h"
 
 namespace Titanic {
 
-CPetSound::CPetSound() : CPetGlyph(), _field198(0), _field19C(0) {
+CPetSound::CPetSound() : CPetGlyph(), _draggingSlider(nullptr), _draggingSliderNum(0) {
 }
 
 bool CPetSound::setup(CPetControl *petControl, CPetGlyphs *owner) {
@@ -198,4 +199,83 @@ void CPetSound::sliderChanged(double offset, int sliderNum) {
 	}
 }
 
+bool CPetSound::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+	if (_musicVolume.resetThumbFocus()) {
+		_draggingSlider = &_musicVolume;
+		getOwner()->startDragging(this, msg);
+		_draggingSliderNum = 0;
+		return true;
+	} else if (_masterVolume.resetThumbFocus()) {
+		_draggingSlider = &_masterVolume;
+		getOwner()->startDragging(this, msg);
+		_draggingSliderNum = 1;
+		return true;
+	} else if (_parrotVolume.resetThumbFocus()) {
+		_draggingSlider = &_parrotVolume;
+		getOwner()->startDragging(this, msg);
+		_draggingSliderNum = 2;
+		return true;
+	} else if (_speechVolume.resetThumbFocus()) {
+		_draggingSlider = &_speechVolume;
+		getOwner()->startDragging(this, msg);
+		_draggingSliderNum = 3;
+		return true;
+	}
+
+	_draggingSlider = nullptr;
+	return false;
+}
+
+bool CPetSound::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
+	if (!_draggingSlider)
+		return false;
+
+	if (_draggingSlider->MouseDragMoveMsg(msg->_mousePos)) {
+		double offset = _draggingSlider->getOffsetPixels();
+		sliderChanged(offset, _draggingSliderNum);
+		getPetControl()->makeDirty();
+		return true;
+	}
+
+	return false;
+}
+
+bool CPetSound::MouseDragEndMsg(CMouseDragEndMsg *msg) {
+	if (!_draggingSlider)
+		return false;
+
+	_draggingSlider->MouseDragEndMsg(msg->_mousePos);
+	getOwner()->endDragging();
+
+	return false;
+}
+
+bool CPetSound::MouseButtonUpMsg(const Point &pt) {
+	int sliderNum = 0;
+	CPetSlider *slider = nullptr;
+
+	if (_musicVolume.MouseButtonUpMsg(pt)) {
+		sliderNum = 0;
+		slider = &_musicVolume;
+	} else if (_masterVolume.MouseButtonUpMsg(pt)) {
+		sliderNum = 1;
+		slider = &_masterVolume;
+	} else if (_parrotVolume.MouseButtonUpMsg(pt)) {
+		sliderNum = 2;
+		slider = &_parrotVolume;
+	} else if (_speechVolume.MouseButtonUpMsg(pt)) {
+		sliderNum = 3;
+		slider = &_speechVolume;
+	} else {
+		return false;
+	}
+
+	double offset = slider->getOffsetPixels();
+	sliderChanged(offset, sliderNum);
+}
+
+void CPetSound::getTooltip(CPetText *text) {
+	text->setText("Change the volume settings.");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h
index 36b6a8b..3727780 100644
--- a/engines/titanic/pet_control/pet_sound.h
+++ b/engines/titanic/pet_control/pet_sound.h
@@ -30,6 +30,8 @@
 
 namespace Titanic {
 
+class CPetRealLife;
+
 class CPetSound : public CPetGlyph {
 private:
 	CPetGfxElement _element;
@@ -41,8 +43,8 @@ private:
 	CPetText _textMusicVolume;
 	CPetText _textParrotVolume;
 	CPetText _textSpeechVolume;
-	int _field198;
-	int _field19C;
+	CPetSlider *_draggingSlider;
+	int _draggingSliderNum;
 private:
 	/**
 	 * Called when a slider has changed
@@ -71,6 +73,36 @@ public:
 	 * information it displays
 	 */
 	virtual bool checkHighlight(const Point &pt);
+
+	/**
+	 * Called when mouse drag starts
+	 */
+	virtual bool MouseDragStartMsg(CMouseDragStartMsg *msg);
+
+	/**
+	 * Called during mouse drags
+	 */
+	virtual bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
+
+	/**
+	 * Called when mouse drag ends
+	 */
+	virtual bool MouseDragEndMsg(CMouseDragEndMsg *msg);
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt);
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+
+	/**
+	 * Get the parent RealLife area
+	 */
+	CPetGlyphs *getOwner() { return _owner; }
 };
 
 } // End of namespace Titanic


Commit: 730895a9ea4a5f1c2032cb552d9221ad22fb8e5f
    https://github.com/scummvm/scummvm/commit/730895a9ea4a5f1c2032cb552d9221ad22fb8e5f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:54-04:00

Commit Message:
TITANIC: Cleaning up CPetLoad & CPetSave methods

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_load.h
    engines/titanic/pet_control/pet_save.h



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index fd4828a..914ddbb 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -412,11 +412,9 @@ bool CPetGlyphs::enterHighlighted() {
 		return false;
 }
 
-bool CPetGlyphs::leaveHighlighted() {
+void CPetGlyphs::leaveHighlighted() {
 	if (_highlightIndex >= 0)
-		return getGlyph(_highlightIndex)->leaveHighlighted();
-	else
-		return false;
+		getGlyph(_highlightIndex)->leaveHighlighted();
 }
 
 void CPetGlyphs::startDragging(CPetGlyph *glyph, CMouseDragStartMsg *msg) {
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index e4f4b1f..883c799 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -194,7 +194,7 @@ public:
 	/**
 	 * Called on a highlighted item when PET area is left
 	 */
-	virtual bool leaveHighlighted() { return false; }
+	virtual void leaveHighlighted() {}
 
 	virtual int proc37() { return 0; }
 
@@ -368,7 +368,7 @@ public:
 	 * When the PET section is left, passes onto the highlighted
 	 * glyph, if any
 	 */
-	bool leaveHighlighted();
+	void leaveHighlighted();
 
 	/**
 	 * Called when a dragging operation starts
diff --git a/engines/titanic/pet_control/pet_load.h b/engines/titanic/pet_control/pet_load.h
index 093fca0..f87cd8a 100644
--- a/engines/titanic/pet_control/pet_load.h
+++ b/engines/titanic/pet_control/pet_load.h
@@ -58,7 +58,6 @@ public:
 	 * Executes the loading or saving
 	 */
 	virtual void execute();
-
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_save.h b/engines/titanic/pet_control/pet_save.h
index 006b2cd..106d499 100644
--- a/engines/titanic/pet_control/pet_save.h
+++ b/engines/titanic/pet_control/pet_save.h
@@ -50,6 +50,19 @@ public:
 	virtual void getTooltip(CPetText *text);
 
 	/**
+	 * Called on a highlighted item when PET area is entered
+	 */
+	virtual bool enterHighlighted() { 
+		highlightSave(_savegameSlotNum);
+		return true;
+	}
+	
+	/**
+	 * Called on a highlighted item when PET area is left
+	 */
+	virtual void leaveHighlighted() { unhighlightSave(_savegameSlotNum); }
+
+	/**
 	 * Highlights a save slot
 	 */
 	virtual void highlightSave(int index);


Commit: 73258800cf10f94cee5a9745649f8c5dbb67109c
    https://github.com/scummvm/scummvm/commit/73258800cf10f94cee5a9745649f8c5dbb67109c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:56-04:00

Commit Message:
TITANIC: Beginnings of CPetRooms

Changed paths:
  A engines/titanic/pet_control/pet_rooms_glyphs.cpp
  A engines/titanic/pet_control/pet_rooms_glyphs.h
  R engines/titanic/pet_control/pet_control_list_item2.cpp
  R engines/titanic/pet_control/pet_control_list_item2.h
  R engines/titanic/pet_control/pet_control_sub11.cpp
  R engines/titanic/pet_control/pet_control_sub11.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 3a47bed..6875e90 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -356,7 +356,6 @@ MODULE_OBJS := \
 	npcs/titania.o \
 	npcs/true_talk_npc.o \
 	pet_control/pet_control.o \
-	pet_control/pet_control_list_item2.o \
 	pet_control/pet_conversations.o \
 	pet_control/pet_element.o \
 	pet_control/pet_frame.o \
@@ -364,12 +363,12 @@ MODULE_OBJS := \
 	pet_control/pet_inventory.o \
 	pet_control/pet_inventory_glyphs.o \
 	pet_control/pet_rooms.o \
+	pet_control/pet_rooms_glyphs.o \
 	pet_control/pet_remote.o \
 	pet_control/pet_real_life.o \
 	pet_control/pet_section.o \
 	pet_control/pet_control_sub5.o \
 	pet_control/pet_control_sub7.o \
-	pet_control/pet_control_sub11.o \
 	pet_control/pet_drag_chev.o \
 	pet_control/pet_graphic2.o \
 	pet_control/pet_graphic.o \
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index e4f0710..baad471 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -49,7 +49,7 @@ private:
 	CPetConversations _conversations;
 	CPetInventory _inventory;
 	CPetRemote _remote;
-	CPetRoomsSection _rooms;
+	CPetRooms _rooms;
 	CPetRealLife _realLife;
 	CPetControlSub5 _sub5;
 	CPetControlSub7 _sub7;
diff --git a/engines/titanic/pet_control/pet_control_list_item2.cpp b/engines/titanic/pet_control/pet_control_list_item2.cpp
deleted file mode 100644
index 82b5992..0000000
--- a/engines/titanic/pet_control/pet_control_list_item2.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_control_list_item2.h"
-
-namespace Titanic {
-
-CPetControlListItem2::CPetControlListItem2() :
-	_field34(0), _field38(0), _field3C(0), _field40(0),
-	_field44(0), _field48(0), _field4C(0), _field50(0),
-	_field54(0), _field58(0), _field5C(0) {
-}
-
-void CPetControlListItem2::setField34(int val) {
-	_field34 = val;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_list_item2.h b/engines/titanic/pet_control/pet_control_list_item2.h
deleted file mode 100644
index 70feb30..0000000
--- a/engines/titanic/pet_control/pet_control_list_item2.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_LIST_ITEM2_H
-#define TITANIC_PET_CONTROL_LIST_ITEM2_H
-
-#include "titanic/pet_control/pet_glyphs.h"
-
-namespace Titanic {
-
-class CPetControlListItem2  : public CPetGlyph {
-protected:
-	int _field34;
-	int _field38;
-	int _field3C;
-	int _field40;
-	int _field44;
-	int _field48;
-	int _field4C;
-	int _field50;
-	int _field54;
-	int _field58;
-	int _field5C;
-public:
-	CPetControlListItem2();
-
-	void setField34(int val);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_LIST_ITEM2_H */
diff --git a/engines/titanic/pet_control/pet_control_sub11.cpp b/engines/titanic/pet_control/pet_control_sub11.cpp
deleted file mode 100644
index 5148d12..0000000
--- a/engines/titanic/pet_control/pet_control_sub11.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_control_sub11.h"
-
-namespace Titanic {
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub11.h b/engines/titanic/pet_control/pet_control_sub11.h
deleted file mode 100644
index eeeb8bf..0000000
--- a/engines/titanic/pet_control/pet_control_sub11.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB11_H
-#define TITANIC_PET_CONTROL_SUB11_H
-
-#include "titanic/pet_control/pet_glyphs.h"
-
-namespace Titanic {
-
-class CPetControlSub11 : public CPetGlyphs {
-public:
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB11_H */
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index ea81dd8..9a55af2 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -21,21 +21,66 @@
  */
 
 #include "titanic/pet_control/pet_rooms.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
-CPetRoomsSection::CPetRoomsSection() :
-	_field100(0), _field104(0), _field108(0), _field10C(0),
-	_field110(0), _field114(0), _field118(0), _field11C(0),
-	_field1C0(0), _field1C4(0), _field1C8(0), _field1CC(0),
-	_field1D0(0), _field1D4(0) {
+CPetRooms::CPetRooms() :
+		_chevLeftOnDim(nullptr), _chevLeftOffDim(nullptr),
+		_chevRightOnDim(nullptr), _chevRightOffDim(nullptr),
+		_chevLeftOnLit(nullptr), _chevLeftOffLit(nullptr),
+		_chevRightOnLit(nullptr), _chevRightOffLit(nullptr),
+		_field1C0(0), _field1C4(0), _field1C8(0), _field1CC(0),
+		_field1D0(0), _field1D4(0) {
 }
 
-void CPetRoomsSection::save(SimpleFile *file, int indent) const {
+bool CPetRooms::setup(CPetControl *petControl) {
+	if (petControl && setupControl(petControl))
+		return reset();
+	return false;
+}
+
+bool CPetRooms::reset() {
+	return true;
+}
+
+void CPetRooms::draw(CScreenManager *screenManager) {
+
+}
+
+bool CPetRooms::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	return true;
+}
+
+bool CPetRooms::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+	return true;
+}
+
+bool CPetRooms::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+	return true;
+}
+
+bool CPetRooms::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
+	return true;
+}
+
+bool CPetRooms::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
+	return true;
+}
+
+int CPetRooms::proc14() {
+	return 0;
+}
 
+void CPetRooms::displayMessage(const CString &msg) {
+
+}
+
+bool CPetRooms::isValid(CPetControl *petControl) {
+	return true;
 }
 
-void CPetRoomsSection::load(SimpleFile *file, int param) {
+void CPetRooms::load(SimpleFile *file, int param) {
 	if (!param) {
 		int count = file->readNumber();
 
@@ -45,7 +90,7 @@ void CPetRoomsSection::load(SimpleFile *file, int param) {
 			warning("TODO: CPetRoomsSection::load - %d,%d", v1, v2);
 		}
 
-		_listItem.setField34(file->readNumber());
+		_glyphItem.set34(file->readNumber());
 		file->readNumber();
 		_field1C0 = file->readNumber();
 		_field1C4 = file->readNumber();
@@ -56,10 +101,57 @@ void CPetRoomsSection::load(SimpleFile *file, int param) {
 	}
 }
 
-bool CPetRoomsSection::isValid(CPetControl *petControl) {
-	// TODO
-	return true;
+void CPetRooms::postLoad() {
+
+}
+
+void CPetRooms::save(SimpleFile *file, int indent) const {
+
+}
+
+void CPetRooms::enter(PetArea oldArea) {
+
 }
 
+void CPetRooms::enterRoom(CRoomItem *room) {
+
+}
+
+CPetText *CPetRooms::getText() {
+	return &_text;
+}
+
+CGameObject *CPetRooms::getBackground(int index) {
+	return nullptr;
+}
+
+bool CPetRooms::setupControl(CPetControl *petControl) {
+	_petControl = petControl;
+	if (!petControl)
+		return false;
+
+	Rect rect1(0, 0, 470, 15);
+	rect1.moveTo(32, 445);
+	_text.setBounds(rect1);
+	_text.setHasBorder(false);
+
+	Rect rect2(0, 0, 81, 81);
+	rect2.moveTo(374, 494);
+	_element.setBounds(rect2);
+
+	_chevLeftOnDim = petControl->getHiddenObject("3PetChevLeftOnDim");
+	_chevLeftOffDim = petControl->getHiddenObject("3PetChevLeftOffDim");
+	_chevRightOnDim = petControl->getHiddenObject("3PetChevRightOnDim");
+	_chevRightOffDim = petControl->getHiddenObject("3PetChevRightOffDim");
+	_chevLeftOnLit = petControl->getHiddenObject("3PetChevLeftOnLit");
+	_chevLeftOffLit = petControl->getHiddenObject("3PetChevLeftOffLit");
+	_chevRightOnLit = petControl->getHiddenObject("3PetChevRightOnLit");
+	_chevRightOffLit = petControl->getHiddenObject("3PetChevRightOffLit");
+
+	_glyphs.setup(6, this);
+	_glyphs.setFlags(GFLAG_16);
+	_glyphItem.setup(petControl, &_glyphs);
+	_glyphItem.set38(1);
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index 1e68873..0974fee 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -20,29 +20,28 @@
  *
  */
 
-#ifndef TITANIC_PET_ROOMS_SECTION_H
-#define TITANIC_PET_ROOMS_SECTION_H
+#ifndef TITANIC_PET_ROOMS_H
+#define TITANIC_PET_ROOMS_H
 
 #include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_control_sub11.h"
 #include "titanic/pet_control/pet_text.h"
-#include "titanic/pet_control/pet_control_list_item2.h"
+#include "titanic/pet_control/pet_rooms_glyphs.h"
 
 namespace Titanic {
 
-class CPetRoomsSection : public CPetSection {
+class CPetRooms : public CPetSection {
 private:
-	CPetControlSub11 _sub11;
-	CPetControlListItem2 _listItem;
-	int _field100;
-	int _field104;
-	int _field108;
-	int _field10C;
-	int _field110;
-	int _field114;
-	int _field118;
-	int _field11C;
-	CPetGfxElement _val1;
+	CPetRoomsGlyphs _glyphs;
+	CPetRoomsGlyph _glyphItem;
+	CGameObject *_chevLeftOnDim;
+	CGameObject *_chevLeftOffDim;
+	CGameObject *_chevRightOnDim;
+	CGameObject *_chevRightOffDim;
+	CGameObject *_chevLeftOnLit;
+	CGameObject *_chevLeftOffLit;
+	CGameObject *_chevRightOnLit;
+	CGameObject *_chevRightOffLit;
+	CPetGfxElement _element;
 	CPetText _text;
 	int _field1C0;
 	int _field1C4;
@@ -50,23 +49,82 @@ private:
 	int _field1CC;
 	int _field1D0;
 	int _field1D4;
+private:
+	/**
+	 * Setup the control
+	 */
+	bool setupControl(CPetControl *petControl);
 public:
-	CPetRoomsSection();
+	CPetRooms();
 
 	/**
-	 * Save the data for the class to file
+	 * Sets up the section
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual bool setup(CPetControl *petControl);
+	
+	/**
+	 * Reset the section
+	 */
+	virtual bool reset();
 
 	/**
-	 * Load the data for the class from file
+	 * Draw the section
 	 */
-	virtual void load(SimpleFile *file, int param);
+	virtual void draw(CScreenManager *screenManager);
+		
+	/**
+	 * Following are handlers for the various messages that the PET can
+	 * pass onto the currently active section/area
+	 */
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	virtual bool MouseDragStartMsg(CMouseDragStartMsg *msg);
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
+	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg);
+
+	virtual int proc14();
+
+	/**
+	 * Display a message
+	 */
+	virtual void displayMessage(const CString &msg);
 
 	/**
 	 * Returns true if the object is in a valid state
 	 */
 	virtual bool isValid(CPetControl *petControl);
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param);
+
+	/**
+	 * Called after a game has been loaded
+	 */
+	virtual void postLoad();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Called when a section is switched to
+	 */
+	virtual void enter(PetArea oldArea);
+
+	/**
+	 * Called when a new room is entered
+	 */
+	virtual void enterRoom(CRoomItem *room);
+
+	/**
+	 * Get a reference to the tooltip text associated with the section
+	 */
+	virtual CPetText *getText();
+
+	virtual CGameObject *getBackground(int index);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
new file mode 100644
index 0000000..c853273
--- /dev/null
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_rooms_glyphs.h"
+
+namespace Titanic {
+
+CPetRoomsGlyph::CPetRoomsGlyph() : CPetGlyph(),
+	_field34(0), _field38(0), _field3C(0), _field40(0),
+	_field44(0), _field48(0), _field4C(0), _field50(0),
+	_field54(0), _field58(0), _field5C(0) {
+}
+
+void CPetRoomsGlyph::set34(int val) {
+	_field34 = val;
+}
+
+void CPetRoomsGlyph::set38(int val) {
+	_field38 = val;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
new file mode 100644
index 0000000..ee79917
--- /dev/null
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_ROOMS_GLYPHS_H
+#define TITANIC_PET_ROOMS_GLYPHS_H
+
+#include "titanic/pet_control/pet_glyphs.h"
+
+namespace Titanic {
+
+class CPetRoomsGlyph : public CPetGlyph {
+protected:
+	int _field34;
+	int _field38;
+	int _field3C;
+	int _field40;
+	int _field44;
+	int _field48;
+	int _field4C;
+	int _field50;
+	int _field54;
+	int _field58;
+	int _field5C;
+public:
+	CPetRoomsGlyph();
+
+	void set34(int val);
+
+	void set38(int val);
+};
+
+class CPetRoomsGlyphs : public CPetGlyphs {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_ROOMS_GLYPHS_H */


Commit: 4180e85bc0da500c347a3c5076ec7e6921e8daff
    https://github.com/scummvm/scummvm/commit/4180e85bc0da500c347a3c5076ec7e6921e8daff
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:57-04:00

Commit Message:
TITANIC: Beginnings of PET Rooms glyph

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h
    engines/titanic/pet_control/pet_sound.h



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 914ddbb..8ed8fcf 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -32,7 +32,7 @@ bool CPetGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	return true;
 }
 
-void CPetGlyph::drawAt(CScreenManager *screenManager, const Point &pt) {
+void CPetGlyph::drawAt(CScreenManager *screenManager, const Point &pt, bool isHighlighted) {
 	_element.translate(pt.x, pt.y);
 	_element.draw(screenManager);
 	_element.translate(-pt.x, -pt.y);
@@ -151,10 +151,8 @@ void CPetGlyphs::draw(CScreenManager *screenManager) {
 			Point pt = getPosition(itemIndex);
 			CPetGlyph *glyph = getGlyph(itemIndex);
 
-			if (glyph) {
-				// TODO: Comparison with highlighted index, and a redundant push?
-				glyph->drawAt(screenManager, pt);
-			}
+			if (glyph)
+				glyph->drawAt(screenManager, pt, index == _highlightIndex);
 		}
 	}
 
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 883c799..9216a42 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -74,6 +74,11 @@ public:
 	void translateBack(const Point &pt) { _element.translate(-pt.x, -pt.y); }
 
 	/**
+	 * Get the parent RealLife area
+	 */
+	CPetGlyphs *getOwner() { return _owner; }
+
+	/**
 	 * Get the PET control
 	 */
 	CPetControl *getPetControl() const;
@@ -106,7 +111,7 @@ public:
 	/**
 	 * Draw the glyph at a specified position
 	 */
-	virtual void drawAt(CScreenManager *screenManager, const Point &pt);
+	virtual void drawAt(CScreenManager *screenManager, const Point &pt, bool isHighlighted);
 
 	/**
 	 * Handles any secondary drawing of the glyph
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index c853273..6c032e7 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -21,13 +21,15 @@
  */
 
 #include "titanic/pet_control/pet_rooms_glyphs.h"
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/support/screen_manager.h"
 
 namespace Titanic {
 
 CPetRoomsGlyph::CPetRoomsGlyph() : CPetGlyph(),
-	_field34(0), _field38(0), _field3C(0), _field40(0),
-	_field44(0), _field48(0), _field4C(0), _field50(0),
-	_field54(0), _field58(0), _field5C(0) {
+	_field34(0), _field38(0), _field3C(0),
+	_field40(nullptr), _field44(nullptr), _field48(nullptr), _field4C(nullptr),
+	_field50(nullptr), _field54(nullptr), _field58(nullptr), _field5C(nullptr) {
 }
 
 void CPetRoomsGlyph::set34(int val) {
@@ -38,4 +40,47 @@ void CPetRoomsGlyph::set38(int val) {
 	_field38 = val;
 }
 
+bool CPetRoomsGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	if (!CPetGlyph::setup(petControl, owner))
+		return false;
+
+	CPetSection *section = owner->getOwner();
+	_field40 = section->getBackground(9);
+	_field44 = section->getBackground(12);
+	_field50 = section->getBackground(13);
+	_field54 = section->getBackground(10);
+	_field48 = section->getBackground(11);
+	_field4C = section->getBackground(14);
+	_field58 = section->getBackground(15);
+	_field5C = _field58;
+	return true;
+}
+
+void CPetRoomsGlyph::drawAt(CScreenManager *screenManager, const Point &pt) {
+	// Clear background
+	Rect rect(pt.x, pt.y, pt.x + 52, pt.y + 52);
+	screenManager->fillRect(SURFACE_BACKBUFFER, &rect, 0, 0, 0);
+
+	warning("TODO: CPetRoomsGlyph::drawAt");
+}
+
+void CPetRoomsGlyph::proc28(const Point &pt) {
+
+}
+int CPetRoomsGlyph::proc29(const Point &pt) {
+	return 0; 
+}
+
+void CPetRoomsGlyph::proc32() {
+
+}
+
+int CPetRoomsGlyph::proc33() {
+	return 1;
+}
+
+void CPetRoomsGlyph::proc39() {
+
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index ee79917..80c3d36 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -32,20 +32,41 @@ protected:
 	int _field34;
 	int _field38;
 	int _field3C;
-	int _field40;
-	int _field44;
-	int _field48;
-	int _field4C;
-	int _field50;
-	int _field54;
-	int _field58;
-	int _field5C;
+	CGameObject *_field40;
+	CGameObject *_field44;
+	CGameObject *_field48;
+	CGameObject *_field4C;
+	CGameObject *_field50;
+	CGameObject *_field54;
+	CGameObject *_field58;
+	CGameObject *_field5C;
 public:
 	CPetRoomsGlyph();
 
 	void set34(int val);
 
 	void set38(int val);
+
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Draw the glyph at a specified position
+	 */
+	virtual void drawAt(CScreenManager *screenManager, const Point &pt);
+
+	/**
+	 * Handles any secondary drawing of the glyph
+	 */
+	virtual void draw2(CScreenManager *screenManager) {}
+
+	virtual void proc28(const Point &pt);
+	virtual int proc29(const Point &pt);
+	virtual void proc32();
+	virtual int proc33();
+	virtual void proc39();
 };
 
 class CPetRoomsGlyphs : public CPetGlyphs {
diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h
index 3727780..267bd03 100644
--- a/engines/titanic/pet_control/pet_sound.h
+++ b/engines/titanic/pet_control/pet_sound.h
@@ -98,11 +98,6 @@ public:
 	 * Returns the tooltip text for when the glyph is selected
 	 */
 	virtual void getTooltip(CPetText *text);
-
-	/**
-	 * Get the parent RealLife area
-	 */
-	CPetGlyphs *getOwner() { return _owner; }
 };
 
 } // End of namespace Titanic


Commit: af06188baedf10247893c6f964462c74eac5f446
    https://github.com/scummvm/scummvm/commit/af06188baedf10247893c6f964462c74eac5f446
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:58-04:00

Commit Message:
TITANIC: Implementing CPetRooms methods

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h
    engines/titanic/pet_control/pet_section.h
    engines/titanic/pet_control/pet_sound.cpp



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 145543f..98887f6 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -431,4 +431,9 @@ void CPetControl::playSound(int soundNum) {
 	}
 }
 
+CString CPetControl::getRoomName() const {
+	CRoomItem *room = getRoom();
+	return room ? room->getName() : CString();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index baad471..78cfb61 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -245,6 +245,11 @@ public:
 	 * Play a sound
 	 */
 	void playSound(int soundNum);
+
+	/**
+	 * Get the room name
+	 */
+	CString getRoomName() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 8ed8fcf..8f8d8ba 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -307,7 +307,7 @@ bool CPetGlyphs::MouseButtonDownMsg(const Point &pt) {
 			CPetGlyph *glyph = getGlyph(index);
 			if (glyph) {
 				if (_highlightIndex == index) {
-					glyph->proc28(glyphRect);
+					glyph->MouseButtonDownMsg(glyphRect);
 					glyph->proc14();
 				} else {
 					changeHighlight(index);
@@ -426,4 +426,16 @@ void CPetGlyphs::endDragging() {
 	_dragGlyph = nullptr;
 }
 
+bool CPetGlyphs::highlighted14() {
+	if (_highlightIndex != -1) {
+		CPetGlyph *pet = getGlyph(_highlightIndex);
+		if (pet) {
+			pet->proc14();
+			return true;
+		}
+	}
+
+	return false;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 9216a42..cefcd5c 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -172,7 +172,12 @@ public:
 	virtual void highlightCurrent(const Point &pt) {}
 
 	virtual void proc27(const Point &pt, bool flag) {}
-	virtual void proc28(const Point &pt) {}
+
+	/**
+	 * Handles mouse button down messages
+	 */
+	virtual void MouseButtonDownMsg(const Point &pt) {}
+	
 	virtual int proc29(const Point &pt) { return 0; }
 
 	/**
@@ -384,6 +389,13 @@ public:
 	 * Called when a dragging operation ends
 	 */
 	void endDragging();
+
+	/**
+	 * Reset the highlight
+	 */
+	void resetHighlight() { changeHighlight(-1); }
+
+	bool highlighted14();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 9a55af2..60ce398 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -41,43 +41,71 @@ bool CPetRooms::setup(CPetControl *petControl) {
 }
 
 bool CPetRooms::reset() {
+	if (_petControl) {
+		_plinth.reset("PetChevPlinth", _petControl, MODE_UNSELECTED);
+		_glyphs.reset();
+
+		uint col = getColor(0);
+		_text.setColor(col);
+		_text.setColor(0, col);
+	}
+
 	return true;
 }
 
 void CPetRooms::draw(CScreenManager *screenManager) {
-
+	_petControl->drawSquares(screenManager, 6);
+	_plinth.draw(screenManager);
+	_glyphItem.drawAt(screenManager, getGlyphPos());
+	_text.draw(screenManager);
 }
 
 bool CPetRooms::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	if (_glyphs.MouseButtonDownMsg(msg->_mousePos))
+		return true;
+
+	if (!_glyphItem.contains(getGlyphPos(), msg->_mousePos))
+		return false;
+
+	_glyphItem.MouseButtonDownMsg(msg->_mousePos);
 	return true;
 }
 
 bool CPetRooms::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+	if (_glyphs.MouseDragStartMsg(msg))
+		return true;
+
+	if (!_glyphItem.contains(getGlyphPos(), msg->_mousePos))
+		return false;
+
+	_glyphItem.proc29(msg->_mousePos);
 	return true;
 }
 
 bool CPetRooms::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
-	return true;
+	return false;
 }
 
 bool CPetRooms::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
-	return true;
+	return !_glyphs.MouseButtonDownMsg(msg->_mousePos);
 }
 
 bool CPetRooms::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
-	return true;
+	return _glyphs.VirtualKeyCharMsg(msg->_keyState.keycode);
 }
 
-int CPetRooms::proc14() {
-	return 0;
+bool CPetRooms::proc14(void *v1) {
+	warning("TODO: proc14");
+	return false;
 }
 
 void CPetRooms::displayMessage(const CString &msg) {
-
+	_glyphs.resetHighlight();
+	CPetSection::displayMessage(msg);
 }
 
 bool CPetRooms::isValid(CPetControl *petControl) {
-	return true;
+	return setupControl(petControl);
 }
 
 void CPetRooms::load(SimpleFile *file, int param) {
@@ -102,15 +130,16 @@ void CPetRooms::load(SimpleFile *file, int param) {
 }
 
 void CPetRooms::postLoad() {
-
+	reset();
 }
 
 void CPetRooms::save(SimpleFile *file, int indent) const {
-
+	warning("TODO: CPetRooms::save");
 }
 
 void CPetRooms::enter(PetArea oldArea) {
-
+	if (!_glyphs.highlighted14())
+		_text.setText("");
 }
 
 void CPetRooms::enterRoom(CRoomItem *room) {
@@ -137,7 +166,7 @@ bool CPetRooms::setupControl(CPetControl *petControl) {
 
 	Rect rect2(0, 0, 81, 81);
 	rect2.moveTo(374, 494);
-	_element.setBounds(rect2);
+	_plinth.setBounds(rect2);
 
 	_chevLeftOnDim = petControl->getHiddenObject("3PetChevLeftOnDim");
 	_chevLeftOffDim = petControl->getHiddenObject("3PetChevLeftOffDim");
@@ -152,6 +181,24 @@ bool CPetRooms::setupControl(CPetControl *petControl) {
 	_glyphs.setFlags(GFLAG_16);
 	_glyphItem.setup(petControl, &_glyphs);
 	_glyphItem.set38(1);
+	return true;
+}
+
+void CPetRooms::resetHighlight() {
+	_glyphItem.set34(fn1());
+	_glyphs.resetHighlight();
+	_glyphItem.proc14();
+	areaChanged(PET_ROOMS);
+}
+
+int CPetRooms::fn1() {
+	warning("TODO: CPetRooms::fn1");
+	return 0;
+}
+
+void CPetRooms::areaChanged(PetArea area) {
+	if (_petControl && _petControl->_currentArea == area)
+		_petControl->makeDirty();
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index 0974fee..4c153d7 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -41,7 +41,7 @@ private:
 	CGameObject *_chevLeftOffLit;
 	CGameObject *_chevRightOnLit;
 	CGameObject *_chevRightOffLit;
-	CPetGfxElement _element;
+	CPetGfxElement _plinth;
 	CPetText _text;
 	int _field1C0;
 	int _field1C4;
@@ -54,6 +54,20 @@ private:
 	 * Setup the control
 	 */
 	bool setupControl(CPetControl *petControl);
+
+	/**
+	 * Returns the glyth position
+	 */
+	Point getGlyphPos() const { return Point(509, 388); }
+
+	/**
+	 * Reset the highlight
+	 */
+	void resetHighlight();
+
+	int fn1();
+
+	void areaChanged(PetArea area);
 public:
 	CPetRooms();
 
@@ -82,7 +96,7 @@ public:
 	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
 	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg);
 
-	virtual int proc14();
+	virtual bool proc14(void *v1);
 
 	/**
 	 * Display a message
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index 6c032e7..d127c41 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -64,9 +64,10 @@ void CPetRoomsGlyph::drawAt(CScreenManager *screenManager, const Point &pt) {
 	warning("TODO: CPetRoomsGlyph::drawAt");
 }
 
-void CPetRoomsGlyph::proc28(const Point &pt) {
+void CPetRoomsGlyph::MouseButtonDownMsg(const Point &pt) {
 
 }
+
 int CPetRoomsGlyph::proc29(const Point &pt) {
 	return 0; 
 }
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index 80c3d36..2832438 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -62,7 +62,11 @@ public:
 	 */
 	virtual void draw2(CScreenManager *screenManager) {}
 
-	virtual void proc28(const Point &pt);
+	/**
+	 * Handles mouse button down messages
+	 */
+	virtual void MouseButtonDownMsg(const Point &pt);
+
 	virtual int proc29(const Point &pt);
 	virtual void proc32();
 	virtual int proc33();
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 0911fd4..720e532 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -90,7 +90,7 @@ public:
 	virtual bool KeyCharMsg(CKeyCharMsg *msg) { return false; }
 	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) { return false; }
 
-	virtual int proc14() { return 0; }
+	virtual bool proc14(void *v1) { return false; }
 	
 	/**
 	 * Returns item a drag-drop operation has dropped on, if any
diff --git a/engines/titanic/pet_control/pet_sound.cpp b/engines/titanic/pet_control/pet_sound.cpp
index 736b966..72e991a 100644
--- a/engines/titanic/pet_control/pet_sound.cpp
+++ b/engines/titanic/pet_control/pet_sound.cpp
@@ -272,6 +272,7 @@ bool CPetSound::MouseButtonUpMsg(const Point &pt) {
 
 	double offset = slider->getOffsetPixels();
 	sliderChanged(offset, sliderNum);
+	return true;
 }
 
 void CPetSound::getTooltip(CPetText *text) {


Commit: a88c0b09994562d4576e7dd08db8ad2fe3326f53
    https://github.com/scummvm/scummvm/commit/a88c0b09994562d4576e7dd08db8ad2fe3326f53
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:11:59-04:00

Commit Message:
TITANIC: Starting to flesh out CPetText drawing

Changed paths:
    engines/titanic/pet_control/pet_load_save.cpp
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h
    engines/titanic/support/screen_manager.h



diff --git a/engines/titanic/pet_control/pet_load_save.cpp b/engines/titanic/pet_control/pet_load_save.cpp
index f777f12..9d185a3 100644
--- a/engines/titanic/pet_control/pet_load_save.cpp
+++ b/engines/titanic/pet_control/pet_load_save.cpp
@@ -36,7 +36,7 @@ bool CPetLoadSave::setup(CPetControl *petControl, CPetGlyphs *owner) {
 		Rect slotRect = getSlotBounds(idx);
 		_slotNames[idx].setBounds(slotRect);
 		_slotNames[idx].resize(3);
-		_slotNames[idx].set30(22);
+		_slotNames[idx].setMaxCharsPerLine(22);
 		_slotNames[idx].setHasBorder(false);
 		_slotNames[idx].setup();
 	}
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index faa25d0..ca65b23 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -25,11 +25,11 @@
 namespace Titanic {
 
 CPetText::CPetText(uint count) :
-		_stringsMerged(false), _field30(-1), _lineCount(0),
-		_field38(-1), _field3C(0), _field40(0), _field44(0),
+		_stringsMerged(false), _maxCharsPerLine(-1), _lineCount(0),
+		_fontNumber1(-1), _field3C(0), _field40(0), _field44(0),
 		_backR(0xff), _backG(0xff), _backB(0xff), 
 		_textR(0), _textG(0), _textB(200),
-		_field60(0), _field64(0), _field68(0), _field6C(0),
+		_fontNumber2(0), _field64(0), _field68(0), _field6C(0),
 		_hasBorder(true), _field74(0), _field78(0), _field7C(0) {
 	setupArrays(count);
 }
@@ -130,7 +130,16 @@ void CPetText::draw(CScreenManager *screenManager) {
 		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
 	}
 
-	warning("TODO: CPetText::draw");
+	draw2(screenManager);
+
+	tempRect = _bounds;
+	tempRect.grow(-2);
+	screenManager->setFontNumber(_fontNumber2);
+
+//	int var14 = 0;
+//	screenManager->writeLines(0, &var14, _field74, )
+	warning("TODO: CPetText_Draw");
+	screenManager->setFontNumber(_fontNumber1);
 }
 
 void CPetText::mergeStrings() {
@@ -161,7 +170,22 @@ void CPetText::setText(const CString &str) {
 }
 
 void CPetText::changeText(const CString &str) {
-	warning("TODO: CPetText::changeText");
+	int lineSize = _array[_lineCount]._string1.size();
+	int strSize = str.size();
+
+	if (_maxCharsPerLine == -1) {
+		// No limit on horizontal characters, so append string to current line
+		_array[_lineCount]._string1 += str;
+	} else if ((lineSize + strSize) <= _maxCharsPerLine) {
+		// New string fits into line, so add it on
+		_array[_lineCount]._string1 += str;
+	} else {
+		// Only add part of the str up to the maximum allowed limit for line
+		_array[_lineCount]._string1 += str.left(_maxCharsPerLine - lineSize);
+	}
+	
+	updateStr3(_lineCount);
+	_stringsMerged = false;
 }
 
 void CPetText::setColor(int val1, uint col) {
@@ -174,9 +198,27 @@ void CPetText::setColor(uint col) {
 	_textB = (col >> 16) & 0xff;
 }
 
-void CPetText::set30(int val) {
-	if (val >= -1 && val < 257)
-		_field30 = val;
+void CPetText::setMaxCharsPerLine(int maxChars) {
+	if (maxChars >= -1 && maxChars < 257)
+		_maxCharsPerLine = maxChars;
+}
+
+void CPetText::updateStr3(int lineNum) {
+	if (_field64 > 0 && _field68 > 0) {
+		char line[5];
+		line[0] = line[3] = 26;
+		line[1] = _field64;
+		line[2] = _field68;
+		line[4] = '\0';
+		_array[lineNum]._string3 = CString(line);
+		
+		_stringsMerged = false;
+		_field64 = _field68 = 0;
+	}
+}
+
+void CPetText::draw2(CScreenManager *screenManager) {
+
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 1770711..9fd057a 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -39,9 +39,9 @@ private:
 	CString _lines;
 	bool _stringsMerged;
 	Rect _bounds;
-	int _field30;
+	int _maxCharsPerLine;
 	int _lineCount;
-	int _field38;
+	int _fontNumber1;
 	int _field3C;
 	int _field40;
 	int _field44;
@@ -51,7 +51,7 @@ private:
 	int _textR;
 	int _textG;
 	int _textB;
-	int _field60;
+	int _fontNumber2;
 	int _field64;
 	int _field68;
 	int _field6C;
@@ -75,6 +75,10 @@ private:
 	 * Change the text
 	 */
 	void changeText(const CString &str);
+
+	void updateStr3(int lineNum);
+
+	void draw2(CScreenManager *screenManager);
 public:
 	CPetText(uint count = 10);
 
@@ -120,7 +124,10 @@ public:
 	 */
 	void setColor(uint col);
 
-	void set30(int val);
+	/**
+	 * Sets the maximum number of characters per line
+	 */
+	void setMaxCharsPerLine(int maxChars);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/screen_manager.h b/engines/titanic/support/screen_manager.h
index affe2ec..d0580d4 100644
--- a/engines/titanic/support/screen_manager.h
+++ b/engines/titanic/support/screen_manager.h
@@ -145,7 +145,15 @@ public:
 	virtual void showCursor() = 0;
 	virtual void hideCursor() = 0;
 
+	/**
+	 * Set drawing bounds for a specified surface
+	 */
 	void setSurfaceBounds(SurfaceNum surfaceNum, const Rect &r);
+
+	/**
+	 * Set the current font number
+	 */
+	void setFontNumber(int fontNumber) { _fontNumber = fontNumber; }
 };
 
 class OSScreenManager: CScreenManager {


Commit: c75de59a28c94e364a38af39057af720ba8465d4
    https://github.com/scummvm/scummvm/commit/c75de59a28c94e364a38af39057af720ba8465d4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:00-04:00

Commit Message:
TITANIC: Implementing font text bounds calculations

Changed paths:
    engines/titanic/support/font.cpp
    engines/titanic/support/font.h
    engines/titanic/support/screen_manager.cpp
    engines/titanic/support/screen_manager.h



diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index 55865e7..f5d28ea 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -70,8 +70,39 @@ uint16 STFont::getColor() const {
 	return g_system->getScreenFormat().RGBToColor(_fontR, _fontG, _fontB);
 }
 
-void STFont::writeString(int maxWidth, const CString &text, int *v1, int *v2) {
-	warning("TODO: STFont::writeString");
+int STFont::getTextBounds(const CString &str, int maxWidth, Point *sizeOut) const {
+	Point textSize;
+
+	// Reset output dimensions if provided
+	if (sizeOut)
+		*sizeOut = Point(0, 0);
+
+	if (_fontHeight == 0 || !_dataPtr)
+		// No font, so return immediately
+		return 0;
+	
+	// Loop through the characters of the string
+	if (!str.empty()) {
+		for (const char *strP = str.c_str(); *strP; ++strP) {
+			if (*strP == 26) {
+				strP += 3;
+			} else if (*strP == 27) {
+				strP += 4;
+			} else {
+				if (*strP == ' ') {
+					// Check fo rline wrapping
+					checkLineWrap(textSize, maxWidth, strP);
+				}
+
+				extendBounds(textSize, *strP, maxWidth);
+			}
+		}
+	}
+
+	if (sizeOut)
+		*sizeOut = textSize;
+
+	return textSize.y + _fontHeight;
 }
 
 int STFont::stringWidth(const CString &text) const {
@@ -160,4 +191,36 @@ void STFont::copyRect(CVideoSurface *surface, const Common::Point &pt, Rect &rec
 	}
 }
 
+void STFont::extendBounds(Point &textSize, byte c, int maxWidth) const {
+	textSize.x += _chars[c]._width;
+
+	if (textSize.x == '\n' || textSize.x > maxWidth) {
+		textSize.x = 0;
+		textSize.y += _fontHeight;
+	}
+}
+
+void STFont::checkLineWrap(Point &textSize, int maxWidth, const char *&str) const {
+	bool flag = false;
+	int totalWidth = 0;
+	for (const char *srcPtr = str; *srcPtr; ++srcPtr) {
+		if (*srcPtr == ' ' && flag)
+			break;
+
+		if (*srcPtr == 26)
+			srcPtr += 3;
+		else if (*srcPtr == 27)
+			srcPtr += 4;
+		else
+			totalWidth += _chars[*srcPtr]._width;
+	}
+	
+	if ((textSize.x + totalWidth) >= maxWidth && totalWidth < maxWidth) {
+		// Word wrap
+		textSize.x = 0;
+		textSize.y += _fontHeight;
+		++str;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/support/font.h b/engines/titanic/support/font.h
index 5ed0b5b..e1c63e6 100644
--- a/engines/titanic/support/font.h
+++ b/engines/titanic/support/font.h
@@ -50,6 +50,17 @@ private:
 	 */
 	int writeChar(CVideoSurface *surface, unsigned char c, 
 		const Common::Point &pt, Rect *destRect, Rect *srcRect);
+
+	/**
+	 * Extends a passed text area by the space required for
+	 * the given character
+	 */
+	void extendBounds(Point &textSize, byte c, int maxWidth) const;
+
+	/**
+	 * Called at spacing between words, checks for line wrapping
+	 */
+	void checkLineWrap(Point &textSize, int maxWidth, const char *&str) const;
 public:
 	byte *_dataPtr;
 	size_t _dataSize;
@@ -72,10 +83,13 @@ public:
 	int stringWidth(const CString &text) const;
 
 	/**
-	 * Write out a string
-	 * TODO: Verify this
+	 * Get the text area a string will fit into
+	 * @param str		String
+	 * @param maxWidth	Maximum width in pixels
+	 * @param sizeOut	Optional pointer to output size (width, height)
+	 * @returns			Required height
 	 */
-	void writeString(int maxWidth, const CString &text, int *v1, int *v2);
+	int getTextBounds(const CString &str, int maxWidth, Point *sizeOut) const;
 
 	/**
 	 * Sets the font color
diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp
index d2f2468..f772bc6 100644
--- a/engines/titanic/support/screen_manager.cpp
+++ b/engines/titanic/support/screen_manager.cpp
@@ -199,12 +199,18 @@ void OSScreenManager::proc13() {}
 void OSScreenManager::proc14() {}
 void OSScreenManager::proc15() {}
 
-void OSScreenManager::writeString(int maxWidth, const CString &text, int *v1, int *v2) {
-	_fonts[_fontNumber].writeString(maxWidth, text, v1, v2);
+int OSScreenManager::getTextBounds(const CString &str, int maxWidth, Point *sizeOut) const {
+	return _fonts[_fontNumber].getTextBounds(str, maxWidth, sizeOut);
+}
+
+int OSScreenManager::getFontHeight() const {
+	return _fonts[_fontNumber]._fontHeight;
+}
+
+int OSScreenManager::stringWidth(const CString &str) {
+	return _fonts[_fontNumber].stringWidth(str);
 }
 
-void OSScreenManager::getFont() {}
-void OSScreenManager::proc18() {}
 void OSScreenManager::proc19() {}
 
 void OSScreenManager::clearSurface(SurfaceNum surfaceNum, Rect *bounds) {
diff --git a/engines/titanic/support/screen_manager.h b/engines/titanic/support/screen_manager.h
index d0580d4..baba662 100644
--- a/engines/titanic/support/screen_manager.h
+++ b/engines/titanic/support/screen_manager.h
@@ -110,14 +110,25 @@ public:
 	virtual void proc14() = 0;
 	virtual void proc15() = 0;
 
+	/**
+	 * Get the text area a string will fit into
+	 * @param str		String
+	 * @param maxWidth	Maximum width in pixels
+	 * @param sizeOut	Optional pointer to output size
+	 * @returns			Required height
+	 */
+	virtual int getTextBounds(const CString &str, int maxWidth, Point *sizeOut = nullptr) const = 0;
+
+	/**
+	 * Get the current font height
+	 */
+	virtual int getFontHeight() const = 0;
 
 	/**
-	 * Write out a string
+	 * Returns the width of a given string in pixels
 	 */
-	virtual void writeString(int maxWidth, const CString &text, int *v1, int *v2) = 0;
+	virtual int stringWidth(const CString &str) = 0;
 
-	virtual void getFont() = 0;
-	virtual void proc18() = 0;
 	virtual void proc19() = 0;
 
 	/**
@@ -216,12 +227,24 @@ public:
 	virtual void proc15();
 
 	/**
-	 * Write out a string
+	 * Get the text area a string will fit into
+	 * @param str		String
+	 * @param maxWidth	Maximum width in pixels
+	 * @param sizeOut	Optional pointer to output size
+	 * @returns			Required height
+	 */
+	virtual int getTextBounds(const CString &str, int maxWidth, Point *sizeOut = nullptr) const;
+
+	/**
+	 * Get the current font height
+	 */
+	virtual int getFontHeight() const;
+
+	/**
+	 * Returns the width of a given string in pixels
 	 */
-	virtual void writeString(int maxWidth, const CString &text, int *v1, int *v2);
+	virtual int stringWidth(const CString &str);
 
-	virtual void getFont();
-	virtual void proc18();
 	virtual void proc19();
 
 	/**


Commit: 36faf0890fec6bab90531ade42c0eb924b31b64a
    https://github.com/scummvm/scummvm/commit/36faf0890fec6bab90531ade42c0eb924b31b64a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:01-04:00

Commit Message:
TITANIC: Minor work towards text display

Changed paths:
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h
    engines/titanic/support/font.cpp
    engines/titanic/support/font.h
    engines/titanic/support/screen_manager.cpp
    engines/titanic/support/screen_manager.h



diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index ca65b23..35f5f8d 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -130,7 +130,7 @@ void CPetText::draw(CScreenManager *screenManager) {
 		screenManager->fillRect(SURFACE_BACKBUFFER, &tempRect, _backR, _backG, _backB);
 	}
 
-	draw2(screenManager);
+	getTextHeight(screenManager);
 
 	tempRect = _bounds;
 	tempRect.grow(-2);
@@ -217,8 +217,13 @@ void CPetText::updateStr3(int lineNum) {
 	}
 }
 
-void CPetText::draw2(CScreenManager *screenManager) {
+int CPetText::getTextHeight(CScreenManager *screenManager) {
+	mergeStrings();
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	int textHeight = screenManager->getTextBounds(_lines, _bounds.width());
+	screenManager->setFontNumber(oldFontNumber);
 
+	return textHeight;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 9fd057a..24c4e94 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -78,7 +78,10 @@ private:
 
 	void updateStr3(int lineNum);
 
-	void draw2(CScreenManager *screenManager);
+	/**
+	 * Get the required height to draw the text
+	 */
+	int getTextHeight(CScreenManager *screenManager);
 public:
 	CPetText(uint count = 10);
 
diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index f5d28ea..e903aba 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -127,7 +127,11 @@ int STFont::stringWidth(const CString &text) const {
 	return total;
 }
 
-int STFont::writeChar(CVideoSurface *surface, unsigned char c, const Common::Point &pt, Rect *destRect, Rect *srcRect) {
+int STFont::writeString(CVideoSurface *surface, const Point &pt, const CString &str) {
+	return 0;
+}
+
+int STFont::writeChar(CVideoSurface *surface, unsigned char c, const Point &pt, Rect *destRect, Rect *srcRect) {
 	if (c == 233)
 		c = '$';
 
@@ -174,7 +178,7 @@ int STFont::writeChar(CVideoSurface *surface, unsigned char c, const Common::Poi
 	return 0;
 }
 
-void STFont::copyRect(CVideoSurface *surface, const Common::Point &pt, Rect &rect) {
+void STFont::copyRect(CVideoSurface *surface, const Point &pt, Rect &rect) {
 	if (surface->lock()) {
 		uint16 *lineP = surface->getBasePtr(pt.x, pt.y);
 		uint16 color = getColor();
@@ -203,7 +207,7 @@ void STFont::extendBounds(Point &textSize, byte c, int maxWidth) const {
 void STFont::checkLineWrap(Point &textSize, int maxWidth, const char *&str) const {
 	bool flag = false;
 	int totalWidth = 0;
-	for (const char *srcPtr = str; *srcPtr; ++srcPtr) {
+	for (const char *srcPtr = str; *srcPtr && *srcPtr != ' '; ++srcPtr) {
 		if (*srcPtr == ' ' && flag)
 			break;
 
diff --git a/engines/titanic/support/font.h b/engines/titanic/support/font.h
index e1c63e6..4bb1b2e 100644
--- a/engines/titanic/support/font.h
+++ b/engines/titanic/support/font.h
@@ -83,6 +83,11 @@ public:
 	int stringWidth(const CString &text) const;
 
 	/**
+	 * Write a string to the specified surface
+	 */
+	int writeString(CVideoSurface *surface, const Point &pt, const CString &str);
+
+	/**
 	 * Get the text area a string will fit into
 	 * @param str		String
 	 * @param maxWidth	Maximum width in pixels
diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp
index f772bc6..b467c85 100644
--- a/engines/titanic/support/screen_manager.cpp
+++ b/engines/titanic/support/screen_manager.cpp
@@ -68,6 +68,12 @@ void CScreenManager::setSurfaceBounds(SurfaceNum surfaceNum, const Rect &r) {
 		_backSurfaces[surfaceNum]._bounds = r;
 }
 
+int CScreenManager::setFontNumber(int fontNumber) {
+	int oldFontNumber = _fontNumber;
+	_fontNumber = fontNumber;
+	return oldFontNumber;
+}
+
 /*------------------------------------------------------------------------*/
 
 OSScreenManager::OSScreenManager(TitanicEngine *vm): CScreenManager(vm),
@@ -197,7 +203,10 @@ void OSScreenManager::blitFrom(SurfaceNum surfaceNum, CVideoSurface *src,
 void OSScreenManager::proc12() {}
 void OSScreenManager::proc13() {}
 void OSScreenManager::proc14() {}
-void OSScreenManager::proc15() {}
+
+void OSScreenManager::setFontColor(byte r, byte g, byte b) {
+	_fonts[_fontNumber].setColor(r, g, b);
+}
 
 int OSScreenManager::getTextBounds(const CString &str, int maxWidth, Point *sizeOut) const {
 	return _fonts[_fontNumber].getTextBounds(str, maxWidth, sizeOut);
diff --git a/engines/titanic/support/screen_manager.h b/engines/titanic/support/screen_manager.h
index baba662..b1e949a 100644
--- a/engines/titanic/support/screen_manager.h
+++ b/engines/titanic/support/screen_manager.h
@@ -108,7 +108,11 @@ public:
 	virtual void proc12() = 0;
 	virtual void proc13() = 0;
 	virtual void proc14() = 0;
-	virtual void proc15() = 0;
+
+	/**
+	 * Set the font color
+	 */
+	virtual void setFontColor(byte r, byte g, byte b) = 0;
 
 	/**
 	 * Get the text area a string will fit into
@@ -164,7 +168,7 @@ public:
 	/**
 	 * Set the current font number
 	 */
-	void setFontNumber(int fontNumber) { _fontNumber = fontNumber; }
+	int setFontNumber(int fontNumber);
 };
 
 class OSScreenManager: CScreenManager {
@@ -224,7 +228,11 @@ public:
 	virtual void proc12();
 	virtual void proc13();
 	virtual void proc14();
-	virtual void proc15();
+
+	/**
+	 * Set the font color
+	 */
+	virtual void setFontColor(byte r, byte g, byte b);
 
 	/**
 	 * Get the text area a string will fit into


Commit: 1512545f28c805fd4083be746220f77b72463130
    https://github.com/scummvm/scummvm/commit/1512545f28c805fd4083be746220f77b72463130
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:02-04:00

Commit Message:
TITANIC: Resolve color handling code in CPetText

Changed paths:
    engines/titanic/pet_control/pet_load_save.cpp
    engines/titanic/pet_control/pet_quit.cpp
    engines/titanic/pet_control/pet_real_life.cpp
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_sound.cpp
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h
    engines/titanic/support/font.cpp
    engines/titanic/support/font.h



diff --git a/engines/titanic/pet_control/pet_load_save.cpp b/engines/titanic/pet_control/pet_load_save.cpp
index 9d185a3..5bfa1d6 100644
--- a/engines/titanic/pet_control/pet_load_save.cpp
+++ b/engines/titanic/pet_control/pet_load_save.cpp
@@ -155,7 +155,7 @@ void CPetLoadSave::highlightChange() {
 	// TODO: Unknown if check
 	if (true) {
 		col = section ? section->getColor(4) : 0;
-		_slotNames[_savegameSlotNum].setColor(0, col);
+		_slotNames[_savegameSlotNum].setLineColor(0, col);
 	}
 }
 
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index 7dcaba8..b92a362 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -54,7 +54,7 @@ bool CPetQuit::reset() {
 
 	uint col = getPetSection()->getColor(0);	
 	_text.setText("Are you sure you want to quit?");
-	_text.setColor(0, col);
+	_text.setLineColor(0, col);
 
 	_btnYes.reset("PetQuitOut", pet, MODE_UNSELECTED);
 	_btnYes.reset("PetQuitIn", pet, MODE_SELECTED);
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
index 27a5c22..9d46962 100644
--- a/engines/titanic/pet_control/pet_real_life.cpp
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -39,7 +39,7 @@ bool CPetRealLife::reset() {
 	_glyphs.reset();
 	uint col = getColor(0);
 	_text.setColor(col);
-	_text.setColor(0, col);
+	_text.setLineColor(0, col);
 
 	return true;
 }
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 60ce398..ee63f41 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -47,7 +47,7 @@ bool CPetRooms::reset() {
 
 		uint col = getColor(0);
 		_text.setColor(col);
-		_text.setColor(0, col);
+		_text.setLineColor(0, col);
 	}
 
 	return true;
diff --git a/engines/titanic/pet_control/pet_sound.cpp b/engines/titanic/pet_control/pet_sound.cpp
index 72e991a..9fb3a07 100644
--- a/engines/titanic/pet_control/pet_sound.cpp
+++ b/engines/titanic/pet_control/pet_sound.cpp
@@ -100,10 +100,10 @@ bool CPetSound::reset() {
 
 		CPetSection *section = getPetSection();
 		uint col = section->getColor(0);
-		_textMusicVolume.setColor(0, col);
-		_textMasterVolume.setColor(0, col);
-		_textParrotVolume.setColor(0, col);
-		_textSpeechVolume.setColor(0, col);
+		_textMusicVolume.setLineColor(0, col);
+		_textMasterVolume.setLineColor(0, col);
+		_textParrotVolume.setLineColor(0, col);
+		_textSpeechVolume.setLineColor(0, col);
 	}
 
 	return false;
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 35f5f8d..324a633 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -48,7 +48,7 @@ void CPetText::freeArrays() {
 void CPetText::setup() {
 	for (int idx = 0; idx < (int)_array.size(); ++idx) {
 		_array[idx]._string1.clear();
-		setArrayStr2(idx, _textR, _textG, _textB);
+		setLineColor(idx, _textR, _textG, _textB);
 		_array[idx]._string3.clear();
 	}
 
@@ -56,22 +56,26 @@ void CPetText::setup() {
 	_stringsMerged = false;
 }
 
-void CPetText::setArrayStr2(uint idx, int val1, int val2, int val3) {
+void CPetText::setLineColor(uint lineNum, uint col) {
+	setLineColor(lineNum, col & 0xff, (col >> 16) & 0xff, (col >> 8) & 0xff);
+}
+
+void CPetText::setLineColor(uint lineNum, byte r, byte g, byte b) {
 	char buffer[6];
-	if (!val1)
-		val1 = 1;
-	if (!val2)
-		val2 = 1;
-	if (!val3)
-		val3 = 1;
-
-	buffer[0] = 27;
-	buffer[1] = val1;
-	buffer[2] = val2;
-	buffer[3] = val3;
-	buffer[4] = 27;
+	if (!r)
+		r = 1;
+	if (!g)
+		g = 1;
+	if (!b)
+		b = 1;
+
+	buffer[0] = TEXTCMD_SET_COLOR;
+	buffer[1] = r;
+	buffer[2] = g;
+	buffer[3] = b;
+	buffer[4] = TEXTCMD_SET_COLOR;
 	buffer[5] = '\0';
-	_array[idx]._string2 = buffer;
+	_array[lineNum]._rgb = buffer;
 }
 
 void CPetText::load(SimpleFile *file, int param) {
@@ -99,7 +103,7 @@ void CPetText::load(SimpleFile *file, int param) {
 		assert(_array.size() >= count);
 		for (uint idx = 0; idx < count; ++idx) {
 			_array[idx]._string1 = file->readString();
-			_array[idx]._string2 = file->readString();
+			_array[idx]._rgb = file->readString();
 			_array[idx]._string3 = file->readString();
 		}	
 	}
@@ -147,7 +151,7 @@ void CPetText::mergeStrings() {
 		_lines.clear();
 
 		for (int idx = 0; idx < _lineCount; ++idx) {
-			CString line = _array[idx]._string2 + _array[idx]._string3 +
+			CString line = _array[idx]._rgb + _array[idx]._string3 +
 				_array[idx]._string1 + "\n";
 			_lines += line;
 
@@ -188,10 +192,6 @@ void CPetText::changeText(const CString &str) {
 	_stringsMerged = false;
 }
 
-void CPetText::setColor(int val1, uint col) {
-	warning("CPetText::setColor");
-}
-
 void CPetText::setColor(uint col) {
 	_textR = col & 0xff;
 	_textG = (col >> 8) & 0xff;
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 24c4e94..2213c63 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -31,7 +31,7 @@ namespace Titanic {
 class CPetText {
 	struct ArrayEntry {
 		CString _string1;
-		CString _string2;
+		CString _rgb;
 		CString _string3;
 	};
 private:
@@ -64,8 +64,6 @@ private:
 
 	void freeArrays();
 
-	void setArrayStr2(uint idx, int val1, int val2, int val3);
-
 	/**
 	 * Merges the strings in the strings array
 	 */
@@ -120,12 +118,17 @@ public:
 	/**
 	 * Set text color
 	 */
-	void setColor(int val1, uint col);
+	void setColor(uint col);
 
 	/**
-	 * Set text color
+	 * Set the color for a line
 	 */
-	void setColor(uint col);
+	void setLineColor(uint lineNum, byte r, byte g, byte b);
+
+	/**
+	 * Set the color for a line
+	 */
+	void setLineColor(uint lineNum, uint col);
 
 	/**
 	 * Sets the maximum number of characters per line
diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index e903aba..819eaad 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -84,9 +84,9 @@ int STFont::getTextBounds(const CString &str, int maxWidth, Point *sizeOut) cons
 	// Loop through the characters of the string
 	if (!str.empty()) {
 		for (const char *strP = str.c_str(); *strP; ++strP) {
-			if (*strP == 26) {
+			if (*strP == TEXTCMD_26) {
 				strP += 3;
-			} else if (*strP == 27) {
+			} else if (*strP == TEXTCMD_SET_COLOR) {
 				strP += 4;
 			} else {
 				if (*strP == ' ') {
@@ -116,7 +116,7 @@ int STFont::stringWidth(const CString &text) const {
 		if (c == 26) {
 			// Skip over command parameter bytes
 			srcP += 3;
-		} else if (c == 27) {
+		} else if (c == TEXTCMD_SET_COLOR) {
 			// Skip over command parameter bytes
 			srcP += 4;
 		} else if (c != '\n') {
@@ -211,9 +211,9 @@ void STFont::checkLineWrap(Point &textSize, int maxWidth, const char *&str) cons
 		if (*srcPtr == ' ' && flag)
 			break;
 
-		if (*srcPtr == 26)
+		if (*srcPtr == TEXTCMD_26)
 			srcPtr += 3;
-		else if (*srcPtr == 27)
+		else if (*srcPtr == TEXTCMD_SET_COLOR)
 			srcPtr += 4;
 		else
 			totalWidth += _chars[*srcPtr]._width;
diff --git a/engines/titanic/support/font.h b/engines/titanic/support/font.h
index 4bb1b2e..087680e 100644
--- a/engines/titanic/support/font.h
+++ b/engines/titanic/support/font.h
@@ -30,6 +30,8 @@
 
 namespace Titanic {
 
+enum TextCommand { TEXTCMD_26 = 26, TEXTCMD_SET_COLOR = 27 };
+
 class CVideoSurface;
 
 class STFont {


Commit: 02bb9510aa3ae99d063e21a6e4c63479b9320d3f
    https://github.com/scummvm/scummvm/commit/02bb9510aa3ae99d063e21a6e4c63479b9320d3f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:03-04:00

Commit Message:
TITANIC: Implemented CPetConversations setup

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 2fbee9e..3afd5ee 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -34,14 +34,55 @@ void CPetConversations::save(SimpleFile *file, int indent) const {
 
 void CPetConversations::load(SimpleFile *file, int param) {
 	_text2.load(file, param);
-	_text1.load(file, param);
+	_log.load(file, param);
 
 	for (int idx = 0; idx < 3; ++idx)
 		_valArray3[idx] = file->readNumber();
 }
 
 bool CPetConversations::isValid(CPetControl *petControl) {
-	// TODO
+	return setupControl(petControl);
+}
+
+bool CPetConversations::setupControl(CPetControl *petControl) {
+	if (petControl) {
+		_petControl = petControl;
+
+		_val3.setBounds(Rect(0, 0, 21, 130));
+		_val3.translate(20, 350);
+		
+		const Rect rect1(0, 0, 22, 36);
+		_gfxList[0].setBounds(rect1);
+		_gfxList[0].translate(20, 359);
+		_gfxList[1].setBounds(rect1);
+		_gfxList[1].translate(20, 397);
+		_gfxList[2].setBounds(rect1);
+		_gfxList[2].translate(20, 434);
+
+		const Rect rect2(0, 0, 11, 24);
+		_val1.setBounds(rect2);
+		_val1.translate(87, 374);
+		_val2.setBounds(rect2);
+		_val2.translate(87, 421);
+
+		const Rect rect3(0, 0, 39, 39);
+		_val7.setBounds(rect3);
+		_val7.translate(546, 372);
+		_val8.setBounds(rect3);
+		_val8.translate(546, 418);
+
+		_val6.setBounds(Rect(0, 0, 37, 70));
+		_val6.translate(46, 374);
+		_val9.setBounds(Rect(0, 0, 435, 3));
+		_val9.translate(102, 441);
+
+		const Rect rect4(0, 0, 33, 66);
+		for (int idx = 0; idx < 9; ++idx) {
+			_valArray2[idx].setBounds(rect4);
+			_valArray2[idx].translate(48, 376);
+		}
+	}
+
 	return true;
 }
 
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index a79a513..89dbc5e 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -34,7 +34,7 @@ private:
 	CPetGfxElement _val1;
 	CPetGfxElement _val2;
 	CPetGfxElement _val3;
-	CPetGfxElement _valArray1[3];
+	CPetGfxElement _gfxList[3];
 	CPetGfxElement _val4;
 	CPetGfxElement _val5;
 	CPetGfxElement _val6;
@@ -44,12 +44,17 @@ private:
 	CPetGfxElement _val9;
 	CPetGfxElement _valArray2[9];
 	int _field30C;
-	CPetText _text1;
+	CPetText _log;
 	CPetText _text2;
 	int _valArray3[3];
 	int _field414;
 	int _field418;
 	CString _string1;
+private:
+	/**
+	 * Sets up the control
+	 */
+	bool setupControl(CPetControl *petControl);
 public:
 	CPetConversations();
 
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 324a633..2e3a184 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -47,7 +47,7 @@ void CPetText::freeArrays() {
 
 void CPetText::setup() {
 	for (int idx = 0; idx < (int)_array.size(); ++idx) {
-		_array[idx]._string1.clear();
+		_array[idx]._line.clear();
 		setLineColor(idx, _textR, _textG, _textB);
 		_array[idx]._string3.clear();
 	}
@@ -102,7 +102,7 @@ void CPetText::load(SimpleFile *file, int param) {
 		warning("TODO: CPetText::load %d,%d", var1, var2);
 		assert(_array.size() >= count);
 		for (uint idx = 0; idx < count; ++idx) {
-			_array[idx]._string1 = file->readString();
+			_array[idx]._line = file->readString();
 			_array[idx]._rgb = file->readString();
 			_array[idx]._string3 = file->readString();
 		}	
@@ -152,7 +152,7 @@ void CPetText::mergeStrings() {
 
 		for (int idx = 0; idx < _lineCount; ++idx) {
 			CString line = _array[idx]._rgb + _array[idx]._string3 +
-				_array[idx]._string1 + "\n";
+				_array[idx]._line + "\n";
 			_lines += line;
 
 		}
@@ -168,24 +168,32 @@ void CPetText::resize(uint count) {
 	_array.resize(count);
 }
 
+CString CPetText::getText() const {
+	CString result = "";
+	for (uint idx = 0; idx < _lineCount; ++idx)
+		result += _array[idx]._line;
+
+	return result;
+}
+
 void CPetText::setText(const CString &str) {
 	setup();
 	changeText(str);
 }
 
 void CPetText::changeText(const CString &str) {
-	int lineSize = _array[_lineCount]._string1.size();
+	int lineSize = _array[_lineCount]._line.size();
 	int strSize = str.size();
 
 	if (_maxCharsPerLine == -1) {
 		// No limit on horizontal characters, so append string to current line
-		_array[_lineCount]._string1 += str;
+		_array[_lineCount]._line += str;
 	} else if ((lineSize + strSize) <= _maxCharsPerLine) {
 		// New string fits into line, so add it on
-		_array[_lineCount]._string1 += str;
+		_array[_lineCount]._line += str;
 	} else {
 		// Only add part of the str up to the maximum allowed limit for line
-		_array[_lineCount]._string1 += str.left(_maxCharsPerLine - lineSize);
+		_array[_lineCount]._line += str.left(_maxCharsPerLine - lineSize);
 	}
 	
 	updateStr3(_lineCount);
@@ -198,6 +206,12 @@ void CPetText::setColor(uint col) {
 	_textB = (col >> 16) & 0xff;
 }
 
+void CPetText::setColor(byte r, byte g, byte b) {
+	_textR = r;
+	_textG = g;
+	_textB = b;
+}
+
 void CPetText::setMaxCharsPerLine(int maxChars) {
 	if (maxChars >= -1 && maxChars < 257)
 		_maxCharsPerLine = maxChars;
@@ -206,7 +220,7 @@ void CPetText::setMaxCharsPerLine(int maxChars) {
 void CPetText::updateStr3(int lineNum) {
 	if (_field64 > 0 && _field68 > 0) {
 		char line[5];
-		line[0] = line[3] = 26;
+		line[0] = line[3] = TEXTCMD_26;
 		line[1] = _field64;
 		line[2] = _field68;
 		line[4] = '\0';
@@ -226,4 +240,11 @@ int CPetText::getTextHeight(CScreenManager *screenManager) {
 	return textHeight;
 }
 
+void CPetText::deleteLastChar() {
+	if (!_array[_lineCount]._line.empty()) {
+		_array[_lineCount]._line.deleteLastChar();
+		_stringsMerged = false;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 2213c63..73e8540 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 class CPetText {
 	struct ArrayEntry {
-		CString _string1;
+		CString _line;
 		CString _rgb;
 		CString _string3;
 	};
@@ -111,6 +111,11 @@ public:
 	void resize(uint count);
 
 	/**
+	 * Returns the text from all the lines as a single string
+	 */
+	CString getText() const;
+
+	/**
 	 * Set the text
 	 */
 	void setText(const CString &str);
@@ -121,6 +126,11 @@ public:
 	void setColor(uint col);
 
 	/**
+	 * Set text color
+	 */
+	void setColor(byte r, byte g, byte b);
+
+	/**
 	 * Set the color for a line
 	 */
 	void setLineColor(uint lineNum, byte r, byte g, byte b);
@@ -134,6 +144,11 @@ public:
 	 * Sets the maximum number of characters per line
 	 */
 	void setMaxCharsPerLine(int maxChars);
+
+	/**
+	 * Delete the last character from the last line
+	 */
+	void deleteLastChar();
 };
 
 } // End of namespace Titanic


Commit: b114c768cd592462794d4fa2a397473cf146656c
    https://github.com/scummvm/scummvm/commit/b114c768cd592462794d4fa2a397473cf146656c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:04-04:00

Commit Message:
TITANIC: Adding more CPetText support methods

Changed paths:
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 2e3a184..7f5a5ea 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -170,7 +170,7 @@ void CPetText::resize(uint count) {
 
 CString CPetText::getText() const {
 	CString result = "";
-	for (uint idx = 0; idx < _lineCount; ++idx)
+	for (int idx = 0; idx < _lineCount; ++idx)
 		result += _array[idx]._line;
 
 	return result;
@@ -247,4 +247,9 @@ void CPetText::deleteLastChar() {
 	}
 }
 
+void CPetText::setNPC(int val1, int npcId) {
+	_field64 = val1;
+	_field68 = npcId;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 73e8540..35d4897 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -149,6 +149,13 @@ public:
 	 * Delete the last character from the last line
 	 */
 	void deleteLastChar();
+
+	void setNPC(int val1, int npcId);
+
+	/**
+	 * Get the font
+	 */
+	int getFontNumber() const { return _fontNumber1; }
 };
 
 } // End of namespace Titanic


Commit: 34c32e38e2659406e3556f752fcada8491860e92
    https://github.com/scummvm/scummvm/commit/34c32e38e2659406e3556f752fcada8491860e92
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:05-04:00

Commit Message:
TITANIC: More font logic, beginnings of text cursor

Changed paths:
    engines/titanic/game_manager.cpp
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h
    engines/titanic/support/font.cpp
    engines/titanic/support/font.h
    engines/titanic/support/screen_manager.cpp
    engines/titanic/support/screen_manager.h
    engines/titanic/support/text_cursor.cpp
    engines/titanic/support/text_cursor.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 31bb427..a82488e 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -142,7 +142,7 @@ void CGameManager::update() {
 		CScreenManager *screenManager = CScreenManager::_screenManagerPtr;
 		CTextCursor *textCursor = screenManager->_textCursor;
 		if (textCursor && textCursor->_active)
-			_bounds.extend(textCursor->getBounds());
+			_bounds.extend(textCursor->getCursorBounds());
 		
 		// Set the surface bounds
 		screenManager->setSurfaceBounds(SURFACE_BACKBUFFER, _bounds);
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 7f5a5ea..77019d7 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -30,7 +30,7 @@ CPetText::CPetText(uint count) :
 		_backR(0xff), _backG(0xff), _backB(0xff), 
 		_textR(0), _textG(0), _textB(200),
 		_fontNumber2(0), _field64(0), _field68(0), _field6C(0),
-		_hasBorder(true), _field74(0), _field78(0), _field7C(0) {
+		_hasBorder(true), _field74(0), _textCursor(nullptr), _field7C(0) {
 	setupArrays(count);
 }
 
@@ -140,9 +140,8 @@ void CPetText::draw(CScreenManager *screenManager) {
 	tempRect.grow(-2);
 	screenManager->setFontNumber(_fontNumber2);
 
-//	int var14 = 0;
-//	screenManager->writeLines(0, &var14, _field74, )
-	warning("TODO: CPetText_Draw");
+	screenManager->writeString(0, tempRect, _field74, _lines, _textCursor);
+
 	screenManager->setFontNumber(_fontNumber1);
 }
 
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 35d4897..6ce1903 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -25,6 +25,7 @@
 
 #include "titanic/support/simple_file.h"
 #include "titanic/support/screen_manager.h"
+#include "titanic/support/text_cursor.h"
 
 namespace Titanic {
 
@@ -57,7 +58,7 @@ private:
 	int _field6C;
 	bool _hasBorder;
 	int _field74;
-	int _field78;
+	CTextCursor *_textCursor;
 	int _field7C;
 private:
 	void setupArrays(int count);
diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index 819eaad..c6fd871 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -127,11 +127,60 @@ int STFont::stringWidth(const CString &text) const {
 	return total;
 }
 
-int STFont::writeString(CVideoSurface *surface, const Point &pt, const CString &str) {
-	return 0;
+int STFont::writeString(CVideoSurface *surface, const Rect &rect1, const Rect &destRect,
+		int val1, const CString &str, CTextCursor *textCursor) {
+	if (!_fontHeight || !_dataPtr)
+		return -1;
+
+	Point textSize;
+	Rect destBounds = destRect;
+	destBounds.constrain(rect1);
+	if (destBounds.isEmpty())
+		return -1;
+
+	const char *endP = nullptr;
+	const char *strEndP = str.c_str() + str.size() - 1;
+	for (const char *srcP = str.c_str(); *srcP; ++srcP) {
+		if (*srcP == TEXTCMD_26) {
+			srcP += 3;
+		} else if (*srcP == TEXTCMD_SET_COLOR) {
+			// Change the color used for characters
+			byte r = *++srcP;
+			byte g = *++srcP;
+			byte b = *++srcP;
+			++srcP;
+			setColor(r, g, b);
+		} else {
+			if (*srcP == ' ') {
+				// Check fo rline wrapping
+				checkLineWrap(textSize, rect1.width(), srcP);
+				if (!*srcP)
+					return endP - str.c_str();
+			}
+
+			if (*srcP != '\n') {
+				int result = writeChar(surface, *srcP, textSize, rect1, &destBounds);
+				if (result == -2)
+					return endP - str.c_str();
+				else if (!result)
+					endP = srcP;
+			}
+
+			if (srcP < strEndP)
+				extendBounds(textSize, *srcP, rect1.width());
+		}
+	}
+
+	if (textCursor && textCursor->get54() == -2) {
+		Point cursorPos(rect1.left + textSize.x, rect1.top + textSize.y);
+		textCursor->setPos(cursorPos);
+	}
+
+	return endP - str.c_str();
 }
 
-int STFont::writeChar(CVideoSurface *surface, unsigned char c, const Point &pt, Rect *destRect, Rect *srcRect) {
+int STFont::writeChar(CVideoSurface *surface, unsigned char c, const Point &pt,
+	const Rect &destRect, const Rect *srcRect) {
 	if (c == 233)
 		c = '$';
 
@@ -140,10 +189,10 @@ int STFont::writeChar(CVideoSurface *surface, unsigned char c, const Point &pt,
 	tempRect.right = _chars[c]._offset + _chars[c]._width;
 	tempRect.top = 0;
 	tempRect.bottom = _fontHeight;
-	Point destPos(pt.x + destRect->left, pt.y + destRect->top);
+	Point destPos(pt.x + destRect.left, pt.y + destRect.top);
 
 	if (srcRect->isEmpty())
-		srcRect = destRect;
+		srcRect = &destRect;
 	if (destPos.y > srcRect->bottom)
 		return -2;
 
diff --git a/engines/titanic/support/font.h b/engines/titanic/support/font.h
index 087680e..f2d7c47 100644
--- a/engines/titanic/support/font.h
+++ b/engines/titanic/support/font.h
@@ -27,6 +27,7 @@
 #include "common/array.h"
 #include "titanic/support/rect.h"
 #include "titanic/support/string.h"
+#include "titanic/support/text_cursor.h"
 
 namespace Titanic {
 
@@ -51,7 +52,7 @@ private:
 	 * Write a character
 	 */
 	int writeChar(CVideoSurface *surface, unsigned char c, 
-		const Common::Point &pt, Rect *destRect, Rect *srcRect);
+		const Common::Point &pt, const Rect &destRect, const Rect *srcRect);
 
 	/**
 	 * Extends a passed text area by the space required for
@@ -87,7 +88,8 @@ public:
 	/**
 	 * Write a string to the specified surface
 	 */
-	int writeString(CVideoSurface *surface, const Point &pt, const CString &str);
+	int writeString(CVideoSurface *surface, const Rect &rect1, const Rect &destRect,
+		int val1, const CString &str, CTextCursor *textCursor);
 
 	/**
 	 * Get the text area a string will fit into
diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp
index b467c85..3005bdd 100644
--- a/engines/titanic/support/screen_manager.cpp
+++ b/engines/titanic/support/screen_manager.cpp
@@ -201,7 +201,16 @@ void OSScreenManager::blitFrom(SurfaceNum surfaceNum, CVideoSurface *src,
 }
 
 void OSScreenManager::proc12() {}
-void OSScreenManager::proc13() {}
+
+int OSScreenManager::writeString(int surfaceNum, const Rect &destRect, 
+		int val1, const CString &str, CTextCursor *textCursor) {
+	if (_backSurfaces.empty())
+		return -1;
+
+	return _fonts[_fontNumber].writeString(_backSurfaces[surfaceNum]._surface,
+		destRect, _backSurfaces[surfaceNum]._bounds, val1, str, textCursor);
+}
+
 void OSScreenManager::proc14() {}
 
 void OSScreenManager::setFontColor(byte r, byte g, byte b) {
@@ -273,7 +282,7 @@ void OSScreenManager::loadCursors() {
 	showCursor();
 
 	if (!_textCursor) {
-		_textCursor = new CTextCursor();
+		_textCursor = new CTextCursor(this);
 	}
 }
 
diff --git a/engines/titanic/support/screen_manager.h b/engines/titanic/support/screen_manager.h
index b1e949a..7fe60d2 100644
--- a/engines/titanic/support/screen_manager.h
+++ b/engines/titanic/support/screen_manager.h
@@ -106,7 +106,17 @@ public:
 		const Rect *srcRect = nullptr) = 0;
 
 	virtual void proc12() = 0;
-	virtual void proc13() = 0;
+	
+	/**
+	 * Write a string
+	 * @param surfaceNum	Destination surface
+	 * @param destRect		Bounds within dest surface
+	 * @param str			Line or lines to write
+	 * @param textCursor	Optional text cursor pointer
+	 */
+	virtual int writeString(int surfaceNum, const Rect &destRect, int val1,
+		const CString &str, CTextCursor *textCursor) = 0;
+	
 	virtual void proc14() = 0;
 
 	/**
@@ -226,7 +236,17 @@ public:
 		const Rect *srcRect = nullptr);
 
 	virtual void proc12();
-	virtual void proc13();
+
+	/**
+	 * Write a string
+	 * @param surfaceNum	Destination surface
+	 * @param destRect		Bounds within dest surface
+	 * @param str			Line or lines to write
+	 * @param textCursor	Optional text cursor pointer
+	 */
+	virtual int writeString(int surfaceNum, const Rect &destRect,
+		int val1, const CString &str, CTextCursor *textCursor);
+
 	virtual void proc14();
 
 	/**
diff --git a/engines/titanic/support/text_cursor.cpp b/engines/titanic/support/text_cursor.cpp
index fd0c1d2..2f2ee8a 100644
--- a/engines/titanic/support/text_cursor.cpp
+++ b/engines/titanic/support/text_cursor.cpp
@@ -22,15 +22,19 @@
 
 #include "common/textconsole.h"
 #include "titanic/support/text_cursor.h"
+#include "titanic/support/screen_manager.h"
 
 namespace Titanic {
 
-CTextCursor::CTextCursor() : _active(false) {
+CTextCursor::CTextCursor(CScreenManager *screenManager) : 
+		_screenManager(screenManager), _priorTicks(300), _active(false),
+		_field24(0), _size(2, 10), _field38(0), _field3C(0),
+		_field44(0), _field48(0), _field4C(0), _field54(-1) {
+	screenManager->createSurface(10, 10);
 }
 
-Rect CTextCursor::getBounds() {
-	warning("CTextCursor::getBounds");
-	return Rect();
+CTextCursor::~CTextCursor() {
+	delete _surface;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/text_cursor.h b/engines/titanic/support/text_cursor.h
index b648067..d9dbce0 100644
--- a/engines/titanic/support/text_cursor.h
+++ b/engines/titanic/support/text_cursor.h
@@ -28,13 +28,63 @@
 
 namespace Titanic {
 
+class CScreenManager;
+class CVideoSurface;
+
 class CTextCursor {
+private:
+	CScreenManager *_screenManager;
+	Point _pos;
+	Rect _bounds;
+	uint _priorTicks;
+	int _field24;
+	Point _size;
+	int _field38;
+	int _field3C;
+	int _field44;
+	int _field48;
+	int _field4C;
+	CVideoSurface *_surface;
+	int _field54;
 public:
 	bool _active;
 public:
-	CTextCursor();
+	CTextCursor(CScreenManager *screenManager);
+	~CTextCursor();
+
+	/**
+	 * Sets the position of the cursor
+	 */
+	void setPos(const Point &pt) { _pos = pt; }
+
+	/**
+	 * Sets the size of the cursor
+	 */
+	void setSize(const Point &size) { _size = size; }
+
+	/**
+	 * Returns the bounds for the cursor
+	 */
+	Rect getCursorBounds() const {
+		return Rect(_pos.x, _pos.y, _pos.x + _size.x, _pos.y + _size.y);
+	}
+
+	/**
+	 * Set bounds
+	 */
+	void setBounds(const Rect &r) { _bounds = r; }
+
+	/**
+	 * Clear the bounds
+	 */
+	void clearBounds() { _bounds.clear(); }
+
+	/**
+	 * Set the prior ticks
+	 */
+	void setTicks(uint ticks) { _priorTicks = ticks; }
 
-	Rect getBounds();
+	int get54() const { return _field54; }
 };
 
 } // End of namespace Titanic


Commit: d6b104d5a3e4ad7baebee8504ed60537a35a429e
    https://github.com/scummvm/scummvm/commit/d6b104d5a3e4ad7baebee8504ed60537a35a429e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:06-04:00

Commit Message:
TITANIC: Further work on CTextCursor fields

Changed paths:
    engines/titanic/support/text_cursor.cpp
    engines/titanic/support/text_cursor.h



diff --git a/engines/titanic/support/text_cursor.cpp b/engines/titanic/support/text_cursor.cpp
index 2f2ee8a..7e69a22 100644
--- a/engines/titanic/support/text_cursor.cpp
+++ b/engines/titanic/support/text_cursor.cpp
@@ -28,8 +28,8 @@ namespace Titanic {
 
 CTextCursor::CTextCursor(CScreenManager *screenManager) : 
 		_screenManager(screenManager), _priorTicks(300), _active(false),
-		_field24(0), _size(2, 10), _field38(0), _field3C(0),
-		_field44(0), _field48(0), _field4C(0), _field54(-1) {
+		_field24(0), _size(2, 10), _field44(0), _field48(0), _field4C(0),
+		_field54(-1) {
 	screenManager->createSurface(10, 10);
 }
 
diff --git a/engines/titanic/support/text_cursor.h b/engines/titanic/support/text_cursor.h
index d9dbce0..c9fcfa3 100644
--- a/engines/titanic/support/text_cursor.h
+++ b/engines/titanic/support/text_cursor.h
@@ -39,8 +39,7 @@ private:
 	uint _priorTicks;
 	int _field24;
 	Point _size;
-	int _field38;
-	int _field3C;
+	Point _screenTopLeft;
 	int _field44;
 	int _field48;
 	int _field4C;
@@ -84,6 +83,11 @@ public:
 	 */
 	void setTicks(uint ticks) { _priorTicks = ticks; }
 
+	/**
+	 * Returns whether the text cursor is active
+	 */
+	bool isActive() const { return _active; }
+
 	int get54() const { return _field54; }
 };
 


Commit: a2f933a80e5e830cdbcbb530f334c41725ee87b2
    https://github.com/scummvm/scummvm/commit/a2f933a80e5e830cdbcbb530f334c41725ee87b2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:07-04:00

Commit Message:
TITANIC: Minor fleshing out on font drawing

Changed paths:
    engines/titanic/support/font.cpp
    engines/titanic/support/font.h



diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index c6fd871..d1c947f 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -128,11 +128,11 @@ int STFont::stringWidth(const CString &text) const {
 }
 
 int STFont::writeString(CVideoSurface *surface, const Rect &rect1, const Rect &destRect,
-		int val1, const CString &str, CTextCursor *textCursor) {
+		int yOffset, const CString &str, CTextCursor *textCursor) {
 	if (!_fontHeight || !_dataPtr)
 		return -1;
 
-	Point textSize;
+	Point textSize(0, -yOffset);
 	Rect destBounds = destRect;
 	destBounds.constrain(rect1);
 	if (destBounds.isEmpty())
@@ -171,7 +171,7 @@ int STFont::writeString(CVideoSurface *surface, const Rect &rect1, const Rect &d
 		}
 	}
 
-	if (textCursor && textCursor->get54() == -2) {
+	if (textCursor && textCursor->getMode() == -2) {
 		Point cursorPos(rect1.left + textSize.x, rect1.top + textSize.y);
 		textCursor->setPos(cursorPos);
 	}
@@ -236,7 +236,8 @@ void STFont::copyRect(CVideoSurface *surface, const Point &pt, Rect &rect) {
 			uint16 *destP = lineP;
 			for (int xp = rect.left; xp < rect.right; ++xp, ++destP) {
 				const byte *srcP = _dataPtr + yp * _dataWidth + xp;
-				//surface->changePixel(destP, color, *srcP >> 3, 1);
+				if (*srcP >> 3)
+					*destP = color;
 			}
 		}
 
diff --git a/engines/titanic/support/font.h b/engines/titanic/support/font.h
index f2d7c47..75c91f3 100644
--- a/engines/titanic/support/font.h
+++ b/engines/titanic/support/font.h
@@ -89,7 +89,7 @@ public:
 	 * Write a string to the specified surface
 	 */
 	int writeString(CVideoSurface *surface, const Rect &rect1, const Rect &destRect,
-		int val1, const CString &str, CTextCursor *textCursor);
+		int yOffset, const CString &str, CTextCursor *textCursor);
 
 	/**
 	 * Get the text area a string will fit into


Commit: 74e40be66e231a8eada9bc045828e17f044a7c55
    https://github.com/scummvm/scummvm/commit/74e40be66e231a8eada9bc045828e17f044a7c55
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:08-04:00

Commit Message:
TITANIC: Implementing text cursor drawing

Changed paths:
    engines/titanic/support/screen_manager.cpp
    engines/titanic/support/screen_manager.h
    engines/titanic/support/text_cursor.cpp
    engines/titanic/support/text_cursor.h
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp
index 3005bdd..0c9d3ab 100644
--- a/engines/titanic/support/screen_manager.cpp
+++ b/engines/titanic/support/screen_manager.cpp
@@ -140,8 +140,6 @@ CVideoSurface *OSScreenManager::getSurface(SurfaceNum surfaceNum) const {
 		return nullptr;
 }
 
-void OSScreenManager::proc9() {}
-
 void OSScreenManager::fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g, byte b) {
 	DirectDrawSurface *surface = getDDSurface(surfaceNum);
 	if (!surface)
diff --git a/engines/titanic/support/screen_manager.h b/engines/titanic/support/screen_manager.h
index 7fe60d2..b963fcd 100644
--- a/engines/titanic/support/screen_manager.h
+++ b/engines/titanic/support/screen_manager.h
@@ -92,7 +92,11 @@ public:
 	virtual void proc6() = 0;
 	virtual void proc7() = 0;
 	virtual CVideoSurface *getSurface(SurfaceNum surfaceNum) const = 0;
-	virtual void proc9() = 0;
+
+	/**
+	 * Return the front render surface
+	 */
+	virtual CVideoSurface *getFrontRenderSurface() const = 0;
 	
 	/**
 	 * Fill an area with a specific color
@@ -222,7 +226,14 @@ public:
 	virtual void proc6();
 	virtual void proc7();
 	virtual CVideoSurface *getSurface(SurfaceNum surfaceNum) const;
-	virtual void proc9();
+
+	/**
+	 * Return the front render surface
+	 */
+	virtual CVideoSurface *getFrontRenderSurface() const {
+		return _frontRenderSurface;
+	}
+
 
 	/**
 	 * Fill an area with a specific color
diff --git a/engines/titanic/support/text_cursor.cpp b/engines/titanic/support/text_cursor.cpp
index 7e69a22..c3d2f20 100644
--- a/engines/titanic/support/text_cursor.cpp
+++ b/engines/titanic/support/text_cursor.cpp
@@ -23,13 +23,15 @@
 #include "common/textconsole.h"
 #include "titanic/support/text_cursor.h"
 #include "titanic/support/screen_manager.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
 CTextCursor::CTextCursor(CScreenManager *screenManager) : 
-		_screenManager(screenManager), _priorTicks(300), _active(false),
-		_field24(0), _size(2, 10), _field44(0), _field48(0), _field4C(0),
-		_field54(-1) {
+		_screenManager(screenManager), _active(false), _blinkVisible(false),
+		_backRenderSurface(nullptr), _frontRenderSurface(nullptr),
+		_blinkDelay(300), _size(2, 10), _priorBlinkTime(0),
+		_cursorR(0), _cursorG(0), _cursorB(0), _mode(-1) {
 	screenManager->createSurface(10, 10);
 }
 
@@ -37,4 +39,52 @@ CTextCursor::~CTextCursor() {
 	delete _surface;
 }
 
+void CTextCursor::setColor(byte r, byte g, byte b) {
+	_cursorR = r;
+	_cursorG = g;
+	_cursorB = b;
+}
+
+void CTextCursor::show() {
+	_backRenderSurface = _screenManager->getSurface(SURFACE_BACKBUFFER);
+	_frontRenderSurface = _screenManager->getFrontRenderSurface();
+	_active = true;
+	_priorBlinkTime = g_vm->_events->getTicksCount();
+}
+
+void CTextCursor::hide() {
+	_active = false;
+}
+
+void CTextCursor::draw() {
+	if (!_active)
+		return;
+
+	// Handle updating whether the blinking cursor is visible or not
+	uint newTicks = g_vm->_events->getTicksCount();
+	while (newTicks > (_priorBlinkTime + _blinkDelay)) {
+		_priorBlinkTime += _blinkDelay;
+		_blinkVisible = !_blinkVisible;
+	}
+
+	if (_blinkVisible) {
+		Rect cursorRect = getCursorBounds();
+		_surface->blitFrom(Common::Point(0, 0), _backRenderSurface, &cursorRect);
+	
+		if (!_screenBounds.isEmpty())
+			// Limit the cursor rect to only within designated screen area
+			cursorRect.constrain(_screenBounds);
+
+		if (!cursorRect.isEmpty()) {
+			// Draw cursor onto the screen
+			_backRenderSurface->_ddSurface->fillRect(&cursorRect,
+				_cursorR, _cursorG, _cursorB);
+		}
+	}
+
+	if (_active && _blinkVisible) {
+		_screenManager->blitFrom(SURFACE_BACKBUFFER, _surface, &_pos);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/support/text_cursor.h b/engines/titanic/support/text_cursor.h
index c9fcfa3..d8c6ac0 100644
--- a/engines/titanic/support/text_cursor.h
+++ b/engines/titanic/support/text_cursor.h
@@ -34,17 +34,20 @@ class CVideoSurface;
 class CTextCursor {
 private:
 	CScreenManager *_screenManager;
+	CVideoSurface *_backRenderSurface;
+	CVideoSurface *_frontRenderSurface;
 	Point _pos;
-	Rect _bounds;
-	uint _priorTicks;
-	int _field24;
+	Rect _screenBounds;
+	uint _blinkDelay;
+	bool _blinkVisible;
 	Point _size;
 	Point _screenTopLeft;
-	int _field44;
-	int _field48;
-	int _field4C;
+	uint _priorBlinkTime;
+	byte _cursorR;
+	byte _cursorG;
+	byte _cursorB;
 	CVideoSurface *_surface;
-	int _field54;
+	int _mode;
 public:
 	bool _active;
 public:
@@ -71,24 +74,46 @@ public:
 	/**
 	 * Set bounds
 	 */
-	void setBounds(const Rect &r) { _bounds = r; }
+	void setBounds(const Rect &r) { _screenBounds = r; }
 
 	/**
 	 * Clear the bounds
 	 */
-	void clearBounds() { _bounds.clear(); }
+	void clearBounds() { _screenBounds.clear(); }
 
 	/**
-	 * Set the prior ticks
+	 * Set the blinking rate
 	 */
-	void setTicks(uint ticks) { _priorTicks = ticks; }
+	void setBlinkRate(uint ticks) { _blinkDelay = ticks; }
+
+	/**
+	 * Set the cursor color
+	 */
+	void setColor(byte r, byte g, byte b);
 
 	/**
 	 * Returns whether the text cursor is active
 	 */
 	bool isActive() const { return _active; }
 
-	int get54() const { return _field54; }
+	int getMode() const { return _mode; }
+
+	void setMode(int mode) { _mode = mode; }
+
+	/**
+	 * Show the text cursor
+	 */
+	void show();
+
+	/**
+	 * Hide the text cursor
+	 */
+	void hide();
+
+	/**
+	 * Update and draw the cursor if necessary
+	 */
+	void draw();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 2ec2c9d..d706189 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -55,7 +55,6 @@ protected:
 protected:
 	CScreenManager *_screenManager;
 	CResourceKey _resourceKey;
-	DirectDrawSurface *_ddSurface;
 	Graphics::ManagedSurface *_rawSurface;
 	bool _pendingLoad;
 	void *_field40;
@@ -66,6 +65,7 @@ protected:
 	int _lockCount;
 public:
 	CMovie *_movie;
+	DirectDrawSurface *_ddSurface;
 	bool _blitFlag;
 	bool _blitStyleFlag;
 public:


Commit: 2675580208561c8c8bd9d6908a202006ddf195b7
    https://github.com/scummvm/scummvm/commit/2675580208561c8c8bd9d6908a202006ddf195b7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:10-04:00

Commit Message:
TITANIC: Fix crashes in PET and text cursor

Changed paths:
    engines/titanic/pet_control/pet_load_save.cpp
    engines/titanic/support/text_cursor.cpp



diff --git a/engines/titanic/pet_control/pet_load_save.cpp b/engines/titanic/pet_control/pet_load_save.cpp
index 5bfa1d6..811fd12 100644
--- a/engines/titanic/pet_control/pet_load_save.cpp
+++ b/engines/titanic/pet_control/pet_load_save.cpp
@@ -152,8 +152,7 @@ void CPetLoadSave::highlightChange() {
 	for (int idx = 0; idx < SAVEGAME_SLOTS_COUNT; ++idx)
 		_slotNames[idx].setColor(col);
 
-	// TODO: Unknown if check
-	if (true) {
+	if (_savegameSlotNum != -1) {
 		col = section ? section->getColor(4) : 0;
 		_slotNames[_savegameSlotNum].setLineColor(0, col);
 	}
diff --git a/engines/titanic/support/text_cursor.cpp b/engines/titanic/support/text_cursor.cpp
index c3d2f20..dc78d53 100644
--- a/engines/titanic/support/text_cursor.cpp
+++ b/engines/titanic/support/text_cursor.cpp
@@ -32,7 +32,7 @@ CTextCursor::CTextCursor(CScreenManager *screenManager) :
 		_backRenderSurface(nullptr), _frontRenderSurface(nullptr),
 		_blinkDelay(300), _size(2, 10), _priorBlinkTime(0),
 		_cursorR(0), _cursorG(0), _cursorB(0), _mode(-1) {
-	screenManager->createSurface(10, 10);
+	_surface = screenManager->createSurface(10, 10);
 }
 
 CTextCursor::~CTextCursor() {


Commit: a8835043f54daf54a2c03ccdb02f125a62a7ddcd
    https://github.com/scummvm/scummvm/commit/a8835043f54daf54a2c03ccdb02f125a62a7ddcd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:11-04:00

Commit Message:
TITANIC: PET Text is now partially showing

Changed paths:
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/support/screen_manager.cpp
    engines/titanic/support/screen_manager.h



diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 77019d7..3a10ab4 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -140,7 +140,7 @@ void CPetText::draw(CScreenManager *screenManager) {
 	tempRect.grow(-2);
 	screenManager->setFontNumber(_fontNumber2);
 
-	screenManager->writeString(0, tempRect, _field74, _lines, _textCursor);
+	screenManager->writeString(SURFACE_BACKBUFFER, tempRect, _field74, _lines, _textCursor);
 
 	screenManager->setFontNumber(_fontNumber1);
 }
@@ -149,11 +149,10 @@ void CPetText::mergeStrings() {
 	if (!_stringsMerged) {
 		_lines.clear();
 
-		for (int idx = 0; idx < _lineCount; ++idx) {
+		for (int idx = 0; idx <= _lineCount; ++idx) {
 			CString line = _array[idx]._rgb + _array[idx]._string3 +
 				_array[idx]._line + "\n";
 			_lines += line;
-
 		}
 
 		_stringsMerged = true;
diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp
index 0c9d3ab..1a43d78 100644
--- a/engines/titanic/support/screen_manager.cpp
+++ b/engines/titanic/support/screen_manager.cpp
@@ -201,12 +201,22 @@ void OSScreenManager::blitFrom(SurfaceNum surfaceNum, CVideoSurface *src,
 void OSScreenManager::proc12() {}
 
 int OSScreenManager::writeString(int surfaceNum, const Rect &destRect, 
-		int val1, const CString &str, CTextCursor *textCursor) {
-	if (_backSurfaces.empty())
+		int yOffset, const CString &str, CTextCursor *textCursor) {
+	CVideoSurface *surface;
+	Rect bounds;
+
+	if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size()) {
+		surface = _backSurfaces[surfaceNum]._surface;
+		bounds = _backSurfaces[surfaceNum]._bounds;
+	} else if (surfaceNum == -1) {
+		surface = _frontRenderSurface;
+		bounds = Rect(0, 0, surface->getWidth(), surface->getHeight());
+	} else {
 		return -1;
+	}
 
-	return _fonts[_fontNumber].writeString(_backSurfaces[surfaceNum]._surface,
-		destRect, _backSurfaces[surfaceNum]._bounds, val1, str, textCursor);
+	return _fonts[_fontNumber].writeString(surface, destRect, bounds,
+		yOffset, str, textCursor);
 }
 
 void OSScreenManager::proc14() {}
diff --git a/engines/titanic/support/screen_manager.h b/engines/titanic/support/screen_manager.h
index b963fcd..2e80869 100644
--- a/engines/titanic/support/screen_manager.h
+++ b/engines/titanic/support/screen_manager.h
@@ -115,12 +115,14 @@ public:
 	 * Write a string
 	 * @param surfaceNum	Destination surface
 	 * @param destRect		Bounds within dest surface
+	 * @param yOffset		Y offset for drawing, to allow for parts of
+	 *						the text to be scrolled off-screen
 	 * @param str			Line or lines to write
 	 * @param textCursor	Optional text cursor pointer
 	 */
-	virtual int writeString(int surfaceNum, const Rect &destRect, int val1,
-		const CString &str, CTextCursor *textCursor) = 0;
-	
+	virtual int writeString(int surfaceNum, const Rect &destRect,
+		int yOffset, const CString &str, CTextCursor *textCursor) = 0;
+
 	virtual void proc14() = 0;
 
 	/**
@@ -252,11 +254,13 @@ public:
 	 * Write a string
 	 * @param surfaceNum	Destination surface
 	 * @param destRect		Bounds within dest surface
+	 * @param yOffset		Y offset for drawing, to allow for parts of
+	 *						the text to be scrolled off-screen
 	 * @param str			Line or lines to write
 	 * @param textCursor	Optional text cursor pointer
 	 */
 	virtual int writeString(int surfaceNum, const Rect &destRect,
-		int val1, const CString &str, CTextCursor *textCursor);
+		int yOffset, const CString &str, CTextCursor *textCursor);
 
 	virtual void proc14();
 


Commit: e4b231b39dfb0247afa61ac8afb40be863b9f08c
    https://github.com/scummvm/scummvm/commit/e4b231b39dfb0247afa61ac8afb40be863b9f08c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:12-04:00

Commit Message:
TITANIC: Fix vertical drawing of text

Changed paths:
    engines/titanic/support/font.cpp



diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index d1c947f..ca9a7ed 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -232,11 +232,11 @@ void STFont::copyRect(CVideoSurface *surface, const Point &pt, Rect &rect) {
 		uint16 *lineP = surface->getBasePtr(pt.x, pt.y);
 		uint16 color = getColor();
 
-		for (int yp = rect.top; yp < rect.bottom; ++yp, lineP += surface->getPitch()) {
+		for (int yp = rect.top; yp < rect.bottom; ++yp, lineP += surface->getWidth()) {
 			uint16 *destP = lineP;
 			for (int xp = rect.left; xp < rect.right; ++xp, ++destP) {
 				const byte *srcP = _dataPtr + yp * _dataWidth + xp;
-				if (*srcP >> 3)
+				if (!(*srcP >> 3))
 					*destP = color;
 			}
 		}


Commit: 001a2ac15e5c8722ba283e7380d6dc9ce11e51b0
    https://github.com/scummvm/scummvm/commit/001a2ac15e5c8722ba283e7380d6dc9ce11e51b0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:13-04:00

Commit Message:
TITANIC: Implement surface changePixel method

Changed paths:
    engines/titanic/support/direct_draw_surface.h
    engines/titanic/support/font.cpp
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/support/direct_draw_surface.h b/engines/titanic/support/direct_draw_surface.h
index 12848b1..af19e36 100644
--- a/engines/titanic/support/direct_draw_surface.h
+++ b/engines/titanic/support/direct_draw_surface.h
@@ -85,6 +85,11 @@ public:
 	int getPitch() const { return _surface->pitch; }
 
 	/**
+	 * Return the surface's format
+	 */
+	const Graphics::PixelFormat &getFormat() { return _surface->format; }
+
+	/**
 	 * Lock the surface for access
 	 */
 	Graphics::ManagedSurface *lock(const Rect *bounds, int flags);
diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index ca9a7ed..3d5705a 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -236,8 +236,7 @@ void STFont::copyRect(CVideoSurface *surface, const Point &pt, Rect &rect) {
 			uint16 *destP = lineP;
 			for (int xp = rect.left; xp < rect.right; ++xp, ++destP) {
 				const byte *srcP = _dataPtr + yp * _dataWidth + xp;
-				if (!(*srcP >> 3))
-					*destP = color;
+				surface->changePixel(destP, &color, *srcP >> 3, true);
 			}
 		}
 
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 089b216..fe69478 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -164,6 +164,8 @@ bool CVideoSurface::proc45() {
 
 /*------------------------------------------------------------------------*/
 
+byte OSVideoSurface::_map[0x400];
+
 OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface) :
 		CVideoSurface(screenManager) {
 	_ddSurface = surface;
@@ -367,8 +369,26 @@ uint16 OSVideoSurface::getPixel(const Common::Point &pt) {
 	}
 }
 
-void OSVideoSurface::changePixel(uint16 *pixelP, uint16 color, int val3, int val5) {
-	// TODO
+void OSVideoSurface::changePixel(uint16 *pixelP, uint16 *color, byte srcVal, bool remapFlag) {
+	assert(getPixelDepth() == 2);
+	const Graphics::PixelFormat &format = _ddSurface->getFormat();
+	
+	// Get the color
+	byte r, g, b;
+	format.colorToRGB(*color, r, g, b);
+	if (remapFlag) {
+		r = _map[0x3e0 - srcVal * 32 + (r >> 2)] << 2;
+		g = _map[0x3e0 - srcVal * 32 + (g >> 2)] << 2;
+		b = _map[0x3e0 - srcVal * 32 + (b >> 2)] << 2;
+	}
+
+	byte r2, g2, b2;
+	format.colorToRGB(*pixelP, r2, g2, b2);
+	r2 = _map[srcVal * 32 + (r2 >> 2)] << 2;
+	g2 = _map[srcVal * 32 + (g2 >> 2)] << 2;
+	b2 = _map[srcVal * 32 + (b2 >> 2)] << 2;
+
+	*pixelP = format.RGBToColor(r + r2, g + g2, b + b2);
 }
 
 void OSVideoSurface::shiftColors() {
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index d706189..60315a6 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -147,7 +147,7 @@ public:
 	/**
 	 * Change a pixel
 	 */
-	virtual void changePixel(uint16 *pixelP, uint16 color, int val3, int val5) = 0;
+	virtual void changePixel(uint16 *pixelP, uint16 *color, byte srcVal, bool remapFlag = true) = 0;
 
 	/**
 	 * Shifts the colors of the surface.. maybe greys it out?
@@ -306,7 +306,7 @@ public:
 	/**
 	 * Change a pixel
 	 */
-	virtual void changePixel(uint16 *pixelP, uint16 color, int val3, int val5);
+	virtual void changePixel(uint16 *pixelP, uint16 *color, byte srcVal, bool remapFlag = true);
 
 	/**
 	 * Shifts the colors of the surface.. maybe greys it out?


Commit: 75fdd1504de98c7c6937344877685bfef6514344
    https://github.com/scummvm/scummvm/commit/75fdd1504de98c7c6937344877685bfef6514344
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:12:14-04:00

Commit Message:
TITANIC: Call method to initialize OSVideoSurface _map array

Changed paths:
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 3660ce1..9321890 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -88,6 +88,7 @@ void TitanicEngine::initialize() {
 	CExitPellerator::init();
 	CEnterExitSecClassMiniLift::init();
 	CTelevision::init();
+	OSVideoSurface::setup();
 
 	_debugger = new Debugger(this);
 	_events = new Events(this);


Commit: 6f001d831623a46f643379554d20e94463d8c2f1
    https://github.com/scummvm/scummvm/commit/6f001d831623a46f643379554d20e94463d8c2f1
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2016-07-21T13:30:47+02:00

Commit Message:
Merge branch 'master' into titanic

Changed paths:
  A backends/audiocd/audiocd-stream.cpp
  A backends/audiocd/audiocd-stream.h
  A backends/audiocd/linux/linux-audiocd.cpp
  A backends/audiocd/linux/linux-audiocd.h
  A backends/audiocd/macosx/macosx-audiocd.cpp
  A backends/audiocd/macosx/macosx-audiocd.h
  A backends/audiocd/win32/msvc/ntddcdrm.h
  A backends/audiocd/win32/win32-audiocd.cpp
  A backends/audiocd/win32/win32-audiocd.h
  A backends/graphics/opengl/context.cpp
  A backends/graphics/opengl/framebuffer.cpp
  A backends/graphics/opengl/framebuffer.h
  A backends/graphics/opengl/opengl-defs.h
  A backends/graphics/opengl/opengl-func.h
  A backends/graphics/opengl/pipelines/clut8.cpp
  A backends/graphics/opengl/pipelines/clut8.h
  A backends/graphics/opengl/pipelines/fixed.cpp
  A backends/graphics/opengl/pipelines/fixed.h
  A backends/graphics/opengl/pipelines/pipeline.cpp
  A backends/graphics/opengl/pipelines/pipeline.h
  A backends/graphics/opengl/pipelines/shader.cpp
  A backends/graphics/opengl/pipelines/shader.h
  A backends/graphics/opengl/shader.cpp
  A backends/graphics/opengl/shader.h
  A backends/taskbar/macosx/dockplugin/dockplugin.m
  A common/updates.cpp
  A devtools/create_classicmacfonts.sh
  A devtools/encode-macbinary.sh
  A dists/macosx/dockplugin/Info.plist
  A dists/macosx/dockplugin/Info.plist.in
  A dists/macosx/dsa_pub.pem
  A dists/macosx/scummvm_appcast.xml
  A engines/adl/adl.cpp
  A engines/adl/adl.h
  A engines/adl/configure.engine
  A engines/adl/detection.cpp
  A engines/adl/detection.h
  A engines/adl/display.cpp
  A engines/adl/display.h
  A engines/adl/hires1.cpp
  A engines/adl/hires1.h
  A engines/adl/module.mk
  A engines/wage/macmenu.cpp
  A engines/wage/macmenu.h
  A engines/wage/macwindow.cpp
  A engines/wage/macwindow.h
  A engines/wage/macwindowmanager.cpp
  A engines/wage/macwindowmanager.h
  A gui/updates-dialog.cpp
  A gui/updates-dialog.h
  R backends/graphics/opengl/extensions.cpp
  R backends/graphics/opengl/extensions.h
  R devtools/create_wage/create_wage.sh
  R dists/macosx/scummvm_osx_appcast.xml
  R engines/wage/menu.cpp
  R engines/wage/menu.h
    .gitignore
    AUTHORS
    NEWS
    README
    audio/adlib.cpp
    audio/decoders/3do.cpp
    audio/decoders/3do.h
    audio/decoders/vorbis.h
    audio/miles_adlib.cpp
    audio/mods/protracker.cpp
    audio/softsynth/fmtowns_pc98/towns_audio.h
    backends/audiocd/audiocd.h
    backends/audiocd/default/default-audiocd.cpp
    backends/audiocd/default/default-audiocd.h
    backends/audiocd/sdl/sdl-audiocd.cpp
    backends/audiocd/sdl/sdl-audiocd.h
    backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
    backends/graphics/opengl/debug.cpp
    backends/graphics/opengl/debug.h
    backends/graphics/opengl/opengl-graphics.cpp
    backends/graphics/opengl/opengl-graphics.h
    backends/graphics/opengl/opengl-sys.h
    backends/graphics/opengl/texture.cpp
    backends/graphics/opengl/texture.h
    backends/graphics/openglsdl/openglsdl-graphics.cpp
    backends/graphics/openglsdl/openglsdl-graphics.h
    backends/module.mk
    backends/platform/dc/dc.h
    backends/platform/dc/dcmain.cpp
    backends/platform/dingux/README.GCW0
    backends/platform/dingux/build.gcw0.sh
    backends/platform/dingux/dingux.mk
    backends/platform/ds/arm9/source/osystem_ds.cpp
    backends/platform/ds/arm9/source/osystem_ds.h
    backends/platform/sdl/macosx/macosx.cpp
    backends/platform/sdl/macosx/macosx.h
    backends/platform/sdl/posix/posix.cpp
    backends/platform/sdl/posix/posix.h
    backends/platform/sdl/sdl.cpp
    backends/platform/sdl/sdl.h
    backends/platform/sdl/win32/win32.cpp
    backends/platform/sdl/win32/win32.h
    backends/platform/symbian/src/portdefs.h
    backends/platform/tizen/graphics.cpp
    backends/platform/tizen/graphics.h
    backends/platform/wince/portdefs.h
    backends/taskbar/macosx/macosx-taskbar.h
    backends/taskbar/macosx/macosx-taskbar.mm
    backends/updates/macosx/macosx-updates.h
    backends/updates/macosx/macosx-updates.mm
    base/commandLine.cpp
    base/main.cpp
    common/memstream.h
    common/module.mk
    common/platform.cpp
    common/platform.h
    common/updates.h
    config.guess
    config.sub
    configure
    devtools/create_project/create_project.cpp
    devtools/create_project/create_project.h
    devtools/create_project/msbuild.cpp
    devtools/create_project/xcode.cpp
    devtools/credits.pl
    devtools/scumm-md5.txt
    devtools/update-version.pl
    dists/gcw0/scummvm.sh
    dists/macosx/Info.plist
    dists/macosx/Info.plist.in
    doc/de/Neues
    engines/access/sound.cpp
    engines/access/sound.h
    engines/access/video/movie_decoder.h
    engines/agi/agi.cpp
    engines/agi/agi.h
    engines/agi/keyboard.cpp
    engines/agi/preagi.cpp
    engines/agi/preagi.h
    engines/agi/sound_midi.cpp
    engines/agi/sound_sarien.cpp
    engines/agi/text.cpp
    engines/agos/agos.cpp
    engines/agos/agos.h
    engines/agos/cursor.cpp
    engines/agos/debugger.cpp
    engines/agos/detection_tables.h
    engines/agos/drivers/accolade/adlib.cpp
    engines/agos/drivers/accolade/driverfile.cpp
    engines/agos/drivers/accolade/mt32.cpp
    engines/agos/event.cpp
    engines/agos/icons.cpp
    engines/agos/input.cpp
    engines/agos/res.cpp
    engines/agos/res_snd.cpp
    engines/agos/saveload.cpp
    engines/agos/script.cpp
    engines/agos/script_e1.cpp
    engines/agos/script_e2.cpp
    engines/agos/script_ff.cpp
    engines/agos/script_pn.cpp
    engines/agos/script_s1.cpp
    engines/agos/script_s2.cpp
    engines/agos/script_ww.cpp
    engines/agos/string.cpp
    engines/agos/subroutine.cpp
    engines/agos/vga.cpp
    engines/agos/vga_e2.cpp
    engines/agos/vga_ff.cpp
    engines/agos/vga_s1.cpp
    engines/agos/vga_s2.cpp
    engines/avalanche/animation.cpp
    engines/avalanche/avalanche.cpp
    engines/avalanche/clock.cpp
    engines/avalanche/dialogs.cpp
    engines/avalanche/ghostroom.cpp
    engines/avalanche/graphics.cpp
    engines/avalanche/highscore.cpp
    engines/avalanche/mainmenu.cpp
    engines/avalanche/nim.cpp
    engines/avalanche/parser.cpp
    engines/avalanche/shootemup.cpp
    engines/avalanche/sound.cpp
    engines/avalanche/sound.h
    engines/bbvs/bbvs.cpp
    engines/bbvs/bbvs.h
    engines/bbvs/dialogs.cpp
    engines/bbvs/dialogs.h
    engines/bbvs/minigames/bbairguitar.cpp
    engines/bbvs/sound.cpp
    engines/bbvs/sound.h
    engines/cge/events.cpp
    engines/cge/sound.cpp
    engines/cge/sound.h
    engines/cge2/events.cpp
    engines/cge2/saveload.cpp
    engines/cge2/sound.cpp
    engines/cge2/sound.h
    engines/cine/main_loop.cpp
    engines/cine/sound.cpp
    engines/composer/composer.cpp
    engines/composer/composer.h
    engines/composer/detection.cpp
    engines/cruise/sound.cpp
    engines/dialogs.cpp
    engines/draci/music.cpp
    engines/drascula/actors.cpp
    engines/drascula/animation.cpp
    engines/drascula/drascula.cpp
    engines/drascula/drascula.h
    engines/drascula/graphics.cpp
    engines/drascula/objects.cpp
    engines/drascula/rooms.cpp
    engines/drascula/saveload.cpp
    engines/drascula/sound.cpp
    engines/drascula/talk.cpp
    engines/dreamweb/detection.cpp
    engines/dreamweb/detection_tables.h
    engines/dreamweb/dreamweb.h
    engines/dreamweb/saveload.cpp
    engines/dreamweb/sound.cpp
    engines/dreamweb/stubs.cpp
    engines/dreamweb/vgagrafx.cpp
    engines/fullpipe/fullpipe.cpp
    engines/fullpipe/fullpipe.h
    engines/fullpipe/sound.cpp
    engines/fullpipe/sound.h
    engines/gob/detection/tables_fascin.h
    engines/gob/detection/tables_playtoons.h
    engines/gob/gob.cpp
    engines/gob/inter_v2.cpp
    engines/gob/sound/adlib.h
    engines/gob/sound/bgatmosphere.h
    engines/gob/sound/pcspeaker.cpp
    engines/gob/sound/pcspeaker.h
    engines/gob/sound/protracker.cpp
    engines/gob/sound/protracker.h
    engines/gob/sound/soundblaster.h
    engines/gob/sound/sounddesc.cpp
    engines/groovie/groovie.cpp
    engines/groovie/music.h
    engines/groovie/player.cpp
    engines/groovie/player.h
    engines/groovie/roq.cpp
    engines/groovie/script.cpp
    engines/groovie/vdx.cpp
    engines/hopkins/hopkins.h
    engines/hopkins/sound.cpp
    engines/hopkins/sound.h
    engines/hugo/dialogs.cpp
    engines/hugo/dialogs.h
    engines/hugo/display.cpp
    engines/hugo/display.h
    engines/hugo/file.h
    engines/hugo/hugo.cpp
    engines/hugo/hugo.h
    engines/hugo/intro.cpp
    engines/hugo/intro.h
    engines/hugo/mouse.cpp
    engines/hugo/mouse.h
    engines/hugo/parser.cpp
    engines/hugo/parser.h
    engines/hugo/sound.cpp
    engines/hugo/sound.h
    engines/hugo/text.cpp
    engines/hugo/util.cpp
    engines/kyra/debugger.cpp
    engines/kyra/eobcommon.cpp
    engines/kyra/kyra_lok.cpp
    engines/kyra/kyra_v2.cpp
    engines/kyra/lol.h
    engines/kyra/sound_adlib.cpp
    engines/kyra/sound_lol.cpp
    engines/kyra/sound_towns.cpp
    engines/kyra/staticres_lol.cpp
    engines/lab/anim.cpp
    engines/lab/dispman.cpp
    engines/lab/engine.cpp
    engines/lab/intro.cpp
    engines/lab/lab.cpp
    engines/lab/map.cpp
    engines/lab/music.cpp
    engines/lab/music.h
    engines/lab/resource.cpp
    engines/lab/special.cpp
    engines/lure/lure.h
    engines/made/made.cpp
    engines/mads/menu_views.h
    engines/mads/nebular/sound_nebular.cpp
    engines/mads/nebular/sound_nebular.h
    engines/mads/sound.cpp
    engines/mads/sound.h
    engines/mohawk/POTFILES
    engines/mohawk/detection.cpp
    engines/mohawk/detection_tables.h
    engines/mohawk/dialogs.h
    engines/mohawk/myst.cpp
    engines/mohawk/myst_scripts.cpp
    engines/mohawk/myst_stacks/credits.cpp
    engines/mohawk/myst_stacks/intro.cpp
    engines/mohawk/myst_stacks/makingof.cpp
    engines/mohawk/myst_stacks/myst.cpp
    engines/mohawk/myst_stacks/selenitic.cpp
    engines/mohawk/myst_stacks/slides.cpp
    engines/mohawk/myst_state.cpp
    engines/mohawk/myst_state.h
    engines/mohawk/riven.cpp
    engines/mohawk/riven.h
    engines/mohawk/sound.cpp
    engines/mohawk/sound.h
    engines/mortevielle/sound.cpp
    engines/mortevielle/sound.h
    engines/neverhood/menumodule.cpp
    engines/neverhood/neverhood.h
    engines/neverhood/sound.h
    engines/parallaction/saveload.cpp
    engines/prince/prince.cpp
    engines/prince/sound.cpp
    engines/prince/sound.h
    engines/queen/detection.cpp
    engines/queen/sound.cpp
    engines/queen/sound.h
    engines/saga/detection_tables.h
    engines/saga/displayinfo.h
    engines/saga/interface.cpp
    engines/saga/music.cpp
    engines/saga/music.h
    engines/saga/saga.cpp
    engines/saga/saga.h
    engines/saga/shorten.cpp
    engines/saga/shorten.h
    engines/saga/sound.cpp
    engines/sci/console.cpp
    engines/sci/detection_tables.h
    engines/sci/engine/kgraphics32.cpp
    engines/sci/engine/savegame.cpp
    engines/sci/engine/scriptdebug.cpp
    engines/sci/engine/seg_manager.cpp
    engines/sci/engine/segment.cpp
    engines/sci/engine/segment.h
    engines/sci/sound/audio.cpp
    engines/sci/sound/audio.h
    engines/sci/sound/drivers/midi.cpp
    engines/sci/sound/music.h
    engines/sci/sound/soundcmd.cpp
    engines/scumm/POTFILES
    engines/scumm/detection.cpp
    engines/scumm/dialogs.cpp
    engines/scumm/dialogs.h
    engines/scumm/he/animation_he.cpp
    engines/scumm/he/animation_he.h
    engines/scumm/he/logic/moonbase.cpp
    engines/scumm/he/script_v100he.cpp
    engines/scumm/he/script_v90he.cpp
    engines/scumm/he/sound_he.cpp
    engines/scumm/he/wiz_he.h
    engines/scumm/imuse_digi/dimuse.h
    engines/scumm/imuse_digi/dimuse_sndmgr.cpp
    engines/scumm/imuse_digi/dimuse_sndmgr.h
    engines/scumm/imuse_digi/dimuse_track.h
    engines/scumm/input.cpp
    engines/scumm/midiparser_ro.cpp
    engines/scumm/players/player_ad.h
    engines/scumm/players/player_apple2.h
    engines/scumm/players/player_mac.cpp
    engines/scumm/players/player_v2cms.cpp
    engines/scumm/players/player_v3m.h
    engines/scumm/players/player_v5m.h
    engines/scumm/saveload.cpp
    engines/scumm/scumm-md5.h
    engines/scumm/scumm.cpp
    engines/scumm/smush/smush_mixer.cpp
    engines/scumm/smush/smush_mixer.h
    engines/scumm/smush/smush_player.cpp
    engines/scumm/smush/smush_player.h
    engines/scumm/sound.cpp
    engines/scumm/sound.h
    engines/sherlock/debugger.cpp
    engines/sherlock/music.cpp
    engines/sherlock/music.h
    engines/sherlock/scalpel/3do/movie_decoder.cpp
    engines/sherlock/scalpel/3do/scalpel_3do_screen.cpp
    engines/sherlock/scalpel/drivers/adlib.cpp
    engines/sherlock/scalpel/scalpel_debugger.cpp
    engines/sherlock/scalpel/scalpel_inventory.cpp
    engines/sherlock/scalpel/scalpel_journal.cpp
    engines/sherlock/scalpel/scalpel_scene.cpp
    engines/sherlock/scalpel/scalpel_screen.cpp
    engines/sherlock/scalpel/scalpel_talk.cpp
    engines/sherlock/scalpel/scalpel_user_interface.cpp
    engines/sherlock/screen.cpp
    engines/sherlock/screen.h
    engines/sherlock/sound.h
    engines/sherlock/surface.cpp
    engines/sherlock/surface.h
    engines/sherlock/talk.cpp
    engines/sherlock/tattoo/tattoo_journal.cpp
    engines/sherlock/tattoo/tattoo_map.cpp
    engines/sherlock/tattoo/tattoo_screen.cpp
    engines/sherlock/tattoo/widget_inventory.cpp
    engines/sky/control.cpp
    engines/sky/control.h
    engines/sky/music/adlibchannel.cpp
    engines/sky/music/adlibchannel.h
    engines/sky/music/adlibmusic.cpp
    engines/sky/music/adlibmusic.h
    engines/sky/skydefs.h
    engines/sword1/logic.h
    engines/sword1/sound.cpp
    engines/sword1/sword1.cpp
    engines/sword2/music.cpp
    engines/sword25/sfx/soundengine.cpp
    engines/sword25/sfx/soundengine.h
    engines/teenagent/font.cpp
    engines/teenagent/resources.cpp
    engines/teenagent/teenagent.cpp
    engines/teenagent/teenagent.h
    engines/testbed/config.h
    engines/testbed/midi.cpp
    engines/testbed/midi.h
    engines/testbed/sound.h
    engines/tinsel/bmv.cpp
    engines/tinsel/bmv.h
    engines/tinsel/music.cpp
    engines/tinsel/sound.cpp
    engines/tinsel/tinsel.cpp
    engines/toltecs/movie.cpp
    engines/toltecs/movie.h
    engines/toon/toon.cpp
    engines/touche/touche.cpp
    engines/touche/touche.h
    engines/tsage/blue_force/blueforce_dialogs.cpp
    engines/tsage/blue_force/blueforce_dialogs.h
    engines/tsage/blue_force/blueforce_scenes1.cpp
    engines/tsage/blue_force/blueforce_scenes4.cpp
    engines/tsage/blue_force/blueforce_scenes5.cpp
    engines/tsage/blue_force/blueforce_scenes6.cpp
    engines/tsage/blue_force/blueforce_scenes8.cpp
    engines/tsage/dialogs.cpp
    engines/tsage/dialogs.h
    engines/tsage/globals.h
    engines/tsage/ringworld/ringworld_demo.cpp
    engines/tsage/ringworld/ringworld_dialogs.cpp
    engines/tsage/ringworld/ringworld_dialogs.h
    engines/tsage/ringworld/ringworld_scenes2.cpp
    engines/tsage/ringworld2/ringworld2_dialogs.cpp
    engines/tsage/ringworld2/ringworld2_dialogs.h
    engines/tsage/ringworld2/ringworld2_outpost.cpp
    engines/tsage/ringworld2/ringworld2_scenes1.cpp
    engines/tsage/scenes.cpp
    engines/tsage/sound.h
    engines/tsage/tsage.h
    engines/voyeur/animation.h
    engines/voyeur/sound.cpp
    engines/voyeur/sound.h
    engines/wage/debugger.cpp
    engines/wage/design.cpp
    engines/wage/design.h
    engines/wage/detection.cpp
    engines/wage/detection_tables.h
    engines/wage/dialog.cpp
    engines/wage/dialog.h
    engines/wage/entities.cpp
    engines/wage/entities.h
    engines/wage/gui-console.cpp
    engines/wage/gui.cpp
    engines/wage/gui.h
    engines/wage/module.mk
    engines/wage/script.cpp
    engines/wage/util.cpp
    engines/wage/wage.cpp
    engines/wage/wage.h
    engines/wage/world.cpp
    engines/wage/world.h
    engines/wintermute/base/base_persistence_manager.cpp
    engines/wintermute/base/sound/base_sound_manager.cpp
    engines/zvision/core/events.cpp
    engines/zvision/scripting/actions.h
    engines/zvision/sound/midi.cpp
    engines/zvision/sound/midi.h
    engines/zvision/zvision.cpp
    graphics/VectorRendererSpec.cpp
    graphics/font.cpp
    graphics/font.h
    graphics/managed_surface.cpp
    graphics/managed_surface.h
    graphics/scaler/thumbnail_intern.cpp
    gui/EventRecorder.cpp
    gui/ThemeEngine.cpp
    gui/Tooltip.h
    gui/credits.h
    gui/debugger.cpp
    gui/dialog.cpp
    gui/dialog.h
    gui/gui-manager.cpp
    gui/gui-manager.h
    gui/module.mk
    gui/options.cpp
    gui/options.h
    gui/predictivedialog.cpp
    gui/predictivedialog.h
    gui/recorderdialog.cpp
    gui/saveload.cpp
    gui/saveload.h
    gui/themes/default.inc
    gui/themes/scummclassic.zip
    gui/themes/scummclassic/classic_layout.stx
    gui/themes/scummclassic/classic_layout_lowres.stx
    gui/themes/scummmodern.zip
    gui/themes/scummmodern/scummmodern_layout.stx
    gui/themes/scummmodern/scummmodern_layout_lowres.stx
    gui/themes/translations.dat
    gui/widget.cpp
    gui/widget.h
    gui/widgets/popup.cpp
    gui/widgets/popup.h
    po/POTFILES
    po/be_BY.po
    po/ca_ES.po
    po/cs_CZ.po
    po/da_DK.po
    po/de_DE.po
    po/es_ES.po
    po/eu.po
    po/fi_FI.po
    po/fr_FR.po
    po/gl_ES.po
    po/hu_HU.po
    po/it_IT.po
    po/nb_NO.po
    po/nl_NL.po
    po/nn_NO.po
    po/pl_PL.po
    po/pt_BR.po
    po/ru_RU.po
    po/scummvm.pot
    po/sv_SE.po
    po/uk_UA.po
    po/zh-Latn_CN.po
    ports.mk
    video/mpegps_decoder.cpp
    video/psx_decoder.cpp





Commit: e778ac8bcd6c2e0a026c813614c884e5044110c3
    https://github.com/scummvm/scummvm/commit/e778ac8bcd6c2e0a026c813614c884e5044110c3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:22:31-04:00

Commit Message:
TITANIC: FIx confusion between mouse down & up messages in CPETElement hierarchy

Changed paths:
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_frame.cpp
    engines/titanic/pet_control/pet_load_save.cpp
    engines/titanic/pet_control/pet_quit.cpp



diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index 3e9c991..616877e 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -33,14 +33,14 @@ void CPetElement::getBounds(Rect *rect) {
 		*rect = Rect();
 }
 
-bool CPetElement::highlightBounds(const Point &pt) {
+bool CPetElement::MouseButtonDownMsg(const Point &pt) {
 	bool result = _bounds.contains(pt);
 	if (result)
 		setMode(MODE_SELECTED);
 	return result;
 }
 
-bool CPetElement::MouseButtonDownMsg(const Point &pt) {
+bool CPetElement::MouseButtonUpMsg(const Point &pt) {
 	bool result = _bounds.contains(pt);
 	if (result)
 		setMode(MODE_UNSELECTED);
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index effc575..4e35ee9 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -70,14 +70,14 @@ public:
 	virtual void getBounds(Rect *rect);
 
 	/**
-	 * Highlights the element if the cursor is on it
+	 * Handles processing mouse button down messages
 	 */
-	virtual bool highlightBounds(const Point &pt);
+	virtual bool MouseButtonDownMsg(const Point &pt);
 
 	/**
-	 * Handles processing mouse button messages
+	 * Handles processing mouse button up messages
 	 */
-	virtual bool MouseButtonDownMsg(const Point &pt);
+	virtual bool MouseButtonUpMsg(const Point &pt);
 
 	/**
 	 * Returns whether the passed point falls inside the item
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index 827874f..ac4b334 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -65,7 +65,7 @@ bool CPetFrame::reset() {
 
 bool CPetFrame::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	for (int idx = 0; idx < 5; ++idx) {
-		if (_modeButtons[idx].MouseButtonDownMsg(msg->_mousePos)) {
+		if (_modeButtons[idx].MouseButtonUpMsg(msg->_mousePos)) {
 			_petControl->setArea(PET_AREAS[idx]);
 			resetArea();
 			_modeButtons[idx].setMode(MODE_SELECTED);
diff --git a/engines/titanic/pet_control/pet_load_save.cpp b/engines/titanic/pet_control/pet_load_save.cpp
index 811fd12..b8cb3da 100644
--- a/engines/titanic/pet_control/pet_load_save.cpp
+++ b/engines/titanic/pet_control/pet_load_save.cpp
@@ -72,7 +72,7 @@ void CPetLoadSave::draw2(CScreenManager *screenManager) {
 }
 
 bool CPetLoadSave::checkHighlight(const Point &pt) {
-	if (_btnLoadSave.highlightBounds(pt))
+	if (_btnLoadSave.MouseButtonDownMsg(pt))
 		return true;
 	
 	checkSlotsHighlight(pt);
@@ -80,7 +80,7 @@ bool CPetLoadSave::checkHighlight(const Point &pt) {
 }
 
 bool CPetLoadSave::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
-	if (_btnLoadSave.MouseButtonDownMsg(msg->_mousePos)) {
+	if (_btnLoadSave.MouseButtonUpMsg(msg->_mousePos)) {
 		execute();
 		resetSlots();
 		return true;
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index b92a362..dff3ea3 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -68,12 +68,12 @@ void CPetQuit::draw2(CScreenManager *screenManager) {
 }
 
 bool CPetQuit::checkHighlight(const Point &pt) {
-	return !_btnYes.highlightBounds(pt);
+	return !_btnYes.MouseButtonDownMsg(pt);
 }
 
 bool CPetQuit::MouseButtonUpMsg(const Point &pt) {
 	CPetControl *pet = getPetControl();
-	if (_btnYes.MouseButtonDownMsg(pt) && pet) {
+	if (_btnYes.MouseButtonUpMsg(pt) && pet) {
 		CGameManager *gameManager = pet->getGameManager();
 		if (gameManager)
 			gameManager->_gameState._quitGame = true;


Commit: b324d2ea6cd422bafd846642ed54620abe7e32ea
    https://github.com/scummvm/scummvm/commit/b324d2ea6cd422bafd846642ed54620abe7e32ea
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:22:32-04:00

Commit Message:
TITANIC: FIx confusion between mouse down & up messages in CPetGlyph hierarchy

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_load_save.cpp
    engines/titanic/pet_control/pet_load_save.h
    engines/titanic/pet_control/pet_quit.cpp
    engines/titanic/pet_control/pet_quit.h
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h
    engines/titanic/pet_control/pet_sound.cpp
    engines/titanic/pet_control/pet_sound.h



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 8f8d8ba..ed879f2 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -323,7 +323,7 @@ bool CPetGlyphs::MouseButtonDownMsg(const Point &pt) {
 		CPetGlyph *glyph = getGlyph(_highlightIndex);
 
 		if (glyph) {
-			if (glyph->checkHighlight(pt))
+			if (glyph->MouseButtonDownMsg(pt))
 				return true;
 
 			if (!(_flags & GFLAG_2)) {
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index cefcd5c..7920501 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -126,10 +126,9 @@ public:
 	virtual Rect getBounds() { return Rect(); }
 
 	/**
-	 * Checks and updates any highlight of the glyph or any contextual
-	 * information it displays
+	 * Called for mouse button down messages
 	 */
-	virtual bool checkHighlight(const Point &pt) { return false; }
+	virtual bool MouseButtonDownMsg(const Point &pt) { return false; }
 
 	/**
 	 * Called when mouse drag starts
@@ -174,9 +173,9 @@ public:
 	virtual void proc27(const Point &pt, bool flag) {}
 
 	/**
-	 * Handles mouse button down messages
+	 *
 	 */
-	virtual void MouseButtonDownMsg(const Point &pt) {}
+	virtual void proc28(const Point &pt) {}
 	
 	virtual int proc29(const Point &pt) { return 0; }
 
diff --git a/engines/titanic/pet_control/pet_load_save.cpp b/engines/titanic/pet_control/pet_load_save.cpp
index b8cb3da..0ae9f3f 100644
--- a/engines/titanic/pet_control/pet_load_save.cpp
+++ b/engines/titanic/pet_control/pet_load_save.cpp
@@ -71,7 +71,7 @@ void CPetLoadSave::draw2(CScreenManager *screenManager) {
 	_btnLoadSave.draw(screenManager);
 }
 
-bool CPetLoadSave::checkHighlight(const Point &pt) {
+bool CPetLoadSave::MouseButtonDownMsg(const Point &pt) {
 	if (_btnLoadSave.MouseButtonDownMsg(pt))
 		return true;
 	
diff --git a/engines/titanic/pet_control/pet_load_save.h b/engines/titanic/pet_control/pet_load_save.h
index ef7e54a..8f8634d 100644
--- a/engines/titanic/pet_control/pet_load_save.h
+++ b/engines/titanic/pet_control/pet_load_save.h
@@ -83,10 +83,9 @@ public:
 	virtual void draw2(CScreenManager *screenManager);
 
 	/**
-	 * Checks and updates any highlight of the glyph or any contextual
-	 * information it displays
+	 * Called for mouse button down messages
 	 */
-	virtual bool checkHighlight(const Point &pt);
+	virtual bool MouseButtonDownMsg(const Point &pt);
 
 	/**
 	 * Handles mouse button messages
diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index dff3ea3..6959160 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -67,7 +67,7 @@ void CPetQuit::draw2(CScreenManager *screenManager) {
 	_btnYes.draw(screenManager);
 }
 
-bool CPetQuit::checkHighlight(const Point &pt) {
+bool CPetQuit::MouseButtonDownMsg(const Point &pt) {
 	return !_btnYes.MouseButtonDownMsg(pt);
 }
 
diff --git a/engines/titanic/pet_control/pet_quit.h b/engines/titanic/pet_control/pet_quit.h
index 72b93c1..7d22690 100644
--- a/engines/titanic/pet_control/pet_quit.h
+++ b/engines/titanic/pet_control/pet_quit.h
@@ -50,10 +50,9 @@ public:
 	virtual void draw2(CScreenManager *screenManager);
 
 	/**
-	 * Checks and updates any highlight of the glyph or any contextual
-	 * information it displays
+	 * Called for mouse button down messages
 	 */
-	virtual bool checkHighlight(const Point &pt);
+	virtual bool MouseButtonDownMsg(const Point &pt);
 
 	/**
 	 * Handles mouse button up messages
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index d127c41..c45e038 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -64,7 +64,7 @@ void CPetRoomsGlyph::drawAt(CScreenManager *screenManager, const Point &pt) {
 	warning("TODO: CPetRoomsGlyph::drawAt");
 }
 
-void CPetRoomsGlyph::MouseButtonDownMsg(const Point &pt) {
+void CPetRoomsGlyph::proc28(const Point &pt) {
 
 }
 
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index 2832438..d08be13 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -63,9 +63,9 @@ public:
 	virtual void draw2(CScreenManager *screenManager) {}
 
 	/**
-	 * Handles mouse button down messages
+	 * 
 	 */
-	virtual void MouseButtonDownMsg(const Point &pt);
+	virtual void proc28(const Point &pt);
 
 	virtual int proc29(const Point &pt);
 	virtual void proc32();
diff --git a/engines/titanic/pet_control/pet_sound.cpp b/engines/titanic/pet_control/pet_sound.cpp
index 9fb3a07..4d2bf37 100644
--- a/engines/titanic/pet_control/pet_sound.cpp
+++ b/engines/titanic/pet_control/pet_sound.cpp
@@ -123,7 +123,7 @@ void CPetSound::draw2(CScreenManager *screenManager) {
 	_textSpeechVolume.draw(screenManager);
 }
 
-bool CPetSound::checkHighlight(const Point &pt) {
+bool CPetSound::MouseButtonDownMsg(const Point &pt) {
 	if (_musicVolume.checkThumb(pt) || _masterVolume.checkThumb(pt) ||
 		_speechVolume.checkThumb(pt))
 		return true;
diff --git a/engines/titanic/pet_control/pet_sound.h b/engines/titanic/pet_control/pet_sound.h
index 267bd03..c4b663a 100644
--- a/engines/titanic/pet_control/pet_sound.h
+++ b/engines/titanic/pet_control/pet_sound.h
@@ -69,10 +69,9 @@ public:
 	virtual void draw2(CScreenManager *screenManager);
 
 	/**
-	 * Checks and updates any highlight of the glyph or any contextual
-	 * information it displays
+	 * Called for mouse button down messages
 	 */
-	virtual bool checkHighlight(const Point &pt);
+	virtual bool MouseButtonDownMsg(const Point &pt);
 
 	/**
 	 * Called when mouse drag starts


Commit: b7ad513b0f0c99bc670546dbb3483e93d59652ee
    https://github.com/scummvm/scummvm/commit/b7ad513b0f0c99bc670546dbb3483e93d59652ee
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:22:33-04:00

Commit Message:
TITANIC: Implement PET Text scrolling

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 3afd5ee..d2c891e 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/pet_control/pet_conversations.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -44,6 +45,14 @@ bool CPetConversations::isValid(CPetControl *petControl) {
 	return setupControl(petControl);
 }
 
+bool CPetConversations::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	return
+		_scrollUp.MouseButtonDownMsg(msg->_mousePos) ||
+		_scrollDown.MouseButtonDownMsg(msg->_mousePos) ||
+		_val7.MouseButtonDownMsg(msg->_mousePos) ||
+		_val8.MouseButtonDownMsg(msg->_mousePos);
+}
+
 bool CPetConversations::setupControl(CPetControl *petControl) {
 	if (petControl) {
 		_petControl = petControl;
@@ -60,10 +69,10 @@ bool CPetConversations::setupControl(CPetControl *petControl) {
 		_gfxList[2].translate(20, 434);
 
 		const Rect rect2(0, 0, 11, 24);
-		_val1.setBounds(rect2);
-		_val1.translate(87, 374);
-		_val2.setBounds(rect2);
-		_val2.translate(87, 421);
+		_scrollUp.setBounds(rect2);
+		_scrollUp.translate(87, 374);
+		_scrollDown.setBounds(rect2);
+		_scrollDown.translate(87, 421);
 
 		const Rect rect3(0, 0, 39, 39);
 		_val7.setBounds(rect3);
@@ -86,4 +95,16 @@ bool CPetConversations::setupControl(CPetControl *petControl) {
 	return true;
 }
 
+void CPetConversations::scrollDown() {
+	_log.scrollDown(CScreenManager::_screenManagerPtr);
+	if (_petControl)
+		_petControl->makeDirty();
+}
+
+void CPetConversations::scrollUp() {
+	_log.scrollUp(CScreenManager::_screenManagerPtr);
+	if (_petControl)
+		_petControl->makeDirty();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 89dbc5e..8a3ca88 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -31,8 +31,8 @@ namespace Titanic {
 
 class CPetConversations : public CPetSection {
 private:
-	CPetGfxElement _val1;
-	CPetGfxElement _val2;
+	CPetGfxElement _scrollUp;
+	CPetGfxElement _scrollDown;
 	CPetGfxElement _val3;
 	CPetGfxElement _gfxList[3];
 	CPetGfxElement _val4;
@@ -55,6 +55,16 @@ private:
 	 * Sets up the control
 	 */
 	bool setupControl(CPetControl *petControl);
+
+	/**
+	 * Scroll down the conversation log
+	 */
+	void scrollDown();
+
+	/**
+	 * Scroll up the conversation log
+	 */
+	void scrollUp();
 public:
 	CPetConversations();
 
@@ -72,6 +82,12 @@ public:
 	 * Returns true if the object is in a valid state
 	 */
 	virtual bool isValid(CPetControl *petControl);
+
+	/**
+	 * Following are handlers for the various messages that the PET can
+	 * pass onto the currently active section/area
+	 */
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 3a10ab4..9a895de 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -30,7 +30,7 @@ CPetText::CPetText(uint count) :
 		_backR(0xff), _backG(0xff), _backB(0xff), 
 		_textR(0), _textG(0), _textB(200),
 		_fontNumber2(0), _field64(0), _field68(0), _field6C(0),
-		_hasBorder(true), _field74(0), _textCursor(nullptr), _field7C(0) {
+		_hasBorder(true), _scrollTop(0), _textCursor(nullptr), _field7C(0) {
 	setupArrays(count);
 }
 
@@ -97,7 +97,7 @@ void CPetText::load(SimpleFile *file, int param) {
 		_textG = file->readNumber();
 		_textB = file->readNumber();
 		_hasBorder = file->readNumber() != 0;
-		_field74 = file->readNumber();
+		_scrollTop = file->readNumber();
 
 		warning("TODO: CPetText::load %d,%d", var1, var2);
 		assert(_array.size() >= count);
@@ -140,7 +140,7 @@ void CPetText::draw(CScreenManager *screenManager) {
 	tempRect.grow(-2);
 	screenManager->setFontNumber(_fontNumber2);
 
-	screenManager->writeString(SURFACE_BACKBUFFER, tempRect, _field74, _lines, _textCursor);
+	screenManager->writeString(SURFACE_BACKBUFFER, tempRect, _scrollTop, _lines, _textCursor);
 
 	screenManager->setFontNumber(_fontNumber1);
 }
@@ -250,4 +250,33 @@ void CPetText::setNPC(int val1, int npcId) {
 	_field68 = npcId;
 }
 
+void CPetText::scrollUp(CScreenManager *screenManager) {
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	_scrollTop -= screenManager->getFontHeight();
+	constrainScrollUp(screenManager);
+	screenManager->setFontNumber(oldFontNumber);
+}
+
+void CPetText::scrollDown(CScreenManager *screenManager) {
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	_scrollTop += screenManager->getFontHeight();
+	constrainScrollDown(screenManager);
+	screenManager->setFontNumber(oldFontNumber);
+}
+
+void CPetText::constrainScrollUp(CScreenManager *screenManager) {
+	if (_scrollTop < 0)
+		_scrollTop = 0;
+}
+
+void CPetText::constrainScrollDown(CScreenManager *screenManager) {
+	// Figure out the maximum scroll amount allowed
+	int maxScroll = _bounds.height() - getTextHeight(screenManager) - 4;
+	if (maxScroll < 0)
+		maxScroll = 0;
+
+	if (_scrollTop > maxScroll)
+		_scrollTop = maxScroll;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 6ce1903..36d098f 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -57,7 +57,7 @@ private:
 	int _field68;
 	int _field6C;
 	bool _hasBorder;
-	int _field74;
+	int _scrollTop;
 	CTextCursor *_textCursor;
 	int _field7C;
 private:
@@ -81,6 +81,16 @@ private:
 	 * Get the required height to draw the text
 	 */
 	int getTextHeight(CScreenManager *screenManager);
+
+	/**
+	 * Ensures the Y scrolling for the text is in the valid range
+	 */
+	void constrainScrollUp(CScreenManager *screenManager);
+
+	/**
+	 * Ensures the Y scrolling for the text is in the valid range
+	 */
+	void constrainScrollDown(CScreenManager *screenManager);
 public:
 	CPetText(uint count = 10);
 
@@ -157,6 +167,16 @@ public:
 	 * Get the font
 	 */
 	int getFontNumber() const { return _fontNumber1; }
+
+	/**
+	 * Scroll the text up
+	 */
+	void scrollUp(CScreenManager *screenManager);
+
+	/**
+	 * Scroll the text down
+	 */
+	void scrollDown(CScreenManager *screenManager);
 };
 
 } // End of namespace Titanic


Commit: de7329619612514e8fd3e9ba1f3e6d7389fd199d
    https://github.com/scummvm/scummvm/commit/de7329619612514e8fd3e9ba1f3e6d7389fd199d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:22:34-04:00

Commit Message:
TITANIC: Implement PET Text scrollToBottom, beginnings of addLine

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index d2c891e..c884d18 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -49,8 +49,35 @@ bool CPetConversations::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	return
 		_scrollUp.MouseButtonDownMsg(msg->_mousePos) ||
 		_scrollDown.MouseButtonDownMsg(msg->_mousePos) ||
-		_val7.MouseButtonDownMsg(msg->_mousePos) ||
-		_val8.MouseButtonDownMsg(msg->_mousePos);
+		_doorBot.MouseButtonDownMsg(msg->_mousePos) ||
+		_bellBot.MouseButtonDownMsg(msg->_mousePos);
+}
+
+bool CPetConversations::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+	if (_scrollUp.MouseButtonUpMsg(msg->_mousePos) ||
+			_scrollDown.MouseButtonUpMsg(msg->_mousePos))
+		return true;
+
+	if (_doorBot.MouseButtonUpMsg(msg->_mousePos)) {
+		switch (canSummonNPC("DoorBot")) {
+		case SUMMON_CANT:
+			break;
+		case SUMMON_CAN:
+			summonNPC("DoorBot");
+			return true;
+		default:
+			break;
+		}
+
+		// Scroll to the bottom of the log
+		scrollToBottom();
+	}
+
+	if (_bellBot.MouseButtonUpMsg(msg->_mousePos)) {
+		// TODO
+	}
+
+	return false;
 }
 
 bool CPetConversations::setupControl(CPetControl *petControl) {
@@ -75,10 +102,10 @@ bool CPetConversations::setupControl(CPetControl *petControl) {
 		_scrollDown.translate(87, 421);
 
 		const Rect rect3(0, 0, 39, 39);
-		_val7.setBounds(rect3);
-		_val7.translate(546, 372);
-		_val8.setBounds(rect3);
-		_val8.translate(546, 418);
+		_doorBot.setBounds(rect3);
+		_doorBot.translate(546, 372);
+		_bellBot.setBounds(rect3);
+		_bellBot.translate(546, 418);
 
 		_val6.setBounds(Rect(0, 0, 37, 70));
 		_val6.translate(46, 374);
@@ -95,16 +122,34 @@ bool CPetConversations::setupControl(CPetControl *petControl) {
 	return true;
 }
 
+void CPetConversations::scrollUp() {
+	_log.scrollUp(CScreenManager::_screenManagerPtr);
+	if (_petControl)
+		_petControl->makeDirty();
+	_field414 = true;
+}
+
 void CPetConversations::scrollDown() {
 	_log.scrollDown(CScreenManager::_screenManagerPtr);
 	if (_petControl)
 		_petControl->makeDirty();
+	_field414 = true;
 }
 
-void CPetConversations::scrollUp() {
-	_log.scrollUp(CScreenManager::_screenManagerPtr);
+void CPetConversations::scrollToBottom() {
+	_log.scrollToBottom(CScreenManager::_screenManagerPtr);
 	if (_petControl)
 		_petControl->makeDirty();
+	_field414 = true;
+}
+
+SummonResult CPetConversations::canSummonNPC(const CString &name) {
+	warning("TODO: canSummonNPC");
+	return SUMMON_ABORT;
+}
+
+void CPetConversations::summonNPC(const CString &name) {
+	warning("TODO: summonNPC");
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 8a3ca88..d04e983 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -29,6 +29,8 @@
 
 namespace Titanic {
 
+enum SummonResult { SUMMON_CANT = 0, SUMMON_CAN = 1, SUMMON_ABORT = 2 };
+
 class CPetConversations : public CPetSection {
 private:
 	CPetGfxElement _scrollUp;
@@ -39,8 +41,8 @@ private:
 	CPetGfxElement _val5;
 	CPetGfxElement _val6;
 	int  _field14C;
-	CPetGfxElement _val7;
-	CPetGfxElement _val8;
+	CPetGfxElement _doorBot;
+	CPetGfxElement _bellBot;
 	CPetGfxElement _val9;
 	CPetGfxElement _valArray2[9];
 	int _field30C;
@@ -57,14 +59,29 @@ private:
 	bool setupControl(CPetControl *petControl);
 
 	/**
+	 * Scroll up the conversation log
+	 */
+	void scrollUp();
+
+	/**
 	 * Scroll down the conversation log
 	 */
 	void scrollDown();
 
 	/**
-	 * Scroll up the conversation log
+	 * Scroll to the bottom of the conversation log
 	 */
-	void scrollUp();
+	void scrollToBottom();
+
+	/**
+	 * Check whether an NPC can be summoned
+	 */
+	SummonResult canSummonNPC(const CString &name);
+
+	/**
+	 * Summon an NPC
+	 */
+	void summonNPC(const CString &name);
 public:
 	CPetConversations();
 
@@ -88,6 +105,7 @@ public:
 	 * pass onto the currently active section/area
 	 */
 	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 9a895de..67910dc 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -264,6 +264,13 @@ void CPetText::scrollDown(CScreenManager *screenManager) {
 	screenManager->setFontNumber(oldFontNumber);
 }
 
+void CPetText::scrollToBottom(CScreenManager *screenManager) {
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	_scrollTop = _bounds.height();
+	constrainScrollDown(screenManager);
+	screenManager->setFontNumber(oldFontNumber);
+}
+
 void CPetText::constrainScrollUp(CScreenManager *screenManager) {
 	if (_scrollTop < 0)
 		_scrollTop = 0;
@@ -279,4 +286,14 @@ void CPetText::constrainScrollDown(CScreenManager *screenManager) {
 		_scrollTop = maxScroll;
 }
 
+void CPetText::addLine(const CString &str, uint color) {
+	addLine(str, color & 0xff, (color >> 8) & 0xff,
+		(color >> 16) & 0xff);
+}
+
+void CPetText::addLine(const CString &str, byte r, byte g, byte b) {
+	warning("TODO: CPetText::addLine");
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 36d098f..6000dd6 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -177,6 +177,21 @@ public:
 	 * Scroll the text down
 	 */
 	void scrollDown(CScreenManager *screenManager);
+
+	/**
+	 * Scroll to the bottom of the text
+	 */
+	void scrollToBottom(CScreenManager *screenManager);
+
+	/**
+	 * Add a line to the text
+	 */
+	void addLine(const CString &str, uint color);
+
+	/**
+	 * Add a line to the text
+	 */
+	void addLine(const CString &str, byte r, byte g, byte b);
 };
 
 } // End of namespace Titanic


Commit: ff72fc594bae10cd4ac5083d0cf2ca6c412d0f9f
    https://github.com/scummvm/scummvm/commit/ff72fc594bae10cd4ac5083d0cf2ca6c412d0f9f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:22:36-04:00

Commit Message:
TITANIC: Implement PET Conversations mouse up, and text addLine

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_text.cpp



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index c884d18..d5f4da4 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -61,6 +61,7 @@ bool CPetConversations::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
 	if (_doorBot.MouseButtonUpMsg(msg->_mousePos)) {
 		switch (canSummonNPC("DoorBot")) {
 		case SUMMON_CANT:
+			_log.addLine("Sadly, it is not possible to summon the DoorBot from this location.", getColor(1));
 			break;
 		case SUMMON_CAN:
 			summonNPC("DoorBot");
@@ -71,10 +72,24 @@ bool CPetConversations::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
 
 		// Scroll to the bottom of the log
 		scrollToBottom();
+		return true;
 	}
 
 	if (_bellBot.MouseButtonUpMsg(msg->_mousePos)) {
-		// TODO
+		switch (canSummonNPC("BellBot")) {
+		case SUMMON_CANT:
+			_log.addLine("Sadly, it is not possible to summon the BellBot from this location.", getColor(1));
+			break;
+		case SUMMON_CAN:
+			summonNPC("BellBot");
+			return true;
+		default:
+			break;
+		}
+
+		// Scroll to the bottom of the log
+		scrollToBottom();
+		return true;
 	}
 
 	return false;
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 67910dc..c31d4fd 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -292,8 +292,20 @@ void CPetText::addLine(const CString &str, uint color) {
 }
 
 void CPetText::addLine(const CString &str, byte r, byte g, byte b) {
-	warning("TODO: CPetText::addLine");
-}
+	if (_lineCount == ((int)_array.size() - 1)) {
+		// Lines array is full
+		if (_array.size() > 1) {
+			// Delete the oldest line, and add a new entry at the end
+			_array.remove_at(0);
+			_array.resize(_array.size() + 1);
+		}
+
+		--_lineCount;
+	}
 
+	setLineColor(_lineCount, r, g, b);
+	changeText(str);
+	++_lineCount;
+}
 
 } // End of namespace Titanic


Commit: 4fd482e41813f32359eb91a2b62867605af0382c
    https://github.com/scummvm/scummvm/commit/4fd482e41813f32359eb91a2b62867605af0382c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:22:37-04:00

Commit Message:
TITANIC: Implement checks for whether NPCs can be summoned

Changed paths:
    engines/titanic/core/saveable_object.cpp
    engines/titanic/messages/messages.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 4a57959..00a48ea 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -917,7 +917,7 @@ DEFFN(CSUBTransition)
 DEFFN(CSubTurnOffMsg)
 DEFFN(CSubTurnOnMsg)
 DEFFN(CSummonBotMsg)
-DEFFN(CSummonBotQuerryMsg)
+DEFFN(CSummonBotQueryMsg)
 DEFFN(CTakeHeadPieceMsg)
 DEFFN(CTextInputMsg)
 DEFFN(CTimeDilationMsg)
@@ -1503,7 +1503,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CSubTurnOffMsg, CMessage);
 	ADDFN(CSubTurnOnMsg, CMessage);
 	ADDFN(CSummonBotMsg, CMessage);
-	ADDFN(CSummonBotQuerryMsg, CMessage);
+	ADDFN(CSummonBotQueryMsg, CMessage);
 	ADDFN(CTakeHeadPieceMsg, CMessage);
 	ADDFN(CTextInputMsg, CMessage);
 	ADDFN(CTimeDilationMsg, CMessage);
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index ae66af1..3af65c2 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -343,7 +343,7 @@ MESSAGE0(CSUBTransition);
 MESSAGE0(CSubTurnOffMsg);
 MESSAGE0(CSubTurnOnMsg);
 MESSAGE2(CSummonBotMsg, CString, strValue, "", int, numValue, 0);
-MESSAGE1(CSummonBotQuerryMsg, CString, value, "");
+MESSAGE1(CSummonBotQueryMsg, CString, npcName, "");
 MESSAGE1(CTakeHeadPieceMsg, CString, value, "NULL");
 MESSAGE2(CTextInputMsg, CString, value1, "", CString, value2, "");
 MESSAGE1(CTimeDilationMsg, int, value, 0);
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 98887f6..e9a8e79 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -23,6 +23,7 @@
 #include "titanic/pet_control/pet_control.h"
 #include "titanic/carry/carry.h"
 #include "titanic/core/project_item.h"
+#include "titanic/messages/messages.h"
 #include "titanic/messages/pet_messages.h"
 #include "titanic/game_manager.h"
 #include "titanic/game_state.h"
@@ -436,4 +437,43 @@ CString CPetControl::getRoomName() const {
 	return room ? room->getName() : CString();
 }
 
+int CPetControl::canSummonNPC(const CString &name) {
+	// If player is the very same view as the NPC, then it's already present
+	if (isNPCInView(name))
+		return SUMMON_CAN;
+
+	// Get the room
+	CGameManager *gameManager = getGameManager();
+	if (!gameManager)
+		return SUMMON_CANT;
+	CRoomItem *room = gameManager->getRoom();
+	if (!room)
+		return SUMMON_CANT;
+
+	// Query current room to see whether the bot can be summoned to it
+	CSummonBotQueryMsg queryMsg(name);
+	return queryMsg.execute(room) ? SUMMON_CAN : SUMMON_CANT;
+}
+
+bool CPetControl::isNPCInView(const CString &name) const {
+	CGameManager *gameManager = getGameManager();
+	if (!gameManager)
+		return false;
+	CViewItem *view = gameManager->getView();
+	if (!view)
+		return false;
+	
+	// Iterate to find NPC
+	for (CTreeItem *child = view->getFirstChild(); child; child = child->scan(view)) {
+		CGameObject *gameObject = static_cast<CGameObject *>(child);
+		if (gameObject) {
+			if (!gameObject->getName().compareToIgnoreCase(name))
+				return true;
+		}
+	}
+
+	return false;
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 78cfb61..4cde477 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -39,6 +39,8 @@
 
 namespace Titanic {
 
+enum SummonResult { SUMMON_CANT = 0, SUMMON_PRESENT = 1, SUMMON_CAN = 2 };
+
 class CPetControl : public CGameObject {
 	DECLARE_MESSAGE_MAP
 private:
@@ -88,6 +90,11 @@ private:
 	bool containsPt(const Common::Point &pt) const;
 
 	bool getC0() const;
+
+	/**
+	 * Checks whether a designated NPC in present in the current view
+	 */
+	bool isNPCInView(const CString &name) const;
 protected:
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
@@ -250,6 +257,11 @@ public:
 	 * Get the room name
 	 */
 	CString getRoomName() const;
+
+	/**
+	 * Check whether an NPC can be summoned
+	 */
+	int canSummonNPC(const CString &name);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index d5f4da4..1012403 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -158,9 +158,8 @@ void CPetConversations::scrollToBottom() {
 	_field414 = true;
 }
 
-SummonResult CPetConversations::canSummonNPC(const CString &name) {
-	warning("TODO: canSummonNPC");
-	return SUMMON_ABORT;
+int CPetConversations::canSummonNPC(const CString &name) {
+	return _petControl ? _petControl->canSummonNPC(name) : SUMMON_CANT;
 }
 
 void CPetConversations::summonNPC(const CString &name) {
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index d04e983..3f396c8 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -29,8 +29,6 @@
 
 namespace Titanic {
 
-enum SummonResult { SUMMON_CANT = 0, SUMMON_CAN = 1, SUMMON_ABORT = 2 };
-
 class CPetConversations : public CPetSection {
 private:
 	CPetGfxElement _scrollUp;
@@ -76,7 +74,7 @@ private:
 	/**
 	 * Check whether an NPC can be summoned
 	 */
-	SummonResult canSummonNPC(const CString &name);
+	int canSummonNPC(const CString &name);
 
 	/**
 	 * Summon an NPC


Commit: 23f5691b97cb53fd45ef411f051b7f10f0523a24
    https://github.com/scummvm/scummvm/commit/23f5691b97cb53fd45ef411f051b7f10f0523a24
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:22:38-04:00

Commit Message:
TITANIC: Implement summoning NPCs

Changed paths:
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/game/television.cpp
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_gfx_element.cpp
    engines/titanic/pet_control/pet_section.cpp
    engines/titanic/pet_control/pet_slider.cpp



diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 039d597..8dd3da0 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -314,9 +314,9 @@ CMusicRoom *CTreeItem::getMusicRoom() const {
 	return gameManager ? &gameManager->_musicRoom : nullptr;
 }
 
-int CTreeItem::getState8() const {
+int CTreeItem::getPassengerClass() const {
 	CGameManager *gameManager = getGameManager();
-	return gameManager ? gameManager->_gameState._field8 : 3;
+	return gameManager ? gameManager->_gameState._passengerClass : 3;
 }
 
 int CTreeItem::getStateC() const {
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 151adde..1dcaee5 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -279,7 +279,11 @@ public:
 	 */
 	CMusicRoom *getMusicRoom() const;
 
-	int getState8() const;
+	/**
+	 * Return the player's passenger class
+	 */
+	int getPassengerClass() const;
+	
 	int getStateC() const;
 };
 
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 6e1f5ca..8884009 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -234,7 +234,7 @@ bool CTelevision::MovieEndMsg(CMovieEndMsg *msg) {
 		parrotMsg.execute("PerchedParrot");
 	}
 
-	if (_fieldE0 == 3 && compareRoomNameTo("SGTState") && !getState8()) {
+	if (_fieldE0 == 3 && compareRoomNameTo("SGTState") && !getPassengerClass()) {
 		playSound("z#47.wav", 100, 0, 0);
 		_fieldF0 = playSound("b#20.wav", 100, 0, 0);
 		CTreeItem *magazine = getRoot()->findByName("Magazine");
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 7c59aaf..2c751c0 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -45,14 +45,14 @@ bool CGameStateMovieList::clear() {
 
 CGameState::CGameState(CGameManager *gameManager) :
 		_gameManager(gameManager), _gameLocation(this),
-		_field8(0), _fieldC(0), _mode(GSMODE_UNSELECTED), _field14(0), _petActive(false),
-		_field1C(0), _quitGame(false), _field24(0), _nodeChangeCtr(0),
-		_nodeEnterTicks(0), _field38(0) {
+		_passengerClass(0), _fieldC(0), _mode(GSMODE_UNSELECTED),
+		_field14(0), _petActive(false), _field1C(0), _quitGame(false),
+		_field24(0), _nodeChangeCtr(0), _nodeEnterTicks(0), _field38(0) {
 }
 
 void CGameState::save(SimpleFile *file) const {
 	file->writeNumber(_petActive);
-	file->writeNumber(_field8);
+	file->writeNumber(_passengerClass);
 	file->writeNumber(_fieldC);
 	file->writeNumber(_field14);
 	file->writeNumber(_field24);
@@ -63,7 +63,7 @@ void CGameState::save(SimpleFile *file) const {
 
 void CGameState::load(SimpleFile *file) {
 	_petActive = file->readNumber() != 0;
-	_field8 = file->readNumber();
+	_passengerClass = file->readNumber();
 	_fieldC = file->readNumber();
 	_field14 = file->readNumber();
 	_field24 = file->readNumber();
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 1176b2f..ff39dc6 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -54,7 +54,7 @@ public:
 	CGameManager *_gameManager;
 	CGameLocation _gameLocation;
 	CGameStateMovieList _movieList;
-	int _field8;
+	int _passengerClass;
 	int _fieldC;
 	GameStateMode _mode;
 	int _field14;
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index e9a8e79..89ea9e9 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -475,5 +475,16 @@ bool CPetControl::isNPCInView(const CString &name) const {
 	return false;
 }
 
+void CPetControl::summonNPC(const CString &name, int val) {
+	CGameManager *gameManager = getGameManager();
+	if (gameManager) {
+		CRoomItem *room = gameManager->getRoom();
+
+		if (room) {
+			CSummonBotMsg summonMsg(name, val);
+			summonMsg.execute(room);
+		}
+	}
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 4cde477..bd89657 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -262,6 +262,11 @@ public:
 	 * Check whether an NPC can be summoned
 	 */
 	int canSummonNPC(const CString &name);
+
+	/**
+	 * Summon an NPC to the player
+	 */
+	void summonNPC(const CString &name, int val);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 1012403..3872d84 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -163,7 +163,13 @@ int CPetConversations::canSummonNPC(const CString &name) {
 }
 
 void CPetConversations::summonNPC(const CString &name) {
-	warning("TODO: summonNPC");
+	if (_petControl) {
+		if (_petControl->getPassengerClass() >= 4) {
+			_petControl->displayMessage("Sorry, you must be at least 3rd class before you can summon for help.");
+		} else {
+			_petControl->summonNPC(name, 0);
+		}
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_gfx_element.cpp b/engines/titanic/pet_control/pet_gfx_element.cpp
index fbe9e6d..491930f 100644
--- a/engines/titanic/pet_control/pet_gfx_element.cpp
+++ b/engines/titanic/pet_control/pet_gfx_element.cpp
@@ -49,11 +49,11 @@ void CPetGfxElement::reset(const CString &name, CPetControl *petControl, PetElem
 		return;
 
 	CString numString(3);	
-	int state8 = petControl->getState8();
+	int classNum = petControl->getPassengerClass();
 
-	if (state8 >= 1 && state8 <= 3) {
-		numString = CString(state8);
-	} else if (state8 == 4) {
+	if (classNum >= 1 && classNum <= 3) {
+		numString = CString(classNum);
+	} else if (classNum == 4) {
 		int stateC = petControl->getStateC();
 		if (stateC == 1)
 			numString = CString(stateC);
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp
index a41118b..afdbc9f 100644
--- a/engines/titanic/pet_control/pet_section.cpp
+++ b/engines/titanic/pet_control/pet_section.cpp
@@ -69,7 +69,7 @@ uint CPetSection::getColor(uint index) {
 const uint *CPetSection::getColorTable(int tableNum) {
 	if (tableNum == -1) {
 		CPetControl *pet = getPetControl();
-		tableNum = pet ? pet->getState8() : 3;
+		tableNum = pet ? pet->getPassengerClass() : 3;
 	}
 
 	switch (tableNum) {
diff --git a/engines/titanic/pet_control/pet_slider.cpp b/engines/titanic/pet_control/pet_slider.cpp
index e8f31a7..82b02af 100644
--- a/engines/titanic/pet_control/pet_slider.cpp
+++ b/engines/titanic/pet_control/pet_slider.cpp
@@ -198,7 +198,7 @@ void CPetSoundSlider::setupThumb(const CString &name, CPetControl *petControl) {
 void CPetSoundSlider::setupBackground2(const CString &name, CPetControl *petControl) {
 	if (petControl) {
 		CString numStr = "3";
-		int mode = petControl->getState8();
+		int mode = petControl->getPassengerClass();
 		if (mode <= 3) {
 			numStr = CString(mode);			
 		} else if (mode == 4) {
@@ -216,11 +216,10 @@ void CPetSoundSlider::setupBackground2(const CString &name, CPetControl *petCont
 void CPetSoundSlider::setupThumb2(const CString &name, CPetControl *petControl) {
 	if (petControl) {
 		CString numStr = "3";
-		int mode = petControl->getState8();
+		int mode = petControl->getPassengerClass();
 		if (mode <= 3) {
 			numStr = CString(mode);
-		}
-		else if (mode == 4) {
+		} else if (mode == 4) {
 			mode = petControl->getStateC();
 			if (mode == 1) {
 				numStr = CString(mode);


Commit: 487f2cef0f0be9bae3b815623b4dceb02e466ce0
    https://github.com/scummvm/scummvm/commit/487f2cef0f0be9bae3b815623b4dceb02e466ce0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:22:39-04:00

Commit Message:
TITANIC: Handle Conversations double click, PET Text key handling

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 3872d84..850fec1 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -95,6 +95,11 @@ bool CPetConversations::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
 	return false;
 }
 
+bool CPetConversations::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
+	return _scrollDown.MouseDoubleClickMsg(msg->_mousePos)
+		|| _scrollUp.MouseDoubleClickMsg(msg->_mousePos);
+}
+
 bool CPetConversations::setupControl(CPetControl *petControl) {
 	if (petControl) {
 		_petControl = petControl;
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 3f396c8..9b31272 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -104,6 +104,7 @@ public:
 	 */
 	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index 616877e..bc1b8de 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -47,7 +47,7 @@ bool CPetElement::MouseButtonUpMsg(const Point &pt) {
 	return result;
 }
 
-bool CPetElement::contains1(const Point &pt) const {
+bool CPetElement::MouseDoubleClickMsg(const Point &pt) const {
 	return _bounds.contains(pt);
 }
 
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index 4e35ee9..38f5f53 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -80,9 +80,9 @@ public:
 	virtual bool MouseButtonUpMsg(const Point &pt);
 
 	/**
-	 * Returns whether the passed point falls inside the item
+	 * Handles processing mouse button double click messages
 	 */
-	virtual bool contains1(const Point &pt) const;
+	virtual bool MouseDoubleClickMsg(const Point &pt) const;
 
 	virtual int proc9(const Point &pt);
 
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index c31d4fd..2ea1099 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -176,10 +176,10 @@ CString CPetText::getText() const {
 
 void CPetText::setText(const CString &str) {
 	setup();
-	changeText(str);
+	appendText(str);
 }
 
-void CPetText::changeText(const CString &str) {
+void CPetText::appendText(const CString &str) {
 	int lineSize = _array[_lineCount]._line.size();
 	int strSize = str.size();
 
@@ -304,8 +304,27 @@ void CPetText::addLine(const CString &str, byte r, byte g, byte b) {
 	}
 
 	setLineColor(_lineCount, r, g, b);
-	changeText(str);
+	appendText(str);
 	++_lineCount;
 }
 
+bool CPetText::handleKey(const Common::KeyState &keyState) {
+	switch (keyState.keycode) {
+	case Common::KEYCODE_BACKSPACE:
+		deleteLastChar();
+		break;
+
+	case Common::KEYCODE_RETURN:
+	case Common::KEYCODE_KP_ENTER:
+		return true;
+
+	default:
+		if (keyState.ascii >= 32 && keyState.ascii <= 127)
+			appendText(CString(keyState.ascii, 1));
+		break;
+	}
+
+	return false;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 6000dd6..4bb699d 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_PET_TEXT_H
 #define TITANIC_PET_TEXT_H
 
+#include "common/keyboard.h"
 #include "titanic/support/simple_file.h"
 #include "titanic/support/screen_manager.h"
 #include "titanic/support/text_cursor.h"
@@ -71,9 +72,9 @@ private:
 	void mergeStrings();
 
 	/**
-	 * Change the text
+	 * Append text to the current text line
 	 */
-	void changeText(const CString &str);
+	void appendText(const CString &str);
 
 	void updateStr3(int lineNum);
 
@@ -192,6 +193,13 @@ public:
 	 * Add a line to the text
 	 */
 	void addLine(const CString &str, byte r, byte g, byte b);
+
+	/**
+	 * Handles character processing to add or remove characters to
+	 * the current text line
+	 * @returns		True if the Enter key was pressed
+	 */
+	bool handleKey(const Common::KeyState &keyState);
 };
 
 } // End of namespace Titanic


Commit: b117bae55a52efdfd0e7593e4e3038d22101d8bc
    https://github.com/scummvm/scummvm/commit/b117bae55a52efdfd0e7593e4e3038d22101d8bc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:22:40-04:00

Commit Message:
TITANIC: Implemented conversations text input entry

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 89ea9e9..997d35b 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -44,7 +44,7 @@ END_MESSAGE_MAP()
 
 CPetControl::CPetControl() : CGameObject(), 
 		_currentArea(PET_CONVERSATION), _fieldC0(0), _locked(0), _fieldC8(0),
-		_treeItem1(nullptr), _treeItem2(nullptr), _hiddenRoom(nullptr),
+		_activeNPC(nullptr), _treeItem2(nullptr), _hiddenRoom(nullptr),
 		_drawBounds(20, 350, 620, 480) {
 	setup();
 	_timers[0] = _timers[1] = nullptr;
@@ -60,7 +60,7 @@ CPetControl::CPetControl() : CGameObject(),
 void CPetControl::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(0, indent);
 	file->writeNumberLine(_currentArea, indent);
-	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_activeNPCName, indent);
 	file->writeQuotedLine(_string2, indent);
 
 	saveAreas(file, indent);
@@ -73,7 +73,7 @@ void CPetControl::load(SimpleFile *file) {
 	
 	if (!val) {
 		_currentArea = (PetArea)file->readNumber();
-		_string1 = file->readString();
+		_activeNPCName = file->readString();
 		_string2 = file->readString();
 		
 		loadAreas(file, 0);
@@ -151,8 +151,8 @@ Rect CPetControl::getBounds() {
 void CPetControl::postLoad() {
 	CProjectItem *root = getRoot();
 
-	if (!_string1.empty() && root)
-		_treeItem1 = root->findByName(_string1);
+	if (!_activeNPCName.empty() && root)
+		_activeNPC = root->findByName(_activeNPCName);
 	if (!_string2.empty() && root)
 		_treeItem2 = root->findByName(_string2);
 
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index bd89657..7e720b7 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -56,8 +56,7 @@ private:
 	CPetControlSub5 _sub5;
 	CPetControlSub7 _sub7;
 	CPetFrame _frame;
-	CTreeItem *_treeItem1;
-	CString _string1;
+	CString _activeNPCName;
 	CTreeItem *_treeItem2;
 	CString _string2;
 	CRoomItem *_hiddenRoom;
@@ -107,6 +106,7 @@ protected:
 	bool TimerMsg(CTimerMsg *msg);
 public:
 	PetArea _currentArea;
+	CTreeItem *_activeNPC;
 public:
 	CLASSDEF
 	CPetControl();
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 850fec1..d7fe68e 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -26,7 +26,7 @@
 namespace Titanic {
 
 CPetConversations::CPetConversations() : CPetSection(),
-		_field414(0), _field418(0) {
+		_logScrolled(false), _field418(0) {
 }
 
 void CPetConversations::save(SimpleFile *file, int indent) const {
@@ -34,7 +34,7 @@ void CPetConversations::save(SimpleFile *file, int indent) const {
 }
 
 void CPetConversations::load(SimpleFile *file, int param) {
-	_text2.load(file, param);
+	_textInput.load(file, param);
 	_log.load(file, param);
 
 	for (int idx = 0; idx < 3; ++idx)
@@ -100,6 +100,16 @@ bool CPetConversations::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
 		|| _scrollUp.MouseDoubleClickMsg(msg->_mousePos);
 }
 
+bool CPetConversations::KeyCharMsg(CKeyCharMsg *msg) {
+	Common::KeyState keyState;
+	keyState.ascii = msg->_key;
+	return handleKey(keyState);
+}
+
+bool CPetConversations::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
+	return handleKey(msg->_keyState);
+}
+
 bool CPetConversations::setupControl(CPetControl *petControl) {
 	if (petControl) {
 		_petControl = petControl;
@@ -146,21 +156,42 @@ void CPetConversations::scrollUp() {
 	_log.scrollUp(CScreenManager::_screenManagerPtr);
 	if (_petControl)
 		_petControl->makeDirty();
-	_field414 = true;
+	_logScrolled = true;
 }
 
 void CPetConversations::scrollDown() {
 	_log.scrollDown(CScreenManager::_screenManagerPtr);
 	if (_petControl)
 		_petControl->makeDirty();
-	_field414 = true;
+	_logScrolled = true;
+}
+
+void CPetConversations::scrollUpPage() {
+	_log.scrollUpPage(CScreenManager::_screenManagerPtr);
+	if (_petControl)
+		_petControl->makeDirty();
+	_logScrolled = true;
+}
+
+void CPetConversations::scrollDownPage() {
+	_log.scrollDownPage(CScreenManager::_screenManagerPtr);
+	if (_petControl)
+		_petControl->makeDirty();
+	_logScrolled = true;
+}
+
+void CPetConversations::scrollToTop() {
+	_log.scrollToTop(CScreenManager::_screenManagerPtr);
+	if (_petControl)
+		_petControl->makeDirty();
+	_logScrolled = true;
 }
 
 void CPetConversations::scrollToBottom() {
 	_log.scrollToBottom(CScreenManager::_screenManagerPtr);
 	if (_petControl)
 		_petControl->makeDirty();
-	_field414 = true;
+	_logScrolled = true;
 }
 
 int CPetConversations::canSummonNPC(const CString &name) {
@@ -177,4 +208,62 @@ void CPetConversations::summonNPC(const CString &name) {
 	}
 }
 
+bool CPetConversations::handleKey(const Common::KeyState &keyState) {
+	switch (keyState.keycode) {
+	case Common::KEYCODE_UP:
+	case Common::KEYCODE_KP8:
+		scrollUp();
+		break;
+	case Common::KEYCODE_DOWN:
+	case Common::KEYCODE_KP2:
+		scrollDown();
+		break;
+	case Common::KEYCODE_PAGEUP:
+	case Common::KEYCODE_KP9:
+		scrollUpPage();
+		break;
+	case Common::KEYCODE_PAGEDOWN:
+	case Common::KEYCODE_KP3:
+		scrollDownPage();
+		break;
+	case Common::KEYCODE_HOME:
+	case Common::KEYCODE_KP7:
+		scrollToTop();
+		break;
+	case Common::KEYCODE_END:
+	case Common::KEYCODE_KP1:
+		scrollToBottom();
+		break;
+	case Common::KEYCODE_BACKSPACE:
+		// Erase key in text input
+		_textInput.handleKey((char)Common::KEYCODE_BACKSPACE);
+	case Common::KEYCODE_RETURN:
+	case Common::KEYCODE_KP_ENTER:
+		// Text line finished
+		textLineEntered(_textInput.getText());
+		return true;
+	default:
+		if (keyState.ascii >= 32 && keyState.ascii)
+			_textInput.handleKey(keyState.ascii);
+		return true;
+	}
+
+	return false;
+}
+
+void CPetConversations::textLineEntered(const CString &textLine) {
+	if (textLine.empty() || !_petControl)
+		return;
+
+	if (_petControl->_activeNPC) {
+		warning("TODO: textLineEntered");
+	} else {
+		_log.addLine("There is no one here to talk to", getColor(1));
+	}
+
+	// Clear input line and scroll log down to end to show response
+	_textInput.setup();
+	scrollToBottom();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 9b31272..f7541ed 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -45,9 +45,9 @@ private:
 	CPetGfxElement _valArray2[9];
 	int _field30C;
 	CPetText _log;
-	CPetText _text2;
+	CPetText _textInput;
 	int _valArray3[3];
-	int _field414;
+	bool _logScrolled;
 	int _field418;
 	CString _string1;
 private:
@@ -67,6 +67,21 @@ private:
 	void scrollDown();
 
 	/**
+	 * Scroll up one page in the conversation log
+	 */
+	void scrollUpPage();
+
+	/**
+	 * Scroll down one page in the conversation log
+	 */
+	void scrollDownPage();
+
+	/**
+	 * Scroll to the top of the conversation log
+	 */
+	void scrollToTop();
+
+	/**
 	 * Scroll to the bottom of the conversation log
 	 */
 	void scrollToBottom();
@@ -80,6 +95,16 @@ private:
 	 * Summon an NPC
 	 */
 	void summonNPC(const CString &name);
+
+	/**
+	 * Handle a keypress
+	 */
+	bool handleKey(const Common::KeyState &keyState);
+
+	/**
+	 * Handles an entered text line
+	 */
+	void textLineEntered(const CString &textLine);
 public:
 	CPetConversations();
 
@@ -105,6 +130,8 @@ public:
 	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
 	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
+	virtual bool KeyCharMsg(CKeyCharMsg *msg);
+	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 2ea1099..a092255 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -264,6 +264,24 @@ void CPetText::scrollDown(CScreenManager *screenManager) {
 	screenManager->setFontNumber(oldFontNumber);
 }
 
+void CPetText::scrollUpPage(CScreenManager *screenManager) {
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	_scrollTop -= getPageHeight(screenManager);
+	constrainScrollUp(screenManager);
+	screenManager->setFontNumber(oldFontNumber);
+}
+
+void CPetText::scrollDownPage(CScreenManager *screenManager) {
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	_scrollTop += getPageHeight(screenManager);
+	constrainScrollDown(screenManager);
+	screenManager->setFontNumber(oldFontNumber);
+}
+
+void CPetText::scrollToTop(CScreenManager *screenManager) {
+	_scrollTop = 0;
+}
+
 void CPetText::scrollToBottom(CScreenManager *screenManager) {
 	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
 	_scrollTop = _bounds.height();
@@ -286,6 +304,22 @@ void CPetText::constrainScrollDown(CScreenManager *screenManager) {
 		_scrollTop = maxScroll;
 }
 
+int CPetText::getPageHeight(CScreenManager *screenManager) {
+	int textHeight = _bounds.height();
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	int fontHeight = screenManager->getFontHeight();
+	screenManager->setFontNumber(oldFontNumber);
+
+	if (fontHeight) {
+		int lines = textHeight / fontHeight;
+		if (lines > 1)
+			--lines;
+		return lines * fontHeight;
+	} else {
+		return 0;
+	}
+}
+
 void CPetText::addLine(const CString &str, uint color) {
 	addLine(str, color & 0xff, (color >> 8) & 0xff,
 		(color >> 16) & 0xff);
@@ -308,19 +342,18 @@ void CPetText::addLine(const CString &str, byte r, byte g, byte b) {
 	++_lineCount;
 }
 
-bool CPetText::handleKey(const Common::KeyState &keyState) {
-	switch (keyState.keycode) {
-	case Common::KEYCODE_BACKSPACE:
+bool CPetText::handleKey(char c) {
+	switch (c) {
+	case (char)Common::KEYCODE_BACKSPACE:
 		deleteLastChar();
 		break;
 
-	case Common::KEYCODE_RETURN:
-	case Common::KEYCODE_KP_ENTER:
+	case (char)Common::KEYCODE_RETURN:
 		return true;
 
 	default:
-		if (keyState.ascii >= 32 && keyState.ascii <= 127)
-			appendText(CString(keyState.ascii, 1));
+		if (c >= 32 && c <= 127)
+			appendText(CString(c, 1));
 		break;
 	}
 
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 4bb699d..00eab10 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -92,6 +92,11 @@ private:
 	 * Ensures the Y scrolling for the text is in the valid range
 	 */
 	void constrainScrollDown(CScreenManager *screenManager);
+
+	/**
+	 * Get the page height for paging up and down
+	 */
+	int getPageHeight(CScreenManager *screenManager);
 public:
 	CPetText(uint count = 10);
 
@@ -180,6 +185,21 @@ public:
 	void scrollDown(CScreenManager *screenManager);
 
 	/**
+	 * Scroll the text up one page
+	 */
+	void scrollUpPage(CScreenManager *screenManager);
+
+	/**
+	 * Scroll the text down one page
+	 */
+	void scrollDownPage(CScreenManager *screenManager);
+
+	/**
+	 * Scroll to the top of the text
+	 */
+	void scrollToTop(CScreenManager *screenManager);
+
+	/**
 	 * Scroll to the bottom of the text
 	 */
 	void scrollToBottom(CScreenManager *screenManager);
@@ -199,7 +219,7 @@ public:
 	 * the current text line
 	 * @returns		True if the Enter key was pressed
 	 */
-	bool handleKey(const Common::KeyState &keyState);
+	bool handleKey(char c);
 };
 
 } // End of namespace Titanic


Commit: 6fa57389a2711a83103ebde63779743f7ac2b96d
    https://github.com/scummvm/scummvm/commit/6fa57389a2711a83103ebde63779743f7ac2b96d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:22:41-04:00

Commit Message:
TITANIC: Finished PET Conversations input line processing

Changed paths:
    engines/titanic/messages/messages.h
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 3af65c2..4c8ccaf 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -345,7 +345,7 @@ MESSAGE0(CSubTurnOnMsg);
 MESSAGE2(CSummonBotMsg, CString, strValue, "", int, numValue, 0);
 MESSAGE1(CSummonBotQueryMsg, CString, npcName, "");
 MESSAGE1(CTakeHeadPieceMsg, CString, value, "NULL");
-MESSAGE2(CTextInputMsg, CString, value1, "", CString, value2, "");
+MESSAGE2(CTextInputMsg, CString, input, "", CString, response, "");
 MESSAGE1(CTimeDilationMsg, int, value, 0);
 MESSAGE0(CTitleSequenceEndedMsg);
 MESSAGE0(CTransitMsg);
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index d7fe68e..ae5bbd6 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -256,7 +256,13 @@ void CPetConversations::textLineEntered(const CString &textLine) {
 		return;
 
 	if (_petControl->_activeNPC) {
-		warning("TODO: textLineEntered");
+		_log.addLine("- " + textLine, getColor(0));
+
+		CTextInputMsg inputMsg(textLine, "");
+		inputMsg.execute(_petControl->_activeNPC);
+
+		if (!inputMsg._response.empty())
+			_log.addLine(inputMsg._response);
 	} else {
 		_log.addLine("There is no one here to talk to", getColor(1));
 	}
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index a092255..349e419 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -320,6 +320,10 @@ int CPetText::getPageHeight(CScreenManager *screenManager) {
 	}
 }
 
+void CPetText::addLine(const CString &str) {
+	addLine(str, _textR, _textG, _textB);
+}
+
 void CPetText::addLine(const CString &str, uint color) {
 	addLine(str, color & 0xff, (color >> 8) & 0xff,
 		(color >> 16) & 0xff);
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 00eab10..a3d136a 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -207,6 +207,11 @@ public:
 	/**
 	 * Add a line to the text
 	 */
+	void addLine(const CString &str);
+
+	/**
+	 * Add a line to the text
+	 */
 	void addLine(const CString &str, uint color);
 
 	/**


Commit: 5d087a8fcd709550ec14fc6b01acf045f8d6614b
    https://github.com/scummvm/scummvm/commit/5d087a8fcd709550ec14fc6b01acf045f8d6614b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:22:42-04:00

Commit Message:
TITANIC: Implement PET Conversations & Text saving

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index ae5bbd6..d21380c 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -29,18 +29,6 @@ CPetConversations::CPetConversations() : CPetSection(),
 		_logScrolled(false), _field418(0) {
 }
 
-void CPetConversations::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetConversations::load(SimpleFile *file, int param) {
-	_textInput.load(file, param);
-	_log.load(file, param);
-
-	for (int idx = 0; idx < 3; ++idx)
-		_valArray3[idx] = file->readNumber();
-}
-
 bool CPetConversations::isValid(CPetControl *petControl) {
 	return setupControl(petControl);
 }
@@ -110,6 +98,39 @@ bool CPetConversations::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
 	return handleKey(msg->_keyState);
 }
 
+void CPetConversations::displayMessage(const CString &msg) {
+	_log.addLine(msg, getColor(1));
+	scrollToBottom();
+}
+
+void CPetConversations::load(SimpleFile *file, int param) {
+	_textInput.load(file, param);
+	_log.load(file, param);
+
+	for (int idx = 0; idx < 3; ++idx)
+		_valArray3[idx] = file->readNumber();
+}
+
+void CPetConversations::postLoad() {
+	reset();
+}
+
+void CPetConversations::save(SimpleFile *file, int indent) const {
+	_textInput.save(file, indent);
+	_log.save(file, indent);
+
+	for (int idx = 0; idx < 3; ++idx)
+		file->writeNumberLine(_valArray3[idx], indent);
+}
+
+void CPetConversations::enter(PetArea oldArea) {
+
+}
+
+void CPetConversations::leave() {
+
+}
+
 bool CPetConversations::setupControl(CPetControl *petControl) {
 	if (petControl) {
 		_petControl = petControl;
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index f7541ed..9247b44 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -109,16 +109,6 @@ public:
 	CPetConversations();
 
 	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file, int param);
-
-	/**
 	 * Returns true if the object is in a valid state
 	 */
 	virtual bool isValid(CPetControl *petControl);
@@ -132,6 +122,35 @@ public:
 	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
 	virtual bool KeyCharMsg(CKeyCharMsg *msg);
 	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg);
+
+	/**
+	 * Display a message
+	 */
+	virtual void displayMessage(const CString &msg);
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param);
+
+	/**
+	 * Called after a game has been loaded
+	 */
+	virtual void postLoad();
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Called when a section is switched to
+	 */
+	virtual void enter(PetArea oldArea);
+	
+	/**
+	 * Called when a section is being left, to switch to another area
+	 */
+	virtual void leave();	
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 349e419..87a6868 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -83,10 +83,7 @@ void CPetText::load(SimpleFile *file, int param) {
 		int var1 = file->readNumber();
 		int var2 = file->readNumber();
 		uint count = file->readNumber();
-		_bounds.left = file->readNumber();
-		_bounds.top = file->readNumber();
-		_bounds.right = file->readNumber();
-		_bounds.bottom = file->readNumber();
+		_bounds = file->readRect();
 		_field3C = file->readNumber();
 		_field40 = file->readNumber();
 		_field44 = file->readNumber();
@@ -109,6 +106,33 @@ void CPetText::load(SimpleFile *file, int param) {
 	}
 }
 
+void CPetText::save(SimpleFile *file, int indent) const {
+	int numLines = _lineCount + 1;
+
+	file->writeNumberLine(_array.size(), indent);
+	file->writeNumberLine(_maxCharsPerLine, indent);
+	file->writeNumberLine(numLines, indent);
+
+	file->writeRect(_bounds, indent);
+	file->writeNumberLine(_field3C, indent);
+	file->writeNumberLine(_field40, indent);
+	file->writeNumberLine(_field44, indent);
+	file->writeNumberLine(_backR, indent);
+	file->writeNumberLine(_backG, indent);
+	file->writeNumberLine(_backB, indent);
+	file->writeNumberLine(_textR, indent);
+	file->writeNumberLine(_textG, indent);
+	file->writeNumberLine(_textB, indent);
+	file->writeNumberLine(_hasBorder, indent);
+	file->writeNumberLine(_scrollTop, indent);
+
+	for (int idx = 0; idx < numLines; ++idx) {
+		file->writeQuotedLine(_array[idx]._line, indent);
+		file->writeQuotedLine(_array[idx]._rgb, indent);
+		file->writeQuotedLine(_array[idx]._string3, indent);
+	}
+}
+
 void CPetText::draw(CScreenManager *screenManager) {
 	Rect tempRect = _bounds;
 
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index a3d136a..dd1547b 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -111,6 +111,11 @@ public:
 	void load(SimpleFile *file, int param);
 
 	/**
+	 * Save the data for the control
+	 */
+	void save(SimpleFile *file, int indent) const;
+
+	/**
 	 * Set the bounds for the control
 	 */
 	void setBounds(const Rect &bounds) { _bounds = bounds; }


Commit: 6ec129d188a2b5b86dba6540b38a959bbf8b2491
    https://github.com/scummvm/scummvm/commit/6ec129d188a2b5b86dba6540b38a959bbf8b2491
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:24-04:00

Commit Message:
TITANIC: Added PET Conversations enter, PET Timers, and Text Cursor show

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_section.cpp
    engines/titanic/pet_control/pet_section.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 997d35b..d67ce54 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -46,8 +46,6 @@ CPetControl::CPetControl() : CGameObject(),
 		_currentArea(PET_CONVERSATION), _fieldC0(0), _locked(0), _fieldC8(0),
 		_activeNPC(nullptr), _treeItem2(nullptr), _hiddenRoom(nullptr),
 		_drawBounds(20, 350, 620, 480) {
-	setup();
-	_timers[0] = _timers[1] = nullptr;
 	_sections[PET_INVENTORY] = &_inventory;
 	_sections[PET_CONVERSATION] = &_conversations;
 	_sections[PET_REMOTE] = &_remote;
@@ -487,4 +485,22 @@ void CPetControl::summonNPC(const CString &name, int val) {
 	}
 }
 
+void CPetControl::startPetTimer(uint timerIndex, uint firstDuration, uint duration, void *target) {
+	stopPetTimer(timerIndex);
+	_timers[timerIndex]._id = (timerIndex, firstDuration, duration);
+	_timers[timerIndex]._target = target;
+	setTimer44(_timers[timerIndex]._id, 0);
+}
+
+void CPetControl::stopPetTimer(uint timerIndex) {
+	if (_timers[timerIndex]._target) {
+		stopTimer(_timers[timerIndex]._id);
+		_timers[timerIndex]._target = nullptr;
+	}
+}
+
+void CPetControl::setTimer44(int id, int val) {
+	getGameManager()->setTimer44(id, val);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 7e720b7..5fbd8a0 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -43,6 +43,11 @@ enum SummonResult { SUMMON_CANT = 0, SUMMON_PRESENT = 1, SUMMON_CAN = 2 };
 
 class CPetControl : public CGameObject {
 	DECLARE_MESSAGE_MAP
+	struct PetEventInfo {
+		int _id;
+		void *_target;
+		PetEventInfo() : _id(0), _target(nullptr) {}
+	};
 private:
 	int _fieldC0;
 	int _locked;
@@ -61,7 +66,7 @@ private:
 	CString _string2;
 	CRoomItem *_hiddenRoom;
 	Rect _drawBounds;
-	void *_timers[2];
+	PetEventInfo _timers[2];
 private:
 	/**
 	 * Returns true if the control is in a valid state
@@ -94,6 +99,8 @@ private:
 	 * Checks whether a designated NPC in present in the current view
 	 */
 	bool isNPCInView(const CString &name) const;
+
+	void setTimer44(int id, int val);
 protected:
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
@@ -267,6 +274,16 @@ public:
 	 * Summon an NPC to the player
 	 */
 	void summonNPC(const CString &name, int val);
+
+	/**
+	 * Start a timer
+	 */
+	void startPetTimer(uint timerIndex, uint firstDuration, uint duration, void *target);
+
+	/**
+	 * Stop a timer
+	 */
+	void stopPetTimer(uint timerIndex);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index d21380c..960b325 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -124,7 +124,11 @@ void CPetConversations::save(SimpleFile *file, int indent) const {
 }
 
 void CPetConversations::enter(PetArea oldArea) {
+	if (_petControl && _petControl->_activeNPC)
+		// Start a timer for the NPC
+		addNPCTimer();
 
+	_textInput.showCursor(-2);
 }
 
 void CPetConversations::leave() {
@@ -229,6 +233,10 @@ void CPetConversations::summonNPC(const CString &name) {
 	}
 }
 
+void CPetConversations::addNPCTimer() {
+	_petControl->startPetTimer(1, 1000, 1000, this);
+}
+
 bool CPetConversations::handleKey(const Common::KeyState &keyState) {
 	switch (keyState.keycode) {
 	case Common::KEYCODE_UP:
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 9247b44..ca85e14 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -97,6 +97,11 @@ private:
 	void summonNPC(const CString &name);
 
 	/**
+	 * Adds an NPC timer
+	 */
+	void addNPCTimer();
+
+	/**
 	 * Handle a keypress
 	 */
 	bool handleKey(const Common::KeyState &keyState);
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp
index afdbc9f..213c93e 100644
--- a/engines/titanic/pet_control/pet_section.cpp
+++ b/engines/titanic/pet_control/pet_section.cpp
@@ -46,8 +46,11 @@ void CPetSection::proc25() {
 	error("TODO");
 }
 
-void CPetSection::proc27() {
-	error("TODO");
+void CPetSection::proc27(int duration) {
+	if (duration > 0)
+		_petControl->startPetTimer(0, duration, 0, this);
+	else
+		proc28();
 }
 
 void CPetSection::proc28() {
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 720e532..d582f38 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -146,7 +146,7 @@ public:
 	 */
 	virtual CPetText *getText() { return nullptr; }
 
-	virtual void proc27();
+	virtual void proc27(int duration);
 	virtual void proc28();
 	virtual void proc29();
 	virtual void proc30();
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 87a6868..7e5f329 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -388,4 +388,18 @@ bool CPetText::handleKey(char c) {
 	return false;
 }
 
+void CPetText::showCursor(int mode) {
+	CScreenManager *screenManager = CScreenManager::setCurrent();
+	_textCursor = screenManager->_textCursor;
+	if (_textCursor) {
+		_textCursor->setPos(Point(0, 0));
+		_textCursor->setSize(Point(2, 10));
+		_textCursor->setColor(0, 0, 0);
+		_textCursor->setBlinkRate(300);
+		_textCursor->setMode(mode);
+		_textCursor->setBounds(_bounds);
+		_textCursor->show();
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index dd1547b..2b68b74 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -230,6 +230,12 @@ public:
 	 * @returns		True if the Enter key was pressed
 	 */
 	bool handleKey(char c);
+
+	/**
+	 * Attaches the current system cursor to the text control,
+	 * and give it suitable defaults
+	 */
+	void showCursor(int mode);
 };
 
 } // End of namespace Titanic


Commit: d6b84cd9e16ac584c5b57b1b94e1d071c30060ce
    https://github.com/scummvm/scummvm/commit/d6b84cd9e16ac584c5b57b1b94e1d071c30060ce
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:33-04:00

Commit Message:
TITANIC: Added PET Conversations leave and Text Cursor hide

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 960b325..7596e65 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -126,13 +126,15 @@ void CPetConversations::save(SimpleFile *file, int indent) const {
 void CPetConversations::enter(PetArea oldArea) {
 	if (_petControl && _petControl->_activeNPC)
 		// Start a timer for the NPC
-		addNPCTimer();
+		startNPCTimer();
 
+	// Show the text cursor
 	_textInput.showCursor(-2);
 }
 
 void CPetConversations::leave() {
-
+	_textInput.hideCursor();
+	stopNPCTimer();
 }
 
 bool CPetConversations::setupControl(CPetControl *petControl) {
@@ -233,10 +235,14 @@ void CPetConversations::summonNPC(const CString &name) {
 	}
 }
 
-void CPetConversations::addNPCTimer() {
+void CPetConversations::startNPCTimer() {
 	_petControl->startPetTimer(1, 1000, 1000, this);
 }
 
+void CPetConversations::stopNPCTimer() {
+	_petControl->stopPetTimer(1);
+}
+
 bool CPetConversations::handleKey(const Common::KeyState &keyState) {
 	switch (keyState.keycode) {
 	case Common::KEYCODE_UP:
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index ca85e14..c7fb207 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -97,9 +97,14 @@ private:
 	void summonNPC(const CString &name);
 
 	/**
-	 * Adds an NPC timer
+	 * Starts the NPC timer
 	 */
-	void addNPCTimer();
+	void startNPCTimer();
+
+	/**
+	 * Stops the NPC timer
+	 */
+	void stopNPCTimer();
 
 	/**
 	 * Handle a keypress
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 7e5f329..6f870fa 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -402,4 +402,12 @@ void CPetText::showCursor(int mode) {
 	}
 }
 
+void CPetText::hideCursor() {
+	if (_textCursor) {
+		_textCursor->setMode(-1);
+		_textCursor->hide();
+		_textCursor = nullptr;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 2b68b74..9b914dc 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -236,6 +236,11 @@ public:
 	 * and give it suitable defaults
 	 */
 	void showCursor(int mode);
+
+	/**
+	 * Removes the cursor attached to the text
+	 */
+	void hideCursor();
 };
 
 } // End of namespace Titanic


Commit: e47494a4894301cf4034c6aad4abd65f45b38eca
    https://github.com/scummvm/scummvm/commit/e47494a4894301cf4034c6aad4abd65f45b38eca
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:34-04:00

Commit Message:
TITANIC: Implement TrueTalk script retrieval

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 7596e65..988df5d 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/pet_control/pet_conversations.h"
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/game_manager.h"
 
 namespace Titanic {
 
@@ -243,6 +244,19 @@ void CPetConversations::stopNPCTimer() {
 	_petControl->stopPetTimer(1);
 }
 
+TTNamedScript *CPetConversations::getNPCScript(const CString &name) const {
+	if (name.empty() || !_petControl)
+		return nullptr;
+	CGameManager *gameManager = _petControl->getGameManager();
+	if (!gameManager)
+		return nullptr;
+	CTrueTalkManager *trueTalk = gameManager->getTalkManager();
+	if (!trueTalk)
+		return nullptr;
+
+	return trueTalk->getTalker(name);
+}
+
 bool CPetConversations::handleKey(const Common::KeyState &keyState) {
 	switch (keyState.keycode) {
 	case Common::KEYCODE_UP:
@@ -307,4 +321,11 @@ void CPetConversations::textLineEntered(const CString &textLine) {
 	scrollToBottom();
 }
 
+CString CPetConversations::getActiveNPCName() const {
+	if (_petControl && _petControl->_activeNPC)
+		return _petControl->_activeNPC->getName();
+	else
+		return CString();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index c7fb207..c3eefa9 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -26,6 +26,7 @@
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_text.h"
 #include "titanic/pet_control/pet_gfx_element.h"
+#include "titanic/true_talk/true_talk_manager.h"
 
 namespace Titanic {
 
@@ -49,7 +50,7 @@ private:
 	int _valArray3[3];
 	bool _logScrolled;
 	int _field418;
-	CString _string1;
+	CString _npcName;
 private:
 	/**
 	 * Sets up the control
@@ -107,6 +108,11 @@ private:
 	void stopNPCTimer();
 
 	/**
+	 * Get the TrueTalk script associated with a given NPC
+	 */
+	TTNamedScript *getNPCScript(const CString &name) const;
+
+	/**
 	 * Handle a keypress
 	 */
 	bool handleKey(const Common::KeyState &keyState);
@@ -115,6 +121,11 @@ private:
 	 * Handles an entered text line
 	 */
 	void textLineEntered(const CString &textLine);
+
+	/**
+	 * Returns the name of the currently active NPC, if any
+	 */
+	CString getActiveNPCName() const;
 public:
 	CPetConversations();
 
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 03f8ac5..b97b519 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -195,4 +195,27 @@ void CTrueTalkManager::fn1(CTreeItem *item, int val2, int val3) {
 	warning("CTrueTalkManager::fn1");
 }
 
+TTNamedScript *CTrueTalkManager::getTalker(const CString &name) {
+	if (name.contains("Doorbot"))
+		return _scripts.getNamedScript(104);
+	else if (name.contains("DeskBot"))
+		return _scripts.getNamedScript(103);
+	else if (name.contains("LiftBot"))
+		return _scripts.getNamedScript(105);
+	else if (name.contains("Parrot"))
+		return _scripts.getNamedScript(107);
+	else if (name.contains("BarBot"))
+		return _scripts.getNamedScript(100);
+	else if (name.contains("ChatterBot"))
+		return _scripts.getNamedScript(102);
+	else if (name.contains("BellBot"))
+		return _scripts.getNamedScript(101);
+	else if (name.contains("MaitreD"))
+		return _scripts.getNamedScript(112);
+	else if (name.contains("Succubus") || name.contains("Sub"))
+		return _scripts.getNamedScript(111);
+
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 2e366a6..9da1c06 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -113,6 +113,11 @@ public:
 	void update2();
 
 	void fn1(CTreeItem *item, int val2, int val3);
+
+	/**
+	 * Return a TrueTalk talker/script
+	 */
+	TTNamedScript *getTalker(const CString &name);
 };
 
 } // End of namespace Titanic


Commit: 7af7838b863893b1a67dfc3a7d82fe0febff8b07
    https://github.com/scummvm/scummvm/commit/7af7838b863893b1a67dfc3a7d82fe0febff8b07
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:35-04:00

Commit Message:
TITANIC: Implement PET Conversations displayNPC

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 988df5d..8f0450c 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -138,6 +138,48 @@ void CPetConversations::leave() {
 	stopNPCTimer();
 }
 
+void CPetConversations::displayNPC(CGameObject *npc) {
+	if (npc) {
+		displayMessage(CString());
+		CString msg = "Talking to ";
+		CString name = npc->getName();
+		int id = 1;
+
+		if (name.contains("Doorbot")) {
+			msg += "the DoorBot";
+		} else if (name.contains("DeskBot")) {
+			id = 2;
+			msg += "the DeskBot";
+		} else if (name.contains("LiftBot")) {
+			id = 3;
+			msg += "a LiftBot";
+		} else if (name.contains("Parrot")) {
+			id = 4;
+			msg += "the Parrot";
+		} else if (name.contains("BarBot")) {
+			id = 5;
+			msg += "the BarBot";
+		} else if (name.contains("ChatterBot")) {
+			id = 6;
+			msg += "a ChatterBot";
+		} else if (name.contains("BellBot")) {
+			id = 7;
+			msg += "the BellBot";
+		} else if (name.contains("Maitre")) {
+			id = 8;
+			msg += "the Maitre d'Bot";
+		} else if (name.contains("Succubus") || name.contains("Sub")) {
+			id = 9;
+			msg += "a Succ-U-Bus";
+		} else {
+			msg += "Unknown";
+		}
+
+		_log.setNPC(1, id);
+		displayMessage(msg);
+	}
+}
+
 bool CPetConversations::setupControl(CPetControl *petControl) {
 	if (petControl) {
 		_petControl = petControl;
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index c3eefa9..ad993ec 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -171,7 +171,12 @@ public:
 	/**
 	 * Called when a section is being left, to switch to another area
 	 */
-	virtual void leave();	
+	virtual void leave();
+
+	/**
+	 * Display a title for an NPC
+	 */
+	virtual void displayNPC(CGameObject *npc);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index d582f38..995feee 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -153,7 +153,11 @@ public:
 
 	virtual CGameObject *getBackground(int index) const { return nullptr; }
 
-	virtual void proc32() {}
+	/**
+	 * Display a title for an NPC
+	 */
+	virtual void displayNPC(CGameObject *npc);
+
 	virtual void proc33() {}
 	virtual void proc34() {}
 	virtual void proc35() {}


Commit: 6de4295cc3e691a7d3806cd27be525037eb173fc
    https://github.com/scummvm/scummvm/commit/6de4295cc3e691a7d3806cd27be525037eb173fc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:36-04:00

Commit Message:
TITANIC: Identifiied Pet Section showCursor & hideCursor methods

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 8f0450c..6776353 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -27,7 +27,7 @@
 namespace Titanic {
 
 CPetConversations::CPetConversations() : CPetSection(),
-		_logScrolled(false), _field418(0) {
+		_logChanged(false), _field418(0) {
 }
 
 bool CPetConversations::isValid(CPetControl *petControl) {
@@ -138,7 +138,7 @@ void CPetConversations::leave() {
 	stopNPCTimer();
 }
 
-void CPetConversations::displayNPC(CGameObject *npc) {
+void CPetConversations::displayNPCName(CGameObject *npc) {
 	if (npc) {
 		displayMessage(CString());
 		CString msg = "Talking to ";
@@ -180,6 +180,14 @@ void CPetConversations::displayNPC(CGameObject *npc) {
 	}
 }
 
+void CPetConversations::showCursor() {
+	_textInput.showCursor(-2);
+}
+
+void CPetConversations::hideCursor() {
+	_textInput.hideCursor();
+}
+
 bool CPetConversations::setupControl(CPetControl *petControl) {
 	if (petControl) {
 		_petControl = petControl;
@@ -226,42 +234,42 @@ void CPetConversations::scrollUp() {
 	_log.scrollUp(CScreenManager::_screenManagerPtr);
 	if (_petControl)
 		_petControl->makeDirty();
-	_logScrolled = true;
+	_logChanged = true;
 }
 
 void CPetConversations::scrollDown() {
 	_log.scrollDown(CScreenManager::_screenManagerPtr);
 	if (_petControl)
 		_petControl->makeDirty();
-	_logScrolled = true;
+	_logChanged = true;
 }
 
 void CPetConversations::scrollUpPage() {
 	_log.scrollUpPage(CScreenManager::_screenManagerPtr);
 	if (_petControl)
 		_petControl->makeDirty();
-	_logScrolled = true;
+	_logChanged = true;
 }
 
 void CPetConversations::scrollDownPage() {
 	_log.scrollDownPage(CScreenManager::_screenManagerPtr);
 	if (_petControl)
 		_petControl->makeDirty();
-	_logScrolled = true;
+	_logChanged = true;
 }
 
 void CPetConversations::scrollToTop() {
 	_log.scrollToTop(CScreenManager::_screenManagerPtr);
 	if (_petControl)
 		_petControl->makeDirty();
-	_logScrolled = true;
+	_logChanged = true;
 }
 
 void CPetConversations::scrollToBottom() {
 	_log.scrollToBottom(CScreenManager::_screenManagerPtr);
 	if (_petControl)
 		_petControl->makeDirty();
-	_logScrolled = true;
+	_logChanged = true;
 }
 
 int CPetConversations::canSummonNPC(const CString &name) {
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index ad993ec..79f6b59 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -48,7 +48,7 @@ private:
 	CPetText _log;
 	CPetText _textInput;
 	int _valArray3[3];
-	bool _logScrolled;
+	bool _logChanged;
 	int _field418;
 	CString _npcName;
 private:
@@ -176,7 +176,17 @@ public:
 	/**
 	 * Display a title for an NPC
 	 */
-	virtual void displayNPC(CGameObject *npc);
+	virtual void displayNPCName(CGameObject *npc);
+
+	/**
+	 * Show the text cursor
+	 */
+	virtual void showCursor();
+	
+	/**
+	 * Hide the text cursor
+	 */
+	virtual void hideCursor();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 995feee..692c8b9 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -156,13 +156,22 @@ public:
 	/**
 	 * Display a title for an NPC
 	 */
-	virtual void displayNPC(CGameObject *npc);
+	virtual void displayNPCName(CGameObject *npc) {}
 
 	virtual void proc33() {}
 	virtual void proc34() {}
 	virtual void proc35() {}
-	virtual void proc36() {}
-	virtual void proc37() {}
+
+	/**
+	 * Show the text cursor
+	 */
+	virtual void showCursor() {}
+	
+	/**
+	 * Hide the text cursor
+	 */
+	virtual void hideCursor() {}
+
 	virtual void proc38(int val) {}
 
 	/**


Commit: 44d95d8e51562d40e5049e9c1c110e6ef9ace83e
    https://github.com/scummvm/scummvm/commit/44d95d8e51562d40e5049e9c1c110e6ef9ace83e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:37-04:00

Commit Message:
TITANIC: Simplify video surface shading palette

Changed paths:
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index fe69478..6ce4731 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -164,7 +164,7 @@ bool CVideoSurface::proc45() {
 
 /*------------------------------------------------------------------------*/
 
-byte OSVideoSurface::_map[0x400];
+byte OSVideoSurface::_palette[32][32];
 
 OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface) :
 		CVideoSurface(screenManager) {
@@ -184,17 +184,16 @@ OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, const CResourceKey
 	}
 }
 
-void OSVideoSurface::setupMap(byte map[0x400], byte val) {
-	byte *pBase = map;
+void OSVideoSurface::setupPalette(byte palette[32][32], byte val) {
 	int incr = 0;
 
-	for (uint idx1 = 0; idx1 < 32; ++idx1, pBase += 32) {
+	for (uint idx1 = 0; idx1 < 32; ++idx1) {
 		for (uint idx2 = 0, base = 0; idx2 < 32; ++idx2, base += incr) {
 			int64 v = 0x84210843;
 			v *= base;
 			v = ((v >> 32) + base) >> 4;
 			v += (v >> 31);
-			pBase[idx2] = v;
+			palette[idx1][idx2] = v;
 
 			if (val != 0xff) {
 				v &= 0xff;
@@ -205,7 +204,7 @@ void OSVideoSurface::setupMap(byte map[0x400], byte val) {
 
 					v >>= 7;
 					v += (v >> 31);
-					pBase[idx2] = v;
+					palette[idx1][idx2] = v;
 				}
 			}
 		}
@@ -377,16 +376,16 @@ void OSVideoSurface::changePixel(uint16 *pixelP, uint16 *color, byte srcVal, boo
 	byte r, g, b;
 	format.colorToRGB(*color, r, g, b);
 	if (remapFlag) {
-		r = _map[0x3e0 - srcVal * 32 + (r >> 2)] << 2;
-		g = _map[0x3e0 - srcVal * 32 + (g >> 2)] << 2;
-		b = _map[0x3e0 - srcVal * 32 + (b >> 2)] << 2;
+		r = _palette[31 - srcVal][r >> 2] << 2;
+		g = _palette[31 - srcVal][g >> 2] << 2;
+		b = _palette[31 - srcVal][b >> 2] << 2;
 	}
 
 	byte r2, g2, b2;
 	format.colorToRGB(*pixelP, r2, g2, b2);
-	r2 = _map[srcVal * 32 + (r2 >> 2)] << 2;
-	g2 = _map[srcVal * 32 + (g2 >> 2)] << 2;
-	b2 = _map[srcVal * 32 + (b2 >> 2)] << 2;
+	r2 = _palette[srcVal][r2 >> 2] << 2;
+	g2 = _palette[srcVal][g2 >> 2] << 2;
+	b2 = _palette[srcVal][b2 >> 2] << 2;
 
 	*pixelP = format.RGBToColor(r + r2, g + g2, b + b2);
 }
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 60315a6..bf2a1a1 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -221,17 +221,17 @@ public:
 class OSVideoSurface : public CVideoSurface {
 	friend class OSMovie;
 private:
-	static byte _map[0x400];
+	static byte _palette[32][32];
 
 	/**
-	 * Setup the color mapping table
+	 * Setup the shading palettes
 	 */
-	static void setupMap(byte map[0x400], byte val);
+	static void setupPalette(byte palette[32][32], byte val);
 public:
 	/**
 	 * Setup statics
 	 */
-	static void setup() { setupMap(_map, 0xff); }
+	static void setup() { setupPalette(_palette, 0xff); }
 public:
 	OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface);
 	OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool flag = false);


Commit: 9205f22a43e6e5ae9a63012fe3ad545150a90b34
    https://github.com/scummvm/scummvm/commit/9205f22a43e6e5ae9a63012fe3ad545150a90b34
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:39-04:00

Commit Message:
TITANIC: Fix generation of shading palettes

Changed paths:
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 6ce4731..cdf9e22 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -164,7 +164,8 @@ bool CVideoSurface::proc45() {
 
 /*------------------------------------------------------------------------*/
 
-byte OSVideoSurface::_palette[32][32];
+byte OSVideoSurface::_palette1[32][32];
+byte OSVideoSurface::_palette2[32][32];
 
 OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface) :
 		CVideoSurface(screenManager) {
@@ -185,27 +186,18 @@ OSVideoSurface::OSVideoSurface(CScreenManager *screenManager, const CResourceKey
 }
 
 void OSVideoSurface::setupPalette(byte palette[32][32], byte val) {
-	int incr = 0;
-
 	for (uint idx1 = 0; idx1 < 32; ++idx1) {
-		for (uint idx2 = 0, base = 0; idx2 < 32; ++idx2, base += incr) {
+		for (uint idx2 = 0, base = 0; idx2 < 32; ++idx2, base += idx1) {
 			int64 v = 0x84210843;
 			v *= base;
-			v = ((v >> 32) + base) >> 4;
-			v += (v >> 31);
+			uint v2 = (v >> 36);
+			v = ((v2 >> 31) + v2) & 0xff;
 			palette[idx1][idx2] = v;
 
-			if (val != 0xff) {
-				v &= 0xff;
-				if (v != idx2) {
-					v = 0x80808081 * val * v * val;
-					v = (v >> 32) + incr;
-					incr = idx1;
-
-					v >>= 7;
-					v += (v >> 31);
-					palette[idx1][idx2] = v;
-				}
+			if (val != 0xff && v != idx2) {
+				v = 0x80808081 * v * val;
+				v2 = v >> 39;
+				palette[idx1][idx2] = (v2 >> 31) + v2;
 			}
 		}
 	}
@@ -376,16 +368,16 @@ void OSVideoSurface::changePixel(uint16 *pixelP, uint16 *color, byte srcVal, boo
 	byte r, g, b;
 	format.colorToRGB(*color, r, g, b);
 	if (remapFlag) {
-		r = _palette[31 - srcVal][r >> 2] << 2;
-		g = _palette[31 - srcVal][g >> 2] << 2;
-		b = _palette[31 - srcVal][b >> 2] << 2;
+		r = _palette1[31 - srcVal][r >> 2] << 2;
+		g = _palette1[31 - srcVal][g >> 2] << 2;
+		b = _palette1[31 - srcVal][b >> 2] << 2;
 	}
 
 	byte r2, g2, b2;
 	format.colorToRGB(*pixelP, r2, g2, b2);
-	r2 = _palette[srcVal][r2 >> 2] << 2;
-	g2 = _palette[srcVal][g2 >> 2] << 2;
-	b2 = _palette[srcVal][b2 >> 2] << 2;
+	r2 = _palette1[srcVal][r2 >> 2] << 2;
+	g2 = _palette1[srcVal][g2 >> 2] << 2;
+	b2 = _palette1[srcVal][b2 >> 2] << 2;
 
 	*pixelP = format.RGBToColor(r + r2, g + g2, b + b2);
 }
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index bf2a1a1..7521a53 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -221,7 +221,8 @@ public:
 class OSVideoSurface : public CVideoSurface {
 	friend class OSMovie;
 private:
-	static byte _palette[32][32];
+	static byte _palette1[32][32];
+	static byte _palette2[32][32];
 
 	/**
 	 * Setup the shading palettes
@@ -231,7 +232,10 @@ public:
 	/**
 	 * Setup statics
 	 */
-	static void setup() { setupPalette(_palette, 0xff); }
+	static void setup() {
+		setupPalette(_palette1, 0xff);
+		setupPalette(_palette2, 0xe0);
+	}
 public:
 	OSVideoSurface(CScreenManager *screenManager, DirectDrawSurface *surface);
 	OSVideoSurface(CScreenManager *screenManager, const CResourceKey &key, bool flag = false);


Commit: e55f634686e06ef9bfca9655b7eca5e2d74b4757
    https://github.com/scummvm/scummvm/commit/e55f634686e06ef9bfca9655b7eca5e2d74b4757
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:40-04:00

Commit Message:
TITANIC: Fix palette usage in changePixel

Changed paths:
    engines/titanic/support/video_surface.cpp



diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index cdf9e22..e5a1e3a 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -362,24 +362,25 @@ uint16 OSVideoSurface::getPixel(const Common::Point &pt) {
 
 void OSVideoSurface::changePixel(uint16 *pixelP, uint16 *color, byte srcVal, bool remapFlag) {
 	assert(getPixelDepth() == 2);
-	const Graphics::PixelFormat &format = _ddSurface->getFormat();
-	
+	const Graphics::PixelFormat &destFormat = _ddSurface->getFormat();
+	const Graphics::PixelFormat srcFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
+
 	// Get the color
 	byte r, g, b;
-	format.colorToRGB(*color, r, g, b);
+	srcFormat.colorToRGB(*color, r, g, b);
 	if (remapFlag) {
-		r = _palette1[31 - srcVal][r >> 2] << 2;
-		g = _palette1[31 - srcVal][g >> 2] << 2;
-		b = _palette1[31 - srcVal][b >> 2] << 2;
+		r = _palette1[31 - srcVal][r >> 3] << 3;
+		g = _palette1[31 - srcVal][g >> 3] << 3;
+		b = _palette1[31 - srcVal][b >> 3] << 3;
 	}
 
 	byte r2, g2, b2;
-	format.colorToRGB(*pixelP, r2, g2, b2);
-	r2 = _palette1[srcVal][r2 >> 2] << 2;
-	g2 = _palette1[srcVal][g2 >> 2] << 2;
-	b2 = _palette1[srcVal][b2 >> 2] << 2;
+	destFormat.colorToRGB(*pixelP, r2, g2, b2);
+	r2 = _palette1[srcVal][r2 >> 3] << 3;
+	g2 = _palette1[srcVal][g2 >> 3] << 3;
+	b2 = _palette1[srcVal][b2 >> 3] << 3;
 
-	*pixelP = format.RGBToColor(r + r2, g + g2, b + b2);
+	*pixelP = destFormat.RGBToColor(r + r2, g + g2, b + b2);
 }
 
 void OSVideoSurface::shiftColors() {


Commit: 210468fae9a51fabe276e8b8485145037dfcb683
    https://github.com/scummvm/scummvm/commit/210468fae9a51fabe276e8b8485145037dfcb683
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:41-04:00

Commit Message:
TITANIC: Minor palette cleanup, remove border from PET Quit view text

Changed paths:
    engines/titanic/pet_control/pet_quit.cpp
    engines/titanic/support/video_surface.cpp



diff --git a/engines/titanic/pet_control/pet_quit.cpp b/engines/titanic/pet_control/pet_quit.cpp
index 6959160..218ed89 100644
--- a/engines/titanic/pet_control/pet_quit.cpp
+++ b/engines/titanic/pet_control/pet_quit.cpp
@@ -35,7 +35,7 @@ bool CPetQuit::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	tempRect.moveTo(322, 407);
 	_text.setBounds(tempRect);
 	_text.resize(3);
-	_text.setHasBorder(true);
+	_text.setHasBorder(false);
 	_text.setup();
 
 	Rect btnRect(0, 0, 68, 52);
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index e5a1e3a..e6b2fa7 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -192,12 +192,12 @@ void OSVideoSurface::setupPalette(byte palette[32][32], byte val) {
 			v *= base;
 			uint v2 = (v >> 36);
 			v = ((v2 >> 31) + v2) & 0xff;
-			palette[idx1][idx2] = v;
+			palette[idx1][idx2] = v << 3;
 
 			if (val != 0xff && v != idx2) {
 				v = 0x80808081 * v * val;
 				v2 = v >> 39;
-				palette[idx1][idx2] = (v2 >> 31) + v2;
+				palette[idx1][idx2] = ((v2 >> 31) + v2) << 3;
 			}
 		}
 	}
@@ -369,16 +369,16 @@ void OSVideoSurface::changePixel(uint16 *pixelP, uint16 *color, byte srcVal, boo
 	byte r, g, b;
 	srcFormat.colorToRGB(*color, r, g, b);
 	if (remapFlag) {
-		r = _palette1[31 - srcVal][r >> 3] << 3;
-		g = _palette1[31 - srcVal][g >> 3] << 3;
-		b = _palette1[31 - srcVal][b >> 3] << 3;
+		r = _palette1[31 - srcVal][r >> 3];
+		g = _palette1[31 - srcVal][g >> 3];
+		b = _palette1[31 - srcVal][b >> 3];
 	}
 
 	byte r2, g2, b2;
 	destFormat.colorToRGB(*pixelP, r2, g2, b2);
-	r2 = _palette1[srcVal][r2 >> 3] << 3;
-	g2 = _palette1[srcVal][g2 >> 3] << 3;
-	b2 = _palette1[srcVal][b2 >> 3] << 3;
+	r2 = _palette1[srcVal][r2 >> 3];
+	g2 = _palette1[srcVal][g2 >> 3];
+	b2 = _palette1[srcVal][b2 >> 3];
 
 	*pixelP = destFormat.RGBToColor(r + r2, g + g2, b + b2);
 }


Commit: 287a9f6ef2ceb1cac4fef74832b3fdee9987ecf1
    https://github.com/scummvm/scummvm/commit/287a9f6ef2ceb1cac4fef74832b3fdee9987ecf1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:42-04:00

Commit Message:
TITANIC: Implement display of tooltips in RealLife

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_real_life.cpp
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_section.cpp



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index ed879f2..96e61c9 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -38,8 +38,15 @@ void CPetGlyph::drawAt(CScreenManager *screenManager, const Point &pt, bool isHi
 	_element.translate(-pt.x, -pt.y);
 }
 
-void CPetGlyph::proc14() {
-	warning("TODO: CPetGlyph::proc14");
+void CPetGlyph::updateTooltip() {
+	CPetText *petText = getPetSection()->getText();
+	if (petText) {
+		petText->setColor(getPetSection()->getColor(0));
+		getTooltip(petText);
+
+		if (_owner)
+			getPetSection()->proc29();
+	}
 }
 
 bool CPetGlyph::contains(const Point &delta, const Point &pt) {
@@ -204,7 +211,7 @@ void CPetGlyphs::changeHighlight(int index) {
 				glyph->highlightCurrent(pt);
 			}
 
-			glyph->proc14();
+			glyph->updateTooltip();
 		}
 	} else if (_owner) {
 		_owner->proc28();
@@ -308,7 +315,7 @@ bool CPetGlyphs::MouseButtonDownMsg(const Point &pt) {
 			if (glyph) {
 				if (_highlightIndex == index) {
 					glyph->MouseButtonDownMsg(glyphRect);
-					glyph->proc14();
+					glyph->updateTooltip();
 				} else {
 					changeHighlight(index);
 					makePetDirty();
@@ -430,7 +437,7 @@ bool CPetGlyphs::highlighted14() {
 	if (_highlightIndex != -1) {
 		CPetGlyph *pet = getGlyph(_highlightIndex);
 		if (pet) {
-			pet->proc14();
+			pet->updateTooltip();
 			return true;
 		}
 	}
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 7920501..12f6687 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -118,7 +118,10 @@ public:
 	 */
 	virtual void draw2(CScreenManager *screenManager) {}
 
-	virtual void proc14();
+	/**
+	 * Updates the tooltip being shown for the glyph
+	 */
+	virtual void updateTooltip();
 
 	/**
 	 * Get the bounds for the glyph
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
index 9d46962..72e350c 100644
--- a/engines/titanic/pet_control/pet_real_life.cpp
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -107,7 +107,7 @@ bool CPetRealLife::setupControl(CPetControl *petControl) {
 		addButton(new CPetSound());
 		addButton(new CPetQuit());
 
-		Rect textRect(0, 0, 32, 436);
+		Rect textRect(0, 0, 276, 30);
 		textRect.moveTo(32, 436);
 		_text.setBounds(textRect);
 		_text.setHasBorder(false);
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index ee63f41..71fa01e 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -187,7 +187,7 @@ bool CPetRooms::setupControl(CPetControl *petControl) {
 void CPetRooms::resetHighlight() {
 	_glyphItem.set34(fn1());
 	_glyphs.resetHighlight();
-	_glyphItem.proc14();
+	_glyphItem.updateTooltip();
 	areaChanged(PET_ROOMS);
 }
 
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp
index 213c93e..8cd9207 100644
--- a/engines/titanic/pet_control/pet_section.cpp
+++ b/engines/titanic/pet_control/pet_section.cpp
@@ -54,11 +54,13 @@ void CPetSection::proc27(int duration) {
 }
 
 void CPetSection::proc28() {
-	error("TODO");
+	CPetText *text = getText();
+	if (text)
+		text->setup();
 }
 
 void CPetSection::proc29() {
-	error("TODO");
+	_petControl->stopPetTimer(0);
 }
 
 void CPetSection::proc30() {


Commit: 01989265aa6abd68f2aa5d799d867886c8ed3799
    https://github.com/scummvm/scummvm/commit/01989265aa6abd68f2aa5d799d867886c8ed3799
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:43-04:00

Commit Message:
TITANIC: PET Conversations now partly rendering

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_gfx_element.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 6776353..bf26898 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -27,7 +27,106 @@
 namespace Titanic {
 
 CPetConversations::CPetConversations() : CPetSection(),
-		_logChanged(false), _field418(0) {
+		_logChanged(false), _field418(0), _npcNum(-1),
+		_rect1(22, 352, 598, 478) {
+	Rect logRect(85, 18, 513, 87);
+	logRect.translate(20, 350);
+	_log.setBounds(logRect);
+	_log.resize(50);
+	_log.setHasBorder(false);
+	_log.setColor(getColor(2));
+	_log.setup();
+	_log.addLine("Welcome to your PET v1.0a");
+
+	Rect inputRect(85, 95, 513, 135);
+	inputRect.translate(20, 350);
+	_textInput.setBounds(inputRect);
+	_textInput.setHasBorder(false);
+	_textInput.resize(2);
+	_textInput.setMaxCharsPerLine(74);
+	_textInput.setColor(getColor(0));
+	_textInput.setup();
+
+	_valArray3[0] = _valArray3[1] = _valArray3[2] = 0;
+}
+
+bool CPetConversations::setup(CPetControl *petControl) {
+	if (petControl && setupControl(petControl))
+		return reset();
+	return false;
+}
+
+bool CPetConversations::reset() {
+	_dials[0].setup(MODE_UNSELECTED, "3PetDial1", _petControl);
+	_dials[1].setup(MODE_UNSELECTED, "3PetDial2", _petControl);
+	_dials[2].setup(MODE_UNSELECTED, "3PetDial3", _petControl);
+	
+	_dialBackground.reset("PetDialBack", _petControl);
+	_scrollUp.reset("PetScrollUp", _petControl);
+	_scrollDown.reset("PetScrollDown", _petControl);
+
+	_doorBot.reset("PetCallDoorOut", _petControl, MODE_UNSELECTED);
+	_doorBot.reset("PetCallDoorIn", _petControl, MODE_SELECTED);
+	_bellBot.reset("PetCallBellOut", _petControl, MODE_UNSELECTED);
+	_doorBot.reset("PetCallBellIn", _petControl, MODE_SELECTED);
+
+	_indent.reset("PetSmallCharacterIndent", _petControl);
+	_splitter.reset("PetSplitter", _petControl);
+
+	_npcIcons[0].setup(MODE_UNSELECTED, "3PetSmlDoorbot", _petControl);
+	_npcIcons[1].setup(MODE_UNSELECTED, "3PetSmlDeskbot", _petControl);
+	_npcIcons[2].setup(MODE_UNSELECTED, "3PetSmlLiftbot", _petControl);
+	_npcIcons[3].setup(MODE_UNSELECTED, "3PetSmlParrot", _petControl);
+	_npcIcons[4].setup(MODE_UNSELECTED, "3PetSmlBarbot", _petControl);
+	_npcIcons[5].setup(MODE_UNSELECTED, "3PetSmlChatterbot", _petControl);
+	_npcIcons[6].setup(MODE_UNSELECTED, "3PetSmlBellbot", _petControl);
+	_npcIcons[7].setup(MODE_UNSELECTED, "3PetSmlMaitreD", _petControl);
+	_npcIcons[8].setup(MODE_UNSELECTED, "3PetSmlSuccubus", _petControl);
+
+	if (_petControl->getPassengerClass() == 1) {
+		uint col = getColor(0);
+		_textInput.setColor(col);
+		_textInput.setLineColor(0, col);
+
+		warning("TODO: Setup log shaded palette?");
+
+		_log.setColor(getColor(2));
+	}
+
+	return true;
+}
+
+void CPetConversations::draw(CScreenManager *screenManager) {
+	_dialBackground.draw(screenManager);
+	_splitter.draw(screenManager);
+	_dials[0].draw(screenManager);
+	_dials[1].draw(screenManager);
+	_dials[2].draw(screenManager);
+
+	_indent.draw(screenManager);
+	_doorBot.draw(screenManager);
+	_bellBot.draw(screenManager);
+	_scrollUp.draw(screenManager);
+	_scrollDown.draw(screenManager);
+	_log.draw(screenManager);
+	_textInput.draw(screenManager);
+
+	if (_logChanged) {
+		int fontNumber = _log.getFontNumber();
+		if (fontNumber >= 0) {
+			warning("TODO conversation draw");
+		}
+
+		_logChanged = false;
+	}
+
+	if (_npcNum >= 0)
+		_npcIcons[_npcNum].draw(screenManager);
+}
+
+Rect CPetConversations::getBounds() {
+	// TODO
+	return Rect();
 }
 
 bool CPetConversations::isValid(CPetControl *petControl) {
@@ -192,16 +291,16 @@ bool CPetConversations::setupControl(CPetControl *petControl) {
 	if (petControl) {
 		_petControl = petControl;
 
-		_val3.setBounds(Rect(0, 0, 21, 130));
-		_val3.translate(20, 350);
+		_dialBackground.setBounds(Rect(0, 0, 21, 130));
+		_dialBackground.translate(20, 350);
 		
 		const Rect rect1(0, 0, 22, 36);
-		_gfxList[0].setBounds(rect1);
-		_gfxList[0].translate(20, 359);
-		_gfxList[1].setBounds(rect1);
-		_gfxList[1].translate(20, 397);
-		_gfxList[2].setBounds(rect1);
-		_gfxList[2].translate(20, 434);
+		_dials[0].setBounds(rect1);
+		_dials[0].translate(20, 359);
+		_dials[1].setBounds(rect1);
+		_dials[1].translate(20, 397);
+		_dials[2].setBounds(rect1);
+		_dials[2].translate(20, 434);
 
 		const Rect rect2(0, 0, 11, 24);
 		_scrollUp.setBounds(rect2);
@@ -215,15 +314,15 @@ bool CPetConversations::setupControl(CPetControl *petControl) {
 		_bellBot.setBounds(rect3);
 		_bellBot.translate(546, 418);
 
-		_val6.setBounds(Rect(0, 0, 37, 70));
-		_val6.translate(46, 374);
-		_val9.setBounds(Rect(0, 0, 435, 3));
-		_val9.translate(102, 441);
+		_indent.setBounds(Rect(0, 0, 37, 70));
+		_indent.translate(46, 374);
+		_splitter.setBounds(Rect(0, 0, 435, 3));
+		_splitter.translate(102, 441);
 
 		const Rect rect4(0, 0, 33, 66);
 		for (int idx = 0; idx < 9; ++idx) {
-			_valArray2[idx].setBounds(rect4);
-			_valArray2[idx].translate(48, 376);
+			_npcIcons[idx].setBounds(rect4);
+			_npcIcons[idx].translate(48, 376);
 		}
 	}
 
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 79f6b59..1bc5941 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -34,17 +34,17 @@ class CPetConversations : public CPetSection {
 private:
 	CPetGfxElement _scrollUp;
 	CPetGfxElement _scrollDown;
-	CPetGfxElement _val3;
-	CPetGfxElement _gfxList[3];
+	CPetGfxElement _dialBackground;
+	CPetGfxElement _dials[3];
 	CPetGfxElement _val4;
 	CPetGfxElement _val5;
-	CPetGfxElement _val6;
-	int  _field14C;
+	CPetGfxElement _indent;
+	Rect _rect1;
 	CPetGfxElement _doorBot;
 	CPetGfxElement _bellBot;
-	CPetGfxElement _val9;
-	CPetGfxElement _valArray2[9];
-	int _field30C;
+	CPetGfxElement _splitter;
+	CPetGfxElement _npcIcons[9];
+	int _npcNum;
 	CPetText _log;
 	CPetText _textInput;
 	int _valArray3[3];
@@ -128,8 +128,29 @@ private:
 	CString getActiveNPCName() const;
 public:
 	CPetConversations();
+	virtual ~CPetConversations() {}
 
 	/**
+	 * Sets up the section
+	 */
+	virtual bool setup(CPetControl *petControl);
+	
+	/**
+	 * Reset the section
+	 */
+	virtual bool reset();
+
+	/**
+	 * Draw the section
+	 */
+	virtual void draw(CScreenManager *screenManager);
+	
+	/**
+	 * Get the bounds for the section
+	 */
+	virtual Rect getBounds();
+	
+	/**
 	 * Returns true if the object is in a valid state
 	 */
 	virtual bool isValid(CPetControl *petControl);
diff --git a/engines/titanic/pet_control/pet_gfx_element.h b/engines/titanic/pet_control/pet_gfx_element.h
index 5bfeca1..f33058f 100644
--- a/engines/titanic/pet_control/pet_gfx_element.h
+++ b/engines/titanic/pet_control/pet_gfx_element.h
@@ -45,7 +45,8 @@ public:
 	/**
 	 * Reset the element
 	 */
-	virtual void reset(const CString &name, CPetControl *petControl, PetElementMode mode);
+	virtual void reset(const CString &name, CPetControl *petControl,
+		PetElementMode mode = MODE_UNSELECTED);
 
 	/**
 	 * Draw the item


Commit: b11033800d1455bd4c35af1126bd4f0cf6b2fb77
    https://github.com/scummvm/scummvm/commit/b11033800d1455bd4c35af1126bd4f0cf6b2fb77
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:44-04:00

Commit Message:
TITANIC: Implementing PET support widgets

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_drag_chev.cpp
    engines/titanic/pet_control/pet_drag_chev.h
    engines/titanic/pet_control/pet_graphic.cpp
    engines/titanic/pet_control/pet_graphic.h
    engines/titanic/pet_control/pet_graphic2.cpp
    engines/titanic/pet_control/pet_graphic2.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index d2af519..6d9f60d 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -721,4 +721,13 @@ bool CGameObject::changeView(const CString &viewName, const CString &clipName) {
 	return true;
 }
 
+void CGameObject::dragMove(const Point &pt) {
+	if (_surface) {
+		_bounds.setWidth(_surface->getWidth());
+		_bounds.setHeight(_surface->getHeight());
+	}
+
+	setPosition(Point(pt.x - _bounds.width() / 2, pt.y - _bounds.height() / 2));
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 94c3e54..847d6cd 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -215,6 +215,11 @@ protected:
 	 * Change the view
 	 */
 	bool changeView(const CString &viewName, const CString &clipName);
+
+	/**
+	 * Support function for drag moving
+	 */
+	void dragMove(const Point &pt);
 public:
 	int _field60;
 	CursorId _cursorId;
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index d67ce54..6be0261 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -348,8 +348,16 @@ void CPetControl::drawSquares(CScreenManager *screenManager, int count) {
 	_frame.drawSquares(screenManager, count);
 }
 
-void CPetControl::displayMessage(const CString &msg) {
-	error("TODO: CPetControl::displayMessage");
+CGameObject *CPetControl::dragEnd(const Point &pt) const {
+	return _currentArea == PET_INVENTORY ? _inventory.dragEnd(pt) : nullptr;
+}
+
+bool CPetControl::checkDragEnd(CGameObject *item) const {
+	return _sections[_currentArea]->checkDragEnd(item);
+}
+
+void CPetControl::displayMessage(const CString &msg) const {
+	_sections[_currentArea]->displayMessage(msg);
 }
 
 CGameObject *CPetControl::getFirstObject() const {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 5fbd8a0..b4c460e 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -207,14 +207,17 @@ public:
 	/**
 	 * Handles drag ends within the PET
 	 */
-	CGameObject *dragEnd(const Point &pt) const {
-		return _currentArea == PET_INVENTORY ? _inventory.dragEnd(pt) : nullptr;
-	}
+	CGameObject *dragEnd(const Point &pt) const;
+
+	/**
+	 * Handles checking when a drag-drop operation ends
+	 */
+	bool checkDragEnd(CGameObject *item) const;
 
 	/**
 	 * Display a message
 	 */
-	void displayMessage(const CString &msg);
+	void displayMessage(const CString &msg) const;
 
 	/**
 	 * Get the first game object stored in the PET
@@ -284,6 +287,7 @@ public:
 	 * Stop a timer
 	 */
 	void stopPetTimer(uint timerIndex);
+
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_drag_chev.cpp b/engines/titanic/pet_control/pet_drag_chev.cpp
index 3c15698..32acf72 100644
--- a/engines/titanic/pet_control/pet_drag_chev.cpp
+++ b/engines/titanic/pet_control/pet_drag_chev.cpp
@@ -21,9 +21,16 @@
  */
 
 #include "titanic/pet_control/pet_drag_chev.h"
+#include "titanic/pet_control/pet_control.h"
+#include "titanic/messages/messages.h"
+#include "titanic/npcs/succubus.h"
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPetDragChev, CPetGraphic2)
+
+END_MESSAGE_MAP()
+
 void CPetDragChev::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CPetGraphic2::save(file, indent);
@@ -34,4 +41,34 @@ void CPetDragChev::load(SimpleFile *file) {
 	CPetGraphic2::load(file);
 }
 
+bool CPetDragChev::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+	getName();
+	return checkStartDragging(msg);
+}
+
+bool CPetDragChev::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
+	dragMove(msg->_mousePos);
+	return true;
+}
+
+bool CPetDragChev::MouseDragEndMsg(CMouseDragEndMsg *msg) {
+	if (msg->_dropTarget) {
+		CSuccUBus *succubus = static_cast<CSuccUBus *>(msg->_dropTarget);
+
+		if (succubus) {
+			CSetChevRoomBits msg(_field54);
+			msg.execute(succubus);
+		} else {
+			CPetControl *petControl = getPetControl();
+			if (petControl && petControl->contains(msg->_mousePos)
+					&& msg->_mousePos.x < 528) {
+				if (petControl->checkDragEnd(this))
+					moveToHiddenRoom();
+			}
+		}
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_drag_chev.h b/engines/titanic/pet_control/pet_drag_chev.h
index 92f3883..4e671ce 100644
--- a/engines/titanic/pet_control/pet_drag_chev.h
+++ b/engines/titanic/pet_control/pet_drag_chev.h
@@ -28,6 +28,11 @@
 namespace Titanic {
 
 class CPetDragChev : public CPetGraphic2 {
+	DECLARE_MESSAGE_MAP
+protected:
+	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
+	bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
+	bool MouseDragEndMsg(CMouseDragEndMsg *msg);
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/pet_control/pet_graphic.cpp b/engines/titanic/pet_control/pet_graphic.cpp
index 3586c4d..797c560 100644
--- a/engines/titanic/pet_control/pet_graphic.cpp
+++ b/engines/titanic/pet_control/pet_graphic.cpp
@@ -24,6 +24,9 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPetGraphic, CGameObject)
+END_MESSAGE_MAP()
+
 void CPetGraphic::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/pet_control/pet_graphic.h b/engines/titanic/pet_control/pet_graphic.h
index 112d75a..d49d0d4 100644
--- a/engines/titanic/pet_control/pet_graphic.h
+++ b/engines/titanic/pet_control/pet_graphic.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CPetGraphic : public CGameObject {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/pet_control/pet_graphic2.cpp b/engines/titanic/pet_control/pet_graphic2.cpp
index d4871e8..ef89819 100644
--- a/engines/titanic/pet_control/pet_graphic2.cpp
+++ b/engines/titanic/pet_control/pet_graphic2.cpp
@@ -24,6 +24,9 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPetGraphic2, CGameObject)
+END_MESSAGE_MAP()
+
 void CPetGraphic2::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/pet_control/pet_graphic2.h b/engines/titanic/pet_control/pet_graphic2.h
index d9bb514..d10dd10 100644
--- a/engines/titanic/pet_control/pet_graphic2.h
+++ b/engines/titanic/pet_control/pet_graphic2.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CPetGraphic2 : public CGameObject {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 692c8b9..faefb99 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -90,7 +90,10 @@ public:
 	virtual bool KeyCharMsg(CKeyCharMsg *msg) { return false; }
 	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) { return false; }
 
-	virtual bool proc14(void *v1) { return false; }
+	/**
+	 * Check whether a drag drop can occur
+	 */
+	virtual bool checkDragEnd(CGameObject *item) { return false; }
 	
 	/**
 	 * Returns item a drag-drop operation has dropped on, if any


Commit: d46d3f7b0dc6f3b401860f6274ebbf04710f06ca
    https://github.com/scummvm/scummvm/commit/d46d3f7b0dc6f3b401860f6274ebbf04710f06ca
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:45-04:00

Commit Message:
TITANIC: Implementing more PET support widgets

Changed paths:
    engines/titanic/pet_control/pet_mode_off.cpp
    engines/titanic/pet_control/pet_mode_off.h
    engines/titanic/pet_control/pet_mode_on.cpp
    engines/titanic/pet_control/pet_mode_on.h
    engines/titanic/pet_control/pet_mode_panel.cpp
    engines/titanic/pet_control/pet_mode_panel.h
    engines/titanic/pet_control/pet_pannel1.cpp
    engines/titanic/pet_control/pet_pannel1.h
    engines/titanic/pet_control/pet_pannel2.cpp
    engines/titanic/pet_control/pet_pannel2.h
    engines/titanic/pet_control/pet_pannel3.cpp
    engines/titanic/pet_control/pet_pannel3.h



diff --git a/engines/titanic/pet_control/pet_mode_off.cpp b/engines/titanic/pet_control/pet_mode_off.cpp
index f4eac74..3d3eb37 100644
--- a/engines/titanic/pet_control/pet_mode_off.cpp
+++ b/engines/titanic/pet_control/pet_mode_off.cpp
@@ -24,6 +24,9 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPetModeOff, CToggleSwitch)
+END_MESSAGE_MAP()
+
 CPetModeOff::CPetModeOff() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/pet_control/pet_mode_off.h b/engines/titanic/pet_control/pet_mode_off.h
index ea88255..a84ed30 100644
--- a/engines/titanic/pet_control/pet_mode_off.h
+++ b/engines/titanic/pet_control/pet_mode_off.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CPetModeOff : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CPetModeOff();
diff --git a/engines/titanic/pet_control/pet_mode_on.cpp b/engines/titanic/pet_control/pet_mode_on.cpp
index 8eb839f..bde318b 100644
--- a/engines/titanic/pet_control/pet_mode_on.cpp
+++ b/engines/titanic/pet_control/pet_mode_on.cpp
@@ -24,6 +24,9 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPetModeOn, CToggleSwitch)
+END_MESSAGE_MAP()
+
 CPetModeOn::CPetModeOn() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/pet_control/pet_mode_on.h b/engines/titanic/pet_control/pet_mode_on.h
index 1434fb2..76e0c92 100644
--- a/engines/titanic/pet_control/pet_mode_on.h
+++ b/engines/titanic/pet_control/pet_mode_on.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CPetModeOn : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CPetModeOn();
diff --git a/engines/titanic/pet_control/pet_mode_panel.cpp b/engines/titanic/pet_control/pet_mode_panel.cpp
index 1919d88..1890f9a 100644
--- a/engines/titanic/pet_control/pet_mode_panel.cpp
+++ b/engines/titanic/pet_control/pet_mode_panel.cpp
@@ -24,6 +24,9 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPetModePanel, CToggleSwitch)
+END_MESSAGE_MAP()
+
 CPetModePanel::CPetModePanel() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/pet_control/pet_mode_panel.h b/engines/titanic/pet_control/pet_mode_panel.h
index ef68ca8..b55f38a 100644
--- a/engines/titanic/pet_control/pet_mode_panel.h
+++ b/engines/titanic/pet_control/pet_mode_panel.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CPetModePanel : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CPetModePanel();
diff --git a/engines/titanic/pet_control/pet_pannel1.cpp b/engines/titanic/pet_control/pet_pannel1.cpp
index 8245d7e..01e2b93 100644
--- a/engines/titanic/pet_control/pet_pannel1.cpp
+++ b/engines/titanic/pet_control/pet_pannel1.cpp
@@ -24,6 +24,9 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPetPannel1, CPetGraphic)
+END_MESSAGE_MAP()
+
 void CPetPannel1::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
diff --git a/engines/titanic/pet_control/pet_pannel1.h b/engines/titanic/pet_control/pet_pannel1.h
index 7a16d8c..4e14536 100644
--- a/engines/titanic/pet_control/pet_pannel1.h
+++ b/engines/titanic/pet_control/pet_pannel1.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CPetPannel1 : public CPetGraphic {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/pet_control/pet_pannel2.cpp b/engines/titanic/pet_control/pet_pannel2.cpp
index a04f63f..e55468d 100644
--- a/engines/titanic/pet_control/pet_pannel2.cpp
+++ b/engines/titanic/pet_control/pet_pannel2.cpp
@@ -24,6 +24,9 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPetPannel2, CPetGraphic)
+END_MESSAGE_MAP()
+
 void CPetPannel2::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
diff --git a/engines/titanic/pet_control/pet_pannel2.h b/engines/titanic/pet_control/pet_pannel2.h
index 7296eab..b32e10e 100644
--- a/engines/titanic/pet_control/pet_pannel2.h
+++ b/engines/titanic/pet_control/pet_pannel2.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CPetPannel2 : public CPetGraphic {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/pet_control/pet_pannel3.cpp b/engines/titanic/pet_control/pet_pannel3.cpp
index 5d0fd93..ea623a3 100644
--- a/engines/titanic/pet_control/pet_pannel3.cpp
+++ b/engines/titanic/pet_control/pet_pannel3.cpp
@@ -24,6 +24,9 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CPetPannel3, CPetGraphic)
+END_MESSAGE_MAP()
+
 void CPetPannel3::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
diff --git a/engines/titanic/pet_control/pet_pannel3.h b/engines/titanic/pet_control/pet_pannel3.h
index 2bdbf1f..f80456f 100644
--- a/engines/titanic/pet_control/pet_pannel3.h
+++ b/engines/titanic/pet_control/pet_pannel3.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CPetPannel3 : public CPetGraphic {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 


Commit: b013d10d8f44e9f611ff205304f451e4e35ee14e
    https://github.com/scummvm/scummvm/commit/b013d10d8f44e9f611ff205304f451e4e35ee14e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:47-04:00

Commit Message:
TITANIC: Implementing PET Nav Helmet section

Changed paths:
  A engines/titanic/pet_control/pet_nav_helmet.cpp
  A engines/titanic/pet_control/pet_nav_helmet.h
  R engines/titanic/pet_control/pet_control_sub5.cpp
  R engines/titanic/pet_control/pet_control_sub5.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_frame.cpp
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 6875e90..80041d8 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -362,12 +362,12 @@ MODULE_OBJS := \
 	pet_control/pet_gfx_element.o \
 	pet_control/pet_inventory.o \
 	pet_control/pet_inventory_glyphs.o \
+	pet_control/pet_nav_helmet.o \
 	pet_control/pet_rooms.o \
 	pet_control/pet_rooms_glyphs.o \
 	pet_control/pet_remote.o \
 	pet_control/pet_real_life.o \
 	pet_control/pet_section.o \
-	pet_control/pet_control_sub5.o \
 	pet_control/pet_control_sub7.o \
 	pet_control/pet_drag_chev.o \
 	pet_control/pet_graphic2.o \
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 6be0261..7a5fc90 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -51,7 +51,7 @@ CPetControl::CPetControl() : CGameObject(),
 	_sections[PET_REMOTE] = &_remote;
 	_sections[PET_ROOMS] = &_rooms;
 	_sections[PET_REAL_LIFE] = &_realLife;
-	_sections[PET_5] = &_sub5;
+	_sections[PET_NAV_HELMET] = &_navHelmet;
 	_sections[PET_6] = &_sub7;
 }
 
@@ -85,7 +85,7 @@ void CPetControl::setup() {
 	_rooms.setup(this);
 	_remote.setup(this);
 	_inventory.setup(this);
-	_sub5.setup(this);
+	_navHelmet.setup(this);
 	_realLife.setup(this);
 	_sub7.setup(this);
 	_frame.setup(this);
@@ -96,7 +96,7 @@ bool CPetControl::isValid() {
 		_rooms.isValid(this) && 
 		_remote.isValid(this) &&
 		_inventory.isValid(this) &&
-		_sub5.isValid(this) &&
+		_navHelmet.isValid(this) &&
 		_realLife.isValid(this) &&
 		_sub7.isValid(this) &&
 		_frame.isValid(this);
@@ -107,7 +107,7 @@ void CPetControl::loadAreas(SimpleFile *file, int param) {
 	_rooms.load(file, param);
 	_remote.load(file, param);
 	_inventory.load(file, param);
-	_sub5.load(file, param);
+	_navHelmet.load(file, param);
 	_realLife.load(file, param);
 	_sub7.load(file, param);
 	_frame.load(file, param);
@@ -118,7 +118,7 @@ void CPetControl::saveAreas(SimpleFile *file, int indent) const {
 	_rooms.save(file, indent);
 	_remote.save(file, indent);
 	_inventory.save(file, indent);
-	_sub5.save(file, indent);
+	_navHelmet.save(file, indent);
 	_realLife.save(file, indent);
 	_sub7.save(file, indent);
 	_frame.save(file, indent);
@@ -163,7 +163,7 @@ void CPetControl::loaded() {
 	_rooms.postLoad();
 	_remote.postLoad();
 	_inventory.postLoad();
-	_sub5.postLoad();
+	_navHelmet.postLoad();
 	_realLife.postLoad();
 	_sub7.postLoad();
 	_frame.postLoad();
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index b4c460e..96c46a6 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -31,10 +31,10 @@
 #include "titanic/pet_control/pet_conversations.h"
 #include "titanic/pet_control/pet_frame.h"
 #include "titanic/pet_control/pet_inventory.h"
+#include "titanic/pet_control/pet_nav_helmet.h"
 #include "titanic/pet_control/pet_real_life.h"
 #include "titanic/pet_control/pet_remote.h"
 #include "titanic/pet_control/pet_rooms.h"
-#include "titanic/pet_control/pet_control_sub5.h"
 #include "titanic/pet_control/pet_control_sub7.h"
 
 namespace Titanic {
@@ -55,10 +55,10 @@ private:
 	CPetSection *_sections[7];
 	CPetConversations _conversations;
 	CPetInventory _inventory;
+	CPetNavHelmet _navHelmet;
 	CPetRemote _remote;
 	CPetRooms _rooms;
 	CPetRealLife _realLife;
-	CPetControlSub5 _sub5;
 	CPetControlSub7 _sub7;
 	CPetFrame _frame;
 	CString _activeNPCName;
diff --git a/engines/titanic/pet_control/pet_control_sub5.cpp b/engines/titanic/pet_control/pet_control_sub5.cpp
deleted file mode 100644
index 0b43853..0000000
--- a/engines/titanic/pet_control/pet_control_sub5.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_control_sub5.h"
-
-namespace Titanic {
-
-CPetControlSub5::CPetControlSub5() :
-	_field98(0), _field9C(0), _fieldA0(0),
-	_field18C(0), _field20C(0), _field210(0) {
-}
-
-void CPetControlSub5::save(SimpleFile *file, int indent) const {
-
-}
-
-void CPetControlSub5::load(SimpleFile *file, int param) {
-	if (!param) {
-		_field20C = file->readNumber();
-		_field210 = file->readNumber();
-	}
-}
-
-bool CPetControlSub5::isValid(CPetControl *petControl) {
-	// TODO
-	return true; 
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub5.h b/engines/titanic/pet_control/pet_control_sub5.h
deleted file mode 100644
index 560803d..0000000
--- a/engines/titanic/pet_control/pet_control_sub5.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB5_H
-#define TITANIC_PET_CONTROL_SUB5_H
-
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_text.h"
-#include "titanic/pet_control/pet_gfx_element.h"
-
-namespace Titanic {
-
-class CPetControlSub5 : public CPetSection {
-private:
-	CPetGfxElement _val1;
-	CPetGfxElement _val2;
-	CPetGfxElement _val3;
-	CPetGfxElement _val4;
-	int _field98;
-	int _field9C;
-	int _fieldA0;
-	CPetGfxElement _valArray1[6];
-	int _field17C;
-	int _field18C;
-	CPetText _text;
-	int _field20C;
-	int _field210;
-public:
-	CPetControlSub5();
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file, int param);
-
-	/**
-	 * Returns true if the object is in a valid state
-	 */
-	virtual bool isValid(CPetControl *petControl);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB5_H */
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index ac4b334..dd2be96 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 
 static const PetArea PET_AREAS[6] = {
 	PET_CONVERSATION, PET_INVENTORY, PET_REMOTE,
-	PET_ROOMS, PET_REAL_LIFE, PET_5
+	PET_ROOMS, PET_REAL_LIFE, PET_NAV_HELMET
 };
 
 CPetFrame::CPetFrame() : CPetSection() {
diff --git a/engines/titanic/pet_control/pet_nav_helmet.cpp b/engines/titanic/pet_control/pet_nav_helmet.cpp
new file mode 100644
index 0000000..13f1989
--- /dev/null
+++ b/engines/titanic/pet_control/pet_nav_helmet.cpp
@@ -0,0 +1,156 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_nav_helmet.h"
+#include "titanic/pet_control/pet_control.h"
+
+namespace Titanic {
+
+CPetNavHelmet::CPetNavHelmet() :
+		_field98(0), _field9C(0), _fieldA0(0), _field18C(0),
+		_field20C(1), _field210(0), _rect1(22, 352, 598, 478) {
+}
+
+bool CPetNavHelmet::setup(CPetControl *petControl) {
+	if (petControl && setupControl(petControl))
+		return reset();
+	return false;
+}
+
+bool CPetNavHelmet::reset() {
+	if (_petControl) {
+		_val1.setup(MODE_UNSELECTED, "3PetStarField", _petControl);
+		_val2.setup(MODE_UNSELECTED, "HomePhotoOnOff", _petControl);
+		_val3.setup(MODE_UNSELECTED, "3PetSetDestin", _petControl);
+		_val3.setup(MODE_SELECTED, "3PetSetDestin1", _petControl);
+		_val4.setup(MODE_UNSELECTED, "3PetStarCtrl", _petControl);
+		
+		_leds[0].setup(MODE_UNSELECTED, "LEDOff1", _petControl);
+		_leds[1].setup(MODE_UNSELECTED, "LEDOn1", _petControl);
+		_leds[2].setup(MODE_UNSELECTED, "LEDOff2", _petControl);
+		_leds[3].setup(MODE_UNSELECTED, "LEDOn2", _petControl);
+		_leds[4].setup(MODE_UNSELECTED, "LEDOff3", _petControl);
+		_leds[5].setup(MODE_UNSELECTED, "LEDOn3", _petControl);
+
+		uint col = getColor(0);
+		_text.setColor(col);
+		_text.setLineColor(0, col);
+	}
+
+	return true;
+}
+
+void CPetNavHelmet::draw(CScreenManager *screenManager) {
+	_petControl->drawSquares(screenManager, 2);
+
+	if (_field20C) {
+		_val2.draw(screenManager);
+	} else {
+		_val4.draw(screenManager);
+	}
+
+	_val3.draw(screenManager);
+	drawButton(_field98, 0, screenManager);
+	drawButton(_field9C, 2, screenManager);
+	drawButton(_fieldA0, 4, screenManager);
+	_text.draw(screenManager);
+}
+
+bool CPetNavHelmet::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	return false;
+}
+
+bool CPetNavHelmet::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+	return false;
+}
+
+bool CPetNavHelmet::isValid(CPetControl *petControl) {
+	return setupControl(petControl);
+}
+
+void CPetNavHelmet::load(SimpleFile *file, int param) {
+	if (!param) {
+		_field20C = file->readNumber();
+		_field210 = file->readNumber();
+	}
+}
+
+void CPetNavHelmet::postLoad() {
+	reset();
+}
+
+void CPetNavHelmet::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(_field20C, indent);
+	file->writeNumberLine(_field210, indent);
+}
+
+bool CPetNavHelmet::setupControl(CPetControl *petControl) {
+	if (petControl) {
+		_petControl = petControl;
+
+		Rect r(0, 0, 64, 64);
+		r.translate(_rect1.left, _rect1.top);
+
+		_val1.setBounds(r);
+		_val1.translate(15, 23);
+		_val2.setBounds(r);
+		_val2.translate(85, 23);
+		_val4.setBounds(r);
+		_val4.translate(85, 23);
+
+		r = Rect(0, 0, 34, 34);
+		r.translate(468, 396);
+		_leds[0].setBounds(r);
+		_leds[1].setBounds(r);
+
+		r.translate(36, 0);
+		_leds[2].setBounds(r);
+		_leds[3].setBounds(r);
+
+		r.translate(36, 0);
+		_leds[4].setBounds(r);
+		_leds[5].setBounds(r);
+
+		r = Rect(0, 0, 157, 51);
+		r.translate(224, 33);
+		r.translate(20, 350);
+		_val3.setBounds(r);
+
+		r = Rect(0, 0, 580, 15);
+		r.translate(32, 445);
+		_text.setBounds(r);
+		_text.setHasBorder(false);
+	}
+
+	return true;
+}
+
+void CPetNavHelmet::drawButton(int offset, int index, CScreenManager *screenManager) {
+	if (_field18C < 4 && (offset / 3) == 1)
+		--offset;
+	if (offset == 2)
+		offset = 1;
+
+	_leds[index + offset].draw(screenManager);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_nav_helmet.h b/engines/titanic/pet_control/pet_nav_helmet.h
new file mode 100644
index 0000000..f47520d
--- /dev/null
+++ b/engines/titanic/pet_control/pet_nav_helmet.h
@@ -0,0 +1,105 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_NAV_HELMET_H
+#define TITANIC_PET_NAV_HELMET_H
+
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_text.h"
+#include "titanic/pet_control/pet_gfx_element.h"
+
+namespace Titanic {
+
+class CPetNavHelmet : public CPetSection {
+private:
+	CPetGfxElement _val1;
+	CPetGfxElement _val2;
+	CPetGfxElement _val3;
+	CPetGfxElement _val4;
+	int _field98;
+	int _field9C;
+	int _fieldA0;
+	CPetGfxElement _leds[6];
+	Rect _rect1;
+	int _field18C;
+	CPetText _text;
+	int _field20C;
+	int _field210;
+private:
+	/**
+	 * Setup the control
+	 */
+	bool setupControl(CPetControl *petControl);
+
+	/**
+	 * Draw a button
+	 */
+	void drawButton(int offset, int index, CScreenManager *screenManager);
+public:
+	CPetNavHelmet();
+
+	/**
+	 * Sets up the section
+	 */
+	virtual bool setup(CPetControl *petControl);
+	
+	/**
+	 * Reset the section
+	 */
+	virtual bool reset();
+
+	/**
+	 * Draw the section
+	 */
+	virtual void draw(CScreenManager *screenManager);
+	
+	/**
+	* Following are handlers for the various messages that the PET can
+	* pass onto the currently active section/area
+	*/
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param);
+
+	/**
+	 * Called after a game has been loaded
+	 */
+	virtual void postLoad();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_NAV_HELMET_H */
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index faefb99..81485ec 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 enum PetArea {
 	PET_INVENTORY = 0, PET_CONVERSATION = 1, PET_REMOTE = 2,
-	PET_ROOMS = 3, PET_REAL_LIFE = 4, PET_5 = 5, PET_6 = 6
+	PET_ROOMS = 3, PET_REAL_LIFE = 4, PET_NAV_HELMET = 5, PET_6 = 6
 };
 
 class CPetControl;


Commit: ecb14e9bc235df216fdcb8426688b455043f2ad0
    https://github.com/scummvm/scummvm/commit/ecb14e9bc235df216fdcb8426688b455043f2ad0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:48-04:00

Commit Message:
TITANIC: Implement more NavHelmet section

Changed paths:
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_nav_helmet.cpp
    engines/titanic/pet_control/pet_nav_helmet.h



diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 96c46a6..7ebdbbd 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -62,7 +62,6 @@ private:
 	CPetControlSub7 _sub7;
 	CPetFrame _frame;
 	CString _activeNPCName;
-	CTreeItem *_treeItem2;
 	CString _string2;
 	CRoomItem *_hiddenRoom;
 	Rect _drawBounds;
@@ -114,6 +113,7 @@ protected:
 public:
 	PetArea _currentArea;
 	CTreeItem *_activeNPC;
+	CTreeItem *_treeItem2;
 public:
 	CLASSDEF
 	CPetControl();
diff --git a/engines/titanic/pet_control/pet_nav_helmet.cpp b/engines/titanic/pet_control/pet_nav_helmet.cpp
index 13f1989..7697df4 100644
--- a/engines/titanic/pet_control/pet_nav_helmet.cpp
+++ b/engines/titanic/pet_control/pet_nav_helmet.cpp
@@ -22,12 +22,13 @@
 
 #include "titanic/pet_control/pet_nav_helmet.h"
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/messages/pet_messages.h"
 
 namespace Titanic {
 
 CPetNavHelmet::CPetNavHelmet() :
 		_field98(0), _field9C(0), _fieldA0(0), _field18C(0),
-		_field20C(1), _field210(0), _rect1(22, 352, 598, 478) {
+		_photoOn(true), _field210(0), _rect1(22, 352, 598, 478) {
 }
 
 bool CPetNavHelmet::setup(CPetControl *petControl) {
@@ -40,8 +41,8 @@ bool CPetNavHelmet::reset() {
 	if (_petControl) {
 		_val1.setup(MODE_UNSELECTED, "3PetStarField", _petControl);
 		_val2.setup(MODE_UNSELECTED, "HomePhotoOnOff", _petControl);
-		_val3.setup(MODE_UNSELECTED, "3PetSetDestin", _petControl);
-		_val3.setup(MODE_SELECTED, "3PetSetDestin1", _petControl);
+		_setDestination.setup(MODE_UNSELECTED, "3PetSetDestin", _petControl);
+		_setDestination.setup(MODE_SELECTED, "3PetSetDestin1", _petControl);
 		_val4.setup(MODE_UNSELECTED, "3PetStarCtrl", _petControl);
 		
 		_leds[0].setup(MODE_UNSELECTED, "LEDOff1", _petControl);
@@ -62,13 +63,13 @@ bool CPetNavHelmet::reset() {
 void CPetNavHelmet::draw(CScreenManager *screenManager) {
 	_petControl->drawSquares(screenManager, 2);
 
-	if (_field20C) {
+	if (_photoOn) {
 		_val2.draw(screenManager);
 	} else {
 		_val4.draw(screenManager);
 	}
 
-	_val3.draw(screenManager);
+	_setDestination.draw(screenManager);
 	drawButton(_field98, 0, screenManager);
 	drawButton(_field9C, 2, screenManager);
 	drawButton(_fieldA0, 4, screenManager);
@@ -76,11 +77,36 @@ void CPetNavHelmet::draw(CScreenManager *screenManager) {
 }
 
 bool CPetNavHelmet::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
-	return false;
+	if (!_petControl->_treeItem2)
+		return false;
+
+	if (_val1.MouseButtonDownMsg(msg->_mousePos)) {
+		CPETHelmetOnOffMsg helmetMsg;
+		helmetMsg.execute(_petControl->_treeItem2);
+	} else if (_val2.MouseButtonDownMsg(msg->_mousePos)) {
+		if (_field210) {
+			_photoOn = !_photoOn;
+			CPETPhotoOnOffMsg photoMsg;
+			photoMsg.execute(_petControl->_treeItem2);
+		} else {
+			_petControl->displayMessage("Please supply Galactic reference material.");
+		}
+	} else if (_setDestination.MouseButtonDownMsg(msg->_mousePos)) {
+		warning("TODO: CPetNavHelmet::MouseButtonDownMsg");
+	}
+
+	return true;
 }
 
 bool CPetNavHelmet::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
-	return false;
+	if (!_petControl->_treeItem2 || !_setDestination.MouseButtonUpMsg(msg->_mousePos))
+		return false;
+
+	if (_petControl) {
+		warning("TODO: CPetNavHelmet::MouseButtonUpMsg");
+	}
+
+	return true;
 }
 
 bool CPetNavHelmet::isValid(CPetControl *petControl) {
@@ -89,7 +115,7 @@ bool CPetNavHelmet::isValid(CPetControl *petControl) {
 
 void CPetNavHelmet::load(SimpleFile *file, int param) {
 	if (!param) {
-		_field20C = file->readNumber();
+		_photoOn = file->readNumber();
 		_field210 = file->readNumber();
 	}
 }
@@ -99,7 +125,7 @@ void CPetNavHelmet::postLoad() {
 }
 
 void CPetNavHelmet::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(_field20C, indent);
+	file->writeNumberLine(_photoOn, indent);
 	file->writeNumberLine(_field210, indent);
 }
 
@@ -133,7 +159,7 @@ bool CPetNavHelmet::setupControl(CPetControl *petControl) {
 		r = Rect(0, 0, 157, 51);
 		r.translate(224, 33);
 		r.translate(20, 350);
-		_val3.setBounds(r);
+		_setDestination.setBounds(r);
 
 		r = Rect(0, 0, 580, 15);
 		r.translate(32, 445);
diff --git a/engines/titanic/pet_control/pet_nav_helmet.h b/engines/titanic/pet_control/pet_nav_helmet.h
index f47520d..09504a1 100644
--- a/engines/titanic/pet_control/pet_nav_helmet.h
+++ b/engines/titanic/pet_control/pet_nav_helmet.h
@@ -33,7 +33,7 @@ class CPetNavHelmet : public CPetSection {
 private:
 	CPetGfxElement _val1;
 	CPetGfxElement _val2;
-	CPetGfxElement _val3;
+	CPetGfxElement _setDestination;
 	CPetGfxElement _val4;
 	int _field98;
 	int _field9C;
@@ -42,7 +42,7 @@ private:
 	Rect _rect1;
 	int _field18C;
 	CPetText _text;
-	int _field20C;
+	bool _photoOn;
 	int _field210;
 private:
 	/**


Commit: a15e299a06c8049cf4332ea2bf4b77ad0bd845e1
    https://github.com/scummvm/scummvm/commit/a15e299a06c8049cf4332ea2bf4b77ad0bd845e1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:49-04:00

Commit Message:
TITANIC: Implement messages PET section

Changed paths:
  A engines/titanic/pet_control/pet_message.cpp
  A engines/titanic/pet_control/pet_message.h
  R engines/titanic/pet_control/pet_control_sub7.cpp
  R engines/titanic/pet_control/pet_control_sub7.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_frame.cpp
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 80041d8..a9d758b 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -362,13 +362,13 @@ MODULE_OBJS := \
 	pet_control/pet_gfx_element.o \
 	pet_control/pet_inventory.o \
 	pet_control/pet_inventory_glyphs.o \
+	pet_control/pet_message.o \
 	pet_control/pet_nav_helmet.o \
 	pet_control/pet_rooms.o \
 	pet_control/pet_rooms_glyphs.o \
 	pet_control/pet_remote.o \
 	pet_control/pet_real_life.o \
 	pet_control/pet_section.o \
-	pet_control/pet_control_sub7.o \
 	pet_control/pet_drag_chev.o \
 	pet_control/pet_graphic2.o \
 	pet_control/pet_graphic.o \
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 7a5fc90..2bd8864 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -52,7 +52,7 @@ CPetControl::CPetControl() : CGameObject(),
 	_sections[PET_ROOMS] = &_rooms;
 	_sections[PET_REAL_LIFE] = &_realLife;
 	_sections[PET_NAV_HELMET] = &_navHelmet;
-	_sections[PET_6] = &_sub7;
+	_sections[PET_MESSAGE] = &_message;
 }
 
 void CPetControl::save(SimpleFile *file, int indent) const {
@@ -87,7 +87,7 @@ void CPetControl::setup() {
 	_inventory.setup(this);
 	_navHelmet.setup(this);
 	_realLife.setup(this);
-	_sub7.setup(this);
+	_message.setup(this);
 	_frame.setup(this);
 }
 
@@ -98,7 +98,7 @@ bool CPetControl::isValid() {
 		_inventory.isValid(this) &&
 		_navHelmet.isValid(this) &&
 		_realLife.isValid(this) &&
-		_sub7.isValid(this) &&
+		_message.isValid(this) &&
 		_frame.isValid(this);
 }
 
@@ -109,7 +109,7 @@ void CPetControl::loadAreas(SimpleFile *file, int param) {
 	_inventory.load(file, param);
 	_navHelmet.load(file, param);
 	_realLife.load(file, param);
-	_sub7.load(file, param);
+	_message.load(file, param);
 	_frame.load(file, param);
 }
 
@@ -120,7 +120,7 @@ void CPetControl::saveAreas(SimpleFile *file, int indent) const {
 	_inventory.save(file, indent);
 	_navHelmet.save(file, indent);
 	_realLife.save(file, indent);
-	_sub7.save(file, indent);
+	_message.save(file, indent);
 	_frame.save(file, indent);
 }
 
@@ -165,7 +165,7 @@ void CPetControl::loaded() {
 	_inventory.postLoad();
 	_navHelmet.postLoad();
 	_realLife.postLoad();
-	_sub7.postLoad();
+	_message.postLoad();
 	_frame.postLoad();
 }
 
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 7ebdbbd..2c70639 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -31,11 +31,11 @@
 #include "titanic/pet_control/pet_conversations.h"
 #include "titanic/pet_control/pet_frame.h"
 #include "titanic/pet_control/pet_inventory.h"
+#include "titanic/pet_control/pet_message.h"
 #include "titanic/pet_control/pet_nav_helmet.h"
 #include "titanic/pet_control/pet_real_life.h"
 #include "titanic/pet_control/pet_remote.h"
 #include "titanic/pet_control/pet_rooms.h"
-#include "titanic/pet_control/pet_control_sub7.h"
 
 namespace Titanic {
 
@@ -59,7 +59,7 @@ private:
 	CPetRemote _remote;
 	CPetRooms _rooms;
 	CPetRealLife _realLife;
-	CPetControlSub7 _sub7;
+	CPetMessage _message;
 	CPetFrame _frame;
 	CString _activeNPCName;
 	CString _string2;
diff --git a/engines/titanic/pet_control/pet_control_sub7.cpp b/engines/titanic/pet_control/pet_control_sub7.cpp
deleted file mode 100644
index 5b03322..0000000
--- a/engines/titanic/pet_control/pet_control_sub7.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_control_sub7.h"
-
-namespace Titanic {
-
-bool CPetControlSub7::isValid(CPetControl *petControl) {
-	// TODO
-	return true;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control_sub7.h b/engines/titanic/pet_control/pet_control_sub7.h
deleted file mode 100644
index 367ce84..0000000
--- a/engines/titanic/pet_control/pet_control_sub7.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_CONTROL_SUB7_H
-#define TITANIC_PET_CONTROL_SUB7_H
-
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_text.h"
-
-namespace Titanic {
-
-class CPetControlSub7 : public CPetSection {
-private:
-	CPetText _text1;
-	CPetText _text2;
-public:
-	/**
-	 * Returns true if the object is in a valid state
-	 */
-	virtual bool isValid(CPetControl *petControl);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_CONTROL_SUB7_H */
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index dd2be96..4c3c518 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -126,7 +126,7 @@ bool CPetFrame::setPetControl(CPetControl *petControl) {
 
 void CPetFrame::setArea(PetArea newArea) {
 	resetArea();
-	if (newArea < PET_6)
+	if (newArea < PET_MESSAGE)
 		_modeButtons[PET_AREAS[newArea]].setMode(MODE_SELECTED);
 }
 
diff --git a/engines/titanic/pet_control/pet_message.cpp b/engines/titanic/pet_control/pet_message.cpp
new file mode 100644
index 0000000..783c901
--- /dev/null
+++ b/engines/titanic/pet_control/pet_message.cpp
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_message.h"
+
+namespace Titanic {
+
+CPetMessage::CPetMessage() {
+	Rect rect1(0, 0, 580, 70);
+	rect1.translate(32, 368);
+	_message.setBounds(rect1);
+	_message.resize(50);
+	_message.setHasBorder(false);
+
+	Rect rect2(0, 0, 580, 15);
+	rect2.translate(32, 445);
+	_tooltip.setBounds(rect2);
+	_tooltip.setHasBorder(false);
+}
+
+bool CPetMessage::setup(CPetControl *petControl) {
+	if (petControl && setupControl(petControl))
+		return reset();
+	return false;
+}
+
+void CPetMessage::draw(CScreenManager *screenManager) {
+	_message.draw(screenManager);
+	_tooltip.draw(screenManager);
+}
+
+bool CPetMessage::setupControl(CPetControl *petControl) {
+	if (petControl)
+		_petControl = petControl;
+	return true;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_message.h b/engines/titanic/pet_control/pet_message.h
new file mode 100644
index 0000000..1ad031d
--- /dev/null
+++ b/engines/titanic/pet_control/pet_message.h
@@ -0,0 +1,96 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_MESSAGE_H
+#define TITANIC_PET_MESSAGE_H
+
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_text.h"
+
+namespace Titanic {
+
+class CPetMessage : public CPetSection {
+private:
+	CPetText _message;
+	CPetText _tooltip;
+private:
+	/**
+	 * Setup the control
+	 */
+	bool setupControl(CPetControl *petControl);
+public:
+	CPetMessage();
+
+	/**
+	 * Sets up the section
+	 */
+	virtual bool setup(CPetControl *petControl);
+	
+	/**
+	 * Reset the section
+	 */
+	virtual bool reset() { return true; }
+
+	/**
+	 * Draw the section
+	 */
+	virtual void draw(CScreenManager *screenManager);
+	
+	/**
+	 * Following are handlers for the various messages that the PET can
+	 * pass onto the currently active section/area
+	 */
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return false; }
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) { return false; }
+
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl) {
+		return setupControl(petControl);
+	}
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param) {}
+
+	/**
+	 * Called after a game has been loaded
+	 */
+	virtual void postLoad() { reset(); }
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const {}
+
+	/**
+	 * Get a reference to the tooltip text associated with the section
+	 */
+	virtual CPetText *getText() { return &_tooltip; }
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_MESSAGE_H */
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 81485ec..0d7ede6 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 enum PetArea {
 	PET_INVENTORY = 0, PET_CONVERSATION = 1, PET_REMOTE = 2,
-	PET_ROOMS = 3, PET_REAL_LIFE = 4, PET_NAV_HELMET = 5, PET_6 = 6
+	PET_ROOMS = 3, PET_REAL_LIFE = 4, PET_NAV_HELMET = 5, PET_MESSAGE = 6
 };
 
 class CPetControl;


Commit: 65dbc2a26505e79c51351eda10195e8425460a87
    https://github.com/scummvm/scummvm/commit/65dbc2a26505e79c51351eda10195e8425460a87
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:50-04:00

Commit Message:
TITANIC: Resolve Pet Text fontNumber fields, getting npc nums

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index bf26898..090952d 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -112,9 +112,11 @@ void CPetConversations::draw(CScreenManager *screenManager) {
 	_textInput.draw(screenManager);
 
 	if (_logChanged) {
-		int fontNumber = _log.getFontNumber();
-		if (fontNumber >= 0) {
-			warning("TODO conversation draw");
+		int startIndex = _log.getLinesStart();
+		if (startIndex >= 0) {
+			int npcNum = _log.getNPCNum(1, startIndex);
+			if (npcNum > 0 && npcNum < 10)
+				_npcNum = npcNum;
 		}
 
 		_logChanged = false;
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 6f870fa..a1cc75c 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -26,10 +26,10 @@ namespace Titanic {
 
 CPetText::CPetText(uint count) :
 		_stringsMerged(false), _maxCharsPerLine(-1), _lineCount(0),
-		_fontNumber1(-1), _field3C(0), _field40(0), _field44(0),
+		_linesStart(-1), _field3C(0), _field40(0), _field44(0),
 		_backR(0xff), _backG(0xff), _backB(0xff), 
 		_textR(0), _textG(0), _textB(200),
-		_fontNumber2(0), _field64(0), _field68(0), _field6C(0),
+		_fontNumber(0), _field64(0), _field68(0), _field6C(0),
 		_hasBorder(true), _scrollTop(0), _textCursor(nullptr), _field7C(0) {
 	setupArrays(count);
 }
@@ -162,11 +162,11 @@ void CPetText::draw(CScreenManager *screenManager) {
 
 	tempRect = _bounds;
 	tempRect.grow(-2);
-	screenManager->setFontNumber(_fontNumber2);
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber);
 
 	screenManager->writeString(SURFACE_BACKBUFFER, tempRect, _scrollTop, _lines, _textCursor);
 
-	screenManager->setFontNumber(_fontNumber1);
+	screenManager->setFontNumber(oldFontNumber);
 }
 
 void CPetText::mergeStrings() {
@@ -255,7 +255,7 @@ void CPetText::updateStr3(int lineNum) {
 
 int CPetText::getTextHeight(CScreenManager *screenManager) {
 	mergeStrings();
-	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber);
 	int textHeight = screenManager->getTextBounds(_lines, _bounds.width());
 	screenManager->setFontNumber(oldFontNumber);
 
@@ -275,28 +275,28 @@ void CPetText::setNPC(int val1, int npcId) {
 }
 
 void CPetText::scrollUp(CScreenManager *screenManager) {
-	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber);
 	_scrollTop -= screenManager->getFontHeight();
 	constrainScrollUp(screenManager);
 	screenManager->setFontNumber(oldFontNumber);
 }
 
 void CPetText::scrollDown(CScreenManager *screenManager) {
-	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber);
 	_scrollTop += screenManager->getFontHeight();
 	constrainScrollDown(screenManager);
 	screenManager->setFontNumber(oldFontNumber);
 }
 
 void CPetText::scrollUpPage(CScreenManager *screenManager) {
-	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber);
 	_scrollTop -= getPageHeight(screenManager);
 	constrainScrollUp(screenManager);
 	screenManager->setFontNumber(oldFontNumber);
 }
 
 void CPetText::scrollDownPage(CScreenManager *screenManager) {
-	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber);
 	_scrollTop += getPageHeight(screenManager);
 	constrainScrollDown(screenManager);
 	screenManager->setFontNumber(oldFontNumber);
@@ -307,7 +307,7 @@ void CPetText::scrollToTop(CScreenManager *screenManager) {
 }
 
 void CPetText::scrollToBottom(CScreenManager *screenManager) {
-	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber);
 	_scrollTop = _bounds.height();
 	constrainScrollDown(screenManager);
 	screenManager->setFontNumber(oldFontNumber);
@@ -330,7 +330,7 @@ void CPetText::constrainScrollDown(CScreenManager *screenManager) {
 
 int CPetText::getPageHeight(CScreenManager *screenManager) {
 	int textHeight = _bounds.height();
-	int oldFontNumber = screenManager->setFontNumber(_fontNumber2);
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber);
 	int fontHeight = screenManager->getFontHeight();
 	screenManager->setFontNumber(oldFontNumber);
 
@@ -410,4 +410,29 @@ void CPetText::hideCursor() {
 	}
 }
 
+int CPetText::getNPCNum(uint npcId, uint startIndex) {
+	if (!_stringsMerged) {
+		mergeStrings();
+		if (!_stringsMerged)
+			return -1;
+	}
+
+	int size = _lines.size();
+	if (startIndex < 5 || startIndex >= size)
+		return -1;
+
+	// Loop through string
+	for (const char *strP = _lines.c_str(); size >= 5; ++strP, --size) {
+		if (*strP == 26) {
+			byte id = *(strP - 2);
+			if (id == npcId)
+				return *(strP - 1);
+		} else if (*strP == 27) {
+			strP += 4;
+		}
+	}
+	
+	return - 1;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 9b914dc..adbd140 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -43,7 +43,7 @@ private:
 	Rect _bounds;
 	int _maxCharsPerLine;
 	int _lineCount;
-	int _fontNumber1;
+	int _linesStart;
 	int _field3C;
 	int _field40;
 	int _field44;
@@ -53,7 +53,7 @@ private:
 	int _textR;
 	int _textG;
 	int _textB;
-	int _fontNumber2;
+	int _fontNumber;
 	int _field64;
 	int _field68;
 	int _field6C;
@@ -175,9 +175,9 @@ public:
 	void setNPC(int val1, int npcId);
 
 	/**
-	 * Get the font
+	 * Get the index into _lines where on-screen text starts
 	 */
-	int getFontNumber() const { return _fontNumber1; }
+	int getLinesStart() const { return _linesStart; }
 
 	/**
 	 * Scroll the text up
@@ -241,6 +241,8 @@ public:
 	 * Removes the cursor attached to the text
 	 */
 	void hideCursor();
+
+	int getNPCNum(uint npcId, uint startIndex);
 };
 
 } // End of namespace Titanic


Commit: 2fb692321165ec5831877fcb60408dd45610f7bb
    https://github.com/scummvm/scummvm/commit/2fb692321165ec5831877fcb60408dd45610f7bb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:51-04:00

Commit Message:
TITANIC: Implement PET Text color remapping

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 090952d..76d2932 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -88,7 +88,11 @@ bool CPetConversations::reset() {
 		_textInput.setColor(col);
 		_textInput.setLineColor(0, col);
 
-		warning("TODO: Setup log shaded palette?");
+		// Replace the log colors with new 1st class ones
+		uint colors1[5], colors2[5];
+		copyColors(2, colors1);
+		copyColors(1, colors2);
+		_log.remapColors(5, colors1, colors2);
 
 		_log.setColor(getColor(2));
 	}
@@ -479,4 +483,9 @@ CString CPetConversations::getActiveNPCName() const {
 		return CString();
 }
 
+void CPetConversations::copyColors(uint tableNum, uint colors[5]) {
+	const uint *src = getColorTable(tableNum);
+	Common::copy(src, src + 5, colors);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 1bc5941..57c7fbd 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -126,6 +126,11 @@ private:
 	 * Returns the name of the currently active NPC, if any
 	 */
 	CString getActiveNPCName() const;
+
+	/**
+	 * Create a color table
+	 */
+	void copyColors(uint tableNum, uint colors[5]);
 public:
 	CPetConversations();
 	virtual ~CPetConversations() {}
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index a1cc75c..1065e6f 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -234,6 +234,31 @@ void CPetText::setColor(byte r, byte g, byte b) {
 	_textB = b;
 }
 
+void CPetText::remapColors(uint count, uint *srcColors, uint *destColors) {
+	if (_lineCount >= 0) {
+		int lineNum = 0;
+		int index1 = 0;
+
+		for (int lineNum = 0; lineNum <= _lineCount; ++lineNum) {
+			// Get the rgb values
+			uint r = _array[lineNum]._rgb[1];
+			uint g = _array[lineNum]._rgb[2];
+			uint b = _array[lineNum]._rgb[3];
+			uint color = r | (g << 8) | (b << 16);
+
+			for (uint index = 0; index < count; ++index) {
+				if (color == srcColors[index]) {
+					// Found a match, so replace the color
+					setLineColor(lineNum, destColors[lineNum]);
+					break;
+				}
+			}
+		}
+	}
+	
+	_stringsMerged = false;
+}
+
 void CPetText::setMaxCharsPerLine(int maxChars) {
 	if (maxChars >= -1 && maxChars < 257)
 		_maxCharsPerLine = maxChars;
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index adbd140..930bf3d 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -242,7 +242,17 @@ public:
 	 */
 	void hideCursor();
 
+	/**
+	 * Get an NPC Number embedded within on-screen text.
+	 * Used by the PET log to encode which NPC spoke
+	 */
 	int getNPCNum(uint npcId, uint startIndex);
+
+	/**
+	 * Replaces any occurances of line colors that appear in the
+	 * first list with the entry at the same index in the dest list
+	 */
+	void remapColors(uint count, uint *srcColors, uint *destColors);
 };
 
 } // End of namespace Titanic


Commit: 2a107eb540d2058ee105b8a362d9288c1e463bfe
    https://github.com/scummvm/scummvm/commit/2a107eb540d2058ee105b8a362d9288c1e463bfe
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:52-04:00

Commit Message:
TITANIC: Simplify PET Element getBounds methods

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_gfx_element.cpp
    engines/titanic/pet_control/pet_gfx_element.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 76d2932..bffcb6d 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -131,8 +131,11 @@ void CPetConversations::draw(CScreenManager *screenManager) {
 }
 
 Rect CPetConversations::getBounds() {
-	// TODO
-	return Rect();
+	Rect rect = _dials[0].getBounds();
+	rect.combine(_dials[1].getBounds());
+	rect.combine(_dials[2].getBounds());
+
+	return rect;
 }
 
 bool CPetConversations::isValid(CPetControl *petControl) {
diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index bc1b8de..da37b35 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -28,9 +28,8 @@ namespace Titanic {
 
 CPetElement::CPetElement() : _mode(MODE_UNSELECTED) {}
 
-void CPetElement::getBounds(Rect *rect) {
-	if (rect)
-		*rect = Rect();
+Rect CPetElement::getBounds() const {
+	return Rect();
 }
 
 bool CPetElement::MouseButtonDownMsg(const Point &pt) {
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index 38f5f53..578f306 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -67,7 +67,7 @@ public:
 	/**
 	 * Get the bounds for the element
 	 */
-	virtual void getBounds(Rect *rect);
+	virtual Rect getBounds() const;
 
 	/**
 	 * Handles processing mouse button down messages
diff --git a/engines/titanic/pet_control/pet_gfx_element.cpp b/engines/titanic/pet_control/pet_gfx_element.cpp
index 491930f..2686bd9 100644
--- a/engines/titanic/pet_control/pet_gfx_element.cpp
+++ b/engines/titanic/pet_control/pet_gfx_element.cpp
@@ -76,17 +76,15 @@ void CPetGfxElement::draw(CScreenManager *screenManager, const Common::Point &de
 		obj->draw(screenManager, destPos);
 }
 
-void CPetGfxElement::getBounds(Rect *rect) {
-	if (rect) {
-		CGameObject *obj = getObject();
-		if (!obj)
-			obj = _object0;
+Rect CPetGfxElement::getBounds() const {
+	CGameObject *obj = getObject();
+	if (!obj)
+		obj = _object0;
 
-		if (obj && obj->getSurface45())
-			*rect = _bounds;
-		else
-			rect->clear();
-	}
+	if (obj && obj->getSurface45())
+		return _bounds;
+	else
+		return Rect();
 }
 
 CGameObject *CPetGfxElement::getObject() const {
diff --git a/engines/titanic/pet_control/pet_gfx_element.h b/engines/titanic/pet_control/pet_gfx_element.h
index f33058f..91d9b9c 100644
--- a/engines/titanic/pet_control/pet_gfx_element.h
+++ b/engines/titanic/pet_control/pet_gfx_element.h
@@ -61,7 +61,7 @@ public:
 	/**
 	 * Get the bounds for the element
 	 */
-	virtual void getBounds(Rect *rect);
+	virtual Rect getBounds() const;
 
 	/**
 	 * Get the game object associated with this item


Commit: 6691dfa408b05d2cb01fb879bc1b2466bf757738
    https://github.com/scummvm/scummvm/commit/6691dfa408b05d2cb01fb879bc1b2466bf757738
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:53-04:00

Commit Message:
TITANIC: Implement PET Conversations dial logic

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_section.cpp
    engines/titanic/pet_control/pet_section.h
    engines/titanic/true_talk/tt_named_script.cpp
    engines/titanic/true_talk/tt_named_script.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index bffcb6d..a62de34 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -47,7 +47,7 @@ CPetConversations::CPetConversations() : CPetSection(),
 	_textInput.setColor(getColor(0));
 	_textInput.setup();
 
-	_valArray3[0] = _valArray3[1] = _valArray3[2] = 0;
+	_npcLevels[0] = _npcLevels[1] = _npcLevels[2] = 0;
 }
 
 bool CPetConversations::setup(CPetControl *petControl) {
@@ -217,7 +217,7 @@ void CPetConversations::load(SimpleFile *file, int param) {
 	_log.load(file, param);
 
 	for (int idx = 0; idx < 3; ++idx)
-		_valArray3[idx] = file->readNumber();
+		_npcLevels[idx] = file->readNumber();
 }
 
 void CPetConversations::postLoad() {
@@ -229,7 +229,7 @@ void CPetConversations::save(SimpleFile *file, int indent) const {
 	_log.save(file, indent);
 
 	for (int idx = 0; idx < 3; ++idx)
-		file->writeNumberLine(_valArray3[idx], indent);
+		file->writeNumberLine(_npcLevels[idx], indent);
 }
 
 void CPetConversations::enter(PetArea oldArea) {
@@ -246,6 +246,19 @@ void CPetConversations::leave() {
 	stopNPCTimer();
 }
 
+void CPetConversations::proc25(int val) {
+	if (val == 1) {
+		proc25(val);
+	} else {
+		CString name = _field418 ? _npcName : getActiveNPCName();
+
+		for (int idx = 0; idx < 3; ++idx) {
+			if (!_dials[idx].hasActiveMovie())
+				updateDial(idx, name);
+		}
+	}
+}
+
 void CPetConversations::displayNPCName(CGameObject *npc) {
 	if (npc) {
 		displayMessage(CString());
@@ -491,4 +504,46 @@ void CPetConversations::copyColors(uint tableNum, uint colors[5]) {
 	Common::copy(src, src + 5, colors);
 }
 
+void CPetConversations::updateDial(uint dialNum, const CString &npcName) {
+	TTNamedScript *script = getNPCScript(npcName);
+	uint newLevel = getDialLevel(dialNum, script);
+	npcDialChange(dialNum, _npcLevels[dialNum], newLevel);
+	_npcLevels[dialNum] = newLevel;
+}
+
+uint CPetConversations::getDialLevel(uint dialNum, TTNamedScript *script, int v) {
+	bool flag = v != 0;
+
+	if (!script)
+		return 0;
+	else
+		return MAX(script->getDialLevel(dialNum), 15);
+}
+
+void CPetConversations::npcDialChange(uint dialNum, int oldLevel, int newLevel) {
+	const uint range1[2] = { 0, 21 };
+	const uint range2[2] = { 22, 43 };
+
+	if (newLevel != oldLevel) {
+		uint src = range1[0], dest = range1[1];
+		if (oldLevel < newLevel) {
+			src = range2[0];
+			dest = range2[1];
+		}
+
+		int64 val1 = (oldLevel * dest) + (100 - oldLevel) * src;
+		val1 *= 0x51EB851F;
+		val1 >>= 37;
+		uint startFrame = val1 + (val1 >> 31);
+
+		int64 val2 = (newLevel * dest) + (100 - newLevel) * src;
+		val2 *= 0x51EB851F;
+		val2 >>= 37;
+		uint endFrame = val2 + (val2 >> 31);
+
+		if (startFrame != endFrame)
+			_dials[dialNum].playMovie(startFrame, endFrame);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 57c7fbd..6e8ffbe 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -47,7 +47,7 @@ private:
 	int _npcNum;
 	CPetText _log;
 	CPetText _textInput;
-	int _valArray3[3];
+	uint _npcLevels[3];
 	bool _logChanged;
 	int _field418;
 	CString _npcName;
@@ -131,6 +131,21 @@ private:
 	 * Create a color table
 	 */
 	void copyColors(uint tableNum, uint colors[5]);
+
+	/**
+	 * Updates one of the dials with data from a given NPC
+	 */
+	void updateDial(uint dialNum, const CString &npcName);
+
+	/**
+	 * Get a dial level
+	 */
+	uint getDialLevel(uint dialNum, TTNamedScript *script, int v = 1);
+
+	/**
+	 * Called when the dial for an NPC is being changed
+	 */
+	void npcDialChange(uint dialNum, int oldLevel, int newLevel);
 public:
 	CPetConversations();
 	virtual ~CPetConversations() {}
@@ -199,6 +214,8 @@ public:
 	 */
 	virtual void leave();
 
+	virtual void proc25(int val);
+
 	/**
 	 * Display a title for an NPC
 	 */
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp
index 8cd9207..7f0a000 100644
--- a/engines/titanic/pet_control/pet_section.cpp
+++ b/engines/titanic/pet_control/pet_section.cpp
@@ -42,8 +42,11 @@ void CPetSection::displayMessage(const CString &msg) {
 	error("TODO");
 }
 
-void CPetSection::proc25() {
-	error("TODO");
+void CPetSection::proc25(int val) {
+	if (!val) {
+		proc28();
+		_petControl->makeDirty();
+	}
 }
 
 void CPetSection::proc27(int duration) {
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 0d7ede6..2a70b1d 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -142,7 +142,7 @@ public:
 	 */
 	virtual void enterRoom(CRoomItem *room) {}
 
-	virtual void proc25();
+	virtual void proc25(int val);
 
 	/**
 	 * Get a reference to the tooltip text associated with the section
diff --git a/engines/titanic/true_talk/tt_named_script.cpp b/engines/titanic/true_talk/tt_named_script.cpp
index 7f4bb5b..9d25320 100644
--- a/engines/titanic/true_talk/tt_named_script.cpp
+++ b/engines/titanic/true_talk/tt_named_script.cpp
@@ -218,7 +218,7 @@ int TTNamedScript::proc34() {
 	return 0;
 }
 
-int TTNamedScript::proc35(int v1, int v2) {
+int TTNamedScript::getDialLevel(uint dialNum, bool flag) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/tt_named_script.h b/engines/titanic/true_talk/tt_named_script.h
index ec5c35c..8174f64 100644
--- a/engines/titanic/true_talk/tt_named_script.h
+++ b/engines/titanic/true_talk/tt_named_script.h
@@ -103,7 +103,12 @@ public:
 	virtual void proc32();
 	virtual void proc33(int v1, int v2);
 	virtual int proc34();
-	virtual int proc35(int v1, int v2);
+
+	/**
+	 * Get the NPC's dial level
+	 */
+	virtual int getDialLevel(uint dialNum, bool flag = true);
+
 	virtual int proc36() const;
 	virtual int proc37() const;
 


Commit: 9d8208bd465a8f42ceb00418d29e9ca55a4d193f
    https://github.com/scummvm/scummvm/commit/9d8208bd465a8f42ceb00418d29e9ca55a4d193f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:55-04:00

Commit Message:
TITANIC: Miscellaneous PET Conversations methods

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index a62de34..c8d17e8 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -216,7 +216,7 @@ void CPetConversations::load(SimpleFile *file, int param) {
 	_textInput.load(file, param);
 	_log.load(file, param);
 
-	for (int idx = 0; idx < 3; ++idx)
+	for (int idx = 0; idx < TOTAL_DIALS; ++idx)
 		_npcLevels[idx] = file->readNumber();
 }
 
@@ -228,7 +228,7 @@ void CPetConversations::save(SimpleFile *file, int indent) const {
 	_textInput.save(file, indent);
 	_log.save(file, indent);
 
-	for (int idx = 0; idx < 3; ++idx)
+	for (int idx = 0; idx < TOTAL_DIALS; ++idx)
 		file->writeNumberLine(_npcLevels[idx], indent);
 }
 
@@ -252,7 +252,7 @@ void CPetConversations::proc25(int val) {
 	} else {
 		CString name = _field418 ? _npcName : getActiveNPCName();
 
-		for (int idx = 0; idx < 3; ++idx) {
+		for (int idx = 0; idx < TOTAL_DIALS; ++idx) {
 			if (!_dials[idx].hasActiveMovie())
 				updateDial(idx, name);
 		}
@@ -301,6 +301,17 @@ void CPetConversations::displayNPCName(CGameObject *npc) {
 	}
 }
 
+void CPetConversations::proc34(const CString &name) {
+	_field418 = 0;
+	resetDials(name);
+	startNPCTimer();
+}
+
+void CPetConversations::proc35() {
+	stopNPCTimer();
+	resetDials("0");
+}
+
 void CPetConversations::showCursor() {
 	_textInput.showCursor(-2);
 }
@@ -546,4 +557,15 @@ void CPetConversations::npcDialChange(uint dialNum, int oldLevel, int newLevel)
 	}
 }
 
+void CPetConversations::resetDials(const CString &name) {
+	TTNamedScript *script = getNPCScript(name);
+
+	for (int idx = 0; idx < TOTAL_DIALS; ++idx) {
+		uint oldLevel = _npcLevels[idx];
+		uint newLevel = getDialLevel(idx, script);
+		npcDialChange(idx, oldLevel, newLevel);
+		_npcLevels[idx] = newLevel;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 6e8ffbe..ec3cdd6 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -30,12 +30,15 @@
 
 namespace Titanic {
 
+#define TOTAL_DIALS 3
+
 class CPetConversations : public CPetSection {
 private:
 	CPetGfxElement _scrollUp;
 	CPetGfxElement _scrollDown;
 	CPetGfxElement _dialBackground;
-	CPetGfxElement _dials[3];
+	CPetGfxElement _dials[TOTAL_DIALS];
+	uint _npcLevels[TOTAL_DIALS];
 	CPetGfxElement _val4;
 	CPetGfxElement _val5;
 	CPetGfxElement _indent;
@@ -47,7 +50,6 @@ private:
 	int _npcNum;
 	CPetText _log;
 	CPetText _textInput;
-	uint _npcLevels[3];
 	bool _logChanged;
 	int _field418;
 	CString _npcName;
@@ -146,6 +148,11 @@ private:
 	 * Called when the dial for an NPC is being changed
 	 */
 	void npcDialChange(uint dialNum, int oldLevel, int newLevel);
+
+	/**
+	 * Reset the dials with those for a given NPC
+	 */
+	void resetDials(const CString &name);
 public:
 	CPetConversations();
 	virtual ~CPetConversations() {}
@@ -221,6 +228,10 @@ public:
 	 */
 	virtual void displayNPCName(CGameObject *npc);
 
+	virtual void proc34(const CString &name);
+
+	virtual void proc35() {}
+
 	/**
 	 * Show the text cursor
 	 */
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 2a70b1d..296479d 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -162,7 +162,9 @@ public:
 	virtual void displayNPCName(CGameObject *npc) {}
 
 	virtual void proc33() {}
-	virtual void proc34() {}
+	
+	virtual void proc34(const CString &name) {}
+	
 	virtual void proc35() {}
 
 	/**


Commit: ce2a9c6f1ba75eedc917deffb79b2531a3d41645
    https://github.com/scummvm/scummvm/commit/ce2a9c6f1ba75eedc917deffb79b2531a3d41645
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:56-04:00

Commit Message:
TITANIC: Minor fleshing out of PET Conversations and Inventory

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_drag_chev.cpp
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index c8d17e8..d4298da 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -528,7 +528,7 @@ uint CPetConversations::getDialLevel(uint dialNum, TTNamedScript *script, int v)
 	if (!script)
 		return 0;
 	else
-		return MAX(script->getDialLevel(dialNum), 15);
+		return MAX(script->getDialLevel(dialNum, flag), 15);
 }
 
 void CPetConversations::npcDialChange(uint dialNum, int oldLevel, int newLevel) {
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index ec3cdd6..9ddc610 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -230,7 +230,7 @@ public:
 
 	virtual void proc34(const CString &name);
 
-	virtual void proc35() {}
+	virtual void proc35();
 
 	/**
 	 * Show the text cursor
diff --git a/engines/titanic/pet_control/pet_drag_chev.cpp b/engines/titanic/pet_control/pet_drag_chev.cpp
index 32acf72..6458041 100644
--- a/engines/titanic/pet_control/pet_drag_chev.cpp
+++ b/engines/titanic/pet_control/pet_drag_chev.cpp
@@ -56,8 +56,8 @@ bool CPetDragChev::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 		CSuccUBus *succubus = static_cast<CSuccUBus *>(msg->_dropTarget);
 
 		if (succubus) {
-			CSetChevRoomBits msg(_field54);
-			msg.execute(succubus);
+			CSetChevRoomBits chevMsg(_field54);
+			chevMsg.execute(succubus);
 		} else {
 			CPetControl *petControl = getPetControl();
 			if (petControl && petControl->contains(msg->_mousePos)
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index c7c6dfd..1ea7806 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 CPetInventory::CPetInventory() : CPetSection(),
-		_field28C(0), _field290(0), _field294(0), _field298(0) {
+		_movie(nullptr), _field290(false), _field294(0), _field298(0) {
 	for (int idx = 0; idx < TOTAL_ITEMS; ++idx) {
 		_itemBackgrounds[idx] = _itemGlyphs[idx] = nullptr;
 	}
@@ -53,8 +53,7 @@ void CPetInventory::draw(CScreenManager *screenManager) {
 }
 
 Rect CPetInventory::getBounds() { 
-	// TODO
-	return Rect(); 
+	return _movie ? _movie->getBounds() : Rect();
 }
 
 CGameObject *CPetInventory::dragEnd(const Point &pt) const {
@@ -200,4 +199,17 @@ CGameObject *CPetInventory::getImage(int index) {
 	return nullptr;
 }
 
+void CPetInventory::setMovie(CGameObject *movie, int flag) {
+	if (_movie)
+		_movie->stopMovie();
+	_movie = movie;
+
+	if (_movie) {
+		if (flag)
+			_movie->playMovie(0, 14, 1);
+		else
+			_movie->playMovie(0);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 969e253..70bcc12 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -39,8 +39,8 @@ private:
 	CPetInventoryGlyphs _items;
 	CGameObject *_itemBackgrounds[46];
 	CGameObject *_itemGlyphs[46];
-	int _field28C;
-	int _field290;
+	CGameObject *_movie;
+	bool _field290;
 	int _field294;
 	int _field298;
 private:
@@ -53,6 +53,11 @@ private:
 	 * Get the index of an item added to the PET
 	 */
 	int getItemIndex(CGameObject *item) const;
+
+	/**
+	 * Set the animated inventory item movie
+	 */
+	void setMovie(CGameObject *movie, int flag);
 public:
 	CPetInventory();
 


Commit: ad02fa76e0bbb81f28610a100aa988f082067c71
    https://github.com/scummvm/scummvm/commit/ad02fa76e0bbb81f28610a100aa988f082067c71
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:57-04:00

Commit Message:
TITANIC: Implement PET Rooms glyphs saving logic

Changed paths:
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h



diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 12f6687..0163f39 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -193,7 +193,7 @@ public:
 	 */
 	virtual void getTooltip(CPetText *text) {}
 
-	virtual void proc32() {}
+	virtual void save2(SimpleFile *file, int indent) {}
 
 	virtual int proc33() { return 1; }
 	virtual int proc34() { return 1; }
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 71fa01e..0a403e6 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -134,7 +134,14 @@ void CPetRooms::postLoad() {
 }
 
 void CPetRooms::save(SimpleFile *file, int indent) const {
-	warning("TODO: CPetRooms::save");
+	_glyphs.save(file, indent);
+	_glyphItem.save2(file, indent);
+	file->writeNumberLine(_field1C0, indent);
+	file->writeNumberLine(_field1C4, indent);
+	file->writeNumberLine(_field1C8, indent);
+	file->writeNumberLine(_field1CC, indent);
+	file->writeNumberLine(_field1D0, indent);
+	file->writeNumberLine(_field1D4, indent);
 }
 
 void CPetRooms::enter(PetArea oldArea) {
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index c45e038..6b762d8 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -72,8 +72,9 @@ int CPetRoomsGlyph::proc29(const Point &pt) {
 	return 0; 
 }
 
-void CPetRoomsGlyph::proc32() {
-
+void CPetRoomsGlyph::save2(SimpleFile *file, int indent) const {
+	file->writeNumberLine(_field34, indent);
+	file->writeNumberLine(_field3C, indent);
 }
 
 int CPetRoomsGlyph::proc33() {
@@ -84,4 +85,13 @@ void CPetRoomsGlyph::proc39() {
 
 }
 
+/*------------------------------------------------------------------------*/
+
+void CPetRoomsGlyphs::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(size(), indent);
+
+	for (const_iterator i = begin(); i != end(); ++i)
+		(*i)->save2(file, indent);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index d08be13..2e8ede2 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -68,12 +68,20 @@ public:
 	virtual void proc28(const Point &pt);
 
 	virtual int proc29(const Point &pt);
-	virtual void proc32();
+
+	virtual void save2(SimpleFile *file, int indent) const;
+	
 	virtual int proc33();
+	
 	virtual void proc39();
 };
 
 class CPetRoomsGlyphs : public CPetGlyphs {
+public:
+	/**
+	 * Save the list
+	 */
+	void save(SimpleFile *file, int indent) const;
 };
 
 } // End of namespace Titanic


Commit: 6b97394ebd577326c8818cfa02b08c119beab8c0
    https://github.com/scummvm/scummvm/commit/6b97394ebd577326c8818cfa02b08c119beab8c0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:58-04:00

Commit Message:
TITANIC: Fully implement PET Rooms loading/saving

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 96e61c9..d1cb384 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -222,6 +222,10 @@ void CPetGlyphs::highlight(int index) {
 	warning("TODO: CPetGlyphs::highlight");
 }
 
+void CPetGlyphs::highlight(const CPetGlyph *glyph) {
+	highlight(indexOf(glyph));
+}
+
 int CPetGlyphs::getHighlightedIndex(int index) {
 	int idx = index - _firstVisibleIndex;
 	return (idx >= 0 && idx < _numVisibleGlyphs) ? idx : -1;
@@ -445,4 +449,14 @@ bool CPetGlyphs::highlighted14() {
 	return false;
 }
 
+int CPetGlyphs::indexOf(const CPetGlyph *glyph) const {
+	int index = 0;
+	for (const_iterator i = begin(); i != end(); ++i, ++index) {
+		if (*i == glyph)
+			return index;
+	}
+
+	return -1;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 0163f39..2aa80db 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -321,11 +321,16 @@ public:
 	void draw(CScreenManager *screenManager);
 
 	/**
-	 * Highlight a specific glyph
+	 * Highlight a specific glyph by indexe
 	 */
 	void highlight(int index);
 
 	/**
+	 * Highlight a specific glyph
+	 */
+	void highlight(const CPetGlyph *glyph);
+
+	/**
 	 * Get the owning section for the glyphs
 	 */
 	CPetSection *getOwner() const { return _owner; }
@@ -398,6 +403,11 @@ public:
 	void resetHighlight() { changeHighlight(-1); }
 
 	bool highlighted14();
+
+	/**
+	 * Returns the index of the specified glyph in the lsit
+	 */
+	int indexOf(const CPetGlyph *glyph) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 0a403e6..7c2b9fb 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -113,9 +113,8 @@ void CPetRooms::load(SimpleFile *file, int param) {
 		int count = file->readNumber();
 
 		for (int idx = 0; idx < count; ++idx) {
-			int v1 = file->readNumber();
-			int v2 = file->readNumber();
-			warning("TODO: CPetRoomsSection::load - %d,%d", v1, v2);
+			CPetRoomsGlyph *glyph = addGlyph(file->readNumber(), false);
+			glyph->set3C(file->readNumber());
 		}
 
 		_glyphItem.set34(file->readNumber());
@@ -134,7 +133,7 @@ void CPetRooms::postLoad() {
 }
 
 void CPetRooms::save(SimpleFile *file, int indent) const {
-	_glyphs.save(file, indent);
+	_glyphs.save2(file, indent);
 	_glyphItem.save2(file, indent);
 	file->writeNumberLine(_field1C0, indent);
 	file->writeNumberLine(_field1C4, indent);
@@ -208,4 +207,17 @@ void CPetRooms::areaChanged(PetArea area) {
 		_petControl->makeDirty();
 }
 
+CPetRoomsGlyph *CPetRooms::addGlyph(int val, bool highlight) {
+	CPetRoomsGlyph *glyph = new CPetRoomsGlyph(val);
+	if (!glyph->setup(_petControl, &_glyphs)) {
+		delete glyph;
+		return nullptr;
+	} else {
+		_glyphs.push_back(glyph);
+		if (highlight)
+			_glyphs.highlight(glyph);
+	}
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index 4c153d7..a0fd3e9 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -68,6 +68,11 @@ private:
 	int fn1();
 
 	void areaChanged(PetArea area);
+
+	/**
+	 * Adds a glyph to the list
+	 */
+	CPetRoomsGlyph *addGlyph(int val, bool highlight);
 public:
 	CPetRooms();
 
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index 6b762d8..57c6e85 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -32,12 +32,10 @@ CPetRoomsGlyph::CPetRoomsGlyph() : CPetGlyph(),
 	_field50(nullptr), _field54(nullptr), _field58(nullptr), _field5C(nullptr) {
 }
 
-void CPetRoomsGlyph::set34(int val) {
-	_field34 = val;
-}
-
-void CPetRoomsGlyph::set38(int val) {
-	_field38 = val;
+CPetRoomsGlyph::CPetRoomsGlyph(int val) : CPetGlyph(),
+	_field34(val), _field38(0), _field3C(0),
+	_field40(nullptr), _field44(nullptr), _field48(nullptr), _field4C(nullptr),
+	_field50(nullptr), _field54(nullptr), _field58(nullptr), _field5C(nullptr) {
 }
 
 bool CPetRoomsGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
@@ -87,7 +85,7 @@ void CPetRoomsGlyph::proc39() {
 
 /*------------------------------------------------------------------------*/
 
-void CPetRoomsGlyphs::save(SimpleFile *file, int indent) const {
+void CPetRoomsGlyphs::save2(SimpleFile *file, int indent) const {
 	file->writeNumberLine(size(), indent);
 
 	for (const_iterator i = begin(); i != end(); ++i)
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index 2e8ede2..3f37bdb 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -42,10 +42,13 @@ protected:
 	CGameObject *_field5C;
 public:
 	CPetRoomsGlyph();
+	CPetRoomsGlyph(int val);
 
-	void set34(int val);
+	void set34(int val) { _field34 = val; }
 
-	void set38(int val);
+	void set38(int val) { _field38 = val; }
+
+	void set3C(int val) { _field3C = val; }
 
 	/**
 	 * Setup the glyph
@@ -77,11 +80,12 @@ public:
 };
 
 class CPetRoomsGlyphs : public CPetGlyphs {
+private:
 public:
 	/**
 	 * Save the list
 	 */
-	void save(SimpleFile *file, int indent) const;
+	void save2(SimpleFile *file, int indent) const;
 };
 
 } // End of namespace Titanic


Commit: 21f98fff46e48e79d3e977d4f20edf90022a825a
    https://github.com/scummvm/scummvm/commit/21f98fff46e48e79d3e977d4f20edf90022a825a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:37:59-04:00

Commit Message:
TITANIC: Fix cursor and entering text in PET Conversations area

Changed paths:
    engines/titanic/input_translator.cpp
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/support/screen_manager.cpp
    engines/titanic/support/text_cursor.cpp



diff --git a/engines/titanic/input_translator.cpp b/engines/titanic/input_translator.cpp
index 499d0f6..571b6df 100644
--- a/engines/titanic/input_translator.cpp
+++ b/engines/titanic/input_translator.cpp
@@ -100,7 +100,7 @@ void CInputTranslator::keyDown(const Common::KeyState &keyState) {
 		_inputHandler->handleMessage(msg);
 	}
 
-	if (keyState.ascii >= 32 && keyState.ascii <= 127) {
+	if (keyState.ascii <= 127) {
 		CKeyCharMsg msg(keyState.ascii);
 		_inputHandler->handleMessage(msg);
 	}
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index d4298da..eb2f971 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -465,17 +465,12 @@ bool CPetConversations::handleKey(const Common::KeyState &keyState) {
 	case Common::KEYCODE_KP1:
 		scrollToBottom();
 		break;
-	case Common::KEYCODE_BACKSPACE:
-		// Erase key in text input
-		_textInput.handleKey((char)Common::KEYCODE_BACKSPACE);
-	case Common::KEYCODE_RETURN:
-	case Common::KEYCODE_KP_ENTER:
-		// Text line finished
-		textLineEntered(_textInput.getText());
-		return true;
 	default:
-		if (keyState.ascii >= 32 && keyState.ascii)
-			_textInput.handleKey(keyState.ascii);
+		if (keyState.ascii > 0 && keyState.ascii) {
+			if (_textInput.handleKey(keyState.ascii))
+				// Text line finished, so process line
+				textLineEntered(_textInput.getText());
+		}
 		return true;
 	}
 
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 1065e6f..1d27402 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -192,7 +192,7 @@ void CPetText::resize(uint count) {
 
 CString CPetText::getText() const {
 	CString result = "";
-	for (int idx = 0; idx < _lineCount; ++idx)
+	for (int idx = 0; idx <= _lineCount; ++idx)
 		result += _array[idx]._line;
 
 	return result;
diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp
index 1a43d78..b0e249d 100644
--- a/engines/titanic/support/screen_manager.cpp
+++ b/engines/titanic/support/screen_manager.cpp
@@ -116,7 +116,9 @@ void OSScreenManager::setMode(int width, int height, int bpp, uint numBackSurfac
 }
 
 void OSScreenManager::drawCursors() {
-	// Nothing needed here, since ScummVM handles cursor drawing
+	// The original did both text and mouse cursor drawing here.
+	// For ScummVM, we only need to worry about the text cursor
+	_textCursor->draw();
 }
 
 DirectDrawSurface *OSScreenManager::getDDSurface(SurfaceNum surfaceNum) {
diff --git a/engines/titanic/support/text_cursor.cpp b/engines/titanic/support/text_cursor.cpp
index dc78d53..ad3fe4e 100644
--- a/engines/titanic/support/text_cursor.cpp
+++ b/engines/titanic/support/text_cursor.cpp
@@ -80,10 +80,8 @@ void CTextCursor::draw() {
 			_backRenderSurface->_ddSurface->fillRect(&cursorRect,
 				_cursorR, _cursorG, _cursorB);
 		}
-	}
-
-	if (_active && _blinkVisible) {
-		_screenManager->blitFrom(SURFACE_BACKBUFFER, _surface, &_pos);
+	
+		//_screenManager->blitFrom(SURFACE_BACKBUFFER, _surface, &_pos);
 	}
 }
 


Commit: f01b8e9c45e3349c84346f270c17610b0e5350b0
    https://github.com/scummvm/scummvm/commit/f01b8e9c45e3349c84346f270c17610b0e5350b0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:00-04:00

Commit Message:
TITANIC: Fix multi-line text writing

Changed paths:
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/support/font.cpp
    engines/titanic/support/font.h



diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 1d27402..a4e0042 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -267,7 +267,7 @@ void CPetText::setMaxCharsPerLine(int maxChars) {
 void CPetText::updateStr3(int lineNum) {
 	if (_field64 > 0 && _field68 > 0) {
 		char line[5];
-		line[0] = line[3] = TEXTCMD_26;
+		line[0] = line[3] = TEXTCMD_NPC;
 		line[1] = _field64;
 		line[2] = _field68;
 		line[4] = '\0';
@@ -333,7 +333,7 @@ void CPetText::scrollToTop(CScreenManager *screenManager) {
 
 void CPetText::scrollToBottom(CScreenManager *screenManager) {
 	int oldFontNumber = screenManager->setFontNumber(_fontNumber);
-	_scrollTop = _bounds.height();
+	_scrollTop = getTextHeight(screenManager);
 	constrainScrollDown(screenManager);
 	screenManager->setFontNumber(oldFontNumber);
 }
@@ -345,7 +345,7 @@ void CPetText::constrainScrollUp(CScreenManager *screenManager) {
 
 void CPetText::constrainScrollDown(CScreenManager *screenManager) {
 	// Figure out the maximum scroll amount allowed
-	int maxScroll = _bounds.height() - getTextHeight(screenManager) - 4;
+	int maxScroll = getTextHeight(screenManager) - _bounds.height() - 4;
 	if (maxScroll < 0)
 		maxScroll = 0;
 
diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index 3d5705a..cc93bbb 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -84,7 +84,7 @@ int STFont::getTextBounds(const CString &str, int maxWidth, Point *sizeOut) cons
 	// Loop through the characters of the string
 	if (!str.empty()) {
 		for (const char *strP = str.c_str(); *strP; ++strP) {
-			if (*strP == TEXTCMD_26) {
+			if (*strP == TEXTCMD_NPC) {
 				strP += 3;
 			} else if (*strP == TEXTCMD_SET_COLOR) {
 				strP += 4;
@@ -141,7 +141,7 @@ int STFont::writeString(CVideoSurface *surface, const Rect &rect1, const Rect &d
 	const char *endP = nullptr;
 	const char *strEndP = str.c_str() + str.size() - 1;
 	for (const char *srcP = str.c_str(); *srcP; ++srcP) {
-		if (*srcP == TEXTCMD_26) {
+		if (*srcP == TEXTCMD_NPC) {
 			srcP += 3;
 		} else if (*srcP == TEXTCMD_SET_COLOR) {
 			// Change the color used for characters
@@ -159,10 +159,10 @@ int STFont::writeString(CVideoSurface *surface, const Rect &rect1, const Rect &d
 			}
 
 			if (*srcP != '\n') {
-				int result = writeChar(surface, *srcP, textSize, rect1, &destBounds);
-				if (result == -2)
+				WriteCharacterResult result = writeChar(surface, *srcP, textSize, rect1, &destBounds);
+				if (result == WC_OUTSIDE_BOTTOM)
 					return endP - str.c_str();
-				else if (!result)
+				else if (result == WC_IN_BOUNDS)
 					endP = srcP;
 			}
 
@@ -176,10 +176,10 @@ int STFont::writeString(CVideoSurface *surface, const Rect &rect1, const Rect &d
 		textCursor->setPos(cursorPos);
 	}
 
-	return endP - str.c_str();
+	return endP ? endP - str.c_str() : 0;
 }
 
-int STFont::writeChar(CVideoSurface *surface, unsigned char c, const Point &pt,
+WriteCharacterResult STFont::writeChar(CVideoSurface *surface, unsigned char c, const Point &pt,
 	const Rect &destRect, const Rect *srcRect) {
 	if (c == 233)
 		c = '$';
@@ -194,7 +194,7 @@ int STFont::writeChar(CVideoSurface *surface, unsigned char c, const Point &pt,
 	if (srcRect->isEmpty())
 		srcRect = &destRect;
 	if (destPos.y > srcRect->bottom)
-		return -2;
+		return WC_OUTSIDE_BOTTOM;
 
 	if ((destPos.y + tempRect.height()) > srcRect->bottom) {
 		tempRect.bottom += tempRect.top - destPos.y;
@@ -202,7 +202,7 @@ int STFont::writeChar(CVideoSurface *surface, unsigned char c, const Point &pt,
 
 	if (destPos.y < srcRect->top) {
 		if ((tempRect.height() + destPos.y) < srcRect->top)
-			return -1;
+			return WC_OUTSIDE_TOP;
 
 		tempRect.top += srcRect->top - destPos.y;
 		destPos.y = srcRect->top;
@@ -210,21 +210,21 @@ int STFont::writeChar(CVideoSurface *surface, unsigned char c, const Point &pt,
 
 	if (destPos.x < srcRect->left) {
 		if ((tempRect.width() + destPos.x) < srcRect->left)
-			return -3;
+			return WC_OUTSIDE_LEFT;
 
 		tempRect.left += srcRect->left - destPos.x;
 		destPos.x = srcRect->left;
 	} else {
 		if ((tempRect.width() + destPos.x) > srcRect->right) {
 			if (destPos.x > srcRect->right)
-				return -4;
+				return WC_OUTSIDE_RIGHT;
 
 			tempRect.right += srcRect->left - destPos.x;
 		}
 	}
 
 	copyRect(surface, destPos, tempRect);
-	return 0;
+	return WC_IN_BOUNDS;
 }
 
 void STFont::copyRect(CVideoSurface *surface, const Point &pt, Rect &rect) {
@@ -247,7 +247,7 @@ void STFont::copyRect(CVideoSurface *surface, const Point &pt, Rect &rect) {
 void STFont::extendBounds(Point &textSize, byte c, int maxWidth) const {
 	textSize.x += _chars[c]._width;
 
-	if (textSize.x == '\n' || textSize.x > maxWidth) {
+	if (c == '\n' || textSize.x > maxWidth) {
 		textSize.x = 0;
 		textSize.y += _fontHeight;
 	}
@@ -260,7 +260,7 @@ void STFont::checkLineWrap(Point &textSize, int maxWidth, const char *&str) cons
 		if (*srcPtr == ' ' && flag)
 			break;
 
-		if (*srcPtr == TEXTCMD_26)
+		if (*srcPtr == TEXTCMD_NPC)
 			srcPtr += 3;
 		else if (*srcPtr == TEXTCMD_SET_COLOR)
 			srcPtr += 4;
diff --git a/engines/titanic/support/font.h b/engines/titanic/support/font.h
index 75c91f3..591fb46 100644
--- a/engines/titanic/support/font.h
+++ b/engines/titanic/support/font.h
@@ -31,7 +31,12 @@
 
 namespace Titanic {
 
-enum TextCommand { TEXTCMD_26 = 26, TEXTCMD_SET_COLOR = 27 };
+enum TextCommand { TEXTCMD_NPC = 26, TEXTCMD_SET_COLOR = 27 };
+
+enum WriteCharacterResult {
+	WC_IN_BOUNDS = 0, WC_OUTSIDE_TOP = -1, WC_OUTSIDE_BOTTOM = -2,
+	WC_OUTSIDE_LEFT = -3, WC_OUTSIDE_RIGHT = -4
+};
 
 class CVideoSurface;
 
@@ -51,7 +56,7 @@ private:
 	/**
 	 * Write a character
 	 */
-	int writeChar(CVideoSurface *surface, unsigned char c, 
+	WriteCharacterResult writeChar(CVideoSurface *surface, unsigned char c, 
 		const Common::Point &pt, const Rect &destRect, const Rect *srcRect);
 
 	/**
@@ -87,6 +92,8 @@ public:
 
 	/**
 	 * Write a string to the specified surface
+	 * @returns		The index of the last character that was visible
+	 *				with the drawing area
 	 */
 	int writeString(CVideoSurface *surface, const Rect &rect1, const Rect &destRect,
 		int yOffset, const CString &str, CTextCursor *textCursor);


Commit: 6c2949ba2388ef949ee4148fcf0ee424a90fe4f0
    https://github.com/scummvm/scummvm/commit/6c2949ba2388ef949ee4148fcf0ee424a90fe4f0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:01-04:00

Commit Message:
TITANIC: Fix PET Conversations scroll buttons

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index eb2f971..8104340 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -143,9 +143,15 @@ bool CPetConversations::isValid(CPetControl *petControl) {
 }
 
 bool CPetConversations::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	if (_scrollDown.MouseButtonDownMsg(msg->_mousePos)) {
+		scrollDown();
+		return true;
+	} else if (_scrollUp.MouseButtonDownMsg(msg->_mousePos)) {
+		scrollUp();
+		return true;
+	}
+
 	return
-		_scrollUp.MouseButtonDownMsg(msg->_mousePos) ||
-		_scrollDown.MouseButtonDownMsg(msg->_mousePos) ||
 		_doorBot.MouseButtonDownMsg(msg->_mousePos) ||
 		_bellBot.MouseButtonDownMsg(msg->_mousePos);
 }


Commit: 93f88cc668f15a4c2b411c99b3f07e2f03bee50a
    https://github.com/scummvm/scummvm/commit/93f88cc668f15a4c2b411c99b3f07e2f03bee50a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:02-04:00

Commit Message:
TITANIC: Fix PET Conversations doorbot/bellbot icons

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 8104340..9b7b277 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -68,7 +68,7 @@ bool CPetConversations::reset() {
 	_doorBot.reset("PetCallDoorOut", _petControl, MODE_UNSELECTED);
 	_doorBot.reset("PetCallDoorIn", _petControl, MODE_SELECTED);
 	_bellBot.reset("PetCallBellOut", _petControl, MODE_UNSELECTED);
-	_doorBot.reset("PetCallBellIn", _petControl, MODE_SELECTED);
+	_bellBot.reset("PetCallBellIn", _petControl, MODE_SELECTED);
 
 	_indent.reset("PetSmallCharacterIndent", _petControl);
 	_splitter.reset("PetSplitter", _petControl);


Commit: 8a6a5ad5c10b682bef145b414ebed386aa7df842
    https://github.com/scummvm/scummvm/commit/8a6a5ad5c10b682bef145b414ebed386aa7df842
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:04-04:00

Commit Message:
TITANIC: In progress implementation of PET Remote

Changed paths:
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_remote.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h
    engines/titanic/pet_control/pet_section.cpp
    engines/titanic/pet_control/pet_section.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index 4463c31..1aef2bc 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -21,12 +21,206 @@
  */
 
 #include "titanic/pet_control/pet_remote.h"
+#include "titanic/pet_control/pet_control.h"
+#include "titanic/game_manager.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
+CPetRemote::CPetRemote() : CPetSection() {
+}
+
+bool CPetRemote::setup(CPetControl *petControl) {
+	if (petControl && setupControl(petControl))
+		return reset();
+	return false;
+}
+
+bool CPetRemote::reset() {
+	if (_petControl) {
+		_onOff.reset("PetSwitchOn", _petControl, MODE_SELECTED);
+		_onOff.reset("PetSwitchOff", _petControl, MODE_UNSELECTED);
+
+		_up.reset("PetUp", _petControl, MODE_UNSELECTED);
+		_down.reset("PetDown", _petControl, MODE_UNSELECTED);
+
+		_left.reset("PetLeftUp", _petControl, MODE_SELECTED);
+		_left.reset("PetLeft", _petControl, MODE_UNSELECTED);
+		_right.reset("PetRightUp", _petControl, MODE_SELECTED);
+		_right.reset("PetRight", _petControl, MODE_UNSELECTED);
+		_top.reset("PetTopUp", _petControl, MODE_SELECTED);
+		_top.reset("PetTop", _petControl, MODE_UNSELECTED);
+		_bottom.reset("PetBottomUp", _petControl, MODE_SELECTED);
+		_bottom.reset("PetBottom", _petControl, MODE_UNSELECTED);
+		_action.reset("PetActionUp", _petControl, MODE_SELECTED);
+		_action.reset("PetAction", _petControl, MODE_UNSELECTED);
+
+		_send.reset("PetActSend0", _petControl, MODE_UNSELECTED);
+		_send.reset("PetActSend1", _petControl, MODE_SELECTED);
+		_receive.reset("PetActReceive0", _petControl, MODE_UNSELECTED);
+		_receive.reset("PetActReceive1", _petControl, MODE_SELECTED);
+		_call.reset("PetActCall0", _petControl, MODE_UNSELECTED);
+		_call.reset("PetActCall1", _petControl, MODE_SELECTED);
+
+		_items.reset();
+		uint col = getColor(0);
+		_text.setColor(col);
+		_text.setLineColor(0, col);
+	}
+
+	return true;
+}
+
+void CPetRemote::draw(CScreenManager *screenManager) {
+	_petControl->drawSquares(screenManager, 6);
+	_items.draw(screenManager);
+	_text.draw(screenManager);
+}
+
+bool CPetRemote::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	return _items.MouseButtonDownMsg(msg->_mousePos);
+}
+
+bool CPetRemote::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+	return _items.MouseButtonUpMsg(msg->_mousePos);
+}
+
+bool CPetRemote::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
+	return _items.MouseButtonDownMsg(msg->_mousePos);
+}
+
+bool CPetRemote::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
+	return _items.VirtualKeyCharMsg(msg->_keyState.keycode);
+}
+
 bool CPetRemote::isValid(CPetControl *petControl) {
+	return setupControl(petControl);
+}
+
+void CPetRemote::postLoad() {
+	reset();
+	CRoomItem *room = getRoom();
+	if (room)
+		enterRoom(room);
+}
+
+void CPetRemote::enter(PetArea oldArea) {
+	if (_items.highlighted14())
+		_text.setText(CString());
+}
+
+void CPetRemote::enterRoom(CRoomItem *room) {
 	// TODO
+}
+
+CPetText *CPetRemote::getText() {
+	return &_text;
+}
+
+CPetElement *CPetRemote::getElement(uint id) {
+	switch (id) {
+	case 0:
+		return &_onOff;
+	case 1:
+		return &_up;
+	case 2:
+		return &_down;
+	case 3:
+		return &_left;
+	case 4:
+		return &_right;
+	case 5:
+		return &_top;
+	case 6:
+		return &_bottom;
+	case 7:
+		return &_action;
+	case 16:
+		return &_send;
+	case 17:
+		return &_receive;
+	case 18:
+		return &_call;
+	default:
+		return nullptr;
+	}
+}
+
+void CPetRemote::proc38(int val) {
+	int highlightIndex = getHighlightIndex(val);
+	if (highlightIndex != -1)
+		_items.highlight(highlightIndex);
+}
+
+bool CPetRemote::setupControl(CPetControl *petControl) {
+	_petControl = petControl;
+	if (!petControl)
+		return false;
+
+	_onOff.setBounds(Rect(0, 0, 15, 43));
+	_onOff.translate(519, 381);
+	_up.setBounds(Rect(0, 0, 21, 24));
+	_up.translate(551, 381);
+	_down.setBounds(Rect(0, 0, 21, 24));
+	_down.translate(551, 402);
+	_left.setBounds(Rect(0, 0, 22, 21));
+	_left.translate(518, 393);
+	_right.setBounds(Rect(0, 0, 21, 21));
+	_right.translate(560, 393);
+	_top.setBounds(Rect(0, 0, 21, 22));
+	_top.translate(539, 371);
+	_bottom.setBounds(Rect(0, 0, 21, 22));
+	_bottom.translate(539, 414);
+	_action.setBounds(Rect(0, 0, 21, 21));
+	_action.translate(539, 393);
+	_send.setBounds(Rect(0, 0, 62, 38));
+	_send.translate(503, 373);
+	_receive.setBounds(Rect(0, 0, 62, 38));
+	_receive.translate(503, 420);
+	_call.setBounds(Rect(0, 0, 62, 38));
+	_call.translate(503, 383);
+
+	Rect rect(0, 0, 580, 15);
+	rect.moveTo(32, 445);
+	_text.setBounds(rect);
+	_text.setHasBorder(false);
+
+	_items.setup(6, this);
+	_items.setFlags(19);
 	return true;
 }
 
+CRoomItem *CPetRemote::getRoom() const {
+	if (_petControl) {
+		CGameManager *gameManager = _petControl->getGameManager();
+		if (gameManager)
+			return gameManager->getRoom();
+	}
+
+	return nullptr;
+}
+
+int CPetRemote::getHighlightIndex(int val) {
+	CRoomItem *room = getRoom();
+	if (!room)
+		return -1;
+
+	int roomIndex = roomIndexOf(room->getName());
+	if (roomIndex == -1)
+		return -1;
+
+	// TODO: more
+
+	return -1;
+}
+
+int CPetRemote::roomIndexOf(const CString &name) {
+	for (int idx = 0; idx < TOTAL_ROOMS; ++idx) {
+		if (g_vm->_roomNames[idx] == name)
+			return idx;
+	}
+
+	return -1;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote.h b/engines/titanic/pet_control/pet_remote.h
index 70f6c32..5db7e7f 100644
--- a/engines/titanic/pet_control/pet_remote.h
+++ b/engines/titanic/pet_control/pet_remote.h
@@ -36,23 +36,96 @@ class CPetRemoteGlyphs : public CPetGlyphs {
 class CPetRemote : public CPetSection {
 private:
 	CPetRemoteGlyphs _items;
-	CPetGfxElement _val1;
-	CPetGfxElement _val2;
-	CPetGfxElement _val3;
-	CPetGfxElement _val4;
-	CPetGfxElement _val5;
-	CPetGfxElement _val6;
-	CPetGfxElement _val7;
-	CPetGfxElement _val8;
-	CPetGfxElement _val9;
-	CPetGfxElement _val10;
-	CPetGfxElement _val11;
+	CPetGfxElement _onOff;
+	CPetGfxElement _up;
+	CPetGfxElement _down;
+	CPetGfxElement _left;
+	CPetGfxElement _right;
+	CPetGfxElement _top;
+	CPetGfxElement _bottom;
+	CPetGfxElement _action;
+	CPetGfxElement _send;
+	CPetGfxElement _receive;
+	CPetGfxElement _call;
 	CPetText _text;
+private:
+	/**
+	 * Setup the control
+	 */
+	bool setupControl(CPetControl *petControl);
+
+	/**
+	 * Get the current room
+	 */
+	CRoomItem *getRoom() const;
+
+	/**
+	 * Return a highlight index
+	 */
+	int getHighlightIndex(int val);
+
+	/**
+	 * Return the index of a room name in the master room names list
+	 */
+	int roomIndexOf(const CString &name);
 public:
+	CPetRemote();
+
+	/**
+	 * Sets up the section
+	 */
+	virtual bool setup(CPetControl *petControl);
+
+	/**
+	 * Reset the section
+	 */
+	virtual bool reset();
+
+	/**
+	 * Draw the section
+	 */
+	virtual void draw(CScreenManager *screenManager);
+
+	/**
+	* Following are handlers for the various messages that the PET can
+	* pass onto the currently active section/area
+	*/
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
+	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg);
+
 	/**
 	 * Returns true if the object is in a valid state
 	 */
 	virtual bool isValid(CPetControl *petControl);
+
+	/**
+	 * Called after a game has been loaded
+	 */
+	virtual void postLoad();
+
+	/**
+	 * Called when a section is switched to
+	 */
+	virtual void enter(PetArea oldArea);
+
+	/**
+	 * Called when a new room is entered
+	 */
+	virtual void enterRoom(CRoomItem *room);
+
+	/**
+	 * Get a reference to the tooltip text associated with the section
+	 */
+	virtual CPetText *getText();
+
+	/**
+	 * Get an element from the section by a designated Id
+	 */
+	virtual CPetElement *getElement(uint id);
+
+	virtual void proc38(int val);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 7c2b9fb..e474e35 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -94,8 +94,8 @@ bool CPetRooms::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
 	return _glyphs.VirtualKeyCharMsg(msg->_keyState.keycode);
 }
 
-bool CPetRooms::proc14(void *v1) {
-	warning("TODO: proc14");
+bool CPetRooms::checkDragEnd(CGameObject *item) {
+	warning("TODO: CPetRooms::checkDragEnd");
 	return false;
 }
 
@@ -171,8 +171,8 @@ bool CPetRooms::setupControl(CPetControl *petControl) {
 	_text.setHasBorder(false);
 
 	Rect rect2(0, 0, 81, 81);
-	rect2.moveTo(374, 494);
 	_plinth.setBounds(rect2);
+	_plinth.translate(494, 374);
 
 	_chevLeftOnDim = petControl->getHiddenObject("3PetChevLeftOnDim");
 	_chevLeftOffDim = petControl->getHiddenObject("3PetChevLeftOffDim");
@@ -219,5 +219,4 @@ CPetRoomsGlyph *CPetRooms::addGlyph(int val, bool highlight) {
 	}
 }
 
-
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index a0fd3e9..522a1e2 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -101,8 +101,11 @@ public:
 	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
 	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg);
 
-	virtual bool proc14(void *v1);
-
+	/**
+	 * Check whether a drag drop can occur
+	 */
+	virtual bool checkDragEnd(CGameObject *item);
+	
 	/**
 	 * Display a message
 	 */
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp
index 7f0a000..116fd94 100644
--- a/engines/titanic/pet_control/pet_section.cpp
+++ b/engines/titanic/pet_control/pet_section.cpp
@@ -66,10 +66,6 @@ void CPetSection::proc29() {
 	_petControl->stopPetTimer(0);
 }
 
-void CPetSection::proc30() {
-	error("TODO");
-}
-
 uint CPetSection::getColor(uint index) {
 	return getColorTable()[index];
 }
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 296479d..52890fc 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -34,6 +34,7 @@ enum PetArea {
 };
 
 class CPetControl;
+class CPetElement;
 class CPetText;
 class CScreenManager;
 class CRoomItem;
@@ -152,7 +153,11 @@ public:
 	virtual void proc27(int duration);
 	virtual void proc28();
 	virtual void proc29();
-	virtual void proc30();
+
+	/**
+	 * Get an element from the section by a designated Id
+	 */
+	virtual CPetElement *getElement(uint id) { return nullptr; }
 
 	virtual CGameObject *getBackground(int index) const { return nullptr; }
 
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 9321890..f1d24a0 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -78,6 +78,7 @@ void TitanicEngine::initialize() {
 	DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
 
 	setItemNames();
+	setRoomNames();
 	CSaveableObject::initClassList();
 	CEnterExitFirstClassState::init();
 	CGetLiftEye2::init();
@@ -173,5 +174,20 @@ void TitanicEngine::setItemNames() {
 		_itemIds[idx] = ITEM_IDS[idx];
 }
 
+void TitanicEngine::setRoomNames() {
+	static const char *const ROOM_NAMES[TOTAL_ROOMS] = {
+		"1stClassLobby", "1stClassRestaurant", "1stClassState",
+		"2ndClassLobby", "secClassState", "Arboretum", "FrozenArboretum",
+		"Bar", "BilgeRoom", "BilgeRoomWith", "BottomOfWell", "Bridge",
+		"CreatorsChamber", "CreatorsChamberOn", "Dome", "Home", "Lift",
+		"EmbLobby", "MoonEmbLobby", "MusicRoomLobby", "MusicRoom",
+		"ParrotLobby", "Pellerator", "PromenadeDeck", "SculptureChamber",
+		"SecClassLittleLift", "ServiceElevator", "SGTLeisure", "SGTLittleLift",
+		"SgtLobby", "SGTState", "Titania", "TopOfWell", "PlayersRoom"
+	};
+
+	for (uint idx = 0; idx < TOTAL_ROOMS; ++idx)
+		_roomNames[idx] = ROOM_NAMES[idx];
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index f639a9c..a5cf0ff 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -65,6 +65,7 @@ enum TitanicDebugChannels {
 #define ERROR_DETAILED 3
 
 #define TOTAL_ITEMS 46
+#define TOTAL_ROOMS 34
 
 struct TitanicGameDescription;
 class TitanicEngine;
@@ -94,6 +95,11 @@ private:
 	 * Sets up the item names, short, and long descriptions
 	 */
 	void setItemNames();
+
+	/**
+	 * Sets up the list of room names
+	 */
+	void setRoomNames();
 protected:
 	const TitanicGameDescription *_gameDescription;
 	int _loadSaveSlot;
@@ -115,6 +121,7 @@ public:
 	CString _itemDescriptions[TOTAL_ITEMS];
 	CString _itemObjects[TOTAL_ITEMS];
 	CString _itemIds[40];
+	CString _roomNames[TOTAL_ROOMS];
 public:
 	TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
 	virtual ~TitanicEngine();


Commit: c3dadcfe3b9d62eb19970b200e941f138f8abf1b
    https://github.com/scummvm/scummvm/commit/c3dadcfe3b9d62eb19970b200e941f138f8abf1b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:05-04:00

Commit Message:
TITANIC: Beginnings of PET Remote glyph classes

Changed paths:
  A engines/titanic/pet_control/pet_remote_glyphs.cpp
  A engines/titanic/pet_control/pet_remote_glyphs.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_nav_helmet.cpp
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_remote.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index a9d758b..ae0c563 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -364,10 +364,11 @@ MODULE_OBJS := \
 	pet_control/pet_inventory_glyphs.o \
 	pet_control/pet_message.o \
 	pet_control/pet_nav_helmet.o \
+	pet_control/pet_real_life.o \
+	pet_control/pet_remote.o \
+	pet_control/pet_remote_glyphs.o \
 	pet_control/pet_rooms.o \
 	pet_control/pet_rooms_glyphs.o \
-	pet_control/pet_remote.o \
-	pet_control/pet_real_life.o \
 	pet_control/pet_section.o \
 	pet_control/pet_drag_chev.o \
 	pet_control/pet_graphic2.o \
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 2bd8864..c115cb5 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -44,7 +44,7 @@ END_MESSAGE_MAP()
 
 CPetControl::CPetControl() : CGameObject(), 
 		_currentArea(PET_CONVERSATION), _fieldC0(0), _locked(0), _fieldC8(0),
-		_activeNPC(nullptr), _treeItem2(nullptr), _hiddenRoom(nullptr),
+		_activeNPC(nullptr), _remoteTarget(nullptr), _hiddenRoom(nullptr),
 		_drawBounds(20, 350, 620, 480) {
 	_sections[PET_INVENTORY] = &_inventory;
 	_sections[PET_CONVERSATION] = &_conversations;
@@ -152,7 +152,7 @@ void CPetControl::postLoad() {
 	if (!_activeNPCName.empty() && root)
 		_activeNPC = root->findByName(_activeNPCName);
 	if (!_string2.empty() && root)
-		_treeItem2 = root->findByName(_string2);
+		_remoteTarget = root->findByName(_string2);
 
 	setArea(_currentArea);
 	loaded();
@@ -179,7 +179,7 @@ void CPetControl::enterRoom(CRoomItem *room) {
 }
 
 void CPetControl::clear() {
-	_treeItem2 = nullptr;
+	_remoteTarget = nullptr;
 	_string2.clear();
 }
 
@@ -216,7 +216,7 @@ void CPetControl::fn2(int val) {
 }
 
 void CPetControl::fn3(CTreeItem *item) {
-	_treeItem2 = item;
+	_remoteTarget = item;
 	if (item)
 		_string2 = item->getName();
 	else
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 2c70639..7763dd9 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -113,7 +113,7 @@ protected:
 public:
 	PetArea _currentArea;
 	CTreeItem *_activeNPC;
-	CTreeItem *_treeItem2;
+	CTreeItem *_remoteTarget;
 public:
 	CLASSDEF
 	CPetControl();
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 2aa80db..5dc5013 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -408,6 +408,11 @@ public:
 	 * Returns the index of the specified glyph in the lsit
 	 */
 	int indexOf(const CPetGlyph *glyph) const;
+
+	/**
+	 * Resets the scrolling of the glyphs list back to the start
+	 */
+	void scrollToStart() { _firstVisibleIndex = 0; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_nav_helmet.cpp b/engines/titanic/pet_control/pet_nav_helmet.cpp
index 7697df4..b995786 100644
--- a/engines/titanic/pet_control/pet_nav_helmet.cpp
+++ b/engines/titanic/pet_control/pet_nav_helmet.cpp
@@ -77,17 +77,17 @@ void CPetNavHelmet::draw(CScreenManager *screenManager) {
 }
 
 bool CPetNavHelmet::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
-	if (!_petControl->_treeItem2)
+	if (!_petControl->_remoteTarget)
 		return false;
 
 	if (_val1.MouseButtonDownMsg(msg->_mousePos)) {
 		CPETHelmetOnOffMsg helmetMsg;
-		helmetMsg.execute(_petControl->_treeItem2);
+		helmetMsg.execute(_petControl->_remoteTarget);
 	} else if (_val2.MouseButtonDownMsg(msg->_mousePos)) {
 		if (_field210) {
 			_photoOn = !_photoOn;
 			CPETPhotoOnOffMsg photoMsg;
-			photoMsg.execute(_petControl->_treeItem2);
+			photoMsg.execute(_petControl->_remoteTarget);
 		} else {
 			_petControl->displayMessage("Please supply Galactic reference material.");
 		}
@@ -99,7 +99,7 @@ bool CPetNavHelmet::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 }
 
 bool CPetNavHelmet::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
-	if (!_petControl->_treeItem2 || !_setDestination.MouseButtonUpMsg(msg->_mousePos))
+	if (!_petControl->_remoteTarget || !_setDestination.MouseButtonUpMsg(msg->_mousePos))
 		return false;
 
 	if (_petControl) {
diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index 1aef2bc..fb9178b 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -21,12 +21,53 @@
  */
 
 #include "titanic/pet_control/pet_remote.h"
+#include "titanic/pet_control/pet_remote_glyphs.h"
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/messages/pet_messages.h"
 #include "titanic/game_manager.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
 
+static const byte REMOTE_DATA[] = {
+	0x00, 0x02, 
+		GLYPH_SUMMON_ELEVATOR, 0x10,
+	0x01,	0x02, 0x01, 0x10,
+	0x02,	0x03, 0x02, 0x04, 0x10,
+	0x03, 0x02,
+		GLYPH_SUMMON_ELEVATOR, 0x10,
+	0x04,	0x02, 0x02, 0x10,
+	0x05,	0x02, 0x01, 0x10,
+	0x06,	0x02, 0x01, 0x10,
+	0x07,	0x03, 0x02, 0x01, 0x10,
+	0x08,	0x01, 0x10,
+	0x09,	0x01, 0x10,
+	0x0A,	0x02, GLYPH_SUMMON_ELEVATOR, 0x10,
+	0x0B,	0x01, 0x11,
+	0x0C,	0x01, 0x10,
+	0x0D,	0x01, 0x10,
+	0x0E,	0x00,
+	0x0F,	0x01, 0x02,
+	0x10,	0x03, 0x12, 0x14, 0x13,
+	0x11,	0x01, 0x10,
+	0x12,	0x00,
+	0x13,	0x02, 0x01, 0x10,
+	0x14,	0x00,
+	0x15,	0x02, 0x10, 0x02,
+	0x16,	0x00,
+	0x17,	0x02, 0x01, 0x10,
+	0x18,	0x01, 0x10,
+	0x19,	0x00,
+	0x1A,	0x00,
+	0x1B,	0x00,
+	0x1C,	0x00,
+	0x1D,	0x02, GLYPH_SUMMON_ELEVATOR, 0x10,
+	0x1E,	0x0C, 0x05, 0x06, 0x07, 0x08, 0x03, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+	0x1F,	0x01, 0x10,
+	0x20,	0x02, GLYPH_SUMMON_ELEVATOR, 0x01,
+	0x21,	0x00
+};
+
 CPetRemote::CPetRemote() : CPetSection() {
 }
 
@@ -117,7 +158,7 @@ CPetText *CPetRemote::getText() {
 	return &_text;
 }
 
-CPetElement *CPetRemote::getElement(uint id) {
+CPetGfxElement *CPetRemote::getElement(uint id) {
 	switch (id) {
 	case 0:
 		return &_onOff;
@@ -209,7 +250,14 @@ int CPetRemote::getHighlightIndex(int val) {
 	if (roomIndex == -1)
 		return -1;
 
-	// TODO: more
+	Common::Array<uint> remoteData;
+	getRemoteData(roomIndex, remoteData);
+
+	// Loop through the data for the room
+	for (uint idx = 0; idx < remoteData.size(); ++idx) {
+		if (remoteData[idx + 1] == val)
+			return idx;
+	}
 
 	return -1;
 }
@@ -223,4 +271,85 @@ int CPetRemote::roomIndexOf(const CString &name) {
 	return -1;
 }
 
+void CPetRemote::getRemoteData(int roomIndex, Common::Array<uint> &indexes) {
+	const byte *p = &REMOTE_DATA[0];
+	for (int idx = 0; idx < TOTAL_ROOMS; ++idx) {
+		if (*p == roomIndex) {
+			for (int idx = 0; idx < *p; ++idx)
+				indexes.push_back(p[idx + 1]);
+			return;
+		}
+
+		p += *(p + 1) + 2;
+	}
+}
+
+bool CPetRemote::loadGlyphs(const Common::Array<uint> &indexes) {
+	for (uint idx = 0; idx < indexes.size(); ++idx) {
+		if (!loadGlyph(indexes[idx]))
+			return false;
+	}
+
+	return true;
+}
+
+bool CPetRemote::loadGlyph(int glyphIndex) {
+	CPetRemoteGlyph *glyph = nullptr;
+
+	switch (glyphIndex) {
+	case GLYPH_SUMMON_ELEVATOR:
+		glyph = new CSummonElevatorGlyph();
+		break;
+
+	default:
+		break;
+	}
+
+	if (glyph) {
+		if (glyph->setup(_petControl, &_items)) {
+			_items.push_back(glyph);
+			return true;
+		}
+	}
+
+	return false;
+}
+
+void CPetRemote::generateMessage(RemoteMessage msgNum, const CString &name, int num) {
+	switch (msgNum) {
+	case RMSG_LEFT: {
+		CPETLeftMsg msg(name, num);
+		msg.execute(_petControl->_remoteTarget);
+		break;
+	}
+
+	case RMSG_RIGHT: {
+		CPETRightMsg msg(name, num);
+		msg.execute(_petControl->_remoteTarget);
+		break;
+	}
+
+	case RMSG_UP: {
+		CPETUpMsg msg(name, num);
+		msg.execute(_petControl->_remoteTarget);
+		break;
+	}
+
+	case RMSG_DOWN: {
+		CPETDownMsg msg(name, num);
+		msg.execute(_petControl->_remoteTarget);
+		break;
+	}
+
+	case RMSG_ACTIVATE: {
+		CPETActivateMsg msg(name, num);
+		msg.execute(_petControl->_remoteTarget);
+		break;
+	}
+
+	default:
+		break;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote.h b/engines/titanic/pet_control/pet_remote.h
index 5db7e7f..6982c93 100644
--- a/engines/titanic/pet_control/pet_remote.h
+++ b/engines/titanic/pet_control/pet_remote.h
@@ -23,16 +23,14 @@
 #ifndef TITANIC_PET_REMOTE_H
 #define TITANIC_PET_REMOTE_H
 
+#include "common/array.h"
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_glyphs.h"
+#include "titanic/pet_control/pet_remote_glyphs.h"
 #include "titanic/pet_control/pet_text.h"
-#include "titanic/pet_control/pet_gfx_element.h"
 
 namespace Titanic {
 
-class CPetRemoteGlyphs : public CPetGlyphs {
-};
-
 class CPetRemote : public CPetSection {
 private:
 	CPetRemoteGlyphs _items;
@@ -68,6 +66,26 @@ private:
 	 * Return the index of a room name in the master room names list
 	 */
 	int roomIndexOf(const CString &name);
+
+	/**
+	 * Return a list of remote action glyph indexes for a given room
+	 */
+	void getRemoteData(int roomIndex, Common::Array<uint> &indexes);
+
+	/**
+	 * Clear the list of rooms glyphs
+	 */
+	void clearGlyphs() { _items.clear(); }
+
+	/**
+	 * Load the room glyphs
+	 */
+	bool loadGlyphs(const Common::Array<uint> &indexes);
+
+	/**
+	 * Load a single room glyph
+	 */
+	bool loadGlyph(int glyphIndex);
 public:
 	CPetRemote();
 
@@ -123,9 +141,14 @@ public:
 	/**
 	 * Get an element from the section by a designated Id
 	 */
-	virtual CPetElement *getElement(uint id);
+	virtual CPetGfxElement *getElement(uint id);
 
 	virtual void proc38(int val);
+
+	/**
+	 * Generates a PET message
+	 */
+	void generateMessage(RemoteMessage msgNum, const CString &name, int num);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
new file mode 100644
index 0000000..76ab383
--- /dev/null
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -0,0 +1,83 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_remote_glyphs.h"
+#include "titanic/pet_control/pet_remote.h"
+
+namespace Titanic {
+
+CPetRemote *CPetRemoteGlyphs::getOwner() const {
+	return static_cast<CPetRemote *>(_owner);
+}
+
+void CPetRemoteGlyphs::generateMessage(RemoteMessage msgNum, const CString &name, int num) {
+	getOwner()->generateMessage(msgNum, name, num);
+}
+
+/*------------------------------------------------------------------------*/
+
+void CPetRemoteGlyph::setDefaults(const CString &name, CPetControl *petControl) {
+	_gfxElement->setBounds(Rect(0, 0, 52, 52));
+	_gfxElement->setup(MODE_UNSELECTED, name, petControl);
+}
+
+CPetRemoteGlyphs *CPetRemoteGlyph::getOwner() const {
+	return static_cast<CPetRemoteGlyphs *>(_owner);
+}
+
+CPetGfxElement *CPetRemoteGlyph::getElement(uint id) const {
+	CPetRemote *remote = static_cast<CPetRemote *>(_owner->getOwner());
+	return remote->getElement(id);
+}
+
+/*------------------------------------------------------------------------*/
+
+bool CSummonElevatorGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	setDefaults("3PetLift", petControl);
+	if (owner)
+		_gfxElement = getElement(18);
+	return true;
+}
+
+void CSummonElevatorGlyph::draw2(CScreenManager *screenManager) {
+	if (_gfxElement)
+		_gfxElement->draw(screenManager);
+}
+
+bool CSummonElevatorGlyph::MouseButtonDownMsg(const Point &pt) {
+	return _gfxElement && _gfxElement->MouseButtonDownMsg(pt); 
+}
+
+bool CSummonElevatorGlyph::MouseButtonUpMsg(const Point &pt) {
+	if (_gfxElement && _gfxElement->MouseButtonUpMsg(pt)) {
+		getOwner()->generateMessage(RMSG_ACTIVATE, "Lift");
+		return true;
+	}
+
+	return false;
+}
+
+void CSummonElevatorGlyph::getTooltip(CPetText *text) {
+	text->setText("Summon Elevator");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.h b/engines/titanic/pet_control/pet_remote_glyphs.h
new file mode 100644
index 0000000..56a2e2c
--- /dev/null
+++ b/engines/titanic/pet_control/pet_remote_glyphs.h
@@ -0,0 +1,108 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_REMOTE_GLYPHS_H
+#define TITANIC_PET_REMOTE_GLYPHS_H
+
+#include "titanic/pet_control/pet_glyphs.h"
+#include "titanic/pet_control/pet_gfx_element.h"
+
+namespace Titanic {
+
+enum RemoteGlyph {
+	GLYPH_SUMMON_ELEVATOR = 0
+};
+
+enum RemoteMessage {
+	RMSG_LEFT = 0, RMSG_RIGHT = 1, RMSG_UP = 2, RMSG_DOWN = 3, RMSG_ACTIVATE = 4
+};
+
+class CPetRemote;
+
+class CPetRemoteGlyphs : public CPetGlyphs {
+public:
+	/**
+	 * Returns the owning CPetRemote
+	 */
+	CPetRemote *getOwner() const;
+
+	/**
+	 * Generates a PET message
+	 */
+	void generateMessage(RemoteMessage msgNum, const CString &name, int num = -1);
+};
+
+class CPetRemoteGlyph : public CPetGlyph {
+protected:
+	CPetGfxElement *_gfxElement;
+protected:
+	CPetRemoteGlyph() : CPetGlyph(), _gfxElement(nullptr) {}
+
+	/**
+	 * Set defaults for the glyph
+	 */
+	void setDefaults(const CString &name, CPetControl *petControl);
+
+	/**
+	 * Get the owner
+	 */
+	CPetRemoteGlyphs *getOwner() const;
+
+	/**
+	 * Get an element by id from the parent Remote section
+	 */
+	CPetGfxElement *getElement(uint id) const;
+};
+
+class CSummonElevatorGlyph : public CPetRemoteGlyph {
+public:
+	CSummonElevatorGlyph() : CPetRemoteGlyph() {}
+
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Handles any secondary drawing of the glyph
+	 */
+	virtual void draw2(CScreenManager *screenManager);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt);
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt);
+	
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_REMOTE_GLYPHS_H */


Commit: efaa86bee4f0183365309056d43b3aa3801f3ddf
    https://github.com/scummvm/scummvm/commit/efaa86bee4f0183365309056d43b3aa3801f3ddf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:06-04:00

Commit Message:
TITANIC: Implement Television Control glyph

Changed paths:
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_remote_glyphs.cpp
    engines/titanic/pet_control/pet_remote_glyphs.h
    engines/titanic/pet_control/pet_rooms.cpp



diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index da37b35..0827b33 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -96,4 +96,11 @@ void CPetElement::setMode(PetElementMode newMode) {
 		changeMode(newMode);
 }
 
+void CPetElement::setSelected(bool flag) {
+	if (flag)
+		changeMode(MODE_SELECTED);
+	else
+		changeMode(MODE_UNSELECTED);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index 578f306..e1edcac 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -126,6 +126,11 @@ public:
 	void setMode(PetElementMode mode);
 
 	/**
+	 * Set whether the element is selected
+	 */
+	void setSelected(bool flag);
+
+	/**
 	 * Set the bounds for the element
 	 */
 	void setBounds(const Rect &r) { _bounds = r; }
diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index fb9178b..9149ed8 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -32,40 +32,52 @@ namespace Titanic {
 static const byte REMOTE_DATA[] = {
 	0x00, 0x02, 
 		GLYPH_SUMMON_ELEVATOR, 0x10,
-	0x01,	0x02, 0x01, 0x10,
-	0x02,	0x03, 0x02, 0x04, 0x10,
+	0x01, 0x02,
+		GLYPH_SUMMON_PELLERATOR, 0x10,
+	0x02, 0x03,
+		GLYPH_TELEVISION_CONTROL, 0x04, 0x10,
 	0x03, 0x02,
 		GLYPH_SUMMON_ELEVATOR, 0x10,
-	0x04,	0x02, 0x02, 0x10,
-	0x05,	0x02, 0x01, 0x10,
-	0x06,	0x02, 0x01, 0x10,
-	0x07,	0x03, 0x02, 0x01, 0x10,
-	0x08,	0x01, 0x10,
-	0x09,	0x01, 0x10,
-	0x0A,	0x02, GLYPH_SUMMON_ELEVATOR, 0x10,
-	0x0B,	0x01, 0x11,
-	0x0C,	0x01, 0x10,
-	0x0D,	0x01, 0x10,
-	0x0E,	0x00,
-	0x0F,	0x01, 0x02,
-	0x10,	0x03, 0x12, 0x14, 0x13,
-	0x11,	0x01, 0x10,
-	0x12,	0x00,
-	0x13,	0x02, 0x01, 0x10,
-	0x14,	0x00,
-	0x15,	0x02, 0x10, 0x02,
-	0x16,	0x00,
-	0x17,	0x02, 0x01, 0x10,
-	0x18,	0x01, 0x10,
-	0x19,	0x00,
-	0x1A,	0x00,
-	0x1B,	0x00,
-	0x1C,	0x00,
-	0x1D,	0x02, GLYPH_SUMMON_ELEVATOR, 0x10,
-	0x1E,	0x0C, 0x05, 0x06, 0x07, 0x08, 0x03, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-	0x1F,	0x01, 0x10,
-	0x20,	0x02, GLYPH_SUMMON_ELEVATOR, 0x01,
-	0x21,	0x00
+	0x04, 0x02,
+		GLYPH_TELEVISION_CONTROL, 0x10,
+	0x05, 0x02,
+		GLYPH_SUMMON_PELLERATOR, 0x10,
+	0x06, 0x02,
+		GLYPH_SUMMON_PELLERATOR, 0x10,
+	0x07, 0x03,
+		GLYPH_TELEVISION_CONTROL, GLYPH_SUMMON_PELLERATOR, 0x10,
+	0x08, 0x01, 0x10,
+	0x09, 0x01, 0x10,
+	0x0A, 0x02, GLYPH_SUMMON_ELEVATOR, 0x10,
+	0x0B, 0x01, 0x11,
+	0x0C, 0x01, 0x10,
+	0x0D, 0x01, 0x10,
+	0x0E, 0x00,
+	0x0F, 0x01,
+		GLYPH_TELEVISION_CONTROL,
+	0x10, 0x03, 0x12, 0x14, 0x13,
+	0x11, 0x01, 0x10,
+	0x12, 0x00,
+	0x13, 0x02,
+		GLYPH_SUMMON_PELLERATOR, 0x10,
+	0x14, 0x00,
+	0x15, 0x02,
+		0x10, GLYPH_TELEVISION_CONTROL,
+	0x16, 0x00,
+	0x17, 0x02,
+		GLYPH_SUMMON_PELLERATOR, 0x10,
+	0x18, 0x01, 0x10,
+	0x19, 0x00,
+	0x1A, 0x00,
+	0x1B, 0x00,
+	0x1C, 0x00,
+	0x1D, 0x02, GLYPH_SUMMON_ELEVATOR, 0x10,
+	0x1E, 0x0C,
+		0x05, 0x06, 0x07, 0x08, 0x03, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+	0x1F, 0x01, 0x10,
+	0x20, 0x02,
+		GLYPH_SUMMON_ELEVATOR, GLYPH_SUMMON_PELLERATOR,
+	0x21, 0x00
 };
 
 CPetRemote::CPetRemote() : CPetSection() {
@@ -301,6 +313,12 @@ bool CPetRemote::loadGlyph(int glyphIndex) {
 		glyph = new CSummonElevatorGlyph();
 		break;
 
+	case GLYPH_SUMMON_PELLERATOR:
+		glyph = new CSummonPelleratorGlyph();
+		break;
+
+	case GLYPH_TELEVISION_CONTROL:
+
 	default:
 		break;
 	}
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index 76ab383..9db3b66 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -51,23 +51,24 @@ CPetGfxElement *CPetRemoteGlyph::getElement(uint id) const {
 
 /*------------------------------------------------------------------------*/
 
-bool CSummonElevatorGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
-	setDefaults("3PetLift", petControl);
+bool CBasicRemoteGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CPetRemoteGlyph::setup(petControl, owner);
+	setDefaults(_gfxName, petControl);
 	if (owner)
 		_gfxElement = getElement(18);
 	return true;
 }
 
-void CSummonElevatorGlyph::draw2(CScreenManager *screenManager) {
+void CBasicRemoteGlyph::draw2(CScreenManager *screenManager) {
 	if (_gfxElement)
 		_gfxElement->draw(screenManager);
 }
 
-bool CSummonElevatorGlyph::MouseButtonDownMsg(const Point &pt) {
+bool CBasicRemoteGlyph::MouseButtonDownMsg(const Point &pt) {
 	return _gfxElement && _gfxElement->MouseButtonDownMsg(pt); 
 }
 
-bool CSummonElevatorGlyph::MouseButtonUpMsg(const Point &pt) {
+bool CBasicRemoteGlyph::MouseButtonUpMsg(const Point &pt) {
 	if (_gfxElement && _gfxElement->MouseButtonUpMsg(pt)) {
 		getOwner()->generateMessage(RMSG_ACTIVATE, "Lift");
 		return true;
@@ -76,8 +77,64 @@ bool CSummonElevatorGlyph::MouseButtonUpMsg(const Point &pt) {
 	return false;
 }
 
-void CSummonElevatorGlyph::getTooltip(CPetText *text) {
-	text->setText("Summon Elevator");
+void CBasicRemoteGlyph::getTooltip(CPetText *text) {
+	text->setText(_tooltip);
+}
+
+/*------------------------------------------------------------------------*/
+
+bool CTelevisionControlGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CPetRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetTV", petControl);
+	if (owner) {
+		_up = getElement(1);
+		_down = getElement(2);
+		_onOff = getElement(4);
+	}
+	
+	return true;
+}
+
+void CTelevisionControlGlyph::draw2(CScreenManager *screenManager) {
+	_onOff->setSelected(_flag);
+	_onOff->draw(screenManager);
+	_up->draw(screenManager);
+	_down->draw(screenManager);
+}
+
+bool CTelevisionControlGlyph::MouseButtonDownMsg(const Point &pt) {
+	if (_onOff && _onOff->MouseButtonDownMsg(pt))
+		return true;
+	if (_up && _up->MouseButtonDownMsg(pt))
+		return true;
+	if (_down && _down->MouseButtonDownMsg(pt))
+		return true;
+
+	return false;
+}
+
+bool CTelevisionControlGlyph::MouseButtonUpMsg(const Point &pt) {
+	if (_onOff && _onOff->MouseButtonUpMsg(pt)) {
+		_flag = !_flag;
+		getOwner()->generateMessage(RMSG_ACTIVATE, "Television");
+		return true;
+	}
+
+	if (_up && _up->MouseButtonUpMsg(pt)) {
+		getOwner()->generateMessage(RMSG_UP, "Television");
+		return true;
+	}
+
+	if (_down && _down->MouseButtonUpMsg(pt)) {
+		getOwner()->generateMessage(RMSG_DOWN, "Television");
+		return true;
+	}
+
+	return false;
+}
+
+void CTelevisionControlGlyph::getTooltip(CPetText *text) {
+	text->setText("Television control");
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.h b/engines/titanic/pet_control/pet_remote_glyphs.h
index 56a2e2c..1a4ee28 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.h
+++ b/engines/titanic/pet_control/pet_remote_glyphs.h
@@ -29,7 +29,8 @@
 namespace Titanic {
 
 enum RemoteGlyph {
-	GLYPH_SUMMON_ELEVATOR = 0
+	GLYPH_SUMMON_ELEVATOR = 0, GLYPH_SUMMON_PELLERATOR = 1,
+	GLYPH_TELEVISION_CONTROL = 2
 };
 
 enum RemoteMessage {
@@ -73,9 +74,13 @@ protected:
 	CPetGfxElement *getElement(uint id) const;
 };
 
-class CSummonElevatorGlyph : public CPetRemoteGlyph {
+class CBasicRemoteGlyph : public CPetRemoteGlyph {
+private:
+	CString _gfxName, _tooltip, _msgString;
 public:
-	CSummonElevatorGlyph() : CPetRemoteGlyph() {}
+	CBasicRemoteGlyph(const CString &gfxName, const CString &tooltip,
+		const CString &msgString) : CPetRemoteGlyph(), 
+		_gfxName(gfxName), _tooltip(tooltip), _msgString(msgString) {}
 
 	/**
 	 * Setup the glyph
@@ -103,6 +108,53 @@ public:
 	virtual void getTooltip(CPetText *text);
 };
 
+class CSummonElevatorGlyph : public CBasicRemoteGlyph {
+public:
+	CSummonElevatorGlyph() : CBasicRemoteGlyph(
+		"3PetLift", "Summon Elevator", "Lift") {}
+};
+
+class CSummonPelleratorGlyph : public CBasicRemoteGlyph {
+public:
+	CSummonPelleratorGlyph() : CBasicRemoteGlyph(
+		"3PetPellerator", "Summon Pellerator", "Pellerator") {}
+};
+
+class CTelevisionControlGlyph : public CPetRemoteGlyph {
+private:
+	bool _flag;
+	CPetGfxElement *_up, *_down, *_onOff;
+public:
+	CTelevisionControlGlyph() : CPetRemoteGlyph(), _flag(false),
+		_up(nullptr), _down(nullptr), _onOff(nullptr) {}
+
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Handles any secondary drawing of the glyph
+	 */
+	virtual void draw2(CScreenManager *screenManager);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt);
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt);
+	
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_PET_REMOTE_GLYPHS_H */
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index e474e35..acf9acf 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -216,6 +216,8 @@ CPetRoomsGlyph *CPetRooms::addGlyph(int val, bool highlight) {
 		_glyphs.push_back(glyph);
 		if (highlight)
 			_glyphs.highlight(glyph);
+
+		return glyph;
 	}
 }
 


Commit: 947d9e344c2e51c7ad8e4fe1f78fb131cafc921a
    https://github.com/scummvm/scummvm/commit/947d9e344c2e51c7ad8e4fe1f78fb131cafc921a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:07-04:00

Commit Message:
TITANIC: Implement toggle remote glyph base class

Changed paths:
    engines/titanic/pet_control/pet_remote_glyphs.cpp
    engines/titanic/pet_control/pet_remote_glyphs.h



diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index 9db3b66..85c4fb8 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -83,6 +83,20 @@ void CBasicRemoteGlyph::getTooltip(CPetText *text) {
 
 /*------------------------------------------------------------------------*/
 
+bool CToggleRemoteGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CPetGlyph::setup(petControl, owner);
+	if (owner)
+		_gfxElement = getElement(0);
+	return true;
+}
+
+void CToggleRemoteGlyph::draw2(CScreenManager *screenManager) {
+	_gfxElement->setMode(_flag ? MODE_SELECTED : MODE_UNSELECTED);
+	_gfxElement->draw(screenManager);
+}
+
+/*------------------------------------------------------------------------*/
+
 bool CTelevisionControlGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	CPetRemoteGlyph::setup(petControl, owner);
 	setDefaults("3PetTV", petControl);
@@ -137,4 +151,16 @@ void CTelevisionControlGlyph::getTooltip(CPetText *text) {
 	text->setText("Television control");
 }
 
+/*------------------------------------------------------------------------*/
+
+bool CEntertainmentDeviceGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CPetRemoteGlyph::setup(petControl, owner);
+	if (owner) {
+		_gfxElement2 = getElement(1);
+		_gfxElement3 = getElement(2);
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.h b/engines/titanic/pet_control/pet_remote_glyphs.h
index 1a4ee28..8a9cb88 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.h
+++ b/engines/titanic/pet_control/pet_remote_glyphs.h
@@ -108,6 +108,29 @@ public:
 	virtual void getTooltip(CPetText *text);
 };
 
+class CToggleRemoteGlyph : public CPetRemoteGlyph {
+protected:
+	CPetGfxElement *_gfxElement;
+	bool _flag;
+public:
+	CToggleRemoteGlyph() : CPetRemoteGlyph(), _gfxElement(nullptr), _flag(false) {}
+
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Handles any secondary drawing of the glyph
+	 */
+	virtual void draw2(CScreenManager *screenManager);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt);
+};
+
 class CSummonElevatorGlyph : public CBasicRemoteGlyph {
 public:
 	CSummonElevatorGlyph() : CBasicRemoteGlyph(
@@ -154,6 +177,20 @@ public:
 	virtual void getTooltip(CPetText *text);
 };
 
+class CEntertainmentDeviceGlyph : public CToggleRemoteGlyph {
+public:
+	int _field3C;
+	CPetGfxElement *_gfxElement2, *_gfxElement3;
+public:
+	CEntertainmentDeviceGlyph() : CToggleRemoteGlyph(),
+		_field3C(0), _gfxElement2(nullptr), _gfxElement3(nullptr) {}
+
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+};
 
 } // End of namespace Titanic
 


Commit: 9a6ad7d1e012a5cb1a4ca955b0f738f12c0a7874
    https://github.com/scummvm/scummvm/commit/9a6ad7d1e012a5cb1a4ca955b0f738f12c0a7874
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:08-04:00

Commit Message:
TITANIC: Implemented remote entertainment device glyph

Changed paths:
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_remote_glyphs.cpp
    engines/titanic/pet_control/pet_remote_glyphs.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index a82488e..0d1714a 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -236,4 +236,13 @@ CScreenManager *CGameManager::setScreenManager() const {
 	return CScreenManager::setCurrent();
 }
 
+CString CGameManager::getFullViewName() {
+	CViewItem *view = getView();
+	CNodeItem *node = view->findNode();
+	CRoomItem *room = node->findRoom();
+
+	return CString::format("%s.%s.%s", room->getName().c_str(),
+		node->getName().c_str(), view->getName().c_str());
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 102cc40..e524265 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -186,6 +186,12 @@ public:
 	 * Return the true talk manager
 	 */
 	CTrueTalkManager *getTalkManager() { return &_trueTalkManager; }
+
+	/**
+	 * Return the full Id of the current view in a
+	 * room.node.view tuplet form
+	 */
+	CString getFullViewName();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index c115cb5..8571b5e 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -511,4 +511,9 @@ void CPetControl::setTimer44(int id, int val) {
 	getGameManager()->setTimer44(id, val);
 }
 
+CString CPetControl::getFullViewName() {
+	CGameManager *gameManager = getGameManager();
+	return gameManager ? gameManager->getFullViewName() : CString();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 7763dd9..23b4f61 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -288,6 +288,11 @@ public:
 	 */
 	void stopPetTimer(uint timerIndex);
 
+	/**
+	 * Return the full Id of the current view in a
+	 * room.node.view tuplet form
+	 */
+	CString getFullViewName();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index 9149ed8..fd2d5e1 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -73,7 +73,7 @@ static const byte REMOTE_DATA[] = {
 	0x1C, 0x00,
 	0x1D, 0x02, GLYPH_SUMMON_ELEVATOR, 0x10,
 	0x1E, 0x0C,
-		0x05, 0x06, 0x07, 0x08, 0x03, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+		0x05, 0x06, 0x07, 0x08, GLYPH_ENTERTAINMENT_DEVICE, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
 	0x1F, 0x01, 0x10,
 	0x20, 0x02,
 		GLYPH_SUMMON_ELEVATOR, GLYPH_SUMMON_PELLERATOR,
@@ -318,6 +318,12 @@ bool CPetRemote::loadGlyph(int glyphIndex) {
 		break;
 
 	case GLYPH_TELEVISION_CONTROL:
+		glyph = new CTelevisionControlGlyph();
+		break;
+
+	case GLYPH_ENTERTAINMENT_DEVICE:
+		glyph = new CEntertainmentDeviceGlyph();
+		break;
 
 	default:
 		break;
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index 85c4fb8..e0334fe 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -22,6 +22,8 @@
 
 #include "titanic/pet_control/pet_remote_glyphs.h"
 #include "titanic/pet_control/pet_remote.h"
+#include "titanic/pet_control/pet_control.h"
+#include "titanic/messages/pet_messages.h"
 
 namespace Titanic {
 
@@ -95,6 +97,25 @@ void CToggleRemoteGlyph::draw2(CScreenManager *screenManager) {
 	_gfxElement->draw(screenManager);
 }
 
+bool CToggleRemoteGlyph::elementMouseButtonDownMsg(const Point &pt) {
+	return _gfxElement->MouseButtonDownMsg(pt);
+}
+
+bool CToggleRemoteGlyph::elementMouseButtonUpMsg(const Point &pt) {
+	if (!_gfxElement->MouseButtonUpMsg(pt))
+		return false;
+
+	CTreeItem *target = getPetControl()->_remoteTarget;
+	if (target) {
+		CPETActivateMsg msg("SGTSelector", -1);
+		msg.execute(target);
+		_flag = !_flag;
+		_gfxElement->setMode(_flag ? MODE_SELECTED : MODE_UNSELECTED);
+	}
+
+	return true;
+}
+
 /*------------------------------------------------------------------------*/
 
 bool CTelevisionControlGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
@@ -163,4 +184,56 @@ bool CEntertainmentDeviceGlyph::setup(CPetControl *petControl, CPetGlyphs *owner
 	return true;
 }
 
+void CEntertainmentDeviceGlyph::draw2(CScreenManager *screenManager) {
+	CString viewName = getPetControl()->getFullViewName();
+	if (viewName == "SGTState.Node 1.S") {
+		_gfxElement->setSelected(_flag);
+		_gfxElement->draw(screenManager);
+	} else if (viewName == "SGTState.Node 4.E") {
+		_gfxElement->setSelected(_flag2);
+		_gfxElement->draw(screenManager);
+		_gfxElement2->draw(screenManager);
+		_gfxElement3->draw(screenManager);
+	}
+}
+
+bool CEntertainmentDeviceGlyph::MouseButtonDownMsg(const Point &pt) {
+	CString viewName = getPetControl()->getFullViewName();
+	if (viewName == "SGTState.Node 1.S") {
+		return elementMouseButtonDownMsg(pt);
+	} else if (viewName == "SGTState.Node 4.E") {
+		return _gfxElement->MouseButtonDownMsg(pt)
+			|| _gfxElement2->MouseButtonDownMsg(pt)
+			|| _gfxElement3->MouseButtonDownMsg(pt);
+	}
+
+	return false;
+}
+
+bool CEntertainmentDeviceGlyph::MouseButtonUpMsg(const Point &pt) {
+	CString viewName = getPetControl()->getFullViewName();
+	if (viewName == "SGTState.Node 1.S") {
+		return elementMouseButtonUpMsg(pt);
+	} else if (viewName == "SGTState.Node 4.E") {
+		if (_gfxElement->MouseButtonUpMsg(pt)) {
+			_flag2 = !_flag2;
+			getOwner()->generateMessage(RMSG_ACTIVATE, "Television");
+			return true;
+		} else if (_gfxElement2->MouseButtonUpMsg(pt)) {
+			getOwner()->generateMessage(RMSG_UP, "Television");
+			return true;
+		}
+		else if (_gfxElement3->MouseButtonUpMsg(pt)) {
+			getOwner()->generateMessage(RMSG_DOWN, "Television");
+			return true;
+		}
+	}
+
+	return false;
+}
+
+void CEntertainmentDeviceGlyph::getTooltip(CPetText *text) {
+	text->setText("Operate visual entertainment device");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.h b/engines/titanic/pet_control/pet_remote_glyphs.h
index 8a9cb88..e8f0c8d 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.h
+++ b/engines/titanic/pet_control/pet_remote_glyphs.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 enum RemoteGlyph {
 	GLYPH_SUMMON_ELEVATOR = 0, GLYPH_SUMMON_PELLERATOR = 1,
-	GLYPH_TELEVISION_CONTROL = 2
+	GLYPH_TELEVISION_CONTROL = 2, GLYPH_ENTERTAINMENT_DEVICE = 3
 };
 
 enum RemoteMessage {
@@ -126,9 +126,14 @@ public:
 	virtual void draw2(CScreenManager *screenManager);
 
 	/**
-	 * Called for mouse button down messages
+	 * Called for mouse button down messages to the default element
 	 */
-	virtual bool MouseButtonDownMsg(const Point &pt);
+	bool elementMouseButtonDownMsg(const Point &pt);
+
+	/**
+	 * Called for mouse button up messages to the default element
+	 */
+	bool elementMouseButtonUpMsg(const Point &pt);	
 };
 
 class CSummonElevatorGlyph : public CBasicRemoteGlyph {
@@ -179,17 +184,36 @@ public:
 
 class CEntertainmentDeviceGlyph : public CToggleRemoteGlyph {
 public:
-	int _field3C;
+	bool _flag2;
 	CPetGfxElement *_gfxElement2, *_gfxElement3;
 public:
 	CEntertainmentDeviceGlyph() : CToggleRemoteGlyph(),
-		_field3C(0), _gfxElement2(nullptr), _gfxElement3(nullptr) {}
+		_flag2(false), _gfxElement2(nullptr), _gfxElement3(nullptr) {}
 
 	/**
 	 * Setup the glyph
 	 */
 	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
 
+	/**
+	 * Handles any secondary drawing of the glyph
+	 */
+	virtual void draw2(CScreenManager *screenManager);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt);
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt);
+	
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
 };
 
 } // End of namespace Titanic


Commit: ab769eee0c99f262052b7a15295a74053943a372
    https://github.com/scummvm/scummvm/commit/ab769eee0c99f262052b7a15295a74053943a372
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:09-04:00

Commit Message:
TITANIC: Implement Operate Lights glyph

Changed paths:
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_remote.h
    engines/titanic/pet_control/pet_remote_glyphs.cpp
    engines/titanic/pet_control/pet_remote_glyphs.h



diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index fd2d5e1..1ed0251 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -35,7 +35,7 @@ static const byte REMOTE_DATA[] = {
 	0x01, 0x02,
 		GLYPH_SUMMON_PELLERATOR, 0x10,
 	0x02, 0x03,
-		GLYPH_TELEVISION_CONTROL, 0x04, 0x10,
+		GLYPH_TELEVISION_CONTROL, GLYPH_OPERATE_LIGHTS, 0x10,
 	0x03, 0x02,
 		GLYPH_SUMMON_ELEVATOR, 0x10,
 	0x04, 0x02,
@@ -200,7 +200,7 @@ CPetGfxElement *CPetRemote::getElement(uint id) {
 }
 
 void CPetRemote::proc38(int val) {
-	int highlightIndex = getHighlightIndex(val);
+	int highlightIndex = getHighlightIndex((RemoteGlyph)val);
 	if (highlightIndex != -1)
 		_items.highlight(highlightIndex);
 }
@@ -253,7 +253,7 @@ CRoomItem *CPetRemote::getRoom() const {
 	return nullptr;
 }
 
-int CPetRemote::getHighlightIndex(int val) {
+int CPetRemote::getHighlightIndex(RemoteGlyph val) {
 	CRoomItem *room = getRoom();
 	if (!room)
 		return -1;
@@ -267,7 +267,7 @@ int CPetRemote::getHighlightIndex(int val) {
 
 	// Loop through the data for the room
 	for (uint idx = 0; idx < remoteData.size(); ++idx) {
-		if (remoteData[idx + 1] == val)
+		if ((RemoteGlyph)remoteData[idx + 1] == val)
 			return idx;
 	}
 
@@ -287,8 +287,8 @@ void CPetRemote::getRemoteData(int roomIndex, Common::Array<uint> &indexes) {
 	const byte *p = &REMOTE_DATA[0];
 	for (int idx = 0; idx < TOTAL_ROOMS; ++idx) {
 		if (*p == roomIndex) {
-			for (int idx = 0; idx < *p; ++idx)
-				indexes.push_back(p[idx + 1]);
+			for (int ctr = 0; ctr < *p; ++ctr)
+				indexes.push_back(p[ctr + 1]);
 			return;
 		}
 
@@ -325,6 +325,10 @@ bool CPetRemote::loadGlyph(int glyphIndex) {
 		glyph = new CEntertainmentDeviceGlyph();
 		break;
 
+	case GLYPH_OPERATE_LIGHTS:
+		glyph = new COperateLightsGlyph();
+		break;
+
 	default:
 		break;
 	}
diff --git a/engines/titanic/pet_control/pet_remote.h b/engines/titanic/pet_control/pet_remote.h
index 6982c93..8703abd 100644
--- a/engines/titanic/pet_control/pet_remote.h
+++ b/engines/titanic/pet_control/pet_remote.h
@@ -60,7 +60,7 @@ private:
 	/**
 	 * Return a highlight index
 	 */
-	int getHighlightIndex(int val);
+	int getHighlightIndex(RemoteGlyph val);
 
 	/**
 	 * Return the index of a room name in the master room names list
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index e0334fe..c1d86d6 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -236,4 +236,59 @@ void CEntertainmentDeviceGlyph::getTooltip(CPetText *text) {
 	text->setText("Operate visual entertainment device");
 }
 
+/*------------------------------------------------------------------------*/
+
+
+bool COperateLightsGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CPetRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetLights", petControl);
+
+	if (owner) {
+		_left = getElement(3);
+		_right = getElement(4);
+		_up = getElement(5);
+		_down = getElement(6);
+		_activate = getElement(7);
+	}
+
+	return true;
+}
+
+void COperateLightsGlyph::draw2(CScreenManager *screenManager) {
+	_left->draw(screenManager);
+	_right->draw(screenManager);
+	_up->draw(screenManager);
+	_down->draw(screenManager);
+	_activate->draw(screenManager);
+}
+
+bool COperateLightsGlyph::MouseButtonDownMsg(const Point &pt) {
+	if (_left->MouseButtonDownMsg(pt)
+			|| _right->MouseButtonDownMsg(pt)
+			|| _up->MouseButtonDownMsg(pt)
+			|| _down->MouseButtonDownMsg(pt)
+			|| _activate->MouseButtonDownMsg(pt))
+		return true;
+	return true;
+}
+
+bool COperateLightsGlyph::MouseButtonUpMsg(const Point &pt) {
+	if (_left && _left->MouseButtonUpMsg(pt))
+		getOwner()->generateMessage(RMSG_LEFT, "Light");
+	else if (_right && _right->MouseButtonUpMsg(pt))
+		getOwner()->generateMessage(RMSG_RIGHT, "Light");
+	else if (_up && _up->MouseButtonUpMsg(pt))
+		getOwner()->generateMessage(RMSG_UP, "Light");
+	else if (_down && _down->MouseButtonUpMsg(pt))
+		getOwner()->generateMessage(RMSG_DOWN, "Light");
+	else
+		getOwner()->generateMessage(RMSG_ACTIVATE, "Light");
+
+	return true;
+}
+
+void COperateLightsGlyph::getTooltip(CPetText *text) {
+	text->setText("Operate the lights");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.h b/engines/titanic/pet_control/pet_remote_glyphs.h
index e8f0c8d..39f9164 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.h
+++ b/engines/titanic/pet_control/pet_remote_glyphs.h
@@ -30,7 +30,8 @@ namespace Titanic {
 
 enum RemoteGlyph {
 	GLYPH_SUMMON_ELEVATOR = 0, GLYPH_SUMMON_PELLERATOR = 1,
-	GLYPH_TELEVISION_CONTROL = 2, GLYPH_ENTERTAINMENT_DEVICE = 3
+	GLYPH_TELEVISION_CONTROL = 2, GLYPH_ENTERTAINMENT_DEVICE = 3,
+	GLYPH_OPERATE_LIGHTS = 4
 };
 
 enum RemoteMessage {
@@ -216,6 +217,40 @@ public:
 	virtual void getTooltip(CPetText *text);
 };
 
+
+class COperateLightsGlyph : public CPetRemoteGlyph {
+public:
+	CPetGfxElement *_left, *_right, *_up, *_down, *_activate;
+public:
+	COperateLightsGlyph() : CPetRemoteGlyph(), _left(nullptr), _right(nullptr),
+		_up(nullptr), _down(nullptr), _activate(nullptr) {}
+
+	/**
+	* Setup the glyph
+	*/
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	* Handles any secondary drawing of the glyph
+	*/
+	virtual void draw2(CScreenManager *screenManager);
+
+	/**
+	* Called for mouse button down messages
+	*/
+	virtual bool MouseButtonDownMsg(const Point &pt);
+
+	/**
+	* Handles mouse button up messages
+	*/
+	virtual bool MouseButtonUpMsg(const Point &pt);
+
+	/**
+	* Returns the tooltip text for when the glyph is selected
+	*/
+	virtual void getTooltip(CPetText *text);
+};
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_PET_REMOTE_GLYPHS_H */


Commit: 00cb975f158d82f80bcad3e025aeaedc8a5cd7d9
    https://github.com/scummvm/scummvm/commit/00cb975f158d82f80bcad3e025aeaedc8a5cd7d9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:10-04:00

Commit Message:
TITANIC: Implement Deploy Floral Enhancement glyph

Changed paths:
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_remote_glyphs.cpp
    engines/titanic/pet_control/pet_remote_glyphs.h



diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index 1ed0251..6ba6e55 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -329,6 +329,10 @@ bool CPetRemote::loadGlyph(int glyphIndex) {
 		glyph = new COperateLightsGlyph();
 		break;
 
+	case GLYPH_DEPLOY_FLORAL:
+		glyph = new CDeployFloralGlyph();
+		break;
+
 	default:
 		break;
 	}
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index c1d86d6..edf1dce 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -238,7 +238,6 @@ void CEntertainmentDeviceGlyph::getTooltip(CPetText *text) {
 
 /*------------------------------------------------------------------------*/
 
-
 bool COperateLightsGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	CPetRemoteGlyph::setup(petControl, owner);
 	setDefaults("3PetLights", petControl);
@@ -291,4 +290,17 @@ void COperateLightsGlyph::getTooltip(CPetText *text) {
 	text->setText("Operate the lights");
 }
 
+/*------------------------------------------------------------------------*/
+
+bool CDeployFloralGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CToggleRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetVase", petControl);
+	return true;
+}
+
+void CDeployFloralGlyph::getTooltip(CPetText *text) {
+	text->setText("Deploy floral enhancement");
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.h b/engines/titanic/pet_control/pet_remote_glyphs.h
index 39f9164..de56787 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.h
+++ b/engines/titanic/pet_control/pet_remote_glyphs.h
@@ -31,7 +31,7 @@ namespace Titanic {
 enum RemoteGlyph {
 	GLYPH_SUMMON_ELEVATOR = 0, GLYPH_SUMMON_PELLERATOR = 1,
 	GLYPH_TELEVISION_CONTROL = 2, GLYPH_ENTERTAINMENT_DEVICE = 3,
-	GLYPH_OPERATE_LIGHTS = 4
+	GLYPH_OPERATE_LIGHTS = 4, GLYPH_DEPLOY_FLORAL = 5
 };
 
 enum RemoteMessage {
@@ -251,6 +251,33 @@ public:
 	virtual void getTooltip(CPetText *text);
 };
 
+class CDeployFloralGlyph : public CToggleRemoteGlyph {
+public:
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt) {
+		return elementMouseButtonDownMsg(pt);
+	}
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt) {
+		return elementMouseButtonUpMsg(pt);
+	}
+	
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_PET_REMOTE_GLYPHS_H */


Commit: 82a1f6f0aa0afd414e3de677ab49e7ea1c15f226
    https://github.com/scummvm/scummvm/commit/82a1f6f0aa0afd414e3de677ab49e7ea1c15f226
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:11-04:00

Commit Message:
TITANIC: Implement Deploy Relaxation Device glyph

Changed paths:
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_remote_glyphs.cpp
    engines/titanic/pet_control/pet_remote_glyphs.h



diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index 6ba6e55..dbb9122 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -73,7 +73,8 @@ static const byte REMOTE_DATA[] = {
 	0x1C, 0x00,
 	0x1D, 0x02, GLYPH_SUMMON_ELEVATOR, 0x10,
 	0x1E, 0x0C,
-		0x05, 0x06, 0x07, 0x08, GLYPH_ENTERTAINMENT_DEVICE, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+		GLYPH_DEPLOY_FLORAL, GLYPH_DEPLOY_RELAXATION, 0x07, 0x08, 
+		GLYPH_ENTERTAINMENT_DEVICE, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
 	0x1F, 0x01, 0x10,
 	0x20, 0x02,
 		GLYPH_SUMMON_ELEVATOR, GLYPH_SUMMON_PELLERATOR,
@@ -333,6 +334,10 @@ bool CPetRemote::loadGlyph(int glyphIndex) {
 		glyph = new CDeployFloralGlyph();
 		break;
 
+	case GLYPH_DEPLOY_RELAXATION:
+		glyph = new CDeployRelaxationGlyph();
+		break;
+
 	default:
 		break;
 	}
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index edf1dce..a41f643 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -303,4 +303,16 @@ void CDeployFloralGlyph::getTooltip(CPetText *text) {
 }
 
 
+/*------------------------------------------------------------------------*/
+
+bool CDeployRelaxationGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CToggleRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetBedfoot", petControl);
+	return true;
+}
+
+void CDeployRelaxationGlyph::getTooltip(CPetText *text) {
+	text->setText("Deploy fully recumbent relaxation device");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.h b/engines/titanic/pet_control/pet_remote_glyphs.h
index de56787..09c6264 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.h
+++ b/engines/titanic/pet_control/pet_remote_glyphs.h
@@ -31,7 +31,8 @@ namespace Titanic {
 enum RemoteGlyph {
 	GLYPH_SUMMON_ELEVATOR = 0, GLYPH_SUMMON_PELLERATOR = 1,
 	GLYPH_TELEVISION_CONTROL = 2, GLYPH_ENTERTAINMENT_DEVICE = 3,
-	GLYPH_OPERATE_LIGHTS = 4, GLYPH_DEPLOY_FLORAL = 5
+	GLYPH_OPERATE_LIGHTS = 4, GLYPH_DEPLOY_FLORAL = 5,
+	GLYPH_DEPLOY_RELAXATION = 6
 };
 
 enum RemoteMessage {
@@ -278,6 +279,33 @@ public:
 	virtual void getTooltip(CPetText *text);
 };
 
+class CDeployRelaxationGlyph : public CToggleRemoteGlyph {
+public:
+	/**
+	* Setup the glyph
+	*/
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	* Called for mouse button down messages
+	*/
+	virtual bool MouseButtonDownMsg(const Point &pt) {
+		return elementMouseButtonDownMsg(pt);
+	}
+
+	/**
+	* Handles mouse button up messages
+	*/
+	virtual bool MouseButtonUpMsg(const Point &pt) {
+		return elementMouseButtonUpMsg(pt);
+	}
+
+	/**
+	* Returns the tooltip text for when the glyph is selected
+	*/
+	virtual void getTooltip(CPetText *text);
+};
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_PET_REMOTE_GLYPHS_H */


Commit: dd9a4f4b5b5b55fa41129568ff8ad4c9329e6759
    https://github.com/scummvm/scummvm/commit/dd9a4f4b5b5b55fa41129568ff8ad4c9329e6759
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:13-04:00

Commit Message:
TITANIC: Implement Deploy Comfort Device glyph

Changed paths:
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_remote_glyphs.cpp
    engines/titanic/pet_control/pet_remote_glyphs.h



diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index dbb9122..9277f81 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -73,7 +73,8 @@ static const byte REMOTE_DATA[] = {
 	0x1C, 0x00,
 	0x1D, 0x02, GLYPH_SUMMON_ELEVATOR, 0x10,
 	0x1E, 0x0C,
-		GLYPH_DEPLOY_FLORAL, GLYPH_DEPLOY_RELAXATION, 0x07, 0x08, 
+		GLYPH_DEPLOY_FLORAL, GLYPH_DEPLOY_RELAXATION, GLYPH_DEPLOY_COMFORT,
+		0x08,
 		GLYPH_ENTERTAINMENT_DEVICE, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
 	0x1F, 0x01, 0x10,
 	0x20, 0x02,
@@ -338,6 +339,10 @@ bool CPetRemote::loadGlyph(int glyphIndex) {
 		glyph = new CDeployRelaxationGlyph();
 		break;
 
+	case GLYPH_DEPLOY_COMFORT:
+		glyph = new CDeployComfortGlyph();
+		break;
+
 	default:
 		break;
 	}
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index a41f643..9ca6986 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -97,17 +97,17 @@ void CToggleRemoteGlyph::draw2(CScreenManager *screenManager) {
 	_gfxElement->draw(screenManager);
 }
 
-bool CToggleRemoteGlyph::elementMouseButtonDownMsg(const Point &pt) {
+bool CToggleRemoteGlyph::elementMouseButtonDownMsg(const Point &pt, int petNum) {
 	return _gfxElement->MouseButtonDownMsg(pt);
 }
 
-bool CToggleRemoteGlyph::elementMouseButtonUpMsg(const Point &pt) {
+bool CToggleRemoteGlyph::elementMouseButtonUpMsg(const Point &pt, int petNum) {
 	if (!_gfxElement->MouseButtonUpMsg(pt))
 		return false;
 
 	CTreeItem *target = getPetControl()->_remoteTarget;
 	if (target) {
-		CPETActivateMsg msg("SGTSelector", -1);
+		CPETActivateMsg msg("SGTSelector", petNum);
 		msg.execute(target);
 		_flag = !_flag;
 		_gfxElement->setMode(_flag ? MODE_SELECTED : MODE_UNSELECTED);
@@ -200,7 +200,7 @@ void CEntertainmentDeviceGlyph::draw2(CScreenManager *screenManager) {
 bool CEntertainmentDeviceGlyph::MouseButtonDownMsg(const Point &pt) {
 	CString viewName = getPetControl()->getFullViewName();
 	if (viewName == "SGTState.Node 1.S") {
-		return elementMouseButtonDownMsg(pt);
+		return elementMouseButtonDownMsg(pt, 4);
 	} else if (viewName == "SGTState.Node 4.E") {
 		return _gfxElement->MouseButtonDownMsg(pt)
 			|| _gfxElement2->MouseButtonDownMsg(pt)
@@ -213,7 +213,7 @@ bool CEntertainmentDeviceGlyph::MouseButtonDownMsg(const Point &pt) {
 bool CEntertainmentDeviceGlyph::MouseButtonUpMsg(const Point &pt) {
 	CString viewName = getPetControl()->getFullViewName();
 	if (viewName == "SGTState.Node 1.S") {
-		return elementMouseButtonUpMsg(pt);
+		return elementMouseButtonUpMsg(pt, 4);
 	} else if (viewName == "SGTState.Node 4.E") {
 		if (_gfxElement->MouseButtonUpMsg(pt)) {
 			_flag2 = !_flag2;
@@ -315,4 +315,16 @@ void CDeployRelaxationGlyph::getTooltip(CPetText *text) {
 	text->setText("Deploy fully recumbent relaxation device");
 }
 
+/*------------------------------------------------------------------------*/
+
+bool CDeployComfortGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CToggleRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetToilet", petControl);
+	return true;
+}
+
+void CDeployComfortGlyph::getTooltip(CPetText *text) {
+	text->setText("Deploy comfort workstation");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.h b/engines/titanic/pet_control/pet_remote_glyphs.h
index 09c6264..eb235bc 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.h
+++ b/engines/titanic/pet_control/pet_remote_glyphs.h
@@ -32,7 +32,7 @@ enum RemoteGlyph {
 	GLYPH_SUMMON_ELEVATOR = 0, GLYPH_SUMMON_PELLERATOR = 1,
 	GLYPH_TELEVISION_CONTROL = 2, GLYPH_ENTERTAINMENT_DEVICE = 3,
 	GLYPH_OPERATE_LIGHTS = 4, GLYPH_DEPLOY_FLORAL = 5,
-	GLYPH_DEPLOY_RELAXATION = 6
+	GLYPH_DEPLOY_RELAXATION = 6, GLYPH_DEPLOY_COMFORT = 7
 };
 
 enum RemoteMessage {
@@ -130,12 +130,12 @@ public:
 	/**
 	 * Called for mouse button down messages to the default element
 	 */
-	bool elementMouseButtonDownMsg(const Point &pt);
+	bool elementMouseButtonDownMsg(const Point &pt, int petNum);
 
 	/**
 	 * Called for mouse button up messages to the default element
 	 */
-	bool elementMouseButtonUpMsg(const Point &pt);	
+	bool elementMouseButtonUpMsg(const Point &pt, int petNum);	
 };
 
 class CSummonElevatorGlyph : public CBasicRemoteGlyph {
@@ -263,14 +263,14 @@ public:
 	 * Called for mouse button down messages
 	 */
 	virtual bool MouseButtonDownMsg(const Point &pt) {
-		return elementMouseButtonDownMsg(pt);
+		return elementMouseButtonDownMsg(pt, 0);
 	}
 
 	/**
 	 * Handles mouse button up messages
 	 */
 	virtual bool MouseButtonUpMsg(const Point &pt) {
-		return elementMouseButtonUpMsg(pt);
+		return elementMouseButtonUpMsg(pt, 0);
 	}
 	
 	/**
@@ -282,6 +282,33 @@ public:
 class CDeployRelaxationGlyph : public CToggleRemoteGlyph {
 public:
 	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt) {
+		return elementMouseButtonDownMsg(pt, 1);
+	}
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt) {
+		return elementMouseButtonUpMsg(pt, 1);
+	}
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
+class CDeployComfortGlyph : public CToggleRemoteGlyph {
+public:
+	/**
 	* Setup the glyph
 	*/
 	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
@@ -290,14 +317,14 @@ public:
 	* Called for mouse button down messages
 	*/
 	virtual bool MouseButtonDownMsg(const Point &pt) {
-		return elementMouseButtonDownMsg(pt);
+		return elementMouseButtonDownMsg(pt, 2);
 	}
 
 	/**
 	* Handles mouse button up messages
 	*/
 	virtual bool MouseButtonUpMsg(const Point &pt) {
-		return elementMouseButtonUpMsg(pt);
+		return elementMouseButtonUpMsg(pt, 2);
 	}
 
 	/**


Commit: 8551f08d0d006b0a2be483420e8920be501d1d55
    https://github.com/scummvm/scummvm/commit/8551f08d0d006b0a2be483420e8920be501d1d55
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:14-04:00

Commit Message:
TITANIC: Implemented more PET Remote glyph classes

Changed paths:
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_remote_glyphs.cpp
    engines/titanic/pet_control/pet_remote_glyphs.h



diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index 9277f81..6dc7a1a 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -31,52 +31,63 @@ namespace Titanic {
 
 static const byte REMOTE_DATA[] = {
 	0x00, 0x02, 
-		GLYPH_SUMMON_ELEVATOR, 0x10,
+		GLYPH_SUMMON_ELEVATOR, GLYPH_SUCCUBUS_DELIVERY,
 	0x01, 0x02,
-		GLYPH_SUMMON_PELLERATOR, 0x10,
+		GLYPH_SUMMON_PELLERATOR, GLYPH_SUCCUBUS_DELIVERY,
 	0x02, 0x03,
-		GLYPH_TELEVISION_CONTROL, GLYPH_OPERATE_LIGHTS, 0x10,
+		GLYPH_TELEVISION_CONTROL, GLYPH_OPERATE_LIGHTS, GLYPH_SUCCUBUS_DELIVERY,
 	0x03, 0x02,
-		GLYPH_SUMMON_ELEVATOR, 0x10,
+		GLYPH_SUMMON_ELEVATOR, GLYPH_SUCCUBUS_DELIVERY,
 	0x04, 0x02,
-		GLYPH_TELEVISION_CONTROL, 0x10,
+		GLYPH_TELEVISION_CONTROL, GLYPH_SUCCUBUS_DELIVERY,
 	0x05, 0x02,
-		GLYPH_SUMMON_PELLERATOR, 0x10,
+		GLYPH_SUMMON_PELLERATOR, GLYPH_SUCCUBUS_DELIVERY,
 	0x06, 0x02,
-		GLYPH_SUMMON_PELLERATOR, 0x10,
+		GLYPH_SUMMON_PELLERATOR, GLYPH_SUCCUBUS_DELIVERY,
 	0x07, 0x03,
-		GLYPH_TELEVISION_CONTROL, GLYPH_SUMMON_PELLERATOR, 0x10,
-	0x08, 0x01, 0x10,
-	0x09, 0x01, 0x10,
-	0x0A, 0x02, GLYPH_SUMMON_ELEVATOR, 0x10,
+		GLYPH_TELEVISION_CONTROL, GLYPH_SUMMON_PELLERATOR, GLYPH_SUCCUBUS_DELIVERY,
+	0x08, 0x01,
+		GLYPH_SUCCUBUS_DELIVERY,
+	0x09, 0x01,
+		GLYPH_SUCCUBUS_DELIVERY,
+	0x0A, 0x02, GLYPH_SUMMON_ELEVATOR, GLYPH_SUCCUBUS_DELIVERY,
 	0x0B, 0x01, 0x11,
-	0x0C, 0x01, 0x10,
-	0x0D, 0x01, 0x10,
+	0x0C, 0x01,
+		GLYPH_SUCCUBUS_DELIVERY,
+	0x0D, 0x01,
+		GLYPH_SUCCUBUS_DELIVERY,
 	0x0E, 0x00,
 	0x0F, 0x01,
 		GLYPH_TELEVISION_CONTROL,
 	0x10, 0x03, 0x12, 0x14, 0x13,
-	0x11, 0x01, 0x10,
+	0x11, 0x01,
+		GLYPH_SUCCUBUS_DELIVERY,
 	0x12, 0x00,
 	0x13, 0x02,
-		GLYPH_SUMMON_PELLERATOR, 0x10,
+		GLYPH_SUMMON_PELLERATOR, GLYPH_SUCCUBUS_DELIVERY,
 	0x14, 0x00,
 	0x15, 0x02,
 		0x10, GLYPH_TELEVISION_CONTROL,
 	0x16, 0x00,
 	0x17, 0x02,
-		GLYPH_SUMMON_PELLERATOR, 0x10,
-	0x18, 0x01, 0x10,
+		GLYPH_SUMMON_PELLERATOR, GLYPH_SUCCUBUS_DELIVERY,
+	0x18, 0x01,
+		GLYPH_SUCCUBUS_DELIVERY,
 	0x19, 0x00,
 	0x1A, 0x00,
 	0x1B, 0x00,
 	0x1C, 0x00,
-	0x1D, 0x02, GLYPH_SUMMON_ELEVATOR, 0x10,
+	0x1D, 0x02,
+		GLYPH_SUMMON_ELEVATOR, GLYPH_SUCCUBUS_DELIVERY,
 	0x1E, 0x0C,
-		GLYPH_DEPLOY_FLORAL, GLYPH_DEPLOY_RELAXATION, GLYPH_DEPLOY_COMFORT,
-		0x08,
-		GLYPH_ENTERTAINMENT_DEVICE, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-	0x1F, 0x01, 0x10,
+		GLYPH_DEPLOY_FLORAL, GLYPH_DEPLOY_FULLY_RELAXATION, GLYPH_DEPLOY_COMFORT,
+		GLYPH_DEPLOY_MINOR_STORAGE, GLYPH_ENTERTAINMENT_DEVICE, 
+		GLYPH_DEPLOY_MAJOR_RELAXATION, GLYPH_INFLATE_RELAXATION,
+		GLYPH_DEPLOY_MAINTENANCE, GLYPH_DEPLOY_WORK_SURFACE,
+		GLYPH_DEPLOY_MINOR_RELAXATION, GLYPH_DEPLOY_SINK,
+		GLYPH_DEPLOY_MAJOR_STORAGE,
+	0x1F, 0x01,
+		GLYPH_SUCCUBUS_DELIVERY,
 	0x20, 0x02,
 		GLYPH_SUMMON_ELEVATOR, GLYPH_SUMMON_PELLERATOR,
 	0x21, 0x00
@@ -335,14 +346,50 @@ bool CPetRemote::loadGlyph(int glyphIndex) {
 		glyph = new CDeployFloralGlyph();
 		break;
 
-	case GLYPH_DEPLOY_RELAXATION:
-		glyph = new CDeployRelaxationGlyph();
+	case GLYPH_DEPLOY_FULLY_RELAXATION:
+		glyph = new CDeployFullyRelaxationGlyph();
 		break;
 
 	case GLYPH_DEPLOY_COMFORT:
 		glyph = new CDeployComfortGlyph();
 		break;
 
+	case GLYPH_DEPLOY_MINOR_STORAGE:
+		glyph = new CDeployMinorStorageGlyph();
+		break;
+
+	case GLYPH_DEPLOY_MAJOR_RELAXATION:
+		glyph = new CDeployMajorRelaxationGlyph();
+		break;
+
+	case GLYPH_INFLATE_RELAXATION:
+		glyph = new CInflateRelaxationGlyph();
+		break;
+
+	case GLYPH_DEPLOY_MAINTENANCE:
+		glyph = new CDeployMaintenanceGlyph();
+		break;
+
+	case GLYPH_DEPLOY_WORK_SURFACE:
+		glyph = new CDeployWorkSurfaceGlyph();
+		break;
+
+	case GLYPH_DEPLOY_MINOR_RELAXATION:
+		glyph = new CDeployMinorRelaxationGlyph();
+		break;
+
+	case GLYPH_DEPLOY_SINK:
+		glyph = new CDeploySinkGlyph();
+		break;
+
+	case GLYPH_DEPLOY_MAJOR_STORAGE:
+		glyph = new CDeployMajorStorageGlyph();
+		break;
+
+	case GLYPH_SUCCUBUS_DELIVERY:
+		glyph = new CSuccubusDeliveryGlyph();
+		break;
+
 	default:
 		break;
 	}
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index 9ca6986..460907a 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -305,13 +305,13 @@ void CDeployFloralGlyph::getTooltip(CPetText *text) {
 
 /*------------------------------------------------------------------------*/
 
-bool CDeployRelaxationGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+bool CDeployFullyRelaxationGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	CToggleRemoteGlyph::setup(petControl, owner);
 	setDefaults("3PetBedfoot", petControl);
 	return true;
 }
 
-void CDeployRelaxationGlyph::getTooltip(CPetText *text) {
+void CDeployFullyRelaxationGlyph::getTooltip(CPetText *text) {
 	text->setText("Deploy fully recumbent relaxation device");
 }
 
@@ -327,4 +327,148 @@ void CDeployComfortGlyph::getTooltip(CPetText *text) {
 	text->setText("Deploy comfort workstation");
 }
 
+/*------------------------------------------------------------------------*/
+
+bool CDeployMinorStorageGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CToggleRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetDraw", petControl);
+	return true;
+}
+
+void CDeployMinorStorageGlyph::getTooltip(CPetText *text) {
+	text->setText("Deploy minor horizontally mobile storage compartment");
+}
+
+/*------------------------------------------------------------------------*/
+
+bool CDeployMajorRelaxationGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CToggleRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetArmChair", petControl);
+	return true;
+}
+
+void CDeployMajorRelaxationGlyph::getTooltip(CPetText *text) {
+	text->setText("Deploy major semi-recumbent relaxation device");
+}
+
+/*------------------------------------------------------------------------*/
+
+bool CInflateRelaxationGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CToggleRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetBedhead", petControl);
+	return true;
+}
+
+void CInflateRelaxationGlyph::getTooltip(CPetText *text) {
+	text->setText("Inflate fully recumbent relaxation device ");
+}
+
+/*------------------------------------------------------------------------*/
+
+bool CDeployMaintenanceGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CToggleRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetWashstand", petControl);
+	return true;
+}
+
+void CDeployMaintenanceGlyph::getTooltip(CPetText *text) {
+	text->setText("Deploy personal maintenance hub");
+}
+
+/*------------------------------------------------------------------------*/
+
+bool CDeployWorkSurfaceGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CToggleRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetTable", petControl);
+	return true;
+}
+
+void CDeployWorkSurfaceGlyph::getTooltip(CPetText *text) {
+	text->setText("Deploy executive horizontal worksurface");
+}
+
+/*------------------------------------------------------------------------*/
+
+bool CDeployMinorRelaxationGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CToggleRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetDeskchair", petControl);
+	return true;
+}
+
+void CDeployMinorRelaxationGlyph::getTooltip(CPetText *text) {
+	text->setText("Deploy minor semi-recumbent relaxation device");
+}
+
+/*------------------------------------------------------------------------*/
+
+bool CDeploySinkGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CToggleRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetDeskchair", petControl);
+	return true;
+}
+
+void CDeploySinkGlyph::getTooltip(CPetText *text) {
+	text->setText("Deploy aqueous cleansing receptacle");
+}
+
+/*------------------------------------------------------------------------*/
+
+bool CDeployMajorStorageGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CToggleRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetChest", petControl);
+	return true;
+}
+
+void CDeployMajorStorageGlyph::getTooltip(CPetText *text) {
+	text->setText("Deploy major horizontally mobile storage compartment");
+}
+
+/*------------------------------------------------------------------------*/
+
+bool CSuccubusDeliveryGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CPetRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetSuccubus", petControl);
+
+	if (owner) {
+		_gfxElement1 = getElement(16);
+		_gfxElement2 = getElement(17);
+	}
+
+	return true;
+}
+
+void CSuccubusDeliveryGlyph::draw2(CScreenManager *screenManager) {
+	_gfxElement1->draw(screenManager);
+	_gfxElement2->draw(screenManager);
+}
+
+bool CSuccubusDeliveryGlyph::MouseButtonDownMsg(const Point &pt) {
+	return _gfxElement1->MouseButtonDownMsg(pt)
+		|| _gfxElement2->MouseButtonDownMsg(pt);
+}
+
+bool CSuccubusDeliveryGlyph::MouseButtonUpMsg(const Point &pt) {
+	CTreeItem *target = getPetControl()->_remoteTarget;
+
+	if (_gfxElement1 && _gfxElement1->MouseButtonUpMsg(pt)) {
+		if (target) {
+			CPETDeliverMsg msg;
+			msg.execute(target);
+		}
+	} else if (_gfxElement2 && _gfxElement2->MouseButtonUpMsg(pt)) {
+		if (target) {
+			CPETReceiveMsg msg;
+			msg.execute(target);
+		}
+	} else {
+		return false;
+	}
+
+	return true;
+}
+
+void CSuccubusDeliveryGlyph::getTooltip(CPetText *text) {
+	text->setText("Succ-U-Bus delivery system control");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.h b/engines/titanic/pet_control/pet_remote_glyphs.h
index eb235bc..0043ea9 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.h
+++ b/engines/titanic/pet_control/pet_remote_glyphs.h
@@ -32,7 +32,12 @@ enum RemoteGlyph {
 	GLYPH_SUMMON_ELEVATOR = 0, GLYPH_SUMMON_PELLERATOR = 1,
 	GLYPH_TELEVISION_CONTROL = 2, GLYPH_ENTERTAINMENT_DEVICE = 3,
 	GLYPH_OPERATE_LIGHTS = 4, GLYPH_DEPLOY_FLORAL = 5,
-	GLYPH_DEPLOY_RELAXATION = 6, GLYPH_DEPLOY_COMFORT = 7
+	GLYPH_DEPLOY_FULLY_RELAXATION = 6, GLYPH_DEPLOY_COMFORT = 7,
+	GLYPH_DEPLOY_MINOR_STORAGE = 8, GLYPH_DEPLOY_MAJOR_RELAXATION = 9,
+	GLYPH_INFLATE_RELAXATION = 10, GLYPH_DEPLOY_MAINTENANCE = 11,
+	GLYPH_DEPLOY_WORK_SURFACE = 12, GLYPH_DEPLOY_MINOR_RELAXATION = 13,
+	GLYPH_DEPLOY_SINK = 14, GLYPH_DEPLOY_MAJOR_STORAGE = 15,
+	GLYPH_SUCCUBUS_DELIVERY = 16
 };
 
 enum RemoteMessage {
@@ -279,7 +284,7 @@ public:
 	virtual void getTooltip(CPetText *text);
 };
 
-class CDeployRelaxationGlyph : public CToggleRemoteGlyph {
+class CDeployFullyRelaxationGlyph : public CToggleRemoteGlyph {
 public:
 	/**
 	 * Setup the glyph
@@ -309,6 +314,114 @@ public:
 class CDeployComfortGlyph : public CToggleRemoteGlyph {
 public:
 	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt) {
+		return elementMouseButtonDownMsg(pt, 2);
+	}
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt) {
+		return elementMouseButtonUpMsg(pt, 2);
+	}
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
+class CDeployMinorStorageGlyph : public CToggleRemoteGlyph {
+public:
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt) {
+		return elementMouseButtonDownMsg(pt, 3);
+	}
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt) {
+		return elementMouseButtonUpMsg(pt, 3);
+	}
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
+class CDeployMajorRelaxationGlyph : public CToggleRemoteGlyph {
+public:
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt) {
+		return elementMouseButtonDownMsg(pt, 5);
+	}
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt) {
+		return elementMouseButtonUpMsg(pt, 5);
+	}
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
+class CInflateRelaxationGlyph : public CToggleRemoteGlyph {
+public:
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt) {
+		return elementMouseButtonDownMsg(pt, 6);
+	}
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt) {
+		return elementMouseButtonUpMsg(pt, 6);
+	}
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
+class CDeployMaintenanceGlyph : public CToggleRemoteGlyph {
+public:
+	/**
 	* Setup the glyph
 	*/
 	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
@@ -317,14 +430,14 @@ public:
 	* Called for mouse button down messages
 	*/
 	virtual bool MouseButtonDownMsg(const Point &pt) {
-		return elementMouseButtonDownMsg(pt, 2);
+		return elementMouseButtonDownMsg(pt, 7);
 	}
 
 	/**
 	* Handles mouse button up messages
 	*/
 	virtual bool MouseButtonUpMsg(const Point &pt) {
-		return elementMouseButtonUpMsg(pt, 2);
+		return elementMouseButtonUpMsg(pt, 7);
 	}
 
 	/**
@@ -333,6 +446,147 @@ public:
 	virtual void getTooltip(CPetText *text);
 };
 
+class CDeployWorkSurfaceGlyph : public CToggleRemoteGlyph {
+public:
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt) {
+		return elementMouseButtonDownMsg(pt, 8);
+	}
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt) {
+		return elementMouseButtonUpMsg(pt, 8);
+	}
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
+class CDeployMinorRelaxationGlyph : public CToggleRemoteGlyph {
+public:
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt) {
+		return elementMouseButtonDownMsg(pt, 9);
+	}
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt) {
+		return elementMouseButtonUpMsg(pt, 9);
+	}
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
+class CDeploySinkGlyph : public CToggleRemoteGlyph {
+public:
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt) {
+		return elementMouseButtonDownMsg(pt, 10);
+	}
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt) {
+		return elementMouseButtonUpMsg(pt, 10);
+	}
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
+class CDeployMajorStorageGlyph : public CToggleRemoteGlyph {
+public:
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt) {
+		return elementMouseButtonDownMsg(pt, 11);
+	}
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt) {
+		return elementMouseButtonUpMsg(pt, 11);
+	}
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
+class CSuccubusDeliveryGlyph : public CPetRemoteGlyph {
+private:
+	CPetGfxElement *_gfxElement1, *_gfxElement2;
+public:
+	CSuccubusDeliveryGlyph() : CPetRemoteGlyph(),
+		_gfxElement1(nullptr), _gfxElement2(nullptr) {}
+
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Handles any secondary drawing of the glyph
+	 */
+	virtual void draw2(CScreenManager *screenManager);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt);
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt);
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_PET_REMOTE_GLYPHS_H */


Commit: 6166c33734efdeabca0fa9d3eeda34389af6b79b
    https://github.com/scummvm/scummvm/commit/6166c33734efdeabca0fa9d3eeda34389af6b79b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:15-04:00

Commit Message:
TITANIC: Implemented more PET Remote glyph classes

Changed paths:
    engines/titanic/messages/messages.h
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_remote_glyphs.cpp
    engines/titanic/pet_control/pet_remote_glyphs.h



diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 4c8ccaf..d64972c 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -180,19 +180,6 @@ public:
 	}
 };
 
-class CTransportMsg : public CMessage {
-public:
-	CString _string;
-	int _value1, _value2;
-public:
-	CLASSDEF
-	CTransportMsg() : _value1(0), _value2(0) {}
-
-	static bool isSupportedBy(const CTreeItem *item) {
-		return supports(item, _type);
-	}
-};
-
 MESSAGE1(CTimeMsg, uint, _ticks, 0);
 
 class CTimerMsg : public CTimeMsg {
@@ -350,6 +337,7 @@ MESSAGE1(CTimeDilationMsg, int, value, 0);
 MESSAGE0(CTitleSequenceEndedMsg);
 MESSAGE0(CTransitMsg);
 MESSAGE1(CTranslateObjectMsg, Point, delta, Point());
+MESSAGE3(CTransportMsg, CString, roomName, "", int, value1, 0, int, value2, 0);
 MESSAGE1(CTriggerAutoMusicPlayerMsg, int, value, 0);
 MESSAGE1(CTriggerNPCEvent, int, value, 0);
 MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, int, value2, 0, int, value3, 0, int, value4, 0);
diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index 6dc7a1a..f2062af 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -51,7 +51,8 @@ static const byte REMOTE_DATA[] = {
 	0x09, 0x01,
 		GLYPH_SUCCUBUS_DELIVERY,
 	0x0A, 0x02, GLYPH_SUMMON_ELEVATOR, GLYPH_SUCCUBUS_DELIVERY,
-	0x0B, 0x01, 0x11,
+	0x0B, 0x01,
+		GLYPH_NAVIGATION_CONTROLLER,
 	0x0C, 0x01,
 		GLYPH_SUCCUBUS_DELIVERY,
 	0x0D, 0x01,
@@ -59,7 +60,8 @@ static const byte REMOTE_DATA[] = {
 	0x0E, 0x00,
 	0x0F, 0x01,
 		GLYPH_TELEVISION_CONTROL,
-	0x10, 0x03, 0x12, 0x14, 0x13,
+	0x10, 0x03,
+		GLYPH_BOTTOM_OF_WELL, 0x14, 0x13,
 	0x11, 0x01,
 		GLYPH_SUCCUBUS_DELIVERY,
 	0x12, 0x00,
@@ -390,6 +392,14 @@ bool CPetRemote::loadGlyph(int glyphIndex) {
 		glyph = new CSuccubusDeliveryGlyph();
 		break;
 
+	case GLYPH_NAVIGATION_CONTROLLER:
+		glyph = new CNavigationControllerGlyph();
+		break;
+
+	case GLYPH_BOTTOM_OF_WELL:
+		glyph = new CBottomOfWellGlyph();
+		break;
+
 	default:
 		break;
 	}
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index 460907a..00ddf42 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -24,6 +24,7 @@
 #include "titanic/pet_control/pet_remote.h"
 #include "titanic/pet_control/pet_control.h"
 #include "titanic/messages/pet_messages.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -118,6 +119,47 @@ bool CToggleRemoteGlyph::elementMouseButtonUpMsg(const Point &pt, int petNum) {
 
 /*------------------------------------------------------------------------*/
 
+bool CRemoteGotoGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CPetRemoteGlyph::setup(petControl, owner);
+
+	if (owner)
+		_gfxElement = getElement(7);
+
+	return true;
+}
+
+void CRemoteGotoGlyph::draw2(CScreenManager *screenManager) {
+	if (_gfxElement)
+		_gfxElement->draw(screenManager);
+}
+
+bool CRemoteGotoGlyph::MouseButtonDownMsg(const Point &pt) {
+	return _gfxElement && _gfxElement->MouseButtonDownMsg(pt);
+}
+
+bool CRemoteGotoGlyph::MouseButtonUpMsg(const Point &pt) {
+	if (!_gfxElement || !_gfxElement->MouseButtonUpMsg(pt))
+		return false;
+
+	CPetControl *petControl = getPetControl();
+	if (petControl) {
+		CGameManager *gameManager = petControl->getGameManager();
+
+		if (gameManager) {
+			CRoomItem *room = gameManager->getRoom();
+
+			if (room) {
+				CTransportMsg msg(g_vm->_roomNames[_roomIndex], 1, 0);
+				msg.execute(room);
+			}
+		}
+	}
+
+	return true;
+}
+
+/*------------------------------------------------------------------------*/
+
 bool CTelevisionControlGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	CPetRemoteGlyph::setup(petControl, owner);
 	setDefaults("3PetTV", petControl);
@@ -471,4 +513,56 @@ void CSuccubusDeliveryGlyph::getTooltip(CPetText *text) {
 	text->setText("Succ-U-Bus delivery system control");
 }
 
+/*------------------------------------------------------------------------*/
+
+bool CNavigationControllerGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CPetRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetStarField", petControl);
+
+	if (owner)
+		_gfxElement = getElement(0);
+
+	return true;
+}
+
+void CNavigationControllerGlyph::draw2(CScreenManager *screenManager) {
+	_gfxElement->setMode(_flag ? MODE_SELECTED : MODE_UNSELECTED);
+	_gfxElement->draw(screenManager);
+}
+
+bool CNavigationControllerGlyph::MouseButtonDownMsg(const Point &pt) {
+	return _gfxElement->MouseButtonDownMsg(pt);
+}
+
+bool CNavigationControllerGlyph::MouseButtonUpMsg(const Point &pt) {
+	if (!_gfxElement->MouseButtonUpMsg(pt))
+		return false;
+
+	_flag = !_flag;
+	CTreeItem *target = getPetControl()->_remoteTarget;
+	if (target) {
+		CPETHelmetOnOffMsg msg;
+		msg.execute(target);
+	}
+
+	return true;
+}
+
+void CNavigationControllerGlyph::getTooltip(CPetText *text) {
+	text->setText("Navigation controller");
+}
+
+/*------------------------------------------------------------------------*/
+
+bool CBottomOfWellGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
+	CPetRemoteGlyph::setup(petControl, owner);
+	setDefaults("3PetBotOfWell", petControl);
+
+	return true;
+}
+
+void CBottomOfWellGlyph::getTooltip(CPetText *text) {
+	text->setText("Go to the Bottom of the Well");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.h b/engines/titanic/pet_control/pet_remote_glyphs.h
index 0043ea9..e6dfc11 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.h
+++ b/engines/titanic/pet_control/pet_remote_glyphs.h
@@ -37,7 +37,8 @@ enum RemoteGlyph {
 	GLYPH_INFLATE_RELAXATION = 10, GLYPH_DEPLOY_MAINTENANCE = 11,
 	GLYPH_DEPLOY_WORK_SURFACE = 12, GLYPH_DEPLOY_MINOR_RELAXATION = 13,
 	GLYPH_DEPLOY_SINK = 14, GLYPH_DEPLOY_MAJOR_STORAGE = 15,
-	GLYPH_SUCCUBUS_DELIVERY = 16
+	GLYPH_SUCCUBUS_DELIVERY = 16, GLYPH_NAVIGATION_CONTROLLER = 17,
+	GLYPH_BOTTOM_OF_WELL = 18
 };
 
 enum RemoteMessage {
@@ -143,6 +144,34 @@ public:
 	bool elementMouseButtonUpMsg(const Point &pt, int petNum);	
 };
 
+class CRemoteGotoGlyph : public CPetRemoteGlyph {
+protected:
+	int _roomIndex;
+	CPetGfxElement *_gfxElement;
+public:
+	CRemoteGotoGlyph() : CPetRemoteGlyph(), _gfxElement(nullptr), _roomIndex(21) {}
+
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Handles any secondary drawing of the glyph
+	 */
+	virtual void draw2(CScreenManager *screenManager);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt);
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt);
+};
+
 class CSummonElevatorGlyph : public CBasicRemoteGlyph {
 public:
 	CSummonElevatorGlyph() : CBasicRemoteGlyph(
@@ -587,6 +616,55 @@ public:
 	virtual void getTooltip(CPetText *text);
 };
 
+class CNavigationControllerGlyph : public CPetRemoteGlyph {
+private:
+	bool _flag;
+	CPetGfxElement *_gfxElement;
+public:
+	CNavigationControllerGlyph() : CPetRemoteGlyph(),
+		_flag(false), _gfxElement(nullptr) {}
+
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Handles any secondary drawing of the glyph
+	 */
+	virtual void draw2(CScreenManager *screenManager);
+
+	/**
+	 * Called for mouse button down messages
+	 */
+	virtual bool MouseButtonDownMsg(const Point &pt);
+
+	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt);
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
+class CBottomOfWellGlyph : public CRemoteGotoGlyph {
+public:
+	CBottomOfWellGlyph() : CRemoteGotoGlyph() {}
+
+	/**
+	 * Setup the glyph
+	 */
+	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+};
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_PET_REMOTE_GLYPHS_H */


Commit: 77feb9d8c888444a89132113c282ee3c7766f7f1
    https://github.com/scummvm/scummvm/commit/77feb9d8c888444a89132113c282ee3c7766f7f1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:16-04:00

Commit Message:
TITANIC: Implement remaining PET Remote glyphs

Changed paths:
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_remote_glyphs.cpp
    engines/titanic/pet_control/pet_remote_glyphs.h



diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index f2062af..aac0dc8 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -61,7 +61,7 @@ static const byte REMOTE_DATA[] = {
 	0x0F, 0x01,
 		GLYPH_TELEVISION_CONTROL,
 	0x10, 0x03,
-		GLYPH_BOTTOM_OF_WELL, 0x14, 0x13,
+		GLYPH_GOTO_BOTTOM_OF_WELL, GLYPH_GOTO_STATEROOM, GLYPH_GOTO_TOP_OF_WELL,
 	0x11, 0x01,
 		GLYPH_SUCCUBUS_DELIVERY,
 	0x12, 0x00,
@@ -69,7 +69,7 @@ static const byte REMOTE_DATA[] = {
 		GLYPH_SUMMON_PELLERATOR, GLYPH_SUCCUBUS_DELIVERY,
 	0x14, 0x00,
 	0x15, 0x02,
-		0x10, GLYPH_TELEVISION_CONTROL,
+		GLYPH_SUCCUBUS_DELIVERY, GLYPH_TELEVISION_CONTROL,
 	0x16, 0x00,
 	0x17, 0x02,
 		GLYPH_SUMMON_PELLERATOR, GLYPH_SUCCUBUS_DELIVERY,
@@ -396,8 +396,35 @@ bool CPetRemote::loadGlyph(int glyphIndex) {
 		glyph = new CNavigationControllerGlyph();
 		break;
 
-	case GLYPH_BOTTOM_OF_WELL:
-		glyph = new CBottomOfWellGlyph();
+	case GLYPH_GOTO_BOTTOM_OF_WELL:
+		glyph = new CGotoBottomOfWellGlyph();
+		break;
+
+	case GLYPH_GOTO_TOP_OF_WELL:
+		glyph = new CGotoTopOfWellGlyph();
+		break;
+
+	case GLYPH_GOTO_STATEROOM:
+		glyph = new CGotoStateroomGlyph();
+		break;
+
+	case GLYPH_GOTO_BAR:
+		glyph = new CGotoBarGlyph();
+
+	case GLYPH_GOTO_PROMENADE:
+		glyph = new CGotoPromenadeDeckGlyph();
+		break;
+
+	case GLYPH_GOTO_ARBORETUM:
+		glyph = new CGotoArboretumGlyph();
+		break;
+
+	case GLYPH_GOTO_MUSIC_ROOM:
+		glyph = new CGotoMusicRoomGlyph();
+		break;
+
+	case GLYPH_GOTO_RESTAURANT:
+		glyph = new CGotoRestaurantGlyph();
 		break;
 
 	default:
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index 00ddf42..e42e082 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -121,6 +121,7 @@ bool CToggleRemoteGlyph::elementMouseButtonUpMsg(const Point &pt, int petNum) {
 
 bool CRemoteGotoGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
 	CPetRemoteGlyph::setup(petControl, owner);
+	setDefaults(_gfxName, petControl);
 
 	if (owner)
 		_gfxElement = getElement(7);
@@ -158,6 +159,10 @@ bool CRemoteGotoGlyph::MouseButtonUpMsg(const Point &pt) {
 	return true;
 }
 
+void CRemoteGotoGlyph::getTooltip(CPetText *text) {
+	text->setText(_tooltip);
+}
+
 /*------------------------------------------------------------------------*/
 
 bool CTelevisionControlGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
@@ -554,15 +559,4 @@ void CNavigationControllerGlyph::getTooltip(CPetText *text) {
 
 /*------------------------------------------------------------------------*/
 
-bool CBottomOfWellGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
-	CPetRemoteGlyph::setup(petControl, owner);
-	setDefaults("3PetBotOfWell", petControl);
-
-	return true;
-}
-
-void CBottomOfWellGlyph::getTooltip(CPetText *text) {
-	text->setText("Go to the Bottom of the Well");
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_remote_glyphs.h b/engines/titanic/pet_control/pet_remote_glyphs.h
index e6dfc11..d3541d6 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.h
+++ b/engines/titanic/pet_control/pet_remote_glyphs.h
@@ -38,7 +38,10 @@ enum RemoteGlyph {
 	GLYPH_DEPLOY_WORK_SURFACE = 12, GLYPH_DEPLOY_MINOR_RELAXATION = 13,
 	GLYPH_DEPLOY_SINK = 14, GLYPH_DEPLOY_MAJOR_STORAGE = 15,
 	GLYPH_SUCCUBUS_DELIVERY = 16, GLYPH_NAVIGATION_CONTROLLER = 17,
-	GLYPH_BOTTOM_OF_WELL = 18
+	GLYPH_GOTO_BOTTOM_OF_WELL = 18, GLYPH_GOTO_TOP_OF_WELL = 19,
+	GLYPH_GOTO_STATEROOM = 20, GLYPH_GOTO_BAR = 21,
+	GLYPH_GOTO_PROMENADE = 22, GLYPH_GOTO_ARBORETUM = 23,
+	GLYPH_GOTO_MUSIC_ROOM = 24, GLYPH_GOTO_RESTAURANT = 25
 };
 
 enum RemoteMessage {
@@ -148,8 +151,12 @@ class CRemoteGotoGlyph : public CPetRemoteGlyph {
 protected:
 	int _roomIndex;
 	CPetGfxElement *_gfxElement;
+	CString _gfxName, _tooltip;
 public:
 	CRemoteGotoGlyph() : CPetRemoteGlyph(), _gfxElement(nullptr), _roomIndex(21) {}
+	CRemoteGotoGlyph(const CString &gfxName, const CString &tooltip) : 
+		CPetRemoteGlyph(), _gfxElement(nullptr), _roomIndex(21),
+		_gfxName(gfxName), _tooltip(tooltip) {}
 
 	/**
 	 * Setup the glyph
@@ -170,6 +177,11 @@ public:
 	 * Handles mouse button up messages
 	 */
 	virtual bool MouseButtonUpMsg(const Point &pt);
+	
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
 };
 
 class CSummonElevatorGlyph : public CBasicRemoteGlyph {
@@ -650,19 +662,52 @@ public:
 	virtual void getTooltip(CPetText *text);
 };
 
-class CBottomOfWellGlyph : public CRemoteGotoGlyph {
+class CGotoBottomOfWellGlyph : public CRemoteGotoGlyph {
 public:
-	CBottomOfWellGlyph() : CRemoteGotoGlyph() {}
+	CGotoBottomOfWellGlyph() : CRemoteGotoGlyph("3PetBotOfWell",
+		"Go to the Bottom of the Well") {}
+};
 
-	/**
-	 * Setup the glyph
-	 */
-	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
+class CGotoTopOfWellGlyph : public CRemoteGotoGlyph {
+public:
+	CGotoTopOfWellGlyph() : CRemoteGotoGlyph("3PetTopOfWell",
+		"Go to the Top of the Well") {}
+};
 
-	/**
-	 * Returns the tooltip text for when the glyph is selected
-	 */
-	virtual void getTooltip(CPetText *text);
+class CGotoStateroomGlyph : public CRemoteGotoGlyph {
+public:
+	CGotoStateroomGlyph() : CRemoteGotoGlyph("3PetRoom",
+		"Go to your stateroom") {}
+};
+
+class CGotoBarGlyph : public CRemoteGotoGlyph {
+public:
+	CGotoBarGlyph() : CRemoteGotoGlyph("3PetBar",
+		"Go to the Bar") {}
+};
+
+class CGotoPromenadeDeckGlyph : public CRemoteGotoGlyph {
+public:
+	CGotoPromenadeDeckGlyph() : CRemoteGotoGlyph("3PetPromDeck",
+		"Go to the Promenade Deck") {}
+};
+
+class CGotoArboretumGlyph : public CRemoteGotoGlyph {
+public:
+	CGotoArboretumGlyph() : CRemoteGotoGlyph("3PetArboretum",
+		"Go to the Arboretum") {}
+};
+
+class CGotoMusicRoomGlyph : public CRemoteGotoGlyph {
+public:
+	CGotoMusicRoomGlyph() : CRemoteGotoGlyph("3PetMusicRoom",
+		"Go to the Music Room") {}
+};
+
+class CGotoRestaurantGlyph : public CRemoteGotoGlyph {
+public:
+	CGotoRestaurantGlyph() : CRemoteGotoGlyph("3Pet1stClassRest",
+		"Go to the First Class Restaurant") {}
 };
 
 } // End of namespace Titanic


Commit: 9ca8e2a9285708d03cd64fbfe7f28c97edb145b2
    https://github.com/scummvm/scummvm/commit/9ca8e2a9285708d03cd64fbfe7f28c97edb145b2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:17-04:00

Commit Message:
TITANIC: Implement CMovieClip methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/movie_clip.cpp
    engines/titanic/core/movie_clip.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 6d9f60d..5e601f9 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -730,4 +730,11 @@ void CGameObject::dragMove(const Point &pt) {
 	setPosition(Point(pt.x - _bounds.width() / 2, pt.y - _bounds.height() / 2));
 }
 
+bool CGameObject::clipExistsByStart(const CString &name, int startFrame) const {
+	return _clipList1.existsByStart(name, startFrame);
+}
+
+bool CGameObject::clipExistsByEnd(const CString &name, int endFrame) const {
+	return _clipList1.existsByEnd(name, endFrame);
+}
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 847d6cd..5264d0c 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -326,6 +326,18 @@ public:
 	 * Marks the area occupied by the object as dirty, requiring re-rendering
 	 */
 	void makeDirty();
+
+	/**
+	 * Returns true if a clip exists in the list with a given name
+	 * and starting frame number
+	 */
+	bool clipExistsByStart(const CString &name, int startFrame = 0) const;
+
+	/**
+	 * Returns true if a clip exists in the list with a given name
+	 * and ending frame number
+	 */
+	bool clipExistsByEnd(const CString &name, int endFrame = 0) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/movie_clip.cpp b/engines/titanic/core/movie_clip.cpp
index fdf329a..a0a6386 100644
--- a/engines/titanic/core/movie_clip.cpp
+++ b/engines/titanic/core/movie_clip.cpp
@@ -24,7 +24,13 @@
 
 namespace Titanic {
 
-CMovieClip::CMovieClip() {
+CMovieClip::CMovieClip(): ListItem(), _startFrame(0), _endFrame(0),
+	_field20(0), _field24(0), _field28(0), _field2C(0), _field30(0) {
+}
+
+CMovieClip::CMovieClip(const CString &name, int startFrame, int endFrame):
+	ListItem(), _name(name), _startFrame(startFrame), _endFrame(endFrame),
+	_field20(0), _field24(0), _field28(0), _field2C(0), _field30(0) {
 }
 
 void CMovieClip::save(SimpleFile *file, int indent) const {
@@ -76,4 +82,24 @@ CMovieClip *CMovieClipList::findByName(const Common::String &name) const {
 	return nullptr;
 }
 
+bool CMovieClipList::existsByStart(const CString &name, int startFrame) const {
+	for (const_iterator i = begin(); i != end(); ++i) {
+		CMovieClip *clip = *i;
+		if (clip->_startFrame == startFrame && clip->_name == name)
+			return true;
+	}
+
+	return false;
+}
+
+bool CMovieClipList::existsByEnd(const CString &name, int endFrame) const {
+	for (const_iterator i = begin(); i != end(); ++i) {
+		CMovieClip *clip = *i;
+		if (clip->_endFrame == endFrame && clip->_name == name)
+			return true;
+	}
+
+	return false;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/movie_clip.h b/engines/titanic/core/movie_clip.h
index 7eccc47..9ee88fd 100644
--- a/engines/titanic/core/movie_clip.h
+++ b/engines/titanic/core/movie_clip.h
@@ -46,6 +46,7 @@ public:
 public:
 	CLASSDEF
 	CMovieClip();
+	CMovieClip(const CString &name, int startFrame, int endFrame);
 
 	/**
 	 * Save the data for the class to file
@@ -63,7 +64,22 @@ public:
  */
 class CMovieClipList: public List<CMovieClip> {
 public:
+	/**
+	 * Finds and returns a movie clip in the list by name
+	 */
 	CMovieClip *findByName(const Common::String &name) const;
+
+	/**
+	 * Returns true if a clip exists in the list with a given name
+	 * and starting frame number
+	 */
+	bool existsByStart(const CString &name, int startFrame = 0) const;
+
+	/**
+	 * Returns true if a clip exists in the list with a given name
+	 * and starting frame number
+	 */
+	bool existsByEnd(const CString &name, int endFrame = 0) const;
 };
 
 } // End of namespace Titanic


Commit: 4963c9f50b53cbd663c18387d8606ad4623cca34
    https://github.com/scummvm/scummvm/commit/4963c9f50b53cbd663c18387d8606ad4623cca34
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:18-04:00

Commit Message:
TITANIC: Implement CMovieEvent & CMovieRangeInfo

Changed paths:
  A engines/titanic/support/movie_event.cpp
  A engines/titanic/support/movie_event.h
  A engines/titanic/support/movie_range_info.cpp
  A engines/titanic/support/movie_range_info.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/movie_clip.cpp
    engines/titanic/core/movie_clip.h
    engines/titanic/module.mk
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 5e601f9..e6b51f7 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -737,4 +737,16 @@ bool CGameObject::clipExistsByStart(const CString &name, int startFrame) const {
 bool CGameObject::clipExistsByEnd(const CString &name, int endFrame) const {
 	return _clipList1.existsByEnd(name, endFrame);
 }
+
+void CGameObject::checkPlayMovie(const CString &name, int flags) {
+	if (!_surface && !_resource.empty())
+		loadResource(_resource);
+
+	if (_surface ) {
+		_surface->proc35(name, flags, (flags & CLIPFLAG_4) ? this : nullptr);
+		if (flags & CLIPFLAG_PLAY)
+			getGameManager()->_gameState.addMovie(_surface->_movie);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 5264d0c..7c40c5f 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -338,6 +338,11 @@ public:
 	 * and ending frame number
 	 */
 	bool clipExistsByEnd(const CString &name, int endFrame = 0) const;
+
+	/**
+	 * Checks and plays a pending clip
+	 */
+	void checkPlayMovie(const CString &name, int flags);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/movie_clip.cpp b/engines/titanic/core/movie_clip.cpp
index a0a6386..9e5df67 100644
--- a/engines/titanic/core/movie_clip.cpp
+++ b/engines/titanic/core/movie_clip.cpp
@@ -21,16 +21,15 @@
  */
 
 #include "titanic/core/movie_clip.h"
+#include "titanic/core/game_object.h"
 
 namespace Titanic {
 
-CMovieClip::CMovieClip(): ListItem(), _startFrame(0), _endFrame(0),
-	_field20(0), _field24(0), _field28(0), _field2C(0), _field30(0) {
+CMovieClip::CMovieClip(): ListItem(), _startFrame(0), _endFrame(0) {
 }
 
 CMovieClip::CMovieClip(const CString &name, int startFrame, int endFrame):
-	ListItem(), _name(name), _startFrame(startFrame), _endFrame(endFrame),
-	_field20(0), _field24(0), _field28(0), _field2C(0), _field30(0) {
+	ListItem(), _name(name), _startFrame(startFrame), _endFrame(endFrame) {
 }
 
 void CMovieClip::save(SimpleFile *file, int indent) const {
@@ -48,14 +47,8 @@ void CMovieClip::load(SimpleFile *file) {
 
 	switch (val) {
 	case 1:
-		_name = file->readString();
-		_startFrame = file->readNumber();
-		_endFrame = file->readNumber();
-		_field20 = file->readNumber();
-		_field24 = file->readNumber();
-		_field28 = file->readNumber();
-		_field2C = file->readNumber();
-		_field30 = file->readNumber();
+		// This should never be used
+		assert(0);
 		break;
 
 	case 2:
@@ -72,6 +65,20 @@ void CMovieClip::load(SimpleFile *file) {
 	ListItem::load(file);
 }
 
+void CMovieClip::process(CGameObject *owner) {
+	int flags = 0;
+	if (_endFrame)
+		flags |= CLIPFLAG_HAS_END_FRAME;
+	if (_startFrame)
+		flags |= CLIPFLAG_HAS_START_FRAME;
+
+	warning("TODO: CMovieClip::process");
+
+	owner->checkPlayMovie(_name, flags);
+
+
+}
+
 CMovieClip *CMovieClipList::findByName(const Common::String &name) const {
 	for (const_iterator i = begin(); i != end(); ++i) {
 		CMovieClip *clip = *i;
diff --git a/engines/titanic/core/movie_clip.h b/engines/titanic/core/movie_clip.h
index 9ee88fd..6486259 100644
--- a/engines/titanic/core/movie_clip.h
+++ b/engines/titanic/core/movie_clip.h
@@ -27,16 +27,21 @@
 
 namespace Titanic {
 
+enum ClipFlag { 
+	CLIPFLAG_HAS_END_FRAME = 1,
+	CLIPFLAG_4 = 4,
+	CLIPFLAG_HAS_START_FRAME = 8,
+	CLIPFLAG_PLAY = 0x10
+};
+
+class CGameObject;
+
 /**
  * Movie clip
  */
 class CMovieClip : public ListItem {
 private:
-	int _field20;
-	int _field24;
-	int _field28;
-	int _field2C;
-	int _field30;
+	Common::List<void *> _items;
 	CString _string2;
 	CString _string3;
 public:
@@ -57,6 +62,8 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
+
+	void process(CGameObject *owner);
 };
 
 /**
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index ae0c563..f570311 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -436,6 +436,8 @@ MODULE_OBJS := \
 	support/image_decoders.o \
 	support/mouse_cursor.o \
 	support/movie.o \
+	support/movie_event.o \
+	support/movie_range_info.o \
 	support/proximity.o \
 	support/rect.o \
 	support/screen_manager.o \
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 3ae2636..1c94cab 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -91,7 +91,7 @@ void OSMovie::proc11() {
 	warning("TODO: OSMovie::proc11");
 }
 
-void OSMovie::proc12() {
+void OSMovie::proc12(const CString &name, int flags, CGameObject *obj) {
 	warning("TODO: OSMovie::proc12");
 }
 
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index 644f582..20de84a 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -61,7 +61,7 @@ public:
 	
 	virtual void proc10() = 0;
 	virtual void proc11() = 0;
-	virtual void proc12() = 0;
+	virtual void proc12(const CString &name, int flags, CGameObject *obj) = 0;
 
 	/**
 	 * Stops the movie
@@ -119,7 +119,7 @@ public:
 	
 	virtual void proc10();
 	virtual void proc11();
-	virtual void proc12();
+	virtual void proc12(const CString &name, int flags, CGameObject *obj);
 
 	/**
 	 * Stops the movie
diff --git a/engines/titanic/support/movie_event.cpp b/engines/titanic/support/movie_event.cpp
new file mode 100644
index 0000000..b3e788e
--- /dev/null
+++ b/engines/titanic/support/movie_event.cpp
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/movie_event.h"
+
+namespace Titanic {
+
+CMovieEvent::CMovieEvent() : ListItem(), _fieldC(0), _field10(0),
+	_field14(0), _field1C(0) {
+}
+
+CMovieEvent::CMovieEvent(const CMovieEvent *src) {
+	_fieldC = src->_fieldC;
+	_field10 = src->_field10;
+	_field14 = src->_field14;
+	_field18 = src->_field18;
+	_field1C = src->_field1C;
+}
+
+void CMovieEvent::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	file->writeNumberLine(_fieldC, indent + 1);
+	file->writeNumberLine(_field10, indent + 1);
+	file->writeNumberLine(_field14, indent + 1);
+	file->writeNumberLine(_field1C, indent + 1);
+
+	ListItem::save(file, indent);
+}
+
+void CMovieEvent::load(SimpleFile *file) {
+	int val = file->readNumber();
+	if (!val) {
+		_fieldC = file->readNumber();
+		_field10 = file->readNumber();
+		_field14 = file->readNumber();
+		_field1C = file->readNumber();
+	}
+
+	ListItem::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/movie_event.h b/engines/titanic/support/movie_event.h
new file mode 100644
index 0000000..5c62220
--- /dev/null
+++ b/engines/titanic/support/movie_event.h
@@ -0,0 +1,58 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVIE_EVENT_H
+#define TITANIC_MOVIE_EVENT_H
+
+#include "titanic/core/list.h"
+
+namespace Titanic {
+
+class CMovieEvent : public ListItem {
+public:
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+	int _field1C;
+public:
+	CMovieEvent();
+	CMovieEvent(const CMovieEvent *src);
+	virtual ~CMovieEvent() {}
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+class CMovieEventList : public List<CMovieEvent> {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVIE_EVENT_H */
diff --git a/engines/titanic/support/movie_range_info.cpp b/engines/titanic/support/movie_range_info.cpp
new file mode 100644
index 0000000..6242673
--- /dev/null
+++ b/engines/titanic/support/movie_range_info.cpp
@@ -0,0 +1,67 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/movie_range_info.h"
+
+namespace Titanic {
+
+CMovieRangeInfo::CMovieRangeInfo() : ListItem(), _fieldC(0),
+		_field10(0), _field14(0), _field18(0), _field1C(0) {
+}
+
+CMovieRangeInfo::CMovieRangeInfo(const CMovieRangeInfo *src) : ListItem() {
+	_fieldC = src->_fieldC;
+	_field10 = src->_field10;
+	_field14 = src->_field14;
+	_field18 = src->_field18;
+	_field1C = src->_field1C;
+
+	// Duplicate the events list
+	for (CMovieEventList::const_iterator i = _events.begin();
+			i != _events.end(); ++i) {
+		_events.push_back(new CMovieEvent(*i));
+	}
+}
+
+void CMovieRangeInfo::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(0, indent);
+	file->writeNumberLine(_fieldC, indent + 1);
+	file->writeNumberLine(_field10, indent + 1);
+	file->writeNumberLine(_field14, indent + 1);
+	file->writeNumberLine(_field1C, indent + 1);
+	file->writeNumberLine(_field18, indent + 1);
+	_events.save(file, indent + 1);
+}
+
+void CMovieRangeInfo::load(SimpleFile *file) {
+	int val = file->readNumber();
+	if (!val) {
+		_fieldC = file->readNumber();
+		_field10 = file->readNumber();
+		_field14 = file->readNumber();
+		_field1C = file->readNumber();
+		_field18 = file->readNumber();
+		_events.load(file);
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/movie_range_info.h b/engines/titanic/support/movie_range_info.h
new file mode 100644
index 0000000..e751e30
--- /dev/null
+++ b/engines/titanic/support/movie_range_info.h
@@ -0,0 +1,64 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVIE_RANGE_INFO_H
+#define TITANIC_MOVIE_RANGE_INFO_H
+
+#include "video/video_decoder.h"
+#include "titanic/core/list.h"
+#include "titanic/core/resource_key.h"
+#include "titanic/support/movie_event.h"
+
+namespace Titanic {
+
+class CMovieRangeInfo : public ListItem {
+public:
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+	int _field1C;
+	CMovieEventList _events;
+public:
+	CMovieRangeInfo();
+	CMovieRangeInfo(const CMovieRangeInfo *src);
+	virtual ~CMovieRangeInfo() {}
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+
+	/**
+	 * Adds an event to the events list
+	 */
+	void add(CMovieEvent *movieEvent) { _events.push_back(movieEvent); }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVIE_RANGE_INFO_H */
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index e6b2fa7..813138d 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -402,6 +402,12 @@ void OSVideoSurface::playMovie(uint startFrame, uint endFrame, int v3, bool v4)
 	}
 }
 
+void OSVideoSurface::proc35(const CString &name, int flags, CGameObject *owner) {
+	if (loadIfReady() && _movie) {
+		_movie->proc12(name, flags, owner);
+	}
+}
+
 void OSVideoSurface::stopMovie() {
 	if (_movie)
 		_movie->stop();
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 7521a53..aee28be 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -166,6 +166,8 @@ public:
 	 */
 	virtual void playMovie(uint startFrame, uint endFrame, int v3, bool v4) = 0;
 
+	virtual void proc35(const CString &name, int flags, CGameObject *owner) = 0;
+
 	/**
 	 * Stops any movie currently attached to the surface
 	 */
@@ -329,6 +331,8 @@ public:
 	 */
 	virtual void playMovie(uint startFrame, uint endFrame, int v3, bool v4);
 
+	virtual void proc35(const CString &name, int flags, CGameObject *owner);
+
 	/**
 	 * Stops any movie currently attached to the surface
 	 */


Commit: b79ed60a8eca775613ec0b36d345dd8fcb4e5f08
    https://github.com/scummvm/scummvm/commit/b79ed60a8eca775613ec0b36d345dd8fcb4e5f08
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:19-04:00

Commit Message:
TITANIC: Added loadSound, support methods, and CSoundItem class

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/sound/sound.cpp
    engines/titanic/sound/sound.h
    engines/titanic/sound/sound_manager.cpp
    engines/titanic/sound/sound_manager.h
    engines/titanic/support/files_manager.cpp
    engines/titanic/support/files_manager.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index e6b51f7..d1991a4 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -239,7 +239,7 @@ void CGameObject::loadResource(const CString &name) {
 }
 
 void CGameObject::loadMovie(const CString &name, bool pendingFlag) {
-	g_vm->_filesManager.fn5(name);
+	g_vm->_filesManager.preload(name);
 
 	// Create the surface if it doesn't already exist
 	if (!_surface) {
@@ -272,7 +272,7 @@ void CGameObject::loadImage(const CString &name, bool pendingFlag) {
 			_surface = nullptr;
 		}
 
-		g_vm->_filesManager.fn5(name);
+		g_vm->_filesManager.preload(name);
 
 		if (!name.empty()) {
 			_surface = new OSVideoSurface(screenManager, CResourceKey(name), pendingFlag);
@@ -749,4 +749,13 @@ void CGameObject::checkPlayMovie(const CString &name, int flags) {
 	}
 }
 
+void CGameObject::loadSound(const CString &name) {
+	CGameManager *gameManager = getGameManager();
+	if (gameManager) {
+		g_vm->_filesManager.preload(name);
+		if (!name.empty())
+			gameManager->_sound.loadSound(name);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 7c40c5f..5bcba77 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -220,6 +220,11 @@ protected:
 	 * Support function for drag moving
 	 */
 	void dragMove(const Point &pt);
+
+	/**
+	 * Load a sound
+	 */
+	void loadSound(const CString &name);
 public:
 	int _field60;
 	CursorId _cursorId;
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index b3b783d..68fb3ae 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -64,4 +64,63 @@ void CSound::fn3(int val, int val2, int val3) {
 	warning("TODO: CSound::fn3");
 }
 
+uint CSound::loadSound(const CString &name) {
+	checkSounds();
+
+	// Check whether an entry for the given name is already active
+	for (CSoundItemList::iterator i = _sounds.begin(); i != _sounds.end(); ++i) {
+		CSoundItem *soundItem = *i;
+		if (soundItem->_name == name) {
+			// Found it, so move it to the front of the list and return
+			_sounds.remove(soundItem);
+			_sounds.push_front(soundItem);
+			return soundItem->_soundHandle;
+		}
+	}
+
+	// Create new sound item
+	CSoundItem *soundItem = new CSoundItem(name);
+	soundItem->_soundHandle = _soundManager.loadSound(name);
+
+	if (!soundItem->_soundHandle) {
+		// Could load sound, so destroy new item and return
+		delete soundItem;
+		return 0;
+	}
+
+	// Add the item to the list of sounds
+	_sounds.push_front(soundItem);
+
+	// If there are more than 10 sounds loaded, remove the last one,
+	// which is the least recently used of all of them
+	if (_sounds.size() > 10)
+		removeOldest();
+
+	return soundItem->_soundHandle;
+}
+
+void CSound::checkSounds() {
+	for (CSoundItemList::iterator i = _sounds.begin(); i != _sounds.end(); ++i) {
+		CSoundItem *soundItem = *i;
+		if (soundItem->_field24 && soundItem->_field28) {
+			if (_soundManager.isActive(soundItem->_soundHandle)) {
+				_sounds.remove(soundItem);
+				delete soundItem;
+			}
+		}
+	}
+}
+
+void CSound::removeOldest() {
+	for (CSoundItemList::iterator i = _sounds.reverse_begin();
+			i != _sounds.end(); --i) {
+		CSoundItem *soundItem = *i;
+		if (soundItem->_field28 && !_soundManager.isActive(soundItem->_soundHandle)) {
+			_sounds.remove(soundItem);
+			delete soundItem;
+			break;
+		}
+	}
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index 488d4de..19a8edf 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -25,15 +25,46 @@
 
 #include "titanic/support/simple_file.h"
 #include "titanic/sound/sound_manager.h"
+#include "titanic/core/list.h"
 #include "titanic/core/view_item.h"
 
 namespace Titanic {
 
 class CGameManager;
 
+class CSoundItem : public ListItem {
+public:
+	CString _name;
+	uint _soundHandle;
+	int _field1C;
+	int _field20;
+	int _field24;
+	int _field28;
+public:
+	CSoundItem() : ListItem(), _soundHandle(0), _field1C(0),
+		_field20(0), _field24(0), _field28(0) {}
+	CSoundItem(const CString &name) : ListItem(), _name(name), 
+		_soundHandle(0), _field1C(0), _field20(0), _field24(0), _field28(0) {}
+};
+
+class CSoundItemList : public List<CSoundItem> {
+};
+
 class CSound {
 private:
 	CGameManager *_gameManager;
+	CSoundItemList _sounds;
+private:
+	/**
+	 * Check whether any sounds are done and can be be removed
+	 */
+	void checkSounds();
+
+	/**
+	 * Removes the oldest sound from the sounds list that isn't
+	 * currently playing
+	 */
+	void removeOldest();
 public:
 	QSoundManager _soundManager;
 public:
@@ -74,6 +105,13 @@ public:
 	 */
 	void preEnterView(CViewItem *newView, bool isNewRoom);
 
+	/**
+	 * Load a sound
+	 * @param name		Name of sound resource
+	 * @returns			Sound handle Id
+	 */
+	uint loadSound(const CString &name);
+
 	bool fn1(int val);
 	void fn2(int val);
 	void fn3(int val, int val2, int val3);
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index 53e5a3d..5c26527 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -34,7 +34,7 @@ QSoundManager::QSoundManager() : _field18(0), _field1C(0) {
 	Common::fill(&_field4A0[0], &_field4A0[16], 0);
 }
 
-int QSoundManager::proc3() {
+uint QSoundManager::loadSound(const CString &name) {
 	warning("TODO");
 	return 0;
 }
@@ -86,9 +86,9 @@ bool QSoundManager::proc14() {
 	return false;
 }
 
-int QSoundManager::proc15() {
+bool QSoundManager::isActive(uint handle) const {
 	warning("TODO");
-	return 0;
+	return false;
 }
 
 int QSoundManager::proc16() {
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index 68843dd..84d9aeb 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -37,7 +37,13 @@ protected:
 public:
 	SoundManager();
 	
-	virtual int proc3() const { return 0; }
+	/**
+	 * Loads a sound
+	 * @param name		Name of sound resource
+	 * @returns			Loaded sound handle
+	 */
+	virtual uint loadSound(const CString &name) { return 0; }
+
 	virtual int proc4() const { return 0; }
 	virtual int proc5() const { return 0; }
 	virtual void proc6() = 0;
@@ -49,7 +55,7 @@ public:
 	virtual void proc12() {}
 	virtual void proc13() {}
 	virtual bool proc14() = 0;
-	virtual int proc15() const { return 0; }
+	virtual bool isActive(uint handle) const { return false; }
 	virtual int proc16() const { return 0; }
 	virtual void WaveMixPump() {}
 	virtual int proc18() const { return 0; }
@@ -100,7 +106,13 @@ public:
 public:
 	QSoundManager();
 
-	virtual int proc3();
+	/**
+	 * Loads a sound
+	 * @param name		Name of sound resource
+	 * @returns			Loaded sound handle
+	 */
+	virtual uint loadSound(const CString &name);
+
 	virtual int proc4();
 	virtual int proc5();
 	virtual void proc6();
@@ -112,7 +124,7 @@ public:
 	virtual void proc12();
 	virtual void proc13();
 	virtual bool proc14();
-	virtual int proc15();
+	virtual bool isActive(uint handle) const;
 	virtual int proc16();
 	virtual void WaveMixPump();
 	virtual int proc18() const;
diff --git a/engines/titanic/support/files_manager.cpp b/engines/titanic/support/files_manager.cpp
index 6cd6bfb..8e70387 100644
--- a/engines/titanic/support/files_manager.cpp
+++ b/engines/titanic/support/files_manager.cpp
@@ -89,8 +89,8 @@ void CFilesManager::fn4(const CString &name) {
 	warning("TODO: CFilesManager::fn4");
 }
 
-void CFilesManager::fn5(const CString &name) {
-	warning("TODO: CFilesManager::fn5");
+void CFilesManager::preload(const CString &name) {
+	// We don't currently do any preloading of resources
 }
 
 Common::SeekableReadStream *CFilesManager::getResource(
diff --git a/engines/titanic/support/files_manager.h b/engines/titanic/support/files_manager.h
index ae66469..185670c 100644
--- a/engines/titanic/support/files_manager.h
+++ b/engines/titanic/support/files_manager.h
@@ -82,7 +82,10 @@ public:
 
 	void fn4(const CString &name);
 
-	void fn5(const CString &name);
+	/**
+	 * Preloads and caches a file for access shortly
+	 */
+	void preload(const CString &name);
 
 	/**
 	 * Get a resource from the executable


Commit: 6948a44ac41f3da70b0cd675e7e9eb96117c54fa
    https://github.com/scummvm/scummvm/commit/6948a44ac41f3da70b0cd675e7e9eb96117c54fa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:21-04:00

Commit Message:
TITANIC: Implemented stopSound

Changed paths:
  A engines/titanic/sound/wave_file.cpp
  A engines/titanic/sound/wave_file.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/television.cpp
    engines/titanic/game/television.h
    engines/titanic/module.mk
    engines/titanic/sound/sound.cpp
    engines/titanic/sound/sound.h
    engines/titanic/sound/sound_manager.cpp
    engines/titanic/sound/sound_manager.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index d1991a4..1d5c974 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -325,18 +325,6 @@ bool CGameObject::soundFn1(int val) {
 	return false;
 }
 
-void CGameObject::soundFn2(int val, int val2) {
-	if (val != 0 && val != -1) {
-		CGameManager *gameManager = getGameManager();
-		if (gameManager) {
-			if (val2)
-				gameManager->_sound.fn3(val, 0, val2);
-			else
-				gameManager->_sound.fn2(val);
-		}
-	}
-}
-
 void CGameObject::setVisible(bool val) {
 	if (val != _visible) {
 		_visible = val;
@@ -456,7 +444,16 @@ void CGameObject::sound8(bool flag) const {
 	getGameManager()->_sound.managerProc8(flag ? 3 : 0);
 }
 
-bool CGameObject::playSound(const CString &name, int val2, int val3, int val4) {
+void CGameObject::loadSound(const CString &name) {
+	CGameManager *gameManager = getGameManager();
+	if (gameManager) {
+		g_vm->_filesManager.preload(name);
+		if (!name.empty())
+			gameManager->_sound.loadSound(name);
+	}
+}
+
+int CGameObject::playSound(const CString &name, int val2, int val3, int val4) {
 	CProximity prox;
 	prox._field8 = val2;
 	prox._fieldC = val3;
@@ -464,12 +461,24 @@ bool CGameObject::playSound(const CString &name, int val2, int val3, int val4) {
 	return playSound(name, prox);
 }
 
-bool CGameObject::playSound(const CString &name, CProximity &prox) {
+int CGameObject::playSound(const CString &name, CProximity &prox) {
 	if (prox._field28 == 2) {
 		// TODO
 	}
 
-	return false;
+	return 0;
+}
+
+void CGameObject::stopSound(int handle, int val2) {
+	if (handle != 0 && handle != -1) {
+		CGameManager *gameManager = getGameManager();
+		if (gameManager) {
+			if (val2)
+				gameManager->_sound.fn3(handle, 0, val2);
+			else
+				gameManager->_sound.fn2(handle);
+		}
+	}
 }
 
 int CGameObject::addTimer(int endVal, uint firstDuration, uint duration) {
@@ -749,13 +758,4 @@ void CGameObject::checkPlayMovie(const CString &name, int flags) {
 	}
 }
 
-void CGameObject::loadSound(const CString &name) {
-	CGameManager *gameManager = getGameManager();
-	if (gameManager) {
-		g_vm->_filesManager.preload(name);
-		if (!name.empty())
-			gameManager->_sound.loadSound(name);
-	}
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 5bcba77..01fe503 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -123,20 +123,29 @@ protected:
 	CViewItem * parseView(const CString &viewString);
 
 	bool soundFn1(int val);
-	void soundFn2(int val, int val2);
 	void petFn2(int val);
 	void petFn3(CTreeItem *item);
 	void incState38();
 
 	/**
+	 * Load a sound
+	 */
+	void loadSound(const CString &name);
+
+	/**
 	 * Plays a sound
 	 */
-	bool playSound(const CString &name, int val2, int val3, int val4);
+	int playSound(const CString &name, int val2, int val3, int val4);
 
 	/**
 	 * Plays a sound
 	 */
-	bool playSound(const CString &name, CProximity &prox);
+	int playSound(const CString &name, CProximity &prox);
+
+	/**
+	 * Stop a sound
+	 */
+	void stopSound(int handle, int val2);
 
 	/**
 	 * Adds a timer
@@ -220,11 +229,6 @@ protected:
 	 * Support function for drag moving
 	 */
 	void dragMove(const Point &pt);
-
-	/**
-	 * Load a sound
-	 */
-	void loadSound(const CString &name);
 public:
 	int _field60;
 	CursorId _cursorId;
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 8884009..280f7f2 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -51,7 +51,7 @@ int CTelevision::_v5;
 int CTelevision::_v6;
 
 CTelevision::CTelevision() : CBackground(), _fieldE0(1),
-	_fieldE4(7), _isOn(false), _fieldEC(0), _fieldF0(0) {
+	_fieldE4(7), _isOn(false), _fieldEC(0), _soundHandle(0) {
 }
 
 void CTelevision::init() {
@@ -76,7 +76,7 @@ void CTelevision::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_v3, indent);
 	file->writeNumberLine(_fieldEC, indent);
 	file->writeNumberLine(_v4, indent);
-	file->writeNumberLine(_fieldF0, indent);
+	file->writeNumberLine(_soundHandle, indent);
 	file->writeNumberLine(_v5, indent);
 	file->writeNumberLine(_v6, indent);
 
@@ -93,7 +93,7 @@ void CTelevision::load(SimpleFile *file) {
 	_v3 = file->readNumber();
 	_fieldEC = file->readNumber();
 	_v4 = file->readNumber();
-	_fieldF0 = file->readNumber();
+	_soundHandle = file->readNumber();
 	_v5 = file->readNumber();
 	_v6 = file->readNumber();
 
@@ -103,8 +103,8 @@ void CTelevision::load(SimpleFile *file) {
 bool CTelevision::LeaveViewMsg(CLeaveViewMsg *msg) {
 	clearPet();
 	if (_isOn) {
-		if (soundFn1(_fieldF0))
-			soundFn2(_fieldF0, 0);
+		if (soundFn1(_soundHandle))
+			stopSound(_soundHandle, 0);
 
 		loadFrame(622);
 		stopMovie();
@@ -153,8 +153,8 @@ static const int END_FRAMES[8] = { 0, 55, 111, 167, 223, 279, 335, 391 };
 
 bool CTelevision::PETUpMsg(CPETUpMsg *msg) {
 	if (msg->_name == "Television" && _isOn) {
-		if (soundFn1(_fieldF0))
-			soundFn2(_fieldF0, 0);
+		if (soundFn1(_soundHandle))
+			stopSound(_soundHandle, 0);
 
 		_fieldE0 = _fieldE0 % _fieldE4 + 1;
 		stopMovie();
@@ -166,8 +166,8 @@ bool CTelevision::PETUpMsg(CPETUpMsg *msg) {
 
 bool CTelevision::PETDownMsg(CPETDownMsg *msg) {
 	if (msg->_name == "Television" && _isOn) {
-		if (soundFn1(_fieldF0))
-			soundFn2(_fieldF0, 0);
+		if (soundFn1(_soundHandle))
+			stopSound(_soundHandle, 0);
 		if (--_fieldE0 < 1)
 			_fieldE0 += _fieldE4;
 
@@ -215,8 +215,8 @@ bool CTelevision::PETActivateMsg(CPETActivateMsg *msg) {
 			_fieldE0 = 1;
 		} else {
 			stopMovie();
-			if (soundFn1(_fieldF0))
-				soundFn2(_fieldF0, 0);
+			if (soundFn1(_soundHandle))
+				stopSound(_soundHandle, 0);
 			
 			setVisible(false);
 		}
@@ -236,7 +236,7 @@ bool CTelevision::MovieEndMsg(CMovieEndMsg *msg) {
 
 	if (_fieldE0 == 3 && compareRoomNameTo("SGTState") && !getPassengerClass()) {
 		playSound("z#47.wav", 100, 0, 0);
-		_fieldF0 = playSound("b#20.wav", 100, 0, 0);
+		_soundHandle = playSound("b#20.wav", 100, 0, 0);
 		CTreeItem *magazine = getRoot()->findByName("Magazine");
 
 		if (magazine) {
diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
index 4c16a32..64202c7 100644
--- a/engines/titanic/game/television.h
+++ b/engines/titanic/game/television.h
@@ -56,7 +56,7 @@ private:
 	int _fieldE4;
 	bool _isOn;
 	int _fieldEC;
-	int _fieldF0;
+	int _soundHandle;
 public:
 	CLASSDEF
 	CTelevision();
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index f570311..778226d 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -412,6 +412,7 @@ MODULE_OBJS := \
 	sound/view_auto_sound_player.o \
 	sound/view_toggles_other_music.o \
 	sound/water_lapping_sounds.o \
+	sound/wave_file.o \
 	star_control/star_control.o \
 	star_control/star_control_sub1.o \
 	star_control/star_control_sub2.o \
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index 68fb3ae..3e4f154 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -56,11 +56,11 @@ bool CSound::fn1(int val) {
 	return false;
 }
 
-void CSound::fn2(int val) {
+void CSound::fn2(int handle) {
 	warning("TODO: CSound::fn3");
 }
 
-void CSound::fn3(int val, int val2, int val3) {
+void CSound::fn3(int handle, int val2, int val3) {
 	warning("TODO: CSound::fn3");
 }
 
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index 19a8edf..dfbee0a 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -35,7 +35,7 @@ class CGameManager;
 class CSoundItem : public ListItem {
 public:
 	CString _name;
-	uint _soundHandle;
+	int _soundHandle;
 	int _field1C;
 	int _field20;
 	int _field24;
@@ -113,8 +113,8 @@ public:
 	uint loadSound(const CString &name);
 
 	bool fn1(int val);
-	void fn2(int val);
-	void fn3(int val, int val2, int val3);
+	void fn2(int handle);
+	void fn3(int handle, int val2, int val3);
 	void managerProc8(int v) { _soundManager.proc8(v); }
 };
 
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index 5c26527..fa1e5fb 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -34,7 +34,7 @@ QSoundManager::QSoundManager() : _field18(0), _field1C(0) {
 	Common::fill(&_field4A0[0], &_field4A0[16], 0);
 }
 
-uint QSoundManager::loadSound(const CString &name) {
+int QSoundManager::loadSound(const CString &name) {
 	warning("TODO");
 	return 0;
 }
@@ -86,7 +86,7 @@ bool QSoundManager::proc14() {
 	return false;
 }
 
-bool QSoundManager::isActive(uint handle) const {
+bool QSoundManager::isActive(int handle) const {
 	warning("TODO");
 	return false;
 }
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index 84d9aeb..e9fd1fa 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -42,7 +42,7 @@ public:
 	 * @param name		Name of sound resource
 	 * @returns			Loaded sound handle
 	 */
-	virtual uint loadSound(const CString &name) { return 0; }
+	virtual int loadSound(const CString &name) { return 0; }
 
 	virtual int proc4() const { return 0; }
 	virtual int proc5() const { return 0; }
@@ -55,7 +55,7 @@ public:
 	virtual void proc12() {}
 	virtual void proc13() {}
 	virtual bool proc14() = 0;
-	virtual bool isActive(uint handle) const { return false; }
+	virtual bool isActive(int handle) const { return false; }
 	virtual int proc16() const { return 0; }
 	virtual void WaveMixPump() {}
 	virtual int proc18() const { return 0; }
@@ -111,7 +111,7 @@ public:
 	 * @param name		Name of sound resource
 	 * @returns			Loaded sound handle
 	 */
-	virtual uint loadSound(const CString &name);
+	virtual int loadSound(const CString &name);
 
 	virtual int proc4();
 	virtual int proc5();
@@ -124,7 +124,7 @@ public:
 	virtual void proc12();
 	virtual void proc13();
 	virtual bool proc14();
-	virtual bool isActive(uint handle) const;
+	virtual bool isActive(int handle) const;
 	virtual int proc16();
 	virtual void WaveMixPump();
 	virtual int proc18() const;
diff --git a/engines/titanic/sound/wave_file.cpp b/engines/titanic/sound/wave_file.cpp
new file mode 100644
index 0000000..288f5f5
--- /dev/null
+++ b/engines/titanic/sound/wave_file.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/sound/wave_file.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic z
diff --git a/engines/titanic/sound/wave_file.h b/engines/titanic/sound/wave_file.h
new file mode 100644
index 0000000..0bb836e
--- /dev/null
+++ b/engines/titanic/sound/wave_file.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_WAVE_FILE_H
+#define TITANIC_WAVE_FILE_H
+
+#include "titanic/support/simple_file.h"
+
+namespace Titanic {
+
+class CSoundManager;
+
+class WaveFile {
+public:
+	int _field0;
+	int _field4;
+	int _field8;
+	uint _handle;
+	CSoundManager *_owner;
+	int _field14;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+	int _field28;
+	int _field2C;
+public:
+	WaveFile() : _field0(2), _field4(0), _field8(0), _handle(0),
+		_owner(nullptr), _field14(1), _field18(0), _field1C(0),
+		_field20(0), _field24(0), _field28(0), _field2C(-1) {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_WAVE_FILE_H */


Commit: f5a82bae97badd29822627029c82a09e8dfb9ed6
    https://github.com/scummvm/scummvm/commit/f5a82bae97badd29822627029c82a09e8dfb9ed6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:22-04:00

Commit Message:
TITANIC: Implemented sound & true talk call methods in CGameObject

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 1d5c974..3406de6 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -315,16 +315,24 @@ void CGameObject::makeDirty() {
 	makeDirty(_bounds);
 }
 
-bool CGameObject::soundFn1(int val) {
-	if (val != 0 && val != -1) {
+bool CGameObject::soundFn1(int handle) {
+	if (handle != 0 && handle != -1) {
 		CGameManager *gameManager = getGameManager();
 		if (gameManager)
-			return gameManager->_sound.fn1(val);
+			return gameManager->_sound.fn1(handle);
 	}
 
 	return false;
 }
 
+void CGameObject::soundFn3(int handle, int val2, int val3) {
+	if (handle != 0 && handle != -1) {
+		CGameManager *gameManager = getGameManager();
+		if (gameManager)
+			return gameManager->_sound.fn3(handle, val2, val3);
+	}
+}
+
 void CGameObject::setVisible(bool val) {
 	if (val != _visible) {
 		_visible = val;
@@ -690,6 +698,10 @@ void CGameObject::incState38() {
 	getGameManager()->_gameState.inc38();
 }
 
+void CGameObject::trueTalkFn1(const CString &name, int val2, int val3) {
+	trueTalkFn1(getRoot()->findByName(name), val2, val3);
+}
+
 void CGameObject::trueTalkFn1(CTreeItem *item, int val2, int val3) {
 	CGameManager *gameManager = getGameManager();
 	if (gameManager) {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 01fe503..8a56945 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -122,7 +122,6 @@ protected:
 	 */
 	CViewItem * parseView(const CString &viewString);
 
-	bool soundFn1(int val);
 	void petFn2(int val);
 	void petFn3(CTreeItem *item);
 	void incState38();
@@ -147,6 +146,10 @@ protected:
 	 */
 	void stopSound(int handle, int val2);
 
+	bool soundFn1(int handle);
+
+	void soundFn3(int handle, int val2, int val3);
+
 	/**
 	 * Adds a timer
 	 */
@@ -213,6 +216,8 @@ protected:
 	 */
 	void moveToView();
 
+	void trueTalkFn1(const CString &name, int val2, int val3);
+
 	void trueTalkFn1(CTreeItem *item, int val2, int val3);
 
 	/**
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index b97b519..827cda9 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/true_talk/true_talk_manager.h"
 #include "titanic/core/tree_item.h"
+#include "titanic/game_manager.h"
 
 #define MKTAG_BE(a3,a2,a1,a0) ((uint32)((a3) | ((a2) << 8) | ((a1) << 16) | ((a0) << 24)))
 
@@ -191,7 +192,7 @@ void CTrueTalkManager::update2() {
 	//warning("CTrueTalkManager::update2");
 }
 
-void CTrueTalkManager::fn1(CTreeItem *item, int val2, int val3) {
+void CTrueTalkManager::fn1(CTreeItem *npc, int val2, int val3) {
 	warning("CTrueTalkManager::fn1");
 }
 
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 9da1c06..8d2ea65 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -112,7 +112,7 @@ public:
 
 	void update2();
 
-	void fn1(CTreeItem *item, int val2, int val3);
+	void fn1(CTreeItem *npc, int val2, int val3);
 
 	/**
 	 * Return a TrueTalk talker/script


Commit: 07cbf78fe119058b196127827638ab0d8bc71b7e
    https://github.com/scummvm/scummvm/commit/07cbf78fe119058b196127827638ab0d8bc71b7e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:23-04:00

Commit Message:
TITANIC: Implemented CTrueTalkManager getNpcScript

Changed paths:
    engines/titanic/carry/carry_parrot.cpp
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index 598393b..6bf536e 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -167,9 +167,9 @@ bool CCarryParrot::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
 		return CCarry::PassOnDragStartMsg(msg);
 	}
 
-	CTreeItem *treeItem = getRoot()->findByName(_string6);
-	if (treeItem)
-		trueTalkFn1(treeItem, 0x446BF, 0);
+	CGameObject *npc = static_cast<CGameObject *>(getRoot()->findByName(_string6));
+	if (npc)
+		trueTalkFn1(npc, 0x446BF, 0);
 
 	_fieldE0 = 0;
 	playSound("z#475.wav", 100, 0, 0);
@@ -198,9 +198,9 @@ bool CCarryParrot::UseWithCharMsg(CUseWithCharMsg *msg) {
 
 bool CCarryParrot::ActMsg(CActMsg *msg) {
 	if (msg->_action == "FreeParrot" && (CParrot::_v4 == 4 || CParrot::_v4 == 1)) {
-		CTreeItem *treeItem = getRoot()->findByName(_string6);
-		if (treeItem)
-			trueTalkFn1(treeItem, 0x446BF, 0);
+		CGameObject *npc = static_cast<CGameObject *>(getRoot()->findByName(_string6));
+		if (npc)
+			trueTalkFn1(npc, 0x446BF, 0);
 
 		setVisible(false);
 		_fieldE0 = 0;
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 3406de6..1b76ec1 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -699,15 +699,16 @@ void CGameObject::incState38() {
 }
 
 void CGameObject::trueTalkFn1(const CString &name, int val2, int val3) {
-	trueTalkFn1(getRoot()->findByName(name), val2, val3);
+	CGameObject *npc = static_cast<CGameObject *>(getRoot()->findByName(name));
+	trueTalkFn1(npc, val2, val3);
 }
 
-void CGameObject::trueTalkFn1(CTreeItem *item, int val2, int val3) {
+void CGameObject::trueTalkFn1(CGameObject *npc, int val2, int val3) {
 	CGameManager *gameManager = getGameManager();
 	if (gameManager) {
 		CTrueTalkManager *talkManager = gameManager->getTalkManager();
 		if (talkManager)
-			talkManager->fn1(item, val2, val3);
+			talkManager->fn1(npc, val2, val3);
 	}
 }
 
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 8a56945..4049267 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -218,7 +218,7 @@ protected:
 
 	void trueTalkFn1(const CString &name, int val2, int val3);
 
-	void trueTalkFn1(CTreeItem *item, int val2, int val3);
+	void trueTalkFn1(CGameObject *npc, int val2, int val3);
 
 	/**
 	 * Load the surface
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 827cda9..a07f7fa 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -192,7 +192,7 @@ void CTrueTalkManager::update2() {
 	//warning("CTrueTalkManager::update2");
 }
 
-void CTrueTalkManager::fn1(CTreeItem *npc, int val2, int val3) {
+void CTrueTalkManager::fn1(CGameObject *npc, int val2, int val3) {
 	warning("CTrueTalkManager::fn1");
 }
 
@@ -219,4 +219,16 @@ TTNamedScript *CTrueTalkManager::getTalker(const CString &name) {
 	return nullptr;
 }
 
+TTNamedScript *CTrueTalkManager::getNpcScript(CGameObject *npc) {
+	CString npcName = npc->getName();
+	TTNamedScript *script = getTalker(npcName);
+
+	if (!script) {
+		// Fall back on the default NPC script
+		script = _scripts.getNamedScript(101);
+	}
+
+	return script;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 8d2ea65..5d5f679 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -31,6 +31,7 @@ namespace Titanic {
 
 class CGameManager;
 class CTreeItem;
+class CGameObject;
 
 class CTrueTalkManager {
 private:
@@ -48,9 +49,20 @@ private:
 	 */
 	static void saveStatics(SimpleFile *file);
 
+	/**
+	 * Loads an NPC from file
+	 */
 	void loadNPC(SimpleFile *file, int charId);
 
+	/**
+	 * Saves the specified NPC to file
+	 */
 	void saveNPC(SimpleFile *file, int charId) const;
+
+	/**
+	 * Gets the script associated with an NPC game object
+	 */
+	TTNamedScript *getNpcScript(CGameObject *npc);
 public:
 	static int _v1;
 	static int _v2;
@@ -112,7 +124,7 @@ public:
 
 	void update2();
 
-	void fn1(CTreeItem *npc, int val2, int val3);
+	void fn1(CGameObject *npc, int val2, int val3);
 
 	/**
 	 * Return a TrueTalk talker/script


Commit: 308926ba87c76dc3151c4ae3428a71656cdbdad2
    https://github.com/scummvm/scummvm/commit/308926ba87c76dc3151c4ae3428a71656cdbdad2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:24-04:00

Commit Message:
TITANIC: Implementing getting TrueTalk room scripts

Changed paths:
    engines/titanic/core/room_item.cpp
    engines/titanic/core/room_item.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp
index 7a6dfd9..6dab983 100644
--- a/engines/titanic/core/room_item.cpp
+++ b/engines/titanic/core/room_item.cpp
@@ -115,4 +115,59 @@ void CRoomItem::calcNodePosition(const Point &nodePos, double &xVal, double &yVa
 	}
 }
 
+int CRoomItem::getScriptId() const {
+	CString name = getName();
+	if (name == "1stClassLobby")
+		return 130;
+	else if (name == "1stClassRestaurant")
+		return 132;
+	else if (name == "1stClassState")
+		return 131;
+	else if (name == "2ndClassLobby")
+		return 128;
+	else if (name == "Bar")
+		return 112;
+	else if (name == "BottomOfWell")
+		return 108;
+	else if (name == "Bridge")
+		return 121;
+	else if (name == "Dome")
+		return 122;
+	else if (name == "Home")
+		return 100;
+	else if (name == "Lift")
+		return 103;
+	else if (name == "MusicRoom")
+		return 117;
+	else if (name == "MusicRoomLobby")
+		return 118;
+	else if (name == "ParrotLobby")
+		return 111;
+	else if (name == "Pellerator")
+		return 104;
+	else if (name == "PromenadeDeck")
+		return 114;
+	else if (name == "SculptureChamber")
+		return 116;
+	else if (name == "secClassState")
+		return 129;
+	else if (name == "ServiceElevator")
+		return 102;
+	else if (name == "SGTLeisure")
+		return 125;
+	else if (name == "SGTLittleLift")
+		return 105;
+	else if (name == "SgtLobby")
+		return 124;
+	else if (name == "SGTState")
+		return 126;
+	else if (name == "Titania")
+		return 123;
+	else if (name == "TopOfWell")
+		return 107;
+
+	// TODO
+	return 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index f14c3ae..519accd 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -64,6 +64,11 @@ public:
 	 * Calculates the positioning of a node within the overall room
 	 */
 	void calcNodePosition(const Point &nodePos, double &xVal, double &yVal) const;
+
+	/**
+	 * Get the TrueTalk script Id associated with the room
+	 */
+	int getScriptId() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index a07f7fa..805ebd3 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -196,7 +196,7 @@ void CTrueTalkManager::fn1(CGameObject *npc, int val2, int val3) {
 	warning("CTrueTalkManager::fn1");
 }
 
-TTNamedScript *CTrueTalkManager::getTalker(const CString &name) {
+TTNamedScript *CTrueTalkManager::getTalker(const CString &name) const {
 	if (name.contains("Doorbot"))
 		return _scripts.getNamedScript(104);
 	else if (name.contains("DeskBot"))
@@ -219,7 +219,7 @@ TTNamedScript *CTrueTalkManager::getTalker(const CString &name) {
 	return nullptr;
 }
 
-TTNamedScript *CTrueTalkManager::getNpcScript(CGameObject *npc) {
+TTNamedScript *CTrueTalkManager::getNpcScript(CGameObject *npc) const {
 	CString npcName = npc->getName();
 	TTNamedScript *script = getTalker(npcName);
 
@@ -231,4 +231,21 @@ TTNamedScript *CTrueTalkManager::getNpcScript(CGameObject *npc) {
 	return script;
 }
 
+TTUnnamedScript *CTrueTalkManager::getRoomScript() const {
+	CRoomItem *room = _gameManager->getRoom();
+	TTUnnamedScript *script = nullptr;
+	if (room) {
+		int scriptId = room->getScriptId();
+		if (scriptId)
+			script = _scripts.getUnnamedScript(scriptId);
+	}
+
+	if (!script) {
+		// Fall back on the default Room script
+		script = _scripts.getUnnamedScript(110);
+	}
+
+	return script;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 5d5f679..ae740cb 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -62,7 +62,12 @@ private:
 	/**
 	 * Gets the script associated with an NPC game object
 	 */
-	TTNamedScript *getNpcScript(CGameObject *npc);
+	TTNamedScript *getNpcScript(CGameObject *npc) const;
+
+	/**
+	 * Gets the script associated with the current room
+	 */
+	TTUnnamedScript *getRoomScript() const;
 public:
 	static int _v1;
 	static int _v2;
@@ -129,7 +134,7 @@ public:
 	/**
 	 * Return a TrueTalk talker/script
 	 */
-	TTNamedScript *getTalker(const CString &name);
+	TTNamedScript *getTalker(const CString &name) const;
 };
 
 } // End of namespace Titanic


Commit: f75b46792579291e79c17a5e52c863d12eced949
    https://github.com/scummvm/scummvm/commit/f75b46792579291e79c17a5e52c863d12eced949
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:25-04:00

Commit Message:
TITANIC: Finished CRoomItem getScriptId

Changed paths:
    engines/titanic/core/room_item.cpp



diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp
index 6dab983..c581579 100644
--- a/engines/titanic/core/room_item.cpp
+++ b/engines/titanic/core/room_item.cpp
@@ -165,8 +165,15 @@ int CRoomItem::getScriptId() const {
 		return 123;
 	else if (name == "TopOfWell")
 		return 107;
+	else if (name == "EmbLobby" || name == "MoonEmbLobby")
+		return 110;
+	else if (name == "CreatorsChamber" || name == "CreatorsChamberOn")
+		return 113;
+	else if (name == "Arboretum" || name == "FrozenArboretum")
+		return 115;
+	else if (name == "BilgeRoom" || name == "BilgeRoomWith")
+		return 101;
 
-	// TODO
 	return 0;
 }
 


Commit: d712875c02c6e82734f6ba9ea56f8206c51a22fe
    https://github.com/scummvm/scummvm/commit/d712875c02c6e82734f6ba9ea56f8206c51a22fe
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:26-04:00

Commit Message:
TITANIC: Renamed TT unnamed script classes to room scripts

Changed paths:
  A engines/titanic/true_talk/tt_room_script.cpp
  A engines/titanic/true_talk/tt_room_script.h
  R engines/titanic/true_talk/tt_unnamed_script.cpp
  R engines/titanic/true_talk/tt_unnamed_script.h
    engines/titanic/core/room_item.cpp
    engines/titanic/module.mk
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_scripts.cpp
    engines/titanic/true_talk/tt_scripts.h



diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp
index c581579..b1c9aee 100644
--- a/engines/titanic/core/room_item.cpp
+++ b/engines/titanic/core/room_item.cpp
@@ -100,7 +100,7 @@ void CRoomItem::load(SimpleFile *file) {
 }
 
 void CRoomItem::loading() {
-	// TODO
+	warning("TODO: CRoomItem::loading");
 }
 
 void CRoomItem::calcNodePosition(const Point &nodePos, double &xVal, double &yVal) const {
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 778226d..a152931 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -458,7 +458,7 @@ MODULE_OBJS := \
 	true_talk/title_engine.o \
 	true_talk/true_talk_manager.o \
 	true_talk/tt_script_base.o \
-	true_talk/tt_unnamed_script.o \
+	true_talk/tt_room_script.o \
 	true_talk/tt_named_script.o \
 	true_talk/tt_scripts.o \
 	true_talk/tt_string.o
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 805ebd3..c9343d1 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -231,18 +231,18 @@ TTNamedScript *CTrueTalkManager::getNpcScript(CGameObject *npc) const {
 	return script;
 }
 
-TTUnnamedScript *CTrueTalkManager::getRoomScript() const {
+TTRoomScript *CTrueTalkManager::getRoomScript() const {
 	CRoomItem *room = _gameManager->getRoom();
-	TTUnnamedScript *script = nullptr;
+	TTRoomScript *script = nullptr;
 	if (room) {
 		int scriptId = room->getScriptId();
 		if (scriptId)
-			script = _scripts.getUnnamedScript(scriptId);
+			script = _scripts.getRoomScript(scriptId);
 	}
 
 	if (!script) {
 		// Fall back on the default Room script
-		script = _scripts.getUnnamedScript(110);
+		script = _scripts.getRoomScript(110);
 	}
 
 	return script;
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index ae740cb..991bf16 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -67,7 +67,7 @@ private:
 	/**
 	 * Gets the script associated with the current room
 	 */
-	TTUnnamedScript *getRoomScript() const;
+	TTRoomScript *getRoomScript() const;
 public:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/true_talk/tt_room_script.cpp b/engines/titanic/true_talk/tt_room_script.cpp
new file mode 100644
index 0000000..1c37a39
--- /dev/null
+++ b/engines/titanic/true_talk/tt_room_script.cpp
@@ -0,0 +1,64 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/tt_room_script.h"
+
+namespace Titanic {
+
+TTRoomScriptBase::TTRoomScriptBase(int scriptId,
+		const char *charClass, const char *charName,
+		int v3, int v4, int v5, int v6, int v2, int v7) : _scriptId(scriptId),
+		TTScriptBase(3, charClass, v2, charName, v3, v4, v5, v6, v7) {
+}
+
+/*------------------------------------------------------------------------*/
+
+TTRoomScript::TTRoomScript(int scriptId) :
+	TTRoomScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) {
+}
+
+void TTRoomScript::proc6() {
+	warning("TODO");
+}
+
+void TTRoomScript::proc7() {
+	warning("TODO");
+}
+
+void TTRoomScript::proc8() {
+	warning("TODO");
+}
+
+void TTRoomScript::proc9() {
+	warning("TODO");
+}
+
+void TTRoomScript::proc10() {
+	warning("TODO");
+}
+
+void TTRoomScript::proc11() {
+	warning("TODO");
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h
new file mode 100644
index 0000000..ed17b29
--- /dev/null
+++ b/engines/titanic/true_talk/tt_room_script.h
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_ROOM_SCRIPT_H
+#define TITANIC_TT_ROOM_SCRIPT_H
+
+#include "titanic/true_talk/tt_script_base.h"
+
+namespace Titanic {
+
+class TTRoomScriptBase : public TTScriptBase {
+public:
+	int _scriptId;
+public:
+	TTRoomScriptBase(int scriptId, const char *charClass, const char *charName,
+		int v3, int v4, int v5, int v6, int v2, int v7);
+
+	virtual void proc6() = 0;
+	virtual void proc7() = 0;
+	virtual void proc8() = 0;
+	virtual void proc9() = 0;
+	virtual void proc10() = 0;
+	virtual void proc11() = 0;
+};
+
+
+class TTRoomScript : public TTRoomScriptBase {
+private:
+	int _field54;
+public:
+	TTRoomScript(int scriptId);
+
+	virtual void proc6();
+	virtual void proc7();
+	virtual void proc8();
+	virtual void proc9();
+	virtual void proc10();
+	virtual void proc11();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_ROOM_SCRIPT_H */
diff --git a/engines/titanic/true_talk/tt_scripts.cpp b/engines/titanic/true_talk/tt_scripts.cpp
index 8e34ec5..9bfa31a 100644
--- a/engines/titanic/true_talk/tt_scripts.cpp
+++ b/engines/titanic/true_talk/tt_scripts.cpp
@@ -45,9 +45,9 @@ TTNamedScript *TTNamedScriptList::findById(int charId) const {
 
 /*------------------------------------------------------------------------*/
 
-TTUnnamedScript *TTUnnamedScriptList::findById(int scriptId) const {
-	for (TTUnnamedScriptList::const_iterator i = begin(); i != end(); ++i) {
-		const TTUnnamedScriptListItem *item = *i;
+TTRoomScript *TTRoomScriptList::findById(int scriptId) const {
+	for (TTRoomScriptList::const_iterator i = begin(); i != end(); ++i) {
+		const TTRoomScriptListItem *item = *i;
 		if (item->_item->_scriptId == scriptId)
 			return item->_item;
 	}
@@ -59,11 +59,11 @@ TTUnnamedScript *TTUnnamedScriptList::findById(int scriptId) const {
 
 TTScripts::TTScripts(CTitleEngine *titleEngine) :
 		_titleEngine(titleEngine), _field24(0), _field28(0) {
-	// Load unnamed scripts
+	// Load room scripts
 	for (int scriptNum = 100; scriptNum < 133; ++scriptNum)
-		addScript(new TTUnnamedScript(scriptNum));
+		addScript(new TTRoomScript(scriptNum));
 
-	// Load named scripts
+	// Load npc scripts
 	addScript(new DoorbotScript(104, "Doorbot", 0, "Fentible", 11, 1, -1, -1, -1, 0), 100);
 	addScript(new BellbotScript(101, "Bellbot", 0, "Krage", 8, 1), 110);
 	addScript(new LiftbotScript(105, "LiftBot", 0, "Nobby", 11, 1, -1, -1, -1, 0), 103);
@@ -77,19 +77,19 @@ TTScripts::TTScripts(CTitleEngine *titleEngine) :
 void TTScripts::addScript(TTNamedScript *script, int scriptId) {
 	script->proc13();
 	
-	// Find the unnamed script this is associated with
-	TTUnnamedScript *unnamedScript = getUnnamedScript(scriptId);
-	assert(unnamedScript);
+	// Find the room script this is associated with
+	TTRoomScript *roomScript = getRoomScript(scriptId);
+	assert(roomScript);
 
-	_namedScripts.push_back(new TTNamedScriptListItem(script, unnamedScript));
+	_namedScripts.push_back(new TTNamedScriptListItem(script, roomScript));
 }
 
-void TTScripts::addScript(TTUnnamedScript *script) {
-	_unnamedScripts.push_back(new TTUnnamedScriptListItem(script));
+void TTScripts::addScript(TTRoomScript *script) {
+	_roomScripts.push_back(new TTRoomScriptListItem(script));
 }
 
-TTUnnamedScript *TTScripts::getUnnamedScript(int scriptId) const {
-	return _unnamedScripts.findById(scriptId);
+TTRoomScript *TTScripts::getRoomScript(int scriptId) const {
+	return _roomScripts.findById(scriptId);
 }
 
 TTNamedScript *TTScripts::getNamedScript(int charId) const {
diff --git a/engines/titanic/true_talk/tt_scripts.h b/engines/titanic/true_talk/tt_scripts.h
index 5934eb3..00638a0 100644
--- a/engines/titanic/true_talk/tt_scripts.h
+++ b/engines/titanic/true_talk/tt_scripts.h
@@ -25,7 +25,7 @@
 
 #include "titanic/core/list.h"
 #include "titanic/true_talk/tt_named_script.h"
-#include "titanic/true_talk/tt_unnamed_script.h"
+#include "titanic/true_talk/tt_room_script.h"
 
 namespace Titanic {
 
@@ -34,30 +34,30 @@ class CTitleEngine;
 class TTNamedScriptListItem : public ListItem {
 public:
 	TTNamedScript *_script;
-	TTUnnamedScript *_unnamedScript;
+	TTRoomScript *_roomScript;
 public:
-	TTNamedScriptListItem() : _script(nullptr), _unnamedScript(nullptr) {}
-	TTNamedScriptListItem(TTNamedScript *script, TTUnnamedScript *unnamedScript) :
-		_script(script), _unnamedScript(unnamedScript) {}
+	TTNamedScriptListItem() : _script(nullptr), _roomScript(nullptr) {}
+	TTNamedScriptListItem(TTNamedScript *script, TTRoomScript *roomScript) :
+		_script(script), _roomScript(roomScript) {}
 	virtual ~TTNamedScriptListItem() { delete _script; }
 };
 
-PTR_LIST_ITEM(TTUnnamedScript);
+PTR_LIST_ITEM(TTRoomScript);
 
 class TTNamedScriptList : public List<TTNamedScriptListItem> {
 public:
 	TTNamedScript *findById(int charId) const;
 };
 
-class TTUnnamedScriptList : public List<TTUnnamedScriptListItem> {
+class TTRoomScriptList : public List<TTRoomScriptListItem> {
 public:
-	TTUnnamedScript *findById(int scriptId) const;
+	TTRoomScript *findById(int scriptId) const;
 };
 
 class TTScripts {
 private:
 	TTNamedScriptList _namedScripts;
-	TTUnnamedScriptList _unnamedScripts;
+	TTRoomScriptList _roomScripts;
 	CTitleEngine *_titleEngine;
 	int _field24;
 	int _field28;
@@ -70,14 +70,14 @@ private:
 	/**
 	 * Add an unnamed script to the unnamed scripts list
 	 */
-	void addScript(TTUnnamedScript *script);
+	void addScript(TTRoomScript *script);
 public:
 	TTScripts(CTitleEngine *titleEngine);
 
 	/**
-	 * Return a pointer to the specified script
+	 * Return a pointer to the specified room script
 	 */
-	TTUnnamedScript *getUnnamedScript(int scriptId) const;
+	TTRoomScript *getRoomScript(int scriptId) const;
 
 	/**
 	 * Return a pointer to the specified named character script
diff --git a/engines/titanic/true_talk/tt_unnamed_script.cpp b/engines/titanic/true_talk/tt_unnamed_script.cpp
deleted file mode 100644
index 8c91290..0000000
--- a/engines/titanic/true_talk/tt_unnamed_script.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/textconsole.h"
-#include "titanic/true_talk/tt_unnamed_script.h"
-
-namespace Titanic {
-
-TTUnnamedScriptBase::TTUnnamedScriptBase(int scriptId,
-		const char *charClass, const char *charName,
-		int v3, int v4, int v5, int v6, int v2, int v7) : _scriptId(scriptId),
-		TTScriptBase(3, charClass, v2, charName, v3, v4, v5, v6, v7) {
-}
-
-/*------------------------------------------------------------------------*/
-
-TTUnnamedScript::TTUnnamedScript(int scriptId) :
-	TTUnnamedScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) {
-}
-
-void TTUnnamedScript::proc6() {
-	warning("TODO");
-}
-
-void TTUnnamedScript::proc7() {
-	warning("TODO");
-}
-
-void TTUnnamedScript::proc8() {
-	warning("TODO");
-}
-
-void TTUnnamedScript::proc9() {
-	warning("TODO");
-}
-
-void TTUnnamedScript::proc10() {
-	warning("TODO");
-}
-
-void TTUnnamedScript::proc11() {
-	warning("TODO");
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_unnamed_script.h b/engines/titanic/true_talk/tt_unnamed_script.h
deleted file mode 100644
index eeba200..0000000
--- a/engines/titanic/true_talk/tt_unnamed_script.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_TT_UNNAMED_SCRIPT_H
-#define TITANIC_TT_UNNAMED_SCRIPT_H
-
-#include "titanic/true_talk/tt_script_base.h"
-
-namespace Titanic {
-
-class TTUnnamedScriptBase : public TTScriptBase {
-public:
-	int _scriptId;
-public:
-	TTUnnamedScriptBase(int scriptId, const char *charClass, const char *charName,
-		int v3, int v4, int v5, int v6, int v2, int v7);
-
-	virtual void proc6() = 0;
-	virtual void proc7() = 0;
-	virtual void proc8() = 0;
-	virtual void proc9() = 0;
-	virtual void proc10() = 0;
-	virtual void proc11() = 0;
-};
-
-
-class TTUnnamedScript : public TTUnnamedScriptBase {
-private:
-	int _field54;
-public:
-	TTUnnamedScript(int scriptId);
-
-	virtual void proc6();
-	virtual void proc7();
-	virtual void proc8();
-	virtual void proc9();
-	virtual void proc10();
-	virtual void proc11();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_TT_UNNAMED_SCRIPT_H */


Commit: d463be89fac3af6f33ef3c5179594e86cd806f83
    https://github.com/scummvm/scummvm/commit/d463be89fac3af6f33ef3c5179594e86cd806f83
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:27-04:00

Commit Message:
TITANIC: Finished CComputerScreen TimerMsg

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/game/computer_screen.cpp
    engines/titanic/messages/messages.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 1b76ec1..6f70742 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -380,6 +380,14 @@ void CGameObject::playClip(const CString &name, uint flags) {
 		playMovie(clip->_startFrame, clip->_endFrame, flags);
 }
 
+void CGameObject::playClip(uint startFrame, uint endFrame) {
+	CMovieClip *clip = new CMovieClip("", startFrame, endFrame);
+	CGameManager *gameManager = getGameManager();
+	CRoomItem *room = gameManager->getRoom();
+
+	gameManager->playClip(clip, room, room);
+}
+
 void CGameObject::playMovie(uint flags) {
 	_frameNumber = -1;
 	if (!_surface && !_resource.empty()) {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 4049267..98973b3 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -134,7 +134,7 @@ protected:
 	/**
 	 * Plays a sound
 	 */
-	int playSound(const CString &name, int val2, int val3, int val4);
+	int playSound(const CString &name, int val2 = 100, int val3 = 0, int val4 = 0);
 
 	/**
 	 * Plays a sound
@@ -144,7 +144,7 @@ protected:
 	/**
 	 * Stop a sound
 	 */
-	void stopSound(int handle, int val2);
+	void stopSound(int handle, int val2 = 0);
 
 	bool soundFn1(int handle);
 
@@ -317,6 +317,11 @@ public:
 	void playClip(const CString &name, uint flags);
 
 	/**
+	 * Play a clip
+	 */
+	void playClip(uint startFrame, uint endFrame);
+
+	/**
 	 * Return the current view/node/room as a single string
 	 */
 	CString getViewFullName() const;
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 00a48ea..4b24f3e 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -759,6 +759,7 @@ DEFFN(CBilgeDispensorEvent)
 DEFFN(CBodyInBilgeRoomMsg)
 DEFFN(CBowlStateChange)
 DEFFN(CCarryObjectArrivedMsg)
+DEFFN(CChangeMusicMsg)
 DEFFN(CChangeSeasonMsg)
 DEFFN(CCheckAllPossibleCodes)
 DEFFN(CCheckChevCode)
@@ -1345,6 +1346,7 @@ void CSaveableObject::initClassList() {
 	ADDFN(CBodyInBilgeRoomMsg, CMessage);
 	ADDFN(CBowlStateChange, CMessage);
 	ADDFN(CCarryObjectArrivedMsg, CMessage);
+	ADDFN(CChangeMusicMsg, CMessage);
 	ADDFN(CChangeSeasonMsg, CMessage);
 	ADDFN(CCheckAllPossibleCodes, CMessage);
 	ADDFN(CCheckChevCode, CMessage);
diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp
index f0fab26..8879136 100644
--- a/engines/titanic/game/computer_screen.cpp
+++ b/engines/titanic/game/computer_screen.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/game/computer_screen.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
@@ -70,8 +71,69 @@ bool CComputerScreen::EnterViewMsg(CEnterViewMsg *msg) {
 }
 
 bool CComputerScreen::TimerMsg(CTimerMsg *msg) {
-	// TODO
-	warning("TODO: CComputerScreen::TimerMsg");
+	int handle;
+
+	switch (msg->_val3) {
+	case 0:
+		loadSound("a#32.wav");
+		loadSound("a#31.wav");
+		loadSound("a#33.wav");
+		loadSound("a#30.wav");
+		loadSound("a#29.wav");
+		playSound("a#25.wav");
+		addTimer(1, 2000, 0);
+		break;
+
+	case 1:
+		playSound("a#32.wav");
+		playSound("a#31.wav");
+		addTimer(2, 2000, 0);
+		break;
+
+	case 2: {
+		CChangeMusicMsg musicMsg(CString(), 1);
+		musicMsg.execute("HomeMusicPlayer");
+		playSound("a#33.wav");
+		playSound("a#31.wav");
+		changeView("Home.Node 4.E", "");
+		playClip(51, 150);
+		playSound("a#31.wav");
+		playClip(151, 200);
+		
+		handle = playSound("a#27.wav");
+		playClip(200, 306);
+		playSound("a#30.wav");
+		stopSound(handle, 0);
+
+		playClip(306, 338);
+		handle = playSound("a#28.wav");
+		playClip(338, 392);
+		playSound("a#29.wav");
+		stopSound(handle);
+
+		playSound("y#662.wav");
+		soundFn3(handle, 10, 2);
+		playClip(392, 450);
+		trueTalkFn1("Doorbot", 0x3611A, 0);
+		sleep(8000);
+		
+		playClip(450, 492);
+		trueTalkFn1("DOorbot", 0x36121, 0);
+		playClip(492, 522);
+		soundFn3(handle, 30, 2);
+
+		playClip(523, 540);
+		soundFn3(handle, 0, 1);
+
+		playClip(541, 551);
+		stopSound(handle);
+		break;
+	}
+
+	default:
+		break;
+	}
+
 	return true;
 }
 
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index d64972c..b3ca1ef 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -185,13 +185,13 @@ MESSAGE1(CTimeMsg, uint, _ticks, 0);
 class CTimerMsg : public CTimeMsg {
 public:
 	uint _timerCtr;
-	int _fieldC;
+	int _val3;
 	CString _action;
 public:
 	CLASSDEF
-	CTimerMsg() : CTimeMsg(), _timerCtr(0), _fieldC(0) {}
+	CTimerMsg() : CTimeMsg(), _timerCtr(0), _val3(0) {}
 	CTimerMsg(uint ticks, uint timerCtr, int val2, const CString &action) :
-		CTimeMsg(ticks), _timerCtr(timerCtr), _fieldC(val2), _action(action) {}
+		CTimeMsg(ticks), _timerCtr(timerCtr), _val3(val2), _action(action) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return supports(item, _type);
@@ -207,6 +207,7 @@ MESSAGE0(CArmPickedUpFromTableMsg);
 MESSAGE0(CBodyInBilgeRoomMsg);
 MESSAGE1(CBowlStateChange, int, value, 0);
 MESSAGE2(CCarryObjectArrivedMsg, CString, strValue, "", int, numValue, 0);
+MESSAGE2(CChangeMusicMsg, CString, strValue, "", int, numValue, 0);
 MESSAGE1(CChangeSeasonMsg, CString, season, "Summer");
 MESSAGE0(CCheckAllPossibleCodes);
 MESSAGE2(CCheckChevCode, int, value1, 0, int, value2, 0);


Commit: b1290d6dd93f2f442bb9649685a9fa713b14821d
    https://github.com/scummvm/scummvm/commit/b1290d6dd93f2f442bb9649685a9fa713b14821d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:29-04:00

Commit Message:
TITANIC: Cleanup & renames for starting conversations

Changed paths:
    engines/titanic/carry/carry_parrot.cpp
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/computer_screen.cpp
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index 6bf536e..aa75688 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -167,9 +167,9 @@ bool CCarryParrot::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
 		return CCarry::PassOnDragStartMsg(msg);
 	}
 
-	CGameObject *npc = static_cast<CGameObject *>(getRoot()->findByName(_string6));
+	CTrueTalkNPC *npc = static_cast<CTrueTalkNPC *>(getRoot()->findByName(_string6));
 	if (npc)
-		trueTalkFn1(npc, 0x446BF, 0);
+		startTalking(npc, 0x446BF, 0);
 
 	_fieldE0 = 0;
 	playSound("z#475.wav", 100, 0, 0);
@@ -198,9 +198,9 @@ bool CCarryParrot::UseWithCharMsg(CUseWithCharMsg *msg) {
 
 bool CCarryParrot::ActMsg(CActMsg *msg) {
 	if (msg->_action == "FreeParrot" && (CParrot::_v4 == 4 || CParrot::_v4 == 1)) {
-		CGameObject *npc = static_cast<CGameObject *>(getRoot()->findByName(_string6));
+		CTrueTalkNPC *npc = static_cast<CTrueTalkNPC *>(getRoot()->findByName(_string6));
 		if (npc)
-			trueTalkFn1(npc, 0x446BF, 0);
+			startTalking(npc, 0x446BF, 0);
 
 		setVisible(false);
 		_fieldE0 = 0;
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 6f70742..ff7e228 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -24,6 +24,7 @@
 #include "titanic/core/mail_man.h"
 #include "titanic/core/resource_key.h"
 #include "titanic/core/room_item.h"
+#include "titanic/npcs/true_talk_npc.h"
 #include "titanic/pet_control/pet_control.h"
 #include "titanic/support/files_manager.h"
 #include "titanic/support/screen_manager.h"
@@ -706,17 +707,17 @@ void CGameObject::incState38() {
 	getGameManager()->_gameState.inc38();
 }
 
-void CGameObject::trueTalkFn1(const CString &name, int val2, int val3) {
-	CGameObject *npc = static_cast<CGameObject *>(getRoot()->findByName(name));
-	trueTalkFn1(npc, val2, val3);
+void CGameObject::startTalking(const CString &npcName, int val2, int val3) {
+	CTrueTalkNPC *npc = static_cast<CTrueTalkNPC *>(getRoot()->findByName(npcName));
+	startTalking(npc, val2, val3);
 }
 
-void CGameObject::trueTalkFn1(CGameObject *npc, int val2, int val3) {
+void CGameObject::startTalking(CTrueTalkNPC *npc, int val2, int val3) {
 	CGameManager *gameManager = getGameManager();
 	if (gameManager) {
 		CTrueTalkManager *talkManager = gameManager->getTalkManager();
 		if (talkManager)
-			talkManager->fn1(npc, val2, val3);
+			talkManager->start(npc, val2, val3);
 	}
 }
 
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 98973b3..97d3ca4 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -37,6 +37,7 @@ enum Found { FOUND_NONE = 0, FOUND_GLOBAL = 1, FOUND_ROOM = 2, FOUND_PET = 3, FO
 
 class CVideoSurface;
 class CMouseDragStartMsg;
+class CTrueTalkNPC;
 class OSMovie;
 
 class CGameObject : public CNamedItem {
@@ -216,9 +217,15 @@ protected:
 	 */
 	void moveToView();
 
-	void trueTalkFn1(const CString &name, int val2, int val3);
+	/**
+	 * Start a conversation with the NPC
+	 */
+	void startTalking(const CString &name, int val2, int val3);
 
-	void trueTalkFn1(CGameObject *npc, int val2, int val3);
+	/**
+	 * Start a conversation with the NPC
+	 */
+	void startTalking(CTrueTalkNPC *npc, int val2, int val3);
 
 	/**
 	 * Load the surface
diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp
index 8879136..846858b 100644
--- a/engines/titanic/game/computer_screen.cpp
+++ b/engines/titanic/game/computer_screen.cpp
@@ -114,11 +114,11 @@ bool CComputerScreen::TimerMsg(CTimerMsg *msg) {
 		playSound("y#662.wav");
 		soundFn3(handle, 10, 2);
 		playClip(392, 450);
-		trueTalkFn1("Doorbot", 0x3611A, 0);
+		startTalking("Doorbot", 0x3611A, 0);
 		sleep(8000);
 		
 		playClip(450, 492);
-		trueTalkFn1("DOorbot", 0x36121, 0);
+		startTalking("Doorbot", 0x36121, 0);
 		playClip(492, 522);
 		soundFn3(handle, 30, 2);
 
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index c9343d1..6abce89 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/true_talk/true_talk_manager.h"
 #include "titanic/core/tree_item.h"
+#include "titanic/npcs/true_talk_npc.h"
 #include "titanic/game_manager.h"
 
 #define MKTAG_BE(a3,a2,a1,a0) ((uint32)((a3) | ((a2) << 8) | ((a1) << 16) | ((a0) << 24)))
@@ -41,7 +42,7 @@ bool CTrueTalkManager::_v10;
 int CTrueTalkManager::_v11[41];
 
 CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : 
-		_gameManager(owner), _scripts(&_titleEngine) {
+		_gameManager(owner), _scripts(&_titleEngine), _currentCharId(0) {
 }
 
 void CTrueTalkManager::save(SimpleFile *file) const {
@@ -192,7 +193,7 @@ void CTrueTalkManager::update2() {
 	//warning("CTrueTalkManager::update2");
 }
 
-void CTrueTalkManager::fn1(CGameObject *npc, int val2, int val3) {
+void CTrueTalkManager::start(CTrueTalkNPC *npc, int val2, int val3) {
 	warning("CTrueTalkManager::fn1");
 }
 
@@ -219,7 +220,7 @@ TTNamedScript *CTrueTalkManager::getTalker(const CString &name) const {
 	return nullptr;
 }
 
-TTNamedScript *CTrueTalkManager::getNpcScript(CGameObject *npc) const {
+TTNamedScript *CTrueTalkManager::getNpcScript(CTrueTalkNPC *npc) const {
 	CString npcName = npc->getName();
 	TTNamedScript *script = getTalker(npcName);
 
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 991bf16..5507cf2 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -31,13 +31,14 @@ namespace Titanic {
 
 class CGameManager;
 class CTreeItem;
-class CGameObject;
+class CTrueTalkNPC;
 
 class CTrueTalkManager {
 private:
 	CGameManager *_gameManager;
 	CTitleEngine _titleEngine;
 	TTScripts _scripts;
+	int _currentCharId;
 private:
 	/**
 	 * Loads the statics for the class
@@ -62,7 +63,7 @@ private:
 	/**
 	 * Gets the script associated with an NPC game object
 	 */
-	TTNamedScript *getNpcScript(CGameObject *npc) const;
+	TTNamedScript *getNpcScript(CTrueTalkNPC *npc) const;
 
 	/**
 	 * Gets the script associated with the current room
@@ -129,7 +130,10 @@ public:
 
 	void update2();
 
-	void fn1(CGameObject *npc, int val2, int val3);
+	/**
+	 * Start a TrueTalk conversation
+	 */
+	void start(CTrueTalkNPC *npc, int val2, int val3);
 
 	/**
 	 * Return a TrueTalk talker/script


Commit: 03a8cbaf98fb44dcd4c915f4d8577adaef6b0d7a
    https://github.com/scummvm/scummvm/commit/03a8cbaf98fb44dcd4c915f4d8577adaef6b0d7a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:30-04:00

Commit Message:
TITANIC: Implemented TT manager loadAssets, beginnings of CDialogueFile

Changed paths:
  A engines/titanic/true_talk/dialogue_file.cpp
  A engines/titanic/true_talk/dialogue_file.h
    engines/titanic/game_manager.cpp
    engines/titanic/messages/messages.h
    engines/titanic/module.mk
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 0d1714a..bfd6984 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -199,7 +199,7 @@ void CGameManager::viewChange() {
 
 	_videoSurface1 = nullptr;
 	_videoSurface2 = CScreenManager::_screenManagerPtr->createSurface(600, 340);
-	_trueTalkManager.viewChange();
+	_trueTalkManager.clear();
 
 	for (CTreeItem *treeItem = _project; treeItem; treeItem = treeItem->scan(_project))
 		treeItem->viewChange();
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index b3ca1ef..fb3169c 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -342,7 +342,7 @@ MESSAGE3(CTransportMsg, CString, roomName, "", int, value1, 0, int, value2, 0);
 MESSAGE1(CTriggerAutoMusicPlayerMsg, int, value, 0);
 MESSAGE1(CTriggerNPCEvent, int, value, 0);
 MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, int, value2, 0, int, value3, 0, int, value4, 0);
-MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, strValue, "", int, numValue, 0);
+MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, filename, "", int, numValue, 0);
 MESSAGE2(CTrueTalkGetStateValueMsg, int, value1, 0, int, value2, -1000);
 MESSAGE2(CTrueTalkNotifySpeechEndedMsg, int, value1, 0, int, value2, 0);
 MESSAGE3(CTrueTalkNotifySpeechStartedMsg, int, value1, 0, int, value2, 0, int, value, 0);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index a152931..0f301b9 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -450,6 +450,7 @@ MODULE_OBJS := \
 	true_talk/barbot_script.o \
 	true_talk/bellbot_script.o \
 	true_talk/deskbot_script.o \
+	true_talk/dialogue_file.o \
 	true_talk/doorbot_script.o \
 	true_talk/liftbot_script.o \
 	true_talk/maitred_script.o \
diff --git a/engines/titanic/true_talk/dialogue_file.cpp b/engines/titanic/true_talk/dialogue_file.cpp
new file mode 100644
index 0000000..341d973
--- /dev/null
+++ b/engines/titanic/true_talk/dialogue_file.cpp
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/dialogue_file.h"
+
+namespace Titanic {
+
+CDialogueFile::CDialogueFile(const CString &filename, uint count) {
+	if (!_file.open(filename))
+		error("Could not locate dialogue file - %s", filename.c_str());
+	
+	_data1.resize(count);
+
+	_file.readUint32LE();		// Skip over file Id
+	_entries.resize(_file.readUint32LE());
+
+	// Read in the entries
+	for (uint idx = 0; idx < _entries.size(); ++idx) {
+		_entries[idx].v1 = _file.readUint32LE();
+		_entries[idx].v2 = _file.readUint32LE();
+	}
+}
+
+CDialogueFile::~CDialogueFile() {
+	clear();
+}
+
+void CDialogueFile::clear() {
+	_file.close();
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/dialogue_file.h b/engines/titanic/true_talk/dialogue_file.h
new file mode 100644
index 0000000..00bacac
--- /dev/null
+++ b/engines/titanic/true_talk/dialogue_file.h
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DIALOGUE_FILE_H
+#define TITANIC_DIALOGUE_FILE_H
+
+#include "common/file.h"
+#include "titanic/support/string.h"
+
+namespace Titanic {
+
+class CDialogueFile {
+	struct CDialogueFileEntry {
+		uint v1;
+		uint v2;
+	};
+	struct EntryRec {
+		uint v1, v2, v3, v4, v5;
+	};
+private:
+	Common::File _file;
+	Common::Array<CDialogueFileEntry> _entries;
+	Common::Array<EntryRec> _data1;
+public:
+	CDialogueFile(const CString &filename, uint count);
+	~CDialogueFile();
+
+	/**
+	 * Clear the loaded data
+	 */
+	void clear();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TITLE_ENGINE_H */
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 6abce89..2e43266 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -42,7 +42,12 @@ bool CTrueTalkManager::_v10;
 int CTrueTalkManager::_v11[41];
 
 CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : 
-		_gameManager(owner), _scripts(&_titleEngine), _currentCharId(0) {
+		_gameManager(owner), _scripts(&_titleEngine), _currentCharId(0),
+		_dialogueFile(nullptr), _field14(0) {
+}
+
+CTrueTalkManager::~CTrueTalkManager() {
+	clear();
 }
 
 void CTrueTalkManager::save(SimpleFile *file) const {
@@ -127,6 +132,12 @@ void CTrueTalkManager::saveStatics(SimpleFile *file) {
 		file->writeNumber(_v11[idx]);
 }
 
+void CTrueTalkManager::clear() {
+	delete _dialogueFile;
+	_dialogueFile = nullptr;
+	_currentCharId = 0;
+}
+
 void CTrueTalkManager::setFlags(int index, int val) {
 	switch (index) {
 	case 1:
@@ -181,10 +192,6 @@ void CTrueTalkManager::preLoad() {
 	warning("TODO: CTrueTalkManager::preLoad");
 }
 
-void CTrueTalkManager::viewChange() {
-	warning("CTrueTalkManager::viewChange");
-}
-
 void CTrueTalkManager::update1() {
 	//warning("CTrueTalkManager::update1");
 }
@@ -194,7 +201,7 @@ void CTrueTalkManager::update2() {
 }
 
 void CTrueTalkManager::start(CTrueTalkNPC *npc, int val2, int val3) {
-	warning("CTrueTalkManager::fn1");
+	
 }
 
 TTNamedScript *CTrueTalkManager::getTalker(const CString &name) const {
@@ -249,4 +256,22 @@ TTRoomScript *CTrueTalkManager::getRoomScript() const {
 	return script;
 }
 
+void CTrueTalkManager::loadAssets(CTrueTalkNPC *npc, int charId) {
+	// If assets for the character are already loaded, simply exit
+	if (_currentCharId == charId)
+		return;
+
+	// Clear any previously loaded data
+	clear();
+
+	// Signal the NPC to get the asset details
+	CTrueTalkGetAssetDetailsMsg detailsMsg;
+	detailsMsg.execute(npc);
+
+	if (!detailsMsg._filename.empty()) {
+		_dialogueFile = new CDialogueFile(detailsMsg._filename, 20);
+		_field14 = detailsMsg._numValue + 1;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 5507cf2..a7258c5 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -24,6 +24,7 @@
 #define TITANIC_TRUE_TALK_MANAGER_H
 
 #include "titanic/support/simple_file.h"
+#include "titanic/true_talk/dialogue_file.h"
 #include "titanic/true_talk/title_engine.h"
 #include "titanic/true_talk/tt_scripts.h"
 
@@ -39,6 +40,8 @@ private:
 	CTitleEngine _titleEngine;
 	TTScripts _scripts;
 	int _currentCharId;
+	CDialogueFile *_dialogueFile;
+	int _field14;
 private:
 	/**
 	 * Loads the statics for the class
@@ -69,6 +72,11 @@ private:
 	 * Gets the script associated with the current room
 	 */
 	TTRoomScript *getRoomScript() const;
+
+	/**
+	 * Loads assets for the current character, if it's changed
+	 */
+	void loadAssets(CTrueTalkNPC *npc, int charId);
 public:
 	static int _v1;
 	static int _v2;
@@ -85,6 +93,7 @@ public:
 	static void setFlags(int index, int val);
 public:
 	CTrueTalkManager(CGameManager *owner);
+	~CTrueTalkManager();
 
 	/**
 	 * Save the data for the class to file
@@ -97,6 +106,11 @@ public:
 	void load(SimpleFile *file);
 
 	/**
+	 * Clear the manager
+	 */
+	void clear();
+
+	/**
 	 * Called when a game is about to be loaded
 	 */
 	void preLoad();
@@ -117,11 +131,6 @@ public:
 	void postSave() {}
 
 	/**
-	 * Called when the view changes
-	 */
-	void viewChange();
-
-	/**
 	 * Returns the scripts for the manager
 	 */
 	TTScripts &getScripts() { return _scripts; }


Commit: ab86c09a2f4c8ea315824bb95c58b5f33728e115
    https://github.com/scummvm/scummvm/commit/ab86c09a2f4c8ea315824bb95c58b5f33728e115
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:31-04:00

Commit Message:
TITANIC: Beginnings of STtitleEngine class

Changed paths:
  A engines/titanic/true_talk/title_engine_sub.cpp
  A engines/titanic/true_talk/title_engine_sub.h
  A engines/titanic/true_talk/tt_title_script.cpp
  A engines/titanic/true_talk/tt_title_script.h
    engines/titanic/module.mk
    engines/titanic/true_talk/title_engine.cpp
    engines/titanic/true_talk/title_engine.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 0f301b9..10698cf 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -457,12 +457,14 @@ MODULE_OBJS := \
 	true_talk/parrot_script.o \
 	true_talk/succubus_script.o \
 	true_talk/title_engine.o \
+	true_talk/title_engine_sub.o \
 	true_talk/true_talk_manager.o \
 	true_talk/tt_script_base.o \
 	true_talk/tt_room_script.o \
 	true_talk/tt_named_script.o \
 	true_talk/tt_scripts.o \
-	true_talk/tt_string.o
+	true_talk/tt_string.o \
+	true_talk/tt_title_script.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
index 1369af6..adc74fe 100644
--- a/engines/titanic/true_talk/title_engine.cpp
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -24,4 +24,54 @@
 
 namespace Titanic {
 
+CTitleEngine::CTitleEngine() : _script(nullptr), _sub(nullptr) {
+}
+
+CTitleEngine::~CTitleEngine() {
+	delete _script;
+	delete _sub;
+}
+
+void CTitleEngine::setup(int val1, int val2) {
+
+}
+
+
+/*------------------------------------------------------------------------*/
+
+STtitleEngine::STtitleEngine(): CTitleEngine(), _field58(0) {
+}
+
+STtitleEngine::~STtitleEngine() {
+	delete _stream;
+}
+
+void STtitleEngine::reset() {
+	_field58 = 0;
+	_array.clear();
+}
+
+void STtitleEngine::setup(int val1, int val2) {
+	CTitleEngine::setup(val1, 3);
+}
+
+int STtitleEngine::proc2(int val1, int val2) {
+	// TODO
+	return 0;
+}
+
+void STtitleEngine::dump(int val1, int val2) {
+	// TODO
+}
+
+void STtitleEngine::open(const CString &name) {
+	_stream = _resources.getResource(Common::WinResourceID("Text"),
+		name);
+}
+
+void STtitleEngine::close() {
+	delete _stream;
+	_stream = nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index c854704..71b0947 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -23,9 +23,83 @@
 #ifndef TITANIC_TITLE_ENGINE_H
 #define TITANIC_TITLE_ENGINE_H
 
+#include "common/stream.h"
+#include "common/winexe_pe.h"
+#include "titanic/support/string.h"
+#include "titanic/true_talk/title_engine_sub.h"
+#include "titanic/true_talk/tt_script_base.h"
+
 namespace Titanic {
 
 class CTitleEngine {
+protected:
+	CTitleEngineSub *_sub;
+	TTScriptBase *_script;
+public:
+	CTitleEngine();
+	~CTitleEngine();
+
+	/**
+	 * Setup the engine
+	 */
+	virtual void setup(int val1, int val2 = 0);
+
+	virtual int proc2(int val1, int val2) { return 2; }
+	
+	virtual int proc4(int unused) const = 0;
+	virtual int proc5(int64 unused) const = 0;
+	virtual int proc6(int64 unused) const = 0;
+	virtual int proc7(int64 unused) const = 0;
+	virtual int proc8() const = 0;
+
+	/**
+	 * Open a designated file
+	 */
+	virtual void open(const CString &name) = 0;
+
+	/**
+	 * Close the file
+	 */
+	virtual void close() = 0;
+};
+
+class STtitleEngine : public CTitleEngine {
+private:
+	Common::PEResources _resources;
+	Common::SeekableReadStream *_stream;
+	int _field58;
+	Common::Array<uint> _array;
+	Common::Array<byte> _data;
+public:
+	STtitleEngine();
+	~STtitleEngine();
+
+	void reset();
+
+	/**
+	 * Setup the engine
+	 */
+	virtual void setup(int val1, int val2 = 0);
+
+	virtual int proc2(int val1, int val2);
+
+	virtual void dump(int val1, int val2);
+
+	virtual int proc4(int unused) const { return 0; }
+	virtual int proc5(int64 unused) const { return 0; }
+	virtual int proc6(int64 unused) const { return 0; }
+	virtual int proc7(int64 unused) const { return 0; }
+	virtual int proc8() const { return 0; }
+
+	/**
+	 * Open a designated file
+	 */
+	virtual void open(const CString &name);
+
+	/**
+	 * Close the file
+	 */
+	virtual void close();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/title_engine_sub.cpp b/engines/titanic/true_talk/title_engine_sub.cpp
new file mode 100644
index 0000000..f7e1f28
--- /dev/null
+++ b/engines/titanic/true_talk/title_engine_sub.cpp
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/title_engine_sub.h"
+
+namespace Titanic {
+
+/*------------------------------------------------------------------------*/
+
+CTitleEngineSub::CTitleEngineSub(CTitleEngine *owner, int val1, int val2) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/title_engine_sub.h b/engines/titanic/true_talk/title_engine_sub.h
new file mode 100644
index 0000000..050f041
--- /dev/null
+++ b/engines/titanic/true_talk/title_engine_sub.h
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TITLE_ENGINE_SUB_H
+#define TITANIC_TITLE_ENGINE_SUB_H
+
+namespace Titanic {
+
+class CTitleEngine;
+
+class CTitleEngineSub {
+public:
+	CTitleEngineSub(CTitleEngine *owner, int val1, int val2);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TITLE_ENGINE_SUB_H */
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 2e43266..091e3f8 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -40,6 +40,7 @@ bool CTrueTalkManager::_v8;
 int CTrueTalkManager::_v9;
 bool CTrueTalkManager::_v10;
 int CTrueTalkManager::_v11[41];
+CTrueTalkNPC *CTrueTalkManager::_currentNPC;
 
 CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : 
 		_gameManager(owner), _scripts(&_titleEngine), _currentCharId(0),
@@ -201,7 +202,18 @@ void CTrueTalkManager::update2() {
 }
 
 void CTrueTalkManager::start(CTrueTalkNPC *npc, int val2, int val3) {
+	TTNamedScript *npcScript = getNpcScript(npc);
+	TTRoomScript *roomScript = getRoomScript();
 	
+	_titleEngine.reset();
+	uint charId = npcScript->charId();
+	loadAssets(npc, charId);
+
+	_currentNPC = npc;
+	warning("TODO: CTrueTalkManager::start");
+	_currentNPC = nullptr;
+
+	//TODO: More
 }
 
 TTNamedScript *CTrueTalkManager::getTalker(const CString &name) const {
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index a7258c5..d2bba4b 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -37,7 +37,7 @@ class CTrueTalkNPC;
 class CTrueTalkManager {
 private:
 	CGameManager *_gameManager;
-	CTitleEngine _titleEngine;
+	STtitleEngine _titleEngine;
 	TTScripts _scripts;
 	int _currentCharId;
 	CDialogueFile *_dialogueFile;
@@ -89,6 +89,7 @@ public:
 	static int _v9;
 	static bool _v10;
 	static int _v11[41];
+	static CTrueTalkNPC *_currentNPC;
 
 	static void setFlags(int index, int val);
 public:
diff --git a/engines/titanic/true_talk/tt_title_script.cpp b/engines/titanic/true_talk/tt_title_script.cpp
new file mode 100644
index 0000000..048199a
--- /dev/null
+++ b/engines/titanic/true_talk/tt_title_script.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_title_script.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_title_script.h b/engines/titanic/true_talk/tt_title_script.h
new file mode 100644
index 0000000..0c36e83
--- /dev/null
+++ b/engines/titanic/true_talk/tt_title_script.h
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_TITLE_SCRIPT_H
+#define TITANIC_TT_TITLE_SCRIPT_H
+
+#include "titanic/true_talk/tt_script_base.h"
+
+namespace Titanic {
+
+class TTTitleScript : public TTScriptBase {
+public:
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_TITLE_SCRIPT_H */


Commit: 4d22064997b286fdf6eb179c710f2bd0ae539943
    https://github.com/scummvm/scummvm/commit/4d22064997b286fdf6eb179c710f2bd0ae539943
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:32-04:00

Commit Message:
TITANIC: Beginnings of script handler

Changed paths:
  A engines/titanic/true_talk/script_handler.cpp
  A engines/titanic/true_talk/script_handler.h
  R engines/titanic/true_talk/title_engine_sub.cpp
  R engines/titanic/true_talk/title_engine_sub.h
    engines/titanic/module.mk
    engines/titanic/true_talk/title_engine.cpp
    engines/titanic/true_talk/title_engine.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 10698cf..df8f053 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -457,7 +457,7 @@ MODULE_OBJS := \
 	true_talk/parrot_script.o \
 	true_talk/succubus_script.o \
 	true_talk/title_engine.o \
-	true_talk/title_engine_sub.o \
+	true_talk/script_handler.o \
 	true_talk/true_talk_manager.o \
 	true_talk/tt_script_base.o \
 	true_talk/tt_room_script.o \
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
new file mode 100644
index 0000000..de10121
--- /dev/null
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/script_handler.h"
+
+namespace Titanic {
+
+/*------------------------------------------------------------------------*/
+
+CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) {
+}
+
+void CScriptHandler::setup(TTNamedScript *npcScript, TTRoomScript *roomScript, uint charId) {
+
+}
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
new file mode 100644
index 0000000..69c1c94
--- /dev/null
+++ b/engines/titanic/true_talk/script_handler.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SCRIPT_HANDLER_H
+#define TITANIC_SCRIPT_HANDLER_H
+
+#include "titanic/true_talk/tt_named_script.h"
+#include "titanic/true_talk/tt_room_script.h"
+
+namespace Titanic {
+
+class CTitleEngine;
+
+class CScriptHandler {
+private:
+	CTitleEngine *_owner;
+public:
+	CScriptHandler(CTitleEngine *owner, int val1, int val2);
+
+	/**
+	 * Set the character and room
+	 */
+	void setup(TTNamedScript *npcScript, TTRoomScript *roomScript, uint charId);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SCRIPT_HANDLER_H */
diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
index adc74fe..d5015b4 100644
--- a/engines/titanic/true_talk/title_engine.cpp
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -24,12 +24,12 @@
 
 namespace Titanic {
 
-CTitleEngine::CTitleEngine() : _script(nullptr), _sub(nullptr) {
+CTitleEngine::CTitleEngine() : _script(nullptr), _handler(nullptr) {
 }
 
 CTitleEngine::~CTitleEngine() {
 	delete _script;
-	delete _sub;
+	delete _handler;
 }
 
 void CTitleEngine::setup(int val1, int val2) {
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index 71b0947..8d32067 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -26,14 +26,14 @@
 #include "common/stream.h"
 #include "common/winexe_pe.h"
 #include "titanic/support/string.h"
-#include "titanic/true_talk/title_engine_sub.h"
+#include "titanic/true_talk/script_handler.h"
 #include "titanic/true_talk/tt_script_base.h"
 
 namespace Titanic {
 
 class CTitleEngine {
 protected:
-	CTitleEngineSub *_sub;
+	CScriptHandler *_handler;
 	TTScriptBase *_script;
 public:
 	CTitleEngine();
diff --git a/engines/titanic/true_talk/title_engine_sub.cpp b/engines/titanic/true_talk/title_engine_sub.cpp
deleted file mode 100644
index f7e1f28..0000000
--- a/engines/titanic/true_talk/title_engine_sub.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/true_talk/title_engine_sub.h"
-
-namespace Titanic {
-
-/*------------------------------------------------------------------------*/
-
-CTitleEngineSub::CTitleEngineSub(CTitleEngine *owner, int val1, int val2) {
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/title_engine_sub.h b/engines/titanic/true_talk/title_engine_sub.h
deleted file mode 100644
index 050f041..0000000
--- a/engines/titanic/true_talk/title_engine_sub.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_TITLE_ENGINE_SUB_H
-#define TITANIC_TITLE_ENGINE_SUB_H
-
-namespace Titanic {
-
-class CTitleEngine;
-
-class CTitleEngineSub {
-public:
-	CTitleEngineSub(CTitleEngine *owner, int val1, int val2);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_TITLE_ENGINE_SUB_H */


Commit: 2a2eaebdc294a7958260ed40d48fef25e1396355
    https://github.com/scummvm/scummvm/commit/2a2eaebdc294a7958260ed40d48fef25e1396355
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:33-04:00

Commit Message:
TITANIC: Implemented CCharacter message handlers

Changed paths:
    engines/titanic/npcs/character.cpp
    engines/titanic/npcs/character.h



diff --git a/engines/titanic/npcs/character.cpp b/engines/titanic/npcs/character.cpp
index b8112ce..df905d9 100644
--- a/engines/titanic/npcs/character.cpp
+++ b/engines/titanic/npcs/character.cpp
@@ -24,6 +24,12 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CCharacter, CGameObject)
+	ON_MESSAGE(LeaveViewMsg)
+	ON_MESSAGE(TurnOn)
+	ON_MESSAGE(TurnOff)
+END_MESSAGE_MAP()
+
 CCharacter::CCharacter() : CGameObject(), _fieldBC(0), _fieldC0(0), _fieldC4(1) {
 }
 
@@ -47,4 +53,27 @@ void CCharacter::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+bool CCharacter::LeaveViewMsg(CLeaveViewMsg *msg) {
+	CTurnOff offMsg;
+	offMsg.execute(this);
+
+	return true;
+}
+
+bool CCharacter::TurnOn(CTurnOn *msg) {
+	if (!_fieldC4)
+		_fieldC4 = 1;
+
+	return true;
+}
+
+bool CCharacter::TurnOff(CTurnOff *msg) {
+	CString charName = getName();
+	if (charName == "Deskbot" || charName == "Barbot" || charName == "SuccUBus") {
+		_fieldC4 = 0;
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/character.h b/engines/titanic/npcs/character.h
index 2fb83e9..c0cc8ff 100644
--- a/engines/titanic/npcs/character.h
+++ b/engines/titanic/npcs/character.h
@@ -28,6 +28,10 @@
 namespace Titanic {
 
 class CCharacter : public CGameObject {
+	DECLARE_MESSAGE_MAP
+	bool LeaveViewMsg(CLeaveViewMsg *msg);
+	bool TurnOn(CTurnOn *msg);
+	bool TurnOff(CTurnOff *msg);
 protected:
 	int _fieldBC;
 	int _fieldC0;


Commit: 82299474029d0568c3de0bcbcc485ad9e14cf7dd
    https://github.com/scummvm/scummvm/commit/82299474029d0568c3de0bcbcc485ad9e14cf7dd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:34-04:00

Commit Message:
TITANIC: In progress message handlers for CTrueTalkNPC

Changed paths:
    engines/titanic/npcs/parrot.cpp
    engines/titanic/npcs/true_talk_npc.cpp
    engines/titanic/npcs/true_talk_npc.h



diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
index c350079..a4cfa08 100644
--- a/engines/titanic/npcs/parrot.cpp
+++ b/engines/titanic/npcs/parrot.cpp
@@ -88,15 +88,15 @@ CParrot::CParrot() : CTrueTalkNPC() {
 	_field1E8 = 0;
 	_field1EC = 30;
 
-	_string1 = "z454.dlg";
-	_fieldD4 = 0x13880;
+	_assetName = "z454.dlg";
+	_assetNumber = 0x13880;
 }
 
 void CParrot::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldD4, indent);
+	file->writeNumberLine(_assetNumber, indent);
 	
-	file->writeQuotedLine(_string1, indent);
+	file->writeQuotedLine(_assetName, indent);
 	file->writeNumberLine(_field108, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
@@ -118,9 +118,9 @@ void CParrot::save(SimpleFile *file, int indent) const {
 
 void CParrot::load(SimpleFile *file) {
 	file->readNumber();
-	_fieldD4 = file->readNumber();
+	_assetNumber = file->readNumber();
 
-	_string1 = file->readString();
+	_assetName = file->readString();
 	_field108 = file->readNumber();
 	_v1 = file->readNumber();
 	_v2 = file->readNumber();
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index 924ea56..72b3cf2 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -21,25 +21,39 @@
  */
 
 #include "titanic/npcs/true_talk_npc.h"
+#include "titanic/core/view_item.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
-CTrueTalkNPC::CTrueTalkNPC() : _string1("z451.dlg"),
-	_fieldD4(0x11170), _fieldE4(0), _fieldE8(0), _fieldEC(0), _fieldF0(0),
-	_fieldF4(0), _fieldF8(0), _fieldFC(0), _field100(0), _field104(0) {
+BEGIN_MESSAGE_MAP(CTrueTalkNPC, CCharacter)
+	ON_MESSAGE(TextInputMsg)
+	ON_MESSAGE(TrueTalkGetAssetDetailsMsg)
+	ON_MESSAGE(DismissBotMsg)
+	ON_MESSAGE(TrueTalkNotifySpeechStartedMsg)
+	ON_MESSAGE(TrueTalkNotifySpeechEndedMsg)
+	ON_MESSAGE(MovieEndMsg)
+	ON_MESSAGE(NPCQueueIdleAnimMsg)
+	ON_MESSAGE(TimerMsg)
+	ON_MESSAGE(NPCPlayAnimationMsg)
+END_MESSAGE_MAP()
+
+CTrueTalkNPC::CTrueTalkNPC() : _assetName("z451.dlg"),
+	_assetNumber(0x11170), _fieldE4(0), _npcFlags(0), _fieldEC(0), _fieldF0(0),
+	_fieldF4(0), _fieldF8(0), _speechTimerId(0), _field100(0), _field104(0) {
 }
 
 void CTrueTalkNPC::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_fieldD4, indent);
-	file->writeQuotedLine(_string1, indent);
+	file->writeNumberLine(_assetNumber, indent);
+	file->writeQuotedLine(_assetName, indent);
 	file->writeNumberLine(_fieldE4, indent);
-	file->writeNumberLine(_fieldE8, indent);
+	file->writeNumberLine(_npcFlags, indent);
 	file->writeNumberLine(_fieldEC, indent);
 	file->writeNumberLine(_fieldF0, indent);
 	file->writeNumberLine(_fieldF4, indent);
 	file->writeNumberLine(_fieldF8, indent);
-	file->writeNumberLine(_fieldFC, indent);
+	file->writeNumberLine(_speechTimerId, indent);
 	file->writeNumberLine(_field100, indent);
 	file->writeNumberLine(_field104, indent);
 
@@ -48,19 +62,124 @@ void CTrueTalkNPC::save(SimpleFile *file, int indent) const {
 
 void CTrueTalkNPC::load(SimpleFile *file) {
 	file->readNumber();
-	_fieldD4 = file->readNumber();
-	_string1 = file->readString();
+	_assetNumber = file->readNumber();
+	_assetName = file->readString();
 	_fieldE4 = file->readNumber();
-	_fieldE8 = file->readNumber();
+	_npcFlags = file->readNumber();
 	_fieldEC = file->readNumber();
 	_fieldF0 = file->readNumber();
 	_fieldF4 = file->readNumber();
 	_fieldF8 = file->readNumber();
-	_fieldFC = file->readNumber();
+	_speechTimerId = file->readNumber();
 	_field100 = file->readNumber();
 	_field104 = file->readNumber();
 
 	CCharacter::load(file);
 }
 
+bool CTrueTalkNPC::TextInputMsg(CTextInputMsg *msg) {
+	processInput(msg, _field104 ? findView() : nullptr);
+	return true;
+}
+
+bool CTrueTalkNPC::TrueTalkGetAssetDetailsMsg(CTrueTalkGetAssetDetailsMsg *msg) {
+	msg->_filename = _assetName;
+	msg->_numValue = _assetNumber;
+	return true;
+}
+
+bool CTrueTalkNPC::DismissBotMsg(CDismissBotMsg *msg) {
+	performAction(1, 0);
+	return true;
+}
+
+bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *msg) {
+	_npcFlags |= NPCFLAG_SPEAKING;
+	++_field100;
+
+	if (!(_npcFlags & NPCFLAG_8)) {
+		if (_speechTimerId)
+			stopTimer(_speechTimerId);
+
+		_fieldEC = msg->_value1;
+		_fieldF0 = g_vm->_events->getTicksCount();
+
+		if (hasActiveMovie() || (_npcFlags & NPCFLAG_2)) {
+			_npcFlags &= ~NPCFLAG_2;
+			stopMovie();
+
+			CNPCPlayTalkingAnimationMsg msg1(_fieldEC, 0, 0);
+			msg1.execute(this);
+
+			if (msg1._value3) {
+				CNPCPlayAnimationMsg msg2(msg1._value3, msg1._value1);
+				msg2.execute(this);
+			}
+		}
+	}
+
+	return true;
+}
+
+bool CTrueTalkNPC::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) {
+	_npcFlags &= ~NPCFLAG_SPEAKING;
+	--_field100;
+	_fieldEC = 0;
+
+	if (!(_npcFlags & NPCFLAG_8)) {
+		CNPCPlayTalkingAnimationMsg msg1(0, 2, 0);
+		msg1.execute(this);
+		CNPCQueueIdleAnimMsg msg2;
+		msg2.execute(this);
+	}
+
+	return true;
+}
+
+bool CTrueTalkNPC::MovieEndMsg(CMovieEndMsg *msg) {
+	if (_npcFlags & NPCFLAG_2) {
+		_npcFlags &= ~NPCFLAG_2;
+		CNPCQueueIdleAnimMsg idleMsg;
+		idleMsg.execute(this);
+		return true;
+	} else if (!(_npcFlags & NPCFLAG_SPEAKING)) {
+		return false;
+	}
+
+	int diff = g_vm->_events->getTicksCount() - _fieldF0;
+	int ticks = MAX((int)_fieldEC - diff, 0);
+	CNPCPlayTalkingAnimationMsg msg1(ticks, ticks > 1000 ? 2 : 1, 0);
+	msg1.execute(this);
+
+	if (msg1._value3) {
+		CNPCPlayAnimationMsg msg2(msg1._value3, msg1._value1);
+		msg2.execute(this);
+	}
+	
+	return true;
+}
+
+bool CTrueTalkNPC::NPCQueueIdleAnimMsg(CNPCQueueIdleAnimMsg *msg) {
+	// TODO
+	return false;
+}
+
+bool CTrueTalkNPC::TimerMsg(CTimerMsg *msg) {
+	// TODO
+	return false;
+}
+
+bool CTrueTalkNPC::NPCPlayAnimationMsg(CNPCPlayAnimationMsg *msg) {
+	// TODO
+	return false;
+}
+
+void CTrueTalkNPC::processInput(CTextInputMsg *msg, CViewItem *view) {
+	// TODO
+}
+
+void CTrueTalkNPC::performAction(int val1, int val2) {
+	// TODO
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index 9546f18..74bf044 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -24,22 +24,42 @@
 #define TITANIC_TRUE_TALK_NPC_H
 
 #include "titanic/npcs/character.h"
+#include "titanic/messages/messages.h"
 
 namespace Titanic {
 
+enum NpcFlag {
+	NPCFLAG_SPEAKING = 1, NPCFLAG_2 = 2, NPCFLAG_4 = 4, NPCFLAG_8 = 8
+};
+
+class CViewItem;
+
 class CTrueTalkNPC : public CCharacter {
+	DECLARE_MESSAGE_MAP
+	bool TextInputMsg(CTextInputMsg *msg);
+	bool TrueTalkGetAssetDetailsMsg(CTrueTalkGetAssetDetailsMsg *msg);
+	bool DismissBotMsg(CDismissBotMsg *msg);
+	bool TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *msg);
+	bool TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg);
+	bool MovieEndMsg(CMovieEndMsg *msg);
+	bool NPCQueueIdleAnimMsg(CNPCQueueIdleAnimMsg *msg);
+	bool TimerMsg(CTimerMsg *msg);
+	bool NPCPlayAnimationMsg(CNPCPlayAnimationMsg *msg);
 protected:
-	int _fieldD4;
-	CString _string1;
+	int _assetNumber;
+	CString _assetName;
 	int _fieldE4;
-	int _fieldE8;
+	uint _npcFlags;
 	int _fieldEC;
 	int _fieldF0;
 	int _fieldF4;
 	int _fieldF8;
-	int _fieldFC;
+	int _speechTimerId;
 	int _field100;
 	int _field104;
+protected:
+	void processInput(CTextInputMsg *msg, CViewItem *view);
+	void performAction(int val1, int val2);
 public:
 	CLASSDEF
 	CTrueTalkNPC();


Commit: 7396781cd44c2ec340308e5ad9de9cefc0ef3eeb
    https://github.com/scummvm/scummvm/commit/7396781cd44c2ec340308e5ad9de9cefc0ef3eeb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:35-04:00

Commit Message:
TITANIC: Implemented more CTrueTalkNPC message handlers

Changed paths:
    engines/titanic/messages/messages.h
    engines/titanic/npcs/true_talk_npc.cpp
    engines/titanic/npcs/true_talk_npc.h



diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index fb3169c..f9589ce 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -269,9 +269,9 @@ MESSAGE2(CMovieFrameMsg, int, value1, 0, int, value2, 0);
 MESSAGE0(CMusicHasStartedMsg);
 MESSAGE0(CMusicHasStoppedMsg);
 MESSAGE0(CMusicSettingChangedMsg);
-MESSAGE2(CNPCPlayAnimationMsg, int, value1, 0, int, value2, 0);
-MESSAGE1(CNPCPlayIdleAnimationMsg, int, value, 0);
-MESSAGE3(CNPCPlayTalkingAnimationMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE2(CNPCPlayAnimationMsg, void *, data, 0, int, value2, 0);
+MESSAGE1(CNPCPlayIdleAnimationMsg, void *, value, 0);
+MESSAGE3(CNPCPlayTalkingAnimationMsg, int, value1, 0, int, value2, 0, void *, value3, nullptr);
 MESSAGE0(CNPCQueueIdleAnimMsg);
 MESSAGE1(CNutPuzzleMsg, CString, value, "");
 MESSAGE1(COnSummonBotMsg, int, value, 0);
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index 72b3cf2..183c189 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -160,18 +160,35 @@ bool CTrueTalkNPC::MovieEndMsg(CMovieEndMsg *msg) {
 }
 
 bool CTrueTalkNPC::NPCQueueIdleAnimMsg(CNPCQueueIdleAnimMsg *msg) {
-	// TODO
-	return false;
+	int rndVal = g_vm->getRandomNumber(_fieldF8 - 1) - (_fieldF8 / 2);
+	_speechTimerId = startAnimTimer("NPCIdleAnim", _fieldF4 + rndVal, 0);
+	
+	return true;
 }
 
 bool CTrueTalkNPC::TimerMsg(CTimerMsg *msg) {
-	// TODO
-	return false;
+	if (_npcFlags & NPCFLAG_4) {
+		if (_field100 > 0)
+			return false;
+
+		CNPCPlayIdleAnimationMsg idleMsg;
+		if (idleMsg.execute(this)) {
+			if (idleMsg._value) {
+				CNPCPlayAnimationMsg animMsg(idleMsg._value, 0);
+				animMsg.execute(this);
+			}
+
+			_npcFlags &= ~NPCFLAG_2;
+		}
+	}
+
+	_speechTimerId = 0;
+	return true;
 }
 
 bool CTrueTalkNPC::NPCPlayAnimationMsg(CNPCPlayAnimationMsg *msg) {
-	// TODO
-	return false;
+	warning("CTrueTalkNPC::NPCPlayAnimationMsg");
+	return true;
 }
 
 void CTrueTalkNPC::processInput(CTextInputMsg *msg, CViewItem *view) {
@@ -182,4 +199,12 @@ void CTrueTalkNPC::performAction(int val1, int val2) {
 	// TODO
 }
 
+int CTrueTalkNPC::startAnimTimer(const CString &action, uint firstDuration, uint duration) {
+	CTimeEventInfo *timer = new CTimeEventInfo(g_vm->_events->getTicksCount(),
+		duration > 0, firstDuration, duration, this, 0, action);
+	getGameManager()->addTimer(timer);
+
+	return timer->_id;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index 74bf044..ad436a5 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -60,6 +60,11 @@ protected:
 protected:
 	void processInput(CTextInputMsg *msg, CViewItem *view);
 	void performAction(int val1, int val2);
+	
+	/**
+	 * Start an animation timer
+	 */
+	int startAnimTimer(const CString &action, uint firstDuration, uint duration);
 public:
 	CLASSDEF
 	CTrueTalkNPC();


Commit: 1e42f6ffed4c1d187863b548c708b42d611aab0e
    https://github.com/scummvm/scummvm/commit/1e42f6ffed4c1d187863b548c708b42d611aab0e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:36-04:00

Commit Message:
TITANIC: Beginnings of input line processing

Changed paths:
    engines/titanic/messages/messages.h
    engines/titanic/npcs/true_talk_npc.cpp
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/title_engine.cpp
    engines/titanic/true_talk/title_engine.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_string.h



diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index f9589ce..aeb82d5 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -269,7 +269,7 @@ MESSAGE2(CMovieFrameMsg, int, value1, 0, int, value2, 0);
 MESSAGE0(CMusicHasStartedMsg);
 MESSAGE0(CMusicHasStoppedMsg);
 MESSAGE0(CMusicSettingChangedMsg);
-MESSAGE2(CNPCPlayAnimationMsg, void *, data, 0, int, value2, 0);
+MESSAGE2(CNPCPlayAnimationMsg, void *, data, nullptr, int, value2, 0);
 MESSAGE1(CNPCPlayIdleAnimationMsg, void *, value, 0);
 MESSAGE3(CNPCPlayTalkingAnimationMsg, int, value1, 0, int, value2, 0, void *, value3, nullptr);
 MESSAGE0(CNPCQueueIdleAnimMsg);
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index 183c189..bc562ef 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -192,7 +192,9 @@ bool CTrueTalkNPC::NPCPlayAnimationMsg(CNPCPlayAnimationMsg *msg) {
 }
 
 void CTrueTalkNPC::processInput(CTextInputMsg *msg, CViewItem *view) {
-	// TODO
+	CTrueTalkManager *talkManager = getGameManager()->getTalkManager();
+	if (talkManager)
+		talkManager->processInput(this, msg, view);
 }
 
 void CTrueTalkNPC::performAction(int val1, int val2) {
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index de10121..eb7979e 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -30,8 +30,12 @@ CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) {
 }
 
 void CScriptHandler::setup(TTNamedScript *npcScript, TTRoomScript *roomScript, uint charId) {
-
+	// TODO
 }
 
+void CScriptHandler::processInput(TTNamedScript *npcScript, TTRoomScript *roomScript,
+		const TTString &line) {
+	// TODO
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 69c1c94..1959468 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -25,6 +25,7 @@
 
 #include "titanic/true_talk/tt_named_script.h"
 #include "titanic/true_talk/tt_room_script.h"
+#include "titanic/true_talk/tt_string.h"
 
 namespace Titanic {
 
@@ -40,6 +41,9 @@ public:
 	 * Set the character and room
 	 */
 	void setup(TTNamedScript *npcScript, TTRoomScript *roomScript, uint charId);
+
+	void processInput(TTNamedScript *npcScript, TTRoomScript *roomScript,
+		const TTString &line);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
index d5015b4..528c4b1 100644
--- a/engines/titanic/true_talk/title_engine.cpp
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -24,12 +24,12 @@
 
 namespace Titanic {
 
-CTitleEngine::CTitleEngine() : _script(nullptr), _handler(nullptr) {
+CTitleEngine::CTitleEngine() : _script(nullptr), _scriptHandler(nullptr) {
 }
 
 CTitleEngine::~CTitleEngine() {
 	delete _script;
-	delete _handler;
+	delete _scriptHandler;
 }
 
 void CTitleEngine::setup(int val1, int val2) {
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index 8d32067..e9bc624 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -33,9 +33,10 @@ namespace Titanic {
 
 class CTitleEngine {
 protected:
-	CScriptHandler *_handler;
 	TTScriptBase *_script;
 public:
+	CScriptHandler *_scriptHandler;
+public:
 	CTitleEngine();
 	~CTitleEngine();
 
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 091e3f8..dc93bf4 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -286,4 +286,26 @@ void CTrueTalkManager::loadAssets(CTrueTalkNPC *npc, int charId) {
 	}
 }
 
+void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CViewItem *view) {
+	TTNamedScript *npcScript = getNpcScript(npc);
+	TTRoomScript *roomScript = getRoomScript();
+	_titleEngine.reset();
+
+	if (npcScript && roomScript) {
+		_currentNPC = npc;
+		_titleEngine._scriptHandler->processInput(npcScript, roomScript,
+			TTString(msg->_input));
+		_currentNPC = nullptr;
+
+		loadAssets(npc, npcScript->charId());
+		setView(npcScript, roomScript, view);
+	}
+	
+	_currentNPC = nullptr;
+}
+
+void CTrueTalkManager::setView(TTNamedScript *npcScript, TTRoomScript *roomScript, CViewItem *view) {
+	warning("TODO: CTrueTalkManager::setView");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index d2bba4b..3c24ade 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_TRUE_TALK_MANAGER_H
 #define TITANIC_TRUE_TALK_MANAGER_H
 
+#include "titanic/messages/messages.h"
 #include "titanic/support/simple_file.h"
 #include "titanic/true_talk/dialogue_file.h"
 #include "titanic/true_talk/title_engine.h"
@@ -32,6 +33,7 @@ namespace Titanic {
 
 class CGameManager;
 class CTreeItem;
+class CViewItem;
 class CTrueTalkNPC;
 
 class CTrueTalkManager {
@@ -77,6 +79,8 @@ private:
 	 * Loads assets for the current character, if it's changed
 	 */
 	void loadAssets(CTrueTalkNPC *npc, int charId);
+
+	void setView(TTNamedScript *npcScript, TTRoomScript *roomScript, CViewItem *view);
 public:
 	static int _v1;
 	static int _v2;
@@ -149,6 +153,11 @@ public:
 	 * Return a TrueTalk talker/script
 	 */
 	TTNamedScript *getTalker(const CString &name) const;
+
+	/**
+	 * Process player's input
+	 */
+	void processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CViewItem *view);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 60fdde0..d593553 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -33,6 +33,7 @@ public:
 public:
 	TTString() : CString(), _status(0) {}
 	TTString(const char *str) : CString(str), _status(0) {}
+	TTString(const CString &str) : CString(str), _status(0) {}
 	virtual ~TTString() {}
 
 	bool isValid() const { return !_status; }


Commit: b138134192bda77a4c1c941e194dc9d353aae256
    https://github.com/scummvm/scummvm/commit/b138134192bda77a4c1c941e194dc9d353aae256
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:38-04:00

Commit Message:
TITANIC: Finished CTrueTalkManager start method

Changed paths:
    engines/titanic/carry/carry_parrot.cpp
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/computer_screen.cpp
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index aa75688..d164e2e 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -169,7 +169,7 @@ bool CCarryParrot::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
 
 	CTrueTalkNPC *npc = static_cast<CTrueTalkNPC *>(getRoot()->findByName(_string6));
 	if (npc)
-		startTalking(npc, 0x446BF, 0);
+		startTalking(npc, 0x446BF);
 
 	_fieldE0 = 0;
 	playSound("z#475.wav", 100, 0, 0);
@@ -200,7 +200,7 @@ bool CCarryParrot::ActMsg(CActMsg *msg) {
 	if (msg->_action == "FreeParrot" && (CParrot::_v4 == 4 || CParrot::_v4 == 1)) {
 		CTrueTalkNPC *npc = static_cast<CTrueTalkNPC *>(getRoot()->findByName(_string6));
 		if (npc)
-			startTalking(npc, 0x446BF, 0);
+			startTalking(npc, 0x446BF);
 
 		setVisible(false);
 		_fieldE0 = 0;
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index ff7e228..7cfcd33 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -707,17 +707,17 @@ void CGameObject::incState38() {
 	getGameManager()->_gameState.inc38();
 }
 
-void CGameObject::startTalking(const CString &npcName, int val2, int val3) {
+void CGameObject::startTalking(const CString &npcName, uint id, CViewItem *view) {
 	CTrueTalkNPC *npc = static_cast<CTrueTalkNPC *>(getRoot()->findByName(npcName));
-	startTalking(npc, val2, val3);
+	startTalking(npc, id, view);
 }
 
-void CGameObject::startTalking(CTrueTalkNPC *npc, int val2, int val3) {
+void CGameObject::startTalking(CTrueTalkNPC *npc, uint id, CViewItem *view) {
 	CGameManager *gameManager = getGameManager();
 	if (gameManager) {
 		CTrueTalkManager *talkManager = gameManager->getTalkManager();
 		if (talkManager)
-			talkManager->start(npc, val2, val3);
+			talkManager->start(npc, id, view);
 	}
 }
 
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 97d3ca4..4d2dca6 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -220,12 +220,12 @@ protected:
 	/**
 	 * Start a conversation with the NPC
 	 */
-	void startTalking(const CString &name, int val2, int val3);
+	void startTalking(const CString &name, uint id, CViewItem *view = nullptr);
 
 	/**
 	 * Start a conversation with the NPC
 	 */
-	void startTalking(CTrueTalkNPC *npc, int val2, int val3);
+	void startTalking(CTrueTalkNPC *npc, uint id, CViewItem *view = nullptr);
 
 	/**
 	 * Load the surface
diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp
index 846858b..9d15ea9 100644
--- a/engines/titanic/game/computer_screen.cpp
+++ b/engines/titanic/game/computer_screen.cpp
@@ -114,11 +114,11 @@ bool CComputerScreen::TimerMsg(CTimerMsg *msg) {
 		playSound("y#662.wav");
 		soundFn3(handle, 10, 2);
 		playClip(392, 450);
-		startTalking("Doorbot", 0x3611A, 0);
+		startTalking("Doorbot", 0x3611A);
 		sleep(8000);
 		
 		playClip(450, 492);
-		startTalking("Doorbot", 0x36121, 0);
+		startTalking("Doorbot", 0x36121);
 		playClip(492, 522);
 		soundFn3(handle, 30, 2);
 
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index dc93bf4..58d9253 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -201,7 +201,7 @@ void CTrueTalkManager::update2() {
 	//warning("CTrueTalkManager::update2");
 }
 
-void CTrueTalkManager::start(CTrueTalkNPC *npc, int val2, int val3) {
+void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) {
 	TTNamedScript *npcScript = getNpcScript(npc);
 	TTRoomScript *roomScript = getRoomScript();
 	
@@ -210,10 +210,10 @@ void CTrueTalkManager::start(CTrueTalkNPC *npc, int val2, int val3) {
 	loadAssets(npc, charId);
 
 	_currentNPC = npc;
-	warning("TODO: CTrueTalkManager::start");
+	_titleEngine._scriptHandler->setup(npcScript, roomScript, charId);
 	_currentNPC = nullptr;
 
-	//TODO: More
+	setView(npcScript, roomScript, view);
 }
 
 TTNamedScript *CTrueTalkManager::getTalker(const CString &name) const {
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 3c24ade..c3c25a3 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -147,7 +147,7 @@ public:
 	/**
 	 * Start a TrueTalk conversation
 	 */
-	void start(CTrueTalkNPC *npc, int val2, int val3);
+	void start(CTrueTalkNPC *npc, uint id, CViewItem *view);
 
 	/**
 	 * Return a TrueTalk talker/script


Commit: 695549585e4fb0578d6add32ac20d19be2c59a0b
    https://github.com/scummvm/scummvm/commit/695549585e4fb0578d6add32ac20d19be2c59a0b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:39-04:00

Commit Message:
TITANIC: Implemented CDialogueFile addToCache

Changed paths:
    engines/titanic/true_talk/dialogue_file.cpp
    engines/titanic/true_talk/dialogue_file.h



diff --git a/engines/titanic/true_talk/dialogue_file.cpp b/engines/titanic/true_talk/dialogue_file.cpp
index 341d973..b52bf2a 100644
--- a/engines/titanic/true_talk/dialogue_file.cpp
+++ b/engines/titanic/true_talk/dialogue_file.cpp
@@ -24,20 +24,25 @@
 
 namespace Titanic {
 
+void DialogueFileIndexEntry::load(Common::SeekableReadStream &s) {
+	_v1 = s.readUint32LE();
+	_offset = s.readUint32LE();
+}
+
+/*------------------------------------------------------------------------*/
+
 CDialogueFile::CDialogueFile(const CString &filename, uint count) {
 	if (!_file.open(filename))
 		error("Could not locate dialogue file - %s", filename.c_str());
 	
-	_data1.resize(count);
+	_cache.resize(count);
 
 	_file.readUint32LE();		// Skip over file Id
 	_entries.resize(_file.readUint32LE());
 
 	// Read in the entries
-	for (uint idx = 0; idx < _entries.size(); ++idx) {
-		_entries[idx].v1 = _file.readUint32LE();
-		_entries[idx].v2 = _file.readUint32LE();
-	}
+	for (uint idx = 0; idx < _entries.size(); ++idx)
+		_entries[idx].load(_file);
 }
 
 CDialogueFile::~CDialogueFile() {
@@ -48,4 +53,34 @@ void CDialogueFile::clear() {
 	_file.close();
 }
 
+DialogueFileCacheEntry *CDialogueFile::addToCache(int index) {
+	if (_entries.size() == 0 || index < 0 || index >= (int)_entries.size()
+			|| !_entries[index]._v1)
+		return nullptr;
+
+	// Scan cache for a free slot
+	uint cacheIndex = 0;
+	while (cacheIndex < _cache.size() && !_cache[cacheIndex]._active)
+		++cacheIndex;
+	if (cacheIndex == _cache.size())
+		return nullptr;
+
+	DialogueFileIndexEntry &entry = _entries[index];
+	DialogueFileCacheEntry &cacheEntry = _cache[cacheIndex];
+
+	cacheEntry._active = true;
+	cacheEntry._offset = entry._offset;
+	cacheEntry.v3 = 0;
+	cacheEntry._entryPtr = &entry;
+
+	// Figure out the size of the entry
+	if (index == ((int)_entries.size() - 1)) {
+		cacheEntry._size = _file.size() - entry._offset;
+	} else {
+		cacheEntry._size = _entries[index + 1]._offset - entry._offset;
+	}
+
+	return &cacheEntry;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/dialogue_file.h b/engines/titanic/true_talk/dialogue_file.h
index 00bacac..8d40045 100644
--- a/engines/titanic/true_talk/dialogue_file.h
+++ b/engines/titanic/true_talk/dialogue_file.h
@@ -28,18 +28,27 @@
 
 namespace Titanic {
 
+struct DialogueFileIndexEntry {
+	uint _v1, _offset;
+
+	DialogueFileIndexEntry() : _v1(0), _offset(0) {}
+	void load(Common::SeekableReadStream &s);
+};
+
+struct DialogueFileCacheEntry {
+	bool _active;
+	uint _offset, v3, _size;
+	DialogueFileIndexEntry *_entryPtr;
+
+	DialogueFileCacheEntry() : _active(false), _offset(0), _size(0),
+		v3(0), _entryPtr(nullptr) {}
+};
+
 class CDialogueFile {
-	struct CDialogueFileEntry {
-		uint v1;
-		uint v2;
-	};
-	struct EntryRec {
-		uint v1, v2, v3, v4, v5;
-	};
 private:
 	Common::File _file;
-	Common::Array<CDialogueFileEntry> _entries;
-	Common::Array<EntryRec> _data1;
+	Common::Array<DialogueFileIndexEntry> _entries;
+	Common::Array<DialogueFileCacheEntry> _cache;
 public:
 	CDialogueFile(const CString &filename, uint count);
 	~CDialogueFile();
@@ -48,6 +57,11 @@ public:
 	 * Clear the loaded data
 	 */
 	void clear();
+
+	/**
+	 * Add a dialogue file entry to the active cache
+	 */
+	DialogueFileCacheEntry *addToCache(int index);
 };
 
 } // End of namespace Titanic


Commit: 09002173031558ccda8c05ef4cc1df329d1da6eb
    https://github.com/scummvm/scummvm/commit/09002173031558ccda8c05ef4cc1df329d1da6eb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:40-04:00

Commit Message:
TITANIC: Implement CDialogueFile read

Changed paths:
    engines/titanic/true_talk/dialogue_file.cpp
    engines/titanic/true_talk/dialogue_file.h



diff --git a/engines/titanic/true_talk/dialogue_file.cpp b/engines/titanic/true_talk/dialogue_file.cpp
index b52bf2a..1d1d789 100644
--- a/engines/titanic/true_talk/dialogue_file.cpp
+++ b/engines/titanic/true_talk/dialogue_file.cpp
@@ -55,7 +55,7 @@ void CDialogueFile::clear() {
 
 DialogueFileCacheEntry *CDialogueFile::addToCache(int index) {
 	if (_entries.size() == 0 || index < 0 || index >= (int)_entries.size()
-			|| !_entries[index]._v1)
+			|| _cache.empty())
 		return nullptr;
 
 	// Scan cache for a free slot
@@ -70,7 +70,7 @@ DialogueFileCacheEntry *CDialogueFile::addToCache(int index) {
 
 	cacheEntry._active = true;
 	cacheEntry._offset = entry._offset;
-	cacheEntry.v3 = 0;
+	cacheEntry._bytesRead = 0;
 	cacheEntry._entryPtr = &entry;
 
 	// Figure out the size of the entry
@@ -80,7 +80,22 @@ DialogueFileCacheEntry *CDialogueFile::addToCache(int index) {
 		cacheEntry._size = _entries[index + 1]._offset - entry._offset;
 	}
 
+	// Return a pointer to the loaded entry
 	return &cacheEntry;
 }
 
+bool CDialogueFile::read(DialogueFileCacheEntry *cacheEntry, byte *buffer, size_t bytesToRead) {
+	// Sanity checks that a valid record is passed, and the size can be read
+	if (!cacheEntry || !cacheEntry->_active || !bytesToRead
+		|| (cacheEntry->_bytesRead + bytesToRead) > cacheEntry->_size)
+		return false;
+
+	// Move to the correct position in the file
+	_file.seek(cacheEntry->_offset + cacheEntry->_bytesRead);
+	bool result = _file.read(buffer, bytesToRead) == bytesToRead;
+	cacheEntry->_bytesRead += bytesToRead;
+
+	return result;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/dialogue_file.h b/engines/titanic/true_talk/dialogue_file.h
index 8d40045..5db91d9 100644
--- a/engines/titanic/true_talk/dialogue_file.h
+++ b/engines/titanic/true_talk/dialogue_file.h
@@ -37,11 +37,16 @@ struct DialogueFileIndexEntry {
 
 struct DialogueFileCacheEntry {
 	bool _active;
-	uint _offset, v3, _size;
+	uint _offset, _bytesRead, _size;
 	DialogueFileIndexEntry *_entryPtr;
 
-	DialogueFileCacheEntry() : _active(false), _offset(0), _size(0),
-		v3(0), _entryPtr(nullptr) {}
+	DialogueFileCacheEntry() : _active(false), _offset(0),
+		_bytesRead(0), _size(0), _entryPtr(nullptr) {}
+
+	/**
+	 * Return the size of a cache entry
+	 */
+	int size() const { return _active ? _size : 0; }
 };
 
 class CDialogueFile {
@@ -49,6 +54,11 @@ private:
 	Common::File _file;
 	Common::Array<DialogueFileIndexEntry> _entries;
 	Common::Array<DialogueFileCacheEntry> _cache;
+private:
+	/**
+	 * Add a dialogue file entry to the active cache
+	 */
+	DialogueFileCacheEntry *addToCache(int index);
 public:
 	CDialogueFile(const CString &filename, uint count);
 	~CDialogueFile();
@@ -61,7 +71,21 @@ public:
 	/**
 	 * Add a dialogue file entry to the active cache
 	 */
-	DialogueFileCacheEntry *addToCache(int index);
+	DialogueFileCacheEntry *addToCacheDouble(int index) {
+		return addToCache(index * 2);
+	}
+
+	/**
+	 * Add a dialogue file entry to the active cache
+	 */
+	DialogueFileCacheEntry *addToCacheDouble1(int index) {
+		return addToCache(index * 2 + 1);
+	}
+
+	/**
+	 * Read data for a resource
+	 */
+	bool read(DialogueFileCacheEntry *cacheEntry, byte *buffer, size_t bytesToRead);
 };
 
 } // End of namespace Titanic


Commit: 0692d261eeea7dd9260e00dc6bc43dda963a41d4
    https://github.com/scummvm/scummvm/commit/0692d261eeea7dd9260e00dc6bc43dda963a41d4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:41-04:00

Commit Message:
TITANIC: Implement reading dialogue string

Changed paths:
    engines/titanic/true_talk/dialogue_file.cpp
    engines/titanic/true_talk/dialogue_file.h
    engines/titanic/true_talk/title_engine.cpp
    engines/titanic/true_talk/title_engine.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/true_talk/dialogue_file.cpp b/engines/titanic/true_talk/dialogue_file.cpp
index 1d1d789..34eb164 100644
--- a/engines/titanic/true_talk/dialogue_file.cpp
+++ b/engines/titanic/true_talk/dialogue_file.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void DialogueFileIndexEntry::load(Common::SeekableReadStream &s) {
+void DialogueIndexEntry::load(Common::SeekableReadStream &s) {
 	_v1 = s.readUint32LE();
 	_offset = s.readUint32LE();
 }
@@ -38,11 +38,11 @@ CDialogueFile::CDialogueFile(const CString &filename, uint count) {
 	_cache.resize(count);
 
 	_file.readUint32LE();		// Skip over file Id
-	_entries.resize(_file.readUint32LE());
+	_index.resize(_file.readUint32LE());
 
 	// Read in the entries
-	for (uint idx = 0; idx < _entries.size(); ++idx)
-		_entries[idx].load(_file);
+	for (uint idx = 0; idx < _index.size(); ++idx)
+		_index[idx].load(_file);
 }
 
 CDialogueFile::~CDialogueFile() {
@@ -53,8 +53,8 @@ void CDialogueFile::clear() {
 	_file.close();
 }
 
-DialogueFileCacheEntry *CDialogueFile::addToCache(int index) {
-	if (_entries.size() == 0 || index < 0 || index >= (int)_entries.size()
+DialogueResource *CDialogueFile::addToCache(int index) {
+	if (_index.size() == 0 || index < 0 || index >= (int)_index.size()
 			|| _cache.empty())
 		return nullptr;
 
@@ -65,26 +65,34 @@ DialogueFileCacheEntry *CDialogueFile::addToCache(int index) {
 	if (cacheIndex == _cache.size())
 		return nullptr;
 
-	DialogueFileIndexEntry &entry = _entries[index];
-	DialogueFileCacheEntry &cacheEntry = _cache[cacheIndex];
+	DialogueIndexEntry &indexEntry = _index[index];
+	DialogueResource &res = _cache[cacheIndex];
 
-	cacheEntry._active = true;
-	cacheEntry._offset = entry._offset;
-	cacheEntry._bytesRead = 0;
-	cacheEntry._entryPtr = &entry;
+	res._active = true;
+	res._offset = indexEntry._offset;
+	res._bytesRead = 0;
+	res._entryPtr = &indexEntry;
 
 	// Figure out the size of the entry
-	if (index == ((int)_entries.size() - 1)) {
-		cacheEntry._size = _file.size() - entry._offset;
+	if (index == ((int)_index.size() - 1)) {
+		res._size = _file.size() - indexEntry._offset;
 	} else {
-		cacheEntry._size = _entries[index + 1]._offset - entry._offset;
+		res._size = _index[index + 1]._offset - indexEntry._offset;
 	}
 
 	// Return a pointer to the loaded entry
-	return &cacheEntry;
+	return &res;
 }
 
-bool CDialogueFile::read(DialogueFileCacheEntry *cacheEntry, byte *buffer, size_t bytesToRead) {
+bool CDialogueFile::closeEntry(DialogueResource *cacheEntry) {
+	if (!cacheEntry || !cacheEntry->_active)
+		return false;
+
+	cacheEntry->_active = false;
+	return true;
+}
+
+bool CDialogueFile::read(DialogueResource *cacheEntry, byte *buffer, size_t bytesToRead) {
 	// Sanity checks that a valid record is passed, and the size can be read
 	if (!cacheEntry || !cacheEntry->_active || !bytesToRead
 		|| (cacheEntry->_bytesRead + bytesToRead) > cacheEntry->_size)
diff --git a/engines/titanic/true_talk/dialogue_file.h b/engines/titanic/true_talk/dialogue_file.h
index 5db91d9..299d01d 100644
--- a/engines/titanic/true_talk/dialogue_file.h
+++ b/engines/titanic/true_talk/dialogue_file.h
@@ -28,37 +28,37 @@
 
 namespace Titanic {
 
-struct DialogueFileIndexEntry {
+struct DialogueIndexEntry {
 	uint _v1, _offset;
 
-	DialogueFileIndexEntry() : _v1(0), _offset(0) {}
+	DialogueIndexEntry() : _v1(0), _offset(0) {}
 	void load(Common::SeekableReadStream &s);
 };
 
-struct DialogueFileCacheEntry {
+struct DialogueResource {
 	bool _active;
 	uint _offset, _bytesRead, _size;
-	DialogueFileIndexEntry *_entryPtr;
+	DialogueIndexEntry *_entryPtr;
 
-	DialogueFileCacheEntry() : _active(false), _offset(0),
+	DialogueResource() : _active(false), _offset(0),
 		_bytesRead(0), _size(0), _entryPtr(nullptr) {}
 
 	/**
 	 * Return the size of a cache entry
 	 */
-	int size() const { return _active ? _size : 0; }
+	size_t size() const { return _active ? _size : 0; }
 };
 
 class CDialogueFile {
 private:
 	Common::File _file;
-	Common::Array<DialogueFileIndexEntry> _entries;
-	Common::Array<DialogueFileCacheEntry> _cache;
+	Common::Array<DialogueIndexEntry> _index;
+	Common::Array<DialogueResource> _cache;
 private:
 	/**
 	 * Add a dialogue file entry to the active cache
 	 */
-	DialogueFileCacheEntry *addToCache(int index);
+	DialogueResource *addToCache(int index);
 public:
 	CDialogueFile(const CString &filename, uint count);
 	~CDialogueFile();
@@ -69,23 +69,28 @@ public:
 	void clear();
 
 	/**
-	 * Add a dialogue file entry to the active cache
+	 * Sets up a text entry within the dialogue file for access
 	 */
-	DialogueFileCacheEntry *addToCacheDouble(int index) {
+	DialogueResource *openTextEntry(int index) {
 		return addToCache(index * 2);
 	}
 
 	/**
-	 * Add a dialogue file entry to the active cache
+	 * Sets up a wave (sound) entry within the dialogue file for access
 	 */
-	DialogueFileCacheEntry *addToCacheDouble1(int index) {
+	DialogueResource *openWaveEntry(int index) {
 		return addToCache(index * 2 + 1);
 	}
 
 	/**
+	 * Removes an entry from the cache
+	 */
+	bool closeEntry(DialogueResource *cacheEntry);
+
+	/**
 	 * Read data for a resource
 	 */
-	bool read(DialogueFileCacheEntry *cacheEntry, byte *buffer, size_t bytesToRead);
+	bool read(DialogueResource *cacheEntry, byte *buffer, size_t bytesToRead);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
index 528c4b1..5b8e8d9 100644
--- a/engines/titanic/true_talk/title_engine.cpp
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -48,7 +48,7 @@ STtitleEngine::~STtitleEngine() {
 
 void STtitleEngine::reset() {
 	_field58 = 0;
-	_array.clear();
+	_indexes.clear();
 }
 
 void STtitleEngine::setup(int val1, int val2) {
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index e9bc624..ab541ec 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -69,7 +69,8 @@ private:
 	Common::PEResources _resources;
 	Common::SeekableReadStream *_stream;
 	int _field58;
-	Common::Array<uint> _array;
+public:
+	Common::Array<uint> _indexes;
 	Common::Array<byte> _data;
 public:
 	STtitleEngine();
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 58d9253..6552a5d 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -44,7 +44,7 @@ CTrueTalkNPC *CTrueTalkManager::_currentNPC;
 
 CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : 
 		_gameManager(owner), _scripts(&_titleEngine), _currentCharId(0),
-		_dialogueFile(nullptr), _field14(0) {
+		_dialogueFile(nullptr), _dialogueIndex(0) {
 }
 
 CTrueTalkManager::~CTrueTalkManager() {
@@ -213,7 +213,7 @@ void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) {
 	_titleEngine._scriptHandler->setup(npcScript, roomScript, charId);
 	_currentNPC = nullptr;
 
-	setView(npcScript, roomScript, view);
+	setDialogue(npcScript, roomScript, view);
 }
 
 TTNamedScript *CTrueTalkManager::getTalker(const CString &name) const {
@@ -282,7 +282,7 @@ void CTrueTalkManager::loadAssets(CTrueTalkNPC *npc, int charId) {
 
 	if (!detailsMsg._filename.empty()) {
 		_dialogueFile = new CDialogueFile(detailsMsg._filename, 20);
-		_field14 = detailsMsg._numValue + 1;
+		_dialogueIndex = detailsMsg._numValue + 1;
 	}
 }
 
@@ -298,14 +298,57 @@ void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CView
 		_currentNPC = nullptr;
 
 		loadAssets(npc, npcScript->charId());
-		setView(npcScript, roomScript, view);
+		setDialogue(npcScript, roomScript, view);
 	}
 	
 	_currentNPC = nullptr;
 }
 
-void CTrueTalkManager::setView(TTNamedScript *npcScript, TTRoomScript *roomScript, CViewItem *view) {
-	warning("TODO: CTrueTalkManager::setView");
+void CTrueTalkManager::setDialogue(TTNamedScript *npcScript, TTRoomScript *roomScript, CViewItem *view) {
+	warning("TODO: CTrueTalkManager::setDialogue");
+}
+
+#define STRING_BUFFER_SIZE 2048
+
+CString CTrueTalkManager::readDialogueString() {
+	byte buffer[STRING_BUFFER_SIZE];
+	CString result;
+
+	for (uint idx = 0; idx < _titleEngine._indexes.size(); ++idx) {
+		if (idx != 0)
+			result += " ";
+
+		// Open a text entry from the dialogue file for access
+		DialogueResource *textRes = _dialogueFile->openTextEntry(
+			_titleEngine._indexes[idx] - _dialogueIndex);
+		if (!textRes)
+			continue;
+
+		size_t entrySize = textRes->size();
+		byte *tempBuffer = (entrySize < STRING_BUFFER_SIZE) ? buffer :
+			new byte[entrySize + 1];
+		
+		_dialogueFile->read(textRes, tempBuffer, entrySize);
+		buffer[entrySize] = '\0';
+
+		// Close the resource
+		_dialogueFile->closeEntry(textRes);
+
+		// Strip off any non-printable characters
+		for (byte *p = buffer; *p != '\0'; ++p) {
+			if (*p < 32 || *p > 127)
+				*p = ' ';
+		}
+
+		// Add string to result
+		result += CString((const char *)buffer);
+
+		// Free buffer if one was allocated
+		if (entrySize >= STRING_BUFFER_SIZE)
+			delete[] tempBuffer;
+	}
+
+	return result;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index c3c25a3..3843483 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -43,7 +43,7 @@ private:
 	TTScripts _scripts;
 	int _currentCharId;
 	CDialogueFile *_dialogueFile;
-	int _field14;
+	int _dialogueIndex;
 private:
 	/**
 	 * Loads the statics for the class
@@ -80,7 +80,12 @@ private:
 	 */
 	void loadAssets(CTrueTalkNPC *npc, int charId);
 
-	void setView(TTNamedScript *npcScript, TTRoomScript *roomScript, CViewItem *view);
+	void setDialogue(TTNamedScript *npcScript, TTRoomScript *roomScript, CViewItem *view);
+
+	/**
+	 * Read in a string from the resource
+	 */
+	CString readDialogueString();
 public:
 	static int _v1;
 	static int _v2;


Commit: 339df8657e883ba62bd5c4c474ab920dfa3d19c8
    https://github.com/scummvm/scummvm/commit/339df8657e883ba62bd5c4c474ab920dfa3d19c8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:42-04:00

Commit Message:
TITANIC: Implement CTrueTalkManager triggerNPC

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/messages/messages.h
    engines/titanic/sound/sound.cpp
    engines/titanic/sound/sound.h
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 7cfcd33..b27b461 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -353,7 +353,7 @@ void CGameObject::petFn3(CTreeItem *item) {
 		pet->fn3(item);
 }
 
-void CGameObject::playMovie(uint startFrame, uint endFrame, int val3) {
+void CGameObject::playMovie(uint startFrame, uint endFrame, uint flags) {
 	_frameNumber = -1;
 	if (!_surface) {
 		if (!_resource.empty())
@@ -367,9 +367,9 @@ void CGameObject::playMovie(uint startFrame, uint endFrame, int val3) {
 		if (movie)
 			movie->_gameObject = this;
 
-		_surface->playMovie(startFrame, endFrame, val3, val3 != 0);
+		_surface->playMovie(startFrame, endFrame, flags, flags != 0);
 
-		if (val3 & 0x10)
+		if (flags & 0x10)
 			getGameManager()->_gameState.addMovie(_surface->_movie);
 	}
 }
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 4d2dca6..87cc2ba 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -316,7 +316,7 @@ public:
 	/**
 	 * Play the movie specified in _resource
 	 */
-	void playMovie(uint startFrame, uint endFrame, int val3);
+	void playMovie(uint startFrame, uint endFrame, uint flags);
 
 	/**
 	 * Play an arbitrary clip
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index aeb82d5..561120d 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -341,7 +341,7 @@ MESSAGE1(CTranslateObjectMsg, Point, delta, Point());
 MESSAGE3(CTransportMsg, CString, roomName, "", int, value1, 0, int, value2, 0);
 MESSAGE1(CTriggerAutoMusicPlayerMsg, int, value, 0);
 MESSAGE1(CTriggerNPCEvent, int, value, 0);
-MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, int, value2, 0, int, value3, 0, int, value4, 0);
+MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, uint, index, 0, uint, startFrame, 0, uint, endFrame, 0);
 MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, filename, "", int, numValue, 0);
 MESSAGE2(CTrueTalkGetStateValueMsg, int, value1, 0, int, value2, -1000);
 MESSAGE2(CTrueTalkNotifySpeechEndedMsg, int, value1, 0, int, value2, 0);
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index 3e4f154..cf7689d 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -25,6 +25,11 @@
 
 namespace Titanic {
 
+int CSoundItem::fn1() {
+	// TODO
+	return 0;
+}
+
 CSound::CSound(CGameManager *owner) : _gameManager(owner) {
 }
 
@@ -123,4 +128,9 @@ void CSound::removeOldest() {
 	}
 }
 
+CSoundItem *CSound::getTrueTalkSound(CDialogueFile *dialogueFile, int index) {
+	warning("TODO: CSound::getTrueTalkSound");
+	return nullptr;
+}
+
 } // End of namespace Titanic z
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index dfbee0a..33996de 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -27,6 +27,7 @@
 #include "titanic/sound/sound_manager.h"
 #include "titanic/core/list.h"
 #include "titanic/core/view_item.h"
+#include "titanic/true_talk/dialogue_file.h"
 
 namespace Titanic {
 
@@ -45,6 +46,8 @@ public:
 		_field20(0), _field24(0), _field28(0) {}
 	CSoundItem(const CString &name) : ListItem(), _name(name), 
 		_soundHandle(0), _field1C(0), _field20(0), _field24(0), _field28(0) {}
+
+	int fn1();
 };
 
 class CSoundItemList : public List<CSoundItem> {
@@ -116,6 +119,8 @@ public:
 	void fn2(int handle);
 	void fn3(int handle, int val2, int val3);
 	void managerProc8(int v) { _soundManager.proc8(v); }
+
+	CSoundItem *getTrueTalkSound(CDialogueFile *dialogueFile, int index);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index eb7979e..a46a033 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -29,7 +29,7 @@ namespace Titanic {
 CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) {
 }
 
-void CScriptHandler::setup(TTNamedScript *npcScript, TTRoomScript *roomScript, uint charId) {
+void CScriptHandler::setup(TTRoomScript *roomScript, TTNamedScript *npcScript, uint charId) {
 	// TODO
 }
 
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 1959468..8d5c78d 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Set the character and room
 	 */
-	void setup(TTNamedScript *npcScript, TTRoomScript *roomScript, uint charId);
+	void setup(TTRoomScript *roomScript, TTNamedScript *npcScript, uint charId);
 
 	void processInput(TTNamedScript *npcScript, TTRoomScript *roomScript,
 		const TTString &line);
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 6552a5d..9e7fb77 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -44,7 +44,7 @@ CTrueTalkNPC *CTrueTalkManager::_currentNPC;
 
 CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : 
 		_gameManager(owner), _scripts(&_titleEngine), _currentCharId(0),
-		_dialogueFile(nullptr), _dialogueIndex(0) {
+		_dialogueFile(nullptr), _dialogueId(0) {
 }
 
 CTrueTalkManager::~CTrueTalkManager() {
@@ -210,10 +210,10 @@ void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) {
 	loadAssets(npc, charId);
 
 	_currentNPC = npc;
-	_titleEngine._scriptHandler->setup(npcScript, roomScript, charId);
+	_titleEngine._scriptHandler->setup(roomScript, npcScript, charId);
 	_currentNPC = nullptr;
 
-	setDialogue(npcScript, roomScript, view);
+	setDialogue(npc, roomScript, view);
 }
 
 TTNamedScript *CTrueTalkManager::getTalker(const CString &name) const {
@@ -282,7 +282,7 @@ void CTrueTalkManager::loadAssets(CTrueTalkNPC *npc, int charId) {
 
 	if (!detailsMsg._filename.empty()) {
 		_dialogueFile = new CDialogueFile(detailsMsg._filename, 20);
-		_dialogueIndex = detailsMsg._numValue + 1;
+		_dialogueId = detailsMsg._numValue + 1;
 	}
 }
 
@@ -298,13 +298,25 @@ void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CView
 		_currentNPC = nullptr;
 
 		loadAssets(npc, npcScript->charId());
-		setDialogue(npcScript, roomScript, view);
+		setDialogue(npc, roomScript, view);
 	}
 	
 	_currentNPC = nullptr;
 }
 
-void CTrueTalkManager::setDialogue(TTNamedScript *npcScript, TTRoomScript *roomScript, CViewItem *view) {
+void CTrueTalkManager::setDialogue(CTrueTalkNPC *npc, TTRoomScript *roomScript, CViewItem *view) {
+	// Get the dialog text
+	CString dialogStr = readDialogueString();
+	if (dialogStr.empty())
+		return;
+
+	TTTalker *talker = new TTTalker(this, npc);
+	_talkers.push_back(talker);
+
+	bool isParrot = npc->getName() == "parrot";
+
+
+
 	warning("TODO: CTrueTalkManager::setDialogue");
 }
 
@@ -320,7 +332,7 @@ CString CTrueTalkManager::readDialogueString() {
 
 		// Open a text entry from the dialogue file for access
 		DialogueResource *textRes = _dialogueFile->openTextEntry(
-			_titleEngine._indexes[idx] - _dialogueIndex);
+			_titleEngine._indexes[idx] - _dialogueId);
 		if (!textRes)
 			continue;
 
@@ -351,4 +363,47 @@ CString CTrueTalkManager::readDialogueString() {
 	return result;
 }
 
+int CTrueTalkManager::readDialogSound() {
+	_field18 = 0;
+
+	for (uint idx = 0; idx < _titleEngine._indexes.size(); ++idx) {
+		CSoundItem *soundItem = _gameManager->_sound.getTrueTalkSound(
+			_dialogueFile, _titleEngine._indexes[idx] - _dialogueId);
+		if (soundItem) {			
+			_field18 = soundItem->fn1();
+		}
+	}
+
+	return _field18;
+}
+
+void CTrueTalkManager::triggerNPC(CTrueTalkNPC *npc) {
+	CTrueTalkSelfQueueAnimSetMsg queueSetMsg;
+	if (queueSetMsg.execute(npc)) {
+		if (_field18 > 300) {
+			CTrueTalkQueueUpAnimSetMsg upMsg(_field18);
+			upMsg.execute(npc);
+		}
+	} else {
+		CTrueTalkGetAnimSetMsg getAnimMsg;
+		if (_field18 > 300) {
+			do {
+				getAnimMsg.execute(npc);
+				if (!getAnimMsg._endFrame)
+					break;
+
+				npc->playMovie(getAnimMsg._startFrame, getAnimMsg._endFrame, 0);
+				getAnimMsg._endFrame = 0;
+
+				uint numFrames = getAnimMsg._endFrame - getAnimMsg._startFrame;
+				int64 val = (numFrames * 1000) * 0x88888889;
+				uint diff = (val >> (32 + 5)) - 500;
+				_field18 += diff;
+
+				getAnimMsg._index++;
+			} while (_field18 > 0);
+		}
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 3843483..c11c34f 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -34,8 +34,28 @@ namespace Titanic {
 class CGameManager;
 class CTreeItem;
 class CViewItem;
+class CTrueTalkManager;
 class CTrueTalkNPC;
 
+class TTTalker : public ListItem {
+public:
+	CTrueTalkManager *_owner;
+	CTrueTalkNPC *_npc;
+	CString _string1;
+	int _field20;
+	int _field24;
+	int _field28;
+public:
+	TTTalker() : _owner(nullptr), _npc(nullptr),
+		_field20(0), _field24(0), _field28(0) {}
+	TTTalker(CTrueTalkManager *owner, CTrueTalkNPC *npc) :
+		_owner(owner), _npc(npc), _field20(0), _field24(0), _field28(0) {}
+
+};
+
+class TTTalkerList : public List<TTTalker> {
+};
+
 class CTrueTalkManager {
 private:
 	CGameManager *_gameManager;
@@ -43,7 +63,9 @@ private:
 	TTScripts _scripts;
 	int _currentCharId;
 	CDialogueFile *_dialogueFile;
-	int _dialogueIndex;
+	int _dialogueId;
+	int _field18;
+	TTTalkerList _talkers;
 private:
 	/**
 	 * Loads the statics for the class
@@ -80,12 +102,22 @@ private:
 	 */
 	void loadAssets(CTrueTalkNPC *npc, int charId);
 
-	void setDialogue(TTNamedScript *npcScript, TTRoomScript *roomScript, CViewItem *view);
+	void setDialogue(CTrueTalkNPC *npc, TTRoomScript *roomScript, CViewItem *view);
 
 	/**
-	 * Read in a string from the resource
+	 * Read in text from the dialogue file
 	 */
 	CString readDialogueString();
+
+	/**
+	 * Read in the sound from the dialogue file
+	 */
+	int readDialogSound();
+
+	/**
+	 * Triggers animation for the NPC
+	 */
+	void triggerNPC(CTrueTalkNPC *npc);
 public:
 	static int _v1;
 	static int _v2;


Commit: b480a2f53e3a48a0e741f86e59cc141f8325c958
    https://github.com/scummvm/scummvm/commit/b480a2f53e3a48a0e741f86e59cc141f8325c958
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:43-04:00

Commit Message:
TITANIC: Implementing TTTalker

Changed paths:
  A engines/titanic/true_talk/tt_talker.cpp
  A engines/titanic/true_talk/tt_talker.h
    engines/titanic/messages/messages.h
    engines/titanic/module.mk
    engines/titanic/npcs/true_talk_npc.cpp
    engines/titanic/npcs/true_talk_npc.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h



diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 561120d..ad5c4bc 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -345,7 +345,7 @@ MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, uint, index, 0, uint, startFram
 MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, filename, "", int, numValue, 0);
 MESSAGE2(CTrueTalkGetStateValueMsg, int, value1, 0, int, value2, -1000);
 MESSAGE2(CTrueTalkNotifySpeechEndedMsg, int, value1, 0, int, value2, 0);
-MESSAGE3(CTrueTalkNotifySpeechStartedMsg, int, value1, 0, int, value2, 0, int, value, 0);
+MESSAGE3(CTrueTalkNotifySpeechStartedMsg, uint, soundId, 0, uint, dialogueId, 0, int, value, 0);
 MESSAGE1(CTrueTalkQueueUpAnimSetMsg, int, value, 0);
 MESSAGE0(CTrueTalkSelfQueueAnimSetMsg);
 MESSAGE3(CTrueTalkTriggerActionMsg, int, value1, 0, int, value2, 0, int, value3, 0);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index df8f053..aaccb77 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -464,6 +464,7 @@ MODULE_OBJS := \
 	true_talk/tt_named_script.o \
 	true_talk/tt_scripts.o \
 	true_talk/tt_string.o \
+	true_talk/tt_talker.o \
 	true_talk/tt_title_script.o
 
 # This module can be built as a plugin
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index bc562ef..297de59 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -39,7 +39,7 @@ BEGIN_MESSAGE_MAP(CTrueTalkNPC, CCharacter)
 END_MESSAGE_MAP()
 
 CTrueTalkNPC::CTrueTalkNPC() : _assetName("z451.dlg"),
-	_assetNumber(0x11170), _fieldE4(0), _npcFlags(0), _fieldEC(0), _fieldF0(0),
+	_assetNumber(0x11170), _fieldE4(0), _npcFlags(0), _soundId(0), _fieldF0(0),
 	_fieldF4(0), _fieldF8(0), _speechTimerId(0), _field100(0), _field104(0) {
 }
 
@@ -49,7 +49,7 @@ void CTrueTalkNPC::save(SimpleFile *file, int indent) const {
 	file->writeQuotedLine(_assetName, indent);
 	file->writeNumberLine(_fieldE4, indent);
 	file->writeNumberLine(_npcFlags, indent);
-	file->writeNumberLine(_fieldEC, indent);
+	file->writeNumberLine(_soundId, indent);
 	file->writeNumberLine(_fieldF0, indent);
 	file->writeNumberLine(_fieldF4, indent);
 	file->writeNumberLine(_fieldF8, indent);
@@ -66,7 +66,7 @@ void CTrueTalkNPC::load(SimpleFile *file) {
 	_assetName = file->readString();
 	_fieldE4 = file->readNumber();
 	_npcFlags = file->readNumber();
-	_fieldEC = file->readNumber();
+	_soundId = file->readNumber();
 	_fieldF0 = file->readNumber();
 	_fieldF4 = file->readNumber();
 	_fieldF8 = file->readNumber();
@@ -101,14 +101,14 @@ bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMs
 		if (_speechTimerId)
 			stopTimer(_speechTimerId);
 
-		_fieldEC = msg->_value1;
+		_soundId = msg->_soundId;
 		_fieldF0 = g_vm->_events->getTicksCount();
 
 		if (hasActiveMovie() || (_npcFlags & NPCFLAG_2)) {
 			_npcFlags &= ~NPCFLAG_2;
 			stopMovie();
 
-			CNPCPlayTalkingAnimationMsg msg1(_fieldEC, 0, 0);
+			CNPCPlayTalkingAnimationMsg msg1(_soundId, 0, 0);
 			msg1.execute(this);
 
 			if (msg1._value3) {
@@ -124,7 +124,7 @@ bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMs
 bool CTrueTalkNPC::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) {
 	_npcFlags &= ~NPCFLAG_SPEAKING;
 	--_field100;
-	_fieldEC = 0;
+	_soundId = 0;
 
 	if (!(_npcFlags & NPCFLAG_8)) {
 		CNPCPlayTalkingAnimationMsg msg1(0, 2, 0);
@@ -147,7 +147,7 @@ bool CTrueTalkNPC::MovieEndMsg(CMovieEndMsg *msg) {
 	}
 
 	int diff = g_vm->_events->getTicksCount() - _fieldF0;
-	int ticks = MAX((int)_fieldEC - diff, 0);
+	int ticks = MAX((int)_soundId - diff, 0);
 	CNPCPlayTalkingAnimationMsg msg1(ticks, ticks > 1000 ? 2 : 1, 0);
 	msg1.execute(this);
 
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index ad436a5..8277b55 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -25,6 +25,7 @@
 
 #include "titanic/npcs/character.h"
 #include "titanic/messages/messages.h"
+#include "titanic/true_talk/tt_talker.h"
 
 namespace Titanic {
 
@@ -50,7 +51,7 @@ protected:
 	CString _assetName;
 	int _fieldE4;
 	uint _npcFlags;
-	int _fieldEC;
+	uint _soundId;
 	int _fieldF0;
 	int _fieldF4;
 	int _fieldF8;
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index a4e0042..e6b90c1 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -236,9 +236,6 @@ void CPetText::setColor(byte r, byte g, byte b) {
 
 void CPetText::remapColors(uint count, uint *srcColors, uint *destColors) {
 	if (_lineCount >= 0) {
-		int lineNum = 0;
-		int index1 = 0;
-
 		for (int lineNum = 0; lineNum <= _lineCount; ++lineNum) {
 			// Get the rgb values
 			uint r = _array[lineNum]._rgb[1];
@@ -442,7 +439,7 @@ int CPetText::getNPCNum(uint npcId, uint startIndex) {
 			return -1;
 	}
 
-	int size = _lines.size();
+	uint size = _lines.size();
 	if (startIndex < 5 || startIndex >= size)
 		return -1;
 
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 9e7fb77..2f7828b 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -42,6 +42,8 @@ bool CTrueTalkManager::_v10;
 int CTrueTalkManager::_v11[41];
 CTrueTalkNPC *CTrueTalkManager::_currentNPC;
 
+/*------------------------------------------------------------------------*/
+
 CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : 
 		_gameManager(owner), _scripts(&_titleEngine), _currentCharId(0),
 		_dialogueFile(nullptr), _dialogueId(0) {
@@ -306,18 +308,18 @@ void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CView
 
 void CTrueTalkManager::setDialogue(CTrueTalkNPC *npc, TTRoomScript *roomScript, CViewItem *view) {
 	// Get the dialog text
-	CString dialogStr = readDialogueString();
-	if (dialogStr.empty())
+	CString dialogueStr = readDialogueString();
+	if (dialogueStr.empty())
 		return;
 
+	int soundId = readDialogSound();
 	TTTalker *talker = new TTTalker(this, npc);
 	_talkers.push_back(talker);
 
-	bool isParrot = npc->getName() == "parrot";
-
-
-
-	warning("TODO: CTrueTalkManager::setDialogue");
+	bool isParrot = npc->getName().contains("parrot");
+	triggerNPC(npc);
+	setTalker(talker, roomScript, view, isParrot);
+	talker->speechStarted(dialogueStr, _titleEngine._indexes[0], soundId);
 }
 
 #define STRING_BUFFER_SIZE 2048
@@ -406,4 +408,8 @@ void CTrueTalkManager::triggerNPC(CTrueTalkNPC *npc) {
 	}
 }
 
+void CTrueTalkManager::setTalker(TTTalker *talker, TTRoomScript *roomScript, CViewItem *view, bool isParrot) {
+	warning("TODO: CTrueTalkManager::setTalker");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index c11c34f..1f6bf16 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -28,6 +28,7 @@
 #include "titanic/true_talk/dialogue_file.h"
 #include "titanic/true_talk/title_engine.h"
 #include "titanic/true_talk/tt_scripts.h"
+#include "titanic/true_talk/tt_talker.h"
 
 namespace Titanic {
 
@@ -37,25 +38,6 @@ class CViewItem;
 class CTrueTalkManager;
 class CTrueTalkNPC;
 
-class TTTalker : public ListItem {
-public:
-	CTrueTalkManager *_owner;
-	CTrueTalkNPC *_npc;
-	CString _string1;
-	int _field20;
-	int _field24;
-	int _field28;
-public:
-	TTTalker() : _owner(nullptr), _npc(nullptr),
-		_field20(0), _field24(0), _field28(0) {}
-	TTTalker(CTrueTalkManager *owner, CTrueTalkNPC *npc) :
-		_owner(owner), _npc(npc), _field20(0), _field24(0), _field28(0) {}
-
-};
-
-class TTTalkerList : public List<TTTalker> {
-};
-
 class CTrueTalkManager {
 private:
 	CGameManager *_gameManager;
@@ -118,6 +100,8 @@ private:
 	 * Triggers animation for the NPC
 	 */
 	void triggerNPC(CTrueTalkNPC *npc);
+
+	void setTalker(TTTalker *talker, TTRoomScript *roomScript, CViewItem *view, bool isParrot);
 public:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/true_talk/tt_talker.cpp b/engines/titanic/true_talk/tt_talker.cpp
new file mode 100644
index 0000000..3e86fdf
--- /dev/null
+++ b/engines/titanic/true_talk/tt_talker.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_talker.h"
+#include "titanic/messages/messages.h"
+
+namespace Titanic {
+
+void TTTalker::speechStarted(const CString &dialogueStr, uint dialogueId, uint soundId) {
+	_dialogueId = dialogueId;
+
+	CTrueTalkNotifySpeechStartedMsg msg(soundId, dialogueId, 0);
+	msg.execute(_npc, nullptr, MSGFLAG_BREAK_IF_HANDLED);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_talker.h b/engines/titanic/true_talk/tt_talker.h
new file mode 100644
index 0000000..792c84c
--- /dev/null
+++ b/engines/titanic/true_talk/tt_talker.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_TALKER_H
+#define TITANIC_TT_TALKER_H
+
+#include "titanic/core/list.h"
+#include "titanic/npcs/true_talk_npc.h"
+#include "titanic/support/string.h"
+
+namespace Titanic {
+
+class CTrueTalkManager;
+
+class TTTalker : public ListItem {
+public:
+	CTrueTalkManager *_owner;
+	CTrueTalkNPC *_npc;
+	CString _string1;
+	int _dialogueId;
+	int _field24;
+	int _field28;
+public:
+	TTTalker() : _owner(nullptr), _npc(nullptr),
+		_dialogueId(0), _field24(0), _field28(0) {}
+	TTTalker(CTrueTalkManager *owner, CTrueTalkNPC *npc) :
+		_owner(owner), _npc(npc), _dialogueId(0), _field24(0), _field28(0) {}
+
+	void speechStarted(const CString &dialogueStr, uint dialogueId, uint soundId);
+};
+
+class TTTalkerList : public List<TTTalker> {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_TALKER_H */


Commit: babdf0aa036a62e098be2e0aef7082e315afbf62
    https://github.com/scummvm/scummvm/commit/babdf0aa036a62e098be2e0aef7082e315afbf62
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:44-04:00

Commit Message:
TITANIC: Setting up of title engine and title script

Changed paths:
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/title_engine.cpp
    engines/titanic/true_talk/title_engine.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/tt_title_script.cpp
    engines/titanic/true_talk/tt_title_script.h



diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index a46a033..83d1812 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -33,8 +33,11 @@ void CScriptHandler::setup(TTRoomScript *roomScript, TTNamedScript *npcScript, u
 	// TODO
 }
 
-void CScriptHandler::processInput(TTNamedScript *npcScript, TTRoomScript *roomScript,
+void CScriptHandler::processInput(TTRoomScript *roomScript, TTNamedScript *npcScript,
 		const TTString &line) {
+	if (!roomScript || line.empty())
+		return;
+	
 	// TODO
 }
 
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 8d5c78d..1206afe 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -42,7 +42,7 @@ public:
 	 */
 	void setup(TTRoomScript *roomScript, TTNamedScript *npcScript, uint charId);
 
-	void processInput(TTNamedScript *npcScript, TTRoomScript *roomScript,
+	void processInput(TTRoomScript *roomScript, TTNamedScript *npcScript,
 		const TTString &line);
 };
 
diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
index 5b8e8d9..3908ea0 100644
--- a/engines/titanic/true_talk/title_engine.cpp
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -33,10 +33,10 @@ CTitleEngine::~CTitleEngine() {
 }
 
 void CTitleEngine::setup(int val1, int val2) {
-
+	_script = new TTTitleScript();
+	_scriptHandler = new CScriptHandler(this, val1, val2);
 }
 
-
 /*------------------------------------------------------------------------*/
 
 STtitleEngine::STtitleEngine(): CTitleEngine(), _field58(0) {
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index ab541ec..389e376 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -28,6 +28,7 @@
 #include "titanic/support/string.h"
 #include "titanic/true_talk/script_handler.h"
 #include "titanic/true_talk/tt_script_base.h"
+#include "titanic/true_talk/tt_title_script.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 2f7828b..fefa2fa 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -295,7 +295,7 @@ void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CView
 
 	if (npcScript && roomScript) {
 		_currentNPC = npc;
-		_titleEngine._scriptHandler->processInput(npcScript, roomScript,
+		_titleEngine._scriptHandler->processInput(roomScript, npcScript,
 			TTString(msg->_input));
 		_currentNPC = nullptr;
 
diff --git a/engines/titanic/true_talk/tt_title_script.cpp b/engines/titanic/true_talk/tt_title_script.cpp
index 048199a..af784e3 100644
--- a/engines/titanic/true_talk/tt_title_script.cpp
+++ b/engines/titanic/true_talk/tt_title_script.cpp
@@ -24,5 +24,8 @@
 
 namespace Titanic {
 
+TTTitleScript::TTTitleScript() : TTScriptBase(1, "", 0, "", 0, -1, -1, -1, 0),
+		_field50(0), _field5C(-1), _field60(0) {	
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_title_script.h b/engines/titanic/true_talk/tt_title_script.h
index 0c36e83..7876ba8 100644
--- a/engines/titanic/true_talk/tt_title_script.h
+++ b/engines/titanic/true_talk/tt_title_script.h
@@ -24,12 +24,18 @@
 #define TITANIC_TT_TITLE_SCRIPT_H
 
 #include "titanic/true_talk/tt_script_base.h"
+#include "titanic/true_talk/tt_string.h"
 
 namespace Titanic {
 
 class TTTitleScript : public TTScriptBase {
+private:
+	int _field50;
+	TTString _string1;
+	int _field5C;
+	int _field60;
 public:
-
+	TTTitleScript();
 };
 
 } // End of namespace Titanic


Commit: e85b171db811d1dac22c2411299b2ce0da7effeb
    https://github.com/scummvm/scummvm/commit/e85b171db811d1dac22c2411299b2ce0da7effeb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:46-04:00

Commit Message:
TITANIC: Adding CTrueTalkManager support methods

Changed paths:
    engines/titanic/game_manager.cpp
    engines/titanic/messages/messages.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_talker.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index bfd6984..1ce9436 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -100,6 +100,7 @@ void CGameManager::preSave(CProjectItem *project) {
 void CGameManager::postSave() {
 	_timers.postSave();
 	_trueTalkManager.postSave();
+	_sound.postSave();
 }
 
 void CGameManager::initBounds() {
@@ -118,7 +119,7 @@ void CGameManager::update() {
 	updateMovies();
 	frameMessage(getRoom());
 	_timers.update(g_vm->_events->getTicksCount());
-	_trueTalkManager.update1();
+	_trueTalkManager.removeCompleted();
 	_trueTalkManager.update2();
 	CScreenManager::_screenManagerPtr->_mouseCursor->update();
 
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index ad5c4bc..f592434 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -343,12 +343,12 @@ MESSAGE1(CTriggerAutoMusicPlayerMsg, int, value, 0);
 MESSAGE1(CTriggerNPCEvent, int, value, 0);
 MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, uint, index, 0, uint, startFrame, 0, uint, endFrame, 0);
 MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, filename, "", int, numValue, 0);
-MESSAGE2(CTrueTalkGetStateValueMsg, int, value1, 0, int, value2, -1000);
+MESSAGE2(CTrueTalkGetStateValueMsg, int, stateNum, 0, int, stateVal, -1000);
 MESSAGE2(CTrueTalkNotifySpeechEndedMsg, int, value1, 0, int, value2, 0);
 MESSAGE3(CTrueTalkNotifySpeechStartedMsg, uint, soundId, 0, uint, dialogueId, 0, int, value, 0);
 MESSAGE1(CTrueTalkQueueUpAnimSetMsg, int, value, 0);
 MESSAGE0(CTrueTalkSelfQueueAnimSetMsg);
-MESSAGE3(CTrueTalkTriggerActionMsg, int, value1, 0, int, value2, 0, int, value3, 0);
+MESSAGE3(CTrueTalkTriggerActionMsg, int, action, 0, int, param1, 0, int, param2, 0);
 MESSAGE0(CTurnOff);
 MESSAGE0(CTurnOn);
 MESSAGE1(CUse, CCarry *, item, nullptr);
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index fefa2fa..2bbac3b 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -192,11 +192,23 @@ void CTrueTalkManager::saveNPC(SimpleFile *file, int charId) const {
 }
 
 void CTrueTalkManager::preLoad() {
-	warning("TODO: CTrueTalkManager::preLoad");
+	// Delete any previous talkers
+	for (TTTalkerList::iterator i = _talkers.begin(); i != _talkers.end(); ++i)
+		delete *i;
+	_talkers.clear();
 }
 
-void CTrueTalkManager::update1() {
-	//warning("CTrueTalkManager::update1");
+void CTrueTalkManager::removeCompleted() {
+	for (TTTalkerList::iterator i = _talkers.begin(); i != _talkers.end(); ) {
+		TTTalker *talker = *i;
+		
+		if (talker->_done) {
+			i = _talkers.erase(i);
+			delete talker;
+		} else {
+			++i;
+		}
+	}
 }
 
 void CTrueTalkManager::update2() {
@@ -412,4 +424,22 @@ void CTrueTalkManager::setTalker(TTTalker *talker, TTRoomScript *roomScript, CVi
 	warning("TODO: CTrueTalkManager::setTalker");
 }
 
+int CTrueTalkManager::getStateVal(int stateNum) {
+	if (!_currentNPC)
+		return -1000;
+
+	CTrueTalkGetStateValueMsg msg(stateNum, -1000);
+	msg.execute(_currentNPC);
+	return msg._stateVal;
+}
+
+bool CTrueTalkManager::triggerAction(int action, int param) {
+	if (!_currentNPC)
+		return false;
+
+	CTrueTalkTriggerActionMsg msg(action, param, 0);
+	msg.execute(_currentNPC);
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 1f6bf16..a7933be 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -118,6 +118,16 @@ public:
 
 	static void setFlags(int index, int val);
 public:
+	/**
+	 * Get a specified state value from the currently set NPC
+	 */
+	static int getStateVal(int stateNum);
+
+	/**
+	 * Trigger an NPC action
+	 */
+	static bool triggerAction(int action, int param);
+public:
 	CTrueTalkManager(CGameManager *owner);
 	~CTrueTalkManager();
 
@@ -161,7 +171,10 @@ public:
 	 */
 	TTScripts &getScripts() { return _scripts; }
 
-	void update1();
+	/**
+	 * Remove any completed talkers
+	 */
+	void removeCompleted();
 
 	void update2();
 
diff --git a/engines/titanic/true_talk/tt_talker.h b/engines/titanic/true_talk/tt_talker.h
index 792c84c..622bcc6 100644
--- a/engines/titanic/true_talk/tt_talker.h
+++ b/engines/titanic/true_talk/tt_talker.h
@@ -38,12 +38,12 @@ public:
 	CString _string1;
 	int _dialogueId;
 	int _field24;
-	int _field28;
+	int _done;
 public:
 	TTTalker() : _owner(nullptr), _npc(nullptr),
-		_dialogueId(0), _field24(0), _field28(0) {}
+		_dialogueId(0), _field24(0), _done(0) {}
 	TTTalker(CTrueTalkManager *owner, CTrueTalkNPC *npc) :
-		_owner(owner), _npc(npc), _dialogueId(0), _field24(0), _field28(0) {}
+		_owner(owner), _npc(npc), _dialogueId(0), _field24(0), _done(0) {}
 
 	void speechStarted(const CString &dialogueStr, uint dialogueId, uint soundId);
 };


Commit: 0cbd9f5063715a35196c40d0e92a21e73b9f15e2
    https://github.com/scummvm/scummvm/commit/0cbd9f5063715a35196c40d0e92a21e73b9f15e2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:47-04:00

Commit Message:
TITANIC: Changing TTNamed* classes to TTNpc*

Changed paths:
  A engines/titanic/true_talk/tt_npc_script.cpp
  A engines/titanic/true_talk/tt_npc_script.h
  R engines/titanic/true_talk/tt_named_script.cpp
  R engines/titanic/true_talk/tt_named_script.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_scripts.cpp
    engines/titanic/true_talk/tt_scripts.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index aaccb77..a0f0efb 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -461,7 +461,7 @@ MODULE_OBJS := \
 	true_talk/true_talk_manager.o \
 	true_talk/tt_script_base.o \
 	true_talk/tt_room_script.o \
-	true_talk/tt_named_script.o \
+	true_talk/tt_npc_script.o \
 	true_talk/tt_scripts.o \
 	true_talk/tt_string.o \
 	true_talk/tt_talker.o \
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 9b7b277..d2efdcf 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -432,7 +432,7 @@ void CPetConversations::stopNPCTimer() {
 	_petControl->stopPetTimer(1);
 }
 
-TTNamedScript *CPetConversations::getNPCScript(const CString &name) const {
+TTNpcScript *CPetConversations::getNPCScript(const CString &name) const {
 	if (name.empty() || !_petControl)
 		return nullptr;
 	CGameManager *gameManager = _petControl->getGameManager();
@@ -517,13 +517,13 @@ void CPetConversations::copyColors(uint tableNum, uint colors[5]) {
 }
 
 void CPetConversations::updateDial(uint dialNum, const CString &npcName) {
-	TTNamedScript *script = getNPCScript(npcName);
+	TTNpcScript *script = getNPCScript(npcName);
 	uint newLevel = getDialLevel(dialNum, script);
 	npcDialChange(dialNum, _npcLevels[dialNum], newLevel);
 	_npcLevels[dialNum] = newLevel;
 }
 
-uint CPetConversations::getDialLevel(uint dialNum, TTNamedScript *script, int v) {
+uint CPetConversations::getDialLevel(uint dialNum, TTNpcScript *script, int v) {
 	bool flag = v != 0;
 
 	if (!script)
@@ -559,7 +559,7 @@ void CPetConversations::npcDialChange(uint dialNum, int oldLevel, int newLevel)
 }
 
 void CPetConversations::resetDials(const CString &name) {
-	TTNamedScript *script = getNPCScript(name);
+	TTNpcScript *script = getNPCScript(name);
 
 	for (int idx = 0; idx < TOTAL_DIALS; ++idx) {
 		uint oldLevel = _npcLevels[idx];
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 9ddc610..4073360 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -112,7 +112,7 @@ private:
 	/**
 	 * Get the TrueTalk script associated with a given NPC
 	 */
-	TTNamedScript *getNPCScript(const CString &name) const;
+	TTNpcScript *getNPCScript(const CString &name) const;
 
 	/**
 	 * Handle a keypress
@@ -142,7 +142,7 @@ private:
 	/**
 	 * Get a dial level
 	 */
-	uint getDialLevel(uint dialNum, TTNamedScript *script, int v = 1);
+	uint getDialLevel(uint dialNum, TTNpcScript *script, int v = 1);
 
 	/**
 	 * Called when the dial for an NPC is being changed
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 2ea86f0..18886c2 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -23,15 +23,15 @@
 #ifndef TITANIC_BARBOT_SCRIPT_H
 #define TITANIC_BARBOT_SCRIPT_H
 
-#include "titanic/true_talk/tt_named_script.h"
+#include "titanic/true_talk/tt_npc_script.h"
 
 namespace Titanic {
 
-class BarbotScript : public TTNamedScript {
+class BarbotScript : public TTNpcScript {
 public:
 	BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNamedScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+		TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
 	virtual int proc6() const;
 	virtual void proc7(int v1, int v2);
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 52d8a19..2042ca9 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 
 BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2) :
-		TTNamedScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
+		TTNpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
 		_field2D0(0), _field2D4(0), _field2D8(0), _field2DC(0) {
 	CTrueTalkManager::setFlags(25, 0);
 	CTrueTalkManager::setFlags(24, 0);
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index cc71c26..ff9f849 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -23,11 +23,11 @@
 #ifndef TITANIC_BELLBOT_SCRIPT_H
 #define TITANIC_BELLBOT_SCRIPT_H
 
-#include "titanic/true_talk/tt_named_script.h"
+#include "titanic/true_talk/tt_npc_script.h"
 
 namespace Titanic {
 
-class BellbotScript : public TTNamedScript {
+class BellbotScript : public TTNpcScript {
 private:
 	int _array[150];
 	int _field2D0;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index f17c041..5844664 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 
 DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2) :
-		TTNamedScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
+		TTNpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
 	CTrueTalkManager::setFlags(18, 0);
 	CTrueTalkManager::setFlags(19, 0);
 	CTrueTalkManager::setFlags(20, 0);
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index dcab218..d001f56 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -23,11 +23,11 @@
 #ifndef TITANIC_DESKBOT_SCRIPT_H
 #define TITANIC_DESKBOT_SCRIPT_H
 
-#include "titanic/true_talk/tt_named_script.h"
+#include "titanic/true_talk/tt_npc_script.h"
 
 namespace Titanic {
 
-class DeskbotScript : public TTNamedScript {
+class DeskbotScript : public TTNpcScript {
 public:
 	DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 37722d4..b52c802 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -23,17 +23,17 @@
 #ifndef TITANIC_DOORBOT_SCRIPT_H
 #define TITANIC_DOORBOT_SCRIPT_H
 
-#include "titanic/true_talk/tt_named_script.h"
+#include "titanic/true_talk/tt_npc_script.h"
 
 namespace Titanic {
 
-class DoorbotScript : public TTNamedScript {
+class DoorbotScript : public TTNpcScript {
 private:
 	int _array[148];
 public:
 	DoorbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNamedScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+		TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
 	virtual int proc6() const;
 	virtual void proc7(int v1, int v2);
@@ -55,4 +55,4 @@ public:
 
 } // End of namespace Titanic
 
-#endif /* TITANIC_TT_CHARACTER1_H */
+#endif /* TITANIC_DOORBOT_SCRIPT_H */
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 8564bb5..a6c3ed8 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -23,15 +23,15 @@
 #ifndef TITANIC_LIFTBOT_SCRIPT_H
 #define TITANIC_LIFTBOT_SCRIPT_H
 
-#include "titanic/true_talk/tt_named_script.h"
+#include "titanic/true_talk/tt_npc_script.h"
 
 namespace Titanic {
 
-class LiftbotScript : public TTNamedScript {
+class LiftbotScript : public TTNpcScript {
 public:
 	LiftbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNamedScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+		TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
 	virtual int proc6() const;
 	virtual void proc7(int v1, int v2);
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index b88dfc6..47ae96c 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 
 MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
 	const char *charName, int v3, int val2) :
-	TTNamedScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
+	TTNpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
 	CTrueTalkManager::setFlags(9, 1);
 	CTrueTalkManager::setFlags(10, 0);
 	CTrueTalkManager::setFlags(11, 0);
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index a5fbb72..7aaddf9 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -23,11 +23,11 @@
 #ifndef TITANIC_MAITRED_SCRIPT_H
 #define TITANIC_MAITRED_SCRIPT_H
 
-#include "titanic/true_talk/tt_named_script.h"
+#include "titanic/true_talk/tt_npc_script.h"
 
 namespace Titanic {
 
-class MaitreDScript : public TTNamedScript {
+class MaitreDScript : public TTNpcScript {
 public:
 	MaitreDScript(int val1, const char *charClass, int v2,
 			const char *charName, int v3, int val2);
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index ac0b08c..354f306 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -23,15 +23,15 @@
 #ifndef TITANIC_PARROT_SCRIPT_H
 #define TITANIC_PARROT_SCRIPT_H
 
-#include "titanic/true_talk/tt_named_script.h"
+#include "titanic/true_talk/tt_npc_script.h"
 
 namespace Titanic {
 
-class ParrotScript : public TTNamedScript {
+class ParrotScript : public TTNpcScript {
 public:
 	ParrotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNamedScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+		TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
 	virtual int proc6() const;
 	virtual void proc7(int v1, int v2);
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 83d1812..ef5814c 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -29,11 +29,11 @@ namespace Titanic {
 CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) {
 }
 
-void CScriptHandler::setup(TTRoomScript *roomScript, TTNamedScript *npcScript, uint charId) {
+void CScriptHandler::setup(TTRoomScript *roomScript, TTNpcScript *npcScript, uint charId) {
 	// TODO
 }
 
-void CScriptHandler::processInput(TTRoomScript *roomScript, TTNamedScript *npcScript,
+void CScriptHandler::processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
 		const TTString &line) {
 	if (!roomScript || line.empty())
 		return;
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 1206afe..6a1e0dc 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_SCRIPT_HANDLER_H
 #define TITANIC_SCRIPT_HANDLER_H
 
-#include "titanic/true_talk/tt_named_script.h"
+#include "titanic/true_talk/tt_npc_script.h"
 #include "titanic/true_talk/tt_room_script.h"
 #include "titanic/true_talk/tt_string.h"
 
@@ -40,9 +40,9 @@ public:
 	/**
 	 * Set the character and room
 	 */
-	void setup(TTRoomScript *roomScript, TTNamedScript *npcScript, uint charId);
+	void setup(TTRoomScript *roomScript, TTNpcScript *npcScript, uint charId);
 
-	void processInput(TTRoomScript *roomScript, TTNamedScript *npcScript,
+	void processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
 		const TTString &line);
 };
 
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 2131775..0aba07e 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -23,17 +23,17 @@
 #ifndef TITANIC_SUCCUBUS_SCRIPT_H
 #define TITANIC_SUCCUBUS_SCRIPT_H
 
-#include "titanic/true_talk/tt_named_script.h"
+#include "titanic/true_talk/tt_npc_script.h"
 
 namespace Titanic {
 
-class SuccUBusScript : public TTNamedScript {
+class SuccUBusScript : public TTNpcScript {
 private:
 	int _field2D0;
 public:
 	SuccUBusScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNamedScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
+		TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
 		_field2D0(0) {}
 
 	virtual int proc6() const;
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 2bbac3b..d467423 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -177,13 +177,13 @@ void CTrueTalkManager::setFlags(int index, int val) {
 }
 
 void CTrueTalkManager::loadNPC(SimpleFile *file, int charId) {
-	TTNamedScript *script = _scripts.getNamedScript(charId);
+	TTNpcScript *script = _scripts.getNamedScript(charId);
 	if (script)
 		script->load(file);
 }
 
 void CTrueTalkManager::saveNPC(SimpleFile *file, int charId) const {
-	TTNamedScript *script = _scripts.getNamedScript(charId);
+	TTNpcScript *script = _scripts.getNamedScript(charId);
 	if (script) {
 		script->save(file);
 		file->writeNumber(MKTAG_BE('U', 'R', 'A', 'H'));
@@ -216,7 +216,7 @@ void CTrueTalkManager::update2() {
 }
 
 void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) {
-	TTNamedScript *npcScript = getNpcScript(npc);
+	TTNpcScript *npcScript = getNpcScript(npc);
 	TTRoomScript *roomScript = getRoomScript();
 	
 	_titleEngine.reset();
@@ -230,7 +230,7 @@ void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) {
 	setDialogue(npc, roomScript, view);
 }
 
-TTNamedScript *CTrueTalkManager::getTalker(const CString &name) const {
+TTNpcScript *CTrueTalkManager::getTalker(const CString &name) const {
 	if (name.contains("Doorbot"))
 		return _scripts.getNamedScript(104);
 	else if (name.contains("DeskBot"))
@@ -253,9 +253,9 @@ TTNamedScript *CTrueTalkManager::getTalker(const CString &name) const {
 	return nullptr;
 }
 
-TTNamedScript *CTrueTalkManager::getNpcScript(CTrueTalkNPC *npc) const {
+TTNpcScript *CTrueTalkManager::getNpcScript(CTrueTalkNPC *npc) const {
 	CString npcName = npc->getName();
-	TTNamedScript *script = getTalker(npcName);
+	TTNpcScript *script = getTalker(npcName);
 
 	if (!script) {
 		// Fall back on the default NPC script
@@ -301,7 +301,7 @@ void CTrueTalkManager::loadAssets(CTrueTalkNPC *npc, int charId) {
 }
 
 void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CViewItem *view) {
-	TTNamedScript *npcScript = getNpcScript(npc);
+	TTNpcScript *npcScript = getNpcScript(npc);
 	TTRoomScript *roomScript = getRoomScript();
 	_titleEngine.reset();
 
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index a7933be..0712919 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -72,7 +72,7 @@ private:
 	/**
 	 * Gets the script associated with an NPC game object
 	 */
-	TTNamedScript *getNpcScript(CTrueTalkNPC *npc) const;
+	TTNpcScript *getNpcScript(CTrueTalkNPC *npc) const;
 
 	/**
 	 * Gets the script associated with the current room
@@ -186,7 +186,7 @@ public:
 	/**
 	 * Return a TrueTalk talker/script
 	 */
-	TTNamedScript *getTalker(const CString &name) const;
+	TTNpcScript *getTalker(const CString &name) const;
 
 	/**
 	 * Process player's input
diff --git a/engines/titanic/true_talk/tt_named_script.cpp b/engines/titanic/true_talk/tt_named_script.cpp
deleted file mode 100644
index 9d25320..0000000
--- a/engines/titanic/true_talk/tt_named_script.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/textconsole.h"
-#include "titanic/true_talk/tt_named_script.h"
-#include "titanic/true_talk/true_talk_manager.h"
-
-namespace Titanic {
-
-TTNamedScriptBase::TTNamedScriptBase(int charId, const char *charClass, int v2,
-		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTScriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
-		_charId(charId), _field54(0), _val2(val2) {
-}
-
-/*------------------------------------------------------------------------*/
-
-TTNamedScript::TTNamedScript(int charId, const char *charClass, int v2,
-		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNamedScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
-		_subPtr(nullptr), _field60(0), _field64(0), _field68(0),
-		_field6C(0), _field70(0), _field74(0), _field78(0),
-		_field7C(0), _field80(0) {
-	CTrueTalkManager::_v2 = 0;
-	Common::fill(&_array[0], &_array[147], 0);
-
-	if (!CTrueTalkManager::_v10) {
-		Common::fill(&CTrueTalkManager::_v11[0], &CTrueTalkManager::_v11[41], 0);
-		CTrueTalkManager::_v10 = true;
-	}
-
-	resetFlags();
-}
-
-void TTNamedScript::resetFlags() {
-	Common::fill(&_array[26], &_array[146], 0);
-}
-
-void TTNamedScript::randomizeFlags() {
-	warning("TODO");
-}
-
-void TTNamedScript::proc4(int v) {
-	warning("TODO");
-}
-
-int TTNamedScript::proc6() const {
-	return 1;
-}
-
-void TTNamedScript::proc7(int v1, int v2) {
-	warning("TODO");
-}
-
-int TTNamedScript::proc8() const {
-	return 0;
-}
-
-int TTNamedScript::proc9() const {
-	return 2;
-}
-
-int TTNamedScript::proc10() const {
-	return 2;
-}
-
-int TTNamedScript::proc11() const {
-	return 2;
-}
-
-int TTNamedScript::proc12() const {
-	return 1;
-}
-
-bool TTNamedScript::proc13() const {
-	warning("TODO");
-	return true;
-}
-
-void TTNamedScript::proc14(int v) {
-	warning("TODO");
-}
-
-int TTNamedScript::proc15() const {
-	return 0;
-}
-
-bool TTNamedScript::proc16() const {
-	return true;
-}
-
-bool TTNamedScript::proc17() const {
-	return true;
-}
-
-bool TTNamedScript::proc18() const {
-	return true;
-}
-
-void TTNamedScript::proc19(int v) {
-	warning("TODO");
-}
-
-void TTNamedScript::proc20(int v) {
-	warning("TODO");
-}
-
-int TTNamedScript::proc21(int v) {
-	return v;
-}
-
-int TTNamedScript::proc22() const {
-	return 0;
-}
-
-int TTNamedScript::proc23() const {
-	return 0;
-}
-
-int TTNamedScript::proc25() const {
-	return 0;
-}
-
-void TTNamedScript::proc26() {
-}
-
-void TTNamedScript::save(SimpleFile *file) {
-	file->writeNumber(charId());
-	saveBody(file);
-
-	file->writeNumber(4);
-	file->writeNumber(_field70);
-	file->writeNumber(_field74);
-	file->writeNumber(_field78);
-	file->writeNumber(_field7C);
-	
-	file->writeNumber(10);
-	for (int idx = 0; idx < 10; ++idx)
-		file->writeNumber(_array[idx]);
-}
-
-void TTNamedScript::load(SimpleFile *file) {
-	loadBody(file);
-
-	int count = file->readNumber();
-	_field70 = file->readNumber();
-	_field74 = file->readNumber();
-	_field78 = file->readNumber();
-	_field7C = file->readNumber();
-
-	for (int idx = count; idx > 4; --idx)
-		file->readNumber();
-
-	count = file->readNumber();
-	for (int idx = 0; idx < count; ++idx) {
-		int v = file->readNumber();
-		if (idx < 10)
-			_array[idx] = v;
-	}
-}
-
-void TTNamedScript::saveBody(SimpleFile *file) {
-	int v = proc31();
-	file->writeNumber(v);
-
-	if (v > 0 && _subPtr) {
-		warning("TODO");
-	}
-}
-
-void TTNamedScript::loadBody(SimpleFile *file) {
-	int count = file->readNumber();
-	preLoad();
-
-	for (int index = 0; index < count; index += 2) {
-		int v = file->readNumber();
-
-		if (_subPtr) {
-			error("TODO - %d", v);
-		}
-	}
-}
-
-int TTNamedScript::proc31() {
-	warning("TODO");
-	return 0;
-}
-
-void TTNamedScript::proc32() {
-	warning("TODO");
-}
-
-void TTNamedScript::proc33(int v1, int v2) {
-	warning("TODO");
-}
-
-int TTNamedScript::proc34() {
-	warning("TODO");
-	return 0;
-}
-
-int TTNamedScript::getDialLevel(uint dialNum, bool flag) {
-	warning("TODO");
-	return 0;
-}
-
-int TTNamedScript::proc36() const {
-	return 0;
-}
-
-int TTNamedScript::proc37() const {
-	return 0;
-}
-
-void TTNamedScript::preLoad() {
-	if (_subPtr) {
-		error("TODO");
-	}
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_named_script.h b/engines/titanic/true_talk/tt_named_script.h
deleted file mode 100644
index 8174f64..0000000
--- a/engines/titanic/true_talk/tt_named_script.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_TT_NAMED_SCRIPT_H
-#define TITANIC_TT_NAMED_SCRIPT_H
-
-#include "titanic/support/simple_file.h"
-#include "titanic/true_talk/tt_script_base.h"
-
-namespace Titanic {
-
-
-class TTNamedScriptBase : public TTScriptBase {
-protected:
-	int _field54;
-	int _val2;
-public:
-	int _charId;
-public:
-	TTNamedScriptBase(int charId, const char *charClass, int v2,
-		const char *charName, int v3, int val2, int v4,
-		int v5, int v6, int v7);
-
-	virtual int proc6() const = 0;
-	virtual void proc7(int v1, int v2) = 0;
-	virtual int proc8() const = 0;
-	virtual int proc9() const = 0;
-	virtual int proc10() const = 0;
-	virtual int proc11() const = 0;
-	virtual int proc12() const = 0;
-
-	int charId() const { return _charId; }
-};
-
-class TTNamedScript : public TTNamedScriptBase {
-protected:
-	byte *_subPtr;
-	int _field60;
-	int _field64;
-	int _field68;
-	int _field6C;
-	int _field70;
-	int _field74;
-	int _field78;
-	int _field7C;
-	int _field80;
-	int _array[147];
-protected:
-	void resetFlags();
-
-	void randomizeFlags();
-public:
-	TTNamedScript(int charId, const char *charClass, int v2,
-		const char *charName, int v3, int val2, int v4,
-		int v5, int v6, int v7);
-
-	virtual void proc4(int v);
-	virtual int proc6() const;
-	virtual void proc7(int v1, int v2);
-	virtual int proc8() const;
-	virtual int proc9() const;
-	virtual int proc10() const;
-	virtual int proc11() const;
-	virtual int proc12() const;
-	virtual bool proc13() const;
-	virtual void proc14(int v);
-	virtual int proc15() const;
-	virtual bool proc16() const;
-	virtual bool proc17() const;
-	virtual bool proc18() const;
-	virtual void proc19(int v);
-	virtual void proc20(int v);
-	virtual int proc21(int v);
-	virtual int proc22() const;
-	virtual int proc23() const;
-	virtual void proc24() = 0;
-	virtual int proc25() const;
-	virtual void proc26();
-	virtual void save(SimpleFile *file);
-	virtual void load(SimpleFile *file);
-	virtual void saveBody(SimpleFile *file);
-	virtual void loadBody(SimpleFile *file);
-	virtual int proc31();
-	virtual void proc32();
-	virtual void proc33(int v1, int v2);
-	virtual int proc34();
-
-	/**
-	 * Get the NPC's dial level
-	 */
-	virtual int getDialLevel(uint dialNum, bool flag = true);
-
-	virtual int proc36() const;
-	virtual int proc37() const;
-
-	void preLoad();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_TT_CHARACTER1_H */
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
new file mode 100644
index 0000000..dfe8ac0
--- /dev/null
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -0,0 +1,240 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/tt_npc_script.h"
+#include "titanic/true_talk/true_talk_manager.h"
+
+namespace Titanic {
+
+TTNpcScriptBase::TTNpcScriptBase(int charId, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTScriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
+		_charId(charId), _field54(0), _val2(val2) {
+}
+
+/*------------------------------------------------------------------------*/
+
+TTNpcScript::TTNpcScript(int charId, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTNpcScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
+		_subPtr(nullptr), _field60(0), _field64(0), _field68(0),
+		_field6C(0), _field70(0), _field74(0), _field78(0),
+		_field7C(0), _field80(0) {
+	CTrueTalkManager::_v2 = 0;
+	Common::fill(&_array[0], &_array[147], 0);
+
+	if (!CTrueTalkManager::_v10) {
+		Common::fill(&CTrueTalkManager::_v11[0], &CTrueTalkManager::_v11[41], 0);
+		CTrueTalkManager::_v10 = true;
+	}
+
+	resetFlags();
+}
+
+void TTNpcScript::resetFlags() {
+	Common::fill(&_array[26], &_array[146], 0);
+}
+
+void TTNpcScript::randomizeFlags() {
+	warning("TODO");
+}
+
+void TTNpcScript::proc4(int v) {
+	warning("TODO");
+}
+
+int TTNpcScript::proc6() const {
+	return 1;
+}
+
+void TTNpcScript::proc7(int v1, int v2) {
+	warning("TODO");
+}
+
+int TTNpcScript::proc8() const {
+	return 0;
+}
+
+int TTNpcScript::proc9() const {
+	return 2;
+}
+
+int TTNpcScript::proc10() const {
+	return 2;
+}
+
+int TTNpcScript::proc11() const {
+	return 2;
+}
+
+int TTNpcScript::proc12() const {
+	return 1;
+}
+
+bool TTNpcScript::proc13() const {
+	warning("TODO");
+	return true;
+}
+
+void TTNpcScript::proc14(int v) {
+	warning("TODO");
+}
+
+int TTNpcScript::proc15() const {
+	return 0;
+}
+
+bool TTNpcScript::proc16() const {
+	return true;
+}
+
+bool TTNpcScript::proc17() const {
+	return true;
+}
+
+bool TTNpcScript::proc18() const {
+	return true;
+}
+
+void TTNpcScript::proc19(int v) {
+	warning("TODO");
+}
+
+void TTNpcScript::proc20(int v) {
+	warning("TODO");
+}
+
+int TTNpcScript::proc21(int v) {
+	return v;
+}
+
+int TTNpcScript::proc22() const {
+	return 0;
+}
+
+int TTNpcScript::proc23() const {
+	return 0;
+}
+
+int TTNpcScript::proc25() const {
+	return 0;
+}
+
+void TTNpcScript::proc26() {
+}
+
+void TTNpcScript::save(SimpleFile *file) {
+	file->writeNumber(charId());
+	saveBody(file);
+
+	file->writeNumber(4);
+	file->writeNumber(_field70);
+	file->writeNumber(_field74);
+	file->writeNumber(_field78);
+	file->writeNumber(_field7C);
+	
+	file->writeNumber(10);
+	for (int idx = 0; idx < 10; ++idx)
+		file->writeNumber(_array[idx]);
+}
+
+void TTNpcScript::load(SimpleFile *file) {
+	loadBody(file);
+
+	int count = file->readNumber();
+	_field70 = file->readNumber();
+	_field74 = file->readNumber();
+	_field78 = file->readNumber();
+	_field7C = file->readNumber();
+
+	for (int idx = count; idx > 4; --idx)
+		file->readNumber();
+
+	count = file->readNumber();
+	for (int idx = 0; idx < count; ++idx) {
+		int v = file->readNumber();
+		if (idx < 10)
+			_array[idx] = v;
+	}
+}
+
+void TTNpcScript::saveBody(SimpleFile *file) {
+	int v = proc31();
+	file->writeNumber(v);
+
+	if (v > 0 && _subPtr) {
+		warning("TODO");
+	}
+}
+
+void TTNpcScript::loadBody(SimpleFile *file) {
+	int count = file->readNumber();
+	preLoad();
+
+	for (int index = 0; index < count; index += 2) {
+		int v = file->readNumber();
+
+		if (_subPtr) {
+			error("TODO - %d", v);
+		}
+	}
+}
+
+int TTNpcScript::proc31() {
+	warning("TODO");
+	return 0;
+}
+
+void TTNpcScript::proc32() {
+	warning("TODO");
+}
+
+void TTNpcScript::proc33(int v1, int v2) {
+	warning("TODO");
+}
+
+int TTNpcScript::proc34() {
+	warning("TODO");
+	return 0;
+}
+
+int TTNpcScript::getDialLevel(uint dialNum, bool flag) {
+	warning("TODO");
+	return 0;
+}
+
+int TTNpcScript::proc36() const {
+	return 0;
+}
+
+int TTNpcScript::proc37() const {
+	return 0;
+}
+
+void TTNpcScript::preLoad() {
+	if (_subPtr) {
+		error("TODO");
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
new file mode 100644
index 0000000..2f03701
--- /dev/null
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -0,0 +1,120 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_NPC_SCRIPT_H
+#define TITANIC_TT_NPC_SCRIPT_H
+
+#include "titanic/support/simple_file.h"
+#include "titanic/true_talk/tt_script_base.h"
+
+namespace Titanic {
+
+
+class TTNpcScriptBase : public TTScriptBase {
+protected:
+	int _field54;
+	int _val2;
+public:
+	int _charId;
+public:
+	TTNpcScriptBase(int charId, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4,
+		int v5, int v6, int v7);
+
+	virtual int proc6() const = 0;
+	virtual void proc7(int v1, int v2) = 0;
+	virtual int proc8() const = 0;
+	virtual int proc9() const = 0;
+	virtual int proc10() const = 0;
+	virtual int proc11() const = 0;
+	virtual int proc12() const = 0;
+
+	int charId() const { return _charId; }
+};
+
+class TTNpcScript : public TTNpcScriptBase {
+protected:
+	byte *_subPtr;
+	int _field60;
+	int _field64;
+	int _field68;
+	int _field6C;
+	int _field70;
+	int _field74;
+	int _field78;
+	int _field7C;
+	int _field80;
+	int _array[147];
+protected:
+	void resetFlags();
+
+	void randomizeFlags();
+public:
+	TTNpcScript(int charId, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4,
+		int v5, int v6, int v7);
+
+	virtual void proc4(int v);
+	virtual int proc6() const;
+	virtual void proc7(int v1, int v2);
+	virtual int proc8() const;
+	virtual int proc9() const;
+	virtual int proc10() const;
+	virtual int proc11() const;
+	virtual int proc12() const;
+	virtual bool proc13() const;
+	virtual void proc14(int v);
+	virtual int proc15() const;
+	virtual bool proc16() const;
+	virtual bool proc17() const;
+	virtual bool proc18() const;
+	virtual void proc19(int v);
+	virtual void proc20(int v);
+	virtual int proc21(int v);
+	virtual int proc22() const;
+	virtual int proc23() const;
+	virtual void proc24() = 0;
+	virtual int proc25() const;
+	virtual void proc26();
+	virtual void save(SimpleFile *file);
+	virtual void load(SimpleFile *file);
+	virtual void saveBody(SimpleFile *file);
+	virtual void loadBody(SimpleFile *file);
+	virtual int proc31();
+	virtual void proc32();
+	virtual void proc33(int v1, int v2);
+	virtual int proc34();
+
+	/**
+	 * Get the NPC's dial level
+	 */
+	virtual int getDialLevel(uint dialNum, bool flag = true);
+
+	virtual int proc36() const;
+	virtual int proc37() const;
+
+	void preLoad();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_NPC_SCRIPT_H */
diff --git a/engines/titanic/true_talk/tt_scripts.cpp b/engines/titanic/true_talk/tt_scripts.cpp
index 9bfa31a..bfcfabe 100644
--- a/engines/titanic/true_talk/tt_scripts.cpp
+++ b/engines/titanic/true_talk/tt_scripts.cpp
@@ -33,11 +33,11 @@
 
 namespace Titanic {
 	
-TTNamedScript *TTNamedScriptList::findById(int charId) const {
-	for (TTNamedScriptList::const_iterator i = begin(); i != end(); ++i) {
-		const TTNamedScriptListItem *item = *i;
-		if (item->_script->_charId == charId)
-			return item->_script;
+TTNpcScript *TTNpcScriptList::findById(int charId) const {
+	for (TTNpcScriptList::const_iterator i = begin(); i != end(); ++i) {
+		const TTNpcScriptListItem *item = *i;
+		if (item->_npcScript->_charId == charId)
+			return item->_npcScript;
 	}
 
 	return nullptr;
@@ -74,14 +74,14 @@ TTScripts::TTScripts(CTitleEngine *titleEngine) :
 	addScript(new SuccUBusScript(111, "Succubus", 0, "Shorbert", 9, 1, -1, -1, -1, 0), 110);
 }
 
-void TTScripts::addScript(TTNamedScript *script, int scriptId) {
+void TTScripts::addScript(TTNpcScript *script, int scriptId) {
 	script->proc13();
 	
 	// Find the room script this is associated with
 	TTRoomScript *roomScript = getRoomScript(scriptId);
 	assert(roomScript);
 
-	_namedScripts.push_back(new TTNamedScriptListItem(script, roomScript));
+	_namedScripts.push_back(new TTNpcScriptListItem(script, roomScript));
 }
 
 void TTScripts::addScript(TTRoomScript *script) {
@@ -92,7 +92,7 @@ TTRoomScript *TTScripts::getRoomScript(int scriptId) const {
 	return _roomScripts.findById(scriptId);
 }
 
-TTNamedScript *TTScripts::getNamedScript(int charId) const {
+TTNpcScript *TTScripts::getNamedScript(int charId) const {
 	return _namedScripts.findById(charId);
 }
 
diff --git a/engines/titanic/true_talk/tt_scripts.h b/engines/titanic/true_talk/tt_scripts.h
index 00638a0..7ee7263 100644
--- a/engines/titanic/true_talk/tt_scripts.h
+++ b/engines/titanic/true_talk/tt_scripts.h
@@ -24,29 +24,29 @@
 #define TITANIC_TT_SCRIPTS_H
 
 #include "titanic/core/list.h"
-#include "titanic/true_talk/tt_named_script.h"
+#include "titanic/true_talk/tt_npc_script.h"
 #include "titanic/true_talk/tt_room_script.h"
 
 namespace Titanic {
 
 class CTitleEngine;
 
-class TTNamedScriptListItem : public ListItem {
+class TTNpcScriptListItem : public ListItem {
 public:
-	TTNamedScript *_script;
+	TTNpcScript *_npcScript;
 	TTRoomScript *_roomScript;
 public:
-	TTNamedScriptListItem() : _script(nullptr), _roomScript(nullptr) {}
-	TTNamedScriptListItem(TTNamedScript *script, TTRoomScript *roomScript) :
-		_script(script), _roomScript(roomScript) {}
-	virtual ~TTNamedScriptListItem() { delete _script; }
+	TTNpcScriptListItem() : _npcScript(nullptr), _roomScript(nullptr) {}
+	TTNpcScriptListItem(TTNpcScript *script, TTRoomScript *roomScript) :
+		_npcScript(script), _roomScript(roomScript) {}
+	virtual ~TTNpcScriptListItem() { delete _npcScript; }
 };
 
 PTR_LIST_ITEM(TTRoomScript);
 
-class TTNamedScriptList : public List<TTNamedScriptListItem> {
+class TTNpcScriptList : public List<TTNpcScriptListItem> {
 public:
-	TTNamedScript *findById(int charId) const;
+	TTNpcScript *findById(int charId) const;
 };
 
 class TTRoomScriptList : public List<TTRoomScriptListItem> {
@@ -56,7 +56,7 @@ public:
 
 class TTScripts {
 private:
-	TTNamedScriptList _namedScripts;
+	TTNpcScriptList _namedScripts;
 	TTRoomScriptList _roomScripts;
 	CTitleEngine *_titleEngine;
 	int _field24;
@@ -65,7 +65,7 @@ private:
 	/**
 	 * Add a named script to the named scripts list
 	 */
-	void addScript(TTNamedScript *script, int charId);
+	void addScript(TTNpcScript *script, int charId);
 
 	/**
 	 * Add an unnamed script to the unnamed scripts list
@@ -82,7 +82,7 @@ public:
 	/**
 	 * Return a pointer to the specified named character script
 	 */
-	TTNamedScript *getNamedScript(int charId) const;
+	TTNpcScript *getNamedScript(int charId) const;
 };
 
 } // End of namespace Titanic


Commit: bac4ced73d53949408a4b1231c42d75eab8ee44c
    https://github.com/scummvm/scummvm/commit/bac4ced73d53949408a4b1231c42d75eab8ee44c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:48-04:00

Commit Message:
TITANIC: Further renaming of named scripts to npc scripts

Changed paths:
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/tt_scripts.cpp
    engines/titanic/true_talk/tt_scripts.h



diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index d467423..4b1dab0 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -177,13 +177,13 @@ void CTrueTalkManager::setFlags(int index, int val) {
 }
 
 void CTrueTalkManager::loadNPC(SimpleFile *file, int charId) {
-	TTNpcScript *script = _scripts.getNamedScript(charId);
+	TTNpcScript *script = _scripts.getNpcScript(charId);
 	if (script)
 		script->load(file);
 }
 
 void CTrueTalkManager::saveNPC(SimpleFile *file, int charId) const {
-	TTNpcScript *script = _scripts.getNamedScript(charId);
+	TTNpcScript *script = _scripts.getNpcScript(charId);
 	if (script) {
 		script->save(file);
 		file->writeNumber(MKTAG_BE('U', 'R', 'A', 'H'));
@@ -232,23 +232,23 @@ void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) {
 
 TTNpcScript *CTrueTalkManager::getTalker(const CString &name) const {
 	if (name.contains("Doorbot"))
-		return _scripts.getNamedScript(104);
+		return _scripts.getNpcScript(104);
 	else if (name.contains("DeskBot"))
-		return _scripts.getNamedScript(103);
+		return _scripts.getNpcScript(103);
 	else if (name.contains("LiftBot"))
-		return _scripts.getNamedScript(105);
+		return _scripts.getNpcScript(105);
 	else if (name.contains("Parrot"))
-		return _scripts.getNamedScript(107);
+		return _scripts.getNpcScript(107);
 	else if (name.contains("BarBot"))
-		return _scripts.getNamedScript(100);
+		return _scripts.getNpcScript(100);
 	else if (name.contains("ChatterBot"))
-		return _scripts.getNamedScript(102);
+		return _scripts.getNpcScript(102);
 	else if (name.contains("BellBot"))
-		return _scripts.getNamedScript(101);
+		return _scripts.getNpcScript(101);
 	else if (name.contains("MaitreD"))
-		return _scripts.getNamedScript(112);
+		return _scripts.getNpcScript(112);
 	else if (name.contains("Succubus") || name.contains("Sub"))
-		return _scripts.getNamedScript(111);
+		return _scripts.getNpcScript(111);
 
 	return nullptr;
 }
@@ -259,7 +259,7 @@ TTNpcScript *CTrueTalkManager::getNpcScript(CTrueTalkNPC *npc) const {
 
 	if (!script) {
 		// Fall back on the default NPC script
-		script = _scripts.getNamedScript(101);
+		script = _scripts.getNpcScript(101);
 	}
 
 	return script;
diff --git a/engines/titanic/true_talk/tt_scripts.cpp b/engines/titanic/true_talk/tt_scripts.cpp
index bfcfabe..96daf76 100644
--- a/engines/titanic/true_talk/tt_scripts.cpp
+++ b/engines/titanic/true_talk/tt_scripts.cpp
@@ -81,7 +81,7 @@ void TTScripts::addScript(TTNpcScript *script, int scriptId) {
 	TTRoomScript *roomScript = getRoomScript(scriptId);
 	assert(roomScript);
 
-	_namedScripts.push_back(new TTNpcScriptListItem(script, roomScript));
+	_npcScripts.push_back(new TTNpcScriptListItem(script, roomScript));
 }
 
 void TTScripts::addScript(TTRoomScript *script) {
@@ -92,8 +92,8 @@ TTRoomScript *TTScripts::getRoomScript(int scriptId) const {
 	return _roomScripts.findById(scriptId);
 }
 
-TTNpcScript *TTScripts::getNamedScript(int charId) const {
-	return _namedScripts.findById(charId);
+TTNpcScript *TTScripts::getNpcScript(int charId) const {
+	return _npcScripts.findById(charId);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_scripts.h b/engines/titanic/true_talk/tt_scripts.h
index 7ee7263..8dd2e93 100644
--- a/engines/titanic/true_talk/tt_scripts.h
+++ b/engines/titanic/true_talk/tt_scripts.h
@@ -56,7 +56,7 @@ public:
 
 class TTScripts {
 private:
-	TTNpcScriptList _namedScripts;
+	TTNpcScriptList _npcScripts;
 	TTRoomScriptList _roomScripts;
 	CTitleEngine *_titleEngine;
 	int _field24;
@@ -80,9 +80,9 @@ public:
 	TTRoomScript *getRoomScript(int scriptId) const;
 
 	/**
-	 * Return a pointer to the specified named character script
+	 * Return a pointer to the specified character script
 	 */
-	TTNpcScript *getNamedScript(int charId) const;
+	TTNpcScript *getNpcScript(int charId) const;
 };
 
 } // End of namespace Titanic


Commit: f706ef374958923c8936e51bf544a01f51ab2066
    https://github.com/scummvm/scummvm/commit/f706ef374958923c8936e51bf544a01f51ab2066
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:49-04:00

Commit Message:
TITANIC: Fleshing out room item and PetText loading code

Changed paths:
    engines/titanic/core/room_item.cpp
    engines/titanic/core/room_item.h
    engines/titanic/pet_control/pet_text.cpp



diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp
index b1c9aee..6143849 100644
--- a/engines/titanic/core/room_item.cpp
+++ b/engines/titanic/core/room_item.cpp
@@ -78,7 +78,7 @@ void CRoomItem::load(SimpleFile *file) {
 
 		file->readBuffer();
 		_clipList.load(file);
-		loading();
+		postLoad();
 		// Deliberate fall-through
 
 	case 0:
@@ -99,8 +99,14 @@ void CRoomItem::load(SimpleFile *file) {
 	CNamedItem::load(file);
 }
 
-void CRoomItem::loading() {
-	warning("TODO: CRoomItem::loading");
+void CRoomItem::postLoad() {
+	if (!_exitMovieKey.exists().empty())
+		return;
+
+	CString name = _transitionMovieKey.exists();
+	if (name.right(7) == "nav.avi") {
+		_exitMovieKey = CResourceKey(name.left(name.size() - 7) + "exit.avi");
+	}
 }
 
 void CRoomItem::calcNodePosition(const Point &nodePos, double &xVal, double &yVal) const {
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index 519accd..e3ba71c 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -32,6 +32,11 @@
 namespace Titanic {
 
 class CRoomItem : public CNamedItem {
+private:
+	/**
+	 * Handles post-load processing
+	 */
+	void postLoad();
 public:
 	Rect _roomRect;
 	CMovieClipList _clipList;
@@ -39,8 +44,6 @@ public:
 	CResourceKey _transitionMovieKey;
 	CResourceKey _exitMovieKey;
 	double _roomDimensionX, _roomDimensionY;
-
-	void loading();
 public:
 	CLASSDEF
 	CRoomItem();
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index e6b90c1..a8d9ba6 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -80,8 +80,8 @@ void CPetText::setLineColor(uint lineNum, byte r, byte g, byte b) {
 
 void CPetText::load(SimpleFile *file, int param) {
 	if (!param) {
-		int var1 = file->readNumber();
-		int var2 = file->readNumber();
+		uint numLines = file->readNumber();
+		uint charsPerLine = file->readNumber();
 		uint count = file->readNumber();
 		_bounds = file->readRect();
 		_field3C = file->readNumber();
@@ -96,7 +96,9 @@ void CPetText::load(SimpleFile *file, int param) {
 		_hasBorder = file->readNumber() != 0;
 		_scrollTop = file->readNumber();
 
-		warning("TODO: CPetText::load %d,%d", var1, var2);
+		resize(numLines);
+		setMaxCharsPerLine(charsPerLine);
+
 		assert(_array.size() >= count);
 		for (uint idx = 0; idx < count; ++idx) {
 			_array[idx]._line = file->readString();


Commit: 74935b371fa94637f5592e402110c3b41cd0b3c4
    https://github.com/scummvm/scummvm/commit/74935b371fa94637f5592e402110c3b41cd0b3c4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:50-04:00

Commit Message:
TITANIC: Implementing scriptChanged methods

Changed paths:
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_room_script.cpp
    engines/titanic/true_talk/tt_room_script.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 1ce9436..fd2f553 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -107,10 +107,6 @@ void CGameManager::initBounds() {
 	_bounds = Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
 }
 
-void CGameManager::fn2() {
-	warning("TODO");
-}
-
 void CGameManager::playClip(CMovieClip *clip, CRoomItem *oldRoom, CRoomItem *newRoom) {
 	warning("TODO: CGameManager::playClip");
 }
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index e524265..c4e6bc6 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -136,8 +136,6 @@ public:
 	 */
 	void initBounds();
 
-	void fn2();
-
 	/**
 	 * Plays a movie clip
 	 */
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index ef5814c..e902d0c 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -29,8 +29,12 @@ namespace Titanic {
 CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) {
 }
 
-void CScriptHandler::setup(TTRoomScript *roomScript, TTNpcScript *npcScript, uint charId) {
-	// TODO
+int CScriptHandler::scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId) {
+	if (!npcScript || !roomScript) {
+		++_inputCtr;
+		return 5;
+	}
+
 }
 
 void CScriptHandler::processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 6a1e0dc..868a2c3 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -34,13 +34,25 @@ class CTitleEngine;
 class CScriptHandler {
 private:
 	CTitleEngine *_owner;
+	TTScriptBase *_script;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+	int _inputCtr;
+	int _field20;
+	int _field24;
+	int _field28;
+	int _field2C;
+	int _field30;
 public:
 	CScriptHandler(CTitleEngine *owner, int val1, int val2);
 
 	/**
 	 * Set the character and room
 	 */
-	void setup(TTRoomScript *roomScript, TTNpcScript *npcScript, uint charId);
+	int scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId);
 
 	void processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
 		const TTString &line);
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 4b1dab0..0b841ac 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -224,7 +224,7 @@ void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) {
 	loadAssets(npc, charId);
 
 	_currentNPC = npc;
-	_titleEngine._scriptHandler->setup(roomScript, npcScript, charId);
+	_titleEngine._scriptHandler->scriptChanged(roomScript, npcScript, id);
 	_currentNPC = nullptr;
 
 	setDialogue(npc, roomScript, view);
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index dfe8ac0..40a50be 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -79,10 +79,6 @@ int TTNpcScript::proc9() const {
 	return 2;
 }
 
-int TTNpcScript::proc10() const {
-	return 2;
-}
-
 int TTNpcScript::proc11() const {
 	return 2;
 }
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 2f03701..c11dc6d 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -44,7 +44,12 @@ public:
 	virtual void proc7(int v1, int v2) = 0;
 	virtual int proc8() const = 0;
 	virtual int proc9() const = 0;
-	virtual int proc10() const = 0;
+
+	/**
+	 * Called when the script/id changes
+	 */
+	virtual int scriptChanged(TTScriptBase *roomScript, uint id) = 0;
+
 	virtual int proc11() const = 0;
 	virtual int proc12() const = 0;
 
@@ -78,7 +83,14 @@ public:
 	virtual void proc7(int v1, int v2);
 	virtual int proc8() const;
 	virtual int proc9() const;
-	virtual int proc10() const;
+
+	/**
+	 * Called when the script/id changes
+	 */
+	virtual int scriptChanged(TTScriptBase *roomScript, uint id) {
+		return 2;
+	}
+
 	virtual int proc11() const;
 	virtual int proc12() const;
 	virtual bool proc13() const;
diff --git a/engines/titanic/true_talk/tt_room_script.cpp b/engines/titanic/true_talk/tt_room_script.cpp
index 1c37a39..37fba1f 100644
--- a/engines/titanic/true_talk/tt_room_script.cpp
+++ b/engines/titanic/true_talk/tt_room_script.cpp
@@ -53,8 +53,10 @@ void TTRoomScript::proc9() {
 	warning("TODO");
 }
 
-void TTRoomScript::proc10() {
-	warning("TODO");
+int TTRoomScript::scriptChanged(TTScriptBase *npcScript, int id) {
+	if (id == 1)
+		_field54 = 1;
+	return 1;
 }
 
 void TTRoomScript::proc11() {
diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h
index ed17b29..f645709 100644
--- a/engines/titanic/true_talk/tt_room_script.h
+++ b/engines/titanic/true_talk/tt_room_script.h
@@ -38,7 +38,12 @@ public:
 	virtual void proc7() = 0;
 	virtual void proc8() = 0;
 	virtual void proc9() = 0;
-	virtual void proc10() = 0;
+	
+	/**
+	 * Called when the script changes
+	 */
+	virtual int scriptChanged(TTScriptBase *npcScript, int id) = 0;
+	
 	virtual void proc11() = 0;
 };
 
@@ -53,8 +58,20 @@ public:
 	virtual void proc7();
 	virtual void proc8();
 	virtual void proc9();
-	virtual void proc10();
+
+	/**
+	 * Called when the script changes
+	 */
+	virtual int scriptChanged(TTScriptBase *npcScript, int id);
+
 	virtual void proc11();
+
+	/**
+	 * Called with the new script and id
+	 */
+	int notifyScript(TTScriptBase *npcScript, int id) {
+		return scriptChanged(npcScript, id);
+	}
 };
 
 } // End of namespace Titanic


Commit: c4375b134a57e3217d24e146592560f1ba9342d7
    https://github.com/scummvm/scummvm/commit/c4375b134a57e3217d24e146592560f1ba9342d7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:51-04:00

Commit Message:
TITANIC: Beginnings of STVocab class, CScriptHandler constructor

Changed paths:
  A engines/titanic/support/file_reader.cpp
  A engines/titanic/support/file_reader.h
  A engines/titanic/true_talk/st_vocab.cpp
  A engines/titanic/true_talk/st_vocab.h
    engines/titanic/module.mk
    engines/titanic/titanic.h
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/title_engine.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index a0f0efb..d808f77 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -431,6 +431,7 @@ MODULE_OBJS := \
 	star_control/star_control_sub15.o \
 	support/direct_draw.o \
 	support/direct_draw_surface.o \
+	support/file_reader.o \
 	support/files_manager.o \
 	support/font.o \
 	support/image.o \
@@ -458,6 +459,7 @@ MODULE_OBJS := \
 	true_talk/succubus_script.o \
 	true_talk/title_engine.o \
 	true_talk/script_handler.o \
+	true_talk/st_vocab.o \
 	true_talk/true_talk_manager.o \
 	true_talk/tt_script_base.o \
 	true_talk/tt_room_script.o \
diff --git a/engines/titanic/support/file_reader.cpp b/engines/titanic/support/file_reader.cpp
new file mode 100644
index 0000000..c332d99
--- /dev/null
+++ b/engines/titanic/support/file_reader.cpp
@@ -0,0 +1,29 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/file_reader.h"
+
+namespace Titanic {
+
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/file_reader.h b/engines/titanic/support/file_reader.h
new file mode 100644
index 0000000..7e9eb1a
--- /dev/null
+++ b/engines/titanic/support/file_reader.h
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FILE_READER_H
+#define TITANIC_FILE_READER_H
+
+#include "common/file.h"
+
+namespace Titanic {
+
+class CFileReader {
+public:
+	Common::File _file;
+public:
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FILE_READER_H */
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index a5cf0ff..b773bec 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -34,6 +34,7 @@
 #include "titanic/events.h"
 #include "titanic/support/files_manager.h"
 #include "titanic/main_game_window.h"
+#include "titanic/support/file_reader.h"
 #include "titanic/support/movie.h"
 #include "titanic/support/screen_manager.h"
 #include "titanic/support/string.h"
@@ -116,6 +117,7 @@ public:
 	OSScreenManager *_screenManager;
 	CMainGameWindow *_window;
 	Common::RandomSource _randomSource;
+	CFileReader _fileReader;
 	CMovieList _activeMovies;
 	CString _itemNames[TOTAL_ITEMS];
 	CString _itemDescriptions[TOTAL_ITEMS];
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index e902d0c..beb5bee 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -21,12 +21,17 @@
  */
 
 #include "titanic/true_talk/script_handler.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
 /*------------------------------------------------------------------------*/
 
-CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) {
+CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) :
+		_owner(owner), _script(owner->_script), _reader(g_vm->_fileReader),
+		_vocab(val2), _field10(0), _field14(0), _field18(0), _inputCtr(0), 
+		_field20(0), _field24(0), _field28(0), _field2C(0), _field30(0) {
+	
 }
 
 int CScriptHandler::scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId) {
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 868a2c3..fba1e41 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -26,6 +26,8 @@
 #include "titanic/true_talk/tt_npc_script.h"
 #include "titanic/true_talk/tt_room_script.h"
 #include "titanic/true_talk/tt_string.h"
+#include "titanic/true_talk/st_vocab.h"
+#include "titanic/support/file_reader.h"
 
 namespace Titanic {
 
@@ -35,8 +37,8 @@ class CScriptHandler {
 private:
 	CTitleEngine *_owner;
 	TTScriptBase *_script;
-	int _field8;
-	int _fieldC;
+	CFileReader &_reader;
+	STVocab _vocab;
 	int _field10;
 	int _field14;
 	int _field18;
diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
new file mode 100644
index 0000000..ed41a4a
--- /dev/null
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/st_vocab.h"
+
+namespace Titanic {
+
+STVocab::STVocab(int val): _field0(0), _field4(0), _field8(0),
+		_fieldC(0), _field10(0), _field18(val) {
+	_field14 = load("STvocab.txt");
+}
+
+int STVocab::load(const CString &name) {
+	// TODO
+	return 0;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/st_vocab.h b/engines/titanic/true_talk/st_vocab.h
new file mode 100644
index 0000000..2b4ebb8
--- /dev/null
+++ b/engines/titanic/true_talk/st_vocab.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ST_VOCAB_H
+#define TITANIC_ST_VOCAB_H
+
+#include "titanic/support/string.h"
+
+namespace Titanic {
+
+class STVocab {
+private:
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+private:
+	/**
+	 * Load the vocab data
+	 */
+	int load(const CString &name);
+public:
+	STVocab(int val);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ST_VOCAB_H */
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index 389e376..12a02e2 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -33,10 +33,9 @@
 namespace Titanic {
 
 class CTitleEngine {
-protected:
-	TTScriptBase *_script;
 public:
 	CScriptHandler *_scriptHandler;
+	TTScriptBase *_script;
 public:
 	CTitleEngine();
 	~CTitleEngine();


Commit: 71179e376363c1c59b9c7819bfbe89196c7bbc23
    https://github.com/scummvm/scummvm/commit/71179e376363c1c59b9c7819bfbe89196c7bbc23
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:52-04:00

Commit Message:
TITANIC: More script handler setup

Changed paths:
    engines/titanic/support/file_reader.cpp
    engines/titanic/support/file_reader.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_room_script.cpp
    engines/titanic/true_talk/tt_room_script.h
    engines/titanic/true_talk/tt_script_base.h



diff --git a/engines/titanic/support/file_reader.cpp b/engines/titanic/support/file_reader.cpp
index c332d99..308d748 100644
--- a/engines/titanic/support/file_reader.cpp
+++ b/engines/titanic/support/file_reader.cpp
@@ -24,6 +24,10 @@
 
 namespace Titanic {
 
+void CFileReader::reset() {
+	_file.close();
+	_field18 = 0;
+}
 
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/file_reader.h b/engines/titanic/support/file_reader.h
index 7e9eb1a..23ab0a6 100644
--- a/engines/titanic/support/file_reader.h
+++ b/engines/titanic/support/file_reader.h
@@ -30,7 +30,9 @@ namespace Titanic {
 class CFileReader {
 public:
 	Common::File _file;
+	int _field18;
 public:
+	void reset();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index f1d24a0..e70a208 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -53,6 +53,8 @@ TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDe
 	_window = nullptr;
 	_screen = nullptr;
 	_screenManager = nullptr;
+	_scriptHandler = nullptr;
+	_script = nullptr;
 }
 
 TitanicEngine::~TitanicEngine() {
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index b773bec..653ace5 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -38,6 +38,7 @@
 #include "titanic/support/movie.h"
 #include "titanic/support/screen_manager.h"
 #include "titanic/support/string.h"
+#include "titanic/true_talk/tt_script_base.h"
 
 /**
  * This is the namespace of the Titanic engine.
@@ -117,6 +118,8 @@ public:
 	OSScreenManager *_screenManager;
 	CMainGameWindow *_window;
 	Common::RandomSource _randomSource;
+	CScriptHandler *_scriptHandler;
+	TTScriptBase *_script;
 	CFileReader _fileReader;
 	CMovieList _activeMovies;
 	CString _itemNames[TOTAL_ITEMS];
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index beb5bee..bd98aad 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -29,17 +29,26 @@ namespace Titanic {
 
 CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) :
 		_owner(owner), _script(owner->_script), _reader(g_vm->_fileReader),
-		_vocab(val2), _field10(0), _field14(0), _field18(0), _inputCtr(0), 
+		_vocab(val2), _sub1(), _sub2(this), _field10(0), _inputCtr(0), 
 		_field20(0), _field24(0), _field28(0), _field2C(0), _field30(0) {
-	
+	g_vm->_scriptHandler = this;
+	g_vm->_script = _script;
 }
 
-int CScriptHandler::scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId) {
+ScriptChangedResult CScriptHandler::scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId) {
 	if (!npcScript || !roomScript) {
 		++_inputCtr;
-		return 5;
+		return SCR_5;
 	}
 
+	ScriptChangedResult result = roomScript->notifyScript(npcScript, dialogueId);
+	if (result == SCR_1)
+		result = npcScript->notifyScript(roomScript, dialogueId);
+
+	if (result != SCR_3 && result != SCR_4)
+		return result;
+
+	error("TODO: CScriptHandler::scriptChanged");
 }
 
 void CScriptHandler::processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index fba1e41..16dff1b 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -32,6 +32,33 @@
 namespace Titanic {
 
 class CTitleEngine;
+class CScriptHandler;
+
+class CScriptHandlerSub1 {
+public:
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+public:
+	CScriptHandlerSub1() : _field0(0), _field4(0), _field8(0),
+		_fieldC(0), _field10(0) {}
+};
+
+class CScriptHandlerSub2 {
+public:
+	CScriptHandler *_owner;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+public:
+	CScriptHandlerSub2(CScriptHandler *owner) : _owner(owner), _field4(0), _field8(0),
+		_fieldC(0), _field10(0), _field14(0), _field18(0) {}
+};
 
 class CScriptHandler {
 private:
@@ -40,8 +67,8 @@ private:
 	CFileReader &_reader;
 	STVocab _vocab;
 	int _field10;
-	int _field14;
-	int _field18;
+	CScriptHandlerSub1 _sub1;
+	CScriptHandlerSub2 _sub2;
 	int _inputCtr;
 	int _field20;
 	int _field24;
@@ -54,7 +81,7 @@ public:
 	/**
 	 * Set the character and room
 	 */
-	int scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId);
+	ScriptChangedResult scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId);
 
 	void processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
 		const TTString &line);
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index c11dc6d..f3df956 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -48,7 +48,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual int scriptChanged(TTScriptBase *roomScript, uint id) = 0;
+	virtual ScriptChangedResult scriptChanged(TTScriptBase *roomScript, uint id) = 0;
 
 	virtual int proc11() const = 0;
 	virtual int proc12() const = 0;
@@ -87,8 +87,8 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual int scriptChanged(TTScriptBase *roomScript, uint id) {
-		return 2;
+	virtual ScriptChangedResult scriptChanged(TTScriptBase *roomScript, uint id) {
+		return SCR_2;
 	}
 
 	virtual int proc11() const;
@@ -125,6 +125,13 @@ public:
 	virtual int proc37() const;
 
 	void preLoad();
+
+	/**
+	 * Called with the script and id changes
+	 */
+	ScriptChangedResult notifyScript(TTScriptBase *npcScript, int id) {
+		return scriptChanged(npcScript, id);
+	}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_room_script.cpp b/engines/titanic/true_talk/tt_room_script.cpp
index 37fba1f..2ade049 100644
--- a/engines/titanic/true_talk/tt_room_script.cpp
+++ b/engines/titanic/true_talk/tt_room_script.cpp
@@ -53,10 +53,11 @@ void TTRoomScript::proc9() {
 	warning("TODO");
 }
 
-int TTRoomScript::scriptChanged(TTScriptBase *npcScript, int id) {
+ScriptChangedResult TTRoomScript::scriptChanged(TTScriptBase *npcScript, int id) {
 	if (id == 1)
 		_field54 = 1;
-	return 1;
+	
+	return SCR_1;
 }
 
 void TTRoomScript::proc11() {
diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h
index f645709..30133b2 100644
--- a/engines/titanic/true_talk/tt_room_script.h
+++ b/engines/titanic/true_talk/tt_room_script.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Called when the script changes
 	 */
-	virtual int scriptChanged(TTScriptBase *npcScript, int id) = 0;
+	virtual ScriptChangedResult scriptChanged(TTScriptBase *npcScript, int id) = 0;
 	
 	virtual void proc11() = 0;
 };
@@ -62,14 +62,14 @@ public:
 	/**
 	 * Called when the script changes
 	 */
-	virtual int scriptChanged(TTScriptBase *npcScript, int id);
+	virtual ScriptChangedResult scriptChanged(TTScriptBase *npcScript, int id);
 
 	virtual void proc11();
 
 	/**
 	 * Called with the new script and id
 	 */
-	int notifyScript(TTScriptBase *npcScript, int id) {
+	ScriptChangedResult notifyScript(TTScriptBase *npcScript, int id) {
 		return scriptChanged(npcScript, id);
 	}
 };
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index 4021a0b..fe999ab 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -27,6 +27,10 @@
 
 namespace Titanic {
 
+enum ScriptChangedResult {
+	SCR_1 = 1, SCR_2 = 2, SCR_3 = 3, SCR_4 = 4, SCR_5 = 5
+};
+
 class TTScriptBase {
 private:
 	void reset();


Commit: 9ce6391a94db959f3dde54ed3d0153e000aa3d5a
    https://github.com/scummvm/scummvm/commit/9ce6391a94db959f3dde54ed3d0153e000aa3d5a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:53-04:00

Commit Message:
TITANIC: Beginnings of TTWord hierarchy

Changed paths:
  A engines/titanic/true_talk/tt_word.cpp
  A engines/titanic/true_talk/tt_word.h
    engines/titanic/module.mk
    engines/titanic/support/file_reader.cpp
    engines/titanic/support/file_reader.h
    engines/titanic/support/simple_file.cpp
    engines/titanic/support/simple_file.h
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/st_vocab.cpp
    engines/titanic/true_talk/st_vocab.h
    engines/titanic/true_talk/title_engine.cpp
    engines/titanic/true_talk/title_engine.h
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index d808f77..a3d60e7 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -467,7 +467,8 @@ MODULE_OBJS := \
 	true_talk/tt_scripts.o \
 	true_talk/tt_string.o \
 	true_talk/tt_talker.o \
-	true_talk/tt_title_script.o
+	true_talk/tt_title_script.o \
+	true_talk/tt_word.o
 
 # This module can be built as a plugin
 ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN)
diff --git a/engines/titanic/support/file_reader.cpp b/engines/titanic/support/file_reader.cpp
index 308d748..f31d72b 100644
--- a/engines/titanic/support/file_reader.cpp
+++ b/engines/titanic/support/file_reader.cpp
@@ -24,10 +24,13 @@
 
 namespace Titanic {
 
-void CFileReader::reset() {
-	_file.close();
-	_field18 = 0;
+CFileReader::CFileReader() : _owner(nullptr), _field4(0), _field8(0),
+	_fieldC(0), _field10(0), _field14(0), _field18(0) {
 }
 
+void CFileReader::reset(CScriptHandler *owner, int val1, int val2) {
+	_owner = owner;
+	_field18 = val2;
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/file_reader.h b/engines/titanic/support/file_reader.h
index 23ab0a6..7d00ebd 100644
--- a/engines/titanic/support/file_reader.h
+++ b/engines/titanic/support/file_reader.h
@@ -27,12 +27,21 @@
 
 namespace Titanic {
 
+class CScriptHandler;
+
 class CFileReader {
 public:
-	Common::File _file;
+	CScriptHandler *_owner;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
 	int _field18;
 public:
-	void reset();
+	CFileReader();
+
+	void reset(CScriptHandler *owner, int val1, int val2);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp
index 88d74a9..b7f666a 100644
--- a/engines/titanic/support/simple_file.cpp
+++ b/engines/titanic/support/simple_file.cpp
@@ -354,6 +354,29 @@ void SimpleFile::writeClassEnd(int indent) {
 	write("}\n", 2);
 }
 
+bool SimpleFile::scanf(const char *format, ...) {
+	va_list va;
+	va_start(va, format);
+	char c;
+
+	CString formatStr(format);
+	while (!formatStr.empty()) {
+		if (formatStr.hasPrefix(" ")) {
+			formatStr.deleteChar(0);
+			safeRead(&c, 1);
+			
+			if (!Common::isSpace(c))
+				return false;
+		} else if (formatStr.hasPrefix("%d")) {
+			formatStr = CString(formatStr.c_str() + 2);
+			int *param = (int *)va_arg(va, int *);
+			*param = readNumber();
+		}
+	}
+
+	va_end(va);
+}
+
 /*------------------------------------------------------------------------*/
 
 void StdCWadFile::open(const CString &name) {
diff --git a/engines/titanic/support/simple_file.h b/engines/titanic/support/simple_file.h
index 115e380..431df01 100644
--- a/engines/titanic/support/simple_file.h
+++ b/engines/titanic/support/simple_file.h
@@ -122,6 +122,11 @@ public:
 	void readBuffer(char *buffer = nullptr, size_t count = 0);
 
 	/**
+	 * Scan in values from the file
+	 */
+	bool scanf(const char *format, ...);
+
+	/**
 	 * Write a string line
 	 */
 	void writeLine(const CString &str);
@@ -197,6 +202,14 @@ public:
 	 * Write out the ending footer for a class definition
 	 */
 	void writeClassEnd(int indent);
+
+	/**
+	 * Return true if the stream has finished being read
+	 */
+	bool eos() const {
+		assert(_inStream);
+		return _inStream->eos();
+	}
 };
 
 /**
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index bd98aad..09110a3 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -53,10 +53,14 @@ ScriptChangedResult CScriptHandler::scriptChanged(TTRoomScript *roomScript, TTNp
 
 void CScriptHandler::processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
 		const TTString &line) {
-	if (!roomScript || line.empty())
+	if (!roomScript || !line.isValid())
 		return;
 	
 	// TODO
 }
 
+SimpleFile *CScriptHandler::openResource(const CString &name) {
+	return _owner->open(name);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 16dff1b..38da259 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -85,6 +85,11 @@ public:
 
 	void processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
 		const TTString &line);
+
+	/**
+	 * Open a resource for access
+	 */
+	SimpleFile *openResource(const CString &name);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index ed41a4a..b725101 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -20,18 +20,32 @@
  *
  */
 
+#include "common/file.h"
 #include "titanic/true_talk/st_vocab.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
-STVocab::STVocab(int val): _field0(0), _field4(0), _field8(0),
+STVocab::STVocab(int val): _field0(0), _field4(0), _vocab(nullptr),
 		_fieldC(0), _field10(0), _field18(val) {
 	_field14 = load("STvocab.txt");
 }
 
 int STVocab::load(const CString &name) {
-	// TODO
-	return 0;
+	SimpleFile *file = g_vm->_fileReader._owner->openResource(name);
+	int result = 0;
+
+	while (!file->eos()) {
+		int mode = file->readNumber();
+
+		switch (mode) {
+		case 0:
+			break;
+		}
+	}
+
+	delete file;
+	return result;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/st_vocab.h b/engines/titanic/true_talk/st_vocab.h
index 2b4ebb8..090dc74 100644
--- a/engines/titanic/true_talk/st_vocab.h
+++ b/engines/titanic/true_talk/st_vocab.h
@@ -24,6 +24,8 @@
 #define TITANIC_ST_VOCAB_H
 
 #include "titanic/support/string.h"
+#include "titanic/true_talk/tt_string.h"
+#include "titanic/true_talk/tt_word.h"
 
 namespace Titanic {
 
@@ -31,7 +33,7 @@ class STVocab {
 private:
 	int _field0;
 	int _field4;
-	int _field8;
+	TTString *_vocab;
 	int _fieldC;
 	int _field10;
 	int _field14;
diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
index 3908ea0..24cc421 100644
--- a/engines/titanic/true_talk/title_engine.cpp
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -64,14 +64,13 @@ void STtitleEngine::dump(int val1, int val2) {
 	// TODO
 }
 
-void STtitleEngine::open(const CString &name) {
-	_stream = _resources.getResource(Common::WinResourceID("Text"),
-		name);
-}
-
-void STtitleEngine::close() {
-	delete _stream;
-	_stream = nullptr;
+SimpleFile *STtitleEngine::open(const CString &name) {
+	Common::SeekableReadStream *stream = _resources.getResource(
+		Common::WinResourceID("Text"), name);
+	
+	SimpleFile *file = new SimpleFile();
+	file->open(stream);
+	return file;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index 12a02e2..fda35ac 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -32,6 +32,13 @@
 
 namespace Titanic {
 
+class CTitleEngine;
+
+class CTitleStream : public SimpleFile {
+public:
+	CTitleStream() : SimpleFile() {}
+};
+
 class CTitleEngine {
 public:
 	CScriptHandler *_scriptHandler;
@@ -56,12 +63,7 @@ public:
 	/**
 	 * Open a designated file
 	 */
-	virtual void open(const CString &name) = 0;
-
-	/**
-	 * Close the file
-	 */
-	virtual void close() = 0;
+	virtual SimpleFile *open(const CString &name) = 0;
 };
 
 class STtitleEngine : public CTitleEngine {
@@ -96,12 +98,7 @@ public:
 	/**
 	 * Open a designated file
 	 */
-	virtual void open(const CString &name);
-
-	/**
-	 * Close the file
-	 */
-	virtual void close();
+	virtual SimpleFile *open(const CString &name);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index f9ae5d6..ffe6509 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -24,4 +24,42 @@
 
 namespace Titanic {
 
+TTString::TTString() : _status(SS_VALID) {
+	_data = new TTStringData();
+}
+
+TTString::TTString(const char *str) : _status(SS_VALID) {
+	_data = new TTStringData(str);
+}
+
+TTString::TTString(const CString &str) {
+	if (_status != SS_VALID) {
+		_status = SS_5;
+		_data = nullptr;
+	} else {
+		_status = SS_VALID;
+		_data = new TTStringData(str);
+	}
+}
+
+TTString::TTString(TTString &str) {
+	if (_status != SS_VALID) {
+		_status = SS_5;
+		_data = nullptr;
+	} else {
+		_status = SS_VALID;
+		_data = str._data;
+		_data->_referenceCount++;
+	}
+}
+
+TTString::~TTString() {
+	if (--_data->_referenceCount == 0)
+		delete _data;
+}
+
+bool TTString::isValid() const {
+	return _status == SS_VALID;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index d593553..947007f 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -27,18 +27,41 @@
 
 namespace Titanic {
 
-class TTString: public CString {
+class TTStringData {
+private:
+	CString _string;
 public:
-	int _status;
+	int _referenceCount;
 public:
-	TTString() : CString(), _status(0) {}
-	TTString(const char *str) : CString(str), _status(0) {}
-	TTString(const CString &str) : CString(str), _status(0) {}
-	virtual ~TTString() {}
+	TTStringData() : _referenceCount(1) {}
+	TTStringData(const char *str) : _string(str), _referenceCount(1) {}
+	TTStringData(const CString &str) : _string(str), _referenceCount(1) {}
+};
+
+enum TTStringStatus { SS_VALID = 0, SS_5 = 5, SS_7 = 7 };
+
+class TTString {
+private:
+	TTStringData *_data;
+	TTStringStatus _status;
+public:
+	TTString();
+	TTString(const char *str);
+	TTString(const CString &str);
+	TTString(TTString &str);
+	virtual ~TTString();
+
+	/**
+	 * Returns true if the string is valid
+	 */
+	bool isValid() const;
 
-	bool isValid() const { return !_status; }
+	/**
+	 * Get the status of the string
+	 */
+	TTStringStatus getStatus() const { return _status; }
 };
 
 } // End of namespace Titanic
 
-#endif /* TITANIC_TT_OBJ8_H */
+#endif /* TITANIC_TT_STRING_H */
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
new file mode 100644
index 0000000..4405f72
--- /dev/null
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -0,0 +1,75 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_word.h"
+
+namespace Titanic {
+
+TTWord::TTWord(TTString &str, int val1, int val2) : _string(str),
+		_field18(val1), _field1C(val2), _fieldC(0), _field10(0),
+		_field20(0), _field24(0), _field28(0) {
+	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
+}
+
+/*------------------------------------------------------------------------*/
+
+void TTWord::readSyn(SimpleFile *file) {
+}
+
+/*------------------------------------------------------------------------*/
+
+TTWord1::TTWord1(TTString &str, int val1, int val2, int val3) :
+		TTWord(str, val1, val2), _field2C(val3) {
+}
+
+/*------------------------------------------------------------------------*/
+
+TTWord2::TTWord2(TTString &str, int val1, int val2, int val3, int val4) :
+		TTWord1(str, val1, val2, val3), _field30(val4) {
+}
+
+/*------------------------------------------------------------------------*/
+
+TTWord3::TTWord3(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6) :
+		TTWord1(str, val1, val2, val4), _field34(val3), _field30(val5), _field3C(val6),
+		_field38(0) {
+}
+
+/*------------------------------------------------------------------------*/
+
+TTWord4::TTWord4(TTString &str, int val1, int val2, int val3, int val4) :
+		TTWord1(str, val1, val2, val3) {
+	if (val4 >= 0 && val4 <= 9) {
+		_field30 = val4;
+	} else {
+		_field30 = 0;
+		_status = SS_5;
+	}
+}
+
+/*------------------------------------------------------------------------*/
+
+TTWord5::TTWord5(TTString &str, int val1, int val2, int val3, int val4) :
+	TTWord1(str, val1, val2, val3), _field30(val4) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
new file mode 100644
index 0000000..d8b34ed
--- /dev/null
+++ b/engines/titanic/true_talk/tt_word.h
@@ -0,0 +1,88 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_WORD_H
+#define TITANIC_TT_WORD_H
+
+#include "titanic/support/simple_file.h"
+#include "titanic/true_talk/tt_string.h"
+
+namespace Titanic {
+
+class TTWord {
+protected:
+	TTString _string;
+	int _fieldC;
+	int _field10;
+	TTStringStatus _status;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+	int _field28;
+public:
+	TTWord(TTString &str, int val1, int val2);
+
+	void readSyn(SimpleFile *file);
+};
+
+class TTWord1 : public TTWord {
+protected:
+	int _field2C;
+public:
+	TTWord1(TTString &str, int val1, int val2, int val3);
+};
+
+class TTWord2 : public TTWord1 {
+protected:
+	int _field30;
+public:
+	TTWord2(TTString &str, int val1, int val2, int val3, int val4);
+};
+
+class TTWord3 : public TTWord1 {
+protected:
+	int _field30;
+	int _field34;
+	int _field38;
+	int _field3C;
+public:
+	TTWord3(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6);
+};
+
+class TTWord4 : public TTWord1 {
+protected:
+	int _field30;
+public:
+	TTWord4(TTString &str, int val1, int val2, int val3, int val4);
+};
+
+class TTWord5 : public TTWord1 {
+protected:
+	int _field30;
+public:
+	TTWord5(TTString &str, int val1, int val2, int val3, int val4);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_WORD_H */


Commit: bb8f95ba9d08d9e660b22240a59486166011bd0b
    https://github.com/scummvm/scummvm/commit/bb8f95ba9d08d9e660b22240a59486166011bd0b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:55-04:00

Commit Message:
TITANIC: Implementing vocab load

Changed paths:
    engines/titanic/support/simple_file.cpp
    engines/titanic/support/simple_file.h
    engines/titanic/true_talk/st_vocab.cpp
    engines/titanic/true_talk/st_vocab.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp
index b7f666a..18a7586 100644
--- a/engines/titanic/support/simple_file.cpp
+++ b/engines/titanic/support/simple_file.cpp
@@ -78,6 +78,12 @@ size_t SimpleFile::write(const void *src, size_t count) {
 	return _outStream->write(src, count);
 }
 
+byte SimpleFile::readByte() {
+	byte b;
+	safeRead(&b, 1);
+	return b;
+}
+
 CString SimpleFile::readString() {
 	char c;
 	CString result;
@@ -368,13 +374,22 @@ bool SimpleFile::scanf(const char *format, ...) {
 			if (!Common::isSpace(c))
 				return false;
 		} else if (formatStr.hasPrefix("%d")) {
+			// Read in a number
 			formatStr = CString(formatStr.c_str() + 2);
 			int *param = (int *)va_arg(va, int *);
 			*param = readNumber();
+		} else if (formatStr.hasPrefix("%s")) {
+			// Read in text until the next space
+			formatStr = CString(formatStr.c_str() + 2);
+			CString *str = (CString *)va_arg(va, CString *);
+			str->clear();
+			while (!eos() && (c = readByte()) != ' ')
+				*str += c;
 		}
 	}
 
 	va_end(va);
+	return !eos();
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/titanic/support/simple_file.h b/engines/titanic/support/simple_file.h
index 431df01..db453c4 100644
--- a/engines/titanic/support/simple_file.h
+++ b/engines/titanic/support/simple_file.h
@@ -87,6 +87,11 @@ public:
 	virtual size_t write(const void *src, size_t count);
 
 	/**
+	 * Read a byte
+	 */
+	byte readByte();
+
+	/**
 	 * Read a string from the file
 	 */
 	CString readString();
diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index b725101..3850c64 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -26,7 +26,7 @@
 
 namespace Titanic {
 
-STVocab::STVocab(int val): _field0(0), _field4(0), _vocab(nullptr),
+STVocab::STVocab(int val): _field0(0), _field4(0), _word(nullptr),
 		_fieldC(0), _field10(0), _field18(val) {
 	_field14 = load("STvocab.txt");
 }
@@ -34,12 +34,70 @@ STVocab::STVocab(int val): _field0(0), _field4(0), _vocab(nullptr),
 int STVocab::load(const CString &name) {
 	SimpleFile *file = g_vm->_fileReader._owner->openResource(name);
 	int result = 0;
+	int param = -1;
+	int mode = 0;
+	bool skipFlag;
 
-	while (!file->eos()) {
-		int mode = file->readNumber();
+	while (!result && !file->eos()) {
+		skipFlag = false;
+		int param = file->readNumber();
+		TTString space(" ");
 
 		switch (mode) {
-		case 0:
+		case 0: {
+			if (_word)
+				result = _word->readSyn(file);
+			skipFlag = true;
+			break;
+		}
+
+		case 1: {
+			TTWord2 *word = new TTWord2(space, 0, 0, 0, 0);
+			result = word->load(file);
+			_word = word;
+			break;
+		}
+
+		case 2: {
+			TTWord3 *word = new TTWord3(space, 0, 0, 0, 0, 0, 0);
+			result = word->load(file);
+			_word = word;
+			break;
+		}
+
+		case 3:
+		case 9: {
+			TTWord1 *word = new TTWord1(space, 0, 0, 0);
+			result = word->load(file, &mode);
+			_word = word;
+			break;
+		}
+
+		case 4:
+		case 5:
+		case 7: {
+			TTWord *word = new TTWord(space, 0, 0);
+			result = word->load(file, &mode);
+			_word = word;
+			break;
+		}
+
+		case 8: {
+			TTWord4 *word = new TTWord4(space, 0, 0, 0, 0);
+			result = word->load(file);
+			_word = word;
+			break;
+		}
+
+		case 6: {
+			TTWord5 *word = new TTWord5(space, 0, 0, 0, 0);
+			result = word->load(file);
+			_word = word;
+			break;
+		}
+
+		default:
+			result = 4;
 			break;
 		}
 	}
diff --git a/engines/titanic/true_talk/st_vocab.h b/engines/titanic/true_talk/st_vocab.h
index 090dc74..cc25150 100644
--- a/engines/titanic/true_talk/st_vocab.h
+++ b/engines/titanic/true_talk/st_vocab.h
@@ -33,7 +33,7 @@ class STVocab {
 private:
 	int _field0;
 	int _field4;
-	TTString *_vocab;
+	TTWord *_word;
 	int _fieldC;
 	int _field10;
 	int _field14;
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 4405f72..a37b049 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -30,9 +30,13 @@ TTWord::TTWord(TTString &str, int val1, int val2) : _string(str),
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
 }
 
-/*------------------------------------------------------------------------*/
+int TTWord::readSyn(SimpleFile *file) {
+	return 0;
+}
 
-void TTWord::readSyn(SimpleFile *file) {
+int TTWord::load(SimpleFile *file, int *mode) {
+	// TODO
+	return 0;
 }
 
 /*------------------------------------------------------------------------*/
@@ -47,6 +51,11 @@ TTWord2::TTWord2(TTString &str, int val1, int val2, int val3, int val4) :
 		TTWord1(str, val1, val2, val3), _field30(val4) {
 }
 
+int TTWord2::load(SimpleFile *file) {
+	// TODO
+	return 0;
+}
+
 /*------------------------------------------------------------------------*/
 
 TTWord3::TTWord3(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6) :
@@ -54,6 +63,11 @@ TTWord3::TTWord3(TTString &str, int val1, int val2, int val3, int val4, int val5
 		_field38(0) {
 }
 
+int TTWord3::load(SimpleFile *file) {
+	// TODO
+	return 0;
+}
+
 /*------------------------------------------------------------------------*/
 
 TTWord4::TTWord4(TTString &str, int val1, int val2, int val3, int val4) :
@@ -66,10 +80,20 @@ TTWord4::TTWord4(TTString &str, int val1, int val2, int val3, int val4) :
 	}
 }
 
+int TTWord4::load(SimpleFile *file) {
+	// TODO
+	return 0;
+}
+
 /*------------------------------------------------------------------------*/
 
 TTWord5::TTWord5(TTString &str, int val1, int val2, int val3, int val4) :
 	TTWord1(str, val1, val2, val3), _field30(val4) {
 }
 
+int TTWord5::load(SimpleFile *file) {
+	// TODO
+	return 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index d8b34ed..1a8b736 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -42,7 +42,12 @@ protected:
 public:
 	TTWord(TTString &str, int val1, int val2);
 
-	void readSyn(SimpleFile *file);
+	int readSyn(SimpleFile *file);
+
+	/**
+	 * Load the word
+	 */
+	int load(SimpleFile *file, int *mode);
 };
 
 class TTWord1 : public TTWord {
@@ -57,6 +62,11 @@ protected:
 	int _field30;
 public:
 	TTWord2(TTString &str, int val1, int val2, int val3, int val4);
+
+	/**
+	 * Load the word
+	 */
+	int load(SimpleFile *file);
 };
 
 class TTWord3 : public TTWord1 {
@@ -67,6 +77,11 @@ protected:
 	int _field3C;
 public:
 	TTWord3(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6);
+
+	/**
+	 * Load the word
+	 */
+	int load(SimpleFile *file);
 };
 
 class TTWord4 : public TTWord1 {
@@ -74,6 +89,11 @@ protected:
 	int _field30;
 public:
 	TTWord4(TTString &str, int val1, int val2, int val3, int val4);
+
+	/**
+	 * Load the word
+	 */
+	int load(SimpleFile *file);
 };
 
 class TTWord5 : public TTWord1 {
@@ -81,6 +101,11 @@ protected:
 	int _field30;
 public:
 	TTWord5(TTString &str, int val1, int val2, int val3, int val4);
+
+	/**
+	 * Load the word
+	 */
+	int load(SimpleFile *file);
 };
 
 } // End of namespace Titanic


Commit: 88dcfebebc183a11729e8dca8768e3a9251533eb
    https://github.com/scummvm/scummvm/commit/88dcfebebc183a11729e8dca8768e3a9251533eb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:56-04:00

Commit Message:
TITANIC: Implementing vocab word loading

Changed paths:
    engines/titanic/true_talk/st_vocab.cpp
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index 3850c64..578ffe5 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -68,7 +68,7 @@ int STVocab::load(const CString &name) {
 		case 3:
 		case 9: {
 			TTWord1 *word = new TTWord1(space, 0, 0, 0);
-			result = word->load(file, &mode);
+			result = word->load(file, mode);
 			_word = word;
 			break;
 		}
@@ -77,7 +77,7 @@ int STVocab::load(const CString &name) {
 		case 5:
 		case 7: {
 			TTWord *word = new TTWord(space, 0, 0);
-			result = word->load(file, &mode);
+			result = word->load(file, mode);
 			_word = word;
 			break;
 		}
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 947007f..bc7278c 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -27,12 +27,10 @@
 
 namespace Titanic {
 
-class TTStringData {
-private:
+struct TTStringData {
 	CString _string;
-public:
 	int _referenceCount;
-public:
+
 	TTStringData() : _referenceCount(1) {}
 	TTStringData(const char *str) : _string(str), _referenceCount(1) {}
 	TTStringData(const CString &str) : _string(str), _referenceCount(1) {}
@@ -60,6 +58,8 @@ public:
 	 * Get the status of the string
 	 */
 	TTStringStatus getStatus() const { return _status; }
+
+	operator const char *() const { return _data->_string.c_str(); }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index a37b049..0bc3611 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -24,8 +24,8 @@
 
 namespace Titanic {
 
-TTWord::TTWord(TTString &str, int val1, int val2) : _string(str),
-		_field18(val1), _field1C(val2), _fieldC(0), _field10(0),
+TTWord::TTWord(TTString &str, int mode, int val2) : _string(str),
+		_wordMode(mode), _field1C(val2), _fieldC(0), _field10(0),
 		_field20(0), _field24(0), _field28(0) {
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
 }
@@ -34,9 +34,32 @@ int TTWord::readSyn(SimpleFile *file) {
 	return 0;
 }
 
-int TTWord::load(SimpleFile *file, int *mode) {
-	// TODO
-	return 0;
+int TTWord::load(SimpleFile *file, int mode) {
+	CString str1, str2;
+	int val;
+
+	if (file->scanf("%d %s %s", &val, &str1, &str2)) {
+		_string = TTString(str1);
+		_field1C = val;
+		_field20 = readNumber(str2.c_str());
+		_wordMode = mode;
+		return 0;
+	} else {
+		return 3;
+	}
+}
+
+uint TTWord::readNumber(const char *str) {
+	uint numValue = *str;
+	if (*str == '0') {
+		numValue = MKTAG('Z', 'Z', 'Z', '[');
+	} else {
+		++str;
+		for (int idx = 0; idx < 3; ++idx, ++str)
+			numValue = (numValue << 8) + *str;
+	}
+
+	return numValue;
 }
 
 /*------------------------------------------------------------------------*/
@@ -52,8 +75,14 @@ TTWord2::TTWord2(TTString &str, int val1, int val2, int val3, int val4) :
 }
 
 int TTWord2::load(SimpleFile *file) {
-	// TODO
-	return 0;
+	int val;
+
+	if (TTWord::load(file, 1) && file->scanf("%d", &val)) {
+		_field30 = val;
+		return 0;
+	} else {
+		return 8;
+	}
 }
 
 /*------------------------------------------------------------------------*/
@@ -81,8 +110,14 @@ TTWord4::TTWord4(TTString &str, int val1, int val2, int val3, int val4) :
 }
 
 int TTWord4::load(SimpleFile *file) {
-	// TODO
-	return 0;
+	int val;
+
+	if (TTWord::load(file, 1) && file->scanf("%d", &val)) {
+		_field30 = val;
+		return 0;
+	} else {
+		return 8;
+	}
 }
 
 /*------------------------------------------------------------------------*/
@@ -92,8 +127,18 @@ TTWord5::TTWord5(TTString &str, int val1, int val2, int val3, int val4) :
 }
 
 int TTWord5::load(SimpleFile *file) {
-	// TODO
-	return 0;
+	int val;
+
+	if (TTWord::load(file, 1) && file->scanf("%d", &val)) {
+		if (val >= 0 && val <= 12) {
+			_field30 = val;
+			return 0;
+		} else {
+			return 5;
+		}
+	} else {
+		return 8;
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 1a8b736..7018d6e 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -34,20 +34,25 @@ protected:
 	int _fieldC;
 	int _field10;
 	TTStringStatus _status;
-	int _field18;
+	int _wordMode;
 	int _field1C;
 	int _field20;
 	int _field24;
 	int _field28;
+protected:
+	/**
+	 * Read in a number
+	 */
+	uint readNumber(const char *str);
 public:
-	TTWord(TTString &str, int val1, int val2);
+	TTWord(TTString &str, int mode, int val2);
 
 	int readSyn(SimpleFile *file);
 
 	/**
 	 * Load the word
 	 */
-	int load(SimpleFile *file, int *mode);
+	int load(SimpleFile *file, int mode);
 };
 
 class TTWord1 : public TTWord {


Commit: b7e4ed8744c815b687ce0e4b89df2d204dd28a2a
    https://github.com/scummvm/scummvm/commit/b7e4ed8744c815b687ce0e4b89df2d204dd28a2a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:57-04:00

Commit Message:
TITANIC: Further fleshing out of vocab loading

Changed paths:
    engines/titanic/true_talk/st_vocab.cpp
    engines/titanic/true_talk/tt_word.cpp



diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index 578ffe5..2a3beff 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -34,13 +34,11 @@ STVocab::STVocab(int val): _field0(0), _field4(0), _word(nullptr),
 int STVocab::load(const CString &name) {
 	SimpleFile *file = g_vm->_fileReader._owner->openResource(name);
 	int result = 0;
-	int param = -1;
-	int mode = 0;
 	bool skipFlag;
 
 	while (!result && !file->eos()) {
 		skipFlag = false;
-		int param = file->readNumber();
+		int mode = file->readNumber();
 		TTString space(" ");
 
 		switch (mode) {
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 0bc3611..3d0aae5 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -93,8 +93,17 @@ TTWord3::TTWord3(TTString &str, int val1, int val2, int val3, int val4, int val5
 }
 
 int TTWord3::load(SimpleFile *file) {
-	// TODO
-	return 0;
+	CString str;
+	int val1, val2;
+
+	if (!TTWord::load(file, 2) && file->scanf("%d %d %d", &str, &val1, &val2)) {
+		_field34 = readNumber(str.c_str());
+		_field30 = val1;
+		_field3C = val2;
+		return 0;
+	} else {
+		return 3;
+	}
 }
 
 /*------------------------------------------------------------------------*/


Commit: 45f84a9da592fbc76156801c634d60615ace67a2
    https://github.com/scummvm/scummvm/commit/45f84a9da592fbc76156801c634d60615ace67a2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:58-04:00

Commit Message:
TITANIC: Fix script handler initialization

Changed paths:
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/true_talk_manager.cpp



diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 09110a3..67ce8be 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -29,10 +29,16 @@ namespace Titanic {
 
 CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) :
 		_owner(owner), _script(owner->_script), _reader(g_vm->_fileReader),
-		_vocab(val2), _sub1(), _sub2(this), _field10(0), _inputCtr(0), 
+		_sub1(), _sub2(this), _field10(0), _inputCtr(0), 
 		_field20(0), _field24(0), _field28(0), _field2C(0), _field30(0) {
 	g_vm->_scriptHandler = this;
 	g_vm->_script = _script;
+	g_vm->_fileReader.reset(this, val1, val2);
+	_vocab = new STVocab(val2);
+}
+
+CScriptHandler::~CScriptHandler() {
+	delete _vocab;
 }
 
 ScriptChangedResult CScriptHandler::scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId) {
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 38da259..58d58d6 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -64,8 +64,8 @@ class CScriptHandler {
 private:
 	CTitleEngine *_owner;
 	TTScriptBase *_script;
+	STVocab *_vocab;
 	CFileReader &_reader;
-	STVocab _vocab;
 	int _field10;
 	CScriptHandlerSub1 _sub1;
 	CScriptHandlerSub2 _sub2;
@@ -77,6 +77,7 @@ private:
 	int _field30;
 public:
 	CScriptHandler(CTitleEngine *owner, int val1, int val2);
+	~CScriptHandler();
 
 	/**
 	 * Set the character and room
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 0b841ac..4892259 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -47,6 +47,8 @@ CTrueTalkNPC *CTrueTalkManager::_currentNPC;
 CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : 
 		_gameManager(owner), _scripts(&_titleEngine), _currentCharId(0),
 		_dialogueFile(nullptr), _dialogueId(0) {
+	_titleEngine.setup(3, 3);
+	_currentNPC = nullptr;
 }
 
 CTrueTalkManager::~CTrueTalkManager() {


Commit: 3822d46341d111ccf29d0dbea4bd7223f546e51b
    https://github.com/scummvm/scummvm/commit/3822d46341d111ccf29d0dbea4bd7223f546e51b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:38:59-04:00

Commit Message:
TITANIC: FIx initializing file reader to read EXE resources

Changed paths:
    engines/titanic/true_talk/st_vocab.cpp
    engines/titanic/true_talk/title_engine.cpp



diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index 2a3beff..ff45dff 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 
 STVocab::STVocab(int val): _field0(0), _field4(0), _word(nullptr),
 		_fieldC(0), _field10(0), _field18(val) {
-	_field14 = load("STvocab.txt");
+	_field14 = load("STVOCAB.TXT");
 }
 
 int STVocab::load(const CString &name) {
diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
index 24cc421..d4462c5 100644
--- a/engines/titanic/true_talk/title_engine.cpp
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -40,6 +40,7 @@ void CTitleEngine::setup(int val1, int val2) {
 /*------------------------------------------------------------------------*/
 
 STtitleEngine::STtitleEngine(): CTitleEngine(), _field58(0) {
+	_resources.loadFromEXE("ST.exe");
 }
 
 STtitleEngine::~STtitleEngine() {
@@ -66,8 +67,9 @@ void STtitleEngine::dump(int val1, int val2) {
 
 SimpleFile *STtitleEngine::open(const CString &name) {
 	Common::SeekableReadStream *stream = _resources.getResource(
-		Common::WinResourceID("Text"), name);
-	
+		Common::WinResourceID("TEXT"), name);
+	assert(stream);
+
 	SimpleFile *file = new SimpleFile();
 	file->open(stream);
 	return file;


Commit: b99fa6ba8c7f4a5407ff59812e5e6023c8a3301c
    https://github.com/scummvm/scummvm/commit/b99fa6ba8c7f4a5407ff59812e5e6023c8a3301c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:00-04:00

Commit Message:
TITANIC: Fix to SimpleFile scanf

Changed paths:
    engines/titanic/support/simple_file.cpp
    engines/titanic/true_talk/tt_string.cpp



diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp
index 18a7586..85f42ae 100644
--- a/engines/titanic/support/simple_file.cpp
+++ b/engines/titanic/support/simple_file.cpp
@@ -368,23 +368,34 @@ bool SimpleFile::scanf(const char *format, ...) {
 	CString formatStr(format);
 	while (!formatStr.empty()) {
 		if (formatStr.hasPrefix(" ")) {
+			// Skip over whitespaces
 			formatStr.deleteChar(0);
-			safeRead(&c, 1);
 			
+			safeRead(&c, 1);			
 			if (!Common::isSpace(c))
 				return false;
+
+			while (Common::isSpace(c))
+				safeRead(&c, 1);
+			_inStream->skip(-1);
 		} else if (formatStr.hasPrefix("%d")) {
 			// Read in a number
 			formatStr = CString(formatStr.c_str() + 2);
 			int *param = (int *)va_arg(va, int *);
 			*param = readNumber();
+			
+			if (!eos())
+				_inStream->skip(-1);
 		} else if (formatStr.hasPrefix("%s")) {
 			// Read in text until the next space
 			formatStr = CString(formatStr.c_str() + 2);
 			CString *str = (CString *)va_arg(va, CString *);
 			str->clear();
-			while (!eos() && (c = readByte()) != ' ')
+			while (!eos() && !Common::isSpace(c = readByte()))
 				*str += c;
+
+			if (!eos())
+				_inStream->skip(-1);
 		}
 	}
 
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index ffe6509..2308afa 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -54,7 +54,7 @@ TTString::TTString(TTString &str) {
 }
 
 TTString::~TTString() {
-	if (--_data->_referenceCount == 0)
+	if (_data && --_data->_referenceCount == 0)
 		delete _data;
 }
 


Commit: 0820c3ffaee211270ab75a14cd1d42047354aa34
    https://github.com/scummvm/scummvm/commit/0820c3ffaee211270ab75a14cd1d42047354aa34
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:01-04:00

Commit Message:
TITANIC: Refactor CTitleEngine to use CFilesManager for PE resources

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/resource_key.cpp
    engines/titanic/game_manager.cpp
    engines/titanic/input_handler.cpp
    engines/titanic/main_game_window.cpp
    engines/titanic/support/files_manager.cpp
    engines/titanic/support/files_manager.h
    engines/titanic/support/font.cpp
    engines/titanic/support/mouse_cursor.cpp
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h
    engines/titanic/true_talk/title_engine.cpp
    engines/titanic/true_talk/title_engine.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index b27b461..5a21487 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -240,7 +240,7 @@ void CGameObject::loadResource(const CString &name) {
 }
 
 void CGameObject::loadMovie(const CString &name, bool pendingFlag) {
-	g_vm->_filesManager.preload(name);
+	g_vm->_filesManager->preload(name);
 
 	// Create the surface if it doesn't already exist
 	if (!_surface) {
@@ -273,7 +273,7 @@ void CGameObject::loadImage(const CString &name, bool pendingFlag) {
 			_surface = nullptr;
 		}
 
-		g_vm->_filesManager.preload(name);
+		g_vm->_filesManager->preload(name);
 
 		if (!name.empty()) {
 			_surface = new OSVideoSurface(screenManager, CResourceKey(name), pendingFlag);
@@ -464,7 +464,7 @@ void CGameObject::sound8(bool flag) const {
 void CGameObject::loadSound(const CString &name) {
 	CGameManager *gameManager = getGameManager();
 	if (gameManager) {
-		g_vm->_filesManager.preload(name);
+		g_vm->_filesManager->preload(name);
 		if (!name.empty())
 			gameManager->_sound.loadSound(name);
 	}
diff --git a/engines/titanic/core/resource_key.cpp b/engines/titanic/core/resource_key.cpp
index 537dd43..a6a0615 100644
--- a/engines/titanic/core/resource_key.cpp
+++ b/engines/titanic/core/resource_key.cpp
@@ -75,7 +75,7 @@ CString CResourceKey::exists() const {
 }
 
 bool CResourceKey::scanForFile() const {
-	return g_vm->_filesManager.scanForFile(_value);
+	return g_vm->_filesManager->scanForFile(_value);
 }
 
 FileType CResourceKey::fileTypeSuffix() const {
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index fd2f553..d0400a4 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -41,7 +41,7 @@ CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
 	_videoSurface1 = nullptr;
 	_videoSurface2 = CScreenManager::_screenManagerPtr->createSurface(600, 340);
 	_project->setGameManager(this);
-	g_vm->_filesManager.setGameManager(this);
+	g_vm->_filesManager->setGameManager(this);
 }
 
 void CGameManager::load(SimpleFile *file) {
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index 3d3541b..289e707 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -53,7 +53,7 @@ void CInputHandler::handleMessage(CMessage &msg, bool respectLock) {
 		if (_gameManager->_gameState._mode == GSMODE_SELECTED) {
 			processMessage(&msg);
 		} else if (!msg.isMouseMsg()) {
-			g_vm->_filesManager.loadDrive();
+			g_vm->_filesManager->loadDrive();
 		}
 	}
 }
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index a524529..73ce375 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -134,7 +134,7 @@ void CMainGameWindow::draw() {
 			break;
 
 		case GSMODE_5:
-			g_vm->_filesManager.debug(scrManager);
+			g_vm->_filesManager->debug(scrManager);
 			break;
 
 		default:
diff --git a/engines/titanic/support/files_manager.cpp b/engines/titanic/support/files_manager.cpp
index 8e70387..eb2f95e 100644
--- a/engines/titanic/support/files_manager.cpp
+++ b/engines/titanic/support/files_manager.cpp
@@ -26,13 +26,12 @@
 
 namespace Titanic {
 
-CFilesManager::CFilesManager() : _gameManager(nullptr), 
-		_assetsPath("Assets"), _exeResources(nullptr), _field0(0),
-		_drive(-1), _field18(0), _field1C(0), _field3C(0) {
+CFilesManager::CFilesManager() : _gameManager(nullptr), _assetsPath("Assets"),
+		_field0(0), _drive(-1), _field18(0), _field1C(0), _field3C(0) {
+	_exeResources.loadFromEXE("st.exe");
 }
 
 CFilesManager::~CFilesManager() {
-	delete _exeResources;
 }
 
 bool CFilesManager::fileExists(const CString &name) {
@@ -94,13 +93,8 @@ void CFilesManager::preload(const CString &name) {
 }
 
 Common::SeekableReadStream *CFilesManager::getResource(
-	Common::WinResourceID area, Common::WinResourceID name) {
-	if (!_exeResources) {
-		_exeResources = new Common::PEResources();
-		_exeResources->loadFromEXE("st.exe");
-	}
-	
-	return _exeResources->getResource(area, name);
+		Common::WinResourceID area, Common::WinResourceID name) {
+	return _exeResources.getResource(area, name);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/files_manager.h b/engines/titanic/support/files_manager.h
index 185670c..6be6a13 100644
--- a/engines/titanic/support/files_manager.h
+++ b/engines/titanic/support/files_manager.h
@@ -37,7 +37,7 @@ class CFilesManagerList : public List<ListItem> {
 class CFilesManager {
 private:
 	CGameManager *_gameManager;
-	Common::PEResources *_exeResources;
+	Common::PEResources _exeResources;
 	CFilesManagerList _list;
 	CString _string1;
 	CString _string2;
diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index cc93bbb..916f020 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -41,7 +41,7 @@ STFont::~STFont() {
 
 void STFont::load(int fontNumber) {
 	assert(!_dataPtr);
-	Common::SeekableReadStream *stream = g_vm->_filesManager.getResource(
+	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource(
 		Common::WinResourceID("STFONT"), fontNumber);
 	if (!stream)
 		error("Could not locate the specified font");
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index 6ddfecf..6ebf4f2 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -63,7 +63,7 @@ CMouseCursor::~CMouseCursor() {
 
 void CMouseCursor::loadCursorImages() {
 	const CString name("ycursors.avi");
-	g_vm->_filesManager.fn4(name);
+	g_vm->_filesManager->fn4(name);
 
 	// WORKAROUND: We need to manipulate ycursors.avi file so it can be read
 	// by the ScummVM AVIDecoder, by removing the redundant second video track
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index e70a208..c2c1f18 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -50,6 +50,7 @@ TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDe
 	g_vm = this;
 	_debugger = nullptr;
 	_events = nullptr;
+	_filesManager = nullptr;
 	_window = nullptr;
 	_screen = nullptr;
 	_screenManager = nullptr;
@@ -63,6 +64,7 @@ TitanicEngine::~TitanicEngine() {
 	delete _screen;
 	delete _window;
 	delete _screenManager;
+	delete _filesManager;
 	CSaveableObject::freeClassList();
 	_activeMovies.clear();
 }
@@ -95,6 +97,7 @@ void TitanicEngine::initialize() {
 
 	_debugger = new Debugger(this);
 	_events = new Events(this);
+	_filesManager = new CFilesManager();
 	_screen = new Graphics::Screen(0, 0);
 	_screenManager = new OSScreenManager(this);
 	_window = new CMainGameWindow(this);
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 653ace5..71e8fcd 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -111,9 +111,9 @@ protected:
 	virtual Common::Error run();
 	virtual bool hasFeature(EngineFeature f) const;
 public:
-	CFilesManager _filesManager;
 	Debugger *_debugger;
 	Events *_events;
+	CFilesManager *_filesManager;
 	Graphics::Screen *_screen;
 	OSScreenManager *_screenManager;
 	CMainGameWindow *_window;
diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
index d4462c5..511ee0a 100644
--- a/engines/titanic/true_talk/title_engine.cpp
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/true_talk/title_engine.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -40,7 +41,6 @@ void CTitleEngine::setup(int val1, int val2) {
 /*------------------------------------------------------------------------*/
 
 STtitleEngine::STtitleEngine(): CTitleEngine(), _field58(0) {
-	_resources.loadFromEXE("ST.exe");
 }
 
 STtitleEngine::~STtitleEngine() {
@@ -66,7 +66,7 @@ void STtitleEngine::dump(int val1, int val2) {
 }
 
 SimpleFile *STtitleEngine::open(const CString &name) {
-	Common::SeekableReadStream *stream = _resources.getResource(
+	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource(
 		Common::WinResourceID("TEXT"), name);
 	assert(stream);
 
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index fda35ac..87491bf 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -68,7 +68,6 @@ public:
 
 class STtitleEngine : public CTitleEngine {
 private:
-	Common::PEResources _resources;
 	Common::SeekableReadStream *_stream;
 	int _field58;
 public:


Commit: 5bb05084fda4e1ce63bd29815ed0676adb1645ed
    https://github.com/scummvm/scummvm/commit/5bb05084fda4e1ce63bd29815ed0676adb1645ed
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:02-04:00

Commit Message:
TITANIC: Fixes for TTString constructors

Changed paths:
    engines/titanic/true_talk/tt_string.cpp



diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index 2308afa..a41f0ce 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -33,17 +33,12 @@ TTString::TTString(const char *str) : _status(SS_VALID) {
 }
 
 TTString::TTString(const CString &str) {
-	if (_status != SS_VALID) {
-		_status = SS_5;
-		_data = nullptr;
-	} else {
-		_status = SS_VALID;
-		_data = new TTStringData(str);
-	}
+	_status = SS_VALID;
+	_data = new TTStringData(str);
 }
 
 TTString::TTString(TTString &str) {
-	if (_status != SS_VALID) {
+	if (str._status != SS_VALID) {
 		_status = SS_5;
 		_data = nullptr;
 	} else {


Commit: 0f96471077d2c5a278fb1594e874e43029afff08
    https://github.com/scummvm/scummvm/commit/0f96471077d2c5a278fb1594e874e43029afff08
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:04-04:00

Commit Message:
TITANIC: Add copy operators for TTString

Changed paths:
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_word.cpp



diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index a41f0ce..189873d 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -53,6 +53,28 @@ TTString::~TTString() {
 		delete _data;
 }
 
+void TTString::operator=(const TTString &str) {
+	// Delete old string reference, if any
+	if (_data && --_data->_referenceCount == 0)
+		delete _data;
+
+	// Copy source string data
+	_status = str._status;
+	_data = str._data;
+	if (_data)
+		_data->_referenceCount++;
+}
+
+void TTString::operator=(const CString &str) {
+	// Delete old string reference, if any
+	if (_data && --_data->_referenceCount == 0)
+		delete _data;
+
+	// Create new string data
+	_data = new TTStringData(str);
+	_status = SS_VALID;
+}
+
 bool TTString::isValid() const {
 	return _status == SS_VALID;
 }
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index bc7278c..250f902 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -49,6 +49,9 @@ public:
 	TTString(TTString &str);
 	virtual ~TTString();
 
+	void operator=(const TTString &str);
+	void operator=(const CString &str);
+
 	/**
 	 * Returns true if the string is valid
 	 */
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 3d0aae5..7d7cb2d 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -39,7 +39,7 @@ int TTWord::load(SimpleFile *file, int mode) {
 	int val;
 
 	if (file->scanf("%d %s %s", &val, &str1, &str2)) {
-		_string = TTString(str1);
+		_string = str1;
 		_field1C = val;
 		_field20 = readNumber(str2.c_str());
 		_wordMode = mode;


Commit: a223309934452ca6652112060aac9bd7272d4ddb
    https://github.com/scummvm/scummvm/commit/a223309934452ca6652112060aac9bd7272d4ddb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:05-04:00

Commit Message:
TITANIC: Changed casing on TTword classes to exactly match original

Changed paths:
    engines/titanic/true_talk/st_vocab.cpp
    engines/titanic/true_talk/st_vocab.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index ff45dff..1b03474 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -50,14 +50,14 @@ int STVocab::load(const CString &name) {
 		}
 
 		case 1: {
-			TTWord2 *word = new TTWord2(space, 0, 0, 0, 0);
+			TTword2 *word = new TTword2(space, 0, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
 		}
 
 		case 2: {
-			TTWord3 *word = new TTWord3(space, 0, 0, 0, 0, 0, 0);
+			TTword3 *word = new TTword3(space, 0, 0, 0, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
@@ -65,7 +65,7 @@ int STVocab::load(const CString &name) {
 
 		case 3:
 		case 9: {
-			TTWord1 *word = new TTWord1(space, 0, 0, 0);
+			TTword1 *word = new TTword1(space, 0, 0, 0);
 			result = word->load(file, mode);
 			_word = word;
 			break;
@@ -74,21 +74,21 @@ int STVocab::load(const CString &name) {
 		case 4:
 		case 5:
 		case 7: {
-			TTWord *word = new TTWord(space, 0, 0);
+			TTword *word = new TTword(space, 0, 0);
 			result = word->load(file, mode);
 			_word = word;
 			break;
 		}
 
 		case 8: {
-			TTWord4 *word = new TTWord4(space, 0, 0, 0, 0);
+			TTword4 *word = new TTword4(space, 0, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
 		}
 
 		case 6: {
-			TTWord5 *word = new TTWord5(space, 0, 0, 0, 0);
+			TTword5 *word = new TTword5(space, 0, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
diff --git a/engines/titanic/true_talk/st_vocab.h b/engines/titanic/true_talk/st_vocab.h
index cc25150..c44c4dd 100644
--- a/engines/titanic/true_talk/st_vocab.h
+++ b/engines/titanic/true_talk/st_vocab.h
@@ -33,7 +33,7 @@ class STVocab {
 private:
 	int _field0;
 	int _field4;
-	TTWord *_word;
+	TTword *_word;
 	int _fieldC;
 	int _field10;
 	int _field14;
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 7d7cb2d..62f924a 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -24,17 +24,17 @@
 
 namespace Titanic {
 
-TTWord::TTWord(TTString &str, int mode, int val2) : _string(str),
+TTword::TTword(TTString &str, int mode, int val2) : _string(str),
 		_wordMode(mode), _field1C(val2), _fieldC(0), _field10(0),
 		_field20(0), _field24(0), _field28(0) {
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
 }
 
-int TTWord::readSyn(SimpleFile *file) {
+int TTword::readSyn(SimpleFile *file) {
 	return 0;
 }
 
-int TTWord::load(SimpleFile *file, int mode) {
+int TTword::load(SimpleFile *file, int mode) {
 	CString str1, str2;
 	int val;
 
@@ -49,7 +49,7 @@ int TTWord::load(SimpleFile *file, int mode) {
 	}
 }
 
-uint TTWord::readNumber(const char *str) {
+uint TTword::readNumber(const char *str) {
 	uint numValue = *str;
 	if (*str == '0') {
 		numValue = MKTAG('Z', 'Z', 'Z', '[');
@@ -64,20 +64,20 @@ uint TTWord::readNumber(const char *str) {
 
 /*------------------------------------------------------------------------*/
 
-TTWord1::TTWord1(TTString &str, int val1, int val2, int val3) :
-		TTWord(str, val1, val2), _field2C(val3) {
+TTword1::TTword1(TTString &str, int val1, int val2, int val3) :
+		TTword(str, val1, val2), _field2C(val3) {
 }
 
 /*------------------------------------------------------------------------*/
 
-TTWord2::TTWord2(TTString &str, int val1, int val2, int val3, int val4) :
-		TTWord1(str, val1, val2, val3), _field30(val4) {
+TTword2::TTword2(TTString &str, int val1, int val2, int val3, int val4) :
+		TTword1(str, val1, val2, val3), _field30(val4) {
 }
 
-int TTWord2::load(SimpleFile *file) {
+int TTword2::load(SimpleFile *file) {
 	int val;
 
-	if (TTWord::load(file, 1) && file->scanf("%d", &val)) {
+	if (TTword::load(file, 1) && file->scanf("%d", &val)) {
 		_field30 = val;
 		return 0;
 	} else {
@@ -87,16 +87,16 @@ int TTWord2::load(SimpleFile *file) {
 
 /*------------------------------------------------------------------------*/
 
-TTWord3::TTWord3(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6) :
-		TTWord1(str, val1, val2, val4), _field34(val3), _field30(val5), _field3C(val6),
+TTword3::TTword3(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6) :
+		TTword1(str, val1, val2, val4), _field34(val3), _field30(val5), _field3C(val6),
 		_field38(0) {
 }
 
-int TTWord3::load(SimpleFile *file) {
+int TTword3::load(SimpleFile *file) {
 	CString str;
 	int val1, val2;
 
-	if (!TTWord::load(file, 2) && file->scanf("%d %d %d", &str, &val1, &val2)) {
+	if (!TTword::load(file, 2) && file->scanf("%d %d %d", &str, &val1, &val2)) {
 		_field34 = readNumber(str.c_str());
 		_field30 = val1;
 		_field3C = val2;
@@ -108,8 +108,8 @@ int TTWord3::load(SimpleFile *file) {
 
 /*------------------------------------------------------------------------*/
 
-TTWord4::TTWord4(TTString &str, int val1, int val2, int val3, int val4) :
-		TTWord1(str, val1, val2, val3) {
+TTword4::TTword4(TTString &str, int val1, int val2, int val3, int val4) :
+		TTword1(str, val1, val2, val3) {
 	if (val4 >= 0 && val4 <= 9) {
 		_field30 = val4;
 	} else {
@@ -118,10 +118,10 @@ TTWord4::TTWord4(TTString &str, int val1, int val2, int val3, int val4) :
 	}
 }
 
-int TTWord4::load(SimpleFile *file) {
+int TTword4::load(SimpleFile *file) {
 	int val;
 
-	if (TTWord::load(file, 1) && file->scanf("%d", &val)) {
+	if (TTword::load(file, 1) && file->scanf("%d", &val)) {
 		_field30 = val;
 		return 0;
 	} else {
@@ -131,14 +131,14 @@ int TTWord4::load(SimpleFile *file) {
 
 /*------------------------------------------------------------------------*/
 
-TTWord5::TTWord5(TTString &str, int val1, int val2, int val3, int val4) :
-	TTWord1(str, val1, val2, val3), _field30(val4) {
+TTword5::TTword5(TTString &str, int val1, int val2, int val3, int val4) :
+	TTword1(str, val1, val2, val3), _field30(val4) {
 }
 
-int TTWord5::load(SimpleFile *file) {
+int TTword5::load(SimpleFile *file) {
 	int val;
 
-	if (TTWord::load(file, 1) && file->scanf("%d", &val)) {
+	if (TTword::load(file, 1) && file->scanf("%d", &val)) {
 		if (val >= 0 && val <= 12) {
 			_field30 = val;
 			return 0;
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 7018d6e..a24099c 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -28,7 +28,7 @@
 
 namespace Titanic {
 
-class TTWord {
+class TTword {
 protected:
 	TTString _string;
 	int _fieldC;
@@ -45,7 +45,7 @@ protected:
 	 */
 	uint readNumber(const char *str);
 public:
-	TTWord(TTString &str, int mode, int val2);
+	TTword(TTString &str, int mode, int val2);
 
 	int readSyn(SimpleFile *file);
 
@@ -55,18 +55,18 @@ public:
 	int load(SimpleFile *file, int mode);
 };
 
-class TTWord1 : public TTWord {
+class TTword1 : public TTword {
 protected:
 	int _field2C;
 public:
-	TTWord1(TTString &str, int val1, int val2, int val3);
+	TTword1(TTString &str, int val1, int val2, int val3);
 };
 
-class TTWord2 : public TTWord1 {
+class TTword2 : public TTword1 {
 protected:
 	int _field30;
 public:
-	TTWord2(TTString &str, int val1, int val2, int val3, int val4);
+	TTword2(TTString &str, int val1, int val2, int val3, int val4);
 
 	/**
 	 * Load the word
@@ -74,14 +74,14 @@ public:
 	int load(SimpleFile *file);
 };
 
-class TTWord3 : public TTWord1 {
+class TTword3 : public TTword1 {
 protected:
 	int _field30;
 	int _field34;
 	int _field38;
 	int _field3C;
 public:
-	TTWord3(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6);
+	TTword3(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6);
 
 	/**
 	 * Load the word
@@ -89,11 +89,11 @@ public:
 	int load(SimpleFile *file);
 };
 
-class TTWord4 : public TTWord1 {
+class TTword4 : public TTword1 {
 protected:
 	int _field30;
 public:
-	TTWord4(TTString &str, int val1, int val2, int val3, int val4);
+	TTword4(TTString &str, int val1, int val2, int val3, int val4);
 
 	/**
 	 * Load the word
@@ -101,11 +101,11 @@ public:
 	int load(SimpleFile *file);
 };
 
-class TTWord5 : public TTWord1 {
+class TTword5 : public TTword1 {
 protected:
 	int _field30;
 public:
-	TTWord5(TTString &str, int val1, int val2, int val3, int val4);
+	TTword5(TTString &str, int val1, int val2, int val3, int val4);
 
 	/**
 	 * Load the word


Commit: 3a464e8770606d75ec7a641eac207b58c95303c1
    https://github.com/scummvm/scummvm/commit/3a464e8770606d75ec7a641eac207b58c95303c1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:06-04:00

Commit Message:
TITANIC: Added new TTstringNode and TTsynonymNode classes

Changed paths:
  A engines/titanic/true_talk/tt_string_node.cpp
  A engines/titanic/true_talk/tt_string_node.h
    engines/titanic/module.mk
    engines/titanic/support/file_reader.h
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index a3d60e7..23354b4 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -466,6 +466,7 @@ MODULE_OBJS := \
 	true_talk/tt_npc_script.o \
 	true_talk/tt_scripts.o \
 	true_talk/tt_string.o \
+	true_talk/tt_string_node.o \
 	true_talk/tt_talker.o \
 	true_talk/tt_title_script.o \
 	true_talk/tt_word.o
diff --git a/engines/titanic/support/file_reader.h b/engines/titanic/support/file_reader.h
index 7d00ebd..42ab43c 100644
--- a/engines/titanic/support/file_reader.h
+++ b/engines/titanic/support/file_reader.h
@@ -42,6 +42,8 @@ public:
 	CFileReader();
 
 	void reset(CScriptHandler *owner, int val1, int val2);
+
+	bool is18Equals(int val) const { return _field18 == val; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index 189873d..78ef822 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -66,6 +66,10 @@ void TTString::operator=(const TTString &str) {
 }
 
 void TTString::operator=(const CString &str) {
+	operator=(str.c_str());
+}
+
+void TTString::operator=(const char *str) {
 	// Delete old string reference, if any
 	if (_data && --_data->_referenceCount == 0)
 		delete _data;
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 250f902..c7c88ff 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -51,6 +51,7 @@ public:
 
 	void operator=(const TTString &str);
 	void operator=(const CString &str);
+	void operator=(const char *str);
 
 	/**
 	 * Returns true if the string is valid
diff --git a/engines/titanic/true_talk/tt_string_node.cpp b/engines/titanic/true_talk/tt_string_node.cpp
new file mode 100644
index 0000000..b1e2a64
--- /dev/null
+++ b/engines/titanic/true_talk/tt_string_node.cpp
@@ -0,0 +1,74 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/tt_string_node.h"
+
+namespace Titanic {
+
+TTstringNode::TTstringNode() : _pPrior(nullptr), _pNext(nullptr),
+		_field14(0), _mode(0), _field1C(0) {
+}
+
+void TTstringNode::initialize(int mode) {
+	_mode = mode;
+	_field14 = 0;
+
+	if (_string.isValid()) {
+		_field1C = 0;
+	} else {
+		_field1C = 11;
+		warning("TTstringNode::initialize has bad subobj");
+	}
+}
+
+void TTstringNode::addNode(TTstringNode *newNode) {
+	TTstringNode *tail = getTail();
+	tail->_pNext = newNode;
+	newNode->_pPrior = this;
+}
+
+TTstringNode *TTstringNode::getTail() const {
+	if (_pNext == nullptr)
+		return nullptr;
+	
+	TTstringNode *node = _pNext;
+	while (node->_pNext)
+		node = node->_pNext;
+
+	return node;
+}
+
+/*------------------------------------------------------------------------*/
+
+TTsynonymNode::TTsynonymNode() : TTstringNode() {
+}
+
+TTsynonymNode::TTsynonymNode(int mode, const char *str, int val2) :
+		TTstringNode() {
+	_string = str;
+	initialize(mode);
+	_field14 = val2;
+}
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string_node.h b/engines/titanic/true_talk/tt_string_node.h
new file mode 100644
index 0000000..e588ea4
--- /dev/null
+++ b/engines/titanic/true_talk/tt_string_node.h
@@ -0,0 +1,65 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_STRING_NODE_H
+#define TITANIC_TT_STRING_NODE_H
+
+#include "titanic/true_talk/tt_string.h"
+
+namespace Titanic {
+
+class TTstringNode {
+private:
+	/**
+	 * Returns the final node at the end of the linked list of nodes
+	 */
+	TTstringNode *getTail() const;
+protected:
+	/**
+	 * Initializes state for the node
+	 */
+	void initialize(int mode);
+public:
+	TTstringNode *_pPrior;
+	TTstringNode *_pNext;
+	TTString _string;
+	int _field14;
+	int _mode;
+	int _field1C;
+public:
+	TTstringNode();
+
+	/**
+	 * Links the passed node to this node as a linked list
+	 */
+	void addNode(TTstringNode *newNode);
+};
+
+class TTsynonymNode : public TTstringNode {
+public:
+	TTsynonymNode();
+	TTsynonymNode(int mode, const char *str, int val2);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_STRING_NODE_H */
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 62f924a..de987c2 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -21,16 +21,38 @@
  */
 
 #include "titanic/true_talk/tt_word.h"
+#include "titanic/true_talk/tt_string_node.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
 TTword::TTword(TTString &str, int mode, int val2) : _string(str),
-		_wordMode(mode), _field1C(val2), _fieldC(0), _field10(0),
+		_wordMode(mode), _field1C(val2), _fieldC(0), _synP(nullptr),
 		_field20(0), _field24(0), _field28(0) {
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
 }
 
 int TTword::readSyn(SimpleFile *file) {
+	CString str;
+	int mode, val1;
+
+	if (!file->scanf("%s %d %d", &str, &mode, &val1))
+		return 8;
+	if (!testFileHandle(file))
+		return 5;
+
+	// Create new synanym node
+	TTsynonymNode *synNode = new TTsynonymNode(mode, str.c_str(), val1);
+
+	if (_synP) {
+		// A synonym already exists, so add new one as a tail
+		// at the end of the linked list of synonyms
+		_synP->addNode(synNode);
+	} else {
+		// Very first synonym, so set it
+		_synP = synNode;
+	}
+
 	return 0;
 }
 
@@ -62,6 +84,14 @@ uint TTword::readNumber(const char *str) {
 	return numValue;
 }
 
+bool TTword::testFileHandle(SimpleFile *file) const {
+	if (g_vm->_fileReader.is18Equals(3))
+		return true;
+
+	// TODO: Figure out why original compares passed file handle against specific values
+	return true;
+}
+
 /*------------------------------------------------------------------------*/
 
 TTword1::TTword1(TTString &str, int val1, int val2, int val3) :
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index a24099c..0d6564a 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -25,6 +25,7 @@
 
 #include "titanic/support/simple_file.h"
 #include "titanic/true_talk/tt_string.h"
+#include "titanic/true_talk/tt_string_node.h"
 
 namespace Titanic {
 
@@ -32,7 +33,7 @@ class TTword {
 protected:
 	TTString _string;
 	int _fieldC;
-	int _field10;
+	TTsynonymNode *_synP;
 	TTStringStatus _status;
 	int _wordMode;
 	int _field1C;
@@ -44,9 +45,14 @@ protected:
 	 * Read in a number
 	 */
 	uint readNumber(const char *str);
+
+	bool testFileHandle(SimpleFile *file) const;
 public:
 	TTword(TTString &str, int mode, int val2);
 
+	/**
+	 * Read in a synonym for the given word
+	 */
 	int readSyn(SimpleFile *file);
 
 	/**


Commit: 33ef893b04bc218a6149b3ff5b6782655767e60f
    https://github.com/scummvm/scummvm/commit/33ef893b04bc218a6149b3ff5b6782655767e60f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:07-04:00

Commit Message:
TITANIC: Implemented vocab findWord

Changed paths:
    engines/titanic/true_talk/st_vocab.cpp
    engines/titanic/true_talk/st_vocab.h
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index 1b03474..b5223a0 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -26,7 +26,7 @@
 
 namespace Titanic {
 
-STVocab::STVocab(int val): _field0(0), _field4(0), _word(nullptr),
+STVocab::STVocab(int val): _vocab(nullptr), _field4(0), _word(nullptr),
 		_fieldC(0), _field10(0), _field18(val) {
 	_field14 = load("STVOCAB.TXT");
 }
@@ -98,10 +98,46 @@ int STVocab::load(const CString &name) {
 			result = 4;
 			break;
 		}
+
+		if (!skipFlag && _word) {
+			if (result) {
+				// Something wrong occurred, so delete word
+				delete _word;
+				_word = nullptr;
+			} else {
+				// Add the word to the master vocab list
+				addWord(_word);
+			}
+		}
 	}
 
+	// Close resource and return result
 	delete file;
 	return result;
 }
 
+void STVocab::addWord(TTword *word) {
+	// TODO
+}
+
+TTword *STVocab::findWord(const TTString &str) {
+	TTsynonymNode *tempNode = new TTsynonymNode();
+	bool flag = false;
+	TTword *word = _vocab;
+
+	while (!flag) {
+		if (_field18 != 3 || strcmp(word->c_str(), str)) {
+			if (word->fn1(str, tempNode, _field18))
+				word = word->_pNext;
+			else
+				flag = true;
+		} else {
+			flag = true;
+		}
+	}
+
+	delete tempNode;
+	return word;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/st_vocab.h b/engines/titanic/true_talk/st_vocab.h
index c44c4dd..19fe0b2 100644
--- a/engines/titanic/true_talk/st_vocab.h
+++ b/engines/titanic/true_talk/st_vocab.h
@@ -31,7 +31,7 @@ namespace Titanic {
 
 class STVocab {
 private:
-	int _field0;
+	TTword *_vocab;
 	int _field4;
 	TTword *_word;
 	int _fieldC;
@@ -43,6 +43,16 @@ private:
 	 * Load the vocab data
 	 */
 	int load(const CString &name);
+
+	/**
+	 * Adds a specified word to the vocab list
+	 */
+	void addWord(TTword *word);
+
+	/**
+	 * Scans the vocab list for an existing word match
+	 */
+	TTword *findWord(const TTString &str);
 public:
 	STVocab(int val);
 };
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index c7c88ff..7d231b1 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -63,7 +63,8 @@ public:
 	 */
 	TTStringStatus getStatus() const { return _status; }
 
-	operator const char *() const { return _data->_string.c_str(); }
+	const char *c_str() const { return _data->_string.c_str(); }
+	operator const char *() const { return c_str(); }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index de987c2..263b519 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -27,7 +27,7 @@
 namespace Titanic {
 
 TTword::TTword(TTString &str, int mode, int val2) : _string(str),
-		_wordMode(mode), _field1C(val2), _fieldC(0), _synP(nullptr),
+		_wordMode(mode), _field1C(val2), _pNext(nullptr), _synP(nullptr),
 		_field20(0), _field24(0), _field28(0) {
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
 }
@@ -92,6 +92,11 @@ bool TTword::testFileHandle(SimpleFile *file) const {
 	return true;
 }
 
+TTword *TTword::fn1(const TTString &str, TTsynonymNode *node, int val) {
+	// TODO
+	return nullptr;
+}
+
 /*------------------------------------------------------------------------*/
 
 TTword1::TTword1(TTString &str, int val1, int val2, int val3) :
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 0d6564a..589dcf7 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -32,7 +32,6 @@ namespace Titanic {
 class TTword {
 protected:
 	TTString _string;
-	int _fieldC;
 	TTsynonymNode *_synP;
 	TTStringStatus _status;
 	int _wordMode;
@@ -48,6 +47,8 @@ protected:
 
 	bool testFileHandle(SimpleFile *file) const;
 public:
+	TTword *_pNext;
+public:
 	TTword(TTString &str, int mode, int val2);
 
 	/**
@@ -59,6 +60,11 @@ public:
 	 * Load the word
 	 */
 	int load(SimpleFile *file, int mode);
+
+	TTword *fn1(const TTString &str, TTsynonymNode *node, int val);
+
+	const char *c_str() const { return _string.c_str(); }
+	operator const char *() const { return c_str(); }
 };
 
 class TTword1 : public TTword {


Commit: 1045fda846dd607546b7f4914850771397fbebb8
    https://github.com/scummvm/scummvm/commit/1045fda846dd607546b7f4914850771397fbebb8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:08-04:00

Commit Message:
TITANIC: Variation TTstringNode initialize method

Changed paths:
    engines/titanic/true_talk/tt_string_node.cpp
    engines/titanic/true_talk/tt_string_node.h



diff --git a/engines/titanic/true_talk/tt_string_node.cpp b/engines/titanic/true_talk/tt_string_node.cpp
index b1e2a64..da805fa 100644
--- a/engines/titanic/true_talk/tt_string_node.cpp
+++ b/engines/titanic/true_talk/tt_string_node.cpp
@@ -29,6 +29,10 @@ TTstringNode::TTstringNode() : _pPrior(nullptr), _pNext(nullptr),
 		_field14(0), _mode(0), _field1C(0) {
 }
 
+TTstringNode::~TTstringNode() {
+	detach();
+}
+
 void TTstringNode::initialize(int mode) {
 	_mode = mode;
 	_field14 = 0;
@@ -41,12 +45,34 @@ void TTstringNode::initialize(int mode) {
 	}
 }
 
+void TTstringNode::initialize(TTstringNode *oldNode) {
+	_mode = oldNode->_mode;
+	_field14 = oldNode->_field14;
+
+	if (_string.isValid()) {
+		_field1C = 0;
+	} else {
+		_field1C = 11;
+		warning("TTstringNode::initialize has bad subobj");
+	}
+
+	delete oldNode;
+}
+
 void TTstringNode::addNode(TTstringNode *newNode) {
 	TTstringNode *tail = getTail();
 	tail->_pNext = newNode;
 	newNode->_pPrior = this;
 }
 
+void TTstringNode::detach() {
+	if (_pPrior)
+		_pPrior->_pNext = _pNext;
+
+	if (_pNext)
+		_pNext->_pPrior = _pPrior;
+}
+
 TTstringNode *TTstringNode::getTail() const {
 	if (_pNext == nullptr)
 		return nullptr;
@@ -58,6 +84,17 @@ TTstringNode *TTstringNode::getTail() const {
 	return node;
 }
 
+TTstringNode *TTstringNode::scan(TTstringNode *start, const TTString &str, int mode) {
+	for (; start; start = start->_pNext) {
+		if (start->_mode == mode || (mode == 3 && start->_mode < 3)) {
+			if (!strcmp(start->_string.c_str(), str.c_str()))
+				start;
+		}
+	}
+
+	return nullptr;
+}
+
 /*------------------------------------------------------------------------*/
 
 TTsynonymNode::TTsynonymNode() : TTstringNode() {
diff --git a/engines/titanic/true_talk/tt_string_node.h b/engines/titanic/true_talk/tt_string_node.h
index e588ea4..41ce6c5 100644
--- a/engines/titanic/true_talk/tt_string_node.h
+++ b/engines/titanic/true_talk/tt_string_node.h
@@ -38,6 +38,11 @@ protected:
 	 * Initializes state for the node
 	 */
 	void initialize(int mode);
+
+	/**
+	 * Initializes state for the node
+	 */
+	void initialize(TTstringNode *oldNode);
 public:
 	TTstringNode *_pPrior;
 	TTstringNode *_pNext;
@@ -47,11 +52,22 @@ public:
 	int _field1C;
 public:
 	TTstringNode();
+	virtual ~TTstringNode();
 
 	/**
 	 * Links the passed node to this node as a linked list
 	 */
 	void addNode(TTstringNode *newNode);
+
+	/**
+	 * Detaches a node from any predecessor and/or successor
+	 */
+	void detach();
+
+	/**
+	 * Scan for a node with a given string
+	 */
+	static TTstringNode *scan(TTstringNode *start, const TTString &str, int mode);
 };
 
 class TTsynonymNode : public TTstringNode {


Commit: fa626a8bc981b9a3009996787c3007193eab1147
    https://github.com/scummvm/scummvm/commit/fa626a8bc981b9a3009996787c3007193eab1147
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:09-04:00

Commit Message:
TITANIC: Implemented TTsynonymNode copy

Changed paths:
    engines/titanic/true_talk/tt_string_node.cpp
    engines/titanic/true_talk/tt_string_node.h



diff --git a/engines/titanic/true_talk/tt_string_node.cpp b/engines/titanic/true_talk/tt_string_node.cpp
index da805fa..db7c846 100644
--- a/engines/titanic/true_talk/tt_string_node.cpp
+++ b/engines/titanic/true_talk/tt_string_node.cpp
@@ -59,6 +59,17 @@ void TTstringNode::initialize(TTstringNode *oldNode) {
 	delete oldNode;
 }
 
+TTstringNode *TTstringNode::scan(TTstringNode *start, const TTString &str, int mode) {
+	for (; start; start = start->_pNext) {
+		if (start->_mode == mode || (mode == 3 && start->_mode < 3)) {
+			if (!strcmp(start->_string.c_str(), str.c_str()))
+				start;
+		}
+	}
+
+	return nullptr;
+}
+
 void TTstringNode::addNode(TTstringNode *newNode) {
 	TTstringNode *tail = getTail();
 	tail->_pNext = newNode;
@@ -84,22 +95,17 @@ TTstringNode *TTstringNode::getTail() const {
 	return node;
 }
 
-TTstringNode *TTstringNode::scan(TTstringNode *start, const TTString &str, int mode) {
-	for (; start; start = start->_pNext) {
-		if (start->_mode == mode || (mode == 3 && start->_mode < 3)) {
-			if (!strcmp(start->_string.c_str(), str.c_str()))
-				start;
-		}
-	}
-
-	return nullptr;
-}
-
 /*------------------------------------------------------------------------*/
 
 TTsynonymNode::TTsynonymNode() : TTstringNode() {
 }
 
+TTsynonymNode::TTsynonymNode(const TTsynonymNode *src) {
+	_string = src->_string;
+	initialize(src->_mode);
+	_field14 = src->_field14;
+}
+
 TTsynonymNode::TTsynonymNode(int mode, const char *str, int val2) :
 		TTstringNode() {
 	_string = str;
@@ -107,5 +113,21 @@ TTsynonymNode::TTsynonymNode(int mode, const char *str, int val2) :
 	_field14 = val2;
 }
 
+TTsynonymNode *TTsynonymNode::copy(TTsynonymNode *src) {
+	if (src->_field1C) {
+		_field1C = 5;
+		return this;
+	} else {
+		_field1C = 0;
+		if (src == this)
+			return this;
+
+		_string = src->_string;
+		TTsynonymNode *newNode = new TTsynonymNode(src);
+		initialize(newNode);
+
+		return this;
+	}
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string_node.h b/engines/titanic/true_talk/tt_string_node.h
index 41ce6c5..7b96fbf 100644
--- a/engines/titanic/true_talk/tt_string_node.h
+++ b/engines/titanic/true_talk/tt_string_node.h
@@ -73,7 +73,10 @@ public:
 class TTsynonymNode : public TTstringNode {
 public:
 	TTsynonymNode();
+	TTsynonymNode(const TTsynonymNode *src);
 	TTsynonymNode(int mode, const char *str, int val2);
+
+	TTsynonymNode *copy(TTsynonymNode *src);
 };
 
 } // End of namespace Titanic


Commit: e86ce94441a032de3707eb7576060d9281a3fec0
    https://github.com/scummvm/scummvm/commit/e86ce94441a032de3707eb7576060d9281a3fec0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:10-04:00

Commit Message:
TITANIC: Implement TTword scanCopy

Changed paths:
    engines/titanic/true_talk/st_vocab.cpp
    engines/titanic/true_talk/tt_string_node.cpp
    engines/titanic/true_talk/tt_string_node.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index b5223a0..bf4d366 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -127,7 +127,7 @@ TTword *STVocab::findWord(const TTString &str) {
 
 	while (!flag) {
 		if (_field18 != 3 || strcmp(word->c_str(), str)) {
-			if (word->fn1(str, tempNode, _field18))
+			if (word->scanCopy(str, tempNode, _field18))
 				word = word->_pNext;
 			else
 				flag = true;
diff --git a/engines/titanic/true_talk/tt_string_node.cpp b/engines/titanic/true_talk/tt_string_node.cpp
index db7c846..b3d3707 100644
--- a/engines/titanic/true_talk/tt_string_node.cpp
+++ b/engines/titanic/true_talk/tt_string_node.cpp
@@ -100,7 +100,7 @@ TTstringNode *TTstringNode::getTail() const {
 TTsynonymNode::TTsynonymNode() : TTstringNode() {
 }
 
-TTsynonymNode::TTsynonymNode(const TTsynonymNode *src) {
+TTsynonymNode::TTsynonymNode(const TTstringNode *src) {
 	_string = src->_string;
 	initialize(src->_mode);
 	_field14 = src->_field14;
@@ -113,7 +113,7 @@ TTsynonymNode::TTsynonymNode(int mode, const char *str, int val2) :
 	_field14 = val2;
 }
 
-TTsynonymNode *TTsynonymNode::copy(TTsynonymNode *src) {
+TTsynonymNode *TTsynonymNode::copy(TTstringNode *src) {
 	if (src->_field1C) {
 		_field1C = 5;
 		return this;
diff --git a/engines/titanic/true_talk/tt_string_node.h b/engines/titanic/true_talk/tt_string_node.h
index 7b96fbf..f836889 100644
--- a/engines/titanic/true_talk/tt_string_node.h
+++ b/engines/titanic/true_talk/tt_string_node.h
@@ -73,10 +73,10 @@ public:
 class TTsynonymNode : public TTstringNode {
 public:
 	TTsynonymNode();
-	TTsynonymNode(const TTsynonymNode *src);
+	TTsynonymNode(const TTstringNode *src);
 	TTsynonymNode(int mode, const char *str, int val2);
 
-	TTsynonymNode *copy(TTsynonymNode *src);
+	TTsynonymNode *copy(TTstringNode *src);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 263b519..7f4b5a8 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -92,8 +92,16 @@ bool TTword::testFileHandle(SimpleFile *file) const {
 	return true;
 }
 
-TTword *TTword::fn1(const TTString &str, TTsynonymNode *node, int val) {
-	// TODO
+TTword *TTword::scanCopy(const TTString &str, TTsynonymNode *node, int mode) {
+	if (_synP) {
+		TTstringNode *strNode = _synP->scan(_synP, str, mode);
+		if (strNode) {
+			node->copy(strNode);
+			node->_pPrior = nullptr;
+			node->_pNext = nullptr;
+		}
+	}
+
 	return nullptr;
 }
 
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 589dcf7..277f180 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -61,7 +61,7 @@ public:
 	 */
 	int load(SimpleFile *file, int mode);
 
-	TTword *fn1(const TTString &str, TTsynonymNode *node, int val);
+	TTword *scanCopy(const TTString &str, TTsynonymNode *node, int mode);
 
 	const char *c_str() const { return _string.c_str(); }
 	operator const char *() const { return c_str(); }


Commit: b8c41050211c6b5c25a9e02a767a54b8e1ef55d7
    https://github.com/scummvm/scummvm/commit/b8c41050211c6b5c25a9e02a767a54b8e1ef55d7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:11-04:00

Commit Message:
TITANIC: Implemented STVocab addWord

Changed paths:
    engines/titanic/true_talk/st_vocab.cpp
    engines/titanic/true_talk/st_vocab.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index bf4d366..5135f64 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -26,7 +26,7 @@
 
 namespace Titanic {
 
-STVocab::STVocab(int val): _vocab(nullptr), _field4(0), _word(nullptr),
+STVocab::STVocab(int val): _pHead(nullptr), _pTail(nullptr), _word(nullptr),
 		_fieldC(0), _field10(0), _field18(val) {
 	_field14 = load("STVOCAB.TXT");
 }
@@ -117,13 +117,33 @@ int STVocab::load(const CString &name) {
 }
 
 void STVocab::addWord(TTword *word) {
-	// TODO
+	TTword *existingWord = findWord(word->_string);
+
+	if (existingWord) {
+		if (word->_synP) {
+			// Move over the synonym
+			existingWord->appendNode(word->_synP);
+			word->_synP = nullptr;
+		}
+
+		_word = nullptr;
+		if (word)
+			delete word;
+	} else if (_pTail) {
+		_pTail->_pNext = word;
+		_pTail = word;
+	} else {
+		if (!_pHead)
+			_pHead = word;
+
+		_pTail = word;
+	}
 }
 
 TTword *STVocab::findWord(const TTString &str) {
 	TTsynonymNode *tempNode = new TTsynonymNode();
 	bool flag = false;
-	TTword *word = _vocab;
+	TTword *word = _pHead;
 
 	while (!flag) {
 		if (_field18 != 3 || strcmp(word->c_str(), str)) {
diff --git a/engines/titanic/true_talk/st_vocab.h b/engines/titanic/true_talk/st_vocab.h
index 19fe0b2..68ce86b 100644
--- a/engines/titanic/true_talk/st_vocab.h
+++ b/engines/titanic/true_talk/st_vocab.h
@@ -31,8 +31,8 @@ namespace Titanic {
 
 class STVocab {
 private:
-	TTword *_vocab;
-	int _field4;
+	TTword *_pHead;
+	TTword *_pTail;
 	TTword *_word;
 	int _fieldC;
 	int _field10;
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 7f4b5a8..7fc5263 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -56,6 +56,13 @@ int TTword::readSyn(SimpleFile *file) {
 	return 0;
 }
 
+void TTword::appendNode(TTsynonymNode *node) {
+	if (_synP)
+		_synP->addNode(node);
+	else
+		_synP = node;
+}
+
 int TTword::load(SimpleFile *file, int mode) {
 	CString str1, str2;
 	int val;
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 277f180..a535cac 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -31,8 +31,6 @@ namespace Titanic {
 
 class TTword {
 protected:
-	TTString _string;
-	TTsynonymNode *_synP;
 	TTStringStatus _status;
 	int _wordMode;
 	int _field1C;
@@ -48,6 +46,8 @@ protected:
 	bool testFileHandle(SimpleFile *file) const;
 public:
 	TTword *_pNext;
+	TTsynonymNode *_synP;
+	TTString _string;
 public:
 	TTword(TTString &str, int mode, int val2);
 
@@ -57,6 +57,11 @@ public:
 	int readSyn(SimpleFile *file);
 
 	/**
+	 * Either sets the first synonym for a word, or adds it to an existing one
+	 */
+	void appendNode(TTsynonymNode *node);
+
+	/**
 	 * Load the word
 	 */
 	int load(SimpleFile *file, int mode);


Commit: b8a7a98c544eeae453b0b62cffdac7a59f43b737
    https://github.com/scummvm/scummvm/commit/b8a7a98c544eeae453b0b62cffdac7a59f43b737
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:13-04:00

Commit Message:
TITANIC: Bugfixes for vocab loading

Changed paths:
    engines/titanic/true_talk/st_vocab.cpp
    engines/titanic/true_talk/tt_string_node.cpp
    engines/titanic/true_talk/tt_string_node.h



diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index 5135f64..a4f5cd8 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -145,7 +145,7 @@ TTword *STVocab::findWord(const TTString &str) {
 	bool flag = false;
 	TTword *word = _pHead;
 
-	while (!flag) {
+	while (word && !flag) {
 		if (_field18 != 3 || strcmp(word->c_str(), str)) {
 			if (word->scanCopy(str, tempNode, _field18))
 				word = word->_pNext;
diff --git a/engines/titanic/true_talk/tt_string_node.cpp b/engines/titanic/true_talk/tt_string_node.cpp
index b3d3707..95b6465 100644
--- a/engines/titanic/true_talk/tt_string_node.cpp
+++ b/engines/titanic/true_talk/tt_string_node.cpp
@@ -84,9 +84,9 @@ void TTstringNode::detach() {
 		_pNext->_pPrior = _pPrior;
 }
 
-TTstringNode *TTstringNode::getTail() const {
+TTstringNode *TTstringNode::getTail() {
 	if (_pNext == nullptr)
-		return nullptr;
+		return this;
 	
 	TTstringNode *node = _pNext;
 	while (node->_pNext)
diff --git a/engines/titanic/true_talk/tt_string_node.h b/engines/titanic/true_talk/tt_string_node.h
index f836889..2c6a4e1 100644
--- a/engines/titanic/true_talk/tt_string_node.h
+++ b/engines/titanic/true_talk/tt_string_node.h
@@ -32,7 +32,7 @@ private:
 	/**
 	 * Returns the final node at the end of the linked list of nodes
 	 */
-	TTstringNode *getTail() const;
+	TTstringNode *getTail();
 protected:
 	/**
 	 * Initializes state for the node


Commit: 17de345191ab9fde2ed1469c5e325347313decdf
    https://github.com/scummvm/scummvm/commit/17de345191ab9fde2ed1469c5e325347313decdf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:14-04:00

Commit Message:
TITANIC: Fix conditional checks in TTword classes load methods

Changed paths:
    engines/titanic/true_talk/tt_word.cpp



diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 7fc5263..3fa5381 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -127,7 +127,7 @@ TTword2::TTword2(TTString &str, int val1, int val2, int val3, int val4) :
 int TTword2::load(SimpleFile *file) {
 	int val;
 
-	if (TTword::load(file, 1) && file->scanf("%d", &val)) {
+	if (!TTword::load(file, 1) && file->scanf("%d", &val)) {
 		_field30 = val;
 		return 0;
 	} else {
@@ -171,7 +171,7 @@ TTword4::TTword4(TTString &str, int val1, int val2, int val3, int val4) :
 int TTword4::load(SimpleFile *file) {
 	int val;
 
-	if (TTword::load(file, 1) && file->scanf("%d", &val)) {
+	if (!TTword::load(file, 1) && file->scanf("%d", &val)) {
 		_field30 = val;
 		return 0;
 	} else {
@@ -188,7 +188,7 @@ TTword5::TTword5(TTString &str, int val1, int val2, int val3, int val4) :
 int TTword5::load(SimpleFile *file) {
 	int val;
 
-	if (TTword::load(file, 1) && file->scanf("%d", &val)) {
+	if (!TTword::load(file, 1) && file->scanf("%d", &val)) {
 		if (val >= 0 && val <= 12) {
 			_field30 = val;
 			return 0;


Commit: a27d49a43ccc699751b049e0631209c214ef71de
    https://github.com/scummvm/scummvm/commit/a27d49a43ccc699751b049e0631209c214ef71de
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:15-04:00

Commit Message:
TITANIC: Fix finding existing words in STVocab findWord

Changed paths:
    engines/titanic/true_talk/st_vocab.cpp



diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index a4f5cd8..138af06 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -148,9 +148,9 @@ TTword *STVocab::findWord(const TTString &str) {
 	while (word && !flag) {
 		if (_field18 != 3 || strcmp(word->c_str(), str)) {
 			if (word->scanCopy(str, tempNode, _field18))
-				word = word->_pNext;
-			else
 				flag = true;
+			else
+				word = word->_pNext;
 		} else {
 			flag = true;
 		}


Commit: 9c8d4f234b3eb8f825b51a225466228c3cf0c727
    https://github.com/scummvm/scummvm/commit/9c8d4f234b3eb8f825b51a225466228c3cf0c727
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:16-04:00

Commit Message:
TITANIC: Split TTsynonymNode into it's own file, and rename to TTsynonym

Changed paths:
  A engines/titanic/true_talk/tt_synonym.cpp
  A engines/titanic/true_talk/tt_synonym.h
    engines/titanic/module.mk
    engines/titanic/true_talk/st_vocab.cpp
    engines/titanic/true_talk/tt_string_node.cpp
    engines/titanic/true_talk/tt_string_node.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 23354b4..42103e7 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -467,6 +467,7 @@ MODULE_OBJS := \
 	true_talk/tt_scripts.o \
 	true_talk/tt_string.o \
 	true_talk/tt_string_node.o \
+	true_talk/tt_synonym.o \
 	true_talk/tt_talker.o \
 	true_talk/tt_title_script.o \
 	true_talk/tt_word.o
diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index 138af06..084393b 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -141,7 +141,7 @@ void STVocab::addWord(TTword *word) {
 }
 
 TTword *STVocab::findWord(const TTString &str) {
-	TTsynonymNode *tempNode = new TTsynonymNode();
+	TTsynonym *tempNode = new TTsynonym();
 	bool flag = false;
 	TTword *word = _pHead;
 
diff --git a/engines/titanic/true_talk/tt_string_node.cpp b/engines/titanic/true_talk/tt_string_node.cpp
index 95b6465..cf01ac6 100644
--- a/engines/titanic/true_talk/tt_string_node.cpp
+++ b/engines/titanic/true_talk/tt_string_node.cpp
@@ -59,17 +59,6 @@ void TTstringNode::initialize(TTstringNode *oldNode) {
 	delete oldNode;
 }
 
-TTstringNode *TTstringNode::scan(TTstringNode *start, const TTString &str, int mode) {
-	for (; start; start = start->_pNext) {
-		if (start->_mode == mode || (mode == 3 && start->_mode < 3)) {
-			if (!strcmp(start->_string.c_str(), str.c_str()))
-				start;
-		}
-	}
-
-	return nullptr;
-}
-
 void TTstringNode::addNode(TTstringNode *newNode) {
 	TTstringNode *tail = getTail();
 	tail->_pNext = newNode;
@@ -95,39 +84,4 @@ TTstringNode *TTstringNode::getTail() {
 	return node;
 }
 
-/*------------------------------------------------------------------------*/
-
-TTsynonymNode::TTsynonymNode() : TTstringNode() {
-}
-
-TTsynonymNode::TTsynonymNode(const TTstringNode *src) {
-	_string = src->_string;
-	initialize(src->_mode);
-	_field14 = src->_field14;
-}
-
-TTsynonymNode::TTsynonymNode(int mode, const char *str, int val2) :
-		TTstringNode() {
-	_string = str;
-	initialize(mode);
-	_field14 = val2;
-}
-
-TTsynonymNode *TTsynonymNode::copy(TTstringNode *src) {
-	if (src->_field1C) {
-		_field1C = 5;
-		return this;
-	} else {
-		_field1C = 0;
-		if (src == this)
-			return this;
-
-		_string = src->_string;
-		TTsynonymNode *newNode = new TTsynonymNode(src);
-		initialize(newNode);
-
-		return this;
-	}
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string_node.h b/engines/titanic/true_talk/tt_string_node.h
index 2c6a4e1..dddef8d 100644
--- a/engines/titanic/true_talk/tt_string_node.h
+++ b/engines/titanic/true_talk/tt_string_node.h
@@ -63,20 +63,6 @@ public:
 	 * Detaches a node from any predecessor and/or successor
 	 */
 	void detach();
-
-	/**
-	 * Scan for a node with a given string
-	 */
-	static TTstringNode *scan(TTstringNode *start, const TTString &str, int mode);
-};
-
-class TTsynonymNode : public TTstringNode {
-public:
-	TTsynonymNode();
-	TTsynonymNode(const TTstringNode *src);
-	TTsynonymNode(int mode, const char *str, int val2);
-
-	TTsynonymNode *copy(TTstringNode *src);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_synonym.cpp b/engines/titanic/true_talk/tt_synonym.cpp
new file mode 100644
index 0000000..5da124a
--- /dev/null
+++ b/engines/titanic/true_talk/tt_synonym.cpp
@@ -0,0 +1,71 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_synonym.h"
+
+namespace Titanic {
+
+TTsynonym::TTsynonym() : TTstringNode() {
+}
+
+TTsynonym::TTsynonym(const TTstringNode *src) {
+	_string = src->_string;
+	initialize(src->_mode);
+	_field14 = src->_field14;
+}
+
+TTsynonym::TTsynonym(int mode, const char *str, int val2) :
+		TTstringNode() {
+	_string = str;
+	initialize(mode);
+	_field14 = val2;
+}
+
+TTsynonym *TTsynonym::findByName(TTsynonym *start, const TTString &str, int mode) {
+	for (; start; start = static_cast<TTsynonym *>(start->_pNext)) {
+		if (start->_mode == mode || (mode == 3 && start->_mode < 3)) {
+			if (!strcmp(start->_string.c_str(), str.c_str()))
+				start;
+		}
+	}
+
+	return nullptr;
+}
+
+TTsynonym *TTsynonym::copy(TTstringNode *src) {
+	if (src->_field1C) {
+		_field1C = 5;
+		return this;
+	} else {
+		_field1C = 0;
+		if (src == this)
+			return this;
+
+		_string = src->_string;
+		TTsynonym *newNode = new TTsynonym(src);
+		initialize(newNode);
+
+		return this;
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_synonym.h b/engines/titanic/true_talk/tt_synonym.h
new file mode 100644
index 0000000..6a20ef3
--- /dev/null
+++ b/engines/titanic/true_talk/tt_synonym.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_SYNONYM_H
+#define TITANIC_TT_SYNONYM_H
+
+#include "titanic/true_talk/tt_string_node.h"
+
+namespace Titanic {
+
+class TTsynonym : public TTstringNode {
+public:
+	TTsynonym();
+	TTsynonym(const TTstringNode *src);
+	TTsynonym(int mode, const char *str, int val2);
+
+	TTsynonym *copy(TTstringNode *src);
+
+	/**
+	 * Scan for a synonym with a given string
+	 */
+	static TTsynonym *findByName(TTsynonym *start, const TTString &str, int mode);
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_SYNONYM_H */
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 3fa5381..431a1d8 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -42,7 +42,7 @@ int TTword::readSyn(SimpleFile *file) {
 		return 5;
 
 	// Create new synanym node
-	TTsynonymNode *synNode = new TTsynonymNode(mode, str.c_str(), val1);
+	TTsynonym *synNode = new TTsynonym(mode, str.c_str(), val1);
 
 	if (_synP) {
 		// A synonym already exists, so add new one as a tail
@@ -56,7 +56,7 @@ int TTword::readSyn(SimpleFile *file) {
 	return 0;
 }
 
-void TTword::appendNode(TTsynonymNode *node) {
+void TTword::appendNode(TTsynonym *node) {
 	if (_synP)
 		_synP->addNode(node);
 	else
@@ -99,9 +99,9 @@ bool TTword::testFileHandle(SimpleFile *file) const {
 	return true;
 }
 
-TTword *TTword::scanCopy(const TTString &str, TTsynonymNode *node, int mode) {
+TTword *TTword::scanCopy(const TTString &str, TTsynonym *node, int mode) {
 	if (_synP) {
-		TTstringNode *strNode = _synP->scan(_synP, str, mode);
+		TTstringNode *strNode = TTsynonym::findByName(_synP, str, mode);
 		if (strNode) {
 			node->copy(strNode);
 			node->_pPrior = nullptr;
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index a535cac..850b695 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -25,7 +25,7 @@
 
 #include "titanic/support/simple_file.h"
 #include "titanic/true_talk/tt_string.h"
-#include "titanic/true_talk/tt_string_node.h"
+#include "titanic/true_talk/tt_synonym.h"
 
 namespace Titanic {
 
@@ -46,7 +46,7 @@ protected:
 	bool testFileHandle(SimpleFile *file) const;
 public:
 	TTword *_pNext;
-	TTsynonymNode *_synP;
+	TTsynonym *_synP;
 	TTString _string;
 public:
 	TTword(TTString &str, int mode, int val2);
@@ -59,14 +59,14 @@ public:
 	/**
 	 * Either sets the first synonym for a word, or adds it to an existing one
 	 */
-	void appendNode(TTsynonymNode *node);
+	void appendNode(TTsynonym *node);
 
 	/**
 	 * Load the word
 	 */
 	int load(SimpleFile *file, int mode);
 
-	TTword *scanCopy(const TTString &str, TTsynonymNode *node, int mode);
+	TTword *scanCopy(const TTString &str, TTsynonym *node, int mode);
 
 	const char *c_str() const { return _string.c_str(); }
 	operator const char *() const { return c_str(); }


Commit: 96a11a08bd4c59cc17a0d502e45c3c0480925c3f
    https://github.com/scummvm/scummvm/commit/96a11a08bd4c59cc17a0d502e45c3c0480925c3f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:17-04:00

Commit Message:
TITANIC: Fix loading TTword3 vocab

Changed paths:
    engines/titanic/true_talk/tt_word.cpp



diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 431a1d8..067560b 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -146,7 +146,7 @@ int TTword3::load(SimpleFile *file) {
 	CString str;
 	int val1, val2;
 
-	if (!TTword::load(file, 2) && file->scanf("%d %d %d", &str, &val1, &val2)) {
+	if (!TTword::load(file, 2) && file->scanf("%s %d %d", &str, &val1, &val2)) {
 		_field34 = readNumber(str.c_str());
 		_field30 = val1;
 		_field3C = val2;


Commit: 01320c06cbb6a25ee226c1037152d5348b73cd68
    https://github.com/scummvm/scummvm/commit/01320c06cbb6a25ee226c1037152d5348b73cd68
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:18-04:00

Commit Message:
TITANIC: Vocab list is now completely loading

Changed paths:
    engines/titanic/support/simple_file.cpp
    engines/titanic/support/simple_file.h
    engines/titanic/true_talk/tt_word.cpp



diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp
index 85f42ae..80f5178 100644
--- a/engines/titanic/support/simple_file.cpp
+++ b/engines/titanic/support/simple_file.cpp
@@ -368,16 +368,14 @@ bool SimpleFile::scanf(const char *format, ...) {
 	CString formatStr(format);
 	while (!formatStr.empty()) {
 		if (formatStr.hasPrefix(" ")) {
-			// Skip over whitespaces
 			formatStr.deleteChar(0);
 			
 			safeRead(&c, 1);			
 			if (!Common::isSpace(c))
 				return false;
 
-			while (Common::isSpace(c))
-				safeRead(&c, 1);
-			_inStream->skip(-1);
+			// Skip over whitespaces
+			skipSpaces();
 		} else if (formatStr.hasPrefix("%d")) {
 			// Read in a number
 			formatStr = CString(formatStr.c_str() + 2);
@@ -399,10 +397,20 @@ bool SimpleFile::scanf(const char *format, ...) {
 		}
 	}
 
+	skipSpaces();
 	va_end(va);
 	return !eos();
 }
 
+void SimpleFile::skipSpaces() {
+	char c = ' ';
+	while (!eos() && Common::isSpace(c))
+		safeRead(&c, 1);
+
+	if (!eos())
+		_inStream->skip(-1);
+}
+
 /*------------------------------------------------------------------------*/
 
 void StdCWadFile::open(const CString &name) {
diff --git a/engines/titanic/support/simple_file.h b/engines/titanic/support/simple_file.h
index db453c4..2a4cfdb 100644
--- a/engines/titanic/support/simple_file.h
+++ b/engines/titanic/support/simple_file.h
@@ -48,6 +48,11 @@ public:
  * This class implements basic reading and writing to files
  */
 class SimpleFile {
+private:
+	/**
+	 * Skip over any pending spaces
+	 */
+	void skipSpaces();
 protected:
 	Common::SeekableReadStream *_inStream;
 	Common::OutSaveFile *_outStream;
@@ -213,7 +218,7 @@ public:
 	 */
 	bool eos() const {
 		assert(_inStream);
-		return _inStream->eos();
+		return _inStream->pos() >= _inStream->size();
 	}
 };
 
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 067560b..143e1df 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -171,7 +171,7 @@ TTword4::TTword4(TTString &str, int val1, int val2, int val3, int val4) :
 int TTword4::load(SimpleFile *file) {
 	int val;
 
-	if (!TTword::load(file, 1) && file->scanf("%d", &val)) {
+	if (!TTword::load(file, 8) && file->scanf("%d", &val)) {
 		_field30 = val;
 		return 0;
 	} else {
@@ -188,7 +188,7 @@ TTword5::TTword5(TTString &str, int val1, int val2, int val3, int val4) :
 int TTword5::load(SimpleFile *file) {
 	int val;
 
-	if (!TTword::load(file, 1) && file->scanf("%d", &val)) {
+	if (!TTword::load(file, 6) && file->scanf("%d", &val)) {
 		if (val >= 0 && val <= 12) {
 			_field30 = val;
 			return 0;


Commit: 7700923298da4002a5d0baf28913a46e7e0fcf59
    https://github.com/scummvm/scummvm/commit/7700923298da4002a5d0baf28913a46e7e0fcf59
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:19-04:00

Commit Message:
TITANIC: Change CFileReader to CExeResoucres

Changed paths:
  A engines/titanic/support/exe_resources.cpp
  A engines/titanic/support/exe_resources.h
  R engines/titanic/support/file_reader.cpp
  R engines/titanic/support/file_reader.h
    engines/titanic/module.mk
    engines/titanic/titanic.h
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/st_vocab.cpp
    engines/titanic/true_talk/tt_word.cpp



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 42103e7..47da6d4 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -431,7 +431,7 @@ MODULE_OBJS := \
 	star_control/star_control_sub15.o \
 	support/direct_draw.o \
 	support/direct_draw_surface.o \
-	support/file_reader.o \
+	support/exe_resources.o \
 	support/files_manager.o \
 	support/font.o \
 	support/image.o \
diff --git a/engines/titanic/support/exe_resources.cpp b/engines/titanic/support/exe_resources.cpp
new file mode 100644
index 0000000..91139dc
--- /dev/null
+++ b/engines/titanic/support/exe_resources.cpp
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/exe_resources.h"
+
+namespace Titanic {
+
+CExeResources::CExeResources() : _owner(nullptr), _field4(0), _field8(0),
+	_fieldC(0), _field10(0), _field14(0), _field18(0) {
+}
+
+void CExeResources::reset(CScriptHandler *owner, int val1, int val2) {
+	_owner = owner;
+	_field18 = val2;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/exe_resources.h b/engines/titanic/support/exe_resources.h
new file mode 100644
index 0000000..48b48d4
--- /dev/null
+++ b/engines/titanic/support/exe_resources.h
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_EXE_RESOURCES_H
+#define TITANIC_EXE_RESOURCES_H
+
+#include "common/file.h"
+
+namespace Titanic {
+
+class CScriptHandler;
+
+class CExeResources {
+public:
+	CScriptHandler *_owner;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+public:
+	CExeResources();
+
+	void reset(CScriptHandler *owner, int val1, int val2);
+
+	bool is18Equals(int val) const { return _field18 == val; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_EXE_RESOURCES_H */
diff --git a/engines/titanic/support/file_reader.cpp b/engines/titanic/support/file_reader.cpp
deleted file mode 100644
index f31d72b..0000000
--- a/engines/titanic/support/file_reader.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/support/file_reader.h"
-
-namespace Titanic {
-
-CFileReader::CFileReader() : _owner(nullptr), _field4(0), _field8(0),
-	_fieldC(0), _field10(0), _field14(0), _field18(0) {
-}
-
-void CFileReader::reset(CScriptHandler *owner, int val1, int val2) {
-	_owner = owner;
-	_field18 = val2;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/support/file_reader.h b/engines/titanic/support/file_reader.h
deleted file mode 100644
index 42ab43c..0000000
--- a/engines/titanic/support/file_reader.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_FILE_READER_H
-#define TITANIC_FILE_READER_H
-
-#include "common/file.h"
-
-namespace Titanic {
-
-class CScriptHandler;
-
-class CFileReader {
-public:
-	CScriptHandler *_owner;
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
-	int _field14;
-	int _field18;
-public:
-	CFileReader();
-
-	void reset(CScriptHandler *owner, int val1, int val2);
-
-	bool is18Equals(int val) const { return _field18 == val; }
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_FILE_READER_H */
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 71e8fcd..78f19c5 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -34,7 +34,7 @@
 #include "titanic/events.h"
 #include "titanic/support/files_manager.h"
 #include "titanic/main_game_window.h"
-#include "titanic/support/file_reader.h"
+#include "titanic/support/exe_resources.h"
 #include "titanic/support/movie.h"
 #include "titanic/support/screen_manager.h"
 #include "titanic/support/string.h"
@@ -120,7 +120,7 @@ public:
 	Common::RandomSource _randomSource;
 	CScriptHandler *_scriptHandler;
 	TTScriptBase *_script;
-	CFileReader _fileReader;
+	CExeResources _exeResources;
 	CMovieList _activeMovies;
 	CString _itemNames[TOTAL_ITEMS];
 	CString _itemDescriptions[TOTAL_ITEMS];
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 67ce8be..d19c08a 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -28,12 +28,12 @@ namespace Titanic {
 /*------------------------------------------------------------------------*/
 
 CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) :
-		_owner(owner), _script(owner->_script), _reader(g_vm->_fileReader),
+		_owner(owner), _script(owner->_script), _resources(g_vm->_exeResources),
 		_sub1(), _sub2(this), _field10(0), _inputCtr(0), 
 		_field20(0), _field24(0), _field28(0), _field2C(0), _field30(0) {
 	g_vm->_scriptHandler = this;
 	g_vm->_script = _script;
-	g_vm->_fileReader.reset(this, val1, val2);
+	g_vm->_exeResources.reset(this, val1, val2);
 	_vocab = new STVocab(val2);
 }
 
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 58d58d6..8449a72 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -27,7 +27,7 @@
 #include "titanic/true_talk/tt_room_script.h"
 #include "titanic/true_talk/tt_string.h"
 #include "titanic/true_talk/st_vocab.h"
-#include "titanic/support/file_reader.h"
+#include "titanic/support/exe_resources.h"
 
 namespace Titanic {
 
@@ -65,7 +65,7 @@ private:
 	CTitleEngine *_owner;
 	TTScriptBase *_script;
 	STVocab *_vocab;
-	CFileReader &_reader;
+	CExeResources &_resources;
 	int _field10;
 	CScriptHandlerSub1 _sub1;
 	CScriptHandlerSub2 _sub2;
diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index 084393b..df683c7 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -32,7 +32,7 @@ STVocab::STVocab(int val): _pHead(nullptr), _pTail(nullptr), _word(nullptr),
 }
 
 int STVocab::load(const CString &name) {
-	SimpleFile *file = g_vm->_fileReader._owner->openResource(name);
+	SimpleFile *file = g_vm->_exeResources._owner->openResource(name);
 	int result = 0;
 	bool skipFlag;
 
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 143e1df..53d4bd8 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -92,7 +92,7 @@ uint TTword::readNumber(const char *str) {
 }
 
 bool TTword::testFileHandle(SimpleFile *file) const {
-	if (g_vm->_fileReader.is18Equals(3))
+	if (g_vm->_exeResources.is18Equals(3))
 		return true;
 
 	// TODO: Figure out why original compares passed file handle against specific values


Commit: 2f2397f7df053fb17badd93b15ea5270892232b2
    https://github.com/scummvm/scummvm/commit/2f2397f7df053fb17badd93b15ea5270892232b2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:21-04:00

Commit Message:
TITANIC: Added STVocab destructor

Changed paths:
    engines/titanic/true_talk/st_vocab.cpp
    engines/titanic/true_talk/st_vocab.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
index df683c7..8ea2b53 100644
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -31,6 +31,14 @@ STVocab::STVocab(int val): _pHead(nullptr), _pTail(nullptr), _word(nullptr),
 	_field14 = load("STVOCAB.TXT");
 }
 
+STVocab::~STVocab() {
+	if (_pHead) {
+		_pHead->deleteSiblings();
+		delete _pHead;
+		_pHead = _pTail = nullptr;
+	}
+}
+
 int STVocab::load(const CString &name) {
 	SimpleFile *file = g_vm->_exeResources._owner->openResource(name);
 	int result = 0;
diff --git a/engines/titanic/true_talk/st_vocab.h b/engines/titanic/true_talk/st_vocab.h
index 68ce86b..6a86825 100644
--- a/engines/titanic/true_talk/st_vocab.h
+++ b/engines/titanic/true_talk/st_vocab.h
@@ -55,6 +55,7 @@ private:
 	TTword *findWord(const TTString &str);
 public:
 	STVocab(int val);
+	~STVocab();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 53d4bd8..b7309b2 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -32,6 +32,14 @@ TTword::TTword(TTString &str, int mode, int val2) : _string(str),
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
 }
 
+void TTword::deleteSiblings() {
+	while (_pNext) {
+		TTword *next = _pNext;
+		_pNext = next->_pNext;
+		delete next;
+	}
+}
+
 int TTword::readSyn(SimpleFile *file) {
 	CString str;
 	int mode, val1;
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 850b695..ad2ddeb 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -52,6 +52,11 @@ public:
 	TTword(TTString &str, int mode, int val2);
 
 	/**
+	 * Delete any following words chained to the word
+	 */
+	void deleteSiblings();
+
+	/**
 	 * Read in a synonym for the given word
 	 */
 	int readSyn(SimpleFile *file);


Commit: 4410c75599def09cfbb181268f5a894f1aa11b44
    https://github.com/scummvm/scummvm/commit/4410c75599def09cfbb181268f5a894f1aa11b44
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:22-04:00

Commit Message:
TITANIC: Rename STVocab to TTvocab to match original

Changed paths:
  A engines/titanic/true_talk/tt_vocab.cpp
  A engines/titanic/true_talk/tt_vocab.h
  R engines/titanic/true_talk/st_vocab.cpp
  R engines/titanic/true_talk/st_vocab.h
    engines/titanic/module.mk
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 47da6d4..cac64a5 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -459,7 +459,6 @@ MODULE_OBJS := \
 	true_talk/succubus_script.o \
 	true_talk/title_engine.o \
 	true_talk/script_handler.o \
-	true_talk/st_vocab.o \
 	true_talk/true_talk_manager.o \
 	true_talk/tt_script_base.o \
 	true_talk/tt_room_script.o \
@@ -470,6 +469,7 @@ MODULE_OBJS := \
 	true_talk/tt_synonym.o \
 	true_talk/tt_talker.o \
 	true_talk/tt_title_script.o \
+	true_talk/tt_vocab.o \
 	true_talk/tt_word.o
 
 # This module can be built as a plugin
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index d19c08a..d050c04 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -34,7 +34,7 @@ CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) :
 	g_vm->_scriptHandler = this;
 	g_vm->_script = _script;
 	g_vm->_exeResources.reset(this, val1, val2);
-	_vocab = new STVocab(val2);
+	_vocab = new TTvocab(val2);
 }
 
 CScriptHandler::~CScriptHandler() {
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 8449a72..80532a7 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -26,7 +26,7 @@
 #include "titanic/true_talk/tt_npc_script.h"
 #include "titanic/true_talk/tt_room_script.h"
 #include "titanic/true_talk/tt_string.h"
-#include "titanic/true_talk/st_vocab.h"
+#include "titanic/true_talk/tt_vocab.h"
 #include "titanic/support/exe_resources.h"
 
 namespace Titanic {
@@ -64,7 +64,7 @@ class CScriptHandler {
 private:
 	CTitleEngine *_owner;
 	TTScriptBase *_script;
-	STVocab *_vocab;
+	TTvocab *_vocab;
 	CExeResources &_resources;
 	int _field10;
 	CScriptHandlerSub1 _sub1;
diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
deleted file mode 100644
index 8ea2b53..0000000
--- a/engines/titanic/true_talk/st_vocab.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/file.h"
-#include "titanic/true_talk/st_vocab.h"
-#include "titanic/titanic.h"
-
-namespace Titanic {
-
-STVocab::STVocab(int val): _pHead(nullptr), _pTail(nullptr), _word(nullptr),
-		_fieldC(0), _field10(0), _field18(val) {
-	_field14 = load("STVOCAB.TXT");
-}
-
-STVocab::~STVocab() {
-	if (_pHead) {
-		_pHead->deleteSiblings();
-		delete _pHead;
-		_pHead = _pTail = nullptr;
-	}
-}
-
-int STVocab::load(const CString &name) {
-	SimpleFile *file = g_vm->_exeResources._owner->openResource(name);
-	int result = 0;
-	bool skipFlag;
-
-	while (!result && !file->eos()) {
-		skipFlag = false;
-		int mode = file->readNumber();
-		TTString space(" ");
-
-		switch (mode) {
-		case 0: {
-			if (_word)
-				result = _word->readSyn(file);
-			skipFlag = true;
-			break;
-		}
-
-		case 1: {
-			TTword2 *word = new TTword2(space, 0, 0, 0, 0);
-			result = word->load(file);
-			_word = word;
-			break;
-		}
-
-		case 2: {
-			TTword3 *word = new TTword3(space, 0, 0, 0, 0, 0, 0);
-			result = word->load(file);
-			_word = word;
-			break;
-		}
-
-		case 3:
-		case 9: {
-			TTword1 *word = new TTword1(space, 0, 0, 0);
-			result = word->load(file, mode);
-			_word = word;
-			break;
-		}
-
-		case 4:
-		case 5:
-		case 7: {
-			TTword *word = new TTword(space, 0, 0);
-			result = word->load(file, mode);
-			_word = word;
-			break;
-		}
-
-		case 8: {
-			TTword4 *word = new TTword4(space, 0, 0, 0, 0);
-			result = word->load(file);
-			_word = word;
-			break;
-		}
-
-		case 6: {
-			TTword5 *word = new TTword5(space, 0, 0, 0, 0);
-			result = word->load(file);
-			_word = word;
-			break;
-		}
-
-		default:
-			result = 4;
-			break;
-		}
-
-		if (!skipFlag && _word) {
-			if (result) {
-				// Something wrong occurred, so delete word
-				delete _word;
-				_word = nullptr;
-			} else {
-				// Add the word to the master vocab list
-				addWord(_word);
-			}
-		}
-	}
-
-	// Close resource and return result
-	delete file;
-	return result;
-}
-
-void STVocab::addWord(TTword *word) {
-	TTword *existingWord = findWord(word->_string);
-
-	if (existingWord) {
-		if (word->_synP) {
-			// Move over the synonym
-			existingWord->appendNode(word->_synP);
-			word->_synP = nullptr;
-		}
-
-		_word = nullptr;
-		if (word)
-			delete word;
-	} else if (_pTail) {
-		_pTail->_pNext = word;
-		_pTail = word;
-	} else {
-		if (!_pHead)
-			_pHead = word;
-
-		_pTail = word;
-	}
-}
-
-TTword *STVocab::findWord(const TTString &str) {
-	TTsynonym *tempNode = new TTsynonym();
-	bool flag = false;
-	TTword *word = _pHead;
-
-	while (word && !flag) {
-		if (_field18 != 3 || strcmp(word->c_str(), str)) {
-			if (word->scanCopy(str, tempNode, _field18))
-				flag = true;
-			else
-				word = word->_pNext;
-		} else {
-			flag = true;
-		}
-	}
-
-	delete tempNode;
-	return word;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/st_vocab.h b/engines/titanic/true_talk/st_vocab.h
deleted file mode 100644
index 6a86825..0000000
--- a/engines/titanic/true_talk/st_vocab.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_ST_VOCAB_H
-#define TITANIC_ST_VOCAB_H
-
-#include "titanic/support/string.h"
-#include "titanic/true_talk/tt_string.h"
-#include "titanic/true_talk/tt_word.h"
-
-namespace Titanic {
-
-class STVocab {
-private:
-	TTword *_pHead;
-	TTword *_pTail;
-	TTword *_word;
-	int _fieldC;
-	int _field10;
-	int _field14;
-	int _field18;
-private:
-	/**
-	 * Load the vocab data
-	 */
-	int load(const CString &name);
-
-	/**
-	 * Adds a specified word to the vocab list
-	 */
-	void addWord(TTword *word);
-
-	/**
-	 * Scans the vocab list for an existing word match
-	 */
-	TTword *findWord(const TTString &str);
-public:
-	STVocab(int val);
-	~STVocab();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_ST_VOCAB_H */
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
new file mode 100644
index 0000000..1bfd3df
--- /dev/null
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -0,0 +1,171 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/file.h"
+#include "titanic/true_talk/tt_vocab.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+TTvocab::TTvocab(int val): _pHead(nullptr), _pTail(nullptr), _word(nullptr),
+		_fieldC(0), _field10(0), _field18(val) {
+	_field14 = load("STVOCAB.TXT");
+}
+
+TTvocab::~TTvocab() {
+	if (_pHead) {
+		_pHead->deleteSiblings();
+		delete _pHead;
+		_pHead = _pTail = nullptr;
+	}
+}
+
+int TTvocab::load(const CString &name) {
+	SimpleFile *file = g_vm->_exeResources._owner->openResource(name);
+	int result = 0;
+	bool skipFlag;
+
+	while (!result && !file->eos()) {
+		skipFlag = false;
+		int mode = file->readNumber();
+		TTString space(" ");
+
+		switch (mode) {
+		case 0: {
+			if (_word)
+				result = _word->readSyn(file);
+			skipFlag = true;
+			break;
+		}
+
+		case 1: {
+			TTword2 *word = new TTword2(space, 0, 0, 0, 0);
+			result = word->load(file);
+			_word = word;
+			break;
+		}
+
+		case 2: {
+			TTword3 *word = new TTword3(space, 0, 0, 0, 0, 0, 0);
+			result = word->load(file);
+			_word = word;
+			break;
+		}
+
+		case 3:
+		case 9: {
+			TTword1 *word = new TTword1(space, 0, 0, 0);
+			result = word->load(file, mode);
+			_word = word;
+			break;
+		}
+
+		case 4:
+		case 5:
+		case 7: {
+			TTword *word = new TTword(space, 0, 0);
+			result = word->load(file, mode);
+			_word = word;
+			break;
+		}
+
+		case 8: {
+			TTword4 *word = new TTword4(space, 0, 0, 0, 0);
+			result = word->load(file);
+			_word = word;
+			break;
+		}
+
+		case 6: {
+			TTword5 *word = new TTword5(space, 0, 0, 0, 0);
+			result = word->load(file);
+			_word = word;
+			break;
+		}
+
+		default:
+			result = 4;
+			break;
+		}
+
+		if (!skipFlag && _word) {
+			if (result) {
+				// Something wrong occurred, so delete word
+				delete _word;
+				_word = nullptr;
+			} else {
+				// Add the word to the master vocab list
+				addWord(_word);
+			}
+		}
+	}
+
+	// Close resource and return result
+	delete file;
+	return result;
+}
+
+void TTvocab::addWord(TTword *word) {
+	TTword *existingWord = findWord(word->_string);
+
+	if (existingWord) {
+		if (word->_synP) {
+			// Move over the synonym
+			existingWord->appendNode(word->_synP);
+			word->_synP = nullptr;
+		}
+
+		_word = nullptr;
+		if (word)
+			delete word;
+	} else if (_pTail) {
+		_pTail->_pNext = word;
+		_pTail = word;
+	} else {
+		if (!_pHead)
+			_pHead = word;
+
+		_pTail = word;
+	}
+}
+
+TTword *TTvocab::findWord(const TTString &str) {
+	TTsynonym *tempNode = new TTsynonym();
+	bool flag = false;
+	TTword *word = _pHead;
+
+	while (word && !flag) {
+		if (_field18 != 3 || strcmp(word->c_str(), str)) {
+			if (word->scanCopy(str, tempNode, _field18))
+				flag = true;
+			else
+				word = word->_pNext;
+		} else {
+			flag = true;
+		}
+	}
+
+	delete tempNode;
+	return word;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
new file mode 100644
index 0000000..d4dbda0
--- /dev/null
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ST_VOCAB_H
+#define TITANIC_ST_VOCAB_H
+
+#include "titanic/support/string.h"
+#include "titanic/true_talk/tt_string.h"
+#include "titanic/true_talk/tt_word.h"
+
+namespace Titanic {
+
+class TTvocab {
+private:
+	TTword *_pHead;
+	TTword *_pTail;
+	TTword *_word;
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+private:
+	/**
+	 * Load the vocab data
+	 */
+	int load(const CString &name);
+
+	/**
+	 * Adds a specified word to the vocab list
+	 */
+	void addWord(TTword *word);
+
+	/**
+	 * Scans the vocab list for an existing word match
+	 */
+	TTword *findWord(const TTString &str);
+public:
+	TTvocab(int val);
+	~TTvocab();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ST_VOCAB_H */


Commit: 7b71462046155e2927bd1f76634ea9b5bf45d381
    https://github.com/scummvm/scummvm/commit/7b71462046155e2927bd1f76634ea9b5bf45d381
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:23-04:00

Commit Message:
TITANIC: Implementing virtual methods for TTword

Changed paths:
    engines/titanic/support/exe_resources.h
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_string_node.cpp
    engines/titanic/true_talk/tt_string_node.h
    engines/titanic/true_talk/tt_synonym.cpp
    engines/titanic/true_talk/tt_synonym.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_vocab.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/support/exe_resources.h b/engines/titanic/support/exe_resources.h
index 48b48d4..bb76062 100644
--- a/engines/titanic/support/exe_resources.h
+++ b/engines/titanic/support/exe_resources.h
@@ -29,6 +29,8 @@ namespace Titanic {
 
 class CScriptHandler;
 
+enum FileHandle { HANDLE_STDIN = 0, HANDLE_STDOUT = 1, HANDLE_STDERR = 2 };
+
 class CExeResources {
 public:
 	CScriptHandler *_owner;
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 80532a7..73ddb7b 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -91,6 +91,8 @@ public:
 	 * Open a resource for access
 	 */
 	SimpleFile *openResource(const CString &name);
+
+
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 7d231b1..9cb92cf 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -63,8 +63,20 @@ public:
 	 */
 	TTStringStatus getStatus() const { return _status; }
 
+	/**
+	 * Get a char * pointer to the string data
+	 */
 	const char *c_str() const { return _data->_string.c_str(); }
+	
+	/**
+	 * Automatic operator to convert to a const char *
+	 */
 	operator const char *() const { return c_str(); }
+
+	/**
+	 * Get a character at a specified index
+	 */
+	char charAt(int index) const { return *(c_str() + index); }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string_node.cpp b/engines/titanic/true_talk/tt_string_node.cpp
index cf01ac6..d125d32 100644
--- a/engines/titanic/true_talk/tt_string_node.cpp
+++ b/engines/titanic/true_talk/tt_string_node.cpp
@@ -26,7 +26,7 @@
 namespace Titanic {
 
 TTstringNode::TTstringNode() : _pPrior(nullptr), _pNext(nullptr),
-		_field14(0), _mode(0), _field1C(0) {
+		_file(HANDLE_STDIN), _mode(0), _field1C(0) {
 }
 
 TTstringNode::~TTstringNode() {
@@ -35,7 +35,7 @@ TTstringNode::~TTstringNode() {
 
 void TTstringNode::initialize(int mode) {
 	_mode = mode;
-	_field14 = 0;
+	_file = HANDLE_STDIN;
 
 	if (_string.isValid()) {
 		_field1C = 0;
@@ -47,7 +47,7 @@ void TTstringNode::initialize(int mode) {
 
 void TTstringNode::initialize(TTstringNode *oldNode) {
 	_mode = oldNode->_mode;
-	_field14 = oldNode->_field14;
+	_file = oldNode->_file;
 
 	if (_string.isValid()) {
 		_field1C = 0;
diff --git a/engines/titanic/true_talk/tt_string_node.h b/engines/titanic/true_talk/tt_string_node.h
index dddef8d..6994a0d 100644
--- a/engines/titanic/true_talk/tt_string_node.h
+++ b/engines/titanic/true_talk/tt_string_node.h
@@ -24,6 +24,7 @@
 #define TITANIC_TT_STRING_NODE_H
 
 #include "titanic/true_talk/tt_string.h"
+#include "titanic/support/exe_resources.h"
 
 namespace Titanic {
 
@@ -47,7 +48,7 @@ public:
 	TTstringNode *_pPrior;
 	TTstringNode *_pNext;
 	TTString _string;
-	int _field14;
+	FileHandle _file;
 	int _mode;
 	int _field1C;
 public:
diff --git a/engines/titanic/true_talk/tt_synonym.cpp b/engines/titanic/true_talk/tt_synonym.cpp
index 5da124a..ea45f2e 100644
--- a/engines/titanic/true_talk/tt_synonym.cpp
+++ b/engines/titanic/true_talk/tt_synonym.cpp
@@ -30,14 +30,14 @@ TTsynonym::TTsynonym() : TTstringNode() {
 TTsynonym::TTsynonym(const TTstringNode *src) {
 	_string = src->_string;
 	initialize(src->_mode);
-	_field14 = src->_field14;
+	_file = src->_file;
 }
 
-TTsynonym::TTsynonym(int mode, const char *str, int val2) :
+TTsynonym::TTsynonym(int mode, const char *str, FileHandle file) :
 		TTstringNode() {
 	_string = str;
 	initialize(mode);
-	_field14 = val2;
+	_file = file;
 }
 
 TTsynonym *TTsynonym::findByName(TTsynonym *start, const TTString &str, int mode) {
diff --git a/engines/titanic/true_talk/tt_synonym.h b/engines/titanic/true_talk/tt_synonym.h
index 6a20ef3..20f63ac 100644
--- a/engines/titanic/true_talk/tt_synonym.h
+++ b/engines/titanic/true_talk/tt_synonym.h
@@ -31,8 +31,11 @@ class TTsynonym : public TTstringNode {
 public:
 	TTsynonym();
 	TTsynonym(const TTstringNode *src);
-	TTsynonym(int mode, const char *str, int val2);
+	TTsynonym(int mode, const char *str, FileHandle file);
 
+	/**
+	 * Copy the synonym
+	 */
 	TTsynonym *copy(TTstringNode *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 1bfd3df..1499573 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -168,4 +168,33 @@ TTword *TTvocab::findWord(const TTString &str) {
 	return word;
 }
 
+TTword *TTvocab::getPrimeWord(TTString &str, TTword **words) {
+	TTsynonym *synonym = new TTsynonym();
+	char c = str.charAt(0);
+	TTword *vocabList = _pHead;
+	TTword *returnWord = nullptr;
+
+	if (!Common::isDigit(c)) {
+		returnWord = new TTword(str, 3, 300);
+	} else if (!vocabList) {
+		// No vocab present. Should never happen
+	} else {
+		TTword *foundWord = nullptr;
+		while (!foundWord && vocabList) {
+			if (_field18 == 3 && !strcmp(str.c_str(), vocabList->c_str())) {
+
+			}
+		}
+
+		// TODO
+
+	}
+
+	if (words)
+		*words = vocabList;
+	delete synonym;
+	
+	return returnWord;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
index d4dbda0..b7e9486 100644
--- a/engines/titanic/true_talk/tt_vocab.h
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -56,6 +56,8 @@ private:
 public:
 	TTvocab(int val);
 	~TTvocab();
+
+	TTword *getPrimeWord(TTString &str, TTword **words);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index b7309b2..80fc611 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -32,6 +32,10 @@ TTword::TTword(TTString &str, int mode, int val2) : _string(str),
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
 }
 
+TTword::TTword(TTword *src) {
+	// TODO
+}
+
 void TTword::deleteSiblings() {
 	while (_pNext) {
 		TTword *next = _pNext;
@@ -50,7 +54,7 @@ int TTword::readSyn(SimpleFile *file) {
 		return 5;
 
 	// Create new synanym node
-	TTsynonym *synNode = new TTsynonym(mode, str.c_str(), val1);
+	TTsynonym *synNode = new TTsynonym(mode, str.c_str(), (FileHandle)val1);
 
 	if (_synP) {
 		// A synonym already exists, so add new one as a tail
@@ -99,7 +103,7 @@ uint TTword::readNumber(const char *str) {
 	return numValue;
 }
 
-bool TTword::testFileHandle(SimpleFile *file) const {
+bool TTword::testFileHandle(FileHandle file) const {
 	if (g_vm->_exeResources.is18Equals(3))
 		return true;
 
@@ -120,6 +124,24 @@ TTword *TTword::scanCopy(const TTString &str, TTsynonym *node, int mode) {
 	return nullptr;
 }
 
+TTword *TTword::copy() {
+	return new TTword(this);
+}
+
+FileHandle TTword::getSynFile() const {
+	return _synP ? _synP->_file : HANDLE_STDIN;
+}
+
+bool TTword::checkSynFile(FileHandle file) const {
+	return _synP && _synP->_file == file;
+}
+
+void TTword::setSynFile(FileHandle file) {
+	if (_synP && testFileHandle(file))
+		_synP->_file = file;
+}
+
+
 /*------------------------------------------------------------------------*/
 
 TTword1::TTword1(TTString &str, int val1, int val2, int val3) :
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index ad2ddeb..d1de411 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -43,13 +43,15 @@ protected:
 	 */
 	uint readNumber(const char *str);
 
-	bool testFileHandle(SimpleFile *file) const;
+	bool testFileHandle(SimpleFile *file) const { return true; }
+	bool testFileHandle(FileHandle resHandle) const;
 public:
 	TTword *_pNext;
 	TTsynonym *_synP;
 	TTString _string;
 public:
 	TTword(TTString &str, int mode, int val2);
+	TTword(TTword *src);
 
 	/**
 	 * Delete any following words chained to the word
@@ -75,6 +77,45 @@ public:
 
 	const char *c_str() const { return _string.c_str(); }
 	operator const char *() const { return c_str(); }
+
+	virtual TTword *copy();
+	virtual int proc2() const { return 0; }
+	virtual int proc3() const { return -1; }
+	virtual void proc4() {}
+	virtual void proc5() {}
+	virtual int proc6() const { return 0; }
+	virtual int proc7() const { return 0; }
+	virtual int proc8() const { return 0; }
+	virtual int proc9() const { return 0; }
+	virtual int proc10() const { return 0; }
+	virtual void proc11() {}
+	virtual int proc12() const { return 0; }
+	virtual int proc13() const { return 0; }
+	virtual int proc14() const { return 0; }
+	virtual int proc15() const { return -1; }
+	virtual int proc16() const { return 0; }
+	virtual int proc17() const { return 0; }
+	virtual int proc18() const { return 0; }
+	virtual int proc19() const { return 0; }
+	virtual int proc20() const { return 0; }
+
+	/**
+	 * Returns the file associated with the word's first synonym
+	 */
+	virtual FileHandle getSynFile() const;
+
+	/**
+	 * Checks whether the file associated with the word's first
+	 * synonym matches the specified file
+	 */
+	virtual bool checkSynFile(FileHandle file) const;
+
+	/**
+	 * Sets the file associated with a synonym
+	 */
+	virtual void setSynFile(FileHandle file);
+
+	virtual int proc24() const { return 0; }
 };
 
 class TTword1 : public TTword {


Commit: ae5cd8d8dda5b66a82d33b4164c06b3313522e10
    https://github.com/scummvm/scummvm/commit/ae5cd8d8dda5b66a82d33b4164c06b3313522e10
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:24-04:00

Commit Message:
TITANIC: Fix TTstringNode pointers to TTsynonym

Changed paths:
    engines/titanic/true_talk/tt_synonym.cpp
    engines/titanic/true_talk/tt_synonym.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_synonym.cpp b/engines/titanic/true_talk/tt_synonym.cpp
index ea45f2e..3ce3b12 100644
--- a/engines/titanic/true_talk/tt_synonym.cpp
+++ b/engines/titanic/true_talk/tt_synonym.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 TTsynonym::TTsynonym() : TTstringNode() {
 }
 
-TTsynonym::TTsynonym(const TTstringNode *src) {
+TTsynonym::TTsynonym(const TTsynonym *src) {
 	_string = src->_string;
 	initialize(src->_mode);
 	_file = src->_file;
@@ -51,7 +51,7 @@ TTsynonym *TTsynonym::findByName(TTsynonym *start, const TTString &str, int mode
 	return nullptr;
 }
 
-TTsynonym *TTsynonym::copy(TTstringNode *src) {
+TTsynonym *TTsynonym::copy(TTsynonym *src) {
 	if (src->_field1C) {
 		_field1C = 5;
 		return this;
diff --git a/engines/titanic/true_talk/tt_synonym.h b/engines/titanic/true_talk/tt_synonym.h
index 20f63ac..b661c16 100644
--- a/engines/titanic/true_talk/tt_synonym.h
+++ b/engines/titanic/true_talk/tt_synonym.h
@@ -30,13 +30,13 @@ namespace Titanic {
 class TTsynonym : public TTstringNode {
 public:
 	TTsynonym();
-	TTsynonym(const TTstringNode *src);
+	TTsynonym(const TTsynonym *src);
 	TTsynonym(int mode, const char *str, FileHandle file);
 
 	/**
 	 * Copy the synonym
 	 */
-	TTsynonym *copy(TTstringNode *src);
+	TTsynonym *copy(TTsynonym *src);
 
 	/**
 	 * Scan for a synonym with a given string
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 80fc611..55de72b 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -113,7 +113,7 @@ bool TTword::testFileHandle(FileHandle file) const {
 
 TTword *TTword::scanCopy(const TTString &str, TTsynonym *node, int mode) {
 	if (_synP) {
-		TTstringNode *strNode = TTsynonym::findByName(_synP, str, mode);
+		TTsynonym *strNode = TTsynonym::findByName(_synP, str, mode);
 		if (strNode) {
 			node->copy(strNode);
 			node->_pPrior = nullptr;
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index d1de411..9bdb810 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -78,7 +78,11 @@ public:
 	const char *c_str() const { return _string.c_str(); }
 	operator const char *() const { return c_str(); }
 
+	/**
+	 * Creates a copy of the word
+	 */
 	virtual TTword *copy();
+	
 	virtual int proc2() const { return 0; }
 	virtual int proc3() const { return -1; }
 	virtual void proc4() {}


Commit: 06876335cd027529b3719cdfc6d255b00a592b02
    https://github.com/scummvm/scummvm/commit/06876335cd027529b3719cdfc6d255b00a592b02
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:25-04:00

Commit Message:
TITANIC: Implement TTword copy

Changed paths:
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 55de72b..4d4f968 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -33,7 +33,39 @@ TTword::TTword(TTString &str, int mode, int val2) : _string(str),
 }
 
 TTword::TTword(TTword *src) {
-	// TODO
+	if (src->getStatus() != SS_VALID) {
+		_status = SS_5;
+		return;
+	}
+
+	_string = src->_string;
+	_wordMode = src->_wordMode;
+	_field1C = src->_field1C;
+	_field20 = src->_field20;
+	_synP = nullptr;
+
+	TTsynonym *priorSyn = nullptr;
+	for (TTsynonym *synP = _synP; synP && !_status;) {
+		TTsynonym *newSyn = new TTsynonym(synP);
+		if (!newSyn) {
+			_status = SS_7;
+		} else {
+			newSyn->_pPrior = priorSyn;
+			newSyn->_pNext = nullptr;
+
+			if (priorSyn) {
+				priorSyn->_pNext = newSyn;
+			} else {
+				_synP = newSyn;
+			}
+
+			priorSyn = newSyn;
+		}
+	}
+
+	_pNext = src->_pNext;
+	_field24 = src->_field24;
+	_field28 = src->_field28;
 }
 
 void TTword::deleteSiblings() {
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 9bdb810..d912751 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -79,6 +79,11 @@ public:
 	operator const char *() const { return c_str(); }
 
 	/**
+	 * Return the status of the word
+	 */
+	TTStringStatus getStatus() const { return _status; }
+
+	/**
 	 * Creates a copy of the word
 	 */
 	virtual TTword *copy();


Commit: e8971dd106fa28fe1d4ef8e00ee34ec623a746c9
    https://github.com/scummvm/scummvm/commit/e8971dd106fa28fe1d4ef8e00ee34ec623a746c9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:26-04:00

Commit Message:
TITANIC: Rename CScriptHandlerSub2 to TTparser

Changed paths:
  A engines/titanic/true_talk/tt_parser.cpp
  A engines/titanic/true_talk/tt_parser.h
    engines/titanic/module.mk
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index cac64a5..51ebdbb 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -463,6 +463,7 @@ MODULE_OBJS := \
 	true_talk/tt_script_base.o \
 	true_talk/tt_room_script.o \
 	true_talk/tt_npc_script.o \
+	true_talk/tt_parser.o \
 	true_talk/tt_scripts.o \
 	true_talk/tt_string.o \
 	true_talk/tt_string_node.o \
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index d050c04..65ec600 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -29,7 +29,7 @@ namespace Titanic {
 
 CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) :
 		_owner(owner), _script(owner->_script), _resources(g_vm->_exeResources),
-		_sub1(), _sub2(this), _field10(0), _inputCtr(0), 
+		_sub1(), _parser(this), _field10(0), _inputCtr(0), 
 		_field20(0), _field24(0), _field28(0), _field2C(0), _field30(0) {
 	g_vm->_scriptHandler = this;
 	g_vm->_script = _script;
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 73ddb7b..7692959 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -24,6 +24,7 @@
 #define TITANIC_SCRIPT_HANDLER_H
 
 #include "titanic/true_talk/tt_npc_script.h"
+#include "titanic/true_talk/tt_parser.h"
 #include "titanic/true_talk/tt_room_script.h"
 #include "titanic/true_talk/tt_string.h"
 #include "titanic/true_talk/tt_vocab.h"
@@ -46,20 +47,6 @@ public:
 		_fieldC(0), _field10(0) {}
 };
 
-class CScriptHandlerSub2 {
-public:
-	CScriptHandler *_owner;
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
-	int _field14;
-	int _field18;
-public:
-	CScriptHandlerSub2(CScriptHandler *owner) : _owner(owner), _field4(0), _field8(0),
-		_fieldC(0), _field10(0), _field14(0), _field18(0) {}
-};
-
 class CScriptHandler {
 private:
 	CTitleEngine *_owner;
@@ -68,7 +55,7 @@ private:
 	CExeResources &_resources;
 	int _field10;
 	CScriptHandlerSub1 _sub1;
-	CScriptHandlerSub2 _sub2;
+	TTparser _parser;
 	int _inputCtr;
 	int _field20;
 	int _field24;
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
new file mode 100644
index 0000000..ad40cbc
--- /dev/null
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_parser.h"
+#include "titanic/true_talk/script_handler.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
new file mode 100644
index 0000000..767406a
--- /dev/null
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_PARSER_H
+#define TITANIC_TT_PARSER_H
+
+namespace Titanic {
+
+class CScriptHandler;
+
+class TTparser {
+public:
+	CScriptHandler *_owner;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+public:
+	TTparser(CScriptHandler *owner) : _owner(owner), _field4(0), _field8(0),
+		_fieldC(0), _field10(0), _field14(0), _field18(0) {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_PARSER_H */


Commit: d649157c5b1afae1ff6a9a565575c1eddcc880fa
    https://github.com/scummvm/scummvm/commit/d649157c5b1afae1ff6a9a565575c1eddcc880fa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:28-04:00

Commit Message:
TITANIC: Figured out original class names for TTword descendents

Changed paths:
  A engines/titanic/true_talk/tt_action.cpp
  A engines/titanic/true_talk/tt_action.h
  A engines/titanic/true_talk/tt_adj.cpp
  A engines/titanic/true_talk/tt_adj.h
  A engines/titanic/true_talk/tt_major_word.cpp
  A engines/titanic/true_talk/tt_major_word.h
  A engines/titanic/true_talk/tt_picture.cpp
  A engines/titanic/true_talk/tt_picture.h
  A engines/titanic/true_talk/tt_pronoun.cpp
  A engines/titanic/true_talk/tt_pronoun.h
    engines/titanic/module.mk
    engines/titanic/support/simple_file.cpp
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 51ebdbb..d52dc56 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -460,10 +460,15 @@ MODULE_OBJS := \
 	true_talk/title_engine.o \
 	true_talk/script_handler.o \
 	true_talk/true_talk_manager.o \
-	true_talk/tt_script_base.o \
-	true_talk/tt_room_script.o \
+	true_talk/tt_action.o \
+	true_talk/tt_adj.o \
+	true_talk/tt_major_word.o \
 	true_talk/tt_npc_script.o \
 	true_talk/tt_parser.o \
+	true_talk/tt_picture.o \
+	true_talk/tt_pronoun.o \
+	true_talk/tt_room_script.o \
+	true_talk/tt_script_base.o \
 	true_talk/tt_scripts.o \
 	true_talk/tt_string.o \
 	true_talk/tt_string_node.o \
diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp
index 80f5178..61d941b 100644
--- a/engines/titanic/support/simple_file.cpp
+++ b/engines/titanic/support/simple_file.cpp
@@ -399,7 +399,7 @@ bool SimpleFile::scanf(const char *format, ...) {
 
 	skipSpaces();
 	va_end(va);
-	return !eos();
+	return true;
 }
 
 void SimpleFile::skipSpaces() {
diff --git a/engines/titanic/true_talk/tt_action.cpp b/engines/titanic/true_talk/tt_action.cpp
new file mode 100644
index 0000000..3caca5d
--- /dev/null
+++ b/engines/titanic/true_talk/tt_action.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_action.h"
+
+namespace Titanic {
+
+TTaction::TTaction(TTString &str, int val1, int val2, int val3, int val4) :
+		TTmajorWord(str, val1, val2, val3), _field30(val4) {
+}
+
+int TTaction::load(SimpleFile *file) {
+	int val;
+
+	if (!TTword::load(file, 1) && file->scanf("%d", &val)) {
+		_field30 = val;
+		return 0;
+	} else {
+		return 8;
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_action.h b/engines/titanic/true_talk/tt_action.h
new file mode 100644
index 0000000..3c27067
--- /dev/null
+++ b/engines/titanic/true_talk/tt_action.h
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_ACTION_H
+#define TITANIC_TT_ACTION_H
+
+#include "titanic/true_talk/tt_major_word.h"
+
+namespace Titanic {
+
+class TTaction : public TTmajorWord {
+protected:
+	int _field30;
+public:
+	TTaction(TTString &str, int val1, int val2, int val3, int val4);
+
+	/**
+	 * Load the word
+	 */
+	int load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_ACTION_H */
diff --git a/engines/titanic/true_talk/tt_adj.cpp b/engines/titanic/true_talk/tt_adj.cpp
new file mode 100644
index 0000000..8ee35e2
--- /dev/null
+++ b/engines/titanic/true_talk/tt_adj.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_adj.h"
+
+namespace Titanic {
+
+TTadj::TTadj(TTString &str, int val1, int val2, int val3, int val4) :
+		TTmajorWord(str, val1, val2, val3) {
+	if (val4 >= 0 && val4 <= 9) {
+		_field30 = val4;
+	} else {
+		_field30 = 0;
+		_status = SS_5;
+	}
+}
+
+int TTadj::load(SimpleFile *file) {
+	int val;
+
+	if (!TTword::load(file, 8) && file->scanf("%d", &val)) {
+		_field30 = val;
+		return 0;
+	} else {
+		return 8;
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_adj.h b/engines/titanic/true_talk/tt_adj.h
new file mode 100644
index 0000000..a0bb340
--- /dev/null
+++ b/engines/titanic/true_talk/tt_adj.h
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_ADJ_H
+#define TITANIC_TT_ADJ_H
+
+#include "titanic/true_talk/tt_major_word.h"
+
+namespace Titanic {
+
+class TTadj : public TTmajorWord {
+protected:
+	int _field30;
+public:
+	TTadj(TTString &str, int val1, int val2, int val3, int val4);
+
+	/**
+	 * Load the word
+	 */
+	int load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_ADJ_H */
diff --git a/engines/titanic/true_talk/tt_major_word.cpp b/engines/titanic/true_talk/tt_major_word.cpp
new file mode 100644
index 0000000..6df761b
--- /dev/null
+++ b/engines/titanic/true_talk/tt_major_word.cpp
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_major_word.h"
+
+namespace Titanic {
+
+TTmajorWord::TTmajorWord(TTString &str, int val1, int val2, int val3) :
+		TTword(str, val1, val2), _field2C(val3) {
+}
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_major_word.h b/engines/titanic/true_talk/tt_major_word.h
new file mode 100644
index 0000000..487c2a5
--- /dev/null
+++ b/engines/titanic/true_talk/tt_major_word.h
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_MAJOR_WORD_H
+#define TITANIC_TT_MAJOR_WORD_H
+
+#include "titanic/true_talk/tt_word.h"
+
+namespace Titanic {
+
+class TTmajorWord : public TTword {
+protected:
+	int _field2C;
+public:
+	TTmajorWord(TTString &str, int val1, int val2, int val3);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_MAJOR_WORD_H */
diff --git a/engines/titanic/true_talk/tt_picture.cpp b/engines/titanic/true_talk/tt_picture.cpp
new file mode 100644
index 0000000..21574df
--- /dev/null
+++ b/engines/titanic/true_talk/tt_picture.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_picture.h"
+
+namespace Titanic {
+
+TTpicture::TTpicture(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6) :
+		TTmajorWord(str, val1, val2, val4), _field34(val3), _field30(val5), _field3C(val6),
+		_field38(0) {
+}
+
+int TTpicture::load(SimpleFile *file) {
+	CString str;
+	int val1, val2;
+
+	if (!TTword::load(file, 2) && file->scanf("%s %d %d", &str, &val1, &val2)) {
+		_field34 = readNumber(str.c_str());
+		_field30 = val1;
+		_field3C = val2;
+		return 0;
+	} else {
+		return 3;
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_picture.h b/engines/titanic/true_talk/tt_picture.h
new file mode 100644
index 0000000..93f9536
--- /dev/null
+++ b/engines/titanic/true_talk/tt_picture.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_PICTURE_H
+#define TITANIC_TT_PICTURE_H
+
+#include "titanic/true_talk/tt_major_word.h"
+
+namespace Titanic {
+
+class TTpicture : public TTmajorWord {
+protected:
+	int _field30;
+	int _field34;
+	int _field38;
+	int _field3C;
+public:
+	TTpicture(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6);
+
+	/**
+	 * Load the word
+	 */
+	int load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_PICTURE_H */
diff --git a/engines/titanic/true_talk/tt_pronoun.cpp b/engines/titanic/true_talk/tt_pronoun.cpp
new file mode 100644
index 0000000..b0e3527
--- /dev/null
+++ b/engines/titanic/true_talk/tt_pronoun.cpp
@@ -0,0 +1,46 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_pronoun.h"
+
+namespace Titanic {
+
+TTpronoun::TTpronoun(TTString &str, int val1, int val2, int val3, int val4) :
+		TTmajorWord(str, val1, val2, val3), _field30(val4) {
+}
+
+int TTpronoun::load(SimpleFile *file) {
+	int val;
+
+	if (!TTword::load(file, 6) && file->scanf("%d", &val)) {
+		if (val >= 0 && val <= 12) {
+			_field30 = val;
+			return 0;
+		} else {
+			return 5;
+		}
+	} else {
+		return 8;
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_pronoun.h b/engines/titanic/true_talk/tt_pronoun.h
new file mode 100644
index 0000000..991c0b3
--- /dev/null
+++ b/engines/titanic/true_talk/tt_pronoun.h
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_PRONOUN_H
+#define TITANIC_TT_PRONOUN_H
+
+#include "titanic/true_talk/tt_major_word.h"
+
+namespace Titanic {
+
+class TTpronoun : public TTmajorWord {
+protected:
+	int _field30;
+public:
+	TTpronoun(TTString &str, int val1, int val2, int val3, int val4);
+
+	/**
+	 * Load the word
+	 */
+	int load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_WORD_H */
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 1499573..1826a43 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -22,6 +22,12 @@
 
 #include "common/file.h"
 #include "titanic/true_talk/tt_vocab.h"
+#include "titanic/true_talk/tt_adj.h"
+#include "titanic/true_talk/tt_action.h"
+#include "titanic/true_talk/tt_adj.h"
+#include "titanic/true_talk/tt_major_word.h"
+#include "titanic/true_talk/tt_picture.h"
+#include "titanic/true_talk/tt_pronoun.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
@@ -58,14 +64,14 @@ int TTvocab::load(const CString &name) {
 		}
 
 		case 1: {
-			TTword2 *word = new TTword2(space, 0, 0, 0, 0);
+			TTaction *word = new TTaction(space, 0, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
 		}
 
 		case 2: {
-			TTword3 *word = new TTword3(space, 0, 0, 0, 0, 0, 0);
+			TTpicture *word = new TTpicture(space, 0, 0, 0, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
@@ -73,7 +79,7 @@ int TTvocab::load(const CString &name) {
 
 		case 3:
 		case 9: {
-			TTword1 *word = new TTword1(space, 0, 0, 0);
+			TTmajorWord *word = new TTmajorWord(space, 0, 0, 0);
 			result = word->load(file, mode);
 			_word = word;
 			break;
@@ -89,14 +95,14 @@ int TTvocab::load(const CString &name) {
 		}
 
 		case 8: {
-			TTword4 *word = new TTword4(space, 0, 0, 0, 0);
+			TTadj *word = new TTadj(space, 0, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
 		}
 
 		case 6: {
-			TTword5 *word = new TTword5(space, 0, 0, 0, 0);
+			TTpronoun *word = new TTpronoun(space, 0, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 4d4f968..ea68b34 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -173,93 +173,4 @@ void TTword::setSynFile(FileHandle file) {
 		_synP->_file = file;
 }
 
-
-/*------------------------------------------------------------------------*/
-
-TTword1::TTword1(TTString &str, int val1, int val2, int val3) :
-		TTword(str, val1, val2), _field2C(val3) {
-}
-
-/*------------------------------------------------------------------------*/
-
-TTword2::TTword2(TTString &str, int val1, int val2, int val3, int val4) :
-		TTword1(str, val1, val2, val3), _field30(val4) {
-}
-
-int TTword2::load(SimpleFile *file) {
-	int val;
-
-	if (!TTword::load(file, 1) && file->scanf("%d", &val)) {
-		_field30 = val;
-		return 0;
-	} else {
-		return 8;
-	}
-}
-
-/*------------------------------------------------------------------------*/
-
-TTword3::TTword3(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6) :
-		TTword1(str, val1, val2, val4), _field34(val3), _field30(val5), _field3C(val6),
-		_field38(0) {
-}
-
-int TTword3::load(SimpleFile *file) {
-	CString str;
-	int val1, val2;
-
-	if (!TTword::load(file, 2) && file->scanf("%s %d %d", &str, &val1, &val2)) {
-		_field34 = readNumber(str.c_str());
-		_field30 = val1;
-		_field3C = val2;
-		return 0;
-	} else {
-		return 3;
-	}
-}
-
-/*------------------------------------------------------------------------*/
-
-TTword4::TTword4(TTString &str, int val1, int val2, int val3, int val4) :
-		TTword1(str, val1, val2, val3) {
-	if (val4 >= 0 && val4 <= 9) {
-		_field30 = val4;
-	} else {
-		_field30 = 0;
-		_status = SS_5;
-	}
-}
-
-int TTword4::load(SimpleFile *file) {
-	int val;
-
-	if (!TTword::load(file, 8) && file->scanf("%d", &val)) {
-		_field30 = val;
-		return 0;
-	} else {
-		return 8;
-	}
-}
-
-/*------------------------------------------------------------------------*/
-
-TTword5::TTword5(TTString &str, int val1, int val2, int val3, int val4) :
-	TTword1(str, val1, val2, val3), _field30(val4) {
-}
-
-int TTword5::load(SimpleFile *file) {
-	int val;
-
-	if (!TTword::load(file, 6) && file->scanf("%d", &val)) {
-		if (val >= 0 && val <= 12) {
-			_field30 = val;
-			return 0;
-		} else {
-			return 5;
-		}
-	} else {
-		return 8;
-	}
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index d912751..3d9001b 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -127,64 +127,6 @@ public:
 	virtual int proc24() const { return 0; }
 };
 
-class TTword1 : public TTword {
-protected:
-	int _field2C;
-public:
-	TTword1(TTString &str, int val1, int val2, int val3);
-};
-
-class TTword2 : public TTword1 {
-protected:
-	int _field30;
-public:
-	TTword2(TTString &str, int val1, int val2, int val3, int val4);
-
-	/**
-	 * Load the word
-	 */
-	int load(SimpleFile *file);
-};
-
-class TTword3 : public TTword1 {
-protected:
-	int _field30;
-	int _field34;
-	int _field38;
-	int _field3C;
-public:
-	TTword3(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6);
-
-	/**
-	 * Load the word
-	 */
-	int load(SimpleFile *file);
-};
-
-class TTword4 : public TTword1 {
-protected:
-	int _field30;
-public:
-	TTword4(TTString &str, int val1, int val2, int val3, int val4);
-
-	/**
-	 * Load the word
-	 */
-	int load(SimpleFile *file);
-};
-
-class TTword5 : public TTword1 {
-protected:
-	int _field30;
-public:
-	TTword5(TTString &str, int val1, int val2, int val3, int val4);
-
-	/**
-	 * Load the word
-	 */
-	int load(SimpleFile *file);
-};
-
 } // End of namespace Titanic
 
 #endif /* TITANIC_TT_WORD_H */


Commit: f114ca6c26f4e77a40126b2ebd9c74c042e72875
    https://github.com/scummvm/scummvm/commit/f114ca6c26f4e77a40126b2ebd9c74c042e72875
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:29-04:00

Commit Message:
TITANIC: More TTword subclass constructors

Changed paths:
    engines/titanic/true_talk/tt_action.cpp
    engines/titanic/true_talk/tt_action.h
    engines/titanic/true_talk/tt_adj.cpp
    engines/titanic/true_talk/tt_adj.h
    engines/titanic/true_talk/tt_major_word.cpp
    engines/titanic/true_talk/tt_major_word.h
    engines/titanic/true_talk/tt_picture.cpp
    engines/titanic/true_talk/tt_picture.h
    engines/titanic/true_talk/tt_pronoun.cpp
    engines/titanic/true_talk/tt_pronoun.h



diff --git a/engines/titanic/true_talk/tt_action.cpp b/engines/titanic/true_talk/tt_action.cpp
index 3caca5d..5f55224 100644
--- a/engines/titanic/true_talk/tt_action.cpp
+++ b/engines/titanic/true_talk/tt_action.cpp
@@ -28,6 +28,15 @@ TTaction::TTaction(TTString &str, int val1, int val2, int val3, int val4) :
 		TTmajorWord(str, val1, val2, val3), _field30(val4) {
 }
 
+TTaction::TTaction(TTaction *src) : TTmajorWord(src) {
+	if (src->getStatus()) {
+		_field30 = 0;
+		_status = SS_5;
+	} else {
+		_field30 = src->_field30;
+	}
+}
+
 int TTaction::load(SimpleFile *file) {
 	int val;
 
diff --git a/engines/titanic/true_talk/tt_action.h b/engines/titanic/true_talk/tt_action.h
index 3c27067..821d16b 100644
--- a/engines/titanic/true_talk/tt_action.h
+++ b/engines/titanic/true_talk/tt_action.h
@@ -32,6 +32,7 @@ protected:
 	int _field30;
 public:
 	TTaction(TTString &str, int val1, int val2, int val3, int val4);
+	TTaction(TTaction *src);
 
 	/**
 	 * Load the word
diff --git a/engines/titanic/true_talk/tt_adj.cpp b/engines/titanic/true_talk/tt_adj.cpp
index 8ee35e2..64321b5 100644
--- a/engines/titanic/true_talk/tt_adj.cpp
+++ b/engines/titanic/true_talk/tt_adj.cpp
@@ -34,6 +34,15 @@ TTadj::TTadj(TTString &str, int val1, int val2, int val3, int val4) :
 	}
 }
 
+TTadj::TTadj(TTadj *src) : TTmajorWord(src) {
+	if (src->getStatus()) {
+		_field30 = 0;
+		_status = SS_5;
+	} else {
+		_field30 = src->_field30;
+	}
+}
+
 int TTadj::load(SimpleFile *file) {
 	int val;
 
diff --git a/engines/titanic/true_talk/tt_adj.h b/engines/titanic/true_talk/tt_adj.h
index a0bb340..1c0306f 100644
--- a/engines/titanic/true_talk/tt_adj.h
+++ b/engines/titanic/true_talk/tt_adj.h
@@ -32,6 +32,7 @@ protected:
 	int _field30;
 public:
 	TTadj(TTString &str, int val1, int val2, int val3, int val4);
+	TTadj(TTadj *src);
 
 	/**
 	 * Load the word
diff --git a/engines/titanic/true_talk/tt_major_word.cpp b/engines/titanic/true_talk/tt_major_word.cpp
index 6df761b..4af3ba1 100644
--- a/engines/titanic/true_talk/tt_major_word.cpp
+++ b/engines/titanic/true_talk/tt_major_word.cpp
@@ -28,5 +28,13 @@ TTmajorWord::TTmajorWord(TTString &str, int val1, int val2, int val3) :
 		TTword(str, val1, val2), _field2C(val3) {
 }
 
+TTmajorWord::TTmajorWord(TTmajorWord *src) : TTword(src) {
+	if (src->getStatus()) {
+		_field2C = 0;
+		_status = SS_5;
+	} else {
+		_field2C = src->_field2C;
+	}
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_major_word.h b/engines/titanic/true_talk/tt_major_word.h
index 487c2a5..95ba6ca 100644
--- a/engines/titanic/true_talk/tt_major_word.h
+++ b/engines/titanic/true_talk/tt_major_word.h
@@ -32,6 +32,7 @@ protected:
 	int _field2C;
 public:
 	TTmajorWord(TTString &str, int val1, int val2, int val3);
+	TTmajorWord(TTmajorWord *src);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_picture.cpp b/engines/titanic/true_talk/tt_picture.cpp
index 21574df..d1e58a5 100644
--- a/engines/titanic/true_talk/tt_picture.cpp
+++ b/engines/titanic/true_talk/tt_picture.cpp
@@ -29,6 +29,21 @@ TTpicture::TTpicture(TTString &str, int val1, int val2, int val3, int val4, int
 		_field38(0) {
 }
 
+TTpicture::TTpicture(TTpicture *src) : TTmajorWord(src) {
+	if (getStatus()) {
+		_field34 = 0;
+		_field30 = 0;
+		_field38 = 0;
+		_field3C = 0;
+		_status = SS_5;
+	} else {
+		_field34 = src->_field34;
+		_field30 = src->_field30;
+		_field38 = src->_field38;
+		_field3C = src->_field3C;
+	}
+}
+
 int TTpicture::load(SimpleFile *file) {
 	CString str;
 	int val1, val2;
diff --git a/engines/titanic/true_talk/tt_picture.h b/engines/titanic/true_talk/tt_picture.h
index 93f9536..938d342 100644
--- a/engines/titanic/true_talk/tt_picture.h
+++ b/engines/titanic/true_talk/tt_picture.h
@@ -35,6 +35,7 @@ protected:
 	int _field3C;
 public:
 	TTpicture(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6);
+	TTpicture(TTpicture *src);
 
 	/**
 	 * Load the word
diff --git a/engines/titanic/true_talk/tt_pronoun.cpp b/engines/titanic/true_talk/tt_pronoun.cpp
index b0e3527..764489d 100644
--- a/engines/titanic/true_talk/tt_pronoun.cpp
+++ b/engines/titanic/true_talk/tt_pronoun.cpp
@@ -28,6 +28,15 @@ TTpronoun::TTpronoun(TTString &str, int val1, int val2, int val3, int val4) :
 		TTmajorWord(str, val1, val2, val3), _field30(val4) {
 }
 
+TTpronoun::TTpronoun(TTpronoun *src) : TTmajorWord(src) {
+	if (src->getStatus()) {
+		_field30 = 0;
+		_status = SS_5;
+	} else {
+		_field30 = src->_field30;
+	}
+}
+
 int TTpronoun::load(SimpleFile *file) {
 	int val;
 
diff --git a/engines/titanic/true_talk/tt_pronoun.h b/engines/titanic/true_talk/tt_pronoun.h
index 991c0b3..5f554a1 100644
--- a/engines/titanic/true_talk/tt_pronoun.h
+++ b/engines/titanic/true_talk/tt_pronoun.h
@@ -32,6 +32,7 @@ protected:
 	int _field30;
 public:
 	TTpronoun(TTString &str, int val1, int val2, int val3, int val4);
+	TTpronoun(TTpronoun *src);
 
 	/**
 	 * Load the word


Commit: 2f9d7f228459db6877ea5afec01f00110d17931a
    https://github.com/scummvm/scummvm/commit/2f9d7f228459db6877ea5afec01f00110d17931a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:30-04:00

Commit Message:
TITANIC: Added TTword subclass copy methods

Changed paths:
    engines/titanic/true_talk/tt_action.cpp
    engines/titanic/true_talk/tt_action.h
    engines/titanic/true_talk/tt_adj.cpp
    engines/titanic/true_talk/tt_adj.h
    engines/titanic/true_talk/tt_major_word.cpp
    engines/titanic/true_talk/tt_major_word.h
    engines/titanic/true_talk/tt_picture.cpp
    engines/titanic/true_talk/tt_picture.h
    engines/titanic/true_talk/tt_pronoun.cpp
    engines/titanic/true_talk/tt_pronoun.h
    engines/titanic/true_talk/tt_string.h



diff --git a/engines/titanic/true_talk/tt_action.cpp b/engines/titanic/true_talk/tt_action.cpp
index 5f55224..041f4a2 100644
--- a/engines/titanic/true_talk/tt_action.cpp
+++ b/engines/titanic/true_talk/tt_action.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+bool TTaction::_staticFlag;
+
 TTaction::TTaction(TTString &str, int val1, int val2, int val3, int val4) :
 		TTmajorWord(str, val1, val2, val3), _field30(val4) {
 }
@@ -48,4 +50,20 @@ int TTaction::load(SimpleFile *file) {
 	}
 }
 
+TTword *TTaction::copy() {
+	TTaction *returnWordP = new TTaction(this);
+	returnWordP->_status = _status;
+	if (!_status) {
+		_staticFlag = false;
+		return returnWordP;
+	} else if (_status == SS_13 && !_staticFlag) {
+		_staticFlag = true;
+		delete returnWordP;
+		return copy();
+	} else {
+		delete returnWordP;
+		return nullptr;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_action.h b/engines/titanic/true_talk/tt_action.h
index 821d16b..0d0b69a 100644
--- a/engines/titanic/true_talk/tt_action.h
+++ b/engines/titanic/true_talk/tt_action.h
@@ -28,6 +28,8 @@
 namespace Titanic {
 
 class TTaction : public TTmajorWord {
+private:
+	static bool _staticFlag; 
 protected:
 	int _field30;
 public:
@@ -38,6 +40,11 @@ public:
 	 * Load the word
 	 */
 	int load(SimpleFile *file);
+
+	/**
+	 * Creates a copy of the word
+	 */
+	virtual TTword *copy();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_adj.cpp b/engines/titanic/true_talk/tt_adj.cpp
index 64321b5..5b94213 100644
--- a/engines/titanic/true_talk/tt_adj.cpp
+++ b/engines/titanic/true_talk/tt_adj.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+bool TTadj::_staticFlag;
+
 TTadj::TTadj(TTString &str, int val1, int val2, int val3, int val4) :
 		TTmajorWord(str, val1, val2, val3) {
 	if (val4 >= 0 && val4 <= 9) {
@@ -54,4 +56,20 @@ int TTadj::load(SimpleFile *file) {
 	}
 }
 
+TTword *TTadj::copy() {
+	TTadj *returnWordP = new TTadj(this);
+	returnWordP->_status = _status;
+	if (!_status) {
+		_staticFlag = false;
+		return returnWordP;
+	} else if (_status == SS_13 && !_staticFlag) {
+		_staticFlag = true;
+		delete returnWordP;
+		return copy();
+	} else {
+		delete returnWordP;
+		return nullptr;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_adj.h b/engines/titanic/true_talk/tt_adj.h
index 1c0306f..02d09b5 100644
--- a/engines/titanic/true_talk/tt_adj.h
+++ b/engines/titanic/true_talk/tt_adj.h
@@ -28,6 +28,8 @@
 namespace Titanic {
 
 class TTadj : public TTmajorWord {
+private:
+	static bool _staticFlag;
 protected:
 	int _field30;
 public:
@@ -38,6 +40,11 @@ public:
 	 * Load the word
 	 */
 	int load(SimpleFile *file);
+
+	/**
+	 * Creates a copy of the word
+	 */
+	virtual TTword *copy();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_major_word.cpp b/engines/titanic/true_talk/tt_major_word.cpp
index 4af3ba1..b56a484 100644
--- a/engines/titanic/true_talk/tt_major_word.cpp
+++ b/engines/titanic/true_talk/tt_major_word.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+bool TTmajorWord::_staticFlag;
+
 TTmajorWord::TTmajorWord(TTString &str, int val1, int val2, int val3) :
 		TTword(str, val1, val2), _field2C(val3) {
 }
@@ -37,4 +39,20 @@ TTmajorWord::TTmajorWord(TTmajorWord *src) : TTword(src) {
 	}
 }
 
+TTword *TTmajorWord::copy() {
+	TTmajorWord *returnWordP = new TTmajorWord(this);
+	returnWordP->_status = _status;
+	if (!_status) {
+		_staticFlag = false;
+		return returnWordP;
+	} else if (_status == SS_13 && !_staticFlag) {
+		_staticFlag = true;
+		delete returnWordP;
+		return copy();
+	} else {
+		delete returnWordP;
+		return nullptr;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_major_word.h b/engines/titanic/true_talk/tt_major_word.h
index 95ba6ca..140419d 100644
--- a/engines/titanic/true_talk/tt_major_word.h
+++ b/engines/titanic/true_talk/tt_major_word.h
@@ -28,11 +28,18 @@
 namespace Titanic {
 
 class TTmajorWord : public TTword {
+private:
+	static bool _staticFlag;
 protected:
 	int _field2C;
 public:
 	TTmajorWord(TTString &str, int val1, int val2, int val3);
 	TTmajorWord(TTmajorWord *src);
+
+	/**
+	 * Creates a copy of the word
+	 */
+	virtual TTword *copy();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_picture.cpp b/engines/titanic/true_talk/tt_picture.cpp
index d1e58a5..2cc69a1 100644
--- a/engines/titanic/true_talk/tt_picture.cpp
+++ b/engines/titanic/true_talk/tt_picture.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+bool TTpicture::_staticFlag;
+
 TTpicture::TTpicture(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6) :
 		TTmajorWord(str, val1, val2, val4), _field34(val3), _field30(val5), _field3C(val6),
 		_field38(0) {
@@ -58,4 +60,20 @@ int TTpicture::load(SimpleFile *file) {
 	}
 }
 
+TTword *TTpicture::copy() {
+	TTpicture *returnWordP = new TTpicture(this);
+	returnWordP->_status = _status;
+	if (!_status) {
+		_staticFlag = false;
+		return returnWordP;
+	} else if (_status == SS_13 && !_staticFlag) {
+		_staticFlag = true;
+		delete returnWordP;
+		return copy();
+	} else {
+		delete returnWordP;
+		return nullptr;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_picture.h b/engines/titanic/true_talk/tt_picture.h
index 938d342..1910bc6 100644
--- a/engines/titanic/true_talk/tt_picture.h
+++ b/engines/titanic/true_talk/tt_picture.h
@@ -28,6 +28,8 @@
 namespace Titanic {
 
 class TTpicture : public TTmajorWord {
+private:
+	static bool _staticFlag;
 protected:
 	int _field30;
 	int _field34;
@@ -41,6 +43,11 @@ public:
 	 * Load the word
 	 */
 	int load(SimpleFile *file);
+
+	/**
+	 * Creates a copy of the word
+	 */
+	virtual TTword *copy();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_pronoun.cpp b/engines/titanic/true_talk/tt_pronoun.cpp
index 764489d..120946b 100644
--- a/engines/titanic/true_talk/tt_pronoun.cpp
+++ b/engines/titanic/true_talk/tt_pronoun.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+bool TTpronoun::_staticFlag;
+
 TTpronoun::TTpronoun(TTString &str, int val1, int val2, int val3, int val4) :
 		TTmajorWord(str, val1, val2, val3), _field30(val4) {
 }
@@ -52,4 +54,20 @@ int TTpronoun::load(SimpleFile *file) {
 	}
 }
 
+TTword *TTpronoun::copy() {
+	TTpronoun *returnWordP = new TTpronoun(this);
+	returnWordP->_status = _status;
+	if (!_status) {
+		_staticFlag = false;
+		return returnWordP;
+	} else if (_status == SS_13 && !_staticFlag) {
+		_staticFlag = true;
+		delete returnWordP;
+		return copy();
+	} else {
+		delete returnWordP;
+		return nullptr;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_pronoun.h b/engines/titanic/true_talk/tt_pronoun.h
index 5f554a1..8f55a36 100644
--- a/engines/titanic/true_talk/tt_pronoun.h
+++ b/engines/titanic/true_talk/tt_pronoun.h
@@ -28,6 +28,8 @@
 namespace Titanic {
 
 class TTpronoun : public TTmajorWord {
+private:
+	static bool _staticFlag; 
 protected:
 	int _field30;
 public:
@@ -38,6 +40,11 @@ public:
 	 * Load the word
 	 */
 	int load(SimpleFile *file);
+
+	/**
+	 * Creates a copy of the word
+	 */
+	virtual TTword *copy();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 9cb92cf..a881c59 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -36,7 +36,7 @@ struct TTStringData {
 	TTStringData(const CString &str) : _string(str), _referenceCount(1) {}
 };
 
-enum TTStringStatus { SS_VALID = 0, SS_5 = 5, SS_7 = 7 };
+enum TTStringStatus { SS_VALID = 0, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_13 = 13 };
 
 class TTString {
 private:


Commit: eb948946885bc128c01f5c09da0bbdba95d2c472
    https://github.com/scummvm/scummvm/commit/eb948946885bc128c01f5c09da0bbdba95d2c472
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:31-04:00

Commit Message:
TITANIC: Implement TTword hierarchy virtual methods

Changed paths:
    engines/titanic/support/simple_file.cpp
    engines/titanic/support/simple_file.h
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/tt_action.cpp
    engines/titanic/true_talk/tt_action.h
    engines/titanic/true_talk/tt_adj.cpp
    engines/titanic/true_talk/tt_adj.h
    engines/titanic/true_talk/tt_major_word.cpp
    engines/titanic/true_talk/tt_major_word.h
    engines/titanic/true_talk/tt_picture.cpp
    engines/titanic/true_talk/tt_picture.h
    engines/titanic/true_talk/tt_pronoun.cpp
    engines/titanic/true_talk/tt_pronoun.h
    engines/titanic/true_talk/tt_script_base.h
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_string_node.h
    engines/titanic/true_talk/tt_synonym.cpp
    engines/titanic/true_talk/tt_synonym.h
    engines/titanic/true_talk/tt_title_script.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_vocab.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp
index 61d941b..f4351f9 100644
--- a/engines/titanic/support/simple_file.cpp
+++ b/engines/titanic/support/simple_file.cpp
@@ -73,7 +73,7 @@ size_t SimpleFile::unsafeRead(void *dst, size_t count) {
 	return _inStream->read(dst, count);
 }
 
-size_t SimpleFile::write(const void *src, size_t count) {
+size_t SimpleFile::write(const void *src, size_t count) const {
 	assert(_outStream);
 	return _outStream->write(src, count);
 }
@@ -237,12 +237,12 @@ void SimpleFile::readBuffer(char *buffer, size_t count) {
 	}
 }
 
-void SimpleFile::writeLine(const CString &str) {
+void SimpleFile::writeLine(const CString &str) const {
 	write(str.c_str(), str.size());
 	write("\r\n", 2);
 }
 
-void SimpleFile::writeString(const CString &str) {
+void SimpleFile::writeString(const CString &str) const {
 	if (str.empty())
 		return;
 
@@ -279,58 +279,69 @@ void SimpleFile::writeString(const CString &str) {
 	}
 }
 
-void SimpleFile::writeQuotedString(const CString &str) {
+void SimpleFile::writeQuotedString(const CString &str) const {
 	write("\"", 1);
 	writeString(str);
 	write("\" ", 2);
 }
 
-void SimpleFile::writeQuotedLine(const CString &str, int indent) {
+void SimpleFile::writeQuotedLine(const CString &str, int indent) const {
 	writeIndent(indent);
 	writeQuotedString(str);
 	write("\n", 1);
 }
 
-void SimpleFile::writeNumber(int val) {
+void SimpleFile::writeNumber(int val) const {
 	CString str = CString::format("%d ", val);
 	write(str.c_str(), str.size());
 }
 
-void SimpleFile::writeNumberLine(int val, int indent) {
+void SimpleFile::writeNumberLine(int val, int indent) const {
 	writeIndent(indent);
 	writeNumber(val);
 	write("\n", 1);
 }
 
-void SimpleFile::writeFloat(double val) {
+void SimpleFile::writeFloat(double val) const {
 	Common::String valStr = Common::String::format("%f ", val);
 	write(valStr.c_str(), valStr.size());
 }
 
-void SimpleFile::writeFloatLine(double val, int indent) {
+void SimpleFile::writeFloatLine(double val, int indent) const {
 	writeIndent(indent);
 	writeFloat(val);
 	write("\n", 1);
 }
 
-void SimpleFile::writePoint(const Point &pt, int indent) {
+void SimpleFile::writePoint(const Point &pt, int indent) const {
 	writeIndent(indent);
 	writeNumber(pt.x);
 	writeNumber(pt.y);
 	write("\n", 1);
 }
 
-void SimpleFile::writeRect(const Rect &r, int indent) {
+void SimpleFile::writeRect(const Rect &r, int indent) const {
 	writePoint(Point(r.left, r.top), indent);
 	writePoint(Point(r.right, r.bottom), indent);
 }
 
-void SimpleFile::writeBounds(const Rect &r, int indent) {
+void SimpleFile::writeBounds(const Rect &r, int indent) const {
 	writePoint(Point(r.left, r.top), indent);
 	writePoint(Point(r.width(), r.height()), indent);
 }
 
-void SimpleFile::writeIndent(uint indent) {
+void SimpleFile::writeFormat(const char *format, ...) const {
+	// Convert the format specifier and params to a string
+	va_list va;
+	va_start(va, format);
+	CString line = CString::vformat(format, va);
+	va_end(va);
+
+	// Write out the string
+	write(format, strlen(format));
+}
+
+void SimpleFile::writeIndent(uint indent) const {
 	for (uint idx = 0; idx < indent; ++idx)
 		write("\t", 1);
 }
@@ -383,7 +394,7 @@ bool SimpleFile::scanf(const char *format, ...) {
 			*param = readNumber();
 			
 			if (!eos())
-				_inStream->skip(-1);
+				_inStream->seek(-1, SEEK_CUR);
 		} else if (formatStr.hasPrefix("%s")) {
 			// Read in text until the next space
 			formatStr = CString(formatStr.c_str() + 2);
@@ -393,7 +404,7 @@ bool SimpleFile::scanf(const char *format, ...) {
 				*str += c;
 
 			if (!eos())
-				_inStream->skip(-1);
+				_inStream->seek(-1, SEEK_CUR);
 		}
 	}
 
@@ -408,7 +419,7 @@ void SimpleFile::skipSpaces() {
 		safeRead(&c, 1);
 
 	if (!eos())
-		_inStream->skip(-1);
+		_inStream->seek(-1, SEEK_CUR);
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/titanic/support/simple_file.h b/engines/titanic/support/simple_file.h
index 2a4cfdb..cf89e5d 100644
--- a/engines/titanic/support/simple_file.h
+++ b/engines/titanic/support/simple_file.h
@@ -89,7 +89,7 @@ public:
 	/**
 	 * Write out data
 	 */
-	virtual size_t write(const void *src, size_t count);
+	virtual size_t write(const void *src, size_t count) const;
 
 	/**
 	 * Read a byte
@@ -139,62 +139,67 @@ public:
 	/**
 	 * Write a string line
 	 */
-	void writeLine(const CString &str);
+	void writeLine(const CString &str) const;
 
 	/**
 	 * Write a string
 	 */
-	void writeString(const CString &str);
+	void writeString(const CString &str) const;
 
 	/**
 	 * Write a quoted string
 	 */
-	void writeQuotedString(const CString &str);
+	void writeQuotedString(const CString &str) const;
 
 	/**
 	 * Write a quoted string line
 	 */
-	void writeQuotedLine(const CString &str, int indent);
+	void writeQuotedLine(const CString &str, int indent) const;
 
 	/**
 	 * Write a number to file
 	 */
-	void writeNumber(int val);
+	void writeNumber(int val) const;
 
 	/**
 	 * Write a number line to file
 	 */
-	void writeNumberLine(int val, int indent);
+	void writeNumberLine(int val, int indent) const;
 
 	/**
 	 * Write a floating point number
 	 */
-	void writeFloat(double val);
+	void writeFloat(double val) const;
 
 	/**
 	 * Write a floating point number as a line
 	 */
-	void writeFloatLine(double val, int indent);
+	void writeFloatLine(double val, int indent) const;
 
 	/**
 	 * Write out a point line
 	 */
-	void writePoint(const Point &pt, int indent);
+	void writePoint(const Point &pt, int indent)const;
 
 	/**
 	 * Write out a rect line
 	 */
-	void writeRect(const Rect &r, int indent);
+	void writeRect(const Rect &r, int indent) const;
 
 	/**
 	 * Write out a bounds line
 	 */
-	void writeBounds(const Rect &r, int indent);
+	void writeBounds(const Rect &r, int indent) const;
+
+	/**
+	 * Write out a string using a format specifier, just like fprintf
+	 */
+	void writeFormat(const char *format, ...) const;
 
 	/**
 	 * Write out a number of tabs to form an indent in the output
 	 */
-	void writeIndent(uint indent);
+	void writeIndent(uint indent) const;
 
 	/**
 	 * Validates that the following non-space character is either
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 65ec600..e923c37 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -58,7 +58,7 @@ ScriptChangedResult CScriptHandler::scriptChanged(TTRoomScript *roomScript, TTNp
 }
 
 void CScriptHandler::processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
-		const TTString &line) {
+		const TTstring &line) {
 	if (!roomScript || !line.isValid())
 		return;
 	
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 7692959..2da9371 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -72,7 +72,7 @@ public:
 	ScriptChangedResult scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId);
 
 	void processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
-		const TTString &line);
+		const TTstring &line);
 
 	/**
 	 * Open a resource for access
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 4892259..7743d81 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -310,7 +310,7 @@ void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CView
 	if (npcScript && roomScript) {
 		_currentNPC = npc;
 		_titleEngine._scriptHandler->processInput(roomScript, npcScript,
-			TTString(msg->_input));
+			TTstring(msg->_input));
 		_currentNPC = nullptr;
 
 		loadAssets(npc, npcScript->charId());
diff --git a/engines/titanic/true_talk/tt_action.cpp b/engines/titanic/true_talk/tt_action.cpp
index 041f4a2..39e3174 100644
--- a/engines/titanic/true_talk/tt_action.cpp
+++ b/engines/titanic/true_talk/tt_action.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 bool TTaction::_staticFlag;
 
-TTaction::TTaction(TTString &str, int val1, int val2, int val3, int val4) :
+TTaction::TTaction(TTstring &str, int val1, int val2, int val3, int val4) :
 		TTmajorWord(str, val1, val2, val3), _field30(val4) {
 }
 
diff --git a/engines/titanic/true_talk/tt_action.h b/engines/titanic/true_talk/tt_action.h
index 0d0b69a..822ba4a 100644
--- a/engines/titanic/true_talk/tt_action.h
+++ b/engines/titanic/true_talk/tt_action.h
@@ -33,7 +33,7 @@ private:
 protected:
 	int _field30;
 public:
-	TTaction(TTString &str, int val1, int val2, int val3, int val4);
+	TTaction(TTstring &str, int val1, int val2, int val3, int val4);
 	TTaction(TTaction *src);
 
 	/**
@@ -45,6 +45,8 @@ public:
 	 * Creates a copy of the word
 	 */
 	virtual TTword *copy();
+
+	virtual bool proc12(int val) const { return _field30 == val; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_adj.cpp b/engines/titanic/true_talk/tt_adj.cpp
index 5b94213..8f62bb8 100644
--- a/engines/titanic/true_talk/tt_adj.cpp
+++ b/engines/titanic/true_talk/tt_adj.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 bool TTadj::_staticFlag;
 
-TTadj::TTadj(TTString &str, int val1, int val2, int val3, int val4) :
+TTadj::TTadj(TTstring &str, int val1, int val2, int val3, int val4) :
 		TTmajorWord(str, val1, val2, val3) {
 	if (val4 >= 0 && val4 <= 9) {
 		_field30 = val4;
diff --git a/engines/titanic/true_talk/tt_adj.h b/engines/titanic/true_talk/tt_adj.h
index 02d09b5..301023e 100644
--- a/engines/titanic/true_talk/tt_adj.h
+++ b/engines/titanic/true_talk/tt_adj.h
@@ -33,7 +33,7 @@ private:
 protected:
 	int _field30;
 public:
-	TTadj(TTString &str, int val1, int val2, int val3, int val4);
+	TTadj(TTstring &str, int val1, int val2, int val3, int val4);
 	TTadj(TTadj *src);
 
 	/**
@@ -45,6 +45,19 @@ public:
 	 * Creates a copy of the word
 	 */
 	virtual TTword *copy();
+
+	virtual bool proc14(int val) const { return _field30 == val; }
+	virtual int proc15() const { return _field30; }
+	virtual bool proc16() const { return _field30 >= 7; }
+	virtual bool proc17() const { return _field30 <= 3; }
+	virtual bool proc18() const { return _field30 > 3 && _field30 < 7; }
+
+	/**
+	 * Dumps data associated with the word to file
+	 */
+	virtual int save(SimpleFile *file) const {
+		return saveData(file, _field30);
+	}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_major_word.cpp b/engines/titanic/true_talk/tt_major_word.cpp
index b56a484..68af628 100644
--- a/engines/titanic/true_talk/tt_major_word.cpp
+++ b/engines/titanic/true_talk/tt_major_word.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 bool TTmajorWord::_staticFlag;
 
-TTmajorWord::TTmajorWord(TTString &str, int val1, int val2, int val3) :
+TTmajorWord::TTmajorWord(TTstring &str, int val1, int val2, int val3) :
 		TTword(str, val1, val2), _field2C(val3) {
 }
 
@@ -39,6 +39,18 @@ TTmajorWord::TTmajorWord(TTmajorWord *src) : TTword(src) {
 	}
 }
 
+int TTmajorWord::saveData(SimpleFile *file, int val) const {
+	int result = TTword::save(file);
+	if (!result) {
+		file->writeFormat("%1.0d", val);
+		file->writeFormat("%c", '\n');
+		if (_synP)
+			result = _synP->save(file);
+	}
+
+	return result;
+}
+
 TTword *TTmajorWord::copy() {
 	TTmajorWord *returnWordP = new TTmajorWord(this);
 	returnWordP->_status = _status;
diff --git a/engines/titanic/true_talk/tt_major_word.h b/engines/titanic/true_talk/tt_major_word.h
index 140419d..962fbaa 100644
--- a/engines/titanic/true_talk/tt_major_word.h
+++ b/engines/titanic/true_talk/tt_major_word.h
@@ -32,14 +32,21 @@ private:
 	static bool _staticFlag;
 protected:
 	int _field2C;
+protected:
+	/**
+	 * Dumps data for the word to a file
+	 */
+	int saveData(SimpleFile *file, int val) const;
 public:
-	TTmajorWord(TTString &str, int val1, int val2, int val3);
+	TTmajorWord(TTstring &str, int val1, int val2, int val3);
 	TTmajorWord(TTmajorWord *src);
 
 	/**
 	 * Creates a copy of the word
 	 */
 	virtual TTword *copy();
+
+	virtual bool proc2(int val) const { return _field2C == val; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_picture.cpp b/engines/titanic/true_talk/tt_picture.cpp
index 2cc69a1..6213cd5 100644
--- a/engines/titanic/true_talk/tt_picture.cpp
+++ b/engines/titanic/true_talk/tt_picture.cpp
@@ -26,20 +26,20 @@ namespace Titanic {
 
 bool TTpicture::_staticFlag;
 
-TTpicture::TTpicture(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6) :
-		TTmajorWord(str, val1, val2, val4), _field34(val3), _field30(val5), _field3C(val6),
+TTpicture::TTpicture(TTstring &str, int val1, int val2, int val3, int val4, int val5, int val6) :
+		TTmajorWord(str, val1, val2, val4), _tag(val3), _field30(val5), _field3C(val6),
 		_field38(0) {
 }
 
 TTpicture::TTpicture(TTpicture *src) : TTmajorWord(src) {
 	if (getStatus()) {
-		_field34 = 0;
+		_tag = 0;
 		_field30 = 0;
 		_field38 = 0;
 		_field3C = 0;
 		_status = SS_5;
 	} else {
-		_field34 = src->_field34;
+		_tag = src->_tag;
 		_field30 = src->_field30;
 		_field38 = src->_field38;
 		_field3C = src->_field3C;
@@ -51,7 +51,7 @@ int TTpicture::load(SimpleFile *file) {
 	int val1, val2;
 
 	if (!TTword::load(file, 2) && file->scanf("%s %d %d", &str, &val1, &val2)) {
-		_field34 = readNumber(str.c_str());
+		_tag = readNumber(str.c_str());
 		_field30 = val1;
 		_field3C = val2;
 		return 0;
@@ -76,4 +76,27 @@ TTword *TTpicture::copy() {
 	}
 }
 
+bool TTpicture::checkTag() const {
+	return _tag == MKTAG('S', 'E', 'X', 'X') ||
+		_tag == MKTAG('E', 'X', 'C', 'R') ||
+		_tag == MKTAG('P', 'P', 'R', 'T') ||
+		_tag == MKTAG('B', 'L', 'A', 'S');
+}
+
+bool TTpicture::compareTagTo(uint tag) const {
+	return _tag == tag;
+}
+
+uint TTpicture::getTag() const {
+	return _tag;
+}
+
+bool TTpicture::proc9(int val) const {
+	return _field3C == val;
+}
+
+int TTpicture::proc10() const {
+	return _field3C;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_picture.h b/engines/titanic/true_talk/tt_picture.h
index 1910bc6..c4cc2c1 100644
--- a/engines/titanic/true_talk/tt_picture.h
+++ b/engines/titanic/true_talk/tt_picture.h
@@ -32,11 +32,11 @@ private:
 	static bool _staticFlag;
 protected:
 	int _field30;
-	int _field34;
+	uint _tag;
 	int _field38;
 	int _field3C;
 public:
-	TTpicture(TTString &str, int val1, int val2, int val3, int val4, int val5, int val6);
+	TTpicture(TTstring &str, int val1, int val2, int val3, int val4, int val5, int val6);
 	TTpicture(TTpicture *src);
 
 	/**
@@ -48,6 +48,25 @@ public:
 	 * Creates a copy of the word
 	 */
 	virtual TTword *copy();
+
+	/**
+	 * Checks whether the word's tag is a known type
+	 */
+	virtual bool checkTag() const;
+	
+	/**
+	 * Compare the word's tag to a given tag value
+	 */
+	virtual bool compareTagTo(uint tag) const;
+
+	/**
+	 * Return the tag associated with the word
+	 */
+	virtual uint getTag() const;
+	
+	virtual bool proc9(int val) const;
+	virtual int proc10() const;
+
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_pronoun.cpp b/engines/titanic/true_talk/tt_pronoun.cpp
index 120946b..4b20b33 100644
--- a/engines/titanic/true_talk/tt_pronoun.cpp
+++ b/engines/titanic/true_talk/tt_pronoun.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 bool TTpronoun::_staticFlag;
 
-TTpronoun::TTpronoun(TTString &str, int val1, int val2, int val3, int val4) :
+TTpronoun::TTpronoun(TTstring &str, int val1, int val2, int val3, int val4) :
 		TTmajorWord(str, val1, val2, val3), _field30(val4) {
 }
 
diff --git a/engines/titanic/true_talk/tt_pronoun.h b/engines/titanic/true_talk/tt_pronoun.h
index 8f55a36..6bb8113 100644
--- a/engines/titanic/true_talk/tt_pronoun.h
+++ b/engines/titanic/true_talk/tt_pronoun.h
@@ -33,7 +33,7 @@ private:
 protected:
 	int _field30;
 public:
-	TTpronoun(TTString &str, int val1, int val2, int val3, int val4);
+	TTpronoun(TTstring &str, int val1, int val2, int val3, int val4);
 	TTpronoun(TTpronoun *src);
 
 	/**
@@ -45,6 +45,15 @@ public:
 	 * Creates a copy of the word
 	 */
 	virtual TTword *copy();
+
+	virtual bool proc19(int val) const { return _field30 == val; }
+
+	/**
+	 * Dumps data associated with the word to file
+	 */
+	virtual int save(SimpleFile *file) const {
+		return saveData(file, _field30);
+	}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index fe999ab..dc0db2c 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -38,7 +38,7 @@ protected:
 	int _field4;
 	int _field8;
 	int _fieldC;
-	TTString _charName, _charClass;
+	TTstring _charName, _charClass;
 	int _field20;
 	int _field24;
 	int _field28;
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index 78ef822..7a39d71 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -21,23 +21,24 @@
  */
 
 #include "titanic/true_talk/tt_string.h"
+#include "titanic/support/simple_file.h"
 
 namespace Titanic {
 
-TTString::TTString() : _status(SS_VALID) {
-	_data = new TTStringData();
+TTstring::TTstring() : _status(SS_VALID) {
+	_data = new TTstringData();
 }
 
-TTString::TTString(const char *str) : _status(SS_VALID) {
-	_data = new TTStringData(str);
+TTstring::TTstring(const char *str) : _status(SS_VALID) {
+	_data = new TTstringData(str);
 }
 
-TTString::TTString(const CString &str) {
+TTstring::TTstring(const CString &str) {
 	_status = SS_VALID;
-	_data = new TTStringData(str);
+	_data = new TTstringData(str);
 }
 
-TTString::TTString(TTString &str) {
+TTstring::TTstring(TTstring &str) {
 	if (str._status != SS_VALID) {
 		_status = SS_5;
 		_data = nullptr;
@@ -48,12 +49,12 @@ TTString::TTString(TTString &str) {
 	}
 }
 
-TTString::~TTString() {
+TTstring::~TTstring() {
 	if (_data && --_data->_referenceCount == 0)
 		delete _data;
 }
 
-void TTString::operator=(const TTString &str) {
+void TTstring::operator=(const TTstring &str) {
 	// Delete old string reference, if any
 	if (_data && --_data->_referenceCount == 0)
 		delete _data;
@@ -65,22 +66,26 @@ void TTString::operator=(const TTString &str) {
 		_data->_referenceCount++;
 }
 
-void TTString::operator=(const CString &str) {
+void TTstring::operator=(const CString &str) {
 	operator=(str.c_str());
 }
 
-void TTString::operator=(const char *str) {
+void TTstring::operator=(const char *str) {
 	// Delete old string reference, if any
 	if (_data && --_data->_referenceCount == 0)
 		delete _data;
 
 	// Create new string data
-	_data = new TTStringData(str);
+	_data = new TTstringData(str);
 	_status = SS_VALID;
 }
 
-bool TTString::isValid() const {
+bool TTstring::isValid() const {
 	return _status == SS_VALID;
 }
 
+void TTstring::save(SimpleFile *file) const {
+	file->writeFormat("%s", c_str());
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index a881c59..0256f10 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -27,29 +27,31 @@
 
 namespace Titanic {
 
-struct TTStringData {
+class SimpleFile;
+
+struct TTstringData {
 	CString _string;
 	int _referenceCount;
 
-	TTStringData() : _referenceCount(1) {}
-	TTStringData(const char *str) : _string(str), _referenceCount(1) {}
-	TTStringData(const CString &str) : _string(str), _referenceCount(1) {}
+	TTstringData() : _referenceCount(1) {}
+	TTstringData(const char *str) : _string(str), _referenceCount(1) {}
+	TTstringData(const CString &str) : _string(str), _referenceCount(1) {}
 };
 
-enum TTStringStatus { SS_VALID = 0, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_13 = 13 };
+enum TTstringStatus { SS_VALID = 0, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_13 = 13 };
 
-class TTString {
+class TTstring {
 private:
-	TTStringData *_data;
-	TTStringStatus _status;
+	TTstringData *_data;
+	TTstringStatus _status;
 public:
-	TTString();
-	TTString(const char *str);
-	TTString(const CString &str);
-	TTString(TTString &str);
-	virtual ~TTString();
+	TTstring();
+	TTstring(const char *str);
+	TTstring(const CString &str);
+	TTstring(TTstring &str);
+	virtual ~TTstring();
 
-	void operator=(const TTString &str);
+	void operator=(const TTstring &str);
 	void operator=(const CString &str);
 	void operator=(const char *str);
 
@@ -61,7 +63,7 @@ public:
 	/**
 	 * Get the status of the string
 	 */
-	TTStringStatus getStatus() const { return _status; }
+	TTstringStatus getStatus() const { return _status; }
 
 	/**
 	 * Get a char * pointer to the string data
@@ -77,6 +79,11 @@ public:
 	 * Get a character at a specified index
 	 */
 	char charAt(int index) const { return *(c_str() + index); }
+
+	/**
+	 * Save the sring to a passed file
+	 */
+	void save(SimpleFile *file) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string_node.h b/engines/titanic/true_talk/tt_string_node.h
index 6994a0d..f9f73ce 100644
--- a/engines/titanic/true_talk/tt_string_node.h
+++ b/engines/titanic/true_talk/tt_string_node.h
@@ -47,7 +47,7 @@ protected:
 public:
 	TTstringNode *_pPrior;
 	TTstringNode *_pNext;
-	TTString _string;
+	TTstring _string;
 	FileHandle _file;
 	int _mode;
 	int _field1C;
diff --git a/engines/titanic/true_talk/tt_synonym.cpp b/engines/titanic/true_talk/tt_synonym.cpp
index 3ce3b12..cac9f64 100644
--- a/engines/titanic/true_talk/tt_synonym.cpp
+++ b/engines/titanic/true_talk/tt_synonym.cpp
@@ -40,7 +40,7 @@ TTsynonym::TTsynonym(int mode, const char *str, FileHandle file) :
 	_file = file;
 }
 
-TTsynonym *TTsynonym::findByName(TTsynonym *start, const TTString &str, int mode) {
+TTsynonym *TTsynonym::findByName(TTsynonym *start, const TTstring &str, int mode) {
 	for (; start; start = static_cast<TTsynonym *>(start->_pNext)) {
 		if (start->_mode == mode || (mode == 3 && start->_mode < 3)) {
 			if (!strcmp(start->_string.c_str(), str.c_str()))
@@ -68,4 +68,29 @@ TTsynonym *TTsynonym::copy(TTsynonym *src) {
 	}
 }
 
+int TTsynonym::save(SimpleFile *file) {
+	for (TTstringNode *synP = this; synP; synP = synP->_pNext) {
+		file->writeFormat("%s", " 0 ");
+		synP->_string.save(file);
+		file->writeFormat("%c", ' ');
+
+		if (synP->_mode) {
+			file->writeFormat("%1.0d", synP->_mode);
+		} else {
+			file->writeFormat("%c", '0');
+		}
+
+		file->writeFormat("%c", ' ');
+		
+		if (synP->_file) {
+			file->writeFormat("%2.0d", synP->_file);
+		} else {
+			file->writeFormat("%c", ' ');
+		}
+		file->writeFormat("%c", '\n');
+	}
+
+	return 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_synonym.h b/engines/titanic/true_talk/tt_synonym.h
index b661c16..40f7ad3 100644
--- a/engines/titanic/true_talk/tt_synonym.h
+++ b/engines/titanic/true_talk/tt_synonym.h
@@ -24,6 +24,7 @@
 #define TITANIC_TT_SYNONYM_H
 
 #include "titanic/true_talk/tt_string_node.h"
+#include "titanic/support/simple_file.h"
 
 namespace Titanic {
 
@@ -41,8 +42,12 @@ public:
 	/**
 	 * Scan for a synonym with a given string
 	 */
-	static TTsynonym *findByName(TTsynonym *start, const TTString &str, int mode);
+	static TTsynonym *findByName(TTsynonym *start, const TTstring &str, int mode);
 
+	/**
+	 * Save data for the synonym to file
+	 */
+	int save(SimpleFile *file);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_title_script.h b/engines/titanic/true_talk/tt_title_script.h
index 7876ba8..a1efd11 100644
--- a/engines/titanic/true_talk/tt_title_script.h
+++ b/engines/titanic/true_talk/tt_title_script.h
@@ -31,7 +31,7 @@ namespace Titanic {
 class TTTitleScript : public TTScriptBase {
 private:
 	int _field50;
-	TTString _string1;
+	TTstring _string1;
 	int _field5C;
 	int _field60;
 public:
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 1826a43..3d2a9d9 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -53,7 +53,7 @@ int TTvocab::load(const CString &name) {
 	while (!result && !file->eos()) {
 		skipFlag = false;
 		int mode = file->readNumber();
-		TTString space(" ");
+		TTstring space(" ");
 
 		switch (mode) {
 		case 0: {
@@ -154,7 +154,7 @@ void TTvocab::addWord(TTword *word) {
 	}
 }
 
-TTword *TTvocab::findWord(const TTString &str) {
+TTword *TTvocab::findWord(const TTstring &str) {
 	TTsynonym *tempNode = new TTsynonym();
 	bool flag = false;
 	TTword *word = _pHead;
@@ -174,7 +174,7 @@ TTword *TTvocab::findWord(const TTString &str) {
 	return word;
 }
 
-TTword *TTvocab::getPrimeWord(TTString &str, TTword **words) {
+TTword *TTvocab::getPrimeWord(TTstring &str, TTword **words) {
 	TTsynonym *synonym = new TTsynonym();
 	char c = str.charAt(0);
 	TTword *vocabList = _pHead;
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
index b7e9486..804d8cb 100644
--- a/engines/titanic/true_talk/tt_vocab.h
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -52,12 +52,12 @@ private:
 	/**
 	 * Scans the vocab list for an existing word match
 	 */
-	TTword *findWord(const TTString &str);
+	TTword *findWord(const TTstring &str);
 public:
 	TTvocab(int val);
 	~TTvocab();
 
-	TTword *getPrimeWord(TTString &str, TTword **words);
+	TTword *getPrimeWord(TTstring &str, TTword **words);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index ea68b34..aa602d8 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -26,7 +26,7 @@
 
 namespace Titanic {
 
-TTword::TTword(TTString &str, int mode, int val2) : _string(str),
+TTword::TTword(TTstring &str, int mode, int val2) : _string(str),
 		_wordMode(mode), _field1C(val2), _pNext(nullptr), _synP(nullptr),
 		_field20(0), _field24(0), _field28(0) {
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
@@ -143,7 +143,7 @@ bool TTword::testFileHandle(FileHandle file) const {
 	return true;
 }
 
-TTword *TTword::scanCopy(const TTString &str, TTsynonym *node, int mode) {
+TTword *TTword::scanCopy(const TTstring &str, TTsynonym *node, int mode) {
 	if (_synP) {
 		TTsynonym *strNode = TTsynonym::findByName(_synP, str, mode);
 		if (strNode) {
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 3d9001b..f77f11c 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -31,7 +31,7 @@ namespace Titanic {
 
 class TTword {
 protected:
-	TTStringStatus _status;
+	TTstringStatus _status;
 	int _wordMode;
 	int _field1C;
 	int _field20;
@@ -48,9 +48,9 @@ protected:
 public:
 	TTword *_pNext;
 	TTsynonym *_synP;
-	TTString _string;
+	TTstring _string;
 public:
-	TTword(TTString &str, int mode, int val2);
+	TTword(TTstring &str, int mode, int val2);
 	TTword(TTword *src);
 
 	/**
@@ -73,7 +73,7 @@ public:
 	 */
 	int load(SimpleFile *file, int mode);
 
-	TTword *scanCopy(const TTString &str, TTsynonym *node, int mode);
+	TTword *scanCopy(const TTstring &str, TTsynonym *node, int mode);
 
 	const char *c_str() const { return _string.c_str(); }
 	operator const char *() const { return c_str(); }
@@ -81,31 +81,44 @@ public:
 	/**
 	 * Return the status of the word
 	 */
-	TTStringStatus getStatus() const { return _status; }
+	TTstringStatus getStatus() const { return _status; }
 
 	/**
 	 * Creates a copy of the word
 	 */
 	virtual TTword *copy();
 	
-	virtual int proc2() const { return 0; }
+	virtual bool proc2(int val) const { return false; }
 	virtual int proc3() const { return -1; }
 	virtual void proc4() {}
 	virtual void proc5() {}
-	virtual int proc6() const { return 0; }
-	virtual int proc7() const { return 0; }
-	virtual int proc8() const { return 0; }
-	virtual int proc9() const { return 0; }
+
+	/**
+	 * Checks whether the word's tag is a known type
+	 */
+	virtual bool checkTag() const { return false; }
+	
+	/**
+	 * Compare the word's tag to a given tag value
+	 */
+	virtual bool compareTagTo(uint tag) const { return false; }
+
+	/**
+	 * Return the tag associated with the word
+	 */
+	virtual uint getTag() const { return 0; }
+	
+	virtual bool proc9(int val) const { return false; }
 	virtual int proc10() const { return 0; }
 	virtual void proc11() {}
-	virtual int proc12() const { return 0; }
+	virtual bool proc12(int val) const { return false; }
 	virtual int proc13() const { return 0; }
-	virtual int proc14() const { return 0; }
+	virtual bool proc14(int val) const { return false; }
 	virtual int proc15() const { return -1; }
-	virtual int proc16() const { return 0; }
-	virtual int proc17() const { return 0; }
-	virtual int proc18() const { return 0; }
-	virtual int proc19() const { return 0; }
+	virtual bool proc16() const { return false; }
+	virtual bool proc17() const { return false; }
+	virtual bool proc18() const { return false; }
+	virtual bool proc19(int val) const { return false; }
 	virtual int proc20() const { return 0; }
 
 	/**
@@ -124,7 +137,10 @@ public:
 	 */
 	virtual void setSynFile(FileHandle file);
 
-	virtual int proc24() const { return 0; }
+	/**
+	 * Dumps data associated with the word to file
+	 */
+	virtual int save(SimpleFile *file) const { return 0; }
 };
 
 } // End of namespace Titanic


Commit: e5e0e22c56ed6dca6a3471b444720b76255025e0
    https://github.com/scummvm/scummvm/commit/e5e0e22c56ed6dca6a3471b444720b76255025e0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:32-04:00

Commit Message:
TITANIC: Beginnings of TTinput class

Changed paths:
  A engines/titanic/true_talk/tt_input.cpp
  A engines/titanic/true_talk/tt_input.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/titanic.h
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/title_engine.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_room_script.cpp
    engines/titanic/true_talk/tt_room_script.h
    engines/titanic/true_talk/tt_script_base.cpp
    engines/titanic/true_talk/tt_script_base.h
    engines/titanic/true_talk/tt_scripts.cpp
    engines/titanic/true_talk/tt_scripts.h
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_title_script.cpp
    engines/titanic/true_talk/tt_title_script.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index d52dc56..f8fe8f5 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -462,6 +462,7 @@ MODULE_OBJS := \
 	true_talk/true_talk_manager.o \
 	true_talk/tt_action.o \
 	true_talk/tt_adj.o \
+	true_talk/tt_input.o \
 	true_talk/tt_major_word.o \
 	true_talk/tt_npc_script.o \
 	true_talk/tt_parser.o \
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index d2efdcf..4e2d905 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -432,7 +432,7 @@ void CPetConversations::stopNPCTimer() {
 	_petControl->stopPetTimer(1);
 }
 
-TTNpcScript *CPetConversations::getNPCScript(const CString &name) const {
+TTnpcScript *CPetConversations::getNPCScript(const CString &name) const {
 	if (name.empty() || !_petControl)
 		return nullptr;
 	CGameManager *gameManager = _petControl->getGameManager();
@@ -517,13 +517,13 @@ void CPetConversations::copyColors(uint tableNum, uint colors[5]) {
 }
 
 void CPetConversations::updateDial(uint dialNum, const CString &npcName) {
-	TTNpcScript *script = getNPCScript(npcName);
+	TTnpcScript *script = getNPCScript(npcName);
 	uint newLevel = getDialLevel(dialNum, script);
 	npcDialChange(dialNum, _npcLevels[dialNum], newLevel);
 	_npcLevels[dialNum] = newLevel;
 }
 
-uint CPetConversations::getDialLevel(uint dialNum, TTNpcScript *script, int v) {
+uint CPetConversations::getDialLevel(uint dialNum, TTnpcScript *script, int v) {
 	bool flag = v != 0;
 
 	if (!script)
@@ -559,7 +559,7 @@ void CPetConversations::npcDialChange(uint dialNum, int oldLevel, int newLevel)
 }
 
 void CPetConversations::resetDials(const CString &name) {
-	TTNpcScript *script = getNPCScript(name);
+	TTnpcScript *script = getNPCScript(name);
 
 	for (int idx = 0; idx < TOTAL_DIALS; ++idx) {
 		uint oldLevel = _npcLevels[idx];
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 4073360..b88ddfa 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -112,7 +112,7 @@ private:
 	/**
 	 * Get the TrueTalk script associated with a given NPC
 	 */
-	TTNpcScript *getNPCScript(const CString &name) const;
+	TTnpcScript *getNPCScript(const CString &name) const;
 
 	/**
 	 * Handle a keypress
@@ -142,7 +142,7 @@ private:
 	/**
 	 * Get a dial level
 	 */
-	uint getDialLevel(uint dialNum, TTNpcScript *script, int v = 1);
+	uint getDialLevel(uint dialNum, TTnpcScript *script, int v = 1);
 
 	/**
 	 * Called when the dial for an NPC is being changed
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 78f19c5..c30ad36 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -119,7 +119,7 @@ public:
 	CMainGameWindow *_window;
 	Common::RandomSource _randomSource;
 	CScriptHandler *_scriptHandler;
-	TTScriptBase *_script;
+	TTscriptBase *_script;
 	CExeResources _exeResources;
 	CMovieList _activeMovies;
 	CString _itemNames[TOTAL_ITEMS];
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 18886c2..ac074e2 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -27,11 +27,11 @@
 
 namespace Titanic {
 
-class BarbotScript : public TTNpcScript {
+class BarbotScript : public TTnpcScript {
 public:
 	BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
 	virtual int proc6() const;
 	virtual void proc7(int v1, int v2);
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 2042ca9..ccd83d0 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 
 BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2) :
-		TTNpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
+		TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
 		_field2D0(0), _field2D4(0), _field2D8(0), _field2DC(0) {
 	CTrueTalkManager::setFlags(25, 0);
 	CTrueTalkManager::setFlags(24, 0);
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index ff9f849..d759583 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -27,7 +27,7 @@
 
 namespace Titanic {
 
-class BellbotScript : public TTNpcScript {
+class BellbotScript : public TTnpcScript {
 private:
 	int _array[150];
 	int _field2D0;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 5844664..65a13b5 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 
 DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2) :
-		TTNpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
+		TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
 	CTrueTalkManager::setFlags(18, 0);
 	CTrueTalkManager::setFlags(19, 0);
 	CTrueTalkManager::setFlags(20, 0);
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index d001f56..8db1a80 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -27,7 +27,7 @@
 
 namespace Titanic {
 
-class DeskbotScript : public TTNpcScript {
+class DeskbotScript : public TTnpcScript {
 public:
 	DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index b52c802..c812d31 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -27,13 +27,13 @@
 
 namespace Titanic {
 
-class DoorbotScript : public TTNpcScript {
+class DoorbotScript : public TTnpcScript {
 private:
 	int _array[148];
 public:
 	DoorbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
 	virtual int proc6() const;
 	virtual void proc7(int v1, int v2);
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index a6c3ed8..7bb355a 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -27,11 +27,11 @@
 
 namespace Titanic {
 
-class LiftbotScript : public TTNpcScript {
+class LiftbotScript : public TTnpcScript {
 public:
 	LiftbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
 	virtual int proc6() const;
 	virtual void proc7(int v1, int v2);
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 47ae96c..35f1efa 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 
 MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
 	const char *charName, int v3, int val2) :
-	TTNpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
+	TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
 	CTrueTalkManager::setFlags(9, 1);
 	CTrueTalkManager::setFlags(10, 0);
 	CTrueTalkManager::setFlags(11, 0);
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 7aaddf9..bd3e440 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -27,7 +27,7 @@
 
 namespace Titanic {
 
-class MaitreDScript : public TTNpcScript {
+class MaitreDScript : public TTnpcScript {
 public:
 	MaitreDScript(int val1, const char *charClass, int v2,
 			const char *charName, int v3, int val2);
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index 354f306..246ceb4 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -27,11 +27,11 @@
 
 namespace Titanic {
 
-class ParrotScript : public TTNpcScript {
+class ParrotScript : public TTnpcScript {
 public:
 	ParrotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
 	virtual int proc6() const;
 	virtual void proc7(int v1, int v2);
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index e923c37..041d490 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/true_talk/script_handler.h"
+#include "titanic/true_talk/tt_input.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
@@ -41,7 +42,7 @@ CScriptHandler::~CScriptHandler() {
 	delete _vocab;
 }
 
-ScriptChangedResult CScriptHandler::scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId) {
+ScriptChangedResult CScriptHandler::scriptChanged(TTroomScript *roomScript, TTnpcScript *npcScript, uint dialogueId) {
 	if (!npcScript || !roomScript) {
 		++_inputCtr;
 		return SCR_5;
@@ -57,12 +58,19 @@ ScriptChangedResult CScriptHandler::scriptChanged(TTRoomScript *roomScript, TTNp
 	error("TODO: CScriptHandler::scriptChanged");
 }
 
-void CScriptHandler::processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
+int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScript,
 		const TTstring &line) {
 	if (!roomScript || !line.isValid())
-		return;
+		return SS_5;
 	
+	TTinput *input = new TTinput(_inputCtr++, line, this, roomScript, npcScript);
+	_parser.processInput(input);
+
+	warning("TODO: CScriptHandler::processInput");
+
 	// TODO
+	delete input;
+	return SS_VALID;
 }
 
 SimpleFile *CScriptHandler::openResource(const CString &name) {
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 2da9371..86cc99c 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -50,7 +50,7 @@ public:
 class CScriptHandler {
 private:
 	CTitleEngine *_owner;
-	TTScriptBase *_script;
+	TTscriptBase *_script;
 	TTvocab *_vocab;
 	CExeResources &_resources;
 	int _field10;
@@ -69,9 +69,10 @@ public:
 	/**
 	 * Set the character and room
 	 */
-	ScriptChangedResult scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId);
+	ScriptChangedResult scriptChanged(TTroomScript *roomScript, 
+		TTnpcScript *npcScript, uint dialogueId);
 
-	void processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
+	int processInput(TTroomScript *roomScript, TTnpcScript *npcScript,
 		const TTstring &line);
 
 	/**
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 0aba07e..6917d0a 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -27,13 +27,13 @@
 
 namespace Titanic {
 
-class SuccUBusScript : public TTNpcScript {
+class SuccUBusScript : public TTnpcScript {
 private:
 	int _field2D0;
 public:
 	SuccUBusScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
+		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
 		_field2D0(0) {}
 
 	virtual int proc6() const;
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index 87491bf..10c32a7 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -42,10 +42,10 @@ public:
 class CTitleEngine {
 public:
 	CScriptHandler *_scriptHandler;
-	TTScriptBase *_script;
+	TTscriptBase *_script;
 public:
 	CTitleEngine();
-	~CTitleEngine();
+	virtual ~CTitleEngine();
 
 	/**
 	 * Setup the engine
@@ -75,7 +75,7 @@ public:
 	Common::Array<byte> _data;
 public:
 	STtitleEngine();
-	~STtitleEngine();
+	virtual ~STtitleEngine();
 
 	void reset();
 
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 7743d81..da3b207 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -179,13 +179,13 @@ void CTrueTalkManager::setFlags(int index, int val) {
 }
 
 void CTrueTalkManager::loadNPC(SimpleFile *file, int charId) {
-	TTNpcScript *script = _scripts.getNpcScript(charId);
+	TTnpcScript *script = _scripts.getNpcScript(charId);
 	if (script)
 		script->load(file);
 }
 
 void CTrueTalkManager::saveNPC(SimpleFile *file, int charId) const {
-	TTNpcScript *script = _scripts.getNpcScript(charId);
+	TTnpcScript *script = _scripts.getNpcScript(charId);
 	if (script) {
 		script->save(file);
 		file->writeNumber(MKTAG_BE('U', 'R', 'A', 'H'));
@@ -218,8 +218,8 @@ void CTrueTalkManager::update2() {
 }
 
 void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) {
-	TTNpcScript *npcScript = getNpcScript(npc);
-	TTRoomScript *roomScript = getRoomScript();
+	TTnpcScript *npcScript = getNpcScript(npc);
+	TTroomScript *roomScript = getRoomScript();
 	
 	_titleEngine.reset();
 	uint charId = npcScript->charId();
@@ -232,7 +232,7 @@ void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) {
 	setDialogue(npc, roomScript, view);
 }
 
-TTNpcScript *CTrueTalkManager::getTalker(const CString &name) const {
+TTnpcScript *CTrueTalkManager::getTalker(const CString &name) const {
 	if (name.contains("Doorbot"))
 		return _scripts.getNpcScript(104);
 	else if (name.contains("DeskBot"))
@@ -255,9 +255,9 @@ TTNpcScript *CTrueTalkManager::getTalker(const CString &name) const {
 	return nullptr;
 }
 
-TTNpcScript *CTrueTalkManager::getNpcScript(CTrueTalkNPC *npc) const {
+TTnpcScript *CTrueTalkManager::getNpcScript(CTrueTalkNPC *npc) const {
 	CString npcName = npc->getName();
-	TTNpcScript *script = getTalker(npcName);
+	TTnpcScript *script = getTalker(npcName);
 
 	if (!script) {
 		// Fall back on the default NPC script
@@ -267,9 +267,9 @@ TTNpcScript *CTrueTalkManager::getNpcScript(CTrueTalkNPC *npc) const {
 	return script;
 }
 
-TTRoomScript *CTrueTalkManager::getRoomScript() const {
+TTroomScript *CTrueTalkManager::getRoomScript() const {
 	CRoomItem *room = _gameManager->getRoom();
-	TTRoomScript *script = nullptr;
+	TTroomScript *script = nullptr;
 	if (room) {
 		int scriptId = room->getScriptId();
 		if (scriptId)
@@ -303,8 +303,8 @@ void CTrueTalkManager::loadAssets(CTrueTalkNPC *npc, int charId) {
 }
 
 void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CViewItem *view) {
-	TTNpcScript *npcScript = getNpcScript(npc);
-	TTRoomScript *roomScript = getRoomScript();
+	TTnpcScript *npcScript = getNpcScript(npc);
+	TTroomScript *roomScript = getRoomScript();
 	_titleEngine.reset();
 
 	if (npcScript && roomScript) {
@@ -320,7 +320,7 @@ void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CView
 	_currentNPC = nullptr;
 }
 
-void CTrueTalkManager::setDialogue(CTrueTalkNPC *npc, TTRoomScript *roomScript, CViewItem *view) {
+void CTrueTalkManager::setDialogue(CTrueTalkNPC *npc, TTroomScript *roomScript, CViewItem *view) {
 	// Get the dialog text
 	CString dialogueStr = readDialogueString();
 	if (dialogueStr.empty())
@@ -422,7 +422,7 @@ void CTrueTalkManager::triggerNPC(CTrueTalkNPC *npc) {
 	}
 }
 
-void CTrueTalkManager::setTalker(TTTalker *talker, TTRoomScript *roomScript, CViewItem *view, bool isParrot) {
+void CTrueTalkManager::setTalker(TTTalker *talker, TTroomScript *roomScript, CViewItem *view, bool isParrot) {
 	warning("TODO: CTrueTalkManager::setTalker");
 }
 
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 0712919..524f13e 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -42,7 +42,7 @@ class CTrueTalkManager {
 private:
 	CGameManager *_gameManager;
 	STtitleEngine _titleEngine;
-	TTScripts _scripts;
+	TTscripts _scripts;
 	int _currentCharId;
 	CDialogueFile *_dialogueFile;
 	int _dialogueId;
@@ -72,19 +72,19 @@ private:
 	/**
 	 * Gets the script associated with an NPC game object
 	 */
-	TTNpcScript *getNpcScript(CTrueTalkNPC *npc) const;
+	TTnpcScript *getNpcScript(CTrueTalkNPC *npc) const;
 
 	/**
 	 * Gets the script associated with the current room
 	 */
-	TTRoomScript *getRoomScript() const;
+	TTroomScript *getRoomScript() const;
 
 	/**
 	 * Loads assets for the current character, if it's changed
 	 */
 	void loadAssets(CTrueTalkNPC *npc, int charId);
 
-	void setDialogue(CTrueTalkNPC *npc, TTRoomScript *roomScript, CViewItem *view);
+	void setDialogue(CTrueTalkNPC *npc, TTroomScript *roomScript, CViewItem *view);
 
 	/**
 	 * Read in text from the dialogue file
@@ -101,7 +101,7 @@ private:
 	 */
 	void triggerNPC(CTrueTalkNPC *npc);
 
-	void setTalker(TTTalker *talker, TTRoomScript *roomScript, CViewItem *view, bool isParrot);
+	void setTalker(TTTalker *talker, TTroomScript *roomScript, CViewItem *view, bool isParrot);
 public:
 	static int _v1;
 	static int _v2;
@@ -169,7 +169,7 @@ public:
 	/**
 	 * Returns the scripts for the manager
 	 */
-	TTScripts &getScripts() { return _scripts; }
+	TTscripts &getScripts() { return _scripts; }
 
 	/**
 	 * Remove any completed talkers
@@ -186,7 +186,7 @@ public:
 	/**
 	 * Return a TrueTalk talker/script
 	 */
-	TTNpcScript *getTalker(const CString &name) const;
+	TTnpcScript *getTalker(const CString &name) const;
 
 	/**
 	 * Process player's input
diff --git a/engines/titanic/true_talk/tt_input.cpp b/engines/titanic/true_talk/tt_input.cpp
new file mode 100644
index 0000000..20fe863
--- /dev/null
+++ b/engines/titanic/true_talk/tt_input.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_input.h"
+#include "titanic/true_talk/script_handler.h"
+
+namespace Titanic {
+
+TTinputSubBase::TTinputSubBase() : _field0(0), _field4(0), _field8(0),
+	_fieldC(0), _field10(0), _field14(0), _field18(0), _field1C(0),
+	_field20(0), _field24(0) {
+}
+
+/*------------------------------------------------------------------------*/
+
+TTinput::TTinput(int inputCtr, const TTstring &line, CScriptHandler *owner,
+		TTroomScript *roomScript, TTnpcScript *npcScript) :
+		_owner(owner), _field2C(1), _inputCtr(inputCtr), _field34(0),
+		_field38(0), _line(line), _field4C(0), _roomScript(roomScript),
+		_npcScript(npcScript), _field58(0), _field5C(0) {
+	_status = _line.isValid() && _string2.isValid() ? SS_11: SS_VALID;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_input.h b/engines/titanic/true_talk/tt_input.h
new file mode 100644
index 0000000..9cb4b72
--- /dev/null
+++ b/engines/titanic/true_talk/tt_input.h
@@ -0,0 +1,77 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_INPUT_H
+#define TITANIC_TT_INPUT_H
+
+#include "titanic/true_talk/tt_npc_script.h"
+#include "titanic/true_talk/tt_room_script.h"
+#include "titanic/true_talk/tt_string.h"
+
+namespace Titanic {
+
+class CScriptHandler;
+
+class TTinputSubBase {
+public:
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+public:
+	TTinputSubBase();
+};
+
+class TTinputSub : public TTinputSubBase {
+public:
+};
+
+class TTinput {
+private:
+	CScriptHandler *_owner;
+	TTinputSub _sub;
+	int _field2C;
+	int _inputCtr;
+	int _field34;
+	int _field38;
+	TTstring _line;
+	TTstring _string2;
+	int _field4C;
+	TTroomScript *_roomScript;
+	TTnpcScript *_npcScript;
+	int _field58;
+	int _field5C;
+	int _status;
+public:
+	TTinput(int inputCtr, const TTstring &line, CScriptHandler *owner,
+		TTroomScript *roomScript, TTnpcScript *npcScript);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_INPUT_H */
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 40a50be..46b350d 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -26,17 +26,17 @@
 
 namespace Titanic {
 
-TTNpcScriptBase::TTNpcScriptBase(int charId, const char *charClass, int v2,
+TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTScriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
+		TTscriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
 		_charId(charId), _field54(0), _val2(val2) {
 }
 
 /*------------------------------------------------------------------------*/
 
-TTNpcScript::TTNpcScript(int charId, const char *charClass, int v2,
+TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTNpcScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
+		TTnpcScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
 		_subPtr(nullptr), _field60(0), _field64(0), _field68(0),
 		_field6C(0), _field70(0), _field74(0), _field78(0),
 		_field7C(0), _field80(0) {
@@ -51,95 +51,95 @@ TTNpcScript::TTNpcScript(int charId, const char *charClass, int v2,
 	resetFlags();
 }
 
-void TTNpcScript::resetFlags() {
+void TTnpcScript::resetFlags() {
 	Common::fill(&_array[26], &_array[146], 0);
 }
 
-void TTNpcScript::randomizeFlags() {
+void TTnpcScript::randomizeFlags() {
 	warning("TODO");
 }
 
-void TTNpcScript::proc4(int v) {
+void TTnpcScript::proc4(int v) {
 	warning("TODO");
 }
 
-int TTNpcScript::proc6() const {
+int TTnpcScript::proc6() const {
 	return 1;
 }
 
-void TTNpcScript::proc7(int v1, int v2) {
+void TTnpcScript::proc7(int v1, int v2) {
 	warning("TODO");
 }
 
-int TTNpcScript::proc8() const {
+int TTnpcScript::proc8() const {
 	return 0;
 }
 
-int TTNpcScript::proc9() const {
+int TTnpcScript::proc9() const {
 	return 2;
 }
 
-int TTNpcScript::proc11() const {
+int TTnpcScript::proc11() const {
 	return 2;
 }
 
-int TTNpcScript::proc12() const {
+int TTnpcScript::proc12() const {
 	return 1;
 }
 
-bool TTNpcScript::proc13() const {
+bool TTnpcScript::proc13() const {
 	warning("TODO");
 	return true;
 }
 
-void TTNpcScript::proc14(int v) {
+void TTnpcScript::proc14(int v) {
 	warning("TODO");
 }
 
-int TTNpcScript::proc15() const {
+int TTnpcScript::proc15() const {
 	return 0;
 }
 
-bool TTNpcScript::proc16() const {
+bool TTnpcScript::proc16() const {
 	return true;
 }
 
-bool TTNpcScript::proc17() const {
+bool TTnpcScript::proc17() const {
 	return true;
 }
 
-bool TTNpcScript::proc18() const {
+bool TTnpcScript::proc18() const {
 	return true;
 }
 
-void TTNpcScript::proc19(int v) {
+void TTnpcScript::proc19(int v) {
 	warning("TODO");
 }
 
-void TTNpcScript::proc20(int v) {
+void TTnpcScript::proc20(int v) {
 	warning("TODO");
 }
 
-int TTNpcScript::proc21(int v) {
+int TTnpcScript::proc21(int v) {
 	return v;
 }
 
-int TTNpcScript::proc22() const {
+int TTnpcScript::proc22() const {
 	return 0;
 }
 
-int TTNpcScript::proc23() const {
+int TTnpcScript::proc23() const {
 	return 0;
 }
 
-int TTNpcScript::proc25() const {
+int TTnpcScript::proc25() const {
 	return 0;
 }
 
-void TTNpcScript::proc26() {
+void TTnpcScript::proc26() {
 }
 
-void TTNpcScript::save(SimpleFile *file) {
+void TTnpcScript::save(SimpleFile *file) {
 	file->writeNumber(charId());
 	saveBody(file);
 
@@ -154,7 +154,7 @@ void TTNpcScript::save(SimpleFile *file) {
 		file->writeNumber(_array[idx]);
 }
 
-void TTNpcScript::load(SimpleFile *file) {
+void TTnpcScript::load(SimpleFile *file) {
 	loadBody(file);
 
 	int count = file->readNumber();
@@ -174,7 +174,7 @@ void TTNpcScript::load(SimpleFile *file) {
 	}
 }
 
-void TTNpcScript::saveBody(SimpleFile *file) {
+void TTnpcScript::saveBody(SimpleFile *file) {
 	int v = proc31();
 	file->writeNumber(v);
 
@@ -183,7 +183,7 @@ void TTNpcScript::saveBody(SimpleFile *file) {
 	}
 }
 
-void TTNpcScript::loadBody(SimpleFile *file) {
+void TTnpcScript::loadBody(SimpleFile *file) {
 	int count = file->readNumber();
 	preLoad();
 
@@ -196,38 +196,38 @@ void TTNpcScript::loadBody(SimpleFile *file) {
 	}
 }
 
-int TTNpcScript::proc31() {
+int TTnpcScript::proc31() {
 	warning("TODO");
 	return 0;
 }
 
-void TTNpcScript::proc32() {
+void TTnpcScript::proc32() {
 	warning("TODO");
 }
 
-void TTNpcScript::proc33(int v1, int v2) {
+void TTnpcScript::proc33(int v1, int v2) {
 	warning("TODO");
 }
 
-int TTNpcScript::proc34() {
+int TTnpcScript::proc34() {
 	warning("TODO");
 	return 0;
 }
 
-int TTNpcScript::getDialLevel(uint dialNum, bool flag) {
+int TTnpcScript::getDialLevel(uint dialNum, bool flag) {
 	warning("TODO");
 	return 0;
 }
 
-int TTNpcScript::proc36() const {
+int TTnpcScript::proc36() const {
 	return 0;
 }
 
-int TTNpcScript::proc37() const {
+int TTnpcScript::proc37() const {
 	return 0;
 }
 
-void TTNpcScript::preLoad() {
+void TTnpcScript::preLoad() {
 	if (_subPtr) {
 		error("TODO");
 	}
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index f3df956..58c1d34 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -29,14 +29,14 @@
 namespace Titanic {
 
 
-class TTNpcScriptBase : public TTScriptBase {
+class TTnpcScriptBase : public TTscriptBase {
 protected:
 	int _field54;
 	int _val2;
 public:
 	int _charId;
 public:
-	TTNpcScriptBase(int charId, const char *charClass, int v2,
+	TTnpcScriptBase(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,
 		int v5, int v6, int v7);
 
@@ -48,7 +48,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTScriptBase *roomScript, uint id) = 0;
+	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id) = 0;
 
 	virtual int proc11() const = 0;
 	virtual int proc12() const = 0;
@@ -56,7 +56,7 @@ public:
 	int charId() const { return _charId; }
 };
 
-class TTNpcScript : public TTNpcScriptBase {
+class TTnpcScript : public TTnpcScriptBase {
 protected:
 	byte *_subPtr;
 	int _field60;
@@ -74,7 +74,7 @@ protected:
 
 	void randomizeFlags();
 public:
-	TTNpcScript(int charId, const char *charClass, int v2,
+	TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,
 		int v5, int v6, int v7);
 
@@ -87,7 +87,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTScriptBase *roomScript, uint id) {
+	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id) {
 		return SCR_2;
 	}
 
@@ -129,7 +129,7 @@ public:
 	/**
 	 * Called with the script and id changes
 	 */
-	ScriptChangedResult notifyScript(TTScriptBase *npcScript, int id) {
+	ScriptChangedResult notifyScript(TTscriptBase *npcScript, int id) {
 		return scriptChanged(npcScript, id);
 	}
 };
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index ad40cbc..5bae72c 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -22,7 +22,12 @@
 
 #include "titanic/true_talk/tt_parser.h"
 #include "titanic/true_talk/script_handler.h"
+#include "titanic/true_talk/tt_input.h"
 
 namespace Titanic {
 
+void TTparser::processInput(TTinput *input) {
+	warning("TODO: TTparser::processInput");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 767406a..8997706 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -23,6 +23,8 @@
 #ifndef TITANIC_TT_PARSER_H
 #define TITANIC_TT_PARSER_H
 
+#include "titanic/true_talk/tt_input.h"
+
 namespace Titanic {
 
 class CScriptHandler;
@@ -39,6 +41,11 @@ public:
 public:
 	TTparser(CScriptHandler *owner) : _owner(owner), _field4(0), _field8(0),
 		_fieldC(0), _field10(0), _field14(0), _field18(0) {}
+
+	/**
+	 * Gets passed a newly created input wrapper during conversation text processing
+	 */
+	void processInput(TTinput *input);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_room_script.cpp b/engines/titanic/true_talk/tt_room_script.cpp
index 2ade049..62f60f4 100644
--- a/engines/titanic/true_talk/tt_room_script.cpp
+++ b/engines/titanic/true_talk/tt_room_script.cpp
@@ -25,42 +25,42 @@
 
 namespace Titanic {
 
-TTRoomScriptBase::TTRoomScriptBase(int scriptId,
+TTroomScriptBase::TTroomScriptBase(int scriptId,
 		const char *charClass, const char *charName,
 		int v3, int v4, int v5, int v6, int v2, int v7) : _scriptId(scriptId),
-		TTScriptBase(3, charClass, v2, charName, v3, v4, v5, v6, v7) {
+		TTscriptBase(3, charClass, v2, charName, v3, v4, v5, v6, v7) {
 }
 
 /*------------------------------------------------------------------------*/
 
-TTRoomScript::TTRoomScript(int scriptId) :
-	TTRoomScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) {
+TTroomScript::TTroomScript(int scriptId) :
+	TTroomScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) {
 }
 
-void TTRoomScript::proc6() {
+void TTroomScript::proc6() {
 	warning("TODO");
 }
 
-void TTRoomScript::proc7() {
+void TTroomScript::proc7() {
 	warning("TODO");
 }
 
-void TTRoomScript::proc8() {
+void TTroomScript::proc8() {
 	warning("TODO");
 }
 
-void TTRoomScript::proc9() {
+void TTroomScript::proc9() {
 	warning("TODO");
 }
 
-ScriptChangedResult TTRoomScript::scriptChanged(TTScriptBase *npcScript, int id) {
+ScriptChangedResult TTroomScript::scriptChanged(TTscriptBase *npcScript, int id) {
 	if (id == 1)
 		_field54 = 1;
 	
 	return SCR_1;
 }
 
-void TTRoomScript::proc11() {
+void TTroomScript::proc11() {
 	warning("TODO");
 }
 
diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h
index 30133b2..7f72573 100644
--- a/engines/titanic/true_talk/tt_room_script.h
+++ b/engines/titanic/true_talk/tt_room_script.h
@@ -27,11 +27,11 @@
 
 namespace Titanic {
 
-class TTRoomScriptBase : public TTScriptBase {
+class TTroomScriptBase : public TTscriptBase {
 public:
 	int _scriptId;
 public:
-	TTRoomScriptBase(int scriptId, const char *charClass, const char *charName,
+	TTroomScriptBase(int scriptId, const char *charClass, const char *charName,
 		int v3, int v4, int v5, int v6, int v2, int v7);
 
 	virtual void proc6() = 0;
@@ -42,17 +42,17 @@ public:
 	/**
 	 * Called when the script changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTScriptBase *npcScript, int id) = 0;
+	virtual ScriptChangedResult scriptChanged(TTscriptBase *npcScript, int id) = 0;
 	
 	virtual void proc11() = 0;
 };
 
 
-class TTRoomScript : public TTRoomScriptBase {
+class TTroomScript : public TTroomScriptBase {
 private:
 	int _field54;
 public:
-	TTRoomScript(int scriptId);
+	TTroomScript(int scriptId);
 
 	virtual void proc6();
 	virtual void proc7();
@@ -62,14 +62,14 @@ public:
 	/**
 	 * Called when the script changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTScriptBase *npcScript, int id);
+	virtual ScriptChangedResult scriptChanged(TTscriptBase *npcScript, int id);
 
 	virtual void proc11();
 
 	/**
 	 * Called with the new script and id
 	 */
-	ScriptChangedResult notifyScript(TTScriptBase *npcScript, int id) {
+	ScriptChangedResult notifyScript(TTscriptBase *npcScript, int id) {
 		return scriptChanged(npcScript, id);
 	}
 };
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index 1430f03..e937f0a 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -25,7 +25,7 @@
 
 namespace Titanic {
 
-TTScriptBase::TTScriptBase(int v1, const char *charClass, int v2,
+TTscriptBase::TTscriptBase(int v1, const char *charClass, int v2,
 		const char *charName, int v3, int v4, int v5, int v6, int v7) :
 		_charName(charName), _charClass(charClass), 
 		_field4(0), _field8(0), _fieldC(0),
@@ -50,13 +50,13 @@ TTScriptBase::TTScriptBase(int v1, const char *charClass, int v2,
 		reset();
 }
 
-bool TTScriptBase::areNamesValid() {
+bool TTscriptBase::areNamesValid() {
 	bool result = !_charName.isValid() && !_charClass.isValid();
 	_status = result ? 0 : 11;
 	return result;
 }
 
-void TTScriptBase::reset() {
+void TTscriptBase::reset() {
 	_field4 = 0;
 	_field8 = 4;
 	_fieldC = 0;
@@ -73,19 +73,23 @@ void TTScriptBase::reset() {
 	_field48 = 0;
 }
 
-void TTScriptBase::proc2(int v) {
+void TTscriptBase::processInput(TTinput *input) {
+	warning("TODO: TTscriptBase::processInput");
+}
+
+void TTscriptBase::proc2(int v) {
 	warning("TODO");
 }
 
-void TTScriptBase::proc3(int v) {
+void TTscriptBase::proc3(int v) {
 	warning("TODO");
 }
 
-void TTScriptBase::proc4(int v) {
+void TTscriptBase::proc4(int v) {
 	warning("TODO");
 }
 
-void TTScriptBase::proc5() {
+void TTscriptBase::proc5() {
 	warning("TODO");
 }
 
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index dc0db2c..0aac1ed 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -31,7 +31,9 @@ enum ScriptChangedResult {
 	SCR_1 = 1, SCR_2 = 2, SCR_3 = 3, SCR_4 = 4, SCR_5 = 5
 };
 
-class TTScriptBase {
+class TTinput;
+
+class TTscriptBase {
 private:
 	void reset();
 protected:
@@ -52,13 +54,18 @@ protected:
 	int _field48;
 	int _status;
 public:
-	TTScriptBase(int v1, const char *charClass, int v2, const char *charName,
+	TTscriptBase(int v1, const char *charClass, int v2, const char *charName,
 		int v3, int v4, int v5, int v6, int v7);
 
 	bool areNamesValid();
 
 	int getStatus() const { return _status; }
 
+	/**
+	 * Gets passed a newly created input wrapper during conversation text processing
+	 */
+	void processInput(TTinput *input);
+
 	virtual void proc2(int v);
 
 	virtual void proc3(int v);
diff --git a/engines/titanic/true_talk/tt_scripts.cpp b/engines/titanic/true_talk/tt_scripts.cpp
index 96daf76..fbdf52f 100644
--- a/engines/titanic/true_talk/tt_scripts.cpp
+++ b/engines/titanic/true_talk/tt_scripts.cpp
@@ -33,9 +33,9 @@
 
 namespace Titanic {
 	
-TTNpcScript *TTNpcScriptList::findById(int charId) const {
-	for (TTNpcScriptList::const_iterator i = begin(); i != end(); ++i) {
-		const TTNpcScriptListItem *item = *i;
+TTnpcScript *TTnpcScriptList::findById(int charId) const {
+	for (TTnpcScriptList::const_iterator i = begin(); i != end(); ++i) {
+		const TTnpcScriptListItem *item = *i;
 		if (item->_npcScript->_charId == charId)
 			return item->_npcScript;
 	}
@@ -45,9 +45,9 @@ TTNpcScript *TTNpcScriptList::findById(int charId) const {
 
 /*------------------------------------------------------------------------*/
 
-TTRoomScript *TTRoomScriptList::findById(int scriptId) const {
-	for (TTRoomScriptList::const_iterator i = begin(); i != end(); ++i) {
-		const TTRoomScriptListItem *item = *i;
+TTroomScript *TTroomScriptList::findById(int scriptId) const {
+	for (TTroomScriptList::const_iterator i = begin(); i != end(); ++i) {
+		const TTroomScriptListItem *item = *i;
 		if (item->_item->_scriptId == scriptId)
 			return item->_item;
 	}
@@ -57,11 +57,11 @@ TTRoomScript *TTRoomScriptList::findById(int scriptId) const {
 
 /*------------------------------------------------------------------------*/
 
-TTScripts::TTScripts(CTitleEngine *titleEngine) :
+TTscripts::TTscripts(CTitleEngine *titleEngine) :
 		_titleEngine(titleEngine), _field24(0), _field28(0) {
 	// Load room scripts
 	for (int scriptNum = 100; scriptNum < 133; ++scriptNum)
-		addScript(new TTRoomScript(scriptNum));
+		addScript(new TTroomScript(scriptNum));
 
 	// Load npc scripts
 	addScript(new DoorbotScript(104, "Doorbot", 0, "Fentible", 11, 1, -1, -1, -1, 0), 100);
@@ -74,25 +74,25 @@ TTScripts::TTScripts(CTitleEngine *titleEngine) :
 	addScript(new SuccUBusScript(111, "Succubus", 0, "Shorbert", 9, 1, -1, -1, -1, 0), 110);
 }
 
-void TTScripts::addScript(TTNpcScript *script, int scriptId) {
+void TTscripts::addScript(TTnpcScript *script, int scriptId) {
 	script->proc13();
 	
 	// Find the room script this is associated with
-	TTRoomScript *roomScript = getRoomScript(scriptId);
+	TTroomScript *roomScript = getRoomScript(scriptId);
 	assert(roomScript);
 
-	_npcScripts.push_back(new TTNpcScriptListItem(script, roomScript));
+	_npcScripts.push_back(new TTnpcScriptListItem(script, roomScript));
 }
 
-void TTScripts::addScript(TTRoomScript *script) {
-	_roomScripts.push_back(new TTRoomScriptListItem(script));
+void TTscripts::addScript(TTroomScript *script) {
+	_roomScripts.push_back(new TTroomScriptListItem(script));
 }
 
-TTRoomScript *TTScripts::getRoomScript(int scriptId) const {
+TTroomScript *TTscripts::getRoomScript(int scriptId) const {
 	return _roomScripts.findById(scriptId);
 }
 
-TTNpcScript *TTScripts::getNpcScript(int charId) const {
+TTnpcScript *TTscripts::getNpcScript(int charId) const {
 	return _npcScripts.findById(charId);
 }
 
diff --git a/engines/titanic/true_talk/tt_scripts.h b/engines/titanic/true_talk/tt_scripts.h
index 8dd2e93..afcc2c3 100644
--- a/engines/titanic/true_talk/tt_scripts.h
+++ b/engines/titanic/true_talk/tt_scripts.h
@@ -31,33 +31,33 @@ namespace Titanic {
 
 class CTitleEngine;
 
-class TTNpcScriptListItem : public ListItem {
+class TTnpcScriptListItem : public ListItem {
 public:
-	TTNpcScript *_npcScript;
-	TTRoomScript *_roomScript;
+	TTnpcScript *_npcScript;
+	TTroomScript *_roomScript;
 public:
-	TTNpcScriptListItem() : _npcScript(nullptr), _roomScript(nullptr) {}
-	TTNpcScriptListItem(TTNpcScript *script, TTRoomScript *roomScript) :
+	TTnpcScriptListItem() : _npcScript(nullptr), _roomScript(nullptr) {}
+	TTnpcScriptListItem(TTnpcScript *script, TTroomScript *roomScript) :
 		_npcScript(script), _roomScript(roomScript) {}
-	virtual ~TTNpcScriptListItem() { delete _npcScript; }
+	virtual ~TTnpcScriptListItem() { delete _npcScript; }
 };
 
-PTR_LIST_ITEM(TTRoomScript);
+PTR_LIST_ITEM(TTroomScript);
 
-class TTNpcScriptList : public List<TTNpcScriptListItem> {
+class TTnpcScriptList : public List<TTnpcScriptListItem> {
 public:
-	TTNpcScript *findById(int charId) const;
+	TTnpcScript *findById(int charId) const;
 };
 
-class TTRoomScriptList : public List<TTRoomScriptListItem> {
+class TTroomScriptList : public List<TTroomScriptListItem> {
 public:
-	TTRoomScript *findById(int scriptId) const;
+	TTroomScript *findById(int scriptId) const;
 };
 
-class TTScripts {
+class TTscripts {
 private:
-	TTNpcScriptList _npcScripts;
-	TTRoomScriptList _roomScripts;
+	TTnpcScriptList _npcScripts;
+	TTroomScriptList _roomScripts;
 	CTitleEngine *_titleEngine;
 	int _field24;
 	int _field28;
@@ -65,24 +65,24 @@ private:
 	/**
 	 * Add a named script to the named scripts list
 	 */
-	void addScript(TTNpcScript *script, int charId);
+	void addScript(TTnpcScript *script, int charId);
 
 	/**
 	 * Add an unnamed script to the unnamed scripts list
 	 */
-	void addScript(TTRoomScript *script);
+	void addScript(TTroomScript *script);
 public:
-	TTScripts(CTitleEngine *titleEngine);
+	TTscripts(CTitleEngine *titleEngine);
 
 	/**
 	 * Return a pointer to the specified room script
 	 */
-	TTRoomScript *getRoomScript(int scriptId) const;
+	TTroomScript *getRoomScript(int scriptId) const;
 
 	/**
 	 * Return a pointer to the specified character script
 	 */
-	TTNpcScript *getNpcScript(int charId) const;
+	TTnpcScript *getNpcScript(int charId) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 0256f10..1a95b4e 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -38,7 +38,7 @@ struct TTstringData {
 	TTstringData(const CString &str) : _string(str), _referenceCount(1) {}
 };
 
-enum TTstringStatus { SS_VALID = 0, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_13 = 13 };
+enum TTstringStatus { SS_VALID = 0, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_11 = 11, SS_13 = 13 };
 
 class TTstring {
 private:
diff --git a/engines/titanic/true_talk/tt_title_script.cpp b/engines/titanic/true_talk/tt_title_script.cpp
index af784e3..85b56d0 100644
--- a/engines/titanic/true_talk/tt_title_script.cpp
+++ b/engines/titanic/true_talk/tt_title_script.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-TTTitleScript::TTTitleScript() : TTScriptBase(1, "", 0, "", 0, -1, -1, -1, 0),
+TTTitleScript::TTTitleScript() : TTscriptBase(1, "", 0, "", 0, -1, -1, -1, 0),
 		_field50(0), _field5C(-1), _field60(0) {	
 }
 
diff --git a/engines/titanic/true_talk/tt_title_script.h b/engines/titanic/true_talk/tt_title_script.h
index a1efd11..f02e591 100644
--- a/engines/titanic/true_talk/tt_title_script.h
+++ b/engines/titanic/true_talk/tt_title_script.h
@@ -28,7 +28,7 @@
 
 namespace Titanic {
 
-class TTTitleScript : public TTScriptBase {
+class TTTitleScript : public TTscriptBase {
 private:
 	int _field50;
 	TTstring _string1;


Commit: e862d80cd2f57b3eebdedb9f87c11fa3b5106e6a
    https://github.com/scummvm/scummvm/commit/e862d80cd2f57b3eebdedb9f87c11fa3b5106e6a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:33-04:00

Commit Message:
TITANIC: Beginning of parser input line normalization

Changed paths:
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/tt_input.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_script_base.cpp
    engines/titanic/true_talk/tt_script_base.h
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h



diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 041d490..2e2a148 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -65,6 +65,8 @@ int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScrip
 	
 	TTinput *input = new TTinput(_inputCtr++, line, this, roomScript, npcScript);
 	_parser.processInput(input);
+	roomScript->processInput(input);
+	npcScript->processInput(input);
 
 	warning("TODO: CScriptHandler::processInput");
 
diff --git a/engines/titanic/true_talk/tt_input.h b/engines/titanic/true_talk/tt_input.h
index 9cb4b72..7e6fd92 100644
--- a/engines/titanic/true_talk/tt_input.h
+++ b/engines/titanic/true_talk/tt_input.h
@@ -59,7 +59,6 @@ private:
 	int _inputCtr;
 	int _field34;
 	int _field38;
-	TTstring _line;
 	TTstring _string2;
 	int _field4C;
 	TTroomScript *_roomScript;
@@ -68,6 +67,8 @@ private:
 	int _field5C;
 	int _status;
 public:
+	TTstring _line;
+public:
 	TTinput(int inputCtr, const TTstring &line, CScriptHandler *owner,
 		TTroomScript *roomScript, TTnpcScript *npcScript);
 };
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 5bae72c..a48fcae 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -26,8 +26,34 @@
 
 namespace Titanic {
 
-void TTparser::processInput(TTinput *input) {
+int TTparser::processInput(TTinput *input) {
+	_input = input;
+	if (normalize(input))
+		return 0;
+
 	warning("TODO: TTparser::processInput");
+	return 0;
+}
+
+int TTparser::normalize(TTinput *input) {
+	TTstring *line = new TTstring();
+
+	for (const char *lineP = input->_line.c_str(); lineP; ++lineP) {
+		char c = *lineP;
+		if (Common::isLower(c)) {
+			(*line) += c;
+		} else if (Common::isSpace(c)) {
+			if (!line->empty() && line->lastChar() != ' ')
+				(*line) += ' ';
+		} else if (Common::isUpper(c)) {
+			(*line) += toupper(c);
+		} else if (Common::isDigit(c)) {
+			// TODO: num handling
+		}
+		// TODO other cases
+	}
+
+	return 0;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 8997706..7df82b0 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -30,22 +30,24 @@ namespace Titanic {
 class CScriptHandler;
 
 class TTparser {
+private:
+	int normalize(TTinput *input);
 public:
 	CScriptHandler *_owner;
 	int _field4;
-	int _field8;
+	TTinput *_input;
 	int _fieldC;
 	int _field10;
 	int _field14;
 	int _field18;
 public:
-	TTparser(CScriptHandler *owner) : _owner(owner), _field4(0), _field8(0),
-		_fieldC(0), _field10(0), _field14(0), _field18(0) {}
+	TTparser(CScriptHandler *owner) : _owner(owner), _field4(0),
+		_input(nullptr), _fieldC(0), _field10(0), _field14(0), _field18(0) {}
 
 	/**
 	 * Gets passed a newly created input wrapper during conversation text processing
 	 */
-	void processInput(TTinput *input);
+	int processInput(TTinput *input);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index e937f0a..88f06a4 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -73,8 +73,9 @@ void TTscriptBase::reset() {
 	_field48 = 0;
 }
 
-void TTscriptBase::processInput(TTinput *input) {
+int TTscriptBase::processInput(TTinput *input) {
 	warning("TODO: TTscriptBase::processInput");
+	return 0;
 }
 
 void TTscriptBase::proc2(int v) {
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index 0aac1ed..12abb5c 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -64,7 +64,7 @@ public:
 	/**
 	 * Gets passed a newly created input wrapper during conversation text processing
 	 */
-	void processInput(TTinput *input);
+	int processInput(TTinput *input);
 
 	virtual void proc2(int v);
 
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index 7a39d71..338b7b5 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -80,6 +80,37 @@ void TTstring::operator=(const char *str) {
 	_status = SS_VALID;
 }
 
+TTstring &TTstring::operator+=(const char *str) {
+	_data->_string += str;
+	return *this;
+}
+
+TTstring &TTstring::operator+=(const TTstring &str) {
+	_data->_string += str;
+	return *this;
+}
+
+TTstring &TTstring::operator+=(char c) {
+	_data->_string += c;
+	return *this;
+}
+
+bool TTstring::empty() const {
+	return _data->_string.empty();
+}
+
+char TTstring::firstChar() const {
+	return _data->_string.firstChar();
+}
+
+char TTstring::lastChar() const {
+	return _data->_string.lastChar();
+}
+
+TTstring *TTstring::copy() const {
+	return new TTstring(c_str());
+}
+
 bool TTstring::isValid() const {
 	return _status == SS_VALID;
 }
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 1a95b4e..8fe7127 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -54,6 +54,17 @@ public:
 	void operator=(const TTstring &str);
 	void operator=(const CString &str);
 	void operator=(const char *str);
+	TTstring &operator+=(const char *str);
+	TTstring &operator+=(const TTstring &str);
+	TTstring &operator+=(char c);
+	bool empty() const;
+	char firstChar() const;
+	char lastChar() const;
+
+	/**
+	 * Create a new copy of the string
+	 */
+	TTstring *copy() const;
 
 	/**
 	 * Returns true if the string is valid


Commit: 68e230182c1f0524a536422bbb669788cf388782
    https://github.com/scummvm/scummvm/commit/68e230182c1f0524a536422bbb669788cf388782
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:35-04:00

Commit Message:
TITANIC: Implement TTparser normalize

Changed paths:
    common/util.cpp
    common/util.h
    engines/titanic/true_talk/tt_input.cpp
    engines/titanic/true_talk/tt_input.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h



diff --git a/common/util.cpp b/common/util.cpp
index 8e0a2fd..62a1baf 100644
--- a/common/util.cpp
+++ b/common/util.cpp
@@ -28,6 +28,7 @@
 #define FORBIDDEN_SYMBOL_EXCEPTION_isspace
 #define FORBIDDEN_SYMBOL_EXCEPTION_isupper
 #define FORBIDDEN_SYMBOL_EXCEPTION_isprint
+#define FORBIDDEN_SYMBOL_EXCEPTION_ispunct
 
 
 #include "common/util.h"
@@ -150,4 +151,10 @@ bool isPrint(int c) {
 	ENSURE_ASCII_CHAR(c);
 	return isprint((byte)c);
 }
+
+bool isPunct(int c) {
+	ENSURE_ASCII_CHAR(c);
+	return ispunct((byte)c);
+}
+
 } // End of namespace Common
diff --git a/common/util.h b/common/util.h
index f51aa00..1f635f3 100644
--- a/common/util.h
+++ b/common/util.h
@@ -177,6 +177,17 @@ bool isUpper(int c);
  * @return		true if the character is printable, false otherwise.
  */
 bool isPrint(int c);
+
+
+/**
+ * Test whether the given character is a punctuation character, 
+ * (i.e not alphanumeric.
+ *
+ * @param c		the character to test
+ * @return		true if the character is punctuation, false otherwise.
+ */
+bool isPunct(int c);
+
 } // End of namespace Common
 
 #endif
diff --git a/engines/titanic/true_talk/tt_input.cpp b/engines/titanic/true_talk/tt_input.cpp
index 20fe863..5d48042 100644
--- a/engines/titanic/true_talk/tt_input.cpp
+++ b/engines/titanic/true_talk/tt_input.cpp
@@ -40,4 +40,8 @@ TTinput::TTinput(int inputCtr, const TTstring &line, CScriptHandler *owner,
 	_status = _line.isValid() && _string2.isValid() ? SS_11: SS_VALID;
 }
 
+void TTinput::set38(int val) {
+	_field38 = val;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_input.h b/engines/titanic/true_talk/tt_input.h
index 7e6fd92..e4d91d7 100644
--- a/engines/titanic/true_talk/tt_input.h
+++ b/engines/titanic/true_talk/tt_input.h
@@ -71,6 +71,8 @@ public:
 public:
 	TTinput(int inputCtr, const TTstring &line, CScriptHandler *owner,
 		TTroomScript *roomScript, TTnpcScript *npcScript);
+
+	void set38(int v);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index a48fcae..2d958f8 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -36,24 +36,138 @@ int TTparser::processInput(TTinput *input) {
 }
 
 int TTparser::normalize(TTinput *input) {
-	TTstring *line = new TTstring();
+	TTstring *destLine = new TTstring();
+	const TTstring &srcLine = input->_line;
+	int srcSize = srcLine.size();
+	int savedIndex = 0;
+	int counter1 = 0;
+	int commandVal;
 
-	for (const char *lineP = input->_line.c_str(); lineP; ++lineP) {
-		char c = *lineP;
+	for (int index = 0; index < srcSize; ++index) {
+		char c = srcLine[index];
 		if (Common::isLower(c)) {
-			(*line) += c;
+			(*destLine) += c;
 		} else if (Common::isSpace(c)) {
-			if (!line->empty() && line->lastChar() != ' ')
-				(*line) += ' ';
+			if (!destLine->empty() && destLine->lastChar() != ' ')
+				(*destLine) += ' ';
 		} else if (Common::isUpper(c)) {
-			(*line) += toupper(c);
+			(*destLine) += toupper(c);
 		} else if (Common::isDigit(c)) {
-			// TODO: num handling
+			if (c == '0' && isSpecialCommand(srcLine, index)) {
+				input->set38(10);
+			} else {
+				// Iterate through all the digits of the number
+				(*destLine) += c;
+				while (Common::isDigit(srcLine[index + 1]))
+					(*destLine) += srcLine[++index];
+			}
+		} else if (Common::isPunct(c)) {
+			bool flag = false;
+			switch (c) {
+			case '!':
+				input->set38(3);
+				break;
+			
+			case '\'':
+				if (!normalizeQuotedString(srcLine, index, *destLine))
+					flag = true;
+				break;
+			
+			case '.':
+				input->set38(1);
+				break;
+			
+			case ':':
+				commandVal = isSpecialCommand(srcLine, index);
+				if (commandVal) {
+					input->set38(commandVal);
+					index += 2;
+				} else {
+					flag = true;
+				}
+				break;
+			
+			case ';':
+				commandVal = isSpecialCommand(srcLine, index);
+				if (commandVal == 6) {
+					input->set38(7);
+					index += 2;
+				} else if (commandVal != 0) {
+					input->set38(commandVal);
+					index += 2;
+				}
+				break;
+			
+			case '<':
+				++index;
+				commandVal = isSpecialCommand(srcLine, index);
+				if (commandVal == 6) {
+					input->set38(12);
+				} else {
+					--index;
+					flag = true;
+				}
+				break;
+
+			case '>':
+				++index;
+				commandVal = isSpecialCommand(srcLine, index);
+				if (commandVal == 6 || commandVal == 9) {
+					input->set38(11);
+				} else {
+					--index;
+					flag = true;
+				}
+				break;
+
+			case '?':
+				input->set38(2);
+				break;
+
+			default:
+				flag = true;
+				break;
+			}
+
+			if (flag && (!savedIndex || (index - savedIndex) == 1))
+				++counter1;
+
+			savedIndex = index;
 		}
-		// TODO other cases
 	}
 
 	return 0;
 }
 
+int TTparser::isSpecialCommand(const TTstring &str, int &index) {
+	if (str[index] != ':' && str[index] != ';')
+		return 0;
+
+	if (str[index + 1] != '-')
+		return 0;
+
+	index += 2;
+	switch (str[index]) {
+	case '(':
+	case '<':
+		return 8;
+
+	case ')':
+	case '>':
+		return 6;
+
+	case 'P':
+	case 'p':
+		return 9;
+
+	default:
+		return 5;
+	}
+}
+
+bool TTparser::normalizeQuotedString(const TTstring &srcLine, int srcIndex, TTstring &destLine) {
+	// TODO
+	return false;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 7df82b0..d05835d 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -31,7 +31,21 @@ class CScriptHandler;
 
 class TTparser {
 private:
+	/**
+	 * Normalizes a passed input, taking care of things like removing extra
+	 * spaces and lowercasing everything
+	 */
 	int normalize(TTinput *input);
+	
+	/**
+	 * Submethod called by normalize to handle text following single quote chracters
+	 */
+	bool normalizeQuotedString(const TTstring &srcLine, int srcIndex, TTstring &destLine);
+
+	/**
+	 * Checks for what is likely special developer cheat codes
+	 */
+	static int isSpecialCommand(const TTstring &str, int &index);
 public:
 	CScriptHandler *_owner;
 	int _field4;
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index 338b7b5..5574cff 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -95,6 +95,10 @@ TTstring &TTstring::operator+=(char c) {
 	return *this;
 }
 
+const char &TTstring::operator[](uint index) {
+	return *(c_str() + index);
+}
+
 bool TTstring::empty() const {
 	return _data->_string.empty();
 }
@@ -107,6 +111,10 @@ char TTstring::lastChar() const {
 	return _data->_string.lastChar();
 }
 
+int TTstring::size() const {
+	return _data->_string.size();
+}
+
 TTstring *TTstring::copy() const {
 	return new TTstring(c_str());
 }
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 8fe7127..3b2b6a2 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -57,9 +57,11 @@ public:
 	TTstring &operator+=(const char *str);
 	TTstring &operator+=(const TTstring &str);
 	TTstring &operator+=(char c);
+	const char &operator[](uint index);
 	bool empty() const;
 	char firstChar() const;
 	char lastChar() const;
+	int size() const;
 
 	/**
 	 * Create a new copy of the string


Commit: 1da409ca9891a46bed2a61fc07946165c670c4e6
    https://github.com/scummvm/scummvm/commit/1da409ca9891a46bed2a61fc07946165c670c4e6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:36-04:00

Commit Message:
TITANIC: Rename stub method to normalizeContraction

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 2d958f8..0bb30a1 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -69,7 +69,7 @@ int TTparser::normalize(TTinput *input) {
 				break;
 			
 			case '\'':
-				if (!normalizeQuotedString(srcLine, index, *destLine))
+				if (!normalizeContraction(srcLine, index, *destLine))
 					flag = true;
 				break;
 			
@@ -165,7 +165,7 @@ int TTparser::isSpecialCommand(const TTstring &str, int &index) {
 	}
 }
 
-bool TTparser::normalizeQuotedString(const TTstring &srcLine, int srcIndex, TTstring &destLine) {
+bool TTparser::normalizeContraction(const TTstring &srcLine, int srcIndex, TTstring &destLine) {
 	// TODO
 	return false;
 }
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index d05835d..3e31257 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -38,9 +38,10 @@ private:
 	int normalize(TTinput *input);
 	
 	/**
-	 * Submethod called by normalize to handle text following single quote chracters
+	 * Submethod called by normalize to handle expanding contacted word pairs
+	 * like can't, should've, and so on.
 	 */
-	bool normalizeQuotedString(const TTstring &srcLine, int srcIndex, TTstring &destLine);
+	bool normalizeContraction(const TTstring &srcLine, int srcIndex, TTstring &destLine);
 
 	/**
 	 * Checks for what is likely special developer cheat codes


Commit: 69134c66cc700fef16b202354e491b9ab6d0b8c0
    https://github.com/scummvm/scummvm/commit/69134c66cc700fef16b202354e491b9ab6d0b8c0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:37-04:00

Commit Message:
TITANIC: Implemented parser normalizeContraction

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 0bb30a1..5aa3576 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -166,6 +166,87 @@ int TTparser::isSpecialCommand(const TTstring &str, int &index) {
 }
 
 bool TTparser::normalizeContraction(const TTstring &srcLine, int srcIndex, TTstring &destLine) {
+	int startIndex = srcIndex + 1;
+	switch (srcLine[startIndex]) {
+	case 'd':
+		srcIndex += 2;
+		if (srcLine.compareAt(srcIndex, " a ") || srcLine.compareAt(srcIndex, " the ")) {
+			destLine += " had";
+		} else {
+			destLine += " would";
+		}
+
+		srcIndex = startIndex;
+		break;
+
+	case 'l':
+		if (srcLine[srcIndex + 2] == 'l') {
+			// 'll ending
+			destLine += " will";
+			srcIndex = startIndex;
+		}
+		break;
+
+	case 'm':
+		// 'm ending
+		destLine += " am";
+		srcIndex = startIndex;
+		break;
+
+	case 'r':
+		// 're ending
+		if (srcLine[srcIndex + 2] == 'e') {
+			destLine += " are";
+			srcIndex = startIndex;
+		}
+		break;
+
+	case 's':
+		destLine += "s*";
+		srcIndex = startIndex;
+		break;
+
+	case 't':
+		if (srcLine[srcIndex - 1] == 'n' && srcIndex >= 3) {
+			if (srcLine[srcIndex - 3] == 'c' && srcLine[srcIndex - 2] == 'a' &&
+				(srcIndex == 3 || srcLine[srcIndex - 4])) {
+				// can't -> can not
+				destLine += 'n';
+			} else if (srcLine[srcIndex - 3] == 'w' && srcLine[srcIndex - 2] == 'o' &&
+				(srcIndex == 3 || srcLine[srcIndex - 4])) {
+				// won't -> will not
+				destLine.deleteLastChar();
+				destLine.deleteLastChar();
+				destLine += "ill";
+			} else if (srcLine[srcIndex - 3] == 'a' && srcLine[srcIndex - 2] == 'i' &&
+				(srcIndex == 3 || srcLine[srcIndex - 4])) {
+				// ain't -> am not
+				destLine.deleteLastChar();
+				destLine.deleteLastChar();
+				destLine += "m";
+			} else if (srcLine.hasSuffix(" sha") || 
+					(srcIndex == 4 && srcLine.hasSuffix("sha"))) {
+				// shan't -> shall not
+				destLine.deleteLastChar();
+				destLine += "ll";
+			}
+
+			destLine += " not";
+		}
+		break;
+
+	case 'v':
+		// 've ending
+		if (srcLine[startIndex + 2] == 'e') {
+			destLine += " have";
+			srcIndex = startIndex;
+		}
+		break;
+
+	default:
+		break;
+	}
+
 	// TODO
 	return false;
 }
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index 5574cff..7a00787 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -95,34 +95,6 @@ TTstring &TTstring::operator+=(char c) {
 	return *this;
 }
 
-const char &TTstring::operator[](uint index) {
-	return *(c_str() + index);
-}
-
-bool TTstring::empty() const {
-	return _data->_string.empty();
-}
-
-char TTstring::firstChar() const {
-	return _data->_string.firstChar();
-}
-
-char TTstring::lastChar() const {
-	return _data->_string.lastChar();
-}
-
-int TTstring::size() const {
-	return _data->_string.size();
-}
-
-TTstring *TTstring::copy() const {
-	return new TTstring(c_str());
-}
-
-bool TTstring::isValid() const {
-	return _status == SS_VALID;
-}
-
 void TTstring::save(SimpleFile *file) const {
 	file->writeFormat("%s", c_str());
 }
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 3b2b6a2..2009167 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -57,21 +57,51 @@ public:
 	TTstring &operator+=(const char *str);
 	TTstring &operator+=(const TTstring &str);
 	TTstring &operator+=(char c);
-	const char &operator[](uint index);
-	bool empty() const;
-	char firstChar() const;
-	char lastChar() const;
-	int size() const;
+
+	const char &operator[](uint index) {
+		return *(c_str() + index);
+	}
+
+	bool empty() const {
+		return _data->_string.empty();
+	}
+
+	char firstChar() const {
+		return _data->_string.firstChar();
+	}
+
+	char lastChar() const {
+		return _data->_string.lastChar();
+	}
+
+	int size() const {
+		return _data->_string.size();
+	}
+
+	void deleteLastChar() {
+		_data->_string.deleteLastChar();
+	}
+
+	bool hasSuffix(const CString &str) const {
+		return _data->_string.hasSuffix(str);
+	}
+	bool hasSuffix(const char *str) const {
+		return _data->_string.hasSuffix(str);
+	}
 
 	/**
 	 * Create a new copy of the string
 	 */
-	TTstring *copy() const;
+	TTstring *copy() const {
+		return new TTstring(c_str());
+	}
 
 	/**
 	 * Returns true if the string is valid
 	 */
-	bool isValid() const;
+	bool isValid() const {
+		return _status == SS_VALID;
+	}
 
 	/**
 	 * Get the status of the string
@@ -97,6 +127,13 @@ public:
 	 * Save the sring to a passed file
 	 */
 	void save(SimpleFile *file) const;
+
+	/**
+	 * Compare a substring within the string at the specified index
+	 */
+	bool compareAt(int index, const char *str) const {
+		return !strncmp(c_str() + index, str, strlen(str));
+	}
 };
 
 } // End of namespace Titanic


Commit: 76b61324de85c92302ed76b67a09c1c60c9b8470
    https://github.com/scummvm/scummvm/commit/76b61324de85c92302ed76b67a09c1c60c9b8470
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-10T16:39:38-04:00

Commit Message:
TITANIC: Renaming for normalized input line

Changed paths:
    engines/titanic/true_talk/tt_input.cpp
    engines/titanic/true_talk/tt_input.h
    engines/titanic/true_talk/tt_parser.cpp



diff --git a/engines/titanic/true_talk/tt_input.cpp b/engines/titanic/true_talk/tt_input.cpp
index 5d48042..102f86f 100644
--- a/engines/titanic/true_talk/tt_input.cpp
+++ b/engines/titanic/true_talk/tt_input.cpp
@@ -35,9 +35,9 @@ TTinputSubBase::TTinputSubBase() : _field0(0), _field4(0), _field8(0),
 TTinput::TTinput(int inputCtr, const TTstring &line, CScriptHandler *owner,
 		TTroomScript *roomScript, TTnpcScript *npcScript) :
 		_owner(owner), _field2C(1), _inputCtr(inputCtr), _field34(0),
-		_field38(0), _line(line), _field4C(0), _roomScript(roomScript),
+		_field38(0), _initialLine(line), _field4C(0), _roomScript(roomScript),
 		_npcScript(npcScript), _field58(0), _field5C(0) {
-	_status = _line.isValid() && _string2.isValid() ? SS_11: SS_VALID;
+	_status = _initialLine.isValid() && _normalizedLine.isValid() ? SS_11: SS_VALID;
 }
 
 void TTinput::set38(int val) {
diff --git a/engines/titanic/true_talk/tt_input.h b/engines/titanic/true_talk/tt_input.h
index e4d91d7..e378e9b 100644
--- a/engines/titanic/true_talk/tt_input.h
+++ b/engines/titanic/true_talk/tt_input.h
@@ -59,7 +59,6 @@ private:
 	int _inputCtr;
 	int _field34;
 	int _field38;
-	TTstring _string2;
 	int _field4C;
 	TTroomScript *_roomScript;
 	TTnpcScript *_npcScript;
@@ -67,7 +66,8 @@ private:
 	int _field5C;
 	int _status;
 public:
-	TTstring _line;
+	TTstring _initialLine;
+	TTstring _normalizedLine;
 public:
 	TTinput(int inputCtr, const TTstring &line, CScriptHandler *owner,
 		TTroomScript *roomScript, TTnpcScript *npcScript);
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 5aa3576..343d0aa 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -37,7 +37,7 @@ int TTparser::processInput(TTinput *input) {
 
 int TTparser::normalize(TTinput *input) {
 	TTstring *destLine = new TTstring();
-	const TTstring &srcLine = input->_line;
+	const TTstring &srcLine = input->_initialLine;
 	int srcSize = srcLine.size();
 	int savedIndex = 0;
 	int counter1 = 0;
@@ -136,6 +136,17 @@ int TTparser::normalize(TTinput *input) {
 		}
 	}
 
+	if (counter1 >= 4)
+		input->set38(4);
+
+	// Remove any trailing spaces
+	while (destLine->hasSuffix(" "))
+		destLine->deleteLastChar();
+
+	// Copy out the normalized line
+	input->_normalizedLine = *destLine;
+	delete destLine;
+
 	return 0;
 }
 


Commit: 2680caa5bde09e3ecc7a1c8ef6c345e2bc9a134b
    https://github.com/scummvm/scummvm/commit/2680caa5bde09e3ecc7a1c8ef6c345e2bc9a134b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:10:30-04:00

Commit Message:
DEVTOOLS: Creation of titanic.dat for holding static data

Changed paths:
  A devtools/create_titanic/create_titanic_dat.cpp
  A devtools/create_titanic/file.h
  A devtools/create_titanic/hash-str.h
  A devtools/create_titanic/hashmap.cpp
  A devtools/create_titanic/hashmap.h
  A devtools/create_titanic/module.mk
  A devtools/create_titanic/str.cpp
  A devtools/create_titanic/str.h
  A devtools/create_titanic/winexe.cpp
  A devtools/create_titanic/winexe.h
  A devtools/create_titanic/winexe_pe.cpp
  A devtools/create_titanic/winexe_pe.h



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
new file mode 100644
index 0000000..e41b125
--- /dev/null
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -0,0 +1,205 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+ // Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+// HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "common/language.h"
+#include "common/rect.h"
+#include "winexe_pe.h"
+#include "file.h"
+
+/**
+ * Format of the access.dat file that will be created:
+ * 4 Bytes - Magic string 'SVTN' to identify valid data file
+ * 2 bytes - Version number
+ *
+ * Following is a series of index entries with the following fields:
+ * 4 bytes - offset in file of entry
+ * 4 bytes - size of entry in the file
+ * ASCIIZ  - name of the resource
+ */
+
+#define VERSION_NUMBER 1
+
+Common::File inputFile, outputFile;
+Common::PEResources res;
+uint headerOffset = 6;
+uint dataOffset = 0x200;
+#define SEGMENT_OFFSET 0x401C00
+
+void NORETURN_PRE error(const char *s, ...) {
+	printf("%s\n", s);
+	exit(1);
+}
+
+void writeEntryHeader(const char *name, uint offset, uint size) {
+	assert(headerOffset < 0x200);
+	outputFile.seek(headerOffset);
+	outputFile.writeLong(offset);
+	outputFile.writeLong(size);
+	outputFile.writeString(name);
+
+	headerOffset += 8 + strlen(name) + 1;
+}
+
+void writeFinalEntryHeader() {
+	assert(headerOffset <= 0x1F8);
+	outputFile.seek(headerOffset);
+	outputFile.writeLong(0);
+	outputFile.writeLong(0);
+}
+
+void writeStringArray(const char *name, uint offset, int count) {
+	outputFile.seek(dataOffset);
+
+	inputFile.seek(offset);
+	uint *offsets = new uint[count];
+	for (int idx = 0; idx < count; ++idx)
+		offsets[idx] = inputFile.readLong();
+
+	// Iterate through reading each string
+	for (int idx = 0; idx < count; ++idx) {
+		if (offsets[idx]) {
+			inputFile.seek(offsets[idx] - SEGMENT_OFFSET);
+			outputFile.writeString(inputFile);
+		} else {
+			outputFile.writeString("");
+		}
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader(name, dataOffset, size);
+	dataOffset += size;
+
+	delete[] offsets;
+}
+
+Common::WinResourceID getResId(uint id) {
+	return Common::WinResourceID(id);
+}
+
+Common::WinResourceID getResId(const char *id) {
+	if (!strcmp(id, "Bitmap"))
+		return Common::WinResourceID(2);
+
+	return Common::WinResourceID(id);
+}
+
+void writeResource(const char *name, Common::File *file) {
+	outputFile.seek(dataOffset);
+	outputFile.write(*file, file->size());
+
+	writeEntryHeader(name, dataOffset, file->size());
+	dataOffset += file->size();
+	delete file;
+}
+
+void writeResource(const char *sectionStr, const uint32 resId) {
+	char nameBuffer[256];
+	sprintf(nameBuffer, "%s/%d", sectionStr, resId);
+	
+	Common::File *file = res.getResource(getResId(sectionStr), resId);
+	assert(file);
+	writeResource(nameBuffer, file);
+}
+
+void writeResource(const char *sectionStr, const char *resId) {
+	char nameBuffer[256];
+	sprintf(nameBuffer, "%s/%s", sectionStr, resId);
+
+	Common::File *file = res.getResource(getResId(sectionStr), 
+		Common::WinResourceID(resId));
+	assert(file);
+	writeResource(nameBuffer, file);
+}
+
+void writeHeader() {
+	// Write out magic string
+	const char *MAGIC_STR = "SVTN";
+	outputFile.write(MAGIC_STR, 4);
+
+	// Write out version number
+	outputFile.writeWord(VERSION_NUMBER);
+}
+
+void writeData() {
+	writeStringArray("TEXT/STRINGS1", 0x21B7C8, 376);
+	writeStringArray("TEXT/STRINGS2", 0x21BDB0, 218);
+	writeStringArray("TEXT/STRINGS3", 0x21C120, 1576);
+	writeStringArray("TEXT/STRINGS4", 0x21D9C8, 82);
+
+	writeResource("Bitmap", "BACKDROP");
+	writeResource("Bitmap", "EVILTWIN");
+	writeResource("Bitmap", "RESTORED");
+	writeResource("Bitmap", "RESTOREF");
+	writeResource("Bitmap", "RESTOREU");
+	writeResource("Bitmap", "STARTD");
+	writeResource("Bitmap", "STARTF");
+	writeResource("Bitmap", "STARTU");
+	writeResource("Bitmap", "TITANIC");
+	writeResource("Bitmap", 133);
+	writeResource("Bitmap", 164);
+	writeResource("Bitmap", 165);
+
+	writeResource("STFONT", 149);
+	writeResource("STFONT", 151);
+	writeResource("STFONT", 152);
+	writeResource("STFONT", 153);
+
+	writeResource("TEXT", "STVOCAB.TXT");
+	writeResource("TEXT", "JRQUOTES.TXT");
+	writeResource("TEXT", 155);
+}
+
+int main(int argc, char *argv[]) {
+	if (argc != 3) {
+		printf("Format: %s ST.exe titanic.dat\n", argv[0]);
+		exit(0);
+	}
+
+	if (!inputFile.open(argv[1])) {
+		error("Could not open input file");
+	}
+	res.loadFromEXE(argv[1]);
+
+	if (!outputFile.open(argv[2], Common::kFileWriteMode)) {
+		error("Could not open output file");
+	}
+
+	writeHeader();
+	writeData();
+	writeFinalEntryHeader();
+
+	inputFile.close();
+	outputFile.close();
+	return 0;
+}
diff --git a/devtools/create_titanic/file.h b/devtools/create_titanic/file.h
new file mode 100644
index 0000000..e8d4960
--- /dev/null
+++ b/devtools/create_titanic/file.h
@@ -0,0 +1,213 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef __FILE_H__
+#define __FILE_H__
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+#include "common/scummsys.h"
+#include "common/endian.h"
+#include "common/algorithm.h"
+
+namespace Common {
+
+enum AccessMode {
+	kFileReadMode = 1,
+	kFileWriteMode = 2
+};
+
+class File {
+private:
+	::FILE *_f;
+	const byte *_memPtr;
+	size_t _offset, _size;
+public:
+	File() : _f(nullptr), _memPtr(nullptr), _offset(0), _size(0) {}
+
+	bool open(const char *filename, AccessMode mode = kFileReadMode) {
+		_memPtr = nullptr;
+		_f = fopen(filename, (mode == kFileReadMode) ? "rb" : "wb+");
+		return (_f != NULL);
+	}
+	bool open(const byte *data, uint size) {
+		close();
+		_f = nullptr;
+		_memPtr = data;
+		_size = size;
+		return true;
+	}
+
+	void close() {
+		if (_f)
+			fclose(_f);
+		_f = nullptr;
+		delete[] _memPtr;
+		_memPtr = nullptr;
+	}
+	int seek(int offset, int whence = SEEK_SET) {
+		if (_f)
+			return fseek(_f, offset, whence);
+
+		switch (whence) {
+		case SEEK_SET:
+			_offset = offset;
+			break;
+		case SEEK_CUR:
+			_offset += offset;
+			break;
+		case SEEK_END:
+			_offset = _size + offset;
+			break;
+		default:
+			break;
+		}
+
+		return _offset;
+	}
+	void skip(int offset) {
+		if (_f)
+			fseek(_f, offset, SEEK_CUR);
+		else
+			_offset += offset;
+	}
+	long read(void *buffer, size_t len) {
+		if (_f)
+			return fread(buffer, 1, len, _f);
+
+		uint bytesToRead = CLIP(len, (size_t)0, _size - _offset);
+		memcpy(buffer, &_memPtr[_offset], bytesToRead);
+		_offset += bytesToRead;
+		return bytesToRead;
+	}
+	void write(const void *buffer, size_t len) {
+		assert(_f);
+		fwrite(buffer, 1, len, _f);
+	}
+	void write(File &src, size_t len) {
+		for (size_t idx = 0; idx < len; ++idx)
+			writeByte(src.readByte());
+	}
+	byte readByte() {
+		byte v;
+		read(&v, sizeof(byte));
+		return v;
+	}
+	uint16 readWord() {
+		uint16 v;
+		read(&v, sizeof(uint16));
+		return FROM_LE_16(v);
+	}
+	uint readLong() {
+		uint v;
+		read(&v, sizeof(uint));
+		return FROM_LE_32(v);
+	}
+
+	uint readUint16BE() {
+		uint16 v;
+		read(&v, sizeof(uint16));
+		return FROM_BE_16(v);
+	}
+	uint readUint16LE() {
+		uint16 v;
+		read(&v, sizeof(uint16));
+		return FROM_LE_16(v);
+	}
+	uint readUint32BE() {
+		uint32 v;
+		read(&v, sizeof(uint32));
+		return FROM_BE_32(v);
+	}
+	uint readUint32LE() {
+		uint32 v;
+		read(&v, sizeof(uint32));
+		return FROM_LE_32(v);
+	}
+
+	void writeByte(byte v) {
+		write(&v, sizeof(byte));
+	}
+	void writeByte(byte v, int len) {
+		byte *b = new byte[len];
+		memset(b, v, len);
+		write(b, len);
+		delete[] b;
+	}
+	void writeWord(uint16 v) {
+		uint16 vTemp = TO_LE_16(v);
+		write(&vTemp, sizeof(uint16));
+	}
+	void writeLong(uint v) {
+		uint vTemp = TO_LE_32(v);
+		write(&vTemp, sizeof(uint));
+	}
+	void writeString(const char *msg) {
+		if (!msg) {
+			writeByte(0);
+		} else {
+			do {
+				writeByte(*msg);
+			} while (*msg++);
+		}
+	}
+	void writeString(File &src) {
+		char c;
+		do {
+			c = src.readByte();
+			writeByte(c);
+		} while (c);
+	}
+	uint pos() const {
+		if (_f)
+			return ftell(_f);
+		else
+			return _offset;
+	}
+	uint size() const {
+		if (_f) {
+			uint currentPos = pos();
+			fseek(_f, 0, SEEK_END);
+			uint result = pos();
+			fseek(_f, currentPos, SEEK_SET);
+			return result;
+		} else if (_memPtr) {
+			return _size;
+		} else {
+			return 0;
+		}
+	}
+	bool eof() const {
+		if (_f)
+			return feof(_f) != 0;
+		else if (_memPtr)
+			return _offset >= _size;
+		return false;
+	}
+};
+
+}
+
+#endif
diff --git a/devtools/create_titanic/hash-str.h b/devtools/create_titanic/hash-str.h
new file mode 100644
index 0000000..b9f6d50
--- /dev/null
+++ b/devtools/create_titanic/hash-str.h
@@ -0,0 +1,86 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef COMMON_HASH_STR_H
+#define COMMON_HASH_STR_H
+
+#include "hashmap.h"
+#include "str.h"
+
+namespace Common {
+
+uint hashit(const char *str);
+uint hashit_lower(const char *str);	// Generate a hash based on the lowercase version of the string
+inline uint hashit(const String &str) { return hashit(str.c_str()); }
+inline uint hashit_lower(const String &str) { return hashit_lower(str.c_str()); }
+
+
+// FIXME: The following functors obviously are not consistently named
+
+struct CaseSensitiveString_EqualTo {
+	bool operator()(const String& x, const String& y) const { return x.equals(y); }
+};
+
+struct CaseSensitiveString_Hash {
+	uint operator()(const String& x) const { return hashit(x.c_str()); }
+};
+
+
+struct IgnoreCase_EqualTo {
+	bool operator()(const String& x, const String& y) const { return x.equalsIgnoreCase(y); }
+};
+
+struct IgnoreCase_Hash {
+	uint operator()(const String& x) const { return hashit_lower(x.c_str()); }
+};
+
+
+
+// Specalization of the Hash functor for String objects.
+// We do case sensitve hashing here, because that is what
+// the default EqualTo is compatible with. If one wants to use
+// case insensitve hashing, then only because one wants to use
+// IgnoreCase_EqualTo, and then one has to specify a custom
+// hash anyway.
+template<>
+struct Hash<String> {
+	uint operator()(const String& s) const {
+		return hashit(s.c_str());
+	}
+};
+
+template<>
+struct Hash<const char *> {
+	uint operator()(const char *s) const {
+		return hashit(s);
+	}
+};
+
+// String map -- by default case insensitive
+typedef HashMap<String, String, IgnoreCase_Hash, IgnoreCase_EqualTo> StringMap;
+
+
+
+} // End of namespace Common
+
+
+#endif
diff --git a/devtools/create_titanic/hashmap.cpp b/devtools/create_titanic/hashmap.cpp
new file mode 100644
index 0000000..9984099
--- /dev/null
+++ b/devtools/create_titanic/hashmap.cpp
@@ -0,0 +1,109 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+// The hash map (associative array) implementation in this file is
+// based on the PyDict implementation of CPython. The erase() method
+// is based on example code in the Wikipedia article on Hash tables.
+
+#include "common/hashmap.h"
+
+namespace Common {
+
+// Hash function for strings, taken from CPython.
+uint hashit(const char *p) {
+	uint hash = *p << 7;
+	byte c;
+	int size = 0;
+	while ((c = *p++)) {
+		hash = (1000003 * hash) ^ c;
+		size++;
+	}
+	return hash ^ size;
+}
+
+// Like hashit, but converts every char to lowercase before hashing.
+uint hashit_lower(const char *p) {
+	uint hash = tolower(*p) << 7;
+	byte c;
+	int size = 0;
+	while ((c = *p++)) {
+		hash = (1000003 * hash) ^ tolower(c);
+		size++;
+	}
+	return hash ^ size;
+}
+
+#ifdef DEBUG_HASH_COLLISIONS
+static double
+	g_collisions = 0,
+	g_dummyHits = 0,
+	g_lookups = 0,
+	g_collPerLook = 0,
+	g_capacity = 0,
+	g_size = 0;
+static int g_max_capacity = 0, g_max_size = 0;
+static int g_totalHashmaps = 0;
+static int g_stats[4] = {0,0,0,0};
+
+void updateHashCollisionStats(int collisions, int dummyHits, int lookups, int arrsize, int nele) {
+	g_collisions += collisions;
+	g_lookups += lookups;
+	g_dummyHits += dummyHits;
+	if (lookups)
+		g_collPerLook += (double)collisions / (double)lookups;
+	g_capacity += arrsize;
+	g_size += nele;
+	g_totalHashmaps++;
+
+	if (3*nele <= 2*8)
+		g_stats[0]++;
+	if (3*nele <= 2*16)
+		g_stats[1]++;
+	if (3*nele <= 2*32)
+		g_stats[2]++;
+	if (3*nele <= 2*64)
+		g_stats[3]++;
+
+	g_max_capacity = MAX(g_max_capacity, arrsize);
+	g_max_size = MAX(g_max_size, nele);
+
+	debug("%d hashmaps: colls %.1f; dummies hit %.1f, lookups %.1f; ratio %.3f%%; size %f (max: %d); capacity %f (max: %d)",
+		g_totalHashmaps,
+		g_collisions / g_totalHashmaps,
+		g_dummyHits / g_totalHashmaps,
+		g_lookups / g_totalHashmaps,
+		100 * g_collPerLook / g_totalHashmaps,
+		g_size / g_totalHashmaps, g_max_size,
+		g_capacity / g_totalHashmaps, g_max_capacity);
+	debug("  %d less than %d; %d less than %d; %d less than %d; %d less than %d",
+			g_stats[0], 2*8/3,
+			g_stats[1],2*16/3,
+			g_stats[2],2*32/3,
+			g_stats[3],2*64/3);
+
+	// TODO:
+	// * Should record the maximal size of the map during its lifetime, not that at its death
+	// * Should do some statistics: how many maps are less than 2/3*8, 2/3*16, 2/3*32, ...
+}
+#endif
+
+} // End of namespace Common
diff --git a/devtools/create_titanic/hashmap.h b/devtools/create_titanic/hashmap.h
new file mode 100644
index 0000000..d7ba100
--- /dev/null
+++ b/devtools/create_titanic/hashmap.h
@@ -0,0 +1,637 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+// The hash map (associative array) implementation in this file is
+// based on the PyDict implementation of CPython.
+
+#ifndef COMMON_HASHMAP_H
+#define COMMON_HASHMAP_H
+
+/**
+ * @def DEBUG_HASH_COLLISIONS
+ * Enable the following #define if you want to check how many collisions the
+ * code produces (many collisions indicate either a bad hash function, or a
+ * hash table that is too small).
+ */
+//#define DEBUG_HASH_COLLISIONS
+
+/**
+ * @def USE_HASHMAP_MEMORY_POOL
+ * Enable the following define to let HashMaps use a memory pool for the
+ nodes they contain. * This increases memory usage, but also can improve
+ speed quite a bit.
+ */
+#define USE_HASHMAP_MEMORY_POOL
+
+
+#include "common/func.h"
+
+#ifdef DEBUG_HASH_COLLISIONS
+#include "common/debug.h"
+#endif
+
+#ifdef USE_HASHMAP_MEMORY_POOL
+#include "common/memorypool.h"
+#endif
+
+
+
+namespace Common {
+
+// The sgi IRIX MIPSpro Compiler has difficulties with nested templates.
+// This and the other __sgi conditionals below work around these problems.
+// The Intel C++ Compiler suffers from the same problems.
+#if (defined(__sgi) && !defined(__GNUC__)) || defined(__INTEL_COMPILER)
+template<class T> class IteratorImpl;
+#endif
+
+
+/**
+ * HashMap<Key,Val> maps objects of type Key to objects of type Val.
+ * For each used Key type, we need an "size_type hashit(Key,size_type)" function
+ * that computes a hash for the given Key object and returns it as an
+ * an integer from 0 to hashsize-1, and also an "equality functor".
+ * that returns true if if its two arguments are to be considered
+ * equal. Also, we assume that "=" works on Val objects for assignment.
+ *
+ * If aa is an HashMap<Key,Val>, then space is allocated each time aa[key] is
+ * referenced, for a new key. If the object is const, then an assertion is
+ * triggered instead. Hence if you are not sure whether a key is contained in
+ * the map, use contains() first to check for its presence.
+ */
+template<class Key, class Val, class HashFunc = Hash<Key>, class EqualFunc = EqualTo<Key> >
+class HashMap {
+public:
+	typedef uint size_type;
+
+private:
+
+	typedef HashMap<Key, Val, HashFunc, EqualFunc> HM_t;
+
+	struct Node {
+		const Key _key;
+		Val _value;
+		explicit Node(const Key &key) : _key(key), _value() {}
+		Node() : _key(), _value() {}
+	};
+
+	enum {
+		HASHMAP_PERTURB_SHIFT = 5,
+		HASHMAP_MIN_CAPACITY = 16,
+
+		// The quotient of the next two constants controls how much the
+		// internal storage of the hashmap may fill up before being
+		// increased automatically.
+		// Note: the quotient of these two must be between and different
+		// from 0 and 1.
+		HASHMAP_LOADFACTOR_NUMERATOR = 2,
+		HASHMAP_LOADFACTOR_DENOMINATOR = 3,
+
+		HASHMAP_MEMORYPOOL_SIZE = HASHMAP_MIN_CAPACITY * HASHMAP_LOADFACTOR_NUMERATOR / HASHMAP_LOADFACTOR_DENOMINATOR
+	};
+
+#ifdef USE_HASHMAP_MEMORY_POOL
+	ObjectPool<Node, HASHMAP_MEMORYPOOL_SIZE> _nodePool;
+#endif
+
+	Node **_storage;	///< hashtable of size arrsize.
+	size_type _mask;		///< Capacity of the HashMap minus one; must be a power of two of minus one
+	size_type _size;
+	size_type _deleted; ///< Number of deleted elements (_dummyNodes)
+
+	HashFunc _hash;
+	EqualFunc _equal;
+
+	/** Default value, returned by the const getVal. */
+	const Val _defaultVal;
+
+	/** Dummy node, used as marker for erased objects. */
+	#define HASHMAP_DUMMY_NODE	((Node *)1)
+
+#ifdef DEBUG_HASH_COLLISIONS
+	mutable int _collisions, _lookups, _dummyHits;
+#endif
+
+	Node *allocNode(const Key &key) {
+#ifdef USE_HASHMAP_MEMORY_POOL
+		return new (_nodePool) Node(key);
+#else
+		return new Node(key);
+#endif
+	}
+
+	void freeNode(Node *node) {
+		if (node && node != HASHMAP_DUMMY_NODE)
+#ifdef USE_HASHMAP_MEMORY_POOL
+			_nodePool.deleteChunk(node);
+#else
+			delete node;
+#endif
+	}
+
+	void assign(const HM_t &map);
+	size_type lookup(const Key &key) const;
+	size_type lookupAndCreateIfMissing(const Key &key);
+	void expandStorage(size_type newCapacity);
+
+#if !defined(__sgi) || defined(__GNUC__)
+	template<class T> friend class IteratorImpl;
+#endif
+
+	/**
+	 * Simple HashMap iterator implementation.
+	 */
+	template<class NodeType>
+	class IteratorImpl {
+		friend class HashMap;
+#if (defined(__sgi) && !defined(__GNUC__)) || defined(__INTEL_COMPILER)
+		template<class T> friend class Common::IteratorImpl;
+#else
+		template<class T> friend class IteratorImpl;
+#endif
+	protected:
+		typedef const HashMap hashmap_t;
+
+		size_type _idx;
+		hashmap_t *_hashmap;
+
+	protected:
+		IteratorImpl(size_type idx, hashmap_t *hashmap) : _idx(idx), _hashmap(hashmap) {}
+
+		NodeType *deref() const {
+			assert(_hashmap != 0);
+			assert(_idx <= _hashmap->_mask);
+			Node *node = _hashmap->_storage[_idx];
+			assert(node != 0);
+			assert(node != HASHMAP_DUMMY_NODE);
+			return node;
+		}
+
+	public:
+		IteratorImpl() : _idx(0), _hashmap(0) {}
+		template<class T>
+		IteratorImpl(const IteratorImpl<T> &c) : _idx(c._idx), _hashmap(c._hashmap) {}
+
+		NodeType &operator*() const { return *deref(); }
+		NodeType *operator->() const { return deref(); }
+
+		bool operator==(const IteratorImpl &iter) const { return _idx == iter._idx && _hashmap == iter._hashmap; }
+		bool operator!=(const IteratorImpl &iter) const { return !(*this == iter); }
+
+		IteratorImpl &operator++() {
+			assert(_hashmap);
+			do {
+				_idx++;
+			} while (_idx <= _hashmap->_mask && (_hashmap->_storage[_idx] == 0 || _hashmap->_storage[_idx] == HASHMAP_DUMMY_NODE));
+			if (_idx > _hashmap->_mask)
+				_idx = (size_type)-1;
+
+			return *this;
+		}
+
+		IteratorImpl operator++(int) {
+			IteratorImpl old = *this;
+			operator ++();
+			return old;
+		}
+	};
+
+public:
+	typedef IteratorImpl<Node> iterator;
+	typedef IteratorImpl<const Node> const_iterator;
+
+	HashMap();
+	HashMap(const HM_t &map);
+	~HashMap();
+
+	HM_t &operator=(const HM_t &map) {
+		if (this == &map)
+			return *this;
+
+		// Remove the previous content and ...
+		clear();
+		delete[] _storage;
+		// ... copy the new stuff.
+		assign(map);
+		return *this;
+	}
+
+	bool contains(const Key &key) const;
+
+	Val &operator[](const Key &key);
+	const Val &operator[](const Key &key) const;
+
+	Val &getVal(const Key &key);
+	const Val &getVal(const Key &key) const;
+	const Val &getVal(const Key &key, const Val &defaultVal) const;
+	void setVal(const Key &key, const Val &val);
+
+	void clear(bool shrinkArray = 0);
+
+	void erase(iterator entry);
+	void erase(const Key &key);
+
+	size_type size() const { return _size; }
+
+	iterator	begin() {
+		// Find and return the first non-empty entry
+		for (size_type ctr = 0; ctr <= _mask; ++ctr) {
+			if (_storage[ctr] && _storage[ctr] != HASHMAP_DUMMY_NODE)
+				return iterator(ctr, this);
+		}
+		return end();
+	}
+	iterator	end() {
+		return iterator((size_type)-1, this);
+	}
+
+	const_iterator	begin() const {
+		// Find and return the first non-empty entry
+		for (size_type ctr = 0; ctr <= _mask; ++ctr) {
+			if (_storage[ctr] && _storage[ctr] != HASHMAP_DUMMY_NODE)
+				return const_iterator(ctr, this);
+		}
+		return end();
+	}
+	const_iterator	end() const {
+		return const_iterator((size_type)-1, this);
+	}
+
+	iterator	find(const Key &key) {
+		size_type ctr = lookup(key);
+		if (_storage[ctr])
+			return iterator(ctr, this);
+		return end();
+	}
+
+	const_iterator	find(const Key &key) const {
+		size_type ctr = lookup(key);
+		if (_storage[ctr])
+			return const_iterator(ctr, this);
+		return end();
+	}
+
+	// TODO: insert() method?
+
+	bool empty() const {
+		return (_size == 0);
+	}
+};
+
+//-------------------------------------------------------
+// HashMap functions
+
+/**
+ * Base constructor, creates an empty hashmap.
+ */
+template<class Key, class Val, class HashFunc, class EqualFunc>
+HashMap<Key, Val, HashFunc, EqualFunc>::HashMap()
+//
+// We have to skip _defaultVal() on PS2 to avoid gcc 3.2.2 ICE
+//
+#ifdef __PLAYSTATION2__
+	{
+#else
+	: _defaultVal() {
+#endif
+	_mask = HASHMAP_MIN_CAPACITY - 1;
+	_storage = new Node *[HASHMAP_MIN_CAPACITY];
+	assert(_storage != NULL);
+	memset(_storage, 0, HASHMAP_MIN_CAPACITY * sizeof(Node *));
+
+	_size = 0;
+	_deleted = 0;
+
+#ifdef DEBUG_HASH_COLLISIONS
+	_collisions = 0;
+	_lookups = 0;
+	_dummyHits = 0;
+#endif
+}
+
+/**
+ * Copy constructor, creates a full copy of the given hashmap.
+ * We must provide a custom copy constructor as we use pointers
+ * to heap buffers for the internal storage.
+ */
+template<class Key, class Val, class HashFunc, class EqualFunc>
+HashMap<Key, Val, HashFunc, EqualFunc>::HashMap(const HM_t &map) :
+	_defaultVal() {
+#ifdef DEBUG_HASH_COLLISIONS
+	_collisions = 0;
+	_lookups = 0;
+	_dummyHits = 0;
+#endif
+	assign(map);
+}
+
+/**
+ * Destructor, frees all used memory.
+ */
+template<class Key, class Val, class HashFunc, class EqualFunc>
+HashMap<Key, Val, HashFunc, EqualFunc>::~HashMap() {
+	for (size_type ctr = 0; ctr <= _mask; ++ctr)
+	  freeNode(_storage[ctr]);
+
+	delete[] _storage;
+#ifdef DEBUG_HASH_COLLISIONS
+	extern void updateHashCollisionStats(int, int, int, int, int);
+	updateHashCollisionStats(_collisions, _dummyHits, _lookups, _mask+1, _size);
+#endif
+}
+
+/**
+ * Internal method for assigning the content of another HashMap
+ * to this one.
+ *
+ * @note We do *not* deallocate the previous storage here -- the caller is
+ *       responsible for doing that!
+ */
+template<class Key, class Val, class HashFunc, class EqualFunc>
+void HashMap<Key, Val, HashFunc, EqualFunc>::assign(const HM_t &map) {
+	_mask = map._mask;
+	_storage = new Node *[_mask+1];
+	assert(_storage != NULL);
+	memset(_storage, 0, (_mask+1) * sizeof(Node *));
+
+	// Simply clone the map given to us, one by one.
+	_size = 0;
+	_deleted = 0;
+	for (size_type ctr = 0; ctr <= _mask; ++ctr) {
+		if (map._storage[ctr] == HASHMAP_DUMMY_NODE) {
+			_storage[ctr] = HASHMAP_DUMMY_NODE;
+			_deleted++;
+		} else if (map._storage[ctr] != NULL) {
+			_storage[ctr] = allocNode(map._storage[ctr]->_key);
+			_storage[ctr]->_value = map._storage[ctr]->_value;
+			_size++;
+		}
+	}
+	// Perform a sanity check (to help track down hashmap corruption)
+	assert(_size == map._size);
+	assert(_deleted == map._deleted);
+}
+
+
+template<class Key, class Val, class HashFunc, class EqualFunc>
+void HashMap<Key, Val, HashFunc, EqualFunc>::clear(bool shrinkArray) {
+	for (size_type ctr = 0; ctr <= _mask; ++ctr) {
+		freeNode(_storage[ctr]);
+		_storage[ctr] = NULL;
+	}
+
+#ifdef USE_HASHMAP_MEMORY_POOL
+	_nodePool.freeUnusedPages();
+#endif
+
+	if (shrinkArray && _mask >= HASHMAP_MIN_CAPACITY) {
+		delete[] _storage;
+
+		_mask = HASHMAP_MIN_CAPACITY;
+		_storage = new Node *[HASHMAP_MIN_CAPACITY];
+		assert(_storage != NULL);
+		memset(_storage, 0, HASHMAP_MIN_CAPACITY * sizeof(Node *));
+	}
+
+	_size = 0;
+	_deleted = 0;
+}
+
+template<class Key, class Val, class HashFunc, class EqualFunc>
+void HashMap<Key, Val, HashFunc, EqualFunc>::expandStorage(size_type newCapacity) {
+	assert(newCapacity > _mask+1);
+
+#ifndef NDEBUG
+	const size_type old_size = _size;
+#endif
+	const size_type old_mask = _mask;
+	Node **old_storage = _storage;
+
+	// allocate a new array
+	_size = 0;
+	_deleted = 0;
+	_mask = newCapacity - 1;
+	_storage = new Node *[newCapacity];
+	assert(_storage != NULL);
+	memset(_storage, 0, newCapacity * sizeof(Node *));
+
+	// rehash all the old elements
+	for (size_type ctr = 0; ctr <= old_mask; ++ctr) {
+		if (old_storage[ctr] == NULL || old_storage[ctr] == HASHMAP_DUMMY_NODE)
+			continue;
+
+		// Insert the element from the old table into the new table.
+		// Since we know that no key exists twice in the old table, we
+		// can do this slightly better than by calling lookup, since we
+		// don't have to call _equal().
+		const size_type hash = _hash(old_storage[ctr]->_key);
+		size_type idx = hash & _mask;
+		for (size_type perturb = hash; _storage[idx] != NULL && _storage[idx] != HASHMAP_DUMMY_NODE; perturb >>= HASHMAP_PERTURB_SHIFT) {
+			idx = (5 * idx + perturb + 1) & _mask;
+		}
+
+		_storage[idx] = old_storage[ctr];
+		_size++;
+	}
+
+	// Perform a sanity check: Old number of elements should match the new one!
+	// This check will fail if some previous operation corrupted this hashmap.
+	assert(_size == old_size);
+
+	delete[] old_storage;
+
+	return;
+}
+
+template<class Key, class Val, class HashFunc, class EqualFunc>
+typename HashMap<Key, Val, HashFunc, EqualFunc>::size_type HashMap<Key, Val, HashFunc, EqualFunc>::lookup(const Key &key) const {
+	const size_type hash = _hash(key);
+	size_type ctr = hash & _mask;
+	for (size_type perturb = hash; ; perturb >>= HASHMAP_PERTURB_SHIFT) {
+		if (_storage[ctr] == NULL)
+			break;
+		if (_storage[ctr] == HASHMAP_DUMMY_NODE) {
+#ifdef DEBUG_HASH_COLLISIONS
+			_dummyHits++;
+#endif
+		} else if (_equal(_storage[ctr]->_key, key))
+			break;
+
+		ctr = (5 * ctr + perturb + 1) & _mask;
+
+#ifdef DEBUG_HASH_COLLISIONS
+		_collisions++;
+#endif
+	}
+
+#ifdef DEBUG_HASH_COLLISIONS
+	_lookups++;
+	debug("collisions %d, dummies hit %d, lookups %d, ratio %f in HashMap %p; size %d num elements %d",
+		_collisions, _dummyHits, _lookups, ((double) _collisions / (double)_lookups),
+		(const void *)this, _mask+1, _size);
+#endif
+
+	return ctr;
+}
+
+template<class Key, class Val, class HashFunc, class EqualFunc>
+typename HashMap<Key, Val, HashFunc, EqualFunc>::size_type HashMap<Key, Val, HashFunc, EqualFunc>::lookupAndCreateIfMissing(const Key &key) {
+	const size_type hash = _hash(key);
+	size_type ctr = hash & _mask;
+	const size_type NONE_FOUND = _mask + 1;
+	size_type first_free = NONE_FOUND;
+	bool found = false;
+	for (size_type perturb = hash; ; perturb >>= HASHMAP_PERTURB_SHIFT) {
+		if (_storage[ctr] == NULL)
+			break;
+		if (_storage[ctr] == HASHMAP_DUMMY_NODE) {
+#ifdef DEBUG_HASH_COLLISIONS
+			_dummyHits++;
+#endif
+			if (first_free != _mask + 1)
+				first_free = ctr;
+		} else if (_equal(_storage[ctr]->_key, key)) {
+			found = true;
+			break;
+		}
+
+		ctr = (5 * ctr + perturb + 1) & _mask;
+
+#ifdef DEBUG_HASH_COLLISIONS
+		_collisions++;
+#endif
+	}
+
+#ifdef DEBUG_HASH_COLLISIONS
+	_lookups++;
+	debug("collisions %d, dummies hit %d, lookups %d, ratio %f in HashMap %p; size %d num elements %d",
+		_collisions, _dummyHits, _lookups, ((double) _collisions / (double)_lookups),
+		(const void *)this, _mask+1, _size);
+#endif
+
+	if (!found && first_free != _mask + 1)
+		ctr = first_free;
+
+	if (!found) {
+		if (_storage[ctr])
+			_deleted--;
+		_storage[ctr] = allocNode(key);
+		assert(_storage[ctr] != NULL);
+		_size++;
+
+		// Keep the load factor below a certain threshold.
+		// Deleted nodes are also counted
+		size_type capacity = _mask + 1;
+		if ((_size + _deleted) * HASHMAP_LOADFACTOR_DENOMINATOR >
+		        capacity * HASHMAP_LOADFACTOR_NUMERATOR) {
+			capacity = capacity < 500 ? (capacity * 4) : (capacity * 2);
+			expandStorage(capacity);
+			ctr = lookup(key);
+			assert(_storage[ctr] != NULL);
+		}
+	}
+
+	return ctr;
+}
+
+
+template<class Key, class Val, class HashFunc, class EqualFunc>
+bool HashMap<Key, Val, HashFunc, EqualFunc>::contains(const Key &key) const {
+	size_type ctr = lookup(key);
+	return (_storage[ctr] != NULL);
+}
+
+template<class Key, class Val, class HashFunc, class EqualFunc>
+Val &HashMap<Key, Val, HashFunc, EqualFunc>::operator[](const Key &key) {
+	return getVal(key);
+}
+
+template<class Key, class Val, class HashFunc, class EqualFunc>
+const Val &HashMap<Key, Val, HashFunc, EqualFunc>::operator[](const Key &key) const {
+	return getVal(key);
+}
+
+template<class Key, class Val, class HashFunc, class EqualFunc>
+Val &HashMap<Key, Val, HashFunc, EqualFunc>::getVal(const Key &key) {
+	size_type ctr = lookupAndCreateIfMissing(key);
+	assert(_storage[ctr] != NULL);
+	return _storage[ctr]->_value;
+}
+
+template<class Key, class Val, class HashFunc, class EqualFunc>
+const Val &HashMap<Key, Val, HashFunc, EqualFunc>::getVal(const Key &key) const {
+	return getVal(key, _defaultVal);
+}
+
+template<class Key, class Val, class HashFunc, class EqualFunc>
+const Val &HashMap<Key, Val, HashFunc, EqualFunc>::getVal(const Key &key, const Val &defaultVal) const {
+	size_type ctr = lookup(key);
+	if (_storage[ctr] != NULL)
+		return _storage[ctr]->_value;
+	else
+		return defaultVal;
+}
+
+template<class Key, class Val, class HashFunc, class EqualFunc>
+void HashMap<Key, Val, HashFunc, EqualFunc>::setVal(const Key &key, const Val &val) {
+	size_type ctr = lookupAndCreateIfMissing(key);
+	assert(_storage[ctr] != NULL);
+	_storage[ctr]->_value = val;
+}
+
+template<class Key, class Val, class HashFunc, class EqualFunc>
+void HashMap<Key, Val, HashFunc, EqualFunc>::erase(iterator entry) {
+	// Check whether we have a valid iterator
+	assert(entry._hashmap == this);
+	const size_type ctr = entry._idx;
+	assert(ctr <= _mask);
+	Node * const node = _storage[ctr];
+	assert(node != NULL);
+	assert(node != HASHMAP_DUMMY_NODE);
+
+	// If we remove a key, we replace it with a dummy node.
+	freeNode(node);
+	_storage[ctr] = HASHMAP_DUMMY_NODE;
+	_size--;
+	_deleted++;
+}
+
+template<class Key, class Val, class HashFunc, class EqualFunc>
+void HashMap<Key, Val, HashFunc, EqualFunc>::erase(const Key &key) {
+
+	size_type ctr = lookup(key);
+	if (_storage[ctr] == NULL)
+		return;
+
+	// If we remove a key, we replace it with a dummy node.
+	freeNode(_storage[ctr]);
+	_storage[ctr] = HASHMAP_DUMMY_NODE;
+	_size--;
+	_deleted++;
+	return;
+}
+
+#undef HASHMAP_DUMMY_NODE
+
+} // End of namespace Common
+
+#endif
diff --git a/devtools/create_titanic/module.mk b/devtools/create_titanic/module.mk
new file mode 100644
index 0000000..05a4130
--- /dev/null
+++ b/devtools/create_titanic/module.mk
@@ -0,0 +1,15 @@
+
+MODULE := devtools/create_titanic
+
+MODULE_OBJS := \
+	create_titanic_dat.o \
+	hashmap.o \
+	str.o \
+	winexe.o \
+	winexe_pe.o
+
+# Set the name of the executable
+TOOL_EXECUTABLE := create_titanic
+
+# Include common rules
+include $(srcdir)/rules.mk
diff --git a/devtools/create_titanic/str.cpp b/devtools/create_titanic/str.cpp
new file mode 100644
index 0000000..14a6e50
--- /dev/null
+++ b/devtools/create_titanic/str.cpp
@@ -0,0 +1,786 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/hash-str.h"
+#include "common/list.h"
+#include "common/memorypool.h"
+#include "common/str.h"
+#include "common/util.h"
+
+namespace Common {
+
+MemoryPool *g_refCountPool = 0; // FIXME: This is never freed right now
+
+static uint32 computeCapacity(uint32 len) {
+	// By default, for the capacity we use the next multiple of 32
+	return ((len + 32 - 1) & ~0x1F);
+}
+
+String::String(const char *str) : _size(0), _str(_storage) {
+	if (str == 0) {
+		_storage[0] = 0;
+		_size = 0;
+	} else
+		initWithCStr(str, strlen(str));
+}
+
+String::String(const char *str, uint32 len) : _size(0), _str(_storage) {
+	initWithCStr(str, len);
+}
+
+String::String(const char *beginP, const char *endP) : _size(0), _str(_storage) {
+	assert(endP >= beginP);
+	initWithCStr(beginP, endP - beginP);
+}
+
+void String::initWithCStr(const char *str, uint32 len) {
+	assert(str);
+
+	// Init _storage member explicitly (ie. without calling its constructor)
+	// for GCC 2.95.x compatibility (see also tracker item #1602879).
+	_storage[0] = 0;
+
+	_size = len;
+
+	if (len >= _builtinCapacity) {
+		// Not enough internal storage, so allocate more
+		_extern._capacity = computeCapacity(len+1);
+		_extern._refCount = 0;
+		_str = new char[_extern._capacity];
+		assert(_str != 0);
+	}
+
+	// Copy the string into the storage area
+	memmove(_str, str, len);
+	_str[len] = 0;
+}
+
+String::String(const String &str)
+    : _size(str._size) {
+	if (str.isStorageIntern()) {
+		// String in internal storage: just copy it
+		memcpy(_storage, str._storage, _builtinCapacity);
+		_str = _storage;
+	} else {
+		// String in external storage: use refcount mechanism
+		str.incRefCount();
+		_extern._refCount = str._extern._refCount;
+		_extern._capacity = str._extern._capacity;
+		_str = str._str;
+	}
+	assert(_str != 0);
+}
+
+String::String(char c)
+    : _size(0), _str(_storage) {
+
+	_storage[0] = c;
+	_storage[1] = 0;
+
+	_size = (c == 0) ? 0 : 1;
+}
+
+String::~String() {
+	decRefCount(_extern._refCount);
+}
+
+void String::makeUnique() {
+	ensureCapacity(_size, true);
+}
+
+/**
+ * Ensure that enough storage is available to store at least new_size
+ * characters plus a null byte. In addition, if we currently share
+ * the storage with another string, unshare it, so that we can safely
+ * write to the storage.
+ */
+void String::ensureCapacity(uint32 new_size, bool keep_old) {
+	bool isShared;
+	uint32 curCapacity, newCapacity;
+	char *newStorage;
+	int *oldRefCount = _extern._refCount;
+
+	if (isStorageIntern()) {
+		isShared = false;
+		curCapacity = _builtinCapacity;
+	} else {
+		isShared = (oldRefCount && *oldRefCount > 1);
+		curCapacity = _extern._capacity;
+	}
+
+	// Special case: If there is enough space, and we do not share
+	// the storage, then there is nothing to do.
+	if (!isShared && new_size < curCapacity)
+		return;
+
+	if (isShared && new_size < _builtinCapacity) {
+		// We share the storage, but there is enough internal storage: Use that.
+		newStorage = _storage;
+		newCapacity = _builtinCapacity;
+	} else {
+		// We need to allocate storage on the heap!
+
+		// Compute a suitable new capacity limit
+		// If the current capacity is sufficient we use the same capacity
+		if (new_size < curCapacity)
+			newCapacity = curCapacity;
+		else
+			newCapacity = MAX(curCapacity * 2, computeCapacity(new_size+1));
+
+		// Allocate new storage
+		newStorage = new char[newCapacity];
+		assert(newStorage);
+	}
+
+	// Copy old data if needed, elsewise reset the new storage.
+	if (keep_old) {
+		assert(_size < newCapacity);
+		memcpy(newStorage, _str, _size + 1);
+	} else {
+		_size = 0;
+		newStorage[0] = 0;
+	}
+
+	// Release hold on the old storage ...
+	decRefCount(oldRefCount);
+
+	// ... in favor of the new storage
+	_str = newStorage;
+
+	if (!isStorageIntern()) {
+		// Set the ref count & capacity if we use an external storage.
+		// It is important to do this *after* copying any old content,
+		// else we would override data that has not yet been copied!
+		_extern._refCount = 0;
+		_extern._capacity = newCapacity;
+	}
+}
+
+void String::incRefCount() const {
+	assert(!isStorageIntern());
+	if (_extern._refCount == 0) {
+		if (g_refCountPool == 0) {
+			g_refCountPool = new MemoryPool(sizeof(int));
+			assert(g_refCountPool);
+		}
+
+		_extern._refCount = (int *)g_refCountPool->allocChunk();
+		*_extern._refCount = 2;
+	} else {
+		++(*_extern._refCount);
+	}
+}
+
+void String::decRefCount(int *oldRefCount) {
+	if (isStorageIntern())
+		return;
+
+	if (oldRefCount) {
+		--(*oldRefCount);
+	}
+	if (!oldRefCount || *oldRefCount <= 0) {
+		// The ref count reached zero, so we free the string storage
+		// and the ref count storage.
+		if (oldRefCount) {
+			assert(g_refCountPool);
+			g_refCountPool->freeChunk(oldRefCount);
+		}
+		delete[] _str;
+
+		// Even though _str points to a freed memory block now,
+		// we do not change its value, because any code that calls
+		// decRefCount will have to do this afterwards anyway.
+	}
+}
+
+String &String::operator=(const char *str) {
+	uint32 len = strlen(str);
+	ensureCapacity(len, false);
+	_size = len;
+	memmove(_str, str, len + 1);
+	return *this;
+}
+
+String &String::operator=(const String &str) {
+	if (&str == this)
+		return *this;
+
+	if (str.isStorageIntern()) {
+		decRefCount(_extern._refCount);
+		_size = str._size;
+		_str = _storage;
+		memcpy(_str, str._str, _size + 1);
+	} else {
+		str.incRefCount();
+		decRefCount(_extern._refCount);
+
+		_extern._refCount = str._extern._refCount;
+		_extern._capacity = str._extern._capacity;
+		_size = str._size;
+		_str = str._str;
+	}
+
+	return *this;
+}
+
+String &String::operator=(char c) {
+	decRefCount(_extern._refCount);
+	_str = _storage;
+
+	_str[0] = c;
+	_str[1] = 0;
+
+	_size = (c == 0) ? 0 : 1;
+	return *this;
+}
+
+String &String::operator+=(const char *str) {
+	if (_str <= str && str <= _str + _size)
+		return operator+=(String(str));
+
+	int len = strlen(str);
+	if (len > 0) {
+		ensureCapacity(_size + len, true);
+
+		memcpy(_str + _size, str, len + 1);
+		_size += len;
+	}
+	return *this;
+}
+
+String &String::operator+=(const String &str) {
+	if (&str == this)
+		return operator+=(String(str));
+
+	int len = str._size;
+	if (len > 0) {
+		ensureCapacity(_size + len, true);
+
+		memcpy(_str + _size, str._str, len + 1);
+		_size += len;
+	}
+	return *this;
+}
+
+String &String::operator+=(char c) {
+	ensureCapacity(_size + 1, true);
+
+	_str[_size++] = c;
+	_str[_size] = 0;
+
+	return *this;
+}
+
+bool String::hasPrefix(const String &x) const {
+	return hasPrefix(x.c_str());
+}
+
+bool String::hasPrefix(const char *x) const {
+	assert(x != 0);
+	// Compare x with the start of _str.
+	const char *y = c_str();
+	while (*x && *x == *y) {
+		++x;
+		++y;
+	}
+	// It's a prefix, if and only if all letters in x are 'used up' before
+	// _str ends.
+	return *x == 0;
+}
+
+bool String::hasSuffix(const String &x) const {
+	return hasSuffix(x.c_str());
+}
+
+bool String::hasSuffix(const char *x) const {
+	assert(x != 0);
+	// Compare x with the end of _str.
+	const uint32 x_size = strlen(x);
+	if (x_size > _size)
+		return false;
+	const char *y = c_str() + _size - x_size;
+	while (*x && *x == *y) {
+		++x;
+		++y;
+	}
+	// It's a suffix, if and only if all letters in x are 'used up' before
+	// _str ends.
+	return *x == 0;
+}
+
+bool String::contains(const String &x) const {
+	return strstr(c_str(), x.c_str()) != NULL;
+}
+
+bool String::contains(const char *x) const {
+	assert(x != 0);
+	return strstr(c_str(), x) != NULL;
+}
+
+bool String::contains(char x) const {
+	return strchr(c_str(), x) != NULL;
+}
+
+void String::deleteLastChar() {
+	if (_size > 0)
+		deleteChar(_size - 1);
+}
+
+void String::deleteChar(uint32 p) {
+	assert(p < _size);
+
+	makeUnique();
+	while (p++ < _size)
+		_str[p - 1] = _str[p];
+	_size--;
+}
+
+void String::erase(uint32 p, uint32 len) {
+	assert(p < _size);
+
+	makeUnique();
+	// If len == npos or p + len is over the end, remove all the way to the end
+	if (len == npos || p + len >= _size) {
+		// Delete char at p as well. So _size = (p - 1) + 1
+		_size = p;
+		// Null terminate
+		_str[_size] = 0;
+		return;
+	}
+
+	for ( ; p + len <= _size; p++) {
+		_str[p] = _str[p + len];
+	}
+	_size -= len;
+}
+
+void String::clear() {
+	decRefCount(_extern._refCount);
+
+	_size = 0;
+	_str = _storage;
+	_storage[0] = 0;
+}
+
+void String::setChar(char c, uint32 p) {
+	assert(p < _size);
+
+	makeUnique();
+	_str[p] = c;
+}
+
+void String::insertChar(char c, uint32 p) {
+	assert(p <= _size);
+
+	ensureCapacity(_size + 1, true);
+	_size++;
+	for (uint32 i = _size; i > p; --i)
+		_str[i] = _str[i - 1];
+	_str[p] = c;
+}
+
+void String::toLowercase() {
+	makeUnique();
+	for (uint32 i = 0; i < _size; ++i)
+		_str[i] = tolower(_str[i]);
+}
+
+void String::toUppercase() {
+	makeUnique();
+	for (uint32 i = 0; i < _size; ++i)
+		_str[i] = toupper(_str[i]);
+}
+
+uint String::hash() const {
+	return hashit(c_str());
+}
+
+// static
+String String::format(const char *fmt, ...) {
+	String output;
+
+	va_list va;
+	va_start(va, fmt);
+	output = String::vformat(fmt, va);
+	va_end(va);
+
+	return output;
+}
+
+// static
+String String::vformat(const char *fmt, va_list args) {
+	String output;
+	assert(output.isStorageIntern());
+
+	va_list va;
+	scumm_va_copy(va, args);
+	int len = vsnprintf(output._str, _builtinCapacity, fmt, va);
+	va_end(va);
+
+	if (len == -1 || len == _builtinCapacity - 1) {
+		// MSVC and IRIX don't return the size the full string would take up.
+		// MSVC returns -1, IRIX returns the number of characters actually written,
+		// which is at the most the size of the buffer minus one, as the string is
+		// truncated to fit.
+
+		// We assume MSVC failed to output the correct, null-terminated string
+		// if the return value is either -1 or size.
+		// For IRIX, because we lack a better mechanism, we assume failure
+		// if the return value equals size - 1.
+		// The downside to this is that whenever we try to format a string where the
+		// size is 1 below the built-in capacity, the size is needlessly increased.
+
+		// Try increasing the size of the string until it fits.
+		int size = _builtinCapacity;
+		do {
+			size *= 2;
+			output.ensureCapacity(size - 1, false);
+			assert(!output.isStorageIntern());
+			size = output._extern._capacity;
+
+			scumm_va_copy(va, args);
+			len = vsnprintf(output._str, size, fmt, va);
+			va_end(va);
+		} while (len == -1 || len >= size - 1);
+		output._size = len;
+	} else if (len < (int)_builtinCapacity) {
+		// vsnprintf succeeded
+		output._size = len;
+	} else {
+		// vsnprintf didn't have enough space, so grow buffer
+		output.ensureCapacity(len, false);
+		scumm_va_copy(va, args);
+		int len2 = vsnprintf(output._str, len+1, fmt, va);
+		va_end(va);
+		assert(len == len2);
+		output._size = len2;
+	}
+
+	return output;
+}
+
+
+#pragma mark -
+
+bool String::operator==(const String &x) const {
+	return equals(x);
+}
+
+bool String::operator==(const char *x) const {
+	assert(x != 0);
+	return equals(x);
+}
+
+bool String::operator!=(const String &x) const {
+	return !equals(x);
+}
+
+bool String::operator !=(const char *x) const {
+	assert(x != 0);
+	return !equals(x);
+}
+
+bool String::operator<(const String &x) const {
+	return compareTo(x) < 0;
+}
+
+bool String::operator<=(const String &x) const {
+	return compareTo(x) <= 0;
+}
+
+bool String::operator>(const String &x) const {
+	return compareTo(x) > 0;
+}
+
+bool String::operator>=(const String &x) const {
+	return compareTo(x) >= 0;
+}
+
+#pragma mark -
+
+bool operator==(const char* y, const String &x) {
+	return (x == y);
+}
+
+bool operator!=(const char* y, const String &x) {
+	return x != y;
+}
+
+#pragma mark -
+
+bool String::equals(const String &x) const {
+	return (0 == compareTo(x));
+}
+
+bool String::equals(const char *x) const {
+	assert(x != 0);
+	return (0 == compareTo(x));
+}
+
+bool String::equalsIgnoreCase(const String &x) const {
+	return (0 == compareToIgnoreCase(x));
+}
+
+bool String::equalsIgnoreCase(const char *x) const {
+	assert(x != 0);
+	return (0 == compareToIgnoreCase(x));
+}
+
+int String::compareTo(const String &x) const {
+	return compareTo(x.c_str());
+}
+
+int String::compareTo(const char *x) const {
+	assert(x != 0);
+	return strcmp(c_str(), x);
+}
+
+int String::compareToIgnoreCase(const String &x) const {
+	return compareToIgnoreCase(x.c_str());
+}
+
+int String::compareToIgnoreCase(const char *x) const {
+	assert(x != 0);
+	return scumm_stricmp(c_str(), x);
+}
+
+#pragma mark -
+
+String operator+(const String &x, const String &y) {
+	String temp(x);
+	temp += y;
+	return temp;
+}
+
+String operator+(const char *x, const String &y) {
+	String temp(x);
+	temp += y;
+	return temp;
+}
+
+String operator+(const String &x, const char *y) {
+	String temp(x);
+	temp += y;
+	return temp;
+}
+
+String operator+(char x, const String &y) {
+	String temp(x);
+	temp += y;
+	return temp;
+}
+
+String operator+(const String &x, char y) {
+	String temp(x);
+	temp += y;
+	return temp;
+}
+
+String lastPathComponent(const String &path, const char sep) {
+	const char *str = path.c_str();
+	const char *last = str + path.size();
+
+	// Skip over trailing slashes
+	while (last > str && *(last-1) == sep)
+		--last;
+
+	// Path consisted of only slashes -> return empty string
+	if (last == str)
+		return String();
+
+	// Now scan the whole component
+	const char *first = last - 1;
+	while (first > str && *first != sep)
+		--first;
+
+	if (*first == sep)
+		first++;
+
+	return String(first, last);
+}
+
+String normalizePath(const String &path, const char sep) {
+	if (path.empty())
+		return path;
+
+	const char *cur = path.c_str();
+	String result;
+
+	// If there is a leading slash, preserve that:
+	if (*cur == sep) {
+		result += sep;
+		// Skip over multiple leading slashes, so "//" equals "/"
+		while (*cur == sep)
+			++cur;
+	}
+
+	// Scan for path components till the end of the String
+	List<String> comps;
+	while (*cur != 0) {
+		const char *start = cur;
+
+		// Scan till the next path separator resp. the end of the string
+		while (*cur != sep && *cur != 0)
+			cur++;
+
+		const String component(start, cur);
+
+		if (component.empty() || component == ".") {
+			// Skip empty components and dot components
+		} else if (!comps.empty() && component == ".." && comps.back() != "..") {
+			// If stack is non-empty and top is not "..", remove top
+			comps.pop_back();
+		} else {
+			// Add the component to the stack
+			comps.push_back(component);
+		}
+
+		// Skip over separator chars
+		while (*cur == sep)
+			cur++;
+	}
+
+	// Finally, assemble all components back into a path
+	while (!comps.empty()) {
+		result += comps.front();
+		comps.pop_front();
+		if (!comps.empty())
+			result += sep;
+	}
+
+	return result;
+}
+
+size_t strlcpy(char *dst, const char *src, size_t size) {
+	// Our backup of the source's start, we need this
+	// to calculate the source's length.
+	const char * const srcStart = src;
+
+	// In case a non-empty size was specified we
+	// copy over (size - 1) bytes at max.
+	if (size != 0) {
+		// Copy over (size - 1) bytes at max.
+		while (--size != 0) {
+			if ((*dst++ = *src) == 0)
+				break;
+			++src;
+		}
+
+		// In case the source string was longer than the
+		// destination, we need to add a terminating
+		// zero.
+		if (size == 0)
+			*dst = 0;
+	}
+
+	// Move to the terminating zero of the source
+	// string, we need this to determine the length
+	// of the source string.
+	while (*src)
+		++src;
+
+	// Return the source string's length.
+	return src - srcStart;
+}
+
+size_t strlcat(char *dst, const char *src, size_t size) {
+	// In case the destination buffer does not contain
+	// space for at least 1 character, we will just
+	// return the source string's length.
+	if (size == 0)
+		return strlen(src);
+
+	// Our backup of the source's start, we need this
+	// to calculate the source's length.
+	const char * const srcStart = src;
+
+	// Our backup of the destination's start, we need
+	// this to calculate the destination's length.
+	const char * const dstStart = dst;
+
+	// Search the end of the destination, but do not
+	// move past the terminating zero.
+	while (size-- != 0 && *dst != 0)
+		++dst;
+
+	// Calculate the destination's length;
+	const size_t dstLength = dst - dstStart;
+
+	// In case we reached the end of the destination
+	// buffer before we had a chance to append any
+	// characters we will just return the destination
+	// length plus the source string's length.
+	if (size == 0)
+		return dstLength + strlen(srcStart);
+
+	// Copy over all of the source that fits
+	// the destination buffer. We also need
+	// to take the terminating zero we will
+	// add into consideration.
+	while (size-- != 0 && *src != 0)
+		*dst++ = *src++;
+	*dst = 0;
+
+	// Move to the terminating zero of the source
+	// string, we need this to determine the length
+	// of the source string.
+	while (*src)
+		++src;
+
+	// Return the total length of the result string
+	return dstLength + (src - srcStart);
+}
+
+} // End of namespace Common
+
+// Portable implementation of stricmp / strcasecmp / strcmpi.
+// TODO: Rename this to Common::strcasecmp
+int scumm_stricmp(const char *s1, const char *s2) {
+	byte l1, l2;
+	do {
+		// Don't use ++ inside tolower, in case the macro uses its
+		// arguments more than once.
+		l1 = (byte)*s1++;
+		l1 = tolower(l1);
+		l2 = (byte)*s2++;
+		l2 = tolower(l2);
+	} while (l1 == l2 && l1 != 0);
+	return l1 - l2;
+}
+
+// Portable implementation of strnicmp / strncasecmp / strncmpi.
+// TODO: Rename this to Common::strncasecmp
+int scumm_strnicmp(const char *s1, const char *s2, uint n) {
+	byte l1, l2;
+	do {
+		if (n-- == 0)
+			return 0;	// no difference found so far -> signal equality
+
+		// Don't use ++ inside tolower, in case the macro uses its
+		// arguments more than once.
+		l1 = (byte)*s1++;
+		l1 = tolower(l1);
+		l2 = (byte)*s2++;
+		l2 = tolower(l2);
+	} while (l1 == l2 && l1 != 0);
+	return l1 - l2;
+}
diff --git a/devtools/create_titanic/str.h b/devtools/create_titanic/str.h
new file mode 100644
index 0000000..2f954dc
--- /dev/null
+++ b/devtools/create_titanic/str.h
@@ -0,0 +1,386 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef COMMON_STRING_H
+#define COMMON_STRING_H
+
+#include "common/scummsys.h"
+
+#include <stdarg.h>
+
+namespace Common {
+
+/**
+ * Simple string class for ScummVM. Provides automatic storage managment,
+ * and overloads several operators in a 'natural' fashion, mimicking
+ * the std::string class. Even provides simple iterators.
+ *
+ * This class tries to avoid allocating lots of small blocks on the heap,
+ * since that is inefficient on several platforms supported by ScummVM.
+ * Instead, small strings are stored 'inside' the string object (i.e. on
+ * the stack, for stack allocated objects), and only for strings exceeding
+ * a certain length do we allocate a buffer on the heap.
+ *
+ * The presence of \0 characters in the string will cause undefined
+ * behavior in some operations.
+ */
+class String {
+public:
+	static const uint32 npos = 0xFFFFFFFF;
+protected:
+	/**
+	 * The size of the internal storage. Increasing this means less heap
+	 * allocations are needed, at the cost of more stack memory usage,
+	 * and of course lots of wasted memory. Empirically, 90% or more of
+	 * all String instances are less than 32 chars long. If a platform
+	 * is very short on stack space, it would be possible to lower this.
+	 * A value of 24 still seems acceptable, though considerably worse,
+	 * while 16 seems to be the lowest you want to go... Anything lower
+	 * than 8 makes no sense, since that's the size of member _extern
+	 * (on 32 bit machines; 12 bytes on systems with 64bit pointers).
+	 */
+	static const uint32 _builtinCapacity = 32 - sizeof(uint32) - sizeof(char *);
+
+	/**
+	 * Length of the string. Stored to avoid having to call strlen
+	 * a lot. Yes, we limit ourselves to strings shorter than 4GB --
+	 * on purpose :-).
+	 */
+	uint32 _size;
+
+	/**
+	 * Pointer to the actual string storage. Either points to _storage,
+	 * or to a block allocated on the heap via malloc.
+	 */
+	char  *_str;
+
+
+	union {
+		/**
+		 * Internal string storage.
+		 */
+		char _storage[_builtinCapacity];
+		/**
+		 * External string storage data -- the refcounter, and the
+		 * capacity of the string _str points to.
+		 */
+		struct {
+			mutable int *_refCount;
+			uint32       _capacity;
+		} _extern;
+	};
+
+	inline bool isStorageIntern() const {
+		return _str == _storage;
+	}
+
+public:
+	/** Construct a new empty string. */
+	String() : _size(0), _str(_storage) { _storage[0] = 0; }
+
+	/** Construct a new string from the given NULL-terminated C string. */
+	String(const char *str);
+
+	/** Construct a new string containing exactly len characters read from address str. */
+	String(const char *str, uint32 len);
+
+	/** Construct a new string containing the characters between beginP (including) and endP (excluding). */
+	String(const char *beginP, const char *endP);
+
+	/** Construct a copy of the given string. */
+	String(const String &str);
+
+	/** Construct a string consisting of the given character. */
+	explicit String(char c);
+
+	~String();
+
+	String &operator=(const char *str);
+	String &operator=(const String &str);
+	String &operator=(char c);
+	String &operator+=(const char *str);
+	String &operator+=(const String &str);
+	String &operator+=(char c);
+
+	bool operator==(const String &x) const;
+	bool operator==(const char *x) const;
+	bool operator!=(const String &x) const;
+	bool operator!=(const char *x) const;
+
+	bool operator<(const String &x) const;
+	bool operator<=(const String &x) const;
+	bool operator>(const String &x) const;
+	bool operator>=(const String &x) const;
+
+	bool equals(const String &x) const;
+	bool equalsIgnoreCase(const String &x) const;
+	int compareTo(const String &x) const;           // strcmp clone
+	int compareToIgnoreCase(const String &x) const; // stricmp clone
+
+	bool equals(const char *x) const;
+	bool equalsIgnoreCase(const char *x) const;
+	int compareTo(const char *x) const;             // strcmp clone
+	int compareToIgnoreCase(const char *x) const;   // stricmp clone
+
+	bool hasSuffix(const String &x) const;
+	bool hasSuffix(const char *x) const;
+
+	bool hasPrefix(const String &x) const;
+	bool hasPrefix(const char *x) const;
+
+	bool contains(const String &x) const;
+	bool contains(const char *x) const;
+	bool contains(char x) const;
+
+	inline const char *c_str() const { return _str; }
+	inline uint size() const         { return _size; }
+
+	inline bool empty() const { return (_size == 0); }
+	char firstChar() const    { return (_size > 0) ? _str[0] : 0; }
+	char lastChar() const     { return (_size > 0) ? _str[_size - 1] : 0; }
+
+	char operator[](int idx) const {
+		assert(_str && idx >= 0 && idx < (int)_size);
+		return _str[idx];
+	}
+
+	/** Remove the last character from the string. */
+	void deleteLastChar();
+
+	/** Remove the character at position p from the string. */
+	void deleteChar(uint32 p);
+
+	/** Remove all characters from position p to the p + len. If len = String::npos, removes all characters to the end */
+	void erase(uint32 p, uint32 len = npos);
+
+	/** Set character c at position p, replacing the previous character there. */
+	void setChar(char c, uint32 p);
+
+	/** Insert character c before position p. */
+	void insertChar(char c, uint32 p);
+
+	/** Clears the string, making it empty. */
+	void clear();
+
+	/** Convert all characters in the string to lowercase. */
+	void toLowercase();
+
+	/** Convert all characters in the string to uppercase. */
+	void toUppercase();
+
+	/**
+	 * Removes trailing and leading whitespaces. Uses isspace() to decide
+	 * what is whitespace and what not.
+	 */
+	void trim();
+
+	uint hash() const;
+
+	/**
+	 * Print formatted data into a String object. Similar to sprintf,
+	 * except that it stores the result in (variably sized) String
+	 * instead of a fixed size buffer.
+	 */
+	static String format(const char *fmt, ...) GCC_PRINTF(1,2);
+
+	/**
+	 * Print formatted data into a String object. Similar to vsprintf,
+	 * except that it stores the result in (variably sized) String
+	 * instead of a fixed size buffer.
+	 */
+	static String vformat(const char *fmt, va_list args);
+
+public:
+	typedef char          value_type;
+	/**
+	 * Unsigned version of the underlying type. This can be used to cast
+	 * individual string characters to bigger integer types without sign
+	 * extension happening.
+	 */
+	typedef unsigned char unsigned_type;
+	typedef char *        iterator;
+	typedef const char *  const_iterator;
+
+	iterator begin() {
+		// Since the user could potentially
+		// change the string via the returned
+		// iterator we have to assure we are
+		// pointing to a unique storage.
+		makeUnique();
+
+		return _str;
+	}
+
+	iterator end() {
+		return begin() + size();
+	}
+
+	const_iterator begin() const {
+		return _str;
+	}
+
+	const_iterator end() const {
+		return begin() + size();
+	}
+
+protected:
+	void makeUnique();
+	void ensureCapacity(uint32 new_size, bool keep_old);
+	void incRefCount() const;
+	void decRefCount(int *oldRefCount);
+	void initWithCStr(const char *str, uint32 len);
+};
+
+// Append two strings to form a new (temp) string
+String operator+(const String &x, const String &y);
+
+String operator+(const char *x, const String &y);
+String operator+(const String &x, const char *y);
+
+String operator+(const String &x, char y);
+String operator+(char x, const String &y);
+
+// Some useful additional comparison operators for Strings
+bool operator==(const char *x, const String &y);
+bool operator!=(const char *x, const String &y);
+
+// Utility functions to remove leading and trailing whitespaces
+extern char *ltrim(char *t);
+extern char *rtrim(char *t);
+extern char *trim(char *t);
+
+
+/**
+ * Returns the last component of a given path.
+ *
+ * Examples:
+ *          /foo/bar.txt    would return 'bar.txt'
+ *          /foo/bar/       would return 'bar'
+ *          /foo/./bar//    would return 'bar'
+ *
+ * @param path the path of which we want to know the last component
+ * @param sep character used to separate path components
+ * @return The last component of the path.
+ */
+String lastPathComponent(const String &path, const char sep);
+
+/**
+ * Normalize a given path to a canonical form. In particular:
+ * - trailing separators are removed:  /foo/bar/ -> /foo/bar
+ * - double separators (= empty components) are removed:   /foo//bar -> /foo/bar
+ * - dot components are removed:  /foo/./bar -> /foo/bar
+ *
+ * @todo remove double dot components:  /foo/baz/../bar -> /foo/bar
+ *
+ * @param path  the path to normalize
+ * @param sep   the separator token (usually '/' on Unix-style systems, or '\\' on Windows based stuff)
+ * @return      the normalized path
+ */
+String normalizePath(const String &path, const char sep);
+
+
+/**
+ * Simple DOS-style pattern matching function (understands * and ? like used in DOS).
+ * Taken from exult/files/listfiles.cc
+ *
+ * Token meaning:
+ *      "*": any character, any amount of times.
+ *      "?": any character, only once.
+ *      "#": any decimal digit, only once.
+ *
+ * Example strings/patterns:
+ *      String: monkey.s01   Pattern: monkey.s??    => true
+ *      String: monkey.s101  Pattern: monkey.s??    => false
+ *      String: monkey.s99   Pattern: monkey.s?1    => false
+ *      String: monkey.s101  Pattern: monkey.s*     => true
+ *      String: monkey.s99   Pattern: monkey.s*1    => false
+ *      String: monkey.s01   Pattern: monkey.s##    => true
+ *      String: monkey.s01   Pattern: monkey.###    => false
+ *
+ * @param str Text to be matched against the given pattern.
+ * @param pat Glob pattern.
+ * @param ignoreCase Whether to ignore the case when doing pattern match
+ * @param pathMode Whether to use path mode, i.e., whether slashes must be matched explicitly.
+ *
+ * @return true if str matches the pattern, false otherwise.
+ */
+bool matchString(const char *str, const char *pat, bool ignoreCase = false, bool pathMode = false);
+
+
+/**
+ * Take a 32 bit value and turn it into a four character string, where each of
+ * the four bytes is turned into one character. Most significant byte is printed
+ * first.
+ */
+String tag2string(uint32 tag);
+
+/**
+ * Copy up to size - 1 characters from src to dst and also zero terminate the
+ * result. Note that src must be a zero terminated string.
+ *
+ * In case size is zero this function just returns the length of the source
+ * string.
+ *
+ * @note This is modeled after OpenBSD's strlcpy. See the manpage here:
+ *       http://www.openbsd.org/cgi-bin/man.cgi?query=strlcpy
+ *
+ * @param dst The destination buffer.
+ * @param src The source string.
+ * @param size The size of the destination buffer.
+ * @return The length of the (non-truncated) result, i.e. strlen(src).
+ */
+size_t strlcpy(char *dst, const char *src, size_t size);
+
+/**
+ * Append the string src to the string dst. Note that both src and dst must be
+ * zero terminated. The result will be zero terminated. At most
+ * "size - strlen(dst) - 1" bytes will be appended.
+ *
+ * In case the dst string does not contain a zero within the first "size" bytes
+ * the dst string will not be changed and size + strlen(src) is returned.
+ *
+ * @note This is modeled after OpenBSD's strlcat. See the manpage here:
+ *       http://www.openbsd.org/cgi-bin/man.cgi?query=strlcat
+ *
+ * @param dst The string the source string should be appended to.
+ * @param src The source string.
+ * @param size The (total) size of the destination buffer.
+ * @return The length of the (non-truncated) result. That is
+ *         strlen(dst) + strlen(src). In case strlen(dst) > size
+ *         size + strlen(src) is returned.
+ */
+size_t strlcat(char *dst, const char *src, size_t size);
+
+/**
+ * Convenience wrapper for tag2string which "returns" a C string.
+ * Note: It is *NOT* safe to do anything with the return value other than directly
+ * copying or printing it.
+ */
+#define tag2str(x)	Common::tag2string(x).c_str()
+
+
+} // End of namespace Common
+
+extern int scumm_stricmp(const char *s1, const char *s2);
+extern int scumm_strnicmp(const char *s1, const char *s2, uint n);
+
+#endif
diff --git a/devtools/create_titanic/winexe.cpp b/devtools/create_titanic/winexe.cpp
new file mode 100644
index 0000000..c23bd84
--- /dev/null
+++ b/devtools/create_titanic/winexe.cpp
@@ -0,0 +1,83 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+#include "str.h"
+#include "winexe.h"
+
+namespace Common {
+
+WinResourceID &WinResourceID::operator=(const String &x) {
+	_name = x;
+	_idType = kIDTypeString;
+	return *this;
+}
+
+WinResourceID &WinResourceID::operator=(uint32 x) {
+	_id = x;
+	_idType = kIDTypeNumerical;
+	return *this;
+}
+
+bool WinResourceID::operator==(const String &x) const {
+	return _idType == kIDTypeString && _name.equalsIgnoreCase(x);
+}
+
+bool WinResourceID::operator==(const uint32 &x) const {
+	return _idType == kIDTypeNumerical && _id == x;
+}
+
+bool WinResourceID::operator==(const WinResourceID &x) const {
+	if (_idType != x._idType)
+		return false;
+	if (_idType == kIDTypeString)
+		return _name.equalsIgnoreCase(x._name);
+	if (_idType == kIDTypeNumerical)
+		return _id == x._id;
+	return true;
+}
+
+String WinResourceID::getString() const {
+	if (_idType != kIDTypeString)
+		return "";
+
+	return _name;
+}
+
+uint32 WinResourceID::getID() const {
+	if (_idType != kIDTypeNumerical)
+		return 0xffffffff;
+
+	return _id;
+}
+
+String WinResourceID::toString() const {
+	if (_idType == kIDTypeString)
+		return _name;
+	else if (_idType == kIDTypeNumerical)
+		return String::format("0x%08x", _id);
+
+	return "";
+}
+
+} // End of namespace Common
diff --git a/devtools/create_titanic/winexe.h b/devtools/create_titanic/winexe.h
new file mode 100644
index 0000000..da99c76
--- /dev/null
+++ b/devtools/create_titanic/winexe.h
@@ -0,0 +1,70 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef COMMON_WINEXE_H
+#define COMMON_WINEXE_H
+
+#include "hash-str.h"
+#include "str.h"
+
+namespace Common {
+
+class WinResourceID {
+public:
+	WinResourceID() { _idType = kIDTypeNull; }
+	WinResourceID(String x) { _idType = kIDTypeString; _name = x; }
+	WinResourceID(uint32 x) { _idType = kIDTypeNumerical; _id = x; }
+
+	WinResourceID &operator=(const String &x);
+	WinResourceID &operator=(uint32 x);
+
+	bool operator==(const String &x) const;
+	bool operator==(const uint32 &x) const;
+	bool operator==(const WinResourceID &x) const;
+
+	String getString() const;
+	uint32 getID() const;
+	String toString() const;
+
+private:
+	/** An ID Type. */
+	enum IDType {
+		kIDTypeNull,      ///< No type set
+		kIDTypeNumerical, ///< A numerical ID.
+		kIDTypeString     ///< A string ID.
+	} _idType;
+
+	String _name;         ///< The resource's string ID.
+	uint32 _id;           ///< The resource's numerical ID.
+};
+
+struct WinResourceID_Hash {
+	uint operator()(const WinResourceID &id) const { return hashit(id.toString()); }
+};
+
+struct WinResourceID_EqualTo {
+	bool operator()(const WinResourceID &id1, const WinResourceID &id2) const { return id1 == id2; }
+};
+
+} // End of namespace Common
+
+#endif
diff --git a/devtools/create_titanic/winexe_pe.cpp b/devtools/create_titanic/winexe_pe.cpp
new file mode 100644
index 0000000..16ad16a
--- /dev/null
+++ b/devtools/create_titanic/winexe_pe.cpp
@@ -0,0 +1,260 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+#include "file.h"
+#include "str.h"
+#include "winexe_pe.h"
+#include "common/array.h"
+#include "common/endian.h"
+
+namespace Common {
+
+PEResources::PEResources() {
+	_exe = 0;
+}
+
+PEResources::~PEResources() {
+	clear();
+}
+
+void PEResources::clear() {
+	_sections.clear();
+	_resources.clear();
+	delete _exe; _exe = 0;
+}
+
+bool PEResources::loadFromEXE(const String &fileName) {
+	if (fileName.empty())
+		return false;
+
+	File *file = new File();
+
+	if (!file->open(fileName.c_str())) {
+		delete file;
+		return false;
+	}
+
+	return loadFromEXE(file);
+}
+
+bool PEResources::loadFromEXE(File *stream) {
+	clear();
+
+	if (!stream)
+		return false;
+
+	if (stream->readUint16BE() != MKTAG16('M', 'Z'))
+		return false;
+
+	stream->skip(58);
+
+	uint32 peOffset = stream->readUint32LE();
+
+	if (!peOffset || peOffset >= (uint32)stream->size())
+		return false;
+
+	stream->seek(peOffset);
+
+	if (stream->readUint32BE() != MKTAG('P','E',0,0))
+		return false;
+
+	stream->skip(2);
+	uint16 sectionCount = stream->readUint16LE();
+	stream->skip(12);
+	uint16 optionalHeaderSize = stream->readUint16LE();
+	stream->skip(optionalHeaderSize + 2);
+
+	// Read in all the sections
+	for (uint16 i = 0; i < sectionCount; i++) {
+		char sectionName[9];
+		stream->read(sectionName, 8);
+		sectionName[8] = 0;
+
+		Section section;
+		stream->skip(4);
+		section.virtualAddress = stream->readUint32LE();
+		section.size = stream->readUint32LE();
+		section.offset = stream->readUint32LE();
+		stream->skip(16);
+
+		_sections[sectionName] = section;
+	}
+
+	// Currently, we require loading a resource section
+	if (!_sections.contains(".rsrc")) {
+		clear();
+		return false;
+	}
+
+	_exe = stream;
+
+	Section &resSection = _sections[".rsrc"];
+	parseResourceLevel(resSection, resSection.offset, 0);
+
+	return true;
+}
+
+void PEResources::parseResourceLevel(Section &section, uint32 offset, int level) {
+	_exe->seek(offset + 12);
+
+	uint16 namedEntryCount = _exe->readUint16LE();
+	uint16 intEntryCount = _exe->readUint16LE();
+
+	for (uint32 i = 0; i < (uint32)(namedEntryCount + intEntryCount); i++) {
+		uint32 value = _exe->readUint32LE();
+
+		WinResourceID id;
+
+		if (value & 0x80000000) {
+			value &= 0x7fffffff;
+
+			uint32 startPos = _exe->pos();
+			_exe->seek(section.offset + (value & 0x7fffffff));
+
+			// Read in the name, truncating from unicode to ascii
+			String name;
+			uint16 nameLength = _exe->readUint16LE();
+			while (nameLength--)
+				name += (char)(_exe->readUint16LE() & 0xff);
+
+			_exe->seek(startPos);
+
+			id = name;
+		} else {
+			id = value;
+		}
+
+		uint32 nextOffset = _exe->readUint32LE();
+		uint32 lastOffset = _exe->pos();
+
+		if (level == 0)
+			_curType = id;
+		else if (level == 1)
+			_curName = id;
+		else if (level == 2)
+			_curLang = id;
+
+		if (level < 2) {
+			// Time to dive down further
+			parseResourceLevel(section, section.offset + (nextOffset & 0x7fffffff), level + 1);
+		} else {
+			_exe->seek(section.offset + nextOffset);
+
+			Resource resource;
+			resource.offset = _exe->readUint32LE() + section.offset - section.virtualAddress;
+			resource.size = _exe->readUint32LE();
+
+			_resources[_curType][_curName][_curLang] = resource;
+		}
+
+		_exe->seek(lastOffset);
+	}
+}
+
+const Array<WinResourceID> PEResources::getTypeList() const {
+	Array<WinResourceID> array;
+
+	if (!_exe)
+		return array;
+
+	for (TypeMap::const_iterator it = _resources.begin(); it != _resources.end(); it++)
+		array.push_back(it->_key);
+
+	return array;
+}
+
+const Array<WinResourceID> PEResources::getNameList(const WinResourceID &type) const {
+	Array<WinResourceID> array;
+
+	if (!_exe || !_resources.contains(type))
+		return array;
+
+	const NameMap &nameMap = _resources[type];
+
+	for (NameMap::const_iterator it = nameMap.begin(); it != nameMap.end(); it++)
+		array.push_back(it->_key);
+
+	return array;
+}
+
+const Array<WinResourceID> PEResources::getLangList(const WinResourceID &type, const WinResourceID &name) const {
+	Array<WinResourceID> array;
+
+	if (!_exe || !_resources.contains(type))
+		return array;
+
+	const NameMap &nameMap = _resources[type];
+
+	if (!nameMap.contains(name))
+		return array;
+
+	const LangMap &langMap = nameMap[name];
+
+	for (LangMap::const_iterator it = langMap.begin(); it != langMap.end(); it++)
+		array.push_back(it->_key);
+
+	return array;
+}
+
+File *PEResources::getResource(const WinResourceID &type, const WinResourceID &name) {
+	Array<WinResourceID> langList = getLangList(type, name);
+
+	if (langList.empty())
+		return 0;
+
+	const Resource &resource = _resources[type][name][langList[0]];
+	byte *data = (byte *)malloc(resource.size);
+	_exe->seek(resource.offset);
+	_exe->read(data, resource.size);
+
+	File *file = new File();
+	file->open(data, resource.size);
+	return file;
+}
+
+File *PEResources::getResource(const WinResourceID &type, const WinResourceID &name, const WinResourceID &lang) {
+	if (!_exe || !_resources.contains(type))
+		return 0;
+
+	const NameMap &nameMap = _resources[type];
+
+	if (!nameMap.contains(name))
+		return 0;
+
+	const LangMap &langMap = nameMap[name];
+
+	if (!langMap.contains(lang))
+		return 0;
+
+	const Resource &resource = langMap[lang];
+	byte *data = (byte *)malloc(resource.size);
+	_exe->seek(resource.offset);
+	_exe->read(data, resource.size);
+
+	File *file = new File();
+	file->open(data, resource.size);
+	return file;
+}
+
+} // End of namespace Common
diff --git a/devtools/create_titanic/winexe_pe.h b/devtools/create_titanic/winexe_pe.h
new file mode 100644
index 0000000..49e29b7
--- /dev/null
+++ b/devtools/create_titanic/winexe_pe.h
@@ -0,0 +1,120 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef COMMON_WINEXE_PE_H
+#define COMMON_WINEXE_PE_H
+
+#include "file.h"
+#include "hash-str.h"
+#include "hashmap.h"
+#include "str.h"
+#include "winexe.h"
+
+namespace Common {
+
+template<class T> class Array;
+class SeekableReadStream;
+
+/** The default Windows PE resources. */
+enum PEResourceType {
+	kPECursor =       0x01,
+	kPEBitmap =       0x02,
+	kPEIcon =         0x03,
+	kPEMenu =         0x04,
+	kPEDialog =       0x05,
+	kPEString =       0x06,
+	kPEFontDir =      0x07,
+	kPEFont =         0x08,
+	kPEAccelerator =  0x09,
+	kPERCData =       0x0A,
+	kPEMessageTable = 0x0B,
+	kPEGroupCursor =  0x0C,
+	kPEGroupIcon =    0x0E,
+	kPEVersion =      0x10,
+	kPEDlgInclude =   0x11,
+	kPEPlugPlay =     0x13,
+	kPEVXD =          0x14,
+	kPEAniCursor =    0x15,
+	kPEAniIcon =      0x16
+};
+
+/**
+ * A class able to load resources from a Windows Portable Executable, such
+ * as cursors, bitmaps, and sounds.
+ */
+class PEResources {
+public:
+	PEResources();
+	~PEResources();
+
+	/** Clear all information. */
+	void clear();
+
+	/** Load from an EXE file. */
+	bool loadFromEXE(const String &fileName);
+
+	bool loadFromEXE(File *stream);
+
+	/** Return a list of resource types. */
+	const Array<WinResourceID> getTypeList() const;
+
+	/** Return a list of names for a given type. */
+	const Array<WinResourceID> getNameList(const WinResourceID &type) const;
+
+	/** Return a list of languages for a given type and name. */
+	const Array<WinResourceID> getLangList(const WinResourceID &type, const WinResourceID &name) const;
+
+	/** Return a stream to the specified resource, taking the first language found (or 0 if non-existent). */
+	File *getResource(const WinResourceID &type, const WinResourceID &name);
+
+	/** Return a stream to the specified resource (or 0 if non-existent). */
+	File *getResource(const WinResourceID &type, const WinResourceID &name, const WinResourceID &lang);
+
+private:
+	struct Section {
+		uint32 virtualAddress;
+		uint32 size;
+		uint32 offset;
+	};
+
+	HashMap<String, Section, IgnoreCase_Hash, IgnoreCase_EqualTo> _sections;
+
+	File *_exe;
+
+	void parseResourceLevel(Section &section, uint32 offset, int level);
+	WinResourceID _curType, _curName, _curLang;
+
+	struct Resource {
+		uint32 offset;
+		uint32 size;
+	};
+
+	typedef HashMap<WinResourceID, Resource, WinResourceID_Hash, WinResourceID_EqualTo> LangMap;
+	typedef HashMap<WinResourceID,  LangMap, WinResourceID_Hash, WinResourceID_EqualTo> NameMap;
+	typedef HashMap<WinResourceID,  NameMap, WinResourceID_Hash, WinResourceID_EqualTo> TypeMap;
+
+	TypeMap _resources;
+};
+
+} // End of namespace Common
+
+#endif


Commit: 053ff7ab75e0ee1f18606dd6c7488c5cc0d31ae5
    https://github.com/scummvm/scummvm/commit/053ff7ab75e0ee1f18606dd6c7488c5cc0d31ae5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:11:06-04:00

Commit Message:
TITANIC: Change engine to use titanic.dat

Changed paths:
    engines/titanic/support/files_manager.cpp
    engines/titanic/support/files_manager.h
    engines/titanic/support/font.cpp
    engines/titanic/true_talk/title_engine.cpp



diff --git a/engines/titanic/support/files_manager.cpp b/engines/titanic/support/files_manager.cpp
index eb2f95e..c415731 100644
--- a/engines/titanic/support/files_manager.cpp
+++ b/engines/titanic/support/files_manager.cpp
@@ -28,10 +28,38 @@ namespace Titanic {
 
 CFilesManager::CFilesManager() : _gameManager(nullptr), _assetsPath("Assets"),
 		_field0(0), _drive(-1), _field18(0), _field1C(0), _field3C(0) {
-	_exeResources.loadFromEXE("st.exe");
+	loadResourceIndex();
 }
 
 CFilesManager::~CFilesManager() {
+	_datFile.close();
+}
+
+void CFilesManager::loadResourceIndex() {
+	if (!_datFile.open("titanic.dat"))
+		error("Could not find titanic.dat data file");
+
+	uint headerId = _datFile.readUint32BE();
+	uint version = _datFile.readUint16LE();
+	if (headerId != MKTAG('S', 'V', 'T', 'N') || version < 1)
+		error("Invalid data file");
+
+	// Read in entries
+	uint offset, size;
+	char c;
+	Common::String resourceName;
+	for (;;) {
+		offset = _datFile.readUint32LE();
+		size = _datFile.readUint32LE();
+		if (size == 0)
+			break;
+
+		Common::String resName;
+		while ((c = _datFile.readByte()) != '\0')
+			resName += c;
+
+		_resources[resName] = ResourceEntry(offset, size);
+	}
 }
 
 bool CFilesManager::fileExists(const CString &name) {
@@ -92,9 +120,11 @@ void CFilesManager::preload(const CString &name) {
 	// We don't currently do any preloading of resources
 }
 
-Common::SeekableReadStream *CFilesManager::getResource(
-		Common::WinResourceID area, Common::WinResourceID name) {
-	return _exeResources.getResource(area, name);
+Common::SeekableReadStream *CFilesManager::getResource(const CString &str) {
+	ResourceEntry resEntry = _resources[str];
+	_datFile.seek(resEntry._offset);
+
+	return _datFile.readStream(resEntry._size);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/files_manager.h b/engines/titanic/support/files_manager.h
index 6be6a13..ec0c7fc 100644
--- a/engines/titanic/support/files_manager.h
+++ b/engines/titanic/support/files_manager.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_FILES_MANAGER_H
 #define TITANIC_FILES_MANAGER_H
 
-#include "common/winexe_pe.h"
+#include "common/hashmap.h"
 #include "titanic/core/list.h"
 #include "titanic/support/screen_manager.h"
 
@@ -35,9 +35,18 @@ class CFilesManagerList : public List<ListItem> {
 };
 
 class CFilesManager {
+	struct ResourceEntry {
+		uint _offset;
+		uint _size;
+		
+		ResourceEntry() : _offset(0), _size(0) {}
+		ResourceEntry(uint offset, uint size) : _offset(offset), _size(size) {}
+	};
+	typedef Common::HashMap<Common::String, ResourceEntry> ResourceHash;
 private:
 	CGameManager *_gameManager;
-	Common::PEResources _exeResources;
+	Common::File _datFile;
+	ResourceHash _resources;
 	CFilesManagerList _list;
 	CString _string1;
 	CString _string2;
@@ -47,6 +56,8 @@ private:
 	int _field1C;
 	int _field3C;
 	const CString _assetsPath;
+private:
+	void loadResourceIndex();
 public:
 	CFilesManager();
 	~CFilesManager();
@@ -90,8 +101,7 @@ public:
 	/**
 	 * Get a resource from the executable
 	 */
-	Common::SeekableReadStream *getResource(Common::WinResourceID area,
-		Common::WinResourceID name);
+	Common::SeekableReadStream *getResource(const CString &str);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index 916f020..c960e2f 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -42,7 +42,7 @@ STFont::~STFont() {
 void STFont::load(int fontNumber) {
 	assert(!_dataPtr);
 	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource(
-		Common::WinResourceID("STFONT"), fontNumber);
+		CString::format("STFONT/%d", fontNumber));
 	if (!stream)
 		error("Could not locate the specified font");
 
diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
index 511ee0a..d5f4651 100644
--- a/engines/titanic/true_talk/title_engine.cpp
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -67,7 +67,7 @@ void STtitleEngine::dump(int val1, int val2) {
 
 SimpleFile *STtitleEngine::open(const CString &name) {
 	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource(
-		Common::WinResourceID("TEXT"), name);
+		CString::format("TEXT/%s", name.c_str()));
 	assert(stream);
 
 	SimpleFile *file = new SimpleFile();


Commit: b37da849c936cc1842969b150e84dd0ad145f576
    https://github.com/scummvm/scummvm/commit/b37da849c936cc1842969b150e84dd0ad145f576
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:11:43-04:00

Commit Message:
TITANIC: Implement TTparser searchAndReplace methods

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp
    engines/titanic/support/string.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_string.h



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index e41b125..2f60508 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -49,20 +49,74 @@
  */
 
 #define VERSION_NUMBER 1
+#define HEADER_SIZE 0x280
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
 uint headerOffset = 6;
-uint dataOffset = 0x200;
+uint dataOffset = HEADER_SIZE;
 #define SEGMENT_OFFSET 0x401C00
 
+static const char *const ITEM_NAMES[46] = {
+	"LeftArmWith", "LeftArmWithout", "RightArmWith", "RightArmWithout", "BridgeRed",
+	"BridgeYellow", "BridgeBlue", "BridgeGreen", "Parrot", "CentralCore", "BrainGreen",
+	"BrainYellow", "BrainRed", "BrainBlue", "ChickenGreasy", "ChickenPlain", "ChickenPurple",
+	"ChickenRed", "ChickenYellow", "CrushedTV", "Ear", "Ear1", "Eyeball", "Eyeball1",
+	"Feather", "Lemon", "GlassEmpty", "GlassPurple", "GlassRed", "GlassYellow", "Hammer",
+	"Hose", "HoseEnd", "LiftHead", "LongStick", "Magazine", "Mouth", "MusicKey", "Napkin",
+	"Nose", "Perch", "PhonoCylinder", "PhonoCylinder1", "PhonoCylinder2", "PhonoCylinder3",
+	"Photo"
+};
+
+static const char *const ITEM_DESCRIPTIONS[46] = {
+	"The Maitre d'Bot's left arm holding a key", "The Maitre d'Bot's left arm",
+	"The Maitre d'Bot's right arm holding Titania's auditory center",
+	"The Maitre d'Bot's right arm", "Red Fuse", "Yellow Fuse", "Blue Fuse",
+	"Green Fuse", "The Parrot", "Titania's central intelligence core",
+	"Titania's auditory center", "Titania's olfactory center",
+	"Titania's speech center", "Titania's vision center", "rather greasy chicken",
+	"very plain chicken", "chicken smeared with starling pur$e",
+	"chicken covered with tomato sauce", "chicken coated in mustard sauce",
+	"A crushed television set", "Titania's ear", "Titania's ear", "Titania's eye",
+	"Titania's eye", "A parrot feather", "A nice fat juicy lemon",
+	"An empty beer glass", "A beer glass containing pur$ed flock of starlings",
+	"A beer glass containing tomato sauce", "A beer glass containing mustard sauce",
+	"A hammer", "A hose", "The other end of a hose", "The LiftBot's head",
+	"A rather long stick", "A magazine", "Titania's mouth", "A key",
+	"A super-absorbent napkin", "Titania's nose", "A perch", "A phonograph cylinder",
+	"A phonograph cylinder", "A phonograph cylinder", "A phonograph cylinder",
+	"A photograph"
+};
+
+static const char *const ITEM_IDS[40] = {
+	"MaitreD Left Arm", "MaitreD Right Arm", "OlfactoryCentre", "AuditoryCentre",
+	"SpeechCentre", "VisionCentre", "CentralCore", "Perch", "SeasonBridge",
+	"FanBridge", "BeamBridge", "ChickenBridge", "CarryParrot", "Chicken",
+	"CrushedTV", "Feathers", "Lemon", "BeerGlass", "BigHammer", "Ear1", "Ear 2",
+	"Eye1", "Eye2", "Mouth", "Nose", "NoseSpare", "Hose", "DeadHoseSpare",
+	"HoseEnd", "DeadHoseEndSpare", "BrokenLiftbotHead", "LongStick", "Magazine",
+	"Napkin", "Phonograph Cylinder", "Phonograph Cylinder 1", "Phonograph Cylinder 2",
+	"Phonograph Cylinder 3", "Photograph", "Music System Key"
+};
+
+static const char *const ROOM_NAMES[34] = {
+	"1stClassLobby", "1stClassRestaurant", "1stClassState",
+	"2ndClassLobby", "secClassState", "Arboretum", "FrozenArboretum",
+	"Bar", "BilgeRoom", "BilgeRoomWith", "BottomOfWell", "Bridge",
+	"CreatorsChamber", "CreatorsChamberOn", "Dome", "Home", "Lift",
+	"EmbLobby", "MoonEmbLobby", "MusicRoomLobby", "MusicRoom",
+	"ParrotLobby", "Pellerator", "PromenadeDeck", "SculptureChamber",
+	"SecClassLittleLift", "ServiceElevator", "SGTLeisure", "SGTLittleLift",
+	"SgtLobby", "SGTState", "Titania", "TopOfWell", "PlayersRoom"
+};
+
 void NORETURN_PRE error(const char *s, ...) {
 	printf("%s\n", s);
 	exit(1);
 }
 
 void writeEntryHeader(const char *name, uint offset, uint size) {
-	assert(headerOffset < 0x200);
+	assert(headerOffset < HEADER_SIZE);
 	outputFile.seek(headerOffset);
 	outputFile.writeLong(offset);
 	outputFile.writeLong(size);
@@ -72,7 +126,7 @@ void writeEntryHeader(const char *name, uint offset, uint size) {
 }
 
 void writeFinalEntryHeader() {
-	assert(headerOffset <= 0x1F8);
+	assert(headerOffset <= (HEADER_SIZE - 8));
 	outputFile.seek(headerOffset);
 	outputFile.writeLong(0);
 	outputFile.writeLong(0);
@@ -103,6 +157,19 @@ void writeStringArray(const char *name, uint offset, int count) {
 	delete[] offsets;
 }
 
+void writeStringArray(const char *name, const char *const *strings, int count) {
+	outputFile.seek(dataOffset);
+
+	// Iterate through writing each string
+	for (int idx = 0; idx < count; ++idx) {
+		outputFile.writeString(strings[idx]);
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader(name, dataOffset, size);
+	dataOffset += size;
+}
+
 Common::WinResourceID getResId(uint id) {
 	return Common::WinResourceID(id);
 }
@@ -152,10 +219,15 @@ void writeHeader() {
 }
 
 void writeData() {
-	writeStringArray("TEXT/STRINGS1", 0x21B7C8, 376);
-	writeStringArray("TEXT/STRINGS2", 0x21BDB0, 218);
-	writeStringArray("TEXT/STRINGS3", 0x21C120, 1576);
-	writeStringArray("TEXT/STRINGS4", 0x21D9C8, 82);
+	writeStringArray("TEXT/ITEM_DESCRIPTIONS", ITEM_DESCRIPTIONS, 46);
+	writeStringArray("TEXT/ITEM_NAMES", ITEM_NAMES, 46);
+	writeStringArray("TEXT/ITEM_IDS", ITEM_IDS, 40);
+	writeStringArray("TEXT/ROOM_NAMES", ROOM_NAMES, 34);
+
+	writeStringArray("TEXT/PHRASES", 0x21B7C8, 376);
+	writeStringArray("TEXT/REPLACEMENTS1", 0x21BDB0, 218);
+	writeStringArray("TEXT/REPLACEMENTS2", 0x21C120, 1576);
+	writeStringArray("TEXT/REPLACEMENTS3", 0x21D9C8, 82);
 
 	writeResource("Bitmap", "BACKDROP");
 	writeResource("Bitmap", "EVILTWIN");
diff --git a/engines/titanic/support/string.h b/engines/titanic/support/string.h
index 02775de..fdaf92c 100644
--- a/engines/titanic/support/string.h
+++ b/engines/titanic/support/string.h
@@ -24,6 +24,7 @@
 #define TITANIC_STRING_H
 
 #include "common/scummsys.h"
+#include "common/array.h"
 #include "common/str.h"
 
 namespace Titanic {
@@ -101,6 +102,8 @@ public:
 	static CString format(const char *fmt, ...);
 };
 
+typedef Common::Array<CString> StringArray;
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_STRING_H */
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 343d0aa..d896923 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -31,6 +31,8 @@ int TTparser::processInput(TTinput *input) {
 	if (normalize(input))
 		return 0;
 
+	// Scan for and replace common slang and contractions with verbose versions
+
 	warning("TODO: TTparser::processInput");
 	return 0;
 }
@@ -53,7 +55,7 @@ int TTparser::normalize(TTinput *input) {
 		} else if (Common::isUpper(c)) {
 			(*destLine) += toupper(c);
 		} else if (Common::isDigit(c)) {
-			if (c == '0' && isSpecialCommand(srcLine, index)) {
+			if (c == '0' && isEmoticon(srcLine, index)) {
 				input->set38(10);
 			} else {
 				// Iterate through all the digits of the number
@@ -78,7 +80,7 @@ int TTparser::normalize(TTinput *input) {
 				break;
 			
 			case ':':
-				commandVal = isSpecialCommand(srcLine, index);
+				commandVal = isEmoticon(srcLine, index);
 				if (commandVal) {
 					input->set38(commandVal);
 					index += 2;
@@ -88,7 +90,7 @@ int TTparser::normalize(TTinput *input) {
 				break;
 			
 			case ';':
-				commandVal = isSpecialCommand(srcLine, index);
+				commandVal = isEmoticon(srcLine, index);
 				if (commandVal == 6) {
 					input->set38(7);
 					index += 2;
@@ -100,7 +102,7 @@ int TTparser::normalize(TTinput *input) {
 			
 			case '<':
 				++index;
-				commandVal = isSpecialCommand(srcLine, index);
+				commandVal = isEmoticon(srcLine, index);
 				if (commandVal == 6) {
 					input->set38(12);
 				} else {
@@ -111,7 +113,7 @@ int TTparser::normalize(TTinput *input) {
 
 			case '>':
 				++index;
-				commandVal = isSpecialCommand(srcLine, index);
+				commandVal = isEmoticon(srcLine, index);
 				if (commandVal == 6 || commandVal == 9) {
 					input->set38(11);
 				} else {
@@ -150,7 +152,7 @@ int TTparser::normalize(TTinput *input) {
 	return 0;
 }
 
-int TTparser::isSpecialCommand(const TTstring &str, int &index) {
+int TTparser::isEmoticon(const TTstring &str, int &index) {
 	if (str[index] != ':' && str[index] != ';')
 		return 0;
 
@@ -258,8 +260,53 @@ bool TTparser::normalizeContraction(const TTstring &srcLine, int srcIndex, TTstr
 		break;
 	}
 
-	// TODO
 	return false;
 }
 
+void TTparser::searchAndReplace(TTstring &line, const StringArray &strings) {
+	int charIndex = 0;
+	while (charIndex >= 0)
+		charIndex = searchAndReplace(line, charIndex, strings);
+}
+
+int TTparser::searchAndReplace(TTstring &line, int startIndex, const StringArray &strings) {
+	int lineSize = line.size();
+	if (startIndex >= lineSize)
+		return -1;
+
+	for (uint idx = 0; idx < strings.size(); idx += 2) {
+		const CString &origStr = strings[idx];
+		const CString &replacementStr = strings[idx + 1];
+
+		if (!strncmp(line.c_str() + startIndex, origStr.c_str(), strings[idx].size())) {
+			// Ensure that that a space follows the match, or the end of string,
+			// so the end of the string doesn't match on parts of larger words
+			char c = line[startIndex + strings[idx].size()];
+			if (c == ' ' || c == '\0') {
+				// Replace the text in the line with it's replacement
+				line = CString(line.c_str(), line.c_str() + startIndex) + replacementStr +
+					CString(line.c_str() + startIndex + origStr.size());
+
+				startIndex += replacementStr.size();
+				break;
+			}
+		}
+	}
+
+	// Skip to the end of the current word
+	while (startIndex < lineSize && line[startIndex] != ' ')
+		++startIndex;
+	if (startIndex == lineSize)
+		return -1;
+
+	// ..and all spaces following it until the start of the next word
+	while (startIndex < lineSize && line[startIndex] == ' ')
+		++startIndex;
+	if (startIndex == lineSize)
+		return -1;
+
+	// Return index of the start of the next word
+	return startIndex;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 3e31257..1eed38d 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -46,7 +46,27 @@ private:
 	/**
 	 * Checks for what is likely special developer cheat codes
 	 */
-	static int isSpecialCommand(const TTstring &str, int &index);
+	static int isEmoticon(const TTstring &str, int &index);
+
+	/**
+	 * Checks if any word within a passed line has an entry in the list of replacements,
+	 * and if found, replaces it with it's equivalent replacement string
+	 * @param line			Line to check
+	 * @param strings		List of strings to check for. Strings come in pairs, with the
+	 * first being the string to match, and the second the replacement
+	 */
+	static void searchAndReplace(TTstring &line, const StringArray &strings);
+
+	/**
+	 * Checks the string starting at a given index for any word in the passed string array,
+	 * and if found, replaces it in the line with it's replacement
+	 * @param line			Line to check
+	 * @param startIndex	Starting index in the start to check
+	 * @param strings		List of strings to check for. Strings come in pairs, with the
+	 * first being the string to match, and the second the replacement
+	 * @returns				Index of the start of the following word			
+	 */
+	static int searchAndReplace(TTstring &line, int startIndex, const StringArray &strings);
 public:
 	CScriptHandler *_owner;
 	int _field4;
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 2009167..1b208cc 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -58,7 +58,7 @@ public:
 	TTstring &operator+=(const TTstring &str);
 	TTstring &operator+=(char c);
 
-	const char &operator[](uint index) {
+	const char &operator[](int index) {
 		return *(c_str() + index);
 	}
 


Commit: e1ba9672330802c458aebd7049e8ae3f4b23f9ca
    https://github.com/scummvm/scummvm/commit/e1ba9672330802c458aebd7049e8ae3f4b23f9ca
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:12:00-04:00

Commit Message:
TITANIC: Moved other static arrays from Titanic engine to dat file

Changed paths:
    engines/titanic/support/exe_resources.cpp
    engines/titanic/support/exe_resources.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h
    engines/titanic/true_talk/tt_parser.cpp



diff --git a/engines/titanic/support/exe_resources.cpp b/engines/titanic/support/exe_resources.cpp
index 91139dc..522e92f 100644
--- a/engines/titanic/support/exe_resources.cpp
+++ b/engines/titanic/support/exe_resources.cpp
@@ -21,11 +21,12 @@
  */
 
 #include "titanic/support/exe_resources.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
 CExeResources::CExeResources() : _owner(nullptr), _field4(0), _field8(0),
-	_fieldC(0), _field10(0), _field14(0), _field18(0) {
+		_fieldC(0), _field10(0), _field14(0), _field18(0) {
 }
 
 void CExeResources::reset(CScriptHandler *owner, int val1, int val2) {
diff --git a/engines/titanic/support/exe_resources.h b/engines/titanic/support/exe_resources.h
index bb76062..49e05aa 100644
--- a/engines/titanic/support/exe_resources.h
+++ b/engines/titanic/support/exe_resources.h
@@ -23,8 +23,6 @@
 #ifndef TITANIC_EXE_RESOURCES_H
 #define TITANIC_EXE_RESOURCES_H
 
-#include "common/file.h"
-
 namespace Titanic {
 
 class CScriptHandler;
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index c2c1f18..38d536c 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -40,6 +40,7 @@
 #include "titanic/moves/enter_exit_first_class_state.h"
 #include "titanic/moves/enter_exit_sec_class_mini_lift.h"
 #include "titanic/moves/exit_pellerator.h"
+#include "titanic/support/simple_file.h"
 
 namespace Titanic {
 
@@ -81,8 +82,6 @@ void TitanicEngine::initialize() {
 	DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
 	DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
 
-	setItemNames();
-	setRoomNames();
 	CSaveableObject::initClassList();
 	CEnterExitFirstClassState::init();
 	CGetLiftEye2::init();
@@ -101,6 +100,11 @@ void TitanicEngine::initialize() {
 	_screen = new Graphics::Screen(0, 0);
 	_screenManager = new OSScreenManager(this);
 	_window = new CMainGameWindow(this);
+
+	setItemNames();
+	setRoomNames();
+	setParserStrings();
+
 	_window->applicationStarting();
 }
 
@@ -127,72 +131,61 @@ Common::Error TitanicEngine::run() {
 	return Common::kNoError;
 }
 
+static CString readString(Common::SeekableReadStream *s) {
+	CString result;
+	char c;
+	while ((c = s->readByte()) != '\0')
+		result += c;
+
+	return result;
+}
+
 void TitanicEngine::setItemNames() {
-	static const char *const NAMES[TOTAL_ITEMS] = {
-		"LeftArmWith", "LeftArmWithout", "RightArmWith", "RightArmWithout", "BridgeRed",
-		"BridgeYellow", "BridgeBlue", "BridgeGreen", "Parrot", "CentralCore", "BrainGreen",
-		"BrainYellow", "BrainRed", "BrainBlue", "ChickenGreasy", "ChickenPlain", "ChickenPurple",
-		"ChickenRed", "ChickenYellow", "CrushedTV", "Ear", "Ear1", "Eyeball", "Eyeball1",
-		"Feather", "Lemon", "GlassEmpty", "GlassPurple", "GlassRed", "GlassYellow", "Hammer",
-		"Hose", "HoseEnd", "LiftHead", "LongStick", "Magazine", "Mouth", "MusicKey", "Napkin",
-		"Nose", "Perch", "PhonoCylinder", "PhonoCylinder1", "PhonoCylinder2", "PhonoCylinder3",
-		"Photo"
-	};
-	for (uint idx = 0; idx < TOTAL_ITEMS; ++idx)
-		_itemNames[idx] = NAMES[idx];
-
-	// Item descriptions
-	static const char *const DESCRIPTIONS[TOTAL_ITEMS] = {
-		"The Maitre d'Bot's left arm holding a key", "The Maitre d'Bot's left arm",
-		"The Maitre d'Bot's right arm holding Titania's auditory center",
-		"The Maitre d'Bot's right arm", "Red Fuse", "Yellow Fuse", "Blue Fuse",
-		"Green Fuse", "The Parrot", "Titania's central intelligence core",
-		"Titania's auditory center", "Titania's olfactory center",
-		"Titania's speech center", "Titania's vision center", "rather greasy chicken",
-		"very plain chicken", "chicken smeared with starling pur$e",
-		"chicken covered with tomato sauce", "chicken coated in mustard sauce",
-		"A crushed television set", "Titania's ear", "Titania's ear", "Titania's eye",
-		"Titania's eye", "A parrot feather", "A nice fat juicy lemon",
-		"An empty beer glass", "A beer glass containing pur$ed flock of starlings",
-		"A beer glass containing tomato sauce", "A beer glass containing mustard sauce",
-		"A hammer", "A hose", "The other end of a hose", "The LiftBot's head",
-		"A rather long stick", "A magazine", "Titania's mouth", "A key",
-		"A super-absorbent napkin", "Titania's nose", "A perch", "A phonograph cylinder",
-		"A phonograph cylinder", "A phonograph cylinder", "A phonograph cylinder",
-		"A photograph"
-	};
-	for (uint idx = 0; idx < TOTAL_ITEMS; ++idx)
-		_itemDescriptions[idx] = DESCRIPTIONS[idx];
-
-	// Item identifiers
-	static const char *const ITEM_IDS[40] = {
-		"MaitreD Left Arm", "MaitreD Right Arm", "OlfactoryCentre", "AuditoryCentre",
-		"SpeechCentre", "VisionCentre", "CentralCore", "Perch", "SeasonBridge",
-		"FanBridge", "BeamBridge", "ChickenBridge", "CarryParrot", "Chicken",
-		"CrushedTV", "Feathers", "Lemon", "BeerGlass", "BigHammer", "Ear1", "Ear 2",
-		"Eye1", "Eye2", "Mouth", "Nose", "NoseSpare", "Hose", "DeadHoseSpare",
-		"HoseEnd", "DeadHoseEndSpare", "BrokenLiftbotHead", "LongStick", "Magazine",
-		"Napkin", "Phonograph Cylinder", "Phonograph Cylinder 1", "Phonograph Cylinder 2",
-		"Phonograph Cylinder 3", "Photograph", "Music System Key"
-	};
-	for (uint idx = 0; idx < 40; ++idx)
-		_itemIds[idx] = ITEM_IDS[idx];
+	Common::SeekableReadStream *r;
+	r = g_vm->_filesManager->getResource("TEXT/ITEM_NAMES");
+	while (r->pos() < r->size())
+		_itemNames.push_back(readString(r));
+	delete r;
+
+	r = g_vm->_filesManager->getResource("TEXT/ITEM_DESCRIPTIONS");
+	while (r->pos() < r->size())
+		_itemNames.push_back(readString(r));
+	delete r;
+
+	r = g_vm->_filesManager->getResource("TEXT/ITEM_IDS");
+	while (r->pos() < r->size())
+		_itemIds.push_back(readString(r));
+	delete r;
 }
 
 void TitanicEngine::setRoomNames() {
-	static const char *const ROOM_NAMES[TOTAL_ROOMS] = {
-		"1stClassLobby", "1stClassRestaurant", "1stClassState",
-		"2ndClassLobby", "secClassState", "Arboretum", "FrozenArboretum",
-		"Bar", "BilgeRoom", "BilgeRoomWith", "BottomOfWell", "Bridge",
-		"CreatorsChamber", "CreatorsChamberOn", "Dome", "Home", "Lift",
-		"EmbLobby", "MoonEmbLobby", "MusicRoomLobby", "MusicRoom",
-		"ParrotLobby", "Pellerator", "PromenadeDeck", "SculptureChamber",
-		"SecClassLittleLift", "ServiceElevator", "SGTLeisure", "SGTLittleLift",
-		"SgtLobby", "SGTState", "Titania", "TopOfWell", "PlayersRoom"
-	};
-
-	for (uint idx = 0; idx < TOTAL_ROOMS; ++idx)
-		_roomNames[idx] = ROOM_NAMES[idx];
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource("TEXT/ROOM_NAMES");
+	while (r->pos() < r->size())
+		_roomNames.push_back(readString(r));
+	delete r;
+}
+
+void TitanicEngine::setParserStrings() {
+	Common::SeekableReadStream *r;
+	r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS1");
+	while (r->pos() < r->size())
+		_replacements1.push_back(readString(r));
+	delete r;
+
+	r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS2");
+	while (r->pos() < r->size())
+		_replacements2.push_back(readString(r));
+	delete r;
+
+	r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS3");
+	while (r->pos() < r->size())
+		_replacements3.push_back(readString(r));
+	delete r;
+
+	r = g_vm->_filesManager->getResource("TEXT/PHRASES");
+	while (r->pos() < r->size())
+		_phrases.push_back(readString(r));
+	delete r;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index c30ad36..95d1aba 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -25,6 +25,7 @@
 
 #include "common/scummsys.h"
 #include "common/random.h"
+#include "common/str-array.h"
 #include "common/system.h"
 #include "common/serializer.h"
 #include "engines/advancedDetector.h"
@@ -102,6 +103,11 @@ private:
 	 * Sets up the list of room names
 	 */
 	void setRoomNames();
+
+	/**
+	 * Set the replacement strings and common phrases lists used by the praser
+	 */
+	void setParserStrings();
 protected:
 	const TitanicGameDescription *_gameDescription;
 	int _loadSaveSlot;
@@ -122,11 +128,15 @@ public:
 	TTscriptBase *_script;
 	CExeResources _exeResources;
 	CMovieList _activeMovies;
-	CString _itemNames[TOTAL_ITEMS];
-	CString _itemDescriptions[TOTAL_ITEMS];
+	StringArray _itemNames;
+	StringArray _itemDescriptions;
 	CString _itemObjects[TOTAL_ITEMS];
-	CString _itemIds[40];
-	CString _roomNames[TOTAL_ROOMS];
+	StringArray _itemIds;
+	StringArray _roomNames;
+	StringArray _replacements1;
+	StringArray _replacements2;
+	StringArray _replacements3;
+	StringArray _phrases;
 public:
 	TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
 	virtual ~TitanicEngine();
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index d896923..4fdaf58 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -23,6 +23,7 @@
 #include "titanic/true_talk/tt_parser.h"
 #include "titanic/true_talk/script_handler.h"
 #include "titanic/true_talk/tt_input.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -32,6 +33,17 @@ int TTparser::processInput(TTinput *input) {
 		return 0;
 
 	// Scan for and replace common slang and contractions with verbose versions
+	searchAndReplace(input->_normalizedLine, g_vm->_replacements1);
+	searchAndReplace(input->_normalizedLine, g_vm->_replacements2);
+
+	// Check entire normalized line against common phrases to replace
+	for (uint idx = 0; idx < g_vm->_phrases.size(); idx += 2) {
+		if (!g_vm->_phrases[idx].compareTo(input->_normalizedLine))
+			input->_normalizedLine = g_vm->_phrases[idx + 1];
+	}
+
+	// Do a further search and replace of roman numerals to decimal
+	searchAndReplace(input->_normalizedLine, g_vm->_replacements3);
 
 	warning("TODO: TTparser::processInput");
 	return 0;


Commit: e16239e21fb1893e700f1a11bbc251d9915c03a7
    https://github.com/scummvm/scummvm/commit/e16239e21fb1893e700f1a11bbc251d9915c03a7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:12:02-04:00

Commit Message:
TITANIC: Implemented parser replaceNumbers sub-methods

Changed paths:
    engines/titanic/titanic.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h



diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 95d1aba..2b08f56 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -82,6 +82,17 @@ struct TitanicSavegameHeader {
 	int _totalFrames;
 };
 
+enum NumberFlag { NF_2 = 2, NF_8 = 8, NF_10 = 0x10 };
+
+struct NumberEntry {
+	CString _text;
+	int _value;
+	int _flags;
+	NumberEntry(const CString &text, int value, int flags) :
+		_text(text), _value(value), _flags(flags) {}
+};
+typedef Common::Array<NumberEntry> NumberArray;
+
 class TitanicEngine : public Engine {
 private:
 	/**
@@ -137,6 +148,7 @@ public:
 	StringArray _replacements2;
 	StringArray _replacements3;
 	StringArray _phrases;
+	NumberArray _numbers;
 public:
 	TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
 	virtual ~TitanicEngine();
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 4fdaf58..9aa6c2e 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -321,4 +321,38 @@ int TTparser::searchAndReplace(TTstring &line, int startIndex, const StringArray
 	return startIndex;
 }
 
+bool TTparser::replaceNumbers(TTstring &line, int *startIndex) {
+	int lineSize = line.size();
+	int index = *startIndex;
+	if (index < 0 || index >= lineSize)
+		return true;
+
+	NumberArray &numbers = g_vm->_numbers;
+	NumberEntry *numEntry = nullptr;
+
+	for (uint idx = 0; idx < numbers.size(); ++idx) {
+		NumberEntry &ne = numbers[idx];
+		if (!strncmp(line.c_str() + index, ne._text.c_str(), ne._text.size())) {
+			if ((ne._flags & NF_10) || (index + ne._text.size()) >= lineSize ||
+					line[index + ne._text.size()] == ' ') {
+				*startIndex += ne._text.size();
+				numEntry = ≠
+				break;
+			}
+		}
+	}
+
+	if (!numEntry || !(numEntry->_flags & NF_10)) {
+		// Skip to end of current word
+		while (*startIndex < lineSize && !Common::isSpace(line[*startIndex]))
+			++*startIndex;
+	}
+
+	// Skip over following spaces until start of following word is reached
+	while (*startIndex < lineSize && Common::isSpace(line[*startIndex]))
+		++*startIndex;
+
+	return *startIndex < lineSize;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 1eed38d..22a2850 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -67,6 +67,16 @@ private:
 	 * @returns				Index of the start of the following word			
 	 */
 	static int searchAndReplace(TTstring &line, int startIndex, const StringArray &strings);
+
+	/**
+	 * Checks the string starting at a given index for a number representation
+	 * such as roman numericals, spelled out numbers, etc. and replaces it with
+	 * a plain decimal representation.
+	 * @param line			Line to check
+	 * @param startIndex	Starting index in the start to check
+	 * @returns				True if end of line hasn't been reached yet
+	 */
+	static bool replaceNumbers(TTstring &line, int *startIndex);
 public:
 	CScriptHandler *_owner;
 	int _field4;


Commit: 3878f38d8c76f2289be1f53bbecf9cda95e43067
    https://github.com/scummvm/scummvm/commit/3878f38d8c76f2289be1f53bbecf9cda95e43067
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:12:22-04:00

Commit Message:
TITANIC: Move replacement string arrays into TTparser, added NUMBERS array

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp
    engines/titanic/support/simple_file.cpp
    engines/titanic/support/simple_file.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 2f60508..ca55f7c 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -49,7 +49,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x280
+#define HEADER_SIZE 0x290
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -110,6 +110,90 @@ static const char *const ROOM_NAMES[34] = {
 	"SgtLobby", "SGTState", "Titania", "TopOfWell", "PlayersRoom"
 };
 
+struct NumberEntry {
+	const char *_text;
+	int _value;
+	uint _flags;
+};
+
+const NumberEntry NUMBERS[76] = {
+	{ "a", 1, 3 },
+	{ "and", 0, 1 },
+	{ "negative", 0, 10 },
+	{ "minus", 0, 10 },
+	{ "below zeor", 0, 8 },
+	{ "degrees below zero", 0, 8 },
+	{ "nil", 0, 2 },
+	{ "zero", 0, 2 },
+	{ "one", 1, 0x12 },
+	{ "two", 2, 0x12 },
+	{ "three", 3, 0x12 },
+	{ "four", 4, 0x12 },
+	{ "five", 5, 0x12 },
+	{ "six", 6, 0x12 },
+	{ "seven", 7, 0x12 },
+	{ "eight", 8, 0x12 },
+	{ "nine", 9, 0x12 },
+	{ "0", 0, 2 },
+	{ "1", 1, 2 },
+	{ "2", 2, 2 },
+	{ "3", 3, 2 },
+	{ "4", 4, 2 },
+	{ "5", 5, 2 },
+	{ "6", 6, 2 },
+	{ "7", 7, 2 },
+	{ "8", 8, 2 },
+	{ "9", 9, 2 },
+	{ "first", 1, 2 },
+	{ "second", 2, 2 },
+	{ "third", 3, 2 },
+	{ "fourth", 4, 2 },
+	{ "fifth", 5, 2 },
+	{ "sixth", 6, 2 },
+	{ "seventh", 7, 2 },
+	{ "eighth", 8, 2 },
+	{ "ninth", 9, 2 },
+	{ "ten", 10, 2 },
+	{ "eleven", 11, 2 },
+	{ "twelve", 12, 2 },
+	{ "thirteen", 13, 2 },
+	{ "fourteen", 14, 2 },
+	{ "fifteen", 15, 2 },
+	{ "sixteen", 16, 2 },
+	{ "seventeen", 17, 2 },
+	{ "eighteen", 18, 2 },
+	{ "nineteen", 19, 2 },
+	{ "tenth", 10, 2 },
+	{ "eleventh", 11, 2 },
+	{ "twelfth", 12, 2 },
+	{ "thirteenth", 13, 2 },
+	{ "fourteenth", 14, 2 },
+	{ "fifteenth", 15, 2 },
+	{ "sixteenth", 16, 2 },
+	{ "seventeenth", 17, 2 },
+	{ "eighteenth", 18, 2 },
+	{ "nineteenth", 19, 2 },
+	{ "twenty", 20, 0x12 },
+	{ "thirty", 30, 0x12 },
+	{ "forty", 40, 0x12 },
+	{ "fourty", 40, 0x12 },
+	{ "fifty", 50, 0x12 },
+	{ "sixty", 60, 0x12 },
+	{ "seventy", 70, 0x12 },
+	{ "eighty", 80, 0x12 },
+	{ "ninety", 90, 0x12 },
+	{ "twentieth", 20, 2 },
+	{ "thirtieth", 30, 2 },
+	{ "fortieth", 40, 2 },
+	{ "fiftieth", 50, 2 },
+	{ "sixtieth", 60, 2 },
+	{ "seventieth", 70, 2 },
+	{ "eightieth", 80, 2 },
+	{ "ninetieth", 90, 2 },
+	{ "hundred", 100, 4 },
+	{ "hundredth", 100, 6 }
+};
+
 void NORETURN_PRE error(const char *s, ...) {
 	printf("%s\n", s);
 	exit(1);
@@ -209,6 +293,21 @@ void writeResource(const char *sectionStr, const char *resId) {
 	writeResource(nameBuffer, file);
 }
 
+void writeNumbers() {
+	outputFile.seek(dataOffset);
+
+	// Iterate through writing each string
+	for (int idx = 0; idx < 76; ++idx) {
+		outputFile.writeString(NUMBERS[idx]._text);
+		outputFile.writeLong(NUMBERS[idx]._value);
+		outputFile.writeLong(NUMBERS[idx]._flags);
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader("TEXT/NUMBERS", dataOffset, size);
+	dataOffset += size;
+}
+
 void writeHeader() {
 	// Write out magic string
 	const char *MAGIC_STR = "SVTN";
@@ -219,16 +318,6 @@ void writeHeader() {
 }
 
 void writeData() {
-	writeStringArray("TEXT/ITEM_DESCRIPTIONS", ITEM_DESCRIPTIONS, 46);
-	writeStringArray("TEXT/ITEM_NAMES", ITEM_NAMES, 46);
-	writeStringArray("TEXT/ITEM_IDS", ITEM_IDS, 40);
-	writeStringArray("TEXT/ROOM_NAMES", ROOM_NAMES, 34);
-
-	writeStringArray("TEXT/PHRASES", 0x21B7C8, 376);
-	writeStringArray("TEXT/REPLACEMENTS1", 0x21BDB0, 218);
-	writeStringArray("TEXT/REPLACEMENTS2", 0x21C120, 1576);
-	writeStringArray("TEXT/REPLACEMENTS3", 0x21D9C8, 82);
-
 	writeResource("Bitmap", "BACKDROP");
 	writeResource("Bitmap", "EVILTWIN");
 	writeResource("Bitmap", "RESTORED");
@@ -250,6 +339,17 @@ void writeData() {
 	writeResource("TEXT", "STVOCAB.TXT");
 	writeResource("TEXT", "JRQUOTES.TXT");
 	writeResource("TEXT", 155);
+
+	writeStringArray("TEXT/ITEM_DESCRIPTIONS", ITEM_DESCRIPTIONS, 46);
+	writeStringArray("TEXT/ITEM_NAMES", ITEM_NAMES, 46);
+	writeStringArray("TEXT/ITEM_IDS", ITEM_IDS, 40);
+	writeStringArray("TEXT/ROOM_NAMES", ROOM_NAMES, 34);
+
+	writeStringArray("TEXT/PHRASES", 0x21B7C8, 376);
+	writeStringArray("TEXT/REPLACEMENTS1", 0x21BDB0, 218);
+	writeStringArray("TEXT/REPLACEMENTS2", 0x21C120, 1576);
+	writeStringArray("TEXT/REPLACEMENTS3", 0x21D9C8, 82);
+	writeNumbers();
 }
 
 int main(int argc, char *argv[]) {
diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp
index f4351f9..45b5c8a 100644
--- a/engines/titanic/support/simple_file.cpp
+++ b/engines/titanic/support/simple_file.cpp
@@ -25,6 +25,17 @@
 
 namespace Titanic {
 
+CString readStringFromStream(Common::SeekableReadStream *s) {
+	CString result;
+	char c;
+	while ((c = s->readByte()) != '\0')
+		result += c;
+
+	return result;
+}
+
+/*------------------------------------------------------------------------*/
+
 bool File::open(const Common::String &name) {
 	if (!Common::File::open(name))
 		error("Could not open file - %s", name.c_str());
diff --git a/engines/titanic/support/simple_file.h b/engines/titanic/support/simple_file.h
index cf89e5d..bca96a6 100644
--- a/engines/titanic/support/simple_file.h
+++ b/engines/titanic/support/simple_file.h
@@ -269,6 +269,11 @@ public:
 	Common::SeekableReadStream *readStream() const { return _inStream; }
 };
 
+/**
+ * General purpose support method for reading an ASCIIZ string from a stream
+ */
+CString readStringFromStream(Common::SeekableReadStream *s);
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_SIMPLE_FILE_H */
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 38d536c..da9be20 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -103,7 +103,6 @@ void TitanicEngine::initialize() {
 
 	setItemNames();
 	setRoomNames();
-	setParserStrings();
 
 	_window->applicationStarting();
 }
@@ -131,60 +130,28 @@ Common::Error TitanicEngine::run() {
 	return Common::kNoError;
 }
 
-static CString readString(Common::SeekableReadStream *s) {
-	CString result;
-	char c;
-	while ((c = s->readByte()) != '\0')
-		result += c;
-
-	return result;
-}
-
 void TitanicEngine::setItemNames() {
 	Common::SeekableReadStream *r;
 	r = g_vm->_filesManager->getResource("TEXT/ITEM_NAMES");
 	while (r->pos() < r->size())
-		_itemNames.push_back(readString(r));
+		_itemNames.push_back(readStringFromStream(r));
 	delete r;
 
 	r = g_vm->_filesManager->getResource("TEXT/ITEM_DESCRIPTIONS");
 	while (r->pos() < r->size())
-		_itemNames.push_back(readString(r));
+		_itemNames.push_back(readStringFromStream(r));
 	delete r;
 
 	r = g_vm->_filesManager->getResource("TEXT/ITEM_IDS");
 	while (r->pos() < r->size())
-		_itemIds.push_back(readString(r));
+		_itemIds.push_back(readStringFromStream(r));
 	delete r;
 }
 
 void TitanicEngine::setRoomNames() {
 	Common::SeekableReadStream *r = g_vm->_filesManager->getResource("TEXT/ROOM_NAMES");
 	while (r->pos() < r->size())
-		_roomNames.push_back(readString(r));
-	delete r;
-}
-
-void TitanicEngine::setParserStrings() {
-	Common::SeekableReadStream *r;
-	r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS1");
-	while (r->pos() < r->size())
-		_replacements1.push_back(readString(r));
-	delete r;
-
-	r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS2");
-	while (r->pos() < r->size())
-		_replacements2.push_back(readString(r));
-	delete r;
-
-	r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS3");
-	while (r->pos() < r->size())
-		_replacements3.push_back(readString(r));
-	delete r;
-
-	r = g_vm->_filesManager->getResource("TEXT/PHRASES");
-	while (r->pos() < r->size())
-		_phrases.push_back(readString(r));
+		_roomNames.push_back(readStringFromStream(r));
 	delete r;
 }
 
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 2b08f56..768f334 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -82,17 +82,6 @@ struct TitanicSavegameHeader {
 	int _totalFrames;
 };
 
-enum NumberFlag { NF_2 = 2, NF_8 = 8, NF_10 = 0x10 };
-
-struct NumberEntry {
-	CString _text;
-	int _value;
-	int _flags;
-	NumberEntry(const CString &text, int value, int flags) :
-		_text(text), _value(value), _flags(flags) {}
-};
-typedef Common::Array<NumberEntry> NumberArray;
-
 class TitanicEngine : public Engine {
 private:
 	/**
@@ -114,11 +103,6 @@ private:
 	 * Sets up the list of room names
 	 */
 	void setRoomNames();
-
-	/**
-	 * Set the replacement strings and common phrases lists used by the praser
-	 */
-	void setParserStrings();
 protected:
 	const TitanicGameDescription *_gameDescription;
 	int _loadSaveSlot;
@@ -144,11 +128,6 @@ public:
 	CString _itemObjects[TOTAL_ITEMS];
 	StringArray _itemIds;
 	StringArray _roomNames;
-	StringArray _replacements1;
-	StringArray _replacements2;
-	StringArray _replacements3;
-	StringArray _phrases;
-	NumberArray _numbers;
 public:
 	TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
 	virtual ~TitanicEngine();
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 9aa6c2e..24361f9 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -27,23 +27,62 @@
 
 namespace Titanic {
 
+TTparser::TTparser(CScriptHandler *owner) : _owner(owner), _field4(0),
+		_input(nullptr), _fieldC(0), _field10(0), _field14(0), _field18(0) {
+	loadArrays();
+}
+
+void TTparser::loadArrays() {
+	Common::SeekableReadStream *r;
+	r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS1");
+	while (r->pos() < r->size())
+		_replacements1.push_back(readStringFromStream(r));
+	delete r;
+
+	r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS2");
+	while (r->pos() < r->size())
+		_replacements2.push_back(readStringFromStream(r));
+	delete r;
+
+	r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS3");
+	while (r->pos() < r->size())
+		_replacements3.push_back(readStringFromStream(r));
+	delete r;
+
+	r = g_vm->_filesManager->getResource("TEXT/PHRASES");
+	while (r->pos() < r->size())
+		_phrases.push_back(readStringFromStream(r));
+	delete r;
+
+	r = g_vm->_filesManager->getResource("TEXT/NUMBERS");
+	while (r->pos() < r->size()) {
+		NumberEntry ne;
+		ne._text = readStringFromStream(r);
+		ne._value = r->readSint32LE();
+		ne._flags = r->readUint32LE();
+		_numbers.push_back(ne);
+	}
+	delete r;
+
+}
+
 int TTparser::processInput(TTinput *input) {
 	_input = input;
 	if (normalize(input))
 		return 0;
 
 	// Scan for and replace common slang and contractions with verbose versions
-	searchAndReplace(input->_normalizedLine, g_vm->_replacements1);
-	searchAndReplace(input->_normalizedLine, g_vm->_replacements2);
+	searchAndReplace(input->_normalizedLine, _replacements1);
+	searchAndReplace(input->_normalizedLine, _replacements2);
 
 	// Check entire normalized line against common phrases to replace
-	for (uint idx = 0; idx < g_vm->_phrases.size(); idx += 2) {
-		if (!g_vm->_phrases[idx].compareTo(input->_normalizedLine))
-			input->_normalizedLine = g_vm->_phrases[idx + 1];
+	for (uint idx = 0; idx < _phrases.size(); idx += 2) {
+		if (!_phrases[idx].compareTo(input->_normalizedLine))
+			input->_normalizedLine = _phrases[idx + 1];
 	}
 
 	// Do a further search and replace of roman numerals to decimal
-	searchAndReplace(input->_normalizedLine, g_vm->_replacements3);
+	searchAndReplace(input->_normalizedLine, _replacements3);
 
 	warning("TODO: TTparser::processInput");
 	return 0;
@@ -321,17 +360,18 @@ int TTparser::searchAndReplace(TTstring &line, int startIndex, const StringArray
 	return startIndex;
 }
 
-bool TTparser::replaceNumbers(TTstring &line, int *startIndex) {
+const NumberEntry *TTparser::replaceNumbers(TTstring &line, int *startIndex) {
 	int lineSize = line.size();
 	int index = *startIndex;
-	if (index < 0 || index >= lineSize)
-		return true;
+	if (index < 0 || index >= lineSize) {
+		*startIndex = -1;
+		return nullptr;
+	}
 
-	NumberArray &numbers = g_vm->_numbers;
 	NumberEntry *numEntry = nullptr;
 
-	for (uint idx = 0; idx < numbers.size(); ++idx) {
-		NumberEntry &ne = numbers[idx];
+	for (uint idx = 0; idx < _numbers.size(); ++idx) {
+		NumberEntry &ne = _numbers[idx];
 		if (!strncmp(line.c_str() + index, ne._text.c_str(), ne._text.size())) {
 			if ((ne._flags & NF_10) || (index + ne._text.size()) >= lineSize ||
 					line[index + ne._text.size()] == ' ') {
@@ -352,7 +392,10 @@ bool TTparser::replaceNumbers(TTstring &line, int *startIndex) {
 	while (*startIndex < lineSize && Common::isSpace(line[*startIndex]))
 		++*startIndex;
 
-	return *startIndex < lineSize;
+	if (*startIndex >= lineSize)
+		*startIndex = -1;
+
+	return numEntry;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 22a2850..7e4e97f 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -24,13 +24,38 @@
 #define TITANIC_TT_PARSER_H
 
 #include "titanic/true_talk/tt_input.h"
+#include "titanic/true_talk/tt_string.h"
 
 namespace Titanic {
 
+enum NumberFlag { NF_2 = 2, NF_8 = 8, NF_10 = 0x10 };
+
 class CScriptHandler;
 
+struct NumberEntry {
+	CString _text;
+	int _value;
+	int _flags;
+
+	NumberEntry() : _value(0), _flags(0) {}
+	NumberEntry(const CString &text, int value, int flags) :
+		_text(text), _value(value), _flags(flags) {}
+};
+typedef Common::Array<NumberEntry> NumberArray;
+
 class TTparser {
 private:
+	StringArray _replacements1;
+	StringArray _replacements2;
+	StringArray _replacements3;
+	StringArray _phrases;
+	NumberArray _numbers;
+private:
+	/**
+	 * Loads the various replacement string data arrays
+	 */
+	void loadArrays();
+
 	/**
 	 * Normalizes a passed input, taking care of things like removing extra
 	 * spaces and lowercasing everything
@@ -74,9 +99,9 @@ private:
 	 * a plain decimal representation.
 	 * @param line			Line to check
 	 * @param startIndex	Starting index in the start to check
-	 * @returns				True if end of line hasn't been reached yet
+	 * @returns				Pointer to matching number entry, if match occurred
 	 */
-	static bool replaceNumbers(TTstring &line, int *startIndex);
+	const NumberEntry *replaceNumbers(TTstring &line, int *startIndex);
 public:
 	CScriptHandler *_owner;
 	int _field4;
@@ -86,8 +111,7 @@ public:
 	int _field14;
 	int _field18;
 public:
-	TTparser(CScriptHandler *owner) : _owner(owner), _field4(0),
-		_input(nullptr), _fieldC(0), _field10(0), _field14(0), _field18(0) {}
+	TTparser(CScriptHandler *owner);
 
 	/**
 	 * Gets passed a newly created input wrapper during conversation text processing


Commit: 361ac2cfe4c6e778ad5eeafac94bbc6927aeaf1b
    https://github.com/scummvm/scummvm/commit/361ac2cfe4c6e778ad5eeafac94bbc6927aeaf1b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:12:39-04:00

Commit Message:
TITANIC: Implemented secondary replaceNumbers method

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 24361f9..9787d1c 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -360,7 +360,57 @@ int TTparser::searchAndReplace(TTstring &line, int startIndex, const StringArray
 	return startIndex;
 }
 
-const NumberEntry *TTparser::replaceNumbers(TTstring &line, int *startIndex) {
+int TTparser::replaceNumbers(TTstring &line, int startIndex) {
+	int index = startIndex;
+	const NumberEntry *numEntry = replaceNumbers2(line, &index);
+	if (!numEntry || !(numEntry->_flags & NF_2))
+		return index;
+
+	bool flag1 = false, flag2 = false, flag3 = false;
+	int total = 0, factor = 0;
+
+	do {
+		if (numEntry->_flags & NF_1) {
+			flag2 = true;
+			if (numEntry->_flags & NF_8)
+				flag1 = true;
+
+			if (numEntry->_flags & NF_4) {
+				flag3 = true;
+				factor *= numEntry->_value;
+			}
+
+			if (numEntry->_flags & NF_2) {
+				if (flag3) {
+					total += factor;
+					factor = 0;
+				}
+
+				factor += numEntry->_value;
+			}
+		}
+	} while (replaceNumbers2(line, &index));
+
+	if (!flag2)
+		return index;
+
+	if (index >= 0) {
+		if (line[index - 1] != ' ')
+			return index;
+	}
+
+	total += factor;
+	CTrueTalkManager::_v1 = total;
+	if (flag1)
+		total = -total;
+
+	CString numStr = CString::format("%d", total);
+	line = CString(line.c_str(), line.c_str() + startIndex) + numStr +
+		CString(line.c_str() + index);
+	return index;
+}
+
+const NumberEntry *TTparser::replaceNumbers2(TTstring &line, int *startIndex) {
 	int lineSize = line.size();
 	int index = *startIndex;
 	if (index < 0 || index >= lineSize) {
@@ -373,7 +423,7 @@ const NumberEntry *TTparser::replaceNumbers(TTstring &line, int *startIndex) {
 	for (uint idx = 0; idx < _numbers.size(); ++idx) {
 		NumberEntry &ne = _numbers[idx];
 		if (!strncmp(line.c_str() + index, ne._text.c_str(), ne._text.size())) {
-			if ((ne._flags & NF_10) || (index + ne._text.size()) >= lineSize ||
+			if ((ne._flags & NF_10) || (index + (int)ne._text.size()) >= lineSize ||
 					line[index + ne._text.size()] == ' ') {
 				*startIndex += ne._text.size();
 				numEntry = ≠
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 7e4e97f..171c91d 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -28,7 +28,7 @@
 
 namespace Titanic {
 
-enum NumberFlag { NF_2 = 2, NF_8 = 8, NF_10 = 0x10 };
+enum NumberFlag { NF_1 = 1, NF_2 = 2, NF_4 = 4, NF_8 = 8, NF_10 = 0x10 };
 
 class CScriptHandler;
 
@@ -94,6 +94,16 @@ private:
 	static int searchAndReplace(TTstring &line, int startIndex, const StringArray &strings);
 
 	/**
+	* Checks the string starting at a given index for a number representation
+	* such as roman numericals, spelled out numbers, etc. and replaces it with
+	* a plain decimal representation.
+	* @param line		Line to check
+	* @param startIndex	Starting index in the start to check
+	* @returns			Index of the start of the following word, or -1 if at end of line
+	*/
+	int replaceNumbers(TTstring &line, int startIndex);
+
+	/**
 	 * Checks the string starting at a given index for a number representation
 	 * such as roman numericals, spelled out numbers, etc. and replaces it with
 	 * a plain decimal representation.
@@ -101,7 +111,7 @@ private:
 	 * @param startIndex	Starting index in the start to check
 	 * @returns				Pointer to matching number entry, if match occurred
 	 */
-	const NumberEntry *replaceNumbers(TTstring &line, int *startIndex);
+	const NumberEntry *replaceNumbers2(TTstring &line, int *startIndex);
 public:
 	CScriptHandler *_owner;
 	int _field4;


Commit: a7c1b2fc6bb7d158f8a48664dd07b4d03f4dc1d5
    https://github.com/scummvm/scummvm/commit/a7c1b2fc6bb7d158f8a48664dd07b4d03f4dc1d5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:12:42-04:00

Commit Message:
TITANIC: Finished TTparser processInput

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 9787d1c..46eb50d 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -84,7 +84,24 @@ int TTparser::processInput(TTinput *input) {
 	// Do a further search and replace of roman numerals to decimal
 	searchAndReplace(input->_normalizedLine, _replacements3);
 
-	warning("TODO: TTparser::processInput");
+	// Replace any roman numerals, spelled out words, etc. with decimal numbers
+	CTrueTalkManager::_v1 = -1000;
+	int idx = 0;
+	do {
+		idx = replaceNumbers(input->_normalizedLine, idx);
+	} while (idx >= 0);
+
+	if (CTrueTalkManager::_v1 == -1000 && !input->_normalizedLine.empty()) {
+		// Scan the text for any numeric digits
+		for (const char *strP = input->_normalizedLine.c_str(); *strP; ++strP) {
+			if (Common::isDigit(*strP)) {
+				// Found digit, so convert it and any following ones
+				CTrueTalkManager::_v1 = atoi(strP);
+				break;
+			}
+		}
+	}
+
 	return 0;
 }
 


Commit: 39b85d845b008613c0c5ce5eb614159362ab1797
    https://github.com/scummvm/scummvm/commit/39b85d845b008613c0c5ce5eb614159362ab1797
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:12:44-04:00

Commit Message:
TITANIC: Changed parser & script processInput methods to preprocess

Changed paths:
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_script_base.cpp
    engines/titanic/true_talk/tt_script_base.h



diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 2e2a148..0b600f9 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -64,9 +64,9 @@ int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScrip
 		return SS_5;
 	
 	TTinput *input = new TTinput(_inputCtr++, line, this, roomScript, npcScript);
-	_parser.processInput(input);
-	roomScript->processInput(input);
-	npcScript->processInput(input);
+	_parser.preprocess(input);
+	roomScript->preprocess(input);
+	npcScript->preprocess(input);
 
 	warning("TODO: CScriptHandler::processInput");
 
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 46eb50d..66cb57b 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -66,7 +66,7 @@ void TTparser::loadArrays() {
 
 }
 
-int TTparser::processInput(TTinput *input) {
+int TTparser::preprocess(TTinput *input) {
 	_input = input;
 	if (normalize(input))
 		return 0;
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 171c91d..4dbc4d4 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -124,9 +124,10 @@ public:
 	TTparser(CScriptHandler *owner);
 
 	/**
-	 * Gets passed a newly created input wrapper during conversation text processing
+	 * Preprocesses the passed input text, to handle things like lowercasing
+	 * all the words, and replcaing common slang with their full equivalents
 	 */
-	int processInput(TTinput *input);
+	int preprocess(TTinput *input);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index 88f06a4..0a14107 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -73,8 +73,8 @@ void TTscriptBase::reset() {
 	_field48 = 0;
 }
 
-int TTscriptBase::processInput(TTinput *input) {
-	warning("TODO: TTscriptBase::processInput");
+int TTscriptBase::preprocess(TTinput *input) {
+	warning("TODO: TTscriptBase::preprocess");
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index 12abb5c..820d269 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -64,7 +64,7 @@ public:
 	/**
 	 * Gets passed a newly created input wrapper during conversation text processing
 	 */
-	int processInput(TTinput *input);
+	int preprocess(TTinput *input);
 
 	virtual void proc2(int v);
 


Commit: aead3a0083edd7ac5e1f748f422ee25695676a4a
    https://github.com/scummvm/scummvm/commit/aead3a0083edd7ac5e1f748f422ee25695676a4a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:12:46-04:00

Commit Message:
TITANIC: Beginnings of TThist class

Changed paths:
  A engines/titanic/true_talk/tt_hist.cpp
  A engines/titanic/true_talk/tt_hist.h
    engines/titanic/module.mk
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_script_base.cpp
    engines/titanic/true_talk/tt_script_base.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index f8fe8f5..7972fa1 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -462,6 +462,7 @@ MODULE_OBJS := \
 	true_talk/true_talk_manager.o \
 	true_talk/tt_action.o \
 	true_talk/tt_adj.o \
+	true_talk/tt_hist.o \
 	true_talk/tt_input.o \
 	true_talk/tt_major_word.o \
 	true_talk/tt_npc_script.o \
diff --git a/engines/titanic/true_talk/tt_hist.cpp b/engines/titanic/true_talk/tt_hist.cpp
new file mode 100644
index 0000000..8c9aeb3
--- /dev/null
+++ b/engines/titanic/true_talk/tt_hist.cpp
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_hist.h"
+#include "titanic/true_talk/tt_input.h"
+
+namespace Titanic {
+
+TThist::TThist(TTinput *input) {
+	// TODO
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_hist.h b/engines/titanic/true_talk/tt_hist.h
new file mode 100644
index 0000000..f910e6e
--- /dev/null
+++ b/engines/titanic/true_talk/tt_hist.h
@@ -0,0 +1,45 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_HIST_H
+#define TITANIC_TT_HIST_H
+
+namespace Titanic {
+
+class TTinput;
+
+class TThist {
+protected:
+	int _field0;
+	TTinput *_input;
+public:
+	TThist(TTinput *input);
+};
+
+class TTscriptHist : public TThist {
+public:
+	TTscriptHist(TTinput *input) : TThist(input) {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_HIST_H */
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 58c1d34..29ab08f 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -28,7 +28,6 @@
 
 namespace Titanic {
 
-
 class TTnpcScriptBase : public TTscriptBase {
 protected:
 	int _field54;
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index 0a14107..092e5bb 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 TTscriptBase::TTscriptBase(int v1, const char *charClass, int v2,
 		const char *charName, int v3, int v4, int v5, int v6, int v7) :
 		_charName(charName), _charClass(charClass), 
-		_field4(0), _field8(0), _fieldC(0),
+		_field4(0), _field8(0), _hist(nullptr),
 		_field20(0), _field24(0), _field28(0), _field2C(0),
 		_field30(0), _field34(0), _field38(0), _field3C(0),
 		_field40(0), _field44(0), _field48(0), _status(0) {
@@ -59,7 +59,7 @@ bool TTscriptBase::areNamesValid() {
 void TTscriptBase::reset() {
 	_field4 = 0;
 	_field8 = 4;
-	_fieldC = 0;
+	_hist = nullptr;
 	_field20 = 0;
 	_field24 = -1;
 	_field28 = -1;
@@ -74,8 +74,10 @@ void TTscriptBase::reset() {
 }
 
 int TTscriptBase::preprocess(TTinput *input) {
-	warning("TODO: TTscriptBase::preprocess");
-	return 0;
+	delete _hist;
+	_hist = new TTscriptHist(input);
+
+	return _hist ? SS_VALID : SS_7;
 }
 
 void TTscriptBase::proc2(int v) {
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index 820d269..f55d06c 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -24,6 +24,7 @@
 #define TITANIC_TT_SCRIPT_BASE_H
 
 #include "titanic/true_talk/tt_string.h"
+#include "titanic/true_talk/tt_hist.h"
 
 namespace Titanic {
 
@@ -39,7 +40,7 @@ private:
 protected:
 	int _field4;
 	int _field8;
-	int _fieldC;
+	TThist *_hist;
 	TTstring _charName, _charClass;
 	int _field20;
 	int _field24;


Commit: 5da19b674d3b9d24517a266e369728f3b5c2957a
    https://github.com/scummvm/scummvm/commit/5da19b674d3b9d24517a266e369728f3b5c2957a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:12:48-04:00

Commit Message:
TITANIC: Changed TTinput to TTsentence to match original

Changed paths:
  A engines/titanic/true_talk/tt_sentence.cpp
  A engines/titanic/true_talk/tt_sentence.h
  R engines/titanic/true_talk/tt_input.cpp
  R engines/titanic/true_talk/tt_input.h
    engines/titanic/module.mk
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/tt_hist.cpp
    engines/titanic/true_talk/tt_hist.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_script_base.cpp
    engines/titanic/true_talk/tt_script_base.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 7972fa1..9e10577 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -463,7 +463,6 @@ MODULE_OBJS := \
 	true_talk/tt_action.o \
 	true_talk/tt_adj.o \
 	true_talk/tt_hist.o \
-	true_talk/tt_input.o \
 	true_talk/tt_major_word.o \
 	true_talk/tt_npc_script.o \
 	true_talk/tt_parser.o \
@@ -472,6 +471,7 @@ MODULE_OBJS := \
 	true_talk/tt_room_script.o \
 	true_talk/tt_script_base.o \
 	true_talk/tt_scripts.o \
+	true_talk/tt_sentence.o \
 	true_talk/tt_string.o \
 	true_talk/tt_string_node.o \
 	true_talk/tt_synonym.o \
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 0b600f9..ab5b971 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -21,7 +21,7 @@
  */
 
 #include "titanic/true_talk/script_handler.h"
-#include "titanic/true_talk/tt_input.h"
+#include "titanic/true_talk/tt_sentence.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
@@ -63,15 +63,15 @@ int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScrip
 	if (!roomScript || !line.isValid())
 		return SS_5;
 	
-	TTinput *input = new TTinput(_inputCtr++, line, this, roomScript, npcScript);
-	_parser.preprocess(input);
-	roomScript->preprocess(input);
-	npcScript->preprocess(input);
+	TTsentence *sentence = new TTsentence(_inputCtr++, line, this, roomScript, npcScript);
+	_parser.preprocess(sentence);
+	roomScript->preprocess(sentence);
+	npcScript->preprocess(sentence);
 
 	warning("TODO: CScriptHandler::processInput");
 
 	// TODO
-	delete input;
+	delete sentence;
 	return SS_VALID;
 }
 
diff --git a/engines/titanic/true_talk/tt_hist.cpp b/engines/titanic/true_talk/tt_hist.cpp
index 8c9aeb3..e0f6cb8 100644
--- a/engines/titanic/true_talk/tt_hist.cpp
+++ b/engines/titanic/true_talk/tt_hist.cpp
@@ -21,11 +21,11 @@
  */
 
 #include "titanic/true_talk/tt_hist.h"
-#include "titanic/true_talk/tt_input.h"
+#include "titanic/true_talk/tt_sentence.h"
 
 namespace Titanic {
 
-TThist::TThist(TTinput *input) {
+TThist::TThist(TTsentence *sentence) {
 	// TODO
 }
 
diff --git a/engines/titanic/true_talk/tt_hist.h b/engines/titanic/true_talk/tt_hist.h
index f910e6e..7ba0032 100644
--- a/engines/titanic/true_talk/tt_hist.h
+++ b/engines/titanic/true_talk/tt_hist.h
@@ -25,19 +25,19 @@
 
 namespace Titanic {
 
-class TTinput;
+class TTsentence;
 
 class TThist {
 protected:
 	int _field0;
-	TTinput *_input;
+	TTsentence *_input;
 public:
-	TThist(TTinput *input);
+	TThist(TTsentence *sentence);
 };
 
 class TTscriptHist : public TThist {
 public:
-	TTscriptHist(TTinput *input) : TThist(input) {}
+	TTscriptHist(TTsentence *sentence) : TThist(sentence) {}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_input.cpp b/engines/titanic/true_talk/tt_input.cpp
deleted file mode 100644
index 102f86f..0000000
--- a/engines/titanic/true_talk/tt_input.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/true_talk/tt_input.h"
-#include "titanic/true_talk/script_handler.h"
-
-namespace Titanic {
-
-TTinputSubBase::TTinputSubBase() : _field0(0), _field4(0), _field8(0),
-	_fieldC(0), _field10(0), _field14(0), _field18(0), _field1C(0),
-	_field20(0), _field24(0) {
-}
-
-/*------------------------------------------------------------------------*/
-
-TTinput::TTinput(int inputCtr, const TTstring &line, CScriptHandler *owner,
-		TTroomScript *roomScript, TTnpcScript *npcScript) :
-		_owner(owner), _field2C(1), _inputCtr(inputCtr), _field34(0),
-		_field38(0), _initialLine(line), _field4C(0), _roomScript(roomScript),
-		_npcScript(npcScript), _field58(0), _field5C(0) {
-	_status = _initialLine.isValid() && _normalizedLine.isValid() ? SS_11: SS_VALID;
-}
-
-void TTinput::set38(int val) {
-	_field38 = val;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_input.h b/engines/titanic/true_talk/tt_input.h
deleted file mode 100644
index e378e9b..0000000
--- a/engines/titanic/true_talk/tt_input.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_TT_INPUT_H
-#define TITANIC_TT_INPUT_H
-
-#include "titanic/true_talk/tt_npc_script.h"
-#include "titanic/true_talk/tt_room_script.h"
-#include "titanic/true_talk/tt_string.h"
-
-namespace Titanic {
-
-class CScriptHandler;
-
-class TTinputSubBase {
-public:
-	int _field0;
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
-	int _field14;
-	int _field18;
-	int _field1C;
-	int _field20;
-	int _field24;
-public:
-	TTinputSubBase();
-};
-
-class TTinputSub : public TTinputSubBase {
-public:
-};
-
-class TTinput {
-private:
-	CScriptHandler *_owner;
-	TTinputSub _sub;
-	int _field2C;
-	int _inputCtr;
-	int _field34;
-	int _field38;
-	int _field4C;
-	TTroomScript *_roomScript;
-	TTnpcScript *_npcScript;
-	int _field58;
-	int _field5C;
-	int _status;
-public:
-	TTstring _initialLine;
-	TTstring _normalizedLine;
-public:
-	TTinput(int inputCtr, const TTstring &line, CScriptHandler *owner,
-		TTroomScript *roomScript, TTnpcScript *npcScript);
-
-	void set38(int v);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_TT_INPUT_H */
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 66cb57b..a965c70 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -22,13 +22,13 @@
 
 #include "titanic/true_talk/tt_parser.h"
 #include "titanic/true_talk/script_handler.h"
-#include "titanic/true_talk/tt_input.h"
+#include "titanic/true_talk/tt_sentence.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
 
 TTparser::TTparser(CScriptHandler *owner) : _owner(owner), _field4(0),
-		_input(nullptr), _fieldC(0), _field10(0), _field14(0), _field18(0) {
+		_sentence(nullptr), _fieldC(0), _field10(0), _field14(0), _field18(0) {
 	loadArrays();
 }
 
@@ -66,34 +66,34 @@ void TTparser::loadArrays() {
 
 }
 
-int TTparser::preprocess(TTinput *input) {
-	_input = input;
-	if (normalize(input))
+int TTparser::preprocess(TTsentence *sentence) {
+	_sentence = sentence;
+	if (normalize(sentence))
 		return 0;
 
 	// Scan for and replace common slang and contractions with verbose versions
-	searchAndReplace(input->_normalizedLine, _replacements1);
-	searchAndReplace(input->_normalizedLine, _replacements2);
+	searchAndReplace(sentence->_normalizedLine, _replacements1);
+	searchAndReplace(sentence->_normalizedLine, _replacements2);
 
 	// Check entire normalized line against common phrases to replace
 	for (uint idx = 0; idx < _phrases.size(); idx += 2) {
-		if (!_phrases[idx].compareTo(input->_normalizedLine))
-			input->_normalizedLine = _phrases[idx + 1];
+		if (!_phrases[idx].compareTo(sentence->_normalizedLine))
+			sentence->_normalizedLine = _phrases[idx + 1];
 	}
 
 	// Do a further search and replace of roman numerals to decimal
-	searchAndReplace(input->_normalizedLine, _replacements3);
+	searchAndReplace(sentence->_normalizedLine, _replacements3);
 
 	// Replace any roman numerals, spelled out words, etc. with decimal numbers
 	CTrueTalkManager::_v1 = -1000;
 	int idx = 0;
 	do {
-		idx = replaceNumbers(input->_normalizedLine, idx);
+		idx = replaceNumbers(sentence->_normalizedLine, idx);
 	} while (idx >= 0);
 
-	if (CTrueTalkManager::_v1 == -1000 && !input->_normalizedLine.empty()) {
+	if (CTrueTalkManager::_v1 == -1000 && !sentence->_normalizedLine.empty()) {
 		// Scan the text for any numeric digits
-		for (const char *strP = input->_normalizedLine.c_str(); *strP; ++strP) {
+		for (const char *strP = sentence->_normalizedLine.c_str(); *strP; ++strP) {
 			if (Common::isDigit(*strP)) {
 				// Found digit, so convert it and any following ones
 				CTrueTalkManager::_v1 = atoi(strP);
@@ -105,9 +105,9 @@ int TTparser::preprocess(TTinput *input) {
 	return 0;
 }
 
-int TTparser::normalize(TTinput *input) {
+int TTparser::normalize(TTsentence *sentence) {
 	TTstring *destLine = new TTstring();
-	const TTstring &srcLine = input->_initialLine;
+	const TTstring &srcLine = sentence->_initialLine;
 	int srcSize = srcLine.size();
 	int savedIndex = 0;
 	int counter1 = 0;
@@ -124,7 +124,7 @@ int TTparser::normalize(TTinput *input) {
 			(*destLine) += toupper(c);
 		} else if (Common::isDigit(c)) {
 			if (c == '0' && isEmoticon(srcLine, index)) {
-				input->set38(10);
+				sentence->set38(10);
 			} else {
 				// Iterate through all the digits of the number
 				(*destLine) += c;
@@ -135,7 +135,7 @@ int TTparser::normalize(TTinput *input) {
 			bool flag = false;
 			switch (c) {
 			case '!':
-				input->set38(3);
+				sentence->set38(3);
 				break;
 			
 			case '\'':
@@ -144,13 +144,13 @@ int TTparser::normalize(TTinput *input) {
 				break;
 			
 			case '.':
-				input->set38(1);
+				sentence->set38(1);
 				break;
 			
 			case ':':
 				commandVal = isEmoticon(srcLine, index);
 				if (commandVal) {
-					input->set38(commandVal);
+					sentence->set38(commandVal);
 					index += 2;
 				} else {
 					flag = true;
@@ -160,10 +160,10 @@ int TTparser::normalize(TTinput *input) {
 			case ';':
 				commandVal = isEmoticon(srcLine, index);
 				if (commandVal == 6) {
-					input->set38(7);
+					sentence->set38(7);
 					index += 2;
 				} else if (commandVal != 0) {
-					input->set38(commandVal);
+					sentence->set38(commandVal);
 					index += 2;
 				}
 				break;
@@ -172,7 +172,7 @@ int TTparser::normalize(TTinput *input) {
 				++index;
 				commandVal = isEmoticon(srcLine, index);
 				if (commandVal == 6) {
-					input->set38(12);
+					sentence->set38(12);
 				} else {
 					--index;
 					flag = true;
@@ -183,7 +183,7 @@ int TTparser::normalize(TTinput *input) {
 				++index;
 				commandVal = isEmoticon(srcLine, index);
 				if (commandVal == 6 || commandVal == 9) {
-					input->set38(11);
+					sentence->set38(11);
 				} else {
 					--index;
 					flag = true;
@@ -191,7 +191,7 @@ int TTparser::normalize(TTinput *input) {
 				break;
 
 			case '?':
-				input->set38(2);
+				sentence->set38(2);
 				break;
 
 			default:
@@ -207,14 +207,14 @@ int TTparser::normalize(TTinput *input) {
 	}
 
 	if (counter1 >= 4)
-		input->set38(4);
+		sentence->set38(4);
 
 	// Remove any trailing spaces
 	while (destLine->hasSuffix(" "))
 		destLine->deleteLastChar();
 
 	// Copy out the normalized line
-	input->_normalizedLine = *destLine;
+	sentence->_normalizedLine = *destLine;
 	delete destLine;
 
 	return 0;
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 4dbc4d4..da63336 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_TT_PARSER_H
 #define TITANIC_TT_PARSER_H
 
-#include "titanic/true_talk/tt_input.h"
+#include "titanic/true_talk/tt_sentence.h"
 #include "titanic/true_talk/tt_string.h"
 
 namespace Titanic {
@@ -60,7 +60,7 @@ private:
 	 * Normalizes a passed input, taking care of things like removing extra
 	 * spaces and lowercasing everything
 	 */
-	int normalize(TTinput *input);
+	int normalize(TTsentence *sentence);
 	
 	/**
 	 * Submethod called by normalize to handle expanding contacted word pairs
@@ -115,7 +115,7 @@ private:
 public:
 	CScriptHandler *_owner;
 	int _field4;
-	TTinput *_input;
+	TTsentence *_sentence;
 	int _fieldC;
 	int _field10;
 	int _field14;
@@ -127,7 +127,7 @@ public:
 	 * Preprocesses the passed input text, to handle things like lowercasing
 	 * all the words, and replcaing common slang with their full equivalents
 	 */
-	int preprocess(TTinput *input);
+	int preprocess(TTsentence *sentence);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index 092e5bb..16783de 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -73,9 +73,9 @@ void TTscriptBase::reset() {
 	_field48 = 0;
 }
 
-int TTscriptBase::preprocess(TTinput *input) {
+int TTscriptBase::preprocess(TTsentence *sentence) {
 	delete _hist;
-	_hist = new TTscriptHist(input);
+	_hist = new TTscriptHist(sentence);
 
 	return _hist ? SS_VALID : SS_7;
 }
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index f55d06c..9bcb334 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -32,7 +32,7 @@ enum ScriptChangedResult {
 	SCR_1 = 1, SCR_2 = 2, SCR_3 = 3, SCR_4 = 4, SCR_5 = 5
 };
 
-class TTinput;
+class TTsentence;
 
 class TTscriptBase {
 private:
@@ -65,7 +65,7 @@ public:
 	/**
 	 * Gets passed a newly created input wrapper during conversation text processing
 	 */
-	int preprocess(TTinput *input);
+	int preprocess(TTsentence *sentence);
 
 	virtual void proc2(int v);
 
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
new file mode 100644
index 0000000..e5968bd
--- /dev/null
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_sentence.h"
+#include "titanic/true_talk/script_handler.h"
+
+namespace Titanic {
+
+TTsentenceSubBase::TTsentenceSubBase() : _field0(0), _field4(0), _field8(0),
+	_fieldC(0), _field10(0), _field14(0), _field18(0), _field1C(0),
+	_field20(0), _field24(0) {
+}
+
+/*------------------------------------------------------------------------*/
+
+TTsentence::TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner,
+		TTroomScript *roomScript, TTnpcScript *npcScript) :
+		_owner(owner), _field2C(1), _inputCtr(inputCtr), _field34(0),
+		_field38(0), _initialLine(line), _field4C(0), _roomScript(roomScript),
+		_npcScript(npcScript), _field58(0), _field5C(0) {
+	_status = _initialLine.isValid() && _normalizedLine.isValid() ? SS_11: SS_VALID;
+}
+
+void TTsentence::set38(int val) {
+	_field38 = val;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
new file mode 100644
index 0000000..94d7bfc
--- /dev/null
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -0,0 +1,80 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_SENTENCE_H
+#define TITANIC_TT_SENTENCE_H
+
+#include "titanic/true_talk/tt_npc_script.h"
+#include "titanic/true_talk/tt_room_script.h"
+#include "titanic/true_talk/tt_string.h"
+
+namespace Titanic {
+
+class CScriptHandler;
+
+class TTsentenceSubBase {
+public:
+	int _field0;
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+	int _field18;
+	int _field1C;
+	int _field20;
+	int _field24;
+public:
+	TTsentenceSubBase();
+};
+
+class TTsentenceSub : public TTsentenceSubBase {
+public:
+};
+
+class TTsentence {
+private:
+	CScriptHandler *_owner;
+	TTsentenceSub _sub;
+	int _field2C;
+	int _inputCtr;
+	int _field34;
+	int _field38;
+	int _field4C;
+	TTroomScript *_roomScript;
+	TTnpcScript *_npcScript;
+	int _field58;
+	int _field5C;
+	int _status;
+public:
+	TTstring _initialLine;
+	TTstring _normalizedLine;
+public:
+	TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner,
+		TTroomScript *roomScript, TTnpcScript *npcScript);
+
+	void set38(int v);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_SENTENCE_H */


Commit: 5b42ae357ebdf5fd2665351a41127fc76167beb5
    https://github.com/scummvm/scummvm/commit/5b42ae357ebdf5fd2665351a41127fc76167beb5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:12:50-04:00

Commit Message:
TITANIC: Refactor TTstringNode to have a base TTnode class

Changed paths:
  A engines/titanic/true_talk/tt_node.cpp
  A engines/titanic/true_talk/tt_node.h
  A engines/titanic/true_talk/tt_sentence_node.cpp
  A engines/titanic/true_talk/tt_sentence_node.h
    engines/titanic/module.mk
    engines/titanic/true_talk/tt_hist.cpp
    engines/titanic/true_talk/tt_hist.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h
    engines/titanic/true_talk/tt_string_node.cpp
    engines/titanic/true_talk/tt_string_node.h
    engines/titanic/true_talk/tt_synonym.cpp
    engines/titanic/true_talk/tt_synonym.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_vocab.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 9e10577..1568eb5 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -464,6 +464,7 @@ MODULE_OBJS := \
 	true_talk/tt_adj.o \
 	true_talk/tt_hist.o \
 	true_talk/tt_major_word.o \
+	true_talk/tt_node.o \
 	true_talk/tt_npc_script.o \
 	true_talk/tt_parser.o \
 	true_talk/tt_picture.o \
@@ -472,6 +473,7 @@ MODULE_OBJS := \
 	true_talk/tt_script_base.o \
 	true_talk/tt_scripts.o \
 	true_talk/tt_sentence.o \
+	true_talk/tt_sentence_node.o \
 	true_talk/tt_string.o \
 	true_talk/tt_string_node.o \
 	true_talk/tt_synonym.o \
diff --git a/engines/titanic/true_talk/tt_hist.cpp b/engines/titanic/true_talk/tt_hist.cpp
index e0f6cb8..fae9ae6 100644
--- a/engines/titanic/true_talk/tt_hist.cpp
+++ b/engines/titanic/true_talk/tt_hist.cpp
@@ -25,8 +25,12 @@
 
 namespace Titanic {
 
-TThist::TThist(TTsentence *sentence) {
-	// TODO
+TThist::TThist(TTsentence *sentence) : _status(0) {
+	_sentence = new TTsentence(sentence);
+}
+
+TThist::~TThist() {
+	delete _sentence;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_hist.h b/engines/titanic/true_talk/tt_hist.h
index 7ba0032..f67a038 100644
--- a/engines/titanic/true_talk/tt_hist.h
+++ b/engines/titanic/true_talk/tt_hist.h
@@ -30,9 +30,11 @@ class TTsentence;
 class TThist {
 protected:
 	int _field0;
-	TTsentence *_input;
+	TTsentence *_sentence;
+	int _status;
 public:
 	TThist(TTsentence *sentence);
+	virtual ~TThist();
 };
 
 class TTscriptHist : public TThist {
diff --git a/engines/titanic/true_talk/tt_node.cpp b/engines/titanic/true_talk/tt_node.cpp
new file mode 100644
index 0000000..8b175a0
--- /dev/null
+++ b/engines/titanic/true_talk/tt_node.cpp
@@ -0,0 +1,60 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/tt_node.h"
+
+namespace Titanic {
+
+TTnode::TTnode() : _priorP(nullptr), _nextP(nullptr) {
+}
+
+TTnode::~TTnode() {
+	detach();
+}
+
+void TTnode::addNode(TTnode *newNode) {
+	TTnode *tail = getTail();
+	tail->_nextP = newNode;
+	newNode->_priorP = this;
+}
+
+void TTnode::detach() {
+	if (_priorP)
+		_priorP->_nextP = _nextP;
+
+	if (_nextP)
+		_nextP->_priorP = _priorP;
+}
+
+TTnode *TTnode::getTail() {
+	if (_nextP == nullptr)
+		return this;
+	
+	TTnode *node = _nextP;
+	while (node->_nextP)
+		node = node->_nextP;
+
+	return node;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_node.h b/engines/titanic/true_talk/tt_node.h
new file mode 100644
index 0000000..668b909
--- /dev/null
+++ b/engines/titanic/true_talk/tt_node.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_NODE_H
+#define TITANIC_TT_NODE_H
+
+namespace Titanic {
+
+class TTnode {
+public:
+	TTnode *_priorP;
+	TTnode *_nextP;
+public:
+	TTnode();
+	virtual ~TTnode();
+
+	/**
+	 * Links the passed node to this node as a linked list
+	 */
+	void addNode(TTnode *newNode);
+
+	/**
+	 * Detaches a node from any predecessor and/or successor
+	 */
+	void detach();
+
+	/**
+	 * Returns the final node at the end of the linked list of nodes
+	 */
+	TTnode *getTail();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_NODE_H */
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index e5968bd..e39a627 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -40,6 +40,15 @@ TTsentence::TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner
 	_status = _initialLine.isValid() && _normalizedLine.isValid() ? SS_11: SS_VALID;
 }
 
+TTsentence::TTsentence(const TTsentence *src) : _initialLine(src->_initialLine),
+		_normalizedLine(src->_normalizedLine) {
+	copyFrom(*src);
+}
+
+void TTsentence::copyFrom(const TTsentence &src) {
+
+}
+
 void TTsentence::set38(int val) {
 	_field38 = val;
 }
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 94d7bfc..784177d 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -65,12 +65,18 @@ private:
 	int _field58;
 	int _field5C;
 	int _status;
+private:
+	/**
+	 * Copy sentence data from a given source
+	 */
+	void copyFrom(const TTsentence &src);
 public:
 	TTstring _initialLine;
 	TTstring _normalizedLine;
 public:
 	TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner,
 		TTroomScript *roomScript, TTnpcScript *npcScript);
+	TTsentence(const TTsentence *src);
 
 	void set38(int v);
 };
diff --git a/engines/titanic/true_talk/tt_sentence_node.cpp b/engines/titanic/true_talk/tt_sentence_node.cpp
new file mode 100644
index 0000000..46a1412
--- /dev/null
+++ b/engines/titanic/true_talk/tt_sentence_node.cpp
@@ -0,0 +1,31 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/textconsole.h"
+#include "titanic/true_talk/tt_sentence_node.h"
+
+namespace Titanic {
+
+TTsentenceNode::TTsentenceNode() : TTnode() {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence_node.h b/engines/titanic/true_talk/tt_sentence_node.h
new file mode 100644
index 0000000..5d22454
--- /dev/null
+++ b/engines/titanic/true_talk/tt_sentence_node.h
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_SENTENCE_NODE_H
+#define TITANIC_TT_SENTENCE_NODE_H
+
+#include "titanic/true_talk/tt_node.h"
+
+namespace Titanic {
+
+class TTsentenceNode : public TTnode {
+public:
+	TTsentenceNode();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_SENTENCE_NODE_H */
diff --git a/engines/titanic/true_talk/tt_string_node.cpp b/engines/titanic/true_talk/tt_string_node.cpp
index d125d32..1c0b5b9 100644
--- a/engines/titanic/true_talk/tt_string_node.cpp
+++ b/engines/titanic/true_talk/tt_string_node.cpp
@@ -25,12 +25,7 @@
 
 namespace Titanic {
 
-TTstringNode::TTstringNode() : _pPrior(nullptr), _pNext(nullptr),
-		_file(HANDLE_STDIN), _mode(0), _field1C(0) {
-}
-
-TTstringNode::~TTstringNode() {
-	detach();
+TTstringNode::TTstringNode() : TTnode() {
 }
 
 void TTstringNode::initialize(int mode) {
@@ -59,29 +54,4 @@ void TTstringNode::initialize(TTstringNode *oldNode) {
 	delete oldNode;
 }
 
-void TTstringNode::addNode(TTstringNode *newNode) {
-	TTstringNode *tail = getTail();
-	tail->_pNext = newNode;
-	newNode->_pPrior = this;
-}
-
-void TTstringNode::detach() {
-	if (_pPrior)
-		_pPrior->_pNext = _pNext;
-
-	if (_pNext)
-		_pNext->_pPrior = _pPrior;
-}
-
-TTstringNode *TTstringNode::getTail() {
-	if (_pNext == nullptr)
-		return this;
-	
-	TTstringNode *node = _pNext;
-	while (node->_pNext)
-		node = node->_pNext;
-
-	return node;
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string_node.h b/engines/titanic/true_talk/tt_string_node.h
index f9f73ce..31013a9 100644
--- a/engines/titanic/true_talk/tt_string_node.h
+++ b/engines/titanic/true_talk/tt_string_node.h
@@ -23,17 +23,13 @@
 #ifndef TITANIC_TT_STRING_NODE_H
 #define TITANIC_TT_STRING_NODE_H
 
+#include "titanic/true_talk/tt_node.h"
 #include "titanic/true_talk/tt_string.h"
 #include "titanic/support/exe_resources.h"
 
 namespace Titanic {
 
-class TTstringNode {
-private:
-	/**
-	 * Returns the final node at the end of the linked list of nodes
-	 */
-	TTstringNode *getTail();
+class TTstringNode : public TTnode {
 protected:
 	/**
 	 * Initializes state for the node
@@ -45,25 +41,12 @@ protected:
 	 */
 	void initialize(TTstringNode *oldNode);
 public:
-	TTstringNode *_pPrior;
-	TTstringNode *_pNext;
 	TTstring _string;
 	FileHandle _file;
 	int _mode;
 	int _field1C;
 public:
 	TTstringNode();
-	virtual ~TTstringNode();
-
-	/**
-	 * Links the passed node to this node as a linked list
-	 */
-	void addNode(TTstringNode *newNode);
-
-	/**
-	 * Detaches a node from any predecessor and/or successor
-	 */
-	void detach();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_synonym.cpp b/engines/titanic/true_talk/tt_synonym.cpp
index cac9f64..0e5ae39 100644
--- a/engines/titanic/true_talk/tt_synonym.cpp
+++ b/engines/titanic/true_talk/tt_synonym.cpp
@@ -24,24 +24,26 @@
 
 namespace Titanic {
 
-TTsynonym::TTsynonym() : TTstringNode() {
+TTsynonym::TTsynonym() : TTstringNode(), _file(HANDLE_STDIN), 
+		_mode(0), _field1C(0) {
 }
 
-TTsynonym::TTsynonym(const TTsynonym *src) {
+TTsynonym::TTsynonym(const TTsynonym *src) : TTstringNode(),
+		_mode(0), _field1C(0) {
 	_string = src->_string;
 	initialize(src->_mode);
 	_file = src->_file;
 }
 
 TTsynonym::TTsynonym(int mode, const char *str, FileHandle file) :
-		TTstringNode() {
+		TTstringNode(), _mode(0), _field1C(0) {
 	_string = str;
 	initialize(mode);
 	_file = file;
 }
 
 TTsynonym *TTsynonym::findByName(TTsynonym *start, const TTstring &str, int mode) {
-	for (; start; start = static_cast<TTsynonym *>(start->_pNext)) {
+	for (; start; start = static_cast<TTsynonym *>(start->_nextP)) {
 		if (start->_mode == mode || (mode == 3 && start->_mode < 3)) {
 			if (!strcmp(start->_string.c_str(), str.c_str()))
 				start;
@@ -69,7 +71,7 @@ TTsynonym *TTsynonym::copy(TTsynonym *src) {
 }
 
 int TTsynonym::save(SimpleFile *file) {
-	for (TTstringNode *synP = this; synP; synP = synP->_pNext) {
+	for (TTstringNode *synP = this; synP; synP = static_cast<TTstringNode *>(synP->_nextP)) {
 		file->writeFormat("%s", " 0 ");
 		synP->_string.save(file);
 		file->writeFormat("%c", ' ');
diff --git a/engines/titanic/true_talk/tt_synonym.h b/engines/titanic/true_talk/tt_synonym.h
index 40f7ad3..288e980 100644
--- a/engines/titanic/true_talk/tt_synonym.h
+++ b/engines/titanic/true_talk/tt_synonym.h
@@ -30,6 +30,11 @@ namespace Titanic {
 
 class TTsynonym : public TTstringNode {
 public:
+	TTstring _string;
+	FileHandle _file;
+	int _mode;
+	int _field1C;
+public:
 	TTsynonym();
 	TTsynonym(const TTsynonym *src);
 	TTsynonym(int mode, const char *str, FileHandle file);
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 3d2a9d9..707cbaf 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -32,16 +32,16 @@
 
 namespace Titanic {
 
-TTvocab::TTvocab(int val): _pHead(nullptr), _pTail(nullptr), _word(nullptr),
+TTvocab::TTvocab(int val): _headP(nullptr), _tailP(nullptr), _word(nullptr),
 		_fieldC(0), _field10(0), _field18(val) {
 	_field14 = load("STVOCAB.TXT");
 }
 
 TTvocab::~TTvocab() {
-	if (_pHead) {
-		_pHead->deleteSiblings();
-		delete _pHead;
-		_pHead = _pTail = nullptr;
+	if (_headP) {
+		_headP->deleteSiblings();
+		delete _headP;
+		_headP = _tailP = nullptr;
 	}
 }
 
@@ -143,28 +143,28 @@ void TTvocab::addWord(TTword *word) {
 		_word = nullptr;
 		if (word)
 			delete word;
-	} else if (_pTail) {
-		_pTail->_pNext = word;
-		_pTail = word;
+	} else if (_tailP) {
+		_tailP->_nextP = word;
+		_tailP = word;
 	} else {
-		if (!_pHead)
-			_pHead = word;
+		if (!_headP)
+			_headP = word;
 
-		_pTail = word;
+		_tailP = word;
 	}
 }
 
 TTword *TTvocab::findWord(const TTstring &str) {
 	TTsynonym *tempNode = new TTsynonym();
 	bool flag = false;
-	TTword *word = _pHead;
+	TTword *word = _headP;
 
 	while (word && !flag) {
 		if (_field18 != 3 || strcmp(word->c_str(), str)) {
 			if (word->scanCopy(str, tempNode, _field18))
 				flag = true;
 			else
-				word = word->_pNext;
+				word = word->_nextP;
 		} else {
 			flag = true;
 		}
@@ -177,7 +177,7 @@ TTword *TTvocab::findWord(const TTstring &str) {
 TTword *TTvocab::getPrimeWord(TTstring &str, TTword **words) {
 	TTsynonym *synonym = new TTsynonym();
 	char c = str.charAt(0);
-	TTword *vocabList = _pHead;
+	TTword *vocabList = _headP;
 	TTword *returnWord = nullptr;
 
 	if (!Common::isDigit(c)) {
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
index 804d8cb..40e9458 100644
--- a/engines/titanic/true_talk/tt_vocab.h
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -31,8 +31,8 @@ namespace Titanic {
 
 class TTvocab {
 private:
-	TTword *_pHead;
-	TTword *_pTail;
+	TTword *_headP;
+	TTword *_tailP;
 	TTword *_word;
 	int _fieldC;
 	int _field10;
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index aa602d8..90c7cf1 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -27,8 +27,8 @@
 namespace Titanic {
 
 TTword::TTword(TTstring &str, int mode, int val2) : _string(str),
-		_wordMode(mode), _field1C(val2), _pNext(nullptr), _synP(nullptr),
-		_field20(0), _field24(0), _field28(0) {
+		_wordMode(mode), _field1C(val2), _field20(0), _field24(0),
+		_field28(0), _synP(nullptr), _nextP(nullptr) {
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
 }
 
@@ -50,11 +50,11 @@ TTword::TTword(TTword *src) {
 		if (!newSyn) {
 			_status = SS_7;
 		} else {
-			newSyn->_pPrior = priorSyn;
-			newSyn->_pNext = nullptr;
+			newSyn->_priorP = priorSyn;
+			newSyn->_nextP = nullptr;
 
 			if (priorSyn) {
-				priorSyn->_pNext = newSyn;
+				priorSyn->_nextP = newSyn;
 			} else {
 				_synP = newSyn;
 			}
@@ -63,15 +63,15 @@ TTword::TTword(TTword *src) {
 		}
 	}
 
-	_pNext = src->_pNext;
+	_nextP = src->_nextP;
 	_field24 = src->_field24;
 	_field28 = src->_field28;
 }
 
 void TTword::deleteSiblings() {
-	while (_pNext) {
-		TTword *next = _pNext;
-		_pNext = next->_pNext;
+	while (_nextP) {
+		TTword *next = _nextP;
+		_nextP = next->_nextP;
 		delete next;
 	}
 }
@@ -148,8 +148,8 @@ TTword *TTword::scanCopy(const TTstring &str, TTsynonym *node, int mode) {
 		TTsynonym *strNode = TTsynonym::findByName(_synP, str, mode);
 		if (strNode) {
 			node->copy(strNode);
-			node->_pPrior = nullptr;
-			node->_pNext = nullptr;
+			node->_priorP = nullptr;
+			node->_nextP = nullptr;
 		}
 	}
 
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index f77f11c..7e692ff 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -46,7 +46,7 @@ protected:
 	bool testFileHandle(SimpleFile *file) const { return true; }
 	bool testFileHandle(FileHandle resHandle) const;
 public:
-	TTword *_pNext;
+	TTword *_nextP;
 	TTsynonym *_synP;
 	TTstring _string;
 public:


Commit: c762308bff46ccb900fa68fc40e72e235c862d89
    https://github.com/scummvm/scummvm/commit/c762308bff46ccb900fa68fc40e72e235c862d89
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:12:53-04:00

Commit Message:
TITANIC: Implement TTsentence copy

Changed paths:
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h
    engines/titanic/true_talk/tt_sentence_node.cpp
    engines/titanic/true_talk/tt_sentence_node.h



diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index e39a627..446d79a 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -35,7 +35,7 @@ TTsentenceSubBase::TTsentenceSubBase() : _field0(0), _field4(0), _field8(0),
 TTsentence::TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner,
 		TTroomScript *roomScript, TTnpcScript *npcScript) :
 		_owner(owner), _field2C(1), _inputCtr(inputCtr), _field34(0),
-		_field38(0), _initialLine(line), _field4C(0), _roomScript(roomScript),
+		_field38(0), _initialLine(line), _nodesP(nullptr), _roomScript(roomScript),
 		_npcScript(npcScript), _field58(0), _field5C(0) {
 	_status = _initialLine.isValid() && _normalizedLine.isValid() ? SS_11: SS_VALID;
 }
@@ -46,7 +46,35 @@ TTsentence::TTsentence(const TTsentence *src) : _initialLine(src->_initialLine),
 }
 
 void TTsentence::copyFrom(const TTsentence &src) {
+	if (!src.getStatus())
+		_status = SS_5;
+	else if (!src._initialLine.isValid() || !src._normalizedLine.isValid())
+		_status = SS_11;
+	else
+		_status = SS_VALID;
 
+	_inputCtr = src._inputCtr;
+	_owner = src._owner;
+	_roomScript = src._roomScript;
+	_npcScript = src._npcScript;
+	_field58 = src._field58;
+	_field5C = src._field5C;
+	_field34 = src._field34;
+	_field38 = src._field38;
+	_field2C = src._field2C;
+	_nodesP = nullptr;
+
+	if (src._nodesP) {
+		// Source has processed nodes, so duplicate them
+		for (TTsentenceNode *node = src._nodesP; node;
+				node = static_cast<TTsentenceNode *>(node->_nextP)) {
+			TTsentenceNode *newNode = new TTsentenceNode(node->_val);
+			if (_nodesP)
+				_nodesP->addNode(newNode);
+			else
+				_nodesP = newNode;
+		}
+	}
 }
 
 void TTsentence::set38(int val) {
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 784177d..4980f24 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -25,6 +25,7 @@
 
 #include "titanic/true_talk/tt_npc_script.h"
 #include "titanic/true_talk/tt_room_script.h"
+#include "titanic/true_talk/tt_sentence_node.h"
 #include "titanic/true_talk/tt_string.h"
 
 namespace Titanic {
@@ -59,7 +60,7 @@ private:
 	int _inputCtr;
 	int _field34;
 	int _field38;
-	int _field4C;
+	TTsentenceNode *_nodesP;
 	TTroomScript *_roomScript;
 	TTnpcScript *_npcScript;
 	int _field58;
@@ -79,6 +80,8 @@ public:
 	TTsentence(const TTsentence *src);
 
 	void set38(int v);
+
+	int getStatus() const { return _status; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence_node.cpp b/engines/titanic/true_talk/tt_sentence_node.cpp
index 46a1412..2bec287 100644
--- a/engines/titanic/true_talk/tt_sentence_node.cpp
+++ b/engines/titanic/true_talk/tt_sentence_node.cpp
@@ -25,7 +25,10 @@
 
 namespace Titanic {
 
-TTsentenceNode::TTsentenceNode() : TTnode() {
+TTsentenceNode::TTsentenceNode() : TTnode(), _val(0) {
+}
+
+TTsentenceNode::TTsentenceNode(int val) : TTnode(), _val(val) {
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence_node.h b/engines/titanic/true_talk/tt_sentence_node.h
index 5d22454..09d106c 100644
--- a/engines/titanic/true_talk/tt_sentence_node.h
+++ b/engines/titanic/true_talk/tt_sentence_node.h
@@ -29,7 +29,10 @@ namespace Titanic {
 
 class TTsentenceNode : public TTnode {
 public:
+	int _val;
+public:
 	TTsentenceNode();
+	TTsentenceNode(int val);
 };
 
 } // End of namespace Titanic


Commit: 89caddc217bc417128fbbdabc48a665acf338e03
    https://github.com/scummvm/scummvm/commit/89caddc217bc417128fbbdabc48a665acf338e03
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:12:55-04:00

Commit Message:
TITANIC: Beginning of TTparser findFrames

Changed paths:
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_room_script.cpp
    engines/titanic/true_talk/tt_room_script.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index ab5b971..0bc50bd5 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -64,10 +64,22 @@ int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScrip
 		return SS_5;
 	
 	TTsentence *sentence = new TTsentence(_inputCtr++, line, this, roomScript, npcScript);
-	_parser.preprocess(sentence);
+	int result = _parser.preprocess(sentence);
 	roomScript->preprocess(sentence);
 	npcScript->preprocess(sentence);
 
+	int canProcess = 0;
+	if (result) {
+		sentence->set34(result);
+		if (roomScript->proc6(npcScript, sentence, result)) {
+			canProcess = npcScript->proc6(roomScript, sentence, result);
+		}
+	}
+
+	if (canProcess == 0 || canProcess == 1) {
+		_parser.findFrames(sentence);
+	}
+
 	warning("TODO: CScriptHandler::processInput");
 
 	// TODO
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 46b350d..0775d09 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -63,10 +63,6 @@ void TTnpcScript::proc4(int v) {
 	warning("TODO");
 }
 
-int TTnpcScript::proc6() const {
-	return 1;
-}
-
 void TTnpcScript::proc7(int v1, int v2) {
 	warning("TODO");
 }
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 29ab08f..2396943 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -28,6 +28,9 @@
 
 namespace Titanic {
 
+class TTroomScript;
+class TTsentence;
+
 class TTnpcScriptBase : public TTscriptBase {
 protected:
 	int _field54;
@@ -39,7 +42,7 @@ public:
 		const char *charName, int v3, int val2, int v4,
 		int v5, int v6, int v7);
 
-	virtual int proc6() const = 0;
+	virtual int proc6(TTroomScript *roomScript, TTsentence *sentence, int val) const = 0;
 	virtual void proc7(int v1, int v2) = 0;
 	virtual int proc8() const = 0;
 	virtual int proc9() const = 0;
@@ -78,7 +81,7 @@ public:
 		int v5, int v6, int v7);
 
 	virtual void proc4(int v);
-	virtual int proc6() const;
+	virtual int proc6(TTroomScript *roomScript, TTsentence *sentence, int val) const { return 1; }
 	virtual void proc7(int v1, int v2);
 	virtual int proc8() const;
 	virtual int proc9() const;
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index a965c70..d2563d4 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -465,4 +465,9 @@ const NumberEntry *TTparser::replaceNumbers2(TTstring &line, int *startIndex) {
 	return numEntry;
 }
 
+int TTparser::findFrames(TTsentence *sentence) {
+	// TODO
+	return 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index da63336..fcf39ea 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -128,6 +128,8 @@ public:
 	 * all the words, and replcaing common slang with their full equivalents
 	 */
 	int preprocess(TTsentence *sentence);
+
+	int findFrames(TTsentence *sentence);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_room_script.cpp b/engines/titanic/true_talk/tt_room_script.cpp
index 62f60f4..885021e 100644
--- a/engines/titanic/true_talk/tt_room_script.cpp
+++ b/engines/titanic/true_talk/tt_room_script.cpp
@@ -37,10 +37,6 @@ TTroomScript::TTroomScript(int scriptId) :
 	TTroomScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) {
 }
 
-void TTroomScript::proc6() {
-	warning("TODO");
-}
-
 void TTroomScript::proc7() {
 	warning("TODO");
 }
diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h
index 7f72573..7fd43f3 100644
--- a/engines/titanic/true_talk/tt_room_script.h
+++ b/engines/titanic/true_talk/tt_room_script.h
@@ -27,6 +27,9 @@
 
 namespace Titanic {
 
+class TTnpcScript;
+class TTsentence;
+
 class TTroomScriptBase : public TTscriptBase {
 public:
 	int _scriptId;
@@ -34,7 +37,7 @@ public:
 	TTroomScriptBase(int scriptId, const char *charClass, const char *charName,
 		int v3, int v4, int v5, int v6, int v2, int v7);
 
-	virtual void proc6() = 0;
+	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, int val) = 0;
 	virtual void proc7() = 0;
 	virtual void proc8() = 0;
 	virtual void proc9() = 0;
@@ -54,7 +57,7 @@ private:
 public:
 	TTroomScript(int scriptId);
 
-	virtual void proc6();
+	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, int val) { return 1; }
 	virtual void proc7();
 	virtual void proc8();
 	virtual void proc9();
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 446d79a..f7779eb 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -77,8 +77,4 @@ void TTsentence::copyFrom(const TTsentence &src) {
 	}
 }
 
-void TTsentence::set38(int val) {
-	_field38 = val;
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 4980f24..450280b 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -79,7 +79,8 @@ public:
 		TTroomScript *roomScript, TTnpcScript *npcScript);
 	TTsentence(const TTsentence *src);
 
-	void set38(int v);
+	void set34(int v) { _field34 = v; }
+	void set38(int v) { _field38 = v; }
 
 	int getStatus() const { return _status; }
 };


Commit: cca38c15e59da0115c06c844d892e9d94c4d53c1
    https://github.com/scummvm/scummvm/commit/cca38c15e59da0115c06c844d892e9d94c4d53c1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:12:57-04:00

Commit Message:
TITANIC: Implemented TTstring tokenize

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_sentence.h
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index d2563d4..9c95529 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -27,7 +27,7 @@
 
 namespace Titanic {
 
-TTparser::TTparser(CScriptHandler *owner) : _owner(owner), _field4(0),
+TTparser::TTparser(CScriptHandler *owner) : _owner(owner), _sentenceSub(nullptr),
 		_sentence(nullptr), _fieldC(0), _field10(0), _field14(0), _field18(0) {
 	loadArrays();
 }
@@ -466,6 +466,10 @@ const NumberEntry *TTparser::replaceNumbers2(TTstring &line, int *startIndex) {
 }
 
 int TTparser::findFrames(TTsentence *sentence) {
+	static bool flag;
+	_sentenceSub = &sentence->_sub;
+	_sentence = sentence;
+
 	// TODO
 	return 0;
 }
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index fcf39ea..9ef84f9 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -114,7 +114,7 @@ private:
 	const NumberEntry *replaceNumbers2(TTstring &line, int *startIndex);
 public:
 	CScriptHandler *_owner;
-	int _field4;
+	TTsentenceSub *_sentenceSub;
 	TTsentence *_sentence;
 	int _fieldC;
 	int _field10;
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 450280b..9f6d18e 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -55,7 +55,6 @@ public:
 class TTsentence {
 private:
 	CScriptHandler *_owner;
-	TTsentenceSub _sub;
 	int _field2C;
 	int _inputCtr;
 	int _field34;
@@ -72,6 +71,7 @@ private:
 	 */
 	void copyFrom(const TTsentence &src);
 public:
+	TTsentenceSub _sub;
 	TTstring _initialLine;
 	TTstring _normalizedLine;
 public:
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index 7a00787..70d6fe3 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -99,4 +99,23 @@ void TTstring::save(SimpleFile *file) const {
 	file->writeFormat("%s", c_str());
 }
 
+TTstring TTstring::tokenize(const char *delim) {
+	const char *strP = _data->_string.c_str();
+	const char *splitP = nullptr, *chP;
+
+	for (const char *d = delim; d; ++d) {
+		chP = strchr(strP, *d);
+		if (chP && (splitP == nullptr || chP < splitP))
+			splitP = chP;
+	}
+
+	if (splitP) {
+		TTstring result(CString(strP, splitP));
+		_data->_string = CString(splitP + 1);
+		return result;
+	} else {
+		return TTstring();
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 1b208cc..cae1a5d 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -134,6 +134,12 @@ public:
 	bool compareAt(int index, const char *str) const {
 		return !strncmp(c_str() + index, str, strlen(str));
 	}
+
+	/**
+	 * Split off everything in the string until the first occurance
+	 * of any specified delimiter character
+	 */
+	TTstring tokenize(const char *delim);
 };
 
 } // End of namespace Titanic


Commit: d4c6538726b4a8425a62391aab5fddc9a2332d46
    https://github.com/scummvm/scummvm/commit/d4c6538726b4a8425a62391aab5fddc9a2332d46
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:00-04:00

Commit Message:
TITANIC: Work on TTparser findFrames

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 9c95529..1658a27 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -470,7 +470,21 @@ int TTparser::findFrames(TTsentence *sentence) {
 	_sentenceSub = &sentence->_sub;
 	_sentence = sentence;
 
+	TTstring *line = sentence->_normalizedLine.copy();
+	TTstring wordString;
+	for (;;) {
+		// Keep stripping words off the start of the passed input
+		TTstring wordString = line->tokenize(" \n");
+		if (wordString.empty())
+			break;
+
+		//TTword *word = nullptr;
+		//_owner->_vocab.fn1(wordString, &word);
+	}
+
+
 	// TODO
+	delete line;
 	return 0;
 }
 


Commit: defd50c9261366be392f91a1807e4b952ad5a28e
    https://github.com/scummvm/scummvm/commit/defd50c9261366be392f91a1807e4b952ad5a28e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:02-04:00

Commit Message:
TITANIC: Added support methods for finding synonyms by name

Changed paths:
    engines/titanic/true_talk/tt_node.cpp
    engines/titanic/true_talk/tt_node.h
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_string_node.cpp
    engines/titanic/true_talk/tt_string_node.h
    engines/titanic/true_talk/tt_synonym.cpp
    engines/titanic/true_talk/tt_synonym.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_vocab.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_node.cpp b/engines/titanic/true_talk/tt_node.cpp
index 8b175a0..22695ad 100644
--- a/engines/titanic/true_talk/tt_node.cpp
+++ b/engines/titanic/true_talk/tt_node.cpp
@@ -46,6 +46,18 @@ void TTnode::detach() {
 		_nextP->_priorP = _priorP;
 }
 
+void TTnode::deleteSiblings() {
+	// Detach current node from prior one, if there is one
+	if (_priorP)
+		_priorP->_nextP = nullptr;
+
+	// Iterate through the linked chain of nodes, deleting each in turn
+	for (TTnode *curP = _nextP, *nextP = nullptr; nextP; curP = nextP) {
+		nextP = curP->_nextP;
+		delete curP;
+	}
+}
+
 TTnode *TTnode::getTail() {
 	if (_nextP == nullptr)
 		return this;
diff --git a/engines/titanic/true_talk/tt_node.h b/engines/titanic/true_talk/tt_node.h
index 668b909..f8d1bc6 100644
--- a/engines/titanic/true_talk/tt_node.h
+++ b/engines/titanic/true_talk/tt_node.h
@@ -44,6 +44,11 @@ public:
 	void detach();
 
 	/**
+	 * Delete any sibling chain attached to this node
+	 */
+	void deleteSiblings();
+
+	/**
 	 * Returns the final node at the end of the linked list of nodes
 	 */
 	TTnode *getTail();
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index 70d6fe3..df93a56 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -95,6 +95,10 @@ TTstring &TTstring::operator+=(char c) {
 	return *this;
 }
 
+bool TTstring::operator==(const TTstring &str) {
+	return _data && str._data && _data->_string == str._data->_string;
+}
+
 void TTstring::save(SimpleFile *file) const {
 	file->writeFormat("%s", c_str());
 }
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index cae1a5d..434c6fe 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -57,6 +57,7 @@ public:
 	TTstring &operator+=(const char *str);
 	TTstring &operator+=(const TTstring &str);
 	TTstring &operator+=(char c);
+	bool operator==(const TTstring &str);
 
 	const char &operator[](int index) {
 		return *(c_str() + index);
diff --git a/engines/titanic/true_talk/tt_string_node.cpp b/engines/titanic/true_talk/tt_string_node.cpp
index 1c0b5b9..2bb0c5a 100644
--- a/engines/titanic/true_talk/tt_string_node.cpp
+++ b/engines/titanic/true_talk/tt_string_node.cpp
@@ -54,4 +54,15 @@ void TTstringNode::initialize(TTstringNode *oldNode) {
 	delete oldNode;
 }
 
+TTstringNode *TTstringNode::findByName(const TTstring &str, int mode) {
+	for (TTstringNode *nodeP = this; nodeP; nodeP = static_cast<TTstringNode *>(nodeP->_nextP)) {
+		if (nodeP->_mode == mode || (mode == 3 && nodeP->_mode < 3)) {
+			if (nodeP->_string == str)
+				return nodeP;
+		}
+	}
+
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string_node.h b/engines/titanic/true_talk/tt_string_node.h
index 31013a9..ced162b 100644
--- a/engines/titanic/true_talk/tt_string_node.h
+++ b/engines/titanic/true_talk/tt_string_node.h
@@ -47,6 +47,11 @@ public:
 	int _field1C;
 public:
 	TTstringNode();
+
+	/**
+	 * Find a string node in the linked chain by name
+	 */
+	TTstringNode *findByName(const TTstring &str, int mode);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_synonym.cpp b/engines/titanic/true_talk/tt_synonym.cpp
index 0e5ae39..636b443 100644
--- a/engines/titanic/true_talk/tt_synonym.cpp
+++ b/engines/titanic/true_talk/tt_synonym.cpp
@@ -42,32 +42,16 @@ TTsynonym::TTsynonym(int mode, const char *str, FileHandle file) :
 	_file = file;
 }
 
-TTsynonym *TTsynonym::findByName(TTsynonym *start, const TTstring &str, int mode) {
-	for (; start; start = static_cast<TTsynonym *>(start->_nextP)) {
-		if (start->_mode == mode || (mode == 3 && start->_mode < 3)) {
-			if (!strcmp(start->_string.c_str(), str.c_str()))
-				start;
-		}
-	}
-
-	return nullptr;
-}
-
-TTsynonym *TTsynonym::copy(TTsynonym *src) {
+TTsynonym *TTsynonym::copyFrom(const TTsynonym *src) {
 	if (src->_field1C) {
 		_field1C = 5;
-		return this;
 	} else {
 		_field1C = 0;
-		if (src == this)
-			return this;
-
-		_string = src->_string;
-		TTsynonym *newNode = new TTsynonym(src);
-		initialize(newNode);
-
-		return this;
+		if (src != this)
+			_string = src->_string;
 	}
+
+	return this;
 }
 
 int TTsynonym::save(SimpleFile *file) {
diff --git a/engines/titanic/true_talk/tt_synonym.h b/engines/titanic/true_talk/tt_synonym.h
index 288e980..e95a6d4 100644
--- a/engines/titanic/true_talk/tt_synonym.h
+++ b/engines/titanic/true_talk/tt_synonym.h
@@ -40,14 +40,9 @@ public:
 	TTsynonym(int mode, const char *str, FileHandle file);
 
 	/**
-	 * Copy the synonym
+	 * Copies data from one synonym to another
 	 */
-	TTsynonym *copy(TTsynonym *src);
-
-	/**
-	 * Scan for a synonym with a given string
-	 */
-	static TTsynonym *findByName(TTsynonym *start, const TTstring &str, int mode);
+	TTsynonym *copyFrom(const TTsynonym *src);
 
 	/**
 	 * Save data for the synonym to file
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 707cbaf..fe8b622 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -33,7 +33,7 @@
 namespace Titanic {
 
 TTvocab::TTvocab(int val): _headP(nullptr), _tailP(nullptr), _word(nullptr),
-		_fieldC(0), _field10(0), _field18(val) {
+		_fieldC(0), _field10(0), _vocabMode(val) {
 	_field14 = load("STVOCAB.TXT");
 }
 
@@ -160,8 +160,8 @@ TTword *TTvocab::findWord(const TTstring &str) {
 	TTword *word = _headP;
 
 	while (word && !flag) {
-		if (_field18 != 3 || strcmp(word->c_str(), str)) {
-			if (word->scanCopy(str, tempNode, _field18))
+		if (_vocabMode != 3 || strcmp(word->c_str(), str)) {
+			if (word->findSynByName(str, tempNode, _vocabMode))
 				flag = true;
 			else
 				word = word->_nextP;
@@ -177,18 +177,20 @@ TTword *TTvocab::findWord(const TTstring &str) {
 TTword *TTvocab::getPrimeWord(TTstring &str, TTword **words) {
 	TTsynonym *synonym = new TTsynonym();
 	char c = str.charAt(0);
-	TTword *vocabList = _headP;
 	TTword *returnWord = nullptr;
 
 	if (!Common::isDigit(c)) {
 		returnWord = new TTword(str, 3, 300);
-	} else if (!vocabList) {
-		// No vocab present. Should never happen
 	} else {
 		TTword *foundWord = nullptr;
-		while (!foundWord && vocabList) {
-			if (_field18 == 3 && !strcmp(str.c_str(), vocabList->c_str())) {
-
+		for (TTword *vocabP = _headP; vocabP && !foundWord; vocabP = vocabP->_nextP) {
+			if (_vocabMode == 3 && !strcmp(str.c_str(), vocabP->c_str())) {
+				foundWord = vocabP->copy();
+				foundWord->_nextP = nullptr;
+				foundWord->setSyn(nullptr);
+			} else {
+				vocabP->findSynByName(str, synonym, _vocabMode);
+				// TODO
 			}
 		}
 
@@ -196,8 +198,8 @@ TTword *TTvocab::getPrimeWord(TTstring &str, TTword **words) {
 
 	}
 
-	if (words)
-		*words = vocabList;
+//	if (words)
+//		*words = vocabList;
 	delete synonym;
 	
 	return returnWord;
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
index 40e9458..c417c7b 100644
--- a/engines/titanic/true_talk/tt_vocab.h
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -37,7 +37,7 @@ private:
 	int _fieldC;
 	int _field10;
 	int _field14;
-	int _field18;
+	int _vocabMode;
 private:
 	/**
 	 * Load the vocab data
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 90c7cf1..a09af4a 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -100,6 +100,15 @@ int TTword::readSyn(SimpleFile *file) {
 	return 0;
 }
 
+void TTword::setSyn(TTsynonym *synP) {
+	if (_synP) {
+		_synP->deleteSiblings();
+		delete _synP;
+	}
+
+	_synP = synP;
+}
+
 void TTword::appendNode(TTsynonym *node) {
 	if (_synP)
 		_synP->addNode(node);
@@ -143,17 +152,20 @@ bool TTword::testFileHandle(FileHandle file) const {
 	return true;
 }
 
-TTword *TTword::scanCopy(const TTstring &str, TTsynonym *node, int mode) {
-	if (_synP) {
-		TTsynonym *strNode = TTsynonym::findByName(_synP, str, mode);
-		if (strNode) {
-			node->copy(strNode);
-			node->_priorP = nullptr;
-			node->_nextP = nullptr;
-		}
-	}
+bool TTword::findSynByName(const TTstring &str, TTsynonym *dest, int mode) const {
+	if (!_synP)
+		return false;
+
+	const TTsynonym *synP = static_cast<const TTsynonym *>(_synP->findByName(str, mode));
+	if (synP) {
+		dest->copyFrom(synP);
+		dest->_priorP = nullptr;
+		dest->_nextP = nullptr;
 
-	return nullptr;
+		return true;
+	} else {
+		return false;
+	}
 }
 
 TTword *TTword::copy() {
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 7e692ff..885409c 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -64,6 +64,11 @@ public:
 	int readSyn(SimpleFile *file);
 
 	/**
+	 * Set a new synonym for the word
+	 */
+	void setSyn(TTsynonym *synP);
+
+	/**
 	 * Either sets the first synonym for a word, or adds it to an existing one
 	 */
 	void appendNode(TTsynonym *node);
@@ -73,7 +78,13 @@ public:
 	 */
 	int load(SimpleFile *file, int mode);
 
-	TTword *scanCopy(const TTstring &str, TTsynonym *node, int mode);
+	/**
+	 * Finds a synonym in the word by name, if one exists
+	 * @param str		Name to search for
+	 * @param dest		Destination synonym instance to copy match into
+	 * @returns			Returns true if a match was found
+	 */
+	bool findSynByName(const TTstring &str, TTsynonym *dest, int mode) const;
 
 	const char *c_str() const { return _string.c_str(); }
 	operator const char *() const { return c_str(); }


Commit: 2b9fcd2cdaa537d79310915a69c48fab0b4ae105
    https://github.com/scummvm/scummvm/commit/2b9fcd2cdaa537d79310915a69c48fab0b4ae105
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:05-04:00

Commit Message:
TITANIC: Finished TTvocab getPrimeWord

Changed paths:
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_vocab.h



diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index fe8b622..102ed2c 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -174,35 +174,38 @@ TTword *TTvocab::findWord(const TTstring &str) {
 	return word;
 }
 
-TTword *TTvocab::getPrimeWord(TTstring &str, TTword **words) {
-	TTsynonym *synonym = new TTsynonym();
+TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const {
+	TTsynonym tempSyn;
 	char c = str.charAt(0);
-	TTword *returnWord = nullptr;
+	TTword *newWord = nullptr;
+	TTword *vocabP;
 
 	if (!Common::isDigit(c)) {
-		returnWord = new TTword(str, 3, 300);
+		vocabP = _headP;
+		newWord = new TTword(str, 3, 300);
 	} else {
-		TTword *foundWord = nullptr;
-		for (TTword *vocabP = _headP; vocabP && !foundWord; vocabP = vocabP->_nextP) {
+		for (vocabP = _headP; vocabP && !newWord; vocabP = vocabP->_nextP) {
 			if (_vocabMode == 3 && !strcmp(str.c_str(), vocabP->c_str())) {
-				foundWord = vocabP->copy();
-				foundWord->_nextP = nullptr;
-				foundWord->setSyn(nullptr);
-			} else {
-				vocabP->findSynByName(str, synonym, _vocabMode);
-				// TODO
+				newWord = vocabP->copy();
+				newWord->_nextP = nullptr;
+				newWord->setSyn(nullptr);
+			} else if (vocabP->findSynByName(str, &tempSyn, _vocabMode)) {
+				// Create a copy of the word and the found synonym
+				TTsynonym *newSyn = new TTsynonym(tempSyn);
+				newSyn->_nextP = newSyn->_priorP = nullptr;
+				newWord = vocabP->copy();
+				newWord->_nextP = nullptr;
+				newWord->setSyn(newSyn);
 			}
 		}
-
-		// TODO
-
 	}
 
-//	if (words)
-//		*words = vocabList;
-	delete synonym;
+	if (srcWord)
+		// Pass out the pointer to the original word
+		*srcWord = vocabP;
 	
-	return returnWord;
+	// Return the new copy of the word
+	return newWord;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
index c417c7b..e1dcfe6 100644
--- a/engines/titanic/true_talk/tt_vocab.h
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -57,7 +57,15 @@ public:
 	TTvocab(int val);
 	~TTvocab();
 
-	TTword *getPrimeWord(TTstring &str, TTword **words);
+	/**
+	 * Scans the vocab list for a word with a synonym matching the passed string.
+	 * If found, creates a new word instance that only has the matching synonym
+	 * linked to it.
+	 * @param str		Word text to scan for
+	 * @param srcWord	Optional pointer to store the original word match was found on
+	 * @returns			A new word instance if a match if found, or null if not
+	 */
+	TTword *getPrimeWord(TTstring &str, TTword **srcWord) const;
 };
 
 } // End of namespace Titanic


Commit: f7b8a870659cf3aeb571d865506a08893b1acb58
    https://github.com/scummvm/scummvm/commit/f7b8a870659cf3aeb571d865506a08893b1acb58
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:07-04:00

Commit Message:
TITANIC: Added TTstring deletePrefix

Changed paths:
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_vocab.h



diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index df93a56..76c1092 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -122,4 +122,21 @@ TTstring TTstring::tokenize(const char *delim) {
 	}
 }
 
+int TTstring::deletePrefix(int count) {
+	int strSize = size();
+	if (count > strSize)
+		count = strSize;
+
+	if (_data->_referenceCount == 1) {
+		// No other references to this string, so we can just directly modify it
+		_data->_string = CString(_data->_string.c_str() + count);
+	} else {
+		// Detach string from current shared data, and create a new one with the substring
+		_data->_referenceCount--;
+		_data = new TTstringData(_data->_string.c_str() + count);
+	}
+
+	return 1;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 434c6fe..4266643 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -90,6 +90,10 @@ public:
 		return _data->_string.hasSuffix(str);
 	}
 
+	bool contains(const char *s) const {
+		return _data->_string.contains(s);
+	}
+
 	/**
 	 * Create a new copy of the string
 	 */
@@ -141,6 +145,11 @@ public:
 	 * of any specified delimiter character
 	 */
 	TTstring tokenize(const char *delim);
+
+	/**
+	 * Delets a specififed number of characters from the start of the string
+	 */
+	int deletePrefix(int count);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 102ed2c..458c0a1 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -208,4 +208,12 @@ TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const {
 	return newWord;
 }
 
+void TTvocab::fn1(TTstring &str) {
+	TTstring tempStr(str);
+	
+	if (tempStr.contains("pre")) {
+
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
index e1dcfe6..0a3e826 100644
--- a/engines/titanic/true_talk/tt_vocab.h
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -66,6 +66,8 @@ public:
 	 * @returns			A new word instance if a match if found, or null if not
 	 */
 	TTword *getPrimeWord(TTstring &str, TTword **srcWord) const;
+
+	void fn1(TTstring &str);
 };
 
 } // End of namespace Titanic


Commit: 6fdaa608f1e78dac127acb38f634294d58b78415
    https://github.com/scummvm/scummvm/commit/6fdaa608f1e78dac127acb38f634294d58b78415
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:10-04:00

Commit Message:
TITANIC: Start on vocab method for finding words with prefixes

Changed paths:
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_vocab.h



diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 4266643..3cc1e5e 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -83,6 +83,12 @@ public:
 		_data->_string.deleteLastChar();
 	}
 
+	bool hasPrefix(const CString &str) const {
+		return _data->_string.hasPrefix(str);
+	}
+	bool hasPrefix(const const char *str) const {
+		return _data->_string.hasPrefix(str);
+	}
 	bool hasSuffix(const CString &str) const {
 		return _data->_string.hasSuffix(str);
 	}
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 458c0a1..dfe894d 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -1,219 +1,248 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/file.h"
-#include "titanic/true_talk/tt_vocab.h"
-#include "titanic/true_talk/tt_adj.h"
-#include "titanic/true_talk/tt_action.h"
-#include "titanic/true_talk/tt_adj.h"
-#include "titanic/true_talk/tt_major_word.h"
-#include "titanic/true_talk/tt_picture.h"
-#include "titanic/true_talk/tt_pronoun.h"
-#include "titanic/titanic.h"
-
-namespace Titanic {
-
-TTvocab::TTvocab(int val): _headP(nullptr), _tailP(nullptr), _word(nullptr),
-		_fieldC(0), _field10(0), _vocabMode(val) {
-	_field14 = load("STVOCAB.TXT");
-}
-
-TTvocab::~TTvocab() {
-	if (_headP) {
-		_headP->deleteSiblings();
-		delete _headP;
-		_headP = _tailP = nullptr;
-	}
-}
-
-int TTvocab::load(const CString &name) {
-	SimpleFile *file = g_vm->_exeResources._owner->openResource(name);
-	int result = 0;
-	bool skipFlag;
-
-	while (!result && !file->eos()) {
-		skipFlag = false;
-		int mode = file->readNumber();
-		TTstring space(" ");
-
-		switch (mode) {
-		case 0: {
-			if (_word)
-				result = _word->readSyn(file);
-			skipFlag = true;
-			break;
-		}
-
-		case 1: {
-			TTaction *word = new TTaction(space, 0, 0, 0, 0);
-			result = word->load(file);
-			_word = word;
-			break;
-		}
-
-		case 2: {
-			TTpicture *word = new TTpicture(space, 0, 0, 0, 0, 0, 0);
-			result = word->load(file);
-			_word = word;
-			break;
-		}
-
-		case 3:
-		case 9: {
-			TTmajorWord *word = new TTmajorWord(space, 0, 0, 0);
-			result = word->load(file, mode);
-			_word = word;
-			break;
-		}
-
-		case 4:
-		case 5:
-		case 7: {
-			TTword *word = new TTword(space, 0, 0);
-			result = word->load(file, mode);
-			_word = word;
-			break;
-		}
-
-		case 8: {
-			TTadj *word = new TTadj(space, 0, 0, 0, 0);
-			result = word->load(file);
-			_word = word;
-			break;
-		}
-
-		case 6: {
-			TTpronoun *word = new TTpronoun(space, 0, 0, 0, 0);
-			result = word->load(file);
-			_word = word;
-			break;
-		}
-
-		default:
-			result = 4;
-			break;
-		}
-
-		if (!skipFlag && _word) {
-			if (result) {
-				// Something wrong occurred, so delete word
-				delete _word;
-				_word = nullptr;
-			} else {
-				// Add the word to the master vocab list
-				addWord(_word);
-			}
-		}
-	}
-
-	// Close resource and return result
-	delete file;
-	return result;
-}
-
-void TTvocab::addWord(TTword *word) {
-	TTword *existingWord = findWord(word->_string);
-
-	if (existingWord) {
-		if (word->_synP) {
-			// Move over the synonym
-			existingWord->appendNode(word->_synP);
-			word->_synP = nullptr;
-		}
-
-		_word = nullptr;
-		if (word)
-			delete word;
-	} else if (_tailP) {
-		_tailP->_nextP = word;
-		_tailP = word;
-	} else {
-		if (!_headP)
-			_headP = word;
-
-		_tailP = word;
-	}
-}
-
-TTword *TTvocab::findWord(const TTstring &str) {
-	TTsynonym *tempNode = new TTsynonym();
-	bool flag = false;
-	TTword *word = _headP;
-
-	while (word && !flag) {
-		if (_vocabMode != 3 || strcmp(word->c_str(), str)) {
-			if (word->findSynByName(str, tempNode, _vocabMode))
-				flag = true;
-			else
-				word = word->_nextP;
-		} else {
-			flag = true;
-		}
-	}
-
-	delete tempNode;
-	return word;
-}
-
-TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const {
-	TTsynonym tempSyn;
-	char c = str.charAt(0);
-	TTword *newWord = nullptr;
-	TTword *vocabP;
-
-	if (!Common::isDigit(c)) {
-		vocabP = _headP;
-		newWord = new TTword(str, 3, 300);
-	} else {
-		for (vocabP = _headP; vocabP && !newWord; vocabP = vocabP->_nextP) {
-			if (_vocabMode == 3 && !strcmp(str.c_str(), vocabP->c_str())) {
-				newWord = vocabP->copy();
-				newWord->_nextP = nullptr;
-				newWord->setSyn(nullptr);
-			} else if (vocabP->findSynByName(str, &tempSyn, _vocabMode)) {
-				// Create a copy of the word and the found synonym
-				TTsynonym *newSyn = new TTsynonym(tempSyn);
-				newSyn->_nextP = newSyn->_priorP = nullptr;
-				newWord = vocabP->copy();
-				newWord->_nextP = nullptr;
-				newWord->setSyn(newSyn);
-			}
-		}
-	}
-
-	if (srcWord)
-		// Pass out the pointer to the original word
-		*srcWord = vocabP;
-	
-	// Return the new copy of the word
-	return newWord;
-}
-
-void TTvocab::fn1(TTstring &str) {
-	TTstring tempStr(str);
-	
-	if (tempStr.contains("pre")) {
-
-	}
-}
-
-} // End of namespace Titanic
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/file.h"
+#include "titanic/true_talk/tt_vocab.h"
+#include "titanic/true_talk/tt_adj.h"
+#include "titanic/true_talk/tt_action.h"
+#include "titanic/true_talk/tt_adj.h"
+#include "titanic/true_talk/tt_major_word.h"
+#include "titanic/true_talk/tt_picture.h"
+#include "titanic/true_talk/tt_pronoun.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+TTvocab::TTvocab(int val): _headP(nullptr), _tailP(nullptr), _word(nullptr),
+		_fieldC(0), _field10(0), _vocabMode(val) {
+	_field14 = load("STVOCAB.TXT");
+}
+
+TTvocab::~TTvocab() {
+	if (_headP) {
+		_headP->deleteSiblings();
+		delete _headP;
+		_headP = _tailP = nullptr;
+	}
+}
+
+int TTvocab::load(const CString &name) {
+	SimpleFile *file = g_vm->_exeResources._owner->openResource(name);
+	int result = 0;
+	bool skipFlag;
+
+	while (!result && !file->eos()) {
+		skipFlag = false;
+		int mode = file->readNumber();
+		TTstring space(" ");
+
+		switch (mode) {
+		case 0: {
+			if (_word)
+				result = _word->readSyn(file);
+			skipFlag = true;
+			break;
+		}
+
+		case 1: {
+			TTaction *word = new TTaction(space, 0, 0, 0, 0);
+			result = word->load(file);
+			_word = word;
+			break;
+		}
+
+		case 2: {
+			TTpicture *word = new TTpicture(space, 0, 0, 0, 0, 0, 0);
+			result = word->load(file);
+			_word = word;
+			break;
+		}
+
+		case 3:
+		case 9: {
+			TTmajorWord *word = new TTmajorWord(space, 0, 0, 0);
+			result = word->load(file, mode);
+			_word = word;
+			break;
+		}
+
+		case 4:
+		case 5:
+		case 7: {
+			TTword *word = new TTword(space, 0, 0);
+			result = word->load(file, mode);
+			_word = word;
+			break;
+		}
+
+		case 8: {
+			TTadj *word = new TTadj(space, 0, 0, 0, 0);
+			result = word->load(file);
+			_word = word;
+			break;
+		}
+
+		case 6: {
+			TTpronoun *word = new TTpronoun(space, 0, 0, 0, 0);
+			result = word->load(file);
+			_word = word;
+			break;
+		}
+
+		default:
+			result = 4;
+			break;
+		}
+
+		if (!skipFlag && _word) {
+			if (result) {
+				// Something wrong occurred, so delete word
+				delete _word;
+				_word = nullptr;
+			} else {
+				// Add the word to the master vocab list
+				addWord(_word);
+			}
+		}
+	}
+
+	// Close resource and return result
+	delete file;
+	return result;
+}
+
+void TTvocab::addWord(TTword *word) {
+	TTword *existingWord = findWord(word->_string);
+
+	if (existingWord) {
+		if (word->_synP) {
+			// Move over the synonym
+			existingWord->appendNode(word->_synP);
+			word->_synP = nullptr;
+		}
+
+		_word = nullptr;
+		if (word)
+			delete word;
+	} else if (_tailP) {
+		_tailP->_nextP = word;
+		_tailP = word;
+	} else {
+		if (!_headP)
+			_headP = word;
+
+		_tailP = word;
+	}
+}
+
+TTword *TTvocab::findWord(const TTstring &str) {
+	TTsynonym *tempNode = new TTsynonym();
+	bool flag = false;
+	TTword *word = _headP;
+
+	while (word && !flag) {
+		if (_vocabMode != 3 || strcmp(word->c_str(), str)) {
+			if (word->findSynByName(str, tempNode, _vocabMode))
+				flag = true;
+			else
+				word = word->_nextP;
+		} else {
+			flag = true;
+		}
+	}
+
+	delete tempNode;
+	return word;
+}
+
+TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const {
+	TTsynonym tempSyn;
+	char c = str.charAt(0);
+	TTword *newWord = nullptr;
+	TTword *vocabP;
+
+	if (!Common::isDigit(c)) {
+		vocabP = _headP;
+		newWord = new TTword(str, 3, 300);
+	} else {
+		for (vocabP = _headP; vocabP && !newWord; vocabP = vocabP->_nextP) {
+			if (_vocabMode == 3 && !strcmp(str.c_str(), vocabP->c_str())) {
+				newWord = vocabP->copy();
+				newWord->_nextP = nullptr;
+				newWord->setSyn(nullptr);
+			} else if (vocabP->findSynByName(str, &tempSyn, _vocabMode)) {
+				// Create a copy of the word and the found synonym
+				TTsynonym *newSyn = new TTsynonym(tempSyn);
+				newSyn->_nextP = newSyn->_priorP = nullptr;
+				newWord = vocabP->copy();
+				newWord->_nextP = nullptr;
+				newWord->setSyn(newSyn);
+			}
+		}
+	}
+
+	if (srcWord)
+		// Pass out the pointer to the original word
+		*srcWord = vocabP;
+	
+	// Return the new copy of the word
+	return newWord;
+}
+
+void TTvocab::fn1(TTstring &str) {
+	TTstring tempStr(str);
+	TTword *word = nullptr;
+	int prefixLen = 0;
+
+	if (tempStr.hasPrefix("pre")) {
+		prefixLen = 3;
+	} else if (tempStr.hasPrefix("re") || tempStr.hasPrefix("co")) {
+		prefixLen = 2;
+	} else if (tempStr.hasPrefix("inter") || tempStr.hasPrefix("multi")) {
+		prefixLen = 5;
+	} else if (tempStr.hasPrefix("over") || tempStr.hasPrefix("post") || tempStr.hasPrefix("self")) {
+		prefixLen = 4;
+	}

+	if (prefixLen) {
+		// Known prefix found, so scan for word without prefix
+		tempStr.deletePrefix(prefixLen);
+		word = getPrimeWord(tempStr);
+		if (word)
+			tempStr = str;
+	} else {
+		if (tempStr.hasPrefix("anti"))
+			prefixLen = 4;
+		else if (tempStr.hasPrefix("counter"))
+			prefixLen = 7;
+
+		if (prefixLen) {
+			tempStr.deletePrefix(prefixLen);
+			word = getPrimeWord(tempStr);
+			if (word)
+				tempStr = str;
+		}
+	}
+
+	// TODO
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
index 0a3e826..16515ce 100644
--- a/engines/titanic/true_talk/tt_vocab.h
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -65,7 +65,7 @@ public:
 	 * @param srcWord	Optional pointer to store the original word match was found on
 	 * @returns			A new word instance if a match if found, or null if not
 	 */
-	TTword *getPrimeWord(TTstring &str, TTword **srcWord) const;
+	TTword *getPrimeWord(TTstring &str, TTword **srcWord = nullptr) const;
 
 	void fn1(TTstring &str);
 };


Commit: 72add4230f881a8e2cb57475eda9692242f59611
    https://github.com/scummvm/scummvm/commit/72add4230f881a8e2cb57475eda9692242f59611
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:12-04:00

Commit Message:
TITANIC: Finished TTvocab getPrefixedWord

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_synonym.cpp
    engines/titanic/true_talk/tt_synonym.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_vocab.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 1658a27..efed166 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -474,7 +474,7 @@ int TTparser::findFrames(TTsentence *sentence) {
 	TTstring wordString;
 	for (;;) {
 		// Keep stripping words off the start of the passed input
-		TTstring wordString = line->tokenize(" \n");
+		wordString = line->tokenize(" \n");
 		if (wordString.empty())
 			break;
 
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 3cc1e5e..faf1d6d 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -86,7 +86,7 @@ public:
 	bool hasPrefix(const CString &str) const {
 		return _data->_string.hasPrefix(str);
 	}
-	bool hasPrefix(const const char *str) const {
+	bool hasPrefix(const char *str) const {
 		return _data->_string.hasPrefix(str);
 	}
 	bool hasSuffix(const CString &str) const {
diff --git a/engines/titanic/true_talk/tt_synonym.cpp b/engines/titanic/true_talk/tt_synonym.cpp
index 636b443..0f56c5c 100644
--- a/engines/titanic/true_talk/tt_synonym.cpp
+++ b/engines/titanic/true_talk/tt_synonym.cpp
@@ -42,6 +42,11 @@ TTsynonym::TTsynonym(int mode, const char *str, FileHandle file) :
 	_file = file;
 }
 
+TTsynonym::TTsynonym(int mode, TTstring *str) : TTstringNode() {
+	_string = *str;
+	initialize(mode);
+}
+
 TTsynonym *TTsynonym::copyFrom(const TTsynonym *src) {
 	if (src->_field1C) {
 		_field1C = 5;
diff --git a/engines/titanic/true_talk/tt_synonym.h b/engines/titanic/true_talk/tt_synonym.h
index e95a6d4..d5dc2be 100644
--- a/engines/titanic/true_talk/tt_synonym.h
+++ b/engines/titanic/true_talk/tt_synonym.h
@@ -38,6 +38,7 @@ public:
 	TTsynonym();
 	TTsynonym(const TTsynonym *src);
 	TTsynonym(int mode, const char *str, FileHandle file);
+	TTsynonym(int mode, TTstring *str);
 
 	/**
 	 * Copies data from one synonym to another
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index dfe894d..5145e4f 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -208,7 +208,7 @@ TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const {
 	return newWord;
 }
 
-void TTvocab::fn1(TTstring &str) {
+TTword *TTvocab::getPrefixedWord(TTstring &str) {
 	TTstring tempStr(str);
 	TTword *word = nullptr;
 	int prefixLen = 0;
@@ -221,28 +221,57 @@ void TTvocab::fn1(TTstring &str) {
 		prefixLen = 5;
 	} else if (tempStr.hasPrefix("over") || tempStr.hasPrefix("post") || tempStr.hasPrefix("self")) {
 		prefixLen = 4;
-	}

+	}
+
 	if (prefixLen) {
 		// Known prefix found, so scan for word without prefix
 		tempStr.deletePrefix(prefixLen);
 		word = getPrimeWord(tempStr);
 		if (word)
 			tempStr = str;
-	} else {
-		if (tempStr.hasPrefix("anti"))
-			prefixLen = 4;
-		else if (tempStr.hasPrefix("counter"))
-			prefixLen = 7;
-
-		if (prefixLen) {
-			tempStr.deletePrefix(prefixLen);
-			word = getPrimeWord(tempStr);
-			if (word)
-				tempStr = str;
+
+	} else if (tempStr.hasPrefix("anti") || tempStr.hasPrefix("counter")) {
+		prefixLen = tempStr[0] == 'a' ? 4 : 7;
+
+		tempStr.deletePrefix(prefixLen);
+		word = getPrimeWord(tempStr);
+		if (!word)
+			tempStr = str;
+		else if (word->_wordMode == 8) {
+			delete word;
+			word = nullptr;
 		}
+
+	} else if (tempStr.hasPrefix("hyper") || tempStr.hasPrefix("super") ||
+			tempStr.hasPrefix("ultra")) {
+		tempStr.deletePrefix(5);
+		word = getPrimeWord(tempStr);
+
+		if (!word)
+			tempStr = str;
+		else if (word->_wordMode == 8) {
+			int val1 = word->proc15();
+			int val2 = word->proc15();
+
+			if (val2 < 5) {
+				if (--val1 > 0)
+					word->unkFn1(val1);
+			} else if (++val1 < 11) {
+				word->unkFn1(val1);
+			}
+		}
+	}
+
+	if (word) {
+		// Set the original word on either the found word or synonym
+		if (word->hasSynonyms())
+			word->setSynStr(&str);
+		else
+			word->_string = str;
 	}
 
-	// TODO
+	delete tempStr;
+	return word;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
index 16515ce..8b2a080 100644
--- a/engines/titanic/true_talk/tt_vocab.h
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -67,7 +67,13 @@ public:
 	 */
 	TTword *getPrimeWord(TTstring &str, TTword **srcWord = nullptr) const;
 
-	void fn1(TTstring &str);
+	/**
+	 * Checks the passed word for common prefixes, and checks for a word
+	 * match for the word without the given prefix
+	 * @param str		Word to check
+	 * @returns			New word instance for found match, or nullptr otherwise
+	 */
+	TTword *getPrefixedWord(TTstring &str);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index a09af4a..bc029d0 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -109,6 +109,16 @@ void TTword::setSyn(TTsynonym *synP) {
 	_synP = synP;
 }
 
+int TTword::setSynStr(TTstring *str) {
+	if (str->empty())
+		return 4;
+
+	TTstring *newStr = new TTstring(*str);
+	TTsynonym *newSyn = new TTsynonym(4, newStr);
+	setSyn(newSyn);
+	return 0;
+}
+
 void TTword::appendNode(TTsynonym *node) {
 	if (_synP)
 		_synP->addNode(node);
@@ -172,6 +182,10 @@ TTword *TTword::copy() {
 	return new TTword(this);
 }
 
+void TTword::unkFn1(int val) {
+	// TODO: This method seems to reference a field beyond the size of TTword
+}
+
 FileHandle TTword::getSynFile() const {
 	return _synP ? _synP->_file : HANDLE_STDIN;
 }
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 885409c..7f0f916 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -32,7 +32,6 @@ namespace Titanic {
 class TTword {
 protected:
 	TTstringStatus _status;
-	int _wordMode;
 	int _field1C;
 	int _field20;
 	int _field24;
@@ -49,6 +48,7 @@ public:
 	TTword *_nextP;
 	TTsynonym *_synP;
 	TTstring _string;
+	int _wordMode;
 public:
 	TTword(TTstring &str, int mode, int val2);
 	TTword(TTword *src);
@@ -69,6 +69,16 @@ public:
 	void setSyn(TTsynonym *synP);
 
 	/**
+	 * Set a new synonym string
+	 */
+	int setSynStr(TTstring *str);
+
+	/**
+	 * Returns true if synonyms have been set for the word
+	 */
+	bool hasSynonyms() const { return _synP != nullptr; }
+
+	/**
 	 * Either sets the first synonym for a word, or adds it to an existing one
 	 */
 	void appendNode(TTsynonym *node);
@@ -99,6 +109,8 @@ public:
 	 */
 	virtual TTword *copy();
 	
+	void unkFn1(int val);
+
 	virtual bool proc2(int val) const { return false; }
 	virtual int proc3() const { return -1; }
 	virtual void proc4() {}


Commit: fc05032feded6af51ac1c0b05488e4eea2c6e891
    https://github.com/scummvm/scummvm/commit/fc05032feded6af51ac1c0b05488e4eea2c6e891
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:15-04:00

Commit Message:
TITANIC: Finished TTvocab getWord

Changed paths:
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_vocab.h



diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 5145e4f..5a52e75 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -174,6 +174,22 @@ TTword *TTvocab::findWord(const TTstring &str) {
 	return word;
 }
 
+TTword *TTvocab::getWord(TTstring &str, TTword **srcWord) const {
+	TTword *word = getPrimeWord(str, srcWord);
+
+	if (!word) {
+		TTstring tempStr(str);
+		if (tempStr.size() > 2) {
+			word = getPluralizedWord(tempStr);
+
+			if (!word)
+				word = getPrefixedWord(tempStr);
+		}
+	}
+
+	return word;
+}
+
 TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const {
 	TTsynonym tempSyn;
 	char c = str.charAt(0);
@@ -208,7 +224,12 @@ TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const {
 	return newWord;
 }
 
-TTword *TTvocab::getPrefixedWord(TTstring &str) {
+TTword *TTvocab::getPluralizedWord(TTstring &str) const {
+	// TODO
+	return nullptr;
+}
+
+TTword *TTvocab::getPrefixedWord(TTstring &str) const {
 	TTstring tempStr(str);
 	TTword *word = nullptr;
 	int prefixLen = 0;
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
index 8b2a080..7da0db3 100644
--- a/engines/titanic/true_talk/tt_vocab.h
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -53,9 +53,6 @@ private:
 	 * Scans the vocab list for an existing word match
 	 */
 	TTword *findWord(const TTstring &str);
-public:
-	TTvocab(int val);
-	~TTvocab();
 
 	/**
 	 * Scans the vocab list for a word with a synonym matching the passed string.
@@ -68,12 +65,31 @@ public:
 	TTword *getPrimeWord(TTstring &str, TTword **srcWord = nullptr) const;
 
 	/**
+	 * Checks the passed word for common pluralization, and if present checks
+	 * for a word match for the base singular word
+	 * @param str		Word to check
+	 * @returns			New word instance for found match, or nullptr otherwise
+	 */
+	TTword *getPluralizedWord(TTstring &str) const;
+
+	/**
 	 * Checks the passed word for common prefixes, and checks for a word
 	 * match for the word without the given prefix
 	 * @param str		Word to check
 	 * @returns			New word instance for found match, or nullptr otherwise
 	 */
-	TTword *getPrefixedWord(TTstring &str);
+	TTword *getPrefixedWord(TTstring &str) const;
+public:
+	TTvocab(int val);
+	~TTvocab();
+
+	/**
+	 * Gets a matching word from the vocab list given a passed string
+	 * @param str		Word text to scan for
+	 * @param srcWord	Optional pointer to store the original word match was found on
+	 * @returns			A new word instance if a match if found, or null if not
+	 */
+	TTword *getWord(TTstring &str, TTword **srcWord = nullptr) const;
 };
 
 } // End of namespace Titanic


Commit: 6fa65bbf0a1a57e47f36a3dd9e1c7a90af2888f6
    https://github.com/scummvm/scummvm/commit/6fa65bbf0a1a57e47f36a3dd9e1c7a90af2888f6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:17-04:00

Commit Message:
TITANIC: Add proper destruction of node chains

Changed paths:
    engines/titanic/true_talk/tt_script_base.cpp
    engines/titanic/true_talk/tt_script_base.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index 16783de..a8e0940 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 TTscriptBase::TTscriptBase(int v1, const char *charClass, int v2,
 		const char *charName, int v3, int v4, int v5, int v6, int v7) :
 		_charName(charName), _charClass(charClass), 
-		_field4(0), _field8(0), _hist(nullptr),
+		_nodesP(nullptr), _field8(0), _hist(nullptr),
 		_field20(0), _field24(0), _field28(0), _field2C(0),
 		_field30(0), _field34(0), _field38(0), _field3C(0),
 		_field40(0), _field44(0), _field48(0), _status(0) {
@@ -50,6 +50,13 @@ TTscriptBase::TTscriptBase(int v1, const char *charClass, int v2,
 		reset();
 }
 
+TTscriptBase::~TTscriptBase() {
+	if (_nodesP) {
+		_nodesP->deleteSiblings();
+		delete _nodesP;
+	}
+}
+
 bool TTscriptBase::areNamesValid() {
 	bool result = !_charName.isValid() && !_charClass.isValid();
 	_status = result ? 0 : 11;
@@ -57,7 +64,7 @@ bool TTscriptBase::areNamesValid() {
 }
 
 void TTscriptBase::reset() {
-	_field4 = 0;
+	_nodesP = nullptr;
 	_field8 = 4;
 	_hist = nullptr;
 	_field20 = 0;
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index 9bcb334..ce83cd1 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -25,6 +25,7 @@
 
 #include "titanic/true_talk/tt_string.h"
 #include "titanic/true_talk/tt_hist.h"
+#include "titanic/true_talk/tt_node.h"
 
 namespace Titanic {
 
@@ -38,7 +39,7 @@ class TTscriptBase {
 private:
 	void reset();
 protected:
-	int _field4;
+	TTnode *_nodesP;
 	int _field8;
 	TThist *_hist;
 	TTstring _charName, _charClass;
@@ -57,6 +58,7 @@ protected:
 public:
 	TTscriptBase(int v1, const char *charClass, int v2, const char *charName,
 		int v3, int v4, int v5, int v6, int v7);
+	virtual ~TTscriptBase();
 
 	bool areNamesValid();
 
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index f7779eb..2654a55 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -27,7 +27,17 @@ namespace Titanic {
 
 TTsentenceSubBase::TTsentenceSubBase() : _field0(0), _field4(0), _field8(0),
 	_fieldC(0), _field10(0), _field14(0), _field18(0), _field1C(0),
-	_field20(0), _field24(0) {
+	_nextP(nullptr), _field24(0) {
+}
+
+void TTsentenceSubBase::deleteSiblings() {
+	// Iterate through the linked chain of nodes, deleting each in turn
+	for (TTsentenceSubBase *curP = _nextP, *nextP = nullptr; nextP; curP = nextP) {
+		nextP = curP->_nextP;
+		delete curP;
+	}
+
+	_nextP = nullptr;
 }
 
 /*------------------------------------------------------------------------*/
@@ -45,6 +55,15 @@ TTsentence::TTsentence(const TTsentence *src) : _initialLine(src->_initialLine),
 	copyFrom(*src);
 }
 
+TTsentence::~TTsentence() {
+	_sub.deleteSiblings();
+
+	if (_nodesP) {
+		_nodesP->deleteSiblings();
+		delete _nodesP;
+	}
+}
+
 void TTsentence::copyFrom(const TTsentence &src) {
 	if (!src.getStatus())
 		_status = SS_5;
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 9f6d18e..042e055 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -42,10 +42,15 @@ public:
 	int _field14;
 	int _field18;
 	int _field1C;
-	int _field20;
+	TTsentenceSubBase *_nextP;
 	int _field24;
 public:
 	TTsentenceSubBase();
+
+	/**
+	 * Delete any sibling chain attached to this node
+	 */
+	void deleteSiblings();
 };
 
 class TTsentenceSub : public TTsentenceSubBase {
@@ -78,6 +83,7 @@ public:
 	TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner,
 		TTroomScript *roomScript, TTnpcScript *npcScript);
 	TTsentence(const TTsentence *src);
+	~TTsentence();
 
 	void set34(int v) { _field34 = v; }
 	void set38(int v) { _field38 = v; }
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index bc029d0..a4147a8 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -68,6 +68,13 @@ TTword::TTword(TTword *src) {
 	_field28 = src->_field28;
 }
 
+TTword::~TTword() {
+	if (_synP) {
+		_synP->deleteSiblings();
+		delete _synP;
+	}
+}
+
 void TTword::deleteSiblings() {
 	while (_nextP) {
 		TTword *next = _nextP;
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 7f0f916..ed32b35 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -52,6 +52,7 @@ public:
 public:
 	TTword(TTstring &str, int mode, int val2);
 	TTword(TTword *src);
+	~TTword();
 
 	/**
 	 * Delete any following words chained to the word


Commit: c858190c54ec3c0bb6f0f9b4a22b4cda1d893bbb
    https://github.com/scummvm/scummvm/commit/c858190c54ec3c0bb6f0f9b4a22b4cda1d893bbb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:20-04:00

Commit Message:
TITANIC: Beginnings of TTvocab getSuffixedWord

Changed paths:
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_vocab.h



diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index 76c1092..90a9aaa 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -139,4 +139,22 @@ int TTstring::deletePrefix(int count) {
 	return 1;
 }
 
+int TTstring::deleteSuffix(int count) {
+	int strSize = size();
+	if (count > strSize)
+		count = strSize;
+
+	CString newStr(_data->_string.c_str(), _data->_string.c_str() + strSize - count);
+	if (_data->_referenceCount == 1) {
+		// No other references to this string, so we can just directly modify it
+		_data->_string = newStr;
+	} else {
+		// Detach string from current shared data, and create a new one with the substring
+		_data->_referenceCount--;
+		_data = new TTstringData(newStr);
+	}
+
+	return 1;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index faf1d6d..6003124 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -156,6 +156,12 @@ public:
 	 * Delets a specififed number of characters from the start of the string
 	 */
 	int deletePrefix(int count);
+
+	/**
+	 * Delets a specififed number of characters from the end of the string
+	 */
+	int deleteSuffix(int count);
+
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 5a52e75..073c7c2 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -180,7 +180,7 @@ TTword *TTvocab::getWord(TTstring &str, TTword **srcWord) const {
 	if (!word) {
 		TTstring tempStr(str);
 		if (tempStr.size() > 2) {
-			word = getPluralizedWord(tempStr);
+			word = getSuffixedWord(tempStr);
 
 			if (!word)
 				word = getPrefixedWord(tempStr);
@@ -224,7 +224,32 @@ TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const {
 	return newWord;
 }
 
-TTword *TTvocab::getPluralizedWord(TTstring &str) const {
+TTword *TTvocab::getSuffixedWord(TTstring &str) const {
+	TTstring tempStr(str);
+	TTword *word = nullptr;
+
+	if (tempStr.hasSuffix("s")) {
+		tempStr.deleteSuffix(1);
+		word = getPrimeWord(tempStr);
+
+		if (!word) {
+			if (!tempStr.hasSuffix("e")) {
+				tempStr = str;
+			} else {
+				tempStr.deleteLastChar();
+				word = getPrimeWord(tempStr);
+			}
+		}
+	
+	} else if (tempStr.hasSuffix("ing")) {
+		tempStr.deleteSuffix(3);
+		word = getPrimeWord(tempStr);
+
+		if (word) {
+
+		}
+	}
+
 	// TODO
 	return nullptr;
 }
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
index 7da0db3..c84acbe 100644
--- a/engines/titanic/true_talk/tt_vocab.h
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -65,12 +65,12 @@ private:
 	TTword *getPrimeWord(TTstring &str, TTword **srcWord = nullptr) const;
 
 	/**
-	 * Checks the passed word for common pluralization, and if present checks
-	 * for a word match for the base singular word
+	 * Checks the passed word for common suffixes, like 's', 'ing', etc. and, if found,
+	 * checks for a word match for the base word without the suffix.
 	 * @param str		Word to check
 	 * @returns			New word instance for found match, or nullptr otherwise
 	 */
-	TTword *getPluralizedWord(TTstring &str) const;
+	TTword *getSuffixedWord(TTstring &str) const;
 
 	/**
 	 * Checks the passed word for common prefixes, and checks for a word


Commit: 54669e7b7e6c3e3ebad32f2d36932d8345814d2c
    https://github.com/scummvm/scummvm/commit/54669e7b7e6c3e3ebad32f2d36932d8345814d2c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:22-04:00

Commit Message:
TITANIC: Added an enum for TTword wordMode

Changed paths:
    engines/titanic/true_talk/tt_action.cpp
    engines/titanic/true_talk/tt_action.h
    engines/titanic/true_talk/tt_adj.cpp
    engines/titanic/true_talk/tt_adj.h
    engines/titanic/true_talk/tt_major_word.cpp
    engines/titanic/true_talk/tt_major_word.h
    engines/titanic/true_talk/tt_picture.cpp
    engines/titanic/true_talk/tt_picture.h
    engines/titanic/true_talk/tt_pronoun.cpp
    engines/titanic/true_talk/tt_pronoun.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_action.cpp b/engines/titanic/true_talk/tt_action.cpp
index 39e3174..028da46 100644
--- a/engines/titanic/true_talk/tt_action.cpp
+++ b/engines/titanic/true_talk/tt_action.cpp
@@ -26,8 +26,8 @@ namespace Titanic {
 
 bool TTaction::_staticFlag;
 
-TTaction::TTaction(TTstring &str, int val1, int val2, int val3, int val4) :
-		TTmajorWord(str, val1, val2, val3), _field30(val4) {
+TTaction::TTaction(TTstring &str, WordMode mode, int val2, int val3, int val4) :
+		TTmajorWord(str, mode, val2, val3), _field30(val4) {
 }
 
 TTaction::TTaction(TTaction *src) : TTmajorWord(src) {
@@ -42,7 +42,7 @@ TTaction::TTaction(TTaction *src) : TTmajorWord(src) {
 int TTaction::load(SimpleFile *file) {
 	int val;
 
-	if (!TTword::load(file, 1) && file->scanf("%d", &val)) {
+	if (!TTword::load(file, WMODE_1) && file->scanf("%d", &val)) {
 		_field30 = val;
 		return 0;
 	} else {
diff --git a/engines/titanic/true_talk/tt_action.h b/engines/titanic/true_talk/tt_action.h
index 822ba4a..b89d702 100644
--- a/engines/titanic/true_talk/tt_action.h
+++ b/engines/titanic/true_talk/tt_action.h
@@ -33,7 +33,7 @@ private:
 protected:
 	int _field30;
 public:
-	TTaction(TTstring &str, int val1, int val2, int val3, int val4);
+	TTaction(TTstring &str, WordMode mode, int val2, int val3, int val4);
 	TTaction(TTaction *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_adj.cpp b/engines/titanic/true_talk/tt_adj.cpp
index 8f62bb8..850692f 100644
--- a/engines/titanic/true_talk/tt_adj.cpp
+++ b/engines/titanic/true_talk/tt_adj.cpp
@@ -26,8 +26,8 @@ namespace Titanic {
 
 bool TTadj::_staticFlag;
 
-TTadj::TTadj(TTstring &str, int val1, int val2, int val3, int val4) :
-		TTmajorWord(str, val1, val2, val3) {
+TTadj::TTadj(TTstring &str, WordMode mode, int val2, int val3, int val4) :
+		TTmajorWord(str, mode, val2, val3) {
 	if (val4 >= 0 && val4 <= 9) {
 		_field30 = val4;
 	} else {
@@ -48,7 +48,7 @@ TTadj::TTadj(TTadj *src) : TTmajorWord(src) {
 int TTadj::load(SimpleFile *file) {
 	int val;
 
-	if (!TTword::load(file, 8) && file->scanf("%d", &val)) {
+	if (!TTword::load(file, WMODE_8) && file->scanf("%d", &val)) {
 		_field30 = val;
 		return 0;
 	} else {
diff --git a/engines/titanic/true_talk/tt_adj.h b/engines/titanic/true_talk/tt_adj.h
index 301023e..f18d249 100644
--- a/engines/titanic/true_talk/tt_adj.h
+++ b/engines/titanic/true_talk/tt_adj.h
@@ -33,7 +33,7 @@ private:
 protected:
 	int _field30;
 public:
-	TTadj(TTstring &str, int val1, int val2, int val3, int val4);
+	TTadj(TTstring &str, WordMode mode, int val2, int val3, int val4);
 	TTadj(TTadj *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_major_word.cpp b/engines/titanic/true_talk/tt_major_word.cpp
index 68af628..b81ada4 100644
--- a/engines/titanic/true_talk/tt_major_word.cpp
+++ b/engines/titanic/true_talk/tt_major_word.cpp
@@ -26,8 +26,8 @@ namespace Titanic {
 
 bool TTmajorWord::_staticFlag;
 
-TTmajorWord::TTmajorWord(TTstring &str, int val1, int val2, int val3) :
-		TTword(str, val1, val2), _field2C(val3) {
+TTmajorWord::TTmajorWord(TTstring &str, WordMode mode, int val2, int val3) :
+		TTword(str, mode, val2), _field2C(val3) {
 }
 
 TTmajorWord::TTmajorWord(TTmajorWord *src) : TTword(src) {
diff --git a/engines/titanic/true_talk/tt_major_word.h b/engines/titanic/true_talk/tt_major_word.h
index 962fbaa..55eb882 100644
--- a/engines/titanic/true_talk/tt_major_word.h
+++ b/engines/titanic/true_talk/tt_major_word.h
@@ -38,7 +38,7 @@ protected:
 	 */
 	int saveData(SimpleFile *file, int val) const;
 public:
-	TTmajorWord(TTstring &str, int val1, int val2, int val3);
+	TTmajorWord(TTstring &str, WordMode mode, int val2, int val3);
 	TTmajorWord(TTmajorWord *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_picture.cpp b/engines/titanic/true_talk/tt_picture.cpp
index 6213cd5..aab9c5d 100644
--- a/engines/titanic/true_talk/tt_picture.cpp
+++ b/engines/titanic/true_talk/tt_picture.cpp
@@ -26,8 +26,8 @@ namespace Titanic {
 
 bool TTpicture::_staticFlag;
 
-TTpicture::TTpicture(TTstring &str, int val1, int val2, int val3, int val4, int val5, int val6) :
-		TTmajorWord(str, val1, val2, val4), _tag(val3), _field30(val5), _field3C(val6),
+TTpicture::TTpicture(TTstring &str, WordMode mode, int val2, int val3, int val4, int val5, int val6) :
+		TTmajorWord(str, mode, val2, val4), _tag(val3), _field30(val5), _field3C(val6),
 		_field38(0) {
 }
 
@@ -50,7 +50,7 @@ int TTpicture::load(SimpleFile *file) {
 	CString str;
 	int val1, val2;
 
-	if (!TTword::load(file, 2) && file->scanf("%s %d %d", &str, &val1, &val2)) {
+	if (!TTword::load(file, WMODE_2) && file->scanf("%s %d %d", &str, &val1, &val2)) {
 		_tag = readNumber(str.c_str());
 		_field30 = val1;
 		_field3C = val2;
diff --git a/engines/titanic/true_talk/tt_picture.h b/engines/titanic/true_talk/tt_picture.h
index c4cc2c1..404d9c4 100644
--- a/engines/titanic/true_talk/tt_picture.h
+++ b/engines/titanic/true_talk/tt_picture.h
@@ -36,7 +36,7 @@ protected:
 	int _field38;
 	int _field3C;
 public:
-	TTpicture(TTstring &str, int val1, int val2, int val3, int val4, int val5, int val6);
+	TTpicture(TTstring &str, WordMode mode, int val2, int val3, int val4, int val5, int val6);
 	TTpicture(TTpicture *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_pronoun.cpp b/engines/titanic/true_talk/tt_pronoun.cpp
index 4b20b33..68fcef0 100644
--- a/engines/titanic/true_talk/tt_pronoun.cpp
+++ b/engines/titanic/true_talk/tt_pronoun.cpp
@@ -26,8 +26,8 @@ namespace Titanic {
 
 bool TTpronoun::_staticFlag;
 
-TTpronoun::TTpronoun(TTstring &str, int val1, int val2, int val3, int val4) :
-		TTmajorWord(str, val1, val2, val3), _field30(val4) {
+TTpronoun::TTpronoun(TTstring &str, WordMode mode, int val2, int val3, int val4) :
+		TTmajorWord(str, mode, val2, val3), _field30(val4) {
 }
 
 TTpronoun::TTpronoun(TTpronoun *src) : TTmajorWord(src) {
@@ -42,7 +42,7 @@ TTpronoun::TTpronoun(TTpronoun *src) : TTmajorWord(src) {
 int TTpronoun::load(SimpleFile *file) {
 	int val;
 
-	if (!TTword::load(file, 6) && file->scanf("%d", &val)) {
+	if (!TTword::load(file, WMODE_6) && file->scanf("%d", &val)) {
 		if (val >= 0 && val <= 12) {
 			_field30 = val;
 			return 0;
diff --git a/engines/titanic/true_talk/tt_pronoun.h b/engines/titanic/true_talk/tt_pronoun.h
index 6bb8113..5aa3e1e 100644
--- a/engines/titanic/true_talk/tt_pronoun.h
+++ b/engines/titanic/true_talk/tt_pronoun.h
@@ -33,7 +33,7 @@ private:
 protected:
 	int _field30;
 public:
-	TTpronoun(TTstring &str, int val1, int val2, int val3, int val4);
+	TTpronoun(TTstring &str, WordMode mode, int val2, int val3, int val4);
 	TTpronoun(TTpronoun *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 073c7c2..b5276e1 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -52,7 +52,7 @@ int TTvocab::load(const CString &name) {
 
 	while (!result && !file->eos()) {
 		skipFlag = false;
-		int mode = file->readNumber();
+		WordMode mode = (WordMode)file->readNumber();
 		TTstring space(" ");
 
 		switch (mode) {
@@ -64,14 +64,14 @@ int TTvocab::load(const CString &name) {
 		}
 
 		case 1: {
-			TTaction *word = new TTaction(space, 0, 0, 0, 0);
+			TTaction *word = new TTaction(space, WMODE_NONE, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
 		}
 
 		case 2: {
-			TTpicture *word = new TTpicture(space, 0, 0, 0, 0, 0, 0);
+			TTpicture *word = new TTpicture(space, WMODE_NONE, 0, 0, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
@@ -79,7 +79,7 @@ int TTvocab::load(const CString &name) {
 
 		case 3:
 		case 9: {
-			TTmajorWord *word = new TTmajorWord(space, 0, 0, 0);
+			TTmajorWord *word = new TTmajorWord(space, WMODE_NONE, 0, 0);
 			result = word->load(file, mode);
 			_word = word;
 			break;
@@ -88,21 +88,21 @@ int TTvocab::load(const CString &name) {
 		case 4:
 		case 5:
 		case 7: {
-			TTword *word = new TTword(space, 0, 0);
+			TTword *word = new TTword(space, WMODE_NONE, 0);
 			result = word->load(file, mode);
 			_word = word;
 			break;
 		}
 
 		case 8: {
-			TTadj *word = new TTadj(space, 0, 0, 0, 0);
+			TTadj *word = new TTadj(space, WMODE_NONE, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
 		}
 
 		case 6: {
-			TTpronoun *word = new TTpronoun(space, 0, 0, 0, 0);
+			TTpronoun *word = new TTpronoun(space, WMODE_NONE, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
@@ -198,7 +198,7 @@ TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const {
 
 	if (!Common::isDigit(c)) {
 		vocabP = _headP;
-		newWord = new TTword(str, 3, 300);
+		newWord = new TTword(str, WMODE_3, 300);
 	} else {
 		for (vocabP = _headP; vocabP && !newWord; vocabP = vocabP->_nextP) {
 			if (_vocabMode == 3 && !strcmp(str.c_str(), vocabP->c_str())) {
@@ -246,8 +246,42 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 		word = getPrimeWord(tempStr);
 
 		if (word) {
+			if (word->_wordMode == 1) {
+				delete word;
+				word = nullptr;
+			} else {
+				delete word;
+				word = new TTadj(str, WMODE_8, 0, 0, 0);
+			}
+		} else {
+			tempStr += "e";
+			word = getPrimeWord(tempStr);
+
+			if (word) {
+				if (word->_wordMode != 1) {
+					delete word;
+					word = new TTadj(str, WMODE_8, 0, 0, 0);
+				}
+			} else {
+				tempStr.deleteSuffix(2);
+				word = getPrimeWord(tempStr);
 
+				if (word) {
+					if (word->_wordMode != 1) {
+						delete word;
+						word = new TTadj(str, WMODE_8, 0, 0, 0);
+					}
+				} else {
+					tempStr = str;
+				}
+			}
 		}
+	
+	} else if (tempStr.hasSuffix("ed")) {
+		tempStr.deleteSuffix(1);
+		word = getPrimeWord(tempStr);
+
+		// TODO
 	}
 
 	// TODO
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index a4147a8..eebb161 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -26,7 +26,7 @@
 
 namespace Titanic {
 
-TTword::TTword(TTstring &str, int mode, int val2) : _string(str),
+TTword::TTword(TTstring &str, WordMode mode, int val2) : _string(str),
 		_wordMode(mode), _field1C(val2), _field20(0), _field24(0),
 		_field28(0), _synP(nullptr), _nextP(nullptr) {
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
@@ -133,7 +133,7 @@ void TTword::appendNode(TTsynonym *node) {
 		_synP = node;
 }
 
-int TTword::load(SimpleFile *file, int mode) {
+int TTword::load(SimpleFile *file, WordMode mode) {
 	CString str1, str2;
 	int val;
 
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index ed32b35..13a40b0 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -29,6 +29,11 @@
 
 namespace Titanic {
 
+enum WordMode { 
+	WMODE_NONE = 0, WMODE_1 = 1, WMODE_2 = 2, WMODE_3 = 3,
+	WMODE_6 = 6, WMODE_8 = 8
+};
+
 class TTword {
 protected:
 	TTstringStatus _status;
@@ -48,9 +53,9 @@ public:
 	TTword *_nextP;
 	TTsynonym *_synP;
 	TTstring _string;
-	int _wordMode;
+	WordMode _wordMode;
 public:
-	TTword(TTstring &str, int mode, int val2);
+	TTword(TTstring &str, WordMode mode, int val2);
 	TTword(TTword *src);
 	~TTword();
 
@@ -87,7 +92,7 @@ public:
 	/**
 	 * Load the word
 	 */
-	int load(SimpleFile *file, int mode);
+	int load(SimpleFile *file, WordMode mode);
 
 	/**
 	 * Finds a synonym in the word by name, if one exists


Commit: c4084e731b60b97bbe0cdf5d6f61f1894b70f96c
    https://github.com/scummvm/scummvm/commit/c4084e731b60b97bbe0cdf5d6f61f1894b70f96c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:25-04:00

Commit Message:
TITANIC: Implemented TTvocab getSuffixedWord

Changed paths:
    engines/titanic/true_talk/tt_action.cpp
    engines/titanic/true_talk/tt_action.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_action.cpp b/engines/titanic/true_talk/tt_action.cpp
index 028da46..e0c7284 100644
--- a/engines/titanic/true_talk/tt_action.cpp
+++ b/engines/titanic/true_talk/tt_action.cpp
@@ -42,7 +42,7 @@ TTaction::TTaction(TTaction *src) : TTmajorWord(src) {
 int TTaction::load(SimpleFile *file) {
 	int val;
 
-	if (!TTword::load(file, WMODE_1) && file->scanf("%d", &val)) {
+	if (!TTword::load(file, WMODE_ACTION) && file->scanf("%d", &val)) {
 		_field30 = val;
 		return 0;
 	} else {
diff --git a/engines/titanic/true_talk/tt_action.h b/engines/titanic/true_talk/tt_action.h
index b89d702..1103da8 100644
--- a/engines/titanic/true_talk/tt_action.h
+++ b/engines/titanic/true_talk/tt_action.h
@@ -41,6 +41,8 @@ public:
 	 */
 	int load(SimpleFile *file);
 
+	void setVal(int val) { _field30 = val; }
+
 	/**
 	 * Creates a copy of the word
 	 */
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index b5276e1..2e5a7cc 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -280,12 +280,205 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 	} else if (tempStr.hasSuffix("ed")) {
 		tempStr.deleteSuffix(1);
 		word = getPrimeWord(tempStr);
+		
+		if (!word) {
+			tempStr.deleteSuffix(1);
+			word = getPrimeWord(tempStr);
+		}
+
+		if (word) {
+			if (word->_wordMode == WMODE_ACTION) {
+				static_cast<TTaction *>(word)->setVal(1);
+			}
+		} else {
+			tempStr = str;
+		}
+
+	} else if (tempStr.hasSuffix("ly")) {
+		tempStr.deleteSuffix(2);
+		word = getPrimeWord(tempStr);
+
+		if (word) {
+			delete word;
+			word = new TTword(str, WMODE_9, 0);
+		} else {
+			tempStr = str;
+		}
+	
+	} else if (tempStr.hasSuffix("er")) {
+		tempStr.deleteSuffix(1);
+		word = getPrimeWord(tempStr);
+
+		if (word) {
+			if (word->_wordMode == WMODE_8) {
+				int val1 = word->proc15();
+				int val2 = word->proc15();
+
+				if (val2 < 5) {
+					if (--val1 > 0) {
+						word->unkFn1(val1);
+					}
+				} else {
+					if (++val1 < 11) {
+						word->unkFn1(val1);
+					}
+				}
+			}
+		} else {
+			tempStr.deleteSuffix(1);
+			word = getPrimeWord(tempStr);
+
+			if (word) {
+				if (word->_wordMode == WMODE_8) {
+					int val1 = word->proc15();
+					int val2 = word->proc15();
+
+					if (val2 < 5) {
+						if (--val1 > 0) {
+							word->unkFn1(val1);
+						}
+					} else {
+						if (++val1 < 11) {
+							word->unkFn1(val1);
+						}
+					}
+				}
+			} else {
+				tempStr.deleteSuffix(1);
+				word = getPrimeWord(tempStr);
+
+				if (word && word->_wordMode == WMODE_8) {
+					int val1 = word->proc15();
+					int val2 = word->proc15();
+
+					if (val2 < 5) {
+						if (--val1 > 0) {
+							word->unkFn1(val1);
+						}
+					} else {
+						if (++val1 < 11) {
+							word->unkFn1(val1);
+						}
+					}
+				}
+			}
+		}
+	
+	} else if (tempStr.hasSuffix("est")) {
+		tempStr.deleteSuffix(2);
+		word = getPrimeWord(tempStr);
+
+		if (word) {
+			if (word->_wordMode == WMODE_8) {
+				int val1 = word->proc15();
+				int val2 = word->proc15();
+
+				if (val2 < 5) {
+					if (--val1 > 0) {
+						word->unkFn1(val1);
+					}
+				} else {
+					if (++val1 < 11) {
+						word->unkFn1(val1);
+					}
+				}
+			}
+		} else {
+			tempStr.deleteSuffix(1);
+			word = getPrimeWord(tempStr);
+
+			if (word) {
+				if (word->_wordMode == WMODE_8) {
+					int val1 = word->proc15();
+					int val2 = word->proc15();
+
+					if (val2 < 5) {
+						if (--val1 > 0) {
+							word->unkFn1(val1);
+						}
+					} else {
+						if (++val1 < 11) {
+							word->unkFn1(val1);
+						}
+					}
+				}
+			} else {
+				tempStr.deleteSuffix(1);
+				word = getPrimeWord(tempStr);
+
+				if (word) {
+					int val1 = word->proc15();
+					int val2 = word->proc15();
+
+					if (val2 < 5) {
+						if (--val1 > 0) {
+							word->unkFn1(val1);
+						}
+					} else {
+						if (++val1 < 11) {
+							word->unkFn1(val1);
+						}
+					}
+				}
+			}
+		}
+
+	} else if (tempStr.hasSuffix("s*")) {
+		tempStr.deleteSuffix(2);
+		word = getPrimeWord(tempStr);
+
+		if (word) {
+			if (word->_wordMode == WMODE_6 || word->_wordMode == WMODE_9) {
+				delete word;
+				TTstring isStr("is");
+				word = getPrimeWord(isStr);
+			} else {
+				switch (word->_field1C) {
+				case 200:
+					if (word->proc10() == 2) {
+						delete word;
+						word = new TTpronoun(tempStr, WMODE_6, 601, 0, 5);
+					} else if (word->proc10() == 1) {
+						delete word;
+						word = new TTpronoun(tempStr, WMODE_6, 601, 0, 4);
+					}
+					break;
+
+				case 201:
+					delete word;
+					word = new TTpronoun(tempStr, WMODE_6, 601, 0, 5);
+					break;
+
+				case 202:
+				case 203:
+					if (word->proc10() == 2) {
+						delete word;
+						word = new TTpronoun(tempStr, WMODE_6, 601, 0, 5);
+					} else {
+						int val = word->proc10() == 1 ? 0 : 4;
+						delete word;
+						word = new TTpronoun(tempStr, WMODE_6, 601, 0, val);
+					}
+					break;
 
-		// TODO
+				case 204:
+					delete word;
+					word = new TTpronoun(tempStr, WMODE_6, 601, 0, 6);
+					break;
+
+				default:
+					delete word;
+					word = new TTpronoun(tempStr, WMODE_6, 601, 0, 0);
+					break;
+				}
+			}
+		}
 	}
 
-	// TODO
-	return nullptr;
+	if (word)
+		word->setSynStr(&str);
+
+	return word;
 }
 
 TTword *TTvocab::getPrefixedWord(TTstring &str) const {
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 13a40b0..0823e3d 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -30,14 +30,13 @@
 namespace Titanic {
 
 enum WordMode { 
-	WMODE_NONE = 0, WMODE_1 = 1, WMODE_2 = 2, WMODE_3 = 3,
-	WMODE_6 = 6, WMODE_8 = 8
+	WMODE_NONE = 0, WMODE_ACTION = 1, WMODE_2 = 2, WMODE_3 = 3,
+	WMODE_6 = 6, WMODE_8 = 8, WMODE_9 = 9
 };
 
 class TTword {
 protected:
 	TTstringStatus _status;
-	int _field1C;
 	int _field20;
 	int _field24;
 	int _field28;
@@ -54,6 +53,7 @@ public:
 	TTsynonym *_synP;
 	TTstring _string;
 	WordMode _wordMode;
+	int _field1C;
 public:
 	TTword(TTstring &str, WordMode mode, int val2);
 	TTword(TTword *src);


Commit: bb459dd5a8219e9f096c8ea52372f07484c2bf19
    https://github.com/scummvm/scummvm/commit/bb459dd5a8219e9f096c8ea52372f07484c2bf19
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:28-04:00

Commit Message:
TITANIC: Changed setSynStr parameter type

Changed paths:
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 2e5a7cc..66497a5 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -476,7 +476,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 	}
 
 	if (word)
-		word->setSynStr(&str);
+		word->setSynStr(str);
 
 	return word;
 }
@@ -538,7 +538,7 @@ TTword *TTvocab::getPrefixedWord(TTstring &str) const {
 	if (word) {
 		// Set the original word on either the found word or synonym
 		if (word->hasSynonyms())
-			word->setSynStr(&str);
+			word->setSynStr(str);
 		else
 			word->_string = str;
 	}
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index eebb161..bb9d63d 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -116,11 +116,11 @@ void TTword::setSyn(TTsynonym *synP) {
 	_synP = synP;
 }
 
-int TTword::setSynStr(TTstring *str) {
-	if (str->empty())
+int TTword::setSynStr(TTstring &str) {
+	if (str.empty())
 		return 4;
 
-	TTstring *newStr = new TTstring(*str);
+	TTstring *newStr = new TTstring(str);
 	TTsynonym *newSyn = new TTsynonym(4, newStr);
 	setSyn(newSyn);
 	return 0;
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 0823e3d..01482a9 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -77,7 +77,7 @@ public:
 	/**
 	 * Set a new synonym string
 	 */
-	int setSynStr(TTstring *str);
+	int setSynStr(TTstring &str);
 
 	/**
 	 * Returns true if synonyms have been set for the word


Commit: 378c96736a4ce86d6812886f7c06a3c6484b9de9
    https://github.com/scummvm/scummvm/commit/378c96736a4ce86d6812886f7c06a3c6484b9de9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:30-04:00

Commit Message:
TITANIC: Fields renaming

Changed paths:
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h
    engines/titanic/true_talk/tt_sentence_node.cpp
    engines/titanic/true_talk/tt_sentence_node.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 86cc99c..891a40f 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -51,7 +51,6 @@ class CScriptHandler {
 private:
 	CTitleEngine *_owner;
 	TTscriptBase *_script;
-	TTvocab *_vocab;
 	CExeResources &_resources;
 	int _field10;
 	CScriptHandlerSub1 _sub1;
@@ -63,6 +62,8 @@ private:
 	int _field2C;
 	int _field30;
 public:
+	TTvocab *_vocab;
+public:
 	CScriptHandler(CTitleEngine *owner, int val1, int val2);
 	~CScriptHandler();
 
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index efed166..787e976 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -478,8 +478,15 @@ int TTparser::findFrames(TTsentence *sentence) {
 		if (wordString.empty())
 			break;
 
-		//TTword *word = nullptr;
-		//_owner->_vocab.fn1(wordString, &word);
+		TTword *srcWord = nullptr;
+		TTword *word = _owner->_vocab->getWord(wordString, &word);
+		sentence->storeVocabHit(srcWord);
+
+		if (word) {
+			// TODO
+		} else {
+
+		}
 	}
 
 
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 2654a55..ca80888 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -87,7 +87,7 @@ void TTsentence::copyFrom(const TTsentence &src) {
 		// Source has processed nodes, so duplicate them
 		for (TTsentenceNode *node = src._nodesP; node;
 				node = static_cast<TTsentenceNode *>(node->_nextP)) {
-			TTsentenceNode *newNode = new TTsentenceNode(node->_val);
+			TTsentenceNode *newNode = new TTsentenceNode(node->_wordP);
 			if (_nodesP)
 				_nodesP->addNode(newNode);
 			else
@@ -96,4 +96,18 @@ void TTsentence::copyFrom(const TTsentence &src) {
 	}
 }
 
+int TTsentence::storeVocabHit(TTword *word) {
+	if (!word)
+		return 0;
+
+	TTsentenceNode *node = new TTsentenceNode(word);
+	if (_nodesP) {
+		_nodesP->addNode(node);
+	} else {
+		_nodesP = node;
+	}
+
+	return 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 042e055..998aad2 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -31,6 +31,7 @@
 namespace Titanic {
 
 class CScriptHandler;
+class TTword;
 
 class TTsentenceSubBase {
 public:
@@ -89,6 +90,13 @@ public:
 	void set38(int v) { _field38 = v; }
 
 	int getStatus() const { return _status; }
+
+	/**
+	 * Adds a found vocab word to the list of words representing
+	 * the player's input
+	 * @param word		Word to node
+	 */
+	int storeVocabHit(TTword *word);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence_node.cpp b/engines/titanic/true_talk/tt_sentence_node.cpp
index 2bec287..33d7501 100644
--- a/engines/titanic/true_talk/tt_sentence_node.cpp
+++ b/engines/titanic/true_talk/tt_sentence_node.cpp
@@ -25,10 +25,10 @@
 
 namespace Titanic {
 
-TTsentenceNode::TTsentenceNode() : TTnode(), _val(0) {
+TTsentenceNode::TTsentenceNode() : TTnode(), _wordP(nullptr) {
 }
 
-TTsentenceNode::TTsentenceNode(int val) : TTnode(), _val(val) {
+TTsentenceNode::TTsentenceNode(TTword *word) : TTnode(), _wordP(word) {
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence_node.h b/engines/titanic/true_talk/tt_sentence_node.h
index 09d106c..18fa56f 100644
--- a/engines/titanic/true_talk/tt_sentence_node.h
+++ b/engines/titanic/true_talk/tt_sentence_node.h
@@ -24,15 +24,16 @@
 #define TITANIC_TT_SENTENCE_NODE_H
 
 #include "titanic/true_talk/tt_node.h"
+#include "titanic/true_talk/tt_word.h"
 
 namespace Titanic {
 
 class TTsentenceNode : public TTnode {
 public:
-	int _val;
+	TTword *_wordP;
 public:
 	TTsentenceNode();
-	TTsentenceNode(int val);
+	TTsentenceNode(TTword *word);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index bb9d63d..c277b87 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -27,7 +27,7 @@
 namespace Titanic {
 
 TTword::TTword(TTstring &str, WordMode mode, int val2) : _string(str),
-		_wordMode(mode), _field1C(val2), _field20(0), _field24(0),
+		_wordMode(mode), _field1C(val2), _tag(0), _field24(0),
 		_field28(0), _synP(nullptr), _nextP(nullptr) {
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
 }
@@ -41,7 +41,7 @@ TTword::TTword(TTword *src) {
 	_string = src->_string;
 	_wordMode = src->_wordMode;
 	_field1C = src->_field1C;
-	_field20 = src->_field20;
+	_tag = src->_tag;
 	_synP = nullptr;
 
 	TTsynonym *priorSyn = nullptr;
@@ -140,7 +140,7 @@ int TTword::load(SimpleFile *file, WordMode mode) {
 	if (file->scanf("%d %s %s", &val, &str1, &str2)) {
 		_string = str1;
 		_field1C = val;
-		_field20 = readNumber(str2.c_str());
+		_tag = readNumber(str2.c_str());
 		_wordMode = mode;
 		return 0;
 	} else {
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 01482a9..9574bc3 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -37,7 +37,6 @@ enum WordMode {
 class TTword {
 protected:
 	TTstringStatus _status;
-	int _field20;
 	int _field24;
 	int _field28;
 protected:
@@ -54,6 +53,7 @@ public:
 	TTstring _string;
 	WordMode _wordMode;
 	int _field1C;
+	uint _tag;
 public:
 	TTword(TTstring &str, WordMode mode, int val2);
 	TTword(TTword *src);


Commit: 4d3ca910b7ba193eb118852380c2727747ed9eb6
    https://github.com/scummvm/scummvm/commit/4d3ca910b7ba193eb118852380c2727747ed9eb6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:33-04:00

Commit Message:
TITANIC: Added TTnode methods

Changed paths:
    engines/titanic/true_talk/tt_node.cpp
    engines/titanic/true_talk/tt_node.h



diff --git a/engines/titanic/true_talk/tt_node.cpp b/engines/titanic/true_talk/tt_node.cpp
index 22695ad..c72dfd3 100644
--- a/engines/titanic/true_talk/tt_node.cpp
+++ b/engines/titanic/true_talk/tt_node.cpp
@@ -38,6 +38,12 @@ void TTnode::addNode(TTnode *newNode) {
 	newNode->_priorP = this;
 }
 
+void TTnode::addToHead(TTnode *newNode) {
+	TTnode *head = getHead();
+	head->_priorP = newNode;
+	newNode->_nextP = head;
+}
+
 void TTnode::detach() {
 	if (_priorP)
 		_priorP->_nextP = _nextP;
@@ -58,6 +64,17 @@ void TTnode::deleteSiblings() {
 	}
 }
 
+TTnode *TTnode::getHead() {
+	if (_priorP == nullptr)
+		return this;
+
+	TTnode *node = _priorP;
+	while (node->_priorP)
+		node = node->_priorP;
+
+	return node;
+}
+
 TTnode *TTnode::getTail() {
 	if (_nextP == nullptr)
 		return this;
diff --git a/engines/titanic/true_talk/tt_node.h b/engines/titanic/true_talk/tt_node.h
index f8d1bc6..8faebae 100644
--- a/engines/titanic/true_talk/tt_node.h
+++ b/engines/titanic/true_talk/tt_node.h
@@ -39,6 +39,12 @@ public:
 	void addNode(TTnode *newNode);
 
 	/**
+	 * Adds a new node at the beginning of the linked list
+	 */
+	void addToHead(TTnode *newNode);
+
+
+	/**
 	 * Detaches a node from any predecessor and/or successor
 	 */
 	void detach();
@@ -49,6 +55,11 @@ public:
 	void deleteSiblings();
 
 	/**
+	 * Returns the first node at the beginning of a linked list of nodes
+	 */
+	TTnode *getHead();
+
+	/**
 	 * Returns the final node at the end of the linked list of nodes
 	 */
 	TTnode *getTail();


Commit: 2d83f5b13104fd173d7272bec63cb76d42c2153e
    https://github.com/scummvm/scummvm/commit/2d83f5b13104fd173d7272bec63cb76d42c2153e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:36-04:00

Commit Message:
TITANIC: Starting TTparser loadRequests

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 787e976..0d7c75c 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -23,15 +23,24 @@
 #include "titanic/true_talk/tt_parser.h"
 #include "titanic/true_talk/script_handler.h"
 #include "titanic/true_talk/tt_sentence.h"
+#include "titanic/true_talk/tt_word.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
 
 TTparser::TTparser(CScriptHandler *owner) : _owner(owner), _sentenceSub(nullptr),
-		_sentence(nullptr), _fieldC(0), _field10(0), _field14(0), _field18(0) {
+		_sentence(nullptr), _fieldC(0), _field10(0), _field14(0), _field18(0),
+		_nodesP(nullptr) {
 	loadArrays();
 }
 
+TTparser::~TTparser() {
+	if (_nodesP) {
+		_nodesP->deleteSiblings();
+		delete _nodesP;
+	}
+}
+
 void TTparser::loadArrays() {
 	Common::SeekableReadStream *r;
 	r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS1");
@@ -495,4 +504,25 @@ int TTparser::findFrames(TTsentence *sentence) {
 	return 0;
 }
 
+void TTparser::loadRequests(TTword *word) {
+	if (word->_tag != MKTAG('Z', 'Z', 'Z', 'T'))
+		addNode(word->_tag);
+
+	switch (word->_wordMode) {
+	case WMODE_NONE:
+		break;
+
+	case WMODE_ACTION:
+		break;
+	}
+	// TODO
+}
+
+void TTparser::addNode(uint tag) {
+	TTparserNode *newNode = new TTparserNode(tag);
+	if (_nodesP)
+		_nodesP->addToHead(newNode);
+	_nodesP = newNode;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 9ef84f9..96c54fb 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_TT_PARSER_H
 #define TITANIC_TT_PARSER_H
 
+#include "titanic/true_talk/tt_node.h"
 #include "titanic/true_talk/tt_sentence.h"
 #include "titanic/true_talk/tt_string.h"
 
@@ -43,6 +44,14 @@ struct NumberEntry {
 };
 typedef Common::Array<NumberEntry> NumberArray;
 
+class TTparserNode : public TTnode {
+public:
+	uint _tag;
+public:
+	TTparserNode() : TTnode(), _tag(0) {}
+	TTparserNode(uint tag) : TTnode(), _tag(tag) {}
+};
+
 class TTparser {
 private:
 	StringArray _replacements1;
@@ -50,6 +59,7 @@ private:
 	StringArray _replacements3;
 	StringArray _phrases;
 	NumberArray _numbers;
+	TTparserNode *_nodesP;
 private:
 	/**
 	 * Loads the various replacement string data arrays
@@ -112,6 +122,13 @@ private:
 	 * @returns				Pointer to matching number entry, if match occurred
 	 */
 	const NumberEntry *replaceNumbers2(TTstring &line, int *startIndex);
+
+	void loadRequests(TTword *word);
+
+	/**
+	 * Creates a new parser node, and adds it to the parser's list
+	 */
+	void addNode(uint tag);
 public:
 	CScriptHandler *_owner;
 	TTsentenceSub *_sentenceSub;
@@ -122,6 +139,7 @@ public:
 	int _field18;
 public:
 	TTparser(CScriptHandler *owner);
+	~TTparser();
 
 	/**
 	 * Preprocesses the passed input text, to handle things like lowercasing
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 9574bc3..333bfb5 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -31,7 +31,8 @@ namespace Titanic {
 
 enum WordMode { 
 	WMODE_NONE = 0, WMODE_ACTION = 1, WMODE_2 = 2, WMODE_3 = 3,
-	WMODE_6 = 6, WMODE_8 = 8, WMODE_9 = 9
+	WMODE_4 = 4, WMODE_5 = 5, WMODE_6 = 6, WMODE_7 = 7,
+	WMODE_8 = 8, WMODE_9 = 9
 };
 
 class TTword {


Commit: 1e35288fee100dd3ba5cac0a128cd2b6858381c1
    https://github.com/scummvm/scummvm/commit/1e35288fee100dd3ba5cac0a128cd2b6858381c1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:39-04:00

Commit Message:
TITANIC: Change TTnode addNode to addToTail

Changed paths:
    engines/titanic/true_talk/tt_node.cpp
    engines/titanic/true_talk/tt_node.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_word.cpp



diff --git a/engines/titanic/true_talk/tt_node.cpp b/engines/titanic/true_talk/tt_node.cpp
index c72dfd3..cbbb1dd 100644
--- a/engines/titanic/true_talk/tt_node.cpp
+++ b/engines/titanic/true_talk/tt_node.cpp
@@ -32,7 +32,7 @@ TTnode::~TTnode() {
 	detach();
 }
 
-void TTnode::addNode(TTnode *newNode) {
+void TTnode::addToTail(TTnode *newNode) {
 	TTnode *tail = getTail();
 	tail->_nextP = newNode;
 	newNode->_priorP = this;
diff --git a/engines/titanic/true_talk/tt_node.h b/engines/titanic/true_talk/tt_node.h
index 8faebae..36d4428 100644
--- a/engines/titanic/true_talk/tt_node.h
+++ b/engines/titanic/true_talk/tt_node.h
@@ -34,15 +34,14 @@ public:
 	virtual ~TTnode();
 
 	/**
-	 * Links the passed node to this node as a linked list
-	 */
-	void addNode(TTnode *newNode);
-
-	/**
 	 * Adds a new node at the beginning of the linked list
 	 */
 	void addToHead(TTnode *newNode);
 
+	/**
+	 * Links the passed node to this node as a linked list
+	 */
+	void addToTail(TTnode *newNode);
 
 	/**
 	 * Detaches a node from any predecessor and/or successor
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index ca80888..67e1a97 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -89,7 +89,7 @@ void TTsentence::copyFrom(const TTsentence &src) {
 				node = static_cast<TTsentenceNode *>(node->_nextP)) {
 			TTsentenceNode *newNode = new TTsentenceNode(node->_wordP);
 			if (_nodesP)
-				_nodesP->addNode(newNode);
+				_nodesP->addToTail(newNode);
 			else
 				_nodesP = newNode;
 		}
@@ -102,7 +102,7 @@ int TTsentence::storeVocabHit(TTword *word) {
 
 	TTsentenceNode *node = new TTsentenceNode(word);
 	if (_nodesP) {
-		_nodesP->addNode(node);
+		_nodesP->addToTail(node);
 	} else {
 		_nodesP = node;
 	}
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index c277b87..dc686b8 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -98,7 +98,7 @@ int TTword::readSyn(SimpleFile *file) {
 	if (_synP) {
 		// A synonym already exists, so add new one as a tail
 		// at the end of the linked list of synonyms
-		_synP->addNode(synNode);
+		_synP->addToTail(synNode);
 	} else {
 		// Very first synonym, so set it
 		_synP = synNode;
@@ -128,7 +128,7 @@ int TTword::setSynStr(TTstring &str) {
 
 void TTword::appendNode(TTsynonym *node) {
 	if (_synP)
-		_synP->addNode(node);
+		_synP->addToTail(node);
 	else
 		_synP = node;
 }


Commit: 49c9060bec57dbc90eff6f765bccd385f4985c61
    https://github.com/scummvm/scummvm/commit/49c9060bec57dbc90eff6f765bccd385f4985c61
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:41-04:00

Commit Message:
TITANIC: More implementation of TTparser loadRequests

Changed paths:
    engines/titanic/true_talk/tt_action.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_action.h b/engines/titanic/true_talk/tt_action.h
index 1103da8..213bdab 100644
--- a/engines/titanic/true_talk/tt_action.h
+++ b/engines/titanic/true_talk/tt_action.h
@@ -42,6 +42,7 @@ public:
 	int load(SimpleFile *file);
 
 	void setVal(int val) { _field30 = val; }
+	int getVal() const { return _field30; }
 
 	/**
 	 * Creates a copy of the word
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 0d7c75c..b81d3cc 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/true_talk/tt_parser.h"
 #include "titanic/true_talk/script_handler.h"
+#include "titanic/true_talk/tt_action.h"
 #include "titanic/true_talk/tt_sentence.h"
 #include "titanic/true_talk/tt_word.h"
 #include "titanic/titanic.h"
@@ -504,7 +505,9 @@ int TTparser::findFrames(TTsentence *sentence) {
 	return 0;
 }
 
-void TTparser::loadRequests(TTword *word) {
+int TTparser::loadRequests(TTword *word) {
+	int status = 0;
+
 	if (word->_tag != MKTAG('Z', 'Z', 'Z', 'T'))
 		addNode(word->_tag);
 
@@ -513,9 +516,127 @@ void TTparser::loadRequests(TTword *word) {
 		break;
 
 	case WMODE_ACTION:
+		if (word->_id != 0x70 && word->_id != 0x71)
+			addNode(1);
+		addNode(17);
+
+		switch (word->_id) {
+		case 101:
+		case 110:
+			addNode(5);
+			addNode(4);
+			break;
+
+		case 102:
+			addNode(4);
+			break;
+
+		case 103:
+		case 111:
+			addNode(8);
+			addNode(7);
+			addNode(5);
+			addNode(4);
+			break;
+
+		case 104:
+		case 107:
+			addNode(15);
+			addNode(5);
+			addNode(4);
+			break;
+
+		case 106:
+			addNode(7);
+			addNode(4);
+			break;
+
+		case 108:
+			addNode(5);
+			addNode(4);
+			addNode(23);
+			break;
+
+		case 112:
+		case 113:
+			addNode(13);
+			addNode(5);
+			break;
+
+		default:
+			break;
+		}
+
+		if (_sentenceSub) {
+			if (_sentenceSub->get18() == 0 || _sentenceSub->get18() == 2) {
+				TTaction *action = static_cast<TTaction *>(word);
+				_sentenceSub->set18(action->getVal());
+			}
+		}
+		break;
+
+	case WMODE_2:
+		if (word->checkTag() && _sentence->_field58 > 0)
+			_sentence->_field58--;
+		addNode(14);
+		break;
+
+	case WMODE_3:
+		switch (word->_id) {
+		case 300:
+			addNode(14);
+			status = 1;
+			break;
+
+		case 306:
+			addNode(23);
+			addNode(4);
+			break;
+
+		case 307:
+		case 308:
+			addNode(23);
+			break;
+
+		default:
+			break;
+		}
+
+		if (status != 1) {
+			addToConceptList(word);
+			addNode(14);
+		}
+		break;
+
+	case WMODE_4:
+		addNode(2);
+		status = 1;
+		break;
+
+	case WMODE_5:
+		if (_sentence->check2C()) {
+			_sentenceSub->_field1C = 1;
+			_sentenceSub = _sentenceSub->addSibling();
+			delete this;
+		} else {
+			addNode(23);
+		}
+		break;
+
+	case WMODE_6:
+		status = fn2(word);
+		break;
+
+	default:
 		break;
 	}
 	// TODO
+
+	return status;
+}
+
+void TTparser::addToConceptList(TTword *word) {
+	// TODO
 }
 
 void TTparser::addNode(uint tag) {
@@ -525,4 +646,32 @@ void TTparser::addNode(uint tag) {
 	_nodesP = newNode;
 }
 
+int TTparser::fn2(TTword *word) {
+	switch (word->_id) {
+	case 600:
+		addNode(13);
+		return 0;
+
+	case 601:
+		addNode(12);
+		return 1;
+
+	case 602:
+	case 607:
+		return checkReferent(static_cast<TTpronoun *>(word));
+
+	case 608:
+		return 1;
+
+	default:
+		return 0;
+	}
+	int checkReferent(TTpronoun *pronoun);
+}
+
+int TTparser::checkReferent(TTpronoun *pronoun) {
+	// TODO
+	return 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 96c54fb..07af2dd 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -24,6 +24,7 @@
 #define TITANIC_TT_PARSER_H
 
 #include "titanic/true_talk/tt_node.h"
+#include "titanic/true_talk/tt_pronoun.h"
 #include "titanic/true_talk/tt_sentence.h"
 #include "titanic/true_talk/tt_string.h"
 
@@ -123,12 +124,16 @@ private:
 	 */
 	const NumberEntry *replaceNumbers2(TTstring &line, int *startIndex);
 
-	void loadRequests(TTword *word);
+	int loadRequests(TTword *word);
+	void addToConceptList(TTword *word);
+	int fn2(TTword *word);
+	int checkReferent(TTpronoun *pronoun);
 
 	/**
 	 * Creates a new parser node, and adds it to the parser's list
 	 */
 	void addNode(uint tag);
+
 public:
 	CScriptHandler *_owner;
 	TTsentenceSub *_sentenceSub;
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 67e1a97..c383bd3 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -42,6 +42,18 @@ void TTsentenceSubBase::deleteSiblings() {
 
 /*------------------------------------------------------------------------*/
 
+TTsentenceSub *TTsentenceSub::addSibling() {
+	if (this == nullptr || _nextP != nullptr)
+		// This should never happen
+		return nullptr;
+
+	TTsentenceSub *nextP = new TTsentenceSub();
+	_nextP = nextP;
+	return nextP;
+}
+
+/*------------------------------------------------------------------------*/
+
 TTsentence::TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner,
 		TTroomScript *roomScript, TTnpcScript *npcScript) :
 		_owner(owner), _field2C(1), _inputCtr(inputCtr), _field34(0),
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 998aad2..902ad10 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -52,10 +52,20 @@ public:
 	 * Delete any sibling chain attached to this node
 	 */
 	void deleteSiblings();
+
+	void set18(int val) { _field18 = val; }
+	int get18() const { return _field18; }
+	bool is24() const { return _field24 == 0; }
 };
 
 class TTsentenceSub : public TTsentenceSubBase {
 public:
+	TTsentenceSub() : TTsentenceSubBase() {}
+
+	/**
+	 * Adds a new sibling instance
+	 */
+	TTsentenceSub *addSibling();
 };
 
 class TTsentence {
@@ -68,7 +78,6 @@ private:
 	TTsentenceNode *_nodesP;
 	TTroomScript *_roomScript;
 	TTnpcScript *_npcScript;
-	int _field58;
 	int _field5C;
 	int _status;
 private:
@@ -80,6 +89,7 @@ public:
 	TTsentenceSub _sub;
 	TTstring _initialLine;
 	TTstring _normalizedLine;
+	int _field58;
 public:
 	TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner,
 		TTroomScript *roomScript, TTnpcScript *npcScript);
@@ -88,6 +98,7 @@ public:
 
 	void set34(int v) { _field34 = v; }
 	void set38(int v) { _field38 = v; }
+	bool check2C() const { return _field2C > 1 && _field2C <= 10; }
 
 	int getStatus() const { return _status; }
 
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 66497a5..1ae7e1c 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -433,7 +433,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 				TTstring isStr("is");
 				word = getPrimeWord(isStr);
 			} else {
-				switch (word->_field1C) {
+				switch (word->_id) {
 				case 200:
 					if (word->proc10() == 2) {
 						delete word;
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index dc686b8..a0cb5df 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -26,8 +26,8 @@
 
 namespace Titanic {
 
-TTword::TTword(TTstring &str, WordMode mode, int val2) : _string(str),
-		_wordMode(mode), _field1C(val2), _tag(0), _field24(0),
+TTword::TTword(TTstring &str, WordMode mode, int id) : _string(str),
+		_wordMode(mode), _id(id), _tag(0), _field24(0),
 		_field28(0), _synP(nullptr), _nextP(nullptr) {
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
 }
@@ -40,7 +40,7 @@ TTword::TTword(TTword *src) {
 
 	_string = src->_string;
 	_wordMode = src->_wordMode;
-	_field1C = src->_field1C;
+	_id = src->_id;
 	_tag = src->_tag;
 	_synP = nullptr;
 
@@ -135,11 +135,11 @@ void TTword::appendNode(TTsynonym *node) {
 
 int TTword::load(SimpleFile *file, WordMode mode) {
 	CString str1, str2;
-	int val;
+	int id;
 
-	if (file->scanf("%d %s %s", &val, &str1, &str2)) {
+	if (file->scanf("%d %s %s", &id, &str1, &str2)) {
 		_string = str1;
-		_field1C = val;
+		_id = id;
 		_tag = readNumber(str2.c_str());
 		_wordMode = mode;
 		return 0;
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 333bfb5..010aa66 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -53,7 +53,7 @@ public:
 	TTsynonym *_synP;
 	TTstring _string;
 	WordMode _wordMode;
-	int _field1C;
+	int _id;
 	uint _tag;
 public:
 	TTword(TTstring &str, WordMode mode, int val2);


Commit: dacfbe6a0e08325d4ddb46937c30a2905d2b79de
    https://github.com/scummvm/scummvm/commit/dacfbe6a0e08325d4ddb46937c30a2905d2b79de
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:44-04:00

Commit Message:
TITANIC: Beginnings of TTconcept class

Changed paths:
  A engines/titanic/true_talk/tt_concept.cpp
  A engines/titanic/true_talk/tt_concept.h
    engines/titanic/module.mk
    engines/titanic/true_talk/tt_script_base.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 1568eb5..b3d1444 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -462,6 +462,7 @@ MODULE_OBJS := \
 	true_talk/true_talk_manager.o \
 	true_talk/tt_action.o \
 	true_talk/tt_adj.o \
+	true_talk/tt_concept.o \
 	true_talk/tt_hist.o \
 	true_talk/tt_major_word.o \
 	true_talk/tt_node.o \
diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
new file mode 100644
index 0000000..af0a148
--- /dev/null
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -0,0 +1,79 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_concept.h"
+#include "titanic/true_talk/tt_script_base.h"
+#include "titanic/true_talk/tt_word.h"
+
+namespace Titanic {
+
+TTconcept::TTconcept() {
+}
+
+TTconcept::TTconcept(TTscriptBase *script, ScriptType scriptType) :
+		_string1(" "), _string2(" "), _wordP(nullptr), _scriptP(nullptr) {
+	if (!script->getStatus()) {
+		setScriptType(scriptType);
+		_scriptP = script;
+
+		if (scriptType == ST_UNKNOWN_SCRIPT && script->_field8 == 1)
+			_scriptType = ST_ROOM_SCRIPT;
+	}
+
+	if (_status)
+		reset();
+}
+
+bool TTconcept::setStatus() {
+	if (_string1.isValid() && _string2.isValid()) {
+		_status = SS_VALID;
+		return true;
+	} else {
+		_status = SS_11;
+		return false;
+	}
+}
+
+void TTconcept::setScriptType(ScriptType scriptType) {
+	_field0 = 0;
+	_field14 = 0;
+	_scriptType = scriptType;
+	_field1C = -1;
+	_field20 = 0;
+	_field2C = 0;
+	_field30 = 0;
+	_field34 = 0;
+	_field38 = 0;
+	_status = 0;
+}
+
+void TTconcept::reset() {
+	delete _wordP;
+	_wordP = nullptr;
+	_scriptP = nullptr;
+
+	int oldStatus = _status;
+	setScriptType(ST_UNKNOWN_SCRIPT);
+	_status = oldStatus;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
new file mode 100644
index 0000000..08b748e
--- /dev/null
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -0,0 +1,74 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_CONCEPT_H
+#define TITANIC_TT_CONCEPT_H
+
+#include "titanic/true_talk/tt_string.h"
+
+namespace Titanic {
+
+enum ScriptType { ST_UNKNOWN_SCRIPT = 0, ST_ROOM_SCRIPT = 1, ST_NPC_SCRIPT = 2 };
+
+class TTscriptBase;
+class TTword;
+
+class TTconcept {
+private:
+	int _field0;
+	TTscriptBase *_scriptP;
+	TTword *_wordP;
+	TTstring _string1;
+	int _field14;
+	ScriptType _scriptType;
+	int _field1C;
+	int _field20;
+	TTstring _string2;
+	int _field2C;
+	int _field30;
+	int _field34;
+	int _field38;
+	int _status;
+private:
+	/**
+	 * Sets the status of the concept
+	 */
+	bool setStatus();
+
+	/**
+	 * Sets the script type and resets other fields
+	 */
+	void setScriptType(ScriptType scriptType);
+
+	/**
+	 * Resets the concept
+	 */
+	void reset();
+public:
+	TTconcept();
+	TTconcept(TTscriptBase *script, ScriptType scriptType);
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_CONCEPT_H */
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index ce83cd1..2b748db 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -40,7 +40,6 @@ private:
 	void reset();
 protected:
 	TTnode *_nodesP;
-	int _field8;
 	TThist *_hist;
 	TTstring _charName, _charClass;
 	int _field20;
@@ -56,6 +55,8 @@ protected:
 	int _field48;
 	int _status;
 public:
+	int _field8;
+public:
 	TTscriptBase(int v1, const char *charClass, int v2, const char *charName,
 		int v3, int v4, int v5, int v6, int v7);
 	virtual ~TTscriptBase();


Commit: 886b71048470986102ce2edf7baffc637134ac49
    https://github.com/scummvm/scummvm/commit/886b71048470986102ce2edf7baffc637134ac49
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:47-04:00

Commit Message:
TITANIC: Implemented TTparser checkReferent

Changed paths:
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/tt_concept.cpp
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_pronoun.h
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 891a40f..cf5eac1 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -50,7 +50,6 @@ public:
 class CScriptHandler {
 private:
 	CTitleEngine *_owner;
-	TTscriptBase *_script;
 	CExeResources &_resources;
 	int _field10;
 	CScriptHandlerSub1 _sub1;
@@ -63,6 +62,7 @@ private:
 	int _field30;
 public:
 	TTvocab *_vocab;
+	TTscriptBase *_script;
 public:
 	CScriptHandler(CTitleEngine *owner, int val1, int val2);
 	~CScriptHandler();
diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index af0a148..bc2da4c 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -43,6 +43,21 @@ TTconcept::TTconcept(TTscriptBase *script, ScriptType scriptType) :
 		reset();
 }
 
+TTconcept::TTconcept(TTword *word, ScriptType scriptType) :
+	_string1(" "), _string2(" "), _wordP(nullptr), _scriptP(nullptr) {
+	
+	if (!word || !setStatus() || word->getStatus()) {
+		_status = SS_5;
+	} else {
+		_status = initializeWordRef(word);
+		if (!_status)
+			setScriptType(scriptType);
+	}
+
+	if (_status)
+		reset();
+}
+
 bool TTconcept::setStatus() {
 	if (_string1.isValid() && _string2.isValid()) {
 		_status = SS_VALID;
@@ -54,7 +69,7 @@ bool TTconcept::setStatus() {
 }
 
 void TTconcept::setScriptType(ScriptType scriptType) {
-	_field0 = 0;
+	_nextP = nullptr;
 	_field14 = 0;
 	_scriptType = scriptType;
 	_field1C = -1;
@@ -66,6 +81,12 @@ void TTconcept::setScriptType(ScriptType scriptType) {
 	_status = 0;
 }
 
+int TTconcept::initializeWordRef(TTword *word) {
+	delete _wordP;
+	_wordP = word;
+	return 0;
+}
+
 void TTconcept::reset() {
 	delete _wordP;
 	_wordP = nullptr;
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 08b748e..787013e 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -34,7 +34,6 @@ class TTword;
 
 class TTconcept {
 private:
-	int _field0;
 	TTscriptBase *_scriptP;
 	TTword *_wordP;
 	TTstring _string1;
@@ -60,13 +59,20 @@ private:
 	void setScriptType(ScriptType scriptType);
 
 	/**
+	 * Sets up the concept for a word reference
+	 */
+	int initializeWordRef(TTword *word);
+
+	/**
 	 * Resets the concept
 	 */
 	void reset();
 public:
+	TTconcept *_nextP;
+public:
 	TTconcept();
 	TTconcept(TTscriptBase *script, ScriptType scriptType);
-
+	TTconcept(TTword *word, ScriptType scriptType);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index b81d3cc..9bc129b 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -23,6 +23,7 @@
 #include "titanic/true_talk/tt_parser.h"
 #include "titanic/true_talk/script_handler.h"
 #include "titanic/true_talk/tt_action.h"
+#include "titanic/true_talk/tt_concept.h"
 #include "titanic/true_talk/tt_sentence.h"
 #include "titanic/true_talk/tt_word.h"
 #include "titanic/titanic.h"
@@ -31,7 +32,7 @@ namespace Titanic {
 
 TTparser::TTparser(CScriptHandler *owner) : _owner(owner), _sentenceSub(nullptr),
 		_sentence(nullptr), _fieldC(0), _field10(0), _field14(0), _field18(0),
-		_nodesP(nullptr) {
+		_nodesP(nullptr), _conceptP(nullptr) {
 	loadArrays();
 }
 
@@ -646,6 +647,17 @@ void TTparser::addNode(uint tag) {
 	_nodesP = newNode;
 }
 
+int TTparser::addConcept(TTconcept *concept) {
+	if (!concept)
+		return SS_5;
+
+	if (_conceptP)
+		concept->_nextP = _conceptP;
+	_conceptP = concept;
+
+	return SS_VALID;
+}
+
 int TTparser::fn2(TTword *word) {
 	switch (word->_id) {
 	case 600:
@@ -670,7 +682,26 @@ int TTparser::fn2(TTword *word) {
 }
 
 int TTparser::checkReferent(TTpronoun *pronoun) {
-	// TODO
+	TTconcept *concept;
+
+	switch (pronoun->getVal()) {
+	case 0:
+		return 0;
+
+	case 1:
+		concept = new TTconcept(_owner->_script, ST_ROOM_SCRIPT);
+		break;
+
+	case 2:
+		concept = new TTconcept(_sentence->_npcScript, ST_NPC_SCRIPT);
+		break;
+
+	default:
+		concept = new TTconcept(pronoun, (ScriptType)pronoun->getVal());
+		break;
+	}
+
+	addConcept(concept);
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 07af2dd..7ad87cc 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -33,6 +33,7 @@ namespace Titanic {
 enum NumberFlag { NF_1 = 1, NF_2 = 2, NF_4 = 4, NF_8 = 8, NF_10 = 0x10 };
 
 class CScriptHandler;
+class TTconcept;
 
 struct NumberEntry {
 	CString _text;
@@ -61,6 +62,7 @@ private:
 	StringArray _phrases;
 	NumberArray _numbers;
 	TTparserNode *_nodesP;
+	TTconcept *_conceptP;
 private:
 	/**
 	 * Loads the various replacement string data arrays
@@ -134,6 +136,10 @@ private:
 	 */
 	void addNode(uint tag);
 
+	/**
+	 * Add a concept node
+	 */
+	int addConcept(TTconcept *concept);
 public:
 	CScriptHandler *_owner;
 	TTsentenceSub *_sentenceSub;
diff --git a/engines/titanic/true_talk/tt_pronoun.h b/engines/titanic/true_talk/tt_pronoun.h
index 5aa3e1e..bd80852 100644
--- a/engines/titanic/true_talk/tt_pronoun.h
+++ b/engines/titanic/true_talk/tt_pronoun.h
@@ -41,6 +41,8 @@ public:
 	 */
 	int load(SimpleFile *file);
 
+	int getVal() const { return _field30; }
+
 	/**
 	 * Creates a copy of the word
 	 */
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 902ad10..a757421 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -76,8 +76,6 @@ private:
 	int _field34;
 	int _field38;
 	TTsentenceNode *_nodesP;
-	TTroomScript *_roomScript;
-	TTnpcScript *_npcScript;
 	int _field5C;
 	int _status;
 private:
@@ -90,6 +88,8 @@ public:
 	TTstring _initialLine;
 	TTstring _normalizedLine;
 	int _field58;
+	TTroomScript *_roomScript;
+	TTnpcScript *_npcScript;
 public:
 	TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner,
 		TTroomScript *roomScript, TTnpcScript *npcScript);


Commit: 8668b37ef583962d9684adb9913289a0b6e71a97
    https://github.com/scummvm/scummvm/commit/8668b37ef583962d9684adb9913289a0b6e71a97
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:50-04:00

Commit Message:
TITANIC: Finished TTparser loadRequests

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 9bc129b..52be957 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -628,10 +628,92 @@ int TTparser::loadRequests(TTword *word) {
 		status = fn2(word);
 		break;
 
+	case WMODE_7:
+		switch (word->_id) {
+		case 700:
+			addNode(6);
+			addNode(5);
+			break;
+		case 701:
+			addNode(11);
+			break;
+		case 702:
+			status = 1;
+			break;
+		case 703:
+			addNode(9);
+			break;
+		case 704:
+			addNode(10);
+			break;
+		default:
+			break;
+		}
+
+	case WMODE_8:
+		if (word->_id == 304) {
+			// Nothing
+		} else if (word->_id == 801) {
+			addNode(22);
+		} else {
+			if (word->proc16())
+				_sentence->_field58++;
+			if (word->proc17())
+				_sentence->_field58++;
+		}
+		break;
+
+	case WMODE_9:
+		switch (word->_id) {
+		case 900:
+		case 901:
+		case 902:
+		case 904:
+			if (_sentence->_field2C == 9) {
+				_sentenceSub->_field1C = 1;
+				_sentenceSub = _sentenceSub->addSibling();
+				addNode(1);
+			}
+			else {
+				addNode(23);
+				addNode(13);
+				addNode(1);
+			}
+			break;
+
+		case 905:
+		case 907:
+		case 908:
+		case 909:
+			addNode(23);
+			break;
+
+		case 906:
+			addNode(23);
+			status = 1;
+			break;
+
+		case 910:
+			addNode(4);
+			addNode(24);
+			addNode(23);
+			addNode(14);
+			status = 1;
+			break;
+
+		default:
+			break;
+		}
+
+		if (word->_id == 906) {
+			addNode(14);
+			status = 1;
+		}
+		break;
+
 	default:
 		break;
 	}
-	// TODO
 
 	return status;
 }
@@ -678,7 +760,6 @@ int TTparser::fn2(TTword *word) {
 	default:
 		return 0;
 	}
-	int checkReferent(TTpronoun *pronoun);
 }
 
 int TTparser::checkReferent(TTpronoun *pronoun) {
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index a757421..fb060c1 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -71,7 +71,6 @@ public:
 class TTsentence {
 private:
 	CScriptHandler *_owner;
-	int _field2C;
 	int _inputCtr;
 	int _field34;
 	int _field38;
@@ -90,6 +89,7 @@ public:
 	int _field58;
 	TTroomScript *_roomScript;
 	TTnpcScript *_npcScript;
+	int _field2C;
 public:
 	TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner,
 		TTroomScript *roomScript, TTnpcScript *npcScript);


Commit: 87201eed1fcbd399934751a08143f259708796dc
    https://github.com/scummvm/scummvm/commit/87201eed1fcbd399934751a08143f259708796dc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:53-04:00

Commit Message:
TITANIC: Added TTparser addToConceptList

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 52be957..2ee080d 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -718,8 +718,14 @@ int TTparser::loadRequests(TTword *word) {
 	return status;
 }
 
-void TTparser::addToConceptList(TTword *word) {
+int TTparser::considerRequests(TTword *word) {
 	// TODO
+	return 0;
+}
+
+void TTparser::addToConceptList(TTword *word) {
+	TTconcept *concept = new TTconcept(word, ST_UNKNOWN_SCRIPT);
+	addConcept(concept);
 }
 
 void TTparser::addNode(uint tag) {
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 7ad87cc..461bcc2 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -127,6 +127,8 @@ private:
 	const NumberEntry *replaceNumbers2(TTstring &line, int *startIndex);
 
 	int loadRequests(TTword *word);
+	int considerRequests(TTword *word);
+
 	void addToConceptList(TTword *word);
 	int fn2(TTword *word);
 	int checkReferent(TTpronoun *pronoun);


Commit: 39a12288bb8343c25f244162a32e744a4fed9f6e
    https://github.com/scummvm/scummvm/commit/39a12288bb8343c25f244162a32e744a4fed9f6e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:56-04:00

Commit Message:
TITANIC: Start of considerRequests

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 2ee080d..9316a90 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -719,8 +719,81 @@ int TTparser::loadRequests(TTword *word) {
 }
 
 int TTparser::considerRequests(TTword *word) {
+	if (_nodesP)
+		return 0;
+
+	TTparserNode *nodeP = _nodesP;
+	TTconcept *concept = nullptr;
+	int status = 0;
+	bool flag = false;
+
+	while (word) {
+		int ecx = 906;
+		int edx = 12;
+
+		if (nodeP->_tag == MKTAG('C', 'O', 'M', 'E')) {
+			addNode(7);
+			addNode(5);
+			addNode(21);
+
+			if (!_sentence->_field2C)
+				_sentence->_field2C = 15;
+		} else if (nodeP->_tag == MKTAG('C', 'U', 'R', 'S') ||
+				nodeP->_tag == MKTAG('S', 'E', 'X', 'X')) {
+			if (_sentence->_field58 > 1)
+				_sentence->_field58--;
+			flag = true;
+
+		} else if (nodeP->_tag == MKTAG('E', 'X', 'I', 'T')) {
+			addNode(8);
+			addNode(5);
+			addNode(21);
+
+			if (!_sentence->_field2C)
+				_sentence->_field2C = 14;
+
+
+		} else if (nodeP->_tag < MKTAG('C', 'O', 'M', 'E')) {
+			if (_sentence->_field58 > 1)
+				_sentence->_field58--;
+			flag = true;
+		} else {
+			switch (nodeP->_tag) {
+			case CHECK_COMMAND_FORM:
+				if (_sentenceSub->_field4 && _sentence->_field2C == 1 &&
+						!_sentenceSub->_conceptP) {
+					concept = new TTconcept(_sentence->_npcScript, ST_NPC_SCRIPT);
+					_sentenceSub->_conceptP = concept;
+					_sentenceSub->_field18 = 3;
+				}
+
+				flag = true;
+				break;
+
+			case 2:
+				if (!word->_wordMode) {
+					word->_wordMode = WMODE_2;
+					addToConceptList(word);
+					addNode(14);
+				}
+
+				flag = true;
+				break;
+
+			case 3:
+				// TODO
+				//flag = _sentenceSub
+				break;
+
+			default:
+				break;
+			}
+		}
+	}
+
 	// TODO
-	return 0;
+	delete concept;
+	return status;
 }
 
 void TTparser::addToConceptList(TTword *word) {
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 461bcc2..6b490f8 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -32,6 +32,10 @@ namespace Titanic {
 
 enum NumberFlag { NF_1 = 1, NF_2 = 2, NF_4 = 4, NF_8 = 8, NF_10 = 0x10 };
 
+enum ParserTag {
+	CHECK_COMMAND_FORM = 1
+};
+
 class CScriptHandler;
 class TTconcept;
 
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index c383bd3..40e3bb0 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -25,9 +25,9 @@
 
 namespace Titanic {
 
-TTsentenceSubBase::TTsentenceSubBase() : _field0(0), _field4(0), _field8(0),
-	_fieldC(0), _field10(0), _field14(0), _field18(0), _field1C(0),
-	_nextP(nullptr), _field24(0) {
+TTsentenceSubBase::TTsentenceSubBase() : _conceptP(nullptr), _field4(0),
+	_field8(0), _fieldC(0), _field10(0), _field14(0), _field18(0),
+	_field1C(0), _nextP(nullptr), _field24(0) {
 }
 
 void TTsentenceSubBase::deleteSiblings() {
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index fb060c1..e6d0d0c 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -31,11 +31,12 @@
 namespace Titanic {
 
 class CScriptHandler;
+class TTconcept;
 class TTword;
 
 class TTsentenceSubBase {
 public:
-	int _field0;
+	TTconcept *_conceptP;
 	int _field4;
 	int _field8;
 	int _fieldC;


Commit: 59796e03e4d2d366a3a6f4d00738fe9795b4fce3
    https://github.com/scummvm/scummvm/commit/59796e03e4d2d366a3a6f4d00738fe9795b4fce3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:13:59-04:00

Commit Message:
TITANIC: Change WordMode to WordClass and flesh it out

Changed paths:
    engines/titanic/true_talk/tt_action.cpp
    engines/titanic/true_talk/tt_action.h
    engines/titanic/true_talk/tt_adj.cpp
    engines/titanic/true_talk/tt_adj.h
    engines/titanic/true_talk/tt_major_word.cpp
    engines/titanic/true_talk/tt_major_word.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_picture.cpp
    engines/titanic/true_talk/tt_picture.h
    engines/titanic/true_talk/tt_pronoun.cpp
    engines/titanic/true_talk/tt_pronoun.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_action.cpp b/engines/titanic/true_talk/tt_action.cpp
index e0c7284..bb30e9c 100644
--- a/engines/titanic/true_talk/tt_action.cpp
+++ b/engines/titanic/true_talk/tt_action.cpp
@@ -26,8 +26,8 @@ namespace Titanic {
 
 bool TTaction::_staticFlag;
 
-TTaction::TTaction(TTstring &str, WordMode mode, int val2, int val3, int val4) :
-		TTmajorWord(str, mode, val2, val3), _field30(val4) {
+TTaction::TTaction(TTstring &str, WordClass wordClass, int val2, int val3, int val4) :
+		TTmajorWord(str, wordClass, val2, val3), _field30(val4) {
 }
 
 TTaction::TTaction(TTaction *src) : TTmajorWord(src) {
@@ -42,7 +42,7 @@ TTaction::TTaction(TTaction *src) : TTmajorWord(src) {
 int TTaction::load(SimpleFile *file) {
 	int val;
 
-	if (!TTword::load(file, WMODE_ACTION) && file->scanf("%d", &val)) {
+	if (!TTword::load(file, WC_ACTION) && file->scanf("%d", &val)) {
 		_field30 = val;
 		return 0;
 	} else {
diff --git a/engines/titanic/true_talk/tt_action.h b/engines/titanic/true_talk/tt_action.h
index 213bdab..0bd1049 100644
--- a/engines/titanic/true_talk/tt_action.h
+++ b/engines/titanic/true_talk/tt_action.h
@@ -33,7 +33,7 @@ private:
 protected:
 	int _field30;
 public:
-	TTaction(TTstring &str, WordMode mode, int val2, int val3, int val4);
+	TTaction(TTstring &str, WordClass wordClass, int val2, int val3, int val4);
 	TTaction(TTaction *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_adj.cpp b/engines/titanic/true_talk/tt_adj.cpp
index 850692f..5659ed2 100644
--- a/engines/titanic/true_talk/tt_adj.cpp
+++ b/engines/titanic/true_talk/tt_adj.cpp
@@ -26,8 +26,8 @@ namespace Titanic {
 
 bool TTadj::_staticFlag;
 
-TTadj::TTadj(TTstring &str, WordMode mode, int val2, int val3, int val4) :
-		TTmajorWord(str, mode, val2, val3) {
+TTadj::TTadj(TTstring &str, WordClass wordClass, int val2, int val3, int val4) :
+		TTmajorWord(str, wordClass, val2, val3) {
 	if (val4 >= 0 && val4 <= 9) {
 		_field30 = val4;
 	} else {
@@ -48,7 +48,7 @@ TTadj::TTadj(TTadj *src) : TTmajorWord(src) {
 int TTadj::load(SimpleFile *file) {
 	int val;
 
-	if (!TTword::load(file, WMODE_8) && file->scanf("%d", &val)) {
+	if (!TTword::load(file, WC_ADJECTIVE) && file->scanf("%d", &val)) {
 		_field30 = val;
 		return 0;
 	} else {
diff --git a/engines/titanic/true_talk/tt_adj.h b/engines/titanic/true_talk/tt_adj.h
index f18d249..7dab02d 100644
--- a/engines/titanic/true_talk/tt_adj.h
+++ b/engines/titanic/true_talk/tt_adj.h
@@ -33,7 +33,7 @@ private:
 protected:
 	int _field30;
 public:
-	TTadj(TTstring &str, WordMode mode, int val2, int val3, int val4);
+	TTadj(TTstring &str, WordClass wordClass, int val2, int val3, int val4);
 	TTadj(TTadj *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_major_word.cpp b/engines/titanic/true_talk/tt_major_word.cpp
index b81ada4..28b9434 100644
--- a/engines/titanic/true_talk/tt_major_word.cpp
+++ b/engines/titanic/true_talk/tt_major_word.cpp
@@ -26,8 +26,8 @@ namespace Titanic {
 
 bool TTmajorWord::_staticFlag;
 
-TTmajorWord::TTmajorWord(TTstring &str, WordMode mode, int val2, int val3) :
-		TTword(str, mode, val2), _field2C(val3) {
+TTmajorWord::TTmajorWord(TTstring &str, WordClass wordClass, int val2, int val3) :
+		TTword(str, wordClass, val2), _field2C(val3) {
 }
 
 TTmajorWord::TTmajorWord(TTmajorWord *src) : TTword(src) {
diff --git a/engines/titanic/true_talk/tt_major_word.h b/engines/titanic/true_talk/tt_major_word.h
index 55eb882..716ccf1 100644
--- a/engines/titanic/true_talk/tt_major_word.h
+++ b/engines/titanic/true_talk/tt_major_word.h
@@ -38,7 +38,7 @@ protected:
 	 */
 	int saveData(SimpleFile *file, int val) const;
 public:
-	TTmajorWord(TTstring &str, WordMode mode, int val2, int val3);
+	TTmajorWord(TTstring &str, WordClass wordClass, int val2, int val3);
 	TTmajorWord(TTmajorWord *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 9316a90..1a2944d 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -512,11 +512,11 @@ int TTparser::loadRequests(TTword *word) {
 	if (word->_tag != MKTAG('Z', 'Z', 'Z', 'T'))
 		addNode(word->_tag);
 
-	switch (word->_wordMode) {
-	case WMODE_NONE:
+	switch (word->_wordClass) {
+	case WC_UNKNOWN:
 		break;
 
-	case WMODE_ACTION:
+	case WC_ACTION:
 		if (word->_id != 0x70 && word->_id != 0x71)
 			addNode(1);
 		addNode(17);
@@ -576,13 +576,13 @@ int TTparser::loadRequests(TTword *word) {
 		}
 		break;
 
-	case WMODE_2:
+	case WC_THING:
 		if (word->checkTag() && _sentence->_field58 > 0)
 			_sentence->_field58--;
 		addNode(14);
 		break;
 
-	case WMODE_3:
+	case WC_ABSTRACT:
 		switch (word->_id) {
 		case 300:
 			addNode(14);
@@ -609,12 +609,12 @@ int TTparser::loadRequests(TTword *word) {
 		}
 		break;
 
-	case WMODE_4:
+	case WC_ARTICLE:
 		addNode(2);
 		status = 1;
 		break;
 
-	case WMODE_5:
+	case WC_CONJUNCTION:
 		if (_sentence->check2C()) {
 			_sentenceSub->_field1C = 1;
 			_sentenceSub = _sentenceSub->addSibling();
@@ -624,11 +624,11 @@ int TTparser::loadRequests(TTword *word) {
 		}
 		break;
 
-	case WMODE_6:
+	case WC_PRONOUN:
 		status = fn2(word);
 		break;
 
-	case WMODE_7:
+	case WC_PREPOSITION:
 		switch (word->_id) {
 		case 700:
 			addNode(6);
@@ -650,7 +650,7 @@ int TTparser::loadRequests(TTword *word) {
 			break;
 		}
 
-	case WMODE_8:
+	case WC_ADJECTIVE:
 		if (word->_id == 304) {
 			// Nothing
 		} else if (word->_id == 801) {
@@ -663,7 +663,7 @@ int TTparser::loadRequests(TTword *word) {
 		}
 		break;
 
-	case WMODE_9:
+	case WC_ADVERB:
 		switch (word->_id) {
 		case 900:
 		case 901:
@@ -771,8 +771,8 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case 2:
-				if (!word->_wordMode) {
-					word->_wordMode = WMODE_2;
+				if (!word->_wordClass) {
+					word->_wordClass = WC_THING;
 					addToConceptList(word);
 					addNode(14);
 				}
diff --git a/engines/titanic/true_talk/tt_picture.cpp b/engines/titanic/true_talk/tt_picture.cpp
index aab9c5d..59ff6c7 100644
--- a/engines/titanic/true_talk/tt_picture.cpp
+++ b/engines/titanic/true_talk/tt_picture.cpp
@@ -26,8 +26,8 @@ namespace Titanic {
 
 bool TTpicture::_staticFlag;
 
-TTpicture::TTpicture(TTstring &str, WordMode mode, int val2, int val3, int val4, int val5, int val6) :
-		TTmajorWord(str, mode, val2, val4), _tag(val3), _field30(val5), _field3C(val6),
+TTpicture::TTpicture(TTstring &str, WordClass wordClass, int val2, int val3, int val4, int val5, int val6) :
+		TTmajorWord(str, wordClass, val2, val4), _tag(val3), _field30(val5), _field3C(val6),
 		_field38(0) {
 }
 
@@ -50,7 +50,7 @@ int TTpicture::load(SimpleFile *file) {
 	CString str;
 	int val1, val2;
 
-	if (!TTword::load(file, WMODE_2) && file->scanf("%s %d %d", &str, &val1, &val2)) {
+	if (!TTword::load(file, WC_THING) && file->scanf("%s %d %d", &str, &val1, &val2)) {
 		_tag = readNumber(str.c_str());
 		_field30 = val1;
 		_field3C = val2;
diff --git a/engines/titanic/true_talk/tt_picture.h b/engines/titanic/true_talk/tt_picture.h
index 404d9c4..71beefe 100644
--- a/engines/titanic/true_talk/tt_picture.h
+++ b/engines/titanic/true_talk/tt_picture.h
@@ -36,7 +36,7 @@ protected:
 	int _field38;
 	int _field3C;
 public:
-	TTpicture(TTstring &str, WordMode mode, int val2, int val3, int val4, int val5, int val6);
+	TTpicture(TTstring &str, WordClass wordClass, int val2, int val3, int val4, int val5, int val6);
 	TTpicture(TTpicture *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_pronoun.cpp b/engines/titanic/true_talk/tt_pronoun.cpp
index 68fcef0..9b6692e 100644
--- a/engines/titanic/true_talk/tt_pronoun.cpp
+++ b/engines/titanic/true_talk/tt_pronoun.cpp
@@ -26,8 +26,8 @@ namespace Titanic {
 
 bool TTpronoun::_staticFlag;
 
-TTpronoun::TTpronoun(TTstring &str, WordMode mode, int val2, int val3, int val4) :
-		TTmajorWord(str, mode, val2, val3), _field30(val4) {
+TTpronoun::TTpronoun(TTstring &str, WordClass wordClass, int val2, int val3, int val4) :
+		TTmajorWord(str, wordClass, val2, val3), _field30(val4) {
 }
 
 TTpronoun::TTpronoun(TTpronoun *src) : TTmajorWord(src) {
@@ -42,7 +42,7 @@ TTpronoun::TTpronoun(TTpronoun *src) : TTmajorWord(src) {
 int TTpronoun::load(SimpleFile *file) {
 	int val;
 
-	if (!TTword::load(file, WMODE_6) && file->scanf("%d", &val)) {
+	if (!TTword::load(file, WC_PRONOUN) && file->scanf("%d", &val)) {
 		if (val >= 0 && val <= 12) {
 			_field30 = val;
 			return 0;
diff --git a/engines/titanic/true_talk/tt_pronoun.h b/engines/titanic/true_talk/tt_pronoun.h
index bd80852..0d9466c 100644
--- a/engines/titanic/true_talk/tt_pronoun.h
+++ b/engines/titanic/true_talk/tt_pronoun.h
@@ -33,7 +33,7 @@ private:
 protected:
 	int _field30;
 public:
-	TTpronoun(TTstring &str, WordMode mode, int val2, int val3, int val4);
+	TTpronoun(TTstring &str, WordClass wordClass, int val2, int val3, int val4);
 	TTpronoun(TTpronoun *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 1ae7e1c..eb3d523 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -52,57 +52,57 @@ int TTvocab::load(const CString &name) {
 
 	while (!result && !file->eos()) {
 		skipFlag = false;
-		WordMode mode = (WordMode)file->readNumber();
+		WordClass wordClass = (WordClass)file->readNumber();
 		TTstring space(" ");
 
-		switch (mode) {
-		case 0: {
+		switch (wordClass) {
+		case WC_UNKNOWN: {
 			if (_word)
 				result = _word->readSyn(file);
 			skipFlag = true;
 			break;
 		}
 
-		case 1: {
-			TTaction *word = new TTaction(space, WMODE_NONE, 0, 0, 0);
+		case WC_ACTION: {
+			TTaction *word = new TTaction(space, WC_UNKNOWN, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
 		}
 
-		case 2: {
-			TTpicture *word = new TTpicture(space, WMODE_NONE, 0, 0, 0, 0, 0);
+		case WC_THING: {
+			TTpicture *word = new TTpicture(space, WC_UNKNOWN, 0, 0, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
 		}
 
-		case 3:
-		case 9: {
-			TTmajorWord *word = new TTmajorWord(space, WMODE_NONE, 0, 0);
-			result = word->load(file, mode);
+		case WC_ABSTRACT:
+		case WC_ADVERB: {
+			TTmajorWord *word = new TTmajorWord(space, WC_UNKNOWN, 0, 0);
+			result = word->load(file, wordClass);
 			_word = word;
 			break;
 		}
 
-		case 4:
-		case 5:
-		case 7: {
-			TTword *word = new TTword(space, WMODE_NONE, 0);
-			result = word->load(file, mode);
+		case WC_ARTICLE:
+		case WC_CONJUNCTION:
+		case WC_PREPOSITION: {
+			TTword *word = new TTword(space, WC_UNKNOWN, 0);
+			result = word->load(file, wordClass);
 			_word = word;
 			break;
 		}
 
-		case 8: {
-			TTadj *word = new TTadj(space, WMODE_NONE, 0, 0, 0);
+		case WC_ADJECTIVE: {
+			TTadj *word = new TTadj(space, WC_UNKNOWN, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
 		}
 
-		case 6: {
-			TTpronoun *word = new TTpronoun(space, WMODE_NONE, 0, 0, 0);
+		case WC_PRONOUN: {
+			TTpronoun *word = new TTpronoun(space, WC_UNKNOWN, 0, 0, 0);
 			result = word->load(file);
 			_word = word;
 			break;
@@ -198,7 +198,7 @@ TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const {
 
 	if (!Common::isDigit(c)) {
 		vocabP = _headP;
-		newWord = new TTword(str, WMODE_3, 300);
+		newWord = new TTword(str, WC_ABSTRACT, 300);
 	} else {
 		for (vocabP = _headP; vocabP && !newWord; vocabP = vocabP->_nextP) {
 			if (_vocabMode == 3 && !strcmp(str.c_str(), vocabP->c_str())) {
@@ -246,30 +246,30 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 		word = getPrimeWord(tempStr);
 
 		if (word) {
-			if (word->_wordMode == 1) {
+			if (word->_wordClass == 1) {
 				delete word;
 				word = nullptr;
 			} else {
 				delete word;
-				word = new TTadj(str, WMODE_8, 0, 0, 0);
+				word = new TTadj(str, WC_ADJECTIVE, 0, 0, 0);
 			}
 		} else {
 			tempStr += "e";
 			word = getPrimeWord(tempStr);
 
 			if (word) {
-				if (word->_wordMode != 1) {
+				if (word->_wordClass != 1) {
 					delete word;
-					word = new TTadj(str, WMODE_8, 0, 0, 0);
+					word = new TTadj(str, WC_ADJECTIVE, 0, 0, 0);
 				}
 			} else {
 				tempStr.deleteSuffix(2);
 				word = getPrimeWord(tempStr);
 
 				if (word) {
-					if (word->_wordMode != 1) {
+					if (word->_wordClass != 1) {
 						delete word;
-						word = new TTadj(str, WMODE_8, 0, 0, 0);
+						word = new TTadj(str, WC_ADJECTIVE, 0, 0, 0);
 					}
 				} else {
 					tempStr = str;
@@ -287,7 +287,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 		}
 
 		if (word) {
-			if (word->_wordMode == WMODE_ACTION) {
+			if (word->_wordClass == WC_ACTION) {
 				static_cast<TTaction *>(word)->setVal(1);
 			}
 		} else {
@@ -300,7 +300,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 
 		if (word) {
 			delete word;
-			word = new TTword(str, WMODE_9, 0);
+			word = new TTword(str, WC_ADVERB, 0);
 		} else {
 			tempStr = str;
 		}
@@ -310,7 +310,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 		word = getPrimeWord(tempStr);
 
 		if (word) {
-			if (word->_wordMode == WMODE_8) {
+			if (word->_wordClass == WC_ADJECTIVE) {
 				int val1 = word->proc15();
 				int val2 = word->proc15();
 
@@ -329,7 +329,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 			word = getPrimeWord(tempStr);
 
 			if (word) {
-				if (word->_wordMode == WMODE_8) {
+				if (word->_wordClass == WC_ADJECTIVE) {
 					int val1 = word->proc15();
 					int val2 = word->proc15();
 
@@ -347,7 +347,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 				tempStr.deleteSuffix(1);
 				word = getPrimeWord(tempStr);
 
-				if (word && word->_wordMode == WMODE_8) {
+				if (word && word->_wordClass == WC_ADJECTIVE) {
 					int val1 = word->proc15();
 					int val2 = word->proc15();
 
@@ -369,7 +369,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 		word = getPrimeWord(tempStr);
 
 		if (word) {
-			if (word->_wordMode == WMODE_8) {
+			if (word->_wordClass == WC_ADJECTIVE) {
 				int val1 = word->proc15();
 				int val2 = word->proc15();
 
@@ -388,7 +388,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 			word = getPrimeWord(tempStr);
 
 			if (word) {
-				if (word->_wordMode == WMODE_8) {
+				if (word->_wordClass == WC_ADJECTIVE) {
 					int val1 = word->proc15();
 					int val2 = word->proc15();
 
@@ -428,7 +428,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 		word = getPrimeWord(tempStr);
 
 		if (word) {
-			if (word->_wordMode == WMODE_6 || word->_wordMode == WMODE_9) {
+			if (word->_wordClass == WC_PRONOUN || word->_wordClass == WC_ADVERB) {
 				delete word;
 				TTstring isStr("is");
 				word = getPrimeWord(isStr);
@@ -437,38 +437,38 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 				case 200:
 					if (word->proc10() == 2) {
 						delete word;
-						word = new TTpronoun(tempStr, WMODE_6, 601, 0, 5);
+						word = new TTpronoun(tempStr, WC_PRONOUN, 601, 0, 5);
 					} else if (word->proc10() == 1) {
 						delete word;
-						word = new TTpronoun(tempStr, WMODE_6, 601, 0, 4);
+						word = new TTpronoun(tempStr, WC_PRONOUN, 601, 0, 4);
 					}
 					break;
 
 				case 201:
 					delete word;
-					word = new TTpronoun(tempStr, WMODE_6, 601, 0, 5);
+					word = new TTpronoun(tempStr, WC_PRONOUN, 601, 0, 5);
 					break;
 
 				case 202:
 				case 203:
 					if (word->proc10() == 2) {
 						delete word;
-						word = new TTpronoun(tempStr, WMODE_6, 601, 0, 5);
+						word = new TTpronoun(tempStr, WC_PRONOUN, 601, 0, 5);
 					} else {
 						int val = word->proc10() == 1 ? 0 : 4;
 						delete word;
-						word = new TTpronoun(tempStr, WMODE_6, 601, 0, val);
+						word = new TTpronoun(tempStr, WC_PRONOUN, 601, 0, val);
 					}
 					break;
 
 				case 204:
 					delete word;
-					word = new TTpronoun(tempStr, WMODE_6, 601, 0, 6);
+					word = new TTpronoun(tempStr, WC_PRONOUN, 601, 0, 6);
 					break;
 
 				default:
 					delete word;
-					word = new TTpronoun(tempStr, WMODE_6, 601, 0, 0);
+					word = new TTpronoun(tempStr, WC_PRONOUN, 601, 0, 0);
 					break;
 				}
 			}
@@ -510,7 +510,7 @@ TTword *TTvocab::getPrefixedWord(TTstring &str) const {
 		word = getPrimeWord(tempStr);
 		if (!word)
 			tempStr = str;
-		else if (word->_wordMode == 8) {
+		else if (word->_wordClass == 8) {
 			delete word;
 			word = nullptr;
 		}
@@ -522,7 +522,7 @@ TTword *TTvocab::getPrefixedWord(TTstring &str) const {
 
 		if (!word)
 			tempStr = str;
-		else if (word->_wordMode == 8) {
+		else if (word->_wordClass == 8) {
 			int val1 = word->proc15();
 			int val2 = word->proc15();
 
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index a0cb5df..028ee81 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -26,8 +26,8 @@
 
 namespace Titanic {
 
-TTword::TTword(TTstring &str, WordMode mode, int id) : _string(str),
-		_wordMode(mode), _id(id), _tag(0), _field24(0),
+TTword::TTword(TTstring &str, WordClass wordClass, int id) : _string(str),
+		_wordClass(wordClass), _id(id), _tag(0), _field24(0),
 		_field28(0), _synP(nullptr), _nextP(nullptr) {
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
 }
@@ -39,7 +39,7 @@ TTword::TTword(TTword *src) {
 	}
 
 	_string = src->_string;
-	_wordMode = src->_wordMode;
+	_wordClass = src->_wordClass;
 	_id = src->_id;
 	_tag = src->_tag;
 	_synP = nullptr;
@@ -133,7 +133,7 @@ void TTword::appendNode(TTsynonym *node) {
 		_synP = node;
 }
 
-int TTword::load(SimpleFile *file, WordMode mode) {
+int TTword::load(SimpleFile *file, WordClass wordClass) {
 	CString str1, str2;
 	int id;
 
@@ -141,7 +141,7 @@ int TTword::load(SimpleFile *file, WordMode mode) {
 		_string = str1;
 		_id = id;
 		_tag = readNumber(str2.c_str());
-		_wordMode = mode;
+		_wordClass = wordClass;
 		return 0;
 	} else {
 		return 3;
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 010aa66..fa7f31e 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -29,10 +29,18 @@
 
 namespace Titanic {
 
-enum WordMode { 
-	WMODE_NONE = 0, WMODE_ACTION = 1, WMODE_2 = 2, WMODE_3 = 3,
-	WMODE_4 = 4, WMODE_5 = 5, WMODE_6 = 6, WMODE_7 = 7,
-	WMODE_8 = 8, WMODE_9 = 9
+enum WordClass { 
+	WC_UNKNOWN = 0, WC_ACTION = 1, WC_THING = 2, WC_ABSTRACT = 3,
+	WC_ARTICLE = 4, WC_CONJUNCTION = 5, WC_PRONOUN = 6,
+	WC_PREPOSITION = 7, WC_ADJECTIVE = 8, WC_ADVERB = 9,
+	WC_UNK_ACTION = 10,
+	WC_ATRANS = 11,		// transfer possession, eg: give/take
+	WC_PTRANS = 12,		// physical transfer, eg: go
+	WC_PROPEL = 13,		// act of applying a force, eg: hit
+	WC_MTRANS = 14,		// mental transfer, eg: see, hear
+	WC_BUILD = 15, WC_ATTEND = 16, WC_SPEAK = 17, WC_GRASP = 18,
+	WC_MOVE = 19, WC_INGEST = 20, WC_EXPEL = 21, WC_STRANS = 22,
+	WC_ISA = 23
 };
 
 class TTword {
@@ -52,11 +60,11 @@ public:
 	TTword *_nextP;
 	TTsynonym *_synP;
 	TTstring _string;
-	WordMode _wordMode;
+	WordClass _wordClass;
 	int _id;
 	uint _tag;
 public:
-	TTword(TTstring &str, WordMode mode, int val2);
+	TTword(TTstring &str, WordClass wordClass, int val2);
 	TTword(TTword *src);
 	~TTword();
 
@@ -93,7 +101,7 @@ public:
 	/**
 	 * Load the word
 	 */
-	int load(SimpleFile *file, WordMode mode);
+	int load(SimpleFile *file, WordClass wordClass);
 
 	/**
 	 * Finds a synonym in the word by name, if one exists


Commit: 006c98cfa425a99aff2e7fa9f2ae426fa8992f51
    https://github.com/scummvm/scummvm/commit/006c98cfa425a99aff2e7fa9f2ae426fa8992f51
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:14:02-04:00

Commit Message:
TITANIC: Added ParserAction enum

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 1a2944d..9b56aef 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -770,7 +770,7 @@ int TTparser::considerRequests(TTword *word) {
 				flag = true;
 				break;
 
-			case 2:
+			case EXPECT_THING:
 				if (!word->_wordClass) {
 					word->_wordClass = WC_THING;
 					addToConceptList(word);
@@ -780,11 +780,35 @@ int TTparser::considerRequests(TTword *word) {
 				flag = true;
 				break;
 
-			case 3:
+			case OBJECT_IS_TO:
 				// TODO
 				//flag = _sentenceSub
 				break;
 
+			case SEEK_ACTOR:
+			case SEEK_OBJECT:
+			case SEEK_OBJECT_OVERRIDE:
+			case SEEK_TO:
+			case SEEK_FROM:
+			case SEEK_TO_OVERRIDE:
+			case SEEK_FROM_OVERRIDE:
+			case SEEK_LOCATION:
+			case SEEK_OWNERSHIP:
+			case SEEK_STATE:
+			case SEEK_MODIFIERS:
+			case SEEK_NEW_FRAME:
+			case SEEK_STATE_OBJECT:
+			case SET_ACTION:
+			case SET_COLOR:
+			case ACTOR_IS_TO:
+			case ACTOR_IS_FROM:
+			case ACTOR_IS_OBJECT:
+			case STATE_IDENTITY:
+			case WORD_TYPE_IS_SENTENCE_TYPE:
+			case COMPLEX_VERB:
+				// TODO
+				break;
+
 			default:
 				break;
 			}
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 6b490f8..aba0344 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -32,8 +32,14 @@ namespace Titanic {
 
 enum NumberFlag { NF_1 = 1, NF_2 = 2, NF_4 = 4, NF_8 = 8, NF_10 = 0x10 };
 
-enum ParserTag {
-	CHECK_COMMAND_FORM = 1
+enum ParserAction {
+	NO_ACTION = 0, CHECK_COMMAND_FORM, EXPECT_THING,  OBJECT_IS_TO,
+	SEEK_ACTOR, SEEK_OBJECT, SEEK_OBJECT_OVERRIDE, SEEK_TO,
+	SEEK_FROM, SEEK_TO_OVERRIDE, SEEK_FROM_OVERRIDE, SEEK_LOCATION,
+	SEEK_OWNERSHIP, SEEK_STATE, SEEK_MODIFIERS, SEEK_NEW_FRAME,
+	SEEK_STATE_OBJECT, SET_ACTION, SET_COLOR, ACTOR_IS_TO,
+	ACTOR_IS_FROM, ACTOR_IS_OBJECT, STATE_IDENTITY,
+	WORD_TYPE_IS_SENTENCE_TYPE, COMPLEX_VERB
 };
 
 class CScriptHandler;


Commit: 46bb597ba21cb04b85f0b7010817fe329848b817
    https://github.com/scummvm/scummvm/commit/46bb597ba21cb04b85f0b7010817fe329848b817
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:14:05-04:00

Commit Message:
TITANIC: New TTconcept constructor

Changed paths:
    engines/titanic/true_talk/tt_concept.cpp
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index bc2da4c..a9794ca 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -58,6 +58,28 @@ TTconcept::TTconcept(TTword *word, ScriptType scriptType) :
 		reset();
 }
 
+TTconcept::TTconcept(const TTconcept &src) :
+		_string1(src._string1), _string2(src._string2),
+		_wordP(nullptr), _scriptP(nullptr) {
+
+	if (src.getStatus()) {
+		_status = SS_5;
+	} else {
+		if (setStatus()) {
+			_status = SS_VALID;
+			_scriptP = src._scriptP;
+			
+			if (src._wordP) {
+				_status = initializeWordRef(src._wordP);
+				copyFrom(src);
+			}
+		}
+	}
+
+	if (_status)
+		reset();
+}
+
 bool TTconcept::setStatus() {
 	if (_string1.isValid() && _string2.isValid()) {
 		_status = SS_VALID;
@@ -97,4 +119,13 @@ void TTconcept::reset() {
 	_status = oldStatus;
 }
 
+bool TTconcept::compareTo(const char *str) const {
+	return this != nullptr && _wordP != nullptr &&
+		_wordP->compareTo(str);
+}
+
+void TTconcept::copyFrom(const TTconcept &src) {
+	// TODO
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 787013e..8006e56 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -67,12 +67,29 @@ private:
 	 * Resets the concept
 	 */
 	void reset();
+
+	/**
+	 * Copy auxiliary data from the specified source concept
+	 */
+	void copyFrom(const TTconcept &src);
 public:
 	TTconcept *_nextP;
 public:
 	TTconcept();
 	TTconcept(TTscriptBase *script, ScriptType scriptType);
 	TTconcept(TTword *word, ScriptType scriptType);
+	TTconcept(const TTconcept &src);
+
+	/**
+	 * Compares the name of the associated word, if any,
+	 * to the passed string
+	 */
+	bool compareTo(const char *str) const;
+
+	/**
+	 * Return the status of the concept
+	 */
+	int getStatus() const { return _status; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 9b56aef..3a49e29 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -781,11 +781,12 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case OBJECT_IS_TO:
-				// TODO
-				//flag = _sentenceSub
+				flag = fn3(&_sentenceSub->_field8, 3);
 				break;
 
 			case SEEK_ACTOR:
+
+
 			case SEEK_OBJECT:
 			case SEEK_OBJECT_OVERRIDE:
 			case SEEK_TO:
@@ -865,6 +866,11 @@ int TTparser::fn2(TTword *word) {
 	}
 }
 
+bool TTparser::fn3(int *v, int v2) {
+	// TODO
+	return false;
+}
+
 int TTparser::checkReferent(TTpronoun *pronoun) {
 	TTconcept *concept;
 
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index aba0344..b73dd76 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -152,6 +152,8 @@ private:
 	 * Add a concept node
 	 */
 	int addConcept(TTconcept *concept);
+
+	bool fn3(int *v, int v2);
 public:
 	CScriptHandler *_owner;
 	TTsentenceSub *_sentenceSub;
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index 90a9aaa..1491937 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -99,6 +99,10 @@ bool TTstring::operator==(const TTstring &str) {
 	return _data && str._data && _data->_string == str._data->_string;
 }
 
+bool TTstring::operator==(const char *str) {
+	return _data && _data->_string == str;
+}
+
 void TTstring::save(SimpleFile *file) const {
 	file->writeFormat("%s", c_str());
 }
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 6003124..435efa1 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -58,6 +58,7 @@ public:
 	TTstring &operator+=(const TTstring &str);
 	TTstring &operator+=(char c);
 	bool operator==(const TTstring &str);
+	bool operator==(const char *str);
 
 	const char &operator[](int index) {
 		return *(c_str() + index);
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 028ee81..24221e1 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -185,6 +185,10 @@ bool TTword::findSynByName(const TTstring &str, TTsynonym *dest, int mode) const
 	}
 }
 
+bool TTword::compareTo(const char *str) const {
+	return _string == str;
+}
+
 TTword *TTword::copy() {
 	return new TTword(this);
 }
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index fa7f31e..f7550b4 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -115,6 +115,11 @@ public:
 	operator const char *() const { return c_str(); }
 
 	/**
+	 * Compares the word's text to a passed string
+	 */
+	bool compareTo(const char *str) const;
+
+	/**
 	 * Return the status of the word
 	 */
 	TTstringStatus getStatus() const { return _status; }


Commit: 6d2f65c97fd4cd23efd3e6e5e0087bf167744d89
    https://github.com/scummvm/scummvm/commit/6d2f65c97fd4cd23efd3e6e5e0087bf167744d89
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:14:08-04:00

Commit Message:
TITANIC: New TTconcept constructor and copy methods

Changed paths:
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/tt_concept.cpp
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 0bc50bd5..a5f0086 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/true_talk/script_handler.h"
 #include "titanic/true_talk/tt_sentence.h"
+#include "titanic/true_talk/tt_parser.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
@@ -91,4 +92,8 @@ SimpleFile *CScriptHandler::openResource(const CString &name) {
 	return _owner->open(name);
 }
 
+void CScriptHandler::setParserConcept(TTconcept *newConcept, TTconcept *oldConcept) {
+	_parser.conceptChanged(newConcept, oldConcept);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index cf5eac1..0183612 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -81,7 +81,10 @@ public:
 	 */
 	SimpleFile *openResource(const CString &name);
 
-
+	/**
+	 * Called when concept data is copied from one to another
+	 */
+	void setParserConcept(TTconcept *newConcept, TTconcept *oldConcept);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index a9794ca..cab67c9 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -23,6 +23,7 @@
 #include "titanic/true_talk/tt_concept.h"
 #include "titanic/true_talk/tt_script_base.h"
 #include "titanic/true_talk/tt_word.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -58,7 +59,7 @@ TTconcept::TTconcept(TTword *word, ScriptType scriptType) :
 		reset();
 }
 
-TTconcept::TTconcept(const TTconcept &src) :
+TTconcept::TTconcept(TTconcept &src) :
 		_string1(src._string1), _string2(src._string2),
 		_wordP(nullptr), _scriptP(nullptr) {
 
@@ -96,7 +97,7 @@ void TTconcept::setScriptType(ScriptType scriptType) {
 	_scriptType = scriptType;
 	_field1C = -1;
 	_field20 = 0;
-	_field2C = 0;
+	_word2 = nullptr;
 	_field30 = 0;
 	_field34 = 0;
 	_field38 = 0;
@@ -124,8 +125,31 @@ bool TTconcept::compareTo(const char *str) const {
 		_wordP->compareTo(str);
 }
 
-void TTconcept::copyFrom(const TTconcept &src) {
-	// TODO
+void TTconcept::copyFrom(TTconcept &src) {
+	_nextP = src._nextP;
+	_field14 = src._field14;
+	_scriptType = src._scriptType;
+	_field1C = src._field1C;
+	_field20 = src._field20;
+
+	if (src._word2) {
+		_word2 = src._word2->copyWords();
+		if (src._word2->getChainStatus())
+			_status = 11;
+	} else {
+		_word2 = nullptr;
+	}
+
+	_field30 = src._field30;
+	_field34 = src._field34;
+	
+	if (src._field38 == 1) {
+		g_vm->_exeResources._owner->setParserConcept(this, &src);
+		src.set38(1);
+		_field38 = 1;
+	}
+
+	_status = src._status;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 8006e56..ba48e70 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -42,7 +42,7 @@ private:
 	int _field1C;
 	int _field20;
 	TTstring _string2;
-	int _field2C;
+	TTword *_word2;
 	int _field30;
 	int _field34;
 	int _field38;
@@ -71,14 +71,14 @@ private:
 	/**
 	 * Copy auxiliary data from the specified source concept
 	 */
-	void copyFrom(const TTconcept &src);
+	void copyFrom(TTconcept &src);
 public:
 	TTconcept *_nextP;
 public:
 	TTconcept();
 	TTconcept(TTscriptBase *script, ScriptType scriptType);
 	TTconcept(TTword *word, ScriptType scriptType);
-	TTconcept(const TTconcept &src);
+	TTconcept(TTconcept &src);
 
 	/**
 	 * Compares the name of the associated word, if any,
@@ -90,6 +90,8 @@ public:
 	 * Return the status of the concept
 	 */
 	int getStatus() const { return _status; }
+
+	void set38(int val) { _field38 = val; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 3a49e29..76c979a 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -895,4 +895,11 @@ int TTparser::checkReferent(TTpronoun *pronoun) {
 	return 0;
 }
 
+void TTparser::conceptChanged(TTconcept *newConcept, TTconcept *oldConcept) {
+	if (!oldConcept && newConcept != _currentConceptP)
+		_currentConceptP = nullptr;
+	else if (oldConcept && oldConcept == _currentConceptP)
+		_currentConceptP = newConcept;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index b73dd76..84fa1aa 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -73,6 +73,7 @@ private:
 	NumberArray _numbers;
 	TTparserNode *_nodesP;
 	TTconcept *_conceptP;
+	TTconcept *_currentConceptP;
 private:
 	/**
 	 * Loads the various replacement string data arrays
@@ -173,6 +174,11 @@ public:
 	int preprocess(TTsentence *sentence);
 
 	int findFrames(TTsentence *sentence);
+
+	/**
+	 * Called when a concept is copied from one to another
+	 */
+	void conceptChanged(TTconcept *newConcept, TTconcept *oldConcept);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 24221e1..c2ce2c1 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -210,4 +210,21 @@ void TTword::setSynFile(FileHandle file) {
 		_synP->_file = file;
 }
 
+TTstringStatus TTword::getChainStatus() const {
+	for (const TTword *word = this; word; word = word->_nextP) {
+		if (word->getStatus())
+			return word->getStatus();
+	}
+
+	return SS_VALID;
+}
+
+TTword *TTword::copyWords() {
+	TTword *result = copy();
+	for (TTword *word = result; word; word = word->_nextP)
+		word->_nextP = word->_nextP->copy();
+
+	return result;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index f7550b4..5fa4953 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -125,6 +125,16 @@ public:
 	TTstringStatus getStatus() const { return _status; }
 
 	/**
+	 * Return the status of the entire word chain
+	 */
+	TTstringStatus getChainStatus() const;
+
+	/**
+	 * Copy the word and any attached to it
+	 */
+	TTword *copyWords();
+
+	/**
 	 * Creates a copy of the word
 	 */
 	virtual TTword *copy();


Commit: 82614fedf3c2b9380530fdc4bc68d585d31aaedb
    https://github.com/scummvm/scummvm/commit/82614fedf3c2b9380530fdc4bc68d585d31aaedb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:14:11-04:00

Commit Message:
TITANIC: Making TTword constructors and copy methods const

Changed paths:
    engines/titanic/true_talk/tt_action.cpp
    engines/titanic/true_talk/tt_action.h
    engines/titanic/true_talk/tt_adj.cpp
    engines/titanic/true_talk/tt_adj.h
    engines/titanic/true_talk/tt_major_word.cpp
    engines/titanic/true_talk/tt_major_word.h
    engines/titanic/true_talk/tt_picture.cpp
    engines/titanic/true_talk/tt_picture.h
    engines/titanic/true_talk/tt_pronoun.cpp
    engines/titanic/true_talk/tt_pronoun.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_action.cpp b/engines/titanic/true_talk/tt_action.cpp
index bb30e9c..04135b55 100644
--- a/engines/titanic/true_talk/tt_action.cpp
+++ b/engines/titanic/true_talk/tt_action.cpp
@@ -30,7 +30,7 @@ TTaction::TTaction(TTstring &str, WordClass wordClass, int val2, int val3, int v
 		TTmajorWord(str, wordClass, val2, val3), _field30(val4) {
 }
 
-TTaction::TTaction(TTaction *src) : TTmajorWord(src) {
+TTaction::TTaction(const TTaction *src) : TTmajorWord(src) {
 	if (src->getStatus()) {
 		_field30 = 0;
 		_status = SS_5;
@@ -50,7 +50,7 @@ int TTaction::load(SimpleFile *file) {
 	}
 }
 
-TTword *TTaction::copy() {
+TTword *TTaction::copy() const {
 	TTaction *returnWordP = new TTaction(this);
 	returnWordP->_status = _status;
 	if (!_status) {
diff --git a/engines/titanic/true_talk/tt_action.h b/engines/titanic/true_talk/tt_action.h
index 0bd1049..7b91b14 100644
--- a/engines/titanic/true_talk/tt_action.h
+++ b/engines/titanic/true_talk/tt_action.h
@@ -34,7 +34,7 @@ protected:
 	int _field30;
 public:
 	TTaction(TTstring &str, WordClass wordClass, int val2, int val3, int val4);
-	TTaction(TTaction *src);
+	TTaction(const TTaction *src);
 
 	/**
 	 * Load the word
@@ -47,7 +47,7 @@ public:
 	/**
 	 * Creates a copy of the word
 	 */
-	virtual TTword *copy();
+	virtual TTword *copy() const;
 
 	virtual bool proc12(int val) const { return _field30 == val; }
 };
diff --git a/engines/titanic/true_talk/tt_adj.cpp b/engines/titanic/true_talk/tt_adj.cpp
index 5659ed2..1c16d58 100644
--- a/engines/titanic/true_talk/tt_adj.cpp
+++ b/engines/titanic/true_talk/tt_adj.cpp
@@ -36,7 +36,7 @@ TTadj::TTadj(TTstring &str, WordClass wordClass, int val2, int val3, int val4) :
 	}
 }
 
-TTadj::TTadj(TTadj *src) : TTmajorWord(src) {
+TTadj::TTadj(const TTadj *src) : TTmajorWord(src) {
 	if (src->getStatus()) {
 		_field30 = 0;
 		_status = SS_5;
@@ -56,7 +56,7 @@ int TTadj::load(SimpleFile *file) {
 	}
 }
 
-TTword *TTadj::copy() {
+TTword *TTadj::copy() const {
 	TTadj *returnWordP = new TTadj(this);
 	returnWordP->_status = _status;
 	if (!_status) {
diff --git a/engines/titanic/true_talk/tt_adj.h b/engines/titanic/true_talk/tt_adj.h
index 7dab02d..813cc8c 100644
--- a/engines/titanic/true_talk/tt_adj.h
+++ b/engines/titanic/true_talk/tt_adj.h
@@ -34,7 +34,7 @@ protected:
 	int _field30;
 public:
 	TTadj(TTstring &str, WordClass wordClass, int val2, int val3, int val4);
-	TTadj(TTadj *src);
+	TTadj(const TTadj *src);
 
 	/**
 	 * Load the word
@@ -44,7 +44,7 @@ public:
 	/**
 	 * Creates a copy of the word
 	 */
-	virtual TTword *copy();
+	virtual TTword *copy() const;
 
 	virtual bool proc14(int val) const { return _field30 == val; }
 	virtual int proc15() const { return _field30; }
diff --git a/engines/titanic/true_talk/tt_major_word.cpp b/engines/titanic/true_talk/tt_major_word.cpp
index 28b9434..0085acc 100644
--- a/engines/titanic/true_talk/tt_major_word.cpp
+++ b/engines/titanic/true_talk/tt_major_word.cpp
@@ -30,7 +30,7 @@ TTmajorWord::TTmajorWord(TTstring &str, WordClass wordClass, int val2, int val3)
 		TTword(str, wordClass, val2), _field2C(val3) {
 }
 
-TTmajorWord::TTmajorWord(TTmajorWord *src) : TTword(src) {
+TTmajorWord::TTmajorWord(const TTmajorWord *src) : TTword(src) {
 	if (src->getStatus()) {
 		_field2C = 0;
 		_status = SS_5;
@@ -51,7 +51,7 @@ int TTmajorWord::saveData(SimpleFile *file, int val) const {
 	return result;
 }
 
-TTword *TTmajorWord::copy() {
+TTword *TTmajorWord::copy() const {
 	TTmajorWord *returnWordP = new TTmajorWord(this);
 	returnWordP->_status = _status;
 	if (!_status) {
diff --git a/engines/titanic/true_talk/tt_major_word.h b/engines/titanic/true_talk/tt_major_word.h
index 716ccf1..d3d434e 100644
--- a/engines/titanic/true_talk/tt_major_word.h
+++ b/engines/titanic/true_talk/tt_major_word.h
@@ -39,12 +39,12 @@ protected:
 	int saveData(SimpleFile *file, int val) const;
 public:
 	TTmajorWord(TTstring &str, WordClass wordClass, int val2, int val3);
-	TTmajorWord(TTmajorWord *src);
+	TTmajorWord(const TTmajorWord *src);
 
 	/**
 	 * Creates a copy of the word
 	 */
-	virtual TTword *copy();
+	virtual TTword *copy() const;
 
 	virtual bool proc2(int val) const { return _field2C == val; }
 };
diff --git a/engines/titanic/true_talk/tt_picture.cpp b/engines/titanic/true_talk/tt_picture.cpp
index 59ff6c7..5c6444a 100644
--- a/engines/titanic/true_talk/tt_picture.cpp
+++ b/engines/titanic/true_talk/tt_picture.cpp
@@ -31,7 +31,7 @@ TTpicture::TTpicture(TTstring &str, WordClass wordClass, int val2, int val3, int
 		_field38(0) {
 }
 
-TTpicture::TTpicture(TTpicture *src) : TTmajorWord(src) {
+TTpicture::TTpicture(const TTpicture *src) : TTmajorWord(src) {
 	if (getStatus()) {
 		_tag = 0;
 		_field30 = 0;
@@ -60,7 +60,7 @@ int TTpicture::load(SimpleFile *file) {
 	}
 }
 
-TTword *TTpicture::copy() {
+TTword *TTpicture::copy() const {
 	TTpicture *returnWordP = new TTpicture(this);
 	returnWordP->_status = _status;
 	if (!_status) {
diff --git a/engines/titanic/true_talk/tt_picture.h b/engines/titanic/true_talk/tt_picture.h
index 71beefe..9c7b2ac 100644
--- a/engines/titanic/true_talk/tt_picture.h
+++ b/engines/titanic/true_talk/tt_picture.h
@@ -37,7 +37,7 @@ protected:
 	int _field3C;
 public:
 	TTpicture(TTstring &str, WordClass wordClass, int val2, int val3, int val4, int val5, int val6);
-	TTpicture(TTpicture *src);
+	TTpicture(const TTpicture *src);
 
 	/**
 	 * Load the word
@@ -47,7 +47,7 @@ public:
 	/**
 	 * Creates a copy of the word
 	 */
-	virtual TTword *copy();
+	virtual TTword *copy() const;
 
 	/**
 	 * Checks whether the word's tag is a known type
diff --git a/engines/titanic/true_talk/tt_pronoun.cpp b/engines/titanic/true_talk/tt_pronoun.cpp
index 9b6692e..3ef4831 100644
--- a/engines/titanic/true_talk/tt_pronoun.cpp
+++ b/engines/titanic/true_talk/tt_pronoun.cpp
@@ -30,7 +30,7 @@ TTpronoun::TTpronoun(TTstring &str, WordClass wordClass, int val2, int val3, int
 		TTmajorWord(str, wordClass, val2, val3), _field30(val4) {
 }
 
-TTpronoun::TTpronoun(TTpronoun *src) : TTmajorWord(src) {
+TTpronoun::TTpronoun(const TTpronoun *src) : TTmajorWord(src) {
 	if (src->getStatus()) {
 		_field30 = 0;
 		_status = SS_5;
@@ -54,7 +54,7 @@ int TTpronoun::load(SimpleFile *file) {
 	}
 }
 
-TTword *TTpronoun::copy() {
+TTword *TTpronoun::copy() const {
 	TTpronoun *returnWordP = new TTpronoun(this);
 	returnWordP->_status = _status;
 	if (!_status) {
diff --git a/engines/titanic/true_talk/tt_pronoun.h b/engines/titanic/true_talk/tt_pronoun.h
index 0d9466c..041ea1d 100644
--- a/engines/titanic/true_talk/tt_pronoun.h
+++ b/engines/titanic/true_talk/tt_pronoun.h
@@ -34,7 +34,7 @@ protected:
 	int _field30;
 public:
 	TTpronoun(TTstring &str, WordClass wordClass, int val2, int val3, int val4);
-	TTpronoun(TTpronoun *src);
+	TTpronoun(const TTpronoun *src);
 
 	/**
 	 * Load the word
@@ -46,7 +46,7 @@ public:
 	/**
 	 * Creates a copy of the word
 	 */
-	virtual TTword *copy();
+	virtual TTword *copy() const;
 
 	virtual bool proc19(int val) const { return _field30 == val; }
 
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index c2ce2c1..e799507 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -32,7 +32,7 @@ TTword::TTword(TTstring &str, WordClass wordClass, int id) : _string(str),
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
 }
 
-TTword::TTword(TTword *src) {
+TTword::TTword(const TTword *src) {
 	if (src->getStatus() != SS_VALID) {
 		_status = SS_5;
 		return;
@@ -189,7 +189,7 @@ bool TTword::compareTo(const char *str) const {
 	return _string == str;
 }
 
-TTword *TTword::copy() {
+TTword *TTword::copy() const {
 	return new TTword(this);
 }
 
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 5fa4953..f823992 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -65,7 +65,7 @@ public:
 	uint _tag;
 public:
 	TTword(TTstring &str, WordClass wordClass, int val2);
-	TTword(TTword *src);
+	TTword(const TTword *src);
 	~TTword();
 
 	/**
@@ -137,7 +137,7 @@ public:
 	/**
 	 * Creates a copy of the word
 	 */
-	virtual TTword *copy();
+	virtual TTword *copy() const;
 	
 	void unkFn1(int val);
 


Commit: b862f95fe175f3938905e3357d8219cf27d62ae9
    https://github.com/scummvm/scummvm/commit/b862f95fe175f3938905e3357d8219cf27d62ae9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:14:14-04:00

Commit Message:
TITANIC: Added concept pointers to CScriptHandler

Changed paths:
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h



diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index a5f0086..470a1fc 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/true_talk/script_handler.h"
+#include "titanic/true_talk/tt_concept.h"
 #include "titanic/true_talk/tt_sentence.h"
 #include "titanic/true_talk/tt_parser.h"
 #include "titanic/titanic.h"
@@ -32,7 +33,8 @@ namespace Titanic {
 CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) :
 		_owner(owner), _script(owner->_script), _resources(g_vm->_exeResources),
 		_sub1(), _parser(this), _field10(0), _inputCtr(0), 
-		_field20(0), _field24(0), _field28(0), _field2C(0), _field30(0) {
+		_concept1P(nullptr), _concept2P(nullptr), _concept3P(nullptr),
+		_concept4P(nullptr), _field30(0) {
 	g_vm->_scriptHandler = this;
 	g_vm->_script = _script;
 	g_vm->_exeResources.reset(this, val1, val2);
@@ -41,6 +43,10 @@ CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) :
 
 CScriptHandler::~CScriptHandler() {
 	delete _vocab;
+	delete _concept1P;
+	delete _concept2P;
+	delete _concept3P;
+	delete _concept4P;
 }
 
 ScriptChangedResult CScriptHandler::scriptChanged(TTroomScript *roomScript, TTnpcScript *npcScript, uint dialogueId) {
@@ -56,7 +62,15 @@ ScriptChangedResult CScriptHandler::scriptChanged(TTroomScript *roomScript, TTnp
 	if (result != SCR_3 && result != SCR_4)
 		return result;
 
-	error("TODO: CScriptHandler::scriptChanged");
+	++_inputCtr;
+	delete _concept1P;
+	delete _concept2P;
+	delete _concept3P;
+	delete _concept4P;
+	_concept1P = nullptr;
+	_concept2P = nullptr;
+	_concept3P = nullptr;
+	_concept4P = nullptr;
 }
 
 int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScript,
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 0183612..62cf9d0 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -55,10 +55,10 @@ private:
 	CScriptHandlerSub1 _sub1;
 	TTparser _parser;
 	int _inputCtr;
-	int _field20;
-	int _field24;
-	int _field28;
-	int _field2C;
+	TTconcept *_concept1P;
+	TTconcept *_concept2P;
+	TTconcept *_concept3P;
+	TTconcept *_concept4P;
 	int _field30;
 public:
 	TTvocab *_vocab;


Commit: bcfebf8f0fb8b1af29c4c80ad00c67e7707bf9ce
    https://github.com/scummvm/scummvm/commit/bcfebf8f0fb8b1af29c4c80ad00c67e7707bf9ce
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:14:17-04:00

Commit Message:
TITANIC: Added TTconcept destructor

Changed paths:
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/tt_concept.cpp
    engines/titanic/true_talk/tt_concept.h



diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 470a1fc..bfd7cdf 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -71,6 +71,8 @@ ScriptChangedResult CScriptHandler::scriptChanged(TTroomScript *roomScript, TTnp
 	_concept2P = nullptr;
 	_concept3P = nullptr;
 	_concept4P = nullptr;
+
+	return result;
 }
 
 int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScript,
diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index cab67c9..2b67c9a 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -27,7 +27,12 @@
 
 namespace Titanic {
 
-TTconcept::TTconcept() {
+TTconcept::TTconcept() : _string1(" "), _string2(" "), 
+		_scriptP(nullptr), _wordP(nullptr) {
+	if (setStatus())
+		setScriptType(ST_UNKNOWN_SCRIPT);
+	else
+		reset();
 }
 
 TTconcept::TTconcept(TTscriptBase *script, ScriptType scriptType) :
@@ -81,6 +86,17 @@ TTconcept::TTconcept(TTconcept &src) :
 		reset();
 }
 
+TTconcept::~TTconcept() {
+	if (_word2P) {
+		_word2P->deleteSiblings();
+		delete _word2P;
+	}
+	delete _wordP;
+
+	if (_flag)
+		g_vm->_exeResources._owner->setParserConcept(this, nullptr);
+}
+
 bool TTconcept::setStatus() {
 	if (_string1.isValid() && _string2.isValid()) {
 		_status = SS_VALID;
@@ -97,10 +113,10 @@ void TTconcept::setScriptType(ScriptType scriptType) {
 	_scriptType = scriptType;
 	_field1C = -1;
 	_field20 = 0;
-	_word2 = nullptr;
+	_word2P = nullptr;
 	_field30 = 0;
 	_field34 = 0;
-	_field38 = 0;
+	_flag = false;
 	_status = 0;
 }
 
@@ -132,21 +148,21 @@ void TTconcept::copyFrom(TTconcept &src) {
 	_field1C = src._field1C;
 	_field20 = src._field20;
 
-	if (src._word2) {
-		_word2 = src._word2->copyWords();
-		if (src._word2->getChainStatus())
+	if (src._word2P) {
+		_word2P = src._word2P->copyWords();
+		if (src._word2P->getChainStatus())
 			_status = 11;
 	} else {
-		_word2 = nullptr;
+		_word2P = nullptr;
 	}
 
 	_field30 = src._field30;
 	_field34 = src._field34;
 	
-	if (src._field38 == 1) {
+	if (src._flag) {
 		g_vm->_exeResources._owner->setParserConcept(this, &src);
-		src.set38(1);
-		_field38 = 1;
+		src.setFlag(true);
+		_flag = true;
 	}
 
 	_status = src._status;
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index ba48e70..d73fea7 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -42,10 +42,10 @@ private:
 	int _field1C;
 	int _field20;
 	TTstring _string2;
-	TTword *_word2;
+	TTword *_word2P;
 	int _field30;
 	int _field34;
-	int _field38;
+	bool _flag;
 	int _status;
 private:
 	/**
@@ -79,6 +79,7 @@ public:
 	TTconcept(TTscriptBase *script, ScriptType scriptType);
 	TTconcept(TTword *word, ScriptType scriptType);
 	TTconcept(TTconcept &src);
+	~TTconcept();
 
 	/**
 	 * Compares the name of the associated word, if any,
@@ -91,7 +92,7 @@ public:
 	 */
 	int getStatus() const { return _status; }
 
-	void set38(int val) { _field38 = val; }
+	void setFlag(bool val) { _flag = val; }
 };
 
 } // End of namespace Titanic


Commit: 1ffb8ff92b9f9d1be7a3f93ad5df859f086f3d94
    https://github.com/scummvm/scummvm/commit/1ffb8ff92b9f9d1be7a3f93ad5df859f086f3d94
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:14:20-04:00

Commit Message:
TITANIC: Added TTconcept deleteSiblings

Changed paths:
    engines/titanic/true_talk/tt_concept.cpp
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h



diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index 2b67c9a..59d53a9 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -97,6 +97,15 @@ TTconcept::~TTconcept() {
 		g_vm->_exeResources._owner->setParserConcept(this, nullptr);
 }
 
+void TTconcept::deleteSiblings() {
+	for (TTconcept *currP = _nextP, *nextP; currP; currP = nextP) {
+		nextP = currP->_nextP;
+		delete currP;
+	}
+
+	_nextP = nullptr;
+}
+
 bool TTconcept::setStatus() {
 	if (_string1.isValid() && _string2.isValid()) {
 		_status = SS_VALID;
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index d73fea7..d28ac57 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -82,6 +82,11 @@ public:
 	~TTconcept();
 
 	/**
+	 * Destroys any attached sibling concepts to the given concept
+	 */
+	void deleteSiblings();
+
+	/**
 	 * Compares the name of the associated word, if any,
 	 * to the passed string
 	 */
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 76c979a..7c3737b 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -31,8 +31,8 @@
 namespace Titanic {
 
 TTparser::TTparser(CScriptHandler *owner) : _owner(owner), _sentenceSub(nullptr),
-		_sentence(nullptr), _fieldC(0), _field10(0), _field14(0), _field18(0),
-		_nodesP(nullptr), _conceptP(nullptr) {
+		_sentence(nullptr), _fieldC(0), _field10(0), _field14(0),
+		_currentWordP(nullptr), _nodesP(nullptr), _conceptP(nullptr) {
 	loadArrays();
 }
 
@@ -41,6 +41,13 @@ TTparser::~TTparser() {
 		_nodesP->deleteSiblings();
 		delete _nodesP;
 	}
+
+	if (_conceptP) {
+		_conceptP->deleteSiblings();
+		delete _conceptP;
+	}
+
+	delete _currentWordP;
 }
 
 void TTparser::loadArrays() {
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 84fa1aa..675bdd6 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -162,7 +162,7 @@ public:
 	int _fieldC;
 	int _field10;
 	int _field14;
-	int _field18;
+	TTword *_currentWordP;
 public:
 	TTparser(CScriptHandler *owner);
 	~TTparser();


Commit: 8c99ff510c2e8a7d4cde30dc6d8b3698fb998907
    https://github.com/scummvm/scummvm/commit/8c99ff510c2e8a7d4cde30dc6d8b3698fb998907
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:14:23-04:00

Commit Message:
TITANIC: Added TTconcept copyFrom method

Changed paths:
    engines/titanic/true_talk/tt_concept.cpp
    engines/titanic/true_talk/tt_concept.h



diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index 59d53a9..8ecaf89 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -77,7 +77,7 @@ TTconcept::TTconcept(TTconcept &src) :
 			
 			if (src._wordP) {
 				_status = initializeWordRef(src._wordP);
-				copyFrom(src);
+				initialize(src);
 			}
 		}
 	}
@@ -150,7 +150,7 @@ bool TTconcept::compareTo(const char *str) const {
 		_wordP->compareTo(str);
 }
 
-void TTconcept::copyFrom(TTconcept &src) {
+void TTconcept::initialize(TTconcept &src) {
 	_nextP = src._nextP;
 	_field14 = src._field14;
 	_scriptType = src._scriptType;
@@ -177,4 +177,29 @@ void TTconcept::copyFrom(TTconcept &src) {
 	_status = src._status;
 }
 
+void TTconcept::copyFrom(TTconcept *src) {
+	if (this != src) {
+		if (src->getStatus()) {
+			_status = SS_5;
+		} else {
+			_string1 = src->_string1;
+			_string2 = src->_string2;
+
+			if (setStatus()) {
+				_scriptP = src->_scriptP;
+				if (src->_wordP) {
+					_status = initializeWordRef(src->_wordP);
+					initialize(*src);
+				} else {
+					_wordP = nullptr;
+					initialize(*src);
+				}
+			}
+		}
+	}
+
+	if (_status)
+		reset();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index d28ac57..ae956c1 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -69,9 +69,9 @@ private:
 	void reset();
 
 	/**
-	 * Copy auxiliary data from the specified source concept
+	 * Initialize inner data for the concept from a given source concept
 	 */
-	void copyFrom(TTconcept &src);
+	void initialize(TTconcept &src);
 public:
 	TTconcept *_nextP;
 public:
@@ -87,6 +87,11 @@ public:
 	void deleteSiblings();
 
 	/**
+	 * Copies data from a source concept
+	 */
+	void copyFrom(TTconcept *src);
+
+	/**
 	 * Compares the name of the associated word, if any,
 	 * to the passed string
 	 */


Commit: 6ab35972e87fd1ac6a2eab7a4a07683f2e844d76
    https://github.com/scummvm/scummvm/commit/6ab35972e87fd1ac6a2eab7a4a07683f2e844d76
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:14:27-04:00

Commit Message:
TITANIC: Implement TTconcept getText

Changed paths:
    engines/titanic/true_talk/tt_concept.cpp
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_script_base.cpp
    engines/titanic/true_talk/tt_script_base.h
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index 8ecaf89..f88722e 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -41,7 +41,7 @@ TTconcept::TTconcept(TTscriptBase *script, ScriptType scriptType) :
 		setScriptType(scriptType);
 		_scriptP = script;
 
-		if (scriptType == ST_UNKNOWN_SCRIPT && script->_field8 == 1)
+		if (scriptType == ST_UNKNOWN_SCRIPT && script->_id == 1)
 			_scriptType = ST_ROOM_SCRIPT;
 	}
 
@@ -202,4 +202,27 @@ void TTconcept::copyFrom(TTconcept *src) {
 		reset();
 }
 
+bool TTconcept::checkWordId1() const {
+	return (_wordP && (_wordP->_id == 200 || _wordP->_id == 201 ||
+		_wordP->_id == 602 || _wordP->_id == 607)) ||
+		(_scriptP && _scriptP->_id <= 2);
+}
+
+bool TTconcept::checkWordId2() const {
+	return (_wordP && _wordP->_id == 204) || (_scriptP && _scriptP->getId() == 3);
+}
+
+bool TTconcept::checkWordClass() const {
+	return !_scriptP && _wordP && (_wordP->_wordClass == WC_THING || _wordP->_wordClass == WC_PRONOUN);
+}
+
+const TTstring TTconcept::getText() {
+	if (_scriptP)
+		return _scriptP->getText();
+	else if (_wordP)
+		return _wordP->getText();
+	else
+		return TTstring();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index ae956c1..a2e5fb2 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -103,6 +103,15 @@ public:
 	int getStatus() const { return _status; }
 
 	void setFlag(bool val) { _flag = val; }
+
+	bool checkWordId1() const;
+	bool checkWordId2() const;
+	bool checkWordClass() const;
+
+	/**
+	 * Return text assocaited with the concept's word or script
+	 */
+	const TTstring getText();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 7c3737b..cb12e04 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -735,8 +735,8 @@ int TTparser::considerRequests(TTword *word) {
 	bool flag = false;
 
 	while (word) {
-		int ecx = 906;
-		int edx = 12;
+		//int ecx = 906;
+		//int edx = 12;
 
 		if (nodeP->_tag == MKTAG('C', 'O', 'M', 'E')) {
 			addNode(7);
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index a8e0940..85c329c 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -25,16 +25,16 @@
 
 namespace Titanic {
 
-TTscriptBase::TTscriptBase(int v1, const char *charClass, int v2,
+TTscriptBase::TTscriptBase(int scriptId, const char *charClass, int v2,
 		const char *charName, int v3, int v4, int v5, int v6, int v7) :
 		_charName(charName), _charClass(charClass), 
-		_nodesP(nullptr), _field8(0), _hist(nullptr),
+		_nodesP(nullptr), _id(0), _hist(nullptr),
 		_field20(0), _field24(0), _field28(0), _field2C(0),
 		_field30(0), _field34(0), _field38(0), _field3C(0),
 		_field40(0), _field44(0), _field48(0), _status(0) {
 	if (!areNamesValid()) {
 		if (!v7 || !getStatus()) {
-			_field8 = v1;
+			_id = scriptId;
 			_field20 = v3;
 			_field24 = v4;
 			_field28 = v5;
@@ -65,7 +65,7 @@ bool TTscriptBase::areNamesValid() {
 
 void TTscriptBase::reset() {
 	_nodesP = nullptr;
-	_field8 = 4;
+	_id = 4;
 	_hist = nullptr;
 	_field20 = 0;
 	_field24 = -1;
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index 2b748db..2ffbf60 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -55,17 +55,30 @@ protected:
 	int _field48;
 	int _status;
 public:
-	int _field8;
+	int _id;
 public:
-	TTscriptBase(int v1, const char *charClass, int v2, const char *charName,
+	TTscriptBase(int scriptId, const char *charClass, int v2, const char *charName,
 		int v3, int v4, int v5, int v6, int v7);
 	virtual ~TTscriptBase();
 
 	bool areNamesValid();
 
+	/**
+	 * Return the Id of the script
+	 */
+	int getId() const { return _id; }
+
+	/**
+	 * Return the status
+	 */
 	int getStatus() const { return _status; }
 
 	/**
+	 * Return the script text
+	 */
+	const TTstring getText() { return _charClass; }
+
+	/**
 	 * Gets passed a newly created input wrapper during conversation text processing
 	 */
 	int preprocess(TTsentence *sentence);
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index f823992..09d9f5e 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -115,6 +115,11 @@ public:
 	operator const char *() const { return c_str(); }
 
 	/**
+	 * Return the text of the word
+	 */
+	const TTstring getText() { return _string; }
+
+	/**
 	 * Compares the word's text to a passed string
 	 */
 	bool compareTo(const char *str) const;


Commit: c3055aeaf08601f8072de1c7d1922284bc3f933f
    https://github.com/scummvm/scummvm/commit/c3055aeaf08601f8072de1c7d1922284bc3f933f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:14:30-04:00

Commit Message:
TITANIC: Added TTconcept setOwner

Changed paths:
    engines/titanic/true_talk/tt_concept.cpp
    engines/titanic/true_talk/tt_concept.h



diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index f88722e..8f42839 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -202,6 +202,36 @@ void TTconcept::copyFrom(TTconcept *src) {
 		reset();
 }
 
+int TTconcept::setOwner(TTconcept *src) {
+	if (this) {
+		if (src->_wordP) {
+			TTword *newWord = src->_wordP->copy();
+			return setOwner(newWord, 1);
+		}
+	}
+
+	return 0;
+}
+
+int TTconcept::setOwner(TTword *src, bool dontDup) {
+	TTword *word = dontDup ? src : src->copy();
+	
+	if (word) {
+		if (!_word2P) {
+			_word2P = word;
+		} else {
+			// Add word to end of word list
+			TTword *tailP = _word2P;
+			while (tailP->_nextP)
+				tailP = tailP->_nextP;
+
+			tailP->_nextP = word;
+		}
+	}
+
+	return 0;
+}
+
 bool TTconcept::checkWordId1() const {
 	return (_wordP && (_wordP->_id == 200 || _wordP->_id == 201 ||
 		_wordP->_id == 602 || _wordP->_id == 607)) ||
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index a2e5fb2..4b908ca 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -98,6 +98,16 @@ public:
 	bool compareTo(const char *str) const;
 
 	/**
+	 * Set an owner for the concept
+	 */
+	int setOwner(TTconcept *src);
+
+	/**
+	 * Set an owner for the concept
+	 */
+	int setOwner(TTword *src, bool dontDup);
+
+	/**
 	 * Return the status of the concept
 	 */
 	int getStatus() const { return _status; }


Commit: 76c84afdfe5cf020f74d724d8cc3bcf67b6d754d
    https://github.com/scummvm/scummvm/commit/76c84afdfe5cf020f74d724d8cc3bcf67b6d754d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:14:33-04:00

Commit Message:
TITANIC: Added TTconcept find methods

Changed paths:
    engines/titanic/true_talk/tt_concept.cpp
    engines/titanic/true_talk/tt_concept.h



diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index 8f42839..6683c8e 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -255,4 +255,22 @@ const TTstring TTconcept::getText() {
 		return TTstring();
 }
 
+TTconcept *TTconcept::findByWordId(int id) {
+	for (TTconcept *conceptP = this; conceptP; conceptP = conceptP->_nextP) {
+		if (conceptP->_wordP && conceptP->_wordP->_id == id)
+			return conceptP;
+	}
+
+	return nullptr;
+}
+
+TTconcept *TTconcept::findByWordClass(WordClass wordClass) {
+	for (TTconcept *conceptP = this; conceptP; conceptP = conceptP->_nextP) {
+		if (conceptP->_wordP && conceptP->_wordP->_wordClass == wordClass)
+			return conceptP;
+	}
+
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 4b908ca..eefe113 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -24,6 +24,7 @@
 #define TITANIC_TT_CONCEPT_H
 
 #include "titanic/true_talk/tt_string.h"
+#include "titanic/true_talk/tt_word.h"
 
 namespace Titanic {
 
@@ -114,6 +115,8 @@ public:
 
 	void setFlag(bool val) { _flag = val; }
 
+	void set1C(int val) { _field1C = val; }
+
 	bool checkWordId1() const;
 	bool checkWordId2() const;
 	bool checkWordClass() const;
@@ -122,6 +125,16 @@ public:
 	 * Return text assocaited with the concept's word or script
 	 */
 	const TTstring getText();
+
+	/**
+	 * Find a word by Id
+	 */
+	TTconcept *findByWordId(int id);
+
+	/**
+	 * Find a word by it's class
+	 */
+	TTconcept *findByWordClass(WordClass wordClass);
 };
 
 } // End of namespace Titanic


Commit: 73e2e8f429eea33e121d93dbc2c38b8be52709d8
    https://github.com/scummvm/scummvm/commit/73e2e8f429eea33e121d93dbc2c38b8be52709d8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:14:36-04:00

Commit Message:
TITANIC: Added TTconcept id methods

Changed paths:
    engines/titanic/true_talk/tt_concept.cpp
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_pronoun.h
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index 6683c8e..05e6401 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -273,4 +273,12 @@ TTconcept *TTconcept::findByWordClass(WordClass wordClass) {
 	return nullptr;
 }
 
+bool TTconcept::isWordId(int id) const {
+	return this && _wordP && _wordP->_id == id;
+}
+
+int TTconcept::getWordId() const {
+	return this && _wordP ? _wordP->_id : 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index eefe113..112d864 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -135,6 +135,16 @@ public:
 	 * Find a word by it's class
 	 */
 	TTconcept *findByWordClass(WordClass wordClass);
+
+	/**
+	 * Returns true if the concept has a word with a given Id
+	 */
+	bool isWordId(int id) const;
+
+	/**
+	 * If a word is associated, return it's Id
+	 */
+	int getWordId() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_pronoun.h b/engines/titanic/true_talk/tt_pronoun.h
index 041ea1d..ccc0771 100644
--- a/engines/titanic/true_talk/tt_pronoun.h
+++ b/engines/titanic/true_talk/tt_pronoun.h
@@ -48,7 +48,9 @@ public:
 	 */
 	virtual TTword *copy() const;
 
-	virtual bool proc19(int val) const { return _field30 == val; }
+	virtual bool comparePronounTo(int val) const { 
+		return _field30 == val;
+	}
 
 	/**
 	 * Dumps data associated with the word to file
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 09d9f5e..0510881 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -125,6 +125,13 @@ public:
 	bool compareTo(const char *str) const;
 
 	/**
+	 * Compares the word's text to a passed string
+	 */
+	bool compareTo(TTstring *str) const {
+		return compareTo(str->c_str());
+	}
+
+	/**
 	 * Return the status of the word
 	 */
 	TTstringStatus getStatus() const { return _status; }
@@ -176,7 +183,7 @@ public:
 	virtual bool proc16() const { return false; }
 	virtual bool proc17() const { return false; }
 	virtual bool proc18() const { return false; }
-	virtual bool proc19(int val) const { return false; }
+	virtual bool comparePronounTo(int val) const { return false; }
 	virtual int proc20() const { return 0; }
 
 	/**


Commit: 938ec867fe6d172c4489bb28ab4a2609004459dc
    https://github.com/scummvm/scummvm/commit/938ec867fe6d172c4489bb28ab4a2609004459dc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:14:53-04:00

Commit Message:
TITANIC: Added TTword isClass method

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index ca55f7c..35157b0 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -49,7 +49,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x290
+#define HEADER_SIZE 0x300
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -349,6 +349,8 @@ void writeData() {
 	writeStringArray("TEXT/REPLACEMENTS1", 0x21BDB0, 218);
 	writeStringArray("TEXT/REPLACEMENTS2", 0x21C120, 1576);
 	writeStringArray("TEXT/REPLACEMENTS3", 0x21D9C8, 82);
+	writeStringArray("TEXT/PRONOUNS", 0x22F718, 15);
+
 	writeNumbers();
 }
 
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 0510881..94edee3 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -142,6 +142,11 @@ public:
 	TTstringStatus getChainStatus() const;
 
 	/**
+	 * Returns true if the word is of the specified class
+	 */
+	bool isClass(WordClass wordClass) const { return _wordClass == wordClass; }
+
+	/**
 	 * Copy the word and any attached to it
 	 */
 	TTword *copyWords();


Commit: d537a25bd705d803d6fb0dc8202c8ef88460cd2c
    https://github.com/scummvm/scummvm/commit/d537a25bd705d803d6fb0dc8202c8ef88460cd2c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:08-04:00

Commit Message:
TITANIC: Added TTsentenceSubBase setHandlerConcept

Changed paths:
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_vocab.h



diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 62cf9d0..1c08248 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -53,16 +53,16 @@ private:
 	CExeResources &_resources;
 	int _field10;
 	CScriptHandlerSub1 _sub1;
-	TTparser _parser;
 	int _inputCtr;
-	TTconcept *_concept1P;
-	TTconcept *_concept2P;
-	TTconcept *_concept3P;
-	TTconcept *_concept4P;
 	int _field30;
 public:
+	TTparser _parser;
 	TTvocab *_vocab;
 	TTscriptBase *_script;
+	TTconcept *_concept1P;
+	TTconcept *_concept2P;
+	TTconcept *_concept3P;
+	TTconcept *_concept4P;
 public:
 	CScriptHandler(CTitleEngine *owner, int val1, int val2);
 	~CScriptHandler();
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index cb12e04..02ecf0a 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -50,29 +50,21 @@ TTparser::~TTparser() {
 	delete _currentWordP;
 }
 
-void TTparser::loadArrays() {
-	Common::SeekableReadStream *r;
-	r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS1");
-	while (r->pos() < r->size())
-		_replacements1.push_back(readStringFromStream(r));
-	delete r;
-
-	r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS2");
+void TTparser::loadArray(StringArray &arr, const CString &name) {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
 	while (r->pos() < r->size())
-		_replacements2.push_back(readStringFromStream(r));
-	delete r;
-
-	r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS3");
-	while (r->pos() < r->size())
-		_replacements3.push_back(readStringFromStream(r));
+		arr.push_back(readStringFromStream(r));
 	delete r;
+}
 
-	r = g_vm->_filesManager->getResource("TEXT/PHRASES");
-	while (r->pos() < r->size())
-		_phrases.push_back(readStringFromStream(r));
-	delete r;
+void TTparser::loadArrays() {
+	loadArray(_replacements1, "TEXT/REPLACEMENTS1");
+	loadArray(_replacements2, "TEXT/REPLACEMENTS2");
+	loadArray(_replacements3, "TEXT/REPLACEMENTS3");
+	loadArray(_phrases, "TEXT/PHRASES");
+	loadArray(_pronouns, "TEXT/PRONOUNS");
 
-	r = g_vm->_filesManager->getResource("TEXT/NUMBERS");
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource("TEXT/NUMBERS");
 	while (r->pos() < r->size()) {
 		NumberEntry ne;
 		ne._text = readStringFromStream(r);
@@ -81,7 +73,6 @@ void TTparser::loadArrays() {
 		_numbers.push_back(ne);
 	}
 	delete r;
-
 }
 
 int TTparser::preprocess(TTsentence *sentence) {
@@ -490,7 +481,8 @@ int TTparser::findFrames(TTsentence *sentence) {
 
 	TTstring *line = sentence->_normalizedLine.copy();
 	TTstring wordString;
-	for (;;) {
+	int status = 0;
+	for (int ctr = 1; !status; ++ctr) {
 		// Keep stripping words off the start of the passed input
 		wordString = line->tokenize(" \n");
 		if (wordString.empty())
@@ -500,17 +492,23 @@ int TTparser::findFrames(TTsentence *sentence) {
 		TTword *word = _owner->_vocab->getWord(wordString, &word);
 		sentence->storeVocabHit(srcWord);
 
-		if (word) {
-			// TODO
-		} else {
-
+		if (!word && ctr == 1) {
+			word = new TTword(wordString, WC_UNKNOWN, 0);
 		}
+
+		for (TTword *currP = word; currP && !status; currP = currP->_nextP)
+			status = processRequests(currP);
+
+		word->deleteSiblings();
+		delete word;
 	}
 
+	if (!status) {
+		status = fn1();
+	}
 
-	// TODO
 	delete line;
-	return 0;
+	return status;
 }
 
 int TTparser::loadRequests(TTword *word) {
@@ -767,10 +765,10 @@ int TTparser::considerRequests(TTword *word) {
 		} else {
 			switch (nodeP->_tag) {
 			case CHECK_COMMAND_FORM:
-				if (_sentenceSub->_field4 && _sentence->_field2C == 1 &&
-						!_sentenceSub->_conceptP) {
+				if (_sentenceSub->_concept1P && _sentence->_field2C == 1 &&
+						!_sentenceSub->_concept0P) {
 					concept = new TTconcept(_sentence->_npcScript, ST_NPC_SCRIPT);
-					_sentenceSub->_conceptP = concept;
+					_sentenceSub->_concept0P = concept;
 					_sentenceSub->_field18 = 3;
 				}
 
@@ -788,7 +786,7 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case OBJECT_IS_TO:
-				flag = fn3(&_sentenceSub->_field8, 3);
+				flag = fn3(&_sentenceSub->_concept2P, 3);
 				break;
 
 			case SEEK_ACTOR:
@@ -828,6 +826,11 @@ int TTparser::considerRequests(TTword *word) {
 	return status;
 }
 
+int TTparser::processRequests(TTword *word) {
+	// TODO
+	return 0;
+}
+
 void TTparser::addToConceptList(TTword *word) {
 	TTconcept *concept = new TTconcept(word, ST_UNKNOWN_SCRIPT);
 	addConcept(concept);
@@ -851,6 +854,11 @@ int TTparser::addConcept(TTconcept *concept) {
 	return SS_VALID;
 }
 
+int TTparser::fn1() {
+	// TODO
+	return 0;
+}
+
 int TTparser::fn2(TTword *word) {
 	switch (word->_id) {
 	case 600:
@@ -873,7 +881,7 @@ int TTparser::fn2(TTword *word) {
 	}
 }
 
-bool TTparser::fn3(int *v, int v2) {
+bool TTparser::fn3(TTconcept **v, int v2) {
 	// TODO
 	return false;
 }
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 675bdd6..a8bb906 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -76,6 +76,11 @@ private:
 	TTconcept *_currentConceptP;
 private:
 	/**
+	 * Load the data for a given array resource
+	 */
+	void loadArray(StringArray &arr, const CString &name);
+
+	/**
 	 * Loads the various replacement string data arrays
 	 */
 	void loadArrays();
@@ -139,6 +144,7 @@ private:
 
 	int loadRequests(TTword *word);
 	int considerRequests(TTword *word);
+	int processRequests(TTword *word);
 
 	void addToConceptList(TTword *word);
 	int fn2(TTword *word);
@@ -154,7 +160,8 @@ private:
 	 */
 	int addConcept(TTconcept *concept);
 
-	bool fn3(int *v, int v2);
+	int fn1();
+	bool fn3(TTconcept **v, int v2);
 public:
 	CScriptHandler *_owner;
 	TTsentenceSub *_sentenceSub;
@@ -163,6 +170,7 @@ public:
 	int _field10;
 	int _field14;
 	TTword *_currentWordP;
+	StringArray _pronouns;
 public:
 	TTparser(CScriptHandler *owner);
 	~TTparser();
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 40e3bb0..9558c54 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -21,13 +21,16 @@
  */
 
 #include "titanic/true_talk/tt_sentence.h"
+#include "titanic/true_talk/tt_concept.h"
 #include "titanic/true_talk/script_handler.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
-TTsentenceSubBase::TTsentenceSubBase() : _conceptP(nullptr), _field4(0),
-	_field8(0), _fieldC(0), _field10(0), _field14(0), _field18(0),
-	_field1C(0), _nextP(nullptr), _field24(0) {
+TTsentenceSubBase::TTsentenceSubBase() : _concept0P(nullptr), 
+		_concept1P(nullptr), _concept2P(nullptr), _concept3P(nullptr),
+		_concept4P(nullptr), _concept5P(nullptr), _field18(0),
+		_field1C(0), _nextP(nullptr), _field24(0) {
 }
 
 void TTsentenceSubBase::deleteSiblings() {
@@ -40,6 +43,60 @@ void TTsentenceSubBase::deleteSiblings() {
 	_nextP = nullptr;
 }
 
+TTconcept **TTsentenceSubBase::setConcept(int conceptIndex, TTconcept *src) {
+	TTconcept **conceptPP = nullptr;
+	switch (conceptIndex) {
+	case 1:
+		conceptPP = &_concept1P;
+		break;
+	case 2:
+		conceptPP = &_concept2P;
+		break;
+	case 3:
+		conceptPP = &_concept3P;
+		break;
+	case 4:
+		conceptPP = &_concept4P;
+		break;
+	case 5:
+		conceptPP = &_concept5P;
+		break;
+	default:
+		break;
+	}
+
+	bool isPronoun = false;
+	StringArray &pronouns = g_vm->_scriptHandler->_parser._pronouns;
+	for (uint idx = 0; idx < pronouns.size() && !isPronoun; ++idx) {
+		isPronoun = pronouns[idx] == src->getText();
+	}
+
+	CScriptHandler &scrHandler = *g_vm->_exeResources._owner;
+	if (!isPronoun) {
+		switch (conceptIndex) {
+		case 0:
+			delete scrHandler._concept2P;
+			scrHandler._concept2P = new TTconcept(*src);
+			break;
+
+		case 1:
+			delete scrHandler._concept4P;
+			scrHandler._concept4P = new TTconcept(*src);
+			break;
+
+		case 2:
+			delete scrHandler._concept1P;
+			scrHandler._concept1P = new TTconcept(*src);
+			break;
+
+		default:
+			break;
+		}
+	}
+
+	return conceptPP;
+}
+
 /*------------------------------------------------------------------------*/
 
 TTsentenceSub *TTsentenceSub::addSibling() {
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index e6d0d0c..3a4fd6c 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -36,12 +36,12 @@ class TTword;
 
 class TTsentenceSubBase {
 public:
-	TTconcept *_conceptP;
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
-	int _field14;
+	TTconcept *_concept0P;
+	TTconcept *_concept1P;
+	TTconcept *_concept2P;
+	TTconcept *_concept3P;
+	TTconcept *_concept4P;
+	TTconcept *_concept5P;
 	int _field18;
 	int _field1C;
 	TTsentenceSubBase *_nextP;
@@ -57,6 +57,8 @@ public:
 	void set18(int val) { _field18 = val; }
 	int get18() const { return _field18; }
 	bool is24() const { return _field24 == 0; }
+
+	TTconcept **setConcept(int conceptIndex, TTconcept *src);
 };
 
 class TTsentenceSub : public TTsentenceSubBase {
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index eb3d523..062b598 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -34,7 +34,7 @@ namespace Titanic {
 
 TTvocab::TTvocab(int val): _headP(nullptr), _tailP(nullptr), _word(nullptr),
 		_fieldC(0), _field10(0), _vocabMode(val) {
-	_field14 = load("STVOCAB.TXT");
+	load("STVOCAB.TXT");
 }
 
 TTvocab::~TTvocab() {
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
index c84acbe..fc7ee2e 100644
--- a/engines/titanic/true_talk/tt_vocab.h
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -36,7 +36,6 @@ private:
 	TTword *_word;
 	int _fieldC;
 	int _field10;
-	int _field14;
 	int _vocabMode;
 private:
 	/**


Commit: 2b6a6cffc0b1854734540170d8b91430b5cc2f97
    https://github.com/scummvm/scummvm/commit/2b6a6cffc0b1854734540170d8b91430b5cc2f97
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:11-04:00

Commit Message:
TITANIC: Implemented TTsentecneSubBase changeConcept

Changed paths:
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h
    engines/titanic/true_talk/tt_string.h



diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 9558c54..7b49df2 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -97,6 +97,21 @@ TTconcept **TTsentenceSubBase::setConcept(int conceptIndex, TTconcept *src) {
 	return conceptPP;
 }
 
+int TTsentenceSubBase::changeConcept(int mode, TTconcept **conceptPP, int conceptIndex) {
+	TTconcept **newConceptPP = setConcept(conceptIndex, *conceptPP);
+
+	if (mode == 0 || (mode == 1 && !*newConceptPP)) {
+		if (!*conceptPP)
+			return SS_5;
+
+		delete *newConceptPP;
+		*newConceptPP = new TTconcept(**conceptPP);
+		return SS_VALID;
+	} else {
+		return SS_1;
+	}
+}
+
 /*------------------------------------------------------------------------*/
 
 TTsentenceSub *TTsentenceSub::addSibling() {
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 3a4fd6c..e995884 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -59,6 +59,7 @@ public:
 	bool is24() const { return _field24 == 0; }
 
 	TTconcept **setConcept(int conceptIndex, TTconcept *src);
+	int changeConcept(int mode, TTconcept **conceptPP, int conceptIndex);
 };
 
 class TTsentenceSub : public TTsentenceSubBase {
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 435efa1..060a48f 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -38,7 +38,7 @@ struct TTstringData {
 	TTstringData(const CString &str) : _string(str), _referenceCount(1) {}
 };
 
-enum TTstringStatus { SS_VALID = 0, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_11 = 11, SS_13 = 13 };
+enum TTstringStatus { SS_VALID = 0, SS_1 = 1, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_11 = 11, SS_13 = 13 };
 
 class TTstring {
 private:


Commit: ae9a04bd414b45bbd8d3c00357432457a92230f9
    https://github.com/scummvm/scummvm/commit/ae9a04bd414b45bbd8d3c00357432457a92230f9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:14-04:00

Commit Message:
TITANIC: Refactored TTsentenceSubBase to TTconceptNode

Changed paths:
  A engines/titanic/true_talk/tt_concept_node.cpp
  A engines/titanic/true_talk/tt_concept_node.h
    engines/titanic/module.mk
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index b3d1444..19e4aff 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -463,6 +463,7 @@ MODULE_OBJS := \
 	true_talk/tt_action.o \
 	true_talk/tt_adj.o \
 	true_talk/tt_concept.o \
+	true_talk/tt_concept_node.o \
 	true_talk/tt_hist.o \
 	true_talk/tt_major_word.o \
 	true_talk/tt_node.o \
diff --git a/engines/titanic/true_talk/tt_concept_node.cpp b/engines/titanic/true_talk/tt_concept_node.cpp
new file mode 100644
index 0000000..9ad9857
--- /dev/null
+++ b/engines/titanic/true_talk/tt_concept_node.cpp
@@ -0,0 +1,126 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_concept_node.h"
+#include "titanic/true_talk/script_handler.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+TTconceptNode::TTconceptNode() : _concept0P(nullptr), 
+		_concept1P(nullptr), _concept2P(nullptr), _concept3P(nullptr),
+		_concept4P(nullptr), _concept5P(nullptr), _field18(0),
+		_field1C(0), _nextP(nullptr), _status(0) {
+}
+
+TTconceptNode::TTconceptNode(const TTconceptNode &src) : _concept0P(nullptr),
+		_concept1P(nullptr), _concept2P(nullptr), _concept3P(nullptr),
+		_concept4P(nullptr), _concept5P(nullptr), _field18(0),
+		_field1C(0), _nextP(nullptr), _status(0) {
+	if (src._status) {
+		_status = SS_5;
+	} else {
+		// TODO
+	}
+}
+
+
+void TTconceptNode::deleteSiblings() {
+	// Iterate through the linked chain of nodes, deleting each in turn
+	for (TTconceptNode *curP = _nextP, *nextP = nullptr; nextP; curP = nextP) {
+		nextP = curP->_nextP;
+		delete curP;
+	}
+
+	_nextP = nullptr;
+}
+
+TTconcept **TTconceptNode::setConcept(int conceptIndex, TTconcept *src) {
+	TTconcept **conceptPP = nullptr;
+	switch (conceptIndex) {
+	case 1:
+		conceptPP = &_concept1P;
+		break;
+	case 2:
+		conceptPP = &_concept2P;
+		break;
+	case 3:
+		conceptPP = &_concept3P;
+		break;
+	case 4:
+		conceptPP = &_concept4P;
+		break;
+	case 5:
+		conceptPP = &_concept5P;
+		break;
+	default:
+		break;
+	}
+
+	bool isPronoun = false;
+	StringArray &pronouns = g_vm->_scriptHandler->_parser._pronouns;
+	for (uint idx = 0; idx < pronouns.size() && !isPronoun; ++idx) {
+		isPronoun = pronouns[idx] == src->getText();
+	}
+
+	CScriptHandler &scrHandler = *g_vm->_exeResources._owner;
+	if (!isPronoun) {
+		switch (conceptIndex) {
+		case 0:
+			delete scrHandler._concept2P;
+			scrHandler._concept2P = new TTconcept(*src);
+			break;
+
+		case 1:
+			delete scrHandler._concept4P;
+			scrHandler._concept4P = new TTconcept(*src);
+			break;
+
+		case 2:
+			delete scrHandler._concept1P;
+			scrHandler._concept1P = new TTconcept(*src);
+			break;
+
+		default:
+			break;
+		}
+	}
+
+	return conceptPP;
+}
+
+int TTconceptNode::changeConcept(int mode, TTconcept **conceptPP, int conceptIndex) {
+	TTconcept **newConceptPP = setConcept(conceptIndex, *conceptPP);
+
+	if (mode == 0 || (mode == 1 && !*newConceptPP)) {
+		if (!*conceptPP)
+			return SS_5;
+
+		delete *newConceptPP;
+		*newConceptPP = new TTconcept(**conceptPP);
+		return SS_VALID;
+	} else {
+		return SS_1;
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_concept_node.h b/engines/titanic/true_talk/tt_concept_node.h
new file mode 100644
index 0000000..8fc1371
--- /dev/null
+++ b/engines/titanic/true_talk/tt_concept_node.h
@@ -0,0 +1,65 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_CONCEPT_NODE_H
+#define TITANIC_TT_CONCEPT_NODE_H
+
+#include "titanic/true_talk/tt_concept.h"
+
+namespace Titanic {
+
+class TTconceptNode {
+public:
+	TTconcept *_concept0P;
+	TTconcept *_concept1P;
+	TTconcept *_concept2P;
+	TTconcept *_concept3P;
+	TTconcept *_concept4P;
+	TTconcept *_concept5P;
+	int _field18;
+	int _field1C;
+	TTconceptNode *_nextP;
+	int _status;
+public:
+	TTconceptNode();
+	TTconceptNode(const TTconceptNode &src);
+
+	/**
+	 * Delete any sibling chain attached to this node
+	 */
+	void deleteSiblings();
+
+	void set18(int val) { _field18 = val; }
+	int get18() const { return _field18; }
+
+	/**
+	 * Returns true if the node is valid
+	 */
+	bool isValid() const { return _status == SS_VALID; }
+
+	TTconcept **setConcept(int conceptIndex, TTconcept *src);
+	int changeConcept(int mode, TTconcept **conceptPP, int conceptIndex);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_CONCEPT_NODE_H */
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 02ecf0a..d02aec9 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -30,7 +30,7 @@
 
 namespace Titanic {
 
-TTparser::TTparser(CScriptHandler *owner) : _owner(owner), _sentenceSub(nullptr),
+TTparser::TTparser(CScriptHandler *owner) : _owner(owner), _sentenceConcept(nullptr),
 		_sentence(nullptr), _fieldC(0), _field10(0), _field14(0),
 		_currentWordP(nullptr), _nodesP(nullptr), _conceptP(nullptr) {
 	loadArrays();
@@ -476,7 +476,7 @@ const NumberEntry *TTparser::replaceNumbers2(TTstring &line, int *startIndex) {
 
 int TTparser::findFrames(TTsentence *sentence) {
 	static bool flag;
-	_sentenceSub = &sentence->_sub;
+	_sentenceConcept = &sentence->_sentenceConcept;
 	_sentence = sentence;
 
 	TTstring *line = sentence->_normalizedLine.copy();
@@ -573,10 +573,10 @@ int TTparser::loadRequests(TTword *word) {
 			break;
 		}
 
-		if (_sentenceSub) {
-			if (_sentenceSub->get18() == 0 || _sentenceSub->get18() == 2) {
+		if (_sentenceConcept) {
+			if (_sentenceConcept->get18() == 0 || _sentenceConcept->get18() == 2) {
 				TTaction *action = static_cast<TTaction *>(word);
-				_sentenceSub->set18(action->getVal());
+				_sentenceConcept->set18(action->getVal());
 			}
 		}
 		break;
@@ -621,8 +621,8 @@ int TTparser::loadRequests(TTword *word) {
 
 	case WC_CONJUNCTION:
 		if (_sentence->check2C()) {
-			_sentenceSub->_field1C = 1;
-			_sentenceSub = _sentenceSub->addSibling();
+			_sentenceConcept->_field1C = 1;
+			_sentenceConcept = _sentenceConcept->addSibling();
 			delete this;
 		} else {
 			addNode(23);
@@ -675,8 +675,8 @@ int TTparser::loadRequests(TTword *word) {
 		case 902:
 		case 904:
 			if (_sentence->_field2C == 9) {
-				_sentenceSub->_field1C = 1;
-				_sentenceSub = _sentenceSub->addSibling();
+				_sentenceConcept->_field1C = 1;
+				_sentenceConcept = _sentenceConcept->addSibling();
 				addNode(1);
 			}
 			else {
@@ -765,11 +765,11 @@ int TTparser::considerRequests(TTword *word) {
 		} else {
 			switch (nodeP->_tag) {
 			case CHECK_COMMAND_FORM:
-				if (_sentenceSub->_concept1P && _sentence->_field2C == 1 &&
-						!_sentenceSub->_concept0P) {
+				if (_sentenceConcept->_concept1P && _sentence->_field2C == 1 &&
+						!_sentenceConcept->_concept0P) {
 					concept = new TTconcept(_sentence->_npcScript, ST_NPC_SCRIPT);
-					_sentenceSub->_concept0P = concept;
-					_sentenceSub->_field18 = 3;
+					_sentenceConcept->_concept0P = concept;
+					_sentenceConcept->_field18 = 3;
 				}
 
 				flag = true;
@@ -786,7 +786,7 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case OBJECT_IS_TO:
-				flag = fn3(&_sentenceSub->_concept2P, 3);
+				flag = fn3(&_sentenceConcept->_concept2P, 3);
 				break;
 
 			case SEEK_ACTOR:
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index a8bb906..3e8c91c 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -164,7 +164,7 @@ private:
 	bool fn3(TTconcept **v, int v2);
 public:
 	CScriptHandler *_owner;
-	TTsentenceSub *_sentenceSub;
+	TTsentenceConcept *_sentenceConcept;
 	TTsentence *_sentence;
 	int _fieldC;
 	int _field10;
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 7b49df2..a78a4ef 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -27,99 +27,12 @@
 
 namespace Titanic {
 
-TTsentenceSubBase::TTsentenceSubBase() : _concept0P(nullptr), 
-		_concept1P(nullptr), _concept2P(nullptr), _concept3P(nullptr),
-		_concept4P(nullptr), _concept5P(nullptr), _field18(0),
-		_field1C(0), _nextP(nullptr), _field24(0) {
-}
-
-void TTsentenceSubBase::deleteSiblings() {
-	// Iterate through the linked chain of nodes, deleting each in turn
-	for (TTsentenceSubBase *curP = _nextP, *nextP = nullptr; nextP; curP = nextP) {
-		nextP = curP->_nextP;
-		delete curP;
-	}
-
-	_nextP = nullptr;
-}
-
-TTconcept **TTsentenceSubBase::setConcept(int conceptIndex, TTconcept *src) {
-	TTconcept **conceptPP = nullptr;
-	switch (conceptIndex) {
-	case 1:
-		conceptPP = &_concept1P;
-		break;
-	case 2:
-		conceptPP = &_concept2P;
-		break;
-	case 3:
-		conceptPP = &_concept3P;
-		break;
-	case 4:
-		conceptPP = &_concept4P;
-		break;
-	case 5:
-		conceptPP = &_concept5P;
-		break;
-	default:
-		break;
-	}
-
-	bool isPronoun = false;
-	StringArray &pronouns = g_vm->_scriptHandler->_parser._pronouns;
-	for (uint idx = 0; idx < pronouns.size() && !isPronoun; ++idx) {
-		isPronoun = pronouns[idx] == src->getText();
-	}
-
-	CScriptHandler &scrHandler = *g_vm->_exeResources._owner;
-	if (!isPronoun) {
-		switch (conceptIndex) {
-		case 0:
-			delete scrHandler._concept2P;
-			scrHandler._concept2P = new TTconcept(*src);
-			break;
-
-		case 1:
-			delete scrHandler._concept4P;
-			scrHandler._concept4P = new TTconcept(*src);
-			break;
-
-		case 2:
-			delete scrHandler._concept1P;
-			scrHandler._concept1P = new TTconcept(*src);
-			break;
-
-		default:
-			break;
-		}
-	}
-
-	return conceptPP;
-}
-
-int TTsentenceSubBase::changeConcept(int mode, TTconcept **conceptPP, int conceptIndex) {
-	TTconcept **newConceptPP = setConcept(conceptIndex, *conceptPP);
-
-	if (mode == 0 || (mode == 1 && !*newConceptPP)) {
-		if (!*conceptPP)
-			return SS_5;
-
-		delete *newConceptPP;
-		*newConceptPP = new TTconcept(**conceptPP);
-		return SS_VALID;
-	} else {
-		return SS_1;
-	}
-}
-
-/*------------------------------------------------------------------------*/
-
-TTsentenceSub *TTsentenceSub::addSibling() {
+TTsentenceConcept *TTsentenceConcept::addSibling() {
 	if (this == nullptr || _nextP != nullptr)
 		// This should never happen
 		return nullptr;
 
-	TTsentenceSub *nextP = new TTsentenceSub();
+	TTsentenceConcept *nextP = new TTsentenceConcept();
 	_nextP = nextP;
 	return nextP;
 }
@@ -134,13 +47,13 @@ TTsentence::TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner
 	_status = _initialLine.isValid() && _normalizedLine.isValid() ? SS_11: SS_VALID;
 }
 
-TTsentence::TTsentence(const TTsentence *src) : _initialLine(src->_initialLine),
-		_normalizedLine(src->_normalizedLine) {
+TTsentence::TTsentence(const TTsentence *src) : _sentenceConcept(src->_sentenceConcept),
+		_initialLine(src->_initialLine), _normalizedLine(src->_normalizedLine) {
 	copyFrom(*src);
 }
 
 TTsentence::~TTsentence() {
-	_sub.deleteSiblings();
+	_sentenceConcept.deleteSiblings();
 
 	if (_nodesP) {
 		_nodesP->deleteSiblings();
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index e995884..6cee970 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_TT_SENTENCE_H
 #define TITANIC_TT_SENTENCE_H
 
+#include "titanic/true_talk/tt_concept_node.h"
 #include "titanic/true_talk/tt_npc_script.h"
 #include "titanic/true_talk/tt_room_script.h"
 #include "titanic/true_talk/tt_sentence_node.h"
@@ -31,45 +32,17 @@
 namespace Titanic {
 
 class CScriptHandler;
-class TTconcept;
 class TTword;
 
-class TTsentenceSubBase {
+class TTsentenceConcept : public TTconceptNode {
 public:
-	TTconcept *_concept0P;
-	TTconcept *_concept1P;
-	TTconcept *_concept2P;
-	TTconcept *_concept3P;
-	TTconcept *_concept4P;
-	TTconcept *_concept5P;
-	int _field18;
-	int _field1C;
-	TTsentenceSubBase *_nextP;
-	int _field24;
-public:
-	TTsentenceSubBase();
-
-	/**
-	 * Delete any sibling chain attached to this node
-	 */
-	void deleteSiblings();
-
-	void set18(int val) { _field18 = val; }
-	int get18() const { return _field18; }
-	bool is24() const { return _field24 == 0; }
-
-	TTconcept **setConcept(int conceptIndex, TTconcept *src);
-	int changeConcept(int mode, TTconcept **conceptPP, int conceptIndex);
-};
-
-class TTsentenceSub : public TTsentenceSubBase {
-public:
-	TTsentenceSub() : TTsentenceSubBase() {}
+	TTsentenceConcept() : TTconceptNode() {}
+	TTsentenceConcept(const TTsentenceConcept &src) : TTconceptNode(src) {}
 
 	/**
 	 * Adds a new sibling instance
 	 */
-	TTsentenceSub *addSibling();
+	TTsentenceConcept *addSibling();
 };
 
 class TTsentence {
@@ -87,7 +60,7 @@ private:
 	 */
 	void copyFrom(const TTsentence &src);
 public:
-	TTsentenceSub _sub;
+	TTsentenceConcept _sentenceConcept;
 	TTstring _initialLine;
 	TTstring _normalizedLine;
 	int _field58;


Commit: 06b9131a6cd5f009147368746b9354378d9d5d18
    https://github.com/scummvm/scummvm/commit/06b9131a6cd5f009147368746b9354378d9d5d18
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:18-04:00

Commit Message:
TITANIC: Added TTconcept copy constructor

Changed paths:
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_concept_node.cpp
    engines/titanic/true_talk/tt_concept_node.h



diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 112d864..8168d4e 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -113,6 +113,11 @@ public:
 	 */
 	int getStatus() const { return _status; }
 
+	/**
+	 * True true if the concept is valid
+	 */
+	bool isValid() const { return _status == SS_VALID; }
+
 	void setFlag(bool val) { _flag = val; }
 
 	void set1C(int val) { _field1C = val; }
diff --git a/engines/titanic/true_talk/tt_concept_node.cpp b/engines/titanic/true_talk/tt_concept_node.cpp
index 9ad9857..aca5718 100644
--- a/engines/titanic/true_talk/tt_concept_node.cpp
+++ b/engines/titanic/true_talk/tt_concept_node.cpp
@@ -26,20 +26,28 @@
 
 namespace Titanic {
 
-TTconceptNode::TTconceptNode() : _concept0P(nullptr), 
-		_concept1P(nullptr), _concept2P(nullptr), _concept3P(nullptr),
-		_concept4P(nullptr), _concept5P(nullptr), _field18(0),
-		_field1C(0), _nextP(nullptr), _status(0) {
+TTconceptNode::TTconceptNode() : _concept0P(_concepts[0]), _concept1P(_concepts[1]),
+		_concept2P(_concepts[2]), _concept3P(_concepts[3]), _concept4P(_concepts[4]),
+		_concept5P(_concepts[5]), _field18(0), _field1C(0), _nextP(nullptr), _status(0) {
 }
 
-TTconceptNode::TTconceptNode(const TTconceptNode &src) : _concept0P(nullptr),
-		_concept1P(nullptr), _concept2P(nullptr), _concept3P(nullptr),
-		_concept4P(nullptr), _concept5P(nullptr), _field18(0),
-		_field1C(0), _nextP(nullptr), _status(0) {
+TTconceptNode::TTconceptNode(const TTconceptNode &src) : _concept0P(_concepts[0]), _concept1P(_concepts[1]),
+		_concept2P(_concepts[2]), _concept3P(_concepts[3]), _concept4P(_concepts[4]),
+		_concept5P(_concepts[5]), _field18(0), _field1C(0), _nextP(nullptr), _status(0) {
 	if (src._status) {
 		_status = SS_5;
 	} else {
-		// TODO
+		for (int idx = 0; idx < 6; ++idx) {
+			if (src._concepts[idx]) {
+				_concepts[idx] = new TTconcept(*src._concepts[idx]);
+				if (!_concepts[idx]->isValid())
+					_status = SS_11;
+			}
+		}
+
+		_field18 = src._field18;
+		_field1C = src._field1C;
+		_nextP = src._nextP;
 	}
 }
 
diff --git a/engines/titanic/true_talk/tt_concept_node.h b/engines/titanic/true_talk/tt_concept_node.h
index 8fc1371..af2fd42 100644
--- a/engines/titanic/true_talk/tt_concept_node.h
+++ b/engines/titanic/true_talk/tt_concept_node.h
@@ -29,12 +29,13 @@ namespace Titanic {
 
 class TTconceptNode {
 public:
-	TTconcept *_concept0P;
-	TTconcept *_concept1P;
-	TTconcept *_concept2P;
-	TTconcept *_concept3P;
-	TTconcept *_concept4P;
-	TTconcept *_concept5P;
+	TTconcept *_concepts[6];
+	TTconcept *&_concept0P;
+	TTconcept *&_concept1P;
+	TTconcept *&_concept2P;
+	TTconcept *&_concept3P;
+	TTconcept *&_concept4P;
+	TTconcept *&_concept5P;
 	int _field18;
 	int _field1C;
 	TTconceptNode *_nextP;


Commit: 483929e70a74f86b250e8934a3880919e9bf3a02
    https://github.com/scummvm/scummvm/commit/483929e70a74f86b250e8934a3880919e9bf3a02
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:22-04:00

Commit Message:
TITANIC: Added various TTparser & TTconcept support methods

Changed paths:
    engines/titanic/true_talk/tt_concept.cpp
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_concept_node.cpp
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h



diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index 05e6401..2c54f2f 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -242,6 +242,11 @@ bool TTconcept::checkWordId2() const {
 	return (_wordP && _wordP->_id == 204) || (_scriptP && _scriptP->getId() == 3);
 }
 
+bool TTconcept::checkWordId3() const {
+	return isWordClass(WC_ABSTRACT) || isWordClass(WC_ADJECTIVE) ||
+		(isWordClass(WC_ADVERB) && getWordId() != 910);
+}
+
 bool TTconcept::checkWordClass() const {
 	return !_scriptP && _wordP && (_wordP->_wordClass == WC_THING || _wordP->_wordClass == WC_PRONOUN);
 }
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 8168d4e..98a6ee6 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -118,12 +118,20 @@ public:
 	 */
 	bool isValid() const { return _status == SS_VALID; }
 
+	/**
+	 * Returns true if the word is of the specified class
+	 */
+	bool isWordClass(WordClass wordClass) const { 
+		return _wordP && _wordP->isClass(wordClass); 
+	}
+
 	void setFlag(bool val) { _flag = val; }
 
 	void set1C(int val) { _field1C = val; }
 
 	bool checkWordId1() const;
 	bool checkWordId2() const;
+	bool checkWordId3() const;
 	bool checkWordClass() const;
 
 	/**
diff --git a/engines/titanic/true_talk/tt_concept_node.cpp b/engines/titanic/true_talk/tt_concept_node.cpp
index aca5718..956d87b 100644
--- a/engines/titanic/true_talk/tt_concept_node.cpp
+++ b/engines/titanic/true_talk/tt_concept_node.cpp
@@ -51,7 +51,6 @@ TTconceptNode::TTconceptNode(const TTconceptNode &src) : _concept0P(_concepts[0]
 	}
 }
 
-
 void TTconceptNode::deleteSiblings() {
 	// Iterate through the linked chain of nodes, deleting each in turn
 	for (TTconceptNode *curP = _nextP, *nextP = nullptr; nextP; curP = nextP) {
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index d02aec9..7b9f4c4 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -790,7 +790,13 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case SEEK_ACTOR:
+				if (_sentenceConcept->_concept0P) {
 
+				}
+				else {
+
+				}
+				break;
 
 			case SEEK_OBJECT:
 			case SEEK_OBJECT_OVERRIDE:
@@ -854,6 +860,30 @@ int TTparser::addConcept(TTconcept *concept) {
 	return SS_VALID;
 }
 
+void TTparser::removeConcept(TTconcept *concept) {
+	// If no concept passed, exit immediately
+	if (!concept)
+		return;
+
+	if (_conceptP == concept) {
+		// Concept specified is the ver ystart of the linked list, so reset head pointer
+		_conceptP = _conceptP->_nextP;
+	} else {
+		// Scan through the linked list, looking for the specific concept
+		for (TTconcept *currP = _conceptP; currP; currP = currP->_nextP) {
+			if (currP->_nextP == concept) {
+				// Found match, so unlink the next link from the chain
+				currP->_nextP = currP->_nextP->_nextP;
+				break;
+			}
+		}
+	}
+
+	// FInally, delete the concept
+	concept->_nextP = nullptr;
+	delete concept;
+}
+
 int TTparser::fn1() {
 	// TODO
 	return 0;
@@ -917,4 +947,31 @@ void TTparser::conceptChanged(TTconcept *newConcept, TTconcept *oldConcept) {
 		_currentConceptP = newConcept;
 }
 
+bool TTparser::checkConcept2(TTconcept *concept, int conceptMode) {
+	switch (conceptMode) {
+	case 3:
+		return concept->checkWordId2();
+
+	case 5:
+		return concept->checkWordClass();
+
+	case 8:
+		return concept->checkWordId1();
+
+	case 9:
+		if (!concept->checkWordId3() && _sentenceConcept->_concept2P) {
+			if (!_sentenceConcept->_concept2P->checkWordId2() || !concept->checkWordId2()) {
+				return _sentenceConcept->_concept2P->checkWordClass() &&
+					concept->checkWordClass();
+			}
+		}
+		break;
+
+	default:
+		break;
+	}
+
+	return false;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 3e8c91c..512acbe 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -147,7 +147,6 @@ private:
 	int processRequests(TTword *word);
 
 	void addToConceptList(TTword *word);
-	int fn2(TTword *word);
 	int checkReferent(TTpronoun *pronoun);
 
 	/**
@@ -160,8 +159,15 @@ private:
 	 */
 	int addConcept(TTconcept *concept);
 
+	/**
+	 * Detaches a concept from the main concept list if prseent, then deletes it
+	 */
+	void removeConcept(TTconcept *concept);
+
 	int fn1();
+	int fn2(TTword *word);
 	bool fn3(TTconcept **v, int v2);
+	bool checkConcept2(TTconcept *concept, int conceptMode);
 public:
 	CScriptHandler *_owner;
 	TTsentenceConcept *_sentenceConcept;


Commit: 5576060aefbea46c8f3214005e8c791776c03b27
    https://github.com/scummvm/scummvm/commit/5576060aefbea46c8f3214005e8c791776c03b27
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:25-04:00

Commit Message:
TITANIC: Added TTparser filterConcepts

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 7b9f4c4..013e5f1 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -974,4 +974,26 @@ bool TTparser::checkConcept2(TTconcept *concept, int conceptMode) {
 	return false;
 }
 
+int TTparser::filterConcepts(int conceptMode, int conceptIndex) {
+	int result = 0;
+
+	for (TTconcept *currP = _conceptP; currP && !result; currP = currP->_nextP) {
+		if (checkConcept2(currP, conceptMode)) {
+			TTconcept **ptrPP = _sentenceConcept->setConcept(conceptIndex, currP);
+			TTconcept *newConcept = new TTconcept(*currP);
+			*ptrPP = newConcept;
+
+			if (newConcept->isValid()) {
+				removeConcept(currP);
+				(*ptrPP)->_nextP = nullptr;
+				result = 1;
+			} else {
+				result = -2;
+			}
+		}
+	}
+
+	return result;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 512acbe..d7e67b2 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -168,6 +168,7 @@ private:
 	int fn2(TTword *word);
 	bool fn3(TTconcept **v, int v2);
 	bool checkConcept2(TTconcept *concept, int conceptMode);
+	int filterConcepts(int conceptMode, int conceptIndex);
 public:
 	CScriptHandler *_owner;
 	TTsentenceConcept *_sentenceConcept;


Commit: 27417fa78d39e983b8a73947ddb476679d9ca953
    https://github.com/scummvm/scummvm/commit/27417fa78d39e983b8a73947ddb476679d9ca953
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:29-04:00

Commit Message:
TITANIC: Added TTparser resetConcept

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 013e5f1..dd33893 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -786,7 +786,7 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case OBJECT_IS_TO:
-				flag = fn3(&_sentenceConcept->_concept2P, 3);
+				flag = resetConcept(&_sentenceConcept->_concept2P, 3);
 				break;
 
 			case SEEK_ACTOR:
@@ -814,7 +814,11 @@ int TTparser::considerRequests(TTword *word) {
 			case SET_COLOR:
 			case ACTOR_IS_TO:
 			case ACTOR_IS_FROM:
+
 			case ACTOR_IS_OBJECT:
+				flag = resetConcept(&_sentenceConcept->_concept0P, 2);
+				break;
+
 			case STATE_IDENTITY:
 			case WORD_TYPE_IS_SENTENCE_TYPE:
 			case COMPLEX_VERB:
@@ -911,11 +915,6 @@ int TTparser::fn2(TTword *word) {
 	}
 }
 
-bool TTparser::fn3(TTconcept **v, int v2) {
-	// TODO
-	return false;
-}
-
 int TTparser::checkReferent(TTpronoun *pronoun) {
 	TTconcept *concept;
 
@@ -996,4 +995,17 @@ int TTparser::filterConcepts(int conceptMode, int conceptIndex) {
 	return result;
 }
 
+bool TTparser::resetConcept(TTconcept **conceptPP, int conceptIndex) {
+	TTconcept **ptrPP = _sentenceConcept->setConcept(conceptIndex, nullptr);
+
+	if (!*ptrPP)
+		return 0;
+
+	int result = _sentenceConcept->changeConcept(1, conceptPP, conceptIndex);
+	if (*conceptPP)
+		_sentenceConcept->setConcept(conceptIndex, *conceptPP);
+
+	return !result;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index d7e67b2..c8432c2 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -166,9 +166,9 @@ private:
 
 	int fn1();
 	int fn2(TTword *word);
-	bool fn3(TTconcept **v, int v2);
 	bool checkConcept2(TTconcept *concept, int conceptMode);
 	int filterConcepts(int conceptMode, int conceptIndex);
+	bool resetConcept(TTconcept **conceptPP, int conceptIndex);
 public:
 	CScriptHandler *_owner;
 	TTsentenceConcept *_sentenceConcept;


Commit: 986ab4b0d18e708fb74b9228bb7b21fd3695035d
    https://github.com/scummvm/scummvm/commit/986ab4b0d18e708fb74b9228bb7b21fd3695035d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:33-04:00

Commit Message:
TITANIC: Added TTsentence fn2 method

Changed paths:
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_concept_node.cpp
    engines/titanic/true_talk/tt_concept_node.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h



diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 98a6ee6..7fc56e7 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -39,7 +39,6 @@ private:
 	TTword *_wordP;
 	TTstring _string1;
 	int _field14;
-	ScriptType _scriptType;
 	int _field1C;
 	int _field20;
 	TTstring _string2;
@@ -75,6 +74,7 @@ private:
 	void initialize(TTconcept &src);
 public:
 	TTconcept *_nextP;
+	ScriptType _scriptType;
 public:
 	TTconcept();
 	TTconcept(TTscriptBase *script, ScriptType scriptType);
diff --git a/engines/titanic/true_talk/tt_concept_node.cpp b/engines/titanic/true_talk/tt_concept_node.cpp
index 956d87b..a98200b 100644
--- a/engines/titanic/true_talk/tt_concept_node.cpp
+++ b/engines/titanic/true_talk/tt_concept_node.cpp
@@ -115,6 +115,24 @@ TTconcept **TTconceptNode::setConcept(int conceptIndex, TTconcept *src) {
 	return conceptPP;
 }
 
+int TTconceptNode::replaceConcept(int mode, int conceptIndex, TTconcept *concept) {
+	TTconcept **conceptPP = setConcept(conceptIndex, concept);
+
+	if (mode == 0 || (mode == 1 && !*conceptPP)) {
+		if (!concept || !concept->isValid())
+			return SS_5;
+
+		if (mode == 0 && *conceptPP) {
+			delete *conceptPP;
+		}
+
+		*conceptPP = new TTconcept(*concept);
+		return (*conceptPP)->isValid() ? SS_VALID : SS_11;
+	} else {
+		return SS_1;
+	}
+}
+
 int TTconceptNode::changeConcept(int mode, TTconcept **conceptPP, int conceptIndex) {
 	TTconcept **newConceptPP = setConcept(conceptIndex, *conceptPP);
 
diff --git a/engines/titanic/true_talk/tt_concept_node.h b/engines/titanic/true_talk/tt_concept_node.h
index af2fd42..5e49e37 100644
--- a/engines/titanic/true_talk/tt_concept_node.h
+++ b/engines/titanic/true_talk/tt_concept_node.h
@@ -58,7 +58,12 @@ public:
 	bool isValid() const { return _status == SS_VALID; }
 
 	TTconcept **setConcept(int conceptIndex, TTconcept *src);
+	int replaceConcept(int mode, int conceptIndex, TTconcept *concept);
 	int changeConcept(int mode, TTconcept **conceptPP, int conceptIndex);
+
+	int concept1WordId() const {
+		return _concept1P ? _concept1P->getWordId() : 0;
+	}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index dd33893..c8bee25 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -504,7 +504,7 @@ int TTparser::findFrames(TTsentence *sentence) {
 	}
 
 	if (!status) {
-		status = fn1();
+		status = checkForAction();
 	}
 
 	delete line;
@@ -888,7 +888,7 @@ void TTparser::removeConcept(TTconcept *concept) {
 	delete concept;
 }
 
-int TTparser::fn1() {
+int TTparser::checkForAction() {
 	// TODO
 	return 0;
 }
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index c8432c2..5d43111 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -164,7 +164,7 @@ private:
 	 */
 	void removeConcept(TTconcept *concept);
 
-	int fn1();
+	int checkForAction();
 	int fn2(TTword *word);
 	bool checkConcept2(TTconcept *concept, int conceptMode);
 	int filterConcepts(int conceptMode, int conceptIndex);
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index a78a4ef..d269f41 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -107,4 +107,115 @@ int TTsentence::storeVocabHit(TTword *word) {
 	return 0;
 }
 
+bool TTsentence::fn2(int conceptIndex, const TTstring &str, TTconceptNode *conceptNode) {
+	if (!conceptNode)
+		conceptNode = &_sentenceConcept;
+	TTconcept *concept = getFrameSlot(conceptIndex, conceptNode);
+
+	if (!concept)
+		return str == "isEmpty";
+
+	bool abortFlag = false;
+	switch (concept->_scriptType) {
+	case 1:
+		if (str == "thePlayer")
+			abortFlag = 1;
+		break;
+
+	case 2:
+		if (str == "targetNpc")
+			abortFlag = 1;
+		break;
+
+	case 3:
+		if (str == "otherNpc")
+			abortFlag = 1;
+		break;
+
+	default:
+		break;
+	}
+
+	TTstring conceptText = concept->getText();
+	if (abortFlag || str == conceptText || concept->compareTo(str)) {
+		delete concept;
+		return true;
+	}
+
+	if (conceptIndex == 1 && g_vm->_exeResources._owner->_concept4P) {
+		if (str == g_vm->_exeResources._owner->_concept4P->getText() &&
+				conceptText == "do")
+			goto exit;
+	}
+
+	if (g_vm->_exeResources._owner->_concept2P && (conceptIndex == 0 ||
+			conceptIndex == 3 || conceptIndex == 4)) {
+		if (str == g_vm->_exeResources._owner->_concept2P->getText() &&
+				(conceptText == "it" || conceptText == "he" || conceptText == "she" ||
+				conceptText == "him" || conceptText == "her" || conceptText == "them" ||
+				conceptText == "they"))
+			goto exit;
+	}
+
+	if (g_vm->_exeResources._owner->_concept1P && (conceptIndex == 0 ||
+		conceptIndex == 2 || conceptIndex == 3 || conceptIndex == 4 || conceptIndex == 5)) {
+		if (str == g_vm->_exeResources._owner->_concept2P->getText() &&
+			(conceptText == "it" || conceptText == "that" || conceptText == "he" ||
+				conceptText == "she" || conceptText == "him" || conceptText == "her" ||
+				conceptText == "them" || conceptText == "they" || conceptText == "those" ||
+				conceptText == "1" || conceptText == "thing"))
+			goto exit;
+	}
+
+	if (g_vm->_exeResources._owner->_concept1P && (conceptIndex == 0 || conceptIndex == 2)) {
+		if (conceptText == "?" && str == g_vm->_exeResources._owner->_concept2P->getText()) {
+			delete concept;
+			concept = getFrameSlot(5, conceptNode);
+			conceptText = concept->getText();
+
+			if (conceptText == "it" || conceptText == "that" || conceptText == "he" ||
+				conceptText == "she" || conceptText == "him" || conceptText == "her" ||
+				conceptText == "them" || conceptText == "they" || conceptText == "those" ||
+				conceptText == "1" || conceptText == "thing")
+				abortFlag = true;
+		}
+	}
+
+exit:
+	delete concept;
+	return abortFlag;
+}
+
+bool TTsentence::fn4(int mode, int wordId, TTconcept *concept) {
+	if (!concept)
+		return false;
+
+	switch (mode) {
+	case 1:
+		return _sentenceConcept._concept1P && _sentenceConcept._concept1P->getWordId() == wordId;
+
+	case 5:
+		return _sentenceConcept._concept5P && _sentenceConcept._concept5P->getWordId() == wordId;
+
+	default:
+		return false;
+	}
+}
+
+TTconcept *TTsentence::getFrameSlot(int conceptIndex, TTconceptNode *conceptNode) {
+	TTconcept *newConcept = new TTconcept();
+	
+	if (!conceptNode)
+		conceptNode = &_sentenceConcept;
+	TTconcept *concept = conceptNode->_concepts[conceptIndex];
+	newConcept->copyFrom(concept);
+
+	if (!newConcept->isValid()) {
+		delete newConcept;
+		newConcept = nullptr;
+	}
+
+	return newConcept;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 6cee970..00f31b4 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -76,15 +76,24 @@ public:
 	void set34(int v) { _field34 = v; }
 	void set38(int v) { _field38 = v; }
 	bool check2C() const { return _field2C > 1 && _field2C <= 10; }
+	int concept18(TTconceptNode *conceptNode) {
+		return conceptNode ? conceptNode->get18() : 0;
+	}
+	int get58() const { return _field58; }
 
 	int getStatus() const { return _status; }
 
+	TTconcept *getFrameSlot(int conceptIndex, TTconceptNode *conceptNode);
+
 	/**
 	 * Adds a found vocab word to the list of words representing
 	 * the player's input
 	 * @param word		Word to node
 	 */
 	int storeVocabHit(TTword *word);
+
+	bool fn2(int conceptIndex, const TTstring &str, TTconceptNode *conceptNode);
+	bool fn4(int mode, int wordId, TTconcept *concept);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index 1491937..58914130 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -95,11 +95,11 @@ TTstring &TTstring::operator+=(char c) {
 	return *this;
 }
 
-bool TTstring::operator==(const TTstring &str) {
+bool TTstring::operator==(const TTstring &str) const {
 	return _data && str._data && _data->_string == str._data->_string;
 }
 
-bool TTstring::operator==(const char *str) {
+bool TTstring::operator==(const char *str) const {
 	return _data && _data->_string == str;
 }
 
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 060a48f..b6ec859 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -57,8 +57,8 @@ public:
 	TTstring &operator+=(const char *str);
 	TTstring &operator+=(const TTstring &str);
 	TTstring &operator+=(char c);
-	bool operator==(const TTstring &str);
-	bool operator==(const char *str);
+	bool operator==(const TTstring &str) const;
+	bool operator==(const char *str) const;
 
 	const char &operator[](int index) {
 		return *(c_str() + index);


Commit: 1992afe4aa5ff8b02d38a0038fc390b6280ab358
    https://github.com/scummvm/scummvm/commit/1992afe4aa5ff8b02d38a0038fc390b6280ab358
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:36-04:00

Commit Message:
TITANIC: Added TTconceptNode createConcept

Changed paths:
    engines/titanic/true_talk/tt_concept_node.cpp
    engines/titanic/true_talk/tt_concept_node.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/tt_concept_node.cpp b/engines/titanic/true_talk/tt_concept_node.cpp
index a98200b..454ca59 100644
--- a/engines/titanic/true_talk/tt_concept_node.cpp
+++ b/engines/titanic/true_talk/tt_concept_node.cpp
@@ -148,4 +148,18 @@ int TTconceptNode::changeConcept(int mode, TTconcept **conceptPP, int conceptInd
 	}
 }
 
+bool TTconceptNode::createConcept(int mode, int conceptIndex, TTword *word) {
+	TTconcept *newConcept = new TTconcept(word, ST_UNKNOWN_SCRIPT);
+	TTconcept **conceptPP = setConcept(conceptIndex, newConcept);
+
+	if (mode == 0 || (mode == 1 && !*conceptPP)) {
+		delete *conceptPP;
+		*conceptPP = newConcept;
+		return false;
+	} else {
+		delete newConcept;
+		return true;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_concept_node.h b/engines/titanic/true_talk/tt_concept_node.h
index 5e49e37..9a1c3a9 100644
--- a/engines/titanic/true_talk/tt_concept_node.h
+++ b/engines/titanic/true_talk/tt_concept_node.h
@@ -60,10 +60,14 @@ public:
 	TTconcept **setConcept(int conceptIndex, TTconcept *src);
 	int replaceConcept(int mode, int conceptIndex, TTconcept *concept);
 	int changeConcept(int mode, TTconcept **conceptPP, int conceptIndex);
+	bool createConcept(int mode, int conceptIndex, TTword *word);
 
 	int concept1WordId() const {
 		return _concept1P ? _concept1P->getWordId() : 0;
 	}
+	int concept5WordId() const {
+		return _concept5P ? _concept5P->getWordId() : 0;
+	}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index c8bee25..3741ab7 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -791,9 +791,14 @@ int TTparser::considerRequests(TTword *word) {
 
 			case SEEK_ACTOR:
 				if (_sentenceConcept->_concept0P) {
+					if (_sentenceConcept->_concept0P->compareTo("?") &&
+							_sentenceConcept->_concept1P->isWordId(113) &&
+							word->_wordClass == WC_THING) {
+						// TODO
+					}
 
-				}
-				else {
+
+				} else {
 
 				}
 				break;
@@ -804,12 +809,33 @@ int TTparser::considerRequests(TTword *word) {
 			case SEEK_FROM:
 			case SEEK_TO_OVERRIDE:
 			case SEEK_FROM_OVERRIDE:
+				if (_sentenceConcept->_concept4P) {
+					delete _sentenceConcept->_concept4P;
+					_sentenceConcept->_concept4P = nullptr;
+				}
+
+				addNode(8);
+				flag = true;
+				break;
+
 			case SEEK_LOCATION:
 			case SEEK_OWNERSHIP:
 			case SEEK_STATE:
 			case SEEK_MODIFIERS:
 			case SEEK_NEW_FRAME:
 			case SEEK_STATE_OBJECT:
+				if (!_sentenceConcept->_concept5P) {
+					addToConceptList(word);
+				} else if (_sentenceConcept->concept5WordId() == 113 ||
+						_sentenceConcept->concept5WordId() == 112) {
+					_sentenceConcept->createConcept(1, 2, word);
+				} else {
+					addToConceptList(word);
+				}
+
+				flag = true;
+				break;
+
 			case SET_ACTION:
 			case SET_COLOR:
 			case ACTOR_IS_TO:
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index d269f41..06ddb6b 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -218,4 +218,16 @@ TTconcept *TTsentence::getFrameSlot(int conceptIndex, TTconceptNode *conceptNode
 	return newConcept;
 }
 
+int TTsentence::is18(int val, const TTconceptNode *node) const {
+	if (!node)
+		node = &_sentenceConcept;
+	return node->_field18 == val;
+}
+
+int TTsentence::is1C(int val, const TTconceptNode *node) const {
+	if (!node)
+		node = &_sentenceConcept;
+	return node->_field1C == val;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 00f31b4..83416cb 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -80,6 +80,8 @@ public:
 		return conceptNode ? conceptNode->get18() : 0;
 	}
 	int get58() const { return _field58; }
+	int is18(int val, const TTconceptNode *node) const;
+	int is1C(int val, const TTconceptNode *node) const;
 
 	int getStatus() const { return _status; }
 


Commit: f98ad3313499c8c6375f3216f5ae6ddb8faa3271
    https://github.com/scummvm/scummvm/commit/f98ad3313499c8c6375f3216f5ae6ddb8faa3271
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:40-04:00

Commit Message:
TITANIC: In-progress TTparser checkForAction

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_string.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 3741ab7..a0eb6a5 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -915,8 +915,88 @@ void TTparser::removeConcept(TTconcept *concept) {
 }
 
 int TTparser::checkForAction() {
+	int status = SS_VALID;
+	bool flag = false;
+	bool actionFlag = false;
+
+	if (_conceptP && _currentWordP) {
+		// Firstly we need to get the next word to process, and remove it from
+		// the list pointed to by _currentWordP
+		TTword *word = _currentWordP;	
+		if (word->_nextP) {
+			// Chain of words, so we need to find the last word of the chain,
+			// and set the last-but-one's _nextP to nullptr to detach the last one
+			TTword *prior = nullptr;
+			for (word = word->_nextP; word->_nextP; word = word->_nextP) {
+				prior = word;
+			}
+
+			if (prior)
+				prior->_nextP = nullptr;
+		} else {
+			// No chain, so singular word can simply be removed
+			_currentWordP = nullptr;
+			if (word->_id == 906 && _sentence->_field2C == 1)
+				_sentence->_field2C = 12;
+		}
+
+		if (word->_text == "do" || word->_text == "doing" || word->_text == "does" ||
+				word->_text == "done") {
+			TTstring doStr("do");
+			TTaction *action = new TTaction(doStr, WC_ACTION, 112, 0, _sentenceConcept->get18());
+			
+			if (!action->isValid()) {
+				status = SS_4;
+			} else {
+				// Have the new action replace the old word instance
+				delete word;
+				word = action;
+				actionFlag = true;
+			}
+		}
+
+		addToConceptList(word);
+		delete word;
+		flag = true;
+	}
+
+	// Handle any remaining words
+	TTword *reqWord = nullptr;
+	while (_currentWordP) {
+		if (considerRequests(_currentWordP) > 1) {
+			reqWord = _currentWordP;
+		} else {
+			// Delete the top of the word chain
+			TTword *wordP = _currentWordP;
+			_currentWordP = _currentWordP->_nextP;
+			delete wordP;
+		}
+	}
+
+	if (flag && _conceptP) {
+		if (actionFlag && (!_sentenceConcept->_concept1P || _sentenceConcept->_concept1P->isWordId(113))) {
+			_sentenceConcept->replaceConcept(0, 1, _conceptP);
+		} else if (!_sentenceConcept->_concept5P) {
+			_sentenceConcept->replaceConcept(1, 5, _conceptP);
+		} else if (_sentenceConcept->_concept5P->isWordId(904)) {
+			_sentenceConcept->replaceConcept(0, 5, _conceptP);
+		}
+
+		removeConcept(_conceptP);
+	}
+
+	if (_sentence->fn2(3, TTstring("thePlayer"), _sentenceConcept) && !flag) {
+		if (_sentenceConcept->concept1WordId() == 101) {
+			_sentence->_field2C = 16;
+		} else if (_sentence->_field2C != 18 && _sentenceConcept->concept1WordId() == 102) {
+			if (_sentence->fn2(0, TTstring("targetNpc"), _sentenceConcept))
+				_sentence->_field2C = 15;
+		}
+	}
+
+
 	// TODO
-	return 0;
+	return status;
 }
 
 int TTparser::fn2(TTword *word) {
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index b6ec859..3e8718d 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -38,7 +38,7 @@ struct TTstringData {
 	TTstringData(const CString &str) : _string(str), _referenceCount(1) {}
 };
 
-enum TTstringStatus { SS_VALID = 0, SS_1 = 1, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_11 = 11, SS_13 = 13 };
+enum TTstringStatus { SS_VALID = 0, SS_1 = 1, SS_4 = 4, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_11 = 11, SS_13 = 13 };
 
 class TTstring {
 private:
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 062b598..350fc71 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -131,7 +131,7 @@ int TTvocab::load(const CString &name) {
 }
 
 void TTvocab::addWord(TTword *word) {
-	TTword *existingWord = findWord(word->_string);
+	TTword *existingWord = findWord(word->_text);
 
 	if (existingWord) {
 		if (word->_synP) {
@@ -540,7 +540,7 @@ TTword *TTvocab::getPrefixedWord(TTstring &str) const {
 		if (word->hasSynonyms())
 			word->setSynStr(str);
 		else
-			word->_string = str;
+			word->_text = str;
 	}
 
 	delete tempStr;
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index e799507..1bf4783 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -26,7 +26,7 @@
 
 namespace Titanic {
 
-TTword::TTword(TTstring &str, WordClass wordClass, int id) : _string(str),
+TTword::TTword(TTstring &str, WordClass wordClass, int id) : _text(str),
 		_wordClass(wordClass), _id(id), _tag(0), _field24(0),
 		_field28(0), _synP(nullptr), _nextP(nullptr) {
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
@@ -38,7 +38,7 @@ TTword::TTword(const TTword *src) {
 		return;
 	}
 
-	_string = src->_string;
+	_text = src->_text;
 	_wordClass = src->_wordClass;
 	_id = src->_id;
 	_tag = src->_tag;
@@ -138,7 +138,7 @@ int TTword::load(SimpleFile *file, WordClass wordClass) {
 	int id;
 
 	if (file->scanf("%d %s %s", &id, &str1, &str2)) {
-		_string = str1;
+		_text = str1;
 		_id = id;
 		_tag = readNumber(str2.c_str());
 		_wordClass = wordClass;
@@ -186,7 +186,7 @@ bool TTword::findSynByName(const TTstring &str, TTsynonym *dest, int mode) const
 }
 
 bool TTword::compareTo(const char *str) const {
-	return _string == str;
+	return _text == str;
 }
 
 TTword *TTword::copy() const {
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 94edee3..ef90796 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -59,7 +59,7 @@ protected:
 public:
 	TTword *_nextP;
 	TTsynonym *_synP;
-	TTstring _string;
+	TTstring _text;
 	WordClass _wordClass;
 	int _id;
 	uint _tag;
@@ -111,13 +111,13 @@ public:
 	 */
 	bool findSynByName(const TTstring &str, TTsynonym *dest, int mode) const;
 
-	const char *c_str() const { return _string.c_str(); }
+	const char *c_str() const { return _text.c_str(); }
 	operator const char *() const { return c_str(); }
 
 	/**
 	 * Return the text of the word
 	 */
-	const TTstring getText() { return _string; }
+	const TTstring getText() { return _text; }
 
 	/**
 	 * Compares the word's text to a passed string
@@ -137,6 +137,11 @@ public:
 	TTstringStatus getStatus() const { return _status; }
 
 	/**
+	 * Returns true if the word is in a valid state
+	 */
+	bool isValid() const { return _status == SS_VALID; }
+
+	/**
 	 * Return the status of the entire word chain
 	 */
 	TTstringStatus getChainStatus() const;


Commit: 35f18390636c74c35af55426d6f48d9db59707bd
    https://github.com/scummvm/scummvm/commit/35f18390636c74c35af55426d6f48d9db59707bd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:43-04:00

Commit Message:
TITANIC: More work on TTparser considerRequests

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index a0eb6a5..cc3ee2f 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -819,6 +819,11 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case SEEK_LOCATION:
+				addNode(5);
+				_sentenceConcept->createConcept(0, 5, word);
+				flag = true;
+				break;
+
 			case SEEK_OWNERSHIP:
 			case SEEK_STATE:
 			case SEEK_MODIFIERS:
@@ -837,15 +842,35 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case SET_ACTION:
-			case SET_COLOR:
+				if (_sentence->fn4(1, 104, _sentenceConcept) ||
+						_sentence->fn4(1, 107, _sentenceConcept)) {
+					concept = _sentenceConcept->_concept1P;
+					_sentenceConcept->_concept1P = nullptr;
+					addNode(15);
+				}
+
+				if (_sentence->check2C() && word->_id == 113)
+					addNode(4);
+
+				if (word->_wordClass == WC_ACTION)
+					_sentenceConcept->createConcept(0, 1, word);
+
+				flag = true;
+				break;
+
 			case ACTOR_IS_TO:
+				_sentenceConcept->changeConcept(1, &_sentenceConcept->_concept0P, 3);
+				flag = true;
+				break;
+
 			case ACTOR_IS_FROM:
+				_sentenceConcept->changeConcept(1, &_sentenceConcept->_concept0P, 4);
+				break;
 
 			case ACTOR_IS_OBJECT:
 				flag = resetConcept(&_sentenceConcept->_concept0P, 2);
 				break;
 
-			case STATE_IDENTITY:
 			case WORD_TYPE_IS_SENTENCE_TYPE:
 			case COMPLEX_VERB:
 				// TODO
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 06ddb6b..d619c9e 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -186,16 +186,16 @@ exit:
 	return abortFlag;
 }
 
-bool TTsentence::fn4(int mode, int wordId, TTconcept *concept) {
-	if (!concept)
-		return false;
+bool TTsentence::fn4(int mode, int wordId, TTconceptNode *node) {
+	if (!node)
+		node = &_sentenceConcept;
 
 	switch (mode) {
 	case 1:
-		return _sentenceConcept._concept1P && _sentenceConcept._concept1P->getWordId() == wordId;
+		return node->_concept1P && node->_concept1P->getWordId() == wordId;
 
 	case 5:
-		return _sentenceConcept._concept5P && _sentenceConcept._concept5P->getWordId() == wordId;
+		return node->_concept5P && node->_concept5P->getWordId() == wordId;
 
 	default:
 		return false;
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 83416cb..d168d48 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -95,7 +95,7 @@ public:
 	int storeVocabHit(TTword *word);
 
 	bool fn2(int conceptIndex, const TTstring &str, TTconceptNode *conceptNode);
-	bool fn4(int mode, int wordId, TTconcept *concept);
+	bool fn4(int mode, int wordId, TTconceptNode *node);
 };
 
 } // End of namespace Titanic


Commit: 63439a1c94d0279e6b00e8663d3ae554a3379b0f
    https://github.com/scummvm/scummvm/commit/63439a1c94d0279e6b00e8663d3ae554a3379b0f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:46-04:00

Commit Message:
TITANIC: Finished TTparser checkForAction

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index cc3ee2f..498c0cc 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -1019,8 +1019,56 @@ int TTparser::checkForAction() {
 		}
 	}
 
+	if (_sentence->fn2(2, TTstring("thePlayer"), _sentenceConcept) &&
+			_sentenceConcept->concept1WordId() == 101 && flag)
+		_sentence->_field2C = 17;
+
+	if (!_sentenceConcept->_concept0P && !_sentenceConcept->_concept1P &&
+			!_sentenceConcept->_concept2P && !_sentenceConcept->_concept5P && !flag) {
+		if (_conceptP)
+			filterConcepts(5, 2);
+
+		if (!_sentenceConcept->_concept2P && _sentence->_field2C == 1)
+			_sentence->_field2C = 0;
+	}
+
+	if (_sentence->_field58 < 5 && _sentence->_field2C == 1 && !flag)
+		_sentence->_field2C = 19;
+
+	for (TTconceptNode *nodeP = &_sentence->_sentenceConcept; nodeP; nodeP = nodeP->_nextP) {
+		if (nodeP->_field18 == 0 && nodeP->_concept1P) {
+			nodeP->_field18 = _sentence->concept18(nodeP);
+		} else if (nodeP->_field18 == 4 && !_sentenceConcept->_concept0P) {
+			if (_sentenceConcept->_concept3P) {
+				_sentenceConcept->_concept0P = _sentenceConcept->_concept3P;
+				_sentenceConcept->_concept3P = nullptr;
+			} else if (_sentenceConcept->_concept2P) {
+				_sentenceConcept->_concept0P = _sentenceConcept->_concept2P;
+				_sentenceConcept->_concept2P = nullptr;
+			}
+		}
+	}
+
+	if (_sentence->_field2C == 1 && _sentenceConcept->_concept5P &&
+			_sentenceConcept->_concept2P) {
+		if (_sentence->fn4(1, 113, nullptr)) {
+			if (_sentence->fn2(2, TTstring("targetNpc"), nullptr)) {
+				_sentence->_field2C = 20;
+			} else if (_sentence->fn2(2, TTstring("thePlayer"), nullptr)) {
+				_sentence->_field2C = 21;
+			} else {
+				_sentence->_field2C = 22;
+			}
+		}
+	} else if (!_sentenceConcept->_concept0P && !_sentenceConcept->_concept1P &&
+			!_sentenceConcept->_concept2P && !_sentenceConcept->_concept5P) {
+		if (_conceptP)
+			filterConcepts(5, 2);
+
+		if (!_sentenceConcept->_concept2P && _sentence->_field2C == 1)
+			_sentence->_field2C = 0;
+	}
 
-	// TODO
 	return status;
 }
 


Commit: 1fff06e97a2d29aa94c4a5a4ee3c08f310ece0d3
    https://github.com/scummvm/scummvm/commit/1fff06e97a2d29aa94c4a5a4ee3c08f310ece0d3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:49-04:00

Commit Message:
TITANIC: Added TTparser processRequests

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 498c0cc..5a94196 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -888,8 +888,44 @@ int TTparser::considerRequests(TTword *word) {
 }
 
 int TTparser::processRequests(TTword *word) {
-	// TODO
-	return 0;
+	int status = loadRequests(word);
+	switch (status) {
+	case 0:
+		status = considerRequests(word);
+		
+		// Iterate through the words
+		while (_currentWordP) {
+			considerRequests(_currentWordP);
+			TTword *nextP = _currentWordP->_nextP;
+
+			delete _currentWordP;
+			_currentWordP = nextP;
+		}
+		break;
+
+	case 1: {
+		TTword *newWord = new TTword(word);
+		newWord->_nextP = nullptr;
+
+		// Add word to word chain
+		if (_currentWordP) {
+			// Add at end of existing chain
+			for (word = _currentWordP; word->_nextP; word = word->_nextP)
+				;
+			word->_nextP = newWord;
+		} else {
+			// First word, so set as head
+			_currentWordP = newWord;
+		}
+		break;
+	}
+
+	default:
+		warning("unexpected return from consider requests");
+		break;
+	}
+
+	return status;
 }
 
 void TTparser::addToConceptList(TTword *word) {


Commit: 409271778e35b5089330abd589e3304f6f25064a
    https://github.com/scummvm/scummvm/commit/409271778e35b5089330abd589e3304f6f25064a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:52-04:00

Commit Message:
TITANIC: Added TTparser removeNode

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 5a94196..f2abe5e 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -975,6 +975,14 @@ void TTparser::removeConcept(TTconcept *concept) {
 	delete concept;
 }
 
+void TTparser::removeNode(TTparserNode *node) {
+	if (!node->_priorP)
+		// Node is the head of the chain, so reset parser's nodes pointer
+		_nodesP = static_cast<TTparserNode *>(node->_nextP);
+
+	delete node;
+}
+
 int TTparser::checkForAction() {
 	int status = SS_VALID;
 	bool flag = false;
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 5d43111..95a3be4 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -164,6 +164,12 @@ private:
 	 */
 	void removeConcept(TTconcept *concept);
 
+	/**
+	 * Detaches a node from the main node list
+	 */
+	void removeNode(TTparserNode *node);
+
+
 	int checkForAction();
 	int fn2(TTword *word);
 	bool checkConcept2(TTconcept *concept, int conceptMode);


Commit: de1bb1e95c1a6eec7b0b505d1e4d44bb1a6f5098
    https://github.com/scummvm/scummvm/commit/de1bb1e95c1a6eec7b0b505d1e4d44bb1a6f5098
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:56-04:00

Commit Message:
TITANIC: In-progress TTparser processModifiers

Changed paths:
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h



diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 7fc56e7..0a14482 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -41,7 +41,6 @@ private:
 	int _field14;
 	int _field1C;
 	int _field20;
-	TTstring _string2;
 	TTword *_word2P;
 	int _field30;
 	int _field34;
@@ -75,6 +74,7 @@ private:
 public:
 	TTconcept *_nextP;
 	ScriptType _scriptType;
+	TTstring _string2;
 public:
 	TTconcept();
 	TTconcept(TTscriptBase *script, ScriptType scriptType);
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index f2abe5e..9b078b4 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -1231,4 +1231,24 @@ bool TTparser::resetConcept(TTconcept **conceptPP, int conceptIndex) {
 	return !result;
 }
 
+int TTparser::processModifiers(int modifier, TTword *word) {
+	TTconcept *newConcept = new TTconcept(word, ST_UNKNOWN_SCRIPT);
+
+	for (TTword *currP = _currentWordP; currP != word; currP = currP->_nextP) {
+		if ((modifier == 2 && currP->_wordClass == WC_ADJECTIVE) ||
+				(modifier == 1 && currP->_wordClass == WC_ADVERB)) {
+			newConcept->_string2 += ' ';
+			newConcept->_string2 += _currentWordP->getText();
+		} else if (word->_id == 113 && currP->_wordClass == WC_ADJECTIVE) {
+			addToConceptList(currP);
+			addNode(13);
+		}
+
+		if (modifier == 2 || modifier == 3) {
+			// TODO
+		}
+	}
+	return 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 95a3be4..7aa47fd 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -169,6 +169,7 @@ private:
 	 */
 	void removeNode(TTparserNode *node);
 
+	int processModifiers(int modifier, TTword *word);
 
 	int checkForAction();
 	int fn2(TTword *word);


Commit: 5ffe93ad9b78d1354df62dff2bbbb743629c56f3
    https://github.com/scummvm/scummvm/commit/5ffe93ad9b78d1354df62dff2bbbb743629c56f3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:15:59-04:00

Commit Message:
TITANIC: Finished TTparser processModifiers

Changed paths:
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_parser.cpp



diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 0a14482..5864660 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -38,12 +38,9 @@ private:
 	TTscriptBase *_scriptP;
 	TTword *_wordP;
 	TTstring _string1;
-	int _field14;
 	int _field1C;
-	int _field20;
 	TTword *_word2P;
 	int _field30;
-	int _field34;
 	bool _flag;
 	int _status;
 private:
@@ -74,6 +71,9 @@ private:
 public:
 	TTconcept *_nextP;
 	ScriptType _scriptType;
+	int _field14;
+	int _field20;
+	int _field34;
 	TTstring _string2;
 public:
 	TTconcept();
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 9b078b4..2cc9346 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -1234,7 +1234,8 @@ bool TTparser::resetConcept(TTconcept **conceptPP, int conceptIndex) {
 int TTparser::processModifiers(int modifier, TTword *word) {
 	TTconcept *newConcept = new TTconcept(word, ST_UNKNOWN_SCRIPT);
 
-	for (TTword *currP = _currentWordP; currP != word; currP = currP->_nextP) {
+	// Cycles through each word
+	for (TTword *currP = _currentWordP; currP != word; currP = _currentWordP) {
 		if ((modifier == 2 && currP->_wordClass == WC_ADJECTIVE) ||
 				(modifier == 1 && currP->_wordClass == WC_ADVERB)) {
 			newConcept->_string2 += ' ';
@@ -1245,9 +1246,70 @@ int TTparser::processModifiers(int modifier, TTword *word) {
 		}
 
 		if (modifier == 2 || modifier == 3) {
-			// TODO
+			switch (_currentWordP->_id) {
+			case 94:
+				_currentConceptP->setOwner(newConcept);
+				if (_currentWordP) {
+					_currentWordP->deleteSiblings();
+					delete _currentWordP;
+					_currentWordP = nullptr;
+				}
+
+				delete newConcept;
+				newConcept = nullptr;
+				break;
+
+			case 204:
+				newConcept->_field34 = 1;
+				if (_sentence->_field2C == 1)
+					_sentence->_field2C = 12;
+				newConcept->_field14 = 1;
+				break;
+
+			case 300:
+				newConcept->set1C(atoi(_currentWordP->_text.c_str()));
+				break;
+
+			case 400:
+				newConcept->_field14 = 2;
+				break;
+
+			case 401:
+				newConcept->_field14 = 1;
+				break;
+
+			case 601:
+				newConcept->setOwner(_currentWordP, false);
+				break;
+
+			case 608:
+				if (_currentWordP->comparePronounTo(10)) {
+					newConcept->_field20 = 1;
+				} else if (_currentWordP->comparePronounTo(11)) {
+					newConcept->_field20 = 2;
+				}
+
+			default:
+				break;
+			}
+		}
+
+		if (_currentWordP) {
+			// Detaches word and deletes it
+			TTword *wordP = _currentWordP;
+			_currentWordP = wordP->_nextP;
+
+			wordP->_nextP = nullptr;
+			delete wordP;
 		}
 	}
+
+	if (newConcept) {
+		newConcept->setFlag(true);
+		_currentConceptP = newConcept;
+		addConcept(newConcept);
+	}
+
 	return 0;
 }
 


Commit: 8a3118912191736620580fd4ead9b19b15d3c3dd
    https://github.com/scummvm/scummvm/commit/8a3118912191736620580fd4ead9b19b15d3c3dd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:02-04:00

Commit Message:
TITANIC: Adding more to TTparser considerRequests, and support methods

Changed paths:
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 5864660..9d067ad 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -35,8 +35,6 @@ class TTword;
 
 class TTconcept {
 private:
-	TTscriptBase *_scriptP;
-	TTword *_wordP;
 	TTstring _string1;
 	int _field1C;
 	TTword *_word2P;
@@ -70,6 +68,8 @@ private:
 	void initialize(TTconcept &src);
 public:
 	TTconcept *_nextP;
+	TTscriptBase *_scriptP;
+	TTword *_wordP;
 	ScriptType _scriptType;
 	int _field14;
 	int _field20;
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 2cc9346..748c19a 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -731,6 +731,7 @@ int TTparser::considerRequests(TTword *word) {
 	TTconcept *concept = nullptr;
 	int status = 0;
 	bool flag = false;
+	bool modifierFlag = false;
 
 	while (word) {
 		//int ecx = 906;
@@ -827,6 +828,71 @@ int TTparser::considerRequests(TTword *word) {
 			case SEEK_OWNERSHIP:
 			case SEEK_STATE:
 			case SEEK_MODIFIERS:
+				if (!modifierFlag) {
+					bool tempFlag = false;
+
+					switch (word->_wordClass) {
+					case WC_ACTION:
+						status = processModifiers(1, word);
+						break;
+					case WC_THING:
+						status = processModifiers(2, word);
+						break;
+					case WC_ABSTRACT:
+						if (word->_id != 300) {
+							status = processModifiers(3, word);
+						} else if (!_conceptP->findByWordClass(WC_THING)) {
+							status = processModifiers(3, word);
+						} else {
+							word->_id = atoi(word->_text.c_str());
+						}
+						break;
+					case WC_PRONOUN:
+						if (word->_id != 602)
+							addToConceptList(word);
+						break;
+					case WC_ADJECTIVE: {
+						TTconcept *concept = _conceptP->findByWordClass(WC_THING);
+						if (concept) {
+							concept->_string2 += ' ';
+							concept->_string2 += word->getText();
+						} else {
+							status = processModifiers(8, word);
+						}
+						break;
+					}
+					case WC_ADVERB:
+						if (word->_id == 906) {
+							for (TTconcept *currP = _conceptP; currP; currP = currP->_nextP) {
+								if (_sentence->isFrameSlotClass(1, WC_ACTION) ||
+										_sentence->isFrameSlotClass(1, WC_THING))
+									currP->_field34 = 1;
+							}
+						} else {
+							TTconcept *conceptP = _conceptP->findByWordClass(WC_ACTION);
+
+							if (conceptP) {
+								conceptP->_string2 += ' ';
+								conceptP->_string2 += word->getText();
+							} else {
+								tempFlag = true;
+							}
+						}
+						break;
+					default:
+						addToConceptList(word);
+						status = 0;
+						break;
+					}
+
+					if (tempFlag)
+						status = _sentenceConcept->createConcept(1, 5, word);
+
+					modifierFlag = true;
+					flag = true;
+				}
+				break;
+
 			case SEEK_NEW_FRAME:
 			case SEEK_STATE_OBJECT:
 				if (!_sentenceConcept->_concept5P) {
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index d619c9e..c777464 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -107,10 +107,10 @@ int TTsentence::storeVocabHit(TTword *word) {
 	return 0;
 }
 
-bool TTsentence::fn2(int conceptIndex, const TTstring &str, TTconceptNode *conceptNode) {
+bool TTsentence::fn2(int slotIndex, const TTstring &str, TTconceptNode *conceptNode) {
 	if (!conceptNode)
 		conceptNode = &_sentenceConcept;
-	TTconcept *concept = getFrameSlot(conceptIndex, conceptNode);
+	TTconcept *concept = getFrameSlot(slotIndex, conceptNode);
 
 	if (!concept)
 		return str == "isEmpty";
@@ -142,14 +142,14 @@ bool TTsentence::fn2(int conceptIndex, const TTstring &str, TTconceptNode *conce
 		return true;
 	}
 
-	if (conceptIndex == 1 && g_vm->_exeResources._owner->_concept4P) {
+	if (slotIndex == 1 && g_vm->_exeResources._owner->_concept4P) {
 		if (str == g_vm->_exeResources._owner->_concept4P->getText() &&
 				conceptText == "do")
 			goto exit;
 	}
 
-	if (g_vm->_exeResources._owner->_concept2P && (conceptIndex == 0 ||
-			conceptIndex == 3 || conceptIndex == 4)) {
+	if (g_vm->_exeResources._owner->_concept2P && (slotIndex == 0 ||
+			slotIndex == 3 || slotIndex == 4)) {
 		if (str == g_vm->_exeResources._owner->_concept2P->getText() &&
 				(conceptText == "it" || conceptText == "he" || conceptText == "she" ||
 				conceptText == "him" || conceptText == "her" || conceptText == "them" ||
@@ -157,8 +157,8 @@ bool TTsentence::fn2(int conceptIndex, const TTstring &str, TTconceptNode *conce
 			goto exit;
 	}
 
-	if (g_vm->_exeResources._owner->_concept1P && (conceptIndex == 0 ||
-		conceptIndex == 2 || conceptIndex == 3 || conceptIndex == 4 || conceptIndex == 5)) {
+	if (g_vm->_exeResources._owner->_concept1P && (slotIndex == 0 ||
+		slotIndex == 2 || slotIndex == 3 || slotIndex == 4 || slotIndex == 5)) {
 		if (str == g_vm->_exeResources._owner->_concept2P->getText() &&
 			(conceptText == "it" || conceptText == "that" || conceptText == "he" ||
 				conceptText == "she" || conceptText == "him" || conceptText == "her" ||
@@ -167,7 +167,7 @@ bool TTsentence::fn2(int conceptIndex, const TTstring &str, TTconceptNode *conce
 			goto exit;
 	}
 
-	if (g_vm->_exeResources._owner->_concept1P && (conceptIndex == 0 || conceptIndex == 2)) {
+	if (g_vm->_exeResources._owner->_concept1P && (slotIndex == 0 || slotIndex == 2)) {
 		if (conceptText == "?" && str == g_vm->_exeResources._owner->_concept2P->getText()) {
 			delete concept;
 			concept = getFrameSlot(5, conceptNode);
@@ -202,12 +202,16 @@ bool TTsentence::fn4(int mode, int wordId, TTconceptNode *node) {
 	}
 }
 
-TTconcept *TTsentence::getFrameSlot(int conceptIndex, TTconceptNode *conceptNode) {
-	TTconcept *newConcept = new TTconcept();
-	
+TTconcept *TTsentence::getFrameEntry(int slotIndex, const TTconceptNode *conceptNode) const {
 	if (!conceptNode)
 		conceptNode = &_sentenceConcept;
-	TTconcept *concept = conceptNode->_concepts[conceptIndex];
+
+	return conceptNode->_concepts[slotIndex];
+}
+
+TTconcept *TTsentence::getFrameSlot(int slotIndex, const TTconceptNode *conceptNode) const {
+	TTconcept *newConcept = new TTconcept();
+	TTconcept *concept = getFrameEntry(slotIndex, conceptNode);
 	newConcept->copyFrom(concept);
 
 	if (!newConcept->isValid()) {
@@ -218,6 +222,15 @@ TTconcept *TTsentence::getFrameSlot(int conceptIndex, TTconceptNode *conceptNode
 	return newConcept;
 }
 
+bool TTsentence::isFrameSlotClass(int slotIndex, WordClass wordClass, const TTconceptNode *conceptNode) const {
+	TTconcept *concept = getFrameEntry(slotIndex, conceptNode);
+	if (concept && concept->_wordP) {
+		return concept->_wordP->isClass(wordClass);
+	} else {
+		return false;
+	}
+}
+
 int TTsentence::is18(int val, const TTconceptNode *node) const {
 	if (!node)
 		node = &_sentenceConcept;
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index d168d48..f51ca4b 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -85,7 +85,20 @@ public:
 
 	int getStatus() const { return _status; }
 
-	TTconcept *getFrameSlot(int conceptIndex, TTconceptNode *conceptNode);
+	/**
+	 * Gets a concept slot
+	 */
+	TTconcept *getFrameEntry(int slotIndex, const TTconceptNode *conceptNode = nullptr) const;
+
+	/**
+	 * Gets a conecpt slot and returns a duplicate of it
+	 */
+	TTconcept *getFrameSlot(int slotIndex, const TTconceptNode *conceptNode = nullptr) const;
+
+	/**
+	 * Returns true if the specified slot has an attached word with a given class
+	 */
+	bool isFrameSlotClass(int slotIndex, WordClass wordClass, const TTconceptNode *conceptNode = nullptr) const;
 
 	/**
 	 * Adds a found vocab word to the list of words representing
@@ -94,7 +107,7 @@ public:
 	 */
 	int storeVocabHit(TTword *word);
 
-	bool fn2(int conceptIndex, const TTstring &str, TTconceptNode *conceptNode);
+	bool fn2(int slotIndex, const TTstring &str, TTconceptNode *conceptNode);
 	bool fn4(int mode, int wordId, TTconceptNode *node);
 };
 


Commit: 23cd7fd2994c6438a37b243af432d5027ee6aeb8
    https://github.com/scummvm/scummvm/commit/23cd7fd2994c6438a37b243af432d5027ee6aeb8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:06-04:00

Commit Message:
TITANIC: Fleshing out TTparser considerRequests

Changed paths:
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_major_word.cpp
    engines/titanic/true_talk/tt_major_word.h
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_picture.cpp
    engines/titanic/true_talk/tt_picture.h
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 9d067ad..835ff60 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -78,7 +78,7 @@ public:
 public:
 	TTconcept();
 	TTconcept(TTscriptBase *script, ScriptType scriptType);
-	TTconcept(TTword *word, ScriptType scriptType);
+	TTconcept(TTword *word, ScriptType scriptType = ST_UNKNOWN_SCRIPT);
 	TTconcept(TTconcept &src);
 	~TTconcept();
 
diff --git a/engines/titanic/true_talk/tt_major_word.cpp b/engines/titanic/true_talk/tt_major_word.cpp
index 0085acc..18a56a4 100644
--- a/engines/titanic/true_talk/tt_major_word.cpp
+++ b/engines/titanic/true_talk/tt_major_word.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 bool TTmajorWord::_staticFlag;
 
-TTmajorWord::TTmajorWord(TTstring &str, WordClass wordClass, int val2, int val3) :
+TTmajorWord::TTmajorWord(const TTstring &str, WordClass wordClass, int val2, int val3) :
 		TTword(str, wordClass, val2), _field2C(val3) {
 }
 
diff --git a/engines/titanic/true_talk/tt_major_word.h b/engines/titanic/true_talk/tt_major_word.h
index d3d434e..c9a708a 100644
--- a/engines/titanic/true_talk/tt_major_word.h
+++ b/engines/titanic/true_talk/tt_major_word.h
@@ -38,7 +38,7 @@ protected:
 	 */
 	int saveData(SimpleFile *file, int val) const;
 public:
-	TTmajorWord(TTstring &str, WordClass wordClass, int val2, int val3);
+	TTmajorWord(const TTstring &str, WordClass wordClass, int val2, int val3);
 	TTmajorWord(const TTmajorWord *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 748c19a..1d2680e 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -24,6 +24,7 @@
 #include "titanic/true_talk/script_handler.h"
 #include "titanic/true_talk/tt_action.h"
 #include "titanic/true_talk/tt_concept.h"
+#include "titanic/true_talk/tt_picture.h"
 #include "titanic/true_talk/tt_sentence.h"
 #include "titanic/true_talk/tt_word.h"
 #include "titanic/titanic.h"
@@ -732,11 +733,9 @@ int TTparser::considerRequests(TTword *word) {
 	int status = 0;
 	bool flag = false;
 	bool modifierFlag = false;
+	int seekFlag = 0;
 
 	while (word) {
-		//int ecx = 906;
-		//int edx = 12;
-
 		if (nodeP->_tag == MKTAG('C', 'O', 'M', 'E')) {
 			addNode(7);
 			addNode(5);
@@ -894,6 +893,29 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case SEEK_NEW_FRAME:
+				if (word->_wordClass == WC_ACTION && word->_id != 104 && word->_id != 107) {
+					if (concept && (_sentenceConcept->_concept5P || _sentenceConcept->_concept2P)) {
+						TTsentenceConcept *oldNode = _sentenceConcept;
+						oldNode->_field1C = 2;
+						_sentenceConcept = oldNode->addSibling();
+						concept = nullptr;
+						
+						_sentenceConcept->_concept1P = oldNode->_concept1P;
+						_sentenceConcept->_concept5P = oldNode->_concept5P;
+						_sentenceConcept->_concept2P = oldNode->_concept2P;
+						
+						if (seekFlag) {
+							seekFlag = 0;
+
+							_sentenceConcept->_field18 = oldNode->_field18;
+							oldNode->_field18 = seekFlag;
+						}
+					}
+
+					flag = true;
+				}
+				break;
+
 			case SEEK_STATE_OBJECT:
 				if (!_sentenceConcept->_concept5P) {
 					addToConceptList(word);
@@ -938,6 +960,84 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case WORD_TYPE_IS_SENTENCE_TYPE:
+				if (_sentence->_field2C == 1 || _sentence->_field2C == 10) {
+					for (TTword *wordP = _currentWordP; wordP; wordP = wordP->_nextP) {
+						if (wordP->_id == 906) {
+							_sentence->_field2C = 12;
+							flag = true;
+							break;
+						}
+					}
+
+					TTpicture *newPictP;
+					TTconcept *newConceptP;
+					switch (word->_id) {
+					case 108:
+						_sentence->_field2C = 8;
+						break;
+					case 113:
+						if (!_sentenceConcept->_concept3P)
+							_sentence->_field2C = 22;
+						break;
+					case 304:
+						_sentence->_field2C = 25;
+						break;
+					case 305:
+						_sentence->_field2C = 24;
+						break;
+					case 306:
+						_sentence->_field2C = 7;
+						break;
+					case 501:
+						_sentence->_field2C = 9;
+						break;
+					case 900:
+						_sentence->_field2C = 5;
+						break;
+					case 901:
+						_sentence->_field2C = 4;
+						break;
+					case 904:
+						_sentence->_field2C = 6;
+						break;
+					case 905:
+						_sentence->_field2C = 11;
+						break;
+					case 906:
+						_sentence->_field2C = 12;
+						break;
+					case 907:
+						_sentence->_field2C = 13;
+						break;
+					case 908:
+						_sentence->_field2C = 2;
+						if (!_sentenceConcept->_concept0P) {
+							newPictP = new TTpicture(TTstring("?"), WC_THING, 0, 0, 0, 0, 0);
+							newConceptP = new TTconcept(newPictP);
+							
+							_sentenceConcept->_concept0P = newConceptP;
+							delete newPictP;
+							addNode(4);
+						}
+						break;
+					case 909:
+						_sentence->_field2C = 3;
+						newPictP = new TTpicture(TTstring("?"), WC_THING, 0, 0, 0, 0, 0);
+						newConceptP = new TTconcept(newPictP);
+
+						_sentenceConcept->_concept2P = newConceptP;
+						delete newPictP;
+						addNode(4);
+						break;
+
+					default:
+						break;
+					}
+				}
+
+				flag = true;
+				break;
+
 			case COMPLEX_VERB:
 				// TODO
 				break;
diff --git a/engines/titanic/true_talk/tt_picture.cpp b/engines/titanic/true_talk/tt_picture.cpp
index 5c6444a..4b04b88 100644
--- a/engines/titanic/true_talk/tt_picture.cpp
+++ b/engines/titanic/true_talk/tt_picture.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 bool TTpicture::_staticFlag;
 
-TTpicture::TTpicture(TTstring &str, WordClass wordClass, int val2, int val3, int val4, int val5, int val6) :
+TTpicture::TTpicture(const TTstring &str, WordClass wordClass, int val2, int val3, int val4, int val5, int val6) :
 		TTmajorWord(str, wordClass, val2, val4), _tag(val3), _field30(val5), _field3C(val6),
 		_field38(0) {
 }
diff --git a/engines/titanic/true_talk/tt_picture.h b/engines/titanic/true_talk/tt_picture.h
index 9c7b2ac..18cb882 100644
--- a/engines/titanic/true_talk/tt_picture.h
+++ b/engines/titanic/true_talk/tt_picture.h
@@ -36,7 +36,7 @@ protected:
 	int _field38;
 	int _field3C;
 public:
-	TTpicture(TTstring &str, WordClass wordClass, int val2, int val3, int val4, int val5, int val6);
+	TTpicture(const TTstring &str, WordClass wordClass, int val2, int val3, int val4, int val5, int val6);
 	TTpicture(const TTpicture *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 1bf4783..1dccd30 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -26,7 +26,7 @@
 
 namespace Titanic {
 
-TTword::TTword(TTstring &str, WordClass wordClass, int id) : _text(str),
+TTword::TTword(const TTstring &str, WordClass wordClass, int id) : _text(str),
 		_wordClass(wordClass), _id(id), _tag(0), _field24(0),
 		_field28(0), _synP(nullptr), _nextP(nullptr) {
 	_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index ef90796..537d1e9 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -64,7 +64,7 @@ public:
 	int _id;
 	uint _tag;
 public:
-	TTword(TTstring &str, WordClass wordClass, int val2);
+	TTword(const TTstring &str, WordClass wordClass, int val2);
 	TTword(const TTword *src);
 	~TTword();
 


Commit: 079a734831983dd26db7a2ef1f06d380b2af12dc
    https://github.com/scummvm/scummvm/commit/079a734831983dd26db7a2ef1f06d380b2af12dc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:09-04:00

Commit Message:
TITANIC: Fleshing out TTparser considerRequests

Changed paths:
    engines/titanic/true_talk/tt_action.cpp
    engines/titanic/true_talk/tt_action.h
    engines/titanic/true_talk/tt_parser.cpp



diff --git a/engines/titanic/true_talk/tt_action.cpp b/engines/titanic/true_talk/tt_action.cpp
index 04135b55..5bf91c7 100644
--- a/engines/titanic/true_talk/tt_action.cpp
+++ b/engines/titanic/true_talk/tt_action.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 bool TTaction::_staticFlag;
 
-TTaction::TTaction(TTstring &str, WordClass wordClass, int val2, int val3, int val4) :
+TTaction::TTaction(const TTstring &str, WordClass wordClass, int val2, int val3, int val4) :
 		TTmajorWord(str, wordClass, val2, val3), _field30(val4) {
 }
 
diff --git a/engines/titanic/true_talk/tt_action.h b/engines/titanic/true_talk/tt_action.h
index 7b91b14..29e2bc4 100644
--- a/engines/titanic/true_talk/tt_action.h
+++ b/engines/titanic/true_talk/tt_action.h
@@ -33,7 +33,7 @@ private:
 protected:
 	int _field30;
 public:
-	TTaction(TTstring &str, WordClass wordClass, int val2, int val3, int val4);
+	TTaction(const TTstring &str, WordClass wordClass, int val2, int val3, int val4);
 	TTaction(const TTaction *src);
 
 	/**
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 1d2680e..45e941c 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -733,7 +733,7 @@ int TTparser::considerRequests(TTword *word) {
 	int status = 0;
 	bool flag = false;
 	bool modifierFlag = false;
-	int seekFlag = 0;
+	int seekVal = 0;
 
 	while (word) {
 		if (nodeP->_tag == MKTAG('C', 'O', 'M', 'E')) {
@@ -804,10 +804,65 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case SEEK_OBJECT:
+			
 			case SEEK_OBJECT_OVERRIDE:
+				if ((word->_wordClass == WC_THING || word->_wordClass == WC_PRONOUN) &&
+						_sentence->fn2(2, TTstring("thePlayer"), _sentenceConcept) &&
+						!_sentenceConcept->_concept3P) {
+					_sentenceConcept->_concept3P = _sentenceConcept->_concept2P;
+					_sentenceConcept->_concept2P = nullptr;
+					
+					flag = filterConcepts(5, 2);
+					if (!flag) {
+						status = _sentenceConcept->createConcept(0, 2, word);
+					}
+				}
+				break;
+
 			case SEEK_TO:
+				if (!_sentenceConcept->_concept3P) {
+					if (!filterConcepts(8, 3))
+						flag = filterConcepts(3, 3);
+				} else {
+					flag = true;
+				}
+				break;
+
 			case SEEK_FROM:
+				if (!_sentenceConcept->_concept4P) {
+					if (!filterConcepts(8, 4))
+						flag = filterConcepts(3, 3);
+				} else {
+					flag = true;
+				}
+				break;
+
 			case SEEK_TO_OVERRIDE:
+				if (word->_wordClass == WC_ACTION) {
+					status = _sentenceConcept->createConcept(0, 1, word);
+					if (!status) {
+						seekVal = _sentenceConcept->_field18;
+						_sentenceConcept->_field18 = 4;
+						flag = true;
+					}
+				} else if (word->_id == 703) {
+					if (_sentenceConcept->_concept2P) {
+						delete _sentenceConcept->_concept2P;
+						_sentenceConcept->_concept2P = nullptr;
+					}
+
+					if (_sentenceConcept->_concept4P || !_sentenceConcept->_concept0P) {
+						addNode(7);
+					} else {
+						_sentenceConcept->changeConcept(1, &_sentenceConcept->_concept0P, 4);
+						concept = nullptr;
+						addNode(7);
+					}
+				} else {
+					flag = true;
+				}
+				break;
+
 			case SEEK_FROM_OVERRIDE:
 				if (_sentenceConcept->_concept4P) {
 					delete _sentenceConcept->_concept4P;
@@ -904,11 +959,11 @@ int TTparser::considerRequests(TTword *word) {
 						_sentenceConcept->_concept5P = oldNode->_concept5P;
 						_sentenceConcept->_concept2P = oldNode->_concept2P;
 						
-						if (seekFlag) {
-							seekFlag = 0;
+						if (seekVal) {
+							seekVal = 0;
 
 							_sentenceConcept->_field18 = oldNode->_field18;
-							oldNode->_field18 = seekFlag;
+							oldNode->_field18 = seekVal;
 						}
 					}
 
@@ -1039,7 +1094,19 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case COMPLEX_VERB:
-				// TODO
+				if (word->_wordClass == WC_ACTION) {
+					flag = true;
+				} else if (!_sentenceConcept->_concept1P) {
+					TTstring wordStr = word->getText();
+					if (wordStr == "do" || wordStr == "doing" || wordStr == "does" || wordStr == "done") {
+						TTaction *verbP = new TTaction(TTstring("do"), WC_ACTION, 112, 0,
+							_sentenceConcept->get18());
+						status = _sentenceConcept->createConcept(1, 1, verbP);
+						delete verbP;
+					}
+
+					flag = true;
+				}
 				break;
 
 			default:


Commit: eaab1605e089ad4abda5b64d85a4d2efe86d5328
    https://github.com/scummvm/scummvm/commit/eaab1605e089ad4abda5b64d85a4d2efe86d5328
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:12-04:00

Commit Message:
TITANIC: Finished inner switch of TTparser considerRequests

Changed paths:
    engines/titanic/true_talk/tt_concept.cpp
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_parser.cpp



diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index 2c54f2f..30ecce1 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -150,6 +150,16 @@ bool TTconcept::compareTo(const char *str) const {
 		_wordP->compareTo(str);
 }
 
+bool TTconcept::compareTo(TTword *word) const {
+	if (_wordP && _wordP->compareTo(word->_text))
+		return true;
+
+	if (_scriptP && _scriptP->getId() == 1 && word->comparePronounTo(1))
+		return true;
+
+	return false;
+}
+
 void TTconcept::initialize(TTconcept &src) {
 	_nextP = src._nextP;
 	_field14 = src._field14;
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 835ff60..4584b51 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -93,12 +93,16 @@ public:
 	void copyFrom(TTconcept *src);
 
 	/**
-	 * Compares the name of the associated word, if any,
-	 * to the passed string
+	 * Compares the name of the associated word, if any, to the passed string
 	 */
 	bool compareTo(const char *str) const;
 
 	/**
+	 * Compares the concept to the specified word
+	 */
+	bool compareTo(TTword *word) const;
+
+	/**
 	 * Set an owner for the concept
 	 */
 	int setOwner(TTconcept *src);
@@ -126,8 +130,8 @@ public:
 	}
 
 	void setFlag(bool val) { _flag = val; }
-
 	void set1C(int val) { _field1C = val; }
+	int get20() const { return _field20; }
 
 	bool checkWordId1() const;
 	bool checkWordId2() const;
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 45e941c..f949618 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -790,20 +790,58 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case SEEK_ACTOR:
-				if (_sentenceConcept->_concept0P) {
-					if (_sentenceConcept->_concept0P->compareTo("?") &&
+				if (!_sentenceConcept->_concept0P) {
+					flag = filterConcepts(5, 0);
+				} else if (_sentenceConcept->_concept0P->compareTo("?") &&
 							_sentenceConcept->_concept1P->isWordId(113) &&
 							word->_wordClass == WC_THING) {
-						// TODO
-					}
-
-
+					TTconcept *oldConcept = _sentenceConcept->_concept0P;
+					_sentenceConcept->_concept0P = nullptr;
+					flag = filterConcepts(5, 2);
+					if (flag)
+						delete oldConcept;
 				} else {
-
+					flag = true;
 				}
 				break;
 
 			case SEEK_OBJECT:
+				if (_sentenceConcept->_concept2P && _sentenceConcept->_concept2P->compareTo(word)) {
+					flag = true;
+				} else if (!_sentenceConcept->_concept2P) {
+					if (filterConcepts(5, 2) && _sentenceConcept->_concept2P->checkWordId1())
+						addNode(5);
+				} else if (word->_wordClass == WC_THING && _sentence->fn2(2, TTstring("?"), _sentenceConcept)) {
+					TTconcept *oldConcept = _sentenceConcept->_concept2P;
+					flag = filterConcepts(5, 2);
+					_sentenceConcept->_concept2P->_field20 = oldConcept->get20();
+					if (flag)
+						delete oldConcept;
+				} else if (!_sentenceConcept->_concept3P &&
+						(!_sentenceConcept->_concept1P || (_sentenceConcept->_concept1P->getWordId() &&
+						_sentenceConcept->_concept1P->getWordId() == 112)) &&
+						_sentenceConcept->_concept2P->checkWordId1() &&
+						(word->_wordClass == WC_THING || word->_wordClass == WC_PRONOUN)) {
+					_sentenceConcept->changeConcept(0, &_sentenceConcept->_concept2P, 3);
+
+					if (_conceptP && _conceptP->isWordId(word->_id)) {
+						status = _sentenceConcept->replaceConcept(0, 2, _conceptP);
+						removeConcept(_conceptP);
+					} else {
+						status = _sentenceConcept->createConcept(0, 2, word);
+					}
+					
+					if (!status && !_sentenceConcept->_concept4P && _sentenceConcept->_concept0P) {
+						TTconcept *oldConcept = _sentenceConcept->_concept2P;
+						flag = filterConcepts(5, 2);
+						_sentenceConcept->_concept2P->_field20 = oldConcept->get20();
+						if (flag)
+							delete oldConcept;
+					} else {
+						flag = true;
+					}
+				}
+				break;
 			
 			case SEEK_OBJECT_OVERRIDE:
 				if ((word->_wordClass == WC_THING || word->_wordClass == WC_PRONOUN) &&
@@ -880,7 +918,35 @@ int TTparser::considerRequests(TTword *word) {
 				break;
 
 			case SEEK_OWNERSHIP:
+				if (word->_id == 601) {
+					if (_conceptP->findByWordClass(WC_THING))
+						status = _conceptP->setOwner(word, false);
+					
+					flag = true;
+				}
+				break;
+
 			case SEEK_STATE:
+				if (_sentenceConcept->_concept5P) {
+					if (_sentenceConcept->_concept5P->findByWordId(306) ||
+							_sentenceConcept->_concept5P->findByWordId(904)) {
+						TTconcept *oldConcept = _sentenceConcept->_concept5P;
+						_sentenceConcept->_concept5P = nullptr;
+						flag = filterConcepts(9, 5);
+						if (flag)
+							delete oldConcept;
+					} else {
+						flag = true;
+					}
+				} else {
+					flag = filterConcepts(9, 5);
+					if (!flag && word->_wordClass == WC_ADVERB) {
+						status = _sentenceConcept->createConcept(1, 5, word);
+						flag = true;
+					}
+				}
+				break;
+
 			case SEEK_MODIFIERS:
 				if (!modifierFlag) {
 					bool tempFlag = false;


Commit: ef186e1a2e668b524f423ad7fbb44dc9d3fb3ea4
    https://github.com/scummvm/scummvm/commit/ef186e1a2e668b524f423ad7fbb44dc9d3fb3ea4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:16-04:00

Commit Message:
TITANIC: Convert outer tag comparisons to switch cases in TTparser considerRequests

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index f949618..f397173 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -736,448 +736,445 @@ int TTparser::considerRequests(TTword *word) {
 	int seekVal = 0;
 
 	while (word) {
-		if (nodeP->_tag == MKTAG('C', 'O', 'M', 'E')) {
-			addNode(7);
-			addNode(5);
-			addNode(21);
+		switch (nodeP->_tag) {
+		case CHECK_COMMAND_FORM:
+			if (_sentenceConcept->_concept1P && _sentence->_field2C == 1 &&
+					!_sentenceConcept->_concept0P) {
+				concept = new TTconcept(_sentence->_npcScript, ST_NPC_SCRIPT);
+				_sentenceConcept->_concept0P = concept;
+				_sentenceConcept->_field18 = 3;
+			}
 
-			if (!_sentence->_field2C)
-				_sentence->_field2C = 15;
-		} else if (nodeP->_tag == MKTAG('C', 'U', 'R', 'S') ||
-				nodeP->_tag == MKTAG('S', 'E', 'X', 'X')) {
-			if (_sentence->_field58 > 1)
-				_sentence->_field58--;
 			flag = true;
+			break;
 
-		} else if (nodeP->_tag == MKTAG('E', 'X', 'I', 'T')) {
-			addNode(8);
-			addNode(5);
-			addNode(21);
-
-			if (!_sentence->_field2C)
-				_sentence->_field2C = 14;
-
+		case EXPECT_THING:
+			if (!word->_wordClass) {
+				word->_wordClass = WC_THING;
+				addToConceptList(word);
+				addNode(14);
+			}
 
-		} else if (nodeP->_tag < MKTAG('C', 'O', 'M', 'E')) {
-			if (_sentence->_field58 > 1)
-				_sentence->_field58--;
 			flag = true;
-		} else {
-			switch (nodeP->_tag) {
-			case CHECK_COMMAND_FORM:
-				if (_sentenceConcept->_concept1P && _sentence->_field2C == 1 &&
-						!_sentenceConcept->_concept0P) {
-					concept = new TTconcept(_sentence->_npcScript, ST_NPC_SCRIPT);
-					_sentenceConcept->_concept0P = concept;
-					_sentenceConcept->_field18 = 3;
-				}
-
-				flag = true;
-				break;
+			break;
 
-			case EXPECT_THING:
-				if (!word->_wordClass) {
-					word->_wordClass = WC_THING;
-					addToConceptList(word);
-					addNode(14);
-				}
+		case OBJECT_IS_TO:
+			flag = resetConcept(&_sentenceConcept->_concept2P, 3);
+			break;
 
+		case SEEK_ACTOR:
+			if (!_sentenceConcept->_concept0P) {
+				flag = filterConcepts(5, 0);
+			} else if (_sentenceConcept->_concept0P->compareTo("?") &&
+						_sentenceConcept->_concept1P->isWordId(113) &&
+						word->_wordClass == WC_THING) {
+				TTconcept *oldConcept = _sentenceConcept->_concept0P;
+				_sentenceConcept->_concept0P = nullptr;
+				flag = filterConcepts(5, 2);
+				if (flag)
+					delete oldConcept;
+			} else {
 				flag = true;
-				break;
-
-			case OBJECT_IS_TO:
-				flag = resetConcept(&_sentenceConcept->_concept2P, 3);
-				break;
+			}
+			break;
 
-			case SEEK_ACTOR:
-				if (!_sentenceConcept->_concept0P) {
-					flag = filterConcepts(5, 0);
-				} else if (_sentenceConcept->_concept0P->compareTo("?") &&
-							_sentenceConcept->_concept1P->isWordId(113) &&
-							word->_wordClass == WC_THING) {
-					TTconcept *oldConcept = _sentenceConcept->_concept0P;
-					_sentenceConcept->_concept0P = nullptr;
-					flag = filterConcepts(5, 2);
-					if (flag)
-						delete oldConcept;
+		case SEEK_OBJECT:
+			if (_sentenceConcept->_concept2P && _sentenceConcept->_concept2P->compareTo(word)) {
+				flag = true;
+			} else if (!_sentenceConcept->_concept2P) {
+				if (filterConcepts(5, 2) && _sentenceConcept->_concept2P->checkWordId1())
+					addNode(5);
+			} else if (word->_wordClass == WC_THING && _sentence->fn2(2, TTstring("?"), _sentenceConcept)) {
+				TTconcept *oldConcept = _sentenceConcept->_concept2P;
+				flag = filterConcepts(5, 2);
+				_sentenceConcept->_concept2P->_field20 = oldConcept->get20();
+				if (flag)
+					delete oldConcept;
+			} else if (!_sentenceConcept->_concept3P &&
+					(!_sentenceConcept->_concept1P || (_sentenceConcept->_concept1P->getWordId() &&
+					_sentenceConcept->_concept1P->getWordId() == 112)) &&
+					_sentenceConcept->_concept2P->checkWordId1() &&
+					(word->_wordClass == WC_THING || word->_wordClass == WC_PRONOUN)) {
+				_sentenceConcept->changeConcept(0, &_sentenceConcept->_concept2P, 3);
+
+				if (_conceptP && _conceptP->isWordId(word->_id)) {
+					status = _sentenceConcept->replaceConcept(0, 2, _conceptP);
+					removeConcept(_conceptP);
 				} else {
-					flag = true;
+					status = _sentenceConcept->createConcept(0, 2, word);
 				}
-				break;
-
-			case SEEK_OBJECT:
-				if (_sentenceConcept->_concept2P && _sentenceConcept->_concept2P->compareTo(word)) {
-					flag = true;
-				} else if (!_sentenceConcept->_concept2P) {
-					if (filterConcepts(5, 2) && _sentenceConcept->_concept2P->checkWordId1())
-						addNode(5);
-				} else if (word->_wordClass == WC_THING && _sentence->fn2(2, TTstring("?"), _sentenceConcept)) {
+					
+				if (!status && !_sentenceConcept->_concept4P && _sentenceConcept->_concept0P) {
 					TTconcept *oldConcept = _sentenceConcept->_concept2P;
 					flag = filterConcepts(5, 2);
 					_sentenceConcept->_concept2P->_field20 = oldConcept->get20();
 					if (flag)
 						delete oldConcept;
-				} else if (!_sentenceConcept->_concept3P &&
-						(!_sentenceConcept->_concept1P || (_sentenceConcept->_concept1P->getWordId() &&
-						_sentenceConcept->_concept1P->getWordId() == 112)) &&
-						_sentenceConcept->_concept2P->checkWordId1() &&
-						(word->_wordClass == WC_THING || word->_wordClass == WC_PRONOUN)) {
-					_sentenceConcept->changeConcept(0, &_sentenceConcept->_concept2P, 3);
-
-					if (_conceptP && _conceptP->isWordId(word->_id)) {
-						status = _sentenceConcept->replaceConcept(0, 2, _conceptP);
-						removeConcept(_conceptP);
-					} else {
-						status = _sentenceConcept->createConcept(0, 2, word);
-					}
-					
-					if (!status && !_sentenceConcept->_concept4P && _sentenceConcept->_concept0P) {
-						TTconcept *oldConcept = _sentenceConcept->_concept2P;
-						flag = filterConcepts(5, 2);
-						_sentenceConcept->_concept2P->_field20 = oldConcept->get20();
-						if (flag)
-							delete oldConcept;
-					} else {
-						flag = true;
-					}
+				} else {
+					flag = true;
 				}
-				break;
+			}
+			break;
 			
-			case SEEK_OBJECT_OVERRIDE:
-				if ((word->_wordClass == WC_THING || word->_wordClass == WC_PRONOUN) &&
-						_sentence->fn2(2, TTstring("thePlayer"), _sentenceConcept) &&
-						!_sentenceConcept->_concept3P) {
-					_sentenceConcept->_concept3P = _sentenceConcept->_concept2P;
-					_sentenceConcept->_concept2P = nullptr;
+		case SEEK_OBJECT_OVERRIDE:
+			if ((word->_wordClass == WC_THING || word->_wordClass == WC_PRONOUN) &&
+					_sentence->fn2(2, TTstring("thePlayer"), _sentenceConcept) &&
+					!_sentenceConcept->_concept3P) {
+				_sentenceConcept->_concept3P = _sentenceConcept->_concept2P;
+				_sentenceConcept->_concept2P = nullptr;
 					
-					flag = filterConcepts(5, 2);
-					if (!flag) {
-						status = _sentenceConcept->createConcept(0, 2, word);
-					}
+				flag = filterConcepts(5, 2);
+				if (!flag) {
+					status = _sentenceConcept->createConcept(0, 2, word);
 				}
-				break;
+			}
+			break;
 
-			case SEEK_TO:
-				if (!_sentenceConcept->_concept3P) {
-					if (!filterConcepts(8, 3))
-						flag = filterConcepts(3, 3);
-				} else {
-					flag = true;
-				}
-				break;
+		case SEEK_TO:
+			if (!_sentenceConcept->_concept3P) {
+				if (!filterConcepts(8, 3))
+					flag = filterConcepts(3, 3);
+			} else {
+				flag = true;
+			}
+			break;
 
-			case SEEK_FROM:
-				if (!_sentenceConcept->_concept4P) {
-					if (!filterConcepts(8, 4))
-						flag = filterConcepts(3, 3);
-				} else {
+		case SEEK_FROM:
+			if (!_sentenceConcept->_concept4P) {
+				if (!filterConcepts(8, 4))
+					flag = filterConcepts(3, 3);
+			} else {
+				flag = true;
+			}
+			break;
+
+		case SEEK_TO_OVERRIDE:
+			if (word->_wordClass == WC_ACTION) {
+				status = _sentenceConcept->createConcept(0, 1, word);
+				if (!status) {
+					seekVal = _sentenceConcept->_field18;
+					_sentenceConcept->_field18 = 4;
 					flag = true;
 				}
-				break;
-
-			case SEEK_TO_OVERRIDE:
-				if (word->_wordClass == WC_ACTION) {
-					status = _sentenceConcept->createConcept(0, 1, word);
-					if (!status) {
-						seekVal = _sentenceConcept->_field18;
-						_sentenceConcept->_field18 = 4;
-						flag = true;
-					}
-				} else if (word->_id == 703) {
-					if (_sentenceConcept->_concept2P) {
-						delete _sentenceConcept->_concept2P;
-						_sentenceConcept->_concept2P = nullptr;
-					}
+			} else if (word->_id == 703) {
+				if (_sentenceConcept->_concept2P) {
+					delete _sentenceConcept->_concept2P;
+					_sentenceConcept->_concept2P = nullptr;
+				}
 
-					if (_sentenceConcept->_concept4P || !_sentenceConcept->_concept0P) {
-						addNode(7);
-					} else {
-						_sentenceConcept->changeConcept(1, &_sentenceConcept->_concept0P, 4);
-						concept = nullptr;
-						addNode(7);
-					}
+				if (_sentenceConcept->_concept4P || !_sentenceConcept->_concept0P) {
+					addNode(7);
 				} else {
-					flag = true;
+					_sentenceConcept->changeConcept(1, &_sentenceConcept->_concept0P, 4);
+					concept = nullptr;
+					addNode(7);
 				}
-				break;
+			} else {
+				flag = true;
+			}
+			break;
 
-			case SEEK_FROM_OVERRIDE:
-				if (_sentenceConcept->_concept4P) {
-					delete _sentenceConcept->_concept4P;
-					_sentenceConcept->_concept4P = nullptr;
-				}
+		case SEEK_FROM_OVERRIDE:
+			if (_sentenceConcept->_concept4P) {
+				delete _sentenceConcept->_concept4P;
+				_sentenceConcept->_concept4P = nullptr;
+			}
 
-				addNode(8);
-				flag = true;
-				break;
+			addNode(8);
+			flag = true;
+			break;
 
-			case SEEK_LOCATION:
-				addNode(5);
-				_sentenceConcept->createConcept(0, 5, word);
-				flag = true;
-				break;
+		case SEEK_LOCATION:
+			addNode(5);
+			_sentenceConcept->createConcept(0, 5, word);
+			flag = true;
+			break;
 
-			case SEEK_OWNERSHIP:
-				if (word->_id == 601) {
-					if (_conceptP->findByWordClass(WC_THING))
-						status = _conceptP->setOwner(word, false);
+		case SEEK_OWNERSHIP:
+			if (word->_id == 601) {
+				if (_conceptP->findByWordClass(WC_THING))
+					status = _conceptP->setOwner(word, false);
 					
+				flag = true;
+			}
+			break;
+
+		case SEEK_STATE:
+			if (_sentenceConcept->_concept5P) {
+				if (_sentenceConcept->_concept5P->findByWordId(306) ||
+						_sentenceConcept->_concept5P->findByWordId(904)) {
+					TTconcept *oldConcept = _sentenceConcept->_concept5P;
+					_sentenceConcept->_concept5P = nullptr;
+					flag = filterConcepts(9, 5);
+					if (flag)
+						delete oldConcept;
+				} else {
 					flag = true;
 				}
-				break;
+			} else {
+				flag = filterConcepts(9, 5);
+				if (!flag && word->_wordClass == WC_ADVERB) {
+					status = _sentenceConcept->createConcept(1, 5, word);
+					flag = true;
+				}
+			}
+			break;
 
-			case SEEK_STATE:
-				if (_sentenceConcept->_concept5P) {
-					if (_sentenceConcept->_concept5P->findByWordId(306) ||
-							_sentenceConcept->_concept5P->findByWordId(904)) {
-						TTconcept *oldConcept = _sentenceConcept->_concept5P;
-						_sentenceConcept->_concept5P = nullptr;
-						flag = filterConcepts(9, 5);
-						if (flag)
-							delete oldConcept;
+		case SEEK_MODIFIERS:
+			if (!modifierFlag) {
+				bool tempFlag = false;
+
+				switch (word->_wordClass) {
+				case WC_ACTION:
+					status = processModifiers(1, word);
+					break;
+				case WC_THING:
+					status = processModifiers(2, word);
+					break;
+				case WC_ABSTRACT:
+					if (word->_id != 300) {
+						status = processModifiers(3, word);
+					} else if (!_conceptP->findByWordClass(WC_THING)) {
+						status = processModifiers(3, word);
 					} else {
-						flag = true;
+						word->_id = atoi(word->_text.c_str());
 					}
-				} else {
-					flag = filterConcepts(9, 5);
-					if (!flag && word->_wordClass == WC_ADVERB) {
-						status = _sentenceConcept->createConcept(1, 5, word);
-						flag = true;
+					break;
+				case WC_PRONOUN:
+					if (word->_id != 602)
+						addToConceptList(word);
+					break;
+				case WC_ADJECTIVE: {
+					TTconcept *conceptP = _conceptP->findByWordClass(WC_THING);
+					if (conceptP) {
+						conceptP->_string2 += ' ';
+						conceptP->_string2 += word->getText();
+					} else {
+						status = processModifiers(8, word);
 					}
+					break;
 				}
-				break;
-
-			case SEEK_MODIFIERS:
-				if (!modifierFlag) {
-					bool tempFlag = false;
-
-					switch (word->_wordClass) {
-					case WC_ACTION:
-						status = processModifiers(1, word);
-						break;
-					case WC_THING:
-						status = processModifiers(2, word);
-						break;
-					case WC_ABSTRACT:
-						if (word->_id != 300) {
-							status = processModifiers(3, word);
-						} else if (!_conceptP->findByWordClass(WC_THING)) {
-							status = processModifiers(3, word);
-						} else {
-							word->_id = atoi(word->_text.c_str());
-						}
-						break;
-					case WC_PRONOUN:
-						if (word->_id != 602)
-							addToConceptList(word);
-						break;
-					case WC_ADJECTIVE: {
-						TTconcept *concept = _conceptP->findByWordClass(WC_THING);
-						if (concept) {
-							concept->_string2 += ' ';
-							concept->_string2 += word->getText();
-						} else {
-							status = processModifiers(8, word);
+				case WC_ADVERB:
+					if (word->_id == 906) {
+						for (TTconcept *currP = _conceptP; currP; currP = currP->_nextP) {
+							if (_sentence->isFrameSlotClass(1, WC_ACTION) ||
+									_sentence->isFrameSlotClass(1, WC_THING))
+								currP->_field34 = 1;
 						}
-						break;
-					}
-					case WC_ADVERB:
-						if (word->_id == 906) {
-							for (TTconcept *currP = _conceptP; currP; currP = currP->_nextP) {
-								if (_sentence->isFrameSlotClass(1, WC_ACTION) ||
-										_sentence->isFrameSlotClass(1, WC_THING))
-									currP->_field34 = 1;
-							}
+					} else {
+						TTconcept *conceptP = _conceptP->findByWordClass(WC_ACTION);
+
+						if (conceptP) {
+							conceptP->_string2 += ' ';
+							conceptP->_string2 += word->getText();
 						} else {
-							TTconcept *conceptP = _conceptP->findByWordClass(WC_ACTION);
-
-							if (conceptP) {
-								conceptP->_string2 += ' ';
-								conceptP->_string2 += word->getText();
-							} else {
-								tempFlag = true;
-							}
+							tempFlag = true;
 						}
-						break;
-					default:
-						addToConceptList(word);
-						status = 0;
-						break;
 					}
+					break;
+				default:
+					addToConceptList(word);
+					status = 0;
+					break;
+				}
 
-					if (tempFlag)
-						status = _sentenceConcept->createConcept(1, 5, word);
+				if (tempFlag)
+					status = _sentenceConcept->createConcept(1, 5, word);
 
-					modifierFlag = true;
-					flag = true;
-				}
-				break;
+				modifierFlag = true;
+				flag = true;
+			}
+			break;
 
-			case SEEK_NEW_FRAME:
-				if (word->_wordClass == WC_ACTION && word->_id != 104 && word->_id != 107) {
-					if (concept && (_sentenceConcept->_concept5P || _sentenceConcept->_concept2P)) {
-						TTsentenceConcept *oldNode = _sentenceConcept;
-						oldNode->_field1C = 2;
-						_sentenceConcept = oldNode->addSibling();
-						concept = nullptr;
+		case SEEK_NEW_FRAME:
+			if (word->_wordClass == WC_ACTION && word->_id != 104 && word->_id != 107) {
+				if (concept && (_sentenceConcept->_concept5P || _sentenceConcept->_concept2P)) {
+					TTsentenceConcept *oldNode = _sentenceConcept;
+					oldNode->_field1C = 2;
+					_sentenceConcept = oldNode->addSibling();
+					concept = nullptr;
 						
-						_sentenceConcept->_concept1P = oldNode->_concept1P;
-						_sentenceConcept->_concept5P = oldNode->_concept5P;
-						_sentenceConcept->_concept2P = oldNode->_concept2P;
+					_sentenceConcept->_concept1P = oldNode->_concept1P;
+					_sentenceConcept->_concept5P = oldNode->_concept5P;
+					_sentenceConcept->_concept2P = oldNode->_concept2P;
 						
-						if (seekVal) {
-							seekVal = 0;
+					if (seekVal) {
+						seekVal = 0;
 
-							_sentenceConcept->_field18 = oldNode->_field18;
-							oldNode->_field18 = seekVal;
-						}
+						_sentenceConcept->_field18 = oldNode->_field18;
+						oldNode->_field18 = seekVal;
 					}
-
-					flag = true;
-				}
-				break;
-
-			case SEEK_STATE_OBJECT:
-				if (!_sentenceConcept->_concept5P) {
-					addToConceptList(word);
-				} else if (_sentenceConcept->concept5WordId() == 113 ||
-						_sentenceConcept->concept5WordId() == 112) {
-					_sentenceConcept->createConcept(1, 2, word);
-				} else {
-					addToConceptList(word);
 				}
 
 				flag = true;
-				break;
+			}
+			break;
 
-			case SET_ACTION:
-				if (_sentence->fn4(1, 104, _sentenceConcept) ||
-						_sentence->fn4(1, 107, _sentenceConcept)) {
-					concept = _sentenceConcept->_concept1P;
-					_sentenceConcept->_concept1P = nullptr;
-					addNode(15);
-				}
+		case SEEK_STATE_OBJECT:
+			if (!_sentenceConcept->_concept5P) {
+				addToConceptList(word);
+			} else if (_sentenceConcept->concept5WordId() == 113 ||
+					_sentenceConcept->concept5WordId() == 112) {
+				_sentenceConcept->createConcept(1, 2, word);
+			} else {
+				addToConceptList(word);
+			}
 
-				if (_sentence->check2C() && word->_id == 113)
-					addNode(4);
+			flag = true;
+			break;
 
-				if (word->_wordClass == WC_ACTION)
-					_sentenceConcept->createConcept(0, 1, word);
+		case SET_ACTION:
+			if (_sentence->fn4(1, 104, _sentenceConcept) ||
+					_sentence->fn4(1, 107, _sentenceConcept)) {
+				concept = _sentenceConcept->_concept1P;
+				_sentenceConcept->_concept1P = nullptr;
+				addNode(15);
+			}
 
-				flag = true;
-				break;
+			if (_sentence->check2C() && word->_id == 113)
+				addNode(4);
 
-			case ACTOR_IS_TO:
-				_sentenceConcept->changeConcept(1, &_sentenceConcept->_concept0P, 3);
-				flag = true;
-				break;
+			if (word->_wordClass == WC_ACTION)
+				_sentenceConcept->createConcept(0, 1, word);
 
-			case ACTOR_IS_FROM:
-				_sentenceConcept->changeConcept(1, &_sentenceConcept->_concept0P, 4);
-				break;
+			flag = true;
+			break;
 
-			case ACTOR_IS_OBJECT:
-				flag = resetConcept(&_sentenceConcept->_concept0P, 2);
-				break;
+		case ACTOR_IS_TO:
+			_sentenceConcept->changeConcept(1, &_sentenceConcept->_concept0P, 3);
+			flag = true;
+			break;
 
-			case WORD_TYPE_IS_SENTENCE_TYPE:
-				if (_sentence->_field2C == 1 || _sentence->_field2C == 10) {
-					for (TTword *wordP = _currentWordP; wordP; wordP = wordP->_nextP) {
-						if (wordP->_id == 906) {
-							_sentence->_field2C = 12;
-							flag = true;
-							break;
-						}
-					}
+		case ACTOR_IS_FROM:
+			_sentenceConcept->changeConcept(1, &_sentenceConcept->_concept0P, 4);
+			break;
 
-					TTpicture *newPictP;
-					TTconcept *newConceptP;
-					switch (word->_id) {
-					case 108:
-						_sentence->_field2C = 8;
-						break;
-					case 113:
-						if (!_sentenceConcept->_concept3P)
-							_sentence->_field2C = 22;
-						break;
-					case 304:
-						_sentence->_field2C = 25;
-						break;
-					case 305:
-						_sentence->_field2C = 24;
-						break;
-					case 306:
-						_sentence->_field2C = 7;
-						break;
-					case 501:
-						_sentence->_field2C = 9;
-						break;
-					case 900:
-						_sentence->_field2C = 5;
-						break;
-					case 901:
-						_sentence->_field2C = 4;
-						break;
-					case 904:
-						_sentence->_field2C = 6;
-						break;
-					case 905:
-						_sentence->_field2C = 11;
-						break;
-					case 906:
+		case ACTOR_IS_OBJECT:
+			flag = resetConcept(&_sentenceConcept->_concept0P, 2);
+			break;
+
+		case WORD_TYPE_IS_SENTENCE_TYPE:
+			if (_sentence->_field2C == 1 || _sentence->_field2C == 10) {
+				for (TTword *wordP = _currentWordP; wordP; wordP = wordP->_nextP) {
+					if (wordP->_id == 906) {
 						_sentence->_field2C = 12;
+						flag = true;
 						break;
-					case 907:
-						_sentence->_field2C = 13;
-						break;
-					case 908:
-						_sentence->_field2C = 2;
-						if (!_sentenceConcept->_concept0P) {
-							newPictP = new TTpicture(TTstring("?"), WC_THING, 0, 0, 0, 0, 0);
-							newConceptP = new TTconcept(newPictP);
-							
-							_sentenceConcept->_concept0P = newConceptP;
-							delete newPictP;
-							addNode(4);
-						}
-						break;
-					case 909:
-						_sentence->_field2C = 3;
+					}
+				}
+
+				TTpicture *newPictP;
+				TTconcept *newConceptP;
+				switch (word->_id) {
+				case 108:
+					_sentence->_field2C = 8;
+					break;
+				case 113:
+					if (!_sentenceConcept->_concept3P)
+						_sentence->_field2C = 22;
+					break;
+				case 304:
+					_sentence->_field2C = 25;
+					break;
+				case 305:
+					_sentence->_field2C = 24;
+					break;
+				case 306:
+					_sentence->_field2C = 7;
+					break;
+				case 501:
+					_sentence->_field2C = 9;
+					break;
+				case 900:
+					_sentence->_field2C = 5;
+					break;
+				case 901:
+					_sentence->_field2C = 4;
+					break;
+				case 904:
+					_sentence->_field2C = 6;
+					break;
+				case 905:
+					_sentence->_field2C = 11;
+					break;
+				case 906:
+					_sentence->_field2C = 12;
+					break;
+				case 907:
+					_sentence->_field2C = 13;
+					break;
+				case 908:
+					_sentence->_field2C = 2;
+					if (!_sentenceConcept->_concept0P) {
 						newPictP = new TTpicture(TTstring("?"), WC_THING, 0, 0, 0, 0, 0);
 						newConceptP = new TTconcept(newPictP);
-
-						_sentenceConcept->_concept2P = newConceptP;
+							
+						_sentenceConcept->_concept0P = newConceptP;
 						delete newPictP;
 						addNode(4);
-						break;
-
-					default:
-						break;
 					}
-				}
+					break;
+				case 909:
+					_sentence->_field2C = 3;
+					newPictP = new TTpicture(TTstring("?"), WC_THING, 0, 0, 0, 0, 0);
+					newConceptP = new TTconcept(newPictP);
+
+					_sentenceConcept->_concept2P = newConceptP;
+					delete newPictP;
+					addNode(4);
+					break;
 
-				flag = true;
-				break;
+				default:
+					break;
+				}
+			}
 
-			case COMPLEX_VERB:
-				if (word->_wordClass == WC_ACTION) {
-					flag = true;
-				} else if (!_sentenceConcept->_concept1P) {
-					TTstring wordStr = word->getText();
-					if (wordStr == "do" || wordStr == "doing" || wordStr == "does" || wordStr == "done") {
-						TTaction *verbP = new TTaction(TTstring("do"), WC_ACTION, 112, 0,
-							_sentenceConcept->get18());
-						status = _sentenceConcept->createConcept(1, 1, verbP);
-						delete verbP;
-					}
+			flag = true;
+			break;
 
-					flag = true;
+		case COMPLEX_VERB:
+			if (word->_wordClass == WC_ACTION) {
+				flag = true;
+			} else if (!_sentenceConcept->_concept1P) {
+				TTstring wordStr = word->getText();
+				if (wordStr == "do" || wordStr == "doing" || wordStr == "does" || wordStr == "done") {
+					TTaction *verbP = new TTaction(TTstring("do"), WC_ACTION, 112, 0,
+						_sentenceConcept->get18());
+					status = _sentenceConcept->createConcept(1, 1, verbP);
+					delete verbP;
 				}
-				break;
 
-			default:
-				break;
+				flag = true;
 			}
+			break;
+
+		case MKTAG('C', 'O', 'M', 'E'):
+			addNode(7);
+			addNode(5);
+			addNode(21);
+
+			if (!_sentence->_field2C)
+				_sentence->_field2C = 15;
+			break;
+
+		case MKTAG('C', 'U', 'R', 'S'):
+		case MKTAG('S', 'E', 'X', 'X'):
+			if (_sentence->_field58 > 1)
+				_sentence->_field58--;
+			flag = true;
+			break;
+
+		case MKTAG('E', 'X', 'I', 'T'):
+			addNode(8);
+			addNode(5);
+			addNode(21);
+
+			if (!_sentence->_field2C)
+				_sentence->_field2C = 14;
+			break;
+
+		default:
+			break;
 		}
 	}
 


Commit: a261041be74b42dd9877acd9968e53641fd62587
    https://github.com/scummvm/scummvm/commit/a261041be74b42dd9877acd9968e53641fd62587
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:19-04:00

Commit Message:
TITANIC: Adding tag switches to TTparser considerRequests

Changed paths:
    engines/titanic/true_talk/tt_concept.cpp
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_parser.cpp



diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
index 30ecce1..c614e14 100644
--- a/engines/titanic/true_talk/tt_concept.cpp
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -288,6 +288,15 @@ TTconcept *TTconcept::findByWordClass(WordClass wordClass) {
 	return nullptr;
 }
 
+TTconcept *TTconcept::findBy20(int val) {
+	for (TTconcept *conceptP = this; conceptP; conceptP = conceptP->_nextP) {
+		if (conceptP->_field20 == val)
+			return conceptP;
+	}
+
+	return nullptr;
+}
+
 bool TTconcept::isWordId(int id) const {
 	return this && _wordP && _wordP->_id == id;
 }
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 4584b51..97cc70e 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -153,6 +153,8 @@ public:
 	 */
 	TTconcept *findByWordClass(WordClass wordClass);
 
+	TTconcept *findBy20(int val);
+
 	/**
 	 * Returns true if the concept has a word with a given Id
 	 */
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index f397173..664dcf7 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -1173,6 +1173,48 @@ int TTparser::considerRequests(TTword *word) {
 				_sentence->_field2C = 14;
 			break;
 
+		case MKTAG('F', 'A', 'R', 'R'):
+			if (_conceptP->findBy20(0))
+				_conceptP->_field20 = 2;
+			break;
+
+		case MKTAG('F', 'U', 'T', 'R'):
+			_sentenceConcept->_field18 = 3;
+			break;
+
+		case MKTAG('G', 'O', 'G', 'O'):
+			addNode(7);
+			addNode(5);
+			addNode(21);
+
+			if (_sentence->_field2C == 1)
+				_sentence->_field2C = 14;
+
+			flag = true;
+			break;
+
+		case MKTAG('H', 'E', 'L', 'P'):
+			if (_sentence->_field2C == 1)
+				_sentence->_field2C = 18;
+			
+			flag = true;
+			break;
+
+		case MKTAG('L', 'O', 'C', 'F'):
+			status = _sentenceConcept->createConcept(1, 5, word);
+			if (!status) {
+				_sentenceConcept->_concept5P->_field20 = 2;
+				flag = true;
+			}
+			break;
+
+		case MKTAG('T', 'E', 'A', 'C'):
+			if (_sentence->_field2C == 1)
+				_sentence->_field2C = 10;
+
+			flag = true;
+			break;
+
 		default:
 			break;
 		}


Commit: fb6e94e8bbe6e5fa2656f3a134b015cf4e986364
    https://github.com/scummvm/scummvm/commit/fb6e94e8bbe6e5fa2656f3a134b015cf4e986364
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:22-04:00

Commit Message:
TITANIC: Remaining tag switch cases in TTparser considerRequests

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_parser.h



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 664dcf7..91bc82d 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -763,6 +763,7 @@ int TTparser::considerRequests(TTword *word) {
 			break;
 
 		case SEEK_ACTOR:
+		case MKTAG('S', 'A', 'C', 'T'):
 			if (!_sentenceConcept->_concept0P) {
 				flag = filterConcepts(5, 0);
 			} else if (_sentenceConcept->_concept0P->compareTo("?") &&
@@ -1202,10 +1203,59 @@ int TTparser::considerRequests(TTword *word) {
 
 		case MKTAG('L', 'O', 'C', 'F'):
 			status = _sentenceConcept->createConcept(1, 5, word);
-			if (!status) {
+			if (!status)
 				_sentenceConcept->_concept5P->_field20 = 2;
-				flag = true;
+
+			flag = true;
+			break;
+
+		case MKTAG('L', 'O', 'C', 'N'):
+			status = _sentenceConcept->createConcept(1, 5, word);
+			if (!status)
+				_sentenceConcept->_concept5P->_field20 = 1;
+
+			flag = true;
+			break;
+
+		case MKTAG('N', 'E', 'A', 'R'):
+			if (_conceptP->findBy20(0)) {
+				_conceptP->_field20 = 1;
+			} else {
+				TTpicture *newPictP = new TTpicture(TTstring("?"), WC_THING, 0, 0, 0, 0, 0);
+				status = addToConceptList(newPictP);
+				_conceptP->_field20 = 1;
+				if (!status)
+					delete newPictP;
 			}
+
+			flag = true;
+			break;
+
+		case MKTAG('P', 'A', 'S', 'T'):
+			_sentenceConcept->_field18 = 1;
+			flag = true;
+			break;
+
+		case MKTAG('P', 'L', 'E', 'Z'):
+			if (_sentence->_field58 < 10)
+				_sentence->_field58++;
+			break;
+
+		case MKTAG('P', 'R', 'E', 'Z'):
+			_sentenceConcept->_field18 = 2;
+			flag = true;
+			break;
+
+		case MKTAG('S', 'A', 'A', 'O'):
+			addNode(5);
+			addNode(4);
+			flag = true;
+			break;
+
+		case MKTAG('S', 'S', 'T', 'A'):
+			addNode(13);
+			addNode(5);
+			flag = true;
 			break;
 
 		case MKTAG('T', 'E', 'A', 'C'):
@@ -1215,7 +1265,13 @@ int TTparser::considerRequests(TTword *word) {
 			flag = true;
 			break;
 
+		case MKTAG('V', 'O', 'B', 'J'):
+			status = _sentenceConcept->createConcept(1, 2, word);
+			flag = true;
+			break;
+
 		default:
+			flag = true;
 			break;
 		}
 	}
@@ -1266,9 +1322,10 @@ int TTparser::processRequests(TTword *word) {
 	return status;
 }
 
-void TTparser::addToConceptList(TTword *word) {
+int TTparser::addToConceptList(TTword *word) {
 	TTconcept *concept = new TTconcept(word, ST_UNKNOWN_SCRIPT);
 	addConcept(concept);
+	return 0;
 }
 
 void TTparser::addNode(uint tag) {
diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h
index 7aa47fd..201de7e 100644
--- a/engines/titanic/true_talk/tt_parser.h
+++ b/engines/titanic/true_talk/tt_parser.h
@@ -146,7 +146,7 @@ private:
 	int considerRequests(TTword *word);
 	int processRequests(TTword *word);
 
-	void addToConceptList(TTword *word);
+	int addToConceptList(TTword *word);
 	int checkReferent(TTpronoun *pronoun);
 
 	/**


Commit: 15843eb4c23c3d8ac88edd9b482fae09d4414582
    https://github.com/scummvm/scummvm/commit/15843eb4c23c3d8ac88edd9b482fae09d4414582
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:26-04:00

Commit Message:
TITANIC: Remainder of TTparser considerRequests

Changed paths:
    engines/titanic/true_talk/tt_parser.cpp



diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 91bc82d..3014eba 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -725,17 +725,16 @@ int TTparser::loadRequests(TTword *word) {
 }
 
 int TTparser::considerRequests(TTword *word) {
-	if (_nodesP)
+	if (!_nodesP || !word)
 		return 0;
-
-	TTparserNode *nodeP = _nodesP;
+	
 	TTconcept *concept = nullptr;
 	int status = 0;
 	bool flag = false;
 	bool modifierFlag = false;
 	int seekVal = 0;
 
-	while (word) {
+	for (TTparserNode *nodeP = _nodesP; nodeP; ) {
 		switch (nodeP->_tag) {
 		case CHECK_COMMAND_FORM:
 			if (_sentenceConcept->_concept1P && _sentence->_field2C == 1 &&
@@ -1274,9 +1273,13 @@ int TTparser::considerRequests(TTword *word) {
 			flag = true;
 			break;
 		}
+
+		TTparserNode *nextP = static_cast<TTparserNode *>(nodeP->_nextP);		
+		if (flag)
+			delete nodeP;
+		nodeP = nextP;
 	}
 
-	// TODO
 	delete concept;
 	return status;
 }


Commit: fa04a6fdf0271f74c45da180b3c6f1ac16bd3a98
    https://github.com/scummvm/scummvm/commit/fa04a6fdf0271f74c45da180b3c6f1ac16bd3a98
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:29-04:00

Commit Message:
TITANIC: Added CTrueTalkManager playSpeech

Changed paths:
    engines/titanic/core/view_item.cpp
    engines/titanic/core/view_item.h
    engines/titanic/sound/sound.cpp
    engines/titanic/sound/sound.h
    engines/titanic/support/proximity.cpp
    engines/titanic/support/proximity.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_talker.cpp
    engines/titanic/true_talk/tt_talker.h



diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index b829ae5..07c0142 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -306,4 +306,8 @@ void CViewItem::handleButtonUpMsg(CMouseButtonUpMsg *msg) {
 	}
 }
 
+void CViewItem::fn1(double val1, double val2, double val3) {
+	warning("TODO: CViewItem::fn1");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index 67b2113..d85117a 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -96,6 +96,8 @@ public:
 	 * Finds a link which connects to another designated view
 	 */
 	CLinkItem *findLink(CViewItem *newView);
+
+	void fn1(double val1, double val2, double val3);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index cf7689d..dc8d0ee 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -69,6 +69,11 @@ void CSound::fn3(int handle, int val2, int val3) {
 	warning("TODO: CSound::fn3");
 }
 
+int CSound::playSpeech(CDialogueFile *dialogueFile, int speechId, const CProximity &prox) {
+	warning("TODO: CSound::playSpeech");
+	return 0;
+}
+
 uint CSound::loadSound(const CString &name) {
 	checkSounds();
 
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index 33996de..f550493 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -24,6 +24,7 @@
 #define TITANIC_SOUND_H
 
 #include "titanic/support/simple_file.h"
+#include "titanic/support/proximity.h"
 #include "titanic/sound/sound_manager.h"
 #include "titanic/core/list.h"
 #include "titanic/core/view_item.h"
@@ -118,6 +119,12 @@ public:
 	bool fn1(int val);
 	void fn2(int handle);
 	void fn3(int handle, int val2, int val3);
+
+	/**
+	 * Play a speech
+	 */
+	int playSpeech(CDialogueFile *dialogueFile, int speechId, const CProximity &prox);
+		
 	void managerProc8(int v) { _soundManager.proc8(v); }
 
 	CSoundItem *getTrueTalkSound(CDialogueFile *dialogueFile, int index);
diff --git a/engines/titanic/support/proximity.cpp b/engines/titanic/support/proximity.cpp
index f7c90f7..4a832b9 100644
--- a/engines/titanic/support/proximity.cpp
+++ b/engines/titanic/support/proximity.cpp
@@ -21,16 +21,17 @@
  */
 
 #include "titanic/support/proximity.h"
+#include "titanic/true_talk/tt_talker.h"
 
 namespace Titanic {
 
 CProximity::CProximity() : _field4(0), _field8(100), _fieldC(0),
-		_field10(-1), _field14(0), _field18(0), _field1C(0x3FF00000),
+		_speechHandle(-1), _field14(0), _field18(0), _field1C(0x3FF00000),
 		_field20(0), _field24(10), _field28(0), _field2C(0),
 		_field30(0x3F000000), _field34(0), _double1(0.0), _double2(0.0),
 		_double3(0.0), _field44(0), _field48(0), _field4C(0),
 		_field50(0), _field54(0), _field58(0), _field5C(0),
-		_field60(0), _field64(0), _field68(0) {
+		_field60(0), _method1(nullptr), _talker(nullptr), _field6C(0) {
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/proximity.h b/engines/titanic/support/proximity.h
index 69979ea..935e2e6 100644
--- a/engines/titanic/support/proximity.h
+++ b/engines/titanic/support/proximity.h
@@ -23,21 +23,27 @@
 #ifndef TITANIC_PROXIMITY_H
 #define TITANIC_PROXIMITY_H
 
+#include "common/scummsys.h"
+
 namespace Titanic {
 
+typedef bool (*CProximityFn)(int val);
+
+class TTtalker;
+
 class CProximity {
 public:
 	int _field4;
 	int _field8;
 	int _fieldC;
-	int _field10;
+	int _speechHandle;
 	int _field14;
 	int _field18;
 	int _field1C;
 	int _field20;
 	int _field24;
 	int _field28;
-	int _field2C;
+	uint32 _field2C;
 	int _field30;
 	int _field34;
 	double _double1;
@@ -51,8 +57,9 @@ public:
 	int _field58;
 	int _field5C;
 	int _field60;
-	int _field64;
-	int _field68;
+	CProximityFn _method1;
+	TTtalker *_talker;
+	int _field6C;
 public:
 	CProximity();
 };
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index da3b207..bff4ba6 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -24,6 +24,7 @@
 #include "titanic/core/tree_item.h"
 #include "titanic/npcs/true_talk_npc.h"
 #include "titanic/game_manager.h"
+#include "titanic/titanic.h"
 
 #define MKTAG_BE(a3,a2,a1,a0) ((uint32)((a3) | ((a2) << 8) | ((a1) << 16) | ((a0) << 24)))
 
@@ -195,14 +196,14 @@ void CTrueTalkManager::saveNPC(SimpleFile *file, int charId) const {
 
 void CTrueTalkManager::preLoad() {
 	// Delete any previous talkers
-	for (TTTalkerList::iterator i = _talkers.begin(); i != _talkers.end(); ++i)
+	for (TTtalkerList::iterator i = _talkers.begin(); i != _talkers.end(); ++i)
 		delete *i;
 	_talkers.clear();
 }
 
 void CTrueTalkManager::removeCompleted() {
-	for (TTTalkerList::iterator i = _talkers.begin(); i != _talkers.end(); ) {
-		TTTalker *talker = *i;
+	for (TTtalkerList::iterator i = _talkers.begin(); i != _talkers.end(); ) {
+		TTtalker *talker = *i;
 		
 		if (talker->_done) {
 			i = _talkers.erase(i);
@@ -327,12 +328,12 @@ void CTrueTalkManager::setDialogue(CTrueTalkNPC *npc, TTroomScript *roomScript,
 		return;
 
 	int soundId = readDialogSound();
-	TTTalker *talker = new TTTalker(this, npc);
+	TTtalker *talker = new TTtalker(this, npc);
 	_talkers.push_back(talker);
 
 	bool isParrot = npc->getName().contains("parrot");
 	triggerNPC(npc);
-	setTalker(talker, roomScript, view, isParrot);
+	playSpeech(talker, roomScript, view, isParrot);
 	talker->speechStarted(dialogueStr, _titleEngine._indexes[0], soundId);
 }
 
@@ -422,8 +423,107 @@ void CTrueTalkManager::triggerNPC(CTrueTalkNPC *npc) {
 	}
 }
 
-void CTrueTalkManager::setTalker(TTTalker *talker, TTroomScript *roomScript, CViewItem *view, bool isParrot) {
-	warning("TODO: CTrueTalkManager::setTalker");
+void CTrueTalkManager::playSpeech(TTtalker *talker, TTroomScript *roomScript, CViewItem *view, bool isParrot) {
+	uint milli, index;
+	switch (roomScript->_scriptId) {
+	case 101:
+		milli = 300;
+		index = 16;
+		break;
+	case 106:
+	case 107:
+	case 110:
+	case 114:
+	case 115:
+	case 122:
+		milli = 130;
+		index = 10;
+		break;
+	case 108:
+	case 109:
+		milli = 200;
+		index = 10;
+		break;
+	case 111:
+	case 116:
+	case 121:
+		milli = 80;
+		index = 12;
+		break;
+	case 112:
+	case 124:
+	case 128:
+	case 130:
+		milli = 80;
+		index = 4;
+		break;
+	case 132:
+		milli = 60;
+		index = 4;
+		break;
+	default:
+		milli = 0;
+		index = 4;
+		break;
+	}
+
+	// Setup proximities
+	CProximity p1, p2, p3;
+	if (isParrot) {
+		p1._field24 = 3;
+		p2._field24 = 5;
+		p3._field24 = 4;
+	} else {
+		p1._field24 = 0;
+		p2._field24 = 1;
+		p3._field24 = 2;
+	}
+
+	if (milli > 0) {
+		p3._field8 = (index * 3) / 2;
+		p3._field28 = 1;
+		p3._field2C = 0xC3070000;
+		p3._field30 = 0x3F800000;
+		p3._field34 = 0;
+
+		p3._field8 = (index * 3) / 4;
+		p2._field28 = 0;
+		p2._field2C = 0x43070000;
+		p2._field30 = 0x3F800000;
+		p2._field34 = 0;
+	}
+
+	_gameManager->_sound.managerProc8(p1._field24);
+	if (view) {
+		p1._field28 = 2;
+		view->fn1(p1._double1, p1._double2, p1._double3);	
+	}
+
+	for (uint idx = 0; idx < _titleEngine._indexes.size(); ++idx) {
+		uint id = _titleEngine._indexes[idx];
+		if (id > 100000)
+			continue;
+
+		if (idx == (_titleEngine._indexes.size() - 1)) {
+			// Final iteration of speech segments to play
+			p1._method1 = &proximityMethod1;
+			p1._talker = talker;
+		}
+
+		// Start the 
+		p1._speechHandle = _gameManager->_sound.playSpeech(_dialogueFile, id - _dialogueId, p1);
+		if (!milli)
+			continue;
+
+		if (idx == 0)
+			g_vm->_events->sleep(milli);
+
+		p3._speechHandle = _gameManager->_sound.playSpeech(_dialogueFile, id - _dialogueId, p3);
+		if (idx == 0)
+			g_vm->_events->sleep(milli);
+
+		p2._speechHandle = _gameManager->_sound.playSpeech(_dialogueFile, id - _dialogueId, p2);
+	}
 }
 
 int CTrueTalkManager::getStateVal(int stateNum) {
@@ -444,4 +544,9 @@ bool CTrueTalkManager::triggerAction(int action, int param) {
 	return true;
 }
 
+bool CTrueTalkManager::proximityMethod1(int val) {
+	// TODO
+	return false;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 524f13e..3467fe1 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -47,7 +47,7 @@ private:
 	CDialogueFile *_dialogueFile;
 	int _dialogueId;
 	int _field18;
-	TTTalkerList _talkers;
+	TTtalkerList _talkers;
 private:
 	/**
 	 * Loads the statics for the class
@@ -101,7 +101,12 @@ private:
 	 */
 	void triggerNPC(CTrueTalkNPC *npc);
 
-	void setTalker(TTTalker *talker, TTroomScript *roomScript, CViewItem *view, bool isParrot);
+	/**
+	 * Plays speech specified by the manager's indexes array
+	 */
+	void playSpeech(TTtalker *talker, TTroomScript *roomScript, CViewItem *view, bool isParrot);
+
+	static bool proximityMethod1(int val);
 public:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/true_talk/tt_talker.cpp b/engines/titanic/true_talk/tt_talker.cpp
index 3e86fdf..1eb7fc8 100644
--- a/engines/titanic/true_talk/tt_talker.cpp
+++ b/engines/titanic/true_talk/tt_talker.cpp
@@ -25,7 +25,7 @@
 
 namespace Titanic {
 
-void TTTalker::speechStarted(const CString &dialogueStr, uint dialogueId, uint soundId) {
+void TTtalker::speechStarted(const CString &dialogueStr, uint dialogueId, uint soundId) {
 	_dialogueId = dialogueId;
 
 	CTrueTalkNotifySpeechStartedMsg msg(soundId, dialogueId, 0);
diff --git a/engines/titanic/true_talk/tt_talker.h b/engines/titanic/true_talk/tt_talker.h
index 622bcc6..9bb59fb 100644
--- a/engines/titanic/true_talk/tt_talker.h
+++ b/engines/titanic/true_talk/tt_talker.h
@@ -31,7 +31,7 @@ namespace Titanic {
 
 class CTrueTalkManager;
 
-class TTTalker : public ListItem {
+class TTtalker : public ListItem {
 public:
 	CTrueTalkManager *_owner;
 	CTrueTalkNPC *_npc;
@@ -40,15 +40,15 @@ public:
 	int _field24;
 	int _done;
 public:
-	TTTalker() : _owner(nullptr), _npc(nullptr),
+	TTtalker() : _owner(nullptr), _npc(nullptr),
 		_dialogueId(0), _field24(0), _done(0) {}
-	TTTalker(CTrueTalkManager *owner, CTrueTalkNPC *npc) :
+	TTtalker(CTrueTalkManager *owner, CTrueTalkNPC *npc) :
 		_owner(owner), _npc(npc), _dialogueId(0), _field24(0), _done(0) {}
 
 	void speechStarted(const CString &dialogueStr, uint dialogueId, uint soundId);
 };
 
-class TTTalkerList : public List<TTTalker> {
+class TTtalkerList : public List<TTtalker> {
 };
 
 } // End of namespace Titanic


Commit: 66a2500928dffba83622d274c37bf26ceda00caf
    https://github.com/scummvm/scummvm/commit/66a2500928dffba83622d274c37bf26ceda00caf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:33-04:00

Commit Message:
TITANIC: Added CTurnOnObject message handlers

Changed paths:
    engines/titanic/core/turn_on_object.cpp
    engines/titanic/core/turn_on_object.h



diff --git a/engines/titanic/core/turn_on_object.cpp b/engines/titanic/core/turn_on_object.cpp
index b4ed2b4..a24843b 100644
--- a/engines/titanic/core/turn_on_object.cpp
+++ b/engines/titanic/core/turn_on_object.cpp
@@ -24,21 +24,36 @@
 
 namespace Titanic {
 
-CTurnOnObject::CTurnOnObject() : CBackground(), _string3("NULL") {
+BEGIN_MESSAGE_MAP(CTurnOnObject, CBackground)
+	ON_MESSAGE(MouseButtonDownMsg)
+	ON_MESSAGE(MouseButtonUpMsg)
+END_MESSAGE_MAP()
+
+CTurnOnObject::CTurnOnObject() : CBackground(), _msgName("NULL") {
 }
 
 void CTurnOnObject::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
-	file->writeQuotedLine(_string3, indent);
+	file->writeQuotedLine(_msgName, indent);
 
 	CBackground::save(file, indent);
 }
 
 void CTurnOnObject::load(SimpleFile *file) {
 	file->readNumber();
-	_string3 = file->readString();
+	_msgName = file->readString();
 
 	CBackground::load(file);
 }
 
+bool CTurnOnObject::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	return true;
+}
+
+bool CTurnOnObject::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+	CTurnOn turnOn;
+	turnOn.execute(_msgName);
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/turn_on_object.h b/engines/titanic/core/turn_on_object.h
index d87e205..3ac5a89 100644
--- a/engines/titanic/core/turn_on_object.h
+++ b/engines/titanic/core/turn_on_object.h
@@ -28,8 +28,11 @@
 namespace Titanic {
 
 class CTurnOnObject : public CBackground {
+	DECLARE_MESSAGE_MAP
+	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
 protected:
-	CString _string3;
+	CString _msgName;
 public:
 	CLASSDEF
 	CTurnOnObject();


Commit: 1f4eca3d061d85cdc11a8e20834c14de082baedc
    https://github.com/scummvm/scummvm/commit/1f4eca3d061d85cdc11a8e20834c14de082baedc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:36-04:00

Commit Message:
TITANIC: Message handler stubs for CDeskbot

Changed paths:
    engines/titanic/npcs/deskbot.cpp
    engines/titanic/npcs/deskbot.h



diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp
index c4745ae..e0e147f 100644
--- a/engines/titanic/npcs/deskbot.cpp
+++ b/engines/titanic/npcs/deskbot.cpp
@@ -24,6 +24,20 @@
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CDeskbot, CTrueTalkNPC)
+	ON_MESSAGE(TurnOn)
+	ON_MESSAGE(EnterViewMsg)
+	ON_MESSAGE(ActMsg)
+	ON_MESSAGE(MovieEndMsg)
+	ON_MESSAGE(LeaveViewMsg)
+	ON_MESSAGE(TrueTalkTriggerActionMsg)
+	ON_MESSAGE(NPCPlayTalkingAnimationMsg)
+	ON_MESSAGE(NPCPlayIdleAnimationMsg)
+	ON_MESSAGE(TrueTalkNotifySpeechStartedMsg)
+	ON_MESSAGE(TrueTalkNotifySpeechEndedMsg)
+	ON_MESSAGE(TurnOff)
+END_MESSAGE_MAP()
+
 int CDeskbot::_v1;
 int CDeskbot::_v2;
 
@@ -50,4 +64,59 @@ void CDeskbot::load(SimpleFile *file) {
 	CTrueTalkNPC::load(file);
 }
 
+bool CDeskbot::TurnOn(CTurnOn *msg) {
+	// TODO
+	return true;
+}
+
+bool CDeskbot::EnterViewMsg(CEnterViewMsg *msg) {
+	// TODO
+	return true;
+}
+
+bool CDeskbot::ActMsg(CActMsg *msg) {
+	// TODO
+	return true;
+}
+
+bool CDeskbot::MovieEndMsg(CMovieEndMsg *msg) {
+	// TODO
+	return true;
+}
+
+bool CDeskbot::LeaveViewMsg(CLeaveViewMsg *msg) {
+	// TODO
+	return true;
+}
+
+bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) {
+	// TODO
+	return true;
+}
+
+bool CDeskbot::NPCPlayTalkingAnimationMsg(CNPCPlayTalkingAnimationMsg *msg) {
+	// TODO
+	return true;
+}
+
+bool CDeskbot::NPCPlayIdleAnimationMsg(CNPCPlayIdleAnimationMsg *msg) {
+	// TODO
+	return true;
+}
+
+bool CDeskbot::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *msg) {
+	// TODO
+	return true;
+}
+
+bool CDeskbot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) {
+	// TODO
+	return true;
+}
+
+bool CDeskbot::TurnOff(CTurnOff *msg) {
+	// TODO
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/deskbot.h b/engines/titanic/npcs/deskbot.h
index 50c3e3f..2711e9c 100644
--- a/engines/titanic/npcs/deskbot.h
+++ b/engines/titanic/npcs/deskbot.h
@@ -28,6 +28,18 @@
 namespace Titanic {
 
 class CDeskbot : public CTrueTalkNPC {
+	DECLARE_MESSAGE_MAP
+	bool TurnOn(CTurnOn *msg);
+	bool EnterViewMsg(CEnterViewMsg *msg);
+	bool ActMsg(CActMsg *msg);
+	bool MovieEndMsg(CMovieEndMsg *msg);
+	bool LeaveViewMsg(CLeaveViewMsg *msg);
+	bool TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg);
+	bool NPCPlayTalkingAnimationMsg(CNPCPlayTalkingAnimationMsg *msg);
+	bool NPCPlayIdleAnimationMsg(CNPCPlayIdleAnimationMsg *msg);
+	bool TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *msg);
+	bool TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg);
+	bool TurnOff(CTurnOff *msg);
 private:
 	static int _v1;
 	static int _v2;


Commit: a7ecc6d601f1beabd0f5538d5e1cd7d6e983d2b9
    https://github.com/scummvm/scummvm/commit/a7ecc6d601f1beabd0f5538d5e1cd7d6e983d2b9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:40-04:00

Commit Message:
TITANIC: Adding CDeskbot message handlers

Changed paths:
    engines/titanic/carry/magazine.cpp
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/npcs/deskbot.cpp
    engines/titanic/npcs/deskbot.h
    engines/titanic/npcs/true_talk_npc.cpp
    engines/titanic/npcs/true_talk_npc.h



diff --git a/engines/titanic/carry/magazine.cpp b/engines/titanic/carry/magazine.cpp
index ac74da8..68d898c 100644
--- a/engines/titanic/carry/magazine.cpp
+++ b/engines/titanic/carry/magazine.cpp
@@ -54,7 +54,7 @@ void CMagazine::load(SimpleFile *file) {
 bool CMagazine::UseWithCharMsg(CUseWithCharMsg *msg) {
 	CDeskbot *deskbot = static_cast<CDeskbot *>(msg->_character);
 	if (deskbot) {
-		if (deskbot->_field108) {
+		if (deskbot->_deskbotActive) {
 			setVisible(false);
 			setPosition(Point(1000, 1000));
 			CActMsg actMsg("2ndClassUpgrade");
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 5a21487..f386c1e 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -707,6 +707,30 @@ void CGameObject::incState38() {
 	getGameManager()->_gameState.inc38();
 }
 
+void CGameObject::inc54() {
+	getGameManager()->inc54();
+}
+
+void CGameObject::dec54() {
+	getGameManager()->dec54();
+}
+
+void CGameObject::lockMouse() {
+	CGameManager *gameMan = getGameManager();
+	gameMan->lockInputHandler();
+
+	if (CScreenManager::_screenManagerPtr->_mouseCursor)
+		CScreenManager::_screenManagerPtr->_mouseCursor->hide();
+}
+
+void CGameObject::unlockMouse() {
+	if (CScreenManager::_screenManagerPtr->_mouseCursor)
+		CScreenManager::_screenManagerPtr->_mouseCursor->show();
+
+	CGameManager *gameMan = getGameManager();
+	gameMan->unlockInputHandler();
+}
+
 void CGameObject::startTalking(const CString &npcName, uint id, CViewItem *view) {
 	CTrueTalkNPC *npc = static_cast<CTrueTalkNPC *>(getRoot()->findByName(npcName));
 	startTalking(npc, id, view);
@@ -721,6 +745,10 @@ void CGameObject::startTalking(CTrueTalkNPC *npc, uint id, CViewItem *view) {
 	}
 }
 
+void CGameObject::endTalking(CTrueTalkNPC *npc, uint id, CViewItem *view) {
+	warning("TODO: CGameObject::endTalking");
+}
+
 void CGameObject::loadSurface() {
 	if (!_surface && !_resource.empty()) {
 		loadResource(_resource);
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 87cc2ba..10847c8 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -126,6 +126,18 @@ protected:
 	void petFn2(int val);
 	void petFn3(CTreeItem *item);
 	void incState38();
+	void inc54();
+	void dec54();
+
+	/**
+	 * Locks/hides the mouse
+	 */
+	void lockMouse();
+
+	/**
+	 * Unlocks/shows the mouse
+	 */
+	void unlockMouse();
 
 	/**
 	 * Load a sound
@@ -228,6 +240,11 @@ protected:
 	void startTalking(CTrueTalkNPC *npc, uint id, CViewItem *view = nullptr);
 
 	/**
+	 * Stop a conversation with the NPC
+	 */
+	void endTalking(CTrueTalkNPC *npc, uint id, CViewItem *view = nullptr);
+
+	/**
 	 * Load the surface
 	 */
 	void loadSurface();
diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp
index e0e147f..dcd2746 100644
--- a/engines/titanic/npcs/deskbot.cpp
+++ b/engines/titanic/npcs/deskbot.cpp
@@ -41,14 +41,14 @@ END_MESSAGE_MAP()
 int CDeskbot::_v1;
 int CDeskbot::_v2;
 
-CDeskbot::CDeskbot() : CTrueTalkNPC(), _field108(0), _field10C(0) {
+CDeskbot::CDeskbot() : CTrueTalkNPC(), _deskbotActive(false), _field10C(0) {
 }
 
 void CDeskbot::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
-	file->writeNumberLine(_field108, indent);
+	file->writeNumberLine(_deskbotActive, indent);
 	file->writeNumberLine(_field10C, indent);
 
 	CTrueTalkNPC::save(file, indent);
@@ -58,34 +58,99 @@ void CDeskbot::load(SimpleFile *file) {
 	file->readNumber();
 	_v1 = file->readNumber();
 	_v2 = file->readNumber();
-	_field108 = file->readNumber();
+	_deskbotActive = file->readNumber();
 	_field10C = file->readNumber();
 
 	CTrueTalkNPC::load(file);
 }
 
 bool CDeskbot::TurnOn(CTurnOn *msg) {
-	// TODO
+	if (!_deskbotActive) {
+		setVisible(true);
+		playClip("BellRinging", 4);
+		playSound("b#69.wav");
+		setPetArea(PET_CONVERSATION);
+
+		_npcFlags |= NPCFLAG_20000;
+		_deskbotActive = true;
+	}
+
 	return true;
 }
 
 bool CDeskbot::EnterViewMsg(CEnterViewMsg *msg) {
-	// TODO
+	setVisible(false);
+	_deskbotActive = false;
+	_fieldC4 = 0;
+	loadFrame(625);
+	
 	return true;
 }
 
 bool CDeskbot::ActMsg(CActMsg *msg) {
-	// TODO
+	if (msg->_action == "2ndClassUpgrade" && getPassengerClass() > 2) {
+		startTalking(this, 140, findView());
+	}
+
 	return true;
 }
 
 bool CDeskbot::MovieEndMsg(CMovieEndMsg *msg) {
-	// TODO
+	bool flag = false;
+	if (_npcFlags & NPCFLAG_10000) {
+		if (_field10C) {
+			setPetArea(PET_ROOMS);
+			dec54();
+			unlockMouse();
+			playSound("z#47.wav", 100, 0, 0);
+			_field10C = false;
+		}
+
+		_npcFlags &= ~NPCFLAG_10000;
+		flag = true;
+	}
+
+	bool flag = false;
+	if (_npcFlags & NPCFLAG_40000) {
+		_deskbotActive = false;
+		_npcFlags &= ~(NPCFLAG_40000 | NPCFLAG_20000);
+
+		if (_npcFlags & NPCFLAG_80000) {
+			CTurnOn turnOn;
+			turnOn.execute("EmbBellbotTrigger");
+			unlockMouse();
+			changeView("EmbLobby.Node 4.N", "");
+		} else if (_npcFlags & NPCFLAG_100000) {
+			CTurnOn turnOn;
+			turnOn.execute("EmbDoorBotTrigger");
+			unlockMouse();
+			changeView("EmbLobby.Node 4.N", "");
+		}
+
+		_npcFlags &= ~(NPCFLAG_80000 | NPCFLAG_100000);
+		flag = true;
+	}
+
+	if (_npcFlags & NPCFLAG_20000) {
+		_npcFlags &= ~(NPCFLAG_40000 | NPCFLAG_20000);
+		endTalking(this, 1, findView());
+
+		_npcFlags |= NPCFLAG_4;
+		flag = true;
+	}
+
+	if (!flag)
+		CTrueTalkNPC::MovieEndMsg(msg);
+
 	return true;
 }
 
 bool CDeskbot::LeaveViewMsg(CLeaveViewMsg *msg) {
-	// TODO
+	if (_deskbotActive) {
+		CTurnOff turnOff;
+		turnOff.execute(this);
+	}
+
 	return true;
 }
 
@@ -115,7 +180,14 @@ bool CDeskbot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg)
 }
 
 bool CDeskbot::TurnOff(CTurnOff *msg) {
-	// TODO
+	if (_deskbotActive) {
+		stopMovie();
+		performAction(1, findView());
+
+		_npcFlags = (_npcFlags & ~(NPCFLAG_SPEAKING | NPCFLAG_2 | NPCFLAG_4)) | NPCFLAG_40000;
+		playClip("Closing", 0x14);
+	}
+
 	return true;
 }
 
diff --git a/engines/titanic/npcs/deskbot.h b/engines/titanic/npcs/deskbot.h
index 2711e9c..607255b 100644
--- a/engines/titanic/npcs/deskbot.h
+++ b/engines/titanic/npcs/deskbot.h
@@ -44,8 +44,8 @@ private:
 	static int _v1;
 	static int _v2;
 public:
-	int _field108;
-	int _field10C;
+	bool _deskbotActive;
+	bool _field10C;
 public:
 	CLASSDEF
 	CDeskbot();
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index 297de59..ba2de20 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -197,7 +197,7 @@ void CTrueTalkNPC::processInput(CTextInputMsg *msg, CViewItem *view) {
 		talkManager->processInput(this, msg, view);
 }
 
-void CTrueTalkNPC::performAction(int val1, int val2) {
+void CTrueTalkNPC::performAction(int actionNum, CViewItem *view) {
 	// TODO
 }
 
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index 8277b55..a1303c3 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -30,7 +30,9 @@
 namespace Titanic {
 
 enum NpcFlag {
-	NPCFLAG_SPEAKING = 1, NPCFLAG_2 = 2, NPCFLAG_4 = 4, NPCFLAG_8 = 8
+	NPCFLAG_SPEAKING = 1, NPCFLAG_2 = 2, NPCFLAG_4 = 4, NPCFLAG_8 = 8,
+	NPCFLAG_10000 = 0x10000, NPCFLAG_20000 = 0x20000, NPCFLAG_40000 = 0x40000,
+	NPCFLAG_80000 = 0x80000, NPCFLAG_100000 = 0x100000
 };
 
 class CViewItem;
@@ -60,7 +62,11 @@ protected:
 	int _field104;
 protected:
 	void processInput(CTextInputMsg *msg, CViewItem *view);
-	void performAction(int val1, int val2);
+	
+	/**
+	 * Perform an action
+	 */
+	void performAction(int actionNum, CViewItem *view = nullptr);
 	
 	/**
 	 * Start an animation timer


Commit: 421812f27c59e53e68dfbaa777284c74a8fb7938
    https://github.com/scummvm/scummvm/commit/421812f27c59e53e68dfbaa777284c74a8fb7938
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:43-04:00

Commit Message:
TITANIC: More implementing deskbot message handlers

Changed paths:
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/npcs/deskbot.cpp
    engines/titanic/npcs/deskbot.h
    engines/titanic/pet_control/pet_gfx_element.cpp
    engines/titanic/pet_control/pet_slider.cpp



diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 8dd3da0..86a6b17 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -319,9 +319,23 @@ int CTreeItem::getPassengerClass() const {
 	return gameManager ? gameManager->_gameState._passengerClass : 3;
 }
 
-int CTreeItem::getStateC() const {
+int CTreeItem::getPriorClass() const {
 	CGameManager *gameManager = getGameManager();
-	return gameManager ? gameManager->_gameState._fieldC : 3;
+	return gameManager ? gameManager->_gameState._priorClass : 3;
+}
+
+void CTreeItem::setPassengerClass(int newClass) {
+	if (newClass >= 1 && newClass <= 4) {
+		// Change the passenger class
+		CGameManager *gameMan = getGameManager();
+		gameMan->_gameState._priorClass = gameMan->_gameState._passengerClass;
+		gameMan->_gameState._passengerClass = newClass;
+
+		// Setup the PET again, so the new class's PET background can take effect
+		CPetControl *petControl = getPetControl();
+		if (petControl)
+			petControl->setup();
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 1dcaee5..d893d6d 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -284,7 +284,15 @@ public:
 	 */
 	int getPassengerClass() const;
 	
-	int getStateC() const;
+	/**
+	 * Return the player's previous passenger class
+	 */
+	int getPriorClass() const;
+
+	/**
+	 * Set's the player's passenger class
+	 */
+	void setPassengerClass(int newClass);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 2c751c0..c552c69 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -45,7 +45,7 @@ bool CGameStateMovieList::clear() {
 
 CGameState::CGameState(CGameManager *gameManager) :
 		_gameManager(gameManager), _gameLocation(this),
-		_passengerClass(0), _fieldC(0), _mode(GSMODE_UNSELECTED),
+		_passengerClass(0), _priorClass(0), _mode(GSMODE_UNSELECTED),
 		_field14(0), _petActive(false), _field1C(0), _quitGame(false),
 		_field24(0), _nodeChangeCtr(0), _nodeEnterTicks(0), _field38(0) {
 }
@@ -53,7 +53,7 @@ CGameState::CGameState(CGameManager *gameManager) :
 void CGameState::save(SimpleFile *file) const {
 	file->writeNumber(_petActive);
 	file->writeNumber(_passengerClass);
-	file->writeNumber(_fieldC);
+	file->writeNumber(_priorClass);
 	file->writeNumber(_field14);
 	file->writeNumber(_field24);
 	file->writeNumber(_field38);
@@ -64,7 +64,7 @@ void CGameState::save(SimpleFile *file) const {
 void CGameState::load(SimpleFile *file) {
 	_petActive = file->readNumber() != 0;
 	_passengerClass = file->readNumber();
-	_fieldC = file->readNumber();
+	_priorClass = file->readNumber();
 	_field14 = file->readNumber();
 	_field24 = file->readNumber();
 	_field38 = file->readNumber();
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index ff39dc6..6512612 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -55,7 +55,7 @@ public:
 	CGameLocation _gameLocation;
 	CGameStateMovieList _movieList;
 	int _passengerClass;
-	int _fieldC;
+	int _priorClass;
 	GameStateMode _mode;
 	int _field14;
 	bool _petActive;
diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp
index dcd2746..548738d 100644
--- a/engines/titanic/npcs/deskbot.cpp
+++ b/engines/titanic/npcs/deskbot.cpp
@@ -110,7 +110,6 @@ bool CDeskbot::MovieEndMsg(CMovieEndMsg *msg) {
 		flag = true;
 	}
 
-	bool flag = false;
 	if (_npcFlags & NPCFLAG_40000) {
 		_deskbotActive = false;
 		_npcFlags &= ~(NPCFLAG_40000 | NPCFLAG_20000);
@@ -155,7 +154,26 @@ bool CDeskbot::LeaveViewMsg(CLeaveViewMsg *msg) {
 }
 
 bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) {
-	// TODO
+	switch (msg->_action) {
+	case 19:
+		inc54();
+		lockMouse();
+		setPetArea(PET_CONVERSATION);
+		playClip("ReprogramPETInHand", 4);
+		_npcFlags |= NPCFLAG_10000;
+		_field10C = msg->_param1;
+
+		switch (_field10C) {
+		case 1:
+			petDisplayMsg("You have been upgraded to 1st Class status. Enjoy hugely.");
+			
+			break;
+		case 2:
+			petDisplayMsg("You have been upgraded to 2nd Class status. Enjoy.");
+			break;
+		}
+	}
+
 	return true;
 }
 
diff --git a/engines/titanic/npcs/deskbot.h b/engines/titanic/npcs/deskbot.h
index 607255b..8425f58 100644
--- a/engines/titanic/npcs/deskbot.h
+++ b/engines/titanic/npcs/deskbot.h
@@ -45,7 +45,7 @@ private:
 	static int _v2;
 public:
 	bool _deskbotActive;
-	bool _field10C;
+	int _field10C;
 public:
 	CLASSDEF
 	CDeskbot();
diff --git a/engines/titanic/pet_control/pet_gfx_element.cpp b/engines/titanic/pet_control/pet_gfx_element.cpp
index 2686bd9..511fb5e 100644
--- a/engines/titanic/pet_control/pet_gfx_element.cpp
+++ b/engines/titanic/pet_control/pet_gfx_element.cpp
@@ -54,7 +54,7 @@ void CPetGfxElement::reset(const CString &name, CPetControl *petControl, PetElem
 	if (classNum >= 1 && classNum <= 3) {
 		numString = CString(classNum);
 	} else if (classNum == 4) {
-		int stateC = petControl->getStateC();
+		int stateC = petControl->getPriorClass();
 		if (stateC == 1)
 			numString = CString(stateC);
 	}
diff --git a/engines/titanic/pet_control/pet_slider.cpp b/engines/titanic/pet_control/pet_slider.cpp
index 82b02af..67f324a 100644
--- a/engines/titanic/pet_control/pet_slider.cpp
+++ b/engines/titanic/pet_control/pet_slider.cpp
@@ -202,7 +202,7 @@ void CPetSoundSlider::setupBackground2(const CString &name, CPetControl *petCont
 		if (mode <= 3) {
 			numStr = CString(mode);			
 		} else if (mode == 4) {
-			mode = petControl->getStateC();
+			mode = petControl->getPriorClass();
 			if (mode == 1) {
 				numStr = CString(mode);
 			}
@@ -220,7 +220,7 @@ void CPetSoundSlider::setupThumb2(const CString &name, CPetControl *petControl)
 		if (mode <= 3) {
 			numStr = CString(mode);
 		} else if (mode == 4) {
-			mode = petControl->getStateC();
+			mode = petControl->getPriorClass();
 			if (mode == 1) {
 				numStr = CString(mode);
 			}


Commit: 063fd5c26a10a665e1cf1acb78696807d18dea8c
    https://github.com/scummvm/scummvm/commit/063fd5c26a10a665e1cf1acb78696807d18dea8c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:47-04:00

Commit Message:
TITANIC: Reorganising methods to class they are in the original

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/pet_control/pet_control.cpp



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index f386c1e..00a7328 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -613,6 +613,11 @@ bool CGameObject::compareViewNameTo(const CString &name) const {
 	return getViewFullName().compareToIgnoreCase(name);
 }
 
+int CGameObject::compareRoomNameTo(const CString &name) {
+	CRoomItem *room = getGameManager()->getRoom();
+	return room->getName().compareToIgnoreCase(name);
+}
+
 void CGameObject::petDisplayMsg(const CString &msg) const {
 	CPetControl *pet = getPetControl();
 	if (pet)
@@ -808,4 +813,69 @@ void CGameObject::checkPlayMovie(const CString &name, int flags) {
 	}
 }
 
+void CGameObject::clearPet() const {
+	CPetControl *petControl = getPetControl();
+	if (petControl)
+		petControl->clear();
+}
+
+CPetControl *CGameObject::getPetControl() const {
+	return static_cast<CPetControl *>(getDontSaveChild(CPetControl::_type));
+}
+
+CMailMan *CGameObject::getMailMan() const {
+	return dynamic_cast<CMailMan *>(getDontSaveChild(CMailMan::_type));
+}
+
+CTreeItem *CGameObject::getDontSaveChild(ClassDef *classDef) const {
+	CProjectItem *root = getRoot();
+	if (!root)
+		return nullptr;
+
+	CDontSaveFileItem *dontSave = root->getDontSaveFileItem();
+	if (!dontSave)
+		return nullptr;
+
+	return dontSave->findChildInstanceOf(classDef);
+}
+
+CRoomItem *CGameObject::getRoom() const {
+	CGameManager *gameManager = getGameManager();
+	return gameManager ? gameManager->getRoom() : nullptr;
+}
+
+CRoomItem *CGameObject::getHiddenRoom() const {
+	CProjectItem *root = getRoot();
+	return root ? root->findHiddenRoom() : nullptr;
+}
+
+CMusicRoom *CGameObject::getMusicRoom() const {
+	CGameManager *gameManager = getGameManager();
+	return gameManager ? &gameManager->_musicRoom : nullptr;
+}
+
+int CGameObject::getPassengerClass() const {
+	CGameManager *gameManager = getGameManager();
+	return gameManager ? gameManager->_gameState._passengerClass : 3;
+}
+
+int CGameObject::getPriorClass() const {
+	CGameManager *gameManager = getGameManager();
+	return gameManager ? gameManager->_gameState._priorClass : 3;
+}
+
+void CGameObject::setPassengerClass(int newClass) {
+	if (newClass >= 1 && newClass <= 4) {
+		// Change the passenger class
+		CGameManager *gameMan = getGameManager();
+		gameMan->_gameState._priorClass = gameMan->_gameState._passengerClass;
+		gameMan->_gameState._passengerClass = newClass;
+
+		// Setup the PET again, so the new class's PET background can take effect
+		CPetControl *petControl = getPetControl();
+		if (petControl)
+			petControl->setup();
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 10847c8..f389815 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -103,11 +103,6 @@ protected:
 	bool checkStartDragging(CMouseDragStartMsg *msg);
 
 	/**
-	 * Marks the area in the passed rect as dirty, and requiring re-rendering
-	 */
-	void makeDirty(const Rect &r);
-
-	/**
 	 * Sets a new area in the PET
 	 */
 	void setPetArea(PetArea newArea) const;
@@ -195,6 +190,11 @@ protected:
 	bool compareViewNameTo(const CString &name) const;
 
 	/**
+	 * Compare the name of the parent room to the item to a passed string
+	 */
+	int compareRoomNameTo(const CString &name);
+
+	/**
 	* Display a message in the PET
 	*/
 	void petDisplayMsg(const CString &msg) const;
@@ -258,6 +258,80 @@ protected:
 	 * Support function for drag moving
 	 */
 	void dragMove(const Point &pt);
+
+	/**
+	 * Set the position of the object
+	 */
+	void setPosition(const Point &newPos);
+
+	void sound8(bool flag) const;
+
+	/**
+	 * Play an arbitrary clip
+	 */
+	void playClip(const CString &name, uint flags);
+
+	/**
+	 * Play a clip
+	 */
+	void playClip(uint startFrame, uint endFrame);
+
+	/**
+	 * Return the current view/node/room as a single string
+	 */
+	CString getViewFullName() const;
+
+	/**
+	 * Returns true if a clip exists in the list with a given name
+	 * and starting frame number
+	 */
+	bool clipExistsByStart(const CString &name, int startFrame = 0) const;
+
+	/**
+	 * Returns true if a clip exists in the list with a given name
+	 * and ending frame number
+	 */
+	bool clipExistsByEnd(const CString &name, int endFrame = 0) const;
+
+	/**
+	 * Clear the PET display
+	 */
+	void clearPet() const;
+	
+	/**
+	 * Returns the PET control
+	 */
+	CPetControl *getPetControl() const;
+
+	/**
+	 * Returns the MailMan
+	 */
+	CMailMan *getMailMan() const;
+
+	/**
+	 * Returns a child of the Dont Save area of the project of the given class
+	 */
+	CTreeItem *getDontSaveChild(ClassDef *classDef) const;
+
+	/**
+	 * Return the current room
+	 */
+	CRoomItem *getRoom() const;
+
+	/**
+	 * Returns the special hidden room container
+	 */
+	CRoomItem *getHiddenRoom() const;
+
+	/**
+	 * Returns the music room instance from the game manager
+	 */
+	CMusicRoom *getMusicRoom() const;
+
+	/**
+	 * Set's the player's passenger class
+	 */
+	void setPassengerClass(int newClass);
 public:
 	int _field60;
 	CursorId _cursorId;
@@ -292,9 +366,14 @@ public:
 	virtual bool isPet() const;
 
 	/**
-	 * Stops any movie currently playing for the object
+	 * Play the movie specified in _resource
 	 */
-	void stopMovie();
+	void playMovie(uint startFrame, uint endFrame, uint flags);
+
+	/**
+	 * Moves the item from it's original position to be under the hidden room
+	 */
+	void moveToHiddenRoom();
 
 	/**
 	 * Checks the passed point is validly in the object,
@@ -303,52 +382,49 @@ public:
 	bool checkPoint(const Point &pt, bool ignore40 = false, bool visibleOnly = false);
 
 	/**
-	 * Set the position of the object
+	 * Change the object's status
 	 */
-	void setPosition(const Point &newPos);
-
+	void playMovie(uint flags);
+	
 	/**
-	 * Returns true if the object has a currently active movie
+	 * Checks and plays a pending clip
 	 */
-	bool hasActiveMovie() const;
+	void checkPlayMovie(const CString &name, int flags);
 
 	/**
-	 * Get the current movie frame
+	 * Returns true if the object has a currently active movie
 	 */
-	int getMovieFrame() const;
-	
-	int getSurface45() const;
-	void sound8(bool flag) const;
+	bool hasActiveMovie() const;
 
 	/**
-	 * Loads a frame
+	 * Stops any movie currently playing for the object
 	 */
-	void loadFrame(int frameNumber);
+	void stopMovie();
 
 	/**
-	 * Change the object's status
+	 * Get the current movie frame
 	 */
-	void playMovie(uint flags);
-
+	int getMovieFrame() const;
+	
 	/**
-	 * Play the movie specified in _resource
+	 * Returns the object's frame number
 	 */
-	void playMovie(uint startFrame, uint endFrame, uint flags);
+	int getFrameNumber() const { return _frameNumber; }
 
 	/**
-	 * Play an arbitrary clip
+	 * Loads a frame
 	 */
-	void playClip(const CString &name, uint flags);
+	void loadFrame(int frameNumber);
 
 	/**
-	 * Play a clip
+	 * Marks the area occupied by the object as dirty, requiring re-rendering
 	 */
-	void playClip(uint startFrame, uint endFrame);
+	void makeDirty();
 
 	/**
-	 * Return the current view/node/room as a single string
+	 * Marks the area in the passed rect as dirty, and requiring re-rendering
 	 */
-	CString getViewFullName() const;
+	void makeDirty(const Rect &r);
 
 	/**
 	 * Sets whether the object is visible
@@ -356,36 +432,16 @@ public:
 	void setVisible(bool val);
 
 	/**
-	 * Moves the item from it's original position to be under the hidden room
-	 */
-	void moveToHiddenRoom();
-
-	/**
-	 * Returns the object's frame number
-	 */
-	int getFrameNumber() const { return _frameNumber; }
-
-	/**
-	 * Marks the area occupied by the object as dirty, requiring re-rendering
+	 * Return the player's passenger class
 	 */
-	void makeDirty();
-
-	/**
-	 * Returns true if a clip exists in the list with a given name
-	 * and starting frame number
-	 */
-	bool clipExistsByStart(const CString &name, int startFrame = 0) const;
-
+	int getPassengerClass() const;
+	
 	/**
-	 * Returns true if a clip exists in the list with a given name
-	 * and ending frame number
+	 * Return the player's previous passenger class
 	 */
-	bool clipExistsByEnd(const CString &name, int endFrame = 0) const;
+	int getPriorClass() const;
 
-	/**
-	 * Checks and plays a pending clip
-	 */
-	void checkPlayMovie(const CString &name, int flags);
+	int getSurface45() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 86a6b17..9b50970 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -268,74 +268,4 @@ CNamedItem *CTreeItem::findByName(const CString &name, int maxLen) {
 	return nullptr;
 }
 
-int CTreeItem::compareRoomNameTo(const CString &name) {
-	CRoomItem *room = getGameManager()->getRoom();
-	return room->getName().compareToIgnoreCase(name);
-}
-
-void CTreeItem::clearPet() const {
-	CPetControl *petControl = getPetControl();
-	if (petControl)
-		petControl->clear();
-}
-
-CPetControl *CTreeItem::getPetControl() const {
-	return static_cast<CPetControl *>(getDontSaveChild(CPetControl::_type));
-}
-
-CMailMan *CTreeItem::getMailMan() const {
-	return dynamic_cast<CMailMan *>(getDontSaveChild(CMailMan::_type));
-}
-
-CTreeItem *CTreeItem::getDontSaveChild(ClassDef *classDef) const {
-	CProjectItem *root = getRoot();
-	if (!root)
-		return nullptr;
-
-	CDontSaveFileItem *dontSave = root->getDontSaveFileItem();
-	if (!dontSave)
-		return nullptr;
-
-	return dontSave->findChildInstanceOf(classDef);
-}
-
-CRoomItem *CTreeItem::getRoom() const {
-	CGameManager *gameManager = getGameManager();
-	return gameManager ? gameManager->getRoom() : nullptr;
-}
-
-CRoomItem *CTreeItem::getHiddenRoom() const {
-	CProjectItem *root = getRoot();
-	return root ? root->findHiddenRoom() : nullptr;
-}
-
-CMusicRoom *CTreeItem::getMusicRoom() const {
-	CGameManager *gameManager = getGameManager();
-	return gameManager ? &gameManager->_musicRoom : nullptr;
-}
-
-int CTreeItem::getPassengerClass() const {
-	CGameManager *gameManager = getGameManager();
-	return gameManager ? gameManager->_gameState._passengerClass : 3;
-}
-
-int CTreeItem::getPriorClass() const {
-	CGameManager *gameManager = getGameManager();
-	return gameManager ? gameManager->_gameState._priorClass : 3;
-}
-
-void CTreeItem::setPassengerClass(int newClass) {
-	if (newClass >= 1 && newClass <= 4) {
-		// Change the passenger class
-		CGameManager *gameMan = getGameManager();
-		gameMan->_gameState._priorClass = gameMan->_gameState._passengerClass;
-		gameMan->_gameState._passengerClass = newClass;
-
-		// Setup the PET again, so the new class's PET background can take effect
-		CPetControl *petControl = getPetControl();
-		if (petControl)
-			petControl->setup();
-	}
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index d893d6d..fd7586b 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -238,61 +238,6 @@ public:
 	 * Finds a tree item by name
 	 */
 	CNamedItem *findByName(const CString &name, int maxLen = 0);
-
-	/**
-	 * Compare the name of the parent room to the item to a passed string
-	 */
-	int compareRoomNameTo(const CString &name);
-
-	/**
-	 * Clear the PET display
-	 */
-	void clearPet() const;
-	
-	/**
-	 * Returns the PET control
-	 */
-	CPetControl *getPetControl() const;
-
-	/**
-	 * Returns the MailMan
-	 */
-	CMailMan *getMailMan() const;
-
-	/**
-	 * Returns a child of the Dont Save area of the project of the given class
-	 */
-	CTreeItem *getDontSaveChild(ClassDef *classDef) const;
-
-	/**
-	 * Return the current room
-	 */
-	CRoomItem *getRoom() const;
-
-	/**
-	 * Returns the special hidden room container
-	 */
-	CRoomItem *getHiddenRoom() const;
-
-	/**
-	 * Returns the music room instance from the game manager
-	 */
-	CMusicRoom *getMusicRoom() const;
-
-	/**
-	 * Return the player's passenger class
-	 */
-	int getPassengerClass() const;
-	
-	/**
-	 * Return the player's previous passenger class
-	 */
-	int getPriorClass() const;
-
-	/**
-	 * Set's the player's passenger class
-	 */
-	void setPassengerClass(int newClass);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 8571b5e..1fd6549 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -225,7 +225,7 @@ void CPetControl::fn3(CTreeItem *item) {
 
 CRoomItem *CPetControl::getHiddenRoom() {
 	if (!_hiddenRoom)
-		_hiddenRoom = CTreeItem::getHiddenRoom();
+		_hiddenRoom = CGameObject::getHiddenRoom();
 
 	return _hiddenRoom;
 }


Commit: 703bb288c17e207f083e75facc750f5c8c30a09e
    https://github.com/scummvm/scummvm/commit/703bb288c17e207f083e75facc750f5c8c30a09e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:51-04:00

Commit Message:
TITANIC: Finished Deskbot message handlers

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/tree_item.h
    engines/titanic/messages/messages.h
    engines/titanic/npcs/deskbot.cpp
    engines/titanic/npcs/deskbot.h
    engines/titanic/npcs/true_talk_npc.cpp
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 00a7328..eaf1dfe 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -26,6 +26,7 @@
 #include "titanic/core/room_item.h"
 #include "titanic/npcs/true_talk_npc.h"
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/star_control/star_control.h"
 #include "titanic/support/files_manager.h"
 #include "titanic/support/screen_manager.h"
 #include "titanic/support/video_surface.h"
@@ -624,6 +625,10 @@ void CGameObject::petDisplayMsg(const CString &msg) const {
 		pet->displayMessage(msg);
 }
 
+void CGameObject::displayMessage(const CString &msg) const {
+	petDisplayMsg(msg);
+}
+
 CGameObject *CGameObject::getMailManFirstObject() const {
 	CMailMan *mailMan = getMailMan();
 	return mailMan ? mailMan->getFirstObject() : nullptr;
@@ -720,6 +725,12 @@ void CGameObject::dec54() {
 	getGameManager()->dec54();
 }
 
+void CGameObject::petAddRoom(int roomNum) {
+	CPetControl *petControl = getPetControl();
+	if (petControl)
+		petControl->addRoom(roomNum);
+}
+
 void CGameObject::lockMouse() {
 	CGameManager *gameMan = getGameManager();
 	gameMan->lockInputHandler();
@@ -827,6 +838,17 @@ CMailMan *CGameObject::getMailMan() const {
 	return dynamic_cast<CMailMan *>(getDontSaveChild(CMailMan::_type));
 }
 
+CStarControl *CGameObject::getStarControl() const {
+	CStarControl *starControl = static_cast<CStarControl *>(getDontSaveChild(CStarControl::_type));
+	if (!starControl) {
+		CViewItem *view = getGameManager()->getView();
+		if (view)
+			starControl = starControl = static_cast<CStarControl *>(view->findChildInstanceOf(CStarControl::_type));
+	}
+
+	return starControl;
+}
+
 CTreeItem *CGameObject::getDontSaveChild(ClassDef *classDef) const {
 	CProjectItem *root = getRoot();
 	if (!root)
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index f389815..22c62a8 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -35,9 +35,13 @@ namespace Titanic {
 enum Find { FIND_GLOBAL = 1, FIND_ROOM = 2, FIND_PET = 4, FIND_MAILMAN = 8 };
 enum Found { FOUND_NONE = 0, FOUND_GLOBAL = 1, FOUND_ROOM = 2, FOUND_PET = 3, FOUND_MAILMAN = 4 };
 
-class CVideoSurface;
+class CMailMan;
+class CMusicRoom;
+class CRoomItem;
+class CStarControl;
 class CMouseDragStartMsg;
 class CTrueTalkNPC;
+class CVideoSurface;
 class OSMovie;
 
 class CGameObject : public CNamedItem {
@@ -125,6 +129,11 @@ protected:
 	void dec54();
 
 	/**
+	 * Adds a room to the room list
+	 */
+	void petAddRoom(int roomNum);
+
+	/**
 	 * Locks/hides the mouse
 	 */
 	void lockMouse();
@@ -195,11 +204,16 @@ protected:
 	int compareRoomNameTo(const CString &name);
 
 	/**
-	* Display a message in the PET
-	*/
+	 * Display a message in the PET
+	 */
 	void petDisplayMsg(const CString &msg) const;
 
 	/**
+	 * Display a message
+	 */
+	void displayMessage(const CString &msg) const;
+
+	/**
 	 * Gets the first object under the system MailMan
 	 */
 	CGameObject *getMailManFirstObject() const;
@@ -309,6 +323,11 @@ protected:
 	CMailMan *getMailMan() const;
 
 	/**
+	 * Returns the star control
+	 */
+	CStarControl *getStarControl() const;
+
+	/**
 	 * Returns a child of the Dont Save area of the project of the given class
 	 */
 	CTreeItem *getDontSaveChild(ClassDef *classDef) const;
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index fd7586b..c0d37d1 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -24,19 +24,14 @@
 #define TITANIC_TREE_ITEM_H
 
 #include "titanic/core/message_target.h"
+#include "titanic/support/simple_file.h"
 
 namespace Titanic {
 
 class CGameManager;
-class CDontSaveFileItem;
-class CMailMan;
-class CMessage;
-class CMusicRoom;
 class CNamedItem;
-class CPetControl;
 class CProjectItem;
 class CScreenManager;
-class CRoomItem;
 class CViewItem;
 
 class CTreeItem: public CMessageTarget {
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index f592434..d456714 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -269,9 +269,9 @@ MESSAGE2(CMovieFrameMsg, int, value1, 0, int, value2, 0);
 MESSAGE0(CMusicHasStartedMsg);
 MESSAGE0(CMusicHasStoppedMsg);
 MESSAGE0(CMusicSettingChangedMsg);
-MESSAGE2(CNPCPlayAnimationMsg, void *, data, nullptr, int, value2, 0);
-MESSAGE1(CNPCPlayIdleAnimationMsg, void *, value, 0);
-MESSAGE3(CNPCPlayTalkingAnimationMsg, int, value1, 0, int, value2, 0, void *, value3, nullptr);
+MESSAGE2(CNPCPlayAnimationMsg, const char *const *, names, nullptr, int, value2, 0);
+MESSAGE1(CNPCPlayIdleAnimationMsg, const char *const *, names, 0);
+MESSAGE3(CNPCPlayTalkingAnimationMsg, int, value1, 0, int, value2, 0, const char *const *, names, nullptr);
 MESSAGE0(CNPCQueueIdleAnimMsg);
 MESSAGE1(CNutPuzzleMsg, CString, value, "");
 MESSAGE1(COnSummonBotMsg, int, value, 0);
@@ -344,7 +344,7 @@ MESSAGE1(CTriggerNPCEvent, int, value, 0);
 MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, uint, index, 0, uint, startFrame, 0, uint, endFrame, 0);
 MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, filename, "", int, numValue, 0);
 MESSAGE2(CTrueTalkGetStateValueMsg, int, stateNum, 0, int, stateVal, -1000);
-MESSAGE2(CTrueTalkNotifySpeechEndedMsg, int, value1, 0, int, value2, 0);
+MESSAGE2(CTrueTalkNotifySpeechEndedMsg, int, value1, 0, int, dialogueId, 0);
 MESSAGE3(CTrueTalkNotifySpeechStartedMsg, uint, soundId, 0, uint, dialogueId, 0, int, value, 0);
 MESSAGE1(CTrueTalkQueueUpAnimSetMsg, int, value, 0);
 MESSAGE0(CTrueTalkSelfQueueAnimSetMsg);
diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp
index 548738d..18c1e2a 100644
--- a/engines/titanic/npcs/deskbot.cpp
+++ b/engines/titanic/npcs/deskbot.cpp
@@ -21,9 +21,20 @@
  */
 
 #include "titanic/npcs/deskbot.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
+static const char *const TALKING_NAMES[] = {
+	"NeutralTalking", "HandFidget1", "HandFidget2", "LookingAround",
+	"FriendlyTalking", "MoreRudeness", "HandUp", "TapFingers",
+	"WaveOn", "WaveArmsAround", "HandsOverEdge"
+};
+
+static const char *const IDLE_NAMES[] = {
+	"WaveOn", "HandFidget1", "HandFidget2", "TapFingers", "HandsOverEdge"
+};
+
 BEGIN_MESSAGE_MAP(CDeskbot, CTrueTalkNPC)
 	ON_MESSAGE(TurnOn)
 	ON_MESSAGE(EnterViewMsg)
@@ -41,7 +52,7 @@ END_MESSAGE_MAP()
 int CDeskbot::_v1;
 int CDeskbot::_v2;
 
-CDeskbot::CDeskbot() : CTrueTalkNPC(), _deskbotActive(false), _field10C(0) {
+CDeskbot::CDeskbot() : CTrueTalkNPC(), _deskbotActive(false), _classNum(0) {
 }
 
 void CDeskbot::save(SimpleFile *file, int indent) const {
@@ -49,7 +60,7 @@ void CDeskbot::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
 	file->writeNumberLine(_deskbotActive, indent);
-	file->writeNumberLine(_field10C, indent);
+	file->writeNumberLine(_classNum, indent);
 
 	CTrueTalkNPC::save(file, indent);
 }
@@ -59,7 +70,7 @@ void CDeskbot::load(SimpleFile *file) {
 	_v1 = file->readNumber();
 	_v2 = file->readNumber();
 	_deskbotActive = file->readNumber();
-	_field10C = file->readNumber();
+	_classNum = file->readNumber();
 
 	CTrueTalkNPC::load(file);
 }
@@ -98,12 +109,12 @@ bool CDeskbot::ActMsg(CActMsg *msg) {
 bool CDeskbot::MovieEndMsg(CMovieEndMsg *msg) {
 	bool flag = false;
 	if (_npcFlags & NPCFLAG_10000) {
-		if (_field10C) {
+		if (_classNum) {
 			setPetArea(PET_ROOMS);
 			dec54();
 			unlockMouse();
 			playSound("z#47.wav", 100, 0, 0);
-			_field10C = false;
+			_classNum = false;
 		}
 
 		_npcFlags &= ~NPCFLAG_10000;
@@ -161,39 +172,126 @@ bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) {
 		setPetArea(PET_CONVERSATION);
 		playClip("ReprogramPETInHand", 4);
 		_npcFlags |= NPCFLAG_10000;
-		_field10C = msg->_param1;
+		_classNum = msg->_param1;
 
-		switch (_field10C) {
+		switch (_classNum) {
 		case 1:
 			petDisplayMsg("You have been upgraded to 1st Class status. Enjoy hugely.");
-			
+			setPassengerClass(_classNum);
+			petAddRoom(_classNum);
 			break;
 		case 2:
 			petDisplayMsg("You have been upgraded to 2nd Class status. Enjoy.");
+			setPassengerClass(_classNum);
+			petAddRoom(_classNum);
+			break;
+		case 3:
+			setPassengerClass(3);
+			petAddRoom(_classNum);
+			break;
+		default:
 			break;
 		}
+
+	case 20:
+		if (getPassengerClass() == 1) {
+			CPetControl *petControl = getPetControl();
+			if (petControl)
+				petControl->roomFn2(4);
+		}
+		break;
+
+	case 21:
+		if (getPassengerClass() == 1) {
+			CPetControl *petControl = getPetControl();
+			if (petControl)
+				petControl->roomFn2(3);
+		}
+		break;
+
+	case 22:
+		if (getPassengerClass() == 1) {
+			CPetControl *petControl = getPetControl();
+			if (petControl)
+				petControl->roomFn2(2);
+		}
+		break;
+
+	case 23:
+		if (getPassengerClass() == 1) {
+			CPetControl *petControl = getPetControl();
+			if (petControl)
+				petControl->roomFn2(1);
+		}
+		break;
+
+	case 26:
+		_npcFlags |= NPCFLAG_80000;
+		CTurnOff turnOff;
+		turnOff.execute(this);
+		lockMouse();
+		break;
 	}
 
 	return true;
 }
 
 bool CDeskbot::NPCPlayTalkingAnimationMsg(CNPCPlayTalkingAnimationMsg *msg) {
-	// TODO
+	if (msg->_value2 != 2)
+		msg->_names = TALKING_NAMES;
+
 	return true;
 }
 
 bool CDeskbot::NPCPlayIdleAnimationMsg(CNPCPlayIdleAnimationMsg *msg) {
-	// TODO
+	msg->_names = IDLE_NAMES;
 	return true;
 }
 
 bool CDeskbot::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *msg) {
-	// TODO
+	if (_npcFlags & NPCFLAG_40000)
+		return true;
+
+	CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(msg);
+	switch (msg->_dialogueId) {
+	case 41684:
+	case 41686:
+	case 41787:
+	case 41788:
+	case 41789:
+		lockMouse();
+		break;
+	default:
+		break;
+	}
+	
 	return true;
 }
 
 bool CDeskbot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) {
-	// TODO
+	if (_npcFlags & NPCFLAG_40000)
+		return true;
+
+	CTurnOff turnOff;
+	CTrueTalkNPC::TrueTalkNotifySpeechEndedMsg(msg);
+
+	switch (msg->_dialogueId) {
+	case 41684:
+	case 41787:
+	case 41788:
+	case 41789:
+		_npcFlags |= NPCFLAG_80000;
+		turnOff.execute(this);
+
+	case 41686:
+		_npcFlags |= NPCFLAG_100000;
+		turnOff.execute(this);
+		break;
+
+	default:
+		break;
+	}
+
 	return true;
 }
 
diff --git a/engines/titanic/npcs/deskbot.h b/engines/titanic/npcs/deskbot.h
index 8425f58..3e155f6 100644
--- a/engines/titanic/npcs/deskbot.h
+++ b/engines/titanic/npcs/deskbot.h
@@ -45,7 +45,7 @@ private:
 	static int _v2;
 public:
 	bool _deskbotActive;
-	int _field10C;
+	int _classNum;
 public:
 	CLASSDEF
 	CDeskbot();
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index ba2de20..32c6412 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -111,8 +111,8 @@ bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMs
 			CNPCPlayTalkingAnimationMsg msg1(_soundId, 0, 0);
 			msg1.execute(this);
 
-			if (msg1._value3) {
-				CNPCPlayAnimationMsg msg2(msg1._value3, msg1._value1);
+			if (msg1._names) {
+				CNPCPlayAnimationMsg msg2(msg1._names, msg1._value1);
 				msg2.execute(this);
 			}
 		}
@@ -151,8 +151,8 @@ bool CTrueTalkNPC::MovieEndMsg(CMovieEndMsg *msg) {
 	CNPCPlayTalkingAnimationMsg msg1(ticks, ticks > 1000 ? 2 : 1, 0);
 	msg1.execute(this);
 
-	if (msg1._value3) {
-		CNPCPlayAnimationMsg msg2(msg1._value3, msg1._value1);
+	if (msg1._names) {
+		CNPCPlayAnimationMsg msg2(msg1._names, msg1._value1);
 		msg2.execute(this);
 	}
 	
@@ -173,8 +173,8 @@ bool CTrueTalkNPC::TimerMsg(CTimerMsg *msg) {
 
 		CNPCPlayIdleAnimationMsg idleMsg;
 		if (idleMsg.execute(this)) {
-			if (idleMsg._value) {
-				CNPCPlayAnimationMsg animMsg(idleMsg._value, 0);
+			if (idleMsg._names) {
+				CNPCPlayAnimationMsg animMsg(idleMsg._names, 0);
 				animMsg.execute(this);
 			}
 
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 1fd6549..92ec3d6 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -516,4 +516,12 @@ CString CPetControl::getFullViewName() {
 	return gameManager ? gameManager->getFullViewName() : CString();
 }
 
+void CPetControl::addRoom(int roomNum) {
+	_rooms.addRoom(roomNum);
+}
+
+int CPetControl::roomFn2(int val) {
+	return _rooms.fn2(val);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 23b4f61..1eedc03 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -293,6 +293,12 @@ public:
 	 * room.node.view tuplet form
 	 */
 	CString getFullViewName();
+
+	/**
+	 * Adds a room to the room list
+	 */
+	void addRoom(int roomNum);
+	int roomFn2(int val);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index acf9acf..a14258e 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -202,6 +202,11 @@ int CPetRooms::fn1() {
 	return 0;
 }
 
+int CPetRooms::fn2(int val) {
+	warning("TODO: CPetRooms::fn2");
+	return 0;
+}
+
 void CPetRooms::areaChanged(PetArea area) {
 	if (_petControl && _petControl->_currentArea == area)
 		_petControl->makeDirty();
@@ -221,4 +226,8 @@ CPetRoomsGlyph *CPetRooms::addGlyph(int val, bool highlight) {
 	}
 }
 
+void CPetRooms::addRoom(int roomNum) {
+	warning("TODO: CPetRooms::addRoom");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index 522a1e2..515c9fb 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -147,6 +147,13 @@ public:
 	virtual CPetText *getText();
 
 	virtual CGameObject *getBackground(int index);
+
+	/**
+	 * Adds a room to the room list
+	 */
+	void addRoom(int roomNum);
+
+	int fn2(int val);
 };
 
 } // End of namespace Titanic


Commit: d0301bce6f932b34810110796fa86bc367ddf89f
    https://github.com/scummvm/scummvm/commit/d0301bce6f932b34810110796fa86bc367ddf89f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:54-04:00

Commit Message:
TITANIC: Move unknown method from TTword to TTadj

Changed paths:
    engines/titanic/true_talk/tt_adj.cpp
    engines/titanic/true_talk/tt_adj.h
    engines/titanic/true_talk/tt_vocab.cpp
    engines/titanic/true_talk/tt_word.cpp
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/true_talk/tt_adj.cpp b/engines/titanic/true_talk/tt_adj.cpp
index 1c16d58..a147847 100644
--- a/engines/titanic/true_talk/tt_adj.cpp
+++ b/engines/titanic/true_talk/tt_adj.cpp
@@ -29,19 +29,19 @@ bool TTadj::_staticFlag;
 TTadj::TTadj(TTstring &str, WordClass wordClass, int val2, int val3, int val4) :
 		TTmajorWord(str, wordClass, val2, val3) {
 	if (val4 >= 0 && val4 <= 9) {
-		_field30 = val4;
+		_val = val4;
 	} else {
-		_field30 = 0;
+		_val = 0;
 		_status = SS_5;
 	}
 }
 
 TTadj::TTadj(const TTadj *src) : TTmajorWord(src) {
 	if (src->getStatus()) {
-		_field30 = 0;
+		_val = 0;
 		_status = SS_5;
 	} else {
-		_field30 = src->_field30;
+		_val = src->_val;
 	}
 }
 
@@ -49,13 +49,22 @@ int TTadj::load(SimpleFile *file) {
 	int val;
 
 	if (!TTword::load(file, WC_ADJECTIVE) && file->scanf("%d", &val)) {
-		_field30 = val;
+		_val = val;
 		return 0;
 	} else {
 		return 8;
 	}
 }
 
+int TTadj::adjFn1(int val) {
+	if (_val < 0 || _val > 9) {
+		return SS_4;
+	} else {
+		_val = val;
+		return SS_VALID;
+	}
+}
+
 TTword *TTadj::copy() const {
 	TTadj *returnWordP = new TTadj(this);
 	returnWordP->_status = _status;
diff --git a/engines/titanic/true_talk/tt_adj.h b/engines/titanic/true_talk/tt_adj.h
index 813cc8c..1dec8a7 100644
--- a/engines/titanic/true_talk/tt_adj.h
+++ b/engines/titanic/true_talk/tt_adj.h
@@ -31,7 +31,7 @@ class TTadj : public TTmajorWord {
 private:
 	static bool _staticFlag;
 protected:
-	int _field30;
+	int _val;
 public:
 	TTadj(TTstring &str, WordClass wordClass, int val2, int val3, int val4);
 	TTadj(const TTadj *src);
@@ -41,22 +41,24 @@ public:
 	 */
 	int load(SimpleFile *file);
 
+	int adjFn1(int val);
+
 	/**
 	 * Creates a copy of the word
 	 */
 	virtual TTword *copy() const;
 
-	virtual bool proc14(int val) const { return _field30 == val; }
-	virtual int proc15() const { return _field30; }
-	virtual bool proc16() const { return _field30 >= 7; }
-	virtual bool proc17() const { return _field30 <= 3; }
-	virtual bool proc18() const { return _field30 > 3 && _field30 < 7; }
+	virtual bool proc14(int val) const { return _val == val; }
+	virtual int proc15() const { return _val; }
+	virtual bool proc16() const { return _val >= 7; }
+	virtual bool proc17() const { return _val <= 3; }
+	virtual bool proc18() const { return _val > 3 && _val < 7; }
 
 	/**
 	 * Dumps data associated with the word to file
 	 */
 	virtual int save(SimpleFile *file) const {
-		return saveData(file, _field30);
+		return saveData(file, _val);
 	}
 };
 
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 350fc71..08d6e9e 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -311,16 +311,17 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 
 		if (word) {
 			if (word->_wordClass == WC_ADJECTIVE) {
+				TTadj *adj = static_cast<TTadj *>(word);
 				int val1 = word->proc15();
 				int val2 = word->proc15();
 
 				if (val2 < 5) {
 					if (--val1 > 0) {
-						word->unkFn1(val1);
+						adj->adjFn1(val1);
 					}
 				} else {
 					if (++val1 < 11) {
-						word->unkFn1(val1);
+						adj->adjFn1(val1);
 					}
 				}
 			}
@@ -330,16 +331,17 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 
 			if (word) {
 				if (word->_wordClass == WC_ADJECTIVE) {
+					TTadj *adj = static_cast<TTadj *>(word);
 					int val1 = word->proc15();
 					int val2 = word->proc15();
 
 					if (val2 < 5) {
 						if (--val1 > 0) {
-							word->unkFn1(val1);
+							adj->adjFn1(val1);
 						}
 					} else {
 						if (++val1 < 11) {
-							word->unkFn1(val1);
+							adj->adjFn1(val1);
 						}
 					}
 				}
@@ -348,16 +350,17 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 				word = getPrimeWord(tempStr);
 
 				if (word && word->_wordClass == WC_ADJECTIVE) {
+					TTadj *adj = static_cast<TTadj *>(word);
 					int val1 = word->proc15();
 					int val2 = word->proc15();
 
 					if (val2 < 5) {
 						if (--val1 > 0) {
-							word->unkFn1(val1);
+							adj->adjFn1(val1);
 						}
 					} else {
 						if (++val1 < 11) {
-							word->unkFn1(val1);
+							adj->adjFn1(val1);
 						}
 					}
 				}
@@ -370,16 +373,17 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 
 		if (word) {
 			if (word->_wordClass == WC_ADJECTIVE) {
+				TTadj *adj = static_cast<TTadj *>(word);
 				int val1 = word->proc15();
 				int val2 = word->proc15();
 
 				if (val2 < 5) {
 					if (--val1 > 0) {
-						word->unkFn1(val1);
+						adj->adjFn1(val1);
 					}
 				} else {
 					if (++val1 < 11) {
-						word->unkFn1(val1);
+						adj->adjFn1(val1);
 					}
 				}
 			}
@@ -389,16 +393,17 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 
 			if (word) {
 				if (word->_wordClass == WC_ADJECTIVE) {
+					TTadj *adj = static_cast<TTadj *>(word);
 					int val1 = word->proc15();
 					int val2 = word->proc15();
 
 					if (val2 < 5) {
 						if (--val1 > 0) {
-							word->unkFn1(val1);
+							adj->adjFn1(val1);
 						}
 					} else {
 						if (++val1 < 11) {
-							word->unkFn1(val1);
+							adj->adjFn1(val1);
 						}
 					}
 				}
@@ -407,16 +412,17 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const {
 				word = getPrimeWord(tempStr);
 
 				if (word) {
+					TTadj *adj = static_cast<TTadj *>(word);
 					int val1 = word->proc15();
 					int val2 = word->proc15();
 
 					if (val2 < 5) {
 						if (--val1 > 0) {
-							word->unkFn1(val1);
+							adj->adjFn1(val1);
 						}
 					} else {
 						if (++val1 < 11) {
-							word->unkFn1(val1);
+							adj->adjFn1(val1);
 						}
 					}
 				}
@@ -522,15 +528,16 @@ TTword *TTvocab::getPrefixedWord(TTstring &str) const {
 
 		if (!word)
 			tempStr = str;
-		else if (word->_wordClass == 8) {
+		else if (word->_wordClass == WC_ADJECTIVE) {
+			TTadj *adj = static_cast<TTadj *>(word);
 			int val1 = word->proc15();
 			int val2 = word->proc15();
 
 			if (val2 < 5) {
 				if (--val1 > 0)
-					word->unkFn1(val1);
+					adj->adjFn1(val1);
 			} else if (++val1 < 11) {
-				word->unkFn1(val1);
+				adj->adjFn1(val1);
 			}
 		}
 	}
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 1dccd30..df6ee5c 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -193,10 +193,6 @@ TTword *TTword::copy() const {
 	return new TTword(this);
 }
 
-void TTword::unkFn1(int val) {
-	// TODO: This method seems to reference a field beyond the size of TTword
-}
-
 FileHandle TTword::getSynFile() const {
 	return _synP ? _synP->_file : HANDLE_STDIN;
 }
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 537d1e9..b16e6a5 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -161,8 +161,6 @@ public:
 	 */
 	virtual TTword *copy() const;
 	
-	void unkFn1(int val);
-
 	virtual bool proc2(int val) const { return false; }
 	virtual int proc3() const { return -1; }
 	virtual void proc4() {}


Commit: b9ad4ff7277505054b0de88b78e0034a462a026b
    https://github.com/scummvm/scummvm/commit/b9ad4ff7277505054b0de88b78e0034a462a026b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:16:58-04:00

Commit Message:
TITANIC: Fix dispatching messages by target name

Changed paths:
    engines/titanic/messages/messages.cpp



diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
index 9f46fef..e25c22f 100644
--- a/engines/titanic/messages/messages.cpp
+++ b/engines/titanic/messages/messages.cpp
@@ -73,7 +73,7 @@ bool CMessage::execute(const CString &target, const ClassDef *classDef, int flag
 	// Scan for the target by name
 	CProjectItem *project = g_vm->_window->_project;
 	for (CTreeItem *treeItem = project; treeItem; treeItem = treeItem->scan(project)) {
-		if (treeItem->getName().compareToIgnoreCase(target))
+		if (!treeItem->getName().compareToIgnoreCase(target))
 			return execute(treeItem, classDef, flags);
 	}
 


Commit: 2f4cf6a26aab58f932c06806a952cbd047c02ed0
    https://github.com/scummvm/scummvm/commit/2f4cf6a26aab58f932c06806a952cbd047c02ed0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:17:02-04:00

Commit Message:
TITANIC: Beginnings of TTresponse class

Changed paths:
  A engines/titanic/true_talk/tt_response.cpp
  A engines/titanic/true_talk/tt_response.h
    engines/titanic/module.mk
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 19e4aff..c97b30f 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -471,6 +471,7 @@ MODULE_OBJS := \
 	true_talk/tt_parser.o \
 	true_talk/tt_picture.o \
 	true_talk/tt_pronoun.o \
+	true_talk/tt_response.o \
 	true_talk/tt_room_script.o \
 	true_talk/tt_script_base.o \
 	true_talk/tt_scripts.o \
diff --git a/engines/titanic/true_talk/tt_response.cpp b/engines/titanic/true_talk/tt_response.cpp
new file mode 100644
index 0000000..8d580ec
--- /dev/null
+++ b/engines/titanic/true_talk/tt_response.cpp
@@ -0,0 +1,71 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_response.h"
+
+namespace Titanic {
+
+TTresponse::TTresponse(const TTstring &src) : _field0(0), _text(src),
+	_fieldC(0), _nextP(nullptr), _linkP(nullptr) {
+}
+
+TTresponse::TTresponse(int val1, int val2) : _field0(val2), _text(" "),
+		_fieldC(val1), _nextP(nullptr), _linkP(nullptr) {
+}
+
+TTresponse::TTresponse(const TTresponse *src) : _field0(src->_field0), 
+		_text(src->_text), _fieldC(src->_fieldC), _nextP(src->_nextP),
+		_linkP(src->_linkP) {
+}
+
+TTresponse::~TTresponse() {
+	// Iterate through destroying any successive linked response items
+	TTresponse *nextP;
+	for (TTresponse *currP = _nextP; currP; currP = nextP) {
+		// Get the following response and detach it from the current one,
+		// so that when the current is destroyed, it will only destroy itself
+		nextP = currP->_nextP;
+		currP->_nextP = nullptr;
+		delete currP;
+	}
+}
+
+TTresponse *TTresponse::copyChain() const {
+	TTresponse *returnResponseP = new TTresponse(this);
+
+	for (TTresponse *srcP = _nextP, *destP = returnResponseP; 
+			srcP; srcP = srcP->_nextP, destP = destP->_nextP) {
+		destP->_nextP = new TTresponse(*srcP);
+	}
+
+	return returnResponseP;
+}
+
+void TTresponse::addLink(TTresponse *item) {
+	TTresponse *currP = this;
+	while (currP->_linkP)
+		currP = currP->_linkP;
+
+	currP->_linkP = item;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_response.h b/engines/titanic/true_talk/tt_response.h
new file mode 100644
index 0000000..c411976
--- /dev/null
+++ b/engines/titanic/true_talk/tt_response.h
@@ -0,0 +1,54 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_RESPONSE_H
+#define TITANIC_TT_RESPONSE_H
+
+#include "titanic/true_talk/tt_string.h"
+namespace Titanic {
+
+class TTsentence;
+
+class TTresponse {
+private:
+	int _field0;
+	TTstring _text;
+	int _fieldC;
+	TTresponse *_nextP;
+	TTresponse *_linkP;
+
+	TTresponse *copyChain() const;
+private:
+	/**
+	 * 
+	 */
+	void addLink(TTresponse *item);
+public:
+	TTresponse(const TTstring &src);
+	TTresponse(int val1, int val2);
+	TTresponse(const TTresponse *src);
+	virtual ~TTresponse();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_RESPONSE_H */
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index b16e6a5..349e9e9 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -29,10 +29,14 @@
 
 namespace Titanic {
 
+/**
+ * Types of words
+ */
 enum WordClass { 
 	WC_UNKNOWN = 0, WC_ACTION = 1, WC_THING = 2, WC_ABSTRACT = 3,
 	WC_ARTICLE = 4, WC_CONJUNCTION = 5, WC_PRONOUN = 6,
 	WC_PREPOSITION = 7, WC_ADJECTIVE = 8, WC_ADVERB = 9,
+	// TODO: These may not actually be part of this enum
 	WC_UNK_ACTION = 10,
 	WC_ATRANS = 11,		// transfer possession, eg: give/take
 	WC_PTRANS = 12,		// physical transfer, eg: go


Commit: 4ee0ced047ddef1994879e23cb6a2bb160933c1c
    https://github.com/scummvm/scummvm/commit/4ee0ced047ddef1994879e23cb6a2bb160933c1c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:17:05-04:00

Commit Message:
TITANIC: Fleshing out TTscriptBase class

Changed paths:
    engines/titanic/true_talk/title_engine.cpp
    engines/titanic/true_talk/title_engine.h
    engines/titanic/true_talk/tt_response.cpp
    engines/titanic/true_talk/tt_response.h
    engines/titanic/true_talk/tt_script_base.cpp
    engines/titanic/true_talk/tt_script_base.h
    engines/titanic/true_talk/tt_string.h



diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
index d5f4651..4dd45ba 100644
--- a/engines/titanic/true_talk/title_engine.cpp
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -40,7 +40,8 @@ void CTitleEngine::setup(int val1, int val2) {
 
 /*------------------------------------------------------------------------*/
 
-STtitleEngine::STtitleEngine(): CTitleEngine(), _field58(0) {
+STtitleEngine::STtitleEngine(): CTitleEngine(),
+		_responseP(nullptr), _field58(0) {
 }
 
 STtitleEngine::~STtitleEngine() {
@@ -56,8 +57,12 @@ void STtitleEngine::setup(int val1, int val2) {
 	CTitleEngine::setup(val1, 3);
 }
 
-int STtitleEngine::proc2(int val1, int val2) {
-	// TODO
+int STtitleEngine::setResponse(TTscriptBase *script, TTresponse *response) {
+	_indexes.clear();
+	for (TTresponse *respP = response; respP; respP = respP->getNext()) {
+		_indexes.push_back(respP->getDialogueId());
+	}
+
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index 10c32a7..afd2d3b 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -27,6 +27,7 @@
 #include "common/winexe_pe.h"
 #include "titanic/support/string.h"
 #include "titanic/true_talk/script_handler.h"
+#include "titanic/true_talk/tt_response.h"
 #include "titanic/true_talk/tt_script_base.h"
 #include "titanic/true_talk/tt_title_script.h"
 
@@ -52,7 +53,10 @@ public:
 	 */
 	virtual void setup(int val1, int val2 = 0);
 
-	virtual int proc2(int val1, int val2) { return 2; }
+	/**
+	 * Sets a conversation reponse
+	 */
+	virtual int setResponse(TTscriptBase *script, TTresponse *response) { return SS_4; }
 	
 	virtual int proc4(int unused) const = 0;
 	virtual int proc5(int64 unused) const = 0;
@@ -69,6 +73,7 @@ public:
 class STtitleEngine : public CTitleEngine {
 private:
 	Common::SeekableReadStream *_stream;
+	TTresponse *_responseP;
 	int _field58;
 public:
 	Common::Array<uint> _indexes;
@@ -84,7 +89,10 @@ public:
 	 */
 	virtual void setup(int val1, int val2 = 0);
 
-	virtual int proc2(int val1, int val2);
+	/**
+	 * Sets a conversation reponse
+	 */
+	virtual int setResponse(TTscriptBase *script, TTresponse *response);
 
 	virtual void dump(int val1, int val2);
 
diff --git a/engines/titanic/true_talk/tt_response.cpp b/engines/titanic/true_talk/tt_response.cpp
index 8d580ec..f007f98 100644
--- a/engines/titanic/true_talk/tt_response.cpp
+++ b/engines/titanic/true_talk/tt_response.cpp
@@ -25,15 +25,15 @@
 namespace Titanic {
 
 TTresponse::TTresponse(const TTstring &src) : _field0(0), _text(src),
-	_fieldC(0), _nextP(nullptr), _linkP(nullptr) {
+	_dialogueId(0), _nextP(nullptr), _linkP(nullptr) {
 }
 
-TTresponse::TTresponse(int val1, int val2) : _field0(val2), _text(" "),
-		_fieldC(val1), _nextP(nullptr), _linkP(nullptr) {
+TTresponse::TTresponse(int dialogueId, int val2) : _field0(val2), _text(" "),
+		_dialogueId(dialogueId), _nextP(nullptr), _linkP(nullptr) {
 }
 
 TTresponse::TTresponse(const TTresponse *src) : _field0(src->_field0), 
-		_text(src->_text), _fieldC(src->_fieldC), _nextP(src->_nextP),
+		_text(src->_text), _dialogueId(src->_dialogueId), _nextP(src->_nextP),
 		_linkP(src->_linkP) {
 }
 
diff --git a/engines/titanic/true_talk/tt_response.h b/engines/titanic/true_talk/tt_response.h
index c411976..38f7ec7 100644
--- a/engines/titanic/true_talk/tt_response.h
+++ b/engines/titanic/true_talk/tt_response.h
@@ -32,21 +32,30 @@ class TTresponse {
 private:
 	int _field0;
 	TTstring _text;
-	int _fieldC;
+	int _dialogueId;
 	TTresponse *_nextP;
 	TTresponse *_linkP;
 
 	TTresponse *copyChain() const;
-private:
-	/**
-	 * 
-	 */
-	void addLink(TTresponse *item);
 public:
 	TTresponse(const TTstring &src);
 	TTresponse(int val1, int val2);
 	TTresponse(const TTresponse *src);
 	virtual ~TTresponse();
+
+	TTresponse *getLink() const { return _linkP; }
+
+	void addLink(TTresponse *item);
+
+	/**
+	 * Get the dialogue Id for the response
+	 */
+	int getDialogueId() const { return _dialogueId; }
+
+	/**
+	 * Return the next response item, if present
+	 */
+	TTresponse *getNext() const { return _nextP; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index 85c329c..25c0b78 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -27,12 +27,12 @@ namespace Titanic {
 
 TTscriptBase::TTscriptBase(int scriptId, const char *charClass, int v2,
 		const char *charName, int v3, int v4, int v5, int v6, int v7) :
-		_charName(charName), _charClass(charClass), 
-		_nodesP(nullptr), _id(0), _hist(nullptr),
+		_charName(charName), _charClass(charClass), _status(0),
+		_nodesP(nullptr), _id(0), _hist1P(nullptr),
 		_field20(0), _field24(0), _field28(0), _field2C(0),
-		_field30(0), _field34(0), _field38(0), _field3C(0),
-		_field40(0), _field44(0), _field48(0), _status(0) {
-	if (!areNamesValid()) {
+		_field30(0), _field34(0), _hist2P(nullptr), _field3C(0),
+		_respHeadP(nullptr), _respTailP(nullptr), _responseP(nullptr) {
+	if (!isValid()) {
 		if (!v7 || !getStatus()) {
 			_id = scriptId;
 			_field20 = v3;
@@ -51,13 +51,19 @@ TTscriptBase::TTscriptBase(int scriptId, const char *charClass, int v2,
 }
 
 TTscriptBase::~TTscriptBase() {
+	deleteResponses();
+	delete _responseP;
+
+	delete _hist1P;
+	delete _hist2P;
+
 	if (_nodesP) {
 		_nodesP->deleteSiblings();
 		delete _nodesP;
 	}
 }
 
-bool TTscriptBase::areNamesValid() {
+bool TTscriptBase::isValid() {
 	bool result = !_charName.isValid() && !_charClass.isValid();
 	_status = result ? 0 : 11;
 	return result;
@@ -66,25 +72,25 @@ bool TTscriptBase::areNamesValid() {
 void TTscriptBase::reset() {
 	_nodesP = nullptr;
 	_id = 4;
-	_hist = nullptr;
+	_hist1P = nullptr;
 	_field20 = 0;
 	_field24 = -1;
 	_field28 = -1;
 	_field2C = -1;
 	_field30 = 0;
 	_field34 = 0;
-	_field38 = 0;
+	_hist2P = nullptr;
 	_field3C = 0;
-	_field40 = 0;
-	_field44 = 0;
-	_field48 = 0;
+	_respHeadP = nullptr;
+	_respTailP = nullptr;
+	_responseP = nullptr;
 }
 
 int TTscriptBase::preprocess(TTsentence *sentence) {
-	delete _hist;
-	_hist = new TTscriptHist(sentence);
+	delete _hist1P;
+	_hist1P = new TTscriptHist(sentence);
 
-	return _hist ? SS_VALID : SS_7;
+	return _hist1P ? SS_VALID : SS_7;
 }
 
 void TTscriptBase::proc2(int v) {
@@ -103,4 +109,40 @@ void TTscriptBase::proc5() {
 	warning("TODO");
 }
 
+void TTscriptBase::deleteResponses() {
+	while (_respTailP) {
+		_respHeadP = _respTailP;
+		_respTailP = _respHeadP->getLink();
+		delete _respHeadP;
+	}
+}
+
+void TTscriptBase::appendResponse(int val1, int *val2, int val3) {
+	if (!val2 || val1 <= *val2) {
+		if (_respHeadP) {
+			_respHeadP = new TTresponse(_respHeadP);
+		} else {
+			_respHeadP = new TTresponse(val3, 3);
+			if (_respTailP)
+				_respTailP->addLink(_respHeadP);
+			else
+				_respTailP = _respHeadP;
+		}
+	}
+}
+
+void TTscriptBase::appendResponse(int val1, int *val2, const TTstring &str) {
+	if (!val2 || val1 <= *val2) {
+		if (_respHeadP) {
+			_respHeadP = new TTresponse(str);
+		} else {
+			_respHeadP = new TTresponse(str);
+			if (_respTailP)
+				_respTailP->addLink(_respHeadP);
+			else
+				_respTailP = _respHeadP;
+		}
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index 2ffbf60..1baff89 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -26,6 +26,7 @@
 #include "titanic/true_talk/tt_string.h"
 #include "titanic/true_talk/tt_hist.h"
 #include "titanic/true_talk/tt_node.h"
+#include "titanic/true_talk/tt_response.h"
 
 namespace Titanic {
 
@@ -40,7 +41,7 @@ private:
 	void reset();
 protected:
 	TTnode *_nodesP;
-	TThist *_hist;
+	TThist *_hist1P;
 	TTstring _charName, _charClass;
 	int _field20;
 	int _field24;
@@ -48,12 +49,28 @@ protected:
 	int _field2C;
 	int _field30;
 	int _field34;
-	int _field38;
+	TThist *_hist2P;
 	int _field3C;
-	int _field40;
-	int _field44;
-	int _field48;
+	TTresponse *_respHeadP;
+	TTresponse *_respTailP;
+	TTresponse *_responseP;
 	int _status;
+protected:
+	/**
+	 * Delete any responses set up for the script
+	 */
+	void deleteResponses();
+	
+	/**
+	 * Creates and appends a new response to the script
+	 */
+	void appendResponse(int val1, int *val2, int val3);
+
+	void appendResponse(int val1, int *val2, const TTstring &str);
+
+	void appendResponse2(int val1, int *val2, const TTstring &str) {
+		appendResponse(val1, val2, str);
+	}
 public:
 	int _id;
 public:
@@ -61,7 +78,19 @@ public:
 		int v3, int v4, int v5, int v6, int v7);
 	virtual ~TTscriptBase();
 
-	bool areNamesValid();
+	virtual void proc2(int v);
+
+	virtual void proc3(int v);
+
+	virtual void proc4(int v);
+
+	virtual void proc5();
+
+
+	/**
+	 * Returns true if the script is in a valid state
+	 */
+	bool isValid();
 
 	/**
 	 * Return the Id of the script
@@ -83,13 +112,6 @@ public:
 	 */
 	int preprocess(TTsentence *sentence);
 
-	virtual void proc2(int v);
-
-	virtual void proc3(int v);
-
-	virtual void proc4(int v);
-
-	virtual void proc5();
 };
 
 
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 3e8718d..12daa07 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -38,7 +38,10 @@ struct TTstringData {
 	TTstringData(const CString &str) : _string(str), _referenceCount(1) {}
 };
 
-enum TTstringStatus { SS_VALID = 0, SS_1 = 1, SS_4 = 4, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_11 = 11, SS_13 = 13 };
+enum TTstringStatus {
+	SS_VALID = 0, SS_1 = 1, SS_2 = 2, SS_3 = 3, SS_4 = 4, 
+	SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_11 = 11, SS_13 = 13
+};
 
 class TTstring {
 private:


Commit: 9f6a3d36f7778c5e530c03063b856212b4805ab9
    https://github.com/scummvm/scummvm/commit/9f6a3d36f7778c5e530c03063b856212b4805ab9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:17:09-04:00

Commit Message:
TITANIC: Further fleshing out of TTscriptBase

Changed paths:
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/tt_response.h
    engines/titanic/true_talk/tt_script_base.cpp
    engines/titanic/true_talk/tt_script_base.h



diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index bfd7cdf..b689aba 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -112,4 +112,8 @@ void CScriptHandler::setParserConcept(TTconcept *newConcept, TTconcept *oldConce
 	_parser.conceptChanged(newConcept, oldConcept);
 }
 
+int CScriptHandler::setResponse(TTscriptBase *script, TTresponse *response) {
+	return _owner->setResponse(script, response);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 1c08248..10699f1 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -85,6 +85,11 @@ public:
 	 * Called when concept data is copied from one to another
 	 */
 	void setParserConcept(TTconcept *newConcept, TTconcept *oldConcept);
+
+	/**
+	 * Sets a conversation reponse
+	 */
+	int setResponse(TTscriptBase *script, TTresponse *response);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_response.h b/engines/titanic/true_talk/tt_response.h
index 38f7ec7..d39d18c 100644
--- a/engines/titanic/true_talk/tt_response.h
+++ b/engines/titanic/true_talk/tt_response.h
@@ -35,14 +35,17 @@ private:
 	int _dialogueId;
 	TTresponse *_nextP;
 	TTresponse *_linkP;
-
-	TTresponse *copyChain() const;
 public:
 	TTresponse(const TTstring &src);
 	TTresponse(int val1, int val2);
 	TTresponse(const TTresponse *src);
 	virtual ~TTresponse();
 
+	/**
+	 * Makes a copy of the chain of responses
+	 */
+	TTresponse *copyChain() const;
+
 	TTresponse *getLink() const { return _linkP; }
 
 	void addLink(TTresponse *item);
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index 25c0b78..218c86d 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -22,6 +22,7 @@
 
 #include "common/textconsole.h"
 #include "titanic/true_talk/tt_script_base.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -31,7 +32,7 @@ TTscriptBase::TTscriptBase(int scriptId, const char *charClass, int v2,
 		_nodesP(nullptr), _id(0), _hist1P(nullptr),
 		_field20(0), _field24(0), _field28(0), _field2C(0),
 		_field30(0), _field34(0), _hist2P(nullptr), _field3C(0),
-		_respHeadP(nullptr), _respTailP(nullptr), _responseP(nullptr) {
+		_respHeadP(nullptr), _respTailP(nullptr), _oldResponseP(nullptr) {
 	if (!isValid()) {
 		if (!v7 || !getStatus()) {
 			_id = scriptId;
@@ -52,7 +53,7 @@ TTscriptBase::TTscriptBase(int scriptId, const char *charClass, int v2,
 
 TTscriptBase::~TTscriptBase() {
 	deleteResponses();
-	delete _responseP;
+	delete _oldResponseP;
 
 	delete _hist1P;
 	delete _hist2P;
@@ -83,7 +84,7 @@ void TTscriptBase::reset() {
 	_field3C = 0;
 	_respHeadP = nullptr;
 	_respTailP = nullptr;
-	_responseP = nullptr;
+	_oldResponseP = nullptr;
 }
 
 int TTscriptBase::preprocess(TTsentence *sentence) {
@@ -93,20 +94,27 @@ int TTscriptBase::preprocess(TTsentence *sentence) {
 	return _hist1P ? SS_VALID : SS_7;
 }
 
-void TTscriptBase::proc2(int v) {
-	warning("TODO");
+void TTscriptBase::addResponse(const TTstring &str) {
+	appendResponse2(-1, nullptr, str);
 }
 
-void TTscriptBase::proc3(int v) {
-	warning("TODO");
+void TTscriptBase::addResponse(int val) {
+	appendResponse(-1, nullptr, val);
 }
 
-void TTscriptBase::proc4(int v) {
-	warning("TODO");
-}
+void TTscriptBase::applyResponse() {
+	delete _oldResponseP;
+	_oldResponseP = nullptr;
+
+	if (_respHeadP) {
+		g_vm->_scriptHandler->setResponse(this, _respHeadP);
+		_oldResponseP = _respHeadP->copyChain();
+		TTresponse *oldRespP = _respHeadP;
+		_respHeadP = _respHeadP->getLink();
+		_respTailP = nullptr;
 
-void TTscriptBase::proc5() {
-	warning("TODO");
+		delete oldRespP;
+	}
 }
 
 void TTscriptBase::deleteResponses() {
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index 1baff89..8387d24 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -53,7 +53,7 @@ protected:
 	int _field3C;
 	TTresponse *_respHeadP;
 	TTresponse *_respTailP;
-	TTresponse *_responseP;
+	TTresponse *_oldResponseP;
 	int _status;
 protected:
 	/**
@@ -78,14 +78,15 @@ public:
 		int v3, int v4, int v5, int v6, int v7);
 	virtual ~TTscriptBase();
 
-	virtual void proc2(int v);
+	virtual void addResponse(const TTstring &str);
 
-	virtual void proc3(int v);
-
-	virtual void proc4(int v);
-
-	virtual void proc5();
+	virtual void addResponse(int val);
 
+	/**
+	 * Passes on the list of dialogue Ids stored in the response(s)
+	 * to the title engine for later display in the PET
+	 */
+	virtual void applyResponse();
 
 	/**
 	 * Returns true if the script is in a valid state


Commit: 07c1b2b23d5e97d28707f4abf734fe1506da1999
    https://github.com/scummvm/scummvm/commit/07c1b2b23d5e97d28707f4abf734fe1506da1999
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:17:12-04:00

Commit Message:
TITANIC: Fleshing out of CTrueTalkManager class

Changed paths:
    engines/titanic/titanic.h
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_room_script.h



diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 768f334..4391796 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -121,6 +121,7 @@ public:
 	Common::RandomSource _randomSource;
 	CScriptHandler *_scriptHandler;
 	TTscriptBase *_script;
+	CTrueTalkManager *_trueTalkManager;
 	CExeResources _exeResources;
 	CMovieList _activeMovies;
 	StringArray _itemNames;
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index bff4ba6..76937da 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -32,7 +32,7 @@ namespace Titanic {
 
 int CTrueTalkManager::_v1;
 int CTrueTalkManager::_v2;
-int CTrueTalkManager::_v3;
+int CTrueTalkManager::_passengerClass;
 bool CTrueTalkManager::_v4;
 bool CTrueTalkManager::_v5;
 int CTrueTalkManager::_v6;
@@ -50,10 +50,12 @@ CTrueTalkManager::CTrueTalkManager(CGameManager *owner) :
 		_dialogueFile(nullptr), _dialogueId(0) {
 	_titleEngine.setup(3, 3);
 	_currentNPC = nullptr;
+	g_vm->_trueTalkManager = this;
 }
 
 CTrueTalkManager::~CTrueTalkManager() {
 	clear();
+	g_vm->_trueTalkManager = nullptr;
 }
 
 void CTrueTalkManager::save(SimpleFile *file) const {
@@ -100,7 +102,7 @@ void CTrueTalkManager::loadStatics(SimpleFile *file) {
 	int count = file->readNumber();
 	_v1 = file->readNumber();
 	_v2 = file->readNumber();
-	_v3 = file->readNumber();
+	_passengerClass = file->readNumber();
 	_v4 = file->readNumber() != 0;
 	_v5 = file->readNumber() != 0;
 	_v6 = file->readNumber();
@@ -124,7 +126,7 @@ void CTrueTalkManager::saveStatics(SimpleFile *file) {
 	file->writeNumber(10);
 	file->writeNumber(_v1);
 	file->writeNumber(_v2);
-	file->writeNumber(_v3);
+	file->writeNumber(_passengerClass);
 	file->writeNumber(_v4 ? 1 : 0);
 	file->writeNumber(_v5 ? 1 : 0);
 	file->writeNumber(_v6);
@@ -148,7 +150,7 @@ void CTrueTalkManager::setFlags(int index, int val) {
 	switch (index) {
 	case 1:
 		if (val >= 1 && val <= 3)
-			_v3 = val;
+			_passengerClass = val;
 		break;
 
 	case 2:
@@ -233,6 +235,14 @@ void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) {
 	setDialogue(npc, roomScript, view);
 }
 
+void CTrueTalkManager::start3(CTrueTalkNPC *npc, CViewItem *view) {
+	start(npc, 3, view);
+}
+
+void CTrueTalkManager::start4(CTrueTalkNPC *npc, CViewItem *view) {
+	start(npc, 4, view);
+}
+
 TTnpcScript *CTrueTalkManager::getTalker(const CString &name) const {
 	if (name.contains("Doorbot"))
 		return _scripts.getNpcScript(104);
@@ -285,6 +295,18 @@ TTroomScript *CTrueTalkManager::getRoomScript() const {
 	return script;
 }
 
+TTroomScript *CTrueTalkManager::getRoomScript(int roomId) const {
+	TTroomScript *script = nullptr;
+	if (roomId)
+		script = _scripts.getRoomScript(roomId);
+
+	if (!script)
+		// Fall back on the default Room script
+		script = _scripts.getRoomScript(110);
+
+	return script;
+}
+
 void CTrueTalkManager::loadAssets(CTrueTalkNPC *npc, int charId) {
 	// If assets for the character are already loaded, simply exit
 	if (_currentCharId == charId)
@@ -526,7 +548,7 @@ void CTrueTalkManager::playSpeech(TTtalker *talker, TTroomScript *roomScript, CV
 	}
 }
 
-int CTrueTalkManager::getStateVal(int stateNum) {
+int CTrueTalkManager::getStateValue(int stateNum) {
 	if (!_currentNPC)
 		return -1000;
 
@@ -549,4 +571,22 @@ bool CTrueTalkManager::proximityMethod1(int val) {
 	return false;
 }
 
+CGameManager *CTrueTalkManager::getGameManager() const {
+	return _gameManager;
+}
+
+CGameState *CTrueTalkManager::getGameState() const {
+	return _gameManager ? &_gameManager->_gameState : nullptr;
+}
+
+int CTrueTalkManager::getPassengerClass() const {
+	CGameState *gameState = getGameState();
+	return gameState ? gameState->_passengerClass : 4;
+}
+
+int CTrueTalkManager::getState14() const {
+	CGameState *gameState = getGameState();
+	return gameState ? gameState->_field14 : 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 3467fe1..89b9cfd 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -33,6 +33,7 @@
 namespace Titanic {
 
 class CGameManager;
+class CGameState;
 class CTreeItem;
 class CViewItem;
 class CTrueTalkManager;
@@ -107,10 +108,27 @@ private:
 	void playSpeech(TTtalker *talker, TTroomScript *roomScript, CViewItem *view, bool isParrot);
 
 	static bool proximityMethod1(int val);
+
+	/**
+	 * Return the game manager
+	 */
+	CGameManager *getGameManager() const;
+
+	/**
+	 * Return the game state
+	 */
+	CGameState *getGameState() const;
+
+	/**
+	 * Get the player's passenger class
+	 */
+	int getPassengerClass() const;
+
+	int getState14() const;
 public:
 	static int _v1;
 	static int _v2;
-	static int _v3;
+	static int _passengerClass;
 	static bool _v4;
 	static bool _v5;
 	static int _v6;
@@ -126,7 +144,7 @@ public:
 	/**
 	 * Get a specified state value from the currently set NPC
 	 */
-	static int getStateVal(int stateNum);
+	static int getStateValue(int stateNum);
 
 	/**
 	 * Trigger an NPC action
@@ -189,6 +207,16 @@ public:
 	void start(CTrueTalkNPC *npc, uint id, CViewItem *view);
 
 	/**
+	 * Start a TrueTalk conversation
+	 */
+	void start3(CTrueTalkNPC *npc, CViewItem *view);
+
+	/**
+	 * Start a TrueTalk conversation
+	 */
+	void start4(CTrueTalkNPC *npc, CViewItem *view);
+
+	/**
 	 * Return a TrueTalk talker/script
 	 */
 	TTnpcScript *getTalker(const CString &name) const;
@@ -197,6 +225,11 @@ public:
 	 * Process player's input
 	 */
 	void processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CViewItem *view);
+
+	/**
+	 * Gets the script associated with a specific room
+	 */
+	TTroomScript *getRoomScript(int roomId) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 0775d09..2aa3b85 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -23,6 +23,7 @@
 #include "common/textconsole.h"
 #include "titanic/true_talk/tt_npc_script.h"
 #include "titanic/true_talk/true_talk_manager.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -229,4 +230,10 @@ void TTnpcScript::preLoad() {
 	}
 }
 
+int TTnpcScript::getRoom54(int roomId) {
+	TTroomScript *room = g_vm->_trueTalkManager->getRoomScript(roomId);
+	return room ? room->_field54 : 0;
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 2396943..2c6c6a0 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -75,6 +75,8 @@ protected:
 	void resetFlags();
 
 	void randomizeFlags();
+
+	static int getRoom54(int roomId);
 public:
 	TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,
diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h
index 7fd43f3..63aedd2 100644
--- a/engines/titanic/true_talk/tt_room_script.h
+++ b/engines/titanic/true_talk/tt_room_script.h
@@ -52,7 +52,7 @@ public:
 
 
 class TTroomScript : public TTroomScriptBase {
-private:
+public:
 	int _field54;
 public:
 	TTroomScript(int scriptId);


Commit: 3ad600439b7cfceae854a8a257a20c4a934634e2
    https://github.com/scummvm/scummvm/commit/3ad600439b7cfceae854a8a257a20c4a934634e2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:17:16-04:00

Commit Message:
TITANIC: Added TTnpcScript getValue

Changed paths:
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 76937da..1c10953 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -32,7 +32,7 @@ namespace Titanic {
 
 int CTrueTalkManager::_v1;
 int CTrueTalkManager::_v2;
-int CTrueTalkManager::_passengerClass;
+int CTrueTalkManager::_v3;
 bool CTrueTalkManager::_v4;
 bool CTrueTalkManager::_v5;
 int CTrueTalkManager::_v6;
@@ -102,7 +102,7 @@ void CTrueTalkManager::loadStatics(SimpleFile *file) {
 	int count = file->readNumber();
 	_v1 = file->readNumber();
 	_v2 = file->readNumber();
-	_passengerClass = file->readNumber();
+	_v3 = file->readNumber();
 	_v4 = file->readNumber() != 0;
 	_v5 = file->readNumber() != 0;
 	_v6 = file->readNumber();
@@ -126,7 +126,7 @@ void CTrueTalkManager::saveStatics(SimpleFile *file) {
 	file->writeNumber(10);
 	file->writeNumber(_v1);
 	file->writeNumber(_v2);
-	file->writeNumber(_passengerClass);
+	file->writeNumber(_v3);
 	file->writeNumber(_v4 ? 1 : 0);
 	file->writeNumber(_v5 ? 1 : 0);
 	file->writeNumber(_v6);
@@ -150,7 +150,7 @@ void CTrueTalkManager::setFlags(int index, int val) {
 	switch (index) {
 	case 1:
 		if (val >= 1 && val <= 3)
-			_passengerClass = val;
+			_v3 = val;
 		break;
 
 	case 2:
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 89b9cfd..ef226f2 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -118,17 +118,10 @@ private:
 	 * Return the game state
 	 */
 	CGameState *getGameState() const;
-
-	/**
-	 * Get the player's passenger class
-	 */
-	int getPassengerClass() const;
-
-	int getState14() const;
 public:
 	static int _v1;
 	static int _v2;
-	static int _passengerClass;
+	static int _v3;
 	static bool _v4;
 	static bool _v5;
 	static int _v6;
@@ -230,6 +223,13 @@ public:
 	 * Gets the script associated with a specific room
 	 */
 	TTroomScript *getRoomScript(int roomId) const;
+
+	/**
+	 * Get the player's passenger class
+	 */
+	int getPassengerClass() const;
+
+	int getState14() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 2aa3b85..7020794 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -235,5 +235,53 @@ int TTnpcScript::getRoom54(int roomId) {
 	return room ? room->_field54 : 0;
 }
 
+int TTnpcScript::getValue(int testNum) {
+	switch (testNum) {
+	case 0:
+		return CTrueTalkManager::_v2;
+	
+	case 1:
+		if (g_vm->_trueTalkManager)
+			CTrueTalkManager::_v3 = g_vm->_trueTalkManager->getPassengerClass();
+		return CTrueTalkManager::_v3;
+
+	case 2:
+		return CTrueTalkManager::_v4;
+
+	case 3:
+		return CTrueTalkManager::_v5 != 0;
+	
+	case 4:
+		if (g_vm->_trueTalkManager) {
+			switch (g_vm->_trueTalkManager->getState14()) {
+			case 1:
+				CTrueTalkManager::_v6 = 3;
+				break;
+			case 2:
+				CTrueTalkManager::_v6 = 0;
+				break;
+			case 3:
+				CTrueTalkManager::_v6 = 1;
+				break;
+			default:
+				CTrueTalkManager::_v6 = 2;
+				break;
+			}
+		}		
+		return CTrueTalkManager::_v6;
+
+	case 5:
+		return CTrueTalkManager::_v7;
+
+	case 6:
+		return CTrueTalkManager::_v8 != 0;
+
+	case 7:
+		return !!getRoom54(123);
+
+	default:
+		return CTrueTalkManager::_v11[testNum];
+	}
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 2c6c6a0..833a958 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -77,6 +77,11 @@ protected:
 	void randomizeFlags();
 
 	static int getRoom54(int roomId);
+
+	/**
+	 * Perform test on various state values
+	 */
+	int getValue(int testNum);
 public:
 	TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,


Commit: d84fb55a24e36b2d829b89534a166b802a4b1fd7
    https://github.com/scummvm/scummvm/commit/d84fb55a24e36b2d829b89534a166b802a4b1fd7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:17:20-04:00

Commit Message:
TITANIC: Adding TTnpcScript dialogue Id handling

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index ab4fbb2..2bb3a18 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -25,7 +25,7 @@
 
 namespace Titanic {
 
-int BarbotScript::proc6() const {
+int BarbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
 	return 2;
 }
@@ -59,7 +59,7 @@ bool BarbotScript::proc18() const {
 	return false;
 }
 
-int BarbotScript::proc21(int v) {
+int BarbotScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
 }
@@ -74,8 +74,9 @@ int BarbotScript::proc23() const {
 	return 0;
 }
 
-void BarbotScript::proc24() {
+const int *BarbotScript::getTablePtr(int id) {
 	warning("TODO");
+	return nullptr;
 }
 
 int BarbotScript::proc25() const {
@@ -90,12 +91,12 @@ void BarbotScript::proc32() {
 	warning("TODO");
 }
 
-int BarbotScript::proc36() const {
+int BarbotScript::proc36(int tagId) const {
 	warning("TODO");
 	return 0;
 }
 
-int BarbotScript::proc37() const {
+uint BarbotScript::translateId(uint id) const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index ac074e2..a55c12b 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -33,22 +33,23 @@ public:
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
-	virtual int proc6() const;
+	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
 	virtual bool proc16() const;
 	virtual bool proc17() const;
 	virtual bool proc18() const;
-	virtual int proc21(int v);
+	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22() const;
 	virtual int proc23() const;
-	virtual void proc24();
+	virtual const int *getTablePtr(int id);
 	virtual int proc25() const;
 	virtual void proc26();
 	virtual void proc32();
-	virtual int proc36() const;
-	virtual int proc37() const;
+	virtual int proc36(int val) const;
+	
+	virtual uint translateId(uint id) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index ccd83d0..794e671 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -40,7 +40,7 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	_array[1] = 0;
 }
 
-int BellbotScript::proc6() const {
+int BellbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
 	return 2;
 }
@@ -74,7 +74,7 @@ bool BellbotScript::proc18() const {
 	return 0;
 }
 
-int BellbotScript::proc21(int v) {
+int BellbotScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
 }
@@ -89,8 +89,9 @@ int BellbotScript::proc23() const {
 	return 0;
 }
 
-void BellbotScript::proc24() {
+const int *BellbotScript::getTablePtr(int id) {
 	warning("TODO");
+	return nullptr;
 }
 
 int BellbotScript::proc25() const {
@@ -101,12 +102,12 @@ int BellbotScript::proc25() const {
 void BellbotScript::proc26() {
 }
 
-int BellbotScript::proc36() const {
+int BellbotScript::proc36(int id) const {
 	warning("TODO");
 	return 0;
 }
 
-int BellbotScript::proc37() const {
+uint BellbotScript::translateId(uint id) const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index d759583..d7fbab3 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -38,21 +38,21 @@ public:
 	BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
 
-	virtual int proc6() const;
+	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
 	virtual bool proc16() const;
 	virtual bool proc17() const;
 	virtual bool proc18() const;
-	virtual int proc21(int v);
+	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22() const;
 	virtual int proc23() const;
-	virtual void proc24();
+	virtual const int *getTablePtr(int id);
 	virtual int proc25() const;
 	virtual void proc26();
-	virtual int proc36() const;
-	virtual int proc37() const;
+	virtual int proc36(int val) const;
+	virtual uint translateId(uint id) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 65a13b5..dbe2664 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -41,9 +41,21 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 		_field74 = 0;
 }
 
-int DeskbotScript::proc6() const {
-	warning("TODO");
-	return 2;
+int DeskbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
+	for (uint idx = 0; idx < _tags.size(); ++idx) {
+		const TTnpcScriptTag &scriptTag = _tags[idx];		
+		uint currTag = (idx == 0) ? MKTAG('P', 'K', 'U', 'P') : scriptTag._tag;
+
+		if (currTag == tag) {
+			int valIndex = getRandomNumber(scriptTag.size()) - 1;
+			uint diagId = getDialogueId(scriptTag._values[valIndex]);
+			addResponse(diagId);
+			applyResponse();
+			break;
+		}
+	}
+
+	return SS_1;
 }
 
 void DeskbotScript::proc7(int v1, int v2) {
@@ -75,7 +87,7 @@ bool DeskbotScript::proc18() const {
 	return 0;
 }
 
-int DeskbotScript::proc21(int v) {
+int DeskbotScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
 }
@@ -90,8 +102,9 @@ int DeskbotScript::proc23() const {
 	return 0;
 }
 
-void DeskbotScript::proc24() {
+const int *DeskbotScript::getTablePtr(int id) {
 	warning("TODO");
+	return nullptr;
 }
 
 int DeskbotScript::proc25() const {
@@ -102,12 +115,12 @@ int DeskbotScript::proc25() const {
 void DeskbotScript::proc26() {
 }
 
-int DeskbotScript::proc36() const {
+int DeskbotScript::proc36(int id) const {
 	warning("TODO");
 	return 0;
 }
 
-int DeskbotScript::proc37() const {
+uint DeskbotScript::translateId(uint id) const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 8db1a80..f2de881 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -23,30 +23,33 @@
 #ifndef TITANIC_DESKBOT_SCRIPT_H
 #define TITANIC_DESKBOT_SCRIPT_H
 
+#include "common/array.h"
 #include "titanic/true_talk/tt_npc_script.h"
 
 namespace Titanic {
 
 class DeskbotScript : public TTnpcScript {
+private:
+	Common::Array<TTnpcScriptTag> _tags;
 public:
 	DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
 
-	virtual int proc6() const;
+	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
 	virtual bool proc16() const;
 	virtual bool proc17() const;
 	virtual bool proc18() const;
-	virtual int proc21(int v);
+	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22() const;
 	virtual int proc23() const;
-	virtual void proc24();
+	virtual const int *getTablePtr(int id);
 	virtual int proc25() const;
 	virtual void proc26();
-	virtual int proc36() const;
-	virtual int proc37() const;
+	virtual int proc36(int val) const;
+	virtual uint translateId(uint id) const;
 
 	virtual void proc38();
 	virtual void proc39();
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 43b9e46..9d35f69 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -25,7 +25,7 @@
 
 namespace Titanic {
 
-int DoorbotScript::proc6() const {
+int DoorbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
 	return 2;
 }
@@ -59,7 +59,7 @@ bool DoorbotScript::proc18() const {
 	return 0;
 }
 
-int DoorbotScript::proc21(int v) {
+int DoorbotScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
 }
@@ -74,8 +74,9 @@ int DoorbotScript::proc23() const {
 	return 0;
 }
 
-void DoorbotScript::proc24() {
+const int *DoorbotScript::getTablePtr(int id) {
 	warning("TODO");
+	return nullptr;
 }
 
 int DoorbotScript::proc25() const {
@@ -90,12 +91,12 @@ void DoorbotScript::proc32() {
 	warning("TODO");
 }
 
-int DoorbotScript::proc36() const {
+int DoorbotScript::proc36(int id) const {
 	warning("TODO");
 	return 0;
 }
 
-int DoorbotScript::proc37() const {
+uint DoorbotScript::translateId(uint id) const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index c812d31..82897b7 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -35,22 +35,22 @@ public:
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
-	virtual int proc6() const;
+	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
 	virtual bool proc16() const;
 	virtual bool proc17() const;
 	virtual bool proc18() const;
-	virtual int proc21(int v);
+	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22() const;
 	virtual int proc23() const;
-	virtual void proc24();
+	virtual const int *getTablePtr(int id);
 	virtual int proc25() const;
 	virtual void proc26();
 	virtual void proc32();
-	virtual int proc36() const;
-	virtual int proc37() const;
+	virtual int proc36(int val) const;
+	virtual uint translateId(uint id) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index c30d226..b1577b3 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -25,7 +25,7 @@
 
 namespace Titanic {
 
-int LiftbotScript::proc6() const {
+int LiftbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
 	return 2;
 }
@@ -64,7 +64,7 @@ bool LiftbotScript::proc18() const {
 	return 0;
 }
 
-int LiftbotScript::proc21(int v) {
+int LiftbotScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
 }
@@ -79,8 +79,9 @@ int LiftbotScript::proc23() const {
 	return 0;
 }
 
-void LiftbotScript::proc24() {
+const int *LiftbotScript::getTablePtr(int id) {
 	warning("TODO");
+	return nullptr;
 }
 
 int LiftbotScript::proc25() const {
@@ -95,7 +96,7 @@ void LiftbotScript::proc32() {
 	warning("TODO");
 }
 
-int LiftbotScript::proc37() const {
+uint LiftbotScript::translateId(uint id) const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 7bb355a..8c2ae32 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -33,7 +33,7 @@ public:
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
-	virtual int proc6() const;
+	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
 	virtual void proc7(int v1, int v2);
 	virtual int proc9() const;
 	virtual int proc10() const;
@@ -41,14 +41,14 @@ public:
 	virtual bool proc16() const;
 	virtual bool proc17() const;
 	virtual bool proc18() const;
-	virtual int proc21(int v);
+	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22() const;
 	virtual int proc23() const;
-	virtual void proc24();
+	virtual const int *getTablePtr(int id);
 	virtual int proc25() const;
 	virtual void proc26();
 	virtual void proc32();
-	virtual int proc37() const;
+	virtual uint translateId(uint id) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 35f1efa..5581c6b 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -39,7 +39,7 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
 	CTrueTalkManager::setFlags(16, 0);
 }
 
-int MaitreDScript::proc6() const {
+int MaitreDScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
 	return 2;
 }
@@ -68,7 +68,7 @@ bool MaitreDScript::proc18() const {
 	return 0;
 }
 
-int MaitreDScript::proc21(int v) {
+int MaitreDScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
 }
@@ -83,8 +83,9 @@ int MaitreDScript::proc23() const {
 	return 0;
 }
 
-void MaitreDScript::proc24() {
+const int *MaitreDScript::getTablePtr(int id) {
 	warning("TODO");
+	return nullptr;
 }
 
 int MaitreDScript::proc25() const {
@@ -95,7 +96,7 @@ int MaitreDScript::proc25() const {
 void MaitreDScript::proc26() {
 }
 
-int MaitreDScript::proc37() const {
+uint MaitreDScript::translateId(uint id) const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index bd3e440..14505ca 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -32,19 +32,19 @@ public:
 	MaitreDScript(int val1, const char *charClass, int v2,
 			const char *charName, int v3, int val2);
 
-	virtual int proc6() const;
+	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual bool proc16() const;
 	virtual bool proc17() const;
 	virtual bool proc18() const;
-	virtual int proc21(int v);
+	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22() const;
 	virtual int proc23() const;
-	virtual void proc24();
+	virtual const int *getTablePtr(int id);
 	virtual int proc25() const;
 	virtual void proc26();
-	virtual int proc37() const;
+	virtual uint translateId(uint id) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index e97d32d..a6b37bf 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -25,7 +25,7 @@
 
 namespace Titanic {
 
-int ParrotScript::proc6() const {
+int ParrotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
 	return 2;
 }
@@ -54,8 +54,9 @@ int ParrotScript::proc23() const {
 	return 0;
 }
 
-void ParrotScript::proc24() {
+const int *ParrotScript::getTablePtr(int id) {
 	warning("TODO");
+	return nullptr;
 }
 
 int ParrotScript::proc25() const {
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index 246ceb4..0add5d9 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -33,13 +33,13 @@ public:
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
-	virtual int proc6() const;
+	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual bool proc17() const;
 	virtual bool proc18() const;
 	virtual int proc23() const;
-	virtual void proc24();
+	virtual const int *getTablePtr(int id);
 	virtual int proc25() const;
 	virtual void proc26();
 };
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 0c1f670..436b779 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -25,7 +25,7 @@
 
 namespace Titanic {
 
-int SuccUBusScript::proc6() const {
+int SuccUBusScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
 	return 2;
 }
@@ -49,7 +49,7 @@ bool SuccUBusScript::proc18() const {
 	return 0;
 }
 
-int SuccUBusScript::proc21(int v) {
+int SuccUBusScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
 }
@@ -59,8 +59,9 @@ int SuccUBusScript::proc23() const {
 	return 0;
 }
 
-void SuccUBusScript::proc24() {
+const int *SuccUBusScript::getTablePtr(int id) {
 	warning("TODO");
+	return nullptr;
 }
 
 int SuccUBusScript::proc25() const {
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 6917d0a..8a078c2 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -36,14 +36,14 @@ public:
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
 		_field2D0(0) {}
 
-	virtual int proc6() const;
+	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual bool proc17() const;
 	virtual bool proc18() const;
-	virtual int proc21(int v);
+	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc23() const;
-	virtual void proc24();
+	virtual const int *getTablePtr(int id);
 	virtual int proc25() const;
 	virtual void proc26();
 };
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 7020794..bbd75a4 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -27,6 +27,17 @@
 
 namespace Titanic {
 
+int TTnpcScriptTag::size() const {
+	for (int idx = 0; idx < 4; ++idx) {
+		if (_values[idx] == 0)
+			return idx;
+	}
+
+	return 4;
+}
+
+/*------------------------------------------------------------------------*/
+
 TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTscriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
@@ -40,9 +51,9 @@ TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 		TTnpcScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
 		_subPtr(nullptr), _field60(0), _field64(0), _field68(0),
 		_field6C(0), _field70(0), _field74(0), _field78(0),
-		_field7C(0), _field80(0) {
+		_field7C(0), _field80(0), _field2CC(false) {
 	CTrueTalkManager::_v2 = 0;
-	Common::fill(&_array[0], &_array[147], 0);
+	Common::fill(&_array[0], &_array[146], 0);
 
 	if (!CTrueTalkManager::_v10) {
 		Common::fill(&CTrueTalkManager::_v11[0], &CTrueTalkManager::_v11[41], 0);
@@ -53,7 +64,8 @@ TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 }
 
 void TTnpcScript::resetFlags() {
-	Common::fill(&_array[26], &_array[146], 0);
+	Common::fill(&_array[20], &_array[140], 0);
+	_field2CC = false;
 }
 
 void TTnpcScript::randomizeFlags() {
@@ -109,16 +121,18 @@ bool TTnpcScript::proc18() const {
 	return true;
 }
 
-void TTnpcScript::proc19(int v) {
+uint TTnpcScript::proc19(uint v) {
 	warning("TODO");
+	return 0;
 }
 
 void TTnpcScript::proc20(int v) {
 	warning("TODO");
 }
 
-int TTnpcScript::proc21(int v) {
-	return v;
+int TTnpcScript::proc21(int v1, int v2, int v3) {
+	// TODO
+	return v1;
 }
 
 int TTnpcScript::proc22() const {
@@ -216,11 +230,11 @@ int TTnpcScript::getDialLevel(uint dialNum, bool flag) {
 	return 0;
 }
 
-int TTnpcScript::proc36() const {
+int TTnpcScript::proc36(int id) const {
 	return 0;
 }
 
-int TTnpcScript::proc37() const {
+uint TTnpcScript::translateId(uint id) const {
 	return 0;
 }
 
@@ -284,4 +298,78 @@ int TTnpcScript::getValue(int testNum) {
 	}
 }
 
+uint TTnpcScript::getRandomNumber(int max) const {
+	return 1 + g_vm->getRandomNumber(max - 1);
+}
+
+uint TTnpcScript::getDialogueId(uint tagId) {
+	if (tagId < 200000)
+		return tagId;
+
+	// Perform any script specific translation
+	uint origId = tagId;
+	if (tagId >= 290000 && tagId <= 290263)
+		tagId = translateId(tagId);
+	if (!tagId)
+		return 0;
+
+	if (!_field2CC) {
+		_field2CC = true;
+		int val = translateByArray(tagId);
+		if (val > 0) {
+			if (proc36(val))
+				return 4;
+		}
+	}
+
+	uint oldTagId = tagId;
+	tagId = proc19(tagId);
+	if (tagId != oldTagId)
+		tagId = proc19(tagId);
+
+	oldTagId = proc23();
+	int v21 = proc21(origId, tagId, oldTagId);
+	if (!v21)
+		return 0;
+
+	int idx = 0;
+	const int *tableP;
+	for (;;) {
+		tableP = getTablePtr(idx++);
+		if (!tableP)
+			return 0;
+
+		if (*tableP == v21)
+			break;
+	}
+	uint newVal = tableP[oldTagId + 1];
+
+	idx = 0;
+	int *arrP = &_array[26];
+	while (idx < 4 && arrP[idx])
+		++idx;
+	if (idx == 4)
+		return newVal;
+
+	_array[26] = origId;
+	idx = 0;
+	arrP = &_array[30];
+	while (idx < 4 && arrP[idx])
+		++idx;
+	if (idx == 4)
+		return newVal;
+
+	arrP[idx] = newVal;
+	return newVal;
+}
+
+int TTnpcScript::translateByArray(int id) {
+	for (uint idx = 1, arrIndex = 35; idx < 15; ++idx, arrIndex += 8) {
+		if (_array[idx - 1] == id && _array[idx] == 0)
+			return idx;
+	}
+
+	return -1;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 833a958..d52da2e 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -31,6 +31,16 @@ namespace Titanic {
 class TTroomScript;
 class TTsentence;
 
+struct TTnpcScriptTag {
+	uint _tag;
+	uint _values[4];
+
+	/**
+	 * Returns the size of the values list plus 1
+	 */
+	int size() const;
+};
+
 class TTnpcScriptBase : public TTscriptBase {
 protected:
 	int _field54;
@@ -59,6 +69,8 @@ public:
 };
 
 class TTnpcScript : public TTnpcScriptBase {
+private:
+	int translateByArray(int id);
 protected:
 	byte *_subPtr;
 	int _field60;
@@ -70,7 +82,8 @@ protected:
 	int _field78;
 	int _field7C;
 	int _field80;
-	int _array[147];
+	int _array[146];
+	bool _field2CC;
 protected:
 	void resetFlags();
 
@@ -82,6 +95,16 @@ protected:
 	 * Perform test on various state values
 	 */
 	int getValue(int testNum);
+
+	/**
+	 * Gets a random number between 1 and a given max
+	 */
+	uint getRandomNumber(int max) const;
+
+	/**
+	 * Returns a dialogue Id by script tag value Id
+	 */
+	uint getDialogueId(uint tagId);
 public:
 	TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,
@@ -108,12 +131,12 @@ public:
 	virtual bool proc16() const;
 	virtual bool proc17() const;
 	virtual bool proc18() const;
-	virtual void proc19(int v);
+	virtual uint proc19(uint v);
 	virtual void proc20(int v);
-	virtual int proc21(int v);
+	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22() const;
 	virtual int proc23() const;
-	virtual void proc24() = 0;
+	virtual const int *getTablePtr(int id) = 0;
 	virtual int proc25() const;
 	virtual void proc26();
 	virtual void save(SimpleFile *file);
@@ -130,8 +153,8 @@ public:
 	 */
 	virtual int getDialLevel(uint dialNum, bool flag = true);
 
-	virtual int proc36() const;
-	virtual int proc37() const;
+	virtual int proc36(int val) const;
+	virtual uint translateId(uint id) const;
 
 	void preLoad();
 


Commit: ef3bd4e28609749b4ada71210dce079cd77dc2a4
    https://github.com/scummvm/scummvm/commit/ef3bd4e28609749b4ada71210dce079cd77dc2a4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:17:24-04:00

Commit Message:
DEVTOOLS: Adding Deskbot tags list

Changed paths:
  A devtools/create_titanic/script_tags.cpp
  A devtools/create_titanic/script_tags.h
    devtools/create_titanic/create_titanic_dat.cpp
    devtools/create_titanic/file.h
    devtools/create_titanic/module.mk



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 35157b0..9b8e8ca 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -36,6 +36,7 @@
 #include "common/rect.h"
 #include "winexe_pe.h"
 #include "file.h"
+#include "script_tags.h"
 
 /**
  * Format of the access.dat file that will be created:
@@ -352,6 +353,7 @@ void writeData() {
 	writeStringArray("TEXT/PRONOUNS", 0x22F718, 15);
 
 	writeNumbers();
+	writeAllScriptTags();
 }
 
 int main(int argc, char *argv[]) {
diff --git a/devtools/create_titanic/file.h b/devtools/create_titanic/file.h
index e8d4960..4580e83 100644
--- a/devtools/create_titanic/file.h
+++ b/devtools/create_titanic/file.h
@@ -210,4 +210,6 @@ public:
 
 }
 
+extern Common::File inputFile, outputFile;
+
 #endif
diff --git a/devtools/create_titanic/module.mk b/devtools/create_titanic/module.mk
index 05a4130..f74f445 100644
--- a/devtools/create_titanic/module.mk
+++ b/devtools/create_titanic/module.mk
@@ -4,6 +4,7 @@ MODULE := devtools/create_titanic
 MODULE_OBJS := \
 	create_titanic_dat.o \
 	hashmap.o \
+	script_tags.o \
 	str.o \
 	winexe.o \
 	winexe_pe.o
diff --git a/devtools/create_titanic/script_tags.cpp b/devtools/create_titanic/script_tags.cpp
new file mode 100644
index 0000000..3ee94ab
--- /dev/null
+++ b/devtools/create_titanic/script_tags.cpp
@@ -0,0 +1,191 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+ // Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+// HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
+#include "file.h"
+#include "script_tags.h"
+
+static const int DESKBOT_TAGS[][5] = {
+	{ MKTAG('P', 'K', 'U', 'P'), 240573, 0, 0, 0 },
+	{ MKTAG('S', 'E', 'X', '1'), 240573, 0, 0, 0 },
+	{ MKTAG('R', 'E', 'S', '1'), 240354, 0, 0, 0 },
+	{ MKTAG('R', 'E', 'S', '2'), 240547, 0, 0, 0 },
+	{ MKTAG('S', 'W', 'E', 'R'), 240578, 0, 0, 0 },
+	{ MKTAG('B', 'Y', 'Z', 'A'), 241173, 0, 0, 0 },
+	{ MKTAG('S', 'A', 'S', 'S'), 240986, 0, 0, 0 },
+	{ MKTAG('S', 'H', 'M', 'S'), 240453, 0, 0, 0 },
+	{ MKTAG('F', 'O', 'O', 'D'), 240849, 0, 0, 0 },
+	{ MKTAG('J', 'F', 'O', 'D'), 240849, 0, 0, 0 },
+
+	{ MKTAG('C', 'H', 'S', 'E'), 240849, 0, 0, 0 },
+	{ MKTAG('A', 'C', 'T', 'R'), 240654, 0, 0, 0 },
+	{ MKTAG('A', 'C', 'T', 'S'), 240655, 0, 0, 0 },
+	{ MKTAG('M', 'U', 'S', 'I'), 240681, 240849, 0, 0 },
+	{ MKTAG('S', 'A', 'N', 'G'), 240681, 240657, 0, 0 },
+	{ MKTAG('S', 'O', 'A', 'P'), 240681, 0, 0, 0 },
+	{ MKTAG('T', 'V', 'S', 'H'), 240681, 0, 0, 0 },
+	{ MKTAG('A', 'R', 'T', 'I'), 240657, 0, 0, 0 },
+	{ MKTAG('A', 'U', 'T', 'H'), 240657, 0, 0, 0 },
+	{ MKTAG('C', 'O', 'M', 'D'), 240657, 240785, 0, 0 },
+
+	{ MKTAG('C', 'O', 'O', 'K'), 240657, 0, 0, 0 },
+	{ MKTAG('C', 'O', 'P', 'S'), 240657, 0, 0, 0 },
+	{ MKTAG('H', 'E', 'R', 'O'), 240657, 0, 0, 0 },
+	{ MKTAG('H', 'O', 'S', 'T'), 240657, 0, 0, 0 },
+	{ MKTAG('P', 'T', 'I', 'C'), 240657, 0, 0, 0 },
+	{ MKTAG('S', 'C', 'I', 'T'), 240657, 0, 0, 0 },
+	{ MKTAG('E', 'A', 'R', 'T'), 240728, 0, 0, 0 },
+	{ MKTAG('P', 'L', 'A', 'N'), 240728, 0, 0, 0 },
+	{ MKTAG('F', 'I', 'L', 'M'), 240939, 0, 0, 0 },
+	{ MKTAG('F', 'I', 'S', 'H'), 240437, 0, 0, 0 },
+
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+
+	{ MKTAG('H', 'H', 'G', 'Q'), 241065, 240453, 0, 0 },
+	{ MKTAG('L', 'I', 'Q', 'D'), 241167, 0, 0, 0 },
+	{ MKTAG('P', 'H', 'I', 'L'), 240607, 0, 0, 0 },
+	{ MKTAG('S', 'I', 'C', 'K'), 241170, 0, 0, 0 },
+	{ MKTAG('T', 'W', 'A', 'T'), 240975, 0, 0, 0 },
+	{ MKTAG('H', 'A', 'H', 'A'), 240785, 0, 0, 0 },
+	{ MKTAG('S', 'C', 'I', 'T'), 240968, 241617, 0, 0 },
+	{ MKTAG('S', 'C', 'I', 'E'), 240967, 241616, 0, 0 },
+	{ MKTAG('S', 'L', 'O', 'W'), 241614, 0, 0, 0 },
+	{ MKTAG('T', 'H', 'A', 'T'), 240760,  241615, 0, 0 },
+
+	{ MKTAG('T', 'D', 'U', 'P'), 241161, 241618, 0, 0 },
+	{ MKTAG('T', 'I', 'T', 'A'), 241619, 0, 0, 0 },
+	{ MKTAG('C', 'S', 'P', 'Y'), 241620, 0, 0, 0 },
+	{ MKTAG('M', 'I', 'N', 'S'), 241621, 0, 0, 0 },
+	{ MKTAG('M', 'C', 'P', 'Y'), 241622, 0, 0, 0 },
+	{ MKTAG('D', 'N', 'C', 'E'), 241623, 0, 0, 0 },
+	{ MKTAG('N', 'A', 'U', 'T'), 241624, 0, 0, 0 },
+	{ MKTAG('A', 'D', 'V', 'T'), 240939, 241622, 0, 0 },
+	{ MKTAG('A', 'N', 'S', 'W'), 240453, 0, 0, 0 },
+	{ MKTAG('A', 'R', 'T', 'Y'), 240658, 0, 0, 0 },
+
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
+	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 }
+};
+
+void writeScriptTags(const char *name, const int *tags, uint count) {
+	outputFile.seek(dataOffset);
+
+	for (int idx = 0; idx < count * 5; ++idx, ++tags)
+		outputFile.writeLong(*tags);
+	
+	writeEntryHeader(name, dataOffset, count * 5 * 4);
+	dataOffset += count * 5 * 4;
+}
+
+void writeAllScriptTags() {
+	writeScriptTags("Tags/103", &DESKBOT_TAGS[0][0], 129);
+}
\ No newline at end of file
diff --git a/devtools/create_titanic/script_tags.h b/devtools/create_titanic/script_tags.h
new file mode 100644
index 0000000..86cd1e6
--- /dev/null
+++ b/devtools/create_titanic/script_tags.h
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef COMMON_SCRIPT_TAGS_H
+#define COMMON_SCRIPT_TAGS_H
+
+#include "common/scummsys.h"
+
+extern void writeAllScriptTags();
+extern void writeEntryHeader(const char *name, uint offset, uint size);
+extern uint dataOffset;
+
+#endif


Commit: cf0051caf719a5ee510973df31aa3b4e4bddc832
    https://github.com/scummvm/scummvm/commit/cf0051caf719a5ee510973df31aa3b4e4bddc832
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:17:28-04:00

Commit Message:
DEVTOOLS: Completed tags list for Deskbot

Changed paths:
    devtools/create_titanic/script_tags.cpp



diff --git a/devtools/create_titanic/script_tags.cpp b/devtools/create_titanic/script_tags.cpp
index 3ee94ab..e5df5e6 100644
--- a/devtools/create_titanic/script_tags.cpp
+++ b/devtools/create_titanic/script_tags.cpp
@@ -32,7 +32,7 @@
 #include "file.h"
 #include "script_tags.h"
 
-static const int DESKBOT_TAGS[][5] = {
+static const int DESKBOT_TAGS[128][5] = {
 	{ MKTAG('P', 'K', 'U', 'P'), 240573, 0, 0, 0 },
 	{ MKTAG('S', 'E', 'X', '1'), 240573, 0, 0, 0 },
 	{ MKTAG('R', 'E', 'S', '1'), 240354, 0, 0, 0 },
@@ -66,17 +66,6 @@ static const int DESKBOT_TAGS[][5] = {
 	{ MKTAG('F', 'I', 'L', 'M'), 240939, 0, 0, 0 },
 	{ MKTAG('F', 'I', 'S', 'H'), 240437, 0, 0, 0 },
 
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-
 	{ MKTAG('H', 'H', 'G', 'Q'), 241065, 240453, 0, 0 },
 	{ MKTAG('L', 'I', 'Q', 'D'), 241167, 0, 0, 0 },
 	{ MKTAG('P', 'H', 'I', 'L'), 240607, 0, 0, 0 },
@@ -99,81 +88,91 @@ static const int DESKBOT_TAGS[][5] = {
 	{ MKTAG('A', 'N', 'S', 'W'), 240453, 0, 0, 0 },
 	{ MKTAG('A', 'R', 'T', 'Y'), 240658, 0, 0, 0 },
 
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 },
-	{ MKTAG('x', 'x', 'x', 'x'), 0, 0, 0, 0 }
+	{ MKTAG('B', 'A', 'R', 'T'), 240491, 0, 0, 0 },
+	{ MKTAG('B', 'A', 'R', '3'), 240610, 0, 0, 0 },
+	{ MKTAG('B', 'A', 'R', 'K'), 240768, 0, 0, 0 },
+	{ MKTAG('B', 'A', 'R', 'U'), 240768, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '1'), 240940, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '2'), 240591, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '3'), 240775, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '4'), 240558, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '5'), 240336, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '6'), 240759, 240760, 0, 0 },
+
+	{ MKTAG('B', 'E', 'L', '7'), 240726, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'F', '1'), 241652, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'F', '2'), 240939, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'P', '1'), 240654, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'P', '2'), 240654, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'P', '3'), 240654, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'P', '4'), 240655, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'R', '1'), 240654, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'R', '2'), 240655, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'T', '1'), 240718, 0, 0, 0 },
+
+	{ MKTAG('B', 'L', 'T', '2'), 240681, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'T', '3'), 240655, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'T', '4'), 240664, 0, 0, 0 },
+	{ MKTAG('B', 'T', 'T', '5'), 240681, 0, 0, 0 },
+	{ MKTAG('B', 'O', 'D', 'Y'), 240596, 0, 0, 0 },
+	{ MKTAG('B', 'O', 'Y', 'S'), 240654, 0, 0, 0 },
+	{ MKTAG('B', 'R', 'N', 'D'), 240939, 241622, 0, 0 },
+	{ MKTAG('C', 'L', 'U', 'B'), 241675, 240681, 241623, 0 },
+	{ MKTAG('C', 'M', 'N', 'T'), 240849, 0, 0, 0 },
+	{ MKTAG('C', 'R', 'I', 'M'), 241096, 240725, 240729, 0 },
+
+	{ MKTAG('D', 'C', 'T', 'R'), 240725, 0, 0, 0 },
+	{ MKTAG('D', 'O', 'R', '2'), 241405, 241404, 241403, 241402 },
+	{ MKTAG('D', 'B', 'U', 'G'), 240922, 240931, 0, 0 },
+	{ MKTAG('F', 'A', 'M', 'E'), 240726, 0, 0, 0 },
+	{ MKTAG('F', 'A', 'S', 'H'), 241172, 0, 0, 0 },
+	{ MKTAG('F', 'A', 'U', 'N'), 240939, 0, 0, 0 },
+	{ MKTAG('F', 'L', 'O', 'R'), 240825, 0, 0, 0 },
+	{ MKTAG('F', 'U', 'L', 'N'), 240864, 241072, 0, 0 },
+	{ MKTAG('G', 'I', 'R', 'L'), 241144, 0, 0, 0 },
+	{ MKTAG('H', 'B', 'B', 'Y'), 241144, 0, 0, 0 },
+
+	{ MKTAG('H', 'H', 'L', 'D'), 241144, 0, 0, 0 },
+	{ MKTAG('H', 'O', 'M', 'E'), 240844, 240626, 0, 0 },
+	{ MKTAG('I', 'S', 'H', 'E'), 240731, 0, 0, 0 },
+	{ MKTAG('J', 'N', 'A', 'M'), 240785, 240657, 0, 0 },
+	{ MKTAG('J', 'O', 'K', 'E'), 240785, 0, 0, 0 },
+	{ MKTAG('K', 'N', 'O', 'B'), 240657, 0, 0, 0 },
+	{ MKTAG('K', 'P', 'L', 'C'), 240844, 240626, 0, 0 },
+	{ MKTAG('L', 'I', 'F', '3'), 240722, 0, 0, 0 },
+	{ MKTAG('L', 'I', 'T', 'E'), 240785, 0, 0, 0 },
+	{ MKTAG('L', 'I', 'T', 'R'), 241404, 241405, 241403, 241406 },
+
+	{ MKTAG('M', 'A', 'D', '1'), 241124, 240971, 241615, 0 },
+	{ MKTAG('M', 'A', 'D', '4'), 241341, 0, 0, 0 },
+	{ MKTAG('M', 'A', 'D', '6'), 240860, 241114, 0, 0 },
+	{ MKTAG('M', 'A', 'G', 'S'), 241404, 241405, 241403, 241407 },
+	{ MKTAG('M', 'L', 'T', 'Y'), 240718, 240719, 0, 0 },
+	{ MKTAG('N', 'I', 'K', 'E'), 241622, 0, 0, 0 },
+	{ MKTAG('N', 'I', 'K', 'N'), 240785, 0, 0, 0 },
+	{ MKTAG('N', 'P', 'L', 'C'), 240844, 240626, 0, 0 },
+	{ MKTAG('O', 'R', 'D', '1'), 240695, 0, 0, 0 },
+	{ MKTAG('O', 'R', 'D', '2'), 240744, 240650, 0, 0 },
+
+	{ MKTAG('O', 'R', 'D', '3'), 240647, 0, 0, 0 },
+	{ MKTAG('O', 'R', 'D', '4'), 240647, 0, 0, 0 },
+	{ MKTAG('O', 'R', 'D', '5'), 241191, 0, 0, 0 },
+	{ MKTAG('P', 'G', 'R', 'P'), 240725, 0, 0, 0 },
+	{ MKTAG('P', 'L', 'A', 'C'), 240728, 0, 0, 0 },
+	{ MKTAG('R', 'C', 'K', 'T'), 241070, 241161, 0, 0 },
+	{ MKTAG('S', 'F', 'S', 'F'), 241172, 0, 0, 0 },
+	{ MKTAG('S', 'P', 'R', 'T'), 241172, 0, 0, 0 },
+	{ MKTAG('S', 'U', 'C', '1'), 240467, 0, 0, 0 },
+	{ MKTAG('T', 'E', 'A', 'M'), 241172, 0, 0, 0 },
+
+	{ MKTAG('T', 'L', 'A', ' '), 240727, 240658, 0, 0 },
+	{ MKTAG('T', 'O', 'Y', 'S'), 240607, 240606, 0, 0 },
+	{ MKTAG('T', 'R', 'A', '2'), 240611, 0, 0, 0 },
+	{ MKTAG('T', 'R', 'A', '3'), 240611, 0, 0, 0 },
+	{ MKTAG('W', 'E', 'A', 'P'), 240939, 0, 0, 0 },
+	{ MKTAG('W', 'E', 'A', 'T'), 241093, 241094, 241095, 0 },
+	{ MKTAG('W', 'T', 'H', 'R'), 241093, 241094, 241095, 0 },
+	{ MKTAG('W', 'W', 'E', 'B'), 241172, 0, 0, 0 }
 };
 
 void writeScriptTags(const char *name, const int *tags, uint count) {
@@ -187,5 +186,5 @@ void writeScriptTags(const char *name, const int *tags, uint count) {
 }
 
 void writeAllScriptTags() {
-	writeScriptTags("Tags/103", &DESKBOT_TAGS[0][0], 129);
+	writeScriptTags("Tags/103", &DESKBOT_TAGS[0][0], 128);
 }
\ No newline at end of file


Commit: ec33749157a18780b7df13733f23af831d4cb096
    https://github.com/scummvm/scummvm/commit/ec33749157a18780b7df13733f23af831d4cb096
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:17:31-04:00

Commit Message:
DEVTOOLS: Add Bellbot script responses to create_titanic

Changed paths:
  A devtools/create_titanic/script_responses.cpp
  A devtools/create_titanic/script_responses.h
  R devtools/create_titanic/script_tags.cpp
  R devtools/create_titanic/script_tags.h
    devtools/create_titanic/create_titanic_dat.cpp
    devtools/create_titanic/module.mk



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 9b8e8ca..133bad5 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -36,7 +36,7 @@
 #include "common/rect.h"
 #include "winexe_pe.h"
 #include "file.h"
-#include "script_tags.h"
+#include "script_responses.h"
 
 /**
  * Format of the access.dat file that will be created:
@@ -356,7 +356,48 @@ void writeData() {
 	writeAllScriptTags();
 }
 
+// Support method used for translating IDA debugger's output for
+// an NPC's chooseResponse method tag list to a format for inclusion
+// in this tool's script_respones.cpp file
+void createScriptResponses() {
+	Common::File inFile;
+	char line[80];
+	char c[2];
+	c[0] = c[1] = '\0';
+
+	inFile.open("d:\\temp\\bellbot.txt");
+	printf("static const int xxxx_RESPONSES[][5] = {\n");
+
+	do {
+		strcpy(line, "");
+
+		while (!inFile.eof()) {
+			c[0] = inFile.readByte();
+			if (c[0] == '\n')
+				c[0] = ' ';
+			else if (c[0] == '\r')
+				continue;
+			strcat(line, c);
+			if (inFile.eof() || strlen(line) == (5 * 9))
+				break;
+		}
+
+		int tag, v1, v2, v3, v4;
+		sscanf(line, "%x %x %x %x %x", &tag, &v1, &v2, &v3, &v4);
+
+		printf("\t{ MKTAG('%c', '%c', '%c', '%c'), %d, %d, %d, %d },\n",
+			(tag >> 24) & 0xff, (tag >> 16) & 0xff, (tag >> 8) & 0xff, tag & 0xff,
+			v1, v2, v3, v4);
+
+	} while (!inFile.eof());
+
+	printf("};\r\n");
+	inFile.close();
+}
+
 int main(int argc, char *argv[]) {
+	createScriptResponses();
+
 	if (argc != 3) {
 		printf("Format: %s ST.exe titanic.dat\n", argv[0]);
 		exit(0);
diff --git a/devtools/create_titanic/module.mk b/devtools/create_titanic/module.mk
index f74f445..ef5b2a0 100644
--- a/devtools/create_titanic/module.mk
+++ b/devtools/create_titanic/module.mk
@@ -4,7 +4,7 @@ MODULE := devtools/create_titanic
 MODULE_OBJS := \
 	create_titanic_dat.o \
 	hashmap.o \
-	script_tags.o \
+	script_responses.o \
 	str.o \
 	winexe.o \
 	winexe_pe.o
diff --git a/devtools/create_titanic/script_responses.cpp b/devtools/create_titanic/script_responses.cpp
new file mode 100644
index 0000000..aa34239
--- /dev/null
+++ b/devtools/create_titanic/script_responses.cpp
@@ -0,0 +1,323 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+ // Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+// HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
+#include "file.h"
+#include "script_responses.h"
+
+static const int DESKBOT_RESPONSES[128][5] = {
+	{ MKTAG('P', 'K', 'U', 'P'), 240573, 0, 0, 0 },
+	{ MKTAG('S', 'E', 'X', '1'), 240573, 0, 0, 0 },
+	{ MKTAG('R', 'E', 'S', '1'), 240354, 0, 0, 0 },
+	{ MKTAG('R', 'E', 'S', '2'), 240547, 0, 0, 0 },
+	{ MKTAG('S', 'W', 'E', 'R'), 240578, 0, 0, 0 },
+	{ MKTAG('B', 'Y', 'Z', 'A'), 241173, 0, 0, 0 },
+	{ MKTAG('S', 'A', 'S', 'S'), 240986, 0, 0, 0 },
+	{ MKTAG('S', 'H', 'M', 'S'), 240453, 0, 0, 0 },
+	{ MKTAG('F', 'O', 'O', 'D'), 240849, 0, 0, 0 },
+	{ MKTAG('J', 'F', 'O', 'D'), 240849, 0, 0, 0 },
+
+	{ MKTAG('C', 'H', 'S', 'E'), 240849, 0, 0, 0 },
+	{ MKTAG('A', 'C', 'T', 'R'), 240654, 0, 0, 0 },
+	{ MKTAG('A', 'C', 'T', 'S'), 240655, 0, 0, 0 },
+	{ MKTAG('M', 'U', 'S', 'I'), 240681, 240849, 0, 0 },
+	{ MKTAG('S', 'A', 'N', 'G'), 240681, 240657, 0, 0 },
+	{ MKTAG('S', 'O', 'A', 'P'), 240681, 0, 0, 0 },
+	{ MKTAG('T', 'V', 'S', 'H'), 240681, 0, 0, 0 },
+	{ MKTAG('A', 'R', 'T', 'I'), 240657, 0, 0, 0 },
+	{ MKTAG('A', 'U', 'T', 'H'), 240657, 0, 0, 0 },
+	{ MKTAG('C', 'O', 'M', 'D'), 240657, 240785, 0, 0 },
+
+	{ MKTAG('C', 'O', 'O', 'K'), 240657, 0, 0, 0 },
+	{ MKTAG('C', 'O', 'P', 'S'), 240657, 0, 0, 0 },
+	{ MKTAG('H', 'E', 'R', 'O'), 240657, 0, 0, 0 },
+	{ MKTAG('H', 'O', 'S', 'T'), 240657, 0, 0, 0 },
+	{ MKTAG('P', 'T', 'I', 'C'), 240657, 0, 0, 0 },
+	{ MKTAG('S', 'C', 'I', 'T'), 240657, 0, 0, 0 },
+	{ MKTAG('E', 'A', 'R', 'T'), 240728, 0, 0, 0 },
+	{ MKTAG('P', 'L', 'A', 'N'), 240728, 0, 0, 0 },
+	{ MKTAG('F', 'I', 'L', 'M'), 240939, 0, 0, 0 },
+	{ MKTAG('F', 'I', 'S', 'H'), 240437, 0, 0, 0 },
+
+	{ MKTAG('H', 'H', 'G', 'Q'), 241065, 240453, 0, 0 },
+	{ MKTAG('L', 'I', 'Q', 'D'), 241167, 0, 0, 0 },
+	{ MKTAG('P', 'H', 'I', 'L'), 240607, 0, 0, 0 },
+	{ MKTAG('S', 'I', 'C', 'K'), 241170, 0, 0, 0 },
+	{ MKTAG('T', 'W', 'A', 'T'), 240975, 0, 0, 0 },
+	{ MKTAG('H', 'A', 'H', 'A'), 240785, 0, 0, 0 },
+	{ MKTAG('S', 'C', 'I', 'T'), 240968, 241617, 0, 0 },
+	{ MKTAG('S', 'C', 'I', 'E'), 240967, 241616, 0, 0 },
+	{ MKTAG('S', 'L', 'O', 'W'), 241614, 0, 0, 0 },
+	{ MKTAG('T', 'H', 'A', 'T'), 240760,  241615, 0, 0 },
+
+	{ MKTAG('T', 'D', 'U', 'P'), 241161, 241618, 0, 0 },
+	{ MKTAG('T', 'I', 'T', 'A'), 241619, 0, 0, 0 },
+	{ MKTAG('C', 'S', 'P', 'Y'), 241620, 0, 0, 0 },
+	{ MKTAG('M', 'I', 'N', 'S'), 241621, 0, 0, 0 },
+	{ MKTAG('M', 'C', 'P', 'Y'), 241622, 0, 0, 0 },
+	{ MKTAG('D', 'N', 'C', 'E'), 241623, 0, 0, 0 },
+	{ MKTAG('N', 'A', 'U', 'T'), 241624, 0, 0, 0 },
+	{ MKTAG('A', 'D', 'V', 'T'), 240939, 241622, 0, 0 },
+	{ MKTAG('A', 'N', 'S', 'W'), 240453, 0, 0, 0 },
+	{ MKTAG('A', 'R', 'T', 'Y'), 240658, 0, 0, 0 },
+
+	{ MKTAG('B', 'A', 'R', 'T'), 240491, 0, 0, 0 },
+	{ MKTAG('B', 'A', 'R', '3'), 240610, 0, 0, 0 },
+	{ MKTAG('B', 'A', 'R', 'K'), 240768, 0, 0, 0 },
+	{ MKTAG('B', 'A', 'R', 'U'), 240768, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '1'), 240940, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '2'), 240591, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '3'), 240775, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '4'), 240558, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '5'), 240336, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '6'), 240759, 240760, 0, 0 },
+
+	{ MKTAG('B', 'E', 'L', '7'), 240726, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'F', '1'), 241652, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'F', '2'), 240939, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'P', '1'), 240654, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'P', '2'), 240654, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'P', '3'), 240654, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'P', '4'), 240655, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'R', '1'), 240654, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'R', '2'), 240655, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'T', '1'), 240718, 0, 0, 0 },
+
+	{ MKTAG('B', 'L', 'T', '2'), 240681, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'T', '3'), 240655, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'T', '4'), 240664, 0, 0, 0 },
+	{ MKTAG('B', 'T', 'T', '5'), 240681, 0, 0, 0 },
+	{ MKTAG('B', 'O', 'D', 'Y'), 240596, 0, 0, 0 },
+	{ MKTAG('B', 'O', 'Y', 'S'), 240654, 0, 0, 0 },
+	{ MKTAG('B', 'R', 'N', 'D'), 240939, 241622, 0, 0 },
+	{ MKTAG('C', 'L', 'U', 'B'), 241675, 240681, 241623, 0 },
+	{ MKTAG('C', 'M', 'N', 'T'), 240849, 0, 0, 0 },
+	{ MKTAG('C', 'R', 'I', 'M'), 241096, 240725, 240729, 0 },
+
+	{ MKTAG('D', 'C', 'T', 'R'), 240725, 0, 0, 0 },
+	{ MKTAG('D', 'O', 'R', '2'), 241405, 241404, 241403, 241402 },
+	{ MKTAG('D', 'B', 'U', 'G'), 240922, 240931, 0, 0 },
+	{ MKTAG('F', 'A', 'M', 'E'), 240726, 0, 0, 0 },
+	{ MKTAG('F', 'A', 'S', 'H'), 241172, 0, 0, 0 },
+	{ MKTAG('F', 'A', 'U', 'N'), 240939, 0, 0, 0 },
+	{ MKTAG('F', 'L', 'O', 'R'), 240825, 0, 0, 0 },
+	{ MKTAG('F', 'U', 'L', 'N'), 240864, 241072, 0, 0 },
+	{ MKTAG('G', 'I', 'R', 'L'), 241144, 0, 0, 0 },
+	{ MKTAG('H', 'B', 'B', 'Y'), 241144, 0, 0, 0 },
+
+	{ MKTAG('H', 'H', 'L', 'D'), 241144, 0, 0, 0 },
+	{ MKTAG('H', 'O', 'M', 'E'), 240844, 240626, 0, 0 },
+	{ MKTAG('I', 'S', 'H', 'E'), 240731, 0, 0, 0 },
+	{ MKTAG('J', 'N', 'A', 'M'), 240785, 240657, 0, 0 },
+	{ MKTAG('J', 'O', 'K', 'E'), 240785, 0, 0, 0 },
+	{ MKTAG('K', 'N', 'O', 'B'), 240657, 0, 0, 0 },
+	{ MKTAG('K', 'P', 'L', 'C'), 240844, 240626, 0, 0 },
+	{ MKTAG('L', 'I', 'F', '3'), 240722, 0, 0, 0 },
+	{ MKTAG('L', 'I', 'T', 'E'), 240785, 0, 0, 0 },
+	{ MKTAG('L', 'I', 'T', 'R'), 241404, 241405, 241403, 241406 },
+
+	{ MKTAG('M', 'A', 'D', '1'), 241124, 240971, 241615, 0 },
+	{ MKTAG('M', 'A', 'D', '4'), 241341, 0, 0, 0 },
+	{ MKTAG('M', 'A', 'D', '6'), 240860, 241114, 0, 0 },
+	{ MKTAG('M', 'A', 'G', 'S'), 241404, 241405, 241403, 241407 },
+	{ MKTAG('M', 'L', 'T', 'Y'), 240718, 240719, 0, 0 },
+	{ MKTAG('N', 'I', 'K', 'E'), 241622, 0, 0, 0 },
+	{ MKTAG('N', 'I', 'K', 'N'), 240785, 0, 0, 0 },
+	{ MKTAG('N', 'P', 'L', 'C'), 240844, 240626, 0, 0 },
+	{ MKTAG('O', 'R', 'D', '1'), 240695, 0, 0, 0 },
+	{ MKTAG('O', 'R', 'D', '2'), 240744, 240650, 0, 0 },
+
+	{ MKTAG('O', 'R', 'D', '3'), 240647, 0, 0, 0 },
+	{ MKTAG('O', 'R', 'D', '4'), 240647, 0, 0, 0 },
+	{ MKTAG('O', 'R', 'D', '5'), 241191, 0, 0, 0 },
+	{ MKTAG('P', 'G', 'R', 'P'), 240725, 0, 0, 0 },
+	{ MKTAG('P', 'L', 'A', 'C'), 240728, 0, 0, 0 },
+	{ MKTAG('R', 'C', 'K', 'T'), 241070, 241161, 0, 0 },
+	{ MKTAG('S', 'F', 'S', 'F'), 241172, 0, 0, 0 },
+	{ MKTAG('S', 'P', 'R', 'T'), 241172, 0, 0, 0 },
+	{ MKTAG('S', 'U', 'C', '1'), 240467, 0, 0, 0 },
+	{ MKTAG('T', 'E', 'A', 'M'), 241172, 0, 0, 0 },
+
+	{ MKTAG('T', 'L', 'A', ' '), 240727, 240658, 0, 0 },
+	{ MKTAG('T', 'O', 'Y', 'S'), 240607, 240606, 0, 0 },
+	{ MKTAG('T', 'R', 'A', '2'), 240611, 0, 0, 0 },
+	{ MKTAG('T', 'R', 'A', '3'), 240611, 0, 0, 0 },
+	{ MKTAG('W', 'E', 'A', 'P'), 240939, 0, 0, 0 },
+	{ MKTAG('W', 'E', 'A', 'T'), 241093, 241094, 241095, 0 },
+	{ MKTAG('W', 'T', 'H', 'R'), 241093, 241094, 241095, 0 },
+	{ MKTAG('W', 'W', 'E', 'B'), 241172, 0, 0, 0 }
+};
+
+static const int BELLBOT_RESPONSES[130][5] = {
+	{ MKTAG('A', 'C', 'T', 'R'), 200505, 0, 0, 0 },
+	{ MKTAG('A', 'C', 'T', 'S'), 200505, 0, 0, 0 },
+	{ MKTAG('F', 'A', 'M', 'E'), 200532, 200585, 0, 0 },
+	{ MKTAG('A', 'D', 'V', 'T'), 200506, 0, 0, 0 },
+	{ MKTAG('L', 'I', 'Q', 'D'), 200507, 200527, 0, 0 },
+	{ MKTAG('F', 'A', 'U', 'N'), 200511, 0, 0, 0 },
+	{ MKTAG('H', 'B', 'B', 'Y'), 200514, 0, 0, 0 },
+	{ MKTAG('N', 'I', 'K', 'E'), 200514, 0, 0, 0 },
+	{ MKTAG('B', 'R', 'N', 'D'), 200514, 0, 0, 0 },
+	{ MKTAG('P', 'G', 'R', 'P'), 200514, 0, 0, 0 },
+	{ MKTAG('R', 'C', 'K', 'T'), 200514, 0, 0, 0 },
+	{ MKTAG('D', 'R', 'U', 'G'), 200528, 0, 0, 0 },
+	{ MKTAG('F', 'A', 'S', 'H'), 200533, 0, 0, 0 },
+	{ MKTAG('T', 'O', 'Y', 'S'), 200533, 0, 0, 0 },
+	{ MKTAG('F', 'O', 'O', 'D'), 202270, 0, 0, 0 },
+	{ MKTAG('J', 'F', 'O', 'D'), 202270, 0, 0, 0 },
+	{ MKTAG('A', 'R', 'T', 'I'), 200538, 0, 0, 0 },
+	{ MKTAG('A', 'R', 'T', 'Y'), 200538, 0, 0, 0 },
+	{ MKTAG('L', 'I', 'T', 'R'), 200538, 0, 0, 0 },
+	{ MKTAG('C', 'R', 'I', 'M'), 200538, 0, 0, 0 },
+	{ MKTAG('C', 'S', 'P', 'Y'), 200538, 0, 0, 0 },
+	{ MKTAG('W', 'E', 'A', 'T'), 200538, 0, 0, 0 },
+	{ MKTAG('M', 'U', 'S', 'I'), 200539, 0, 0, 0 },
+	{ MKTAG('S', 'O', 'N', 'G'), 200539, 0, 0, 0 },
+	{ MKTAG('F', 'I', 'L', 'M'), 200534, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'F', '1'), 200535, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'F', '2'), 200536, 0, 0, 0 },
+	{ MKTAG('M', 'A', 'G', 'S'), 200542, 0, 0, 0 },
+	{ MKTAG('P', 'H', 'I', 'L'), 200557, 0, 0, 0 },
+	{ MKTAG('P', 'L', 'A', 'N'), 200562, 0, 0, 0 },
+	{ MKTAG('E', 'A', 'R', 'T'), 200562, 202252, 0, 0 },
+	{ MKTAG('P', 'L', 'A', 'C'), 200562, 202252, 0, 0 },
+	{ MKTAG('F', 'L', 'O', 'R'), 200570, 0, 0, 0 },
+	{ MKTAG('P', 'T', 'I', 'C'), 200571, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'P', '1'), 200577, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'P', '2'), 200575, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'P', '3'), 200576, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'P', '4'), 200578, 0, 0, 0 },
+	{ MKTAG('K', 'N', 'O', 'B'), 200579, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'R', '1'), 200580, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'R', '2'), 200581, 0, 0, 0 },
+	{ MKTAG('S', 'E', 'X', '1'), 200582, 0, 0, 0 },
+	{ MKTAG('S', 'P', 'R', 'T'), 200584, 0, 0, 0 },
+	{ MKTAG('T', 'E', 'A', 'M'), 200584, 0, 0, 0 },
+	{ MKTAG('H', 'E', 'R', 'O'), 200585, 0, 0, 0 },
+	{ MKTAG('T', 'W', 'A', 'T'), 200588, 0, 0, 0 },
+	{ MKTAG('S', 'W', 'E', 'R'), 200590, 200336, 0, 0 },
+	{ MKTAG('T', 'R', 'A', '2'), 200594, 0, 0, 0 },
+	{ MKTAG('T', 'R', 'A', '3'), 200594, 0, 0, 0 },
+	{ MKTAG('T', 'V', 'S', 'H'), 200595, 0, 0, 0 },
+	{ MKTAG('S', 'O', 'A', 'P'), 200595, 0, 0, 0 },
+	{ MKTAG('C', 'O', 'M', 'D'), 200595, 0, 0, 0 },
+	{ MKTAG('C', 'O', 'O', 'K'), 200595, 0, 0, 0 },
+	{ MKTAG('C', 'O', 'P', 'S'), 200595, 0, 0, 0 },
+	{ MKTAG('D', 'C', 'T', 'R'), 200595, 0, 0, 0 },
+	{ MKTAG('S', 'F', 'S', 'F'), 200595, 0, 0, 0 },
+	{ MKTAG('H', 'O', 'S', 'T'), 200595, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'T', '1'), 200596, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'T', '2'), 200597, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'T', '3'), 200598, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'T', '4'), 200599, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'T', '5'), 200600, 0, 0, 0 },
+	{ MKTAG('W', 'E', 'A', 'P'), 200601, 0, 0, 0 },
+	{ MKTAG('A', 'U', 'T', 'H'), 200605, 0, 0, 0 },
+	{ MKTAG('H', 'H', 'L', 'D'), 200536, 0, 0, 0 },
+	{ MKTAG('W', 'W', 'E', 'B'), 200608, 0, 0, 0 },
+	{ MKTAG('M', 'L', 'T', 'Y'), 200608, 0, 0, 0 },
+	{ MKTAG('P', 'K', 'U', 'P'), 200067, 0, 0, 0 },
+	{ MKTAG('S', 'U', 'C', '1'), 200067, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '1'), 200684, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '2'), 200887, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '3'), 200610, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '4'), 200015, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '5'), 200043, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '6'), 200333, 0, 0, 0 },
+	{ MKTAG('B', 'E', 'L', '7'), 200884, 0, 0, 0 },
+	{ MKTAG('H', 'H', 'G', 'Q'), 200516, 0, 0, 0 },
+	{ MKTAG('C', 'H', 'A', 'N'), 200961, 0, 0, 0 },
+	{ MKTAG('B', 'Y', 'Z', 'A'), 201271, 0, 0, 0 },
+	{ MKTAG('F', 'I', 'S', 'H'), 201242, 0, 0, 0 },
+	{ MKTAG('S', 'A', 'S', 'S'), 201256, 0, 0, 0 },
+	{ MKTAG('S', 'I', 'C', 'K'), 201704, 0, 0, 0 },
+	{ MKTAG('N', 'H', 'R', 'O'), 201704, 0, 0, 0 },
+	{ MKTAG('S', 'C', 'I', 'E'), 201675, 0, 0, 0 },
+	{ MKTAG('S', 'C', 'I', 'T'), 201676, 0, 0, 0 },
+	{ MKTAG('T', 'D', 'V', 'P'), 200490, 0, 0, 0 },
+	{ MKTAG('H', 'A', 'H', 'A'), 200950, 0, 0, 0 },
+	{ MKTAG('S', 'U', 'C', '1'), 200582, 0, 0, 0 },
+	{ MKTAG('T', 'L', 'A', ' '), 201243, 0, 0, 0 },
+	{ MKTAG('J', 'O', 'K', 'E'), 201244, 0, 0, 0 },
+	{ MKTAG('C', 'H', 'S', 'E'), 202270, 0, 0, 0 },
+	{ MKTAG('C', 'L', 'U', 'B'), 201654, 0, 0, 0 },
+	{ MKTAG('S', 'L', 'O', 'W'), 201877, 0, 0, 0 },
+	{ MKTAG('T', 'H', 'R', 'T'), 201238, 201269, 201982, 200336 },
+	{ MKTAG('A', 'N', 'S', 'W'), 200139, 0, 0, 0 },
+	{ MKTAG('B', 'A', 'R', '1'), 202051, 200473, 200229, 0 },
+	{ MKTAG('B', 'A', 'R', 'K'), 200510, 201326, 0, 0 },
+	{ MKTAG('B', 'A', 'R', 'U'), 200510, 201326, 0, 0 },
+	{ MKTAG('B', 'O', 'D', 'Y'), 201704, 0, 0, 0 },
+	{ MKTAG('C', 'M', 'N', 'T'), 202270, 0, 0, 0 },
+	{ MKTAG('D', 'E', 'S', '2'), 201529, 0, 0, 0 },
+	{ MKTAG('D', 'N', 'C', 'E'), 200952, 200953, 200960, 0 },
+	{ MKTAG('D', 'O', 'R', '2'), 200372, 0, 0, 0 },
+	{ MKTAG('F', 'U', 'L', 'N'), 202035, 202044, 0, 0 },
+	{ MKTAG('H', 'O', 'M', 'E'), 202252, 0, 0, 0 },
+	{ MKTAG('I', 'S', 'H', 'E'), 201609, 0, 0, 0 },
+	{ MKTAG('J', 'N', 'A', 'M'), 202035, 0, 0, 0 },
+	{ MKTAG('L', 'I', 'F', '1'), 201704, 0, 0, 0 },
+	{ MKTAG('L', 'I', 'F', '2'), 201704, 0, 0, 0 },
+	{ MKTAG('L', 'I', 'F', '3'), 201704, 0, 0, 0 },
+	{ MKTAG('M', 'A', 'D', '1'), 201238, 0, 0, 0 },
+	{ MKTAG('M', 'A', 'D', '4'), 200292, 0, 0, 0 },
+	{ MKTAG('M', 'A', 'D', '5'), 200140, 0, 0, 0 },
+	{ MKTAG('M', 'A', 'D', '6'), 200968, 0, 0, 0 },
+	{ MKTAG('M', 'C', 'P', 'Y'), 200514, 0, 0, 0 },
+	{ MKTAG('M', 'I', 'N', 'S'), 200541, 0, 0, 0 },
+	{ MKTAG('N', 'A', 'U', 'T'), 200529, 0, 0, 0 },
+	{ MKTAG('N', 'O', 'N', 'O'), 200127, 0, 0, 0 },
+	{ MKTAG('N', 'P', 'L', 'C'), 200234, 201625, 0, 0 },
+	{ MKTAG('O', 'R', 'D', '1'), 200473, 0, 0, 0 },
+	{ MKTAG('O', 'R', 'D', '2'), 200473, 0, 0, 0 },
+	{ MKTAG('O', 'R', 'D', '3'), 200473, 0, 0, 0 },
+	{ MKTAG('O', 'R', 'D', '4'), 200473, 0, 0, 0 },
+	{ MKTAG('O', 'R', 'D', '5'), 200473, 0, 0, 0 },
+	{ MKTAG('S', 'U', 'C', '2'), 200024, 0, 0, 0 },
+	{ MKTAG('S', 'U', 'M', 'S'), 200139, 0, 0, 0 },
+	{ MKTAG('T', 'I', 'T', 'A'), 200606, 0, 0, 0 },
+	{ MKTAG('W', 'T', 'H', 'R'), 201094, 201097, 201092, 0 },
+	{ MKTAG('Y', 'E', 'S', 'S'), 201525, 201529, 0, 0 },
+};
+
+void writeScriptTags(const char *name, const int *tags, uint count) {
+	outputFile.seek(dataOffset);
+
+	for (int idx = 0; idx < count * 5; ++idx, ++tags)
+		outputFile.writeLong(*tags);
+	
+	writeEntryHeader(name, dataOffset, count * 5 * 4);
+	dataOffset += count * 5 * 4;
+}
+
+void writeAllScriptTags() {
+	writeScriptTags("Responses/Deskbot", &DESKBOT_RESPONSES[0][0], 128);
+	writeScriptTags("Responses/Bellbot", &BELLBOT_RESPONSES[0][0], 130);
+}
\ No newline at end of file
diff --git a/devtools/create_titanic/script_responses.h b/devtools/create_titanic/script_responses.h
new file mode 100644
index 0000000..86cd1e6
--- /dev/null
+++ b/devtools/create_titanic/script_responses.h
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef COMMON_SCRIPT_TAGS_H
+#define COMMON_SCRIPT_TAGS_H
+
+#include "common/scummsys.h"
+
+extern void writeAllScriptTags();
+extern void writeEntryHeader(const char *name, uint offset, uint size);
+extern uint dataOffset;
+
+#endif
diff --git a/devtools/create_titanic/script_tags.cpp b/devtools/create_titanic/script_tags.cpp
deleted file mode 100644
index e5df5e6..0000000
--- a/devtools/create_titanic/script_tags.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
- // Disable symbol overrides so that we can use system headers.
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
-
-// HACK to allow building with the SDL backend on MinGW
-// see bug #1800764 "TOOLS: MinGW tools building broken"
-#ifdef main
-#undef main
-#endif // main
-
-#include "file.h"
-#include "script_tags.h"
-
-static const int DESKBOT_TAGS[128][5] = {
-	{ MKTAG('P', 'K', 'U', 'P'), 240573, 0, 0, 0 },
-	{ MKTAG('S', 'E', 'X', '1'), 240573, 0, 0, 0 },
-	{ MKTAG('R', 'E', 'S', '1'), 240354, 0, 0, 0 },
-	{ MKTAG('R', 'E', 'S', '2'), 240547, 0, 0, 0 },
-	{ MKTAG('S', 'W', 'E', 'R'), 240578, 0, 0, 0 },
-	{ MKTAG('B', 'Y', 'Z', 'A'), 241173, 0, 0, 0 },
-	{ MKTAG('S', 'A', 'S', 'S'), 240986, 0, 0, 0 },
-	{ MKTAG('S', 'H', 'M', 'S'), 240453, 0, 0, 0 },
-	{ MKTAG('F', 'O', 'O', 'D'), 240849, 0, 0, 0 },
-	{ MKTAG('J', 'F', 'O', 'D'), 240849, 0, 0, 0 },
-
-	{ MKTAG('C', 'H', 'S', 'E'), 240849, 0, 0, 0 },
-	{ MKTAG('A', 'C', 'T', 'R'), 240654, 0, 0, 0 },
-	{ MKTAG('A', 'C', 'T', 'S'), 240655, 0, 0, 0 },
-	{ MKTAG('M', 'U', 'S', 'I'), 240681, 240849, 0, 0 },
-	{ MKTAG('S', 'A', 'N', 'G'), 240681, 240657, 0, 0 },
-	{ MKTAG('S', 'O', 'A', 'P'), 240681, 0, 0, 0 },
-	{ MKTAG('T', 'V', 'S', 'H'), 240681, 0, 0, 0 },
-	{ MKTAG('A', 'R', 'T', 'I'), 240657, 0, 0, 0 },
-	{ MKTAG('A', 'U', 'T', 'H'), 240657, 0, 0, 0 },
-	{ MKTAG('C', 'O', 'M', 'D'), 240657, 240785, 0, 0 },
-
-	{ MKTAG('C', 'O', 'O', 'K'), 240657, 0, 0, 0 },
-	{ MKTAG('C', 'O', 'P', 'S'), 240657, 0, 0, 0 },
-	{ MKTAG('H', 'E', 'R', 'O'), 240657, 0, 0, 0 },
-	{ MKTAG('H', 'O', 'S', 'T'), 240657, 0, 0, 0 },
-	{ MKTAG('P', 'T', 'I', 'C'), 240657, 0, 0, 0 },
-	{ MKTAG('S', 'C', 'I', 'T'), 240657, 0, 0, 0 },
-	{ MKTAG('E', 'A', 'R', 'T'), 240728, 0, 0, 0 },
-	{ MKTAG('P', 'L', 'A', 'N'), 240728, 0, 0, 0 },
-	{ MKTAG('F', 'I', 'L', 'M'), 240939, 0, 0, 0 },
-	{ MKTAG('F', 'I', 'S', 'H'), 240437, 0, 0, 0 },
-
-	{ MKTAG('H', 'H', 'G', 'Q'), 241065, 240453, 0, 0 },
-	{ MKTAG('L', 'I', 'Q', 'D'), 241167, 0, 0, 0 },
-	{ MKTAG('P', 'H', 'I', 'L'), 240607, 0, 0, 0 },
-	{ MKTAG('S', 'I', 'C', 'K'), 241170, 0, 0, 0 },
-	{ MKTAG('T', 'W', 'A', 'T'), 240975, 0, 0, 0 },
-	{ MKTAG('H', 'A', 'H', 'A'), 240785, 0, 0, 0 },
-	{ MKTAG('S', 'C', 'I', 'T'), 240968, 241617, 0, 0 },
-	{ MKTAG('S', 'C', 'I', 'E'), 240967, 241616, 0, 0 },
-	{ MKTAG('S', 'L', 'O', 'W'), 241614, 0, 0, 0 },
-	{ MKTAG('T', 'H', 'A', 'T'), 240760,  241615, 0, 0 },
-
-	{ MKTAG('T', 'D', 'U', 'P'), 241161, 241618, 0, 0 },
-	{ MKTAG('T', 'I', 'T', 'A'), 241619, 0, 0, 0 },
-	{ MKTAG('C', 'S', 'P', 'Y'), 241620, 0, 0, 0 },
-	{ MKTAG('M', 'I', 'N', 'S'), 241621, 0, 0, 0 },
-	{ MKTAG('M', 'C', 'P', 'Y'), 241622, 0, 0, 0 },
-	{ MKTAG('D', 'N', 'C', 'E'), 241623, 0, 0, 0 },
-	{ MKTAG('N', 'A', 'U', 'T'), 241624, 0, 0, 0 },
-	{ MKTAG('A', 'D', 'V', 'T'), 240939, 241622, 0, 0 },
-	{ MKTAG('A', 'N', 'S', 'W'), 240453, 0, 0, 0 },
-	{ MKTAG('A', 'R', 'T', 'Y'), 240658, 0, 0, 0 },
-
-	{ MKTAG('B', 'A', 'R', 'T'), 240491, 0, 0, 0 },
-	{ MKTAG('B', 'A', 'R', '3'), 240610, 0, 0, 0 },
-	{ MKTAG('B', 'A', 'R', 'K'), 240768, 0, 0, 0 },
-	{ MKTAG('B', 'A', 'R', 'U'), 240768, 0, 0, 0 },
-	{ MKTAG('B', 'E', 'L', '1'), 240940, 0, 0, 0 },
-	{ MKTAG('B', 'E', 'L', '2'), 240591, 0, 0, 0 },
-	{ MKTAG('B', 'E', 'L', '3'), 240775, 0, 0, 0 },
-	{ MKTAG('B', 'E', 'L', '4'), 240558, 0, 0, 0 },
-	{ MKTAG('B', 'E', 'L', '5'), 240336, 0, 0, 0 },
-	{ MKTAG('B', 'E', 'L', '6'), 240759, 240760, 0, 0 },
-
-	{ MKTAG('B', 'E', 'L', '7'), 240726, 0, 0, 0 },
-	{ MKTAG('B', 'L', 'F', '1'), 241652, 0, 0, 0 },
-	{ MKTAG('B', 'L', 'F', '2'), 240939, 0, 0, 0 },
-	{ MKTAG('B', 'L', 'P', '1'), 240654, 0, 0, 0 },
-	{ MKTAG('B', 'L', 'P', '2'), 240654, 0, 0, 0 },
-	{ MKTAG('B', 'L', 'P', '3'), 240654, 0, 0, 0 },
-	{ MKTAG('B', 'L', 'P', '4'), 240655, 0, 0, 0 },
-	{ MKTAG('B', 'L', 'R', '1'), 240654, 0, 0, 0 },
-	{ MKTAG('B', 'L', 'R', '2'), 240655, 0, 0, 0 },
-	{ MKTAG('B', 'L', 'T', '1'), 240718, 0, 0, 0 },
-
-	{ MKTAG('B', 'L', 'T', '2'), 240681, 0, 0, 0 },
-	{ MKTAG('B', 'L', 'T', '3'), 240655, 0, 0, 0 },
-	{ MKTAG('B', 'L', 'T', '4'), 240664, 0, 0, 0 },
-	{ MKTAG('B', 'T', 'T', '5'), 240681, 0, 0, 0 },
-	{ MKTAG('B', 'O', 'D', 'Y'), 240596, 0, 0, 0 },
-	{ MKTAG('B', 'O', 'Y', 'S'), 240654, 0, 0, 0 },
-	{ MKTAG('B', 'R', 'N', 'D'), 240939, 241622, 0, 0 },
-	{ MKTAG('C', 'L', 'U', 'B'), 241675, 240681, 241623, 0 },
-	{ MKTAG('C', 'M', 'N', 'T'), 240849, 0, 0, 0 },
-	{ MKTAG('C', 'R', 'I', 'M'), 241096, 240725, 240729, 0 },
-
-	{ MKTAG('D', 'C', 'T', 'R'), 240725, 0, 0, 0 },
-	{ MKTAG('D', 'O', 'R', '2'), 241405, 241404, 241403, 241402 },
-	{ MKTAG('D', 'B', 'U', 'G'), 240922, 240931, 0, 0 },
-	{ MKTAG('F', 'A', 'M', 'E'), 240726, 0, 0, 0 },
-	{ MKTAG('F', 'A', 'S', 'H'), 241172, 0, 0, 0 },
-	{ MKTAG('F', 'A', 'U', 'N'), 240939, 0, 0, 0 },
-	{ MKTAG('F', 'L', 'O', 'R'), 240825, 0, 0, 0 },
-	{ MKTAG('F', 'U', 'L', 'N'), 240864, 241072, 0, 0 },
-	{ MKTAG('G', 'I', 'R', 'L'), 241144, 0, 0, 0 },
-	{ MKTAG('H', 'B', 'B', 'Y'), 241144, 0, 0, 0 },
-
-	{ MKTAG('H', 'H', 'L', 'D'), 241144, 0, 0, 0 },
-	{ MKTAG('H', 'O', 'M', 'E'), 240844, 240626, 0, 0 },
-	{ MKTAG('I', 'S', 'H', 'E'), 240731, 0, 0, 0 },
-	{ MKTAG('J', 'N', 'A', 'M'), 240785, 240657, 0, 0 },
-	{ MKTAG('J', 'O', 'K', 'E'), 240785, 0, 0, 0 },
-	{ MKTAG('K', 'N', 'O', 'B'), 240657, 0, 0, 0 },
-	{ MKTAG('K', 'P', 'L', 'C'), 240844, 240626, 0, 0 },
-	{ MKTAG('L', 'I', 'F', '3'), 240722, 0, 0, 0 },
-	{ MKTAG('L', 'I', 'T', 'E'), 240785, 0, 0, 0 },
-	{ MKTAG('L', 'I', 'T', 'R'), 241404, 241405, 241403, 241406 },
-
-	{ MKTAG('M', 'A', 'D', '1'), 241124, 240971, 241615, 0 },
-	{ MKTAG('M', 'A', 'D', '4'), 241341, 0, 0, 0 },
-	{ MKTAG('M', 'A', 'D', '6'), 240860, 241114, 0, 0 },
-	{ MKTAG('M', 'A', 'G', 'S'), 241404, 241405, 241403, 241407 },
-	{ MKTAG('M', 'L', 'T', 'Y'), 240718, 240719, 0, 0 },
-	{ MKTAG('N', 'I', 'K', 'E'), 241622, 0, 0, 0 },
-	{ MKTAG('N', 'I', 'K', 'N'), 240785, 0, 0, 0 },
-	{ MKTAG('N', 'P', 'L', 'C'), 240844, 240626, 0, 0 },
-	{ MKTAG('O', 'R', 'D', '1'), 240695, 0, 0, 0 },
-	{ MKTAG('O', 'R', 'D', '2'), 240744, 240650, 0, 0 },
-
-	{ MKTAG('O', 'R', 'D', '3'), 240647, 0, 0, 0 },
-	{ MKTAG('O', 'R', 'D', '4'), 240647, 0, 0, 0 },
-	{ MKTAG('O', 'R', 'D', '5'), 241191, 0, 0, 0 },
-	{ MKTAG('P', 'G', 'R', 'P'), 240725, 0, 0, 0 },
-	{ MKTAG('P', 'L', 'A', 'C'), 240728, 0, 0, 0 },
-	{ MKTAG('R', 'C', 'K', 'T'), 241070, 241161, 0, 0 },
-	{ MKTAG('S', 'F', 'S', 'F'), 241172, 0, 0, 0 },
-	{ MKTAG('S', 'P', 'R', 'T'), 241172, 0, 0, 0 },
-	{ MKTAG('S', 'U', 'C', '1'), 240467, 0, 0, 0 },
-	{ MKTAG('T', 'E', 'A', 'M'), 241172, 0, 0, 0 },
-
-	{ MKTAG('T', 'L', 'A', ' '), 240727, 240658, 0, 0 },
-	{ MKTAG('T', 'O', 'Y', 'S'), 240607, 240606, 0, 0 },
-	{ MKTAG('T', 'R', 'A', '2'), 240611, 0, 0, 0 },
-	{ MKTAG('T', 'R', 'A', '3'), 240611, 0, 0, 0 },
-	{ MKTAG('W', 'E', 'A', 'P'), 240939, 0, 0, 0 },
-	{ MKTAG('W', 'E', 'A', 'T'), 241093, 241094, 241095, 0 },
-	{ MKTAG('W', 'T', 'H', 'R'), 241093, 241094, 241095, 0 },
-	{ MKTAG('W', 'W', 'E', 'B'), 241172, 0, 0, 0 }
-};
-
-void writeScriptTags(const char *name, const int *tags, uint count) {
-	outputFile.seek(dataOffset);
-
-	for (int idx = 0; idx < count * 5; ++idx, ++tags)
-		outputFile.writeLong(*tags);
-	
-	writeEntryHeader(name, dataOffset, count * 5 * 4);
-	dataOffset += count * 5 * 4;
-}
-
-void writeAllScriptTags() {
-	writeScriptTags("Tags/103", &DESKBOT_TAGS[0][0], 128);
-}
\ No newline at end of file
diff --git a/devtools/create_titanic/script_tags.h b/devtools/create_titanic/script_tags.h
deleted file mode 100644
index 86cd1e6..0000000
--- a/devtools/create_titanic/script_tags.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef COMMON_SCRIPT_TAGS_H
-#define COMMON_SCRIPT_TAGS_H
-
-#include "common/scummsys.h"
-
-extern void writeAllScriptTags();
-extern void writeEntryHeader(const char *name, uint offset, uint size);
-extern uint dataOffset;
-
-#endif


Commit: f51a428f8b32323a4328d69dff7c5afd48630224
    https://github.com/scummvm/scummvm/commit/f51a428f8b32323a4328d69dff7c5afd48630224
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:17:50-04:00

Commit Message:
DEVTOOLS: Fixes to Deskbot responses in create_titanic

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp
    devtools/create_titanic/script_responses.cpp
    devtools/create_titanic/script_responses.h



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 133bad5..11b963c 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -353,7 +353,7 @@ void writeData() {
 	writeStringArray("TEXT/PRONOUNS", 0x22F718, 15);
 
 	writeNumbers();
-	writeAllScriptTags();
+	writeAllScriptResponses();
 }
 
 // Support method used for translating IDA debugger's output for
@@ -365,7 +365,7 @@ void createScriptResponses() {
 	char c[2];
 	c[0] = c[1] = '\0';
 
-	inFile.open("d:\\temp\\bellbot.txt");
+	inFile.open("d:\\temp\\deskbot.txt");
 	printf("static const int xxxx_RESPONSES[][5] = {\n");
 
 	do {
@@ -396,8 +396,6 @@ void createScriptResponses() {
 }
 
 int main(int argc, char *argv[]) {
-	createScriptResponses();
-
 	if (argc != 3) {
 		printf("Format: %s ST.exe titanic.dat\n", argv[0]);
 		exit(0);
diff --git a/devtools/create_titanic/script_responses.cpp b/devtools/create_titanic/script_responses.cpp
index aa34239..1c43eb0 100644
--- a/devtools/create_titanic/script_responses.cpp
+++ b/devtools/create_titanic/script_responses.cpp
@@ -35,26 +35,24 @@
 static const int DESKBOT_RESPONSES[128][5] = {
 	{ MKTAG('P', 'K', 'U', 'P'), 240573, 0, 0, 0 },
 	{ MKTAG('S', 'E', 'X', '1'), 240573, 0, 0, 0 },
-	{ MKTAG('R', 'E', 'S', '1'), 240354, 0, 0, 0 },
-	{ MKTAG('R', 'E', 'S', '2'), 240547, 0, 0, 0 },
+	{ MKTAG('D', 'E', 'S', '1'), 240354, 0, 0, 0 },
+	{ MKTAG('D', 'E', 'S', '2'), 240547, 0, 0, 0 },
 	{ MKTAG('S', 'W', 'E', 'R'), 240578, 0, 0, 0 },
 	{ MKTAG('B', 'Y', 'Z', 'A'), 241173, 0, 0, 0 },
 	{ MKTAG('S', 'A', 'S', 'S'), 240986, 0, 0, 0 },
-	{ MKTAG('S', 'H', 'M', 'S'), 240453, 0, 0, 0 },
+	{ MKTAG('S', 'U', 'M', 'S'), 240453, 0, 0, 0 },
 	{ MKTAG('F', 'O', 'O', 'D'), 240849, 0, 0, 0 },
 	{ MKTAG('J', 'F', 'O', 'D'), 240849, 0, 0, 0 },
-
 	{ MKTAG('C', 'H', 'S', 'E'), 240849, 0, 0, 0 },
 	{ MKTAG('A', 'C', 'T', 'R'), 240654, 0, 0, 0 },
 	{ MKTAG('A', 'C', 'T', 'S'), 240655, 0, 0, 0 },
-	{ MKTAG('M', 'U', 'S', 'I'), 240681, 240849, 0, 0 },
-	{ MKTAG('S', 'A', 'N', 'G'), 240681, 240657, 0, 0 },
+	{ MKTAG('M', 'U', 'S', 'I'), 240681, 241621, 0, 0 },
+	{ MKTAG('S', 'O', 'N', 'G'), 240681, 241621, 0, 0 },
 	{ MKTAG('S', 'O', 'A', 'P'), 240681, 0, 0, 0 },
 	{ MKTAG('T', 'V', 'S', 'H'), 240681, 0, 0, 0 },
 	{ MKTAG('A', 'R', 'T', 'I'), 240657, 0, 0, 0 },
 	{ MKTAG('A', 'U', 'T', 'H'), 240657, 0, 0, 0 },
 	{ MKTAG('C', 'O', 'M', 'D'), 240657, 240785, 0, 0 },
-
 	{ MKTAG('C', 'O', 'O', 'K'), 240657, 0, 0, 0 },
 	{ MKTAG('C', 'O', 'P', 'S'), 240657, 0, 0, 0 },
 	{ MKTAG('H', 'E', 'R', 'O'), 240657, 0, 0, 0 },
@@ -65,7 +63,6 @@ static const int DESKBOT_RESPONSES[128][5] = {
 	{ MKTAG('P', 'L', 'A', 'N'), 240728, 0, 0, 0 },
 	{ MKTAG('F', 'I', 'L', 'M'), 240939, 0, 0, 0 },
 	{ MKTAG('F', 'I', 'S', 'H'), 240437, 0, 0, 0 },
-
 	{ MKTAG('H', 'H', 'G', 'Q'), 241065, 240453, 0, 0 },
 	{ MKTAG('L', 'I', 'Q', 'D'), 241167, 0, 0, 0 },
 	{ MKTAG('P', 'H', 'I', 'L'), 240607, 0, 0, 0 },
@@ -75,9 +72,8 @@ static const int DESKBOT_RESPONSES[128][5] = {
 	{ MKTAG('S', 'C', 'I', 'T'), 240968, 241617, 0, 0 },
 	{ MKTAG('S', 'C', 'I', 'E'), 240967, 241616, 0, 0 },
 	{ MKTAG('S', 'L', 'O', 'W'), 241614, 0, 0, 0 },
-	{ MKTAG('T', 'H', 'A', 'T'), 240760,  241615, 0, 0 },
-
-	{ MKTAG('T', 'D', 'U', 'P'), 241161, 241618, 0, 0 },
+	{ MKTAG('T', 'H', 'R', 'T'), 240760, 241615, 0, 0 },
+	{ MKTAG('T', 'D', 'V', 'P'), 241161, 241618, 0, 0 },
 	{ MKTAG('T', 'I', 'T', 'A'), 241619, 0, 0, 0 },
 	{ MKTAG('C', 'S', 'P', 'Y'), 241620, 0, 0, 0 },
 	{ MKTAG('M', 'I', 'N', 'S'), 241621, 0, 0, 0 },
@@ -87,8 +83,7 @@ static const int DESKBOT_RESPONSES[128][5] = {
 	{ MKTAG('A', 'D', 'V', 'T'), 240939, 241622, 0, 0 },
 	{ MKTAG('A', 'N', 'S', 'W'), 240453, 0, 0, 0 },
 	{ MKTAG('A', 'R', 'T', 'Y'), 240658, 0, 0, 0 },
-
-	{ MKTAG('B', 'A', 'R', 'T'), 240491, 0, 0, 0 },
+	{ MKTAG('B', 'A', 'R', '1'), 240491, 0, 0, 0 },
 	{ MKTAG('B', 'A', 'R', '3'), 240610, 0, 0, 0 },
 	{ MKTAG('B', 'A', 'R', 'K'), 240768, 0, 0, 0 },
 	{ MKTAG('B', 'A', 'R', 'U'), 240768, 0, 0, 0 },
@@ -98,7 +93,6 @@ static const int DESKBOT_RESPONSES[128][5] = {
 	{ MKTAG('B', 'E', 'L', '4'), 240558, 0, 0, 0 },
 	{ MKTAG('B', 'E', 'L', '5'), 240336, 0, 0, 0 },
 	{ MKTAG('B', 'E', 'L', '6'), 240759, 240760, 0, 0 },
-
 	{ MKTAG('B', 'E', 'L', '7'), 240726, 0, 0, 0 },
 	{ MKTAG('B', 'L', 'F', '1'), 241652, 0, 0, 0 },
 	{ MKTAG('B', 'L', 'F', '2'), 240939, 0, 0, 0 },
@@ -109,40 +103,36 @@ static const int DESKBOT_RESPONSES[128][5] = {
 	{ MKTAG('B', 'L', 'R', '1'), 240654, 0, 0, 0 },
 	{ MKTAG('B', 'L', 'R', '2'), 240655, 0, 0, 0 },
 	{ MKTAG('B', 'L', 'T', '1'), 240718, 0, 0, 0 },
-
 	{ MKTAG('B', 'L', 'T', '2'), 240681, 0, 0, 0 },
 	{ MKTAG('B', 'L', 'T', '3'), 240655, 0, 0, 0 },
 	{ MKTAG('B', 'L', 'T', '4'), 240664, 0, 0, 0 },
-	{ MKTAG('B', 'T', 'T', '5'), 240681, 0, 0, 0 },
+	{ MKTAG('B', 'L', 'T', '5'), 240681, 0, 0, 0 },
 	{ MKTAG('B', 'O', 'D', 'Y'), 240596, 0, 0, 0 },
 	{ MKTAG('B', 'O', 'Y', 'S'), 240654, 0, 0, 0 },
 	{ MKTAG('B', 'R', 'N', 'D'), 240939, 241622, 0, 0 },
 	{ MKTAG('C', 'L', 'U', 'B'), 241675, 240681, 241623, 0 },
 	{ MKTAG('C', 'M', 'N', 'T'), 240849, 0, 0, 0 },
 	{ MKTAG('C', 'R', 'I', 'M'), 241096, 240725, 240729, 0 },
-
-	{ MKTAG('D', 'C', 'T', 'R'), 240725, 0, 0, 0 },
+	{ MKTAG('D', 'C', 'T', 'R'), 240681, 0, 0, 0 },
 	{ MKTAG('D', 'O', 'R', '2'), 241405, 241404, 241403, 241402 },
-	{ MKTAG('D', 'B', 'U', 'G'), 240922, 240931, 0, 0 },
+	{ MKTAG('D', 'R', 'U', 'G'), 240922, 240931, 0, 0 },
 	{ MKTAG('F', 'A', 'M', 'E'), 240726, 0, 0, 0 },
 	{ MKTAG('F', 'A', 'S', 'H'), 241172, 0, 0, 0 },
 	{ MKTAG('F', 'A', 'U', 'N'), 240939, 0, 0, 0 },
 	{ MKTAG('F', 'L', 'O', 'R'), 240825, 0, 0, 0 },
 	{ MKTAG('F', 'U', 'L', 'N'), 240864, 241072, 0, 0 },
-	{ MKTAG('G', 'I', 'R', 'L'), 241144, 0, 0, 0 },
+	{ MKTAG('G', 'I', 'R', 'L'), 240655, 0, 0, 0 },
 	{ MKTAG('H', 'B', 'B', 'Y'), 241144, 0, 0, 0 },
-
 	{ MKTAG('H', 'H', 'L', 'D'), 241144, 0, 0, 0 },
 	{ MKTAG('H', 'O', 'M', 'E'), 240844, 240626, 0, 0 },
 	{ MKTAG('I', 'S', 'H', 'E'), 240731, 0, 0, 0 },
-	{ MKTAG('J', 'N', 'A', 'M'), 240785, 240657, 0, 0 },
+	{ MKTAG('J', 'N', 'A', 'M'), 240785, 0, 0, 0 },
 	{ MKTAG('J', 'O', 'K', 'E'), 240785, 0, 0, 0 },
 	{ MKTAG('K', 'N', 'O', 'B'), 240657, 0, 0, 0 },
 	{ MKTAG('K', 'P', 'L', 'C'), 240844, 240626, 0, 0 },
 	{ MKTAG('L', 'I', 'F', '3'), 240722, 0, 0, 0 },
 	{ MKTAG('L', 'I', 'T', 'E'), 240785, 0, 0, 0 },
 	{ MKTAG('L', 'I', 'T', 'R'), 241404, 241405, 241403, 241406 },
-
 	{ MKTAG('M', 'A', 'D', '1'), 241124, 240971, 241615, 0 },
 	{ MKTAG('M', 'A', 'D', '4'), 241341, 0, 0, 0 },
 	{ MKTAG('M', 'A', 'D', '6'), 240860, 241114, 0, 0 },
@@ -153,18 +143,16 @@ static const int DESKBOT_RESPONSES[128][5] = {
 	{ MKTAG('N', 'P', 'L', 'C'), 240844, 240626, 0, 0 },
 	{ MKTAG('O', 'R', 'D', '1'), 240695, 0, 0, 0 },
 	{ MKTAG('O', 'R', 'D', '2'), 240744, 240650, 0, 0 },
-
 	{ MKTAG('O', 'R', 'D', '3'), 240647, 0, 0, 0 },
 	{ MKTAG('O', 'R', 'D', '4'), 240647, 0, 0, 0 },
 	{ MKTAG('O', 'R', 'D', '5'), 241191, 0, 0, 0 },
-	{ MKTAG('P', 'G', 'R', 'P'), 240725, 0, 0, 0 },
+	{ MKTAG('P', 'G', 'R', 'P'), 240681, 0, 0, 0 },
 	{ MKTAG('P', 'L', 'A', 'C'), 240728, 0, 0, 0 },
 	{ MKTAG('R', 'C', 'K', 'T'), 241070, 241161, 0, 0 },
 	{ MKTAG('S', 'F', 'S', 'F'), 241172, 0, 0, 0 },
 	{ MKTAG('S', 'P', 'R', 'T'), 241172, 0, 0, 0 },
 	{ MKTAG('S', 'U', 'C', '1'), 240467, 0, 0, 0 },
 	{ MKTAG('T', 'E', 'A', 'M'), 241172, 0, 0, 0 },
-
 	{ MKTAG('T', 'L', 'A', ' '), 240727, 240658, 0, 0 },
 	{ MKTAG('T', 'O', 'Y', 'S'), 240607, 240606, 0, 0 },
 	{ MKTAG('T', 'R', 'A', '2'), 240611, 0, 0, 0 },
@@ -307,7 +295,7 @@ static const int BELLBOT_RESPONSES[130][5] = {
 	{ MKTAG('Y', 'E', 'S', 'S'), 201525, 201529, 0, 0 },
 };
 
-void writeScriptTags(const char *name, const int *tags, uint count) {
+void writeScriptResponses(const char *name, const int *tags, uint count) {
 	outputFile.seek(dataOffset);
 
 	for (int idx = 0; idx < count * 5; ++idx, ++tags)
@@ -317,7 +305,7 @@ void writeScriptTags(const char *name, const int *tags, uint count) {
 	dataOffset += count * 5 * 4;
 }
 
-void writeAllScriptTags() {
-	writeScriptTags("Responses/Deskbot", &DESKBOT_RESPONSES[0][0], 128);
-	writeScriptTags("Responses/Bellbot", &BELLBOT_RESPONSES[0][0], 130);
+void writeAllScriptResponses() {
+	writeScriptResponses("Responses/Deskbot", &DESKBOT_RESPONSES[0][0], 128);
+	writeScriptResponses("Responses/Bellbot", &BELLBOT_RESPONSES[0][0], 130);
 }
\ No newline at end of file
diff --git a/devtools/create_titanic/script_responses.h b/devtools/create_titanic/script_responses.h
index 86cd1e6..ca927e0 100644
--- a/devtools/create_titanic/script_responses.h
+++ b/devtools/create_titanic/script_responses.h
@@ -25,7 +25,7 @@
 
 #include "common/scummsys.h"
 
-extern void writeAllScriptTags();
+extern void writeAllScriptResponses();
 extern void writeEntryHeader(const char *name, uint offset, uint size);
 extern uint dataOffset;
 


Commit: ba5e13d479f3c8615e8c0984c58e86421499f1b3
    https://github.com/scummvm/scummvm/commit/ba5e13d479f3c8615e8c0984c58e86421499f1b3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:18:31-04:00

Commit Message:
TITANIC: Set up loading of deskbot & bellbot script response lists

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp
    devtools/create_titanic/script_responses.cpp
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 11b963c..4999ee3 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -50,7 +50,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x300
+#define HEADER_SIZE 0x340
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
diff --git a/devtools/create_titanic/script_responses.cpp b/devtools/create_titanic/script_responses.cpp
index 1c43eb0..30d0c7f 100644
--- a/devtools/create_titanic/script_responses.cpp
+++ b/devtools/create_titanic/script_responses.cpp
@@ -295,17 +295,335 @@ static const int BELLBOT_RESPONSES[130][5] = {
 	{ MKTAG('Y', 'E', 'S', 'S'), 201525, 201529, 0, 0 },
 };
 
-void writeScriptResponses(const char *name, const int *tags, uint count) {
+const int BARBOT_RESPONSES[93][2] = {
+	{ MKTAG('S', 'L', 'O', 'W'), 0x3D09E },
+	{ MKTAG('T', 'H', 'R', 'T'), 0x3D0B1 },
+	{ MKTAG('A', 'C', 'T', 'R'), 0x3D77F },
+	{ MKTAG('A', 'C', 'T', 'S'), 0x3D780 },
+	{ MKTAG('A', 'D', 'V', 'T'), 0x3D781 },
+	{ MKTAG('A', 'R', 'T', 'I'), 0x3D782 },
+	{ MKTAG('A', 'R', 'T', 'Y'), 0x3D783 },
+	{ MKTAG('A', 'U', 'T', 'H'), 0x3D784 },
+	{ MKTAG('B', 'A', 'R', 'K'), 0x3D786 },
+	{ MKTAG('B', 'A', 'R', 'U'), 0x3D786 },
+	{ MKTAG('B', 'O', 'Y', 'S'), 0x3D239 },
+	{ MKTAG('G', 'I', 'R', 'L'), 0x3D23A },
+	{ MKTAG('B', 'R', 'N', 'D'), 0x3D787 },
+	{ MKTAG('C', 'H', 'S', 'E'), 0x3D788 },
+	{ MKTAG('C', 'O', 'M', 'D'), 0x3D789 },
+	{ MKTAG('C', 'O', 'O', 'K'), 0x3D78A },
+	{ MKTAG('C', 'O', 'P', 'S'), 0x3D78B },
+	{ MKTAG('C', 'R', 'I', 'M'), 0x3D78C },
+	{ MKTAG('C', 'S', 'P', 'Y'), 0x3D78D },
+	{ MKTAG('D', 'C', 'T', 'R'), 0x3D78E },
+	{ MKTAG('D', 'N', 'C', 'E'), 0x3D78F },
+	{ MKTAG('D', 'R', 'U', 'G'), 0x3D790 },
+	{ MKTAG('E', 'A', 'R', 'T'), 0x3D791 },
+	{ MKTAG('E', 'M', 'O', 'T'), 0x3D792 },
+	{ MKTAG('F', 'A', 'M', 'E'), 0x3D793 },
+	{ MKTAG('A', 'S', 'H', '1'), 0x3D794 },
+	{ MKTAG('A', 'S', 'H', '2'), 0x3D795 },
+	{ MKTAG('F', 'A', 'U', 'N'), 0x3D796 },
+	{ MKTAG('F', 'I', 'L', 'M'), 0x3D797 },
+	{ MKTAG('F', 'I', 'S', 'H'), 0x3D798 },
+	{ MKTAG('F', 'L', 'O', 'R'), 0x3D799 },
+	{ MKTAG('F', 'O', 'O', 'D'), 0x3D79A },
+	{ MKTAG('J', 'F', 'O', 'D'), 0x3D79A },
+	{ MKTAG('H', 'B', 'B', 'Y'), 0x3D79B },
+	{ MKTAG('H', 'E', 'R', 'O'), 0x3D79C },
+	{ MKTAG('H', 'H', 'L', 'D'), 0x3D79D },
+	{ MKTAG('H', 'O', 'M', 'E'), 0x3D79E },
+	{ MKTAG('H', 'O', 'S', 'T'), 0x3D79F },
+	{ MKTAG('K', 'N', 'O', 'B'), 0x3D7A0 },
+	{ MKTAG('L', 'I', 'Q', 'D'), 0x3D7A1 },
+	{ MKTAG('L', 'I', 'T', 'R'), 0x3D7A2 },
+	{ MKTAG('M', 'A', 'G', 'S'), 0x3D7A3 },
+	{ MKTAG('M', 'C', 'P', 'Y'), 0x3D7A4 },
+	{ MKTAG('M', 'I', 'N', 'S'), 0x3D7A5 },
+	{ MKTAG('M', 'L', 'T', 'Y'), 0x3D7A6 },
+	{ MKTAG('M', 'U', 'S', 'I'), 0x3D7A7 },
+	{ MKTAG('N', 'A', 'U', 'T'), 0x3D7A8 },
+	{ MKTAG('P', 'G', 'R', 'P'), 0x3D7A9 },
+	{ MKTAG('P', 'H', 'I', 'L'), 0x3D7AA },
+	{ MKTAG('P', 'K', 'U', 'P'), 0x3D7AB },
+	{ MKTAG('P', 'L', 'A', 'N'), 0x3D7AC },
+	{ MKTAG('B', 'L', 'P', '1'), 0x3D7AD },
+	{ MKTAG('B', 'L', 'P', '2'), 0x3D7AD },
+	{ MKTAG('P', 'T', 'I', 'C'), 0x3D7AD },
+	{ MKTAG('R', 'C', 'K', 'T'), 0x3D7AE },
+	{ MKTAG('S', 'C', 'I', 'E'), 0x3D7AF },
+	{ MKTAG('S', 'C', 'I', 'T'), 0x3D7B0 },
+	{ MKTAG('S', 'E', 'X', '1'), 0x3D7B1 },
+	{ MKTAG('S', 'F', 'S', 'F'), 0x3D7B2 },
+	{ MKTAG('S', 'O', 'A', 'P'), 0x3D7B4 },
+	{ MKTAG('S', 'O', 'N', 'G'), 0x3D7B5 },
+	{ MKTAG('S', 'P', 'R', 'T'), 0x3D7B6 },
+	{ MKTAG('S', 'W', 'E', 'R'), 0x3D7B7 },
+	{ MKTAG('T', 'D', 'V', 'P'), 0x3D7BC },
+	{ MKTAG('T', 'E', 'A', 'M'), 0x3D7BD },
+	{ MKTAG('T', 'I', 'T', 'A'), 0x3D7BF },
+	{ MKTAG('T', 'L', 'A', ' '), 0x3D7C0 },
+	{ MKTAG('T', 'O', 'Y', 'S'), 0x3D7C1 },
+	{ MKTAG('T', 'R', 'A', '2'), 0x3D7C2 },
+	{ MKTAG('T', 'R', 'A', '3'), 0x3D7C3 },
+	{ MKTAG('T', 'V', 'S', 'H'), 0x3D7C4 },
+	{ MKTAG('W', 'E', 'A', 'P'), 0x3D7C5 },
+	{ MKTAG('W', 'E', 'A', 'T'), 0x3D7C6 },
+	{ MKTAG('W', 'W', 'E', 'B'), 0x3D7C7 },
+	{ MKTAG('I', 'S', 'H', 'E'), 0x3D221 },
+	{ MKTAG('L', 'I', 'T', 'E'), 0x3D31B },
+	{ MKTAG('B', 'Y', 'Z', 'A'), 0x3D448 },
+	{ MKTAG('W', 'T', 'H', 'R'), 0x3D6E5 },
+	{ MKTAG('N', 'P', 'L', 'C'), 0x3D231 },
+	{ MKTAG('B', 'A', 'R', '1'), 0x3D095 },
+	{ MKTAG('B', 'A', 'R', '2'), 0x3D107 },
+	{ MKTAG('B', 'A', 'R', '3'), 0x3D09D },
+	{ MKTAG('M', 'P', 'O', 'P'), 0x3D0D3 },
+	{ MKTAG('J', 'O', 'K', 'E'), 0x3D5A9 },
+	{ MKTAG('J', 'N', 'A', 'M'), 0x3D5A9 },
+	{ MKTAG('N', 'I', 'B', '1'), 0x3D128 },
+	{ MKTAG('N', 'I', 'B', '2'), 0x3D0DC },
+	{ MKTAG('N', 'I', 'B', '3'), 0x3D345 },
+	{ MKTAG('N', 'I', 'B', '4'), 0x3D125 },
+	{ MKTAG('N', 'I', 'B', '5'), 0x3D369 },
+	{ MKTAG('N', 'I', 'B', '6'), 0x3D444 },
+	{ MKTAG('B', 'A', 'R', '4'), 0x3D0DF },
+	{ MKTAG('F', 'U', 'L', 'N'), 0x3D32C }
+};
+
+const int DOORBOT_RESPONSES[101][2] = {
+	{ MKTAG('W', 'E', 'A', 'T'), 0x2E29 },
+	{ MKTAG('T', 'W', 'A', 'T'), 0x2E29 },
+	{ MKTAG('B', 'A', 'R', 'M'), 0x2E29 },
+	{ MKTAG('B', 'A', 'R', 'U'), 0x2E29 },
+	{ MKTAG('B', 'A', 'R', 'K'), 0x2E29 },
+	{ MKTAG('B', 'Y', 'Z', 'A'), 0x274E },
+	{ MKTAG('S', 'I', 'C', 'K'), 0x28AC },
+	{ MKTAG('B', 'O', 'D', 'Y'), 0x28AC },
+	{ MKTAG('N', 'H', 'R', 'O'), 0x28A8 },
+	{ MKTAG('N', 'P', 'L', 'C'), 0x28A7 },
+	{ MKTAG('H', 'O', 'M', 'E'), 0x28A7 },
+	{ MKTAG('S', 'C', 'I', 'E'), 0x28A9 },
+	{ MKTAG('P', 'T', 'I', 'C'), 0x2E42 },
+	{ MKTAG('P', 'G', 'R', 'P'), 0x2E42 },
+	{ MKTAG('B', 'L', 'P', '1'), 0x2E42 },
+	{ MKTAG('B', 'L', 'P', '2'), 0x2E42 },
+	{ MKTAG('B', 'L', 'P', '3'), 0x2E42 },
+	{ MKTAG('B', 'L', 'P', '4'), 0x2E42 },
+	{ MKTAG('B', 'L', 'F', '1'), 0x2E3C },
+	{ MKTAG('B', 'L', 'F', '2'), 0x2E3C },
+	{ MKTAG('B', 'L', 'R', '1'), 0x2E42 },
+	{ MKTAG('B', 'L', 'T', '1'), 0x2E56 },
+	{ MKTAG('B', 'L', 'T', '2'), 0x2E48 },
+	{ MKTAG('B', 'L', 'T', '3'), 0x2E55 },
+	{ MKTAG('B', 'L', 'T', '4'), 0x2E56 },
+	{ MKTAG('B', 'L', 'T', '5'), 0x2E56 },
+	{ MKTAG('S', 'W', 'E', 'R'), 0x2E4E },
+	{ MKTAG('S', 'O', 'N', 'G'), 0x2E49 },
+	{ MKTAG('L', 'I', 'T', 'R'), 0x2E40 },
+	{ MKTAG('A', 'R', 'T', 'I'), 0x2E1F },
+	{ MKTAG('N', 'I', 'K', 'E'), 0x2E22 },
+	{ MKTAG('E', 'M', 'O', 'T'), 0x2E38 },
+	{ MKTAG('D', 'R', 'U', 'G'), 0x2E36 },
+	{ MKTAG('E', 'A', 'R', 'T'), 0x2E37 },
+	{ MKTAG('F', 'A', 'M', 'E'), 0x2E39 },
+	{ MKTAG('F', 'A', 'U', 'N'), 0x2E3B },
+	{ MKTAG('F', 'I', 'S', 'H'), 0x2E3B },
+	{ MKTAG('F', 'L', 'O', 'R'), 0x2E3D },
+	{ MKTAG('F', 'O', 'O', 'D'), 0x2E3E },
+	{ MKTAG('J', 'F', 'O', 'D'), 0x2E3E },
+	{ MKTAG('H', 'B', 'B', 'Y'), 0x2E3F },
+	{ MKTAG('H', 'E', 'R', 'O'), 0x2E4D },
+	{ MKTAG('H', 'O', 'S', 'T'), 0x2E55 },
+	{ MKTAG('L', 'I', 'Q', 'D'), 0x2E35 },
+	{ MKTAG('M', 'A', 'G', 'S'), 0x2E40 },
+	{ MKTAG('P', 'H', 'I', 'L'), 0x2E44 },
+	{ MKTAG('P', 'K', 'U', 'P'), 0x2E24 },
+	{ MKTAG('P', 'L', 'A', 'N'), 0x2E45 },
+	{ MKTAG('R', 'C', 'K', 'T'), 0x2E4A },
+	{ MKTAG('S', 'E', 'X', '1'), 0x2E47 },
+	{ MKTAG('S', 'U', 'C', '1'), 0x2E47 },
+	{ MKTAG('S', 'O', 'A', 'P'), 0x2E48 },
+	{ MKTAG('T', 'O', 'Y', 'S'), 0x2E50 },
+	{ MKTAG('H', 'H', 'L', 'D'), 0x2E50 },
+	{ MKTAG('A', 'C', 'T', 'R'), 0x2E1B },
+	{ MKTAG('A', 'C', 'T', 'S'), 0x2E1C },
+	{ MKTAG('A', 'D', 'V', 'T'), 0x2E1D },
+	{ MKTAG('B', 'R', 'N', 'D'), 0x2E21 },
+	{ MKTAG('B', 'R', 'N', '2'), 0x2E22 },
+	{ MKTAG('B', 'R', 'N', '3'), 0x2E23 },
+	{ MKTAG('F', 'A', 'S', 'H'), 0x2E3A },
+	{ MKTAG('F', 'I', 'L', 'M'), 0x2E3C },
+	{ MKTAG('K', 'N', 'O', 'B'), 0x2E42 },
+	{ MKTAG('M', 'U', 'S', 'I'), 0x2E43 },
+	{ MKTAG('S', 'F', 'S', 'F'), 0x2E46 },
+	{ MKTAG('S', 'P', 'R', 'T'), 0x2E4B },
+	{ MKTAG('T', 'E', 'A', 'M'), 0x2E4C },
+	{ MKTAG('T', 'R', 'A', 'V'), 0x2E52 },
+	{ MKTAG('T', 'V', 'S', 'H'), 0x2E56 },
+	{ MKTAG('W', 'E', 'A', 'P'), 0x2E57 },
+	{ MKTAG('W', 'W', 'E', 'B'), 0x2E58 },
+	{ MKTAG('A', 'R', 'T', 'Y'), 0x2E1E },
+	{ MKTAG('C', 'O', 'M', 'D'), 0x2E25 },
+	{ MKTAG('C', 'O', 'O', 'K'), 0x2E26 },
+	{ MKTAG('C', 'O', 'P', 'S'), 0x2E27 },
+	{ MKTAG('C', 'R', 'I', 'M'), 0x2E28 },
+	{ MKTAG('D', 'C', 'T', 'R'), 0x2E29 },
+	{ MKTAG('A', 'U', 'T', 'H'), 0x2E29 },
+	{ MKTAG('M', 'L', 'T', 'Y'), 0x2E41 },
+	{ MKTAG('S', 'A', 'S', 'S'), 0x28C3 },
+	{ MKTAG('B', 'O', 'Y', 'S'), 0x2768 },
+	{ MKTAG('G', 'I', 'R', 'L'), 0x2769 },
+	{ MKTAG('T', 'D', 'V', 'P'), 0x277D },
+	{ MKTAG('I', 'S', 'H', 'E'), 0x27B6 },
+	{ MKTAG('J', 'O', 'K', 'E'), 0x29FF },
+	{ MKTAG('J', 'N', 'A', 'M'), 0x29FF },
+	{ MKTAG('S', 'L', 'O', 'W'), 0x2823 },
+	{ MKTAG('T', 'H', 'R', 'T'), 0x2823 },
+	{ MKTAG('D', 'O', 'R', '2'), 0x2BC0 },
+	{ MKTAG('M', 'P', 'O', 'P'), 0x2BC0 },
+	{ MKTAG('C', 'L', 'U', 'B'), 0x2E39 },
+	{ MKTAG('C', 'O', 'L', 'R'), 0x2776 },
+	{ MKTAG('D', 'N', 'C', 'E'), 0x2931 },
+	{ MKTAG('M', 'C', 'P', 'Y'), 0x276B },
+	{ MKTAG('M', 'I', 'N', 'S'), 0x2E43 },
+	{ MKTAG('P', 'L', 'A', 'C'), 0x2E37 },
+	{ MKTAG('T', 'I', 'T', 'A'), 0x2E40 },
+	{ MKTAG('T', 'L', 'A', ' '), 0x277D },
+	{ MKTAG('H', 'A', 'H', 'A'), 0x27A8 },
+	{ MKTAG('F', 'U', 'L', 'N'), 0x2B15 },
+	{ MKTAG('B', 'A', 'R', '1'), 0x2E35 }
+};
+
+const int LIFTBOT_RESPONSES[34][2] = {
+	{ MKTAG('L', 'I', 'F', '1'), 0x33453 },
+	{ MKTAG('L', 'I', 'F', '2'), 0x3345D },
+	{ MKTAG('L', 'I', 'F', '3'), 0x3354E },
+	{ MKTAG('L', 'I', 'F', '4'), 0x3374B },
+	{ MKTAG('I', 'S', 'H', 'E'), 0x335F7 },
+	{ MKTAG('J', 'O', 'K', 'E'), 0x3374B },
+	{ MKTAG('J', 'N', 'A', 'M'), 0x3374B },
+	{ MKTAG('S', 'L', 'O', 'W'), 0x337B5 },
+	{ MKTAG('T', 'H', 'R', 'T'), 0x337BB },
+	{ MKTAG('S', 'C', 'I', 'E'), 0x337B2 },
+	{ MKTAG('S', 'C', 'I', 'T'), 0x337B4 },
+	{ MKTAG('T', 'D', 'V', 'P'), 0x337BA },
+	{ MKTAG('T', 'I', 'T', 'A'), 0x337C0 },
+	{ MKTAG('C', 'S', 'P', 'Y'), 0x337A5 },
+	{ MKTAG('M', 'U', 'S', 'I'), 0x337AA },
+	{ MKTAG('M', 'C', 'P', 'Y'), 0x337A9 },
+	{ MKTAG('D', 'N', 'C', 'E'), 0x337A7 },
+	{ MKTAG('N', 'A', 'U', 'T'), 0x337AC },
+	{ MKTAG('T', 'L', 'A', ' '), 0x337C1 },
+	{ MKTAG('S', 'U', 'M', 'S'), 0x33598 },
+	{ MKTAG('O', 'R', 'D', '1'), 0x33776 },
+	{ MKTAG('O', 'R', 'D', '2'), 0x33779 },
+	{ MKTAG('O', 'R', 'D', '3'), 0x3377A },
+	{ MKTAG('O', 'R', 'D', '4'), 0x3377B },
+	{ MKTAG('O', 'R', 'D', '5'), 0x3377C },
+	{ MKTAG('O', 'R', 'D', '6'), 0x3377D },
+	{ MKTAG('O', 'R', 'D', '7'), 0x3377E },
+	{ MKTAG('L', 'I', 'Q', 'D'), 0x337FC },
+	{ MKTAG('F', 'O', 'O', 'D'), 0x337FD },
+	{ MKTAG('J', 'F', 'O', 'D'), 0x337FD },
+	{ MKTAG('W', 'E', 'A', 'T'), 0x337E3 },
+	{ MKTAG('S', 'I', 'C', 'K'), 0x336A1 },
+	{ MKTAG('B', 'O', 'D', 'Y'), 0x33624 },
+	{ MKTAG('B', 'Y', 'Z', 'A'), 0x33617 }
+};
+
+const int MAITRED_RESPONSES[74][2] = {
+	{ MKTAG('M', 'A', 'D', '1'), 0x3F7E2 },
+	{ MKTAG('M', 'A', 'D', '2'), 0x3F916 },
+	{ MKTAG('M', 'A', 'D', '3'), 0x3F931 },
+	{ MKTAG('M', 'A', 'D', '4'), 0x3F936 },
+	{ MKTAG('M', 'A', 'D', '5'), 0x3F938 },
+	{ MKTAG('M', 'A', 'D', '6'), 0x3F943 },
+	{ MKTAG('M', 'A', 'D', '7'), 0x3F947 },
+	{ MKTAG('M', 'A', 'D', '8'), 0x3F945 },
+	{ MKTAG('M', 'A', 'D', '9'), 0x3F946 },
+	{ MKTAG('M', 'D', '1', '0'), 0x3F9F5 },
+	{ MKTAG('M', 'D', '1', '1'), 0x3F982 },
+	{ MKTAG('J', 'F', 'O', 'D'), 0x3F930 },
+	{ MKTAG('C', 'M', 'N', 'T'), 0x3F937 },
+	{ MKTAG('H', 'A', 'H', 'A'), 0x3FA47 },
+	{ MKTAG('S', 'U', 'M', 'S'), 0x3F9FE },
+	{ MKTAG('A', 'N', 'S', 'W'), 0x3F90B },
+	{ MKTAG('M', 'U', 'S', 'I'), 0x3FA35 },
+	{ MKTAG('S', 'O', 'N', 'G'), 0x3FA35 },
+	{ MKTAG('A', 'C', 'T', 'R'), 0x3F9B6 },
+	{ MKTAG('A', 'C', 'T', 'S'), 0x3F9B7 },
+	{ MKTAG('A', 'R', 'T', 'I'), 0x3F9CE },
+	{ MKTAG('A', 'R', 'T', 'Y'), 0x3F9CE },
+	{ MKTAG('A', 'U', 'T', 'H'), 0x3FAB6 },
+	{ MKTAG('C', 'O', 'M', 'D'), 0x3F963 },
+	{ MKTAG('C', 'O', 'P', 'S'), 0x3F9F8 },
+	{ MKTAG('C', 'R', 'I', 'M'), 0x3F9F8 },
+	{ MKTAG('C', 'S', 'P', 'Y'), 0x3F965 },
+	{ MKTAG('D', 'C', 'T', 'R'), 0x3F9B6 },
+	{ MKTAG('D', 'R', 'U', 'G'), 0x3F96F },
+	{ MKTAG('E', 'A', 'R', 'T'), 0x3F9E3 },
+	{ MKTAG('E', 'M', 'O', 'T'), 0x3FA29 },
+	{ MKTAG('F', 'A', 'M', 'E'), 0x3FAB6 },
+	{ MKTAG('F', 'A', 'S', 'H'), 0x3F8EA },
+	{ MKTAG('F', 'A', 'U', 'N'), 0x3F969 },
+	{ MKTAG('F', 'I', 'L', 'M'), 0x3F9CE },
+	{ MKTAG('F', 'L', 'O', 'R'), 0x3F9A3 },
+	{ MKTAG('H', 'B', 'B', 'Y'), 0x3F987 },
+	{ MKTAG('H', 'E', 'R', 'O'), 0x3F8DA },
+	{ MKTAG('H', 'H', 'G', 'Q'), 0x3F96B },
+	{ MKTAG('H', 'H', 'L', 'D'), 0x3FA2B },
+	{ MKTAG('H', 'O', 'S', 'T'), 0x3F9E1 },
+	{ MKTAG('K', 'N', 'O', 'B'), 0x3F9E1 },
+	{ MKTAG('L', 'I', 'Q', 'D'), 0x3F91C },
+	{ MKTAG('L', 'I', 'T', 'R'), 0x3F9CE },
+	{ MKTAG('M', 'A', 'G', 'S'), 0x3F912 },
+	{ MKTAG('M', 'L', 'T', 'Y'), 0x3F9F7 },
+	{ MKTAG('P', 'G', 'R', 'P'), 0x3F8D0 },
+	{ MKTAG('P', 'H', 'I', 'L'), 0x3F8E9 },
+	{ MKTAG('P', 'K', 'U', 'P'), 0x3F9FB },
+	{ MKTAG('P', 'L', 'A', 'C'), 0x3FA22 },
+	{ MKTAG('P', 'T', 'I', 'C'), 0x3F8D0 },
+	{ MKTAG('R', 'C', 'K', 'T'), 0x3F9A3 },
+	{ MKTAG('S', 'C', 'I', 'E'), 0x3F968 },
+	{ MKTAG('S', 'C', 'I', 'T'), 0x3F9E2 },
+	{ MKTAG('S', 'E', 'X', '1'), 0x3F9C9 },
+	{ MKTAG('S', 'F', 'S', 'F'), 0x3F988 },
+	{ MKTAG('S', 'O', 'A', 'P'), 0x3FA3C },
+	{ MKTAG('S', 'P', 'R', 'T'), 0x3FAB6 },
+	{ MKTAG('S', 'W', 'E', 'R'), 0x3F96B },
+	{ MKTAG('T', 'E', 'A', 'M'), 0x3F9B8 },
+	{ MKTAG('T', 'O', 'Y', 'S'), 0x3F96D },
+	{ MKTAG('T', 'V', 'S', 'H'), 0x3F9CE },
+	{ MKTAG('W', 'E', 'A', 'P'), 0x3F9D8 },
+	{ MKTAG('W', 'W', 'E', 'B'), 0x3F987 },
+	{ MKTAG('B', 'Y', 'Z', 'A'), 0x3F9A5 },
+	{ MKTAG('T', 'W', 'A', 'T'), 0x3F96F },
+	{ MKTAG('M', 'C', 'P', 'Y'), 0x3F9B9 },
+	{ MKTAG('T', 'H', 'R', 'T'), 0x3FB15 },
+	{ MKTAG('T', 'D', 'V', 'P'), 0x3FB17 },
+	{ MKTAG('T', 'I', 'T', 'A'), 0x3FB18 },
+	{ MKTAG('M', 'I', 'N', 'S'), 0x3FB19 },
+	{ MKTAG('D', 'N', 'C', 'E'), 0x3FB1A },
+	{ MKTAG('N', 'A', 'U', 'T'), 0x3FB1B },
+	{ MKTAG('T', 'L', 'A', ' '), 0x3FB1C }
+};
+
+void writeScriptResponses(const char *name, const int *tags, uint count, int valuesPerTag) {
 	outputFile.seek(dataOffset);
 
-	for (int idx = 0; idx < count * 5; ++idx, ++tags)
+	for (int idx = 0; idx < count * (valuesPerTag + 1); ++idx, ++tags)
 		outputFile.writeLong(*tags);
 	
-	writeEntryHeader(name, dataOffset, count * 5 * 4);
-	dataOffset += count * 5 * 4;
+	writeEntryHeader(name, dataOffset, count * (valuesPerTag + 1) * 4);
+	dataOffset += count * (valuesPerTag + 1) * 4;
 }
 
 void writeAllScriptResponses() {
-	writeScriptResponses("Responses/Deskbot", &DESKBOT_RESPONSES[0][0], 128);
-	writeScriptResponses("Responses/Bellbot", &BELLBOT_RESPONSES[0][0], 130);
+	writeScriptResponses("Responses/Barbot", &BARBOT_RESPONSES[0][0], 93, 1);
+	writeScriptResponses("Responses/Bellbot", &BELLBOT_RESPONSES[0][0], 130, 4);
+	writeScriptResponses("Responses/Deskbot", &DESKBOT_RESPONSES[0][0], 128, 4);
+	writeScriptResponses("Responses/Doorbot", &DOORBOT_RESPONSES[0][0], 101, 1);
+	writeScriptResponses("Responses/Liftbot", &LIFTBOT_RESPONSES[0][0], 34, 1);
+	writeScriptResponses("Responses/MaitreD", &MAITRED_RESPONSES[0][0], 74, 1);
 }
\ No newline at end of file
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 2bb3a18..2c82949 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -25,9 +25,9 @@
 
 namespace Titanic {
 
-int BarbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
+int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
-	return 2;
+	return SS_2;
 }
 
 void BarbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index a55c12b..4568187 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -33,7 +33,11 @@ public:
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
-	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
+	/**
+	 * Chooses and adds a conversation response based on a specified tag Id.
+	 */
+	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 794e671..0e11aea 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -38,11 +38,8 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	randomizeFlags();
 	_array[0] = 100;
 	_array[1] = 0;
-}
 
-int BellbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
-	warning("TODO");
-	return 2;
+	load("Responses/Bellbot");
 }
 
 void BellbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index d7fbab3..86e9165 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -38,7 +38,6 @@ public:
 	BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
 
-	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index dbe2664..319175f 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -39,23 +39,8 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 	_array[0] = 100;
 	if (_field74 == 1)
 		_field74 = 0;
-}
-
-int DeskbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
-	for (uint idx = 0; idx < _tags.size(); ++idx) {
-		const TTnpcScriptTag &scriptTag = _tags[idx];		
-		uint currTag = (idx == 0) ? MKTAG('P', 'K', 'U', 'P') : scriptTag._tag;
-
-		if (currTag == tag) {
-			int valIndex = getRandomNumber(scriptTag.size()) - 1;
-			uint diagId = getDialogueId(scriptTag._values[valIndex]);
-			addResponse(diagId);
-			applyResponse();
-			break;
-		}
-	}
 
-	return SS_1;
+	load("Responses/Deskbot");
 }
 
 void DeskbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index f2de881..3dda552 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -29,13 +29,10 @@
 namespace Titanic {
 
 class DeskbotScript : public TTnpcScript {
-private:
-	Common::Array<TTnpcScriptTag> _tags;
 public:
 	DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
 
-	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 9d35f69..d1638ee 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -25,9 +25,9 @@
 
 namespace Titanic {
 
-int DoorbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
+int DoorbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
-	return 2;
+	return SS_2;
 }
 
 void DoorbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 82897b7..3158ef0 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -35,7 +35,11 @@ public:
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
-	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
+	/**
+	 * Chooses and adds a conversation response based on a specified tag Id.
+	 */
+	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index b1577b3..b627df6 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -25,9 +25,9 @@
 
 namespace Titanic {
 
-int LiftbotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
+int LiftbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
-	return 2;
+	return SS_2;
 }
 
 void LiftbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 8c2ae32..9e7d72f 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -33,7 +33,11 @@ public:
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
-	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
+	/**
+	 * Chooses and adds a conversation response based on a specified tag Id.
+	 */
+	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
 	virtual void proc7(int v1, int v2);
 	virtual int proc9() const;
 	virtual int proc10() const;
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 5581c6b..717dbca 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -39,9 +39,9 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
 	CTrueTalkManager::setFlags(16, 0);
 }
 
-int MaitreDScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
+int MaitreDScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
-	return 2;
+	return SS_2;
 }
 
 void MaitreDScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 14505ca..d638dee 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -32,7 +32,11 @@ public:
 	MaitreDScript(int val1, const char *charClass, int v2,
 			const char *charName, int v3, int val2);
 
-	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
+	/**
+	 * Chooses and adds a conversation response based on a specified tag Id.
+	 */
+	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual bool proc16() const;
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index a6b37bf..6e90bbc 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -25,9 +25,9 @@
 
 namespace Titanic {
 
-int ParrotScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
+int ParrotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
-	return 2;
+	return SS_2;
 }
 
 void ParrotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index 0add5d9..abf8042 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -33,7 +33,11 @@ public:
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
 
-	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
+	/**
+	 * Chooses and adds a conversation response based on a specified tag Id.
+	 */
+	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual bool proc17() const;
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index b689aba..f5db6eb 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -89,7 +89,7 @@ int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScrip
 	if (result) {
 		sentence->set34(result);
 		if (roomScript->proc6(npcScript, sentence, result)) {
-			canProcess = npcScript->proc6(roomScript, sentence, result);
+			canProcess = npcScript->chooseResponse(roomScript, sentence, result);
 		}
 	}
 
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 436b779..60e3abb 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -25,9 +25,9 @@
 
 namespace Titanic {
 
-int SuccUBusScript::proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag) {
+int SuccUBusScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
-	return 2;
+	return SS_2;
 }
 
 void SuccUBusScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 8a078c2..4324999 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -36,7 +36,11 @@ public:
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
 		_field2D0(0) {}
 
-	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, uint tag);
+	/**
+	 * Chooses and adds a conversation response based on a specified tag Id.
+	 */
+	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual bool proc17() const;
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index bbd75a4..59212cb 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -27,7 +27,7 @@
 
 namespace Titanic {
 
-int TTnpcScriptTag::size() const {
+int TTnpcScriptResponse::size() const {
 	for (int idx = 0; idx < 4; ++idx) {
 		if (_values[idx] == 0)
 			return idx;
@@ -63,6 +63,21 @@ TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 	resetFlags();
 }
 
+void TTnpcScript::load(const char *name) {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+
+	while (r->pos() < r->size()) {
+		TTnpcScriptResponse sr;
+		sr._tag = r->readUint32LE();
+		for (int idx = 0; idx < 4; ++idx)
+			sr._values[idx] = r->readUint32LE();
+		
+		_responses.push_back(sr);
+	}
+
+	delete r;
+}
+
 void TTnpcScript::resetFlags() {
 	Common::fill(&_array[20], &_array[140], 0);
 	_field2CC = false;
@@ -76,6 +91,22 @@ void TTnpcScript::proc4(int v) {
 	warning("TODO");
 }
 
+int TTnpcScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
+	for (uint idx = 0; idx < _responses.size(); ++idx) {
+		const TTnpcScriptResponse &response = _responses[idx];
+
+		if (response._tag == tag) {
+			int valIndex = getRandomNumber(response.size()) - 1;
+			uint diagId = getDialogueId(response._values[valIndex]);
+			addResponse(diagId);
+			applyResponse();
+			return 2;
+		}
+	}
+
+	return 1;
+}
+
 void TTnpcScript::proc7(int v1, int v2) {
 	warning("TODO");
 }
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index d52da2e..407b364 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -31,7 +31,7 @@ namespace Titanic {
 class TTroomScript;
 class TTsentence;
 
-struct TTnpcScriptTag {
+struct TTnpcScriptResponse {
 	uint _tag;
 	uint _values[4];
 
@@ -52,7 +52,11 @@ public:
 		const char *charName, int v3, int val2, int v4,
 		int v5, int v6, int v7);
 
-	virtual int proc6(TTroomScript *roomScript, TTsentence *sentence, int val) const = 0;
+	/**
+	 * Chooses and adds a conversation response based on a specified tag Id.
+	 */
+	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) = 0;
+
 	virtual void proc7(int v1, int v2) = 0;
 	virtual int proc8() const = 0;
 	virtual int proc9() const = 0;
@@ -70,6 +74,8 @@ public:
 
 class TTnpcScript : public TTnpcScriptBase {
 private:
+	Common::Array<TTnpcScriptResponse> _responses;
+private:
 	int translateByArray(int id);
 protected:
 	byte *_subPtr;
@@ -85,6 +91,14 @@ protected:
 	int _array[146];
 	bool _field2CC;
 protected:
+	/**
+	 * Loads response data for the NPC from the given resource
+	 */
+	void load(const char *name);
+
+	/**
+	 * Reset script flags
+	 */
 	void resetFlags();
 
 	void randomizeFlags();
@@ -111,7 +125,14 @@ public:
 		int v5, int v6, int v7);
 
 	virtual void proc4(int v);
-	virtual int proc6(TTroomScript *roomScript, TTsentence *sentence, int val) const { return 1; }
+
+	/**
+	 * Chooses and adds a conversation response based on a specified tag Id.
+	 * This default implementation does a lookup into a list of known tags,
+	 * and chooses a random dialogue Id from the available ones for that tag
+	 */
+	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+
 	virtual void proc7(int v1, int v2);
 	virtual int proc8() const;
 	virtual int proc9() const;


Commit: 451ab9d452e4003c6b0304d4c4609cf442fb3f81
    https://github.com/scummvm/scummvm/commit/451ab9d452e4003c6b0304d4c4609cf442fb3f81
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:18:45-04:00

Commit Message:
TITANIC: Load response data for remaining NPC scripts

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 2c82949..d47d2b5 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -25,6 +25,12 @@
 
 namespace Titanic {
 
+BarbotScript::BarbotScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
+	load("Responses/Barbot");
+}
+
 int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
 	return SS_2;
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 4568187..9f38604 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -30,8 +30,7 @@ namespace Titanic {
 class BarbotScript : public TTnpcScript {
 public:
 	BarbotScript(int val1, const char *charClass, int v2,
-		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
 
 	/**
 	 * Chooses and adds a conversation response based on a specified tag Id.
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 0e11aea..7954b7f 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -39,7 +39,7 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	_array[0] = 100;
 	_array[1] = 0;
 
-	load("Responses/Bellbot");
+	load("Responses/Bellbot", 4);
 }
 
 void BellbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 319175f..fe4de23 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -40,7 +40,7 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 	if (_field74 == 1)
 		_field74 = 0;
 
-	load("Responses/Deskbot");
+	load("Responses/Deskbot", 4);
 }
 
 void DeskbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index d1638ee..9c8c686 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -25,6 +25,12 @@
 
 namespace Titanic {
 
+DoorbotScript::DoorbotScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
+	load("Responses/Doorbot");
+}
+
 int DoorbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
 	return SS_2;
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 3158ef0..d00e5b1 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -32,8 +32,7 @@ private:
 	int _array[148];
 public:
 	DoorbotScript(int val1, const char *charClass, int v2,
-		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
 
 	/**
 	 * Chooses and adds a conversation response based on a specified tag Id.
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index b627df6..90b8f10 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -25,6 +25,13 @@
 
 namespace Titanic {
 
+LiftbotScript::LiftbotScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
+	load("Responses/Liftbot");
+}
+
+
 int LiftbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
 	warning("TODO");
 	return SS_2;
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 9e7d72f..0279392 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -30,8 +30,7 @@ namespace Titanic {
 class LiftbotScript : public TTnpcScript {
 public:
 	LiftbotScript(int val1, const char *charClass, int v2,
-		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
 
 	/**
 	 * Chooses and adds a conversation response based on a specified tag Id.
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 717dbca..10c115d 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -27,8 +27,8 @@
 namespace Titanic {
 
 MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
-	const char *charName, int v3, int val2) :
-	TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
+		const char *charName, int v3, int val2) :
+		TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
 	CTrueTalkManager::setFlags(9, 1);
 	CTrueTalkManager::setFlags(10, 0);
 	CTrueTalkManager::setFlags(11, 0);
@@ -37,6 +37,8 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
 	CTrueTalkManager::setFlags(14, 0);
 	CTrueTalkManager::setFlags(15, 0);
 	CTrueTalkManager::setFlags(16, 0);
+
+	load("Responses/MaitreD");
 }
 
 int MaitreDScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 59212cb..2c8b8ba 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -63,13 +63,13 @@ TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 	resetFlags();
 }
 
-void TTnpcScript::load(const char *name) {
+void TTnpcScript::load(const char *name, int valuesPerTag) {
 	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
 
 	while (r->pos() < r->size()) {
 		TTnpcScriptResponse sr;
 		sr._tag = r->readUint32LE();
-		for (int idx = 0; idx < 4; ++idx)
+		for (int idx = 0; idx < valuesPerTag; ++idx)
 			sr._values[idx] = r->readUint32LE();
 		
 		_responses.push_back(sr);
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 407b364..3822b52 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -74,10 +74,9 @@ public:
 
 class TTnpcScript : public TTnpcScriptBase {
 private:
-	Common::Array<TTnpcScriptResponse> _responses;
-private:
 	int translateByArray(int id);
 protected:
+	Common::Array<TTnpcScriptResponse> _responses;
 	byte *_subPtr;
 	int _field60;
 	int _field64;
@@ -94,7 +93,7 @@ protected:
 	/**
 	 * Loads response data for the NPC from the given resource
 	 */
-	void load(const char *name);
+	void load(const char *name, int valuesPerTag = 1);
 
 	/**
 	 * Reset script flags


Commit: 58c8833d82cc9f7c19cd9424cacce8a71c555108
    https://github.com/scummvm/scummvm/commit/58c8833d82cc9f7c19cd9424cacce8a71c555108
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:18:47-04:00

Commit Message:
TITANIC: Implementing npc scripts chooseResponse methods

Changed paths:
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/tt_script_base.h



diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 90b8f10..dd6203d 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -25,16 +25,44 @@
 
 namespace Titanic {
 
+static const int STATE_ARRAY[7] = {
+	0x78BE, 0x78C0, 0x78C1, 0x78C2, 0x78C3, 0x78C4, 0x78C5
+};
+
 LiftbotScript::LiftbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
+	_state = 0;
 	load("Responses/Liftbot");
 }
 
-
 int LiftbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
-	warning("TODO");
-	return SS_2;
+	switch (tag) {
+	case MKTAG('D', 'N', 'A', '1'):
+	case MKTAG('H', 'H', 'G', 'Q'):
+	case MKTAG('A', 'N', 'S', 'W'):
+		if (_state >= 7) {
+			proc14(30918);
+			set34(2);
+			_state = 0;
+		} else {
+			addResponse(STATE_ARRAY[_state++]);
+		}
+
+		applyResponse();
+		return 2;
+
+	case MKTAG('O', 'R', 'D', '8'):
+		addResponse(30475);
+		addResponse(30467);
+		addResponse(30466);
+		addResponse(30474);
+		applyResponse();
+		return SS_2;
+
+	default:
+		return TTnpcScript::chooseResponse(roomScript, sentence, tag);
+	}
 }
 
 void LiftbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 0279392..04454c8 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -28,6 +28,8 @@
 namespace Titanic {
 
 class LiftbotScript : public TTnpcScript {
+private:
+	int _state;
 public:
 	LiftbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 10c115d..ed9cc5b 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -42,8 +42,15 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
 }
 
 int MaitreDScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
-	warning("TODO");
-	return SS_2;
+	if (tag == MKTAG('F', 'O', 'O', 'D') || tag == MKTAG('F', 'I', 'S', 'H') ||
+			tag == MKTAG('C', 'H', 'S', 'E')) {
+		addResponse(getDialogueId(260388));
+		addResponse(getDialogueId(260659));
+		applyResponse();
+		return 2;
+	}
+
+	return TTnpcScript::chooseResponse(roomScript, sentence, tag);
 }
 
 void MaitreDScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index 6e90bbc..3e195a0 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -26,8 +26,13 @@
 namespace Titanic {
 
 int ParrotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
-	warning("TODO");
-	return SS_2;
+	if (tag == MKTAG('B', 'Y', 'Z', 'A')) {
+		addResponse(getDialogueId(280246));
+		applyResponse();
+		return 2;
+	} else {
+		return 1;
+	}
 }
 
 void ParrotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 60e3abb..c09cadd 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -26,8 +26,36 @@
 namespace Titanic {
 
 int SuccUBusScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
-	warning("TODO");
-	return SS_2;
+	uint dialogueId = tag;
+
+	switch (tag) {
+	case MKTAG('S', 'L', 'O', 'W'):
+	case MKTAG('T', 'H', 'R', 'T'):
+		dialogueId = 70021;
+
+	case MKTAG('S', 'U', 'C', '1'):
+		dialogueId = getDialogueId(230009);
+		break;
+
+	case MKTAG('S', 'U', 'C', '2'):
+		dialogueId = 70117;
+		break;
+
+	case MKTAG('S', 'W', 'E', 'R'):
+		dialogueId = getRandomNumber(100) > 40 ? 70103 : getDialogueId(230030);
+		break;
+
+	default:
+		break;
+	}
+
+	if (dialogueId) {
+		addResponse(dialogueId);
+		applyResponse();
+		return 2;
+	} else {
+		return 1;
+	}
 }
 
 void SuccUBusScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index 8387d24..cdaf8c7 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -71,6 +71,8 @@ protected:
 	void appendResponse2(int val1, int *val2, const TTstring &str) {
 		appendResponse(val1, val2, str);
 	}
+
+	void set34(int val) { _field34 = val; }
 public:
 	int _id;
 public:


Commit: 01020dcd8ca0ab8d930a9c2f1452e50cc2721ed5
    https://github.com/scummvm/scummvm/commit/01020dcd8ca0ab8d930a9c2f1452e50cc2721ed5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:18:49-04:00

Commit Message:
TITANIC: Renaming script methods

Changed paths:
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_room_script.cpp
    engines/titanic/true_talk/tt_room_script.h



diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index f5db6eb..5e31a9d 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -88,7 +88,7 @@ int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScrip
 	int canProcess = 0;
 	if (result) {
 		sentence->set34(result);
-		if (roomScript->proc6(npcScript, sentence, result)) {
+		if (roomScript->canRespond(npcScript, sentence, result)) {
 			canProcess = npcScript->chooseResponse(roomScript, sentence, result);
 		}
 	}
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 97cc70e..01f51e1 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -70,7 +70,7 @@ public:
 	TTconcept *_nextP;
 	TTscriptBase *_scriptP;
 	TTword *_wordP;
-	ScriptType _scriptType;
+	int _scriptType;
 	int _field14;
 	int _field20;
 	int _field34;
diff --git a/engines/titanic/true_talk/tt_room_script.cpp b/engines/titanic/true_talk/tt_room_script.cpp
index 885021e..4182498 100644
--- a/engines/titanic/true_talk/tt_room_script.cpp
+++ b/engines/titanic/true_talk/tt_room_script.cpp
@@ -37,10 +37,6 @@ TTroomScript::TTroomScript(int scriptId) :
 	TTroomScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) {
 }
 
-void TTroomScript::proc7() {
-	warning("TODO");
-}
-
 void TTroomScript::proc8() {
 	warning("TODO");
 }
diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h
index 63aedd2..4aa9b16 100644
--- a/engines/titanic/true_talk/tt_room_script.h
+++ b/engines/titanic/true_talk/tt_room_script.h
@@ -37,8 +37,16 @@ public:
 	TTroomScriptBase(int scriptId, const char *charClass, const char *charName,
 		int v3, int v4, int v5, int v6, int v2, int v7);
 
-	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, int val) = 0;
-	virtual void proc7() = 0;
+	/**
+	 * Returns true if a response can be made
+	 */
+	virtual bool canRespond(TTnpcScript *npcScript, TTsentence *sentence, int val) const = 0;
+
+	/**
+	 * Returns true if further sentence processing is allowed
+	 */
+	virtual bool canProcess(TTnpcScript *npcScript, TTsentence *sentence) const = 0;
+
 	virtual void proc8() = 0;
 	virtual void proc9() = 0;
 	
@@ -57,8 +65,20 @@ public:
 public:
 	TTroomScript(int scriptId);
 
-	virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, int val) { return 1; }
-	virtual void proc7();
+	/**
+	 * Returns true if a response can be made
+	 */
+	virtual bool canRespond(TTnpcScript *npcScript, TTsentence *sentence, int val) const {
+		return true;
+	}
+
+	/**
+	 * Returns true if further sentence processing is allowed
+	 */
+	virtual bool canProcess(TTnpcScript *npcScript, TTsentence *sentence) const {
+		return true;
+	}
+
 	virtual void proc8();
 	virtual void proc9();
 


Commit: 4ab3b4d2097077ab16bc6c33fac7a332ee74e1a2
    https://github.com/scummvm/scummvm/commit/4ab3b4d2097077ab16bc6c33fac7a332ee74e1a2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:18:52-04:00

Commit Message:
TITANIC: Further npc scripts chooseResponse methods

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index d47d2b5..ed7e083 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -25,13 +25,36 @@
 
 namespace Titanic {
 
+static const int STATE_ARRAY[7] = {
+	0xCAB0, 0xCAB2, 0xCAB3, 0xCAB4, 0xCAB5, 0xCAB6, 0xCAB7
+};
+
 BarbotScript::BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
+	_state = 0;
 	load("Responses/Barbot");
 }
 
 int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
+	if (tag == MKTAG('D', 'N', 'A', '1') || tag == MKTAG('H', 'H', 'G', 'Q') ||
+			tag == MKTAG('A', 'N', 'S', 'W') || tag == MKTAG('S', 'U', 'M', 'S')) {
+		if (_state < 7) {
+			addResponse(STATE_ARRAY[_state++]);
+		} else {
+			proc14(51896);
+			set34(1);
+			_state = 0;
+		}
+
+		applyResponse();
+		return 2;
+	}
+	
+	if (tag == MKTAG('S', 'W', 'E', 'R')) {
+
+	}
+
 	warning("TODO");
 	return SS_2;
 }
@@ -107,4 +130,9 @@ uint BarbotScript::translateId(uint id) const {
 	return 0;
 }
 
+void BarbotScript::adjustDial(int dialNum, int amount) {
+	int level = CLIP(getDialLevel(dialNum) + amount, 0, 100);
+	setDial(dialNum, level);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 9f38604..4aaa5f5 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -28,6 +28,13 @@
 namespace Titanic {
 
 class BarbotScript : public TTnpcScript {
+private:
+	int _state;
+private:
+	/**
+	 * Adjust a given dial number by a given delta amount
+	 */
+	void adjustDial(int dialNum, int amount);
 public:
 	BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 9c8c686..aec067e 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -22,18 +22,76 @@
 
 #include "common/textconsole.h"
 #include "titanic/true_talk/doorbot_script.h"
+#include "titanic/true_talk/tt_room_script.h"
 
 namespace Titanic {
 
+static const int STATE_ARRAY[9] = {
+	0x2E2A, 0x2E2B, 0x2E2C, 0x2E2D, 0x2E2E, 0x2E2F, 0x2E30, 0x2E31, 0x2E32
+};
+
 DoorbotScript::DoorbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
+	Common::fill(&_array[0], &_array[148], 0);
+	_state = 0;
 	load("Responses/Doorbot");
 }
 
 int DoorbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
-	warning("TODO");
-	return SS_2;
+	if (tag == MKTAG('D', 'N', 'A', '1') || tag == MKTAG('H', 'H', 'G', 'Q') ||
+		tag == MKTAG('A', 'N', 'S', 'W') || tag == MKTAG('S', 'U', 'M', 'S')) {
+		if (_state > 9)
+			_state = 0;
+		addResponse(STATE_ARRAY[_state]);
+		applyResponse();
+
+		if (STATE_ARRAY[_state] == 11826)
+			set34(1);
+		++_state;
+		return 2;
+	}
+
+	if (tag == MKTAG('C', 'H', 'S', 'E') || tag == MKTAG('C', 'M', 'N', 'T') ||
+			tag == MKTAG('J', 'F', 'O', 'D'))
+		tag = MKTAG('F', 'O', 'O', 'D');
+
+	if (tag == MKTAG('F', 'O', 'O', 'D') && roomScript->_scriptId == 132) {
+		return setResponse(getDialogueId(220818));
+	}
+
+	if (tag == MKTAG('T', 'R', 'A', 'V')) {
+		return setResponse(11858 - getRandomBit());
+	} else if (tag == MKTAG('C', 'S', 'P', 'Y')) {
+		return setResponse(10405, 3);
+	} else if (tag == MKTAG('S', 'C', 'I', 'T')) {
+		return setResponse(10410, 14);
+	} else if (tag == MKTAG('L', 'I', 'T', 'E')) {
+		return setResponse(10296, 17);
+	} else if (tag == MKTAG('D', 'O', 'R', '1')) {
+		return setResponse(getDialogueId(222034));
+	} else if (tag == MKTAG('W', 'T', 'H', 'R')) {
+		return setResponse(getDialogueId(222126));
+	} else if (tag == MKTAG('N', 'A', 'U', 'T')) {
+		return setResponse(getDialogueId(222259));
+	} else if (tag == MKTAG('T', 'R', 'A', '2')) {
+		return setResponse(getRandomBit() ? 11860 : 11859);
+	} else if (tag == MKTAG('T', 'R', 'A', '3')) {
+		return setResponse(getRandomBit() ? 11859 : 11858);
+	} else if (tag == MKTAG('B', 'R', 'N', 'D')) {
+		switch (getRandomNumber(3)) {
+		case 1:
+			tag = MKTAG('B', 'R', 'N', '2');
+			break;
+		case 2:
+			tag = MKTAG('B', 'R', 'N', '3');
+			break;
+		default:
+			break;
+		}
+	}
+
+	return TTnpcScript::chooseResponse(roomScript, sentence, tag);
 }
 
 void DoorbotScript::proc7(int v1, int v2) {
@@ -107,4 +165,13 @@ uint DoorbotScript::translateId(uint id) const {
 	return 0;
 }
 
+int DoorbotScript::setResponse(int dialogueId, int v34) {
+	addResponse(dialogueId);
+	applyResponse();
+
+	if (v34 != -1)
+		set34(v34);
+	return 2;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index d00e5b1..5158eec 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -30,6 +30,12 @@ namespace Titanic {
 class DoorbotScript : public TTnpcScript {
 private:
 	int _array[148];
+	int _state;
+private:
+	/**
+	 * Sets a response
+	 */
+	int setResponse(int dialogueId, int v34 = -1);
 public:
 	DoorbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);


Commit: e2d3a0a32f62c6865397ca23984e15fbf6af5a3a
    https://github.com/scummvm/scummvm/commit/e2d3a0a32f62c6865397ca23984e15fbf6af5a3a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:18:54-04:00

Commit Message:
TITANIC: Adding setDial method

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 92ec3d6..85bac6a 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -524,4 +524,9 @@ int CPetControl::roomFn2(int val) {
 	return _rooms.fn2(val);
 }
 
+void CPetControl::resetDials(int flag) {
+	if (flag == 1)
+		_conversations.resetDials(_activeNPCName);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 1eedc03..cf1589c 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -299,6 +299,11 @@ public:
 	 */
 	void addRoom(int roomNum);
 	int roomFn2(int val);
+
+	/**
+	 * Resets the dial display to reflect new values
+	 */
+	void resetDials(int flag = 1);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index b88ddfa..cefdf1b 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -148,11 +148,6 @@ private:
 	 * Called when the dial for an NPC is being changed
 	 */
 	void npcDialChange(uint dialNum, int oldLevel, int newLevel);
-
-	/**
-	 * Reset the dials with those for a given NPC
-	 */
-	void resetDials(const CString &name);
 public:
 	CPetConversations();
 	virtual ~CPetConversations() {}
@@ -241,6 +236,11 @@ public:
 	 * Hide the text cursor
 	 */
 	virtual void hideCursor();
+
+	/**
+	 * Reset the dials with those for a given NPC
+	 */
+	void resetDials(const CString &name);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index ef226f2..3140e72 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -110,11 +110,6 @@ private:
 	static bool proximityMethod1(int val);
 
 	/**
-	 * Return the game manager
-	 */
-	CGameManager *getGameManager() const;
-
-	/**
 	 * Return the game state
 	 */
 	CGameState *getGameState() const;
@@ -192,6 +187,11 @@ public:
 	 */
 	void removeCompleted();
 
+	/**
+	 * Return the game manager
+	 */
+	CGameManager *getGameManager() const;
+
 	void update2();
 
 	/**
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 2c8b8ba..48135d0 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "common/textconsole.h"
+#include "titanic/pet_control/pet_control.h"
 #include "titanic/true_talk/tt_npc_script.h"
 #include "titanic/true_talk/true_talk_manager.h"
 #include "titanic/titanic.h"
@@ -53,7 +54,8 @@ TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 		_field6C(0), _field70(0), _field74(0), _field78(0),
 		_field7C(0), _field80(0), _field2CC(false) {
 	CTrueTalkManager::_v2 = 0;
-	Common::fill(&_array[0], &_array[146], 0);
+	Common::fill(&_dialValues[0], &_dialValues[DIALS_ARRAY_COUNT], 0);
+	Common::fill(&_array[0], &_array[136], 0);
 
 	if (!CTrueTalkManager::_v10) {
 		Common::fill(&CTrueTalkManager::_v11[0], &CTrueTalkManager::_v11[41], 0);
@@ -243,15 +245,34 @@ int TTnpcScript::proc31() {
 	return 0;
 }
 
-void TTnpcScript::proc32() {
+void TTnpcScript::proc32(int dialNum, int region) {
 	warning("TODO");
 }
 
-void TTnpcScript::proc33(int v1, int v2) {
-	warning("TODO");
+void TTnpcScript::setDial(int dialNum, int value) {
+	if (dialNum < DIALS_ARRAY_COUNT) {
+		int oldRegion = proc34(dialNum);
+
+		int newRegion = 1;
+		if (value < 50)
+			newRegion = 0;
+		else if (value > 150)
+			newRegion = 2;
+
+		if (oldRegion == newRegion)
+			proc32(dialNum, newRegion);
+
+		_dialValues[dialNum] = value;
+	}
+
+	if (g_vm->_trueTalkManager) {
+		CPetControl *petControl = g_vm->_trueTalkManager->getGameManager()->getPetControl();
+		if (petControl)
+			petControl->resetDials();
+	}
 }
 
-int TTnpcScript::proc34() {
+int TTnpcScript::proc34(int dialNum) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 3822b52..bb49542 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -28,6 +28,8 @@
 
 namespace Titanic {
 
+#define DIALS_ARRAY_COUNT 10
+
 class TTroomScript;
 class TTsentence;
 
@@ -87,7 +89,8 @@ protected:
 	int _field78;
 	int _field7C;
 	int _field80;
-	int _array[146];
+	int _dialValues[DIALS_ARRAY_COUNT];
+	int _array[136];
 	bool _field2CC;
 protected:
 	/**
@@ -115,6 +118,13 @@ protected:
 	uint getRandomNumber(int max) const;
 
 	/**
+	 * Gets a random number of 0 or 1
+	 */
+	uint getRandomBit() const {
+		return getRandomNumber(2) - 1;
+	}
+
+	/**
 	 * Returns a dialogue Id by script tag value Id
 	 */
 	uint getDialogueId(uint tagId);
@@ -164,9 +174,14 @@ public:
 	virtual void saveBody(SimpleFile *file);
 	virtual void loadBody(SimpleFile *file);
 	virtual int proc31();
-	virtual void proc32();
-	virtual void proc33(int v1, int v2);
-	virtual int proc34();
+	virtual void proc32(int dialNum, int region);
+
+	/**
+	 * Sets the value for an NPC's dial
+	 */
+	virtual void setDial(int dialNum, int value);
+	
+	virtual int proc34(int dialNum);
 
 	/**
 	 * Get the NPC's dial level


Commit: b1ae3f44db79c7dc4ce31985dc5ca072fc1c9d76
    https://github.com/scummvm/scummvm/commit/b1ae3f44db79c7dc4ce31985dc5ca072fc1c9d76
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:18:57-04:00

Commit Message:
TITANIC: More script dial methods

Changed paths:
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 48135d0..8369d66 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -24,6 +24,7 @@
 #include "titanic/pet_control/pet_control.h"
 #include "titanic/true_talk/tt_npc_script.h"
 #include "titanic/true_talk/true_talk_manager.h"
+#include "titanic/game_manager.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
@@ -245,13 +246,20 @@ int TTnpcScript::proc31() {
 	return 0;
 }
 
-void TTnpcScript::proc32(int dialNum, int region) {
-	warning("TODO");
+void TTnpcScript::setDialRegion(int dialNum, int region) {
+	if (dialNum < DIALS_ARRAY_COUNT)
+		_dialValues[dialNum] = region * 100;
+
+	if (g_vm->_trueTalkManager) {
+		CPetControl *petControl = getPetControl(g_vm->_trueTalkManager->getGameManager());
+		if (petControl)
+			petControl->playSound(1);
+	}
 }
 
 void TTnpcScript::setDial(int dialNum, int value) {
 	if (dialNum < DIALS_ARRAY_COUNT) {
-		int oldRegion = proc34(dialNum);
+		int oldRegion = getDialRegion(dialNum);
 
 		int newRegion = 1;
 		if (value < 50)
@@ -260,21 +268,30 @@ void TTnpcScript::setDial(int dialNum, int value) {
 			newRegion = 2;
 
 		if (oldRegion == newRegion)
-			proc32(dialNum, newRegion);
+			setDialRegion(dialNum, newRegion);
 
 		_dialValues[dialNum] = value;
 	}
 
 	if (g_vm->_trueTalkManager) {
-		CPetControl *petControl = g_vm->_trueTalkManager->getGameManager()->getPetControl();
+		CPetControl *petControl = getPetControl(g_vm->_trueTalkManager->getGameManager());
 		if (petControl)
 			petControl->resetDials();
 	}
 }
 
-int TTnpcScript::proc34(int dialNum) {
-	warning("TODO");
-	return 0;
+int TTnpcScript::getDialRegion(int dialNum) {
+	if (dialNum < DIALS_ARRAY_COUNT) {
+		int value = _dialValues[dialNum];
+		if (value < 50)
+			return 0;
+		else if (value > 150)
+			return 2;
+		else
+			return 1;
+	} else {
+		return 0;
+	}
 }
 
 int TTnpcScript::getDialLevel(uint dialNum, bool flag) {
@@ -424,4 +441,10 @@ int TTnpcScript::translateByArray(int id) {
 	return -1;
 }
 
+CPetControl *TTnpcScript::getPetControl(CGameManager *gameManager) {
+	if (gameManager && gameManager->_project)
+		return gameManager->_project->getPetControl();
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index bb49542..69934ce 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -30,6 +30,8 @@ namespace Titanic {
 
 #define DIALS_ARRAY_COUNT 10
 
+class CGameManager;
+class CPetControl;
 class TTroomScript;
 class TTsentence;
 
@@ -128,6 +130,11 @@ protected:
 	 * Returns a dialogue Id by script tag value Id
 	 */
 	uint getDialogueId(uint tagId);
+
+	/**
+	 * Returns a pointer to the PET control
+	 */
+	static CPetControl *getPetControl(CGameManager *gameManager);
 public:
 	TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,
@@ -174,14 +181,21 @@ public:
 	virtual void saveBody(SimpleFile *file);
 	virtual void loadBody(SimpleFile *file);
 	virtual int proc31();
-	virtual void proc32(int dialNum, int region);
+
+	/**
+	 * Sets a given dial to be pointing in a specified region (0 to 2)
+	 */
+	virtual void setDialRegion(int dialNum, int region);
 
 	/**
 	 * Sets the value for an NPC's dial
 	 */
 	virtual void setDial(int dialNum, int value);
 	
-	virtual int proc34(int dialNum);
+	/**
+	 * Returns a dial's region number
+	 */
+	virtual int getDialRegion(int dialNum);
 
 	/**
 	 * Get the NPC's dial level


Commit: 95dc0bc4ccf51de23ab30133d6d1f339936ad413
    https://github.com/scummvm/scummvm/commit/95dc0bc4ccf51de23ab30133d6d1f339936ad413
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:18:59-04:00

Commit Message:
TITANIC: Finished BarbotScript chooseResponse

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index ed7e083..16bc244 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -49,14 +49,53 @@ int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 
 		applyResponse();
 		return 2;
-	}
+
+	} else if (tag == MKTAG('S', 'W', 'E', 'R')) {
+		adjustDial(0, -18);
+		adjustDial(1, -5);
+
+		if (getRandomNumber(100) > 50) {
+			addResponse(getDialogueId(getDialRegion(0) == 0 ? 250200 : 250062));
+			applyResponse();
+			return 2;
+		}
+
+	} else if (tag == MKTAG('B', 'A', 'R', 'K') && getRandomNumber(100) > 50) {
+		proc14(250025);
+		switch (proc23()) {
+		case 4:
+		case 6:
+			addResponse(getDialogueId(250125));
+			break;
+		default:
+			break;
+		}
+
+		applyResponse();
+		return 2;
 	
-	if (tag == MKTAG('S', 'W', 'E', 'R')) {
+	} else if (tag == MKTAG('B', 'A', 'R', 'U') && getRandomNumber(100) > 50) {
+		proc14(250025);
+		switch (proc23()) {
+		case 4:
+		case 6:
+			addResponse(getDialogueId(250112));
+			break;
+		default:
+			break;
+		}
 
+		applyResponse();
+		return 2;	
 	}
 
-	warning("TODO");
-	return SS_2;
+	if (tag == MKTAG('T', 'H', 'R', 'T') || tag == MKTAG('S', 'L', 'O', 'W') ||
+			tag == MKTAG('S', 'E', 'X', '1') || tag == MKTAG('P', 'K', 'U', 'P')) {
+		adjustDial(0, -7);
+		adjustDial(1, -3);
+	}
+
+	return TTnpcScript::chooseResponse(roomScript, sentence, tag);
 }
 
 void BarbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 69934ce..906489e 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -198,7 +198,8 @@ public:
 	virtual int getDialRegion(int dialNum);
 
 	/**
-	 * Get the NPC's dial level
+	 * Gets the value for a dial, introducing a slight random variance so that
+	 * the displayed dial will oscillate randomly around it's real level
 	 */
 	virtual int getDialLevel(uint dialNum, bool flag = true);
 


Commit: 6075a8fe4900bb32216099b2f9fd34334dbc281b
    https://github.com/scummvm/scummvm/commit/6075a8fe4900bb32216099b2f9fd34334dbc281b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:02-04:00

Commit Message:
TITANIC: Implement TTnpcScript selectResponse

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 16bc244..ddb06b1 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -42,7 +42,7 @@ int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 		if (_state < 7) {
 			addResponse(STATE_ARRAY[_state++]);
 		} else {
-			proc14(51896);
+			selectResponse(51896);
 			set34(1);
 			_state = 0;
 		}
@@ -61,7 +61,7 @@ int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 		}
 
 	} else if (tag == MKTAG('B', 'A', 'R', 'K') && getRandomNumber(100) > 50) {
-		proc14(250025);
+		selectResponse(250025);
 		switch (proc23()) {
 		case 4:
 		case 6:
@@ -75,7 +75,7 @@ int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 		return 2;
 	
 	} else if (tag == MKTAG('B', 'A', 'R', 'U') && getRandomNumber(100) > 50) {
-		proc14(250025);
+		selectResponse(250025);
 		switch (proc23()) {
 		case 4:
 		case 6:
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index dd6203d..5ffd6fb 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -42,7 +42,7 @@ int LiftbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence
 	case MKTAG('H', 'H', 'G', 'Q'):
 	case MKTAG('A', 'N', 'S', 'W'):
 		if (_state >= 7) {
-			proc14(30918);
+			selectResponse(30918);
 			set34(2);
 			_state = 0;
 		} else {
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 8369d66..1f1fceb 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -66,13 +66,14 @@ TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 	resetFlags();
 }
 
-void TTnpcScript::load(const char *name, int valuesPerTag) {
+void TTnpcScript::load(const char *name, int valuesPerResponse) {
+	_valuesPerResponse = valuesPerResponse;
 	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
 
 	while (r->pos() < r->size()) {
 		TTnpcScriptResponse sr;
 		sr._tag = r->readUint32LE();
-		for (int idx = 0; idx < valuesPerTag; ++idx)
+		for (int idx = 0; idx < valuesPerResponse; ++idx)
 			sr._values[idx] = r->readUint32LE();
 		
 		_responses.push_back(sr);
@@ -99,9 +100,14 @@ int TTnpcScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 		const TTnpcScriptResponse &response = _responses[idx];
 
 		if (response._tag == tag) {
-			int valIndex = getRandomNumber(response.size()) - 1;
-			uint diagId = getDialogueId(response._values[valIndex]);
-			addResponse(diagId);
+			if (_valuesPerResponse == 1) {
+				selectResponse(response._values[0]);
+			} else {
+				int valIndex = getRandomNumber(response.size()) - 1;
+				uint diagId = getDialogueId(response._values[valIndex]);
+				addResponse(diagId);
+			}
+			
 			applyResponse();
 			return 2;
 		}
@@ -135,8 +141,11 @@ bool TTnpcScript::proc13() const {
 	return true;
 }
 
-void TTnpcScript::proc14(int v) {
-	warning("TODO");
+void TTnpcScript::selectResponse(int id) {
+	if (id >= 200000 && id <= 290264)
+		id = getDialogueId(id);
+
+	addResponse(id);
 }
 
 int TTnpcScript::proc15() const {
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 906489e..239ccce 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -81,6 +81,7 @@ private:
 	int translateByArray(int id);
 protected:
 	Common::Array<TTnpcScriptResponse> _responses;
+	int _valuesPerResponse;
 	byte *_subPtr;
 	int _field60;
 	int _field64;
@@ -98,7 +99,7 @@ protected:
 	/**
 	 * Loads response data for the NPC from the given resource
 	 */
-	void load(const char *name, int valuesPerTag = 1);
+	void load(const char *name, int valuesPerResponse = 1);
 
 	/**
 	 * Reset script flags
@@ -163,7 +164,13 @@ public:
 	virtual int proc11() const;
 	virtual int proc12() const;
 	virtual bool proc13() const;
-	virtual void proc14(int v);
+
+	/**
+	 * Translate a passed Id to a dialogue Id if necessary,
+	 * and adds it to the response
+	 */
+	virtual void selectResponse(int id);
+	
 	virtual int proc15() const;
 	virtual bool proc16() const;
 	virtual bool proc17() const;


Commit: 928f9a8974753e84a051e354113811ba1b9548f1
    https://github.com/scummvm/scummvm/commit/928f9a8974753e84a051e354113811ba1b9548f1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:04-04:00

Commit Message:
TITANIC: Remove redundant CScriptHandlerSub class

Changed paths:
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 5e31a9d..cd06d71 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -32,7 +32,7 @@ namespace Titanic {
 
 CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) :
 		_owner(owner), _script(owner->_script), _resources(g_vm->_exeResources),
-		_sub1(), _parser(this), _field10(0), _inputCtr(0), 
+		_parser(this), _field10(0), _inputCtr(0), 
 		_concept1P(nullptr), _concept2P(nullptr), _concept3P(nullptr),
 		_concept4P(nullptr), _field30(0) {
 	g_vm->_scriptHandler = this;
@@ -94,12 +94,13 @@ int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScrip
 	}
 
 	if (canProcess == 0 || canProcess == 1) {
-		_parser.findFrames(sentence);
+		if (!_parser.findFrames(sentence)) {
+			if (roomScript->canProcess(npcScript, sentence) && npcScript) {
+				npcScript->process(roomScript, sentence);
+			}
+		}
 	}
 
-	warning("TODO: CScriptHandler::processInput");
-
-	// TODO
 	delete sentence;
 	return SS_VALID;
 }
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 10699f1..93abbc3 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -35,24 +35,11 @@ namespace Titanic {
 class CTitleEngine;
 class CScriptHandler;
 
-class CScriptHandlerSub1 {
-public:
-	int _field0;
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
-public:
-	CScriptHandlerSub1() : _field0(0), _field4(0), _field8(0),
-		_fieldC(0), _field10(0) {}
-};
-
 class CScriptHandler {
 private:
 	CTitleEngine *_owner;
 	CExeResources &_resources;
 	int _field10;
-	CScriptHandlerSub1 _sub1;
 	int _inputCtr;
 	int _field30;
 public:
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 1f1fceb..20e7faf 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -116,7 +116,7 @@ int TTnpcScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 	return 1;
 }
 
-void TTnpcScript::proc7(int v1, int v2) {
+void TTnpcScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 }
 
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 239ccce..3b9ffe8 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -150,7 +150,11 @@ public:
 	 */
 	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
 
-	virtual void proc7(int v1, int v2);
+	/**
+	 * Does further NPC specific processing of the sentence
+	 */
+	virtual void process(TTroomScript *roomScript, TTsentence *sentence);
+
 	virtual int proc8() const;
 	virtual int proc9() const;
 


Commit: 62c699fa3ca815a658a930b06ab99f6ce31a881d
    https://github.com/scummvm/scummvm/commit/62c699fa3ca815a658a930b06ab99f6ce31a881d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:07-04:00

Commit Message:
TITANIC: New TTsentenceEntries class for holding sentence res data

Changed paths:
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 20e7faf..41bf5d8 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -51,7 +51,7 @@ TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
 TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
-		_subPtr(nullptr), _field60(0), _field64(0), _field68(0),
+		_subPtr(nullptr), _entriesP(nullptr), _entryCount(0), _field68(0),
 		_field6C(0), _field70(0), _field74(0), _field78(0),
 		_field7C(0), _field80(0), _field2CC(false) {
 	CTrueTalkManager::_v2 = 0;
@@ -117,7 +117,7 @@ int TTnpcScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 }
 
 void TTnpcScript::process(TTroomScript *roomScript, TTsentence *sentence) {
-	warning("TODO");
+	processSentence(_entriesP, _entryCount, roomScript, sentence);
 }
 
 int TTnpcScript::proc8() const {
@@ -456,4 +456,8 @@ CPetControl *TTnpcScript::getPetControl(CGameManager *gameManager) {
 	return nullptr;
 }
 
+void TTnpcScript::processSentence(const TTsentenceEntries *entries, int entryCount, TTroomScript *roomScript, TTsentence *sentence) {
+	warning("TODO");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 3b9ffe8..a6741e6 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -34,6 +34,7 @@ class CGameManager;
 class CPetControl;
 class TTroomScript;
 class TTsentence;
+class TTsentenceEntries;
 
 struct TTnpcScriptResponse {
 	uint _tag;
@@ -83,8 +84,8 @@ protected:
 	Common::Array<TTnpcScriptResponse> _responses;
 	int _valuesPerResponse;
 	byte *_subPtr;
-	int _field60;
-	int _field64;
+	const TTsentenceEntries *_entriesP;
+	int _entryCount;
 	int _field68;
 	int _field6C;
 	int _field70;
@@ -136,6 +137,8 @@ protected:
 	 * Returns a pointer to the PET control
 	 */
 	static CPetControl *getPetControl(CGameManager *gameManager);
+
+	void processSentence(const TTsentenceEntries *entries, int entryCount, TTroomScript *roomScript, TTsentence *sentence);
 public:
 	TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index c777464..697afdd 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -39,6 +39,41 @@ TTsentenceConcept *TTsentenceConcept::addSibling() {
 
 /*------------------------------------------------------------------------*/
 
+bool TTsentenceEntry::load(Common::SeekableReadStream *s) {
+	if (s->pos() >= s->size())
+		return false;
+
+	_field0 = s->readUint32LE();
+	_field4 = s->readUint32LE();
+	_string8 = readStringFromStream(s);
+	_fieldC = s->readUint32LE();
+	_string10 = readStringFromStream(s);
+	_string14 = readStringFromStream(s);
+	_string18 = readStringFromStream(s);
+	_string1C = readStringFromStream(s);
+	_field20 = s->readUint32LE();
+	_string24 = readStringFromStream(s);
+	_field28 = s->readUint32LE();
+	_field2C = s->readUint32LE();
+	_field30 = s->readUint32LE();
+
+	return true;
+}
+
+/*------------------------------------------------------------------------*/
+
+void TTsentenceEntries::load(const CString &resName) {
+	TTsentenceEntry entry;
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(resName);
+
+	while (entry.load(r))
+		push_back(entry);
+
+	delete r;
+}
+
+/*------------------------------------------------------------------------*/
+
 TTsentence::TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner,
 		TTroomScript *roomScript, TTnpcScript *npcScript) :
 		_owner(owner), _field2C(1), _inputCtr(inputCtr), _field34(0),
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index f51ca4b..3d1c9f2 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -23,6 +23,7 @@
 #ifndef TITANIC_TT_SENTENCE_H
 #define TITANIC_TT_SENTENCE_H
 
+#include "common/array.h"
 #include "titanic/true_talk/tt_concept_node.h"
 #include "titanic/true_talk/tt_npc_script.h"
 #include "titanic/true_talk/tt_room_script.h"
@@ -45,6 +46,39 @@ public:
 	TTsentenceConcept *addSibling();
 };
 
+struct TTsentenceEntry {
+	int _field0;
+	int _field4;
+	CString _string8;
+	int _fieldC;
+	CString _string10;
+	CString _string14;
+	CString _string18;
+	CString _string1C;
+	int _field20;
+	CString _string24;
+	int _field28;
+	int _field2C;
+	int _field30;
+
+	TTsentenceEntry() : _field0(0), _field4(0), _fieldC(0),
+		_field20(0), _field28(0), _field2C(0), _field30(0) {}
+
+	/**
+	 * Load an entry from the passed stream, and returns true
+	 * if an entry was successfully loaded
+	 */
+	bool load(Common::SeekableReadStream *s);
+};
+
+class TTsentenceEntries : public Common::Array<TTsentenceEntry> {
+public:
+	/**
+	 * Load a list of entries from the specified resource
+	 */
+	void load(const CString &resName);
+};
+
 class TTsentence {
 private:
 	CScriptHandler *_owner;


Commit: 6eb562a17a56ca415eb939f07d512d627b1907e9
    https://github.com/scummvm/scummvm/commit/6eb562a17a56ca415eb939f07d512d627b1907e9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:09-04:00

Commit Message:
TITANIC: Beginnings of script handler processSentence

Changed paths:
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 41bf5d8..6f3c102 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -456,7 +456,37 @@ CPetControl *TTnpcScript::getPetControl(CGameManager *gameManager) {
 	return nullptr;
 }
 
-void TTnpcScript::processSentence(const TTsentenceEntries *entries, int entryCount, TTroomScript *roomScript, TTsentence *sentence) {
+int TTnpcScript::processSentence(const TTsentenceEntries *entries, uint entryCount, TTroomScript *roomScript, TTsentence *sentence) {
+	if (!entries)
+		return SS_1;
+	if (!entryCount)
+		// No count specified, so use entire list
+		entryCount = entries->size();
+	int entryId = _field2C;
+
+	for (uint loopCtr = 0; loopCtr < 2; ++loopCtr) {
+		for (uint entryCtr = 0; entryCtr < entryCount; ++entryCtr) {
+			const TTsentenceEntry &entry = (*entries)[entryCtr];
+			if (entry._field4 != entryId && (loopCtr == 0 || entry._field4))
+				continue;
+
+			bool flag;
+			if (entry._fieldC || entry._string10.empty()) {
+				flag = sentence->fn1(entry._string8, entry._fieldC,
+					entry._string14, entry._string18, entry._string1C,
+					entry._field20, entry._field28, 0, nullptr);
+			} else {
+				flag = sentence->fn3(entry._string8, entry._string10,
+					entry._string14, entry._string18, entry._string1C,
+					entry._string24, entry._field28, 0, nullptr);
+			}
+
+			if (flag) {
+				// TODO
+			}
+		}
+	}
+
 	warning("TODO");
 }
 
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index a6741e6..43e26b6 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -138,7 +138,7 @@ protected:
 	 */
 	static CPetControl *getPetControl(CGameManager *gameManager);
 
-	void processSentence(const TTsentenceEntries *entries, int entryCount, TTroomScript *roomScript, TTsentence *sentence);
+	int processSentence(const TTsentenceEntries *entries, uint entryCount, TTroomScript *roomScript, TTsentence *sentence);
 public:
 	TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 697afdd..f41ddd1 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -142,6 +142,19 @@ int TTsentence::storeVocabHit(TTword *word) {
 	return 0;
 }
 
+bool TTsentence::fn1(const CString &str, int wordId1, const CString &str1, const CString &str2,
+		const CString &str3, int wordId2, int val, int val2, const TTconceptNode *node) {
+	// TODO
+	return false;
+}
+
+bool TTsentence::fn3(const CString &str1, const CString &str2, const CString &str3,
+		const CString &str4, const CString &str5, const CString &str6,
+		int val, int val2, const TTconceptNode *node) {
+	// TODO
+	return false;
+}
+
 bool TTsentence::fn2(int slotIndex, const TTstring &str, TTconceptNode *conceptNode) {
 	if (!conceptNode)
 		conceptNode = &_sentenceConcept;
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 3d1c9f2..66d64fc 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -141,6 +141,11 @@ public:
 	 */
 	int storeVocabHit(TTword *word);
 
+	bool fn1(const CString &str, int wordId1, const CString &str1, const CString &str2,
+		const CString &str3, int wordId2, int val, int val2, const TTconceptNode *node);
+	bool fn3(const CString &str1, const CString &str2, const CString &str3,
+		const CString &str4, const CString &str5, const CString &str6,
+		int val, int val2, const TTconceptNode *node);
 	bool fn2(int slotIndex, const TTstring &str, TTconceptNode *conceptNode);
 	bool fn4(int mode, int wordId, TTconceptNode *node);
 };


Commit: 3196e488f196a6c33f89eea389cf8d9a90d5f90d
    https://github.com/scummvm/scummvm/commit/3196e488f196a6c33f89eea389cf8d9a90d5f90d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:12-04:00

Commit Message:
TITANIC: Finished TTnpcScript processSentence

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index ddb06b1..d6768fc 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -132,7 +132,7 @@ int BarbotScript::proc21(int v1, int v2, int v3) {
 	return 0;
 }
 
-int BarbotScript::proc22() const {
+int BarbotScript::proc22(int id) const {
 	warning("TODO");
 	return 0;
 }
@@ -147,12 +147,12 @@ const int *BarbotScript::getTablePtr(int id) {
 	return nullptr;
 }
 
-int BarbotScript::proc25() const {
+int BarbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
 }
 
-void BarbotScript::proc26() {
+void BarbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
 void BarbotScript::proc32() {
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 4aaa5f5..99dfac8 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -51,11 +51,11 @@ public:
 	virtual bool proc17() const;
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
-	virtual int proc22() const;
+	virtual int proc22(int id) const;
 	virtual int proc23() const;
 	virtual const int *getTablePtr(int id);
-	virtual int proc25() const;
-	virtual void proc26();
+	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc32();
 	virtual int proc36(int val) const;
 	
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 7954b7f..1da2726 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -76,7 +76,7 @@ int BellbotScript::proc21(int v1, int v2, int v3) {
 	return 0;
 }
 
-int BellbotScript::proc22() const {
+int BellbotScript::proc22(int id) const {
 	warning("TODO");
 	return 0;
 }
@@ -91,12 +91,12 @@ const int *BellbotScript::getTablePtr(int id) {
 	return nullptr;
 }
 
-int BellbotScript::proc25() const {
+int BellbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
 }
 
-void BellbotScript::proc26() {
+void BellbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
 int BellbotScript::proc36(int id) const {
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 86e9165..3c23716 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -45,11 +45,11 @@ public:
 	virtual bool proc17() const;
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
-	virtual int proc22() const;
+	virtual int proc22(int id) const;
 	virtual int proc23() const;
 	virtual const int *getTablePtr(int id);
-	virtual int proc25() const;
-	virtual void proc26();
+	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
 	virtual uint translateId(uint id) const;
 };
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index fe4de23..ce643f5 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -77,7 +77,7 @@ int DeskbotScript::proc21(int v1, int v2, int v3) {
 	return 0;
 }
 
-int DeskbotScript::proc22() const {
+int DeskbotScript::proc22(int id) const {
 	warning("TODO");
 	return 0;
 }
@@ -92,12 +92,12 @@ const int *DeskbotScript::getTablePtr(int id) {
 	return nullptr;
 }
 
-int DeskbotScript::proc25() const {
+int DeskbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
 }
 
-void DeskbotScript::proc26() {
+void DeskbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
 int DeskbotScript::proc36(int id) const {
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 3dda552..a5fb11e 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -40,11 +40,11 @@ public:
 	virtual bool proc17() const;
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
-	virtual int proc22() const;
+	virtual int proc22(int id) const;
 	virtual int proc23() const;
 	virtual const int *getTablePtr(int id);
-	virtual int proc25() const;
-	virtual void proc26();
+	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
 	virtual uint translateId(uint id) const;
 
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index aec067e..2b248ac 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -128,7 +128,7 @@ int DoorbotScript::proc21(int v1, int v2, int v3) {
 	return 0;
 }
 
-int DoorbotScript::proc22() const {
+int DoorbotScript::proc22(int id) const {
 	warning("TODO");
 	return 0;
 }
@@ -143,12 +143,12 @@ const int *DoorbotScript::getTablePtr(int id) {
 	return nullptr;
 }
 
-int DoorbotScript::proc25() const {
+int DoorbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
 }
 
-void DoorbotScript::proc26() {
+void DoorbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
 void DoorbotScript::proc32() {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 5158eec..72e24db 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -52,11 +52,11 @@ public:
 	virtual bool proc17() const;
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
-	virtual int proc22() const;
+	virtual int proc22(int id) const;
 	virtual int proc23() const;
 	virtual const int *getTablePtr(int id);
-	virtual int proc25() const;
-	virtual void proc26();
+	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc32();
 	virtual int proc36(int val) const;
 	virtual uint translateId(uint id) const;
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 5ffd6fb..3a64733 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -104,7 +104,7 @@ int LiftbotScript::proc21(int v1, int v2, int v3) {
 	return 0;
 }
 
-int LiftbotScript::proc22() const {
+int LiftbotScript::proc22(int id) const {
 	warning("TODO");
 	return 0;
 }
@@ -119,12 +119,12 @@ const int *LiftbotScript::getTablePtr(int id) {
 	return nullptr;
 }
 
-int LiftbotScript::proc25() const {
+int LiftbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
 }
 
-void LiftbotScript::proc26() {
+void LiftbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
 void LiftbotScript::proc32() {
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 04454c8..9e2a9ff 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -47,11 +47,11 @@ public:
 	virtual bool proc17() const;
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
-	virtual int proc22() const;
+	virtual int proc22(int id) const;
 	virtual int proc23() const;
 	virtual const int *getTablePtr(int id);
-	virtual int proc25() const;
-	virtual void proc26();
+	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc32();
 	virtual uint translateId(uint id) const;
 };
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index ed9cc5b..c417940 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -82,7 +82,7 @@ int MaitreDScript::proc21(int v1, int v2, int v3) {
 	return 0;
 }
 
-int MaitreDScript::proc22() const {
+int MaitreDScript::proc22(int id) const {
 	warning("TODO");
 	return 0;
 }
@@ -97,12 +97,12 @@ const int *MaitreDScript::getTablePtr(int id) {
 	return nullptr;
 }
 
-int MaitreDScript::proc25() const {
+int MaitreDScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
 }
 
-void MaitreDScript::proc26() {
+void MaitreDScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
 uint MaitreDScript::translateId(uint id) const {
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index d638dee..389e388 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -43,11 +43,11 @@ public:
 	virtual bool proc17() const;
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
-	virtual int proc22() const;
+	virtual int proc22(int id) const;
 	virtual int proc23() const;
 	virtual const int *getTablePtr(int id);
-	virtual int proc25() const;
-	virtual void proc26();
+	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual uint translateId(uint id) const;
 };
 
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index 3e195a0..a889187 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -64,12 +64,12 @@ const int *ParrotScript::getTablePtr(int id) {
 	return nullptr;
 }
 
-int ParrotScript::proc25() const {
+int ParrotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
 }
 
-void ParrotScript::proc26() {
+void ParrotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index abf8042..3cf804d 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -44,8 +44,8 @@ public:
 	virtual bool proc18() const;
 	virtual int proc23() const;
 	virtual const int *getTablePtr(int id);
-	virtual int proc25() const;
-	virtual void proc26();
+	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index c09cadd..b52a02a 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -92,12 +92,12 @@ const int *SuccUBusScript::getTablePtr(int id) {
 	return nullptr;
 }
 
-int SuccUBusScript::proc25() const {
+int SuccUBusScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
 }
 
-void SuccUBusScript::proc26() {
+void SuccUBusScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 4324999..e9263db 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -48,8 +48,8 @@ public:
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc23() const;
 	virtual const int *getTablePtr(int id);
-	virtual int proc25() const;
-	virtual void proc26();
+	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 01f51e1..3301926 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -132,6 +132,7 @@ public:
 	void setFlag(bool val) { _flag = val; }
 	void set1C(int val) { _field1C = val; }
 	int get20() const { return _field20; }
+	int get34() const { return _field34; }
 
 	bool checkWordId1() const;
 	bool checkWordId2() const;
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 6f3c102..ff1d854 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -178,7 +178,7 @@ int TTnpcScript::proc21(int v1, int v2, int v3) {
 	return v1;
 }
 
-int TTnpcScript::proc22() const {
+int TTnpcScript::proc22(int id) const {
 	return 0;
 }
 
@@ -186,11 +186,11 @@ int TTnpcScript::proc23() const {
 	return 0;
 }
 
-int TTnpcScript::proc25() const {
+int TTnpcScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	return 0;
 }
 
-void TTnpcScript::proc26() {
+void TTnpcScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
 void TTnpcScript::save(SimpleFile *file) {
@@ -482,12 +482,49 @@ int TTnpcScript::processSentence(const TTsentenceEntries *entries, uint entryCou
 			}
 
 			if (flag) {
-				// TODO
+				if (entry._field2C) {
+					bool flag2 = true;
+					if (entry._field2C & 0x1000000)
+						flag2 = sentence->isConcept34(1);
+
+					if (entry._field2C & 0x2000000)
+						flag2 = sentence->isConcept34(0) || sentence->isConcept34(4);
+
+					if (!flag2) {
+						flag = false;
+					} else {
+						int result = proc25(entry._field2C & 0xFFFFFF, entry._field0,
+							roomScript, sentence);
+						if (result == 2)
+							return 2;
+						flag = !result;
+					}
+				}
+
+				if (flag) {
+					int dialogueId = getDialogueId(entry._field0);
+					int id;
+					if (!dialogueId)
+						return 1;
+					else if (dialogueId == 4)
+						return 2;	
+					addResponse(dialogueId);
+
+					id = proc22(dialogueId);
+					if (id)
+						addResponse(getDialogueId(id));
+					applyResponse();
+
+					if (entry._field30)
+						proc26(entry._field30, &entry, roomScript, sentence);
+
+					return 2;
+				}
 			}
 		}
 	}
 
-	warning("TODO");
+	return 1;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 43e26b6..afd7680 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -34,6 +34,7 @@ class CGameManager;
 class CPetControl;
 class TTroomScript;
 class TTsentence;
+struct TTsentenceEntry;
 class TTsentenceEntries;
 
 struct TTnpcScriptResponse {
@@ -185,11 +186,11 @@ public:
 	virtual uint proc19(uint v);
 	virtual void proc20(int v);
 	virtual int proc21(int v1, int v2, int v3);
-	virtual int proc22() const;
+	virtual int proc22(int id) const;
 	virtual int proc23() const;
 	virtual const int *getTablePtr(int id) = 0;
-	virtual int proc25() const;
-	virtual void proc26();
+	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void save(SimpleFile *file);
 	virtual void load(SimpleFile *file);
 	virtual void saveBody(SimpleFile *file);
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index f41ddd1..8347b42 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -291,4 +291,9 @@ int TTsentence::is1C(int val, const TTconceptNode *node) const {
 	return node->_field1C == val;
 }
 
+bool TTsentence::isConcept34(int slotIndex, TTconceptNode *node) {
+	TTconcept *concept = getFrameEntry(slotIndex, node);
+	return concept && concept->get34();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 66d64fc..349d0c3 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -148,6 +148,8 @@ public:
 		int val, int val2, const TTconceptNode *node);
 	bool fn2(int slotIndex, const TTstring &str, TTconceptNode *conceptNode);
 	bool fn4(int mode, int wordId, TTconceptNode *node);
+
+	bool isConcept34(int slotIndex, TTconceptNode *node = nullptr);
 };
 
 } // End of namespace Titanic


Commit: f02efd2d9e762c9f79e983603b5684e5eb357496
    https://github.com/scummvm/scummvm/commit/f02efd2d9e762c9f79e983603b5684e5eb357496
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:15-04:00

Commit Message:
TITANIC: Beginnings of TTquotes class

Changed paths:
  A engines/titanic/true_talk/tt_quotes.cpp
  A engines/titanic/true_talk/tt_quotes.h
    engines/titanic/module.mk



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index c97b30f..2b604ec 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -471,6 +471,7 @@ MODULE_OBJS := \
 	true_talk/tt_parser.o \
 	true_talk/tt_picture.o \
 	true_talk/tt_pronoun.o \
+	true_talk/tt_quotes.o \
 	true_talk/tt_response.o \
 	true_talk/tt_room_script.o \
 	true_talk/tt_script_base.o \
diff --git a/engines/titanic/true_talk/tt_quotes.cpp b/engines/titanic/true_talk/tt_quotes.cpp
new file mode 100644
index 0000000..ced7f8e
--- /dev/null
+++ b/engines/titanic/true_talk/tt_quotes.cpp
@@ -0,0 +1,86 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/algorithm.h"
+#include "titanic/true_talk/tt_quotes.h"
+
+namespace Titanic {
+
+TTquotes::TTquotes() {
+	Common::fill(&_array[0], &_array[256], 0);
+	_dataP = nullptr;
+	_field540 = 0;
+	_field544 = 0;
+}
+
+TTquotes::~TTquotes() {
+	for (int idx = 0; idx < 26; ++idx)
+		delete _alphabet[idx]._dataP;
+
+	delete _dataP;
+}
+
+void TTquotes::load(const CString &name) {
+	// TODO
+}
+
+int TTquotes::read(const char *str) {
+	if (!str || !*str)
+		return 0;
+
+	// Find start and end of string
+	const char *startP = str, *endP = str;
+	while (*endP)
+		++endP;
+
+	do {
+		int result = read(startP, endP);
+		if (result)
+			return result;
+
+		// Move to next following space or end of string
+		while (*startP && *startP != ' ')
+			++startP;
+		// If it's a space, then move past it to start of next word
+		while (*startP && *startP == ' ')
+			++startP;
+
+	} while (*startP);
+
+	return 0;
+}
+
+int TTquotes::read(const char *startP, const char *endP) {
+	int size = endP - startP;
+	if (size < 3)
+		return 0;
+
+	uint index = MIN((uint)(*startP - 'a'), (uint)25);
+	TTquotesEntry &entry = _alphabet[index];
+	if (!entry._dataP || entry._field4 <= 0)
+		return 0;
+
+	// TODO
+	return 0;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_quotes.h b/engines/titanic/true_talk/tt_quotes.h
new file mode 100644
index 0000000..2af612c
--- /dev/null
+++ b/engines/titanic/true_talk/tt_quotes.h
@@ -0,0 +1,61 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_QUOTES_H
+#define TITANIC_TT_QUOTES_H
+
+#include "common/scummsys.h"
+#include "titanic/support/string.h"
+
+namespace Titanic {
+
+class TTquotes {
+	struct TTquotesEntry {
+		byte *_dataP;
+		int _field4;
+		int _field8;
+
+		TTquotesEntry() : _dataP(nullptr), _field4(0), _field8(0) {}
+	};
+private:
+	TTquotesEntry _alphabet[26];
+	uint _array[256];
+	byte *_dataP;
+	int _field540;
+	int _field544;
+private:
+	int read(const char *startP, const char *endP);
+public:
+	TTquotes();
+	~TTquotes();
+
+	/**
+	 * Load quotes from the specified resource
+	 */
+	void load(const CString &name);
+
+	int read(const char *str);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_QUOTES_H */


Commit: 4e766db41cae9d747f49cbfefbb5a23612768ea5
    https://github.com/scummvm/scummvm/commit/4e766db41cae9d747f49cbfefbb5a23612768ea5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:17-04:00

Commit Message:
TITANIC: Implemented TTnpcScript loadQuotes

Changed paths:
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_scripts.cpp



diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 1c10953..a5a1edc 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -49,6 +49,7 @@ CTrueTalkManager::CTrueTalkManager(CGameManager *owner) :
 		_gameManager(owner), _scripts(&_titleEngine), _currentCharId(0),
 		_dialogueFile(nullptr), _dialogueId(0) {
 	_titleEngine.setup(3, 3);
+	_quotes.load("TEXT/JRQuotes.txt");
 	_currentNPC = nullptr;
 	g_vm->_trueTalkManager = this;
 }
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 3140e72..754a995 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -27,6 +27,7 @@
 #include "titanic/support/simple_file.h"
 #include "titanic/true_talk/dialogue_file.h"
 #include "titanic/true_talk/title_engine.h"
+#include "titanic/true_talk/tt_quotes.h"
 #include "titanic/true_talk/tt_scripts.h"
 #include "titanic/true_talk/tt_talker.h"
 
@@ -129,6 +130,8 @@ public:
 
 	static void setFlags(int index, int val);
 public:
+	TTquotes _quotes;
+public:
 	/**
 	 * Get a specified state value from the currently set NPC
 	 */
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index ff1d854..337b367 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -136,9 +136,17 @@ int TTnpcScript::proc12() const {
 	return 1;
 }
 
-bool TTnpcScript::proc13() const {
-	warning("TODO");
-	return true;
+
+bool TTnpcScript::loadQuotes() {
+	// Original did a load of a global quotes here the first time
+	// this method is called. ScummVM implementation has refactored
+	// the loading to the CTrueTalkManager constructor
+
+	if (!proc18()) {
+		return false;
+	} else {
+		return proc17();
+	}
 }
 
 void TTnpcScript::selectResponse(int id) {
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index afd7680..15ff530 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -171,7 +171,11 @@ public:
 
 	virtual int proc11() const;
 	virtual int proc12() const;
-	virtual bool proc13() const;
+
+	/**
+	 * Handles loading quotes used by the scripts
+	 */
+	virtual bool loadQuotes();
 
 	/**
 	 * Translate a passed Id to a dialogue Id if necessary,
diff --git a/engines/titanic/true_talk/tt_scripts.cpp b/engines/titanic/true_talk/tt_scripts.cpp
index fbdf52f..94420a4 100644
--- a/engines/titanic/true_talk/tt_scripts.cpp
+++ b/engines/titanic/true_talk/tt_scripts.cpp
@@ -75,7 +75,7 @@ TTscripts::TTscripts(CTitleEngine *titleEngine) :
 }
 
 void TTscripts::addScript(TTnpcScript *script, int scriptId) {
-	script->proc13();
+	script->loadQuotes();
 	
 	// Find the room script this is associated with
 	TTroomScript *roomScript = getRoomScript(scriptId);


Commit: b3bcf1cc4e2c22cedafd63417bb1d22ef591dd41
    https://github.com/scummvm/scummvm/commit/b3bcf1cc4e2c22cedafd63417bb1d22ef591dd41
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:20-04:00

Commit Message:
TITANIC: Finished TTquotes load

Changed paths:
    engines/titanic/true_talk/tt_quotes.cpp
    engines/titanic/true_talk/tt_quotes.h



diff --git a/engines/titanic/true_talk/tt_quotes.cpp b/engines/titanic/true_talk/tt_quotes.cpp
index ced7f8e..734ad58 100644
--- a/engines/titanic/true_talk/tt_quotes.cpp
+++ b/engines/titanic/true_talk/tt_quotes.cpp
@@ -22,25 +22,50 @@
 
 #include "common/algorithm.h"
 #include "titanic/true_talk/tt_quotes.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
 TTquotes::TTquotes() {
 	Common::fill(&_array[0], &_array[256], 0);
 	_dataP = nullptr;
-	_field540 = 0;
+	_dataSize = 0;
 	_field544 = 0;
 }
 
 TTquotes::~TTquotes() {
-	for (int idx = 0; idx < 26; ++idx)
-		delete _alphabet[idx]._dataP;
-
-	delete _dataP;
+	delete[] _dataP;
 }
 
 void TTquotes::load(const CString &name) {
-	// TODO
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource("TEXT/JRQuotes.txt");
+	size_t size = r->readUint32LE();
+
+	_dataSize = _field544 = size;
+	_dataP = new char[size + 0x10];
+
+	for (int idx = 0; idx < 256; ++idx)
+		_array[idx] = r->readUint32LE();
+
+	for (int charIdx = 0; charIdx < 26; ++charIdx) {
+		TTquotesLetter &letter = _alphabet[charIdx];
+		int count = r->readUint32LE();
+
+		// Load the list of entries for the given letter
+		letter._entries.resize(count);
+		for (int idx = 0; idx < count; ++idx) {
+			letter._entries[idx]._val1 = r->readByte();
+			letter._entries[idx]._val2 = r->readByte();
+			letter._entries[idx]._strP = _dataP + r->readUint32LE();
+		}
+	}
+
+	// Read in buffer and then decode it
+	r->read((byte *)_dataP, _dataSize);
+	for (size_t idx = 0; idx < _dataSize; idx += 4)
+		WRITE_LE_UINT32((byte *)_dataP + idx, READ_LE_UINT32((byte *)_dataP + idx) ^ 0xA55A5AA5);
+
+	delete r;
 }
 
 int TTquotes::read(const char *str) {
@@ -75,8 +100,9 @@ int TTquotes::read(const char *startP, const char *endP) {
 		return 0;
 
 	uint index = MIN((uint)(*startP - 'a'), (uint)25);
-	TTquotesEntry &entry = _alphabet[index];
-	if (!entry._dataP || entry._field4 <= 0)
+	TTquotesLetter &letter = _alphabet[index];
+	if (letter._entries.empty())
+		// No entries for the letter, so exit immediately
 		return 0;
 
 	// TODO
diff --git a/engines/titanic/true_talk/tt_quotes.h b/engines/titanic/true_talk/tt_quotes.h
index 2af612c..6649c1f 100644
--- a/engines/titanic/true_talk/tt_quotes.h
+++ b/engines/titanic/true_talk/tt_quotes.h
@@ -24,23 +24,29 @@
 #define TITANIC_TT_QUOTES_H
 
 #include "common/scummsys.h"
+#include "common/stream.h"
 #include "titanic/support/string.h"
 
 namespace Titanic {
 
 class TTquotes {
 	struct TTquotesEntry {
-		byte *_dataP;
+		byte _val1, _val2;
+		const char *_strP;
+		TTquotesEntry() : _val1(0), _val2(0), _strP(nullptr) {}
+	};
+	struct TTquotesLetter {
+		Common::Array<TTquotesEntry> _entries;
 		int _field4;
 		int _field8;
 
-		TTquotesEntry() : _dataP(nullptr), _field4(0), _field8(0) {}
+		TTquotesLetter() : _field4(0), _field8(0) {}
 	};
 private:
-	TTquotesEntry _alphabet[26];
+	TTquotesLetter _alphabet[26];
 	uint _array[256];
-	byte *_dataP;
-	int _field540;
+	const char *_dataP;
+	size_t _dataSize;
 	int _field544;
 private:
 	int read(const char *startP, const char *endP);


Commit: e9c239797d2c99ec15675513c577b92a1ea6802e
    https://github.com/scummvm/scummvm/commit/e9c239797d2c99ec15675513c577b92a1ea6802e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:23-04:00

Commit Message:
TITANIC: Implement TTquotes read

Changed paths:
    engines/titanic/true_talk/tt_quotes.cpp
    engines/titanic/true_talk/tt_quotes.h



diff --git a/engines/titanic/true_talk/tt_quotes.cpp b/engines/titanic/true_talk/tt_quotes.cpp
index 734ad58..856cba9 100644
--- a/engines/titanic/true_talk/tt_quotes.cpp
+++ b/engines/titanic/true_talk/tt_quotes.cpp
@@ -100,12 +100,46 @@ int TTquotes::read(const char *startP, const char *endP) {
 		return 0;
 
 	uint index = MIN((uint)(*startP - 'a'), (uint)25);
-	TTquotesLetter &letter = _alphabet[index];
+	const TTquotesLetter &letter = _alphabet[index];
 	if (letter._entries.empty())
 		// No entries for the letter, so exit immediately
 		return 0;
 
-	// TODO
+	int maxSize = size + 4;
+	bool letterFlag = index != 25;
+
+	for (uint idx = 0; idx < letter._entries.size(); ++idx) {
+		const TTquotesEntry &entry = letter._entries[idx];
+		if (entry._val2 > maxSize)
+			continue;
+
+		const char *srcP = startP;
+		const char *destP = entry._strP;
+		int srcIndex = 0, destIndex = 0;
+		if (*destP) {
+			do {
+				if (!srcP[srcIndex]) {
+					break;
+				} else if (srcP[srcIndex] == '*') {
+					++srcIndex;
+				} else if (destP[destIndex] == '-') {
+					++destIndex;
+					if (srcP[srcIndex] == ' ')
+						++srcIndex;
+				} else if (srcP[srcIndex] != destP[destIndex]) {
+					break;
+				} else {
+					++destIndex;
+					++srcIndex;
+				}
+			} while (destP[destIndex]);
+
+			if (!destP[destIndex] && (srcP[srcIndex] <= '*' ||
+					(srcP[srcIndex] == 's' && srcP[srcIndex + 1] <= '*')))
+				return entry._val1;
+		}
+	}
+
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/tt_quotes.h b/engines/titanic/true_talk/tt_quotes.h
index 6649c1f..f67216c 100644
--- a/engines/titanic/true_talk/tt_quotes.h
+++ b/engines/titanic/true_talk/tt_quotes.h
@@ -49,6 +49,10 @@ private:
 	size_t _dataSize;
 	int _field544;
 private:
+	/**
+	 * Test whether a substring contains one of the quotes,
+	 * and if so, returns the Id associated with it
+	 */
 	int read(const char *startP, const char *endP);
 public:
 	TTquotes();
@@ -59,6 +63,10 @@ public:
 	 */
 	void load(const CString &name);
 
+	/**
+	 * Test whether a passed string contains one of the quotes,
+	 * and if so, returns the Id associated with it
+	 */
 	int read(const char *str);
 };
 


Commit: ebb60288716bc4876183989d04d7bb2208b9fceb
    https://github.com/scummvm/scummvm/commit/ebb60288716bc4876183989d04d7bb2208b9fceb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:25-04:00

Commit Message:
TITANIC: gcc compilation fixes

Changed paths:
    engines/titanic/core/list.h
    engines/titanic/game_view.h
    engines/titanic/sound/sound_manager.h
    engines/titanic/true_talk/tt_word.h



diff --git a/engines/titanic/core/list.h b/engines/titanic/core/list.h
index 1905c0f..4052a01 100644
--- a/engines/titanic/core/list.h
+++ b/engines/titanic/core/list.h
@@ -149,7 +149,7 @@ public:
 	}
 
 	bool contains(const T *item) const {
-		for (Common::List<T *>::const_iterator i = Common::List<T *>::begin(); 
+		for (typename Common::List<T *>::const_iterator i = Common::List<T *>::begin(); 
 				i != Common::List<T *>::end(); ++i) {
 			if (*i == item)
 				return true;
diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h
index 0bba5cf..74ab207 100644
--- a/engines/titanic/game_view.h
+++ b/engines/titanic/game_view.h
@@ -39,6 +39,7 @@ public:
 	CVideoSurface *_surface;
 public:
 	CGameView();
+	virtual ~CGameView() {}
 
 	/**
 	 * Set the game manager
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index e9fd1fa..75cf06e 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -36,6 +36,7 @@ protected:
 	int _field14;
 public:
 	SoundManager();
+	virtual ~SoundManager() {}
 	
 	/**
 	 * Loads a sound
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index 349e9e9..428a3e3 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -70,7 +70,7 @@ public:
 public:
 	TTword(const TTstring &str, WordClass wordClass, int val2);
 	TTword(const TTword *src);
-	~TTword();
+	virtual ~TTword();
 
 	/**
 	 * Delete any following words chained to the word


Commit: 66efdc239c88124296acdcb45427d83793934e91
    https://github.com/scummvm/scummvm/commit/66efdc239c88124296acdcb45427d83793934e91
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:28-04:00

Commit Message:
TITANIC: gcc compilation fixes

Changed paths:
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/view_item.cpp
    engines/titanic/pet_control/pet_slider.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/support/font.cpp
    engines/titanic/support/string.cpp
    engines/titanic/true_talk/tt_parser.cpp
    engines/titanic/true_talk/tt_quotes.cpp



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 4b24f3e..f6c83b2 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -783,9 +783,9 @@ DEFFN(CDropObjectMsg)
 DEFFN(CDropZoneGotObjectMsg)
 DEFFN(CDropZoneLostObjectMsg)
 DEFFN(CEditControlMsg)
-DEFFN(CEnterNodeMsg);
-DEFFN(CEnterRoomMsg);
-DEFFN(CEnterViewMsg);
+DEFFN(CEnterNodeMsg)
+DEFFN(CEnterRoomMsg)
+DEFFN(CEnterViewMsg)
 DEFFN(CEjectCylinderMsg)
 DEFFN(CErasePhonographCylinderMsg)
 DEFFN(CFrameMsg)
@@ -805,9 +805,9 @@ DEFFN(CIsEarBowlPuzzleDone)
 DEFFN(CIsHookedOnMsg)
 DEFFN(CIsParrotPresentMsg)
 DEFFN(CKeyCharMsg)
-DEFFN(CLeaveNodeMsg);
-DEFFN(CLeaveRoomMsg);
-DEFFN(CLeaveViewMsg);
+DEFFN(CLeaveNodeMsg)
+DEFFN(CLeaveRoomMsg)
+DEFFN(CLeaveViewMsg)
 DEFFN(CLemonFallsFromTreeMsg)
 DEFFN(CLightsMsg)
 DEFFN(CLoadSuccessMsg)
@@ -868,9 +868,9 @@ DEFFN(CPhonographRecordMsg)
 DEFFN(CPhonographStopMsg)
 DEFFN(CPlayRangeMsg)
 DEFFN(CPlayerTriesRestaurantTableMsg)
-DEFFN(CPreEnterNodeMsg);
-DEFFN(CPreEnterRoomMsg);
-DEFFN(CPreEnterViewMsg);
+DEFFN(CPreEnterNodeMsg)
+DEFFN(CPreEnterRoomMsg)
+DEFFN(CPreEnterViewMsg)
 DEFFN(CPreSaveMsg)
 DEFFN(CProdMaitreDMsg)
 DEFFN(CPumpingMsg)
@@ -900,7 +900,7 @@ DEFFN(CSetChevLiftBits)
 DEFFN(CSetChevPanelBitMsg)
 DEFFN(CSetChevPanelButtonsMsg)
 DEFFN(CSetChevRoomBits)
-DEFFN(CSetFrameMsg);
+DEFFN(CSetFrameMsg)
 DEFFN(CSetMusicControlsMsg)
 DEFFN(CSetVarMsg)
 DEFFN(CSetVolumeMsg)
@@ -998,7 +998,7 @@ DEFFN(CMusicPlayer)
 DEFFN(CNodeAutoSoundPlayer)
 DEFFN(CRestrictedAutoMusicPlayer)
 DEFFN(CRoomAutoSoundPlayer)
-DEFFN(CRoomTriggerAutoMusicPlayer);
+DEFFN(CRoomTriggerAutoMusicPlayer)
 DEFFN(CSeasonNoises)
 DEFFN(CSeasonalMusicPlayer)
 DEFFN(CTitaniaSpeech)
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 07c0142..8faf100 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -38,7 +38,7 @@ BEGIN_MESSAGE_MAP(CViewItem, CNamedItem)
 END_MESSAGE_MAP()
 
 CViewItem::CViewItem() : CNamedItem() {
-	Common::fill(&_buttonUpTargets[0], &_buttonUpTargets[4], nullptr);
+	Common::fill(&_buttonUpTargets[0], &_buttonUpTargets[4], (CTreeItem *)nullptr);
 	_field24 = 0;
 	_field28 = 0.0;
 	_viewNumber = 0;
diff --git a/engines/titanic/pet_control/pet_slider.h b/engines/titanic/pet_control/pet_slider.h
index 93390a5..0bc9e82 100644
--- a/engines/titanic/pet_control/pet_slider.h
+++ b/engines/titanic/pet_control/pet_slider.h
@@ -80,6 +80,7 @@ protected:
 	bool containsPt(const Point &pt) const { return _bounds.contains(pt); }
 public:
 	CPetSlider();
+	virtual ~CPetSlider() {}
 
 	/**
 	 * Setup the background
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index a8d9ba6..f87b037 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -404,7 +404,7 @@ bool CPetText::handleKey(char c) {
 		return true;
 
 	default:
-		if (c >= 32 && c <= 127)
+		if ((byte)c >= 32 && (byte)c <= 127)
 			appendText(CString(c, 1));
 		break;
 	}
diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index c960e2f..f4466de 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -112,7 +112,7 @@ int STFont::stringWidth(const CString &text) const {
 	const char *srcP = text.c_str();
 	int total = 0;
 	char c;
-	while (c = *srcP++) {
+	while (c = (*srcP++)) {
 		if (c == 26) {
 			// Skip over command parameter bytes
 			srcP += 3;
@@ -265,7 +265,7 @@ void STFont::checkLineWrap(Point &textSize, int maxWidth, const char *&str) cons
 		else if (*srcPtr == TEXTCMD_SET_COLOR)
 			srcPtr += 4;
 		else
-			totalWidth += _chars[*srcPtr]._width;
+			totalWidth += _chars[(byte)*srcPtr]._width;
 	}
 	
 	if ((textSize.x + totalWidth) >= maxWidth && totalWidth < maxWidth) {
diff --git a/engines/titanic/support/string.cpp b/engines/titanic/support/string.cpp
index 86dc0be..d85fcfc 100644
--- a/engines/titanic/support/string.cpp
+++ b/engines/titanic/support/string.cpp
@@ -32,9 +32,7 @@ CString::CString(char c, uint32 len) : Common::String() {
 }
 
 CString::CString(int val) : Common::String() {
-	char buffer[16];
-	itoa(val, buffer, 10);
-	*this += buffer;
+	*this = CString::format("%d", val);
 }
 
 CString CString::left(uint count) const {
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 3014eba..1d9c199 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -476,7 +476,6 @@ const NumberEntry *TTparser::replaceNumbers2(TTstring &line, int *startIndex) {
 }
 
 int TTparser::findFrames(TTsentence *sentence) {
-	static bool flag;
 	_sentenceConcept = &sentence->_sentenceConcept;
 	_sentence = sentence;
 
@@ -1428,10 +1427,10 @@ int TTparser::checkForAction() {
 	}
 
 	// Handle any remaining words
-	TTword *reqWord = nullptr;
 	while (_currentWordP) {
-		if (considerRequests(_currentWordP) > 1) {
-			reqWord = _currentWordP;
+		int result = considerRequests(_currentWordP);
+		if (result > 1) {
+			status = result;
 		} else {
 			// Delete the top of the word chain
 			TTword *wordP = _currentWordP;
diff --git a/engines/titanic/true_talk/tt_quotes.cpp b/engines/titanic/true_talk/tt_quotes.cpp
index 856cba9..7b98558 100644
--- a/engines/titanic/true_talk/tt_quotes.cpp
+++ b/engines/titanic/true_talk/tt_quotes.cpp
@@ -63,7 +63,7 @@ void TTquotes::load(const CString &name) {
 	// Read in buffer and then decode it
 	r->read((byte *)_dataP, _dataSize);
 	for (size_t idx = 0; idx < _dataSize; idx += 4)
-		WRITE_LE_UINT32((byte *)_dataP + idx, READ_LE_UINT32((byte *)_dataP + idx) ^ 0xA55A5AA5);
+		WRITE_LE_UINT32((byte *)_dataP + idx, READ_LE_UINT32((const byte *)_dataP + idx) ^ 0xA55A5AA5);
 
 	delete r;
 }


Commit: 02b3526e297e38984eeb99c98b5c020f3a57da9e
    https://github.com/scummvm/scummvm/commit/02b3526e297e38984eeb99c98b5c020f3a57da9e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:31-04:00

Commit Message:
TITANIC: gcc compilation fixes

Changed paths:
    engines/titanic/true_talk/tt_quotes.h



diff --git a/engines/titanic/true_talk/tt_quotes.h b/engines/titanic/true_talk/tt_quotes.h
index f67216c..4e7d0d3 100644
--- a/engines/titanic/true_talk/tt_quotes.h
+++ b/engines/titanic/true_talk/tt_quotes.h
@@ -45,7 +45,7 @@ class TTquotes {
 private:
 	TTquotesLetter _alphabet[26];
 	uint _array[256];
-	const char *_dataP;
+	char *_dataP;
 	size_t _dataSize;
 	int _field544;
 private:


Commit: 764cfcb6d6ccad3046c9d96788b3edd5857f1c79
    https://github.com/scummvm/scummvm/commit/764cfcb6d6ccad3046c9d96788b3edd5857f1c79
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:45-04:00

Commit Message:
TITANIC: gcc compilation fixes

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp
    engines/titanic/core/game_object.cpp
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/support/font.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 4999ee3..b8d3565 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -50,7 +50,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x340
+#define HEADER_SIZE 0x380
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -309,6 +309,47 @@ void writeNumbers() {
 	dataOffset += size;
 }
 
+void writeResponseTree() {
+	const int FILE_DIFF = 0x401C00;
+	outputFile.seek(dataOffset);
+	
+	inputFile.seek(0x619500 - FILE_DIFF);
+	char buffer[32];
+	inputFile.read(buffer, 32);
+	if (strcmp(buffer, "ReadInt(): No number to read")) {
+		printf("Could not find tree data at expected position\n");
+		exit(1);
+	}
+
+	for (int idx = 0; idx < 1022; ++idx) {
+		inputFile.seek(0x619520 - FILE_DIFF + idx * 8);
+		uint id = inputFile.readLong();
+		uint offset = inputFile.readLong();
+
+		outputFile.writeLong(id);
+		if (!id) {
+			// An end of list id
+		} else if (offset >= 0x619520 && offset <= 0x61B510) {
+			// Offset to another table
+			outputFile.writeByte(0);
+			outputFile.writeLong((offset - 0x619520) / 8);
+		} else {
+			// Offset to ASCIIZ string
+			outputFile.writeByte(1);
+			inputFile.seek(offset - FILE_DIFF);
+			char c;
+			do {
+				c = inputFile.readByte();
+				outputFile.writeByte(c);
+			} while (c);
+		}
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader("TEXT/TREE", dataOffset, size);
+	dataOffset += size;
+}
+
 void writeHeader() {
 	// Write out magic string
 	const char *MAGIC_STR = "SVTN";
@@ -337,6 +378,8 @@ void writeData() {
 	writeResource("STFONT", 152);
 	writeResource("STFONT", 153);
 
+	writeResource("STARFIELD", 132);
+
 	writeResource("TEXT", "STVOCAB.TXT");
 	writeResource("TEXT", "JRQUOTES.TXT");
 	writeResource("TEXT", 155);
@@ -351,6 +394,7 @@ void writeData() {
 	writeStringArray("TEXT/REPLACEMENTS2", 0x21C120, 1576);
 	writeStringArray("TEXT/REPLACEMENTS3", 0x21D9C8, 82);
 	writeStringArray("TEXT/PRONOUNS", 0x22F718, 15);
+	writeResponseTree();
 
 	writeNumbers();
 	writeAllScriptResponses();
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index eaf1dfe..624a4b0 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -237,6 +237,8 @@ void CGameObject::loadResource(const CString &name) {
 	case FILETYPE_MOVIE:
 		loadMovie(name);
 		break;
+	default:
+		break;
 	}
 }
 
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 85bac6a..51631a3 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -495,7 +495,7 @@ void CPetControl::summonNPC(const CString &name, int val) {
 
 void CPetControl::startPetTimer(uint timerIndex, uint firstDuration, uint duration, void *target) {
 	stopPetTimer(timerIndex);
-	_timers[timerIndex]._id = (timerIndex, firstDuration, duration);
+	_timers[timerIndex]._id = addTimer(timerIndex, firstDuration, duration);
 	_timers[timerIndex]._target = target;
 	setTimer44(_timers[timerIndex]._id, 0);
 }
diff --git a/engines/titanic/support/font.cpp b/engines/titanic/support/font.cpp
index f4466de..07e4c28 100644
--- a/engines/titanic/support/font.cpp
+++ b/engines/titanic/support/font.cpp
@@ -112,7 +112,7 @@ int STFont::stringWidth(const CString &text) const {
 	const char *srcP = text.c_str();
 	int total = 0;
 	char c;
-	while (c = (*srcP++)) {
+	while ((c = *srcP++)) {
 		if (c == 26) {
 			// Skip over command parameter bytes
 			srcP += 3;
@@ -120,7 +120,7 @@ int STFont::stringWidth(const CString &text) const {
 			// Skip over command parameter bytes
 			srcP += 4;
 		} else if (c != '\n') {
-			total += _chars[c]._width;
+			total += _chars[(byte)c]._width;
 		}
 	}
 
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 15ff530..7362d4d 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -210,7 +210,7 @@ public:
 	 * Sets the value for an NPC's dial
 	 */
 	virtual void setDial(int dialNum, int value);
-	
+
 	/**
 	 * Returns a dial's region number
 	 */


Commit: 6c4eff4dfcb883df81d415bb57377da7bf239cc1
    https://github.com/scummvm/scummvm/commit/6c4eff4dfcb883df81d415bb57377da7bf239cc1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:56-04:00

Commit Message:
TITANIC: Fix loading of JRQUOTES

Changed paths:
    engines/titanic/pet_control/pet_inventory_glyphs.cpp
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/tt_quotes.cpp
    engines/titanic/true_talk/tt_quotes.h



diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
index 6ce130f..b793c1a 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
@@ -111,8 +111,10 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
 		break;
 
 	default:
-		return ITEM_MODES[itemIndex];
+		break;
 	}
+
+	return ITEM_MODES[itemIndex];
 }
 
 int CPetInventoryGlyph::subMode(CGameObject *item, int val) {
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index a5a1edc..555d0e6 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -49,7 +49,7 @@ CTrueTalkManager::CTrueTalkManager(CGameManager *owner) :
 		_gameManager(owner), _scripts(&_titleEngine), _currentCharId(0),
 		_dialogueFile(nullptr), _dialogueId(0) {
 	_titleEngine.setup(3, 3);
-	_quotes.load("TEXT/JRQuotes.txt");
+	_quotes.load("TEXT/JRQUOTES.TXT");
 	_currentNPC = nullptr;
 	g_vm->_trueTalkManager = this;
 }
diff --git a/engines/titanic/true_talk/tt_quotes.cpp b/engines/titanic/true_talk/tt_quotes.cpp
index 7b98558..8e9978b 100644
--- a/engines/titanic/true_talk/tt_quotes.cpp
+++ b/engines/titanic/true_talk/tt_quotes.cpp
@@ -27,7 +27,7 @@
 namespace Titanic {
 
 TTquotes::TTquotes() {
-	Common::fill(&_array[0], &_array[256], 0);
+	Common::fill(&_tags[0], &_tags[256], 0);
 	_dataP = nullptr;
 	_dataSize = 0;
 	_field544 = 0;
@@ -38,14 +38,14 @@ TTquotes::~TTquotes() {
 }
 
 void TTquotes::load(const CString &name) {
-	Common::SeekableReadStream *r = g_vm->_filesManager->getResource("TEXT/JRQuotes.txt");
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
 	size_t size = r->readUint32LE();
 
 	_dataSize = _field544 = size;
 	_dataP = new char[size + 0x10];
 
 	for (int idx = 0; idx < 256; ++idx)
-		_array[idx] = r->readUint32LE();
+		_tags[idx] = r->readUint32LE();
 
 	for (int charIdx = 0; charIdx < 26; ++charIdx) {
 		TTquotesLetter &letter = _alphabet[charIdx];
diff --git a/engines/titanic/true_talk/tt_quotes.h b/engines/titanic/true_talk/tt_quotes.h
index 4e7d0d3..db10526 100644
--- a/engines/titanic/true_talk/tt_quotes.h
+++ b/engines/titanic/true_talk/tt_quotes.h
@@ -44,7 +44,7 @@ class TTquotes {
 	};
 private:
 	TTquotesLetter _alphabet[26];
-	uint _array[256];
+	uint _tags[256];
 	char *_dataP;
 	size_t _dataSize;
 	int _field544;


Commit: 253cf2f57457d430236a4d972a1d6295511c21fa
    https://github.com/scummvm/scummvm/commit/253cf2f57457d430236a4d972a1d6295511c21fa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:19:59-04:00

Commit Message:
TITANIC: Fix startup crash when creating NPC scripts

Changed paths:
    engines/titanic/true_talk/tt_npc_script.cpp



diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 337b367..86494e8 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -83,7 +83,7 @@ void TTnpcScript::load(const char *name, int valuesPerResponse) {
 }
 
 void TTnpcScript::resetFlags() {
-	Common::fill(&_array[20], &_array[140], 0);
+	Common::fill(&_array[20], &_array[136], 0);
 	_field2CC = false;
 }
 


Commit: 51226842c8f63ffa65c397906ad7aed9dd3d9ca9
    https://github.com/scummvm/scummvm/commit/51226842c8f63ffa65c397906ad7aed9dd3d9ca9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:02-04:00

Commit Message:
TITANIC: Start of new TTvocabTree class; added load method

Changed paths:
  A engines/titanic/true_talk/tt_quotes_tree.cpp
  A engines/titanic/true_talk/tt_quotes_tree.h
    engines/titanic/module.mk
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/true_talk_manager.h
    engines/titanic/true_talk/tt_quotes.cpp
    engines/titanic/true_talk/tt_quotes.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 2b604ec..2879713 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -472,6 +472,7 @@ MODULE_OBJS := \
 	true_talk/tt_picture.o \
 	true_talk/tt_pronoun.o \
 	true_talk/tt_quotes.o \
+	true_talk/tt_quotes_tree.o \
 	true_talk/tt_response.o \
 	true_talk/tt_room_script.o \
 	true_talk/tt_script_base.o \
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 555d0e6..91e6c9e 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -49,7 +49,9 @@ CTrueTalkManager::CTrueTalkManager(CGameManager *owner) :
 		_gameManager(owner), _scripts(&_titleEngine), _currentCharId(0),
 		_dialogueFile(nullptr), _dialogueId(0) {
 	_titleEngine.setup(3, 3);
-	_quotes.load("TEXT/JRQUOTES.TXT");
+	_quotes.load();
+	_quotesTree.load();
+
 	_currentNPC = nullptr;
 	g_vm->_trueTalkManager = this;
 }
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 754a995..ad378af 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -28,6 +28,7 @@
 #include "titanic/true_talk/dialogue_file.h"
 #include "titanic/true_talk/title_engine.h"
 #include "titanic/true_talk/tt_quotes.h"
+#include "titanic/true_talk/tt_quotes_tree.h"
 #include "titanic/true_talk/tt_scripts.h"
 #include "titanic/true_talk/tt_talker.h"
 
@@ -131,6 +132,7 @@ public:
 	static void setFlags(int index, int val);
 public:
 	TTquotes _quotes;
+	TTquotesTree _quotesTree;
 public:
 	/**
 	 * Get a specified state value from the currently set NPC
diff --git a/engines/titanic/true_talk/tt_quotes.cpp b/engines/titanic/true_talk/tt_quotes.cpp
index 8e9978b..a2afa1a 100644
--- a/engines/titanic/true_talk/tt_quotes.cpp
+++ b/engines/titanic/true_talk/tt_quotes.cpp
@@ -37,8 +37,8 @@ TTquotes::~TTquotes() {
 	delete[] _dataP;
 }
 
-void TTquotes::load(const CString &name) {
-	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+void TTquotes::load() {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource("TEXT/JRQUOTES.TXT");
 	size_t size = r->readUint32LE();
 
 	_dataSize = _field544 = size;
@@ -106,7 +106,6 @@ int TTquotes::read(const char *startP, const char *endP) {
 		return 0;
 
 	int maxSize = size + 4;
-	bool letterFlag = index != 25;
 
 	for (uint idx = 0; idx < letter._entries.size(); ++idx) {
 		const TTquotesEntry &entry = letter._entries[idx];
@@ -115,7 +114,7 @@ int TTquotes::read(const char *startP, const char *endP) {
 
 		const char *srcP = startP;
 		const char *destP = entry._strP;
-		int srcIndex = 0, destIndex = 0;
+		int srcIndex = index != 25 ? 1 : 0, destIndex = 0;
 		if (*destP) {
 			do {
 				if (!srcP[srcIndex]) {
diff --git a/engines/titanic/true_talk/tt_quotes.h b/engines/titanic/true_talk/tt_quotes.h
index db10526..a90c70e 100644
--- a/engines/titanic/true_talk/tt_quotes.h
+++ b/engines/titanic/true_talk/tt_quotes.h
@@ -59,9 +59,9 @@ public:
 	~TTquotes();
 
 	/**
-	 * Load quotes from the specified resource
+	 * Load quotes data resource
 	 */
-	void load(const CString &name);
+	void load();
 
 	/**
 	 * Test whether a passed string contains one of the quotes,
diff --git a/engines/titanic/true_talk/tt_quotes_tree.cpp b/engines/titanic/true_talk/tt_quotes_tree.cpp
new file mode 100644
index 0000000..0f10a10
--- /dev/null
+++ b/engines/titanic/true_talk/tt_quotes_tree.cpp
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/algorithm.h"
+#include "titanic/true_talk/tt_quotes_tree.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+/**
+ * Specifies the starting index for each of the three main trees
+ */
+static uint TABLE_INDEXES[3] = { 922, 1015, 1018 };
+
+void TTquotesTree::load() {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource("TEXT/TREE");
+	
+	for (int idx = 0; idx < QUOTES_TREE_COUNT; ++idx) {
+		TTquotesTree::TTquotesTreeEntry &rec = _entries[idx];
+		assert(r->pos() < r->size());
+		
+		rec._id = r->readUint32LE();		
+		if (rec._id == 0) {
+			rec._type = ET_END;
+		} else {
+			byte type = r->readByte();
+			if (type == 0) {
+				// Index to sub-table
+				rec._subTable = &_entries[0] + r->readUint32LE();
+			} else {
+				// Read in string for entry
+				char c;
+				while ((c = r->readByte()) != '\0')
+					rec._string += c;
+			}
+		}
+	}
+
+	assert(r->pos() == r->size());
+	delete r;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_quotes_tree.h b/engines/titanic/true_talk/tt_quotes_tree.h
new file mode 100644
index 0000000..9496fa8
--- /dev/null
+++ b/engines/titanic/true_talk/tt_quotes_tree.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_QUOTES_TREE_H
+#define TITANIC_TT_QUOTES_TREE_H
+
+#include "common/scummsys.h"
+#include "common/stream.h"
+#include "titanic/support/string.h"
+
+namespace Titanic {
+
+#define QUOTES_TREE_COUNT 1022
+
+enum TreeEntryType { ET_END = 0, ET_TABLE = 1, ET_STRING = 2 };
+
+class TTquotesTree {
+	struct TTquotesTreeEntry {
+		uint _id;
+		TreeEntryType _type;
+		TTquotesTreeEntry *_subTable;
+		CString _string;
+
+		TTquotesTreeEntry() : _id(0), _type(ET_END), _subTable(nullptr) {}
+	};
+private:
+	TTquotesTreeEntry _entries[QUOTES_TREE_COUNT];
+public:
+	/**
+	 * Load data for the quotes tree
+	 */
+	void load();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_QUOTES_TREE_H */


Commit: bfe075d314f8e9d7010d0f5e60d44bb314e53846
    https://github.com/scummvm/scummvm/commit/bfe075d314f8e9d7010d0f5e60d44bb314e53846
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:05-04:00

Commit Message:
TITANIC: Further fleshing out of TTquotes and TTquotesTree

Changed paths:
    engines/titanic/true_talk/tt_quotes.cpp
    engines/titanic/true_talk/tt_quotes.h
    engines/titanic/true_talk/tt_quotes_tree.cpp
    engines/titanic/true_talk/tt_quotes_tree.h



diff --git a/engines/titanic/true_talk/tt_quotes.cpp b/engines/titanic/true_talk/tt_quotes.cpp
index a2afa1a..1df3c0c 100644
--- a/engines/titanic/true_talk/tt_quotes.cpp
+++ b/engines/titanic/true_talk/tt_quotes.cpp
@@ -54,8 +54,8 @@ void TTquotes::load() {
 		// Load the list of entries for the given letter
 		letter._entries.resize(count);
 		for (int idx = 0; idx < count; ++idx) {
-			letter._entries[idx]._val1 = r->readByte();
-			letter._entries[idx]._val2 = r->readByte();
+			letter._entries[idx]._tagIndex = r->readByte();
+			letter._entries[idx]._maxSize = r->readByte();
 			letter._entries[idx]._strP = _dataP + r->readUint32LE();
 		}
 	}
@@ -109,7 +109,7 @@ int TTquotes::read(const char *startP, const char *endP) {
 
 	for (uint idx = 0; idx < letter._entries.size(); ++idx) {
 		const TTquotesEntry &entry = letter._entries[idx];
-		if (entry._val2 > maxSize)
+		if (entry._maxSize > maxSize)
 			continue;
 
 		const char *srcP = startP;
@@ -135,7 +135,7 @@ int TTquotes::read(const char *startP, const char *endP) {
 
 			if (!destP[destIndex] && (srcP[srcIndex] <= '*' ||
 					(srcP[srcIndex] == 's' && srcP[srcIndex + 1] <= '*')))
-				return entry._val1;
+				return _tags[entry._tagIndex];
 		}
 	}
 
diff --git a/engines/titanic/true_talk/tt_quotes.h b/engines/titanic/true_talk/tt_quotes.h
index a90c70e..1387a1d 100644
--- a/engines/titanic/true_talk/tt_quotes.h
+++ b/engines/titanic/true_talk/tt_quotes.h
@@ -31,9 +31,9 @@ namespace Titanic {
 
 class TTquotes {
 	struct TTquotesEntry {
-		byte _val1, _val2;
+		byte _tagIndex, _maxSize;
 		const char *_strP;
-		TTquotesEntry() : _val1(0), _val2(0), _strP(nullptr) {}
+		TTquotesEntry() : _tagIndex(0), _maxSize(0), _strP(nullptr) {}
 	};
 	struct TTquotesLetter {
 		Common::Array<TTquotesEntry> _entries;
@@ -51,7 +51,7 @@ private:
 private:
 	/**
 	 * Test whether a substring contains one of the quotes,
-	 * and if so, returns the Id associated with it
+	 * and if so, returns the 4-character tag Id associated with it
 	 */
 	int read(const char *startP, const char *endP);
 public:
@@ -65,7 +65,7 @@ public:
 
 	/**
 	 * Test whether a passed string contains one of the quotes,
-	 * and if so, returns the Id associated with it
+	 * and if so, returns the 4-character tag Id associated with it
 	 */
 	int read(const char *str);
 };
diff --git a/engines/titanic/true_talk/tt_quotes_tree.cpp b/engines/titanic/true_talk/tt_quotes_tree.cpp
index 0f10a10..6eee912 100644
--- a/engines/titanic/true_talk/tt_quotes_tree.cpp
+++ b/engines/titanic/true_talk/tt_quotes_tree.cpp
@@ -40,7 +40,7 @@ void TTquotesTree::load() {
 		
 		rec._id = r->readUint32LE();		
 		if (rec._id == 0) {
-			rec._type = ET_END;
+			// Nothing needed
 		} else {
 			byte type = r->readByte();
 			if (type == 0) {
@@ -59,4 +59,76 @@ void TTquotesTree::load() {
 	delete r;
 }
 
+void TTquotesTree::search(const char **str, TTquotesTreeEntry *bTree,
+		TTtreeBuffer *buffer, int quoteId) {
+	buffer->_strP = nullptr;
+	(buffer + 1)->_strP = nullptr;
+
+	bool flag = false;
+	for (uint mode = bTree->_id >> 24; mode != 0; 
+			++bTree, mode = bTree->_id >> 24) {
+
+		switch (mode) {
+		case 1:
+			if (compareWord(str, bTree->_string.c_str()))
+				flag = true;
+			break;
+		
+		case 2:
+			compareWord(str, bTree->_string.c_str());
+			break;
+		
+		case 5:
+			warning("TODO: TTquotesTree::search");
+			break;
+
+		case 7:
+
+		default:
+			break;
+		}
+
+		if (flag) {
+			// TODO
+			break;
+		}
+	}
+
+}
+
+bool TTquotesTree::compareWord(const char **str, const char *refStr) {
+	// Skip over any spaces
+	const char *strP = *str;
+	while (*strP && *strP == ' ')
+		++strP;
+	*str = strP;
+
+	// Compare against the reference string
+	while (*strP && *refStr && *refStr != '*') {
+		if (*refStr == '-') {
+			if (*strP == ' ')
+				++strP;
+		} else if (*strP == *refStr) {
+			++strP;
+		} else {
+			return false;
+		}
+	}
+
+	if (*refStr && *refStr != '*')
+		return false;
+	if (!*refStr && *strP && *strP != ' ')
+		return false;
+
+	if (*refStr == '*') {
+		// Skip over to the end of the word
+		while (*strP && *strP != ' ')
+			++strP;
+	}
+
+	// Pass out the new updated string position
+	*str = strP;
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_quotes_tree.h b/engines/titanic/true_talk/tt_quotes_tree.h
index 9496fa8..fb7d262 100644
--- a/engines/titanic/true_talk/tt_quotes_tree.h
+++ b/engines/titanic/true_talk/tt_quotes_tree.h
@@ -31,24 +31,41 @@ namespace Titanic {
 
 #define QUOTES_TREE_COUNT 1022
 
-enum TreeEntryType { ET_END = 0, ET_TABLE = 1, ET_STRING = 2 };
+class TTtreeBuffer {
+public:
+	int _field0;
+	const char *_strP;
+public:
+	TTtreeBuffer() : _field0(0), _strP(nullptr) {}
+};
 
 class TTquotesTree {
 	struct TTquotesTreeEntry {
 		uint _id;
-		TreeEntryType _type;
 		TTquotesTreeEntry *_subTable;
 		CString _string;
 
-		TTquotesTreeEntry() : _id(0), _type(ET_END), _subTable(nullptr) {}
+		TTquotesTreeEntry() : _id(0), _subTable(nullptr) {}
 	};
 private:
 	TTquotesTreeEntry _entries[QUOTES_TREE_COUNT];
+private:
+	/**
+	 * Inner search method
+	 */
+	void search(const char **str, TTquotesTreeEntry *bTree, TTtreeBuffer *buffer,
+		int quoteId);
+
+	/**
+	 * Compare the current word in the string against a specified word
+	 */
+	bool compareWord(const char **str, const char *refStr);
 public:
 	/**
 	 * Load data for the quotes tree
 	 */
 	void load();
+
 };
 
 } // End of namespace Titanic


Commit: 289856dce3868de36c985f1df94ce3d1f3bff99b
    https://github.com/scummvm/scummvm/commit/289856dce3868de36c985f1df94ce3d1f3bff99b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:08-04:00

Commit Message:
TITANIC: Finished TTquotesTree search methods

Changed paths:
    engines/titanic/true_talk/tt_quotes.cpp
    engines/titanic/true_talk/tt_quotes.h
    engines/titanic/true_talk/tt_quotes_tree.cpp
    engines/titanic/true_talk/tt_quotes_tree.h



diff --git a/engines/titanic/true_talk/tt_quotes.cpp b/engines/titanic/true_talk/tt_quotes.cpp
index 1df3c0c..825210a 100644
--- a/engines/titanic/true_talk/tt_quotes.cpp
+++ b/engines/titanic/true_talk/tt_quotes.cpp
@@ -68,7 +68,7 @@ void TTquotes::load() {
 	delete r;
 }
 
-int TTquotes::read(const char *str) {
+int TTquotes::find(const char *str) {
 	if (!str || !*str)
 		return 0;
 
@@ -78,9 +78,9 @@ int TTquotes::read(const char *str) {
 		++endP;
 
 	do {
-		int result = read(startP, endP);
-		if (result)
-			return result;
+		int tagId = find(startP, endP);
+		if (tagId)
+			return tagId;
 
 		// Move to next following space or end of string
 		while (*startP && *startP != ' ')
@@ -91,10 +91,11 @@ int TTquotes::read(const char *str) {
 
 	} while (*startP);
 
+	// No match
 	return 0;
 }
 
-int TTquotes::read(const char *startP, const char *endP) {
+int TTquotes::find(const char *startP, const char *endP) {
 	int size = endP - startP;
 	if (size < 3)
 		return 0;
diff --git a/engines/titanic/true_talk/tt_quotes.h b/engines/titanic/true_talk/tt_quotes.h
index 1387a1d..c6627dc 100644
--- a/engines/titanic/true_talk/tt_quotes.h
+++ b/engines/titanic/true_talk/tt_quotes.h
@@ -53,7 +53,7 @@ private:
 	 * Test whether a substring contains one of the quotes,
 	 * and if so, returns the 4-character tag Id associated with it
 	 */
-	int read(const char *startP, const char *endP);
+	int find(const char *startP, const char *endP);
 public:
 	TTquotes();
 	~TTquotes();
@@ -67,7 +67,7 @@ public:
 	 * Test whether a passed string contains one of the quotes,
 	 * and if so, returns the 4-character tag Id associated with it
 	 */
-	int read(const char *str);
+	int find(const char *str);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_quotes_tree.cpp b/engines/titanic/true_talk/tt_quotes_tree.cpp
index 6eee912..8641ab9 100644
--- a/engines/titanic/true_talk/tt_quotes_tree.cpp
+++ b/engines/titanic/true_talk/tt_quotes_tree.cpp
@@ -35,7 +35,7 @@ void TTquotesTree::load() {
 	Common::SeekableReadStream *r = g_vm->_filesManager->getResource("TEXT/TREE");
 	
 	for (int idx = 0; idx < QUOTES_TREE_COUNT; ++idx) {
-		TTquotesTree::TTquotesTreeEntry &rec = _entries[idx];
+		TTquotesTreeEntry &rec = _entries[idx];
 		assert(r->pos() < r->size());
 		
 		rec._id = r->readUint32LE();		
@@ -59,12 +59,30 @@ void TTquotesTree::load() {
 	delete r;
 }
 
-void TTquotesTree::search(const char **str, TTquotesTreeEntry *bTree,
-		TTtreeBuffer *buffer, int quoteId) {
-	buffer->_strP = nullptr;
-	(buffer + 1)->_strP = nullptr;
+int TTquotesTree::search(const char *str, QuoteTreeNum treeNum,
+		TTtreeResult *buffer, uint tagId, int *remainder) {
+	const TTquotesTreeEntry *bTree = &_entries[TABLE_INDEXES[treeNum]];
+	if (!search1(&str, bTree, buffer, tagId) || !buffer->_treeItemP)
+		return -1;
+	
+	if (remainder) {
+		while (*str) {
+			if (*str >= 'a' && *str != 's')
+				*remainder += *str;
+		}
+	}
+	
+	return buffer->_treeItemP->_id & 0xffffff;
+}
+
+bool TTquotesTree::search1(const char **str, const TTquotesTreeEntry *bTree,
+		TTtreeResult *buffer, uint tagId) {
+	buffer->_treeItemP = nullptr;
+	(buffer + 1)->_treeItemP = nullptr;
 
+	const char *strP = *str;
 	bool flag = false;
+
 	for (uint mode = bTree->_id >> 24; mode != 0; 
 			++bTree, mode = bTree->_id >> 24) {
 
@@ -79,21 +97,83 @@ void TTquotesTree::search(const char **str, TTquotesTreeEntry *bTree,
 			break;
 		
 		case 5:
-			warning("TODO: TTquotesTree::search");
+			if (READ_LE_UINT32(bTree->_string.c_str()) == tagId)
+				flag = true;
 			break;
 
 		case 7:
+			if (search1(str, bTree->_subTable, buffer + 1, tagId))
+				flag = true;
+			break;
+
+		case 8:
+			if (search2(str, bTree->_subTable, buffer + 1, tagId))
+				flag = true;
+			break;
 
 		default:
 			break;
 		}
 
 		if (flag) {
-			// TODO
+			buffer->_treeItemP = bTree;
+			return true;
+		}
+	}
+
+	*str = strP;
+	return false;
+}
+
+bool TTquotesTree::search2(const char **str, const TTquotesTreeEntry *bTree,
+		TTtreeResult *buffer, uint tagId) {
+	buffer->_treeItemP = bTree;
+	(buffer + 1)->_treeItemP = nullptr;
+
+	const char *strP = *str;
+	bool flag = false;
+	for (uint mode = bTree->_id >> 24; mode != 0;
+			++bTree, mode = bTree->_id >> 24) {
+		switch (mode) {
+		case 0:
+			return true;
+
+		case 1:
+			if (compareWord(str, bTree->_string.c_str()))
+				flag = true;
+			break;
+
+		case 2:
+			compareWord(str, bTree->_string.c_str());
+			break;
+
+		case 5:
+			if (READ_LE_UINT32(bTree->_string.c_str()) == tagId)
+				flag = true;
+			break;
+
+		case 7:
+			if (search1(str, bTree->_subTable, buffer + 1, tagId))
+				flag = true;
 			break;
+
+		case 8:
+			if (search2(str, bTree->_subTable, buffer + 1, tagId))
+				flag = true;
+			break;
+
+		default:
+			break;
+		}
+
+		if (flag) {
+			buffer->_treeItemP = nullptr;
+			*str = strP;
+			return false;
 		}
 	}
 
+	return true;
 }
 
 bool TTquotesTree::compareWord(const char **str, const char *refStr) {
diff --git a/engines/titanic/true_talk/tt_quotes_tree.h b/engines/titanic/true_talk/tt_quotes_tree.h
index fb7d262..fa0e9ed 100644
--- a/engines/titanic/true_talk/tt_quotes_tree.h
+++ b/engines/titanic/true_talk/tt_quotes_tree.h
@@ -31,30 +31,39 @@ namespace Titanic {
 
 #define QUOTES_TREE_COUNT 1022
 
-class TTtreeBuffer {
+enum QuoteTreeNum { TREE_1 = 0, TREE_2 = 1, TREE_3 = 2 };
+
+struct TTquotesTreeEntry {
+	uint _id;
+	TTquotesTreeEntry *_subTable;
+	CString _string;
+
+	TTquotesTreeEntry() : _id(0), _subTable(nullptr) {}
+};
+
+class TTtreeResult {
 public:
-	int _field0;
-	const char *_strP;
+	int _id;
+	const TTquotesTreeEntry *_treeItemP;
 public:
-	TTtreeBuffer() : _field0(0), _strP(nullptr) {}
+	TTtreeResult() : _id(0), _treeItemP(nullptr) {}
 };
 
 class TTquotesTree {
-	struct TTquotesTreeEntry {
-		uint _id;
-		TTquotesTreeEntry *_subTable;
-		CString _string;
-
-		TTquotesTreeEntry() : _id(0), _subTable(nullptr) {}
-	};
 private:
 	TTquotesTreeEntry _entries[QUOTES_TREE_COUNT];
 private:
 	/**
-	 * Inner search method
+	 * First inner search method
+	 */
+	bool search1(const char **str, const TTquotesTreeEntry *bTree,
+		TTtreeResult *buffer, uint tagId);
+
+	/**
+	 * Second inner search method
 	 */
-	void search(const char **str, TTquotesTreeEntry *bTree, TTtreeBuffer *buffer,
-		int quoteId);
+	bool search2(const char **str, const TTquotesTreeEntry *bTree,
+		TTtreeResult *buffer, uint tagId);
 
 	/**
 	 * Compare the current word in the string against a specified word
@@ -66,6 +75,8 @@ public:
 	 */
 	void load();
 
+	int search(const char *str, QuoteTreeNum treeNum,
+		TTtreeResult *buffer, uint tagId, int *remainder);
 };
 
 } // End of namespace Titanic


Commit: 9d92a5a6a468889e39b1b8d4f696fde3769da79c
    https://github.com/scummvm/scummvm/commit/9d92a5a6a468889e39b1b8d4f696fde3769da79c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:11-04:00

Commit Message:
TITANIC: Fleshing out usage of TTscriptArrayItem in TTnpcScript

Changed paths:
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_quotes_tree.cpp
    engines/titanic/true_talk/tt_quotes_tree.h



diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index ce643f5..6edaa14 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -57,7 +57,8 @@ int DeskbotScript::proc15() const {
 	return 0;
 }
 
-bool DeskbotScript::proc16() const {
+bool DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+	int val, uint tagId, uint remainder) const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index a5fb11e..f7a46c9 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -36,7 +36,8 @@ public:
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
-	virtual bool proc16() const;
+	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		int val, uint tagId, uint remainder) const;
 	virtual bool proc17() const;
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 2b248ac..e65d744 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -108,7 +108,8 @@ int DoorbotScript::proc15() const {
 	return 0;
 }
 
-bool DoorbotScript::proc16() const {
+bool DoorbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		int val, uint tagId, uint remainder) const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 72e24db..42fcb19 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -48,7 +48,8 @@ public:
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
-	virtual bool proc16() const;
+	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		int val, uint tagId, uint remainder) const;
 	virtual bool proc17() const;
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 3a64733..6390070 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -84,7 +84,8 @@ int LiftbotScript::proc15() const {
 	return 0;
 }
 
-bool LiftbotScript::proc16() const {
+bool LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		int val, uint tagId, uint remainder) const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 9e2a9ff..b3ab529 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -43,7 +43,9 @@ public:
 	virtual int proc9() const;
 	virtual int proc10() const;
 	virtual int proc15() const;
-	virtual bool proc16() const;
+	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		int val, uint tagId, uint remainder) const;
+
 	virtual bool proc17() const;
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index c417940..b13e059 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -62,7 +62,8 @@ int MaitreDScript::proc10() const {
 	return 0;
 }
 
-bool MaitreDScript::proc16() const {
+bool MaitreDScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		int val, uint tagId, uint remainder) const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 389e388..05c16ec 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -39,7 +39,9 @@ public:
 
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
-	virtual bool proc16() const;
+	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		int val, uint tagId, uint remainder) const;
+
 	virtual bool proc17() const;
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 86494e8..40e95e5 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -40,6 +40,17 @@ int TTnpcScriptResponse::size() const {
 
 /*------------------------------------------------------------------------*/
 
+TTscriptArrayItem::TTscriptArrayItem(uint id, const uint *arrayP, bool flag1, bool flag2) :
+		_id(id), _arrayP(arrayP), _nextP(nullptr) {
+	_flags = 0;
+	if (flag1)
+		_flags |= SF_1;
+	if (flag2)
+		_flags |= SF_2;
+}
+
+/*------------------------------------------------------------------------*/
+
 TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTscriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
@@ -51,9 +62,8 @@ TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
 TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
-		_subPtr(nullptr), _entriesP(nullptr), _entryCount(0), _field68(0),
-		_field6C(0), _field70(0), _field74(0), _field78(0),
-		_field7C(0), _field80(0), _field2CC(false) {
+		_entriesP(nullptr), _entryCount(0), _field68(0), _field6C(0), _field70(0),
+		_field74(0), _field78(0), _field7C(0), _field80(0), _field2CC(false) {
 	CTrueTalkManager::_v2 = 0;
 	Common::fill(&_dialValues[0], &_dialValues[DIALS_ARRAY_COUNT], 0);
 	Common::fill(&_array[0], &_array[136], 0);
@@ -136,7 +146,6 @@ int TTnpcScript::proc12() const {
 	return 1;
 }
 
-
 bool TTnpcScript::loadQuotes() {
 	// Original did a load of a global quotes here the first time
 	// this method is called. ScummVM implementation has refactored
@@ -160,7 +169,8 @@ int TTnpcScript::proc15() const {
 	return 0;
 }
 
-bool TTnpcScript::proc16() const {
+bool TTnpcScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		int val, uint tagId, uint remainder) const {
 	return true;
 }
 
@@ -240,8 +250,14 @@ void TTnpcScript::saveBody(SimpleFile *file) {
 	int v = proc31();
 	file->writeNumber(v);
 
-	if (v > 0 && _subPtr) {
-		warning("TODO");
+	if (v > 0) {
+		for (uint idx = 0; idx < _arrayItems.size(); ++idx) {
+			const TTscriptArrayItem &item = _arrayItems[idx];
+			if (item._flags == SF_1 && item._val) {
+				file->writeNumber(item._id);
+				file->writeNumber(item._val);
+			}
+		}
 	}
 }
 
@@ -252,15 +268,25 @@ void TTnpcScript::loadBody(SimpleFile *file) {
 	for (int index = 0; index < count; index += 2) {
 		int v = file->readNumber();
 
-		if (_subPtr) {
-			error("TODO - %d", v);
+		for (uint idx = 0; idx < _arrayItems.size(); ++idx) {
+			TTscriptArrayItem &item = _arrayItems[idx];
+			if (!item._id) {
+				item._id = v;
+				break;
+			}
 		}
 	}
 }
 
-int TTnpcScript::proc31() {
-	warning("TODO");
-	return 0;
+int TTnpcScript::proc31() const {
+	int count = 0;
+	for (uint idx = 0; idx < _arrayItems.size(); ++idx) {
+		const TTscriptArrayItem &item = _arrayItems[idx];
+		if (item._flags != SF_1 && item._val)
+			++count;
+	}
+
+	return count * 2;
 }
 
 void TTnpcScript::setDialRegion(int dialNum, int region) {
@@ -325,9 +351,8 @@ uint TTnpcScript::translateId(uint id) const {
 }
 
 void TTnpcScript::preLoad() {
-	if (_subPtr) {
-		error("TODO");
-	}
+	for (uint idx = 0; idx < _arrayItems.size(); ++idx)
+		_arrayItems[idx]._val = 0;
 }
 
 int TTnpcScript::getRoom54(int roomId) {
@@ -535,4 +560,34 @@ int TTnpcScript::processSentence(const TTsentenceEntries *entries, uint entryCou
 	return 1;
 }
 
+bool TTnpcScript::defaultProcess(TTroomScript *roomScript, TTsentence *sentence) {
+	uint remainder;
+	TTtreeResult results[32];
+	const TTstring &line = sentence->_normalizedLine;
+
+	uint tagId = g_vm->_trueTalkManager->_quotes.find(line.c_str());
+	int val = g_vm->_trueTalkManager->_quotesTree.search(line.c_str(), TREE_1, results, tagId, &remainder);
+
+	if (val > 0) {
+		if (!handleQuote(roomScript, sentence, val, tagId, remainder))
+			return true;
+	}
+
+	// TODO
+	return false;
+}
+
+void TTnpcScript::addArrayItem(uint id, const uint *arrayP, bool flag1, bool flag2) {
+	_arrayItems.push_back(TTscriptArrayItem(id, arrayP, flag1, flag2));
+}
+
+TTscriptArrayItem *TTnpcScript::findArrayItem(uint id) {
+	for (uint idx = 0; idx < _arrayItems.size(); ++idx) {
+		if (_arrayItems[idx]._id == id)
+			return &_arrayItems[idx];
+	}
+
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 7362d4d..2dd721e 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -30,6 +30,8 @@ namespace Titanic {
 
 #define DIALS_ARRAY_COUNT 10
 
+enum ScriptArrayFlag { SF_1 = 1, SF_2 = 2 };
+
 class CGameManager;
 class CPetControl;
 class TTroomScript;
@@ -47,6 +49,18 @@ struct TTnpcScriptResponse {
 	int size() const;
 };
 
+struct TTscriptArrayItem {
+	uint _id;
+	const uint *_arrayP;
+	TTscriptArrayItem *_nextP;
+	uint _val;
+	int _flags;
+
+	TTscriptArrayItem() : _id(0), _arrayP(nullptr), _nextP(nullptr),
+		_val(0), _flags(0) {}
+	TTscriptArrayItem(uint id, const uint *arrayP, bool flag1, bool flag2);
+};
+
 class TTnpcScriptBase : public TTscriptBase {
 protected:
 	int _field54;
@@ -84,7 +98,7 @@ private:
 protected:
 	Common::Array<TTnpcScriptResponse> _responses;
 	int _valuesPerResponse;
-	byte *_subPtr;
+	Common::Array<TTscriptArrayItem> _arrayItems;
 	const TTsentenceEntries *_entriesP;
 	int _entryCount;
 	int _field68;
@@ -139,7 +153,19 @@ protected:
 	 */
 	static CPetControl *getPetControl(CGameManager *gameManager);
 
+	/**
+	 * Adds a new item to the entries list
+	 */
+	void addArrayItem(uint id, const uint *arrayP, bool flag1, bool flag2);
+
+	/**
+	 * Finds an array item by Id
+	 */
+	TTscriptArrayItem *findArrayItem(uint id);
+
 	int processSentence(const TTsentenceEntries *entries, uint entryCount, TTroomScript *roomScript, TTsentence *sentence);
+
+	bool defaultProcess(TTroomScript *roomScript, TTsentence *sentence);
 public:
 	TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,
@@ -184,7 +210,8 @@ public:
 	virtual void selectResponse(int id);
 	
 	virtual int proc15() const;
-	virtual bool proc16() const;
+	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		int val, uint tagId, uint remainder) const;
 	virtual bool proc17() const;
 	virtual bool proc18() const;
 	virtual uint proc19(uint v);
@@ -199,7 +226,7 @@ public:
 	virtual void load(SimpleFile *file);
 	virtual void saveBody(SimpleFile *file);
 	virtual void loadBody(SimpleFile *file);
-	virtual int proc31();
+	virtual int proc31() const;
 
 	/**
 	 * Sets a given dial to be pointing in a specified region (0 to 2)
diff --git a/engines/titanic/true_talk/tt_quotes_tree.cpp b/engines/titanic/true_talk/tt_quotes_tree.cpp
index 8641ab9..1f073b8 100644
--- a/engines/titanic/true_talk/tt_quotes_tree.cpp
+++ b/engines/titanic/true_talk/tt_quotes_tree.cpp
@@ -60,7 +60,7 @@ void TTquotesTree::load() {
 }
 
 int TTquotesTree::search(const char *str, QuoteTreeNum treeNum,
-		TTtreeResult *buffer, uint tagId, int *remainder) {
+		TTtreeResult *buffer, uint tagId, uint *remainder) {
 	const TTquotesTreeEntry *bTree = &_entries[TABLE_INDEXES[treeNum]];
 	if (!search1(&str, bTree, buffer, tagId) || !buffer->_treeItemP)
 		return -1;
diff --git a/engines/titanic/true_talk/tt_quotes_tree.h b/engines/titanic/true_talk/tt_quotes_tree.h
index fa0e9ed..d7ca798 100644
--- a/engines/titanic/true_talk/tt_quotes_tree.h
+++ b/engines/titanic/true_talk/tt_quotes_tree.h
@@ -76,7 +76,7 @@ public:
 	void load();
 
 	int search(const char *str, QuoteTreeNum treeNum,
-		TTtreeResult *buffer, uint tagId, int *remainder);
+		TTtreeResult *buffer, uint tagId, uint *remainder);
 };
 
 } // End of namespace Titanic


Commit: a05173568253455ba05763865f5e8869bd36d7f0
    https://github.com/scummvm/scummvm/commit/a05173568253455ba05763865f5e8869bd36d7f0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:14-04:00

Commit Message:
TITANIC: Added TTnpcScript getRangeValue

Changed paths:
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 40e95e5..c3f0509 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -40,13 +40,14 @@ int TTnpcScriptResponse::size() const {
 
 /*------------------------------------------------------------------------*/
 
-TTscriptArrayItem::TTscriptArrayItem(uint id, const uint *arrayP, bool flag1, bool flag2) :
+TTscriptRange::TTscriptRange(uint id, const uint *arrayP, bool isRandom,
+		bool isSequential) :
 		_id(id), _arrayP(arrayP), _nextP(nullptr) {
-	_flags = 0;
-	if (flag1)
-		_flags |= SF_1;
-	if (flag2)
-		_flags |= SF_2;
+	_mode = SF_NONE;
+	if (isRandom)
+		_mode = SF_RANDOM;
+	if (isSequential)
+		_mode = SF_SEQUENTIAL;
 }
 
 /*------------------------------------------------------------------------*/
@@ -62,7 +63,7 @@ TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
 TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
-		_entriesP(nullptr), _entryCount(0), _field68(0), _field6C(0), _field70(0),
+		_entriesP(nullptr), _entryCount(0), _field68(0), _field6C(0), _rangeResetCtr(0),
 		_field74(0), _field78(0), _field7C(0), _field80(0), _field2CC(false) {
 	CTrueTalkManager::_v2 = 0;
 	Common::fill(&_dialValues[0], &_dialValues[DIALS_ARRAY_COUNT], 0);
@@ -182,9 +183,48 @@ bool TTnpcScript::proc18() const {
 	return true;
 }
 
-uint TTnpcScript::proc19(uint v) {
-	warning("TODO");
-	return 0;
+uint TTnpcScript::getRangeValue(uint id) {
+	TTscriptRange *range = findRange(id);
+	if (!range)
+		return 0;
+
+	switch (range->_mode) {
+	case SF_RANDOM: {
+		uint count = 0;
+		for (const uint *p = range->_arrayP; *p; ++p)
+			++count;
+
+		uint index = getRandomNumber(count) - 1;
+		if (count > 1 && range->_arrayP[index] == range->_priorIndex) {
+			for (int retry = 0; retry < 8 && index != range->_priorIndex; ++retry)
+				index = getRandomNumber(count) - 1;
+		}
+
+		range->_priorIndex = index;
+		return range->_arrayP[index];
+	}
+
+	case SF_SEQUENTIAL: {
+		// Get the next value from the array sequentially
+		int val = range->_arrayP[range->_priorIndex];
+		if (!val) {
+			// Reached end of array, so reset back to start
+			range->_priorIndex = 1;
+			val = range->_arrayP[1];
+		}
+
+		++range->_priorIndex;
+		return val;
+	}
+
+	default:
+		if (range->_arrayP[range->_priorIndex])
+			return range->_arrayP[range->_priorIndex++];
+		
+		range->_priorIndex = 1;
+		++_rangeResetCtr;
+		return range->_arrayP[0];
+	}
 }
 
 void TTnpcScript::proc20(int v) {
@@ -216,7 +256,7 @@ void TTnpcScript::save(SimpleFile *file) {
 	saveBody(file);
 
 	file->writeNumber(4);
-	file->writeNumber(_field70);
+	file->writeNumber(_rangeResetCtr);
 	file->writeNumber(_field74);
 	file->writeNumber(_field78);
 	file->writeNumber(_field7C);
@@ -230,7 +270,7 @@ void TTnpcScript::load(SimpleFile *file) {
 	loadBody(file);
 
 	int count = file->readNumber();
-	_field70 = file->readNumber();
+	_rangeResetCtr = file->readNumber();
 	_field74 = file->readNumber();
 	_field78 = file->readNumber();
 	_field7C = file->readNumber();
@@ -251,11 +291,11 @@ void TTnpcScript::saveBody(SimpleFile *file) {
 	file->writeNumber(v);
 
 	if (v > 0) {
-		for (uint idx = 0; idx < _arrayItems.size(); ++idx) {
-			const TTscriptArrayItem &item = _arrayItems[idx];
-			if (item._flags == SF_1 && item._val) {
+		for (uint idx = 0; idx < _ranges.size(); ++idx) {
+			const TTscriptRange &item = _ranges[idx];
+			if (item._mode == SF_RANDOM && item._priorIndex) {
 				file->writeNumber(item._id);
-				file->writeNumber(item._val);
+				file->writeNumber(item._priorIndex);
 			}
 		}
 	}
@@ -268,8 +308,8 @@ void TTnpcScript::loadBody(SimpleFile *file) {
 	for (int index = 0; index < count; index += 2) {
 		int v = file->readNumber();
 
-		for (uint idx = 0; idx < _arrayItems.size(); ++idx) {
-			TTscriptArrayItem &item = _arrayItems[idx];
+		for (uint idx = 0; idx < _ranges.size(); ++idx) {
+			TTscriptRange &item = _ranges[idx];
 			if (!item._id) {
 				item._id = v;
 				break;
@@ -280,9 +320,9 @@ void TTnpcScript::loadBody(SimpleFile *file) {
 
 int TTnpcScript::proc31() const {
 	int count = 0;
-	for (uint idx = 0; idx < _arrayItems.size(); ++idx) {
-		const TTscriptArrayItem &item = _arrayItems[idx];
-		if (item._flags != SF_1 && item._val)
+	for (uint idx = 0; idx < _ranges.size(); ++idx) {
+		const TTscriptRange &item = _ranges[idx];
+		if (item._mode != SF_RANDOM && item._priorIndex)
 			++count;
 	}
 
@@ -351,8 +391,8 @@ uint TTnpcScript::translateId(uint id) const {
 }
 
 void TTnpcScript::preLoad() {
-	for (uint idx = 0; idx < _arrayItems.size(); ++idx)
-		_arrayItems[idx]._val = 0;
+	for (uint idx = 0; idx < _ranges.size(); ++idx)
+		_ranges[idx]._priorIndex = 0;
 }
 
 int TTnpcScript::getRoom54(int roomId) {
@@ -434,9 +474,9 @@ uint TTnpcScript::getDialogueId(uint tagId) {
 	}
 
 	uint oldTagId = tagId;
-	tagId = proc19(tagId);
+	tagId = getRangeValue(tagId);
 	if (tagId != oldTagId)
-		tagId = proc19(tagId);
+		tagId = getRangeValue(tagId);
 
 	oldTagId = proc23();
 	int v21 = proc21(origId, tagId, oldTagId);
@@ -577,14 +617,14 @@ bool TTnpcScript::defaultProcess(TTroomScript *roomScript, TTsentence *sentence)
 	return false;
 }
 
-void TTnpcScript::addArrayItem(uint id, const uint *arrayP, bool flag1, bool flag2) {
-	_arrayItems.push_back(TTscriptArrayItem(id, arrayP, flag1, flag2));
+void TTnpcScript::addRange(uint id, const uint *arrayP, bool isRandom, bool isSequential) {
+	_ranges.push_back(TTscriptRange(id, arrayP, isRandom, isSequential));
 }
 
-TTscriptArrayItem *TTnpcScript::findArrayItem(uint id) {
-	for (uint idx = 0; idx < _arrayItems.size(); ++idx) {
-		if (_arrayItems[idx]._id == id)
-			return &_arrayItems[idx];
+TTscriptRange *TTnpcScript::findRange(uint id) {
+	for (uint idx = 0; idx < _ranges.size(); ++idx) {
+		if (_ranges[idx]._id == id)
+			return &_ranges[idx];
 	}
 
 	return nullptr;
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 2dd721e..1c7446a 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 #define DIALS_ARRAY_COUNT 10
 
-enum ScriptArrayFlag { SF_1 = 1, SF_2 = 2 };
+enum ScriptArrayFlag { SF_NONE = 0, SF_RANDOM = 1, SF_SEQUENTIAL = 2 };
 
 class CGameManager;
 class CPetControl;
@@ -49,16 +49,17 @@ struct TTnpcScriptResponse {
 	int size() const;
 };
 
-struct TTscriptArrayItem {
+struct TTscriptRange {
 	uint _id;
 	const uint *_arrayP;
-	TTscriptArrayItem *_nextP;
-	uint _val;
-	int _flags;
-
-	TTscriptArrayItem() : _id(0), _arrayP(nullptr), _nextP(nullptr),
-		_val(0), _flags(0) {}
-	TTscriptArrayItem(uint id, const uint *arrayP, bool flag1, bool flag2);
+	TTscriptRange *_nextP;
+	uint _priorIndex;
+	ScriptArrayFlag _mode;
+
+	TTscriptRange() : _id(0), _arrayP(nullptr), _nextP(nullptr),
+		_priorIndex(0), _mode(SF_NONE) {}
+	TTscriptRange(uint id, const uint *arrayP, bool isRandom, 
+		bool isSequential);
 };
 
 class TTnpcScriptBase : public TTscriptBase {
@@ -98,12 +99,12 @@ private:
 protected:
 	Common::Array<TTnpcScriptResponse> _responses;
 	int _valuesPerResponse;
-	Common::Array<TTscriptArrayItem> _arrayItems;
+	Common::Array<TTscriptRange> _ranges;
 	const TTsentenceEntries *_entriesP;
 	int _entryCount;
 	int _field68;
 	int _field6C;
-	int _field70;
+	int _rangeResetCtr;
 	int _field74;
 	int _field78;
 	int _field7C;
@@ -154,14 +155,14 @@ protected:
 	static CPetControl *getPetControl(CGameManager *gameManager);
 
 	/**
-	 * Adds a new item to the entries list
+	 * Adds a new item to the list of number ranges
 	 */
-	void addArrayItem(uint id, const uint *arrayP, bool flag1, bool flag2);
+	void addRange(uint id, const uint *arrayP, bool isRandom, bool isSequential);
 
 	/**
-	 * Finds an array item by Id
+	 * Finds an entry in the list of prevoiusly registered number ranges
 	 */
-	TTscriptArrayItem *findArrayItem(uint id);
+	TTscriptRange *findRange(uint id);
 
 	int processSentence(const TTsentenceEntries *entries, uint entryCount, TTroomScript *roomScript, TTsentence *sentence);
 
@@ -214,7 +215,14 @@ public:
 		int val, uint tagId, uint remainder) const;
 	virtual bool proc17() const;
 	virtual bool proc18() const;
-	virtual uint proc19(uint v);
+
+	/**
+	 * Given an Id for a previously registered set of random number values,
+	 * picks one of the array values and returns it.. depending on flags,
+	 * either a random value, or each value in turn
+	 */
+	virtual uint getRangeValue(uint id);
+	
 	virtual void proc20(int v);
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;


Commit: b76a6e2fb4bbb74e4fa8c340a3d515553980f940
    https://github.com/scummvm/scummvm/commit/b76a6e2fb4bbb74e4fa8c340a3d515553980f940
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:17-04:00

Commit Message:
TITANIC: Added TTnpcScript setupDials

Changed paths:
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 1da2726..828d606 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -35,7 +35,7 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	CTrueTalkManager::setFlags(40, 0);
 	CTrueTalkManager::setFlags(26, 0);
 
-	randomizeFlags();
+	setupDials(0, 0, 0);
 	_array[0] = 100;
 	_array[1] = 0;
 
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 6edaa14..4149199 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -35,7 +35,7 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 	CTrueTalkManager::setFlags(21, 0);
 	CTrueTalkManager::setFlags(22, 0);
 
-	randomizeFlags();
+	setupDials(0, 0, 0);
 	_array[0] = 100;
 	if (_field74 == 1)
 		_field74 = 0;
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index c3f0509..e31be05 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -98,8 +98,15 @@ void TTnpcScript::resetFlags() {
 	_field2CC = false;
 }
 
-void TTnpcScript::randomizeFlags() {
-	warning("TODO");
+void TTnpcScript::setupDials(int dial1, int dial2, int dial3) {
+	_dialValues[0] = dial1;
+	_dialValues[1] = dial2;
+	_dialValues[2] = dial3;
+	_field74 = getRandomNumber(3) - 1;
+	_field78 = getRandomNumber(5) + 6;
+
+	if (_dialValues[0] > 70)
+		_field78 = -_field78;
 }
 
 void TTnpcScript::proc4(int v) {
@@ -613,7 +620,11 @@ bool TTnpcScript::defaultProcess(TTroomScript *roomScript, TTsentence *sentence)
 			return true;
 	}
 
-	// TODO
+	if (tagId) {
+		if (chooseResponse(roomScript, sentence, tagId) == 2)
+			return true;
+	}
+
 	return false;
 }
 
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 1c7446a..c76e385 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -123,7 +123,10 @@ protected:
 	 */
 	void resetFlags();
 
-	void randomizeFlags();
+	/**
+	 * Setup dials
+	 */
+	void setupDials(int dial1, int dial2, int dial3);
 
 	static int getRoom54(int roomId);
 


Commit: 6792fd92b7101c9c85656ff914bafcb3e30a176a
    https://github.com/scummvm/scummvm/commit/6792fd92b7101c9c85656ff914bafcb3e30a176a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:20-04:00

Commit Message:
TITANIC: Renamings for script setupRanges

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index d6768fc..9d4bdf6 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -117,7 +117,7 @@ bool BarbotScript::proc16() const {
 	return false;
 }
 
-bool BarbotScript::proc17() const {
+bool BarbotScript::setupRanges() {
 	warning("TODO");
 	return false;
 }
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 99dfac8..38f6ecd 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -48,7 +48,12 @@ public:
 	virtual int proc10() const;
 	virtual int proc15() const;
 	virtual bool proc16() const;
-	virtual bool proc17() const;
+	
+	/**
+	 * Setup range sets
+	 */
+	virtual bool setupRanges();
+	
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 828d606..d40de3d 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -61,7 +61,7 @@ bool BellbotScript::proc16() const {
 	return 0;
 }
 
-bool BellbotScript::proc17() const {
+bool BellbotScript::setupRanges() {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 3c23716..72b6a84 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -42,7 +42,12 @@ public:
 	virtual int proc10() const;
 	virtual int proc15() const;
 	virtual bool proc16() const;
-	virtual bool proc17() const;
+
+	/**
+	 * Setup range sets
+	 */
+	virtual bool setupRanges();
+
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 4149199..28a211b 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -63,7 +63,7 @@ bool DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return 0;
 }
 
-bool DeskbotScript::proc17() const {
+bool DeskbotScript::setupRanges() {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index f7a46c9..2fd5945 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -38,7 +38,12 @@ public:
 	virtual int proc15() const;
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
-	virtual bool proc17() const;
+
+	/**
+	 * Setup range sets
+	 */
+	virtual bool setupRanges();
+
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index e65d744..b76f7ac 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -114,7 +114,7 @@ bool DoorbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return 0;
 }
 
-bool DoorbotScript::proc17() const {
+bool DoorbotScript::setupRanges() {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 42fcb19..05f0048 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -50,7 +50,12 @@ public:
 	virtual int proc15() const;
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
-	virtual bool proc17() const;
+
+	/**
+	 * Setup range sets
+	 */
+	virtual bool setupRanges();
+
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 6390070..9ba80a6 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -90,7 +90,7 @@ bool LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return 0;
 }
 
-bool LiftbotScript::proc17() const {
+bool LiftbotScript::setupRanges() {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index b3ab529..ddbe92b 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -46,7 +46,11 @@ public:
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
-	virtual bool proc17() const;
+	/**
+	 * Setup range sets
+	 */
+	virtual bool setupRanges();
+
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index b13e059..bdfd505 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -68,7 +68,7 @@ bool MaitreDScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return 0;
 }
 
-bool MaitreDScript::proc17() const {
+bool MaitreDScript::setupRanges() {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 05c16ec..c2d146e 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -42,7 +42,11 @@ public:
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
-	virtual bool proc17() const;
+	/**
+	 * Setup range sets
+	 */
+	virtual bool setupRanges();
+
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index a889187..93312bb 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -44,7 +44,7 @@ int ParrotScript::proc10() const {
 	return 0;
 }
 
-bool ParrotScript::proc17() const {
+bool ParrotScript::setupRanges() {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index 3cf804d..dd8ed96 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -40,7 +40,12 @@ public:
 
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
-	virtual bool proc17() const;
+
+	/**
+	 * Setup range sets
+	 */
+	virtual bool setupRanges();
+
 	virtual bool proc18() const;
 	virtual int proc23() const;
 	virtual const int *getTablePtr(int id);
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index b52a02a..fcd0fcf 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -67,7 +67,7 @@ int SuccUBusScript::proc10() const {
 	return 0;
 }
 
-bool SuccUBusScript::proc17() const {
+bool SuccUBusScript::setupRanges() {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index e9263db..4a9166f 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -43,7 +43,12 @@ public:
 
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
-	virtual bool proc17() const;
+
+	/**
+	 * Setup range sets
+	 */
+	virtual bool setupRanges();
+
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index c76e385..dadea17 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -62,6 +62,13 @@ struct TTscriptRange {
 		bool isSequential);
 };
 
+struct TTscriptRangeInit {
+	uint id;
+	uint *_array;
+	bool _isRandom;
+	bool _isSequential;
+};
+
 class TTnpcScriptBase : public TTscriptBase {
 protected:
 	int _field54;


Commit: 59c033e68f09f323601f17892dfa2a270c8f8a00
    https://github.com/scummvm/scummvm/commit/59c033e68f09f323601f17892dfa2a270c8f8a00
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:23-04:00

Commit Message:
DEVTOOLS: Start of script ranges addition to create_titanic

Changed paths:
  A devtools/create_titanic/script_ranges.cpp
  A devtools/create_titanic/script_ranges.h
    devtools/create_titanic/create_titanic_dat.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index b8d3565..03d0552 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -37,6 +37,7 @@
 #include "winexe_pe.h"
 #include "file.h"
 #include "script_responses.h"
+#include "script_ranges.h"
 
 /**
  * Format of the access.dat file that will be created:
@@ -398,6 +399,7 @@ void writeData() {
 
 	writeNumbers();
 	writeAllScriptResponses();
+	writeAllScriptRanges();
 }
 
 // Support method used for translating IDA debugger's output for
diff --git a/devtools/create_titanic/script_ranges.cpp b/devtools/create_titanic/script_ranges.cpp
new file mode 100644
index 0000000..94c5d76
--- /dev/null
+++ b/devtools/create_titanic/script_ranges.cpp
@@ -0,0 +1,235 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+ // Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+// HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
+#include "file.h"
+#include "script_ranges.h"
+
+static uint BARBOT_RANGE1[] = { 250062, 250064, 250065, 250066, 250067, 250068, 250069, 250070, 250071, 250063, 0 };
+static uint BARBOT_RANGE2[] = { 250200, 250201, 250202, 250203, 250204, 250205, 250206, 250207, 0 };
+static uint BARBOT_RANGE3[] = { 250160, 250161, 250162, 250163, 0 };
+static uint BARBOT_RANGE4[] = { 250175, 250176, 250177, 250178, 250179, 250180, 250181, 250182, 250183, 0 };
+static uint BARBOT_RANGE5[] = { 250114, 250004, 0 };
+static uint BARBOT_RANGE6[] = { 250042, 250009, 250010, 250011, 251692, 251693, 251694, 0 };
+static uint BARBOT_RANGE7[] = { 250012, 250111, 0 };
+static uint BARBOT_RANGE8[] = { 250013, 250119, 0 };
+static uint BARBOT_RANGE9[] = { 250027, 250126, 250055, 0 };
+static uint BARBOT_RANGE10[] = { 250032, 250130, 0 };
+static uint BARBOT_RANGE11[] = { 250038, 250134, 0 };
+static uint BARBOT_RANGE12[] = { 250039, 250135, 250050, 0 };
+static uint BARBOT_RANGE13[] = { 250016, 250120, 250136, 250145, 250143, 0 };
+static uint BARBOT_RANGE14[] = { 250040, 250138, 250139, 0 };
+static uint BARBOT_RANGE15[] = { 250037, 250133, 250617, 0 };
+static uint BARBOT_RANGE16[] = { 250031, 250129, 0 };
+static uint BARBOT_RANGE17[] = { 250036, 250132, 0 };
+static uint BARBOT_RANGE18[] = { 250035, 250137, 0 };
+static uint BARBOT_RANGE19[] = { 250021, 250123, 0 };
+static uint BARBOT_RANGE20[] = { 250006, 250117, 0 };
+static uint BARBOT_RANGE21[] = { 250024, 250124, 0 };
+static uint BARBOT_RANGE22[] = { 250002, 250113, 0 };
+static uint BARBOT_RANGE23[] = { 250152, 250153, 250079, 250194, 250149, 250151, 250150,
+250208, 250209, 250157, 250195, 250076, 250156, 250074,
+250075, 250080, 250192, 250109, 250159, 250110, 250148,
+250053, 250155, 250197, 250072, 250077, 250001, 250154,
+250196, 250198, 250199, 250158, 250073, 0 };
+static uint BARBOT_RANGE24[] = { 251831, 251832, 251833, 251834, 251835, 250617, 0 };
+static uint BARBOT_RANGE25[] = { 250033, 251838, 0 };
+static uint BARBOT_RANGE26[] = { 250014, 251827, 251781, 250617, 0 };
+static uint BARBOT_RANGE27[] = { 251855, 251856, 0 };
+static uint BARBOT_RANGE28[] = { 251852, 251853, 0 };
+static uint BARBOT_RANGE29[] = { 251250, 251261, 251272, 251277, 251278, 251279, 251280,
+251281, 251282, 251251, 251252, 251253, 251254, 251255,
+251256, 251257, 251258, 251259, 251260, 251262, 251263,
+251264, 251265, 251266, 251267, 251268, 251269, 251270,
+251271, 251273, 251274, 251275, 251276, 0 };
+static uint BARBOT_RANGE30[] = { 251283, 251284, 251285, 251286, 0 };
+static uint BARBOT_RANGE31[] = { 250527, 250530, 250531, 250532, 250533, 250534, 250535,
+250536, 250537, 250528, 250529, 0 };
+static uint BARBOT_RANGE32[] = { 250593, 250594, 0 };
+static uint BARBOT_RANGE33[] = { 250263, 250264, 250265, 250266, 0 };
+static uint BARBOT_RANGE34[] = { 250227, 250228, 250229, 250230, 0 };
+static uint BARBOT_RANGE35[] = { 250239, 250240, 250241, 250242, 250243, 0 };
+static uint BARBOT_RANGE36[] = { 250507, 250222, 250678, 250588, 0 };
+static uint BARBOT_RANGE37[] = { 250365, 250366, 250367, 250368, 0 };
+static uint BARBOT_RANGE38[] = { 250936, 250937, 250938, 0 };
+static uint BARBOT_RANGE39[] = { 250610, 250611, 0 };
+static uint BARBOT_RANGE40[] = { 250082, 250093, 250102, 250104, 250105, 250106, 250107,
+250108, 250091, 250092, 250094, 250095, 250096, 250097,
+250098, 250099, 250100, 250101, 251700, 251701, 251702,
+251703, 251704, 251862, 250617, 250268, 250272, 0 };
+static uint BARBOT_RANGE41[] = { 250584, 250585, 0 };
+static uint BARBOT_RANGE42[] = { 250579, 251142, 0 };
+static uint BARBOT_RANGE43[] = { 250577, 250578, 0 };
+static uint BARBOT_RANGE44[] = { 250244, 250245, 250246, 250247, 250248, 250249, 250250,
+250251, 250252, 250253, 250254, 250255, 250256, 250257,
+250258, 250259, 250260, 250261, 250262, 0 };
+static uint BARBOT_RANGE45[] = { 250286, 250288, 250289, 250290, 250291, 250292, 250293,
+250294, 250295, 250287, 0 };
+static uint BARBOT_RANGE46[] = { 250296, 250299, 250300, 250301, 250302, 250303, 250304,
+250305, 250306, 250297, 250298, 0 };
+static uint BARBOT_RANGE47[] = { 250307, 250309, 250310, 250311, 250312, 250313, 250314,
+250315, 250316, 0 };
+static uint BARBOT_RANGE48[] = { 251682, 251683, 251684, 251685, 251686, 251687, 251688,
+251689, 250756, 250757, 250758, 250759, 0 };
+static uint BARBOT_RANGE49[] = { 250738, 250742, 250743, 250744, 250745, 250746, 250747,
+250748, 250749, 250739, 250740, 250741, 0 };
+static uint BARBOT_RANGE50[] = { 250659, 250660, 250661, 250379, 0 };
+static uint BARBOT_RANGE51[] = { 251761, 251762, 251763, 251764, 0 };
+static uint BARBOT_RANGE52[] = { 251754, 251755, 251756, 251757, 251758, 251759, 0 };
+static uint BARBOT_RANGE53[] = { 250482, 250504, 250424, 250463, 250466, 250467, 250468,
+250478, 250501, 250502, 250503, 250506, 250413, 251014,
+250614, 250756, 250758, 250759, 250223, 250737, 250658,
+251027, 250633, 250935, 250237, 251618, 0 };
+static uint BARBOT_RANGE54[] = { 250504, 250434, 250436, 250466, 250467, 250468, 250469,
+250470, 250472, 250501, 250502, 250503, 250505, 250413,
+251681, 250756, 250758, 250759, 250223, 251027, 250633,
+250935, 250237, 251618, 250371, 0 };
+static uint BARBOT_RANGE55[] = { 250952, 250953, 0 };
+static uint BARBOT_RANGE56[] = { 251777, 250951, 0 };
+static uint BARBOT_RANGE57[] = { 251871, 251877, 251878, 251879, 251880, 251883, 251884,
+251872, 251873, 0 };
+static uint BARBOT_RANGE58[] = { 250228, 250236, 250258, 250259, 250378, 250465, 250536,
+251016, 251048, 251068, 0 };
+static uint BARBOT_RANGE59[] = { 250141, 250378, 251048, 0 };
+static uint BARBOT_RANGE60[] = { 251621, 251622, 251623, 251624, 251625, 251626, 0 };
+static uint BARBOT_RANGE61[] = { 251650, 251651, 0 };
+static uint BARBOT_RANGE62[] = { 251305, 251306, 251307, 251308, 0 };
+static uint BARBOT_RANGE63[] = { 251836, 251890, 251891, 251892, 0 };
+static uint BARBOT_RANGE64[] = { 250760, 251246, 251156, 251335, 251510, 251059, 251097,
+251136, 250374, 250375, 250376, 250377, 251015, 251016,
+251017, 251018, 0 };
+static uint BARBOT_RANGE65[] = { 250899, 250906, 250948, 250713, 250690, 0 };
+static uint BARBOT_RANGE66[] = { 250906, 250948, 250713, 250899, 250690, 0 };
+static uint BARBOT_RANGE67[] = { 250949, 250713, 250711, 250152, 250153, 250690, 250906, 0 };
+static uint BARBOT_RANGE68[] = { 251815, 250711, 0 };
+static uint BARBOT_RANGE69[] = { 251829, 250711, 0 };
+static uint BARBOT_RANGE70[] = { 251779, 250712, 0 };
+
+#define BARBOT_RANGE_COUNT 70
+static ScriptRange BARBOT_RANGES[70] = {
+	{ 250062, BARBOT_RANGE1, false, false },
+	{ 250200, BARBOT_RANGE2, false, false },
+	{ 250160, BARBOT_RANGE3, false, false },
+	{ 250175, BARBOT_RANGE4, false, false },
+	{ 250004, BARBOT_RANGE5, false, false },
+	{ 250042, BARBOT_RANGE6, true, false },
+	{ 250012, BARBOT_RANGE7, false, false },
+	{ 250013, BARBOT_RANGE8, false, false },
+	{ 250027, BARBOT_RANGE9, false, false },
+	{ 250032, BARBOT_RANGE10, false, false },
+	{ 250038, BARBOT_RANGE11, false, false },
+	{ 250039, BARBOT_RANGE12, false, false },
+	{ 250016, BARBOT_RANGE13, false, false },
+	{ 250040, BARBOT_RANGE14, false, false },
+	{ 250037, BARBOT_RANGE15, false, false },
+	{ 250031, BARBOT_RANGE16, false, false },
+	{ 250036, BARBOT_RANGE17, false, false },
+	{ 250035, BARBOT_RANGE18, false, false },
+	{ 250021, BARBOT_RANGE19, false, false },
+	{ 250006, BARBOT_RANGE20, false, false },
+
+	{ 250024, BARBOT_RANGE21, false, false },
+	{ 250002, BARBOT_RANGE22, false, false },
+	{ 250210, BARBOT_RANGE23, false, false },
+	{ 251831, BARBOT_RANGE24, false, false },
+	{ 250033, BARBOT_RANGE25, false, false },
+	{ 250014, BARBOT_RANGE26, false, false },
+	{ 251855, BARBOT_RANGE27, false, false },
+	{ 251852, BARBOT_RANGE28, false, false },
+	{ 251250, BARBOT_RANGE29, false, false },
+	{ 251283, BARBOT_RANGE30, false, false },
+	{ 250527, BARBOT_RANGE31, false, false },
+	{ 250593, BARBOT_RANGE32, false, false },
+	{ 250263, BARBOT_RANGE33, false, false },
+	{ 250227, BARBOT_RANGE34, false, false },
+	{ 250239, BARBOT_RANGE35, false, false },
+	{ 250507, BARBOT_RANGE36, false, false },
+	{ 250365, BARBOT_RANGE37, false, false },
+	{ 250936, BARBOT_RANGE38, false, false },
+	{ 250610, BARBOT_RANGE39, false, false },
+	{ 250082, BARBOT_RANGE40, true, false },
+
+	{ 250584, BARBOT_RANGE41, false, false },
+	{ 250579, BARBOT_RANGE42, false, false },
+	{ 250577, BARBOT_RANGE43, false, false },
+	{ 250244, BARBOT_RANGE44, true, false },
+	{ 250286, BARBOT_RANGE45, true, false },
+	{ 250296, BARBOT_RANGE46, true, false },
+	{ 250307, BARBOT_RANGE47, true, false },
+	{ 251682, BARBOT_RANGE48, true, false },
+	{ 250738, BARBOT_RANGE49, true, false },
+	{ 250659, BARBOT_RANGE50, true, false },
+	{ 251761, BARBOT_RANGE51, false, false },
+	{ 251754, BARBOT_RANGE52, false, false },
+	{ 251896, BARBOT_RANGE53, true, false },
+	{ 251897, BARBOT_RANGE54, true, false },
+	{ 250952, BARBOT_RANGE55, false, false },
+	{ 251777, BARBOT_RANGE56, false, false },
+	{ 251871, BARBOT_RANGE57, true, false },
+	{ 250140, BARBOT_RANGE58, true, false },
+	{ 250141, BARBOT_RANGE59, false, false },
+	{ 251621, BARBOT_RANGE60, false, false },
+
+	{ 251650, BARBOT_RANGE61, false, false },
+	{ 251305, BARBOT_RANGE62, false, false },
+	{ 251836, BARBOT_RANGE63, false, false },
+	{ 251018, BARBOT_RANGE64, true, false },
+	{ 250899, BARBOT_RANGE65, false, false },
+	{ 250899, BARBOT_RANGE66, false, false },
+	{ 251899, BARBOT_RANGE67, false, false },
+	{ 251815, BARBOT_RANGE68, false, false },
+	{ 251829, BARBOT_RANGE69, false, false },
+	{ 251779, BARBOT_RANGE70 }
+};
+
+
+void writeScriptRange(const char *name, const ScriptRange *ranges, int count) {
+	outputFile.seek(dataOffset);
+
+	for (int idx = 0; idx < count; ++idx) {
+		outputFile.writeLong(ranges[idx]._id);
+		outputFile.writeByte(ranges[idx]._isRandom);
+		outputFile.writeByte(ranges[idx]._isSequential);
+
+		const uint *v = ranges[idx]._array;
+		do {
+			outputFile.writeLong(*v);
+		} while (*v++ != 0);
+	}
+	outputFile.writeLong(0);
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader(name, dataOffset, size);
+	dataOffset += size;
+}
+
+void writeAllScriptRanges() {
+	writeScriptRange("Ranges/Barbot", BARBOT_RANGES, 70);
+}
\ No newline at end of file
diff --git a/devtools/create_titanic/script_ranges.h b/devtools/create_titanic/script_ranges.h
new file mode 100644
index 0000000..70caac1
--- /dev/null
+++ b/devtools/create_titanic/script_ranges.h
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef COMMON_SCRIPT_RANGES_H
+#define COMMON_SCRIPT_RANGES_H
+
+#include "common/scummsys.h"
+
+struct ScriptRange {
+	uint _id;
+	uint *_array;
+	bool _isRandom;
+	bool _isSequential;
+};
+
+extern void writeAllScriptRanges();
+extern void writeEntryHeader(const char *name, uint offset, uint size);
+extern uint dataOffset;
+
+#endif


Commit: c660bbf1416410dbb3a985300b8c037f7f30eab3
    https://github.com/scummvm/scummvm/commit/c660bbf1416410dbb3a985300b8c037f7f30eab3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:27-04:00

Commit Message:
TITANIC: Beginnings of loading NPC range data

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 9d4bdf6..2a67a7b 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -33,7 +33,8 @@ BarbotScript::BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
 	_state = 0;
-	load("Responses/Barbot");
+	loadRanges("Ranges/Barbot");
+	loadResponses("Responses/Barbot");
 }
 
 int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index d40de3d..a02ef14 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -39,7 +39,7 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	_array[0] = 100;
 	_array[1] = 0;
 
-	load("Responses/Bellbot", 4);
+	loadResponses("Responses/Bellbot", 4);
 }
 
 void BellbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 28a211b..85b59b0 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -40,7 +40,7 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 	if (_field74 == 1)
 		_field74 = 0;
 
-	load("Responses/Deskbot", 4);
+	loadResponses("Responses/Deskbot", 4);
 }
 
 void DeskbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index b76f7ac..7d291b6 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -35,7 +35,7 @@ DoorbotScript::DoorbotScript(int val1, const char *charClass, int v2,
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
 	Common::fill(&_array[0], &_array[148], 0);
 	_state = 0;
-	load("Responses/Doorbot");
+	loadResponses("Responses/Doorbot");
 }
 
 int DoorbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 9ba80a6..5a63a51 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -33,7 +33,7 @@ LiftbotScript::LiftbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
 	_state = 0;
-	load("Responses/Liftbot");
+	loadResponses("Responses/Liftbot");
 }
 
 int LiftbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index bdfd505..7bd19c4 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -38,7 +38,7 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
 	CTrueTalkManager::setFlags(15, 0);
 	CTrueTalkManager::setFlags(16, 0);
 
-	load("Responses/MaitreD");
+	loadResponses("Responses/MaitreD");
 }
 
 int MaitreDScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index e31be05..19ff05d 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -40,14 +40,17 @@ int TTnpcScriptResponse::size() const {
 
 /*------------------------------------------------------------------------*/
 
-TTscriptRange::TTscriptRange(uint id, const uint *arrayP, bool isRandom,
-		bool isSequential) :
-		_id(id), _arrayP(arrayP), _nextP(nullptr) {
+TTscriptRange::TTscriptRange(uint id, const Common::Array<uint> &values, 
+		bool isRandom, bool isSequential) :
+		_id(id), _nextP(nullptr) {
 	_mode = SF_NONE;
 	if (isRandom)
 		_mode = SF_RANDOM;
 	if (isSequential)
 		_mode = SF_SEQUENTIAL;
+
+	for (uint idx = 0; idx < values.size(); ++idx)
+		_values.push_back(values[idx]);
 }
 
 /*------------------------------------------------------------------------*/
@@ -77,7 +80,7 @@ TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 	resetFlags();
 }
 
-void TTnpcScript::load(const char *name, int valuesPerResponse) {
+void TTnpcScript::loadResponses(const char *name, int valuesPerResponse) {
 	_valuesPerResponse = valuesPerResponse;
 	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
 
@@ -93,6 +96,27 @@ void TTnpcScript::load(const char *name, int valuesPerResponse) {
 	delete r;
 }
 
+void TTnpcScript::loadRanges(const char *name) {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+
+	while (r->pos() < r->size()) {
+		Common::Array<uint> values;
+		uint id = r->readUint32LE();
+		bool isRandom = r->readByte();
+		bool isSequential = r->readByte();
+
+		uint v;
+		do {
+			v = r->readUint32LE();
+			values.push_back(v);
+		} while (v);
+
+		addRange(id, values, isRandom, isSequential);
+	}
+
+	delete r;
+}
+
 void TTnpcScript::resetFlags() {
 	Common::fill(&_array[20], &_array[136], 0);
 	_field2CC = false;
@@ -197,27 +221,25 @@ uint TTnpcScript::getRangeValue(uint id) {
 
 	switch (range->_mode) {
 	case SF_RANDOM: {
-		uint count = 0;
-		for (const uint *p = range->_arrayP; *p; ++p)
-			++count;
+		uint count = range->_values.size();
 
 		uint index = getRandomNumber(count) - 1;
-		if (count > 1 && range->_arrayP[index] == range->_priorIndex) {
+		if (count > 1 && range->_values[index] == range->_priorIndex) {
 			for (int retry = 0; retry < 8 && index != range->_priorIndex; ++retry)
 				index = getRandomNumber(count) - 1;
 		}
 
 		range->_priorIndex = index;
-		return range->_arrayP[index];
+		return range->_values[index];
 	}
 
 	case SF_SEQUENTIAL: {
 		// Get the next value from the array sequentially
-		int val = range->_arrayP[range->_priorIndex];
+		int val = range->_values[range->_priorIndex];
 		if (!val) {
 			// Reached end of array, so reset back to start
 			range->_priorIndex = 1;
-			val = range->_arrayP[1];
+			val = range->_values[1];
 		}
 
 		++range->_priorIndex;
@@ -225,12 +247,12 @@ uint TTnpcScript::getRangeValue(uint id) {
 	}
 
 	default:
-		if (range->_arrayP[range->_priorIndex])
-			return range->_arrayP[range->_priorIndex++];
+		if (range->_values[range->_priorIndex])
+			return range->_values[range->_priorIndex++];
 		
 		range->_priorIndex = 1;
 		++_rangeResetCtr;
-		return range->_arrayP[0];
+		return range->_values[0];
 	}
 }
 
@@ -628,8 +650,8 @@ bool TTnpcScript::defaultProcess(TTroomScript *roomScript, TTsentence *sentence)
 	return false;
 }
 
-void TTnpcScript::addRange(uint id, const uint *arrayP, bool isRandom, bool isSequential) {
-	_ranges.push_back(TTscriptRange(id, arrayP, isRandom, isSequential));
+void TTnpcScript::addRange(uint id, const Common::Array<uint> &values, bool isRandom, bool isSequential) {
+	_ranges.push_back(TTscriptRange(id, values, isRandom, isSequential));
 }
 
 TTscriptRange *TTnpcScript::findRange(uint id) {
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index dadea17..77f4445 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -51,24 +51,17 @@ struct TTnpcScriptResponse {
 
 struct TTscriptRange {
 	uint _id;
-	const uint *_arrayP;
+	Common::Array<uint> _values;
 	TTscriptRange *_nextP;
 	uint _priorIndex;
 	ScriptArrayFlag _mode;
 
-	TTscriptRange() : _id(0), _arrayP(nullptr), _nextP(nullptr),
+	TTscriptRange() : _id(0), _nextP(nullptr),
 		_priorIndex(0), _mode(SF_NONE) {}
-	TTscriptRange(uint id, const uint *arrayP, bool isRandom, 
+	TTscriptRange(uint id, const Common::Array<uint> &values, bool isRandom, 
 		bool isSequential);
 };
 
-struct TTscriptRangeInit {
-	uint id;
-	uint *_array;
-	bool _isRandom;
-	bool _isSequential;
-};
-
 class TTnpcScriptBase : public TTscriptBase {
 protected:
 	int _field54;
@@ -123,7 +116,12 @@ protected:
 	/**
 	 * Loads response data for the NPC from the given resource
 	 */
-	void load(const char *name, int valuesPerResponse = 1);
+	void loadResponses(const char *name, int valuesPerResponse = 1);
+
+	/**
+	 * Load ranges data for the NPC from the given resource
+	 */
+	void loadRanges(const char *name);
 
 	/**
 	 * Reset script flags
@@ -167,7 +165,7 @@ protected:
 	/**
 	 * Adds a new item to the list of number ranges
 	 */
-	void addRange(uint id, const uint *arrayP, bool isRandom, bool isSequential);
+	void addRange(uint id, const Common::Array<uint> &values, bool isRandom, bool isSequential);
 
 	/**
 	 * Finds an entry in the list of prevoiusly registered number ranges


Commit: 9a35125d65fcba2df05a0a226878da43c0394319
    https://github.com/scummvm/scummvm/commit/9a35125d65fcba2df05a0a226878da43c0394319
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:30-04:00

Commit Message:
TITANIC: Added Deskbot ranges to create_titanic

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp
    devtools/create_titanic/script_ranges.cpp
    devtools/create_titanic/script_ranges.h



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 03d0552..506aaae 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -51,7 +51,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x380
+#define HEADER_SIZE 0x400
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
diff --git a/devtools/create_titanic/script_ranges.cpp b/devtools/create_titanic/script_ranges.cpp
index 94c5d76..25d3b8e 100644
--- a/devtools/create_titanic/script_ranges.cpp
+++ b/devtools/create_titanic/script_ranges.cpp
@@ -32,108 +32,108 @@
 #include "file.h"
 #include "script_ranges.h"
 
-static uint BARBOT_RANGE1[] = { 250062, 250064, 250065, 250066, 250067, 250068, 250069, 250070, 250071, 250063, 0 };
-static uint BARBOT_RANGE2[] = { 250200, 250201, 250202, 250203, 250204, 250205, 250206, 250207, 0 };
-static uint BARBOT_RANGE3[] = { 250160, 250161, 250162, 250163, 0 };
-static uint BARBOT_RANGE4[] = { 250175, 250176, 250177, 250178, 250179, 250180, 250181, 250182, 250183, 0 };
-static uint BARBOT_RANGE5[] = { 250114, 250004, 0 };
-static uint BARBOT_RANGE6[] = { 250042, 250009, 250010, 250011, 251692, 251693, 251694, 0 };
-static uint BARBOT_RANGE7[] = { 250012, 250111, 0 };
-static uint BARBOT_RANGE8[] = { 250013, 250119, 0 };
-static uint BARBOT_RANGE9[] = { 250027, 250126, 250055, 0 };
-static uint BARBOT_RANGE10[] = { 250032, 250130, 0 };
-static uint BARBOT_RANGE11[] = { 250038, 250134, 0 };
-static uint BARBOT_RANGE12[] = { 250039, 250135, 250050, 0 };
-static uint BARBOT_RANGE13[] = { 250016, 250120, 250136, 250145, 250143, 0 };
-static uint BARBOT_RANGE14[] = { 250040, 250138, 250139, 0 };
-static uint BARBOT_RANGE15[] = { 250037, 250133, 250617, 0 };
-static uint BARBOT_RANGE16[] = { 250031, 250129, 0 };
-static uint BARBOT_RANGE17[] = { 250036, 250132, 0 };
-static uint BARBOT_RANGE18[] = { 250035, 250137, 0 };
-static uint BARBOT_RANGE19[] = { 250021, 250123, 0 };
-static uint BARBOT_RANGE20[] = { 250006, 250117, 0 };
-static uint BARBOT_RANGE21[] = { 250024, 250124, 0 };
-static uint BARBOT_RANGE22[] = { 250002, 250113, 0 };
-static uint BARBOT_RANGE23[] = { 250152, 250153, 250079, 250194, 250149, 250151, 250150,
+const uint BARBOT_RANGE1[] = { 250062, 250064, 250065, 250066, 250067, 250068, 250069, 250070, 250071, 250063, 0 };
+const uint BARBOT_RANGE2[] = { 250200, 250201, 250202, 250203, 250204, 250205, 250206, 250207, 0 };
+const uint BARBOT_RANGE3[] = { 250160, 250161, 250162, 250163, 0 };
+const uint BARBOT_RANGE4[] = { 250175, 250176, 250177, 250178, 250179, 250180, 250181, 250182, 250183, 0 };
+const uint BARBOT_RANGE5[] = { 250114, 250004, 0 };
+const uint BARBOT_RANGE6[] = { 250042, 250009, 250010, 250011, 251692, 251693, 251694, 0 };
+const uint BARBOT_RANGE7[] = { 250012, 250111, 0 };
+const uint BARBOT_RANGE8[] = { 250013, 250119, 0 };
+const uint BARBOT_RANGE9[] = { 250027, 250126, 250055, 0 };
+const uint BARBOT_RANGE10[] = { 250032, 250130, 0 };
+const uint BARBOT_RANGE11[] = { 250038, 250134, 0 };
+const uint BARBOT_RANGE12[] = { 250039, 250135, 250050, 0 };
+const uint BARBOT_RANGE13[] = { 250016, 250120, 250136, 250145, 250143, 0 };
+const uint BARBOT_RANGE14[] = { 250040, 250138, 250139, 0 };
+const uint BARBOT_RANGE15[] = { 250037, 250133, 250617, 0 };
+const uint BARBOT_RANGE16[] = { 250031, 250129, 0 };
+const uint BARBOT_RANGE17[] = { 250036, 250132, 0 };
+const uint BARBOT_RANGE18[] = { 250035, 250137, 0 };
+const uint BARBOT_RANGE19[] = { 250021, 250123, 0 };
+const uint BARBOT_RANGE20[] = { 250006, 250117, 0 };
+const uint BARBOT_RANGE21[] = { 250024, 250124, 0 };
+const uint BARBOT_RANGE22[] = { 250002, 250113, 0 };
+const uint BARBOT_RANGE23[] = { 250152, 250153, 250079, 250194, 250149, 250151, 250150,
 250208, 250209, 250157, 250195, 250076, 250156, 250074,
 250075, 250080, 250192, 250109, 250159, 250110, 250148,
 250053, 250155, 250197, 250072, 250077, 250001, 250154,
 250196, 250198, 250199, 250158, 250073, 0 };
-static uint BARBOT_RANGE24[] = { 251831, 251832, 251833, 251834, 251835, 250617, 0 };
-static uint BARBOT_RANGE25[] = { 250033, 251838, 0 };
-static uint BARBOT_RANGE26[] = { 250014, 251827, 251781, 250617, 0 };
-static uint BARBOT_RANGE27[] = { 251855, 251856, 0 };
-static uint BARBOT_RANGE28[] = { 251852, 251853, 0 };
-static uint BARBOT_RANGE29[] = { 251250, 251261, 251272, 251277, 251278, 251279, 251280,
+const uint BARBOT_RANGE24[] = { 251831, 251832, 251833, 251834, 251835, 250617, 0 };
+const uint BARBOT_RANGE25[] = { 250033, 251838, 0 };
+const uint BARBOT_RANGE26[] = { 250014, 251827, 251781, 250617, 0 };
+const uint BARBOT_RANGE27[] = { 251855, 251856, 0 };
+const uint BARBOT_RANGE28[] = { 251852, 251853, 0 };
+const uint BARBOT_RANGE29[] = { 251250, 251261, 251272, 251277, 251278, 251279, 251280,
 251281, 251282, 251251, 251252, 251253, 251254, 251255,
 251256, 251257, 251258, 251259, 251260, 251262, 251263,
 251264, 251265, 251266, 251267, 251268, 251269, 251270,
 251271, 251273, 251274, 251275, 251276, 0 };
-static uint BARBOT_RANGE30[] = { 251283, 251284, 251285, 251286, 0 };
-static uint BARBOT_RANGE31[] = { 250527, 250530, 250531, 250532, 250533, 250534, 250535,
+const uint BARBOT_RANGE30[] = { 251283, 251284, 251285, 251286, 0 };
+const uint BARBOT_RANGE31[] = { 250527, 250530, 250531, 250532, 250533, 250534, 250535,
 250536, 250537, 250528, 250529, 0 };
-static uint BARBOT_RANGE32[] = { 250593, 250594, 0 };
-static uint BARBOT_RANGE33[] = { 250263, 250264, 250265, 250266, 0 };
-static uint BARBOT_RANGE34[] = { 250227, 250228, 250229, 250230, 0 };
-static uint BARBOT_RANGE35[] = { 250239, 250240, 250241, 250242, 250243, 0 };
-static uint BARBOT_RANGE36[] = { 250507, 250222, 250678, 250588, 0 };
-static uint BARBOT_RANGE37[] = { 250365, 250366, 250367, 250368, 0 };
-static uint BARBOT_RANGE38[] = { 250936, 250937, 250938, 0 };
-static uint BARBOT_RANGE39[] = { 250610, 250611, 0 };
-static uint BARBOT_RANGE40[] = { 250082, 250093, 250102, 250104, 250105, 250106, 250107,
+const uint BARBOT_RANGE32[] = { 250593, 250594, 0 };
+const uint BARBOT_RANGE33[] = { 250263, 250264, 250265, 250266, 0 };
+const uint BARBOT_RANGE34[] = { 250227, 250228, 250229, 250230, 0 };
+const uint BARBOT_RANGE35[] = { 250239, 250240, 250241, 250242, 250243, 0 };
+const uint BARBOT_RANGE36[] = { 250507, 250222, 250678, 250588, 0 };
+const uint BARBOT_RANGE37[] = { 250365, 250366, 250367, 250368, 0 };
+const uint BARBOT_RANGE38[] = { 250936, 250937, 250938, 0 };
+const uint BARBOT_RANGE39[] = { 250610, 250611, 0 };
+const uint BARBOT_RANGE40[] = { 250082, 250093, 250102, 250104, 250105, 250106, 250107,
 250108, 250091, 250092, 250094, 250095, 250096, 250097,
 250098, 250099, 250100, 250101, 251700, 251701, 251702,
 251703, 251704, 251862, 250617, 250268, 250272, 0 };
-static uint BARBOT_RANGE41[] = { 250584, 250585, 0 };
-static uint BARBOT_RANGE42[] = { 250579, 251142, 0 };
-static uint BARBOT_RANGE43[] = { 250577, 250578, 0 };
-static uint BARBOT_RANGE44[] = { 250244, 250245, 250246, 250247, 250248, 250249, 250250,
+const uint BARBOT_RANGE41[] = { 250584, 250585, 0 };
+const uint BARBOT_RANGE42[] = { 250579, 251142, 0 };
+const uint BARBOT_RANGE43[] = { 250577, 250578, 0 };
+const uint BARBOT_RANGE44[] = { 250244, 250245, 250246, 250247, 250248, 250249, 250250,
 250251, 250252, 250253, 250254, 250255, 250256, 250257,
 250258, 250259, 250260, 250261, 250262, 0 };
-static uint BARBOT_RANGE45[] = { 250286, 250288, 250289, 250290, 250291, 250292, 250293,
+const uint BARBOT_RANGE45[] = { 250286, 250288, 250289, 250290, 250291, 250292, 250293,
 250294, 250295, 250287, 0 };
-static uint BARBOT_RANGE46[] = { 250296, 250299, 250300, 250301, 250302, 250303, 250304,
+const uint BARBOT_RANGE46[] = { 250296, 250299, 250300, 250301, 250302, 250303, 250304,
 250305, 250306, 250297, 250298, 0 };
-static uint BARBOT_RANGE47[] = { 250307, 250309, 250310, 250311, 250312, 250313, 250314,
+const uint BARBOT_RANGE47[] = { 250307, 250309, 250310, 250311, 250312, 250313, 250314,
 250315, 250316, 0 };
-static uint BARBOT_RANGE48[] = { 251682, 251683, 251684, 251685, 251686, 251687, 251688,
+const uint BARBOT_RANGE48[] = { 251682, 251683, 251684, 251685, 251686, 251687, 251688,
 251689, 250756, 250757, 250758, 250759, 0 };
-static uint BARBOT_RANGE49[] = { 250738, 250742, 250743, 250744, 250745, 250746, 250747,
+const uint BARBOT_RANGE49[] = { 250738, 250742, 250743, 250744, 250745, 250746, 250747,
 250748, 250749, 250739, 250740, 250741, 0 };
-static uint BARBOT_RANGE50[] = { 250659, 250660, 250661, 250379, 0 };
-static uint BARBOT_RANGE51[] = { 251761, 251762, 251763, 251764, 0 };
-static uint BARBOT_RANGE52[] = { 251754, 251755, 251756, 251757, 251758, 251759, 0 };
-static uint BARBOT_RANGE53[] = { 250482, 250504, 250424, 250463, 250466, 250467, 250468,
+const uint BARBOT_RANGE50[] = { 250659, 250660, 250661, 250379, 0 };
+const uint BARBOT_RANGE51[] = { 251761, 251762, 251763, 251764, 0 };
+const uint BARBOT_RANGE52[] = { 251754, 251755, 251756, 251757, 251758, 251759, 0 };
+const uint BARBOT_RANGE53[] = { 250482, 250504, 250424, 250463, 250466, 250467, 250468,
 250478, 250501, 250502, 250503, 250506, 250413, 251014,
 250614, 250756, 250758, 250759, 250223, 250737, 250658,
 251027, 250633, 250935, 250237, 251618, 0 };
-static uint BARBOT_RANGE54[] = { 250504, 250434, 250436, 250466, 250467, 250468, 250469,
+const uint BARBOT_RANGE54[] = { 250504, 250434, 250436, 250466, 250467, 250468, 250469,
 250470, 250472, 250501, 250502, 250503, 250505, 250413,
 251681, 250756, 250758, 250759, 250223, 251027, 250633,
 250935, 250237, 251618, 250371, 0 };
-static uint BARBOT_RANGE55[] = { 250952, 250953, 0 };
-static uint BARBOT_RANGE56[] = { 251777, 250951, 0 };
-static uint BARBOT_RANGE57[] = { 251871, 251877, 251878, 251879, 251880, 251883, 251884,
+const uint BARBOT_RANGE55[] = { 250952, 250953, 0 };
+const uint BARBOT_RANGE56[] = { 251777, 250951, 0 };
+const uint BARBOT_RANGE57[] = { 251871, 251877, 251878, 251879, 251880, 251883, 251884,
 251872, 251873, 0 };
-static uint BARBOT_RANGE58[] = { 250228, 250236, 250258, 250259, 250378, 250465, 250536,
+const uint BARBOT_RANGE58[] = { 250228, 250236, 250258, 250259, 250378, 250465, 250536,
 251016, 251048, 251068, 0 };
-static uint BARBOT_RANGE59[] = { 250141, 250378, 251048, 0 };
-static uint BARBOT_RANGE60[] = { 251621, 251622, 251623, 251624, 251625, 251626, 0 };
-static uint BARBOT_RANGE61[] = { 251650, 251651, 0 };
-static uint BARBOT_RANGE62[] = { 251305, 251306, 251307, 251308, 0 };
-static uint BARBOT_RANGE63[] = { 251836, 251890, 251891, 251892, 0 };
-static uint BARBOT_RANGE64[] = { 250760, 251246, 251156, 251335, 251510, 251059, 251097,
+const uint BARBOT_RANGE59[] = { 250141, 250378, 251048, 0 };
+const uint BARBOT_RANGE60[] = { 251621, 251622, 251623, 251624, 251625, 251626, 0 };
+const uint BARBOT_RANGE61[] = { 251650, 251651, 0 };
+const uint BARBOT_RANGE62[] = { 251305, 251306, 251307, 251308, 0 };
+const uint BARBOT_RANGE63[] = { 251836, 251890, 251891, 251892, 0 };
+const uint BARBOT_RANGE64[] = { 250760, 251246, 251156, 251335, 251510, 251059, 251097,
 251136, 250374, 250375, 250376, 250377, 251015, 251016,
 251017, 251018, 0 };
-static uint BARBOT_RANGE65[] = { 250899, 250906, 250948, 250713, 250690, 0 };
-static uint BARBOT_RANGE66[] = { 250906, 250948, 250713, 250899, 250690, 0 };
-static uint BARBOT_RANGE67[] = { 250949, 250713, 250711, 250152, 250153, 250690, 250906, 0 };
-static uint BARBOT_RANGE68[] = { 251815, 250711, 0 };
-static uint BARBOT_RANGE69[] = { 251829, 250711, 0 };
-static uint BARBOT_RANGE70[] = { 251779, 250712, 0 };
+const uint BARBOT_RANGE65[] = { 250899, 250906, 250948, 250713, 250690, 0 };
+const uint BARBOT_RANGE66[] = { 250906, 250948, 250713, 250899, 250690, 0 };
+const uint BARBOT_RANGE67[] = { 250949, 250713, 250711, 250152, 250153, 250690, 250906, 0 };
+const uint BARBOT_RANGE68[] = { 251815, 250711, 0 };
+const uint BARBOT_RANGE69[] = { 251829, 250711, 0 };
+const uint BARBOT_RANGE70[] = { 251779, 250712, 0 };
 
 #define BARBOT_RANGE_COUNT 70
-static ScriptRange BARBOT_RANGES[70] = {
+const ScriptRange BARBOT_RANGES[70] = {
 	{ 250062, BARBOT_RANGE1, false, false },
 	{ 250200, BARBOT_RANGE2, false, false },
 	{ 250160, BARBOT_RANGE3, false, false },
@@ -206,9 +206,334 @@ static ScriptRange BARBOT_RANGES[70] = {
 	{ 251899, BARBOT_RANGE67, false, false },
 	{ 251815, BARBOT_RANGE68, false, false },
 	{ 251829, BARBOT_RANGE69, false, false },
-	{ 251779, BARBOT_RANGE70 }
+	{ 251779, BARBOT_RANGE70, false, false }
 };
 
+const uint DESKBOT_RANGE1[] = { 240002, 240003, 240006, 240007, 0 };
+const uint DESKBOT_RANGE2[] = { 240008, 240009, 240010, 240011, 240012, 240013, 240004, 240005, 0 };
+const uint DESKBOT_RANGE3[] = { 240336, 240337, 240338, 240339, 240340, 240341, 240342, 240343, 240344, 0 };
+const uint DESKBOT_RANGE4[] = { 240345, 240346, 240347, 0 };
+const uint DESKBOT_RANGE5[] = { 240348, 240349, 240350, 0 };
+const uint DESKBOT_RANGE6[] = { 240351, 240352, 240353, 0 };
+const uint DESKBOT_RANGE7[] = { 240355, 240356, 240357, 0 };
+const uint DESKBOT_RANGE8[] = { 240359, 240360, 240361, 0 };
+const uint DESKBOT_RANGE9[] = { 240362, 240363, 240364, 240365, 240366, 240367, 0 };
+const uint DESKBOT_RANGE10[] = { 240368, 240369, 240370, 240371, 0 };
+
+const uint DESKBOT_RANGE11[] = { 240372, 240373, 240374, 0 };
+const uint DESKBOT_RANGE12[] = { 240375, 240376, 240377, 0 };
+const uint DESKBOT_RANGE13[] = { 240378, 240379, 240380, 0 };
+const uint DESKBOT_RANGE14[] = { 240381, 240382, 240383, 240384, 0 };
+const uint DESKBOT_RANGE15[] = { 240385, 240386, 240387, 0 };
+const uint DESKBOT_RANGE16[] = { 240388, 240389, 240390, 0 };
+const uint DESKBOT_RANGE17[] = { 240391, 240392, 240393, 0 };
+const uint DESKBOT_RANGE18[] = { 240394, 240395, 240396, 240397, 0 };
+const uint DESKBOT_RANGE19[] = { 240399, 0 };
+const uint DESKBOT_RANGE20[] = { 240401, 240402, 240403, 0 };
+
+const uint DESKBOT_RANGE21[] = { 240404, 240405, 240406, 0 };
+const uint DESKBOT_RANGE22[] = { 240407, 240408, 240409, 240900, 240410, 240411, 240412, 240900, 241671, 241672,
+241673, 241671, 241672, 241673, 241671, 241672, 241673, 0 };
+const uint DESKBOT_RANGE23[] = { 240421, 240422, 0 };
+const uint DESKBOT_RANGE24[] = { 240451, 240424, 240425, 240426, 240452, 240455, 240456, 240457, 240458, 240459, 240460, 0 };
+const uint DESKBOT_RANGE25[] = { 240451, 240424, 240425, 240426, 240452, 240455, 240456, 240457, 240458, 0 };
+const uint DESKBOT_RANGE26[] = { 240428, 240429, 240430, 0 };
+const uint DESKBOT_RANGE27[] = { 240431, 240432, 0 };
+const uint DESKBOT_RANGE28[] = { 240435, 240436, 240437, 240438, 240439, 0 };
+const uint DESKBOT_RANGE29[] = { 240440, 240441, 240442, 240443, 240444, 0 };
+const uint DESKBOT_RANGE30[] = { 240451, 240452, 0 };
+
+const uint DESKBOT_RANGE31[] = { 240455, 240456, 240457, 240458, 240459, 240460, 0 };
+const uint DESKBOT_RANGE32[] = { 240461, 240462, 240463, 240464, 240977, 240978, 240979, 240980, 240804, 240806,
+	240807, 240808, 0 };
+const uint DESKBOT_RANGE33[] = { 241742, 241743, 241744, 241745, 241746, 241747, 241748, 240954, 0 };
+const uint DESKBOT_RANGE34[] = { 240480, 240481, 240482, 0 };
+const uint DESKBOT_RANGE35[] = { 241117, 241515, 0 };
+const uint DESKBOT_RANGE36[] = { 240486, 241585, 240487, 241585, 240488, 241585, 0 };
+const uint DESKBOT_RANGE37[] = { 240490, 240491, 0 };
+const uint DESKBOT_RANGE38[] = { 240496, 240507, 240518, 240529, 240540, 240542, 240543, 240544, 240545, 240497,
+	240498, 240499, 240500, 240501, 240502, 240503, 240504, 240505, 240506, 240508,
+	240509, 240510, 240511, 240512, 240513, 240514, 240515, 240516, 240517, 240519,
+	240520, 240521, 240522, 240523, 240524, 240525, 240526, 240527, 240528, 240530,
+	240531, 240532, 240533, 240534, 240535, 240536, 240537, 240538, 240539, 240541, 0 };
+const uint DESKBOT_RANGE39[] = { 240587, 240588, 0 };
+const uint DESKBOT_RANGE40[] = { 240589, 240590, 240591, 241652, 0 };
+
+const uint DESKBOT_RANGE41[] = { 240592, 240593, 240594, 241653, 0 };
+const uint DESKBOT_RANGE42[] = { 240595, 240596, 0 };
+const uint DESKBOT_RANGE43[] = { 240597, 240598, 0 };
+const uint DESKBOT_RANGE44[] = { 240602, 240613, 240622, 240623, 240624, 240627, 240603, 240606, 240609, 0 };
+const uint DESKBOT_RANGE45[] = { 240629, 240630, 240354, 0 };
+const uint DESKBOT_RANGE46[] = { 240635, 240636, 240637, 0 };
+const uint DESKBOT_RANGE47[] = {
+	240640, 240656, 240667, 240678, 240689, 240699, 240710, 240721, 240732, 240641,
+	240647, 240648, 240649, 240650, 240651, 240652, 240653, 240654, 240655, 240657,
+	240658, 240659, 240660, 240661, 240662, 240663, 240664, 240665, 240666, 240668,
+	240669, 240670, 240671, 240672, 240673, 240674, 240675, 240676, 240677, 240679,
+	240680, 240681, 240682, 240683, 240684, 240685, 240686, 240687, 240688, 240690,
+	240691, 240692, 240693, 240694, 240695, 240696, 240697, 240698, 240700, 240701,
+	240702, 240703, 240704, 240705, 240706, 240707, 240708, 240709, 240711, 240712,
+	240713, 240714, 240715, 240716, 240717, 240718, 240719, 240720, 240722, 240723,
+	240724, 240725, 240726, 240727, 240728, 240729, 240730, 240731, 240733, 240734,
+	240735, 240736, 240737, 240738, 240739, 240740, 240741, 240742, 240642, 240643,
+	240644, 240645, 240646, 0
+};
+const uint DESKBOT_RANGE48[] = { 240758, 240759, 240760, 0 };
+const uint DESKBOT_RANGE49[] = { 240761, 240762, 240764, 240766, 0 };
+const uint DESKBOT_RANGE50[] = { 240335, 240776, 240778, 240779, 240780, 240781, 0 };
+
+const uint DESKBOT_RANGE51[] = { 240335, 240776, 240777, 240778, 240779, 240780, 240781, 0 };
+const uint DESKBOT_RANGE52[] = { 240782, 240783, 240834, 240592, 240589, 240768, 240770, 240771, 240769, 240772,
+240773, 240590, 240593, 240595, 240587, 240597, 240591, 240594, 240596, 240588,
+240598, 241120, 240675, 241124, 0 };
+const uint DESKBOT_RANGE53[] = { 240787, 240788, 240789, 240790, 240791, 241635, 0 };
+const uint DESKBOT_RANGE54[] = { 240792, 240793, 240794, 240795, 240796, 240797, 241635, 0 };
+const uint DESKBOT_RANGE55[] = { 240798, 240799, 240800, 241635, 0 };
+const uint DESKBOT_RANGE56[] = { 240804, 240806, 240807, 240808, 0 };
+const uint DESKBOT_RANGE57[] = { 240809, 240820, 240822, 240823, 240824, 240825, 240826, 240827, 240828, 240829,
+240810, 240811, 240812, 240813, 240814, 240815, 240816, 240817, 240818, 240819,
+240821, 0 };
+const uint DESKBOT_RANGE58[] = { 240835, 240836, 240837, 240838, 240839, 240840, 0 };
+const uint DESKBOT_RANGE59[] = { 240861, 240862, 240863, 0 };
+const uint DESKBOT_RANGE60[] = { 240881, 240883, 240884, 240885, 240886, 240887, 240888, 240889, 240890, 240882, 0 };
+
+const uint DESKBOT_RANGE61[] = { 240894, 240895, 240896, 240897, 240898, 240899, 240900, 240901, 240902, 0 };
+const uint DESKBOT_RANGE62[] = { 240904, 240905, 240906, 240907, 240908, 241342, 0 };
+const uint DESKBOT_RANGE63[] = { 240911, 240922, 240930, 240932, 240933, 240934, 240935, 240936, 240937, 240912,
+	240913, 240914, 240915, 240916, 240917, 240918, 240919, 240920, 240921, 240923,
+	240931, 240925, 240926, 240927, 240928, 240929, 0
+};
+const uint DESKBOT_RANGE64[] = { 240948, 240949, 240950, 240951, 0 };
+const uint DESKBOT_RANGE65[] = { 240959, 240960, 240961, 240962, 0 };
+const uint DESKBOT_RANGE66[] = { 240965, 240966, 0 };
+const uint DESKBOT_RANGE67[] = { 240972, 240973, 240974, 0 };
+const uint DESKBOT_RANGE68[] = { 240977, 240978, 240979, 240980, 0 };
+const uint DESKBOT_RANGE69[] = { 240982, 240983, 240984, 240985, 0 };
+const uint DESKBOT_RANGE70[] = { 240988, 240989, 240990, 240991, 0 };
+
+const uint DESKBOT_RANGE71[] = { 240992, 240994, 240995, 240996, 240997, 240998, 241000, 241001, 0 };
+const uint DESKBOT_RANGE72[] = { 241002, 241004, 241005, 241006, 241007, 241008, 241009, 241010, 241011, 241003, 0 };
+const uint DESKBOT_RANGE73[] = {
+	241012, 241023, 241034, 241045, 241050, 241051, 241052, 241053, 241054, 241013,
+	241014, 241015, 241016, 241017, 241018, 241019, 241020, 241021, 241022, 241024,
+	241025, 241026, 241027, 241028, 241029, 241030, 241031, 241032, 241033, 241035,
+	241036, 241037, 241038, 241039, 241040, 241041, 241042, 241043, 241044, 241046,
+	241047, 241048, 241049, 0
+};
+const uint DESKBOT_RANGE74[] = { 241055, 241057, 241058, 241059, 241060, 241061, 241062, 241063, 241064, 241056, 0 };
+const uint DESKBOT_RANGE75[] = { 241078, 241079, 241080, 241081, 241082, 241083, 241084, 241085, 0 };
+const uint DESKBOT_RANGE76[] = { 241091, 241092, 241093, 241094, 241095, 0 };
+const uint DESKBOT_RANGE77[] = { 241103, 241104, 241105, 241106, 241107, 0 };
+const uint DESKBOT_RANGE78[] = {
+	241132, 241127, 241133, 241140, 241151, 241152, 241153, 241154, 241155, 241156,
+	241157, 241128, 241129, 241130, 241131, 241136, 241137, 241138, 241139, 241141,
+	241142, 241143, 241144, 241145, 241146, 241147, 241148, 241149, 241150, 0
+};
+const uint DESKBOT_RANGE79[] = { 240404, 241099, 0 };
+const uint DESKBOT_RANGE80[] = { 241125, 241124, 241125, 241125, 240649, 240729, 241686, 241680, 241738, 0 };
+
+const uint DESKBOT_RANGE81[] = { 241096, 241112, 240727, 241679, 241738, 0 };
+const uint DESKBOT_RANGE82[] = { 240833, 240845, 241464, 241465, 241674, 241738, 0 };
+const uint DESKBOT_RANGE83[] = { 240726, 241684, 241738, 0 };
+const uint DESKBOT_RANGE84[] = { 240728, 240728, 240728, 240644, 240953, 240728, 240601, 240728, 241075, 240728,
+240952, 240728, 240600, 241120, 241683, 241738, 241738, 241738, 0 };
+const uint DESKBOT_RANGE85[] = { 240730, 241738, 0 };
+const uint DESKBOT_RANGE86[] = { 240008, 240009, 240010, 240011, 240012, 240013, 240004, 240005, 0 };
+const uint DESKBOT_RANGE87[] = { 240677, 240680, 240766, 241109, 240633, 240747, 240940, 241187, 241120, 240665,
+240669, 240620, 0 };
+const uint DESKBOT_RANGE88[] = {
+	240948, 240602, 240613, 240622, 240624, 240625, 240626, 240627, 240603, 240605,
+	240607, 240609, 240610, 241150, 240925, 240882, 240864, 241072, 240942, 240867,
+	241096, 240971, 240785, 240868, 240833, 240955, 241077, 240877, 240754, 241163,
+	241071, 241161, 240871, 241114, 240963, 240956, 240750, 240958, 240851, 240866,
+	241100, 240941, 241115, 241088, 240628, 240846, 240857, 241164, 241165, 240954,
+	241087, 240869, 240784, 240637, 240700, 240701, 240704, 240929, 240716, 240717,
+	240720, 240689, 240732, 240648, 240653, 240664, 240676, 0
+};
+const uint DESKBOT_RANGE89[] = { 241012, 0 };
+const uint DESKBOT_RANGE90[] = { 240775, 240419, 240701, 240642, 240802, 240891, 241110, 241568, 241569, 241570, 241571, 0 };
+
+const uint DESKBOT_RANGE91[] = { 241338, 240831, 0 };
+const uint DESKBOT_RANGE92[] = { 240416, 241343, 0 };
+const uint DESKBOT_RANGE93[] = { 241577, 241578, 241579, 241580, 241581, 241582, 0 };
+const uint DESKBOT_RANGE94[] = { 241383, 241586, 0 };
+const uint DESKBOT_RANGE95[] = { 241446, 241447, 241448, 0 };
+const uint DESKBOT_RANGE96[] = { 241443, 241444, 241445, 0 };
+const uint DESKBOT_RANGE97[] = { 241116, 241365, 0 };
+const uint DESKBOT_RANGE98[] = {
+	241522, 241523, 241524, 241525, 241526, 241527, 241528, 241529, 241530, 241531,
+	241532, 241533, 241534, 241535, 241536, 241537, 241538, 241539, 241540, 241541,
+	241542, 241543, 241544, 241545, 241546, 241547, 241548, 241549, 241550, 241551,
+	241552, 241553, 241554, 0
+};
+const uint DESKBOT_RANGE99[] = { 241341, 241634, 0 };
+const uint DESKBOT_RANGE100[] = { 241449, 241635, 241450, 241635, 0 };
+
+const uint DESKBOT_RANGE101[] = { 241638, 241639, 241640, 241654, 241655, 241643, 0 };
+const uint DESKBOT_RANGE102[] = { 241702, 241703, 241704, 0 };
+const uint DESKBOT_RANGE103[] = { 240465, 241641, 0 };
+const uint DESKBOT_RANGE104[] = { 241371, 241111, 0 };
+
+#define DESKBOT_RANGE_COUNT 146
+const ScriptRange DESKBOT_RANGES[146] = {
+	{ 240546, DESKBOT_RANGE1, false, false },
+	{ 240547, DESKBOT_RANGE2, false, false },
+	{ 240548, DESKBOT_RANGE3, false, false },
+	{ 240549, DESKBOT_RANGE4, false, false },
+	{ 240550, DESKBOT_RANGE5, false, false },
+	{ 240551, DESKBOT_RANGE6, false, false },
+	{ 240552, DESKBOT_RANGE7, false, false },
+	{ 240553, DESKBOT_RANGE8, false, false },
+	{ 240554, DESKBOT_RANGE9, false, false },
+	{ 240555, DESKBOT_RANGE10, false, false },
+
+	{ 240556, DESKBOT_RANGE11, false, false },
+	{ 240557, DESKBOT_RANGE12, false, false },
+	{ 240558, DESKBOT_RANGE13, false, false },
+	{ 240559, DESKBOT_RANGE14, false, false },
+	{ 240560, DESKBOT_RANGE15, false, false },
+	{ 240561, DESKBOT_RANGE16, false, false },
+	{ 240562, DESKBOT_RANGE17, false, false },
+	{ 240563, DESKBOT_RANGE18, false, false },
+	{ 240564, DESKBOT_RANGE19, false, false },
+	{ 240565, DESKBOT_RANGE20, false, false },
+
+	{ 240566, DESKBOT_RANGE21, false, false },
+	{ 240567, DESKBOT_RANGE22, false, false },
+	{ 240568, DESKBOT_RANGE23, false, false },
+	{ 240569, DESKBOT_RANGE24, false, false },
+	{ 240570, DESKBOT_RANGE25, false, false },
+	{ 240571, DESKBOT_RANGE26, false, false },
+	{ 240572, DESKBOT_RANGE27, false, false },
+	{ 240573, DESKBOT_RANGE28, false, false },
+	{ 240574, DESKBOT_RANGE29, false, false },
+	{ 240575, DESKBOT_RANGE30, false, false },
+
+	{ 240576, DESKBOT_RANGE31, false, false },
+	{ 240577, DESKBOT_RANGE32, false, false },
+	{ 240578, DESKBOT_RANGE33, false, false },
+	{ 240579, DESKBOT_RANGE34, false, false },
+	{ 240580, DESKBOT_RANGE35, false, false },
+	{ 240581, DESKBOT_RANGE36, false, false },
+	{ 240582, DESKBOT_RANGE37, false, false },
+	{ 240583, DESKBOT_RANGE38, false, false },
+	{ 241167, DESKBOT_RANGE39, false, false },
+	{ 241168, DESKBOT_RANGE40, false, false },
+
+	{ 241169, DESKBOT_RANGE41, false, false },
+	{ 241170, DESKBOT_RANGE42, false, false },
+	{ 241171, DESKBOT_RANGE43, false, false },
+	{ 241172, DESKBOT_RANGE44, false, false },
+	{ 241173, DESKBOT_RANGE45, false, false },
+	{ 241174, DESKBOT_RANGE46, false, false },
+	{ 241175, DESKBOT_RANGE47, false, false },
+	{ 241176, DESKBOT_RANGE48, false, false },
+	{ 241177, DESKBOT_RANGE49, false, false },
+	{ 241178, DESKBOT_RANGE50, false, false },
+
+	{ 241179, DESKBOT_RANGE51, false, false },
+	{ 241180, DESKBOT_RANGE52, false, false },
+	{ 241181, DESKBOT_RANGE53, false, false },
+	{ 241182, DESKBOT_RANGE54, false, false },
+	{ 241183, DESKBOT_RANGE55, false, false },
+	{ 241184, DESKBOT_RANGE56, false, false },
+	{ 241185, DESKBOT_RANGE57, false, false },
+	{ 241186, DESKBOT_RANGE58, false, false },
+	{ 241187, DESKBOT_RANGE59, false, false },
+	{ 241188, DESKBOT_RANGE60, false, false },
+
+	{ 241189, DESKBOT_RANGE61, false, false },
+	{ 241190, DESKBOT_RANGE62, false, false },
+	{ 241191, DESKBOT_RANGE63, false, false },
+	{ 241192, DESKBOT_RANGE64, false, false },
+	{ 241193, DESKBOT_RANGE65, false, false },
+	{ 241194, DESKBOT_RANGE66, false, false },
+	{ 241195, DESKBOT_RANGE67, false, false },
+	{ 241196, DESKBOT_RANGE68, false, false },
+	{ 241197, DESKBOT_RANGE69, false, false },
+	{ 241198, DESKBOT_RANGE70, false, false },
+
+	{ 241199, DESKBOT_RANGE71, false, false },
+	{ 241200, DESKBOT_RANGE72, false, false },
+	{ 241201, DESKBOT_RANGE73, false, false },
+	{ 241202, DESKBOT_RANGE74, false, false },
+	{ 241203, DESKBOT_RANGE75, false, false },
+	{ 241204, DESKBOT_RANGE76, false, false },
+	{ 241205, DESKBOT_RANGE77, false, false },
+	{ 241166, DESKBOT_RANGE78, false, false },
+	{ 241206, DESKBOT_RANGE79, false, false },
+	{ 241207, DESKBOT_RANGE80, false, false },
+
+	{ 241208, DESKBOT_RANGE81, false, false },
+	{ 241209, DESKBOT_RANGE82, false, false },
+	{ 241210, DESKBOT_RANGE83, false, false },
+	{ 241211, DESKBOT_RANGE84, false, false },
+	{ 241212, DESKBOT_RANGE85, false, false },
+	{ 241213, DESKBOT_RANGE86, false, false },
+	{ 241214, DESKBOT_RANGE87, false, false },
+	{ 241215, DESKBOT_RANGE88, false, false },
+
+	{ 241217, DESKBOT_RANGE89, false, false },
+	{ 241218, DESKBOT_RANGE89, false, false },
+	{ 241219, DESKBOT_RANGE89, false, false },
+	{ 241220, DESKBOT_RANGE89, false, false },
+	{ 241221, DESKBOT_RANGE89, false, false },
+	{ 241222, DESKBOT_RANGE89, false, false },
+	{ 241223, DESKBOT_RANGE89, false, false },
+	{ 241224, DESKBOT_RANGE89, false, false },
+	{ 241225, DESKBOT_RANGE89, false, false },
+	{ 241226, DESKBOT_RANGE89, false, false },
+	{ 241227, DESKBOT_RANGE89, false, false },
+	{ 241228, DESKBOT_RANGE89, false, false },
+	{ 241229, DESKBOT_RANGE89, false, false },
+	{ 241230, DESKBOT_RANGE89, false, false },
+	{ 241231, DESKBOT_RANGE89, false, false },
+	{ 241232, DESKBOT_RANGE89, false, false },
+	{ 241233, DESKBOT_RANGE89, false, false },
+	{ 241234, DESKBOT_RANGE89, false, false },
+	{ 241235, DESKBOT_RANGE89, false, false },
+	{ 241236, DESKBOT_RANGE89, false, false },
+	{ 241237, DESKBOT_RANGE89, false, false },
+	{ 241238, DESKBOT_RANGE89, false, false },
+	{ 241239, DESKBOT_RANGE89, false, false },
+	{ 241240, DESKBOT_RANGE89, false, false },
+	{ 241241, DESKBOT_RANGE89, false, false },
+	{ 241242, DESKBOT_RANGE89, false, false },
+	{ 241243, DESKBOT_RANGE89, false, false },
+	{ 241244, DESKBOT_RANGE89, false, false },
+	{ 241245, DESKBOT_RANGE89, false, false },
+	{ 241246, DESKBOT_RANGE89, false, false },
+	{ 241247, DESKBOT_RANGE89, false, false },
+	{ 241248, DESKBOT_RANGE89, false, false },
+	{ 241249, DESKBOT_RANGE89, false, false },
+	{ 241250, DESKBOT_RANGE89, false, false },
+	{ 241251, DESKBOT_RANGE89, false, false },
+	{ 241252, DESKBOT_RANGE89, false, false },
+	{ 241253, DESKBOT_RANGE89, false, false },
+	{ 241254, DESKBOT_RANGE89, false, false },
+	{ 241255, DESKBOT_RANGE89, false, false },
+	{ 241256, DESKBOT_RANGE89, false, false },
+	{ 241257, DESKBOT_RANGE89, false, false },
+	{ 241258, DESKBOT_RANGE89, false, false },
+	{ 241259, DESKBOT_RANGE89, false, false },
+
+	{ 241216, DESKBOT_RANGE90, false, false },
+	{ 241625, DESKBOT_RANGE91, false, false },
+	{ 241626, DESKBOT_RANGE92, false, false },
+	{ 241627, DESKBOT_RANGE93, false, false },
+	{ 241628, DESKBOT_RANGE94, false, false },
+	{ 241629, DESKBOT_RANGE95, false, false },
+	{ 241630, DESKBOT_RANGE96, false, false },
+	{ 241631, DESKBOT_RANGE97, false, false },
+	{ 241632, DESKBOT_RANGE98, false, false },
+	{ 241633, DESKBOT_RANGE99, false, false },
+	{ 241634, DESKBOT_RANGE100, false, false },
+
+	{ 241738, DESKBOT_RANGE101, false, false },
+	{ 241739, DESKBOT_RANGE102, false, false },
+	{ 241740, DESKBOT_RANGE103, false, false },
+	{ 241741, DESKBOT_RANGE104, false, false }
+};
 
 void writeScriptRange(const char *name, const ScriptRange *ranges, int count) {
 	outputFile.seek(dataOffset);
@@ -223,7 +548,6 @@ void writeScriptRange(const char *name, const ScriptRange *ranges, int count) {
 			outputFile.writeLong(*v);
 		} while (*v++ != 0);
 	}
-	outputFile.writeLong(0);
 
 	uint size = outputFile.size() - dataOffset;
 	writeEntryHeader(name, dataOffset, size);
@@ -231,5 +555,6 @@ void writeScriptRange(const char *name, const ScriptRange *ranges, int count) {
 }
 
 void writeAllScriptRanges() {
-	writeScriptRange("Ranges/Barbot", BARBOT_RANGES, 70);
+	writeScriptRange("Ranges/Barbot", BARBOT_RANGES, BARBOT_RANGE_COUNT);
+	writeScriptRange("Ranges/Deskbot", DESKBOT_RANGES, DESKBOT_RANGE_COUNT);
 }
\ No newline at end of file
diff --git a/devtools/create_titanic/script_ranges.h b/devtools/create_titanic/script_ranges.h
index 70caac1..3013a32 100644
--- a/devtools/create_titanic/script_ranges.h
+++ b/devtools/create_titanic/script_ranges.h
@@ -27,7 +27,7 @@
 
 struct ScriptRange {
 	uint _id;
-	uint *_array;
+	const uint *_array;
 	bool _isRandom;
 	bool _isSequential;
 };


Commit: 16797bd75ff0bbbfbd52c99ad3f7d5ac884b37a5
    https://github.com/scummvm/scummvm/commit/16797bd75ff0bbbfbd52c99ad3f7d5ac884b37a5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:33-04:00

Commit Message:
TITANIC: Add loading of Deskbot ranges

Changed paths:
    engines/titanic/true_talk/deskbot_script.cpp



diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 85b59b0..7efd925 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -40,6 +40,7 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 	if (_field74 == 1)
 		_field74 = 0;
 
+	loadRanges("Ranges/Deskbot");
 	loadResponses("Responses/Deskbot", 4);
 }
 


Commit: 565940d27c159823468bb2d059e3695d72974530
    https://github.com/scummvm/scummvm/commit/565940d27c159823468bb2d059e3695d72974530
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:36-04:00

Commit Message:
DEVTOOLS: Added Doorbot ranges to create_titanic

Changed paths:
    devtools/create_titanic/script_ranges.cpp



diff --git a/devtools/create_titanic/script_ranges.cpp b/devtools/create_titanic/script_ranges.cpp
index 25d3b8e..58dcecf 100644
--- a/devtools/create_titanic/script_ranges.cpp
+++ b/devtools/create_titanic/script_ranges.cpp
@@ -399,28 +399,28 @@ const ScriptRange DESKBOT_RANGES[146] = {
 	{ 240565, DESKBOT_RANGE20, false, false },
 
 	{ 240566, DESKBOT_RANGE21, false, false },
-	{ 240567, DESKBOT_RANGE22, false, false },
+	{ 240567, DESKBOT_RANGE22, true, false },
 	{ 240568, DESKBOT_RANGE23, false, false },
 	{ 240569, DESKBOT_RANGE24, false, false },
 	{ 240570, DESKBOT_RANGE25, false, false },
 	{ 240571, DESKBOT_RANGE26, false, false },
 	{ 240572, DESKBOT_RANGE27, false, false },
-	{ 240573, DESKBOT_RANGE28, false, false },
+	{ 240573, DESKBOT_RANGE28, true, false },
 	{ 240574, DESKBOT_RANGE29, false, false },
 	{ 240575, DESKBOT_RANGE30, false, false },
 
 	{ 240576, DESKBOT_RANGE31, false, false },
-	{ 240577, DESKBOT_RANGE32, false, false },
-	{ 240578, DESKBOT_RANGE33, false, false },
+	{ 240577, DESKBOT_RANGE32, true, false },
+	{ 240578, DESKBOT_RANGE33, true, false },
 	{ 240579, DESKBOT_RANGE34, false, false },
-	{ 240580, DESKBOT_RANGE35, false, false },
+	{ 240580, DESKBOT_RANGE35, true, false },
 	{ 240581, DESKBOT_RANGE36, false, false },
 	{ 240582, DESKBOT_RANGE37, false, false },
 	{ 240583, DESKBOT_RANGE38, false, false },
 	{ 241167, DESKBOT_RANGE39, false, false },
-	{ 241168, DESKBOT_RANGE40, false, false },
+	{ 241168, DESKBOT_RANGE40, true, false },
 
-	{ 241169, DESKBOT_RANGE41, false, false },
+	{ 241169, DESKBOT_RANGE41, true, false },
 	{ 241170, DESKBOT_RANGE42, false, false },
 	{ 241171, DESKBOT_RANGE43, false, false },
 	{ 241172, DESKBOT_RANGE44, false, false },
@@ -429,29 +429,29 @@ const ScriptRange DESKBOT_RANGES[146] = {
 	{ 241175, DESKBOT_RANGE47, false, false },
 	{ 241176, DESKBOT_RANGE48, false, false },
 	{ 241177, DESKBOT_RANGE49, false, false },
-	{ 241178, DESKBOT_RANGE50, false, false },
-
-	{ 241179, DESKBOT_RANGE51, false, false },
-	{ 241180, DESKBOT_RANGE52, false, false },
-	{ 241181, DESKBOT_RANGE53, false, false },
-	{ 241182, DESKBOT_RANGE54, false, false },
-	{ 241183, DESKBOT_RANGE55, false, false },
-	{ 241184, DESKBOT_RANGE56, false, false },
+	{ 241178, DESKBOT_RANGE50, true, false },
+
+	{ 241179, DESKBOT_RANGE51, true, false },
+	{ 241180, DESKBOT_RANGE52, true, false },
+	{ 241181, DESKBOT_RANGE53, true, false },
+	{ 241182, DESKBOT_RANGE54, true, false },
+	{ 241183, DESKBOT_RANGE55, true, false },
+	{ 241184, DESKBOT_RANGE56, true, false },
 	{ 241185, DESKBOT_RANGE57, false, false },
 	{ 241186, DESKBOT_RANGE58, false, false },
 	{ 241187, DESKBOT_RANGE59, false, false },
-	{ 241188, DESKBOT_RANGE60, false, false },
+	{ 241188, DESKBOT_RANGE60, true, false },
 
 	{ 241189, DESKBOT_RANGE61, false, false },
-	{ 241190, DESKBOT_RANGE62, false, false },
-	{ 241191, DESKBOT_RANGE63, false, false },
+	{ 241190, DESKBOT_RANGE62, true, false },
+	{ 241191, DESKBOT_RANGE63, true, false },
 	{ 241192, DESKBOT_RANGE64, false, false },
 	{ 241193, DESKBOT_RANGE65, false, false },
 	{ 241194, DESKBOT_RANGE66, false, false },
 	{ 241195, DESKBOT_RANGE67, false, false },
 	{ 241196, DESKBOT_RANGE68, false, false },
-	{ 241197, DESKBOT_RANGE69, false, false },
-	{ 241198, DESKBOT_RANGE70, false, false },
+	{ 241197, DESKBOT_RANGE69, true, false },
+	{ 241198, DESKBOT_RANGE70, true, false },
 
 	{ 241199, DESKBOT_RANGE71, false, false },
 	{ 241200, DESKBOT_RANGE72, false, false },
@@ -462,16 +462,16 @@ const ScriptRange DESKBOT_RANGES[146] = {
 	{ 241205, DESKBOT_RANGE77, false, false },
 	{ 241166, DESKBOT_RANGE78, false, false },
 	{ 241206, DESKBOT_RANGE79, false, false },
-	{ 241207, DESKBOT_RANGE80, false, false },
+	{ 241207, DESKBOT_RANGE80, true, false },
 
-	{ 241208, DESKBOT_RANGE81, false, false },
-	{ 241209, DESKBOT_RANGE82, false, false },
-	{ 241210, DESKBOT_RANGE83, false, false },
-	{ 241211, DESKBOT_RANGE84, false, false },
-	{ 241212, DESKBOT_RANGE85, false, false },
-	{ 241213, DESKBOT_RANGE86, false, false },
-	{ 241214, DESKBOT_RANGE87, false, false },
-	{ 241215, DESKBOT_RANGE88, false, false },
+	{ 241208, DESKBOT_RANGE81, true, false },
+	{ 241209, DESKBOT_RANGE82, true, false },
+	{ 241210, DESKBOT_RANGE83, true, false },
+	{ 241211, DESKBOT_RANGE84, true, false },
+	{ 241212, DESKBOT_RANGE85, true, false },
+	{ 241213, DESKBOT_RANGE86, true, false },
+	{ 241214, DESKBOT_RANGE87, true, false },
+	{ 241215, DESKBOT_RANGE88, true, false },
 
 	{ 241217, DESKBOT_RANGE89, false, false },
 	{ 241218, DESKBOT_RANGE89, false, false },
@@ -517,22 +517,142 @@ const ScriptRange DESKBOT_RANGES[146] = {
 	{ 241258, DESKBOT_RANGE89, false, false },
 	{ 241259, DESKBOT_RANGE89, false, false },
 
-	{ 241216, DESKBOT_RANGE90, false, false },
+	{ 241216, DESKBOT_RANGE90, true, false },
 	{ 241625, DESKBOT_RANGE91, false, false },
-	{ 241626, DESKBOT_RANGE92, false, false },
+	{ 241626, DESKBOT_RANGE92, true, false },
 	{ 241627, DESKBOT_RANGE93, false, false },
-	{ 241628, DESKBOT_RANGE94, false, false },
-	{ 241629, DESKBOT_RANGE95, false, false },
-	{ 241630, DESKBOT_RANGE96, false, false },
-	{ 241631, DESKBOT_RANGE97, false, false },
-	{ 241632, DESKBOT_RANGE98, false, false },
-	{ 241633, DESKBOT_RANGE99, false, false },
-	{ 241634, DESKBOT_RANGE100, false, false },
-
-	{ 241738, DESKBOT_RANGE101, false, false },
-	{ 241739, DESKBOT_RANGE102, false, false },
-	{ 241740, DESKBOT_RANGE103, false, false },
-	{ 241741, DESKBOT_RANGE104, false, false }
+	{ 241628, DESKBOT_RANGE94, true, false },
+	{ 241629, DESKBOT_RANGE95, true, false },
+	{ 241630, DESKBOT_RANGE96, true, false },
+	{ 241631, DESKBOT_RANGE97, true, false },
+	{ 241632, DESKBOT_RANGE98, true, false },
+	{ 241633, DESKBOT_RANGE99, true, false },
+	{ 241634, DESKBOT_RANGE100, true, false },
+
+	{ 241738, DESKBOT_RANGE101, true, false },
+	{ 241739, DESKBOT_RANGE102, true, false },
+	{ 241740, DESKBOT_RANGE103, true, false },
+	{ 241741, DESKBOT_RANGE104, true, false }
+};
+
+const uint DOORBOT_RANGE1[] = { 220075, 220078, 220080, 220081, 220082, 220083, 220084, 0 };
+const uint DOORBOT_RANGE2[] = { 220077, 220079, 220076, 0 };
+const uint DOORBOT_RANGE3[] = {
+	220008, 220009, 220010, 220011, 220012, 220013, 220014,
+	220015, 220016, 221053, 221054, 221055, 221056, 221057,
+	221058, 221059, 221060, 221061, 0
+};
+const uint DOORBOT_RANGE4[] = {
+	221062, 221063, 221064, 221065, 221066, 221067, 221068,
+	221069, 221070, 221071, 221072, 221073, 221074, 221075,
+	221076, 221077, 221078, 221079, 221080, 221081, 221082,
+	0
+};
+const uint DOORBOT_RANGE5[] = { 220737, 220738, 220739, 220740, 0 };
+const uint DOORBOT_RANGE6[] = { 220759, 220760, 220761, 0 };
+const uint DOORBOT_RANGE7[] = { 220771, 220772, 220773, 220774, 220775, 0 };
+const uint DOORBOT_RANGE8[] = { 220792, 220793, 220794, 220795, 220796, 220797, 220798, 0 };
+const uint DOORBOT_RANGE9[] = { 220017, 220018, 220019, 220020, 220833, 0 };
+const uint DOORBOT_RANGE10[] = { 220035, 220036, 220038, 0 };
+
+const uint DOORBOT_RANGE11[] = { 220093, 220094, 220095, 0 };
+const uint DOORBOT_RANGE12[] = { 220109, 220117, 0 };
+const uint DOORBOT_RANGE13[] = { 220837, 220838, 220839, 0 };
+const uint DOORBOT_RANGE14[] = { 220849, 220850, 220851, 220852, 0 };
+const uint DOORBOT_RANGE15[] = { 220858, 220860, 0 };
+const uint DOORBOT_RANGE16[] = { 221043, 221045, 221046, 221047, 221048, 221049, 221050,
+	221051, 221052, 221044, 0 };
+const uint DOORBOT_RANGE17[] = { 221140, 221141, 221142, 221143, 221144, 221145, 221146,
+	221147, 0 };
+const uint DOORBOT_RANGE18[] = { 220885, 220886, 220887, 220888, 220890, 220883, 220884,
+	220889, 0 };
+const uint DOORBOT_RANGE19[] = {
+	221356, 221364, 221365, 221366, 221129, 221367, 221368,
+	221132, 221369, 221357, 221359, 221363, 220902, 0
+};
+const uint DOORBOT_RANGE20[] = { 221129, 221130, 221131, 221132, 221133, 221136, 221137,
+	221138, 0 };
+const uint DOORBOT_RANGE21[] = { 221157, 221165, 221166, 221167, 221130, 221168, 221169,
+	221132, 221170, 221171, 221158, 220910, 0 };
+const uint DOORBOT_RANGE22[] = { 221356, 221364, 221366, 221129, 221368, 221132, 221369,
+	221357, 221359, 221363, 220902, 220919, 220911, 220936,
+	220942, 220946, 220988, 0
+};
+const uint DOORBOT_RANGE23[] = {
+	221157, 221165, 221166, 221167, 221130, 221168, 221169,
+	221132, 221170, 221171, 221158, 220910, 220911, 220929,
+	220944, 220948, 220909, 0
+};
+const uint DOORBOT_RANGE24[] = { 220980, 220981, 220982, 220984, 220956, 220931, 220926,
+	220916, 220914, 220913, 220974, 220952, 0 };
+const uint DOORBOT_RANGE25[] = { 220873, 220874, 220875, 220876, 220877, 0 };
+const uint DOORBOT_RANGE26[] = { 221242, 221243, 221244, 221242, 221243, 221244, 221251, 0 };
+const uint DOORBOT_RANGE27[] = { 221245, 221246, 221247, 221248, 221249, 221250, 0 };
+const uint DOORBOT_RANGE28[] = { 221777, 221780, 0 };
+const uint DOORBOT_RANGE29[] = { 221966, 221967, 0 };
+const uint DOORBOT_RANGE30[] = { 220986, 222096, 222099, 222102, 0 };
+const uint DOORBOT_RANGE31[] = { 222193, 222197, 222198, 222199, 222200, 222201, 222202,
+	222203, 222204, 222194, 222195, 222196, 0 };
+const uint DOORBOT_RANGE32[] = { 221927, 221931, 0 };
+const uint DOORBOT_RANGE33[] = { 221945, 221948, 0 };
+const uint DOORBOT_RANGE34[] = { 222004, 222001, 0 };
+const uint DOORBOT_RANGE35[] = { 222259, 222262, 222265, 222268, 222271, 222274, 222277,
+	222280, 222283, 222254, 222257, 0 };
+const uint DOORBOT_RANGE36[] = { 221364, 221365, 221360, 221252, 220952, 220916, 220996,
+	220924, 220926, 220931, 220956, 220967, 220968, 220980,
+	220981, 220982, 220984, 220988, 0 };
+const uint DOORBOT_RANGE37[] = {
+	221166, 221252, 220984, 220952, 220996, 220916, 220926,
+	220931, 220948, 220965, 220967, 220980, 220981, 220982,
+	220983, 220988, 220903, 221019, 221355, 0 };
+const uint DOORBOT_RANGE38[] = { 222248, 220081, 220082, 220083, 220084, 0 };
+const uint DOORBOT_RANGE39[] = { 221095, 222202, 222239, 221758, 221759, 221762, 221763,
+	221766, 221767, 221768, 0 };
+
+#define DOORBOT_RANGE_COUNT 39
+const ScriptRange DOORBOT_RANGES[39] = {
+	{ 220074, DOORBOT_RANGE1, false, false },
+	{ 221381, DOORBOT_RANGE2, false, false },
+	{ 220000, DOORBOT_RANGE3, true, false },
+	{ 221380, DOORBOT_RANGE4, true, false },
+	{ 220736, DOORBOT_RANGE5, false, false },
+	{ 220759, DOORBOT_RANGE6, false, false },
+	{ 220771, DOORBOT_RANGE7, false, false },
+	{ 220792, DOORBOT_RANGE8, false, false },
+	{ 220017, DOORBOT_RANGE9, false, false },
+	{ 220037, DOORBOT_RANGE10, false, false },
+
+	{ 220093, DOORBOT_RANGE11, false, false },
+	{ 220109, DOORBOT_RANGE12, false, false },
+	{ 220837, DOORBOT_RANGE13, false, false },
+	{ 220849, DOORBOT_RANGE14, false, false },
+	{ 220858, DOORBOT_RANGE15, false, false },
+	{ 221043, DOORBOT_RANGE16, false, false },
+	{ 221140, DOORBOT_RANGE17, false, false },
+	{ 220883, DOORBOT_RANGE18, false, false },
+	{ 221375, DOORBOT_RANGE19, true, false },
+	{ 221129, DOORBOT_RANGE20, true, false },
+
+	{ 221376, DOORBOT_RANGE21, true, false },
+	{ 221377, DOORBOT_RANGE22, true, false },
+	{ 221378, DOORBOT_RANGE23, true, false },
+	{ 221379, DOORBOT_RANGE24, true, false },
+	{ 220873, DOORBOT_RANGE25, false, false },
+	{ 221242, DOORBOT_RANGE26, false, false },
+	{ 221245, DOORBOT_RANGE27, false, false },
+	{ 221777, DOORBOT_RANGE28, false, false },
+	{ 221966, DOORBOT_RANGE29, false, false },
+	{ 220986, DOORBOT_RANGE30, false, false },
+
+	{ 222193, DOORBOT_RANGE31, false, false },
+	{ 221927, DOORBOT_RANGE32, false, false },
+	{ 221948, DOORBOT_RANGE33, false, true },
+	{ 222000, DOORBOT_RANGE34, false, false },
+	{ 222259, DOORBOT_RANGE35, false, false },
+	{ 222415, DOORBOT_RANGE36, true, false },
+	{ 222416, DOORBOT_RANGE37, true, false },
+	{ 222248, DOORBOT_RANGE38, false, false },
+	{ 221095, DOORBOT_RANGE39, true, false }
 };
 
 void writeScriptRange(const char *name, const ScriptRange *ranges, int count) {
@@ -557,4 +677,5 @@ void writeScriptRange(const char *name, const ScriptRange *ranges, int count) {
 void writeAllScriptRanges() {
 	writeScriptRange("Ranges/Barbot", BARBOT_RANGES, BARBOT_RANGE_COUNT);
 	writeScriptRange("Ranges/Deskbot", DESKBOT_RANGES, DESKBOT_RANGE_COUNT);
+	writeScriptRange("Ranges/Doorbot", DOORBOT_RANGES, DOORBOT_RANGE_COUNT);
 }
\ No newline at end of file


Commit: 0825f00bccfe94f055afba4ba721f73d8a6297fe
    https://github.com/scummvm/scummvm/commit/0825f00bccfe94f055afba4ba721f73d8a6297fe
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:39-04:00

Commit Message:
DEVTOOLS: Added Liftbot ranges to create_titanic

Changed paths:
    devtools/create_titanic/script_ranges.cpp



diff --git a/devtools/create_titanic/script_ranges.cpp b/devtools/create_titanic/script_ranges.cpp
index 58dcecf..8f52bd1 100644
--- a/devtools/create_titanic/script_ranges.cpp
+++ b/devtools/create_titanic/script_ranges.cpp
@@ -655,6 +655,116 @@ const ScriptRange DOORBOT_RANGES[39] = {
 	{ 221095, DOORBOT_RANGE39, true, false }
 };
 
+const uint LIFTBOT_RANGE1[] = { 210028, 210034, 210039, 210044, 210049, 210054, 0 };
+const uint LIFTBOT_RANGE2[] = { 210321, 210322, 210323, 210324, 210792, 210794, 210796, 210793, 210795, 210797, 0 };
+const uint LIFTBOT_RANGE3[] = {
+	210572, 210568, 210338, 210341, 210355, 210419, 210430, 210441, 210460, 210463,
+	210464, 210475, 210477, 210496, 210497, 210503, 210357, 210359, 210372, 210382,
+	210388, 210393, 210394, 210400, 210415, 0
+};
+const uint LIFTBOT_RANGE4[] = {
+	210568, 210342, 210555, 210551, 210534, 210557, 210334, 210474, 210504, 210505,
+	210517, 210358, 210359, 210360, 210376, 210378, 210379, 210382, 210396, 210398,
+	210402, 0
+};
+const uint LIFTBOT_RANGE5[] = {
+	210572, 210568, 210397, 210408, 210419, 210430, 210441, 210460, 210463, 210464,
+	210475, 210477, 210496, 210497, 210503, 210357, 210359, 210372, 210382, 210388,
+	210393, 210394, 210400, 210415, 0
+};
+const uint LIFTBOT_RANGE6[] = {
+	210555, 210551, 210534, 210557, 210334, 210474, 210504, 210505, 210517, 210358,
+	210359, 210360, 210376, 210378, 210379, 210382, 210396, 210398, 210402, 0
+};
+const uint LIFTBOT_RANGE7[] = { 210344, 210447, 210529, 210530, 210351, 210356, 210378, 0 };
+const uint LIFTBOT_RANGE8[] = { 210512, 210513, 210345, 0 };
+const uint LIFTBOT_RANGE9[] = { 210847, 210848, 210153, 0 };
+const uint LIFTBOT_RANGE10[] = { 210846, 210153, 0 };
+
+const uint LIFTBOT_RANGE11[] = { 210595, 210601, 210602, 210603, 210604, 210605, 210606, 210607, 210608, 210596,
+	210597, 210598, 210599, 210600, 0 };
+const uint LIFTBOT_RANGE12[] = { 210489, 210570, 210610, 210610, 210610, 210610, 210610, 0 };
+const uint LIFTBOT_RANGE13[] = { 210819, 210822, 210823, 210824, 210825, 210827, 210828, 210829, 210820, 210821,
+	210965, 210969, 210965, 210969, 0 };
+const uint LIFTBOT_RANGE14[] = { 210869, 210870, 210871, 210872, 210873, 0 };
+const uint LIFTBOT_RANGE15[] = { 210875, 210876, 210877, 210878, 210879, 0 };
+const uint LIFTBOT_RANGE16[] = { 210866, 210867, 0 };
+const uint LIFTBOT_RANGE17[] = { 210853, 210854, 0 };
+const uint LIFTBOT_RANGE18[] = { 210858, 210859, 0 };
+const uint LIFTBOT_RANGE19[] = { 210860, 210861, 210862, 210863, 210864, 210865, 0 };
+const uint LIFTBOT_RANGE20[] = { 210771, 210914, 0 };
+
+const uint LIFTBOT_RANGE21[] = { 210764, 210765, 210766, 210767, 210768, 210769, 210770, 0 };
+const uint LIFTBOT_RANGE22[] = { 210607, 210799, 210800, 210801, 210802, 210815, 210890, 210892, 0 };
+const uint LIFTBOT_RANGE23[] = { 210355, 210359, 210376, 210388, 210416, 210568, 210551, 0 };
+const uint LIFTBOT_RANGE24[] = { 210511, 210522, 210382, 210383, 210392, 210337, 210546, 210576, 0 };
+const uint LIFTBOT_RANGE25[] = { 210775, 210777, 210778, 210779, 210780, 210781, 210782, 210783, 210784, 210776,
+	210459, 210789, 210790, 210791, 0 };
+const uint LIFTBOT_RANGE26[] = { 210780, 210781, 210782, 210783, 210784, 210780, 210781, 210782, 210783, 210784,
+	210789, 210790, 210791, 0 };
+const uint LIFTBOT_RANGE27[] = { 210440, 210442, 0 };
+const uint LIFTBOT_RANGE28[] = { 210906, 210907, 210908, 210909, 210910, 210911, 210912, 0 };
+const uint LIFTBOT_RANGE29[] = { 210901, 210902, 210903, 210904, 210905, 0 };
+const uint LIFTBOT_RANGE30[] = { 210970, 210971, 210974, 210975, 210976, 210977, 210978, 210979, 210980, 210981,
+	210972, 210973, 0 };
+
+const uint LIFTBOT_RANGE31[] = { 210830, 210831, 210832, 210833, 210834, 210835, 210836, 210837, 0 };
+const uint LIFTBOT_RANGE32[] = { 210692, 210695, 210696, 210697, 210698, 210699, 210700, 210701, 210702, 210693, 210694, 0 };
+const uint LIFTBOT_RANGE33[] = { 210915, 210916, 210917, 0 };
+const uint LIFTBOT_RANGE34[] = { 210688, 210689, 210690, 0 };
+const uint LIFTBOT_RANGE35[] = { 210946, 210947, 210948, 210949, 210950, 210951, 210952, 210953, 210954, 0 };
+const uint LIFTBOT_RANGE36[] = { 210923, 210924, 0 };
+const uint LIFTBOT_RANGE37[] = { 210925, 210926, 210927, 210928, 210929, 210930, 210931, 210932, 210933, 0 };
+const uint LIFTBOT_RANGE38[] = { 210413, 210799, 210800, 210801, 210802, 210888, 210889, 210890, 210891, 210892, 0 };
+const uint LIFTBOT_RANGE39[] = { 210682, 210684, 210028, 210034, 210683, 210039, 210685, 210044, 210049, 210686,
+	210054, 0 };
+
+#define LIFTBOT_RANGE_COUNT 40
+const ScriptRange LIFTBOT_RANGES[40] = {
+	{ 210033, LIFTBOT_RANGE1, false, false },
+	{ 210321, LIFTBOT_RANGE2, true, false },
+	{ 210580, LIFTBOT_RANGE3, true, false },
+	{ 210581, LIFTBOT_RANGE4, true, false },
+	{ 210582, LIFTBOT_RANGE5, true, false },
+	{ 210583, LIFTBOT_RANGE6, true, false },
+	{ 210584, LIFTBOT_RANGE7, true, false },
+	{ 210585, LIFTBOT_RANGE8, true, false },
+	{ 210586, LIFTBOT_RANGE9, false, false },
+	{ 210587, LIFTBOT_RANGE10, false, false },
+
+	{ 210588, LIFTBOT_RANGE11, true, false },
+	{ 210589, LIFTBOT_RANGE12, true, false },
+	{ 210590, LIFTBOT_RANGE13, true, false },
+	{ 210869, LIFTBOT_RANGE14, false, false },
+	{ 210875, LIFTBOT_RANGE15, false, false },
+	{ 210866, LIFTBOT_RANGE16, false, false },
+	{ 210853, LIFTBOT_RANGE17, false, false },
+	{ 210858, LIFTBOT_RANGE18, false, false },
+	{ 210860, LIFTBOT_RANGE19, false, false },
+	{ 210771, LIFTBOT_RANGE20, false, false },
+
+	{ 210764, LIFTBOT_RANGE21, false, false },
+	{ 210958, LIFTBOT_RANGE22, true, false },
+	{ 210591, LIFTBOT_RANGE23, true, false },
+	{ 210592, LIFTBOT_RANGE24, true, false },
+	{ 210594, LIFTBOT_RANGE25, true, false },
+	{ 210593, LIFTBOT_RANGE26, true, false },
+	{ 210440, LIFTBOT_RANGE27, false, false },
+	{ 210906, LIFTBOT_RANGE28, true, false },
+	{ 210901, LIFTBOT_RANGE29, true, false },
+	{ 210970, LIFTBOT_RANGE30, false, false },
+
+	{ 210830, LIFTBOT_RANGE31, true, false },
+	{ 210692, LIFTBOT_RANGE32, false, false },
+	{ 210915, LIFTBOT_RANGE33, false, false },
+	{ 210688, LIFTBOT_RANGE34, false, false },
+	{ 210946, LIFTBOT_RANGE35, true, false },
+	{ 210923, LIFTBOT_RANGE36, false, false },
+	{ 210925, LIFTBOT_RANGE37, true, false },
+	{ 210413, LIFTBOT_RANGE38, true, false },
+	{ 210682, LIFTBOT_RANGE39, false, false }
+};
+
 void writeScriptRange(const char *name, const ScriptRange *ranges, int count) {
 	outputFile.seek(dataOffset);
 
@@ -678,4 +788,5 @@ void writeAllScriptRanges() {
 	writeScriptRange("Ranges/Barbot", BARBOT_RANGES, BARBOT_RANGE_COUNT);
 	writeScriptRange("Ranges/Deskbot", DESKBOT_RANGES, DESKBOT_RANGE_COUNT);
 	writeScriptRange("Ranges/Doorbot", DOORBOT_RANGES, DOORBOT_RANGE_COUNT);
+	writeScriptRange("Ranges/Liftbot", LIFTBOT_RANGES, LIFTBOT_RANGE_COUNT);
 }
\ No newline at end of file


Commit: 96f700a205d983111ffccf2eed25ab728d40434c
    https://github.com/scummvm/scummvm/commit/96f700a205d983111ffccf2eed25ab728d40434c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:43-04:00

Commit Message:
DEVTOOLS: Added MaitreD ranges to create_titanic

Changed paths:
    devtools/create_titanic/script_ranges.cpp



diff --git a/devtools/create_titanic/script_ranges.cpp b/devtools/create_titanic/script_ranges.cpp
index 8f52bd1..511d266 100644
--- a/devtools/create_titanic/script_ranges.cpp
+++ b/devtools/create_titanic/script_ranges.cpp
@@ -765,6 +765,254 @@ const ScriptRange LIFTBOT_RANGES[40] = {
 	{ 210682, LIFTBOT_RANGE39, false, false }
 };
 
+const uint MAITRED_RANGE1[] = { 260009, 260010, 260011, 260012, 0 };
+const uint MAITRED_RANGE2[] = { 
+	260043, 260013, 260044, 260014, 260017, 260015, 260016, 260040, 260042, 260019,
+	260029, 260021, 260018, 260020, 260022, 260023, 260041, 260028, 260045, 260031,
+	260032, 260033, 260030, 260046, 260034, 260039, 0
+};
+const uint MAITRED_RANGE3[] = {
+	260013, 260014, 260029, 260040, 260041, 260042, 260043, 260044, 260045, 260046,
+	260015, 260016, 260017, 260018, 260019, 260020, 260021, 260022, 260023, 260028,
+	260030, 260031, 260032, 260033, 260034, 260035, 260039, 0
+};
+const uint MAITRED_RANGE4[] = {
+	260013, 260014, 260029, 260040, 260041, 260042, 260043, 260044, 260045, 260046,
+	260015, 260016, 260017, 260018, 260019, 260020, 260021, 260022, 260023, 260025,
+	260028, 260030, 260031, 260032, 260033, 260034, 260036, 260039, 0
+};
+const uint MAITRED_RANGE5[] = {
+	260013, 260014, 260029, 260040, 260041, 260042, 260043, 260044, 260045, 260046,
+	260015, 260016, 260017, 260018, 260019, 260020, 260021, 260022, 260023, 260026,
+	260028, 260030, 260031, 260032, 260033, 260034, 260037, 260039, 0
+};
+const uint MAITRED_RANGE6[] = {
+	260013, 260014, 260029, 260040, 260041, 260042, 260043, 260044, 260045, 260046,
+	260015, 260016, 260017, 260018, 260019, 260020, 260021, 260022, 260023, 260027,
+	260028, 260030, 260031, 260032, 260033, 260034, 260038, 260039, 0
+};
+const uint MAITRED_RANGE7[] = { 260048, 260049, 260050, 0 };
+const uint MAITRED_RANGE8[] = { 260054, 260055, 260056, 260057, 260058, 260059, 260060, 0 };
+const uint MAITRED_RANGE9[] = { 260061, 260062, 0 };
+const uint MAITRED_RANGE10[] = { 260064, 260065, 260066, 0 };
+const uint MAITRED_RANGE11[] = { 260068, 260110, 260069, 260070, 260075, 261010, 260181, 260076, 0 };
+const uint MAITRED_RANGE12[] = { 260068, 260110, 260069, 260070, 260075, 261010, 260181, 260076, 0 };
+const uint MAITRED_RANGE13[] = { 260068, 260110, 260069, 260071, 260075, 261010, 260181, 260076, 0 };
+const uint MAITRED_RANGE14[] = { 260068, 260110, 260069, 260072, 260075, 261010, 260181, 260076, 0 };
+const uint MAITRED_RANGE15[] = { 260068, 260110, 260069, 260073, 260075, 261010, 260181, 260076, 0 };
+const uint MAITRED_RANGE16[] = { 260068, 260110, 260069, 260074, 260075, 261010, 260181, 260076, 0 };
+const uint MAITRED_RANGE17[] = { 260078, 260079, 260080, 0 };
+const uint MAITRED_RANGE18[] = { 260081, 260082, 260083, 260084, 260085, 0 };
+const uint MAITRED_RANGE19[] = { 260103, 260104, 260105, 0 };
+const uint MAITRED_RANGE20[] = { 260092, 260093, 260088, 260090, 0 };
+const uint MAITRED_RANGE21[] = {
+	260132, 260133, 260134, 260135, 260136, 260137, 260138, 260139, 260140, 260141,
+	260142, 260143, 260144, 260145, 260146, 260147, 260148, 260149, 260150, 260151,
+	260152, 260153, 260154, 260155, 260156, 0
+};
+const uint MAITRED_RANGE22[] = {
+	260158, 260159, 260160, 260161, 260162, 260163, 260164, 260165, 260166, 260167,
+	260168, 260169, 260170, 260171, 260172, 260173, 260174, 260175, 260176, 260177,
+	260178, 260179, 260180, 0
+};
+const uint MAITRED_RANGE23[] = { 260185, 260186, 260187, 260188, 0 };
+const uint MAITRED_RANGE24[] = { 260191, 260192, 260193, 0 };
+const uint MAITRED_RANGE25[] = { 260203, 260204, 0 }; 
+const uint MAITRED_RANGE26[] = { 260217, 260218, 260219, 260220, 0 };
+const uint MAITRED_RANGE27[] = { 260263, 260264, 260265, 260427, 260053, 0 };
+const uint MAITRED_RANGE28[] = { 260266, 260267, 260268, 0 };
+const uint MAITRED_RANGE29[] = { 260274, 260278, 260287, 260288, 0 };
+const uint MAITRED_RANGE30[] = { 260275, 260276, 260281, 260283, 260289, 260361, 0 };
+const uint MAITRED_RANGE31[] = { 260277, 260280, 260284, 260286, 260359, 0 };
+const uint MAITRED_RANGE32[] = { 260279, 260285, 0 };
+const uint MAITRED_RANGE33[] = { 260275, 260276, 260281, 260283, 260289, 260361, 0 };
+const uint MAITRED_RANGE34[] = { 260282, 260360, 0 };
+const uint MAITRED_RANGE35[] = { 260432, 260306, 0 };
+const uint MAITRED_RANGE36[] = { 260319, 260320, 260321, 0 };
+const uint MAITRED_RANGE37[] = { 260322, 260485, 0 };
+const uint MAITRED_RANGE38[] = { 260324, 260325, 0 };
+const uint MAITRED_RANGE39[] = { 260326, 260327, 0 };
+const uint MAITRED_RANGE40[] = { 260338, 260339, 260340, 260341, 260342, 260343, 0 };
+const uint MAITRED_RANGE41[] = {
+	260054, 260055, 260056, 260057, 260058, 260059, 260345, 260346, 260347, 260348,
+	260349, 260350, 260351, 260352, 260353, 260354, 260355, 260356, 260357, 260358, 0
+};
+const uint MAITRED_RANGE42[] = { 260369, 260370, 0 };
+const uint MAITRED_RANGE43[] = { 260207, 260375, 260767, 0 };
+const uint MAITRED_RANGE44[] = { 260381, 260382, 260383, 260384, 260385, 0 };
+const uint MAITRED_RANGE45[] = { 260389, 260390, 260391, 260392, 260393, 260394, 260395, 260396, 260397, 260398, 0 };
+const uint MAITRED_RANGE46[] = { 260403, 260404, 260763, 0 };
+const uint MAITRED_RANGE47[] = { 260424, 260425, 260426, 0 };
+const uint MAITRED_RANGE48[] = { 260450, 260451, 0 };
+const uint MAITRED_RANGE49[] = { 260521, 260501, 0 };
+const uint MAITRED_RANGE50[] = { 260526, 260429, 0 };
+const uint MAITRED_RANGE51[] = { 260527, 260430, 0 };
+const uint MAITRED_RANGE52[] = { 260528, 260431, 0 };
+const uint MAITRED_RANGE53[] = { 260567, 260568, 0 };
+const uint MAITRED_RANGE54[] = { 260495, 260496, 0 };
+const uint MAITRED_RANGE55[] = { 260511, 260512, 0 };
+const uint MAITRED_RANGE56[] = { 260573, 260572, 0 };
+const uint MAITRED_RANGE57[] = { 260595, 260596, 260597, 260598, 260599, 260600, 0 };
+const uint MAITRED_RANGE58[] = { 260620, 260621, 0 };
+const uint MAITRED_RANGE59[] = { 260623, 260630, 260636, 0 };
+const uint MAITRED_RANGE60[] = { 260215, 260690, 260223, 260691, 0 };
+const uint MAITRED_RANGE61[] = { 260000, 260212, 0 };
+const uint MAITRED_RANGE62[] = { 260213, 260252, 0 };
+const uint MAITRED_RANGE63[] = {
+	260700, 260701, 260702, 260703, 260704, 260705, 260706, 260707, 260708, 260709,
+	260710, 260711, 260712, 260713, 260714, 260715, 260716, 260717, 260718, 260719,
+	260720, 260721, 260731, 260732, 260733, 260734, 260735, 260736, 260737, 260738,
+	260739, 260740, 260741, 260742, 260743, 260744, 260745, 260746, 260747, 260748,
+	260749, 260750, 260751, 260752, 260753, 260754, 260755, 260756, 260757, 260758,
+	260759, 260760, 0
+};
+const uint MAITRED_RANGE64[] = { 260723, 260724, 260725, 260726, 260727, 260728, 260729, 260730, 0 };
+const uint MAITRED_RANGE65[] = { 260765, 260766, 0 };
+const uint MAITRED_RANGE66[] = { 260770, 260771, 0 };
+const uint MAITRED_RANGE67[] = { 260773, 260774, 260775, 260776, 260271, 0 };
+const uint MAITRED_RANGE68[] = { 260801, 260802, 0 };
+const uint MAITRED_RANGE69[] = { 260804, 260805, 260806, 260807, 260808, 0 };
+const uint MAITRED_RANGE70[] = { 260810, 260811, 0 };
+const uint MAITRED_RANGE71[] = { 260813, 260814, 260815, 0 };
+const uint MAITRED_RANGE72[] = { 260818, 260819, 0 };
+const uint MAITRED_RANGE73[] = { 260844, 260845, 260846, 260847, 260848, 0 };
+const uint MAITRED_RANGE74[] = { 260857, 260858, 260859, 0 };
+const uint MAITRED_RANGE75[] = { 260861, 260862, 0 };
+const uint MAITRED_RANGE76[] = { 260864, 260865, 260866, 260867, 260868, 260869, 260870, 260871, 260872, 0 };
+const uint MAITRED_RANGE77[] = { 260876, 260877, 260878, 260879, 0 };
+const uint MAITRED_RANGE78[] = { 260881, 260882, 260883, 260884, 0 };
+const uint MAITRED_RANGE79[] = { 260899, 260900, 260901, 260902, 260903, 260904, 260905, 260906, 260907, 260908,
+260909, 260910, 260911, 260912, 0 };
+const uint MAITRED_RANGE80[] = { 260914, 260915, 0 };
+const uint MAITRED_RANGE81[] = { 260917, 260918, 260919, 0 };
+const uint MAITRED_RANGE82[] = { 260921, 260922, 260923, 260924, 260925, 260926, 260927, 260928, 260929, 260930,
+	260931, 0 };
+const uint MAITRED_RANGE83[] = { 260933, 260946, 0 };
+const uint MAITRED_RANGE84[] = { 260935, 260947, 0 };
+const uint MAITRED_RANGE85[] = { 260939, 260948, 0 };
+const uint MAITRED_RANGE86[] = { 260941, 260949, 0 };
+const uint MAITRED_RANGE87[] = { 260943, 260950, 0 };
+const uint MAITRED_RANGE88[] = { 260945, 260951, 0 };
+const uint MAITRED_RANGE89[] = { 260953, 260954, 260955, 0 };
+const uint MAITRED_RANGE90[] = { 260957, 260958, 0 };
+const uint MAITRED_RANGE91[] = { 260962, 260963, 260964, 260965, 0 };
+const uint MAITRED_RANGE92[] = { 260967, 260968, 260969, 260970, 260971, 260972, 260973, 0 };
+const uint MAITRED_RANGE93[] = { 260982, 260983, 260984, 0 };
+const uint MAITRED_RANGE94[] = { 260993, 260994, 260995, 0 };
+const uint MAITRED_RANGE95[] = { 261013, 261014, 261015, 0 };
+const uint MAITRED_RANGE96[] = { 260798, 260211, 0 };
+const uint MAITRED_RANGE97[] = { 260790, 260416, 260417, 0 };
+
+#define MAITRED_RANGE_COUNT 97
+const ScriptRange MAITRED_RANGES[97] = {
+	{ 260112, MAITRED_RANGE1, true, false },
+	{ 260131, MAITRED_RANGE2, false, false },
+	{ 260113, MAITRED_RANGE3, true, false },
+	{ 260114, MAITRED_RANGE4, true, false },
+	{ 260115, MAITRED_RANGE5, true, false },
+	{ 260116, MAITRED_RANGE6, true, false },
+	{ 260117, MAITRED_RANGE7, false, false },
+	{ 260118, MAITRED_RANGE8, true, false },
+	{ 260120, MAITRED_RANGE9, false, false },
+	{ 260119, MAITRED_RANGE10, false, false },
+
+	{ 260121, MAITRED_RANGE11, false, false },
+	{ 260122, MAITRED_RANGE12, false, false },
+	{ 260123, MAITRED_RANGE13, false, false },
+	{ 260124, MAITRED_RANGE14, false, false },
+	{ 260125, MAITRED_RANGE15, false, false },
+	{ 260126, MAITRED_RANGE16, false, false },
+	{ 260127, MAITRED_RANGE17, false, false },
+	{ 260128, MAITRED_RANGE18, true, false },
+	{ 260129, MAITRED_RANGE19, false, false },
+	{ 260130, MAITRED_RANGE20, false, false },
+
+	{ 260674, MAITRED_RANGE21, true, false },
+	{ 260675, MAITRED_RANGE22, true, false },
+	{ 260676, MAITRED_RANGE23, false, false },
+	{ 260677, MAITRED_RANGE24, false, false },
+	{ 260678, MAITRED_RANGE25, false, false },
+	{ 260679, MAITRED_RANGE26, false, false },
+	{ 260680, MAITRED_RANGE27, true, false },
+	{ 260681, MAITRED_RANGE28, false, false },
+	{ 260682, MAITRED_RANGE29, true, false },
+	{ 260644, MAITRED_RANGE30, true, false },
+
+	{ 260645, MAITRED_RANGE31, true, false },
+	{ 260646, MAITRED_RANGE32, true, false },
+	{ 260647, MAITRED_RANGE33, true, false },
+	{ 260648, MAITRED_RANGE34, true, false },
+	{ 260649, MAITRED_RANGE35, true, false },
+	{ 260650, MAITRED_RANGE36, false, false },
+	{ 260651, MAITRED_RANGE37, false, false },
+	{ 260652, MAITRED_RANGE38, false, false },
+	{ 260653, MAITRED_RANGE39, false, false },
+	{ 260654, MAITRED_RANGE40, true, false },
+
+	{ 260655, MAITRED_RANGE41, true, false },
+	{ 260656, MAITRED_RANGE42, false, false },
+	{ 260657, MAITRED_RANGE43, true, false },
+	{ 260658, MAITRED_RANGE44, false, false },
+	{ 260659, MAITRED_RANGE45, false, false },
+	{ 260660, MAITRED_RANGE46, true, false },
+	{ 260661, MAITRED_RANGE47, false, false },
+	{ 260662, MAITRED_RANGE48, false, false },
+	{ 260663, MAITRED_RANGE49, false, false },
+	{ 260664, MAITRED_RANGE50, false, false },
+
+	{ 260665, MAITRED_RANGE51, false, false },
+	{ 260666, MAITRED_RANGE52, false, false },
+	{ 260667, MAITRED_RANGE53, false, false },
+	{ 260668, MAITRED_RANGE54, false, false },
+	{ 260669, MAITRED_RANGE55, false, false },
+	{ 260670, MAITRED_RANGE56, false, false },
+	{ 260671, MAITRED_RANGE57, false, false },
+	{ 260672, MAITRED_RANGE58, false, false },
+	{ 260673, MAITRED_RANGE59, false, false },
+	{ 260683, MAITRED_RANGE60, false, false },
+
+	{ 260684, MAITRED_RANGE61, false, false },
+	{ 260685, MAITRED_RANGE62, false, false },
+	{ 260699, MAITRED_RANGE63, true, false },
+	{ 260722, MAITRED_RANGE64, true, false },
+	{ 260764, MAITRED_RANGE65, true, false },
+	{ 260769, MAITRED_RANGE66, true, false },
+	{ 260772, MAITRED_RANGE67, true, false },
+	{ 260800, MAITRED_RANGE68, true, false },
+	{ 260803, MAITRED_RANGE69, true, false },
+	{ 260809, MAITRED_RANGE70, true, false },
+
+	{ 260812, MAITRED_RANGE71, true, false },
+	{ 260817, MAITRED_RANGE72, true, false },
+	{ 260843, MAITRED_RANGE73, true, false },
+	{ 260856, MAITRED_RANGE74, true, false },
+	{ 260860, MAITRED_RANGE75, true, false },
+	{ 260863, MAITRED_RANGE76, true, false },
+	{ 260875, MAITRED_RANGE77, true, false },
+	{ 260880, MAITRED_RANGE78, true, false },
+	{ 260898, MAITRED_RANGE79, true, false },
+	{ 260913, MAITRED_RANGE80, true, false },
+
+	{ 260916, MAITRED_RANGE81, true, false },
+	{ 260920, MAITRED_RANGE82, true, false },
+	{ 260932, MAITRED_RANGE83, true, false },
+	{ 260934, MAITRED_RANGE84, true, false },
+	{ 260938, MAITRED_RANGE85, true, false },
+	{ 260940, MAITRED_RANGE86, true, false },
+	{ 260942, MAITRED_RANGE87, true, false },
+	{ 260944, MAITRED_RANGE88, true, false },
+	{ 260952, MAITRED_RANGE89, true, false },
+	{ 260956, MAITRED_RANGE90, true, false },
+
+	{ 260961, MAITRED_RANGE91, true, false },
+	{ 260966, MAITRED_RANGE92, true, false },
+	{ 260981, MAITRED_RANGE93, false, false },
+	{ 260992, MAITRED_RANGE94, true, false },
+	{ 261012, MAITRED_RANGE95, true, false },
+	{ 261016, MAITRED_RANGE96, true, false },
+	{ 261017, MAITRED_RANGE97, true, false }
+};
+
 void writeScriptRange(const char *name, const ScriptRange *ranges, int count) {
 	outputFile.seek(dataOffset);
 
@@ -789,4 +1037,5 @@ void writeAllScriptRanges() {
 	writeScriptRange("Ranges/Deskbot", DESKBOT_RANGES, DESKBOT_RANGE_COUNT);
 	writeScriptRange("Ranges/Doorbot", DOORBOT_RANGES, DOORBOT_RANGE_COUNT);
 	writeScriptRange("Ranges/Liftbot", LIFTBOT_RANGES, LIFTBOT_RANGE_COUNT);
+	writeScriptRange("Ranges/MaitreD", MAITRED_RANGES, MAITRED_RANGE_COUNT);
 }
\ No newline at end of file


Commit: 448b59c0991cb532f61eacdecb684a2fce3ef6b8
    https://github.com/scummvm/scummvm/commit/448b59c0991cb532f61eacdecb684a2fce3ef6b8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:46-04:00

Commit Message:
DEVTOOLS: Added Parrot ranges to create_titanic

Changed paths:
    devtools/create_titanic/script_ranges.cpp



diff --git a/devtools/create_titanic/script_ranges.cpp b/devtools/create_titanic/script_ranges.cpp
index 511d266..8bac9c5 100644
--- a/devtools/create_titanic/script_ranges.cpp
+++ b/devtools/create_titanic/script_ranges.cpp
@@ -1013,6 +1013,86 @@ const ScriptRange MAITRED_RANGES[97] = {
 	{ 261017, MAITRED_RANGE97, true, false }
 };
 
+const uint PARROT_RANGE1[] = { 280171, 280172, 280173, 280174, 280175, 280176, 280153, 280154, 280155, 0 };
+const uint PARROT_RANGE2[] = { 280004, 280005, 280006, 280007, 280008, 280009, 280010, 280011, 280012, 0 };
+const uint PARROT_RANGE3[] = { 280000, 280001, 280002, 0 };
+const uint PARROT_RANGE4[] = { 280161, 280162, 280163, 280164, 280165, 0 };
+const uint PARROT_RANGE5[] = { 280156, 280157, 0 };
+const uint PARROT_RANGE6[] = { 280158, 280159, 280160, 0 };
+const uint PARROT_RANGE7[] = { 280166, 280167, 280168, 0 };
+const uint PARROT_RANGE8[] = { 280179, 280180, 280181, 0 };
+const uint PARROT_RANGE9[] = { 280086, 280087, 280088, 280089, 280090, 280091, 0 };
+const uint PARROT_RANGE10[] = { 280153, 280154, 280155, 0 };
+const uint PARROT_RANGE11[] = { 280043, 280044, 280045, 280046, 280047, 280048, 280049, 280050, 280051, 280052, 0 };
+const uint PARROT_RANGE12[] = { 280014, 280015, 280016, 0 };
+const uint PARROT_RANGE13[] = { 280217, 280039, 280040, 280041, 280042, 0 };
+const uint PARROT_RANGE14[] = { 280119, 280120, 280121, 280122, 280028, 280029, 280030, 280031, 280116, 280117,
+	280118, 0 };
+const uint PARROT_RANGE15[] = { 280028, 280029, 280030, 280031, 0 };
+const uint PARROT_RANGE16[] = { 280123, 280124, 280125, 280126, 280127, 280128, 0 };
+const uint PARROT_RANGE17[] = { 280129, 280130, 280131, 280132, 280133, 280134, 280135, 280136, 280137, 280138, 0 };
+const uint PARROT_RANGE18[] = { 280035, 280036, 280037, 280038, 0 };
+const uint PARROT_RANGE19[] = { 280094, 280095, 280096, 280097, 280098, 280099, 280100, 280101, 280102, 280103,
+	280104, 0 };
+const uint PARROT_RANGE20[] = { 280078, 280079, 280080, 280081, 280082, 280083, 280084, 0 };
+const uint PARROT_RANGE21[] = { 280067, 280068, 0 };
+const uint PARROT_RANGE22[] = { 280139, 280140, 280141, 0 };
+const uint PARROT_RANGE23[] = { 280017, 280018, 280019, 280020, 280021, 280022, 280023, 280024, 280025, 280026,
+	280027, 0 };
+const uint PARROT_RANGE24[] = { 280065, 280143, 280142, 280190, 280144, 280066, 280145, 280146, 280147, 0 };
+const uint PARROT_RANGE25[] = { 280148, 280062, 280063, 0 };
+const uint PARROT_RANGE26[] = { 280071, 280072, 280073, 280074, 280075, 280076, 280077, 0 };
+const uint PARROT_RANGE27[] = { 280218, 280219, 0 };
+const uint PARROT_RANGE28[] = { 280057, 280058, 280059, 280060, 280061, 0 };
+const uint PARROT_RANGE29[] = { 280196, 280197, 280198, 280199, 280200, 0 };
+const uint PARROT_RANGE30[] = { 280202, 280203, 280204, 280205, 0 };
+const uint PARROT_RANGE31[] = { 280193, 280194, 280195, 0 };
+const uint PARROT_RANGE32[] = { 280149, 280069, 280070, 0 };
+const uint PARROT_RANGE33[] = { 280222, 280223, 280224, 280225, 280226, 280227, 280228, 280229, 280230, 280231,
+	280232, 280233, 280234, 0 };
+const uint PARROT_RANGE34[] = { 280268, 280269, 280270, 280271, 280272, 280273, 280274, 0 };
+
+#define PARROT_RANGE_COUNT 34
+const ScriptRange PARROT_RANGES[34] = {
+	{ 280235, PARROT_RANGE1, false, false },
+	{ 280236, PARROT_RANGE1, false, false },
+	{ 280237, PARROT_RANGE1, false, false },
+	{ 280238, PARROT_RANGE1, false, false },
+	{ 280239, PARROT_RANGE1, false, false },
+	{ 280240, PARROT_RANGE1, false, false },
+	{ 280241, PARROT_RANGE1, false, false },
+	{ 280242, PARROT_RANGE1, false, false },
+	{ 280243, PARROT_RANGE1, false, false },
+	{ 280244, PARROT_RANGE1, false, false },
+
+	{ 280245, PARROT_RANGE1, false, false },
+	{ 280246, PARROT_RANGE1, false, false },
+	{ 280247, PARROT_RANGE1, false, false },
+	{ 280248, PARROT_RANGE1, false, false },
+	{ 280249, PARROT_RANGE1, false, false },
+	{ 280250, PARROT_RANGE1, false, false },
+	{ 280251, PARROT_RANGE1, false, false },
+	{ 280252, PARROT_RANGE1, false, false },
+	{ 280253, PARROT_RANGE1, false, false },
+	{ 280254, PARROT_RANGE1, false, false },
+
+	{ 280255, PARROT_RANGE1, false, false },
+	{ 280256, PARROT_RANGE1, false, false },
+	{ 280257, PARROT_RANGE1, false, false },
+	{ 280258, PARROT_RANGE1, false, false },
+	{ 280259, PARROT_RANGE1, false, false },
+	{ 280260, PARROT_RANGE1, false, false },
+	{ 280261, PARROT_RANGE1, false, false },
+	{ 280262, PARROT_RANGE1, false, false },
+	{ 280263, PARROT_RANGE1, false, false },
+	{ 280264, PARROT_RANGE1, false, false },
+
+	{ 280265, PARROT_RANGE1, false, false },
+	{ 280266, PARROT_RANGE1, false, false },
+	{ 280222, PARROT_RANGE1, false, false },
+	{ 280267, PARROT_RANGE1, false, false }
+};
+
 void writeScriptRange(const char *name, const ScriptRange *ranges, int count) {
 	outputFile.seek(dataOffset);
 
@@ -1038,4 +1118,5 @@ void writeAllScriptRanges() {
 	writeScriptRange("Ranges/Doorbot", DOORBOT_RANGES, DOORBOT_RANGE_COUNT);
 	writeScriptRange("Ranges/Liftbot", LIFTBOT_RANGES, LIFTBOT_RANGE_COUNT);
 	writeScriptRange("Ranges/MaitreD", MAITRED_RANGES, MAITRED_RANGE_COUNT);
+	writeScriptRange("Ranges/Parrot", PARROT_RANGES, PARROT_RANGE_COUNT);
 }
\ No newline at end of file


Commit: 31f8f1fbaff7ef0aa68914307fed209d278751d3
    https://github.com/scummvm/scummvm/commit/31f8f1fbaff7ef0aa68914307fed209d278751d3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:49-04:00

Commit Message:
DEVTOOLS: Added SuccUBus ranges to create_titanic

Changed paths:
    devtools/create_titanic/script_ranges.cpp



diff --git a/devtools/create_titanic/script_ranges.cpp b/devtools/create_titanic/script_ranges.cpp
index 8bac9c5..ce2d1b8 100644
--- a/devtools/create_titanic/script_ranges.cpp
+++ b/devtools/create_titanic/script_ranges.cpp
@@ -1093,6 +1093,53 @@ const ScriptRange PARROT_RANGES[34] = {
 	{ 280267, PARROT_RANGE1, false, false }
 };
 
+const uint SUCCUBUS_RANGE1[] = { 230001, 230149, 230078, 230002, 230033, 230067, 230003, 230079, 230034, 230055,
+	230080, 230081, 230064, 230035, 0 };
+const uint SUCCUBUS_RANGE2[] = { 230005, 230085, 230006, 230091, 0 };
+const uint SUCCUBUS_RANGE3[] = { 230009, 230010, 230011, 0 };
+const uint SUCCUBUS_RANGE4[] = { 230030, 230031, 230032, 230033, 230034, 230035, 230036, 230037, 230038, 230142,
+	230097, 0 };
+const uint SUCCUBUS_RANGE5[] = { 230100, 230101, 230102, 230104, 230105, 230113, 0 };
+const uint SUCCUBUS_RANGE6[] = { 230106, 230107, 230108, 230109, 230110, 0 };
+const uint SUCCUBUS_RANGE7[] = { 230119, 230120, 0 };
+const uint SUCCUBUS_RANGE8[] = { 230150, 230152, 230153, 230151, 0 };
+const uint SUCCUBUS_RANGE9[] = { 230154, 230155, 0 };
+const uint SUCCUBUS_RANGE10[] = { 230163, 230164, 230167, 230165, 230166, 230168, 0 };
+const uint SUCCUBUS_RANGE11[] = { 230123, 230124, 230126, 230127, 230128, 230129, 230130, 230131, 0 };
+const uint SUCCUBUS_RANGE12[] = { 230117, 230115, 0 };
+const uint SUCCUBUS_RANGE13[] = { 230179, 230180, 230057, 230181, 230068, 230182, 230118, 230048, 230058, 0 };
+const uint SUCCUBUS_RANGE14[] = { 230191, 230192, 230193, 230194, 0 };
+const uint SUCCUBUS_RANGE15[] = { 230239, 230240, 230241, 0 };
+const uint SUCCUBUS_RANGE16[] = { 230200, 230201, 230202, 230203, 230204, 230205, 230206, 0 };
+const uint SUCCUBUS_RANGE17[] = { 230122, 230073, 230074, 230075, 230076, 230077, 0 };
+const uint SUCCUBUS_RANGE18[] = { 230103, 230114, 230125, 230136, 230147, 230158, 230169, 230079, 230080, 230081,
+	230082, 0 };
+const uint SUCCUBUS_RANGE19[] = { 230207, 230072, 0 };
+
+#define SUCCUBUS_RANGE_COUNT 19
+const ScriptRange SUCCUBUS_RANGES[19] = {
+	{ 230001, SUCCUBUS_RANGE1, false, false },
+	{ 230005, SUCCUBUS_RANGE2, false, false },
+	{ 230009, SUCCUBUS_RANGE3, false, false },
+	{ 230030, SUCCUBUS_RANGE4, false, false },
+	{ 230244, SUCCUBUS_RANGE5, false, false },
+	{ 230106, SUCCUBUS_RANGE6, false, false },
+	{ 230119, SUCCUBUS_RANGE7, false, false },
+	{ 230150, SUCCUBUS_RANGE8, false, false },
+	{ 230154, SUCCUBUS_RANGE9, false, false },
+	{ 230163, SUCCUBUS_RANGE10, false, false },
+
+	{ 230123, SUCCUBUS_RANGE11, false, false },
+	{ 230117, SUCCUBUS_RANGE12, false, false },
+	{ 230179, SUCCUBUS_RANGE13, false, false },
+	{ 230191, SUCCUBUS_RANGE14, false, false },
+	{ 230239, SUCCUBUS_RANGE15, false, false },
+	{ 230200, SUCCUBUS_RANGE16, false, false },
+	{ 230122, SUCCUBUS_RANGE17, false, false },
+	{ 230103, SUCCUBUS_RANGE18, false, false },
+	{ 230207, SUCCUBUS_RANGE19, false, false }
+};
+
 void writeScriptRange(const char *name, const ScriptRange *ranges, int count) {
 	outputFile.seek(dataOffset);
 
@@ -1119,4 +1166,5 @@ void writeAllScriptRanges() {
 	writeScriptRange("Ranges/Liftbot", LIFTBOT_RANGES, LIFTBOT_RANGE_COUNT);
 	writeScriptRange("Ranges/MaitreD", MAITRED_RANGES, MAITRED_RANGE_COUNT);
 	writeScriptRange("Ranges/Parrot", PARROT_RANGES, PARROT_RANGE_COUNT);
+	writeScriptRange("Ranges/SuccUBus", SUCCUBUS_RANGES, SUCCUBUS_RANGE_COUNT);
 }
\ No newline at end of file


Commit: e9c3d180cd245fd25fb0f234e55e30ea864634ce
    https://github.com/scummvm/scummvm/commit/e9c3d180cd245fd25fb0f234e55e30ea864634ce
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:53-04:00

Commit Message:
DEVTOOLS: Fixes for range data generation in create_titanic

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp
    devtools/create_titanic/script_ranges.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 506aaae..b5a8e46 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -51,7 +51,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x400
+#define HEADER_SIZE 0x420
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
diff --git a/devtools/create_titanic/script_ranges.cpp b/devtools/create_titanic/script_ranges.cpp
index ce2d1b8..834b0f5 100644
--- a/devtools/create_titanic/script_ranges.cpp
+++ b/devtools/create_titanic/script_ranges.cpp
@@ -719,8 +719,8 @@ const uint LIFTBOT_RANGE38[] = { 210413, 210799, 210800, 210801, 210802, 210888,
 const uint LIFTBOT_RANGE39[] = { 210682, 210684, 210028, 210034, 210683, 210039, 210685, 210044, 210049, 210686,
 	210054, 0 };
 
-#define LIFTBOT_RANGE_COUNT 40
-const ScriptRange LIFTBOT_RANGES[40] = {
+#define LIFTBOT_RANGE_COUNT 39
+const ScriptRange LIFTBOT_RANGES[39] = {
 	{ 210033, LIFTBOT_RANGE1, false, false },
 	{ 210321, LIFTBOT_RANGE2, true, false },
 	{ 210580, LIFTBOT_RANGE3, true, false },


Commit: 02cd4557a40d10f50b76425c7df0a26cc46aa6a8
    https://github.com/scummvm/scummvm/commit/02cd4557a40d10f50b76425c7df0a26cc46aa6a8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:20:56-04:00

Commit Message:
TITANIC: Remove unneeded NPC setupRanges methods

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 2a67a7b..dc8a5bb 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -118,11 +118,6 @@ bool BarbotScript::proc16() const {
 	return false;
 }
 
-bool BarbotScript::setupRanges() {
-	warning("TODO");
-	return false;
-}
-
 bool BarbotScript::proc18() const {
 	warning("TODO");
 	return false;
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 38f6ecd..c2f53da 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -49,11 +49,6 @@ public:
 	virtual int proc15() const;
 	virtual bool proc16() const;
 	
-	/**
-	 * Setup range sets
-	 */
-	virtual bool setupRanges();
-	
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index a02ef14..dec4ace 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -39,6 +39,7 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	_array[0] = 100;
 	_array[1] = 0;
 
+	loadRanges("Ranges/Bellbot");
 	loadResponses("Responses/Bellbot", 4);
 }
 
@@ -61,11 +62,6 @@ bool BellbotScript::proc16() const {
 	return 0;
 }
 
-bool BellbotScript::setupRanges() {
-	warning("TODO");
-	return 0;
-}
-
 bool BellbotScript::proc18() const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 72b6a84..552f834 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -43,11 +43,6 @@ public:
 	virtual int proc15() const;
 	virtual bool proc16() const;
 
-	/**
-	 * Setup range sets
-	 */
-	virtual bool setupRanges();
-
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 7efd925..e92dd6b 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -64,11 +64,6 @@ bool DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return 0;
 }
 
-bool DeskbotScript::setupRanges() {
-	warning("TODO");
-	return 0;
-}
-
 bool DeskbotScript::proc18() const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 2fd5945..144209a 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -39,11 +39,6 @@ public:
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
-	/**
-	 * Setup range sets
-	 */
-	virtual bool setupRanges();
-
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 7d291b6..65fc194 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -35,6 +35,7 @@ DoorbotScript::DoorbotScript(int val1, const char *charClass, int v2,
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
 	Common::fill(&_array[0], &_array[148], 0);
 	_state = 0;
+	loadRanges("Ranges/Doorbot");
 	loadResponses("Responses/Doorbot");
 }
 
@@ -114,11 +115,6 @@ bool DoorbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return 0;
 }
 
-bool DoorbotScript::setupRanges() {
-	warning("TODO");
-	return 0;
-}
-
 bool DoorbotScript::proc18() const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 05f0048..4c18f1f 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -51,11 +51,6 @@ public:
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
-	/**
-	 * Setup range sets
-	 */
-	virtual bool setupRanges();
-
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 5a63a51..daa3b6c 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -33,6 +33,7 @@ LiftbotScript::LiftbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
 	_state = 0;
+	loadRanges("Ranges/Liftbot");
 	loadResponses("Responses/Liftbot");
 }
 
@@ -90,11 +91,6 @@ bool LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return 0;
 }
 
-bool LiftbotScript::setupRanges() {
-	warning("TODO");
-	return 0;
-}
-
 bool LiftbotScript::proc18() const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index ddbe92b..b4d739e 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -46,11 +46,6 @@ public:
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
-	/**
-	 * Setup range sets
-	 */
-	virtual bool setupRanges();
-
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 7bd19c4..8980da3 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -38,6 +38,7 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
 	CTrueTalkManager::setFlags(15, 0);
 	CTrueTalkManager::setFlags(16, 0);
 
+	loadRanges("Ranges/MaitreD");
 	loadResponses("Responses/MaitreD");
 }
 
@@ -68,11 +69,6 @@ bool MaitreDScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return 0;
 }
 
-bool MaitreDScript::setupRanges() {
-	warning("TODO");
-	return 0;
-}
-
 bool MaitreDScript::proc18() const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index c2d146e..b6e2369 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -42,11 +42,6 @@ public:
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
-	/**
-	 * Setup range sets
-	 */
-	virtual bool setupRanges();
-
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index 93312bb..ecfc8e8 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -25,6 +25,12 @@
 
 namespace Titanic {
 
+ParrotScript::ParrotScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
+	loadRanges("Ranges/Parrot");
+}
+
 int ParrotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
 	if (tag == MKTAG('B', 'Y', 'Z', 'A')) {
 		addResponse(getDialogueId(280246));
@@ -44,11 +50,6 @@ int ParrotScript::proc10() const {
 	return 0;
 }
 
-bool ParrotScript::setupRanges() {
-	warning("TODO");
-	return 0;
-}
-
 bool ParrotScript::proc18() const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index dd8ed96..ad078af 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -30,8 +30,7 @@ namespace Titanic {
 class ParrotScript : public TTnpcScript {
 public:
 	ParrotScript(int val1, const char *charClass, int v2,
-		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
 
 	/**
 	 * Chooses and adds a conversation response based on a specified tag Id.
@@ -41,11 +40,6 @@ public:
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 
-	/**
-	 * Setup range sets
-	 */
-	virtual bool setupRanges();
-
 	virtual bool proc18() const;
 	virtual int proc23() const;
 	virtual const int *getTablePtr(int id);
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index fcd0fcf..4031368 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -25,6 +25,13 @@
 
 namespace Titanic {
 
+SuccUBusScript::SuccUBusScript(int val1, const char *charClass, int v2,
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
+		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
+		_field2D0(0) {
+	loadRanges("Ranges/SuccUBus");
+}
+
 int SuccUBusScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
 	uint dialogueId = tag;
 
@@ -67,11 +74,6 @@ int SuccUBusScript::proc10() const {
 	return 0;
 }
 
-bool SuccUBusScript::setupRanges() {
-	warning("TODO");
-	return 0;
-}
-
 bool SuccUBusScript::proc18() const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 4a9166f..77f338b 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -32,9 +32,7 @@ private:
 	int _field2D0;
 public:
 	SuccUBusScript(int val1, const char *charClass, int v2,
-		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
-		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
-		_field2D0(0) {}
+		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
 
 	/**
 	 * Chooses and adds a conversation response based on a specified tag Id.
@@ -44,11 +42,6 @@ public:
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 
-	/**
-	 * Setup range sets
-	 */
-	virtual bool setupRanges();
-
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc23() const;


Commit: 074dbb8c1a2bfd9ad377ec6f57280d62dfe83803
    https://github.com/scummvm/scummvm/commit/074dbb8c1a2bfd9ad377ec6f57280d62dfe83803
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:21:00-04:00

Commit Message:
DEVTOOLS: Add NPC sentence entry data to create_titanic

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index b5a8e46..ad52a5d 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -51,7 +51,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x420
+#define HEADER_SIZE 0x500
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -310,6 +310,16 @@ void writeNumbers() {
 	dataOffset += size;
 }
 
+void writeString(uint offset) {
+	const int FILE_DIFF = 0x401C00;
+	inputFile.seek(offset - FILE_DIFF);
+	char c;
+	do {
+		c = inputFile.readByte();
+		outputFile.writeByte(c);
+	} while (c);
+}
+
 void writeResponseTree() {
 	const int FILE_DIFF = 0x401C00;
 	outputFile.seek(dataOffset);
@@ -337,12 +347,7 @@ void writeResponseTree() {
 		} else {
 			// Offset to ASCIIZ string
 			outputFile.writeByte(1);
-			inputFile.seek(offset - FILE_DIFF);
-			char c;
-			do {
-				c = inputFile.readByte();
-				outputFile.writeByte(c);
-			} while (c);
+			writeString(offset);
 		}
 	}
 
@@ -351,6 +356,55 @@ void writeResponseTree() {
 	dataOffset += size;
 }
 
+
+void writeSentenceEntries(const char *name, uint tableOffset) {
+	const int FILE_DIFF = 0x401C00;
+	outputFile.seek(dataOffset);
+
+	uint v1, v2, v4, v9, v11, v12, v13;
+	uint offset3, offset5, offset6, offset7, offset8, offset10;
+
+	for (uint idx = 0; ; ++idx) {
+		inputFile.seek(tableOffset - FILE_DIFF + idx * 0x34);
+		v1 = inputFile.readLong();
+		if (!v1)
+			// Reached end of list
+			break;
+
+		// Read data fields
+		v2 = inputFile.readLong();
+		offset3 = inputFile.readLong();
+		v4 = inputFile.readLong();
+		offset5 = inputFile.readLong();
+		offset6 = inputFile.readLong();
+		offset7 = inputFile.readLong();
+		offset8 = inputFile.readLong();
+		v9 = inputFile.readLong();
+		offset10 = inputFile.readLong();
+		v11 = inputFile.readLong();
+		v12 = inputFile.readLong();
+		v13 = inputFile.readLong();
+
+		outputFile.writeLong(v1);
+		outputFile.writeLong(v2);
+		writeString(offset3);
+		outputFile.writeLong(v1);
+		writeString(offset5);
+		writeString(offset6);
+		writeString(offset7);
+		writeString(offset8);
+		outputFile.writeLong(v9);
+		writeString(offset10);
+		outputFile.writeLong(v11);
+		outputFile.writeLong(v12);
+		outputFile.writeLong(v13);
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader("TEXT/TREE", dataOffset, size);
+	dataOffset += size;
+}
+
 void writeHeader() {
 	// Write out magic string
 	const char *MAGIC_STR = "SVTN";
@@ -395,8 +449,17 @@ void writeData() {
 	writeStringArray("TEXT/REPLACEMENTS2", 0x21C120, 1576);
 	writeStringArray("TEXT/REPLACEMENTS3", 0x21D9C8, 82);
 	writeStringArray("TEXT/PRONOUNS", 0x22F718, 15);
-	writeResponseTree();
 
+	writeSentenceEntries("Sentences/Barbot", 0x5ABE60);
+	writeSentenceEntries("Sentences/Bellbot", 0x5C2230);
+	writeSentenceEntries("Sentences/Deskbot", 0x5DCD10);
+	writeSentenceEntries("Sentences/Doorbot", 0x5EC110);
+	writeSentenceEntries("Sentences/Liftbot", 0x6026B0);
+	writeSentenceEntries("Sentences/MaitreD", 0x60CFD8);
+	writeSentenceEntries("Sentences/Parrot", 0x615858);
+	writeSentenceEntries("Sentences/SuccUBus", 0x616698);
+
+	writeResponseTree();
 	writeNumbers();
 	writeAllScriptResponses();
 	writeAllScriptRanges();


Commit: 041ce7f4efd80af0c8cea3b58d87741ee1206a6e
    https://github.com/scummvm/scummvm/commit/041ce7f4efd80af0c8cea3b58d87741ee1206a6e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:21:03-04:00

Commit Message:
DEVTOOLS: Add NPC Id mapping tables to create_titanic

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index ad52a5d..b90777c 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -51,7 +51,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x500
+#define HEADER_SIZE 0x580
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -59,6 +59,8 @@ uint headerOffset = 6;
 uint dataOffset = HEADER_SIZE;
 #define SEGMENT_OFFSET 0x401C00
 
+const int FILE_DIFF = 0x401C00;
+
 static const char *const ITEM_NAMES[46] = {
 	"LeftArmWith", "LeftArmWithout", "RightArmWith", "RightArmWithout", "BridgeRed",
 	"BridgeYellow", "BridgeBlue", "BridgeGreen", "Parrot", "CentralCore", "BrainGreen",
@@ -311,7 +313,6 @@ void writeNumbers() {
 }
 
 void writeString(uint offset) {
-	const int FILE_DIFF = 0x401C00;
 	inputFile.seek(offset - FILE_DIFF);
 	char c;
 	do {
@@ -321,7 +322,6 @@ void writeString(uint offset) {
 }
 
 void writeResponseTree() {
-	const int FILE_DIFF = 0x401C00;
 	outputFile.seek(dataOffset);
 	
 	inputFile.seek(0x619500 - FILE_DIFF);
@@ -358,7 +358,6 @@ void writeResponseTree() {
 
 
 void writeSentenceEntries(const char *name, uint tableOffset) {
-	const int FILE_DIFF = 0x401C00;
 	outputFile.seek(dataOffset);
 
 	uint v1, v2, v4, v9, v11, v12, v13;
@@ -405,6 +404,23 @@ void writeSentenceEntries(const char *name, uint tableOffset) {
 	dataOffset += size;
 }
 
+void writeSentenceMappings(const char *name, uint offset, int numValues) {
+	inputFile.seek(offset - FILE_DIFF);
+	outputFile.seek(dataOffset);
+
+	uint id;
+	while ((id = inputFile.readLong()) != 0) {
+		outputFile.writeLong(id);
+
+		for (int ctr = 0; ctr < numValues; ++ctr)
+			outputFile.writeLong(inputFile.readLong());
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader(name, dataOffset, size);
+	dataOffset += size;
+}
+
 void writeHeader() {
 	// Write out magic string
 	const char *MAGIC_STR = "SVTN";
@@ -458,6 +474,14 @@ void writeData() {
 	writeSentenceEntries("Sentences/MaitreD", 0x60CFD8);
 	writeSentenceEntries("Sentences/Parrot", 0x615858);
 	writeSentenceEntries("Sentences/SuccUBus", 0x616698);
+	writeSentenceMappings("Sentences/Barbot", 0x5B28A0, 8);
+	writeSentenceMappings("Sentences/Bellbot", 0x5CD830, 1);
+	writeSentenceMappings("Sentences/Deskbot", 0x5E2BB8, 4);
+	writeSentenceMappings("Sentences/Doorbot", 0x5F7950, 4);
+	writeSentenceMappings("Sentences/Liftbot", 0x608660, 4);
+	writeSentenceMappings("Sentences/MaitreD", 0x6125C8, 1);
+	writeSentenceMappings("Sentences/Parrot", 0x615B68, 1);
+	writeSentenceMappings("Sentences/SuccUBus", 0x6189F0, 1);
 
 	writeResponseTree();
 	writeNumbers();


Commit: cf79431c72becc58791a610f2ff184801e74f998
    https://github.com/scummvm/scummvm/commit/cf79431c72becc58791a610f2ff184801e74f998
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:21:06-04:00

Commit Message:
DEVTOOLS: Fix NPC Id mapping names in create_titanic

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index b90777c..22489dd 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -474,14 +474,14 @@ void writeData() {
 	writeSentenceEntries("Sentences/MaitreD", 0x60CFD8);
 	writeSentenceEntries("Sentences/Parrot", 0x615858);
 	writeSentenceEntries("Sentences/SuccUBus", 0x616698);
-	writeSentenceMappings("Sentences/Barbot", 0x5B28A0, 8);
-	writeSentenceMappings("Sentences/Bellbot", 0x5CD830, 1);
-	writeSentenceMappings("Sentences/Deskbot", 0x5E2BB8, 4);
-	writeSentenceMappings("Sentences/Doorbot", 0x5F7950, 4);
-	writeSentenceMappings("Sentences/Liftbot", 0x608660, 4);
-	writeSentenceMappings("Sentences/MaitreD", 0x6125C8, 1);
-	writeSentenceMappings("Sentences/Parrot", 0x615B68, 1);
-	writeSentenceMappings("Sentences/SuccUBus", 0x6189F0, 1);
+	writeSentenceMappings("Mappings/Barbot", 0x5B28A0, 8);
+	writeSentenceMappings("Mappings/Bellbot", 0x5CD830, 1);
+	writeSentenceMappings("Mappings/Deskbot", 0x5E2BB8, 4);
+	writeSentenceMappings("Mappings/Doorbot", 0x5F7950, 4);
+	writeSentenceMappings("Mappings/Liftbot", 0x608660, 4);
+	writeSentenceMappings("Mappings/MaitreD", 0x6125C8, 1);
+	writeSentenceMappings("Mappings/Parrot", 0x615B68, 1);
+	writeSentenceMappings("Mappings/SuccUBus", 0x6189F0, 1);
 
 	writeResponseTree();
 	writeNumbers();


Commit: bc8e37e17bb02c81467c36dd8c0b60d8e1f9eca1
    https://github.com/scummvm/scummvm/commit/bc8e37e17bb02c81467c36dd8c0b60d8e1f9eca1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:21:10-04:00

Commit Message:
TITANIC: Load NPC mapping tables

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index dc8a5bb..ebd35a7 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -33,6 +33,7 @@ BarbotScript::BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
 	_state = 0;
+	_mappings.load("Mappings/Barbot", 8);
 	loadRanges("Ranges/Barbot");
 	loadResponses("Responses/Barbot");
 }
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index dec4ace..5acf011 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -39,6 +39,7 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	_array[0] = 100;
 	_array[1] = 0;
 
+	_mappings.load("Mappings/Bellbot", 1);
 	loadRanges("Ranges/Bellbot");
 	loadResponses("Responses/Bellbot", 4);
 }
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index e92dd6b..8c52616 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -40,6 +40,7 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 	if (_field74 == 1)
 		_field74 = 0;
 
+	_mappings.load("Mappings/Deskbot", 4);
 	loadRanges("Ranges/Deskbot");
 	loadResponses("Responses/Deskbot", 4);
 }
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 65fc194..92db168 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -35,6 +35,7 @@ DoorbotScript::DoorbotScript(int val1, const char *charClass, int v2,
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
 	Common::fill(&_array[0], &_array[148], 0);
 	_state = 0;
+	_mappings.load("Mappings/Doorbot", 4);
 	loadRanges("Ranges/Doorbot");
 	loadResponses("Responses/Doorbot");
 }
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index daa3b6c..a040160 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -33,6 +33,7 @@ LiftbotScript::LiftbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
 	_state = 0;
+	_mappings.load("Mappings/Liftbot", 4);
 	loadRanges("Ranges/Liftbot");
 	loadResponses("Responses/Liftbot");
 }
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 8980da3..6b7a124 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -38,6 +38,7 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
 	CTrueTalkManager::setFlags(15, 0);
 	CTrueTalkManager::setFlags(16, 0);
 
+	_mappings.load("Mappings/MaitreD", 1);
 	loadRanges("Ranges/MaitreD");
 	loadResponses("Responses/MaitreD");
 }
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index ecfc8e8..5434b8b 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -28,6 +28,7 @@ namespace Titanic {
 ParrotScript::ParrotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
+	_mappings.load("Mappings/Parrot", 1);
 	loadRanges("Ranges/Parrot");
 }
 
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 4031368..f0f2003 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -29,6 +29,7 @@ SuccUBusScript::SuccUBusScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
 		_field2D0(0) {
+	_mappings.load("Mappings/SuccUBus", 1);
 	loadRanges("Ranges/SuccUBus");
 }
 
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 19ff05d..e6b803a 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -55,6 +55,30 @@ TTscriptRange::TTscriptRange(uint id, const Common::Array<uint> &values,
 
 /*------------------------------------------------------------------------*/
 
+TTscriptMapping::TTscriptMapping() : _id(0) {
+	Common::fill(&_values[0], &_values[8], 0);
+}
+
+/*------------------------------------------------------------------------*/
+
+void TTscriptMappings::load(const char *name, int valuesPerMapping) {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+	_valuesPerMapping = valuesPerMapping;
+
+	while (r->pos() < r->size()) {
+		resize(size() + 1);
+		TTscriptMapping &m = (*this)[size() - 1];
+
+		m._id = r->readUint32LE();
+		for (int idx = 0; idx < valuesPerMapping; ++idx)
+			m._values[idx] = r->readUint32LE();
+	}
+
+	delete r;
+}
+
+/*------------------------------------------------------------------------*/
+
 TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTscriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 77f4445..66cb3af 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -62,6 +62,20 @@ struct TTscriptRange {
 		bool isSequential);
 };
 
+struct TTscriptMapping {
+	uint _id;
+	uint _values[8];
+
+	TTscriptMapping();
+};
+
+class TTscriptMappings : public Common::Array<TTscriptMapping> {
+public:
+	int _valuesPerMapping;
+
+	void load(const char *name, int valuesPerMapping);
+};
+
 class TTnpcScriptBase : public TTscriptBase {
 protected:
 	int _field54;
@@ -100,6 +114,7 @@ protected:
 	Common::Array<TTnpcScriptResponse> _responses;
 	int _valuesPerResponse;
 	Common::Array<TTscriptRange> _ranges;
+	TTscriptMappings _mappings;
 	const TTsentenceEntries *_entriesP;
 	int _entryCount;
 	int _field68;


Commit: c3d2f5f5ca89b0626c0ee933a825572fc952d4b4
    https://github.com/scummvm/scummvm/commit/c3d2f5f5ca89b0626c0ee933a825572fc952d4b4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:21:13-04:00

Commit Message:
DEVTOOLS: Fix writing of sentence entries in create_titanic

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 22489dd..f0f7370 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -51,7 +51,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x580
+#define HEADER_SIZE 0x5A0
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -400,7 +400,7 @@ void writeSentenceEntries(const char *name, uint tableOffset) {
 	}
 
 	uint size = outputFile.size() - dataOffset;
-	writeEntryHeader("TEXT/TREE", dataOffset, size);
+	writeEntryHeader(name, dataOffset, size);
 	dataOffset += size;
 }
 


Commit: 67b19851d56cc507ce48994a1b92407e79f53056
    https://github.com/scummvm/scummvm/commit/67b19851d56cc507ce48994a1b92407e79f53056
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:21:17-04:00

Commit Message:
TITANIC: Add loading of NPC sentence entry data

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index ebd35a7..f768885 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -22,6 +22,7 @@
 
 #include "common/textconsole.h"
 #include "titanic/true_talk/barbot_script.h"
+#include "titanic/true_talk/true_talk_manager.h"
 
 namespace Titanic {
 
@@ -33,9 +34,22 @@ BarbotScript::BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
 	_state = 0;
-	_mappings.load("Mappings/Barbot", 8);
+
 	loadRanges("Ranges/Barbot");
 	loadResponses("Responses/Barbot");
+	setupSentences();
+}
+
+void BarbotScript::setupSentences() {
+	for (int idx = 28; idx < 35; ++idx)
+		CTrueTalkManager::setFlags(idx, 0);
+	setupDials(100, 100, 100);
+
+	if (!_field74)
+		_field74 = 2;
+
+	_mappings.load("Mappings/Barbot", 8);
+	_entries.load("Sentences/Barbot");
 }
 
 int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index c2f53da..c5f7800 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -35,6 +35,11 @@ private:
 	 * Adjust a given dial number by a given delta amount
 	 */
 	void adjustDial(int dialNum, int amount);
+
+	/**
+	 * Setup sentence data
+	 */
+	void setupSentences();
 public:
 	BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 5acf011..78eab6e 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -39,9 +39,17 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	_array[0] = 100;
 	_array[1] = 0;
 
-	_mappings.load("Mappings/Bellbot", 1);
 	loadRanges("Ranges/Bellbot");
 	loadResponses("Responses/Bellbot", 4);
+	setupSentences();
+}
+
+void BellbotScript::setupSentences() {
+	_mappings.load("Mappings/Bellbot", 1);
+	_entries.load("Sentences/Bellbot");
+	_field2DC = 0;
+	_field68 = 0;
+	_entryCount = 0;
 }
 
 void BellbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 552f834..cc70b27 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -34,6 +34,11 @@ private:
 	int _field2D4;
 	int _field2D8;
 	int _field2DC;
+private:
+	/**
+	 * Setup sentence data
+	 */
+	void setupSentences();
 public:
 	BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 8c52616..0b8c7e2 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -40,9 +40,17 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 	if (_field74 == 1)
 		_field74 = 0;
 
-	_mappings.load("Mappings/Deskbot", 4);
 	loadRanges("Ranges/Deskbot");
 	loadResponses("Responses/Deskbot", 4);
+	setupSentences();
+}
+
+void DeskbotScript::setupSentences() {
+	_mappings.load("Mappings/Deskbot", 4);
+	_entries.load("Sentences/Deskbot");
+	_dialValues[0] = _dialValues[1] = 0;
+	_field68 = 0;
+	_entryCount = 0;
 }
 
 void DeskbotScript::proc7(int v1, int v2) {
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 144209a..224496c 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -29,6 +29,11 @@
 namespace Titanic {
 
 class DeskbotScript : public TTnpcScript {
+private:
+	/**
+	 * Setup sentence data
+	 */
+	void setupSentences();
 public:
 	DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 92db168..7e01813 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -23,6 +23,7 @@
 #include "common/textconsole.h"
 #include "titanic/true_talk/doorbot_script.h"
 #include "titanic/true_talk/tt_room_script.h"
+#include "titanic/true_talk/true_talk_manager.h"
 
 namespace Titanic {
 
@@ -33,11 +34,21 @@ static const int STATE_ARRAY[9] = {
 DoorbotScript::DoorbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
-	Common::fill(&_array[0], &_array[148], 0);
-	_state = 0;
-	_mappings.load("Mappings/Doorbot", 4);
 	loadRanges("Ranges/Doorbot");
 	loadResponses("Responses/Doorbot");
+	setupSentences();
+}
+
+void DoorbotScript::setupSentences() {
+	for (int idx = 35; idx < 40; ++idx)
+		CTrueTalkManager::setFlags(idx, 0);
+	_state = 1;
+	_dialValues[0] = _dialValues[1] = 100;
+
+	_mappings.load("Mappings/Doorbot", 4);
+	_entries.load("Sentences/Doorbot");
+	_field68 = 0;
+	_entryCount = 0;
 }
 
 int DoorbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 4c18f1f..f7015e1 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -29,10 +29,14 @@ namespace Titanic {
 
 class DoorbotScript : public TTnpcScript {
 private:
-	int _array[148];
 	int _state;
 private:
 	/**
+	 * Setup sentence data
+	 */
+	void setupSentences();
+
+	/**
 	 * Sets a response
 	 */
 	int setResponse(int dialogueId, int v34 = -1);
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index a040160..b96f485 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -22,6 +22,7 @@
 
 #include "common/textconsole.h"
 #include "titanic/true_talk/liftbot_script.h"
+#include "titanic/true_talk/true_talk_manager.h"
 
 namespace Titanic {
 
@@ -33,9 +34,20 @@ LiftbotScript::LiftbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
 	_state = 0;
-	_mappings.load("Mappings/Liftbot", 4);
+
 	loadRanges("Ranges/Liftbot");
 	loadResponses("Responses/Liftbot");
+	setupSentences();
+}
+
+void LiftbotScript::setupSentences() {
+	CTrueTalkManager::setFlags(27, 0);
+	setupDials(getRandomNumber(40) + 60, getRandomNumber(40) + 60, 0);
+
+	_mappings.load("Mappings/Liftbot", 4);
+	_entries.load("Sentences/Liftbot");
+	_field68 = 0;
+	_entryCount = 0;
 }
 
 int LiftbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index b4d739e..1db3163 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -30,6 +30,11 @@ namespace Titanic {
 class LiftbotScript : public TTnpcScript {
 private:
 	int _state;
+private:
+	/**
+	 * Setup sentence data
+	 */
+	void setupSentences();
 public:
 	LiftbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 6b7a124..2497fd8 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -38,9 +38,16 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
 	CTrueTalkManager::setFlags(15, 0);
 	CTrueTalkManager::setFlags(16, 0);
 
-	_mappings.load("Mappings/MaitreD", 1);
 	loadRanges("Ranges/MaitreD");
 	loadResponses("Responses/MaitreD");
+	setupSentences();
+}
+
+void MaitreDScript::setupSentences() {
+	_mappings.load("Mappings/MaitreD", 1);
+	_entries.load("Sentences/MaitreD");
+	_field68 = 0;
+	_entryCount = 0;
 }
 
 int MaitreDScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index b6e2369..0ebfabf 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -28,6 +28,11 @@
 namespace Titanic {
 
 class MaitreDScript : public TTnpcScript {
+private:
+	/**
+	 * Setup sentence data
+	 */
+	void setupSentences();
 public:
 	MaitreDScript(int val1, const char *charClass, int v2,
 			const char *charName, int v3, int val2);
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index 5434b8b..eb08d7c 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -28,8 +28,16 @@ namespace Titanic {
 ParrotScript::ParrotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
-	_mappings.load("Mappings/Parrot", 1);
+
 	loadRanges("Ranges/Parrot");
+	setupSentences();
+}
+
+void ParrotScript::setupSentences() {
+	_mappings.load("Mappings/Parrot", 1);
+	_entries.load("Sentences/Parrot");
+	_field68 = 0;
+	_entryCount = 0;
 }
 
 int ParrotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index ad078af..f5d9cb2 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -28,6 +28,11 @@
 namespace Titanic {
 
 class ParrotScript : public TTnpcScript {
+private:
+	/**
+	 * Setup sentence data
+	 */
+	void setupSentences(); 
 public:
 	ParrotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index f0f2003..1a23484 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -29,8 +29,16 @@ SuccUBusScript::SuccUBusScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
 		_field2D0(0) {
-	_mappings.load("Mappings/SuccUBus", 1);
+
 	loadRanges("Ranges/SuccUBus");
+	setupSentences();
+}
+
+void SuccUBusScript::setupSentences() {
+	_mappings.load("Mappings/SuccUBus", 1);
+	_entries.load("Sentences/SuccUBus");
+	_field68 = 0;
+	_entryCount = 0;
 }
 
 int SuccUBusScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 77f338b..fffdd80 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -30,6 +30,11 @@ namespace Titanic {
 class SuccUBusScript : public TTnpcScript {
 private:
 	int _field2D0;
+private:
+	/**
+	 * Setup sentence data
+	 */
+	void setupSentences(); 
 public:
 	SuccUBusScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index e6b803a..e06184a 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -55,6 +55,42 @@ TTscriptRange::TTscriptRange(uint id, const Common::Array<uint> &values,
 
 /*------------------------------------------------------------------------*/
 
+
+bool TTsentenceEntry::load(Common::SeekableReadStream *s) {
+	if (s->pos() >= s->size())
+		return false;
+
+	_field0 = s->readUint32LE();
+	_field4 = s->readUint32LE();
+	_string8 = readStringFromStream(s);
+	_fieldC = s->readUint32LE();
+	_string10 = readStringFromStream(s);
+	_string14 = readStringFromStream(s);
+	_string18 = readStringFromStream(s);
+	_string1C = readStringFromStream(s);
+	_field20 = s->readUint32LE();
+	_string24 = readStringFromStream(s);
+	_field28 = s->readUint32LE();
+	_field2C = s->readUint32LE();
+	_field30 = s->readUint32LE();
+
+	return true;
+}
+
+/*------------------------------------------------------------------------*/
+
+void TTsentenceEntries::load(const CString &resName) {
+	TTsentenceEntry entry;
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(resName);
+
+	while (entry.load(r))
+		push_back(entry);
+
+	delete r;
+}
+
+/*------------------------------------------------------------------------*/
+
 TTscriptMapping::TTscriptMapping() : _id(0) {
 	Common::fill(&_values[0], &_values[8], 0);
 }
@@ -90,7 +126,7 @@ TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
 TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
-		_entriesP(nullptr), _entryCount(0), _field68(0), _field6C(0), _rangeResetCtr(0),
+		_entryCount(0), _field68(0), _field6C(0), _rangeResetCtr(0),
 		_field74(0), _field78(0), _field7C(0), _field80(0), _field2CC(false) {
 	CTrueTalkManager::_v2 = 0;
 	Common::fill(&_dialValues[0], &_dialValues[DIALS_ARRAY_COUNT], 0);
@@ -183,7 +219,7 @@ int TTnpcScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 }
 
 void TTnpcScript::process(TTroomScript *roomScript, TTsentence *sentence) {
-	processSentence(_entriesP, _entryCount, roomScript, sentence);
+	processSentence(&_entries, _entryCount, roomScript, sentence);
 }
 
 int TTnpcScript::proc8() const {
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 66cb3af..3a4ac57 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -37,7 +37,6 @@ class CPetControl;
 class TTroomScript;
 class TTsentence;
 struct TTsentenceEntry;
-class TTsentenceEntries;
 
 struct TTnpcScriptResponse {
 	uint _tag;
@@ -62,6 +61,40 @@ struct TTscriptRange {
 		bool isSequential);
 };
 
+
+struct TTsentenceEntry {
+	int _field0;
+	int _field4;
+	CString _string8;
+	int _fieldC;
+	CString _string10;
+	CString _string14;
+	CString _string18;
+	CString _string1C;
+	int _field20;
+	CString _string24;
+	int _field28;
+	int _field2C;
+	int _field30;
+
+	TTsentenceEntry() : _field0(0), _field4(0), _fieldC(0),
+		_field20(0), _field28(0), _field2C(0), _field30(0) {}
+
+	/**
+	* Load an entry from the passed stream, and returns true
+	* if an entry was successfully loaded
+	*/
+	bool load(Common::SeekableReadStream *s);
+};
+
+class TTsentenceEntries : public Common::Array<TTsentenceEntry> {
+public:
+	/**
+	* Load a list of entries from the specified resource
+	*/
+	void load(const CString &resName);
+};
+
 struct TTscriptMapping {
 	uint _id;
 	uint _values[8];
@@ -115,7 +148,7 @@ protected:
 	int _valuesPerResponse;
 	Common::Array<TTscriptRange> _ranges;
 	TTscriptMappings _mappings;
-	const TTsentenceEntries *_entriesP;
+	TTsentenceEntries _entries;
 	int _entryCount;
 	int _field68;
 	int _field6C;
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 8347b42..b11912d 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -39,41 +39,6 @@ TTsentenceConcept *TTsentenceConcept::addSibling() {
 
 /*------------------------------------------------------------------------*/
 
-bool TTsentenceEntry::load(Common::SeekableReadStream *s) {
-	if (s->pos() >= s->size())
-		return false;
-
-	_field0 = s->readUint32LE();
-	_field4 = s->readUint32LE();
-	_string8 = readStringFromStream(s);
-	_fieldC = s->readUint32LE();
-	_string10 = readStringFromStream(s);
-	_string14 = readStringFromStream(s);
-	_string18 = readStringFromStream(s);
-	_string1C = readStringFromStream(s);
-	_field20 = s->readUint32LE();
-	_string24 = readStringFromStream(s);
-	_field28 = s->readUint32LE();
-	_field2C = s->readUint32LE();
-	_field30 = s->readUint32LE();
-
-	return true;
-}
-
-/*------------------------------------------------------------------------*/
-
-void TTsentenceEntries::load(const CString &resName) {
-	TTsentenceEntry entry;
-	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(resName);
-
-	while (entry.load(r))
-		push_back(entry);
-
-	delete r;
-}
-
-/*------------------------------------------------------------------------*/
-
 TTsentence::TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner,
 		TTroomScript *roomScript, TTnpcScript *npcScript) :
 		_owner(owner), _field2C(1), _inputCtr(inputCtr), _field34(0),
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 349d0c3..f26dd35 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -46,39 +46,6 @@ public:
 	TTsentenceConcept *addSibling();
 };
 
-struct TTsentenceEntry {
-	int _field0;
-	int _field4;
-	CString _string8;
-	int _fieldC;
-	CString _string10;
-	CString _string14;
-	CString _string18;
-	CString _string1C;
-	int _field20;
-	CString _string24;
-	int _field28;
-	int _field2C;
-	int _field30;
-
-	TTsentenceEntry() : _field0(0), _field4(0), _fieldC(0),
-		_field20(0), _field28(0), _field2C(0), _field30(0) {}
-
-	/**
-	 * Load an entry from the passed stream, and returns true
-	 * if an entry was successfully loaded
-	 */
-	bool load(Common::SeekableReadStream *s);
-};
-
-class TTsentenceEntries : public Common::Array<TTsentenceEntry> {
-public:
-	/**
-	 * Load a list of entries from the specified resource
-	 */
-	void load(const CString &resName);
-};
-
 class TTsentence {
 private:
 	CScriptHandler *_owner;


Commit: f88e65fe94b756c0277113f341c0d96890bd1d99
    https://github.com/scummvm/scummvm/commit/f88e65fe94b756c0277113f341c0d96890bd1d99
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:21:21-04:00

Commit Message:
DEVTOOLS: Add Bellbot range data to create_titanic

Changed paths:
    devtools/create_titanic/script_ranges.cpp



diff --git a/devtools/create_titanic/script_ranges.cpp b/devtools/create_titanic/script_ranges.cpp
index 834b0f5..6a0140a 100644
--- a/devtools/create_titanic/script_ranges.cpp
+++ b/devtools/create_titanic/script_ranges.cpp
@@ -209,6 +209,639 @@ const ScriptRange BARBOT_RANGES[70] = {
 	{ 251779, BARBOT_RANGE70, false, false }
 };
 
+const uint BELLBOT_RANGE1[] = { 200059, 200637, 0 };
+const uint BELLBOT_RANGE2[] = { 200001, 200002, 200003, 200004, 200005, 200006, 0 };
+const uint BELLBOT_RANGE3[] = { 200020, 200021, 202117, 202118, 0 };
+const uint BELLBOT_RANGE4[] = { 200023, 200024, 200025, 0 };
+const uint BELLBOT_RANGE5[] = { 200029, 0 };
+const uint BELLBOT_RANGE6[] = { 200034, 200035, 0 };
+const uint BELLBOT_RANGE7[] = { 200038, 200039, 0 };
+const uint BELLBOT_RANGE8[] = { 200061, 200062, 200063, 200064, 200065, 200066, 200201, 200202, 200203, 200204,
+	200205, 0 };
+const uint BELLBOT_RANGE9[] = { 200068, 200069, 200070, 200071, 200072, 0 };
+const uint BELLBOT_RANGE10[] = { 200076, 200077, 0 };
+
+const uint BELLBOT_RANGE11[] = { 200079, 200080, 200081, 200082, 200083, 200084, 0 };
+const uint BELLBOT_RANGE12[] = { 200119, 200120, 200121, 200122, 200123, 200124, 200125, 200126, 0 };
+const uint BELLBOT_RANGE13[] = { 200134, 200135, 0 };
+const uint BELLBOT_RANGE14[] = { 200141, 200149, 200150, 200151, 200152, 200153, 200154, 200155, 200156, 200142,
+200143, 200144, 200145, 200147, 200148, 0 };
+const uint BELLBOT_RANGE15[] = { 200158, 200168, 200169, 200170, 200171, 200172, 200173, 200174, 200175, 200159,
+200160, 200161, 200162, 200146, 200163, 200164, 200165, 200166, 200167, 0 };
+const uint BELLBOT_RANGE16[] = {
+	200177, 200182, 200183, 200184, 200185, 200186, 200187, 200188, 200189, 200191,
+	200178, 200179, 200180, 200181, 0
+};
+const uint BELLBOT_RANGE17[] = { 200194, 200195, 200196, 200197, 200198, 200199, 0 };
+const uint BELLBOT_RANGE18[] = { 200201, 200202, 200203, 200204, 200205, 200078, 0 };
+const uint BELLBOT_RANGE19[] = { 200236, 200237, 200238, 200239, 200240, 0 };
+const uint BELLBOT_RANGE20[] = { 200244, 200245, 200246, 200247, 200248, 0 };
+
+const uint BELLBOT_RANGE21[] = { 200262, 200263, 200264, 200265, 200266, 200267, 200268, 200269, 200270, 200271, 0 };
+const uint BELLBOT_RANGE22[] = { 200280, 200281, 200282, 0 };
+const uint BELLBOT_RANGE23[] = { 200284, 200285, 200286, 200287, 200288, 200289, 0 };
+const uint BELLBOT_RANGE24[] = { 200291, 200292, 202254, 0 };
+const uint BELLBOT_RANGE25[] = { 200294, 200295, 200296, 200297, 200298, 200299, 200300, 200301, 200481, 200481,
+200481, 0 };
+const uint BELLBOT_RANGE26[] = { 200307, 200308, 200309, 0 };
+const uint BELLBOT_RANGE27[] = { 200312, 200313, 0 };
+const uint BELLBOT_RANGE28[] = { 200324, 200325, 200326, 200327, 200328, 0 };
+const uint BELLBOT_RANGE29[] = { 200331, 200332, 200722, 200723, 0 };
+const uint BELLBOT_RANGE30[] = { 200337, 200338, 200339, 200340, 200341, 200342, 200343, 200344, 200345, 200346, 0 };
+
+const uint BELLBOT_RANGE31[] = { 200351, 200352, 200353, 200354, 200355, 200356, 200357, 200358, 0 };
+const uint BELLBOT_RANGE32[] = { 200360, 200361, 0 };
+const uint BELLBOT_RANGE33[] = { 200363, 200364, 0 };
+const uint BELLBOT_RANGE34[] = { 200371, 200372, 200373, 0 };
+const uint BELLBOT_RANGE35[] = { 200375, 200376, 0 };
+const uint BELLBOT_RANGE36[] = { 200394, 200395, 200396, 0 };
+const uint BELLBOT_RANGE37[] = { 200406, 200407, 0 };
+const uint BELLBOT_RANGE38[] = { 200414, 200415, 0 };
+const uint BELLBOT_RANGE39[] = { 200423, 200424, 0 };
+const uint BELLBOT_RANGE40[] = { 200433, 200434, 200435, 0 };
+
+const uint BELLBOT_RANGE41[] = { 200437, 200440, 200441, 200442, 200443, 200444, 200445, 200446, 200447, 200438,
+200439, 0 };
+const uint BELLBOT_RANGE42[] = { 200449, 200450, 200451, 200452, 200453, 200454, 0 };
+const uint BELLBOT_RANGE43[] = { 200456, 200457, 200458, 0 };
+const uint BELLBOT_RANGE44[] = {
+	201036, 201037, 200997, 200998, 200999, 201000, 201009, 201010, 200482, 200483,
+	200484, 200485, 200486, 200487, 200488, 200489, 200490, 200691, 202215, 200666,
+	200665, 200375, 200788, 200687, 200985, 200986, 201011, 201021, 0
+};
+const uint BELLBOT_RANGE45[] = { 200497, 200498, 200499, 200500, 200501, 200502, 200503, 0 };
+const uint BELLBOT_RANGE46[] = { 200508, 200509, 200510, 202219, 0 };
+const uint BELLBOT_RANGE47[] = { 200517, 200518, 200519, 200520, 200521, 200522, 200523, 200524, 0 };
+const uint BELLBOT_RANGE48[] = { 200529, 200530, 200531, 0 };
+const uint BELLBOT_RANGE49[] = { 200540, 200541, 0 };
+const uint BELLBOT_RANGE50[] = { 200558, 200559, 200560, 200561, 0 };
+
+const uint BELLBOT_RANGE51[] = { 200563, 200564, 200565, 200566, 200567, 200568, 200569, 0 };
+const uint BELLBOT_RANGE52[] = { 200572, 200573, 200574, 0 };
+const uint BELLBOT_RANGE53[] = { 200584, 200586, 200587, 200588, 200589, 0 };
+const uint BELLBOT_RANGE54[] = { 200591, 200592, 200593, 0 };
+const uint BELLBOT_RANGE55[] = { 200602, 200603, 200604, 0 };
+const uint BELLBOT_RANGE56[] = { 200606, 200607, 0 };
+const uint BELLBOT_RANGE57[] = { 200619, 200620, 200621, 200622, 200623, 200624, 200625, 200626, 0 };
+const uint BELLBOT_RANGE58[] = { 200636, 200637, 0 };
+const uint BELLBOT_RANGE59[] = { 200672, 200671, 0 };
+const uint BELLBOT_RANGE60[] = { 200679, 201977, 0 };
+
+const uint BELLBOT_RANGE61[] = { 200687, 200688, 200689, 200690, 200691, 200692, 0 };
+const uint BELLBOT_RANGE62[] = { 200699, 200700, 0 };
+const uint BELLBOT_RANGE63[] = { 200705, 200706, 200707, 0 };
+const uint BELLBOT_RANGE64[] = { 200711, 200712, 200713, 0 };
+const uint BELLBOT_RANGE65[] = { 200717, 200718, 0 };
+const uint BELLBOT_RANGE66[] = { 200724, 200725, 200726, 200727, 200728, 0 };
+const uint BELLBOT_RANGE67[] = { 200734, 200735, 200736, 0 };
+const uint BELLBOT_RANGE68[] = { 200749, 200750, 200751, 200752, 200753, 200481, 200481, 200481, 0 };
+const uint BELLBOT_RANGE69[] = { 200758, 200759, 0 };
+const uint BELLBOT_RANGE70[] = { 200774, 200775, 200776, 201820, 0 };
+
+const uint BELLBOT_RANGE71[] = { 200778, 200779, 200780, 200781, 200481, 200481, 0 };
+const uint BELLBOT_RANGE72[] = { 200783, 200784, 200785, 200786, 200787, 200481, 200481, 0 };
+const uint BELLBOT_RANGE73[] = { 200800, 200801, 200802, 200803, 200804, 200805, 200806, 200807, 200808, 200809,
+	200481, 200481, 0 };
+const uint BELLBOT_RANGE74[] = { 200815, 200816, 200481, 0 };
+const uint BELLBOT_RANGE75[] = { 200827, 200828, 200829, 200481, 0 };
+const uint BELLBOT_RANGE76[] = { 200867, 200868, 200869, 200481, 0 };
+const uint BELLBOT_RANGE77[] = { 200875, 200876, 0 };
+const uint BELLBOT_RANGE78[] = { 200878, 200879, 200880, 200481, 0 };
+const uint BELLBOT_RANGE79[] = { 200889, 200890, 200891, 200481, 0 };
+const uint BELLBOT_RANGE80[] = { 200893, 200894, 200895, 200896, 200897, 200898, 200481, 0 };
+
+const uint BELLBOT_RANGE81[] = { 200400, 200399, 0 };
+const uint BELLBOT_RANGE82[] = { 200114, 200115, 0 };
+const uint BELLBOT_RANGE83[] = { 200660, 200659, 0 };
+const uint BELLBOT_RANGE84[] = { 200303, 200304, 0 };
+const uint BELLBOT_RANGE85[] = { 200837, 200838, 0 };
+const uint BELLBOT_RANGE86[] = { 200790, 200791, 0 };
+const uint BELLBOT_RANGE87[] = { 200771, 200772, 0 };
+const uint BELLBOT_RANGE88[] = { 200137, 200138, 0 };
+const uint BELLBOT_RANGE89[] = { 200548, 200551, 200555, 200549, 200547, 200553, 200552, 200545, 200550, 200554,
+200546, 200556, 0 };
+const uint BELLBOT_RANGE90[] = {
+	200906, 200907, 200908, 200909, 200910, 200911, 200912, 200913, 200914, 200915,
+	200916, 200917, 200918, 200919, 200922, 200923, 200924, 200925, 200926, 200927,
+	200928, 200929, 200930, 0
+};
+
+const uint BELLBOT_RANGE91[] = {
+	200931, 200932, 200933, 200934, 200935, 200936, 200937, 200938, 200939, 200940,
+	200941, 200942, 200943, 200944, 200947, 200948, 200949, 200950, 200951, 200952,
+	200953, 200954, 200955, 200956, 200957, 200958, 200959, 200960, 200962, 200965,
+	200966, 201028, 201029, 201030, 201033, 202051, 0
+};
+const uint BELLBOT_RANGE92[] = {
+	200967, 200968, 200969, 200970, 200971, 200972, 200973, 200974, 200975, 200976,
+	200977, 200978, 200979, 200980, 200981, 200982, 200983, 200984, 200985, 200986,
+	200987, 200988, 200989, 201036, 201037, 0
+};
+const uint BELLBOT_RANGE93[] = { 200991, 200992, 200993, 200994, 200995, 200996, 201001, 201002, 201003, 201004,
+201007, 0 };
+const uint BELLBOT_RANGE94[] = { 200997, 200998, 200999, 201000, 201009, 201010, 0 };
+const uint BELLBOT_RANGE95[] = { 201014, 201015, 201016, 201017, 201018, 201019, 201020, 201023, 201024, 0 };
+const uint BELLBOT_RANGE96[] = { 201025, 201026, 201027, 0 };
+const uint BELLBOT_RANGE97[] = { 201044, 201045, 201046, 201047, 0 };
+const uint BELLBOT_RANGE98[] = { 201048, 201051, 201059, 201063, 201065, 201068, 201069, 200236, 200237, 200238,
+200239, 201882, 0 };
+const uint BELLBOT_RANGE99[] = { 201060, 201061, 201062, 0 };
+const uint BELLBOT_RANGE100[] = { 201053, 201054, 0 };
+
+const uint BELLBOT_RANGE101[] = { 201055, 201056, 201057, 201058, 0 };
+const uint BELLBOT_RANGE102[] = { 201073, 201074, 201075, 0 };
+const uint BELLBOT_RANGE103[] = { 202158, 201076, 201077, 201078, 202159, 0 };
+const uint BELLBOT_RANGE104[] = { 201079, 201080, 201081, 201082, 201087, 201088, 0 };
+const uint BELLBOT_RANGE105[] = { 201084, 201085, 0 };
+const uint BELLBOT_RANGE106[] = { 201090, 201091, 201092, 201093, 201094, 201095, 201096, 201097, 0 };
+const uint BELLBOT_RANGE107[] = { 201098, 201099, 201100, 201101, 201102, 201105, 201106, 201107, 201108, 0 };
+const uint BELLBOT_RANGE108[] = {
+	201111, 201112, 201113, 201114, 201115, 201116, 201117, 201118, 201119, 201120,
+	201121, 201122, 201123, 201124, 201125, 201126, 201127, 201128, 201130, 201131,
+	201132, 201133, 0
+};
+const uint BELLBOT_RANGE109[] = { 201134, 201136, 201137, 201138, 0 };
+const uint BELLBOT_RANGE110[] = { 201139, 201140, 201141, 201142, 201143, 201144, 201145, 201146, 201147, 201148, 0 };
+
+const uint BELLBOT_RANGE111[] = { 201149, 201150, 201151, 201152, 201153, 201154, 201155, 201156, 201157, 0 };
+const uint BELLBOT_RANGE112[] = { 201158, 201159, 201160, 201161, 201162, 201163, 201164, 201165, 201166, 0 };
+const uint BELLBOT_RANGE113[] = {
+	201170, 201171, 201172, 201173, 201174, 201175, 201176, 201177, 201178, 201179,
+	201180, 201181, 201182, 201183, 201184, 201185, 201186, 201187, 201188, 201189,
+	201190, 201191, 201192, 201193, 201194, 201195, 201196, 201197, 201198, 201199,
+	201200, 201201, 201202, 201203, 201204, 201205, 201206, 201207, 201208, 201209,
+	201210, 201211, 201212, 201213, 201214, 201215, 0
+};
+const uint BELLBOT_RANGE114[] = { 201170, 0 };
+const uint BELLBOT_RANGE115[] = { 201239, 201240, 201241, 0 };
+const uint BELLBOT_RANGE116[] = { 201242, 201243, 0 };
+const uint BELLBOT_RANGE117[] = { 201245, 201246, 201247, 201248, 0 };
+const uint BELLBOT_RANGE118[] = { 201249, 201250, 201251, 201252, 0 };
+const uint BELLBOT_RANGE119[] = { 201253, 201254, 201255, 0 };
+const uint BELLBOT_RANGE120[] = { 201258, 201259, 202138, 201260, 202139, 201261, 202138, 0 };
+
+const uint BELLBOT_RANGE121[] = { 201265, 201266, 201267, 201268, 0 };
+const uint BELLBOT_RANGE122[] = { 201310, 201312, 0 };
+const uint BELLBOT_RANGE123[] = { 201313, 201314, 201315, 201316, 201317, 201318, 201319, 201320, 201321, 0 };
+const uint BELLBOT_RANGE124[] = { 201340, 201342, 0 };
+const uint BELLBOT_RANGE125[] = { 201344, 201432, 0 };
+const uint BELLBOT_RANGE126[] = { 201345, 201458, 0 };
+const uint BELLBOT_RANGE127[] = { 201346, 201484, 0 };
+const uint BELLBOT_RANGE128[] = { 201444, 0 };
+const uint BELLBOT_RANGE129[] = { 201348, 201406, 201456, 0 };
+const uint BELLBOT_RANGE130[] = { 201350, 201351, 0 };
+
+const uint BELLBOT_RANGE131[] = { 201398, 201352, 201429, 0 };
+const uint BELLBOT_RANGE132[] = { 201354, 201460, 0 };
+const uint BELLBOT_RANGE133[] = { 201355, 201465, 0 };
+const uint BELLBOT_RANGE134[] = { 201356, 201415, 0 };
+const uint BELLBOT_RANGE135[] = { 201357, 201358, 0 };
+const uint BELLBOT_RANGE136[] = { 201359, 201410, 0 };
+const uint BELLBOT_RANGE137[] = { 201360, 201477, 0 };
+const uint BELLBOT_RANGE138[] = { 201361, 201422, 0 };
+const uint BELLBOT_RANGE139[] = { 201362, 201481, 0 };
+const uint BELLBOT_RANGE140[] = { 201363, 201364, 201440, 0 };
+
+const uint BELLBOT_RANGE141[] = { 201365, 201366, 0 };
+const uint BELLBOT_RANGE142[] = { 201367, 201390, 0 };
+const uint BELLBOT_RANGE143[] = { 201368, 201461, 0 };
+const uint BELLBOT_RANGE144[] = { 201370, 201419, 0 };
+const uint BELLBOT_RANGE145[] = { 201371, 201462, 0 };
+const uint BELLBOT_RANGE146[] = { 201372, 201423, 201453, 0 };
+const uint BELLBOT_RANGE147[] = { 201374, 201443, 0 };
+const uint BELLBOT_RANGE148[] = { 201376, 201420, 0 };
+const uint BELLBOT_RANGE149[] = { 201377, 201409, 0 };
+const uint BELLBOT_RANGE150[] = { 201378, 201434, 0 };
+
+const uint BELLBOT_RANGE151[] = { 201380, 201381, 0 };
+const uint BELLBOT_RANGE152[] = { 201382, 201396, 201414, 201446, 201463, 0 };
+const uint BELLBOT_RANGE153[] = { 201383, 201413, 0 };
+const uint BELLBOT_RANGE154[] = { 201401, 201402, 0 };
+const uint BELLBOT_RANGE155[] = { 201438, 201439, 0 };
+const uint BELLBOT_RANGE156[] = { 201493, 201494, 201495, 201496, 201497, 201498, 201499, 201500, 0 };
+const uint BELLBOT_RANGE157[] = { 201502, 201503, 201504, 201505, 201506, 201507, 201508, 201509, 0 };
+const uint BELLBOT_RANGE158[] = { 201513, 201514, 201515, 201516, 201517, 201518, 201519, 201520, 0 };
+const uint BELLBOT_RANGE159[] = { 201628, 201629, 0 };
+const uint BELLBOT_RANGE160[] = { 201640, 201641, 0 };
+
+const uint BELLBOT_RANGE161[] = { 201663, 201664, 0 };
+const uint BELLBOT_RANGE162[] = { 201031, 201032, 0 };
+const uint BELLBOT_RANGE163[] = { 201442, 0 };
+const uint BELLBOT_RANGE164[] = { 201384, 201442, 0 };
+const uint BELLBOT_RANGE165[] = {
+	200451, 200452, 200056, 200057, 200228, 201686, 201687, 201688, 201025, 201028,
+	201029, 201030, 201033, 201051, 201060, 201061, 201086, 201703, 201315, 201316,
+	201497, 201533, 201529, 201525, 201537, 201543, 201546, 201547, 201550, 201559,
+	201565, 201573, 201580, 201584, 201594, 201595, 201596, 201597, 201598, 201599,
+	201602, 201601, 201605, 201607, 201620, 201625, 201639, 201684, 0 };
+const uint BELLBOT_RANGE166[] = { 200083, 200084, 201335, 0 };
+const uint BELLBOT_RANGE167[] = { 200951, 200952, 200953, 200956, 201029, 200660, 201003, 201060, 201066, 201111,
+201115, 0 };
+const uint BELLBOT_RANGE168[] = { 200109, 200110, 0 };
+const uint BELLBOT_RANGE169[] = { 200864, 200865, 0 };
+const uint BELLBOT_RANGE170[] = { 200090, 200091, 0 };
+
+const uint BELLBOT_RANGE171[] = { 200675, 200676, 0 };
+const uint BELLBOT_RANGE172[] = {
+	201979, 201980, 201981, 201982, 201983, 200442, 200238, 200236, 201098, 201101,
+	201102, 201105, 201108, 201270, 201510, 0
+};
+const uint BELLBOT_RANGE173[] = { 202134, 202135, 202136, 202137, 202138, 202139, 0 };
+const uint BELLBOT_RANGE174[] = { 202276, 202232, 200858, 202276, 202276, 202276, 0 };
+const uint BELLBOT_RANGE175[] = { 202214, 202215, 200845, 0 };
+const uint BELLBOT_RANGE176[] = { 201852, 201853, 0 };
+const uint BELLBOT_RANGE177[] = { 202017, 202018, 0 };
+const uint BELLBOT_RANGE178[] = { 202023, 202024, 0 };
+const uint BELLBOT_RANGE179[] = { 202028, 202029, 0 };
+const uint BELLBOT_RANGE180[] = { 202031, 202032, 202033, 202034, 0 };
+
+const uint BELLBOT_RANGE181[] = { 202036, 202037, 0 };
+const uint BELLBOT_RANGE182[] = { 202039, 202040, 202041, 0 };
+const uint BELLBOT_RANGE183[] = { 201810, 201811, 0 };
+const uint BELLBOT_RANGE184[] = { 201817, 201818, 201819, 0 };
+const uint BELLBOT_RANGE185[] = { 201823, 201824, 201825, 201826, 201827, 0 };
+const uint BELLBOT_RANGE186[] = { 201829, 201830, 201831, 0 };
+const uint BELLBOT_RANGE187[] = { 201833, 201834, 201838, 200273, 201840, 0 };
+const uint BELLBOT_RANGE188[] = { 201836, 201837, 201838, 0 };
+const uint BELLBOT_RANGE189[] = { 201842, 201843, 0 };
+const uint BELLBOT_RANGE190[] = { 201845, 201846, 0 };
+
+const uint BELLBOT_RANGE191[] = { 201860, 201861, 201862, 201867, 201866, 0 };
+const uint BELLBOT_RANGE192[] = { 201866, 201867, 0 };
+const uint BELLBOT_RANGE193[] = { 201871, 201872, 201873, 201874, 0 };
+const uint BELLBOT_RANGE194[] = { 201878, 201879, 0 };
+const uint BELLBOT_RANGE195[] = { 201907, 201908, 201909, 201910, 0 };
+const uint BELLBOT_RANGE196[] = { 201917, 201918, 201919, 201920, 0 };
+const uint BELLBOT_RANGE197[] = { 201925, 201926, 201927, 201808, 0 };
+const uint BELLBOT_RANGE198[] = { 201931, 201932, 201810, 201811, 0 };
+const uint BELLBOT_RANGE199[] = { 201989, 201990, 0 };
+const uint BELLBOT_RANGE200[] = { 202049, 202050, 0 };
+
+const uint BELLBOT_RANGE201[] = { 202053, 202054, 0 };
+const uint BELLBOT_RANGE202[] = { 202057, 202058, 202068, 200274, 0 };
+const uint BELLBOT_RANGE203[] = { 202060, 202061, 202062, 202063, 202064, 0 };
+const uint BELLBOT_RANGE204[] = { 202093, 202094, 200275, 202095, 0 };
+const uint BELLBOT_RANGE205[] = { 202097, 202098, 202099, 202100, 202101, 0 };
+const uint BELLBOT_RANGE206[] = { 202104, 202105, 202106, 0 };
+const uint BELLBOT_RANGE207[] = { 202112, 202113, 202114, 200277, 0 };
+const uint BELLBOT_RANGE208[] = { 200020, 200021, 202117, 202118, 200276, 0 };
+const uint BELLBOT_RANGE209[] = { 202120, 202121, 202122, 202123, 202124, 202125, 202126, 0 };
+const uint BELLBOT_RANGE210[] = { 202128, 202129, 202130, 0 };
+
+const uint BELLBOT_RANGE211[] = { 202146, 202147, 202148, 201116, 0 };
+const uint BELLBOT_RANGE212[] = { 202151, 202152, 202153, 202154, 202155, 0 };
+const uint BELLBOT_RANGE213[] = { 202163, 202164, 200325, 202023, 202024, 202189, 0 };
+const uint BELLBOT_RANGE214[] = { 202166, 202167, 202168, 0 };
+const uint BELLBOT_RANGE215[] = { 202172, 202173, 0 };
+const uint BELLBOT_RANGE216[] = { 202176, 202177, 0 };
+const uint BELLBOT_RANGE217[] = { 202186, 202187, 0 };
+const uint BELLBOT_RANGE218[] = { 202192, 202193, 0 };
+const uint BELLBOT_RANGE219[] = { 202195, 202196, 202197, 202198, 202199, 202200, 0 };
+const uint BELLBOT_RANGE220[] = { 202158, 202159, 201076, 201077, 201078, 0 };
+
+const uint BELLBOT_RANGE221[] = { 200849, 202001, 0 };
+const uint BELLBOT_RANGE222[] = { 202000, 200844, 0 };
+const uint BELLBOT_RANGE223[] = { 201915, 200272, 0 };
+const uint BELLBOT_RANGE224[] = { 200239, 201049, 201063, 201089, 201113, 202150, 201062, 0 };
+const uint BELLBOT_RANGE225[] = { 201984, 201985, 201049, 201065, 201068, 0 };
+const uint BELLBOT_RANGE226[] = { 200001, 200003, 200004, 200005, 200121, 200122, 200351, 200352, 200353, 200354,
+200355, 200356, 200357, 200358, 202174, 201085, 200510, 202261, 0 };
+const uint BELLBOT_RANGE227[] = { 202134, 202135, 202136, 202137, 202138, 202139, 200352, 200358, 201084, 0 };
+const uint BELLBOT_RANGE228[] = { 200444, 200081, 200082, 200083, 200084, 200923, 201331, 201343, 202109, 0 };
+const uint BELLBOT_RANGE229[] = { 200280, 200080, 200287, 200922, 201337, 201338, 201339, 201908, 201909, 0 };
+const uint BELLBOT_RANGE230[] = { 201324, 200917, 200281, 200282, 200727, 200924, 200926, 0 };
+
+const uint BELLBOT_RANGE231[] = { 201323, 200925, 200927, 200928, 200919, 200906, 201333, 202176, 202178, 202177,
+201987, 201989, 201990, 0 };
+const uint BELLBOT_RANGE232[] = {
+	200916, 200915, 200918, 200907, 200908, 200909, 200910, 200911, 200912, 200913,
+	201325, 201326, 201327, 201328, 201329, 201330, 201332, 201334, 201335, 201336,
+	201340, 201341, 201342, 201833, 201834, 0
+};
+const uint BELLBOT_RANGE233[] = {
+	200125, 200205, 200264, 200419, 200440, 200443, 200445, 200446, 200447, 200438,
+	200420, 200620, 200621, 200622, 200624, 200669, 200771, 200787, 200093, 201026,
+	201047, 201088, 201271, 201086, 200664, 2006642, 0 };
+const uint BELLBOT_RANGE234[] = { 200729, 0 };
+const uint BELLBOT_RANGE235[] = { 200252, 200766, 201105, 201106, 201107, 201108, 0 };
+const uint BELLBOT_RANGE236[] = { 202220, 200537, 0 };
+const uint BELLBOT_RANGE237[] = { 202230, 202144, 0 };
+const uint BELLBOT_RANGE238[] = { 202019, 202018, 202017, 201049, 201050, 200891, 201043, 201521, 0 };
+const uint BELLBOT_RANGE239[] = { 200476, 202203, 0 };
+const uint BELLBOT_RANGE240[] = { 200475, 201856, 0 };
+
+#define BELLBOT_RANGE_COUNT 283
+static ScriptRange BELLBOT_RANGES[283] = {
+	{ 200058, BELLBOT_RANGE1, false, false },
+	{ 200000, BELLBOT_RANGE2, true, false },
+	{ 200019, BELLBOT_RANGE3, true, false },
+	{ 200022, BELLBOT_RANGE4, true, false },
+	{ 200027, BELLBOT_RANGE5, false, false },
+	{ 200033, BELLBOT_RANGE6, false, false },
+	{ 200037, BELLBOT_RANGE7, false, false },
+	{ 200060, BELLBOT_RANGE8, true, false },
+	{ 200067, BELLBOT_RANGE9, true, false },
+	{ 200075, BELLBOT_RANGE10, false, false },
+
+	{ 200078, BELLBOT_RANGE11, false, false },
+	{ 200118, BELLBOT_RANGE12, false, false },
+	{ 200133, BELLBOT_RANGE13, false, false },
+	{ 200140, BELLBOT_RANGE14, true, false },
+	{ 200157, BELLBOT_RANGE15, true, false },
+	{ 200176, BELLBOT_RANGE16, true, false },
+	{ 200193, BELLBOT_RANGE17, true, false },
+	{ 200200, BELLBOT_RANGE18, false, false },
+	{ 200235, BELLBOT_RANGE19, false, false },
+	{ 200243, BELLBOT_RANGE20, false, false },
+
+	{ 200261, BELLBOT_RANGE21, false, false },
+	{ 200279, BELLBOT_RANGE22, false, false },
+	{ 200283, BELLBOT_RANGE23, false, false },
+	{ 200290, BELLBOT_RANGE24, true, false },
+	{ 200293, BELLBOT_RANGE25, false, false },
+	{ 200306, BELLBOT_RANGE26, false, false },
+	{ 200311, BELLBOT_RANGE27, false, false },
+	{ 200323, BELLBOT_RANGE28, false, false },
+	{ 200330, BELLBOT_RANGE29, true, false },
+	{ 200336, BELLBOT_RANGE30, false, false },
+
+	{ 200350, BELLBOT_RANGE31, false, false },
+	{ 200359, BELLBOT_RANGE32, false, false },
+	{ 200362, BELLBOT_RANGE33, false, false },
+	{ 200370, BELLBOT_RANGE34, false, false },
+	{ 200374, BELLBOT_RANGE35, false, false },
+	{ 200393, BELLBOT_RANGE36, false, false },
+	{ 200405, BELLBOT_RANGE37, false, false },
+	{ 200413, BELLBOT_RANGE38, false, false },
+	{ 200422, BELLBOT_RANGE39, false, false },
+	{ 200432, BELLBOT_RANGE40, true, false },
+
+	{ 200436, BELLBOT_RANGE41, true, false },
+	{ 200448, BELLBOT_RANGE42, true, false },
+	{ 200455, BELLBOT_RANGE43, false, false },
+	{ 200481, BELLBOT_RANGE44, true, false },
+	{ 200496, BELLBOT_RANGE45, false, false },
+	{ 200507, BELLBOT_RANGE46, true, false },
+	{ 200516, BELLBOT_RANGE47, true, false },
+	{ 200528, BELLBOT_RANGE48, true, false },
+	{ 200539, BELLBOT_RANGE49, true, false },
+	{ 200557, BELLBOT_RANGE50, true, false },
+
+	{ 200562, BELLBOT_RANGE51, true, false },
+	{ 200571, BELLBOT_RANGE52, true, false },
+	{ 200585, BELLBOT_RANGE53, true, false },
+	{ 200590, BELLBOT_RANGE54, true, false },
+	{ 200601, BELLBOT_RANGE55, true, false },
+	{ 200605, BELLBOT_RANGE56, true, false },
+	{ 200617, BELLBOT_RANGE57, true, false },
+	{ 200635, BELLBOT_RANGE58, false, false },
+	{ 200670, BELLBOT_RANGE59, false, false },
+	{ 200677, BELLBOT_RANGE60, true, false },
+
+	{ 200686, BELLBOT_RANGE61, false, false },
+	{ 200698, BELLBOT_RANGE62, false, false },
+	{ 200704, BELLBOT_RANGE63, false, false },
+	{ 200710, BELLBOT_RANGE64, true, false },
+	{ 200716, BELLBOT_RANGE65, false, false },
+	{ 200723, BELLBOT_RANGE66, true, false },
+	{ 200733, BELLBOT_RANGE67, false, false },
+	{ 200748, BELLBOT_RANGE68, true, false },
+	{ 200757, BELLBOT_RANGE69, false, false },
+	{ 200773, BELLBOT_RANGE70, true, false },
+
+	{ 200777, BELLBOT_RANGE71, true, false },
+	{ 200782, BELLBOT_RANGE72, true, false },
+	{ 200799, BELLBOT_RANGE73, true, false },
+	{ 200814, BELLBOT_RANGE74, true, false },
+	{ 200826, BELLBOT_RANGE75, true, false },
+	{ 200866, BELLBOT_RANGE76, true, false },
+	{ 200874, BELLBOT_RANGE77, false, false },
+	{ 200877, BELLBOT_RANGE78, true, false },
+	{ 200888, BELLBOT_RANGE79, true, false },
+	{ 200892, BELLBOT_RANGE80, true, false },
+
+	{ 200398, BELLBOT_RANGE81, false, false },
+	{ 200113, BELLBOT_RANGE82, false, false },
+	{ 200658, BELLBOT_RANGE83, false, false },
+	{ 200302, BELLBOT_RANGE84, false, false },
+	{ 200836, BELLBOT_RANGE85, false, false },
+	{ 200789, BELLBOT_RANGE86, false, false },
+	{ 200770, BELLBOT_RANGE87, false, false },
+	{ 200136, BELLBOT_RANGE88, false, false },
+	{ 200544, BELLBOT_RANGE89, false, false },
+	{ 201685, BELLBOT_RANGE90, false, false },
+
+	{ 201686, BELLBOT_RANGE91, true, false },
+	{ 201687, BELLBOT_RANGE92, true, false },
+	{ 201688, BELLBOT_RANGE93, true, false },
+	{ 201689, BELLBOT_RANGE94, false, false },
+	{ 201690, BELLBOT_RANGE95, false, false },
+	{ 201691, BELLBOT_RANGE96, false, false },
+	{ 201692, BELLBOT_RANGE97, true, false },
+	{ 201693, BELLBOT_RANGE98, true, false },
+	{ 201694, BELLBOT_RANGE99, false, false },
+	{ 201695, BELLBOT_RANGE100, true, false },
+
+	{ 201696, BELLBOT_RANGE101, true, false },
+	{ 201697, BELLBOT_RANGE102, true, false },
+	{ 201698, BELLBOT_RANGE103, false, false },
+	{ 201699, BELLBOT_RANGE104, true, false },
+	{ 201700, BELLBOT_RANGE105, true, false },
+	{ 201701, BELLBOT_RANGE106, false, false },
+	{ 201702, BELLBOT_RANGE107, false, false },
+	{ 201703, BELLBOT_RANGE108, true, false },
+	{ 201704, BELLBOT_RANGE109, true, false },
+	{ 201705, BELLBOT_RANGE110, true, false },
+
+	{ 201706, BELLBOT_RANGE111, true, false },
+	{ 201707, BELLBOT_RANGE112, true, false },
+	{ 201708, BELLBOT_RANGE113, false, false },
+
+	{ 201709, BELLBOT_RANGE114, false, false },
+	{ 201710, BELLBOT_RANGE114, false, false },
+	{ 201711, BELLBOT_RANGE114, false, false },
+	{ 201712, BELLBOT_RANGE114, false, false },
+	{ 201713, BELLBOT_RANGE114, false, false },
+	{ 201714, BELLBOT_RANGE114, false, false },
+	{ 201715, BELLBOT_RANGE114, false, false },
+	{ 201716, BELLBOT_RANGE114, false, false },
+	{ 201717, BELLBOT_RANGE114, false, false },
+	{ 201718, BELLBOT_RANGE114, false, false },
+	{ 201719, BELLBOT_RANGE114, false, false },
+	{ 201720, BELLBOT_RANGE114, false, false },
+	{ 201721, BELLBOT_RANGE114, false, false },
+	{ 201722, BELLBOT_RANGE114, false, false },
+	{ 201723, BELLBOT_RANGE114, false, false },
+	{ 201724, BELLBOT_RANGE114, false, false },
+	{ 201725, BELLBOT_RANGE114, false, false },
+	{ 201726, BELLBOT_RANGE114, false, false },
+	{ 201727, BELLBOT_RANGE114, false, false },
+	{ 201728, BELLBOT_RANGE114, false, false },
+	{ 201729, BELLBOT_RANGE114, false, false },
+	{ 201730, BELLBOT_RANGE114, false, false },
+	{ 201731, BELLBOT_RANGE114, false, false },
+	{ 201732, BELLBOT_RANGE114, false, false },
+	{ 201733, BELLBOT_RANGE114, false, false },
+	{ 201735, BELLBOT_RANGE114, false, false },
+	{ 201736, BELLBOT_RANGE114, false, false },
+	{ 201737, BELLBOT_RANGE114, false, false },
+	{ 201738, BELLBOT_RANGE114, false, false },
+	{ 201739, BELLBOT_RANGE114, false, false },
+	{ 201740, BELLBOT_RANGE114, false, false },
+	{ 201741, BELLBOT_RANGE114, false, false },
+	{ 201743, BELLBOT_RANGE114, false, false },
+	{ 201744, BELLBOT_RANGE114, false, false },
+	{ 201745, BELLBOT_RANGE114, false, false },
+	{ 201746, BELLBOT_RANGE114, false, false },
+	{ 201747, BELLBOT_RANGE114, false, false },
+	{ 201748, BELLBOT_RANGE114, false, false },
+	{ 201749, BELLBOT_RANGE114, false, false },
+	{ 201750, BELLBOT_RANGE114, false, false },
+	{ 201751, BELLBOT_RANGE114, false, false },
+	{ 201752, BELLBOT_RANGE114, false, false },
+	{ 201753, BELLBOT_RANGE114, false, false },
+	{ 201754, BELLBOT_RANGE114, false, false },
+
+	{ 201755, BELLBOT_RANGE115, true, false },
+	{ 201756, BELLBOT_RANGE116, true, false },
+	{ 201757, BELLBOT_RANGE117, true, false },
+	{ 201758, BELLBOT_RANGE118, true, false },
+	{ 201759, BELLBOT_RANGE119, true, false },
+	{ 201760, BELLBOT_RANGE120, false, false },
+
+	{ 201761, BELLBOT_RANGE121, true, false },
+	{ 201762, BELLBOT_RANGE122, true, false },
+	{ 201763, BELLBOT_RANGE123, true, false },
+	{ 201764, BELLBOT_RANGE124, false, false },
+	{ 201765, BELLBOT_RANGE125, false, false },
+	{ 201766, BELLBOT_RANGE126, false, false },
+	{ 201767, BELLBOT_RANGE127, false, false },
+	{ 201768, BELLBOT_RANGE128, false, false },
+	{ 201769, BELLBOT_RANGE129, false, false },
+	{ 201770, BELLBOT_RANGE130, false, false },
+
+	{ 201771, BELLBOT_RANGE131, true, false },
+	{ 201772, BELLBOT_RANGE132, false, false },
+	{ 201773, BELLBOT_RANGE133, false, false },
+	{ 201774, BELLBOT_RANGE134, false, false },
+	{ 201775, BELLBOT_RANGE135, false, false },
+	{ 201776, BELLBOT_RANGE136, false, false },
+	{ 201777, BELLBOT_RANGE137, false, false },
+	{ 201778, BELLBOT_RANGE138, false, false },
+	{ 201779, BELLBOT_RANGE139, false, false },
+	{ 201780, BELLBOT_RANGE140, false, false },
+
+	{ 201781, BELLBOT_RANGE141, false, false },
+	{ 201782, BELLBOT_RANGE142, false, false },
+	{ 201783, BELLBOT_RANGE143, false, false },
+	{ 201784, BELLBOT_RANGE144, false, false },
+	{ 201785, BELLBOT_RANGE145, false, false },
+	{ 201786, BELLBOT_RANGE146, false, false },
+	{ 201787, BELLBOT_RANGE147, false, false },
+	{ 201788, BELLBOT_RANGE148, false, false },
+	{ 201789, BELLBOT_RANGE149, false, false },
+	{ 201790, BELLBOT_RANGE150, false, false },
+
+	{ 201791, BELLBOT_RANGE151, false, false },
+	{ 201792, BELLBOT_RANGE152, false, false },
+	{ 201793, BELLBOT_RANGE153, false, false },
+	{ 201794, BELLBOT_RANGE154, false, false },
+	{ 201795, BELLBOT_RANGE155, false, false },
+	{ 201796, BELLBOT_RANGE156, true, false },
+	{ 201797, BELLBOT_RANGE157, false, false },
+	{ 201798, BELLBOT_RANGE158, false, false },
+	{ 201799, BELLBOT_RANGE159, false, false },
+	{ 201800, BELLBOT_RANGE160, false, false },
+
+	{ 201801, BELLBOT_RANGE161, false, false },
+	{ 201802, BELLBOT_RANGE162, false, false },
+	{ 201803, BELLBOT_RANGE163, false, false },
+	{ 201804, BELLBOT_RANGE164, true, false },
+	{ 201805, BELLBOT_RANGE165, true, false },
+	{ 201806, BELLBOT_RANGE166, true, false },
+	{ 201807, BELLBOT_RANGE167, true, false },
+	{ 200108, BELLBOT_RANGE168, false, false },
+	{ 200863, BELLBOT_RANGE169, false, false },
+	{ 200089, BELLBOT_RANGE170, false, false },
+
+	{ 200674, BELLBOT_RANGE171, false, false },
+	{ 201978, BELLBOT_RANGE172, true, false },
+	{ 202133, BELLBOT_RANGE173, true, false },
+	{ 202231, BELLBOT_RANGE174, true, false },
+	{ 202213, BELLBOT_RANGE175, true, false },
+	{ 201851, BELLBOT_RANGE176, true, false },
+	{ 202016, BELLBOT_RANGE177, false, false },
+	{ 202022, BELLBOT_RANGE178, false, false },
+	{ 202027, BELLBOT_RANGE179, false, false },
+	{ 202030, BELLBOT_RANGE180, true, false },
+
+	{ 202035, BELLBOT_RANGE181, false, false },
+	{ 202038, BELLBOT_RANGE182, false, false },
+	{ 201809, BELLBOT_RANGE183, true, false },
+	{ 201816, BELLBOT_RANGE184, true, false },
+	{ 201822, BELLBOT_RANGE185, false, false },
+	{ 201828, BELLBOT_RANGE186, true, false },
+	{ 201832, BELLBOT_RANGE187, true, false },
+	{ 201835, BELLBOT_RANGE188, true, false },
+	{ 201841, BELLBOT_RANGE189, true, false },
+	{ 201844, BELLBOT_RANGE190, true, false },
+
+	{ 201859, BELLBOT_RANGE191, true, false },
+	{ 201865, BELLBOT_RANGE192, true, false },
+	{ 201870, BELLBOT_RANGE193, false, false },
+	{ 201877, BELLBOT_RANGE194, false, false },
+	{ 201906, BELLBOT_RANGE195, true, false },
+	{ 201916, BELLBOT_RANGE196, true, false },
+	{ 201924, BELLBOT_RANGE197, true, false },
+	{ 201930, BELLBOT_RANGE198, true, false },
+	{ 201988, BELLBOT_RANGE199, true, false },
+	{ 202048, BELLBOT_RANGE200, true, false },
+
+	{ 202052, BELLBOT_RANGE201, true, false },
+	{ 202056, BELLBOT_RANGE202, true, false },
+	{ 202059, BELLBOT_RANGE203, true, false },
+	{ 202092, BELLBOT_RANGE204, true, false },
+	{ 202096, BELLBOT_RANGE205, false, false },
+	{ 202103, BELLBOT_RANGE206, true, false },
+	{ 202111, BELLBOT_RANGE207, true, false },
+	{ 202116, BELLBOT_RANGE208, true, true },
+	{ 202119, BELLBOT_RANGE209, true, false },
+	{ 202127, BELLBOT_RANGE210, true, false },
+
+	{ 202145, BELLBOT_RANGE211, true, false },
+	{ 202150, BELLBOT_RANGE212, true, false },
+	{ 202162, BELLBOT_RANGE213, true, false },
+	{ 202165, BELLBOT_RANGE214, true, false },
+	{ 202171, BELLBOT_RANGE215, true, false },
+	{ 202175, BELLBOT_RANGE216, false, false },
+	{ 202185, BELLBOT_RANGE217, false, false },
+	{ 202191, BELLBOT_RANGE218, false, false },
+	{ 202194, BELLBOT_RANGE219, false, false },
+	{ 202157, BELLBOT_RANGE220, false, false },
+
+	{ 202256, BELLBOT_RANGE221, true, false },
+	{ 202255, BELLBOT_RANGE222, true, false },
+	{ 202257, BELLBOT_RANGE223, true, false },
+	{ 202258, BELLBOT_RANGE224, true, false },
+	{ 202259, BELLBOT_RANGE225, true, false },
+	{ 202260, BELLBOT_RANGE226, true, false },
+	{ 202261, BELLBOT_RANGE227, true, false },
+	{ 202262, BELLBOT_RANGE228, true, false },
+	{ 202263, BELLBOT_RANGE229, true, false },
+	{ 202264, BELLBOT_RANGE230, true, false },
+
+	{ 202265, BELLBOT_RANGE231, true, false },
+	{ 202266, BELLBOT_RANGE232, true, false },
+	{ 202267, BELLBOT_RANGE233, true, false },
+	{ 202268, BELLBOT_RANGE234, true, false },
+	{ 202269, BELLBOT_RANGE235, true, false },
+	{ 202270, BELLBOT_RANGE236, true, false },
+	{ 202271, BELLBOT_RANGE237, true, false },
+	{ 202272, BELLBOT_RANGE238, true, false },
+	{ 202273, BELLBOT_RANGE239, true, false },
+	{ 202274, BELLBOT_RANGE240, true, false }
+};
+
 const uint DESKBOT_RANGE1[] = { 240002, 240003, 240006, 240007, 0 };
 const uint DESKBOT_RANGE2[] = { 240008, 240009, 240010, 240011, 240012, 240013, 240004, 240005, 0 };
 const uint DESKBOT_RANGE3[] = { 240336, 240337, 240338, 240339, 240340, 240341, 240342, 240343, 240344, 0 };


Commit: 4cdd55a7f251b40b7b9b354316cf4cf3d1cc88dd
    https://github.com/scummvm/scummvm/commit/4cdd55a7f251b40b7b9b354316cf4cf3d1cc88dd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:21:24-04:00

Commit Message:
TITANIC: Implemented remaining TTroomScript virtual methods

Changed paths:
    engines/titanic/true_talk/tt_room_script.cpp
    engines/titanic/true_talk/tt_room_script.h



diff --git a/engines/titanic/true_talk/tt_room_script.cpp b/engines/titanic/true_talk/tt_room_script.cpp
index 4182498..b8fbca7 100644
--- a/engines/titanic/true_talk/tt_room_script.cpp
+++ b/engines/titanic/true_talk/tt_room_script.cpp
@@ -37,12 +37,13 @@ TTroomScript::TTroomScript(int scriptId) :
 	TTroomScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) {
 }
 
-void TTroomScript::proc8() {
-	warning("TODO");
+bool TTroomScript::proc8() const {
+	return false;
 }
 
-void TTroomScript::proc9() {
-	warning("TODO");
+void TTroomScript::proc9(int v) {
+	if (v == 1)
+		_field54 = 1;
 }
 
 ScriptChangedResult TTroomScript::scriptChanged(TTscriptBase *npcScript, int id) {
@@ -52,8 +53,8 @@ ScriptChangedResult TTroomScript::scriptChanged(TTscriptBase *npcScript, int id)
 	return SCR_1;
 }
 
-void TTroomScript::proc11() {
-	warning("TODO");
+bool TTroomScript::proc11() const {
+	return true;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h
index 4aa9b16..d4da5fc 100644
--- a/engines/titanic/true_talk/tt_room_script.h
+++ b/engines/titanic/true_talk/tt_room_script.h
@@ -47,15 +47,15 @@ public:
 	 */
 	virtual bool canProcess(TTnpcScript *npcScript, TTsentence *sentence) const = 0;
 
-	virtual void proc8() = 0;
-	virtual void proc9() = 0;
+	virtual bool proc8() const = 0;
+	virtual void proc9(int v) = 0;
 	
 	/**
 	 * Called when the script changes
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *npcScript, int id) = 0;
 	
-	virtual void proc11() = 0;
+	virtual bool proc11() const = 0;
 };
 
 
@@ -79,15 +79,16 @@ public:
 		return true;
 	}
 
-	virtual void proc8();
-	virtual void proc9();
+	virtual bool  proc8() const;
+
+	virtual void proc9(int v);
 
 	/**
 	 * Called when the script changes
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *npcScript, int id);
 
-	virtual void proc11();
+	virtual bool proc11() const;
 
 	/**
 	 * Called with the new script and id


Commit: d99e06f373da39f7eda3c302619709d1e042ec8b
    https://github.com/scummvm/scummvm/commit/d99e06f373da39f7eda3c302619709d1e042ec8b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:21:28-04:00

Commit Message:
TITANIC: Added TTnpcScript checkItems

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index f768885..ba3ca03 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -114,8 +114,12 @@ int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 	return TTnpcScript::chooseResponse(roomScript, sentence, tag);
 }
 
-void BarbotScript::proc7(int v1, int v2) {
-	warning("TODO");
+int BarbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+	if (roomScript->_scriptId != 112)
+		return 2;
+
+	// TODO
+	return 2;
 }
 
 int BarbotScript::proc10() const {
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index c5f7800..4be978c 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -49,7 +49,11 @@ public:
 	 */
 	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
 
-	virtual void proc7(int v1, int v2);
+	/**
+	 * Does NPC specific processing of the parsed sentence
+	 */
+	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
+
 	virtual int proc10() const;
 	virtual int proc15() const;
 	virtual bool proc16() const;
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index e06184a..1f9bb83 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -23,12 +23,21 @@
 #include "common/textconsole.h"
 #include "titanic/pet_control/pet_control.h"
 #include "titanic/true_talk/tt_npc_script.h"
+#include "titanic/true_talk/tt_sentence.h"
 #include "titanic/true_talk/true_talk_manager.h"
 #include "titanic/game_manager.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
 
+static const char *const ITEMS[] = {
+	"chicken", "napkin", "parrot", "moth", "fuse", "eye", "nose", "ear", "mouth",
+	"auditorycenter", "visioncenter", "olfactorycenter", "speechcenter", "stick",
+	"longstick", "bomb", "lemon", "puree", "television", "hammer", nullptr
+};
+
+/*------------------------------------------------------------------------*/
+
 int TTnpcScriptResponse::size() const {
 	for (int idx = 0; idx < 4; ++idx) {
 		if (_values[idx] == 0)
@@ -127,7 +136,7 @@ TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
 		_entryCount(0), _field68(0), _field6C(0), _rangeResetCtr(0),
-		_field74(0), _field78(0), _field7C(0), _field80(0), _field2CC(false) {
+		_field74(0), _field78(0), _field7C(0), _itemStringP(nullptr), _field2CC(false) {
 	CTrueTalkManager::_v2 = 0;
 	Common::fill(&_dialValues[0], &_dialValues[DIALS_ARRAY_COUNT], 0);
 	Common::fill(&_array[0], &_array[136], 0);
@@ -218,8 +227,8 @@ int TTnpcScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 	return 1;
 }
 
-void TTnpcScript::process(TTroomScript *roomScript, TTsentence *sentence) {
-	processSentence(&_entries, _entryCount, roomScript, sentence);
+int TTnpcScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+	return processEntries(&_entries, _entryCount, roomScript, sentence);
 }
 
 int TTnpcScript::proc8() const {
@@ -618,7 +627,7 @@ CPetControl *TTnpcScript::getPetControl(CGameManager *gameManager) {
 	return nullptr;
 }
 
-int TTnpcScript::processSentence(const TTsentenceEntries *entries, uint entryCount, TTroomScript *roomScript, TTsentence *sentence) {
+int TTnpcScript::processEntries(const TTsentenceEntries *entries, uint entryCount, TTroomScript *roomScript, TTsentence *sentence) {
 	if (!entries)
 		return SS_1;
 	if (!entryCount)
@@ -723,4 +732,23 @@ TTscriptRange *TTnpcScript::findRange(uint id) {
 	return nullptr;
 }
 
+void TTnpcScript::checkItems(TTroomScript *roomScript, TTsentence *sentence) {
+	_field2CC = 0;
+	++CTrueTalkManager::_v2;
+
+	if (sentence) {
+		if (!_itemStringP || getRandomNumber(100) > 80) {
+			for (const char *const *strP = &ITEMS[0]; *strP; ++strP) {
+				if (sentence->localWord(*strP)) {
+					_itemStringP = *strP;
+					break;
+				}
+			}
+		}
+
+		if (sentence->localWord("bomb"))
+			_field7C = 1;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 3a4ac57..f31a769 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -125,7 +125,11 @@ public:
 	 */
 	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) = 0;
 
-	virtual void proc7(int v1, int v2) = 0;
+	/**
+	 * Does NPC specific processing of the parsed sentence
+	 */
+	virtual int process(TTroomScript *roomScript, TTsentence *sentence) = 0;
+
 	virtual int proc8() const = 0;
 	virtual int proc9() const = 0;
 
@@ -156,7 +160,7 @@ protected:
 	int _field74;
 	int _field78;
 	int _field7C;
-	int _field80;
+	const char *_itemStringP;
 	int _dialValues[DIALS_ARRAY_COUNT];
 	int _array[136];
 	bool _field2CC;
@@ -220,9 +224,14 @@ protected:
 	 */
 	TTscriptRange *findRange(uint id);
 
-	int processSentence(const TTsentenceEntries *entries, uint entryCount, TTroomScript *roomScript, TTsentence *sentence);
+	/**
+	 * Scans through a list of sentence entries for a matching standardized response
+	 */
+	int processEntries(const TTsentenceEntries *entries, uint entryCount, TTroomScript *roomScript, TTsentence *sentence);
 
 	bool defaultProcess(TTroomScript *roomScript, TTsentence *sentence);
+
+	void checkItems(TTroomScript *roomScript, TTsentence *sentence);
 public:
 	TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,
@@ -238,9 +247,9 @@ public:
 	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
 
 	/**
-	 * Does further NPC specific processing of the sentence
+	 * Does NPC specific processing of the parsed sentence
 	 */
-	virtual void process(TTroomScript *roomScript, TTsentence *sentence);
+	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
 
 	virtual int proc8() const;
 	virtual int proc9() const;
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index b11912d..54c6644 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -261,4 +261,9 @@ bool TTsentence::isConcept34(int slotIndex, TTconceptNode *node) {
 	return concept && concept->get34();
 }
 
+bool TTsentence::localWord(const char *str) const {
+	// TODO
+	return false;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index f26dd35..c9e8de9 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -117,6 +117,8 @@ public:
 	bool fn4(int mode, int wordId, TTconceptNode *node);
 
 	bool isConcept34(int slotIndex, TTconceptNode *node = nullptr);
+
+	bool localWord(const char *str) const;
 };
 
 } // End of namespace Titanic


Commit: f6cd02ce78627cfbc725eb999aca1a623cf43917
    https://github.com/scummvm/scummvm/commit/f6cd02ce78627cfbc725eb999aca1a623cf43917
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:21:32-04:00

Commit Message:
TITANIC: Added TTsentence contains

Changed paths:
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 54c6644..56ccc5a 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -266,4 +266,8 @@ bool TTsentence::localWord(const char *str) const {
 	return false;
 }
 
+bool TTsentence::contains(const char *str) const {
+	return _initialLine.contains(str) || _normalizedLine.contains(str);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index c9e8de9..94cc265 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -119,6 +119,12 @@ public:
 	bool isConcept34(int slotIndex, TTconceptNode *node = nullptr);
 
 	bool localWord(const char *str) const;
+
+	/**
+	 * Returns true if the sentence (either the original or normalized lines)
+	 * contain the specified substring
+	 */
+	bool contains(const char *str) const;
 };
 
 } // End of namespace Titanic


Commit: d3dc8d81ce24146913c531c5d8cae25a383f8e03
    https://github.com/scummvm/scummvm/commit/d3dc8d81ce24146913c531c5d8cae25a383f8e03
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:21:45-04:00

Commit Message:
TITANIC: Beginnings of BarbotScript process

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_script_base.cpp
    engines/titanic/true_talk/tt_script_base.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index ba3ca03..2687336 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -30,10 +30,21 @@ static const int STATE_ARRAY[7] = {
 	0xCAB0, 0xCAB2, 0xCAB3, 0xCAB4, 0xCAB5, 0xCAB6, 0xCAB7
 };
 
+static const uint ARRAY1[] = {
+	0, 50033, 50044, 50045, 50046, 50047, 50048, 50049,
+	50050, 50051, 50034, 50035, 50036, 50037, 50038, 50039,
+	50040, 50041, 50042, 50043, 50411, 0
+};
+
+static const uint ARRAY2[] = {
+	51899, 51900, 51901, 51902, 51903, 51904, 51905, 51906, 51907, 0
+};
+
 BarbotScript::BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
 	_state = 0;
+	_arrIndex = 0;
 
 	loadRanges("Ranges/Barbot");
 	loadResponses("Responses/Barbot");
@@ -115,9 +126,73 @@ int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 }
 
 int BarbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+	int dialogueId = 0;
+
 	if (roomScript->_scriptId != 112)
 		return 2;
 
+	checkItems(roomScript, sentence);
+	if (isState9()) {
+		if (sentence->localWord("visioncenter") || sentence->localWord("brain") ||
+				sentence->contains("vision") || sentence->contains("visual") ||
+				sentence->contains("brain") || sentence->contains("crystal")) {
+			if (CTrueTalkManager::getStateValue(2)) {
+				addResponse(getDialogueId(251003));
+				applyResponse();
+				CTrueTalkManager::triggerAction(6, 0);
+				return 2;
+			}
+		}
+
+		if (sentence->contains("goldfish")) {
+			addResponse(getDialogueId(250184));
+			applyResponse();
+			return 2;
+		}
+
+		dialogueId = ARRAY1[getRandomNumber(20)];
+		if (!ARRAY2[_arrIndex])
+			_arrIndex = 0;
+
+		if (_arrIndex) {
+			dialogueId = ARRAY2[_arrIndex++];
+		} else if (getRandomNumber(100) > 35) {
+			dialogueId = ARRAY2[0];
+			_arrIndex = 1;		
+		} else if (getRandomNumber(100) > 60) {
+			switch (sentence->_field2C) {
+			case 2:
+				dialogueId = 51914;
+				break;
+			case 3:
+				dialogueId = 51911;
+				break;
+			case 4:
+				dialogueId = 51913;
+				break;
+			case 5:
+				dialogueId = 51912;
+				break;
+			case 6:
+				dialogueId = 51915;
+				break;
+			case 7:
+				dialogueId = 51909;
+				break;
+			default:
+				break;
+			}
+		}
+
+		addResponse(dialogueId);
+		if (getRandomNumber(100) > 65)
+			addResponse(getDialogueId(251250));
+		applyResponse();
+		return 2;
+	}
+
+
+
 	// TODO
 	return 2;
 }
@@ -189,4 +264,8 @@ void BarbotScript::adjustDial(int dialNum, int amount) {
 	setDial(dialNum, level);
 }
 
+bool BarbotScript::isState9() const {
+	return CTrueTalkManager::getStateValue(9) != 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 4be978c..419d7cf 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -30,6 +30,7 @@ namespace Titanic {
 class BarbotScript : public TTnpcScript {
 private:
 	int _state;
+	int _arrIndex;
 private:
 	/**
 	 * Adjust a given dial number by a given delta amount
@@ -40,6 +41,8 @@ private:
 	 * Setup sentence data
 	 */
 	void setupSentences();
+
+	bool isState9() const;
 public:
 	BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 1f9bb83..070ecbb 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -202,8 +202,12 @@ void TTnpcScript::setupDials(int dial1, int dial2, int dial3) {
 		_field78 = -_field78;
 }
 
-void TTnpcScript::proc4(int v) {
-	warning("TODO");
+void TTnpcScript::addResponse(int id) {
+	if (id > 200000)
+		id = getDialogueId(id);
+
+	proc15(id);
+	TTscriptBase::addResponse(id);
 }
 
 int TTnpcScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
@@ -266,7 +270,7 @@ void TTnpcScript::selectResponse(int id) {
 	addResponse(id);
 }
 
-int TTnpcScript::proc15() const {
+int TTnpcScript::proc15(int id) const {
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index f31a769..bcf3c7d 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -237,7 +237,7 @@ public:
 		const char *charName, int v3, int val2, int v4,
 		int v5, int v6, int v7);
 
-	virtual void proc4(int v);
+	virtual void addResponse(int id);
 
 	/**
 	 * Chooses and adds a conversation response based on a specified tag Id.
@@ -275,7 +275,7 @@ public:
 	 */
 	virtual void selectResponse(int id);
 	
-	virtual int proc15() const;
+	virtual int proc15(int id) const;
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 	virtual bool proc17() const;
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index 218c86d..c6a197a 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -98,8 +98,8 @@ void TTscriptBase::addResponse(const TTstring &str) {
 	appendResponse2(-1, nullptr, str);
 }
 
-void TTscriptBase::addResponse(int val) {
-	appendResponse(-1, nullptr, val);
+void TTscriptBase::addResponse(int id) {
+	appendResponse(-1, nullptr, id);
 }
 
 void TTscriptBase::applyResponse() {
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index cdaf8c7..e855fef 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -82,7 +82,7 @@ public:
 
 	virtual void addResponse(const TTstring &str);
 
-	virtual void addResponse(int val);
+	virtual void addResponse(int id);
 
 	/**
 	 * Passes on the list of dialogue Ids stored in the response(s)


Commit: 8c237b3ee2c6b33edcc11ce9783f87e34f971508
    https://github.com/scummvm/scummvm/commit/8c237b3ee2c6b33edcc11ce9783f87e34f971508
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:22:57-04:00

Commit Message:
TITANIC: Fix NPC handleQuote method stubs

Changed paths:
  A devtools/create_titanic/tag_maps.cpp
  A devtools/create_titanic/tag_maps.h
    devtools/create_titanic/create_titanic_dat.cpp
    devtools/create_titanic/script_ranges.cpp
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index f0f7370..09a4b4c 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -38,6 +38,7 @@
 #include "file.h"
 #include "script_responses.h"
 #include "script_ranges.h"
+#include "tag_maps.h"
 
 /**
  * Format of the access.dat file that will be created:
@@ -51,7 +52,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x5A0
+#define HEADER_SIZE 0x640
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -487,19 +488,18 @@ void writeData() {
 	writeNumbers();
 	writeAllScriptResponses();
 	writeAllScriptRanges();
+	writeAllTagMappings();
 }
 
-// Support method used for translating IDA debugger's output for
-// an NPC's chooseResponse method tag list to a format for inclusion
-// in this tool's script_respones.cpp file
-void createScriptResponses() {
+void createScriptMap() {
 	Common::File inFile;
 	char line[80];
 	char c[2];
 	c[0] = c[1] = '\0';
+	int counter = 0;
 
-	inFile.open("d:\\temp\\deskbot.txt");
-	printf("static const int xxxx_RESPONSES[][5] = {\n");
+	inFile.open("d:\\temp\\map.txt");
+	printf("static const TagMapping xxxx_ID_MAP[] = {\n");
 
 	do {
 		strcpy(line, "");
@@ -511,17 +511,20 @@ void createScriptResponses() {
 			else if (c[0] == '\r')
 				continue;
 			strcat(line, c);
-			if (inFile.eof() || strlen(line) == (5 * 9))
+			if (inFile.eof() || strlen(line) == (2 * 9))
 				break;
 		}
 
-		int tag, v1, v2, v3, v4;
-		sscanf(line, "%x %x %x %x %x", &tag, &v1, &v2, &v3, &v4);
+		int v1, v2;
+		sscanf(line, "%x %x", &v1, &v2);
 
-		printf("\t{ MKTAG('%c', '%c', '%c', '%c'), %d, %d, %d, %d },\n",
-			(tag >> 24) & 0xff, (tag >> 16) & 0xff, (tag >> 8) & 0xff, tag & 0xff,
-			v1, v2, v3, v4);
+		if (counter != 0 && (counter % 3) == 0)
+			printf("\r\n");
+		if ((counter % 3) == 0)
+			printf("\t");
 
+		printf("{ 0x%.5x, 0x%.5x }, ", v1, v2);
+		++counter;
 	} while (!inFile.eof());
 
 	printf("};\r\n");
diff --git a/devtools/create_titanic/script_ranges.cpp b/devtools/create_titanic/script_ranges.cpp
index 6a0140a..b6550f7 100644
--- a/devtools/create_titanic/script_ranges.cpp
+++ b/devtools/create_titanic/script_ranges.cpp
@@ -1794,6 +1794,7 @@ void writeScriptRange(const char *name, const ScriptRange *ranges, int count) {
 
 void writeAllScriptRanges() {
 	writeScriptRange("Ranges/Barbot", BARBOT_RANGES, BARBOT_RANGE_COUNT);
+	writeScriptRange("Ranges/Bellbot", BELLBOT_RANGES, BELLBOT_RANGE_COUNT);
 	writeScriptRange("Ranges/Deskbot", DESKBOT_RANGES, DESKBOT_RANGE_COUNT);
 	writeScriptRange("Ranges/Doorbot", DOORBOT_RANGES, DOORBOT_RANGE_COUNT);
 	writeScriptRange("Ranges/Liftbot", LIFTBOT_RANGES, LIFTBOT_RANGE_COUNT);
diff --git a/devtools/create_titanic/tag_maps.cpp b/devtools/create_titanic/tag_maps.cpp
new file mode 100644
index 0000000..d3640f8
--- /dev/null
+++ b/devtools/create_titanic/tag_maps.cpp
@@ -0,0 +1,391 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+ // Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+// HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
+#include "file.h"
+#include "tag_maps.h"
+
+#define BARBOT_COUNT 250
+static const TagMapping BARBOT_MAP[250] = {
+	{ 0x46cd0, 0x3d21e }, { 0x46ce2, 0x3d23b }, { 0x46ced, 0x3d246 },
+	{ 0x46cf8, 0x3d251 }, { 0x46d03, 0x3d25c }, { 0x46d0e, 0x3d267 },
+	{ 0x46d19, 0x3d272 }, { 0x46d24, 0x3d27d }, { 0x46d2f, 0x3d288 },
+	{ 0x46cd1, 0x3d21f }, { 0x46cd9, 0x3d22a }, { 0x46cda, 0x3d233 },
+	{ 0x46cdb, 0x3d234 }, { 0x46cdc, 0x3d235 }, { 0x46cdd, 0x3d236 },
+	{ 0x46cde, 0x3d237 }, { 0x46cdf, 0x3d238 }, { 0x46ce0, 0x3d239 },
+	{ 0x46ce1, 0x3d23a }, { 0x46ce3, 0x3d23c }, { 0x46ce4, 0x3d23d },
+	{ 0x46ce5, 0x3d23e }, { 0x46ce6, 0x3d23f }, { 0x46ce7, 0x3d240 },
+	{ 0x46ce8, 0x3d241 }, { 0x46ce9, 0x3d242 }, { 0x46cea, 0x3d243 },
+	{ 0x46ceb, 0x3d244 }, { 0x46cec, 0x3d245 }, { 0x46cee, 0x3d26b },
+	{ 0x46cef, 0x3d247 }, { 0x46cf0, 0x3d248 }, { 0x46cf1, 0x3d249 },
+	{ 0x46cf2, 0x3d24a }, { 0x46cf3, 0x3d24b }, { 0x46cf4, 0x3d24c },
+	{ 0x46cf5, 0x3d24d }, { 0x46cf6, 0x3d24e }, { 0x46cf7, 0x3d24f },
+	{ 0x46cf9, 0x3d250 }, { 0x46cfa, 0x3d252 }, { 0x46cfb, 0x3d253 },
+	{ 0x46cfc, 0x3d254 }, { 0x46cfd, 0x3d255 }, { 0x46cfe, 0x3d256 },
+	{ 0x46cff, 0x3d257 }, { 0x46d00, 0x3d258 }, { 0x46d01, 0x3d259 },
+	{ 0x46d02, 0x3d25a }, { 0x46d04, 0x3d25b }, { 0x46d05, 0x3d25d },
+	{ 0x46d06, 0x3d25e }, { 0x46d07, 0x3d25f }, { 0x46d08, 0x3d260 },
+	{ 0x46d09, 0x3d26f }, { 0x46d0a, 0x3d270 }, { 0x46d0b, 0x3d271 },
+	{ 0x46d0c, 0x3d273 }, { 0x46d0d, 0x3d274 }, { 0x46d0f, 0x3d275 },
+	{ 0x46d10, 0x3d276 }, { 0x46d11, 0x3d277 }, { 0x46d12, 0x3d278 },
+	{ 0x46d13, 0x3d279 }, { 0x46d14, 0x3d27a }, { 0x46d15, 0x3d27b },
+	{ 0x46d16, 0x3d27c }, { 0x46d17, 0x3d27e }, { 0x46d18, 0x3d27f },
+	{ 0x46d1a, 0x3d280 }, { 0x46d1b, 0x3d281 }, { 0x46d1c, 0x3d282 },
+	{ 0x46d1d, 0x3d283 }, { 0x46d1e, 0x3d284 }, { 0x46d1f, 0x3d285 },
+	{ 0x46d20, 0x3d286 }, { 0x46d21, 0x3d287 }, { 0x46d22, 0x3d289 },
+	{ 0x46d23, 0x3d28a }, { 0x46d25, 0x3d28b }, { 0x46d26, 0x3d28c },
+	{ 0x46d27, 0x3d28d }, { 0x46d28, 0x3d28e }, { 0x46d29, 0x3d28f },
+	{ 0x46d2a, 0x3d290 }, { 0x46d2b, 0x3d291 }, { 0x46d2c, 0x3d292 },
+	{ 0x46d2d, 0x3d220 }, { 0x46d2e, 0x3d221 }, { 0x46d30, 0x3d222 },
+	{ 0x46d31, 0x3d223 }, { 0x46d32, 0x3d224 }, { 0x46d33, 0x3d225 },
+	{ 0x46d34, 0x3d226 }, { 0x46d35, 0x3d227 }, { 0x46d36, 0x3d228 },
+	{ 0x46d37, 0x3d229 }, { 0x46d38, 0x3d22b }, { 0x46d39, 0x3d22c },
+	{ 0x46cd2, 0x3d22d }, { 0x46cd3, 0x3d22e }, { 0x46cd5, 0x3d22f },
+	{ 0x46cd6, 0x3d230 }, { 0x46cd7, 0x3d231 }, { 0x46cd8, 0x3d232 },
+	{ 0x46d3a, 0x3d768 }, { 0x46d3b, 0x3d372 }, { 0x46d47, 0x3d43c },
+	{ 0x46d48, 0x3d7ce }, { 0x46d49, 0x3d7cf }, { 0x46d4a, 0x3d6f1 },
+	{ 0x46d4b, 0x3d77c }, { 0x46d4c, 0x3d49d }, { 0x46d4d, 0x3d77c },
+	{ 0x46d4e, 0x3d0b5 }, { 0x46d4f, 0x3d177 }, { 0x46d50, 0x3d2d7 },
+	{ 0x46d51, 0x3d77c }, { 0x46d52, 0x3d77c }, { 0x46d53, 0x3d30b },
+	{ 0x46d55, 0x3d706 }, { 0x46d56, 0x3d704 }, { 0x46d57, 0x3d77c },
+	{ 0x46d54, 0x3d0a0 }, { 0x46d58, 0x3d722 }, { 0x46d5a, 0x3d44a },
+	{ 0x46d5b, 0x3d452 }, { 0x46d5c, 0x3d469 }, { 0x46d5d, 0x3d475 },
+	{ 0x46d5e, 0x3d476 }, { 0x46d5f, 0x3d477 }, { 0x46d60, 0x3d478 },
+	{ 0x46d61, 0x3d479 }, { 0x46d62, 0x3d47a }, { 0x46d63, 0x3d44b },
+	{ 0x46d64, 0x3d44c }, { 0x46d65, 0x3d44d }, { 0x46d66, 0x3d44e },
+	{ 0x46d67, 0x3d44f }, { 0x46d68, 0x3d450 }, { 0x46d69, 0x3d451 },
+	{ 0x46d6a, 0x3d453 }, { 0x46d6b, 0x3d460 }, { 0x46d6c, 0x3d462 },
+	{ 0x46d6d, 0x3d463 }, { 0x46d6e, 0x3d464 }, { 0x46d6f, 0x3d465 },
+	{ 0x46d70, 0x3d466 }, { 0x46d71, 0x3d467 }, { 0x46d72, 0x3d468 },
+	{ 0x46d73, 0x3d454 }, { 0x46d74, 0x3d455 }, { 0x46d75, 0x3d456 },
+	{ 0x46d76, 0x3d457 }, { 0x46d77, 0x3d458 }, { 0x46d78, 0x3d459 },
+	{ 0x46d79, 0x3d45a }, { 0x46d7a, 0x3d45b }, { 0x46d7b, 0x3d45c },
+	{ 0x46d7c, 0x3d45f }, { 0x46d7d, 0x3d461 }, { 0x46d7e, 0x3d46a },
+	{ 0x46d7f, 0x3d46d }, { 0x46d80, 0x3d46e }, { 0x46d81, 0x3d46f },
+	{ 0x46d82, 0x3d470 }, { 0x46d83, 0x3d471 }, { 0x46d84, 0x3d472 },
+	{ 0x46d85, 0x3d473 }, { 0x46d86, 0x3d474 }, { 0x46d87, 0x3d46b },
+	{ 0x46d88, 0x3d75d }, { 0x46d89, 0x3d75e }, { 0x46d8a, 0x3d75f },
+	{ 0x46d8b, 0x3d760 }, { 0x46d8c, 0x3d761 }, { 0x46d8d, 0x3d762 },
+	{ 0x46d8e, 0x3d763 }, { 0x46d8f, 0x3d766 }, { 0x46d90, 0x3d767 },
+	{ 0x46d91, 0x3d77c }, { 0x46d92, 0x3d768 }, { 0x46d93, 0x3d765 },
+	{ 0x46d94, 0x3d769 }, { 0x46d95, 0x3d770 }, { 0x46d96, 0x3d775 },
+	{ 0x46d97, 0x3d776 }, { 0x46d98, 0x3d777 }, { 0x46d99, 0x3d778 },
+	{ 0x46d9a, 0x3d779 }, { 0x46d9b, 0x3d77a }, { 0x46d9c, 0x3d77b },
+	{ 0x46d9d, 0x3d764 }, { 0x46d9e, 0x3d739 }, { 0x46d9f, 0x3d73a },
+	{ 0x46da0, 0x3d73b }, { 0x46da1, 0x3d73c }, { 0x46da2, 0x3d73d },
+	{ 0x46da3, 0x3d73e }, { 0x46da4, 0x3d742 }, { 0x46da5, 0x3d744 },
+	{ 0x46da6, 0x3d743 }, { 0x46da7, 0x3d745 }, { 0x46da8, 0x3d741 },
+	{ 0x46da9, 0x3d746 }, { 0x46daa, 0x3d747 }, { 0x46dab, 0x3d748 },
+	{ 0x46dac, 0x3d749 }, { 0x46dad, 0x3d74a }, { 0x46dae, 0x3d74b },
+	{ 0x46daf, 0x3d73f }, { 0x46db0, 0x3d771 }, { 0x46db1, 0x3d74c },
+	{ 0x46db2, 0x3d74d }, { 0x46db3, 0x3d74e }, { 0x46db4, 0x3d74f },
+	{ 0x46db5, 0x3d750 }, { 0x46db6, 0x3d751 }, { 0x46db7, 0x3d753 },
+	{ 0x46db8, 0x3d755 }, { 0x46db9, 0x3d754 }, { 0x46dba, 0x3d756 },
+	{ 0x46dbb, 0x3d752 }, { 0x46dbc, 0x3d757 }, { 0x46dbd, 0x3d758 },
+	{ 0x46dbe, 0x3d759 }, { 0x46dbf, 0x3d75a }, { 0x46dc0, 0x3d75b },
+	{ 0x46dc1, 0x3d75c }, { 0x46dc2, 0x3d4a7 }, { 0x46dc3, 0x3d2bf },
+	{ 0x46dc4, 0x3d6fa }, { 0x46dc5, 0x3d6f9 }, { 0x46dc6, 0x3d6fb },
+	{ 0x46dc7, 0x3d6f5 }, { 0x46dc8, 0x3d6fc }, { 0x46dc9, 0x3d6ff },
+	{ 0x46dca, 0x3d2ab }, { 0x46dcb, 0x3d715 }, { 0x46dcc, 0x3d710 },
+	{ 0x46dcd, 0x3d70c }, { 0x46dce, 0x3d712 }, { 0x46dcf, 0x3d70f },
+	{ 0x46dd0, 0x3d717 }, { 0x46dd1, 0x3d716 }, { 0x46dd2, 0x3d285 },
+	{ 0x46dd3, 0x3d269 }, { 0x46dd4, 0x3d2f8 }, { 0x46dd5, 0x0c421 },
+	{ 0x46dd6, 0x0c3fc }
+};
+
+#define BELLBOT_COUNT 108
+static const TagMapping BELLBOT_MAP[108] = {
+	{ 0x46cd0, 0x31331 }, { 0x46ce2, 0x31332 }, { 0x46ced, 0x31333 },
+	{ 0x46cf8, 0x31334 }, { 0x46d03, 0x31335 }, { 0x46d0e, 0x31336 },
+	{ 0x46d19, 0x31337 }, { 0x46d24, 0x31338 }, { 0x46d2f, 0x31339 },
+	{ 0x46cd1, 0x3133a }, { 0x46cd9, 0x3133b }, { 0x46cda, 0x3133c },
+	{ 0x46cdb, 0x3133d }, { 0x46cdc, 0x3133e }, { 0x46cdd, 0x3133f },
+	{ 0x46cde, 0x31340 }, { 0x46cdf, 0x31341 }, { 0x46ce0, 0x31342 },
+	{ 0x46ce1, 0x31343 }, { 0x46ce3, 0x31344 }, { 0x46ce4, 0x31345 },
+	{ 0x46ce5, 0x31346 }, { 0x46ce6, 0x31347 }, { 0x46ce7, 0x31348 },
+	{ 0x46ce8, 0x31349 }, { 0x46ce9, 0x3134a }, { 0x46cea, 0x3134b },
+	{ 0x46ceb, 0x3134c }, { 0x46cec, 0x3134d }, { 0x46cee, 0x3134e },
+	{ 0x46cef, 0x3134f }, { 0x46cf0, 0x31350 }, { 0x46cf1, 0x31351 },
+	{ 0x46cf2, 0x31352 }, { 0x46cf3, 0x31353 }, { 0x46cf4, 0x31354 },
+	{ 0x46cf5, 0x31355 }, { 0x46cf6, 0x31356 }, { 0x46cf7, 0x31357 },
+	{ 0x46cf9, 0x31358 }, { 0x46cfa, 0x31359 }, { 0x46cfb, 0x3135a },
+	{ 0x46cfc, 0x3135b }, { 0x46cfd, 0x3135c }, { 0x46cfe, 0x3135d },
+	{ 0x46cff, 0x3135e }, { 0x46d00, 0x3135f }, { 0x46d01, 0x31360 },
+	{ 0x46d02, 0x31361 }, { 0x46d04, 0x31362 }, { 0x46d05, 0x31363 },
+	{ 0x46d06, 0x31364 }, { 0x46d07, 0x31365 }, { 0x46d08, 0x31366 },
+	{ 0x46d09, 0x31367 }, { 0x46d0a, 0x31368 }, { 0x46d0b, 0x31369 },
+	{ 0x46d0c, 0x3136a }, { 0x46d0d, 0x3136b }, { 0x46d0f, 0x3136c },
+	{ 0x46d10, 0x3136d }, { 0x46d11, 0x3136e }, { 0x46d12, 0x3136f },
+	{ 0x46d13, 0x31370 }, { 0x46d14, 0x31371 }, { 0x46d15, 0x31372 },
+	{ 0x46d16, 0x31373 }, { 0x46d17, 0x31374 }, { 0x46d18, 0x31375 },
+	{ 0x46d1a, 0x31376 }, { 0x46d1b, 0x31377 }, { 0x46d1c, 0x31378 },
+	{ 0x46d1d, 0x31379 }, { 0x46d1e, 0x3137a }, { 0x46d1f, 0x3137b },
+	{ 0x46d20, 0x3137c }, { 0x46d21, 0x3137d }, { 0x46d22, 0x3137e },
+	{ 0x46d23, 0x3137f }, { 0x46d25, 0x31380 }, { 0x46d26, 0x31381 },
+	{ 0x46d27, 0x31382 }, { 0x46d28, 0x31383 }, { 0x46d29, 0x31384 },
+	{ 0x46d2a, 0x31385 }, { 0x46d2b, 0x31386 }, { 0x46d2c, 0x31387 },
+	{ 0x46d2d, 0x31388 }, { 0x46d2e, 0x31389 }, { 0x46d30, 0x3138a },
+	{ 0x46d31, 0x3138b }, { 0x46d32, 0x3138c }, { 0x46d33, 0x3138d },
+	{ 0x46d34, 0x3138e }, { 0x46d35, 0x3138f }, { 0x46d36, 0x31390 },
+	{ 0x46d37, 0x31391 }, { 0x46d38, 0x31392 }, { 0x46d39, 0x31393 },
+	{ 0x46cd2, 0x31394 }, { 0x46cd3, 0x31395 }, { 0x46cd4, 0x31396 },
+	{ 0x46cd5, 0x31397 }, { 0x46cd6, 0x31398 }, { 0x46cd7, 0x31399 },
+	{ 0x46cd8, 0x3139a }, { 0x46d3b, 0x313d7 }, { 0x46d58, 0x313d6 }
+};
+
+#define DESKBOT_COUNT 108
+static const TagMapping DESKBOT_MAP[108] = {
+	{ 0x46cd0, 0x3ac00 }, { 0x46ce2, 0x3ac10 }, { 0x46ced, 0x3ac1b },
+	{ 0x46cf8, 0x3ac26 }, { 0x46d03, 0x3ac31 }, { 0x46d0e, 0x3ac3b },
+	{ 0x46d19, 0x3ac46 }, { 0x46d24, 0x3ac51 }, { 0x46d2f, 0x3ac5c },
+	{ 0x46cd1, 0x3ac01 }, { 0x46cd9, 0x3ac07 }, { 0x46cda, 0x3ac08 },
+	{ 0x46cdb, 0x3ac09 }, { 0x46cdc, 0x3ac0a }, { 0x46cdd, 0x3ac0b },
+	{ 0x46cde, 0x3ac0c }, { 0x46cdf, 0x3ac0d }, { 0x46ce0, 0x3ac0e },
+	{ 0x46ce1, 0x3ac0f }, { 0x46ce3, 0x3ac11 }, { 0x46ce4, 0x3ac12 },
+	{ 0x46ce5, 0x3ac13 }, { 0x46ce6, 0x3ac15 }, { 0x46ce7, 0x3ac16 },
+	{ 0x46ce8, 0x3ac17 }, { 0x46ce9, 0x3ac18 }, { 0x46cea, 0x3ac19 },
+	{ 0x46ceb, 0x3ac1a }, { 0x46cec, 0x3ac1c }, { 0x46cee, 0x3abf2 },
+	{ 0x46cef, 0x3ac1d }, { 0x46cf0, 0x3ac1e }, { 0x46cf1, 0x3ac1f },
+	{ 0x46cf2, 0x3ac20 }, { 0x46cf3, 0x3ac21 }, { 0x46cf4, 0x3ac22 },
+	{ 0x46cf5, 0x3ac23 }, { 0x46cf6, 0x3ac24 }, { 0x46cf7, 0x3ac25 },
+	{ 0x46cf9, 0x3ac27 }, { 0x46cfa, 0x3ac28 }, { 0x46cfb, 0x3ac29 },
+	{ 0x46cfc, 0x3ac2a }, { 0x46cfd, 0x3ac2b }, { 0x46cfe, 0x3ac2c },
+	{ 0x46cff, 0x3ac2d }, { 0x46d00, 0x3ac2e }, { 0x46d01, 0x3ac2f },
+	{ 0x46d02, 0x3ac30 }, { 0x46d04, 0x3ac32 }, { 0x46d05, 0x3ac33 },
+	{ 0x46d06, 0x3ac34 }, { 0x46d07, 0x3ac35 }, { 0x46d08, 0x3ac36 },
+	{ 0x46d09, 0x3acd2 }, { 0x46d0a, 0x3ac37 }, { 0x46d0b, 0x3ac38 },
+	{ 0x46d0c, 0x3ac39 }, { 0x46d0d, 0x3ac3a }, { 0x46d0f, 0x3ac3c },
+	{ 0x46d10, 0x3ac3d }, { 0x46d11, 0x3ac3e }, { 0x46d12, 0x3ac3f },
+	{ 0x46d13, 0x3ac40 }, { 0x46d14, 0x3ac41 }, { 0x46d15, 0x3ac42 },
+	{ 0x46d16, 0x3ac43 }, { 0x46d17, 0x3ac44 }, { 0x46d18, 0x3ac45 },
+	{ 0x46d1a, 0x3ac47 }, { 0x46d1b, 0x3ac48 }, { 0x46d1c, 0x3ac49 },
+	{ 0x46d1d, 0x3ac4a }, { 0x46d1e, 0x3ac4b }, { 0x46d1f, 0x3ac4c },
+	{ 0x46d20, 0x3ac4d }, { 0x46d21, 0x3ac4e }, { 0x46d22, 0x3ac4f },
+	{ 0x46d23, 0x3ac50 }, { 0x46d25, 0x3ac52 }, { 0x46d26, 0x3ac53 },
+	{ 0x46d27, 0x3ac54 }, { 0x46d28, 0x3ac55 }, { 0x46d29, 0x3ac56 },
+	{ 0x46d2a, 0x3ac57 }, { 0x46d2b, 0x3ac58 }, { 0x46d2c, 0x3ac59 },
+	{ 0x46d2d, 0x3ac5a }, { 0x46d2e, 0x3ac5b }, { 0x46d30, 0x3ac5d },
+	{ 0x46d31, 0x3ac5e }, { 0x46d32, 0x3ac5f }, { 0x46d33, 0x3ac60 },
+	{ 0x46d34, 0x3ac61 }, { 0x46d35, 0x3ac62 }, { 0x46d36, 0x3ac63 },
+	{ 0x46d37, 0x3ac64 }, { 0x46d38, 0x3ac65 }, { 0x46d39, 0x3ac66 },
+	{ 0x46cd2, 0x3ac02 }, { 0x46cd3, 0x3ac03 }, { 0x46cd4, 0x3ac04 },
+	{ 0x46cd5, 0x3ac05 }, { 0x46cd6, 0x3ac06 }, { 0x46d3b, 0x3ae27 },
+	{ 0x46d58, 0x3ae0e }, { 0x46dd2, 0x3aebc }, { 0x46dd6, 0x3aebd }
+};
+
+#define DOORBOT_COUNT 240
+static const TagMapping DOORBOT_MAP[240] = {
+	{ 0x46cd1, 0x35ee6 }, { 0x46cd2, 0x35ee7 }, { 0x46cd3, 0x35ee8 },
+	{ 0x46cd4, 0x35ee9 }, { 0x46cd5, 0x35eea }, { 0x46cd6, 0x35eeb },
+	{ 0x46cd7, 0x35eec }, { 0x46cd8, 0x35eed }, { 0x46cd9, 0x35eee },
+	{ 0x46cda, 0x35eef }, { 0x46cdb, 0x35ef0 }, { 0x46cdc, 0x35ef1 },
+	{ 0x46cdd, 0x35ef2 }, { 0x46cde, 0x35ef3 }, { 0x46cdf, 0x35ef4 },
+	{ 0x46ce0, 0x35ef5 }, { 0x46ce1, 0x35ef6 }, { 0x46ce2, 0x35ef7 },
+	{ 0x46ce3, 0x35ef8 }, { 0x46ce4, 0x35ef9 }, { 0x46ce5, 0x35efa },
+	{ 0x46ce6, 0x35efb }, { 0x46ce7, 0x35efc }, { 0x46ce8, 0x35efd },
+	{ 0x46ce9, 0x35efe }, { 0x46cea, 0x35eff }, { 0x46ceb, 0x35f00 },
+	{ 0x46cec, 0x35f01 }, { 0x46ced, 0x35f02 }, { 0x46cee, 0x35f03 },
+	{ 0x46cef, 0x35f04 }, { 0x46cf0, 0x35f05 }, { 0x46cf1, 0x35f06 },
+	{ 0x46cf2, 0x35f07 }, { 0x46cf3, 0x35f08 }, { 0x46cf4, 0x35f09 },
+	{ 0x46cf5, 0x35f0a }, { 0x46cf6, 0x35f0b }, { 0x46cf7, 0x35f0c },
+	{ 0x46cf8, 0x35f0d }, { 0x46cf9, 0x35f0e }, { 0x46cfa, 0x35f0f },
+	{ 0x46cfb, 0x35f10 }, { 0x46cfc, 0x35f11 }, { 0x46cfd, 0x35f12 },
+	{ 0x46cfe, 0x35f13 }, { 0x46cff, 0x35f14 }, { 0x46d00, 0x35f15 },
+	{ 0x46d01, 0x35f16 }, { 0x46d02, 0x35f17 }, { 0x46d03, 0x35f18 },
+	{ 0x46d04, 0x35f19 }, { 0x46d05, 0x35f1a }, { 0x46d06, 0x35f1b },
+	{ 0x46d07, 0x35f1c }, { 0x46d08, 0x35f1d }, { 0x46d09, 0x35f1e },
+	{ 0x46d0a, 0x35f1f }, { 0x46d0b, 0x35f20 }, { 0x46d0c, 0x35f21 },
+	{ 0x46d0d, 0x35f22 }, { 0x46d0e, 0x35f23 }, { 0x46d0f, 0x35f24 },
+	{ 0x46d10, 0x35f25 }, { 0x46d11, 0x35f26 }, { 0x46d12, 0x35f27 },
+	{ 0x46d13, 0x35f28 }, { 0x46d14, 0x35f29 }, { 0x46d15, 0x35f2a },
+	{ 0x46d16, 0x35f2b }, { 0x46d17, 0x35f2c }, { 0x46d18, 0x35f2d },
+	{ 0x46d19, 0x35f2e }, { 0x46d1a, 0x35f2f }, { 0x46d1b, 0x35f30 },
+	{ 0x46d1c, 0x35f31 }, { 0x46d1d, 0x35f32 }, { 0x46d1e, 0x35f33 },
+	{ 0x46d1f, 0x35f34 }, { 0x46d20, 0x35f35 }, { 0x46d21, 0x35f36 },
+	{ 0x46d22, 0x35f37 }, { 0x46d23, 0x35f38 }, { 0x46d24, 0x35f39 },
+	{ 0x46d25, 0x35f3a }, { 0x46d26, 0x35f3b }, { 0x46d27, 0x35f3c },
+	{ 0x46d28, 0x35f3d }, { 0x46d29, 0x35f3e }, { 0x46d2a, 0x35f3f },
+	{ 0x46d2b, 0x35f40 }, { 0x46d2c, 0x35f41 }, { 0x46d2d, 0x35f42 },
+	{ 0x46d2e, 0x35f43 }, { 0x46d2f, 0x35f44 }, { 0x46d30, 0x35f45 },
+	{ 0x46d31, 0x35f46 }, { 0x46d32, 0x35f47 }, { 0x46d33, 0x35f48 },
+	{ 0x46d34, 0x35f49 }, { 0x46d35, 0x35f4a }, { 0x46d36, 0x35f4b },
+	{ 0x46d37, 0x35f4c }, { 0x46d38, 0x35f4d }, { 0x46d39, 0x35f4e },
+	{ 0x46d3a, 0x35bf5 }, { 0x46d3b, 0x360c0 }, { 0x46d3d, 0x36027 },
+	{ 0x46d3e, 0x36028 }, { 0x46d3f, 0x36029 }, { 0x46d40, 0x3602a },
+	{ 0x46d41, 0x3602e }, { 0x46d42, 0x3602f }, { 0x46d43, 0x36030 },
+	{ 0x46d44, 0x36031 }, { 0x46d45, 0x3602c }, { 0x46d46, 0x3602d },
+	{ 0x46d47, 0x36227 }, { 0x46d48, 0x36084 }, { 0x46d49, 0x36085 },
+	{ 0x46d4a, 0x36467 }, { 0x46d4b, 0x36457 }, { 0x46d4c, 0x36457 },
+	{ 0x46d4d, 0x36457 }, { 0x46d4e, 0x3646d }, { 0x46d4f, 0x36457 },
+	{ 0x46d50, 0x36470 }, { 0x46d51, 0x36457 }, { 0x46d52, 0x36457 },
+	{ 0x46d53, 0x36457 }, { 0x46d55, 0x360a3 }, { 0x46d56, 0x3634c },
+	{ 0x46d57, 0x36457 }, { 0x46d54, 0x36457 }, { 0x46d58, 0x360bf },
+	{ 0x46d5a, 0x36407 }, { 0x46d5b, 0x3640c }, { 0x46d5c, 0x3641a },
+	{ 0x46d5d, 0x36420 }, { 0x46d5e, 0x36421 }, { 0x46d5f, 0x36422 },
+	{ 0x46d60, 0x36423 }, { 0x46d61, 0x36424 }, { 0x46d66, 0x36408 },
+	{ 0x46d67, 0x36409 }, { 0x46d68, 0x3640a }, { 0x46d69, 0x3640b },
+	{ 0x46d6a, 0x3640d }, { 0x46d6e, 0x36415 }, { 0x46d6f, 0x36416 },
+	{ 0x46d70, 0x36417 }, { 0x46d71, 0x36418 }, { 0x46d72, 0x36419 },
+	{ 0x46d73, 0x3640e }, { 0x46d74, 0x3640f }, { 0x46d75, 0x36410 },
+	{ 0x46d76, 0x36411 }, { 0x46d77, 0x36412 }, { 0x46d7e, 0x3641b },
+	{ 0x46d7f, 0x3641c }, { 0x46d80, 0x3641d }, { 0x46d81, 0x3641e },
+	{ 0x46d82, 0x3641f }, { 0x46d88, 0x362d4 }, { 0x46d89, 0x362db },
+	{ 0x46d8a, 0x362e2 }, { 0x46d8b, 0x362e3 }, { 0x46d8c, 0x362e7 },
+	{ 0x46d8d, 0x362eb }, { 0x46d8e, 0x362f2 }, { 0x46d8f, 0x362f5 },
+	{ 0x46d90, 0x36305 }, { 0x46d91, 0x36457 }, { 0x46d92, 0x36309 },
+	{ 0x46d93, 0x362f4 }, { 0x46d94, 0x3630a }, { 0x46d96, 0x36318 },
+	{ 0x46d97, 0x36319 }, { 0x46d98, 0x36326 }, { 0x46d99, 0x36327 },
+	{ 0x46d9a, 0x3632e }, { 0x46d9b, 0x3632f }, { 0x46d9c, 0x36330 },
+	{ 0x46d9d, 0x362f3 }, { 0x46d9e, 0x362b0 }, { 0x46d9f, 0x362b1 },
+	{ 0x46da0, 0x362b2 }, { 0x46da1, 0x362b3 }, { 0x46da2, 0x362b4 },
+	{ 0x46da3, 0x362b5 }, { 0x46da4, 0x362b9 }, { 0x46da5, 0x362bb },
+	{ 0x46da6, 0x362ba }, { 0x46da7, 0x362bc }, { 0x46da8, 0x362b8 },
+	{ 0x46da9, 0x362bd }, { 0x46daa, 0x362be }, { 0x46dab, 0x362bf },
+	{ 0x46dac, 0x362c0 }, { 0x46dad, 0x362c1 }, { 0x46dae, 0x362c2 },
+	{ 0x46daf, 0x362b6 }, { 0x46db0, 0x36314 }, { 0x46db1, 0x362c3 },
+	{ 0x46db2, 0x362c4 }, { 0x46db3, 0x362c5 }, { 0x46db4, 0x362c6 },
+	{ 0x46db5, 0x362c7 }, { 0x46db6, 0x362c8 }, { 0x46db7, 0x362ca },
+	{ 0x46db8, 0x362cc }, { 0x46db9, 0x362cb }, { 0x46dba, 0x362cd },
+	{ 0x46dbb, 0x362c9 }, { 0x46dbc, 0x362ce }, { 0x46dbd, 0x362cf },
+	{ 0x46dbe, 0x362d0 }, { 0x46dbf, 0x362d1 }, { 0x46dc0, 0x362d2 },
+	{ 0x46dc1, 0x362d3 }, { 0x46dc2, 0x3637c }, { 0x46dc3, 0x3627c },
+	{ 0x46dc4, 0x36497 }, { 0x46dc5, 0x36493 }, { 0x46dc6, 0x3647f },
+	{ 0x46dc7, 0x3647c }, { 0x46dc8, 0x36482 }, { 0x46dc9, 0x3648a },
+	{ 0x46dca, 0x3649b }, { 0x46dcb, 0x364b6 }, { 0x46dcc, 0x364aa },
+	{ 0x46dcd, 0x364a1 }, { 0x46dce, 0x364b0 }, { 0x46dcf, 0x364a7 },
+	{ 0x46dd1, 0x364b9 }, { 0x46dd2, 0x36370 }, { 0x46dd3, 0x363ab },
+	{ 0x46dd4, 0x36404 }, { 0x46dd5, 0x362ab }, { 0x46dd6, 0x3636d }
+};
+
+#define LIFTBOT_COUNT 118
+static const TagMapping LIFTBOT_MAP[118] = {
+	{ 0x46cd1, 0x335b5 }, { 0x46cd2, 0x33603 }, { 0x46cd3, 0x33604 },
+	{ 0x46cd4, 0x33605 }, { 0x46cd5, 0x33606 }, { 0x46cd6, 0x33607 },
+	{ 0x46cd7, 0x33608 }, { 0x46cd8, 0x33607 }, { 0x46cd9, 0x335b6 },
+	{ 0x46cda, 0x335b7 }, { 0x46cdb, 0x335b8 }, { 0x46cdc, 0x335b9 },
+	{ 0x46cdd, 0x335ba }, { 0x46cde, 0x335bb }, { 0x46cdf, 0x335bc },
+	{ 0x46ce0, 0x335bd }, { 0x46ce1, 0x335bf }, { 0x46ce2, 0x335ac },
+	{ 0x46ce3, 0x335c0 }, { 0x46ce4, 0x335c1 }, { 0x46ce5, 0x335c2 },
+	{ 0x46ce6, 0x335c4 }, { 0x46ce7, 0x335c5 }, { 0x46ce8, 0x335c6 },
+	{ 0x46ce9, 0x335c7 }, { 0x46cea, 0x335c8 }, { 0x46ceb, 0x335ca },
+	{ 0x46cec, 0x335cb }, { 0x46ced, 0x335ad }, { 0x46cee, 0x335cc },
+	{ 0x46cef, 0x335ce }, { 0x46cf0, 0x335d0 }, { 0x46cf1, 0x335d1 },
+	{ 0x46cf2, 0x335d2 }, { 0x46cf3, 0x335d4 }, { 0x46cf4, 0x335d5 },
+	{ 0x46cf5, 0x335d6 }, { 0x46cf6, 0x335d7 }, { 0x46cf7, 0x335d8 },
+	{ 0x46cf8, 0x335ae }, { 0x46cf9, 0x335d9 }, { 0x46cfa, 0x335db },
+	{ 0x46cfb, 0x335de }, { 0x46cfc, 0x335df }, { 0x46cfd, 0x335e0 },
+	{ 0x46cfe, 0x335e1 }, { 0x46cff, 0x335e2 }, { 0x46d00, 0x335e3 },
+	{ 0x46d01, 0x335e4 }, { 0x46d02, 0x335e5 }, { 0x46d03, 0x335af },
+	{ 0x46d04, 0x335e6 }, { 0x46d05, 0x335e7 }, { 0x46d06, 0x335ea },
+	{ 0x46d07, 0x335eb }, { 0x46d08, 0x335ec }, { 0x46d09, 0x3364a },
+	{ 0x46d0a, 0x3364b }, { 0x46d0b, 0x3364c }, { 0x46d0c, 0x3364d },
+	{ 0x46d0d, 0x3364e }, { 0x46d0e, 0x335b0 }, { 0x46d0f, 0x33650 },
+	{ 0x46d10, 0x33651 }, { 0x46d11, 0x33652 }, { 0x46d12, 0x33653 },
+	{ 0x46d13, 0x33654 }, { 0x46d14, 0x33656 }, { 0x46d15, 0x33657 },
+	{ 0x46d16, 0x33658 }, { 0x46d17, 0x33659 }, { 0x46d18, 0x3365b },
+	{ 0x46d19, 0x335b1 }, { 0x46d1a, 0x3365c }, { 0x46d1b, 0x3365d },
+	{ 0x46d1c, 0x3365e }, { 0x46d1d, 0x3365f }, { 0x46d1e, 0x33660 },
+	{ 0x46d1f, 0x33661 }, { 0x46d20, 0x33662 }, { 0x46d21, 0x33663 },
+	{ 0x46d22, 0x335a9 }, { 0x46d23, 0x335aa }, { 0x46d24, 0x335b2 },
+	{ 0x46d25, 0x335ed }, { 0x46d26, 0x335ee }, { 0x46d27, 0x335ef },
+	{ 0x46d28, 0x335f0 }, { 0x46d29, 0x335f1 }, { 0x46d2a, 0x335f2 },
+	{ 0x46d2b, 0x335f4 }, { 0x46d2c, 0x335f5 }, { 0x46d2d, 0x335f6 },
+	{ 0x46d2e, 0x335f7 }, { 0x46d2f, 0x335b4 }, { 0x46d30, 0x335f8 },
+	{ 0x46d31, 0x335f9 }, { 0x46d32, 0x335fa }, { 0x46d33, 0x335fb },
+	{ 0x46d34, 0x335fc }, { 0x46d35, 0x335fd }, { 0x46d36, 0x335ff },
+	{ 0x46d37, 0x33600 }, { 0x46d38, 0x33601 }, { 0x46d39, 0x33602 },
+	{ 0x46d3a, 0x3380f }, { 0x46d3b, 0x33695 }, { 0x46d47, 0x07536 },
+	{ 0x46d4a, 0x3360c }, { 0x46d4e, 0x337fc }, { 0x46d50, 0x337fd },
+	{ 0x46d56, 0x33800 }, { 0x46d58, 0x33694 }, { 0x46dc2, 0x337f3 },
+	{ 0x46dc6, 0x337fb }, { 0x46dc7, 0x337f9 }, { 0x46dca, 0x33802 },
+	{ 0x46dd3, 0x33775 }
+};
+
+#define MAITRED_COUNT 108
+static const TagMapping MAITRED_MAP[] = {
+	{ 0x46cd0, 0x3f94c }, { 0x46ce2, 0x3f9a6 }, { 0x46ced, 0x3f9a7 },
+	{ 0x46cf8, 0x3f9a8 }, { 0x46d03, 0x3f9a9 }, { 0x46d0e, 0x3f9aa },
+	{ 0x46d19, 0x3f9ab }, { 0x46d24, 0x3f9ac }, { 0x46d2f, 0x3f9ad },
+	{ 0x46cd1, 0x3f9ae }, { 0x46cd9, 0x3f9af }, { 0x46cda, 0x3f9b0 },
+	{ 0x46cdb, 0x3f9b1 }, { 0x46cdc, 0x3f9b2 }, { 0x46cdd, 0x3f9b3 },
+	{ 0x46cde, 0x3f9b4 }, { 0x46cdf, 0x3f9b5 }, { 0x46ce0, 0x3f9b6 },
+	{ 0x46ce1, 0x3f9b7 }, { 0x46ce3, 0x3f9b8 }, { 0x46ce4, 0x3f9b9 },
+	{ 0x46ce5, 0x3f9ba }, { 0x46ce6, 0x3f9bb }, { 0x46ce7, 0x3f9bc },
+	{ 0x46ce8, 0x3f9bd }, { 0x46ce9, 0x3f9be }, { 0x46cea, 0x3f9bf },
+	{ 0x46ceb, 0x3f9c0 }, { 0x46cec, 0x3f9c1 }, { 0x46cee, 0x3f9c2 },
+	{ 0x46cef, 0x3f9c3 }, { 0x46cf0, 0x3f9c4 }, { 0x46cf1, 0x3f9c5 },
+	{ 0x46cf2, 0x3f9c6 }, { 0x46cf3, 0x3f9c7 }, { 0x46cf4, 0x3f9c8 },
+	{ 0x46cf5, 0x3f9c9 }, { 0x46cf6, 0x3f9ca }, { 0x46cf7, 0x3f9cb },
+	{ 0x46cf9, 0x3f9cc }, { 0x46cfa, 0x3f9cd }, { 0x46cfb, 0x3f9ce },
+	{ 0x46cfc, 0x3f9cf }, { 0x46cfd, 0x3f9d0 }, { 0x46cfe, 0x3f9d1 },
+	{ 0x46cff, 0x3f9d2 }, { 0x46d00, 0x3f9d3 }, { 0x46d01, 0x3f9d4 },
+	{ 0x46d02, 0x3f9d5 }, { 0x46d04, 0x3f9d6 }, { 0x46d05, 0x3f9d7 },
+	{ 0x46d06, 0x3f9d9 }, { 0x46d07, 0x3f9da }, { 0x46d08, 0x3f9db },
+	{ 0x46d09, 0x3f98a }, { 0x46d0a, 0x3f98b }, { 0x46d0b, 0x3f98c },
+	{ 0x46d0c, 0x3f98d }, { 0x46d0d, 0x3f98e }, { 0x46d0f, 0x3f98f },
+	{ 0x46d10, 0x3f991 }, { 0x46d11, 0x3f992 }, { 0x46d12, 0x3f993 },
+	{ 0x46d13, 0x3f994 }, { 0x46d14, 0x3f996 }, { 0x46d15, 0x3f997 },
+	{ 0x46d16, 0x3f998 }, { 0x46d17, 0x3f999 }, { 0x46d18, 0x3f99a },
+	{ 0x46d1a, 0x3f99b }, { 0x46d1b, 0x3f99c }, { 0x46d1c, 0x3f99d },
+	{ 0x46d1d, 0x3f99e }, { 0x46d1e, 0x3f99f }, { 0x46d1f, 0x3f9a1 },
+	{ 0x46d20, 0x3f9a2 }, { 0x46d21, 0x3f9a3 }, { 0x46d22, 0x3f9a4 },
+	{ 0x46d23, 0x3f9a5 }, { 0x46d25, 0x3f9dd }, { 0x46d26, 0x3f9de },
+	{ 0x46d27, 0x3f9df }, { 0x46d28, 0x3f9e0 }, { 0x46d29, 0x3f9e1 },
+	{ 0x46d2a, 0x3f9e2 }, { 0x46d2b, 0x3f9e3 }, { 0x46d2c, 0x3f9e4 },
+	{ 0x46d2d, 0x3f9e5 }, { 0x46d2e, 0x3f9e6 }, { 0x46d30, 0x3f9e7 },
+	{ 0x46d31, 0x3f9e8 }, { 0x46d32, 0x3f9e9 }, { 0x46d33, 0x3f9ea },
+	{ 0x46d34, 0x3f9eb }, { 0x46d35, 0x3f9ec }, { 0x46d36, 0x3f9ed },
+	{ 0x46d37, 0x3f9ee }, { 0x46d38, 0x3f9ef }, { 0x46d39, 0x3f9f0 },
+	{ 0x46cd2, 0x3f9f1 }, { 0x46cd3, 0x3f9f2 }, { 0x46cd4, 0x3f9f3 },
+	{ 0x46cd5, 0x3f9f9 }, { 0x46cd6, 0x3f9fa }, { 0x46cd7, 0x3f9fb },
+	{ 0x46cd8, 0x3f9fc }, { 0x46d3b, 0x3f853 }, { 0x46d58, 0x3f83c }
+};
+
+void writeTagMappings(const char *name, const TagMapping *map, int count) {
+	outputFile.seek(dataOffset);
+
+	for (int idx = 0; idx < count; ++idx, ++map) {
+		outputFile.writeLong(map->_src);
+		outputFile.writeLong(map->_dest);
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader(name, dataOffset, size);
+	dataOffset += size;
+}
+
+void writeAllTagMappings() {
+	writeTagMappings("TagMap/Barbot", BARBOT_MAP, BARBOT_COUNT);
+	writeTagMappings("TagMap/Bellbot", BELLBOT_MAP, BELLBOT_COUNT);
+	writeTagMappings("TagMap/Deskbot", DESKBOT_MAP, DESKBOT_COUNT);
+	writeTagMappings("TagMap/Doorbot", DOORBOT_MAP, DOORBOT_COUNT);
+	writeTagMappings("TagMap/Liftbot", LIFTBOT_MAP, LIFTBOT_COUNT);
+	writeTagMappings("TagMap/MaitreD", MAITRED_MAP, MAITRED_COUNT);
+}
\ No newline at end of file
diff --git a/devtools/create_titanic/tag_maps.h b/devtools/create_titanic/tag_maps.h
new file mode 100644
index 0000000..33dd8e6
--- /dev/null
+++ b/devtools/create_titanic/tag_maps.h
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef COMMON_TAG_MAPS_H
+#define COMMON_TAG_MAPS_H
+
+#include "common/scummsys.h"
+
+struct TagMapping {
+	uint _src;
+	uint _dest;
+};
+
+extern void writeAllTagMappings();
+extern void writeEntryHeader(const char *name, uint offset, uint size);
+extern uint dataOffset;
+
+#endif
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 2687336..a864107 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -207,8 +207,9 @@ int BarbotScript::proc15() const {
 	return 0;
 }
 
-bool BarbotScript::proc16() const {
-	warning("TODO");
+bool BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+	int val, uint tagId, uint remainder) const {
+	warning("TODO: handleQuote");
 	return false;
 }
 
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 419d7cf..d49cf59 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -59,7 +59,9 @@ public:
 
 	virtual int proc10() const;
 	virtual int proc15() const;
-	virtual bool proc16() const;
+
+	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		int val, uint tagId, uint remainder) const;
 	
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 78eab6e..ddb7e04 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -66,9 +66,10 @@ int BellbotScript::proc15() const {
 	return 0;
 }
 
-bool BellbotScript::proc16() const {
-	warning("TODO");
-	return 0;
+bool BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+	int val, uint tagId, uint remainder) const {
+	warning("TODO: handleQuote");
+	return false;
 }
 
 bool BellbotScript::proc18() const {
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index cc70b27..1c027e7 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -46,7 +46,9 @@ public:
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
-	virtual bool proc16() const;
+
+	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		int val, uint tagId, uint remainder) const;
 
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 224496c..0012cf7 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -41,6 +41,7 @@ public:
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
+
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index f7015e1..912e881 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -52,6 +52,7 @@ public:
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
 	virtual int proc15() const;
+
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 1db3163..f3704e1 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -48,6 +48,7 @@ public:
 	virtual int proc9() const;
 	virtual int proc10() const;
 	virtual int proc15() const;
+
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 0ebfabf..ea3aaee 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -44,6 +44,7 @@ public:
 
 	virtual void proc7(int v1, int v2);
 	virtual int proc10() const;
+
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index bcf3c7d..be96cf9 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -276,8 +276,10 @@ public:
 	virtual void selectResponse(int id);
 	
 	virtual int proc15(int id) const;
+
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
+
 	virtual bool proc17() const;
 	virtual bool proc18() const;
 


Commit: ab55958319e285781e086ad2edc28297fce65a3d
    https://github.com/scummvm/scummvm/commit/ab55958319e285781e086ad2edc28297fce65a3d
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-07-15T19:23:07-04:00

Commit Message:
TITANIC: Fix compilation on MSVC9

Changed paths:
    engines/titanic/true_talk/true_talk_manager.cpp
    engines/titanic/true_talk/tt_string.cpp
    engines/titanic/true_talk/tt_string.h



diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 91e6c9e..5444cde 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -335,8 +335,7 @@ void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CView
 
 	if (npcScript && roomScript) {
 		_currentNPC = npc;
-		_titleEngine._scriptHandler->processInput(roomScript, npcScript,
-			TTstring(msg->_input));
+		_titleEngine._scriptHandler->processInput(roomScript, npcScript, TTstring(msg->_input));
 		_currentNPC = nullptr;
 
 		loadAssets(npc, npcScript->charId());
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp
index 58914130..198a8c2 100644
--- a/engines/titanic/true_talk/tt_string.cpp
+++ b/engines/titanic/true_talk/tt_string.cpp
@@ -38,7 +38,7 @@ TTstring::TTstring(const CString &str) {
 	_data = new TTstringData(str);
 }
 
-TTstring::TTstring(TTstring &str) {
+TTstring::TTstring(const TTstring &str) {
 	if (str._status != SS_VALID) {
 		_status = SS_5;
 		_data = nullptr;
diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h
index 12daa07..5b12d93 100644
--- a/engines/titanic/true_talk/tt_string.h
+++ b/engines/titanic/true_talk/tt_string.h
@@ -51,7 +51,7 @@ public:
 	TTstring();
 	TTstring(const char *str);
 	TTstring(const CString &str);
-	TTstring(TTstring &str);
+	TTstring(const TTstring &str);
 	virtual ~TTstring();
 
 	void operator=(const TTstring &str);


Commit: 840557236c7f9f3e4e10b586781a36eb712b7de3
    https://github.com/scummvm/scummvm/commit/840557236c7f9f3e4e10b586781a36eb712b7de3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:10-04:00

Commit Message:
TITANIC: Add loading of NPC tag maps, TTnpcScript translateId method

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index a864107..7cc1e0a 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -49,6 +49,7 @@ BarbotScript::BarbotScript(int val1, const char *charClass, int v2,
 	loadRanges("Ranges/Barbot");
 	loadResponses("Responses/Barbot");
 	setupSentences();
+	_tagMappings.load("TagMap/Barbot");
 }
 
 void BarbotScript::setupSentences() {
@@ -255,11 +256,6 @@ int BarbotScript::proc36(int tagId) const {
 	return 0;
 }
 
-uint BarbotScript::translateId(uint id) const {
-	warning("TODO");
-	return 0;
-}
-
 void BarbotScript::adjustDial(int dialNum, int amount) {
 	int level = CLIP(getDialLevel(dialNum) + amount, 0, 100);
 	setDial(dialNum, level);
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index d49cf59..4232102 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -72,8 +72,6 @@ public:
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc32();
 	virtual int proc36(int val) const;
-	
-	virtual uint translateId(uint id) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index ddb7e04..fa00718 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -42,6 +42,7 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	loadRanges("Ranges/Bellbot");
 	loadResponses("Responses/Bellbot", 4);
 	setupSentences();
+	_tagMappings.load("TagMap/Bellbot");
 }
 
 void BellbotScript::setupSentences() {
@@ -110,9 +111,4 @@ int BellbotScript::proc36(int id) const {
 	return 0;
 }
 
-uint BellbotScript::translateId(uint id) const {
-	warning("TODO");
-	return 0;
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 1c027e7..f13b1b2 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -58,7 +58,6 @@ public:
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
-	virtual uint translateId(uint id) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 0b8c7e2..c323c7c 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -43,6 +43,7 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 	loadRanges("Ranges/Deskbot");
 	loadResponses("Responses/Deskbot", 4);
 	setupSentences();
+	_tagMappings.load("TagMap/Deskbot");
 }
 
 void DeskbotScript::setupSentences() {
@@ -111,11 +112,6 @@ int DeskbotScript::proc36(int id) const {
 	return 0;
 }
 
-uint DeskbotScript::translateId(uint id) const {
-	warning("TODO");
-	return 0;
-}
-
 void DeskbotScript::proc38() {
 	warning("TODO");
 }
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 0012cf7..b75abaa 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -53,7 +53,6 @@ public:
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
-	virtual uint translateId(uint id) const;
 
 	virtual void proc38();
 	virtual void proc39();
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 7e01813..bfa1ba9 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -37,6 +37,7 @@ DoorbotScript::DoorbotScript(int val1, const char *charClass, int v2,
 	loadRanges("Ranges/Doorbot");
 	loadResponses("Responses/Doorbot");
 	setupSentences();
+	_tagMappings.load("TagMap/Doorbot");
 }
 
 void DoorbotScript::setupSentences() {
@@ -169,11 +170,6 @@ int DoorbotScript::proc36(int id) const {
 	return 0;
 }
 
-uint DoorbotScript::translateId(uint id) const {
-	warning("TODO");
-	return 0;
-}
-
 int DoorbotScript::setResponse(int dialogueId, int v34) {
 	addResponse(dialogueId);
 	applyResponse();
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 912e881..ef14cf7 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -65,7 +65,6 @@ public:
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc32();
 	virtual int proc36(int val) const;
-	virtual uint translateId(uint id) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index b96f485..cabfe41 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -38,6 +38,7 @@ LiftbotScript::LiftbotScript(int val1, const char *charClass, int v2,
 	loadRanges("Ranges/Liftbot");
 	loadResponses("Responses/Liftbot");
 	setupSentences();
+	_tagMappings.load("TagMap/Liftbot");
 }
 
 void LiftbotScript::setupSentences() {
@@ -141,9 +142,4 @@ void LiftbotScript::proc32() {
 	warning("TODO");
 }
 
-uint LiftbotScript::translateId(uint id) const {
-	warning("TODO");
-	return 0;
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index f3704e1..39ff9bb 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -60,7 +60,6 @@ public:
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc32();
-	virtual uint translateId(uint id) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 2497fd8..b5d5e3a 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -41,6 +41,7 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
 	loadRanges("Ranges/MaitreD");
 	loadResponses("Responses/MaitreD");
 	setupSentences();
+	_tagMappings.load("TagMap/MaitreD");
 }
 
 void MaitreDScript::setupSentences() {
@@ -110,9 +111,4 @@ int MaitreDScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsenten
 void MaitreDScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
-uint MaitreDScript::translateId(uint id) const {
-	warning("TODO");
-	return 0;
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index ea3aaee..0c96434 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -55,7 +55,6 @@ public:
 	virtual const int *getTablePtr(int id);
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
-	virtual uint translateId(uint id) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 070ecbb..d7fc34f 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -124,6 +124,21 @@ void TTscriptMappings::load(const char *name, int valuesPerMapping) {
 
 /*------------------------------------------------------------------------*/
 
+void TTtagMappings::load(const char *name) {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+
+	while (r->pos() < r->size()) {
+		uint src = r->readUint32LE();
+		uint dest = r->readUint32LE();
+
+		push_back(TTtagMapping(src, dest));
+	}
+
+	delete r;
+}
+
+/*------------------------------------------------------------------------*/
+
 TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTscriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
@@ -489,6 +504,11 @@ int TTnpcScript::proc36(int id) const {
 }
 
 uint TTnpcScript::translateId(uint id) const {
+	for (uint idx = 0; idx < _tagMappings.size(); ++idx) {
+		if (_tagMappings[idx]._src == id)
+			return _tagMappings[idx]._dest;
+	}
+
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index be96cf9..d2a5328 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -109,6 +109,17 @@ public:
 	void load(const char *name, int valuesPerMapping);
 };
 
+struct TTtagMapping {
+	uint _src, _dest;
+	TTtagMapping() : _src(0), _dest(0) {}
+	TTtagMapping(uint src, uint dest) : _src(src), _dest(dest) {}
+};
+
+class TTtagMappings : public Common::Array<TTtagMapping> {
+public:
+	void load(const char *name);
+};
+
 class TTnpcScriptBase : public TTscriptBase {
 protected:
 	int _field54;
@@ -153,6 +164,7 @@ protected:
 	Common::Array<TTscriptRange> _ranges;
 	TTscriptMappings _mappings;
 	TTsentenceEntries _entries;
+	TTtagMappings _tagMappings;
 	int _entryCount;
 	int _field68;
 	int _field6C;


Commit: d13501bd1c78504f7d75443e8f45bcee67900e96
    https://github.com/scummvm/scummvm/commit/d13501bd1c78504f7d75443e8f45bcee67900e96
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:13-04:00

Commit Message:
TITANIC: Added TTnpcScript getDialLevel

Changed paths:
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index d7fc34f..94401da 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -20,6 +20,7 @@
  *
  */
 
+#include "common/algorithm.h"
 #include "common/textconsole.h"
 #include "titanic/pet_control/pet_control.h"
 #include "titanic/true_talk/tt_npc_script.h"
@@ -494,9 +495,20 @@ int TTnpcScript::getDialRegion(int dialNum) {
 	}
 }
 
-int TTnpcScript::getDialLevel(uint dialNum, bool flag) {
-	warning("TODO");
-	return 0;
+int TTnpcScript::getDialLevel(uint dialNum, bool randomizeFlag) {
+	int result = _dialValues[dialNum];
+	if (randomizeFlag) {
+		bool lowFlag = result <= 50;
+		result = CLIP(result + (int)getRandomNumber(18) - 9, 0, 100);
+
+		if (lowFlag) {
+			result = MIN(result, 46);
+		} else {
+			result = MAX(result, 54);
+		}
+	}
+
+	return result;
 }
 
 int TTnpcScript::proc36(int id) const {
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index d2a5328..0e4359b 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -331,10 +331,12 @@ public:
 	virtual int getDialRegion(int dialNum);
 
 	/**
-	 * Gets the value for a dial, introducing a slight random variance so that
-	 * the displayed dial will oscillate randomly around it's real level
+	 * Gets the value for a dial
+	 * @param dialNum		Dial number
+	 * @param randomizeFlag	If set, introduces a slight random variance so that
+	 *		the displayed dial will oscillate randomly around it's real level
 	 */
-	virtual int getDialLevel(uint dialNum, bool flag = true);
+	virtual int getDialLevel(uint dialNum, bool randomizeFlag = true);
 
 	virtual int proc36(int val) const;
 	virtual uint translateId(uint id) const;


Commit: f4ce2d04c35de96bd8cbc2897b0d4998784bfde3
    https://github.com/scummvm/scummvm/commit/f4ce2d04c35de96bd8cbc2897b0d4998784bfde3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:16-04:00

Commit Message:
TITANIC: Added Deskbot dial test methods

Changed paths:
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index c323c7c..019f182 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -112,20 +112,20 @@ int DeskbotScript::proc36(int id) const {
 	return 0;
 }
 
-void DeskbotScript::proc38() {
-	warning("TODO");
+bool DeskbotScript::isDial0Medium() const {
+	return getDialRegion(0) == 1;
 }
 
-void DeskbotScript::proc39() {
-	warning("TODO");
+bool DeskbotScript::isDial0Low() const {
+	return getDialRegion(0) == 0;
 }
 
-void DeskbotScript::proc40() {
-	warning("TODO");
+bool DeskbotScript::isDial1Medium() const {
+	return getDialRegion(1) == 1;
 }
 
-void DeskbotScript::proc41() {
-	warning("TODO");
+bool DeskbotScript::isDial1Low() const {
+	return getDialRegion(1) == 0;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index b75abaa..5943848 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -54,10 +54,25 @@ public:
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
 
-	virtual void proc38();
-	virtual void proc39();
-	virtual void proc40();
-	virtual void proc41();
+	/**
+	 * Returns true if dial 1 is the medium (1) region
+	 */
+	virtual bool isDial0Medium() const;
+
+	/**
+	 * Returns true if dial 0 is the low end region
+	 */
+	virtual bool isDial0Low() const;
+
+	/**
+	 * Returns true if dial 1 is the medium (1) region
+	 */
+	bool isDial1Medium() const;
+
+	/**
+	 * Returns true if dial 1 is the low end region
+	 */
+	virtual bool isDial1Low() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 94401da..2bfef60 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -345,13 +345,14 @@ uint TTnpcScript::getRangeValue(uint id) {
 	}
 }
 
-void TTnpcScript::proc20(int v) {
-	warning("TODO");
+void TTnpcScript::resetRange(int id) {
+	TTscriptRange *range = findRange(id);
+	if (range && range->_mode != SF_RANDOM)
+		range->_priorIndex = 0;
 }
 
 int TTnpcScript::proc21(int v1, int v2, int v3) {
-	// TODO
-	return v1;
+	return v2;
 }
 
 int TTnpcScript::proc22(int id) const {
@@ -481,7 +482,7 @@ void TTnpcScript::setDial(int dialNum, int value) {
 	}
 }
 
-int TTnpcScript::getDialRegion(int dialNum) {
+int TTnpcScript::getDialRegion(int dialNum) const {
 	if (dialNum < DIALS_ARRAY_COUNT) {
 		int value = _dialValues[dialNum];
 		if (value < 50)
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 0e4359b..261bc57 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -302,7 +302,11 @@ public:
 	 */
 	virtual uint getRangeValue(uint id);
 	
-	virtual void proc20(int v);
+	/**
+	 * Resets the prior used index for the specified range
+	 */
+	virtual void resetRange(int id);
+
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
@@ -328,7 +332,7 @@ public:
 	/**
 	 * Returns a dial's region number
 	 */
-	virtual int getDialRegion(int dialNum);
+	virtual int getDialRegion(int dialNum) const;
 
 	/**
 	 * Gets the value for a dial


Commit: bf1657beb011749a17c531aec185b50ba6baf9fc
    https://github.com/scummvm/scummvm/commit/bf1657beb011749a17c531aec185b50ba6baf9fc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:19-04:00

Commit Message:
TITANIC: Changed NPC proc10 definitions to scriptChanged

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 7cc1e0a..c734711 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -198,9 +198,9 @@ int BarbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	return 2;
 }
 
-int BarbotScript::proc10() const {
+ScriptChangedResult BarbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
 	warning("TODO");
-	return 0;
+	return SCR_1;
 }
 
 int BarbotScript::proc15() const {
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 4232102..1456c8d 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -57,7 +57,11 @@ public:
 	 */
 	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
 
-	virtual int proc10() const;
+	/**
+	 * Called when the script/id changes
+	 */
+	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+
 	virtual int proc15() const;
 
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index fa00718..08bddcb 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -57,9 +57,9 @@ void BellbotScript::proc7(int v1, int v2) {
 	warning("TODO");
 }
 
-int BellbotScript::proc10() const {
+ScriptChangedResult BellbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
 	warning("TODO");
-	return 0;
+	return SCR_1;
 }
 
 int BellbotScript::proc15() const {
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index f13b1b2..141346f 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -44,7 +44,12 @@ public:
 		const char *charName, int v3, int val2);
 
 	virtual void proc7(int v1, int v2);
-	virtual int proc10() const;
+
+	/**
+	 * Called when the script/id changes
+	 */
+	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+
 	virtual int proc15() const;
 
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 019f182..91d90b7 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -58,9 +58,9 @@ void DeskbotScript::proc7(int v1, int v2) {
 	warning("TODO");
 }
 
-int DeskbotScript::proc10() const {
+ScriptChangedResult DeskbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
 	warning("TODO");
-	return 0;
+	return SCR_1;
 }
 
 int DeskbotScript::proc15() const {
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 5943848..a5b8798 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -39,7 +39,12 @@ public:
 		const char *charName, int v3, int val2);
 
 	virtual void proc7(int v1, int v2);
-	virtual int proc10() const;
+
+	/**
+	 * Called when the script/id changes
+	 */
+	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+
 	virtual int proc15() const;
 
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index bfa1ba9..427ed65 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -112,9 +112,9 @@ void DoorbotScript::proc7(int v1, int v2) {
 	warning("TODO");
 }
 
-int DoorbotScript::proc10() const {
+ScriptChangedResult DoorbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
 	warning("TODO");
-	return 0;
+	return SCR_1;
 }
 
 int DoorbotScript::proc15() const {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index ef14cf7..3bff98b 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -50,7 +50,12 @@ public:
 	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
 
 	virtual void proc7(int v1, int v2);
-	virtual int proc10() const;
+
+	/**
+	 * Called when the script/id changes
+	 */
+	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+
 	virtual int proc15() const;
 
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index cabfe41..4a8a860 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -89,9 +89,9 @@ int LiftbotScript::proc9() const {
 	return 0;
 }
 
-int LiftbotScript::proc10() const {
+ScriptChangedResult LiftbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
 	warning("TODO");
-	return 0;
+	return SCR_1;
 }
 
 int LiftbotScript::proc15() const {
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 39ff9bb..bbe2961 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -46,7 +46,12 @@ public:
 
 	virtual void proc7(int v1, int v2);
 	virtual int proc9() const;
-	virtual int proc10() const;
+
+	/**
+	 * Called when the script/id changes
+	 */
+	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+
 	virtual int proc15() const;
 
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index b5d5e3a..659d6ab 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -67,9 +67,9 @@ void MaitreDScript::proc7(int v1, int v2) {
 	warning("TODO");
 }
 
-int MaitreDScript::proc10() const {
+ScriptChangedResult MaitreDScript::scriptChanged(TTscriptBase *roomScript, uint id) {
 	warning("TODO");
-	return 0;
+	return SCR_1;
 }
 
 bool MaitreDScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 0c96434..da73e0e 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -43,7 +43,11 @@ public:
 	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
 
 	virtual void proc7(int v1, int v2);
-	virtual int proc10() const;
+
+	/**
+	 * Called when the script/id changes
+	 */
+	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index eb08d7c..abb29d0 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -54,9 +54,9 @@ void ParrotScript::proc7(int v1, int v2) {
 	warning("TODO");
 }
 
-int ParrotScript::proc10() const {
+ScriptChangedResult ParrotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
 	warning("TODO");
-	return 0;
+	return SCR_1;
 }
 
 bool ParrotScript::proc18() const {
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index f5d9cb2..4d4e07d 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -43,7 +43,11 @@ public:
 	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
 
 	virtual void proc7(int v1, int v2);
-	virtual int proc10() const;
+
+	/**
+	 * Called when the script/id changes
+	 */
+	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
 	virtual bool proc18() const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 1a23484..9768703 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -78,9 +78,9 @@ void SuccUBusScript::proc7(int v1, int v2) {
 	warning("TODO");
 }
 
-int SuccUBusScript::proc10() const {
+ScriptChangedResult SuccUBusScript::scriptChanged(TTscriptBase *roomScript, uint id) {
 	warning("TODO");
-	return 0;
+	return SCR_1;
 }
 
 bool SuccUBusScript::proc18() const {
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index fffdd80..482723c 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -45,7 +45,12 @@ public:
 	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
 
 	virtual void proc7(int v1, int v2);
-	virtual int proc10() const;
+
+	/**
+	 * Called when the script/id changes
+	 */
+	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+
 
 	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);


Commit: 52f6394ae5e0ef37213f12dd430ac0e580ccd463
    https://github.com/scummvm/scummvm/commit/52f6394ae5e0ef37213f12dd430ac0e580ccd463
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:22-04:00

Commit Message:
TITANIC: Changed NPC proc7 definitions to process

Changed paths:
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h



diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 08bddcb..623fe07 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -53,8 +53,9 @@ void BellbotScript::setupSentences() {
 	_entryCount = 0;
 }
 
-void BellbotScript::proc7(int v1, int v2) {
-	warning("TODO");
+int BellbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+	// TODO
+	return 0;
 }
 
 ScriptChangedResult BellbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 141346f..b6aa92e 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -43,7 +43,10 @@ public:
 	BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
 
-	virtual void proc7(int v1, int v2);
+	/**
+	 * Does NPC specific processing of the parsed sentence
+	 */
+	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
 	 * Called when the script/id changes
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 91d90b7..999dd65 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -54,8 +54,9 @@ void DeskbotScript::setupSentences() {
 	_entryCount = 0;
 }
 
-void DeskbotScript::proc7(int v1, int v2) {
-	warning("TODO");
+int DeskbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+	// TODO
+	return 0;
 }
 
 ScriptChangedResult DeskbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index a5b8798..973641b 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -38,7 +38,10 @@ public:
 	DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
 
-	virtual void proc7(int v1, int v2);
+	/**
+	 * Does NPC specific processing of the parsed sentence
+	 */
+	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
 	 * Called when the script/id changes
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 427ed65..65bf88c 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -108,8 +108,9 @@ int DoorbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence
 	return TTnpcScript::chooseResponse(roomScript, sentence, tag);
 }
 
-void DoorbotScript::proc7(int v1, int v2) {
-	warning("TODO");
+int DoorbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+	// TODO
+	return 0;
 }
 
 ScriptChangedResult DoorbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 3bff98b..fee2373 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -49,7 +49,10 @@ public:
 	 */
 	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
 
-	virtual void proc7(int v1, int v2);
+	/**
+	 * Does NPC specific processing of the parsed sentence
+	 */
+	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
 	 * Called when the script/id changes
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 4a8a860..36aea54 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -80,8 +80,9 @@ int LiftbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence
 	}
 }
 
-void LiftbotScript::proc7(int v1, int v2) {
-	warning("TODO");
+int LiftbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+	// TODO
+	return 0;
 }
 
 int LiftbotScript::proc9() const {
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index bbe2961..d800eed 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -44,7 +44,11 @@ public:
 	 */
 	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
 
-	virtual void proc7(int v1, int v2);
+	/**
+	 * Does NPC specific processing of the parsed sentence
+	 */
+	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
+
 	virtual int proc9() const;
 
 	/**
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 659d6ab..987a7ff 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -63,8 +63,9 @@ int MaitreDScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence
 	return TTnpcScript::chooseResponse(roomScript, sentence, tag);
 }
 
-void MaitreDScript::proc7(int v1, int v2) {
-	warning("TODO");
+int MaitreDScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+	// TODO
+	return 0;
 }
 
 ScriptChangedResult MaitreDScript::scriptChanged(TTscriptBase *roomScript, uint id) {
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index da73e0e..87a1fdb 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -42,7 +42,10 @@ public:
 	 */
 	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
 
-	virtual void proc7(int v1, int v2);
+	/**
+	 * Does NPC specific processing of the parsed sentence
+	 */
+	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
 	 * Called when the script/id changes
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index abb29d0..cafb220 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -50,8 +50,9 @@ int ParrotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 	}
 }
 
-void ParrotScript::proc7(int v1, int v2) {
-	warning("TODO");
+int ParrotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+	// TODO
+	return 0;
 }
 
 ScriptChangedResult ParrotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index 4d4e07d..504f311 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -42,7 +42,10 @@ public:
 	 */
 	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
 
-	virtual void proc7(int v1, int v2);
+	/**
+	 * Does NPC specific processing of the parsed sentence
+	 */
+	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
 	 * Called when the script/id changes
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 9768703..5373f3f 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -74,8 +74,9 @@ int SuccUBusScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentenc
 	}
 }
 
-void SuccUBusScript::proc7(int v1, int v2) {
-	warning("TODO");
+int SuccUBusScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+	// TODO
+	return 0;
 }
 
 ScriptChangedResult SuccUBusScript::scriptChanged(TTscriptBase *roomScript, uint id) {
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 482723c..e83475b 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -44,7 +44,10 @@ public:
 	 */
 	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
 
-	virtual void proc7(int v1, int v2);
+	/**
+	 * Does NPC specific processing of the parsed sentence
+	 */
+	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
 	 * Called when the script/id changes


Commit: 314a8f25ab8ea8600962af8c82356a728ff3b977
    https://github.com/scummvm/scummvm/commit/314a8f25ab8ea8600962af8c82356a728ff3b977
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:25-04:00

Commit Message:
TITANIC: Added ParrotScript scriptChanged

Changed paths:
    engines/titanic/core/game_object.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 22c62a8..24a8ac2 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -229,11 +229,6 @@ protected:
 	CGameObject *findRoomObject(const CString &name) const;
 
 	/**
-	 * Finds an item in various system areas
-	 */
-	Found find(const CString &name, CGameObject **item, int findAreas);
-
-	/**
 	 * Scan the specified room for an item by name
 	 */
 	static CGameObject *findUnder(CTreeItem *parent, const CString &name);
@@ -461,6 +456,11 @@ public:
 	int getPriorClass() const;
 
 	int getSurface45() const;
+
+	/**
+	 * Finds an item in various system areas
+	 */
+	Found find(const CString &name, CGameObject **item, int findAreas);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index cafb220..e0c7a9b 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -22,6 +22,7 @@
 
 #include "common/textconsole.h"
 #include "titanic/true_talk/parrot_script.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -51,13 +52,55 @@ int ParrotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 }
 
 int ParrotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
-	// TODO
-	return 0;
+	if (processEntries(roomScript, sentence) == 2) {
+		int tagId = g_vm->_trueTalkManager->_quotes.find(sentence->_normalizedLine);
+		if (!tagId || chooseResponse(roomScript, sentence, tagId) != 2) {
+			addResponse(getDialogueId(sentence->check2C() ? 280248 : 280235));
+			applyResponse();
+		}
+	}
+
+	return 2;
 }
 
 ScriptChangedResult ParrotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
-	warning("TODO");
-	return SCR_1;
+	if (id >= 280000 && id <= 280276) {
+		if (id == 280258) {
+			if (CTrueTalkManager::_currentNPC) {
+				CGameObject *chicken;
+				if (CTrueTalkManager::_currentNPC->find("Chicken", &chicken, FIND_PET))
+					id = 280147 - getRandomBit();
+			}
+
+			id = getDialogueId(id);
+		} else {
+			if ((id == 280146 || id == 280147) && CTrueTalkManager::_currentNPC) {
+				CGameObject *chicken;
+				if (CTrueTalkManager::_currentNPC->find("Chicken", &chicken, FIND_PET))
+					id = 280142;
+			}
+
+			addResponse(getDialogueId(id));
+			if (id == 280192)
+				addResponse(getDialogueId(280222));
+			applyResponse();
+		}
+	}
+
+	if (id >= 80000 && id <= 80244) {
+		if ((id == 80155 || id == 80156) && CTrueTalkManager::_currentNPC) {
+			CGameObject *chicken;
+			if (CTrueTalkManager::_currentNPC->find("Chicken", &chicken, FIND_PET))
+				id = 80151;
+		}
+
+		addResponse(id);
+		if (id == 80201)
+			addResponse(getDialogueId(280222));
+		applyResponse();
+	}
+
+	return (id == 3) ? SCR_2 : SCR_1;
 }
 
 bool ParrotScript::proc18() const {
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 261bc57..b12c35d 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -241,6 +241,13 @@ protected:
 	 */
 	int processEntries(const TTsentenceEntries *entries, uint entryCount, TTroomScript *roomScript, TTsentence *sentence);
 
+	/**
+	 * Scans through a list of sentence entries for a matching standardized response
+	 */
+	int processEntries(TTroomScript *roomScript, TTsentence *sentence) {
+		return processEntries(&_entries, _entryCount, roomScript, sentence);
+	}
+
 	bool defaultProcess(TTroomScript *roomScript, TTsentence *sentence);
 
 	void checkItems(TTroomScript *roomScript, TTsentence *sentence);


Commit: a5e6d1e345872cfec5101912db50514b74cf4e38
    https://github.com/scummvm/scummvm/commit/a5e6d1e345872cfec5101912db50514b74cf4e38
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:28-04:00

Commit Message:
TITANIC: Remove deprecated NPC methods for data now loaded from DAT file

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_scripts.cpp



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index c734711..e66c17b 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -214,11 +214,6 @@ bool BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return false;
 }
 
-bool BarbotScript::proc18() const {
-	warning("TODO");
-	return false;
-}
-
 int BarbotScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 1456c8d..526cf71 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -67,7 +67,6 @@ public:
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 	
-	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 623fe07..3e75fce 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -74,11 +74,6 @@ bool BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return false;
 }
 
-bool BellbotScript::proc18() const {
-	warning("TODO");
-	return 0;
-}
-
 int BellbotScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index b6aa92e..0dcdbfe 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -58,7 +58,6 @@ public:
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
-	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 999dd65..54e22a9 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -75,11 +75,6 @@ bool DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return 0;
 }
 
-bool DeskbotScript::proc18() const {
-	warning("TODO");
-	return 0;
-}
-
 int DeskbotScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 973641b..d0d1f8a 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -53,7 +53,6 @@ public:
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
-	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 65bf88c..7689fc2 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -129,11 +129,6 @@ bool DoorbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return 0;
 }
 
-bool DoorbotScript::proc18() const {
-	warning("TODO");
-	return 0;
-}
-
 int DoorbotScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index fee2373..97d42e3 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -64,7 +64,6 @@ public:
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
-	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 36aea54..21bdbdd 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -106,11 +106,6 @@ bool LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return 0;
 }
 
-bool LiftbotScript::proc18() const {
-	warning("TODO");
-	return 0;
-}
-
 int LiftbotScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index d800eed..67565f4 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -61,7 +61,6 @@ public:
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
-	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 987a7ff..92966ad 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -79,11 +79,6 @@ bool MaitreDScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return 0;
 }
 
-bool MaitreDScript::proc18() const {
-	warning("TODO");
-	return 0;
-}
-
 int MaitreDScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 87a1fdb..27c72f15 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -55,7 +55,6 @@ public:
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
-	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index e0c7a9b..8e88e58 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -103,11 +103,6 @@ ScriptChangedResult ParrotScript::scriptChanged(TTscriptBase *roomScript, uint i
 	return (id == 3) ? SCR_2 : SCR_1;
 }
 
-bool ParrotScript::proc18() const {
-	warning("TODO");
-	return 0;
-}
-
 int ParrotScript::proc23() const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index 504f311..02ec4e9 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -52,7 +52,6 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-	virtual bool proc18() const;
 	virtual int proc23() const;
 	virtual const int *getTablePtr(int id);
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 5373f3f..cb1b035 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -84,11 +84,6 @@ ScriptChangedResult SuccUBusScript::scriptChanged(TTscriptBase *roomScript, uint
 	return SCR_1;
 }
 
-bool SuccUBusScript::proc18() const {
-	warning("TODO");
-	return 0;
-}
-
 int SuccUBusScript::proc21(int v1, int v2, int v3) {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index e83475b..9787b2c 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -54,8 +54,6 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-
-	virtual bool proc18() const;
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc23() const;
 	virtual const int *getTablePtr(int id);
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 2bfef60..0de460c 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -267,18 +267,6 @@ int TTnpcScript::proc12() const {
 	return 1;
 }
 
-bool TTnpcScript::loadQuotes() {
-	// Original did a load of a global quotes here the first time
-	// this method is called. ScummVM implementation has refactored
-	// the loading to the CTrueTalkManager constructor
-
-	if (!proc18()) {
-		return false;
-	} else {
-		return proc17();
-	}
-}
-
 void TTnpcScript::selectResponse(int id) {
 	if (id >= 200000 && id <= 290264)
 		id = getDialogueId(id);
@@ -295,14 +283,6 @@ bool TTnpcScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return true;
 }
 
-bool TTnpcScript::proc17() const {
-	return true;
-}
-
-bool TTnpcScript::proc18() const {
-	return true;
-}
-
 uint TTnpcScript::getRangeValue(uint id) {
 	TTscriptRange *range = findRange(id);
 	if (!range)
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index b12c35d..b143af6 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -284,11 +284,6 @@ public:
 	virtual int proc12() const;
 
 	/**
-	 * Handles loading quotes used by the scripts
-	 */
-	virtual bool loadQuotes();
-
-	/**
 	 * Translate a passed Id to a dialogue Id if necessary,
 	 * and adds it to the response
 	 */
@@ -299,9 +294,6 @@ public:
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
-	virtual bool proc17() const;
-	virtual bool proc18() const;
-
 	/**
 	 * Given an Id for a previously registered set of random number values,
 	 * picks one of the array values and returns it.. depending on flags,
diff --git a/engines/titanic/true_talk/tt_scripts.cpp b/engines/titanic/true_talk/tt_scripts.cpp
index 94420a4..5783866 100644
--- a/engines/titanic/true_talk/tt_scripts.cpp
+++ b/engines/titanic/true_talk/tt_scripts.cpp
@@ -75,8 +75,6 @@ TTscripts::TTscripts(CTitleEngine *titleEngine) :
 }
 
 void TTscripts::addScript(TTnpcScript *script, int scriptId) {
-	script->loadQuotes();
-	
 	// Find the room script this is associated with
 	TTroomScript *roomScript = getRoomScript(scriptId);
 	assert(roomScript);


Commit: 441d168d3782683acd4ec05535d2b73afb1c86f5
    https://github.com/scummvm/scummvm/commit/441d168d3782683acd4ec05535d2b73afb1c86f5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:31-04:00

Commit Message:
TITANIC: Replace NPC proc23 methods with a single getMapping

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index e66c17b..cfde44d 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -229,11 +229,6 @@ int BarbotScript::proc23() const {
 	return 0;
 }
 
-const int *BarbotScript::getTablePtr(int id) {
-	warning("TODO");
-	return nullptr;
-}
-
 int BarbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 526cf71..1d73094 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -70,7 +70,6 @@ public:
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
-	virtual const int *getTablePtr(int id);
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc32();
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 3e75fce..a13f9d6 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -89,11 +89,6 @@ int BellbotScript::proc23() const {
 	return 0;
 }
 
-const int *BellbotScript::getTablePtr(int id) {
-	warning("TODO");
-	return nullptr;
-}
-
 int BellbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 0dcdbfe..b21d689 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -61,7 +61,6 @@ public:
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
-	virtual const int *getTablePtr(int id);
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 54e22a9..ca000a4 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -90,11 +90,6 @@ int DeskbotScript::proc23() const {
 	return 0;
 }
 
-const int *DeskbotScript::getTablePtr(int id) {
-	warning("TODO");
-	return nullptr;
-}
-
 int DeskbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index d0d1f8a..f685b7a 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -56,7 +56,6 @@ public:
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
-	virtual const int *getTablePtr(int id);
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 7689fc2..0db7547 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -144,11 +144,6 @@ int DoorbotScript::proc23() const {
 	return 0;
 }
 
-const int *DoorbotScript::getTablePtr(int id) {
-	warning("TODO");
-	return nullptr;
-}
-
 int DoorbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 97d42e3..f50fa28 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -67,7 +67,6 @@ public:
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
-	virtual const int *getTablePtr(int id);
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc32();
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 21bdbdd..e911fe1 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -121,11 +121,6 @@ int LiftbotScript::proc23() const {
 	return 0;
 }
 
-const int *LiftbotScript::getTablePtr(int id) {
-	warning("TODO");
-	return nullptr;
-}
-
 int LiftbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 67565f4..b2662b1 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -64,7 +64,6 @@ public:
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
-	virtual const int *getTablePtr(int id);
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc32();
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 92966ad..998048f 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -94,11 +94,6 @@ int MaitreDScript::proc23() const {
 	return 0;
 }
 
-const int *MaitreDScript::getTablePtr(int id) {
-	warning("TODO");
-	return nullptr;
-}
-
 int MaitreDScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 27c72f15..c210f71 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -58,7 +58,6 @@ public:
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
-	virtual const int *getTablePtr(int id);
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index 8e88e58..358c943 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -104,17 +104,10 @@ ScriptChangedResult ParrotScript::scriptChanged(TTscriptBase *roomScript, uint i
 }
 
 int ParrotScript::proc23() const {
-	warning("TODO");
 	return 0;
 }
 
-const int *ParrotScript::getTablePtr(int id) {
-	warning("TODO");
-	return nullptr;
-}
-
 int ParrotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
-	warning("TODO");
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index 02ec4e9..921dc22 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -53,7 +53,6 @@ public:
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
 	virtual int proc23() const;
-	virtual const int *getTablePtr(int id);
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index cb1b035..cb1c12f 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -94,11 +94,6 @@ int SuccUBusScript::proc23() const {
 	return 0;
 }
 
-const int *SuccUBusScript::getTablePtr(int id) {
-	warning("TODO");
-	return nullptr;
-}
-
 int SuccUBusScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 9787b2c..c5ba51e 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -56,7 +56,6 @@ public:
 
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc23() const;
-	virtual const int *getTablePtr(int id);
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 0de460c..1ee5785 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -343,6 +343,12 @@ int TTnpcScript::proc23() const {
 	return 0;
 }
 
+const TTscriptMapping *TTnpcScript::getMapping(int index) {
+	if (index >= 0 && index < (int)_mappings.size())
+		return &_mappings[index];
+	return nullptr;
+}
+
 int TTnpcScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	return 0;
 }
@@ -594,21 +600,21 @@ uint TTnpcScript::getDialogueId(uint tagId) {
 		tagId = getRangeValue(tagId);
 
 	oldTagId = proc23();
-	int v21 = proc21(origId, tagId, oldTagId);
-	if (!v21)
+	uint newId = proc21(origId, tagId, oldTagId);
+	if (!newId)
 		return 0;
 
 	int idx = 0;
-	const int *tableP;
+	const TTscriptMapping *tableP;
 	for (;;) {
-		tableP = getTablePtr(idx++);
+		tableP = getMapping(idx++);
 		if (!tableP)
 			return 0;
 
-		if (*tableP == v21)
+		if (tableP->_id == newId)
 			break;
 	}
-	uint newVal = tableP[oldTagId + 1];
+	uint newVal = tableP->_values[oldTagId];
 
 	idx = 0;
 	int *arrP = &_array[26];
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index b143af6..d7cec8d 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -309,7 +309,7 @@ public:
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
-	virtual const int *getTablePtr(int id) = 0;
+	virtual const TTscriptMapping *getMapping(int index);
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void save(SimpleFile *file);


Commit: 758fb87f0ead14545ea7bbea85ae5355230ff113
    https://github.com/scummvm/scummvm/commit/758fb87f0ead14545ea7bbea85ae5355230ff113
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-07-15T19:23:35-04:00

Commit Message:
TITANIC: Improve configure.engine

Changed paths:
    engines/titanic/configure.engine



diff --git a/engines/titanic/configure.engine b/engines/titanic/configure.engine
index 781b783..c73bb19 100644
--- a/engines/titanic/configure.engine
+++ b/engines/titanic/configure.engine
@@ -1,3 +1,3 @@
 # This file is included from the main "configure" script
 # add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine titanic "Starship Titanic" no
+add_engine titanic "Starship Titanic" no "" "" "jpeg highres"


Commit: 68f13646e185416bb74812ea489764b9b28b8e22
    https://github.com/scummvm/scummvm/commit/68f13646e185416bb74812ea489764b9b28b8e22
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:38-04:00

Commit Message:
TITANIC: Implementing more CGameObject/OSScreenManager draw methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/support/screen_manager.cpp
    engines/titanic/support/screen_manager.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 624a4b0..5f68037 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -161,6 +161,47 @@ bool CGameObject::checkPoint(const Point &pt, bool ignore40, bool visibleOnly) {
 	return pixel != transColor;
 }
 
+bool CGameObject::clipRect(const Rect &rect1, Rect &rect2) const {
+	if (!rect2.intersects(rect1))
+		return false;
+
+	rect2.clip(rect1);
+	return true;
+}
+
+void CGameObject::draw(CScreenManager *screenManager, const Rect &destRect, const Rect &srcRect) {
+	Rect tempRect = destRect;
+	if (clipRect(srcRect, tempRect)) {
+		if (!_surface && !_resource.empty()) {
+			loadResource(_resource);
+			_resource.clear();
+		}
+
+		if (_surface)
+			screenManager->blitFrom(SURFACE_PRIMARY, &tempRect, _surface);
+	}
+}
+
+void CGameObject::draw(CScreenManager *screenManager, const Point &destPos) {
+	if (!_surface && !_resource.empty()) {
+		loadResource(_resource);
+		_resource.clear();
+	}
+
+	if (_surface) {
+		int xSize = _surface->getWidth();
+		int ySize = _surface->getHeight();
+
+		if (xSize > 0 && ySize > 0) {
+			screenManager->blitFrom(SURFACE_BACKBUFFER, _surface, &destPos);
+		}
+	}
+}
+
+void CGameObject::draw(CScreenManager *screenManager, const Point &destPos, const Rect &srcRect) {
+	draw(screenManager, Rect(destPos.x, destPos.y, destPos.x + 52, destPos.y + 52), srcRect);
+}
+
 void CGameObject::draw(CScreenManager *screenManager) {
 	if (!_visible)
 		return;
@@ -209,22 +250,6 @@ void CGameObject::draw(CScreenManager *screenManager) {
 	}
 }
 
-void CGameObject::draw(CScreenManager *screenManager, const Common::Point &destPos) {
-	if (!_surface && !_resource.empty()) {
-		loadResource(_resource);
-		_resource.clear();
-	}
-
-	if (_surface) {
-		int xSize = _surface->getWidth();
-		int ySize = _surface->getHeight();
-
-		if (xSize > 0 && ySize > 0) {
-			screenManager->blitFrom(SURFACE_BACKBUFFER, _surface, &destPos);
-		}
-	}
-}
-
 bool CGameObject::isPet() const {
 	return isInstanceOf(CPetControl::_type);
 }
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 24a8ac2..a30c348 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -66,6 +66,12 @@ private:
 	void loadImage(const CString &name, bool pendingFlag = true);
 
 	void processClipList2();
+
+	/**
+	 * Merges one rect into another, and returns true if there was
+	 * a common intersection
+	 */
+	bool clipRect(const Rect &rect1, Rect &rect2) const;
 protected:
 	Rect _bounds;
 	double _field34;
@@ -367,12 +373,22 @@ public:
 	/**
 	 * Allows the item to draw itself
 	 */
-	virtual void draw(CScreenManager *screenManager);
+	void draw(CScreenManager *screenManager, const Rect &destRect, const Rect &srcRect);
 
 	/**
 	 * Allows the item to draw itself
 	 */
-	virtual void draw(CScreenManager *screenManager, const Common::Point &destPos);
+	void draw(CScreenManager *screenManager, const Point &destPos);
+
+	/**
+	 * Allows the item to draw itself
+	 */
+	void draw(CScreenManager *screenManager, const Point &destPos, const Rect &srcRect);
+
+	/**
+	 * Allows the item to draw itself
+	 */
+	virtual void draw(CScreenManager *screenManager);
 
 	/**
 	 * Returns true if the item is the PET control
diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp
index b0e249d..27c0d98 100644
--- a/engines/titanic/support/screen_manager.cpp
+++ b/engines/titanic/support/screen_manager.cpp
@@ -163,7 +163,7 @@ void OSScreenManager::fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g
 }
 
 void OSScreenManager::blitFrom(SurfaceNum surfaceNum, CVideoSurface *src,
-	const Point *destPos, const Rect *srcRect) {
+		const Point *destPos, const Rect *srcRect) {
 	// Get the dest surface
 	CVideoSurface *destSurface = _frontRenderSurface;
 	if (surfaceNum < -1)
@@ -200,7 +200,19 @@ void OSScreenManager::blitFrom(SurfaceNum surfaceNum, CVideoSurface *src,
 		destSurface->blitFrom(destPoint, src, bounds);
 }
 
-void OSScreenManager::proc12() {}
+void OSScreenManager::blitFrom(SurfaceNum surfaceNum, const Rect *rect, CVideoSurface *src, int v) {
+	// Get the dest surface
+	CVideoSurface *destSurface = _frontRenderSurface;
+	if (surfaceNum < -1)
+		return;
+	if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
+		destSurface = _backSurfaces[surfaceNum]._surface;
+	if (!destSurface->hasSurface())
+		return;
+
+	if (!rect->isEmpty())
+		destSurface->blitFrom(Point(rect->left, rect->top), src, rect);
+}
 
 int OSScreenManager::writeString(int surfaceNum, const Rect &destRect, 
 		int yOffset, const CString &str, CTextCursor *textCursor) {
diff --git a/engines/titanic/support/screen_manager.h b/engines/titanic/support/screen_manager.h
index 2e80869..21b40ca 100644
--- a/engines/titanic/support/screen_manager.h
+++ b/engines/titanic/support/screen_manager.h
@@ -41,8 +41,8 @@ namespace Titanic {
  * remapped to the primary surface
  */
 enum SurfaceNum {
-	SURFACE_PRIMARY = -1,
-	SURFACE_BACKBUFFER = -1
+	SURFACE_PRIMARY = -1,		// Surface 0
+	SURFACE_BACKBUFFER = -1		// Surface -1
 };
 
 class TitanicEngine;
@@ -109,8 +109,11 @@ public:
 	virtual void blitFrom(SurfaceNum surfaceNum, CVideoSurface *src, const Point *destPos = nullptr,
 		const Rect *srcRect = nullptr) = 0;
 
-	virtual void proc12() = 0;
-	
+	/**
+	 * Blits a surface onto one of the screen surfaces
+	 */
+	virtual void blitFrom(SurfaceNum surfaceNum, const Rect *rect, CVideoSurface *src, int v = 0) = 0;
+
 	/**
 	 * Write a string
 	 * @param surfaceNum	Destination surface
@@ -248,7 +251,10 @@ public:
 	virtual void blitFrom(SurfaceNum surfaceNum, CVideoSurface *src, const Point *destPos,
 		const Rect *srcRect = nullptr);
 
-	virtual void proc12();
+	/**
+	 * Blits a surface onto one of the screen surfaces
+	 */
+	virtual void blitFrom(SurfaceNum surfaceNum, const Rect *rect, CVideoSurface *src, int v = 0);
 
 	/**
 	 * Write a string


Commit: 2267c5eb4c5addecbf0012495f84ece6d6df835d
    https://github.com/scummvm/scummvm/commit/2267c5eb4c5addecbf0012495f84ece6d6df835d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:41-04:00

Commit Message:
TITANIC: Beginnings of CCreditText class

Changed paths:
  A engines/titanic/support/credit_text.cpp
  A engines/titanic/support/credit_text.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/module.mk
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 5f68037..2da7d79 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -38,7 +38,19 @@ namespace Titanic {
 BEGIN_MESSAGE_MAP(CGameObject, CNamedItem)
 END_MESSAGE_MAP()
 
-void *CGameObject::_v1 = nullptr;
+CCreditText *CGameObject::_credits;
+
+void CGameObject::init() {
+	_credits = nullptr;
+}
+
+void CGameObject::deinit() {
+	if (_credits) {
+		_credits->clear();
+		delete _credits;
+		_credits = nullptr;
+	}
+}
 
 CGameObject::CGameObject(): CNamedItem() {
 	_bounds = Rect(0, 0, 15, 15);
@@ -205,7 +217,7 @@ void CGameObject::draw(CScreenManager *screenManager, const Point &destPos, cons
 void CGameObject::draw(CScreenManager *screenManager) {
 	if (!_visible)
 		return;
-	if (_v1) {
+	if (_credits) {
 		error("TODO: Block in CGameObject::draw");
 	}
 
@@ -927,4 +939,11 @@ void CGameObject::setPassengerClass(int newClass) {
 	}
 }
 
+void CGameObject::createCredits() {
+	_credits = new CCreditText();
+	CScreenManager *screenManager = getGameManager()->setScreenManager();
+	_credits->load(this, screenManager, _bounds);
+	
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index a30c348..44e1231 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -24,6 +24,7 @@
 #define TITANIC_GAME_OBJECT_H
 
 #include "titanic/support/mouse_cursor.h"
+#include "titanic/support/credit_text.h"
 #include "titanic/support/proximity.h"
 #include "titanic/support/rect.h"
 #include "titanic/core/movie_clip.h"
@@ -47,8 +48,8 @@ class OSMovie;
 class CGameObject : public CNamedItem {
 	friend class OSMovie;
 	DECLARE_MESSAGE_MAP
-public:
-	static void *_v1;
+private:
+	static CCreditText *_credits;
 private:
 	/**
 	 * Load a visual resource for the object
@@ -357,6 +358,16 @@ public:
 	CursorId _cursorId;
 	bool _visible;
 public:
+	/**
+	 * Initializes statics
+	 */
+	static void init();
+
+	/**
+	 * Deinitializes statics
+	 */
+	static void deinit();
+public:
 	CLASSDEF
 	CGameObject();
 
@@ -477,6 +488,11 @@ public:
 	 * Finds an item in various system areas
 	 */
 	Found find(const CString &name, CGameObject **item, int findAreas);
+
+	/**
+	 * Sets up credits text
+	 */
+	void createCredits();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 2879713..dac6287 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -440,6 +440,7 @@ MODULE_OBJS := \
 	support/movie.o \
 	support/movie_event.o \
 	support/movie_range_info.o \
+	support/credit_text.o \
 	support/proximity.o \
 	support/rect.o \
 	support/screen_manager.o \
diff --git a/engines/titanic/support/credit_text.cpp b/engines/titanic/support/credit_text.cpp
new file mode 100644
index 0000000..e70d1dc
--- /dev/null
+++ b/engines/titanic/support/credit_text.cpp
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/credit_text.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+CCreditText::CCreditText() : _screenManagerP(nullptr), _field14(0),
+	_ticks(0), _fontHeight(1), _objectP(nullptr), _field34(0), _field38(0),
+	_field3C(0), _field40(0), _field44(0), _field48(0), _field4C(0),
+	_field50(0), _field54(0), _field58(0), _field5C(0) {
+}
+
+void CCreditText::clear() {
+	_list.destroyContents();
+	_objectP = nullptr;
+}
+
+void CCreditText::load(CGameObject *obj, CScreenManager *screenManager,
+		const Rect &rect, int v) {
+	_objectP = obj;
+	_screenManagerP = screenManager;
+	_field14 = v;
+	_ticks = g_vm->_events->getTicksCount();
+	_field40 = 0;
+	_field44 = 0xFF;
+	_field48 = 0xFF;
+	_field4C = 0xFF;
+	_field50 = 0;
+	_field54 = 0;
+	_field58 = 0;
+	_field5C = 0;
+}
+
+void CCreditText::setup() {
+	// TODO
+}
+
+bool CCreditText::draw() {
+	return false;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/credit_text.h b/engines/titanic/support/credit_text.h
new file mode 100644
index 0000000..82da833
--- /dev/null
+++ b/engines/titanic/support/credit_text.h
@@ -0,0 +1,90 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CREDIT_TEXT_H
+#define TITANIC_CREDIT_TEXT_H
+
+#include "titanic/core/list.h"
+
+namespace Titanic {
+
+class CGameObject;
+class CScreenManager;
+
+class COverrideSubItem : public ListItem {
+
+};
+typedef List<COverrideSubItem> CCreditTextSubList;
+
+class CCreditTextItem : public ListItem {
+
+};
+typedef List<CCreditTextItem> CCreditTextList;
+
+class CCreditText {
+private:
+	/**
+	 * Sets up needed data
+	 */
+	void setup();
+public:
+	CScreenManager *_screenManagerP;
+	Rect _rect;
+	int _field14;
+	CCreditTextList _list;
+	uint _ticks;
+	uint _fontHeight;
+	CGameObject *_objectP;
+	int _field34;
+	int _field38;
+	int _field3C;
+	int _field40;
+	int _field44;
+	int _field48;
+	int _field4C;
+	int _field50;
+	int _field54;
+	int _field58;
+	int _field5C;
+public:
+	CCreditText();
+
+	/**
+	 * Clears the object
+	 */
+	void clear();
+
+	/**
+	 * Sets the game object this override is associated with
+	 */
+	void load(CGameObject *obj, CScreenManager *screenManager,
+		const Rect &rect, int v = 0);
+
+	/**
+	 * Draw the item
+	 */
+	bool draw();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CREDIT_TEXT_H */
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index da9be20..9d44cd6 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -84,6 +84,7 @@ void TitanicEngine::initialize() {
 
 	CSaveableObject::initClassList();
 	CEnterExitFirstClassState::init();
+	CGameObject::init();
 	CGetLiftEye2::init();
 	CHose::init();
 	CParrotLobbyObject::init();
@@ -115,6 +116,7 @@ void TitanicEngine::deinitialize() {
 	CSGTStateRoom::deinit();
 	CExitPellerator::deinit();
 	CEnterExitSecClassMiniLift::deinit();
+	CGameObject::deinit();
 	CTelevision::deinit();
 }
 


Commit: f0889c17a46019b8b294a74d054d0c60e445190b
    https://github.com/scummvm/scummvm/commit/f0889c17a46019b8b294a74d054d0c60e445190b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:44-04:00

Commit Message:
TITANIC: Implementing lots of cGameObject methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/mail_man.cpp
    engines/titanic/core/mail_man.h
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 2da7d79..4a5dd9b 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -343,7 +343,10 @@ void CGameObject::loadFrame(int frameNumber) {
 }
 
 void CGameObject::processClipList2() {
-	warning("CGameObject::processClipList2");
+	for (CMovieClipList::iterator i = _clipList2.begin(); i != _clipList2.end(); ++i)
+		(*i)->process(this);
+
+	_clipList2.destroyContents();
 }
 
 void CGameObject::makeDirty(const Rect &r) {
@@ -429,6 +432,17 @@ void CGameObject::playClip(uint startFrame, uint endFrame) {
 	gameManager->playClip(clip, room, room);
 }
 
+void CGameObject::playRandomClip(const char **names, uint flags) {
+	// Count size of array
+	int count = 0;
+	for (const char **p = names; *p; ++p)
+		++count;
+
+	// Play clip
+	const char *name = names[g_vm->getRandomNumber(count - 1)];
+	playClip(name, flags);
+}
+
 void CGameObject::playMovie(uint flags) {
 	_frameNumber = -1;
 	if (!_surface && !_resource.empty()) {
@@ -844,6 +858,11 @@ void CGameObject::dragMove(const Point &pt) {
 	setPosition(Point(pt.x - _bounds.width() / 2, pt.y - _bounds.height() / 2));
 }
 
+Point CGameObject::getControid() const {
+	return Point(_bounds.left + _bounds.width() / 2,
+		_bounds.top + _bounds.height() / 2);
+}
+
 bool CGameObject::clipExistsByStart(const CString &name, int startFrame) const {
 	return _clipList1.existsByStart(name, startFrame);
 }
@@ -943,7 +962,75 @@ void CGameObject::createCredits() {
 	_credits = new CCreditText();
 	CScreenManager *screenManager = getGameManager()->setScreenManager();
 	_credits->load(this, screenManager, _bounds);
-	
+}
+
+void CGameObject::fn10(int v1, int v2, int v3) {
+	makeDirty();
+	_field44 = v1;
+	_field48 = v2;
+	_field4C = v3;
+}
+
+void CGameObject::setMovie14(int v) {
+	if (!_surface && !_resource.empty()) {
+		loadResource(_resource);
+		_resource.clear();
+	}
+
+	if (_surface && _surface->_movie)
+		_surface->_movie->_field14 = v;
+}
+
+void CGameObject::movie38(int v1, int v2) {
+	if (_surface)
+		_surface->proc38(v1, v2);
+}
+
+void CGameObject::movie38(int v1) {
+	if (_surface)
+		_surface->proc38(-1, v1);
+}
+
+int CGameObject::getClipDuration(const CString &name, int frameRate) const {
+	CMovieClip *clip = _clipList1.findByName(name);
+	return clip ? (clip->_endFrame - clip->_startFrame) * 1000 / frameRate : 0;
+}
+
+void CGameObject::petIncC0() {
+	getPetControl()->incC0();
+}
+
+void CGameObject::petDecC0() {
+	getPetControl()->decC0();
+}
+
+void CGameObject::setState1C(bool flag) {
+	getGameManager()->_gameState._field1C = flag;
+}
+
+void CGameObject::mailFn10(int v) {
+	CMailMan *mailMan = getMailMan();
+	if (mailMan) {
+		makeDirty();
+		mailMan->fn10(this, v);
+	}
+}
+
+void CGameObject::mailFn11(int v) {
+	CMailMan *mailMan = getMailMan();
+	if (mailMan) {
+		makeDirty();
+		mailMan->fn11(this, v);
+	}
+}
+
+bool CGameObject::mailExists(int id) const {
+	return findMail(id) != nullptr;
+}
+
+CGameObject *CGameObject::findMail(int id) const {
+	CMailMan *mailMan = getMailMan();
+	return mailMan ? mailMan->findMail(id) : nullptr;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 44e1231..01f15ce 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -276,6 +276,11 @@ protected:
 	void dragMove(const Point &pt);
 
 	/**
+	 * Get the centre of the game object's bounds
+	 */
+	Point getControid() const;
+
+	/**
 	 * Set the position of the object
 	 */
 	void setPosition(const Point &newPos);
@@ -293,6 +298,11 @@ protected:
 	void playClip(uint startFrame, uint endFrame);
 
 	/**
+	 * Play a clip randomly from a passed list of names
+	 */
+	void playRandomClip(const char **names, uint flags);
+
+	/**
 	 * Return the current view/node/room as a single string
 	 */
 	CString getViewFullName() const;
@@ -353,6 +363,37 @@ protected:
 	 * Set's the player's passenger class
 	 */
 	void setPassengerClass(int newClass);
+
+	void setMovie14(int v);
+
+	void movie38(int v1, int v2);
+
+	void movie38(int v1);
+
+	void fn10(int v1, int v2, int v3);
+
+	/**
+	 * Gets the duration of a specified clip in milliseconds
+	 */
+	int getClipDuration(const CString &name, int frameRate = 14) const;
+
+	void petIncC0();
+	void petDecC0();
+
+	void setState1C(bool flag);
+
+	void mailFn10(int v);
+	void mailFn11(int v);
+
+	/**
+	 * Returns true if a mail with a specified Id exists
+	 */
+	bool mailExists(int id) const;
+
+	/**
+	 * Returns a specified mail, if one exists
+	 */
+	CGameObject *findMail(int id) const;
 public:
 	int _field60;
 	CursorId _cursorId;
diff --git a/engines/titanic/core/mail_man.cpp b/engines/titanic/core/mail_man.cpp
index cb95924..e96b697 100644
--- a/engines/titanic/core/mail_man.cpp
+++ b/engines/titanic/core/mail_man.cpp
@@ -47,4 +47,21 @@ CGameObject *CMailMan::getNextObject(CGameObject *prior) const {
 	return static_cast<CGameObject *>(prior->getNextSibling());
 }
 
+void CMailMan::fn10(CGameObject *obj, int v) {
+	warning("TODO: CMailMan::fn10");
+}
+
+void CMailMan::fn11(CGameObject *obj, int v) {
+	warning("TODO: CMailMan::fn11");
+}
+
+CGameObject *CMailMan::findMail(int id) const {
+	for (CGameObject *obj = getFirstObject(); obj; obj = getNextObject(obj)) {
+		if (_field50 && _field54 == id)
+			return obj;
+	}
+
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/mail_man.h b/engines/titanic/core/mail_man.h
index d1c84e2..1a95729 100644
--- a/engines/titanic/core/mail_man.h
+++ b/engines/titanic/core/mail_man.h
@@ -54,8 +54,17 @@ public:
 	 * the passed game object
 	 */
 	CGameObject *getNextObject(CGameObject *prior) const;
+
+	void fn10(CGameObject *obj, int v);
+	void fn11(CGameObject *obj, int v);
+
+	/**
+	 * Scan the mail list for a specified item
+	 */
+	CGameObject *findMail(int id) const;
 };
 
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_MAIL_MAN_H */
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index c552c69..d129767 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -46,7 +46,7 @@ bool CGameStateMovieList::clear() {
 CGameState::CGameState(CGameManager *gameManager) :
 		_gameManager(gameManager), _gameLocation(this),
 		_passengerClass(0), _priorClass(0), _mode(GSMODE_UNSELECTED),
-		_field14(0), _petActive(false), _field1C(0), _quitGame(false),
+		_field14(0), _petActive(false), _field1C(false), _quitGame(false),
 		_field24(0), _nodeChangeCtr(0), _nodeEnterTicks(0), _field38(0) {
 }
 
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 6512612..3274592 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -59,7 +59,7 @@ public:
 	GameStateMode _mode;
 	int _field14;
 	bool _petActive;
-	int _field1C;
+	bool _field1C;
 	bool _quitGame;
 	int _field24;
 	uint _nodeChangeCtr;
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 51631a3..37af6f7 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -239,10 +239,6 @@ bool CPetControl::containsPt(const Common::Point &pt) const {
 	return _drawBounds.contains(pt);
 }
 
-bool CPetControl::getC0() const {
-	return _fieldC0 > 0;
-}
-
 bool CPetControl::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	if (!containsPt(msg->_mousePos) || getC0())
 		return false;
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index cf1589c..71785ce 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -92,8 +92,6 @@ private:
 	 */
 	bool containsPt(const Common::Point &pt) const;
 
-	bool getC0() const;
-
 	/**
 	 * Checks whether a designated NPC in present in the current view
 	 */
@@ -304,6 +302,10 @@ public:
 	 * Resets the dial display to reflect new values
 	 */
 	void resetDials(int flag = 1);
+
+	bool getC0() const { return _fieldC0 > 0; }
+	void incC0() { ++_fieldC0; }
+	void decC0() { --_fieldC0; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 1c94cab..26620de 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -26,7 +26,8 @@
 
 namespace Titanic {
 
-CMovie::CMovie() : ListItem(), _state(MOVIE_STOPPED), _field10(0) {
+CMovie::CMovie() : ListItem(), _state(MOVIE_STOPPED), _field10(0),
+		_field14(0) {
 }
 
 CMovie::~CMovie() {
@@ -50,7 +51,10 @@ bool CMovie::get10() {
 
 OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) :
 		_videoSurface(surface), _gameObject(nullptr), _endFrame(-1) {
-	_video = new Video::AVIDecoder();
+	Video::AVIDecoder *decoder = new Video::AVIDecoder();
+	_video = decoder;
+	_field14 = 1;
+
 	if (!_video->loadFile(name.getString()))
 		error("Could not open video - %s", name.getString().c_str());
 }
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index 20de84a..01f107e 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -46,6 +46,8 @@ protected:
 	MovieState _state;
 	int _field10;
 public:
+	int _field14;
+public:
 	CMovie();
 	virtual ~CMovie();
 
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 813138d..3b026c5 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -418,6 +418,10 @@ void OSVideoSurface::setMovieFrame(uint frameNumber) {
 		_movie->setFrame(frameNumber);
 }
 
+void OSVideoSurface::proc38(int v1, int v2) {
+	warning("OSVideoSurface::proc38");
+}
+
 bool OSVideoSurface::loadIfReady() {
 	_videoSurfaceNum = _videoSurfaceCounter;
 
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index aee28be..8d0dd2f 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -178,6 +178,8 @@ public:
 	 */
 	virtual void setMovieFrame(uint frameNumber) = 0;
 
+	virtual void proc38(int v1, int v2) = 0;
+
 	/**
 	 * Loads the surface's resource if there's one pending
 	 */
@@ -343,6 +345,8 @@ public:
 	 */
 	virtual void setMovieFrame(uint frameNumber);
 
+	virtual void proc38(int v1, int v2);
+
 	/**
 	 * Loads the surface's resource if there's one pending
 	 */


Commit: 701caa956ca652256504a1dd6a82e24a853323ac
    https://github.com/scummvm/scummvm/commit/701caa956ca652256504a1dd6a82e24a853323ac
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:47-04:00

Commit Message:
TITANIC: Implemented mail manager methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/mail_man.cpp
    engines/titanic/core/mail_man.h
    engines/titanic/pet_control/pet_drag_chev.cpp



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 4a5dd9b..466fb44 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -61,8 +61,8 @@ CGameObject::CGameObject(): CNamedItem() {
 	_field44 = 0xF0;
 	_field48 = 0xF0;
 	_field4C = 0xFF;
-	_field50 = 0;
-	_field54 = 0;
+	_isMail = false;
+	_id = 0;
 	_field58 = 0;
 	_visible = true;
 	_field60 = 0;
@@ -124,8 +124,8 @@ void CGameObject::load(SimpleFile *file) {
 		_field4C = file->readNumber();
 		_fieldB8 = file->readNumber();
 		_visible = file->readNumber() != 0;
-		_field50 = file->readNumber();
-		_field54 = file->readNumber();
+		_isMail = file->readNumber();
+		_id = file->readNumber();
 		_field58 = file->readNumber();
 
 		resourceKey.load(file);		
@@ -1008,19 +1008,19 @@ void CGameObject::setState1C(bool flag) {
 	getGameManager()->_gameState._field1C = flag;
 }
 
-void CGameObject::mailFn10(int v) {
+void CGameObject::addMail(int mailId) {
 	CMailMan *mailMan = getMailMan();
 	if (mailMan) {
 		makeDirty();
-		mailMan->fn10(this, v);
+		mailMan->addMail(this, mailId);
 	}
 }
 
-void CGameObject::mailFn11(int v) {
+void CGameObject::setMailId(int mailId) {
 	CMailMan *mailMan = getMailMan();
 	if (mailMan) {
 		makeDirty();
-		mailMan->fn11(this, v);
+		mailMan->setMailId(this, mailId);
 	}
 }
 
@@ -1033,4 +1033,16 @@ CGameObject *CGameObject::findMail(int id) const {
 	return mailMan ? mailMan->findMail(id) : nullptr;
 }
 
+void CGameObject::removeMail(int id, int v) {
+	CMailMan *mailMan = getMailMan();
+	if (mailMan)
+		mailMan->removeMail(id, v);
+}
+
+void CGameObject::resetMail() {
+	CMailMan *mailMan = getMailMan();
+	if (mailMan)
+		mailMan->resetValue();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 01f15ce..ad0d939 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -82,9 +82,6 @@ protected:
 	int _field44;
 	int _field48;
 	int _field4C;
-	int _field50;
-	int _field54;
-	int _field58;
 	CMovieClipList _clipList1;
 	int _initialFrame;
 	CMovieClipList _clipList2;
@@ -382,8 +379,15 @@ protected:
 
 	void setState1C(bool flag);
 
-	void mailFn10(int v);
-	void mailFn11(int v);
+	/**
+	 * Adds an object to the mail list
+	 */
+	void addMail(int mailId);
+
+	/**
+	 * Sets the mail identifier for an object
+	 */
+	void setMailId(int mailId);
 
 	/**
 	 * Returns true if a mail with a specified Id exists
@@ -394,7 +398,20 @@ protected:
 	 * Returns a specified mail, if one exists
 	 */
 	CGameObject *findMail(int id) const;
+
+	/**
+	 * Remove an object from the mail list
+	 */
+	void removeMail(int id, int v);
+
+	/**
+	 * Resets the Mail Man value
+	 */
+	void resetMail();
 public:
+	bool _isMail;
+	int _id;
+	int _field58;
 	int _field60;
 	CursorId _cursorId;
 	bool _visible;
diff --git a/engines/titanic/core/mail_man.cpp b/engines/titanic/core/mail_man.cpp
index e96b697..8ac50e9 100644
--- a/engines/titanic/core/mail_man.cpp
+++ b/engines/titanic/core/mail_man.cpp
@@ -47,21 +47,35 @@ CGameObject *CMailMan::getNextObject(CGameObject *prior) const {
 	return static_cast<CGameObject *>(prior->getNextSibling());
 }
 
-void CMailMan::fn10(CGameObject *obj, int v) {
-	warning("TODO: CMailMan::fn10");
+void CMailMan::addMail(CGameObject *obj, int id) {
+	obj->detach();
+	obj->addUnder(this);
+	setMailId(obj, id);
 }
 
-void CMailMan::fn11(CGameObject *obj, int v) {
-	warning("TODO: CMailMan::fn11");
+void CMailMan::setMailId(CGameObject *obj, int id) {
+	obj->_id = id;
+	obj->_field58 = 0;
+	obj->_isMail = true;
 }
 
 CGameObject *CMailMan::findMail(int id) const {
 	for (CGameObject *obj = getFirstObject(); obj; obj = getNextObject(obj)) {
-		if (_field50 && _field54 == id)
+		if (obj->_isMail && obj->_id == id)
 			return obj;
 	}
 
 	return nullptr;
 }
 
+void CMailMan::removeMail(int id, int v) {
+	for (CGameObject *obj = getFirstObject(); obj; obj = getNextObject(obj)) {
+		if (obj->_isMail && obj->_id == id) {
+			obj->_isMail = false;
+			obj->_field58 = v;
+			break;
+		}
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/mail_man.h b/engines/titanic/core/mail_man.h
index 1a95729..982aae4 100644
--- a/engines/titanic/core/mail_man.h
+++ b/engines/titanic/core/mail_man.h
@@ -55,13 +55,27 @@ public:
 	 */
 	CGameObject *getNextObject(CGameObject *prior) const;
 
-	void fn10(CGameObject *obj, int v);
-	void fn11(CGameObject *obj, int v);
+	/**
+	 * Add an object to the mail list
+	 */
+	void addMail(CGameObject *obj, int id);
+
+	/**
+	 * Sets the mail identifier for an object
+	 */
+	static void setMailId(CGameObject *obj, int id);
 
 	/**
 	 * Scan the mail list for a specified item
 	 */
 	CGameObject *findMail(int id) const;
+
+	/**
+	 * Remove a mail item
+	 */
+	void removeMail(int id, int v);
+
+	void resetValue() { _value = 0; }
 };
 
 
diff --git a/engines/titanic/pet_control/pet_drag_chev.cpp b/engines/titanic/pet_control/pet_drag_chev.cpp
index 6458041..3143cde 100644
--- a/engines/titanic/pet_control/pet_drag_chev.cpp
+++ b/engines/titanic/pet_control/pet_drag_chev.cpp
@@ -56,7 +56,7 @@ bool CPetDragChev::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 		CSuccUBus *succubus = static_cast<CSuccUBus *>(msg->_dropTarget);
 
 		if (succubus) {
-			CSetChevRoomBits chevMsg(_field54);
+			CSetChevRoomBits chevMsg(_id);
 			chevMsg.execute(succubus);
 		} else {
 			CPetControl *petControl = getPetControl();


Commit: cafde797732d62241207fb39b66456a69a0eb3c1
    https://github.com/scummvm/scummvm/commit/cafde797732d62241207fb39b66456a69a0eb3c1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:51-04:00

Commit Message:
TITANIC: Added PET cursor related methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/television.cpp
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_remote.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 466fb44..aa0de49 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -384,10 +384,22 @@ void CGameObject::setVisible(bool val) {
 	}
 }
 
-void CGameObject::petFn2(int val) {
+void CGameObject::petHighlightGlyph(int val) {
 	CPetControl *pet = getPetControl();
 	if (pet)
-		pet->fn2(val);
+		pet->highlightGlyph(val);
+}
+
+void CGameObject::petHideCursor() {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->hideCursor();
+}
+
+void CGameObject::petShowCursor() {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->showCursor();
 }
 
 void CGameObject::petFn3(CTreeItem *item) {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index ad0d939..20729d5 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -126,7 +126,21 @@ protected:
 	 */
 	CViewItem * parseView(const CString &viewString);
 
-	void petFn2(int val);
+	/**
+	 * Highlights a glyph in the currently active PET section
+	 */
+	void petHighlightGlyph(int id);
+
+	/**
+	 * Hides the text cursor in the current section, if applicable
+	 */
+	void petHideCursor();
+
+	/**
+	 * Shows the text cursor in the current section, if applicable
+	 */
+	void petShowCursor();
+
 	void petFn3(CTreeItem *item);
 	void incState38();
 	void inc54();
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 280f7f2..5127712 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -140,7 +140,7 @@ bool CTelevision::ChangeSeasonMsg(CChangeSeasonMsg *msg) {
 
 bool CTelevision::EnterViewMsg(CEnterViewMsg *msg) {
 	setPetArea(PET_REMOTE);
-	petFn2(2);
+	petHighlightGlyph(GLYPH_TELEVISION_CONTROL);
 	petFn3(0);
 	setVisible(0);
 	_fieldE0 = 1;
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 37af6f7..bc2ab03 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -211,8 +211,16 @@ PetArea CPetControl::setArea(PetArea newArea) {
 	return newArea;
 }
 
-void CPetControl::fn2(int val) {
-	_sections[_currentArea]->proc38(val);
+void CPetControl::hideCursor() {
+	_sections[_currentArea]->hideCursor();
+}
+
+void CPetControl::showCursor() {
+	_sections[_currentArea]->showCursor();
+}
+
+void CPetControl::highlightGlyph(int id) {
+	_sections[_currentArea]->highlight(id);
 }
 
 void CPetControl::fn3(CTreeItem *item) {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 71785ce..3dee76f 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -163,8 +163,6 @@ public:
 
 	bool fn1(int val);
 
-	void fn2(int val);
-
 	void fn3(CTreeItem *item);
 
 	void fn4();
@@ -175,6 +173,21 @@ public:
 	PetArea setArea(PetArea newSection);
 
 	/**
+	 * Hides the text cursor in the current section, if applicable
+	 */
+	void hideCursor();
+
+	/**
+	 * Shows the text cursor in the current section, if applicable
+	 */
+	void showCursor();
+
+	/**
+	 * Highlights a glyph item in the currently active section, if applicable
+	 */
+	void highlightGlyph(int id);
+
+	/**
 	 * Returns true if the PET is currently unlocked
 	 */
 	bool isUnlocked() const { return _locked == 0; }
diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index aac0dc8..6f13325 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -214,8 +214,8 @@ CPetGfxElement *CPetRemote::getElement(uint id) {
 	}
 }
 
-void CPetRemote::proc38(int val) {
-	int highlightIndex = getHighlightIndex((RemoteGlyph)val);
+void CPetRemote::highlight(int id) {
+	int highlightIndex = getHighlightIndex((RemoteGlyph)id);
 	if (highlightIndex != -1)
 		_items.highlight(highlightIndex);
 }
diff --git a/engines/titanic/pet_control/pet_remote.h b/engines/titanic/pet_control/pet_remote.h
index 8703abd..58c429f 100644
--- a/engines/titanic/pet_control/pet_remote.h
+++ b/engines/titanic/pet_control/pet_remote.h
@@ -143,7 +143,10 @@ public:
 	 */
 	virtual CPetGfxElement *getElement(uint id);
 
-	virtual void proc38(int val);
+	/**
+	 * Highlights a glyph item in the section
+	 */
+	virtual void highlight(int id);
 
 	/**
 	 * Generates a PET message
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 52890fc..15c4033 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -182,7 +182,10 @@ public:
 	 */
 	virtual void hideCursor() {}
 
-	virtual void proc38(int val) {}
+	/**
+	 * Highlights a glyph item in the section, if applicable
+	 */
+	virtual void highlight(int id) {}
 
 	/**
 	 * Get the PET control


Commit: 4f85562c47d6e4b16e9b0e8e018e09635bf4ba9d
    https://github.com/scummvm/scummvm/commit/4f85562c47d6e4b16e9b0e8e018e09635bf4ba9d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:54-04:00

Commit Message:
TITANIC: In progress adding CRoomFlags class

Changed paths:
  A engines/titanic/room_flags.cpp
  A engines/titanic/room_flags.h
    engines/titanic/module.mk



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index dac6287..b1b35fc 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -11,6 +11,7 @@ MODULE_OBJS := \
 	input_handler.o \
 	input_translator.o \
 	main_game_window.o \
+	room_flags.o \
 	titanic.o \
 	carry/auditory_centre.o \
 	carry/arm.o \
diff --git a/engines/titanic/room_flags.cpp b/engines/titanic/room_flags.cpp
new file mode 100644
index 0000000..ac3ae49
--- /dev/null
+++ b/engines/titanic/room_flags.cpp
@@ -0,0 +1,403 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/room_flags.h"
+
+namespace Titanic {
+
+#define ELEVATOR_SHIFT 18
+#define ELEVATOR_MASK 3
+#define PASSENGER_CLASS_SHIFT 16
+#define PASSENGER_CLASS_MASK 3
+#define FLOOR_SHIFT 8
+#define FLOOR_MASK 0xFF
+#define ROOM_SHIFT 1
+#define ROOM_MASK 0x7F
+
+struct TransportFlagsEntry {
+	const char *const _roomName;
+	uint _roomFlags;
+};
+struct SuccUBusFlagsEntry {
+	const char *const _roomName;
+	uint _roomFlags;
+	uint _succubusNum;
+};
+
+#define TRANSPORT_ROOMS_SIZE 6
+const TransportFlagsEntry TRANSPORT_ROOMS[TRANSPORT_ROOMS_SIZE] = {
+	{ "TopOfWell", 0xDF4D1 },
+	{ "Pellerator", 0xC95E9 },
+	{ "Dome", 0xAD171 },
+	{ "Lift", 0x96E45 },
+	{ "SGTLeisure", 0x5D3AD },
+	{ "ServiceElevator", 0x68797 }
+};
+
+#define SUCCUBUS_ROOMS_SIZE 17
+const SuccUBusFlagsEntry SUCCUBUS_ROOMS[SUCCUBUS_ROOMS_SIZE] = {
+	{ "ParrotLobby", 0x1D0D9, 3 },
+	{ "SculptureChamber", 0x465FB, 2 },
+	{ "Bar", 0x0B3D97, 2 },
+	{ "EmbLobby", 0x0CC971, 3 },
+	{ "MoonEmbLobby", 0x0CC971, 3 },
+	{ "MusicRoom", 0x0F34DB, 2 },
+	{ "MusicRoomLobby", 0x0F34DB, 2 },
+	{ "Titania", 0x8A397, 3 },
+	{ "BottomOfWell", 0x59FAD, 3 },
+	{ "Arboretum", 0x4D6AF, 1 },
+	{ "PromenadeDeck", 0x79C45, 2 },
+	{ "1stClassRestaurant", 0x896B9, 1 },
+	{ "CreatorsChamber", 0x2F86D, 2 },
+	{ "CreatorsChamberOn", 0x2F86D, 2 },
+	{ "BilgeRoom", 0x3D94B, 3 },
+	{ "BilgeRoomWith", 0x3D94B, 3 },
+	{ "Bridge", 0x39FCB, 3 }
+};
+
+int CRoomFlags::getConditionally() const {
+	if (getRoomArea() != 5 || getRoomCategory() != 5)
+		return _data;
+	else
+		return 5;
+}
+
+bool CRoomFlags::isTransportRoom() const {
+	for (int idx = 0; idx < TRANSPORT_ROOMS_SIZE; ++idx) {
+		if (TRANSPORT_ROOMS[idx]._roomFlags == _data)
+			return true;
+	}
+
+	return false;
+}
+
+int CRoomFlags::getRoomCategory() const {
+	if (getRoomNum() == 0)
+		return false;
+
+	CRoomFlags tempFlags = _data;
+	tempFlags.setRoomBits(1);
+	return tempFlags.getRoomArea() != 5;
+}
+
+CString CRoomFlags::getRoomDesc() const {
+	switch (getRoomArea()) {
+	case 1:
+	case 2:
+	case 3: {
+		CString result = getPassengerClassDesc();
+		result += ", ";
+		result += getFloorDesc();
+		result += ", ";
+		result += getElevatorDesc();
+		result += ", ";
+		result += getRoomDesc();
+		return result;
+	}
+
+	case 4:
+		if (isTransportRoom()) {
+			switch (_data) {
+			case 0x68797:
+				return "The Service Elevator";
+			case 0x5D3AD:
+				return "The Super Galactic Leisure Lounge";
+			case 0x96E45:
+				return "The Elevator";
+			case 0xAD171:
+				return "The Dome";
+			case 0xC95E9:
+				return "The Pellerator";
+			case 0xDF4D1:
+				return  "The Top of the Well";
+			default:
+				break;
+			}
+		}
+
+		if (getRoomCategory() == 0) {
+			return "Nowhere you're likely to want to go.";
+		} else {
+			CString result = getPassengerClassDesc();
+			result += ", ";
+			result += getFloorDesc();
+			return result;
+		}
+		break;
+
+	case 5:
+		switch (_data) {
+		case 0x1D0D9:
+			return "The Parrot Lobby";
+		case 0x2F86D:
+			return "The Creators' Chamber";
+		case 0x39FCB:
+			return "The Bridge";
+		case 0x3D94B:
+			return "The Bilge Room";
+		case 0x465FB:
+			return "The Sculpture Chamber";
+		case 0x4D6AF:
+			return "The Arboretum";
+		case 0x59FAD:
+			return "The Bottom of the Well";
+		case 0x79C45:
+			return "The Promenade Deck";
+		case 0x896B9:
+			return "The 1st class restaurant";
+		case 0x8A397:
+			return "Titania's Room";
+		case 0xB3D97:
+			return "The Bar";
+		case 0xCC971:
+			return "The Embarkation Lobby";
+		case 0xF34DB:
+			return  "The Music Room";
+		default:
+			break;
+		}
+		return "Unknown Room";
+
+	default:
+		break;
+	}
+
+	return "Unknown Room";
+}
+
+void CRoomFlags::setElevatorBits(uint val) {
+	_data &= ~(ELEVATOR_MASK << ELEVATOR_SHIFT);
+	_data |= (val & ELEVATOR_MASK) << ELEVATOR_SHIFT;
+}
+
+uint CRoomFlags::getElevatorBits() const {
+	return (_data >> ELEVATOR_SHIFT) & ELEVATOR_MASK;
+}
+
+void CRoomFlags::setPassengerClassBits(uint val) {
+	_data &= ~(PASSENGER_CLASS_MASK << PASSENGER_CLASS_SHIFT);
+	_data |= (val & PASSENGER_CLASS_MASK) << PASSENGER_CLASS_SHIFT;
+}
+
+uint CRoomFlags::getPassengerClassBits() const {
+	return (_data >> PASSENGER_CLASS_SHIFT) & PASSENGER_CLASS_MASK;
+}
+
+CString CRoomFlags::getPassengerClassDesc() const {
+	int classNum = getPassengerClassNum();
+
+	switch (classNum) {
+	case 1:
+		return "1st class";
+	case 2:
+		return "2nd class";
+	case 3:
+		return "SGT class";
+	default:
+		return "no class";
+	}
+}
+
+void CRoomFlags::setFloorBits(uint val) {
+	_data &= ~(FLOOR_MASK << FLOOR_SHIFT);
+	_data |= (val & FLOOR_MASK) << FLOOR_SHIFT;
+}
+
+uint CRoomFlags::getFloorBits() const {
+	return (_data >> FLOOR_SHIFT) & FLOOR_MASK;
+}
+
+uint CRoomFlags::decodeFloorBits(uint bits) const {
+	int base = 0;
+	int offset = bits & 0xF;
+
+	switch ((bits >> 4) & 0xF) {
+	case 1:
+	case 2:
+	case 3:
+		base = 40;
+		break;
+	case 4:
+		base = 10;
+		break;
+	case 5:
+		base = 20;
+		break;
+	case 6:
+		base = 30;
+		break;
+	default:
+		break;
+	}
+
+	return offset >= 10 ? 0 : base + offset;
+}
+
+void CRoomFlags::setFloorNum(uint floorNum) {
+	uint base = 0;
+
+	switch (floorNum / 10) {
+	case 0:
+		base = 0x90;
+		break;
+	case 1:
+		base = 0xD0;
+	case 2:
+		base = 0xE0;
+	case 3:
+		base = 0xF0;
+		break;
+	default:
+		break;
+	}
+
+	setFloorBits(base | (floorNum % 10));
+}
+
+uint CRoomFlags::getFloorNum() const {
+	return decodeFloorBits(getFloorBits());
+}
+
+void CRoomFlags::setRoomBits(uint roomBits) {
+	_data &= ~(ROOM_MASK << ROOM_SHIFT);
+	_data |= (roomBits & ROOM_MASK) << ROOM_SHIFT;
+}
+
+uint CRoomFlags::getRoomBits() const {
+	return (_data >> ROOM_SHIFT) & ROOM_MASK;
+}
+
+uint CRoomFlags::getRoomArea() const {
+	warning("TODO: CRoomFlags::getRoomArea");
+	return 0;
+}
+
+bool CRoomFlags::isSuccUBusRoomFlags() const {
+	for (int idx = 0; idx < SUCCUBUS_ROOMS_SIZE; ++idx) {
+		if (SUCCUBUS_ROOMS[idx]._roomFlags == _data)
+			return true;
+	}
+
+	return false;
+}
+
+bool CRoomFlags::getBit0() const {
+	return _data & 1;
+}
+
+uint CRoomFlags::getSpecialRoomFlags(const CString &roomName) {
+	for (int idx = 0; idx < SUCCUBUS_ROOMS_SIZE; ++idx) {
+		if (!roomName.compareTo(SUCCUBUS_ROOMS[idx]._roomName))
+			return SUCCUBUS_ROOMS[idx]._roomFlags;
+	}
+
+	for (int idx = 0; idx < TRANSPORT_ROOMS_SIZE; ++idx) {
+		if (!roomName.compareTo(TRANSPORT_ROOMS[idx]._roomName))
+			return TRANSPORT_ROOMS[idx]._roomFlags;
+	}
+
+	return 0;
+}
+
+uint CRoomFlags::getSuccUBusNum(const CString &roomName) {
+	for (int idx = 0; idx < SUCCUBUS_ROOMS_SIZE; ++idx) {
+		if (!roomName.compareTo(SUCCUBUS_ROOMS[idx]._roomName))
+			return SUCCUBUS_ROOMS[idx]._succubusNum;
+	}
+
+	return 0;
+}
+
+CString CRoomFlags::getSuccUBusRoomName() const {
+	for (int idx = 0; idx < SUCCUBUS_ROOMS_SIZE; ++idx) {
+		if (SUCCUBUS_ROOMS[idx]._roomFlags == _data)
+			return SUCCUBUS_ROOMS[idx]._roomName;
+	}
+
+	return CString();
+}
+
+void CRoomFlags::changeLocation(int action) {
+	uint floorNum = getFloorNum();
+	uint roomNum = getRoomNum();
+	uint elevatorNum = getElevatorNum();
+	uint classNum = getPassengerClassNum();
+	uint v10, v11, v12, v13;
+
+	switch (classNum) {
+	case 1:
+		v10 = 2;
+		v11 = 19;
+		v12 = 1;
+		v13 = 3;
+		break;
+
+	case 2:
+		v10 = 20;
+		v11 = 27;
+		v12 = 1;
+		v13 = (elevatorNum & 1) ? 3 : 4;
+		break;
+
+	case 3:
+		v10 = 28;
+		v11 = 38;
+		v12 = 1;
+		v13 = 18;
+		break;
+
+	default:
+		v10 = 0;
+		v11 = 0;
+		v12 = 0;
+		v13 = 0;
+		break;
+	}
+
+	// Perform action to change room or floor
+	switch (action) {
+	case 1:
+		if (--roomNum < v12)
+			roomNum = v12;
+		break;
+
+	case 2:
+		if (++roomNum > v13)
+			roomNum = v13;
+		break;
+
+	case 3:
+		if (--floorNum < v10)
+			floorNum = v10;
+		break;
+
+	case 4:
+		if (++floorNum > v11)
+			floorNum = v11;
+	}
+
+	// Set new floor and room
+	setFloorNum(floorNum);
+	setRoomBits(roomNum);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/room_flags.h b/engines/titanic/room_flags.h
new file mode 100644
index 0000000..9614525
--- /dev/null
+++ b/engines/titanic/room_flags.h
@@ -0,0 +1,202 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ROOM_FLAGS_H
+#define TITANIC_ROOM_FLAGS_H
+
+#include "titanic/support/string.h"
+
+namespace Titanic {
+
+class CRoomFlags {
+private:
+	uint _data;
+private:
+	int getConditionally() const;
+
+	bool not5() const { return getConditionally() != 5; }
+
+	/**
+	 * Returns true if the current flags appear in the
+	 * list of transport rooms
+	 */
+	bool isTransportRoom() const;
+
+	int getRoomCategory() const;
+
+	/**
+	 * Set the bits for the elevator number
+	 */
+	void setElevatorBits(uint val);
+
+	/**
+	 * Set the bits for the passenger class
+	 */
+	void setPassengerClassBits(uint val);
+
+	/**
+	 * Set the bits for the floor number
+	 */
+	void setFloorBits(uint val);
+
+	/**
+	 * Translates bits for floor into a floor number
+	 */
+	uint decodeFloorBits(uint bits) const;
+
+	uint getRoomArea() const;
+
+	/**
+	 * Returns true if the current flags are in the succubus list
+	 */
+	bool isSuccUBusRoomFlags() const;
+
+	/**
+	 * Gets the special flags for a transport or succubus room
+	 */
+	uint getSpecialRoomFlags(const CString &roomName);
+
+	/**
+	 * Gets the succubus number associated with a given room
+	 */
+	uint getSuccUBusNum(const CString &roomName);
+
+	/**
+	 * Gets the succubus room name associated with the current room flags
+	 */
+	CString getSuccUBusRoomName() const;
+public:
+	CRoomFlags() : _data(0) {}
+	CRoomFlags(uint data) : _data(data) {}
+	operator uint() { return _data; }
+
+	/**
+	 * Set the flags value
+	 */
+	void set(uint data) { _data = data; }
+
+	/**
+	 * Get the flags value
+	 */
+	uint get() const { return _data; }
+
+	bool test5(const CRoomFlags &roomFlags) const {
+		return roomFlags.not5();
+	}
+
+	/**
+	 * Get a description for the room
+	 */
+	CString getRoomDesc() const;
+
+	/**
+	 * Get the bits for the elevator number
+	 */
+	uint getElevatorBits() const;
+
+	/**
+	 * Set the elevator number
+	 */
+	void setElevatorNum(uint val) { setElevatorBits(val - 1); }
+
+	/**
+	 * Get the elevator number
+	 */
+	uint getElevatorNum() const { return getElevatorBits() + 1; }
+
+	/**
+	 * Get a description for the elevator number
+	 */
+	CString getElevatorDesc() const {
+		return CString::format("Elevator %d", getElevatorNum());
+	}
+
+	/**
+	 * Gets the bits for the passenger class
+	 */
+	uint getPassengerClassBits() const;
+
+	/**
+	 * Gets the passenger class number
+	 */
+	uint getPassengerClassNum() const { return getPassengerClassBits(); }
+
+	/**
+	 * Get a description for the passenger class
+	 */
+	CString getPassengerClassDesc() const;
+
+	/**
+	 * Gets the bits for the floor number
+	 */
+	uint getFloorBits() const;
+
+	/**
+	 * Sets the floor number
+	 */
+	void setFloorNum(uint floorNum);
+
+	/**
+	 * Gets the floor number
+	 */
+	uint getFloorNum() const;
+
+	/**
+	 * Get a description for the floor number
+	 */
+	CString getFloorDesc() const {
+		return CString::format("Floor %d", getFloorNum());
+	}
+
+	/**
+	 * Sets the bits for the room number
+	 */
+	void setRoomBits(uint roomBits);
+
+	/**
+	 * Gets the bits for the room number
+	 */
+	uint getRoomBits() const;
+
+	/**
+	 * Gets the room number
+	 */
+	uint getRoomNum() const { return getRoomBits(); }
+
+	/**
+	 * Gets a string for the room number
+	 */
+	CString getRoomNumDesc() const {
+		return CString::format("Room %d", getRoomNum());
+	}
+
+	bool getBit0() const;
+
+	/**
+	 * Change the passenger class
+	 */
+	void changeLocation(int action);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ROOM_FLAGS_H */


Commit: 23da68350dee0b211cdcf29734146ac71583044b
    https://github.com/scummvm/scummvm/commit/23da68350dee0b211cdcf29734146ac71583044b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:23:57-04:00

Commit Message:
TITANIC: Finished CRoomFlags methods

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/room_flags.cpp
    engines/titanic/room_flags.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index bc2ab03..f7973e0 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -533,4 +533,11 @@ void CPetControl::resetDials(int flag) {
 		_conversations.resetDials(_activeNPCName);
 }
 
+int CPetControl::getMailDest(const CRoomFlags &roomFlags) const {
+	if (!roomFlags.isSuccUBusRoomFlags())
+		return roomFlags.getPassengerClassNum();
+
+	return roomFlags.getSuccUBusNum(roomFlags.getSuccUBusRoomName());
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 3dee76f..758069e 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -36,6 +36,7 @@
 #include "titanic/pet_control/pet_real_life.h"
 #include "titanic/pet_control/pet_remote.h"
 #include "titanic/pet_control/pet_rooms.h"
+#include "titanic/room_flags.h"
 
 namespace Titanic {
 
@@ -319,6 +320,11 @@ public:
 	bool getC0() const { return _fieldC0 > 0; }
 	void incC0() { ++_fieldC0; }
 	void decC0() { --_fieldC0; }
+
+	/**
+	 * Get mail destination given the specified flags
+	 */
+	int getMailDest(const CRoomFlags &roomFlags) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/room_flags.cpp b/engines/titanic/room_flags.cpp
index ac3ae49..b64b650 100644
--- a/engines/titanic/room_flags.cpp
+++ b/engines/titanic/room_flags.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/room_flags.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -99,6 +100,43 @@ int CRoomFlags::getRoomCategory() const {
 	return tempFlags.getRoomArea() != 5;
 }
 
+int CRoomFlags::getRoomArea() const {
+	if (isSuccUBusRoomFlags())
+		return 4;
+
+	if (!getBit0()) {
+		uint v3 = getFloorNum();
+		if (v3 <= 38) {
+			uint v4 = getRoomNum();
+			if (v4 <= 18) {
+				uint v6 = getElevatorNum();
+
+				if (v6 >= 1 && v6 <= 4) {
+					uint v7 = getPassengerClassNum() - 1;
+					if (v7) {
+						uint v8 = v7 - 1;
+						if (v8) {
+							if (v8 == 1 && is28To38(v3) && (v6 & 1) && v4 >= 1)
+								return 3;
+						} else if (is20To27(v3)) {
+							if (v6 & 1) {
+								if (v4 >= 1 && v4 <= 3)
+									return 2;
+							} else if (v4 >= 1 && v4 <= 4) {
+								return 2;
+							}
+						}
+					} else if (is2To19(v3) && v4 >= 1 && v4 <= 3) {
+						return 1;
+					}
+				}
+			}
+		}
+	}
+
+	return 5;
+}
+
 CString CRoomFlags::getRoomDesc() const {
 	switch (getRoomArea()) {
 	case 1:
@@ -286,11 +324,6 @@ uint CRoomFlags::getRoomBits() const {
 	return (_data >> ROOM_SHIFT) & ROOM_MASK;
 }
 
-uint CRoomFlags::getRoomArea() const {
-	warning("TODO: CRoomFlags::getRoomArea");
-	return 0;
-}
-
 bool CRoomFlags::isSuccUBusRoomFlags() const {
 	for (int idx = 0; idx < SUCCUBUS_ROOMS_SIZE; ++idx) {
 		if (SUCCUBUS_ROOMS[idx]._roomFlags == _data)
@@ -318,7 +351,7 @@ uint CRoomFlags::getSpecialRoomFlags(const CString &roomName) {
 	return 0;
 }
 
-uint CRoomFlags::getSuccUBusNum(const CString &roomName) {
+uint CRoomFlags::getSuccUBusNum(const CString &roomName) const {
 	for (int idx = 0; idx < SUCCUBUS_ROOMS_SIZE; ++idx) {
 		if (!roomName.compareTo(SUCCUBUS_ROOMS[idx]._roomName))
 			return SUCCUBUS_ROOMS[idx]._succubusNum;
@@ -400,4 +433,80 @@ void CRoomFlags::changeLocation(int action) {
 	setRoomBits(roomNum);
 }
 
+bool CRoomFlags::compareFlags(CRoomFlags flags1, CRoomFlags flags2) const {
+	if (flags1.getFloorNum() != flags2.getFloorNum())
+		return false;
+
+	uint elev1 = flags1.getElevatorNum();
+	uint elev2 = flags2.getElevatorNum();
+	uint class1 = getPassengerClassNum();
+	uint class2 = getPassengerClassNum();
+
+	if (class1 > 0 && class1 < 3) {
+		if (elev1 == 2)
+			elev1 = 1;
+		else if (elev1 == 4)
+			elev1 = 3;
+	}
+	if (class2 > 0 && class2 < 3) {
+		if (elev2 == 2)
+			elev2 = 1;
+		else if (elev2 == 4)
+			elev2 = 3;
+	}
+
+	return elev1 == elev2;
+}
+
+bool CRoomFlags::compareLocation(uint roomFlags) {
+	CRoomFlags flags(roomFlags);
+
+	return getElevatorNum() == flags.getElevatorBits() &&
+		getFloorNum() == flags.getFloorNum() &&
+		getRoomNum() == flags.getRoomNum();
+}
+
+void CRoomFlags::setRandomLocation(int classNum, bool flag) {
+	uint minRoom, elevNum, maxRoom, maxFloor, minFloor;
+
+	do {
+		switch (classNum) {
+		case 1:
+			minFloor = 2;
+			maxFloor = 19;
+			minRoom = 1;
+			maxRoom = 3;
+			elevNum = g_vm->getRandomNumber(flag ? 2 : 3);
+			break;
+
+		case 2:
+			minFloor = 20;
+			maxFloor = 27;
+			elevNum = g_vm->getRandomNumber(flag ? 2 : 3);
+			minRoom = 1;
+			maxRoom = ((elevNum - 1) & 1) ? 3 : 4;
+			break;
+
+		case 3:
+			minRoom = 1;
+			minFloor = 28;
+			maxFloor = 38;
+			maxRoom = 18;
+			elevNum = g_vm->getRandomNumber(1);
+			if (elevNum == 1)
+				elevNum = 2;
+			break;
+
+		default:
+			return;
+		}
+
+		uint floorNum = minFloor + g_vm->getRandomNumber(maxFloor - minFloor);
+		uint roomNum = minRoom + g_vm->getRandomNumber(maxRoom - minRoom);
+		setElevatorBits(elevNum);
+		setRoomBits(roomNum);
+		setFloorNum(floorNum);
+	} while (_data == 0x59706);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/room_flags.h b/engines/titanic/room_flags.h
index 9614525..553e0a3 100644
--- a/engines/titanic/room_flags.h
+++ b/engines/titanic/room_flags.h
@@ -43,6 +43,8 @@ private:
 
 	int getRoomCategory() const;
 
+	int getRoomArea() const;
+
 	/**
 	 * Set the bits for the elevator number
 	 */
@@ -63,27 +65,27 @@ private:
 	 */
 	uint decodeFloorBits(uint bits) const;
 
-	uint getRoomArea() const;
-
 	/**
-	 * Returns true if the current flags are in the succubus list
+	 * Compares two room flags together
 	 */
-	bool isSuccUBusRoomFlags() const;
+	bool compareFlags(CRoomFlags flags1, CRoomFlags flags2) const;
 
 	/**
-	 * Gets the special flags for a transport or succubus room
+	 * Compares the current flags against the specified flags
+	 * for a matching elevator, floor, and room
 	 */
-	uint getSpecialRoomFlags(const CString &roomName);
+	bool compareLocation(uint roomFlags);
 
 	/**
-	 * Gets the succubus number associated with a given room
+	 * Returns true if the current flags is for Titania's room
 	 */
-	uint getSuccUBusNum(const CString &roomName);
+	bool isTitania() const { return _data == 0x8A397; }
 
-	/**
-	 * Gets the succubus room name associated with the current room flags
-	 */
-	CString getSuccUBusRoomName() const;
+	bool is59706() const { return _data == 0x59706; }
+
+	bool is2To19(uint v) const { return v >= 2 && v <= 19; }
+	bool is20To27(uint v) const { return v >= 20 && v <= 27; }
+	bool is28To38(uint v) const { return v >= 28 && v <= 38; }
 public:
 	CRoomFlags() : _data(0) {}
 	CRoomFlags(uint data) : _data(data) {}
@@ -99,9 +101,15 @@ public:
 	 */
 	uint get() const { return _data; }
 
-	bool test5(const CRoomFlags &roomFlags) const {
-		return roomFlags.not5();
-	}
+	/**
+	 * Gets the special flags for a transport or succubus room
+	 */
+	uint getSpecialRoomFlags(const CString &roomName);
+
+	/**
+	 * Returns true if the current flags are in the succubus list
+	 */
+	bool isSuccUBusRoomFlags() const;
 
 	/**
 	 * Get a description for the room
@@ -195,6 +203,21 @@ public:
 	 * Change the passenger class
 	 */
 	void changeLocation(int action);
+
+	/**
+	 * Sets a random destination in the flags
+	 */
+	void setRandomLocation(int classNum, bool flag);
+
+	/**
+	 * Gets the succubus number associated with a given room
+	 */
+	uint getSuccUBusNum(const CString &roomName) const;
+
+	/**
+	 * Gets the succubus room name associated with the current room flags
+	 */
+	CString getSuccUBusRoomName() const;
 };
 
 } // End of namespace Titanic


Commit: 5aff1d01b4088979e207c434476fa7ca3f6a644f
    https://github.com/scummvm/scummvm/commit/5aff1d01b4088979e207c434476fa7ca3f6a644f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:01-04:00

Commit Message:
TITANIC: Cleaning up mode and room flags fields on PET room glyphs

Changed paths:
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h



diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index a14258e..29a4688 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -114,10 +114,10 @@ void CPetRooms::load(SimpleFile *file, int param) {
 
 		for (int idx = 0; idx < count; ++idx) {
 			CPetRoomsGlyph *glyph = addGlyph(file->readNumber(), false);
-			glyph->set3C(file->readNumber());
+			glyph->setMode((RoomGlyphMode)file->readNumber());
 		}
 
-		_glyphItem.set34(file->readNumber());
+		_glyphItem.setMode((RoomGlyphMode)file->readNumber());
 		file->readNumber();
 		_field1C0 = file->readNumber();
 		_field1C4 = file->readNumber();
@@ -191,15 +191,15 @@ bool CPetRooms::setupControl(CPetControl *petControl) {
 }
 
 void CPetRooms::resetHighlight() {
-	_glyphItem.set34(fn1());
+	_glyphItem.setMode(fn1());
 	_glyphs.resetHighlight();
 	_glyphItem.updateTooltip();
 	areaChanged(PET_ROOMS);
 }
 
-int CPetRooms::fn1() {
+RoomGlyphMode CPetRooms::fn1() {
 	warning("TODO: CPetRooms::fn1");
-	return 0;
+	return RGM_0;
 }
 
 int CPetRooms::fn2(int val) {
@@ -230,4 +230,9 @@ void CPetRooms::addRoom(int roomNum) {
 	warning("TODO: CPetRooms::addRoom");
 }
 
+uint CPetRooms::mode1Flags() const {
+	CPetRoomsGlyph *glyph = _glyphs.findMode1();
+	return glyph ? glyph->getRoomFlags() : 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index 515c9fb..608940f 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -65,7 +65,7 @@ private:
 	 */
 	void resetHighlight();
 
-	int fn1();
+	RoomGlyphMode fn1();
 
 	void areaChanged(PetArea area);
 
@@ -73,6 +73,8 @@ private:
 	 * Adds a glyph to the list
 	 */
 	CPetRoomsGlyph *addGlyph(int val, bool highlight);
+
+	uint mode1Flags() const;
 public:
 	CPetRooms();
 
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index 57c6e85..71fdc56 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -27,13 +27,13 @@
 namespace Titanic {
 
 CPetRoomsGlyph::CPetRoomsGlyph() : CPetGlyph(),
-	_field34(0), _field38(0), _field3C(0),
+	_roomFlags(0), _field38(0), _mode(RGM_0),
 	_field40(nullptr), _field44(nullptr), _field48(nullptr), _field4C(nullptr),
 	_field50(nullptr), _field54(nullptr), _field58(nullptr), _field5C(nullptr) {
 }
 
-CPetRoomsGlyph::CPetRoomsGlyph(int val) : CPetGlyph(),
-	_field34(val), _field38(0), _field3C(0),
+CPetRoomsGlyph::CPetRoomsGlyph(uint flags) : CPetGlyph(),
+	_roomFlags(flags), _field38(0), _mode(RGM_0),
 	_field40(nullptr), _field44(nullptr), _field48(nullptr), _field4C(nullptr),
 	_field50(nullptr), _field54(nullptr), _field58(nullptr), _field5C(nullptr) {
 }
@@ -71,8 +71,8 @@ int CPetRoomsGlyph::proc29(const Point &pt) {
 }
 
 void CPetRoomsGlyph::save2(SimpleFile *file, int indent) const {
-	file->writeNumberLine(_field34, indent);
-	file->writeNumberLine(_field3C, indent);
+	file->writeNumberLine(_roomFlags, indent);
+	file->writeNumberLine(_mode, indent);
 }
 
 int CPetRoomsGlyph::proc33() {
@@ -92,4 +92,14 @@ void CPetRoomsGlyphs::save2(SimpleFile *file, int indent) const {
 		(*i)->save2(file, indent);
 }
 
+CPetRoomsGlyph *CPetRoomsGlyphs::findMode1() const {
+	for (const_iterator i = begin(); i != end(); ++i) {
+		CPetRoomsGlyph *glyph = static_cast<CPetRoomsGlyph *>(*i);
+		if (glyph->isMode1())
+			return glyph;
+	}
+
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index 3f37bdb..c48011f 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -27,11 +27,13 @@
 
 namespace Titanic {
 
+enum RoomGlyphMode { RGM_0 = 0, RGM_1 = 1, RGM_2 = 2 };
+
 class CPetRoomsGlyph : public CPetGlyph {
 protected:
-	int _field34;
+	uint _roomFlags;
 	int _field38;
-	int _field3C;
+	RoomGlyphMode _mode;
 	CGameObject *_field40;
 	CGameObject *_field44;
 	CGameObject *_field48;
@@ -42,13 +44,28 @@ protected:
 	CGameObject *_field5C;
 public:
 	CPetRoomsGlyph();
-	CPetRoomsGlyph(int val);
+	CPetRoomsGlyph(uint flags);
 
-	void set34(int val) { _field34 = val; }
+	/**
+	 * Set the room flags for the glyph
+	 */
+	void setFoomFlags(uint flags) { _roomFlags = flags; }
+
+	/**
+	 * Get the room flags for the glyph
+	 */
+	uint getRoomFlags() const { return _roomFlags; }
 
 	void set38(int val) { _field38 = val; }
 
-	void set3C(int val) { _field3C = val; }
+	/**
+	 * Sets the mode of the glyph
+	 */
+	void setMode(RoomGlyphMode mode) { _mode = mode; }
+
+	bool isModeValid() const { return _mode != RGM_0; }
+	bool isMode1() const { return _mode == RGM_1; }
+	bool isMode2() const { return _mode == RGM_2; }
 
 	/**
 	 * Setup the glyph
@@ -86,6 +103,8 @@ public:
 	 * Save the list
 	 */
 	void save2(SimpleFile *file, int indent) const;
+
+	CPetRoomsGlyph *findMode1() const;
 };
 
 } // End of namespace Titanic


Commit: 452274dae027933b2199cd26236f1a5e908c4275
    https://github.com/scummvm/scummvm/commit/452274dae027933b2199cd26236f1a5e908c4275
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:04-04:00

Commit Message:
TITANIC: Flesh out PET Rooms adding glyphs

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/npcs/deskbot.cpp
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index aa0de49..695a6d6 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -790,10 +790,10 @@ void CGameObject::dec54() {
 	getGameManager()->dec54();
 }
 
-void CGameObject::petAddRoom(int roomNum) {
+void CGameObject::petAddRandomRoom(int passClassNum) {
 	CPetControl *petControl = getPetControl();
 	if (petControl)
-		petControl->addRoom(roomNum);
+		petControl->addRandomRoom(passClassNum);
 }
 
 void CGameObject::lockMouse() {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 20729d5..bb6b161 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -149,7 +149,7 @@ protected:
 	/**
 	 * Adds a room to the room list
 	 */
-	void petAddRoom(int roomNum);
+	void petAddRandomRoom(int passClassNum);
 
 	/**
 	 * Locks/hides the mouse
diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp
index 18c1e2a..a52d7c7 100644
--- a/engines/titanic/npcs/deskbot.cpp
+++ b/engines/titanic/npcs/deskbot.cpp
@@ -178,16 +178,16 @@ bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) {
 		case 1:
 			petDisplayMsg("You have been upgraded to 1st Class status. Enjoy hugely.");
 			setPassengerClass(_classNum);
-			petAddRoom(_classNum);
+			petAddRandomRoom(_classNum);
 			break;
 		case 2:
 			petDisplayMsg("You have been upgraded to 2nd Class status. Enjoy.");
 			setPassengerClass(_classNum);
-			petAddRoom(_classNum);
+			petAddRandomRoom(_classNum);
 			break;
 		case 3:
 			setPassengerClass(3);
-			petAddRoom(_classNum);
+			petAddRandomRoom(_classNum);
 			break;
 		default:
 			break;
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index f7973e0..e7bf1ee 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -520,8 +520,8 @@ CString CPetControl::getFullViewName() {
 	return gameManager ? gameManager->getFullViewName() : CString();
 }
 
-void CPetControl::addRoom(int roomNum) {
-	_rooms.addRoom(roomNum);
+void CPetControl::addRandomRoom(int passClassNum) {
+	_rooms.addRandomRoom(passClassNum);
 }
 
 int CPetControl::roomFn2(int val) {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 758069e..652a6e8 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -307,9 +307,10 @@ public:
 	CString getFullViewName();
 
 	/**
-	 * Adds a room to the room list
+	 * Adds a random room to the room list
 	 */
-	void addRoom(int roomNum);
+	void addRandomRoom(int passClassNum);
+
 	int roomFn2(int val);
 
 	/**
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 29a4688..b98c68c 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -212,8 +212,45 @@ void CPetRooms::areaChanged(PetArea area) {
 		_petControl->makeDirty();
 }
 
-CPetRoomsGlyph *CPetRooms::addGlyph(int val, bool highlight) {
-	CPetRoomsGlyph *glyph = new CPetRoomsGlyph(val);
+void CPetRooms::addRandomRoom(int passClassNum) {
+	CPetRoomsGlyph *glyph = _glyphs.findMode1();
+	if (glyph)
+		glyph->setMode(RGM_2);
+
+	CRoomFlags roomFlags;
+	roomFlags.setRandomLocation(passClassNum, _field1D4);
+	if (addRoom(roomFlags, true)) {
+
+	}
+
+	warning("TODO: CPetRooms::addRoom");
+}
+
+CPetRoomsGlyph *CPetRooms::addRoom(uint roomFlags, bool highlight) {
+	// Ensure that we don't add room if the room is already present
+	if (_glyphs.hasFlags(roomFlags))
+		return nullptr;
+	
+	if (_glyphs.size() >= 32)
+		// Too many rooms already
+		return nullptr;
+
+	// Do a preliminary scan of the glyph list for any glyph that is
+	// no longer valid, and thus can be removed
+	for (CPetRoomsGlyphs::iterator i = _glyphs.begin(); i != _glyphs.end(); ++i) {
+		CPetRoomsGlyph *glyph = static_cast<CPetRoomsGlyph *>(*i);
+		if (!glyph->isModeValid()) {
+			_glyphs.erase(i);
+			break;
+		}
+	}
+
+	// Add the glyph
+	return addGlyph(roomFlags, highlight);
+}
+
+CPetRoomsGlyph *CPetRooms::addGlyph(uint roomFlags, bool highlight) {
+	CPetRoomsGlyph *glyph = new CPetRoomsGlyph(roomFlags);
 	if (!glyph->setup(_petControl, &_glyphs)) {
 		delete glyph;
 		return nullptr;
@@ -226,10 +263,6 @@ CPetRoomsGlyph *CPetRooms::addGlyph(int val, bool highlight) {
 	}
 }
 
-void CPetRooms::addRoom(int roomNum) {
-	warning("TODO: CPetRooms::addRoom");
-}
-
 uint CPetRooms::mode1Flags() const {
 	CPetRoomsGlyph *glyph = _glyphs.findMode1();
 	return glyph ? glyph->getRoomFlags() : 0;
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index 608940f..a8a83af 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -72,7 +72,12 @@ private:
 	/**
 	 * Adds a glyph to the list
 	 */
-	CPetRoomsGlyph *addGlyph(int val, bool highlight);
+	CPetRoomsGlyph *addRoom(uint roomFlags, bool highlight);
+
+	/**
+	 * Adds a glyph to the list
+	 */
+	CPetRoomsGlyph *addGlyph(uint roomFlags, bool highlight);
 
 	uint mode1Flags() const;
 public:
@@ -151,9 +156,9 @@ public:
 	virtual CGameObject *getBackground(int index);
 
 	/**
-	 * Adds a room to the room list
+	 * Adds a random room to the glyph list
 	 */
-	void addRoom(int roomNum);
+	void addRandomRoom(int passClassNum);
 
 	int fn2(int val);
 };
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index 71fdc56..1048180 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -102,4 +102,14 @@ CPetRoomsGlyph *CPetRoomsGlyphs::findMode1() const {
 	return nullptr;
 }
 
+CPetRoomsGlyph *CPetRoomsGlyphs::findGlyphByFlags(uint flags) const {
+	for (const_iterator i = begin(); i != end(); ++i) {
+		CPetRoomsGlyph *glyph = static_cast<CPetRoomsGlyph *>(*i);
+		if (glyph->getRoomFlags() == flags)
+			return glyph;
+	}
+
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index c48011f..1d6ded7 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -47,27 +47,6 @@ public:
 	CPetRoomsGlyph(uint flags);
 
 	/**
-	 * Set the room flags for the glyph
-	 */
-	void setFoomFlags(uint flags) { _roomFlags = flags; }
-
-	/**
-	 * Get the room flags for the glyph
-	 */
-	uint getRoomFlags() const { return _roomFlags; }
-
-	void set38(int val) { _field38 = val; }
-
-	/**
-	 * Sets the mode of the glyph
-	 */
-	void setMode(RoomGlyphMode mode) { _mode = mode; }
-
-	bool isModeValid() const { return _mode != RGM_0; }
-	bool isMode1() const { return _mode == RGM_1; }
-	bool isMode2() const { return _mode == RGM_2; }
-
-	/**
 	 * Setup the glyph
 	 */
 	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
@@ -94,6 +73,28 @@ public:
 	virtual int proc33();
 	
 	virtual void proc39();
+
+
+	/**
+	 * Set the room flags for the glyph
+	 */
+	void setFoomFlags(uint flags) { _roomFlags = flags; }
+
+	/**
+	 * Get the room flags for the glyph
+	 */
+	uint getRoomFlags() const { return _roomFlags; }
+
+	void set38(int val) { _field38 = val; }
+
+	/**
+	 * Sets the mode of the glyph
+	 */
+	void setMode(RoomGlyphMode mode) { _mode = mode; }
+
+	bool isModeValid() const { return _mode != RGM_0; }
+	bool isMode1() const { return _mode == RGM_1; }
+	bool isMode2() const { return _mode == RGM_2; }
 };
 
 class CPetRoomsGlyphs : public CPetGlyphs {
@@ -105,6 +106,17 @@ public:
 	void save2(SimpleFile *file, int indent) const;
 
 	CPetRoomsGlyph *findMode1() const;
+
+
+	/**
+	 * Finds a glyph in the list by it's room flags
+	 */
+	CPetRoomsGlyph *findGlyphByFlags(uint flags) const;
+
+	/**
+	 * Returns true if there's a glyph in the list with a given room flags
+	 */
+	bool hasFlags(uint flags) const { return findGlyphByFlags(flags) != nullptr; }
 };
 
 } // End of namespace Titanic


Commit: 5a328ce28f4edfe3da0c261d7abc884aa6af94a2
    https://github.com/scummvm/scummvm/commit/5a328ce28f4edfe3da0c261d7abc884aa6af94a2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:08-04:00

Commit Message:
TITANIC: Completed CPetRooms methods

Changed paths:
    engines/titanic/game/television.cpp
    engines/titanic/npcs/deskbot.cpp
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h
    engines/titanic/room_flags.cpp
    engines/titanic/room_flags.h



diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 5127712..a3f8ec3 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -277,10 +277,12 @@ bool CTelevision::TurnOn(CTurnOn *msg) {
 
 bool CTelevision::LightsMsg(CLightsMsg *msg) {
 	CPetControl *pet = getPetControl();
+	bool flag = false;
+
 	if (pet)
-		pet->fn4();
+		flag = pet->isRoom59706();
 
-	if (msg->_field8 || !_turnOn)
+	if (msg->_field8 || !flag)
 		_turnOn = true;
 
 	return true;
diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp
index a52d7c7..2af758b 100644
--- a/engines/titanic/npcs/deskbot.cpp
+++ b/engines/titanic/npcs/deskbot.cpp
@@ -197,7 +197,7 @@ bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) {
 		if (getPassengerClass() == 1) {
 			CPetControl *petControl = getPetControl();
 			if (petControl)
-				petControl->roomFn2(4);
+				petControl->changeLocationClass(4);
 		}
 		break;
 
@@ -205,7 +205,7 @@ bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) {
 		if (getPassengerClass() == 1) {
 			CPetControl *petControl = getPetControl();
 			if (petControl)
-				petControl->roomFn2(3);
+				petControl->changeLocationClass(3);
 		}
 		break;
 
@@ -213,7 +213,7 @@ bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) {
 		if (getPassengerClass() == 1) {
 			CPetControl *petControl = getPetControl();
 			if (petControl)
-				petControl->roomFn2(2);
+				petControl->changeLocationClass(2);
 		}
 		break;
 
@@ -221,7 +221,7 @@ bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) {
 		if (getPassengerClass() == 1) {
 			CPetControl *petControl = getPetControl();
 			if (petControl)
-				petControl->roomFn2(1);
+				petControl->changeLocationClass(1);
 		}
 		break;
 
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index e7bf1ee..45b5ac3 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -188,10 +188,6 @@ bool CPetControl::fn1(int val) {
 	return false;
 }
 
-void CPetControl::fn4() {
-	warning("TODO: CPetControl::fn4");
-}
-
 PetArea CPetControl::setArea(PetArea newArea) {
 	if (newArea == _currentArea || !isUnlocked())
 		return _currentArea;
@@ -520,14 +516,6 @@ CString CPetControl::getFullViewName() {
 	return gameManager ? gameManager->getFullViewName() : CString();
 }
 
-void CPetControl::addRandomRoom(int passClassNum) {
-	_rooms.addRandomRoom(passClassNum);
-}
-
-int CPetControl::roomFn2(int val) {
-	return _rooms.fn2(val);
-}
-
 void CPetControl::resetDials(int flag) {
 	if (flag == 1)
 		_conversations.resetDials(_activeNPCName);
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 652a6e8..c9056a7 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -166,8 +166,6 @@ public:
 
 	void fn3(CTreeItem *item);
 
-	void fn4();
-
 	/**
 	 * Sets the currently viewed area within the PET
 	 */
@@ -307,13 +305,6 @@ public:
 	CString getFullViewName();
 
 	/**
-	 * Adds a random room to the room list
-	 */
-	void addRandomRoom(int passClassNum);
-
-	int roomFn2(int val);
-
-	/**
 	 * Resets the dial display to reflect new values
 	 */
 	void resetDials(int flag = 1);
@@ -322,10 +313,136 @@ public:
 	void incC0() { ++_fieldC0; }
 	void decC0() { --_fieldC0; }
 
+	/* CPetRooms methods */
+
+	/**
+	 * Adds a random room to the room list
+	 */
+	void addRandomRoom(int passClassNum) {
+		_rooms.addRandomRoom(passClassNum);
+	}
+
+	/**
+	 * Change the current location passenger class
+	 */
+	bool changeLocationClass(int newClassNum) {
+		return _rooms.changeLocationClass(newClassNum);
+	}
+
+	/**
+	 * Returns true if the Rooms list has a room with the given flags
+	 */
+	bool hasRoomFlags() const {
+		return _rooms.hasRoomFlags(getRoomFlags());
+	}
+
+	uint getRoomFlags() const {
+		return _rooms.getRoomFlags();
+	}
+
+	/**
+	 * Set the current elevator number to use for room glyphs
+	 */
+	void setRoomsElevatorNum(int elevNum) {
+		_rooms.setElevatorNum(elevNum);
+	}
+
+	/**
+	 * Get the current elevator number used by room glyphs
+	 */
+	int getRoomsElevatorNum() const {
+		return _rooms.getElevatorNum();
+	}
+
+	/**
+	 * Set the current floor number to use for room glyphs
+	 */
+	void setRoomsFloorNum(int floorNum) {
+		_rooms.setFloorNum(floorNum);
+	}
+
+	/**
+	 * Get the current floor number used by room glyphs
+	 */
+	int getRoomsFloorNum() const {
+		return _rooms.getFloorNum();
+	}
+
+	/**
+	 * Set the current room number to use for room glyphs
+	 */
+	void setRoomsRoomNum(int roomNum) {
+		_rooms.setRoomNum(roomNum);
+	}
+
+	/**
+	 * Get the current floor number used by room glyphs
+	 */
+	int getRoomsRoomNum() const {
+		return _rooms.getRoomNum();
+	}
+
+	void setRooms1D0(int v) {
+		_rooms.set1D0(v);
+	}
+	int getRooms1D0() const {
+		return _rooms.get1D0();
+	}
+	void setRooms1CC(int v) {
+		_rooms.set1CC(v);
+	}
+	int getRooms1CC() const {
+		return _rooms.get1CC();
+	}
+
+	/**
+	 * Reset the highlight
+	 */
+	void resetRoomsHighlight() {
+		_rooms.resetHighlight();
+	}
+
+	int getRoomsMode1Flags() const {
+		return _rooms.mode1Flags();
+	}
+
+	uint getSpecialRoomFlags(const CString &name) {
+		return CRoomFlags::getSpecialRoomFlags(name);
+	}
+
 	/**
 	 * Get mail destination given the specified flags
 	 */
 	int getMailDest(const CRoomFlags &roomFlags) const;
+
+	bool testRooms5(uint roomFlags) {
+		return CRoomFlags(roomFlags).not5();
+	}
+
+	int getRoomsRoomNum1() const {
+		return _rooms.getMode1RoomNum();
+	}
+	int getRoomsFloorNum1() const {
+		return _rooms.getMode1FloorNum();
+	}
+	int getRoomsElevatorNum1() const {
+		return _rooms.getMode1ElevatorNum();
+	}
+
+	void setRooms1D4(int val) {
+		_rooms.set1D4(val);
+	}
+
+	bool isRoom59706() const {
+		return CRoomFlags(getRoomFlags()).is59706();
+	}
+
+	/**
+	 * Returns true if the passed room flags indicate the room has a succubus
+	 */
+	bool isSuccUBusRoom(const CRoomFlags &roomFlags) {
+		return roomFlags.isSuccUBusRoomFlags();
+	}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index b98c68c..9db5adc 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -30,7 +30,7 @@ CPetRooms::CPetRooms() :
 		_chevRightOnDim(nullptr), _chevRightOffDim(nullptr),
 		_chevLeftOnLit(nullptr), _chevLeftOffLit(nullptr),
 		_chevRightOnLit(nullptr), _chevRightOffLit(nullptr),
-		_field1C0(0), _field1C4(0), _field1C8(0), _field1CC(0),
+		_floorNum(0), _elevatorNum(0), _roomNum(0), _field1CC(0),
 		_field1D0(0), _field1D4(0) {
 }
 
@@ -95,7 +95,22 @@ bool CPetRooms::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
 }
 
 bool CPetRooms::checkDragEnd(CGameObject *item) {
-	warning("TODO: CPetRooms::checkDragEnd");
+	// Ignore any item drops except valid mail items
+	if (!item->_isMail)
+		return false;
+
+	uint roomFlags = item->_id;
+	CPetRoomsGlyph *glyph = _glyphs.findGlyphByFlags(roomFlags);
+	if (glyph) {
+		if (_glyphs.findGlyphByFlags(0)) {
+			_glyphs.highlight(glyph);
+			return false;
+		}
+
+		roomFlags = 0;
+	}
+
+	addRoom(roomFlags, true);
 	return false;
 }
 
@@ -119,9 +134,9 @@ void CPetRooms::load(SimpleFile *file, int param) {
 
 		_glyphItem.setMode((RoomGlyphMode)file->readNumber());
 		file->readNumber();
-		_field1C0 = file->readNumber();
-		_field1C4 = file->readNumber();
-		_field1C8 = file->readNumber();
+		_floorNum = file->readNumber();
+		_elevatorNum = file->readNumber();
+		_roomNum = file->readNumber();
 		_field1CC = file->readNumber();
 		_field1D0 = file->readNumber();
 		_field1D4 = file->readNumber();
@@ -135,9 +150,9 @@ void CPetRooms::postLoad() {
 void CPetRooms::save(SimpleFile *file, int indent) const {
 	_glyphs.save2(file, indent);
 	_glyphItem.save2(file, indent);
-	file->writeNumberLine(_field1C0, indent);
-	file->writeNumberLine(_field1C4, indent);
-	file->writeNumberLine(_field1C8, indent);
+	file->writeNumberLine(_floorNum, indent);
+	file->writeNumberLine(_elevatorNum, indent);
+	file->writeNumberLine(_roomNum, indent);
 	file->writeNumberLine(_field1CC, indent);
 	file->writeNumberLine(_field1D0, indent);
 	file->writeNumberLine(_field1D4, indent);
@@ -157,7 +172,26 @@ CPetText *CPetRooms::getText() {
 }
 
 CGameObject *CPetRooms::getBackground(int index) {
-	return nullptr;
+	switch (index) {
+	case 8:
+		return _chevLeftOnDim;
+	case 9:
+		return _chevLeftOffDim;
+	case 10:
+		return _chevLeftOnLit;
+	case 11:
+		return _chevLeftOffLit;
+	case 12:
+		return _chevRightOnDim;
+	case 13:
+		return _chevRightOffDim;
+	case 14:
+		return _chevRightOnLit;
+	case 15:
+		return _chevRightOffLit;
+	default:
+		return nullptr;
+	}
 }
 
 bool CPetRooms::setupControl(CPetControl *petControl) {
@@ -191,20 +225,54 @@ bool CPetRooms::setupControl(CPetControl *petControl) {
 }
 
 void CPetRooms::resetHighlight() {
-	_glyphItem.setMode(fn1());
+	_glyphItem.setRoomFlags(getRoomFlags());
 	_glyphs.resetHighlight();
 	_glyphItem.updateTooltip();
 	areaChanged(PET_ROOMS);
 }
 
-RoomGlyphMode CPetRooms::fn1() {
-	warning("TODO: CPetRooms::fn1");
-	return RGM_0;
-}
+uint CPetRooms::getRoomFlags() const {
+	CRoomFlags roomFlags;
+	CString roomName = _petControl->getRoomName();
+	
+	uint flags = roomFlags.getSpecialRoomFlags(roomName);
+	if (flags)
+		return flags;
+
+	int classNum = roomFlags.whatPassengerClass(_floorNum);
+	roomFlags.setPassengerClassBits(classNum);
+	roomFlags.setFloorNum(_floorNum);
+
+	switch (classNum) {
+	case 1:
+		roomFlags.setElevatorNum(_elevatorNum);
+		roomFlags.setRoomBits(_roomNum);
+		break;
+
+	case 2:
+		if (_roomNum > 0) {
+			if (_roomNum >= 3) {
+				roomFlags.setElevatorNum(_elevatorNum == 1 || _elevatorNum == 2 ? 1 : 3);
+			} else {
+				roomFlags.setElevatorNum(_elevatorNum == 1 || _elevatorNum == 2 ? 2 : 4);
+			}
+
+			roomFlags.setRoomBits(((_roomNum - 1) & 1) + (_field1CC > 1 ? 3 : 2));			
+		} else {
+			roomFlags.setRoomBits(0);
+		}
+		break;
 
-int CPetRooms::fn2(int val) {
-	warning("TODO: CPetRooms::fn2");
-	return 0;
+	case 3:
+		roomFlags.setElevatorNum(_elevatorNum);
+		roomFlags.setRoomBits(_roomNum + _field1CC * 6 - 6);
+		break;
+
+	default:
+		break;
+	}
+
+	return roomFlags.get();
 }
 
 void CPetRooms::areaChanged(PetArea area) {
@@ -219,11 +287,11 @@ void CPetRooms::addRandomRoom(int passClassNum) {
 
 	CRoomFlags roomFlags;
 	roomFlags.setRandomLocation(passClassNum, _field1D4);
-	if (addRoom(roomFlags, true)) {
-
+	glyph = addRoom(roomFlags, true);
+	if (glyph) {
+		glyph->setMode(RGM_1);
+		_glyphs.highlight(glyph);
 	}
-
-	warning("TODO: CPetRooms::addRoom");
 }
 
 CPetRoomsGlyph *CPetRooms::addRoom(uint roomFlags, bool highlight) {
@@ -268,4 +336,47 @@ uint CPetRooms::mode1Flags() const {
 	return glyph ? glyph->getRoomFlags() : 0;
 }
 
+bool CPetRooms::changeLocationClass(int newClassNum) {
+	CPetRoomsGlyph *glyph = _glyphs.findMode1();
+	if (!glyph)
+		return 0;
+
+	glyph->changeLocation(newClassNum);
+	return true;
+}
+
+bool CPetRooms::hasRoomFlags(uint roomFlags) const {
+	for (CPetRoomsGlyphs::const_iterator i = _glyphs.begin(); i != _glyphs.end(); ++i) {
+		const CPetRoomsGlyph *glyph = static_cast<const CPetRoomsGlyph *>(*i);
+		if (glyph->isModeValid() && glyph->getRoomFlags() == roomFlags)
+			return true;
+	}
+
+	return false;
+}
+
+int CPetRooms::getMode1RoomNum() const {
+	uint flags = mode1Flags();
+	if (!flags)
+		return 0;
+
+	return CRoomFlags(flags).getRoomNum();
+}
+
+int CPetRooms::getMode1FloorNum() const {
+	uint flags = mode1Flags();
+	if (!flags)
+		return 0;
+
+	return CRoomFlags(flags).getFloorNum();
+}
+
+int CPetRooms::getMode1ElevatorNum() const {
+	uint flags = mode1Flags();
+	if (!flags)
+		return 0;
+
+	return CRoomFlags(flags).getElevatorNum();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index a8a83af..1e7468a 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -43,9 +43,9 @@ private:
 	CGameObject *_chevRightOffLit;
 	CPetGfxElement _plinth;
 	CPetText _text;
-	int _field1C0;
-	int _field1C4;
-	int _field1C8;
+	int _floorNum;
+	int _elevatorNum;
+	int _roomNum;
 	int _field1CC;
 	int _field1D0;
 	int _field1D4;
@@ -60,13 +60,6 @@ private:
 	 */
 	Point getGlyphPos() const { return Point(509, 388); }
 
-	/**
-	 * Reset the highlight
-	 */
-	void resetHighlight();
-
-	RoomGlyphMode fn1();
-
 	void areaChanged(PetArea area);
 
 	/**
@@ -78,8 +71,6 @@ private:
 	 * Adds a glyph to the list
 	 */
 	CPetRoomsGlyph *addGlyph(uint roomFlags, bool highlight);
-
-	uint mode1Flags() const;
 public:
 	CPetRooms();
 
@@ -156,11 +147,47 @@ public:
 	virtual CGameObject *getBackground(int index);
 
 	/**
+	 * Reset the highlight
+	 */
+	void resetHighlight();
+
+	/**
 	 * Adds a random room to the glyph list
 	 */
 	void addRandomRoom(int passClassNum);
 
-	int fn2(int val);
+	/**
+	 * Change the current location passenger class
+	 */
+	bool changeLocationClass(int newClassNum);
+
+	/**
+	 * Returns true if a room glyph exists with the given flags
+	 */
+	bool hasRoomFlags(uint roomFlags) const;
+
+	int getMode1RoomNum() const;
+	int getMode1FloorNum() const;
+	int getMode1ElevatorNum() const;
+
+	/**
+	 * Gets room flags to use for glyphs
+	 */
+	uint getRoomFlags() const;
+
+	uint mode1Flags() const;
+
+	void setFloorNum(int floorNum) { _floorNum = floorNum; }
+	int getFloorNum() const { return _floorNum; }
+	void setElevatorNum(int elevNum) { _elevatorNum = elevNum; }
+	int getElevatorNum() const { return _elevatorNum; }
+	void setRoomNum(int roomNum) { _roomNum = roomNum; }
+	int getRoomNum() const { return _roomNum; }
+	void set1CC(int val) { _field1CC = val; }
+	int get1CC() const { return _field1CC; }
+	void set1D0(int val) { _field1D0 = val; }
+	int get1D0() const { return _field1D0; }
+	void set1D4(int val) { _field1D4 = val; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index 1048180..7860497 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -23,6 +23,7 @@
 #include "titanic/pet_control/pet_rooms_glyphs.h"
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/support/screen_manager.h"
+#include "titanic/room_flags.h"
 
 namespace Titanic {
 
@@ -83,6 +84,12 @@ void CPetRoomsGlyph::proc39() {
 
 }
 
+void CPetRoomsGlyph::changeLocation(int newClassNum) {
+	CRoomFlags roomFlags(_roomFlags);
+	roomFlags.changeLocation(newClassNum);
+	_roomFlags = roomFlags.get();
+}
+
 /*------------------------------------------------------------------------*/
 
 void CPetRoomsGlyphs::save2(SimpleFile *file, int indent) const {
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index 1d6ded7..98ddcc7 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -78,7 +78,7 @@ public:
 	/**
 	 * Set the room flags for the glyph
 	 */
-	void setFoomFlags(uint flags) { _roomFlags = flags; }
+	void setRoomFlags(uint flags) { _roomFlags = flags; }
 
 	/**
 	 * Get the room flags for the glyph
@@ -92,6 +92,8 @@ public:
 	 */
 	void setMode(RoomGlyphMode mode) { _mode = mode; }
 
+	void changeLocation(int newClassNum);
+
 	bool isModeValid() const { return _mode != RGM_0; }
 	bool isMode1() const { return _mode == RGM_1; }
 	bool isMode2() const { return _mode == RGM_2; }
diff --git a/engines/titanic/room_flags.cpp b/engines/titanic/room_flags.cpp
index b64b650..ac378e2 100644
--- a/engines/titanic/room_flags.cpp
+++ b/engines/titanic/room_flags.cpp
@@ -509,4 +509,11 @@ void CRoomFlags::setRandomLocation(int classNum, bool flag) {
 	} while (_data == 0x59706);
 }
 
+int CRoomFlags::whatPassengerClass(int floorNum) {
+	if (is2To19(floorNum))
+		return 1;
+
+	return is20To27(floorNum) ? 2 : 3;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/room_flags.h b/engines/titanic/room_flags.h
index 553e0a3..dfb7c89 100644
--- a/engines/titanic/room_flags.h
+++ b/engines/titanic/room_flags.h
@@ -33,8 +33,6 @@ private:
 private:
 	int getConditionally() const;
 
-	bool not5() const { return getConditionally() != 5; }
-
 	/**
 	 * Returns true if the current flags appear in the
 	 * list of transport rooms
@@ -51,11 +49,6 @@ private:
 	void setElevatorBits(uint val);
 
 	/**
-	 * Set the bits for the passenger class
-	 */
-	void setPassengerClassBits(uint val);
-
-	/**
 	 * Set the bits for the floor number
 	 */
 	void setFloorBits(uint val);
@@ -81,11 +74,9 @@ private:
 	 */
 	bool isTitania() const { return _data == 0x8A397; }
 
-	bool is59706() const { return _data == 0x59706; }
-
-	bool is2To19(uint v) const { return v >= 2 && v <= 19; }
-	bool is20To27(uint v) const { return v >= 20 && v <= 27; }
-	bool is28To38(uint v) const { return v >= 28 && v <= 38; }
+	static bool is2To19(uint v) { return v >= 2 && v <= 19; }
+	static bool is20To27(uint v) { return v >= 20 && v <= 27; }
+	static bool is28To38(uint v) { return v >= 28 && v <= 38; }
 public:
 	CRoomFlags() : _data(0) {}
 	CRoomFlags(uint data) : _data(data) {}
@@ -104,7 +95,7 @@ public:
 	/**
 	 * Gets the special flags for a transport or succubus room
 	 */
-	uint getSpecialRoomFlags(const CString &roomName);
+	static uint getSpecialRoomFlags(const CString &roomName);
 
 	/**
 	 * Returns true if the current flags are in the succubus list
@@ -144,6 +135,11 @@ public:
 	uint getPassengerClassBits() const;
 
 	/**
+	 * Set the bits for the passenger class
+	 */
+	void setPassengerClassBits(uint val);
+
+	/**
 	 * Gets the passenger class number
 	 */
 	uint getPassengerClassNum() const { return getPassengerClassBits(); }
@@ -218,6 +214,15 @@ public:
 	 * Gets the succubus room name associated with the current room flags
 	 */
 	CString getSuccUBusRoomName() const;
+
+	/**
+	 * Returns what passenger class a particular floor number belongs to
+	 */
+	static int whatPassengerClass(int floorNum);
+
+	bool not5() const { return getConditionally() != 5; }
+
+	bool is59706() const { return _data == 0x59706; }
 };
 
 } // End of namespace Titanic


Commit: 3fb8c888a76762160179f331b2df2d3fa967b242
    https://github.com/scummvm/scummvm/commit/3fb8c888a76762160179f331b2df2d3fa967b242
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:11-04:00

Commit Message:
TITANIC: Adding miscellaneous CGameObject & CPetControl methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 695a6d6..79ceb92 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -402,10 +402,10 @@ void CGameObject::petShowCursor() {
 		pet->showCursor();
 }
 
-void CGameObject::petFn3(CTreeItem *item) {
+void CGameObject::petSetRemoteTarget() {
 	CPetControl *pet = getPetControl();
 	if (pet)
-		pet->fn3(item);
+		pet->setRemoteTarget(this);
 }
 
 void CGameObject::playMovie(uint startFrame, uint endFrame, uint flags) {
@@ -1057,4 +1057,22 @@ void CGameObject::resetMail() {
 		mailMan->resetValue();
 }
 
+void CGameObject::petSetRooms1D0(int val) {
+	CPetControl *petControl = getPetControl();
+	if (petControl)
+		petControl->setRooms1D0(val);
+}
+
+int CGameObject::petGetRooms1D0() const {
+	CPetControl *petControl = getPetControl();
+	return petControl ? petControl->getRooms1D0() : 0;
+}
+
+void CGameObject::petAddRandomRoom(int passClassNum) {
+	CPetControl *petControl = getPetControl();
+	if (petControl)
+		petControl->addRandomRoom(passClassNum);
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index bb6b161..0a60704 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -141,17 +141,16 @@ protected:
 	 */
 	void petShowCursor();
 
-	void petFn3(CTreeItem *item);
+	/**
+	 * Set the remote target in the PET to this object
+	 */
+	void petSetRemoteTarget();
+
 	void incState38();
 	void inc54();
 	void dec54();
 
 	/**
-	 * Adds a room to the room list
-	 */
-	void petAddRandomRoom(int passClassNum);
-
-	/**
 	 * Locks/hides the mouse
 	 */
 	void lockMouse();
@@ -565,6 +564,15 @@ public:
 	 * Sets up credits text
 	 */
 	void createCredits();
+
+	void petSetRooms1D0(int val);
+
+	int petGetRooms1D0() const;
+
+	/**
+	 * Adds a random room to the pET
+	 */
+	void petAddRandomRoom(int passClassNum);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 45b5ac3..802e0ad 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -178,9 +178,14 @@ void CPetControl::enterRoom(CRoomItem *room) {
 	_remote.enterRoom(room);
 }
 
-void CPetControl::clear() {
+void CPetControl::resetRemoteTarget() {
 	_remoteTarget = nullptr;
-	_string2.clear();
+	_remoteTargetName.clear();
+}
+
+void CPetControl::resetActiveNPC() {
+	_activeNPC = nullptr;
+	_activeNPCName = "";
 }
 
 bool CPetControl::fn1(int val) {
@@ -219,12 +224,12 @@ void CPetControl::highlightGlyph(int id) {
 	_sections[_currentArea]->highlight(id);
 }
 
-void CPetControl::fn3(CTreeItem *item) {
+void CPetControl::setRemoteTarget(CGameObject *item) {
 	_remoteTarget = item;
 	if (item)
-		_string2 = item->getName();
+		_remoteTargetName = item->getName();
 	else
-		_string2.clear();
+		_remoteTargetName.clear();
 }
 
 CRoomItem *CPetControl::getHiddenRoom() {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index c9056a7..3881bda 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -63,7 +63,7 @@ private:
 	CPetMessage _message;
 	CPetFrame _frame;
 	CString _activeNPCName;
-	CString _string2;
+	CString _remoteTargetName;
 	CRoomItem *_hiddenRoom;
 	Rect _drawBounds;
 	PetEventInfo _timers[2];
@@ -112,7 +112,7 @@ protected:
 public:
 	PetArea _currentArea;
 	CTreeItem *_activeNPC;
-	CTreeItem *_remoteTarget;
+	CGameObject *_remoteTarget;
 public:
 	CLASSDEF
 	CPetControl();
@@ -158,13 +158,21 @@ public:
 	void enterRoom(CRoomItem *room);
 
 	/**
-	 * Called to clear the PET display
+	 * Called to reset the remote target
 	 */
-	void clear();
+	void resetRemoteTarget();
+
+	/**
+	 * Resets the Active NPC
+	 */
+	void resetActiveNPC();
 
 	bool fn1(int val);
 
-	void fn3(CTreeItem *item);
+	/**
+	 * Set the remote target
+	 */
+	void setRemoteTarget(CGameObject *item);
 
 	/**
 	 * Sets the currently viewed area within the PET


Commit: 54eac84dc5051c9833ea96f0be6c7b44ba262817
    https://github.com/scummvm/scummvm/commit/54eac84dc5051c9833ea96f0be6c7b44ba262817
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:15-04:00

Commit Message:
TITANIC: Fix compilation issues

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/game/television.cpp
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 79ceb92..f0fd08a 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -790,12 +790,6 @@ void CGameObject::dec54() {
 	getGameManager()->dec54();
 }
 
-void CGameObject::petAddRandomRoom(int passClassNum) {
-	CPetControl *petControl = getPetControl();
-	if (petControl)
-		petControl->addRandomRoom(passClassNum);
-}
-
 void CGameObject::lockMouse() {
 	CGameManager *gameMan = getGameManager();
 	gameMan->lockInputHandler();
@@ -897,7 +891,7 @@ void CGameObject::checkPlayMovie(const CString &name, int flags) {
 void CGameObject::clearPet() const {
 	CPetControl *petControl = getPetControl();
 	if (petControl)
-		petControl->clear();
+		petControl->resetActiveNPC();
 }
 
 CPetControl *CGameObject::getPetControl() const {
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index a3f8ec3..4d8e3f2 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -141,7 +141,7 @@ bool CTelevision::ChangeSeasonMsg(CChangeSeasonMsg *msg) {
 bool CTelevision::EnterViewMsg(CEnterViewMsg *msg) {
 	setPetArea(PET_REMOTE);
 	petHighlightGlyph(GLYPH_TELEVISION_CONTROL);
-	petFn3(0);
+	petSetRemoteTarget();
 	setVisible(0);
 	_fieldE0 = 1;
 
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 802e0ad..22b513e 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -59,7 +59,7 @@ void CPetControl::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(0, indent);
 	file->writeNumberLine(_currentArea, indent);
 	file->writeQuotedLine(_activeNPCName, indent);
-	file->writeQuotedLine(_string2, indent);
+	file->writeQuotedLine(_remoteTargetName, indent);
 
 	saveAreas(file, indent);
 	CGameObject::save(file, indent);
@@ -72,7 +72,7 @@ void CPetControl::load(SimpleFile *file) {
 	if (!val) {
 		_currentArea = (PetArea)file->readNumber();
 		_activeNPCName = file->readString();
-		_string2 = file->readString();
+		_remoteTargetName = file->readString();
 		
 		loadAreas(file, 0);
 	}
@@ -151,8 +151,8 @@ void CPetControl::postLoad() {
 
 	if (!_activeNPCName.empty() && root)
 		_activeNPC = root->findByName(_activeNPCName);
-	if (!_string2.empty() && root)
-		_remoteTarget = root->findByName(_string2);
+	if (!_remoteTargetName.empty() && root)
+		_remoteTarget = static_cast<CGameObject *>(root->findByName(_remoteTargetName));
 
 	setArea(_currentArea);
 	loaded();
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index 7860497..9ecaefb 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -80,8 +80,10 @@ int CPetRoomsGlyph::proc33() {
 	return 1;
 }
 
-void CPetRoomsGlyph::proc39() {
-
+void CPetRoomsGlyph::loadFlags(SimpleFile *file, int val) {
+	if (!val) {
+		_roomFlags = file->readNumber();
+	}
 }
 
 void CPetRoomsGlyph::changeLocation(int newClassNum) {
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index 98ddcc7..bed167f 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -24,6 +24,7 @@
 #define TITANIC_PET_ROOMS_GLYPHS_H
 
 #include "titanic/pet_control/pet_glyphs.h"
+#include "titanic/support/simple_file.h"
 
 namespace Titanic {
 
@@ -71,9 +72,11 @@ public:
 	virtual void save2(SimpleFile *file, int indent) const;
 	
 	virtual int proc33();
-	
-	virtual void proc39();
 
+	/**
+	 * Loads flags for the glyph
+	 */
+	virtual void loadFlags(SimpleFile *file, int val);
 
 	/**
 	 * Set the room flags for the glyph


Commit: f7d6db05e849855cbd17a60c3bbc3b1e96d1453a
    https://github.com/scummvm/scummvm/commit/f7d6db05e849855cbd17a60c3bbc3b1e96d1453a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:18-04:00

Commit Message:
TITANIC: Adding Pet Room glyph methods

Changed paths:
    engines/titanic/events.h
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h



diff --git a/engines/titanic/events.h b/engines/titanic/events.h
index 4cbba17..4638056 100644
--- a/engines/titanic/events.h
+++ b/engines/titanic/events.h
@@ -48,7 +48,7 @@ private:
 	uint32 _priorMiddleDownTime;
 	uint32 _priorRightDownTime;
 	Common::Point _mousePos;
-	int _specialButtons;
+	uint _specialButtons;
 
 	/**
 	 * Check whether it's time to display the next screen frame
@@ -108,6 +108,8 @@ public:
 	 * Sleep for a specified period of time
 	 */
 	void sleep(uint time);
+
+	uint getSpecialButtons() const { return _specialButtons; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 5dc5013..f0b9ef1 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -178,7 +178,7 @@ public:
 	/**
 	 *
 	 */
-	virtual void proc28(const Point &pt) {}
+	virtual void proc28(const Point &topLeft, const Point &pt) {}
 	
 	virtual int proc29(const Point &pt) { return 0; }
 
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index 9ecaefb..de06e02 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -21,9 +21,11 @@
  */
 
 #include "titanic/pet_control/pet_rooms_glyphs.h"
+#include "titanic/pet_control/pet_control.h"
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/support/screen_manager.h"
 #include "titanic/room_flags.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -63,11 +65,36 @@ void CPetRoomsGlyph::drawAt(CScreenManager *screenManager, const Point &pt) {
 	warning("TODO: CPetRoomsGlyph::drawAt");
 }
 
-void CPetRoomsGlyph::proc28(const Point &pt) {
+void CPetRoomsGlyph::proc28(const Point &topLeft, const Point &pt) {
+	if (isModeValid()) {
+		bool isShiftPressed = g_vm->_events->getSpecialButtons() & MK_SHIFT;
 
+		if (isShiftPressed) {
+			int selection = getSelection(topLeft, pt);
+			if (selection >= 0)
+				_roomFlags |= 1 << selection;
+		}
+
+		updateTooltip();
+	}
 }
 
 int CPetRoomsGlyph::proc29(const Point &pt) {
+	bool isShiftPressed = g_vm->_events->getSpecialButtons() & MK_SHIFT;
+	CPetControl *petControl = getPetControl();
+
+	if (!isShiftPressed && petControl) {
+		CGameObject *chevron = petControl->getHiddenObject("3PetChevron");
+
+		if (chevron) {
+			chevron->_id = _roomFlags;
+			chevron->_isMail = _field38;
+//			petControl->removeFromInventory(chevon);
+//			chevron->loadSurface();
+			// TODO
+		}
+	}
+
 	return 0; 
 }
 
@@ -92,6 +119,28 @@ void CPetRoomsGlyph::changeLocation(int newClassNum) {
 	_roomFlags = roomFlags.get();
 }
 
+int CPetRoomsGlyph::getSelection(const Point &topLeft, const Point &pt) {
+	Rect rects[4] = {
+		Rect(topLeft.x, topLeft.y, topLeft.x + 13, topLeft.y + 10),
+		Rect(topLeft.x + 13, topLeft.y, topLeft.x + 26, topLeft.y + 10),
+		Rect(topLeft.x + 26, topLeft.y, topLeft.x + 39, topLeft.y + 10),
+		Rect(topLeft.x + 39, topLeft.y, topLeft.x + 52, topLeft.y + 10)
+	};
+
+	for (int idx = 0, btnIndex = 19; idx < 5; ++idx, btnIndex -= 4) {
+		// Iterate through each of the four rects, seeing if there's a match.
+		// If not, move it down to the next row for the next loop iteration
+		for (int i = 0; i < 4; ++i) {
+			if (rects[i].contains(pt))
+				return btnIndex - i;
+			
+			rects[i].translate(0, 10);
+		}
+	}
+
+	return -1;
+}
+
 /*------------------------------------------------------------------------*/
 
 void CPetRoomsGlyphs::save2(SimpleFile *file, int indent) const {
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index bed167f..cb937ec 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -31,7 +31,7 @@ namespace Titanic {
 enum RoomGlyphMode { RGM_0 = 0, RGM_1 = 1, RGM_2 = 2 };
 
 class CPetRoomsGlyph : public CPetGlyph {
-protected:
+private:
 	uint _roomFlags;
 	int _field38;
 	RoomGlyphMode _mode;
@@ -43,6 +43,12 @@ protected:
 	CGameObject *_field54;
 	CGameObject *_field58;
 	CGameObject *_field5C;
+private:
+	/**
+	 * Find the selected button under the given point, based on the buttons
+	 * starting at a designated top/left position
+	 */
+	int getSelection(const Point &topLeft, const Point &pt);
 public:
 	CPetRoomsGlyph();
 	CPetRoomsGlyph(uint flags);
@@ -65,7 +71,7 @@ public:
 	/**
 	 * 
 	 */
-	virtual void proc28(const Point &pt);
+	virtual void proc28(const Point &topLeft, const Point &pt);
 
 	virtual int proc29(const Point &pt);
 


Commit: 5b98885f8797d5c36336a22a9399611b11a3715f
    https://github.com/scummvm/scummvm/commit/5b98885f8797d5c36336a22a9399611b11a3715f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:22-04:00

Commit Message:
TITANIC: Figured out PET Room Glyph modes

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/npcs/deskbot.cpp
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_inventory_glyphs.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index f0fd08a..735caad 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -1062,11 +1062,10 @@ int CGameObject::petGetRooms1D0() const {
 	return petControl ? petControl->getRooms1D0() : 0;
 }
 
-void CGameObject::petAddRandomRoom(int passClassNum) {
+void CGameObject::reassignRoom(int passClassNum) {
 	CPetControl *petControl = getPetControl();
 	if (petControl)
-		petControl->addRandomRoom(passClassNum);
+		petControl->reassignRoom(passClassNum);
 }
 
-
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 0a60704..059b705 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -271,11 +271,6 @@ protected:
 	void endTalking(CTrueTalkNPC *npc, uint id, CViewItem *view = nullptr);
 
 	/**
-	 * Load the surface
-	 */
-	void loadSurface();
-
-	/**
 	 * Change the view
 	 */
 	bool changeView(const CString &viewName, const CString &clipName);
@@ -529,6 +524,11 @@ public:
 	void loadFrame(int frameNumber);
 
 	/**
+	 * Load the surface
+	 */
+	void loadSurface();
+
+	/**
 	 * Marks the area occupied by the object as dirty, requiring re-rendering
 	 */
 	void makeDirty();
@@ -570,9 +570,9 @@ public:
 	int petGetRooms1D0() const;
 
 	/**
-	 * Adds a random room to the pET
+	 * Gives the player a new assigned room in the specified passenger class
 	 */
-	void petAddRandomRoom(int passClassNum);
+	void reassignRoom(int passClassNum);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp
index 2af758b..eb42a8e 100644
--- a/engines/titanic/npcs/deskbot.cpp
+++ b/engines/titanic/npcs/deskbot.cpp
@@ -178,16 +178,16 @@ bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) {
 		case 1:
 			petDisplayMsg("You have been upgraded to 1st Class status. Enjoy hugely.");
 			setPassengerClass(_classNum);
-			petAddRandomRoom(_classNum);
+			reassignRoom(_classNum);
 			break;
 		case 2:
 			petDisplayMsg("You have been upgraded to 2nd Class status. Enjoy.");
 			setPassengerClass(_classNum);
-			petAddRandomRoom(_classNum);
+			reassignRoom(_classNum);
 			break;
 		case 3:
 			setPassengerClass(3);
-			petAddRandomRoom(_classNum);
+			reassignRoom(_classNum);
 			break;
 		default:
 			break;
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 22b513e..5de87cd 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -376,7 +376,7 @@ CGameObject *CPetControl::getNextObject(CGameObject *prior) const {
 	return static_cast<CGameObject *>(prior->getNextSibling());
 }
 
-void CPetControl::addToInventory(CCarry *item) {
+void CPetControl::addToInventory(CGameObject *item) {
 	item->detach();
 
 	if (item->getName() == "CarryParcel") {
@@ -403,7 +403,7 @@ void CPetControl::addToInventory(CCarry *item) {
 	msg.execute(item);
 }
 
-void CPetControl::removeFromInventory(CCarry *item, CTreeItem *newParent,
+void CPetControl::removeFromInventory(CGameObject *item, CTreeItem *newParent,
 		bool refreshUI, bool sendMsg) {
 	if (item && newParent) {
 		item->detach();
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 3881bda..8093152 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -251,12 +251,12 @@ public:
 	/**
 	 * Adds an item to the PET inventory
 	 */
-	void addToInventory(CCarry *item);
+	void addToInventory(CGameObject *item);
 
 	/**
 	 * Remove an item from the inventory
 	 */
-	void removeFromInventory(CCarry *item, CTreeItem *newParent,
+	void removeFromInventory(CGameObject *item, CTreeItem *newParent,
 		bool refreshUI = true, bool sendMsg = true);
 
 	/**
@@ -324,10 +324,10 @@ public:
 	/* CPetRooms methods */
 
 	/**
-	 * Adds a random room to the room list
+	 * Gives the player a new assigned room in the specified passenger class
 	 */
-	void addRandomRoom(int passClassNum) {
-		_rooms.addRandomRoom(passClassNum);
+	void reassignRoom(int passClassNum) {
+		_rooms.reassignRoom(passClassNum);
 	}
 
 	/**
@@ -410,8 +410,8 @@ public:
 		_rooms.resetHighlight();
 	}
 
-	int getRoomsMode1Flags() const {
-		return _rooms.mode1Flags();
+	int getAssignedRoomFlags() const {
+		return _rooms.getAssignedRoomFlags();
 	}
 
 	uint getSpecialRoomFlags(const CString &name) {
@@ -427,14 +427,25 @@ public:
 		return CRoomFlags(roomFlags).not5();
 	}
 
-	int getRoomsRoomNum1() const {
-		return _rooms.getMode1RoomNum();
+	/**
+	 * Returns the room number for the player's currently assigned room
+	 */
+	int getAssignedRoomNum() const {
+		return _rooms.getAssignedRoomNum();
 	}
-	int getRoomsFloorNum1() const {
-		return _rooms.getMode1FloorNum();
+
+	/**
+	 * Returns the floor number for the player's currently assigned room
+	 */
+	int getAssignedFloorNum() const {
+		return _rooms.getAssignedFloorNum();
 	}
+
+	/**
+	 * Returns the elevator number for the player's currently assigned room
+	 */
 	int getRoomsElevatorNum1() const {
-		return _rooms.getMode1ElevatorNum();
+		return _rooms.getAssignedElevatorNum();
 	}
 
 	void setRooms1D4(int val) {
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 1ea7806..37a7342 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -128,7 +128,7 @@ void CPetInventory::change(CCarry *item) {
 	}
 }
 
-void CPetInventory::itemRemoved(CCarry *item) {
+void CPetInventory::itemRemoved(CGameObject *item) {
 	if (item) {
 		CInventoryGlyphAction action(item, ACTION_REMOVED);
 		_items.change(&action);
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 70bcc12..58e6bd9 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -127,7 +127,7 @@ public:
 	/**
 	 * Called when an item has been removed from the PET
 	 */
-	void itemRemoved(CCarry *item);
+	void itemRemoved(CGameObject *item);
 
 	/**
 	 * Called when the items under the PET have changed
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h
index 190bce7..91b1e5e 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.h
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.h
@@ -61,9 +61,9 @@ public:
 
 class CInventoryGlyphAction : public CGlyphAction {
 public:
-	CCarry *_item;
+	CGameObject *_item;
 public:
-	CInventoryGlyphAction(CCarry *item, GlyphActionMode mode) : 
+	CInventoryGlyphAction(CGameObject *item, GlyphActionMode mode) : 
 		CGlyphAction(mode), _item(item) {}
 };
 
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 9db5adc..6f34ee5 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -280,16 +280,18 @@ void CPetRooms::areaChanged(PetArea area) {
 		_petControl->makeDirty();
 }
 
-void CPetRooms::addRandomRoom(int passClassNum) {
-	CPetRoomsGlyph *glyph = _glyphs.findMode1();
+void CPetRooms::reassignRoom(int passClassNum) {
+	CPetRoomsGlyph *glyph = _glyphs.findAssignedRoom();
 	if (glyph)
-		glyph->setMode(RGM_2);
+		// Flag the old assigned room as no longer assigned
+		glyph->setMode(RGM_PREV_ASSIGNED_ROOM);
 
 	CRoomFlags roomFlags;
 	roomFlags.setRandomLocation(passClassNum, _field1D4);
 	glyph = addRoom(roomFlags, true);
 	if (glyph) {
-		glyph->setMode(RGM_1);
+		// Flag the new room as assigned to the player, and highlight it
+		glyph->setMode(RGM_ASSIGNED_ROOM);
 		_glyphs.highlight(glyph);
 	}
 }
@@ -307,7 +309,7 @@ CPetRoomsGlyph *CPetRooms::addRoom(uint roomFlags, bool highlight) {
 	// no longer valid, and thus can be removed
 	for (CPetRoomsGlyphs::iterator i = _glyphs.begin(); i != _glyphs.end(); ++i) {
 		CPetRoomsGlyph *glyph = static_cast<CPetRoomsGlyph *>(*i);
-		if (!glyph->isModeValid()) {
+		if (!glyph->isAssigned()) {
 			_glyphs.erase(i);
 			break;
 		}
@@ -331,13 +333,8 @@ CPetRoomsGlyph *CPetRooms::addGlyph(uint roomFlags, bool highlight) {
 	}
 }
 
-uint CPetRooms::mode1Flags() const {
-	CPetRoomsGlyph *glyph = _glyphs.findMode1();
-	return glyph ? glyph->getRoomFlags() : 0;
-}
-
 bool CPetRooms::changeLocationClass(int newClassNum) {
-	CPetRoomsGlyph *glyph = _glyphs.findMode1();
+	CPetRoomsGlyph *glyph = _glyphs.findAssignedRoom();
 	if (!glyph)
 		return 0;
 
@@ -348,31 +345,36 @@ bool CPetRooms::changeLocationClass(int newClassNum) {
 bool CPetRooms::hasRoomFlags(uint roomFlags) const {
 	for (CPetRoomsGlyphs::const_iterator i = _glyphs.begin(); i != _glyphs.end(); ++i) {
 		const CPetRoomsGlyph *glyph = static_cast<const CPetRoomsGlyph *>(*i);
-		if (glyph->isModeValid() && glyph->getRoomFlags() == roomFlags)
+		if (glyph->isAssigned() && glyph->getRoomFlags() == roomFlags)
 			return true;
 	}
 
 	return false;
 }
 
-int CPetRooms::getMode1RoomNum() const {
-	uint flags = mode1Flags();
+uint CPetRooms::getAssignedRoomFlags() const {
+	CPetRoomsGlyph *glyph = _glyphs.findAssignedRoom();
+	return glyph ? glyph->getRoomFlags() : 0;
+}
+
+int CPetRooms::getAssignedRoomNum() const {
+	uint flags = getAssignedRoomFlags();
 	if (!flags)
 		return 0;
 
 	return CRoomFlags(flags).getRoomNum();
 }
 
-int CPetRooms::getMode1FloorNum() const {
-	uint flags = mode1Flags();
+int CPetRooms::getAssignedFloorNum() const {
+	uint flags = getAssignedRoomFlags();
 	if (!flags)
 		return 0;
 
 	return CRoomFlags(flags).getFloorNum();
 }
 
-int CPetRooms::getMode1ElevatorNum() const {
-	uint flags = mode1Flags();
+int CPetRooms::getAssignedElevatorNum() const {
+	uint flags = getAssignedRoomFlags();
 	if (!flags)
 		return 0;
 
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index 1e7468a..b39587a 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -152,9 +152,9 @@ public:
 	void resetHighlight();
 
 	/**
-	 * Adds a random room to the glyph list
+	 * Gives the player a new assigned room in the specified passenger class
 	 */
-	void addRandomRoom(int passClassNum);
+	void reassignRoom(int passClassNum);
 
 	/**
 	 * Change the current location passenger class
@@ -166,17 +166,31 @@ public:
 	 */
 	bool hasRoomFlags(uint roomFlags) const;
 
-	int getMode1RoomNum() const;
-	int getMode1FloorNum() const;
-	int getMode1ElevatorNum() const;
+	/**
+	 * Returns the room flags for the player's currently assigned room
+	 */
+	uint getAssignedRoomFlags() const;
+
+	/**
+	 * Returns the room number for the player's currently assigned room
+	 */
+	int getAssignedRoomNum() const;
+
+	/**
+	 * Returns the floor number for the player's currently assigned room
+	 */
+	int getAssignedFloorNum() const;
+
+	/**
+	 * Returns the elevator number for the player's currently assigned room
+	 */
+	int getAssignedElevatorNum() const;
 
 	/**
 	 * Gets room flags to use for glyphs
 	 */
 	uint getRoomFlags() const;
 
-	uint mode1Flags() const;
-
 	void setFloorNum(int floorNum) { _floorNum = floorNum; }
 	int getFloorNum() const { return _floorNum; }
 	void setElevatorNum(int elevNum) { _elevatorNum = elevNum; }
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index de06e02..d6f13c3 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -30,13 +30,13 @@
 namespace Titanic {
 
 CPetRoomsGlyph::CPetRoomsGlyph() : CPetGlyph(),
-	_roomFlags(0), _field38(0), _mode(RGM_0),
+	_roomFlags(0), _field38(0), _mode(RGM_UNASSIGNED),
 	_field40(nullptr), _field44(nullptr), _field48(nullptr), _field4C(nullptr),
 	_field50(nullptr), _field54(nullptr), _field58(nullptr), _field5C(nullptr) {
 }
 
 CPetRoomsGlyph::CPetRoomsGlyph(uint flags) : CPetGlyph(),
-	_roomFlags(flags), _field38(0), _mode(RGM_0),
+	_roomFlags(flags), _field38(0), _mode(RGM_UNASSIGNED),
 	_field40(nullptr), _field44(nullptr), _field48(nullptr), _field4C(nullptr),
 	_field50(nullptr), _field54(nullptr), _field58(nullptr), _field5C(nullptr) {
 }
@@ -66,7 +66,7 @@ void CPetRoomsGlyph::drawAt(CScreenManager *screenManager, const Point &pt) {
 }
 
 void CPetRoomsGlyph::proc28(const Point &topLeft, const Point &pt) {
-	if (isModeValid()) {
+	if (isAssigned()) {
 		bool isShiftPressed = g_vm->_events->getSpecialButtons() & MK_SHIFT;
 
 		if (isShiftPressed) {
@@ -89,8 +89,10 @@ int CPetRoomsGlyph::proc29(const Point &pt) {
 		if (chevron) {
 			chevron->_id = _roomFlags;
 			chevron->_isMail = _field38;
-//			petControl->removeFromInventory(chevon);
-//			chevron->loadSurface();
+			petControl->removeFromInventory(chevron, false, false);
+			chevron->loadSurface();
+
+			warning("TODO: CPetRoomsGlyph::proc29");
 			// TODO
 		}
 	}
@@ -98,6 +100,24 @@ int CPetRoomsGlyph::proc29(const Point &pt) {
 	return 0; 
 }
 
+void CPetRoomsGlyph::getTooltip(CPetText *text) {
+	CRoomFlags roomFlags(_roomFlags);
+	CPetSection *owner = getPetSection();
+
+	CString msg;
+	if (isCurrentlyAssigned()) {
+		msg = "Your assigned room: ";
+	} else if (isPreviouslyAssigned()) {
+		msg = "A previously assigned room: ";
+	} else if (!_field38) {
+		msg = "Saved Chevron: ";
+	} else if (_field38 == 1 && getRoomFlags() == _roomFlags) {
+		msg = "Current location: ";
+	}
+
+	// TODO: More stuff
+}
+
 void CPetRoomsGlyph::save2(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_roomFlags, indent);
 	file->writeNumberLine(_mode, indent);
@@ -150,10 +170,10 @@ void CPetRoomsGlyphs::save2(SimpleFile *file, int indent) const {
 		(*i)->save2(file, indent);
 }
 
-CPetRoomsGlyph *CPetRoomsGlyphs::findMode1() const {
+CPetRoomsGlyph *CPetRoomsGlyphs::findAssignedRoom() const {
 	for (const_iterator i = begin(); i != end(); ++i) {
 		CPetRoomsGlyph *glyph = static_cast<CPetRoomsGlyph *>(*i);
-		if (glyph->isMode1())
+		if (glyph->isCurrentlyAssigned())
 			return glyph;
 	}
 
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index cb937ec..574403b 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -28,7 +28,9 @@
 
 namespace Titanic {
 
-enum RoomGlyphMode { RGM_0 = 0, RGM_1 = 1, RGM_2 = 2 };
+enum RoomGlyphMode {
+	RGM_UNASSIGNED = 0, RGM_ASSIGNED_ROOM = 1, RGM_PREV_ASSIGNED_ROOM = 2
+};
 
 class CPetRoomsGlyph : public CPetGlyph {
 private:
@@ -75,6 +77,11 @@ public:
 
 	virtual int proc29(const Point &pt);
 
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+
 	virtual void save2(SimpleFile *file, int indent) const;
 	
 	virtual int proc33();
@@ -103,9 +110,20 @@ public:
 
 	void changeLocation(int newClassNum);
 
-	bool isModeValid() const { return _mode != RGM_0; }
-	bool isMode1() const { return _mode == RGM_1; }
-	bool isMode2() const { return _mode == RGM_2; }
+	/**
+	 * Returns true if the room is either currently or previously assigned
+	 */
+	bool isAssigned() const { return _mode != RGM_UNASSIGNED; }
+	
+	/**
+	 * Returns true if the room is the one currently assigned to the player
+	 */
+	bool isCurrentlyAssigned() const { return _mode == RGM_ASSIGNED_ROOM; }
+	
+	/**
+	 * Returns true if the room was previously assigned to the player
+	 */
+	bool isPreviouslyAssigned() const { return _mode == RGM_PREV_ASSIGNED_ROOM; }
 };
 
 class CPetRoomsGlyphs : public CPetGlyphs {
@@ -116,8 +134,10 @@ public:
 	 */
 	void save2(SimpleFile *file, int indent) const;
 
-	CPetRoomsGlyph *findMode1() const;
-
+	/**
+	 * Returns the glyph for hte player's assigned room
+	 */
+	CPetRoomsGlyph *findAssignedRoom() const;
 
 	/**
 	 * Finds a glyph in the list by it's room flags


Commit: fd2fd2cdc5e730b43510d2a6b866a9aa67c3c7d5
    https://github.com/scummvm/scummvm/commit/fd2fd2cdc5e730b43510d2a6b866a9aa67c3c7d5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:25-04:00

Commit Message:
TITANIC: Added PET Room Glyph drawing

Changed paths:
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h



diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 6f34ee5..34554eb 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -56,7 +56,7 @@ bool CPetRooms::reset() {
 void CPetRooms::draw(CScreenManager *screenManager) {
 	_petControl->drawSquares(screenManager, 6);
 	_plinth.draw(screenManager);
-	_glyphItem.drawAt(screenManager, getGlyphPos());
+	_glyphItem.drawAt(screenManager, getGlyphPos(), false);
 	_text.draw(screenManager);
 }
 
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index d6f13c3..520a649 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -31,14 +31,14 @@ namespace Titanic {
 
 CPetRoomsGlyph::CPetRoomsGlyph() : CPetGlyph(),
 	_roomFlags(0), _field38(0), _mode(RGM_UNASSIGNED),
-	_field40(nullptr), _field44(nullptr), _field48(nullptr), _field4C(nullptr),
-	_field50(nullptr), _field54(nullptr), _field58(nullptr), _field5C(nullptr) {
+	_object0(nullptr), _object1(nullptr), _object2(nullptr), _object3(nullptr),
+	_object4(nullptr), _object5(nullptr), _object6(nullptr), _object7(nullptr) {
 }
 
 CPetRoomsGlyph::CPetRoomsGlyph(uint flags) : CPetGlyph(),
 	_roomFlags(flags), _field38(0), _mode(RGM_UNASSIGNED),
-	_field40(nullptr), _field44(nullptr), _field48(nullptr), _field4C(nullptr),
-	_field50(nullptr), _field54(nullptr), _field58(nullptr), _field5C(nullptr) {
+	_object0(nullptr), _object1(nullptr), _object2(nullptr), _object3(nullptr),
+	_object4(nullptr), _object5(nullptr), _object6(nullptr), _object7(nullptr) {
 }
 
 bool CPetRoomsGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
@@ -46,23 +46,59 @@ bool CPetRoomsGlyph::setup(CPetControl *petControl, CPetGlyphs *owner) {
 		return false;
 
 	CPetSection *section = owner->getOwner();
-	_field40 = section->getBackground(9);
-	_field44 = section->getBackground(12);
-	_field50 = section->getBackground(13);
-	_field54 = section->getBackground(10);
-	_field48 = section->getBackground(11);
-	_field4C = section->getBackground(14);
-	_field58 = section->getBackground(15);
-	_field5C = _field58;
+	_object0 = section->getBackground(9);
+	_object1 = section->getBackground(12);
+	_object4 = section->getBackground(13);
+	_object5 = section->getBackground(10);
+	_object2 = section->getBackground(11);
+	_object3 = section->getBackground(14);
+	_object6 = section->getBackground(15);
+	_object7 = _object6;
 	return true;
 }
 
-void CPetRoomsGlyph::drawAt(CScreenManager *screenManager, const Point &pt) {
+void CPetRoomsGlyph::drawAt(CScreenManager *screenManager, const Point &pt, bool isHighlighted) {
 	// Clear background
 	Rect rect(pt.x, pt.y, pt.x + 52, pt.y + 52);
 	screenManager->fillRect(SURFACE_BACKBUFFER, &rect, 0, 0, 0);
 
-	warning("TODO: CPetRoomsGlyph::drawAt");
+	CRoomFlags roomFlags(_roomFlags);
+	uint elevBits = roomFlags.getElevatorBits();
+	uint classBits = roomFlags.getPassengerClassBits();
+	uint floorBits = roomFlags.getFloorBits();
+	uint roomBits = roomFlags.getRoomBits();
+
+	// Save a copy of object pointers that may be modified
+	CGameObject *obj0 = _object0;
+	CGameObject *obj1 = _object1;
+	CGameObject *obj4 = _object4;
+	CGameObject *obj5 = _object5;
+
+	if (_field38 == 1 || isHighlighted) {
+		_object0 = _object2;
+		_object1 = _object3;
+		_object4 = _object6;
+		_object5 = _object7;
+	}
+
+	// Draw the images
+	Point destPt = pt;
+	drawObjects(classBits + elevBits * 4, destPt, screenManager);
+	destPt.y += 10;
+	drawObjects((floorBits >> 4) & 15, destPt, screenManager);
+	destPt.y += 10;
+	drawObjects(floorBits & 15, destPt, screenManager);
+	destPt.y += 10;
+	drawObjects(roomBits >> 3, destPt, screenManager);
+	destPt.y += 7;
+	drawObjects(((roomBits & 7) << 1) + (roomFlags.getBit0() ? 1 : 0),
+		destPt, screenManager);
+
+	// Restore original object pointers
+	_object0 = obj0;
+	_object1 = obj1;
+	_object4 = obj4;
+	_object5 = obj5;
 }
 
 void CPetRoomsGlyph::proc28(const Point &topLeft, const Point &pt) {
@@ -102,7 +138,7 @@ int CPetRoomsGlyph::proc29(const Point &pt) {
 
 void CPetRoomsGlyph::getTooltip(CPetText *text) {
 	CRoomFlags roomFlags(_roomFlags);
-	CPetSection *owner = getPetSection();
+	CPetRooms *owner = static_cast<CPetRooms *>(getPetSection());
 
 	CString msg;
 	if (isCurrentlyAssigned()) {
@@ -111,11 +147,20 @@ void CPetRoomsGlyph::getTooltip(CPetText *text) {
 		msg = "A previously assigned room: ";
 	} else if (!_field38) {
 		msg = "Saved Chevron: ";
-	} else if (_field38 == 1 && getRoomFlags() == _roomFlags) {
+	} else if (_field38 == 1 && owner->getRoomFlags() == _roomFlags) {
 		msg = "Current location: ";
 	}
 
-	// TODO: More stuff
+	// Get the room description
+	CString roomStr = roomFlags.getRoomDesc();
+
+	if (roomStr == "The Elevator") {
+		int elevNum = owner->getElevatorNum();
+		roomStr = CString::format("Elevator %d", elevNum);
+	}
+
+	roomStr += " (shift-click edits)";
+	text->setText(roomStr);
 }
 
 void CPetRoomsGlyph::save2(SimpleFile *file, int indent) const {
@@ -161,6 +206,20 @@ int CPetRoomsGlyph::getSelection(const Point &topLeft, const Point &pt) {
 	return -1;
 }
 
+void CPetRoomsGlyph::drawObjects(uint flags, const Point &pt, CScreenManager *screenManager) {
+	if (_object0 && _object1 && _object4 && _object5) {
+		Point destPos = pt;
+		((flags & 8) ? _object0 : _object5)->draw(screenManager, destPos);
+		destPos.x += 13;
+		((flags & 4) ? _object4 : _object5)->draw(screenManager, destPos);
+		destPos.x += 13;
+		((flags & 2) ? _object0 : _object1)->draw(screenManager, destPos);
+		destPos.x += 13;
+		((flags & 1) ? _object4 : _object5)->draw(screenManager, destPos);
+	}
+}
+
+
 /*------------------------------------------------------------------------*/
 
 void CPetRoomsGlyphs::save2(SimpleFile *file, int indent) const {
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index 574403b..f0b243e 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -37,20 +37,25 @@ private:
 	uint _roomFlags;
 	int _field38;
 	RoomGlyphMode _mode;
-	CGameObject *_field40;
-	CGameObject *_field44;
-	CGameObject *_field48;
-	CGameObject *_field4C;
-	CGameObject *_field50;
-	CGameObject *_field54;
-	CGameObject *_field58;
-	CGameObject *_field5C;
+	CGameObject *_object0;
+	CGameObject *_object1;
+	CGameObject *_object2;
+	CGameObject *_object3;
+	CGameObject *_object4;
+	CGameObject *_object5;
+	CGameObject *_object6;
+	CGameObject *_object7;
 private:
 	/**
 	 * Find the selected button under the given point, based on the buttons
 	 * starting at a designated top/left position
 	 */
 	int getSelection(const Point &topLeft, const Point &pt);
+
+	/**
+	 * Draws the objects
+	 */
+	void drawObjects(uint flags, const Point &pt, CScreenManager *screenManager);
 public:
 	CPetRoomsGlyph();
 	CPetRoomsGlyph(uint flags);
@@ -63,7 +68,7 @@ public:
 	/**
 	 * Draw the glyph at a specified position
 	 */
-	virtual void drawAt(CScreenManager *screenManager, const Point &pt);
+	virtual void drawAt(CScreenManager *screenManager, const Point &pt, bool isHighlighted);
 
 	/**
 	 * Handles any secondary drawing of the glyph


Commit: a4b746d24eaeba4cfd05603be2591dc3ec2d10e9
    https://github.com/scummvm/scummvm/commit/a4b746d24eaeba4cfd05603be2591dc3ec2d10e9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:29-04:00

Commit Message:
TITANIC: Added further PET Rooms Glyph method

Changed paths:
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h



diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index f0b9ef1..f6c4806 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -195,7 +195,7 @@ public:
 
 	virtual void save2(SimpleFile *file, int indent) {}
 
-	virtual int proc33() { return 1; }
+	virtual bool proc33(CPetGlyph *glyph) { return true; }
 	virtual int proc34() { return 1; }
 
 	/**
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index 520a649..7f6ebd6 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -168,8 +168,10 @@ void CPetRoomsGlyph::save2(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_mode, indent);
 }
 
-int CPetRoomsGlyph::proc33() {
-	return 1;
+bool CPetRoomsGlyph::proc33(CPetGlyph *glyph) {
+	CPetRoomsGlyph *roomGlyph = static_cast<CPetRoomsGlyph *>(glyph);
+
+	return proc33(glyph) && _roomFlags == roomGlyph->_roomFlags;
 }
 
 void CPetRoomsGlyph::loadFlags(SimpleFile *file, int val) {
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index f0b243e..f3bd2d2 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -89,7 +89,7 @@ public:
 
 	virtual void save2(SimpleFile *file, int indent) const;
 	
-	virtual int proc33();
+	virtual bool proc33(CPetGlyph *glyph);
 
 	/**
 	 * Loads flags for the glyph


Commit: 934787b19be3aa86e02d77eea0a1a5ffa1771075
    https://github.com/scummvm/scummvm/commit/934787b19be3aa86e02d77eea0a1a5ffa1771075
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:33-04:00

Commit Message:
TITANIC: Finsihed remaining PET Remote methods

Changed paths:
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_remote.h



diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index 6f13325..f59f1fb 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -178,7 +178,19 @@ void CPetRemote::enter(PetArea oldArea) {
 }
 
 void CPetRemote::enterRoom(CRoomItem *room) {
-	// TODO
+	clearGlyphs();
+
+	if (room) {
+		CString roomName = room->getName();
+		int roomIndex = roomIndexOf(roomName);
+		if (roomIndex != -1) {
+			Common::Array<uint> indexes;
+			if (getRemoteData(roomIndex, indexes)) {
+				loadGlyphs(indexes);
+				_items.scrollToStart();
+			}
+		}
+	}
 }
 
 CPetText *CPetRemote::getText() {
@@ -298,17 +310,19 @@ int CPetRemote::roomIndexOf(const CString &name) {
 	return -1;
 }
 
-void CPetRemote::getRemoteData(int roomIndex, Common::Array<uint> &indexes) {
+bool CPetRemote::getRemoteData(int roomIndex, Common::Array<uint> &indexes) {
 	const byte *p = &REMOTE_DATA[0];
 	for (int idx = 0; idx < TOTAL_ROOMS; ++idx) {
 		if (*p == roomIndex) {
 			for (int ctr = 0; ctr < *p; ++ctr)
 				indexes.push_back(p[ctr + 1]);
-			return;
+			return true;
 		}
 
 		p += *(p + 1) + 2;
 	}
+
+	return false;
 }
 
 bool CPetRemote::loadGlyphs(const Common::Array<uint> &indexes) {
diff --git a/engines/titanic/pet_control/pet_remote.h b/engines/titanic/pet_control/pet_remote.h
index 58c429f..22ea1e0 100644
--- a/engines/titanic/pet_control/pet_remote.h
+++ b/engines/titanic/pet_control/pet_remote.h
@@ -70,7 +70,7 @@ private:
 	/**
 	 * Return a list of remote action glyph indexes for a given room
 	 */
-	void getRemoteData(int roomIndex, Common::Array<uint> &indexes);
+	bool getRemoteData(int roomIndex, Common::Array<uint> &indexes);
 
 	/**
 	 * Clear the list of rooms glyphs


Commit: ec5dcc17dc75a1b74a417676edf0c51048e19b6c
    https://github.com/scummvm/scummvm/commit/ec5dcc17dc75a1b74a417676edf0c51048e19b6c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:36-04:00

Commit Message:
TITANIC: Added TTtalker methods

Changed paths:
    engines/titanic/core/game_object.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_talker.cpp
    engines/titanic/true_talk/tt_talker.h



diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 059b705..4b9fab9 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -328,11 +328,6 @@ protected:
 	 * Clear the PET display
 	 */
 	void clearPet() const;
-	
-	/**
-	 * Returns the PET control
-	 */
-	CPetControl *getPetControl() const;
 
 	/**
 	 * Returns the MailMan
@@ -471,6 +466,11 @@ public:
 	 * Returns true if the item is the PET control
 	 */
 	virtual bool isPet() const;
+	
+	/**
+	 * Returns the PET control
+	 */
+	CPetControl *getPetControl() const;
 
 	/**
 	 * Play the movie specified in _resource
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 5de87cd..549ba72 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -521,7 +521,7 @@ CString CPetControl::getFullViewName() {
 	return gameManager ? gameManager->getFullViewName() : CString();
 }
 
-void CPetControl::resetDials(int flag) {
+void CPetControl::convResetDials(int flag) {
 	if (flag == 1)
 		_conversations.resetDials(_activeNPCName);
 }
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 8093152..fb5e009 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -312,16 +312,25 @@ public:
 	 */
 	CString getFullViewName();
 
-	/**
-	 * Resets the dial display to reflect new values
-	 */
-	void resetDials(int flag = 1);
-
 	bool getC0() const { return _fieldC0 > 0; }
 	void incC0() { ++_fieldC0; }
 	void decC0() { --_fieldC0; }
 
-	/* CPetRooms methods */
+	/*--- CPetConversations methods ---*/
+
+	/**
+	 * Resets the dial display in the conversation tab to reflect new values
+	 */
+	void convResetDials(int flag = 1);
+
+	/**
+	 * Adds a line to the conversation log
+	 */
+	void convAddLine(const CString &line) {
+		_conversations.addLine(line);
+	}
+
+	/*--- CPetRooms methods ---*/
 
 	/**
 	 * Gives the player a new assigned room in the specified passenger class
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 4e2d905..b1c3ef3 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -239,6 +239,8 @@ void CPetConversations::save(SimpleFile *file, int indent) const {
 }
 
 void CPetConversations::enter(PetArea oldArea) {
+	resetDials();
+
 	if (_petControl && _petControl->_activeNPC)
 		// Start a timer for the NPC
 		startNPCTimer();
@@ -558,6 +560,10 @@ void CPetConversations::npcDialChange(uint dialNum, int oldLevel, int newLevel)
 	}
 }
 
+void CPetConversations::resetDials() {
+	resetDials(getActiveNPCName());
+}
+
 void CPetConversations::resetDials(const CString &name) {
 	TTnpcScript *script = getNPCScript(name);
 
@@ -569,4 +575,9 @@ void CPetConversations::resetDials(const CString &name) {
 	}
 }
 
+void CPetConversations::addLine(const CString &line) {
+	_log.addLine(line);
+	scrollToBottom();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index cefdf1b..d6a3e25 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -238,9 +238,19 @@ public:
 	virtual void hideCursor();
 
 	/**
+	 * Resets the dials with the data for the currently active NPC
+	 */
+	void resetDials();
+
+	/**
 	 * Reset the dials with those for a given NPC
 	 */
 	void resetDials(const CString &name);
+
+	/**
+	 * Adds a line to the log
+	 */
+	void addLine(const CString &line);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 1ee5785..8289b53 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -464,7 +464,7 @@ void TTnpcScript::setDial(int dialNum, int value) {
 	if (g_vm->_trueTalkManager) {
 		CPetControl *petControl = getPetControl(g_vm->_trueTalkManager->getGameManager());
 		if (petControl)
-			petControl->resetDials();
+			petControl->convResetDials();
 	}
 }
 
diff --git a/engines/titanic/true_talk/tt_talker.cpp b/engines/titanic/true_talk/tt_talker.cpp
index 1eb7fc8..61443a4 100644
--- a/engines/titanic/true_talk/tt_talker.cpp
+++ b/engines/titanic/true_talk/tt_talker.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/true_talk/tt_talker.h"
 #include "titanic/messages/messages.h"
+#include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
@@ -32,4 +33,20 @@ void TTtalker::speechStarted(const CString &dialogueStr, uint dialogueId, uint s
 	msg.execute(_npc, nullptr, MSGFLAG_BREAK_IF_HANDLED);
 }
 
+TTtalker::~TTtalker() {
+	CPetControl *petControl = _npc->getPetControl();
+	if (petControl)
+		// Add in final line
+		petControl->convAddLine(_line);
+
+	// Notify the end of the speech
+	CTrueTalkNotifySpeechEndedMsg endedMsg(_field24, _dialogueId);
+	endedMsg.execute(_npc, nullptr, MSGFLAG_BREAK_IF_HANDLED);
+}
+
+void TTtalker::endSpeech(int val) {
+	_done = true;
+	_field24 = val;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_talker.h b/engines/titanic/true_talk/tt_talker.h
index 9bb59fb..636eb0c 100644
--- a/engines/titanic/true_talk/tt_talker.h
+++ b/engines/titanic/true_talk/tt_talker.h
@@ -35,7 +35,7 @@ class TTtalker : public ListItem {
 public:
 	CTrueTalkManager *_owner;
 	CTrueTalkNPC *_npc;
-	CString _string1;
+	CString _line;
 	int _dialogueId;
 	int _field24;
 	int _done;
@@ -44,8 +44,17 @@ public:
 		_dialogueId(0), _field24(0), _done(0) {}
 	TTtalker(CTrueTalkManager *owner, CTrueTalkNPC *npc) :
 		_owner(owner), _npc(npc), _dialogueId(0), _field24(0), _done(0) {}
+	~TTtalker();
 
+	/**
+	 * Start a new speech
+	 */
 	void speechStarted(const CString &dialogueStr, uint dialogueId, uint soundId);
+
+	/**
+	 * End the speech
+	 */
+	void endSpeech(int val);
 };
 
 class TTtalkerList : public List<TTtalker> {


Commit: 9ae0a76333a2258d92996a62a6cc7b1e630107b6
    https://github.com/scummvm/scummvm/commit/9ae0a76333a2258d92996a62a6cc7b1e630107b6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:39-04:00

Commit Message:
TITANIC: Properly named several PET Glyph virtual methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/messages/mouse_messages.h
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 735caad..7b89438 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -492,7 +492,7 @@ void CGameObject::setPosition(const Point &newPos) {
 }
 
 bool CGameObject::checkStartDragging(CMouseDragStartMsg *msg) {
-	if (_visible && checkPoint(msg->_mousePos, msg->_field14, 1)) {
+	if (_visible && checkPoint(msg->_mousePos, msg->_handled, 1)) {
 		savePosition();
 		msg->_dragItem = this;
 		return true;
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 4b9fab9..afcd2f0 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -276,11 +276,6 @@ protected:
 	bool changeView(const CString &viewName, const CString &clipName);
 
 	/**
-	 * Support function for drag moving
-	 */
-	void dragMove(const Point &pt);
-
-	/**
 	 * Get the centre of the game object's bounds
 	 */
 	Point getControid() const;
@@ -573,6 +568,11 @@ public:
 	 * Gives the player a new assigned room in the specified passenger class
 	 */
 	void reassignRoom(int passClassNum);
+
+	/**
+	 * Support function for drag moving
+	 */
+	void dragMove(const Point &pt);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index ce02e1d..4f568cd 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -127,12 +127,12 @@ public:
 class CMouseDragStartMsg : public CMouseDragMsg {
 public:
 	CTreeItem *_dragItem;
-	int _field14;
+	bool _handled;
 public:
 	CLASSDEF
-	CMouseDragStartMsg() : CMouseDragMsg(), _dragItem(nullptr), _field14(0) {}
+	CMouseDragStartMsg() : CMouseDragMsg(), _dragItem(nullptr), _handled(false) {}
 	CMouseDragStartMsg(const Point &pt) : CMouseDragMsg(pt),
-		_dragItem(nullptr), _field14(0) {}
+		_dragItem(nullptr), _handled(false) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return supports(item, _type);
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index d1cb384..b5fa407 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -259,7 +259,7 @@ void CPetGlyphs::setFirstVisible(int index) {
 				int idx = getHighlightedIndex(_highlightIndex);
 				if (idx != -1) {
 					Point tempPt = getPosition(idx);
-					glyph->proc27(tempPt, true);
+					glyph->glyphFocused(tempPt, true);
 				}
 			}
 		}
@@ -318,7 +318,7 @@ bool CPetGlyphs::MouseButtonDownMsg(const Point &pt) {
 			CPetGlyph *glyph = getGlyph(index);
 			if (glyph) {
 				if (_highlightIndex == index) {
-					glyph->MouseButtonDownMsg(glyphRect);
+					glyph->selectGlyph(glyphRect, pt);
 					glyph->updateTooltip();
 				} else {
 					changeHighlight(index);
@@ -366,7 +366,7 @@ bool CPetGlyphs::MouseDragStartMsg(CMouseDragStartMsg *msg) {
 		Rect glyphRect = getRect(index);
 
 		if (glyphRect.contains(msg->_mousePos))
-			return glyph->proc29(glyphRect);
+			return glyph->dragGlyph(glyphRect, msg);
 		else
 			return glyph->MouseDragStartMsg(msg);
 	}
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index f6c4806..26b1a65 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -173,14 +173,20 @@ public:
 	 */
 	virtual void highlightCurrent(const Point &pt) {}
 
-	virtual void proc27(const Point &pt, bool flag) {}
+	/**
+	 * Glyph has been shifted to be first visible one
+	 */
+	virtual void glyphFocused(const Point &pt, bool flag) {}
 
 	/**
-	 *
+	 * Selects a glyph
 	 */
-	virtual void proc28(const Point &topLeft, const Point &pt) {}
+	virtual void selectGlyph(const Point &topLeft, const Point &pt) {}
 	
-	virtual int proc29(const Point &pt) { return 0; }
+	/**
+	 * Called when a glyph drag starts
+	 */
+	virtual bool dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg) { return false; }
 
 	/**
 	 * Returns true if the glyph's bounds, shifted to a given position,
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 34554eb..028f1de 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -75,10 +75,11 @@ bool CPetRooms::MouseDragStartMsg(CMouseDragStartMsg *msg) {
 	if (_glyphs.MouseDragStartMsg(msg))
 		return true;
 
-	if (!_glyphItem.contains(getGlyphPos(), msg->_mousePos))
+	Point topLeft = getGlyphPos();
+	if (!_glyphItem.contains(topLeft, msg->_mousePos))
 		return false;
 
-	_glyphItem.proc29(msg->_mousePos);
+	_glyphItem.dragGlyph(topLeft, msg);
 	return true;
 }
 
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index 7f6ebd6..b0a486d 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -101,7 +101,7 @@ void CPetRoomsGlyph::drawAt(CScreenManager *screenManager, const Point &pt, bool
 	_object5 = obj5;
 }
 
-void CPetRoomsGlyph::proc28(const Point &topLeft, const Point &pt) {
+void CPetRoomsGlyph::selectGlyph(const Point &topLeft, const Point &pt) {
 	if (isAssigned()) {
 		bool isShiftPressed = g_vm->_events->getSpecialButtons() & MK_SHIFT;
 
@@ -115,7 +115,7 @@ void CPetRoomsGlyph::proc28(const Point &topLeft, const Point &pt) {
 	}
 }
 
-int CPetRoomsGlyph::proc29(const Point &pt) {
+bool CPetRoomsGlyph::dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg) {
 	bool isShiftPressed = g_vm->_events->getSpecialButtons() & MK_SHIFT;
 	CPetControl *petControl = getPetControl();
 
@@ -128,12 +128,15 @@ int CPetRoomsGlyph::proc29(const Point &pt) {
 			petControl->removeFromInventory(chevron, false, false);
 			chevron->loadSurface();
 
-			warning("TODO: CPetRoomsGlyph::proc29");
-			// TODO
+			chevron->dragMove(msg->_mousePos);
+			msg->_handled = true;
+
+			if (msg->execute(chevron))
+				return true;
 		}
 	}
 
-	return 0; 
+	return false;
 }
 
 void CPetRoomsGlyph::getTooltip(CPetText *text) {
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index f3bd2d2..3706fcc 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -76,11 +76,14 @@ public:
 	virtual void draw2(CScreenManager *screenManager) {}
 
 	/**
-	 * 
+	 * Selects a glyph
 	 */
-	virtual void proc28(const Point &topLeft, const Point &pt);
+	virtual void selectGlyph(const Point &topLeft, const Point &pt);
 
-	virtual int proc29(const Point &pt);
+	/**
+	 * Called when a glyph drag starts
+	 */
+	virtual bool dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg);
 
 	/**
 	 * Returns the tooltip text for when the glyph is selected


Commit: 6b376e2fa1cce5323ae2a462451b7742ff5840d6
    https://github.com/scummvm/scummvm/commit/6b376e2fa1cce5323ae2a462451b7742ff5840d6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:41-04:00

Commit Message:
TITANIC: Added remaining PET Conversations methods

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index b1c3ef3..9f41a35 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -513,6 +513,13 @@ CString CPetConversations::getActiveNPCName() const {
 		return CString();
 }
 
+void CPetConversations::setActiveNPC(const CString &name) {
+	_npcName = name;
+	_field418 = 1;
+	resetDials();
+	startNPCTimer();
+}
+
 void CPetConversations::copyColors(uint tableNum, uint colors[5]) {
 	const uint *src = getColorTable(tableNum);
 	Common::copy(src, src + 5, colors);
@@ -575,6 +582,11 @@ void CPetConversations::resetDials(const CString &name) {
 	}
 }
 
+void CPetConversations::resetDials0() {
+	stopNPCTimer();
+	resetDials("0");
+}
+
 void CPetConversations::addLine(const CString &line) {
 	_log.addLine(line);
 	scrollToBottom();
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index d6a3e25..9b75a33 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -130,6 +130,11 @@ private:
 	CString getActiveNPCName() const;
 
 	/**
+	 * Set the active NPC
+	 */
+	void setActiveNPC(const CString &name);
+
+	/**
 	 * Create a color table
 	 */
 	void copyColors(uint tableNum, uint colors[5]);
@@ -248,6 +253,11 @@ public:
 	void resetDials(const CString &name);
 
 	/**
+	 * Reset the dials to the '0' position
+	 */
+	void resetDials0();
+
+	/**
 	 * Adds a line to the log
 	 */
 	void addLine(const CString &line);


Commit: c2f6110d0218802b811c1172f114b5d8ed8bf37c
    https://github.com/scummvm/scummvm/commit/c2f6110d0218802b811c1172f114b5d8ed8bf37c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:44-04:00

Commit Message:
TITANIC: Added CPetGlyphs methods

Changed paths:
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h



diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index b5fa407..1aea34f 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -219,7 +219,11 @@ void CPetGlyphs::changeHighlight(int index) {
 }
 
 void CPetGlyphs::highlight(int index) {
-	warning("TODO: CPetGlyphs::highlight");
+	if (index >= 0) {
+		setSelectedIndex(index);
+		changeHighlight(index);
+		makePetDirty();
+	}
 }
 
 void CPetGlyphs::highlight(const CPetGlyph *glyph) {
@@ -235,6 +239,15 @@ int CPetGlyphs::getItemIndex(int index) {
 	return _firstVisibleIndex + index;
 }
 
+void CPetGlyphs::setSelectedIndex(int index) {
+	if (index >= 0 && index < (int)size() && getHighlightedIndex(index) == -1) {
+		if (_firstVisibleIndex <= index)
+			index -= _numVisibleGlyphs - 1;
+
+		setFirstVisible(index);
+	}
+}
+
 CPetGlyph *CPetGlyphs::getGlyph(int index) {
 	for (iterator i = begin(); i != end(); ++i) {
 		if (index-- == 0)
@@ -459,4 +472,24 @@ int CPetGlyphs::indexOf(const CPetGlyph *glyph) const {
 	return -1;
 }
 
+void CPetGlyphs::incSelection() {
+	if (_highlightIndex >= 0 && _highlightIndex < ((int)size() - 1)) {
+		if (getHighlightedIndex(_highlightIndex) >= (_numVisibleGlyphs - 1))
+			scrollRight();
+
+		changeHighlight(_highlightIndex + 1);
+		makePetDirty();
+	}
+}
+
+void CPetGlyphs::decSelection() {
+	if (_highlightIndex > 0) {
+		if (getHighlightedIndex(_highlightIndex) == 0)
+			scrollLeft();
+
+		changeHighlight(_highlightIndex - 1);
+		makePetDirty();
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 26b1a65..f1587e3 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -245,6 +245,11 @@ private:
 	int getItemIndex(int index);
 
 	/**
+	 * Set the item index
+	 */
+	void setSelectedIndex(int index);
+
+	/**
 	 * Return a specified glyph
 	 */
 	CPetGlyph *getGlyph(int index);
@@ -419,6 +424,16 @@ public:
 	 * Resets the scrolling of the glyphs list back to the start
 	 */
 	void scrollToStart() { _firstVisibleIndex = 0; }
+
+	/**
+	 * Increment the currently selected index
+	 */
+	void incSelection();
+
+	/**
+	 * Decrement the currently selected index
+	 */
+	void decSelection();
 };
 
 } // End of namespace Titanic


Commit: 6f5f59af17290930ea75261c604471057e3b45e3
    https://github.com/scummvm/scummvm/commit/6f5f59af17290930ea75261c604471057e3b45e3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:46-04:00

Commit Message:
TITANIC: Added various PET methods

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory_glyphs.cpp
    engines/titanic/pet_control/pet_inventory_glyphs.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 9f41a35..4ec6e89 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -309,7 +309,7 @@ void CPetConversations::displayNPCName(CGameObject *npc) {
 	}
 }
 
-void CPetConversations::proc34(const CString &name) {
+void CPetConversations::setNPC(const CString &name) {
 	_field418 = 0;
 	resetDials(name);
 	startNPCTimer();
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 9b75a33..9af1f14 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -228,7 +228,10 @@ public:
 	 */
 	virtual void displayNPCName(CGameObject *npc);
 
-	virtual void proc34(const CString &name);
+	/**
+	 * Sets the NPC to use
+	 */
+	virtual void setNPC(const CString &name);
 
 	virtual void proc35();
 
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 1aea34f..2e9b590 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -71,6 +71,10 @@ void CPetGlyph::setName(const CString &name, CPetControl *petControl) {
 	_element.reset(name, petControl, MODE_UNSELECTED);
 }
 
+bool CPetGlyph::isHighlighted() const {
+	return _owner->isGlyphHighlighted(this);
+}
+
 /*------------------------------------------------------------------------*/
 
 CPetGlyphs::CPetGlyphs() : _firstVisibleIndex(0),  _numVisibleGlyphs(TOTAL_GLYPHS),
@@ -177,7 +181,7 @@ void CPetGlyphs::draw(CScreenManager *screenManager) {
 	}
 }
 
-Point CPetGlyphs::getPosition(int index) {
+Point CPetGlyphs::getPosition(int index) const {
 	Point tempPoint(37 + index * 70, 375);
 	return tempPoint;
 }
@@ -230,7 +234,7 @@ void CPetGlyphs::highlight(const CPetGlyph *glyph) {
 	highlight(indexOf(glyph));
 }
 
-int CPetGlyphs::getHighlightedIndex(int index) {
+int CPetGlyphs::getHighlightedIndex(int index) const {
 	int idx = index - _firstVisibleIndex;
 	return (idx >= 0 && idx < _numVisibleGlyphs) ? idx : -1;
 }
@@ -416,15 +420,27 @@ bool CPetGlyphs::KeyCharMsg(int key) {
 
 bool CPetGlyphs::VirtualKeyCharMsg(int key) {
 	bool handled = false;
-	warning("TODO: CPetGlyphs::virtualKeyCharMsg");
 
-	if (!handled && _highlightIndex >= 0) {
+	switch (key) {
+	case Common::KEYCODE_LEFT:
+		decSelection();
+		return true;
+
+	case Common::KEYCODE_RIGHT:
+		incSelection();
+		return true;
+
+	default:
+		break;
+	}
+
+	if (_highlightIndex >= 0) {
 		CPetGlyph *glyph = getGlyph(_highlightIndex);
 		if (glyph && glyph->VirtualKeyCharMsg(key))
-			handled = true;
+			return true;
 	}
 
-	return handled;
+	return false;
 }
 
 bool CPetGlyphs::enterHighlighted() {
@@ -492,4 +508,34 @@ void CPetGlyphs::decSelection() {
 	}
 }
 
+CGameObject *CPetGlyphs::getObjectAt(const Point &pt) {
+	for (int idx = 0; idx < _numVisibleGlyphs; ++idx) {
+		Rect glyphRect = getRect(idx);
+		if (glyphRect.contains(pt)) {
+			CPetGlyph *glyph = getGlyph(getItemIndex(idx));
+			if (glyph)
+				return glyph->getObjectAt();
+		}
+	}
+
+	return nullptr;
+}
+
+bool CPetGlyphs::isGlyphHighlighted(const CPetGlyph *glyph) const {
+	if (_highlightIndex == -1)
+		return false;
+
+	return indexOf(glyph) == _highlightIndex;
+}
+
+Point CPetGlyphs::getHighlightedGlyphPos() const {
+	if (_highlightIndex != -1) {
+		int idx = getHighlightedIndex(_highlightIndex);
+		if (idx >= 0)
+			return getPosition(idx);
+	}
+
+	return Point(0, 0);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index f1587e3..9dfe5ad 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -64,31 +64,6 @@ public:
 	CPetGlyph() : ListItem(), _owner(nullptr) {}
 
 	/**
-	 * Translate the glyph's position
-	 */
-	void translate(const Point &pt) { _element.translate(pt.x, pt.y); }
-
-	/**
-	 * Translate the glyph's position back
-	 */
-	void translateBack(const Point &pt) { _element.translate(-pt.x, -pt.y); }
-
-	/**
-	 * Get the parent RealLife area
-	 */
-	CPetGlyphs *getOwner() { return _owner; }
-
-	/**
-	 * Get the PET control
-	 */
-	CPetControl *getPetControl() const;
-
-	/**
-	 * Sets new name and default bounds for glyph
-	 */
-	void setName(const CString &name, CPetControl *petControl);
-
-	/**
 	 * Setup the glyph
 	 */
 	virtual bool setup(CPetControl *petControl, CPetGlyphs *owner);
@@ -199,7 +174,10 @@ public:
 	 */
 	virtual void getTooltip(CPetText *text) {}
 
-	virtual void save2(SimpleFile *file, int indent) {}
+	/**
+	 * Saves the data for the glyph
+	 */
+	virtual void saveGlyph(SimpleFile *file, int indent) {}
 
 	virtual bool proc33(CPetGlyph *glyph) { return true; }
 	virtual int proc34() { return 1; }
@@ -214,12 +192,45 @@ public:
 	 */
 	virtual void leaveHighlighted() {}
 
-	virtual int proc37() { return 0; }
+	/**
+	 * Returns the object associated with the glyph
+	 */
+	virtual CGameObject *getObjectAt() { return nullptr; }
 
 	/**
 	 * Does a processing action on the glyph
 	 */
 	virtual bool doAction(CGlyphAction *action) { return true; }
+
+	/**
+	 * Translate the glyph's position
+	 */
+	void translate(const Point &pt) { _element.translate(pt.x, pt.y); }
+
+	/**
+	 * Translate the glyph's position back
+	 */
+	void translateBack(const Point &pt) { _element.translate(-pt.x, -pt.y); }
+
+	/**
+	 * Get the parent RealLife area
+	 */
+	CPetGlyphs *getOwner() { return _owner; }
+
+	/**
+	 * Get the PET control
+	 */
+	CPetControl *getPetControl() const;
+
+	/**
+	 * Sets new name and default bounds for glyph
+	 */
+	void setName(const CString &name, CPetControl *petControl);
+
+	/**
+	 * Returns true if the specified glyph is the currently highlighted one
+	 */
+	bool isHighlighted() const;
 };
 		
 class CPetGlyphs : public List<CPetGlyph> {
@@ -227,7 +238,7 @@ private:
 	/**
 	 * Get a position for the glyph
 	 */
-	Point getPosition(int index);
+	Point getPosition(int index) const;
 
 	/**
 	 * Get a rect for the glyph
@@ -237,7 +248,7 @@ private:
 	/**
 	 * Returns the on-screen index for the highlight to be shown at
 	 */
-	int getHighlightedIndex(int index);
+	int getHighlightedIndex(int index) const;
 
 	/**
 	 * Returns the index of a glyph given the visible on-screen glyph number
@@ -434,6 +445,21 @@ public:
 	 * Decrement the currently selected index
 	 */
 	void decSelection();
+
+	/**
+	 * Returns the object associated the glyph under the specified position
+	 */
+	CGameObject *getObjectAt(const Point &pt);
+
+	/**
+	 * Returns true if the specified glyph is the currently highlighted one
+	 */
+	bool isGlyphHighlighted(const CPetGlyph *glyph) const;
+
+	/**
+	 * Get the top-left position of the currently highlighted glyph
+	 */
+	Point getHighlightedGlyphPos() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 37a7342..bf6b913 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -124,14 +124,14 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
 void CPetInventory::change(CCarry *item) {
 	if (item) {
 		CInventoryGlyphAction action(item, ACTION_CHANGE);
-		_items.change(&action);
+		_items.doAction(&action);
 	}
 }
 
 void CPetInventory::itemRemoved(CGameObject *item) {
 	if (item) {
 		CInventoryGlyphAction action(item, ACTION_REMOVED);
-		_items.change(&action);
+		_items.doAction(&action);
 	}
 }
 
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
index b793c1a..441726e 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
@@ -146,7 +146,15 @@ bool CPetInventoryGlyph::doAction(CGlyphAction *action) {
 		if (_item == invAction->_item && _owner) {
 			int v = populateItem(_item, 0);
 			_background = owner->getBackground(v);
+
+			if (isHighlighted()) {
+				warning("TODO");
+			}
 		}
+		break;
+
+	default:
+		break;
 	}
 
 	return true;
@@ -154,7 +162,7 @@ bool CPetInventoryGlyph::doAction(CGlyphAction *action) {
 
 /*------------------------------------------------------------------------*/
 
-bool CPetInventoryGlyphs::change(CInventoryGlyphAction *action) {
+bool CPetInventoryGlyphs::doAction(CInventoryGlyphAction *action) {
 	for (iterator i = begin(); i != end(); ++i) {
 		(*i)->doAction(action);
 	}
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h
index 91b1e5e..17222a9 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.h
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.h
@@ -54,6 +54,11 @@ public:
 	void setItem(CGameObject *item, int val);
 
 	/**
+	 * Returns the object associated with the glyph
+	 */
+	virtual CGameObject *getObjectAt() { return _item; }
+
+	/**
 	 * Does a processing action on the glyph
 	 */
 	virtual bool doAction(CGlyphAction *action);
@@ -73,9 +78,9 @@ private:
 	CGameObject *getBackground(int index);
 public:
 	/**
-	 * 
+	 * Do an action on the glyphs
 	 */
-	bool change(CInventoryGlyphAction *item);
+	bool doAction(CInventoryGlyphAction *item);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 028f1de..bbb8daf 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -149,8 +149,8 @@ void CPetRooms::postLoad() {
 }
 
 void CPetRooms::save(SimpleFile *file, int indent) const {
-	_glyphs.save2(file, indent);
-	_glyphItem.save2(file, indent);
+	_glyphs.saveGlyphs(file, indent);
+	_glyphItem.saveGlyph(file, indent);
 	file->writeNumberLine(_floorNum, indent);
 	file->writeNumberLine(_elevatorNum, indent);
 	file->writeNumberLine(_roomNum, indent);
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index b0a486d..864ae2e 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -166,7 +166,7 @@ void CPetRoomsGlyph::getTooltip(CPetText *text) {
 	text->setText(roomStr);
 }
 
-void CPetRoomsGlyph::save2(SimpleFile *file, int indent) const {
+void CPetRoomsGlyph::saveGlyph(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_roomFlags, indent);
 	file->writeNumberLine(_mode, indent);
 }
@@ -227,11 +227,11 @@ void CPetRoomsGlyph::drawObjects(uint flags, const Point &pt, CScreenManager *sc
 
 /*------------------------------------------------------------------------*/
 
-void CPetRoomsGlyphs::save2(SimpleFile *file, int indent) const {
+void CPetRoomsGlyphs::saveGlyphs(SimpleFile *file, int indent) const {
 	file->writeNumberLine(size(), indent);
 
 	for (const_iterator i = begin(); i != end(); ++i)
-		(*i)->save2(file, indent);
+		(*i)->saveGlyph(file, indent);
 }
 
 CPetRoomsGlyph *CPetRoomsGlyphs::findAssignedRoom() const {
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index 3706fcc..f0c2ce0 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -90,7 +90,10 @@ public:
 	 */
 	virtual void getTooltip(CPetText *text);
 
-	virtual void save2(SimpleFile *file, int indent) const;
+	/**
+	 * Saves the data for the glyph
+	 */
+	virtual void saveGlyph(SimpleFile *file, int indent) const;
 	
 	virtual bool proc33(CPetGlyph *glyph);
 
@@ -140,7 +143,7 @@ public:
 	/**
 	 * Save the list
 	 */
-	void save2(SimpleFile *file, int indent) const;
+	void saveGlyphs(SimpleFile *file, int indent) const;
 
 	/**
 	 * Returns the glyph for hte player's assigned room
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 15c4033..d888e05 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -167,9 +167,12 @@ public:
 	virtual void displayNPCName(CGameObject *npc) {}
 
 	virtual void proc33() {}
-	
-	virtual void proc34(const CString &name) {}
-	
+
+	/**
+	 * Sets the NPC to use
+	 */
+	virtual void setNPC(const CString &name) {}
+
 	virtual void proc35() {}
 
 	/**


Commit: bb567c6e1160615b647c27040743353df9311699
    https://github.com/scummvm/scummvm/commit/bb567c6e1160615b647c27040743353df9311699
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:49-04:00

Commit Message:
TITANIC: Adding PET Inventory Glyph methods

Changed paths:
    engines/titanic/core/game_object.h
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_inventory_glyphs.cpp
    engines/titanic/pet_control/pet_inventory_glyphs.h



diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index afcd2f0..7f245cc 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -280,11 +280,6 @@ protected:
 	 */
 	Point getControid() const;
 
-	/**
-	 * Set the position of the object
-	 */
-	void setPosition(const Point &newPos);
-
 	void sound8(bool flag) const;
 
 	/**
@@ -484,6 +479,11 @@ public:
 	bool checkPoint(const Point &pt, bool ignore40 = false, bool visibleOnly = false);
 
 	/**
+	 * Set the position of the object
+	 */
+	void setPosition(const Point &newPos);
+
+	/**
 	 * Change the object's status
 	 */
 	void playMovie(uint flags);
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index 2e9b590..c132a2f 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -120,24 +120,20 @@ void CPetGlyphs::reset() {
 	}
 }
 
-bool CPetGlyphs::enter() {
+void CPetGlyphs::enter() {
 	if (_highlightIndex != -1) {
 		CPetGlyph *glyph = getGlyph(_highlightIndex);
-		if (glyph && glyph->enter())
-			return true;
+		if (glyph)
+			glyph->enter();
 	}
-
-	return false;
 }
 
-bool CPetGlyphs::leave() {
+void CPetGlyphs::leave() {
 	if (_highlightIndex != -1) {
 		CPetGlyph *glyph = getGlyph(_highlightIndex);
-		if (glyph && glyph->leave())
-			return true;
+		if (glyph)
+			glyph->leave();
 	}
-
-	return false;
 }
 
 void CPetGlyphs::draw(CScreenManager *screenManager) {
@@ -419,8 +415,6 @@ bool CPetGlyphs::KeyCharMsg(int key) {
 }
 
 bool CPetGlyphs::VirtualKeyCharMsg(int key) {
-	bool handled = false;
-
 	switch (key) {
 	case Common::KEYCODE_LEFT:
 		decSelection();
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 9dfe5ad..e240cd1 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -76,12 +76,12 @@ public:
 	/**
 	 * Called when the PET area is entered
 	 */
-	virtual bool enter() { return false; }
+	virtual void enter() {}
 	
 	/**
 	 * Called when the PET area is left
 	 */
-	virtual bool leave() { return false; }
+	virtual void leave() {}
 
 	/**
 	 * Draw the glyph at a specified position
@@ -151,7 +151,7 @@ public:
 	/**
 	 * Glyph has been shifted to be first visible one
 	 */
-	virtual void glyphFocused(const Point &pt, bool flag) {}
+	virtual void glyphFocused(const Point &topLeft, bool flag) {}
 
 	/**
 	 * Selects a glyph
@@ -180,7 +180,11 @@ public:
 	virtual void saveGlyph(SimpleFile *file, int indent) {}
 
 	virtual bool proc33(CPetGlyph *glyph) { return true; }
-	virtual int proc34() { return 1; }
+
+	/**
+	 * Return whether the glyph has an associated image
+	 */
+	virtual bool hasImage() const { return true; }
 
 	/**
 	 * Called on a highlighted item when PET area is entered
@@ -328,12 +332,12 @@ public:
 	/**
 	 * Called when PET area is entered
 	 */
-	virtual bool enter();
+	virtual void enter();
 
 	/**
 	 * Called when PET area is left
 	 */
-	virtual bool leave();
+	virtual void leave();
 
 	void setFlags(int flags) { _flags = flags; }
 
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index bf6b913..930a93f 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -199,7 +199,7 @@ CGameObject *CPetInventory::getImage(int index) {
 	return nullptr;
 }
 
-void CPetInventory::setMovie(CGameObject *movie, int flag) {
+void CPetInventory::playMovie(CGameObject *movie, int flag) {
 	if (_movie)
 		_movie->stopMovie();
 	_movie = movie;
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 58e6bd9..3437d09 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -53,11 +53,6 @@ private:
 	 * Get the index of an item added to the PET
 	 */
 	int getItemIndex(CGameObject *item) const;
-
-	/**
-	 * Set the animated inventory item movie
-	 */
-	void setMovie(CGameObject *movie, int flag);
 public:
 	CPetInventory();
 
@@ -140,6 +135,11 @@ public:
 	void highlightItem(CGameObject *item);
 
 	CGameObject *getImage(int index);
+
+	/**
+	 * Play the animated movie for an object
+	 */
+	void playMovie(CGameObject *movie, int flag);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
index 441726e..57c8611 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
@@ -20,9 +20,9 @@
  *
  */
 
-#include "common/textconsole.h"
 #include "titanic/pet_control/pet_inventory_glyphs.h"
 #include "titanic/pet_control/pet_inventory.h"
+#include "titanic/messages/pet_messages.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
@@ -34,6 +34,129 @@ const uint ITEM_MODES[40] = {
 	33, 34, 35, 38, 41, 42, 43, 44, 45, 37
 };
 
+void CPetInventoryGlyph::enter() {
+	startBackgroundMovie();
+}
+
+void CPetInventoryGlyph::leave() {
+	stopMovie();
+}
+
+void CPetInventoryGlyph::drawAt(CScreenManager *screenManager, const Point &pt, bool isHighlighted) {
+	if (!_field34)
+		return;
+
+	if (_image) {
+		if (_image->hasActiveMovie()) {
+			if (isHighlighted)
+				_image->draw(screenManager);
+			else
+				_image->draw(screenManager, pt);
+			return;
+		}
+
+		_image = nullptr;
+		if (_background && isHighlighted) {
+			_background->setPosition(pt);
+			startBackgroundMovie();
+		}
+	}
+
+	if (_background) {
+		if (isHighlighted)
+			_background->draw(screenManager);
+		else
+			_background->draw(screenManager, pt);
+	} else if (_image) {
+		_image->draw(screenManager, pt, Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
+	}
+}
+
+
+void CPetInventoryGlyph::unhighlightCurrent() {
+	if (_image) {
+		_image->setPosition(Point(0, 0));
+		stopMovie();
+	} else if (_background) {
+		_background->setPosition(Point(0, 0));
+		_background->loadFrame(0);
+		stopMovie();
+	}
+}
+
+void CPetInventoryGlyph::highlightCurrent(const Point &pt) {
+	reposition(pt);
+	if (_item) {
+		CPETObjectSelectedMsg selectedMsg;
+		selectedMsg.execute(_item);
+	}
+}
+
+void CPetInventoryGlyph::glyphFocused(const Point &topLeft, bool flag) {
+	if (_background && flag)
+		_background->setPosition(topLeft);
+}
+
+bool CPetInventoryGlyph::dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg) {
+	warning("TODO");
+	return false;
+}
+
+void CPetInventoryGlyph::getTooltip(CPetText *text) {
+	if (text) {
+		text->setText("");
+
+		if (_field34 && _item) {
+			int itemIndex = populateItem(_item, 0);
+			if (itemIndex >= 14 && itemIndex <= 18) {
+				CPETObjectStateMsg stateMsg(0);
+				stateMsg.execute(_item);
+
+				text->setText(CString::format("%s %s",
+					stateMsg._value ? "A hot " : "A cold ",
+					g_vm->_itemDescriptions[itemIndex].c_str()
+				));
+
+			} else {
+				text->setText(g_vm->_itemDescriptions[itemIndex]);
+			}
+		}
+	}
+}
+
+bool CPetInventoryGlyph::doAction(CGlyphAction *action) {
+	CInventoryGlyphAction *invAction = static_cast<CInventoryGlyphAction *>(action);
+	CPetInventoryGlyphs *owner = static_cast<CPetInventoryGlyphs *>(_owner);
+	if (!invAction)
+		return false;
+
+	switch (invAction->getMode()) {
+	case ACTION_REMOVED:
+		if (invAction->_item == _item) {
+			_item = nullptr;
+			_background = nullptr;
+			_field34 = 0;
+		}
+		break;
+
+	case ACTION_REMOVE:
+		if (_item == invAction->_item && _owner) {
+			int v = populateItem(_item, 0);
+			_background = owner->getBackground(v);
+
+			if (isHighlighted()) {
+				warning("TODO");
+			}
+		}
+		break;
+
+	default:
+		break;
+	}
+
+	return true;
+}
+
 void CPetInventoryGlyph::setItem(CGameObject *item, int val) {
 	_item = item;
 
@@ -127,37 +250,39 @@ int CPetInventoryGlyph::subMode(CGameObject *item, int val) {
 	return frameNum;
 }
 
-bool CPetInventoryGlyph::doAction(CGlyphAction *action) {
-	CInventoryGlyphAction *invAction = static_cast<CInventoryGlyphAction *>(action);
-	CPetInventoryGlyphs *owner = static_cast<CPetInventoryGlyphs *>(_owner);
-	if (!invAction)
-		return false; 
-
-	switch (invAction->getMode()) {
-	case ACTION_REMOVED:
-		if (invAction->_item == _item) {
-			_item = nullptr;
-			_background = nullptr;
-			_field34 = 0;
-		}
-		break;
-
-	case ACTION_REMOVE:
-		if (_item == invAction->_item && _owner) {
-			int v = populateItem(_item, 0);
-			_background = owner->getBackground(v);
+void CPetInventoryGlyph::startBackgroundMovie() {
+	if (_owner) {
+		CPetInventory *section = static_cast<CPetInventory *>(_owner->getOwner());
+		if (section)
+			section->playMovie(_background, 1);
+	}
+}
 
-			if (isHighlighted()) {
-				warning("TODO");
-			}
-		}
-		break;
+void CPetInventoryGlyph::startForegroundMovie() {
+	if (_owner) {
+		CPetInventory *section = static_cast<CPetInventory *>(_owner->getOwner());
+		if (section)
+			section->playMovie(_image, 1);
+	}
+}
 
-	default:
-		break;
+void CPetInventoryGlyph::stopMovie() {
+	if (_owner) {
+		CPetInventory *section = static_cast<CPetInventory *>(_owner->getOwner());
+		if (section)
+			section->playMovie(nullptr, 1);
 	}
+}
 
-	return true;
+void CPetInventoryGlyph::reposition(const Point &pt) {
+	if (_image) {
+		_image->setPosition(pt);
+		startForegroundMovie();
+	}
+	else if (_background) {
+		_background->setPosition(pt);
+		startBackgroundMovie();
+	}
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h
index 17222a9..06e1d06 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.h
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.h
@@ -37,21 +37,81 @@ private:
 	int populateItem(CGameObject *item, int val);
 
 	int subMode(CGameObject *item, int val);
+
+	/**
+	 * Start any movie for the background
+	 */
+	void startBackgroundMovie();
+
+	/**
+	 * Start any movie for the foreground item
+	 */
+	void startForegroundMovie();
+
+	/**
+	 * Stop any previously started foreground or background movie
+	 */
+	void stopMovie();
+
+	/**
+	 * Reposition the inventory item
+	 */
+	void reposition(const Point &pt);
 public:
 	CGameObject *_item;
 	int _field34;
 	CGameObject *_background;
 	CGameObject *_image;
 public:
-	CPetInventoryGlyph() : _item(nullptr), _field34(0), 
+	CPetInventoryGlyph() : _item(nullptr), _field34(1), 
 		_background(nullptr), _image(nullptr) {}
 	CPetInventoryGlyph(CCarry *item, int val) : _item(item),
 		_field34(val), _background(nullptr), _image(nullptr) {}
 
 	/**
-	 * Set the inventory item
+	 * Called when the PET area is entered
 	 */
-	void setItem(CGameObject *item, int val);
+	virtual void enter();
+	
+	/**
+	 * Called when the PET area is left
+	 */
+	virtual void leave();
+
+	/**
+	 * Draw the glyph at a specified position
+	 */
+	virtual void drawAt(CScreenManager *screenManager, const Point &pt, bool isHighlighted);
+
+	/**
+	 * Unhighlight any currently highlighted element
+	 */
+	virtual void unhighlightCurrent();
+
+	/**
+	 * Highlight any currently highlighted element
+	 */
+	virtual void highlightCurrent(const Point &pt);
+
+	/**
+	 * Glyph has been shifted to be first visible one
+	 */
+	virtual void glyphFocused(const Point &topLeft, bool flag);
+	
+	/**
+	 * Called when a glyph drag starts
+	 */
+	virtual bool dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg);
+
+	/**
+	 * Returns the tooltip text for when the glyph is selected
+	 */
+	virtual void getTooltip(CPetText *text);
+
+	/**
+	 * Return whether the glyph has an associated image
+	 */
+	virtual bool hasImage() const { return _item && _background; }
 
 	/**
 	 * Returns the object associated with the glyph
@@ -62,6 +122,11 @@ public:
 	 * Does a processing action on the glyph
 	 */
 	virtual bool doAction(CGlyphAction *action);
+
+	/**
+	 * Set the inventory item
+	 */
+	void setItem(CGameObject *item, int val);
 };
 
 class CInventoryGlyphAction : public CGlyphAction {


Commit: 5fe1f73159d43cd165d20bdc8297eb5eb6d42492
    https://github.com/scummvm/scummvm/commit/5fe1f73159d43cd165d20bdc8297eb5eb6d42492
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:51-04:00

Commit Message:
TITANIC: Added remaining PET Inventory Glyph methods

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_inventory_glyphs.cpp



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 549ba72..e2279e5 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -521,6 +521,14 @@ CString CPetControl::getFullViewName() {
 	return gameManager ? gameManager->getFullViewName() : CString();
 }
 
+bool CPetControl::isSuccUBusActive() const {
+	if (!_activeNPC)
+		return false;
+
+	CString name = getName();
+	return name.contains("Succubus") || name.contains("Sub");
+}
+
 void CPetControl::convResetDials(int flag) {
 	if (flag == 1)
 		_conversations.resetDials(_activeNPCName);
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index fb5e009..5e47f32 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -316,6 +316,8 @@ public:
 	void incC0() { ++_fieldC0; }
 	void decC0() { --_fieldC0; }
 
+	bool isSuccUBusActive() const;
+
 	/*--- CPetConversations methods ---*/
 
 	/**
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
index 57c8611..8eeccbb 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/pet_control/pet_inventory_glyphs.h"
+#include "titanic/pet_control/pet_control.h"
 #include "titanic/pet_control/pet_inventory.h"
 #include "titanic/messages/pet_messages.h"
 #include "titanic/titanic.h"
@@ -98,8 +99,46 @@ void CPetInventoryGlyph::glyphFocused(const Point &topLeft, bool flag) {
 }
 
 bool CPetInventoryGlyph::dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg) {
-	warning("TODO");
-	return false;
+	if (!_item)
+		return false;
+
+	if (_background) {
+		_field34 = 0;
+		stopMovie();
+	}
+
+	CPetControl *petControl = getPetControl();
+	if (!petControl)
+		return false;
+
+	CGameObject *carryParcel = petControl->getHiddenObject("CarryParcel");
+
+	if (petControl->isSuccUBusActive() && carryParcel) {
+		petControl->removeFromInventory(_item, carryParcel, false, true);
+		petControl->removeFromInventory(_item, false, false);
+
+		carryParcel->setPosition(Point(msg->_mousePos.x - carryParcel->getBounds().width() / 2,
+			msg->_mousePos.y - carryParcel->getBounds().height() / 2));
+		_item->setPosition(Point(SCREEN_WIDTH, SCREEN_HEIGHT));
+	} else {
+		petControl->removeFromInventory(_item, false, true);
+
+		_item->setPosition(Point(msg->_mousePos.x - carryParcel->getBounds().width() / 2,
+			msg->_mousePos.y - carryParcel->getBounds().height() / 2));
+		_item->setVisible(true);
+	}
+
+	msg->_handled = true;
+	if (msg->execute(carryParcel)) {
+		_item = nullptr;
+		_background = nullptr;
+		_field34 = 0;
+		petControl->setC8(1);
+		return true;
+	} else {
+		petControl->addToInventory(carryParcel);
+		return false;
+	}
 }
 
 void CPetInventoryGlyph::getTooltip(CPetText *text) {
@@ -145,7 +184,9 @@ bool CPetInventoryGlyph::doAction(CGlyphAction *action) {
 			_background = owner->getBackground(v);
 
 			if (isHighlighted()) {
-				warning("TODO");
+				Point glyphPos = _owner->getHighlightedGlyphPos();
+				reposition(glyphPos);
+				updateTooltip();
 			}
 		}
 		break;
@@ -278,8 +319,7 @@ void CPetInventoryGlyph::reposition(const Point &pt) {
 	if (_image) {
 		_image->setPosition(pt);
 		startForegroundMovie();
-	}
-	else if (_background) {
+	} else if (_background) {
 		_background->setPosition(pt);
 		startBackgroundMovie();
 	}


Commit: 42c8ac1c880076c181071922aff3b923a185af98
    https://github.com/scummvm/scummvm/commit/42c8ac1c880076c181071922aff3b923a185af98
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:53-04:00

Commit Message:
TITANIC: Added Pet Inventorty virtual methods

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_inventory_glyphs.h
    engines/titanic/pet_control/pet_real_life.cpp
    engines/titanic/pet_control/pet_real_life.h
    engines/titanic/pet_control/pet_remote.cpp
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index e2279e5..f5c5647 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -131,7 +131,7 @@ void CPetControl::draw(CScreenManager *screenManager) {
 
 	if (!bounds.isEmpty()) {
 		if (_fieldC8 >= 0) {
-			_inventory.proc5(_fieldC8);
+			_inventory.changed(_fieldC8);
 			_fieldC8 = -1;
 		}
 
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index c132a2f..eca6f30 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -182,7 +182,7 @@ Point CPetGlyphs::getPosition(int index) const {
 	return tempPoint;
 }
 
-Rect CPetGlyphs::getRect(int index) {
+Rect CPetGlyphs::getRect(int index) const {
 	Point pt = getPosition(index);
 	return Rect(pt.x, pt.y, pt.x + 52, pt.y + 52);
 }
@@ -235,7 +235,7 @@ int CPetGlyphs::getHighlightedIndex(int index) const {
 	return (idx >= 0 && idx < _numVisibleGlyphs) ? idx : -1;
 }
 
-int CPetGlyphs::getItemIndex(int index) {
+int CPetGlyphs::getItemIndex(int index) const {
 	return _firstVisibleIndex + index;
 }
 
@@ -248,8 +248,8 @@ void CPetGlyphs::setSelectedIndex(int index) {
 	}
 }
 
-CPetGlyph *CPetGlyphs::getGlyph(int index) {
-	for (iterator i = begin(); i != end(); ++i) {
+CPetGlyph *CPetGlyphs::getGlyph(int index) const {
+	for (const_iterator i = begin(); i != end(); ++i) {
 		if (index-- == 0)
 			return *i;
 	}
@@ -414,7 +414,9 @@ bool CPetGlyphs::KeyCharMsg(int key) {
 	return false;
 }
 
-bool CPetGlyphs::VirtualKeyCharMsg(int key) {
+bool CPetGlyphs::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
+	Common::KeyCode key = msg->_keyState.keycode;
+
 	switch (key) {
 	case Common::KEYCODE_LEFT:
 		decSelection();
@@ -430,7 +432,7 @@ bool CPetGlyphs::VirtualKeyCharMsg(int key) {
 
 	if (_highlightIndex >= 0) {
 		CPetGlyph *glyph = getGlyph(_highlightIndex);
-		if (glyph && glyph->VirtualKeyCharMsg(key))
+		if (glyph && glyph->VirtualKeyCharMsg(msg))
 			return true;
 	}
 
@@ -502,7 +504,7 @@ void CPetGlyphs::decSelection() {
 	}
 }
 
-CGameObject *CPetGlyphs::getObjectAt(const Point &pt) {
+CGameObject *CPetGlyphs::getObjectAt(const Point &pt) const {
 	for (int idx = 0; idx < _numVisibleGlyphs; ++idx) {
 		Rect glyphRect = getRect(idx);
 		if (glyphRect.contains(pt)) {
@@ -532,4 +534,33 @@ Point CPetGlyphs::getHighlightedGlyphPos() const {
 	return Point(0, 0);
 }
 
+bool CPetGlyphs::areItemsValid() const {
+	for (const_iterator i = begin(); i != end(); ++i) {
+		if (!(*i)->isValid())
+			return false;
+	}
+
+	return true;
+}
+
+void CPetGlyphs::removeInvalid() {
+	if (!areItemsValid()) {
+		changeHighlight(-1);
+
+		for (iterator i = begin(); i != end(); ) {
+			CPetGlyph *glyph = *i;
+
+			if (!glyph->isValid()) {
+				i = erase(i);
+				delete glyph;
+			} else {
+				++i;
+			}
+		}
+
+		_firstVisibleIndex = CLIP(_firstVisibleIndex, 0,
+			(int)size() - _numVisibleGlyphs);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index e240cd1..7271d6c 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -127,16 +127,21 @@ public:
 	 * Handles mouse button up messages
 	 */
 	virtual bool MouseButtonUpMsg(const Point &pt) { return false; }
-	
-	virtual int proc21() { return 0; }
-	virtual int proc22() { return 0; }
 
 	/**
-	 * Handles keypresses when the glyph is focused
+	 * Handles mouse double-click messages
+	 */
+	virtual bool MouseDoubleClickMsg(const CMouseDoubleClickMsg *msg) { return false; }
+
+	/**
+	 * Handles keypresses
 	 */
 	virtual bool KeyCharMsg(int key) { return false; }
 	
-	virtual bool VirtualKeyCharMsg(int key) { return false; }
+	/**
+	 * Handles keypresses
+	 */
+	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) { return false; }
 
 	/**
 	 * Unhighlight any currently highlighted element
@@ -182,9 +187,9 @@ public:
 	virtual bool proc33(CPetGlyph *glyph) { return true; }
 
 	/**
-	 * Return whether the glyph has an associated image
+	 * Return whether the glyph is currently valid
 	 */
-	virtual bool hasImage() const { return true; }
+	virtual bool isValid() const { return true; }
 
 	/**
 	 * Called on a highlighted item when PET area is entered
@@ -247,7 +252,7 @@ private:
 	/**
 	 * Get a rect for the glyph
 	 */
-	Rect getRect(int index);
+	Rect getRect(int index) const;
 
 	/**
 	 * Returns the on-screen index for the highlight to be shown at
@@ -257,7 +262,7 @@ private:
 	/**
 	 * Returns the index of a glyph given the visible on-screen glyph number
 	 */
-	int getItemIndex(int index);
+	int getItemIndex(int index) const;
 
 	/**
 	 * Set the item index
@@ -267,7 +272,7 @@ private:
 	/**
 	 * Return a specified glyph
 	 */
-	CPetGlyph *getGlyph(int index);
+	CPetGlyph *getGlyph(int index) const;
 
 	/**
 	 * Scrolls the glyphs to the left
@@ -288,6 +293,11 @@ private:
 	 * Make the PET dirty
 	 */
 	void makePetDirty();
+
+	/**
+	 * Returns true if all the glyphs are in a valid state
+	 */
+	bool areItemsValid() const;
 protected:
 	int _firstVisibleIndex;
 	int _totalGlyphs;
@@ -377,6 +387,11 @@ public:
 	bool MouseButtonUpMsg(const Point &pt);
 
 	/**
+	 * Mouse double click message
+	 */
+	bool MouseDoubleClickMsg(const Point &pt) { return true; }
+
+	/**
 	 * Mouse drag start messagge
 	 */
 	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
@@ -399,7 +414,7 @@ public:
 	/**
 	 * Virtual key message
 	 */
-	bool VirtualKeyCharMsg(int key);
+	bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg);
 
 	/**
 	 * When the PET section is entered, passes onto the highlighted
@@ -453,7 +468,7 @@ public:
 	/**
 	 * Returns the object associated the glyph under the specified position
 	 */
-	CGameObject *getObjectAt(const Point &pt);
+	CGameObject *getObjectAt(const Point &pt) const;
 
 	/**
 	 * Returns true if the specified glyph is the currently highlighted one
@@ -464,6 +479,12 @@ public:
 	 * Get the top-left position of the currently highlighted glyph
 	 */
 	Point getHighlightedGlyphPos() const;
+
+	/**
+	 * Removes any glyphs from the list that no longer have any images
+	 * associated with them
+	 */
+	void removeInvalid();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 930a93f..a207c66 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -41,8 +41,9 @@ bool CPetInventory::setup(CPetControl *petControl) {
 bool CPetInventory::reset() {
 	_items.reset();
 	_text.setup();
+	_text.setColor(getColor(0));
+	_text.setLineColor(0, getColor(0));
 
-	// TODO
 	return true;
 }
 
@@ -56,9 +57,45 @@ Rect CPetInventory::getBounds() {
 	return _movie ? _movie->getBounds() : Rect();
 }
 
+void CPetInventory::changed(int changeType) {
+	switch (changeType) {
+	case 0:
+	case 2:
+		itemsChanged();
+		break;
+	case 1:
+		removeInvalid();
+		break;
+	default:
+		break;
+	}
+}
+
+bool CPetInventory::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	return _items.MouseButtonDownMsg(msg->_mousePos);
+}
+
+bool CPetInventory::MouseDragStartMsg(CMouseDragStartMsg *msg) {
+	bool result = _items.MouseDragStartMsg(msg);
+	if (result)
+		_petControl->makeDirty();
+	return result;
+}
+
+bool CPetInventory::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+	return _items.MouseButtonUpMsg(msg->_mousePos);
+}
+
+bool CPetInventory::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
+	return _items.MouseDoubleClickMsg(msg->_mousePos);
+}
+
+bool CPetInventory::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
+	return _items.VirtualKeyCharMsg(msg);
+}
+
 CGameObject *CPetInventory::dragEnd(const Point &pt) const {
-	warning("TODO: CPetInventory::dragEnd");
-	return nullptr;
+	return _items.getObjectAt(pt);
 }
 
 bool CPetInventory::isValid(CPetControl *petControl) {
@@ -212,4 +249,8 @@ void CPetInventory::playMovie(CGameObject *movie, int flag) {
 	}
 }
 
+void CPetInventory::removeInvalid() {
+	_items.removeInvalid();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 3437d09..e931abf 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -53,6 +53,11 @@ private:
 	 * Get the index of an item added to the PET
 	 */
 	int getItemIndex(CGameObject *item) const;
+
+	/**
+	 * Remove any invalid inventory glyphs
+	 */
+	void removeInvalid();
 public:
 	CPetInventory();
 
@@ -77,41 +82,63 @@ public:
 	virtual Rect getBounds();
 	
 	/**
-	 * Save the data for the class to file
+	 * Called when a general change occurs
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void changed(int changeType);
 
 	/**
-	 * Load the data for the class from file
+	 * Following are handlers for the various messages that the PET can
+	 * pass onto the currently active section/area
 	 */
-	virtual void load(SimpleFile *file, int param);
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	virtual bool MouseDragStartMsg(CMouseDragStartMsg *msg);
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+	virtual bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
+	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg);
 
 	/**
 	 * Returns item a drag-drop operation has dropped on, if any
 	 */
 	virtual CGameObject *dragEnd(const Point &pt) const;
 
-
 	/**
 	 * Returns true if the object is in a valid state
 	 */
 	virtual bool isValid(CPetControl *petControl);
 
 	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param);
+
+	/**
 	 * Called after a game has been loaded
 	 */
 	virtual void postLoad();
 
 	/**
-	 * Called when a section is switched to
+	 * Save the data for the class to file
 	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	* Called when a section is switched to
+	*/
 	virtual void enter(PetArea oldArea);
-	
+
 	/**
-	 * Called when a section is being left, to switch to another area
-	 */
+	* Called when a section is being left, to switch to another area
+	*/
 	virtual void leave();
-	
+
+	/**
+	 * Get a reference to the tooltip text associated with the section
+	 */
+	virtual CPetText *getText() { return &_text; }
+
+	/**
+	 * Special retrieval of glyph background image
+	 */
 	virtual CGameObject *getBackground(int index) const;
 
 	/**
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h
index 06e1d06..716c9d1 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.h
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.h
@@ -109,9 +109,9 @@ public:
 	virtual void getTooltip(CPetText *text);
 
 	/**
-	 * Return whether the glyph has an associated image
+	 * Return whether the glyph is currently valid
 	 */
-	virtual bool hasImage() const { return _item && _background; }
+	virtual bool isValid() const { return _item && _background; }
 
 	/**
 	 * Returns the object associated with the glyph
diff --git a/engines/titanic/pet_control/pet_real_life.cpp b/engines/titanic/pet_control/pet_real_life.cpp
index 72e350c..b9e1990 100644
--- a/engines/titanic/pet_control/pet_real_life.cpp
+++ b/engines/titanic/pet_control/pet_real_life.cpp
@@ -76,7 +76,7 @@ bool CPetRealLife::KeyCharMsg(CKeyCharMsg *msg) {
 }
 
 bool CPetRealLife::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
-	return _glyphs.VirtualKeyCharMsg(msg->_keyState.keycode);
+	return _glyphs.VirtualKeyCharMsg(msg);
 }
 
 void CPetRealLife::postLoad() {
diff --git a/engines/titanic/pet_control/pet_real_life.h b/engines/titanic/pet_control/pet_real_life.h
index b00c7c1..aa980fc 100644
--- a/engines/titanic/pet_control/pet_real_life.h
+++ b/engines/titanic/pet_control/pet_real_life.h
@@ -69,8 +69,6 @@ public:
 	 */
 	virtual Rect getBounds() { return Rect(); }
 	
-	virtual void proc5(int val) {}
-	
 	/**
 	 * Following are handlers for the various messages that the PET can
 	 * pass onto the currently active section/area
diff --git a/engines/titanic/pet_control/pet_remote.cpp b/engines/titanic/pet_control/pet_remote.cpp
index f59f1fb..9b43b8d 100644
--- a/engines/titanic/pet_control/pet_remote.cpp
+++ b/engines/titanic/pet_control/pet_remote.cpp
@@ -158,7 +158,7 @@ bool CPetRemote::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
 }
 
 bool CPetRemote::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
-	return _items.VirtualKeyCharMsg(msg->_keyState.keycode);
+	return _items.VirtualKeyCharMsg(msg);
 }
 
 bool CPetRemote::isValid(CPetControl *petControl) {
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index bbb8daf..467c645 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -92,7 +92,7 @@ bool CPetRooms::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
 }
 
 bool CPetRooms::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
-	return _glyphs.VirtualKeyCharMsg(msg->_keyState.keycode);
+	return _glyphs.VirtualKeyCharMsg(msg);
 }
 
 bool CPetRooms::checkDragEnd(CGameObject *item) {
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index b39587a..14dbf8f 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -144,6 +144,9 @@ public:
 	 */
 	virtual CPetText *getText();
 
+	/**
+	 * Special retrieval of glyph background image
+	 */
 	virtual CGameObject *getBackground(int index);
 
 	/**
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index d888e05..cf729b7 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -76,7 +76,10 @@ public:
 	 */
 	virtual Rect getBounds() { return Rect(); }
 	
-	virtual void proc5(int val) {}
+	/**
+	 * Called when a general change occurs
+	 */
+	virtual void changed(int changeType) {}
 	
 	/**
 	 * Following are handlers for the various messages that the PET can
@@ -159,6 +162,9 @@ public:
 	 */
 	virtual CPetElement *getElement(uint id) { return nullptr; }
 
+	/**
+	 * Special retrieval of glyph background image
+	 */
 	virtual CGameObject *getBackground(int index) const { return nullptr; }
 
 	/**


Commit: 4ed93ca8f175d7a43c6a0de72ad02b42827938b7
    https://github.com/scummvm/scummvm/commit/4ed93ca8f175d7a43c6a0de72ad02b42827938b7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:56-04:00

Commit Message:
TITANIC: Cleanup of PET section classes methods to match original

Changed paths:
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_glyphs.cpp
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h
    engines/titanic/pet_control/pet_section.cpp
    engines/titanic/pet_control/pet_section.h



diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 4ec6e89..276b99e 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -506,13 +506,6 @@ void CPetConversations::textLineEntered(const CString &textLine) {
 	scrollToBottom();
 }
 
-CString CPetConversations::getActiveNPCName() const {
-	if (_petControl && _petControl->_activeNPC)
-		return _petControl->_activeNPC->getName();
-	else
-		return CString();
-}
-
 void CPetConversations::setActiveNPC(const CString &name) {
 	_npcName = name;
 	_field418 = 1;
@@ -520,11 +513,6 @@ void CPetConversations::setActiveNPC(const CString &name) {
 	startNPCTimer();
 }
 
-void CPetConversations::copyColors(uint tableNum, uint colors[5]) {
-	const uint *src = getColorTable(tableNum);
-	Common::copy(src, src + 5, colors);
-}
-
 void CPetConversations::updateDial(uint dialNum, const CString &npcName) {
 	TTnpcScript *script = getNPCScript(npcName);
 	uint newLevel = getDialLevel(dialNum, script);
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 9af1f14..4deab3e 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -125,21 +125,11 @@ private:
 	void textLineEntered(const CString &textLine);
 
 	/**
-	 * Returns the name of the currently active NPC, if any
-	 */
-	CString getActiveNPCName() const;
-
-	/**
 	 * Set the active NPC
 	 */
 	void setActiveNPC(const CString &name);
 
 	/**
-	 * Create a color table
-	 */
-	void copyColors(uint tableNum, uint colors[5]);
-
-	/**
 	 * Updates one of the dials with data from a given NPC
 	 */
 	void updateDial(uint dialNum, const CString &npcName);
diff --git a/engines/titanic/pet_control/pet_glyphs.cpp b/engines/titanic/pet_control/pet_glyphs.cpp
index eca6f30..c36bae6 100644
--- a/engines/titanic/pet_control/pet_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_glyphs.cpp
@@ -45,7 +45,7 @@ void CPetGlyph::updateTooltip() {
 		getTooltip(petText);
 
 		if (_owner)
-			getPetSection()->proc29();
+			getPetSection()->stopTextTimer();
 	}
 }
 
@@ -214,7 +214,7 @@ void CPetGlyphs::changeHighlight(int index) {
 			glyph->updateTooltip();
 		}
 	} else if (_owner) {
-		_owner->proc28();
+		_owner->removeText();
 	}
 }
 
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 467c645..fb7cb2b 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -276,11 +276,6 @@ uint CPetRooms::getRoomFlags() const {
 	return roomFlags.get();
 }
 
-void CPetRooms::areaChanged(PetArea area) {
-	if (_petControl && _petControl->_currentArea == area)
-		_petControl->makeDirty();
-}
-
 void CPetRooms::reassignRoom(int passClassNum) {
 	CPetRoomsGlyph *glyph = _glyphs.findAssignedRoom();
 	if (glyph)
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index 14dbf8f..64fd016 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -60,8 +60,6 @@ private:
 	 */
 	Point getGlyphPos() const { return Point(509, 388); }
 
-	void areaChanged(PetArea area);
-
 	/**
 	 * Adds a glyph to the list
 	 */
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp
index 116fd94..a29a8f8 100644
--- a/engines/titanic/pet_control/pet_section.cpp
+++ b/engines/titanic/pet_control/pet_section.cpp
@@ -39,30 +39,36 @@ static const uint PALETTE3[5] = {
 };
 
 void CPetSection::displayMessage(const CString &msg) {
-	error("TODO");
+	CPetText *text = getText();
+
+	if (text) {
+		text->setColor(getColor(1));
+		_petControl->makeDirty();
+		removeText(5000);
+	}
 }
 
 void CPetSection::proc25(int val) {
 	if (!val) {
-		proc28();
+		removeText();
 		_petControl->makeDirty();
 	}
 }
 
-void CPetSection::proc27(int duration) {
+void CPetSection::removeText(int duration) {
 	if (duration > 0)
 		_petControl->startPetTimer(0, duration, 0, this);
 	else
-		proc28();
+		removeText();
 }
 
-void CPetSection::proc28() {
+void CPetSection::removeText() {
 	CPetText *text = getText();
 	if (text)
 		text->setup();
 }
 
-void CPetSection::proc29() {
+void CPetSection::stopTextTimer() {
 	_petControl->stopPetTimer(0);
 }
 
@@ -83,4 +89,21 @@ const uint *CPetSection::getColorTable(int tableNum) {
 	}
 }
 
+void CPetSection::areaChanged(PetArea area) {
+	if (_petControl && _petControl->_currentArea == area)
+		_petControl->makeDirty();
+}
+
+CString CPetSection::getActiveNPCName() const {
+	if (_petControl && _petControl->_activeNPC)
+		return _petControl->_activeNPC->getName();
+	else
+		return CString();
+}
+
+void CPetSection::copyColors(uint tableNum, uint colors[5]) {
+	const uint *src = getColorTable(tableNum);
+	Common::copy(src, src + 5, colors);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index cf729b7..5ae86b7 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -52,6 +52,21 @@ struct CPetSectionSubData {
 class CPetSection {
 public:
 	CPetControl *_petControl;
+protected:
+	/**
+	 * Called when the current area is changed
+	 */
+	void areaChanged(PetArea area);
+
+	/**
+	 * Returns the name of the currently active NPC, if any
+	 */
+	CString getActiveNPCName() const;
+
+	/**
+	 * Create a color table
+	 */
+	void copyColors(uint tableNum, uint colors[5]);
 public:
 	CPetSection() : _petControl(nullptr) {}
 	virtual ~CPetSection() {}
@@ -153,9 +168,20 @@ public:
 	 */
 	virtual CPetText *getText() { return nullptr; }
 
-	virtual void proc27(int duration);
-	virtual void proc28();
-	virtual void proc29();
+	/**
+	 * Removes text after a given duration
+	 */
+	virtual void removeText(int duration);
+	
+	/**
+	 * Removes text after a given duration
+	 */
+	virtual void removeText();
+
+	/**
+	 * Stops the text removal timer
+	 */
+	virtual void stopTextTimer();
 
 	/**
 	 * Get an element from the section by a designated Id


Commit: 243a3e6a7dbedf5960a20b7028263310fb5ab27a
    https://github.com/scummvm/scummvm/commit/243a3e6a7dbedf5960a20b7028263310fb5ab27a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:24:58-04:00

Commit Message:
TITANIC: Rename CPlaceHolder to CPlaceHolderItem to match original

Changed paths:
  A engines/titanic/game/placeholder/place_holder_item.cpp
  A engines/titanic/game/placeholder/place_holder_item.h
  R engines/titanic/game/placeholder/place_holder.cpp
  R engines/titanic/game/placeholder/place_holder.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
    engines/titanic/game/placeholder/bar_shelf_vis_centre.h
    engines/titanic/game/placeholder/lemon_on_bar.cpp
    engines/titanic/game/placeholder/lemon_on_bar.h
    engines/titanic/game/placeholder/tv_on_bar.cpp
    engines/titanic/game/placeholder/tv_on_bar.h
    engines/titanic/module.mk



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index f6c83b2..300d971 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -251,7 +251,7 @@
 #include "titanic/game/pickup/pick_up_vis_centre.h"
 #include "titanic/game/placeholder/bar_shelf_vis_centre.h"
 #include "titanic/game/placeholder/lemon_on_bar.h"
-#include "titanic/game/placeholder/place_holder.h"
+#include "titanic/game/placeholder/place_holder_item.h"
 #include "titanic/game/placeholder/tv_on_bar.h"
 #include "titanic/game/sgt/armchair.h"
 #include "titanic/game/sgt/basin.h"
@@ -665,7 +665,7 @@ DEFFN(CPickUpSpeechCentre)
 DEFFN(CPickUpVisCentre)
 DEFFN(CBarShelfVisCentre)
 DEFFN(CLemonOnBar)
-DEFFN(CPlaceHolder)
+DEFFN(CPlaceHolderItem)
 DEFFN(CTVOnBar)
 DEFFN(CArmchair)
 DEFFN(CBasin)
@@ -1245,10 +1245,10 @@ void CSaveableObject::initClassList() {
 	ADDFN(CPickUpLemon, CPickUp);
 	ADDFN(CPickUpSpeechCentre, CPickUp);
 	ADDFN(CPickUpVisCentre, CPickUp);
-	ADDFN(CBarShelfVisCentre, CPlaceHolder);
-	ADDFN(CLemonOnBar, CPlaceHolder);
-	ADDFN(CPlaceHolder, CGameObject);
-	ADDFN(CTVOnBar, CPlaceHolder);
+	ADDFN(CBarShelfVisCentre, CPlaceHolderItem);
+	ADDFN(CLemonOnBar, CPlaceHolderItem);
+	ADDFN(CPlaceHolderItem, CGameObject);
+	ADDFN(CTVOnBar, CPlaceHolderItem);
 	ADDFN(CArmchair, CSGTStateRoom);
 	ADDFN(CBasin, CSGTStateRoom);
 	ADDFN(CBedfoot, CSGTStateRoom);
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 9b50970..190dc99 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -34,6 +34,7 @@
 #include "titanic/core/room_item.h"
 #include "titanic/pet_control/pet_control.h"
 #include "titanic/game_manager.h"
+#include "titanic/game/placeholder/place_holder_item.h"
 
 namespace Titanic {
 
@@ -95,6 +96,10 @@ bool CTreeItem::isLinkItem() const {
 	return isInstanceOf(CLinkItem::_type);
 }
 
+bool CTreeItem::isPlaceHolderItem() const {
+	return isInstanceOf(CPlaceHolderItem::_type);
+}
+
 bool CTreeItem::isNamedItem() const {
 	return isInstanceOf(CNamedItem::_type);
 }
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index c0d37d1..2ea7b42 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -99,6 +99,11 @@ public:
 	virtual bool isLinkItem() const;
 
 	/**
+	 * Returns true if the item is a placeholder item
+	 */
+	virtual bool isPlaceHolderItem() const;
+
+	/**
 	 * Returns true if the item is a named item
 	 */
 	virtual bool isNamedItem() const;
diff --git a/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp b/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
index 3d3a056..f3eda05 100644
--- a/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
+++ b/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
@@ -27,13 +27,13 @@ namespace Titanic {
 void CBarShelfVisCentre::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
-	CPlaceHolder::save(file, indent);
+	CPlaceHolderItem::save(file, indent);
 }
 
 void CBarShelfVisCentre::load(SimpleFile *file) {
 	file->readNumber();
 	_value = file->readNumber();
-	CPlaceHolder::load(file);
+	CPlaceHolderItem::load(file);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/placeholder/bar_shelf_vis_centre.h b/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
index a2d39c3..a5acff6 100644
--- a/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
+++ b/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
@@ -23,16 +23,16 @@
 #ifndef TITANIC_BAR_SHELF_VIS_CENTRE_H
 #define TITANIC_BAR_SHELF_VIS_CENTRE_H
 
-#include "titanic/game/placeholder/place_holder.h"
+#include "titanic/game/placeholder/place_holder_item.h"
 
 namespace Titanic {
 
-class CBarShelfVisCentre : public CPlaceHolder {
+class CBarShelfVisCentre : public CPlaceHolderItem {
 private:
 	int _value;
 public:
 	CLASSDEF
-	CBarShelfVisCentre() : CPlaceHolder(), _value(0) {}
+	CBarShelfVisCentre() : CPlaceHolderItem(), _value(0) {}
 	
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/placeholder/lemon_on_bar.cpp b/engines/titanic/game/placeholder/lemon_on_bar.cpp
index 336933a..d51f4b8 100644
--- a/engines/titanic/game/placeholder/lemon_on_bar.cpp
+++ b/engines/titanic/game/placeholder/lemon_on_bar.cpp
@@ -27,13 +27,13 @@ namespace Titanic {
 void CLemonOnBar::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writePoint(_pos1, indent);
-	CPlaceHolder::save(file, indent);
+	CPlaceHolderItem::save(file, indent);
 }
 
 void CLemonOnBar::load(SimpleFile *file) {
 	file->readNumber();
 	_pos1 = file->readPoint();
-	CPlaceHolder::load(file);
+	CPlaceHolderItem::load(file);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/placeholder/lemon_on_bar.h b/engines/titanic/game/placeholder/lemon_on_bar.h
index 18559b0..d1654bf 100644
--- a/engines/titanic/game/placeholder/lemon_on_bar.h
+++ b/engines/titanic/game/placeholder/lemon_on_bar.h
@@ -23,11 +23,11 @@
 #ifndef TITANIC_LEMON_ON_BAR_H
 #define TITANIC_LEMON_ON_BAR_H
 
-#include "titanic/game/placeholder/place_holder.h"
+#include "titanic/game/placeholder/place_holder_item.h"
 
 namespace Titanic {
 
-class CLemonOnBar : public CPlaceHolder {
+class CLemonOnBar : public CPlaceHolderItem {
 private:
 	Point _pos1;
 public:
diff --git a/engines/titanic/game/placeholder/place_holder.cpp b/engines/titanic/game/placeholder/place_holder.cpp
deleted file mode 100644
index d96f551..0000000
--- a/engines/titanic/game/placeholder/place_holder.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/game/placeholder/place_holder.h"
-
-namespace Titanic {
-
-void CPlaceHolder::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(1, indent);
-	CGameObject::save(file, indent);
-}
-
-void CPlaceHolder::load(SimpleFile *file) {
-	file->readNumber();
-	CGameObject::load(file);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/game/placeholder/place_holder.h b/engines/titanic/game/placeholder/place_holder.h
deleted file mode 100644
index 4d01cd6..0000000
--- a/engines/titanic/game/placeholder/place_holder.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PLACE_HOLDER_H
-#define TITANIC_PLACE_HOLDER_H
-
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-class CPlaceHolder : public CGameObject {
-public:
-	CLASSDEF
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PLACE_HOLDER_H */
diff --git a/engines/titanic/game/placeholder/place_holder_item.cpp b/engines/titanic/game/placeholder/place_holder_item.cpp
new file mode 100644
index 0000000..a3c26c8
--- /dev/null
+++ b/engines/titanic/game/placeholder/place_holder_item.cpp
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/game/placeholder/place_holder_item.h"
+
+namespace Titanic {
+
+void CPlaceHolderItem::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CGameObject::save(file, indent);
+}
+
+void CPlaceHolderItem::load(SimpleFile *file) {
+	file->readNumber();
+	CGameObject::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/game/placeholder/place_holder_item.h b/engines/titanic/game/placeholder/place_holder_item.h
new file mode 100644
index 0000000..c665e0f
--- /dev/null
+++ b/engines/titanic/game/placeholder/place_holder_item.h
@@ -0,0 +1,47 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PLACE_HOLDER_H
+#define TITANIC_PLACE_HOLDER_H
+
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+class CPlaceHolderItem : public CGameObject {
+public:
+	CLASSDEF
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PLACE_HOLDER_H */
diff --git a/engines/titanic/game/placeholder/tv_on_bar.cpp b/engines/titanic/game/placeholder/tv_on_bar.cpp
index 5b22069..3b97658 100644
--- a/engines/titanic/game/placeholder/tv_on_bar.cpp
+++ b/engines/titanic/game/placeholder/tv_on_bar.cpp
@@ -27,13 +27,13 @@ namespace Titanic {
 void CTVOnBar::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writePoint(_pos1, indent);
-	CPlaceHolder::save(file, indent);
+	CPlaceHolderItem::save(file, indent);
 }
 
 void CTVOnBar::load(SimpleFile *file) {
 	file->readNumber();
 	_pos1 = file->readPoint();
-	CPlaceHolder::load(file);
+	CPlaceHolderItem::load(file);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/placeholder/tv_on_bar.h b/engines/titanic/game/placeholder/tv_on_bar.h
index 3af59de..2cc5494 100644
--- a/engines/titanic/game/placeholder/tv_on_bar.h
+++ b/engines/titanic/game/placeholder/tv_on_bar.h
@@ -23,11 +23,11 @@
 #ifndef TITANIC_TV_ON_BAR_H
 #define TITANIC_TV_ON_BAR_H
 
-#include "titanic/game/placeholder/place_holder.h"
+#include "titanic/game/placeholder/place_holder_item.h"
 
 namespace Titanic {
 
-class CTVOnBar : public CPlaceHolder {
+class CTVOnBar : public CPlaceHolderItem {
 private:
 	Point _pos1;
 public:
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index b1b35fc..a204c7c 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -245,7 +245,7 @@ MODULE_OBJS := \
 	game/pickup/pick_up_speech_centre.o \
 	game/pickup/pick_up_vis_centre.o \
 	game/placeholder/bar_shelf_vis_centre.o \
-	game/placeholder/place_holder.o \
+	game/placeholder/place_holder_item.o \
 	game/placeholder/lemon_on_bar.o \
 	game/placeholder/tv_on_bar.o \
 	game/transport/gondolier.o \


Commit: 507924b39d0beb50bacb05f3ad15f66fc113f3a9
    https://github.com/scummvm/scummvm/commit/507924b39d0beb50bacb05f3ad15f66fc113f3a9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:01-04:00

Commit Message:
TITANIC: Fix initializing PET Remote glyphs

Changed paths:
    engines/titanic/pet_control/pet_remote_glyphs.cpp



diff --git a/engines/titanic/pet_control/pet_remote_glyphs.cpp b/engines/titanic/pet_control/pet_remote_glyphs.cpp
index e42e082..6b7c8cb 100644
--- a/engines/titanic/pet_control/pet_remote_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_remote_glyphs.cpp
@@ -39,8 +39,8 @@ void CPetRemoteGlyphs::generateMessage(RemoteMessage msgNum, const CString &name
 /*------------------------------------------------------------------------*/
 
 void CPetRemoteGlyph::setDefaults(const CString &name, CPetControl *petControl) {
-	_gfxElement->setBounds(Rect(0, 0, 52, 52));
-	_gfxElement->setup(MODE_UNSELECTED, name, petControl);
+	_element.setBounds(Rect(0, 0, 52, 52));
+	_element.setup(MODE_UNSELECTED, name, petControl);
 }
 
 CPetRemoteGlyphs *CPetRemoteGlyph::getOwner() const {


Commit: 04afc633794035cfcc0cb7030113d7750a7dbae3
    https://github.com/scummvm/scummvm/commit/04afc633794035cfcc0cb7030113d7750a7dbae3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:03-04:00

Commit Message:
TITANIC: Adding savegame header load/save methods

Changed paths:
    engines/titanic/core/project_item.cpp
    engines/titanic/core/project_item.h
    engines/titanic/support/simple_file.cpp
    engines/titanic/support/simple_file.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 7546f20..c6a5c2e 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -22,6 +22,8 @@
 
 #include "common/file.h"
 #include "common/savefile.h"
+#include "graphics/scaler.h"
+#include "graphics/thumbnail.h"
 #include "titanic/game_manager.h"
 #include "titanic/titanic.h"
 #include "titanic/core/dont_save_file_item.h"
@@ -32,6 +34,13 @@
 
 namespace Titanic {
 
+#define CURRENT_SAVEGAME_VERSION 1
+#define MAX_SAVEGAME_SLOTS 99
+#define MINIMUM_SAVEGAME_VERSION 1
+
+static const char *const SAVEGAME_STR = "TNIC";
+#define SAVEGAME_STR_SIZE 4
+
 void CFileListItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(0, indent);
 	file->writeQuotedLine(_name, indent);
@@ -158,6 +167,11 @@ void CProjectItem::loadGame(int slotId) {
 		file.open(newFile);
 	}
 
+	// Load the savegame header in
+	TitanicSavegameHeader header;
+	readSavegameHeader(&file, header);
+	delete header._thumbnail;
+
 	// Load the contents in
 	CProjectItem *newProject = loadData(&file);
 	file.IsClassStart();
@@ -183,7 +197,7 @@ void CProjectItem::loadGame(int slotId) {
 	postLoad();
 }
 
-void CProjectItem::saveGame(int slotId) {
+void CProjectItem::saveGame(int slotId, const CString &desc) {
 	CompressedFile file;
 	Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(
 		Common::String::format("slot%d.gam", slotId));
@@ -192,6 +206,11 @@ void CProjectItem::saveGame(int slotId) {
 	// Signal the game is being saved
 	preSave();
 
+	// Write out the savegame header
+	TitanicSavegameHeader header;
+	header._saveName = desc;
+	writeSavegameHeader(&file, header);
+
 	// Save the contents out
 	saveData(&file, this);
 
@@ -411,4 +430,111 @@ CViewItem *CProjectItem::findView(int roomNumber, int nodeNumber, int viewNumber
 	return nullptr;
 }
 
+SaveStateList CProjectItem::getSavegameList(const Common::String &target) {
+	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+	Common::StringArray filenames;
+	Common::String saveDesc;
+	Common::String pattern = Common::String::format("%s.0??", target.c_str());
+	TitanicSavegameHeader header;
+
+	filenames = saveFileMan->listSavefiles(pattern);
+	sort(filenames.begin(), filenames.end());   // Sort to get the files in numerical order
+
+	SaveStateList saveList;
+	for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
+		const char *ext = strrchr(file->c_str(), '.');
+		int slot = ext ? atoi(ext + 1) : -1;
+
+		if (slot >= 0 && slot < MAX_SAVEGAME_SLOTS) {
+			Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(*file);
+
+			if (in) {
+				SimpleFile f;
+				f.open(in);
+				if (!readSavegameHeader(&f, header))
+					continue;
+
+				saveList.push_back(SaveStateDescriptor(slot, header._saveName));
+
+				header._thumbnail->free();
+				delete header._thumbnail;
+				delete in;
+			}
+		}
+	}
+
+	return saveList;
+}
+
+bool CProjectItem::readSavegameHeader(SimpleFile *file, TitanicSavegameHeader &header) {
+	char saveIdentBuffer[SAVEGAME_STR_SIZE + 1];
+	header._thumbnail = nullptr;
+
+	// Validate the header Id
+	file->unsafeRead(saveIdentBuffer, SAVEGAME_STR_SIZE + 1);
+	if (strncmp(saveIdentBuffer, SAVEGAME_STR, SAVEGAME_STR_SIZE)) {
+		file->seek(-SAVEGAME_STR_SIZE, SEEK_CUR);
+		header._saveName = "Unnamed";
+		return true;
+	}
+
+	header._version = file->readByte();
+	if (header._version < MINIMUM_SAVEGAME_VERSION || header._version > CURRENT_SAVEGAME_VERSION)
+		return false;
+
+	// Read in the string
+	header._saveName.clear();
+	char ch;
+	while ((ch = (char)file->readByte()) != '\0') header._saveName += ch;
+
+	// Get the thumbnail
+	header._thumbnail = Graphics::loadThumbnail(*file);
+	if (!header._thumbnail)
+		return false;
+
+	// Read in save date/time
+	header._year = file->readUint16LE();
+	header._month = file->readUint16LE();
+	header._day = file->readUint16LE();
+	header._hour = file->readUint16LE();
+	header._minute = file->readUint16LE();
+	header._totalFrames = file->readUint32LE();
+
+	return true;
+}
+
+void CProjectItem::writeSavegameHeader(SimpleFile *file, TitanicSavegameHeader &header) {
+	// Write out a savegame header
+	file->write(SAVEGAME_STR, SAVEGAME_STR_SIZE + 1);
+
+	file->writeByte(CURRENT_SAVEGAME_VERSION);
+
+	// Write savegame name
+	file->write(header._saveName.c_str(), header._saveName.size());
+	file->writeByte('\0');
+
+	// Create a thumbnail of the screen and save it out
+	Graphics::Surface *thumb = createThumbnail();
+	Graphics::saveThumbnail(*file, *thumb);
+	thumb->free();
+	delete thumb;
+
+	// Write out the save date/time
+	TimeDate td;
+	g_system->getTimeAndDate(td);
+	file->writeUint16LE(td.tm_year + 1900);
+	file->writeUint16LE(td.tm_mon + 1);
+	file->writeUint16LE(td.tm_mday);
+	file->writeUint16LE(td.tm_hour);
+	file->writeUint16LE(td.tm_min);
+	file->writeUint16LE(g_vm->_events->getFrameCounter());
+}
+
+Graphics::Surface *CProjectItem::createThumbnail() {
+	Graphics::Surface *thumb = new Graphics::Surface();
+
+	::createThumbnailFromScreen(thumb);
+	return thumb;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index 0807460..213fa9d 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -24,6 +24,9 @@
 #define TITANIC_PROJECT_ITEM_H
 
 #include "common/scummsys.h"
+#include "common/str.h"
+#include "engines/savestate.h"
+#include "graphics/surface.h"
 #include "titanic/support/simple_file.h"
 #include "titanic/core/dont_save_file_item.h"
 #include "titanic/core/file_item.h"
@@ -32,6 +35,16 @@
 
 namespace Titanic {
 
+struct TitanicSavegameHeader {
+	uint8 _version;
+	CString _saveName;
+	Graphics::Surface *_thumbnail;
+	int _year, _month, _day;
+	int _hour, _minute;
+	int _totalFrames;
+};
+
+
 class CGameManager;
 class CPetControl;
 class CViewItem;
@@ -117,6 +130,26 @@ private:
 	 * Save project data to the passed file
 	 */
 	void saveData(SimpleFile *file, CTreeItem *item) const;
+
+	/**
+	 * Creates a thumbnail for the current on-screen contents
+	 */
+	static Graphics::Surface *createThumbnail();
+public:
+	/**
+	 * Load a list of savegames
+	 */
+	static SaveStateList getSavegameList(const Common::String &target);
+
+	/**
+	 * Write out the header information for a savegame
+	 */
+	static void writeSavegameHeader(SimpleFile *file, TitanicSavegameHeader &header);
+
+	/**
+	 * Read in the header information for a savegame
+	 */
+	static bool readSavegameHeader(SimpleFile *file, TitanicSavegameHeader &header);
 public:
 	CLASSDEF
 	CProjectItem();
@@ -159,7 +192,7 @@ public:
 	/**
 	 * Save the entire project data to a given savegame slot
 	 */
-	void saveGame(int slotId);
+	void saveGame(int slotId, const CString &desc);
 
 	/**
 	 * Clear any currently loaded project
diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp
index 45b5c8a..e60b7c7 100644
--- a/engines/titanic/support/simple_file.cpp
+++ b/engines/titanic/support/simple_file.cpp
@@ -89,12 +89,29 @@ size_t SimpleFile::write(const void *src, size_t count) const {
 	return _outStream->write(src, count);
 }
 
+void SimpleFile::seek(int offset, int origin) {
+	assert(_inStream);
+	_inStream->seek(offset, origin);
+}
+
 byte SimpleFile::readByte() {
 	byte b;
 	safeRead(&b, 1);
 	return b;
 }
 
+uint SimpleFile::readUint16LE() {
+	uint val;
+	safeRead(&val, 2);
+	return READ_LE_UINT16(&val);
+}
+
+uint SimpleFile::readUint32LE() {
+	uint val;
+	safeRead(&val, 4);
+	return READ_LE_UINT32(&val);
+}
+
 CString SimpleFile::readString() {
 	char c;
 	CString result;
@@ -248,6 +265,20 @@ void SimpleFile::readBuffer(char *buffer, size_t count) {
 	}
 }
 
+void SimpleFile::writeUint16LE(uint val) {
+	byte lo = val & 0xff;
+	byte hi = (val >> 8) & 0xff;
+	write(&lo, 1);
+	write(&hi, 1);
+}
+
+void SimpleFile::writeUint32LE(uint val) {
+	uint16 lo = val & 0xffff;
+	uint16 hi = (val >> 16) & 0xff;
+	writeUint16LE(lo);
+	writeUint16LE(hi);
+}
+
 void SimpleFile::writeLine(const CString &str) const {
 	write(str.c_str(), str.size());
 	write("\r\n", 2);
diff --git a/engines/titanic/support/simple_file.h b/engines/titanic/support/simple_file.h
index bca96a6..a83e592 100644
--- a/engines/titanic/support/simple_file.h
+++ b/engines/titanic/support/simple_file.h
@@ -61,6 +61,9 @@ public:
 	SimpleFile();
 	virtual ~SimpleFile();
 
+	operator Common::SeekableReadStream &() { return *_inStream; }
+	operator Common::WriteStream &() { return *_outStream; }
+
 	/**
 	 * Set up a stream for read access
 	 */
@@ -92,11 +95,26 @@ public:
 	virtual size_t write(const void *src, size_t count) const;
 
 	/**
+	 * Seek
+	 */
+	virtual void seek(int offset, int origin);
+
+	/**
 	 * Read a byte
 	 */
 	byte readByte();
 
 	/**
+	 * Read a 16-bit LE number
+	 */
+	uint readUint16LE();
+
+	/**
+	 * Read a 32-bit LE number
+	 */
+	uint readUint32LE();
+
+	/**
 	 * Read a string from the file
 	 */
 	CString readString();
@@ -137,6 +155,21 @@ public:
 	bool scanf(const char *format, ...);
 
 	/**
+	 * Write out a byte
+	 */
+	void writeByte(byte b) { write(&b, 1); }
+
+	/**
+	 * Write out a raw 16-bit LE number
+	 */
+	void writeUint16LE(uint val);
+
+	/**
+	 * Write out a raw 32-bit LE number
+	 */
+	void writeUint32LE(uint val);
+
+	/**
 	 * Write a string line
 	 */
 	void writeLine(const CString &str) const;
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 9d44cd6..ab734d9 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -157,4 +157,27 @@ void TitanicEngine::setRoomNames() {
 	delete r;
 }
 
+
+bool TitanicEngine::canLoadGameStateCurrently() {
+	return _window->_inputAllowed;
+}
+
+bool TitanicEngine::canSaveGameStateCurrently() {
+	return _window->_inputAllowed;
+}
+
+Common::Error TitanicEngine::loadGameState(int slot) {
+	_window->_project->loadGame(slot);
+	return Common::kNoError;
+}
+
+Common::Error TitanicEngine::saveGameState(int slot, const Common::String &desc) {
+	_window->_project->saveGame(slot, desc);
+	return Common::kNoError;
+}
+
+CString TitanicEngine::generateSaveName(int slot) {
+	return CString::format("%s.%03d", _targetName.c_str(), slot);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 4391796..9acf78c 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -73,15 +73,6 @@ enum TitanicDebugChannels {
 struct TitanicGameDescription;
 class TitanicEngine;
 
-struct TitanicSavegameHeader {
-	uint8 _version;
-	Common::String _saveName;
-	Graphics::Surface *_thumbnail;
-	int _year, _month, _day;
-	int _hour, _minute;
-	int _totalFrames;
-};
-
 class TitanicEngine : public Engine {
 private:
 	/**
@@ -133,6 +124,27 @@ public:
 	TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDesc);
 	virtual ~TitanicEngine();
 
+
+	/**
+	 * Returns true if a savegame can be loaded
+	 */
+	virtual bool canLoadGameStateCurrently();
+
+	/**
+	 * Returns true if the game can be saved
+	 */
+	virtual bool canSaveGameStateCurrently();
+
+	/**
+	 * Called by the GMM to load a savegame
+	 */
+	virtual Common::Error loadGameState(int slot);
+
+	/**
+	 * Called by the GMM to save the game
+	 */
+	virtual Common::Error saveGameState(int slot, const Common::String &desc);
+
 	uint32 getFeatures() const;
 	bool isDemo() const;
 	Common::Language getLanguage() const;
@@ -141,6 +153,12 @@ public:
 	 * Gets a random number
 	 */
 	uint getRandomNumber(uint max) { return _randomSource.getRandomNumber(max); }
+
+	/**
+	 * Support method that generates a savegame name
+	 * @param slot		Slot number
+	 */
+	CString generateSaveName(int slot);
 };
 
 extern TitanicEngine *g_vm;


Commit: 0146a3c6b6bdb16eef6f46e116b0d9fe9883858f
    https://github.com/scummvm/scummvm/commit/0146a3c6b6bdb16eef6f46e116b0d9fe9883858f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:06-04:00

Commit Message:
TITANIC: Added remaining CPetControl methods

Changed paths:
    engines/titanic/carry/carry_parrot.cpp
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_inventory_glyphs.cpp
    engines/titanic/pet_control/pet_section.cpp
    engines/titanic/pet_control/pet_section.h
    engines/titanic/support/simple_file.h



diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index d164e2e..e274679 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -222,7 +222,7 @@ bool CCarryParrot::ActMsg(CActMsg *msg) {
 			}
 
 			getPetControl()->removeFromInventory(this);
-			getPetControl()->setC8(true);
+			getPetControl()->setAreaChangeType(1);
 			moveUnder(getRoom());
 		}
 
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 7b89438..95024b9 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -1002,12 +1002,12 @@ int CGameObject::getClipDuration(const CString &name, int frameRate) const {
 	return clip ? (clip->_endFrame - clip->_startFrame) * 1000 / frameRate : 0;
 }
 
-void CGameObject::petIncC0() {
-	getPetControl()->incC0();
+void CGameObject::petLockInput() {
+	getPetControl()->incInputLocks();
 }
 
-void CGameObject::petDecC0() {
-	getPetControl()->decC0();
+void CGameObject::petUnlockInput() {
+	getPetControl()->decInputLocks();
 }
 
 void CGameObject::setState1C(bool flag) {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 7f245cc..7a12abe 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -367,9 +367,6 @@ protected:
 	 */
 	int getClipDuration(const CString &name, int frameRate = 14) const;
 
-	void petIncC0();
-	void petDecC0();
-
 	void setState1C(bool flag);
 
 	/**
@@ -401,6 +398,16 @@ protected:
 	 * Resets the Mail Man value
 	 */
 	void resetMail();
+
+	/**
+	 * Locks the PET, disabling all input. Can be called multiple times
+	 */
+	void petLockInput();
+	
+	/**
+	 * Unlocks PET input
+	 */
+	void petUnlockInput();
 public:
 	bool _isMail;
 	int _id;
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index f5c5647..7e5cd20 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -43,9 +43,9 @@ BEGIN_MESSAGE_MAP(CPetControl, CGameObject)
 END_MESSAGE_MAP()
 
 CPetControl::CPetControl() : CGameObject(), 
-		_currentArea(PET_CONVERSATION), _fieldC0(0), _locked(0), _fieldC8(0),
-		_activeNPC(nullptr), _remoteTarget(nullptr), _hiddenRoom(nullptr),
-		_drawBounds(20, 350, 620, 480) {
+		_currentArea(PET_CONVERSATION), _inputLockCount(0), _areaLockCount(0),
+		_areaChangeType(-1), _activeNPC(nullptr), _remoteTarget(nullptr),
+		_hiddenRoom(nullptr), _drawBounds(20, 350, 620, 480) {
 	_sections[PET_INVENTORY] = &_inventory;
 	_sections[PET_CONVERSATION] = &_conversations;
 	_sections[PET_REMOTE] = &_remote;
@@ -81,7 +81,7 @@ void CPetControl::load(SimpleFile *file) {
 }
 
 void CPetControl::setup() {
-	warning("TODO: CPetControl::setup");
+	_conversations.setup(this);
 	_rooms.setup(this);
 	_remote.setup(this);
 	_inventory.setup(this);
@@ -130,9 +130,9 @@ void CPetControl::draw(CScreenManager *screenManager) {
 	bounds.constrain(gameManager->_bounds);
 
 	if (!bounds.isEmpty()) {
-		if (_fieldC8 >= 0) {
-			_inventory.changed(_fieldC8);
-			_fieldC8 = -1;
+		if (_areaChangeType >= 0) {
+			_inventory.changed(_areaChangeType);
+			_areaChangeType = -1;
 		}
 
 		_frame.drawFrame(screenManager);
@@ -188,13 +188,8 @@ void CPetControl::resetActiveNPC() {
 	_activeNPCName = "";
 }
 
-bool CPetControl::fn1(int val) {
-	warning("TODO: CPetControl::fn1");
-	return false;
-}
-
 PetArea CPetControl::setArea(PetArea newArea) {
-	if (newArea == _currentArea || !isUnlocked())
+	if (newArea == _currentArea || !isAreaActive())
 		return _currentArea;
 
 	// Signal the currently active area that it's being left
@@ -249,11 +244,11 @@ bool CPetControl::containsPt(const Common::Point &pt) const {
 }
 
 bool CPetControl::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
-	if (!containsPt(msg->_mousePos) || getC0())
+	if (!containsPt(msg->_mousePos) || isInputLocked())
 		return false;
 
 	bool result = false;
-	if (isUnlocked())
+	if (isAreaActive())
 		result = _frame.MouseButtonDownMsg(msg);
 
 	if (!result) {
@@ -265,7 +260,7 @@ bool CPetControl::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 }
 
 bool CPetControl::MouseDragStartMsg(CMouseDragStartMsg *msg) {
-	if (!containsPt(msg->_mousePos) || getC0())
+	if (!containsPt(msg->_mousePos) || isInputLocked())
 		return false;
 
 	return _sections[_currentArea]->MouseDragStartMsg(msg);
@@ -280,11 +275,11 @@ bool CPetControl::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 }
 
 bool CPetControl::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
-	if (!containsPt(msg->_mousePos) || getC0())
+	if (!containsPt(msg->_mousePos) || isInputLocked())
 		return false;
 
 	bool result = false;
-	if (isUnlocked())
+	if (isAreaActive())
 		result = _frame.MouseButtonUpMsg(msg);
 
 	if (!result)
@@ -295,21 +290,21 @@ bool CPetControl::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
 }
 
 bool CPetControl::MouseDoubleClickMsg(CMouseDoubleClickMsg *msg) {
-	if (!containsPt(msg->_mousePos) || getC0())
+	if (!containsPt(msg->_mousePos) || isInputLocked())
 		return false;
 
 	return _sections[_currentArea]->MouseDoubleClickMsg(msg);
 }
 
 bool CPetControl::KeyCharMsg(CKeyCharMsg *msg) {
-	if (getC0())
+	if (isInputLocked())
 		return false;
 
 	return _sections[_currentArea]->KeyCharMsg(msg);
 }
 
 bool CPetControl::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
-	if (getC0())
+	if (isInputLocked())
 		return false;
 
 	bool result = _sections[_currentArea]->VirtualKeyCharMsg(msg);
@@ -498,7 +493,7 @@ void CPetControl::summonNPC(const CString &name, int val) {
 	}
 }
 
-void CPetControl::startPetTimer(uint timerIndex, uint firstDuration, uint duration, void *target) {
+void CPetControl::startPetTimer(uint timerIndex, uint firstDuration, uint duration, CPetSection *target) {
 	stopPetTimer(timerIndex);
 	_timers[timerIndex]._id = addTimer(timerIndex, firstDuration, duration);
 	_timers[timerIndex]._target = target;
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 5e47f32..c3afb78 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -46,13 +46,13 @@ class CPetControl : public CGameObject {
 	DECLARE_MESSAGE_MAP
 	struct PetEventInfo {
 		int _id;
-		void *_target;
+		CPetSection *_target;
 		PetEventInfo() : _id(0), _target(nullptr) {}
 	};
 private:
-	int _fieldC0;
-	int _locked;
-	int _fieldC8;
+	int _inputLockCount;
+	int _areaLockCount;
+	int _areaChangeType;
 	CPetSection *_sections[7];
 	CPetConversations _conversations;
 	CPetInventory _inventory;
@@ -163,13 +163,6 @@ public:
 	void resetRemoteTarget();
 
 	/**
-	 * Resets the Active NPC
-	 */
-	void resetActiveNPC();
-
-	bool fn1(int val);
-
-	/**
 	 * Set the remote target
 	 */
 	void setRemoteTarget(CGameObject *item);
@@ -194,10 +187,6 @@ public:
 	 */
 	void highlightGlyph(int id);
 
-	/**
-	 * Returns true if the PET is currently unlocked
-	 */
-	bool isUnlocked() const { return _locked == 0; }
 
 	/**
 	 * Returns a game object used by the PET by name from within the
@@ -274,7 +263,11 @@ public:
 	 */
 	void moveToHiddenRoom(CTreeItem *item);
 
-	void setC8(int val) { _fieldC8 = val; }
+	/**
+	 * Sets a change for the PET Area's glyphs. Only applicable when
+	 * the Inventory is the active tab
+	 */
+	void setAreaChangeType(int changeType) { _areaChangeType = changeType; }
 
 	/**
 	 * Play a sound
@@ -297,9 +290,9 @@ public:
 	void summonNPC(const CString &name, int val);
 
 	/**
-	 * Start a timer
+	 * Start a timer for a Pet Area
 	 */
-	void startPetTimer(uint timerIndex, uint firstDuration, uint duration, void *target);
+	void startPetTimer(uint timerIndex, uint firstDuration, uint duration, CPetSection *target);
 
 	/**
 	 * Stop a timer
@@ -312,15 +305,60 @@ public:
 	 */
 	CString getFullViewName();
 
-	bool getC0() const { return _fieldC0 > 0; }
-	void incC0() { ++_fieldC0; }
-	void decC0() { --_fieldC0; }
+	/**
+	 * Returns true if all input is currently locked (disabled)
+	 */
+	bool isInputLocked() const { return _inputLockCount > 0; }
+	
+	/**
+	 * Increments the input locked count
+	 */
+	void incInputLocks() { ++_inputLockCount; }
+	
+	/**
+	 * Decremenst the input locked count
+	 */
+	void decInputLocks() { --_inputLockCount; }
+
+	/**
+	 * Returns true if the PET is currently unlocked
+	 */
+	bool isAreaActive() const { return _areaLockCount == 0; }
+
+	/**
+	 * Increment the number of PET area (tab) locks
+	 */
+	void incAreaLocks() { ++_areaLockCount; }
+
+	/**
+	 * Decrement the number of PET area (tab) locks
+	 */
+	void decAreaLocks() { 
+		_areaLockCount = MAX(_areaLockCount - 1, 0);
+	}
 
 	bool isSuccUBusActive() const;
 
 	/*--- CPetConversations methods ---*/
 
 	/**
+	 * Sets the active NPC
+	 */
+	void setActiveNPC(const CString &name) {
+		_conversations.setActiveNPC(name);
+	}
+
+	/**
+	 * Resets the Active NPC
+	 */
+	void resetActiveNPC();
+
+	/**
+	 * Resets the conversation dials back to 0 position
+	 */
+	void resetDials0() { _conversations.resetDials0(); }
+
+	/**
 	 * Resets the dial display in the conversation tab to reflect new values
 	 */
 	void convResetDials(int flag = 1);
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 276b99e..3d239bb 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -254,9 +254,9 @@ void CPetConversations::leave() {
 	stopNPCTimer();
 }
 
-void CPetConversations::proc25(int val) {
+void CPetConversations::timerExpired(int val) {
 	if (val == 1) {
-		proc25(val);
+		CPetSection::timerExpired(val);
 	} else {
 		CString name = _field418 ? _npcName : getActiveNPCName();
 
@@ -315,7 +315,7 @@ void CPetConversations::setNPC(const CString &name) {
 	startNPCTimer();
 }
 
-void CPetConversations::proc35() {
+void CPetConversations::resetNPC() {
 	stopNPCTimer();
 	resetDials("0");
 }
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 4deab3e..876f3d7 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -125,11 +125,6 @@ private:
 	void textLineEntered(const CString &textLine);
 
 	/**
-	 * Set the active NPC
-	 */
-	void setActiveNPC(const CString &name);
-
-	/**
 	 * Updates one of the dials with data from a given NPC
 	 */
 	void updateDial(uint dialNum, const CString &npcName);
@@ -211,7 +206,10 @@ public:
 	 */
 	virtual void leave();
 
-	virtual void proc25(int val);
+	/**
+	 * Called when a previously set up PET timer expires
+	 */
+	virtual void timerExpired(int val);
 
 	/**
 	 * Display a title for an NPC
@@ -223,7 +221,10 @@ public:
 	 */
 	virtual void setNPC(const CString &name);
 
-	virtual void proc35();
+	/**
+	 * Resets the active NPC
+	 */
+	virtual void resetNPC();
 
 	/**
 	 * Show the text cursor
@@ -236,6 +237,11 @@ public:
 	virtual void hideCursor();
 
 	/**
+	 * Set the active NPC
+	 */
+	void setActiveNPC(const CString &name);
+
+	/**
 	 * Resets the dials with the data for the currently active NPC
 	 */
 	void resetDials();
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
index 8eeccbb..deea8ee 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
@@ -133,7 +133,7 @@ bool CPetInventoryGlyph::dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg
 		_item = nullptr;
 		_background = nullptr;
 		_field34 = 0;
-		petControl->setC8(1);
+		petControl->setAreaChangeType(1);
 		return true;
 	} else {
 		petControl->addToInventory(carryParcel);
diff --git a/engines/titanic/pet_control/pet_section.cpp b/engines/titanic/pet_control/pet_section.cpp
index a29a8f8..50d6c76 100644
--- a/engines/titanic/pet_control/pet_section.cpp
+++ b/engines/titanic/pet_control/pet_section.cpp
@@ -48,7 +48,7 @@ void CPetSection::displayMessage(const CString &msg) {
 	}
 }
 
-void CPetSection::proc25(int val) {
+void CPetSection::timerExpired(int val) {
 	if (!val) {
 		removeText();
 		_petControl->makeDirty();
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 5ae86b7..58938c5 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -161,7 +161,10 @@ public:
 	 */
 	virtual void enterRoom(CRoomItem *room) {}
 
-	virtual void proc25(int val);
+	/**
+	 * Called when a previously set up PET timer expires
+	 */
+	virtual void timerExpired(int val);
 
 	/**
 	 * Get a reference to the tooltip text associated with the section
@@ -205,7 +208,10 @@ public:
 	 */
 	virtual void setNPC(const CString &name) {}
 
-	virtual void proc35() {}
+	/**
+	 * Resets the active NPC
+	 */
+	virtual void resetNPC() {}
 
 	/**
 	 * Show the text cursor
diff --git a/engines/titanic/support/simple_file.h b/engines/titanic/support/simple_file.h
index a83e592..0cfb424 100644
--- a/engines/titanic/support/simple_file.h
+++ b/engines/titanic/support/simple_file.h
@@ -98,7 +98,6 @@ public:
 	 * Seek
 	 */
 	virtual void seek(int offset, int origin);
-
 	/**
 	 * Read a byte
 	 */


Commit: 6f063c4703e5705edbba7ad39ef9c0656b74bc75
    https://github.com/scummvm/scummvm/commit/6f063c4703e5705edbba7ad39ef9c0656b74bc75
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:09-04:00

Commit Message:
TITANIC: Fleshing out CGameObject and CPetControl methods

Changed paths:
    engines/titanic/carry/arm.cpp
    engines/titanic/carry/brain.cpp
    engines/titanic/carry/bridge_piece.cpp
    engines/titanic/carry/carry.cpp
    engines/titanic/carry/carry.h
    engines/titanic/carry/carry_parrot.cpp
    engines/titanic/carry/chicken.cpp
    engines/titanic/carry/napkin.cpp
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/debugger.cpp
    engines/titanic/game/television.cpp
    engines/titanic/npcs/deskbot.cpp
    engines/titanic/npcs/true_talk_npc.cpp
    engines/titanic/npcs/true_talk_npc.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_drag_chev.cpp
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_real_life.h
    engines/titanic/room_flags.cpp
    engines/titanic/room_flags.h



diff --git a/engines/titanic/carry/arm.cpp b/engines/titanic/carry/arm.cpp
index d662b43..ee58aea 100644
--- a/engines/titanic/carry/arm.cpp
+++ b/engines/titanic/carry/arm.cpp
@@ -119,7 +119,7 @@ bool CArm::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 		if (hookedMsg._result) {
 			_string7 = "GondolierLeftLever";
 		} else {
-			addToInventory();
+			petAddToInventory();
 		}
 	} else if (msg->_other->getName() == "GondolierRightLever") {
 		CIsHookedOnMsg hookedMsg(_hookedRect, 0, getName());
@@ -129,7 +129,7 @@ bool CArm::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 		if (hookedMsg._result) {
 			_string7 = "GondolierRightLever";
 		} else {
-			addToInventory();
+			petAddToInventory();
 		}
 	}
 
@@ -166,13 +166,13 @@ bool CArm::MaitreDHappyMsg(CMaitreDHappyMsg *msg) {
 			CGameObject *child = static_cast<CGameObject *>(getFirstChild());
 			if (child) {
 				child->setVisible(true);
-				addToInventory();
+				petAddToInventory();
 			}
 
 			_visibleFrame = _field170;
 			loadFrame(_visibleFrame);
 			_string6 = "None";
-			invChange();
+			petInvChange();
 		}
 	}
 
@@ -189,7 +189,7 @@ bool CArm::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
 				_visibleFrame = _field170;
 				loadFrame(_visibleFrame);
 				child->setVisible(true);
-				child->addToInventory();
+				child->petAddToInventory();
 			}
 
 			_string6 = "None";
diff --git a/engines/titanic/carry/brain.cpp b/engines/titanic/carry/brain.cpp
index acc29b3..a60e652 100644
--- a/engines/titanic/carry/brain.cpp
+++ b/engines/titanic/carry/brain.cpp
@@ -59,13 +59,13 @@ bool CBrain::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 	if (slot) {
 		if (slot->getName() == "CentralCore") {
 			setVisible(false);
-			moveToHiddenRoom();
+			petMoveToHiddenRoom();
 			CAddHeadPieceMsg headpieceMsg(getName());
 			headpieceMsg.execute("CentralCoreSlot");
 		}
 		else if (!slot->_value1 && slot->getName() == "CentralCoreSlot") {
 			setVisible(false);
-			moveToHiddenRoom();
+			petMoveToHiddenRoom();
 			CAddHeadPieceMsg headpieceMsg(getName());
 			headpieceMsg.execute(msg->_other);
 			playSound("z#116.wav", 100, 0, 0);
diff --git a/engines/titanic/carry/bridge_piece.cpp b/engines/titanic/carry/bridge_piece.cpp
index 4fafac2..1fe5e04 100644
--- a/engines/titanic/carry/bridge_piece.cpp
+++ b/engines/titanic/carry/bridge_piece.cpp
@@ -56,14 +56,14 @@ bool CBridgePiece::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 	if (!shipSetting) {
 		return CCarry::UseWithOtherMsg(msg);
 	} else if (shipSetting->_string4 == "NULL") {
-		addToInventory();
+		petAddToInventory();
 		return true;
 	} else {
 		setVisible(false);
 		playSound("z#54.wav", 100, 0, 0);
 		setPosition(shipSetting->_pos1);
 		shipSetting->_string4 = getName();
-		moveToHiddenRoom();
+		petMoveToHiddenRoom();
 
 		CAddHeadPieceMsg headpieceMsg(shipSetting->getName() == _string6 ?
 			"Enable" : "Disable");
diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index cb87b94..ca022a6 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -123,7 +123,7 @@ bool CCarry::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
 bool CCarry::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 	if (msg->_dropTarget) {
 		if (msg->_dropTarget->isPet()) {
-			addToInventory();
+			petAddToInventory();
 			return true;
 		}
 
@@ -147,7 +147,7 @@ bool CCarry::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 	CString viewName = getViewFullName();
 	if (viewName.empty() || msg->_mousePos.y >= 360) {
 		sleep(250);
-		addToInventory();
+		petAddToInventory();
 	} else {
 		setPosition(_origPos);
 		loadFrame(_itemFrame);
@@ -165,7 +165,7 @@ bool CCarry::UseWithCharMsg(CUseWithCharMsg *msg) {
 	} else {
 		CShowTextMsg textMsg(_string4);
 		textMsg.execute("PET");
-		addToInventory();
+		petAddToInventory();
 	}
 
 	return true;
@@ -182,7 +182,7 @@ bool CCarry::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 	_fullViewName = getViewFullName();
 	if (_fullViewName.empty() || _bounds.top >= 360) {
 		sleep(250);
-		addToInventory();
+		petAddToInventory();
 	} else {
 		setPosition(_origPos);
 	}
@@ -238,18 +238,4 @@ bool CCarry::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
 	return true;
 }
 
-void CCarry::addToInventory() {
-	CPetControl *pet = getPetControl();
-	if (pet) {
-		makeDirty();
-		pet->addToInventory(this);
-	}
-}
-
-void CCarry::invChange() {
-	CPetControl *pet = getPetControl();
-	if (pet)
-		pet->invChange(this);
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index ba782fd..f447672 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -61,11 +61,6 @@ protected:
 	int _enterFrame;
 	bool _enterFrameSet;
 	int _visibleFrame;
-protected:
-	/**
-	 *
-	 */
-	void invChange();
 public:
 	CLASSDEF
 	CCarry();
@@ -79,11 +74,6 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
-
-	/**
-	 * Add the item to the inventory
-	 */
-	void addToInventory();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index e274679..b0916bb 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -105,7 +105,7 @@ bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 	stopMovie();
 
 	if (msg->_mousePos.y >= 360) {
-		addToInventory();
+		petAddToInventory();
 		return true;
 	}
 
@@ -215,7 +215,7 @@ bool CCarryParrot::ActMsg(CActMsg *msg) {
 				CCarry *feathers = static_cast<CCarry *>(getRoot()->findByName("Feathers"));
 				if (feathers) {
 					feathers->setVisible(true);
-					feathers->addToInventory();
+					feathers->petAddToInventory();
 				}
 
 				_field140 = true;
diff --git a/engines/titanic/carry/chicken.cpp b/engines/titanic/carry/chicken.cpp
index 8483a3f..60627bd 100644
--- a/engines/titanic/carry/chicken.cpp
+++ b/engines/titanic/carry/chicken.cpp
@@ -72,13 +72,13 @@ bool CChicken::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 		if (_field12C || _string6 == "None") {
 			CActMsg actMsg("Clean");
 			actMsg.execute(this);
-			addToInventory();
+			petAddToInventory();
 		} else {
 			CShowTextMsg textMsg("The chicken is already clean.");
 			textMsg.execute("PET");
 		}
 
-		addToInventory();
+		petAddToInventory();
 	} else {
 		CSauceDispensor *dispensor = static_cast<CSauceDispensor *>(msg->_other);
 		if (!dispensor || _string6 == "None") {
@@ -101,7 +101,7 @@ bool CChicken::UseWithCharMsg(CUseWithCharMsg *msg) {
 		acceptMsg._item = this;
 		acceptMsg.execute(succubus);
 	} else {
-		addToInventory();
+		petAddToInventory();
 	}
 
 	return true;
@@ -110,7 +110,7 @@ bool CChicken::UseWithCharMsg(CUseWithCharMsg *msg) {
 bool CChicken::ActMsg(CActMsg *msg) {
 	if (msg->_action == "GoToPET") {
 		setVisible(true);
-		addToInventory();
+		petAddToInventory();
 	} else if (msg->_action == "Tomato") {
 		_string6 = "Tomato";
 		loadFrame(4);
@@ -142,7 +142,7 @@ bool CChicken::ActMsg(CActMsg *msg) {
 		_v1 = 120;
 	} else if (msg->_action == "Eaten") {
 		setVisible(false);
-		moveToHiddenRoom();
+		petMoveToHiddenRoom();
 		_field13C = 1;
 	}
 
@@ -171,7 +171,7 @@ bool CChicken::TimerMsg(CTimerMsg *msg) {
 	}
 
 	if (flag) {
-		invChange();
+		petInvChange();
 		stopTimer(_timerId);
 	}
 
diff --git a/engines/titanic/carry/napkin.cpp b/engines/titanic/carry/napkin.cpp
index a8ceaad..cba2b4a 100644
--- a/engines/titanic/carry/napkin.cpp
+++ b/engines/titanic/carry/napkin.cpp
@@ -49,11 +49,11 @@ bool CNapkin::UseWithOtherMsg(CUseWithOtherMsg *msg) {
 			CActMsg actMsg("Clean");
 			actMsg.execute("Chicken");
 		} else {
-			petDisplayMsg("The Chicken is already quite clean enough, thank you.");
+			petDisplayMessage("The Chicken is already quite clean enough, thank you.");
 		}
 	}
 
-	addToInventory();
+	petAddToInventory();
 	return CCarry::UseWithOtherMsg(msg);
 }
 
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 95024b9..a903189 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -501,12 +501,6 @@ bool CGameObject::checkStartDragging(CMouseDragStartMsg *msg) {
 	}
 }
 
-void CGameObject::setPetArea(PetArea newArea) const {
-	CPetControl *pet = getPetControl();
-	if (pet)
-		pet->setArea(newArea);
-}
-
 bool CGameObject::hasActiveMovie() const {
 	if (_surface && _surface->_movie)
 		return _surface->_movie->isActive();
@@ -684,16 +678,6 @@ int CGameObject::compareRoomNameTo(const CString &name) {
 	return room->getName().compareToIgnoreCase(name);
 }
 
-void CGameObject::petDisplayMsg(const CString &msg) const {
-	CPetControl *pet = getPetControl();
-	if (pet)
-		pet->displayMessage(msg);
-}
-
-void CGameObject::displayMessage(const CString &msg) const {
-	petDisplayMsg(msg);
-}
-
 CGameObject *CGameObject::getMailManFirstObject() const {
 	CMailMan *mailMan = getMailMan();
 	return mailMan ? mailMan->getFirstObject() : nullptr;
@@ -764,14 +748,6 @@ Found CGameObject::find(const CString &name, CGameObject **item, int findAreas)
 	return FOUND_NONE;
 }
 
-void CGameObject::moveToHiddenRoom() {
-	CPetControl *pet = getPetControl();
-	if (pet) {
-		makeDirty();
-		pet->moveToHiddenRoom(this);
-	}
-}
-
 void CGameObject::moveToView() {
 	CViewItem *view = getGameManager()->getView();
 	detach();
@@ -806,24 +782,6 @@ void CGameObject::unlockMouse() {
 	gameMan->unlockInputHandler();
 }
 
-void CGameObject::startTalking(const CString &npcName, uint id, CViewItem *view) {
-	CTrueTalkNPC *npc = static_cast<CTrueTalkNPC *>(getRoot()->findByName(npcName));
-	startTalking(npc, id, view);
-}
-
-void CGameObject::startTalking(CTrueTalkNPC *npc, uint id, CViewItem *view) {
-	CGameManager *gameManager = getGameManager();
-	if (gameManager) {
-		CTrueTalkManager *talkManager = gameManager->getTalkManager();
-		if (talkManager)
-			talkManager->start(npc, id, view);
-	}
-}
-
-void CGameObject::endTalking(CTrueTalkNPC *npc, uint id, CViewItem *view) {
-	warning("TODO: CGameObject::endTalking");
-}
-
 void CGameObject::loadSurface() {
 	if (!_surface && !_resource.empty()) {
 		loadResource(_resource);
@@ -869,6 +827,10 @@ Point CGameObject::getControid() const {
 		_bounds.top + _bounds.height() / 2);
 }
 
+void CGameObject::performAction(int actionNum, CViewItem *view) {
+	// TODO
+}
+
 bool CGameObject::clipExistsByStart(const CString &name, int startFrame) const {
 	return _clipList1.existsByStart(name, startFrame);
 }
@@ -888,7 +850,7 @@ void CGameObject::checkPlayMovie(const CString &name, int flags) {
 	}
 }
 
-void CGameObject::clearPet() const {
+void CGameObject::petClear() const {
 	CPetControl *petControl = getPetControl();
 	if (petControl)
 		petControl->resetActiveNPC();
@@ -1002,12 +964,20 @@ int CGameObject::getClipDuration(const CString &name, int frameRate) const {
 	return clip ? (clip->_endFrame - clip->_startFrame) * 1000 / frameRate : 0;
 }
 
-void CGameObject::petLockInput() {
-	getPetControl()->incInputLocks();
-}
+bool CGameObject::compareRoomFlags(int mode, uint flags1, uint flags2) {
+	switch (mode) {
+	case 1:
+		return CRoomFlags::compareLocation(flags1, flags2);
 
-void CGameObject::petUnlockInput() {
-	getPetControl()->decInputLocks();
+	case 2:
+		return CRoomFlags::compareClassElevator(flags1, flags2);
+
+	case 3:
+		return CRoomFlags::isTitania(flags1, flags2);
+
+	default:
+		return false;
+	}
 }
 
 void CGameObject::setState1C(bool flag) {
@@ -1051,10 +1021,48 @@ void CGameObject::resetMail() {
 		mailMan->resetValue();
 }
 
-void CGameObject::petSetRooms1D0(int val) {
-	CPetControl *petControl = getPetControl();
-	if (petControl)
-		petControl->setRooms1D0(val);
+void CGameObject::petAddToCarryParcel(CGameObject *obj) {
+	CPetControl *pet = getPetControl();
+	if (pet) {
+		CGameObject *parcel = pet->getHiddenObject("CarryParcel");
+		if (parcel)
+			parcel->moveUnder(obj);
+	}
+}
+
+void CGameObject::petAddToInventory() {
+	CPetControl *pet = getPetControl();
+	if (pet) {
+		makeDirty();
+		pet->addToInventory(this);
+	}
+}
+
+CTreeItem *CGameObject::petContainerRemove(CGameObject *obj) {
+	CPetControl *pet = getPetControl();
+	if (!obj || !pet)
+		return nullptr;
+	if (!obj->compareRoomNameTo("CarryParcel"))
+		return obj;
+
+	CGameObject *item = static_cast<CGameObject *>(pet->getLastChild());
+	if (item)
+		item->detach();
+
+	pet->moveToHiddenRoom(obj);
+	pet->removeFromInventory(item, false, false);
+
+	return item;
+}
+
+void CGameObject::petDisplayMessage(int unused, const CString &msg) {
+	petDisplayMessage(msg);
+}
+
+void CGameObject::petDisplayMessage(const CString &msg) {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->displayMessage(msg);
 }
 
 int CGameObject::petGetRooms1D0() const {
@@ -1062,10 +1070,78 @@ int CGameObject::petGetRooms1D0() const {
 	return petControl ? petControl->getRooms1D0() : 0;
 }
 
-void CGameObject::reassignRoom(int passClassNum) {
+void CGameObject::petInvChange() {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->invChange(this);
+}
+
+void CGameObject::petLockInput() {
+	getPetControl()->incInputLocks();
+}
+
+void CGameObject::petMoveToHiddenRoom() {
+	CPetControl *pet = getPetControl();
+	if (pet) {
+		makeDirty();
+		pet->moveToHiddenRoom(this);
+	}
+}
+
+void CGameObject::petReassignRoom(int passClassNum) {
 	CPetControl *petControl = getPetControl();
 	if (petControl)
 		petControl->reassignRoom(passClassNum);
 }
 
+void CGameObject::petSetArea(PetArea newArea) const {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->setArea(newArea);
+}
+
+void CGameObject::petSetRooms1D0(int val) {
+	CPetControl *petControl = getPetControl();
+	if (petControl)
+		petControl->setRooms1D0(val);
+}
+
+void CGameObject::petOnSummonBot(const CString &name, int val) {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->summonBot(name, val);
+}
+
+void CGameObject::petUnlockInput() {
+	getPetControl()->decInputLocks();
+}
+
+/*------------------------------------------------------------------------*/
+
+void CGameObject::startTalking(const CString &npcName, uint id, CViewItem *view) {
+	CTrueTalkNPC *npc = static_cast<CTrueTalkNPC *>(getRoot()->findByName(npcName));
+	startTalking(npc, id, view);
+}
+
+void CGameObject::startTalking(CTrueTalkNPC *npc, uint id, CViewItem *view) {
+	CGameManager *gameManager = getGameManager();
+	if (gameManager) {
+		CTrueTalkManager *talkManager = gameManager->getTalkManager();
+		if (talkManager)
+			talkManager->start(npc, id, view);
+	}
+}
+
+void CGameObject::endTalking(CTrueTalkNPC *npc, bool viewFlag, CViewItem *view) {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->setActiveNPC(npc);
+
+	if (viewFlag)
+		npc->setView(view);
+
+	if (pet)
+		pet->refreshNPC();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 7a12abe..4ca8061 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -111,11 +111,6 @@ protected:
 	bool checkStartDragging(CMouseDragStartMsg *msg);
 
 	/**
-	 * Sets a new area in the PET
-	 */
-	void setPetArea(PetArea newArea) const;
-
-	/**
 	 * Goto a new view
 	 */
 	void gotoView(const CString &viewName, const CString &clipName);
@@ -126,26 +121,6 @@ protected:
 	 */
 	CViewItem * parseView(const CString &viewString);
 
-	/**
-	 * Highlights a glyph in the currently active PET section
-	 */
-	void petHighlightGlyph(int id);
-
-	/**
-	 * Hides the text cursor in the current section, if applicable
-	 */
-	void petHideCursor();
-
-	/**
-	 * Shows the text cursor in the current section, if applicable
-	 */
-	void petShowCursor();
-
-	/**
-	 * Set the remote target in the PET to this object
-	 */
-	void petSetRemoteTarget();
-
 	void incState38();
 	void inc54();
 	void dec54();
@@ -221,11 +196,6 @@ protected:
 	int compareRoomNameTo(const CString &name);
 
 	/**
-	 * Display a message in the PET
-	 */
-	void petDisplayMsg(const CString &msg) const;
-
-	/**
 	 * Display a message
 	 */
 	void displayMessage(const CString &msg) const;
@@ -256,21 +226,6 @@ protected:
 	void moveToView();
 
 	/**
-	 * Start a conversation with the NPC
-	 */
-	void startTalking(const CString &name, uint id, CViewItem *view = nullptr);
-
-	/**
-	 * Start a conversation with the NPC
-	 */
-	void startTalking(CTrueTalkNPC *npc, uint id, CViewItem *view = nullptr);
-
-	/**
-	 * Stop a conversation with the NPC
-	 */
-	void endTalking(CTrueTalkNPC *npc, uint id, CViewItem *view = nullptr);
-
-	/**
 	 * Change the view
 	 */
 	bool changeView(const CString &viewName, const CString &clipName);
@@ -317,7 +272,12 @@ protected:
 	/**
 	 * Clear the PET display
 	 */
-	void clearPet() const;
+	void petClear() const;
+	
+	/**
+	 * Perform an action
+	 */
+	void performAction(int actionNum, CViewItem *view = nullptr);
 
 	/**
 	 * Returns the MailMan
@@ -463,11 +423,6 @@ public:
 	 * Returns true if the item is the PET control
 	 */
 	virtual bool isPet() const;
-	
-	/**
-	 * Returns the PET control
-	 */
-	CPetControl *getPetControl() const;
 
 	/**
 	 * Play the movie specified in _resource
@@ -475,11 +430,6 @@ public:
 	void playMovie(uint startFrame, uint endFrame, uint flags);
 
 	/**
-	 * Moves the item from it's original position to be under the hidden room
-	 */
-	void moveToHiddenRoom();
-
-	/**
 	 * Checks the passed point is validly in the object,
 	 * with extra checking of object flags status
 	 */
@@ -567,19 +517,108 @@ public:
 	 */
 	void createCredits();
 
-	void petSetRooms1D0(int val);
+	/**
+	 * Support function for drag moving
+	 */
+	void dragMove(const Point &pt);
+	
+	bool compareRoomFlags(int mode, uint flags1, uint flags2);
+
+	/*--- CPetControl Methods ---*/
+
+	/**
+	 * Returns the PET control
+	 */
+	CPetControl *getPetControl() const;
+
+	/**
+	 * Moves a specified item to the carry parcel
+	 */
+	void petAddToCarryParcel(CGameObject *obj);
+
+	/**
+	 * Add the item to the inventory
+	 */
+	void petAddToInventory();
+
+	CTreeItem *petContainerRemove(CGameObject *obj);
+
+	/**
+	 * Display a message in the PET
+	 */
+	void petDisplayMessage(int unused, const CString &msg);
+
+	/**
+	 * Display a message in the PET
+	 */
+	void petDisplayMessage(const CString &msg);
 
 	int petGetRooms1D0() const;
 
 	/**
+	 * Hides the text cursor in the current section, if applicable
+	 */
+	void petHideCursor();
+
+	/**
+	 * Highlights a glyph in the currently active PET section
+	 */
+	void petHighlightGlyph(int id);
+
+	/**
+	 * Called when the status of an item in the inventory has changed
+	 */
+	void petInvChange();
+
+	/**
+	 * Moves the item from it's original position to be under the hidden room
+	 */
+	void petMoveToHiddenRoom();
+
+	/**
 	 * Gives the player a new assigned room in the specified passenger class
 	 */
-	void reassignRoom(int passClassNum);
+	void petReassignRoom(int passClassNum);
 
 	/**
-	 * Support function for drag moving
+	 * Sets a new area in the PET
 	 */
-	void dragMove(const Point &pt);
+	void petSetArea(PetArea newArea) const;
+
+	/**
+	 * Set the remote target in the PET to this object
+	 */
+	void petSetRemoteTarget();
+
+	void petSetRooms1D0(int val);
+
+	/**
+	 * Shows the text cursor in the current section, if applicable
+	 */
+	void petShowCursor();
+
+	/**
+	 * Summon a bot
+	 */
+	void petOnSummonBot(const CString &name, int val);
+
+	/*--- CTrueTalkManager Methods ---*/
+
+	/**
+	 * Stop a conversation with the NPC
+	 */
+	void endTalking(CTrueTalkNPC *npc, bool viewFlag, CViewItem *view = nullptr);
+
+	/**
+	 * Start a conversation with the NPC
+	 */
+	void startTalking(CTrueTalkNPC *npc, uint id, CViewItem *view = nullptr);
+
+	/**
+	 * Start a conversation with the NPC
+	 */
+	void startTalking(const CString &name, uint id, CViewItem *view = nullptr);
+
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp
index e02f1c8..37fc546 100644
--- a/engines/titanic/debugger.cpp
+++ b/engines/titanic/debugger.cpp
@@ -249,7 +249,7 @@ bool Debugger::cmdItem(int argc, const char **argv) {
 			// Ensure the PET is active and add the item to the inventory
 			gameState._petActive = true;
 			gameManager.initBounds();
-			item->addToInventory();
+			item->petAddToInventory();
 
 			return false;
 		} else {
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 4d8e3f2..57b2b7f 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -101,7 +101,7 @@ void CTelevision::load(SimpleFile *file) {
 }
 
 bool CTelevision::LeaveViewMsg(CLeaveViewMsg *msg) {
-	clearPet();
+	petClear();
 	if (_isOn) {
 		if (soundFn1(_soundHandle))
 			stopSound(_soundHandle, 0);
@@ -139,7 +139,7 @@ bool CTelevision::ChangeSeasonMsg(CChangeSeasonMsg *msg) {
 }
 
 bool CTelevision::EnterViewMsg(CEnterViewMsg *msg) {
-	setPetArea(PET_REMOTE);
+	petSetArea(PET_REMOTE);
 	petHighlightGlyph(GLYPH_TELEVISION_CONTROL);
 	petSetRemoteTarget();
 	setVisible(0);
diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp
index eb42a8e..3fe9236 100644
--- a/engines/titanic/npcs/deskbot.cpp
+++ b/engines/titanic/npcs/deskbot.cpp
@@ -80,7 +80,7 @@ bool CDeskbot::TurnOn(CTurnOn *msg) {
 		setVisible(true);
 		playClip("BellRinging", 4);
 		playSound("b#69.wav");
-		setPetArea(PET_CONVERSATION);
+		petSetArea(PET_CONVERSATION);
 
 		_npcFlags |= NPCFLAG_20000;
 		_deskbotActive = true;
@@ -110,7 +110,7 @@ bool CDeskbot::MovieEndMsg(CMovieEndMsg *msg) {
 	bool flag = false;
 	if (_npcFlags & NPCFLAG_10000) {
 		if (_classNum) {
-			setPetArea(PET_ROOMS);
+			petSetArea(PET_ROOMS);
 			dec54();
 			unlockMouse();
 			playSound("z#47.wav", 100, 0, 0);
@@ -169,25 +169,25 @@ bool CDeskbot::TrueTalkTriggerActionMsg(CTrueTalkTriggerActionMsg *msg) {
 	case 19:
 		inc54();
 		lockMouse();
-		setPetArea(PET_CONVERSATION);
+		petSetArea(PET_CONVERSATION);
 		playClip("ReprogramPETInHand", 4);
 		_npcFlags |= NPCFLAG_10000;
 		_classNum = msg->_param1;
 
 		switch (_classNum) {
 		case 1:
-			petDisplayMsg("You have been upgraded to 1st Class status. Enjoy hugely.");
+			petDisplayMessage("You have been upgraded to 1st Class status. Enjoy hugely.");
 			setPassengerClass(_classNum);
-			reassignRoom(_classNum);
+			petReassignRoom(_classNum);
 			break;
 		case 2:
-			petDisplayMsg("You have been upgraded to 2nd Class status. Enjoy.");
+			petDisplayMessage("You have been upgraded to 2nd Class status. Enjoy.");
 			setPassengerClass(_classNum);
-			reassignRoom(_classNum);
+			petReassignRoom(_classNum);
 			break;
 		case 3:
 			setPassengerClass(3);
-			reassignRoom(_classNum);
+			petReassignRoom(_classNum);
 			break;
 		default:
 			break;
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index 32c6412..00b68c2 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -197,10 +197,6 @@ void CTrueTalkNPC::processInput(CTextInputMsg *msg, CViewItem *view) {
 		talkManager->processInput(this, msg, view);
 }
 
-void CTrueTalkNPC::performAction(int actionNum, CViewItem *view) {
-	// TODO
-}
-
 int CTrueTalkNPC::startAnimTimer(const CString &action, uint firstDuration, uint duration) {
 	CTimeEventInfo *timer = new CTimeEventInfo(g_vm->_events->getTicksCount(),
 		duration > 0, firstDuration, duration, this, 0, action);
@@ -209,4 +205,10 @@ int CTrueTalkNPC::startAnimTimer(const CString &action, uint firstDuration, uint
 	return timer->_id;
 }
 
+void CTrueTalkNPC::setView(CViewItem *view) {
+	CTrueTalkManager *talkManager = getGameManager()->getTalkManager();
+	if (talkManager)
+		talkManager->start3(this, view);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index a1303c3..1a10a0a 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -64,11 +64,6 @@ protected:
 	void processInput(CTextInputMsg *msg, CViewItem *view);
 	
 	/**
-	 * Perform an action
-	 */
-	void performAction(int actionNum, CViewItem *view = nullptr);
-	
-	/**
 	 * Start an animation timer
 	 */
 	int startAnimTimer(const CString &action, uint firstDuration, uint duration);
@@ -85,6 +80,11 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
+
+	/**
+	 * Set the view for the NPC
+	 */
+	void setView(CViewItem *view);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 7e5cd20..e526a03 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -183,6 +183,21 @@ void CPetControl::resetRemoteTarget() {
 	_remoteTargetName.clear();
 }
 
+void CPetControl::setActiveNPC(CTrueTalkNPC *npc) {
+	if (_activeNPC == npc) {
+		if (_activeNPC) {
+			_activeNPCName = npc->getName();
+			_conversations.displayNPCName(npc);
+		} else {
+			_activeNPCName = "";
+		}
+	}
+}
+
+void CPetControl::refreshNPC() {
+	_conversations.setNPC(_activeNPCName);
+}
+
 void CPetControl::resetActiveNPC() {
 	_activeNPC = nullptr;
 	_activeNPCName = "";
@@ -379,7 +394,7 @@ void CPetControl::addToInventory(CGameObject *item) {
 		if (child)
 			child->detach();
 
-		item->moveToHiddenRoom();
+		item->petMoveToHiddenRoom();
 		if (!child)
 			return;
 
@@ -413,12 +428,12 @@ void CPetControl::removeFromInventory(CGameObject *item, CTreeItem *newParent,
 	}
 }
 
-void CPetControl::removeFromInventory(CCarry *item, bool refreshUI, bool sendMsg) {
+void CPetControl::removeFromInventory(CGameObject *item, bool refreshUI, bool sendMsg) {
 	CViewItem *view = getGameManager()->getView();
 	removeFromInventory(item, view, refreshUI, sendMsg);
 }
 
-void CPetControl::invChange(CCarry *item) {
+void CPetControl::invChange(CGameObject *item) {
 	_inventory.change(item);
 }
 
@@ -430,6 +445,66 @@ void CPetControl::moveToHiddenRoom(CTreeItem *item) {
 	}
 }
 
+bool CPetControl::checkNode(const CString &name) {
+	CGameManager *gameManager = getGameManager();
+	if (!gameManager)
+		return true;
+	if (name == "NULL")
+		return false;
+	
+	CViewItem *view = gameManager->getView();
+	if (!view)
+		return true;
+
+	CNodeItem *node = view->findNode();
+	if (!node)
+		return true;
+
+	CString viewName = view->getName();
+	CString nodeName = node->getName();
+	CRoomItem *room = getGameManager()->getRoom();
+
+	if (room) {
+		CString roomName = room->getName();
+		CString newNode;
+
+		if (roomName == "1stClassRestaurant") {
+		} else if (nodeName == "Lobby Node") {
+			nodeName = "Node 1";
+		} else if (nodeName == "Entrance Node") {
+			nodeName = "Node 2";
+		} else if (nodeName == "MaitreD Node") {
+			nodeName = "Node 3";
+		} else if (nodeName == "Scraliontis Table Standing Node") {
+			nodeName = "Node 4";
+		} else if (nodeName == "Pellerator Node") {
+			nodeName = "Node 5";
+		} else if (nodeName == "SUB Node") {
+			nodeName = "Node 6";
+		} else if (nodeName == "Phonograph Node") {
+			nodeName = "Node 7";
+		} else if (nodeName == "Scraliontis Table Seated Node") {
+			nodeName = "Node 8";
+		}
+
+		if (roomName == "MusicRoom") {
+			if (nodeName == "Musical Instruments")
+				nodeName = "Node 1";
+			if (nodeName == "Phonograph Node")
+				nodeName = "Node 2";
+		}
+	}
+
+	CString str = CString::format("%s.%s", nodeName.c_str(), viewName.c_str());
+	str = str.right(5);
+	str.toLowercase();
+
+	CString nameLower = name;
+	nameLower.toLowercase();
+
+	return nameLower.contains(str);
+}
+
 void CPetControl::playSound(int soundNum) {
 	CTreeItem *player = getHiddenObject("PETSoundPlayer");
 	if (player) {
@@ -443,9 +518,9 @@ CString CPetControl::getRoomName() const {
 	return room ? room->getName() : CString();
 }
 
-int CPetControl::canSummonNPC(const CString &name) {
+int CPetControl::canSummonBot(const CString &name) {
 	// If player is the very same view as the NPC, then it's already present
-	if (isNPCInView(name))
+	if (isBotInView(name))
 		return SUMMON_CAN;
 
 	// Get the room
@@ -461,7 +536,7 @@ int CPetControl::canSummonNPC(const CString &name) {
 	return queryMsg.execute(room) ? SUMMON_CAN : SUMMON_CANT;
 }
 
-bool CPetControl::isNPCInView(const CString &name) const {
+bool CPetControl::isBotInView(const CString &name) const {
 	CGameManager *gameManager = getGameManager();
 	if (!gameManager)
 		return false;
@@ -481,7 +556,7 @@ bool CPetControl::isNPCInView(const CString &name) const {
 	return false;
 }
 
-void CPetControl::summonNPC(const CString &name, int val) {
+void CPetControl::summonBot(const CString &name, int val) {
 	CGameManager *gameManager = getGameManager();
 	if (gameManager) {
 		CRoomItem *room = gameManager->getRoom();
@@ -493,6 +568,20 @@ void CPetControl::summonNPC(const CString &name, int val) {
 	}
 }
 
+void CPetControl::onSummonBot(const CString &name, int val) {
+	CGameObject *bot = findObject(name, getHiddenRoom());
+	if (!bot) {
+		bot = findObject(name, getRoot());
+	}
+
+	if (bot) {
+		removeFromInventory(bot, false, false);
+
+		COnSummonBotMsg summonMsg(val);
+		summonMsg.execute(bot);
+	}
+}
+
 void CPetControl::startPetTimer(uint timerIndex, uint firstDuration, uint duration, CPetSection *target) {
 	stopPetTimer(timerIndex);
 	_timers[timerIndex]._id = addTimer(timerIndex, firstDuration, duration);
@@ -511,6 +600,18 @@ void CPetControl::setTimer44(int id, int val) {
 	getGameManager()->setTimer44(id, val);
 }
 
+CGameObject *CPetControl::findObject(const CString &name, CTreeItem *root) {
+	for (CTreeItem *item = root; item; item = item->scan(root)) {
+		if (!item->getName().compareToIgnoreCase(name)) {
+			CGameObject *obj = static_cast<CGameObject *>(item);
+			if (obj)
+				return obj;
+		}
+	}
+
+	return nullptr;
+}
+
 CString CPetControl::getFullViewName() {
 	CGameManager *gameManager = getGameManager();
 	return gameManager ? gameManager->getFullViewName() : CString();
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index c3afb78..6b40c15 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -96,9 +96,14 @@ private:
 	/**
 	 * Checks whether a designated NPC in present in the current view
 	 */
-	bool isNPCInView(const CString &name) const;
+	bool isBotInView(const CString &name) const;
 
 	void setTimer44(int id, int val);
+
+	/**
+	 * Find an object under a given root
+	 */
+	CGameObject *findObject(const CString &name, CTreeItem *root);
 protected:
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
@@ -251,12 +256,12 @@ public:
 	/**
 	 * Remove an item from the inventory
 	 */
-	void removeFromInventory(CCarry *item, bool refreshUI = true, bool sendMsg = true);
+	void removeFromInventory(CGameObject *item, bool refreshUI = true, bool sendMsg = true);
 
 	/**
 	 * Called when the status of an item in the inventory has changed
 	 */
-	void invChange(CCarry *item);
+	void invChange(CGameObject *item);
 
 	/**
 	 * Moves a tree item from it's original position to be under the hidden room
@@ -269,6 +274,8 @@ public:
 	 */
 	void setAreaChangeType(int changeType) { _areaChangeType = changeType; }
 
+	bool checkNode(const CString &name);
+
 	/**
 	 * Play a sound
 	 */
@@ -282,12 +289,17 @@ public:
 	/**
 	 * Check whether an NPC can be summoned
 	 */
-	int canSummonNPC(const CString &name);
+	int canSummonBot(const CString &name);
 
 	/**
 	 * Summon an NPC to the player
 	 */
-	void summonNPC(const CString &name, int val);
+	void summonBot(const CString &name, int val);
+
+	/**
+	 * Summon a bot to the player
+	 */
+	void onSummonBot(const CString &name, int val);
 
 	/**
 	 * Start a timer for a Pet Area
@@ -349,6 +361,16 @@ public:
 	}
 
 	/**
+	 * Sets the actie NPC
+	 */
+	void setActiveNPC(CTrueTalkNPC *npc);
+
+	/**
+	 * Refresh the currently active NPC
+	 */
+	void refreshNPC();
+
+	/**
 	 * Resets the Active NPC
 	 */
 	void resetActiveNPC();
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 3d239bb..f9c051a 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -162,12 +162,12 @@ bool CPetConversations::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
 		return true;
 
 	if (_doorBot.MouseButtonUpMsg(msg->_mousePos)) {
-		switch (canSummonNPC("DoorBot")) {
+		switch (canSummonBot("DoorBot")) {
 		case SUMMON_CANT:
 			_log.addLine("Sadly, it is not possible to summon the DoorBot from this location.", getColor(1));
 			break;
 		case SUMMON_CAN:
-			summonNPC("DoorBot");
+			summonBot("DoorBot");
 			return true;
 		default:
 			break;
@@ -179,12 +179,12 @@ bool CPetConversations::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
 	}
 
 	if (_bellBot.MouseButtonUpMsg(msg->_mousePos)) {
-		switch (canSummonNPC("BellBot")) {
+		switch (canSummonBot("BellBot")) {
 		case SUMMON_CANT:
 			_log.addLine("Sadly, it is not possible to summon the BellBot from this location.", getColor(1));
 			break;
 		case SUMMON_CAN:
-			summonNPC("BellBot");
+			summonBot("BellBot");
 			return true;
 		default:
 			break;
@@ -412,16 +412,16 @@ void CPetConversations::scrollToBottom() {
 	_logChanged = true;
 }
 
-int CPetConversations::canSummonNPC(const CString &name) {
-	return _petControl ? _petControl->canSummonNPC(name) : SUMMON_CANT;
+int CPetConversations::canSummonBot(const CString &name) {
+	return _petControl ? _petControl->canSummonBot(name) : SUMMON_CANT;
 }
 
-void CPetConversations::summonNPC(const CString &name) {
+void CPetConversations::summonBot(const CString &name) {
 	if (_petControl) {
 		if (_petControl->getPassengerClass() >= 4) {
 			_petControl->displayMessage("Sorry, you must be at least 3rd class before you can summon for help.");
 		} else {
-			_petControl->summonNPC(name, 0);
+			_petControl->summonBot(name, 0);
 		}
 	}
 }
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 876f3d7..51487e1 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -92,12 +92,12 @@ private:
 	/**
 	 * Check whether an NPC can be summoned
 	 */
-	int canSummonNPC(const CString &name);
+	int canSummonBot(const CString &name);
 
 	/**
 	 * Summon an NPC
 	 */
-	void summonNPC(const CString &name);
+	void summonBot(const CString &name);
 
 	/**
 	 * Starts the NPC timer
diff --git a/engines/titanic/pet_control/pet_drag_chev.cpp b/engines/titanic/pet_control/pet_drag_chev.cpp
index 3143cde..e6c4749 100644
--- a/engines/titanic/pet_control/pet_drag_chev.cpp
+++ b/engines/titanic/pet_control/pet_drag_chev.cpp
@@ -63,7 +63,7 @@ bool CPetDragChev::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 			if (petControl && petControl->contains(msg->_mousePos)
 					&& msg->_mousePos.x < 528) {
 				if (petControl->checkDragEnd(this))
-					moveToHiddenRoom();
+					petMoveToHiddenRoom();
 			}
 		}
 	}
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index a207c66..62eee83 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -158,7 +158,7 @@ bool CPetInventory::setPetControl(CPetControl *petControl) {
 	return true;
 }
 
-void CPetInventory::change(CCarry *item) {
+void CPetInventory::change(CGameObject *item) {
 	if (item) {
 		CInventoryGlyphAction action(item, ACTION_CHANGE);
 		_items.doAction(&action);
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index e931abf..8a6bceb 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -144,7 +144,7 @@ public:
 	/**
 	 * 
 	 */
-	void change(CCarry *item);
+	void change(CGameObject *item);
 
 	/**
 	 * Called when an item has been removed from the PET
diff --git a/engines/titanic/pet_control/pet_real_life.h b/engines/titanic/pet_control/pet_real_life.h
index aa980fc..d049d47 100644
--- a/engines/titanic/pet_control/pet_real_life.h
+++ b/engines/titanic/pet_control/pet_real_life.h
@@ -81,8 +81,6 @@ public:
 	virtual bool KeyCharMsg(CKeyCharMsg *msg);
 	virtual bool VirtualKeyCharMsg(CVirtualKeyCharMsg *msg);
 
-	virtual int proc14() { return 0; }
-	
 	/**
 	 * Returns item a drag-drop operation has dropped on, if any
 	 */
diff --git a/engines/titanic/room_flags.cpp b/engines/titanic/room_flags.cpp
index ac378e2..4b3aeb4 100644
--- a/engines/titanic/room_flags.cpp
+++ b/engines/titanic/room_flags.cpp
@@ -433,14 +433,17 @@ void CRoomFlags::changeLocation(int action) {
 	setRoomBits(roomNum);
 }
 
-bool CRoomFlags::compareFlags(CRoomFlags flags1, CRoomFlags flags2) const {
-	if (flags1.getFloorNum() != flags2.getFloorNum())
+bool CRoomFlags::compareClassElevator(uint flags1, uint flags2) {
+	CRoomFlags f1(flags1);
+	CRoomFlags f2(flags2);
+
+	if (f1.getFloorNum() != f2.getFloorNum())
 		return false;
 
-	uint elev1 = flags1.getElevatorNum();
-	uint elev2 = flags2.getElevatorNum();
-	uint class1 = getPassengerClassNum();
-	uint class2 = getPassengerClassNum();
+	uint elev1 = f1.getElevatorNum();
+	uint elev2 = f2.getElevatorNum();
+	uint class1 = f1.getPassengerClassNum();
+	uint class2 = f2.getPassengerClassNum();
 
 	if (class1 > 0 && class1 < 3) {
 		if (elev1 == 2)
@@ -458,12 +461,17 @@ bool CRoomFlags::compareFlags(CRoomFlags flags1, CRoomFlags flags2) const {
 	return elev1 == elev2;
 }
 
-bool CRoomFlags::compareLocation(uint roomFlags) {
-	CRoomFlags flags(roomFlags);
+bool CRoomFlags::compareLocation(uint flags1, uint flags2) {
+	CRoomFlags f1(flags1);
+	CRoomFlags f2(flags2);
+
+	return f1.getElevatorNum() == f2.getElevatorBits() &&
+		f1.getFloorNum() == f2.getFloorNum() &&
+		f1.getRoomNum() == f2.getRoomNum();
+}
 
-	return getElevatorNum() == flags.getElevatorBits() &&
-		getFloorNum() == flags.getFloorNum() &&
-		getRoomNum() == flags.getRoomNum();
+bool CRoomFlags::isTitania(uint flags1, uint flags2) {
+	return flags2 == 0x8A397;
 }
 
 void CRoomFlags::setRandomLocation(int classNum, bool flag) {
diff --git a/engines/titanic/room_flags.h b/engines/titanic/room_flags.h
index dfb7c89..f0f90f8 100644
--- a/engines/titanic/room_flags.h
+++ b/engines/titanic/room_flags.h
@@ -58,25 +58,25 @@ private:
 	 */
 	uint decodeFloorBits(uint bits) const;
 
+	static bool is2To19(uint v) { return v >= 2 && v <= 19; }
+	static bool is20To27(uint v) { return v >= 20 && v <= 27; }
+	static bool is28To38(uint v) { return v >= 28 && v <= 38; }
+public:
 	/**
-	 * Compares two room flags together
+	 * Compares the current flags against the specified flags
+	 * for a matching elevator, floor, and room
 	 */
-	bool compareFlags(CRoomFlags flags1, CRoomFlags flags2) const;
+	static bool compareLocation(uint flags1, uint flags2);
 
 	/**
-	 * Compares the current flags against the specified flags
-	 * for a matching elevator, floor, and room
+	 * Compares two room flags together
 	 */
-	bool compareLocation(uint roomFlags);
+	static bool compareClassElevator(uint flags1, uint flags2);
 
 	/**
 	 * Returns true if the current flags is for Titania's room
 	 */
-	bool isTitania() const { return _data == 0x8A397; }
-
-	static bool is2To19(uint v) { return v >= 2 && v <= 19; }
-	static bool is20To27(uint v) { return v >= 20 && v <= 27; }
-	static bool is28To38(uint v) { return v >= 28 && v <= 38; }
+	static bool isTitania(uint flags1, uint flags2);
 public:
 	CRoomFlags() : _data(0) {}
 	CRoomFlags(uint data) : _data(data) {}


Commit: ad873455cf29622e52c15ac48e608d385a744be2
    https://github.com/scummvm/scummvm/commit/ad873455cf29622e52c15ac48e608d385a744be2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:11-04:00

Commit Message:
TITANIC: Adding PET Control bot methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index a903189..154d2ae 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -1055,6 +1055,16 @@ CTreeItem *CGameObject::petContainerRemove(CGameObject *obj) {
 	return item;
 }
 
+bool CGameObject::petDismissBot(const CString &name) {
+	CPetControl *pet = getPetControl();
+	return pet ? pet->dismissBot(name) : false;
+}
+
+bool CGameObject::petDoorOrBellbotPresent() const {
+	CPetControl *pet = getPetControl();
+	return pet ? pet->isDoorOrBellbotPresent() : false;
+}
+
 void CGameObject::petDisplayMessage(int unused, const CString &msg) {
 	petDisplayMessage(msg);
 }
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 4ca8061..c43d73f 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -544,6 +544,16 @@ public:
 	CTreeItem *petContainerRemove(CGameObject *obj);
 
 	/**
+	 * Dismiss a bot
+	 */
+	bool petDismissBot(const CString &name);
+
+	/**
+	 * Is Doorbot or Bellbot present in the current view
+	 */
+	bool petDoorOrBellbotPresent() const;
+
+	/**
 	 * Display a message in the PET
 	 */
 	void petDisplayMessage(int unused, const CString &msg);
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index e526a03..7d35eb3 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -569,9 +569,9 @@ void CPetControl::summonBot(const CString &name, int val) {
 }
 
 void CPetControl::onSummonBot(const CString &name, int val) {
-	CGameObject *bot = findObject(name, getHiddenRoom());
+	CGameObject *bot = findBot(name, getHiddenRoom());
 	if (!bot) {
-		bot = findObject(name, getRoot());
+		bot = findBot(name, getRoot());
 	}
 
 	if (bot) {
@@ -582,6 +582,46 @@ void CPetControl::onSummonBot(const CString &name, int val) {
 	}
 }
 
+bool CPetControl::dismissBot(const CString &name) {
+	CGameManager *gameManager = getGameManager();
+	if (!gameManager)
+		return false;
+	CViewItem *view = gameManager->getView();
+	if (!view)
+		return false;
+
+	bool result = false;
+	CDismissBotMsg dismissMsg;
+	for (CTreeItem *treeItem = view->getFirstChild(); treeItem;
+			treeItem = treeItem->scan(view)) {
+		if (!treeItem->getName().compareToIgnoreCase(name))
+			dismissMsg.execute(treeItem);
+		else
+			result = true;
+	}
+
+	return result;
+}
+
+bool CPetControl::isDoorOrBellbotPresent() const {
+	CGameManager *gameManager = getGameManager();
+	if (!gameManager)
+		return false;
+	CViewItem *view = gameManager->getView();
+	if (!view)
+		return false;
+
+	for (CTreeItem *treeItem = view->getFirstChild(); treeItem;
+			treeItem = treeItem->scan(view)) {
+		CString name = treeItem->getName();
+		if (static_cast<CGameObject *>(treeItem) &&
+				(name.contains("Doorbot") || name.contains("BellBot")))
+			return true;
+	}
+
+	return false;
+}
+
 void CPetControl::startPetTimer(uint timerIndex, uint firstDuration, uint duration, CPetSection *target) {
 	stopPetTimer(timerIndex);
 	_timers[timerIndex]._id = addTimer(timerIndex, firstDuration, duration);
@@ -600,7 +640,7 @@ void CPetControl::setTimer44(int id, int val) {
 	getGameManager()->setTimer44(id, val);
 }
 
-CGameObject *CPetControl::findObject(const CString &name, CTreeItem *root) {
+CGameObject *CPetControl::findBot(const CString &name, CTreeItem *root) {
 	for (CTreeItem *item = root; item; item = item->scan(root)) {
 		if (!item->getName().compareToIgnoreCase(name)) {
 			CGameObject *obj = static_cast<CGameObject *>(item);
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 6b40c15..07a4ffa 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -98,12 +98,12 @@ private:
 	 */
 	bool isBotInView(const CString &name) const;
 
-	void setTimer44(int id, int val);
-
 	/**
-	 * Find an object under a given root
+	 * Find a bot under a given root
 	 */
-	CGameObject *findObject(const CString &name, CTreeItem *root);
+	CGameObject *findBot(const CString &name, CTreeItem *root);
+
+	void setTimer44(int id, int val);
 protected:
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
@@ -302,6 +302,16 @@ public:
 	void onSummonBot(const CString &name, int val);
 
 	/**
+	 * Dismiss an NPC
+	 */
+	bool dismissBot(const CString &name);
+
+	/**
+	 * Returns true if Doorbot or Bellbot present
+	 */
+	bool isDoorOrBellbotPresent() const;
+
+	/**
 	 * Start a timer for a Pet Area
 	 */
 	void startPetTimer(uint timerIndex, uint firstDuration, uint duration, CPetSection *target);


Commit: be9a05f8b54e77a04c92aa766233bb8908b50c92
    https://github.com/scummvm/scummvm/commit/be9a05f8b54e77a04c92aa766233bb8908b50c92
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:14-04:00

Commit Message:
TITANIC: Added CPetStarfield methods

Changed paths:
  A engines/titanic/pet_control/pet_starfield.cpp
  A engines/titanic/pet_control/pet_starfield.h
  R engines/titanic/pet_control/pet_nav_helmet.cpp
  R engines/titanic/pet_control/pet_nav_helmet.h
    engines/titanic/core/game_object.h
    engines/titanic/module.mk
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_frame.cpp
    engines/titanic/pet_control/pet_quit.h
    engines/titanic/pet_control/pet_section.h
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control.h



diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index c43d73f..d372b40 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -285,11 +285,6 @@ protected:
 	CMailMan *getMailMan() const;
 
 	/**
-	 * Returns the star control
-	 */
-	CStarControl *getStarControl() const;
-
-	/**
 	 * Returns a child of the Dont Save area of the project of the given class
 	 */
 	CTreeItem *getDontSaveChild(ClassDef *classDef) const;
@@ -612,6 +607,13 @@ public:
 	 */
 	void petOnSummonBot(const CString &name, int val);
 
+	/*--- CStarControl Methods ---*/
+
+	/**
+	 * Returns the star control
+	 */
+	CStarControl *getStarControl() const;
+
 	/*--- CTrueTalkManager Methods ---*/
 
 	/**
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index a204c7c..881aa02 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -364,7 +364,7 @@ MODULE_OBJS := \
 	pet_control/pet_inventory.o \
 	pet_control/pet_inventory_glyphs.o \
 	pet_control/pet_message.o \
-	pet_control/pet_nav_helmet.o \
+	pet_control/pet_starfield.o \
 	pet_control/pet_real_life.o \
 	pet_control/pet_remote.o \
 	pet_control/pet_remote_glyphs.o \
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 7d35eb3..b6648b9 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -51,7 +51,7 @@ CPetControl::CPetControl() : CGameObject(),
 	_sections[PET_REMOTE] = &_remote;
 	_sections[PET_ROOMS] = &_rooms;
 	_sections[PET_REAL_LIFE] = &_realLife;
-	_sections[PET_NAV_HELMET] = &_navHelmet;
+	_sections[PET_STARFIELD] = &_navHelmet;
 	_sections[PET_MESSAGE] = &_message;
 }
 
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 07a4ffa..d03f1c5 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -32,7 +32,7 @@
 #include "titanic/pet_control/pet_frame.h"
 #include "titanic/pet_control/pet_inventory.h"
 #include "titanic/pet_control/pet_message.h"
-#include "titanic/pet_control/pet_nav_helmet.h"
+#include "titanic/pet_control/pet_starfield.h"
 #include "titanic/pet_control/pet_real_life.h"
 #include "titanic/pet_control/pet_remote.h"
 #include "titanic/pet_control/pet_rooms.h"
@@ -56,7 +56,7 @@ private:
 	CPetSection *_sections[7];
 	CPetConversations _conversations;
 	CPetInventory _inventory;
-	CPetNavHelmet _navHelmet;
+	CPetStarfield _navHelmet;
 	CPetRemote _remote;
 	CPetRooms _rooms;
 	CPetRealLife _realLife;
diff --git a/engines/titanic/pet_control/pet_frame.cpp b/engines/titanic/pet_control/pet_frame.cpp
index 4c3c518..bc1a8e9 100644
--- a/engines/titanic/pet_control/pet_frame.cpp
+++ b/engines/titanic/pet_control/pet_frame.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 
 static const PetArea PET_AREAS[6] = {
 	PET_CONVERSATION, PET_INVENTORY, PET_REMOTE,
-	PET_ROOMS, PET_REAL_LIFE, PET_NAV_HELMET
+	PET_ROOMS, PET_REAL_LIFE, PET_STARFIELD
 };
 
 CPetFrame::CPetFrame() : CPetSection() {
diff --git a/engines/titanic/pet_control/pet_nav_helmet.cpp b/engines/titanic/pet_control/pet_nav_helmet.cpp
deleted file mode 100644
index b995786..0000000
--- a/engines/titanic/pet_control/pet_nav_helmet.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/pet_control/pet_nav_helmet.h"
-#include "titanic/pet_control/pet_control.h"
-#include "titanic/messages/pet_messages.h"
-
-namespace Titanic {
-
-CPetNavHelmet::CPetNavHelmet() :
-		_field98(0), _field9C(0), _fieldA0(0), _field18C(0),
-		_photoOn(true), _field210(0), _rect1(22, 352, 598, 478) {
-}
-
-bool CPetNavHelmet::setup(CPetControl *petControl) {
-	if (petControl && setupControl(petControl))
-		return reset();
-	return false;
-}
-
-bool CPetNavHelmet::reset() {
-	if (_petControl) {
-		_val1.setup(MODE_UNSELECTED, "3PetStarField", _petControl);
-		_val2.setup(MODE_UNSELECTED, "HomePhotoOnOff", _petControl);
-		_setDestination.setup(MODE_UNSELECTED, "3PetSetDestin", _petControl);
-		_setDestination.setup(MODE_SELECTED, "3PetSetDestin1", _petControl);
-		_val4.setup(MODE_UNSELECTED, "3PetStarCtrl", _petControl);
-		
-		_leds[0].setup(MODE_UNSELECTED, "LEDOff1", _petControl);
-		_leds[1].setup(MODE_UNSELECTED, "LEDOn1", _petControl);
-		_leds[2].setup(MODE_UNSELECTED, "LEDOff2", _petControl);
-		_leds[3].setup(MODE_UNSELECTED, "LEDOn2", _petControl);
-		_leds[4].setup(MODE_UNSELECTED, "LEDOff3", _petControl);
-		_leds[5].setup(MODE_UNSELECTED, "LEDOn3", _petControl);
-
-		uint col = getColor(0);
-		_text.setColor(col);
-		_text.setLineColor(0, col);
-	}
-
-	return true;
-}
-
-void CPetNavHelmet::draw(CScreenManager *screenManager) {
-	_petControl->drawSquares(screenManager, 2);
-
-	if (_photoOn) {
-		_val2.draw(screenManager);
-	} else {
-		_val4.draw(screenManager);
-	}
-
-	_setDestination.draw(screenManager);
-	drawButton(_field98, 0, screenManager);
-	drawButton(_field9C, 2, screenManager);
-	drawButton(_fieldA0, 4, screenManager);
-	_text.draw(screenManager);
-}
-
-bool CPetNavHelmet::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
-	if (!_petControl->_remoteTarget)
-		return false;
-
-	if (_val1.MouseButtonDownMsg(msg->_mousePos)) {
-		CPETHelmetOnOffMsg helmetMsg;
-		helmetMsg.execute(_petControl->_remoteTarget);
-	} else if (_val2.MouseButtonDownMsg(msg->_mousePos)) {
-		if (_field210) {
-			_photoOn = !_photoOn;
-			CPETPhotoOnOffMsg photoMsg;
-			photoMsg.execute(_petControl->_remoteTarget);
-		} else {
-			_petControl->displayMessage("Please supply Galactic reference material.");
-		}
-	} else if (_setDestination.MouseButtonDownMsg(msg->_mousePos)) {
-		warning("TODO: CPetNavHelmet::MouseButtonDownMsg");
-	}
-
-	return true;
-}
-
-bool CPetNavHelmet::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
-	if (!_petControl->_remoteTarget || !_setDestination.MouseButtonUpMsg(msg->_mousePos))
-		return false;
-
-	if (_petControl) {
-		warning("TODO: CPetNavHelmet::MouseButtonUpMsg");
-	}
-
-	return true;
-}
-
-bool CPetNavHelmet::isValid(CPetControl *petControl) {
-	return setupControl(petControl);
-}
-
-void CPetNavHelmet::load(SimpleFile *file, int param) {
-	if (!param) {
-		_photoOn = file->readNumber();
-		_field210 = file->readNumber();
-	}
-}
-
-void CPetNavHelmet::postLoad() {
-	reset();
-}
-
-void CPetNavHelmet::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(_photoOn, indent);
-	file->writeNumberLine(_field210, indent);
-}
-
-bool CPetNavHelmet::setupControl(CPetControl *petControl) {
-	if (petControl) {
-		_petControl = petControl;
-
-		Rect r(0, 0, 64, 64);
-		r.translate(_rect1.left, _rect1.top);
-
-		_val1.setBounds(r);
-		_val1.translate(15, 23);
-		_val2.setBounds(r);
-		_val2.translate(85, 23);
-		_val4.setBounds(r);
-		_val4.translate(85, 23);
-
-		r = Rect(0, 0, 34, 34);
-		r.translate(468, 396);
-		_leds[0].setBounds(r);
-		_leds[1].setBounds(r);
-
-		r.translate(36, 0);
-		_leds[2].setBounds(r);
-		_leds[3].setBounds(r);
-
-		r.translate(36, 0);
-		_leds[4].setBounds(r);
-		_leds[5].setBounds(r);
-
-		r = Rect(0, 0, 157, 51);
-		r.translate(224, 33);
-		r.translate(20, 350);
-		_setDestination.setBounds(r);
-
-		r = Rect(0, 0, 580, 15);
-		r.translate(32, 445);
-		_text.setBounds(r);
-		_text.setHasBorder(false);
-	}
-
-	return true;
-}
-
-void CPetNavHelmet::drawButton(int offset, int index, CScreenManager *screenManager) {
-	if (_field18C < 4 && (offset / 3) == 1)
-		--offset;
-	if (offset == 2)
-		offset = 1;
-
-	_leds[index + offset].draw(screenManager);
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_nav_helmet.h b/engines/titanic/pet_control/pet_nav_helmet.h
deleted file mode 100644
index 09504a1..0000000
--- a/engines/titanic/pet_control/pet_nav_helmet.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_PET_NAV_HELMET_H
-#define TITANIC_PET_NAV_HELMET_H
-
-#include "titanic/pet_control/pet_section.h"
-#include "titanic/pet_control/pet_text.h"
-#include "titanic/pet_control/pet_gfx_element.h"
-
-namespace Titanic {
-
-class CPetNavHelmet : public CPetSection {
-private:
-	CPetGfxElement _val1;
-	CPetGfxElement _val2;
-	CPetGfxElement _setDestination;
-	CPetGfxElement _val4;
-	int _field98;
-	int _field9C;
-	int _fieldA0;
-	CPetGfxElement _leds[6];
-	Rect _rect1;
-	int _field18C;
-	CPetText _text;
-	bool _photoOn;
-	int _field210;
-private:
-	/**
-	 * Setup the control
-	 */
-	bool setupControl(CPetControl *petControl);
-
-	/**
-	 * Draw a button
-	 */
-	void drawButton(int offset, int index, CScreenManager *screenManager);
-public:
-	CPetNavHelmet();
-
-	/**
-	 * Sets up the section
-	 */
-	virtual bool setup(CPetControl *petControl);
-	
-	/**
-	 * Reset the section
-	 */
-	virtual bool reset();
-
-	/**
-	 * Draw the section
-	 */
-	virtual void draw(CScreenManager *screenManager);
-	
-	/**
-	* Following are handlers for the various messages that the PET can
-	* pass onto the currently active section/area
-	*/
-	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
-	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
-
-	/**
-	 * Returns true if the object is in a valid state
-	 */
-	virtual bool isValid(CPetControl *petControl);
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file, int param);
-
-	/**
-	 * Called after a game has been loaded
-	 */
-	virtual void postLoad();
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_PET_NAV_HELMET_H */
diff --git a/engines/titanic/pet_control/pet_quit.h b/engines/titanic/pet_control/pet_quit.h
index 7d22690..87d8aef 100644
--- a/engines/titanic/pet_control/pet_quit.h
+++ b/engines/titanic/pet_control/pet_quit.h
@@ -63,6 +63,11 @@ public:
 	 * Returns the tooltip text for when the glyph is selected
 	 */
 	virtual void getTooltip(CPetText *text);
+
+	/**
+	 * Get a reference to the tooltip text associated with the section
+	 */
+	virtual CPetText *getText() { return &_text; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 58938c5..3673d4d 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -30,7 +30,7 @@ namespace Titanic {
 
 enum PetArea {
 	PET_INVENTORY = 0, PET_CONVERSATION = 1, PET_REMOTE = 2,
-	PET_ROOMS = 3, PET_REAL_LIFE = 4, PET_NAV_HELMET = 5, PET_MESSAGE = 6
+	PET_ROOMS = 3, PET_REAL_LIFE = 4, PET_STARFIELD = 5, PET_MESSAGE = 6
 };
 
 class CPetControl;
diff --git a/engines/titanic/pet_control/pet_starfield.cpp b/engines/titanic/pet_control/pet_starfield.cpp
new file mode 100644
index 0000000..f657d9b
--- /dev/null
+++ b/engines/titanic/pet_control/pet_starfield.cpp
@@ -0,0 +1,256 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/pet_control/pet_starfield.h"
+#include "titanic/pet_control/pet_control.h"
+#include "titanic/messages/pet_messages.h"
+#include "titanic/star_control/star_control.h"
+
+namespace Titanic {
+
+CPetStarfield::CPetStarfield() : _field18C(0), _photoOn(true),
+		_field210(0), _rect1(22, 352, 598, 478) {
+	_btnOffsets[0] = _btnOffsets[1] = _btnOffsets[2] = 0;
+}
+
+bool CPetStarfield::setup(CPetControl *petControl) {
+	if (petControl && setupControl(petControl))
+		return reset();
+	return false;
+}
+
+bool CPetStarfield::reset() {
+	if (_petControl) {
+		_val1.setup(MODE_UNSELECTED, "3PetStarField", _petControl);
+		_val2.setup(MODE_UNSELECTED, "HomePhotoOnOff", _petControl);
+		_setDestination.setup(MODE_UNSELECTED, "3PetSetDestin", _petControl);
+		_setDestination.setup(MODE_SELECTED, "3PetSetDestin1", _petControl);
+		_val4.setup(MODE_UNSELECTED, "3PetStarCtrl", _petControl);
+		
+		_leds[0].setup(MODE_UNSELECTED, "LEDOff1", _petControl);
+		_leds[1].setup(MODE_UNSELECTED, "LEDOn1", _petControl);
+		_leds[2].setup(MODE_UNSELECTED, "LEDOff2", _petControl);
+		_leds[3].setup(MODE_UNSELECTED, "LEDOn2", _petControl);
+		_leds[4].setup(MODE_UNSELECTED, "LEDOff3", _petControl);
+		_leds[5].setup(MODE_UNSELECTED, "LEDOn3", _petControl);
+
+		uint col = getColor(0);
+		_text.setColor(col);
+		_text.setLineColor(0, col);
+	}
+
+	return true;
+}
+
+void CPetStarfield::draw(CScreenManager *screenManager) {
+	_petControl->drawSquares(screenManager, 2);
+
+	if (_photoOn) {
+		_val2.draw(screenManager);
+	} else {
+		_val4.draw(screenManager);
+	}
+
+	_setDestination.draw(screenManager);
+	drawButton(_btnOffsets[0], 0, screenManager);
+	drawButton(_btnOffsets[1], 2, screenManager);
+	drawButton(_btnOffsets[2], 4, screenManager);
+	_text.draw(screenManager);
+}
+
+bool CPetStarfield::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	if (!_petControl->_remoteTarget)
+		return false;
+
+	if (_val1.MouseButtonDownMsg(msg->_mousePos)) {
+		CPETHelmetOnOffMsg helmetMsg;
+		helmetMsg.execute(_petControl->_remoteTarget);
+	} else if (_val2.MouseButtonDownMsg(msg->_mousePos)) {
+		if (_field210) {
+			_photoOn = !_photoOn;
+			CPETPhotoOnOffMsg photoMsg;
+			photoMsg.execute(_petControl->_remoteTarget);
+		} else {
+			_petControl->displayMessage("Please supply Galactic reference material.");
+		}
+	} else if (!_setDestination.MouseButtonDownMsg(msg->_mousePos)) {
+		return elementsMouseDown(msg);
+	}
+
+	return true;
+}
+
+bool CPetStarfield::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
+	if (!_petControl->_remoteTarget || !_setDestination.MouseButtonUpMsg(msg->_mousePos))
+		return false;
+
+	if (_petControl) {
+		CStarControl *starControl = _petControl->getStarControl();
+		
+		if (starControl) {
+			CPETSetStarDestinationMsg starfieldMsg;
+			starfieldMsg.execute(_petControl->_remoteTarget);
+			starControl->fn3();
+		}
+	}
+
+	return true;
+}
+
+bool CPetStarfield::isValid(CPetControl *petControl) {
+	return setupControl(petControl);
+}
+
+void CPetStarfield::load(SimpleFile *file, int param) {
+	if (!param) {
+		_photoOn = file->readNumber();
+		_field210 = file->readNumber();
+	}
+}
+
+void CPetStarfield::postLoad() {
+	reset();
+}
+
+void CPetStarfield::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(_photoOn, indent);
+	file->writeNumberLine(_field210, indent);
+}
+
+bool CPetStarfield::setupControl(CPetControl *petControl) {
+	if (petControl) {
+		_petControl = petControl;
+
+		Rect r(0, 0, 64, 64);
+		r.translate(_rect1.left, _rect1.top);
+
+		_val1.setBounds(r);
+		_val1.translate(15, 23);
+		_val2.setBounds(r);
+		_val2.translate(85, 23);
+		_val4.setBounds(r);
+		_val4.translate(85, 23);
+
+		r = Rect(0, 0, 34, 34);
+		r.translate(468, 396);
+		_leds[0].setBounds(r);
+		_leds[1].setBounds(r);
+
+		r.translate(36, 0);
+		_leds[2].setBounds(r);
+		_leds[3].setBounds(r);
+
+		r.translate(36, 0);
+		_leds[4].setBounds(r);
+		_leds[5].setBounds(r);
+
+		r = Rect(0, 0, 157, 51);
+		r.translate(224, 33);
+		r.translate(20, 350);
+		_setDestination.setBounds(r);
+
+		r = Rect(0, 0, 580, 15);
+		r.translate(32, 445);
+		_text.setBounds(r);
+		_text.setHasBorder(false);
+	}
+
+	return true;
+}
+
+void CPetStarfield::drawButton(int offset, int index, CScreenManager *screenManager) {
+	if (_field18C < 4 && (offset / 3) == 1)
+		--offset;
+	if (offset == 2)
+		offset = 1;
+
+	_leds[index + offset].draw(screenManager);
+}
+
+void CPetStarfield::setButtons(int val1, int val2) {
+	_btnOffsets[0] = 0;
+	_btnOffsets[1] = 0;
+	_btnOffsets[2] = 0;
+
+	if (val1 >= 0)
+		_btnOffsets[0] = 2;
+	if (val1 >= 1)
+		_btnOffsets[1] = 2;
+	if (val1 >= 2)
+		_btnOffsets[2] = 2;
+
+	if (val2) {
+		if (val1 == -1)
+			_btnOffsets[0] = 1;
+		if (val1 == 0)
+			_btnOffsets[1] = 1;
+		if (val1 == 1)
+			_btnOffsets[2] = 1;
+	}
+
+	_field18C = (_field18C + 1) % 8;
+}
+
+void CPetStarfield::makePetDirty() {
+	_petControl->makeDirty();
+}
+
+bool CPetStarfield::elementsMouseDown(CMouseButtonDownMsg *msg) {
+	if (elementMouseButton(0, msg, _leds[0].getBounds()))
+		return true;
+	if (elementMouseButton(1, msg, _leds[2].getBounds()))
+		return true;
+	if (elementMouseButton(2, msg, _leds[4].getBounds()))
+		return true;
+
+	return false;
+}
+
+bool CPetStarfield::elementMouseButton(int index, CMouseButtonDownMsg *msg, const Rect &rect) {
+	if (!rect.contains(msg->_mousePos))
+		return false;
+
+	switch (_btnOffsets[index]) {
+	case 1:
+		if (_petControl->_remoteTarget) {
+			CPETStarFieldLockMsg lockMsg(1);
+			lockMsg.execute(_petControl->_remoteTarget);
+		}
+		break;
+
+	case 2:
+		if (index < 2 && _btnOffsets[index] >= 2) {
+			if (_petControl->_remoteTarget) {
+				CPETStarFieldLockMsg lockMsg(1);
+				lockMsg.execute(_petControl->_remoteTarget);
+			}
+		}
+		break;
+
+	default:
+		break;
+	}
+
+	return true;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_starfield.h b/engines/titanic/pet_control/pet_starfield.h
new file mode 100644
index 0000000..30766b3
--- /dev/null
+++ b/engines/titanic/pet_control/pet_starfield.h
@@ -0,0 +1,122 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_PET_STARFIELD_H
+#define TITANIC_PET_STARFIELD_H
+
+#include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_text.h"
+#include "titanic/pet_control/pet_gfx_element.h"
+
+namespace Titanic {
+
+class CPetStarfield : public CPetSection {
+private:
+	CPetGfxElement _val1;
+	CPetGfxElement _val2;
+	CPetGfxElement _setDestination;
+	CPetGfxElement _val4;
+	int _btnOffsets[3];
+	CPetGfxElement _leds[6];
+	Rect _rect1;
+	int _field18C;
+	CPetText _text;
+	bool _photoOn;
+	int _field210;
+private:
+	/**
+	 * Setup the control
+	 */
+	bool setupControl(CPetControl *petControl);
+
+	/**
+	 * Draw a button
+	 */
+	void drawButton(int offset, int index, CScreenManager *screenManager);
+
+	void set210(int val) { _field210 = val; }
+
+	/**
+	 * Sets the offsets for each of the buttons
+	 */
+	void setButtons(int val1, int val2);
+
+	/**
+	 * Make the PET as dirty, requiring a redraw
+	 */
+	void makePetDirty();
+
+	/**
+	 * Mouse down handling for Nav elements
+	 */
+	bool elementsMouseDown(CMouseButtonDownMsg *msg);
+
+	bool elementMouseButton(int index, CMouseButtonDownMsg *msg, const Rect &rect);
+public:
+	CPetStarfield();
+
+	/**
+	 * Sets up the section
+	 */
+	virtual bool setup(CPetControl *petControl);
+	
+	/**
+	 * Reset the section
+	 */
+	virtual bool reset();
+
+	/**
+	 * Draw the section
+	 */
+	virtual void draw(CScreenManager *screenManager);
+	
+	/**
+	* Following are handlers for the various messages that the PET can
+	* pass onto the currently active section/area
+	*/
+	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
+
+	/**
+	 * Returns true if the object is in a valid state
+	 */
+	virtual bool isValid(CPetControl *petControl);
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file, int param);
+
+	/**
+	 * Called after a game has been loaded
+	 */
+	virtual void postLoad();
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_PET_STARFIELD_H */
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index 4465798..3f84a94 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -53,4 +53,8 @@ void CStarControl::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+void CStarControl::fn3() {
+	warning("CStarControl::fn3");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index 9462cee..3e53db1 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -52,6 +52,8 @@ public:
 	 * Load the data for the class from file
 	 */
 	virtual void load(SimpleFile *file);
+
+	void fn3();
 };
 
 } // End of namespace Titanic


Commit: b6f476c70f90dd451e7e931fe91ce7c86b922b20
    https://github.com/scummvm/scummvm/commit/b6f476c70f90dd451e7e931fe91ce7c86b922b20
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:17-04:00

Commit Message:
TITANIC: Cleanup and renamings for PET Starfield controller

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_starfield.cpp
    engines/titanic/pet_control/pet_starfield.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index b6648b9..7934365 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -51,7 +51,7 @@ CPetControl::CPetControl() : CGameObject(),
 	_sections[PET_REMOTE] = &_remote;
 	_sections[PET_ROOMS] = &_rooms;
 	_sections[PET_REAL_LIFE] = &_realLife;
-	_sections[PET_STARFIELD] = &_navHelmet;
+	_sections[PET_STARFIELD] = &_starfield;
 	_sections[PET_MESSAGE] = &_message;
 }
 
@@ -85,7 +85,7 @@ void CPetControl::setup() {
 	_rooms.setup(this);
 	_remote.setup(this);
 	_inventory.setup(this);
-	_navHelmet.setup(this);
+	_starfield.setup(this);
 	_realLife.setup(this);
 	_message.setup(this);
 	_frame.setup(this);
@@ -96,7 +96,7 @@ bool CPetControl::isValid() {
 		_rooms.isValid(this) && 
 		_remote.isValid(this) &&
 		_inventory.isValid(this) &&
-		_navHelmet.isValid(this) &&
+		_starfield.isValid(this) &&
 		_realLife.isValid(this) &&
 		_message.isValid(this) &&
 		_frame.isValid(this);
@@ -107,7 +107,7 @@ void CPetControl::loadAreas(SimpleFile *file, int param) {
 	_rooms.load(file, param);
 	_remote.load(file, param);
 	_inventory.load(file, param);
-	_navHelmet.load(file, param);
+	_starfield.load(file, param);
 	_realLife.load(file, param);
 	_message.load(file, param);
 	_frame.load(file, param);
@@ -118,7 +118,7 @@ void CPetControl::saveAreas(SimpleFile *file, int indent) const {
 	_rooms.save(file, indent);
 	_remote.save(file, indent);
 	_inventory.save(file, indent);
-	_navHelmet.save(file, indent);
+	_starfield.save(file, indent);
 	_realLife.save(file, indent);
 	_message.save(file, indent);
 	_frame.save(file, indent);
@@ -163,7 +163,7 @@ void CPetControl::loaded() {
 	_rooms.postLoad();
 	_remote.postLoad();
 	_inventory.postLoad();
-	_navHelmet.postLoad();
+	_starfield.postLoad();
 	_realLife.postLoad();
 	_message.postLoad();
 	_frame.postLoad();
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index d03f1c5..e389a0e 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -56,7 +56,7 @@ private:
 	CPetSection *_sections[7];
 	CPetConversations _conversations;
 	CPetInventory _inventory;
-	CPetStarfield _navHelmet;
+	CPetStarfield _starfield;
 	CPetRemote _remote;
 	CPetRooms _rooms;
 	CPetRealLife _realLife;
diff --git a/engines/titanic/pet_control/pet_starfield.cpp b/engines/titanic/pet_control/pet_starfield.cpp
index f657d9b..4230d94 100644
--- a/engines/titanic/pet_control/pet_starfield.cpp
+++ b/engines/titanic/pet_control/pet_starfield.cpp
@@ -40,11 +40,11 @@ bool CPetStarfield::setup(CPetControl *petControl) {
 
 bool CPetStarfield::reset() {
 	if (_petControl) {
-		_val1.setup(MODE_UNSELECTED, "3PetStarField", _petControl);
-		_val2.setup(MODE_UNSELECTED, "HomePhotoOnOff", _petControl);
-		_setDestination.setup(MODE_UNSELECTED, "3PetSetDestin", _petControl);
-		_setDestination.setup(MODE_SELECTED, "3PetSetDestin1", _petControl);
-		_val4.setup(MODE_UNSELECTED, "3PetStarCtrl", _petControl);
+		_imgStarfield.setup(MODE_UNSELECTED, "3PetStarField", _petControl);
+		_imgPhoto.setup(MODE_UNSELECTED, "HomePhotoOnOff", _petControl);
+		_btnSetDest.setup(MODE_UNSELECTED, "3PetSetDestin", _petControl);
+		_btnSetDest.setup(MODE_SELECTED, "3PetSetDestin1", _petControl);
+		_imgStarCtrl.setup(MODE_UNSELECTED, "3PetStarCtrl", _petControl);
 		
 		_leds[0].setup(MODE_UNSELECTED, "LEDOff1", _petControl);
 		_leds[1].setup(MODE_UNSELECTED, "LEDOn1", _petControl);
@@ -64,13 +64,14 @@ bool CPetStarfield::reset() {
 void CPetStarfield::draw(CScreenManager *screenManager) {
 	_petControl->drawSquares(screenManager, 2);
 
+	_imgStarfield.draw(screenManager);
 	if (_photoOn) {
-		_val2.draw(screenManager);
+		_imgPhoto.draw(screenManager);
 	} else {
-		_val4.draw(screenManager);
+		_imgStarCtrl.draw(screenManager);
 	}
 
-	_setDestination.draw(screenManager);
+	_btnSetDest.draw(screenManager);
 	drawButton(_btnOffsets[0], 0, screenManager);
 	drawButton(_btnOffsets[1], 2, screenManager);
 	drawButton(_btnOffsets[2], 4, screenManager);
@@ -81,10 +82,10 @@ bool CPetStarfield::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 	if (!_petControl->_remoteTarget)
 		return false;
 
-	if (_val1.MouseButtonDownMsg(msg->_mousePos)) {
+	if (_imgStarfield.MouseButtonDownMsg(msg->_mousePos)) {
 		CPETHelmetOnOffMsg helmetMsg;
 		helmetMsg.execute(_petControl->_remoteTarget);
-	} else if (_val2.MouseButtonDownMsg(msg->_mousePos)) {
+	} else if (_imgPhoto.MouseButtonDownMsg(msg->_mousePos)) {
 		if (_field210) {
 			_photoOn = !_photoOn;
 			CPETPhotoOnOffMsg photoMsg;
@@ -92,7 +93,7 @@ bool CPetStarfield::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 		} else {
 			_petControl->displayMessage("Please supply Galactic reference material.");
 		}
-	} else if (!_setDestination.MouseButtonDownMsg(msg->_mousePos)) {
+	} else if (!_btnSetDest.MouseButtonDownMsg(msg->_mousePos)) {
 		return elementsMouseDown(msg);
 	}
 
@@ -100,7 +101,7 @@ bool CPetStarfield::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 }
 
 bool CPetStarfield::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
-	if (!_petControl->_remoteTarget || !_setDestination.MouseButtonUpMsg(msg->_mousePos))
+	if (!_petControl->_remoteTarget || !_btnSetDest.MouseButtonUpMsg(msg->_mousePos))
 		return false;
 
 	if (_petControl) {
@@ -143,12 +144,12 @@ bool CPetStarfield::setupControl(CPetControl *petControl) {
 		Rect r(0, 0, 64, 64);
 		r.translate(_rect1.left, _rect1.top);
 
-		_val1.setBounds(r);
-		_val1.translate(15, 23);
-		_val2.setBounds(r);
-		_val2.translate(85, 23);
-		_val4.setBounds(r);
-		_val4.translate(85, 23);
+		_imgStarfield.setBounds(r);
+		_imgStarfield.translate(15, 23);
+		_imgPhoto.setBounds(r);
+		_imgPhoto.translate(85, 23);
+		_imgStarCtrl.setBounds(r);
+		_imgStarCtrl.translate(85, 23);
 
 		r = Rect(0, 0, 34, 34);
 		r.translate(468, 396);
@@ -166,7 +167,7 @@ bool CPetStarfield::setupControl(CPetControl *petControl) {
 		r = Rect(0, 0, 157, 51);
 		r.translate(224, 33);
 		r.translate(20, 350);
-		_setDestination.setBounds(r);
+		_btnSetDest.setBounds(r);
 
 		r = Rect(0, 0, 580, 15);
 		r.translate(32, 445);
diff --git a/engines/titanic/pet_control/pet_starfield.h b/engines/titanic/pet_control/pet_starfield.h
index 30766b3..6cfc308 100644
--- a/engines/titanic/pet_control/pet_starfield.h
+++ b/engines/titanic/pet_control/pet_starfield.h
@@ -31,10 +31,10 @@ namespace Titanic {
 
 class CPetStarfield : public CPetSection {
 private:
-	CPetGfxElement _val1;
-	CPetGfxElement _val2;
-	CPetGfxElement _setDestination;
-	CPetGfxElement _val4;
+	CPetGfxElement _imgStarfield;
+	CPetGfxElement _imgPhoto;
+	CPetGfxElement _imgStarCtrl;
+	CPetGfxElement _btnSetDest;
 	int _btnOffsets[3];
 	CPetGfxElement _leds[6];
 	Rect _rect1;


Commit: ef1d10e926fcf31ffeb5c594a305ec0cd8bf7064
    https://github.com/scummvm/scummvm/commit/ef1d10e926fcf31ffeb5c594a305ec0cd8bf7064
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:19-04:00

Commit Message:
TITANIC: Implemented remaining CGameManager methods and others

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/mail_man.cpp
    engines/titanic/core/room_item.cpp
    engines/titanic/core/room_item.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_starfield.cpp
    engines/titanic/pet_control/pet_starfield.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 154d2ae..0bf5464 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -63,7 +63,7 @@ CGameObject::CGameObject(): CNamedItem() {
 	_field4C = 0xFF;
 	_isMail = false;
 	_id = 0;
-	_field58 = 0;
+	_roomFlags = 0;
 	_visible = true;
 	_field60 = 0;
 	_cursorId = CURSOR_ARROW;
@@ -126,7 +126,7 @@ void CGameObject::load(SimpleFile *file) {
 		_visible = file->readNumber() != 0;
 		_isMail = file->readNumber();
 		_id = file->readNumber();
-		_field58 = file->readNumber();
+		_roomFlags = file->readNumber();
 
 		resourceKey.load(file);		
 		_surface = nullptr;
@@ -688,24 +688,29 @@ CGameObject *CGameObject::getMailManNextObject(CGameObject *prior) const {
 	return mailMan ? mailMan->getNextObject(prior) : nullptr;
 }
 
-CGameObject *CGameObject::findRoomObject(const CString &name) const {
-	return static_cast<CGameObject *>(findRoom()->findByName(name));
-}
-
-CGameObject *CGameObject::findUnder(CTreeItem *parent, const CString &name) {
-	if (!parent)
+CGameObject *CGameObject::findMailByFlags(int mode, uint roomFlags) {
+	CMailMan *mailMan = getMailMan();
+	if (!mailMan)
 		return nullptr;
-
-	for (CTreeItem *treeItem = parent->getFirstChild(); treeItem;
-	treeItem = treeItem->scan(parent)) {
-		if (!treeItem->getName().compareTo(name)) {
-			return dynamic_cast<CGameObject *>(treeItem);
-		}
+	
+	for (CGameObject *obj = mailMan->getFirstObject(); obj;
+			obj = mailMan->getNextObject(obj)) {
+		if (compareRoomFlags(mode, roomFlags, obj->_roomFlags))
+			return obj;
 	}
 
 	return nullptr;
 }
 
+CGameObject *CGameObject::getNextMail(CGameObject *prior) {
+	CMailMan *mailMan = getMailMan();
+	return mailMan ? mailMan->getNextObject(prior) : nullptr;
+}
+
+CGameObject *CGameObject::findRoomObject(const CString &name) const {
+	return static_cast<CGameObject *>(findRoom()->findByName(name));
+}
+
 Found CGameObject::find(const CString &name, CGameObject **item, int findAreas) {
 	CGameObject *go;
 	*item = nullptr;
@@ -897,6 +902,23 @@ CRoomItem *CGameObject::getHiddenRoom() const {
 	return root ? root->findHiddenRoom() : nullptr;
 }
 
+CGameObject *CGameObject::getHiddenObject(const CString &name) const {
+	CRoomItem *room = getHiddenRoom();
+	return room ? static_cast<CGameObject *>(findUnder(room, name)) : nullptr;
+}
+
+CTreeItem *CGameObject::findUnder(CTreeItem *parent, const CString &name) const {
+	if (!parent)
+		return nullptr;
+
+	for (CTreeItem *item = parent->getFirstChild(); item; item = item->scan(parent)) {
+		if (item->getName() == name)
+			return item;
+	}
+
+	return nullptr;
+}
+
 CMusicRoom *CGameObject::getMusicRoom() const {
 	CGameManager *gameManager = getGameManager();
 	return gameManager ? &gameManager->_musicRoom : nullptr;
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index d372b40..67bf131 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -196,11 +196,6 @@ protected:
 	int compareRoomNameTo(const CString &name);
 
 	/**
-	 * Display a message
-	 */
-	void displayMessage(const CString &msg) const;
-
-	/**
 	 * Gets the first object under the system MailMan
 	 */
 	CGameObject *getMailManFirstObject() const;
@@ -211,14 +206,19 @@ protected:
 	CGameObject *getMailManNextObject(CGameObject *prior) const;
 
 	/**
-	 * Finds an object by name within the object's room
+	 * Find mail by room flags
 	 */
-	CGameObject *findRoomObject(const CString &name) const;
+	CGameObject *findMailByFlags(int mode, uint roomFlags);
 
 	/**
-	 * Scan the specified room for an item by name
+	 * Find next mail from a given prior one
+	 */
+	CGameObject *getNextMail(CGameObject *prior);
+
+	/**
+	 * Finds an object by name within the object's room
 	 */
-	static CGameObject *findUnder(CTreeItem *parent, const CString &name);
+	CGameObject *findRoomObject(const CString &name) const;
 
 	/**
 	 * Moves the item from it's original position to be under the current view
@@ -300,6 +300,16 @@ protected:
 	CRoomItem *getHiddenRoom() const;
 
 	/**
+	 * Returns a hidden object
+	 */
+	CGameObject *getHiddenObject(const CString &name) const;
+	
+	/**
+	 * Scan the specified room for an item by name
+	 */
+	CTreeItem *findUnder(CTreeItem *parent, const CString &name) const;
+
+	/**
 	 * Returns the music room instance from the game manager
 	 */
 	CMusicRoom *getMusicRoom() const;
@@ -366,7 +376,7 @@ protected:
 public:
 	bool _isMail;
 	int _id;
-	int _field58;
+	uint _roomFlags;
 	int _field60;
 	CursorId _cursorId;
 	bool _visible;
diff --git a/engines/titanic/core/mail_man.cpp b/engines/titanic/core/mail_man.cpp
index 8ac50e9..8226ebf 100644
--- a/engines/titanic/core/mail_man.cpp
+++ b/engines/titanic/core/mail_man.cpp
@@ -55,7 +55,7 @@ void CMailMan::addMail(CGameObject *obj, int id) {
 
 void CMailMan::setMailId(CGameObject *obj, int id) {
 	obj->_id = id;
-	obj->_field58 = 0;
+	obj->_roomFlags = 0;
 	obj->_isMail = true;
 }
 
@@ -68,11 +68,11 @@ CGameObject *CMailMan::findMail(int id) const {
 	return nullptr;
 }
 
-void CMailMan::removeMail(int id, int v) {
+void CMailMan::removeMail(int id, int roomFlags) {
 	for (CGameObject *obj = getFirstObject(); obj; obj = getNextObject(obj)) {
 		if (obj->_isMail && obj->_id == id) {
 			obj->_isMail = false;
-			obj->_field58 = v;
+			obj->_roomFlags = roomFlags;
 			break;
 		}
 	}
diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp
index 6143849..e33d0c4 100644
--- a/engines/titanic/core/room_item.cpp
+++ b/engines/titanic/core/room_item.cpp
@@ -183,4 +183,13 @@ int CRoomItem::getScriptId() const {
 	return 0;
 }
 
+CResourceKey CRoomItem::getTransitionMovieKey() {
+	_transitionMovieKey.scanForFile();
+	return _transitionMovieKey;
+}
+
+CResourceKey CRoomItem::getExitMovieKey() {
+	return _exitMovieKey;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index e3ba71c..4692318 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -72,6 +72,10 @@ public:
 	 * Get the TrueTalk script Id associated with the room
 	 */
 	int getScriptId() const;
+
+	CResourceKey getTransitionMovieKey();
+
+	CResourceKey getExitMovieKey();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index d0400a4..c5f0f11 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -34,16 +34,28 @@ CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
 		_project(project), _gameView(gameView), _trueTalkManager(this),
 		_inputHandler(this), _inputTranslator(&_inputHandler),		
 		_gameState(this), _sound(this), _musicRoom(this),
-		_field30(0), _soundMaker(nullptr), _field4C(0),
+		_treeItem(nullptr), _soundMaker(nullptr), _movieRoom(nullptr),
 		_dragItem(nullptr), _field54(0), _lastDiskTicksCount(0), _tickCount2(0) {
 	
 	CTimeEventInfo::_nextId = 0;
-	_videoSurface1 = nullptr;
-	_videoSurface2 = CScreenManager::_screenManagerPtr->createSurface(600, 340);
+	_movie = nullptr;
+	_movieSurface = CScreenManager::_screenManagerPtr->createSurface(600, 340);
 	_project->setGameManager(this);
 	g_vm->_filesManager->setGameManager(this);
 }
 
+CGameManager::~CGameManager() {
+	delete _movie;
+	delete _movieSurface;
+
+	if (_treeItem) {
+		_treeItem->destroyAll();
+		_treeItem = nullptr;
+	}
+
+	_project->resetGameManager();
+}
+
 void CGameManager::load(SimpleFile *file) {
 	file->readNumber();
 
@@ -107,8 +119,33 @@ void CGameManager::initBounds() {
 	_bounds = Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
 }
 
+void CGameManager::roomTransition(CRoomItem *oldRoom, CRoomItem *newRoom) {
+	delete _movie;
+	_movie = nullptr;
+
+	CResourceKey movieKey = (oldRoom == newRoom) ? oldRoom->getTransitionMovieKey() :
+		oldRoom->getExitMovieKey();
+	CString filename = movieKey.exists();
+	if (g_vm->_filesManager->fileExists(filename)) {
+		_movieSurface->freeSurface();
+		_movie = new OSMovie(filename, _movieSurface);
+	}
+}
+
 void CGameManager::playClip(CMovieClip *clip, CRoomItem *oldRoom, CRoomItem *newRoom) {
-	warning("TODO: CGameManager::playClip");
+	if (oldRoom != newRoom || newRoom != _movieRoom || !_movie)
+		roomTransition(oldRoom, newRoom);
+
+	if (clip && clip->_startFrame != clip->_endFrame && _movie) {
+		// Clip details specifying a sub-section of movie to play
+		Rect tempRect(20, 10, SCREEN_WIDTH - 20, 350);
+
+		lockInputHandler();
+		CScreenManager::_screenManagerPtr->_mouseCursor->hide();
+		_movie->playClip(tempRect, clip->_startFrame, clip->_endFrame);
+		CScreenManager::_screenManagerPtr->_mouseCursor->show();
+		unlockInputHandler();
+	}
 }
 
 void CGameManager::update() {
@@ -191,11 +228,11 @@ void CGameManager::updateDiskTicksCount() {
 }
 
 void CGameManager::viewChange() {
-	delete _videoSurface1;
-	delete _videoSurface2;
+	delete _movie;
+	delete _movieSurface;
 
-	_videoSurface1 = nullptr;
-	_videoSurface2 = CScreenManager::_screenManagerPtr->createSurface(600, 340);
+	_movie = nullptr;
+	_movieSurface = CScreenManager::_screenManagerPtr->createSurface(600, 340);
 	_trueTalkManager.clear();
 
 	for (CTreeItem *treeItem = _project; treeItem; treeItem = treeItem->scan(_project))
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index c4e6bc6..179e6cd 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -44,12 +44,12 @@ class CGameManager {
 private:
 	CTrueTalkManager _trueTalkManager;
 	CTimeEventInfoList _timers;
-	int _field30;
+	CTreeItem *_treeItem;
 	CBackgroundSoundMaker *_soundMaker;
-	CVideoSurface *_videoSurface1;
-	int _field4C;
+	CMovie *_movie;
+	CRoomItem *_movieRoom;
 	int _field54;
-	CVideoSurface *_videoSurface2;
+	CVideoSurface *_movieSurface;
 	uint _lastDiskTicksCount;
 	uint _tickCount2;
 private:
@@ -62,6 +62,11 @@ private:
 	 * Handles any ongoing movie playback
 	 */
 	void updateMovies();
+
+	/**
+	 * Handles a room transition
+	 */
+	void roomTransition(CRoomItem *oldRoom, CRoomItem *newRoom);
 public:
 	CProjectItem *_project;
 	CGameView *_gameView;
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 7934365..1643459 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -251,7 +251,7 @@ CRoomItem *CPetControl::getHiddenRoom() {
 
 CGameObject *CPetControl::getHiddenObject(const CString &name) {
 	CRoomItem *room = getHiddenRoom();
-	return room ? findUnder(room, name) : nullptr;
+	return room ? static_cast<CGameObject *>(findUnder(room, name)) : nullptr;
 }
 
 bool CPetControl::containsPt(const Common::Point &pt) const {
@@ -677,4 +677,14 @@ int CPetControl::getMailDest(const CRoomFlags &roomFlags) const {
 	return roomFlags.getSuccUBusNum(roomFlags.getSuccUBusRoomName());
 }
 
+void CPetControl::starsSetButtons(int val1, int val2) {
+	_starfield.setButtons(val1, val2);
+	if (_currentArea == PET_STARFIELD)
+		_starfield.makePetDirty();
+}
+
+void CPetControl::starsSetReference(bool hasRef) {
+	_starfield.setHasReference(hasRef);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index e389a0e..5601c40 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -386,6 +386,13 @@ public:
 	void resetActiveNPC();
 
 	/**
+	 * Resets NPC in conversations
+	 */
+	void convResetNPC() {
+		_conversations.resetNPC();
+	}
+
+	/**
 	 * Resets the conversation dials back to 0 position
 	 */
 	void resetDials0() { _conversations.resetDials0(); }
@@ -543,6 +550,23 @@ public:
 	bool isSuccUBusRoom(const CRoomFlags &roomFlags) {
 		return roomFlags.isSuccUBusRoomFlags();
 	}
+
+	/**
+	 * Called with a phonograph action for Send, Receive, or Record
+	 */
+	void phonographAction(const CString &action) {
+		// Original had some code that had no effect
+	}
+
+	/**
+	 * Sets the status buttons for the starfield control
+	 */
+	void starsSetButtons(int val1, int val2);
+
+	/**
+	 * Set whether the user has the galactic reference material
+	 */
+	void starsSetReference(bool hasRef);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_starfield.cpp b/engines/titanic/pet_control/pet_starfield.cpp
index 4230d94..cde512c 100644
--- a/engines/titanic/pet_control/pet_starfield.cpp
+++ b/engines/titanic/pet_control/pet_starfield.cpp
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 CPetStarfield::CPetStarfield() : _field18C(0), _photoOn(true),
-		_field210(0), _rect1(22, 352, 598, 478) {
+		_hasReference(false), _rect1(22, 352, 598, 478) {
 	_btnOffsets[0] = _btnOffsets[1] = _btnOffsets[2] = 0;
 }
 
@@ -86,7 +86,7 @@ bool CPetStarfield::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 		CPETHelmetOnOffMsg helmetMsg;
 		helmetMsg.execute(_petControl->_remoteTarget);
 	} else if (_imgPhoto.MouseButtonDownMsg(msg->_mousePos)) {
-		if (_field210) {
+		if (_hasReference) {
 			_photoOn = !_photoOn;
 			CPETPhotoOnOffMsg photoMsg;
 			photoMsg.execute(_petControl->_remoteTarget);
@@ -124,7 +124,7 @@ bool CPetStarfield::isValid(CPetControl *petControl) {
 void CPetStarfield::load(SimpleFile *file, int param) {
 	if (!param) {
 		_photoOn = file->readNumber();
-		_field210 = file->readNumber();
+		_hasReference = file->readNumber();
 	}
 }
 
@@ -134,7 +134,7 @@ void CPetStarfield::postLoad() {
 
 void CPetStarfield::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(_photoOn, indent);
-	file->writeNumberLine(_field210, indent);
+	file->writeNumberLine(_hasReference, indent);
 }
 
 bool CPetStarfield::setupControl(CPetControl *petControl) {
diff --git a/engines/titanic/pet_control/pet_starfield.h b/engines/titanic/pet_control/pet_starfield.h
index 6cfc308..ec659cc 100644
--- a/engines/titanic/pet_control/pet_starfield.h
+++ b/engines/titanic/pet_control/pet_starfield.h
@@ -41,7 +41,7 @@ private:
 	int _field18C;
 	CPetText _text;
 	bool _photoOn;
-	int _field210;
+	bool _hasReference;
 private:
 	/**
 	 * Setup the control
@@ -53,18 +53,6 @@ private:
 	 */
 	void drawButton(int offset, int index, CScreenManager *screenManager);
 
-	void set210(int val) { _field210 = val; }
-
-	/**
-	 * Sets the offsets for each of the buttons
-	 */
-	void setButtons(int val1, int val2);
-
-	/**
-	 * Make the PET as dirty, requiring a redraw
-	 */
-	void makePetDirty();
-
 	/**
 	 * Mouse down handling for Nav elements
 	 */
@@ -115,6 +103,21 @@ public:
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Sets the offsets for each of the buttons
+	 */
+	void setButtons(int val1, int val2);
+
+	/**
+	 * Sets whether the player has the galactic reference material
+	 */
+	void setHasReference(bool hasRef) { _hasReference = hasRef; }
+
+	/**
+	 * Make the PET as dirty, requiring a redraw
+	 */
+	void makePetDirty();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 26620de..cde3b22 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -87,8 +87,8 @@ void OSMovie::play(uint startFrame, uint endFrame, int v3, bool v4) {
 	_state = MOVIE_NONE;
 }
 
-void OSMovie::proc10() {
-	warning("TODO: OSMovie::proc10");
+void OSMovie::playClip(const Rect &rect, uint startFrame, uint endFrame) {
+	warning("TODO: OSMovie::playClip");
 }
 
 void OSMovie::proc11() {
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index 01f107e..61dd4cf 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -61,7 +61,11 @@ public:
 	 */
 	virtual void play(uint startFrame, uint endFrame, int v3, bool v4) = 0;
 	
-	virtual void proc10() = 0;
+	/**
+	 * Plays a sub-section of a movie
+	 */
+	virtual void playClip(const Rect &rect, uint startFrame, uint endFrame) = 0;
+	
 	virtual void proc11() = 0;
 	virtual void proc12(const CString &name, int flags, CGameObject *obj) = 0;
 
@@ -119,7 +123,11 @@ public:
 	 */
 	virtual void play(uint startFrame, uint endFrame, int v3, bool v4);
 	
-	virtual void proc10();
+	/**
+	 * Plays a sub-section of a movie
+	 */
+	virtual void playClip(const Rect &rect, uint startFrame, uint endFrame);
+
 	virtual void proc11();
 	virtual void proc12(const CString &name, int flags, CGameObject *obj);
 


Commit: e161a3d2078c8b9d284b5bfbeab8de3d8304eedb
    https://github.com/scummvm/scummvm/commit/e161a3d2078c8b9d284b5bfbeab8de3d8304eedb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:22-04:00

Commit Message:
TITANIC: Added extra CGameState methods

Changed paths:
    engines/titanic/game_state.h



diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 3274592..125882a 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -124,6 +124,11 @@ public:
 	 */
 	void addMovie(CMovie *movie);
 
+	void inc14() { _field14 = (_field14 + 1) & 3; }
+	void set24(int v) { _field24 = v; }
+	int get24() const { return _field24; }
+	int getNodeChangedCtr() const { return _nodeChangeCtr; }
+	uint32 getNodeEnterTicks() const { return _nodeEnterTicks; }
 	void inc38() { ++_field38; }
 };
 


Commit: c87a6e212aa190a7473722dfdd34cf794105d265
    https://github.com/scummvm/scummvm/commit/c87a6e212aa190a7473722dfdd34cf794105d265
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:25-04:00

Commit Message:
TITANIC: Adding stub methods to CGameObject

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 0bf5464..15bc1ec 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -869,17 +869,6 @@ CMailMan *CGameObject::getMailMan() const {
 	return dynamic_cast<CMailMan *>(getDontSaveChild(CMailMan::_type));
 }
 
-CStarControl *CGameObject::getStarControl() const {
-	CStarControl *starControl = static_cast<CStarControl *>(getDontSaveChild(CStarControl::_type));
-	if (!starControl) {
-		CViewItem *view = getGameManager()->getView();
-		if (view)
-			starControl = starControl = static_cast<CStarControl *>(view->findChildInstanceOf(CStarControl::_type));
-	}
-
-	return starControl;
-}
-
 CTreeItem *CGameObject::getDontSaveChild(ClassDef *classDef) const {
 	CProjectItem *root = getRoot();
 	if (!root)
@@ -892,11 +881,6 @@ CTreeItem *CGameObject::getDontSaveChild(ClassDef *classDef) const {
 	return dontSave->findChildInstanceOf(classDef);
 }
 
-CRoomItem *CGameObject::getRoom() const {
-	CGameManager *gameManager = getGameManager();
-	return gameManager ? gameManager->getRoom() : nullptr;
-}
-
 CRoomItem *CGameObject::getHiddenRoom() const {
 	CProjectItem *root = getRoot();
 	return root ? root->findHiddenRoom() : nullptr;
@@ -1043,6 +1027,25 @@ void CGameObject::resetMail() {
 		mailMan->resetValue();
 }
 
+/*------------------------------------------------------------------------*/
+
+CRoomItem *CGameObject::getRoom() const {
+	CGameManager *gameManager = getGameManager();
+	return gameManager ? gameManager->getRoom() : nullptr;
+}
+
+CNodeItem *CGameObject::getNode() const {
+	CGameManager *gameManager = getGameManager();
+	return gameManager ? gameManager->getNode() : nullptr;
+}
+
+CViewItem *CGameObject::getView() const {
+	CGameManager *gameManager = getGameManager();
+	return gameManager ? gameManager->getView() : nullptr;
+}
+
+/*------------------------------------------------------------------------*/
+
 void CGameObject::petAddToCarryParcel(CGameObject *obj) {
 	CPetControl *pet = getPetControl();
 	if (pet) {
@@ -1150,6 +1153,31 @@ void CGameObject::petUnlockInput() {
 
 /*------------------------------------------------------------------------*/
 
+CStarControl *CGameObject::getStarControl() const {
+	CStarControl *starControl = static_cast<CStarControl *>(getDontSaveChild(CStarControl::_type));
+	if (!starControl) {
+		CViewItem *view = getGameManager()->getView();
+		if (view)
+			starControl = starControl = static_cast<CStarControl *>(view->findChildInstanceOf(CStarControl::_type));
+	}
+
+	return starControl;
+}
+
+void CGameObject::starFn1(int v) {
+	CStarControl *starControl = getStarControl();
+	if (starControl)
+		starControl->fn1(v);
+}
+
+void CGameObject::starFn2() {
+	CStarControl *starControl = getStarControl();
+	if (starControl)
+		starControl->fn4();
+}
+
+/*------------------------------------------------------------------------*/
+
 void CGameObject::startTalking(const CString &npcName, uint id, CViewItem *view) {
 	CTrueTalkNPC *npc = static_cast<CTrueTalkNPC *>(getRoot()->findByName(npcName));
 	startTalking(npc, id, view);
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 67bf131..448b547 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -290,11 +290,6 @@ protected:
 	CTreeItem *getDontSaveChild(ClassDef *classDef) const;
 
 	/**
-	 * Return the current room
-	 */
-	CRoomItem *getRoom() const;
-
-	/**
 	 * Returns the special hidden room container
 	 */
 	CRoomItem *getHiddenRoom() const;
@@ -529,6 +524,23 @@ public:
 	
 	bool compareRoomFlags(int mode, uint flags1, uint flags2);
 
+	/*--- CGameManager Methods ---*/
+
+	/**
+	 * Return the current room
+	 */
+	CRoomItem *getRoom() const;
+
+	/**
+	 * Return the current node
+	 */
+	CNodeItem *getNode() const;
+
+	/**
+	 * Return the current room
+	 */
+	CViewItem *getView() const;
+
 	/*--- CPetControl Methods ---*/
 
 	/**
@@ -624,6 +636,9 @@ public:
 	 */
 	CStarControl *getStarControl() const;
 
+	void starFn1(int v);
+	void starFn2();
+
 	/*--- CTrueTalkManager Methods ---*/
 
 	/**
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index 3f84a94..f27f16d 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -57,4 +57,12 @@ void CStarControl::fn3() {
 	warning("CStarControl::fn3");
 }
 
+void CStarControl::fn1(int v) {
+	warning("CStarControl::fn1");
+}
+
+void CStarControl::fn4() {
+	warning("CStarControl::fn4");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index 3e53db1..ee042b6 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -53,7 +53,9 @@ public:
 	 */
 	virtual void load(SimpleFile *file);
 
+	void fn1(int v);
 	void fn3();
+	void fn4();
 };
 
 } // End of namespace Titanic


Commit: 3988a9eeee98efdd3b297cde76640416fc13f3ca
    https://github.com/scummvm/scummvm/commit/3988a9eeee98efdd3b297cde76640416fc13f3ca
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:27-04:00

Commit Message:
TITANIC: Adding more game object methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/npcs/true_talk_npc.cpp
    engines/titanic/npcs/true_talk_npc.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 15bc1ec..72a6e92 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -678,6 +678,26 @@ int CGameObject::compareRoomNameTo(const CString &name) {
 	return room->getName().compareToIgnoreCase(name);
 }
 
+CString CGameObject::getRoomName() const {
+	CRoomItem *room = getRoom();
+	return room ? room->getName() : CString();
+}
+
+CString CGameObject::getRoomNodeName() const {
+	CNodeItem *node = getNode();
+	if (!node)
+		return CString();
+
+	CRoomItem *room = node->findRoom();
+
+	return CString::format("%s.%s", room->getName().c_str(), node->getName().c_str());
+}
+
+CString CGameObject::getFullViewName() {
+	CGameManager *gameManager = getGameManager();
+	return gameManager ? gameManager->getFullViewName() : CString();
+}
+
 CGameObject *CGameObject::getMailManFirstObject() const {
 	CMailMan *mailMan = getMailMan();
 	return mailMan ? mailMan->getFirstObject() : nullptr;
@@ -711,6 +731,11 @@ CGameObject *CGameObject::findRoomObject(const CString &name) const {
 	return static_cast<CGameObject *>(findRoom()->findByName(name));
 }
 
+CGameObject *CGameObject::findInRoom(const CString &name) {
+	CRoomItem *room = getRoom();
+	return room ? static_cast<CGameObject *>(room->findByName(name)) : nullptr;
+}
+
 Found CGameObject::find(const CString &name, CGameObject **item, int findAreas) {
 	CGameObject *go;
 	*item = nullptr;
@@ -903,6 +928,16 @@ CTreeItem *CGameObject::findUnder(CTreeItem *parent, const CString &name) const
 	return nullptr;
 }
 
+CRoomItem *CGameObject::findRoomByName(const CString &name) {
+	CProjectItem *project = getRoot();
+	for (CRoomItem *room = project->findFirstRoom(); room; room = project->findNextRoom(room)) {
+		if (!room->getName().compareToIgnoreCase(name))
+			return room;
+	}
+
+	return nullptr;
+}
+
 CMusicRoom *CGameObject::getMusicRoom() const {
 	CGameManager *gameManager = getGameManager();
 	return gameManager ? &gameManager->_musicRoom : nullptr;
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 448b547..4d53bd3 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -221,6 +221,11 @@ protected:
 	CGameObject *findRoomObject(const CString &name) const;
 
 	/**
+	 * FInds an object under the current room
+	 */
+	CGameObject *findInRoom(const CString &name);
+
+	/**
 	 * Moves the item from it's original position to be under the current view
 	 */
 	void moveToView();
@@ -305,6 +310,11 @@ protected:
 	CTreeItem *findUnder(CTreeItem *parent, const CString &name) const;
 
 	/**
+	 * Finds a room by name
+	 */
+	CRoomItem *findRoomByName(const CString &name);
+
+	/**
 	 * Returns the music room instance from the game manager
 	 */
 	CMusicRoom *getMusicRoom() const;
@@ -541,6 +551,22 @@ public:
 	 */
 	CViewItem *getView() const;
 
+	/**
+	 * Get the current room name
+	 */
+	CString getRoomName() const;
+
+	/**
+	 * Get the current node and room in the form "room.node"
+	 */
+	CString getRoomNodeName() const;
+
+	/**
+	 * Return the full Id of the current view in a
+	 * room.node.view tuplet form
+	 */
+	CString getFullViewName();
+
 	/*--- CPetControl Methods ---*/
 
 	/**
@@ -655,7 +681,6 @@ public:
 	 * Start a conversation with the NPC
 	 */
 	void startTalking(const CString &name, uint id, CViewItem *view = nullptr);
-
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index 00b68c2..0295826 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -211,4 +211,11 @@ void CTrueTalkNPC::setView(CViewItem *view) {
 		talkManager->start3(this, view);
 }
 
+void CTrueTalkNPC::startTalker(CViewItem *view) {
+	CGameManager *gameManager = getGameManager();
+	if (gameManager)
+		gameManager->getTalkManager()->start4(this, view);
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index 1a10a0a..b13841b 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -85,6 +85,11 @@ public:
 	 * Set the view for the NPC
 	 */
 	void setView(CViewItem *view);
+
+	/**
+	 * Start the talker in the given view
+	 */
+	void startTalker(CViewItem *view);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 1643459..6e30711 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -513,11 +513,6 @@ void CPetControl::playSound(int soundNum) {
 	}
 }
 
-CString CPetControl::getRoomName() const {
-	CRoomItem *room = getRoom();
-	return room ? room->getName() : CString();
-}
-
 int CPetControl::canSummonBot(const CString &name) {
 	// If player is the very same view as the NPC, then it's already present
 	if (isBotInView(name))
@@ -652,11 +647,6 @@ CGameObject *CPetControl::findBot(const CString &name, CTreeItem *root) {
 	return nullptr;
 }
 
-CString CPetControl::getFullViewName() {
-	CGameManager *gameManager = getGameManager();
-	return gameManager ? gameManager->getFullViewName() : CString();
-}
-
 bool CPetControl::isSuccUBusActive() const {
 	if (!_activeNPC)
 		return false;
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 5601c40..75b92d7 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -282,11 +282,6 @@ public:
 	void playSound(int soundNum);
 
 	/**
-	 * Get the room name
-	 */
-	CString getRoomName() const;
-
-	/**
 	 * Check whether an NPC can be summoned
 	 */
 	int canSummonBot(const CString &name);
@@ -322,12 +317,6 @@ public:
 	void stopPetTimer(uint timerIndex);
 
 	/**
-	 * Return the full Id of the current view in a
-	 * room.node.view tuplet form
-	 */
-	CString getFullViewName();
-
-	/**
 	 * Returns true if all input is currently locked (disabled)
 	 */
 	bool isInputLocked() const { return _inputLockCount > 0; }


Commit: f141b337177bb0bd001c753f8cb17999b6ea2bf9
    https://github.com/scummvm/scummvm/commit/f141b337177bb0bd001c753f8cb17999b6ea2bf9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:30-04:00

Commit Message:
TITANIC: Adding CGameObject methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/tree_item.h
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 72a6e92..795ed92 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -143,6 +143,70 @@ void CGameObject::load(SimpleFile *file) {
 	CNamedItem::load(file);
 }
 
+void CGameObject::draw(CScreenManager *screenManager) {
+	if (!_visible)
+		return;
+	if (_credits) {
+		error("TODO: Block in CGameObject::draw");
+	}
+
+	if (_field40) {
+		if (_field90) {
+			if (_bounds.intersects(getGameManager()->_bounds))
+				warning("TODO: _field90(screenManager);");
+		}
+	}
+	else {
+		if (!_surface) {
+			if (!_resource.empty()) {
+				loadResource(_resource);
+				_resource = "";
+			}
+		}
+
+		if (_surface) {
+			_bounds.setWidth(_surface->getWidth());
+			_bounds.setHeight(_surface->getHeight());
+
+			if (!_bounds.width() || !_bounds.height())
+				return;
+
+			if (_frameNumber >= 0) {
+				loadFrame(_frameNumber);
+				_frameNumber = -1;
+			}
+
+			if (!_clipList2.empty())
+				processClipList2();
+
+			if (_bounds.intersects(getGameManager()->_bounds)) {
+				if (_surface) {
+					Point destPos(_bounds.left, _bounds.top);
+					screenManager->blitFrom(SURFACE_BACKBUFFER, _surface, &destPos);
+				}
+
+				if (_field90)
+					warning("TODO: sub_415f80(screenManager);");
+			}
+		}
+	}
+}
+
+Rect CGameObject::getBounds() const {
+	return (_surface && _surface->proc45()) ? _bounds : Rect();
+}
+
+void CGameObject::viewChange() {
+	// Handle freeing the surfaces of objects when their view is left
+	if (_surface) {
+		_resource = _surface->_resourceKey.getString();
+		_initialFrame = getMovieFrame();
+
+		delete _surface;
+		_surface = nullptr;
+	}
+}
+
 void CGameObject::stopMovie() {
 	if (_surface)
 		_surface->stopMovie();
@@ -214,54 +278,6 @@ void CGameObject::draw(CScreenManager *screenManager, const Point &destPos, cons
 	draw(screenManager, Rect(destPos.x, destPos.y, destPos.x + 52, destPos.y + 52), srcRect);
 }
 
-void CGameObject::draw(CScreenManager *screenManager) {
-	if (!_visible)
-		return;
-	if (_credits) {
-		error("TODO: Block in CGameObject::draw");
-	}
-
-	if (_field40) {
-		if (_field90) {
-			if (_bounds.intersects(getGameManager()->_bounds))
-				warning("TODO: _field90(screenManager);");
-		}
-	} else {
-		if (!_surface) {
-			if (!_resource.empty()) {
-				loadResource(_resource);
-				_resource = "";
-			}
-		}
-
-		if (_surface) {
-			_bounds.setWidth(_surface->getWidth());
-			_bounds.setHeight(_surface->getHeight());
-
-			if (!_bounds.width() || !_bounds.height())
-				return;
-
-			if (_frameNumber >= 0) {
-				loadFrame(_frameNumber);
-				_frameNumber = -1;
-			}
-
-			if (!_clipList2.empty())
-				processClipList2();
-
-			if (_bounds.intersects(getGameManager()->_bounds)) {
-				if (_surface) {
-					Point destPos(_bounds.left, _bounds.top);
-					screenManager->blitFrom(SURFACE_BACKBUFFER, _surface, &destPos);
-				}
-
-				if (_field90)
-					warning("TODO: sub_415f80(screenManager);");
-			}
-		}
-	}
-}
-
 bool CGameObject::isPet() const {
 	return isInstanceOf(CPetControl::_type);
 }
@@ -369,6 +385,10 @@ bool CGameObject::soundFn1(int handle) {
 	return false;
 }
 
+void CGameObject::soundFn2(const CString &resName, int v1, int v2, int v3, int handleIndex) {
+	warning("TODO: CGameObject::soundFn2");
+}
+
 void CGameObject::soundFn3(int handle, int val2, int val3) {
 	if (handle != 0 && handle != -1) {
 		CGameManager *gameManager = getGameManager();
@@ -377,6 +397,14 @@ void CGameObject::soundFn3(int handle, int val2, int val3) {
 	}
 }
 
+void CGameObject::soundFn4(int v1, int v2, int v3) {
+	warning("CGameObject::soundFn4");
+}
+
+void CGameObject::soundFn5(int v1, int v2, int v3) {
+	warning("CGameObject::soundFn5");
+}
+
 void CGameObject::setVisible(bool val) {
 	if (val != _visible) {
 		_visible = val;
@@ -402,6 +430,24 @@ void CGameObject::petShowCursor() {
 		pet->showCursor();
 }
 
+void CGameObject::petShow() {
+	CGameManager *gameManager = getGameManager();
+	if (gameManager) {
+		gameManager->_gameState._petActive = true;
+		gameManager->_gameState.setMode(GSMODE_SELECTED);
+		gameManager->initBounds();
+	}
+}
+
+void CGameObject::petHide() {
+	CGameManager *gameManager = getGameManager();
+	if (gameManager) {
+		gameManager->_gameState._petActive = false;
+		gameManager->_gameState.setMode(GSMODE_SELECTED);
+		gameManager->initBounds();
+	}
+}
+
 void CGameObject::petSetRemoteTarget() {
 	CPetControl *pet = getPetControl();
 	if (pet)
@@ -886,6 +932,11 @@ void CGameObject::petClear() const {
 		petControl->resetActiveNPC();
 }
 
+CDontSaveFileItem *CGameObject::getDontSave() const {
+	CProjectItem *project = getRoot();
+	return project ? project->getDontSaveFileItem() : nullptr;
+}
+
 CPetControl *CGameObject::getPetControl() const {
 	return static_cast<CPetControl *>(getDontSaveChild(CPetControl::_type));
 }
@@ -1005,6 +1056,10 @@ int CGameObject::getClipDuration(const CString &name, int frameRate) const {
 	return clip ? (clip->_endFrame - clip->_startFrame) * 1000 / frameRate : 0;
 }
 
+uint32 CGameObject::getTickCount() {
+	return g_vm->_events->getTicksCount();
+}
+
 bool CGameObject::compareRoomFlags(int mode, uint flags1, uint flags2) {
 	switch (mode) {
 	case 1:
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 4d53bd3..a744cd1 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -36,6 +36,7 @@ namespace Titanic {
 enum Find { FIND_GLOBAL = 1, FIND_ROOM = 2, FIND_PET = 4, FIND_MAILMAN = 8 };
 enum Found { FOUND_NONE = 0, FOUND_GLOBAL = 1, FOUND_ROOM = 2, FOUND_PET = 3, FOUND_MAILMAN = 4 };
 
+class CDontSaveFileItem;
 class CMailMan;
 class CMusicRoom;
 class CRoomItem;
@@ -157,8 +158,14 @@ protected:
 
 	bool soundFn1(int handle);
 
+	void soundFn2(const CString &resName, int v1, int v2, int v3, int handleIndex);
+
 	void soundFn3(int handle, int val2, int val3);
 
+	void soundFn4(int v1, int v2, int v3);
+
+	void soundFn5(int v1, int v2, int v3);
+
 	/**
 	 * Adds a timer
 	 */
@@ -290,6 +297,11 @@ protected:
 	CMailMan *getMailMan() const;
 
 	/**
+	 * Gets the don't save container object
+	 */
+	CDontSaveFileItem *getDontSave() const;
+
+	/**
 	 * Returns a child of the Dont Save area of the project of the given class
 	 */
 	CTreeItem *getDontSaveChild(ClassDef *classDef) const;
@@ -337,6 +349,11 @@ protected:
 	 */
 	int getClipDuration(const CString &name, int frameRate = 14) const;
 
+	/**
+	 * Returns the current system tick count
+	 */
+	uint32 getTickCount();
+
 	void setState1C(bool flag);
 
 	/**
@@ -410,24 +427,39 @@ public:
 	virtual void load(SimpleFile *file);
 
 	/**
+	 * Returns the clip list, if any, associated with the item
+	 */
+	virtual const CMovieClipList *getClipList() const { return &_clipList1; }
+
+	/**
 	 * Allows the item to draw itself
 	 */
-	void draw(CScreenManager *screenManager, const Rect &destRect, const Rect &srcRect);
+	virtual void draw(CScreenManager *screenManager);
+
+	/**
+	 * Gets the bounds occupied by the item
+	 */
+	virtual Rect getBounds() const;
+
+	/**
+	 * Called when the view changes
+	 */
+	virtual void viewChange();
 
 	/**
 	 * Allows the item to draw itself
 	 */
-	void draw(CScreenManager *screenManager, const Point &destPos);
+	void draw(CScreenManager *screenManager, const Rect &destRect, const Rect &srcRect);
 
 	/**
 	 * Allows the item to draw itself
 	 */
-	void draw(CScreenManager *screenManager, const Point &destPos, const Rect &srcRect);
+	void draw(CScreenManager *screenManager, const Point &destPos);
 
 	/**
 	 * Allows the item to draw itself
 	 */
-	virtual void draw(CScreenManager *screenManager);
+	void draw(CScreenManager *screenManager, const Point &destPos, const Rect &srcRect);
 
 	/**
 	 * Returns true if the item is the PET control
@@ -609,6 +641,11 @@ public:
 	int petGetRooms1D0() const;
 
 	/**
+	 * Hide the PET
+	 */
+	void petHide();
+
+	/**
 	 * Hides the text cursor in the current section, if applicable
 	 */
 	void petHideCursor();
@@ -646,6 +683,11 @@ public:
 	void petSetRooms1D0(int val);
 
 	/**
+	 * Show the PET
+	 */
+	void petShow();
+
+	/**
 	 * Shows the text cursor in the current section, if applicable
 	 */
 	void petShowCursor();
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 2ea7b42..77d7aa5 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -29,6 +29,7 @@
 namespace Titanic {
 
 class CGameManager;
+class CMovieClipList;
 class CNamedItem;
 class CProjectItem;
 class CScreenManager;
@@ -128,6 +129,13 @@ public:
 	 */
 	virtual int compareTo(const CString &name, int maxLen) const { return false; }
 
+	virtual int proc23() const { return 0; }
+
+	/**
+	 * Returns the clip list, if any, associated with the item
+	 */
+	virtual const CMovieClipList *getClipList() const { return nullptr; }
+
 	/**
 	 * Returns true if the given item connects to another specified view
 	 */
@@ -141,7 +149,7 @@ public:
 	/**
 	 * Gets the bounds occupied by the item
 	 */
-	virtual Rect getBounds() { return Rect(); }
+	virtual Rect getBounds() const { return Rect(); }
 
 	/**
 	 * Called when the view changes
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 8d0dd2f..6f707a3 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -54,7 +54,6 @@ protected:
 	static int _videoSurfaceCounter;
 protected:
 	CScreenManager *_screenManager;
-	CResourceKey _resourceKey;
 	Graphics::ManagedSurface *_rawSurface;
 	bool _pendingLoad;
 	void *_field40;
@@ -68,6 +67,7 @@ public:
 	DirectDrawSurface *_ddSurface;
 	bool _blitFlag;
 	bool _blitStyleFlag;
+	CResourceKey _resourceKey;
 public:
 	CVideoSurface(CScreenManager *screenManager);
 	virtual ~CVideoSurface();


Commit: 0e8148207070e92a5234e5c0a4e05fe401901736
    https://github.com/scummvm/scummvm/commit/0e8148207070e92a5234e5c0a4e05fe401901736
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:33-04:00

Commit Message:
TITANIC: Added more CGameObject methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 795ed92..183cb6b 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -850,6 +850,14 @@ void CGameObject::lockMouse() {
 		CScreenManager::_screenManagerPtr->_mouseCursor->hide();
 }
 
+void CGameObject::hideMouse() {
+	CScreenManager::_screenManagerPtr->_mouseCursor->hide();
+}
+
+void CGameObject::showMouse() {
+	CScreenManager::_screenManagerPtr->_mouseCursor->show();
+}
+
 void CGameObject::unlockMouse() {
 	if (CScreenManager::_screenManagerPtr->_mouseCursor)
 		CScreenManager::_screenManagerPtr->_mouseCursor->show();
@@ -898,6 +906,11 @@ void CGameObject::dragMove(const Point &pt) {
 	setPosition(Point(pt.x - _bounds.width() / 2, pt.y - _bounds.height() / 2));
 }
 
+bool CGameObject::isObjectDragging() const {
+	CTreeItem *item = getGameManager()->_dragItem;
+	return item ? static_cast<CGameObject *>(item) != nullptr : false;
+}
+
 Point CGameObject::getControid() const {
 	return Point(_bounds.left + _bounds.width() / 2,
 		_bounds.top + _bounds.height() / 2);
@@ -1294,4 +1307,30 @@ void CGameObject::endTalking(CTrueTalkNPC *npc, bool viewFlag, CViewItem *view)
 		pet->refreshNPC();
 }
 
+void CGameObject::talkSetDialRegion(const CString &name, int dialNum, int regionNum) {
+	CGameManager *gameManager = getGameManager();
+	if (gameManager) {
+		CTrueTalkManager *talkManager = gameManager->getTalkManager();
+		if (talkManager) {
+			TTnpcScript *npcScript = talkManager->getTalker(name);
+			if (npcScript)
+				npcScript->setDialRegion(dialNum, regionNum);
+		}
+	}
+}
+
+int CGameObject::talkGetDIalRegion(const CString &name, int dialNum) {
+	CGameManager *gameManager = getGameManager();
+	if (gameManager) {
+		CTrueTalkManager *talkManager = gameManager->getTalkManager();
+		if (talkManager) {
+			TTnpcScript *npcScript = talkManager->getTalker(name);
+			if (npcScript)
+				return npcScript->getDialRegion(dialNum);
+		}
+	}
+
+	return 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index a744cd1..d9f382c 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -137,6 +137,16 @@ protected:
 	void unlockMouse();
 
 	/**
+	 * Hides the mouse cursor
+	 */
+	void hideMouse();
+
+	/**
+	 * Shows the mouse cursor
+	 */
+	void showMouse();
+
+	/**
 	 * Load a sound
 	 */
 	void loadSound(const CString &name);
@@ -564,6 +574,11 @@ public:
 	 */
 	void dragMove(const Point &pt);
 	
+	/**
+	 * Returns true if an item being dragged is a game object
+	 */
+	bool isObjectDragging() const;
+
 	bool compareRoomFlags(int mode, uint flags1, uint flags2);
 
 	/*--- CGameManager Methods ---*/
@@ -723,6 +738,16 @@ public:
 	 * Start a conversation with the NPC
 	 */
 	void startTalking(const CString &name, uint id, CViewItem *view = nullptr);
+
+	/**
+	 * Sets a dial region for a given NPC
+	 */
+	void talkSetDialRegion(const CString &name, int dialNum, int regionNum);
+
+	/**
+	 * Gets a dial region for a given NPC
+	 */
+	int talkGetDIalRegion(const CString &name, int dialNum);
 };
 
 } // End of namespace Titanic


Commit: a1c181f94945633300a9e9c4f657bb654abad98c
    https://github.com/scummvm/scummvm/commit/a1c181f94945633300a9e9c4f657bb654abad98c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:36-04:00

Commit Message:
TITANIC: Adding CGameObject methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/npcs/true_talk_npc.cpp
    engines/titanic/npcs/true_talk_npc.h
    engines/titanic/support/mouse_cursor.cpp
    engines/titanic/support/mouse_cursor.h
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 183cb6b..9c5f9db 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -830,10 +830,32 @@ void CGameObject::moveToView() {
 	view->addUnder(this);
 }
 
+void CGameObject::moveToView(const CString &name) {
+	CViewItem *view = parseView(name);
+	detach();
+	view->addUnder(this);
+}
+
 void CGameObject::incState38() {
 	getGameManager()->_gameState.inc38();
 }
 
+void CGameObject::stateInc14() {
+	getGameManager()->_gameState.inc14();
+}
+
+int CGameObject::stateGet14() {
+	return getGameManager()->_gameState._field14;
+}
+
+void CGameObject::stateSet24() {
+	getGameManager()->_gameState.set24(1);
+}
+
+int CGameObject::stateGet24() {
+	return getGameManager()->_gameState.get24();
+}
+
 void CGameObject::inc54() {
 	getGameManager()->inc54();
 }
@@ -842,6 +864,11 @@ void CGameObject::dec54() {
 	getGameManager()->dec54();
 }
 
+void CGameObject::surface39(int v1, int v2) {
+	if (_surface)
+		_surface->proc39(v1, v2);
+}
+
 void CGameObject::lockMouse() {
 	CGameManager *gameMan = getGameManager();
 	gameMan->lockInputHandler();
@@ -858,6 +885,36 @@ void CGameObject::showMouse() {
 	CScreenManager::_screenManagerPtr->_mouseCursor->show();
 }
 
+void CGameObject::disableMouse() {
+	lockInputHandler();
+	hideMouse();
+}
+
+void CGameObject::enableMouse() {
+	unlockInputHandler();
+	showMouse();
+}
+
+void CGameObject::mouseLockE4() {
+	CScreenManager::_screenManagerPtr->_mouseCursor->lockE4();
+}
+
+void CGameObject::mouseUnlockE4() {
+	CScreenManager::_screenManagerPtr->_mouseCursor->unlockE4();
+}
+
+void CGameObject::mouseSaveState(int v1, int v2, int v3) {
+	CScreenManager::_screenManagerPtr->_mouseCursor->saveState(v1, v2, v3);
+}
+
+void CGameObject::lockInputHandler() {
+	getGameManager()->lockInputHandler();
+}
+
+void CGameObject::unlockInputHandler() {
+	getGameManager()->unlockInputHandler();
+}
+
 void CGameObject::unlockMouse() {
 	if (CScreenManager::_screenManagerPtr->_mouseCursor)
 		CScreenManager::_screenManagerPtr->_mouseCursor->show();
@@ -1244,6 +1301,12 @@ void CGameObject::petSetRooms1D0(int val) {
 		petControl->setRooms1D0(val);
 }
 
+void CGameObject::petSetRooms1D4(int v) {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->setRooms1D4(v);
+}
+
 void CGameObject::petOnSummonBot(const CString &name, int val) {
 	CPetControl *pet = getPetControl();
 	if (pet)
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index d9f382c..02168c9 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -122,7 +122,6 @@ protected:
 	 */
 	CViewItem * parseView(const CString &viewString);
 
-	void incState38();
 	void inc54();
 	void dec54();
 
@@ -147,6 +146,31 @@ protected:
 	void showMouse();
 
 	/**
+	 * Disable the mouse
+	 */
+	void disableMouse();
+
+	/**
+	 * Enable the mouse
+	 */
+	void enableMouse();
+
+	void mouseLockE4();
+	void mouseUnlockE4();
+
+	void mouseSaveState(int v1, int v2, int v3);
+
+	/**
+	 * Lock the input handler
+	 */
+	void lockInputHandler();
+
+	/**
+	 * Unlock the input handler
+	 */
+	void unlockInputHandler();
+
+	/**
 	 * Load a sound
 	 */
 	void loadSound(const CString &name);
@@ -243,11 +267,16 @@ protected:
 	CGameObject *findInRoom(const CString &name);
 
 	/**
-	 * Moves the item from it's original position to be under the current view
+	 * Moves the object to be under the current view
 	 */
 	void moveToView();
 
 	/**
+	 * Moves the object to be under the specified view
+	 */
+	void moveToView(const CString &name);
+
+	/**
 	 * Change the view
 	 */
 	bool changeView(const CString &viewName, const CString &clipName);
@@ -364,8 +393,6 @@ protected:
 	 */
 	uint32 getTickCount();
 
-	void setState1C(bool flag);
-
 	/**
 	 * Adds an object to the mail list
 	 */
@@ -405,6 +432,15 @@ protected:
 	 * Unlocks PET input
 	 */
 	void petUnlockInput();
+
+	void setState1C(bool flag);
+	void incState38();
+	void stateInc14();
+	int stateGet14();
+	void stateSet24();
+	int stateGet24();
+
+	void surface39(int v1, int v2);
 public:
 	bool _isMail;
 	int _id;
@@ -696,6 +732,8 @@ public:
 	void petSetRemoteTarget();
 
 	void petSetRooms1D0(int val);
+	void petSetRooms1D4(int v);
+
 
 	/**
 	 * Show the PET
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index 0295826..c989aa3 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -205,6 +205,10 @@ int CTrueTalkNPC::startAnimTimer(const CString &action, uint firstDuration, uint
 	return timer->_id;
 }
 
+void CTrueTalkNPC::stopAnimTimer(int id) {
+	getGameManager()->stopTimer(id);
+}
+
 void CTrueTalkNPC::setView(CViewItem *view) {
 	CTrueTalkManager *talkManager = getGameManager()->getTalkManager();
 	if (talkManager)
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index b13841b..2361304 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -67,6 +67,11 @@ protected:
 	 * Start an animation timer
 	 */
 	int startAnimTimer(const CString &action, uint firstDuration, uint duration);
+
+	/**
+	 * Stop an animation timer
+	 */
+	void stopAnimTimer(int id);
 public:
 	CLASSDEF
 	CTrueTalkNPC();
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index 6ebf4f2..d87e7a4 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -51,7 +51,8 @@ static const int CURSOR_DATA[NUM_CURSORS][4] = {
 };
 
 CMouseCursor::CMouseCursor(CScreenManager *screenManager) : 
-		_screenManager(screenManager), _cursorId(CURSOR_HOURGLASS), _setCursorCount(0) {
+		_screenManager(screenManager), _cursorId(CURSOR_HOURGLASS),
+		_setCursorCount(0), _fieldE4(0), _fieldE8(0) {
 	loadCursorImages();
 	setCursor(CURSOR_ARROW);
 }
@@ -129,4 +130,19 @@ void CMouseCursor::update() {
 	// No implementation needed
 }
 
+void CMouseCursor::lockE4() {
+	_fieldE4 = 0;
+	CScreenManager::_screenManagerPtr->_inputHandler->incLockCount();
+}
+
+void CMouseCursor::unlockE4() {
+	_fieldE4 = 1;
+	_fieldE8 = 0;
+	CScreenManager::_screenManagerPtr->_inputHandler->decLockCount();
+}
+
+void CMouseCursor::saveState(int v1, int v2, int v3) {
+	// TODO
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h
index ac5da26..55e0cb4 100644
--- a/engines/titanic/support/mouse_cursor.h
+++ b/engines/titanic/support/mouse_cursor.h
@@ -62,6 +62,8 @@ private:
 	CursorId _cursorId;
 	CursorEntry _cursors[NUM_CURSORS];
 	uint _setCursorCount;
+	int _fieldE4;
+	int _fieldE8;
 
 	/**
 	 * Load the images for each cursor
@@ -95,6 +97,11 @@ public:
 	 * Returns the number of times the cursor has been set
 	 */
 	uint getChangeCount() const { return _setCursorCount; }
+
+	void lockE4();
+	void unlockE4();
+
+	void saveState(int v1, int v2, int v3);
 };
 
 
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 3b026c5..c1af869 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -422,6 +422,10 @@ void OSVideoSurface::proc38(int v1, int v2) {
 	warning("OSVideoSurface::proc38");
 }
 
+void OSVideoSurface::proc39(int v1, int v2) {
+	warning("OSVideoSurface::proc39");
+}
+
 bool OSVideoSurface::loadIfReady() {
 	_videoSurfaceNum = _videoSurfaceCounter;
 
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 6f707a3..2b66b26 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -180,6 +180,8 @@ public:
 
 	virtual void proc38(int v1, int v2) = 0;
 
+	virtual void proc39(int v1, int v2) = 0;
+
 	/**
 	 * Loads the surface's resource if there's one pending
 	 */
@@ -347,6 +349,8 @@ public:
 
 	virtual void proc38(int v1, int v2);
 
+	virtual void proc39(int v1, int v2);
+
 	/**
 	 * Loads the surface's resource if there's one pending
 	 */


Commit: 4db07ba145f75cdcf65a88b136790abc891b2745
    https://github.com/scummvm/scummvm/commit/4db07ba145f75cdcf65a88b136790abc891b2745
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:38-04:00

Commit Message:
TITANIC: Add mouse down/up generation methods

Changed paths:
  A engines/titanic/messages/mouse_messages.cpp
    engines/titanic/messages/mouse_messages.h
    engines/titanic/module.mk



diff --git a/engines/titanic/messages/mouse_messages.cpp b/engines/titanic/messages/mouse_messages.cpp
new file mode 100644
index 0000000..8ef7f38
--- /dev/null
+++ b/engines/titanic/messages/mouse_messages.cpp
@@ -0,0 +1,48 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/messages/mouse_messages.h"
+#include "titanic/support/mouse_cursor.h"
+#include "titanic/support/screen_manager.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+void CMouseButtonDownMsg::generate() {
+	CInputHandler &inputHandler = *CScreenManager::_screenManagerPtr->_inputHandler;
+	const Point &mousePos = inputHandler._mousePos;
+	
+	CMouseButtonDownMsg msg(mousePos, MB_LEFT);
+	inputHandler.handleMessage(msg, false);
+}
+
+/*------------------------------------------------------------------------*/
+
+void CMouseButtonUpMsg::generate() {
+	CInputHandler &inputHandler = *CScreenManager::_screenManagerPtr->_inputHandler;
+	const Point &mousePos = inputHandler._mousePos;
+
+	CMouseButtonUpMsg msg(mousePos, MB_LEFT);
+	inputHandler.handleMessage(msg, false);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 4f568cd..8d5aa8b 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -78,6 +78,11 @@ public:
 	static bool isSupportedBy(const CTreeItem *item) {
 		return supports(item, _type);
 	}
+
+	/**
+	 * Generate a dummy mouse down message at the current mouse position
+	 */
+	static void generate();
 };
 
 class CMouseButtonUpMsg : public CMouseButtonMsg {
@@ -89,6 +94,11 @@ public:
 	static bool isSupportedBy(const CTreeItem *item) {
 		return supports(item, _type);
 	}
+
+	/**
+	 * Generate a dummy mouse up message at the current mouse position
+	 */
+	static void generate();
 };
 
 class CMouseDoubleClickMsg : public CMouseButtonMsg {
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 881aa02..28be249 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -317,6 +317,7 @@ MODULE_OBJS := \
 	messages/bilge_dispensor_event.o \
 	messages/door_auto_sound_event.o \
 	messages/messages.o \
+	messages/mouse_messages.o \
 	messages/service_elevator_door.o \
 	moves/enter_bomb_room.o \
 	moves/enter_bridge.o \


Commit: 0715be79269a0830136f76e78da2e893ce2e2ed4
    https://github.com/scummvm/scummvm/commit/0715be79269a0830136f76e78da2e893ce2e2ed4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:41-04:00

Commit Message:
TITANIC: Added CGameObject text methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 9c5f9db..66417ac 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -69,14 +69,18 @@ CGameObject::CGameObject(): CNamedItem() {
 	_cursorId = CURSOR_ARROW;
 	_initialFrame = 0;
 	_frameNumber = -1;
-	_field90 = 0;
-	_field94 = 0;
-	_field98 = 0;
+	_text = nullptr;
+	_textBorder = _textBorderRight = 0;
 	_field9C = 0;
 	_surface = nullptr;
 	_fieldB8 = 0;
 }
 
+CGameObject::~CGameObject() {
+	delete _surface;
+	delete _text;
+}
+
 void CGameObject::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(7, indent);
 	error("TODO: CGameObject::save");
@@ -151,12 +155,12 @@ void CGameObject::draw(CScreenManager *screenManager) {
 	}
 
 	if (_field40) {
-		if (_field90) {
-			if (_bounds.intersects(getGameManager()->_bounds))
-				warning("TODO: _field90(screenManager);");
-		}
-	}
-	else {
+		// If a text object is defined, handle drawing it
+		if (_text && _bounds.intersects(getGameManager()->_bounds))
+			_text->draw(screenManager);
+
+		return;
+	} else {
 		if (!_surface) {
 			if (!_resource.empty()) {
 				loadResource(_resource);
@@ -185,8 +189,8 @@ void CGameObject::draw(CScreenManager *screenManager) {
 					screenManager->blitFrom(SURFACE_BACKBUFFER, _surface, &destPos);
 				}
 
-				if (_field90)
-					warning("TODO: sub_415f80(screenManager);");
+				if (_text)
+					_text->draw(screenManager);
 			}
 		}
 	}
@@ -358,6 +362,21 @@ void CGameObject::loadFrame(int frameNumber) {
 	makeDirty();
 }
 
+void CGameObject::playMovie(int v1, int v2) {
+	if (_surface && !_resource.empty()) {
+		loadResource(_resource);
+		_resource.clear();
+	}
+
+	if (_surface && _surface->loadIfReady()) {
+		if (_surface->_movie) {
+			disableMouse();
+			_surface->_movie->play(_bounds, v1, v2);
+			enableMouse();
+		}
+	}
+}
+
 void CGameObject::processClipList2() {
 	for (CMovieClipList::iterator i = _clipList2.begin(); i != _clipList2.end(); ++i)
 		(*i)->process(this);
@@ -869,6 +888,66 @@ void CGameObject::surface39(int v1, int v2) {
 		_surface->proc39(v1, v2);
 }
 
+void CGameObject::setTextBorder(const CString &str, int border, int borderRight) {
+	if (!_text)
+		_text = new CPetText();
+	_textBorder = border;
+	_textBorderRight = borderRight;
+	
+	_text->setText(str);
+	CScreenManager *screenManager = getGameManager()->setScreenManager();
+	_text->scrollToTop(screenManager);
+}
+
+void CGameObject::setTextHasBorders(bool hasBorders) {
+	if (!_text)
+		_text = new CPetText();
+
+	_text->setHasBorder(hasBorders);
+}
+
+void CGameObject::setTextBounds() {
+	Rect rect = _bounds;
+	rect.grow(_textBorder);
+	rect.right -= _textBorderRight;
+
+	_text->setBounds(rect);
+	makeDirty();
+}
+
+void CGameObject::setTextColor(byte r, byte g, byte b) {
+	if (!_text)
+		_text = new CPetText();
+
+	_text->setColor(r, g, b);
+}
+
+void CGameObject::setTextFontNumber(int fontNumber) {
+	if (!_text)
+		_text = new CPetText();
+
+	_text->setFontNumber(fontNumber);
+}
+
+int CGameObject::getTextWidth() const {
+	assert(_text);
+	return _text->getTextWidth(CScreenManager::_screenManagerPtr);
+}
+
+CTextCursor *CGameObject::getTextCursor() const {
+	return CScreenManager::_screenManagerPtr->_textCursor;
+}
+
+void CGameObject::scrollTextUp() {
+	if (_text)
+		_text->scrollUp(CScreenManager::_screenManagerPtr);
+}
+
+void CGameObject::scrollTextDown() {
+	if (_text)
+		_text->scrollDown(CScreenManager::_screenManagerPtr);
+}
+
 void CGameObject::lockMouse() {
 	CGameManager *gameMan = getGameManager();
 	gameMan->lockInputHandler();
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 02168c9..145b81e 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -30,6 +30,7 @@
 #include "titanic/core/movie_clip.h"
 #include "titanic/core/named_item.h"
 #include "titanic/pet_control/pet_section.h"
+#include "titanic/pet_control/pet_text.h"
 
 namespace Titanic {
 
@@ -87,9 +88,9 @@ protected:
 	int _initialFrame;
 	CMovieClipList _clipList2;
 	int _frameNumber;
-	int _field90;
-	int _field94;
-	int _field98;
+	CPetText *_text;
+	uint _textBorder;
+	uint _textBorderRight;
 	int _field9C;
 	Common::Point _savedPos;
 	CVideoSurface *_surface;
@@ -289,6 +290,11 @@ protected:
 	void sound8(bool flag) const;
 
 	/**
+	 * Plays a movie
+	 */
+	void playMovie(int v1, int v2);
+
+	/**
 	 * Play an arbitrary clip
 	 */
 	void playClip(const CString &name, uint flags);
@@ -441,6 +447,51 @@ protected:
 	int stateGet24();
 
 	void surface39(int v1, int v2);
+
+	/**
+	 * Set up the text borders for the object
+	 */
+	void setTextBorder(const CString &str, int border = 0, int borderRight = 0);
+
+	/**
+	 * Sets whether the text will use borders
+	 */
+	void setTextHasBorders(bool hasBorders);
+
+	/**
+	 * Sets the bounds for a previously defined text area
+	 */
+	void setTextBounds();
+
+	/**
+	 * Sets the color for the object's text
+	 */
+	void setTextColor(byte r, byte g, byte b);
+
+	/**
+	 * Sets the font number to use for text
+	 */
+	void setTextFontNumber(int fontNumber);
+
+	/**
+	 * Gets the width of the text contents
+	 */
+	int getTextWidth() const;
+
+	/**
+	 * Returns the text cursor
+	 */
+	CTextCursor *getTextCursor() const;
+
+	/**
+	 * Scroll text up
+	 */
+	void scrollTextUp();
+
+	/**
+	 * Scroll text down
+	 */
+	void scrollTextDown();
 public:
 	bool _isMail;
 	int _id;
@@ -461,6 +512,7 @@ public:
 public:
 	CLASSDEF
 	CGameObject();
+	~CGameObject();
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index f87b037..fa7441c 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -277,6 +277,15 @@ void CPetText::updateStr3(int lineNum) {
 	}
 }
 
+int CPetText::getTextWidth(CScreenManager *screenManager) {
+	mergeStrings();
+	int oldFontNumber = screenManager->setFontNumber(_fontNumber);
+	int textWidth = screenManager->stringWidth(_lines);
+	screenManager->setFontNumber(oldFontNumber);
+
+	return textWidth;
+}
+
 int CPetText::getTextHeight(CScreenManager *screenManager) {
 	mergeStrings();
 	int oldFontNumber = screenManager->setFontNumber(_fontNumber);
@@ -459,4 +468,9 @@ int CPetText::getNPCNum(uint npcId, uint startIndex) {
 	return - 1;
 }
 
+void CPetText::setFontNumber(int fontNumber) {
+	if (fontNumber >= 0 && fontNumber <= 2)
+		_fontNumber = fontNumber;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 930bf3d..2a6e24d 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -79,11 +79,6 @@ private:
 	void updateStr3(int lineNum);
 
 	/**
-	 * Get the required height to draw the text
-	 */
-	int getTextHeight(CScreenManager *screenManager);
-
-	/**
 	 * Ensures the Y scrolling for the text is in the valid range
 	 */
 	void constrainScrollUp(CScreenManager *screenManager);
@@ -253,6 +248,21 @@ public:
 	 * first list with the entry at the same index in the dest list
 	 */
 	void remapColors(uint count, uint *srcColors, uint *destColors);
+
+	/**
+	 * Set the font number to use
+	 */
+	void setFontNumber(int fontNumber);
+
+	/**
+	 * Get the width of the text
+	 */
+	int getTextWidth(CScreenManager *screenManager);
+
+	/**
+	 * Get the required height to draw the text
+	 */
+	int getTextHeight(CScreenManager *screenManager);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index cde3b22..27bcb97 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -87,6 +87,10 @@ void OSMovie::play(uint startFrame, uint endFrame, int v3, bool v4) {
 	_state = MOVIE_NONE;
 }
 
+void OSMovie::play(const Rect &rect, int v1, int v2) {
+	warning("TODO: OSMovie::play 3");
+}
+
 void OSMovie::playClip(const Rect &rect, uint startFrame, uint endFrame) {
 	warning("TODO: OSMovie::playClip");
 }
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index 61dd4cf..da32855 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -60,6 +60,11 @@ public:
 	 * Plays the movie
 	 */
 	virtual void play(uint startFrame, uint endFrame, int v3, bool v4) = 0;
+
+	/**
+	 * Plays the movie
+	 */
+	virtual void play(const Rect &rect, int v1, int v2) = 0;
 	
 	/**
 	 * Plays a sub-section of a movie
@@ -124,6 +129,11 @@ public:
 	virtual void play(uint startFrame, uint endFrame, int v3, bool v4);
 	
 	/**
+	 * Plays the movie
+	 */
+	virtual void play(const Rect &rect, int v1, int v2);
+	
+	/**
 	 * Plays a sub-section of a movie
 	 */
 	virtual void playClip(const Rect &rect, uint startFrame, uint endFrame);


Commit: 5c2a39e74ac1cf8b67e17fe25e00bcca487c9f99
    https://github.com/scummvm/scummvm/commit/5c2a39e74ac1cf8b67e17fe25e00bcca487c9f99
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:44-04:00

Commit Message:
TITANIC: Set up empty message targets for classes without messages

Changed paths:
  A engines/titanic/gfx/music_slider.cpp
  A engines/titanic/gfx/music_switch.cpp
    engines/titanic/carry/brain.cpp
    engines/titanic/carry/feathers.cpp
    engines/titanic/carry/hose_end.cpp
    engines/titanic/carry/hose_end.h
    engines/titanic/carry/parcel.cpp
    engines/titanic/core/dont_save_file_item.cpp
    engines/titanic/core/dont_save_file_item.h
    engines/titanic/core/file_item.cpp
    engines/titanic/core/file_item.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/link_item.cpp
    engines/titanic/core/link_item.h
    engines/titanic/core/message_target.h
    engines/titanic/core/named_item.cpp
    engines/titanic/core/node_item.cpp
    engines/titanic/core/node_item.h
    engines/titanic/core/project_item.cpp
    engines/titanic/core/project_item.h
    engines/titanic/core/room_item.cpp
    engines/titanic/core/room_item.h
    engines/titanic/core/static_image.cpp
    engines/titanic/core/static_image.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/game/arb_background.cpp
    engines/titanic/game/arb_background.h
    engines/titanic/game/broken_pell_base.cpp
    engines/titanic/game/broken_pell_base.h
    engines/titanic/game/leave_sec_class_state.cpp
    engines/titanic/game/leave_sec_class_state.h
    engines/titanic/game/music_room_phonograph.cpp
    engines/titanic/game/music_room_phonograph.h
    engines/titanic/game/musical_instrument.cpp
    engines/titanic/game/musical_instrument.h
    engines/titanic/game/navigation_computer.cpp
    engines/titanic/game/navigation_computer.h
    engines/titanic/game/null_port_hole.cpp
    engines/titanic/game/null_port_hole.h
    engines/titanic/game/parrot/parrot_lobby_object.cpp
    engines/titanic/game/parrot/parrot_lobby_object.h
    engines/titanic/game/pet/pet_class1.cpp
    engines/titanic/game/pet/pet_class1.h
    engines/titanic/game/pet/pet_class2.cpp
    engines/titanic/game/pet/pet_class2.h
    engines/titanic/game/pet/pet_class3.cpp
    engines/titanic/game/pet/pet_class3.h
    engines/titanic/game/splash_animation.cpp
    engines/titanic/game/splash_animation.h
    engines/titanic/game/transport/transport.cpp
    engines/titanic/game/transport/transport.h
    engines/titanic/gfx/chev_left_off.cpp
    engines/titanic/gfx/chev_left_off.h
    engines/titanic/gfx/chev_left_on.cpp
    engines/titanic/gfx/chev_left_on.h
    engines/titanic/gfx/chev_right_off.cpp
    engines/titanic/gfx/chev_right_off.h
    engines/titanic/gfx/chev_right_on.cpp
    engines/titanic/gfx/chev_right_on.h
    engines/titanic/gfx/chev_send_rec_switch.cpp
    engines/titanic/gfx/chev_send_rec_switch.h
    engines/titanic/gfx/elevator_button.cpp
    engines/titanic/gfx/elevator_button.h
    engines/titanic/gfx/get_from_succ.cpp
    engines/titanic/gfx/get_from_succ.h
    engines/titanic/gfx/helmet_on_off.cpp
    engines/titanic/gfx/helmet_on_off.h
    engines/titanic/gfx/home_photo.cpp
    engines/titanic/gfx/home_photo.h
    engines/titanic/gfx/icon_nav_action.cpp
    engines/titanic/gfx/icon_nav_action.h
    engines/titanic/gfx/icon_nav_butt.cpp
    engines/titanic/gfx/icon_nav_butt.h
    engines/titanic/gfx/icon_nav_down.cpp
    engines/titanic/gfx/icon_nav_down.h
    engines/titanic/gfx/icon_nav_image.cpp
    engines/titanic/gfx/icon_nav_image.h
    engines/titanic/gfx/icon_nav_left.cpp
    engines/titanic/gfx/icon_nav_left.h
    engines/titanic/gfx/icon_nav_receive.cpp
    engines/titanic/gfx/icon_nav_receive.h
    engines/titanic/gfx/icon_nav_right.cpp
    engines/titanic/gfx/icon_nav_right.h
    engines/titanic/gfx/icon_nav_send.cpp
    engines/titanic/gfx/icon_nav_send.h
    engines/titanic/gfx/icon_nav_up.cpp
    engines/titanic/gfx/icon_nav_up.h
    engines/titanic/gfx/keybrd_butt.cpp
    engines/titanic/gfx/keybrd_butt.h
    engines/titanic/gfx/music_slider.h
    engines/titanic/gfx/music_switch.h
    engines/titanic/gfx/send_to_succ.cpp
    engines/titanic/gfx/send_to_succ.h
    engines/titanic/gfx/sgt_selector.cpp
    engines/titanic/gfx/sgt_selector.h
    engines/titanic/gfx/small_chev_left_off.cpp
    engines/titanic/gfx/small_chev_left_off.h
    engines/titanic/gfx/small_chev_left_on.cpp
    engines/titanic/gfx/small_chev_left_on.h
    engines/titanic/gfx/small_chev_right_off.cpp
    engines/titanic/gfx/small_chev_right_off.h
    engines/titanic/gfx/small_chev_right_on.cpp
    engines/titanic/gfx/small_chev_right_on.h
    engines/titanic/gfx/text_down.cpp
    engines/titanic/gfx/text_down.h
    engines/titanic/gfx/text_skrew.cpp
    engines/titanic/gfx/text_skrew.h
    engines/titanic/gfx/text_up.cpp
    engines/titanic/gfx/text_up.h
    engines/titanic/gfx/toggle_button.cpp
    engines/titanic/gfx/toggle_button.h
    engines/titanic/module.mk
    engines/titanic/npcs/mobile.cpp
    engines/titanic/npcs/mobile.h
    engines/titanic/npcs/true_talk_npc.cpp
    engines/titanic/npcs/true_talk_npc.h
    engines/titanic/pet_control/pet_graphic.cpp
    engines/titanic/pet_control/pet_graphic2.cpp
    engines/titanic/pet_control/pet_leaf.cpp
    engines/titanic/pet_control/pet_leaf.h
    engines/titanic/pet_control/pet_mode_off.cpp
    engines/titanic/pet_control/pet_mode_on.cpp
    engines/titanic/pet_control/pet_mode_panel.cpp
    engines/titanic/pet_control/pet_pannel1.cpp
    engines/titanic/pet_control/pet_pannel2.cpp
    engines/titanic/pet_control/pet_pannel3.cpp
    engines/titanic/sound/dome_from_top_of_well.cpp
    engines/titanic/sound/dome_from_top_of_well.h
    engines/titanic/sound/water_lapping_sounds.cpp
    engines/titanic/sound/water_lapping_sounds.h



diff --git a/engines/titanic/carry/brain.cpp b/engines/titanic/carry/brain.cpp
index a60e652..1fe0c1b 100644
--- a/engines/titanic/carry/brain.cpp
+++ b/engines/titanic/carry/brain.cpp
@@ -123,7 +123,7 @@ bool CBrain::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
 bool CBrain::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
 	if (!_field138) {
 		if (getName() == "Perch") {
-			incState38();
+			stateInc38();
 			_field138 = 1;
 		}
 	}
diff --git a/engines/titanic/carry/feathers.cpp b/engines/titanic/carry/feathers.cpp
index a738d74..e89f335 100644
--- a/engines/titanic/carry/feathers.cpp
+++ b/engines/titanic/carry/feathers.cpp
@@ -24,8 +24,7 @@
 
 namespace Titanic {
 
-BEGIN_MESSAGE_MAP(CFeathers, CCarry)
-END_MESSAGE_MAP()
+EMPTY_MESSAGE_MAP(CFeathers, CCarry)
 
 CFeathers::CFeathers() : CCarry() {
 }
diff --git a/engines/titanic/carry/hose_end.cpp b/engines/titanic/carry/hose_end.cpp
index 97d75b0..6f15d5b 100644
--- a/engines/titanic/carry/hose_end.cpp
+++ b/engines/titanic/carry/hose_end.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CHoseEnd, CHose)
+
 CHoseEnd::CHoseEnd() : CHose() {
 	_string6 = "Connection refused by remote hose.";
 }
diff --git a/engines/titanic/carry/hose_end.h b/engines/titanic/carry/hose_end.h
index d9efb59..796191e 100644
--- a/engines/titanic/carry/hose_end.h
+++ b/engines/titanic/carry/hose_end.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CHoseEnd : public CHose {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CHoseEnd();
diff --git a/engines/titanic/carry/parcel.cpp b/engines/titanic/carry/parcel.cpp
index 275c982..d532bac 100644
--- a/engines/titanic/carry/parcel.cpp
+++ b/engines/titanic/carry/parcel.cpp
@@ -24,8 +24,7 @@
 
 namespace Titanic {
 
-BEGIN_MESSAGE_MAP(CParcel, CCarry)
-END_MESSAGE_MAP()
+EMPTY_MESSAGE_MAP(CParcel, CCarry)
 
 CParcel::CParcel() : CCarry() {
 }
diff --git a/engines/titanic/core/dont_save_file_item.cpp b/engines/titanic/core/dont_save_file_item.cpp
index 389cef5..00b7dd2 100644
--- a/engines/titanic/core/dont_save_file_item.cpp
+++ b/engines/titanic/core/dont_save_file_item.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CDontSaveFileItem, CFileItem)
+
 void CDontSaveFileItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(0, indent);
 }
diff --git a/engines/titanic/core/dont_save_file_item.h b/engines/titanic/core/dont_save_file_item.h
index d4d5da2..7517976 100644
--- a/engines/titanic/core/dont_save_file_item.h
+++ b/engines/titanic/core/dont_save_file_item.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CDontSaveFileItem : public CFileItem {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/core/file_item.cpp b/engines/titanic/core/file_item.cpp
index 0d3316d..566f910 100644
--- a/engines/titanic/core/file_item.cpp
+++ b/engines/titanic/core/file_item.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CFileItem, CTreeItem)
+
 void CFileItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(0, indent);
 	CTreeItem::save(file, indent);
diff --git a/engines/titanic/core/file_item.h b/engines/titanic/core/file_item.h
index 34ba0ae..e8e4935 100644
--- a/engines/titanic/core/file_item.h
+++ b/engines/titanic/core/file_item.h
@@ -30,6 +30,7 @@
 namespace Titanic {
 
 class CFileItem: public CTreeItem {
+	DECLARE_MESSAGE_MAP
 private:
 	CString _filename;
 public:
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 66417ac..d1f3a32 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -35,8 +35,7 @@
 
 namespace Titanic {
 
-BEGIN_MESSAGE_MAP(CGameObject, CNamedItem)
-END_MESSAGE_MAP()
+EMPTY_MESSAGE_MAP(CGameObject, CNamedItem)
 
 CCreditText *CGameObject::_credits;
 
@@ -424,6 +423,10 @@ void CGameObject::soundFn5(int v1, int v2, int v3) {
 	warning("CGameObject::soundFn5");
 }
 
+void CGameObject::sound8(bool flag) const {
+	getGameManager()->_sound.managerProc8(flag ? 3 : 0);
+}
+
 void CGameObject::setVisible(bool val) {
 	if (val != _visible) {
 		_visible = val;
@@ -582,10 +585,6 @@ int CGameObject::getSurface45() const {
 	return _surface ? _surface->proc45() : 0;
 }
 
-void CGameObject::sound8(bool flag) const {
-	getGameManager()->_sound.managerProc8(flag ? 3 : 0);
-}
-
 void CGameObject::loadSound(const CString &name) {
 	CGameManager *gameManager = getGameManager();
 	if (gameManager) {
@@ -855,15 +854,11 @@ void CGameObject::moveToView(const CString &name) {
 	view->addUnder(this);
 }
 
-void CGameObject::incState38() {
-	getGameManager()->_gameState.inc38();
-}
-
 void CGameObject::stateInc14() {
 	getGameManager()->_gameState.inc14();
 }
 
-int CGameObject::stateGet14() {
+int CGameObject::stateGet14() const {
 	return getGameManager()->_gameState._field14;
 }
 
@@ -871,10 +866,22 @@ void CGameObject::stateSet24() {
 	getGameManager()->_gameState.set24(1);
 }
 
-int CGameObject::stateGet24() {
+int CGameObject::stateGet24() const {
 	return getGameManager()->_gameState.get24();
 }
 
+void CGameObject::stateInc38() {
+	getGameManager()->_gameState.inc38();
+}
+
+int CGameObject::stateGet38() const {
+	return getGameManager()->_gameState._field38;
+}
+
+void CGameObject::quitGame() {
+	getGameManager()->_gameState._quitGame = true;
+}
+
 void CGameObject::inc54() {
 	getGameManager()->inc54();
 }
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 145b81e..ade8800 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -201,6 +201,8 @@ protected:
 
 	void soundFn5(int v1, int v2, int v3);
 
+	void sound8(bool flag) const;
+
 	/**
 	 * Adds a timer
 	 */
@@ -287,8 +289,6 @@ protected:
 	 */
 	Point getControid() const;
 
-	void sound8(bool flag) const;
-
 	/**
 	 * Plays a movie
 	 */
@@ -440,11 +440,17 @@ protected:
 	void petUnlockInput();
 
 	void setState1C(bool flag);
-	void incState38();
 	void stateInc14();
-	int stateGet14();
+	int stateGet14() const;
 	void stateSet24();
-	int stateGet24();
+	int stateGet24() const;
+	void stateInc38();
+	int stateGet38() const;
+
+	/**
+	 * Flag to quit the game
+	 */
+	void quitGame();
 
 	void surface39(int v1, int v2);
 
diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp
index b172b9b..a0460bd 100644
--- a/engines/titanic/core/link_item.cpp
+++ b/engines/titanic/core/link_item.cpp
@@ -27,6 +27,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CLinkItem, CNamedItem)
+
 CLinkItem::CLinkItem() : CNamedItem() {
 	_roomNumber = -1;
 	_nodeNumber = -1;
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index 25de741..9c37639 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -34,6 +34,7 @@ class CNodeItem;
 class CRoomItem;
 
 class CLinkItem : public CNamedItem {
+	DECLARE_MESSAGE_MAP
 private:
 	/**
 	 * Returns a new name for the link item, based on the
diff --git a/engines/titanic/core/message_target.h b/engines/titanic/core/message_target.h
index 0f43bcd..e5bdf3e 100644
--- a/engines/titanic/core/message_target.h
+++ b/engines/titanic/core/message_target.h
@@ -68,6 +68,21 @@ protected: \
 		return &messageMap; \
 	}
 
+#define EMPTY_MESSAGE_MAP(theClass, baseClass) \
+	const MSGMAP *theClass::getMessageMap() const \
+		{ return getThisMessageMap(); } \
+	const MSGMAP *theClass::getThisMessageMap() \
+	{ \
+		typedef theClass ThisClass;						   \
+		typedef baseClass TheBaseClass;					   \
+		static const MSGMAP_ENTRY _messageEntries[] = { \
+		{ (PMSG)nullptr, nullptr } \
+	}; \
+		static const MSGMAP messageMap = \
+		{ &TheBaseClass::getThisMessageMap, &_messageEntries[0] }; \
+		return &messageMap; \
+	}
+
 class CMessageTarget: public CSaveableObject {
 	DECLARE_MESSAGE_MAP
 public:
diff --git a/engines/titanic/core/named_item.cpp b/engines/titanic/core/named_item.cpp
index 72d3fd9..981627a 100644
--- a/engines/titanic/core/named_item.cpp
+++ b/engines/titanic/core/named_item.cpp
@@ -27,8 +27,7 @@
 
 namespace Titanic {
 
-BEGIN_MESSAGE_MAP(CNamedItem, CTreeItem)
-END_MESSAGE_MAP()
+EMPTY_MESSAGE_MAP(CNamedItem, CTreeItem)
 
 CString CNamedItem::dumpItem(int indent) const {
 	CString result = CTreeItem::dumpItem(indent);
diff --git a/engines/titanic/core/node_item.cpp b/engines/titanic/core/node_item.cpp
index 6b7d645..57acbdb 100644
--- a/engines/titanic/core/node_item.cpp
+++ b/engines/titanic/core/node_item.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CNodeItem, CNamedItem)
+
 CNodeItem::CNodeItem() : CNamedItem(), _nodeNumber(0) {
 }
 
diff --git a/engines/titanic/core/node_item.h b/engines/titanic/core/node_item.h
index 32db1c1..85003bf 100644
--- a/engines/titanic/core/node_item.h
+++ b/engines/titanic/core/node_item.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CNodeItem : public CNamedItem {
+	DECLARE_MESSAGE_MAP
 public:
 	int _nodeNumber;
 	Point _nodePos;
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index c6a5c2e..586301b 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -41,6 +41,8 @@ namespace Titanic {
 static const char *const SAVEGAME_STR = "TNIC";
 #define SAVEGAME_STR_SIZE 4
 
+EMPTY_MESSAGE_MAP(CProjectItem, CFileItem)
+
 void CFileListItem::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(0, indent);
 	file->writeQuotedLine(_name, indent);
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index 213fa9d..d0b8d77 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -73,11 +73,10 @@ public:
  * Filename list
  */
 class CFileList: public List<CFileListItem> {
-public:
 };
 
-
 class CProjectItem : public CFileItem {
+	DECLARE_MESSAGE_MAP
 private:
 	CString _filename;
 	CFileList _files;
diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp
index e33d0c4..b3a3fe4 100644
--- a/engines/titanic/core/room_item.cpp
+++ b/engines/titanic/core/room_item.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CRoomItem, CNamedItem)
+
 CRoomItem::CRoomItem() : CNamedItem(), _roomNumber(0),
 		_roomDimensionX(0.0), _roomDimensionY(0.0) {
 }
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index 4692318..f44a525 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -32,6 +32,7 @@
 namespace Titanic {
 
 class CRoomItem : public CNamedItem {
+	DECLARE_MESSAGE_MAP
 private:
 	/**
 	 * Handles post-load processing
diff --git a/engines/titanic/core/static_image.cpp b/engines/titanic/core/static_image.cpp
index 54a041f..cc8e1dd 100644
--- a/engines/titanic/core/static_image.cpp
+++ b/engines/titanic/core/static_image.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CStaticImage, CGameObject)
+
 void CStaticImage::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/core/static_image.h b/engines/titanic/core/static_image.h
index 2b0a3ad..953cf4d 100644
--- a/engines/titanic/core/static_image.h
+++ b/engines/titanic/core/static_image.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CStaticImage : public CGameObject {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 190dc99..21496ee 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -38,8 +38,7 @@
 
 namespace Titanic {
 
-BEGIN_MESSAGE_MAP(CTreeItem, CMessageTarget)
-END_MESSAGE_MAP()
+EMPTY_MESSAGE_MAP(CTreeItem, CMessageTarget)
 
 CTreeItem::CTreeItem() : _parent(nullptr), _firstChild(nullptr),
 	_nextSibling(nullptr), _priorSibling(nullptr), _field14(0) {
diff --git a/engines/titanic/game/arb_background.cpp b/engines/titanic/game/arb_background.cpp
index 54e9c17..0755815 100644
--- a/engines/titanic/game/arb_background.cpp
+++ b/engines/titanic/game/arb_background.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CArbBackground, CBackground)
+
 CArbBackground::CArbBackground() : CBackground(),
 	_fieldE0(0), _fieldE4(61), _fieldE8(62), _fieldEC(118) {
 }
diff --git a/engines/titanic/game/arb_background.h b/engines/titanic/game/arb_background.h
index 50a9075..a5850af 100644
--- a/engines/titanic/game/arb_background.h
+++ b/engines/titanic/game/arb_background.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CArbBackground : public CBackground {
+	DECLARE_MESSAGE_MAP
 public:
 	int _fieldE0;
 	int _fieldE4;
diff --git a/engines/titanic/game/broken_pell_base.cpp b/engines/titanic/game/broken_pell_base.cpp
index 2d11e54..8b8e0b9 100644
--- a/engines/titanic/game/broken_pell_base.cpp
+++ b/engines/titanic/game/broken_pell_base.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CBrokenPellBase, CBackground)
+
 int CBrokenPellBase::_v1;
 int CBrokenPellBase::_v2;
 
diff --git a/engines/titanic/game/broken_pell_base.h b/engines/titanic/game/broken_pell_base.h
index 46e7a70..45b6594 100644
--- a/engines/titanic/game/broken_pell_base.h
+++ b/engines/titanic/game/broken_pell_base.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CBrokenPellBase : public CBackground {
+	DECLARE_MESSAGE_MAP
 private:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/game/leave_sec_class_state.cpp b/engines/titanic/game/leave_sec_class_state.cpp
index cbeb872..922bd98 100644
--- a/engines/titanic/game/leave_sec_class_state.cpp
+++ b/engines/titanic/game/leave_sec_class_state.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CLeaveSecClassState, CGameObject)
+
 void CLeaveSecClassState::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/leave_sec_class_state.h b/engines/titanic/game/leave_sec_class_state.h
index 34ba31b..5f77436 100644
--- a/engines/titanic/game/leave_sec_class_state.h
+++ b/engines/titanic/game/leave_sec_class_state.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CLeaveSecClassState : public CGameObject {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/music_room_phonograph.cpp b/engines/titanic/game/music_room_phonograph.cpp
index 7fa30f5..c08b230 100644
--- a/engines/titanic/game/music_room_phonograph.cpp
+++ b/engines/titanic/game/music_room_phonograph.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CMusicRoomPhonograph, CRestaurantPhonograph)
+
 void CMusicRoomPhonograph::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field118, indent);
diff --git a/engines/titanic/game/music_room_phonograph.h b/engines/titanic/game/music_room_phonograph.h
index 6660503..cad59f3 100644
--- a/engines/titanic/game/music_room_phonograph.h
+++ b/engines/titanic/game/music_room_phonograph.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CMusicRoomPhonograph : public CRestaurantPhonograph {
+	DECLARE_MESSAGE_MAP
 private:
 	int _field118;
 public:
diff --git a/engines/titanic/game/musical_instrument.cpp b/engines/titanic/game/musical_instrument.cpp
index 6695104..6480f9f 100644
--- a/engines/titanic/game/musical_instrument.cpp
+++ b/engines/titanic/game/musical_instrument.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CMusicalInstrument, CBackground)
+
 void CMusicalInstrument::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CBackground::save(file, indent);
diff --git a/engines/titanic/game/musical_instrument.h b/engines/titanic/game/musical_instrument.h
index b4abe4f..5bc7446 100644
--- a/engines/titanic/game/musical_instrument.h
+++ b/engines/titanic/game/musical_instrument.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CMusicalInstrument : public CBackground {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/navigation_computer.cpp b/engines/titanic/game/navigation_computer.cpp
index be2f189..7e04f84 100644
--- a/engines/titanic/game/navigation_computer.cpp
+++ b/engines/titanic/game/navigation_computer.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CNavigationComputer, CGameObject)
+
 void CNavigationComputer::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/navigation_computer.h b/engines/titanic/game/navigation_computer.h
index a7077f7..5315c88 100644
--- a/engines/titanic/game/navigation_computer.h
+++ b/engines/titanic/game/navigation_computer.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CNavigationComputer : public CGameObject {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/null_port_hole.cpp b/engines/titanic/game/null_port_hole.cpp
index c437dfe..93dd7eb 100644
--- a/engines/titanic/game/null_port_hole.cpp
+++ b/engines/titanic/game/null_port_hole.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CNullPortHole, CClickResponder)
+
 CNullPortHole::CNullPortHole() : CClickResponder() {
 	_string1 = "For a better view, why not visit the Promenade Deck?";
 	_string2 = "b#48.wav";
diff --git a/engines/titanic/game/null_port_hole.h b/engines/titanic/game/null_port_hole.h
index fb07462..be335ef 100644
--- a/engines/titanic/game/null_port_hole.h
+++ b/engines/titanic/game/null_port_hole.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CNullPortHole : public CClickResponder {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CNullPortHole();
diff --git a/engines/titanic/game/parrot/parrot_lobby_object.cpp b/engines/titanic/game/parrot/parrot_lobby_object.cpp
index 137f3e2..8090a1d 100644
--- a/engines/titanic/game/parrot/parrot_lobby_object.cpp
+++ b/engines/titanic/game/parrot/parrot_lobby_object.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CParrotLobbyObject, CGameObject)
+
 int CParrotLobbyObject::_v1;
 int CParrotLobbyObject::_v2;
 int CParrotLobbyObject::_v3;
diff --git a/engines/titanic/game/parrot/parrot_lobby_object.h b/engines/titanic/game/parrot/parrot_lobby_object.h
index 9cc979c..5b53276 100644
--- a/engines/titanic/game/parrot/parrot_lobby_object.h
+++ b/engines/titanic/game/parrot/parrot_lobby_object.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CParrotLobbyObject : public CGameObject {
+	DECLARE_MESSAGE_MAP
 public:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/game/pet/pet_class1.cpp b/engines/titanic/game/pet/pet_class1.cpp
index 4bd2556..b0407ef 100644
--- a/engines/titanic/game/pet/pet_class1.cpp
+++ b/engines/titanic/game/pet/pet_class1.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CPETClass1, CGameObject)
+
 void CPETClass1::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/pet/pet_class1.h b/engines/titanic/game/pet/pet_class1.h
index 12dfb32..e22b214 100644
--- a/engines/titanic/game/pet/pet_class1.h
+++ b/engines/titanic/game/pet/pet_class1.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CPETClass1 : public CGameObject {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_class2.cpp b/engines/titanic/game/pet/pet_class2.cpp
index 8399468..8809f84 100644
--- a/engines/titanic/game/pet/pet_class2.cpp
+++ b/engines/titanic/game/pet/pet_class2.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CPETClass2, CGameObject)
+
 void CPETClass2::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/pet/pet_class2.h b/engines/titanic/game/pet/pet_class2.h
index 5b96118..529f953 100644
--- a/engines/titanic/game/pet/pet_class2.h
+++ b/engines/titanic/game/pet/pet_class2.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CPETClass2 : public CGameObject {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/pet/pet_class3.cpp b/engines/titanic/game/pet/pet_class3.cpp
index 96ce6646..81ddf8a 100644
--- a/engines/titanic/game/pet/pet_class3.cpp
+++ b/engines/titanic/game/pet/pet_class3.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CPETClass3, CGameObject)
+
 void CPETClass3::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/pet/pet_class3.h b/engines/titanic/game/pet/pet_class3.h
index d68cb09..d34c9d3 100644
--- a/engines/titanic/game/pet/pet_class3.h
+++ b/engines/titanic/game/pet/pet_class3.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CPETClass3 : public CGameObject {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/splash_animation.cpp b/engines/titanic/game/splash_animation.cpp
index 16cf067..3d35929 100644
--- a/engines/titanic/game/splash_animation.cpp
+++ b/engines/titanic/game/splash_animation.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CSplashAnimation, CGameObject)
+
 void CSplashAnimation::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/splash_animation.h b/engines/titanic/game/splash_animation.h
index 2f40562..9b6322e 100644
--- a/engines/titanic/game/splash_animation.h
+++ b/engines/titanic/game/splash_animation.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CSplashAnimation : public CGameObject {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/game/transport/transport.cpp b/engines/titanic/game/transport/transport.cpp
index ef31a07..e003759 100644
--- a/engines/titanic/game/transport/transport.cpp
+++ b/engines/titanic/game/transport/transport.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CTransport, CMobile)
+
 CTransport::CTransport() : CMobile(), _string1("*.*.*") {
 }
 
diff --git a/engines/titanic/game/transport/transport.h b/engines/titanic/game/transport/transport.h
index faa00b4..b7540ad 100644
--- a/engines/titanic/game/transport/transport.h
+++ b/engines/titanic/game/transport/transport.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CTransport : public CMobile {
+	DECLARE_MESSAGE_MAP
 public:
 	CString _string1;
 	CString _string2;
diff --git a/engines/titanic/gfx/chev_left_off.cpp b/engines/titanic/gfx/chev_left_off.cpp
index 736cc0d..0ce2d62 100644
--- a/engines/titanic/gfx/chev_left_off.cpp
+++ b/engines/titanic/gfx/chev_left_off.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CChevLeftOff, CToggleSwitch)
+
 CChevLeftOff::CChevLeftOff() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/chev_left_off.h b/engines/titanic/gfx/chev_left_off.h
index 753aba3..36a9d2c 100644
--- a/engines/titanic/gfx/chev_left_off.h
+++ b/engines/titanic/gfx/chev_left_off.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CChevLeftOff : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CChevLeftOff();
diff --git a/engines/titanic/gfx/chev_left_on.cpp b/engines/titanic/gfx/chev_left_on.cpp
index f233c53..c3264b7 100644
--- a/engines/titanic/gfx/chev_left_on.cpp
+++ b/engines/titanic/gfx/chev_left_on.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CChevLeftOn, CToggleSwitch)
+
 CChevLeftOn::CChevLeftOn() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/chev_left_on.h b/engines/titanic/gfx/chev_left_on.h
index 99126d7..0de814b 100644
--- a/engines/titanic/gfx/chev_left_on.h
+++ b/engines/titanic/gfx/chev_left_on.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CChevLeftOn : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CChevLeftOn();
diff --git a/engines/titanic/gfx/chev_right_off.cpp b/engines/titanic/gfx/chev_right_off.cpp
index 7cf3b11..60ed2de 100644
--- a/engines/titanic/gfx/chev_right_off.cpp
+++ b/engines/titanic/gfx/chev_right_off.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CChevRightOff, CToggleSwitch)
+
 CChevRightOff::CChevRightOff() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/chev_right_off.h b/engines/titanic/gfx/chev_right_off.h
index 1a31007..3714c2b 100644
--- a/engines/titanic/gfx/chev_right_off.h
+++ b/engines/titanic/gfx/chev_right_off.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CChevRightOff : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CChevRightOff();
diff --git a/engines/titanic/gfx/chev_right_on.cpp b/engines/titanic/gfx/chev_right_on.cpp
index 848abfc..ac55100 100644
--- a/engines/titanic/gfx/chev_right_on.cpp
+++ b/engines/titanic/gfx/chev_right_on.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CChevRightOn, CToggleSwitch)
+
 CChevRightOn::CChevRightOn() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/chev_right_on.h b/engines/titanic/gfx/chev_right_on.h
index 084b02e..d72c34a 100644
--- a/engines/titanic/gfx/chev_right_on.h
+++ b/engines/titanic/gfx/chev_right_on.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CChevRightOn : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CChevRightOn();
diff --git a/engines/titanic/gfx/chev_send_rec_switch.cpp b/engines/titanic/gfx/chev_send_rec_switch.cpp
index affe9bc..d0d4a81 100644
--- a/engines/titanic/gfx/chev_send_rec_switch.cpp
+++ b/engines/titanic/gfx/chev_send_rec_switch.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CChevSendRecSwitch, CToggleSwitch)
+
 CChevSendRecSwitch::CChevSendRecSwitch() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/chev_send_rec_switch.h b/engines/titanic/gfx/chev_send_rec_switch.h
index 29d6e7a..2f51bae 100644
--- a/engines/titanic/gfx/chev_send_rec_switch.h
+++ b/engines/titanic/gfx/chev_send_rec_switch.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CChevSendRecSwitch : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CChevSendRecSwitch();
diff --git a/engines/titanic/gfx/elevator_button.cpp b/engines/titanic/gfx/elevator_button.cpp
index 81c9598..2a599ca 100644
--- a/engines/titanic/gfx/elevator_button.cpp
+++ b/engines/titanic/gfx/elevator_button.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CElevatorButton, CSTButton)
+
 CElevatorButton::CElevatorButton() : CSTButton() {
 }
 
diff --git a/engines/titanic/gfx/elevator_button.h b/engines/titanic/gfx/elevator_button.h
index dddb707..d6bf5dc 100644
--- a/engines/titanic/gfx/elevator_button.h
+++ b/engines/titanic/gfx/elevator_button.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CElevatorButton : public CSTButton {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CElevatorButton();
diff --git a/engines/titanic/gfx/get_from_succ.cpp b/engines/titanic/gfx/get_from_succ.cpp
index ad7b5dc..c7a59fd 100644
--- a/engines/titanic/gfx/get_from_succ.cpp
+++ b/engines/titanic/gfx/get_from_succ.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CGetFromSucc, CToggleSwitch)
+
 CGetFromSucc::CGetFromSucc() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/get_from_succ.h b/engines/titanic/gfx/get_from_succ.h
index f0b028a..dc611f1 100644
--- a/engines/titanic/gfx/get_from_succ.h
+++ b/engines/titanic/gfx/get_from_succ.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CGetFromSucc : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CGetFromSucc();
diff --git a/engines/titanic/gfx/helmet_on_off.cpp b/engines/titanic/gfx/helmet_on_off.cpp
index e1c6989..2913177 100644
--- a/engines/titanic/gfx/helmet_on_off.cpp
+++ b/engines/titanic/gfx/helmet_on_off.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CHelmetOnOff, CToggleSwitch)
+
 CHelmetOnOff::CHelmetOnOff() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/helmet_on_off.h b/engines/titanic/gfx/helmet_on_off.h
index 41621f3..f607b47 100644
--- a/engines/titanic/gfx/helmet_on_off.h
+++ b/engines/titanic/gfx/helmet_on_off.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CHelmetOnOff : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CHelmetOnOff();
diff --git a/engines/titanic/gfx/home_photo.cpp b/engines/titanic/gfx/home_photo.cpp
index 48661fc..303e56d 100644
--- a/engines/titanic/gfx/home_photo.cpp
+++ b/engines/titanic/gfx/home_photo.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CHomePhoto, CToggleSwitch)
+
 CHomePhoto::CHomePhoto() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/home_photo.h b/engines/titanic/gfx/home_photo.h
index 6e6f497..db0be89 100644
--- a/engines/titanic/gfx/home_photo.h
+++ b/engines/titanic/gfx/home_photo.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CHomePhoto : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CHomePhoto();
diff --git a/engines/titanic/gfx/icon_nav_action.cpp b/engines/titanic/gfx/icon_nav_action.cpp
index f8aaa72..e66c345 100644
--- a/engines/titanic/gfx/icon_nav_action.cpp
+++ b/engines/titanic/gfx/icon_nav_action.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CIconNavAction, CToggleSwitch)
+
 CIconNavAction::CIconNavAction() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/icon_nav_action.h b/engines/titanic/gfx/icon_nav_action.h
index cb8fae9..189ea35 100644
--- a/engines/titanic/gfx/icon_nav_action.h
+++ b/engines/titanic/gfx/icon_nav_action.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CIconNavAction : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CIconNavAction();
diff --git a/engines/titanic/gfx/icon_nav_butt.cpp b/engines/titanic/gfx/icon_nav_butt.cpp
index 85eb130..820a427 100644
--- a/engines/titanic/gfx/icon_nav_butt.cpp
+++ b/engines/titanic/gfx/icon_nav_butt.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CIconNavButt, CPetGraphic)
+
 void CIconNavButt::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
diff --git a/engines/titanic/gfx/icon_nav_butt.h b/engines/titanic/gfx/icon_nav_butt.h
index b2db4c7..0cb2f1a 100644
--- a/engines/titanic/gfx/icon_nav_butt.h
+++ b/engines/titanic/gfx/icon_nav_butt.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CIconNavButt : public CPetGraphic {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/gfx/icon_nav_down.cpp b/engines/titanic/gfx/icon_nav_down.cpp
index 947aa4c..78727a3 100644
--- a/engines/titanic/gfx/icon_nav_down.cpp
+++ b/engines/titanic/gfx/icon_nav_down.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CIconNavDown, CToggleSwitch)
+
 CIconNavDown::CIconNavDown() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/icon_nav_down.h b/engines/titanic/gfx/icon_nav_down.h
index b7759e0..3eef9ef 100644
--- a/engines/titanic/gfx/icon_nav_down.h
+++ b/engines/titanic/gfx/icon_nav_down.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CIconNavDown : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CIconNavDown();
diff --git a/engines/titanic/gfx/icon_nav_image.cpp b/engines/titanic/gfx/icon_nav_image.cpp
index 1e8a1ca..d0c6239 100644
--- a/engines/titanic/gfx/icon_nav_image.cpp
+++ b/engines/titanic/gfx/icon_nav_image.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CIconNavImage, CPetGraphic)
+
 void CIconNavImage::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
diff --git a/engines/titanic/gfx/icon_nav_image.h b/engines/titanic/gfx/icon_nav_image.h
index 295ffe7..8460733 100644
--- a/engines/titanic/gfx/icon_nav_image.h
+++ b/engines/titanic/gfx/icon_nav_image.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CIconNavImage : public CPetGraphic {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/gfx/icon_nav_left.cpp b/engines/titanic/gfx/icon_nav_left.cpp
index 5ec5090..803818f 100644
--- a/engines/titanic/gfx/icon_nav_left.cpp
+++ b/engines/titanic/gfx/icon_nav_left.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CIconNavLeft, CToggleSwitch)
+
 CIconNavLeft::CIconNavLeft() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/icon_nav_left.h b/engines/titanic/gfx/icon_nav_left.h
index e507d2c..5fd7b65 100644
--- a/engines/titanic/gfx/icon_nav_left.h
+++ b/engines/titanic/gfx/icon_nav_left.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CIconNavLeft : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CIconNavLeft();
diff --git a/engines/titanic/gfx/icon_nav_receive.cpp b/engines/titanic/gfx/icon_nav_receive.cpp
index ad7e0e7..554656c 100644
--- a/engines/titanic/gfx/icon_nav_receive.cpp
+++ b/engines/titanic/gfx/icon_nav_receive.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CIconNavReceive, CPetGraphic)
+
 void CIconNavReceive::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
diff --git a/engines/titanic/gfx/icon_nav_receive.h b/engines/titanic/gfx/icon_nav_receive.h
index 36eed53..f181439 100644
--- a/engines/titanic/gfx/icon_nav_receive.h
+++ b/engines/titanic/gfx/icon_nav_receive.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CIconNavReceive : public CPetGraphic {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/gfx/icon_nav_right.cpp b/engines/titanic/gfx/icon_nav_right.cpp
index d133ed3..1553c91 100644
--- a/engines/titanic/gfx/icon_nav_right.cpp
+++ b/engines/titanic/gfx/icon_nav_right.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CIconNavRight, CToggleSwitch)
+
 CIconNavRight::CIconNavRight() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/icon_nav_right.h b/engines/titanic/gfx/icon_nav_right.h
index db3bab4..c088a23 100644
--- a/engines/titanic/gfx/icon_nav_right.h
+++ b/engines/titanic/gfx/icon_nav_right.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CIconNavRight : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CIconNavRight();
diff --git a/engines/titanic/gfx/icon_nav_send.cpp b/engines/titanic/gfx/icon_nav_send.cpp
index 856560c..64d2a86 100644
--- a/engines/titanic/gfx/icon_nav_send.cpp
+++ b/engines/titanic/gfx/icon_nav_send.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CIconNavSend, CPetGraphic)
+
 void CIconNavSend::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
diff --git a/engines/titanic/gfx/icon_nav_send.h b/engines/titanic/gfx/icon_nav_send.h
index d25d0b9..41c747e 100644
--- a/engines/titanic/gfx/icon_nav_send.h
+++ b/engines/titanic/gfx/icon_nav_send.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CIconNavSend : public CPetGraphic {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/gfx/icon_nav_up.cpp b/engines/titanic/gfx/icon_nav_up.cpp
index 5b5d5ec..a8f4f55 100644
--- a/engines/titanic/gfx/icon_nav_up.cpp
+++ b/engines/titanic/gfx/icon_nav_up.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CIconNavUp, CToggleSwitch)
+
 CIconNavUp::CIconNavUp() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/icon_nav_up.h b/engines/titanic/gfx/icon_nav_up.h
index 7eeeb77..691e665 100644
--- a/engines/titanic/gfx/icon_nav_up.h
+++ b/engines/titanic/gfx/icon_nav_up.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CIconNavUp : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CIconNavUp();
diff --git a/engines/titanic/gfx/keybrd_butt.cpp b/engines/titanic/gfx/keybrd_butt.cpp
index 3e7f5c1..4a18d99 100644
--- a/engines/titanic/gfx/keybrd_butt.cpp
+++ b/engines/titanic/gfx/keybrd_butt.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CKeybrdButt, CToggleSwitch)
+
 CKeybrdButt::CKeybrdButt() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/keybrd_butt.h b/engines/titanic/gfx/keybrd_butt.h
index a4f233b..33ff418 100644
--- a/engines/titanic/gfx/keybrd_butt.h
+++ b/engines/titanic/gfx/keybrd_butt.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CKeybrdButt : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CKeybrdButt();
diff --git a/engines/titanic/gfx/music_slider.cpp b/engines/titanic/gfx/music_slider.cpp
new file mode 100644
index 0000000..f065ae6
--- /dev/null
+++ b/engines/titanic/gfx/music_slider.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/music_slider.h"
+
+namespace Titanic {
+
+EMPTY_MESSAGE_MAP(CMusicSlider, CMusicControl)
+
+void CMusicSlider::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CMusicControl::save(file, indent);
+}
+
+void CMusicSlider::load(SimpleFile *file) {
+	file->readNumber();
+	CMusicControl::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/music_slider.h b/engines/titanic/gfx/music_slider.h
index 3fd0ab3..b396074 100644
--- a/engines/titanic/gfx/music_slider.h
+++ b/engines/titanic/gfx/music_slider.h
@@ -28,24 +28,19 @@
 namespace Titanic {
 
 class CMusicSlider : public CMusicControl {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const {
-		file->writeNumberLine(1, indent);
-		CMusicControl::save(file, indent);
-	}
+	virtual void save(SimpleFile *file, int indent) const;
 
 	/**
 	 * Load the data for the class from file
 	 */
-	virtual void load(SimpleFile *file) {
-		file->readNumber();
-		CMusicControl::load(file);
-	}
+	virtual void load(SimpleFile *file);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/gfx/music_switch.cpp b/engines/titanic/gfx/music_switch.cpp
new file mode 100644
index 0000000..69e8f2e
--- /dev/null
+++ b/engines/titanic/gfx/music_switch.cpp
@@ -0,0 +1,39 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/gfx/music_switch.h"
+
+namespace Titanic {
+
+EMPTY_MESSAGE_MAP(CMusicSwitch, CMusicControl)
+
+void CMusicSwitch::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(1, indent);
+	CMusicControl::save(file, indent);
+}
+
+void CMusicSwitch::load(SimpleFile *file) {
+	file->readNumber();
+	CMusicControl::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/gfx/music_switch.h b/engines/titanic/gfx/music_switch.h
index 534eb25..bd9397e 100644
--- a/engines/titanic/gfx/music_switch.h
+++ b/engines/titanic/gfx/music_switch.h
@@ -28,24 +28,19 @@
 namespace Titanic {
 
 class CMusicSwitch : public CMusicControl {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const {
-		file->writeNumberLine(1, indent);
-		CMusicControl::save(file, indent);
-	}
+	virtual void save(SimpleFile *file, int indent) const;
 
 	/**
 	 * Load the data for the class from file
 	 */
-	virtual void load(SimpleFile *file) {
-		file->readNumber();
-		CMusicControl::load(file);
-	}
+	virtual void load(SimpleFile *file);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/gfx/send_to_succ.cpp b/engines/titanic/gfx/send_to_succ.cpp
index 82c923c..938fa7c 100644
--- a/engines/titanic/gfx/send_to_succ.cpp
+++ b/engines/titanic/gfx/send_to_succ.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CSendToSucc, CToggleSwitch)
+
 CSendToSucc::CSendToSucc() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/send_to_succ.h b/engines/titanic/gfx/send_to_succ.h
index fb237f2..65868cd 100644
--- a/engines/titanic/gfx/send_to_succ.h
+++ b/engines/titanic/gfx/send_to_succ.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CSendToSucc : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CSendToSucc();
diff --git a/engines/titanic/gfx/sgt_selector.cpp b/engines/titanic/gfx/sgt_selector.cpp
index 7ad126b..170b0f4 100644
--- a/engines/titanic/gfx/sgt_selector.cpp
+++ b/engines/titanic/gfx/sgt_selector.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CSGTSelector, CPetGraphic)
+
 void CSGTSelector::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
diff --git a/engines/titanic/gfx/sgt_selector.h b/engines/titanic/gfx/sgt_selector.h
index 8ebd7ae..82757fa 100644
--- a/engines/titanic/gfx/sgt_selector.h
+++ b/engines/titanic/gfx/sgt_selector.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CSGTSelector : public CPetGraphic {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/gfx/small_chev_left_off.cpp b/engines/titanic/gfx/small_chev_left_off.cpp
index 8614e33..8647ad8 100644
--- a/engines/titanic/gfx/small_chev_left_off.cpp
+++ b/engines/titanic/gfx/small_chev_left_off.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CSmallChevLeftOff, CToggleSwitch)
+
 CSmallChevLeftOff::CSmallChevLeftOff() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/small_chev_left_off.h b/engines/titanic/gfx/small_chev_left_off.h
index fc500ce..27c4001 100644
--- a/engines/titanic/gfx/small_chev_left_off.h
+++ b/engines/titanic/gfx/small_chev_left_off.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CSmallChevLeftOff : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CSmallChevLeftOff();
diff --git a/engines/titanic/gfx/small_chev_left_on.cpp b/engines/titanic/gfx/small_chev_left_on.cpp
index 7f6a4ee..b5031e9 100644
--- a/engines/titanic/gfx/small_chev_left_on.cpp
+++ b/engines/titanic/gfx/small_chev_left_on.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CSmallChevLeftOn, CToggleSwitch)
+
 CSmallChevLeftOn::CSmallChevLeftOn() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/small_chev_left_on.h b/engines/titanic/gfx/small_chev_left_on.h
index 8ab9417..7b60857 100644
--- a/engines/titanic/gfx/small_chev_left_on.h
+++ b/engines/titanic/gfx/small_chev_left_on.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CSmallChevLeftOn : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CSmallChevLeftOn();
diff --git a/engines/titanic/gfx/small_chev_right_off.cpp b/engines/titanic/gfx/small_chev_right_off.cpp
index 1a3051b..6d0c08e 100644
--- a/engines/titanic/gfx/small_chev_right_off.cpp
+++ b/engines/titanic/gfx/small_chev_right_off.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CSmallChevRightOff, CToggleSwitch)
+
 CSmallChevRightOff::CSmallChevRightOff() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/small_chev_right_off.h b/engines/titanic/gfx/small_chev_right_off.h
index fae9c3c..0dadae1 100644
--- a/engines/titanic/gfx/small_chev_right_off.h
+++ b/engines/titanic/gfx/small_chev_right_off.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CSmallChevRightOff : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CSmallChevRightOff();
diff --git a/engines/titanic/gfx/small_chev_right_on.cpp b/engines/titanic/gfx/small_chev_right_on.cpp
index 714b6b3..552990d 100644
--- a/engines/titanic/gfx/small_chev_right_on.cpp
+++ b/engines/titanic/gfx/small_chev_right_on.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CSmallChevRightOn, CToggleSwitch)
+
 CSmallChevRightOn::CSmallChevRightOn() : CToggleSwitch() {
 }
 
diff --git a/engines/titanic/gfx/small_chev_right_on.h b/engines/titanic/gfx/small_chev_right_on.h
index c5cb4d7..ea042d3 100644
--- a/engines/titanic/gfx/small_chev_right_on.h
+++ b/engines/titanic/gfx/small_chev_right_on.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CSmallChevRightOn : public CToggleSwitch {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 	CSmallChevRightOn();
diff --git a/engines/titanic/gfx/text_down.cpp b/engines/titanic/gfx/text_down.cpp
index d4bdfdb..967d60f 100644
--- a/engines/titanic/gfx/text_down.cpp
+++ b/engines/titanic/gfx/text_down.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CTextDown, CPetGraphic)
+
 void CTextDown::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
diff --git a/engines/titanic/gfx/text_down.h b/engines/titanic/gfx/text_down.h
index 189f795..920ea8c 100644
--- a/engines/titanic/gfx/text_down.h
+++ b/engines/titanic/gfx/text_down.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CTextDown : public CPetGraphic {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/gfx/text_skrew.cpp b/engines/titanic/gfx/text_skrew.cpp
index 8d1f026..30cc7f4 100644
--- a/engines/titanic/gfx/text_skrew.cpp
+++ b/engines/titanic/gfx/text_skrew.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CTextSkrew, CPetGraphic)
+
 void CTextSkrew::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
diff --git a/engines/titanic/gfx/text_skrew.h b/engines/titanic/gfx/text_skrew.h
index aa6c375..6e86e70 100644
--- a/engines/titanic/gfx/text_skrew.h
+++ b/engines/titanic/gfx/text_skrew.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CTextSkrew : public CPetGraphic {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/gfx/text_up.cpp b/engines/titanic/gfx/text_up.cpp
index ce3ff10..0cb4153 100644
--- a/engines/titanic/gfx/text_up.cpp
+++ b/engines/titanic/gfx/text_up.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CTextUp, CPetGraphic)
+
 void CTextUp::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
diff --git a/engines/titanic/gfx/text_up.h b/engines/titanic/gfx/text_up.h
index 103f621..05a54bc 100644
--- a/engines/titanic/gfx/text_up.h
+++ b/engines/titanic/gfx/text_up.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CTextUp : public CPetGraphic {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/gfx/toggle_button.cpp b/engines/titanic/gfx/toggle_button.cpp
index 8284d35..3bb2e96 100644
--- a/engines/titanic/gfx/toggle_button.cpp
+++ b/engines/titanic/gfx/toggle_button.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CToggleButton, CBackground)
+
 void CToggleButton::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
diff --git a/engines/titanic/gfx/toggle_button.h b/engines/titanic/gfx/toggle_button.h
index a98a94d..ac0bb69 100644
--- a/engines/titanic/gfx/toggle_button.h
+++ b/engines/titanic/gfx/toggle_button.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CToggleButton : public CBackground {
+	DECLARE_MESSAGE_MAP
 private:
 	int _fieldE0;
 public:
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 28be249..3985ebf 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -298,6 +298,8 @@ MODULE_OBJS := \
 	gfx/keybrd_butt.o \
 	gfx/move_object_button.o \
 	gfx/music_control.o \
+	gfx/music_slider.o \
+	gfx/music_switch.o \
 	gfx/send_to_succ.o \
 	gfx/sgt_selector.o \
 	gfx/slider_button.o \
diff --git a/engines/titanic/npcs/mobile.cpp b/engines/titanic/npcs/mobile.cpp
index 37c1d13..55b37f5 100644
--- a/engines/titanic/npcs/mobile.cpp
+++ b/engines/titanic/npcs/mobile.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CMobile, CCharacter)
+
 CMobile::CMobile() : CCharacter(), _fieldDC(0) {
 }
 
diff --git a/engines/titanic/npcs/mobile.h b/engines/titanic/npcs/mobile.h
index 4979d54..3ec19a4 100644
--- a/engines/titanic/npcs/mobile.h
+++ b/engines/titanic/npcs/mobile.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CMobile : public CCharacter {
+	DECLARE_MESSAGE_MAP
 private:
 	Point _pos1;
 	int _fieldDC;
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index c989aa3..0eaf213 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/npcs/true_talk_npc.h"
 #include "titanic/core/view_item.h"
+#include "titanic/pet_control/pet_control.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
@@ -221,5 +222,16 @@ void CTrueTalkNPC::startTalker(CViewItem *view) {
 		gameManager->getTalkManager()->start4(this, view);
 }
 
+void CTrueTalkNPC::performAction(bool startTalking, CViewItem *view) {
+	CPetControl *pet = getPetControl();
+	if (pet)
+		pet->resetActiveNPC();
+
+	if (startTalking)
+		startTalker(view);
+
+	if (pet)
+		pet->convResetNPC();
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index 2361304..3126d92 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -72,6 +72,11 @@ protected:
 	 * Stop an animation timer
 	 */
 	void stopAnimTimer(int id);
+
+	/**
+	 * Perform an action
+	 */
+	void performAction(bool startTalking, CViewItem *view);
 public:
 	CLASSDEF
 	CTrueTalkNPC();
diff --git a/engines/titanic/pet_control/pet_graphic.cpp b/engines/titanic/pet_control/pet_graphic.cpp
index 797c560..25a7739 100644
--- a/engines/titanic/pet_control/pet_graphic.cpp
+++ b/engines/titanic/pet_control/pet_graphic.cpp
@@ -24,8 +24,7 @@
 
 namespace Titanic {
 
-BEGIN_MESSAGE_MAP(CPetGraphic, CGameObject)
-END_MESSAGE_MAP()
+EMPTY_MESSAGE_MAP(CPetGraphic, CGameObject)
 
 void CPetGraphic::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/pet_control/pet_graphic2.cpp b/engines/titanic/pet_control/pet_graphic2.cpp
index ef89819..a33a1c7 100644
--- a/engines/titanic/pet_control/pet_graphic2.cpp
+++ b/engines/titanic/pet_control/pet_graphic2.cpp
@@ -24,8 +24,7 @@
 
 namespace Titanic {
 
-BEGIN_MESSAGE_MAP(CPetGraphic2, CGameObject)
-END_MESSAGE_MAP()
+EMPTY_MESSAGE_MAP(CPetGraphic2, CGameObject)
 
 void CPetGraphic2::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/pet_control/pet_leaf.cpp b/engines/titanic/pet_control/pet_leaf.cpp
index 77b0d42..833f4ed 100644
--- a/engines/titanic/pet_control/pet_leaf.cpp
+++ b/engines/titanic/pet_control/pet_leaf.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(PETLeaf, CGameObject)
+
 void PETLeaf::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/pet_control/pet_leaf.h b/engines/titanic/pet_control/pet_leaf.h
index 0733749..b9c516f 100644
--- a/engines/titanic/pet_control/pet_leaf.h
+++ b/engines/titanic/pet_control/pet_leaf.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class PETLeaf : public CGameObject {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/pet_control/pet_mode_off.cpp b/engines/titanic/pet_control/pet_mode_off.cpp
index 3d3eb37..a1c9f3d 100644
--- a/engines/titanic/pet_control/pet_mode_off.cpp
+++ b/engines/titanic/pet_control/pet_mode_off.cpp
@@ -24,8 +24,7 @@
 
 namespace Titanic {
 
-BEGIN_MESSAGE_MAP(CPetModeOff, CToggleSwitch)
-END_MESSAGE_MAP()
+EMPTY_MESSAGE_MAP(CPetModeOff, CToggleSwitch)
 
 CPetModeOff::CPetModeOff() : CToggleSwitch() {
 }
diff --git a/engines/titanic/pet_control/pet_mode_on.cpp b/engines/titanic/pet_control/pet_mode_on.cpp
index bde318b..1a7c2c2 100644
--- a/engines/titanic/pet_control/pet_mode_on.cpp
+++ b/engines/titanic/pet_control/pet_mode_on.cpp
@@ -24,8 +24,7 @@
 
 namespace Titanic {
 
-BEGIN_MESSAGE_MAP(CPetModeOn, CToggleSwitch)
-END_MESSAGE_MAP()
+EMPTY_MESSAGE_MAP(CPetModeOn, CToggleSwitch)
 
 CPetModeOn::CPetModeOn() : CToggleSwitch() {
 }
diff --git a/engines/titanic/pet_control/pet_mode_panel.cpp b/engines/titanic/pet_control/pet_mode_panel.cpp
index 1890f9a..87351be 100644
--- a/engines/titanic/pet_control/pet_mode_panel.cpp
+++ b/engines/titanic/pet_control/pet_mode_panel.cpp
@@ -24,8 +24,7 @@
 
 namespace Titanic {
 
-BEGIN_MESSAGE_MAP(CPetModePanel, CToggleSwitch)
-END_MESSAGE_MAP()
+EMPTY_MESSAGE_MAP(CPetModePanel, CToggleSwitch)
 
 CPetModePanel::CPetModePanel() : CToggleSwitch() {
 }
diff --git a/engines/titanic/pet_control/pet_pannel1.cpp b/engines/titanic/pet_control/pet_pannel1.cpp
index 01e2b93..527841f 100644
--- a/engines/titanic/pet_control/pet_pannel1.cpp
+++ b/engines/titanic/pet_control/pet_pannel1.cpp
@@ -24,8 +24,7 @@
 
 namespace Titanic {
 
-BEGIN_MESSAGE_MAP(CPetPannel1, CPetGraphic)
-END_MESSAGE_MAP()
+EMPTY_MESSAGE_MAP(CPetPannel1, CPetGraphic)
 
 void CPetPannel1::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/pet_control/pet_pannel2.cpp b/engines/titanic/pet_control/pet_pannel2.cpp
index e55468d..48675a7 100644
--- a/engines/titanic/pet_control/pet_pannel2.cpp
+++ b/engines/titanic/pet_control/pet_pannel2.cpp
@@ -24,8 +24,7 @@
 
 namespace Titanic {
 
-BEGIN_MESSAGE_MAP(CPetPannel2, CPetGraphic)
-END_MESSAGE_MAP()
+EMPTY_MESSAGE_MAP(CPetPannel2, CPetGraphic)
 
 void CPetPannel2::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/pet_control/pet_pannel3.cpp b/engines/titanic/pet_control/pet_pannel3.cpp
index ea623a3..a0b6938 100644
--- a/engines/titanic/pet_control/pet_pannel3.cpp
+++ b/engines/titanic/pet_control/pet_pannel3.cpp
@@ -24,8 +24,7 @@
 
 namespace Titanic {
 
-BEGIN_MESSAGE_MAP(CPetPannel3, CPetGraphic)
-END_MESSAGE_MAP()
+EMPTY_MESSAGE_MAP(CPetPannel3, CPetGraphic)
 
 void CPetPannel3::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/sound/dome_from_top_of_well.cpp b/engines/titanic/sound/dome_from_top_of_well.cpp
index 6e31937..f8d946a 100644
--- a/engines/titanic/sound/dome_from_top_of_well.cpp
+++ b/engines/titanic/sound/dome_from_top_of_well.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CDomeFromTopOfWell, CViewAutoSoundPlayer)
+
 void CDomeFromTopOfWell::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	CViewAutoSoundPlayer::save(file, indent);
diff --git a/engines/titanic/sound/dome_from_top_of_well.h b/engines/titanic/sound/dome_from_top_of_well.h
index bb8ab63..24c1650 100644
--- a/engines/titanic/sound/dome_from_top_of_well.h
+++ b/engines/titanic/sound/dome_from_top_of_well.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CDomeFromTopOfWell : public CViewAutoSoundPlayer {
+	DECLARE_MESSAGE_MAP
 public:
 	CLASSDEF
 
diff --git a/engines/titanic/sound/water_lapping_sounds.cpp b/engines/titanic/sound/water_lapping_sounds.cpp
index b3f5d23..f5a69e6 100644
--- a/engines/titanic/sound/water_lapping_sounds.cpp
+++ b/engines/titanic/sound/water_lapping_sounds.cpp
@@ -24,6 +24,8 @@
 
 namespace Titanic {
 
+EMPTY_MESSAGE_MAP(CWaterLappingSounds, CRoomAutoSoundPlayer)
+
 void CWaterLappingSounds::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
diff --git a/engines/titanic/sound/water_lapping_sounds.h b/engines/titanic/sound/water_lapping_sounds.h
index 0d885be..cf6c721 100644
--- a/engines/titanic/sound/water_lapping_sounds.h
+++ b/engines/titanic/sound/water_lapping_sounds.h
@@ -28,6 +28,7 @@
 namespace Titanic {
 
 class CWaterLappingSounds : public CRoomAutoSoundPlayer {
+	DECLARE_MESSAGE_MAP
 public:
 	int _value;
 public:


Commit: 123966554abab05646f666b85a29726b02342661
    https://github.com/scummvm/scummvm/commit/123966554abab05646f666b85a29726b02342661
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:47-04:00

Commit Message:
TITANIC: gcc compilation fixes

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/message_target.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index d1f3a32..9e15590 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -1410,7 +1410,7 @@ CStarControl *CGameObject::getStarControl() const {
 	if (!starControl) {
 		CViewItem *view = getGameManager()->getView();
 		if (view)
-			starControl = starControl = static_cast<CStarControl *>(view->findChildInstanceOf(CStarControl::_type));
+			starControl = static_cast<CStarControl *>(view->findChildInstanceOf(CStarControl::_type));
 	}
 
 	return starControl;
diff --git a/engines/titanic/core/message_target.h b/engines/titanic/core/message_target.h
index e5bdf3e..42e9e5a 100644
--- a/engines/titanic/core/message_target.h
+++ b/engines/titanic/core/message_target.h
@@ -73,7 +73,6 @@ protected: \
 		{ return getThisMessageMap(); } \
 	const MSGMAP *theClass::getThisMessageMap() \
 	{ \
-		typedef theClass ThisClass;						   \
 		typedef baseClass TheBaseClass;					   \
 		static const MSGMAP_ENTRY _messageEntries[] = { \
 		{ (PMSG)nullptr, nullptr } \


Commit: ce0be01e317996c0454a85dd9a24b896e13ddc8e
    https://github.com/scummvm/scummvm/commit/ce0be01e317996c0454a85dd9a24b896e13ddc8e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:50-04:00

Commit Message:
TITANIC: Cleanup CGameObject list from CMovieClipList to CMovieRangeInfoList

Changed paths:
  A engines/titanic/support/movie_clip.cpp
  A engines/titanic/support/movie_clip.h
  R engines/titanic/core/movie_clip.cpp
  R engines/titanic/core/movie_clip.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/game_object_desc_item.h
    engines/titanic/core/link_item.h
    engines/titanic/core/room_item.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/module.mk
    engines/titanic/support/movie_range_info.cpp
    engines/titanic/support/movie_range_info.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 9e15590..2a2c6cf 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -93,7 +93,7 @@ void CGameObject::load(SimpleFile *file) {
 
 	switch (val) {
 	case 7:
-		_clipList2.load(file);
+		_movieRangeInfo.load(file);
 		_frameNumber = file->readNumber();
 		// Deliberate fall-through
 
@@ -102,7 +102,7 @@ void CGameObject::load(SimpleFile *file) {
 		// Deliberate fall-through
 
 	case 5:
-		_clipList1.load(file);
+		_movieClips.load(file);
 		// Deliberate fall-through
 
 	case 4:
@@ -179,8 +179,8 @@ void CGameObject::draw(CScreenManager *screenManager) {
 				_frameNumber = -1;
 			}
 
-			if (!_clipList2.empty())
-				processClipList2();
+			if (!_movieRangeInfo.empty())
+				processMoveRangeInfo();
 
 			if (_bounds.intersects(getGameManager()->_bounds)) {
 				if (_surface) {
@@ -376,11 +376,11 @@ void CGameObject::playMovie(int v1, int v2) {
 	}
 }
 
-void CGameObject::processClipList2() {
-	for (CMovieClipList::iterator i = _clipList2.begin(); i != _clipList2.end(); ++i)
+void CGameObject::processMoveRangeInfo() {
+	for (CMovieRangeInfoList::iterator i = _movieRangeInfo.begin(); i != _movieRangeInfo.end(); ++i)
 		(*i)->process(this);
 
-	_clipList2.destroyContents();
+	_movieRangeInfo.destroyContents();
 }
 
 void CGameObject::makeDirty(const Rect &r) {
@@ -499,7 +499,7 @@ void CGameObject::playMovie(uint startFrame, uint endFrame, uint flags) {
 
 void CGameObject::playClip(const CString &name, uint flags) {
 	_frameNumber = -1;
-	CMovieClip *clip = _clipList1.findByName(name);
+	CMovieClip *clip = _movieClips.findByName(name);
 	if (clip)
 		playMovie(clip->_startFrame, clip->_endFrame, flags);
 }
@@ -1064,11 +1064,11 @@ void CGameObject::performAction(int actionNum, CViewItem *view) {
 }
 
 bool CGameObject::clipExistsByStart(const CString &name, int startFrame) const {
-	return _clipList1.existsByStart(name, startFrame);
+	return _movieClips.existsByStart(name, startFrame);
 }
 
 bool CGameObject::clipExistsByEnd(const CString &name, int endFrame) const {
-	return _clipList1.existsByEnd(name, endFrame);
+	return _movieClips.existsByEnd(name, endFrame);
 }
 
 void CGameObject::checkPlayMovie(const CString &name, int flags) {
@@ -1208,7 +1208,7 @@ void CGameObject::movie38(int v1) {
 }
 
 int CGameObject::getClipDuration(const CString &name, int frameRate) const {
-	CMovieClip *clip = _clipList1.findByName(name);
+	CMovieClip *clip = _movieClips.findByName(name);
 	return clip ? (clip->_endFrame - clip->_startFrame) * 1000 / frameRate : 0;
 }
 
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index ade8800..5533673 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -25,9 +25,10 @@
 
 #include "titanic/support/mouse_cursor.h"
 #include "titanic/support/credit_text.h"
+#include "titanic/support/movie_range_info.h"
 #include "titanic/support/proximity.h"
 #include "titanic/support/rect.h"
-#include "titanic/core/movie_clip.h"
+#include "titanic/support/movie_clip.h"
 #include "titanic/core/named_item.h"
 #include "titanic/pet_control/pet_section.h"
 #include "titanic/pet_control/pet_text.h"
@@ -68,7 +69,10 @@ private:
 	 */
 	void loadImage(const CString &name, bool pendingFlag = true);
 
-	void processClipList2();
+	/**
+	 * Process and remove any registered movie range info
+	 */
+	void processMoveRangeInfo();
 
 	/**
 	 * Merges one rect into another, and returns true if there was
@@ -84,9 +88,9 @@ protected:
 	int _field44;
 	int _field48;
 	int _field4C;
-	CMovieClipList _clipList1;
+	CMovieClipList _movieClips;
 	int _initialFrame;
-	CMovieClipList _clipList2;
+	CMovieRangeInfoList _movieRangeInfo;
 	int _frameNumber;
 	CPetText *_text;
 	uint _textBorder;
@@ -533,7 +537,7 @@ public:
 	/**
 	 * Returns the clip list, if any, associated with the item
 	 */
-	virtual const CMovieClipList *getClipList() const { return &_clipList1; }
+	virtual const CMovieClipList *getClipList() const { return &_movieClips; }
 
 	/**
 	 * Allows the item to draw itself
diff --git a/engines/titanic/core/game_object_desc_item.h b/engines/titanic/core/game_object_desc_item.h
index 4ac5816..5bfc483 100644
--- a/engines/titanic/core/game_object_desc_item.h
+++ b/engines/titanic/core/game_object_desc_item.h
@@ -23,7 +23,7 @@
 #ifndef TITANIC_GAME_OBJECT_DESK_ITEM_H
 #define TITANIC_GAME_OBJECT_DESK_ITEM_H
 
-#include "titanic/core/movie_clip.h"
+#include "titanic/support/movie_clip.h"
 #include "titanic/core/tree_item.h"
 #include "titanic/core/list.h"
 
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index 9c37639..328d5bc 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -25,7 +25,7 @@
 
 #include "titanic/support/mouse_cursor.h"
 #include "titanic/core/named_item.h"
-#include "titanic/core/movie_clip.h"
+#include "titanic/support/movie_clip.h"
 
 namespace Titanic {
 
diff --git a/engines/titanic/core/movie_clip.cpp b/engines/titanic/core/movie_clip.cpp
deleted file mode 100644
index 9e5df67..0000000
--- a/engines/titanic/core/movie_clip.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/core/movie_clip.h"
-#include "titanic/core/game_object.h"
-
-namespace Titanic {
-
-CMovieClip::CMovieClip(): ListItem(), _startFrame(0), _endFrame(0) {
-}
-
-CMovieClip::CMovieClip(const CString &name, int startFrame, int endFrame):
-	ListItem(), _name(name), _startFrame(startFrame), _endFrame(endFrame) {
-}
-
-void CMovieClip::save(SimpleFile *file, int indent) const {
-	file->writeNumberLine(2, indent);
-	file->writeQuotedLine("Clip", indent);
-	file->writeQuotedLine(_name, indent);
-	file->writeNumberLine(_startFrame, indent);
-	file->writeNumberLine(_endFrame, indent);
-
-	ListItem::save(file, indent);
-}
-
-void CMovieClip::load(SimpleFile *file) {
-	int val = file->readNumber();
-
-	switch (val) {
-	case 1:
-		// This should never be used
-		assert(0);
-		break;
-
-	case 2:
-		file->readString();
-		_name = file->readString();
-		_startFrame = file->readNumber();
-		_endFrame = file->readNumber();
-		break;
-
-	default:
-		break;
-	}
-
-	ListItem::load(file);
-}
-
-void CMovieClip::process(CGameObject *owner) {
-	int flags = 0;
-	if (_endFrame)
-		flags |= CLIPFLAG_HAS_END_FRAME;
-	if (_startFrame)
-		flags |= CLIPFLAG_HAS_START_FRAME;
-
-	warning("TODO: CMovieClip::process");
-
-	owner->checkPlayMovie(_name, flags);
-
-
-}
-
-CMovieClip *CMovieClipList::findByName(const Common::String &name) const {
-	for (const_iterator i = begin(); i != end(); ++i) {
-		CMovieClip *clip = *i;
-		if (clip->_name == name)
-			return clip;
-	}
-
-	return nullptr;
-}
-
-bool CMovieClipList::existsByStart(const CString &name, int startFrame) const {
-	for (const_iterator i = begin(); i != end(); ++i) {
-		CMovieClip *clip = *i;
-		if (clip->_startFrame == startFrame && clip->_name == name)
-			return true;
-	}
-
-	return false;
-}
-
-bool CMovieClipList::existsByEnd(const CString &name, int endFrame) const {
-	for (const_iterator i = begin(); i != end(); ++i) {
-		CMovieClip *clip = *i;
-		if (clip->_endFrame == endFrame && clip->_name == name)
-			return true;
-	}
-
-	return false;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/core/movie_clip.h b/engines/titanic/core/movie_clip.h
deleted file mode 100644
index 6486259..0000000
--- a/engines/titanic/core/movie_clip.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_MOVIE_CLIP_H
-#define TITANIC_MOVIE_CLIP_H
-
-#include "titanic/core/list.h"
-
-namespace Titanic {
-
-enum ClipFlag { 
-	CLIPFLAG_HAS_END_FRAME = 1,
-	CLIPFLAG_4 = 4,
-	CLIPFLAG_HAS_START_FRAME = 8,
-	CLIPFLAG_PLAY = 0x10
-};
-
-class CGameObject;
-
-/**
- * Movie clip
- */
-class CMovieClip : public ListItem {
-private:
-	Common::List<void *> _items;
-	CString _string2;
-	CString _string3;
-public:
-	CString _name;
-	int _startFrame;
-	int _endFrame;
-public:
-	CLASSDEF
-	CMovieClip();
-	CMovieClip(const CString &name, int startFrame, int endFrame);
-
-	/**
-	 * Save the data for the class to file
-	 */
-	virtual void save(SimpleFile *file, int indent) const;
-
-	/**
-	 * Load the data for the class from file
-	 */
-	virtual void load(SimpleFile *file);
-
-	void process(CGameObject *owner);
-};
-
-/**
- * Movie clip list
- */
-class CMovieClipList: public List<CMovieClip> {
-public:
-	/**
-	 * Finds and returns a movie clip in the list by name
-	 */
-	CMovieClip *findByName(const Common::String &name) const;
-
-	/**
-	 * Returns true if a clip exists in the list with a given name
-	 * and starting frame number
-	 */
-	bool existsByStart(const CString &name, int startFrame = 0) const;
-
-	/**
-	 * Returns true if a clip exists in the list with a given name
-	 * and starting frame number
-	 */
-	bool existsByEnd(const CString &name, int endFrame = 0) const;
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_MOVIE_CLIP_H */
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index f44a525..eb7f4c4 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -25,7 +25,7 @@
 
 #include "titanic/support/rect.h"
 #include "titanic/core/list.h"
-#include "titanic/core/movie_clip.h"
+#include "titanic/support/movie_clip.h"
 #include "titanic/core/named_item.h"
 #include "titanic/core/resource_key.h"
 
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 300d971..ad98ac4 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -70,7 +70,7 @@
 #include "titanic/core/list.h"
 #include "titanic/core/mail_man.h"
 #include "titanic/core/message_target.h"
-#include "titanic/core/movie_clip.h"
+#include "titanic/support/movie_clip.h"
 #include "titanic/core/multi_drop_target.h"
 #include "titanic/core/node_item.h"
 #include "titanic/core/project_item.h"
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 3985ebf..3c752bf 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -63,7 +63,6 @@ MODULE_OBJS := \
 	core/list.o \
 	core/mail_man.o \
 	core/message_target.o \
-	core/movie_clip.o \
 	core/multi_drop_target.o \
 	core/named_item.o \
 	core/node_item.o \
@@ -442,6 +441,7 @@ MODULE_OBJS := \
 	support/image_decoders.o \
 	support/mouse_cursor.o \
 	support/movie.o \
+	support/movie_clip.o \
 	support/movie_event.o \
 	support/movie_range_info.o \
 	support/credit_text.o \
diff --git a/engines/titanic/support/movie_clip.cpp b/engines/titanic/support/movie_clip.cpp
new file mode 100644
index 0000000..da655ce
--- /dev/null
+++ b/engines/titanic/support/movie_clip.cpp
@@ -0,0 +1,98 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/movie_clip.h"
+#include "titanic/core/game_object.h"
+
+namespace Titanic {
+
+CMovieClip::CMovieClip(): ListItem(), _startFrame(0), _endFrame(0) {
+}
+
+CMovieClip::CMovieClip(const CString &name, int startFrame, int endFrame):
+	ListItem(), _name(name), _startFrame(startFrame), _endFrame(endFrame) {
+}
+
+void CMovieClip::save(SimpleFile *file, int indent) const {
+	file->writeNumberLine(2, indent);
+	file->writeQuotedLine("Clip", indent);
+	file->writeQuotedLine(_name, indent);
+	file->writeNumberLine(_startFrame, indent);
+	file->writeNumberLine(_endFrame, indent);
+
+	ListItem::save(file, indent);
+}
+
+void CMovieClip::load(SimpleFile *file) {
+	int val = file->readNumber();
+
+	switch (val) {
+	case 1:
+		// This should never be used
+		assert(0);
+		break;
+
+	case 2:
+		file->readString();
+		_name = file->readString();
+		_startFrame = file->readNumber();
+		_endFrame = file->readNumber();
+		break;
+
+	default:
+		break;
+	}
+
+	ListItem::load(file);
+}
+
+CMovieClip *CMovieClipList::findByName(const Common::String &name) const {
+	for (const_iterator i = begin(); i != end(); ++i) {
+		CMovieClip *clip = *i;
+		if (clip->_name == name)
+			return clip;
+	}
+
+	return nullptr;
+}
+
+bool CMovieClipList::existsByStart(const CString &name, int startFrame) const {
+	for (const_iterator i = begin(); i != end(); ++i) {
+		CMovieClip *clip = *i;
+		if (clip->_startFrame == startFrame && clip->_name == name)
+			return true;
+	}
+
+	return false;
+}
+
+bool CMovieClipList::existsByEnd(const CString &name, int endFrame) const {
+	for (const_iterator i = begin(); i != end(); ++i) {
+		CMovieClip *clip = *i;
+		if (clip->_endFrame == endFrame && clip->_name == name)
+			return true;
+	}
+
+	return false;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/movie_clip.h b/engines/titanic/support/movie_clip.h
new file mode 100644
index 0000000..0b1106f
--- /dev/null
+++ b/engines/titanic/support/movie_clip.h
@@ -0,0 +1,92 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVIE_CLIP_H
+#define TITANIC_MOVIE_CLIP_H
+
+#include "titanic/core/list.h"
+
+namespace Titanic {
+
+enum ClipFlag { 
+	CLIPFLAG_HAS_END_FRAME = 1,
+	CLIPFLAG_4 = 4,
+	CLIPFLAG_HAS_START_FRAME = 8,
+	CLIPFLAG_PLAY = 0x10
+};
+
+class CGameObject;
+
+/**
+ * Movie clip
+ */
+class CMovieClip : public ListItem {
+private:
+	Common::List<void *> _items;
+	CString _string2;
+	CString _string3;
+public:
+	CString _name;
+	int _startFrame;
+	int _endFrame;
+public:
+	CLASSDEF
+	CMovieClip();
+	CMovieClip(const CString &name, int startFrame, int endFrame);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	virtual void save(SimpleFile *file, int indent) const;
+
+	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file);
+};
+
+/**
+ * Movie clip list
+ */
+class CMovieClipList: public List<CMovieClip> {
+public:
+	/**
+	 * Finds and returns a movie clip in the list by name
+	 */
+	CMovieClip *findByName(const Common::String &name) const;
+
+	/**
+	 * Returns true if a clip exists in the list with a given name
+	 * and starting frame number
+	 */
+	bool existsByStart(const CString &name, int startFrame = 0) const;
+
+	/**
+	 * Returns true if a clip exists in the list with a given name
+	 * and starting frame number
+	 */
+	bool existsByEnd(const CString &name, int endFrame = 0) const;
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVIE_CLIP_H */
diff --git a/engines/titanic/support/movie_range_info.cpp b/engines/titanic/support/movie_range_info.cpp
index 6242673..ff246fb 100644
--- a/engines/titanic/support/movie_range_info.cpp
+++ b/engines/titanic/support/movie_range_info.cpp
@@ -64,4 +64,18 @@ void CMovieRangeInfo::load(SimpleFile *file) {
 	}
 }
 
+void CMovieRangeInfo::process(CGameObject *owner) {
+/*
+	int flags = 0;
+	if (_endFrame)
+		flags |= CLIPFLAG_HAS_END_FRAME;
+	if (_startFrame)
+		flags |= CLIPFLAG_HAS_START_FRAME;
+
+	warning("TODO: CMovieClip::process");
+
+	owner->checkPlayMovie(_name, flags);
+	*/
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie_range_info.h b/engines/titanic/support/movie_range_info.h
index e751e30..2c7d86f 100644
--- a/engines/titanic/support/movie_range_info.h
+++ b/engines/titanic/support/movie_range_info.h
@@ -30,6 +30,8 @@
 
 namespace Titanic {
 
+class CGameObject;
+
 class CMovieRangeInfo : public ListItem {
 public:
 	int _fieldC;
@@ -57,6 +59,11 @@ public:
 	 * Adds an event to the events list
 	 */
 	void add(CMovieEvent *movieEvent) { _events.push_back(movieEvent); }
+
+	void process(CGameObject *owner);
+};
+
+class CMovieRangeInfoList : public List<CMovieRangeInfo> {
 };
 
 } // End of namespace Titanic


Commit: a82bcd3ce7ef0ae604af45fdb56668fca47e7137
    https://github.com/scummvm/scummvm/commit/a82bcd3ce7ef0ae604af45fdb56668fca47e7137
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:53-04:00

Commit Message:
TITANIC: Added CMovieRangeInfo methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/support/movie_range_info.cpp
    engines/titanic/support/movie_range_info.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 2a2c6cf..af866dd 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -1197,12 +1197,12 @@ void CGameObject::setMovie14(int v) {
 		_surface->_movie->_field14 = v;
 }
 
-void CGameObject::movie38(int v1, int v2) {
+void CGameObject::surface38(int v1, int v2) {
 	if (_surface)
 		_surface->proc38(v1, v2);
 }
 
-void CGameObject::movie38(int v1) {
+void CGameObject::surface38(int v1) {
 	if (_surface)
 		_surface->proc38(-1, v1);
 }
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 5533673..98d6d60 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -387,10 +387,6 @@ protected:
 
 	void setMovie14(int v);
 
-	void movie38(int v1, int v2);
-
-	void movie38(int v1);
-
 	void fn10(int v1, int v2, int v3);
 
 	/**
@@ -848,6 +844,12 @@ public:
 	 * Gets a dial region for a given NPC
 	 */
 	int talkGetDIalRegion(const CString &name, int dialNum);
+
+	/*--- CVideoSurface Methods ---*/
+
+	void surface38(int v1, int v2);
+
+	void surface38(int v1);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie_range_info.cpp b/engines/titanic/support/movie_range_info.cpp
index ff246fb..ab34082 100644
--- a/engines/titanic/support/movie_range_info.cpp
+++ b/engines/titanic/support/movie_range_info.cpp
@@ -21,19 +21,22 @@
  */
 
 #include "titanic/support/movie_range_info.h"
+#include "titanic/support/movie_clip.h"
+#include "titanic/core/game_object.h"
 
 namespace Titanic {
 
-CMovieRangeInfo::CMovieRangeInfo() : ListItem(), _fieldC(0),
-		_field10(0), _field14(0), _field18(0), _field1C(0) {
+CMovieRangeInfo::CMovieRangeInfo() : ListItem(), _startFrame(0), _endFrame(0) {
+}
+
+CMovieRangeInfo::~CMovieRangeInfo() {
+	_events.destroyContents();
 }
 
 CMovieRangeInfo::CMovieRangeInfo(const CMovieRangeInfo *src) : ListItem() {
-	_fieldC = src->_fieldC;
-	_field10 = src->_field10;
-	_field14 = src->_field14;
-	_field18 = src->_field18;
-	_field1C = src->_field1C;
+	_movieName = src->_movieName;
+	_startFrame = src->_startFrame;
+	_endFrame = src->_endFrame;
 
 	// Duplicate the events list
 	for (CMovieEventList::const_iterator i = _events.begin();
@@ -44,38 +47,60 @@ CMovieRangeInfo::CMovieRangeInfo(const CMovieRangeInfo *src) : ListItem() {
 
 void CMovieRangeInfo::save(SimpleFile *file, int indent) const {
 	file->writeNumberLine(0, indent);
-	file->writeNumberLine(_fieldC, indent + 1);
-	file->writeNumberLine(_field10, indent + 1);
-	file->writeNumberLine(_field14, indent + 1);
-	file->writeNumberLine(_field1C, indent + 1);
-	file->writeNumberLine(_field18, indent + 1);
+	file->writeQuotedLine(_movieName, indent + 1);
+	file->writeNumberLine(_endFrame, indent + 1);
+	file->writeNumberLine(_startFrame, indent + 1);
 	_events.save(file, indent + 1);
 }
 
 void CMovieRangeInfo::load(SimpleFile *file) {
 	int val = file->readNumber();
 	if (!val) {
-		_fieldC = file->readNumber();
-		_field10 = file->readNumber();
-		_field14 = file->readNumber();
-		_field1C = file->readNumber();
-		_field18 = file->readNumber();
+		_movieName = file->readString();
+		_endFrame = file->readNumber();
+		_startFrame = file->readNumber();
 		_events.load(file);
 	}
 }
 
+void CMovieRangeInfo::get1(CMovieEventList &list) {
+	for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) {
+		CMovieEvent *movieEvent = *i;
+		if (movieEvent->_fieldC == 1)
+			list.push_back(new CMovieEvent(movieEvent));
+	}
+}
+
+void CMovieRangeInfo::get2(CMovieEventList &list, int val) {
+	for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) {
+		CMovieEvent *movieEvent = *i;
+		if (movieEvent->_fieldC == 2 && movieEvent->_field1C == val)
+			list.push_back(new CMovieEvent(movieEvent));
+	}
+}
+
 void CMovieRangeInfo::process(CGameObject *owner) {
-/*
 	int flags = 0;
 	if (_endFrame)
 		flags |= CLIPFLAG_HAS_END_FRAME;
 	if (_startFrame)
 		flags |= CLIPFLAG_HAS_START_FRAME;
+	
+	for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) {
+		CMovieEvent *movieEvent = *i;
+		if (!movieEvent->_fieldC) {
+			flags |= CLIPFLAG_PLAY;
+			break;
+		}
+	}
 
-	warning("TODO: CMovieClip::process");
+	owner->checkPlayMovie(_movieName, flags);
 
-	owner->checkPlayMovie(_name, flags);
-	*/
+	for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) {
+		CMovieEvent *movieEvent = *i;
+		if (!movieEvent->_fieldC)
+			owner->surface38(movieEvent->_field1C);
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie_range_info.h b/engines/titanic/support/movie_range_info.h
index 2c7d86f..3f077c7 100644
--- a/engines/titanic/support/movie_range_info.h
+++ b/engines/titanic/support/movie_range_info.h
@@ -34,16 +34,14 @@ class CGameObject;
 
 class CMovieRangeInfo : public ListItem {
 public:
-	int _fieldC;
-	int _field10;
-	int _field14;
-	int _field18;
-	int _field1C;
+	CString _movieName;
+	uint _startFrame;
+	uint _endFrame;
 	CMovieEventList _events;
 public:
 	CMovieRangeInfo();
 	CMovieRangeInfo(const CMovieRangeInfo *src);
-	virtual ~CMovieRangeInfo() {}
+	virtual ~CMovieRangeInfo();
 
 	/**
 	 * Save the data for the class to file
@@ -58,7 +56,11 @@ public:
 	/**
 	 * Adds an event to the events list
 	 */
-	void add(CMovieEvent *movieEvent) { _events.push_back(movieEvent); }
+	void addEvent(CMovieEvent *movieEvent) { _events.push_back(movieEvent); }
+
+	void get1(CMovieEventList &list);
+
+	void get2(CMovieEventList &list, int val);
 
 	void process(CGameObject *owner);
 };


Commit: 5ccc0a66da38d23520234e7060efaf966d3345b9
    https://github.com/scummvm/scummvm/commit/5ccc0a66da38d23520234e7060efaf966d3345b9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:25:58-04:00

Commit Message:
TITANIC: Removed const modifier from all saveable objects

Turns out that CGameObject::save regenerates the _movieRangeInfo list.
So the const suffix can no longer be used for the entire hierarchy

Changed paths:
    engines/titanic/carry/arm.cpp
    engines/titanic/carry/arm.h
    engines/titanic/carry/auditory_centre.cpp
    engines/titanic/carry/auditory_centre.h
    engines/titanic/carry/bowl_ear.cpp
    engines/titanic/carry/bowl_ear.h
    engines/titanic/carry/brain.cpp
    engines/titanic/carry/brain.h
    engines/titanic/carry/bridge_piece.cpp
    engines/titanic/carry/bridge_piece.h
    engines/titanic/carry/carry.cpp
    engines/titanic/carry/carry.h
    engines/titanic/carry/carry_parrot.cpp
    engines/titanic/carry/carry_parrot.h
    engines/titanic/carry/central_core.cpp
    engines/titanic/carry/central_core.h
    engines/titanic/carry/chicken.cpp
    engines/titanic/carry/chicken.h
    engines/titanic/carry/crushed_tv.cpp
    engines/titanic/carry/crushed_tv.h
    engines/titanic/carry/ear.cpp
    engines/titanic/carry/ear.h
    engines/titanic/carry/eye.cpp
    engines/titanic/carry/eye.h
    engines/titanic/carry/feathers.cpp
    engines/titanic/carry/feathers.h
    engines/titanic/carry/fruit.cpp
    engines/titanic/carry/fruit.h
    engines/titanic/carry/glass.cpp
    engines/titanic/carry/glass.h
    engines/titanic/carry/hammer.cpp
    engines/titanic/carry/hammer.h
    engines/titanic/carry/head_piece.cpp
    engines/titanic/carry/head_piece.h
    engines/titanic/carry/hose.cpp
    engines/titanic/carry/hose.h
    engines/titanic/carry/hose_end.cpp
    engines/titanic/carry/hose_end.h
    engines/titanic/carry/key.cpp
    engines/titanic/carry/key.h
    engines/titanic/carry/liftbot_head.cpp
    engines/titanic/carry/liftbot_head.h
    engines/titanic/carry/long_stick.cpp
    engines/titanic/carry/long_stick.h
    engines/titanic/carry/magazine.cpp
    engines/titanic/carry/magazine.h
    engines/titanic/carry/maitred_left_arm.cpp
    engines/titanic/carry/maitred_left_arm.h
    engines/titanic/carry/maitred_right_arm.cpp
    engines/titanic/carry/maitred_right_arm.h
    engines/titanic/carry/mouth.cpp
    engines/titanic/carry/mouth.h
    engines/titanic/carry/napkin.cpp
    engines/titanic/carry/napkin.h
    engines/titanic/carry/nose.cpp
    engines/titanic/carry/nose.h
    engines/titanic/carry/note.cpp
    engines/titanic/carry/note.h
    engines/titanic/carry/parcel.cpp
    engines/titanic/carry/parcel.h
    engines/titanic/carry/perch.cpp
    engines/titanic/carry/perch.h
    engines/titanic/carry/phonograph_cylinder.cpp
    engines/titanic/carry/phonograph_cylinder.h
    engines/titanic/carry/phonograph_ear.cpp
    engines/titanic/carry/phonograph_ear.h
    engines/titanic/carry/photograph.cpp
    engines/titanic/carry/photograph.h
    engines/titanic/carry/plug_in.cpp
    engines/titanic/carry/plug_in.h
    engines/titanic/carry/speech_centre.cpp
    engines/titanic/carry/speech_centre.h
    engines/titanic/carry/sweets.cpp
    engines/titanic/carry/sweets.h
    engines/titanic/carry/test_carry.cpp
    engines/titanic/carry/test_carry.h
    engines/titanic/carry/vision_centre.cpp
    engines/titanic/carry/vision_centre.h
    engines/titanic/core/background.cpp
    engines/titanic/core/background.h
    engines/titanic/core/click_responder.cpp
    engines/titanic/core/click_responder.h
    engines/titanic/core/dont_save_file_item.cpp
    engines/titanic/core/dont_save_file_item.h
    engines/titanic/core/drop_target.cpp
    engines/titanic/core/drop_target.h
    engines/titanic/core/file_item.cpp
    engines/titanic/core/file_item.h
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/game_object_desc_item.cpp
    engines/titanic/core/game_object_desc_item.h
    engines/titanic/core/link_item.cpp
    engines/titanic/core/link_item.h
    engines/titanic/core/list.cpp
    engines/titanic/core/list.h
    engines/titanic/core/mail_man.cpp
    engines/titanic/core/mail_man.h
    engines/titanic/core/message_target.cpp
    engines/titanic/core/message_target.h
    engines/titanic/core/multi_drop_target.cpp
    engines/titanic/core/multi_drop_target.h
    engines/titanic/core/named_item.cpp
    engines/titanic/core/named_item.h
    engines/titanic/core/node_item.cpp
    engines/titanic/core/node_item.h
    engines/titanic/core/project_item.cpp
    engines/titanic/core/project_item.h
    engines/titanic/core/resource_key.cpp
    engines/titanic/core/resource_key.h
    engines/titanic/core/room_item.cpp
    engines/titanic/core/room_item.h
    engines/titanic/core/saveable_object.cpp
    engines/titanic/core/saveable_object.h
    engines/titanic/core/static_image.cpp
    engines/titanic/core/static_image.h
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h
    engines/titanic/core/turn_on_object.cpp
    engines/titanic/core/turn_on_object.h
    engines/titanic/core/turn_on_play_sound.cpp
    engines/titanic/core/turn_on_play_sound.h
    engines/titanic/core/turn_on_turn_off.cpp
    engines/titanic/core/turn_on_turn_off.h
    engines/titanic/core/view_item.cpp
    engines/titanic/core/view_item.h
    engines/titanic/game/announce.cpp
    engines/titanic/game/announce.h
    engines/titanic/game/annoy_barbot.cpp
    engines/titanic/game/annoy_barbot.h
    engines/titanic/game/arb_background.cpp
    engines/titanic/game/arb_background.h
    engines/titanic/game/arboretum_gate.cpp
    engines/titanic/game/arboretum_gate.h
    engines/titanic/game/auto_animate.cpp
    engines/titanic/game/auto_animate.h
    engines/titanic/game/bar_bell.cpp
    engines/titanic/game/bar_bell.h
    engines/titanic/game/bar_menu.cpp
    engines/titanic/game/bar_menu.h
    engines/titanic/game/bar_menu_button.cpp
    engines/titanic/game/bar_menu_button.h
    engines/titanic/game/belbot_get_light.cpp
    engines/titanic/game/belbot_get_light.h
    engines/titanic/game/bilge_succubus.cpp
    engines/titanic/game/bilge_succubus.h
    engines/titanic/game/bomb.cpp
    engines/titanic/game/bomb.h
    engines/titanic/game/bottom_of_well_monitor.cpp
    engines/titanic/game/bottom_of_well_monitor.h
    engines/titanic/game/bowl_unlocker.cpp
    engines/titanic/game/bowl_unlocker.h
    engines/titanic/game/brain_slot.cpp
    engines/titanic/game/brain_slot.h
    engines/titanic/game/bridge_door.cpp
    engines/titanic/game/bridge_door.h
    engines/titanic/game/bridge_view.cpp
    engines/titanic/game/bridge_view.h
    engines/titanic/game/broken_pell_base.cpp
    engines/titanic/game/broken_pell_base.h
    engines/titanic/game/broken_pellerator.cpp
    engines/titanic/game/broken_pellerator.h
    engines/titanic/game/broken_pellerator_froz.cpp
    engines/titanic/game/broken_pellerator_froz.h
    engines/titanic/game/cage.cpp
    engines/titanic/game/cage.h
    engines/titanic/game/call_pellerator.cpp
    engines/titanic/game/call_pellerator.h
    engines/titanic/game/captains_wheel.cpp
    engines/titanic/game/captains_wheel.h
    engines/titanic/game/cdrom.cpp
    engines/titanic/game/cdrom.h
    engines/titanic/game/cdrom_computer.cpp
    engines/titanic/game/cdrom_computer.h
    engines/titanic/game/cdrom_tray.cpp
    engines/titanic/game/cdrom_tray.h
    engines/titanic/game/cell_point_button.cpp
    engines/titanic/game/cell_point_button.h
    engines/titanic/game/chev_code.cpp
    engines/titanic/game/chev_code.h
    engines/titanic/game/chev_panel.cpp
    engines/titanic/game/chev_panel.h
    engines/titanic/game/chicken_cooler.cpp
    engines/titanic/game/chicken_cooler.h
    engines/titanic/game/chicken_dispensor.cpp
    engines/titanic/game/chicken_dispensor.h
    engines/titanic/game/close_broken_pel.cpp
    engines/titanic/game/close_broken_pel.h
    engines/titanic/game/code_wheel.cpp
    engines/titanic/game/code_wheel.h
    engines/titanic/game/computer.cpp
    engines/titanic/game/computer.h
    engines/titanic/game/computer_screen.cpp
    engines/titanic/game/computer_screen.h
    engines/titanic/game/cookie.cpp
    engines/titanic/game/cookie.h
    engines/titanic/game/credits.cpp
    engines/titanic/game/credits.h
    engines/titanic/game/credits_button.cpp
    engines/titanic/game/credits_button.h
    engines/titanic/game/dead_area.cpp
    engines/titanic/game/dead_area.h
    engines/titanic/game/desk_click_responder.cpp
    engines/titanic/game/desk_click_responder.h
    engines/titanic/game/doorbot_elevator_handler.cpp
    engines/titanic/game/doorbot_elevator_handler.h
    engines/titanic/game/doorbot_home_handler.cpp
    engines/titanic/game/doorbot_home_handler.h
    engines/titanic/game/ear_sweet_bowl.cpp
    engines/titanic/game/ear_sweet_bowl.h
    engines/titanic/game/eject_phonograph_button.cpp
    engines/titanic/game/eject_phonograph_button.h
    engines/titanic/game/elevator_action_area.cpp
    engines/titanic/game/elevator_action_area.h
    engines/titanic/game/emma_control.cpp
    engines/titanic/game/emma_control.h
    engines/titanic/game/empty_nut_bowl.cpp
    engines/titanic/game/empty_nut_bowl.h
    engines/titanic/game/end_credit_text.cpp
    engines/titanic/game/end_credit_text.h
    engines/titanic/game/end_credits.cpp
    engines/titanic/game/end_credits.h
    engines/titanic/game/end_explode_ship.cpp
    engines/titanic/game/end_explode_ship.h
    engines/titanic/game/end_game_credits.cpp
    engines/titanic/game/end_game_credits.h
    engines/titanic/game/end_sequence_control.cpp
    engines/titanic/game/end_sequence_control.h
    engines/titanic/game/fan.cpp
    engines/titanic/game/fan.h
    engines/titanic/game/fan_control.cpp
    engines/titanic/game/fan_control.h
    engines/titanic/game/fan_decrease.cpp
    engines/titanic/game/fan_decrease.h
    engines/titanic/game/fan_increase.cpp
    engines/titanic/game/fan_increase.h
    engines/titanic/game/fan_noises.cpp
    engines/titanic/game/fan_noises.h
    engines/titanic/game/floor_indicator.cpp
    engines/titanic/game/floor_indicator.h
    engines/titanic/game/games_console.cpp
    engines/titanic/game/games_console.h
    engines/titanic/game/get_lift_eye2.cpp
    engines/titanic/game/get_lift_eye2.h
    engines/titanic/game/glass_smasher.cpp
    engines/titanic/game/glass_smasher.h
    engines/titanic/game/gondolier/gondolier_base.cpp
    engines/titanic/game/gondolier/gondolier_base.h
    engines/titanic/game/gondolier/gondolier_chest.cpp
    engines/titanic/game/gondolier/gondolier_chest.h
    engines/titanic/game/gondolier/gondolier_face.cpp
    engines/titanic/game/gondolier/gondolier_face.h
    engines/titanic/game/gondolier/gondolier_mixer.cpp
    engines/titanic/game/gondolier/gondolier_mixer.h
    engines/titanic/game/gondolier/gondolier_slider.cpp
    engines/titanic/game/gondolier/gondolier_slider.h
    engines/titanic/game/hammer_clip.cpp
    engines/titanic/game/hammer_clip.h
    engines/titanic/game/hammer_dispensor.cpp
    engines/titanic/game/hammer_dispensor.h
    engines/titanic/game/hammer_dispensor_button.cpp
    engines/titanic/game/hammer_dispensor_button.h
    engines/titanic/game/head_slot.cpp
    engines/titanic/game/head_slot.h
    engines/titanic/game/head_smash_event.cpp
    engines/titanic/game/head_smash_event.h
    engines/titanic/game/head_smash_lever.cpp
    engines/titanic/game/head_smash_lever.h
    engines/titanic/game/head_spinner.cpp
    engines/titanic/game/head_spinner.h
    engines/titanic/game/idle_summoner.cpp
    engines/titanic/game/idle_summoner.h
    engines/titanic/game/leave_sec_class_state.cpp
    engines/titanic/game/leave_sec_class_state.h
    engines/titanic/game/lemon_dispensor.cpp
    engines/titanic/game/lemon_dispensor.h
    engines/titanic/game/light.cpp
    engines/titanic/game/light.h
    engines/titanic/game/light_switch.cpp
    engines/titanic/game/light_switch.h
    engines/titanic/game/little_lift_button.cpp
    engines/titanic/game/little_lift_button.h
    engines/titanic/game/long_stick_dispenser.cpp
    engines/titanic/game/long_stick_dispenser.h
    engines/titanic/game/maitred/maitred_arm_holder.cpp
    engines/titanic/game/maitred/maitred_arm_holder.h
    engines/titanic/game/maitred/maitred_body.cpp
    engines/titanic/game/maitred/maitred_body.h
    engines/titanic/game/maitred/maitred_legs.cpp
    engines/titanic/game/maitred/maitred_legs.h
    engines/titanic/game/maitred/maitred_prod_receptor.cpp
    engines/titanic/game/maitred/maitred_prod_receptor.h
    engines/titanic/game/missiveomat.cpp
    engines/titanic/game/missiveomat.h
    engines/titanic/game/missiveomat_button.cpp
    engines/titanic/game/missiveomat_button.h
    engines/titanic/game/movie_tester.cpp
    engines/titanic/game/movie_tester.h
    engines/titanic/game/music_console_button.cpp
    engines/titanic/game/music_console_button.h
    engines/titanic/game/music_room_phonograph.cpp
    engines/titanic/game/music_room_phonograph.h
    engines/titanic/game/music_room_stop_phonograph_button.cpp
    engines/titanic/game/music_room_stop_phonograph_button.h
    engines/titanic/game/music_system_lock.cpp
    engines/titanic/game/music_system_lock.h
    engines/titanic/game/musical_instrument.cpp
    engines/titanic/game/musical_instrument.h
    engines/titanic/game/nav_helmet.cpp
    engines/titanic/game/nav_helmet.h
    engines/titanic/game/navigation_computer.cpp
    engines/titanic/game/navigation_computer.h
    engines/titanic/game/no_nut_bowl.cpp
    engines/titanic/game/no_nut_bowl.h
    engines/titanic/game/nose_holder.cpp
    engines/titanic/game/nose_holder.h
    engines/titanic/game/null_port_hole.cpp
    engines/titanic/game/null_port_hole.h
    engines/titanic/game/nut_replacer.cpp
    engines/titanic/game/nut_replacer.h
    engines/titanic/game/parrot/parrot_lobby_controller.cpp
    engines/titanic/game/parrot/parrot_lobby_controller.h
    engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
    engines/titanic/game/parrot/parrot_lobby_link_updater.h
    engines/titanic/game/parrot/parrot_lobby_object.cpp
    engines/titanic/game/parrot/parrot_lobby_object.h
    engines/titanic/game/parrot/parrot_lobby_view_object.cpp
    engines/titanic/game/parrot/parrot_lobby_view_object.h
    engines/titanic/game/parrot/parrot_loser.cpp
    engines/titanic/game/parrot/parrot_loser.h
    engines/titanic/game/parrot/parrot_nut_bowl_actor.cpp
    engines/titanic/game/parrot/parrot_nut_bowl_actor.h
    engines/titanic/game/parrot/parrot_nut_eater.cpp
    engines/titanic/game/parrot/parrot_nut_eater.h
    engines/titanic/game/parrot/parrot_perch_holder.cpp
    engines/titanic/game/parrot/parrot_perch_holder.h
    engines/titanic/game/parrot/parrot_succubus.cpp
    engines/titanic/game/parrot/parrot_succubus.h
    engines/titanic/game/parrot/parrot_trigger.cpp
    engines/titanic/game/parrot/parrot_trigger.h
    engines/titanic/game/parrot/player_meets_parrot.cpp
    engines/titanic/game/parrot/player_meets_parrot.h
    engines/titanic/game/pet/pet.cpp
    engines/titanic/game/pet/pet.h
    engines/titanic/game/pet/pet_class1.cpp
    engines/titanic/game/pet/pet_class1.h
    engines/titanic/game/pet/pet_class2.cpp
    engines/titanic/game/pet/pet_class2.h
    engines/titanic/game/pet/pet_class3.cpp
    engines/titanic/game/pet/pet_class3.h
    engines/titanic/game/pet/pet_lift.cpp
    engines/titanic/game/pet/pet_lift.h
    engines/titanic/game/pet/pet_monitor.cpp
    engines/titanic/game/pet/pet_monitor.h
    engines/titanic/game/pet/pet_pellerator.cpp
    engines/titanic/game/pet/pet_pellerator.h
    engines/titanic/game/pet/pet_position.cpp
    engines/titanic/game/pet/pet_position.h
    engines/titanic/game/pet/pet_sentinal.cpp
    engines/titanic/game/pet/pet_sentinal.h
    engines/titanic/game/pet/pet_sounds.cpp
    engines/titanic/game/pet/pet_sounds.h
    engines/titanic/game/pet/pet_transition.cpp
    engines/titanic/game/pet/pet_transition.h
    engines/titanic/game/pet/pet_transport.cpp
    engines/titanic/game/pet/pet_transport.h
    engines/titanic/game/pet_disabler.cpp
    engines/titanic/game/pet_disabler.h
    engines/titanic/game/phonograph.cpp
    engines/titanic/game/phonograph.h
    engines/titanic/game/phonograph_lid.cpp
    engines/titanic/game/phonograph_lid.h
    engines/titanic/game/pickup/pick_up.cpp
    engines/titanic/game/pickup/pick_up.h
    engines/titanic/game/pickup/pick_up_bar_glass.cpp
    engines/titanic/game/pickup/pick_up_bar_glass.h
    engines/titanic/game/pickup/pick_up_hose.cpp
    engines/titanic/game/pickup/pick_up_hose.h
    engines/titanic/game/pickup/pick_up_lemon.cpp
    engines/titanic/game/pickup/pick_up_lemon.h
    engines/titanic/game/pickup/pick_up_speech_centre.cpp
    engines/titanic/game/pickup/pick_up_speech_centre.h
    engines/titanic/game/pickup/pick_up_vis_centre.cpp
    engines/titanic/game/pickup/pick_up_vis_centre.h
    engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
    engines/titanic/game/placeholder/bar_shelf_vis_centre.h
    engines/titanic/game/placeholder/lemon_on_bar.cpp
    engines/titanic/game/placeholder/lemon_on_bar.h
    engines/titanic/game/placeholder/place_holder_item.cpp
    engines/titanic/game/placeholder/place_holder_item.h
    engines/titanic/game/placeholder/tv_on_bar.cpp
    engines/titanic/game/placeholder/tv_on_bar.h
    engines/titanic/game/play_music_button.cpp
    engines/titanic/game/play_music_button.h
    engines/titanic/game/play_on_act.cpp
    engines/titanic/game/play_on_act.h
    engines/titanic/game/port_hole.cpp
    engines/titanic/game/port_hole.h
    engines/titanic/game/record_phonograph_button.cpp
    engines/titanic/game/record_phonograph_button.h
    engines/titanic/game/replacement_ear.cpp
    engines/titanic/game/replacement_ear.h
    engines/titanic/game/reserved_table.cpp
    engines/titanic/game/reserved_table.h
    engines/titanic/game/restaurant_cylinder_holder.cpp
    engines/titanic/game/restaurant_cylinder_holder.h
    engines/titanic/game/restaurant_phonograph.cpp
    engines/titanic/game/restaurant_phonograph.h
    engines/titanic/game/sauce_dispensor.cpp
    engines/titanic/game/sauce_dispensor.h
    engines/titanic/game/search_point.cpp
    engines/titanic/game/search_point.h
    engines/titanic/game/season_background.cpp
    engines/titanic/game/season_background.h
    engines/titanic/game/season_barrel.cpp
    engines/titanic/game/season_barrel.h
    engines/titanic/game/seasonal_adjustment.cpp
    engines/titanic/game/seasonal_adjustment.h
    engines/titanic/game/service_elevator_window.cpp
    engines/titanic/game/service_elevator_window.h
    engines/titanic/game/sgt/armchair.cpp
    engines/titanic/game/sgt/armchair.h
    engines/titanic/game/sgt/basin.cpp
    engines/titanic/game/sgt/basin.h
    engines/titanic/game/sgt/bedfoot.cpp
    engines/titanic/game/sgt/bedfoot.h
    engines/titanic/game/sgt/bedhead.cpp
    engines/titanic/game/sgt/bedhead.h
    engines/titanic/game/sgt/chest_of_drawers.cpp
    engines/titanic/game/sgt/chest_of_drawers.h
    engines/titanic/game/sgt/desk.cpp
    engines/titanic/game/sgt/desk.h
    engines/titanic/game/sgt/deskchair.cpp
    engines/titanic/game/sgt/deskchair.h
    engines/titanic/game/sgt/drawer.cpp
    engines/titanic/game/sgt/drawer.h
    engines/titanic/game/sgt/sgt_doors.cpp
    engines/titanic/game/sgt/sgt_doors.h
    engines/titanic/game/sgt/sgt_nav.cpp
    engines/titanic/game/sgt/sgt_nav.h
    engines/titanic/game/sgt/sgt_navigation.cpp
    engines/titanic/game/sgt/sgt_navigation.h
    engines/titanic/game/sgt/sgt_restaurant_doors.cpp
    engines/titanic/game/sgt/sgt_restaurant_doors.h
    engines/titanic/game/sgt/sgt_state_control.cpp
    engines/titanic/game/sgt/sgt_state_control.h
    engines/titanic/game/sgt/sgt_state_room.cpp
    engines/titanic/game/sgt/sgt_state_room.h
    engines/titanic/game/sgt/sgt_tv.cpp
    engines/titanic/game/sgt/sgt_tv.h
    engines/titanic/game/sgt/sgt_upper_doors_sound.cpp
    engines/titanic/game/sgt/sgt_upper_doors_sound.h
    engines/titanic/game/sgt/toilet.cpp
    engines/titanic/game/sgt/toilet.h
    engines/titanic/game/sgt/vase.cpp
    engines/titanic/game/sgt/vase.h
    engines/titanic/game/sgt/washstand.cpp
    engines/titanic/game/sgt/washstand.h
    engines/titanic/game/ship_setting.cpp
    engines/titanic/game/ship_setting.h
    engines/titanic/game/ship_setting_button.cpp
    engines/titanic/game/ship_setting_button.h
    engines/titanic/game/show_cell_points.cpp
    engines/titanic/game/show_cell_points.h
    engines/titanic/game/speech_dispensor.cpp
    engines/titanic/game/speech_dispensor.h
    engines/titanic/game/splash_animation.cpp
    engines/titanic/game/splash_animation.h
    engines/titanic/game/starling_puret.cpp
    engines/titanic/game/starling_puret.h
    engines/titanic/game/start_action.cpp
    engines/titanic/game/start_action.h
    engines/titanic/game/stop_phonograph_button.cpp
    engines/titanic/game/stop_phonograph_button.h
    engines/titanic/game/sub_glass.cpp
    engines/titanic/game/sub_glass.h
    engines/titanic/game/sub_wrapper.cpp
    engines/titanic/game/sub_wrapper.h
    engines/titanic/game/sweet_bowl.cpp
    engines/titanic/game/sweet_bowl.h
    engines/titanic/game/television.cpp
    engines/titanic/game/television.h
    engines/titanic/game/third_class_canal.cpp
    engines/titanic/game/third_class_canal.h
    engines/titanic/game/throw_tv_down_well.cpp
    engines/titanic/game/throw_tv_down_well.h
    engines/titanic/game/titania_still_control.cpp
    engines/titanic/game/titania_still_control.h
    engines/titanic/game/tow_parrot_nav.cpp
    engines/titanic/game/tow_parrot_nav.h
    engines/titanic/game/transport/exit_pellerator.h
    engines/titanic/game/transport/gondolier.cpp
    engines/titanic/game/transport/gondolier.h
    engines/titanic/game/transport/lift.cpp
    engines/titanic/game/transport/lift.h
    engines/titanic/game/transport/lift_indicator.cpp
    engines/titanic/game/transport/lift_indicator.h
    engines/titanic/game/transport/pellerator.cpp
    engines/titanic/game/transport/pellerator.h
    engines/titanic/game/transport/service_elevator.cpp
    engines/titanic/game/transport/service_elevator.h
    engines/titanic/game/transport/transport.cpp
    engines/titanic/game/transport/transport.h
    engines/titanic/game/up_lighter.cpp
    engines/titanic/game/up_lighter.h
    engines/titanic/game/useless_lever.cpp
    engines/titanic/game/useless_lever.h
    engines/titanic/game/volume_control.cpp
    engines/titanic/game/volume_control.h
    engines/titanic/game/wheel_button.cpp
    engines/titanic/game/wheel_button.h
    engines/titanic/game/wheel_hotspot.cpp
    engines/titanic/game/wheel_hotspot.h
    engines/titanic/game/wheel_spin.cpp
    engines/titanic/game/wheel_spin.h
    engines/titanic/game/wheel_spin_horn.cpp
    engines/titanic/game/wheel_spin_horn.h
    engines/titanic/gfx/act_button.cpp
    engines/titanic/gfx/act_button.h
    engines/titanic/gfx/changes_season_button.cpp
    engines/titanic/gfx/changes_season_button.h
    engines/titanic/gfx/chev_left_off.cpp
    engines/titanic/gfx/chev_left_off.h
    engines/titanic/gfx/chev_left_on.cpp
    engines/titanic/gfx/chev_left_on.h
    engines/titanic/gfx/chev_right_off.cpp
    engines/titanic/gfx/chev_right_off.h
    engines/titanic/gfx/chev_right_on.cpp
    engines/titanic/gfx/chev_right_on.h
    engines/titanic/gfx/chev_send_rec_switch.cpp
    engines/titanic/gfx/chev_send_rec_switch.h
    engines/titanic/gfx/chev_switch.cpp
    engines/titanic/gfx/chev_switch.h
    engines/titanic/gfx/edit_control.cpp
    engines/titanic/gfx/edit_control.h
    engines/titanic/gfx/elevator_button.cpp
    engines/titanic/gfx/elevator_button.h
    engines/titanic/gfx/get_from_succ.cpp
    engines/titanic/gfx/get_from_succ.h
    engines/titanic/gfx/helmet_on_off.cpp
    engines/titanic/gfx/helmet_on_off.h
    engines/titanic/gfx/home_photo.cpp
    engines/titanic/gfx/home_photo.h
    engines/titanic/gfx/icon_nav_action.cpp
    engines/titanic/gfx/icon_nav_action.h
    engines/titanic/gfx/icon_nav_butt.cpp
    engines/titanic/gfx/icon_nav_butt.h
    engines/titanic/gfx/icon_nav_down.cpp
    engines/titanic/gfx/icon_nav_down.h
    engines/titanic/gfx/icon_nav_image.cpp
    engines/titanic/gfx/icon_nav_image.h
    engines/titanic/gfx/icon_nav_left.cpp
    engines/titanic/gfx/icon_nav_left.h
    engines/titanic/gfx/icon_nav_receive.cpp
    engines/titanic/gfx/icon_nav_receive.h
    engines/titanic/gfx/icon_nav_right.cpp
    engines/titanic/gfx/icon_nav_right.h
    engines/titanic/gfx/icon_nav_send.cpp
    engines/titanic/gfx/icon_nav_send.h
    engines/titanic/gfx/icon_nav_up.cpp
    engines/titanic/gfx/icon_nav_up.h
    engines/titanic/gfx/keybrd_butt.cpp
    engines/titanic/gfx/keybrd_butt.h
    engines/titanic/gfx/move_object_button.cpp
    engines/titanic/gfx/move_object_button.h
    engines/titanic/gfx/music_control.cpp
    engines/titanic/gfx/music_control.h
    engines/titanic/gfx/music_slider.cpp
    engines/titanic/gfx/music_slider.h
    engines/titanic/gfx/music_slider_pitch.h
    engines/titanic/gfx/music_slider_speed.h
    engines/titanic/gfx/music_switch.cpp
    engines/titanic/gfx/music_switch.h
    engines/titanic/gfx/music_switch_inversion.h
    engines/titanic/gfx/music_switch_reverse.h
    engines/titanic/gfx/music_voice_mute.h
    engines/titanic/gfx/send_to_succ.cpp
    engines/titanic/gfx/send_to_succ.h
    engines/titanic/gfx/sgt_selector.cpp
    engines/titanic/gfx/sgt_selector.h
    engines/titanic/gfx/slider_button.cpp
    engines/titanic/gfx/slider_button.h
    engines/titanic/gfx/small_chev_left_off.cpp
    engines/titanic/gfx/small_chev_left_off.h
    engines/titanic/gfx/small_chev_left_on.cpp
    engines/titanic/gfx/small_chev_left_on.h
    engines/titanic/gfx/small_chev_right_off.cpp
    engines/titanic/gfx/small_chev_right_off.h
    engines/titanic/gfx/small_chev_right_on.cpp
    engines/titanic/gfx/small_chev_right_on.h
    engines/titanic/gfx/st_button.cpp
    engines/titanic/gfx/st_button.h
    engines/titanic/gfx/status_change_button.cpp
    engines/titanic/gfx/status_change_button.h
    engines/titanic/gfx/text_down.cpp
    engines/titanic/gfx/text_down.h
    engines/titanic/gfx/text_skrew.cpp
    engines/titanic/gfx/text_skrew.h
    engines/titanic/gfx/text_up.cpp
    engines/titanic/gfx/text_up.h
    engines/titanic/gfx/toggle_button.cpp
    engines/titanic/gfx/toggle_button.h
    engines/titanic/gfx/toggle_switch.cpp
    engines/titanic/gfx/toggle_switch.h
    engines/titanic/messages/auto_sound_event.cpp
    engines/titanic/messages/auto_sound_event.h
    engines/titanic/messages/bilge_auto_sound_event.cpp
    engines/titanic/messages/bilge_auto_sound_event.h
    engines/titanic/messages/bilge_dispensor_event.cpp
    engines/titanic/messages/bilge_dispensor_event.h
    engines/titanic/messages/door_auto_sound_event.cpp
    engines/titanic/messages/door_auto_sound_event.h
    engines/titanic/messages/messages.cpp
    engines/titanic/messages/messages.h
    engines/titanic/messages/service_elevator_door.cpp
    engines/titanic/messages/service_elevator_door.h
    engines/titanic/moves/enter_bomb_room.cpp
    engines/titanic/moves/enter_bomb_room.h
    engines/titanic/moves/enter_bridge.cpp
    engines/titanic/moves/enter_bridge.h
    engines/titanic/moves/enter_exit_first_class_state.cpp
    engines/titanic/moves/enter_exit_first_class_state.h
    engines/titanic/moves/enter_exit_mini_lift.cpp
    engines/titanic/moves/enter_exit_mini_lift.h
    engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
    engines/titanic/moves/enter_exit_sec_class_mini_lift.h
    engines/titanic/moves/enter_exit_view.cpp
    engines/titanic/moves/enter_exit_view.h
    engines/titanic/moves/enter_sec_class_state.cpp
    engines/titanic/moves/enter_sec_class_state.h
    engines/titanic/moves/exit_arboretum.cpp
    engines/titanic/moves/exit_arboretum.h
    engines/titanic/moves/exit_bridge.cpp
    engines/titanic/moves/exit_bridge.h
    engines/titanic/moves/exit_lift.cpp
    engines/titanic/moves/exit_lift.h
    engines/titanic/moves/exit_pellerator.cpp
    engines/titanic/moves/exit_pellerator.h
    engines/titanic/moves/exit_state_room.cpp
    engines/titanic/moves/exit_state_room.h
    engines/titanic/moves/exit_tiania.cpp
    engines/titanic/moves/exit_tiania.h
    engines/titanic/moves/move_player_in_parrot_room.cpp
    engines/titanic/moves/move_player_in_parrot_room.h
    engines/titanic/moves/move_player_to.cpp
    engines/titanic/moves/move_player_to.h
    engines/titanic/moves/move_player_to_from.cpp
    engines/titanic/moves/move_player_to_from.h
    engines/titanic/moves/multi_move.cpp
    engines/titanic/moves/multi_move.h
    engines/titanic/moves/pan_from_pel.cpp
    engines/titanic/moves/pan_from_pel.h
    engines/titanic/moves/restaurant_pan_handler.cpp
    engines/titanic/moves/restaurant_pan_handler.h
    engines/titanic/moves/restricted_move.cpp
    engines/titanic/moves/restricted_move.h
    engines/titanic/moves/scraliontis_table.cpp
    engines/titanic/moves/scraliontis_table.h
    engines/titanic/moves/trip_down_canal.cpp
    engines/titanic/moves/trip_down_canal.h
    engines/titanic/npcs/barbot.cpp
    engines/titanic/npcs/barbot.h
    engines/titanic/npcs/bellbot.cpp
    engines/titanic/npcs/bellbot.h
    engines/titanic/npcs/callbot.cpp
    engines/titanic/npcs/callbot.h
    engines/titanic/npcs/character.cpp
    engines/titanic/npcs/character.h
    engines/titanic/npcs/deskbot.cpp
    engines/titanic/npcs/deskbot.h
    engines/titanic/npcs/doorbot.cpp
    engines/titanic/npcs/doorbot.h
    engines/titanic/npcs/liftbot.cpp
    engines/titanic/npcs/liftbot.h
    engines/titanic/npcs/maitre_d.cpp
    engines/titanic/npcs/maitre_d.h
    engines/titanic/npcs/mobile.cpp
    engines/titanic/npcs/mobile.h
    engines/titanic/npcs/parrot.cpp
    engines/titanic/npcs/parrot.h
    engines/titanic/npcs/robot_controller.cpp
    engines/titanic/npcs/robot_controller.h
    engines/titanic/npcs/starlings.cpp
    engines/titanic/npcs/starlings.h
    engines/titanic/npcs/succubus.cpp
    engines/titanic/npcs/succubus.h
    engines/titanic/npcs/summon_bots.cpp
    engines/titanic/npcs/summon_bots.h
    engines/titanic/npcs/titania.cpp
    engines/titanic/npcs/titania.h
    engines/titanic/npcs/true_talk_npc.cpp
    engines/titanic/npcs/true_talk_npc.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_drag_chev.cpp
    engines/titanic/pet_control/pet_drag_chev.h
    engines/titanic/pet_control/pet_graphic.cpp
    engines/titanic/pet_control/pet_graphic.h
    engines/titanic/pet_control/pet_graphic2.cpp
    engines/titanic/pet_control/pet_graphic2.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_leaf.cpp
    engines/titanic/pet_control/pet_leaf.h
    engines/titanic/pet_control/pet_message.h
    engines/titanic/pet_control/pet_mode_off.cpp
    engines/titanic/pet_control/pet_mode_off.h
    engines/titanic/pet_control/pet_mode_on.cpp
    engines/titanic/pet_control/pet_mode_on.h
    engines/titanic/pet_control/pet_mode_panel.cpp
    engines/titanic/pet_control/pet_mode_panel.h
    engines/titanic/pet_control/pet_pannel1.cpp
    engines/titanic/pet_control/pet_pannel1.h
    engines/titanic/pet_control/pet_pannel2.cpp
    engines/titanic/pet_control/pet_pannel2.h
    engines/titanic/pet_control/pet_pannel3.cpp
    engines/titanic/pet_control/pet_pannel3.h
    engines/titanic/pet_control/pet_real_life.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/pet_control/pet_rooms_glyphs.h
    engines/titanic/pet_control/pet_section.h
    engines/titanic/pet_control/pet_starfield.cpp
    engines/titanic/pet_control/pet_starfield.h
    engines/titanic/pet_control/pet_text.cpp
    engines/titanic/pet_control/pet_text.h
    engines/titanic/sound/auto_music_player.cpp
    engines/titanic/sound/auto_music_player.h
    engines/titanic/sound/auto_music_player_base.cpp
    engines/titanic/sound/auto_music_player_base.h
    engines/titanic/sound/auto_sound_player.cpp
    engines/titanic/sound/auto_sound_player.h
    engines/titanic/sound/auto_sound_player_adsr.cpp
    engines/titanic/sound/auto_sound_player_adsr.h
    engines/titanic/sound/background_sound_maker.cpp
    engines/titanic/sound/background_sound_maker.h
    engines/titanic/sound/bird_song.cpp
    engines/titanic/sound/bird_song.h
    engines/titanic/sound/dome_from_top_of_well.cpp
    engines/titanic/sound/dome_from_top_of_well.h
    engines/titanic/sound/enter_view_toggles_other_music.cpp
    engines/titanic/sound/enter_view_toggles_other_music.h
    engines/titanic/sound/gondolier_song.cpp
    engines/titanic/sound/gondolier_song.h
    engines/titanic/sound/music_player.cpp
    engines/titanic/sound/music_player.h
    engines/titanic/sound/node_auto_sound_player.cpp
    engines/titanic/sound/node_auto_sound_player.h
    engines/titanic/sound/restricted_auto_music_player.cpp
    engines/titanic/sound/restricted_auto_music_player.h
    engines/titanic/sound/room_auto_sound_player.cpp
    engines/titanic/sound/room_auto_sound_player.h
    engines/titanic/sound/room_trigger_auto_music_player.cpp
    engines/titanic/sound/room_trigger_auto_music_player.h
    engines/titanic/sound/season_noises.cpp
    engines/titanic/sound/season_noises.h
    engines/titanic/sound/seasonal_music_player.cpp
    engines/titanic/sound/seasonal_music_player.h
    engines/titanic/sound/titania_speech.cpp
    engines/titanic/sound/titania_speech.h
    engines/titanic/sound/trigger_auto_music_player.cpp
    engines/titanic/sound/trigger_auto_music_player.h
    engines/titanic/sound/view_auto_sound_player.cpp
    engines/titanic/sound/view_auto_sound_player.h
    engines/titanic/sound/view_toggles_other_music.cpp
    engines/titanic/sound/view_toggles_other_music.h
    engines/titanic/sound/water_lapping_sounds.cpp
    engines/titanic/sound/water_lapping_sounds.h
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control.h
    engines/titanic/star_control/star_control_sub11.cpp
    engines/titanic/star_control/star_control_sub11.h
    engines/titanic/star_control/star_control_sub12.cpp
    engines/titanic/star_control/star_control_sub12.h
    engines/titanic/star_control/star_control_sub13.cpp
    engines/titanic/star_control/star_control_sub13.h
    engines/titanic/star_control/star_control_sub14.cpp
    engines/titanic/star_control/star_control_sub14.h
    engines/titanic/star_control/star_control_sub8.h
    engines/titanic/support/movie_clip.cpp
    engines/titanic/support/movie_clip.h
    engines/titanic/support/movie_event.cpp
    engines/titanic/support/movie_event.h
    engines/titanic/support/movie_range_info.cpp
    engines/titanic/support/movie_range_info.h
    engines/titanic/support/time_event_info.cpp
    engines/titanic/support/time_event_info.h



diff --git a/engines/titanic/carry/arm.cpp b/engines/titanic/carry/arm.cpp
index ee58aea..880c93d 100644
--- a/engines/titanic/carry/arm.cpp
+++ b/engines/titanic/carry/arm.cpp
@@ -40,7 +40,7 @@ CArm::CArm() : CCarry(), _string6("Key"),
 	_armRect(220, 208, 409, 350) {
 }
 
-void CArm::save(SimpleFile *file, int indent) const {
+void CArm::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string6, indent);
 	file->writeNumberLine(_field138, indent);
diff --git a/engines/titanic/carry/arm.h b/engines/titanic/carry/arm.h
index f19943d..afef22b 100644
--- a/engines/titanic/carry/arm.h
+++ b/engines/titanic/carry/arm.h
@@ -55,7 +55,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/auditory_centre.cpp b/engines/titanic/carry/auditory_centre.cpp
index e5dedcd..d88989a 100644
--- a/engines/titanic/carry/auditory_centre.cpp
+++ b/engines/titanic/carry/auditory_centre.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CAuditoryCentre::save(SimpleFile *file, int indent) const {
+void CAuditoryCentre::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CBrain::save(file, indent);
 }
diff --git a/engines/titanic/carry/auditory_centre.h b/engines/titanic/carry/auditory_centre.h
index c429fd7..d4b9bee 100644
--- a/engines/titanic/carry/auditory_centre.h
+++ b/engines/titanic/carry/auditory_centre.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/bowl_ear.cpp b/engines/titanic/carry/bowl_ear.cpp
index 70d2409..bb5172e 100644
--- a/engines/titanic/carry/bowl_ear.cpp
+++ b/engines/titanic/carry/bowl_ear.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBowlEar::save(SimpleFile *file, int indent) const {
+void CBowlEar::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CEar::save(file, indent);
 }
diff --git a/engines/titanic/carry/bowl_ear.h b/engines/titanic/carry/bowl_ear.h
index 1617ced..39d5dc9 100644
--- a/engines/titanic/carry/bowl_ear.h
+++ b/engines/titanic/carry/bowl_ear.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/brain.cpp b/engines/titanic/carry/brain.cpp
index 1fe0c1b..8df0de9 100644
--- a/engines/titanic/carry/brain.cpp
+++ b/engines/titanic/carry/brain.cpp
@@ -36,7 +36,7 @@ END_MESSAGE_MAP()
 CBrain::CBrain() : CCarry(), _field134(0), _field138(0) {
 }
 
-void CBrain::save(SimpleFile *file, int indent) const {
+void CBrain::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writePoint(_pos1, indent);
 	file->writeNumberLine(_field134, indent);
diff --git a/engines/titanic/carry/brain.h b/engines/titanic/carry/brain.h
index 3e24f52..fd70a7e 100644
--- a/engines/titanic/carry/brain.h
+++ b/engines/titanic/carry/brain.h
@@ -48,7 +48,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/bridge_piece.cpp b/engines/titanic/carry/bridge_piece.cpp
index 1fe5e04..fc845fe 100644
--- a/engines/titanic/carry/bridge_piece.cpp
+++ b/engines/titanic/carry/bridge_piece.cpp
@@ -33,7 +33,7 @@ END_MESSAGE_MAP()
 CBridgePiece::CBridgePiece() : CCarry(), _field140(0) {
 }
 
-void CBridgePiece::save(SimpleFile *file, int indent) const {
+void CBridgePiece::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string6, indent);
 	file->writePoint(_pos3, indent);
diff --git a/engines/titanic/carry/bridge_piece.h b/engines/titanic/carry/bridge_piece.h
index 5041cbc..04bc7b9 100644
--- a/engines/titanic/carry/bridge_piece.h
+++ b/engines/titanic/carry/bridge_piece.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp
index ca022a6..75b3b6f 100644
--- a/engines/titanic/carry/carry.cpp
+++ b/engines/titanic/carry/carry.cpp
@@ -52,7 +52,7 @@ CCarry::CCarry() : CGameObject(), _fieldDC(0), _fieldE0(1),
 	_string4("It doesn't seem to want this.") {
 }
 
-void CCarry::save(SimpleFile *file, int indent) const {
+void CCarry::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
 	file->writePoint(_origPos, indent);
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index f447672..3658963 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -68,7 +68,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index b0916bb..cf96204 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -47,7 +47,7 @@ CCarryParrot::CCarryParrot() : CCarry(), _string6("PerchedParrot"),
 		_field148(25), _field14C(0), _field150(8) {
 }
 
-void CCarryParrot::save(SimpleFile *file, int indent) const {
+void CCarryParrot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string6, indent);
 	file->writeNumberLine(_timerId, indent);
diff --git a/engines/titanic/carry/carry_parrot.h b/engines/titanic/carry/carry_parrot.h
index 1c5cc2e..84c656c 100644
--- a/engines/titanic/carry/carry_parrot.h
+++ b/engines/titanic/carry/carry_parrot.h
@@ -57,7 +57,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/central_core.cpp b/engines/titanic/carry/central_core.cpp
index 97309e0..a50c95a 100644
--- a/engines/titanic/carry/central_core.cpp
+++ b/engines/titanic/carry/central_core.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CCentralCore::save(SimpleFile *file, int indent) const {
+void CCentralCore::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CBrain::save(file, indent);
 }
diff --git a/engines/titanic/carry/central_core.h b/engines/titanic/carry/central_core.h
index b397046..852d2b6 100644
--- a/engines/titanic/carry/central_core.h
+++ b/engines/titanic/carry/central_core.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/chicken.cpp b/engines/titanic/carry/chicken.cpp
index 60627bd..65404dc 100644
--- a/engines/titanic/carry/chicken.cpp
+++ b/engines/titanic/carry/chicken.cpp
@@ -45,7 +45,7 @@ CChicken::CChicken() : CCarry(), _string6("None"),
 		_field12C(1), _field13C(0), _timerId(0) {
 }
 
-void CChicken::save(SimpleFile *file, int indent) const {
+void CChicken::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field12C, indent);
 	file->writeQuotedLine(_string6, indent);
diff --git a/engines/titanic/carry/chicken.h b/engines/titanic/carry/chicken.h
index 946c102..e9e8f00 100644
--- a/engines/titanic/carry/chicken.h
+++ b/engines/titanic/carry/chicken.h
@@ -55,7 +55,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/crushed_tv.cpp b/engines/titanic/carry/crushed_tv.cpp
index 5abc8fa..a265b61 100644
--- a/engines/titanic/carry/crushed_tv.cpp
+++ b/engines/titanic/carry/crushed_tv.cpp
@@ -34,7 +34,7 @@ END_MESSAGE_MAP()
 CCrushedTV::CCrushedTV() : CCarry() {
 }
 
-void CCrushedTV::save(SimpleFile *file, int indent) const {
+void CCrushedTV::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CCarry::save(file, indent);
 }
diff --git a/engines/titanic/carry/crushed_tv.h b/engines/titanic/carry/crushed_tv.h
index 3e77534..d141589 100644
--- a/engines/titanic/carry/crushed_tv.h
+++ b/engines/titanic/carry/crushed_tv.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/ear.cpp b/engines/titanic/carry/ear.cpp
index d87b09d..8d85e24 100644
--- a/engines/titanic/carry/ear.cpp
+++ b/engines/titanic/carry/ear.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CEar::CEar() : CHeadPiece() {
 }
 
-void CEar::save(SimpleFile *file, int indent) const {
+void CEar::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CHeadPiece::save(file, indent);
 }
diff --git a/engines/titanic/carry/ear.h b/engines/titanic/carry/ear.h
index 2a20620..bdffdc2 100644
--- a/engines/titanic/carry/ear.h
+++ b/engines/titanic/carry/ear.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/eye.cpp b/engines/titanic/carry/eye.cpp
index 21fc3fa..5de1789 100644
--- a/engines/titanic/carry/eye.cpp
+++ b/engines/titanic/carry/eye.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CEye::CEye() : CHeadPiece(), _eyeNum(0) {
 }
 
-void CEye::save(SimpleFile *file, int indent) const {
+void CEye::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_eyeNum, indent);
 	CHeadPiece::save(file, indent);
diff --git a/engines/titanic/carry/eye.h b/engines/titanic/carry/eye.h
index f7e17fa..2531666 100644
--- a/engines/titanic/carry/eye.h
+++ b/engines/titanic/carry/eye.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/feathers.cpp b/engines/titanic/carry/feathers.cpp
index e89f335..c2cf369 100644
--- a/engines/titanic/carry/feathers.cpp
+++ b/engines/titanic/carry/feathers.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CFeathers, CCarry)
 CFeathers::CFeathers() : CCarry() {
 }
 
-void CFeathers::save(SimpleFile *file, int indent) const {
+void CFeathers::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CCarry::save(file, indent);
 }
diff --git a/engines/titanic/carry/feathers.h b/engines/titanic/carry/feathers.h
index f90de11..e2c8ab7 100644
--- a/engines/titanic/carry/feathers.h
+++ b/engines/titanic/carry/feathers.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/fruit.cpp b/engines/titanic/carry/fruit.cpp
index 3355d6e..832dccf 100644
--- a/engines/titanic/carry/fruit.cpp
+++ b/engines/titanic/carry/fruit.cpp
@@ -28,7 +28,7 @@ CFruit::CFruit() : CCarry(), _field12C(0),
 		_field130(0), _field134(0), _field138(0) {
 }
 
-void CFruit::save(SimpleFile *file, int indent) const {
+void CFruit::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field12C, indent);
 	file->writeNumberLine(_field130, indent);
diff --git a/engines/titanic/carry/fruit.h b/engines/titanic/carry/fruit.h
index 3d23afd..595f27d 100644
--- a/engines/titanic/carry/fruit.h
+++ b/engines/titanic/carry/fruit.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/glass.cpp b/engines/titanic/carry/glass.cpp
index 1f0e059..051457a 100644
--- a/engines/titanic/carry/glass.cpp
+++ b/engines/titanic/carry/glass.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CGlass::CGlass() : CCarry(), _string6("None") {
 }
 
-void CGlass::save(SimpleFile *file, int indent) const {
+void CGlass::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string6, indent);
 	CCarry::save(file, indent);
diff --git a/engines/titanic/carry/glass.h b/engines/titanic/carry/glass.h
index 55c0322..4e54015 100644
--- a/engines/titanic/carry/glass.h
+++ b/engines/titanic/carry/glass.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/hammer.cpp b/engines/titanic/carry/hammer.cpp
index f1dc3b2..d3b9121 100644
--- a/engines/titanic/carry/hammer.cpp
+++ b/engines/titanic/carry/hammer.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CHammer::CHammer() : CCarry() {
 }
 
-void CHammer::save(SimpleFile *file, int indent) const {
+void CHammer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CCarry::save(file, indent);
 }
diff --git a/engines/titanic/carry/hammer.h b/engines/titanic/carry/hammer.h
index e3180e7..e35fdd1 100644
--- a/engines/titanic/carry/hammer.h
+++ b/engines/titanic/carry/hammer.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/head_piece.cpp b/engines/titanic/carry/head_piece.cpp
index 1eab585..ae70964 100644
--- a/engines/titanic/carry/head_piece.cpp
+++ b/engines/titanic/carry/head_piece.cpp
@@ -28,7 +28,7 @@ CHeadPiece::CHeadPiece() : CCarry(), _string6("Not Working"),
 		_field12C(0), _field13C(0) {
 }
 
-void CHeadPiece::save(SimpleFile *file, int indent) const {
+void CHeadPiece::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field12C, indent);
 	file->writeQuotedLine(_string6, indent);
diff --git a/engines/titanic/carry/head_piece.h b/engines/titanic/carry/head_piece.h
index daa59255..1989b0e 100644
--- a/engines/titanic/carry/head_piece.h
+++ b/engines/titanic/carry/head_piece.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/hose.cpp b/engines/titanic/carry/hose.cpp
index 1617fef..747d58c 100644
--- a/engines/titanic/carry/hose.cpp
+++ b/engines/titanic/carry/hose.cpp
@@ -38,7 +38,7 @@ CHose::CHose() : CCarry(),
 	_string6("Succ-U-Bus auxiliary hose attachment incompatible with sliding glass cover.") {
 }
 
-void CHose::save(SimpleFile *file, int indent) const {
+void CHose::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_statics->_v1, indent);
 	file->writeQuotedLine(_statics->_v2, indent);
diff --git a/engines/titanic/carry/hose.h b/engines/titanic/carry/hose.h
index c16351b..d45fc08 100644
--- a/engines/titanic/carry/hose.h
+++ b/engines/titanic/carry/hose.h
@@ -46,7 +46,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/hose_end.cpp b/engines/titanic/carry/hose_end.cpp
index 6f15d5b..f6097c4 100644
--- a/engines/titanic/carry/hose_end.cpp
+++ b/engines/titanic/carry/hose_end.cpp
@@ -30,7 +30,7 @@ CHoseEnd::CHoseEnd() : CHose() {
 	_string6 = "Connection refused by remote hose.";
 }
 
-void CHoseEnd::save(SimpleFile *file, int indent) const {
+void CHoseEnd::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string6, indent);
 	CHose::save(file, indent);
diff --git a/engines/titanic/carry/hose_end.h b/engines/titanic/carry/hose_end.h
index 796191e..8a82ec5 100644
--- a/engines/titanic/carry/hose_end.h
+++ b/engines/titanic/carry/hose_end.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/key.cpp b/engines/titanic/carry/key.cpp
index 2c559bb..6e94746 100644
--- a/engines/titanic/carry/key.cpp
+++ b/engines/titanic/carry/key.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CKey::CKey() : CCarry() {
 }
 
-void CKey::save(SimpleFile *file, int indent) const {
+void CKey::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CCarry::save(file, indent);
 }
diff --git a/engines/titanic/carry/key.h b/engines/titanic/carry/key.h
index e6973b5..6b7a134 100644
--- a/engines/titanic/carry/key.h
+++ b/engines/titanic/carry/key.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/liftbot_head.cpp b/engines/titanic/carry/liftbot_head.cpp
index 422d88a..bcab8e8 100644
--- a/engines/titanic/carry/liftbot_head.cpp
+++ b/engines/titanic/carry/liftbot_head.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CLiftbotHead::CLiftbotHead() : CCarry(), _field12C(0) {
 }
 
-void CLiftbotHead::save(SimpleFile *file, int indent) const {
+void CLiftbotHead::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field12C, indent);
 	CCarry::save(file, indent);
diff --git a/engines/titanic/carry/liftbot_head.h b/engines/titanic/carry/liftbot_head.h
index f2b60c1..9dc6250 100644
--- a/engines/titanic/carry/liftbot_head.h
+++ b/engines/titanic/carry/liftbot_head.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/long_stick.cpp b/engines/titanic/carry/long_stick.cpp
index d5bf73b..ab1e42b 100644
--- a/engines/titanic/carry/long_stick.cpp
+++ b/engines/titanic/carry/long_stick.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CLongStick::CLongStick() : CCarry() {
 }
 
-void CLongStick::save(SimpleFile *file, int indent) const {
+void CLongStick::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CCarry::save(file, indent);
 }
diff --git a/engines/titanic/carry/long_stick.h b/engines/titanic/carry/long_stick.h
index e2718a3..60bff0d 100644
--- a/engines/titanic/carry/long_stick.h
+++ b/engines/titanic/carry/long_stick.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/magazine.cpp b/engines/titanic/carry/magazine.cpp
index 68d898c..cdf92fc 100644
--- a/engines/titanic/carry/magazine.cpp
+++ b/engines/titanic/carry/magazine.cpp
@@ -35,7 +35,7 @@ END_MESSAGE_MAP()
 CMagazine::CMagazine() : CCarry() {
 }
 
-void CMagazine::save(SimpleFile *file, int indent) const {
+void CMagazine::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field12C, indent);
 	file->writeNumberLine(_field130, indent);
diff --git a/engines/titanic/carry/magazine.h b/engines/titanic/carry/magazine.h
index 16ef4bb..afe9598 100644
--- a/engines/titanic/carry/magazine.h
+++ b/engines/titanic/carry/magazine.h
@@ -45,7 +45,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/maitred_left_arm.cpp b/engines/titanic/carry/maitred_left_arm.cpp
index 6fb93ec..b31c2a6f6 100644
--- a/engines/titanic/carry/maitred_left_arm.cpp
+++ b/engines/titanic/carry/maitred_left_arm.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMaitreDLeftArm::save(SimpleFile *file, int indent) const {
+void CMaitreDLeftArm::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field174, indent);
 	CArm::save(file, indent);
diff --git a/engines/titanic/carry/maitred_left_arm.h b/engines/titanic/carry/maitred_left_arm.h
index e46485c..e59d84e 100644
--- a/engines/titanic/carry/maitred_left_arm.h
+++ b/engines/titanic/carry/maitred_left_arm.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/maitred_right_arm.cpp b/engines/titanic/carry/maitred_right_arm.cpp
index 15767a2..7030e83 100644
--- a/engines/titanic/carry/maitred_right_arm.cpp
+++ b/engines/titanic/carry/maitred_right_arm.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMaitreDRightArm::save(SimpleFile *file, int indent) const {
+void CMaitreDRightArm::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CArm::save(file, indent);
 }
diff --git a/engines/titanic/carry/maitred_right_arm.h b/engines/titanic/carry/maitred_right_arm.h
index c89b7e8..f8a7861 100644
--- a/engines/titanic/carry/maitred_right_arm.h
+++ b/engines/titanic/carry/maitred_right_arm.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/mouth.cpp b/engines/titanic/carry/mouth.cpp
index 058ffc4..8c3791f 100644
--- a/engines/titanic/carry/mouth.cpp
+++ b/engines/titanic/carry/mouth.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CMouth::CMouth() : CHeadPiece() {
 }
 
-void CMouth::save(SimpleFile *file, int indent) const {
+void CMouth::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CHeadPiece::save(file, indent);
 }
diff --git a/engines/titanic/carry/mouth.h b/engines/titanic/carry/mouth.h
index 1c446b2..0efaf73 100644
--- a/engines/titanic/carry/mouth.h
+++ b/engines/titanic/carry/mouth.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/napkin.cpp b/engines/titanic/carry/napkin.cpp
index cba2b4a..ace5a38 100644
--- a/engines/titanic/carry/napkin.cpp
+++ b/engines/titanic/carry/napkin.cpp
@@ -32,7 +32,7 @@ END_MESSAGE_MAP()
 CNapkin::CNapkin() : CCarry() {
 }
 
-void CNapkin::save(SimpleFile *file, int indent) const {
+void CNapkin::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CCarry::save(file, indent);
 }
diff --git a/engines/titanic/carry/napkin.h b/engines/titanic/carry/napkin.h
index ac14b70..b94a618 100644
--- a/engines/titanic/carry/napkin.h
+++ b/engines/titanic/carry/napkin.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/nose.cpp b/engines/titanic/carry/nose.cpp
index cd5085d..4f3afe2 100644
--- a/engines/titanic/carry/nose.cpp
+++ b/engines/titanic/carry/nose.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CNose::CNose() : CHeadPiece() {
 }
 
-void CNose::save(SimpleFile *file, int indent) const {
+void CNose::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CHeadPiece::save(file, indent);
 }
diff --git a/engines/titanic/carry/nose.h b/engines/titanic/carry/nose.h
index 717b639..337617c 100644
--- a/engines/titanic/carry/nose.h
+++ b/engines/titanic/carry/nose.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/note.cpp b/engines/titanic/carry/note.cpp
index 78286d7..388f87e 100644
--- a/engines/titanic/carry/note.cpp
+++ b/engines/titanic/carry/note.cpp
@@ -31,7 +31,7 @@ END_MESSAGE_MAP()
 CNote::CNote() : CCarry(), _field138(1) {
 }
 
-void CNote::save(SimpleFile *file, int indent) const {
+void CNote::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string6, indent);
 	file->writeNumberLine(_field138, indent);
diff --git a/engines/titanic/carry/note.h b/engines/titanic/carry/note.h
index 22a95b0..f0563f5 100644
--- a/engines/titanic/carry/note.h
+++ b/engines/titanic/carry/note.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/parcel.cpp b/engines/titanic/carry/parcel.cpp
index d532bac..13e2f6d 100644
--- a/engines/titanic/carry/parcel.cpp
+++ b/engines/titanic/carry/parcel.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CParcel, CCarry)
 CParcel::CParcel() : CCarry() {
 }
 
-void CParcel::save(SimpleFile *file, int indent) const {
+void CParcel::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CCarry::save(file, indent);
 }
diff --git a/engines/titanic/carry/parcel.h b/engines/titanic/carry/parcel.h
index cb36bed..7209bd3 100644
--- a/engines/titanic/carry/parcel.h
+++ b/engines/titanic/carry/parcel.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/perch.cpp b/engines/titanic/carry/perch.cpp
index 976921b..281b3fc 100644
--- a/engines/titanic/carry/perch.cpp
+++ b/engines/titanic/carry/perch.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPerch::save(SimpleFile *file, int indent) const {
+void CPerch::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CCentralCore::save(file, indent);
 }
diff --git a/engines/titanic/carry/perch.h b/engines/titanic/carry/perch.h
index 1ed2cca..ef04d11 100644
--- a/engines/titanic/carry/perch.h
+++ b/engines/titanic/carry/perch.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/phonograph_cylinder.cpp b/engines/titanic/carry/phonograph_cylinder.cpp
index d7b9fe6..0684c56 100644
--- a/engines/titanic/carry/phonograph_cylinder.cpp
+++ b/engines/titanic/carry/phonograph_cylinder.cpp
@@ -46,7 +46,7 @@ CPhonographCylinder::CPhonographCylinder() : CCarry(),
 		_bassInversionControl(false) {
 }
 
-void CPhonographCylinder::save(SimpleFile *file, int indent) const {
+void CPhonographCylinder::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_itemName, indent);
 	file->writeNumberLine(_bellsMuteControl, indent);
diff --git a/engines/titanic/carry/phonograph_cylinder.h b/engines/titanic/carry/phonograph_cylinder.h
index 8c4ca64..2f950d1 100644
--- a/engines/titanic/carry/phonograph_cylinder.h
+++ b/engines/titanic/carry/phonograph_cylinder.h
@@ -63,7 +63,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/phonograph_ear.cpp b/engines/titanic/carry/phonograph_ear.cpp
index 0b4142c..ceb71ba 100644
--- a/engines/titanic/carry/phonograph_ear.cpp
+++ b/engines/titanic/carry/phonograph_ear.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPhonographEar::save(SimpleFile *file, int indent) const {
+void CPhonographEar::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field140, indent);
 	CEar::save(file, indent);
diff --git a/engines/titanic/carry/phonograph_ear.h b/engines/titanic/carry/phonograph_ear.h
index 71ef38f..d450f28 100644
--- a/engines/titanic/carry/phonograph_ear.h
+++ b/engines/titanic/carry/phonograph_ear.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/photograph.cpp b/engines/titanic/carry/photograph.cpp
index 7f76f39..7f32a06 100644
--- a/engines/titanic/carry/photograph.cpp
+++ b/engines/titanic/carry/photograph.cpp
@@ -37,7 +37,7 @@ int CPhotograph::_v1;
 CPhotograph::CPhotograph() : CCarry(), _field12C(0), _field130(0) {
 }
 
-void CPhotograph::save(SimpleFile *file, int indent) const {
+void CPhotograph::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field12C, indent);
 	file->writeNumberLine(_v1, indent);
diff --git a/engines/titanic/carry/photograph.h b/engines/titanic/carry/photograph.h
index b7ce488..3161e48 100644
--- a/engines/titanic/carry/photograph.h
+++ b/engines/titanic/carry/photograph.h
@@ -48,7 +48,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/plug_in.cpp b/engines/titanic/carry/plug_in.cpp
index e4fe54d..c82a4cc 100644
--- a/engines/titanic/carry/plug_in.cpp
+++ b/engines/titanic/carry/plug_in.cpp
@@ -31,7 +31,7 @@ END_MESSAGE_MAP()
 CPlugIn::CPlugIn() : CCarry(), _field12C(0) {
 }
 
-void CPlugIn::save(SimpleFile *file, int indent) const {
+void CPlugIn::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CCarry::save(file, indent);
 }
diff --git a/engines/titanic/carry/plug_in.h b/engines/titanic/carry/plug_in.h
index f48a74b..e788d15 100644
--- a/engines/titanic/carry/plug_in.h
+++ b/engines/titanic/carry/plug_in.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/speech_centre.cpp b/engines/titanic/carry/speech_centre.cpp
index 86ed730..b8076ae 100644
--- a/engines/titanic/carry/speech_centre.cpp
+++ b/engines/titanic/carry/speech_centre.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CSpeechCentre::save(SimpleFile *file, int indent) const {
+void CSpeechCentre::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field13C, indent);
 	file->writeQuotedLine(_string1, indent);
diff --git a/engines/titanic/carry/speech_centre.h b/engines/titanic/carry/speech_centre.h
index 8f6fdfd..e16556e 100644
--- a/engines/titanic/carry/speech_centre.h
+++ b/engines/titanic/carry/speech_centre.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/sweets.cpp b/engines/titanic/carry/sweets.cpp
index 71295a3..f19a828 100644
--- a/engines/titanic/carry/sweets.cpp
+++ b/engines/titanic/carry/sweets.cpp
@@ -31,7 +31,7 @@ END_MESSAGE_MAP()
 CSweets::CSweets() : CCarry() {
 }
 
-void CSweets::save(SimpleFile *file, int indent) const {
+void CSweets::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CCarry::save(file, indent);
 }
diff --git a/engines/titanic/carry/sweets.h b/engines/titanic/carry/sweets.h
index 7fc0787..8eb0a16 100644
--- a/engines/titanic/carry/sweets.h
+++ b/engines/titanic/carry/sweets.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/test_carry.cpp b/engines/titanic/carry/test_carry.cpp
index 26b4f56..0e86c51 100644
--- a/engines/titanic/carry/test_carry.cpp
+++ b/engines/titanic/carry/test_carry.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CTestArray::save(SimpleFile *file, int indent) const {
+void CTestArray::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value1, indent);
 	file->writeNumberLine(_value2, indent);
diff --git a/engines/titanic/carry/test_carry.h b/engines/titanic/carry/test_carry.h
index 56526b4..b9591a7 100644
--- a/engines/titanic/carry/test_carry.h
+++ b/engines/titanic/carry/test_carry.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/carry/vision_centre.cpp b/engines/titanic/carry/vision_centre.cpp
index b85f99f..8c8bab1 100644
--- a/engines/titanic/carry/vision_centre.cpp
+++ b/engines/titanic/carry/vision_centre.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CVisionCentre::save(SimpleFile *file, int indent) const {
+void CVisionCentre::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CBrain::save(file, indent);
 }
diff --git a/engines/titanic/carry/vision_centre.h b/engines/titanic/carry/vision_centre.h
index ce1d959..6cf2d9d 100644
--- a/engines/titanic/carry/vision_centre.h
+++ b/engines/titanic/carry/vision_centre.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/background.cpp b/engines/titanic/core/background.cpp
index 52ff4c4..f180df8 100644
--- a/engines/titanic/core/background.cpp
+++ b/engines/titanic/core/background.cpp
@@ -33,7 +33,7 @@ END_MESSAGE_MAP()
 CBackground::CBackground() : CGameObject(), _fieldBC(0), _fieldC0(0), _fieldDC(0) {
 }
 
-void CBackground::save(SimpleFile *file, int indent) const {
+void CBackground::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/core/background.h b/engines/titanic/core/background.h
index f4969d4..ef9a6c3 100644
--- a/engines/titanic/core/background.h
+++ b/engines/titanic/core/background.h
@@ -46,7 +46,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/click_responder.cpp b/engines/titanic/core/click_responder.cpp
index 9e8564b..f969455 100644
--- a/engines/titanic/core/click_responder.cpp
+++ b/engines/titanic/core/click_responder.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CClickResponder::save(SimpleFile *file, int indent) const {
+void CClickResponder::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
 	file->writeQuotedLine(_string2, indent);
diff --git a/engines/titanic/core/click_responder.h b/engines/titanic/core/click_responder.h
index 68d3e34..c682530 100644
--- a/engines/titanic/core/click_responder.h
+++ b/engines/titanic/core/click_responder.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/dont_save_file_item.cpp b/engines/titanic/core/dont_save_file_item.cpp
index 00b7dd2..87ab77e 100644
--- a/engines/titanic/core/dont_save_file_item.cpp
+++ b/engines/titanic/core/dont_save_file_item.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CDontSaveFileItem, CFileItem)
 
-void CDontSaveFileItem::save(SimpleFile *file, int indent) const {
+void CDontSaveFileItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
 }
 
diff --git a/engines/titanic/core/dont_save_file_item.h b/engines/titanic/core/dont_save_file_item.h
index 7517976..242e373 100644
--- a/engines/titanic/core/dont_save_file_item.h
+++ b/engines/titanic/core/dont_save_file_item.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/drop_target.cpp b/engines/titanic/core/drop_target.cpp
index 9782967..05ea644 100644
--- a/engines/titanic/core/drop_target.cpp
+++ b/engines/titanic/core/drop_target.cpp
@@ -29,7 +29,7 @@ CDropTarget::CDropTarget() : CGameObject(), _fieldC4(0),
 	_fieldFC(0), _field10C(1), _field110(8), _field114(20) {
 }
 
-void CDropTarget::save(SimpleFile *file, int indent) const {
+void CDropTarget::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writePoint(_pos1, indent);
 	file->writeNumberLine(_fieldC4, indent);
diff --git a/engines/titanic/core/drop_target.h b/engines/titanic/core/drop_target.h
index 6c1cdcf..99734d7 100644
--- a/engines/titanic/core/drop_target.h
+++ b/engines/titanic/core/drop_target.h
@@ -50,7 +50,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/file_item.cpp b/engines/titanic/core/file_item.cpp
index 566f910..824195d 100644
--- a/engines/titanic/core/file_item.cpp
+++ b/engines/titanic/core/file_item.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CFileItem, CTreeItem)
 
-void CFileItem::save(SimpleFile *file, int indent) const {
+void CFileItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
 	CTreeItem::save(file, indent);
 }
diff --git a/engines/titanic/core/file_item.h b/engines/titanic/core/file_item.h
index e8e4935..4210251 100644
--- a/engines/titanic/core/file_item.h
+++ b/engines/titanic/core/file_item.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index af866dd..29ad735 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -80,7 +80,7 @@ CGameObject::~CGameObject() {
 	delete _text;
 }
 
-void CGameObject::save(SimpleFile *file, int indent) const {
+void CGameObject::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(7, indent);
 	error("TODO: CGameObject::save");
 
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 98d6d60..1afe834 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -523,7 +523,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/game_object_desc_item.cpp b/engines/titanic/core/game_object_desc_item.cpp
index 77174e5..409334c 100644
--- a/engines/titanic/core/game_object_desc_item.cpp
+++ b/engines/titanic/core/game_object_desc_item.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CGameObjectDescItem::CGameObjectDescItem(): CTreeItem() {
 }
 
-void CGameObjectDescItem::save(SimpleFile *file, int indent) const {
+void CGameObjectDescItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	_clipList.save(file, indent);
 	file->writeQuotedLine(_string1, indent);
diff --git a/engines/titanic/core/game_object_desc_item.h b/engines/titanic/core/game_object_desc_item.h
index 5bfc483..df9ef7b 100644
--- a/engines/titanic/core/game_object_desc_item.h
+++ b/engines/titanic/core/game_object_desc_item.h
@@ -43,7 +43,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp
index a0460bd..a56122f 100644
--- a/engines/titanic/core/link_item.cpp
+++ b/engines/titanic/core/link_item.cpp
@@ -43,7 +43,7 @@ CString CLinkItem::formName() {
 	return "";
 }
 
-void CLinkItem::save(SimpleFile *file, int indent) const {
+void CLinkItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(2, indent);
 	file->writeQuotedLine("L", indent);
 	file->writeNumberLine(_cursorId, indent + 1);
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index 328d5bc..09f3a7a 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -56,7 +56,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/list.cpp b/engines/titanic/core/list.cpp
index d733ce2..8e90e9f 100644
--- a/engines/titanic/core/list.cpp
+++ b/engines/titanic/core/list.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void ListItem::save(SimpleFile *file, int indent) const {
+void ListItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
 }
 
diff --git a/engines/titanic/core/list.h b/engines/titanic/core/list.h
index 4052a01..eb87d7f 100644
--- a/engines/titanic/core/list.h
+++ b/engines/titanic/core/list.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
@@ -76,7 +76,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const {
+	virtual void save(SimpleFile *file, int indent) {
 		file->writeNumberLine(0, indent);
 
 		// Write out number of items
@@ -84,9 +84,9 @@ public:
 		file->writeNumberLine(Common::List<T *>::size(), indent);
 
 		// Iterate through writing entries
-		typename Common::List<T *>::const_iterator i;
+		typename Common::List<T *>::iterator i;
 		for (i = Common::List<T *>::begin(); i != Common::List<T *>::end(); ++i) {
-			const ListItem *item = *i;
+			ListItem *item = *i;
 			item->saveHeader(file, indent);
 			item->save(file, indent + 1);
 			item->saveFooter(file, indent);
diff --git a/engines/titanic/core/mail_man.cpp b/engines/titanic/core/mail_man.cpp
index 8226ebf..afe13be 100644
--- a/engines/titanic/core/mail_man.cpp
+++ b/engines/titanic/core/mail_man.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMailMan::save(SimpleFile *file, int indent) const {
+void CMailMan::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/core/mail_man.h b/engines/titanic/core/mail_man.h
index 982aae4..27a6cd1 100644
--- a/engines/titanic/core/mail_man.h
+++ b/engines/titanic/core/mail_man.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/message_target.cpp b/engines/titanic/core/message_target.cpp
index b99fa5c..4815d03 100644
--- a/engines/titanic/core/message_target.cpp
+++ b/engines/titanic/core/message_target.cpp
@@ -37,7 +37,7 @@ const MSGMAP *CMessageTarget::getThisMessageMap() {
 	return &messageMap;
 }
 
-void CMessageTarget::save(SimpleFile *file, int indent) const {
+void CMessageTarget::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
 	CSaveableObject::save(file, indent);
 }
diff --git a/engines/titanic/core/message_target.h b/engines/titanic/core/message_target.h
index 42e9e5a..5508c47 100644
--- a/engines/titanic/core/message_target.h
+++ b/engines/titanic/core/message_target.h
@@ -90,7 +90,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/multi_drop_target.cpp b/engines/titanic/core/multi_drop_target.cpp
index 1f6e6cf..f299819 100644
--- a/engines/titanic/core/multi_drop_target.cpp
+++ b/engines/titanic/core/multi_drop_target.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMultiDropTarget::save(SimpleFile *file, int indent) const {
+void CMultiDropTarget::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string5, indent);
 	file->writeQuotedLine(_string6, indent);
diff --git a/engines/titanic/core/multi_drop_target.h b/engines/titanic/core/multi_drop_target.h
index ddf20e4..22cc094 100644
--- a/engines/titanic/core/multi_drop_target.h
+++ b/engines/titanic/core/multi_drop_target.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/named_item.cpp b/engines/titanic/core/named_item.cpp
index 981627a..2b741f7 100644
--- a/engines/titanic/core/named_item.cpp
+++ b/engines/titanic/core/named_item.cpp
@@ -36,7 +36,7 @@ CString CNamedItem::dumpItem(int indent) const {
 	return result;
 }
 
-void CNamedItem::save(SimpleFile *file, int indent) const {
+void CNamedItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
 	file->writeQuotedLine(_name, indent);
 
diff --git a/engines/titanic/core/named_item.h b/engines/titanic/core/named_item.h
index 9763e1b..889a847 100644
--- a/engines/titanic/core/named_item.h
+++ b/engines/titanic/core/named_item.h
@@ -46,7 +46,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/node_item.cpp b/engines/titanic/core/node_item.cpp
index 57acbdb..79188dd 100644
--- a/engines/titanic/core/node_item.cpp
+++ b/engines/titanic/core/node_item.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CNodeItem, CNamedItem)
 CNodeItem::CNodeItem() : CNamedItem(), _nodeNumber(0) {
 }
 
-void CNodeItem::save(SimpleFile *file, int indent) const {
+void CNodeItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
 	file->writeQuotedLine("N", indent);
 	file->writeNumberLine(_nodePos.x, indent + 1);
diff --git a/engines/titanic/core/node_item.h b/engines/titanic/core/node_item.h
index 85003bf..ff57448 100644
--- a/engines/titanic/core/node_item.h
+++ b/engines/titanic/core/node_item.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 586301b..a768d0e 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -43,7 +43,7 @@ static const char *const SAVEGAME_STR = "TNIC";
 
 EMPTY_MESSAGE_MAP(CProjectItem, CFileItem)
 
-void CFileListItem::save(SimpleFile *file, int indent) const {
+void CFileListItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
 	file->writeQuotedLine(_name, indent);
 
@@ -63,7 +63,7 @@ CProjectItem::CProjectItem() : _nextRoomNumber(0), _nextMessageNumber(0),
 		_nextObjectNumber(0), _gameManager(nullptr) {
 }
 
-void CProjectItem::save(SimpleFile *file, int indent) const {
+void CProjectItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(6, indent);
 	file->writeQuotedLine("Next Avail. Object Number", indent);
 	file->writeNumberLine(_nextObjectNumber, indent);
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index d0b8d77..9270bdf 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -61,7 +61,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
@@ -156,7 +156,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/resource_key.cpp b/engines/titanic/core/resource_key.cpp
index a6a0615..3b390af 100644
--- a/engines/titanic/core/resource_key.cpp
+++ b/engines/titanic/core/resource_key.cpp
@@ -27,7 +27,7 @@
 
 namespace Titanic {
 
-void CResourceKey::save(SimpleFile *file, int indent) const {
+void CResourceKey::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine("Resource Key...", indent);
 	file->writeQuotedLine(_key, indent);
diff --git a/engines/titanic/core/resource_key.h b/engines/titanic/core/resource_key.h
index 8a6f86f..eb08334 100644
--- a/engines/titanic/core/resource_key.h
+++ b/engines/titanic/core/resource_key.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp
index b3a3fe4..78bd678 100644
--- a/engines/titanic/core/room_item.cpp
+++ b/engines/titanic/core/room_item.cpp
@@ -30,7 +30,7 @@ CRoomItem::CRoomItem() : CNamedItem(), _roomNumber(0),
 		_roomDimensionX(0.0), _roomDimensionY(0.0) {
 }
 
-void CRoomItem::save(SimpleFile *file, int indent) const {
+void CRoomItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(3, indent);
 	file->writeQuotedLine("Exit Movies", indent);
 	_exitMovieKey.save(file, indent);
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index eb7f4c4..bcdc95e 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -52,7 +52,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index ad98ac4..d3c64a1 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -1614,7 +1614,7 @@ CSaveableObject *CSaveableObject::createInstance(const Common::String &name) {
 	return (*_classList)[name]();
 }
 
-void CSaveableObject::save(SimpleFile *file, int indent) const {
+void CSaveableObject::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
 }
 
@@ -1622,11 +1622,11 @@ void CSaveableObject::load(SimpleFile *file) {
 	file->readNumber();
 }
 
-void CSaveableObject::saveHeader(SimpleFile *file, int indent) const {
+void CSaveableObject::saveHeader(SimpleFile *file, int indent) {
 	file->writeClassStart(getType()->_className, indent);
 }
 
-void CSaveableObject::saveFooter(SimpleFile *file, int indent) const {
+void CSaveableObject::saveFooter(SimpleFile *file, int indent) {
 	file->writeClassEnd(indent);
 }
 
diff --git a/engines/titanic/core/saveable_object.h b/engines/titanic/core/saveable_object.h
index e067df2..6d80ad1 100644
--- a/engines/titanic/core/saveable_object.h
+++ b/engines/titanic/core/saveable_object.h
@@ -85,7 +85,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
@@ -96,13 +96,13 @@ public:
 	 * Write out a header definition for the class to file
 	 * prior to saving the actual data for the class
 	 */
-	virtual void saveHeader(SimpleFile *file, int indent) const;
+	virtual void saveHeader(SimpleFile *file, int indent);
 	
 	/**
 	 * Writes out a footer for the class after it's data has
 	 * been written to file
 	 */
-	virtual void saveFooter(SimpleFile *file, int indent) const;
+	virtual void saveFooter(SimpleFile *file, int indent);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/core/static_image.cpp b/engines/titanic/core/static_image.cpp
index cc8e1dd..6728610 100644
--- a/engines/titanic/core/static_image.cpp
+++ b/engines/titanic/core/static_image.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CStaticImage, CGameObject)
 
-void CStaticImage::save(SimpleFile *file, int indent) const {
+void CStaticImage::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/core/static_image.h b/engines/titanic/core/static_image.h
index 953cf4d..27f861e 100644
--- a/engines/titanic/core/static_image.h
+++ b/engines/titanic/core/static_image.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 21496ee..de3d87e 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -65,7 +65,7 @@ CString CTreeItem::dumpItem(int indent) const {
 	return result;
 }
 
-void CTreeItem::save(SimpleFile *file, int indent) const {
+void CTreeItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
 	CMessageTarget::save(file, indent);
 }
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 77d7aa5..a15a5ae 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -62,7 +62,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/turn_on_object.cpp b/engines/titanic/core/turn_on_object.cpp
index a24843b..221602b 100644
--- a/engines/titanic/core/turn_on_object.cpp
+++ b/engines/titanic/core/turn_on_object.cpp
@@ -32,7 +32,7 @@ END_MESSAGE_MAP()
 CTurnOnObject::CTurnOnObject() : CBackground(), _msgName("NULL") {
 }
 
-void CTurnOnObject::save(SimpleFile *file, int indent) const {
+void CTurnOnObject::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_msgName, indent);
 
diff --git a/engines/titanic/core/turn_on_object.h b/engines/titanic/core/turn_on_object.h
index 3ac5a89..7150069 100644
--- a/engines/titanic/core/turn_on_object.h
+++ b/engines/titanic/core/turn_on_object.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/turn_on_play_sound.cpp b/engines/titanic/core/turn_on_play_sound.cpp
index d56aef8..2f9dba2 100644
--- a/engines/titanic/core/turn_on_play_sound.cpp
+++ b/engines/titanic/core/turn_on_play_sound.cpp
@@ -28,7 +28,7 @@ CTurnOnPlaySound::CTurnOnPlaySound() : CTurnOnObject(),
 		_string3("NULL"), _fieldF8(80), _fieldFC(0) {
 }
 
-void CTurnOnPlaySound::save(SimpleFile *file, int indent) const {
+void CTurnOnPlaySound::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string3, indent);
 	file->writeNumberLine(_fieldF8, indent);
diff --git a/engines/titanic/core/turn_on_play_sound.h b/engines/titanic/core/turn_on_play_sound.h
index 263709b..58d33ab 100644
--- a/engines/titanic/core/turn_on_play_sound.h
+++ b/engines/titanic/core/turn_on_play_sound.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/turn_on_turn_off.cpp b/engines/titanic/core/turn_on_turn_off.cpp
index a6a65e3..d43ddf7 100644
--- a/engines/titanic/core/turn_on_turn_off.cpp
+++ b/engines/titanic/core/turn_on_turn_off.cpp
@@ -28,7 +28,7 @@ CTurnOnTurnOff::CTurnOnTurnOff() : CBackground(), _fieldE0(0),
 	_fieldE4(0), _fieldE8(0), _fieldEC(0), _fieldF0(0) {
 }
 
-void CTurnOnTurnOff::save(SimpleFile *file, int indent) const {
+void CTurnOnTurnOff::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/core/turn_on_turn_off.h b/engines/titanic/core/turn_on_turn_off.h
index 5683a0d..2df8830 100644
--- a/engines/titanic/core/turn_on_turn_off.h
+++ b/engines/titanic/core/turn_on_turn_off.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 8faf100..56069a9 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -53,7 +53,7 @@ void CViewItem::setData(double v) {
 	_field54 = sin(_field28) * -30.0;
 }
 
-void CViewItem::save(SimpleFile *file, int indent) const {
+void CViewItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	_resourceKey.save(file, indent);
 	file->writeQuotedLine("V", indent);
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index d85117a..4e25c00 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -65,7 +65,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/announce.cpp b/engines/titanic/game/announce.cpp
index 098ae70..df6689d 100644
--- a/engines/titanic/game/announce.cpp
+++ b/engines/titanic/game/announce.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CAnnounce::CAnnounce() : _fieldBC(0), _fieldC0(0), _fieldC4(1), _fieldC8(0) {
 }
 
-void CAnnounce::save(SimpleFile *file, int indent) const {
+void CAnnounce::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/announce.h b/engines/titanic/game/announce.h
index 18702c3..3845d96 100644
--- a/engines/titanic/game/announce.h
+++ b/engines/titanic/game/announce.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/annoy_barbot.cpp b/engines/titanic/game/annoy_barbot.cpp
index caea823..d69d9ff 100644
--- a/engines/titanic/game/annoy_barbot.cpp
+++ b/engines/titanic/game/annoy_barbot.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 int CAnnoyBarbot::_v1;
 
-void CAnnoyBarbot::save(SimpleFile *file, int indent) const {
+void CAnnoyBarbot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/annoy_barbot.h b/engines/titanic/game/annoy_barbot.h
index c15b41d..e29c0c4 100644
--- a/engines/titanic/game/annoy_barbot.h
+++ b/engines/titanic/game/annoy_barbot.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/arb_background.cpp b/engines/titanic/game/arb_background.cpp
index 0755815..b86ecb1 100644
--- a/engines/titanic/game/arb_background.cpp
+++ b/engines/titanic/game/arb_background.cpp
@@ -30,7 +30,7 @@ CArbBackground::CArbBackground() : CBackground(),
 	_fieldE0(0), _fieldE4(61), _fieldE8(62), _fieldEC(118) {
 }
 
-void CArbBackground::save(SimpleFile *file, int indent) const {
+void CArbBackground::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/arb_background.h b/engines/titanic/game/arb_background.h
index a5850af..4227667 100644
--- a/engines/titanic/game/arb_background.h
+++ b/engines/titanic/game/arb_background.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/arboretum_gate.cpp b/engines/titanic/game/arboretum_gate.cpp
index f3e3301..9caa87c 100644
--- a/engines/titanic/game/arboretum_gate.cpp
+++ b/engines/titanic/game/arboretum_gate.cpp
@@ -69,7 +69,7 @@ CArboretumGate::CArboretumGate() : CBackground() {
 	_field150 = 424;
 }
 
-void CArboretumGate::save(SimpleFile *file, int indent) const {
+void CArboretumGate::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_v1, indent);
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
index 736f67b..bd41dd1 100644
--- a/engines/titanic/game/arboretum_gate.h
+++ b/engines/titanic/game/arboretum_gate.h
@@ -80,7 +80,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/auto_animate.cpp b/engines/titanic/game/auto_animate.cpp
index 8bd332a..172b8c4 100644
--- a/engines/titanic/game/auto_animate.cpp
+++ b/engines/titanic/game/auto_animate.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CAutoAnimate::save(SimpleFile *file, int indent) const {
+void CAutoAnimate::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/auto_animate.h b/engines/titanic/game/auto_animate.h
index 7130d6a..fe70400 100644
--- a/engines/titanic/game/auto_animate.h
+++ b/engines/titanic/game/auto_animate.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/bar_bell.cpp b/engines/titanic/game/bar_bell.cpp
index adb563c..b33ee1c 100644
--- a/engines/titanic/game/bar_bell.cpp
+++ b/engines/titanic/game/bar_bell.cpp
@@ -28,7 +28,7 @@ CBarBell::CBarBell() : CGameObject(), _fieldBC(0),
 	_fieldC0(65), _fieldC4(0), _fieldC8(0), _fieldCC(0) {
 }
 
-void CBarBell::save(SimpleFile *file, int indent) const {
+void CBarBell::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/bar_bell.h b/engines/titanic/game/bar_bell.h
index b17d808..9010012 100644
--- a/engines/titanic/game/bar_bell.h
+++ b/engines/titanic/game/bar_bell.h
@@ -43,7 +43,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/bar_menu.cpp b/engines/titanic/game/bar_menu.cpp
index 25da001..b24c429 100644
--- a/engines/titanic/game/bar_menu.cpp
+++ b/engines/titanic/game/bar_menu.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CBarMenu::CBarMenu() : CGameObject(), _fieldBC(0), _fieldC0(0), _fieldC4(6) {
 }
 
-void CBarMenu::save(SimpleFile *file, int indent) const {
+void CBarMenu::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/bar_menu.h b/engines/titanic/game/bar_menu.h
index ac253fc..db3c937 100644
--- a/engines/titanic/game/bar_menu.h
+++ b/engines/titanic/game/bar_menu.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/bar_menu_button.cpp b/engines/titanic/game/bar_menu_button.cpp
index 897c7a8..f57d72c 100644
--- a/engines/titanic/game/bar_menu_button.cpp
+++ b/engines/titanic/game/bar_menu_button.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBarMenuButton::save(SimpleFile *file, int indent) const {
+void CBarMenuButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/bar_menu_button.h b/engines/titanic/game/bar_menu_button.h
index 1a9d42c..fe7d7d9 100644
--- a/engines/titanic/game/bar_menu_button.h
+++ b/engines/titanic/game/bar_menu_button.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/belbot_get_light.cpp b/engines/titanic/game/belbot_get_light.cpp
index 4bbafcd..3e678a8 100644
--- a/engines/titanic/game/belbot_get_light.cpp
+++ b/engines/titanic/game/belbot_get_light.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBelbotGetLight::save(SimpleFile *file, int indent) const {
+void CBelbotGetLight::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/belbot_get_light.h b/engines/titanic/game/belbot_get_light.h
index 05c14f5..dd6f361 100644
--- a/engines/titanic/game/belbot_get_light.h
+++ b/engines/titanic/game/belbot_get_light.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/bilge_succubus.cpp b/engines/titanic/game/bilge_succubus.cpp
index 9c19d81..ceee3f7 100644
--- a/engines/titanic/game/bilge_succubus.cpp
+++ b/engines/titanic/game/bilge_succubus.cpp
@@ -28,7 +28,7 @@ CBilgeSuccUBus::CBilgeSuccUBus() : CSuccUBus(), _field1DC(0),
 	_field1E0(0), _field1E4(0), _field1E8(0) {
 }
 
-void CBilgeSuccUBus::save(SimpleFile *file, int indent) const {
+void CBilgeSuccUBus::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field1DC, indent);
 	file->writeNumberLine(_field1E0, indent);
diff --git a/engines/titanic/game/bilge_succubus.h b/engines/titanic/game/bilge_succubus.h
index 4ff72a5..9546d00 100644
--- a/engines/titanic/game/bilge_succubus.h
+++ b/engines/titanic/game/bilge_succubus.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/bomb.cpp b/engines/titanic/game/bomb.cpp
index a6086a2..9a08f26 100644
--- a/engines/titanic/game/bomb.cpp
+++ b/engines/titanic/game/bomb.cpp
@@ -38,7 +38,7 @@ CBomb::CBomb() : CBackground() {
 	_field104 = 60;
 }
 
-void CBomb::save(SimpleFile *file, int indent) const {
+void CBomb::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/bomb.h b/engines/titanic/game/bomb.h
index 76799da..59351db 100644
--- a/engines/titanic/game/bomb.h
+++ b/engines/titanic/game/bomb.h
@@ -48,7 +48,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/bottom_of_well_monitor.cpp b/engines/titanic/game/bottom_of_well_monitor.cpp
index b48b5ad..beb2a80 100644
--- a/engines/titanic/game/bottom_of_well_monitor.cpp
+++ b/engines/titanic/game/bottom_of_well_monitor.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 int CBottomOfWellMonitor::_v1;
 int CBottomOfWellMonitor::_v2;
 
-void CBottomOfWellMonitor::save(SimpleFile *file, int indent) const {
+void CBottomOfWellMonitor::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
diff --git a/engines/titanic/game/bottom_of_well_monitor.h b/engines/titanic/game/bottom_of_well_monitor.h
index e063579..cae02b9 100644
--- a/engines/titanic/game/bottom_of_well_monitor.h
+++ b/engines/titanic/game/bottom_of_well_monitor.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/bowl_unlocker.cpp b/engines/titanic/game/bowl_unlocker.cpp
index 83ae9e3..c3c501d 100644
--- a/engines/titanic/game/bowl_unlocker.cpp
+++ b/engines/titanic/game/bowl_unlocker.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBowlUnlocker::save(SimpleFile *file, int indent) const {
+void CBowlUnlocker::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/bowl_unlocker.h b/engines/titanic/game/bowl_unlocker.h
index 7b886c4..9ab9e63 100644
--- a/engines/titanic/game/bowl_unlocker.h
+++ b/engines/titanic/game/bowl_unlocker.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/brain_slot.cpp b/engines/titanic/game/brain_slot.cpp
index f655a96..f196314 100644
--- a/engines/titanic/game/brain_slot.cpp
+++ b/engines/titanic/game/brain_slot.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 int CBrainSlot::_v1;
 int CBrainSlot::_v2;
 
-void CBrainSlot::save(SimpleFile *file, int indent) const {
+void CBrainSlot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value1, indent);
 	file->writeQuotedLine(_value2, indent);
diff --git a/engines/titanic/game/brain_slot.h b/engines/titanic/game/brain_slot.h
index ae797eb..f94ffc7 100644
--- a/engines/titanic/game/brain_slot.h
+++ b/engines/titanic/game/brain_slot.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/bridge_door.cpp b/engines/titanic/game/bridge_door.cpp
index b24f7a6..57cdbd2 100644
--- a/engines/titanic/game/bridge_door.cpp
+++ b/engines/titanic/game/bridge_door.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBridgeDoor::save(SimpleFile *file, int indent) const {
+void CBridgeDoor::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/bridge_door.h b/engines/titanic/game/bridge_door.h
index 828562d..f14d601 100644
--- a/engines/titanic/game/bridge_door.h
+++ b/engines/titanic/game/bridge_door.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/bridge_view.cpp b/engines/titanic/game/bridge_view.cpp
index 8afca38..9854969 100644
--- a/engines/titanic/game/bridge_view.cpp
+++ b/engines/titanic/game/bridge_view.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBridgeView::save(SimpleFile *file, int indent) const {
+void CBridgeView::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	CBackground::save(file, indent);
diff --git a/engines/titanic/game/bridge_view.h b/engines/titanic/game/bridge_view.h
index 35de076..be349f3 100644
--- a/engines/titanic/game/bridge_view.h
+++ b/engines/titanic/game/bridge_view.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/broken_pell_base.cpp b/engines/titanic/game/broken_pell_base.cpp
index 8b8e0b9..77d3aee 100644
--- a/engines/titanic/game/broken_pell_base.cpp
+++ b/engines/titanic/game/broken_pell_base.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CBrokenPellBase, CBackground)
 int CBrokenPellBase::_v1;
 int CBrokenPellBase::_v2;
 
-void CBrokenPellBase::save(SimpleFile *file, int indent) const {
+void CBrokenPellBase::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
diff --git a/engines/titanic/game/broken_pell_base.h b/engines/titanic/game/broken_pell_base.h
index 45b6594..d3157fd 100644
--- a/engines/titanic/game/broken_pell_base.h
+++ b/engines/titanic/game/broken_pell_base.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/broken_pellerator.cpp b/engines/titanic/game/broken_pellerator.cpp
index ea16767..d3b204b 100644
--- a/engines/titanic/game/broken_pellerator.cpp
+++ b/engines/titanic/game/broken_pellerator.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBrokenPellerator::save(SimpleFile *file, int indent) const {
+void CBrokenPellerator::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string2, indent);
 	file->writeQuotedLine(_string3, indent);
diff --git a/engines/titanic/game/broken_pellerator.h b/engines/titanic/game/broken_pellerator.h
index 974d5d2..ebb31d5 100644
--- a/engines/titanic/game/broken_pellerator.h
+++ b/engines/titanic/game/broken_pellerator.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/broken_pellerator_froz.cpp b/engines/titanic/game/broken_pellerator_froz.cpp
index 6b077d2..4b21ea9 100644
--- a/engines/titanic/game/broken_pellerator_froz.cpp
+++ b/engines/titanic/game/broken_pellerator_froz.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBrokenPelleratorFroz::save(SimpleFile *file, int indent) const {
+void CBrokenPelleratorFroz::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string2, indent);
 	file->writeQuotedLine(_string3, indent);
diff --git a/engines/titanic/game/broken_pellerator_froz.h b/engines/titanic/game/broken_pellerator_froz.h
index c3674f0..cc2ed31 100644
--- a/engines/titanic/game/broken_pellerator_froz.h
+++ b/engines/titanic/game/broken_pellerator_froz.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/cage.cpp b/engines/titanic/game/cage.cpp
index 480944f..7fbc052 100644
--- a/engines/titanic/game/cage.cpp
+++ b/engines/titanic/game/cage.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 int CCage::_v1;
 int CCage::_v2;
 
-void CCage::save(SimpleFile *file, int indent) const {
+void CCage::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
diff --git a/engines/titanic/game/cage.h b/engines/titanic/game/cage.h
index 08fc8c8..72de9fb 100644
--- a/engines/titanic/game/cage.h
+++ b/engines/titanic/game/cage.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/call_pellerator.cpp b/engines/titanic/game/call_pellerator.cpp
index 85f2ab8..0ea4813 100644
--- a/engines/titanic/game/call_pellerator.cpp
+++ b/engines/titanic/game/call_pellerator.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CCallPellerator::save(SimpleFile *file, int indent) const {
+void CCallPellerator::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/call_pellerator.h b/engines/titanic/game/call_pellerator.h
index dc9afe0..fc8110a 100644
--- a/engines/titanic/game/call_pellerator.h
+++ b/engines/titanic/game/call_pellerator.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/captains_wheel.cpp b/engines/titanic/game/captains_wheel.cpp
index b4e31fd..c84c919 100644
--- a/engines/titanic/game/captains_wheel.cpp
+++ b/engines/titanic/game/captains_wheel.cpp
@@ -29,7 +29,7 @@ CCaptainsWheel::CCaptainsWheel() : CBackground(),
 	_fieldF0(0), _fieldF4(0) {
 }
 
-void CCaptainsWheel::save(SimpleFile *file, int indent) const {
+void CCaptainsWheel::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/captains_wheel.h b/engines/titanic/game/captains_wheel.h
index bcfc513..f817ee7 100644
--- a/engines/titanic/game/captains_wheel.h
+++ b/engines/titanic/game/captains_wheel.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/cdrom.cpp b/engines/titanic/game/cdrom.cpp
index 0fd7eb5..111b090 100644
--- a/engines/titanic/game/cdrom.cpp
+++ b/engines/titanic/game/cdrom.cpp
@@ -36,7 +36,7 @@ END_MESSAGE_MAP()
 CCDROM::CCDROM() : CGameObject() {
 }
 
-void CCDROM::save(SimpleFile *file, int indent) const {
+void CCDROM::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writePoint(_tempPos, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/cdrom.h b/engines/titanic/game/cdrom.h
index 44e1e82..ece7242 100644
--- a/engines/titanic/game/cdrom.h
+++ b/engines/titanic/game/cdrom.h
@@ -44,7 +44,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/cdrom_computer.cpp b/engines/titanic/game/cdrom_computer.cpp
index a25706a..ceb0595 100644
--- a/engines/titanic/game/cdrom_computer.cpp
+++ b/engines/titanic/game/cdrom_computer.cpp
@@ -33,7 +33,7 @@ CCDROMComputer::CCDROMComputer() : CGameObject(),
 		_clickRect(0, 3, 55, 32) {
 }
 
-void CCDROMComputer::save(SimpleFile *file, int indent) const {
+void CCDROMComputer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_clickRect.left, indent);
 	file->writeNumberLine(_clickRect.top, indent);
diff --git a/engines/titanic/game/cdrom_computer.h b/engines/titanic/game/cdrom_computer.h
index 4ea2f4d..da6e0e7 100644
--- a/engines/titanic/game/cdrom_computer.h
+++ b/engines/titanic/game/cdrom_computer.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/cdrom_tray.cpp b/engines/titanic/game/cdrom_tray.cpp
index 1b2d6ba..118150b 100644
--- a/engines/titanic/game/cdrom_tray.cpp
+++ b/engines/titanic/game/cdrom_tray.cpp
@@ -36,7 +36,7 @@ END_MESSAGE_MAP()
 CCDROMTray::CCDROMTray() : CGameObject(), _state(0) {
 }
 
-void CCDROMTray::save(SimpleFile *file, int indent) const {
+void CCDROMTray::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_state, indent);
 	file->writeQuotedLine(_insertedCD, indent);
diff --git a/engines/titanic/game/cdrom_tray.h b/engines/titanic/game/cdrom_tray.h
index 96faf64..dbeec17 100644
--- a/engines/titanic/game/cdrom_tray.h
+++ b/engines/titanic/game/cdrom_tray.h
@@ -43,7 +43,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/cell_point_button.cpp b/engines/titanic/game/cell_point_button.cpp
index 45ddad8..18ece09 100644
--- a/engines/titanic/game/cell_point_button.cpp
+++ b/engines/titanic/game/cell_point_button.cpp
@@ -38,7 +38,7 @@ CCellPointButton::CCellPointButton() : CBackground() {
 	_field108 = 1;
 }
 
-void CCellPointButton::save(SimpleFile *file, int indent) const {
+void CCellPointButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/cell_point_button.h b/engines/titanic/game/cell_point_button.h
index 02710f6..0a04350 100644
--- a/engines/titanic/game/cell_point_button.h
+++ b/engines/titanic/game/cell_point_button.h
@@ -49,7 +49,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/chev_code.cpp b/engines/titanic/game/chev_code.cpp
index d2818f6..ebc2057 100644
--- a/engines/titanic/game/chev_code.cpp
+++ b/engines/titanic/game/chev_code.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CChevCode::save(SimpleFile *file, int indent) const {
+void CChevCode::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/chev_code.h b/engines/titanic/game/chev_code.h
index 3d5347b..df7421e 100644
--- a/engines/titanic/game/chev_code.h
+++ b/engines/titanic/game/chev_code.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/chev_panel.cpp b/engines/titanic/game/chev_panel.cpp
index 665b91d..245968e 100644
--- a/engines/titanic/game/chev_panel.cpp
+++ b/engines/titanic/game/chev_panel.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CChevPanel::save(SimpleFile *file, int indent) const {
+void CChevPanel::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/chev_panel.h b/engines/titanic/game/chev_panel.h
index 9ddca37..e53a94e 100644
--- a/engines/titanic/game/chev_panel.h
+++ b/engines/titanic/game/chev_panel.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/chicken_cooler.cpp b/engines/titanic/game/chicken_cooler.cpp
index aa39f04..29232e1 100644
--- a/engines/titanic/game/chicken_cooler.cpp
+++ b/engines/titanic/game/chicken_cooler.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CChickenCooler::save(SimpleFile *file, int indent) const {
+void CChickenCooler::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/chicken_cooler.h b/engines/titanic/game/chicken_cooler.h
index 220dba0..b735b0f 100644
--- a/engines/titanic/game/chicken_cooler.h
+++ b/engines/titanic/game/chicken_cooler.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/chicken_dispensor.cpp b/engines/titanic/game/chicken_dispensor.cpp
index d3660bd..a9bf576 100644
--- a/engines/titanic/game/chicken_dispensor.cpp
+++ b/engines/titanic/game/chicken_dispensor.cpp
@@ -28,7 +28,7 @@ CChickenDispensor::CChickenDispensor() : CBackground(),
 	_fieldE0(0), _fieldE4(0), _fieldE8(0) {
 }
 
-void CChickenDispensor::save(SimpleFile *file, int indent) const {
+void CChickenDispensor::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/chicken_dispensor.h b/engines/titanic/game/chicken_dispensor.h
index 97e5f86..21163c6 100644
--- a/engines/titanic/game/chicken_dispensor.h
+++ b/engines/titanic/game/chicken_dispensor.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/close_broken_pel.cpp b/engines/titanic/game/close_broken_pel.cpp
index 9cc4eb6..d27441a 100644
--- a/engines/titanic/game/close_broken_pel.cpp
+++ b/engines/titanic/game/close_broken_pel.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CCloseBrokenPel::save(SimpleFile *file, int indent) const {
+void CCloseBrokenPel::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string3, indent);
 	CBackground::save(file, indent);
diff --git a/engines/titanic/game/close_broken_pel.h b/engines/titanic/game/close_broken_pel.h
index ecf38d9..252d089 100644
--- a/engines/titanic/game/close_broken_pel.h
+++ b/engines/titanic/game/close_broken_pel.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/code_wheel.cpp b/engines/titanic/game/code_wheel.cpp
index a10a70c..d8ce48e 100644
--- a/engines/titanic/game/code_wheel.cpp
+++ b/engines/titanic/game/code_wheel.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CodeWheel::CodeWheel() : CBomb(), _field108(0), _field10C(4), _field110(0) {
 }
 
-void CodeWheel::save(SimpleFile *file, int indent) const {
+void CodeWheel::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field108, indent);
 	file->writeNumberLine(_field10C, indent);
diff --git a/engines/titanic/game/code_wheel.h b/engines/titanic/game/code_wheel.h
index 6080e92..1776ad6 100644
--- a/engines/titanic/game/code_wheel.h
+++ b/engines/titanic/game/code_wheel.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/computer.cpp b/engines/titanic/game/computer.cpp
index d2a2cc1..e3f9430 100644
--- a/engines/titanic/game/computer.cpp
+++ b/engines/titanic/game/computer.cpp
@@ -30,7 +30,7 @@ BEGIN_MESSAGE_MAP(CComputer, CBackground)
 	ON_MESSAGE(MovieEndMsg)
 END_MESSAGE_MAP()
 
-void CComputer::save(SimpleFile *file, int indent) const {
+void CComputer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_currentCD, indent);
 	file->writeNumberLine(_state, indent);
diff --git a/engines/titanic/game/computer.h b/engines/titanic/game/computer.h
index 3db0ee1..e9716aa 100644
--- a/engines/titanic/game/computer.h
+++ b/engines/titanic/game/computer.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp
index 9d15ea9..c73db4f 100644
--- a/engines/titanic/game/computer_screen.cpp
+++ b/engines/titanic/game/computer_screen.cpp
@@ -35,7 +35,7 @@ END_MESSAGE_MAP()
 CComputerScreen::CComputerScreen() : CGameObject() {
 }
 
-void CComputerScreen::save(SimpleFile *file, int indent) const {
+void CComputerScreen::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/computer_screen.h b/engines/titanic/game/computer_screen.h
index fa02ef5..032c724 100644
--- a/engines/titanic/game/computer_screen.h
+++ b/engines/titanic/game/computer_screen.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/cookie.cpp b/engines/titanic/game/cookie.cpp
index 98621d0..915bb93 100644
--- a/engines/titanic/game/cookie.cpp
+++ b/engines/titanic/game/cookie.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CCookie::save(SimpleFile *file, int indent) const {
+void CCookie::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value1, indent);
 	file->writeNumberLine(_value2, indent);
diff --git a/engines/titanic/game/cookie.h b/engines/titanic/game/cookie.h
index bd9d1ff..72b29dc 100644
--- a/engines/titanic/game/cookie.h
+++ b/engines/titanic/game/cookie.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/credits.cpp b/engines/titanic/game/credits.cpp
index 178d268..7078d41 100644
--- a/engines/titanic/game/credits.cpp
+++ b/engines/titanic/game/credits.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CCredits::CCredits() : CGameObject(), _fieldBC(-1), _fieldC0(1) {
 }
 
-void CCredits::save(SimpleFile *file, int indent) const {
+void CCredits::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/credits.h b/engines/titanic/game/credits.h
index dc22912..5b3fe29 100644
--- a/engines/titanic/game/credits.h
+++ b/engines/titanic/game/credits.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/credits_button.cpp b/engines/titanic/game/credits_button.cpp
index 0ab23c1..90bb1b5 100644
--- a/engines/titanic/game/credits_button.cpp
+++ b/engines/titanic/game/credits_button.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CCreditsButton::CCreditsButton() : CBackground(), _fieldE0(1) {
 }
 
-void CCreditsButton::save(SimpleFile *file, int indent) const {
+void CCreditsButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	CBackground::save(file, indent);
diff --git a/engines/titanic/game/credits_button.h b/engines/titanic/game/credits_button.h
index fd7a8ad..74fcdc0 100644
--- a/engines/titanic/game/credits_button.h
+++ b/engines/titanic/game/credits_button.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/dead_area.cpp b/engines/titanic/game/dead_area.cpp
index 5d5b2d0..3c41ab3 100644
--- a/engines/titanic/game/dead_area.cpp
+++ b/engines/titanic/game/dead_area.cpp
@@ -32,7 +32,7 @@ END_MESSAGE_MAP()
 CDeadArea::CDeadArea() : CGameObject() {
 }
 
-void CDeadArea::save(SimpleFile *file, int indent) const {
+void CDeadArea::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/dead_area.h b/engines/titanic/game/dead_area.h
index 367308e..8bffed7 100644
--- a/engines/titanic/game/dead_area.h
+++ b/engines/titanic/game/dead_area.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/desk_click_responder.cpp b/engines/titanic/game/desk_click_responder.cpp
index 312fe56..d9b2cb6 100644
--- a/engines/titanic/game/desk_click_responder.cpp
+++ b/engines/titanic/game/desk_click_responder.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CDeskClickResponder::save(SimpleFile *file, int indent) const {
+void CDeskClickResponder::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldD4, indent);
 	file->writeNumberLine(_fieldD8, indent);
diff --git a/engines/titanic/game/desk_click_responder.h b/engines/titanic/game/desk_click_responder.h
index a11d7ae..3967b68 100644
--- a/engines/titanic/game/desk_click_responder.h
+++ b/engines/titanic/game/desk_click_responder.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/doorbot_elevator_handler.cpp b/engines/titanic/game/doorbot_elevator_handler.cpp
index ae1894d..13fc368 100644
--- a/engines/titanic/game/doorbot_elevator_handler.cpp
+++ b/engines/titanic/game/doorbot_elevator_handler.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 int CDoorbotElevatorHandler::_v1;
 
-void CDoorbotElevatorHandler::save(SimpleFile *file, int indent) const {
+void CDoorbotElevatorHandler::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	file->writeNumberLine(_v1, indent);
diff --git a/engines/titanic/game/doorbot_elevator_handler.h b/engines/titanic/game/doorbot_elevator_handler.h
index 2bbfab9..57722c5 100644
--- a/engines/titanic/game/doorbot_elevator_handler.h
+++ b/engines/titanic/game/doorbot_elevator_handler.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/doorbot_home_handler.cpp b/engines/titanic/game/doorbot_home_handler.cpp
index 5d25017..b848308 100644
--- a/engines/titanic/game/doorbot_home_handler.cpp
+++ b/engines/titanic/game/doorbot_home_handler.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CDoorbotHomeHandler::CDoorbotHomeHandler() {
 }
 
-void CDoorbotHomeHandler::save(SimpleFile *file, int indent) const {
+void CDoorbotHomeHandler::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/doorbot_home_handler.h b/engines/titanic/game/doorbot_home_handler.h
index 1e5d128..66cec70 100644
--- a/engines/titanic/game/doorbot_home_handler.h
+++ b/engines/titanic/game/doorbot_home_handler.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/ear_sweet_bowl.cpp b/engines/titanic/game/ear_sweet_bowl.cpp
index dc4ca7a..0f70693 100644
--- a/engines/titanic/game/ear_sweet_bowl.cpp
+++ b/engines/titanic/game/ear_sweet_bowl.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CEarSweetBowl::save(SimpleFile *file, int indent) const {
+void CEarSweetBowl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSweetBowl::save(file, indent);
 }
diff --git a/engines/titanic/game/ear_sweet_bowl.h b/engines/titanic/game/ear_sweet_bowl.h
index aa276f8..a5386d4 100644
--- a/engines/titanic/game/ear_sweet_bowl.h
+++ b/engines/titanic/game/ear_sweet_bowl.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/eject_phonograph_button.cpp b/engines/titanic/game/eject_phonograph_button.cpp
index bd444f9..4657f04 100644
--- a/engines/titanic/game/eject_phonograph_button.cpp
+++ b/engines/titanic/game/eject_phonograph_button.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CEjectPhonographButton::save(SimpleFile *file, int indent) const {
+void CEjectPhonographButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/eject_phonograph_button.h b/engines/titanic/game/eject_phonograph_button.h
index d3e8a50..670670b 100644
--- a/engines/titanic/game/eject_phonograph_button.h
+++ b/engines/titanic/game/eject_phonograph_button.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/elevator_action_area.cpp b/engines/titanic/game/elevator_action_area.cpp
index c9916bf..1cbff8d 100644
--- a/engines/titanic/game/elevator_action_area.cpp
+++ b/engines/titanic/game/elevator_action_area.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CElevatorActionArea::save(SimpleFile *file, int indent) const {
+void CElevatorActionArea::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/elevator_action_area.h b/engines/titanic/game/elevator_action_area.h
index 570ee80..361f19a 100644
--- a/engines/titanic/game/elevator_action_area.h
+++ b/engines/titanic/game/elevator_action_area.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/emma_control.cpp b/engines/titanic/game/emma_control.cpp
index fac429c..814cb44 100644
--- a/engines/titanic/game/emma_control.cpp
+++ b/engines/titanic/game/emma_control.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 int CEmmaControl::_v1;
 
-void CEmmaControl::save(SimpleFile *file, int indent) const {
+void CEmmaControl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeQuotedLine(_wavFile1, indent);
diff --git a/engines/titanic/game/emma_control.h b/engines/titanic/game/emma_control.h
index ea30c52..654d3c5 100644
--- a/engines/titanic/game/emma_control.h
+++ b/engines/titanic/game/emma_control.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/empty_nut_bowl.cpp b/engines/titanic/game/empty_nut_bowl.cpp
index 217029b..ae9cb35 100644
--- a/engines/titanic/game/empty_nut_bowl.cpp
+++ b/engines/titanic/game/empty_nut_bowl.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CEmptyNutBowl::save(SimpleFile *file, int indent) const {
+void CEmptyNutBowl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/empty_nut_bowl.h b/engines/titanic/game/empty_nut_bowl.h
index 9645284..31f31e2 100644
--- a/engines/titanic/game/empty_nut_bowl.h
+++ b/engines/titanic/game/empty_nut_bowl.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/end_credit_text.cpp b/engines/titanic/game/end_credit_text.cpp
index 8ae83ac..6e0c21b 100644
--- a/engines/titanic/game/end_credit_text.cpp
+++ b/engines/titanic/game/end_credit_text.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CEndCreditText::save(SimpleFile *file, int indent) const {
+void CEndCreditText::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/end_credit_text.h b/engines/titanic/game/end_credit_text.h
index 0003a8b..137e510 100644
--- a/engines/titanic/game/end_credit_text.h
+++ b/engines/titanic/game/end_credit_text.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/end_credits.cpp b/engines/titanic/game/end_credits.cpp
index 0f71cfc..61640b9 100644
--- a/engines/titanic/game/end_credits.cpp
+++ b/engines/titanic/game/end_credits.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CEndCredits::save(SimpleFile *file, int indent) const {
+void CEndCredits::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/end_credits.h b/engines/titanic/game/end_credits.h
index a259a21..9aad297 100644
--- a/engines/titanic/game/end_credits.h
+++ b/engines/titanic/game/end_credits.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/end_explode_ship.cpp b/engines/titanic/game/end_explode_ship.cpp
index e12e03e..f7ac365 100644
--- a/engines/titanic/game/end_explode_ship.cpp
+++ b/engines/titanic/game/end_explode_ship.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CEndExplodeShip::save(SimpleFile *file, int indent) const {
+void CEndExplodeShip::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value1, indent);
 	file->writeNumberLine(_value2, indent);
diff --git a/engines/titanic/game/end_explode_ship.h b/engines/titanic/game/end_explode_ship.h
index a6b053f..48bbeca 100644
--- a/engines/titanic/game/end_explode_ship.h
+++ b/engines/titanic/game/end_explode_ship.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/end_game_credits.cpp b/engines/titanic/game/end_game_credits.cpp
index 56b06e6..2d1aa79 100644
--- a/engines/titanic/game/end_game_credits.cpp
+++ b/engines/titanic/game/end_game_credits.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CEndGameCredits::CEndGameCredits() : CGameObject(), _fieldBC(0) {
 }
 
-void CEndGameCredits::save(SimpleFile *file, int indent) const {
+void CEndGameCredits::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writePoint(_pos1, indent);
diff --git a/engines/titanic/game/end_game_credits.h b/engines/titanic/game/end_game_credits.h
index ab14f26..5eee5fc 100644
--- a/engines/titanic/game/end_game_credits.h
+++ b/engines/titanic/game/end_game_credits.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/end_sequence_control.cpp b/engines/titanic/game/end_sequence_control.cpp
index 2417214..d32b3d1 100644
--- a/engines/titanic/game/end_sequence_control.cpp
+++ b/engines/titanic/game/end_sequence_control.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CEndSequenceControl::save(SimpleFile *file, int indent) const {
+void CEndSequenceControl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/end_sequence_control.h b/engines/titanic/game/end_sequence_control.h
index 64bafcb..0a9d6f0 100644
--- a/engines/titanic/game/end_sequence_control.h
+++ b/engines/titanic/game/end_sequence_control.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/fan.cpp b/engines/titanic/game/fan.cpp
index 4715aa7..eabaf63 100644
--- a/engines/titanic/game/fan.cpp
+++ b/engines/titanic/game/fan.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CFan::save(SimpleFile *file, int indent) const {
+void CFan::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value1, indent);
 	file->writeNumberLine(_value2, indent);
diff --git a/engines/titanic/game/fan.h b/engines/titanic/game/fan.h
index 6f23407..d3cf527 100644
--- a/engines/titanic/game/fan.h
+++ b/engines/titanic/game/fan.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/fan_control.cpp b/engines/titanic/game/fan_control.cpp
index 44e36b2..a42e4dd 100644
--- a/engines/titanic/game/fan_control.cpp
+++ b/engines/titanic/game/fan_control.cpp
@@ -28,7 +28,7 @@ CFanControl::CFanControl() : CGameObject(), _fieldBC(0),
 	_fieldC0(0), _fieldC4(0), _fieldC8(0), _fieldCC(0) {
 }
 
-void CFanControl::save(SimpleFile *file, int indent) const {
+void CFanControl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/fan_control.h b/engines/titanic/game/fan_control.h
index 54ebbe2..14b56db 100644
--- a/engines/titanic/game/fan_control.h
+++ b/engines/titanic/game/fan_control.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/fan_decrease.cpp b/engines/titanic/game/fan_decrease.cpp
index 41e227e..2049b1e 100644
--- a/engines/titanic/game/fan_decrease.cpp
+++ b/engines/titanic/game/fan_decrease.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CFanDecrease::save(SimpleFile *file, int indent) const {
+void CFanDecrease::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/fan_decrease.h b/engines/titanic/game/fan_decrease.h
index bac1028..7d0c4a3 100644
--- a/engines/titanic/game/fan_decrease.h
+++ b/engines/titanic/game/fan_decrease.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/fan_increase.cpp b/engines/titanic/game/fan_increase.cpp
index 06fcf47..aa23dd9 100644
--- a/engines/titanic/game/fan_increase.cpp
+++ b/engines/titanic/game/fan_increase.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CFanIncrease::save(SimpleFile *file, int indent) const {
+void CFanIncrease::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/fan_increase.h b/engines/titanic/game/fan_increase.h
index 62561f1..e81ff46 100644
--- a/engines/titanic/game/fan_increase.h
+++ b/engines/titanic/game/fan_increase.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/fan_noises.cpp b/engines/titanic/game/fan_noises.cpp
index 18a6ef7..14177ab 100644
--- a/engines/titanic/game/fan_noises.cpp
+++ b/engines/titanic/game/fan_noises.cpp
@@ -29,7 +29,7 @@ CFanNoises::CFanNoises() : CGameObject(), _fieldBC(-1),
 	_fieldD0(0), _fieldD4(-1) {
 }
 
-void CFanNoises::save(SimpleFile *file, int indent) const {
+void CFanNoises::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/fan_noises.h b/engines/titanic/game/fan_noises.h
index a78b3ca..f187853 100644
--- a/engines/titanic/game/fan_noises.h
+++ b/engines/titanic/game/fan_noises.h
@@ -45,7 +45,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/floor_indicator.cpp b/engines/titanic/game/floor_indicator.cpp
index b17bd4b..360232c 100644
--- a/engines/titanic/game/floor_indicator.cpp
+++ b/engines/titanic/game/floor_indicator.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CFloorIndicator::save(SimpleFile *file, int indent) const {
+void CFloorIndicator::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/floor_indicator.h b/engines/titanic/game/floor_indicator.h
index a3511fb..ccd6a8b 100644
--- a/engines/titanic/game/floor_indicator.h
+++ b/engines/titanic/game/floor_indicator.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/games_console.cpp b/engines/titanic/game/games_console.cpp
index 13a7260..b7500f9 100644
--- a/engines/titanic/game/games_console.cpp
+++ b/engines/titanic/game/games_console.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CGamesConsole::save(SimpleFile *file, int indent) const {
+void CGamesConsole::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	CBackground::save(file, indent);
diff --git a/engines/titanic/game/games_console.h b/engines/titanic/game/games_console.h
index 67634d8d..8d37186 100644
--- a/engines/titanic/game/games_console.h
+++ b/engines/titanic/game/games_console.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/get_lift_eye2.cpp b/engines/titanic/game/get_lift_eye2.cpp
index 76e6d2a..7747f7b 100644
--- a/engines/titanic/game/get_lift_eye2.cpp
+++ b/engines/titanic/game/get_lift_eye2.cpp
@@ -34,7 +34,7 @@ void CGetLiftEye2::deinit() {
 	delete _v1;
 }
 
-void CGetLiftEye2::save(SimpleFile *file, int indent) const {
+void CGetLiftEye2::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(*_v1, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
index d936559..7a3caa1 100644
--- a/engines/titanic/game/get_lift_eye2.h
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/glass_smasher.cpp b/engines/titanic/game/glass_smasher.cpp
index 80b665d..8c33124 100644
--- a/engines/titanic/game/glass_smasher.cpp
+++ b/engines/titanic/game/glass_smasher.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CGlassSmasher::save(SimpleFile *file, int indent) const {
+void CGlassSmasher::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/glass_smasher.h b/engines/titanic/game/glass_smasher.h
index 9c25065..1c4e703 100644
--- a/engines/titanic/game/glass_smasher.h
+++ b/engines/titanic/game/glass_smasher.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/gondolier/gondolier_base.cpp b/engines/titanic/game/gondolier/gondolier_base.cpp
index bf54ed4..1f7339c 100644
--- a/engines/titanic/game/gondolier/gondolier_base.cpp
+++ b/engines/titanic/game/gondolier/gondolier_base.cpp
@@ -35,7 +35,7 @@ int CGondolierBase::_v8;
 int CGondolierBase::_v9;
 int CGondolierBase::_v10;
 
-void CGondolierBase::save(SimpleFile *file, int indent) const {
+void CGondolierBase::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
diff --git a/engines/titanic/game/gondolier/gondolier_base.h b/engines/titanic/game/gondolier/gondolier_base.h
index c45e3e2..e5efaf8 100644
--- a/engines/titanic/game/gondolier/gondolier_base.h
+++ b/engines/titanic/game/gondolier/gondolier_base.h
@@ -45,7 +45,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/gondolier/gondolier_chest.cpp b/engines/titanic/game/gondolier/gondolier_chest.cpp
index 441a8ba..b3e7217 100644
--- a/engines/titanic/game/gondolier/gondolier_chest.cpp
+++ b/engines/titanic/game/gondolier/gondolier_chest.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CGondolierChest::save(SimpleFile *file, int indent) const {
+void CGondolierChest::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGondolierBase::save(file, indent);
 }
diff --git a/engines/titanic/game/gondolier/gondolier_chest.h b/engines/titanic/game/gondolier/gondolier_chest.h
index d2c1381..55e5a2b 100644
--- a/engines/titanic/game/gondolier/gondolier_chest.h
+++ b/engines/titanic/game/gondolier/gondolier_chest.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/gondolier/gondolier_face.cpp b/engines/titanic/game/gondolier/gondolier_face.cpp
index 6db23d8..bdab849 100644
--- a/engines/titanic/game/gondolier/gondolier_face.cpp
+++ b/engines/titanic/game/gondolier/gondolier_face.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CGondolierFace::save(SimpleFile *file, int indent) const {
+void CGondolierFace::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	CGondolierBase::save(file, indent);
diff --git a/engines/titanic/game/gondolier/gondolier_face.h b/engines/titanic/game/gondolier/gondolier_face.h
index 334cab1..03e221e 100644
--- a/engines/titanic/game/gondolier/gondolier_face.h
+++ b/engines/titanic/game/gondolier/gondolier_face.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.cpp b/engines/titanic/game/gondolier/gondolier_mixer.cpp
index 76bf259..9b7b72c 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.cpp
+++ b/engines/titanic/game/gondolier/gondolier_mixer.cpp
@@ -31,7 +31,7 @@ CGondolierMixer::CGondolierMixer() : CGondolierBase(),
 	_fieldE4(0) {
 }
 
-void CGondolierMixer::save(SimpleFile *file, int indent) const {
+void CGondolierMixer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.h b/engines/titanic/game/gondolier/gondolier_mixer.h
index 2202d24..0276de1 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.h
+++ b/engines/titanic/game/gondolier/gondolier_mixer.h
@@ -45,7 +45,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/gondolier/gondolier_slider.cpp b/engines/titanic/game/gondolier/gondolier_slider.cpp
index dff464c..eb6b1a9 100644
--- a/engines/titanic/game/gondolier/gondolier_slider.cpp
+++ b/engines/titanic/game/gondolier/gondolier_slider.cpp
@@ -31,7 +31,7 @@ CGondolierSlider::CGondolierSlider() : CGondolierBase(),
 	_fieldEC(0), _string1("NULL"), _fieldFC(0), _field118(0) {
 }
 
-void CGondolierSlider::save(SimpleFile *file, int indent) const {
+void CGondolierSlider::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/gondolier/gondolier_slider.h b/engines/titanic/game/gondolier/gondolier_slider.h
index eef4a58..c5fd08f 100644
--- a/engines/titanic/game/gondolier/gondolier_slider.h
+++ b/engines/titanic/game/gondolier/gondolier_slider.h
@@ -54,7 +54,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/hammer_clip.cpp b/engines/titanic/game/hammer_clip.cpp
index 60955a2..e3f3a09 100644
--- a/engines/titanic/game/hammer_clip.cpp
+++ b/engines/titanic/game/hammer_clip.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CHammerClip::save(SimpleFile *file, int indent) const {
+void CHammerClip::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/hammer_clip.h b/engines/titanic/game/hammer_clip.h
index d1891d8..01f419c 100644
--- a/engines/titanic/game/hammer_clip.h
+++ b/engines/titanic/game/hammer_clip.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/hammer_dispensor.cpp b/engines/titanic/game/hammer_dispensor.cpp
index d486910..440fe1b 100644
--- a/engines/titanic/game/hammer_dispensor.cpp
+++ b/engines/titanic/game/hammer_dispensor.cpp
@@ -28,7 +28,7 @@ CHammerDispensor::CHammerDispensor() : CBackground(),
 	_fieldE0(0), _fieldE4(0), _fieldE8(0) {
 }
 
-void CHammerDispensor::save(SimpleFile *file, int indent) const {
+void CHammerDispensor::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/hammer_dispensor.h b/engines/titanic/game/hammer_dispensor.h
index b99045d..9a58850 100644
--- a/engines/titanic/game/hammer_dispensor.h
+++ b/engines/titanic/game/hammer_dispensor.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/hammer_dispensor_button.cpp b/engines/titanic/game/hammer_dispensor_button.cpp
index eb9fa38..3346498 100644
--- a/engines/titanic/game/hammer_dispensor_button.cpp
+++ b/engines/titanic/game/hammer_dispensor_button.cpp
@@ -29,7 +29,7 @@ CHammerDispensorButton::CHammerDispensorButton() : CStartAction(),
 	_field108(6), _field10C(0), _field110(0) {
 }
 
-void CHammerDispensorButton::save(SimpleFile *file, int indent) const {
+void CHammerDispensorButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldF8, indent);
 	file->writeNumberLine(_fieldFC, indent);
diff --git a/engines/titanic/game/hammer_dispensor_button.h b/engines/titanic/game/hammer_dispensor_button.h
index 3f28360..5b91bbd 100644
--- a/engines/titanic/game/hammer_dispensor_button.h
+++ b/engines/titanic/game/hammer_dispensor_button.h
@@ -43,7 +43,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/head_slot.cpp b/engines/titanic/game/head_slot.cpp
index 4cb15cc..32650b7 100644
--- a/engines/titanic/game/head_slot.cpp
+++ b/engines/titanic/game/head_slot.cpp
@@ -31,7 +31,7 @@ CHeadSlot::CHeadSlot() : CGameObject(), _string1("NotWorking"), _string2("NULL")
 	_fieldE4(82), _fieldE8(112), _fieldEC(0) {
 }
 
-void CHeadSlot::save(SimpleFile *file, int indent) const {
+void CHeadSlot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeQuotedLine(_string1, indent);
diff --git a/engines/titanic/game/head_slot.h b/engines/titanic/game/head_slot.h
index 3ba94a6..b097947 100644
--- a/engines/titanic/game/head_slot.h
+++ b/engines/titanic/game/head_slot.h
@@ -47,7 +47,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/head_smash_event.cpp b/engines/titanic/game/head_smash_event.cpp
index a3d3395..5b79acf 100644
--- a/engines/titanic/game/head_smash_event.cpp
+++ b/engines/titanic/game/head_smash_event.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CHeadSmashEvent::save(SimpleFile *file, int indent) const {
+void CHeadSmashEvent::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CBackground::save(file, indent);
 }
diff --git a/engines/titanic/game/head_smash_event.h b/engines/titanic/game/head_smash_event.h
index 847e86e..9e21080 100644
--- a/engines/titanic/game/head_smash_event.h
+++ b/engines/titanic/game/head_smash_event.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/head_smash_lever.cpp b/engines/titanic/game/head_smash_lever.cpp
index 23ca96d..5a2fe1f 100644
--- a/engines/titanic/game/head_smash_lever.cpp
+++ b/engines/titanic/game/head_smash_lever.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CHeadSmashLever::CHeadSmashLever() : CBackground(),
 		_fieldE0(0), _fieldE4(0), _fieldE8(0) {}
 
-void CHeadSmashLever::save(SimpleFile *file, int indent) const {
+void CHeadSmashLever::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/head_smash_lever.h b/engines/titanic/game/head_smash_lever.h
index 8a67f56..a35a18c 100644
--- a/engines/titanic/game/head_smash_lever.h
+++ b/engines/titanic/game/head_smash_lever.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/head_spinner.cpp b/engines/titanic/game/head_spinner.cpp
index a01f4ea..2fb3654 100644
--- a/engines/titanic/game/head_spinner.cpp
+++ b/engines/titanic/game/head_spinner.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CHeadSpinner::save(SimpleFile *file, int indent) const {
+void CHeadSpinner::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value1, indent);
 	file->writeNumberLine(_value2, indent);
diff --git a/engines/titanic/game/head_spinner.h b/engines/titanic/game/head_spinner.h
index 3ed3e1f..8f1f8c2 100644
--- a/engines/titanic/game/head_spinner.h
+++ b/engines/titanic/game/head_spinner.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/idle_summoner.cpp b/engines/titanic/game/idle_summoner.cpp
index 3932726..19d760a 100644
--- a/engines/titanic/game/idle_summoner.cpp
+++ b/engines/titanic/game/idle_summoner.cpp
@@ -30,7 +30,7 @@ CIdleSummoner::CIdleSummoner() : CGameObject(), _fieldBC(0x57E40),
 	_fieldD8(0xEA60), _fieldDC(0xEA60) {
 }
 
-void CIdleSummoner::save(SimpleFile *file, int indent) const {
+void CIdleSummoner::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/idle_summoner.h b/engines/titanic/game/idle_summoner.h
index a983684..ccee7bc 100644
--- a/engines/titanic/game/idle_summoner.h
+++ b/engines/titanic/game/idle_summoner.h
@@ -45,7 +45,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/leave_sec_class_state.cpp b/engines/titanic/game/leave_sec_class_state.cpp
index 922bd98..0143062 100644
--- a/engines/titanic/game/leave_sec_class_state.cpp
+++ b/engines/titanic/game/leave_sec_class_state.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CLeaveSecClassState, CGameObject)
 
-void CLeaveSecClassState::save(SimpleFile *file, int indent) const {
+void CLeaveSecClassState::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/leave_sec_class_state.h b/engines/titanic/game/leave_sec_class_state.h
index 5f77436..fe55b94 100644
--- a/engines/titanic/game/leave_sec_class_state.h
+++ b/engines/titanic/game/leave_sec_class_state.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/lemon_dispensor.cpp b/engines/titanic/game/lemon_dispensor.cpp
index b13b6d8..8e1674c 100644
--- a/engines/titanic/game/lemon_dispensor.cpp
+++ b/engines/titanic/game/lemon_dispensor.cpp
@@ -32,7 +32,7 @@ CLemonDispensor::CLemonDispensor() : CBackground(),
 	_fieldE0(0), _fieldE4(9), _fieldE8(15), _fieldEC(0) {
 }
 
-void CLemonDispensor::save(SimpleFile *file, int indent) const {
+void CLemonDispensor::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
diff --git a/engines/titanic/game/lemon_dispensor.h b/engines/titanic/game/lemon_dispensor.h
index 091c6d7..fe5ab52 100644
--- a/engines/titanic/game/lemon_dispensor.h
+++ b/engines/titanic/game/lemon_dispensor.h
@@ -44,7 +44,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/light.cpp b/engines/titanic/game/light.cpp
index 6b5ff51..fd3c446 100644
--- a/engines/titanic/game/light.cpp
+++ b/engines/titanic/game/light.cpp
@@ -29,7 +29,7 @@ CLight::CLight() : CBackground(), _fieldE0(0), _fieldE4(0),
 	_fieldF8(0), _fieldFC(0) {
 }
 
-void CLight::save(SimpleFile *file, int indent) const {
+void CLight::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/light.h b/engines/titanic/game/light.h
index 625e256..b919c5f 100644
--- a/engines/titanic/game/light.h
+++ b/engines/titanic/game/light.h
@@ -46,7 +46,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/light_switch.cpp b/engines/titanic/game/light_switch.cpp
index 78a0548..3f5c8d2 100644
--- a/engines/titanic/game/light_switch.cpp
+++ b/engines/titanic/game/light_switch.cpp
@@ -30,7 +30,7 @@ CLightSwitch::CLightSwitch() : CBackground(),
 		_fieldE0(0), _fieldE4(0), _fieldE8(0) {
 }
 
-void CLightSwitch::save(SimpleFile *file, int indent) const {
+void CLightSwitch::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/light_switch.h b/engines/titanic/game/light_switch.h
index 80adf81..c8728e0 100644
--- a/engines/titanic/game/light_switch.h
+++ b/engines/titanic/game/light_switch.h
@@ -43,7 +43,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/little_lift_button.cpp b/engines/titanic/game/little_lift_button.cpp
index 3e2fbdd..5005cb1 100644
--- a/engines/titanic/game/little_lift_button.cpp
+++ b/engines/titanic/game/little_lift_button.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CLittleLiftButton::save(SimpleFile *file, int indent) const {
+void CLittleLiftButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CBackground::save(file, indent);
diff --git a/engines/titanic/game/little_lift_button.h b/engines/titanic/game/little_lift_button.h
index 92f084a..451c6ce 100644
--- a/engines/titanic/game/little_lift_button.h
+++ b/engines/titanic/game/little_lift_button.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/long_stick_dispenser.cpp b/engines/titanic/game/long_stick_dispenser.cpp
index cf11096..cb562ec 100644
--- a/engines/titanic/game/long_stick_dispenser.cpp
+++ b/engines/titanic/game/long_stick_dispenser.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CLongStickDispenser::save(SimpleFile *file, int indent) const {
+void CLongStickDispenser::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/long_stick_dispenser.h b/engines/titanic/game/long_stick_dispenser.h
index bf5db20..6306686 100644
--- a/engines/titanic/game/long_stick_dispenser.h
+++ b/engines/titanic/game/long_stick_dispenser.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/maitred/maitred_arm_holder.cpp b/engines/titanic/game/maitred/maitred_arm_holder.cpp
index b6fc494..4d35277 100644
--- a/engines/titanic/game/maitred/maitred_arm_holder.cpp
+++ b/engines/titanic/game/maitred/maitred_arm_holder.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMaitreDArmHolder::save(SimpleFile *file, int indent) const {
+void CMaitreDArmHolder::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CDropTarget::save(file, indent);
 }
diff --git a/engines/titanic/game/maitred/maitred_arm_holder.h b/engines/titanic/game/maitred/maitred_arm_holder.h
index e329157..c823bd9 100644
--- a/engines/titanic/game/maitred/maitred_arm_holder.h
+++ b/engines/titanic/game/maitred/maitred_arm_holder.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/maitred/maitred_body.cpp b/engines/titanic/game/maitred/maitred_body.cpp
index 4cdd589..6b495e5 100644
--- a/engines/titanic/game/maitred/maitred_body.cpp
+++ b/engines/titanic/game/maitred/maitred_body.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMaitreDLegs::save(SimpleFile *file, int indent) const {
+void CMaitreDLegs::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldC8, indent);
 	CMaitreDProdReceptor::save(file, indent);
diff --git a/engines/titanic/game/maitred/maitred_body.h b/engines/titanic/game/maitred/maitred_body.h
index 9dcc2af..52e2ac8 100644
--- a/engines/titanic/game/maitred/maitred_body.h
+++ b/engines/titanic/game/maitred/maitred_body.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/maitred/maitred_legs.cpp b/engines/titanic/game/maitred/maitred_legs.cpp
index ce7054e..5071805 100644
--- a/engines/titanic/game/maitred/maitred_legs.cpp
+++ b/engines/titanic/game/maitred/maitred_legs.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMaitreDBody::save(SimpleFile *file, int indent) const {
+void CMaitreDBody::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldC8, indent);
 	CMaitreDProdReceptor::save(file, indent);
diff --git a/engines/titanic/game/maitred/maitred_legs.h b/engines/titanic/game/maitred/maitred_legs.h
index 0dc1b34..5ee9482 100644
--- a/engines/titanic/game/maitred/maitred_legs.h
+++ b/engines/titanic/game/maitred/maitred_legs.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/maitred/maitred_prod_receptor.cpp b/engines/titanic/game/maitred/maitred_prod_receptor.cpp
index 6e6143c..4823f14 100644
--- a/engines/titanic/game/maitred/maitred_prod_receptor.cpp
+++ b/engines/titanic/game/maitred/maitred_prod_receptor.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMaitreDProdReceptor::save(SimpleFile *file, int indent) const {
+void CMaitreDProdReceptor::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/maitred/maitred_prod_receptor.h b/engines/titanic/game/maitred/maitred_prod_receptor.h
index b82c95b..5138d46 100644
--- a/engines/titanic/game/maitred/maitred_prod_receptor.h
+++ b/engines/titanic/game/maitred/maitred_prod_receptor.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/missiveomat.cpp b/engines/titanic/game/missiveomat.cpp
index fbe430f..931b146 100644
--- a/engines/titanic/game/missiveomat.cpp
+++ b/engines/titanic/game/missiveomat.cpp
@@ -28,7 +28,7 @@ CMissiveOMat::CMissiveOMat() : CGameObject(), _fieldBC(1),
 	_fieldC0(0), _fieldC4(0), _fieldE0(-1) {
 }
 
-void CMissiveOMat::save(SimpleFile *file, int indent) const {
+void CMissiveOMat::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/missiveomat.h b/engines/titanic/game/missiveomat.h
index a58c928..1b7850f 100644
--- a/engines/titanic/game/missiveomat.h
+++ b/engines/titanic/game/missiveomat.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/missiveomat_button.cpp b/engines/titanic/game/missiveomat_button.cpp
index 8f0918a..d5ae75d 100644
--- a/engines/titanic/game/missiveomat_button.cpp
+++ b/engines/titanic/game/missiveomat_button.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMissiveOMatButton::save(SimpleFile *file, int indent) const {
+void CMissiveOMatButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldFC, indent);
 
diff --git a/engines/titanic/game/missiveomat_button.h b/engines/titanic/game/missiveomat_button.h
index 603d2f5..eb00b7e 100644
--- a/engines/titanic/game/missiveomat_button.h
+++ b/engines/titanic/game/missiveomat_button.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/movie_tester.cpp b/engines/titanic/game/movie_tester.cpp
index 0a4f4a9..1b266d9 100644
--- a/engines/titanic/game/movie_tester.cpp
+++ b/engines/titanic/game/movie_tester.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMovieTester::save(SimpleFile *file, int indent) const {
+void CMovieTester::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value1, indent);
 	file->writeNumberLine(_value2, indent);
diff --git a/engines/titanic/game/movie_tester.h b/engines/titanic/game/movie_tester.h
index 2fffd5d..cf39ae3 100644
--- a/engines/titanic/game/movie_tester.h
+++ b/engines/titanic/game/movie_tester.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/music_console_button.cpp b/engines/titanic/game/music_console_button.cpp
index d92dd4d..1bc78ff 100644
--- a/engines/titanic/game/music_console_button.cpp
+++ b/engines/titanic/game/music_console_button.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMusicConsoleButton::save(SimpleFile *file, int indent) const {
+void CMusicConsoleButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CMusicPlayer::save(file, indent);
 }
diff --git a/engines/titanic/game/music_console_button.h b/engines/titanic/game/music_console_button.h
index f6c33a9..1a1861b 100644
--- a/engines/titanic/game/music_console_button.h
+++ b/engines/titanic/game/music_console_button.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/music_room_phonograph.cpp b/engines/titanic/game/music_room_phonograph.cpp
index c08b230..2fceca2 100644
--- a/engines/titanic/game/music_room_phonograph.cpp
+++ b/engines/titanic/game/music_room_phonograph.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CMusicRoomPhonograph, CRestaurantPhonograph)
 
-void CMusicRoomPhonograph::save(SimpleFile *file, int indent) const {
+void CMusicRoomPhonograph::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field118, indent);
 	CRestaurantPhonograph::save(file, indent);
diff --git a/engines/titanic/game/music_room_phonograph.h b/engines/titanic/game/music_room_phonograph.h
index cad59f3..dcc7267 100644
--- a/engines/titanic/game/music_room_phonograph.h
+++ b/engines/titanic/game/music_room_phonograph.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/music_room_stop_phonograph_button.cpp b/engines/titanic/game/music_room_stop_phonograph_button.cpp
index 7e00bad..44342fc 100644
--- a/engines/titanic/game/music_room_stop_phonograph_button.cpp
+++ b/engines/titanic/game/music_room_stop_phonograph_button.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMusicRoomStopPhonographButton::save(SimpleFile *file, int indent) const {
+void CMusicRoomStopPhonographButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field100, indent);
 	CEjectPhonographButton::save(file, indent);
diff --git a/engines/titanic/game/music_room_stop_phonograph_button.h b/engines/titanic/game/music_room_stop_phonograph_button.h
index c37065f..81cd755 100644
--- a/engines/titanic/game/music_room_stop_phonograph_button.h
+++ b/engines/titanic/game/music_room_stop_phonograph_button.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/music_system_lock.cpp b/engines/titanic/game/music_system_lock.cpp
index 6bd83f6..f1e062b 100644
--- a/engines/titanic/game/music_system_lock.cpp
+++ b/engines/titanic/game/music_system_lock.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMusicSystemLock::save(SimpleFile *file, int indent) const {
+void CMusicSystemLock::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CDropTarget::save(file, indent);
diff --git a/engines/titanic/game/music_system_lock.h b/engines/titanic/game/music_system_lock.h
index b5f4da5..ad722ca 100644
--- a/engines/titanic/game/music_system_lock.h
+++ b/engines/titanic/game/music_system_lock.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/musical_instrument.cpp b/engines/titanic/game/musical_instrument.cpp
index 6480f9f..aea58b4 100644
--- a/engines/titanic/game/musical_instrument.cpp
+++ b/engines/titanic/game/musical_instrument.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CMusicalInstrument, CBackground)
 
-void CMusicalInstrument::save(SimpleFile *file, int indent) const {
+void CMusicalInstrument::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CBackground::save(file, indent);
 }
diff --git a/engines/titanic/game/musical_instrument.h b/engines/titanic/game/musical_instrument.h
index 5bc7446..273770c 100644
--- a/engines/titanic/game/musical_instrument.h
+++ b/engines/titanic/game/musical_instrument.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/nav_helmet.cpp b/engines/titanic/game/nav_helmet.cpp
index c1dbb11..770eb73 100644
--- a/engines/titanic/game/nav_helmet.cpp
+++ b/engines/titanic/game/nav_helmet.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CNavHelmet::save(SimpleFile *file, int indent) const {
+void CNavHelmet::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/nav_helmet.h b/engines/titanic/game/nav_helmet.h
index ff39280..5e17622 100644
--- a/engines/titanic/game/nav_helmet.h
+++ b/engines/titanic/game/nav_helmet.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/navigation_computer.cpp b/engines/titanic/game/navigation_computer.cpp
index 7e04f84..042901c 100644
--- a/engines/titanic/game/navigation_computer.cpp
+++ b/engines/titanic/game/navigation_computer.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CNavigationComputer, CGameObject)
 
-void CNavigationComputer::save(SimpleFile *file, int indent) const {
+void CNavigationComputer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/navigation_computer.h b/engines/titanic/game/navigation_computer.h
index 5315c88..f24cbad 100644
--- a/engines/titanic/game/navigation_computer.h
+++ b/engines/titanic/game/navigation_computer.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/no_nut_bowl.cpp b/engines/titanic/game/no_nut_bowl.cpp
index 354dea3..47f9d79 100644
--- a/engines/titanic/game/no_nut_bowl.cpp
+++ b/engines/titanic/game/no_nut_bowl.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CNoNutBowl::save(SimpleFile *file, int indent) const {
+void CNoNutBowl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CBackground::save(file, indent);
 }
diff --git a/engines/titanic/game/no_nut_bowl.h b/engines/titanic/game/no_nut_bowl.h
index 7557491..5cb3aa2 100644
--- a/engines/titanic/game/no_nut_bowl.h
+++ b/engines/titanic/game/no_nut_bowl.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/nose_holder.cpp b/engines/titanic/game/nose_holder.cpp
index ba512d0..cd9433e 100644
--- a/engines/titanic/game/nose_holder.cpp
+++ b/engines/titanic/game/nose_holder.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CNoseHolder::CNoseHolder() : CDropTarget(), _field118(0), _field11C(0) {
 }
 
-void CNoseHolder::save(SimpleFile *file, int indent) const {
+void CNoseHolder::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field11C, indent);
 
diff --git a/engines/titanic/game/nose_holder.h b/engines/titanic/game/nose_holder.h
index e26c70f..6e25835 100644
--- a/engines/titanic/game/nose_holder.h
+++ b/engines/titanic/game/nose_holder.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/null_port_hole.cpp b/engines/titanic/game/null_port_hole.cpp
index 93dd7eb..060e5f0 100644
--- a/engines/titanic/game/null_port_hole.cpp
+++ b/engines/titanic/game/null_port_hole.cpp
@@ -31,7 +31,7 @@ CNullPortHole::CNullPortHole() : CClickResponder() {
 	_string2 = "b#48.wav";
 }
 
-void CNullPortHole::save(SimpleFile *file, int indent) const {
+void CNullPortHole::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string2, indent);
 	file->writeQuotedLine(_string1, indent);
diff --git a/engines/titanic/game/null_port_hole.h b/engines/titanic/game/null_port_hole.h
index be335ef..3170a84 100644
--- a/engines/titanic/game/null_port_hole.h
+++ b/engines/titanic/game/null_port_hole.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/nut_replacer.cpp b/engines/titanic/game/nut_replacer.cpp
index 36c0510..9a73355 100644
--- a/engines/titanic/game/nut_replacer.cpp
+++ b/engines/titanic/game/nut_replacer.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CNutReplacer::save(SimpleFile *file, int indent) const {
+void CNutReplacer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/nut_replacer.h b/engines/titanic/game/nut_replacer.h
index 0917b40..6a8e014 100644
--- a/engines/titanic/game/nut_replacer.h
+++ b/engines/titanic/game/nut_replacer.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/parrot/parrot_lobby_controller.cpp b/engines/titanic/game/parrot/parrot_lobby_controller.cpp
index 2376cea..f1e054a 100644
--- a/engines/titanic/game/parrot/parrot_lobby_controller.cpp
+++ b/engines/titanic/game/parrot/parrot_lobby_controller.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CParrotLobbyController::save(SimpleFile *file, int indent) const {
+void CParrotLobbyController::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CParrotLobbyObject::save(file, indent);
 }
diff --git a/engines/titanic/game/parrot/parrot_lobby_controller.h b/engines/titanic/game/parrot/parrot_lobby_controller.h
index 6515a23..9f5ddca 100644
--- a/engines/titanic/game/parrot/parrot_lobby_controller.h
+++ b/engines/titanic/game/parrot/parrot_lobby_controller.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/parrot/parrot_lobby_link_updater.cpp b/engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
index e62e9dd..25d5ec7 100644
--- a/engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
+++ b/engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CParrotLobbyLinkUpdater::save(SimpleFile *file, int indent) const {
+void CParrotLobbyLinkUpdater::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CParrotLobbyObject::save(file, indent);
 }
diff --git a/engines/titanic/game/parrot/parrot_lobby_link_updater.h b/engines/titanic/game/parrot/parrot_lobby_link_updater.h
index 2f3ce7b..a433f0b 100644
--- a/engines/titanic/game/parrot/parrot_lobby_link_updater.h
+++ b/engines/titanic/game/parrot/parrot_lobby_link_updater.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/parrot/parrot_lobby_object.cpp b/engines/titanic/game/parrot/parrot_lobby_object.cpp
index 8090a1d..9d556b5 100644
--- a/engines/titanic/game/parrot/parrot_lobby_object.cpp
+++ b/engines/titanic/game/parrot/parrot_lobby_object.cpp
@@ -38,7 +38,7 @@ void CParrotLobbyObject::init() {
 	_v4 = 7;
 }
 
-void CParrotLobbyObject::save(SimpleFile *file, int indent) const {
+void CParrotLobbyObject::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
diff --git a/engines/titanic/game/parrot/parrot_lobby_object.h b/engines/titanic/game/parrot/parrot_lobby_object.h
index 5b53276..967ad23 100644
--- a/engines/titanic/game/parrot/parrot_lobby_object.h
+++ b/engines/titanic/game/parrot/parrot_lobby_object.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/parrot/parrot_lobby_view_object.cpp b/engines/titanic/game/parrot/parrot_lobby_view_object.cpp
index 740eac8..ae39803 100644
--- a/engines/titanic/game/parrot/parrot_lobby_view_object.cpp
+++ b/engines/titanic/game/parrot/parrot_lobby_view_object.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CParrotLobbyViewObject::save(SimpleFile *file, int indent) const {
+void CParrotLobbyViewObject::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);	
 	CParrotLobbyObject::save(file, indent);
diff --git a/engines/titanic/game/parrot/parrot_lobby_view_object.h b/engines/titanic/game/parrot/parrot_lobby_view_object.h
index 1e3e398..656924f 100644
--- a/engines/titanic/game/parrot/parrot_lobby_view_object.h
+++ b/engines/titanic/game/parrot/parrot_lobby_view_object.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/parrot/parrot_loser.cpp b/engines/titanic/game/parrot/parrot_loser.cpp
index e82506e..6e23ef8 100644
--- a/engines/titanic/game/parrot/parrot_loser.cpp
+++ b/engines/titanic/game/parrot/parrot_loser.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CParrotLoser::save(SimpleFile *file, int indent) const {
+void CParrotLoser::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/parrot/parrot_loser.h b/engines/titanic/game/parrot/parrot_loser.h
index 806195d..c1e6c9f 100644
--- a/engines/titanic/game/parrot/parrot_loser.h
+++ b/engines/titanic/game/parrot/parrot_loser.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/parrot/parrot_nut_bowl_actor.cpp b/engines/titanic/game/parrot/parrot_nut_bowl_actor.cpp
index 0917319..c83d66c 100644
--- a/engines/titanic/game/parrot/parrot_nut_bowl_actor.cpp
+++ b/engines/titanic/game/parrot/parrot_nut_bowl_actor.cpp
@@ -28,7 +28,7 @@ CParrotNutBowlActor::CParrotNutBowlActor() : CGameObject(),
 		_value1(0), _value2(0) {
 }
 
-void CParrotNutBowlActor::save(SimpleFile *file, int indent) const {
+void CParrotNutBowlActor::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value1, indent);
 	file->writeNumberLine(_value2, indent);
diff --git a/engines/titanic/game/parrot/parrot_nut_bowl_actor.h b/engines/titanic/game/parrot/parrot_nut_bowl_actor.h
index d1ccca6..34be83a 100644
--- a/engines/titanic/game/parrot/parrot_nut_bowl_actor.h
+++ b/engines/titanic/game/parrot/parrot_nut_bowl_actor.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/parrot/parrot_nut_eater.cpp b/engines/titanic/game/parrot/parrot_nut_eater.cpp
index 9d58632..309b379 100644
--- a/engines/titanic/game/parrot/parrot_nut_eater.cpp
+++ b/engines/titanic/game/parrot/parrot_nut_eater.cpp
@@ -28,7 +28,7 @@ CParrotNutEater::CParrotNutEater() : CGameObject(), _fieldBC(0),
 		_fieldC0(69), _fieldC4(132), _fieldC8(0), _fieldCC(68) {
 }
 
-void CParrotNutEater::save(SimpleFile *file, int indent) const {
+void CParrotNutEater::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	
diff --git a/engines/titanic/game/parrot/parrot_nut_eater.h b/engines/titanic/game/parrot/parrot_nut_eater.h
index 6a7afd9..fe0a3ae 100644
--- a/engines/titanic/game/parrot/parrot_nut_eater.h
+++ b/engines/titanic/game/parrot/parrot_nut_eater.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/parrot/parrot_perch_holder.cpp b/engines/titanic/game/parrot/parrot_perch_holder.cpp
index 00dfe4a..dd85239 100644
--- a/engines/titanic/game/parrot/parrot_perch_holder.cpp
+++ b/engines/titanic/game/parrot/parrot_perch_holder.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CParrotPerchHolder::save(SimpleFile *file, int indent) const {
+void CParrotPerchHolder::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CMultiDropTarget::save(file, indent);
 }
diff --git a/engines/titanic/game/parrot/parrot_perch_holder.h b/engines/titanic/game/parrot/parrot_perch_holder.h
index f355263..8c7a441 100644
--- a/engines/titanic/game/parrot/parrot_perch_holder.h
+++ b/engines/titanic/game/parrot/parrot_perch_holder.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/parrot/parrot_succubus.cpp b/engines/titanic/game/parrot/parrot_succubus.cpp
index e29c6a6..02a29b7 100644
--- a/engines/titanic/game/parrot/parrot_succubus.cpp
+++ b/engines/titanic/game/parrot/parrot_succubus.cpp
@@ -28,7 +28,7 @@ CParrotSuccUBus::CParrotSuccUBus() : CSuccUBus(), _field1DC(0),
 	_field1EC(0), _field1F0(376), _field1F4(393) {
 }
 
-void CParrotSuccUBus::save(SimpleFile *file, int indent) const {
+void CParrotSuccUBus::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field1DC, indent);
 	file->writeQuotedLine(_string3, indent);
diff --git a/engines/titanic/game/parrot/parrot_succubus.h b/engines/titanic/game/parrot/parrot_succubus.h
index e60d35c..7984cc6 100644
--- a/engines/titanic/game/parrot/parrot_succubus.h
+++ b/engines/titanic/game/parrot/parrot_succubus.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/parrot/parrot_trigger.cpp b/engines/titanic/game/parrot/parrot_trigger.cpp
index aeab3c1..36e99ad 100644
--- a/engines/titanic/game/parrot/parrot_trigger.cpp
+++ b/engines/titanic/game/parrot/parrot_trigger.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CParrotTrigger::save(SimpleFile *file, int indent) const {
+void CParrotTrigger::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/parrot/parrot_trigger.h b/engines/titanic/game/parrot/parrot_trigger.h
index 33aea15..f2d1d7e 100644
--- a/engines/titanic/game/parrot/parrot_trigger.h
+++ b/engines/titanic/game/parrot/parrot_trigger.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/parrot/player_meets_parrot.cpp b/engines/titanic/game/parrot/player_meets_parrot.cpp
index 15dd2900..6db9345 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.cpp
+++ b/engines/titanic/game/parrot/player_meets_parrot.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPlayerMeetsParrot::save(SimpleFile *file, int indent) const {
+void CPlayerMeetsParrot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/parrot/player_meets_parrot.h b/engines/titanic/game/parrot/player_meets_parrot.h
index 53fa63a..0a72099 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.h
+++ b/engines/titanic/game/parrot/player_meets_parrot.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pet/pet.cpp b/engines/titanic/game/pet/pet.cpp
index 3e65755..cd4e16d 100644
--- a/engines/titanic/game/pet/pet.cpp
+++ b/engines/titanic/game/pet/pet.cpp
@@ -28,7 +28,7 @@ CPET::CPET() : CGameObject(), _fieldBC(0), _fieldC0(3),
 	_fieldC4(0), _fieldC8(0), _fieldD8(0), _fieldDC(0) {
 }
 
-void CPET::save(SimpleFile *file, int indent) const {
+void CPET::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/pet/pet.h b/engines/titanic/game/pet/pet.h
index 58e3577..de62294 100644
--- a/engines/titanic/game/pet/pet.h
+++ b/engines/titanic/game/pet/pet.h
@@ -43,7 +43,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pet/pet_class1.cpp b/engines/titanic/game/pet/pet_class1.cpp
index b0407ef..096977e 100644
--- a/engines/titanic/game/pet/pet_class1.cpp
+++ b/engines/titanic/game/pet/pet_class1.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CPETClass1, CGameObject)
 
-void CPETClass1::save(SimpleFile *file, int indent) const {
+void CPETClass1::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/pet/pet_class1.h b/engines/titanic/game/pet/pet_class1.h
index e22b214..aeb01ad 100644
--- a/engines/titanic/game/pet/pet_class1.h
+++ b/engines/titanic/game/pet/pet_class1.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pet/pet_class2.cpp b/engines/titanic/game/pet/pet_class2.cpp
index 8809f84..d13ed66 100644
--- a/engines/titanic/game/pet/pet_class2.cpp
+++ b/engines/titanic/game/pet/pet_class2.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CPETClass2, CGameObject)
 
-void CPETClass2::save(SimpleFile *file, int indent) const {
+void CPETClass2::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/pet/pet_class2.h b/engines/titanic/game/pet/pet_class2.h
index 529f953..aa85397 100644
--- a/engines/titanic/game/pet/pet_class2.h
+++ b/engines/titanic/game/pet/pet_class2.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pet/pet_class3.cpp b/engines/titanic/game/pet/pet_class3.cpp
index 81ddf8a..0c0adf2 100644
--- a/engines/titanic/game/pet/pet_class3.cpp
+++ b/engines/titanic/game/pet/pet_class3.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CPETClass3, CGameObject)
 
-void CPETClass3::save(SimpleFile *file, int indent) const {
+void CPETClass3::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/pet/pet_class3.h b/engines/titanic/game/pet/pet_class3.h
index d34c9d3..733186a 100644
--- a/engines/titanic/game/pet/pet_class3.h
+++ b/engines/titanic/game/pet/pet_class3.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pet/pet_lift.cpp b/engines/titanic/game/pet/pet_lift.cpp
index 8a16c67..39b0d01 100644
--- a/engines/titanic/game/pet/pet_lift.cpp
+++ b/engines/titanic/game/pet/pet_lift.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPETLift::save(SimpleFile *file, int indent) const {
+void CPETLift::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPETTransport::save(file, indent);
 }
diff --git a/engines/titanic/game/pet/pet_lift.h b/engines/titanic/game/pet/pet_lift.h
index 1c56b05..9bdf531 100644
--- a/engines/titanic/game/pet/pet_lift.h
+++ b/engines/titanic/game/pet/pet_lift.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pet/pet_monitor.cpp b/engines/titanic/game/pet/pet_monitor.cpp
index ebbddd8..6a0d207 100644
--- a/engines/titanic/game/pet/pet_monitor.cpp
+++ b/engines/titanic/game/pet/pet_monitor.cpp
@@ -28,7 +28,7 @@ BEGIN_MESSAGE_MAP(CPETMonitor, CGameObject)
 	ON_MESSAGE(EnterRoomMsg)
 END_MESSAGE_MAP()
 
-void CPETMonitor::save(SimpleFile *file, int indent) const {
+void CPETMonitor::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/pet/pet_monitor.h b/engines/titanic/game/pet/pet_monitor.h
index a53f360..140c17b 100644
--- a/engines/titanic/game/pet/pet_monitor.h
+++ b/engines/titanic/game/pet/pet_monitor.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pet/pet_pellerator.cpp b/engines/titanic/game/pet/pet_pellerator.cpp
index bcddc75..a29942c 100644
--- a/engines/titanic/game/pet/pet_pellerator.cpp
+++ b/engines/titanic/game/pet/pet_pellerator.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPETPellerator::save(SimpleFile *file, int indent) const {
+void CPETPellerator::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPETTransport::save(file, indent);
 }
diff --git a/engines/titanic/game/pet/pet_pellerator.h b/engines/titanic/game/pet/pet_pellerator.h
index 1036c93..31b44e3 100644
--- a/engines/titanic/game/pet/pet_pellerator.h
+++ b/engines/titanic/game/pet/pet_pellerator.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pet/pet_position.cpp b/engines/titanic/game/pet/pet_position.cpp
index 66e8e36..9f58093 100644
--- a/engines/titanic/game/pet/pet_position.cpp
+++ b/engines/titanic/game/pet/pet_position.cpp
@@ -28,7 +28,7 @@ BEGIN_MESSAGE_MAP(CPETPosition, CGameObject)
 	ON_MESSAGE(EnterRoomMsg)
 END_MESSAGE_MAP()
 
-void CPETPosition::save(SimpleFile *file, int indent) const {
+void CPETPosition::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/pet/pet_position.h b/engines/titanic/game/pet/pet_position.h
index f4f0fd5..63c0bf2 100644
--- a/engines/titanic/game/pet/pet_position.h
+++ b/engines/titanic/game/pet/pet_position.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pet/pet_sentinal.cpp b/engines/titanic/game/pet/pet_sentinal.cpp
index 4ced872..1b647d7 100644
--- a/engines/titanic/game/pet/pet_sentinal.cpp
+++ b/engines/titanic/game/pet/pet_sentinal.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPETSentinal::save(SimpleFile *file, int indent) const {
+void CPETSentinal::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/pet/pet_sentinal.h b/engines/titanic/game/pet/pet_sentinal.h
index 728ddbf..8b1e992 100644
--- a/engines/titanic/game/pet/pet_sentinal.h
+++ b/engines/titanic/game/pet/pet_sentinal.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pet/pet_sounds.cpp b/engines/titanic/game/pet/pet_sounds.cpp
index abf6ba3..d612c74 100644
--- a/engines/titanic/game/pet/pet_sounds.cpp
+++ b/engines/titanic/game/pet/pet_sounds.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPETSounds::save(SimpleFile *file, int indent) const {
+void CPETSounds::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/pet/pet_sounds.h b/engines/titanic/game/pet/pet_sounds.h
index f099d9e..3513da5 100644
--- a/engines/titanic/game/pet/pet_sounds.h
+++ b/engines/titanic/game/pet/pet_sounds.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pet/pet_transition.cpp b/engines/titanic/game/pet/pet_transition.cpp
index fed2d2c..33cc36c 100644
--- a/engines/titanic/game/pet/pet_transition.cpp
+++ b/engines/titanic/game/pet/pet_transition.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPETTransition::save(SimpleFile *file, int indent) const {
+void CPETTransition::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/pet/pet_transition.h b/engines/titanic/game/pet/pet_transition.h
index c8dc153..9e4a628 100644
--- a/engines/titanic/game/pet/pet_transition.h
+++ b/engines/titanic/game/pet/pet_transition.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pet/pet_transport.cpp b/engines/titanic/game/pet/pet_transport.cpp
index bcbf319..9661cac 100644
--- a/engines/titanic/game/pet/pet_transport.cpp
+++ b/engines/titanic/game/pet/pet_transport.cpp
@@ -28,7 +28,7 @@ BEGIN_MESSAGE_MAP(CPETTransport, CGameObject)
 	ON_MESSAGE(EnterRoomMsg)
 END_MESSAGE_MAP()
 
-void CPETTransport::save(SimpleFile *file, int indent) const {
+void CPETTransport::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/pet/pet_transport.h b/engines/titanic/game/pet/pet_transport.h
index 052fd7b..e580ab8 100644
--- a/engines/titanic/game/pet/pet_transport.h
+++ b/engines/titanic/game/pet/pet_transport.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pet_disabler.cpp b/engines/titanic/game/pet_disabler.cpp
index 94a4964..2275156 100644
--- a/engines/titanic/game/pet_disabler.cpp
+++ b/engines/titanic/game/pet_disabler.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPetDisabler::save(SimpleFile *file, int indent) const {
+void CPetDisabler::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/pet_disabler.h b/engines/titanic/game/pet_disabler.h
index 5db5d7b..5928d44 100644
--- a/engines/titanic/game/pet_disabler.h
+++ b/engines/titanic/game/pet_disabler.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/phonograph.cpp b/engines/titanic/game/phonograph.cpp
index f086376..9740e29 100644
--- a/engines/titanic/game/phonograph.cpp
+++ b/engines/titanic/game/phonograph.cpp
@@ -29,7 +29,7 @@ CPhonograph::CPhonograph() : CMusicPlayer(),
 	_fieldF0(0), _fieldF4(0) {
 }
 
-void CPhonograph::save(SimpleFile *file, int indent) const {
+void CPhonograph::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string2, indent);
 	file->writeNumberLine(_fieldE0, indent);
diff --git a/engines/titanic/game/phonograph.h b/engines/titanic/game/phonograph.h
index c5f5a90..e0f407b 100644
--- a/engines/titanic/game/phonograph.h
+++ b/engines/titanic/game/phonograph.h
@@ -45,7 +45,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/phonograph_lid.cpp b/engines/titanic/game/phonograph_lid.cpp
index a228af8..a051842 100644
--- a/engines/titanic/game/phonograph_lid.cpp
+++ b/engines/titanic/game/phonograph_lid.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPhonographLid::save(SimpleFile *file, int indent) const {
+void CPhonographLid::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/phonograph_lid.h b/engines/titanic/game/phonograph_lid.h
index 38c8924..486a9b4 100644
--- a/engines/titanic/game/phonograph_lid.h
+++ b/engines/titanic/game/phonograph_lid.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pickup/pick_up.cpp b/engines/titanic/game/pickup/pick_up.cpp
index 58ffc5a..c660a36 100644
--- a/engines/titanic/game/pickup/pick_up.cpp
+++ b/engines/titanic/game/pickup/pick_up.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPickUp::save(SimpleFile *file, int indent) const {
+void CPickUp::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/pickup/pick_up.h b/engines/titanic/game/pickup/pick_up.h
index d5a8580..76537d1 100644
--- a/engines/titanic/game/pickup/pick_up.h
+++ b/engines/titanic/game/pickup/pick_up.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pickup/pick_up_bar_glass.cpp b/engines/titanic/game/pickup/pick_up_bar_glass.cpp
index 1d475c2..85b8832 100644
--- a/engines/titanic/game/pickup/pick_up_bar_glass.cpp
+++ b/engines/titanic/game/pickup/pick_up_bar_glass.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPickUpBarGlass::save(SimpleFile *file, int indent) const {
+void CPickUpBarGlass::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPickUp::save(file, indent);
 }
diff --git a/engines/titanic/game/pickup/pick_up_bar_glass.h b/engines/titanic/game/pickup/pick_up_bar_glass.h
index f1c7555..f9bcb00 100644
--- a/engines/titanic/game/pickup/pick_up_bar_glass.h
+++ b/engines/titanic/game/pickup/pick_up_bar_glass.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pickup/pick_up_hose.cpp b/engines/titanic/game/pickup/pick_up_hose.cpp
index e6902cb..7375dda 100644
--- a/engines/titanic/game/pickup/pick_up_hose.cpp
+++ b/engines/titanic/game/pickup/pick_up_hose.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 int CPickUpHose::_v1;
 
-void CPickUpHose::save(SimpleFile *file, int indent) const {
+void CPickUpHose::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
 	file->writeNumberLine(_v1, indent);
diff --git a/engines/titanic/game/pickup/pick_up_hose.h b/engines/titanic/game/pickup/pick_up_hose.h
index 9014934..68bec36 100644
--- a/engines/titanic/game/pickup/pick_up_hose.h
+++ b/engines/titanic/game/pickup/pick_up_hose.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pickup/pick_up_lemon.cpp b/engines/titanic/game/pickup/pick_up_lemon.cpp
index 7364fee..772114f 100644
--- a/engines/titanic/game/pickup/pick_up_lemon.cpp
+++ b/engines/titanic/game/pickup/pick_up_lemon.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPickUpLemon::save(SimpleFile *file, int indent) const {
+void CPickUpLemon::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPickUp::save(file, indent);
 }
diff --git a/engines/titanic/game/pickup/pick_up_lemon.h b/engines/titanic/game/pickup/pick_up_lemon.h
index dc2942f..9bed9ce 100644
--- a/engines/titanic/game/pickup/pick_up_lemon.h
+++ b/engines/titanic/game/pickup/pick_up_lemon.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pickup/pick_up_speech_centre.cpp b/engines/titanic/game/pickup/pick_up_speech_centre.cpp
index 74c4739..0b9a8d2 100644
--- a/engines/titanic/game/pickup/pick_up_speech_centre.cpp
+++ b/engines/titanic/game/pickup/pick_up_speech_centre.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPickUpSpeechCentre::save(SimpleFile *file, int indent) const {
+void CPickUpSpeechCentre::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPickUp::save(file, indent);
 }
diff --git a/engines/titanic/game/pickup/pick_up_speech_centre.h b/engines/titanic/game/pickup/pick_up_speech_centre.h
index 5d7d133..a74566b 100644
--- a/engines/titanic/game/pickup/pick_up_speech_centre.h
+++ b/engines/titanic/game/pickup/pick_up_speech_centre.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/pickup/pick_up_vis_centre.cpp b/engines/titanic/game/pickup/pick_up_vis_centre.cpp
index 8fda66f..796e467 100644
--- a/engines/titanic/game/pickup/pick_up_vis_centre.cpp
+++ b/engines/titanic/game/pickup/pick_up_vis_centre.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPickUpVisCentre::save(SimpleFile *file, int indent) const {
+void CPickUpVisCentre::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPickUp::save(file, indent);
 }
diff --git a/engines/titanic/game/pickup/pick_up_vis_centre.h b/engines/titanic/game/pickup/pick_up_vis_centre.h
index 4345fce..059c4f8 100644
--- a/engines/titanic/game/pickup/pick_up_vis_centre.h
+++ b/engines/titanic/game/pickup/pick_up_vis_centre.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp b/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
index f3eda05..a8a33fe 100644
--- a/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
+++ b/engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBarShelfVisCentre::save(SimpleFile *file, int indent) const {
+void CBarShelfVisCentre::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CPlaceHolderItem::save(file, indent);
diff --git a/engines/titanic/game/placeholder/bar_shelf_vis_centre.h b/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
index a5acff6..7cb4478 100644
--- a/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
+++ b/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/placeholder/lemon_on_bar.cpp b/engines/titanic/game/placeholder/lemon_on_bar.cpp
index d51f4b8..08d686e 100644
--- a/engines/titanic/game/placeholder/lemon_on_bar.cpp
+++ b/engines/titanic/game/placeholder/lemon_on_bar.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CLemonOnBar::save(SimpleFile *file, int indent) const {
+void CLemonOnBar::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writePoint(_pos1, indent);
 	CPlaceHolderItem::save(file, indent);
diff --git a/engines/titanic/game/placeholder/lemon_on_bar.h b/engines/titanic/game/placeholder/lemon_on_bar.h
index d1654bf..030481e 100644
--- a/engines/titanic/game/placeholder/lemon_on_bar.h
+++ b/engines/titanic/game/placeholder/lemon_on_bar.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/placeholder/place_holder_item.cpp b/engines/titanic/game/placeholder/place_holder_item.cpp
index a3c26c8..365e8cb 100644
--- a/engines/titanic/game/placeholder/place_holder_item.cpp
+++ b/engines/titanic/game/placeholder/place_holder_item.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPlaceHolderItem::save(SimpleFile *file, int indent) const {
+void CPlaceHolderItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/placeholder/place_holder_item.h b/engines/titanic/game/placeholder/place_holder_item.h
index c665e0f..72f49c0 100644
--- a/engines/titanic/game/placeholder/place_holder_item.h
+++ b/engines/titanic/game/placeholder/place_holder_item.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/placeholder/tv_on_bar.cpp b/engines/titanic/game/placeholder/tv_on_bar.cpp
index 3b97658..efbbe50 100644
--- a/engines/titanic/game/placeholder/tv_on_bar.cpp
+++ b/engines/titanic/game/placeholder/tv_on_bar.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CTVOnBar::save(SimpleFile *file, int indent) const {
+void CTVOnBar::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writePoint(_pos1, indent);
 	CPlaceHolderItem::save(file, indent);
diff --git a/engines/titanic/game/placeholder/tv_on_bar.h b/engines/titanic/game/placeholder/tv_on_bar.h
index 2cc5494..ffe8109 100644
--- a/engines/titanic/game/placeholder/tv_on_bar.h
+++ b/engines/titanic/game/placeholder/tv_on_bar.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/play_music_button.cpp b/engines/titanic/game/play_music_button.cpp
index 49e128c..8066739 100644
--- a/engines/titanic/game/play_music_button.cpp
+++ b/engines/titanic/game/play_music_button.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPlayMusicButton::save(SimpleFile *file, int indent) const {
+void CPlayMusicButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/play_music_button.h b/engines/titanic/game/play_music_button.h
index 9e0bb46..8ae32dc 100644
--- a/engines/titanic/game/play_music_button.h
+++ b/engines/titanic/game/play_music_button.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/play_on_act.cpp b/engines/titanic/game/play_on_act.cpp
index b0236cd..e1ef120 100644
--- a/engines/titanic/game/play_on_act.cpp
+++ b/engines/titanic/game/play_on_act.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CPlayOnAct::save(SimpleFile *file, int indent) const {
+void CPlayOnAct::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CBackground::save(file, indent);
 }
diff --git a/engines/titanic/game/play_on_act.h b/engines/titanic/game/play_on_act.h
index 22bb54d..bd60600 100644
--- a/engines/titanic/game/play_on_act.h
+++ b/engines/titanic/game/play_on_act.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/port_hole.cpp b/engines/titanic/game/port_hole.cpp
index 5564732..f3c447f 100644
--- a/engines/titanic/game/port_hole.cpp
+++ b/engines/titanic/game/port_hole.cpp
@@ -28,7 +28,7 @@ CPortHole::CPortHole() : CGameObject(), _fieldBC(0),
 		_string1("b#47.wav"), _string2("b#46.wav") {
 }
 
-void CPortHole::save(SimpleFile *file, int indent) const {
+void CPortHole::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeQuotedLine(_string1, indent);
diff --git a/engines/titanic/game/port_hole.h b/engines/titanic/game/port_hole.h
index 2672614..4e952cc 100644
--- a/engines/titanic/game/port_hole.h
+++ b/engines/titanic/game/port_hole.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/record_phonograph_button.cpp b/engines/titanic/game/record_phonograph_button.cpp
index 896e9d2..f022957 100644
--- a/engines/titanic/game/record_phonograph_button.cpp
+++ b/engines/titanic/game/record_phonograph_button.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CRecordPhonographButton::save(SimpleFile *file, int indent) const {
+void CRecordPhonographButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CBackground::save(file, indent);
diff --git a/engines/titanic/game/record_phonograph_button.h b/engines/titanic/game/record_phonograph_button.h
index 3ae7fb1..9750b7d 100644
--- a/engines/titanic/game/record_phonograph_button.h
+++ b/engines/titanic/game/record_phonograph_button.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/replacement_ear.cpp b/engines/titanic/game/replacement_ear.cpp
index 4926932..1f99603 100644
--- a/engines/titanic/game/replacement_ear.cpp
+++ b/engines/titanic/game/replacement_ear.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CReplacementEar::save(SimpleFile *file, int indent) const {
+void CReplacementEar::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CBackground::save(file, indent);
 }
diff --git a/engines/titanic/game/replacement_ear.h b/engines/titanic/game/replacement_ear.h
index 0cff55d..59d291f 100644
--- a/engines/titanic/game/replacement_ear.h
+++ b/engines/titanic/game/replacement_ear.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/reserved_table.cpp b/engines/titanic/game/reserved_table.cpp
index 222712a..a600190 100644
--- a/engines/titanic/game/reserved_table.cpp
+++ b/engines/titanic/game/reserved_table.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CReservedTable::save(SimpleFile *file, int indent) const {
+void CReservedTable::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value1, indent);
 	file->writeNumberLine(_value2, indent);
diff --git a/engines/titanic/game/reserved_table.h b/engines/titanic/game/reserved_table.h
index 49cd5e8..a0927fa 100644
--- a/engines/titanic/game/reserved_table.h
+++ b/engines/titanic/game/reserved_table.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/restaurant_cylinder_holder.cpp b/engines/titanic/game/restaurant_cylinder_holder.cpp
index 1662064..d70009f 100644
--- a/engines/titanic/game/restaurant_cylinder_holder.cpp
+++ b/engines/titanic/game/restaurant_cylinder_holder.cpp
@@ -29,7 +29,7 @@ CRestaurantCylinderHolder::CRestaurantCylinderHolder() : CDropTarget(),
 	_string6("z#61.wav"), _field140(1) {
 }
 
-void CRestaurantCylinderHolder::save(SimpleFile *file, int indent) const {
+void CRestaurantCylinderHolder::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field118, indent);
 	file->writeNumberLine(_field11C, indent);
diff --git a/engines/titanic/game/restaurant_cylinder_holder.h b/engines/titanic/game/restaurant_cylinder_holder.h
index 9f3911d..d679dd1 100644
--- a/engines/titanic/game/restaurant_cylinder_holder.h
+++ b/engines/titanic/game/restaurant_cylinder_holder.h
@@ -43,7 +43,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/restaurant_phonograph.cpp b/engines/titanic/game/restaurant_phonograph.cpp
index c73bd51..83a4ac3 100644
--- a/engines/titanic/game/restaurant_phonograph.cpp
+++ b/engines/titanic/game/restaurant_phonograph.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CRestaurantPhonograph::CRestaurantPhonograph() : CPhonograph(),
 	_fieldF8(1), _field114(0) {}
 
-void CRestaurantPhonograph::save(SimpleFile *file, int indent) const {
+void CRestaurantPhonograph::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldF8, indent);
 	file->writeQuotedLine(_string2, indent);
diff --git a/engines/titanic/game/restaurant_phonograph.h b/engines/titanic/game/restaurant_phonograph.h
index 40116f5..6243497 100644
--- a/engines/titanic/game/restaurant_phonograph.h
+++ b/engines/titanic/game/restaurant_phonograph.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sauce_dispensor.cpp b/engines/titanic/game/sauce_dispensor.cpp
index 6365f6e..8dc818d 100644
--- a/engines/titanic/game/sauce_dispensor.cpp
+++ b/engines/titanic/game/sauce_dispensor.cpp
@@ -28,7 +28,7 @@ CSauceDispensor::CSauceDispensor() : CBackground(),
 		_fieldEC(0), _fieldF0(0), _field104(0), _field108(0) {
 }
 
-void CSauceDispensor::save(SimpleFile *file, int indent) const {
+void CSauceDispensor::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string3, indent);
 	file->writeNumberLine(_fieldEC, indent);
diff --git a/engines/titanic/game/sauce_dispensor.h b/engines/titanic/game/sauce_dispensor.h
index 8a5cc96..f87420b 100644
--- a/engines/titanic/game/sauce_dispensor.h
+++ b/engines/titanic/game/sauce_dispensor.h
@@ -43,7 +43,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/search_point.cpp b/engines/titanic/game/search_point.cpp
index c235e47..f60a313 100644
--- a/engines/titanic/game/search_point.cpp
+++ b/engines/titanic/game/search_point.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CSearchPoint::save(SimpleFile *file, int indent) const {
+void CSearchPoint::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/search_point.h b/engines/titanic/game/search_point.h
index 7bd05d8..057bb4d 100644
--- a/engines/titanic/game/search_point.h
+++ b/engines/titanic/game/search_point.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/season_background.cpp b/engines/titanic/game/season_background.cpp
index a4de590..1c63f3d 100644
--- a/engines/titanic/game/season_background.cpp
+++ b/engines/titanic/game/season_background.cpp
@@ -28,7 +28,7 @@ CSeasonBackground::CSeasonBackground() : CBackground(),
 	_fieldE0(0), _fieldE4(0), _fieldE8(46), _fieldEC(0) {
 }
 
-void CSeasonBackground::save(SimpleFile *file, int indent) const {
+void CSeasonBackground::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/season_background.h b/engines/titanic/game/season_background.h
index 709f100..c89e6a6 100644
--- a/engines/titanic/game/season_background.h
+++ b/engines/titanic/game/season_background.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/season_barrel.cpp b/engines/titanic/game/season_barrel.cpp
index 8aa7b22..9594396 100644
--- a/engines/titanic/game/season_barrel.cpp
+++ b/engines/titanic/game/season_barrel.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CSeasonBarrel::save(SimpleFile *file, int indent) const {
+void CSeasonBarrel::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/season_barrel.h b/engines/titanic/game/season_barrel.h
index d3f7b1a..145dfa0 100644
--- a/engines/titanic/game/season_barrel.h
+++ b/engines/titanic/game/season_barrel.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/seasonal_adjustment.cpp b/engines/titanic/game/seasonal_adjustment.cpp
index c0c7b2f..33a0ae8 100644
--- a/engines/titanic/game/seasonal_adjustment.cpp
+++ b/engines/titanic/game/seasonal_adjustment.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CSeasonalAdjustment::save(SimpleFile *file, int indent) const {
+void CSeasonalAdjustment::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/seasonal_adjustment.h b/engines/titanic/game/seasonal_adjustment.h
index 4bfec1a..4f251ad 100644
--- a/engines/titanic/game/seasonal_adjustment.h
+++ b/engines/titanic/game/seasonal_adjustment.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/service_elevator_window.cpp b/engines/titanic/game/service_elevator_window.cpp
index 1371fb7..95b2735 100644
--- a/engines/titanic/game/service_elevator_window.cpp
+++ b/engines/titanic/game/service_elevator_window.cpp
@@ -28,7 +28,7 @@ CServiceElevatorWindow::CServiceElevatorWindow() : CBackground(),
 	_fieldE0(0), _fieldE4(0), _fieldE8(0), _fieldEC(0) {
 }
 
-void CServiceElevatorWindow::save(SimpleFile *file, int indent) const {
+void CServiceElevatorWindow::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/service_elevator_window.h b/engines/titanic/game/service_elevator_window.h
index 70c3875..0815023 100644
--- a/engines/titanic/game/service_elevator_window.h
+++ b/engines/titanic/game/service_elevator_window.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/armchair.cpp b/engines/titanic/game/sgt/armchair.cpp
index 3491452..4c4ef44 100644
--- a/engines/titanic/game/sgt/armchair.cpp
+++ b/engines/titanic/game/sgt/armchair.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CArmchair::save(SimpleFile *file, int indent) const {
+void CArmchair::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSGTStateRoom::save(file, indent);
 }
diff --git a/engines/titanic/game/sgt/armchair.h b/engines/titanic/game/sgt/armchair.h
index 1ce6955..5dfd94d 100644
--- a/engines/titanic/game/sgt/armchair.h
+++ b/engines/titanic/game/sgt/armchair.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/basin.cpp b/engines/titanic/game/sgt/basin.cpp
index 75c53bc..1eb1d16 100644
--- a/engines/titanic/game/sgt/basin.cpp
+++ b/engines/titanic/game/sgt/basin.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBasin::save(SimpleFile *file, int indent) const {
+void CBasin::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSGTStateRoom::save(file, indent);
 }
diff --git a/engines/titanic/game/sgt/basin.h b/engines/titanic/game/sgt/basin.h
index cc9739f..950bdb8 100644
--- a/engines/titanic/game/sgt/basin.h
+++ b/engines/titanic/game/sgt/basin.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/bedfoot.cpp b/engines/titanic/game/sgt/bedfoot.cpp
index b039f8a..18ea07a 100644
--- a/engines/titanic/game/sgt/bedfoot.cpp
+++ b/engines/titanic/game/sgt/bedfoot.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBedfoot::save(SimpleFile *file, int indent) const {
+void CBedfoot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSGTStateRoom::save(file, indent);
 }
diff --git a/engines/titanic/game/sgt/bedfoot.h b/engines/titanic/game/sgt/bedfoot.h
index 55be4fd..db1e1dd 100644
--- a/engines/titanic/game/sgt/bedfoot.h
+++ b/engines/titanic/game/sgt/bedfoot.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/bedhead.cpp b/engines/titanic/game/sgt/bedhead.cpp
index 758c1ff..fad7272 100644
--- a/engines/titanic/game/sgt/bedhead.cpp
+++ b/engines/titanic/game/sgt/bedhead.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBedhead::save(SimpleFile *file, int indent) const {
+void CBedhead::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSGTStateRoom::save(file, indent);
 }
diff --git a/engines/titanic/game/sgt/bedhead.h b/engines/titanic/game/sgt/bedhead.h
index 317b7eb..b938dcd 100644
--- a/engines/titanic/game/sgt/bedhead.h
+++ b/engines/titanic/game/sgt/bedhead.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/chest_of_drawers.cpp b/engines/titanic/game/sgt/chest_of_drawers.cpp
index 5ec98e8..be62e12 100644
--- a/engines/titanic/game/sgt/chest_of_drawers.cpp
+++ b/engines/titanic/game/sgt/chest_of_drawers.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CChestOfDrawers::save(SimpleFile *file, int indent) const {
+void CChestOfDrawers::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSGTStateRoom::save(file, indent);
 }
diff --git a/engines/titanic/game/sgt/chest_of_drawers.h b/engines/titanic/game/sgt/chest_of_drawers.h
index e0bdd75..5b72f3e 100644
--- a/engines/titanic/game/sgt/chest_of_drawers.h
+++ b/engines/titanic/game/sgt/chest_of_drawers.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/desk.cpp b/engines/titanic/game/sgt/desk.cpp
index ea00c24..4dd0fda 100644
--- a/engines/titanic/game/sgt/desk.cpp
+++ b/engines/titanic/game/sgt/desk.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CDesk::save(SimpleFile *file, int indent) const {
+void CDesk::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSGTStateRoom::save(file, indent);
 }
diff --git a/engines/titanic/game/sgt/desk.h b/engines/titanic/game/sgt/desk.h
index 7fbb65a..d35417c 100644
--- a/engines/titanic/game/sgt/desk.h
+++ b/engines/titanic/game/sgt/desk.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/deskchair.cpp b/engines/titanic/game/sgt/deskchair.cpp
index 337b55a..a4a2bad 100644
--- a/engines/titanic/game/sgt/deskchair.cpp
+++ b/engines/titanic/game/sgt/deskchair.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CDeskchair::save(SimpleFile *file, int indent) const {
+void CDeskchair::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSGTStateRoom::save(file, indent);
 }
diff --git a/engines/titanic/game/sgt/deskchair.h b/engines/titanic/game/sgt/deskchair.h
index 205209c..38e4d6d 100644
--- a/engines/titanic/game/sgt/deskchair.h
+++ b/engines/titanic/game/sgt/deskchair.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/drawer.cpp b/engines/titanic/game/sgt/drawer.cpp
index 1d7fad2..03aa1b5 100644
--- a/engines/titanic/game/sgt/drawer.cpp
+++ b/engines/titanic/game/sgt/drawer.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CDrawer::CDrawer() : CSGTStateRoom(), _fieldF4(0) {
 }
 
-void CDrawer::save(SimpleFile *file, int indent) const {
+void CDrawer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldF4, indent);
 	CSGTStateRoom::save(file, indent);
diff --git a/engines/titanic/game/sgt/drawer.h b/engines/titanic/game/sgt/drawer.h
index 8436e5c..4f68b1b 100644
--- a/engines/titanic/game/sgt/drawer.h
+++ b/engines/titanic/game/sgt/drawer.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/sgt_doors.cpp b/engines/titanic/game/sgt/sgt_doors.cpp
index 587a961..516b0f1 100644
--- a/engines/titanic/game/sgt/sgt_doors.cpp
+++ b/engines/titanic/game/sgt/sgt_doors.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CSGTDoors::save(SimpleFile *file, int indent) const {
+void CSGTDoors::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value1, indent);
 	file->writeNumberLine(_value2, indent);
diff --git a/engines/titanic/game/sgt/sgt_doors.h b/engines/titanic/game/sgt/sgt_doors.h
index 9828708..11825c0 100644
--- a/engines/titanic/game/sgt/sgt_doors.h
+++ b/engines/titanic/game/sgt/sgt_doors.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/sgt_nav.cpp b/engines/titanic/game/sgt/sgt_nav.cpp
index e40d34d..f98e486 100644
--- a/engines/titanic/game/sgt/sgt_nav.cpp
+++ b/engines/titanic/game/sgt/sgt_nav.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void SGTNav::save(SimpleFile *file, int indent) const {
+void SGTNav::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSGTStateRoom::save(file, indent);
 }
diff --git a/engines/titanic/game/sgt/sgt_nav.h b/engines/titanic/game/sgt/sgt_nav.h
index 7d7f57f..39b267f 100644
--- a/engines/titanic/game/sgt/sgt_nav.h
+++ b/engines/titanic/game/sgt/sgt_nav.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/sgt_navigation.cpp b/engines/titanic/game/sgt/sgt_navigation.cpp
index 666459b..d0c3084 100644
--- a/engines/titanic/game/sgt/sgt_navigation.cpp
+++ b/engines/titanic/game/sgt/sgt_navigation.cpp
@@ -34,7 +34,7 @@ void CSGTNavigation::deinit() {
 	delete _statics;
 }
 
-void CSGTNavigation::save(SimpleFile *file, int indent) const {
+void CSGTNavigation::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_statics->_v1, indent);
 	file->writeQuotedLine(_statics->_v2, indent);
diff --git a/engines/titanic/game/sgt/sgt_navigation.h b/engines/titanic/game/sgt/sgt_navigation.h
index 083efa8..ac8c475 100644
--- a/engines/titanic/game/sgt/sgt_navigation.h
+++ b/engines/titanic/game/sgt/sgt_navigation.h
@@ -44,7 +44,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/sgt_restaurant_doors.cpp b/engines/titanic/game/sgt/sgt_restaurant_doors.cpp
index 1e4a167..74a71e7 100644
--- a/engines/titanic/game/sgt/sgt_restaurant_doors.cpp
+++ b/engines/titanic/game/sgt/sgt_restaurant_doors.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CSGTRestaurantDoors::save(SimpleFile *file, int indent) const {
+void CSGTRestaurantDoors::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/sgt/sgt_restaurant_doors.h b/engines/titanic/game/sgt/sgt_restaurant_doors.h
index 14677ea..e740db6 100644
--- a/engines/titanic/game/sgt/sgt_restaurant_doors.h
+++ b/engines/titanic/game/sgt/sgt_restaurant_doors.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/sgt_state_control.cpp b/engines/titanic/game/sgt/sgt_state_control.cpp
index 113bd0d..07c1f5e 100644
--- a/engines/titanic/game/sgt/sgt_state_control.cpp
+++ b/engines/titanic/game/sgt/sgt_state_control.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CSGTStateControl::save(SimpleFile *file, int indent) const {
+void CSGTStateControl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	CBackground::save(file, indent);
diff --git a/engines/titanic/game/sgt/sgt_state_control.h b/engines/titanic/game/sgt/sgt_state_control.h
index 05d8fde..af51274 100644
--- a/engines/titanic/game/sgt/sgt_state_control.h
+++ b/engines/titanic/game/sgt/sgt_state_control.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/sgt_state_room.cpp b/engines/titanic/game/sgt/sgt_state_room.cpp
index 1a68131..55f08de 100644
--- a/engines/titanic/game/sgt/sgt_state_room.cpp
+++ b/engines/titanic/game/sgt/sgt_state_room.cpp
@@ -42,7 +42,7 @@ CSGTStateRoom::CSGTStateRoom() : CBackground(), _fieldE0(1),
 	_fieldE4(1), _fieldE8(0), _fieldEC(1), _fieldF0(1) {
 }
 
-void CSGTStateRoom::save(SimpleFile *file, int indent) const {
+void CSGTStateRoom::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_statics->_v1, indent);
 	file->writeQuotedLine(_statics->_v2, indent);
diff --git a/engines/titanic/game/sgt/sgt_state_room.h b/engines/titanic/game/sgt/sgt_state_room.h
index 7b2b5a8..1809ec8 100644
--- a/engines/titanic/game/sgt/sgt_state_room.h
+++ b/engines/titanic/game/sgt/sgt_state_room.h
@@ -65,7 +65,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/sgt_tv.cpp b/engines/titanic/game/sgt/sgt_tv.cpp
index 3165458..ae4c59e 100644
--- a/engines/titanic/game/sgt/sgt_tv.cpp
+++ b/engines/titanic/game/sgt/sgt_tv.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CSGTTV::save(SimpleFile *file, int indent) const {
+void CSGTTV::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSGTStateRoom::save(file, indent);
 }
diff --git a/engines/titanic/game/sgt/sgt_tv.h b/engines/titanic/game/sgt/sgt_tv.h
index 347d2c7..e97f974 100644
--- a/engines/titanic/game/sgt/sgt_tv.h
+++ b/engines/titanic/game/sgt/sgt_tv.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/sgt_upper_doors_sound.cpp b/engines/titanic/game/sgt/sgt_upper_doors_sound.cpp
index 83a500e..ed37b0a 100644
--- a/engines/titanic/game/sgt/sgt_upper_doors_sound.cpp
+++ b/engines/titanic/game/sgt/sgt_upper_doors_sound.cpp
@@ -28,7 +28,7 @@ CSGTUpperDoorsSound::CSGTUpperDoorsSound() {
 	_string2 = "b#53.wav";
 }
 
-void CSGTUpperDoorsSound::save(SimpleFile *file, int indent) const {
+void CSGTUpperDoorsSound::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string2, indent);
 
diff --git a/engines/titanic/game/sgt/sgt_upper_doors_sound.h b/engines/titanic/game/sgt/sgt_upper_doors_sound.h
index cd62aa5..3289b88 100644
--- a/engines/titanic/game/sgt/sgt_upper_doors_sound.h
+++ b/engines/titanic/game/sgt/sgt_upper_doors_sound.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/toilet.cpp b/engines/titanic/game/sgt/toilet.cpp
index ed4ac52..799abd6 100644
--- a/engines/titanic/game/sgt/toilet.cpp
+++ b/engines/titanic/game/sgt/toilet.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CToilet::save(SimpleFile *file, int indent) const {
+void CToilet::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSGTStateRoom::save(file, indent);
 }
diff --git a/engines/titanic/game/sgt/toilet.h b/engines/titanic/game/sgt/toilet.h
index 0892651..d0d2851 100644
--- a/engines/titanic/game/sgt/toilet.h
+++ b/engines/titanic/game/sgt/toilet.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/vase.cpp b/engines/titanic/game/sgt/vase.cpp
index 04c5165..3e04b5d 100644
--- a/engines/titanic/game/sgt/vase.cpp
+++ b/engines/titanic/game/sgt/vase.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CVase::save(SimpleFile *file, int indent) const {
+void CVase::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSGTStateRoom::save(file, indent);
 }
diff --git a/engines/titanic/game/sgt/vase.h b/engines/titanic/game/sgt/vase.h
index 1b2a89f..ec3662b 100644
--- a/engines/titanic/game/sgt/vase.h
+++ b/engines/titanic/game/sgt/vase.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sgt/washstand.cpp b/engines/titanic/game/sgt/washstand.cpp
index f361b14..8127a59 100644
--- a/engines/titanic/game/sgt/washstand.cpp
+++ b/engines/titanic/game/sgt/washstand.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CWashstand::save(SimpleFile *file, int indent) const {
+void CWashstand::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSGTStateRoom::save(file, indent);
 }
diff --git a/engines/titanic/game/sgt/washstand.h b/engines/titanic/game/sgt/washstand.h
index 975a4d5..ea7636c 100644
--- a/engines/titanic/game/sgt/washstand.h
+++ b/engines/titanic/game/sgt/washstand.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/ship_setting.cpp b/engines/titanic/game/ship_setting.cpp
index 037a199..462f396 100644
--- a/engines/titanic/game/ship_setting.cpp
+++ b/engines/titanic/game/ship_setting.cpp
@@ -28,7 +28,7 @@ CShipSetting::CShipSetting() : CBackground(),
 	_string4("NULL"), _string5("NULL") {
 }
 
-void CShipSetting::save(SimpleFile *file, int indent) const {
+void CShipSetting::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string3, indent);
 	file->writePoint(_pos1, indent);
diff --git a/engines/titanic/game/ship_setting.h b/engines/titanic/game/ship_setting.h
index acc06d1..e0a52dd 100644
--- a/engines/titanic/game/ship_setting.h
+++ b/engines/titanic/game/ship_setting.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/ship_setting_button.cpp b/engines/titanic/game/ship_setting_button.cpp
index 95507f3..7dc2cab 100644
--- a/engines/titanic/game/ship_setting_button.cpp
+++ b/engines/titanic/game/ship_setting_button.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CShipSettingButton::CShipSettingButton() : CGameObject(), _fieldC8(0), _fieldCC(0) {
 }
 
-void CShipSettingButton::save(SimpleFile *file, int indent) const {
+void CShipSettingButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
 	file->writeNumberLine(_fieldC8, indent);
diff --git a/engines/titanic/game/ship_setting_button.h b/engines/titanic/game/ship_setting_button.h
index e6a6822..e5a889b 100644
--- a/engines/titanic/game/ship_setting_button.h
+++ b/engines/titanic/game/ship_setting_button.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/show_cell_points.cpp b/engines/titanic/game/show_cell_points.cpp
index e23d588..7d54401 100644
--- a/engines/titanic/game/show_cell_points.cpp
+++ b/engines/titanic/game/show_cell_points.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CShowCellpoints::save(SimpleFile *file, int indent) const {
+void CShowCellpoints::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_strValue, indent);
 	file->writeNumberLine(_numValue, indent);
diff --git a/engines/titanic/game/show_cell_points.h b/engines/titanic/game/show_cell_points.h
index a3d7ba2..8359221 100644
--- a/engines/titanic/game/show_cell_points.h
+++ b/engines/titanic/game/show_cell_points.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/speech_dispensor.cpp b/engines/titanic/game/speech_dispensor.cpp
index 7287339..f9cc019 100644
--- a/engines/titanic/game/speech_dispensor.cpp
+++ b/engines/titanic/game/speech_dispensor.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CSpeechDispensor::save(SimpleFile *file, int indent) const {
+void CSpeechDispensor::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/speech_dispensor.h b/engines/titanic/game/speech_dispensor.h
index 440746e..6302ca3 100644
--- a/engines/titanic/game/speech_dispensor.h
+++ b/engines/titanic/game/speech_dispensor.h
@@ -43,7 +43,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/splash_animation.cpp b/engines/titanic/game/splash_animation.cpp
index 3d35929..cfaf697 100644
--- a/engines/titanic/game/splash_animation.cpp
+++ b/engines/titanic/game/splash_animation.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CSplashAnimation, CGameObject)
 
-void CSplashAnimation::save(SimpleFile *file, int indent) const {
+void CSplashAnimation::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/splash_animation.h b/engines/titanic/game/splash_animation.h
index 9b6322e..4b70b38 100644
--- a/engines/titanic/game/splash_animation.h
+++ b/engines/titanic/game/splash_animation.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/starling_puret.cpp b/engines/titanic/game/starling_puret.cpp
index 1fa0dc8..359ad77 100644
--- a/engines/titanic/game/starling_puret.cpp
+++ b/engines/titanic/game/starling_puret.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CStarlingPuret::save(SimpleFile *file, int indent) const {
+void CStarlingPuret::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/starling_puret.h b/engines/titanic/game/starling_puret.h
index 7299c68..36cd23e 100644
--- a/engines/titanic/game/starling_puret.h
+++ b/engines/titanic/game/starling_puret.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/start_action.cpp b/engines/titanic/game/start_action.cpp
index e41b7df..ab356ea 100644
--- a/engines/titanic/game/start_action.cpp
+++ b/engines/titanic/game/start_action.cpp
@@ -33,7 +33,7 @@ END_MESSAGE_MAP()
 CStartAction::CStartAction() : CBackground() {
 }
 
-void CStartAction::save(SimpleFile *file, int indent) const {
+void CStartAction::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_msgTarget, indent);
 	file->writeQuotedLine(_msgAction, indent);
diff --git a/engines/titanic/game/start_action.h b/engines/titanic/game/start_action.h
index de3c488..6b6860e 100644
--- a/engines/titanic/game/start_action.h
+++ b/engines/titanic/game/start_action.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/stop_phonograph_button.cpp b/engines/titanic/game/stop_phonograph_button.cpp
index 7c4367a..d18f471 100644
--- a/engines/titanic/game/stop_phonograph_button.cpp
+++ b/engines/titanic/game/stop_phonograph_button.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CStopPhonographButton::save(SimpleFile *file, int indent) const {
+void CStopPhonographButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CBackground::save(file, indent);
 }
diff --git a/engines/titanic/game/stop_phonograph_button.h b/engines/titanic/game/stop_phonograph_button.h
index b1accfe..1109f81 100644
--- a/engines/titanic/game/stop_phonograph_button.h
+++ b/engines/titanic/game/stop_phonograph_button.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sub_glass.cpp b/engines/titanic/game/sub_glass.cpp
index b16199d..f1349f0 100644
--- a/engines/titanic/game/sub_glass.cpp
+++ b/engines/titanic/game/sub_glass.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CSUBGlass::CSUBGlass() : _fieldBC(0), _fieldC0(0), _fieldC4(1), _fieldC8(0) {
 }
 
-void CSUBGlass::save(SimpleFile *file, int indent) const {
+void CSUBGlass::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/game/sub_glass.h b/engines/titanic/game/sub_glass.h
index b7ba513..1aa73d2 100644
--- a/engines/titanic/game/sub_glass.h
+++ b/engines/titanic/game/sub_glass.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sub_wrapper.cpp b/engines/titanic/game/sub_wrapper.cpp
index be6b3e2..dcc4893 100644
--- a/engines/titanic/game/sub_wrapper.cpp
+++ b/engines/titanic/game/sub_wrapper.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CSUBWrapper::save(SimpleFile *file, int indent) const {
+void CSUBWrapper::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/game/sub_wrapper.h b/engines/titanic/game/sub_wrapper.h
index 6b724f8..d2fc914 100644
--- a/engines/titanic/game/sub_wrapper.h
+++ b/engines/titanic/game/sub_wrapper.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/sweet_bowl.cpp b/engines/titanic/game/sweet_bowl.cpp
index f6bbb2c..e14f900 100644
--- a/engines/titanic/game/sweet_bowl.cpp
+++ b/engines/titanic/game/sweet_bowl.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CSweetBowl::save(SimpleFile *file, int indent) const {
+void CSweetBowl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/sweet_bowl.h b/engines/titanic/game/sweet_bowl.h
index fa607bb..5beb960 100644
--- a/engines/titanic/game/sweet_bowl.h
+++ b/engines/titanic/game/sweet_bowl.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index 57b2b7f..f5a7e5f 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -66,7 +66,7 @@ void CTelevision::init() {
 void CTelevision::deinit() {
 }
 
-void CTelevision::save(SimpleFile *file, int indent) const {
+void CTelevision::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_v1, indent);
diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
index 64202c7..27dd3d6 100644
--- a/engines/titanic/game/television.h
+++ b/engines/titanic/game/television.h
@@ -66,7 +66,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/third_class_canal.cpp b/engines/titanic/game/third_class_canal.cpp
index a25d5f2..6b0a101 100644
--- a/engines/titanic/game/third_class_canal.cpp
+++ b/engines/titanic/game/third_class_canal.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CThirdClassCanal::save(SimpleFile *file, int indent) const {
+void CThirdClassCanal::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CBackground::save(file, indent);
 }
diff --git a/engines/titanic/game/third_class_canal.h b/engines/titanic/game/third_class_canal.h
index 7a2c3d4..1cc5394 100644
--- a/engines/titanic/game/third_class_canal.h
+++ b/engines/titanic/game/third_class_canal.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/throw_tv_down_well.cpp b/engines/titanic/game/throw_tv_down_well.cpp
index d77d776..c8a9fc7 100644
--- a/engines/titanic/game/throw_tv_down_well.cpp
+++ b/engines/titanic/game/throw_tv_down_well.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CThrowTVDownWell::save(SimpleFile *file, int indent) const {
+void CThrowTVDownWell::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_strValue, indent);
 	file->writeNumberLine(_numValue, indent);
diff --git a/engines/titanic/game/throw_tv_down_well.h b/engines/titanic/game/throw_tv_down_well.h
index dee1450..ce10264 100644
--- a/engines/titanic/game/throw_tv_down_well.h
+++ b/engines/titanic/game/throw_tv_down_well.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/titania_still_control.cpp b/engines/titanic/game/titania_still_control.cpp
index 96c003d..67866ec 100644
--- a/engines/titanic/game/titania_still_control.cpp
+++ b/engines/titanic/game/titania_still_control.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CTitaniaStillControl::save(SimpleFile *file, int indent) const {
+void CTitaniaStillControl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/titania_still_control.h b/engines/titanic/game/titania_still_control.h
index a0f739d..dbff0c7 100644
--- a/engines/titanic/game/titania_still_control.h
+++ b/engines/titanic/game/titania_still_control.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/tow_parrot_nav.cpp b/engines/titanic/game/tow_parrot_nav.cpp
index d476681..9361808 100644
--- a/engines/titanic/game/tow_parrot_nav.cpp
+++ b/engines/titanic/game/tow_parrot_nav.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CTOWParrotNav::save(SimpleFile *file, int indent) const {
+void CTOWParrotNav::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/game/tow_parrot_nav.h b/engines/titanic/game/tow_parrot_nav.h
index 420c29b..651b8be 100644
--- a/engines/titanic/game/tow_parrot_nav.h
+++ b/engines/titanic/game/tow_parrot_nav.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/transport/exit_pellerator.h b/engines/titanic/game/transport/exit_pellerator.h
index e72cbb4..e55a8fb 100644
--- a/engines/titanic/game/transport/exit_pellerator.h
+++ b/engines/titanic/game/transport/exit_pellerator.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/transport/gondolier.cpp b/engines/titanic/game/transport/gondolier.cpp
index f67a3b6..f731e45 100644
--- a/engines/titanic/game/transport/gondolier.cpp
+++ b/engines/titanic/game/transport/gondolier.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CGondolier::save(SimpleFile *file, int indent) const {
+void CGondolier::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CTransport::save(file, indent);
 }
diff --git a/engines/titanic/game/transport/gondolier.h b/engines/titanic/game/transport/gondolier.h
index bdfb3e7..4f4c570 100644
--- a/engines/titanic/game/transport/gondolier.h
+++ b/engines/titanic/game/transport/gondolier.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/transport/lift.cpp b/engines/titanic/game/transport/lift.cpp
index e978762..72f832b 100644
--- a/engines/titanic/game/transport/lift.cpp
+++ b/engines/titanic/game/transport/lift.cpp
@@ -35,7 +35,7 @@ int CLift::_v4;
 int CLift::_v5;
 int CLift::_v6;
 
-void CLift::save(SimpleFile *file, int indent) const {
+void CLift::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h
index 161061c..4b39d34 100644
--- a/engines/titanic/game/transport/lift.h
+++ b/engines/titanic/game/transport/lift.h
@@ -47,7 +47,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/transport/lift_indicator.cpp b/engines/titanic/game/transport/lift_indicator.cpp
index eb7f6bf..582de8a 100644
--- a/engines/titanic/game/transport/lift_indicator.cpp
+++ b/engines/titanic/game/transport/lift_indicator.cpp
@@ -32,7 +32,7 @@ CLiftindicator::CLiftindicator() : CLift(),
 		_fieldFC(0), _field108(0), _field10C(0) {
 }
 
-void CLiftindicator::save(SimpleFile *file, int indent) const {
+void CLiftindicator::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldFC, indent);
 	file->writePoint(_pos2, indent);
diff --git a/engines/titanic/game/transport/lift_indicator.h b/engines/titanic/game/transport/lift_indicator.h
index c73d1f4..2b08da5 100644
--- a/engines/titanic/game/transport/lift_indicator.h
+++ b/engines/titanic/game/transport/lift_indicator.h
@@ -43,7 +43,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/transport/pellerator.cpp b/engines/titanic/game/transport/pellerator.cpp
index ed82aa9..e789c20 100644
--- a/engines/titanic/game/transport/pellerator.cpp
+++ b/engines/titanic/game/transport/pellerator.cpp
@@ -31,7 +31,7 @@ END_MESSAGE_MAP()
 int CPellerator::_v1;
 int CPellerator::_v2;
 
-void CPellerator::save(SimpleFile *file, int indent) const {
+void CPellerator::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
diff --git a/engines/titanic/game/transport/pellerator.h b/engines/titanic/game/transport/pellerator.h
index 0539b5c..ac1486d 100644
--- a/engines/titanic/game/transport/pellerator.h
+++ b/engines/titanic/game/transport/pellerator.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/transport/service_elevator.cpp b/engines/titanic/game/transport/service_elevator.cpp
index ba68bc8..1ea8d14 100644
--- a/engines/titanic/game/transport/service_elevator.cpp
+++ b/engines/titanic/game/transport/service_elevator.cpp
@@ -32,7 +32,7 @@ CServiceElevator::CServiceElevator() : CTransport(),
 	_fieldF8(0), _fieldFC(0), _field100(0), _field104(0) {
 }
 
-void CServiceElevator::save(SimpleFile *file, int indent) const {
+void CServiceElevator::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
diff --git a/engines/titanic/game/transport/service_elevator.h b/engines/titanic/game/transport/service_elevator.h
index 9edc1f9..472f458 100644
--- a/engines/titanic/game/transport/service_elevator.h
+++ b/engines/titanic/game/transport/service_elevator.h
@@ -44,7 +44,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/transport/transport.cpp b/engines/titanic/game/transport/transport.cpp
index e003759..f9598c7 100644
--- a/engines/titanic/game/transport/transport.cpp
+++ b/engines/titanic/game/transport/transport.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CTransport, CMobile)
 CTransport::CTransport() : CMobile(), _string1("*.*.*") {
 }
 
-void CTransport::save(SimpleFile *file, int indent) const {
+void CTransport::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
 	file->writeQuotedLine(_string2, indent);
diff --git a/engines/titanic/game/transport/transport.h b/engines/titanic/game/transport/transport.h
index b7540ad..6690688 100644
--- a/engines/titanic/game/transport/transport.h
+++ b/engines/titanic/game/transport/transport.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/up_lighter.cpp b/engines/titanic/game/up_lighter.cpp
index 50cd1d4..f03b8f3 100644
--- a/engines/titanic/game/up_lighter.cpp
+++ b/engines/titanic/game/up_lighter.cpp
@@ -28,7 +28,7 @@ CUpLighter::CUpLighter() : CDropTarget(), _field118(0),
 	_field11C(0), _field120(0), _field124(0) {
 }
 
-void CUpLighter::save(SimpleFile *file, int indent) const {
+void CUpLighter::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field118, indent);
 	file->writeNumberLine(_field11C, indent);
diff --git a/engines/titanic/game/up_lighter.h b/engines/titanic/game/up_lighter.h
index a3f8b2a..be76f57 100644
--- a/engines/titanic/game/up_lighter.h
+++ b/engines/titanic/game/up_lighter.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/useless_lever.cpp b/engines/titanic/game/useless_lever.cpp
index afc025b..e48ad55 100644
--- a/engines/titanic/game/useless_lever.cpp
+++ b/engines/titanic/game/useless_lever.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CUselessLever::save(SimpleFile *file, int indent) const {
+void CUselessLever::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleButton::save(file, indent);
 }
diff --git a/engines/titanic/game/useless_lever.h b/engines/titanic/game/useless_lever.h
index f582bde..d6c5480 100644
--- a/engines/titanic/game/useless_lever.h
+++ b/engines/titanic/game/useless_lever.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/volume_control.cpp b/engines/titanic/game/volume_control.cpp
index e9b66c7..c6b0e41 100644
--- a/engines/titanic/game/volume_control.cpp
+++ b/engines/titanic/game/volume_control.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CVolumeControl::CVolumeControl() : CGameObject() {
 }
 
-void CVolumeControl::save(SimpleFile *file, int indent) const {
+void CVolumeControl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeQuotedLine(_string1, indent);
diff --git a/engines/titanic/game/volume_control.h b/engines/titanic/game/volume_control.h
index cef5ac4..77e3346 100644
--- a/engines/titanic/game/volume_control.h
+++ b/engines/titanic/game/volume_control.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/wheel_button.cpp b/engines/titanic/game/wheel_button.cpp
index 0fad684..19c42a8 100644
--- a/engines/titanic/game/wheel_button.cpp
+++ b/engines/titanic/game/wheel_button.cpp
@@ -28,7 +28,7 @@ CWheelButton::CWheelButton() : CBackground(),
 	_fieldE0(0), _fieldE4(0), _fieldE8(0) {
 }
 
-void CWheelButton::save(SimpleFile *file, int indent) const {
+void CWheelButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/wheel_button.h b/engines/titanic/game/wheel_button.h
index 75e1268..78ea708 100644
--- a/engines/titanic/game/wheel_button.h
+++ b/engines/titanic/game/wheel_button.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/wheel_hotspot.cpp b/engines/titanic/game/wheel_hotspot.cpp
index 8b05f45..f9af594 100644
--- a/engines/titanic/game/wheel_hotspot.cpp
+++ b/engines/titanic/game/wheel_hotspot.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CWheelHotSpot::save(SimpleFile *file, int indent) const {
+void CWheelHotSpot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/game/wheel_hotspot.h b/engines/titanic/game/wheel_hotspot.h
index 7164b88..75b597c 100644
--- a/engines/titanic/game/wheel_hotspot.h
+++ b/engines/titanic/game/wheel_hotspot.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/wheel_spin.cpp b/engines/titanic/game/wheel_spin.cpp
index 7f16a4c..daa9918 100644
--- a/engines/titanic/game/wheel_spin.cpp
+++ b/engines/titanic/game/wheel_spin.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CWheelSpin::save(SimpleFile *file, int indent) const {
+void CWheelSpin::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CBackground::save(file, indent);
diff --git a/engines/titanic/game/wheel_spin.h b/engines/titanic/game/wheel_spin.h
index 2e21da4..9e584a1 100644
--- a/engines/titanic/game/wheel_spin.h
+++ b/engines/titanic/game/wheel_spin.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/game/wheel_spin_horn.cpp b/engines/titanic/game/wheel_spin_horn.cpp
index 3bc705d..b01cc67 100644
--- a/engines/titanic/game/wheel_spin_horn.cpp
+++ b/engines/titanic/game/wheel_spin_horn.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CWheelSpinHorn::save(SimpleFile *file, int indent) const {
+void CWheelSpinHorn::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
 	file->writeQuotedLine(_string2, indent);
diff --git a/engines/titanic/game/wheel_spin_horn.h b/engines/titanic/game/wheel_spin_horn.h
index e4c0bd7..ac4021f 100644
--- a/engines/titanic/game/wheel_spin_horn.h
+++ b/engines/titanic/game/wheel_spin_horn.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/act_button.cpp b/engines/titanic/gfx/act_button.cpp
index 3e79a17..c84f358 100644
--- a/engines/titanic/gfx/act_button.cpp
+++ b/engines/titanic/gfx/act_button.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CActButton::CActButton() : CSTButton() {
 }
 
-void CActButton::save(SimpleFile *file, int indent) const {
+void CActButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSTButton::save(file, indent);
 }
diff --git a/engines/titanic/gfx/act_button.h b/engines/titanic/gfx/act_button.h
index b8f8f21..3b78e0c 100644
--- a/engines/titanic/gfx/act_button.h
+++ b/engines/titanic/gfx/act_button.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/changes_season_button.cpp b/engines/titanic/gfx/changes_season_button.cpp
index a5f6778..d5242ad 100644
--- a/engines/titanic/gfx/changes_season_button.cpp
+++ b/engines/titanic/gfx/changes_season_button.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CChangesSeasonButton::CChangesSeasonButton() : CSTButton() {
 }
 
-void CChangesSeasonButton::save(SimpleFile *file, int indent) const {
+void CChangesSeasonButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSTButton::save(file, indent);
 }
diff --git a/engines/titanic/gfx/changes_season_button.h b/engines/titanic/gfx/changes_season_button.h
index f39cfdc..2fe4672 100644
--- a/engines/titanic/gfx/changes_season_button.h
+++ b/engines/titanic/gfx/changes_season_button.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/chev_left_off.cpp b/engines/titanic/gfx/chev_left_off.cpp
index 0ce2d62..5158399 100644
--- a/engines/titanic/gfx/chev_left_off.cpp
+++ b/engines/titanic/gfx/chev_left_off.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CChevLeftOff, CToggleSwitch)
 CChevLeftOff::CChevLeftOff() : CToggleSwitch() {
 }
 
-void CChevLeftOff::save(SimpleFile *file, int indent) const {
+void CChevLeftOff::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/chev_left_off.h b/engines/titanic/gfx/chev_left_off.h
index 36a9d2c..572f58a 100644
--- a/engines/titanic/gfx/chev_left_off.h
+++ b/engines/titanic/gfx/chev_left_off.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/chev_left_on.cpp b/engines/titanic/gfx/chev_left_on.cpp
index c3264b7..5b3f6a8 100644
--- a/engines/titanic/gfx/chev_left_on.cpp
+++ b/engines/titanic/gfx/chev_left_on.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CChevLeftOn, CToggleSwitch)
 CChevLeftOn::CChevLeftOn() : CToggleSwitch() {
 }
 
-void CChevLeftOn::save(SimpleFile *file, int indent) const {
+void CChevLeftOn::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/chev_left_on.h b/engines/titanic/gfx/chev_left_on.h
index 0de814b..c015eef 100644
--- a/engines/titanic/gfx/chev_left_on.h
+++ b/engines/titanic/gfx/chev_left_on.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/chev_right_off.cpp b/engines/titanic/gfx/chev_right_off.cpp
index 60ed2de..4cab070 100644
--- a/engines/titanic/gfx/chev_right_off.cpp
+++ b/engines/titanic/gfx/chev_right_off.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CChevRightOff, CToggleSwitch)
 CChevRightOff::CChevRightOff() : CToggleSwitch() {
 }
 
-void CChevRightOff::save(SimpleFile *file, int indent) const {
+void CChevRightOff::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/chev_right_off.h b/engines/titanic/gfx/chev_right_off.h
index 3714c2b..05b62f3 100644
--- a/engines/titanic/gfx/chev_right_off.h
+++ b/engines/titanic/gfx/chev_right_off.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/chev_right_on.cpp b/engines/titanic/gfx/chev_right_on.cpp
index ac55100..29a07f0 100644
--- a/engines/titanic/gfx/chev_right_on.cpp
+++ b/engines/titanic/gfx/chev_right_on.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CChevRightOn, CToggleSwitch)
 CChevRightOn::CChevRightOn() : CToggleSwitch() {
 }
 
-void CChevRightOn::save(SimpleFile *file, int indent) const {
+void CChevRightOn::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/chev_right_on.h b/engines/titanic/gfx/chev_right_on.h
index d72c34a..56672f2 100644
--- a/engines/titanic/gfx/chev_right_on.h
+++ b/engines/titanic/gfx/chev_right_on.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/chev_send_rec_switch.cpp b/engines/titanic/gfx/chev_send_rec_switch.cpp
index d0d4a81..92b5518 100644
--- a/engines/titanic/gfx/chev_send_rec_switch.cpp
+++ b/engines/titanic/gfx/chev_send_rec_switch.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CChevSendRecSwitch, CToggleSwitch)
 CChevSendRecSwitch::CChevSendRecSwitch() : CToggleSwitch() {
 }
 
-void CChevSendRecSwitch::save(SimpleFile *file, int indent) const {
+void CChevSendRecSwitch::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/chev_send_rec_switch.h b/engines/titanic/gfx/chev_send_rec_switch.h
index 2f51bae..17a1b0a 100644
--- a/engines/titanic/gfx/chev_send_rec_switch.h
+++ b/engines/titanic/gfx/chev_send_rec_switch.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/chev_switch.cpp b/engines/titanic/gfx/chev_switch.cpp
index d7f1107..a6ce930 100644
--- a/engines/titanic/gfx/chev_switch.cpp
+++ b/engines/titanic/gfx/chev_switch.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CChevSwitch::CChevSwitch() : CToggleSwitch() {
 }
 
-void CChevSwitch::save(SimpleFile *file, int indent) const {
+void CChevSwitch::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/chev_switch.h b/engines/titanic/gfx/chev_switch.h
index 6c0314b..d3c884e 100644
--- a/engines/titanic/gfx/chev_switch.h
+++ b/engines/titanic/gfx/chev_switch.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/edit_control.cpp b/engines/titanic/gfx/edit_control.cpp
index 17a56d6..3b611e9 100644
--- a/engines/titanic/gfx/edit_control.cpp
+++ b/engines/titanic/gfx/edit_control.cpp
@@ -31,7 +31,7 @@ CEditControl::CEditControl() : CGameObject(), _fieldBC(0),  _fieldC0(0),
 {
 }
 
-void CEditControl::save(SimpleFile *file, int indent) const {
+void CEditControl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/gfx/edit_control.h b/engines/titanic/gfx/edit_control.h
index d782b72..4288637 100644
--- a/engines/titanic/gfx/edit_control.h
+++ b/engines/titanic/gfx/edit_control.h
@@ -49,7 +49,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/elevator_button.cpp b/engines/titanic/gfx/elevator_button.cpp
index 2a599ca..3c61869 100644
--- a/engines/titanic/gfx/elevator_button.cpp
+++ b/engines/titanic/gfx/elevator_button.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CElevatorButton, CSTButton)
 CElevatorButton::CElevatorButton() : CSTButton() {
 }
 
-void CElevatorButton::save(SimpleFile *file, int indent) const {
+void CElevatorButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSTButton::save(file, indent);
 }
diff --git a/engines/titanic/gfx/elevator_button.h b/engines/titanic/gfx/elevator_button.h
index d6bf5dc..da7e25a 100644
--- a/engines/titanic/gfx/elevator_button.h
+++ b/engines/titanic/gfx/elevator_button.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/get_from_succ.cpp b/engines/titanic/gfx/get_from_succ.cpp
index c7a59fd..0f3f4ba 100644
--- a/engines/titanic/gfx/get_from_succ.cpp
+++ b/engines/titanic/gfx/get_from_succ.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CGetFromSucc, CToggleSwitch)
 CGetFromSucc::CGetFromSucc() : CToggleSwitch() {
 }
 
-void CGetFromSucc::save(SimpleFile *file, int indent) const {
+void CGetFromSucc::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/get_from_succ.h b/engines/titanic/gfx/get_from_succ.h
index dc611f1..5f16f91 100644
--- a/engines/titanic/gfx/get_from_succ.h
+++ b/engines/titanic/gfx/get_from_succ.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/helmet_on_off.cpp b/engines/titanic/gfx/helmet_on_off.cpp
index 2913177..c72c795 100644
--- a/engines/titanic/gfx/helmet_on_off.cpp
+++ b/engines/titanic/gfx/helmet_on_off.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CHelmetOnOff, CToggleSwitch)
 CHelmetOnOff::CHelmetOnOff() : CToggleSwitch() {
 }
 
-void CHelmetOnOff::save(SimpleFile *file, int indent) const {
+void CHelmetOnOff::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/helmet_on_off.h b/engines/titanic/gfx/helmet_on_off.h
index f607b47..c0e1a0a 100644
--- a/engines/titanic/gfx/helmet_on_off.h
+++ b/engines/titanic/gfx/helmet_on_off.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/home_photo.cpp b/engines/titanic/gfx/home_photo.cpp
index 303e56d..1c3b064 100644
--- a/engines/titanic/gfx/home_photo.cpp
+++ b/engines/titanic/gfx/home_photo.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CHomePhoto, CToggleSwitch)
 CHomePhoto::CHomePhoto() : CToggleSwitch() {
 }
 
-void CHomePhoto::save(SimpleFile *file, int indent) const {
+void CHomePhoto::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/home_photo.h b/engines/titanic/gfx/home_photo.h
index db0be89..c143523 100644
--- a/engines/titanic/gfx/home_photo.h
+++ b/engines/titanic/gfx/home_photo.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/icon_nav_action.cpp b/engines/titanic/gfx/icon_nav_action.cpp
index e66c345..bd32c93 100644
--- a/engines/titanic/gfx/icon_nav_action.cpp
+++ b/engines/titanic/gfx/icon_nav_action.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CIconNavAction, CToggleSwitch)
 CIconNavAction::CIconNavAction() : CToggleSwitch() {
 }
 
-void CIconNavAction::save(SimpleFile *file, int indent) const {
+void CIconNavAction::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/icon_nav_action.h b/engines/titanic/gfx/icon_nav_action.h
index 189ea35..2a5961d 100644
--- a/engines/titanic/gfx/icon_nav_action.h
+++ b/engines/titanic/gfx/icon_nav_action.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/icon_nav_butt.cpp b/engines/titanic/gfx/icon_nav_butt.cpp
index 820a427..cc9a217 100644
--- a/engines/titanic/gfx/icon_nav_butt.cpp
+++ b/engines/titanic/gfx/icon_nav_butt.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CIconNavButt, CPetGraphic)
 
-void CIconNavButt::save(SimpleFile *file, int indent) const {
+void CIconNavButt::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
 }
diff --git a/engines/titanic/gfx/icon_nav_butt.h b/engines/titanic/gfx/icon_nav_butt.h
index 0cb2f1a..3c73a27 100644
--- a/engines/titanic/gfx/icon_nav_butt.h
+++ b/engines/titanic/gfx/icon_nav_butt.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/icon_nav_down.cpp b/engines/titanic/gfx/icon_nav_down.cpp
index 78727a3..09a0332 100644
--- a/engines/titanic/gfx/icon_nav_down.cpp
+++ b/engines/titanic/gfx/icon_nav_down.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CIconNavDown, CToggleSwitch)
 CIconNavDown::CIconNavDown() : CToggleSwitch() {
 }
 
-void CIconNavDown::save(SimpleFile *file, int indent) const {
+void CIconNavDown::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/icon_nav_down.h b/engines/titanic/gfx/icon_nav_down.h
index 3eef9ef..6de13ea 100644
--- a/engines/titanic/gfx/icon_nav_down.h
+++ b/engines/titanic/gfx/icon_nav_down.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/icon_nav_image.cpp b/engines/titanic/gfx/icon_nav_image.cpp
index d0c6239..59a50bb 100644
--- a/engines/titanic/gfx/icon_nav_image.cpp
+++ b/engines/titanic/gfx/icon_nav_image.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CIconNavImage, CPetGraphic)
 
-void CIconNavImage::save(SimpleFile *file, int indent) const {
+void CIconNavImage::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
 }
diff --git a/engines/titanic/gfx/icon_nav_image.h b/engines/titanic/gfx/icon_nav_image.h
index 8460733..3ff82f3 100644
--- a/engines/titanic/gfx/icon_nav_image.h
+++ b/engines/titanic/gfx/icon_nav_image.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/icon_nav_left.cpp b/engines/titanic/gfx/icon_nav_left.cpp
index 803818f..272e2a6 100644
--- a/engines/titanic/gfx/icon_nav_left.cpp
+++ b/engines/titanic/gfx/icon_nav_left.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CIconNavLeft, CToggleSwitch)
 CIconNavLeft::CIconNavLeft() : CToggleSwitch() {
 }
 
-void CIconNavLeft::save(SimpleFile *file, int indent) const {
+void CIconNavLeft::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/icon_nav_left.h b/engines/titanic/gfx/icon_nav_left.h
index 5fd7b65..bba3016 100644
--- a/engines/titanic/gfx/icon_nav_left.h
+++ b/engines/titanic/gfx/icon_nav_left.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/icon_nav_receive.cpp b/engines/titanic/gfx/icon_nav_receive.cpp
index 554656c..ba5d8ea 100644
--- a/engines/titanic/gfx/icon_nav_receive.cpp
+++ b/engines/titanic/gfx/icon_nav_receive.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CIconNavReceive, CPetGraphic)
 
-void CIconNavReceive::save(SimpleFile *file, int indent) const {
+void CIconNavReceive::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
 }
diff --git a/engines/titanic/gfx/icon_nav_receive.h b/engines/titanic/gfx/icon_nav_receive.h
index f181439..8fff0d0 100644
--- a/engines/titanic/gfx/icon_nav_receive.h
+++ b/engines/titanic/gfx/icon_nav_receive.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/icon_nav_right.cpp b/engines/titanic/gfx/icon_nav_right.cpp
index 1553c91..a661e0d 100644
--- a/engines/titanic/gfx/icon_nav_right.cpp
+++ b/engines/titanic/gfx/icon_nav_right.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CIconNavRight, CToggleSwitch)
 CIconNavRight::CIconNavRight() : CToggleSwitch() {
 }
 
-void CIconNavRight::save(SimpleFile *file, int indent) const {
+void CIconNavRight::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/icon_nav_right.h b/engines/titanic/gfx/icon_nav_right.h
index c088a23..1df1043 100644
--- a/engines/titanic/gfx/icon_nav_right.h
+++ b/engines/titanic/gfx/icon_nav_right.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/icon_nav_send.cpp b/engines/titanic/gfx/icon_nav_send.cpp
index 64d2a86..067e448 100644
--- a/engines/titanic/gfx/icon_nav_send.cpp
+++ b/engines/titanic/gfx/icon_nav_send.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CIconNavSend, CPetGraphic)
 
-void CIconNavSend::save(SimpleFile *file, int indent) const {
+void CIconNavSend::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
 }
diff --git a/engines/titanic/gfx/icon_nav_send.h b/engines/titanic/gfx/icon_nav_send.h
index 41c747e..d709205 100644
--- a/engines/titanic/gfx/icon_nav_send.h
+++ b/engines/titanic/gfx/icon_nav_send.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/icon_nav_up.cpp b/engines/titanic/gfx/icon_nav_up.cpp
index a8f4f55..5671dee 100644
--- a/engines/titanic/gfx/icon_nav_up.cpp
+++ b/engines/titanic/gfx/icon_nav_up.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CIconNavUp, CToggleSwitch)
 CIconNavUp::CIconNavUp() : CToggleSwitch() {
 }
 
-void CIconNavUp::save(SimpleFile *file, int indent) const {
+void CIconNavUp::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/icon_nav_up.h b/engines/titanic/gfx/icon_nav_up.h
index 691e665..73d4fc3 100644
--- a/engines/titanic/gfx/icon_nav_up.h
+++ b/engines/titanic/gfx/icon_nav_up.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/keybrd_butt.cpp b/engines/titanic/gfx/keybrd_butt.cpp
index 4a18d99..1a0a927 100644
--- a/engines/titanic/gfx/keybrd_butt.cpp
+++ b/engines/titanic/gfx/keybrd_butt.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CKeybrdButt, CToggleSwitch)
 CKeybrdButt::CKeybrdButt() : CToggleSwitch() {
 }
 
-void CKeybrdButt::save(SimpleFile *file, int indent) const {
+void CKeybrdButt::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/keybrd_butt.h b/engines/titanic/gfx/keybrd_butt.h
index 33ff418..4bf38a1 100644
--- a/engines/titanic/gfx/keybrd_butt.h
+++ b/engines/titanic/gfx/keybrd_butt.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/move_object_button.cpp b/engines/titanic/gfx/move_object_button.cpp
index 4ab0825..bdc90a6 100644
--- a/engines/titanic/gfx/move_object_button.cpp
+++ b/engines/titanic/gfx/move_object_button.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CMoveObjectButton::CMoveObjectButton() : CSTButton(), _field11C(1) {
 }
 
-void CMoveObjectButton::save(SimpleFile *file, int indent) const {
+void CMoveObjectButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writePoint(_pos1, indent);
 	file->writeNumberLine(_field11C, indent);
diff --git a/engines/titanic/gfx/move_object_button.h b/engines/titanic/gfx/move_object_button.h
index 3873db6..a255ecf 100644
--- a/engines/titanic/gfx/move_object_button.h
+++ b/engines/titanic/gfx/move_object_button.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/music_control.cpp b/engines/titanic/gfx/music_control.cpp
index 5ca079f..85a3d77 100644
--- a/engines/titanic/gfx/music_control.cpp
+++ b/engines/titanic/gfx/music_control.cpp
@@ -28,7 +28,7 @@ CMusicControl::CMusicControl() : CBackground(),
 	_fieldE0(0), _fieldE4(0), _fieldE8(1), _fieldEC(1) {
 }
 
-void CMusicControl::save(SimpleFile *file, int indent) const {
+void CMusicControl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/gfx/music_control.h b/engines/titanic/gfx/music_control.h
index 97a0077..4b79270 100644
--- a/engines/titanic/gfx/music_control.h
+++ b/engines/titanic/gfx/music_control.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/music_slider.cpp b/engines/titanic/gfx/music_slider.cpp
index f065ae6..fcf4d4b 100644
--- a/engines/titanic/gfx/music_slider.cpp
+++ b/engines/titanic/gfx/music_slider.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CMusicSlider, CMusicControl)
 
-void CMusicSlider::save(SimpleFile *file, int indent) const {
+void CMusicSlider::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CMusicControl::save(file, indent);
 }
diff --git a/engines/titanic/gfx/music_slider.h b/engines/titanic/gfx/music_slider.h
index b396074..87a06c6 100644
--- a/engines/titanic/gfx/music_slider.h
+++ b/engines/titanic/gfx/music_slider.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/music_slider_pitch.h b/engines/titanic/gfx/music_slider_pitch.h
index f50958b..edb8f42 100644
--- a/engines/titanic/gfx/music_slider_pitch.h
+++ b/engines/titanic/gfx/music_slider_pitch.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const {
+	virtual void save(SimpleFile *file, int indent) {
 		file->writeNumberLine(1, indent);
 		CMusicSlider::save(file, indent);
 	}
diff --git a/engines/titanic/gfx/music_slider_speed.h b/engines/titanic/gfx/music_slider_speed.h
index 8ed1862..c6a35dd 100644
--- a/engines/titanic/gfx/music_slider_speed.h
+++ b/engines/titanic/gfx/music_slider_speed.h
@@ -34,7 +34,7 @@ namespace Titanic {
 		/**
 		* Save the data for the class to file
 		*/
-		virtual void save(SimpleFile *file, int indent) const {
+		virtual void save(SimpleFile *file, int indent) {
 			file->writeNumberLine(1, indent);
 			CMusicSlider::save(file, indent);
 		}
diff --git a/engines/titanic/gfx/music_switch.cpp b/engines/titanic/gfx/music_switch.cpp
index 69e8f2e..fb1c6de 100644
--- a/engines/titanic/gfx/music_switch.cpp
+++ b/engines/titanic/gfx/music_switch.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CMusicSwitch, CMusicControl)
 
-void CMusicSwitch::save(SimpleFile *file, int indent) const {
+void CMusicSwitch::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CMusicControl::save(file, indent);
 }
diff --git a/engines/titanic/gfx/music_switch.h b/engines/titanic/gfx/music_switch.h
index bd9397e..bb90a8f 100644
--- a/engines/titanic/gfx/music_switch.h
+++ b/engines/titanic/gfx/music_switch.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/music_switch_inversion.h b/engines/titanic/gfx/music_switch_inversion.h
index 6aea692..052c812 100644
--- a/engines/titanic/gfx/music_switch_inversion.h
+++ b/engines/titanic/gfx/music_switch_inversion.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const {
+	virtual void save(SimpleFile *file, int indent) {
 		file->writeNumberLine(1, indent);
 		CMusicSwitch::save(file, indent);
 	}
diff --git a/engines/titanic/gfx/music_switch_reverse.h b/engines/titanic/gfx/music_switch_reverse.h
index 99460f1..5a6208c 100644
--- a/engines/titanic/gfx/music_switch_reverse.h
+++ b/engines/titanic/gfx/music_switch_reverse.h
@@ -34,7 +34,7 @@ namespace Titanic {
 		/**
 		 * Save the data for the class to file
 		 */
-		virtual void save(SimpleFile *file, int indent) const {
+		virtual void save(SimpleFile *file, int indent) {
 			file->writeNumberLine(1, indent);
 			CMusicSwitch::save(file, indent);
 		}
diff --git a/engines/titanic/gfx/music_voice_mute.h b/engines/titanic/gfx/music_voice_mute.h
index 2198b96..85aeda8 100644
--- a/engines/titanic/gfx/music_voice_mute.h
+++ b/engines/titanic/gfx/music_voice_mute.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const {
+	virtual void save(SimpleFile *file, int indent) {
 		file->writeNumberLine(1, indent);
 		CMusicControl::save(file, indent);
 	}
diff --git a/engines/titanic/gfx/send_to_succ.cpp b/engines/titanic/gfx/send_to_succ.cpp
index 938fa7c..3054191 100644
--- a/engines/titanic/gfx/send_to_succ.cpp
+++ b/engines/titanic/gfx/send_to_succ.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CSendToSucc, CToggleSwitch)
 CSendToSucc::CSendToSucc() : CToggleSwitch() {
 }
 
-void CSendToSucc::save(SimpleFile *file, int indent) const {
+void CSendToSucc::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/send_to_succ.h b/engines/titanic/gfx/send_to_succ.h
index 65868cd..1b8d177 100644
--- a/engines/titanic/gfx/send_to_succ.h
+++ b/engines/titanic/gfx/send_to_succ.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/sgt_selector.cpp b/engines/titanic/gfx/sgt_selector.cpp
index 170b0f4..c7b52f8 100644
--- a/engines/titanic/gfx/sgt_selector.cpp
+++ b/engines/titanic/gfx/sgt_selector.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CSGTSelector, CPetGraphic)
 
-void CSGTSelector::save(SimpleFile *file, int indent) const {
+void CSGTSelector::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
 }
diff --git a/engines/titanic/gfx/sgt_selector.h b/engines/titanic/gfx/sgt_selector.h
index 82757fa..c6d2a16 100644
--- a/engines/titanic/gfx/sgt_selector.h
+++ b/engines/titanic/gfx/sgt_selector.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/slider_button.cpp b/engines/titanic/gfx/slider_button.cpp
index bcd9add..0633158 100644
--- a/engines/titanic/gfx/slider_button.cpp
+++ b/engines/titanic/gfx/slider_button.cpp
@@ -28,7 +28,7 @@ CSliderButton::CSliderButton() : CSTButton(), _field114(0),
 		_field118(0), _field11C(0) {
 }
 
-void CSliderButton::save(SimpleFile *file, int indent) const {
+void CSliderButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field114, indent);
 	file->writeNumberLine(_field118, indent);
diff --git a/engines/titanic/gfx/slider_button.h b/engines/titanic/gfx/slider_button.h
index 2fdf448..3bd33aa 100644
--- a/engines/titanic/gfx/slider_button.h
+++ b/engines/titanic/gfx/slider_button.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/small_chev_left_off.cpp b/engines/titanic/gfx/small_chev_left_off.cpp
index 8647ad8..b0b22e9 100644
--- a/engines/titanic/gfx/small_chev_left_off.cpp
+++ b/engines/titanic/gfx/small_chev_left_off.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CSmallChevLeftOff, CToggleSwitch)
 CSmallChevLeftOff::CSmallChevLeftOff() : CToggleSwitch() {
 }
 
-void CSmallChevLeftOff::save(SimpleFile *file, int indent) const {
+void CSmallChevLeftOff::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/small_chev_left_off.h b/engines/titanic/gfx/small_chev_left_off.h
index 27c4001..a164235 100644
--- a/engines/titanic/gfx/small_chev_left_off.h
+++ b/engines/titanic/gfx/small_chev_left_off.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/small_chev_left_on.cpp b/engines/titanic/gfx/small_chev_left_on.cpp
index b5031e9..a2df2b5 100644
--- a/engines/titanic/gfx/small_chev_left_on.cpp
+++ b/engines/titanic/gfx/small_chev_left_on.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CSmallChevLeftOn, CToggleSwitch)
 CSmallChevLeftOn::CSmallChevLeftOn() : CToggleSwitch() {
 }
 
-void CSmallChevLeftOn::save(SimpleFile *file, int indent) const {
+void CSmallChevLeftOn::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/small_chev_left_on.h b/engines/titanic/gfx/small_chev_left_on.h
index 7b60857..ab94147 100644
--- a/engines/titanic/gfx/small_chev_left_on.h
+++ b/engines/titanic/gfx/small_chev_left_on.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/small_chev_right_off.cpp b/engines/titanic/gfx/small_chev_right_off.cpp
index 6d0c08e..48f0941 100644
--- a/engines/titanic/gfx/small_chev_right_off.cpp
+++ b/engines/titanic/gfx/small_chev_right_off.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CSmallChevRightOff, CToggleSwitch)
 CSmallChevRightOff::CSmallChevRightOff() : CToggleSwitch() {
 }
 
-void CSmallChevRightOff::save(SimpleFile *file, int indent) const {
+void CSmallChevRightOff::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/small_chev_right_off.h b/engines/titanic/gfx/small_chev_right_off.h
index 0dadae1..3283eb2 100644
--- a/engines/titanic/gfx/small_chev_right_off.h
+++ b/engines/titanic/gfx/small_chev_right_off.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/small_chev_right_on.cpp b/engines/titanic/gfx/small_chev_right_on.cpp
index 552990d..af794fa 100644
--- a/engines/titanic/gfx/small_chev_right_on.cpp
+++ b/engines/titanic/gfx/small_chev_right_on.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CSmallChevRightOn, CToggleSwitch)
 CSmallChevRightOn::CSmallChevRightOn() : CToggleSwitch() {
 }
 
-void CSmallChevRightOn::save(SimpleFile *file, int indent) const {
+void CSmallChevRightOn::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/gfx/small_chev_right_on.h b/engines/titanic/gfx/small_chev_right_on.h
index ea042d3..fe522c4 100644
--- a/engines/titanic/gfx/small_chev_right_on.h
+++ b/engines/titanic/gfx/small_chev_right_on.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/st_button.cpp b/engines/titanic/gfx/st_button.cpp
index b45d990..4b93d46 100644
--- a/engines/titanic/gfx/st_button.cpp
+++ b/engines/titanic/gfx/st_button.cpp
@@ -40,7 +40,7 @@ CSTButton::CSTButton() : CBackground() {
 	_buttonFrame = 0;
 }
 
-void CSTButton::save(SimpleFile *file, int indent) const {
+void CSTButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_statusInc, indent);
 	file->writeQuotedLine(_statusTarget, indent);
diff --git a/engines/titanic/gfx/st_button.h b/engines/titanic/gfx/st_button.h
index e2f9aa3..b3bd5e8 100644
--- a/engines/titanic/gfx/st_button.h
+++ b/engines/titanic/gfx/st_button.h
@@ -49,7 +49,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/status_change_button.cpp b/engines/titanic/gfx/status_change_button.cpp
index 36037a2..6644247 100644
--- a/engines/titanic/gfx/status_change_button.cpp
+++ b/engines/titanic/gfx/status_change_button.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CStatusChangeButton::CStatusChangeButton() : CSTButton() {
 }
 
-void CStatusChangeButton::save(SimpleFile *file, int indent) const {
+void CStatusChangeButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CSTButton::save(file, indent);
 }
diff --git a/engines/titanic/gfx/status_change_button.h b/engines/titanic/gfx/status_change_button.h
index be0d998..818f21e 100644
--- a/engines/titanic/gfx/status_change_button.h
+++ b/engines/titanic/gfx/status_change_button.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/text_down.cpp b/engines/titanic/gfx/text_down.cpp
index 967d60f..4a68752 100644
--- a/engines/titanic/gfx/text_down.cpp
+++ b/engines/titanic/gfx/text_down.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CTextDown, CPetGraphic)
 
-void CTextDown::save(SimpleFile *file, int indent) const {
+void CTextDown::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
 }
diff --git a/engines/titanic/gfx/text_down.h b/engines/titanic/gfx/text_down.h
index 920ea8c..04805e7 100644
--- a/engines/titanic/gfx/text_down.h
+++ b/engines/titanic/gfx/text_down.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/text_skrew.cpp b/engines/titanic/gfx/text_skrew.cpp
index 30cc7f4..391ed37 100644
--- a/engines/titanic/gfx/text_skrew.cpp
+++ b/engines/titanic/gfx/text_skrew.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CTextSkrew, CPetGraphic)
 
-void CTextSkrew::save(SimpleFile *file, int indent) const {
+void CTextSkrew::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
 }
diff --git a/engines/titanic/gfx/text_skrew.h b/engines/titanic/gfx/text_skrew.h
index 6e86e70..a932633 100644
--- a/engines/titanic/gfx/text_skrew.h
+++ b/engines/titanic/gfx/text_skrew.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/text_up.cpp b/engines/titanic/gfx/text_up.cpp
index 0cb4153..d5e2b1b 100644
--- a/engines/titanic/gfx/text_up.cpp
+++ b/engines/titanic/gfx/text_up.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CTextUp, CPetGraphic)
 
-void CTextUp::save(SimpleFile *file, int indent) const {
+void CTextUp::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
 }
diff --git a/engines/titanic/gfx/text_up.h b/engines/titanic/gfx/text_up.h
index 05a54bc..19f150b 100644
--- a/engines/titanic/gfx/text_up.h
+++ b/engines/titanic/gfx/text_up.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/toggle_button.cpp b/engines/titanic/gfx/toggle_button.cpp
index 3bb2e96..78e5356 100644
--- a/engines/titanic/gfx/toggle_button.cpp
+++ b/engines/titanic/gfx/toggle_button.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CToggleButton, CBackground)
 
-void CToggleButton::save(SimpleFile *file, int indent) const {
+void CToggleButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 
diff --git a/engines/titanic/gfx/toggle_button.h b/engines/titanic/gfx/toggle_button.h
index ac0bb69..b82e255 100644
--- a/engines/titanic/gfx/toggle_button.h
+++ b/engines/titanic/gfx/toggle_button.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/gfx/toggle_switch.cpp b/engines/titanic/gfx/toggle_switch.cpp
index 3307146..20cbb86 100644
--- a/engines/titanic/gfx/toggle_switch.cpp
+++ b/engines/titanic/gfx/toggle_switch.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CToggleSwitch::CToggleSwitch() : CGameObject(), _fieldBC(0) {
 }
 
-void CToggleSwitch::save(SimpleFile *file, int indent) const {
+void CToggleSwitch::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writePoint(_pos1, indent);
diff --git a/engines/titanic/gfx/toggle_switch.h b/engines/titanic/gfx/toggle_switch.h
index cc369f6..ce39fee 100644
--- a/engines/titanic/gfx/toggle_switch.h
+++ b/engines/titanic/gfx/toggle_switch.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/messages/auto_sound_event.cpp b/engines/titanic/messages/auto_sound_event.cpp
index 006762c..baa11c7 100644
--- a/engines/titanic/messages/auto_sound_event.cpp
+++ b/engines/titanic/messages/auto_sound_event.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CAutoSoundEvent::CAutoSoundEvent() : CGameObject(), _value1(0), _value2(70) {
 }
 
-void CAutoSoundEvent::save(SimpleFile *file, int indent) const {
+void CAutoSoundEvent::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value1, indent);
 	file->writeNumberLine(_value2, indent);
diff --git a/engines/titanic/messages/auto_sound_event.h b/engines/titanic/messages/auto_sound_event.h
index 03baba3..599404d 100644
--- a/engines/titanic/messages/auto_sound_event.h
+++ b/engines/titanic/messages/auto_sound_event.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/messages/bilge_auto_sound_event.cpp b/engines/titanic/messages/bilge_auto_sound_event.cpp
index 7bc91da..fa87b4b 100644
--- a/engines/titanic/messages/bilge_auto_sound_event.cpp
+++ b/engines/titanic/messages/bilge_auto_sound_event.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBilgeAutoSoundEvent::save(SimpleFile *file, int indent) const {
+void CBilgeAutoSoundEvent::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CAutoSoundEvent::save(file, indent);
 }
diff --git a/engines/titanic/messages/bilge_auto_sound_event.h b/engines/titanic/messages/bilge_auto_sound_event.h
index e51f74b..5d32282 100644
--- a/engines/titanic/messages/bilge_auto_sound_event.h
+++ b/engines/titanic/messages/bilge_auto_sound_event.h
@@ -34,7 +34,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/messages/bilge_dispensor_event.cpp b/engines/titanic/messages/bilge_dispensor_event.cpp
index f0daa7a..043ffe7 100644
--- a/engines/titanic/messages/bilge_dispensor_event.cpp
+++ b/engines/titanic/messages/bilge_dispensor_event.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBilgeDispensorEvent::save(SimpleFile *file, int indent) const {
+void CBilgeDispensorEvent::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CAutoSoundEvent::save(file, indent);
 }
diff --git a/engines/titanic/messages/bilge_dispensor_event.h b/engines/titanic/messages/bilge_dispensor_event.h
index df6e112..8616373 100644
--- a/engines/titanic/messages/bilge_dispensor_event.h
+++ b/engines/titanic/messages/bilge_dispensor_event.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/messages/door_auto_sound_event.cpp b/engines/titanic/messages/door_auto_sound_event.cpp
index ff9101f..b9cedae 100644
--- a/engines/titanic/messages/door_auto_sound_event.cpp
+++ b/engines/titanic/messages/door_auto_sound_event.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) const {
+void CDoorAutoSoundEvent::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
 	file->writeQuotedLine(_string2, indent);
diff --git a/engines/titanic/messages/door_auto_sound_event.h b/engines/titanic/messages/door_auto_sound_event.h
index cccc3ff..9b3ebbc 100644
--- a/engines/titanic/messages/door_auto_sound_event.h
+++ b/engines/titanic/messages/door_auto_sound_event.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
index e25c22f..5f587c9 100644
--- a/engines/titanic/messages/messages.cpp
+++ b/engines/titanic/messages/messages.cpp
@@ -32,7 +32,7 @@ namespace Titanic {
 CMessage::CMessage() : CSaveableObject() {
 }
 
-void CMessage::save(SimpleFile *file, int indent) const {
+void CMessage::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
 }
 
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index d456714..278fac1 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -123,7 +123,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/messages/service_elevator_door.cpp b/engines/titanic/messages/service_elevator_door.cpp
index e771f14..748790e 100644
--- a/engines/titanic/messages/service_elevator_door.cpp
+++ b/engines/titanic/messages/service_elevator_door.cpp
@@ -29,7 +29,7 @@ CServiceElevatorDoor::CServiceElevatorDoor() : CDoorAutoSoundEvent() {
 	_string2 = "z#32.wav";
 }
 
-void CServiceElevatorDoor::save(SimpleFile *file, int indent) const {
+void CServiceElevatorDoor::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string2, indent);
 	file->writeQuotedLine(_string1, indent);
diff --git a/engines/titanic/messages/service_elevator_door.h b/engines/titanic/messages/service_elevator_door.h
index ac5cf51..104b573 100644
--- a/engines/titanic/messages/service_elevator_door.h
+++ b/engines/titanic/messages/service_elevator_door.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/enter_bomb_room.cpp b/engines/titanic/moves/enter_bomb_room.cpp
index e989d47..55b838d 100644
--- a/engines/titanic/moves/enter_bomb_room.cpp
+++ b/engines/titanic/moves/enter_bomb_room.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CEnterBombRoom::CEnterBombRoom() : CMovePlayerTo(), _fieldC8(0) {
 }
 
-void CEnterBombRoom::save(SimpleFile *file, int indent) const {
+void CEnterBombRoom::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CMovePlayerTo::save(file, indent);
 }
diff --git a/engines/titanic/moves/enter_bomb_room.h b/engines/titanic/moves/enter_bomb_room.h
index dabde2e..d49b176 100644
--- a/engines/titanic/moves/enter_bomb_room.h
+++ b/engines/titanic/moves/enter_bomb_room.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/enter_bridge.cpp b/engines/titanic/moves/enter_bridge.cpp
index f526934..2600ee6 100644
--- a/engines/titanic/moves/enter_bridge.cpp
+++ b/engines/titanic/moves/enter_bridge.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CEnterBridge::save(SimpleFile *file, int indent) const {
+void CEnterBridge::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/moves/enter_bridge.h b/engines/titanic/moves/enter_bridge.h
index fee299a..86cc2f3 100644
--- a/engines/titanic/moves/enter_bridge.h
+++ b/engines/titanic/moves/enter_bridge.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/enter_exit_first_class_state.cpp b/engines/titanic/moves/enter_exit_first_class_state.cpp
index ed80947..0e2c6c0 100644
--- a/engines/titanic/moves/enter_exit_first_class_state.cpp
+++ b/engines/titanic/moves/enter_exit_first_class_state.cpp
@@ -34,7 +34,7 @@ void CEnterExitFirstClassState::deinit() {
 	delete _v1;
 }
 
-void CEnterExitFirstClassState::save(SimpleFile *file, int indent) const {
+void CEnterExitFirstClassState::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(*_v1, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/moves/enter_exit_first_class_state.h b/engines/titanic/moves/enter_exit_first_class_state.h
index 728395d..2038084 100644
--- a/engines/titanic/moves/enter_exit_first_class_state.h
+++ b/engines/titanic/moves/enter_exit_first_class_state.h
@@ -46,7 +46,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/enter_exit_mini_lift.cpp b/engines/titanic/moves/enter_exit_mini_lift.cpp
index b6a1423..eb56bdb 100644
--- a/engines/titanic/moves/enter_exit_mini_lift.cpp
+++ b/engines/titanic/moves/enter_exit_mini_lift.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CEnterExitMiniLift::save(SimpleFile *file, int indent) const {
+void CEnterExitMiniLift::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/moves/enter_exit_mini_lift.h b/engines/titanic/moves/enter_exit_mini_lift.h
index 5a91d39..e973cf8 100644
--- a/engines/titanic/moves/enter_exit_mini_lift.h
+++ b/engines/titanic/moves/enter_exit_mini_lift.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp b/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
index f993d26..b571a25 100644
--- a/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
+++ b/engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
@@ -34,7 +34,7 @@ void CEnterExitSecClassMiniLift::deinit() {
 	delete _statics;
 }
 
-void CEnterExitSecClassMiniLift::save(SimpleFile *file, int indent) const {
+void CEnterExitSecClassMiniLift::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_statics->_v1, indent);
 	file->writeNumberLine(_statics->_v2, indent);
diff --git a/engines/titanic/moves/enter_exit_sec_class_mini_lift.h b/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
index a1081c2..935dfb7 100644
--- a/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
+++ b/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
@@ -47,7 +47,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/enter_exit_view.cpp b/engines/titanic/moves/enter_exit_view.cpp
index 3e5789e..825156a 100644
--- a/engines/titanic/moves/enter_exit_view.cpp
+++ b/engines/titanic/moves/enter_exit_view.cpp
@@ -28,7 +28,7 @@ CEnterExitView::CEnterExitView() : CGameObject(), _fieldBC(0),
 	_fieldC0(0), _fieldC4(0), _fieldC8(0), _fieldCC(0) {
 }
 
-void CEnterExitView::save(SimpleFile *file, int indent) const {
+void CEnterExitView::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/moves/enter_exit_view.h b/engines/titanic/moves/enter_exit_view.h
index e967723..774c72e 100644
--- a/engines/titanic/moves/enter_exit_view.h
+++ b/engines/titanic/moves/enter_exit_view.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/enter_sec_class_state.cpp b/engines/titanic/moves/enter_sec_class_state.cpp
index 74f6176..dced724 100644
--- a/engines/titanic/moves/enter_sec_class_state.cpp
+++ b/engines/titanic/moves/enter_sec_class_state.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CEnterSecClassState::save(SimpleFile *file, int indent) const {
+void CEnterSecClassState::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value1, indent);
 	file->writeNumberLine(_value2, indent);
diff --git a/engines/titanic/moves/enter_sec_class_state.h b/engines/titanic/moves/enter_sec_class_state.h
index 2e80939..3eadfa2 100644
--- a/engines/titanic/moves/enter_sec_class_state.h
+++ b/engines/titanic/moves/enter_sec_class_state.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/exit_arboretum.cpp b/engines/titanic/moves/exit_arboretum.cpp
index 2b5b497..d606510 100644
--- a/engines/titanic/moves/exit_arboretum.cpp
+++ b/engines/titanic/moves/exit_arboretum.cpp
@@ -28,7 +28,7 @@ CExitArboretum::CExitArboretum() : CMovePlayerTo(),
 		_fieldC8(0), _fieldCC(0), _fieldD0(1) {
 }
 
-void CExitArboretum::save(SimpleFile *file, int indent) const {
+void CExitArboretum::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldC8, indent);
 	file->writeNumberLine(_fieldCC, indent);
diff --git a/engines/titanic/moves/exit_arboretum.h b/engines/titanic/moves/exit_arboretum.h
index 0da67dd..a20cf46 100644
--- a/engines/titanic/moves/exit_arboretum.h
+++ b/engines/titanic/moves/exit_arboretum.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/exit_bridge.cpp b/engines/titanic/moves/exit_bridge.cpp
index 99138f9..2ff56d3 100644
--- a/engines/titanic/moves/exit_bridge.cpp
+++ b/engines/titanic/moves/exit_bridge.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CExitBridge::CExitBridge() : CMovePlayerTo() {
 }
 
-void CExitBridge::save(SimpleFile *file, int indent) const {
+void CExitBridge::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CMovePlayerTo::save(file, indent);
 }
diff --git a/engines/titanic/moves/exit_bridge.h b/engines/titanic/moves/exit_bridge.h
index 9231728..b5fcd9a 100644
--- a/engines/titanic/moves/exit_bridge.h
+++ b/engines/titanic/moves/exit_bridge.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/exit_lift.cpp b/engines/titanic/moves/exit_lift.cpp
index 376b9e0..a264be8 100644
--- a/engines/titanic/moves/exit_lift.cpp
+++ b/engines/titanic/moves/exit_lift.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CExitLift::save(SimpleFile *file, int indent) const {
+void CExitLift::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/moves/exit_lift.h b/engines/titanic/moves/exit_lift.h
index e97f041..6144d43 100644
--- a/engines/titanic/moves/exit_lift.h
+++ b/engines/titanic/moves/exit_lift.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/exit_pellerator.cpp b/engines/titanic/moves/exit_pellerator.cpp
index 7c0a52b..68a2a8d 100644
--- a/engines/titanic/moves/exit_pellerator.cpp
+++ b/engines/titanic/moves/exit_pellerator.cpp
@@ -34,7 +34,7 @@ void CExitPellerator::deinit() {
 	delete _statics;
 }
 
-void CExitPellerator::save(SimpleFile *file, int indent) const {
+void CExitPellerator::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_statics->_v1, indent);
 	file->writeNumberLine(_statics->_v2, indent);
diff --git a/engines/titanic/moves/exit_pellerator.h b/engines/titanic/moves/exit_pellerator.h
index 3ae70db..3610831 100644
--- a/engines/titanic/moves/exit_pellerator.h
+++ b/engines/titanic/moves/exit_pellerator.h
@@ -44,7 +44,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/exit_state_room.cpp b/engines/titanic/moves/exit_state_room.cpp
index 0dc4a4f..1c78a69 100644
--- a/engines/titanic/moves/exit_state_room.cpp
+++ b/engines/titanic/moves/exit_state_room.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CExitStateRoom::CExitStateRoom() : CMovePlayerTo(), _fieldC8(0) {
 }
 
-void CExitStateRoom::save(SimpleFile *file, int indent) const {
+void CExitStateRoom::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CMovePlayerTo::save(file, indent);
 }
diff --git a/engines/titanic/moves/exit_state_room.h b/engines/titanic/moves/exit_state_room.h
index ccf52ce..ac94297 100644
--- a/engines/titanic/moves/exit_state_room.h
+++ b/engines/titanic/moves/exit_state_room.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/exit_tiania.cpp b/engines/titanic/moves/exit_tiania.cpp
index 99b6c96..6cb2422 100644
--- a/engines/titanic/moves/exit_tiania.cpp
+++ b/engines/titanic/moves/exit_tiania.cpp
@@ -28,7 +28,7 @@ CExitTiania::CExitTiania() : CMovePlayerTo(), _fieldC8(0),
 		_string1("NULL"), _string2("NULL"), _string3("NULL") {
 }
 
-void CExitTiania::save(SimpleFile *file, int indent) const {
+void CExitTiania::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldC8, indent);
 	file->writeQuotedLine(_string1, indent);
diff --git a/engines/titanic/moves/exit_tiania.h b/engines/titanic/moves/exit_tiania.h
index 3af5aad..6ae3bc8 100644
--- a/engines/titanic/moves/exit_tiania.h
+++ b/engines/titanic/moves/exit_tiania.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/move_player_in_parrot_room.cpp b/engines/titanic/moves/move_player_in_parrot_room.cpp
index 91c1706..df38c63 100644
--- a/engines/titanic/moves/move_player_in_parrot_room.cpp
+++ b/engines/titanic/moves/move_player_in_parrot_room.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CMovePlayerInParrotRoom::CMovePlayerInParrotRoom() : CMovePlayerTo() {
 }
 
-void CMovePlayerInParrotRoom::save(SimpleFile *file, int indent) const {
+void CMovePlayerInParrotRoom::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CMovePlayerTo::save(file, indent);
 }
diff --git a/engines/titanic/moves/move_player_in_parrot_room.h b/engines/titanic/moves/move_player_in_parrot_room.h
index 5339a60..cdb0007 100644
--- a/engines/titanic/moves/move_player_in_parrot_room.h
+++ b/engines/titanic/moves/move_player_in_parrot_room.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/move_player_to.cpp b/engines/titanic/moves/move_player_to.cpp
index 8ce8f77..9b6000c 100644
--- a/engines/titanic/moves/move_player_to.cpp
+++ b/engines/titanic/moves/move_player_to.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CMovePlayerTo::CMovePlayerTo() : CGameObject() {
 }
 
-void CMovePlayerTo::save(SimpleFile *file, int indent) const {
+void CMovePlayerTo::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_destination, indent);
 
diff --git a/engines/titanic/moves/move_player_to.h b/engines/titanic/moves/move_player_to.h
index 2617b46..890c822 100644
--- a/engines/titanic/moves/move_player_to.h
+++ b/engines/titanic/moves/move_player_to.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/move_player_to_from.cpp b/engines/titanic/moves/move_player_to_from.cpp
index f349c5c..1a67dc8 100644
--- a/engines/titanic/moves/move_player_to_from.cpp
+++ b/engines/titanic/moves/move_player_to_from.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CMovePlayerToFrom::CMovePlayerToFrom() : CGameObject() {
 }
 
-void CMovePlayerToFrom::save(SimpleFile *file, int indent) const {
+void CMovePlayerToFrom::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string2, indent);
 
diff --git a/engines/titanic/moves/move_player_to_from.h b/engines/titanic/moves/move_player_to_from.h
index bc1878a..14c6e3a 100644
--- a/engines/titanic/moves/move_player_to_from.h
+++ b/engines/titanic/moves/move_player_to_from.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/multi_move.cpp b/engines/titanic/moves/multi_move.cpp
index 6b35b8865..fb5570d 100644
--- a/engines/titanic/moves/multi_move.cpp
+++ b/engines/titanic/moves/multi_move.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CMultiMove::CMultiMove() : CMovePlayerTo() {
 }
 
-void CMultiMove::save(SimpleFile *file, int indent) const {
+void CMultiMove::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
 	file->writeQuotedLine(_string2, indent);
diff --git a/engines/titanic/moves/multi_move.h b/engines/titanic/moves/multi_move.h
index a06632d..a18eb76 100644
--- a/engines/titanic/moves/multi_move.h
+++ b/engines/titanic/moves/multi_move.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/pan_from_pel.cpp b/engines/titanic/moves/pan_from_pel.cpp
index db3c9bf..fccc643 100644
--- a/engines/titanic/moves/pan_from_pel.cpp
+++ b/engines/titanic/moves/pan_from_pel.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CPanFromPel::CPanFromPel() : CMovePlayerTo(), _fieldC8(0) {
 }
 
-void CPanFromPel::save(SimpleFile *file, int indent) const {
+void CPanFromPel::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldC8, indent);
 	file->writeQuotedLine(_string1, indent);
diff --git a/engines/titanic/moves/pan_from_pel.h b/engines/titanic/moves/pan_from_pel.h
index b94f516..936bac8 100644
--- a/engines/titanic/moves/pan_from_pel.h
+++ b/engines/titanic/moves/pan_from_pel.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/restaurant_pan_handler.cpp b/engines/titanic/moves/restaurant_pan_handler.cpp
index 8efc5cb..92f55b4 100644
--- a/engines/titanic/moves/restaurant_pan_handler.cpp
+++ b/engines/titanic/moves/restaurant_pan_handler.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 int CRestaurantPanHandler::_v1;
 
-void CRestaurantPanHandler::save(SimpleFile *file, int indent) const {
+void CRestaurantPanHandler::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeQuotedLine(_string1, indent);
diff --git a/engines/titanic/moves/restaurant_pan_handler.h b/engines/titanic/moves/restaurant_pan_handler.h
index 29f7832..2caf286 100644
--- a/engines/titanic/moves/restaurant_pan_handler.h
+++ b/engines/titanic/moves/restaurant_pan_handler.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/restricted_move.cpp b/engines/titanic/moves/restricted_move.cpp
index d6a046d..5f18dab 100644
--- a/engines/titanic/moves/restricted_move.cpp
+++ b/engines/titanic/moves/restricted_move.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CRestrictedMove::CRestrictedMove() : CMovePlayerTo(), _fieldC8(0) {
 }
 
-void CRestrictedMove::save(SimpleFile *file, int indent) const {
+void CRestrictedMove::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldC8, indent);
 
diff --git a/engines/titanic/moves/restricted_move.h b/engines/titanic/moves/restricted_move.h
index ef95e0f..59ff69f 100644
--- a/engines/titanic/moves/restricted_move.h
+++ b/engines/titanic/moves/restricted_move.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/scraliontis_table.cpp b/engines/titanic/moves/scraliontis_table.cpp
index d67b2f3..77d2f9d 100644
--- a/engines/titanic/moves/scraliontis_table.cpp
+++ b/engines/titanic/moves/scraliontis_table.cpp
@@ -28,7 +28,7 @@ CScraliontisTable::CScraliontisTable() : CRestaurantPanHandler(),
 		_fieldE0(0), _fieldE4(0), _fieldE8(0), _fieldEC(0) {
 }
 
-void CScraliontisTable::save(SimpleFile *file, int indent) const {
+void CScraliontisTable::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldE0, indent);
 	file->writeNumberLine(_fieldE4, indent);
diff --git a/engines/titanic/moves/scraliontis_table.h b/engines/titanic/moves/scraliontis_table.h
index 53b0006..a1b8052 100644
--- a/engines/titanic/moves/scraliontis_table.h
+++ b/engines/titanic/moves/scraliontis_table.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/moves/trip_down_canal.cpp b/engines/titanic/moves/trip_down_canal.cpp
index 349a7e9..c8051dd 100644
--- a/engines/titanic/moves/trip_down_canal.cpp
+++ b/engines/titanic/moves/trip_down_canal.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CTripDownCanal::CTripDownCanal() : CMovePlayerTo() {
 }
 
-void CTripDownCanal::save(SimpleFile *file, int indent) const {
+void CTripDownCanal::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CMovePlayerTo::save(file, indent);
 }
diff --git a/engines/titanic/moves/trip_down_canal.h b/engines/titanic/moves/trip_down_canal.h
index 80d5dcf..debe064 100644
--- a/engines/titanic/moves/trip_down_canal.h
+++ b/engines/titanic/moves/trip_down_canal.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/barbot.cpp b/engines/titanic/npcs/barbot.cpp
index 8abf41d..8f1c5e6 100644
--- a/engines/titanic/npcs/barbot.cpp
+++ b/engines/titanic/npcs/barbot.cpp
@@ -171,7 +171,7 @@ CBarbot::CBarbot() : CTrueTalkNPC() {
 	_field340 = 95;
 }
 
-void CBarbot::save(SimpleFile *file, int indent) const {
+void CBarbot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field108, indent);
 	file->writeNumberLine(_field10C, indent);
diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h
index fa06f8f..27a091e 100644
--- a/engines/titanic/npcs/barbot.h
+++ b/engines/titanic/npcs/barbot.h
@@ -181,7 +181,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/bellbot.cpp b/engines/titanic/npcs/bellbot.cpp
index 4874722..7ee0128 100644
--- a/engines/titanic/npcs/bellbot.cpp
+++ b/engines/titanic/npcs/bellbot.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CBellBot::CBellBot() : CTrueTalkNPC(), _field108(0) {
 }
 
-void CBellBot::save(SimpleFile *file, int indent) const {
+void CBellBot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field108, indent);
 
diff --git a/engines/titanic/npcs/bellbot.h b/engines/titanic/npcs/bellbot.h
index c3d38f6..6be0615 100644
--- a/engines/titanic/npcs/bellbot.h
+++ b/engines/titanic/npcs/bellbot.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/callbot.cpp b/engines/titanic/npcs/callbot.cpp
index 3fb7ee2..eb0d4b7 100644
--- a/engines/titanic/npcs/callbot.cpp
+++ b/engines/titanic/npcs/callbot.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CCallBot::CCallBot() : CGameObject(), _fieldC8(0) {
 }
 
-void CCallBot::save(SimpleFile *file, int indent) const {
+void CCallBot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
 	file->writeNumberLine(_fieldC8, indent);
diff --git a/engines/titanic/npcs/callbot.h b/engines/titanic/npcs/callbot.h
index 299a329..6848121 100644
--- a/engines/titanic/npcs/callbot.h
+++ b/engines/titanic/npcs/callbot.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/character.cpp b/engines/titanic/npcs/character.cpp
index df905d9..ed36db1 100644
--- a/engines/titanic/npcs/character.cpp
+++ b/engines/titanic/npcs/character.cpp
@@ -33,7 +33,7 @@ END_MESSAGE_MAP()
 CCharacter::CCharacter() : CGameObject(), _fieldBC(0), _fieldC0(0), _fieldC4(1) {
 }
 
-void CCharacter::save(SimpleFile *file, int indent) const {
+void CCharacter::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeNumberLine(_fieldC0, indent);
diff --git a/engines/titanic/npcs/character.h b/engines/titanic/npcs/character.h
index c0cc8ff..2362f01 100644
--- a/engines/titanic/npcs/character.h
+++ b/engines/titanic/npcs/character.h
@@ -44,7 +44,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp
index 3fe9236..d11b135 100644
--- a/engines/titanic/npcs/deskbot.cpp
+++ b/engines/titanic/npcs/deskbot.cpp
@@ -55,7 +55,7 @@ int CDeskbot::_v2;
 CDeskbot::CDeskbot() : CTrueTalkNPC(), _deskbotActive(false), _classNum(0) {
 }
 
-void CDeskbot::save(SimpleFile *file, int indent) const {
+void CDeskbot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
diff --git a/engines/titanic/npcs/deskbot.h b/engines/titanic/npcs/deskbot.h
index 3e155f6..ff54599 100644
--- a/engines/titanic/npcs/deskbot.h
+++ b/engines/titanic/npcs/deskbot.h
@@ -53,7 +53,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/doorbot.cpp b/engines/titanic/npcs/doorbot.cpp
index 17db94f..76db55f 100644
--- a/engines/titanic/npcs/doorbot.cpp
+++ b/engines/titanic/npcs/doorbot.cpp
@@ -34,7 +34,7 @@ CDoorbot::CDoorbot() : CTrueTalkNPC() {
 	_field114 = 0;
 }
 
-void CDoorbot::save(SimpleFile *file, int indent) const {
+void CDoorbot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_v2, indent);
diff --git a/engines/titanic/npcs/doorbot.h b/engines/titanic/npcs/doorbot.h
index f0c46e5..9ea7de6 100644
--- a/engines/titanic/npcs/doorbot.h
+++ b/engines/titanic/npcs/doorbot.h
@@ -43,7 +43,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/liftbot.cpp b/engines/titanic/npcs/liftbot.cpp
index 0125406..43daa01 100644
--- a/engines/titanic/npcs/liftbot.cpp
+++ b/engines/titanic/npcs/liftbot.cpp
@@ -30,7 +30,7 @@ int CLiftBot::_v2;
 CLiftBot::CLiftBot() : CTrueTalkNPC(), _field108(1) {
 }
 
-void CLiftBot::save(SimpleFile *file, int indent) const {
+void CLiftBot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 	file->writeNumberLine(_field108, indent);
diff --git a/engines/titanic/npcs/liftbot.h b/engines/titanic/npcs/liftbot.h
index d0db94e..e993da0 100644
--- a/engines/titanic/npcs/liftbot.h
+++ b/engines/titanic/npcs/liftbot.h
@@ -42,7 +42,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/maitre_d.cpp b/engines/titanic/npcs/maitre_d.cpp
index d100a0b..903f3a4 100644
--- a/engines/titanic/npcs/maitre_d.cpp
+++ b/engines/titanic/npcs/maitre_d.cpp
@@ -31,7 +31,7 @@ CMaitreD::CMaitreD() : CTrueTalkNPC(),
 	_field11C(0), _field12C(0), _field130(1), _field134(0), _field138(0) {
 }
 
-void CMaitreD::save(SimpleFile *file, int indent) const {
+void CMaitreD::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_field108, indent);
 	file->writeQuotedLine(_string2, indent);
diff --git a/engines/titanic/npcs/maitre_d.h b/engines/titanic/npcs/maitre_d.h
index bae682b..6a63348 100644
--- a/engines/titanic/npcs/maitre_d.h
+++ b/engines/titanic/npcs/maitre_d.h
@@ -47,7 +47,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/mobile.cpp b/engines/titanic/npcs/mobile.cpp
index 55b37f5..83f886e 100644
--- a/engines/titanic/npcs/mobile.cpp
+++ b/engines/titanic/npcs/mobile.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CMobile, CCharacter)
 CMobile::CMobile() : CCharacter(), _fieldDC(0) {
 }
 
-void CMobile::save(SimpleFile *file, int indent) const {
+void CMobile::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writePoint(_pos1, indent);
 	file->writeNumberLine(_fieldDC, indent);
diff --git a/engines/titanic/npcs/mobile.h b/engines/titanic/npcs/mobile.h
index 3ec19a4..42effc6 100644
--- a/engines/titanic/npcs/mobile.h
+++ b/engines/titanic/npcs/mobile.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
index a4cfa08..49e4f40 100644
--- a/engines/titanic/npcs/parrot.cpp
+++ b/engines/titanic/npcs/parrot.cpp
@@ -92,7 +92,7 @@ CParrot::CParrot() : CTrueTalkNPC() {
 	_assetNumber = 0x13880;
 }
 
-void CParrot::save(SimpleFile *file, int indent) const {
+void CParrot::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_assetNumber, indent);
 	
diff --git a/engines/titanic/npcs/parrot.h b/engines/titanic/npcs/parrot.h
index 0019437..010d9af 100644
--- a/engines/titanic/npcs/parrot.h
+++ b/engines/titanic/npcs/parrot.h
@@ -98,7 +98,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/robot_controller.cpp b/engines/titanic/npcs/robot_controller.cpp
index c6ef422..98866e4 100644
--- a/engines/titanic/npcs/robot_controller.cpp
+++ b/engines/titanic/npcs/robot_controller.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CRobotController::CRobotController() : CGameObject(), _string1("BellBot") {
 }
 
-void CRobotController::save(SimpleFile *file, int indent) const {
+void CRobotController::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
 
diff --git a/engines/titanic/npcs/robot_controller.h b/engines/titanic/npcs/robot_controller.h
index 998453e..54b0a20 100644
--- a/engines/titanic/npcs/robot_controller.h
+++ b/engines/titanic/npcs/robot_controller.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/starlings.cpp b/engines/titanic/npcs/starlings.cpp
index dcb9fbd..333f4c4 100644
--- a/engines/titanic/npcs/starlings.cpp
+++ b/engines/titanic/npcs/starlings.cpp
@@ -29,7 +29,7 @@ int CStarlings::_v1;
 CStarlings::CStarlings() : CCharacter() {
 }
 
-void CStarlings::save(SimpleFile *file, int indent) const {
+void CStarlings::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_v1, indent);
 
diff --git a/engines/titanic/npcs/starlings.h b/engines/titanic/npcs/starlings.h
index f7b1442..40cb1b8 100644
--- a/engines/titanic/npcs/starlings.h
+++ b/engines/titanic/npcs/starlings.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/succubus.cpp b/engines/titanic/npcs/succubus.cpp
index 7570338..f66a59c 100644
--- a/engines/titanic/npcs/succubus.cpp
+++ b/engines/titanic/npcs/succubus.cpp
@@ -84,7 +84,7 @@ CSuccUBus::CSuccUBus() : CTrueTalkNPC() {
 	_field1D8 = 0;
 }
 
-void CSuccUBus::save(SimpleFile *file, int indent) const {
+void CSuccUBus::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 
 	file->writeNumberLine(_v0, indent);
diff --git a/engines/titanic/npcs/succubus.h b/engines/titanic/npcs/succubus.h
index e46592c..a78a88b 100644
--- a/engines/titanic/npcs/succubus.h
+++ b/engines/titanic/npcs/succubus.h
@@ -93,7 +93,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/summon_bots.cpp b/engines/titanic/npcs/summon_bots.cpp
index 661b3f0..8796e5f 100644
--- a/engines/titanic/npcs/summon_bots.cpp
+++ b/engines/titanic/npcs/summon_bots.cpp
@@ -28,7 +28,7 @@ CSummonBots::CSummonBots() : CRobotController(), _string2("NULL"),
 		_fieldC8(0), _fieldCC(0) {
 }
 
-void CSummonBots::save(SimpleFile *file, int indent) const {
+void CSummonBots::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldC8, indent);
 	file->writeNumberLine(_fieldCC, indent);
diff --git a/engines/titanic/npcs/summon_bots.h b/engines/titanic/npcs/summon_bots.h
index 80aef73..245d047 100644
--- a/engines/titanic/npcs/summon_bots.h
+++ b/engines/titanic/npcs/summon_bots.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/titania.cpp b/engines/titanic/npcs/titania.cpp
index 3a71d7f..34c21d0 100644
--- a/engines/titanic/npcs/titania.cpp
+++ b/engines/titanic/npcs/titania.cpp
@@ -38,7 +38,7 @@ CTitania::CTitania() : CCharacter() {
 	_field100 = 1;
 }
 
-void CTitania::save(SimpleFile *file, int indent) const {
+void CTitania::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldD4, indent);
 	file->writeNumberLine(_fieldD8, indent);
diff --git a/engines/titanic/npcs/titania.h b/engines/titanic/npcs/titania.h
index 4c4c812..3eb95c0 100644
--- a/engines/titanic/npcs/titania.h
+++ b/engines/titanic/npcs/titania.h
@@ -48,7 +48,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index 0eaf213..51d7c2e 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -44,7 +44,7 @@ CTrueTalkNPC::CTrueTalkNPC() : _assetName("z451.dlg"),
 	_fieldF4(0), _fieldF8(0), _speechTimerId(0), _field100(0), _field104(0) {
 }
 
-void CTrueTalkNPC::save(SimpleFile *file, int indent) const {
+void CTrueTalkNPC::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_assetNumber, indent);
 	file->writeQuotedLine(_assetName, indent);
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index 3126d92..7202f25 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -84,7 +84,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 6e30711..0695cde 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -55,7 +55,7 @@ CPetControl::CPetControl() : CGameObject(),
 	_sections[PET_MESSAGE] = &_message;
 }
 
-void CPetControl::save(SimpleFile *file, int indent) const {
+void CPetControl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
 	file->writeNumberLine(_currentArea, indent);
 	file->writeQuotedLine(_activeNPCName, indent);
@@ -113,7 +113,7 @@ void CPetControl::loadAreas(SimpleFile *file, int param) {
 	_frame.load(file, param);
 }
 
-void CPetControl::saveAreas(SimpleFile *file, int indent) const {
+void CPetControl::saveAreas(SimpleFile *file, int indent) {
 	_conversations.save(file, indent);
 	_rooms.save(file, indent);
 	_remote.save(file, indent);
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 75b92d7..e56d8f8 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -81,7 +81,7 @@ private:
 	/**
 	 * Saves data for the individual areas
 	 */
-	void saveAreas(SimpleFile *file, int indent) const;
+	void saveAreas(SimpleFile *file, int indent);
 
 	/**
 	 * Called at the end of the post game-load handling
@@ -125,7 +125,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index f9c051a..0a8a71b 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -230,7 +230,7 @@ void CPetConversations::postLoad() {
 	reset();
 }
 
-void CPetConversations::save(SimpleFile *file, int indent) const {
+void CPetConversations::save(SimpleFile *file, int indent) {
 	_textInput.save(file, indent);
 	_log.save(file, indent);
 
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 51487e1..62cddd4 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -194,7 +194,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Called when a section is switched to
diff --git a/engines/titanic/pet_control/pet_drag_chev.cpp b/engines/titanic/pet_control/pet_drag_chev.cpp
index e6c4749..beaac4e 100644
--- a/engines/titanic/pet_control/pet_drag_chev.cpp
+++ b/engines/titanic/pet_control/pet_drag_chev.cpp
@@ -31,7 +31,7 @@ BEGIN_MESSAGE_MAP(CPetDragChev, CPetGraphic2)
 
 END_MESSAGE_MAP()
 
-void CPetDragChev::save(SimpleFile *file, int indent) const {
+void CPetDragChev::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPetGraphic2::save(file, indent);
 }
diff --git a/engines/titanic/pet_control/pet_drag_chev.h b/engines/titanic/pet_control/pet_drag_chev.h
index 4e671ce..1ca9788 100644
--- a/engines/titanic/pet_control/pet_drag_chev.h
+++ b/engines/titanic/pet_control/pet_drag_chev.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/pet_control/pet_graphic.cpp b/engines/titanic/pet_control/pet_graphic.cpp
index 25a7739..c4e1849 100644
--- a/engines/titanic/pet_control/pet_graphic.cpp
+++ b/engines/titanic/pet_control/pet_graphic.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CPetGraphic, CGameObject)
 
-void CPetGraphic::save(SimpleFile *file, int indent) const {
+void CPetGraphic::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/pet_control/pet_graphic.h b/engines/titanic/pet_control/pet_graphic.h
index d49d0d4..34badfd 100644
--- a/engines/titanic/pet_control/pet_graphic.h
+++ b/engines/titanic/pet_control/pet_graphic.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/pet_control/pet_graphic2.cpp b/engines/titanic/pet_control/pet_graphic2.cpp
index a33a1c7..79cf42e 100644
--- a/engines/titanic/pet_control/pet_graphic2.cpp
+++ b/engines/titanic/pet_control/pet_graphic2.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CPetGraphic2, CGameObject)
 
-void CPetGraphic2::save(SimpleFile *file, int indent) const {
+void CPetGraphic2::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/pet_control/pet_graphic2.h b/engines/titanic/pet_control/pet_graphic2.h
index d10dd10..4e77662 100644
--- a/engines/titanic/pet_control/pet_graphic2.h
+++ b/engines/titanic/pet_control/pet_graphic2.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 62eee83..2f8125c 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -114,7 +114,7 @@ void CPetInventory::postLoad() {
 	_field290 = 0;
 }
 
-void CPetInventory::save(SimpleFile *file, int indent) const {
+void CPetInventory::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(_field298, indent);
 }
 
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 8a6bceb..9e074dd 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -119,7 +119,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	* Called when a section is switched to
diff --git a/engines/titanic/pet_control/pet_leaf.cpp b/engines/titanic/pet_control/pet_leaf.cpp
index 833f4ed..bf40b6c 100644
--- a/engines/titanic/pet_control/pet_leaf.cpp
+++ b/engines/titanic/pet_control/pet_leaf.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(PETLeaf, CGameObject)
 
-void PETLeaf::save(SimpleFile *file, int indent) const {
+void PETLeaf::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CGameObject::save(file, indent);
 }
diff --git a/engines/titanic/pet_control/pet_leaf.h b/engines/titanic/pet_control/pet_leaf.h
index b9c516f..0d18742 100644
--- a/engines/titanic/pet_control/pet_leaf.h
+++ b/engines/titanic/pet_control/pet_leaf.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/pet_control/pet_message.h b/engines/titanic/pet_control/pet_message.h
index 1ad031d..499f274 100644
--- a/engines/titanic/pet_control/pet_message.h
+++ b/engines/titanic/pet_control/pet_message.h
@@ -82,7 +82,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const {}
+	virtual void save(SimpleFile *file, int indent) {}
 
 	/**
 	 * Get a reference to the tooltip text associated with the section
diff --git a/engines/titanic/pet_control/pet_mode_off.cpp b/engines/titanic/pet_control/pet_mode_off.cpp
index a1c9f3d..277b8e5 100644
--- a/engines/titanic/pet_control/pet_mode_off.cpp
+++ b/engines/titanic/pet_control/pet_mode_off.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CPetModeOff, CToggleSwitch)
 CPetModeOff::CPetModeOff() : CToggleSwitch() {
 }
 
-void CPetModeOff::save(SimpleFile *file, int indent) const {
+void CPetModeOff::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/pet_control/pet_mode_off.h b/engines/titanic/pet_control/pet_mode_off.h
index a84ed30..0a4851a 100644
--- a/engines/titanic/pet_control/pet_mode_off.h
+++ b/engines/titanic/pet_control/pet_mode_off.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/pet_control/pet_mode_on.cpp b/engines/titanic/pet_control/pet_mode_on.cpp
index 1a7c2c2..89845dc 100644
--- a/engines/titanic/pet_control/pet_mode_on.cpp
+++ b/engines/titanic/pet_control/pet_mode_on.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CPetModeOn, CToggleSwitch)
 CPetModeOn::CPetModeOn() : CToggleSwitch() {
 }
 
-void CPetModeOn::save(SimpleFile *file, int indent) const {
+void CPetModeOn::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/pet_control/pet_mode_on.h b/engines/titanic/pet_control/pet_mode_on.h
index 76e0c92..d33a0d2 100644
--- a/engines/titanic/pet_control/pet_mode_on.h
+++ b/engines/titanic/pet_control/pet_mode_on.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/pet_control/pet_mode_panel.cpp b/engines/titanic/pet_control/pet_mode_panel.cpp
index 87351be..1384602 100644
--- a/engines/titanic/pet_control/pet_mode_panel.cpp
+++ b/engines/titanic/pet_control/pet_mode_panel.cpp
@@ -29,7 +29,7 @@ EMPTY_MESSAGE_MAP(CPetModePanel, CToggleSwitch)
 CPetModePanel::CPetModePanel() : CToggleSwitch() {
 }
 
-void CPetModePanel::save(SimpleFile *file, int indent) const {
+void CPetModePanel::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CToggleSwitch::save(file, indent);
 }
diff --git a/engines/titanic/pet_control/pet_mode_panel.h b/engines/titanic/pet_control/pet_mode_panel.h
index b55f38a..17ce48d 100644
--- a/engines/titanic/pet_control/pet_mode_panel.h
+++ b/engines/titanic/pet_control/pet_mode_panel.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/pet_control/pet_pannel1.cpp b/engines/titanic/pet_control/pet_pannel1.cpp
index 527841f..9906212 100644
--- a/engines/titanic/pet_control/pet_pannel1.cpp
+++ b/engines/titanic/pet_control/pet_pannel1.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CPetPannel1, CPetGraphic)
 
-void CPetPannel1::save(SimpleFile *file, int indent) const {
+void CPetPannel1::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
 }
diff --git a/engines/titanic/pet_control/pet_pannel1.h b/engines/titanic/pet_control/pet_pannel1.h
index 4e14536..c81d451 100644
--- a/engines/titanic/pet_control/pet_pannel1.h
+++ b/engines/titanic/pet_control/pet_pannel1.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/pet_control/pet_pannel2.cpp b/engines/titanic/pet_control/pet_pannel2.cpp
index 48675a7..b67e0ed 100644
--- a/engines/titanic/pet_control/pet_pannel2.cpp
+++ b/engines/titanic/pet_control/pet_pannel2.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CPetPannel2, CPetGraphic)
 
-void CPetPannel2::save(SimpleFile *file, int indent) const {
+void CPetPannel2::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
 }
diff --git a/engines/titanic/pet_control/pet_pannel2.h b/engines/titanic/pet_control/pet_pannel2.h
index b32e10e..404dd88 100644
--- a/engines/titanic/pet_control/pet_pannel2.h
+++ b/engines/titanic/pet_control/pet_pannel2.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/pet_control/pet_pannel3.cpp b/engines/titanic/pet_control/pet_pannel3.cpp
index a0b6938..a2a1fbe 100644
--- a/engines/titanic/pet_control/pet_pannel3.cpp
+++ b/engines/titanic/pet_control/pet_pannel3.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CPetPannel3, CPetGraphic)
 
-void CPetPannel3::save(SimpleFile *file, int indent) const {
+void CPetPannel3::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CPetGraphic::save(file, indent);
 }
diff --git a/engines/titanic/pet_control/pet_pannel3.h b/engines/titanic/pet_control/pet_pannel3.h
index f80456f..addf614 100644
--- a/engines/titanic/pet_control/pet_pannel3.h
+++ b/engines/titanic/pet_control/pet_pannel3.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/pet_control/pet_real_life.h b/engines/titanic/pet_control/pet_real_life.h
index d049d47..a4ae67f 100644
--- a/engines/titanic/pet_control/pet_real_life.h
+++ b/engines/titanic/pet_control/pet_real_life.h
@@ -109,7 +109,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const {}
+	virtual void save(SimpleFile *file, int indent) {}
 
 	/**
 	 * Called when a section is switched to
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index fb7cb2b..2d73113 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -148,7 +148,7 @@ void CPetRooms::postLoad() {
 	reset();
 }
 
-void CPetRooms::save(SimpleFile *file, int indent) const {
+void CPetRooms::save(SimpleFile *file, int indent) {
 	_glyphs.saveGlyphs(file, indent);
 	_glyphItem.saveGlyph(file, indent);
 	file->writeNumberLine(_floorNum, indent);
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index 64fd016..b82b42c 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -125,7 +125,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Called when a section is switched to
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index 864ae2e..5de814a 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -166,7 +166,7 @@ void CPetRoomsGlyph::getTooltip(CPetText *text) {
 	text->setText(roomStr);
 }
 
-void CPetRoomsGlyph::saveGlyph(SimpleFile *file, int indent) const {
+void CPetRoomsGlyph::saveGlyph(SimpleFile *file, int indent) {
 	file->writeNumberLine(_roomFlags, indent);
 	file->writeNumberLine(_mode, indent);
 }
@@ -227,7 +227,7 @@ void CPetRoomsGlyph::drawObjects(uint flags, const Point &pt, CScreenManager *sc
 
 /*------------------------------------------------------------------------*/
 
-void CPetRoomsGlyphs::saveGlyphs(SimpleFile *file, int indent) const {
+void CPetRoomsGlyphs::saveGlyphs(SimpleFile *file, int indent) {
 	file->writeNumberLine(size(), indent);
 
 	for (const_iterator i = begin(); i != end(); ++i)
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.h b/engines/titanic/pet_control/pet_rooms_glyphs.h
index f0c2ce0..5d0fec8 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.h
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.h
@@ -93,7 +93,7 @@ public:
 	/**
 	 * Saves the data for the glyph
 	 */
-	virtual void saveGlyph(SimpleFile *file, int indent) const;
+	virtual void saveGlyph(SimpleFile *file, int indent);
 	
 	virtual bool proc33(CPetGlyph *glyph);
 
@@ -143,7 +143,7 @@ public:
 	/**
 	 * Save the list
 	 */
-	void saveGlyphs(SimpleFile *file, int indent) const;
+	void saveGlyphs(SimpleFile *file, int indent);
 
 	/**
 	 * Returns the glyph for hte player's assigned room
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 3673d4d..4047ab0 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -142,7 +142,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const {}
+	virtual void save(SimpleFile *file, int indent) {}
 
 	/**
 	 * Called when a section is switched to
diff --git a/engines/titanic/pet_control/pet_starfield.cpp b/engines/titanic/pet_control/pet_starfield.cpp
index cde512c..35ef943 100644
--- a/engines/titanic/pet_control/pet_starfield.cpp
+++ b/engines/titanic/pet_control/pet_starfield.cpp
@@ -132,7 +132,7 @@ void CPetStarfield::postLoad() {
 	reset();
 }
 
-void CPetStarfield::save(SimpleFile *file, int indent) const {
+void CPetStarfield::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(_photoOn, indent);
 	file->writeNumberLine(_hasReference, indent);
 }
diff --git a/engines/titanic/pet_control/pet_starfield.h b/engines/titanic/pet_control/pet_starfield.h
index ec659cc..9550e0a 100644
--- a/engines/titanic/pet_control/pet_starfield.h
+++ b/engines/titanic/pet_control/pet_starfield.h
@@ -102,7 +102,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Sets the offsets for each of the buttons
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index fa7441c..983d35e 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -108,7 +108,7 @@ void CPetText::load(SimpleFile *file, int param) {
 	}
 }
 
-void CPetText::save(SimpleFile *file, int indent) const {
+void CPetText::save(SimpleFile *file, int indent) {
 	int numLines = _lineCount + 1;
 
 	file->writeNumberLine(_array.size(), indent);
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index 2a6e24d..f5d4235 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -108,7 +108,7 @@ public:
 	/**
 	 * Save the data for the control
 	 */
-	void save(SimpleFile *file, int indent) const;
+	void save(SimpleFile *file, int indent);
 
 	/**
 	 * Set the bounds for the control
diff --git a/engines/titanic/sound/auto_music_player.cpp b/engines/titanic/sound/auto_music_player.cpp
index 309c57b..9648143 100644
--- a/engines/titanic/sound/auto_music_player.cpp
+++ b/engines/titanic/sound/auto_music_player.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CAutoMusicPlayer::CAutoMusicPlayer() : CAutoMusicPlayerBase() {
 }
 
-void CAutoMusicPlayer::save(SimpleFile *file, int indent) const {
+void CAutoMusicPlayer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string2, indent);
 
diff --git a/engines/titanic/sound/auto_music_player.h b/engines/titanic/sound/auto_music_player.h
index 063778c..5d9bb0f 100644
--- a/engines/titanic/sound/auto_music_player.h
+++ b/engines/titanic/sound/auto_music_player.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/auto_music_player_base.cpp b/engines/titanic/sound/auto_music_player_base.cpp
index 116fcf7..c8b9adc 100644
--- a/engines/titanic/sound/auto_music_player_base.cpp
+++ b/engines/titanic/sound/auto_music_player_base.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CAutoMusicPlayerBase::CAutoMusicPlayerBase() : CGameObject(),
 	_fieldC8(1), _fieldCC(0), _fieldD0(-1), _fieldD4(1) {
 }
-void CAutoMusicPlayerBase::save(SimpleFile *file, int indent) const {
+void CAutoMusicPlayerBase::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string1, indent);
 	file->writeNumberLine(_fieldC8, indent);
diff --git a/engines/titanic/sound/auto_music_player_base.h b/engines/titanic/sound/auto_music_player_base.h
index e762ef4..d6d9926 100644
--- a/engines/titanic/sound/auto_music_player_base.h
+++ b/engines/titanic/sound/auto_music_player_base.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/auto_sound_player.cpp b/engines/titanic/sound/auto_sound_player.cpp
index 7b20f65..3e3d529 100644
--- a/engines/titanic/sound/auto_sound_player.cpp
+++ b/engines/titanic/sound/auto_sound_player.cpp
@@ -29,7 +29,7 @@ CAutoSoundPlayer::CAutoSoundPlayer() : CGameObject(),
 	_fieldDC(0), _fieldE0(-1), _fieldE4(0), _fieldE8(0) {
 }
 
-void CAutoSoundPlayer::save(SimpleFile *file, int indent) const {
+void CAutoSoundPlayer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeQuotedLine(_string1, indent);
diff --git a/engines/titanic/sound/auto_sound_player.h b/engines/titanic/sound/auto_sound_player.h
index 15f1325..b85bb68 100644
--- a/engines/titanic/sound/auto_sound_player.h
+++ b/engines/titanic/sound/auto_sound_player.h
@@ -46,7 +46,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/auto_sound_player_adsr.cpp b/engines/titanic/sound/auto_sound_player_adsr.cpp
index 815c1cd..4bfd557 100644
--- a/engines/titanic/sound/auto_sound_player_adsr.cpp
+++ b/engines/titanic/sound/auto_sound_player_adsr.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CAutoSoundPlayerADSR::save(SimpleFile *file, int indent) const {
+void CAutoSoundPlayerADSR::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string2, indent);
 	file->writeQuotedLine(_string3, indent);
diff --git a/engines/titanic/sound/auto_sound_player_adsr.h b/engines/titanic/sound/auto_sound_player_adsr.h
index c88a861..9dd9ec5 100644
--- a/engines/titanic/sound/auto_sound_player_adsr.h
+++ b/engines/titanic/sound/auto_sound_player_adsr.h
@@ -38,7 +38,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/background_sound_maker.cpp b/engines/titanic/sound/background_sound_maker.cpp
index 111e641..0abab89 100644
--- a/engines/titanic/sound/background_sound_maker.cpp
+++ b/engines/titanic/sound/background_sound_maker.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBackgroundSoundMaker::save(SimpleFile *file, int indent) const {
+void CBackgroundSoundMaker::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/sound/background_sound_maker.h b/engines/titanic/sound/background_sound_maker.h
index 68c1d7d..32fb50b 100644
--- a/engines/titanic/sound/background_sound_maker.h
+++ b/engines/titanic/sound/background_sound_maker.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/bird_song.cpp b/engines/titanic/sound/bird_song.cpp
index f003a4f..7f7d0ad 100644
--- a/engines/titanic/sound/bird_song.cpp
+++ b/engines/titanic/sound/bird_song.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CBirdSong::save(SimpleFile *file, int indent) const {
+void CBirdSong::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CRoomAutoSoundPlayer::save(file, indent);
diff --git a/engines/titanic/sound/bird_song.h b/engines/titanic/sound/bird_song.h
index d932cfd..1b1e309 100644
--- a/engines/titanic/sound/bird_song.h
+++ b/engines/titanic/sound/bird_song.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/dome_from_top_of_well.cpp b/engines/titanic/sound/dome_from_top_of_well.cpp
index f8d946a..778f016 100644
--- a/engines/titanic/sound/dome_from_top_of_well.cpp
+++ b/engines/titanic/sound/dome_from_top_of_well.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
 
 EMPTY_MESSAGE_MAP(CDomeFromTopOfWell, CViewAutoSoundPlayer)
 
-void CDomeFromTopOfWell::save(SimpleFile *file, int indent) const {
+void CDomeFromTopOfWell::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CViewAutoSoundPlayer::save(file, indent);
 }
diff --git a/engines/titanic/sound/dome_from_top_of_well.h b/engines/titanic/sound/dome_from_top_of_well.h
index 24c1650..62c97da 100644
--- a/engines/titanic/sound/dome_from_top_of_well.h
+++ b/engines/titanic/sound/dome_from_top_of_well.h
@@ -35,7 +35,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/enter_view_toggles_other_music.cpp b/engines/titanic/sound/enter_view_toggles_other_music.cpp
index fbf5b4a..0b14999 100644
--- a/engines/titanic/sound/enter_view_toggles_other_music.cpp
+++ b/engines/titanic/sound/enter_view_toggles_other_music.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
 CEnterViewTogglesOtherMusic::CEnterViewTogglesOtherMusic() : CTriggerAutoMusicPlayer(), _fieldC8(0) {
 }
 
-void CEnterViewTogglesOtherMusic::save(SimpleFile *file, int indent) const {
+void CEnterViewTogglesOtherMusic::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldC8, indent);
 
diff --git a/engines/titanic/sound/enter_view_toggles_other_music.h b/engines/titanic/sound/enter_view_toggles_other_music.h
index 991a6ad..adcf3df 100644
--- a/engines/titanic/sound/enter_view_toggles_other_music.h
+++ b/engines/titanic/sound/enter_view_toggles_other_music.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/gondolier_song.cpp b/engines/titanic/sound/gondolier_song.cpp
index 52b7ae0..b44400b 100644
--- a/engines/titanic/sound/gondolier_song.cpp
+++ b/engines/titanic/sound/gondolier_song.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CGondolierSong::save(SimpleFile *file, int indent) const {
+void CGondolierSong::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_value, indent);
 	CRoomAutoSoundPlayer::save(file, indent);
diff --git a/engines/titanic/sound/gondolier_song.h b/engines/titanic/sound/gondolier_song.h
index 6377279..710cd96 100644
--- a/engines/titanic/sound/gondolier_song.h
+++ b/engines/titanic/sound/gondolier_song.h
@@ -37,7 +37,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/music_player.cpp b/engines/titanic/sound/music_player.cpp
index 193527b..fb48ae8 100644
--- a/engines/titanic/sound/music_player.cpp
+++ b/engines/titanic/sound/music_player.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CMusicPlayer::save(SimpleFile *file, int indent) const {
+void CMusicPlayer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldBC, indent);
 	file->writeQuotedLine(_string1, indent);
diff --git a/engines/titanic/sound/music_player.h b/engines/titanic/sound/music_player.h
index 1b928fa..fa877ec 100644
--- a/engines/titanic/sound/music_player.h
+++ b/engines/titanic/sound/music_player.h
@@ -43,7 +43,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/node_auto_sound_player.cpp b/engines/titanic/sound/node_auto_sound_player.cpp
index ee403ba..f74c891 100644
--- a/engines/titanic/sound/node_auto_sound_player.cpp
+++ b/engines/titanic/sound/node_auto_sound_player.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CNodeAutoSoundPlayer::save(SimpleFile *file, int indent) const {
+void CNodeAutoSoundPlayer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldEC, indent);
 	CAutoSoundPlayer::save(file, indent);
diff --git a/engines/titanic/sound/node_auto_sound_player.h b/engines/titanic/sound/node_auto_sound_player.h
index 2f961dd..06322f8 100644
--- a/engines/titanic/sound/node_auto_sound_player.h
+++ b/engines/titanic/sound/node_auto_sound_player.h
@@ -39,7 +39,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/restricted_auto_music_player.cpp b/engines/titanic/sound/restricted_auto_music_player.cpp
index cd1b193..4ccfecc 100644
--- a/engines/titanic/sound/restricted_auto_music_player.cpp
+++ b/engines/titanic/sound/restricted_auto_music_player.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CRestrictedAutoMusicPlayer::save(SimpleFile *file, int indent) const {
+void CRestrictedAutoMusicPlayer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeQuotedLine(_string3, indent);
 	file->writeQuotedLine(_string4, indent);
diff --git a/engines/titanic/sound/restricted_auto_music_player.h b/engines/titanic/sound/restricted_auto_music_player.h
index b288296..be40bd8 100644
--- a/engines/titanic/sound/restricted_auto_music_player.h
+++ b/engines/titanic/sound/restricted_auto_music_player.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/room_auto_sound_player.cpp b/engines/titanic/sound/room_auto_sound_player.cpp
index 4393d41..da98d41 100644
--- a/engines/titanic/sound/room_auto_sound_player.cpp
+++ b/engines/titanic/sound/room_auto_sound_player.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CRoomAutoSoundPlayer::save(SimpleFile *file, int indent) const {
+void CRoomAutoSoundPlayer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CAutoSoundPlayer::save(file, indent);
 }
diff --git a/engines/titanic/sound/room_auto_sound_player.h b/engines/titanic/sound/room_auto_sound_player.h
index c17d983..8b5fc86 100644
--- a/engines/titanic/sound/room_auto_sound_player.h
+++ b/engines/titanic/sound/room_auto_sound_player.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/room_trigger_auto_music_player.cpp b/engines/titanic/sound/room_trigger_auto_music_player.cpp
index 8c20097..4506dfd 100644
--- a/engines/titanic/sound/room_trigger_auto_music_player.cpp
+++ b/engines/titanic/sound/room_trigger_auto_music_player.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-void CRoomTriggerAutoMusicPlayer::save(SimpleFile *file, int indent) const {
+void CRoomTriggerAutoMusicPlayer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	CTriggerAutoMusicPlayer::save(file, indent);
 }
diff --git a/engines/titanic/sound/room_trigger_auto_music_player.h b/engines/titanic/sound/room_trigger_auto_music_player.h
index 26823ce..da378a3 100644
--- a/engines/titanic/sound/room_trigger_auto_music_player.h
+++ b/engines/titanic/sound/room_trigger_auto_music_player.h
@@ -36,7 +36,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/season_noises.cpp b/engines/titanic/sound/season_noises.cpp
index beacdef..e730765 100644
--- a/engines/titanic/sound/season_noises.cpp
+++ b/engines/titanic/sound/season_noises.cpp
@@ -28,7 +28,7 @@ CSeasonNoises::CSeasonNoises() : CViewAutoSoundPlayer(), _fieldF0(0),
 	_string2("NULL"), _string3("NULL"), _string4("NULL"), _string5("NULL") {
 }
 
-void CSeasonNoises::save(SimpleFile *file, int indent) const {
+void CSeasonNoises::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldF0, indent);
 	file->writeQuotedLine(_string2, indent);
diff --git a/engines/titanic/sound/season_noises.h b/engines/titanic/sound/season_noises.h
index 7746c16..6d65de8 100644
--- a/engines/titanic/sound/season_noises.h
+++ b/engines/titanic/sound/season_noises.h
@@ -41,7 +41,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/seasonal_music_player.cpp b/engines/titanic/sound/seasonal_music_player.cpp
index c4a8f02..8ac6eb6 100644
--- a/engines/titanic/sound/seasonal_music_player.cpp
+++ b/engines/titanic/sound/seasonal_music_player.cpp
@@ -35,7 +35,7 @@ CSeasonalMusicPlayer::CSeasonalMusicPlayer() : CAutoMusicPlayerBase() {
 	_fieldF4 = -4;
 }
 
-void CSeasonalMusicPlayer::save(SimpleFile *file, int indent) const {
+void CSeasonalMusicPlayer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
 	file->writeNumberLine(_fieldD8, indent);
 	file->writeNumberLine(_fieldDC, indent);
diff --git a/engines/titanic/sound/seasonal_music_player.h b/engines/titanic/sound/seasonal_music_player.h
index da19e1f..3c434ec 100644
--- a/engines/titanic/sound/seasonal_music_player.h
+++ b/engines/titanic/sound/seasonal_music_player.h
@@ -44,7 +44,7 @@ public:
 	/**
 	 * Save the data for the class to file
 	 */
-	virtual void save(SimpleFile *file, int indent) const;
+	virtual void save(SimpleFile *file, int indent);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/sound/titania_speech.cpp b/engines/titanic/sound/titania_speech.cpp


Commit: 8ea5d533294193a4d220316152cec59580bbf10c
    https://github.com/scummvm/scummvm/commit/8ea5d533294193a4d220316152cec59580bbf10c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:26:02-04:00

Commit Message:
TITANIC: Added CGameObject saving, and movie range info methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/core/tree_item.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/movie_clip.cpp
    engines/titanic/support/movie_range_info.cpp
    engines/titanic/support/movie_range_info.h
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 29ad735..a5657f5 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -82,7 +82,49 @@ CGameObject::~CGameObject() {
 
 void CGameObject::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(7, indent);
-	error("TODO: CGameObject::save");
+	_movieRangeInfoList.destroyContents();
+
+	if (_surface) {
+		Common::List<CMovieRangeInfo *> rangeList = _surface->getMovieRangeInfo();
+		
+		for (Common::List<CMovieRangeInfo *>::const_iterator i = rangeList.begin();
+				i != rangeList.end(); ++i) {
+			CMovieRangeInfo *rangeInfo = new CMovieRangeInfo(*i);
+			rangeInfo->_frameNumber = (i == rangeList.begin()) ? getMovieFrame() : -1;
+		}
+	}
+
+	_movieRangeInfoList.save(file, indent);
+	_movieRangeInfoList.destroyContents();
+
+	file->writeNumberLine(getMovieFrame(), indent + 1);
+	file->writeNumberLine(_cursorId, indent + 1);
+	_movieClips.save(file, indent + 1);
+	file->writeNumberLine(_field60, indent + 1);
+	file->writeNumberLine(_field40, indent + 1);
+	file->writeQuotedLine(_resource, indent + 1);
+	file->writeBounds(_bounds, indent + 1);
+	
+	file->writeFloatLine(_field34, indent + 1);
+	file->writeFloatLine(_field38, indent + 1);
+	file->writeFloatLine(_field3C, indent + 1);
+
+	file->writeNumberLine(_field44, indent + 1);
+	file->writeNumberLine(_field48, indent + 1);
+	file->writeNumberLine(_field4C, indent + 1);
+	file->writeNumberLine(_fieldB8, indent + 1);
+	file->writeNumberLine(_visible, indent + 1);
+	file->writeNumberLine(_isMail, indent + 1);
+	file->writeNumberLine(_id, indent + 1);
+	file->writeNumberLine(_roomFlags, indent + 1);
+
+	if (_surface) {
+		_surface->_resourceKey.save(file, indent);
+	} else {
+		CResourceKey resourceKey;
+		resourceKey.save(file, indent);
+	}
+	file->writeNumberLine(_surface != nullptr, indent);
 
 	CNamedItem::save(file, indent);
 }
@@ -93,7 +135,7 @@ void CGameObject::load(SimpleFile *file) {
 
 	switch (val) {
 	case 7:
-		_movieRangeInfo.load(file);
+		_movieRangeInfoList.load(file);
 		_frameNumber = file->readNumber();
 		// Deliberate fall-through
 
@@ -179,7 +221,7 @@ void CGameObject::draw(CScreenManager *screenManager) {
 				_frameNumber = -1;
 			}
 
-			if (!_movieRangeInfo.empty())
+			if (!_movieRangeInfoList.empty())
 				processMoveRangeInfo();
 
 			if (_bounds.intersects(getGameManager()->_bounds)) {
@@ -377,10 +419,10 @@ void CGameObject::playMovie(int v1, int v2) {
 }
 
 void CGameObject::processMoveRangeInfo() {
-	for (CMovieRangeInfoList::iterator i = _movieRangeInfo.begin(); i != _movieRangeInfo.end(); ++i)
+	for (CMovieRangeInfoList::iterator i = _movieRangeInfoList.begin(); i != _movieRangeInfoList.end(); ++i)
 		(*i)->process(this);
 
-	_movieRangeInfo.destroyContents();
+	_movieRangeInfoList.destroyContents();
 }
 
 void CGameObject::makeDirty(const Rect &r) {
@@ -1071,12 +1113,12 @@ bool CGameObject::clipExistsByEnd(const CString &name, int endFrame) const {
 	return _movieClips.existsByEnd(name, endFrame);
 }
 
-void CGameObject::checkPlayMovie(const CString &name, int flags) {
+void CGameObject::checkPlayMovie(int fieldC, int field10, int frameNumber, int flags) {
 	if (!_surface && !_resource.empty())
 		loadResource(_resource);
 
 	if (_surface ) {
-		_surface->proc35(name, flags, (flags & CLIPFLAG_4) ? this : nullptr);
+		_surface->proc35(fieldC, field10, frameNumber, flags, (flags & CLIPFLAG_4) ? this : nullptr);
 		if (flags & CLIPFLAG_PLAY)
 			getGameManager()->_gameState.addMovie(_surface->_movie);
 	}
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 1afe834..8c53e15 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -90,7 +90,7 @@ protected:
 	int _field4C;
 	CMovieClipList _movieClips;
 	int _initialFrame;
-	CMovieRangeInfoList _movieRangeInfo;
+	CMovieRangeInfoList _movieRangeInfoList;
 	int _frameNumber;
 	CPetText *_text;
 	uint _textBorder;
@@ -533,7 +533,7 @@ public:
 	/**
 	 * Returns the clip list, if any, associated with the item
 	 */
-	virtual const CMovieClipList *getClipList() const { return &_movieClips; }
+	virtual const CMovieClipList *getMovieClips() const { return &_movieClips; }
 
 	/**
 	 * Allows the item to draw itself
@@ -594,7 +594,7 @@ public:
 	/**
 	 * Checks and plays a pending clip
 	 */
-	void checkPlayMovie(const CString &name, int flags);
+	void checkPlayMovie(int fieldC, int field10, int frameNumber, int flags);
 
 	/**
 	 * Returns true if the object has a currently active movie
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index a15a5ae..49a3fa7 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -134,7 +134,7 @@ public:
 	/**
 	 * Returns the clip list, if any, associated with the item
 	 */
-	virtual const CMovieClipList *getClipList() const { return nullptr; }
+	virtual const CMovieClipList *getMovieClips() const { return nullptr; }
 
 	/**
 	 * Returns true if the given item connects to another specified view
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 27bcb97..361bf6e 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -99,7 +99,7 @@ void OSMovie::proc11() {
 	warning("TODO: OSMovie::proc11");
 }
 
-void OSMovie::proc12(const CString &name, int flags, CGameObject *obj) {
+void OSMovie::proc12(int v1, int v2, int frameNumber, int flags, CGameObject *obj) {
 	warning("TODO: OSMovie::proc12");
 }
 
@@ -121,8 +121,9 @@ void OSMovie::proc16() {
 	warning("TODO: OSMovie::proc16");
 }
 
-void OSMovie::proc17() {
-	warning("TODO: OSMovie::proc17");
+const Common::List<CMovieRangeInfo *> OSMovie::getMovieRangeInfo() const {
+	warning("TODO: OSMovie::getMovieRangeInfo");
+	return Common::List<CMovieRangeInfo *>();
 }
 
 void OSMovie::proc18() {
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index da32855..2d7bdc9 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -23,9 +23,11 @@
 #ifndef TITANIC_MOVIE_H
 #define TITANIC_MOVIE_H
 
+#include "common/list.h"
 #include "video/video_decoder.h"
 #include "titanic/core/list.h"
 #include "titanic/core/resource_key.h"
+#include "titanic/support/movie_range_info.h"
 
 namespace Titanic {
 
@@ -72,7 +74,7 @@ public:
 	virtual void playClip(const Rect &rect, uint startFrame, uint endFrame) = 0;
 	
 	virtual void proc11() = 0;
-	virtual void proc12(const CString &name, int flags, CGameObject *obj) = 0;
+	virtual void proc12(int v1, int v2, int frameNumber, int flags, CGameObject *obj) = 0;
 
 	/**
 	 * Stops the movie
@@ -82,7 +84,12 @@ public:
 	virtual void proc14() = 0;
 	virtual void setFrame(uint frameNumber) = 0;
 	virtual void proc16() = 0;
-	virtual void proc17() = 0;
+	
+	/**
+	 * Return any movie range info associated with the movie
+	 */
+	virtual const Common::List<CMovieRangeInfo *> getMovieRangeInfo() const = 0;
+
 	virtual void proc18() = 0;
 
 	/**
@@ -139,7 +146,7 @@ public:
 	virtual void playClip(const Rect &rect, uint startFrame, uint endFrame);
 
 	virtual void proc11();
-	virtual void proc12(const CString &name, int flags, CGameObject *obj);
+	virtual void proc12(int v1, int v2, int frameNumber, int flags, CGameObject *obj);
 
 	/**
 	 * Stops the movie
@@ -154,7 +161,12 @@ public:
 	virtual void setFrame(uint frameNumber);
 	
 	virtual void proc16();
-	virtual void proc17();
+
+	/**
+	 * Return any movie range info associated with the movie
+	 */
+	virtual const Common::List<CMovieRangeInfo *> getMovieRangeInfo() const;
+
 	virtual void proc18();
 
 	/**
diff --git a/engines/titanic/support/movie_clip.cpp b/engines/titanic/support/movie_clip.cpp
index 2d3187b..1f2ef66 100644
--- a/engines/titanic/support/movie_clip.cpp
+++ b/engines/titanic/support/movie_clip.cpp
@@ -65,6 +65,8 @@ void CMovieClip::load(SimpleFile *file) {
 	ListItem::load(file);
 }
 
+/*------------------------------------------------------------------------*/
+
 CMovieClip *CMovieClipList::findByName(const Common::String &name) const {
 	for (const_iterator i = begin(); i != end(); ++i) {
 		CMovieClip *clip = *i;
diff --git a/engines/titanic/support/movie_range_info.cpp b/engines/titanic/support/movie_range_info.cpp
index d48bab1..e6b28ce 100644
--- a/engines/titanic/support/movie_range_info.cpp
+++ b/engines/titanic/support/movie_range_info.cpp
@@ -34,7 +34,9 @@ CMovieRangeInfo::~CMovieRangeInfo() {
 }
 
 CMovieRangeInfo::CMovieRangeInfo(const CMovieRangeInfo *src) : ListItem() {
-	_movieName = src->_movieName;
+	_fieldC = src->_fieldC;
+	_field10 = src->_field10;
+	_frameNumber = src->_frameNumber;
 	_startFrame = src->_startFrame;
 	_endFrame = src->_endFrame;
 
@@ -47,7 +49,9 @@ CMovieRangeInfo::CMovieRangeInfo(const CMovieRangeInfo *src) : ListItem() {
 
 void CMovieRangeInfo::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
-	file->writeQuotedLine(_movieName, indent + 1);
+	file->writeNumberLine(_fieldC, indent + 1);
+	file->writeNumberLine(_field10, indent + 1);
+	file->writeNumberLine(_frameNumber, indent + 1);
 	file->writeNumberLine(_endFrame, indent + 1);
 	file->writeNumberLine(_startFrame, indent + 1);
 	_events.save(file, indent + 1);
@@ -56,7 +60,9 @@ void CMovieRangeInfo::save(SimpleFile *file, int indent) {
 void CMovieRangeInfo::load(SimpleFile *file) {
 	int val = file->readNumber();
 	if (!val) {
-		_movieName = file->readString();
+		_fieldC = file->readNumber();
+		_field10 = file->readNumber();
+		_frameNumber = file->readNumber();
 		_endFrame = file->readNumber();
 		_startFrame = file->readNumber();
 		_events.load(file);
@@ -94,7 +100,7 @@ void CMovieRangeInfo::process(CGameObject *owner) {
 		}
 	}
 
-	owner->checkPlayMovie(_movieName, flags);
+	owner->checkPlayMovie(_fieldC, _field10, _frameNumber, flags);
 
 	for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) {
 		CMovieEvent *movieEvent = *i;
diff --git a/engines/titanic/support/movie_range_info.h b/engines/titanic/support/movie_range_info.h
index 2776ac2..be04975 100644
--- a/engines/titanic/support/movie_range_info.h
+++ b/engines/titanic/support/movie_range_info.h
@@ -34,7 +34,9 @@ class CGameObject;
 
 class CMovieRangeInfo : public ListItem {
 public:
-	CString _movieName;
+	int _fieldC;
+	int _field10;
+	int _frameNumber;
 	uint _startFrame;
 	uint _endFrame;
 	CMovieEventList _events;
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index c1af869..9293b03 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -402,9 +402,9 @@ void OSVideoSurface::playMovie(uint startFrame, uint endFrame, int v3, bool v4)
 	}
 }
 
-void OSVideoSurface::proc35(const CString &name, int flags, CGameObject *owner) {
+void OSVideoSurface::proc35(int v1, int v2, int frameNumber, int flags, CGameObject *owner) {
 	if (loadIfReady() && _movie) {
-		_movie->proc12(name, flags, owner);
+		_movie->proc12(v1, v2, frameNumber, flags, owner);
 	}
 }
 
@@ -426,6 +426,10 @@ void OSVideoSurface::proc39(int v1, int v2) {
 	warning("OSVideoSurface::proc39");
 }
 
+const Common::List<CMovieRangeInfo *> OSVideoSurface::getMovieRangeInfo() const {
+	return _movie ? _movie->getMovieRangeInfo() : Common::List<CMovieRangeInfo *>();
+}
+
 bool OSVideoSurface::loadIfReady() {
 	_videoSurfaceNum = _videoSurfaceCounter;
 
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 2b66b26..e5d904f 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -28,6 +28,7 @@
 #include "titanic/support/font.h"
 #include "titanic/support/direct_draw.h"
 #include "titanic/support/movie.h"
+#include "titanic/support/movie_range_info.h"
 #include "titanic/support/rect.h"
 #include "titanic/core/list.h"
 #include "titanic/core/resource_key.h"
@@ -166,7 +167,7 @@ public:
 	 */
 	virtual void playMovie(uint startFrame, uint endFrame, int v3, bool v4) = 0;
 
-	virtual void proc35(const CString &name, int flags, CGameObject *owner) = 0;
+	virtual void proc35(int v1, int v2, int frameNumber, int flags, CGameObject *owner) = 0;
 
 	/**
 	 * Stops any movie currently attached to the surface
@@ -183,6 +184,11 @@ public:
 	virtual void proc39(int v1, int v2) = 0;
 
 	/**
+	 * Return any movie range info associated with the surface's movie
+	 */
+	virtual const Common::List<CMovieRangeInfo *> getMovieRangeInfo() const = 0;
+
+	/**
 	 * Loads the surface's resource if there's one pending
 	 */
 	virtual bool loadIfReady() = 0;
@@ -335,7 +341,7 @@ public:
 	 */
 	virtual void playMovie(uint startFrame, uint endFrame, int v3, bool v4);
 
-	virtual void proc35(const CString &name, int flags, CGameObject *owner);
+	virtual void proc35(int v1, int v2, int frameNumber, int flags, CGameObject *owner);
 
 	/**
 	 * Stops any movie currently attached to the surface
@@ -352,6 +358,11 @@ public:
 	virtual void proc39(int v1, int v2);
 
 	/**
+	 * Return any movie range info associated with the surface's movie
+	 */
+	virtual const Common::List<CMovieRangeInfo *> getMovieRangeInfo() const;
+
+	/**
 	 * Loads the surface's resource if there's one pending
 	 */
 	virtual bool loadIfReady();


Commit: d436ce5dae8ab9d4c7dbe4c6d069f7202309f297
    https://github.com/scummvm/scummvm/commit/d436ce5dae8ab9d4c7dbe4c6d069f7202309f297
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:26:05-04:00

Commit Message:
TITANIC: Beginning of work on star control hierarchy

Changed paths:
    engines/titanic/star_control/star_control_sub12.h
    engines/titanic/star_control/star_control_sub6.cpp
    engines/titanic/star_control/star_control_sub6.h



diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index 3637e13..bce668f 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -41,7 +41,6 @@ private:
 	int _field2C;
 	CStarControlSub13 _sub13;
 	int _field108;
-	int _field21C;
 public:
 	CStarControlSub12(void *val1, void *val2);
 	virtual ~CStarControlSub12() {}
diff --git a/engines/titanic/star_control/star_control_sub6.cpp b/engines/titanic/star_control/star_control_sub6.cpp
index 48285a7..79937b7 100644
--- a/engines/titanic/star_control/star_control_sub6.cpp
+++ b/engines/titanic/star_control/star_control_sub6.cpp
@@ -24,10 +24,23 @@
 
 namespace Titanic {
 
-CStarControlSub6::CStarControlSub6() :
-	_field0(0x3F800000), _field4(0), _field8(0), _fieldC(0),
-	_field10(0x3F800000), _field14(0), _field18(0), _field1C(0),
-	_field20(0x3F800000), _field24(0), _field28(0), _field2C(0) {
+CStarControlSub6::CStarControlSub6() {
+	clear();
+}
+
+void CStarControlSub6::clear() {
+	_field0 = 0x3F800000;
+	_field4 = 0;
+	_field8 = 0;
+	_fieldC = 0),
+	_field10 = 0x3F800000;
+	_field14 = 0;
+	_field18 = 0;
+	_field1C = 0),
+	_field20 = 0x3F800000;
+	_field24 = 0;
+	_field28 = 0;
+	_field2C = 0;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub6.h b/engines/titanic/star_control/star_control_sub6.h
index d57b35c..3531c76 100644
--- a/engines/titanic/star_control/star_control_sub6.h
+++ b/engines/titanic/star_control/star_control_sub6.h
@@ -41,6 +41,8 @@ private:
 	int _field2C;
 public:
 	CStarControlSub6();
+
+	void clear();
 };
 
 } // End of namespace Titanic


Commit: eebb42be89b3fe520bb4d175a0c0fac3c3291841
    https://github.com/scummvm/scummvm/commit/eebb42be89b3fe520bb4d175a0c0fac3c3291841
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:26:08-04:00

Commit Message:
TITANIC: Work on CBaseStar and CStarControlSub4 classes

Changed paths:
  A engines/titanic/star_control/base_star.cpp
  A engines/titanic/star_control/base_star.h
  R engines/titanic/star_control/star_control_sub3.cpp
  R engines/titanic/star_control/star_control_sub3.h
    engines/titanic/module.mk
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control.h
    engines/titanic/star_control/star_control_sub2.cpp
    engines/titanic/star_control/star_control_sub2.h
    engines/titanic/star_control/star_control_sub4.cpp
    engines/titanic/star_control/star_control_sub4.h
    engines/titanic/star_control/star_control_sub6.cpp
    engines/titanic/star_control/star_control_sub7.cpp
    engines/titanic/star_control/star_control_sub7.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 3c752bf..7138f57 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -419,7 +419,7 @@ MODULE_OBJS := \
 	star_control/star_control.o \
 	star_control/star_control_sub1.o \
 	star_control/star_control_sub2.o \
-	star_control/star_control_sub3.o \
+	star_control/base_star.o \
 	star_control/star_control_sub4.o \
 	star_control/star_control_sub5.o \
 	star_control/star_control_sub6.o \
diff --git a/engines/titanic/star_control/base_star.cpp b/engines/titanic/star_control/base_star.cpp
new file mode 100644
index 0000000..c8f55a7
--- /dev/null
+++ b/engines/titanic/star_control/base_star.cpp
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/base_star.h"
+
+namespace Titanic {
+
+CBaseStar::CBaseStar() : _fieldC(1), _minVal(0.0), _maxVal(1.0), _range(0.0) {
+}
+
+void CBaseStar::proc2(int v1, int v2, int v3) {
+	error("TODO");
+}
+
+void CBaseStar::clear() {
+	if (!_data.empty()) {
+		if (_fieldC)
+			_data.clear();
+	}
+}
+
+void CBaseStar::initialize() {
+	_minVal = 9.9999998e10;
+	_maxVal = -9.9999998e10;
+	_sub4.initialize();
+
+	for (uint idx = 0; idx < _data.size(); ++idx) {
+		const CBaseStarEntry *entry = getDataPtr(idx);
+		_sub4.checkEntry(entry->_val);
+
+		if (entry->_value < _minVal)
+			_minVal = entry->_value;
+		if (entry->_value > _maxVal)
+			_maxVal = entry->_value;
+	}
+
+	_range = (_maxVal - _minVal) / 1.0;
+}
+
+CBaseStarEntry *CBaseStar::getDataPtr(int index) {
+	return (index >= 0 && index < (int)_data.size()) ? &_data[index] : nullptr;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/base_star.h b/engines/titanic/star_control/base_star.h
new file mode 100644
index 0000000..20dbace
--- /dev/null
+++ b/engines/titanic/star_control/base_star.h
@@ -0,0 +1,81 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB3_H
+#define TITANIC_STAR_CONTROL_SUB3_H
+
+#include "titanic/support/simple_file.h"
+#include "titanic/star_control/star_control_sub4.h"
+
+namespace Titanic {
+
+struct CBaseStarEntry {
+	int _field0;
+	double _value;
+	CBaseStarVal _val;
+};
+
+class CBaseStar {
+protected:
+	Common::Array<CBaseStarEntry> _data;
+	int _fieldC;
+	CStarControlSub4 _sub4;
+	double _minVal;
+	double _maxVal;
+	double _range;
+public:
+	CBaseStar();
+	virtual ~CBaseStar() {}
+
+	virtual void proc2(int v1, int v2, int v3);
+	virtual bool loadYale(int v1) { return true; }
+	virtual bool proc4(int v1, int v2, int v3, int v4, int v5) { return false; }
+	virtual bool proc5(int v1) { return false; }
+	virtual bool loadStar() { return false; }
+	virtual bool proc7(int v1, int v2) { return true; }
+
+	/**
+	 * Load the item's data
+	 */
+	virtual void load(SimpleFile *file) {}
+
+	/**
+	 * Save the item's data
+	 */
+	virtual void save(SimpleFile *file, int indent) {}
+
+	/**
+	 * Clear allocated data
+	 */
+	void clear();
+
+	void initialize();
+
+	/**
+	 * Get a pointer to a data entry
+	 */
+	CBaseStarEntry *getDataPtr(int index);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB3_H */
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index 9880e6f..d8b7d12 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -25,8 +25,8 @@
 
 namespace Titanic {
 
-CStarControl::CStarControl() : _fieldBC(0), _field80A0(0),
-		_field80A4(0), _field80A8(0), _field80AC(0), _field80B0(0) {
+CStarControl::CStarControl() : _fieldBC(0), _field80B0(0),
+		_starRect(20, 10, 620, 350) {
 }
 
 void CStarControl::save(SimpleFile *file, int indent) {
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index 1bd2dec..be8ee75 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -34,10 +34,7 @@ private:
 	int _fieldBC;
 	CStarControlSub1 _sub1;
 	CStarControlSub11 _sub11;
-	int _field80A0;
-	int _field80A4;
-	int _field80A8;
-	int _field80AC;
+	Rect _starRect;
 	int _field80B0;
 public:
 	CLASSDEF
diff --git a/engines/titanic/star_control/star_control_sub2.cpp b/engines/titanic/star_control/star_control_sub2.cpp
index 9b9a5f8..d221c9f 100644
--- a/engines/titanic/star_control/star_control_sub2.cpp
+++ b/engines/titanic/star_control/star_control_sub2.cpp
@@ -24,5 +24,25 @@
 
 namespace Titanic {
 
+bool CStarControlSub2::proc3(int v1) {
+	clear();
+	// TODO
+	return true;
+}
+
+bool CStarControlSub2::proc4(int v1, int v2, int v3, int v4, int v5) {
+	// TODO
+	return true;
+}
+
+bool CStarControlSub2::proc6() {
+	// TODO
+	return true;
+}
+
+bool CStarControlSub2::proc7(int v1, int v2) {
+	// TODO
+	return true;
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub2.h b/engines/titanic/star_control/star_control_sub2.h
index 2bae029..33fdb42 100644
--- a/engines/titanic/star_control/star_control_sub2.h
+++ b/engines/titanic/star_control/star_control_sub2.h
@@ -23,13 +23,18 @@
 #ifndef TITANIC_STAR_CONTROL_SUB2_H
 #define TITANIC_STAR_CONTROL_SUB2_H
 
-#include "titanic/star_control/star_control_sub3.h"
+#include "titanic/star_control/base_star.h"
 
 namespace Titanic {
 
-class CStarControlSub2: public CStarControlSub3 {
+class CStarControlSub2: public CBaseStar {
 public:
 	virtual ~CStarControlSub2() {}
+
+	virtual bool proc3(int v1);
+	virtual bool proc4(int v1, int v2, int v3, int v4, int v5);
+	virtual bool proc6();
+	virtual bool proc7(int v1, int v2);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub3.cpp b/engines/titanic/star_control/star_control_sub3.cpp
deleted file mode 100644
index c65a308..0000000
--- a/engines/titanic/star_control/star_control_sub3.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/star_control/star_control_sub3.h"
-
-namespace Titanic {
-
-CStarControlSub3::CStarControlSub3() : _field4(0), _field8(0),
-		_fieldC(1), _field28(0), _field2C(0x3F800000) {
-}
-
-void CStarControlSub3::proc2() {
-	error("TODO");
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub3.h b/engines/titanic/star_control/star_control_sub3.h
deleted file mode 100644
index 08d0835..0000000
--- a/engines/titanic/star_control/star_control_sub3.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_CONTROL_SUB3_H
-#define TITANIC_STAR_CONTROL_SUB3_H
-
-#include "titanic/support/simple_file.h"
-#include "titanic/star_control/star_control_sub4.h"
-
-namespace Titanic {
-
-class CStarControlSub3 {
-protected:
-	int _field4;
-	int _field8;
-	int _fieldC;
-	CStarControlSub4 _sub4;
-	int _field28;
-	int _field2C;
-public:
-	CStarControlSub3();
-	virtual ~CStarControlSub3() {}
-
-	virtual void proc2();
-	virtual int proc3() { return 1; }
-	virtual int proc4() { return 0; }
-	virtual int proc5() { return 0; }
-	virtual int proc6() { return 0; }
-	virtual int proc7() { return 1; }
-
-	virtual void load(SimpleFile *file) {}
-
-	virtual void proc9() {}
-
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_SUB3_H */
diff --git a/engines/titanic/star_control/star_control_sub4.cpp b/engines/titanic/star_control/star_control_sub4.cpp
index 27ef859..f765acb 100644
--- a/engines/titanic/star_control/star_control_sub4.cpp
+++ b/engines/titanic/star_control/star_control_sub4.cpp
@@ -20,12 +20,26 @@
  *
  */
 
+#include "common/algorithm.h"
 #include "titanic/star_control/star_control_sub4.h"
 
 namespace Titanic {
 
-CStarControlSub4::CStarControlSub4() : _field0(0), 
-	_field4(0), _fieldC(0), _field10(0), _field14(0) {
+CStarControlSub4::CStarControlSub4() {
+}
+
+void CStarControlSub4::initialize() {
+	_min._v1 = _min._v2 = _min._v3 = 9.9999994e27;
+	_max._v1 = _max._v2 = _max._v3 = -9.9999994e27;
+}
+
+void CStarControlSub4::checkEntry(const CBaseStarVal &val) {
+	_min._v1 = MIN(_min._v1, val._v1);
+	_min._v2 = MIN(_min._v2, val._v2);
+	_min._v3 = MIN(_min._v3, val._v3);
+	_max._v1 = MAX(_max._v1, val._v1);
+	_max._v2 = MAX(_max._v2, val._v2);
+	_max._v3 = MAX(_max._v3, val._v3);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub4.h b/engines/titanic/star_control/star_control_sub4.h
index 4aa75f8..f0fcfaf 100644
--- a/engines/titanic/star_control/star_control_sub4.h
+++ b/engines/titanic/star_control/star_control_sub4.h
@@ -25,17 +25,21 @@
 
 namespace Titanic {
 
+struct CBaseStarVal {
+	double _v1, _v2, _v3;
+	CBaseStarVal() : _v1(0), _v2(0), _v3(0) {}
+};
+
 class CStarControlSub4 {
 private:
-	int _field0;
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
-	int _field14;
+	CBaseStarVal _min;
+	CBaseStarVal _max;
 public:
 	CStarControlSub4();
 
+	void initialize();
+
+	void checkEntry(const CBaseStarVal &val);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub6.cpp b/engines/titanic/star_control/star_control_sub6.cpp
index 79937b7..c416181 100644
--- a/engines/titanic/star_control/star_control_sub6.cpp
+++ b/engines/titanic/star_control/star_control_sub6.cpp
@@ -32,11 +32,11 @@ void CStarControlSub6::clear() {
 	_field0 = 0x3F800000;
 	_field4 = 0;
 	_field8 = 0;
-	_fieldC = 0),
+	_fieldC = 0;
 	_field10 = 0x3F800000;
 	_field14 = 0;
 	_field18 = 0;
-	_field1C = 0),
+	_field1C = 0;
 	_field20 = 0x3F800000;
 	_field24 = 0;
 	_field28 = 0;
diff --git a/engines/titanic/star_control/star_control_sub7.cpp b/engines/titanic/star_control/star_control_sub7.cpp
index 0677e33..b33f8be 100644
--- a/engines/titanic/star_control/star_control_sub7.cpp
+++ b/engines/titanic/star_control/star_control_sub7.cpp
@@ -24,5 +24,13 @@
 
 namespace Titanic {
 
+void CStarControlSub7::proc2(int v1, int v2, int v3) {
+	// TODO
+}
+
+bool CStarControlSub7::proc5(int v1) {
+	// TODO
+	return true;
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub7.h b/engines/titanic/star_control/star_control_sub7.h
index 9999423..b73124d 100644
--- a/engines/titanic/star_control/star_control_sub7.h
+++ b/engines/titanic/star_control/star_control_sub7.h
@@ -23,11 +23,15 @@
 #ifndef TITANIC_STAR_CONTROL_SUB7_H
 #define TITANIC_STAR_CONTROL_SUB7_H
 
-#include "titanic/star_control/star_control_sub3.h"
+#include "titanic/star_control/base_star.h"
 namespace Titanic {
 
-class CStarControlSub7 : public CStarControlSub3 {
+class CStarControlSub7 : public CBaseStar {
 public:
+	virtual ~CStarControlSub7() { clear(); }
+
+	virtual void proc2(int v1, int v2, int v3);
+	virtual bool proc5(int v1);
 };
 
 } // End of namespace Titanic


Commit: 8f6ba6e00a919fdeb56f70d79f6c1fb62856971d
    https://github.com/scummvm/scummvm/commit/8f6ba6e00a919fdeb56f70d79f6c1fb62856971d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:26:11-04:00

Commit Message:
TITANIC: Added CBaseStar data loading

Changed paths:
    engines/titanic/star_control/base_star.cpp
    engines/titanic/star_control/base_star.h
    engines/titanic/star_control/star_control_sub2.cpp
    engines/titanic/star_control/star_control_sub2.h



diff --git a/engines/titanic/star_control/base_star.cpp b/engines/titanic/star_control/base_star.cpp
index c8f55a7..7b57b88 100644
--- a/engines/titanic/star_control/base_star.cpp
+++ b/engines/titanic/star_control/base_star.cpp
@@ -21,10 +21,31 @@
  */
 
 #include "titanic/star_control/base_star.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
-CBaseStar::CBaseStar() : _fieldC(1), _minVal(0.0), _maxVal(1.0), _range(0.0) {
+CBaseStarEntry::CBaseStarEntry() : _field0(0), _value(0.0) {
+	Common::fill(&_data[0], &_data[5], 0);
+}
+
+void CBaseStarEntry::load(Common::SeekableReadStream &s) {
+	_field0 = s.readByte();
+	_field1 = s.readByte();
+	_field2 = s.readByte();
+	_field3 = s.readByte();
+	*((uint32 *)&_value) = s.readUint32LE();		// FIXME
+	_val._v1 = s.readUint32LE();
+	_val._v2 = s.readUint32LE();
+	_val._v3 = s.readUint32LE();
+
+	for (int idx = 0; idx < 5; ++idx)
+		_data[idx] = s.readUint32LE();
+}
+
+/*------------------------------------------------------------------------*/
+
+CBaseStar::CBaseStar() : _minVal(0.0), _maxVal(1.0), _range(0.0) {
 }
 
 void CBaseStar::proc2(int v1, int v2, int v3) {
@@ -32,10 +53,7 @@ void CBaseStar::proc2(int v1, int v2, int v3) {
 }
 
 void CBaseStar::clear() {
-	if (!_data.empty()) {
-		if (_fieldC)
-			_data.clear();
-	}
+	_data.clear();
 }
 
 void CBaseStar::initialize() {
@@ -60,4 +78,41 @@ CBaseStarEntry *CBaseStar::getDataPtr(int index) {
 	return (index >= 0 && index < (int)_data.size()) ? &_data[index] : nullptr;
 }
 
+void CBaseStar::loadData(Common::SeekableReadStream &s) {
+	uint headerId = s.readUint32LE();
+	uint count = s.readUint32LE();
+	if (headerId != 100 || count == 0);
+	error("Invalid star data");
+
+	// Initialize the data array
+	clear();
+	_data.resize(count);
+
+	// Iterate through reading the data for each entry
+	for (uint idx = 0; idx < count; ++idx)
+		_data[idx].load(s);
+}
+
+void CBaseStar::loadData(const CString &resName) {
+	// Get a stream to read the data from the DAT file
+	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource(resName);
+	assert(stream);
+
+	// Load the stream
+	loadData(*stream);
+	delete stream;
+}
+
+void CBaseStar::resetEntry(CBaseStarEntry &entry) {
+	entry._field0 = 0xFF;
+	entry._field1 = 0xFF;
+	entry._field2 = 0xFF;
+	entry._field3 = 0;
+	entry._val._v1 = 0;
+	entry._val._v2 = 0;
+	entry._val._v3 = 0;
+	for (int idx = 0; idx < 5; ++idx)
+		entry._data[idx] = 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/base_star.h b/engines/titanic/star_control/base_star.h
index 20dbace..ad3ad13 100644
--- a/engines/titanic/star_control/base_star.h
+++ b/engines/titanic/star_control/base_star.h
@@ -29,19 +29,45 @@
 namespace Titanic {
 
 struct CBaseStarEntry {
-	int _field0;
+	byte _field0;
+	byte _field1;
+	byte _field2;
+	byte _field3;
 	double _value;
 	CBaseStarVal _val;
+	uint _data[5];
+
+	CBaseStarEntry();
+	void load(Common::SeekableReadStream &s);
 };
 
 class CBaseStar {
 protected:
 	Common::Array<CBaseStarEntry> _data;
-	int _fieldC;
 	CStarControlSub4 _sub4;
 	double _minVal;
 	double _maxVal;
 	double _range;
+protected:
+	/**
+	 * Get a pointer to a data entry
+	 */
+	CBaseStarEntry *getDataPtr(int index);
+
+	/**
+	 * Load entry data from a passed stream
+	 */
+	void loadData(Common::SeekableReadStream &s);
+
+	/**
+	 * Load entry data from a specified resource
+	 */
+	void loadData(const CString &resName);
+
+	/**
+	 * Reset the data for an entry
+	 */
+	void resetEntry(CBaseStarEntry &entry);
 public:
 	CBaseStar();
 	virtual ~CBaseStar() {}
@@ -69,11 +95,6 @@ public:
 	void clear();
 
 	void initialize();
-
-	/**
-	 * Get a pointer to a data entry
-	 */
-	CBaseStarEntry *getDataPtr(int index);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub2.cpp b/engines/titanic/star_control/star_control_sub2.cpp
index d221c9f..eeebaa1 100644
--- a/engines/titanic/star_control/star_control_sub2.cpp
+++ b/engines/titanic/star_control/star_control_sub2.cpp
@@ -35,7 +35,7 @@ bool CStarControlSub2::proc4(int v1, int v2, int v3, int v4, int v5) {
 	return true;
 }
 
-bool CStarControlSub2::proc6() {
+bool CStarControlSub2::loadStar() {
 	// TODO
 	return true;
 }
diff --git a/engines/titanic/star_control/star_control_sub2.h b/engines/titanic/star_control/star_control_sub2.h
index 33fdb42..bfbe02c 100644
--- a/engines/titanic/star_control/star_control_sub2.h
+++ b/engines/titanic/star_control/star_control_sub2.h
@@ -33,7 +33,7 @@ public:
 
 	virtual bool proc3(int v1);
 	virtual bool proc4(int v1, int v2, int v3, int v4, int v5);
-	virtual bool proc6();
+	virtual bool loadStar();
 	virtual bool proc7(int v1, int v2);
 };
 


Commit: 712db65ff4d1e10d07ed873cc5929a1cbb0862be
    https://github.com/scummvm/scummvm/commit/712db65ff4d1e10d07ed873cc5929a1cbb0862be
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:26:14-04:00

Commit Message:
TITANIC: Implemented CStarControlSub15 class

Changed paths:
  A engines/titanic/star_control/star_control_sub16.cpp
  A engines/titanic/star_control/star_control_sub16.h
  A engines/titanic/star_control/star_view.cpp
  A engines/titanic/star_control/star_view.h
  R engines/titanic/star_control/star_control_sub11.cpp
  R engines/titanic/star_control/star_control_sub11.h
    engines/titanic/module.mk
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control.h
    engines/titanic/star_control/star_control_sub12.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 7138f57..71df87d 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -427,11 +427,13 @@ MODULE_OBJS := \
 	star_control/star_control_sub8.o \
 	star_control/star_control_sub9.o \
 	star_control/star_control_sub10.o \
-	star_control/star_control_sub11.o \
+	star_control/star_view.o \
 	star_control/star_control_sub12.o \
 	star_control/star_control_sub13.o \
 	star_control/star_control_sub14.o \
 	star_control/star_control_sub15.o \
+	star_control/star_control_sub16.o \
+	star_control/surface_obj.o \
 	support/direct_draw.o \
 	support/direct_draw_surface.o \
 	support/exe_resources.o \
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index d8b7d12..aa65781 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -31,6 +31,8 @@ CStarControl::CStarControl() : _fieldBC(0), _field80B0(0),
 
 void CStarControl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
+	_sub1.save(file, indent);
+	_view.save(file, indent);
 	CGameObject::save(file, indent);
 }
 
@@ -42,7 +44,7 @@ void CStarControl::load(SimpleFile *file) {
 		if (!_sub1.initDocument())
 			error("Couldn't initialise the StarField document");
 
-		_sub11.load(file, 0);
+		_view.load(file, 0);
 		CScreenManager *screenManager = CScreenManager::setCurrent();
 		if (!screenManager)
 			error("There's no screen  manager during loading");
@@ -53,6 +55,11 @@ void CStarControl::load(SimpleFile *file) {
 	CGameObject::load(file);
 }
 
+void CStarControl::draw(CScreenManager *screenManager) {
+	if (_visible)
+		_view.draw(screenManager);
+}
+
 void CStarControl::fn3() {
 	warning("CStarControl::fn3");
 }
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index be8ee75..c653e8e 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -25,7 +25,7 @@
 
 #include "titanic/core/game_object.h"
 #include "titanic/star_control/star_control_sub1.h"
-#include "titanic/star_control/star_control_sub11.h"
+#include "titanic/star_control/star_view.h"
 
 namespace Titanic {
 
@@ -33,7 +33,7 @@ class CStarControl : public CGameObject {
 private:
 	int _fieldBC;
 	CStarControlSub1 _sub1;
-	CStarControlSub11 _sub11;
+	CStarView _view;
 	Rect _starRect;
 	int _field80B0;
 public:
@@ -50,6 +50,11 @@ public:
 	 */
 	virtual void load(SimpleFile *file);
 
+	/**
+	 * Allows the item to draw itself
+	 */
+	virtual void draw(CScreenManager *screenManager);
+
 	void fn1(int v);
 	void fn3();
 	void fn4();
diff --git a/engines/titanic/star_control/star_control_sub11.cpp b/engines/titanic/star_control/star_control_sub11.cpp
deleted file mode 100644
index 05f2733..0000000
--- a/engines/titanic/star_control/star_control_sub11.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/support/screen_manager.h"
-#include "titanic/star_control/star_control_sub11.h"
-
-namespace Titanic {
-
-CStarControlSub11::CStarControlSub11() : 
-		_sub12(nullptr, nullptr), _sub13(nullptr),
-		_field4(0), _field8(0), _field118(0), _field20C(0),
-		_field210(0), _field214(0), _field218(0), _field21C(0) {
-	_sub12.proc3();
-}
-
-void CStarControlSub11::load(SimpleFile *file, int param) {
-	if (!param) {
-		_sub12.load(file, param);
-
-		_field118 = file->readNumber();
-		if (_field118)
-			_sub13.load(file, 0);
-
-		_field218 = file->readNumber();
-		_field21C = file->readNumber();
-	}
-}
-
-void CStarControlSub11::save(SimpleFile *file, int indent) {
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub11.h b/engines/titanic/star_control/star_control_sub11.h
deleted file mode 100644
index a322e1e..0000000
--- a/engines/titanic/star_control/star_control_sub11.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_CONTROL_SUB11_H
-#define TITANIC_STAR_CONTROL_SUB11_H
-
-#include "titanic/support/simple_file.h"
-#include "titanic/star_control/star_control_sub12.h"
-#include "titanic/star_control/star_control_sub13.h"
-#include "titanic/star_control/star_control_sub15.h"
-
-namespace Titanic {
-
-class CStarControlSub11 {
-private:
-	int _field0;
-	int _field4;
-	int _field8;
-	CStarControlSub12 _sub12;
-	int _field118;
-	CStarControlSub13 _sub13;
-	CStarControlSub15 _sub15;
-	int _field20C;
-	int _field210;
-	int _field214;
-	int _field218;
-	int _field21C;
-public:
-	CStarControlSub11();
-
-	/**
-	 * Load the data for the class from file
-	 */
-	void load(SimpleFile *file, int param);
-
-	/**
-	 * Save the data for the class to file
-	 */
-	void save(SimpleFile *file, int indent);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_SUB11_H */
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index bce668f..e053aef 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -50,12 +50,12 @@ public:
 	/**
 	 * Load the data for the class from file
 	 */
-	void load(SimpleFile *file, int param);
+	virtual void load(SimpleFile *file, int param);
 
 	/**
 	 * Save the data for the class to file
 	 */
-	void save(SimpleFile *file, int indent);
+	virtual void save(SimpleFile *file, int indent);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub16.cpp b/engines/titanic/star_control/star_control_sub16.cpp
new file mode 100644
index 0000000..1465ac6
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub16.cpp
@@ -0,0 +1,74 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub16.h"
+
+namespace Titanic {
+
+CStarControlSub16::CStarControlSub16() : _field4(-1), _field8(32),
+		_videoSurface(nullptr) {
+}
+
+void CStarControlSub16::reset() {
+	_field4 = 0;
+}
+
+bool CStarControlSub16::setupSurface(CScreenManager *screenManager, CVideoSurface *srcSurface) {
+	int width = srcSurface->getWidth();
+	int height = srcSurface->getHeight();
+
+	if (_videoSurface) {
+		if (width == _videoSurface->getWidth() && _videoSurface->getHeight())
+			// Allocated surface already matches new size
+			return true;
+
+		// Different sizes, so delete old surface
+		delete _videoSurface;
+	}
+
+	_videoSurface = screenManager->createSurface(width, height);
+	return true;
+}
+
+CVideoSurface *CStarControlSub16::loadSurface(CScreenManager *screenManager, CVideoSurface *srcSurface) {
+	if (_field4 < 0 || _field4 >= _field8)
+		return srcSurface;
+
+	if (!_field8 && !setupSurface(screenManager, srcSurface))
+		return nullptr;
+
+	srcSurface->lock();
+	_videoSurface->lock();
+	CSurfaceObj srcSurfaceObj(srcSurface);
+	CSurfaceObj destSurfaceObj(_videoSurface);
+
+	proc4(srcSurfaceObj, destSurfaceObj);
+
+	srcSurface->unlock();
+	_videoSurface->unlock();
+	
+	++_field4;
+	return _videoSurface;
+}
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub16.h b/engines/titanic/star_control/star_control_sub16.h
new file mode 100644
index 0000000..64e463c
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub16.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB16_H
+#define TITANIC_STAR_CONTROL_SUB16_H
+
+#include "titanic/support/video_surface.h"
+#include "titanic/support/screen_manager.h"
+#include "titanic/star_control/surface_obj.h"
+
+namespace Titanic {
+
+class CStarControlSub16 {
+private:
+	/**
+	 * Sets up an internal surface to match the size of the specified one
+	 */
+	bool setupSurface(CScreenManager *screenManager, CVideoSurface *srcSurface);
+protected:
+	int _field4;
+	int _field8;
+	CVideoSurface *_videoSurface;
+protected:
+	virtual void proc4(CSurfaceObj &srcSurface, CSurfaceObj &destSurface) = 0;
+public:
+	CStarControlSub16();
+
+	virtual void reset();
+
+	/**
+	 * Loads from a given source surface
+	 */
+	virtual CVideoSurface *loadSurface(CScreenManager *screenManager, CVideoSurface *srcSurface);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB16_H */
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
new file mode 100644
index 0000000..8af94c6
--- /dev/null
+++ b/engines/titanic/star_control/star_view.cpp
@@ -0,0 +1,67 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/screen_manager.h"
+#include "titanic/star_control/star_view.h"
+
+namespace Titanic {
+
+CStarView::CStarView() : 
+		_sub12(nullptr, nullptr), _sub13(nullptr),
+		_field4(0), _videoSurface(nullptr), _field118(0), _field20C(0),
+		_field210(0), _field214(0), _field218(0), _field21C(0) {
+	_sub12.proc3();
+}
+
+void CStarView::load(SimpleFile *file, int param) {
+	if (!param) {
+		_sub12.load(file, param);
+
+		_field118 = file->readNumber();
+		if (_field118)
+			_sub13.load(file, 0);
+
+		_field218 = file->readNumber();
+		_field21C = file->readNumber();
+	}
+}
+
+void CStarView::save(SimpleFile *file, int indent) {
+	_sub12.save(file, indent);
+	
+	file->writeNumberLine(_field118, indent);
+	if (_field118)
+		_sub13.save(file, indent);
+
+	file->writeNumberLine(_field218, indent);
+	file->writeNumberLine(_field21C, indent);
+}
+
+void CStarView::draw(CScreenManager *screenManager) {
+	if (!screenManager)
+		return;
+
+
+	// TODO
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_view.h b/engines/titanic/star_control/star_view.h
new file mode 100644
index 0000000..47d138a
--- /dev/null
+++ b/engines/titanic/star_control/star_view.h
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_VIEW_H
+#define TITANIC_STAR_VIEW_H
+
+#include "titanic/support/simple_file.h"
+#include "titanic/support/video_surface.h"
+#include "titanic/star_control/star_control_sub12.h"
+#include "titanic/star_control/star_control_sub13.h"
+#include "titanic/star_control/star_control_sub15.h"
+
+namespace Titanic {
+
+class CStarView {
+private:
+	int _field0;
+	int _field4;
+	CVideoSurface *_videoSurface;
+	CStarControlSub12 _sub12;
+	int _field118;
+	CStarControlSub13 _sub13;
+	CStarControlSub15 _sub15;
+	int _field20C;
+	int _field210;
+	int _field214;
+	int _field218;
+	int _field21C;
+public:
+	CStarView();
+
+	/**
+	 * Load the data for the class from file
+	 */
+	void load(SimpleFile *file, int param);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	void save(SimpleFile *file, int indent);
+
+	/**
+	 * Allows the item to draw itself
+	 */
+	void draw(CScreenManager *screenManager);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_RENDERER_H */


Commit: ed2a716790255c93a75db3570de0d821978cfe68
    https://github.com/scummvm/scummvm/commit/ed2a716790255c93a75db3570de0d821978cfe68
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:26:17-04:00

Commit Message:
TITANIC: Implemented CSurfaceObj class

Changed paths:
  A engines/titanic/star_control/surface_obj.cpp
  A engines/titanic/star_control/surface_obj.h



diff --git a/engines/titanic/star_control/surface_obj.cpp b/engines/titanic/star_control/surface_obj.cpp
new file mode 100644
index 0000000..93f46e5
--- /dev/null
+++ b/engines/titanic/star_control/surface_obj.cpp
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/surface_obj.h"
+
+namespace Titanic {
+
+CSurfaceObj::CSurfaceObj(CVideoSurface *surface) {
+	_width = surface->getWidth();
+	_height = surface->getHeight();
+	_pitch = surface->getPitch();
+
+	// Original supported other pixel depths
+	_bpp = surface->getPixelDepth();
+	assert(_bpp == 2);
+	_pixelsPtr = surface->getPixels();
+
+	initialize();
+}
+
+void CSurfaceObj::initialize() {
+	_bounds = Rect(0, 0, _width - 1, _height - 1);
+	_centroid = Point(_width / 2, _height / 2);
+	_field22 = _field21 = _field20 = 0xFF;
+	_field27 = _field26 = _field25 = 0;
+	_field24 = _field23 = 0;
+	_field28 = _field2C = 0;
+	_field38 = 0;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/surface_obj.h b/engines/titanic/star_control/surface_obj.h
new file mode 100644
index 0000000..518f85b
--- /dev/null
+++ b/engines/titanic/star_control/surface_obj.h
@@ -0,0 +1,65 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SURFACE_OBJ_H
+#define TITANIC_SURFACE_OBJ_H
+
+#include "titanic/support/rect.h"
+#include "titanic/support/video_surface.h"
+
+namespace Titanic {
+
+class CSurfaceObj {
+private:
+	/**
+	 * Initialize data for the class
+	 */
+	void initialize();
+public:
+	int _field0;
+	int _width;
+	int _height;
+	int _pitch;
+	int _bpp;
+	uint16 *_pixelsPtr;
+	Point _centroid;
+	byte _field20;
+	byte _field21;
+	byte _field22;
+	byte _field23;
+	byte _field24;
+	byte _field25;
+	byte _field26;
+	byte _field27;
+	int _field28;
+	int _field2C;
+	int _field30;
+	int _field34;
+	int _field38;
+	Rect _bounds;
+public:
+	CSurfaceObj(CVideoSurface *surface);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB16_H */


Commit: 79b4754b3318c21479dfccaf91dcf09fabf23fd4
    https://github.com/scummvm/scummvm/commit/79b4754b3318c21479dfccaf91dcf09fabf23fd4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:26:21-04:00

Commit Message:
TITANIC: Finish and better name fader classes

Changed paths:
  A engines/titanic/star_control/surface_area.cpp
  A engines/titanic/star_control/surface_area.h
  A engines/titanic/star_control/surface_fader.cpp
  A engines/titanic/star_control/surface_fader.h
  A engines/titanic/star_control/surface_fader_base.cpp
  A engines/titanic/star_control/surface_fader_base.h
  R engines/titanic/star_control/star_control_sub15.cpp
  R engines/titanic/star_control/star_control_sub15.h
  R engines/titanic/star_control/star_control_sub16.cpp
  R engines/titanic/star_control/star_control_sub16.h
  R engines/titanic/star_control/surface_obj.cpp
  R engines/titanic/star_control/surface_obj.h
    engines/titanic/module.mk
    engines/titanic/star_control/star_view.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 71df87d..79f55d4 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -433,7 +433,9 @@ MODULE_OBJS := \
 	star_control/star_control_sub14.o \
 	star_control/star_control_sub15.o \
 	star_control/star_control_sub16.o \
-	star_control/surface_obj.o \
+	star_control/surface_area.o \
+	star_control/surface_fader_base.o \
+	star_control/surface_fader.o \
 	support/direct_draw.o \
 	support/direct_draw_surface.o \
 	support/exe_resources.o \
diff --git a/engines/titanic/star_control/star_control_sub15.cpp b/engines/titanic/star_control/star_control_sub15.cpp
deleted file mode 100644
index 07ed80c..0000000
--- a/engines/titanic/star_control/star_control_sub15.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/star_control/star_control_sub15.h"
-
-namespace Titanic {
-
-CStarControlSub15::CStarControlSub15() : _field4(-1),
-		_field8(32), _fieldC(0), _field10(0), _field14(0) {
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub15.h b/engines/titanic/star_control/star_control_sub15.h
deleted file mode 100644
index 0e0d2e4..0000000
--- a/engines/titanic/star_control/star_control_sub15.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_CONTROL_SUB15_H
-#define TITANIC_STAR_CONTROL_SUB15_H
-
-#include "titanic/support/simple_file.h"
-
-namespace Titanic {
-
-class CStarControlSub15 {
-private:
-	double _field4;
-	double _field8;
-	double _fieldC;
-	double _field10;
-	double _field14;
-public:
-	CStarControlSub15();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_SUB15_H */
diff --git a/engines/titanic/star_control/star_control_sub16.cpp b/engines/titanic/star_control/star_control_sub16.cpp
deleted file mode 100644
index 1465ac6..0000000
--- a/engines/titanic/star_control/star_control_sub16.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/star_control/star_control_sub16.h"
-
-namespace Titanic {
-
-CStarControlSub16::CStarControlSub16() : _field4(-1), _field8(32),
-		_videoSurface(nullptr) {
-}
-
-void CStarControlSub16::reset() {
-	_field4 = 0;
-}
-
-bool CStarControlSub16::setupSurface(CScreenManager *screenManager, CVideoSurface *srcSurface) {
-	int width = srcSurface->getWidth();
-	int height = srcSurface->getHeight();
-
-	if (_videoSurface) {
-		if (width == _videoSurface->getWidth() && _videoSurface->getHeight())
-			// Allocated surface already matches new size
-			return true;
-
-		// Different sizes, so delete old surface
-		delete _videoSurface;
-	}
-
-	_videoSurface = screenManager->createSurface(width, height);
-	return true;
-}
-
-CVideoSurface *CStarControlSub16::loadSurface(CScreenManager *screenManager, CVideoSurface *srcSurface) {
-	if (_field4 < 0 || _field4 >= _field8)
-		return srcSurface;
-
-	if (!_field8 && !setupSurface(screenManager, srcSurface))
-		return nullptr;
-
-	srcSurface->lock();
-	_videoSurface->lock();
-	CSurfaceObj srcSurfaceObj(srcSurface);
-	CSurfaceObj destSurfaceObj(_videoSurface);
-
-	proc4(srcSurfaceObj, destSurfaceObj);
-
-	srcSurface->unlock();
-	_videoSurface->unlock();
-	
-	++_field4;
-	return _videoSurface;
-}
-
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub16.h b/engines/titanic/star_control/star_control_sub16.h
deleted file mode 100644
index 64e463c..0000000
--- a/engines/titanic/star_control/star_control_sub16.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_CONTROL_SUB16_H
-#define TITANIC_STAR_CONTROL_SUB16_H
-
-#include "titanic/support/video_surface.h"
-#include "titanic/support/screen_manager.h"
-#include "titanic/star_control/surface_obj.h"
-
-namespace Titanic {
-
-class CStarControlSub16 {
-private:
-	/**
-	 * Sets up an internal surface to match the size of the specified one
-	 */
-	bool setupSurface(CScreenManager *screenManager, CVideoSurface *srcSurface);
-protected:
-	int _field4;
-	int _field8;
-	CVideoSurface *_videoSurface;
-protected:
-	virtual void proc4(CSurfaceObj &srcSurface, CSurfaceObj &destSurface) = 0;
-public:
-	CStarControlSub16();
-
-	virtual void reset();
-
-	/**
-	 * Loads from a given source surface
-	 */
-	virtual CVideoSurface *loadSurface(CScreenManager *screenManager, CVideoSurface *srcSurface);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_SUB16_H */
diff --git a/engines/titanic/star_control/star_view.h b/engines/titanic/star_control/star_view.h
index 47d138a..d625d9b 100644
--- a/engines/titanic/star_control/star_view.h
+++ b/engines/titanic/star_control/star_view.h
@@ -27,7 +27,7 @@
 #include "titanic/support/video_surface.h"
 #include "titanic/star_control/star_control_sub12.h"
 #include "titanic/star_control/star_control_sub13.h"
-#include "titanic/star_control/star_control_sub15.h"
+#include "titanic/star_control/surface_fader.h"
 
 namespace Titanic {
 
@@ -39,7 +39,7 @@ private:
 	CStarControlSub12 _sub12;
 	int _field118;
 	CStarControlSub13 _sub13;
-	CStarControlSub15 _sub15;
+	CSurfaceFader _fader;
 	int _field20C;
 	int _field210;
 	int _field214;
diff --git a/engines/titanic/star_control/surface_area.cpp b/engines/titanic/star_control/surface_area.cpp
new file mode 100644
index 0000000..77f8222
--- /dev/null
+++ b/engines/titanic/star_control/surface_area.cpp
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/surface_area.h"
+
+namespace Titanic {
+
+CSurfaceArea::CSurfaceArea(CVideoSurface *surface) {
+	_width = surface->getWidth();
+	_height = surface->getHeight();
+	_pitch = surface->getPitch();
+
+	// Original supported other pixel depths
+	_bpp = surface->getPixelDepth();
+	assert(_bpp == 2);
+	_pixelsPtr = surface->getPixels();
+
+	initialize();
+}
+
+void CSurfaceArea::initialize() {
+	_bounds = Rect(0, 0, _width - 1, _height - 1);
+	_centroid = Point(_width / 2, _height / 2);
+	_field22 = _field21 = _field20 = 0xFF;
+	_field27 = _field26 = _field25 = 0;
+	_field24 = _field23 = 0;
+	_field28 = _field2C = 0;
+	_field38 = 0;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/surface_area.h b/engines/titanic/star_control/surface_area.h
new file mode 100644
index 0000000..4d19131
--- /dev/null
+++ b/engines/titanic/star_control/surface_area.h
@@ -0,0 +1,65 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SURFACE_OBJ_H
+#define TITANIC_SURFACE_OBJ_H
+
+#include "titanic/support/rect.h"
+#include "titanic/support/video_surface.h"
+
+namespace Titanic {
+
+class CSurfaceArea {
+private:
+	/**
+	 * Initialize data for the class
+	 */
+	void initialize();
+public:
+	int _field0;
+	int _width;
+	int _height;
+	int _pitch;
+	int _bpp;
+	uint16 *_pixelsPtr;
+	Point _centroid;
+	byte _field20;
+	byte _field21;
+	byte _field22;
+	byte _field23;
+	byte _field24;
+	byte _field25;
+	byte _field26;
+	byte _field27;
+	int _field28;
+	int _field2C;
+	int _field30;
+	int _field34;
+	int _field38;
+	Rect _bounds;
+public:
+	CSurfaceArea(CVideoSurface *surface);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB16_H */
diff --git a/engines/titanic/star_control/surface_fader.cpp b/engines/titanic/star_control/surface_fader.cpp
new file mode 100644
index 0000000..089ad51
--- /dev/null
+++ b/engines/titanic/star_control/surface_fader.cpp
@@ -0,0 +1,73 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/surface_fader.h"
+#include "common/system.h"
+#include "graphics/pixelformat.h"
+
+namespace Titanic {
+
+CSurfaceFader::CSurfaceFader() : CSurfaceFaderBase() {
+	_dataP = new byte[_count];
+
+	for (int idx = 0; idx < _count; ++idx) {
+		// TODO: Setup data bytes
+	}
+}
+
+CSurfaceFader::~CSurfaceFader() {
+	delete[] _dataP;
+}
+
+void CSurfaceFader::copySurface(CSurfaceArea &srcSurface, CSurfaceArea &destSurface) {
+	const uint16 *srcPixelP = srcSurface._pixelsPtr;
+	uint16 *destPixelP = destSurface._pixelsPtr;
+
+	// Currently we only support 2 bytes per pixel surfaces
+	assert(srcSurface._bpp == 2);
+
+	byte dataVal = _dataP[_index];
+	double fraction = (double)dataVal / ((double)(_count - 1));
+	if (!_fadeIn)
+		// For fade outs, reverse the percentage visibility
+		fraction = 1.0 - fraction;
+
+	// Iterate through the pixels
+	byte r, g, b;
+	Graphics::PixelFormat format = g_system->getScreenFormat();
+
+	for (int yp = 0; yp < srcSurface._height; ++yp) {
+		for (int xp = 0; xp < srcSurface._width; ++xp, ++srcPixelP, ++destPixelP) {
+			format.colorToRGB(*srcPixelP, r, g, b);
+			r = (byte)((double)r * fraction);
+			g = (byte)((double)g * fraction);
+			b = (byte)((double)b * fraction);
+			*destPixelP = format.RGBToColor(r, g, b);
+		}
+	}
+}
+
+void CSurfaceFader::setFadeIn(bool fadeIn) {
+	_fadeIn = fadeIn;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/surface_fader.h b/engines/titanic/star_control/surface_fader.h
new file mode 100644
index 0000000..650cbbb
--- /dev/null
+++ b/engines/titanic/star_control/surface_fader.h
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SURFACE_FADER_H
+#define TITANIC_SURFACE_FADER_H
+
+#include "titanic/star_control/surface_fader_base.h"
+
+namespace Titanic {
+
+class CSurfaceFader: public CSurfaceFaderBase {
+private:
+	byte *_dataP;
+	bool _fadeIn;
+protected:
+	/**
+	 * Create a faded version of the source surface at the given dest
+	 */
+	virtual void copySurface(CSurfaceArea &srcSurface, CSurfaceArea &destSurface);
+public:
+	CSurfaceFader();
+	virtual ~CSurfaceFader();
+
+	/**
+	 * Sets whether a fade in (versus a fade out) should be done
+	 */
+	void setFadeIn(bool fadeIn);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SURFACE_SHADER_H */
diff --git a/engines/titanic/star_control/surface_fader_base.cpp b/engines/titanic/star_control/surface_fader_base.cpp
new file mode 100644
index 0000000..dfd7c4a
--- /dev/null
+++ b/engines/titanic/star_control/surface_fader_base.cpp
@@ -0,0 +1,78 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/surface_fader_base.h"
+
+namespace Titanic {
+
+CSurfaceFaderBase::CSurfaceFaderBase() : _index(-1), _count(32),
+		_videoSurface(nullptr) {
+}
+
+CSurfaceFaderBase::~CSurfaceFaderBase() {
+	delete _videoSurface;
+}
+
+void CSurfaceFaderBase::reset() {
+	_index = 0;
+}
+
+bool CSurfaceFaderBase::setupSurface(CScreenManager *screenManager, CVideoSurface *srcSurface) {
+	int width = srcSurface->getWidth();
+	int height = srcSurface->getHeight();
+
+	if (_videoSurface) {
+		if (width == _videoSurface->getWidth() && _videoSurface->getHeight())
+			// Allocated surface already matches new size
+			return true;
+
+		// Different sizes, so delete old surface
+		delete _videoSurface;
+	}
+
+	_videoSurface = screenManager->createSurface(width, height);
+	return true;
+}
+
+CVideoSurface *CSurfaceFaderBase::fade(CScreenManager *screenManager, CVideoSurface *srcSurface) {
+	if (_index == -1 || _index >= _count)
+		return srcSurface;
+
+	if (!_count && !setupSurface(screenManager, srcSurface))
+		return nullptr;
+
+	srcSurface->lock();
+	_videoSurface->lock();
+	CSurfaceArea srCSurfaceArea(srcSurface);
+	CSurfaceArea destSurfaceObj(_videoSurface);
+
+	// Copy the surface with fading
+	copySurface(srCSurfaceArea, destSurfaceObj);
+
+	srcSurface->unlock();
+	_videoSurface->unlock();
+	
+	++_index;
+	return _videoSurface;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/surface_fader_base.h b/engines/titanic/star_control/surface_fader_base.h
new file mode 100644
index 0000000..ead4460
--- /dev/null
+++ b/engines/titanic/star_control/surface_fader_base.h
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SURFACE_FADER_BASE_H
+#define TITANIC_SURFACE_FADER_BASE_H
+
+#include "titanic/support/video_surface.h"
+#include "titanic/support/screen_manager.h"
+#include "titanic/star_control/surface_area.h"
+
+namespace Titanic {
+
+class CSurfaceFaderBase {
+private:
+	/**
+	 * Sets up an internal surface to match the size of the specified one
+	 */
+	bool setupSurface(CScreenManager *screenManager, CVideoSurface *srcSurface);
+protected:
+	int _index;
+	int _count;
+	CVideoSurface *_videoSurface;
+protected:
+	/**
+	 * Create a faded version of the source surface at the given dest
+	 */
+	virtual void copySurface(CSurfaceArea &srcSurface, CSurfaceArea &destSurface) = 0;
+public:
+	CSurfaceFaderBase();
+	virtual ~CSurfaceFaderBase();
+
+	virtual void reset();
+
+	/**
+	 * Creates a faded version of the passed source surface, based on a percentage
+	 * visibility specified by _index of _count
+	 */
+	virtual CVideoSurface *fade(CScreenManager *screenManager, CVideoSurface *srcSurface);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_SURFACE_FADER_BASE_H */
diff --git a/engines/titanic/star_control/surface_obj.cpp b/engines/titanic/star_control/surface_obj.cpp
deleted file mode 100644
index 93f46e5..0000000
--- a/engines/titanic/star_control/surface_obj.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/star_control/surface_obj.h"
-
-namespace Titanic {
-
-CSurfaceObj::CSurfaceObj(CVideoSurface *surface) {
-	_width = surface->getWidth();
-	_height = surface->getHeight();
-	_pitch = surface->getPitch();
-
-	// Original supported other pixel depths
-	_bpp = surface->getPixelDepth();
-	assert(_bpp == 2);
-	_pixelsPtr = surface->getPixels();
-
-	initialize();
-}
-
-void CSurfaceObj::initialize() {
-	_bounds = Rect(0, 0, _width - 1, _height - 1);
-	_centroid = Point(_width / 2, _height / 2);
-	_field22 = _field21 = _field20 = 0xFF;
-	_field27 = _field26 = _field25 = 0;
-	_field24 = _field23 = 0;
-	_field28 = _field2C = 0;
-	_field38 = 0;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/surface_obj.h b/engines/titanic/star_control/surface_obj.h
deleted file mode 100644
index 518f85b..0000000
--- a/engines/titanic/star_control/surface_obj.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_SURFACE_OBJ_H
-#define TITANIC_SURFACE_OBJ_H
-
-#include "titanic/support/rect.h"
-#include "titanic/support/video_surface.h"
-
-namespace Titanic {
-
-class CSurfaceObj {
-private:
-	/**
-	 * Initialize data for the class
-	 */
-	void initialize();
-public:
-	int _field0;
-	int _width;
-	int _height;
-	int _pitch;
-	int _bpp;
-	uint16 *_pixelsPtr;
-	Point _centroid;
-	byte _field20;
-	byte _field21;
-	byte _field22;
-	byte _field23;
-	byte _field24;
-	byte _field25;
-	byte _field26;
-	byte _field27;
-	int _field28;
-	int _field2C;
-	int _field30;
-	int _field34;
-	int _field38;
-	Rect _bounds;
-public:
-	CSurfaceObj(CVideoSurface *surface);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_SUB16_H */


Commit: ed06a1a44e508fe671d05a3b5de96fdc2a415ba7
    https://github.com/scummvm/scummvm/commit/ed06a1a44e508fe671d05a3b5de96fdc2a415ba7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:26:24-04:00

Commit Message:
TITANIC: Added bulk ofCStarView draw

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_view.cpp
    engines/titanic/star_control/star_view.h
    engines/titanic/star_control/surface_fader_base.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index a5657f5..dcc66f5 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -1101,10 +1101,6 @@ Point CGameObject::getControid() const {
 		_bounds.top + _bounds.height() / 2);
 }
 
-void CGameObject::performAction(int actionNum, CViewItem *view) {
-	// TODO
-}
-
 bool CGameObject::clipExistsByStart(const CString &name, int startFrame) const {
 	return _movieClips.existsByStart(name, startFrame);
 }
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 8c53e15..2005953 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -336,11 +336,6 @@ protected:
 	void petClear() const;
 	
 	/**
-	 * Perform an action
-	 */
-	void performAction(int actionNum, CViewItem *view = nullptr);
-
-	/**
 	 * Returns the MailMan
 	 */
 	CMailMan *getMailMan() const;
@@ -361,11 +356,6 @@ protected:
 	CRoomItem *getHiddenRoom() const;
 
 	/**
-	 * Returns a hidden object
-	 */
-	CGameObject *getHiddenObject(const CString &name) const;
-	
-	/**
 	 * Scan the specified room for an item by name
 	 */
 	CTreeItem *findUnder(CTreeItem *parent, const CString &name) const;
@@ -659,6 +649,11 @@ public:
 	Found find(const CString &name, CGameObject **item, int findAreas);
 
 	/**
+	 * Returns a hidden object
+	 */
+	CGameObject *getHiddenObject(const CString &name) const;
+	
+	/**
 	 * Sets up credits text
 	 */
 	void createCredits();
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index aa65781..ae29f3a 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -49,7 +49,10 @@ void CStarControl::load(SimpleFile *file) {
 		if (!screenManager)
 			error("There's no screen  manager during loading");
 
-		warning("TODO");
+		_view.setup(screenManager, &_sub1, this);
+		_view.reset();
+
+		_fieldBC = 1;
 	}
 	
 	CGameObject::load(file);
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index 8af94c6..c31a28c 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -22,13 +22,15 @@
 
 #include "titanic/support/screen_manager.h"
 #include "titanic/star_control/star_view.h"
+#include "titanic/star_control/star_control.h"
+#include "titanic/core/game_object.h"
 
 namespace Titanic {
 
-CStarView::CStarView() : 
-		_sub12(nullptr, nullptr), _sub13(nullptr),
-		_field4(0), _videoSurface(nullptr), _field118(0), _field20C(0),
-		_field210(0), _field214(0), _field218(0), _field21C(0) {
+CStarView::CStarView() : _sub12(nullptr, nullptr), _sub13(nullptr),
+		_owner(nullptr), _sub1(nullptr), _videoSurface(nullptr), _field118(0), 
+		_videoSurface2(nullptr), _field210(0), _homePhotoMask(nullptr),
+		_field218(0), _field21C(0) {
 	_sub12.proc3();
 }
 
@@ -56,12 +58,39 @@ void CStarView::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(_field21C, indent);
 }
 
+void CStarView::setup(CScreenManager *screenManager, CStarControlSub1 *sub1, CStarControl *starControl) {
+	_sub1 = sub1;
+	_owner = starControl;
+}
+
+void CStarView::reset() {
+	// TODO
+}
+
 void CStarView::draw(CScreenManager *screenManager) {
-	if (!screenManager)
+	if (!screenManager || !_videoSurface || !_sub1)
 		return;
 
+	if (_fader.isActive()) {
+		CVideoSurface *surface = _field21C ? _videoSurface2 : _videoSurface;
+		surface = _fader.fade(screenManager, surface);
+		screenManager->blitFrom(SURFACE_PRIMARY, surface);
+	} else {
+		Point destPos(20, 10);
 
-	// TODO
+		if (_field21C) {
+			screenManager->blitFrom(SURFACE_PRIMARY, _videoSurface2, &destPos);
+
+			if (!_homePhotoMask && _owner) {
+				_homePhotoMask = _owner->getHiddenObject("HomePhotoMask");
+			}
+
+			if (_homePhotoMask)
+				_homePhotoMask->draw(screenManager, Point(20, 187));
+		} else {
+			// TODO
+		}
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_view.h b/engines/titanic/star_control/star_view.h
index d625d9b..cfd2c8c 100644
--- a/engines/titanic/star_control/star_view.h
+++ b/engines/titanic/star_control/star_view.h
@@ -31,18 +31,21 @@
 
 namespace Titanic {
 
+class CStarControl;
+class CStarControlSub1;
+
 class CStarView {
 private:
-	int _field0;
-	int _field4;
+	CStarControl *_owner;
+	CStarControlSub1 *_sub1;
 	CVideoSurface *_videoSurface;
 	CStarControlSub12 _sub12;
 	int _field118;
 	CStarControlSub13 _sub13;
 	CSurfaceFader _fader;
-	int _field20C;
+	CVideoSurface *_videoSurface2;
 	int _field210;
-	int _field214;
+	CGameObject *_homePhotoMask;
 	int _field218;
 	int _field21C;
 public:
@@ -59,6 +62,13 @@ public:
 	void save(SimpleFile *file, int indent);
 
 	/**
+	 * Sets references used by the view
+	 */
+	void setup(CScreenManager *screenManager, CStarControlSub1 *sub1, CStarControl *starControl);
+
+	void reset();
+
+	/**
 	 * Allows the item to draw itself
 	 */
 	void draw(CScreenManager *screenManager);
diff --git a/engines/titanic/star_control/surface_fader_base.h b/engines/titanic/star_control/surface_fader_base.h
index ead4460..4631835 100644
--- a/engines/titanic/star_control/surface_fader_base.h
+++ b/engines/titanic/star_control/surface_fader_base.h
@@ -36,18 +36,21 @@ private:
 	 */
 	bool setupSurface(CScreenManager *screenManager, CVideoSurface *srcSurface);
 protected:
-	int _index;
-	int _count;
-	CVideoSurface *_videoSurface;
-protected:
 	/**
 	 * Create a faded version of the source surface at the given dest
 	 */
 	virtual void copySurface(CSurfaceArea &srcSurface, CSurfaceArea &destSurface) = 0;
 public:
+	int _index;
+	int _count;
+	CVideoSurface *_videoSurface;
+public:
 	CSurfaceFaderBase();
 	virtual ~CSurfaceFaderBase();
 
+	/**
+	 * Reset fading back to the start
+	 */
 	virtual void reset();
 
 	/**
@@ -55,6 +58,11 @@ public:
 	 * visibility specified by _index of _count
 	 */
 	virtual CVideoSurface *fade(CScreenManager *screenManager, CVideoSurface *srcSurface);
+
+	/**
+	 * Returns true if a fade is in progress
+	 */
+	bool isActive() const { return _index != -1 && _index < _count; }
 };
 
 } // End of namespace Titanic


Commit: 46ec1a004bf68d238e5cb141de7dbb426dbd3249
    https://github.com/scummvm/scummvm/commit/46ec1a004bf68d238e5cb141de7dbb426dbd3249
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:26:27-04:00

Commit Message:
TITANIC: Added CStarControl message handlers

Changed paths:
  A engines/titanic/star_control/error_code.h
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control.h
    engines/titanic/star_control/star_view.cpp
    engines/titanic/star_control/star_view.h



diff --git a/engines/titanic/star_control/error_code.h b/engines/titanic/star_control/error_code.h
new file mode 100644
index 0000000..52b0fb9
--- /dev/null
+++ b/engines/titanic/star_control/error_code.h
@@ -0,0 +1,51 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_ERROR_CODE_H
+#define TITANIC_ERROR_CODE_H
+
+namespace Titanic {
+
+class CErrorCode {
+private:
+	int _value;
+public:
+	CErrorCode() : _value(0) {}
+
+	/**
+	 * Sets the error code
+	 */
+	void set() { _value = 1; }
+
+	/**
+	 * Gets the error code and resets it
+	 */
+	int get() {
+		int result = _value;
+		_value = 0;
+		return result;
+	}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ERROR_CODE_H */
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index ae29f3a..8ab247e 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -22,9 +22,17 @@
 
 #include "titanic/support/screen_manager.h"
 #include "titanic/star_control/star_control.h"
+#include "titanic/star_control/error_code.h"
 
 namespace Titanic {
 
+BEGIN_MESSAGE_MAP(CStarControl, CGameObject)
+	ON_MESSAGE(MouseMoveMsg)
+	ON_MESSAGE(MouseButtonDownMsg)
+	ON_MESSAGE(KeyCharMsg)
+	ON_MESSAGE(FrameMsg)
+END_MESSAGE_MAP()
+
 CStarControl::CStarControl() : _fieldBC(0), _field80B0(0),
 		_starRect(20, 10, 620, 350) {
 }
@@ -63,6 +71,53 @@ void CStarControl::draw(CScreenManager *screenManager) {
 		_view.draw(screenManager);
 }
 
+bool CStarControl::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+	if (_visible && _starRect.contains(msg->_mousePos)) {
+		_view.MouseButtonDownMsg(0, Point(msg->_mousePos.x - 20,
+			msg->_mousePos.y - 10));
+		return true;
+	} else {
+		return false;
+	}
+}
+
+bool CStarControl::MouseMoveMsg(CMouseMoveMsg *msg) {
+	if (_visible && _starRect.contains(msg->_mousePos)) {
+		_view.MouseMoveMsg(0, Point(msg->_mousePos.x - 20,
+			msg->_mousePos.y - 10));
+		makeDirty();
+		return true;
+	} else {
+		return false;
+	}
+}
+
+bool CStarControl::KeyCharMsg(CKeyCharMsg *msg) {
+	if (_visible)
+		_view.KeyCharMsg(msg->_key);
+
+	return false;
+}
+
+bool CStarControl::FrameMsg(CFrameMsg *msg) {
+	if (_visible) {
+		Point pt = getMousePos();
+		if (_starRect.contains(pt))
+			_view.MouseMoveMsg(0, pt);
+
+		newFrame();
+		makeDirty();
+		return true;
+	} else {
+		return false;
+	}
+}
+
+void CStarControl::newFrame() {
+	// TODO
+}
+
+
 void CStarControl::fn3() {
 	warning("CStarControl::fn3");
 }
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index c653e8e..0c1fab7 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -30,12 +30,22 @@
 namespace Titanic {
 
 class CStarControl : public CGameObject {
+	DECLARE_MESSAGE_MAP
+	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
+	bool MouseMoveMsg(CMouseMoveMsg *msg);
+	bool KeyCharMsg(CKeyCharMsg *msg);
+	bool FrameMsg(CFrameMsg *msg);
 private:
 	int _fieldBC;
 	CStarControlSub1 _sub1;
 	CStarView _view;
 	Rect _starRect;
 	int _field80B0;
+private:
+	/**
+	 * Called for ever new game frame
+	 */
+	void newFrame();
 public:
 	CLASSDEF
 	CStarControl();
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index c31a28c..35920a3 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -93,4 +93,17 @@ void CStarView::draw(CScreenManager *screenManager) {
 	}
 }
 
+void CStarView::MouseButtonDownMsg(int unused, const Point &pt) {
+	// TODO
+}
+
+void CStarView::MouseMoveMsg(int unused, const Point &pt) {
+	// TODO
+}
+
+CErrorCode CStarView::KeyCharMsg(int key) {
+	// TODO
+	return CErrorCode();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_view.h b/engines/titanic/star_control/star_view.h
index cfd2c8c..7ec86b5 100644
--- a/engines/titanic/star_control/star_view.h
+++ b/engines/titanic/star_control/star_view.h
@@ -28,6 +28,7 @@
 #include "titanic/star_control/star_control_sub12.h"
 #include "titanic/star_control/star_control_sub13.h"
 #include "titanic/star_control/surface_fader.h"
+#include "titanic/star_control/error_code.h"
 
 namespace Titanic {
 
@@ -72,6 +73,21 @@ public:
 	 * Allows the item to draw itself
 	 */
 	void draw(CScreenManager *screenManager);
+
+	/**
+	 * Handles mouse down messages
+	 */
+	void MouseButtonDownMsg(int unused, const Point &pt);
+
+	/**
+	 * Handles mouse move messages
+	 */
+	void MouseMoveMsg(int unused, const Point &pt);
+
+	/**
+	 * Handles keyboard messages
+	 */
+	CErrorCode KeyCharMsg(int key);
 };
 
 } // End of namespace Titanic


Commit: 2ff4d3ed66bd839fb3534429a645291b8ccbec67
    https://github.com/scummvm/scummvm/commit/2ff4d3ed66bd839fb3534429a645291b8ccbec67
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:26:40-04:00

Commit Message:
TITANIC: Adding starfield points loading

Changed paths:
  A engines/titanic/star_control/star_array.cpp
  A engines/titanic/star_control/star_array.h
  R engines/titanic/star_control/star_control_sub10.cpp
  R engines/titanic/star_control/star_control_sub10.h
    devtools/create_titanic/create_titanic_dat.cpp
    engines/titanic/module.mk
    engines/titanic/star_control/star_control_sub1.cpp
    engines/titanic/star_control/star_control_sub1.h



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 09a4b4c..be58deb 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -52,7 +52,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x640
+#define HEADER_SIZE 0x680
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -422,6 +422,18 @@ void writeSentenceMappings(const char *name, uint offset, int numValues) {
 	dataOffset += size;
 }
 
+
+void writeStarfieldPoints() {
+	outputFile.seek(dataOffset);
+
+	inputFile.seek(0x59DE4C - FILE_DIFF);
+	uint size = 876 * 12;
+
+	outputFile.write(inputFile, size);
+	writeEntryHeader("STARFIELD/POINTS", dataOffset, size);
+	dataOffset += size;
+}
+
 void writeHeader() {
 	// Write out magic string
 	const char *MAGIC_STR = "SVTN";
@@ -451,6 +463,7 @@ void writeData() {
 	writeResource("STFONT", 153);
 
 	writeResource("STARFIELD", 132);
+	writeStarfieldPoints();
 
 	writeResource("TEXT", "STVOCAB.TXT");
 	writeResource("TEXT", "JRQUOTES.TXT");
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 79f55d4..f1392f1 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -420,13 +420,13 @@ MODULE_OBJS := \
 	star_control/star_control_sub1.o \
 	star_control/star_control_sub2.o \
 	star_control/base_star.o \
+	star_control/star_array.o \
 	star_control/star_control_sub4.o \
 	star_control/star_control_sub5.o \
 	star_control/star_control_sub6.o \
 	star_control/star_control_sub7.o \
 	star_control/star_control_sub8.o \
 	star_control/star_control_sub9.o \
-	star_control/star_control_sub10.o \
 	star_control/star_view.o \
 	star_control/star_control_sub12.o \
 	star_control/star_control_sub13.o \
diff --git a/engines/titanic/star_control/star_array.cpp b/engines/titanic/star_control/star_array.cpp
new file mode 100644
index 0000000..1af608d
--- /dev/null
+++ b/engines/titanic/star_control/star_array.cpp
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_array.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+#define ARRAY_COUNT 876
+
+CStarArray::CStarArray() {
+}
+
+void CStarArray::initialize() {
+	// Get a reference to the starfield points resource
+	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource("STARFIELD/POINTS");
+	assert(stream && stream->size() == (12 * ARRAY_COUNT));
+
+	_data.resize(ARRAY_COUNT);
+	for (int idx = 0; idx < ARRAY_COUNT; ++idx) {
+		// Get the next set of values
+		int v1 = stream->readUint32LE();
+		int v2 = stream->readUint32LE();
+		stream->readUint32LE();
+
+		// Pre-process them
+		// TODO
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_array.h b/engines/titanic/star_control/star_array.h
new file mode 100644
index 0000000..859db60
--- /dev/null
+++ b/engines/titanic/star_control/star_array.h
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_ARRAY_H
+#define TITANIC_STAR_ARRAY_H
+
+#include "common/array.h"
+
+namespace Titanic {
+
+class CStarArray {
+	struct CStarArrayEntry {
+		double _v1;
+		double _v2;
+		double _v3;
+	};
+private:
+	Common::Array<CStarArrayEntry> _data;
+public:
+	CStarArray();
+
+	/**
+	 * Initialize the array
+	 */
+	void initialize();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_ARRAY_H */
diff --git a/engines/titanic/star_control/star_control_sub1.cpp b/engines/titanic/star_control/star_control_sub1.cpp
index 6adc9a6..5edbab1 100644
--- a/engines/titanic/star_control/star_control_sub1.cpp
+++ b/engines/titanic/star_control/star_control_sub1.cpp
@@ -43,6 +43,7 @@ void CStarControlSub1::load(SimpleFile *file, int param) {
 
 bool CStarControlSub1::initDocument() {
 	warning("CStarControlSub1::initDocument");
+	_starArray.initialize();
 	return true;
 }
 
diff --git a/engines/titanic/star_control/star_control_sub1.h b/engines/titanic/star_control/star_control_sub1.h
index 2e76a1f..0e99b4e 100644
--- a/engines/titanic/star_control/star_control_sub1.h
+++ b/engines/titanic/star_control/star_control_sub1.h
@@ -23,12 +23,12 @@
 #ifndef TITANIC_STAR_CONTROL_SUB1_H
 #define TITANIC_STAR_CONTROL_SUB1_H
 
+#include "titanic/star_control/star_array.h"
 #include "titanic/star_control/star_control_sub2.h"
 #include "titanic/star_control/star_control_sub5.h"
 #include "titanic/star_control/star_control_sub7.h"
 #include "titanic/star_control/star_control_sub8.h"
 #include "titanic/star_control/star_control_sub9.h"
-#include "titanic/star_control/star_control_sub10.h"
 
 namespace Titanic {
 
@@ -37,7 +37,7 @@ private:
 	CStarControlSub7 _sub7;
 	CStarControlSub8 _sub8;
 	CStarControlSub9 _sub9;
-	CStarControlSub10 _sub10;
+	CStarArray _starArray;
 	CStarControlSub5 _sub5;
 	int _field7DA8;
 	int _field7DAC;
diff --git a/engines/titanic/star_control/star_control_sub10.cpp b/engines/titanic/star_control/star_control_sub10.cpp
deleted file mode 100644
index ca32f5e..0000000
--- a/engines/titanic/star_control/star_control_sub10.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/star_control/star_control_sub10.h"
-
-namespace Titanic {
-
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub10.h b/engines/titanic/star_control/star_control_sub10.h
deleted file mode 100644
index af4ad17..0000000
--- a/engines/titanic/star_control/star_control_sub10.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_CONTROL_SUB10_H
-#define TITANIC_STAR_CONTROL_SUB10_H
-
-namespace Titanic {
-
-class CStarControlSub10 {
-private:
-	int _field0;
-	int _field4;
-public:
-	CStarControlSub10() : _field0(0), _field4(0) {}
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_SUB10_H */


Commit: 82c0be2bc525e87b1be0f59c88a93ebd0ae2e189
    https://github.com/scummvm/scummvm/commit/82c0be2bc525e87b1be0f59c88a93ebd0ae2e189
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:26:56-04:00

Commit Message:
DEVTOOLS: Add second starfield points array to create_titanic

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index be58deb..2ea8f2a 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -422,7 +422,6 @@ void writeSentenceMappings(const char *name, uint offset, int numValues) {
 	dataOffset += size;
 }
 
-
 void writeStarfieldPoints() {
 	outputFile.seek(dataOffset);
 
@@ -434,6 +433,25 @@ void writeStarfieldPoints() {
 	dataOffset += size;
 }
 
+void writeStarfieldPoints2() {
+	outputFile.seek(dataOffset);
+
+	for (int rootCtr = 0; rootCtr < 80; ++rootCtr) {
+		inputFile.seek(0x5A2F28 - FILE_DIFF + rootCtr * 8);
+		uint offset = inputFile.readUint32LE();
+		uint count = inputFile.readUint32LE();
+
+		outputFile.writeLong(count);
+		inputFile.seek(offset - FILE_DIFF);
+		outputFile.write(inputFile, count * 4 * 4);
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	outputFile.write(inputFile, size);
+	writeEntryHeader("STARFIELD/POINTS2", dataOffset, size);
+	dataOffset += size;
+}
+
 void writeHeader() {
 	// Write out magic string
 	const char *MAGIC_STR = "SVTN";
@@ -464,6 +482,7 @@ void writeData() {
 
 	writeResource("STARFIELD", 132);
 	writeStarfieldPoints();
+	writeStarfieldPoints2();
 
 	writeResource("TEXT", "STVOCAB.TXT");
 	writeResource("TEXT", "JRQUOTES.TXT");


Commit: 4840e3e86b9d710f255b7e6faefdf8dc9ec8aecc
    https://github.com/scummvm/scummvm/commit/4840e3e86b9d710f255b7e6faefdf8dc9ec8aecc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:26:59-04:00

Commit Message:
TITANIC: In-progress loading of second starfield points array

Changed paths:
    engines/titanic/star_control/star_array.cpp
    engines/titanic/star_control/star_array.h
    engines/titanic/star_control/star_control_sub1.cpp
    engines/titanic/star_control/star_control_sub9.cpp
    engines/titanic/star_control/star_control_sub9.h



diff --git a/engines/titanic/star_control/star_array.cpp b/engines/titanic/star_control/star_array.cpp
index 1af608d..f25d837 100644
--- a/engines/titanic/star_control/star_array.cpp
+++ b/engines/titanic/star_control/star_array.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/star_control/star_array.h"
+#include "titanic/star_control/star_control_sub12.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
@@ -47,4 +48,8 @@ void CStarArray::initialize() {
 	}
 }
 
+void CStarArray::draw(CSurfaceArea *surface, CStarControlSub12 *img) {
+	// TODO
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_array.h b/engines/titanic/star_control/star_array.h
index 859db60..827af01 100644
--- a/engines/titanic/star_control/star_array.h
+++ b/engines/titanic/star_control/star_array.h
@@ -24,9 +24,12 @@
 #define TITANIC_STAR_ARRAY_H
 
 #include "common/array.h"
+#include "titanic/star_control/surface_area.h"
 
 namespace Titanic {
 
+class CStarControlSub12;
+
 class CStarArray {
 	struct CStarArrayEntry {
 		double _v1;
@@ -42,6 +45,11 @@ public:
 	 * Initialize the array
 	 */
 	void initialize();
+
+	/**
+	 * Draw the starfield points
+	 */
+	void draw(CSurfaceArea *surface, CStarControlSub12 *img);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub1.cpp b/engines/titanic/star_control/star_control_sub1.cpp
index 5edbab1..75dc230 100644
--- a/engines/titanic/star_control/star_control_sub1.cpp
+++ b/engines/titanic/star_control/star_control_sub1.cpp
@@ -44,6 +44,7 @@ void CStarControlSub1::load(SimpleFile *file, int param) {
 bool CStarControlSub1::initDocument() {
 	warning("CStarControlSub1::initDocument");
 	_starArray.initialize();
+	_sub9.initialize();
 	return true;
 }
 
diff --git a/engines/titanic/star_control/star_control_sub9.cpp b/engines/titanic/star_control/star_control_sub9.cpp
index 92ce8f6..be06e46 100644
--- a/engines/titanic/star_control/star_control_sub9.cpp
+++ b/engines/titanic/star_control/star_control_sub9.cpp
@@ -21,8 +21,33 @@
  */
 
 #include "titanic/star_control/star_control_sub9.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
+#define ARRAY_COUNT 80
+
+void CStarControlSub9::initialize() {
+	// Get a reference to the starfield points resource
+	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource("STARFIELD/POINTS2");
+
+	_data.resize(ARRAY_COUNT);
+	for (int rootCtr = 0; rootCtr < ARRAY_COUNT; ++rootCtr) {
+		// Get the number of sub-entries for this entry
+		int count = stream->readUint32LE();
+
+		// Read in the sub-entries
+		RootEntry &rootEntry = _data[rootCtr];
+		rootEntry.resize(count);
+		for (int idx = 0; idx < count; ++idx) {
+			int v1 = stream->readSint32LE();
+			int v2 = stream->readSint32LE();
+			int v3 = stream->readSint32LE();
+			int v4 = stream->readSint32LE();
+
+			// TODO: Processing here
+		}
+	}
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub9.h b/engines/titanic/star_control/star_control_sub9.h
index 67a14a5..ad05a4a 100644
--- a/engines/titanic/star_control/star_control_sub9.h
+++ b/engines/titanic/star_control/star_control_sub9.h
@@ -23,18 +23,30 @@
 #ifndef TITANIC_STAR_CONTROL_SUB9_H
 #define TITANIC_STAR_CONTROL_SUB9_H
 
+#include "common/array.h"
+
 namespace Titanic {
 
 class CStarControlSub9 {
-	struct ArrayEntry {
+	struct DataEntry {
+		int _v1;
+		int _v2;
+		int _v3;
+		int _v4;
+	};
+
+	class RootEntry : public Common::Array<DataEntry> {
+	public:
 		int _field0;
-		int _field4;
-		int _field8;
-		ArrayEntry() : _field0(0), _field4(0), _field8(0) {}
+		RootEntry() : _field0(0) {}
 	};
 private:
-	ArrayEntry _array[80];
+	Common::Array<RootEntry> _data;
 public:
+	/**
+	 * Initializes the data
+	 */
+	void initialize();
 };
 
 } // End of namespace Titanic


Commit: d9e05e215c1ba8ab93530e7263b527c03fcc61c8
    https://github.com/scummvm/scummvm/commit/d9e05e215c1ba8ab93530e7263b527c03fcc61c8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:02-04:00

Commit Message:
TITANIC: Fleshing out screen manager

Changed paths:
    engines/titanic/support/screen_manager.cpp
    engines/titanic/support/screen_manager.h



diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp
index 27c0d98..d795f78 100644
--- a/engines/titanic/support/screen_manager.cpp
+++ b/engines/titanic/support/screen_manager.cpp
@@ -130,8 +130,15 @@ DirectDrawSurface *OSScreenManager::getDDSurface(SurfaceNum surfaceNum) {
 		return nullptr;
 }
 
-void OSScreenManager::proc6() {}
-void OSScreenManager::proc7() {}
+CVideoSurface *OSScreenManager::lockSurface(SurfaceNum surfaceNum) {
+	CVideoSurface *surface = getSurface(surfaceNum);
+	surface->lock();
+	return surface;
+}
+
+void OSScreenManager::unlockSurface(CVideoSurface *surface) {
+	surface->unlock();
+}
 
 CVideoSurface *OSScreenManager::getSurface(SurfaceNum surfaceNum) const {
 	if (surfaceNum == SURFACE_PRIMARY)
@@ -233,7 +240,11 @@ int OSScreenManager::writeString(int surfaceNum, const Rect &destRect,
 		yOffset, str, textCursor);
 }
 
-void OSScreenManager::proc14() {}
+int OSScreenManager::writeString(int surfaceNum, const Rect &srcRect,
+		const Rect &destRect, const CString &str, CTextCursor *textCursor) {
+	// TODO
+	return 0;
+}
 
 void OSScreenManager::setFontColor(byte r, byte g, byte b) {
 	_fonts[_fontNumber].setColor(r, g, b);
@@ -251,7 +262,15 @@ int OSScreenManager::stringWidth(const CString &str) {
 	return _fonts[_fontNumber].stringWidth(str);
 }
 
-void OSScreenManager::proc19() {}
+void OSScreenManager::frameRect(SurfaceNum surfaceNum, const Rect &rect, byte r, byte g, byte b) {
+	Rect top(rect.left, rect.top, rect.right, rect.top + 1);
+	fillRect(surfaceNum, &top, r, g, b);
+	Rect bottom(rect.left, rect.bottom - 1, rect.right, rect.bottom);
+	fillRect(surfaceNum, &bottom, r, g, b);
+	Rect left(rect.left, rect.top, rect.left + 1, rect.bottom);
+	fillRect(surfaceNum, &left, r, g, b);
+	Rect right(rect.right - 1, rect.top, rect.right, rect.bottom);
+}
 
 void OSScreenManager::clearSurface(SurfaceNum surfaceNum, Rect *bounds) {
 	if (surfaceNum == SURFACE_PRIMARY)
@@ -274,16 +293,12 @@ CVideoSurface *OSScreenManager::createSurface(const CResourceKey &key) {
 	return new OSVideoSurface(this, key);
 }
 
-void OSScreenManager::proc23() {}
-void OSScreenManager::proc24() {}
-void OSScreenManager::proc25() {}
-
 void OSScreenManager::showCursor() {
-
+	CScreenManager::_screenManagerPtr->_mouseCursor->show();
 }
 
 void OSScreenManager::hideCursor() {
-
+	CScreenManager::_screenManagerPtr->_mouseCursor->hide();
 }
 
 void OSScreenManager::destroyFrontAndBackBuffers() {
diff --git a/engines/titanic/support/screen_manager.h b/engines/titanic/support/screen_manager.h
index 21b40ca..0736f13 100644
--- a/engines/titanic/support/screen_manager.h
+++ b/engines/titanic/support/screen_manager.h
@@ -89,8 +89,19 @@ public:
 	 */
 	virtual void drawCursors() = 0;
 	
-	virtual void proc6() = 0;
-	virtual void proc7() = 0;
+	/**
+	 * Locks a specified surface number for access and returns a pointer to it
+	 */
+	virtual CVideoSurface *lockSurface(SurfaceNum surfaceNum) = 0;
+	
+	/**
+	 * Unlocks a previously locked surface
+	 */
+	virtual void unlockSurface(CVideoSurface *surface) = 0;
+	
+	/**
+	 * Gets a specified surface number
+	 */
 	virtual CVideoSurface *getSurface(SurfaceNum surfaceNum) const = 0;
 
 	/**
@@ -126,7 +137,16 @@ public:
 	virtual int writeString(int surfaceNum, const Rect &destRect,
 		int yOffset, const CString &str, CTextCursor *textCursor) = 0;
 
-	virtual void proc14() = 0;
+	/**
+	 * Write a string
+	 * @param surfaceNum	Destination surface
+	 * @param srcRect		Drawing area
+	 * @param destRect		Bounds of dest surface
+	 * @param str			Line or lines to write
+	 * @param textCursor	Optional text cursor pointer
+	 */
+	virtual int writeString(int surfaceNum, const Rect &srcRect,
+		const Rect &destRect, const CString &str, CTextCursor *textCursor) = 0;
 
 	/**
 	 * Set the font color
@@ -152,7 +172,10 @@ public:
 	 */
 	virtual int stringWidth(const CString &str) = 0;
 
-	virtual void proc19() = 0;
+	/**
+	 * Draws a frame enclosing the specified area
+	 */
+	virtual void frameRect(SurfaceNum surfaceNum, const Rect &rect, byte r, byte g, byte b) = 0;
 
 	/**
 	 * Clear a portion of a specified surface
@@ -173,10 +196,27 @@ public:
 	 * Creates a surface from a specified resource
 	 */
 	virtual CVideoSurface *createSurface(const CResourceKey &key) = 0;
-	
-	virtual void proc24() = 0;
-	virtual void proc25() = 0;
+
+	/**
+	* Get the top-left corner of the screen in global screen co-ordinates
+	* For ScummVM, this is always (0, 0), even in Windowed mode
+	*/
+	virtual Point getScreenTopLeft() { return Point(0, 0); }
+
+	/**
+	 * Waits for a vertical screen sync
+	 * For ScummVM, this can be safely ignored
+	 */
+	virtual void waitForVSync() {}
+
+	/**
+	 * Show the mouse cursor
+	 */
 	virtual void showCursor() = 0;
+	
+	/**
+	 * Hide the mouse cursor
+	 */
 	virtual void hideCursor() = 0;
 
 	/**
@@ -228,8 +268,19 @@ public:
 	 */
 	virtual void drawCursors();
 
-	virtual void proc6();
-	virtual void proc7();
+	/**
+	 * Locks a specified surface number for access and returns a pointer to it
+	 */
+	virtual CVideoSurface *lockSurface(SurfaceNum surfaceNum);
+	
+	/**
+	 * Unlocks a previously locked surface
+	 */
+	virtual void unlockSurface(CVideoSurface *surface);
+	
+	/**
+	 * Gets a specified surface number
+	 */
 	virtual CVideoSurface *getSurface(SurfaceNum surfaceNum) const;
 
 	/**
@@ -268,7 +319,16 @@ public:
 	virtual int writeString(int surfaceNum, const Rect &destRect,
 		int yOffset, const CString &str, CTextCursor *textCursor);
 
-	virtual void proc14();
+	/**
+	 * Write a string
+	 * @param surfaceNum	Destination surface
+	 * @param srcRect		Drawing area
+	 * @param destRect		Bounds of dest surface
+	 * @param str			Line or lines to write
+	 * @param textCursor	Optional text cursor pointer
+	 */
+	virtual int writeString(int surfaceNum, const Rect &srcRect,
+		const Rect &destRect, const CString &str, CTextCursor *textCursor);
 
 	/**
 	 * Set the font color
@@ -294,7 +354,10 @@ public:
 	 */
 	virtual int stringWidth(const CString &str);
 
-	virtual void proc19();
+	/**
+	 * Draws a frame enclosing the specified area
+	 */
+	virtual void frameRect(SurfaceNum surfaceNum, const Rect &rect, byte r, byte g, byte b);
 
 	/**
 	 * Clear a portion of the screen surface
@@ -316,10 +379,14 @@ public:
 	 */
 	virtual CVideoSurface *createSurface(const CResourceKey &key);
 
-	virtual void proc23();
-	virtual void proc24();
-	virtual void proc25();
+	/**
+	 * Show the mouse cursor
+	 */
 	virtual void showCursor();
+	
+	/**
+	 * Hide the mouse cursor
+	 */
 	virtual void hideCursor();
 };
 


Commit: 5ab33f117a0bc3451a1d30024208c45a2a548a4b
    https://github.com/scummvm/scummvm/commit/5ab33f117a0bc3451a1d30024208c45a2a548a4b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:06-04:00

Commit Message:
TITANIC: Adding more video surface methods

Changed paths:
    engines/titanic/support/image_decoders.cpp
    engines/titanic/support/movie.cpp
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/support/image_decoders.cpp b/engines/titanic/support/image_decoders.cpp
index 9fe55eb..4203dad 100644
--- a/engines/titanic/support/image_decoders.cpp
+++ b/engines/titanic/support/image_decoders.cpp
@@ -36,7 +36,7 @@ void CJPEGDecode::decode(OSVideoSurface &surface, const CString &name) {
 	// Resize the surface if necessary
 	if (!surface.hasSurface() || surface.getWidth() != srcSurf->w 
 			|| surface.getHeight() != srcSurf->h)
-		surface.resize(srcSurf->w, srcSurf->h);
+		surface.recreate(srcSurf->w, srcSurf->h);
 
 	// Convert the decoded surface to the correct pixel format, and then copy it over
 	surface.lock();
@@ -63,7 +63,7 @@ void CTargaDecode::decode(OSVideoSurface &surface, const CString &name) {
 	// Resize the surface if necessary
 	if (!surface.hasSurface() || surface.getWidth() != srcSurf->w
 			|| surface.getHeight() != srcSurf->h)
-		surface.resize(srcSurf->w, srcSurf->h);
+		surface.recreate(srcSurf->w, srcSurf->h);
 
 	// Convert the decoded surface to the correct pixel format, and then copy it over
 	surface.lock();
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 361bf6e..9b6fd01 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -175,7 +175,7 @@ void OSMovie::decodeFrame() {
 
 	// If the video surface doesn't yet have an underlying surface, create it
 	if (!videoSurface->hasSurface())
-		videoSurface->resize(frame->w, frame->h);
+		videoSurface->recreate(frame->w, frame->h);
 
 	// Lock access to the surface
 	videoSurface->lock();
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 9293b03..e71b251 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -296,7 +296,14 @@ int OSVideoSurface::getPitch() {
 	return _ddSurface->getPitch();
 }
 
-void OSVideoSurface::resize(int width, int height) {
+int OSVideoSurface::getBpp() {
+	if (!loadIfReady())
+		error("Could not load resource");
+
+	return getPixelDepth();
+}
+
+void OSVideoSurface::recreate(int width, int height) {
 	freeSurface();
 
 	_screenManager->resizeSurface(this, width, height);
@@ -304,9 +311,19 @@ void OSVideoSurface::resize(int width, int height) {
 		_videoSurfaceCounter += _ddSurface->getSize();
 }
 
+void OSVideoSurface::resize(int width, int height) {
+	if (!_ddSurface || _ddSurface->getWidth() != width || 
+			_ddSurface->getHeight() != height)
+		recreate(width, height);
+}
+
+void OSVideoSurface::detachSurface() {
+	_ddSurface = nullptr;
+}
+
 int OSVideoSurface::getPixelDepth() {
 	if (!loadIfReady())
-		assert(0);
+		error("Could not load resource");
 
 	lock();
 	
@@ -360,6 +377,13 @@ uint16 OSVideoSurface::getPixel(const Common::Point &pt) {
 	}
 }
 
+void OSVideoSurface::setPixel(const Point &pt, uint pixel) {
+	assert(getPixelDepth() == 2);
+
+	uint16 *pixelP = (uint16 *)_rawSurface->getBasePtr(pt.x, pt.y);
+	*pixelP = pixel;
+}
+
 void OSVideoSurface::changePixel(uint16 *pixelP, uint16 *color, byte srcVal, bool remapFlag) {
 	assert(getPixelDepth() == 2);
 	const Graphics::PixelFormat &destFormat = _ddSurface->getFormat();
@@ -391,9 +415,17 @@ void OSVideoSurface::shiftColors() {
 	// we already convert 16-bit surfaces as soon as they're loaded
 }
 
+void OSVideoSurface::clear() {
+	if (!loadIfReady())
+		error("Could not load resource");
+
+}
+
 void OSVideoSurface::playMovie(uint flags, CVideoSurface *surface) {
 	if (loadIfReady() && _movie)
 		_movie->play(flags, surface);
+
+	_ddSurface->fill(nullptr, 0);
 }
 
 void OSVideoSurface::playMovie(uint startFrame, uint endFrame, int v3, bool v4) {
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index e5d904f..9b7e0fb 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -129,13 +129,28 @@ public:
 	 * Returns the pitch of the surface in bytes
 	 */
 	virtual int getPitch() = 0;
-	
+
+	/**
+	 * Returns the bytes per pixel of the surface
+	 */
+	virtual int getBpp() = 0;
+
 	/**
-	 * Reiszes the surface
+	 * Recreates the surface
+	 */
+	virtual void recreate(int width, int height) = 0;
+
+	/**
+	 * Resizes the surface
 	 */
 	virtual void resize(int width, int height) = 0;
 
 	/**
+	 * Detachs the underlying raw surface
+	 */
+	virtual void detachSurface() = 0;
+
+	/**
 	 * Returns the number of bytes per pixel in the surface
 	 */
 	virtual int getPixelDepth() = 0;
@@ -145,6 +160,12 @@ public:
 	 */
 	virtual uint16 getPixel(const Common::Point &pt) = 0;
 
+
+	/**
+	 * Sets a pixel at a specified position within the surface
+	 */
+	virtual void setPixel(const Point &pt, uint pixel) = 0;
+
 	/**
 	 * Change a pixel
 	 */
@@ -156,6 +177,11 @@ public:
 	virtual void shiftColors() = 0;
 
 	/**
+	 * Clears the entire surface to black
+	 */
+	virtual void clear() = 0;
+
+	/**
 	 * Plays a movie, loading it from the specified _resource
 	 * if not already loaded
 	 */
@@ -305,11 +331,26 @@ public:
 	virtual int getPitch();
 
 	/**
-	 * Reiszes the surface
+	 * Returns the bytes per pixel of the surface
+	 */
+	virtual int getBpp();
+
+	/**
+	 * Recreates the surface with the designated size
+	 */
+	virtual void recreate(int width, int height);
+
+	/**
+	 * Resizes the surface
 	 */
 	virtual void resize(int width, int height);
 
 	/**
+	 * Detachs the underlying raw surface
+	 */
+	virtual void detachSurface();
+
+	/**
 	 * Returns the number of bytes per pixel in the surface
 	 */
 	virtual int getPixelDepth();
@@ -317,7 +358,12 @@ public:
 	/**
 	 * Gets the pixel at the specified position within the surface
 	 */
-	virtual uint16 getPixel(const Common::Point &pt);
+	virtual uint16 getPixel(const Point &pt);
+
+	/**
+	 * Sets a pixel at a specified position within the surface
+	 */
+	virtual void setPixel(const Point &pt, uint pixel);
 
 	/**
 	 * Change a pixel
@@ -330,6 +376,11 @@ public:
 	virtual void shiftColors();
 
 	/**
+	 * Clears the entire surface to black
+	 */
+	virtual void clear();
+
+	/**
 	 * Plays a movie, loading it from the specified _resource
 	 * if not already loaded
 	 */


Commit: 3f12927b77735c17eedfbe14f36607ddc6580c83
    https://github.com/scummvm/scummvm/commit/3f12927b77735c17eedfbe14f36607ddc6580c83
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:09-04:00

Commit Message:
TITANIC: Added CVideoSurface transPixelate

Changed paths:
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index e71b251..85a1aa1 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -476,6 +476,34 @@ bool OSVideoSurface::loadIfReady() {
 	}
 }
 
+void OSVideoSurface::transPixelate() {
+	if (!loadIfReady())
+		return;
+
+	lock();
+	Graphics::ManagedSurface *surface = _rawSurface;
+	uint transColor = getTransparencyColor();
+	// TODO: Check whether color is correct
+	uint pixelColor = surface->format.RGBToColor(0x50, 0, 0);
+
+	for (int yp = 0; yp < surface->h; ++yp) {
+		uint16 *pixelsP = (uint16 *)surface->getBasePtr(0, yp);
+		bool bitFlag = (yp % 2) == 0;
+		int replaceCtr = yp & 3;
+
+		for (int xp = 0; xp < surface->w; ++xp, ++pixelsP) {
+			if (bitFlag && *pixelsP == transColor && replaceCtr == 0)
+				*pixelsP = pixelColor;
+
+			bitFlag = !bitFlag;
+			replaceCtr = (replaceCtr + 1) & 3;
+		}
+	}
+
+	surface->markAllDirty();
+	unlock();
+}
+
 int OSVideoSurface::freeSurface() {
 	if (!_ddSurface)
 		return 0;
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 9b7e0fb..45c6182 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -224,6 +224,12 @@ public:
 	 */
 	virtual bool load() = 0;
 
+	/**
+	 * Does a replacement of transparent pixels on certain lines at regular
+	 * intervals. This is totally weird
+	 */
+	virtual void transPixelate() = 0;
+
 	virtual bool proc45();
 
 	/**
@@ -424,6 +430,12 @@ public:
 	virtual bool load();
 
 	/**
+	 * Does a replacement of transparent pixels on certain lines at regular
+	 * intervals. This is totally weird
+	 */
+	virtual void transPixelate();
+
+	/**
 	 * Frees the underlying surface
 	 */
 	virtual int freeSurface();


Commit: fb06cb4dde4d612289ea1b5830f8cd1c9e1bedfc
    https://github.com/scummvm/scummvm/commit/fb06cb4dde4d612289ea1b5830f8cd1c9e1bedfc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:13-04:00

Commit Message:
TITANIC: Added CMovieManager class

Changed paths:
  A engines/titanic/support/movie_manager.cpp
  A engines/titanic/support/movie_manager.h
    engines/titanic/game_manager.cpp
    engines/titanic/game_state.cpp
    engines/titanic/module.mk
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index c5f0f11..7e8531f 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -128,7 +128,7 @@ void CGameManager::roomTransition(CRoomItem *oldRoom, CRoomItem *newRoom) {
 	CString filename = movieKey.exists();
 	if (g_vm->_filesManager->fileExists(filename)) {
 		_movieSurface->freeSurface();
-		_movie = new OSMovie(filename, _movieSurface);
+		_movie = g_vm->_movieManager.createMovie(filename, _movieSurface);
 	}
 }
 
@@ -194,8 +194,8 @@ void CGameManager::update() {
 void CGameManager::updateMovies() {
 	// TODO: Make this more like the original, if I can figuring out
 	// what's it doing with temporary lists and the OSMovie methods
-	for (CMovieList::iterator i = g_vm->_activeMovies.begin();
-			i != g_vm->_activeMovies.end(); ) {
+	for (CMovieList::iterator i = CMovie::_activeMovies->begin();
+			i != CMovie::_activeMovies->end(); ) {
 		OSMovie *movie = static_cast<OSMovie *>(*i);
 		assert(movie && movie->_gameObject);
 
@@ -205,7 +205,8 @@ void CGameManager::updateMovies() {
 			CMovieEndMsg endMsg;
 			endMsg.execute(movie->_gameObject);
 
-			i = g_vm->_activeMovies.erase(i);
+			i = CMovie::_activeMovies->erase(i);
+			delete movie;
 			continue;
 		}
 
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index d129767..6c81bc8 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -28,17 +28,8 @@
 namespace Titanic {
 
 bool CGameStateMovieList::clear() {
-	for (iterator i = begin(); i != end(); ) {
-		CMovieListItem *listItem = *i;
-		++i;
-
-		if (!g_vm->_activeMovies.contains(listItem->_item)) {
-			remove(listItem);
-			delete listItem;
-		}
-	}
-
-	return size() > 0;
+	// TODO
+	return false;
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index f1392f1..71db594 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -448,6 +448,7 @@ MODULE_OBJS := \
 	support/movie_clip.o \
 	support/movie_event.o \
 	support/movie_range_info.o \
+	support/movie_manager.o \
 	support/credit_text.o \
 	support/proximity.o \
 	support/rect.o \
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 9b6fd01..869a351 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -26,16 +26,35 @@
 
 namespace Titanic {
 
+CMovieList *CMovie::_activeMovies;
+
 CMovie::CMovie() : ListItem(), _state(MOVIE_STOPPED), _field10(0),
 		_field14(0) {
 }
 
 CMovie::~CMovie() {
-	g_vm->_activeMovies.remove(this);
+	removeFromActiveMovies();
+}
+
+void CMovie::init() {
+	_activeMovies = new CMovieList();
+}
+
+void CMovie::deinit() {
+	delete _activeMovies;
+}
+
+void CMovie::addToActiveMovies() {
+	if (!isActive())
+		_activeMovies->push_back(this);
+}
+
+void CMovie::removeFromActiveMovies() {
+	_activeMovies->remove(this);
 }
 
 bool CMovie::isActive() const {
-	return g_vm->_activeMovies.contains(this);
+	return _activeMovies->contains(this);
 }
 
 bool CMovie::get10() {
@@ -67,7 +86,6 @@ OSMovie::OSMovie(Common::SeekableReadStream *stream, CVideoSurface *surface) :
 }
 
 OSMovie::~OSMovie() {
-	g_vm->_activeMovies.remove(this);
 	delete _video;
 }
 
@@ -83,7 +101,7 @@ void OSMovie::play(uint startFrame, uint endFrame, int v3, bool v4) {
 	_video->seekToFrame(startFrame);
 	_endFrame = endFrame;
 
-	g_vm->_activeMovies.push_back(this);
+	addToActiveMovies();
 	_state = MOVIE_NONE;
 }
 
@@ -126,7 +144,10 @@ const Common::List<CMovieRangeInfo *> OSMovie::getMovieRangeInfo() const {
 	return Common::List<CMovieRangeInfo *>();
 }
 
-void OSMovie::proc18() {
+void OSMovie::proc18(int v) {
+//	if (_aviSurface)
+//		_aviSurface->_field3C = 0;
+
 	warning("TODO: OSMovie::proc18");
 }
 
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index 2d7bdc9..fbbfebc 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -47,9 +47,31 @@ class CMovie : public ListItem {
 protected:
 	MovieState _state;
 	int _field10;
+protected:
+	/**
+	 * Adds the movie to the active movies list
+	 */
+	void addToActiveMovies();
+
+	/**
+	 * Removes the movie from the active movies list
+	 */
+	void removeFromActiveMovies();
 public:
 	int _field14;
 public:
+	static CMovieList *_activeMovies;
+
+	/**
+	 * Initializes statics
+	 */
+	static void init();
+
+	/**
+	 * Deinitializes statics
+	 */
+	static void deinit();
+public:
 	CMovie();
 	virtual ~CMovie();
 
@@ -90,7 +112,7 @@ public:
 	 */
 	virtual const Common::List<CMovieRangeInfo *> getMovieRangeInfo() const = 0;
 
-	virtual void proc18() = 0;
+	virtual void proc18(int v) = 0;
 
 	/**
 	 * Get the current movie frame
@@ -167,7 +189,7 @@ public:
 	 */
 	virtual const Common::List<CMovieRangeInfo *> getMovieRangeInfo() const;
 
-	virtual void proc18();
+	virtual void proc18(int v);
 
 	/**
 	 * Get the current movie frame
diff --git a/engines/titanic/support/movie_manager.cpp b/engines/titanic/support/movie_manager.cpp
new file mode 100644
index 0000000..e3330f0
--- /dev/null
+++ b/engines/titanic/support/movie_manager.cpp
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/movie_manager.h"
+#include "titanic/support/movie.h"
+#include "titanic/support/video_surface.h"
+
+namespace Titanic {
+
+CMovie *CMovieManager::createMovie(const CResourceKey &key, CVideoSurface *surface) {
+	CMovie *movie = new OSMovie(key, surface);
+	movie->proc18(_field4);
+	return movie;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/movie_manager.h b/engines/titanic/support/movie_manager.h
new file mode 100644
index 0000000..91ea75e
--- /dev/null
+++ b/engines/titanic/support/movie_manager.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVIE_MANAGER_H
+#define TITANIC_MOVIE_MANAGER_H
+
+#include "titanic/core/list.h"
+#include "titanic/core/resource_key.h"
+
+namespace Titanic {
+
+class CMovie;
+class CVideoSurface;
+
+class CMovieManagerBase {
+public:
+	virtual ~CMovieManagerBase() {}
+
+	virtual CMovie *createMovie(const CResourceKey &key, CVideoSurface *surface) = 0;
+};
+
+class CMovieManager : public CMovieManagerBase {
+private:
+	int _field4;
+public:
+	CMovieManager() : CMovieManagerBase(), _field4(0) {}
+	virtual ~CMovieManager() {}
+
+	virtual CMovie *createMovie(const CResourceKey &key, CVideoSurface *surface);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVIE_MANAGER_H */
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 85a1aa1..0335e7d 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -23,6 +23,7 @@
 #include "titanic/support/video_surface.h"
 #include "titanic/support/image_decoders.h"
 #include "titanic/support/screen_manager.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -234,6 +235,11 @@ void OSVideoSurface::loadJPEG(const CResourceKey &key) {
 	_resourceKey = key;
 }
 
+void OSVideoSurface::loadTarga(const CString &name) {
+	CResourceKey key(name);
+	loadTarga(key);
+}
+
 void OSVideoSurface::loadMovie(const CResourceKey &key, bool destroyFlag) {
 	// Delete any prior movie
 	if (_movie) {
@@ -242,7 +248,7 @@ void OSVideoSurface::loadMovie(const CResourceKey &key, bool destroyFlag) {
 	}
 
 	// Create the new movie and load the first frame to the video surface
-	_movie = new OSMovie(key, this);
+	_movie = g_vm->_movieManager.createMovie(key, this);
 	_movie->setFrame(0);
 
 	// If flagged to destroy, then immediately destroy movie instance
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 45c6182..37afccf 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -94,6 +94,11 @@ public:
 	virtual void loadJPEG(const CResourceKey &key) = 0;
 
 	/**
+	 * Loads a Targa image file specified by the given name
+	 */
+	virtual void loadTarga(const CString &name) = 0;
+
+	/**
 	 * Loads a movie file specified by the resource key.
 	 * @param key			Resource key for movie to load
 	 * @param destroyFlag	Immediately destroy movie after decoding first frame
@@ -300,6 +305,11 @@ public:
 	virtual void loadJPEG(const CResourceKey &key);
 
 	/**
+	 * Loads a Targa image file specified by the given name
+	 */
+	virtual void loadTarga(const CString &name);
+
+	/**
 	 * Loads a movie file specified by the resource key.
 	 * @param key			Resource key for movie to load
 	 * @param destroyFlag	Immediately destroy movie after decoding first frame
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index ab734d9..7b91a1a 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -67,7 +67,6 @@ TitanicEngine::~TitanicEngine() {
 	delete _screenManager;
 	delete _filesManager;
 	CSaveableObject::freeClassList();
-	_activeMovies.clear();
 }
 
 void TitanicEngine::initializePath(const Common::FSNode &gamePath) {
@@ -87,6 +86,7 @@ void TitanicEngine::initialize() {
 	CGameObject::init();
 	CGetLiftEye2::init();
 	CHose::init();
+	CMovie::init();
 	CParrotLobbyObject::init();
 	CSGTNavigation::init();
 	CSGTStateRoom::init();
@@ -112,6 +112,7 @@ void TitanicEngine::deinitialize() {
 	CEnterExitFirstClassState::deinit();
 	CGetLiftEye2::deinit();
 	CHose::deinit();
+	CMovie::deinit();
 	CSGTNavigation::deinit();
 	CSGTStateRoom::deinit();
 	CExitPellerator::deinit();
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index 9acf78c..dd28971 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -36,7 +36,7 @@
 #include "titanic/support/files_manager.h"
 #include "titanic/main_game_window.h"
 #include "titanic/support/exe_resources.h"
-#include "titanic/support/movie.h"
+#include "titanic/support/movie_manager.h"
 #include "titanic/support/screen_manager.h"
 #include "titanic/support/string.h"
 #include "titanic/true_talk/tt_script_base.h"
@@ -106,6 +106,7 @@ public:
 	Debugger *_debugger;
 	Events *_events;
 	CFilesManager *_filesManager;
+	CMovieManager _movieManager;
 	Graphics::Screen *_screen;
 	OSScreenManager *_screenManager;
 	CMainGameWindow *_window;
@@ -114,7 +115,6 @@ public:
 	TTscriptBase *_script;
 	CTrueTalkManager *_trueTalkManager;
 	CExeResources _exeResources;
-	CMovieList _activeMovies;
 	StringArray _itemNames;
 	StringArray _itemDescriptions;
 	CString _itemObjects[TOTAL_ITEMS];


Commit: 8b2d85f8e5b30aeb73817894974a4db53588565b
    https://github.com/scummvm/scummvm/commit/8b2d85f8e5b30aeb73817894974a4db53588565b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:16-04:00

Commit Message:
TITANIC: Figured out remainder of CMovieManager

Changed paths:
    engines/titanic/sound/sound.cpp
    engines/titanic/sound/sound_manager.cpp
    engines/titanic/sound/sound_manager.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/movie_manager.cpp
    engines/titanic/support/movie_manager.h



diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index dc8d0ee..7968a08 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/sound/sound.h"
 #include "titanic/game_manager.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -31,6 +32,7 @@ int CSoundItem::fn1() {
 }
 
 CSound::CSound(CGameManager *owner) : _gameManager(owner) {
+	g_vm->_movieManager.setSoundManager(&_soundManager);
 }
 
 void CSound::save(SimpleFile *file) const {
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index fa1e5fb..05a924f 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-SoundManager::SoundManager() : _musicPercent(75.0), _speechPercent(75.0),
+CSoundManager::CSoundManager() : _musicPercent(75.0), _speechPercent(75.0),
 	_masterPercent(75.0), _parrotPercent(75.0), _field14(1) {
 }
 
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index 75cf06e..ac4ac1e 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -27,7 +27,7 @@
 
 namespace Titanic {
 
-class SoundManager {
+class CSoundManager {
 protected:
 	double _musicPercent;
 	double _speechPercent;
@@ -35,8 +35,8 @@ protected:
 	double _parrotPercent;
 	int _field14;
 public:
-	SoundManager();
-	virtual ~SoundManager() {}
+	CSoundManager();
+	virtual ~CSoundManager() {}
 	
 	/**
 	 * Loads a sound
@@ -98,7 +98,7 @@ public:
 	virtual void proc29() {}
 };
 
-class QSoundManager : public SoundManager {
+class QSoundManager : public CSoundManager {
 public:
 	int _field18;
 	int _field1C;
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 869a351..6a79c02 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "video/avi_decoder.h"
+#include "titanic/sound/sound_manager.h"
 #include "titanic/support/movie.h"
 #include "titanic/titanic.h"
 
@@ -144,9 +145,9 @@ const Common::List<CMovieRangeInfo *> OSMovie::getMovieRangeInfo() const {
 	return Common::List<CMovieRangeInfo *>();
 }
 
-void OSMovie::proc18(int v) {
+void OSMovie::setSoundManager(CSoundManager *soundManager) {
 //	if (_aviSurface)
-//		_aviSurface->_field3C = 0;
+//		_aviSurface->_field3C = soundManager;
 
 	warning("TODO: OSMovie::proc18");
 }
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index fbbfebc..7abca6b 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -35,9 +35,10 @@ enum MovieState {
 	MOVIE_STOPPED = -1, MOVIE_NONE = 0, MOVIE_FINISHED = 1, MOVIE_FRAME = 2
 };
 
-class CVideoSurface;
-class CMovie;
 class CGameObject;
+class CMovie;
+class CSoundManager;
+class CVideoSurface;
 
 class CMovieList : public List<CMovie> {
 public:
@@ -112,7 +113,10 @@ public:
 	 */
 	virtual const Common::List<CMovieRangeInfo *> getMovieRangeInfo() const = 0;
 
-	virtual void proc18(int v) = 0;
+	/**
+	 * Set the sound manager reference
+	 */
+	virtual void setSoundManager(CSoundManager *soundManager) = 0;
 
 	/**
 	 * Get the current movie frame
@@ -189,7 +193,10 @@ public:
 	 */
 	virtual const Common::List<CMovieRangeInfo *> getMovieRangeInfo() const;
 
-	virtual void proc18(int v);
+	/**
+	 * Set the sound manager reference
+	 */
+	virtual void setSoundManager(CSoundManager *soundManager);
 
 	/**
 	 * Get the current movie frame
diff --git a/engines/titanic/support/movie_manager.cpp b/engines/titanic/support/movie_manager.cpp
index e3330f0..bfeb081 100644
--- a/engines/titanic/support/movie_manager.cpp
+++ b/engines/titanic/support/movie_manager.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 
 CMovie *CMovieManager::createMovie(const CResourceKey &key, CVideoSurface *surface) {
 	CMovie *movie = new OSMovie(key, surface);
-	movie->proc18(_field4);
+	movie->setSoundManager(_soundManager);
 	return movie;
 }
 
diff --git a/engines/titanic/support/movie_manager.h b/engines/titanic/support/movie_manager.h
index 91ea75e..2920d90 100644
--- a/engines/titanic/support/movie_manager.h
+++ b/engines/titanic/support/movie_manager.h
@@ -25,6 +25,7 @@
 
 #include "titanic/core/list.h"
 #include "titanic/core/resource_key.h"
+#include "titanic/sound/sound_manager.h"
 
 namespace Titanic {
 
@@ -35,17 +36,28 @@ class CMovieManagerBase {
 public:
 	virtual ~CMovieManagerBase() {}
 
+	/**
+	 * Create a new movie and return it
+	 */
 	virtual CMovie *createMovie(const CResourceKey &key, CVideoSurface *surface) = 0;
 };
 
 class CMovieManager : public CMovieManagerBase {
 private:
-	int _field4;
+	CSoundManager *_soundManager;
 public:
-	CMovieManager() : CMovieManagerBase(), _field4(0) {}
+	CMovieManager() : CMovieManagerBase(), _soundManager(nullptr) {}
 	virtual ~CMovieManager() {}
 
+	/**
+	 * Create a new movie and return it
+	 */
 	virtual CMovie *createMovie(const CResourceKey &key, CVideoSurface *surface);
+
+	/**
+	 * Sets the sound manager that will be attached to all created movies
+	 */
+	void setSoundManager(CSoundManager *soundManager) { _soundManager = soundManager; }
 };
 
 } // End of namespace Titanic


Commit: f99b16f564315be5863de57bd03bb8354673f0c5
    https://github.com/scummvm/scummvm/commit/f99b16f564315be5863de57bd03bb8354673f0c5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:19-04:00

Commit Message:
TITANIC: Suppress some warnings in unimplemented code

Changed paths:
    engines/titanic/star_control/base_star.cpp
    engines/titanic/star_control/star_array.cpp
    engines/titanic/star_control/star_control_sub9.cpp



diff --git a/engines/titanic/star_control/base_star.cpp b/engines/titanic/star_control/base_star.cpp
index 7b57b88..4f4f838 100644
--- a/engines/titanic/star_control/base_star.cpp
+++ b/engines/titanic/star_control/base_star.cpp
@@ -81,8 +81,8 @@ CBaseStarEntry *CBaseStar::getDataPtr(int index) {
 void CBaseStar::loadData(Common::SeekableReadStream &s) {
 	uint headerId = s.readUint32LE();
 	uint count = s.readUint32LE();
-	if (headerId != 100 || count == 0);
-	error("Invalid star data");
+	if (headerId != 100 || count == 0)
+		error("Invalid star data");
 
 	// Initialize the data array
 	clear();
diff --git a/engines/titanic/star_control/star_array.cpp b/engines/titanic/star_control/star_array.cpp
index f25d837..8049cb5 100644
--- a/engines/titanic/star_control/star_array.cpp
+++ b/engines/titanic/star_control/star_array.cpp
@@ -43,6 +43,7 @@ void CStarArray::initialize() {
 		int v2 = stream->readUint32LE();
 		stream->readUint32LE();
 
+		warning("TODO: %d %d", v1, v2);
 		// Pre-process them
 		// TODO
 	}
diff --git a/engines/titanic/star_control/star_control_sub9.cpp b/engines/titanic/star_control/star_control_sub9.cpp
index be06e46..fda2f5b 100644
--- a/engines/titanic/star_control/star_control_sub9.cpp
+++ b/engines/titanic/star_control/star_control_sub9.cpp
@@ -40,11 +40,14 @@ void CStarControlSub9::initialize() {
 		RootEntry &rootEntry = _data[rootCtr];
 		rootEntry.resize(count);
 		for (int idx = 0; idx < count; ++idx) {
+			DataEntry &entry = rootEntry[idx];
 			int v1 = stream->readSint32LE();
 			int v2 = stream->readSint32LE();
 			int v3 = stream->readSint32LE();
 			int v4 = stream->readSint32LE();
 
+			warning("TODO: %d %d %d %d", v1, v2, v3, v4);
+			entry._v1 = 0;
 			// TODO: Processing here
 		}
 	}


Commit: 0b860220fc25d6ba78c7a403913d07561f492a6a
    https://github.com/scummvm/scummvm/commit/0b860220fc25d6ba78c7a403913d07561f492a6a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:23-04:00

Commit Message:
TITANIC: Beginnings of AVISurface class

Changed paths:
  A engines/titanic/support/avi_surface.cpp
  A engines/titanic/support/avi_surface.h
    engines/titanic/module.mk



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 71db594..8d25bc3 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -436,6 +436,7 @@ MODULE_OBJS := \
 	star_control/surface_area.o \
 	star_control/surface_fader_base.o \
 	star_control/surface_fader.o \
+	support/avi_surface.o \
 	support/direct_draw.o \
 	support/direct_draw_surface.o \
 	support/exe_resources.o \
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
new file mode 100644
index 0000000..f6f63a7
--- /dev/null
+++ b/engines/titanic/support/avi_surface.cpp
@@ -0,0 +1,32 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/support/avi_surface.h"
+#include "video/avi_decoder.h"
+
+namespace Titanic {
+
+AVISurface::AVISurface(const CResourceKey &key) {
+	// TODO
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
new file mode 100644
index 0000000..248f2c5
--- /dev/null
+++ b/engines/titanic/support/avi_surface.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_AVI_SURFACE_H
+#define TITANIC_AVI_SURFACE_H
+
+#include "video/video_decoder.h"
+#include "titanic/core/resource_key.h"
+#include "titanic/support/movie_range_info.h"
+
+namespace Titanic {
+
+class CSoundManager;
+
+class AVISurface {
+private:
+	int _field4;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _frame;
+	CMovieRangeInfoList _movieRangeInfo;
+	int _field28;
+	int _field2C;
+	int _field30;
+	int _field34;
+	int _field38;
+	CSoundManager *_soundManager;
+	// TODO: Lots more fields
+public:
+	AVISurface(const CResourceKey &key);
+
+	
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_AVI_SURFACE_H */


Commit: b725c9add76b793fa1bdb2ecd00195d20dfa0567
    https://github.com/scummvm/scummvm/commit/b725c9add76b793fa1bdb2ecd00195d20dfa0567
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:26-04:00

Commit Message:
TITANIC: Added CStarArray initialization

Changed paths:
    engines/titanic/star_control/star_array.cpp



diff --git a/engines/titanic/star_control/star_array.cpp b/engines/titanic/star_control/star_array.cpp
index 8049cb5..d2a5fe1 100644
--- a/engines/titanic/star_control/star_array.cpp
+++ b/engines/titanic/star_control/star_array.cpp
@@ -36,16 +36,23 @@ void CStarArray::initialize() {
 	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource("STARFIELD/POINTS");
 	assert(stream && stream->size() == (12 * ARRAY_COUNT));
 
+	double factor = 3.1415927 * 0.0055555557;
+
 	_data.resize(ARRAY_COUNT);
 	for (int idx = 0; idx < ARRAY_COUNT; ++idx) {
+		CStarArrayEntry &entry = _data[idx];
+
 		// Get the next set of values
-		int v1 = stream->readUint32LE();
-		int v2 = stream->readUint32LE();
+		double v1 = stream->readUint32LE();
+		double v2 = stream->readUint32LE();
 		stream->readUint32LE();
 
-		warning("TODO: %d %d", v1, v2);
-		// Pre-process them
-		// TODO
+		v1 *= 0.0099999998 * factor;
+		v2 *= 0.015 * factor;
+
+		entry._v1 = cos(v2) * 3000000.0 * cos(v1);
+		entry._v2 = sin(v2) * 3000000.0 * cos(v1);
+		entry._v3 = sin(v1) * 3000000.0;
 	}
 }
 


Commit: 341cf1866168a8e270ed08b38cd43aa83387ea5a
    https://github.com/scummvm/scummvm/commit/341cf1866168a8e270ed08b38cd43aa83387ea5a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:30-04:00

Commit Message:
TITANIC: Added CStarControlSub9 loading

Changed paths:
    engines/titanic/star_control/star_array.cpp
    engines/titanic/star_control/star_control_sub9.cpp
    engines/titanic/star_control/star_control_sub9.h



diff --git a/engines/titanic/star_control/star_array.cpp b/engines/titanic/star_control/star_array.cpp
index d2a5fe1..2e4a928 100644
--- a/engines/titanic/star_control/star_array.cpp
+++ b/engines/titanic/star_control/star_array.cpp
@@ -27,6 +27,7 @@
 namespace Titanic {
 
 #define ARRAY_COUNT 876
+const double FACTOR = 3.1415927 * 0.0055555557;
 
 CStarArray::CStarArray() {
 }
@@ -36,8 +37,6 @@ void CStarArray::initialize() {
 	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource("STARFIELD/POINTS");
 	assert(stream && stream->size() == (12 * ARRAY_COUNT));
 
-	double factor = 3.1415927 * 0.0055555557;
-
 	_data.resize(ARRAY_COUNT);
 	for (int idx = 0; idx < ARRAY_COUNT; ++idx) {
 		CStarArrayEntry &entry = _data[idx];
@@ -47,8 +46,8 @@ void CStarArray::initialize() {
 		double v2 = stream->readUint32LE();
 		stream->readUint32LE();
 
-		v1 *= 0.0099999998 * factor;
-		v2 *= 0.015 * factor;
+		v1 *= 0.0099999998 * FACTOR;
+		v2 *= 0.015 * FACTOR;
 
 		entry._v1 = cos(v2) * 3000000.0 * cos(v1);
 		entry._v2 = sin(v2) * 3000000.0 * cos(v1);
diff --git a/engines/titanic/star_control/star_control_sub9.cpp b/engines/titanic/star_control/star_control_sub9.cpp
index fda2f5b..e19977c 100644
--- a/engines/titanic/star_control/star_control_sub9.cpp
+++ b/engines/titanic/star_control/star_control_sub9.cpp
@@ -26,6 +26,7 @@
 namespace Titanic {
 
 #define ARRAY_COUNT 80
+const double FACTOR = 3.1415927 * 0.0055555557;
 
 void CStarControlSub9::initialize() {
 	// Get a reference to the starfield points resource
@@ -35,20 +36,20 @@ void CStarControlSub9::initialize() {
 	for (int rootCtr = 0; rootCtr < ARRAY_COUNT; ++rootCtr) {
 		// Get the number of sub-entries for this entry
 		int count = stream->readUint32LE();
+		double v1, v2;
 
 		// Read in the sub-entries
 		RootEntry &rootEntry = _data[rootCtr];
-		rootEntry.resize(count);
-		for (int idx = 0; idx < count; ++idx) {
-			DataEntry &entry = rootEntry[idx];
-			int v1 = stream->readSint32LE();
-			int v2 = stream->readSint32LE();
-			int v3 = stream->readSint32LE();
-			int v4 = stream->readSint32LE();
-
-			warning("TODO: %d %d %d %d", v1, v2, v3, v4);
-			entry._v1 = 0;
-			// TODO: Processing here
+		rootEntry.resize(count * 2);
+		for (int idx = 0; idx < count * 2; ++idx) {
+			DataEntry &entry = rootEntry[idx * 2];
+			v1 = stream->readSint32LE();
+			v2 = stream->readSint32LE();
+			v1 *= 0.015 * FACTOR;
+			v2 *= 0.0099999998 * FACTOR;
+			entry._v1 = cos(v1) * 3000000.0 * cos(v2);
+			entry._v2 = sin(v1) * 3000000.0 * cos(v2);
+			entry._v3 = sin(v2) * 3000000.0;
 		}
 	}
 }
diff --git a/engines/titanic/star_control/star_control_sub9.h b/engines/titanic/star_control/star_control_sub9.h
index ad05a4a..5f334f4 100644
--- a/engines/titanic/star_control/star_control_sub9.h
+++ b/engines/titanic/star_control/star_control_sub9.h
@@ -32,7 +32,6 @@ class CStarControlSub9 {
 		int _v1;
 		int _v2;
 		int _v3;
-		int _v4;
 	};
 
 	class RootEntry : public Common::Array<DataEntry> {


Commit: cc9bf88ed56a4c5fbb14c05d30395b1688f5ebe7
    https://github.com/scummvm/scummvm/commit/cc9bf88ed56a4c5fbb14c05d30395b1688f5ebe7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:33-04:00

Commit Message:
TITANIC: Major implementation of OSMovie and AVISurface classes

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/events.cpp
    engines/titanic/events.h
    engines/titanic/game/computer.cpp
    engines/titanic/game_manager.cpp
    engines/titanic/messages/messages.h
    engines/titanic/sound/sound_manager.cpp
    engines/titanic/sound/sound_manager.h
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/avi_surface.h
    engines/titanic/support/mouse_cursor.cpp
    engines/titanic/support/mouse_cursor.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/movie_event.cpp
    engines/titanic/support/movie_event.h
    engines/titanic/support/movie_range_info.cpp
    engines/titanic/support/movie_range_info.h
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index dcc66f5..78b91c3 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -85,12 +85,14 @@ void CGameObject::save(SimpleFile *file, int indent) {
 	_movieRangeInfoList.destroyContents();
 
 	if (_surface) {
-		Common::List<CMovieRangeInfo *> rangeList = _surface->getMovieRangeInfo();
+		const CMovieRangeInfoList *rangeList = _surface->getMovieRangeInfo();
 		
-		for (Common::List<CMovieRangeInfo *>::const_iterator i = rangeList.begin();
-				i != rangeList.end(); ++i) {
-			CMovieRangeInfo *rangeInfo = new CMovieRangeInfo(*i);
-			rangeInfo->_frameNumber = (i == rangeList.begin()) ? getMovieFrame() : -1;
+		if (rangeList) {
+			for (CMovieRangeInfoList::const_iterator i = rangeList->begin();
+				i != rangeList->end(); ++i) {
+				CMovieRangeInfo *rangeInfo = new CMovieRangeInfo(*i);
+				rangeInfo->_initialFrame = (i == rangeList->begin()) ? getMovieFrame() : -1;
+			}
 		}
 	}
 
@@ -403,21 +405,6 @@ void CGameObject::loadFrame(int frameNumber) {
 	makeDirty();
 }
 
-void CGameObject::playMovie(int v1, int v2) {
-	if (_surface && !_resource.empty()) {
-		loadResource(_resource);
-		_resource.clear();
-	}
-
-	if (_surface && _surface->loadIfReady()) {
-		if (_surface->_movie) {
-			disableMouse();
-			_surface->_movie->play(_bounds, v1, v2);
-			enableMouse();
-		}
-	}
-}
-
 void CGameObject::processMoveRangeInfo() {
 	for (CMovieRangeInfoList::iterator i = _movieRangeInfoList.begin(); i != _movieRangeInfoList.end(); ++i)
 		(*i)->process(this);
@@ -518,23 +505,53 @@ void CGameObject::petSetRemoteTarget() {
 		pet->setRemoteTarget(this);
 }
 
-void CGameObject::playMovie(uint startFrame, uint endFrame, uint flags) {
+void CGameObject::playMovie(uint flags) {
 	_frameNumber = -1;
+
+	if (_surface && !_resource.empty()) {
+		loadResource(_resource);
+		_resource.clear();
+	}
+
+	CGameObject *obj = (flags & MOVIE_NO_OBJECT) ? nullptr : this;
+	if (_surface) {
+		_surface->playMovie(flags, obj);
+		if (flags & MOVIE_GAMESTATE)
+			getGameManager()->_gameState.addMovie(_surface->_movie);
+	}
+}
+
+void CGameObject::playMovie(int startFrame, int endFrame, uint flags) {
+	_frameNumber = -1;
+
 	if (!_surface) {
 		if (!_resource.empty())
 			loadResource(_resource);
 		_resource.clear();
 	}
 
+	CGameObject *obj = (flags & MOVIE_NO_OBJECT) ? nullptr : this;
 	if (_surface) {
-		// TODO: Figure out where to do this legitimately
-		OSMovie *movie = static_cast<OSMovie *>(_surface->_movie);
-		if (movie)
-			movie->_gameObject = this;
+		_surface->playMovie(startFrame, endFrame, flags, obj);
+		if (flags & MOVIE_GAMESTATE)
+			getGameManager()->_gameState.addMovie(_surface->_movie);
+	}
+}
+
 
-		_surface->playMovie(startFrame, endFrame, flags, flags != 0);
+void CGameObject::playMovie(int startFrame, int endFrame, int initialFrame, uint flags) {
+	_frameNumber = -1;
 
-		if (flags & 0x10)
+	if (!_surface) {
+		if (!_resource.empty())
+			loadResource(_resource);
+		_resource.clear();
+	}
+
+	CGameObject *obj = (flags & MOVIE_NO_OBJECT) ? nullptr : this;
+	if (_surface) {
+		_surface->playMovie(startFrame, endFrame, initialFrame, flags, obj);
+		if (flags & MOVIE_GAMESTATE)
 			getGameManager()->_gameState.addMovie(_surface->_movie);
 	}
 }
@@ -565,28 +582,6 @@ void CGameObject::playRandomClip(const char **names, uint flags) {
 	playClip(name, flags);
 }
 
-void CGameObject::playMovie(uint flags) {
-	_frameNumber = -1;
-	if (!_surface && !_resource.empty()) {
-		loadResource(_resource);
-		_resource.clear();
-	}
-
-	CVideoSurface *surface = (flags & 4) ? _surface : nullptr;
-	if (_surface) {
-		_surface->playMovie(flags, surface);
-		
-		// TODO: Figure out where to do this legitimately
-		OSMovie *movie = static_cast<OSMovie *>(_surface->_movie);
-		if (movie)
-			movie->_gameObject = this;
-
-		if (flags & 0x10) {
-			getGameManager()->_gameState.addMovie(_surface->_movie);
-		}
-	}
-}
-
 void CGameObject::savePosition() {
 	_savedPos = _bounds;
 }
@@ -1109,17 +1104,6 @@ bool CGameObject::clipExistsByEnd(const CString &name, int endFrame) const {
 	return _movieClips.existsByEnd(name, endFrame);
 }
 
-void CGameObject::checkPlayMovie(int fieldC, int field10, int frameNumber, int flags) {
-	if (!_surface && !_resource.empty())
-		loadResource(_resource);
-
-	if (_surface ) {
-		_surface->proc35(fieldC, field10, frameNumber, flags, (flags & CLIPFLAG_4) ? this : nullptr);
-		if (flags & CLIPFLAG_PLAY)
-			getGameManager()->_gameState.addMovie(_surface->_movie);
-	}
-}
-
 void CGameObject::petClear() const {
 	CPetControl *petControl = getPetControl();
 	if (petControl)
@@ -1235,14 +1219,14 @@ void CGameObject::setMovie14(int v) {
 		_surface->_movie->_field14 = v;
 }
 
-void CGameObject::surface38(int v1, int v2) {
+void CGameObject::movieEvent(int frameNumber) {
 	if (_surface)
-		_surface->proc38(v1, v2);
+		_surface->addMovieEvent(frameNumber, this);
 }
 
-void CGameObject::surface38(int v1) {
+void CGameObject::movieEvent() {
 	if (_surface)
-		_surface->proc38(-1, v1);
+		_surface->addMovieEvent(-1, this);
 }
 
 int CGameObject::getClipDuration(const CString &name, int frameRate) const {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 2005953..58ae4c6 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -294,11 +294,6 @@ protected:
 	Point getControid() const;
 
 	/**
-	 * Plays a movie
-	 */
-	void playMovie(int v1, int v2);
-
-	/**
 	 * Play an arbitrary clip
 	 */
 	void playClip(const CString &name, uint flags);
@@ -561,11 +556,6 @@ public:
 	virtual bool isPet() const;
 
 	/**
-	 * Play the movie specified in _resource
-	 */
-	void playMovie(uint startFrame, uint endFrame, uint flags);
-
-	/**
 	 * Checks the passed point is validly in the object,
 	 * with extra checking of object flags status
 	 */
@@ -582,9 +572,14 @@ public:
 	void playMovie(uint flags);
 	
 	/**
-	 * Checks and plays a pending clip
+	 * Play the movie specified in _resource
+	 */
+	void playMovie(int startFrame, int endFrame, uint flags);
+
+	/**
+	 * Play the movie specified in _resource
 	 */
-	void checkPlayMovie(int fieldC, int field10, int frameNumber, int flags);
+	void playMovie(int startFrame, int endFrame, int initialFrame, uint flags);
 
 	/**
 	 * Returns true if the object has a currently active movie
@@ -842,9 +837,16 @@ public:
 
 	/*--- CVideoSurface Methods ---*/
 
-	void surface38(int v1, int v2);
+	/**
+	 * Signal a movie event for the given frame
+	 */
+	void movieEvent(int frameNumber);
 
-	void surface38(int v1);
+	/**
+	 * Signal a movie event at the end of all currently
+	 * playing ranges
+	 */
+	void movieEvent();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index 5901073..ff425ab 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -235,4 +235,27 @@ void Events::sleep(uint time) {
 	}
 }
 
+bool Events::waitForPress(uint expiry) {
+	uint32 delayEnd = g_system->getMillis() + expiry;
+
+	while (!_vm->shouldQuit() && g_system->getMillis() < delayEnd) {
+		g_system->delayMillis(10);
+		checkForNextFrameCounter();
+
+		Common::Event event;
+		if (g_system->getEventManager()->pollEvent(event)) {
+			switch (event.type) {
+			case Common::EVENT_LBUTTONDOWN:
+			case Common::EVENT_MBUTTONDOWN:
+			case Common::EVENT_KEYDOWN:
+				return true;
+			default:
+				break;
+			}
+		}
+	}
+
+	return false;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/events.h b/engines/titanic/events.h
index 4638056..ab3d755 100644
--- a/engines/titanic/events.h
+++ b/engines/titanic/events.h
@@ -104,12 +104,17 @@ public:
 	 */
 	bool isSpecialPressed(SpecialButtons btn) const { return _specialButtons; }
 
+	uint getSpecialButtons() const { return _specialButtons; }
+
 	/**
 	 * Sleep for a specified period of time
 	 */
 	void sleep(uint time);
 
-	uint getSpecialButtons() const { return _specialButtons; }
+	/**
+	 * Wait for a mouse or keypress
+	 */
+	bool waitForPress(uint expiry);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game/computer.cpp b/engines/titanic/game/computer.cpp
index e3f9430..9057499 100644
--- a/engines/titanic/game/computer.cpp
+++ b/engines/titanic/game/computer.cpp
@@ -91,7 +91,7 @@ bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
 }
 
 bool CComputer::MovieEndMsg(CMovieEndMsg *msg) {
-	if (msg->_value2 == 90) {
+	if (msg->_endFrame == 90) {
 		playSound("a#32.wav", 100, 0, 0);
 		playSound("a#33.wav", 100, 0, 0);
 		playSound("a#31.wav", 100, 0, 0);
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 7e8531f..84306b4 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -192,36 +192,48 @@ void CGameManager::update() {
 }
 
 void CGameManager::updateMovies() {
-	// TODO: Make this more like the original, if I can figuring out
-	// what's it doing with temporary lists and the OSMovie methods
-	for (CMovieList::iterator i = CMovie::_activeMovies->begin();
-			i != CMovie::_activeMovies->end(); ) {
-		OSMovie *movie = static_cast<OSMovie *>(*i);
-		assert(movie && movie->_gameObject);
-
-		movie->update();
-		switch (movie->getState()) {
-		case MOVIE_FINISHED: {
-			CMovieEndMsg endMsg;
-			endMsg.execute(movie->_gameObject);
-
-			i = CMovie::_activeMovies->erase(i);
-			delete movie;
-			continue;
-		}
-
-		case MOVIE_FRAME: {
-			CMovieFrameMsg frameMsg;
-			frameMsg.execute(movie->_gameObject);
+	bool repeatFlag;
+	do {
+		repeatFlag = false;
+
+		for (CMovieList::iterator i = CMovie::_playingMovies->begin();
+				i != CMovie::_playingMovies->end(); ) {
+			CMovie *movie = *i;
+			if (movie->_state)
+				continue;
+
+			CMovieEventList eventsList;
+			if (!movie->handleEvents(eventsList))
+				movie->removeFromPlayingMovies();
+
+			while (!eventsList.empty()) {
+				CMovieEvent *movieEvent = eventsList.front();
+
+				switch (movieEvent->_type) {
+				case MET_MOVIE_END: {
+					CMovieEndMsg endMsg(movieEvent->_startFrame, movieEvent->_endFrame);
+					endMsg.execute(movieEvent->_gameObject);
+					break;
+				}
+
+				case MET_FRAME: {
+					CMovieFrameMsg frameMsg(movieEvent->_initialFrame, 0);
+					frameMsg.execute(movieEvent->_gameObject);
+					break;
+				}
+
+				default:
+					break;
+				}
+
+				eventsList.remove(movieEvent);
+			}
+
+			repeatFlag = true;
+			movie->_state = MSTATE_1;
 			break;
 		}
-
-		default:
-			break;
-		}
-
-		++i;
-	}
+	} while (repeatFlag);
 }
 
 void CGameManager::updateDiskTicksCount() {
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 278fac1..de5d0bd 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -264,8 +264,8 @@ MESSAGE0(CMaitreDDefeatedMsg);
 MESSAGE0(CMaitreDHappyMsg);
 MESSAGE1(CMissiveOMatActionMsg, int, value, 0);
 MESSAGE0(CMoveToStartPosMsg);
-MESSAGE2(CMovieEndMsg, int, value1, 0, int, value2, 0);
-MESSAGE2(CMovieFrameMsg, int, value1, 0, int, value2, 0);
+MESSAGE2(CMovieEndMsg, int, startFrame, 0, int, endFrame, 0);
+MESSAGE2(CMovieFrameMsg, int, frameNumber, 0, int, value2, 0);
 MESSAGE0(CMusicHasStartedMsg);
 MESSAGE0(CMusicHasStoppedMsg);
 MESSAGE0(CMusicSettingChangedMsg);
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index 05a924f..440d74a 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -100,8 +100,8 @@ void QSoundManager::WaveMixPump() {
 	warning("TODO");
 }
 
-int QSoundManager::proc18() const {
-	warning("TODO");
+bool QSoundManager::movieStarted() const {
+	// TODO
 	return 0;
 }
 
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index ac4ac1e..942124e 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -59,7 +59,12 @@ public:
 	virtual bool isActive(int handle) const { return false; }
 	virtual int proc16() const { return 0; }
 	virtual void WaveMixPump() {}
-	virtual int proc18() const { return 0; }
+	
+	/**
+	 * Called when a movie with audio is started
+	 */
+	virtual bool movieStarted() const { return false; }
+
 	virtual void setMusicPercent(double percent) { _musicPercent = percent; }
 	virtual void setSpeechPercent(double percent) { _speechPercent = percent; }
 	virtual void setMasterPercent(double percent) { _masterPercent = percent; }
@@ -128,7 +133,13 @@ public:
 	virtual bool isActive(int handle) const;
 	virtual int proc16();
 	virtual void WaveMixPump();
-	virtual int proc18() const;
+
+	
+	/**
+	 * Called when a movie with audio is started
+	 */
+	virtual bool movieStarted() const;
+
 	virtual void proc19(int v);
 	virtual void proc20(int v);
 	virtual void proc21(int v);
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index f6f63a7..47127fe 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -21,12 +21,197 @@
  */
 
 #include "titanic/support/avi_surface.h"
+#include "titanic/support/video_surface.h"
 #include "video/avi_decoder.h"
 
 namespace Titanic {
 
 AVISurface::AVISurface(const CResourceKey &key) {
+
 	// TODO
+/*
+Video::AVIDecoder *decoder = new Video::AVIDecoder();
+decoder->ignoreSecondaryVideoTracks();
+_video = decoder;
+_field14 = 1;
+
+if (!_video->loadFile(name.getString()))
+error("Could not open video - %s", name.getString().c_str());
+*/
+}
+
+AVISurface::~AVISurface() {
+	if (_videoSurface)
+		_videoSurface->_blitStyleFlag = false;
+	delete _frameInfo;
+}
+
+bool AVISurface::play(uint flags, CGameObject *obj) {
+	if (flags & MOVIE_REVERSE)
+		return play(_decoder->getFrameCount() - 1, 0, flags, obj);
+	else
+		return play(0, _decoder->getFrameCount() - 1, flags, obj);
+}
+
+bool AVISurface::play(int startFrame, int endFrame, uint flags, CGameObject *obj) {
+	if (flags & MOVIE_STOP_PREVIOUS)
+		stop();
+
+	return play(startFrame, endFrame, -1, flags, obj);
+}
+
+bool AVISurface::play(int startFrame, int endFrame, int initialFrame, uint flags, CGameObject *obj) {
+	CMovieRangeInfo *info = new CMovieRangeInfo();
+	info->_startFrame = startFrame;
+	info->_endFrame = endFrame;
+	info->_isReversed = endFrame < startFrame;
+	info->_isFlag1 = flags & MOVIE_1;
+
+	if (obj) {
+		CMovieEvent *me = new CMovieEvent();
+		me->_type = MET_MOVIE_END;
+		me->_startFrame = startFrame;
+		me->_endFrame = endFrame;
+		me->_initialFrame = 0;
+		me->_gameObject = obj;
+		
+		info->addEvent(me);
+	}
+
+	_movieRangeInfo.push_back(info);
+	
+	if (_movieRangeInfo.size() == 1) {
+		changeFrame(initialFrame);
+	} else {
+		return true;
+	}	
+}
+
+void AVISurface::stop() {
+	_isPlaying = false;
+	_decoder->stop();
+	_movieRangeInfo.destroyContents();
+}
+
+bool AVISurface::changeFrame(int frameNumber) {
+	if (_isPlaying)
+		return false;
+
+	if (frameNumber == -1)
+		// Default to starting frame of first movie range
+		frameNumber = _movieRangeInfo.front()->_startFrame;
+
+	seekToFrame(frameNumber);
+	renderFrame();
+
+	_isPlaying = true;
+	return true;
+}
+
+void AVISurface::seekToFrame(uint frameNumber) {
+	_decoder->seekToFrame(frameNumber);
+	_priorFrame = frameNumber;
+}
+
+bool AVISurface::handleEvents(CMovieEventList &events) {
+	if (!_isPlaying)
+		return true;
+
+	CMovieRangeInfo *info = _movieRangeInfo.front();
+	_currentPos += info->_isReversed ? -1 : 1;
+	if ((info->_isReversed && _currentPos < info->_endFrame) ||
+		(!info->_isReversed && _currentPos > info->_endFrame)) {
+		if (info->_isFlag1) {
+			info->getMovieEnd(events);
+			_movieRangeInfo.remove(info);
+			delete info;
+
+			if (_movieRangeInfo.empty()) {
+				// NO more ranges, so stop playback
+				stop();
+			} else {
+				// Not empty, so move onto new first one
+				info = _movieRangeInfo.front();
+				_currentPos = info->_startFrame;
+			}
+		} else {
+			_currentPos = info->_startFrame;
+		}
+	}
+
+	if (_isPlaying) {
+		// SInce movie ranges can change the position in the movie,
+		// ensure the decoder is kept in sync
+		seekToFrame(_currentPos);
+				
+		info->getMovieFrame(events, _currentPos);
+		return renderFrame();
+	} else {
+		return false;
+	}
+}
+
+void AVISurface::setVideoSurface(CVideoSurface *surface) {
+	_videoSurface = surface;
+
+	warning("TODO: Get video track list from video decoder");
+}
+
+uint AVISurface::getWidth() const {
+	return _decoder->getWidth();
+}
+
+uint AVISurface::getHeight() const {
+	return _decoder->getHeight();
+}
+
+void AVISurface::setFrame(int frameNumber) {
+	// If playback was in process, stop it
+	if (_isPlaying)
+		stop();
+
+	// Ensure the frame number is valid
+	if (frameNumber >= _decoder->getFrameCount())
+		frameNumber = _decoder->getFrameCount() - 1;
+
+	seekToFrame(frameNumber);
+	renderFrame();
+}
+
+int AVISurface::getFrame() const {
+	return _decoder->getCurFrame();
+}
+
+bool AVISurface::renderFrame() {
+	// Check there's a frame ready for 
+	assert(_videoSurface);
+	if (!_decoder->needsUpdate())
+		return false;
+
+	// Get the frame to render, and draw it on the surface
+	const Graphics::Surface *frame = _decoder->decodeNextFrame();
+	_videoSurface->blitFrom(Point(0, 0), frame);
+	return false;
+}
+
+bool AVISurface::addEvent(int frameNumber, CGameObject *obj) {
+	if (!_movieRangeInfo.empty()) {
+		CMovieRangeInfo *tail = _movieRangeInfo.back();
+		if (frameNumber == -1)
+			frameNumber = tail->_startFrame;
+
+		CMovieEvent *me = new CMovieEvent();
+		me->_type = MET_FRAME;
+		me->_startFrame = 0;
+		me->_endFrame = 0;
+		me->_initialFrame = frameNumber;
+		me->_gameObject = obj;
+		tail->addEvent(me);
+
+		return _movieRangeInfo.size() == 1 && frameNumber == _priorFrame;
+	}
+
+	return false;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index 248f2c5..48c8169 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -23,33 +23,121 @@
 #ifndef TITANIC_AVI_SURFACE_H
 #define TITANIC_AVI_SURFACE_H
 
-#include "video/video_decoder.h"
+#include "video/avi_decoder.h"
 #include "titanic/core/resource_key.h"
 #include "titanic/support/movie_range_info.h"
 
 namespace Titanic {
 
 class CSoundManager;
+class CVideoSurface;
+
+enum MovieFlag {
+	MOVIE_1 = 1, MOVIE_STOP_PREVIOUS = 2, MOVIE_NO_OBJECT = 4,
+	MOVIE_REVERSE = 8, MOVIE_GAMESTATE = 0x10
+};
 
 class AVISurface {
 private:
+	Video::AVIDecoder *_decoder;
+	CVideoSurface *_videoSurface;
 	int _field4;
 	int _field8;
-	int _fieldC;
-	int _field10;
-	int _frame;
+	int _currentPos;
+	int _priorFrame;
 	CMovieRangeInfoList _movieRangeInfo;
-	int _field28;
-	int _field2C;
-	int _field30;
-	int _field34;
-	int _field38;
+	int _streamCount;
+	void *_frameInfo;
+private:
+	/**
+	 * Render a frame to the video surface
+	 */
+	bool renderFrame();
+protected:
+	/**
+	 * Change the frame with ??? checking
+	 */
+	virtual bool changeFrame(int frameNumber);
+
+	/**
+	 * Seeks to a given frame number in the video
+	 */
+	virtual void seekToFrame(uint frameNumber);
+public:
 	CSoundManager *_soundManager;
-	// TODO: Lots more fields
+	bool _hasAudio;
+	bool _isPlaying;
+	double _frameRate;
 public:
 	AVISurface(const CResourceKey &key);
+	~AVISurface();
+
+	/**
+	 * Start playing the loaded AVI video
+	 */
+	virtual bool play(uint flags, CGameObject *obj);
+
+	/**
+	 * Start playing the loaded AVI video
+	 */
+	virtual bool play(int startFrame, int endFrame, uint flags, CGameObject *obj);
+
+	/**
+	 * Start playing the loaded AVI video
+	 */
+	virtual bool play(int startFrame, int endFrame, int initialFrame, uint flags, CGameObject *obj);
+
+	/**
+	 * Stop the currently playing video
+	 */
+	virtual void stop();
+
+	/**
+	 * Handle any movie events relevent for the frame
+	 */
+	virtual bool handleEvents(CMovieEventList &events);
+
+	/**
+	 * Set the video surface the AVI Surface will render on
+	 */
+	void setVideoSurface(CVideoSurface *surface);
+
+	/**
+	 * Get the width of the video
+	 */
+	uint getWidth() const;
+
+	/**
+	 * Get the height of the video
+	 */
+	uint getHeight() const;
+
+	/**
+	 * Set the current frame
+	 */
+	void setFrame(int frameNumber);
+
+	/**
+	 * Gets the current frame
+	 */
+	int getFrame() const;
+
+	/**
+	 * Add a movie event
+	 */
+	bool addEvent(int frameNumber, CGameObject *obj);
+
+	const void *getFrameInfo() const {
+		return _streamCount <= 1 ? nullptr : _frameInfo;
+	}
+
+	/**
+	 * Get a reference to the movie range info list
+	 */
+	const CMovieRangeInfoList *getMovieRangeInfo() const {
+		return &_movieRangeInfo;
+	}
 
-	
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index d87e7a4..721088f 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -91,15 +91,17 @@ void CMouseCursor::loadCursorImages() {
 		// Create the surface
 		CVideoSurface *surface = _screenManager->createSurface(64, 64);
 		_cursors[idx]._videoSurface = surface;
-
+/*
 		Common::SeekableReadStream *stream = new Common::MemoryReadStream(
 			movieData, f.size(), DisposeAfterUse::NO);
 		OSMovie movie(stream, surface);
 		movie.setFrame(idx);
-
-		_cursors[idx]._ptrUnknown = movie.proc21();
-		surface->set40(_cursors[idx]._ptrUnknown);
-	}
+		
+		int frameNum = movie.proc21();
+		_cursors[idx]._frameNumber = frameNum;
+		surface->setMovieFrame(frameNum);
+*/
+		}
 }
 
 void CMouseCursor::show() {
diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h
index 55e0cb4..168a7be 100644
--- a/engines/titanic/support/mouse_cursor.h
+++ b/engines/titanic/support/mouse_cursor.h
@@ -54,7 +54,7 @@ class CVideoSurface;
 class CMouseCursor {
 	struct CursorEntry {
 		CVideoSurface *_videoSurface;
-		void *_ptrUnknown;
+		int _frameNumber;
 		Common::Point _centroid;
 	};
 private:
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 6a79c02..338396f 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -20,42 +20,51 @@
  *
  */
 
-#include "video/avi_decoder.h"
-#include "titanic/sound/sound_manager.h"
 #include "titanic/support/movie.h"
+#include "titanic/support/avi_surface.h"
+#include "titanic/sound/sound_manager.h"
+#include "titanic/messages/messages.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
 
-CMovieList *CMovie::_activeMovies;
+#define CLIP_WIDTH 600
+#define CLIP_WIDTH_REDUCED (CLIP_WIDTH / 2)
+#define CLIP_HEIGHT 340
+#define CLIP_HEIGHT_REDUCED (CLIP_HEIGHT / 2)
+
+CMovieList *CMovie::_playingMovies;
+CVideoSurface *CMovie::_movieSurface;
 
-CMovie::CMovie() : ListItem(), _state(MOVIE_STOPPED), _field10(0),
+CMovie::CMovie() : ListItem(), _state(MSTATE_0), _field10(0),
 		_field14(0) {
 }
 
 CMovie::~CMovie() {
-	removeFromActiveMovies();
+	removeFromPlayingMovies();
 }
 
 void CMovie::init() {
-	_activeMovies = new CMovieList();
+	_playingMovies = new CMovieList();
+	_movieSurface = nullptr;
 }
 
 void CMovie::deinit() {
-	delete _activeMovies;
+	delete _playingMovies;
+	delete _movieSurface;
 }
 
-void CMovie::addToActiveMovies() {
+void CMovie::addToPlayingMovies() {
 	if (!isActive())
-		_activeMovies->push_back(this);
+		_playingMovies->push_back(this);
 }
 
-void CMovie::removeFromActiveMovies() {
-	_activeMovies->remove(this);
+void CMovie::removeFromPlayingMovies() {
+	_playingMovies->remove(this);
 }
 
 bool CMovie::isActive() const {
-	return _activeMovies->contains(this);
+	return _playingMovies->contains(this);
 }
 
 bool CMovie::get10() {
@@ -70,156 +79,148 @@ bool CMovie::get10() {
 /*------------------------------------------------------------------------*/
 
 OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) :
-		_videoSurface(surface), _gameObject(nullptr), _endFrame(-1) {
-	Video::AVIDecoder *decoder = new Video::AVIDecoder();
-	_video = decoder;
-	_field14 = 1;
-
-	if (!_video->loadFile(name.getString()))
-		error("Could not open video - %s", name.getString().c_str());
-}
+		_aviSurface(name), _videoSurface(surface) {
+	_field18 = 0;
+	_field24 = 0;
+	_field28 = 0;
+	_field2C = 0;
+	_ticksStart = 0;
+	_frameTime1 = 0;
+	_frameTime2 = 17066;
 
-OSMovie::OSMovie(Common::SeekableReadStream *stream, CVideoSurface *surface) :
-		_videoSurface(surface), _gameObject(nullptr), _endFrame(-1) {
-	_video = new Video::AVIDecoder();
-	if (!_video->loadStream(stream))
-		error("Could not parse movie stream");
+	surface->resize(_aviSurface.getWidth(), _aviSurface.getHeight());
+	_aviSurface.setVideoSurface(surface);
 }
 
 OSMovie::~OSMovie() {
-	delete _video;
 }
 
-void OSMovie::play(uint flags, CVideoSurface *surface) {
-	uint endFrame = _video->getFrameCount();
-	play(0, endFrame, 0, 0);
-}
+void OSMovie::play(uint flags, CGameObject *obj) {
+	_aviSurface.play(flags, obj);
 
-void OSMovie::play(uint startFrame, uint endFrame, int v3, bool v4) {
-	warning("TODO: OSMovie::play properly");
+	if (_aviSurface._isPlaying)
+		movieStarted();
+}
 
-	_video->start();
-	_video->seekToFrame(startFrame);
-	_endFrame = endFrame;
+void OSMovie::play(uint startFrame, uint endFrame, uint flags, CGameObject *obj) {
+	_aviSurface.play(startFrame, endFrame, flags, obj);
 
-	addToActiveMovies();
-	_state = MOVIE_NONE;
+	if (_aviSurface._isPlaying)
+		movieStarted();
 }
 
-void OSMovie::play(const Rect &rect, int v1, int v2) {
-	warning("TODO: OSMovie::play 3");
-}
+void OSMovie::play(uint startFrame, uint endFrame, uint initialFrame, uint flags, CGameObject *obj) {
+	_aviSurface.play(startFrame, endFrame, initialFrame, flags, obj);
 
-void OSMovie::playClip(const Rect &rect, uint startFrame, uint endFrame) {
-	warning("TODO: OSMovie::playClip");
+	if (_aviSurface._isPlaying)
+		movieStarted();
 }
 
-void OSMovie::proc11() {
-	warning("TODO: OSMovie::proc11");
-}
+void OSMovie::playClip(const Point &drawPos, uint startFrame, uint endFrame) {
+	if (!_movieSurface)
+		_movieSurface = CScreenManager::_screenManagerPtr->createSurface(600, 340);
+	
+	bool widthLess = _videoSurface->getWidth() < 600;
+	bool heightLess = _videoSurface->getHeight() < 340;
+	Rect r(drawPos.x, drawPos.y,
+		drawPos.x + widthLess ? CLIP_WIDTH_REDUCED : CLIP_WIDTH,
+		drawPos.y + heightLess ? CLIP_HEIGHT_REDUCED : CLIP_HEIGHT
+	);
 
-void OSMovie::proc12(int v1, int v2, int frameNumber, int flags, CGameObject *obj) {
-	warning("TODO: OSMovie::proc12");
+	uint timePerFrame = 1000 / _aviSurface._frameRate;
+
+	for (; endFrame >= startFrame; ++startFrame) {
+		// Set the frame
+		_aviSurface.setFrame(startFrame);
+
+		// TODO: See if we need to do anything further here. The original had a bunch
+		// of calls and using of the _movieSurface; perhaps to allow scaling down
+		// videos to half-size
+		if (widthLess || heightLess)
+			warning("Not properly reducing clip size: %d %d", r.width(), r.height());
+
+		// Wait for the next frame, unless the user interrupts the clip
+		if (g_vm->_events->waitForPress(timePerFrame))
+			break;
+	}
 }
 
 void OSMovie::stop() {
-	_video->stop();
-	_state = MOVIE_STOPPED;
+	_aviSurface.stop();
+	removeFromPlayingMovies();
 }
 
-void OSMovie::proc14() {
-	warning("TODO: OSMovie::proc14");
+void OSMovie::addEvent(int frameNumber, CGameObject *obj) {
+	if (_aviSurface.addEvent(frameNumber, obj)) {
+		CMovieFrameMsg frameMsg(frameNumber, 0);
+		frameMsg.execute(obj);
+	}
 }
 
 void OSMovie::setFrame(uint frameNumber) {
-	_video->seekToFrame(frameNumber);
-	decodeFrame();
+	_aviSurface.setFrame(frameNumber);
+	_videoSurface->setMovieFrame(frameNumber);
 }
 
-void OSMovie::proc16() {
-	warning("TODO: OSMovie::proc16");
-}
+bool OSMovie::handleEvents(CMovieEventList &events) {
+	if (!_aviSurface._isPlaying)
+		return false;
 
-const Common::List<CMovieRangeInfo *> OSMovie::getMovieRangeInfo() const {
-	warning("TODO: OSMovie::getMovieRangeInfo");
-	return Common::List<CMovieRangeInfo *>();
-}
+	int time = (g_vm->_events->getTicksCount() + ((_ticksStart << 24) - _ticksStart)) << 8;
+	if (time < _frameTime1)
+		return _aviSurface._isPlaying;
 
-void OSMovie::setSoundManager(CSoundManager *soundManager) {
-//	if (_aviSurface)
-//		_aviSurface->_field3C = soundManager;
+	if (!_field14 && (time - _frameTime1) > (_frameTime2 * 2))
+		_frameTime1 = time;
 
-	warning("TODO: OSMovie::proc18");
-}
+	_frameTime1 += _frameTime2;
+	_aviSurface.handleEvents(events);
+	_videoSurface->setMovieFrameInfo(_aviSurface.getFrameInfo());
 
-int OSMovie::getFrame() {
-	assert(_video);
-	return _video->getCurFrame();
-}
+	if (_field14) {
+		while (_frameTime1 >= time && events.empty()) {
+			_aviSurface.handleEvents(events);
+			_videoSurface->setMovieFrameInfo(_aviSurface.getFrameInfo());
 
-void OSMovie::proc20() {
-	warning("TODO: OSMovie::proc20");
-}
-
-void *OSMovie::proc21() {
-	warning("TODO: OSMovie::proc21");
-	return nullptr;
-}
-
-MovieState OSMovie::getState() {
-	if (!_video)
-		_state = MOVIE_STOPPED;
-	return _state;
-}
-
-void OSMovie::update() {
-	if (_state != MOVIE_STOPPED) {
-		if (_video->isPlaying()) {
-			if (_video->getCurFrame() >= _endFrame) {
-				_video->stop();
-				_state = MOVIE_FINISHED;
-			} else if (_video->needsUpdate()) {
-				decodeFrame();
-				_state = MOVIE_FRAME;
-			} else {
-				_state = MOVIE_NONE;
-			}
-		} else {
-			_state = MOVIE_STOPPED;
+			_frameTime1 += _frameTime2;
 		}
 	}
+
+	return _aviSurface._isPlaying;
+}
+
+const CMovieRangeInfoList *OSMovie::getMovieRangeInfo() const {
+	return _aviSurface.getMovieRangeInfo();
 }
 
-void OSMovie::decodeFrame() {
-	const Graphics::Surface *frame = _video->decodeNextFrame();
-	OSVideoSurface *videoSurface = static_cast<OSVideoSurface *>(_videoSurface);
-	assert(videoSurface);
+void OSMovie::setSoundManager(CSoundManager *soundManager) {
+	_aviSurface._soundManager = soundManager;
+}
 
-	// If the video surface doesn't yet have an underlying surface, create it
-	if (!videoSurface->hasSurface())
-		videoSurface->recreate(frame->w, frame->h);
+int OSMovie::getFrame() const {
+	return _aviSurface.getFrame();
+}
 
-	// Lock access to the surface
-	videoSurface->lock();
-	assert(videoSurface->_rawSurface);
+void OSMovie::movieStarted() {
+	_frameTime1 = _frameTime2 = 256000.0 / _aviSurface._frameRate;
+	_ticksStart = g_vm->_events->getTicksCount();
 
-	if (frame->format == videoSurface->_rawSurface->format) {
-		// Matching format, so we can copy straight from the video frame
-		videoSurface->_rawSurface->blitFrom(*frame);
-	} else {
-		// Different formats so we have to convert it first
-		Graphics::Surface *s = frame->convertTo(videoSurface->_rawSurface->format);
-		videoSurface->_rawSurface->blitFrom(*s);
+	if (_aviSurface._hasAudio)
+		_aviSurface._soundManager->movieStarted();
 
-		s->free();
-		delete s;
-	}
+	// Register the movie in the playing list
+	addToPlayingMovies();
+	_field10 = 1;
+}
 
-	// Unlock the surface
-	videoSurface->unlock();
+void OSMovie::proc20() {
+	// TODO
+}
 
-	if (_gameObject)
-		_gameObject->makeDirty();
+int OSMovie::proc21() {
+	// TODO
+	return 0;
 }
 
+
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index 7abca6b..c839c88 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -27,12 +27,13 @@
 #include "video/video_decoder.h"
 #include "titanic/core/list.h"
 #include "titanic/core/resource_key.h"
+#include "titanic/support/avi_surface.h"
 #include "titanic/support/movie_range_info.h"
 
 namespace Titanic {
 
 enum MovieState { 
-	MOVIE_STOPPED = -1, MOVIE_NONE = 0, MOVIE_FINISHED = 1, MOVIE_FRAME = 2
+	MSTATE_0 = 0, MSTATE_1 = 1
 };
 
 class CGameObject;
@@ -46,22 +47,17 @@ public:
 
 class CMovie : public ListItem {
 protected:
-	MovieState _state;
-	int _field10;
-protected:
-	/**
-	 * Adds the movie to the active movies list
-	 */
-	void addToActiveMovies();
-
 	/**
-	 * Removes the movie from the active movies list
+	 * Adds the movie to the list of currently playing movies
 	 */
-	void removeFromActiveMovies();
+	void addToPlayingMovies();
 public:
+	MovieState _state;
+	int _field10;
 	int _field14;
 public:
-	static CMovieList *_activeMovies;
+	static CMovieList *_playingMovies;
+	static CVideoSurface *_movieSurface;
 
 	/**
 	 * Initializes statics
@@ -77,41 +73,49 @@ public:
 	virtual ~CMovie();
 
 	/**
-	 * Plays the movie
+	 * Starts playing the movie
 	 */
-	virtual void play(uint flags, CVideoSurface *surface) = 0;
+	virtual void play(uint flags, CGameObject *obj) = 0;
 	
 	/**
-	 * Plays the movie
+	 * Starts playing the movie
 	 */
-	virtual void play(uint startFrame, uint endFrame, int v3, bool v4) = 0;
+	virtual void play(uint startFrame, uint endFrame, uint flags, CGameObject *obj) = 0;
 
 	/**
-	 * Plays the movie
+	 * Starts playing the movie
 	 */
-	virtual void play(const Rect &rect, int v1, int v2) = 0;
+	virtual void play(uint startFrame, uint endFrame, uint initialFrame, uint flags, CGameObject *obj) = 0;
 	
 	/**
 	 * Plays a sub-section of a movie
 	 */
-	virtual void playClip(const Rect &rect, uint startFrame, uint endFrame) = 0;
+	virtual void playClip(const Point &drawPos, uint startFrame, uint endFrame) = 0;
 	
-	virtual void proc11() = 0;
-	virtual void proc12(int v1, int v2, int frameNumber, int flags, CGameObject *obj) = 0;
-
 	/**
 	 * Stops the movie
 	 */
 	virtual void stop() = 0;
 
-	virtual void proc14() = 0;
+	/**
+	 * Add a playback event
+	 */
+	virtual void addEvent(int frameNumber, CGameObject *obj) = 0;
+
+	/**
+	 * Set the current frame number
+	 */
 	virtual void setFrame(uint frameNumber) = 0;
-	virtual void proc16() = 0;
+	
+	/**
+	 * Handle any pending movie events
+	 */
+	virtual bool handleEvents(CMovieEventList &events) = 0;
 	
 	/**
 	 * Return any movie range info associated with the movie
 	 */
-	virtual const Common::List<CMovieRangeInfo *> getMovieRangeInfo() const = 0;
+	virtual const CMovieRangeInfoList *getMovieRangeInfo() const = 0;
 
 	/**
 	 * Set the sound manager reference
@@ -121,94 +125,102 @@ public:
 	/**
 	 * Get the current movie frame
 	 */
-	virtual int getFrame() = 0;
+	virtual int getFrame() const = 0;
 	
 	virtual void proc20() = 0;
-	virtual void *proc21() = 0;
+	virtual int proc21() = 0;
+
+	/**
+	 * Removes the movie from the list of currently playing movies
+	 */
+	void removeFromPlayingMovies();
 
+	/**
+	 * Returns true if the movie is currently active
+	 */
 	bool isActive() const;
 
 	bool get10();
-
-	virtual MovieState getState() = 0;
-	virtual void update() = 0;
 };
 
 class OSMovie : public CMovie {
 private:
-	Video::VideoDecoder *_video;
+	AVISurface _aviSurface;
 	CVideoSurface *_videoSurface;
-	int _endFrame;
-
+	int _field18;
+	int _field24;
+	int _field28;
+	int _field2C;
+	int _ticksStart;
+	int _frameTime1;
+	int _frameTime2;
+private:
 	/**
-	 * Decodes the next frame
+	 * Called when a movie is started playing
 	 */
-	void decodeFrame();
-public:
-	CGameObject *_gameObject;
+	void movieStarted();
 public:
 	OSMovie(const CResourceKey &name, CVideoSurface *surface);
-	OSMovie(Common::SeekableReadStream *stream, CVideoSurface *surface);
 	virtual ~OSMovie();
 
 	/**
-	 * Plays the movie
+	 * Starts playing the movie
 	 */
-	virtual void play(uint flags, CVideoSurface *surface);
+	virtual void play(uint flags, CGameObject *obj);
 	
 	/**
-	 * Plays the movie
+	 * Starts playing the movie
 	 */
-	virtual void play(uint startFrame, uint endFrame, int v3, bool v4);
+	virtual void play(uint startFrame, uint endFrame, uint flags, CGameObject *obj);
 	
 	/**
-	 * Plays the movie
+	 * Starts playing the movie
 	 */
-	virtual void play(const Rect &rect, int v1, int v2);
+	virtual void play(uint startFrame, uint endFrame, uint initialFrame, uint flags, CGameObject *obj);
 	
 	/**
 	 * Plays a sub-section of a movie
 	 */
-	virtual void playClip(const Rect &rect, uint startFrame, uint endFrame);
-
-	virtual void proc11();
-	virtual void proc12(int v1, int v2, int frameNumber, int flags, CGameObject *obj);
+	virtual void playClip(const Point &drawPos, uint startFrame, uint endFrame);
 
 	/**
 	 * Stops the movie
 	 */
 	virtual void stop();
 	
-	virtual void proc14();
+	/**
+	 * Add a playback event
+	 */
+	virtual void addEvent(int eventId, CGameObject *obj);
 
 	/**
 	 * Set the current frame number
 	 */
 	virtual void setFrame(uint frameNumber);
 	
-	virtual void proc16();
+	/**
+	 * Handle any pending movie events
+	 */
+	virtual bool handleEvents(CMovieEventList &events);
 
 	/**
-	 * Return any movie range info associated with the movie
+	 * Get the current frame number
 	 */
-	virtual const Common::List<CMovieRangeInfo *> getMovieRangeInfo() const;
+	virtual int getFrame() const;
 
 	/**
-	 * Set the sound manager reference
+	 * Return any movie range info associated with the movie
 	 */
-	virtual void setSoundManager(CSoundManager *soundManager);
+	virtual const CMovieRangeInfoList *getMovieRangeInfo() const;
 
 	/**
-	 * Get the current movie frame
+	 * Set the sound manager reference
 	 */
-	virtual int getFrame();
+	virtual void setSoundManager(CSoundManager *soundManager);
 
 	virtual void proc20();
-	virtual void *proc21();
-
+	virtual int proc21();
 
-	virtual MovieState getState();
-	virtual void update();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie_event.cpp b/engines/titanic/support/movie_event.cpp
index 870a06f..5f8a6da 100644
--- a/engines/titanic/support/movie_event.cpp
+++ b/engines/titanic/support/movie_event.cpp
@@ -21,27 +21,29 @@
  */
 
 #include "titanic/support/movie_event.h"
+#include "titanic/core/game_object.h"
 
 namespace Titanic {
 
-CMovieEvent::CMovieEvent() : ListItem(), _fieldC(0), _field10(0),
-	_field14(0), _field1C(0) {
+CMovieEvent::CMovieEvent() : ListItem(), _type(MET_PLAY), _startFrame(0),
+	_endFrame(0), _initialFrame(0), _gameObject(nullptr) {
 }
 
 CMovieEvent::CMovieEvent(const CMovieEvent *src) {
-	_fieldC = src->_fieldC;
-	_field10 = src->_field10;
-	_field14 = src->_field14;
-	_field18 = src->_field18;
-	_field1C = src->_field1C;
+	_type = src->_type;
+	_startFrame = src->_startFrame;
+	_endFrame = src->_endFrame;
+	_initialFrame = src->_initialFrame;
+	_gameObject = src->_gameObject;
 }
 
 void CMovieEvent::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
-	file->writeNumberLine(_fieldC, indent + 1);
-	file->writeNumberLine(_field10, indent + 1);
-	file->writeNumberLine(_field14, indent + 1);
-	file->writeNumberLine(_field1C, indent + 1);
+	file->writeNumberLine(_startFrame, indent + 1);
+	file->writeNumberLine(_endFrame, indent + 1);
+	error("FIXME: Original save/loaded object pointer");
+	//	file->writeNumberLine(_gameObject, indent + 1);
+	file->writeNumberLine(_initialFrame, indent + 1);
 
 	ListItem::save(file, indent);
 }
@@ -49,10 +51,11 @@ void CMovieEvent::save(SimpleFile *file, int indent) {
 void CMovieEvent::load(SimpleFile *file) {
 	int val = file->readNumber();
 	if (!val) {
-		_fieldC = file->readNumber();
-		_field10 = file->readNumber();
-		_field14 = file->readNumber();
-		_field1C = file->readNumber();
+		_startFrame = file->readNumber();
+		_endFrame = file->readNumber();
+		file->readNumber();
+		error("FIXME: Original save/loaded object pointer");
+		_initialFrame = file->readNumber();
 	}
 
 	ListItem::load(file);
diff --git a/engines/titanic/support/movie_event.h b/engines/titanic/support/movie_event.h
index ed72e2d..af93c76 100644
--- a/engines/titanic/support/movie_event.h
+++ b/engines/titanic/support/movie_event.h
@@ -27,13 +27,17 @@
 
 namespace Titanic {
 
+enum MovieEventType { MET_PLAY = 0, MET_MOVIE_END = 1, MET_FRAME = 2 };
+
+class CGameObject;
+
 class CMovieEvent : public ListItem {
 public:
-	int _fieldC;
-	int _field10;
-	int _field14;
-	int _field18;
-	int _field1C;
+	MovieEventType _type;
+	int _startFrame;
+	int _endFrame;
+	CGameObject *_gameObject;
+	int _initialFrame;
 public:
 	CMovieEvent();
 	CMovieEvent(const CMovieEvent *src);
@@ -53,6 +57,10 @@ public:
 class CMovieEventList : public List<CMovieEvent> {
 };
 
+class CSharedMovieEventList : public Common::List<CMovieEvent> {
+};
+
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_MOVIE_EVENT_H */
diff --git a/engines/titanic/support/movie_range_info.cpp b/engines/titanic/support/movie_range_info.cpp
index e6b28ce..4c62539 100644
--- a/engines/titanic/support/movie_range_info.cpp
+++ b/engines/titanic/support/movie_range_info.cpp
@@ -34,11 +34,11 @@ CMovieRangeInfo::~CMovieRangeInfo() {
 }
 
 CMovieRangeInfo::CMovieRangeInfo(const CMovieRangeInfo *src) : ListItem() {
-	_fieldC = src->_fieldC;
-	_field10 = src->_field10;
-	_frameNumber = src->_frameNumber;
 	_startFrame = src->_startFrame;
 	_endFrame = src->_endFrame;
+	_initialFrame = src->_initialFrame;
+	_isReversed = src->_isReversed;
+	_isFlag1 = src->_isFlag1;
 
 	// Duplicate the events list
 	for (CMovieEventList::const_iterator i = _events.begin();
@@ -49,38 +49,38 @@ CMovieRangeInfo::CMovieRangeInfo(const CMovieRangeInfo *src) : ListItem() {
 
 void CMovieRangeInfo::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
-	file->writeNumberLine(_fieldC, indent + 1);
-	file->writeNumberLine(_field10, indent + 1);
-	file->writeNumberLine(_frameNumber, indent + 1);
-	file->writeNumberLine(_endFrame, indent + 1);
 	file->writeNumberLine(_startFrame, indent + 1);
+	file->writeNumberLine(_endFrame, indent + 1);
+	file->writeNumberLine(_initialFrame, indent + 1);
+	file->writeNumberLine(_isFlag1, indent + 1);
+	file->writeNumberLine(_isReversed, indent + 1);
 	_events.save(file, indent + 1);
 }
 
 void CMovieRangeInfo::load(SimpleFile *file) {
 	int val = file->readNumber();
 	if (!val) {
-		_fieldC = file->readNumber();
-		_field10 = file->readNumber();
-		_frameNumber = file->readNumber();
-		_endFrame = file->readNumber();
 		_startFrame = file->readNumber();
+		_endFrame = file->readNumber();
+		_initialFrame = file->readNumber();
+		_isFlag1 = file->readNumber();
+		_isReversed = file->readNumber();
 		_events.load(file);
 	}
 }
 
-void CMovieRangeInfo::get1(CMovieEventList &list) {
+void CMovieRangeInfo::getMovieEnd(CMovieEventList &list) {
 	for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) {
 		CMovieEvent *movieEvent = *i;
-		if (movieEvent->_fieldC == 1)
+		if (movieEvent->_type == MET_MOVIE_END)
 			list.push_back(new CMovieEvent(movieEvent));
 	}
 }
 
-void CMovieRangeInfo::get2(CMovieEventList &list, int val) {
+void CMovieRangeInfo::getMovieFrame(CMovieEventList &list, int frameNumber) {
 	for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) {
 		CMovieEvent *movieEvent = *i;
-		if (movieEvent->_fieldC == 2 && movieEvent->_field1C == val)
+		if (movieEvent->_type == MET_FRAME && movieEvent->_initialFrame == frameNumber)
 			list.push_back(new CMovieEvent(movieEvent));
 	}
 }
@@ -88,24 +88,24 @@ void CMovieRangeInfo::get2(CMovieEventList &list, int val) {
 void CMovieRangeInfo::process(CGameObject *owner) {
 	int flags = 0;
 	if (_endFrame)
-		flags |= CLIPFLAG_HAS_END_FRAME;
+		flags |= MOVIE_1;
 	if (_startFrame)
-		flags |= CLIPFLAG_HAS_START_FRAME;
+		flags |= MOVIE_REVERSE;
 	
 	for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) {
 		CMovieEvent *movieEvent = *i;
-		if (!movieEvent->_fieldC) {
+		if (!movieEvent->_type == MET_PLAY) {
 			flags |= CLIPFLAG_PLAY;
 			break;
 		}
 	}
 
-	owner->checkPlayMovie(_fieldC, _field10, _frameNumber, flags);
+	owner->playMovie(_startFrame, _endFrame, _initialFrame, flags);
 
 	for (CMovieEventList::iterator i = _events.begin(); i != _events.end(); ++i) {
 		CMovieEvent *movieEvent = *i;
-		if (!movieEvent->_fieldC)
-			owner->surface38(movieEvent->_field1C);
+		if (movieEvent->_type == MET_PLAY)
+			owner->movieEvent(movieEvent->_initialFrame);
 	}
 }
 
diff --git a/engines/titanic/support/movie_range_info.h b/engines/titanic/support/movie_range_info.h
index be04975..b8186e6 100644
--- a/engines/titanic/support/movie_range_info.h
+++ b/engines/titanic/support/movie_range_info.h
@@ -34,11 +34,11 @@ class CGameObject;
 
 class CMovieRangeInfo : public ListItem {
 public:
-	int _fieldC;
-	int _field10;
-	int _frameNumber;
-	uint _startFrame;
-	uint _endFrame;
+	int _startFrame;
+	int _endFrame;
+	int _initialFrame;
+	bool _isReversed;
+	bool _isFlag1;
 	CMovieEventList _events;
 public:
 	CMovieRangeInfo();
@@ -60,9 +60,15 @@ public:
 	 */
 	void addEvent(CMovieEvent *movieEvent) { _events.push_back(movieEvent); }
 
-	void get1(CMovieEventList &list);
+	/**
+	 * Get any movie end events for the range
+	 */
+	void getMovieEnd(CMovieEventList &list);
 
-	void get2(CMovieEventList &list, int val);
+	/**
+	 * Get any movie frame events for a specified frame number
+	 */
+	void getMovieFrame(CMovieEventList &list, int frameNumber);
 
 	void process(CGameObject *owner);
 };
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 0335e7d..fc7db30 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -32,7 +32,7 @@ int CVideoSurface::_videoSurfaceCounter = 0;
 CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
 		_screenManager(screenManager), _rawSurface(nullptr), _movie(nullptr),
 		_pendingLoad(false), _blitStyleFlag(false), _blitFlag(false),
-		_field40(nullptr), _field44(4), _field48(0), _field50(1) {
+		_movieFrameInfo(nullptr), _transparencyMode(TRANS_DEFAULT), _field48(0), _field50(1) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
 }
 
@@ -427,22 +427,22 @@ void OSVideoSurface::clear() {
 
 }
 
-void OSVideoSurface::playMovie(uint flags, CVideoSurface *surface) {
+void OSVideoSurface::playMovie(uint flags, CGameObject *obj) {
 	if (loadIfReady() && _movie)
-		_movie->play(flags, surface);
+		_movie->play(flags, obj);
 
 	_ddSurface->fill(nullptr, 0);
 }
 
-void OSVideoSurface::playMovie(uint startFrame, uint endFrame, int v3, bool v4) {
+void OSVideoSurface::playMovie(uint startFrame, uint endFrame, uint flags, CGameObject *obj) {
 	if (loadIfReady() && _movie) {
-		_movie->play(startFrame, endFrame, v3, v4);
+		_movie->play(startFrame, endFrame, flags, obj);
 	}
 }
 
-void OSVideoSurface::proc35(int v1, int v2, int frameNumber, int flags, CGameObject *owner) {
+void OSVideoSurface::playMovie(uint startFrame, uint endFrame, uint initialFrame, uint flags, CGameObject *obj) {
 	if (loadIfReady() && _movie) {
-		_movie->proc12(v1, v2, frameNumber, flags, owner);
+		_movie->play(startFrame, endFrame, initialFrame, flags, obj);
 	}
 }
 
@@ -456,16 +456,17 @@ void OSVideoSurface::setMovieFrame(uint frameNumber) {
 		_movie->setFrame(frameNumber);
 }
 
-void OSVideoSurface::proc38(int v1, int v2) {
-	warning("OSVideoSurface::proc38");
+void OSVideoSurface::addMovieEvent(int frameNumber, CGameObject *obj) {
+	if (_movie)
+		_movie->addEvent(frameNumber, obj);
 }
 
 void OSVideoSurface::proc39(int v1, int v2) {
 	warning("OSVideoSurface::proc39");
 }
 
-const Common::List<CMovieRangeInfo *> OSVideoSurface::getMovieRangeInfo() const {
-	return _movie ? _movie->getMovieRangeInfo() : Common::List<CMovieRangeInfo *>();
+const CMovieRangeInfoList *OSVideoSurface::getMovieRangeInfo() const {
+	return _movie ? _movie->getMovieRangeInfo() : nullptr;
 }
 
 bool OSVideoSurface::loadIfReady() {
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 37afccf..3521be6 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -35,6 +35,11 @@
 
 namespace Titanic {
 
+enum TransparencyMode {
+	TRANS_MASK0 = 0, TRANS_MASK255 = 1, TRANS_ALPHA0 = 2,
+	TRANS_ALPHA255 = 3, TRANS_DEFAULT = 4
+};
+
 class CScreenManager;
 class CJPEGDecode;
 class CTargaDecode;
@@ -57,8 +62,7 @@ protected:
 	CScreenManager *_screenManager;
 	Graphics::ManagedSurface *_rawSurface;
 	bool _pendingLoad;
-	void *_field40;
-	int _field44;
+	const void *_movieFrameInfo;
 	int _field48;
 	int _videoSurfaceNum;
 	int _field50;
@@ -69,6 +73,7 @@ public:
 	bool _blitFlag;
 	bool _blitStyleFlag;
 	CResourceKey _resourceKey;
+	TransparencyMode _transparencyMode;
 public:
 	CVideoSurface(CScreenManager *screenManager);
 	virtual ~CVideoSurface();
@@ -190,15 +195,19 @@ public:
 	 * Plays a movie, loading it from the specified _resource
 	 * if not already loaded
 	 */
-	virtual void playMovie(uint flags, CVideoSurface *surface) = 0;
+	virtual void playMovie(uint flags, CGameObject *obj) = 0;
 
 	/**
 	 * Plays a movie, loading it from the specified _resource
 	 * if not already loaded
 	 */
-	virtual void playMovie(uint startFrame, uint endFrame, int v3, bool v4) = 0;
+	virtual void playMovie(uint startFrame, uint endFrame, uint flags, CGameObject *obj) = 0;
 
-	virtual void proc35(int v1, int v2, int frameNumber, int flags, CGameObject *owner) = 0;
+	/**
+	 * Plays a movie, loading it from the specified _resource
+	 * if not already loaded
+	 */
+	virtual void playMovie(uint startFrame, uint endFrame, uint initialFrame, uint flags, CGameObject *obj) = 0;
 
 	/**
 	 * Stops any movie currently attached to the surface
@@ -206,18 +215,21 @@ public:
 	virtual void stopMovie() = 0;
 
 	/**
-	 * Sets the movie to the specified frame number
+	 * Set the current movie frame number
 	 */
 	virtual void setMovieFrame(uint frameNumber) = 0;
 
-	virtual void proc38(int v1, int v2) = 0;
+	/**
+	 * Adds a movie playback event
+	 */
+	virtual void addMovieEvent(int eventId, CGameObject *obj) = 0;
 
 	virtual void proc39(int v1, int v2) = 0;
 
 	/**
 	 * Return any movie range info associated with the surface's movie
 	 */
-	virtual const Common::List<CMovieRangeInfo *> getMovieRangeInfo() const = 0;
+	virtual const CMovieRangeInfoList *getMovieRangeInfo() const = 0;
 
 	/**
 	 * Loads the surface's resource if there's one pending
@@ -257,8 +269,19 @@ public:
 	 */
 	void blitFrom(const Point &destPos, const Graphics::Surface *src);
 
-	void set40(void *v) { _field40 = v; }
+	/**
+	 *
+	 */
+	void setMovieFrameInfo(const void *frameInfo) { _movieFrameInfo = frameInfo; }
+
+	/**
+	 */
+	const void *getMovieFrameInfo() const { return _movieFrameInfo; }
 
+	/**
+	 * Get the pixels associated with the surface. Only valid when the
+	 * surface has been locked for access
+	 */
 	uint16 *getPixels() { return (uint16 *)_rawSurface->getPixels(); }
 
 	/**
@@ -400,15 +423,19 @@ public:
 	 * Plays a movie, loading it from the specified _resource
 	 * if not already loaded
 	 */
-	virtual void playMovie(uint flags, CVideoSurface *surface);
+	virtual void playMovie(uint flags, CGameObject *obj);
 
 	/**
 	 * Plays a movie, loading it from the specified _resource
 	 * if not already loaded
 	 */
-	virtual void playMovie(uint startFrame, uint endFrame, int v3, bool v4);
+	virtual void playMovie(uint startFrame, uint endFrame, uint flags, CGameObject *obj);
 
-	virtual void proc35(int v1, int v2, int frameNumber, int flags, CGameObject *owner);
+	/**
+	 * Plays a movie, loading it from the specified _resource
+	 * if not already loaded
+	 */
+	virtual void playMovie(uint startFrame, uint endFrame, uint initialFrame, uint flags, CGameObject *obj);
 
 	/**
 	 * Stops any movie currently attached to the surface
@@ -420,14 +447,17 @@ public:
 	 */
 	virtual void setMovieFrame(uint frameNumber);
 
-	virtual void proc38(int v1, int v2);
+	/**
+	 * Adds a movie playback event
+	 */
+	virtual void addMovieEvent(int frameNumber, CGameObject *obj);
 
 	virtual void proc39(int v1, int v2);
 
 	/**
 	 * Return any movie range info associated with the surface's movie
 	 */
-	virtual const Common::List<CMovieRangeInfo *> getMovieRangeInfo() const;
+	virtual const CMovieRangeInfoList *getMovieRangeInfo() const;
 
 	/**
 	 * Loads the surface's resource if there's one pending


Commit: 6c56d5aa11db1401bc0a2277776ec43128174bc2
    https://github.com/scummvm/scummvm/commit/6c56d5aa11db1401bc0a2277776ec43128174bc2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:37-04:00

Commit Message:
TITANIC: Named two remaining OSMovie virtual methods

Changed paths:
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/avi_surface.h
    engines/titanic/support/mouse_cursor.cpp
    engines/titanic/support/mouse_cursor.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h



diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 47127fe..a416bc3 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -214,4 +214,16 @@ bool AVISurface::addEvent(int frameNumber, CGameObject *obj) {
 	return false;
 }
 
+void AVISurface::setFrameRate(double rate) {
+	if (rate >= 0.0 && rate <= 100.0) {
+		_frameRate = rate;
+		warning("TODO: Frame rate set to %d yet to be implemented", (int)rate);
+	}
+}
+
+void *AVISurface::duplicateFrameInfo() const {
+	// TODO
+	return nullptr;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index 48c8169..fe3e972 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -127,6 +127,11 @@ public:
 	 */
 	bool addEvent(int frameNumber, CGameObject *obj);
 
+	/**
+	 * Set the frame rate
+	 */
+	void setFrameRate(double rate);
+
 	const void *getFrameInfo() const {
 		return _streamCount <= 1 ? nullptr : _frameInfo;
 	}
@@ -138,6 +143,10 @@ public:
 		return &_movieRangeInfo;
 	}
 
+	/**
+	 * Duplicate the frame info
+	 */
+	void *duplicateFrameInfo() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index 721088f..be607a4 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -97,11 +97,11 @@ void CMouseCursor::loadCursorImages() {
 		OSMovie movie(stream, surface);
 		movie.setFrame(idx);
 		
-		int frameNum = movie.proc21();
-		_cursors[idx]._frameNumber = frameNum;
-		surface->setMovieFrame(frameNum);
-*/
-		}
+		void *frameInfo = movie.duplicateFrameInfo();
+		_cursors[idx]._frameInfo = frameInfo;
+		surface->setMovieFrameInfo(frameInfo);
+		*/
+	}
 }
 
 void CMouseCursor::show() {
diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h
index 168a7be..f674ccd 100644
--- a/engines/titanic/support/mouse_cursor.h
+++ b/engines/titanic/support/mouse_cursor.h
@@ -54,8 +54,11 @@ class CVideoSurface;
 class CMouseCursor {
 	struct CursorEntry {
 		CVideoSurface *_videoSurface;
-		int _frameNumber;
+		void *_frameInfo;
 		Common::Point _centroid;
+
+		CursorEntry() : _videoSurface(nullptr), _frameInfo(nullptr) {}
+		~CursorEntry() { delete _frameInfo; }
 	};
 private:
 	CScreenManager *_screenManager;
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 338396f..fc31750 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -213,14 +213,12 @@ void OSMovie::movieStarted() {
 	_field10 = 1;
 }
 
-void OSMovie::proc20() {
-	// TODO
+void OSMovie::setFrameRate(double rate) {
+	_aviSurface.setFrameRate(rate);
 }
 
-int OSMovie::proc21() {
-	// TODO
-	return 0;
+void *OSMovie::duplicateFrameInfo() const {
+	return _aviSurface.duplicateFrameInfo();
 }
 
-
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index c839c88..8034bd4 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -126,9 +126,16 @@ public:
 	 * Get the current movie frame
 	 */
 	virtual int getFrame() const = 0;
-	
-	virtual void proc20() = 0;
-	virtual int proc21() = 0;
+
+	/**
+	 * Set the frame rate for the movie
+	 */
+	virtual void setFrameRate(double rate) = 0;
+
+	/**
+	* Creates a duplicate of the frame info
+	*/
+	virtual void *duplicateFrameInfo() const = 0;
 
 	/**
 	 * Removes the movie from the list of currently playing movies
@@ -218,9 +225,15 @@ public:
 	 */
 	virtual void setSoundManager(CSoundManager *soundManager);
 
-	virtual void proc20();
-	virtual int proc21();
+	/**
+	 * Set the frame rate for the movie
+	 */
+	virtual void setFrameRate(double rate);
 
+	/**
+	 * Creates a duplicate of the frame info
+	 */
+	virtual void *duplicateFrameInfo() const;
 };
 
 } // End of namespace Titanic


Commit: fd954a8e0b41370ae68f3b409295676de207313d
    https://github.com/scummvm/scummvm/commit/fd954a8e0b41370ae68f3b409295676de207313d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:40-04:00

Commit Message:
TITANIC: Added OSVideoSurface flipVertically

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 78b91c3..eeb765e 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -927,9 +927,9 @@ void CGameObject::dec54() {
 	getGameManager()->dec54();
 }
 
-void CGameObject::surface39(int v1, int v2) {
+void CGameObject::setMovieFrameRate(double rate) {
 	if (_surface)
-		_surface->proc39(v1, v2);
+		_surface->setMovieFrameRate(rate);
 }
 
 void CGameObject::setTextBorder(const CString &str, int border, int borderRight) {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 58ae4c6..b74c35f 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -437,7 +437,10 @@ protected:
 	 */
 	void quitGame();
 
-	void surface39(int v1, int v2);
+	/**
+	 * Set the frame rate for the currently loaded movie
+	 */
+	void setMovieFrameRate(double rate);
 
 	/**
 	 * Set up the text borders for the object
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index a416bc3..e371ccb 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -27,23 +27,24 @@
 namespace Titanic {
 
 AVISurface::AVISurface(const CResourceKey &key) {
+	_videoSurface = nullptr;
+	_field4 = 0;
+	_field8 = 0;
+	_currentPos = 0;
+	_priorFrame = 0;
+	_streamCount = 0;
+	_frameInfo = nullptr;
 
-	// TODO
-/*
-Video::AVIDecoder *decoder = new Video::AVIDecoder();
-decoder->ignoreSecondaryVideoTracks();
-_video = decoder;
-_field14 = 1;
-
-if (!_video->loadFile(name.getString()))
-error("Could not open video - %s", name.getString().c_str());
-*/
+	_decoder = new Video::AVIDecoder();
+	if (!_decoder->loadFile(key.getString()))
+		error("Could not open video - %s", key.getString().c_str());
 }
 
 AVISurface::~AVISurface() {
 	if (_videoSurface)
 		_videoSurface->_blitStyleFlag = false;
 	delete _frameInfo;
+	delete _decoder;
 }
 
 bool AVISurface::play(uint flags, CGameObject *obj) {
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index fc7db30..546c2c4 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -461,14 +461,40 @@ void OSVideoSurface::addMovieEvent(int frameNumber, CGameObject *obj) {
 		_movie->addEvent(frameNumber, obj);
 }
 
-void OSVideoSurface::proc39(int v1, int v2) {
-	warning("OSVideoSurface::proc39");
+void OSVideoSurface::setMovieFrameRate(double rate) {
+	if (_movie)
+		_movie->setFrameRate(rate);
 }
 
 const CMovieRangeInfoList *OSVideoSurface::getMovieRangeInfo() const {
 	return _movie ? _movie->getMovieRangeInfo() : nullptr;
 }
 
+void OSVideoSurface::flipVertically(bool needsLock) {
+	if (!loadIfReady() || !_blitStyleFlag)
+		return;
+
+	if (needsLock)
+		lock();
+
+	byte lineBuffer[SCREEN_WIDTH * 2];
+	int pitch = getBpp() * getWidth();
+	assert(pitch < (SCREEN_WIDTH * 2));
+
+	for (int yp = 0; yp < (_rawSurface->h / 2); ++yp) {
+		byte *line1P = (byte *)_rawSurface->getBasePtr(0, yp);
+		byte *line2P = (byte *)_rawSurface->getBasePtr(0, _rawSurface->h - yp - 1);
+
+		Common::copy(line1P, line1P + pitch, lineBuffer);
+		Common::copy(line2P, line2P + pitch, line1P);
+		Common::copy(lineBuffer, lineBuffer + pitch, line1P);
+	}
+
+	_blitStyleFlag = false;
+	if (needsLock)
+		unlock();
+}
+
 bool OSVideoSurface::loadIfReady() {
 	_videoSurfaceNum = _videoSurfaceCounter;
 
@@ -511,6 +537,10 @@ void OSVideoSurface::transPixelate() {
 	unlock();
 }
 
+void *OSVideoSurface::dupMovieFrameInfo() const {
+	return _movie ? _movie->duplicateFrameInfo() : nullptr;
+}
+
 int OSVideoSurface::freeSurface() {
 	if (!_ddSurface)
 		return 0;
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 3521be6..c8cfb78 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -224,7 +224,10 @@ public:
 	 */
 	virtual void addMovieEvent(int eventId, CGameObject *obj) = 0;
 
-	virtual void proc39(int v1, int v2) = 0;
+	/**
+	 * Set the movie frame rate
+	 */
+	virtual void setMovieFrameRate(double rate) = 0;
 
 	/**
 	 * Return any movie range info associated with the surface's movie
@@ -232,6 +235,11 @@ public:
 	virtual const CMovieRangeInfoList *getMovieRangeInfo() const = 0;
 
 	/**
+	 *
+	 */
+	virtual void flipVertically(bool needsLock = true) = 0;
+
+	/**
 	 * Loads the surface's resource if there's one pending
 	 */
 	virtual bool loadIfReady() = 0;
@@ -250,6 +258,11 @@ public:
 	virtual bool proc45();
 
 	/**
+	* Duplicates movie frame info
+	*/
+	virtual void *dupMovieFrameInfo() const = 0;
+
+	/**
 	 * Frees the underlying surface
 	 */
 	virtual int freeSurface() { return 0; }
@@ -452,7 +465,10 @@ public:
 	 */
 	virtual void addMovieEvent(int frameNumber, CGameObject *obj);
 
-	virtual void proc39(int v1, int v2);
+	/**
+	 * Set the movie frame rate
+	 */
+	virtual void setMovieFrameRate(double rate);
 
 	/**
 	 * Return any movie range info associated with the surface's movie
@@ -460,6 +476,11 @@ public:
 	virtual const CMovieRangeInfoList *getMovieRangeInfo() const;
 
 	/**
+	 *
+	 */
+	virtual void flipVertically(bool needsLock = true);
+
+	/**
 	 * Loads the surface's resource if there's one pending
 	 */
 	virtual bool loadIfReady();
@@ -476,6 +497,12 @@ public:
 	virtual void transPixelate();
 
 	/**
+	 * Duplicates movie frame info
+	 */
+	virtual void *dupMovieFrameInfo() const;
+
+
+	/**
 	 * Frees the underlying surface
 	 */
 	virtual int freeSurface();


Commit: 62f2763bf794dfb711fd48e32d7c2162bdb5aed8
    https://github.com/scummvm/scummvm/commit/62f2763bf794dfb711fd48e32d7c2162bdb5aed8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:42-04:00

Commit Message:
VIDEO: Respect RIFF filesize field when decoding AVI files

Starship Titanic in particular needs this, since some of the videos
have extra junk at the end of the file, such as ycursors.avi,
and parsing fails if we don't respect the filesize field

Changed paths:
    video/avi_decoder.cpp



diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp
index 52a55f6..8f1bec4 100644
--- a/video/avi_decoder.cpp
+++ b/video/avi_decoder.cpp
@@ -296,7 +296,7 @@ bool AVIDecoder::loadStream(Common::SeekableReadStream *stream) {
 		return false;
 	}
 
-	/* uint32 fileSize = */ stream->readUint32LE();
+	uint32 fileSize = stream->readUint32LE();
 	uint32 riffType = stream->readUint32BE();
 
 	if (riffType != ID_AVI) {
@@ -307,7 +307,7 @@ bool AVIDecoder::loadStream(Common::SeekableReadStream *stream) {
 	_fileStream = stream;
 
 	// Go through all chunks in the file
-	while (parseNextChunk())
+	while (_fileStream->pos() < fileSize && parseNextChunk())
 		;
 
 	if (!_decodedHeader) {


Commit: 207e1cbb296c8f825d19167d420bbf141398ac1d
    https://github.com/scummvm/scummvm/commit/207e1cbb296c8f825d19167d420bbf141398ac1d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-15T19:27:44-04:00

Commit Message:
TITANIC: Remove old hard-coded video loading code from cursors loading

Changed paths:
    engines/titanic/support/mouse_cursor.cpp



diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index be607a4..496b152 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -63,26 +63,10 @@ CMouseCursor::~CMouseCursor() {
 }
 
 void CMouseCursor::loadCursorImages() {
-	const CString name("ycursors.avi");
-	g_vm->_filesManager->fn4(name);
-
-	// WORKAROUND: We need to manipulate ycursors.avi file so it can be read
-	// by the ScummVM AVIDecoder, by removing the redundant second video track
-	Common::File f;
-	if (!f.open(name))
-		error("Could not open cursors file");
-
-	// Read in the entire file
-	byte *movieData = (byte *)malloc(f.size());
-	f.read(movieData, f.size());
-
-	if (READ_BE_UINT32(movieData + 254) == MKTAG('s', 't', 'r', 'h')) {
-		// Change the second video chunk to junk data so it gets ignored
-		WRITE_BE_UINT32(movieData + 254, MKTAG('J', 'U', 'N', 'K'));
-		WRITE_LE_UINT32(movieData + 258, 1128);
-	}
+	const CResourceKey key("ycursors.avi");
+	g_vm->_filesManager->fn4(key.getString());
 
-	// Iterate through each cursor
+	// Iterate through getting each cursor
 	for (int idx = 0; idx < NUM_CURSORS; ++idx) {
 		assert(CURSOR_DATA[idx][0] == (idx + 1));
 		_cursors[idx]._centroid = Common::Point(CURSOR_DATA[idx][2],
@@ -91,16 +75,14 @@ void CMouseCursor::loadCursorImages() {
 		// Create the surface
 		CVideoSurface *surface = _screenManager->createSurface(64, 64);
 		_cursors[idx]._videoSurface = surface;
-/*
-		Common::SeekableReadStream *stream = new Common::MemoryReadStream(
-			movieData, f.size(), DisposeAfterUse::NO);
-		OSMovie movie(stream, surface);
+
+		// Open the cursors video and move to the given frame
+		OSMovie movie(key, surface);
 		movie.setFrame(idx);
 		
 		void *frameInfo = movie.duplicateFrameInfo();
 		_cursors[idx]._frameInfo = frameInfo;
 		surface->setMovieFrameInfo(frameInfo);
-		*/
 	}
 }
 


Commit: fa6e12aaab4e19424481fc26eab281663cbf3283
    https://github.com/scummvm/scummvm/commit/fa6e12aaab4e19424481fc26eab281663cbf3283
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:08:31-04:00

Commit Message:
VIDEO: Add support for a track filtering callback function

This is needed for Starship Titanic, where videos can have a secondary
video track. It was simpler to use the callback as a means to select
one video track each across two decoders than trying to make VideoDecoder
and/or AVIDecoder support decoding from multiple video tracks simultaneously

Changed paths:
    video/avi_decoder.cpp
    video/avi_decoder.h



diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp
index 8f1bec4..cb087c7 100644
--- a/video/avi_decoder.cpp
+++ b/video/avi_decoder.cpp
@@ -76,12 +76,13 @@ enum {
 };
 
 
-AVIDecoder::AVIDecoder(Audio::Mixer::SoundType soundType) : _frameRateOverride(0), _soundType(soundType) {
+AVIDecoder::AVIDecoder(Audio::Mixer::SoundType soundType, SelectTrackFn trackFn) : 
+		_frameRateOverride(0), _soundType(soundType), _selectTrackFn(trackFn) {
 	initCommon();
 }
 
-AVIDecoder::AVIDecoder(const Common::Rational &frameRateOverride, Audio::Mixer::SoundType soundType)
-		: _frameRateOverride(frameRateOverride), _soundType(soundType) {
+AVIDecoder::AVIDecoder(const Common::Rational &frameRateOverride, Audio::Mixer::SoundType soundType,
+		SelectTrackFn trackFn) : _frameRateOverride(frameRateOverride), _soundType(soundType), _selectTrackFn(trackFn) {
 	initCommon();
 }
 
@@ -99,6 +100,7 @@ void AVIDecoder::initCommon() {
 	_movieListStart = 0;
 	_movieListEnd = 0;
 	_fileStream = 0;
+	_videoTrackCounter = _audioTrackCounter = 0;
 	memset(&_header, 0, sizeof(_header));
 }
 
@@ -263,7 +265,8 @@ void AVIDecoder::handleStreamHeader(uint32 size) {
 			}
 		}
 
-		addTrack(new AVIVideoTrack(_header.totalFrames, sHeader, bmInfo, initialPalette));
+		if (!_selectTrackFn || _selectTrackFn(true, _videoTrackCounter++))
+			addTrack(new AVIVideoTrack(_header.totalFrames, sHeader, bmInfo, initialPalette));
 	} else if (sHeader.streamType == ID_AUDS) {
 		PCMWaveFormat wvInfo;
 		wvInfo.tag = _fileStream->readUint16LE();
@@ -278,9 +281,11 @@ void AVIDecoder::handleStreamHeader(uint32 size) {
 		if (wvInfo.channels == 2)
 			sHeader.sampleSize /= 2;
 
-		AVIAudioTrack *track = createAudioTrack(sHeader, wvInfo);
-		track->createAudioStream();
-		addTrack(track);
+		if (!_selectTrackFn || _selectTrackFn(false, _audioTrackCounter++)) {
+			AVIAudioTrack *track = createAudioTrack(sHeader, wvInfo);
+			track->createAudioStream();
+			addTrack(track);
+		}
 	}
 
 	// Ensure that we're at the end of the chunk
@@ -337,7 +342,6 @@ bool AVIDecoder::loadStream(Common::SeekableReadStream *stream) {
 	}
 
 	if (_videoTracks.size() != 1) {
-		warning("Unhandled AVI video track count: %d", _videoTracks.size());
 		close();
 		return false;
 	}
diff --git a/video/avi_decoder.h b/video/avi_decoder.h
index 96d9e82..04e6a18 100644
--- a/video/avi_decoder.h
+++ b/video/avi_decoder.h
@@ -61,8 +61,10 @@ namespace Video {
  */
 class AVIDecoder : public VideoDecoder {
 public:
-	AVIDecoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType);
-	AVIDecoder(const Common::Rational &frameRateOverride, Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType);
+	typedef bool(*SelectTrackFn)(bool isVideo, int trackNumber);
+	AVIDecoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType, SelectTrackFn trackFn = nullptr);
+	AVIDecoder(const Common::Rational &frameRateOverride, Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType,
+		SelectTrackFn trackFn = nullptr);
 	virtual ~AVIDecoder();
 
 	bool loadStream(Common::SeekableReadStream *stream);
@@ -268,6 +270,10 @@ protected:
 
 	Audio::Mixer::SoundType _soundType;
 	Common::Rational _frameRateOverride;
+
+	int _videoTrackCounter, _audioTrackCounter;
+	SelectTrackFn _selectTrackFn;
+
 	void initCommon();
 
 	bool parseNextChunk();


Commit: 8a6bba0fec0718f9c9fc9b69478b8aa6ff0bd791
    https://github.com/scummvm/scummvm/commit/8a6bba0fec0718f9c9fc9b69478b8aa6ff0bd791
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:17-04:00

Commit Message:
TITANIC: Change AVISurface to use a separate AVIDecoder for each video track

Changed paths:
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/avi_surface.h



diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index e371ccb..96bd6f7 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -26,6 +26,21 @@
 
 namespace Titanic {
 
+/**
+ * Track filter for AVIDecoder that filters out any secondary video track
+ */
+static bool primaryTrackSelect(bool isVideo, int trackCounter) {
+	return !isVideo || trackCounter == 0;
+}
+
+/**
+ * Track filter for AVIDecoder that only accepts the secondary video track
+ * for a video, if present
+ */
+static bool secondaryTrackSelect(bool isVideo, int trackCounter) {
+	return isVideo && trackCounter > 0;
+}
+
 AVISurface::AVISurface(const CResourceKey &key) {
 	_videoSurface = nullptr;
 	_field4 = 0;
@@ -34,24 +49,35 @@ AVISurface::AVISurface(const CResourceKey &key) {
 	_priorFrame = 0;
 	_streamCount = 0;
 	_frameInfo = nullptr;
+	_isPlaying = false;
 
-	_decoder = new Video::AVIDecoder();
-	if (!_decoder->loadFile(key.getString()))
+	// Create a decoder for the audio (if any) and primary video track
+	_decoders[0] = new Video::AVIDecoder(Audio::Mixer::kPlainSoundType, primaryTrackSelect);
+	if (!_decoders[0]->loadFile(key.getString()))
 		error("Could not open video - %s", key.getString().c_str());
+
+	// Create a decoder for any secondary video track
+	Video::AVIDecoder *decoder2 = new Video::AVIDecoder(Audio::Mixer::kPlainSoundType, secondaryTrackSelect);
+	if (decoder2->loadFile(key.getString())) {
+		_decoders[1] = decoder2;
+	} else {
+		delete decoder2;
+	}
 }
 
 AVISurface::~AVISurface() {
 	if (_videoSurface)
 		_videoSurface->_blitStyleFlag = false;
 	delete _frameInfo;
-	delete _decoder;
+	delete _decoders[0];
+	delete _decoders[1];
 }
 
 bool AVISurface::play(uint flags, CGameObject *obj) {
 	if (flags & MOVIE_REVERSE)
-		return play(_decoder->getFrameCount() - 1, 0, flags, obj);
+		return play(_decoders[0]->getFrameCount() - 1, 0, flags, obj);
 	else
-		return play(0, _decoder->getFrameCount() - 1, flags, obj);
+		return play(0, _decoders[0]->getFrameCount() - 1, flags, obj);
 }
 
 bool AVISurface::play(int startFrame, int endFrame, uint flags, CGameObject *obj) {
@@ -90,7 +116,10 @@ bool AVISurface::play(int startFrame, int endFrame, int initialFrame, uint flags
 
 void AVISurface::stop() {
 	_isPlaying = false;
-	_decoder->stop();
+	_decoders[0]->stop();
+	if (_decoders[1])
+		_decoders[1]->stop();
+
 	_movieRangeInfo.destroyContents();
 }
 
@@ -110,7 +139,10 @@ bool AVISurface::changeFrame(int frameNumber) {
 }
 
 void AVISurface::seekToFrame(uint frameNumber) {
-	_decoder->seekToFrame(frameNumber);
+	_decoders[0]->seekToFrame(frameNumber);
+	if (_decoders[1])
+		_decoders[1]->seekToFrame(frameNumber);
+
 	_priorFrame = frameNumber;
 }
 
@@ -159,11 +191,11 @@ void AVISurface::setVideoSurface(CVideoSurface *surface) {
 }
 
 uint AVISurface::getWidth() const {
-	return _decoder->getWidth();
+	return _decoders[0]->getWidth();
 }
 
 uint AVISurface::getHeight() const {
-	return _decoder->getHeight();
+	return _decoders[0]->getHeight();
 }
 
 void AVISurface::setFrame(int frameNumber) {
@@ -172,26 +204,32 @@ void AVISurface::setFrame(int frameNumber) {
 		stop();
 
 	// Ensure the frame number is valid
-	if (frameNumber >= _decoder->getFrameCount())
-		frameNumber = _decoder->getFrameCount() - 1;
+	if (frameNumber >= _decoders[0]->getFrameCount())
+		frameNumber = _decoders[0]->getFrameCount() - 1;
 
 	seekToFrame(frameNumber);
 	renderFrame();
 }
 
 int AVISurface::getFrame() const {
-	return _decoder->getCurFrame();
+	return _decoders[0]->getCurFrame();
 }
 
 bool AVISurface::renderFrame() {
-	// Check there's a frame ready for 
+	// Check there's a frame ready for display
 	assert(_videoSurface);
-	if (!_decoder->needsUpdate())
+	if (!_decoders[0]->needsUpdate() || (_decoders[1] && !_decoders[1]->needsUpdate()))
 		return false;
 
 	// Get the frame to render, and draw it on the surface
-	const Graphics::Surface *frame = _decoder->decodeNextFrame();
-	_videoSurface->blitFrom(Point(0, 0), frame);
+	// TODO: Handle transparency
+	for (int idx = 0; idx < 2; ++idx) {
+		if (_decoders[idx]) {
+			const Graphics::Surface *frame = _decoders[idx]->decodeNextFrame();
+			_videoSurface->blitFrom(Point(0, 0), frame);
+		}
+	}
+
 	return false;
 }
 
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index fe3e972..f3722ca 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -39,7 +39,7 @@ enum MovieFlag {
 
 class AVISurface {
 private:
-	Video::AVIDecoder *_decoder;
+	Video::AVIDecoder *_decoders[2];
 	CVideoSurface *_videoSurface;
 	int _field4;
 	int _field8;


Commit: bb2d290dcaae8d29f56066ac92330c59862012a7
    https://github.com/scummvm/scummvm/commit/bb2d290dcaae8d29f56066ac92330c59862012a7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:20-04:00

Commit Message:
VIDEO: Handle STRN chunks in AVI file streams to set stream name

Changed paths:
    video/avi_decoder.cpp
    video/avi_decoder.h



diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp
index cb087c7..44f8ade 100644
--- a/video/avi_decoder.cpp
+++ b/video/avi_decoder.cpp
@@ -101,6 +101,7 @@ void AVIDecoder::initCommon() {
 	_movieListEnd = 0;
 	_fileStream = 0;
 	_videoTrackCounter = _audioTrackCounter = 0;
+	_lastAddedTrack = nullptr;
 	memset(&_header, 0, sizeof(_header));
 }
 
@@ -147,10 +148,12 @@ bool AVIDecoder::parseNextChunk() {
 	case ID_JUNQ: // Same as JUNK, safe to ignore
 	case ID_ISFT: // Metadata, safe to ignore
 	case ID_DISP: // Metadata, should be safe to ignore
-	case ID_STRN: // Metadata, safe to ignore
 	case ID_DMLH: // OpenDML extension, contains an extra total frames field, safe to ignore
 		skipChunk(size);
 		break;
+	case ID_STRN: // Metadata, safe to ignore
+		readStreamName(size);
+		break;
 	case ID_IDX1:
 		readOldIndex(size);
 		break;
@@ -265,8 +268,7 @@ void AVIDecoder::handleStreamHeader(uint32 size) {
 			}
 		}
 
-		if (!_selectTrackFn || _selectTrackFn(true, _videoTrackCounter++))
-			addTrack(new AVIVideoTrack(_header.totalFrames, sHeader, bmInfo, initialPalette));
+		addTrack(new AVIVideoTrack(_header.totalFrames, sHeader, bmInfo, initialPalette));
 	} else if (sHeader.streamType == ID_AUDS) {
 		PCMWaveFormat wvInfo;
 		wvInfo.tag = _fileStream->readUint16LE();
@@ -281,17 +283,48 @@ void AVIDecoder::handleStreamHeader(uint32 size) {
 		if (wvInfo.channels == 2)
 			sHeader.sampleSize /= 2;
 
-		if (!_selectTrackFn || _selectTrackFn(false, _audioTrackCounter++)) {
-			AVIAudioTrack *track = createAudioTrack(sHeader, wvInfo);
-			track->createAudioStream();
-			addTrack(track);
-		}
+		AVIAudioTrack *track = createAudioTrack(sHeader, wvInfo);
+		track->createAudioStream();
+		addTrack(track);
 	}
 
 	// Ensure that we're at the end of the chunk
 	_fileStream->seek(startPos + strfSize);
 }
 
+void AVIDecoder::addTrack(Track *track, bool isExternal) {
+	if (!_selectTrackFn ||
+			(dynamic_cast<AVIVideoTrack *>(track) && _selectTrackFn(true, _videoTrackCounter++)) ||
+			(dynamic_cast<AVIAudioTrack *>(track) && _selectTrackFn(false, _audioTrackCounter++))) {
+		VideoDecoder::addTrack(track, isExternal);
+		_lastAddedTrack = track;
+	} else {
+		_lastAddedTrack = nullptr;
+	}
+}
+
+void AVIDecoder::readStreamName(uint32 size) {
+	if (!_lastAddedTrack) {
+		skipChunk(size);
+	} else {
+		// Get in the name
+		assert(size > 0 && size < 64);
+		char buffer[64];
+		_fileStream->read(buffer, size);
+		if (size & 1)
+			_fileStream->skip(1);
+
+		// Apply it to the most recently read stream
+		assert(_lastAddedTrack);
+		AVIVideoTrack *vidTrack = dynamic_cast<AVIVideoTrack *>(_lastAddedTrack);
+		AVIAudioTrack *audTrack = dynamic_cast<AVIAudioTrack *>(_lastAddedTrack);
+		if (vidTrack)
+			vidTrack->getName() = Common::String(buffer);
+		else if (audTrack)
+			audTrack->getName() = Common::String(buffer);
+	}
+}
+
 bool AVIDecoder::loadStream(Common::SeekableReadStream *stream) {
 	close();
 
@@ -301,7 +334,7 @@ bool AVIDecoder::loadStream(Common::SeekableReadStream *stream) {
 		return false;
 	}
 
-	uint32 fileSize = stream->readUint32LE();
+	int32 fileSize = stream->readUint32LE();
 	uint32 riffType = stream->readUint32BE();
 
 	if (riffType != ID_AVI) {
diff --git a/video/avi_decoder.h b/video/avi_decoder.h
index 04e6a18..8b9fcbd 100644
--- a/video/avi_decoder.h
+++ b/video/avi_decoder.h
@@ -83,6 +83,16 @@ protected:
 	bool supportsAudioTrackSwitching() const { return true; }
 	AudioTrack *getAudioTrack(int index);
 
+	/**
+	 * Define a track to be used by this class.
+	 *
+	 * The pointer is then owned by this base class.
+	 *
+	 * @param track The track to add
+	 * @param isExternal Is this an external track not found by loadStream()?
+	 */
+	void addTrack(Track *track, bool isExternal = false);
+
 	struct BitmapInfoHeader {
 		uint32 size;
 		uint32 width;
@@ -166,6 +176,7 @@ protected:
 		uint32 quality;
 		uint32 sampleSize;
 		Common::Rect frame;
+		Common::String name;
 	};
 
 	class AVIVideoTrack : public FixedRateVideoTrack {
@@ -181,6 +192,7 @@ protected:
 		Graphics::PixelFormat getPixelFormat() const;
 		int getCurFrame() const { return _curFrame; }
 		int getFrameCount() const { return _frameCount; }
+		Common::String &getName() { return _vidsHeader.name; }
 		const Graphics::Surface *decodeNextFrame() { return _lastFrame; }
 
 		const byte *getPalette() const;
@@ -224,6 +236,7 @@ protected:
 		void skipAudio(const Audio::Timestamp &time, const Audio::Timestamp &frameTime);
 		virtual void resetStream();
 		uint32 getCurChunk() const { return _curChunk; }
+		Common::String &getName() { return _audsHeader.name; }
 		void setCurChunk(uint32 chunk) { _curChunk = chunk; }
 
 		bool isRewindable() const { return true; }
@@ -272,6 +285,7 @@ protected:
 	Common::Rational _frameRateOverride;
 
 	int _videoTrackCounter, _audioTrackCounter;
+	Track *_lastAddedTrack;
 	SelectTrackFn _selectTrackFn;
 
 	void initCommon();
@@ -280,6 +294,7 @@ protected:
 	void skipChunk(uint32 size);
 	void handleList(uint32 listSize);
 	void handleStreamHeader(uint32 size);
+	void readStreamName(uint32 size);
 	uint16 getStreamType(uint32 tag) const { return tag & 0xFFFF; }
 	byte getStreamIndex(uint32 tag) const;
 	void checkTruemotion1();


Commit: c458c3c9b740602002cd0a130a99af8b10402806
    https://github.com/scummvm/scummvm/commit/c458c3c9b740602002cd0a130a99af8b10402806
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:22-04:00

Commit Message:
TITANIC: Fix warnings in AVISurface

Changed paths:
    engines/titanic/support/avi_surface.cpp



diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 96bd6f7..7f2cd3c 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -108,7 +108,7 @@ bool AVISurface::play(int startFrame, int endFrame, int initialFrame, uint flags
 	_movieRangeInfo.push_back(info);
 	
 	if (_movieRangeInfo.size() == 1) {
-		changeFrame(initialFrame);
+		return changeFrame(initialFrame);
 	} else {
 		return true;
 	}	
@@ -204,7 +204,7 @@ void AVISurface::setFrame(int frameNumber) {
 		stop();
 
 	// Ensure the frame number is valid
-	if (frameNumber >= _decoders[0]->getFrameCount())
+	if (frameNumber >= (int)_decoders[0]->getFrameCount())
 		frameNumber = _decoders[0]->getFrameCount() - 1;
 
 	seekToFrame(frameNumber);


Commit: 513723c82d5db078236421577924bd9cde29b99b
    https://github.com/scummvm/scummvm/commit/513723c82d5db078236421577924bd9cde29b99b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:24-04:00

Commit Message:
TITANIC: Making the AVISurface frameInfo a video surface

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/game_view.cpp
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/avi_surface.h
    engines/titanic/support/mouse_cursor.cpp
    engines/titanic/support/mouse_cursor.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index eeb765e..f0f0980 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -275,7 +275,7 @@ bool CGameObject::checkPoint(const Point &pt, bool ignore40, bool visibleOnly) {
 	}
 
 	Common::Point pixelPos = pt - _bounds;
-	if (_surface->_blitStyleFlag) {
+	if (_surface->_transBlitFlag) {
 		pixelPos.y = ((_bounds.height() - _bounds.top) / 2) * 2 - pixelPos.y;
 	}
 
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index 2f0e74a..9bc9551 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -57,7 +57,7 @@ void CGameView::createSurface(const CResourceKey &key) {
 	// Create a fresh surface
 	CScreenManager::setCurrent();
 	_surface = CScreenManager::_currentScreenManagerPtr->createSurface(key);
-	_surface->_blitFlag = true;
+	_surface->_fastBlitFlag = true;
 }
 
 void CGameView::drawView() {
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 7f2cd3c..85590f1 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -21,11 +21,20 @@
  */
 
 #include "titanic/support/avi_surface.h"
+#include "titanic/support/screen_manager.h"
 #include "titanic/support/video_surface.h"
 #include "video/avi_decoder.h"
 
 namespace Titanic {
 
+Video::AVIDecoder::AVIVideoTrack &AVIDecoder::getVideoTrack() {
+	for (TrackListIterator it = getTrackListBegin(); it != getTrackListEnd(); it++)
+		if ((*it)->getTrackType() == Track::kTrackTypeVideo)
+			return *static_cast<AVIVideoTrack *>(*it);
+			
+	error("Could not find video track");
+}
+
 /**
  * Track filter for AVIDecoder that filters out any secondary video track
  */
@@ -43,21 +52,19 @@ static bool secondaryTrackSelect(bool isVideo, int trackCounter) {
 
 AVISurface::AVISurface(const CResourceKey &key) {
 	_videoSurface = nullptr;
-	_field4 = 0;
-	_field8 = 0;
 	_currentPos = 0;
 	_priorFrame = 0;
 	_streamCount = 0;
-	_frameInfo = nullptr;
+	_movieFrameSurface[0] = _movieFrameSurface[1] = nullptr;
 	_isPlaying = false;
 
 	// Create a decoder for the audio (if any) and primary video track
-	_decoders[0] = new Video::AVIDecoder(Audio::Mixer::kPlainSoundType, primaryTrackSelect);
+	_decoders[0] = new AVIDecoder(Audio::Mixer::kPlainSoundType, primaryTrackSelect);
 	if (!_decoders[0]->loadFile(key.getString()))
 		error("Could not open video - %s", key.getString().c_str());
 
 	// Create a decoder for any secondary video track
-	Video::AVIDecoder *decoder2 = new Video::AVIDecoder(Audio::Mixer::kPlainSoundType, secondaryTrackSelect);
+	AVIDecoder *decoder2 = new AVIDecoder(Audio::Mixer::kPlainSoundType, secondaryTrackSelect);
 	if (decoder2->loadFile(key.getString())) {
 		_decoders[1] = decoder2;
 	} else {
@@ -67,8 +74,9 @@ AVISurface::AVISurface(const CResourceKey &key) {
 
 AVISurface::~AVISurface() {
 	if (_videoSurface)
-		_videoSurface->_blitStyleFlag = false;
-	delete _frameInfo;
+		_videoSurface->_transBlitFlag = false;
+	delete _movieFrameSurface[0];
+	delete _movieFrameSurface[1];
 	delete _decoders[0];
 	delete _decoders[1];
 }
@@ -187,7 +195,37 @@ bool AVISurface::handleEvents(CMovieEventList &events) {
 void AVISurface::setVideoSurface(CVideoSurface *surface) {
 	_videoSurface = surface;
 
-	warning("TODO: Get video track list from video decoder");
+	// Handling for secondary video stream
+	if (_decoders[1]) {
+		const Common::String &streamName = _decoders[1]->getVideoTrack().getName();
+
+		if (streamName == "mask0") {
+			_videoSurface->_transparencyMode = TRANS_MASK0;
+		} else if (streamName == "mask255") {
+			_videoSurface->_transparencyMode = TRANS_MASK255;
+		} else if (streamName == "alpha0") {
+			_videoSurface->_transparencyMode = TRANS_ALPHA0;
+		} else if (streamName == "alpha255") {
+			_videoSurface->_transparencyMode = TRANS_ALPHA255;
+		}
+	}
+
+	setupDecompressor();
+}
+
+void AVISurface::setupDecompressor() {
+	for (int idx = 0; idx < 2; ++idx) {
+		if (!_decoders[idx])
+			continue;
+		AVIDecoder &decoder = *_decoders[idx];
+
+		// Setup frame surface
+		_movieFrameSurface[idx] = CScreenManager::_screenManagerPtr->createSurface(decoder.getWidth(), decoder.getHeight());
+
+		// TODO: See whether this simplified form of original works
+		if (idx == 2)
+			_videoSurface->_transBlitFlag = true;
+	}
 }
 
 uint AVISurface::getWidth() const {
@@ -260,9 +298,14 @@ void AVISurface::setFrameRate(double rate) {
 	}
 }
 
-void *AVISurface::duplicateFrameInfo() const {
-	// TODO
-	return nullptr;
+CVideoSurface *AVISurface::getSecondarySurface() {
+	return _streamCount <= 1 ? nullptr : _movieFrameSurface[1];
+}
+
+CVideoSurface *AVISurface::duplicateSecondaryFrame() const {
+	// TODO: Make this cleaner
+	OSVideoSurface *src = dynamic_cast<OSVideoSurface *>(_movieFrameSurface[1]);
+	return new OSVideoSurface(*src);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index f3722ca..62fc517 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -37,22 +37,35 @@ enum MovieFlag {
 	MOVIE_REVERSE = 8, MOVIE_GAMESTATE = 0x10
 };
 
+class AVIDecoder : public Video::AVIDecoder {
+public:
+	AVIDecoder(Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType, SelectTrackFn trackFn = nullptr) :
+		Video::AVIDecoder(soundType, trackFn) {}
+	AVIDecoder(const Common::Rational &frameRateOverride, Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType,
+		SelectTrackFn trackFn = nullptr) : Video::AVIDecoder(frameRateOverride, soundType, trackFn) {}
+	
+	Video::AVIDecoder::AVIVideoTrack &getVideoTrack();
+};
+
 class AVISurface {
 private:
-	Video::AVIDecoder *_decoders[2];
+	AVIDecoder *_decoders[2];
 	CVideoSurface *_videoSurface;
-	int _field4;
-	int _field8;
 	int _currentPos;
 	int _priorFrame;
 	CMovieRangeInfoList _movieRangeInfo;
 	int _streamCount;
-	void *_frameInfo;
+	CVideoSurface *_movieFrameSurface[2];
 private:
 	/**
 	 * Render a frame to the video surface
 	 */
 	bool renderFrame();
+
+	/**
+	 * Sets up for video decompression
+	 */
+	void setupDecompressor();
 protected:
 	/**
 	 * Change the frame with ??? checking
@@ -132,9 +145,10 @@ public:
 	 */
 	void setFrameRate(double rate);
 
-	const void *getFrameInfo() const {
-		return _streamCount <= 1 ? nullptr : _frameInfo;
-	}
+	/**
+	 * Returns the surface for the secondary video track frame, if present
+	 */
+	CVideoSurface *getSecondarySurface();
 
 	/**
 	 * Get a reference to the movie range info list
@@ -144,9 +158,9 @@ public:
 	}
 
 	/**
-	 * Duplicate the frame info
+	 * Duplicates the secondary frame, if the movie has a second video track
 	 */
-	void *duplicateFrameInfo() const;
+	CVideoSurface *duplicateSecondaryFrame() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index 496b152..628211c 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -50,6 +50,11 @@ static const int CURSOR_DATA[NUM_CURSORS][4] = {
 	{ 15, 138, 20, 28 }
 };
 
+CMouseCursor::CursorEntry::~CursorEntry() {
+	delete _videoSurface;
+	delete _frameSurface;
+}
+
 CMouseCursor::CMouseCursor(CScreenManager *screenManager) : 
 		_screenManager(screenManager), _cursorId(CURSOR_HOURGLASS),
 		_setCursorCount(0), _fieldE4(0), _fieldE8(0) {
@@ -80,9 +85,9 @@ void CMouseCursor::loadCursorImages() {
 		OSMovie movie(key, surface);
 		movie.setFrame(idx);
 		
-		void *frameInfo = movie.duplicateFrameInfo();
-		_cursors[idx]._frameInfo = frameInfo;
-		surface->setMovieFrameInfo(frameInfo);
+		CVideoSurface *frameSurface = movie.duplicateFrame();
+		_cursors[idx]._frameSurface = frameSurface;
+		surface->setMovieFrameSurface(frameSurface);
 	}
 }
 
diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h
index f674ccd..f6ab92d 100644
--- a/engines/titanic/support/mouse_cursor.h
+++ b/engines/titanic/support/mouse_cursor.h
@@ -54,11 +54,11 @@ class CVideoSurface;
 class CMouseCursor {
 	struct CursorEntry {
 		CVideoSurface *_videoSurface;
-		void *_frameInfo;
+		CVideoSurface *_frameSurface;
 		Common::Point _centroid;
 
-		CursorEntry() : _videoSurface(nullptr), _frameInfo(nullptr) {}
-		~CursorEntry() { delete _frameInfo; }
+		CursorEntry() : _videoSurface(nullptr), _frameSurface(nullptr) {}
+		~CursorEntry();
 	};
 private:
 	CScreenManager *_screenManager;
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index fc31750..495cf7c 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -159,7 +159,7 @@ void OSMovie::addEvent(int frameNumber, CGameObject *obj) {
 
 void OSMovie::setFrame(uint frameNumber) {
 	_aviSurface.setFrame(frameNumber);
-	_videoSurface->setMovieFrame(frameNumber);
+	_videoSurface->setMovieFrameSurface(_aviSurface.getSecondarySurface());
 }
 
 bool OSMovie::handleEvents(CMovieEventList &events) {
@@ -175,12 +175,12 @@ bool OSMovie::handleEvents(CMovieEventList &events) {
 
 	_frameTime1 += _frameTime2;
 	_aviSurface.handleEvents(events);
-	_videoSurface->setMovieFrameInfo(_aviSurface.getFrameInfo());
+	_videoSurface->setMovieFrameSurface(_aviSurface.getSecondarySurface());
 
 	if (_field14) {
 		while (_frameTime1 >= time && events.empty()) {
 			_aviSurface.handleEvents(events);
-			_videoSurface->setMovieFrameInfo(_aviSurface.getFrameInfo());
+			_videoSurface->setMovieFrameSurface(_aviSurface.getSecondarySurface());
 
 			_frameTime1 += _frameTime2;
 		}
@@ -217,8 +217,8 @@ void OSMovie::setFrameRate(double rate) {
 	_aviSurface.setFrameRate(rate);
 }
 
-void *OSMovie::duplicateFrameInfo() const {
-	return _aviSurface.duplicateFrameInfo();
+CVideoSurface *OSMovie::duplicateFrame() const {
+	return _aviSurface.duplicateSecondaryFrame();
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index 8034bd4..f9e3686 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -133,9 +133,9 @@ public:
 	virtual void setFrameRate(double rate) = 0;
 
 	/**
-	* Creates a duplicate of the frame info
+	* Creates a duplicate of the movie's frame
 	*/
-	virtual void *duplicateFrameInfo() const = 0;
+	virtual CVideoSurface *duplicateFrame() const = 0;
 
 	/**
 	 * Removes the movie from the list of currently playing movies
@@ -233,7 +233,7 @@ public:
 	/**
 	 * Creates a duplicate of the frame info
 	 */
-	virtual void *duplicateFrameInfo() const;
+	virtual CVideoSurface *duplicateFrame() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 546c2c4..3e6e93a 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -31,8 +31,8 @@ int CVideoSurface::_videoSurfaceCounter = 0;
 
 CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
 		_screenManager(screenManager), _rawSurface(nullptr), _movie(nullptr),
-		_pendingLoad(false), _blitStyleFlag(false), _blitFlag(false),
-		_movieFrameInfo(nullptr), _transparencyMode(TRANS_DEFAULT), _field48(0), _field50(1) {
+		_pendingLoad(false), _transBlitFlag(false), _fastBlitFlag(false),
+		_movieFrameSurface(nullptr), _transparencyMode(TRANS_DEFAULT), _field48(0), _field50(1) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
 }
 
@@ -52,10 +52,10 @@ void CVideoSurface::blitFrom(const Point &destPos, CVideoSurface *src, const Rec
 		Rect srcBounds, destBounds;
 		clipBounds(srcBounds, destBounds, src, srcRect, &destPos);
 
-		if (_blitStyleFlag)
-			blitRect2(srcBounds, destBounds, src);
+		if (_transBlitFlag)
+			transBlitRect(srcBounds, destBounds, src);
 		else
-			blitRect1(srcBounds, destBounds, src);
+			blitRect(srcBounds, destBounds, src);
 	}
 }
 
@@ -128,21 +128,25 @@ void CVideoSurface::clipBounds(Rect &srcRect, Rect &destRect,
 		error("Invalid rect");
 }
 
-void CVideoSurface::blitRect1(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
+void CVideoSurface::blitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
 	src->lock();
 	lock();
 
-	// TODO: Do it like the original does it
-	_rawSurface->transBlitFrom(*src->_rawSurface, srcRect, destRect,
-		getTransparencyColor());
+	if (_fastBlitFlag) {
+		_rawSurface->transBlitFrom(*src->_rawSurface, srcRect, destRect,
+			getTransparencyColor());
+		return;
+	}
+
+	// TODO
 
 	src->unlock();
 	unlock();
 }
 
-void CVideoSurface::blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
+void CVideoSurface::transBlitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
 	// TODO: Do it like the original does it
-	blitRect1(srcRect, destRect, src);
+	blitRect(srcRect, destRect, src);
 }
 
 uint CVideoSurface::getTransparencyColor() {
@@ -471,7 +475,7 @@ const CMovieRangeInfoList *OSVideoSurface::getMovieRangeInfo() const {
 }
 
 void OSVideoSurface::flipVertically(bool needsLock) {
-	if (!loadIfReady() || !_blitStyleFlag)
+	if (!loadIfReady() || !_transBlitFlag)
 		return;
 
 	if (needsLock)
@@ -490,7 +494,7 @@ void OSVideoSurface::flipVertically(bool needsLock) {
 		Common::copy(lineBuffer, lineBuffer + pitch, line1P);
 	}
 
-	_blitStyleFlag = false;
+	_transBlitFlag = false;
 	if (needsLock)
 		unlock();
 }
@@ -537,8 +541,8 @@ void OSVideoSurface::transPixelate() {
 	unlock();
 }
 
-void *OSVideoSurface::dupMovieFrameInfo() const {
-	return _movie ? _movie->duplicateFrameInfo() : nullptr;
+CVideoSurface *OSVideoSurface::dupMovieFrame() const {
+	return _movie ? _movie->duplicateFrame() : nullptr;
 }
 
 int OSVideoSurface::freeSurface() {
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index c8cfb78..2547458 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -54,15 +54,15 @@ private:
 	void clipBounds(Rect &srcRect, Rect &destRect, CVideoSurface *srcSurface,
 		const Rect *subRect = nullptr, const Point *destPos = nullptr);
 
-	void blitRect1(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
-	void blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
+	void blitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
+	void transBlitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
 protected:
 	static int _videoSurfaceCounter;
 protected:
 	CScreenManager *_screenManager;
 	Graphics::ManagedSurface *_rawSurface;
 	bool _pendingLoad;
-	const void *_movieFrameInfo;
+	CVideoSurface *_movieFrameSurface;
 	int _field48;
 	int _videoSurfaceNum;
 	int _field50;
@@ -70,8 +70,8 @@ protected:
 public:
 	CMovie *_movie;
 	DirectDrawSurface *_ddSurface;
-	bool _blitFlag;
-	bool _blitStyleFlag;
+	bool _fastBlitFlag;
+	bool _transBlitFlag;
 	CResourceKey _resourceKey;
 	TransparencyMode _transparencyMode;
 public:
@@ -258,9 +258,9 @@ public:
 	virtual bool proc45();
 
 	/**
-	* Duplicates movie frame info
-	*/
-	virtual void *dupMovieFrameInfo() const = 0;
+	 * Duplicates movie frame surface
+	 */
+	virtual CVideoSurface *dupMovieFrame() const = 0;
 
 	/**
 	 * Frees the underlying surface
@@ -285,11 +285,11 @@ public:
 	/**
 	 *
 	 */
-	void setMovieFrameInfo(const void *frameInfo) { _movieFrameInfo = frameInfo; }
+	void setMovieFrameSurface(CVideoSurface *frameSurface) { _movieFrameSurface = frameSurface; }
 
 	/**
 	 */
-	const void *getMovieFrameInfo() const { return _movieFrameInfo; }
+	CVideoSurface *getMovieFrameSurface() const { return _movieFrameSurface; }
 
 	/**
 	 * Get the pixels associated with the surface. Only valid when the
@@ -497,9 +497,9 @@ public:
 	virtual void transPixelate();
 
 	/**
-	 * Duplicates movie frame info
+	 * Duplicates movie frame surface
 	 */
-	virtual void *dupMovieFrameInfo() const;
+	virtual CVideoSurface *dupMovieFrame() const;
 
 
 	/**


Commit: 6b250453f90a399b76d373ae9205b1bb985f8e46
    https://github.com/scummvm/scummvm/commit/6b250453f90a399b76d373ae9205b1bb985f8e46
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:27-04:00

Commit Message:
TITANIC: Further implementation of movie frame decoding

Changed paths:
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/avi_surface.h
    engines/titanic/support/mouse_cursor.cpp
    engines/titanic/support/mouse_cursor.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 85590f1..ca6a09a 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -23,6 +23,8 @@
 #include "titanic/support/avi_surface.h"
 #include "titanic/support/screen_manager.h"
 #include "titanic/support/video_surface.h"
+#include "common/system.h"
+#include "graphics/pixelformat.h"
 #include "video/avi_decoder.h"
 
 namespace Titanic {
@@ -220,7 +222,8 @@ void AVISurface::setupDecompressor() {
 		AVIDecoder &decoder = *_decoders[idx];
 
 		// Setup frame surface
-		_movieFrameSurface[idx] = CScreenManager::_screenManagerPtr->createSurface(decoder.getWidth(), decoder.getHeight());
+		_movieFrameSurface[idx] = new Graphics::ManagedSurface(decoder.getWidth(), decoder.getHeight(),
+			g_system->getScreenFormat());
 
 		// TODO: See whether this simplified form of original works
 		if (idx == 2)
@@ -259,15 +262,29 @@ bool AVISurface::renderFrame() {
 	if (!_decoders[0]->needsUpdate() || (_decoders[1] && !_decoders[1]->needsUpdate()))
 		return false;
 
-	// Get the frame to render, and draw it on the surface
-	// TODO: Handle transparency
+	// Decode each decoder's video stream into the appropriate surface
 	for (int idx = 0; idx < 2; ++idx) {
 		if (_decoders[idx]) {
 			const Graphics::Surface *frame = _decoders[idx]->decodeNextFrame();
-			_videoSurface->blitFrom(Point(0, 0), frame);
+			
+			if (_movieFrameSurface[idx]->format == frame->format) {
+				_movieFrameSurface[idx]->blitFrom(*frame);
+			} else {
+				// Format mis-match, so we need to convert the frame
+				Graphics::Surface *s = frame->convertTo(_movieFrameSurface[idx]->format,
+					_decoders[idx]->getPalette());
+				_movieFrameSurface[idx]->blitFrom(*s);
+				s->free();
+				delete s;
+			}
 		}
 	}
 
+	// Blit the primary video frame onto the main overall surface
+	_videoSurface->lock();
+	_videoSurface->getRawSurface()->blitFrom(*_movieFrameSurface[0]);
+	_videoSurface->unlock();
+
 	return false;
 }
 
@@ -298,14 +315,19 @@ void AVISurface::setFrameRate(double rate) {
 	}
 }
 
-CVideoSurface *AVISurface::getSecondarySurface() {
+Graphics::ManagedSurface *AVISurface::getSecondarySurface() {
 	return _streamCount <= 1 ? nullptr : _movieFrameSurface[1];
 }
 
-CVideoSurface *AVISurface::duplicateSecondaryFrame() const {
-	// TODO: Make this cleaner
-	OSVideoSurface *src = dynamic_cast<OSVideoSurface *>(_movieFrameSurface[1]);
-	return new OSVideoSurface(*src);
+Graphics::ManagedSurface *AVISurface::duplicateSecondaryFrame() const {
+	if (_streamCount <= 1) {
+		return nullptr;
+	} else {
+		Graphics::ManagedSurface *dest = new Graphics::ManagedSurface(_movieFrameSurface[1]->w,
+			_movieFrameSurface[1]->h, _movieFrameSurface[1]->format);
+		dest->blitFrom(*_movieFrameSurface[1]);
+		return dest;
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index 62fc517..f74f6a8 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -24,6 +24,7 @@
 #define TITANIC_AVI_SURFACE_H
 
 #include "video/avi_decoder.h"
+#include "graphics/managed_surface.h"
 #include "titanic/core/resource_key.h"
 #include "titanic/support/movie_range_info.h"
 
@@ -55,7 +56,7 @@ private:
 	int _priorFrame;
 	CMovieRangeInfoList _movieRangeInfo;
 	int _streamCount;
-	CVideoSurface *_movieFrameSurface[2];
+	Graphics::ManagedSurface *_movieFrameSurface[2];
 private:
 	/**
 	 * Render a frame to the video surface
@@ -148,7 +149,7 @@ public:
 	/**
 	 * Returns the surface for the secondary video track frame, if present
 	 */
-	CVideoSurface *getSecondarySurface();
+	Graphics::ManagedSurface *getSecondarySurface();
 
 	/**
 	 * Get a reference to the movie range info list
@@ -160,7 +161,7 @@ public:
 	/**
 	 * Duplicates the secondary frame, if the movie has a second video track
 	 */
-	CVideoSurface *duplicateSecondaryFrame() const;
+	Graphics::ManagedSurface *duplicateSecondaryFrame() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index 628211c..5694d83 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -85,7 +85,7 @@ void CMouseCursor::loadCursorImages() {
 		OSMovie movie(key, surface);
 		movie.setFrame(idx);
 		
-		CVideoSurface *frameSurface = movie.duplicateFrame();
+		Graphics::ManagedSurface *frameSurface = movie.duplicateFrame();
 		_cursors[idx]._frameSurface = frameSurface;
 		surface->setMovieFrameSurface(frameSurface);
 	}
diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h
index f6ab92d..7a81ad4 100644
--- a/engines/titanic/support/mouse_cursor.h
+++ b/engines/titanic/support/mouse_cursor.h
@@ -25,6 +25,7 @@
 
 #include "common/scummsys.h"
 #include "common/rect.h"
+#include "graphics/managed_surface.h"
 
 namespace Titanic {
 
@@ -54,7 +55,7 @@ class CVideoSurface;
 class CMouseCursor {
 	struct CursorEntry {
 		CVideoSurface *_videoSurface;
-		CVideoSurface *_frameSurface;
+		Graphics::ManagedSurface *_frameSurface;
 		Common::Point _centroid;
 
 		CursorEntry() : _videoSurface(nullptr), _frameSurface(nullptr) {}
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 495cf7c..b98a5b5 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -217,7 +217,7 @@ void OSMovie::setFrameRate(double rate) {
 	_aviSurface.setFrameRate(rate);
 }
 
-CVideoSurface *OSMovie::duplicateFrame() const {
+Graphics::ManagedSurface *OSMovie::duplicateFrame() const {
 	return _aviSurface.duplicateSecondaryFrame();
 }
 
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index f9e3686..b6c2a09 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -135,7 +135,7 @@ public:
 	/**
 	* Creates a duplicate of the movie's frame
 	*/
-	virtual CVideoSurface *duplicateFrame() const = 0;
+	virtual Graphics::ManagedSurface *duplicateFrame() const = 0;
 
 	/**
 	 * Removes the movie from the list of currently playing movies
@@ -233,7 +233,7 @@ public:
 	/**
 	 * Creates a duplicate of the frame info
 	 */
-	virtual CVideoSurface *duplicateFrame() const;
+	virtual Graphics::ManagedSurface *duplicateFrame() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 3e6e93a..0429ed4 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -541,7 +541,7 @@ void OSVideoSurface::transPixelate() {
 	unlock();
 }
 
-CVideoSurface *OSVideoSurface::dupMovieFrame() const {
+Graphics::ManagedSurface *OSVideoSurface::dupMovieFrame() const {
 	return _movie ? _movie->duplicateFrame() : nullptr;
 }
 
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 2547458..a0e74b5 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -25,6 +25,7 @@
 
 #include "common/scummsys.h"
 #include "common/array.h"
+#include "graphics/managed_surface.h"
 #include "titanic/support/font.h"
 #include "titanic/support/direct_draw.h"
 #include "titanic/support/movie.h"
@@ -62,7 +63,7 @@ protected:
 	CScreenManager *_screenManager;
 	Graphics::ManagedSurface *_rawSurface;
 	bool _pendingLoad;
-	CVideoSurface *_movieFrameSurface;
+	Graphics::ManagedSurface *_movieFrameSurface;
 	int _field48;
 	int _videoSurfaceNum;
 	int _field50;
@@ -260,7 +261,7 @@ public:
 	/**
 	 * Duplicates movie frame surface
 	 */
-	virtual CVideoSurface *dupMovieFrame() const = 0;
+	virtual Graphics::ManagedSurface *dupMovieFrame() const = 0;
 
 	/**
 	 * Frees the underlying surface
@@ -283,13 +284,14 @@ public:
 	void blitFrom(const Point &destPos, const Graphics::Surface *src);
 
 	/**
-	 *
+	 * Sets the movie frame surface containing frame data from an active movie
 	 */
-	void setMovieFrameSurface(CVideoSurface *frameSurface) { _movieFrameSurface = frameSurface; }
+	void setMovieFrameSurface(Graphics::ManagedSurface *frameSurface) { _movieFrameSurface = frameSurface; }
 
 	/**
+	 * Get the previously set movie frame surface
 	 */
-	CVideoSurface *getMovieFrameSurface() const { return _movieFrameSurface; }
+	Graphics::ManagedSurface *getMovieFrameSurface() const { return _movieFrameSurface; }
 
 	/**
 	 * Get the pixels associated with the surface. Only valid when the
@@ -298,6 +300,12 @@ public:
 	uint16 *getPixels() { return (uint16 *)_rawSurface->getPixels(); }
 
 	/**
+	 * Get a reference to the underlying surface. Only valid when the surface
+	 * has been locked for access
+	 */
+	Graphics::ManagedSurface *getRawSurface() { return _rawSurface; }
+
+	/**
 	 * Returns the transparent color
 	 */
 	uint getTransparencyColor();
@@ -499,7 +507,7 @@ public:
 	/**
 	 * Duplicates movie frame surface
 	 */
-	virtual CVideoSurface *dupMovieFrame() const;
+	virtual Graphics::ManagedSurface *dupMovieFrame() const;
 
 
 	/**


Commit: f92f2243fdfd905b73b642ffc651311f28ba8320
    https://github.com/scummvm/scummvm/commit/f92f2243fdfd905b73b642ffc651311f28ba8320
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:29-04:00

Commit Message:
TITANIC: Fix star control points 2 loading

Changed paths:
    engines/titanic/star_control/star_control_sub9.cpp



diff --git a/engines/titanic/star_control/star_control_sub9.cpp b/engines/titanic/star_control/star_control_sub9.cpp
index e19977c..292e9a8 100644
--- a/engines/titanic/star_control/star_control_sub9.cpp
+++ b/engines/titanic/star_control/star_control_sub9.cpp
@@ -42,7 +42,7 @@ void CStarControlSub9::initialize() {
 		RootEntry &rootEntry = _data[rootCtr];
 		rootEntry.resize(count * 2);
 		for (int idx = 0; idx < count * 2; ++idx) {
-			DataEntry &entry = rootEntry[idx * 2];
+			DataEntry &entry = rootEntry[idx];
 			v1 = stream->readSint32LE();
 			v2 = stream->readSint32LE();
 			v1 *= 0.015 * FACTOR;


Commit: 1986fa6e83884688a62c0cfbfb9109fcd26fac6e
    https://github.com/scummvm/scummvm/commit/1986fa6e83884688a62c0cfbfb9109fcd26fac6e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:32-04:00

Commit Message:
TITANIC: Fixes for mouse cursor/movie frame handling

Changed paths:
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/mouse_cursor.cpp



diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index ca6a09a..b685fa8 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -65,10 +65,13 @@ AVISurface::AVISurface(const CResourceKey &key) {
 	if (!_decoders[0]->loadFile(key.getString()))
 		error("Could not open video - %s", key.getString().c_str());
 
+	_streamCount = 1;
+
 	// Create a decoder for any secondary video track
 	AVIDecoder *decoder2 = new AVIDecoder(Audio::Mixer::kPlainSoundType, secondaryTrackSelect);
 	if (decoder2->loadFile(key.getString())) {
 		_decoders[1] = decoder2;
+		++_streamCount;
 	} else {
 		delete decoder2;
 	}
@@ -263,20 +266,18 @@ bool AVISurface::renderFrame() {
 		return false;
 
 	// Decode each decoder's video stream into the appropriate surface
-	for (int idx = 0; idx < 2; ++idx) {
-		if (_decoders[idx]) {
-			const Graphics::Surface *frame = _decoders[idx]->decodeNextFrame();
+	for (int idx = 0; idx < _streamCount; ++idx) {
+		const Graphics::Surface *frame = _decoders[idx]->decodeNextFrame();
 			
-			if (_movieFrameSurface[idx]->format == frame->format) {
-				_movieFrameSurface[idx]->blitFrom(*frame);
-			} else {
-				// Format mis-match, so we need to convert the frame
-				Graphics::Surface *s = frame->convertTo(_movieFrameSurface[idx]->format,
-					_decoders[idx]->getPalette());
-				_movieFrameSurface[idx]->blitFrom(*s);
-				s->free();
-				delete s;
-			}
+		if (_movieFrameSurface[idx]->format == frame->format) {
+			_movieFrameSurface[idx]->blitFrom(*frame);
+		} else {
+			// Format mis-match, so we need to convert the frame
+			Graphics::Surface *s = frame->convertTo(_movieFrameSurface[idx]->format,
+				_decoders[idx]->getPalette());
+			_movieFrameSurface[idx]->blitFrom(*s);
+			s->free();
+			delete s;
 		}
 	}
 
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp
index 5694d83..d6a4282 100644
--- a/engines/titanic/support/mouse_cursor.cpp
+++ b/engines/titanic/support/mouse_cursor.cpp
@@ -63,8 +63,6 @@ CMouseCursor::CMouseCursor(CScreenManager *screenManager) :
 }
 
 CMouseCursor::~CMouseCursor() {
-	for (int idx = 0; idx < NUM_CURSORS; ++idx)
-		delete _cursors[idx]._videoSurface;
 }
 
 void CMouseCursor::loadCursorImages() {


Commit: b843b2fd3385533955a325ff8819e37ab3b0b2f0
    https://github.com/scummvm/scummvm/commit/b843b2fd3385533955a325ff8819e37ab3b0b2f0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:34-04:00

Commit Message:
TITANIC: Fix memory leak in image decoders

Changed paths:
    engines/titanic/support/image_decoders.cpp



diff --git a/engines/titanic/support/image_decoders.cpp b/engines/titanic/support/image_decoders.cpp
index 4203dad..495d1d0 100644
--- a/engines/titanic/support/image_decoders.cpp
+++ b/engines/titanic/support/image_decoders.cpp
@@ -45,6 +45,7 @@ void CJPEGDecode::decode(OSVideoSurface &surface, const CString &name) {
 	Common::copy((byte *)convertedSurface->getPixels(), (byte *)convertedSurface->getPixels() +
 		surface.getPitch() * surface.getHeight(), (byte *)surface._rawSurface->getPixels());
 
+	convertedSurface->free();
 	delete convertedSurface;
 	surface.unlock();
 }
@@ -72,6 +73,7 @@ void CTargaDecode::decode(OSVideoSurface &surface, const CString &name) {
 	Common::copy((byte *)convertedSurface->getPixels(), (byte *)convertedSurface->getPixels() +
 		surface.getPitch() * surface.getHeight(), (byte *)surface._rawSurface->getPixels());
 
+	convertedSurface->free();
 	delete convertedSurface;
 	surface.unlock();
 }


Commit: 6331e3814a7fe501056ec5a356924b9c4c40c16f
    https://github.com/scummvm/scummvm/commit/6331e3814a7fe501056ec5a356924b9c4c40c16f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:36-04:00

Commit Message:
TITANIC: Fleshing out & fixes for video surface blit methods

Changed paths:
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 0429ed4..4169a80 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -32,7 +32,8 @@ int CVideoSurface::_videoSurfaceCounter = 0;
 CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
 		_screenManager(screenManager), _rawSurface(nullptr), _movie(nullptr),
 		_pendingLoad(false), _transBlitFlag(false), _fastBlitFlag(false),
-		_movieFrameSurface(nullptr), _transparencyMode(TRANS_DEFAULT), _field48(0), _field50(1) {
+		_movieFrameSurface(nullptr), _transparencyMode(TRANS_DEFAULT), 
+		_field48(0), _field50(1), _lockCount(0) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
 }
 
@@ -52,10 +53,10 @@ void CVideoSurface::blitFrom(const Point &destPos, CVideoSurface *src, const Rec
 		Rect srcBounds, destBounds;
 		clipBounds(srcBounds, destBounds, src, srcRect, &destPos);
 
-		if (_transBlitFlag)
-			transBlitRect(srcBounds, destBounds, src);
+		if (src->_transBlitFlag)
+			blitRect2(srcBounds, destBounds, src);
 		else
-			blitRect(srcBounds, destBounds, src);
+			blitRect1(srcBounds, destBounds, src);
 	}
 }
 
@@ -128,25 +129,38 @@ void CVideoSurface::clipBounds(Rect &srcRect, Rect &destRect,
 		error("Invalid rect");
 }
 
-void CVideoSurface::blitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
+void CVideoSurface::blitRect1(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
 	src->lock();
 	lock();
 
-	if (_fastBlitFlag) {
-		_rawSurface->transBlitFrom(*src->_rawSurface, srcRect, destRect,
-			getTransparencyColor());
-		return;
+	if (src->_fastBlitFlag) {
+		_rawSurface->blitFrom(*src->_rawSurface, srcRect, Point(destRect.left, destRect.top));
+	} else if (getMovieFrameSurface()) {
+		movieBlitRect(srcRect, destRect, src);
+	} else {
+		_rawSurface->transBlitFrom(*src->_rawSurface, srcRect, destRect, src->getTransparencyColor());
 	}
 
-	// TODO
-
 	src->unlock();
 	unlock();
 }
 
-void CVideoSurface::transBlitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
-	// TODO: Do it like the original does it
-	blitRect(srcRect, destRect, src);
+void CVideoSurface::blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
+	if (getMovieFrameSurface()) {
+		movieBlitRect(srcRect, destRect, src);
+	} else {
+		src->lock();
+		lock();
+
+		_rawSurface->blitFrom(*src->_rawSurface, srcRect, Point(destRect.left, destRect.top));
+
+		src->unlock();
+		unlock();
+	}
+}
+
+void CVideoSurface::movieBlitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src) {
+	// TODO
 }
 
 uint CVideoSurface::getTransparencyColor() {
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index a0e74b5..040161f 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -55,8 +55,9 @@ private:
 	void clipBounds(Rect &srcRect, Rect &destRect, CVideoSurface *srcSurface,
 		const Rect *subRect = nullptr, const Point *destPos = nullptr);
 
-	void blitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
-	void transBlitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
+	void blitRect1(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
+	void blitRect2(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
+	void movieBlitRect(const Rect &srcRect, const Rect &destRect, CVideoSurface *src);
 protected:
 	static int _videoSurfaceCounter;
 protected:


Commit: 7b331771ca631236be57778f8e64fa916e1ec112
    https://github.com/scummvm/scummvm/commit/7b331771ca631236be57778f8e64fa916e1ec112
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:39-04:00

Commit Message:
TITANIC: Beginnings of CStarControlSub15 class

Changed paths:
  A engines/titanic/star_control/star_control_sub15.cpp
  A engines/titanic/star_control/star_control_sub15.h
    engines/titanic/module.mk



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 8d25bc3..e015a25 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -432,7 +432,6 @@ MODULE_OBJS := \
 	star_control/star_control_sub13.o \
 	star_control/star_control_sub14.o \
 	star_control/star_control_sub15.o \
-	star_control/star_control_sub16.o \
 	star_control/surface_area.o \
 	star_control/surface_fader_base.o \
 	star_control/surface_fader.o \
diff --git a/engines/titanic/star_control/star_control_sub15.cpp b/engines/titanic/star_control/star_control_sub15.cpp
new file mode 100644
index 0000000..a6eb2e8
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub15.cpp
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub15.h"
+
+namespace Titanic {
+
+CStarControlSub15::CStarControlSub15() :
+		_field0(1.875), _field8(0), _fieldC(0),
+		_field10(0), _field14(0), _field18(0.0), _field1C(0),
+		_field20(1.875), _field28(0), _field2C(0),
+		_field30(0), _field38(0), _field3C(0),
+		_field40(1.875), _field48(0), _field4C(0),
+		_field50(0), _field54(0), _field58(0), _field5C(0) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub15.h b/engines/titanic/star_control/star_control_sub15.h
new file mode 100644
index 0000000..faf68f1
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub15.h
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB15_H
+#define TITANIC_STAR_CONTROL_SUB15_H
+
+namespace Titanic {
+
+class CStarControlSub15 {
+private:
+	double _field0;
+	int _field8;
+	int _fieldC;
+	int _field10;
+	int _field14;
+	double _field18;
+	int _field1C;
+	double _field20;
+	int _field24;
+	int _field28;
+	int _field2C;
+	double _field30;
+	int _field38;
+	int _field3C;
+	double _field40;
+	int _field48;
+	int _field4C;
+	int _field50;
+	int _field54;
+	int _field58;
+	int _field5C;
+public:
+	CStarControlSub15();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB15_H */


Commit: ce7e2c80d618f3721afc3948e6a0b2f7a2585ba8
    https://github.com/scummvm/scummvm/commit/ce7e2c80d618f3721afc3948e6a0b2f7a2585ba8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:41-04:00

Commit Message:
TITANIC: Further star control class stubs

Changed paths:
  A engines/titanic/star_control/star_control_sub20.cpp
  A engines/titanic/star_control/star_control_sub20.h
  A engines/titanic/star_control/star_control_sub21.cpp
  A engines/titanic/star_control/star_control_sub21.h
  A engines/titanic/star_control/star_control_sub22.cpp
  A engines/titanic/star_control/star_control_sub22.h
  A engines/titanic/star_control/star_control_sub23.cpp
  A engines/titanic/star_control/star_control_sub23.h
  A engines/titanic/star_control/star_control_sub24.cpp
  A engines/titanic/star_control/star_control_sub24.h
  A engines/titanic/star_control/star_control_sub25.cpp
  A engines/titanic/star_control/star_control_sub25.h
  A engines/titanic/star_control/star_control_sub26.cpp
  A engines/titanic/star_control/star_control_sub26.h
    engines/titanic/module.mk



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index e015a25..de82f1d 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -432,6 +432,13 @@ MODULE_OBJS := \
 	star_control/star_control_sub13.o \
 	star_control/star_control_sub14.o \
 	star_control/star_control_sub15.o \
+	star_control/star_control_sub20.o \
+	star_control/star_control_sub21.o \
+	star_control/star_control_sub22.o \
+	star_control/star_control_sub23.o \
+	star_control/star_control_sub24.o \
+	star_control/star_control_sub25.o \
+	star_control/star_control_sub26.o \
 	star_control/surface_area.o \
 	star_control/surface_fader_base.o \
 	star_control/surface_fader.o \
diff --git a/engines/titanic/star_control/star_control_sub20.cpp b/engines/titanic/star_control/star_control_sub20.cpp
new file mode 100644
index 0000000..958ee38
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub20.cpp
@@ -0,0 +1,144 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub20.h"
+#include "common/textconsole.h"
+
+namespace Titanic {
+
+CStarControlSub20::CStarControlSub20(void *src) {
+	_lockCounter = 0;
+	_dataP = nullptr;
+
+	if (src) {
+		copyFrom1(src);
+	} else {
+		_field4 = 0.0;
+		_field8 = 0.0;
+		_fieldC = 20.0;
+		_field10 = 0.0;
+		_field14 = 50000.0;
+		_field18 = 1.0;
+		_field1C = 1.0;
+		_field20 = 0.0;
+	}
+}
+
+CStarControlSub20::~CStarControlSub20() { 
+	clear();
+}
+
+void CStarControlSub20::copyFrom1(void *src) {
+	error("TODO: CStarControlSub20::copyFrom1");
+}
+
+void CStarControlSub20::copyFrom2(void *src) {
+	error("TODO: CStarControlSub20::copyFrom2");
+}
+
+void CStarControlSub20::proc4() {
+	if (!isLocked() && _field4 < _field14) {
+		_field8 += _field4;
+		if (_fieldC == _field8)
+			_field4 -= _field8;
+		else
+			_field4 += _field8;
+	}
+}
+
+void CStarControlSub20::proc5() {
+	if (!isLocked()) {
+		_field8 -= _fieldC;
+		if (_field8 == _field4)
+			_field4 += _field8;
+		else
+			_field4 -= _field8;
+
+		if (_field8 < 0.0)
+			_field8 = 0.0;
+	}
+}
+
+void CStarControlSub20::proc6() {
+	if (!isLocked())
+		_field4 = _field14;
+}
+
+void CStarControlSub20::proc7() {
+	if (!isLocked()) {
+		_field4 = 0.0;
+		_field8 = 0.0;
+	}
+}
+
+void CStarControlSub20::proc11(CErrorCode *errorCode, void *v2, void *v3) {
+	if (_field4 > 0.0) {
+		warning("TODO: CStarControlSub20::proc11");
+	}
+}
+
+void CStarControlSub20::setData(void *data) {
+	clear();
+	_dataP = data;
+}
+
+void CStarControlSub20::clear() {
+	if (_dataP) {
+		delete _dataP;
+		_dataP = nullptr;
+	}
+}
+
+void CStarControlSub20::load(SimpleFile *file, int val) {
+	if (!val) {
+		_field4 = file->readFloat();
+		_field8 = file->readFloat();
+		_fieldC = file->readFloat();
+		_field10 = file->readFloat();
+		_field14 = file->readFloat();
+		_field18 = file->readFloat();
+		_field1C = file->readFloat();
+		_field20 = file->readFloat();
+	}
+}
+
+void CStarControlSub20::save(SimpleFile *file, int indent) {
+	file->writeFloatLine(_field4, indent);
+	file->writeFloatLine(_field8, indent);
+	file->writeFloatLine(_fieldC, indent);
+	file->writeFloatLine(_field10, indent);
+	file->writeFloatLine(_field14, indent);
+	file->writeFloatLine(_field18, indent);
+	file->writeFloatLine(_field1C, indent);
+	file->writeFloatLine(_field20, indent);
+}
+
+void CStarControlSub20::incLockCount() {
+	++_lockCounter;
+}
+
+void CStarControlSub20::decLockCount() {
+	if (_lockCounter > 0)
+		--_lockCounter;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub20.h b/engines/titanic/star_control/star_control_sub20.h
new file mode 100644
index 0000000..376c097
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub20.h
@@ -0,0 +1,96 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB20_H
+#define TITANIC_STAR_CONTROL_SUB20_H
+
+#include "titanic/support/simple_file.h"
+#include "titanic/star_control/error_code.h"
+
+namespace Titanic {
+
+class CStarControlSub20 {
+public:
+	double _field4;
+	double _field8;
+	double _fieldC;
+	double _field10;
+	double _field14;
+	double _field18;
+	double _field1C;
+	double _field20;
+	int _lockCounter;
+	void *_dataP;
+public:
+	CStarControlSub20(void *src);
+	virtual ~CStarControlSub20();
+
+	virtual void copyFrom1(void *src);
+	virtual void copyFrom2(void *src);
+	virtual void proc4();
+	virtual void proc5();
+	virtual void proc6();
+	virtual void proc7();
+	virtual void proc8() {}
+	virtual void proc9() {}
+	virtual void proc10() {}
+	virtual void proc11(CErrorCode *errorCode, void *v2, void *v3);
+
+	/**
+	 * Set the data
+	 */
+	virtual void setData(void *data);
+
+	/**
+	 * Clear the class
+	 */
+	virtual void clear();
+
+	/**
+	 * Load the class
+	 */
+	virtual void load(SimpleFile *file, int val = 0);
+
+	/**
+	 * Save the class
+	 */
+	virtual void save(SimpleFile *file, int indent);
+
+	/**
+	 * Increment tthe lock counter
+	 */
+	void incLockCount();
+
+	/**
+	 * Decrement the lock counter
+	 */
+	void decLockCount();
+
+	/**
+	 * Returns true if the lock counter is non-zero
+	 */
+	bool isLocked() const { return _lockCounter > 0; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB20_H */
diff --git a/engines/titanic/star_control/star_control_sub21.cpp b/engines/titanic/star_control/star_control_sub21.cpp
new file mode 100644
index 0000000..958ee38
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub21.cpp
@@ -0,0 +1,144 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub20.h"
+#include "common/textconsole.h"
+
+namespace Titanic {
+
+CStarControlSub20::CStarControlSub20(void *src) {
+	_lockCounter = 0;
+	_dataP = nullptr;
+
+	if (src) {
+		copyFrom1(src);
+	} else {
+		_field4 = 0.0;
+		_field8 = 0.0;
+		_fieldC = 20.0;
+		_field10 = 0.0;
+		_field14 = 50000.0;
+		_field18 = 1.0;
+		_field1C = 1.0;
+		_field20 = 0.0;
+	}
+}
+
+CStarControlSub20::~CStarControlSub20() { 
+	clear();
+}
+
+void CStarControlSub20::copyFrom1(void *src) {
+	error("TODO: CStarControlSub20::copyFrom1");
+}
+
+void CStarControlSub20::copyFrom2(void *src) {
+	error("TODO: CStarControlSub20::copyFrom2");
+}
+
+void CStarControlSub20::proc4() {
+	if (!isLocked() && _field4 < _field14) {
+		_field8 += _field4;
+		if (_fieldC == _field8)
+			_field4 -= _field8;
+		else
+			_field4 += _field8;
+	}
+}
+
+void CStarControlSub20::proc5() {
+	if (!isLocked()) {
+		_field8 -= _fieldC;
+		if (_field8 == _field4)
+			_field4 += _field8;
+		else
+			_field4 -= _field8;
+
+		if (_field8 < 0.0)
+			_field8 = 0.0;
+	}
+}
+
+void CStarControlSub20::proc6() {
+	if (!isLocked())
+		_field4 = _field14;
+}
+
+void CStarControlSub20::proc7() {
+	if (!isLocked()) {
+		_field4 = 0.0;
+		_field8 = 0.0;
+	}
+}
+
+void CStarControlSub20::proc11(CErrorCode *errorCode, void *v2, void *v3) {
+	if (_field4 > 0.0) {
+		warning("TODO: CStarControlSub20::proc11");
+	}
+}
+
+void CStarControlSub20::setData(void *data) {
+	clear();
+	_dataP = data;
+}
+
+void CStarControlSub20::clear() {
+	if (_dataP) {
+		delete _dataP;
+		_dataP = nullptr;
+	}
+}
+
+void CStarControlSub20::load(SimpleFile *file, int val) {
+	if (!val) {
+		_field4 = file->readFloat();
+		_field8 = file->readFloat();
+		_fieldC = file->readFloat();
+		_field10 = file->readFloat();
+		_field14 = file->readFloat();
+		_field18 = file->readFloat();
+		_field1C = file->readFloat();
+		_field20 = file->readFloat();
+	}
+}
+
+void CStarControlSub20::save(SimpleFile *file, int indent) {
+	file->writeFloatLine(_field4, indent);
+	file->writeFloatLine(_field8, indent);
+	file->writeFloatLine(_fieldC, indent);
+	file->writeFloatLine(_field10, indent);
+	file->writeFloatLine(_field14, indent);
+	file->writeFloatLine(_field18, indent);
+	file->writeFloatLine(_field1C, indent);
+	file->writeFloatLine(_field20, indent);
+}
+
+void CStarControlSub20::incLockCount() {
+	++_lockCounter;
+}
+
+void CStarControlSub20::decLockCount() {
+	if (_lockCounter > 0)
+		--_lockCounter;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub21.h b/engines/titanic/star_control/star_control_sub21.h
new file mode 100644
index 0000000..8214a18
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub21.h
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB21_H
+#define TITANIC_STAR_CONTROL_SUB21_H
+
+#include "titanic/star_control/star_control_sub20.h"
+
+namespace Titanic {
+
+class CStarControlSub21 : public CStarControlSub20 {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB21_H */
diff --git a/engines/titanic/star_control/star_control_sub22.cpp b/engines/titanic/star_control/star_control_sub22.cpp
new file mode 100644
index 0000000..d7835a6
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub22.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub22.h"
+#include "common/textconsole.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub22.h b/engines/titanic/star_control/star_control_sub22.h
new file mode 100644
index 0000000..94a0cdf
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub22.h
@@ -0,0 +1,33 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB22_H
+#define TITANIC_STAR_CONTROL_SUB22_H
+
+namespace Titanic {
+
+class CStarControlSub22 {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB22_H */
diff --git a/engines/titanic/star_control/star_control_sub23.cpp b/engines/titanic/star_control/star_control_sub23.cpp
new file mode 100644
index 0000000..b009cbc
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub23.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub23.h"
+#include "common/textconsole.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub23.h b/engines/titanic/star_control/star_control_sub23.h
new file mode 100644
index 0000000..136401e
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub23.h
@@ -0,0 +1,33 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB23_H
+#define TITANIC_STAR_CONTROL_SUB23_H
+
+namespace Titanic {
+
+class CStarControlSub23 {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB23_H */
diff --git a/engines/titanic/star_control/star_control_sub24.cpp b/engines/titanic/star_control/star_control_sub24.cpp
new file mode 100644
index 0000000..6f17eb7
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub24.cpp
@@ -0,0 +1,29 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub24.h"
+#include "common/textconsole.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub24.h b/engines/titanic/star_control/star_control_sub24.h
new file mode 100644
index 0000000..43f1e09
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub24.h
@@ -0,0 +1,33 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB24_H
+#define TITANIC_STAR_CONTROL_SUB24_H
+
+namespace Titanic {
+
+class CStarControlSub24 {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB24_H */
diff --git a/engines/titanic/star_control/star_control_sub25.cpp b/engines/titanic/star_control/star_control_sub25.cpp
new file mode 100644
index 0000000..f91c75a
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub25.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub25.h"
+#include "common/textconsole.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub25.h b/engines/titanic/star_control/star_control_sub25.h
new file mode 100644
index 0000000..ebfe789
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub25.h
@@ -0,0 +1,33 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB25_H
+#define TITANIC_STAR_CONTROL_SUB25_H
+
+namespace Titanic {
+
+class CStarControlSub25 {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB25_H */
diff --git a/engines/titanic/star_control/star_control_sub26.cpp b/engines/titanic/star_control/star_control_sub26.cpp
new file mode 100644
index 0000000..9d796a0
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub26.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub26.h"
+#include "common/textconsole.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub26.h b/engines/titanic/star_control/star_control_sub26.h
new file mode 100644
index 0000000..2edfce7
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub26.h
@@ -0,0 +1,33 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB26_H
+#define TITANIC_STAR_CONTROL_SUB26_H
+
+namespace Titanic {
+
+class CStarControlSub26 {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB26_H */


Commit: 7553b81d8694fe05b5ba29893f3578b3d43aed68
    https://github.com/scummvm/scummvm/commit/7553b81d8694fe05b5ba29893f3578b3d43aed68
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:44-04:00

Commit Message:
TITANIC: Some star control class definitions

Changed paths:
    engines/titanic/star_control/star_control_sub25.h
    engines/titanic/star_control/star_control_sub26.h



diff --git a/engines/titanic/star_control/star_control_sub25.h b/engines/titanic/star_control/star_control_sub25.h
index ebfe789..81b5bb0 100644
--- a/engines/titanic/star_control/star_control_sub25.h
+++ b/engines/titanic/star_control/star_control_sub25.h
@@ -23,9 +23,19 @@
 #ifndef TITANIC_STAR_CONTROL_SUB25_H
 #define TITANIC_STAR_CONTROL_SUB25_H
 
+#include "titanic/star_control/star_control_sub14.h"
+#include "titanic/star_control/star_control_sub26.h"
+
 namespace Titanic {
 
 class CStarControlSub25 {
+public:
+	CStarControlSub14 _sub1;
+	CStarControlSub14 _sub2;
+	CStarControlSub26 _sub3;
+	CStarControlSub26 _sub4;
+public:
+	
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub26.h b/engines/titanic/star_control/star_control_sub26.h
index 2edfce7..cf0c62a 100644
--- a/engines/titanic/star_control/star_control_sub26.h
+++ b/engines/titanic/star_control/star_control_sub26.h
@@ -26,6 +26,20 @@
 namespace Titanic {
 
 class CStarControlSub26 {
+	struct Sub {
+		int _field0;
+		int _field4;
+		int _field8;
+		int _field10;
+		int _field14;
+
+		Sub() : _field0(0), _field4(0), _field8(0), _field10(0), _field14(0) {}
+	};
+public:
+	int _field0;
+	double _field4;
+public:
+	CStarControlSub26() : _field0(0), _field4(1.875) {}
 };
 
 } // End of namespace Titanic


Commit: e1695101bc464fe1a4917f7cd25db38854c923e0
    https://github.com/scummvm/scummvm/commit/e1695101bc464fe1a4917f7cd25db38854c923e0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:46-04:00

Commit Message:
TITANIC: Beginnings of matrix and vector classes

Changed paths:
  A engines/titanic/star_control/dmatrix.cpp
  A engines/titanic/star_control/dmatrix.h
  A engines/titanic/star_control/dvector.cpp
  A engines/titanic/star_control/dvector.h
  A engines/titanic/star_control/fmatrix.cpp
  A engines/titanic/star_control/fmatrix.h
  A engines/titanic/star_control/fpoint.cpp
  A engines/titanic/star_control/fpoint.h
  A engines/titanic/star_control/fvector.cpp
  A engines/titanic/star_control/fvector.h
  R engines/titanic/star_control/star_control_sub14.cpp
  R engines/titanic/star_control/star_control_sub14.h
  R engines/titanic/star_control/star_control_sub15.cpp
  R engines/titanic/star_control/star_control_sub15.h
    engines/titanic/module.mk
    engines/titanic/star_control/star_control_sub13.cpp
    engines/titanic/star_control/star_control_sub13.h
    engines/titanic/star_control/star_control_sub25.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index de82f1d..9dfbc92 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -417,10 +417,15 @@ MODULE_OBJS := \
 	sound/water_lapping_sounds.o \
 	sound/wave_file.o \
 	star_control/star_control.o \
-	star_control/star_control_sub1.o \
-	star_control/star_control_sub2.o \
 	star_control/base_star.o \
+	star_control/dmatrix.o \
+	star_control/dvector.o \
+	star_control/fmatrix.o \
+	star_control/fpoint.o \
+	star_control/fvector.o \
 	star_control/star_array.o \
+	star_control/star_control_sub1.o \
+	star_control/star_control_sub2.o \
 	star_control/star_control_sub4.o \
 	star_control/star_control_sub5.o \
 	star_control/star_control_sub6.o \
@@ -430,8 +435,6 @@ MODULE_OBJS := \
 	star_control/star_view.o \
 	star_control/star_control_sub12.o \
 	star_control/star_control_sub13.o \
-	star_control/star_control_sub14.o \
-	star_control/star_control_sub15.o \
 	star_control/star_control_sub20.o \
 	star_control/star_control_sub21.o \
 	star_control/star_control_sub22.o \
diff --git a/engines/titanic/star_control/dmatrix.cpp b/engines/titanic/star_control/dmatrix.cpp
new file mode 100644
index 0000000..160dcca
--- /dev/null
+++ b/engines/titanic/star_control/dmatrix.cpp
@@ -0,0 +1,33 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/dmatrix.h"
+
+namespace Titanic {
+
+DMatrix::DMatrix() :
+	_row1(1.0, 0.0, 0.0), _row2(0.0, 1.0, 0.0), _row3(0.0, 0.0, 1.0),
+	_row4(0.0, 0.0, 0.0) {
+}
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/dmatrix.h b/engines/titanic/star_control/dmatrix.h
new file mode 100644
index 0000000..8c5eeeb
--- /dev/null
+++ b/engines/titanic/star_control/dmatrix.h
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DMATRIX_H
+#define TITANIC_DMATRIX_H
+
+#include "titanic/star_control/dvector.h"
+
+namespace Titanic {
+
+class DMatrix {
+private:
+	DVector _row1;
+	DVector _row2;
+	DVector _row3;
+	DVector _row4;
+public:
+	DMatrix();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DMATRIX_H */
diff --git a/engines/titanic/star_control/dvector.cpp b/engines/titanic/star_control/dvector.cpp
new file mode 100644
index 0000000..8e071cf
--- /dev/null
+++ b/engines/titanic/star_control/dvector.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/dvector.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/dvector.h b/engines/titanic/star_control/dvector.h
new file mode 100644
index 0000000..32d2bdd
--- /dev/null
+++ b/engines/titanic/star_control/dvector.h
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_DVECTOR_H
+#define TITANIC_DVECTOR_H
+
+namespace Titanic {
+
+class DVector {
+public:
+	double _x, _y, _z;
+public:
+	DVector() : _x(0), _y(0), _z(0) {}
+	DVector(double x, double y, double z) : _x(x), _y(y), _z(z) {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_DVECTOR_H */
diff --git a/engines/titanic/star_control/fmatrix.cpp b/engines/titanic/star_control/fmatrix.cpp
new file mode 100644
index 0000000..52fc2bf
--- /dev/null
+++ b/engines/titanic/star_control/fmatrix.cpp
@@ -0,0 +1,75 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/fmatrix.h"
+
+namespace Titanic {
+
+FMatrix::FMatrix() :
+	_row1(1.0, 0.0, 0.0), _row2(0.0, 1.0, 0.0), _row3(0.0, 0.0, 1.0) {
+}
+
+FMatrix::FMatrix(DMatrix *src) {
+	copyFrom(src);
+}
+
+void FMatrix::copyFrom(const DMatrix *src) {
+	// TODO
+}
+
+void FMatrix::load(SimpleFile *file, int param) {
+	_row1._x = file->readFloat();
+	_row1._y = file->readFloat();
+	_row1._z = file->readFloat();
+	_row2._x = file->readFloat();
+	_row2._y = file->readFloat();
+	_row2._z = file->readFloat();
+	_row3._x = file->readFloat();
+	_row3._y = file->readFloat();
+	_row3._z = file->readFloat();
+}
+
+void FMatrix::save(SimpleFile *file, int indent) {
+	file->writeFloatLine(_row1._x, indent);
+	file->writeFloatLine(_row1._y, indent);
+	file->writeFloatLine(_row1._z, indent);
+	file->writeFloatLine(_row2._x, indent);
+	file->writeFloatLine(_row2._y, indent);
+	file->writeFloatLine(_row2._z, indent);
+	file->writeFloatLine(_row3._x, indent);
+	file->writeFloatLine(_row3._y, indent);
+	file->writeFloatLine(_row3._z, indent);
+}
+
+void FMatrix::clear() {
+	_row1 = FVector(1.0, 0.0, 0.0);
+	_row2 = FVector(0.0, 1.0, 0.0);
+	_row3 = FVector(0.0, 0.0, 1.0);
+}
+
+void FMatrix::set(FVector *row1, FVector *row2, FVector *row3) {
+	_row1 = *row1;
+	_row2 = *row2;
+	_row3 = *row3;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/fmatrix.h b/engines/titanic/star_control/fmatrix.h
new file mode 100644
index 0000000..e98b160
--- /dev/null
+++ b/engines/titanic/star_control/fmatrix.h
@@ -0,0 +1,70 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FMATRIX_H
+#define TITANIC_FMATRIX_H
+
+#include "titanic/support/simple_file.h"
+#include "titanic/star_control/fvector.h"
+
+namespace Titanic {
+
+class DMatrix;
+
+class FMatrix {
+private:
+	FVector _row1;
+	FVector _row2;
+	FVector _row3;
+private:
+	/**
+	 * Copys data from a given source
+	 */
+	void copyFrom(const DMatrix *src);
+public:
+	FMatrix();
+	FMatrix(DMatrix *src);
+
+	/**
+	 * Load the data for the class from file
+	 */
+	void load(SimpleFile *file, int param);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	void save(SimpleFile *file, int indent);
+
+	/**
+	 * Clears the matrix
+	 */
+	void clear();
+
+	/**
+	 * Sets the data for the matrix
+	 */
+	void set(FVector *row1, FVector *row2, FVector *row3);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MATRIX3_H */
diff --git a/engines/titanic/star_control/fpoint.cpp b/engines/titanic/star_control/fpoint.cpp
new file mode 100644
index 0000000..f3d7008
--- /dev/null
+++ b/engines/titanic/star_control/fpoint.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/fpoint.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/fpoint.h b/engines/titanic/star_control/fpoint.h
new file mode 100644
index 0000000..5329ecb
--- /dev/null
+++ b/engines/titanic/star_control/fpoint.h
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FPOINT_H
+#define TITANIC_FPOINT_H
+
+namespace Titanic {
+
+class FVector {
+public:
+	double _x, _y;
+public:
+	FVector() : _x(0), _y(0) {}
+	FVector(double x, double y) : _x(x), _y(y) {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FPOINT_H */
diff --git a/engines/titanic/star_control/fvector.cpp b/engines/titanic/star_control/fvector.cpp
new file mode 100644
index 0000000..39d303c
--- /dev/null
+++ b/engines/titanic/star_control/fvector.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/fvector.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/fvector.h b/engines/titanic/star_control/fvector.h
new file mode 100644
index 0000000..86e6e38
--- /dev/null
+++ b/engines/titanic/star_control/fvector.h
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_FVECTOR_H
+#define TITANIC_FVECTOR_H
+
+namespace Titanic {
+
+class FVector {
+public:
+	double _x, _y, _z;
+public:
+	FVector() : _x(0), _y(0), _z(0) {}
+	FVector(double x, double y, double z) : _x(x), _y(y), _z(z) {}
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_FVECTOR_H */
diff --git a/engines/titanic/star_control/star_control_sub13.cpp b/engines/titanic/star_control/star_control_sub13.cpp
index f22a22a..fd67c19 100644
--- a/engines/titanic/star_control/star_control_sub13.cpp
+++ b/engines/titanic/star_control/star_control_sub13.cpp
@@ -63,12 +63,12 @@ void CStarControlSub13::load(SimpleFile *file, int param) {
 	for (int idx = 0; idx < 5; ++idx)
 		_valArray[idx] = file->readFloat();
 
-	_sub14.load(file, param);
+	_matrix.load(file, param);
 	_fieldD4 = 0;
 }
 
 void CStarControlSub13::save(SimpleFile *file, int indent) {
-	_sub14.save(file, indent);
+	_matrix.save(file, indent);
 }
 
 
diff --git a/engines/titanic/star_control/star_control_sub13.h b/engines/titanic/star_control/star_control_sub13.h
index e1b5477..37ffe1b 100644
--- a/engines/titanic/star_control/star_control_sub13.h
+++ b/engines/titanic/star_control/star_control_sub13.h
@@ -25,7 +25,7 @@
 
 #include "titanic/support/simple_file.h"
 #include "titanic/star_control/star_control_sub6.h"
-#include "titanic/star_control/star_control_sub14.h"
+#include "titanic/star_control/fmatrix.h"
 
 namespace Titanic {
 
@@ -43,7 +43,7 @@ private:
 	int _field22;
 	int _field24;
 	double _valArray[5];
-	CStarControlSub14 _sub14;
+	FMatrix _matrix;
 	CStarControlSub6 _sub1;
 	CStarControlSub6 _sub2;
 	int _fieldC0;
diff --git a/engines/titanic/star_control/star_control_sub14.cpp b/engines/titanic/star_control/star_control_sub14.cpp
deleted file mode 100644
index 75e7c68..0000000
--- a/engines/titanic/star_control/star_control_sub14.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/star_control/star_control_sub14.h"
-
-namespace Titanic {
-
-CStarControlSub14::CStarControlSub14() :
-	_field0(0x3F800000), _field4(0), _field8(0), _fieldC(0),
-	_field10(0x3F800000), _field14(0), _field18(0), _field1C(0),
-	_field20(0x3F800000) {
-}
-
-void CStarControlSub14::load(SimpleFile *file, int param) {
-	_field0 = file->readFloat();
-	_field4 = file->readFloat();
-	_field8 = file->readFloat();
-	_fieldC = file->readFloat();
-	_field10 = file->readFloat();
-	_field14 = file->readFloat();
-	_field18 = file->readFloat();
-	_field1C = file->readFloat();
-	_field20 = file->readFloat();
-}
-
-void CStarControlSub14::save(SimpleFile *file, int indent) {
-
-}
-
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub14.h b/engines/titanic/star_control/star_control_sub14.h
deleted file mode 100644
index 0b1d4e3..0000000
--- a/engines/titanic/star_control/star_control_sub14.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_CONTROL_SUB14_H
-#define TITANIC_STAR_CONTROL_SUB14_H
-
-#include "titanic/support/simple_file.h"
-
-namespace Titanic {
-
-class CStarControlSub14 {
-private:
-	double _field0;
-	double _field4;
-	double _field8;
-	double _fieldC;
-	double _field10;
-	double _field14;
-	double _field18;
-	double _field1C;
-	double _field20;
-public:
-	CStarControlSub14();
-
-	/**
-	 * Load the data for the class from file
-	 */
-	void load(SimpleFile *file, int param);
-
-	/**
-	 * Save the data for the class to file
-	 */
-	void save(SimpleFile *file, int indent);
-
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_SUB13_H */
diff --git a/engines/titanic/star_control/star_control_sub15.cpp b/engines/titanic/star_control/star_control_sub15.cpp
deleted file mode 100644
index a6eb2e8..0000000
--- a/engines/titanic/star_control/star_control_sub15.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/star_control/star_control_sub15.h"
-
-namespace Titanic {
-
-CStarControlSub15::CStarControlSub15() :
-		_field0(1.875), _field8(0), _fieldC(0),
-		_field10(0), _field14(0), _field18(0.0), _field1C(0),
-		_field20(1.875), _field28(0), _field2C(0),
-		_field30(0), _field38(0), _field3C(0),
-		_field40(1.875), _field48(0), _field4C(0),
-		_field50(0), _field54(0), _field58(0), _field5C(0) {
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub15.h b/engines/titanic/star_control/star_control_sub15.h
deleted file mode 100644
index faf68f1..0000000
--- a/engines/titanic/star_control/star_control_sub15.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_CONTROL_SUB15_H
-#define TITANIC_STAR_CONTROL_SUB15_H
-
-namespace Titanic {
-
-class CStarControlSub15 {
-private:
-	double _field0;
-	int _field8;
-	int _fieldC;
-	int _field10;
-	int _field14;
-	double _field18;
-	int _field1C;
-	double _field20;
-	int _field24;
-	int _field28;
-	int _field2C;
-	double _field30;
-	int _field38;
-	int _field3C;
-	double _field40;
-	int _field48;
-	int _field4C;
-	int _field50;
-	int _field54;
-	int _field58;
-	int _field5C;
-public:
-	CStarControlSub15();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_SUB15_H */
diff --git a/engines/titanic/star_control/star_control_sub25.h b/engines/titanic/star_control/star_control_sub25.h
index 81b5bb0..e943782 100644
--- a/engines/titanic/star_control/star_control_sub25.h
+++ b/engines/titanic/star_control/star_control_sub25.h
@@ -23,17 +23,17 @@
 #ifndef TITANIC_STAR_CONTROL_SUB25_H
 #define TITANIC_STAR_CONTROL_SUB25_H
 
-#include "titanic/star_control/star_control_sub14.h"
+#include "titanic/star_control/fmatrix.h"
 #include "titanic/star_control/star_control_sub26.h"
 
 namespace Titanic {
 
 class CStarControlSub25 {
 public:
-	CStarControlSub14 _sub1;
-	CStarControlSub14 _sub2;
-	CStarControlSub26 _sub3;
-	CStarControlSub26 _sub4;
+	FMatrix _matrix1;
+	FMatrix _matrix2;
+	CStarControlSub26 _sub1;
+	CStarControlSub26 _sub2;
 public:
 	
 };


Commit: 9b1efa3bf5696ea606b9374d216d4a1ecf52610b
    https://github.com/scummvm/scummvm/commit/9b1efa3bf5696ea606b9374d216d4a1ecf52610b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:49-04:00

Commit Message:
TITANIC: Added FMatrix methods

Changed paths:
    engines/titanic/star_control/dmatrix.h
    engines/titanic/star_control/dvector.cpp
    engines/titanic/star_control/dvector.h
    engines/titanic/star_control/fmatrix.cpp
    engines/titanic/star_control/fmatrix.h
    engines/titanic/star_control/fpoint.h
    engines/titanic/star_control/fvector.cpp
    engines/titanic/star_control/fvector.h
    engines/titanic/star_control/star_control_sub21.cpp
    engines/titanic/star_control/star_control_sub6.cpp
    engines/titanic/star_control/star_control_sub6.h



diff --git a/engines/titanic/star_control/dmatrix.h b/engines/titanic/star_control/dmatrix.h
index 8c5eeeb..565df80 100644
--- a/engines/titanic/star_control/dmatrix.h
+++ b/engines/titanic/star_control/dmatrix.h
@@ -27,6 +27,10 @@
 
 namespace Titanic {
 
+/**
+ * Double based matrix class.
+ * @remarks		TODO: See if it can be merged with FMatrix
+ */
 class DMatrix {
 private:
 	DVector _row1;
diff --git a/engines/titanic/star_control/dvector.cpp b/engines/titanic/star_control/dvector.cpp
index 8e071cf..e4c5b15 100644
--- a/engines/titanic/star_control/dvector.cpp
+++ b/engines/titanic/star_control/dvector.cpp
@@ -21,8 +21,17 @@
  */
 
 #include "titanic/star_control/dvector.h"
+#include "common/algorithm.h"
 
 namespace Titanic {
 
+void DVector::fn3() {
+	double hyp = sqrt(_x * _x + _y * _y + _z * _z);
+	assert(hyp);
+
+	_x *= 1.0 / hyp;
+	_y *= 1.0 / hyp;
+	_z *= 1.0 / hyp;
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/dvector.h b/engines/titanic/star_control/dvector.h
index 32d2bdd..7aca407 100644
--- a/engines/titanic/star_control/dvector.h
+++ b/engines/titanic/star_control/dvector.h
@@ -25,12 +25,18 @@
 
 namespace Titanic {
 
+/**
+ * Double based vector class.
+ * @remarks		TODO: See if it can be merged with FVector
+ */
 class DVector {
 public:
 	double _x, _y, _z;
 public:
 	DVector() : _x(0), _y(0), _z(0) {}
 	DVector(double x, double y, double z) : _x(x), _y(y), _z(z) {}
+
+	void fn3();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/fmatrix.cpp b/engines/titanic/star_control/fmatrix.cpp
index 52fc2bf..c53892d 100644
--- a/engines/titanic/star_control/fmatrix.cpp
+++ b/engines/titanic/star_control/fmatrix.cpp
@@ -72,4 +72,59 @@ void FMatrix::set(FVector *row1, FVector *row2, FVector *row3) {
 	_row3 = *row3;
 }
 
+void FMatrix::fn1(FVector *v) {
+	_row3._x = v->_x;
+
+	FVector tempVector;
+	tempVector.fn1(v);
+
+	_row2._x = tempVector._x;
+	_row2._y = tempVector._y;
+	_row2._z = tempVector._z;
+
+	_row3.multiply(v, &_row2);
+	_row1._x = _row2._x;
+	_row1._y = _row2._y;
+	_row1._z = _row2._z;
+	_row1.fn3();
+
+	_row3.multiply(&tempVector, &_row1);
+	_row2._x = _row1._x;
+	_row2._y = _row1._y;
+	_row2._z = _row1._z;
+	_row2.fn3();
+}
+
+void FMatrix::fn2(FMatrix *m) {
+	double x1 = _row1._y * m->_row2._x + _row1._z * m->_row3._x + _row1._x * m->_row1._x;
+	double y1 = _row1._x * m->_row1._y + m->_row2._y * _row1._y + m->_row3._y * _row1._z;
+	double z1 = _row1._x * m->_row1._z + _row1._y * m->_row2._z + _row1._z * m->_row3._z;
+	double x2 = m->_row1._x * _row2._x + m->_row3._x * _row2._z + m->_row2._x * _row2._y;
+	double y2 = m->_row3._y * _row2._z + m->_row1._y * _row2._x + m->_row2._y * _row2._y;
+	double z2 = _row2._z * m->_row3._z + _row2._x * m->_row1._z + _row2._y * m->_row2._z;
+	double x3 = m->_row1._x * _row3._x + _row3._z * m->_row3._x + _row3._y * m->_row2._x;
+	double y3 = _row3._y * m->_row2._y + _row3._z * m->_row3._y + _row3._x * m->_row1._y;
+	double z3 = _row3._x * m->_row1._z + _row3._y * m->_row2._z + _row3._z * m->_row3._z;
+
+	_row1 = FVector(x1, y1, z1);
+	_row2 = FVector(x2, y2, z2);
+	_row3 = FVector(x3, y3, z3);
+}
+
+void FMatrix::fn3(FMatrix *m) {
+	double x1 = _row2._x * m->_row1._y + m->_row1._z * _row3._x + _row1._x * m->_row1._x;
+	double y1 = m->_row1._x * _row1._y + _row3._y * m->_row1._z + _row2._y * m->_row1._y;
+	double z1 = m->_row1._x * _row1._z + m->_row1._y * _row2._z + m->_row1._z * _row3._z;
+	double x2 = _row1._x * m->_row2._x + _row2._x * m->_row2._y + _row3._x * m->_row2._z;
+	double y2 = _row3._y * m->_row2._z + _row1._y * m->_row2._x + _row2._y * m->_row2._y;
+	double z2 = m->_row2._z * _row3._z + m->_row2._x * _row1._z + m->_row2._y * _row2._z;
+	double x3 = _row1._x * m->_row3._x + m->_row3._z * _row3._x + m->_row3._y * _row2._x;
+	double y3 = m->_row3._y * _row2._y + m->_row3._z * _row3._y + m->_row3._x * _row1._y;
+	double z3 = m->_row3._x * _row1._z + m->_row3._y * _row2._z + m->_row3._z * _row3._z;
+
+	_row1 = FVector(x1, y1, z1);
+	_row2 = FVector(x2, y2, z2);
+	_row3 = FVector(x3, y3, z3);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/fmatrix.h b/engines/titanic/star_control/fmatrix.h
index e98b160..391e117 100644
--- a/engines/titanic/star_control/fmatrix.h
+++ b/engines/titanic/star_control/fmatrix.h
@@ -30,6 +30,10 @@ namespace Titanic {
 
 class DMatrix;
 
+/**
+ * Floating point matrix class.
+ * @remarks		TODO: See if it can be merged with DMatrix
+ */
 class FMatrix {
 private:
 	FVector _row1;
@@ -63,6 +67,25 @@ public:
 	 * Sets the data for the matrix
 	 */
 	void set(FVector *row1, FVector *row2, FVector *row3);
+
+	void fn1(FVector *v);
+
+	void fn2(FMatrix *m);
+	void fn3(FMatrix *m);
+
+	/**
+	 * Returns true if the passed matrix equals this one
+	 */
+	bool operator==(const FMatrix &src) {
+		return _row1 == src._row1 && _row2 == src._row2 && _row3 == src._row3;
+	}
+
+	/**
+	 * Returns true if the passed matrix does not equal this one
+	 */
+	bool operator!=(const FMatrix &src) {
+		return !operator==(src);
+	}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/fpoint.h b/engines/titanic/star_control/fpoint.h
index 5329ecb..f2cef18 100644
--- a/engines/titanic/star_control/fpoint.h
+++ b/engines/titanic/star_control/fpoint.h
@@ -25,12 +25,15 @@
 
 namespace Titanic {
 
-class FVector {
+/**
+ * Floating point Point class
+ */
+class FPoint {
 public:
 	double _x, _y;
 public:
-	FVector() : _x(0), _y(0) {}
-	FVector(double x, double y) : _x(x), _y(y) {}
+	FPoint() : _x(0), _y(0) {}
+	FPoint(double x, double y) : _x(x), _y(y) {}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/fvector.cpp b/engines/titanic/star_control/fvector.cpp
index 39d303c..a7520bf 100644
--- a/engines/titanic/star_control/fvector.cpp
+++ b/engines/titanic/star_control/fvector.cpp
@@ -21,8 +21,30 @@
  */
 
 #include "titanic/star_control/fvector.h"
+#include "common/algorithm.h"
 
 namespace Titanic {
 
+void FVector::fn1(FVector *v) {
+	v->_x = (ABS(_x - _y) < 0.00001 && ABS(_y - _z) < 0.00001 &&
+		ABS(_x - _z) < 0.00001) ? -_x : _x;
+	v->_y = _y;
+	v->_z = _z;
+}
+
+void FVector::multiply(FVector *dest, const FVector *src) {
+	dest->_x = (src->_z * _y) - (_z * src->_y);
+	dest->_y = (src->_x * _z) - (_x * src->_z);
+	dest->_z = (src->_y * _x) - (_y * src->_x);
+}
+
+void FVector::fn3() {
+	double hyp = sqrt(_x * _x + _y * _y + _z * _z);
+	assert(hyp);
+
+	_x *= 1.0 / hyp;
+	_y *= 1.0 / hyp;
+	_z *= 1.0 / hyp;
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/fvector.h b/engines/titanic/star_control/fvector.h
index 86e6e38..75ad2f8 100644
--- a/engines/titanic/star_control/fvector.h
+++ b/engines/titanic/star_control/fvector.h
@@ -25,12 +25,34 @@
 
 namespace Titanic {
 
+/**
+ * Floating point vector class.
+ * @remarks		TODO: See if it can be merged with DVector
+ */
 class FVector {
 public:
 	double _x, _y, _z;
 public:
 	FVector() : _x(0), _y(0), _z(0) {}
 	FVector(double x, double y, double z) : _x(x), _y(y), _z(z) {}
+
+	void fn1(FVector *v);
+	void multiply(FVector *dest, const FVector *src);
+	void fn3();
+
+	/**
+	 * Returns true if the passed vector equals this one
+	 */
+	bool operator==(const FVector &src) const {
+		return _x != src._x || _y != src._y || _z != src._z;
+	}
+
+	/**
+	 * Returns true if the passed vector does not equal this one
+	 */
+	bool operator!=(const FVector &src) const {
+		return !operator==(src);
+	}
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub21.cpp b/engines/titanic/star_control/star_control_sub21.cpp
index 958ee38..b606d15 100644
--- a/engines/titanic/star_control/star_control_sub21.cpp
+++ b/engines/titanic/star_control/star_control_sub21.cpp
@@ -20,125 +20,9 @@
  *
  */
 
-#include "titanic/star_control/star_control_sub20.h"
+#include "titanic/star_control/star_control_sub21.h"
 #include "common/textconsole.h"
 
 namespace Titanic {
 
-CStarControlSub20::CStarControlSub20(void *src) {
-	_lockCounter = 0;
-	_dataP = nullptr;
-
-	if (src) {
-		copyFrom1(src);
-	} else {
-		_field4 = 0.0;
-		_field8 = 0.0;
-		_fieldC = 20.0;
-		_field10 = 0.0;
-		_field14 = 50000.0;
-		_field18 = 1.0;
-		_field1C = 1.0;
-		_field20 = 0.0;
-	}
-}
-
-CStarControlSub20::~CStarControlSub20() { 
-	clear();
-}
-
-void CStarControlSub20::copyFrom1(void *src) {
-	error("TODO: CStarControlSub20::copyFrom1");
-}
-
-void CStarControlSub20::copyFrom2(void *src) {
-	error("TODO: CStarControlSub20::copyFrom2");
-}
-
-void CStarControlSub20::proc4() {
-	if (!isLocked() && _field4 < _field14) {
-		_field8 += _field4;
-		if (_fieldC == _field8)
-			_field4 -= _field8;
-		else
-			_field4 += _field8;
-	}
-}
-
-void CStarControlSub20::proc5() {
-	if (!isLocked()) {
-		_field8 -= _fieldC;
-		if (_field8 == _field4)
-			_field4 += _field8;
-		else
-			_field4 -= _field8;
-
-		if (_field8 < 0.0)
-			_field8 = 0.0;
-	}
-}
-
-void CStarControlSub20::proc6() {
-	if (!isLocked())
-		_field4 = _field14;
-}
-
-void CStarControlSub20::proc7() {
-	if (!isLocked()) {
-		_field4 = 0.0;
-		_field8 = 0.0;
-	}
-}
-
-void CStarControlSub20::proc11(CErrorCode *errorCode, void *v2, void *v3) {
-	if (_field4 > 0.0) {
-		warning("TODO: CStarControlSub20::proc11");
-	}
-}
-
-void CStarControlSub20::setData(void *data) {
-	clear();
-	_dataP = data;
-}
-
-void CStarControlSub20::clear() {
-	if (_dataP) {
-		delete _dataP;
-		_dataP = nullptr;
-	}
-}
-
-void CStarControlSub20::load(SimpleFile *file, int val) {
-	if (!val) {
-		_field4 = file->readFloat();
-		_field8 = file->readFloat();
-		_fieldC = file->readFloat();
-		_field10 = file->readFloat();
-		_field14 = file->readFloat();
-		_field18 = file->readFloat();
-		_field1C = file->readFloat();
-		_field20 = file->readFloat();
-	}
-}
-
-void CStarControlSub20::save(SimpleFile *file, int indent) {
-	file->writeFloatLine(_field4, indent);
-	file->writeFloatLine(_field8, indent);
-	file->writeFloatLine(_fieldC, indent);
-	file->writeFloatLine(_field10, indent);
-	file->writeFloatLine(_field14, indent);
-	file->writeFloatLine(_field18, indent);
-	file->writeFloatLine(_field1C, indent);
-	file->writeFloatLine(_field20, indent);
-}
-
-void CStarControlSub20::incLockCount() {
-	++_lockCounter;
-}
-
-void CStarControlSub20::decLockCount() {
-	if (_lockCounter > 0)
-		--_lockCounter;
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub6.cpp b/engines/titanic/star_control/star_control_sub6.cpp
index c416181..dfa23d6 100644
--- a/engines/titanic/star_control/star_control_sub6.cpp
+++ b/engines/titanic/star_control/star_control_sub6.cpp
@@ -29,15 +29,7 @@ CStarControlSub6::CStarControlSub6() {
 }
 
 void CStarControlSub6::clear() {
-	_field0 = 0x3F800000;
-	_field4 = 0;
-	_field8 = 0;
-	_fieldC = 0;
-	_field10 = 0x3F800000;
-	_field14 = 0;
-	_field18 = 0;
-	_field1C = 0;
-	_field20 = 0x3F800000;
+	_matrix.clear();
 	_field24 = 0;
 	_field28 = 0;
 	_field2C = 0;
diff --git a/engines/titanic/star_control/star_control_sub6.h b/engines/titanic/star_control/star_control_sub6.h
index 3531c76..0c477ee 100644
--- a/engines/titanic/star_control/star_control_sub6.h
+++ b/engines/titanic/star_control/star_control_sub6.h
@@ -23,19 +23,13 @@
 #ifndef TITANIC_STAR_CONTROL_SUB6_H
 #define TITANIC_STAR_CONTROL_SUB6_H
 
+#include "titanic/star_control/fmatrix.h"
+
 namespace Titanic {
 
 class CStarControlSub6 {
 private:
-	int _field0;
-	int _field4;
-	int _field8;
-	int _fieldC;
-	int _field10;
-	int _field14;
-	int _field18;
-	int _field1C;
-	int _field20;
+	FMatrix _matrix;
 	int _field24;
 	int _field28;
 	int _field2C;


Commit: e674116edbd61054dae994033c0b0c10259b8aed
    https://github.com/scummvm/scummvm/commit/e674116edbd61054dae994033c0b0c10259b8aed
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:51-04:00

Commit Message:
TITANIC: More FVector methods

Changed paths:
    engines/titanic/star_control/fvector.cpp
    engines/titanic/star_control/fvector.h



diff --git a/engines/titanic/star_control/fvector.cpp b/engines/titanic/star_control/fvector.cpp
index a7520bf..ce7b62b 100644
--- a/engines/titanic/star_control/fvector.cpp
+++ b/engines/titanic/star_control/fvector.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/star_control/fvector.h"
 #include "common/algorithm.h"
+#include "common/textconsole.h"
 
 namespace Titanic {
 
@@ -47,4 +48,23 @@ void FVector::fn3() {
 	_z *= 1.0 / hyp;
 }
 
+double FVector::getDistance(const FVector *src) const {
+	double xd = src->_x - _x;
+	double yd = src->_y - _y;
+	double zd = src->_z - _z;
+
+	return sqrt(xd * xd + yd * yd + zd * zd);
+}
+
+void FVector::fn4(FVector *dest, const FVector *v1, const FVector *v2) {
+	FVector tempVector(v1->_x + v2->_x, v1->_y + v2->_y, v1->_z + v2->_z);
+	tempVector.fn3();
+
+	*dest = tempVector;
+}
+
+void FVector::fn5(FVector *dest, const void *v) const {
+	error("TODO: FVector::fn5");
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/fvector.h b/engines/titanic/star_control/fvector.h
index 75ad2f8..9af18dc 100644
--- a/engines/titanic/star_control/fvector.h
+++ b/engines/titanic/star_control/fvector.h
@@ -41,6 +41,14 @@ public:
 	void fn3();
 
 	/**
+	 * Returns the distance between a specified point and this one
+	 */
+	double getDistance(const FVector *src) const;
+
+	static void fn4(FVector *dest, const FVector *v1, const FVector *v2);
+	void fn5(FVector *dest, const void *v) const;
+
+	/**
 	 * Returns true if the passed vector equals this one
 	 */
 	bool operator==(const FVector &src) const {


Commit: 1b06a9294ac40dbba1437806e222e4cbdd32c016
    https://github.com/scummvm/scummvm/commit/1b06a9294ac40dbba1437806e222e4cbdd32c016
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:54-04:00

Commit Message:
TITANIC: Setup of CStarControlSub6 class

Changed paths:
    engines/titanic/star_control/fmatrix.h
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control.h
    engines/titanic/star_control/star_control_sub6.cpp
    engines/titanic/star_control/star_control_sub6.h



diff --git a/engines/titanic/star_control/fmatrix.h b/engines/titanic/star_control/fmatrix.h
index 391e117..5dbbe99 100644
--- a/engines/titanic/star_control/fmatrix.h
+++ b/engines/titanic/star_control/fmatrix.h
@@ -36,15 +36,15 @@ class DMatrix;
  */
 class FMatrix {
 private:
-	FVector _row1;
-	FVector _row2;
-	FVector _row3;
-private:
 	/**
 	 * Copys data from a given source
 	 */
 	void copyFrom(const DMatrix *src);
 public:
+	FVector _row1;
+	FVector _row2;
+	FVector _row3;
+public:
 	FMatrix();
 	FMatrix(DMatrix *src);
 
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index 8ab247e..0e54cf5 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -23,6 +23,7 @@
 #include "titanic/support/screen_manager.h"
 #include "titanic/star_control/star_control.h"
 #include "titanic/star_control/error_code.h"
+#include "titanic/star_control/star_control_sub6.h"
 
 namespace Titanic {
 
@@ -35,6 +36,11 @@ END_MESSAGE_MAP()
 
 CStarControl::CStarControl() : _fieldBC(0), _field80B0(0),
 		_starRect(20, 10, 620, 350) {
+	CStarControlSub6::init();
+}
+
+CStarControl::~CStarControl() {
+	CStarControlSub6::deinit();
 }
 
 void CStarControl::save(SimpleFile *file, int indent) {
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index 0c1fab7..c771373 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -49,6 +49,7 @@ private:
 public:
 	CLASSDEF
 	CStarControl();
+	virtual ~CStarControl();
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/star_control/star_control_sub6.cpp b/engines/titanic/star_control/star_control_sub6.cpp
index dfa23d6..2022ab8 100644
--- a/engines/titanic/star_control/star_control_sub6.cpp
+++ b/engines/titanic/star_control/star_control_sub6.cpp
@@ -24,10 +24,24 @@
 
 namespace Titanic {
 
+CStarControlSub6 *CStarControlSub6::_static;
+
 CStarControlSub6::CStarControlSub6() {
 	clear();
 }
 
+CStarControlSub6::CStarControlSub6(int mode, double val) {
+	set(mode, val);
+}
+
+void CStarControlSub6::init() {
+	_static = nullptr;
+}
+
+void CStarControlSub6::deinit() {
+	delete _static;
+}
+
 void CStarControlSub6::clear() {
 	_matrix.clear();
 	_field24 = 0;
@@ -35,4 +49,55 @@ void CStarControlSub6::clear() {
 	_field2C = 0;
 }
 
+void CStarControlSub6::set(int mode, double amount) {
+	const double ROTATION = 3.1415927 * 0.0055555557;
+	double sinVal = sin(amount * ROTATION);
+	double cosVal = cos(amount * ROTATION);
+
+	switch (mode) {
+	case 0:
+		_matrix._row1._x = 1.0;
+		_matrix._row1._y = 0.0;
+		_matrix._row1._z = 0.0;
+		_matrix._row2._x = 0.0;
+		_matrix._row2._y = cosVal;
+		_matrix._row2._z = sinVal;
+		_matrix._row3._x = 0.0;
+		_matrix._row3._y = -sinVal;
+		_matrix._row3._z = cosVal;
+		break;
+
+	case 1:
+		_matrix._row1._x = cosVal;
+		_matrix._row1._y = 0.0;
+		_matrix._row1._z = sinVal;
+		_matrix._row2._x = 0.0;
+		_matrix._row2._y = 1.0;
+		_matrix._row2._z = 0.0;
+		_matrix._row3._x = -sinVal;
+		_matrix._row3._y = 0.0;
+		_matrix._row3._z = sinVal;
+		break;
+
+	case 2:
+		_matrix._row1._x = cosVal;
+		_matrix._row1._y = sinVal;
+		_matrix._row1._z = 0.0;
+		_matrix._row2._x = -sinVal;
+		_matrix._row2._y = cosVal;
+		_matrix._row2._z = 0.0;
+		_matrix._row3._x = 0.0;
+		_matrix._row3._y = 0.0;
+		_matrix._row3._z = 1.0;
+		break;
+
+	default:
+		break;
+	}
+
+	_field24 = 0.0;
+	_field28 = 0.0;
+	_field2C = 0.0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub6.h b/engines/titanic/star_control/star_control_sub6.h
index 0c477ee..10058f5 100644
--- a/engines/titanic/star_control/star_control_sub6.h
+++ b/engines/titanic/star_control/star_control_sub6.h
@@ -33,10 +33,24 @@ private:
 	int _field24;
 	int _field28;
 	int _field2C;
+private:
+	static CStarControlSub6 *_static;
+public:
+	static void init();
+	static void deinit();
 public:
 	CStarControlSub6();
+	CStarControlSub6(int mode, double amount);
 
+	/**
+	 * Clear the item
+	 */
 	void clear();
+
+	/**
+	 * Sets the default data
+	 */
+	void set(int mode, double val);
 };
 
 } // End of namespace Titanic


Commit: 0118919d358332f243713b69e6fff163413146a3
    https://github.com/scummvm/scummvm/commit/0118919d358332f243713b69e6fff163413146a3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:56-04:00

Commit Message:
TITANIC: Further work on DMatrix

Changed paths:
    engines/titanic/star_control/dmatrix.cpp
    engines/titanic/star_control/dmatrix.h
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control_sub26.cpp
    engines/titanic/star_control/star_control_sub26.h
    engines/titanic/star_control/star_control_sub6.cpp



diff --git a/engines/titanic/star_control/dmatrix.cpp b/engines/titanic/star_control/dmatrix.cpp
index 160dcca..7000805 100644
--- a/engines/titanic/star_control/dmatrix.cpp
+++ b/engines/titanic/star_control/dmatrix.cpp
@@ -21,13 +21,84 @@
  */
 
 #include "titanic/star_control/dmatrix.h"
+#include "titanic/star_control/fmatrix.h"
+#include "titanic/star_control/star_control_sub26.h"
 
 namespace Titanic {
 
+DMatrix *DMatrix::_static;
+
 DMatrix::DMatrix() :
-	_row1(1.0, 0.0, 0.0), _row2(0.0, 1.0, 0.0), _row3(0.0, 0.0, 1.0),
-	_row4(0.0, 0.0, 0.0) {
+	_row1(1.0, 0.0, 0.0), _row2(0.0, 1.0, 0.0), _row3(0.0, 0.0, 1.0) {
+}
+
+DMatrix::DMatrix(int mode, const FMatrix *src) {
+	assert(!mode);
+
+	_row1._x = 1.0;
+	_row2._y = 1.0;
+	_row3._z = 1.0;
+	_frow1._x = src->_row1._x;
+	_frow1._y = src->_row1._y;
+	_frow1._z = src->_row1._z;
+	_frow2._x = src->_row2._x;
+	_frow2._y = src->_row2._y;
+	_frow2._z = src->_row2._z;
+}
+
+DMatrix::DMatrix(int mode, double val) {
+	set(mode, val);
+}
+
+void DMatrix::init() {
+	_static = nullptr;
+}
+
+void DMatrix::deinit() {
+	delete _static;
+	_static = nullptr;
 }
 
+void DMatrix::set(int mode, double amount) {
+	const double FACTOR = 0.0174532925199433;
+	double sinVal = sin(amount * FACTOR);
+	double cosVal = cos(amount * FACTOR);
+
+	switch (mode) {
+	case 0:
+		_row1._x = 1.0;
+		_row2._y = cosVal;
+		_row2._z = sinVal;
+		_row3._y = -sinVal;
+		_row3._z = cosVal;
+		break;
+
+	case 1:
+		_row1._x = cosVal;
+		_row1._z = sinVal;
+		_row2._y = 1.0;
+		_row3._x = -sinVal;
+		_row3._z = cosVal;
+		break;
+
+	case 2:
+		_row1._x = cosVal;
+		_row1._y = sinVal;
+		_row2._x = -sinVal;
+		_row2._y = cosVal;
+		_row3._z = 1.0;
+		break;
+
+	default:
+		break;
+	}
+}
+
+void DMatrix::fn3(CStarControlSub26 *sub26) {
+	double v = sub26->fn1();
+	v = (v < 0.0) ? 0.0 : 2.0 / v;
+
+	error("TODO: DMatrix::fn3 %d", (int)v);
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/dmatrix.h b/engines/titanic/star_control/dmatrix.h
index 565df80..14f6bb0 100644
--- a/engines/titanic/star_control/dmatrix.h
+++ b/engines/titanic/star_control/dmatrix.h
@@ -24,21 +24,40 @@
 #define TITANIC_DMATRIX_H
 
 #include "titanic/star_control/dvector.h"
+#include "titanic/star_control/fvector.h"
 
 namespace Titanic {
 
+class FMatrix;
+class CStarControlSub26;
+
 /**
  * Double based matrix class.
  * @remarks		TODO: See if it can be merged with FMatrix
  */
 class DMatrix {
 private:
+	static DMatrix *_static;
+public:
 	DVector _row1;
 	DVector _row2;
 	DVector _row3;
-	DVector _row4;
+	FVector _frow1;
+	FVector _frow2;
+public:
+	static void init();
+	static void deinit();
 public:
 	DMatrix();
+	DMatrix(int mode, const FMatrix *src);
+	DMatrix(int mode, double val);
+
+	/**
+	 * Sets up data for the matrix
+	 */
+	void set(int mode, double amount);
+
+	void fn3(CStarControlSub26 *sub26);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index 0e54cf5..e048d11 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -22,6 +22,7 @@
 
 #include "titanic/support/screen_manager.h"
 #include "titanic/star_control/star_control.h"
+#include "titanic/star_control/dmatrix.h"
 #include "titanic/star_control/error_code.h"
 #include "titanic/star_control/star_control_sub6.h"
 
@@ -37,10 +38,12 @@ END_MESSAGE_MAP()
 CStarControl::CStarControl() : _fieldBC(0), _field80B0(0),
 		_starRect(20, 10, 620, 350) {
 	CStarControlSub6::init();
+	DMatrix::init();
 }
 
 CStarControl::~CStarControl() {
 	CStarControlSub6::deinit();
+	DMatrix::deinit();
 }
 
 void CStarControl::save(SimpleFile *file, int indent) {
diff --git a/engines/titanic/star_control/star_control_sub26.cpp b/engines/titanic/star_control/star_control_sub26.cpp
index 9d796a0..89ff93c 100644
--- a/engines/titanic/star_control/star_control_sub26.cpp
+++ b/engines/titanic/star_control/star_control_sub26.cpp
@@ -25,4 +25,10 @@
 
 namespace Titanic {
 
+double CStarControlSub26::fn1() const {
+	return _sub._v1 * _sub._v1 + _sub._v2 * _sub._v2 +
+		_sub._v3 * _sub._v3 + _field0 * _field0;
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub26.h b/engines/titanic/star_control/star_control_sub26.h
index cf0c62a..4054a2b 100644
--- a/engines/titanic/star_control/star_control_sub26.h
+++ b/engines/titanic/star_control/star_control_sub26.h
@@ -27,19 +27,19 @@ namespace Titanic {
 
 class CStarControlSub26 {
 	struct Sub {
-		int _field0;
-		int _field4;
-		int _field8;
-		int _field10;
-		int _field14;
+		double _v1;
+		double _v2;
+		double _v3;
 
-		Sub() : _field0(0), _field4(0), _field8(0), _field10(0), _field14(0) {}
+		Sub() : _v1(0.0), _v2(0.0), _v3(0.0) {}
 	};
 public:
-	int _field0;
-	double _field4;
+	double _field0;
+	Sub _sub;
 public:
-	CStarControlSub26() : _field0(0), _field4(1.875) {}
+	CStarControlSub26() : _field0(1.0) {}
+
+	double fn1() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub6.cpp b/engines/titanic/star_control/star_control_sub6.cpp
index 2022ab8..83abc22 100644
--- a/engines/titanic/star_control/star_control_sub6.cpp
+++ b/engines/titanic/star_control/star_control_sub6.cpp
@@ -40,6 +40,7 @@ void CStarControlSub6::init() {
 
 void CStarControlSub6::deinit() {
 	delete _static;
+	_static = nullptr;
 }
 
 void CStarControlSub6::clear() {


Commit: dee69e206906f59d6af5f6e6351d5b9d8770221f
    https://github.com/scummvm/scummvm/commit/dee69e206906f59d6af5f6e6351d5b9d8770221f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:09:59-04:00

Commit Message:
TITANIC: Renaming of star point classes

Changed paths:
  A engines/titanic/star_control/star_points1.cpp
  A engines/titanic/star_control/star_points1.h
  A engines/titanic/star_control/star_points2.cpp
  A engines/titanic/star_control/star_points2.h
  R engines/titanic/star_control/star_array.cpp
  R engines/titanic/star_control/star_array.h
  R engines/titanic/star_control/star_control_sub9.cpp
  R engines/titanic/star_control/star_control_sub9.h
    engines/titanic/module.mk
    engines/titanic/star_control/star_control_sub1.cpp
    engines/titanic/star_control/star_control_sub1.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 9dfbc92..96715f2 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -423,7 +423,6 @@ MODULE_OBJS := \
 	star_control/fmatrix.o \
 	star_control/fpoint.o \
 	star_control/fvector.o \
-	star_control/star_array.o \
 	star_control/star_control_sub1.o \
 	star_control/star_control_sub2.o \
 	star_control/star_control_sub4.o \
@@ -431,8 +430,6 @@ MODULE_OBJS := \
 	star_control/star_control_sub6.o \
 	star_control/star_control_sub7.o \
 	star_control/star_control_sub8.o \
-	star_control/star_control_sub9.o \
-	star_control/star_view.o \
 	star_control/star_control_sub12.o \
 	star_control/star_control_sub13.o \
 	star_control/star_control_sub20.o \
@@ -442,6 +439,9 @@ MODULE_OBJS := \
 	star_control/star_control_sub24.o \
 	star_control/star_control_sub25.o \
 	star_control/star_control_sub26.o \
+	star_control/star_points1.o \
+	star_control/star_points2.o \
+	star_control/star_view.o \
 	star_control/surface_area.o \
 	star_control/surface_fader_base.o \
 	star_control/surface_fader.o \
diff --git a/engines/titanic/star_control/star_array.cpp b/engines/titanic/star_control/star_array.cpp
deleted file mode 100644
index 2e4a928..0000000
--- a/engines/titanic/star_control/star_array.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/star_control/star_array.h"
-#include "titanic/star_control/star_control_sub12.h"
-#include "titanic/titanic.h"
-
-namespace Titanic {
-
-#define ARRAY_COUNT 876
-const double FACTOR = 3.1415927 * 0.0055555557;
-
-CStarArray::CStarArray() {
-}
-
-void CStarArray::initialize() {
-	// Get a reference to the starfield points resource
-	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource("STARFIELD/POINTS");
-	assert(stream && stream->size() == (12 * ARRAY_COUNT));
-
-	_data.resize(ARRAY_COUNT);
-	for (int idx = 0; idx < ARRAY_COUNT; ++idx) {
-		CStarArrayEntry &entry = _data[idx];
-
-		// Get the next set of values
-		double v1 = stream->readUint32LE();
-		double v2 = stream->readUint32LE();
-		stream->readUint32LE();
-
-		v1 *= 0.0099999998 * FACTOR;
-		v2 *= 0.015 * FACTOR;
-
-		entry._v1 = cos(v2) * 3000000.0 * cos(v1);
-		entry._v2 = sin(v2) * 3000000.0 * cos(v1);
-		entry._v3 = sin(v1) * 3000000.0;
-	}
-}
-
-void CStarArray::draw(CSurfaceArea *surface, CStarControlSub12 *img) {
-	// TODO
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_array.h b/engines/titanic/star_control/star_array.h
deleted file mode 100644
index 827af01..0000000
--- a/engines/titanic/star_control/star_array.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_ARRAY_H
-#define TITANIC_STAR_ARRAY_H
-
-#include "common/array.h"
-#include "titanic/star_control/surface_area.h"
-
-namespace Titanic {
-
-class CStarControlSub12;
-
-class CStarArray {
-	struct CStarArrayEntry {
-		double _v1;
-		double _v2;
-		double _v3;
-	};
-private:
-	Common::Array<CStarArrayEntry> _data;
-public:
-	CStarArray();
-
-	/**
-	 * Initialize the array
-	 */
-	void initialize();
-
-	/**
-	 * Draw the starfield points
-	 */
-	void draw(CSurfaceArea *surface, CStarControlSub12 *img);
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_ARRAY_H */
diff --git a/engines/titanic/star_control/star_control_sub1.cpp b/engines/titanic/star_control/star_control_sub1.cpp
index 75dc230..c3a268e 100644
--- a/engines/titanic/star_control/star_control_sub1.cpp
+++ b/engines/titanic/star_control/star_control_sub1.cpp
@@ -43,8 +43,8 @@ void CStarControlSub1::load(SimpleFile *file, int param) {
 
 bool CStarControlSub1::initDocument() {
 	warning("CStarControlSub1::initDocument");
-	_starArray.initialize();
-	_sub9.initialize();
+	_points1.initialize();
+	_points2.initialize();
 	return true;
 }
 
diff --git a/engines/titanic/star_control/star_control_sub1.h b/engines/titanic/star_control/star_control_sub1.h
index 0e99b4e..dd7ae5f 100644
--- a/engines/titanic/star_control/star_control_sub1.h
+++ b/engines/titanic/star_control/star_control_sub1.h
@@ -23,12 +23,12 @@
 #ifndef TITANIC_STAR_CONTROL_SUB1_H
 #define TITANIC_STAR_CONTROL_SUB1_H
 
-#include "titanic/star_control/star_array.h"
 #include "titanic/star_control/star_control_sub2.h"
 #include "titanic/star_control/star_control_sub5.h"
 #include "titanic/star_control/star_control_sub7.h"
 #include "titanic/star_control/star_control_sub8.h"
-#include "titanic/star_control/star_control_sub9.h"
+#include "titanic/star_control/star_points1.h"
+#include "titanic/star_control/star_points2.h"
 
 namespace Titanic {
 
@@ -36,8 +36,8 @@ class CStarControlSub1 : public CStarControlSub2 {
 private:
 	CStarControlSub7 _sub7;
 	CStarControlSub8 _sub8;
-	CStarControlSub9 _sub9;
-	CStarArray _starArray;
+	CStarPoints1 _points1;
+	CStarPoints2 _points2;
 	CStarControlSub5 _sub5;
 	int _field7DA8;
 	int _field7DAC;
diff --git a/engines/titanic/star_control/star_control_sub9.cpp b/engines/titanic/star_control/star_control_sub9.cpp
deleted file mode 100644
index 292e9a8..0000000
--- a/engines/titanic/star_control/star_control_sub9.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/star_control/star_control_sub9.h"
-#include "titanic/titanic.h"
-
-namespace Titanic {
-
-#define ARRAY_COUNT 80
-const double FACTOR = 3.1415927 * 0.0055555557;
-
-void CStarControlSub9::initialize() {
-	// Get a reference to the starfield points resource
-	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource("STARFIELD/POINTS2");
-
-	_data.resize(ARRAY_COUNT);
-	for (int rootCtr = 0; rootCtr < ARRAY_COUNT; ++rootCtr) {
-		// Get the number of sub-entries for this entry
-		int count = stream->readUint32LE();
-		double v1, v2;
-
-		// Read in the sub-entries
-		RootEntry &rootEntry = _data[rootCtr];
-		rootEntry.resize(count * 2);
-		for (int idx = 0; idx < count * 2; ++idx) {
-			DataEntry &entry = rootEntry[idx];
-			v1 = stream->readSint32LE();
-			v2 = stream->readSint32LE();
-			v1 *= 0.015 * FACTOR;
-			v2 *= 0.0099999998 * FACTOR;
-			entry._v1 = cos(v1) * 3000000.0 * cos(v2);
-			entry._v2 = sin(v1) * 3000000.0 * cos(v2);
-			entry._v3 = sin(v2) * 3000000.0;
-		}
-	}
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub9.h b/engines/titanic/star_control/star_control_sub9.h
deleted file mode 100644
index 5f334f4..0000000
--- a/engines/titanic/star_control/star_control_sub9.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_CONTROL_SUB9_H
-#define TITANIC_STAR_CONTROL_SUB9_H
-
-#include "common/array.h"
-
-namespace Titanic {
-
-class CStarControlSub9 {
-	struct DataEntry {
-		int _v1;
-		int _v2;
-		int _v3;
-	};
-
-	class RootEntry : public Common::Array<DataEntry> {
-	public:
-		int _field0;
-		RootEntry() : _field0(0) {}
-	};
-private:
-	Common::Array<RootEntry> _data;
-public:
-	/**
-	 * Initializes the data
-	 */
-	void initialize();
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_SUB9_H */
diff --git a/engines/titanic/star_control/star_points1.cpp b/engines/titanic/star_control/star_points1.cpp
new file mode 100644
index 0000000..9e684f3
--- /dev/null
+++ b/engines/titanic/star_control/star_points1.cpp
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_points1.h"
+#include "titanic/star_control/star_control_sub12.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+#define ARRAY_COUNT 876
+const double FACTOR = 3.1415927 * 0.0055555557;
+
+CStarPoints1::CStarPoints1() {
+}
+
+void CStarPoints1::initialize() {
+	// Get a reference to the starfield points resource
+	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource("STARFIELD/POINTS");
+	assert(stream && stream->size() == (12 * ARRAY_COUNT));
+
+	_data.resize(ARRAY_COUNT);
+	for (int idx = 0; idx < ARRAY_COUNT; ++idx) {
+		FVector &entry = _data[idx];
+
+		// Get the next set of values
+		double v1 = stream->readUint32LE();
+		double v2 = stream->readUint32LE();
+		stream->readUint32LE();
+
+		v1 *= 0.0099999998 * FACTOR;
+		v2 *= 0.015 * FACTOR;
+
+		entry._x = cos(v2) * 3000000.0 * cos(v1);
+		entry._y = sin(v2) * 3000000.0 * cos(v1);
+		entry._z = sin(v1) * 3000000.0;
+	}
+}
+
+void CStarPoints1::draw(CSurfaceArea *surface, CStarControlSub12 *img) {
+	// TODO
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_points1.h b/engines/titanic/star_control/star_points1.h
new file mode 100644
index 0000000..41fb6b4
--- /dev/null
+++ b/engines/titanic/star_control/star_points1.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_POINTS1_H
+#define TITANIC_STAR_POINTS1_H
+
+#include "common/array.h"
+#include "titanic/star_control/surface_area.h"
+#include "titanic/star_control/fvector.h"
+
+namespace Titanic {
+
+class CStarControlSub12;
+
+class CStarPoints1 {
+private:
+	Common::Array<FVector> _data;
+public:
+	CStarPoints1();
+
+	/**
+	 * Initialize the array
+	 */
+	void initialize();
+
+	/**
+	 * Draw the starfield points
+	 */
+	void draw(CSurfaceArea *surface, CStarControlSub12 *img);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_POINTS1_H */
diff --git a/engines/titanic/star_control/star_points2.cpp b/engines/titanic/star_control/star_points2.cpp
new file mode 100644
index 0000000..10d10e1
--- /dev/null
+++ b/engines/titanic/star_control/star_points2.cpp
@@ -0,0 +1,57 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_points2.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+#define ARRAY_COUNT 80
+const double FACTOR = 3.1415927 * 0.0055555557;
+
+void CStarPoints2::initialize() {
+	// Get a reference to the starfield points resource
+	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource("STARFIELD/POINTS2");
+
+	_data.resize(ARRAY_COUNT);
+	for (int rootCtr = 0; rootCtr < ARRAY_COUNT; ++rootCtr) {
+		// Get the number of sub-entries for this entry
+		int count = stream->readUint32LE();
+		double v1, v2;
+
+		// Read in the sub-entries
+		RootEntry &rootEntry = _data[rootCtr];
+		rootEntry.resize(count * 2);
+		for (int idx = 0; idx < count * 2; ++idx) {
+			DataEntry &entry = rootEntry[idx];
+			v1 = stream->readSint32LE();
+			v2 = stream->readSint32LE();
+			v1 *= 0.015 * FACTOR;
+			v2 *= 0.0099999998 * FACTOR;
+			entry._v1 = cos(v1) * 3000000.0 * cos(v2);
+			entry._v2 = sin(v1) * 3000000.0 * cos(v2);
+			entry._v3 = sin(v2) * 3000000.0;
+		}
+	}
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_points2.h b/engines/titanic/star_control/star_points2.h
new file mode 100644
index 0000000..0ba5e0a
--- /dev/null
+++ b/engines/titanic/star_control/star_points2.h
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_POINTS2_H
+#define TITANIC_STAR_POINTS2_H
+
+#include "common/array.h"
+
+namespace Titanic {
+
+class CStarPoints2 {
+	struct DataEntry {
+		int _v1;
+		int _v2;
+		int _v3;
+	};
+
+	class RootEntry : public Common::Array<DataEntry> {
+	public:
+		int _field0;
+		RootEntry() : _field0(0) {}
+	};
+private:
+	Common::Array<RootEntry> _data;
+public:
+	/**
+	 * Initializes the data
+	 */
+	void initialize();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_POINTS2_H */


Commit: c4e3cd87abbddef07436c83736cd3acebd0798aa
    https://github.com/scummvm/scummvm/commit/c4e3cd87abbddef07436c83736cd3acebd0798aa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:10:01-04:00

Commit Message:
TITANIC: Finished startfield initDocument

Changed paths:
    engines/titanic/pet_control/pet_starfield.cpp
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control.h
    engines/titanic/star_control/star_control_sub1.cpp
    engines/titanic/star_control/star_control_sub1.h
    engines/titanic/star_control/star_control_sub2.cpp
    engines/titanic/star_control/star_control_sub2.h
    engines/titanic/star_control/star_control_sub5.cpp
    engines/titanic/star_control/star_control_sub5.h
    engines/titanic/star_control/star_points1.cpp
    engines/titanic/star_control/star_points1.h
    engines/titanic/star_control/star_points2.cpp
    engines/titanic/star_control/star_points2.h
    engines/titanic/star_control/star_view.cpp
    engines/titanic/star_control/star_view.h



diff --git a/engines/titanic/pet_control/pet_starfield.cpp b/engines/titanic/pet_control/pet_starfield.cpp
index 35ef943..34d696e 100644
--- a/engines/titanic/pet_control/pet_starfield.cpp
+++ b/engines/titanic/pet_control/pet_starfield.cpp
@@ -107,10 +107,10 @@ bool CPetStarfield::MouseButtonUpMsg(CMouseButtonUpMsg *msg) {
 	if (_petControl) {
 		CStarControl *starControl = _petControl->getStarControl();
 		
-		if (starControl) {
+		if (starControl && starControl->canSetStarDestination()) {
 			CPETSetStarDestinationMsg starfieldMsg;
 			starfieldMsg.execute(_petControl->_remoteTarget);
-			starControl->fn3();
+			starControl->starDestinationSet();
 		}
 	}
 
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index e048d11..e852432 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -126,17 +126,20 @@ void CStarControl::newFrame() {
 	// TODO
 }
 
+void CStarControl::fn1(int action) {
+	// TODO
+}
 
-void CStarControl::fn3() {
-	warning("CStarControl::fn3");
+bool CStarControl::fn4() {
+	return _sub1.get7();
 }
 
-void CStarControl::fn1(int v) {
-	warning("CStarControl::fn1");
+bool CStarControl::canSetStarDestination() const {
+	return _view.canSetStarDestination();
 }
 
-void CStarControl::fn4() {
-	warning("CStarControl::fn4");
+void CStarControl::starDestinationSet() {
+	_view.starDestinationSet();
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index c771373..43cfdc4 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -66,9 +66,18 @@ public:
 	 */
 	virtual void draw(CScreenManager *screenManager);
 
-	void fn1(int v);
-	void fn3();
-	void fn4();
+	void fn1(int action);
+	bool fn4();
+
+	/**
+	 * Returns true if a star destination can be set
+	 */
+	bool canSetStarDestination() const;
+
+	/**
+	 * Called when a star destination is set
+	 */
+	void starDestinationSet();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub1.cpp b/engines/titanic/star_control/star_control_sub1.cpp
index c3a268e..35bce35 100644
--- a/engines/titanic/star_control/star_control_sub1.cpp
+++ b/engines/titanic/star_control/star_control_sub1.cpp
@@ -24,28 +24,42 @@
 
 namespace Titanic {
 
-CStarControlSub1::CStarControlSub1() :
-	_field7DA8(0), _field7DAC(0), _field7DB0(0),
-	_field7DB4(1), _field7DB8(0), _field7DBC(0) {
+CStarControlSub1::CStarControlSub1() : _val1(0), _val2(0), _val3(0), _val4(1),
+	_val5(0), _val6(false) {
 }
 
 void CStarControlSub1::load(SimpleFile *file, int param) {
 	if (!param) {
 		_sub7.load(file);
 		_sub8.load(file);
-		_field7DA8 = file->readNumber();
-		_field7DAC = file->readNumber();
-		_field7DB0 = file->readNumber();
-		_field7DB4 = file->readNumber();
-		_field7DBC = file->readNumber();
+		_val1 = file->readNumber();
+		_val2 = file->readNumber();
+		_val3 = file->readNumber();
+		_val4 = file->readNumber();
+		_val6 = file->readNumber();
 	}
 }
 
+void CStarControlSub1::save(SimpleFile *file, int indent) {
+	_sub7.save(file, indent);
+	_sub8.save(file, indent);
+	file->writeNumberLine(_val1, indent);
+	file->writeNumberLine(_val2, indent);
+	file->writeNumberLine(_val3, indent);
+	file->writeNumberLine(_val4, indent);
+	file->writeNumberLine(_val6, indent);
+}
+
 bool CStarControlSub1::initDocument() {
-	warning("CStarControlSub1::initDocument");
-	_points1.initialize();
-	_points2.initialize();
-	return true;
+	bool valid = setup() && _points1.initialize();
+	if (valid)
+		valid = _sub5.setup();
+	if (valid)
+		valid = _points1.initialize();
+	if (valid)
+		valid = _points2.initialize();
+
+	return valid;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub1.h b/engines/titanic/star_control/star_control_sub1.h
index dd7ae5f..8aab0b6 100644
--- a/engines/titanic/star_control/star_control_sub1.h
+++ b/engines/titanic/star_control/star_control_sub1.h
@@ -39,12 +39,13 @@ private:
 	CStarPoints1 _points1;
 	CStarPoints2 _points2;
 	CStarControlSub5 _sub5;
-	int _field7DA8;
-	int _field7DAC;
-	int _field7DB0;
-	int _field7DB4;
-	int _field7DB8;
-	int _field7DBC;
+	int _val1;
+	int _val2;
+	int _val3;
+	int _val4;
+	int _val5;
+	int _val6;
+	bool _val7;
 public:
 	CStarControlSub1();
 
@@ -53,7 +54,15 @@ public:
 	 */
 	void load(SimpleFile *file, int param);
 
+	/**
+	 * Save the data for the class to file
+	 */
+	void save(SimpleFile *file, int indent);
+
 	bool initDocument();
+
+	int get6() const { return _val6; }
+	bool get7() const { return _val7; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub2.cpp b/engines/titanic/star_control/star_control_sub2.cpp
index eeebaa1..fcbb70c 100644
--- a/engines/titanic/star_control/star_control_sub2.cpp
+++ b/engines/titanic/star_control/star_control_sub2.cpp
@@ -45,4 +45,9 @@ bool CStarControlSub2::proc7(int v1, int v2) {
 	return true;
 }
 
+bool CStarControlSub2::setup() {
+	// TODO
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub2.h b/engines/titanic/star_control/star_control_sub2.h
index bfbe02c..cd77815 100644
--- a/engines/titanic/star_control/star_control_sub2.h
+++ b/engines/titanic/star_control/star_control_sub2.h
@@ -35,6 +35,11 @@ public:
 	virtual bool proc4(int v1, int v2, int v3, int v4, int v5);
 	virtual bool loadStar();
 	virtual bool proc7(int v1, int v2);
+
+	/**
+	 * Setup the control
+	 */
+	bool setup();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub5.cpp b/engines/titanic/star_control/star_control_sub5.cpp
index 64e48e1..e289922 100644
--- a/engines/titanic/star_control/star_control_sub5.cpp
+++ b/engines/titanic/star_control/star_control_sub5.cpp
@@ -28,4 +28,17 @@ CStarControlSub5::CStarControlSub5() :
 	_field4(1), _field78AC(0), _field78B0(0) {
 }
 
+bool CStarControlSub5::setup() {
+	// TODO
+	return true;
+}
+
+void CStarControlSub5::proc2() {
+	// TODO
+}
+
+void CStarControlSub5::proc3(CErrorCode *errorCode) {
+	// TODO
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub5.h b/engines/titanic/star_control/star_control_sub5.h
index c3621e9..e245b29 100644
--- a/engines/titanic/star_control/star_control_sub5.h
+++ b/engines/titanic/star_control/star_control_sub5.h
@@ -24,6 +24,7 @@
 #define TITANIC_STAR_CONTROL_SUB5_H
 
 #include "titanic/star_control/star_control_sub6.h"
+#include "titanic/star_control/error_code.h"
 
 namespace Titanic {
 
@@ -43,6 +44,10 @@ private:
 	int _field78B0;
 public:
 	CStarControlSub5();
+
+	virtual bool setup();
+	virtual void proc2();
+	virtual void proc3(CErrorCode *errorCode);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_points1.cpp b/engines/titanic/star_control/star_points1.cpp
index 9e684f3..6e698d6 100644
--- a/engines/titanic/star_control/star_points1.cpp
+++ b/engines/titanic/star_control/star_points1.cpp
@@ -32,7 +32,7 @@ const double FACTOR = 3.1415927 * 0.0055555557;
 CStarPoints1::CStarPoints1() {
 }
 
-void CStarPoints1::initialize() {
+bool CStarPoints1::initialize() {
 	// Get a reference to the starfield points resource
 	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource("STARFIELD/POINTS");
 	assert(stream && stream->size() == (12 * ARRAY_COUNT));
@@ -53,9 +53,16 @@ void CStarPoints1::initialize() {
 		entry._y = sin(v2) * 3000000.0 * cos(v1);
 		entry._z = sin(v1) * 3000000.0;
 	}
+
+	return true;
 }
 
 void CStarPoints1::draw(CSurfaceArea *surface, CStarControlSub12 *img) {
+	if (_data.empty())
+		return;
+
+
+
 	// TODO
 }
 
diff --git a/engines/titanic/star_control/star_points1.h b/engines/titanic/star_control/star_points1.h
index 41fb6b4..a6e4ee2 100644
--- a/engines/titanic/star_control/star_points1.h
+++ b/engines/titanic/star_control/star_points1.h
@@ -40,7 +40,7 @@ public:
 	/**
 	 * Initialize the array
 	 */
-	void initialize();
+	bool initialize();
 
 	/**
 	 * Draw the starfield points
diff --git a/engines/titanic/star_control/star_points2.cpp b/engines/titanic/star_control/star_points2.cpp
index 10d10e1..4fea298 100644
--- a/engines/titanic/star_control/star_points2.cpp
+++ b/engines/titanic/star_control/star_points2.cpp
@@ -28,7 +28,7 @@ namespace Titanic {
 #define ARRAY_COUNT 80
 const double FACTOR = 3.1415927 * 0.0055555557;
 
-void CStarPoints2::initialize() {
+bool CStarPoints2::initialize() {
 	// Get a reference to the starfield points resource
 	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource("STARFIELD/POINTS2");
 
@@ -52,6 +52,8 @@ void CStarPoints2::initialize() {
 			entry._v3 = sin(v2) * 3000000.0;
 		}
 	}
+
+	return true;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_points2.h b/engines/titanic/star_control/star_points2.h
index 0ba5e0a..31bded4 100644
--- a/engines/titanic/star_control/star_points2.h
+++ b/engines/titanic/star_control/star_points2.h
@@ -45,7 +45,7 @@ public:
 	/**
 	 * Initializes the data
 	 */
-	void initialize();
+	bool initialize();
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index 35920a3..5bfef41 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -106,4 +106,13 @@ CErrorCode CStarView::KeyCharMsg(int key) {
 	return CErrorCode();
 }
 
+bool CStarView::canSetStarDestination() const {
+	// TODO
+	return false;
+}
+
+void CStarView::starDestinationSet() {
+	// TODO
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_view.h b/engines/titanic/star_control/star_view.h
index 7ec86b5..cc40fb4 100644
--- a/engines/titanic/star_control/star_view.h
+++ b/engines/titanic/star_control/star_view.h
@@ -88,6 +88,16 @@ public:
 	 * Handles keyboard messages
 	 */
 	CErrorCode KeyCharMsg(int key);
+
+	/**
+	 * Returns true if a star destination can be set
+	 */
+	bool canSetStarDestination() const;
+
+	/**
+	 * Called when a star destination is set
+	 */
+	void starDestinationSet();
 };
 
 } // End of namespace Titanic


Commit: 29c87fe375947a6683d81be7f4b24f7c04960fac
    https://github.com/scummvm/scummvm/commit/29c87fe375947a6683d81be7f4b24f7c04960fac
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:10:04-04:00

Commit Message:
TITANIC: Renamed CStarControlSub12 to CStarField

Changed paths:
  A engines/titanic/star_control/star_field.cpp
  A engines/titanic/star_control/star_field.h
  R engines/titanic/star_control/star_control_sub1.cpp
  R engines/titanic/star_control/star_control_sub1.h
    engines/titanic/module.mk
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control.h
    engines/titanic/star_control/star_view.cpp
    engines/titanic/star_control/star_view.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 96715f2..33e3558 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -423,7 +423,6 @@ MODULE_OBJS := \
 	star_control/fmatrix.o \
 	star_control/fpoint.o \
 	star_control/fvector.o \
-	star_control/star_control_sub1.o \
 	star_control/star_control_sub2.o \
 	star_control/star_control_sub4.o \
 	star_control/star_control_sub5.o \
@@ -439,6 +438,7 @@ MODULE_OBJS := \
 	star_control/star_control_sub24.o \
 	star_control/star_control_sub25.o \
 	star_control/star_control_sub26.o \
+	star_control/star_field.o \
 	star_control/star_points1.o \
 	star_control/star_points2.o \
 	star_control/star_view.o \
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index e852432..e1e804f 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -48,7 +48,7 @@ CStarControl::~CStarControl() {
 
 void CStarControl::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
-	_sub1.save(file, indent);
+	_starField.save(file, indent);
 	_view.save(file, indent);
 	CGameObject::save(file, indent);
 }
@@ -57,8 +57,8 @@ void CStarControl::load(SimpleFile *file) {
 	int val = file->readNumber();
 	
 	if (!val) {
-		_sub1.load(file, 0);
-		if (!_sub1.initDocument())
+		_starField.load(file, 0);
+		if (!_starField.initDocument())
 			error("Couldn't initialise the StarField document");
 
 		_view.load(file, 0);
@@ -66,7 +66,7 @@ void CStarControl::load(SimpleFile *file) {
 		if (!screenManager)
 			error("There's no screen  manager during loading");
 
-		_view.setup(screenManager, &_sub1, this);
+		_view.setup(screenManager, &_starField, this);
 		_view.reset();
 
 		_fieldBC = 1;
@@ -131,7 +131,7 @@ void CStarControl::fn1(int action) {
 }
 
 bool CStarControl::fn4() {
-	return _sub1.get7();
+	return _starField.get7();
 }
 
 bool CStarControl::canSetStarDestination() const {
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index 43cfdc4..2f6a86a 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -24,7 +24,7 @@
 #define TITANIC_STAR_CONTROL_H
 
 #include "titanic/core/game_object.h"
-#include "titanic/star_control/star_control_sub1.h"
+#include "titanic/star_control/star_field.h"
 #include "titanic/star_control/star_view.h"
 
 namespace Titanic {
@@ -37,7 +37,7 @@ class CStarControl : public CGameObject {
 	bool FrameMsg(CFrameMsg *msg);
 private:
 	int _fieldBC;
-	CStarControlSub1 _sub1;
+	CStarField _starField;
 	CStarView _view;
 	Rect _starRect;
 	int _field80B0;
diff --git a/engines/titanic/star_control/star_control_sub1.cpp b/engines/titanic/star_control/star_control_sub1.cpp
deleted file mode 100644
index 35bce35..0000000
--- a/engines/titanic/star_control/star_control_sub1.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "titanic/star_control/star_control_sub1.h"
-
-namespace Titanic {
-
-CStarControlSub1::CStarControlSub1() : _val1(0), _val2(0), _val3(0), _val4(1),
-	_val5(0), _val6(false) {
-}
-
-void CStarControlSub1::load(SimpleFile *file, int param) {
-	if (!param) {
-		_sub7.load(file);
-		_sub8.load(file);
-		_val1 = file->readNumber();
-		_val2 = file->readNumber();
-		_val3 = file->readNumber();
-		_val4 = file->readNumber();
-		_val6 = file->readNumber();
-	}
-}
-
-void CStarControlSub1::save(SimpleFile *file, int indent) {
-	_sub7.save(file, indent);
-	_sub8.save(file, indent);
-	file->writeNumberLine(_val1, indent);
-	file->writeNumberLine(_val2, indent);
-	file->writeNumberLine(_val3, indent);
-	file->writeNumberLine(_val4, indent);
-	file->writeNumberLine(_val6, indent);
-}
-
-bool CStarControlSub1::initDocument() {
-	bool valid = setup() && _points1.initialize();
-	if (valid)
-		valid = _sub5.setup();
-	if (valid)
-		valid = _points1.initialize();
-	if (valid)
-		valid = _points2.initialize();
-
-	return valid;
-}
-
-} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub1.h b/engines/titanic/star_control/star_control_sub1.h
deleted file mode 100644
index 8aab0b6..0000000
--- a/engines/titanic/star_control/star_control_sub1.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef TITANIC_STAR_CONTROL_SUB1_H
-#define TITANIC_STAR_CONTROL_SUB1_H
-
-#include "titanic/star_control/star_control_sub2.h"
-#include "titanic/star_control/star_control_sub5.h"
-#include "titanic/star_control/star_control_sub7.h"
-#include "titanic/star_control/star_control_sub8.h"
-#include "titanic/star_control/star_points1.h"
-#include "titanic/star_control/star_points2.h"
-
-namespace Titanic {
-
-class CStarControlSub1 : public CStarControlSub2 {
-private:
-	CStarControlSub7 _sub7;
-	CStarControlSub8 _sub8;
-	CStarPoints1 _points1;
-	CStarPoints2 _points2;
-	CStarControlSub5 _sub5;
-	int _val1;
-	int _val2;
-	int _val3;
-	int _val4;
-	int _val5;
-	int _val6;
-	bool _val7;
-public:
-	CStarControlSub1();
-
-	/**
-	 * Load the data for the class from file
-	 */
-	void load(SimpleFile *file, int param);
-
-	/**
-	 * Save the data for the class to file
-	 */
-	void save(SimpleFile *file, int indent);
-
-	bool initDocument();
-
-	int get6() const { return _val6; }
-	bool get7() const { return _val7; }
-};
-
-} // End of namespace Titanic
-
-#endif /* TITANIC_STAR_CONTROL_SUB1_H */
diff --git a/engines/titanic/star_control/star_field.cpp b/engines/titanic/star_control/star_field.cpp
new file mode 100644
index 0000000..1d667c0
--- /dev/null
+++ b/engines/titanic/star_control/star_field.cpp
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_field.h"
+
+namespace Titanic {
+
+CStarField::CStarField() : _val1(0), _val2(0), _val3(0), _val4(1),
+	_val5(0), _val6(false) {
+}
+
+void CStarField::load(SimpleFile *file, int param) {
+	if (!param) {
+		_sub7.load(file);
+		_sub8.load(file);
+		_val1 = file->readNumber();
+		_val2 = file->readNumber();
+		_val3 = file->readNumber();
+		_val4 = file->readNumber();
+		_val6 = file->readNumber();
+	}
+}
+
+void CStarField::save(SimpleFile *file, int indent) {
+	_sub7.save(file, indent);
+	_sub8.save(file, indent);
+	file->writeNumberLine(_val1, indent);
+	file->writeNumberLine(_val2, indent);
+	file->writeNumberLine(_val3, indent);
+	file->writeNumberLine(_val4, indent);
+	file->writeNumberLine(_val6, indent);
+}
+
+bool CStarField::initDocument() {
+	bool valid = setup() && _points1.initialize();
+	if (valid)
+		valid = _sub5.setup();
+	if (valid)
+		valid = _points1.initialize();
+	if (valid)
+		valid = _points2.initialize();
+
+	return valid;
+}
+
+void CStarField::draw(CVideoSurface *surface, CStarControlSub12 *sub12) {
+	// TODO
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_field.h b/engines/titanic/star_control/star_field.h
new file mode 100644
index 0000000..48c2721
--- /dev/null
+++ b/engines/titanic/star_control/star_field.h
@@ -0,0 +1,75 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_FIELD_H
+#define TITANIC_STAR_FIELD_H
+
+#include "titanic/star_control/star_control_sub2.h"
+#include "titanic/star_control/star_control_sub5.h"
+#include "titanic/star_control/star_control_sub7.h"
+#include "titanic/star_control/star_control_sub8.h"
+#include "titanic/star_control/star_points1.h"
+#include "titanic/star_control/star_points2.h"
+
+namespace Titanic {
+
+class CStarField : public CStarControlSub2 {
+private:
+	CStarControlSub7 _sub7;
+	CStarControlSub8 _sub8;
+	CStarPoints1 _points1;
+	CStarPoints2 _points2;
+	CStarControlSub5 _sub5;
+	int _val1;
+	int _val2;
+	int _val3;
+	int _val4;
+	int _val5;
+	int _val6;
+	bool _val7;
+public:
+	CStarField();
+
+	/**
+	 * Load the data for the class from file
+	 */
+	void load(SimpleFile *file, int param);
+
+	/**
+	 * Save the data for the class to file
+	 */
+	void save(SimpleFile *file, int indent);
+
+	bool initDocument();
+
+	/**
+	 * Renders the contents of the starfield
+	 */
+	void draw(CVideoSurface *surface, CStarControlSub12 *sub12);
+
+	int get6() const { return _val6; }
+	bool get7() const { return _val7; }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_FIELD_H */
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index 5bfef41..63bbed1 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -23,12 +23,13 @@
 #include "titanic/support/screen_manager.h"
 #include "titanic/star_control/star_view.h"
 #include "titanic/star_control/star_control.h"
+#include "titanic/star_control/star_field.h"
 #include "titanic/core/game_object.h"
 
 namespace Titanic {
 
 CStarView::CStarView() : _sub12(nullptr, nullptr), _sub13(nullptr),
-		_owner(nullptr), _sub1(nullptr), _videoSurface(nullptr), _field118(0), 
+		_owner(nullptr), _starField(nullptr), _videoSurface(nullptr), _field118(0), 
 		_videoSurface2(nullptr), _field210(0), _homePhotoMask(nullptr),
 		_field218(0), _field21C(0) {
 	_sub12.proc3();
@@ -58,8 +59,8 @@ void CStarView::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(_field21C, indent);
 }
 
-void CStarView::setup(CScreenManager *screenManager, CStarControlSub1 *sub1, CStarControl *starControl) {
-	_sub1 = sub1;
+void CStarView::setup(CScreenManager *screenManager, CStarField *starField, CStarControl *starControl) {
+	_starField = starField;
 	_owner = starControl;
 }
 
@@ -68,7 +69,7 @@ void CStarView::reset() {
 }
 
 void CStarView::draw(CScreenManager *screenManager) {
-	if (!screenManager || !_videoSurface || !_sub1)
+	if (!screenManager || !_videoSurface || !_starField)
 		return;
 
 	if (_fader.isActive()) {
@@ -88,7 +89,16 @@ void CStarView::draw(CScreenManager *screenManager) {
 			if (_homePhotoMask)
 				_homePhotoMask->draw(screenManager, Point(20, 187));
 		} else {
-			// TODO
+			fn1();
+
+			// Render the display
+			_videoSurface->clear();
+			_videoSurface->lock();
+			_starField->draw(_videoSurface, &_sub12);
+			_videoSurface->unlock();
+
+			// Blit the resulting surface to the screen
+			screenManager->blitFrom(SURFACE_PRIMARY, _videoSurface, &destPos);
 		}
 	}
 }
@@ -115,4 +125,8 @@ void CStarView::starDestinationSet() {
 	// TODO
 }
 
+void CStarView::fn1() {
+	// TODO
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_view.h b/engines/titanic/star_control/star_view.h
index cc40fb4..bcba5ac 100644
--- a/engines/titanic/star_control/star_view.h
+++ b/engines/titanic/star_control/star_view.h
@@ -33,12 +33,12 @@
 namespace Titanic {
 
 class CStarControl;
-class CStarControlSub1;
+class CStarField;
 
 class CStarView {
 private:
 	CStarControl *_owner;
-	CStarControlSub1 *_sub1;
+	CStarField *_starField;
 	CVideoSurface *_videoSurface;
 	CStarControlSub12 _sub12;
 	int _field118;
@@ -49,6 +49,8 @@ private:
 	CGameObject *_homePhotoMask;
 	int _field218;
 	int _field21C;
+private:
+	void fn1();
 public:
 	CStarView();
 
@@ -65,7 +67,7 @@ public:
 	/**
 	 * Sets references used by the view
 	 */
-	void setup(CScreenManager *screenManager, CStarControlSub1 *sub1, CStarControl *starControl);
+	void setup(CScreenManager *screenManager, CStarField *starField, CStarControl *starControl);
 
 	void reset();
 


Commit: 789760295df25b209e312a1d48c0ca6be74c2c81
    https://github.com/scummvm/scummvm/commit/789760295df25b209e312a1d48c0ca6be74c2c81
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:10:07-04:00

Commit Message:
VIDEO: Add titanic to list of engines using AVIDecoder

Changed paths:
    video/avi_decoder.h



diff --git a/video/avi_decoder.h b/video/avi_decoder.h
index 8b9fcbd..a3733b5 100644
--- a/video/avi_decoder.h
+++ b/video/avi_decoder.h
@@ -57,6 +57,7 @@ namespace Video {
  *  - sci
  *  - sword1
  *  - sword2
+ *  - titanic
  *  - zvision
  */
 class AVIDecoder : public VideoDecoder {


Commit: 816b99f5a657181ea84e0f42d2713406a9f041d2
    https://github.com/scummvm/scummvm/commit/816b99f5a657181ea84e0f42d2713406a9f041d2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T13:26:22-04:00

Commit Message:
TITANIC: Added CStarField support methods

Changed paths:
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control_sub5.h
    engines/titanic/star_control/star_control_sub8.h
    engines/titanic/star_control/star_field.cpp
    engines/titanic/star_control/star_field.h



diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index e1e804f..3e0ff16 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -131,7 +131,7 @@ void CStarControl::fn1(int action) {
 }
 
 bool CStarControl::fn4() {
-	return _starField.get7();
+	return _starField.get6();
 }
 
 bool CStarControl::canSetStarDestination() const {
diff --git a/engines/titanic/star_control/star_control_sub5.h b/engines/titanic/star_control/star_control_sub5.h
index e245b29..8007f83 100644
--- a/engines/titanic/star_control/star_control_sub5.h
+++ b/engines/titanic/star_control/star_control_sub5.h
@@ -48,6 +48,9 @@ public:
 	virtual bool setup();
 	virtual void proc2();
 	virtual void proc3(CErrorCode *errorCode);
+
+	int get4() const { return _field4; }
+	void set4(int val) { _field4 = val; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub8.h b/engines/titanic/star_control/star_control_sub8.h
index 39d9fef..6d8d1f0 100644
--- a/engines/titanic/star_control/star_control_sub8.h
+++ b/engines/titanic/star_control/star_control_sub8.h
@@ -37,10 +37,11 @@ class CStarControlSub8 {
 private:
 	int _field0;
 	int _field4;
-	int _field8;
 	int _fieldC;
 	StructEntry _array[3];
 public:
+	int _field8;
+public:
 	CStarControlSub8();
 
 	/**
diff --git a/engines/titanic/star_control/star_field.cpp b/engines/titanic/star_control/star_field.cpp
index 1d667c0..2c94ebb 100644
--- a/engines/titanic/star_control/star_field.cpp
+++ b/engines/titanic/star_control/star_field.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-CStarField::CStarField() : _val1(0), _val2(0), _val3(0), _val4(1),
+CStarField::CStarField() : _val1(0), _val2(0), _val3(0), _val4(true),
 	_val5(0), _val6(false) {
 }
 
@@ -66,4 +66,62 @@ void CStarField::draw(CVideoSurface *surface, CStarControlSub12 *sub12) {
 	// TODO
 }
 
+int CStarField::get1() const { 
+	return _val1;
+}
+
+void CStarField::set1(int val) {
+	_val1 = val;
+}
+
+int CStarField::get2() const {
+	return _val2;
+}
+
+void CStarField::set2(int val) {
+	_val2 = val;
+}
+
+int CStarField::get54() const {
+	return _sub5.get4();
+}
+
+void CStarField::set54(int val) {
+	_sub5.set4(val);
+}
+
+int CStarField::get3() const {
+	return _val3;
+}
+
+void CStarField::set3(int val) {
+	_val3 = val;
+}
+
+void CStarField::toggle4() {
+	_val4 = !_val4; 
+}
+
+bool CStarField::set4(bool val) {
+	bool oldVal = _val4;
+	_val4 = val;
+	return val;
+}
+
+int CStarField::get88() const {
+	return _sub8._field8;
+}
+
+int CStarField::get5() const {
+	return _val5;
+}
+
+void CStarField::update6() {
+	_val6 = _sub8._field8 == 2;
+}
+
+int CStarField::get6() const {
+	return _val6;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_field.h b/engines/titanic/star_control/star_field.h
index 48c2721..d02749b 100644
--- a/engines/titanic/star_control/star_field.h
+++ b/engines/titanic/star_control/star_field.h
@@ -42,10 +42,9 @@ private:
 	int _val1;
 	int _val2;
 	int _val3;
-	int _val4;
+	bool _val4;
 	int _val5;
-	int _val6;
-	bool _val7;
+	bool _val6;
 public:
 	CStarField();
 
@@ -66,8 +65,20 @@ public:
 	 */
 	void draw(CVideoSurface *surface, CStarControlSub12 *sub12);
 
-	int get6() const { return _val6; }
-	bool get7() const { return _val7; }
+	int get1() const;
+	void set1(int val);
+	int get2() const;
+	void set2(int val);
+	int get54() const;
+	void set54(int val);
+	int get3() const;
+	void set3(int val);
+	void toggle4();	
+	bool set4(bool val);
+	int get88() const;
+	int get5() const;
+	void update6();
+	int get6() const;	
 };
 
 } // End of namespace Titanic


Commit: 90f2cce0b9621b483f9530c3615b40a0c8a50bb8
    https://github.com/scummvm/scummvm/commit/90f2cce0b9621b483f9530c3615b40a0c8a50bb8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T15:40:07-04:00

Commit Message:
TITANIC: Start of starfield rendering

Changed paths:
    engines/titanic/star_control/base_star.cpp
    engines/titanic/star_control/base_star.h
    engines/titanic/star_control/star_control_sub12.cpp
    engines/titanic/star_control/star_control_sub12.h
    engines/titanic/star_control/star_field.cpp
    engines/titanic/star_control/star_field.h
    engines/titanic/star_control/star_view.cpp



diff --git a/engines/titanic/star_control/base_star.cpp b/engines/titanic/star_control/base_star.cpp
index 4f4f838..f09df38 100644
--- a/engines/titanic/star_control/base_star.cpp
+++ b/engines/titanic/star_control/base_star.cpp
@@ -48,8 +48,8 @@ void CBaseStarEntry::load(Common::SeekableReadStream &s) {
 CBaseStar::CBaseStar() : _minVal(0.0), _maxVal(1.0), _range(0.0) {
 }
 
-void CBaseStar::proc2(int v1, int v2, int v3) {
-	error("TODO");
+void CBaseStar::draw(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarControlSub5 *sub5) {
+	// TODO
 }
 
 void CBaseStar::clear() {
diff --git a/engines/titanic/star_control/base_star.h b/engines/titanic/star_control/base_star.h
index ad3ad13..cf5cbc7 100644
--- a/engines/titanic/star_control/base_star.h
+++ b/engines/titanic/star_control/base_star.h
@@ -25,9 +25,13 @@
 
 #include "titanic/support/simple_file.h"
 #include "titanic/star_control/star_control_sub4.h"
+#include "titanic/star_control/star_control_sub5.h"
+#include "titanic/star_control/surface_area.h"
 
 namespace Titanic {
 
+class CStarControlSub12;
+
 struct CBaseStarEntry {
 	byte _field0;
 	byte _field1;
@@ -72,7 +76,11 @@ public:
 	CBaseStar();
 	virtual ~CBaseStar() {}
 
-	virtual void proc2(int v1, int v2, int v3);
+	/**
+	 * Draw the item
+	 */
+	virtual void draw(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStarControlSub5 *sub5);
+
 	virtual bool loadYale(int v1) { return true; }
 	virtual bool proc4(int v1, int v2, int v3, int v4, int v5) { return false; }
 	virtual bool proc5(int v1) { return false; }
diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp
index aa65f71..5fc26e4 100644
--- a/engines/titanic/star_control/star_control_sub12.cpp
+++ b/engines/titanic/star_control/star_control_sub12.cpp
@@ -37,4 +37,8 @@ void CStarControlSub12::save(SimpleFile *file, int indent) {
 	_sub13.save(file, indent);
 }
 
+void CStarControlSub12::setupHandler(void *v) {
+	// TODO
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index e053aef..51d8366 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -41,6 +41,8 @@ private:
 	int _field2C;
 	CStarControlSub13 _sub13;
 	int _field108;
+private:
+	void setupHandler(void *v);
 public:
 	CStarControlSub12(void *val1, void *val2);
 	virtual ~CStarControlSub12() {}
diff --git a/engines/titanic/star_control/star_field.cpp b/engines/titanic/star_control/star_field.cpp
index 2c94ebb..a90d228 100644
--- a/engines/titanic/star_control/star_field.cpp
+++ b/engines/titanic/star_control/star_field.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/star_control/star_field.h"
+#include "titanic/star_control/surface_area.h"
 
 namespace Titanic {
 
@@ -62,7 +63,11 @@ bool CStarField::initDocument() {
 	return valid;
 }
 
-void CStarField::draw(CVideoSurface *surface, CStarControlSub12 *sub12) {
+void CStarField::render(CVideoSurface *surface, CStarControlSub12 *sub12) {
+	CSurfaceArea surfaceArea(surface);
+	draw(&surfaceArea, sub12, &_sub5);
+
+
 	// TODO
 }
 
diff --git a/engines/titanic/star_control/star_field.h b/engines/titanic/star_control/star_field.h
index d02749b..18104cd 100644
--- a/engines/titanic/star_control/star_field.h
+++ b/engines/titanic/star_control/star_field.h
@@ -63,7 +63,7 @@ public:
 	/**
 	 * Renders the contents of the starfield
 	 */
-	void draw(CVideoSurface *surface, CStarControlSub12 *sub12);
+	void render(CVideoSurface *surface, CStarControlSub12 *sub12);
 
 	int get1() const;
 	void set1(int val);
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index 63bbed1..a4c742c 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -94,7 +94,7 @@ void CStarView::draw(CScreenManager *screenManager) {
 			// Render the display
 			_videoSurface->clear();
 			_videoSurface->lock();
-			_starField->draw(_videoSurface, &_sub12);
+			_starField->render(_videoSurface, &_sub12);
 			_videoSurface->unlock();
 
 			// Blit the resulting surface to the screen


Commit: 9e14d4a56660ab3f090fd8eaed756a4d83353d76
    https://github.com/scummvm/scummvm/commit/9e14d4a56660ab3f090fd8eaed756a4d83353d76
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T16:01:49-04:00

Commit Message:
TITANIC: Added CStarControlSub12 setupHandler

Changed paths:
  A engines/titanic/star_control/star_control_sub27.cpp
  A engines/titanic/star_control/star_control_sub27.h
    engines/titanic/module.mk
    engines/titanic/star_control/star_control_sub12.cpp
    engines/titanic/star_control/star_control_sub12.h
    engines/titanic/star_control/star_control_sub21.cpp
    engines/titanic/star_control/star_control_sub21.h
    engines/titanic/star_control/star_control_sub22.cpp
    engines/titanic/star_control/star_control_sub22.h
    engines/titanic/star_control/star_control_sub24.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 33e3558..ec32947 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -438,6 +438,7 @@ MODULE_OBJS := \
 	star_control/star_control_sub24.o \
 	star_control/star_control_sub25.o \
 	star_control/star_control_sub26.o \
+	star_control/star_control_sub27.o \
 	star_control/star_field.o \
 	star_control/star_points1.o \
 	star_control/star_points2.o \
diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp
index 5fc26e4..a2e1f06 100644
--- a/engines/titanic/star_control/star_control_sub12.cpp
+++ b/engines/titanic/star_control/star_control_sub12.cpp
@@ -21,12 +21,19 @@
  */
 
 #include "titanic/star_control/star_control_sub12.h"
+#include "titanic/star_control/star_control_sub21.h"
+#include "titanic/star_control/star_control_sub22.h"
 
 namespace Titanic {
 
 CStarControlSub12::CStarControlSub12(void *val1, void *val2) : 
-		_field4(-1), _field2C(0), _field108(0),
+		_field4(-1), _handlerP(nullptr), _field108(0),
 		_sub13(val1) {
+	setupHandler(val2);
+}
+
+CStarControlSub12::~CStarControlSub12() {
+	deleteHandler();
 }
 
 void CStarControlSub12::load(SimpleFile *file, int param) {
@@ -37,8 +44,38 @@ void CStarControlSub12::save(SimpleFile *file, int indent) {
 	_sub13.save(file, indent);
 }
 
-void CStarControlSub12::setupHandler(void *v) {
-	// TODO
+bool CStarControlSub12::setupHandler(void *src) {
+	CStarControlSub20 *handler = nullptr;
+
+	switch (_field4) {
+	case -1:
+		handler = new CStarControlSub21(src);
+		break;
+
+	case 0:
+	case 1:
+	case 2:
+		handler = new CStarControlSub22(src);
+		break;
+
+	default:
+		break;
+	}
+
+	if (handler) {
+		assert(!_handlerP);
+		_handlerP = handler;
+		return true;
+	} else {
+		return false;
+	}
+}
+
+void CStarControlSub12::deleteHandler() {
+	if (_handlerP) {
+		delete _handlerP;
+		_handlerP = nullptr;
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index 51d8366..a114cde 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -25,6 +25,7 @@
 
 #include "titanic/support/simple_file.h"
 #include "titanic/star_control/star_control_sub13.h"
+#include "titanic/star_control/star_control_sub20.h"
 
 namespace Titanic {
 
@@ -38,14 +39,22 @@ class CStarControlSub12 {
 private:
 	int _field4;
 	ArrayEntry _array[3];
-	int _field2C;
+	CStarControlSub20 *_handlerP;
 	CStarControlSub13 _sub13;
 	int _field108;
 private:
-	void setupHandler(void *v);
+	/**
+	 * Set up a handler
+	 */
+	bool setupHandler(void *src);
+
+	/**
+	 * Deletes any previous handler
+	 */
+	void deleteHandler();
 public:
 	CStarControlSub12(void *val1, void *val2);
-	virtual ~CStarControlSub12() {}
+	virtual ~CStarControlSub12();
 
 	virtual void proc3() {}
 
diff --git a/engines/titanic/star_control/star_control_sub21.cpp b/engines/titanic/star_control/star_control_sub21.cpp
index b606d15..20b8bc5 100644
--- a/engines/titanic/star_control/star_control_sub21.cpp
+++ b/engines/titanic/star_control/star_control_sub21.cpp
@@ -25,4 +25,8 @@
 
 namespace Titanic {
 
+CStarControlSub21::CStarControlSub21(void *src) :
+		CStarControlSub20(src), _sub24() {
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub21.h b/engines/titanic/star_control/star_control_sub21.h
index 8214a18..610f26e 100644
--- a/engines/titanic/star_control/star_control_sub21.h
+++ b/engines/titanic/star_control/star_control_sub21.h
@@ -24,10 +24,15 @@
 #define TITANIC_STAR_CONTROL_SUB21_H
 
 #include "titanic/star_control/star_control_sub20.h"
+#include "titanic/star_control/star_control_sub24.h"
 
 namespace Titanic {
 
 class CStarControlSub21 : public CStarControlSub20 {
+private:
+	CStarControlSub24 _sub24;
+public:
+	CStarControlSub21(void *src);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub22.cpp b/engines/titanic/star_control/star_control_sub22.cpp
index d7835a6..9298d5b 100644
--- a/engines/titanic/star_control/star_control_sub22.cpp
+++ b/engines/titanic/star_control/star_control_sub22.cpp
@@ -25,4 +25,8 @@
 
 namespace Titanic {
 
+CStarControlSub22::CStarControlSub22(void *src) :
+		CStarControlSub20(src), _sub27() {
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub22.h b/engines/titanic/star_control/star_control_sub22.h
index 94a0cdf..dae231f 100644
--- a/engines/titanic/star_control/star_control_sub22.h
+++ b/engines/titanic/star_control/star_control_sub22.h
@@ -23,9 +23,16 @@
 #ifndef TITANIC_STAR_CONTROL_SUB22_H
 #define TITANIC_STAR_CONTROL_SUB22_H
 
+#include "titanic/star_control/star_control_sub20.h"
+#include "titanic/star_control/star_control_sub27.h"
+
 namespace Titanic {
 
-class CStarControlSub22 {
+class CStarControlSub22 : public CStarControlSub20 {
+private:
+	CStarControlSub27 _sub27;
+public:
+	CStarControlSub22(void *src);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub24.h b/engines/titanic/star_control/star_control_sub24.h
index 43f1e09..e0970fc 100644
--- a/engines/titanic/star_control/star_control_sub24.h
+++ b/engines/titanic/star_control/star_control_sub24.h
@@ -23,9 +23,11 @@
 #ifndef TITANIC_STAR_CONTROL_SUB24_H
 #define TITANIC_STAR_CONTROL_SUB24_H
 
+#include "titanic/star_control/star_control_sub23.h"
+
 namespace Titanic {
 
-class CStarControlSub24 {
+class CStarControlSub24 : public CStarControlSub23 {
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub27.cpp b/engines/titanic/star_control/star_control_sub27.cpp
new file mode 100644
index 0000000..6f17eb7
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub27.cpp
@@ -0,0 +1,29 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/star_control/star_control_sub24.h"
+#include "common/textconsole.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub27.h b/engines/titanic/star_control/star_control_sub27.h
new file mode 100644
index 0000000..01782b6
--- /dev/null
+++ b/engines/titanic/star_control/star_control_sub27.h
@@ -0,0 +1,35 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_STAR_CONTROL_SUB27_H
+#define TITANIC_STAR_CONTROL_SUB27_H
+
+#include "titanic/star_control/star_control_sub23.h"
+
+namespace Titanic {
+
+class CStarControlSub27 : public CStarControlSub23 {
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_STAR_CONTROL_SUB27_H */


Commit: 011286d4b88b9d01ea1ceb232d6369385e68887e
    https://github.com/scummvm/scummvm/commit/011286d4b88b9d01ea1ceb232d6369385e68887e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T16:43:53-04:00

Commit Message:
TITANIC: Extra construction for CStarControlSub12

Changed paths:
    engines/titanic/star_control/fmatrix.cpp
    engines/titanic/star_control/fmatrix.h
    engines/titanic/star_control/star_control_sub12.cpp
    engines/titanic/star_control/star_control_sub12.h
    engines/titanic/star_control/star_control_sub13.cpp
    engines/titanic/star_control/star_control_sub13.h
    engines/titanic/star_control/star_control_sub6.cpp
    engines/titanic/star_control/star_control_sub6.h
    engines/titanic/star_control/star_view.cpp



diff --git a/engines/titanic/star_control/fmatrix.cpp b/engines/titanic/star_control/fmatrix.cpp
index c53892d..81604c8 100644
--- a/engines/titanic/star_control/fmatrix.cpp
+++ b/engines/titanic/star_control/fmatrix.cpp
@@ -32,6 +32,12 @@ FMatrix::FMatrix(DMatrix *src) {
 	copyFrom(src);
 }
 
+FMatrix::FMatrix(FMatrix *src) {
+	_row1 = src->_row1;
+	_row2 = src->_row2;
+	_row3 = src->_row3;
+}
+
 void FMatrix::copyFrom(const DMatrix *src) {
 	// TODO
 }
diff --git a/engines/titanic/star_control/fmatrix.h b/engines/titanic/star_control/fmatrix.h
index 5dbbe99..3367387 100644
--- a/engines/titanic/star_control/fmatrix.h
+++ b/engines/titanic/star_control/fmatrix.h
@@ -47,6 +47,7 @@ public:
 public:
 	FMatrix();
 	FMatrix(DMatrix *src);
+	FMatrix(FMatrix *src);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp
index a2e1f06..aa90a3c 100644
--- a/engines/titanic/star_control/star_control_sub12.cpp
+++ b/engines/titanic/star_control/star_control_sub12.cpp
@@ -32,6 +32,11 @@ CStarControlSub12::CStarControlSub12(void *val1, void *val2) :
 	setupHandler(val2);
 }
 
+CStarControlSub12::CStarControlSub12(CStarControlSub13 *src) :
+		_field4(-1), _handlerP(nullptr), _field108(0), _sub13(src) {
+
+}
+
 CStarControlSub12::~CStarControlSub12() {
 	deleteHandler();
 }
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index a114cde..0600aba 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -54,6 +54,7 @@ private:
 	void deleteHandler();
 public:
 	CStarControlSub12(void *val1, void *val2);
+	CStarControlSub12(CStarControlSub13 *src);
 	virtual ~CStarControlSub12();
 
 	virtual void proc3() {}
diff --git a/engines/titanic/star_control/star_control_sub13.cpp b/engines/titanic/star_control/star_control_sub13.cpp
index fd67c19..2038af3 100644
--- a/engines/titanic/star_control/star_control_sub13.cpp
+++ b/engines/titanic/star_control/star_control_sub13.cpp
@@ -24,25 +24,51 @@
 
 namespace Titanic {
 
-CStarControlSub13::CStarControlSub13(void *ptr):
+CStarControlSub13::CStarControlSub13(void *src) :
 		_field0(0), _field4(0), _field8(0), _fieldC0(0),
 		_fieldC4(0), _fieldC8(0), _fieldCC(0), _fieldD0(0) {
-	if (ptr) {
-		setup(ptr);
+	if (src) {
+		setup(src);
 	} else {
 		_fieldC = 0;
 		_field10 = 0x44480000;
 		_field14 = 0x461C4000;
 		_field18 = 0x41A00000;
 		_field1C = 0x41A00000;
-		_field20 = 600;
-		_field22 = 340;
+		_width = 600;
+		_height = 340;
 		_field24 = 0;
 	}
 
 	_fieldD4 = 0;
 }
 
+CStarControlSub13::CStarControlSub13(CStarControlSub13 *src) :
+		_matrix(&src->_matrix), _sub1(&src->_sub1), _sub2(&src->_sub2) {
+	_field0 = src->_field0;
+	_field4 = src->_field4;
+	_field8 = src->_field8;
+	_fieldC = src->_fieldC;
+	_field10 = src->_field10;
+	_field14 = src->_field14;
+	_field18 = src->_field18;
+	_field1C = src->_field1C;
+	_width = src->_width;
+	_height = src->_height;
+
+	_fieldCC = src->_fieldCC;
+	_fieldD0 = src->_fieldD0;
+	_fieldC0 = src->_fieldC0;
+	_fieldC4 = src->_fieldC4;
+	_fieldC8 = src->_fieldC8;
+	_field24 = src->_field24;
+
+	_valArray[0] = src->_valArray[0];
+	_valArray[2] = src->_valArray[2];
+	_valArray[3] = src->_valArray[3];
+	_fieldD4 = 0;
+}
+
 void CStarControlSub13::setup(void *ptr) {
 	// TODO
 }
@@ -56,8 +82,10 @@ void CStarControlSub13::load(SimpleFile *file, int param) {
 	_field14 = file->readFloat();
 	_field18 = file->readFloat();
 	_field1C = file->readFloat();
-	_field20 = file->readNumber();
-	_field22 = _field20 >> 16;
+	
+	int widthHeight = file->readNumber();
+	_width = widthHeight & 0xff;
+	_height = _width >> 16;
 	_field24 = file->readNumber();
 	
 	for (int idx = 0; idx < 5; ++idx)
@@ -68,6 +96,19 @@ void CStarControlSub13::load(SimpleFile *file, int param) {
 }
 
 void CStarControlSub13::save(SimpleFile *file, int indent) {
+	file->writeFloatLine(_field0, indent);
+	file->writeFloatLine(_field4, indent);
+	file->writeFloatLine(_field8, indent);
+	file->writeFloatLine(_fieldC, indent);
+	file->writeFloatLine(_field10, indent);
+	file->writeFloatLine(_field14, indent);
+	file->writeFloatLine(_field18, indent);
+	file->writeFloatLine(_field1C, indent);
+	file->writeFloatLine(_width | (_height << 16), indent);
+
+	for (int idx = 0; idx < 5; ++idx)
+		file->writeFloatLine(_valArray[idx], indent);
+
 	_matrix.save(file, indent);
 }
 
diff --git a/engines/titanic/star_control/star_control_sub13.h b/engines/titanic/star_control/star_control_sub13.h
index 37ffe1b..7eeab97 100644
--- a/engines/titanic/star_control/star_control_sub13.h
+++ b/engines/titanic/star_control/star_control_sub13.h
@@ -39,8 +39,8 @@ private:
 	double _field14;
 	double _field18;
 	double _field1C;
-	int _field20;
-	int _field22;
+	int _width;
+	int _height;
 	int _field24;
 	double _valArray[5];
 	FMatrix _matrix;
@@ -56,6 +56,7 @@ private:
 	void setup(void *ptr);
 public:
 	CStarControlSub13(void *ptr);
+	CStarControlSub13(CStarControlSub13 *src);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/star_control/star_control_sub6.cpp b/engines/titanic/star_control/star_control_sub6.cpp
index 83abc22..a5a1d81 100644
--- a/engines/titanic/star_control/star_control_sub6.cpp
+++ b/engines/titanic/star_control/star_control_sub6.cpp
@@ -34,6 +34,10 @@ CStarControlSub6::CStarControlSub6(int mode, double val) {
 	set(mode, val);
 }
 
+CStarControlSub6::CStarControlSub6(const CStarControlSub6 *src) {
+	copyFrom(src);
+}
+
 void CStarControlSub6::init() {
 	_static = nullptr;
 }
@@ -101,4 +105,11 @@ void CStarControlSub6::set(int mode, double amount) {
 	_field2C = 0.0;
 }
 
+void CStarControlSub6::copyFrom(const CStarControlSub6 *src) {
+	_matrix = src->_matrix;
+	_field24 = src->_field24;
+	_field28 = src->_field28;
+	_field2C = src->_field2C;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub6.h b/engines/titanic/star_control/star_control_sub6.h
index 10058f5..fe2b3d4 100644
--- a/engines/titanic/star_control/star_control_sub6.h
+++ b/engines/titanic/star_control/star_control_sub6.h
@@ -41,6 +41,7 @@ public:
 public:
 	CStarControlSub6();
 	CStarControlSub6(int mode, double amount);
+	CStarControlSub6(const CStarControlSub6 *src);
 
 	/**
 	 * Clear the item
@@ -51,6 +52,8 @@ public:
 	 * Sets the default data
 	 */
 	void set(int mode, double val);
+
+	void copyFrom(const CStarControlSub6 *src);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index a4c742c..2308227 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -28,7 +28,7 @@
 
 namespace Titanic {
 
-CStarView::CStarView() : _sub12(nullptr, nullptr), _sub13(nullptr),
+CStarView::CStarView() : _sub12(nullptr, nullptr), _sub13((void *)nullptr),
 		_owner(nullptr), _starField(nullptr), _videoSurface(nullptr), _field118(0), 
 		_videoSurface2(nullptr), _field210(0), _homePhotoMask(nullptr),
 		_field218(0), _field21C(0) {


Commit: 87db74d771d86281def59c12ba8359abeaa03585
    https://github.com/scummvm/scummvm/commit/87db74d771d86281def59c12ba8359abeaa03585
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T20:18:20-04:00

Commit Message:
TITANIC: Adding CStarControlSub12 methods

Changed paths:
    engines/titanic/star_control/fmatrix.cpp
    engines/titanic/star_control/fmatrix.h
    engines/titanic/star_control/star_control_sub12.cpp
    engines/titanic/star_control/star_control_sub12.h
    engines/titanic/star_control/star_control_sub13.cpp
    engines/titanic/star_control/star_control_sub13.h
    engines/titanic/star_control/star_control_sub20.cpp
    engines/titanic/star_control/star_control_sub20.h
    engines/titanic/star_control/star_view.cpp



diff --git a/engines/titanic/star_control/fmatrix.cpp b/engines/titanic/star_control/fmatrix.cpp
index 81604c8..af15477 100644
--- a/engines/titanic/star_control/fmatrix.cpp
+++ b/engines/titanic/star_control/fmatrix.cpp
@@ -78,17 +78,17 @@ void FMatrix::set(FVector *row1, FVector *row2, FVector *row3) {
 	_row3 = *row3;
 }
 
-void FMatrix::fn1(FVector *v) {
+void FMatrix::fn1(const FVector *v) {
 	_row3._x = v->_x;
 
 	FVector tempVector;
-	tempVector.fn1(v);
+	_row3.fn1(&tempVector);
 
 	_row2._x = tempVector._x;
 	_row2._y = tempVector._y;
 	_row2._z = tempVector._z;
 
-	_row3.multiply(v, &_row2);
+	_row3.multiply(&tempVector, &_row2);
 	_row1._x = _row2._x;
 	_row1._y = _row2._y;
 	_row1._z = _row2._z;
diff --git a/engines/titanic/star_control/fmatrix.h b/engines/titanic/star_control/fmatrix.h
index 3367387..d7c4acf 100644
--- a/engines/titanic/star_control/fmatrix.h
+++ b/engines/titanic/star_control/fmatrix.h
@@ -69,7 +69,7 @@ public:
 	 */
 	void set(FVector *row1, FVector *row2, FVector *row3);
 
-	void fn1(FVector *v);
+	void fn1(const FVector *v);
 
 	void fn2(FMatrix *m);
 	void fn3(FMatrix *m);
diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp
index aa90a3c..f968559 100644
--- a/engines/titanic/star_control/star_control_sub12.cpp
+++ b/engines/titanic/star_control/star_control_sub12.cpp
@@ -41,6 +41,65 @@ CStarControlSub12::~CStarControlSub12() {
 	deleteHandler();
 }
 
+void CStarControlSub12::proc2(const void *src) {
+	_sub13.copyFrom(src); 
+}
+
+void CStarControlSub12::proc3(const void *src) {
+	_handlerP->copyFrom1(src);
+}
+
+void CStarControlSub12::proc4(const void *src) {
+	if (!isLocked()) {
+		_sub13.fn10(src);
+		set108();
+	}
+}
+
+void CStarControlSub12::proc5(const FVector *src) {
+	if (!isLocked())
+		_sub13.fn11(src);
+}
+
+void CStarControlSub12::proc6(int v) {
+	if (!isLocked())
+		_sub13.setC(v);
+}
+
+void CStarControlSub12::proc7(int v) {
+	if (!isLocked())
+		_sub13.set10(v);
+}
+
+void CStarControlSub12::proc8(int v) {
+	if (!isLocked())
+		_sub13.set14(v);
+}
+
+void CStarControlSub12::proc9(int v) {
+	if (!isLocked())
+		_sub13.set18(v);
+}
+
+void CStarControlSub12::proc10(int v) {
+	if (!isLocked())
+		_sub13.set1C(v);
+}
+
+void CStarControlSub12::proc11() {
+	if (!isLocked())
+		_sub13.fn12();
+}
+
+void CStarControlSub12::proc12(double v1, double v2) {
+	if (!isLocked())
+		_sub13.fn13(v1, v2);
+}
+
+void CStarControlSub12::proc13(CStarControlSub13 *dest) {
+	*dest = _sub13;
+}
+
 void CStarControlSub12::load(SimpleFile *file, int param) {
 	_sub13.load(file, param);
 }
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index 0600aba..1262aa8 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -52,12 +52,28 @@ private:
 	 * Deletes any previous handler
 	 */
 	void deleteHandler();
+
+	/**
+	 * Return whether the handler is locked
+	 */
+	bool isLocked() { return _handlerP->isLocked(); }
 public:
 	CStarControlSub12(void *val1, void *val2);
 	CStarControlSub12(CStarControlSub13 *src);
 	virtual ~CStarControlSub12();
 
-	virtual void proc3() {}
+	virtual void proc2(const void *src);
+	virtual void proc3(const void *src);
+	virtual void proc4(const void *src);
+	virtual void proc5(const FVector *src);
+	virtual void proc6(int v);
+	virtual void proc7(int v);
+	virtual void proc8(int v);
+	virtual void proc9(int v);
+	virtual void proc10(int v);
+	virtual void proc11();
+	virtual void proc12(double v1, double v2);
+	virtual void proc13(CStarControlSub13 *dest);
 
 	/**
 	 * Load the data for the class from file
@@ -68,6 +84,11 @@ public:
 	 * Save the data for the class to file
 	 */
 	virtual void save(SimpleFile *file, int indent);
+
+
+	bool is108() const { return _field108; }
+	void set108() { _field108 = true; }
+	void reset108() { _field108 = false; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub13.cpp b/engines/titanic/star_control/star_control_sub13.cpp
index 2038af3..a8599a7 100644
--- a/engines/titanic/star_control/star_control_sub13.cpp
+++ b/engines/titanic/star_control/star_control_sub13.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/star_control/star_control_sub13.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -73,6 +74,18 @@ void CStarControlSub13::setup(void *ptr) {
 	// TODO
 }
 
+void CStarControlSub13::copyFrom(const void *src) {
+	if (!src)
+		return;
+/*
+	_field0 = src->_field0;
+	_field4 = src->_field4;
+	_field8 = src->_field8;
+	_fieldC = src->_field18;
+	_field10 = src->_field1C;
+	*/
+}
+
 void CStarControlSub13::load(SimpleFile *file, int param) {
 	_field0 = file->readFloat();
 	_field4 = file->readFloat();
@@ -112,5 +125,55 @@ void CStarControlSub13::save(SimpleFile *file, int indent) {
 	_matrix.save(file, indent);
 }
 
+void CStarControlSub13::fn10(const void *src) {
+	error("TODO: CStarControlSub13::fn10");
+}
+
+void CStarControlSub13::fn11(const FVector *v) {
+	_matrix.fn1(v);
+	_fieldD4 = 0;
+}
+
+void CStarControlSub13::setC(int v) {
+	_fieldC = v;
+	_fieldD4 = 0;
+}
+
+void CStarControlSub13::set10(int v) {
+	_field10 = v;
+	_fieldD4 = 0;
+}
+
+void CStarControlSub13::set14(int v) {
+	_field10 = v;
+}
+
+void CStarControlSub13::set18(int v) {
+	_field18 = v;
+	_fieldD4 = 0;
+}
+
+void CStarControlSub13::set1C(int v) {
+	_field1C = v;
+	_fieldD4 = 0;
+}
+
+void CStarControlSub13::fn12() {
+	_matrix.clear();
+	error("TODO: CStarControlSub13::fn12");
+}
+
+void CStarControlSub13::fn13(double v1, double v2) {
+	if (v1 == 0.0) {
+		_valArray[0] = v2;
+		_valArray[1] = -v2;
+	} else {
+		_valArray[3] = v2;
+		_valArray[4] = -v2;
+	}
+
+	_valArray[2] = 0.0;
+	_field24 = v2 ? 2 : 0;
+}
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub13.h b/engines/titanic/star_control/star_control_sub13.h
index 7eeab97..eb4a07c 100644
--- a/engines/titanic/star_control/star_control_sub13.h
+++ b/engines/titanic/star_control/star_control_sub13.h
@@ -58,6 +58,8 @@ public:
 	CStarControlSub13(void *ptr);
 	CStarControlSub13(CStarControlSub13 *src);
 
+	void copyFrom(const void *src);
+
 	/**
 	 * Load the data for the class from file
 	 */
@@ -67,6 +69,17 @@ public:
 	 * Save the data for the class to file
 	 */
 	void save(SimpleFile *file, int indent);
+
+	void fn10(const void *src);
+	void fn11(const FVector *v);
+	void fn12();
+	void fn13(double v1, double v2);
+
+	void setC(int v);
+	void set10(int v);
+	void set14(int v);
+	void set18(int v);
+	void set1C(int v);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub20.cpp b/engines/titanic/star_control/star_control_sub20.cpp
index 958ee38..82b6b0d 100644
--- a/engines/titanic/star_control/star_control_sub20.cpp
+++ b/engines/titanic/star_control/star_control_sub20.cpp
@@ -47,11 +47,11 @@ CStarControlSub20::~CStarControlSub20() {
 	clear();
 }
 
-void CStarControlSub20::copyFrom1(void *src) {
+void CStarControlSub20::copyFrom1(const void *src) {
 	error("TODO: CStarControlSub20::copyFrom1");
 }
 
-void CStarControlSub20::copyFrom2(void *src) {
+void CStarControlSub20::copyFrom2(const void *src) {
 	error("TODO: CStarControlSub20::copyFrom2");
 }
 
diff --git a/engines/titanic/star_control/star_control_sub20.h b/engines/titanic/star_control/star_control_sub20.h
index 376c097..9d90b80 100644
--- a/engines/titanic/star_control/star_control_sub20.h
+++ b/engines/titanic/star_control/star_control_sub20.h
@@ -44,8 +44,8 @@ public:
 	CStarControlSub20(void *src);
 	virtual ~CStarControlSub20();
 
-	virtual void copyFrom1(void *src);
-	virtual void copyFrom2(void *src);
+	virtual void copyFrom1(const void *src);
+	virtual void copyFrom2(const void *src);
 	virtual void proc4();
 	virtual void proc5();
 	virtual void proc6();
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index 2308227..5140dc0 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -32,7 +32,10 @@ CStarView::CStarView() : _sub12(nullptr, nullptr), _sub13((void *)nullptr),
 		_owner(nullptr), _starField(nullptr), _videoSurface(nullptr), _field118(0), 
 		_videoSurface2(nullptr), _field210(0), _homePhotoMask(nullptr),
 		_field218(0), _field21C(0) {
-	_sub12.proc3();
+	static const uint DATA[8] = { 0, 0, 0x47C35000, 0, 0x41A00000,
+		0x3F800000, 0x3F800000, 0x3F800000 };
+
+	_sub12.proc3(&DATA[0]);
 }
 
 void CStarView::load(SimpleFile *file, int param) {


Commit: 020655a6f3925a7a5e919274a96451bd434c2120
    https://github.com/scummvm/scummvm/commit/020655a6f3925a7a5e919274a96451bd434c2120
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T21:26:03-04:00

Commit Message:
TITANIC: Adding CStarControlSub12 methods

Changed paths:
    engines/titanic/star_control/star_control.cpp
    engines/titanic/star_control/star_control_sub12.cpp
    engines/titanic/star_control/star_control_sub12.h
    engines/titanic/star_control/star_control_sub13.cpp
    engines/titanic/star_control/star_control_sub13.h
    engines/titanic/star_control/star_control_sub20.cpp
    engines/titanic/star_control/star_control_sub20.h



diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index 3e0ff16..3324d17 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -25,6 +25,7 @@
 #include "titanic/star_control/dmatrix.h"
 #include "titanic/star_control/error_code.h"
 #include "titanic/star_control/star_control_sub6.h"
+#include "titanic/star_control/star_control_sub12.h"
 
 namespace Titanic {
 
@@ -38,11 +39,13 @@ END_MESSAGE_MAP()
 CStarControl::CStarControl() : _fieldBC(0), _field80B0(0),
 		_starRect(20, 10, 620, 350) {
 	CStarControlSub6::init();
+	CStarControlSub12::init();
 	DMatrix::init();
 }
 
 CStarControl::~CStarControl() {
 	CStarControlSub6::deinit();
+	CStarControlSub12::deinit();
 	DMatrix::deinit();
 }
 
diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp
index f968559..9673270 100644
--- a/engines/titanic/star_control/star_control_sub12.cpp
+++ b/engines/titanic/star_control/star_control_sub12.cpp
@@ -26,6 +26,9 @@
 
 namespace Titanic {
 
+FMatrix *CStarControlSub12::_matrix1;
+FMatrix *CStarControlSub12::_matrix2;
+
 CStarControlSub12::CStarControlSub12(void *val1, void *val2) : 
 		_field4(-1), _handlerP(nullptr), _field108(0),
 		_sub13(val1) {
@@ -34,7 +37,18 @@ CStarControlSub12::CStarControlSub12(void *val1, void *val2) :
 
 CStarControlSub12::CStarControlSub12(CStarControlSub13 *src) :
 		_field4(-1), _handlerP(nullptr), _field108(0), _sub13(src) {
+}
+
+void CStarControlSub12::init() {
+	_matrix1 = nullptr;
+	_matrix2 = nullptr;
+}
 
+void CStarControlSub12::deinit() {
+	delete _matrix1;
+	delete _matrix2;
+	_matrix1 = nullptr;
+	_matrix2 = nullptr;
 }
 
 CStarControlSub12::~CStarControlSub12() {
@@ -49,16 +63,16 @@ void CStarControlSub12::proc3(const void *src) {
 	_handlerP->copyFrom1(src);
 }
 
-void CStarControlSub12::proc4(const void *src) {
+void CStarControlSub12::setPosition(const FVector &v) {
 	if (!isLocked()) {
-		_sub13.fn10(src);
+		_sub13.setPosition(v);
 		set108();
 	}
 }
 
-void CStarControlSub12::proc5(const FVector *src) {
+void CStarControlSub12::proc5(const FVector &v) {
 	if (!isLocked())
-		_sub13.fn11(src);
+		_sub13.fn11(v);
 }
 
 void CStarControlSub12::proc6(int v) {
@@ -100,6 +114,38 @@ void CStarControlSub12::proc13(CStarControlSub13 *dest) {
 	*dest = _sub13;
 }
 
+void CStarControlSub12::proc14(int v) {
+	FMatrix matrix;
+	_sub13.getMatrix(&matrix);
+	FVector vector = _sub13._position;
+
+	_handlerP->proc9(&vector, v, &matrix);
+}
+
+void CStarControlSub12::proc15(int v) {
+	if (!_matrix1)
+		_matrix1 = new FMatrix();
+	if (!_matrix2)
+		_matrix2 = new FMatrix();
+
+	_sub13.getMatrix(_matrix1);
+	*_matrix2 = *_matrix1;
+
+	FVector v1 = _sub13._position;
+	FVector v2 = _sub13._position;
+	CErrorCode errorCode;
+	_handlerP->proc11(errorCode, v2, _matrix2);
+
+	if (v1 != v2) {
+		_sub13.setPosition(v2);
+		set108();
+	}
+
+	if (_matrix1 != _matrix2) {
+		_sub13.setMatrix(_matrix2);
+	}
+}
+
 void CStarControlSub12::load(SimpleFile *file, int param) {
 	_sub13.load(file, param);
 }
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index 1262aa8..643e3df 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -24,6 +24,7 @@
 #define TITANIC_STAR_CONTROL_SUB12_H
 
 #include "titanic/support/simple_file.h"
+#include "titanic/star_control/fmatrix.h"
 #include "titanic/star_control/star_control_sub13.h"
 #include "titanic/star_control/star_control_sub20.h"
 
@@ -37,6 +38,9 @@ class CStarControlSub12 {
 		ArrayEntry() : _field0(0), _field4(0), _field8(0) {}
 	};
 private:
+	static FMatrix *_matrix1;
+	static FMatrix *_matrix2;
+private:
 	int _field4;
 	ArrayEntry _array[3];
 	CStarControlSub20 *_handlerP;
@@ -58,14 +62,17 @@ private:
 	 */
 	bool isLocked() { return _handlerP->isLocked(); }
 public:
+	static void init();
+	static void deinit();
+public:
 	CStarControlSub12(void *val1, void *val2);
 	CStarControlSub12(CStarControlSub13 *src);
 	virtual ~CStarControlSub12();
 
 	virtual void proc2(const void *src);
 	virtual void proc3(const void *src);
-	virtual void proc4(const void *src);
-	virtual void proc5(const FVector *src);
+	virtual void setPosition(const FVector &v);
+	virtual void proc5(const FVector &v);
 	virtual void proc6(int v);
 	virtual void proc7(int v);
 	virtual void proc8(int v);
@@ -74,6 +81,8 @@ public:
 	virtual void proc11();
 	virtual void proc12(double v1, double v2);
 	virtual void proc13(CStarControlSub13 *dest);
+	virtual void proc14(int v);
+	virtual void proc15(int v);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/star_control/star_control_sub13.cpp b/engines/titanic/star_control/star_control_sub13.cpp
index a8599a7..a69937b 100644
--- a/engines/titanic/star_control/star_control_sub13.cpp
+++ b/engines/titanic/star_control/star_control_sub13.cpp
@@ -26,8 +26,7 @@
 namespace Titanic {
 
 CStarControlSub13::CStarControlSub13(void *src) :
-		_field0(0), _field4(0), _field8(0), _fieldC0(0),
-		_fieldC4(0), _fieldC8(0), _fieldCC(0), _fieldD0(0) {
+		_fieldC0(0), _fieldC4(0), _fieldC8(0), _fieldCC(0), _fieldD0(0) {
 	if (src) {
 		setup(src);
 	} else {
@@ -46,9 +45,7 @@ CStarControlSub13::CStarControlSub13(void *src) :
 
 CStarControlSub13::CStarControlSub13(CStarControlSub13 *src) :
 		_matrix(&src->_matrix), _sub1(&src->_sub1), _sub2(&src->_sub2) {
-	_field0 = src->_field0;
-	_field4 = src->_field4;
-	_field8 = src->_field8;
+	_position = src->_position;
 	_fieldC = src->_fieldC;
 	_field10 = src->_field10;
 	_field14 = src->_field14;
@@ -87,9 +84,9 @@ void CStarControlSub13::copyFrom(const void *src) {
 }
 
 void CStarControlSub13::load(SimpleFile *file, int param) {
-	_field0 = file->readFloat();
-	_field4 = file->readFloat();
-	_field8 = file->readFloat();
+	_position._x = file->readFloat();
+	_position._y = file->readFloat();
+	_position._z = file->readFloat();
 	_fieldC = file->readFloat();
 	_field10 = file->readFloat();
 	_field14 = file->readFloat();
@@ -109,9 +106,9 @@ void CStarControlSub13::load(SimpleFile *file, int param) {
 }
 
 void CStarControlSub13::save(SimpleFile *file, int indent) {
-	file->writeFloatLine(_field0, indent);
-	file->writeFloatLine(_field4, indent);
-	file->writeFloatLine(_field8, indent);
+	file->writeFloatLine(_position._x, indent);
+	file->writeFloatLine(_position._y, indent);
+	file->writeFloatLine(_position._z, indent);
 	file->writeFloatLine(_fieldC, indent);
 	file->writeFloatLine(_field10, indent);
 	file->writeFloatLine(_field14, indent);
@@ -125,12 +122,18 @@ void CStarControlSub13::save(SimpleFile *file, int indent) {
 	_matrix.save(file, indent);
 }
 
-void CStarControlSub13::fn10(const void *src) {
-	error("TODO: CStarControlSub13::fn10");
+void CStarControlSub13::setPosition(const FVector &v) {
+	_position = v;
+	_fieldD4 = 0;
 }
 
-void CStarControlSub13::fn11(const FVector *v) {
-	_matrix.fn1(v);
+void CStarControlSub13::setMatrix(const FMatrix &m) {
+	_matrix = m;
+	_fieldD4 = 0;
+}
+
+void CStarControlSub13::fn11(const FVector &v) {
+	_matrix.fn1(&v);
 	_fieldD4 = 0;
 }
 
@@ -176,4 +179,8 @@ void CStarControlSub13::fn13(double v1, double v2) {
 	_field24 = v2 ? 2 : 0;
 }
 
+void CStarControlSub13::getMatrix(FMatrix *matrix) {
+	*matrix = _matrix;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub13.h b/engines/titanic/star_control/star_control_sub13.h
index eb4a07c..eacdce3 100644
--- a/engines/titanic/star_control/star_control_sub13.h
+++ b/engines/titanic/star_control/star_control_sub13.h
@@ -31,9 +31,6 @@ namespace Titanic {
 
 class CStarControlSub13 {
 private:
-	double _field0;
-	double _field4;
-	double _field8;
 	double _fieldC;
 	double _field10;
 	double _field14;
@@ -55,6 +52,8 @@ private:
 private:
 	void setup(void *ptr);
 public:
+	FVector _position;
+public:
 	CStarControlSub13(void *ptr);
 	CStarControlSub13(CStarControlSub13 *src);
 
@@ -70,11 +69,25 @@ public:
 	 */
 	void save(SimpleFile *file, int indent);
 
-	void fn10(const void *src);
-	void fn11(const FVector *v);
+	/**
+	 * Sets the position
+	 */
+	void setPosition(const FVector &v);
+
+	/**
+	 * Sets the matrix
+	 */
+	void setMatrix(const FMatrix &m);
+
+	void fn11(const FVector &v);
 	void fn12();
 	void fn13(double v1, double v2);
 
+	/**
+	 * Makes a copy of the instance's matrix into the passed matrix
+	 */
+	void getMatrix(FMatrix *matrix);
+
 	void setC(int v);
 	void set10(int v);
 	void set14(int v);
diff --git a/engines/titanic/star_control/star_control_sub20.cpp b/engines/titanic/star_control/star_control_sub20.cpp
index 82b6b0d..3611478 100644
--- a/engines/titanic/star_control/star_control_sub20.cpp
+++ b/engines/titanic/star_control/star_control_sub20.cpp
@@ -90,7 +90,7 @@ void CStarControlSub20::proc7() {
 	}
 }
 
-void CStarControlSub20::proc11(CErrorCode *errorCode, void *v2, void *v3) {
+void CStarControlSub20::proc11(CErrorCode &errorCode, FVector &v, const FMatrix &m) {
 	if (_field4 > 0.0) {
 		warning("TODO: CStarControlSub20::proc11");
 	}
diff --git a/engines/titanic/star_control/star_control_sub20.h b/engines/titanic/star_control/star_control_sub20.h
index 9d90b80..eaa9d4f 100644
--- a/engines/titanic/star_control/star_control_sub20.h
+++ b/engines/titanic/star_control/star_control_sub20.h
@@ -25,6 +25,7 @@
 
 #include "titanic/support/simple_file.h"
 #include "titanic/star_control/error_code.h"
+#include "titanic/star_control/fmatrix.h"
 
 namespace Titanic {
 
@@ -51,9 +52,9 @@ public:
 	virtual void proc6();
 	virtual void proc7();
 	virtual void proc8() {}
-	virtual void proc9() {}
+	virtual void proc9(FVector *v, int v2, FMatrix *matrix) {}
 	virtual void proc10() {}
-	virtual void proc11(CErrorCode *errorCode, void *v2, void *v3);
+	virtual void proc11(CErrorCode &errorCode, FVector &v, const FMatrix &m);
 
 	/**
 	 * Set the data


Commit: 3ee3784073fb7c5299f553c3fd07842aed2d356f
    https://github.com/scummvm/scummvm/commit/3ee3784073fb7c5299f553c3fd07842aed2d356f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-17T23:18:06-04:00

Commit Message:
TITANIC: Added remaining CStarControlSub12 virtual methods

Changed paths:
    engines/titanic/star_control/fvector.cpp
    engines/titanic/star_control/fvector.h
    engines/titanic/star_control/star_control_sub12.cpp
    engines/titanic/star_control/star_control_sub12.h
    engines/titanic/star_control/star_control_sub13.cpp
    engines/titanic/star_control/star_control_sub13.h
    engines/titanic/star_control/star_control_sub6.h



diff --git a/engines/titanic/star_control/fvector.cpp b/engines/titanic/star_control/fvector.cpp
index ce7b62b..aa99e8b 100644
--- a/engines/titanic/star_control/fvector.cpp
+++ b/engines/titanic/star_control/fvector.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "titanic/star_control/fvector.h"
+#include "titanic/star_control/star_control_sub6.h"
 #include "common/algorithm.h"
 #include "common/textconsole.h"
 
@@ -63,7 +64,7 @@ void FVector::fn4(FVector *dest, const FVector *v1, const FVector *v2) {
 	*dest = tempVector;
 }
 
-void FVector::fn5(FVector *dest, const void *v) const {
+void FVector::fn5(FVector *dest, const CStarControlSub6 *sub6) const {
 	error("TODO: FVector::fn5");
 }
 
diff --git a/engines/titanic/star_control/fvector.h b/engines/titanic/star_control/fvector.h
index 9af18dc..8e1ba47 100644
--- a/engines/titanic/star_control/fvector.h
+++ b/engines/titanic/star_control/fvector.h
@@ -25,6 +25,8 @@
 
 namespace Titanic {
 
+class CStarControlSub6;
+
 /**
  * Floating point vector class.
  * @remarks		TODO: See if it can be merged with DVector
@@ -46,7 +48,7 @@ public:
 	double getDistance(const FVector *src) const;
 
 	static void fn4(FVector *dest, const FVector *v1, const FVector *v2);
-	void fn5(FVector *dest, const void *v) const;
+	void fn5(FVector *dest, const CStarControlSub6 *sub6) const;
 
 	/**
 	 * Returns true if the passed vector equals this one
diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp
index 9673270..85b7c83 100644
--- a/engines/titanic/star_control/star_control_sub12.cpp
+++ b/engines/titanic/star_control/star_control_sub12.cpp
@@ -30,13 +30,13 @@ FMatrix *CStarControlSub12::_matrix1;
 FMatrix *CStarControlSub12::_matrix2;
 
 CStarControlSub12::CStarControlSub12(void *val1, void *val2) : 
-		_field4(-1), _handlerP(nullptr), _field108(0),
+		_currentIndex(-1), _handlerP(nullptr), _field108(0),
 		_sub13(val1) {
 	setupHandler(val2);
 }
 
 CStarControlSub12::CStarControlSub12(CStarControlSub13 *src) :
-		_field4(-1), _handlerP(nullptr), _field108(0), _sub13(src) {
+		_currentIndex(-1), _handlerP(nullptr), _field108(0), _sub13(src) {
 }
 
 void CStarControlSub12::init() {
@@ -146,6 +146,98 @@ void CStarControlSub12::proc15(int v) {
 	}
 }
 
+void CStarControlSub12::proc16() {
+	_handlerP->proc4();
+}
+
+void CStarControlSub12::proc17() {
+	_handlerP->proc5();
+}
+
+void CStarControlSub12::proc18() {
+	_handlerP->proc6();
+}
+
+void CStarControlSub12::proc19() {
+	_handlerP->proc7();
+}
+
+void CStarControlSub12::proc20(double v) {
+	if (!isLocked())
+		_sub13.fn14(v);
+}
+
+void CStarControlSub12::proc21(CStarControlSub6 &sub6) {
+	if (!isLocked()) {
+		_sub13.setPosition(sub6);
+		set108();
+	}
+}
+
+void CStarControlSub12::proc22(FMatrix &m) {
+	if (!isLocked())
+		_sub13.fn15(m);
+}
+
+CStarControlSub6 CStarControlSub12::proc23() {
+	return _sub13.getSub1();
+}
+
+CStarControlSub6 CStarControlSub12::proc24() {
+	return _sub13.getSub2();
+}
+
+double CStarControlSub12::proc25() const {
+	return _sub13._field10;
+}
+
+double CStarControlSub12::proc26() const {
+	return _sub13._field14;
+}
+
+int CStarControlSub12::proc27() const {
+	return _sub13._field24;
+}
+
+FVector CStarControlSub12::proc28(int index, const void *v2) {
+	error("TODO: CStarControlSub12::proc28");
+	return FVector();
+}
+
+FVector CStarControlSub12::proc29(const FVector &v) {
+	return _sub13.fn16(v);
+}
+
+FVector CStarControlSub12::proc30(int index, const FVector &v) {
+	return _sub13.fn17(index, v);
+}
+
+FVector CStarControlSub12::proc31(int index, const FVector &v) {
+	return _sub13.fn18(index, v);
+}
+
+void CStarControlSub12::proc32(double v1, double v2) {
+	error("TODO: CStarControlSub12::proc32");
+}
+
+bool CStarControlSub12::setArrayVector(const FVector &v) {
+	if (_currentIndex >= 2)
+		return false;
+
+	error("TODO: CStarControlSub12::setArrayVector");
+}
+
+bool CStarControlSub12::proc35() {
+	if (_currentIndex == -1)
+		return false;
+
+	error("TODO: CStarControlSub12::proc35");
+}
+
+void CStarControlSub12::proc36(double *v1, double *v2, double *v3, double *v4) {
+	_sub13.fn19(v1, v2, v3, v4);
+}
+
 void CStarControlSub12::load(SimpleFile *file, int param) {
 	_sub13.load(file, param);
 }
@@ -157,7 +249,7 @@ void CStarControlSub12::save(SimpleFile *file, int indent) {
 bool CStarControlSub12::setupHandler(void *src) {
 	CStarControlSub20 *handler = nullptr;
 
-	switch (_field4) {
+	switch (_currentIndex) {
 	case -1:
 		handler = new CStarControlSub21(src);
 		break;
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index 643e3df..1d5f693 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -31,18 +31,12 @@
 namespace Titanic {
 
 class CStarControlSub12 {
-	struct ArrayEntry {
-		int _field0;
-		int _field4;
-		int _field8;
-		ArrayEntry() : _field0(0), _field4(0), _field8(0) {}
-	};
 private:
 	static FMatrix *_matrix1;
 	static FMatrix *_matrix2;
 private:
-	int _field4;
-	ArrayEntry _array[3];
+	int _currentIndex;
+	FVector _array[3];
 	CStarControlSub20 *_handlerP;
 	CStarControlSub13 _sub13;
 	int _field108;
@@ -83,6 +77,27 @@ public:
 	virtual void proc13(CStarControlSub13 *dest);
 	virtual void proc14(int v);
 	virtual void proc15(int v);
+	virtual void proc16();
+	virtual void proc17();
+	virtual void proc18();
+	virtual void proc19();
+	virtual void proc20(double v);
+	virtual void proc21(CStarControlSub6 &sub6);
+	virtual void proc22(FMatrix &m);
+	virtual CStarControlSub6 proc23();
+	virtual CStarControlSub6 proc24();
+	virtual double proc25() const;
+	virtual double proc26() const;
+	virtual int proc27() const;
+	virtual FVector proc28(int index, const void *v2);
+	virtual FVector proc29(const FVector &v);
+	virtual FVector proc30(int index, const FVector &v);
+	virtual FVector proc31(int index, const FVector &v);
+	virtual void proc32(double v1, double v2);
+	virtual int getCurrentIndex() const { return _currentIndex; }
+	virtual bool setArrayVector(const FVector &v);
+	virtual bool proc35();
+	virtual void proc36(double *v1, double *v2, double *v3, double *v4);
 
 	/**
 	 * Load the data for the class from file
diff --git a/engines/titanic/star_control/star_control_sub13.cpp b/engines/titanic/star_control/star_control_sub13.cpp
index a69937b..c721b39 100644
--- a/engines/titanic/star_control/star_control_sub13.cpp
+++ b/engines/titanic/star_control/star_control_sub13.cpp
@@ -127,6 +127,13 @@ void CStarControlSub13::setPosition(const FVector &v) {
 	_fieldD4 = 0;
 }
 
+void CStarControlSub13::setPosition(const CStarControlSub6 &sub6) {
+	FVector vector;
+	_position.fn5(&vector, &sub6);
+	_position = sub6._matrix._row1;
+	_fieldD4 = 0;
+}
+
 void CStarControlSub13::setMatrix(const FMatrix &m) {
 	_matrix = m;
 	_fieldD4 = 0;
@@ -179,6 +186,50 @@ void CStarControlSub13::fn13(double v1, double v2) {
 	_field24 = v2 ? 2 : 0;
 }
 
+void CStarControlSub13::fn14(double v) {
+	error("TODO: CStarControlSub13::fn14");
+}
+
+void CStarControlSub13::fn15(FMatrix &matrix) {
+	_matrix.fn3(&matrix);
+	_fieldD4 = 0;
+}
+
+CStarControlSub6 CStarControlSub13::getSub1() {
+	if (!_fieldD4)
+		reset();
+
+	return _sub1;
+}
+
+CStarControlSub6 CStarControlSub13::getSub2() {
+	if (!_fieldD4)
+		reset();
+
+	return _sub2;
+}
+
+FVector CStarControlSub13::fn16(const FVector &v) {
+	error("TODO: CStarControlSub13::fn16");
+}
+
+FVector CStarControlSub13::fn17(int index, const FVector &v) {
+	error("TODO: CStarControlSub13::fn17");
+}
+
+FVector CStarControlSub13::fn18(int index, const FVector &v) {
+	error("TODO: CStarControlSub13::fn17");
+}
+
+void CStarControlSub13::fn19(double *v1, double *v2, double *v3, double *v4) {
+	error("TODO: CStarControlSub13::fn19");
+}
+
+void CStarControlSub13::reset() {
+	const double FACTOR = 3.1415927 * 0.0055555557;
+	error("TODO: CStarControlSub13::reset");
+}
+
 void CStarControlSub13::getMatrix(FMatrix *matrix) {
 	*matrix = _matrix;
 }
diff --git a/engines/titanic/star_control/star_control_sub13.h b/engines/titanic/star_control/star_control_sub13.h
index eacdce3..2f0b479 100644
--- a/engines/titanic/star_control/star_control_sub13.h
+++ b/engines/titanic/star_control/star_control_sub13.h
@@ -32,27 +32,29 @@ namespace Titanic {
 class CStarControlSub13 {
 private:
 	double _fieldC;
-	double _field10;
-	double _field14;
 	double _field18;
 	double _field1C;
 	int _width;
 	int _height;
-	int _field24;
 	double _valArray[5];
 	FMatrix _matrix;
 	CStarControlSub6 _sub1;
 	CStarControlSub6 _sub2;
-	int _fieldC0;
-	int _fieldC4;
+	double _fieldC0;
+	double _fieldC4;
 	int _fieldC8;
 	int _fieldCC;
-	int _fieldD0;
+	double _fieldD0;
 	int _fieldD4;
 private:
 	void setup(void *ptr);
+
+	void reset();
 public:
 	FVector _position;
+	double _field10;
+	double _field14;
+	int _field24;
 public:
 	CStarControlSub13(void *ptr);
 	CStarControlSub13(CStarControlSub13 *src);
@@ -75,6 +77,11 @@ public:
 	void setPosition(const FVector &v);
 
 	/**
+	 * Sets the position
+	 */
+	void setPosition(const CStarControlSub6 &sub6);
+
+	/**
 	 * Sets the matrix
 	 */
 	void setMatrix(const FMatrix &m);
@@ -82,6 +89,14 @@ public:
 	void fn11(const FVector &v);
 	void fn12();
 	void fn13(double v1, double v2);
+	void fn14(double v);
+	void fn15(FMatrix &matrix);
+	CStarControlSub6 getSub1();
+	CStarControlSub6 getSub2();
+	FVector fn16(const FVector &v);
+	FVector fn17(int index, const FVector &v);
+	FVector fn18(int index, const FVector &v);
+	void fn19(double *v1, double *v2, double *v3, double *v4);
 
 	/**
 	 * Makes a copy of the instance's matrix into the passed matrix
diff --git a/engines/titanic/star_control/star_control_sub6.h b/engines/titanic/star_control/star_control_sub6.h
index fe2b3d4..118c7c7 100644
--- a/engines/titanic/star_control/star_control_sub6.h
+++ b/engines/titanic/star_control/star_control_sub6.h
@@ -29,7 +29,6 @@ namespace Titanic {
 
 class CStarControlSub6 {
 private:
-	FMatrix _matrix;
 	int _field24;
 	int _field28;
 	int _field2C;
@@ -39,6 +38,8 @@ public:
 	static void init();
 	static void deinit();
 public:
+	FMatrix _matrix;
+public:
 	CStarControlSub6();
 	CStarControlSub6(int mode, double amount);
 	CStarControlSub6(const CStarControlSub6 *src);


Commit: 5387d4dd7b025ec3e18c4f2c17a5a82d9164e1c8
    https://github.com/scummvm/scummvm/commit/5387d4dd7b025ec3e18c4f2c17a5a82d9164e1c8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-18T18:59:10-04:00

Commit Message:
TITANIC: Added CStarControlSub20 copyFrom/copyTo methods

Changed paths:
    engines/titanic/star_control/star_control_sub12.cpp
    engines/titanic/star_control/star_control_sub12.h
    engines/titanic/star_control/star_control_sub20.cpp
    engines/titanic/star_control/star_control_sub20.h
    engines/titanic/star_control/star_control_sub21.cpp
    engines/titanic/star_control/star_control_sub21.h
    engines/titanic/star_control/star_control_sub22.cpp
    engines/titanic/star_control/star_control_sub22.h
    engines/titanic/star_control/star_view.cpp



diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp
index 85b7c83..5840495 100644
--- a/engines/titanic/star_control/star_control_sub12.cpp
+++ b/engines/titanic/star_control/star_control_sub12.cpp
@@ -29,10 +29,10 @@ namespace Titanic {
 FMatrix *CStarControlSub12::_matrix1;
 FMatrix *CStarControlSub12::_matrix2;
 
-CStarControlSub12::CStarControlSub12(void *val1, void *val2) : 
+CStarControlSub12::CStarControlSub12(void *val1, const CStar20Data *data) : 
 		_currentIndex(-1), _handlerP(nullptr), _field108(0),
 		_sub13(val1) {
-	setupHandler(val2);
+	setupHandler(data);
 }
 
 CStarControlSub12::CStarControlSub12(CStarControlSub13 *src) :
@@ -59,8 +59,8 @@ void CStarControlSub12::proc2(const void *src) {
 	_sub13.copyFrom(src); 
 }
 
-void CStarControlSub12::proc3(const void *src) {
-	_handlerP->copyFrom1(src);
+void CStarControlSub12::proc3(const CStar20Data *src) {
+	_handlerP->copyFrom(src);
 }
 
 void CStarControlSub12::setPosition(const FVector &v) {
@@ -246,7 +246,7 @@ void CStarControlSub12::save(SimpleFile *file, int indent) {
 	_sub13.save(file, indent);
 }
 
-bool CStarControlSub12::setupHandler(void *src) {
+bool CStarControlSub12::setupHandler(const CStar20Data *src) {
 	CStarControlSub20 *handler = nullptr;
 
 	switch (_currentIndex) {
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index 1d5f693..8da45df 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -44,7 +44,7 @@ private:
 	/**
 	 * Set up a handler
 	 */
-	bool setupHandler(void *src);
+	bool setupHandler(const CStar20Data *src);
 
 	/**
 	 * Deletes any previous handler
@@ -59,12 +59,12 @@ public:
 	static void init();
 	static void deinit();
 public:
-	CStarControlSub12(void *val1, void *val2);
+	CStarControlSub12(void *val1, const CStar20Data *data);
 	CStarControlSub12(CStarControlSub13 *src);
 	virtual ~CStarControlSub12();
 
 	virtual void proc2(const void *src);
-	virtual void proc3(const void *src);
+	virtual void proc3(const CStar20Data *src);
 	virtual void setPosition(const FVector &v);
 	virtual void proc5(const FVector &v);
 	virtual void proc6(int v);
diff --git a/engines/titanic/star_control/star_control_sub20.cpp b/engines/titanic/star_control/star_control_sub20.cpp
index 3611478..36e7036 100644
--- a/engines/titanic/star_control/star_control_sub20.cpp
+++ b/engines/titanic/star_control/star_control_sub20.cpp
@@ -25,21 +25,21 @@
 
 namespace Titanic {
 
-CStarControlSub20::CStarControlSub20(void *src) {
+CStarControlSub20::CStarControlSub20(const CStar20Data *src) {
 	_lockCounter = 0;
 	_dataP = nullptr;
 
 	if (src) {
-		copyFrom1(src);
+		copyFrom(src);
 	} else {
-		_field4 = 0.0;
-		_field8 = 0.0;
-		_fieldC = 20.0;
-		_field10 = 0.0;
-		_field14 = 50000.0;
-		_field18 = 1.0;
-		_field1C = 1.0;
-		_field20 = 0.0;
+		_data._field0 = 0.0;
+		_data._field4 = 0.0;
+		_data._field8 = 20.0;
+		_data._fieldC = 0.0;
+		_data._field10 = 50000.0;
+		_data._field14 = 1.0;
+		_data._field18 = 1.0;
+		_data._field1C = 0.0;
 	}
 }
 
@@ -47,51 +47,51 @@ CStarControlSub20::~CStarControlSub20() {
 	clear();
 }
 
-void CStarControlSub20::copyFrom1(const void *src) {
-	error("TODO: CStarControlSub20::copyFrom1");
+void CStarControlSub20::copyFrom(const CStar20Data *src) {
+	_data = *src;
 }
 
-void CStarControlSub20::copyFrom2(const void *src) {
-	error("TODO: CStarControlSub20::copyFrom2");
+void CStarControlSub20::copyTo(CStar20Data *dest) {
+	*dest = _data;
 }
 
 void CStarControlSub20::proc4() {
-	if (!isLocked() && _field4 < _field14) {
-		_field8 += _field4;
-		if (_fieldC == _field8)
-			_field4 -= _field8;
+	if (!isLocked() && _data._field0 < _data._field10) {
+		_data._field4 += _data._field0;
+		if (_data._field8 == _data._field4)
+			_data._field0 -= _data._field4;
 		else
-			_field4 += _field8;
+			_data._field0 += _data._field4;
 	}
 }
 
 void CStarControlSub20::proc5() {
 	if (!isLocked()) {
-		_field8 -= _fieldC;
-		if (_field8 == _field4)
-			_field4 += _field8;
+		_data._field4 -= _data._field8;
+		if (_data._field4 == _data._field0)
+			_data._field0 += _data._field4;
 		else
-			_field4 -= _field8;
+			_data._field0 -= _data._field4;
 
-		if (_field8 < 0.0)
-			_field8 = 0.0;
+		if (_data._field4 < 0.0)
+			_data._field4 = 0.0;
 	}
 }
 
 void CStarControlSub20::proc6() {
 	if (!isLocked())
-		_field4 = _field14;
+		_data._field0 = _data._field10;
 }
 
 void CStarControlSub20::proc7() {
 	if (!isLocked()) {
-		_field4 = 0.0;
-		_field8 = 0.0;
+		_data._field0 = 0.0;
+		_data._field4 = 0.0;
 	}
 }
 
 void CStarControlSub20::proc11(CErrorCode &errorCode, FVector &v, const FMatrix &m) {
-	if (_field4 > 0.0) {
+	if (_data._field0 > 0.0) {
 		warning("TODO: CStarControlSub20::proc11");
 	}
 }
@@ -110,26 +110,26 @@ void CStarControlSub20::clear() {
 
 void CStarControlSub20::load(SimpleFile *file, int val) {
 	if (!val) {
-		_field4 = file->readFloat();
-		_field8 = file->readFloat();
-		_fieldC = file->readFloat();
-		_field10 = file->readFloat();
-		_field14 = file->readFloat();
-		_field18 = file->readFloat();
-		_field1C = file->readFloat();
-		_field20 = file->readFloat();
+		_data._field0 = file->readFloat();
+		_data._field4 = file->readFloat();
+		_data._field8 = file->readFloat();
+		_data._fieldC = file->readFloat();
+		_data._field10 = file->readFloat();
+		_data._field14 = file->readFloat();
+		_data._field18 = file->readFloat();
+		_data._field1C = file->readFloat();
 	}
 }
 
 void CStarControlSub20::save(SimpleFile *file, int indent) {
-	file->writeFloatLine(_field4, indent);
-	file->writeFloatLine(_field8, indent);
-	file->writeFloatLine(_fieldC, indent);
-	file->writeFloatLine(_field10, indent);
-	file->writeFloatLine(_field14, indent);
-	file->writeFloatLine(_field18, indent);
-	file->writeFloatLine(_field1C, indent);
-	file->writeFloatLine(_field20, indent);
+	file->writeFloatLine(_data._field0, indent);
+	file->writeFloatLine(_data._field4, indent);
+	file->writeFloatLine(_data._field8, indent);
+	file->writeFloatLine(_data._fieldC, indent);
+	file->writeFloatLine(_data._field10, indent);
+	file->writeFloatLine(_data._field14, indent);
+	file->writeFloatLine(_data._field18, indent);
+	file->writeFloatLine(_data._field1C, indent);
 }
 
 void CStarControlSub20::incLockCount() {
diff --git a/engines/titanic/star_control/star_control_sub20.h b/engines/titanic/star_control/star_control_sub20.h
index eaa9d4f..66e10a8 100644
--- a/engines/titanic/star_control/star_control_sub20.h
+++ b/engines/titanic/star_control/star_control_sub20.h
@@ -29,8 +29,8 @@
 
 namespace Titanic {
 
-class CStarControlSub20 {
-public:
+struct CStar20Data {
+	double _field0;
 	double _field4;
 	double _field8;
 	double _fieldC;
@@ -38,15 +38,19 @@ public:
 	double _field14;
 	double _field18;
 	double _field1C;
-	double _field20;
+};
+
+class CStarControlSub20 {
+public:
+	CStar20Data _data;
 	int _lockCounter;
 	void *_dataP;
 public:
-	CStarControlSub20(void *src);
+	CStarControlSub20(const CStar20Data *src);
 	virtual ~CStarControlSub20();
 
-	virtual void copyFrom1(const void *src);
-	virtual void copyFrom2(const void *src);
+	virtual void copyFrom(const CStar20Data *src);
+	virtual void copyTo(CStar20Data *dest);
 	virtual void proc4();
 	virtual void proc5();
 	virtual void proc6();
diff --git a/engines/titanic/star_control/star_control_sub21.cpp b/engines/titanic/star_control/star_control_sub21.cpp
index 20b8bc5..1730244 100644
--- a/engines/titanic/star_control/star_control_sub21.cpp
+++ b/engines/titanic/star_control/star_control_sub21.cpp
@@ -25,7 +25,7 @@
 
 namespace Titanic {
 
-CStarControlSub21::CStarControlSub21(void *src) :
+CStarControlSub21::CStarControlSub21(const CStar20Data *src) :
 		CStarControlSub20(src), _sub24() {
 }
 
diff --git a/engines/titanic/star_control/star_control_sub21.h b/engines/titanic/star_control/star_control_sub21.h
index 610f26e..5febda0 100644
--- a/engines/titanic/star_control/star_control_sub21.h
+++ b/engines/titanic/star_control/star_control_sub21.h
@@ -32,7 +32,7 @@ class CStarControlSub21 : public CStarControlSub20 {
 private:
 	CStarControlSub24 _sub24;
 public:
-	CStarControlSub21(void *src);
+	CStarControlSub21(const CStar20Data *src);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub22.cpp b/engines/titanic/star_control/star_control_sub22.cpp
index 9298d5b..b06731b 100644
--- a/engines/titanic/star_control/star_control_sub22.cpp
+++ b/engines/titanic/star_control/star_control_sub22.cpp
@@ -25,7 +25,7 @@
 
 namespace Titanic {
 
-CStarControlSub22::CStarControlSub22(void *src) :
+CStarControlSub22::CStarControlSub22(const CStar20Data *src) :
 		CStarControlSub20(src), _sub27() {
 }
 
diff --git a/engines/titanic/star_control/star_control_sub22.h b/engines/titanic/star_control/star_control_sub22.h
index dae231f..88a114f 100644
--- a/engines/titanic/star_control/star_control_sub22.h
+++ b/engines/titanic/star_control/star_control_sub22.h
@@ -32,7 +32,7 @@ class CStarControlSub22 : public CStarControlSub20 {
 private:
 	CStarControlSub27 _sub27;
 public:
-	CStarControlSub22(void *src);
+	CStarControlSub22(const CStar20Data *src);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index 5140dc0..f5d1d36 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -32,10 +32,10 @@ CStarView::CStarView() : _sub12(nullptr, nullptr), _sub13((void *)nullptr),
 		_owner(nullptr), _starField(nullptr), _videoSurface(nullptr), _field118(0), 
 		_videoSurface2(nullptr), _field210(0), _homePhotoMask(nullptr),
 		_field218(0), _field21C(0) {
-	static const uint DATA[8] = { 0, 0, 0x47C35000, 0, 0x41A00000,
+	CStar20Data data = { 0, 0, 0x47C35000, 0, 0x41A00000,
 		0x3F800000, 0x3F800000, 0x3F800000 };
 
-	_sub12.proc3(&DATA[0]);
+	_sub12.proc3(&data);
 }
 
 void CStarView::load(SimpleFile *file, int param) {


Commit: 25e8d1d5a8724b7bb93de2cb3b0253bdb6b66e4c
    https://github.com/scummvm/scummvm/commit/25e8d1d5a8724b7bb93de2cb3b0253bdb6b66e4c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-18T19:28:10-04:00

Commit Message:
TITANIC: Simplify data usage in CStarControlSub20

Changed paths:
    engines/titanic/star_control/star_control_sub20.cpp
    engines/titanic/star_control/star_control_sub20.h



diff --git a/engines/titanic/star_control/star_control_sub20.cpp b/engines/titanic/star_control/star_control_sub20.cpp
index 36e7036..4454ead 100644
--- a/engines/titanic/star_control/star_control_sub20.cpp
+++ b/engines/titanic/star_control/star_control_sub20.cpp
@@ -32,14 +32,14 @@ CStarControlSub20::CStarControlSub20(const CStar20Data *src) {
 	if (src) {
 		copyFrom(src);
 	} else {
-		_data._field0 = 0.0;
-		_data._field4 = 0.0;
-		_data._field8 = 20.0;
-		_data._fieldC = 0.0;
-		_data._field10 = 50000.0;
-		_data._field14 = 1.0;
-		_data._field18 = 1.0;
-		_data._field1C = 0.0;
+		_field0 = 0.0;
+		_field4 = 0.0;
+		_field8 = 20.0;
+		_fieldC = 0.0;
+		_field10 = 50000.0;
+		_field14 = 1.0;
+		_field18 = 1.0;
+		_field1C = 0.0;
 	}
 }
 
@@ -48,50 +48,50 @@ CStarControlSub20::~CStarControlSub20() {
 }
 
 void CStarControlSub20::copyFrom(const CStar20Data *src) {
-	_data = *src;
+	*((CStar20Data *)this) = *src;
 }
 
 void CStarControlSub20::copyTo(CStar20Data *dest) {
-	*dest = _data;
+	*dest = *((CStar20Data *)this);
 }
 
 void CStarControlSub20::proc4() {
-	if (!isLocked() && _data._field0 < _data._field10) {
-		_data._field4 += _data._field0;
-		if (_data._field8 == _data._field4)
-			_data._field0 -= _data._field4;
+	if (!isLocked() && _field0 < _field10) {
+		_field4 += _field0;
+		if (_field8 == _field4)
+			_field0 -= _field4;
 		else
-			_data._field0 += _data._field4;
+			_field0 += _field4;
 	}
 }
 
 void CStarControlSub20::proc5() {
 	if (!isLocked()) {
-		_data._field4 -= _data._field8;
-		if (_data._field4 == _data._field0)
-			_data._field0 += _data._field4;
+		_field4 -= _field8;
+		if (_field4 == _field0)
+			_field0 += _field4;
 		else
-			_data._field0 -= _data._field4;
+			_field0 -= _field4;
 
-		if (_data._field4 < 0.0)
-			_data._field4 = 0.0;
+		if (_field4 < 0.0)
+			_field4 = 0.0;
 	}
 }
 
 void CStarControlSub20::proc6() {
 	if (!isLocked())
-		_data._field0 = _data._field10;
+		_field0 = _field10;
 }
 
 void CStarControlSub20::proc7() {
 	if (!isLocked()) {
-		_data._field0 = 0.0;
-		_data._field4 = 0.0;
+		_field0 = 0.0;
+		_field4 = 0.0;
 	}
 }
 
 void CStarControlSub20::proc11(CErrorCode &errorCode, FVector &v, const FMatrix &m) {
-	if (_data._field0 > 0.0) {
+	if (_field0 > 0.0) {
 		warning("TODO: CStarControlSub20::proc11");
 	}
 }
@@ -110,26 +110,26 @@ void CStarControlSub20::clear() {
 
 void CStarControlSub20::load(SimpleFile *file, int val) {
 	if (!val) {
-		_data._field0 = file->readFloat();
-		_data._field4 = file->readFloat();
-		_data._field8 = file->readFloat();
-		_data._fieldC = file->readFloat();
-		_data._field10 = file->readFloat();
-		_data._field14 = file->readFloat();
-		_data._field18 = file->readFloat();
-		_data._field1C = file->readFloat();
+		_field0 = file->readFloat();
+		_field4 = file->readFloat();
+		_field8 = file->readFloat();
+		_fieldC = file->readFloat();
+		_field10 = file->readFloat();
+		_field14 = file->readFloat();
+		_field18 = file->readFloat();
+		_field1C = file->readFloat();
 	}
 }
 
 void CStarControlSub20::save(SimpleFile *file, int indent) {
-	file->writeFloatLine(_data._field0, indent);
-	file->writeFloatLine(_data._field4, indent);
-	file->writeFloatLine(_data._field8, indent);
-	file->writeFloatLine(_data._fieldC, indent);
-	file->writeFloatLine(_data._field10, indent);
-	file->writeFloatLine(_data._field14, indent);
-	file->writeFloatLine(_data._field18, indent);
-	file->writeFloatLine(_data._field1C, indent);
+	file->writeFloatLine(_field0, indent);
+	file->writeFloatLine(_field4, indent);
+	file->writeFloatLine(_field8, indent);
+	file->writeFloatLine(_fieldC, indent);
+	file->writeFloatLine(_field10, indent);
+	file->writeFloatLine(_field14, indent);
+	file->writeFloatLine(_field18, indent);
+	file->writeFloatLine(_field1C, indent);
 }
 
 void CStarControlSub20::incLockCount() {
diff --git a/engines/titanic/star_control/star_control_sub20.h b/engines/titanic/star_control/star_control_sub20.h
index 66e10a8..359482b 100644
--- a/engines/titanic/star_control/star_control_sub20.h
+++ b/engines/titanic/star_control/star_control_sub20.h
@@ -40,9 +40,8 @@ struct CStar20Data {
 	double _field1C;
 };
 
-class CStarControlSub20 {
+class CStarControlSub20 : public CStar20Data {
 public:
-	CStar20Data _data;
 	int _lockCounter;
 	void *_dataP;
 public:


Commit: 87379442ffb497352915b058b100b688d96a98e9
    https://github.com/scummvm/scummvm/commit/87379442ffb497352915b058b100b688d96a98e9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-18T21:47:19-04:00

Commit Message:
TITANIC: Fix scanning for files not to free resources

Changed paths:
    engines/titanic/support/files_manager.cpp



diff --git a/engines/titanic/support/files_manager.cpp b/engines/titanic/support/files_manager.cpp
index c415731..1d2b1d9 100644
--- a/engines/titanic/support/files_manager.cpp
+++ b/engines/titanic/support/files_manager.cpp
@@ -86,14 +86,16 @@ bool CFilesManager::scanForFile(const CString &name) {
 		fname += ".st";
 	}
 
+	// Return true if the file exists
+	if (fileExists(fname))
+		return true;
+
+	// Couldn't find file. Start by calling the game manager's viewChange
+	// method, which handles all active scene objects freeing their resources
 	if (_gameManager)
 		_gameManager->viewChange();
 
-	// The original had a bunch of code here handling determining
-	// which asset path, if any, the filename was present for,
-	// and storing the "active asset path" it was found on.
-	// This is redundant for ScummVM, which takes care of the paths
-	return fileExists(fname);
+	return false;
 }
 
 void CFilesManager::loadDrive() {


Commit: 18e06f727ab55eb232a8f97c09cb9950b29eeef8
    https://github.com/scummvm/scummvm/commit/18e06f727ab55eb232a8f97c09cb9950b29eeef8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-18T21:51:50-04:00

Commit Message:
TITANIC: Fix loading of movies with only a single video track

Changed paths:
    engines/titanic/support/avi_surface.cpp



diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index b685fa8..7779baf 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -74,6 +74,7 @@ AVISurface::AVISurface(const CResourceKey &key) {
 		++_streamCount;
 	} else {
 		delete decoder2;
+		_decoders[1] = nullptr;
 	}
 }
 


Commit: 2ea4116e0ac29c73cad891cb194e16ba645786fa
    https://github.com/scummvm/scummvm/commit/2ea4116e0ac29c73cad891cb194e16ba645786fa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-18T22:32:28-04:00

Commit Message:
TITANIC: gcc compilation fixes

Changed paths:
    engines/titanic/pet_control/pet_drag_chev.cpp
    engines/titanic/star_control/star_control_sub20.cpp
    engines/titanic/star_control/star_control_sub20.h
    engines/titanic/star_control/star_control_sub5.h
    engines/titanic/support/avi_surface.h



diff --git a/engines/titanic/pet_control/pet_drag_chev.cpp b/engines/titanic/pet_control/pet_drag_chev.cpp
index beaac4e..d437d43 100644
--- a/engines/titanic/pet_control/pet_drag_chev.cpp
+++ b/engines/titanic/pet_control/pet_drag_chev.cpp
@@ -28,7 +28,9 @@
 namespace Titanic {
 
 BEGIN_MESSAGE_MAP(CPetDragChev, CPetGraphic2)
-
+	ON_MESSAGE(MouseDragStartMsg)
+	ON_MESSAGE(MouseDragMoveMsg)
+	ON_MESSAGE(MouseDragEndMsg)
 END_MESSAGE_MAP()
 
 void CPetDragChev::save(SimpleFile *file, int indent) {
diff --git a/engines/titanic/star_control/star_control_sub20.cpp b/engines/titanic/star_control/star_control_sub20.cpp
index 4454ead..5c6c243 100644
--- a/engines/titanic/star_control/star_control_sub20.cpp
+++ b/engines/titanic/star_control/star_control_sub20.cpp
@@ -98,7 +98,7 @@ void CStarControlSub20::proc11(CErrorCode &errorCode, FVector &v, const FMatrix
 
 void CStarControlSub20::setData(void *data) {
 	clear();
-	_dataP = data;
+	_dataP = (byte *)data;
 }
 
 void CStarControlSub20::clear() {
diff --git a/engines/titanic/star_control/star_control_sub20.h b/engines/titanic/star_control/star_control_sub20.h
index 359482b..9dbabbb 100644
--- a/engines/titanic/star_control/star_control_sub20.h
+++ b/engines/titanic/star_control/star_control_sub20.h
@@ -43,7 +43,7 @@ struct CStar20Data {
 class CStarControlSub20 : public CStar20Data {
 public:
 	int _lockCounter;
-	void *_dataP;
+	byte *_dataP;
 public:
 	CStarControlSub20(const CStar20Data *src);
 	virtual ~CStarControlSub20();
diff --git a/engines/titanic/star_control/star_control_sub5.h b/engines/titanic/star_control/star_control_sub5.h
index 8007f83..ce92ef1 100644
--- a/engines/titanic/star_control/star_control_sub5.h
+++ b/engines/titanic/star_control/star_control_sub5.h
@@ -44,6 +44,7 @@ private:
 	int _field78B0;
 public:
 	CStarControlSub5();
+	virtual ~CStarControlSub5() {}
 
 	virtual bool setup();
 	virtual void proc2();
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index f74f6a8..32db925 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -84,7 +84,7 @@ public:
 	double _frameRate;
 public:
 	AVISurface(const CResourceKey &key);
-	~AVISurface();
+	virtual ~AVISurface();
 
 	/**
 	 * Start playing the loaded AVI video


Commit: 53c7517dfbae96fe99b7a8e7a32298526e46baa1
    https://github.com/scummvm/scummvm/commit/53c7517dfbae96fe99b7a8e7a32298526e46baa1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-19T22:41:03-04:00

Commit Message:
TITANIC: Fix loading movies for playback

Changed paths:
    engines/titanic/core/game_object.cpp



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index f0f0980..3dad7c2 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -508,7 +508,7 @@ void CGameObject::petSetRemoteTarget() {
 void CGameObject::playMovie(uint flags) {
 	_frameNumber = -1;
 
-	if (_surface && !_resource.empty()) {
+	if (!_surface && !_resource.empty()) {
 		loadResource(_resource);
 		_resource.clear();
 	}


Commit: d5bf17e73ff9533d2f54588622048ab755f4151b
    https://github.com/scummvm/scummvm/commit/d5bf17e73ff9533d2f54588622048ab755f4151b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-20T07:38:13-04:00

Commit Message:
TITANIC: Add movie _handled flag, simplify frame timinig code

Changed paths:
    engines/titanic/game_manager.cpp
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/avi_surface.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 84306b4..7e6916a 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -192,14 +192,20 @@ void CGameManager::update() {
 }
 
 void CGameManager::updateMovies() {
+	// Initial iteration to mark all the movies as not yet handled
+	for (CMovieList::iterator i = CMovie::_playingMovies->begin();
+			i != CMovie::_playingMovies->end(); ++i)
+		(*i)->_handled = false;
+
 	bool repeatFlag;
 	do {
 		repeatFlag = false;
 
+		// Scan for a movie to process
 		for (CMovieList::iterator i = CMovie::_playingMovies->begin();
-				i != CMovie::_playingMovies->end(); ) {
+				i != CMovie::_playingMovies->end(); ++i) {
 			CMovie *movie = *i;
-			if (movie->_state)
+			if (movie->_handled)
 				continue;
 
 			CMovieEventList eventsList;
@@ -229,8 +235,9 @@ void CGameManager::updateMovies() {
 				eventsList.remove(movieEvent);
 			}
 
+			// Flag the movie as having been handled
+			movie->_handled = true;
 			repeatFlag = true;
-			movie->_state = MSTATE_1;
 			break;
 		}
 	} while (repeatFlag);
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 7779baf..38bccaf 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -260,10 +260,13 @@ int AVISurface::getFrame() const {
 	return _decoders[0]->getCurFrame();
 }
 
+bool AVISurface::isFrameReady() const {
+	return _decoders[0]->needsUpdate() && (!_decoders[1] || _decoders[1]->needsUpdate());
+}
+
 bool AVISurface::renderFrame() {
 	// Check there's a frame ready for display
-	assert(_videoSurface);
-	if (!_decoders[0]->needsUpdate() || (_decoders[1] && !_decoders[1]->needsUpdate()))
+	if (!isFrameReady())
 		return false;
 
 	// Decode each decoder's video stream into the appropriate surface
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index 32db925..dfd4c59 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -162,6 +162,11 @@ public:
 	 * Duplicates the secondary frame, if the movie has a second video track
 	 */
 	Graphics::ManagedSurface *duplicateSecondaryFrame() const;
+
+	/**
+	 * Returns true if a frame is ready to be rendered
+	 */
+	bool isFrameReady() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index b98a5b5..2943ee1 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -36,7 +36,7 @@ namespace Titanic {
 CMovieList *CMovie::_playingMovies;
 CVideoSurface *CMovie::_movieSurface;
 
-CMovie::CMovie() : ListItem(), _state(MSTATE_0), _field10(0),
+CMovie::CMovie() : ListItem(), _handled(false), _field10(0),
 		_field14(0) {
 }
 
@@ -84,9 +84,6 @@ OSMovie::OSMovie(const CResourceKey &name, CVideoSurface *surface) :
 	_field24 = 0;
 	_field28 = 0;
 	_field2C = 0;
-	_ticksStart = 0;
-	_frameTime1 = 0;
-	_frameTime2 = 17066;
 
 	surface->resize(_aviSurface.getWidth(), _aviSurface.getHeight());
 	_aviSurface.setVideoSurface(surface);
@@ -165,25 +162,13 @@ void OSMovie::setFrame(uint frameNumber) {
 bool OSMovie::handleEvents(CMovieEventList &events) {
 	if (!_aviSurface._isPlaying)
 		return false;
-
-	int time = (g_vm->_events->getTicksCount() + ((_ticksStart << 24) - _ticksStart)) << 8;
-	if (time < _frameTime1)
+	if (!_aviSurface.isFrameReady())
 		return _aviSurface._isPlaying;
 
-	if (!_field14 && (time - _frameTime1) > (_frameTime2 * 2))
-		_frameTime1 = time;
-
-	_frameTime1 += _frameTime2;
-	_aviSurface.handleEvents(events);
-	_videoSurface->setMovieFrameSurface(_aviSurface.getSecondarySurface());
-
-	if (_field14) {
-		while (_frameTime1 >= time && events.empty()) {
-			_aviSurface.handleEvents(events);
-			_videoSurface->setMovieFrameSurface(_aviSurface.getSecondarySurface());
-
-			_frameTime1 += _frameTime2;
-		}
+	// Handle updating the frame
+	while (_aviSurface.isFrameReady()) {
+		_aviSurface.handleEvents(events);
+		_videoSurface->setMovieFrameSurface(_aviSurface.getSecondarySurface());
 	}
 
 	return _aviSurface._isPlaying;
@@ -202,9 +187,6 @@ int OSMovie::getFrame() const {
 }
 
 void OSMovie::movieStarted() {
-	_frameTime1 = _frameTime2 = 256000.0 / _aviSurface._frameRate;
-	_ticksStart = g_vm->_events->getTicksCount();
-
 	if (_aviSurface._hasAudio)
 		_aviSurface._soundManager->movieStarted();
 
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index b6c2a09..feb320f 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -32,10 +32,6 @@
 
 namespace Titanic {
 
-enum MovieState { 
-	MSTATE_0 = 0, MSTATE_1 = 1
-};
-
 class CGameObject;
 class CMovie;
 class CSoundManager;
@@ -52,7 +48,7 @@ protected:
 	 */
 	void addToPlayingMovies();
 public:
-	MovieState _state;
+	bool _handled;
 	int _field10;
 	int _field14;
 public:
@@ -158,9 +154,6 @@ private:
 	int _field24;
 	int _field28;
 	int _field2C;
-	int _ticksStart;
-	int _frameTime1;
-	int _frameTime2;
 private:
 	/**
 	 * Called when a movie is started playing


Commit: c5792fce4bcf8a4e2e89d83242a248a56f579bc6
    https://github.com/scummvm/scummvm/commit/c5792fce4bcf8a4e2e89d83242a248a56f579bc6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-20T07:56:26-04:00

Commit Message:
TITANIC: Clarify movie/surface has frame fields & variables

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/pet_control/pet_gfx_element.cpp
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie.h
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 3dad7c2..5d913eb 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -240,7 +240,7 @@ void CGameObject::draw(CScreenManager *screenManager) {
 }
 
 Rect CGameObject::getBounds() const {
-	return (_surface && _surface->proc45()) ? _bounds : Rect();
+	return (_surface && _surface->hasFrame()) ? _bounds : Rect();
 }
 
 void CGameObject::viewChange() {
@@ -618,8 +618,8 @@ int CGameObject::getMovieFrame() const {
 	return _initialFrame;
 }
 
-int CGameObject::getSurface45() const {
-	return _surface ? _surface->proc45() : 0;
+bool CGameObject::surfaceHasFrame() const {
+	return _surface ? _surface->hasFrame() : false;
 }
 
 void CGameObject::loadSound(const CString &name) {
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index b74c35f..3f77776 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -639,7 +639,11 @@ public:
 	 */
 	int getPriorClass() const;
 
-	int getSurface45() const;
+	/**
+	 * Returns true if there's an attached surface which has a frame
+	 * ready for display
+	 */
+	bool surfaceHasFrame() const;
 
 	/**
 	 * Finds an item in various system areas
diff --git a/engines/titanic/pet_control/pet_gfx_element.cpp b/engines/titanic/pet_control/pet_gfx_element.cpp
index 511fb5e..9fc0c2a 100644
--- a/engines/titanic/pet_control/pet_gfx_element.cpp
+++ b/engines/titanic/pet_control/pet_gfx_element.cpp
@@ -81,7 +81,7 @@ Rect CPetGfxElement::getBounds() const {
 	if (!obj)
 		obj = _object0;
 
-	if (obj && obj->getSurface45())
+	if (obj && obj->surfaceHasFrame())
 		return _bounds;
 	else
 		return Rect();
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 2943ee1..3856c44 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -36,7 +36,7 @@ namespace Titanic {
 CMovieList *CMovie::_playingMovies;
 CVideoSurface *CMovie::_movieSurface;
 
-CMovie::CMovie() : ListItem(), _handled(false), _field10(0),
+CMovie::CMovie() : ListItem(), _handled(false), _hasVideoFrame(false),
 		_field14(0) {
 }
 
@@ -67,9 +67,9 @@ bool CMovie::isActive() const {
 	return _playingMovies->contains(this);
 }
 
-bool CMovie::get10() {
-	if (_field10) {
-		_field10 = 0;
+bool CMovie::hasVideoFrame() {
+	if (_hasVideoFrame) {
+		_hasVideoFrame = 0;
 		return true;
 	} else {
 		return false;
@@ -171,6 +171,9 @@ bool OSMovie::handleEvents(CMovieEventList &events) {
 		_videoSurface->setMovieFrameSurface(_aviSurface.getSecondarySurface());
 	}
 
+	// Flag there's a video frame
+	_hasVideoFrame = true;
+
 	return _aviSurface._isPlaying;
 }
 
@@ -192,7 +195,7 @@ void OSMovie::movieStarted() {
 
 	// Register the movie in the playing list
 	addToPlayingMovies();
-	_field10 = 1;
+	_hasVideoFrame = true;
 }
 
 void OSMovie::setFrameRate(double rate) {
diff --git a/engines/titanic/support/movie.h b/engines/titanic/support/movie.h
index feb320f..2a7d589 100644
--- a/engines/titanic/support/movie.h
+++ b/engines/titanic/support/movie.h
@@ -49,7 +49,7 @@ protected:
 	void addToPlayingMovies();
 public:
 	bool _handled;
-	int _field10;
+	bool _hasVideoFrame;
 	int _field14;
 public:
 	static CMovieList *_playingMovies;
@@ -143,7 +143,10 @@ public:
 	 */
 	bool isActive() const;
 
-	bool get10();
+	/**
+	 * Returns true if there's a video frame
+	 */
+	bool hasVideoFrame();
 };
 
 class OSMovie : public CMovie {
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 4169a80..49388b6 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -33,7 +33,7 @@ CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
 		_screenManager(screenManager), _rawSurface(nullptr), _movie(nullptr),
 		_pendingLoad(false), _transBlitFlag(false), _fastBlitFlag(false),
 		_movieFrameSurface(nullptr), _transparencyMode(TRANS_DEFAULT), 
-		_field48(0), _field50(1), _lockCount(0) {
+		_field48(0), _hasFrame(true), _lockCount(0) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
 }
 
@@ -170,12 +170,12 @@ uint CVideoSurface::getTransparencyColor() {
 	return val;
 }
 
-bool CVideoSurface::proc45() {
-	if (_field50) {
-		_field50 = 0;
+bool CVideoSurface::hasFrame() {
+	if (_hasFrame) {
+		_hasFrame = false;
 		return true;
 	} else if (_movie) {
-		return _movie->get10();
+		return _movie->hasVideoFrame();
 	} else {
 		return false;
 	}
@@ -519,7 +519,7 @@ bool OSVideoSurface::loadIfReady() {
 	if (hasSurface()) {
 		return true;
 	} else if (_pendingLoad) {
-		_field50 = 1;
+		_hasFrame = true;
 		load();
 		return true;
 	} else {
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 040161f..0e777ba 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -67,7 +67,7 @@ protected:
 	Graphics::ManagedSurface *_movieFrameSurface;
 	int _field48;
 	int _videoSurfaceNum;
-	int _field50;
+	bool _hasFrame;
 	int _lockCount;
 public:
 	CMovie *_movie;
@@ -257,7 +257,10 @@ public:
 	 */
 	virtual void transPixelate() = 0;
 
-	virtual bool proc45();
+	/**
+	 * Returns true if there's a frame to display on the video surface
+	 */
+	virtual bool hasFrame();
 
 	/**
 	 * Duplicates movie frame surface


Commit: a13134b38d1400bfc6746657faf87907f9575e80
    https://github.com/scummvm/scummvm/commit/a13134b38d1400bfc6746657faf87907f9575e80
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-20T13:44:19-04:00

Commit Message:
TITANIC: Clarify CVideoSurface _field48 as _freeMovieSurface

Changed paths:
    engines/titanic/support/video_surface.cpp
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index 49388b6..594f660 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -33,7 +33,7 @@ CVideoSurface::CVideoSurface(CScreenManager *screenManager) :
 		_screenManager(screenManager), _rawSurface(nullptr), _movie(nullptr),
 		_pendingLoad(false), _transBlitFlag(false), _fastBlitFlag(false),
 		_movieFrameSurface(nullptr), _transparencyMode(TRANS_DEFAULT), 
-		_field48(0), _hasFrame(true), _lockCount(0) {
+		_freeMovieSurface(DisposeAfterUse::NO), _hasFrame(true), _lockCount(0) {
 	_videoSurfaceNum = _videoSurfaceCounter++;
 }
 
@@ -41,6 +41,9 @@ CVideoSurface::~CVideoSurface() {
 	if (_ddSurface)
 		_videoSurfaceCounter -= freeSurface();
 	--_videoSurfaceCounter;
+
+	if (_freeMovieSurface == DisposeAfterUse::YES)
+		delete _movieFrameSurface;
 }
 
 void CVideoSurface::setSurface(CScreenManager *screenManager, DirectDrawSurface *surface) {
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 0e777ba..1f3a0fa 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -65,7 +65,7 @@ protected:
 	Graphics::ManagedSurface *_rawSurface;
 	bool _pendingLoad;
 	Graphics::ManagedSurface *_movieFrameSurface;
-	int _field48;
+	DisposeAfterUse::Flag _freeMovieSurface;
 	int _videoSurfaceNum;
 	bool _hasFrame;
 	int _lockCount;


Commit: 1102203396b8e924991fd0dc9990004b5d7f2e63
    https://github.com/scummvm/scummvm/commit/1102203396b8e924991fd0dc9990004b5d7f2e63
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-20T18:49:41-04:00

Commit Message:
TITANIC: Add missing engine saving functionality

Changed paths:
    engines/titanic/core/project_item.cpp
    engines/titanic/detection.cpp



diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index a768d0e..6596816 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -160,7 +160,7 @@ void CProjectItem::loadGame(int slotId) {
 	// Open either an existing savegame slot or the new game template
 	if (slotId >= 0) {
 		Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(
-			Common::String::format("slot%d.gam", slotId));
+			g_vm->generateSaveName(slotId));
 		file.open(saveFile);
 	} else {
 		Common::File *newFile = new Common::File();
@@ -202,7 +202,7 @@ void CProjectItem::loadGame(int slotId) {
 void CProjectItem::saveGame(int slotId, const CString &desc) {
 	CompressedFile file;
 	Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(
-		Common::String::format("slot%d.gam", slotId));
+		g_vm->generateSaveName(slotId));
 	file.open(saveFile);
 
 	// Signal the game is being saved
diff --git a/engines/titanic/detection.cpp b/engines/titanic/detection.cpp
index 70fe25d..ca4db96 100644
--- a/engines/titanic/detection.cpp
+++ b/engines/titanic/detection.cpp
@@ -21,6 +21,8 @@
  */
 
 #include "titanic/titanic.h"
+#include "titanic/core/project_item.h"
+#include "titanic/support/simple_file.h"
 
 #include "base/plugins.h"
 #include "common/savefile.h"
@@ -106,7 +108,40 @@ bool TitanicMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADG
 }
 
 SaveStateList TitanicMetaEngine::listSaves(const char *target) const {
+	Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+	Common::StringArray filenames;
+	Common::String saveDesc;
+	Common::String pattern = Common::String::format("%s.0##", target);
+	Titanic::TitanicSavegameHeader header;
+
+	filenames = saveFileMan->listSavefiles(pattern);
+
 	SaveStateList saveList;
+	for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
+		const char *ext = strrchr(file->c_str(), '.');
+		int slot = ext ? atoi(ext + 1) : -1;
+
+		if (slot >= 0 && slot < MAX_SAVES) {
+			Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(*file);
+
+			if (in) {
+				Titanic::CompressedFile file;
+				file.open(in);
+				Titanic::CProjectItem::readSavegameHeader(&file, header);
+				saveList.push_back(SaveStateDescriptor(slot, header._saveName));
+
+				if (header._thumbnail) {
+					header._thumbnail->free();
+					delete header._thumbnail;
+				}
+
+				file.close();
+			}
+		}
+	}
+
+	// Sort saves based on slot number.
+	Common::sort(saveList.begin(), saveList.end(), SaveStateDescriptorSlotComparator());
 	return saveList;
 }
 
@@ -115,9 +150,33 @@ int TitanicMetaEngine::getMaximumSaveSlot() const {
 }
 
 void TitanicMetaEngine::removeSaveState(const char *target, int slot) const {
+	Common::String filename = Common::String::format("%s.%03d", target, slot);
+	g_system->getSavefileManager()->removeSavefile(filename);
 }
 
 SaveStateDescriptor TitanicMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+	Common::String filename = Common::String::format("%s.%03d", target, slot);
+	Common::InSaveFile *f = g_system->getSavefileManager()->openForLoading(filename);
+
+	if (f) {
+		Titanic::CompressedFile file;
+		file.open(f);
+
+		Titanic::TitanicSavegameHeader header;
+		Titanic::CProjectItem::readSavegameHeader(&file, header);
+
+		file.close();
+
+		// Create the return descriptor
+		SaveStateDescriptor desc(slot, header._saveName);
+		desc.setThumbnail(header._thumbnail);
+		desc.setSaveDate(header._year, header._month, header._day);
+		desc.setSaveTime(header._hour, header._minute);
+		desc.setPlayTime(header._totalFrames * GAME_FRAME_TIME);
+
+		return desc;
+	}
+
 	return SaveStateDescriptor();
 }
 


Commit: 543434aa78fd46a73ba169a773259cf71451e0c5
    https://github.com/scummvm/scummvm/commit/543434aa78fd46a73ba169a773259cf71451e0c5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-20T19:03:30-04:00

Commit Message:
TITANIC: Fix destroying previous game project when loading savegame

Changed paths:
    engines/titanic/core/tree_item.cpp
    engines/titanic/core/tree_item.h



diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index de3d87e..5fcd74b 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -213,16 +213,16 @@ void CTreeItem::moveUnder(CTreeItem *newParent) {
 }
 
 void CTreeItem::destroyAll() {
-	destroyOthers();
+	destroyChildren();
 	detach();
 	delete this;
 }
 
-int CTreeItem::destroyOthers() {
+int CTreeItem::destroyChildren() {
 	if (!_firstChild)
 		return 0;
 
-	CTreeItem *item = this, *child, *nextSibling;
+	CTreeItem *item = _firstChild, *child, *nextSibling;
 	int total = 0;
 
 	do {
@@ -230,9 +230,9 @@ int CTreeItem::destroyOthers() {
 		nextSibling = item->_nextSibling;
 
 		if (child)
-			total += child->destroyOthers();
-		child->detach();
-		delete child;
+			total += item->destroyChildren();
+		item->detach();
+		delete item;
 		++total;
 	} while ((item = nextSibling) != nullptr);
 
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 49a3fa7..46d7996 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -233,9 +233,10 @@ public:
 	void destroyAll();
 
 	/**
-	 * Destroys all tree items around the given one
+	 * Destroys all child tree items under this one.
+	 * @returns		Total number of tree items recursively removed
 	 */
-	int destroyOthers();
+	int destroyChildren();
 
 	/**
 	 * Detach the tree item from any other associated tree items


Commit: 2db54279e95da5b3ed72b02fe840648b2ce3accd
    https://github.com/scummvm/scummvm/commit/2db54279e95da5b3ed72b02fe840648b2ce3accd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-20T20:12:45-04:00

Commit Message:
TITANIC: Fixes for saving/loading savegame headers

Changed paths:
    engines/titanic/core/project_item.cpp



diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 6596816..9448aae 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -202,7 +202,7 @@ void CProjectItem::loadGame(int slotId) {
 void CProjectItem::saveGame(int slotId, const CString &desc) {
 	CompressedFile file;
 	Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(
-		g_vm->generateSaveName(slotId));
+		g_vm->generateSaveName(slotId), false);
 	file.open(saveFile);
 
 	// Signal the game is being saved
@@ -529,7 +529,7 @@ void CProjectItem::writeSavegameHeader(SimpleFile *file, TitanicSavegameHeader &
 	file->writeUint16LE(td.tm_mday);
 	file->writeUint16LE(td.tm_hour);
 	file->writeUint16LE(td.tm_min);
-	file->writeUint16LE(g_vm->_events->getFrameCounter());
+	file->writeUint32LE(g_vm->_events->getFrameCounter());
 }
 
 Graphics::Surface *CProjectItem::createThumbnail() {


Commit: 0ed7b463e885e499f2603b6bd3e49929c45af84a
    https://github.com/scummvm/scummvm/commit/0ed7b463e885e499f2603b6bd3e49929c45af84a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-20T21:51:44-04:00

Commit Message:
TITANIC: Fixes for saving & loading savegames

Changed paths:
    engines/titanic/core/project_item.cpp
    engines/titanic/core/room_item.cpp
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/moves/exit_bridge.cpp
    engines/titanic/star_control/star_control.cpp
    engines/titanic/true_talk/tt_npc_script.cpp



diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 9448aae..4fd2ea2 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -69,6 +69,10 @@ void CProjectItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(_nextObjectNumber, indent);
 	file->writeQuotedLine("Next Avail. Message Number", indent);
 	file->writeNumberLine(_nextMessageNumber, indent);
+
+	file->writeQuotedLine("", indent);
+	_files.save(file, indent);
+
 	file->writeQuotedLine("Next Avail. Room Number", indent);
 	file->writeNumberLine(_nextRoomNumber, indent);
 
@@ -216,6 +220,9 @@ void CProjectItem::saveGame(int slotId, const CString &desc) {
 	// Save the contents out
 	saveData(&file, this);
 
+	// Save the game manager data
+	_gameManager->save(&file);
+
 	// Close the file and signal that the saving has finished
 	file.close();
 	postSave();
diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp
index 78bd678..a88238d 100644
--- a/engines/titanic/core/room_item.cpp
+++ b/engines/titanic/core/room_item.cpp
@@ -35,6 +35,7 @@ void CRoomItem::save(SimpleFile *file, int indent) {
 	file->writeQuotedLine("Exit Movies", indent);
 	_exitMovieKey.save(file, indent);
 
+	file->writeQuotedLine("Room dimensions x 1000", indent);
 	file->writeNumberLine(_roomDimensionX * 1000.0, indent + 1);
 	file->writeNumberLine(_roomDimensionY * 1000.0, indent + 1);
 
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 7e6916a..0670499 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -56,6 +56,14 @@ CGameManager::~CGameManager() {
 	_project->resetGameManager();
 }
 
+void CGameManager::save(SimpleFile *file) {
+	file->writeNumber(_lastDiskTicksCount);
+	_gameState.save(file);
+	_timers.save(file, 0);
+	_trueTalkManager.save(file);
+	_sound.save(file);
+}
+
 void CGameManager::load(SimpleFile *file) {
 	file->readNumber();
 
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 179e6cd..129ce6b 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -82,6 +82,11 @@ public:
 	~CGameManager();
 
 	/**
+	 * Save data to a save file
+	 */
+	void save(SimpleFile *file);
+
+	/**
 	 * Load data from a save file
 	 */
 	void load(SimpleFile *file);
diff --git a/engines/titanic/moves/exit_bridge.cpp b/engines/titanic/moves/exit_bridge.cpp
index 2ff56d3..b913911 100644
--- a/engines/titanic/moves/exit_bridge.cpp
+++ b/engines/titanic/moves/exit_bridge.cpp
@@ -29,6 +29,8 @@ CExitBridge::CExitBridge() : CMovePlayerTo() {
 
 void CExitBridge::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
+	file->writeQuotedLine(_string1, indent);
+
 	CMovePlayerTo::save(file, indent);
 }
 
diff --git a/engines/titanic/star_control/star_control.cpp b/engines/titanic/star_control/star_control.cpp
index 3324d17..18876ad 100644
--- a/engines/titanic/star_control/star_control.cpp
+++ b/engines/titanic/star_control/star_control.cpp
@@ -50,7 +50,7 @@ CStarControl::~CStarControl() {
 }
 
 void CStarControl::save(SimpleFile *file, int indent) {
-	file->writeNumberLine(1, indent);
+	file->writeNumberLine(0, indent);
 	_starField.save(file, indent);
 	_view.save(file, indent);
 	CGameObject::save(file, indent);
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 8289b53..7095391 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -392,10 +392,10 @@ void TTnpcScript::load(SimpleFile *file) {
 }
 
 void TTnpcScript::saveBody(SimpleFile *file) {
-	int v = proc31();
-	file->writeNumber(v);
+	int count = proc31();
+	file->writeNumber(count);
 
-	if (v > 0) {
+	if (count > 0) {
 		for (uint idx = 0; idx < _ranges.size(); ++idx) {
 			const TTscriptRange &item = _ranges[idx];
 			if (item._mode == SF_RANDOM && item._priorIndex) {
@@ -411,12 +411,13 @@ void TTnpcScript::loadBody(SimpleFile *file) {
 	preLoad();
 
 	for (int index = 0; index < count; index += 2) {
-		int v = file->readNumber();
+		int id = file->readNumber();
+		int val = file->readNumber();
 
 		for (uint idx = 0; idx < _ranges.size(); ++idx) {
 			TTscriptRange &item = _ranges[idx];
-			if (!item._id) {
-				item._id = v;
+			if (item._id == id) {
+				item._priorIndex = val;
 				break;
 			}
 		}


Commit: 4ff421570679621db76cca59315a036bf64a6550
    https://github.com/scummvm/scummvm/commit/4ff421570679621db76cca59315a036bf64a6550
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-20T22:23:42-04:00

Commit Message:
TITANIC: Display first 5 savegame slots in PET RealLife tab

Changed paths:
    engines/titanic/pet_control/pet_load_save.cpp



diff --git a/engines/titanic/pet_control/pet_load_save.cpp b/engines/titanic/pet_control/pet_load_save.cpp
index 0ae9f3f..17e6f5e 100644
--- a/engines/titanic/pet_control/pet_load_save.cpp
+++ b/engines/titanic/pet_control/pet_load_save.cpp
@@ -23,6 +23,7 @@
 #include "titanic/pet_control/pet_load_save.h"
 #include "titanic/pet_control/pet_control.h"
 #include "titanic/core/project_item.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -53,6 +54,7 @@ bool CPetLoadSave::setup(CPetControl *petControl, CPetGlyphs *owner) {
 
 bool CPetLoadSave::reset() {
 	highlightChange();
+	resetSlots();
 
 	CPetControl *pet = getPetControl();
 	if (pet) {
@@ -124,14 +126,29 @@ Rect CPetLoadSave::getSlotBounds(int index) {
 }
 
 void CPetLoadSave::resetSlots() {
-	CPetControl *pet = getPetControl();
-	CProjectItem *project = pet ? pet->getRoot() : nullptr;
-
 	for (int idx = 0; idx < SAVEGAME_SLOTS_COUNT; ++idx) {
 		_slotNames[idx].setText("Empty");
 
-		if (project) {
-			warning("TODO: Get savegame name");
+		// Try and open up the savegame for access
+		Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(
+			g_vm->generateSaveName(idx));
+
+		if (in) {
+			// Read in the savegame header data
+			CompressedFile file;
+			file.open(in);
+
+			TitanicSavegameHeader header;
+			CProjectItem::readSavegameHeader(&file, header);
+			if (header._thumbnail) {
+				header._thumbnail->free();
+				delete header._thumbnail;
+			}
+
+			file.close();
+
+			// Set the name text
+			_slotNames[idx].setText(header._saveName);
 		}
 	}
 


Commit: 41a3c83bc6444550c9e4ea1a5918450403e0e5ee
    https://github.com/scummvm/scummvm/commit/41a3c83bc6444550c9e4ea1a5918450403e0e5ee
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-22T12:44:14-04:00

Commit Message:
TITANIC: Fleshing out PET RealLife Load functionality

Changed paths:
    engines/titanic/game_manager.cpp
    engines/titanic/game_manager.h
    engines/titanic/pet_control/pet_load.cpp
    engines/titanic/pet_control/pet_load.h
    engines/titanic/pet_control/pet_load_save.cpp
    engines/titanic/pet_control/pet_load_save.h
    engines/titanic/pet_control/pet_save.cpp
    engines/titanic/pet_control/pet_save.h



diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 0670499..2f83bca 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -47,13 +47,16 @@ CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
 CGameManager::~CGameManager() {
 	delete _movie;
 	delete _movieSurface;
+	destroyTreeItem();
 
+	_project->resetGameManager();
+}
+
+void CGameManager::destroyTreeItem() {
 	if (_treeItem) {
 		_treeItem->destroyAll();
 		_treeItem = nullptr;
 	}
-
-	_project->resetGameManager();
 }
 
 void CGameManager::save(SimpleFile *file) {
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 129ce6b..4808b26 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -82,6 +82,11 @@ public:
 	~CGameManager();
 
 	/**
+	 * Destroys and allocated tree item
+	 */
+	void destroyTreeItem();
+
+	/**
 	 * Save data to a save file
 	 */
 	void save(SimpleFile *file);
diff --git a/engines/titanic/pet_control/pet_load.cpp b/engines/titanic/pet_control/pet_load.cpp
index f4be690..cb3514e 100644
--- a/engines/titanic/pet_control/pet_load.cpp
+++ b/engines/titanic/pet_control/pet_load.cpp
@@ -22,6 +22,8 @@
 
 #include "titanic/pet_control/pet_load.h"
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/core/project_item.h"
+#include "titanic/game_manager.h"
 
 namespace Titanic {
 
@@ -38,12 +40,36 @@ bool CPetLoad::reset() {
 	return true;
 }
 
+bool CPetLoad::MouseButtonUpMsg(const Point &pt) {
+	if (_btnLoadSave.MouseButtonUpMsg(pt)) {
+		execute();
+		return true;
+	} else {
+		return false;
+	}
+}
+
 void CPetLoad::getTooltip(CPetText *text) {
 	text->setText("Load the game.");
 }
 
 void CPetLoad::execute() {
-	warning("TODO: CPetLoad::execute");
+	CPetControl *pet = getPetControl();
+
+	if (_savegameSlotNum >= 0 && _slotInUse[_savegameSlotNum]) {
+		CProjectItem *project = pet ? pet->getRoot() : nullptr;
+		CGameManager *gameManager = project ? project->getGameManager() : nullptr;
+
+		if (project && gameManager) {
+			pet->displayMessage("Loading the selected game, please wait.");
+
+			gameManager->destroyTreeItem();
+			gameManager->initBounds();
+			project->loadGame(_savegameSlotNum);
+		}
+	} else if (pet) {
+		pet->displayMessage("You must select a game to load first.");
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_load.h b/engines/titanic/pet_control/pet_load.h
index f87cd8a..ad0b026 100644
--- a/engines/titanic/pet_control/pet_load.h
+++ b/engines/titanic/pet_control/pet_load.h
@@ -35,6 +35,11 @@ public:
 	virtual bool reset();
 	
 	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt);
+
+	/**
 	 * Highlight any currently highlighted element
 	 */
 	virtual void highlightCurrent() { resetSlots(); }
diff --git a/engines/titanic/pet_control/pet_load_save.cpp b/engines/titanic/pet_control/pet_load_save.cpp
index 17e6f5e..77b6126 100644
--- a/engines/titanic/pet_control/pet_load_save.cpp
+++ b/engines/titanic/pet_control/pet_load_save.cpp
@@ -81,16 +81,6 @@ bool CPetLoadSave::MouseButtonDownMsg(const Point &pt) {
 	return false;
 }
 
-bool CPetLoadSave::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
-	if (_btnLoadSave.MouseButtonUpMsg(msg->_mousePos)) {
-		execute();
-		resetSlots();
-		return true;
-	} else {
-		return false;
-	}
-}
-
 bool CPetLoadSave::KeyCharMsg(Common::KeyCode key) {
 	switch (key) {
 	case Common::KEYCODE_TAB:
@@ -128,6 +118,7 @@ Rect CPetLoadSave::getSlotBounds(int index) {
 void CPetLoadSave::resetSlots() {
 	for (int idx = 0; idx < SAVEGAME_SLOTS_COUNT; ++idx) {
 		_slotNames[idx].setText("Empty");
+		_slotInUse[idx] = false;
 
 		// Try and open up the savegame for access
 		Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(
@@ -139,16 +130,17 @@ void CPetLoadSave::resetSlots() {
 			file.open(in);
 
 			TitanicSavegameHeader header;
-			CProjectItem::readSavegameHeader(&file, header);
+			if (CProjectItem::readSavegameHeader(&file, header)) {
+				_slotInUse[idx] = true;
+				_slotNames[idx].setText(header._saveName);
+			}
+
 			if (header._thumbnail) {
 				header._thumbnail->free();
 				delete header._thumbnail;
 			}
 
 			file.close();
-
-			// Set the name text
-			_slotNames[idx].setText(header._saveName);
 		}
 	}
 
diff --git a/engines/titanic/pet_control/pet_load_save.h b/engines/titanic/pet_control/pet_load_save.h
index 8f8634d..687bd13 100644
--- a/engines/titanic/pet_control/pet_load_save.h
+++ b/engines/titanic/pet_control/pet_load_save.h
@@ -58,6 +58,7 @@ private:
 	bool isSlotHighlighted(int index, const Point &pt);
 protected:
 	CPetText _slotNames[SAVEGAME_SLOTS_COUNT];
+	bool _slotInUse[SAVEGAME_SLOTS_COUNT];
 	CPetGfxElement _btnLoadSave;
 	CPetGfxElement _gutter;
 	static int _savegameSlotNum;
@@ -88,15 +89,13 @@ public:
 	virtual bool MouseButtonDownMsg(const Point &pt);
 
 	/**
-	 * Handles mouse button messages
-	 */
-	virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
-
-	/**
 	 * Handles keypresses when the glyph is focused
 	 */
 	virtual bool KeyCharMsg(Common::KeyCode key);
 
+	/**
+	 * Resets highlighting on the save slots
+	 */
 	virtual void resetSaves() { resetSlots(); }
 
 	/**
diff --git a/engines/titanic/pet_control/pet_save.cpp b/engines/titanic/pet_control/pet_save.cpp
index a2e458b..3410539 100644
--- a/engines/titanic/pet_control/pet_save.cpp
+++ b/engines/titanic/pet_control/pet_save.cpp
@@ -38,6 +38,21 @@ bool CPetSave::reset() {
 	return true;
 }
 
+bool CPetSave::MouseButtonUpMsg(const Point &pt) {
+	if (_btnLoadSave.MouseButtonUpMsg(pt)) {
+		execute();
+		resetSlots();
+		return true;
+	} else {
+		return false;
+	}
+}
+
+void CPetSave::highlightCurrent() {
+	resetSlots();
+	highlightSave(_savegameSlotNum);
+}
+
 void CPetSave::getTooltip(CPetText *text) {
 	text->setText("Save the game.");
 }
diff --git a/engines/titanic/pet_control/pet_save.h b/engines/titanic/pet_control/pet_save.h
index 106d499..d37f4e3 100644
--- a/engines/titanic/pet_control/pet_save.h
+++ b/engines/titanic/pet_control/pet_save.h
@@ -35,6 +35,11 @@ public:
 	virtual bool reset();
 
 	/**
+	 * Handles mouse button up messages
+	 */
+	virtual bool MouseButtonUpMsg(const Point &pt);
+
+	/**
 	 * Unhighlight any currently highlighted element
 	 */
 	virtual void unhighlightCurrent() { unhighlightSave(_savegameSlotNum); }
@@ -42,7 +47,7 @@ public:
 	/**
 	 * Highlight any currently highlighted element
 	 */
-	virtual void highlightCurrent() { highlightSave(_savegameSlotNum); }
+	virtual void highlightCurrent();
 
 	/**
 	 * Returns the tooltip text for when the glyph is selected


Commit: 03b45f44dfdb86a9607aaa09a02e5c57968e275f
    https://github.com/scummvm/scummvm/commit/03b45f44dfdb86a9607aaa09a02e5c57968e275f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-22T13:28:32-04:00

Commit Message:
TITANIC: Workaround for original using destroyed objects after save load

The original loads savegames by loading a new project hierarchy and then
deleting and replacing the existing one. This means that objects in the
original project, such as the PET control, are destroyed, leaving the
remainder of the PET code that called load operating on destroyed objects.

This workaround instead flags for a load to be done, and adds new code in
the game manager to take care of it. This way, the remainder of the PET
event handling can finish first, and it will be then safe to destroy the
original game project (including PET) and load the new savegame.

Changed paths:
    engines/titanic/game_state.h
    engines/titanic/main_game_window.cpp
    engines/titanic/main_game_window.h
    engines/titanic/pet_control/pet_load.cpp



diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 125882a..d90c845 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -33,7 +33,8 @@ namespace Titanic {
 
 class CGameManager;
 
-enum GameStateMode { GSMODE_UNSELECTED = 0, GSMODE_SELECTED = 1, GSMODE_2 = 2, GSMODE_3 = 3, GSMODE_4 = 4, GSMODE_5 = 5 };
+enum GameStateMode { GSMODE_UNSELECTED = 0, GSMODE_SELECTED = 1, GSMODE_2 = 2, GSMODE_3 = 3, GSMODE_4 = 4, GSMODE_5 = 5,
+	GSMODE_PENDING_LOAD };
 
 PTR_LIST_ITEM(CMovie);
 class CGameStateMovieList : public List<CMovieListItem> {
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 73ce375..3c549c4 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -36,6 +36,7 @@ CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) {
 	_inputAllowed = false;
 	_image = nullptr;
 	_cursor = nullptr;
+	_pendingLoadSlot = -1;
 }
 
 bool CMainGameWindow::Create() {
@@ -137,6 +138,12 @@ void CMainGameWindow::draw() {
 			g_vm->_filesManager->debug(scrManager);
 			break;
 
+		case GSMODE_PENDING_LOAD:
+			// Pending savegame to load
+			_gameManager->_gameState.setMode(GSMODE_SELECTED);
+			_vm->_window->_project->loadGame(_pendingLoadSlot);
+			break;
+
 		default:
 			break;
 		}
@@ -190,4 +197,9 @@ void CMainGameWindow::mouseChanged() {
 		_gameManager->update();
 }
 
+void CMainGameWindow::loadGame(int slotId) {
+	_pendingLoadSlot = slotId;
+	_gameManager->_gameState.setMode(GSMODE_PENDING_LOAD);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 78f01b9..18c0394 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -37,6 +37,7 @@ class TitanicEngine;
 class CMainGameWindow {
 private:
 	TitanicEngine *_vm;
+	int _pendingLoadSlot;
 
 	/**
 	 * Checks for the presence of any savegames and, if present,
@@ -98,6 +99,11 @@ public:
 	 * Called by the event handler when a mouse event has been generated
 	 */
 	void mouseChanged();
+
+	/**
+	 * Schedules a savegame to be loaded
+	 */
+	void loadGame(int slotId);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_load.cpp b/engines/titanic/pet_control/pet_load.cpp
index cb3514e..04eec54 100644
--- a/engines/titanic/pet_control/pet_load.cpp
+++ b/engines/titanic/pet_control/pet_load.cpp
@@ -24,6 +24,7 @@
 #include "titanic/pet_control/pet_control.h"
 #include "titanic/core/project_item.h"
 #include "titanic/game_manager.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -57,16 +58,10 @@ void CPetLoad::execute() {
 	CPetControl *pet = getPetControl();
 
 	if (_savegameSlotNum >= 0 && _slotInUse[_savegameSlotNum]) {
-		CProjectItem *project = pet ? pet->getRoot() : nullptr;
-		CGameManager *gameManager = project ? project->getGameManager() : nullptr;
+		CMainGameWindow *window = g_vm->_window;
 
-		if (project && gameManager) {
-			pet->displayMessage("Loading the selected game, please wait.");
-
-			gameManager->destroyTreeItem();
-			gameManager->initBounds();
-			project->loadGame(_savegameSlotNum);
-		}
+		// WORKAROUND: Schedule the savegame to be loaded after frame rendering ends
+		window->loadGame(_savegameSlotNum);
 	} else if (pet) {
 		pet->displayMessage("You must select a game to load first.");
 	}


Commit: 4f08292c8c082361af7212e3951af4b1b6c45199
    https://github.com/scummvm/scummvm/commit/4f08292c8c082361af7212e3951af4b1b6c45199
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-22T21:54:48-04:00

Commit Message:
TITANIC: Add support for arbitrary window event targets

Also moved all standard game event methods to CMainGameWindow. This
will allow for the Continue Save dialog to be added in and get
events instead of the game window

Changed paths:
    engines/titanic/detection.cpp
    engines/titanic/events.cpp
    engines/titanic/events.h
    engines/titanic/game_state.cpp
    engines/titanic/main_game_window.cpp
    engines/titanic/main_game_window.h
    engines/titanic/pet_control/pet_rooms_glyphs.cpp
    engines/titanic/titanic.cpp
    engines/titanic/titanic.h
    engines/titanic/true_talk/tt_npc_script.cpp



diff --git a/engines/titanic/detection.cpp b/engines/titanic/detection.cpp
index ca4db96..a9878d9 100644
--- a/engines/titanic/detection.cpp
+++ b/engines/titanic/detection.cpp
@@ -127,8 +127,9 @@ SaveStateList TitanicMetaEngine::listSaves(const char *target) const {
 			if (in) {
 				Titanic::CompressedFile file;
 				file.open(in);
-				Titanic::CProjectItem::readSavegameHeader(&file, header);
-				saveList.push_back(SaveStateDescriptor(slot, header._saveName));
+				
+				if (Titanic::CProjectItem::readSavegameHeader(&file, header))
+					saveList.push_back(SaveStateDescriptor(slot, header._saveName));
 
 				if (header._thumbnail) {
 					header._thumbnail->free();
diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index ff425ab..381d371 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -30,9 +30,8 @@
 
 namespace Titanic {
 
-Events::Events(TitanicEngine *vm): _vm(vm), _specialButtons(0),
-		_frameCounter(1), _priorFrameTime(0), _priorLeftDownTime(0),
-		_priorMiddleDownTime(0), _priorRightDownTime(0) {
+Events::Events(TitanicEngine *vm): _vm(vm), _frameCounter(1),
+		_priorFrameTime(0) {
 }
 
 void Events::pollEvents() {
@@ -45,29 +44,29 @@ void Events::pollEvents() {
 	switch (event.type) {
 	case Common::EVENT_MOUSEMOVE:
 		_mousePos = event.mouse;
-		mouseMove();
+		eventTarget()->mouseMove(_mousePos);
 		break;
 	case Common::EVENT_LBUTTONDOWN:
 		_mousePos = event.mouse;
-		leftButtonDown();
+		eventTarget()->leftButtonDown(_mousePos);
 		break;
 	case Common::EVENT_LBUTTONUP:
 		_mousePos = event.mouse;
-		leftButtonUp();
+		eventTarget()->leftButtonUp(_mousePos);
 		break;
 	case Common::EVENT_MBUTTONDOWN:
 		_mousePos = event.mouse;
-		middleButtonDown();
+		eventTarget()->middleButtonDown(_mousePos);
 		break;
 	case Common::EVENT_MBUTTONUP:
 		_mousePos = event.mouse;
-		middleButtonUp();
+		eventTarget()->middleButtonUp(_mousePos);
 		break;
 	case Common::EVENT_KEYDOWN:
-		keyDown(event.kbd);
+		eventTarget()->keyDown(event.kbd);
 		break;
 	case Common::EVENT_KEYUP:
-		keyUp(event.kbd);
+		eventTarget()->keyUp(event.kbd);
 		break;
 	default:
 		break;
@@ -87,7 +86,7 @@ bool Events::checkForNextFrameCounter() {
 		_priorFrameTime = milli;
 
 		// Handle any idle updates
-		onIdle();
+		eventTarget()->onIdle();
 
 		// Give time to the debugger
 		_vm->_debugger->onFrame();
@@ -105,128 +104,6 @@ uint32 Events::getTicksCount() const {
 	return g_system->getMillis();
 }
 
-void Events::onIdle() {
-	if (!_vm->_window->_inputAllowed)
-		return;
-	CGameManager *gameManager = _vm->_window->_gameManager;
-	if (!gameManager)
-		return;
-
-	// Let the game manager perform any game updates
-	gameManager->update();
-
-	if (gameManager->_gameState._quitGame) {
-		// Game needs to shut down
-		_vm->quitGame();
-	}
-}
-
-#define HANDLE_MESSAGE(METHOD) 	if (_vm->_window->_inputAllowed) { \
-	_vm->_window->_gameManager->_inputTranslator.METHOD(_specialButtons, Point(_mousePos.x, _mousePos.y)); \
-	_vm->_window->mouseChanged(); \
-	}
-
-
-void Events::mouseMove() {
-	HANDLE_MESSAGE(mouseMove)
-}
-
-void Events::leftButtonDown() {
-	_specialButtons |= MK_LBUTTON;
-
-	if ((getTicksCount() - _priorLeftDownTime) < DOUBLE_CLICK_TIME) {
-		_priorLeftDownTime = 0;
-		leftButtonDoubleClick();
-	} else {
-		_priorLeftDownTime = getTicksCount();
-		HANDLE_MESSAGE(leftButtonDown)
-	}
-}
-
-void Events::leftButtonUp() {
-	_specialButtons &= ~MK_LBUTTON;
-	HANDLE_MESSAGE(leftButtonUp)
-}
-
-void Events::leftButtonDoubleClick() {
-	HANDLE_MESSAGE(leftButtonDoubleClick)
-}
-
-void Events::middleButtonDown() {
-	_specialButtons |= MK_MBUTTON;
-
-	if ((getTicksCount() - _priorMiddleDownTime) < DOUBLE_CLICK_TIME) {
-		_priorMiddleDownTime = 0;
-		middleButtonDoubleClick();
-	} else {
-		_priorMiddleDownTime = getTicksCount();
-		HANDLE_MESSAGE(middleButtonDown)
-	}
-}
-
-void Events::middleButtonUp() {
-	_specialButtons &= ~MK_MBUTTON;
-	HANDLE_MESSAGE(middleButtonUp)
-}
-
-void Events::middleButtonDoubleClick() {
-	HANDLE_MESSAGE(middleButtonDoubleClick)
-}
-
-void Events::rightButtonDown() {
-	_specialButtons |= MK_RBUTTON;
-
-	if ((getTicksCount() - _priorRightDownTime) < DOUBLE_CLICK_TIME) {
-		_priorRightDownTime = 0;
-		rightButtonDoubleClick();
-	} else {
-		_priorRightDownTime = getTicksCount();
-		HANDLE_MESSAGE(rightButtonDown)
-	}
-}
-
-void Events::rightButtonUp() {
-	_specialButtons &= ~MK_RBUTTON;
-	HANDLE_MESSAGE(rightButtonUp)
-}
-
-void Events::rightButtonDoubleClick() {
-	HANDLE_MESSAGE(rightButtonDoubleClick)
-}
-
-void Events::charPress(char c) {
-
-}
-
-void Events::keyDown(Common::KeyState keyState) {
-	handleKbdSpecial(keyState);
-
-	if (keyState.keycode == Common::KEYCODE_d && (keyState.flags & Common::KBD_CTRL)) {
-		// Attach to the debugger
-		_vm->_debugger->attach();
-		_vm->_debugger->onFrame();
-	}
-
-	if (_vm->_window->_inputAllowed)
-		_vm->_window->_gameManager->_inputTranslator.keyDown(keyState);
-}
-
-void Events::keyUp(Common::KeyState keyState) {
-	handleKbdSpecial(keyState);
-}
-
-void Events::handleKbdSpecial(Common::KeyState keyState) {
-	if (keyState.flags & Common::KBD_CTRL)
-		_specialButtons |= MK_CONTROL;
-	else
-		_specialButtons &= ~MK_CONTROL;
-
-	if (keyState.flags & Common::KBD_SHIFT)
-		_specialButtons |= MK_SHIFT;
-	else
-		_specialButtons &= ~MK_SHIFT;
-}
-
 void Events::sleep(uint time) {
 	uint32 delayEnd = g_system->getMillis() + time;
 
diff --git a/engines/titanic/events.h b/engines/titanic/events.h
index ab3d755..68666c7 100644
--- a/engines/titanic/events.h
+++ b/engines/titanic/events.h
@@ -25,6 +25,8 @@
 
 #include "common/scummsys.h"
 #include "common/events.h"
+#include "common/stack.h"
+#include "support/rect.h"
 
 namespace Titanic {
 
@@ -39,16 +41,41 @@ enum SpecialButtons {
 
 class TitanicEngine;
 
+/**
+ * A base class for windows that can receive event messages
+ */
+class CEventTarget {
+public:
+	virtual ~CEventTarget() {}
+
+	/**
+	 * Called to handle any regular updates the game requires
+	 */
+	virtual void onIdle() {}
+
+	/**
+	 * Mouse/key event handlers
+	 */
+	virtual void mouseMove(const Point &mousePos) {}
+	virtual void leftButtonDown(const Point &mousePos) {}
+	virtual void leftButtonUp(const Point &mousePos) {}
+	virtual void leftButtonDoubleClick(const Point &mousePos) {}
+	virtual void middleButtonDown(const Point &mousePos) {}
+	virtual void middleButtonUp(const Point &mousePos) {}
+	virtual void middleButtonDoubleClick(const Point &mousePos) {}
+	virtual void rightButtonDown(const Point &mousePos) {}
+	virtual void rightButtonUp(const Point &mousePos) {}
+	virtual void keyDown(Common::KeyState keyState) {}
+	virtual void keyUp(Common::KeyState keyState) {}
+};
+
 class Events {
 private:
 	TitanicEngine *_vm;
+	Common::Stack<CEventTarget *> _eventTargets;
 	uint32 _frameCounter;
 	uint32 _priorFrameTime;
-	uint32 _priorLeftDownTime;
-	uint32 _priorMiddleDownTime;
-	uint32 _priorRightDownTime;
 	Common::Point _mousePos;
-	uint _specialButtons;
 
 	/**
 	 * Check whether it's time to display the next screen frame
@@ -56,29 +83,32 @@ private:
 	bool checkForNextFrameCounter();
 
 	/**
-	 * Called to handle any regular updates the game requires
+	 * Return the currently active event target
 	 */
-	void onIdle();
-
-	void mouseMove();
-	void leftButtonDown();
-	void leftButtonUp();
-	void leftButtonDoubleClick();
-	void middleButtonDown();
-	void middleButtonUp();
-	void middleButtonDoubleClick();
-	void rightButtonDown();
-	void rightButtonUp();
-	void rightButtonDoubleClick();
-	void charPress(char c);
-	void keyDown(Common::KeyState keyState);
-	void keyUp(Common::KeyState keyState);
-	void handleKbdSpecial(Common::KeyState keyState);
+	CEventTarget *eventTarget() const {
+		return _eventTargets.top();
+	}
 public:
 	Events(TitanicEngine *vm);
 	~Events() {}
 
 	/**
+	 * Adds a new event target to the top of the list. It will get
+	 * all events generated until such time as another is pushed on
+	 * top of it, or the removeTarget method is called
+	 */
+	void addTarget(CEventTarget *target) {
+		_eventTargets.push(target);
+	}
+
+	/**
+	 * Removes the currently active event target
+	 */
+	void removeTarget() {
+		_eventTargets.pop();
+	}
+
+	/**
 	 * Check for any pending events
 	 */
 	void pollEvents();
@@ -100,13 +130,6 @@ public:
 	uint32 getTicksCount() const;
 
 	/**
-	 * Return whether a given special key is currently pressed
-	 */
-	bool isSpecialPressed(SpecialButtons btn) const { return _specialButtons; }
-
-	uint getSpecialButtons() const { return _specialButtons; }
-
-	/**
 	 * Sleep for a specified period of time
 	 */
 	void sleep(uint time);
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 6c81bc8..f7ae304 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -120,7 +120,7 @@ void CGameState::changeView(CViewItem *newView, CMovieClip *clip) {
 	oldView->leaveView(newView);
 
 	// If Shift key is pressed, skip showing the transition clip
-	if (g_vm->_events->isSpecialPressed(MK_SHIFT))
+	if (g_vm->_window->isSpecialPressed(MK_SHIFT))
 		clip = nullptr;
 
 	if (_mode == GSMODE_2) {
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 3c549c4..736154a 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -20,16 +20,19 @@
  *
  */
 
+#include "common/config-manager.h"
 #include "titanic/titanic.h"
-#include "titanic/main_game_window.h"
 #include "titanic/game_manager.h"
 #include "titanic/game_view.h"
+#include "titanic/main_game_window.h"
 #include "titanic/messages/messages.h"
 #include "titanic/pet_control/pet_control.h"
 
 namespace Titanic {
 
-CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) {
+CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm),
+		_specialButtons(0), _priorLeftDownTime(0),
+		_priorMiddleDownTime(0), _priorRightDownTime(0) {
 	_gameView = nullptr;
 	_gameManager = nullptr;
 	_project = nullptr;
@@ -37,6 +40,12 @@ CMainGameWindow::CMainGameWindow(TitanicEngine *vm): _vm(vm) {
 	_image = nullptr;
 	_cursor = nullptr;
 	_pendingLoadSlot = -1;
+
+	// Set the window as an event target
+	vm->_events->addTarget(this);
+}
+
+CMainGameWindow::~CMainGameWindow() {
 }
 
 bool CMainGameWindow::Create() {
@@ -53,14 +62,11 @@ void CMainGameWindow::applicationStarting() {
 	// Set up the game project, and get game slot
 	int saveSlot = loadGame();
 	assert(_project);
-	
+
 	// Set the video mode
 	CScreenManager *screenManager = CScreenManager::setCurrent();
 	screenManager->setMode(640, 480, 16, 0, true);
 
-	// TODO: Remove initial background and palette
-
-
 	// Create game view and manager
 	_gameView = new CSTGameView(this);
 	_gameManager = new CGameManager(_project, _gameView);
@@ -98,7 +104,10 @@ int CMainGameWindow::loadGame() {
 }
 
 int CMainGameWindow::selectSavegame() {
-	// TODO: For now, hardcoded to -1 for new saves
+	// If the user selected a savegame from the launcher, return it
+	if (ConfMan.hasKey("save_slot"))
+		return ConfMan.getInt("save_slot");
+
 	return -1;
 }
 
@@ -111,7 +120,7 @@ void CMainGameWindow::setActiveView(CViewItem *viewItem) {
 		_gameView->createSurface(key);
 	}
 }
-
+ 
 void CMainGameWindow::draw() {
 	if (_gameManager) {
 		if (!_gameView->_surface) {
@@ -202,4 +211,126 @@ void CMainGameWindow::loadGame(int slotId) {
 	_gameManager->_gameState.setMode(GSMODE_PENDING_LOAD);
 }
 
+void CMainGameWindow::onIdle() {
+	if (!_inputAllowed)
+		return;
+	CGameManager *gameManager = _gameManager;
+	if (!gameManager)
+		return;
+
+	// Let the game manager perform any game updates
+	gameManager->update();
+
+	if (gameManager->_gameState._quitGame) {
+		// Game needs to shut down
+		_vm->quitGame();
+	}
+}
+
+#define HANDLE_MESSAGE(METHOD) 	if (_inputAllowed) { \
+	_gameManager->_inputTranslator.METHOD(_specialButtons, mousePos); \
+	mouseChanged(); \
+	}
+
+
+void CMainGameWindow::mouseMove(const Point &mousePos) {
+	HANDLE_MESSAGE(mouseMove)
+}
+
+void CMainGameWindow::leftButtonDown(const Point &mousePos) {
+	_specialButtons |= MK_LBUTTON;
+
+	if ((_vm->_events->getTicksCount() - _priorLeftDownTime) < DOUBLE_CLICK_TIME) {
+		_priorLeftDownTime = 0;
+		leftButtonDoubleClick(mousePos);
+	} else {
+		_priorLeftDownTime = _vm->_events->getTicksCount();
+		HANDLE_MESSAGE(leftButtonDown)
+	}
+}
+
+void CMainGameWindow::leftButtonUp(const Point &mousePos) {
+	_specialButtons &= ~MK_LBUTTON;
+	HANDLE_MESSAGE(leftButtonUp)
+}
+
+void CMainGameWindow::leftButtonDoubleClick(const Point &mousePos) {
+	HANDLE_MESSAGE(leftButtonDoubleClick)
+}
+
+void CMainGameWindow::middleButtonDown(const Point &mousePos) {
+	_specialButtons |= MK_MBUTTON;
+
+	if ((_vm->_events->getTicksCount() - _priorMiddleDownTime) < DOUBLE_CLICK_TIME) {
+		_priorMiddleDownTime = 0;
+		middleButtonDoubleClick(mousePos);
+	} else {
+		_priorMiddleDownTime = _vm->_events->getTicksCount();
+		HANDLE_MESSAGE(middleButtonDown)
+	}
+}
+
+void CMainGameWindow::middleButtonUp(const Point &mousePos) {
+	_specialButtons &= ~MK_MBUTTON;
+	HANDLE_MESSAGE(middleButtonUp)
+}
+
+void CMainGameWindow::middleButtonDoubleClick(const Point &mousePos) {
+	HANDLE_MESSAGE(middleButtonDoubleClick)
+}
+
+void CMainGameWindow::rightButtonDown(const Point &mousePos) {
+	_specialButtons |= MK_RBUTTON;
+
+	if ((_vm->_events->getTicksCount() - _priorRightDownTime) < DOUBLE_CLICK_TIME) {
+		_priorRightDownTime = 0;
+		rightButtonDoubleClick(mousePos);
+	} else {
+		_priorRightDownTime = _vm->_events->getTicksCount();
+		HANDLE_MESSAGE(rightButtonDown)
+	}
+}
+
+void CMainGameWindow::rightButtonUp(const Point &mousePos) {
+	_specialButtons &= ~MK_RBUTTON;
+	HANDLE_MESSAGE(rightButtonUp)
+}
+
+void CMainGameWindow::rightButtonDoubleClick(const Point &mousePos) {
+	HANDLE_MESSAGE(rightButtonDoubleClick)
+}
+
+void CMainGameWindow::charPress(char c) {
+
+}
+
+void CMainGameWindow::keyDown(Common::KeyState keyState) {
+	handleKbdSpecial(keyState);
+
+	if (keyState.keycode == Common::KEYCODE_d && (keyState.flags & Common::KBD_CTRL)) {
+		// Attach to the debugger
+		_vm->_debugger->attach();
+		_vm->_debugger->onFrame();
+	}
+
+	if (_inputAllowed)
+		_gameManager->_inputTranslator.keyDown(keyState);
+}
+
+void CMainGameWindow::keyUp(Common::KeyState keyState) {
+	handleKbdSpecial(keyState);
+}
+
+void CMainGameWindow::handleKbdSpecial(Common::KeyState keyState) {
+	if (keyState.flags & Common::KBD_CTRL)
+		_specialButtons |= MK_CONTROL;
+	else
+		_specialButtons &= ~MK_CONTROL;
+
+	if (keyState.flags & Common::KBD_SHIFT)
+		_specialButtons |= MK_SHIFT;
+	else
+		_specialButtons &= ~MK_SHIFT;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 18c0394..7a651ec 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -29,16 +29,22 @@
 #include "titanic/game_view.h"
 #include "titanic/support/image.h"
 #include "titanic/core/project_item.h"
+#include "titanic/events.h"
 
 namespace Titanic {
 
 class TitanicEngine;
 
-class CMainGameWindow {
+class CMainGameWindow : public CEventTarget {
 private:
 	TitanicEngine *_vm;
 	int _pendingLoadSlot;
-
+	uint _specialButtons;
+	uint32 _priorFrameTime;
+	uint32 _priorLeftDownTime;
+	uint32 _priorMiddleDownTime;
+	uint32 _priorRightDownTime;
+private:
 	/**
 	 * Checks for the presence of any savegames and, if present,
 	 * lets the user pick one to resume
@@ -65,6 +71,12 @@ private:
 	 * Draws all the items within the view
 	 */
 	void drawViewContents(CScreenManager *screenManager);
+
+	void leftButtonDoubleClick(const Point &mousePos);
+	void middleButtonDoubleClick(const Point &mousePos);
+	void rightButtonDoubleClick(const Point &mousePos);
+	void charPress(char c);
+	void handleKbdSpecial(Common::KeyState keyState);
 public:
 	CGameView *_gameView;
 	CGameManager *_gameManager;
@@ -74,6 +86,22 @@ public:
 	void *_cursor;
 public:
 	CMainGameWindow(TitanicEngine *vm);
+	virtual ~CMainGameWindow();
+
+	/**
+	* Called to handle any regular updates the game requires
+	*/
+	void onIdle();
+
+	virtual void mouseMove(const Point &mousePos);
+	virtual void leftButtonDown(const Point &mousePos);
+	virtual void leftButtonUp(const Point &mousePos);
+	virtual void middleButtonDown(const Point &mousePos);
+	virtual void middleButtonUp(const Point &mousePos);
+	virtual void rightButtonDown(const Point &mousePos);
+	virtual void rightButtonUp(const Point &mousePos);
+	virtual void keyDown(Common::KeyState keyState);
+	virtual void keyUp(Common::KeyState keyState);
 
 	/**
 	 * Creates the window
@@ -104,6 +132,16 @@ public:
 	 * Schedules a savegame to be loaded
 	 */
 	void loadGame(int slotId);
+
+	/*
+	 * Return whether a given special key is currently pressed
+	 */
+	bool isSpecialPressed(SpecialButtons btn) const { return _specialButtons; }
+
+	/**
+	 * Returns the bitset of the currently pressed special buttons
+	 */
+	uint getSpecialButtons() const { return _specialButtons; }
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/pet_control/pet_rooms_glyphs.cpp b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
index 5de814a..810342a 100644
--- a/engines/titanic/pet_control/pet_rooms_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_rooms_glyphs.cpp
@@ -103,7 +103,7 @@ void CPetRoomsGlyph::drawAt(CScreenManager *screenManager, const Point &pt, bool
 
 void CPetRoomsGlyph::selectGlyph(const Point &topLeft, const Point &pt) {
 	if (isAssigned()) {
-		bool isShiftPressed = g_vm->_events->getSpecialButtons() & MK_SHIFT;
+		bool isShiftPressed = g_vm->_window->getSpecialButtons() & MK_SHIFT;
 
 		if (isShiftPressed) {
 			int selection = getSelection(topLeft, pt);
@@ -116,7 +116,7 @@ void CPetRoomsGlyph::selectGlyph(const Point &topLeft, const Point &pt) {
 }
 
 bool CPetRoomsGlyph::dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg) {
-	bool isShiftPressed = g_vm->_events->getSpecialButtons() & MK_SHIFT;
+	bool isShiftPressed = g_vm->_window->getSpecialButtons() & MK_SHIFT;
 	CPetControl *petControl = getPetControl();
 
 	if (!isShiftPressed && petControl) {
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 7b91a1a..dfb68fd 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -181,4 +181,31 @@ CString TitanicEngine::generateSaveName(int slot) {
 	return CString::format("%s.%03d", _targetName.c_str(), slot);
 }
 
+CString TitanicEngine::getSavegameName(int slot) {
+	// Try and open up the savegame for access
+	Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(
+		generateSaveName(slot));
+
+	if (in) {
+		// Read in the savegame header data
+		CompressedFile file;
+		file.open(in);
+
+		TitanicSavegameHeader header;
+		bool isValid = CProjectItem::readSavegameHeader(&file, header);
+		if (header._thumbnail) {
+			header._thumbnail->free();
+			delete header._thumbnail;
+		}
+
+		file.close();
+
+		if (isValid)
+			// Set the name text
+			return header._saveName;
+	}
+
+	return CString();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/titanic.h b/engines/titanic/titanic.h
index dd28971..ec01555 100644
--- a/engines/titanic/titanic.h
+++ b/engines/titanic/titanic.h
@@ -70,6 +70,8 @@ enum TitanicDebugChannels {
 #define TOTAL_ITEMS 46
 #define TOTAL_ROOMS 34
 
+#define MAX_SAVES 99
+
 struct TitanicGameDescription;
 class TitanicEngine;
 
@@ -159,6 +161,12 @@ public:
 	 * @param slot		Slot number
 	 */
 	CString generateSaveName(int slot);
+
+	/**
+	 * Checks whether a savegame exists for the given slot,
+	 * and if it exists, returns it's description
+	 */
+	CString getSavegameName(int slot);
 };
 
 extern TitanicEngine *g_vm;
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 7095391..8cce90e 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -416,7 +416,7 @@ void TTnpcScript::loadBody(SimpleFile *file) {
 
 		for (uint idx = 0; idx < _ranges.size(); ++idx) {
 			TTscriptRange &item = _ranges[idx];
-			if (item._id == id) {
+			if (item._id == (uint)id) {
 				item._priorIndex = val;
 				break;
 			}


Commit: 7f05cfad13fbce82326542d9bdd0dd0473565baf
    https://github.com/scummvm/scummvm/commit/7f05cfad13fbce82326542d9bdd0dd0473565baf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-22T21:55:36-04:00

Commit Message:
DEVTOOLS: Save create_titanic bitmap resources with correct bitmap headers

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 2ea8f2a..ed263d7 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -279,9 +279,9 @@ void writeResource(const char *name, Common::File *file) {
 	delete file;
 }
 
-void writeResource(const char *sectionStr, const uint32 resId) {
+void writeResource(const char *sectionStr, uint32 resId) {
 	char nameBuffer[256];
-	sprintf(nameBuffer, "%s/%d", sectionStr, resId);
+	sprintf(nameBuffer, "%s/%u", sectionStr, resId);
 	
 	Common::File *file = res.getResource(getResId(sectionStr), resId);
 	assert(file);
@@ -298,6 +298,43 @@ void writeResource(const char *sectionStr, const char *resId) {
 	writeResource(nameBuffer, file);
 }
 
+void writeBitmap(const char *name, Common::File *file) {
+	outputFile.seek(dataOffset);
+
+	// Write out the necessary bitmap header so that the ScummVM
+	// BMP decoder can properly handle decoding the bitmaps
+	outputFile.write("BM", 2);
+	outputFile.writeLong(file->size() + 14);	// Filesize
+	outputFile.writeLong(0);					// res1 & res2
+	outputFile.writeLong(0x436);				// image offset
+
+	outputFile.write(*file, file->size() + 14);
+
+	writeEntryHeader(name, dataOffset, file->size() + 14);
+	dataOffset += file->size() + 14;
+	delete file;
+}
+
+void writeBitmap(const char *sectionStr, const char *resId) {
+	char nameBuffer[256];
+	sprintf(nameBuffer, "%s/%s", sectionStr, resId);
+
+	Common::File *file = res.getResource(getResId(sectionStr),
+		Common::WinResourceID(resId));
+	assert(file);
+	writeBitmap(nameBuffer, file);
+}
+
+void writeBitmap(const char *sectionStr, uint32 resId) {
+	char nameBuffer[256];
+	sprintf(nameBuffer, "%s/%u", sectionStr, resId);
+
+	Common::File *file = res.getResource(getResId(sectionStr),
+		Common::WinResourceID(resId));
+	assert(file);
+	writeBitmap(nameBuffer, file);
+}
+
 void writeNumbers() {
 	outputFile.seek(dataOffset);
 
@@ -357,7 +394,6 @@ void writeResponseTree() {
 	dataOffset += size;
 }
 
-
 void writeSentenceEntries(const char *name, uint tableOffset) {
 	outputFile.seek(dataOffset);
 
@@ -462,18 +498,18 @@ void writeHeader() {
 }
 
 void writeData() {
-	writeResource("Bitmap", "BACKDROP");
-	writeResource("Bitmap", "EVILTWIN");
-	writeResource("Bitmap", "RESTORED");
-	writeResource("Bitmap", "RESTOREF");
-	writeResource("Bitmap", "RESTOREU");
-	writeResource("Bitmap", "STARTD");
-	writeResource("Bitmap", "STARTF");
-	writeResource("Bitmap", "STARTU");
-	writeResource("Bitmap", "TITANIC");
-	writeResource("Bitmap", 133);
-	writeResource("Bitmap", 164);
-	writeResource("Bitmap", 165);
+	writeBitmap("Bitmap", "BACKDROP");
+	writeBitmap("Bitmap", "EVILTWIN");
+	writeBitmap("Bitmap", "RESTORED");
+	writeBitmap("Bitmap", "RESTOREF");
+	writeBitmap("Bitmap", "RESTOREU");
+	writeBitmap("Bitmap", "STARTD");
+	writeBitmap("Bitmap", "STARTF");
+	writeBitmap("Bitmap", "STARTU");
+	writeBitmap("Bitmap", "TITANIC");
+	writeBitmap("Bitmap", 133);
+	writeBitmap("Bitmap", 164);
+	writeBitmap("Bitmap", 165);
 
 	writeResource("STFONT", 149);
 	writeResource("STFONT", 151);


Commit: 21e4d6686f515e70fce1ee177388b5d3bc7a4d61
    https://github.com/scummvm/scummvm/commit/21e4d6686f515e70fce1ee177388b5d3bc7a4d61
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-22T21:56:16-04:00

Commit Message:
TITANIC: Beginnings of Continue Save dialog

Changed paths:
  A engines/titanic/continue_save_dialog.cpp
  A engines/titanic/continue_save_dialog.h
    engines/titanic/main_game_window.cpp
    engines/titanic/main_game_window.h
    engines/titanic/module.mk
    engines/titanic/support/image.cpp
    engines/titanic/support/image.h



diff --git a/engines/titanic/continue_save_dialog.cpp b/engines/titanic/continue_save_dialog.cpp
new file mode 100644
index 0000000..1db3ba2
--- /dev/null
+++ b/engines/titanic/continue_save_dialog.cpp
@@ -0,0 +1,80 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/continue_save_dialog.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+CContinueSaveDialog::CContinueSaveDialog() {
+	g_vm->_events->addTarget(this);
+	_highlightedSlot = _selectedSlot = -999;
+}
+
+CContinueSaveDialog::~CContinueSaveDialog() {
+	g_vm->_events->removeTarget();
+}
+
+void CContinueSaveDialog::addSavegame(int slot, const CString &name) {
+	_saves.push_back(SaveEntry(slot, name));
+}
+
+int CContinueSaveDialog::show() {
+	// Load images for the dialog
+	loadImages();
+
+	// Render the view
+	render();
+
+	// Event loop waiting for selection
+	while (!g_vm->shouldQuit() && _selectedSlot == -999) {
+		g_vm->_events->pollEventsAndWait();
+	}
+
+	return _selectedSlot;
+}
+
+void CContinueSaveDialog::loadImages() {
+	_backdrop.load("Bitmap/BACKDROP");
+	_evilTwin.load("Bitmap/EVILTWIN");
+}
+
+void CContinueSaveDialog::render() {
+	Graphics::Screen &screen = *g_vm->_screen;
+	screen.clear();
+	screen.blitFrom(_backdrop, Common::Point(48, 22));
+}
+
+void CContinueSaveDialog::leftButtonDown(const Point &mousePos) {
+
+}
+
+void CContinueSaveDialog::leftButtonUp(const Point &mousePos) {
+
+}
+
+void CContinueSaveDialog::keyDown(Common::KeyState keyState) {
+	if (keyState.keycode == Common::KEYCODE_ESCAPE)
+		_selectedSlot = EXIT_GAME;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/continue_save_dialog.h b/engines/titanic/continue_save_dialog.h
new file mode 100644
index 0000000..0dc0c06
--- /dev/null
+++ b/engines/titanic/continue_save_dialog.h
@@ -0,0 +1,78 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_CONTINUE_SAVE_DIALOG_H
+#define TITANIC_CONTINUE_SAVE_DIALOG_H
+
+#include "common/array.h"
+#include "titanic/events.h"
+#include "titanic/support/image.h"
+#include "titanic/support/string.h"
+
+namespace Titanic {
+
+#define EXIT_GAME -2
+
+class CContinueSaveDialog : public CEventTarget {
+	struct SaveEntry {
+		int _slot;
+		CString _name;
+		SaveEntry() : _slot(0) {}
+		SaveEntry(int slot, const CString &name) : _slot(slot), _name(name) {}
+	};
+private:
+	Common::Array<SaveEntry> _saves;
+	int _highlightedSlot, _selectedSlot;
+	Image _backdrop;
+	Image _evilTwin;
+private:
+	/**
+	 * Load the images
+	 */
+	void loadImages();
+
+	/**
+	 * Render the dialog
+	 */
+	void render();
+public:
+	CContinueSaveDialog();
+	virtual ~CContinueSaveDialog();
+
+	virtual void leftButtonDown(const Point &mousePos);
+	virtual void leftButtonUp(const Point &mousePos);
+	virtual void keyDown(Common::KeyState keyState);
+
+	/**
+	 * Add a savegame to the list to be displayed
+	 */
+	void addSavegame(int slot, const CString &name);
+
+	/**
+	 * Show the dialog and wait for a slot to be selected
+	 */
+	int show();
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_CONTINUE_SAVE_DIALOG_H */
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 736154a..2ecc319 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -22,6 +22,7 @@
 
 #include "common/config-manager.h"
 #include "titanic/titanic.h"
+#include "titanic/continue_save_dialog.h"
 #include "titanic/game_manager.h"
 #include "titanic/game_view.h"
 #include "titanic/main_game_window.h"
@@ -50,23 +51,22 @@ CMainGameWindow::~CMainGameWindow() {
 
 bool CMainGameWindow::Create() {
 	Image image;
-	bool result = image.loadResource("TITANIC");
-	if (!result)
-		return true;
+	image.load("TITANIC");
 
 	// TODO: Stuff
 	return true;
 }
 
 void CMainGameWindow::applicationStarting() {
-	// Set up the game project, and get game slot
-	int saveSlot = loadGame();
-	assert(_project);
-
 	// Set the video mode
 	CScreenManager *screenManager = CScreenManager::setCurrent();
 	screenManager->setMode(640, 480, 16, 0, true);
 
+	// Set up the game project, and get game slot
+	int saveSlot = getSavegameSlot();
+	if (saveSlot == -2)
+		return;
+
 	// Create game view and manager
 	_gameView = new CSTGameView(this);
 	_gameManager = new CGameManager(_project, _gameView);
@@ -96,7 +96,7 @@ void CMainGameWindow::applicationStarting() {
 	_gameManager->initBounds();
 }
 
-int CMainGameWindow::loadGame() {
+int CMainGameWindow::getSavegameSlot() {
 	_project = new CProjectItem();
 	_project->setFilename("starship.prj");
 
@@ -108,7 +108,21 @@ int CMainGameWindow::selectSavegame() {
 	if (ConfMan.hasKey("save_slot"))
 		return ConfMan.getInt("save_slot");
 
-	return -1;
+	CContinueSaveDialog dialog;
+	bool hasSavegames = false;
+
+	// Loop through save slots to find any existing save slots
+	for (int idx = 0; idx < MAX_SAVES; ++idx) {
+		CString saveName = g_vm->getSavegameName(idx);
+		if (!saveName.empty()) {
+			dialog.addSavegame(idx, saveName);
+			hasSavegames = true;
+		}
+	}
+
+	// If there are savegames, show the select dialog and get a choice.
+	// If there aren't, return -1 to indicate starting a new game
+	return hasSavegames ? dialog.show() : -1;
 }
 
 void CMainGameWindow::setActiveView(CViewItem *viewItem) {
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 7a651ec..82e24e2 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -49,7 +49,7 @@ private:
 	 * Checks for the presence of any savegames and, if present,
 	 * lets the user pick one to resume
 	 */
-	int loadGame();
+	int getSavegameSlot();
 
 	/**
 	 * Creates the game "project" and determine a game save slot
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index ec32947..60a95bc 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -1,6 +1,7 @@
 MODULE := engines/titanic
 
 MODULE_OBJS := \
+	continue_save_dialog.o \
 	debugger.o \
 	detection.o \
 	events.o \
diff --git a/engines/titanic/support/image.cpp b/engines/titanic/support/image.cpp
index cabdd64..1e936b6 100644
--- a/engines/titanic/support/image.cpp
+++ b/engines/titanic/support/image.cpp
@@ -20,102 +20,37 @@
  *
  */
 
-#include "common/file.h"
 #include "titanic/support/image.h"
+#include "titanic/titanic.h"
+#include "image/bmp.h"
 
 namespace Titanic {
 
-BITMAPINFOHEADER::BITMAPINFOHEADER() {
-	_biSize = 0;
-	_biWidth = 0;
-	_biHeight = 0;
-	_biPlanes = 0;
-	_biBitCount = 0;
-	_biCompression = 0;
-	_biSizeImage = 0;
-	_biXPelsPerMeter = 0;
-	_biYPelsPerMeter = 0;
-	_biClrUsed = 0;
-	_biClrImportant = 0;
-}
-
-/*------------------------------------------------------------------------*/
-
-RGBQuad::RGBQuad() : _rgbRed(0), _rgbGreen(0), _rgbBlue(0), _rgbReserved(0) {}
-
-/*------------------------------------------------------------------------*/
-
-Image::Image() {
-	_bitmapInfo = nullptr;
-	_bits = nullptr;
-	_flag = true;
-
-	set(16, 16);
-}
-
-void Image::proc6() {
-
-}
-
-void Image::set(int width, int height) {
-	delete _bitmapInfo;
-	if (_flag && _bitmapInfo)
-		delete[] _bits;
-
-	_bitmapInfo = new tagBITMAPINFO;
-	_bits = new byte[(width + 3) & 0xFFFC * height];
-
-	tagBITMAPINFO &bi = *_bitmapInfo;
-	bi._bmiHeader._biWidth = width;
-	bi._bmiHeader._biHeight = height;
-	bi._bmiHeader._biPlanes = 1;
-	bi._bmiHeader._biBitCount = 8;
-}
-
-void Image::proc8() {
-
-}
-
-bool Image::loadResource(const Common::String &name) {
-	// This method is hardcoded for the Titanic splash screen resource
-	assert(name == "TITANIC");
-
-	Common::File f;
-	if (!f.open("ST.exe"))
-		return false;
-
-	// The ST.exe executable has a bitmap called "TITANIC". Since we can't use
-	// the Windows FindResource function in ScummVM, this is hardcoded for now
-	f.seek(0x29B660);
-	uint size = f.readUint32LE();
-	if (size != 40)
-		return false;
-
-	loadBitmap(f);
-
-	return true;
-}
-
-void Image::proc10() {
-
-}
-
-void Image::draw() {
-
+void Image::load(const CString &resName) {
+	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource(resName);
+	loadBitmap(*stream);
+	delete stream;
 }
 
 void Image::loadBitmap(Common::SeekableReadStream &s) {
-	_bitmapInfo->_bmiHeader._biWidth = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biHeight = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biPlanes = s.readUint16LE();
-	_bitmapInfo->_bmiHeader._biBitCount = s.readUint16LE();
-	_bitmapInfo->_bmiHeader._biCompression = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biSizeImage = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biXPelsPerMeter = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biYPelsPerMeter = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biClrUsed = s.readUint32LE();
-	_bitmapInfo->_bmiHeader._biClrImportant = s.readUint32LE();
-
+	::Image::BitmapDecoder decoder;
+	decoder.loadStream(s);
+	const Graphics::Surface *src = decoder.getSurface();
+	Graphics::PixelFormat scrFormat = g_system->getScreenFormat();
+
+	if (src->format == scrFormat) {
+		create(src->w, src->h, scrFormat);
+		blitFrom(*src);
+	} else {
+		// Convert the loaded surface to the screen surface format
+		const byte *palette = decoder.getPalette();
+		Graphics::Surface *surface = src->convertTo(scrFormat, palette);
+		create(surface->w, surface->h, scrFormat);
+		blitFrom(*surface);
+
+		surface->free();
+		delete surface;
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/image.h b/engines/titanic/support/image.h
index 9030e81..9876f15 100644
--- a/engines/titanic/support/image.h
+++ b/engines/titanic/support/image.h
@@ -23,58 +23,19 @@
 #ifndef TITANIC_IMAGE_H
 #define TITANIC_IMAGE_H
 
-#include "common/scummsys.h"
-#include "common/array.h"
+#include "common/stream.h"
+#include "graphics/managed_surface.h"
+#include "titanic/support/string.h"
 
 namespace Titanic {
 
-struct BITMAPINFOHEADER {
-	int _biSize;
-	int _biWidth;
-	int _biHeight;
-	int _biPlanes;
-	int _biBitCount;
-	int _biCompression;
-	int _biSizeImage;
-	int _biXPelsPerMeter;
-	int _biYPelsPerMeter;
-	int _biClrUsed;
-	int _biClrImportant;
-
-	BITMAPINFOHEADER();
-};
-
-struct RGBQuad {
-	byte _rgbRed;
-	byte _rgbGreen;
-	byte _rgbBlue;
-	byte _rgbReserved;
-
-	RGBQuad();
-};
-
-struct tagBITMAPINFO {
-	BITMAPINFOHEADER _bmiHeader;
-	RGBQuad _bmiColors[256];
-};
-
-class Image {
+class Image : public Graphics::ManagedSurface {
 private:
 	void loadBitmap(Common::SeekableReadStream &s);
 public:
-	tagBITMAPINFO *_bitmapInfo;
-	byte *_bits;
-	bool _flag;
-public:
-	Image();
 	virtual ~Image() {}
 
-	virtual void proc6();
-	virtual void set(int width, int height);
-	virtual void proc8();
-	virtual bool loadResource(const Common::String &name);
-	virtual void proc10();
-	virtual void draw();
+	void load(const CString &resName);
 };
 
 } // End of namespace Titanic


Commit: 7821b846591bd5a7da0770082e1ca30317b0e360
    https://github.com/scummvm/scummvm/commit/7821b846591bd5a7da0770082e1ca30317b0e360
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-22T22:42:46-04:00

Commit Message:
TITANIC: Add button handling and evil twin to Continue Save dialog

Changed paths:
    engines/titanic/continue_save_dialog.cpp
    engines/titanic/continue_save_dialog.h
    engines/titanic/events.cpp



diff --git a/engines/titanic/continue_save_dialog.cpp b/engines/titanic/continue_save_dialog.cpp
index 1db3ba2..1be0cf1 100644
--- a/engines/titanic/continue_save_dialog.cpp
+++ b/engines/titanic/continue_save_dialog.cpp
@@ -25,9 +25,17 @@
 
 namespace Titanic {
 
+#define RESTORE_X 346
+#define RESTORE_Y 94
+#define START_X 370
+#define START_Y 276
+
 CContinueSaveDialog::CContinueSaveDialog() {
 	g_vm->_events->addTarget(this);
 	_highlightedSlot = _selectedSlot = -999;
+	_restoreState = _startState = -1;
+	_mouseDown = false;
+	_evilTwinShown = false;
 }
 
 CContinueSaveDialog::~CContinueSaveDialog() {
@@ -56,20 +64,122 @@ int CContinueSaveDialog::show() {
 void CContinueSaveDialog::loadImages() {
 	_backdrop.load("Bitmap/BACKDROP");
 	_evilTwin.load("Bitmap/EVILTWIN");
+	_restoreD.load("Bitmap/RESTORED");
+	_restoreU.load("Bitmap/RESTOREU");
+	_restoreF.load("Bitmap/RESTOREF");
+	_startD.load("Bitmap/STARTD");
+	_startU.load("Bitmap/STARTU");
+	_startF.load("Bitmap/STARTF");
 }
 
 void CContinueSaveDialog::render() {
 	Graphics::Screen &screen = *g_vm->_screen;
 	screen.clear();
 	screen.blitFrom(_backdrop, Common::Point(48, 22));
+
+	if (_evilTwinShown)
+		screen.blitFrom(_evilTwin, Common::Point(78, 59));
+
+	_restoreState = _startState = -1;
+	renderButtons();
 }
 
-void CContinueSaveDialog::leftButtonDown(const Point &mousePos) {
+void CContinueSaveDialog::renderButtons() {
+	Graphics::Screen &screen = *g_vm->_screen;
+	Rect restoreRect(RESTORE_X, RESTORE_Y, RESTORE_X + _restoreU.w, RESTORE_Y + _restoreU.h);
+	Rect startRect(START_X, START_Y, START_X + _startU.w, START_Y + _startU.h);
+
+	// Determine the current state for the buttons
+	int restoreState, startState;
+	if (!restoreRect.contains(_mousePos))
+		restoreState = 0;
+	else
+		restoreState = _mouseDown ? 1 : 2;
+
+	if (!startRect.contains(_mousePos))
+		startState = 0;
+	else
+		startState = _mouseDown ? 1 : 2;
+
+	// Draw the start button
+	if (startState != _startState) {
+		_startState = startState;
+		switch (_startState) {
+		case 0:
+			screen.blitFrom(_startU, Common::Point(START_X, START_Y));
+			break;
+		case 1:
+			screen.blitFrom(_startD, Common::Point(START_X, START_Y));
+			break;
+		case 2:
+			screen.blitFrom(_startF, Common::Point(START_X, START_Y));
+			break;
+		default:
+			break;
+		}
+	}
 
+	// Draw the restore button
+	if (restoreState != _restoreState) {
+		_restoreState = restoreState;
+		switch (_restoreState) {
+		case 0:
+			screen.blitFrom(_restoreU, Common::Point(RESTORE_X, RESTORE_Y));
+			break;
+		case 1:
+			screen.blitFrom(_restoreD, Common::Point(RESTORE_X, RESTORE_Y));
+			break;
+		case 2:
+			screen.blitFrom(_restoreF, Common::Point(RESTORE_X, RESTORE_Y));
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+void CContinueSaveDialog::mouseMove(const Point &mousePos) {
+	_mousePos = mousePos;
+	renderButtons();
+}
+
+void CContinueSaveDialog::leftButtonDown(const Point &mousePos) {
+	_mouseDown = true;
+	mouseMove(mousePos);
 }
 
 void CContinueSaveDialog::leftButtonUp(const Point &mousePos) {
+	Rect restoreRect(RESTORE_X, RESTORE_Y, RESTORE_X + _restoreU.w, RESTORE_Y + _restoreU.h);
+	Rect startRect(START_X, START_Y, START_X + _startU.w, START_Y + _startU.h);
+	_mouseDown = false;
+
+	if (restoreRect.contains(mousePos)) {
+		// Flag to exit dialog and load highlighted slot. If no slot was
+		// selected explicitly, then fall back on loading the first slot
+		_selectedSlot = (_highlightedSlot == -999) ? _saves[0]._slot :
+			_saves[_highlightedSlot]._slot;
+	} else if (startRect.contains(mousePos)) {
+		// Start a new game
+		_selectedSlot = -1;
+	} else {
+		// TODO: Slot highlighting
+	}
+}
+
+void CContinueSaveDialog::rightButtonDown(const Point &mousePos) {
+	Rect eye1(188, 190, 192, 195), eye2(209, 192, 213, 197);
 
+	if (eye1.contains(mousePos) || eye2.contains(mousePos)) {
+		_evilTwinShown = true;
+		render();
+	}
+}
+
+void CContinueSaveDialog::rightButtonUp(const Point &mousePos) {
+	if (_evilTwinShown) {
+		_evilTwinShown = false;
+		render();
+	}
 }
 
 void CContinueSaveDialog::keyDown(Common::KeyState keyState) {
diff --git a/engines/titanic/continue_save_dialog.h b/engines/titanic/continue_save_dialog.h
index 0dc0c06..697a930 100644
--- a/engines/titanic/continue_save_dialog.h
+++ b/engines/titanic/continue_save_dialog.h
@@ -26,6 +26,7 @@
 #include "common/array.h"
 #include "titanic/events.h"
 #include "titanic/support/image.h"
+#include "titanic/support/rect.h"
 #include "titanic/support/string.h"
 
 namespace Titanic {
@@ -42,8 +43,14 @@ class CContinueSaveDialog : public CEventTarget {
 private:
 	Common::Array<SaveEntry> _saves;
 	int _highlightedSlot, _selectedSlot;
+	Point _mousePos;
+	bool _evilTwinShown;
+	bool _mouseDown;
+	int _restoreState, _startState;
 	Image _backdrop;
 	Image _evilTwin;
+	Image _restoreD, _restoreU, _restoreF;
+	Image _startD, _startU, _startF;
 private:
 	/**
 	 * Load the images
@@ -54,12 +61,20 @@ private:
 	 * Render the dialog
 	 */
 	void render();
+
+	/**
+	 * Render the buttons
+	 */
+	void renderButtons();
 public:
 	CContinueSaveDialog();
 	virtual ~CContinueSaveDialog();
 
+	virtual void mouseMove(const Point &mousePos);
 	virtual void leftButtonDown(const Point &mousePos);
 	virtual void leftButtonUp(const Point &mousePos);
+	virtual void rightButtonDown(const Point &mousePos);
+	virtual void rightButtonUp(const Point &mousePos);
 	virtual void keyDown(Common::KeyState keyState);
 
 	/**
diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index 381d371..997dbfa 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -62,6 +62,14 @@ void Events::pollEvents() {
 		_mousePos = event.mouse;
 		eventTarget()->middleButtonUp(_mousePos);
 		break;
+	case Common::EVENT_RBUTTONDOWN:
+		_mousePos = event.mouse;
+		eventTarget()->rightButtonDown(_mousePos);
+		break;
+	case Common::EVENT_RBUTTONUP:
+		_mousePos = event.mouse;
+		eventTarget()->rightButtonUp(_mousePos);
+		break;
 	case Common::EVENT_KEYDOWN:
 		eventTarget()->keyDown(event.kbd);
 		break;


Commit: 8f43f2a7a563c13200a9d946f4473ca11d05385a
    https://github.com/scummvm/scummvm/commit/8f43f2a7a563c13200a9d946f4473ca11d05385a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-22T23:48:56-04:00

Commit Message:
TITANIC: Setting up Continue Save dialog slot names list

Changed paths:
    engines/titanic/continue_save_dialog.cpp
    engines/titanic/continue_save_dialog.h



diff --git a/engines/titanic/continue_save_dialog.cpp b/engines/titanic/continue_save_dialog.cpp
index 1be0cf1..5a881c1 100644
--- a/engines/titanic/continue_save_dialog.cpp
+++ b/engines/titanic/continue_save_dialog.cpp
@@ -25,6 +25,7 @@
 
 namespace Titanic {
 
+#define SAVEGAME_SLOTS_COUNT 5
 #define RESTORE_X 346
 #define RESTORE_Y 94
 #define START_X 370
@@ -36,6 +37,16 @@ CContinueSaveDialog::CContinueSaveDialog() {
 	_restoreState = _startState = -1;
 	_mouseDown = false;
 	_evilTwinShown = false;
+
+	for (int idx = 0; idx < SAVEGAME_SLOTS_COUNT; ++idx) {
+		Rect slotRect = getSlotBounds(idx);
+		_slotNames[idx].setFontNumber(0);
+		_slotNames[idx].setBounds(slotRect);
+		_slotNames[idx].resize(3);
+		_slotNames[idx].setMaxCharsPerLine(22);
+		_slotNames[idx].setHasBorder(false);
+		_slotNames[idx].setup();
+	}
 }
 
 CContinueSaveDialog::~CContinueSaveDialog() {
@@ -43,9 +54,15 @@ CContinueSaveDialog::~CContinueSaveDialog() {
 }
 
 void CContinueSaveDialog::addSavegame(int slot, const CString &name) {
+	assert(_saves.size() < SAVEGAME_SLOTS_COUNT);
+	_slotNames[_saves.size()].setText(name);
 	_saves.push_back(SaveEntry(slot, name));
 }
 
+Rect CContinueSaveDialog::getSlotBounds(int index) {
+	return Rect(360, 168 + index * 12, 556, 180 + index * 12);
+}
+
 int CContinueSaveDialog::show() {
 	// Load images for the dialog
 	loadImages();
@@ -82,6 +99,7 @@ void CContinueSaveDialog::render() {
 
 	_restoreState = _startState = -1;
 	renderButtons();
+	renderSlots();
 }
 
 void CContinueSaveDialog::renderButtons() {
@@ -138,6 +156,11 @@ void CContinueSaveDialog::renderButtons() {
 	}
 }
 
+void CContinueSaveDialog::renderSlots() {
+	for (int idx = 0; idx < SAVEGAME_SLOTS_COUNT; ++idx)
+		_slotNames[idx].draw(CScreenManager::_screenManagerPtr);
+}
+
 void CContinueSaveDialog::mouseMove(const Point &mousePos) {
 	_mousePos = mousePos;
 	renderButtons();
diff --git a/engines/titanic/continue_save_dialog.h b/engines/titanic/continue_save_dialog.h
index 697a930..58c7dee 100644
--- a/engines/titanic/continue_save_dialog.h
+++ b/engines/titanic/continue_save_dialog.h
@@ -28,6 +28,7 @@
 #include "titanic/support/image.h"
 #include "titanic/support/rect.h"
 #include "titanic/support/string.h"
+#include "titanic/pet_control/pet_text.h"
 
 namespace Titanic {
 
@@ -42,6 +43,7 @@ class CContinueSaveDialog : public CEventTarget {
 	};
 private:
 	Common::Array<SaveEntry> _saves;
+	CPetText _slotNames[5];
 	int _highlightedSlot, _selectedSlot;
 	Point _mousePos;
 	bool _evilTwinShown;
@@ -66,6 +68,16 @@ private:
 	 * Render the buttons
 	 */
 	void renderButtons();
+
+	/**
+	 * Render the slots
+	 */
+	void renderSlots();
+
+	/**
+	 * Get the area to draw a slot name in
+	 */
+	Rect getSlotBounds(int index);
 public:
 	CContinueSaveDialog();
 	virtual ~CContinueSaveDialog();


Commit: 9a69ee3f44ee6ad72da8f5bacf3329f95d86707f
    https://github.com/scummvm/scummvm/commit/9a69ee3f44ee6ad72da8f5bacf3329f95d86707f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T09:13:00-04:00

Commit Message:
TITANIC: Fix redrawing CPetText after line colors are changed

Changed paths:
    engines/titanic/pet_control/pet_text.cpp



diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 983d35e..6813095 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -76,6 +76,8 @@ void CPetText::setLineColor(uint lineNum, byte r, byte g, byte b) {
 	buffer[4] = TEXTCMD_SET_COLOR;
 	buffer[5] = '\0';
 	_array[lineNum]._rgb = buffer;
+
+	_stringsMerged = false;
 }
 
 void CPetText::load(SimpleFile *file, int param) {


Commit: 4bad949717c9179e9192b0edf6b81b9012fd0fbf
    https://github.com/scummvm/scummvm/commit/4bad949717c9179e9192b0edf6b81b9012fd0fbf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T09:13:55-04:00

Commit Message:
TITANIC: Add Continue Save dialog slots rendering and selection

Changed paths:
    engines/titanic/continue_save_dialog.cpp



diff --git a/engines/titanic/continue_save_dialog.cpp b/engines/titanic/continue_save_dialog.cpp
index 5a881c1..483b308 100644
--- a/engines/titanic/continue_save_dialog.cpp
+++ b/engines/titanic/continue_save_dialog.cpp
@@ -60,7 +60,7 @@ void CContinueSaveDialog::addSavegame(int slot, const CString &name) {
 }
 
 Rect CContinueSaveDialog::getSlotBounds(int index) {
-	return Rect(360, 168 + index * 12, 556, 180 + index * 12);
+	return Rect(360, 164 + index * 19, 556, 180 + index * 19);
 }
 
 int CContinueSaveDialog::show() {
@@ -157,8 +157,12 @@ void CContinueSaveDialog::renderButtons() {
 }
 
 void CContinueSaveDialog::renderSlots() {
-	for (int idx = 0; idx < SAVEGAME_SLOTS_COUNT; ++idx)
+	for (uint idx = 0; idx < _saves.size(); ++idx) {
+		byte rgb = (_highlightedSlot == idx) ? 255 : 0;
+		_slotNames[idx].setColor(rgb, rgb, rgb);
+		_slotNames[idx].setLineColor(0, rgb, rgb, rgb);
 		_slotNames[idx].draw(CScreenManager::_screenManagerPtr);
+	}
 }
 
 void CContinueSaveDialog::mouseMove(const Point &mousePos) {
@@ -185,7 +189,14 @@ void CContinueSaveDialog::leftButtonUp(const Point &mousePos) {
 		// Start a new game
 		_selectedSlot = -1;
 	} else {
-		// TODO: Slot highlighting
+		// Check whether a filled in slot was selected
+		for (uint idx = 0; idx < _saves.size(); ++idx) {
+			if (getSlotBounds(idx).contains(mousePos)) {
+				_highlightedSlot = idx;
+				render();
+				break;
+			}
+		}
 	}
 }
 


Commit: 9c5f3c305a5edcc60d0415b92fa4dfc533af8918
    https://github.com/scummvm/scummvm/commit/9c5f3c305a5edcc60d0415b92fa4dfc533af8918
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T10:37:04-04:00

Commit Message:
TITANIC: gcc compilation fix

Changed paths:
    engines/titanic/continue_save_dialog.cpp



diff --git a/engines/titanic/continue_save_dialog.cpp b/engines/titanic/continue_save_dialog.cpp
index 483b308..39b7d19 100644
--- a/engines/titanic/continue_save_dialog.cpp
+++ b/engines/titanic/continue_save_dialog.cpp
@@ -157,7 +157,7 @@ void CContinueSaveDialog::renderButtons() {
 }
 
 void CContinueSaveDialog::renderSlots() {
-	for (uint idx = 0; idx < _saves.size(); ++idx) {
+	for (int idx = 0; idx < (int)_saves.size(); ++idx) {
 		byte rgb = (_highlightedSlot == idx) ? 255 : 0;
 		_slotNames[idx].setColor(rgb, rgb, rgb);
 		_slotNames[idx].setLineColor(0, rgb, rgb, rgb);


Commit: 71b76acc630af3537b7379be24d59d38326f2606
    https://github.com/scummvm/scummvm/commit/71b76acc630af3537b7379be24d59d38326f2606
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T11:38:39-04:00

Commit Message:
TITANIC: Fixes and simplification of AVISurface

Changed paths:
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/avi_surface.h
    engines/titanic/support/movie.cpp



diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index 0827b33..8727d4f 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -86,7 +86,7 @@ void CPetElement::loadFrame(int frameNumber) {
 		gameObject->loadFrame(frameNumber);
 }
 
-int CPetElement::getFrame() {
+int CPetElement::getMovieFrame() const {
 	CGameObject *gameObject = getObject();
 	return gameObject ? gameObject->getMovieFrame() : 0;
 }
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index e1edcac..ad4e7fe 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -114,7 +114,7 @@ public:
 	/**
 	 * Get the current frame
 	 */
-	virtual int getFrame();
+	virtual int getMovieFrame() const;
 
 	/**
 	 * Get the game object associated with this item
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index 38bccaf..c64edca 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -54,11 +54,8 @@ static bool secondaryTrackSelect(bool isVideo, int trackCounter) {
 
 AVISurface::AVISurface(const CResourceKey &key) {
 	_videoSurface = nullptr;
-	_currentPos = 0;
-	_priorFrame = 0;
 	_streamCount = 0;
 	_movieFrameSurface[0] = _movieFrameSurface[1] = nullptr;
-	_isPlaying = false;
 
 	// Create a decoder for the audio (if any) and primary video track
 	_decoders[0] = new AVIDecoder(Audio::Mixer::kPlainSoundType, primaryTrackSelect);
@@ -122,14 +119,13 @@ bool AVISurface::play(int startFrame, int endFrame, int initialFrame, uint flags
 	_movieRangeInfo.push_back(info);
 	
 	if (_movieRangeInfo.size() == 1) {
-		return changeFrame(initialFrame);
+		return startAtFrame(initialFrame);
 	} else {
 		return true;
 	}	
 }
 
 void AVISurface::stop() {
-	_isPlaying = false;
 	_decoders[0]->stop();
 	if (_decoders[1])
 		_decoders[1]->stop();
@@ -137,37 +133,46 @@ void AVISurface::stop() {
 	_movieRangeInfo.destroyContents();
 }
 
-bool AVISurface::changeFrame(int frameNumber) {
-	if (_isPlaying)
+bool AVISurface::startAtFrame(int frameNumber) {
+	if (isPlaying())
+		// If it's already playing, then don't allow it
 		return false;
 
 	if (frameNumber == -1)
 		// Default to starting frame of first movie range
 		frameNumber = _movieRangeInfo.front()->_startFrame;
 
+	// Get the initial frame
 	seekToFrame(frameNumber);
 	renderFrame();
 
-	_isPlaying = true;
+	// Start the playback
+	_decoders[0]->start();
+	if (_decoders[1])
+		_decoders[1]->start();
+	
 	return true;
 }
 
 void AVISurface::seekToFrame(uint frameNumber) {
-	_decoders[0]->seekToFrame(frameNumber);
-	if (_decoders[1])
-		_decoders[1]->seekToFrame(frameNumber);
+	if ((int)frameNumber != getFrame()) {
+		_decoders[0]->seekToFrame(frameNumber);
+		if (_decoders[1])
+			_decoders[1]->seekToFrame(frameNumber);
+	}
 
-	_priorFrame = frameNumber;
+	renderFrame();
 }
 
 bool AVISurface::handleEvents(CMovieEventList &events) {
-	if (!_isPlaying)
+	if (!isPlaying())
 		return true;
 
 	CMovieRangeInfo *info = _movieRangeInfo.front();
-	_currentPos += info->_isReversed ? -1 : 1;
-	if ((info->_isReversed && _currentPos < info->_endFrame) ||
-		(!info->_isReversed && _currentPos > info->_endFrame)) {
+	int currentPos = getFrame();
+
+	if ((info->_isReversed && currentPos < info->_endFrame) ||
+		(!info->_isReversed && currentPos > info->_endFrame)) {
 		if (info->_isFlag1) {
 			info->getMovieEnd(events);
 			_movieRangeInfo.remove(info);
@@ -179,19 +184,20 @@ bool AVISurface::handleEvents(CMovieEventList &events) {
 			} else {
 				// Not empty, so move onto new first one
 				info = _movieRangeInfo.front();
-				_currentPos = info->_startFrame;
+				currentPos = info->_startFrame;
 			}
 		} else {
-			_currentPos = info->_startFrame;
+			currentPos = info->_startFrame;
 		}
 	}
 
-	if (_isPlaying) {
-		// SInce movie ranges can change the position in the movie,
-		// ensure the decoder is kept in sync
-		seekToFrame(_currentPos);
-				
-		info->getMovieFrame(events, _currentPos);
+	if (isPlaying()) {
+		if (currentPos != getFrame())
+			// The frame has been changed, so move to new position
+			seekToFrame(currentPos);
+	
+		// Get any events for the given position
+		info->getMovieFrame(events, currentPos);
 		return renderFrame();
 	} else {
 		return false;
@@ -245,7 +251,7 @@ uint AVISurface::getHeight() const {
 
 void AVISurface::setFrame(int frameNumber) {
 	// If playback was in process, stop it
-	if (_isPlaying)
+	if (isPlaying())
 		stop();
 
 	// Ensure the frame number is valid
@@ -307,7 +313,7 @@ bool AVISurface::addEvent(int frameNumber, CGameObject *obj) {
 		me->_gameObject = obj;
 		tail->addEvent(me);
 
-		return _movieRangeInfo.size() == 1 && frameNumber == _priorFrame;
+		return _movieRangeInfo.size() == 1 && frameNumber == getFrame();
 	}
 
 	return false;
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index dfd4c59..4372757 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -52,8 +52,6 @@ class AVISurface {
 private:
 	AVIDecoder *_decoders[2];
 	CVideoSurface *_videoSurface;
-	int _currentPos;
-	int _priorFrame;
 	CMovieRangeInfoList _movieRangeInfo;
 	int _streamCount;
 	Graphics::ManagedSurface *_movieFrameSurface[2];
@@ -69,9 +67,9 @@ private:
 	void setupDecompressor();
 protected:
 	/**
-	 * Change the frame with ??? checking
+	 * Start playback at the specified frame
 	 */
-	virtual bool changeFrame(int frameNumber);
+	virtual bool startAtFrame(int frameNumber);
 
 	/**
 	 * Seeks to a given frame number in the video
@@ -80,7 +78,6 @@ protected:
 public:
 	CSoundManager *_soundManager;
 	bool _hasAudio;
-	bool _isPlaying;
 	double _frameRate;
 public:
 	AVISurface(const CResourceKey &key);
@@ -107,6 +104,11 @@ public:
 	virtual void stop();
 
 	/**
+	 * Return true if a video is currently playing
+	 */
+	virtual bool isPlaying() const { return _decoders[0]->isPlaying(); }
+
+	/**
 	 * Handle any movie events relevent for the frame
 	 */
 	virtual bool handleEvents(CMovieEventList &events);
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 3856c44..9dc57b8 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -95,21 +95,21 @@ OSMovie::~OSMovie() {
 void OSMovie::play(uint flags, CGameObject *obj) {
 	_aviSurface.play(flags, obj);
 
-	if (_aviSurface._isPlaying)
+	if (_aviSurface.isPlaying())
 		movieStarted();
 }
 
 void OSMovie::play(uint startFrame, uint endFrame, uint flags, CGameObject *obj) {
 	_aviSurface.play(startFrame, endFrame, flags, obj);
 
-	if (_aviSurface._isPlaying)
+	if (_aviSurface.isPlaying())
 		movieStarted();
 }
 
 void OSMovie::play(uint startFrame, uint endFrame, uint initialFrame, uint flags, CGameObject *obj) {
 	_aviSurface.play(startFrame, endFrame, initialFrame, flags, obj);
 
-	if (_aviSurface._isPlaying)
+	if (_aviSurface.isPlaying())
 		movieStarted();
 }
 
@@ -160,10 +160,10 @@ void OSMovie::setFrame(uint frameNumber) {
 }
 
 bool OSMovie::handleEvents(CMovieEventList &events) {
-	if (!_aviSurface._isPlaying)
+	if (!_aviSurface.isPlaying())
 		return false;
 	if (!_aviSurface.isFrameReady())
-		return _aviSurface._isPlaying;
+		return _aviSurface.isPlaying();
 
 	// Handle updating the frame
 	while (_aviSurface.isFrameReady()) {
@@ -174,7 +174,7 @@ bool OSMovie::handleEvents(CMovieEventList &events) {
 	// Flag there's a video frame
 	_hasVideoFrame = true;
 
-	return _aviSurface._isPlaying;
+	return _aviSurface.isPlaying();
 }
 
 const CMovieRangeInfoList *OSMovie::getMovieRangeInfo() const {


Commit: 8a6a5cebfbb6c18fe136e2925dd086912a0b7e6c
    https://github.com/scummvm/scummvm/commit/8a6a5cebfbb6c18fe136e2925dd086912a0b7e6c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T11:50:07-04:00

Commit Message:
TITANIC: Clarify MODE_2 as MODE_FOCUSED

Changed paths:
    engines/titanic/pet_control/pet_element.cpp
    engines/titanic/pet_control/pet_element.h
    engines/titanic/pet_control/pet_gfx_element.cpp



diff --git a/engines/titanic/pet_control/pet_element.cpp b/engines/titanic/pet_control/pet_element.cpp
index 8727d4f..c5e1a6e 100644
--- a/engines/titanic/pet_control/pet_element.cpp
+++ b/engines/titanic/pet_control/pet_element.cpp
@@ -50,10 +50,10 @@ bool CPetElement::MouseDoubleClickMsg(const Point &pt) const {
 	return _bounds.contains(pt);
 }
 
-int CPetElement::proc9(const Point &pt) {
+bool CPetElement::MouseMoveMsg(const Point &pt) {
 	bool result = _bounds.contains(pt);
 	if (result)
-		setMode(MODE_2);
+		setMode(MODE_FOCUSED);
 	return result;
 }
 
@@ -92,7 +92,7 @@ int CPetElement::getMovieFrame() const {
 }
 
 void CPetElement::setMode(PetElementMode newMode) {
-	if (newMode >= MODE_UNSELECTED && newMode <= MODE_2)
+	if (newMode >= MODE_UNSELECTED && newMode <= MODE_FOCUSED)
 		changeMode(newMode);
 }
 
diff --git a/engines/titanic/pet_control/pet_element.h b/engines/titanic/pet_control/pet_element.h
index ad4e7fe..bbf3e83 100644
--- a/engines/titanic/pet_control/pet_element.h
+++ b/engines/titanic/pet_control/pet_element.h
@@ -30,7 +30,7 @@
 
 namespace Titanic {
 
-enum PetElementMode { MODE_UNSELECTED = 0, MODE_SELECTED = 1, MODE_2 = 2 };
+enum PetElementMode { MODE_UNSELECTED = 0, MODE_SELECTED = 1, MODE_FOCUSED = 2 };
 
 class CGameObject;
 class CPetControl;
@@ -84,7 +84,10 @@ public:
 	 */
 	virtual bool MouseDoubleClickMsg(const Point &pt) const;
 
-	virtual int proc9(const Point &pt);
+	/**
+	 * Handles processing mouse move messages
+	 */
+	virtual bool MouseMoveMsg(const Point &pt);
 
 	/**
 	 * Returns whether the passed point falls inside the item
diff --git a/engines/titanic/pet_control/pet_gfx_element.cpp b/engines/titanic/pet_control/pet_gfx_element.cpp
index 9fc0c2a..6022885 100644
--- a/engines/titanic/pet_control/pet_gfx_element.cpp
+++ b/engines/titanic/pet_control/pet_gfx_element.cpp
@@ -36,7 +36,7 @@ void CPetGfxElement::setup(PetElementMode mode, const CString &name,
 	case MODE_SELECTED:
 		_object1 = petControl->getHiddenObject(name);
 		break;
-	case MODE_2:
+	case MODE_FOCUSED:
 		_object2 = petControl->getHiddenObject(name);
 		break;
 	default:
@@ -93,7 +93,7 @@ CGameObject *CPetGfxElement::getObject() const {
 		return _object0;
 	case MODE_SELECTED:
 		return _object1;
-	case MODE_2:
+	case MODE_FOCUSED:
 		return _object2;
 	default:
 		return nullptr;


Commit: c918602800772556ae95ba477141b80316aa07ae
    https://github.com/scummvm/scummvm/commit/c918602800772556ae95ba477141b80316aa07ae
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T12:11:09-04:00

Commit Message:
TITANIC: Fix some warnings

Changed paths:
    engines/titanic/core/tree_item.h
    engines/titanic/detection.cpp
    engines/titanic/star_control/star_field.cpp



diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 46d7996..3754bd4 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -127,9 +127,7 @@ public:
 	/**
 	 * Compares the name of the item to a passed name
 	 */
-	virtual int compareTo(const CString &name, int maxLen) const { return false; }
-
-	virtual int proc23() const { return 0; }
+	virtual int compareTo(const CString &name, int maxLen = 0) const { return false; }
 
 	/**
 	 * Returns the clip list, if any, associated with the item
diff --git a/engines/titanic/detection.cpp b/engines/titanic/detection.cpp
index a9878d9..86d26f2 100644
--- a/engines/titanic/detection.cpp
+++ b/engines/titanic/detection.cpp
@@ -125,10 +125,10 @@ SaveStateList TitanicMetaEngine::listSaves(const char *target) const {
 			Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(*file);
 
 			if (in) {
-				Titanic::CompressedFile file;
-				file.open(in);
+				Titanic::CompressedFile cf;
+				cf.open(in);
 				
-				if (Titanic::CProjectItem::readSavegameHeader(&file, header))
+				if (Titanic::CProjectItem::readSavegameHeader(&cf, header))
 					saveList.push_back(SaveStateDescriptor(slot, header._saveName));
 
 				if (header._thumbnail) {
@@ -136,7 +136,7 @@ SaveStateList TitanicMetaEngine::listSaves(const char *target) const {
 					delete header._thumbnail;
 				}
 
-				file.close();
+				cf.close();
 			}
 		}
 	}
diff --git a/engines/titanic/star_control/star_field.cpp b/engines/titanic/star_control/star_field.cpp
index a90d228..882e3c3 100644
--- a/engines/titanic/star_control/star_field.cpp
+++ b/engines/titanic/star_control/star_field.cpp
@@ -110,7 +110,7 @@ void CStarField::toggle4() {
 bool CStarField::set4(bool val) {
 	bool oldVal = _val4;
 	_val4 = val;
-	return val;
+	return oldVal;
 }
 
 int CStarField::get88() const {


Commit: 8dd24dd94530db499ead47dc4fda62194c179efd
    https://github.com/scummvm/scummvm/commit/8dd24dd94530db499ead47dc4fda62194c179efd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T12:30:53-04:00

Commit Message:
TITANIC: Finish CLinkItem class

Changed paths:
    engines/titanic/core/link_item.cpp
    engines/titanic/core/link_item.h



diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp
index a56122f..5de0d4c 100644
--- a/engines/titanic/core/link_item.cpp
+++ b/engines/titanic/core/link_item.cpp
@@ -33,21 +33,49 @@ CLinkItem::CLinkItem() : CNamedItem() {
 	_roomNumber = -1;
 	_nodeNumber = -1;
 	_viewNumber = -1;
-	_field30 = 0;
+	_linkMode = 0;
 	_cursorId = CURSOR_ARROW;
 	_name = "Link";
 }
 
 CString CLinkItem::formName() {
-	warning("TODO: CLinkItem::formName");
-	return "";
+	CViewItem *view = findView();
+	CNodeItem *node = view->findNode();
+	CRoomItem *room = node->findRoom();
+
+	CViewItem *destView = getDestView();
+	CNodeItem *destNode = destView->findNode();
+	CRoomItem *destRoom = destNode->findRoom();
+
+	switch (_linkMode) {
+	case 1:
+		return CString::format("_PANL,%d,%s,%s", node->_nodeNumber,
+			view->getName(), destView->getName());
+
+	case 2:
+		return CString::format("_PANR,%d,%s,%s", node->_nodeNumber,
+			view->getName(), destView->getName());
+
+	case 3:
+		return CString::format("_TRACK,%d,%s,%d,%s", 
+			node->_nodeNumber, view->getName(), 
+			destNode->_nodeNumber, destView->getName());
+
+	case 4:
+		return CString::format("_EXIT,%d,%d,%s,%d,%d,%s",
+			room->_roomNumber, node->_nodeNumber, view->getName(),
+			destRoom->_roomNumber, destNode->_nodeNumber, destView->getName());
+
+	default:
+		return getName();
+	}
 }
 
 void CLinkItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(2, indent);
 	file->writeQuotedLine("L", indent);
 	file->writeNumberLine(_cursorId, indent + 1);
-	file->writeNumberLine(_field30, indent + 1);
+	file->writeNumberLine(_linkMode, indent + 1);
 	file->writeNumberLine(_roomNumber, indent + 1);
 	file->writeNumberLine(_nodeNumber, indent + 1);
 	file->writeNumberLine(_viewNumber, indent + 1);
@@ -71,7 +99,7 @@ void CLinkItem::load(SimpleFile *file) {
 		// Deliberate fall-through
 
 	case 1:
-		_field30 = file->readNumber();
+		_linkMode = file->readNumber();
 		// Deliberate fall-through
 
 	case 0:
@@ -93,7 +121,7 @@ void CLinkItem::load(SimpleFile *file) {
 	CNamedItem::load(file);
 
 	if (val < 2) {
-		switch (_field30) {
+		switch (_linkMode) {
 		case 2:
 			_cursorId = CURSOR_MOVE_LEFT;
 			break;
@@ -120,11 +148,11 @@ bool CLinkItem::connectsTo(CViewItem *destView) const {
 }
 
 void CLinkItem::setDestination(int roomNumber, int nodeNumber,
-		int viewNumber, int v) {
+		int viewNumber, int linkMode) {
 	_roomNumber = roomNumber;
 	_nodeNumber = nodeNumber;
 	_viewNumber = viewNumber;
-	_field30 = v;
+	_linkMode = linkMode;
 
 	_name = formName();
 }
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index 09f3a7a..f194bc1 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -45,7 +45,7 @@ protected:
 	int _roomNumber;
 	int _nodeNumber;
 	int _viewNumber;
-	int _field30;
+	int _linkMode;
 public:
 	Rect _bounds;
 	CursorId _cursorId;
@@ -72,7 +72,7 @@ public:
 	 * Set the destination for the link item
 	 */
 	virtual void setDestination(int roomNumber, int nodeNumber,
-		int viewNumber, int v);
+		int viewNumber, int linkMode);
 
 	/**
 	 * Get the destination view for the link item


Commit: 382ba52e332a02a49343c1ba1c2aed80dfcd5c87
    https://github.com/scummvm/scummvm/commit/382ba52e332a02a49343c1ba1c2aed80dfcd5c87
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T12:45:29-04:00

Commit Message:
TITANIC: Fix exit crash when a movie is active

Changed paths:
    engines/titanic/support/movie.cpp



diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 9dc57b8..33e7d33 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -50,6 +50,15 @@ void CMovie::init() {
 }
 
 void CMovie::deinit() {
+	// Delete each movie in turn
+	for (CMovieList::iterator i = _playingMovies->begin(); i != _playingMovies->end(); ) {
+		// We need to increment iterator before deleting movie,
+		// since the CMovie destructor calls removeFromPlayingMovies
+		CMovie *movie = *i;
+		++i;
+		delete movie;
+	}
+
 	delete _playingMovies;
 	delete _movieSurface;
 }


Commit: 9e02409ef4ece6b3184c1d745106e87f3169e6ca
    https://github.com/scummvm/scummvm/commit/9e02409ef4ece6b3184c1d745106e87f3169e6ca
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T13:15:24-04:00

Commit Message:
TITANIC: Clarification and fixes for movie reverse and repeat flags

Changed paths:
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/avi_surface.h
    engines/titanic/support/movie.cpp
    engines/titanic/support/movie_range_info.cpp
    engines/titanic/support/movie_range_info.h



diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index c64edca..c3a7201 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -103,7 +103,7 @@ bool AVISurface::play(int startFrame, int endFrame, int initialFrame, uint flags
 	info->_startFrame = startFrame;
 	info->_endFrame = endFrame;
 	info->_isReversed = endFrame < startFrame;
-	info->_isFlag1 = flags & MOVIE_1;
+	info->_isRepeat = flags & MOVIE_REPEAT;
 
 	if (obj) {
 		CMovieEvent *me = new CMovieEvent();
@@ -119,6 +119,8 @@ bool AVISurface::play(int startFrame, int endFrame, int initialFrame, uint flags
 	_movieRangeInfo.push_back(info);
 	
 	if (_movieRangeInfo.size() == 1) {
+		// First play call, so start the movie playing
+		setReversed(info->_isReversed);
 		return startAtFrame(initialFrame);
 	} else {
 		return true;
@@ -164,6 +166,12 @@ void AVISurface::seekToFrame(uint frameNumber) {
 	renderFrame();
 }
 
+void AVISurface::setReversed(bool isReversed) {
+	_decoders[0]->setReverse(isReversed);
+	if (_decoders[1])
+		_decoders[1]->setReverse(isReversed);
+}
+
 bool AVISurface::handleEvents(CMovieEventList &events) {
 	if (!isPlaying())
 		return true;
@@ -173,7 +181,9 @@ bool AVISurface::handleEvents(CMovieEventList &events) {
 
 	if ((info->_isReversed && currentPos < info->_endFrame) ||
 		(!info->_isReversed && currentPos > info->_endFrame)) {
-		if (info->_isFlag1) {
+		if (info->_isRepeat) {
+			currentPos = info->_startFrame;
+		} else {
 			info->getMovieEnd(events);
 			_movieRangeInfo.remove(info);
 			delete info;
@@ -186,15 +196,15 @@ bool AVISurface::handleEvents(CMovieEventList &events) {
 				info = _movieRangeInfo.front();
 				currentPos = info->_startFrame;
 			}
-		} else {
-			currentPos = info->_startFrame;
 		}
 	}
 
 	if (isPlaying()) {
-		if (currentPos != getFrame())
+		if (currentPos != getFrame()) {
 			// The frame has been changed, so move to new position
+			setReversed(info->_isReversed);
 			seekToFrame(currentPos);
+		}
 	
 		// Get any events for the given position
 		info->getMovieFrame(events, currentPos);
@@ -267,7 +277,8 @@ int AVISurface::getFrame() const {
 }
 
 bool AVISurface::isFrameReady() const {
-	return _decoders[0]->needsUpdate() && (!_decoders[1] || _decoders[1]->needsUpdate());
+	return _decoders[0]->needsUpdate() && 
+		(!_decoders[1] || _decoders[1]->needsUpdate());
 }
 
 bool AVISurface::renderFrame() {
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index 4372757..77186ed 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -34,7 +34,7 @@ class CSoundManager;
 class CVideoSurface;
 
 enum MovieFlag {
-	MOVIE_1 = 1, MOVIE_STOP_PREVIOUS = 2, MOVIE_NO_OBJECT = 4,
+	MOVIE_REPEAT = 1, MOVIE_STOP_PREVIOUS = 2, MOVIE_NO_OBJECT = 4,
 	MOVIE_REVERSE = 8, MOVIE_GAMESTATE = 0x10
 };
 
@@ -69,7 +69,12 @@ protected:
 	/**
 	 * Start playback at the specified frame
 	 */
-	virtual bool startAtFrame(int frameNumber);
+	bool startAtFrame(int frameNumber);
+
+	/**
+	 * Sets whether the movie is playing in reverse
+	 */
+	void setReversed(bool isReversed);
 
 	/**
 	 * Seeks to a given frame number in the video
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index 33e7d33..eba878e 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -175,7 +175,7 @@ bool OSMovie::handleEvents(CMovieEventList &events) {
 		return _aviSurface.isPlaying();
 
 	// Handle updating the frame
-	while (_aviSurface.isFrameReady()) {
+	while (_aviSurface.isPlaying() && _aviSurface.isFrameReady()) {
 		_aviSurface.handleEvents(events);
 		_videoSurface->setMovieFrameSurface(_aviSurface.getSecondarySurface());
 	}
diff --git a/engines/titanic/support/movie_range_info.cpp b/engines/titanic/support/movie_range_info.cpp
index 4c62539..634ab1c 100644
--- a/engines/titanic/support/movie_range_info.cpp
+++ b/engines/titanic/support/movie_range_info.cpp
@@ -38,7 +38,7 @@ CMovieRangeInfo::CMovieRangeInfo(const CMovieRangeInfo *src) : ListItem() {
 	_endFrame = src->_endFrame;
 	_initialFrame = src->_initialFrame;
 	_isReversed = src->_isReversed;
-	_isFlag1 = src->_isFlag1;
+	_isRepeat = src->_isRepeat;
 
 	// Duplicate the events list
 	for (CMovieEventList::const_iterator i = _events.begin();
@@ -52,7 +52,7 @@ void CMovieRangeInfo::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(_startFrame, indent + 1);
 	file->writeNumberLine(_endFrame, indent + 1);
 	file->writeNumberLine(_initialFrame, indent + 1);
-	file->writeNumberLine(_isFlag1, indent + 1);
+	file->writeNumberLine(_isRepeat, indent + 1);
 	file->writeNumberLine(_isReversed, indent + 1);
 	_events.save(file, indent + 1);
 }
@@ -63,7 +63,7 @@ void CMovieRangeInfo::load(SimpleFile *file) {
 		_startFrame = file->readNumber();
 		_endFrame = file->readNumber();
 		_initialFrame = file->readNumber();
-		_isFlag1 = file->readNumber();
+		_isRepeat = file->readNumber();
 		_isReversed = file->readNumber();
 		_events.load(file);
 	}
@@ -88,7 +88,7 @@ void CMovieRangeInfo::getMovieFrame(CMovieEventList &list, int frameNumber) {
 void CMovieRangeInfo::process(CGameObject *owner) {
 	int flags = 0;
 	if (_endFrame)
-		flags |= MOVIE_1;
+		flags |= MOVIE_REPEAT;
 	if (_startFrame)
 		flags |= MOVIE_REVERSE;
 	
diff --git a/engines/titanic/support/movie_range_info.h b/engines/titanic/support/movie_range_info.h
index b8186e6..6b13fba 100644
--- a/engines/titanic/support/movie_range_info.h
+++ b/engines/titanic/support/movie_range_info.h
@@ -38,7 +38,7 @@ public:
 	int _endFrame;
 	int _initialFrame;
 	bool _isReversed;
-	bool _isFlag1;
+	bool _isRepeat;
 	CMovieEventList _events;
 public:
 	CMovieRangeInfo();


Commit: 00c568e17572ce2ac4e9c97c21c00a734951ae9a
    https://github.com/scummvm/scummvm/commit/00c568e17572ce2ac4e9c97c21c00a734951ae9a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T14:39:07-04:00

Commit Message:
TITANIC: Fix for movie play ranges that end at the AVI file end

Changed paths:
    engines/titanic/support/avi_surface.cpp
    engines/titanic/support/avi_surface.h
    engines/titanic/support/movie.cpp



diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp
index c3a7201..6507c8b 100644
--- a/engines/titanic/support/avi_surface.cpp
+++ b/engines/titanic/support/avi_surface.cpp
@@ -57,6 +57,12 @@ AVISurface::AVISurface(const CResourceKey &key) {
 	_streamCount = 0;
 	_movieFrameSurface[0] = _movieFrameSurface[1] = nullptr;
 
+	// Reset current frame. We need to keep track of frames separately from the decoders,
+	// since it needs to be able to go beyond the frame count or to negative to allow
+	// correct detection of when range playbacks have finished
+	_currentFrame = -1;
+	_isReversed = false;
+
 	// Create a decoder for the audio (if any) and primary video track
 	_decoders[0] = new AVIDecoder(Audio::Mixer::kPlainSoundType, primaryTrackSelect);
 	if (!_decoders[0]->loadFile(key.getString()))
@@ -103,6 +109,7 @@ bool AVISurface::play(int startFrame, int endFrame, int initialFrame, uint flags
 	info->_startFrame = startFrame;
 	info->_endFrame = endFrame;
 	info->_isReversed = endFrame < startFrame;
+	info->_initialFrame = 0;
 	info->_isRepeat = flags & MOVIE_REPEAT;
 
 	if (obj) {
@@ -161,6 +168,8 @@ void AVISurface::seekToFrame(uint frameNumber) {
 		_decoders[0]->seekToFrame(frameNumber);
 		if (_decoders[1])
 			_decoders[1]->seekToFrame(frameNumber);
+
+		_currentFrame = (int)frameNumber;
 	}
 
 	renderFrame();
@@ -170,6 +179,8 @@ void AVISurface::setReversed(bool isReversed) {
 	_decoders[0]->setReverse(isReversed);
 	if (_decoders[1])
 		_decoders[1]->setReverse(isReversed);
+
+	_isReversed = isReversed;
 }
 
 bool AVISurface::handleEvents(CMovieEventList &events) {
@@ -177,12 +188,13 @@ bool AVISurface::handleEvents(CMovieEventList &events) {
 		return true;
 
 	CMovieRangeInfo *info = _movieRangeInfo.front();
-	int currentPos = getFrame();
+	_currentFrame += _isReversed ? -1 : 1;
 
-	if ((info->_isReversed && currentPos < info->_endFrame) ||
-		(!info->_isReversed && currentPos > info->_endFrame)) {
+	int newFrame = _currentFrame;
+	if ((info->_isReversed && newFrame <= info->_endFrame) ||
+		(!info->_isReversed && newFrame >= info->_endFrame)) {
 		if (info->_isRepeat) {
-			currentPos = info->_startFrame;
+			newFrame = info->_startFrame;
 		} else {
 			info->getMovieEnd(events);
 			_movieRangeInfo.remove(info);
@@ -194,20 +206,20 @@ bool AVISurface::handleEvents(CMovieEventList &events) {
 			} else {
 				// Not empty, so move onto new first one
 				info = _movieRangeInfo.front();
-				currentPos = info->_startFrame;
+				newFrame = info->_startFrame;
 			}
 		}
 	}
 
 	if (isPlaying()) {
-		if (currentPos != getFrame()) {
+		if (newFrame != getFrame()) {
 			// The frame has been changed, so move to new position
 			setReversed(info->_isReversed);
-			seekToFrame(currentPos);
+			seekToFrame(newFrame);
 		}
 	
 		// Get any events for the given position
-		info->getMovieFrame(events, currentPos);
+		info->getMovieFrame(events, newFrame);
 		return renderFrame();
 	} else {
 		return false;
@@ -272,18 +284,13 @@ void AVISurface::setFrame(int frameNumber) {
 	renderFrame();
 }
 
-int AVISurface::getFrame() const {
-	return _decoders[0]->getCurFrame();
-}
-
-bool AVISurface::isFrameReady() const {
-	return _decoders[0]->needsUpdate() && 
-		(!_decoders[1] || _decoders[1]->needsUpdate());
+bool AVISurface::isNextFrame() const {
+	return _decoders[0]->getTimeToNextFrame() == 0;
 }
 
 bool AVISurface::renderFrame() {
 	// Check there's a frame ready for display
-	if (!isFrameReady())
+	if (!_decoders[0]->needsUpdate())
 		return false;
 
 	// Decode each decoder's video stream into the appropriate surface
@@ -331,10 +338,9 @@ bool AVISurface::addEvent(int frameNumber, CGameObject *obj) {
 }
 
 void AVISurface::setFrameRate(double rate) {
-	if (rate >= 0.0 && rate <= 100.0) {
-		_frameRate = rate;
-		warning("TODO: Frame rate set to %d yet to be implemented", (int)rate);
-	}
+	_decoders[0]->setRate(Common::Rational(rate));
+	if (_decoders[1])
+		_decoders[1]->setRate(Common::Rational(rate));
 }
 
 Graphics::ManagedSurface *AVISurface::getSecondarySurface() {
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index 77186ed..53e2aae 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -55,6 +55,8 @@ private:
 	CMovieRangeInfoList _movieRangeInfo;
 	int _streamCount;
 	Graphics::ManagedSurface *_movieFrameSurface[2];
+	bool _isReversed;
+	int _currentFrame;
 private:
 	/**
 	 * Render a frame to the video surface
@@ -141,7 +143,7 @@ public:
 	/**
 	 * Gets the current frame
 	 */
-	int getFrame() const;
+	int getFrame() const { return _currentFrame; }
 
 	/**
 	 * Add a movie event
@@ -171,9 +173,9 @@ public:
 	Graphics::ManagedSurface *duplicateSecondaryFrame() const;
 
 	/**
-	 * Returns true if a frame is ready to be rendered
+	 * Returns true if it's time for the next
 	 */
-	bool isFrameReady() const;
+	bool isNextFrame() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/movie.cpp b/engines/titanic/support/movie.cpp
index eba878e..3c935e8 100644
--- a/engines/titanic/support/movie.cpp
+++ b/engines/titanic/support/movie.cpp
@@ -171,11 +171,11 @@ void OSMovie::setFrame(uint frameNumber) {
 bool OSMovie::handleEvents(CMovieEventList &events) {
 	if (!_aviSurface.isPlaying())
 		return false;
-	if (!_aviSurface.isFrameReady())
+	if (!_aviSurface.isNextFrame())
 		return _aviSurface.isPlaying();
 
 	// Handle updating the frame
-	while (_aviSurface.isPlaying() && _aviSurface.isFrameReady()) {
+	while (_aviSurface.isPlaying() && _aviSurface.isNextFrame()) {
 		_aviSurface.handleEvents(events);
 		_videoSurface->setMovieFrameSurface(_aviSurface.getSecondarySurface());
 	}


Commit: d979dcd020d65aa0019d7a53c1dcd8b4f4a0f909
    https://github.com/scummvm/scummvm/commit/d979dcd020d65aa0019d7a53c1dcd8b4f4a0f909
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T17:21:38-04:00

Commit Message:
TITANIC: Fixes for movie notification, computer game logic cleanup

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/game/cdrom.cpp
    engines/titanic/game/cdrom_tray.cpp
    engines/titanic/game/cdrom_tray.h
    engines/titanic/game/computer_screen.cpp
    engines/titanic/game_state.cpp
    engines/titanic/game_state.h
    engines/titanic/input_handler.cpp
    engines/titanic/main_game_window.cpp
    engines/titanic/support/avi_surface.h
    engines/titanic/support/files_manager.cpp
    engines/titanic/support/time_event_info.cpp



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 5d913eb..4f9a2a5 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -485,7 +485,7 @@ void CGameObject::petShow() {
 	CGameManager *gameManager = getGameManager();
 	if (gameManager) {
 		gameManager->_gameState._petActive = true;
-		gameManager->_gameState.setMode(GSMODE_SELECTED);
+		gameManager->_gameState.setMode(GSMODE_INTERACTIVE);
 		gameManager->initBounds();
 	}
 }
@@ -494,7 +494,7 @@ void CGameObject::petHide() {
 	CGameManager *gameManager = getGameManager();
 	if (gameManager) {
 		gameManager->_gameState._petActive = false;
-		gameManager->_gameState.setMode(GSMODE_SELECTED);
+		gameManager->_gameState.setMode(GSMODE_INTERACTIVE);
 		gameManager->initBounds();
 	}
 }
@@ -513,7 +513,7 @@ void CGameObject::playMovie(uint flags) {
 		_resource.clear();
 	}
 
-	CGameObject *obj = (flags & MOVIE_NO_OBJECT) ? nullptr : this;
+	CGameObject *obj = (flags & MOVIE_NOTIFY_OBJECT) ? this : nullptr;
 	if (_surface) {
 		_surface->playMovie(flags, obj);
 		if (flags & MOVIE_GAMESTATE)
@@ -530,7 +530,7 @@ void CGameObject::playMovie(int startFrame, int endFrame, uint flags) {
 		_resource.clear();
 	}
 
-	CGameObject *obj = (flags & MOVIE_NO_OBJECT) ? nullptr : this;
+	CGameObject *obj = (flags & MOVIE_NOTIFY_OBJECT) ? this : nullptr;
 	if (_surface) {
 		_surface->playMovie(startFrame, endFrame, flags, obj);
 		if (flags & MOVIE_GAMESTATE)
@@ -548,7 +548,7 @@ void CGameObject::playMovie(int startFrame, int endFrame, int initialFrame, uint
 		_resource.clear();
 	}
 
-	CGameObject *obj = (flags & MOVIE_NO_OBJECT) ? nullptr : this;
+	CGameObject *obj = (flags & MOVIE_NOTIFY_OBJECT) ? this : nullptr;
 	if (_surface) {
 		_surface->playMovie(startFrame, endFrame, initialFrame, flags, obj);
 		if (flags & MOVIE_GAMESTATE)
diff --git a/engines/titanic/game/cdrom.cpp b/engines/titanic/game/cdrom.cpp
index 111b090..cd913d0 100644
--- a/engines/titanic/game/cdrom.cpp
+++ b/engines/titanic/game/cdrom.cpp
@@ -62,7 +62,7 @@ bool CCDROM::MouseDragEndMsg(CMouseDragEndMsg *msg) {
 	if (msg->_dropTarget && msg->_dropTarget->getName() == "newComputer") {
 		CCDROMTray *newTray = dynamic_cast<CCDROMTray *>(getRoom()->findByName("newTray"));
 
-		if (newTray->_state && newTray->_insertedCD == "None") {
+		if (newTray->_isOpened && newTray->_insertedCD == "None") {
 			CActMsg actMsg(getName());
 			actMsg.execute(newTray);
 			setVisible(false);
diff --git a/engines/titanic/game/cdrom_tray.cpp b/engines/titanic/game/cdrom_tray.cpp
index 118150b..1e5b135 100644
--- a/engines/titanic/game/cdrom_tray.cpp
+++ b/engines/titanic/game/cdrom_tray.cpp
@@ -33,12 +33,12 @@ BEGIN_MESSAGE_MAP(CCDROMTray, CGameObject)
 END_MESSAGE_MAP()
 
 
-CCDROMTray::CCDROMTray() : CGameObject(), _state(0) {
+CCDROMTray::CCDROMTray() : CGameObject(), _isOpened(false) {
 }
 
 void CCDROMTray::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
-	file->writeNumberLine(_state, indent);
+	file->writeNumberLine(_isOpened, indent);
 	file->writeQuotedLine(_insertedCD, indent);
 
 	CGameObject::save(file, indent);
@@ -46,7 +46,7 @@ void CCDROMTray::save(SimpleFile *file, int indent) {
 
 void CCDROMTray::load(SimpleFile *file) {
 	file->readNumber();
-	_state = file->readNumber();
+	_isOpened = file->readNumber();
 	_insertedCD = file->readString();
 
 	CGameObject::load(file);
@@ -54,65 +54,73 @@ void CCDROMTray::load(SimpleFile *file) {
 
 bool CCDROMTray::ActMsg(CActMsg *msg) {
 	if (msg->_action == "ClickedOn") {
-		if (_state) {
+		if (_isOpened) {
+			// Closing the tray
 			if (_insertedCD == "None") {
+				// No CD in tray
 				playMovie(55, 65, 0);
 				playSound("a#35.wav", 50, 0, 0);
-				_state = 0;
+				_isOpened = false;
 			} else {
-				CTreeItem *treeItem = getRoom()->findByName(_insertedCD);
-				if (treeItem) {
+				// Ejecting tray with CD
+				CTreeItem *cdrom = getRoom()->findByName(_insertedCD);
+				if (cdrom) {
 					CActMsg actMsg("Ejected");
-					actMsg.execute(treeItem);
+					actMsg.execute(cdrom);
 				}
 
 				_insertedCD = "None";
 				loadFrame(52);
 			}
 		} else if (_insertedCD == "None") {
+			// Opening tray with no CD
 			playMovie(44, 54, 0);
 			playSound("a#34.wav", 50, 0, 0);
-			_state = 1;
+			_isOpened = true;
 		} else if (_insertedCD == "newCD1" || _insertedCD == "newCD2") {
+			// Opening tray with standard CD
 			playMovie(22, 32, 0);
 			playSound("a#34.wav", 50, 0, 0);
-			_state = 1;
+			_isOpened = true;
 		} else if (_insertedCD == "newSTCD") {
+			// Opening tray with Starship Titanic CD
 			playMovie(0, 10, 0);
 			playSound("a#34.wav", 50, 0, 0);
-			_state = 1;
+			_isOpened = true;
 		}
-	} else if (_state) {
+	} else if (_isOpened) {
 		if (msg->_action == "newCD1" || msg->_action == "newCD2") {
-			playMovie(33, 43, 4);
+			// Standard CD dropped on CDROM Tray
+			playMovie(33, 43, MOVIE_NOTIFY_OBJECT);
 			playSound("a#35.wav", 50, 0, 0);
 		} else if (msg->_action == "newSTCD") {
-			playMovie(11, 21, 4);
+			// Starship Titanic CD dropped on CDROM Tray
+			playMovie(11, 21, MOVIE_NOTIFY_OBJECT);
 			playSound("a#35.wav", 50, 0, 0);
 		} else {
 			return true;
 		}
 
 		_insertedCD = msg->_action;
-		_state = 0;
+		_isOpened = false;
 	}
 
 	return true;
 }
 
 bool CCDROMTray::MovieEndMsg(CMovieEndMsg *msg) {
-	CTreeItem *treeItem = getRoom()->findByName("newScreen");
+	CTreeItem *screen = getRoom()->findByName("newScreen");
 	
-	if (treeItem) {
+	if (screen) {
 		CActMsg actMsg(_insertedCD);
-		actMsg.execute(treeItem);
+		actMsg.execute(screen);
 	}
 
 	return true;
 }
 
 bool CCDROMTray::StatusChangeMsg(CStatusChangeMsg *msg) {
-	msg->_success = _state;
+	msg->_success = _isOpened;
 	return true;
 }
 
diff --git a/engines/titanic/game/cdrom_tray.h b/engines/titanic/game/cdrom_tray.h
index dbeec17..c91e045 100644
--- a/engines/titanic/game/cdrom_tray.h
+++ b/engines/titanic/game/cdrom_tray.h
@@ -34,7 +34,7 @@ class CCDROMTray : public CGameObject {
 	bool MovieEndMsg(CMovieEndMsg *msg);
 	bool StatusChangeMsg(CStatusChangeMsg *msg);
 public:
-	int _state;
+	bool _isOpened;
 	CString _insertedCD;
 public:
 	CLASSDEF
diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp
index c73db4f..b73beda 100644
--- a/engines/titanic/game/computer_screen.cpp
+++ b/engines/titanic/game/computer_screen.cpp
@@ -47,10 +47,10 @@ void CComputerScreen::load(SimpleFile *file) {
 
 bool CComputerScreen::ActMsg(CActMsg *msg) {
 	if (msg->_action == "newCD1" || msg->_action == "newCD2") {
-		playMovie(27, 53, 16);
-		playMovie(19, 26, 16);
+		playMovie(27, 53, MOVIE_GAMESTATE);
+		playMovie(19, 26, MOVIE_GAMESTATE);
 	} else if (msg->_action == "newSTCD") {
-		playMovie(0, 18, 20);
+		playMovie(0, 18, MOVIE_GAMESTATE | MOVIE_NOTIFY_OBJECT);
 	}
 
 	return true;
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index f7ae304..0f2ed17 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -36,7 +36,7 @@ bool CGameStateMovieList::clear() {
 
 CGameState::CGameState(CGameManager *gameManager) :
 		_gameManager(gameManager), _gameLocation(this),
-		_passengerClass(0), _priorClass(0), _mode(GSMODE_UNSELECTED),
+		_passengerClass(0), _priorClass(0), _mode(GSMODE_NONE),
 		_field14(0), _petActive(false), _field1C(false), _quitGame(false),
 		_field24(0), _nodeChangeCtr(0), _nodeEnterTicks(0), _field38(0) {
 }
@@ -69,14 +69,14 @@ void CGameState::load(SimpleFile *file) {
 void CGameState::setMode(GameStateMode newMode) {
 	CScreenManager *sm = CScreenManager::_screenManagerPtr;
 
-	if (newMode == GSMODE_2 && newMode != _mode) {
+	if (newMode == GSMODE_CUTSCENE && newMode != _mode) {
 		if (_gameManager)
 			_gameManager->lockInputHandler();
 
 		if (sm && sm->_mouseCursor)
 			sm->_mouseCursor->hide();
 
-	} else if (newMode != GSMODE_2 && newMode != _mode) {
+	} else if (newMode != GSMODE_CUTSCENE && newMode != _mode) {
 		if (sm && sm->_mouseCursor)
 			sm->_mouseCursor->show();
 	
@@ -123,7 +123,7 @@ void CGameState::changeView(CViewItem *newView, CMovieClip *clip) {
 	if (g_vm->_window->isSpecialPressed(MK_SHIFT))
 		clip = nullptr;
 
-	if (_mode == GSMODE_2) {
+	if (_mode == GSMODE_CUTSCENE) {
 		_movieList._view = newView;
 		_movieList._movieClip = clip;
 	} else {
@@ -143,8 +143,8 @@ void CGameState::changeView(CViewItem *newView, CMovieClip *clip) {
 }
 
 void CGameState::checkForViewChange() {
-	if (_mode == GSMODE_2 && _movieList.clear()) {
-		setMode(GSMODE_SELECTED);
+	if (_mode == GSMODE_CUTSCENE && _movieList.clear()) {
+		setMode(GSMODE_INTERACTIVE);
 		if (_movieList._view)
 			enterView();
 	}
@@ -152,7 +152,7 @@ void CGameState::checkForViewChange() {
 
 void CGameState::addMovie(CMovie *movie) {
 	_movieList.push_back(new CMovieListItem(movie));
-	setMode(GSMODE_2);
+	setMode(GSMODE_CUTSCENE);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index d90c845..0bfa0d5 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -33,8 +33,10 @@ namespace Titanic {
 
 class CGameManager;
 
-enum GameStateMode { GSMODE_UNSELECTED = 0, GSMODE_SELECTED = 1, GSMODE_2 = 2, GSMODE_3 = 3, GSMODE_4 = 4, GSMODE_5 = 5,
-	GSMODE_PENDING_LOAD };
+enum GameStateMode { 
+	GSMODE_NONE = 0, GSMODE_INTERACTIVE = 1, GSMODE_CUTSCENE = 2,
+	GSMODE_3 = 3, GSMODE_4 = 4, GSMODE_5 = 5, GSMODE_PENDING_LOAD = 6
+};
 
 PTR_LIST_ITEM(CMovie);
 class CGameStateMovieList : public List<CMovieListItem> {
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index 289e707..395f55d 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -50,7 +50,7 @@ void CInputHandler::decLockCount() {
 
 void CInputHandler::handleMessage(CMessage &msg, bool respectLock) {
 	if (!respectLock || _lockCount <= 0) {
-		if (_gameManager->_gameState._mode == GSMODE_SELECTED) {
+		if (_gameManager->_gameState._mode == GSMODE_INTERACTIVE) {
 			processMessage(&msg);
 		} else if (!msg.isMouseMsg()) {
 			g_vm->_filesManager->loadDrive();
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index 2ecc319..46d658b 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -75,7 +75,7 @@ void CMainGameWindow::applicationStarting() {
 	// Load either a new game or selected existing save
 	_project->loadGame(saveSlot);
 	_inputAllowed = true;
-	_gameManager->_gameState.setMode(GSMODE_SELECTED);
+	_gameManager->_gameState.setMode(GSMODE_INTERACTIVE);
 
 	// TODO: Cursor/image
 
@@ -147,8 +147,8 @@ void CMainGameWindow::draw() {
 		scrManager->clearSurface(SURFACE_BACKBUFFER, &_gameManager->_bounds);
 
 		switch (_gameManager->_gameState._mode) {
-		case GSMODE_SELECTED:
-		case GSMODE_2:
+		case GSMODE_INTERACTIVE:
+		case GSMODE_CUTSCENE:
 			if (_gameManager->_gameState._petActive)
 				drawPet(scrManager);
 
@@ -163,7 +163,7 @@ void CMainGameWindow::draw() {
 
 		case GSMODE_PENDING_LOAD:
 			// Pending savegame to load
-			_gameManager->_gameState.setMode(GSMODE_SELECTED);
+			_gameManager->_gameState.setMode(GSMODE_INTERACTIVE);
 			_vm->_window->_project->loadGame(_pendingLoadSlot);
 			break;
 
diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h
index 53e2aae..d21182b 100644
--- a/engines/titanic/support/avi_surface.h
+++ b/engines/titanic/support/avi_surface.h
@@ -34,7 +34,7 @@ class CSoundManager;
 class CVideoSurface;
 
 enum MovieFlag {
-	MOVIE_REPEAT = 1, MOVIE_STOP_PREVIOUS = 2, MOVIE_NO_OBJECT = 4,
+	MOVIE_REPEAT = 1, MOVIE_STOP_PREVIOUS = 2, MOVIE_NOTIFY_OBJECT = 4,
 	MOVIE_REVERSE = 8, MOVIE_GAMESTATE = 0x10
 };
 
diff --git a/engines/titanic/support/files_manager.cpp b/engines/titanic/support/files_manager.cpp
index 1d2b1d9..04928b9 100644
--- a/engines/titanic/support/files_manager.cpp
+++ b/engines/titanic/support/files_manager.cpp
@@ -109,7 +109,7 @@ void CFilesManager::debug(CScreenManager *screenManager) {
 
 void CFilesManager::resetView() {
 	if (_gameManager) {
-		_gameManager->_gameState.setMode(GSMODE_SELECTED);
+		_gameManager->_gameState.setMode(GSMODE_INTERACTIVE);
 		_gameManager->initBounds();
 	}
 }
diff --git a/engines/titanic/support/time_event_info.cpp b/engines/titanic/support/time_event_info.cpp
index 041a01c..a192233 100644
--- a/engines/titanic/support/time_event_info.cpp
+++ b/engines/titanic/support/time_event_info.cpp
@@ -100,7 +100,7 @@ CTimeEventInfo::CTimeEventInfo() : ListItem(), _lockCounter(0),
 CTimeEventInfo::CTimeEventInfo(uint ticks, uint f14, uint firstDuration,
 		uint duration, CTreeItem *target, int timerVal3, const CString &action) :
 		ListItem(), _lockCounter(0), _field14(f14), _firstDuration(firstDuration),
-		_duration(duration), _target(target), _field2C(0), _field30(0),
+		_duration(duration), _target(target), _actionVal(0), _field2C(0), _field30(0),
 		_timerCtr(0), _lastTimerTicks(ticks), _field3C(0), _done(false),
 		_field44(true) {
 	_id = _nextId++;


Commit: d690ca322c04ee2044b7502369c5cc104a0c7b76
    https://github.com/scummvm/scummvm/commit/d690ca322c04ee2044b7502369c5cc104a0c7b76
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T18:10:34-04:00

Commit Message:
TITANIC: Cleanup of CTimeEventInfo class

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/game/computer_screen.cpp
    engines/titanic/messages/messages.h
    engines/titanic/support/time_event_info.cpp
    engines/titanic/support/time_event_info.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 4f9a2a5..d33a0c9 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -659,17 +659,17 @@ void CGameObject::stopSound(int handle, int val2) {
 	}
 }
 
-int CGameObject::addTimer(int endVal, uint firstDuration, uint duration) {
+int CGameObject::addTimer(int endVal, uint firstDuration, uint repeatDuration) {
 	CTimeEventInfo *timer = new CTimeEventInfo(g_vm->_events->getTicksCount(),
-		duration != 0, firstDuration, duration, this, endVal, CString());
+		repeatDuration != 0, firstDuration, repeatDuration, this, endVal, CString());
 
 	getGameManager()->addTimer(timer);
 	return timer->_id;
 }
 
-int CGameObject::addTimer(uint firstDuration, uint duration) {
+int CGameObject::addTimer(uint firstDuration, uint repeatDuration) {
 	CTimeEventInfo *timer = new CTimeEventInfo(g_vm->_events->getTicksCount(),
-		duration != 0, firstDuration, duration, this, 0, CString());
+		repeatDuration != 0, firstDuration, repeatDuration, this, 0, CString());
 
 	getGameManager()->addTimer(timer);
 	return timer->_id;
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 3f77776..bde5e25 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -210,12 +210,12 @@ protected:
 	/**
 	 * Adds a timer
 	 */
-	int addTimer(int endVal, uint firstDuration, uint duration);
+	int addTimer(int endVal, uint firstDuration, uint repeatDuration);
 
 	/**
 	 * Adds a timer
 	 */
-	int addTimer(uint firstDuration, uint duration);
+	int addTimer(uint firstDuration, uint repeatDuration);
 
 	/**
 	 * Stops a timer
diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp
index b73beda..fd56737 100644
--- a/engines/titanic/game/computer_screen.cpp
+++ b/engines/titanic/game/computer_screen.cpp
@@ -73,7 +73,7 @@ bool CComputerScreen::EnterViewMsg(CEnterViewMsg *msg) {
 bool CComputerScreen::TimerMsg(CTimerMsg *msg) {
 	int handle;
 
-	switch (msg->_val3) {
+	switch (msg->_actionVal) {
 	case 0:
 		loadSound("a#32.wav");
 		loadSound("a#31.wav");
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index de5d0bd..0fe6968 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -185,13 +185,13 @@ MESSAGE1(CTimeMsg, uint, _ticks, 0);
 class CTimerMsg : public CTimeMsg {
 public:
 	uint _timerCtr;
-	int _val3;
+	int _actionVal;
 	CString _action;
 public:
 	CLASSDEF
-	CTimerMsg() : CTimeMsg(), _timerCtr(0), _val3(0) {}
-	CTimerMsg(uint ticks, uint timerCtr, int val2, const CString &action) :
-		CTimeMsg(ticks), _timerCtr(timerCtr), _val3(val2), _action(action) {}
+	CTimerMsg() : CTimeMsg(), _timerCtr(0), _actionVal(0) {}
+	CTimerMsg(uint ticks, uint timerCtr, int actionVal, const CString &action) :
+		CTimeMsg(ticks), _timerCtr(timerCtr), _actionVal(actionVal), _action(action) {}
 
 	static bool isSupportedBy(const CTreeItem *item) {
 		return supports(item, _type);
diff --git a/engines/titanic/support/time_event_info.cpp b/engines/titanic/support/time_event_info.cpp
index a192233..1787741 100644
--- a/engines/titanic/support/time_event_info.cpp
+++ b/engines/titanic/support/time_event_info.cpp
@@ -91,17 +91,17 @@ void CTimeEventInfoList::set44(uint id, uint val) {
 uint CTimeEventInfo::_nextId;
 
 CTimeEventInfo::CTimeEventInfo() : ListItem(), _lockCounter(0), 
-		_field14(0), _firstDuration(0), _duration(0), _target(nullptr),
+		_repeated(false), _firstDuration(0), _repeatDuration(0), _target(nullptr),
 		_actionVal(0), _field2C(0), _field30(0), _timerCtr(0),
-		_lastTimerTicks(0), _field3C(0), _done(false), _field44(0) {
+		_lastTimerTicks(0), _relativeTicks(0), _done(false), _field44(0) {
 	_id = _nextId++;
 }
 
-CTimeEventInfo::CTimeEventInfo(uint ticks, uint f14, uint firstDuration,
-		uint duration, CTreeItem *target, int timerVal3, const CString &action) :
-		ListItem(), _lockCounter(0), _field14(f14), _firstDuration(firstDuration),
-		_duration(duration), _target(target), _actionVal(0), _field2C(0), _field30(0),
-		_timerCtr(0), _lastTimerTicks(ticks), _field3C(0), _done(false),
+CTimeEventInfo::CTimeEventInfo(uint ticks, bool repeated, uint firstDuration,
+		uint repeatDuration, CTreeItem *target, int endVal, const CString &action) :
+		ListItem(), _lockCounter(0), _repeated(repeated), _firstDuration(firstDuration),
+		_repeatDuration(repeatDuration), _target(target), _actionVal(endVal), _field2C(0), 
+		_field30(0), _timerCtr(0), _lastTimerTicks(ticks), _relativeTicks(0), _done(false),
 		_field44(true) {
 	_id = _nextId++;
 }
@@ -114,13 +114,13 @@ void CTimeEventInfo::save(SimpleFile *file, int indent) {
 		targetName = _target->getName();
 	file->writeQuotedLine(targetName, indent);
 	file->writeNumberLine(_id, indent);
-	file->writeNumberLine(_field14, indent);
+	file->writeNumberLine(_repeated, indent);
 	file->writeNumberLine(_firstDuration, indent);
-	file->writeNumberLine(_duration, indent);
+	file->writeNumberLine(_repeatDuration, indent);
 	file->writeNumberLine(_actionVal, indent);
 	file->writeQuotedLine(_action, indent);
 	file->writeNumberLine(_timerCtr, indent);
-	file->writeNumberLine(_field3C, indent);
+	file->writeNumberLine(_relativeTicks, indent);
 	file->writeNumberLine(_done, indent);
 	file->writeNumberLine(_field44, indent);
 }
@@ -132,13 +132,13 @@ void CTimeEventInfo::load(SimpleFile *file) {
 	if (!val) {
 		_targetName = file->readString();
 		_id = file->readNumber();
-		_field14 = file->readNumber();
+		_repeated = file->readNumber();
 		_firstDuration = file->readNumber();
-		_duration = file->readNumber();
+		_repeatDuration = file->readNumber();
 		_actionVal = file->readNumber();
 		_action = file->readString();
 		_timerCtr = file->readNumber();
-		_field3C = file->readNumber();
+		_relativeTicks = file->readNumber();
 		_done = file->readNumber() != 0;
 		_field44 = file->readNumber();
 		_target = nullptr;
@@ -155,7 +155,7 @@ void CTimeEventInfo::postLoad(uint ticks, CProjectItem *project) {
 	if (!_target)
 		_done = true;
 
-	_lastTimerTicks = ticks + _field3C;
+	_lastTimerTicks = ticks + _relativeTicks;
 	if (_id >= _nextId)
 		_nextId = _id + 1;
 
@@ -163,7 +163,7 @@ void CTimeEventInfo::postLoad(uint ticks, CProjectItem *project) {
 }
 
 void CTimeEventInfo::preSave(uint ticks) {
-	_field3C = _lastTimerTicks - ticks;
+	_relativeTicks = _lastTimerTicks - ticks;
 	lock();
 }
 
@@ -176,7 +176,7 @@ bool CTimeEventInfo::update(uint ticks) {
 		return false;
 
 	if (_timerCtr) {
-		if (ticks > (_lastTimerTicks + _duration)) {
+		if (ticks > (_lastTimerTicks + _repeatDuration)) {
 			++_timerCtr;
 			_lastTimerTicks = ticks;
 
@@ -195,7 +195,8 @@ bool CTimeEventInfo::update(uint ticks) {
 				timerMsg.execute(_target);
 			}
 
-			if (!_field14)
+			if (!_repeated)
+				// Event is done, and can be removed
 				return true;
 		}
 	}
diff --git a/engines/titanic/support/time_event_info.h b/engines/titanic/support/time_event_info.h
index b436f87..23d0d2b 100644
--- a/engines/titanic/support/time_event_info.h
+++ b/engines/titanic/support/time_event_info.h
@@ -49,9 +49,9 @@ public:
 public:
 	int _lockCounter;
 	uint _id;
-	uint _field14;
+	bool _repeated;
 	uint _firstDuration;
-	uint _duration;
+	uint _repeatDuration;
 	CTreeItem *_target;
 	uint _actionVal;
 	CString _action;
@@ -59,15 +59,15 @@ public:
 	uint _field30;
 	uint _timerCtr;
 	uint _lastTimerTicks;
-	uint _field3C;
+	uint _relativeTicks;
 	bool _done;
 	uint _field44;
 	CString _targetName;
 public:
 	CLASSDEF
 	CTimeEventInfo();
-	CTimeEventInfo(uint ticks, uint f14, uint firstDuration, uint duration,
-		CTreeItem *target, int timerVal3, const CString &action);
+	CTimeEventInfo(uint ticks, bool repeated, uint firstDuration, uint repeatDuration,
+		CTreeItem *target, int endVal, const CString &action);
 
 	/**
 	 * Save the data for the class to file


Commit: 2efee2ae8c1c4e285fe81bce66a594d9b949548a
    https://github.com/scummvm/scummvm/commit/2efee2ae8c1c4e285fe81bce66a594d9b949548a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T19:15:26-04:00

Commit Message:
TITANIC: Further timers cleanup

Changed paths:
    engines/titanic/game_manager.h
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/support/time_event_info.cpp
    engines/titanic/support/time_event_info.h



diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 4808b26..aa2df46 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -193,7 +193,12 @@ public:
 	 */
 	void stopTimer(uint id) { _timers.stop(id); }
 
-	void setTimer44(uint id, uint val) { _timers.set44(id, val); }
+	/**
+	 * Flags whether the timer will be persisent across save & loads
+	 */
+	void setTimerPersisent(uint id, bool flag) { 
+		_timers.setPersisent(id, flag);
+	}
 
 	/**
 	 * Return the true talk manager
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 0695cde..8308145 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -621,7 +621,7 @@ void CPetControl::startPetTimer(uint timerIndex, uint firstDuration, uint durati
 	stopPetTimer(timerIndex);
 	_timers[timerIndex]._id = addTimer(timerIndex, firstDuration, duration);
 	_timers[timerIndex]._target = target;
-	setTimer44(_timers[timerIndex]._id, 0);
+	setTimerPersisent(_timers[timerIndex]._id, false);
 }
 
 void CPetControl::stopPetTimer(uint timerIndex) {
@@ -631,8 +631,8 @@ void CPetControl::stopPetTimer(uint timerIndex) {
 	}
 }
 
-void CPetControl::setTimer44(int id, int val) {
-	getGameManager()->setTimer44(id, val);
+void CPetControl::setTimerPersisent(int id, bool flag) {
+	getGameManager()->setTimerPersisent(id, flag);
 }
 
 CGameObject *CPetControl::findBot(const CString &name, CTreeItem *root) {
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index e56d8f8..39df91c 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -103,7 +103,10 @@ private:
 	 */
 	CGameObject *findBot(const CString &name, CTreeItem *root);
 
-	void setTimer44(int id, int val);
+	/**
+	 * Flags whether the timer will be persisent across save & loads
+	 */
+	void setTimerPersisent(int id, bool flag);
 protected:
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
diff --git a/engines/titanic/support/time_event_info.cpp b/engines/titanic/support/time_event_info.cpp
index 1787741..0226223 100644
--- a/engines/titanic/support/time_event_info.cpp
+++ b/engines/titanic/support/time_event_info.cpp
@@ -76,11 +76,11 @@ void CTimeEventInfoList::stop(uint id) {
 	}
 }
 
-void CTimeEventInfoList::set44(uint id, uint val) {
+void CTimeEventInfoList::setPersisent(uint id, bool flag) {
 	for (iterator i = begin(); i != end(); ++i) {
 		CTimeEventInfo *item = *i;
 		if (item->_id == id) {
-			item->set44(val);
+			item->setPersisent(flag);
 			return;
 		}
 	}
@@ -91,18 +91,17 @@ void CTimeEventInfoList::set44(uint id, uint val) {
 uint CTimeEventInfo::_nextId;
 
 CTimeEventInfo::CTimeEventInfo() : ListItem(), _lockCounter(0), 
-		_repeated(false), _firstDuration(0), _repeatDuration(0), _target(nullptr),
-		_actionVal(0), _field2C(0), _field30(0), _timerCtr(0),
-		_lastTimerTicks(0), _relativeTicks(0), _done(false), _field44(0) {
+		_repeated(false), _firstDuration(0), _repeatDuration(0),
+		_target(nullptr), _actionVal(0), _timerCtr(0), _done(false),
+		_lastTimerTicks(0), _relativeTicks(0), _persisent(true) {
 	_id = _nextId++;
 }
 
 CTimeEventInfo::CTimeEventInfo(uint ticks, bool repeated, uint firstDuration,
 		uint repeatDuration, CTreeItem *target, int endVal, const CString &action) :
 		ListItem(), _lockCounter(0), _repeated(repeated), _firstDuration(firstDuration),
-		_repeatDuration(repeatDuration), _target(target), _actionVal(endVal), _field2C(0), 
-		_field30(0), _timerCtr(0), _lastTimerTicks(ticks), _relativeTicks(0), _done(false),
-		_field44(true) {
+		_repeatDuration(repeatDuration), _target(target), _actionVal(endVal), _done(false),
+		_timerCtr(0), _lastTimerTicks(ticks), _relativeTicks(0), _persisent(true) {
 	_id = _nextId++;
 }
 
@@ -122,7 +121,7 @@ void CTimeEventInfo::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(_timerCtr, indent);
 	file->writeNumberLine(_relativeTicks, indent);
 	file->writeNumberLine(_done, indent);
-	file->writeNumberLine(_field44, indent);
+	file->writeNumberLine(_persisent, indent);
 }
 
 void CTimeEventInfo::load(SimpleFile *file) {
@@ -140,13 +139,13 @@ void CTimeEventInfo::load(SimpleFile *file) {
 		_timerCtr = file->readNumber();
 		_relativeTicks = file->readNumber();
 		_done = file->readNumber() != 0;
-		_field44 = file->readNumber();
+		_persisent = file->readNumber() != 0;
 		_target = nullptr;
 	}
 }
 
 void CTimeEventInfo::postLoad(uint ticks, CProjectItem *project) {
-	if (!_field44 || _targetName.empty())
+	if (!_persisent || _targetName.empty())
 		_done = true;
 	
 	// Get the timer's target
diff --git a/engines/titanic/support/time_event_info.h b/engines/titanic/support/time_event_info.h
index 23d0d2b..ee787bc 100644
--- a/engines/titanic/support/time_event_info.h
+++ b/engines/titanic/support/time_event_info.h
@@ -55,13 +55,11 @@ public:
 	CTreeItem *_target;
 	uint _actionVal;
 	CString _action;
-	uint _field2C;
-	uint _field30;
 	uint _timerCtr;
 	uint _lastTimerTicks;
 	uint _relativeTicks;
 	bool _done;
-	uint _field44;
+	bool _persisent;
 	CString _targetName;
 public:
 	CLASSDEF
@@ -96,7 +94,10 @@ public:
 
 	bool update(uint ticks);
 
-	void set44(uint val) { _field44 = val; }
+	/**
+	 * Flags whether the timer will be persisent across save & loads
+	 */
+	void setPersisent(bool val) { _persisent = val; }
 };
 
 class CTimeEventInfoList : public List<CTimeEventInfo> {
@@ -126,7 +127,10 @@ public:
 	 */
 	void stop(uint id);
 
-	void set44(uint id, uint val);
+	/**
+	 * Sets whether a timer with a given Id will be persisent across saves
+	 */
+	void setPersisent(uint id, bool flag);
 };
 
 } // End of namespace Titanic


Commit: f1344c2c277125e652092b94a0a5347f842c45d0
    https://github.com/scummvm/scummvm/commit/f1344c2c277125e652092b94a0a5347f842c45d0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-23T21:50:51-04:00

Commit Message:
TITANIC: Added CCreditText loading

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/support/credit_text.cpp
    engines/titanic/support/credit_text.h
    engines/titanic/support/string.cpp
    engines/titanic/support/string.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index d33a0c9..af4ffab 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -193,8 +193,11 @@ void CGameObject::load(SimpleFile *file) {
 void CGameObject::draw(CScreenManager *screenManager) {
 	if (!_visible)
 		return;
-	if (_credits) {
-		error("TODO: Block in CGameObject::draw");
+	if (_credits && _credits->_objectP == this) {
+		if (!_credits->draw())
+			CGameObject::deinit();
+		
+		return;
 	}
 
 	if (_field40) {
diff --git a/engines/titanic/support/credit_text.cpp b/engines/titanic/support/credit_text.cpp
index e70d1dc..1f12341 100644
--- a/engines/titanic/support/credit_text.cpp
+++ b/engines/titanic/support/credit_text.cpp
@@ -26,13 +26,13 @@
 namespace Titanic {
 
 CCreditText::CCreditText() : _screenManagerP(nullptr), _field14(0),
-	_ticks(0), _fontHeight(1), _objectP(nullptr), _field34(0), _field38(0),
-	_field3C(0), _field40(0), _field44(0), _field48(0), _field4C(0),
-	_field50(0), _field54(0), _field58(0), _field5C(0) {
+	_ticks(0), _fontHeight(1), _objectP(nullptr), _totalHeight(0),
+	_field40(0), _field44(0), _field48(0), _field4C(0), _field50(0),
+	_field54(0), _field58(0), _field5C(0) {
 }
 
 void CCreditText::clear() {
-	_list.destroyContents();
+	_groups.destroyContents();
 	_objectP = nullptr;
 }
 
@@ -41,6 +41,9 @@ void CCreditText::load(CGameObject *obj, CScreenManager *screenManager,
 	_objectP = obj;
 	_screenManagerP = screenManager;
 	_field14 = v;
+
+	setup();
+
 	_ticks = g_vm->_events->getTicksCount();
 	_field40 = 0;
 	_field44 = 0xFF;
@@ -53,7 +56,95 @@ void CCreditText::load(CGameObject *obj, CScreenManager *screenManager,
 }
 
 void CCreditText::setup() {
-	// TODO
+	Common::SeekableReadStream *stream = g_vm->_filesManager->getResource(
+		CString::format("TEXT/155"));
+	int oldFontNumber = _screenManagerP->setFontNumber(3);
+	_fontHeight = _screenManagerP->getFontHeight();
+
+	while (stream->pos() < stream->size()) {
+		// Read in the line
+		CString srcLine = readLine(stream);
+
+		// Create a new group and line within it
+		CCreditLineGroup *group = new CCreditLineGroup();
+		CCreditLine *line = new CCreditLine(srcLine, 
+			_screenManagerP->stringWidth(srcLine));
+		group->_lines.push_back(line);
+
+		// Loop to add more lines to the group
+		bool hasDots = false;
+		while (stream->pos() < stream->size()) {
+			srcLine = readLine(stream);
+			if (srcLine.empty())
+				break;
+
+			CCreditLine *line = new CCreditLine(srcLine,
+				_screenManagerP->stringWidth(srcLine));
+			group->_lines.push_back(line);
+
+			if (srcLine.contains("...."))
+				hasDots = true;
+		}
+
+		_groups.push_back(group);
+	}
+
+	_groupIt = _groups.begin();
+	_lineIt = (*_groupIt)->_lines.begin();
+	_totalHeight = _objectP->getBounds().height() + _fontHeight * 2;
+}
+
+CString CCreditText::readLine(Common::SeekableReadStream *stream) {
+	CString line;
+	char c = stream->readByte();
+
+	while (c != '\r' && c != '\n' && c != '\0') {
+		line += c;
+
+		if (stream->pos() == stream->size())
+			break;
+		c = stream->readByte();
+	}
+
+	if (c == '\r') {
+		c = stream->readByte();
+		if (c != '\n')
+			stream->skip(-1);
+	}
+
+	return line;
+}
+
+void CCreditText::handleDots(CCreditLineGroup *group) {
+	uint maxWidth = 0;
+	CCreditLines::iterator second = group->_lines.begin();
+	++second;
+
+	// Figure out the maximum width of secondary lines
+	for (CCreditLines::iterator i = second; i != group->_lines.end(); ++i)
+		maxWidth = MAX(maxWidth, (*i)->_lineWidth);
+	
+	int charWidth = _screenManagerP->stringWidth(".");
+
+	// Process the secondary lines
+	for (CCreditLines::iterator i = second; i != group->_lines.end(); ++i) {
+		CCreditLine *line = *i;
+		if (line->_lineWidth >= maxWidth)
+			continue;
+
+		int dotsCount = (maxWidth + charWidth / 2 - line->_lineWidth) / charWidth;
+		int dotIndex = line->_line.indexOf("....");
+
+		if (dotIndex > 0) {
+			CString leftStr = line->_line.left(dotIndex);
+			CString dotsStr('.', dotsCount);
+			CString rightStr = line->_line.right(dotIndex);
+
+			line->_line = CString::format("%s%s%s", leftStr.c_str(),
+				dotsStr.c_str(), rightStr.c_str());
+			line->_lineWidth = maxWidth;
+		}
+	}
 }
 
 bool CCreditText::draw() {
diff --git a/engines/titanic/support/credit_text.h b/engines/titanic/support/credit_text.h
index 82da833..ec8fc22 100644
--- a/engines/titanic/support/credit_text.h
+++ b/engines/titanic/support/credit_text.h
@@ -30,15 +30,21 @@ namespace Titanic {
 class CGameObject;
 class CScreenManager;
 
-class COverrideSubItem : public ListItem {
-
+class CCreditLine : public ListItem {
+public:
+	CString _line;
+	uint _lineWidth;
+public:
+	CCreditLine() : _lineWidth(0) {}
+	CCreditLine(const CString &line, uint lineWidth) : _line(line), _lineWidth(lineWidth) {}
 };
-typedef List<COverrideSubItem> CCreditTextSubList;
-
-class CCreditTextItem : public ListItem {
+typedef List<CCreditLine> CCreditLines;
 
+class CCreditLineGroup : public ListItem {
+public:
+	CCreditLines _lines;
 };
-typedef List<CCreditTextItem> CCreditTextList;
+typedef List<CCreditLineGroup> CCreditLineGroups;
 
 class CCreditText {
 private:
@@ -46,17 +52,27 @@ private:
 	 * Sets up needed data
 	 */
 	void setup();
+
+	/**
+	 * Read in a text line from the passed stream
+	 */
+	CString readLine(Common::SeekableReadStream *stream);
+
+	/**
+	 * Handles a group where the .... sequence was encountered
+	 */
+	void handleDots(CCreditLineGroup *group);
 public:
 	CScreenManager *_screenManagerP;
 	Rect _rect;
 	int _field14;
-	CCreditTextList _list;
+	CCreditLineGroups _groups;
 	uint _ticks;
 	uint _fontHeight;
 	CGameObject *_objectP;
-	int _field34;
-	int _field38;
-	int _field3C;
+	CCreditLineGroups::iterator _groupIt;
+	CCreditLines::iterator _lineIt;
+	uint _totalHeight;
 	int _field40;
 	int _field44;
 	int _field48;
diff --git a/engines/titanic/support/string.cpp b/engines/titanic/support/string.cpp
index d85fcfc..cd39c03 100644
--- a/engines/titanic/support/string.cpp
+++ b/engines/titanic/support/string.cpp
@@ -63,6 +63,11 @@ int CString::indexOf(char c) const {
 	return charP ? charP - c_str() : -1;
 }
 
+int CString::indexOf(const char *s) const {
+	const char *strP = strstr(c_str(), s);
+	return strP ? strP - c_str() : -1;
+}
+
 int CString::lastIndexOf(char c) const {
 	const char *charP = strrchr(c_str(), c);
 	return charP ? charP - c_str() : -1;
diff --git a/engines/titanic/support/string.h b/engines/titanic/support/string.h
index fdaf92c..9550ce8 100644
--- a/engines/titanic/support/string.h
+++ b/engines/titanic/support/string.h
@@ -75,6 +75,11 @@ public:
 	int indexOf(char c) const;
 
 	/**
+	 * Returns the index of the first occurance of a given string
+	 */
+	int indexOf(const char *s) const;
+
+	/**
 	 * Returns the index of the last occurance of a given character
 	 */
 	int lastIndexOf(char c) const;


Commit: fd316a60589f07ac75cfdf1b56188d9d464336bd
    https://github.com/scummvm/scummvm/commit/fd316a60589f07ac75cfdf1b56188d9d464336bd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T07:45:30-04:00

Commit Message:
TITANIC: Fleshed out various methods

Changed paths:
    engines/titanic/game_state.cpp
    engines/titanic/input_handler.cpp
    engines/titanic/input_handler.h
    engines/titanic/input_translator.cpp
    engines/titanic/input_translator.h
    engines/titanic/support/credit_text.cpp



diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index 0f2ed17..5628161 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -28,8 +28,18 @@
 namespace Titanic {
 
 bool CGameStateMovieList::clear() {
-	// TODO
-	return false;
+	for (CGameStateMovieList::iterator i = begin(); i != end(); ) {
+		CMovieListItem *movieItem = *i;
+
+		if (movieItem->_item->isActive()) {
+			++i;
+		} else {
+			i = erase(i);
+			delete movieItem;
+		}
+	}
+
+	return !empty();
 }
 
 /*------------------------------------------------------------------------*/
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index 395f55d..7c35a5d 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -22,15 +22,17 @@
 
 #include "titanic/input_handler.h"
 #include "titanic/game_manager.h"
-#include "titanic/support/screen_manager.h"
 #include "titanic/titanic.h"
+#include "titanic/messages/mouse_messages.h"
 #include "titanic/pet_control/pet_control.h"
+#include "titanic/support/screen_manager.h"
 
 namespace Titanic {
 
 CInputHandler::CInputHandler(CGameManager *owner) :
 		_gameManager(owner), _inputTranslator(nullptr), _dragging(false),
-		_buttonDown(false), _dragItem(nullptr),  _lockCount(0), _field24(0) {
+		_buttonDown(false), _dragItem(nullptr),  _lockCount(0),
+		_singleton(false) {
 	CScreenManager::_screenManagerPtr->_inputHandler = this;
 }
 
@@ -44,7 +46,13 @@ void CInputHandler::incLockCount() {
 
 void CInputHandler::decLockCount() {
 	if (--_lockCount == 0 && _inputTranslator) {
-		warning("TODO");
+		if (_dragging && !_inputTranslator->isMousePressed()) {
+			CMouseButtonUpMsg upMsg(_mousePos, MK_LBUTTON);
+			handleMessage(upMsg);
+		}
+
+		_buttonDown = _inputTranslator->isMousePressed();
+		_singleton = true;
 	}
 }
 
@@ -60,11 +68,11 @@ void CInputHandler::handleMessage(CMessage &msg, bool respectLock) {
 
 void CInputHandler::processMessage(CMessage *msg) {
 	const CMouseMsg *mouseMsg = dynamic_cast<const CMouseMsg *>(msg);
-	_field24 = 0;
+	_singleton = false;
 	dispatchMessage(msg);
 
-	if (_field24) {
-		_field24 = 0;
+	if (_singleton) {
+		_singleton = false;
 	} else if (mouseMsg) {
 		// Keep the game state mouse position up to date
 		if (_mousePos != mouseMsg->_mousePos) {
diff --git a/engines/titanic/input_handler.h b/engines/titanic/input_handler.h
index 2d62127..7244ddc 100644
--- a/engines/titanic/input_handler.h
+++ b/engines/titanic/input_handler.h
@@ -56,7 +56,7 @@ public:
 	Point _dragStartPos;
 	Point _mousePos;
 	int _lockCount;
-	int _field24;
+	bool _singleton;
 public:
 	CInputHandler(CGameManager *owner);
 
diff --git a/engines/titanic/input_translator.cpp b/engines/titanic/input_translator.cpp
index 571b6df..ce272d1 100644
--- a/engines/titanic/input_translator.cpp
+++ b/engines/titanic/input_translator.cpp
@@ -24,6 +24,7 @@
 #include "titanic/input_translator.h"
 #include "titanic/events.h"
 #include "titanic/messages/mouse_messages.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -106,4 +107,8 @@ void CInputTranslator::keyDown(const Common::KeyState &keyState) {
 	}
 }
 
+bool CInputTranslator::isMousePressed() const {
+	return g_vm->_window->getSpecialButtons() & (MK_LBUTTON | MK_RBUTTON | MK_MBUTTON);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/input_translator.h b/engines/titanic/input_translator.h
index 7ca2a78..d92157b 100644
--- a/engines/titanic/input_translator.h
+++ b/engines/titanic/input_translator.h
@@ -52,6 +52,11 @@ public:
 	void rightButtonUp(int special, const Point &pt);
 	void rightButtonDoubleClick(int special, const Point &pt);
 	void keyDown(const Common::KeyState &keyState);
+
+	/**
+	 * Returns true if any mouse button is currently pressed
+	 */
+	bool isMousePressed() const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/credit_text.cpp b/engines/titanic/support/credit_text.cpp
index 1f12341..0e9715a 100644
--- a/engines/titanic/support/credit_text.cpp
+++ b/engines/titanic/support/credit_text.cpp
@@ -78,7 +78,7 @@ void CCreditText::setup() {
 			if (srcLine.empty())
 				break;
 
-			CCreditLine *line = new CCreditLine(srcLine,
+			line = new CCreditLine(srcLine,
 				_screenManagerP->stringWidth(srcLine));
 			group->_lines.push_back(line);
 
@@ -107,9 +107,8 @@ CString CCreditText::readLine(Common::SeekableReadStream *stream) {
 	}
 
 	if (c == '\r') {
-		c = stream->readByte();
-		if (c != '\n')
-			stream->skip(-1);
+		// Read following '\n'
+		stream->readByte();
 	}
 
 	return line;


Commit: d1880452b52c75bd5bc9b4d20e4890ccc4bb0dba
    https://github.com/scummvm/scummvm/commit/d1880452b52c75bd5bc9b4d20e4890ccc4bb0dba
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T15:20:49-04:00

Commit Message:
TITANIC: Added 16bit requirement to configure.engine

Changed paths:
    engines/titanic/configure.engine



diff --git a/engines/titanic/configure.engine b/engines/titanic/configure.engine
index c73bb19..daf4e6b 100644
--- a/engines/titanic/configure.engine
+++ b/engines/titanic/configure.engine
@@ -1,3 +1,3 @@
 # This file is included from the main "configure" script
 # add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine titanic "Starship Titanic" no "" "" "jpeg highres"
+add_engine titanic "Starship Titanic" no "" "" "16bit jpeg highres"


Commit: 125a38c98a174d7908d6974048948ad2c80ec015
    https://github.com/scummvm/scummvm/commit/125a38c98a174d7908d6974048948ad2c80ec015
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T16:29:41-04:00

Commit Message:
TITANIC: In progress adding TTbarbotScript process method

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_script_base.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index cfde44d..89dfe0a 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -192,6 +192,434 @@ int BarbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 		return 2;
 	}
 
+	CTrueTalkManager::setFlags(29, getValue(29) - 1);
+	CTrueTalkManager::setFlags(30, getValue(30) - 1);
+	CTrueTalkManager::setFlags(31, getValue(31) - 1);
+	CTrueTalkManager::setFlags(32, getValue(32) - 1);
+	CTrueTalkManager::setFlags(33, getValue(33) - 1);
+	CTrueTalkManager::setFlags(34, getValue(34) - 1);
+	
+	int val34 = get34();
+	set34(0);
+
+	int val2C = sentence->_field2C;
+	bool flag = val2C == 11 || val2C == 13;
+	bool flag2 = val2C == 12;
+
+	if (!val34) {
+		goto done;
+	} else if (val34 > 50357) {
+		goto done;
+	} else if (val34 == 50357) {
+		return applySentenceIds(50358, -1);
+	}
+
+	switch (val34) {
+	case 1:
+		if (flag)
+			return applySentenceIds(51898, 2);
+		if (flag2)
+			return applySentenceIds(51897);
+		break;
+	case 2:
+		if (flag)
+			return applySentenceIds(51897);
+		break;
+	case 3:
+		if (sentence->localWord("useless") || sentence->contains("useless"))
+			return applySentenceIds(50824);
+		break;
+	case 4:
+		if (flag)
+			return applySentenceIds(getRandomBit() ? 50512 : 51642);
+		else if (flag2)
+			return applySentenceIds(getRandomBit() ? 50511 : 51643);
+		break;
+	case 5:
+		if (flag)
+			return applySentenceIds(50829, 6);
+		if (flag2)
+			return applySentenceIds(50828);
+		break;
+	case 6:
+		if (flag)
+			return applySentenceIds(50831);
+		if (flag2)
+			return applySentenceIds(50830);
+		break;
+	case 7:
+		if (flag2 || sentence->contains("never"))
+			return applySentenceIds(51553);
+		if (flag || sentence->contains("nicest"))
+			return applySentenceIds(51554);
+		break;
+	case 8:
+		if (flag)
+			return applySentenceIds(50961);
+		if (flag2)
+			return applySentenceIds(50960);
+		break;
+	case 9:
+		if (flag)
+			return applySentenceIds(getDialogueId(251858));
+		break;
+	case 10:
+		if (flag)
+			return applySentenceIds(getDialogueId(251014));
+		else if (flag2)
+			return applySentenceIds(getDialogueId(251013));
+		break;
+	case 11:
+		if (flag)
+			return applySentenceIds(getDialogueId(251008));
+		else if (flag2)
+			return applySentenceIds(getDialogueId(251007));
+		break;
+	case 12:
+		if (flag)
+			return applySentenceIds(getDialogueId(250656));
+		else if (flag2)
+			return applySentenceIds(getDialogueId(250655));
+		break;
+	case 13:
+		if (flag)
+			return applySentenceIds(getDialogueId(250614));
+		else if (flag2)
+			return applySentenceIds(getDialogueId(250613));
+		break;
+	case 14:
+		if (val2C == 6)
+			return applySentenceIds(getDialogueId(250946));
+		break;
+	case 15:
+		/* TODO 
+		if (flag || sentence->contains("or")) {
+			return applySentenceIds(getDialogueId(250526), 16);
+		} else {
+			TTtreeResult treeResult;
+			if (TTquotesTree::search(sentence->_normalizedLine.c_str(), 
+					&TTnpcScript_BTREE_3, &treeResult, 0, 0) != -1) {
+				id = getDialogueId(250526);
+				return applySentenceIds(id, 16);
+			}
+		}
+		*/
+		break;
+	case 17:
+		if (flag) {
+			return applySentenceIds(50382);
+		} else if (flag2) {
+			return applySentenceIds(51423);
+		} 
+		// Deliberate fall-through
+
+	case 16:
+		if (val2C == 7 || val2C == 10)
+			return applySentenceIds(getDialogueId(250525));
+		break;
+	case 18:
+		return applySentenceIds(getDialogueId(250589));
+	case 19:
+		return applySentenceIds(getDialogueId(250565), 20);
+	case 20:
+		if (flag)
+			return applySentenceIds(50307);
+		if (flag2)
+			return applySentenceIds(50306);
+		break;
+	case 21:
+		if (flag)
+			return applySentenceIds(50359);
+		if (flag2)
+			return applySentenceIds(50357);
+		break;
+	case 23:
+		if (val2C == 6 || val2C == 10)
+			return applySentenceIds(getDialogueId(250551));
+		break;
+	case 24:
+		if (sentence->contains("do not know")
+				|| sentence->contains("no idea")
+				|| sentence->contains("a clue")) {
+			return applySentenceIds(getDialogueId(250553));
+		} else {
+			return applySentenceIds(getDialogueId(250552));
+		}
+		break;
+	case 25:
+		if (flag || val2C == 10)
+			applySentenceIds(getDialogueId(251899), 26);
+		else if (flag2)
+			return applySentenceIds(50215);
+		break;
+	case 26:
+		/* TODO
+		v43 = TTstring_cstr(&sentence->normalizedLine);
+		if (TTquotesTree_Search(v43, &TTnpcScript_BTREE_3, &buffer, 0, 0) == -1)
+			break;
+		*/
+		return applySentenceIds(getDialogueId(251899), 26);
+
+	case 27:
+		if (flag)
+			return applySentenceIds(getDialogueId(250766));
+		else if (flag2)
+			return applySentenceIds(getDialogueId(250764));
+		break;
+	case 28:
+		return applySentenceIds(getDialogueId(250765));
+	case 29:
+		return applySentenceIds(getDialogueId(250652));
+	case 30:
+		return applySentenceIds(getDialogueId(250653));
+	case 31:
+		if (flag)
+			return applySentenceIds(getDialogueId(250664));
+		else if (flag2)
+			return applySentenceIds(getDialogueId(250663));
+		break;
+	case 32:
+		if (flag)
+			return applySentenceIds(getDialogueId(250643));
+		else if (flag2)
+			return applySentenceIds(getDialogueId(250642));
+		break;
+	case 33:
+		return applySentenceIds(50763);
+	case 34:
+		if (flag)
+			return applySentenceIds(getDialogueId(251622));
+		else if (flag2)
+			return applySentenceIds(getDialogueId(251624));
+		break;
+	case 35:
+		if (val2C == 6 || val2C == 10)
+			return applySentenceIds(getDialogueId(251623));
+		break;
+	case 36:
+		if (flag)
+			return applySentenceIds(50335);
+		if (flag2)
+			return applySentenceIds(50334);
+		break;
+	case 37:
+		if (flag)
+			return applySentenceIds(50217);
+		if (flag2)
+			return applySentenceIds(50153);
+		break;
+	case 38:
+		return applySentenceIds(getDialogueId(250637));
+	case 39:
+		return applySentenceIds(getDialogueId(250638));
+	case 40:
+		return applySentenceIds(getDialogueId(250639));
+	case 41:
+		return applySentenceIds(getDialogueId(250640));
+	case 42:
+		if (flag)
+			return applySentenceIds(getDialogueId(250676));
+		else if (flag2)
+			return applySentenceIds(getDialogueId(250673));
+		break;
+	case 43:
+		if (flag)
+			return applySentenceIds(50416, -1);
+		if (flag2)
+			return applySentenceIds(50415, -1);
+		break;
+	case 44:
+		if (flag)
+			return applySentenceIds(getDialogueId(250468));
+		else if (flag2)
+			return applySentenceIds(getDialogueId(250413));
+
+		if (val2C == 6 || val2C == 10)
+			return applySentenceIds(getDialogueId(251649));
+		break;
+	case 45:
+		if (sentence->localWord("summer")
+				|| sentence->contains("summer")
+				|| sentence->localWord("autumn")
+				|| sentence->contains("autumn")) {
+			return applySentenceIds(50743);
+		} else if (sentence->localWord("winter") || sentence->contains("winter")) {
+			return applySentenceIds(50696);
+		} else {
+			return applySentenceIds(50225);
+		}
+		break;
+	case 46:
+		if (val2C == 7 || val2C == 10)
+			return applySentenceIds(50698);
+		break;
+	case 47:
+		if (flag || flag2 || val2C == 6)
+			return applySentenceIds(50717);
+		break;
+	case 48:
+		if (flag)
+			return applySentenceIds(50710);
+		if (flag2)
+			return applySentenceIds(50225);
+		break;
+	case 49:
+		if (sentence->localWord("scraliontis") || sentence->contains("scraliontis"))
+			return applySentenceIds(50711);
+		if (sentence->localWord("brobostigon") || sentence->contains("brobostigon"))
+			return applySentenceIds(50712);
+		break;
+	case 50:
+		return applySentenceIds(50713);
+	case 51:
+		if (flag)
+			return applySentenceIds(50715);
+		if (flag2)
+			return applySentenceIds(50714);
+		break;
+	case 52:
+		if (sentence->localWord("note") || sentence->contains("note"))
+			return applySentenceIds(50716);
+		return  applySentenceIds(50210);
+	case 53:
+		return applySentenceIds(50210);
+	case 54:
+		if (getDialRegion(0) != 0) {
+			if (val2C == 12)
+				return applySentenceIds(50174);
+			else
+				return applySentenceIds(50300);
+		} else if (val2C == 7 || val2C == 10) {
+			return applySentenceIds(50871);
+		}
+		break;
+	case 55:
+		if (flag)
+			return applySentenceIds(50302);
+		if (flag2)
+			return applySentenceIds(50301);
+		break;
+	case 56:
+		if (flag)
+			return applySentenceIds(50304);
+		if (flag2)
+			return applySentenceIds(50303);
+		break;
+	case 57:
+		if (sentence->localWord("mustard")
+			|| sentence->contains("mustard")
+			|| sentence->localWord("tomato")
+			|| sentence->contains("tomato"))
+			return applySentenceIds(50320);
+		if (sentence->localWord("sauce")
+			|| sentence->localWord("puree")
+			|| sentence->contains("sauce")
+			|| sentence->contains("puree")
+			|| sentence->contains("bird")
+			|| sentence->contains("starling")) {
+			applySentenceIds(50321);
+			CTrueTalkManager::triggerAction(30, 0);
+			return 2;
+		}
+		
+		return applySentenceIds(50320);
+	case 58:
+		if (val2C == 6 || val2C == 10)
+			return applySentenceIds(50880);
+		break;
+	case 59:
+		if (flag) {
+			if (addRandomResponse(true)) {
+				set34(59);
+				return 2;
+			}
+		} else if (flag2) {
+			return applySentenceIds(getDialogueId(251754));
+		}
+		break;
+	case 60:
+		if (flag && addRandomResponse(true)) {
+			set34(59);
+			return 2;
+		} else if (flag2 || val2C == 7 || val2C == 10) {
+			return applySentenceIds(getDialogueId(251712));
+		}
+		break;
+	case 61:
+		if (val2C == 3) {
+			if (sentence->localWord("loop"))
+				return applySentenceIds(getDialogueId(250269));
+			else if (sentence->localWord("do"))
+				return applySentenceIds(getDialogueId(250270));
+		} else if (val2C == 7) {
+			return applySentenceIds(getDialogueId(250270));
+		} else if (flag) {
+			return applySentenceIds(getDialogueId(250270));
+		}
+
+		return applySentenceIds(getDialogueId(250272));
+	case 62:
+		if (flag
+				|| (val2C == 3 && sentence->localWord("do"))
+				|| val2C == 7
+				|| sentence->localWord("help"))
+			return applySentenceIds(getDialogueId(250270));
+
+		return applySentenceIds(getDialogueId(2570272));
+	case 63:
+		if (flag
+				|| (val2C == 3 || sentence->localWord("do"))
+				|| val2C == 7
+				|| sentence->localWord("help"))
+			return applySentenceIds(getDialogueId(250271));
+
+		return applySentenceIds(getDialogueId(250272));
+	case 64:
+		if (flag || val2C == 3 || val2C == 8)
+			return applySentenceIds(getDialogueId(250631));
+		break;
+	case 65:
+		if (sentence->localWord("now") || sentence->localWord("soonh"))
+			return applySentenceIds(getDialogueId(250424));
+		return applySentenceIds(getDialogueId(250506));
+	case 66:
+		if (flag || sentence->localWord("good") || sentence->localWord("well"))
+			return applySentenceIds(getDialogueId(251027));
+		return applySentenceIds(getDialogueId(251021));
+	case 67:
+		if (flag || val2C == 6 || val2C == 10) {
+			setDial(0, getDialLevel(0, false) - 8);
+			return applySentenceIds(getDialogueId(251589));
+		}
+		break;
+	case 68:
+		if (flag || val2C == 6 || val2C == 10) {
+			setDial(0, getDialLevel(0, false) - 12);
+			return applySentenceIds(getDialogueId(251590));
+		}
+		break;
+	case 69:
+		if (flag || val2C == 6 || val2C == 10) {
+			setDial(0, getDialLevel(0, false) - 25);
+			return applySentenceIds(getDialogueId(251591));
+		}
+		break;
+	default:
+		break;
+	}
+
+done:
+	// Adjust primary dial
+	set34(0);
+	if (sentence->get58() != 5) {
+		adjustDial(0, sentence->get58() * 4 - 20);
+	} else if (getDialLevel(0, false) > 65) {
+		adjustDial(0, -2 - getRandomNumber(7));
+	} else if (getDialLevel(0, false) < 35) {
+		adjustDial(0, 2 + getRandomNumber(7));
+	}
+
+	// TODO: Remainder of method
 
 
 	// TODO
@@ -255,4 +683,25 @@ bool BarbotScript::isState9() const {
 	return CTrueTalkManager::getStateValue(9) != 0;
 }
 
+int BarbotScript::applySentenceIds(int dialogueId, int v34) {
+	addResponse(dialogueId);
+	applyResponse();
+
+	if (v34 != -1) {
+		set34(v34);
+	} else {
+		for (uint idx = 0; idx < _mappings.size(); ++idx) {
+			const TTscriptMapping &m = _mappings[idx];
+			for (int vidx = 0; vidx < _mappings._valuesPerMapping; ++idx) {
+				if (m._values[vidx] == (uint)dialogueId) {
+					proc21(m._id, m._id, vidx);
+					break;
+				}
+			}
+		}
+	}
+
+	return -2;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 1d73094..3d2a513 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -43,6 +43,8 @@ private:
 	void setupSentences();
 
 	bool isState9() const;
+
+	int applySentenceIds(int dialogueId, int v34 = -1);
 public:
 	BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 8cce90e..647523b 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -37,6 +37,69 @@ static const char *const ITEMS[] = {
 	"longstick", "bomb", "lemon", "puree", "television", "hammer", nullptr
 };
 
+struct ItemRec {
+	const char *const _name;
+	uint _id;
+};
+static const ItemRec ARRAY1[] = {
+	{ ITEMS[0], 290138 },
+	{ ITEMS[1], 290139 },
+	{ ITEMS[2], 290141 },
+	{ ITEMS[3], 290142 },
+	{ ITEMS[4], 290153 },
+	{ ITEMS[5], 290158 },
+	{ ITEMS[6], 290159 },
+	{ ITEMS[7], 290160 },
+	{ ITEMS[8], 290161 },
+	{ ITEMS[9], 290162 },
+	{ ITEMS[10], 290163 },
+	{ ITEMS[11], 290164 },
+	{ ITEMS[12], 290165 },
+	{ ITEMS[13], 290166 },
+	{ ITEMS[14], 290166 },
+	{ ITEMS[15], 290178 },
+	{ ITEMS[16], 290174 },
+	{ ITEMS[17], 290175 },
+	{ ITEMS[18], 290176 },
+	{ ITEMS[19], 290179 },
+	{ nullptr, 0 }
+};
+static const uint ARRAY2[] = {
+	290167, 290178, 290183, 290144, 290148, 290151, 290154, 290156, 290158, 290159, 290160, 290161,
+	290162, 290163, 290164, 290165, 290177, 290181, 0
+};
+static const uint RANDOM1[] = {
+	290184, 290185, 290187, 290188, 290190, 290191, 290193, 290195, 290196, 290197, 290198, 290199,
+	290202, 290205, 0
+};
+static const uint RANDOM2[] = {
+	290186, 290187, 290188, 290190, 290191, 290193, 290194, 290195, 290196, 290197, 290198, 290199,
+	290200, 290201, 290202, 290204, 290205, 0
+};
+static const uint RANDOM3[] = {
+	290188, 290190, 290192, 290194, 290197, 290200, 290201, 290202, 290204, 290205, 0
+};
+static const uint RANDOM4[] = {
+	290206, 290207, 290209, 290210, 290211, 290212, 290216, 290217, 290218, 290219, 290222, 290223, 0
+};
+static const uint RANDOM5[] = {
+	290208, 290209, 290210, 290211, 290212, 290214, 290215, 290216, 290217, 290218, 290219, 290221,
+	290222, 290223, 0
+};
+static const uint RANDOM6[] = {
+	290210, 290211, 290213, 290214, 290215, 290220, 290221, 290222, 290223, 0
+};
+static const uint RANDOM7[] = {
+	290225, 290226, 290228, 290229, 290230, 290232, 290231, 290235, 290236, 290237, 290238, 290241, 0
+};
+static const uint RANDOM8[] = {
+	290227, 290228, 290229, 290230, 290231, 290232, 290233, 290234, 290235, 290236, 290237, 290238,
+	290240, 290241, 0
+};
+static const uint RANDOM9[] = {
+	290228, 290229, 290230, 290232, 290233, 290234, 290239, 290240, 290241, 0
+};
+
 /*------------------------------------------------------------------------*/
 
 int TTnpcScriptResponse::size() const {
@@ -775,4 +838,58 @@ void TTnpcScript::checkItems(TTroomScript *roomScript, TTsentence *sentence) {
 	}
 }
 
+bool TTnpcScript::addRandomResponse(bool flag) {
+	if (getValue(1) > 3)
+		return false;
+
+	const uint *data;
+	if (flag) {
+		if (getValue(1) == 2)
+			data = RANDOM8;
+		else if (getValue(1) == 1)
+			data = RANDOM7;
+		else
+			data = RANDOM9;
+	} else if (getRandomBit()) {
+		if (getValue(1) == 2)
+			data = RANDOM2;
+		else if (getValue(1) == 1)
+			data = RANDOM1;
+		else
+			data = RANDOM3;
+	} else {
+		if (getValue(1) == 2)
+			data = RANDOM5;
+		else if (getValue(1) == 1)
+			data = RANDOM4;
+		else
+			data = RANDOM6;
+	}
+
+	// Pick a random entry
+	uint count = 0;
+	while (data[count])
+		++count;
+	uint id = data[getRandomNumber(count - 1)];
+
+	if (id == 290188 && getRoom54(101))
+		id = 290189;
+	else if (id == 290202 && getRoom54(123))
+		id = 290203;
+
+	if (!id)
+		return false;
+	id = getDialogueId(id);
+	if (id == 4)
+		return true;
+	if (!id)
+		return false;
+
+	if (flag)
+		addResponse(getDialogueId(290224));
+	
+	addResponse(id);
+	applyResponse();
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index d7cec8d..43764d8 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -251,6 +251,11 @@ protected:
 	bool defaultProcess(TTroomScript *roomScript, TTsentence *sentence);
 
 	void checkItems(TTroomScript *roomScript, TTsentence *sentence);
+
+	/**
+	 * Adds a random conversation response
+	 */
+	bool addRandomResponse(bool flag);
 public:
 	TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index e855fef..e94bab3 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -73,6 +73,7 @@ protected:
 	}
 
 	void set34(int val) { _field34 = val; }
+	int get34() const { return _field34; }
 public:
 	int _id;
 public:


Commit: 773bfca60551c519a3bf1989724bafe77390a728
    https://github.com/scummvm/scummvm/commit/773bfca60551c519a3bf1989724bafe77390a728
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T19:44:04-04:00

Commit Message:
DEVTOOLS: Add secondary Barbot sentence data to create_titanic

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index ed263d7..199a8d1 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -52,7 +52,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x680
+#define HEADER_SIZE 0x700
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -535,7 +535,9 @@ void writeData() {
 	writeStringArray("TEXT/REPLACEMENTS3", 0x21D9C8, 82);
 	writeStringArray("TEXT/PRONOUNS", 0x22F718, 15);
 
+	writeSentenceEntries("Sentences/Default", 0x5C0130);
 	writeSentenceEntries("Sentences/Barbot", 0x5ABE60);
+	writeSentenceEntries("Sentences/Barbot2", 0x5BD4E8);
 	writeSentenceEntries("Sentences/Bellbot", 0x5C2230);
 	writeSentenceEntries("Sentences/Deskbot", 0x5DCD10);
 	writeSentenceEntries("Sentences/Doorbot", 0x5EC110);


Commit: 6e2a4edd2a9cbb5c44be1a930e27d607e744361d
    https://github.com/scummvm/scummvm/commit/6e2a4edd2a9cbb5c44be1a930e27d607e744361d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T19:44:19-04:00

Commit Message:
TITANIC: Finish TTbarbotScript process method

Changed paths:
    engines/titanic/titanic.cpp
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index dfb68fd..66d4e46 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -41,6 +41,7 @@
 #include "titanic/moves/enter_exit_sec_class_mini_lift.h"
 #include "titanic/moves/exit_pellerator.h"
 #include "titanic/support/simple_file.h"
+#include "titanic/true_talk/tt_npc_script.h"
 
 namespace Titanic {
 
@@ -93,6 +94,7 @@ void TitanicEngine::initialize() {
 	CExitPellerator::init();
 	CEnterExitSecClassMiniLift::init();
 	CTelevision::init();
+	TTnpcScript::init();
 	OSVideoSurface::setup();
 
 	_debugger = new Debugger(this);
@@ -119,6 +121,7 @@ void TitanicEngine::deinitialize() {
 	CEnterExitSecClassMiniLift::deinit();
 	CGameObject::deinit();
 	CTelevision::deinit();
+	TTnpcScript::deinit();
 }
 
 Common::Error TitanicEngine::run() {
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 89dfe0a..03aa1cd 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -57,11 +57,12 @@ void BarbotScript::setupSentences() {
 		CTrueTalkManager::setFlags(idx, 0);
 	setupDials(100, 100, 100);
 
-	if (!_field74)
-		_field74 = 2;
+	if (!_currentDialNum)
+		_currentDialNum = 2;
 
 	_mappings.load("Mappings/Barbot", 8);
 	_entries.load("Sentences/Barbot");
+	_entries2.load("Sentences/Barbot2");
 }
 
 int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
@@ -619,10 +620,138 @@ done:
 		adjustDial(0, 2 + getRandomNumber(7));
 	}
 
-	// TODO: Remainder of method
+	updateCurrentDial(true);
 
+	if (sentence->contains("goldfish")) {
+		addResponse(250184);
+	} else if ((sentence->localWord("puree") || sentence->localWord("pureed"))
+		&& sentence->localWord("parrot")) {
+		addResponse(250021);
+	} else if (sentence->localWord("starling")) {
+		addResponse(250024);
+	} else {
+		if (getRandomNumber(100) > 95 && getDialRegion(2) == 0) {
+			addResponse(getDialogueId(250210));
+		}
+
+		if (processEntries(&_entries, _entryCount, roomScript, sentence) == 2)
+			return 2;
+		if (processEntries(_defaultEntries, 0, roomScript, sentence) != 2
+				&& !defaultProcess(roomScript, sentence)) {
+			int dval = 0;
+			flag = getRandomNumber(100) > 50;
+			int val;
+
+			switch (_field2C) {
+			case 2:
+				val = getValue(29);
+				if (val < 16)
+					val += 4;
+				if (val < 9) {
+					val = val / 2;
+					dval = 250081 + flag ? 0 : 267;
+				}
+				CTrueTalkManager::setFlags(29, val);
+				break;
+
+			case 3:
+				val = getValue(30);
+				if (val < 16)
+					val += 4;
+				if (val < 9) {
+					val = val / 2;
+					dval = 250081 + flag ? 0 : 243;
+				}
+				CTrueTalkManager::setFlags(30, val);
+				break;
+
+			case 4:
+				val = getValue(31);
+				if (val < 16)
+					val += 4;
+				if (val < 9) {
+					val = val / 2;
+					dval = 250081 + flag ? 0 : 256;
+				}
+				CTrueTalkManager::setFlags(31, val);
+				break;
+
+			case 5:
+				val = getValue(32);
+				if (val < 16)
+					val += 4;
+				if (val < 9) {
+					val = val / 2;
+					dval = 250081 + flag ? 0 : 251;
+				}
+				CTrueTalkManager::setFlags(32, val);
+				break;
+
+			case 6:
+				val = getValue(33);
+				if (val < 16)
+					val += 4;
+				if (val < 9) {
+					val = val / 2;
+					dval = 250081 + flag ? 0 : 273;
+				}
+				CTrueTalkManager::setFlags(33, val);
+				break;
+
+			case 7:
+				val = getValue(34);
+				if (val < 16)
+					val += 4;
+				if (val < 9) {
+					val = val / 2;
+					dval = 250081 + flag ? 0 : 236;
+				}
+				CTrueTalkManager::setFlags(34, val);
+				break;
+
+
+			case 11:
+				addResponse(getDialogueId(250463));
+				applyResponse();
+				return 2;
+
+			case 12:
+				addResponse(getDialogueId(250455));
+				applyResponse();
+				return 2;
+
+			case 13:
+				addResponse(getDialogueId(250447));
+				applyResponse();
+				return 2;
+
+			case 19:
+				return applySentenceIds(getDialogueId(getDialRegion(0) ? 250062 : 250200));
 
-	// TODO
+			default:
+				break;
+			}
+
+			if (dval) {
+				adjustDial(0, -9);
+				adjustDial(1, -2);
+
+				if (dval != 250081) {
+					selectResponse(250286);
+					selectResponse(250296);
+					selectResponse(250307);
+					applyResponse();
+					return 2;
+				}
+			} else if (processEntries(&_entries2, 0, roomScript, sentence) == 2) {
+				return 2;
+			}
+
+			addResponse(getDialogueId(250082 + getRandomNumber(100) <= 89 ? 128 : 0));
+		}
+	}
+
+	applyResponse();
 	return 2;
 }
 
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 3d2a513..9449149 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -31,6 +31,7 @@ class BarbotScript : public TTnpcScript {
 private:
 	int _state;
 	int _arrIndex;
+	TTsentenceEntries _entries2;
 private:
 	/**
 	 * Adjust a given dial number by a given delta amount
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index ca000a4..61e1f71 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -37,8 +37,8 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 
 	setupDials(0, 0, 0);
 	_array[0] = 100;
-	if (_field74 == 1)
-		_field74 = 0;
+	if (_currentDialNum == 1)
+		_currentDialNum = 0;
 
 	loadRanges("Ranges/Deskbot");
 	loadResponses("Responses/Deskbot", 4);
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 647523b..f673cc0 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -31,6 +31,8 @@
 
 namespace Titanic {
 
+TTsentenceEntries *TTnpcScript::_defaultEntries;
+
 static const char *const ITEMS[] = {
 	"chicken", "napkin", "parrot", "moth", "fuse", "eye", "nose", "ear", "mouth",
 	"auditorycenter", "visioncenter", "olfactorycenter", "speechcenter", "stick",
@@ -211,11 +213,21 @@ TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
 
 /*------------------------------------------------------------------------*/
 
+void TTnpcScript::init() {
+	_defaultEntries = new TTsentenceEntries();
+	_defaultEntries->load("Sentences/Default");
+}
+
+void TTnpcScript::deinit() {
+	delete _defaultEntries;
+	_defaultEntries = nullptr;
+}
+
 TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
 		_entryCount(0), _field68(0), _field6C(0), _rangeResetCtr(0),
-		_field74(0), _field78(0), _field7C(0), _itemStringP(nullptr), _field2CC(false) {
+		_currentDialNum(0), _dialDelta(0), _field7C(0), _itemStringP(nullptr), _field2CC(false) {
 	CTrueTalkManager::_v2 = 0;
 	Common::fill(&_dialValues[0], &_dialValues[DIALS_ARRAY_COUNT], 0);
 	Common::fill(&_array[0], &_array[136], 0);
@@ -274,11 +286,11 @@ void TTnpcScript::setupDials(int dial1, int dial2, int dial3) {
 	_dialValues[0] = dial1;
 	_dialValues[1] = dial2;
 	_dialValues[2] = dial3;
-	_field74 = getRandomNumber(3) - 1;
-	_field78 = getRandomNumber(5) + 6;
+	_currentDialNum = getRandomNumber(3) - 1;
+	_dialDelta = getRandomNumber(5) + 6;
 
 	if (_dialValues[0] > 70)
-		_field78 = -_field78;
+		_dialDelta = -_dialDelta;
 }
 
 void TTnpcScript::addResponse(int id) {
@@ -425,8 +437,8 @@ void TTnpcScript::save(SimpleFile *file) {
 
 	file->writeNumber(4);
 	file->writeNumber(_rangeResetCtr);
-	file->writeNumber(_field74);
-	file->writeNumber(_field78);
+	file->writeNumber(_currentDialNum);
+	file->writeNumber(_dialDelta);
 	file->writeNumber(_field7C);
 	
 	file->writeNumber(10);
@@ -439,8 +451,8 @@ void TTnpcScript::load(SimpleFile *file) {
 
 	int count = file->readNumber();
 	_rangeResetCtr = file->readNumber();
-	_field74 = file->readNumber();
-	_field78 = file->readNumber();
+	_currentDialNum = file->readNumber();
+	_dialDelta = file->readNumber();
 	_field7C = file->readNumber();
 
 	for (int idx = count; idx > 4; --idx)
@@ -890,6 +902,31 @@ bool TTnpcScript::addRandomResponse(bool flag) {
 	
 	addResponse(id);
 	applyResponse();
+	return true;
+}
+
+void TTnpcScript::updateCurrentDial(bool changeDial) {
+	int dialLevel = CLIP(getDialLevel(_currentDialNum) + _dialDelta, 0, 100);
+	setDial(_currentDialNum, dialLevel);
+
+	bool edgeFlag = false;
+	if (_dialDelta < 0) {
+		if (dialLevel < 10 || getRandomNumber(100) > 93)
+			edgeFlag = true;
+	} else {
+		if (dialLevel > 90 || getRandomNumber(100) > 93)
+			edgeFlag = true;
+	}
+
+	if (edgeFlag) {
+		if (changeDial)
+			_currentDialNum = getRandomNumber(3);
+
+		_dialDelta = getRandomNumber(12) + 3;
+		dialLevel = getDialLevel(_currentDialNum, false);
+		if (dialLevel > 50)
+			_dialDelta = -_dialDelta;
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 43764d8..8a17064 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -159,6 +159,8 @@ class TTnpcScript : public TTnpcScriptBase {
 private:
 	int translateByArray(int id);
 protected:
+	static TTsentenceEntries *_defaultEntries;
+protected:
 	Common::Array<TTnpcScriptResponse> _responses;
 	int _valuesPerResponse;
 	Common::Array<TTscriptRange> _ranges;
@@ -169,8 +171,8 @@ protected:
 	int _field68;
 	int _field6C;
 	int _rangeResetCtr;
-	int _field74;
-	int _field78;
+	int _currentDialNum;
+	int _dialDelta;
 	int _field7C;
 	const char *_itemStringP;
 	int _dialValues[DIALS_ARRAY_COUNT];
@@ -256,6 +258,14 @@ protected:
 	 * Adds a random conversation response
 	 */
 	bool addRandomResponse(bool flag);
+
+	/**
+	 * Updates the current dial with the given delta
+	 */
+	void updateCurrentDial(bool changeDial);
+public:
+	static void init();
+	static void deinit();
 public:
 	TTnpcScript(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4,


Commit: 7d554339d3e1040480c9e1105d3ce7065fc77772
    https://github.com/scummvm/scummvm/commit/7d554339d3e1040480c9e1105d3ce7065fc77772
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T19:55:46-04:00

Commit Message:
TITANIC: Add semicolons after DEFFN lines

Changed paths:
    engines/titanic/core/saveable_object.cpp



diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index d3c64a1..62cee47 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -420,594 +420,594 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
 	CSaveableObject::_classList = nullptr;
 Common::List<ClassDef *> *CSaveableObject::_classDefs;
 
-#define DEFFN(T) ClassDef *T::_type; \
-	CSaveableObject *Function##T() { return new T(); }
+#define DEFFN(T) CSaveableObject *Function##T() { return new T(); } \
+	ClassDef *T::_type
 #define ADDFN(CHILD, PARENT) \
 	CHILD::_type = new TypeTemplate<CHILD>(#CHILD, PARENT::_type); \
 	(*_classList)[#CHILD] = Function##CHILD
 
-DEFFN(CArm)
-DEFFN(CAuditoryCentre)
-DEFFN(CBowlEar)
-DEFFN(CBrain)
-DEFFN(CBridgePiece)
-DEFFN(CCarry)
-DEFFN(CCarryParrot)
-DEFFN(CCentralCore)
-DEFFN(CChicken)
-DEFFN(CCrushedTV)
-DEFFN(CEar)
-DEFFN(CEye)
-DEFFN(CFeathers)
-DEFFN(CFruit)
-DEFFN(CGlass)
-DEFFN(CHammer)
-DEFFN(CHeadPiece)
-DEFFN(CHose)
-DEFFN(CHoseEnd)
-DEFFN(CKey)
-DEFFN(CLiftbotHead)
-DEFFN(CLongStick)
-DEFFN(CMagazine)
-DEFFN(CMaitreDLeftArm)
-DEFFN(CMaitreDRightArm)
-DEFFN(CMouth)
-DEFFN(CNapkin)
-DEFFN(CNose)
-DEFFN(CNote)
-DEFFN(CParcel)
-DEFFN(CPerch)
-DEFFN(CPhonographCylinder)
-DEFFN(CPhonographEar)
-DEFFN(CPhotograph)
-DEFFN(CPlugIn)
-DEFFN(CSpeechCentre)
-DEFFN(CSweets)
-DEFFN(CVisionCentre)
+DEFFN(CArm);
+DEFFN(CAuditoryCentre);
+DEFFN(CBowlEar);
+DEFFN(CBrain);
+DEFFN(CBridgePiece);
+DEFFN(CCarry);
+DEFFN(CCarryParrot);
+DEFFN(CCentralCore);
+DEFFN(CChicken);
+DEFFN(CCrushedTV);
+DEFFN(CEar);
+DEFFN(CEye);
+DEFFN(CFeathers);
+DEFFN(CFruit);
+DEFFN(CGlass);
+DEFFN(CHammer);
+DEFFN(CHeadPiece);
+DEFFN(CHose);
+DEFFN(CHoseEnd);
+DEFFN(CKey);
+DEFFN(CLiftbotHead);
+DEFFN(CLongStick);
+DEFFN(CMagazine);
+DEFFN(CMaitreDLeftArm);
+DEFFN(CMaitreDRightArm);
+DEFFN(CMouth);
+DEFFN(CNapkin);
+DEFFN(CNose);
+DEFFN(CNote);
+DEFFN(CParcel);
+DEFFN(CPerch);
+DEFFN(CPhonographCylinder);
+DEFFN(CPhonographEar);
+DEFFN(CPhotograph);
+DEFFN(CPlugIn);
+DEFFN(CSpeechCentre);
+DEFFN(CSweets);
+DEFFN(CVisionCentre);
 
-DEFFN(CBackground)
-DEFFN(CClickResponder)
-DEFFN(CDontSaveFileItem)
-DEFFN(CDropTarget)
-DEFFN(CFileItem)
-DEFFN(CFileListItem)
-DEFFN(CGameObject)
-DEFFN(CGameObjectDescItem)
-DEFFN(CLinkItem)
-DEFFN(ListItem)
-DEFFN(CMailMan)
-DEFFN(CMessageTarget)
-DEFFN(CMovieClip)
-DEFFN(CMultiDropTarget)
-DEFFN(CNamedItem)
-DEFFN(CNodeItem)
-DEFFN(CProjectItem)
-DEFFN(CResourceKey)
-DEFFN(CRoomItem)
-DEFFN(CSaveableObject)
-DEFFN(CStaticImage)
-DEFFN(CTurnOnObject)
-DEFFN(CTurnOnPlaySound)
-DEFFN(CTurnOnTurnOff)
-DEFFN(CTreeItem)
-DEFFN(CViewItem)
+DEFFN(CBackground);
+DEFFN(CClickResponder);
+DEFFN(CDontSaveFileItem);
+DEFFN(CDropTarget);
+DEFFN(CFileItem);
+DEFFN(CFileListItem);
+DEFFN(CGameObject);
+DEFFN(CGameObjectDescItem);
+DEFFN(CLinkItem);
+DEFFN(ListItem);
+DEFFN(CMailMan);
+DEFFN(CMessageTarget);
+DEFFN(CMovieClip);
+DEFFN(CMultiDropTarget);
+DEFFN(CNamedItem);
+DEFFN(CNodeItem);
+DEFFN(CProjectItem);
+DEFFN(CResourceKey);
+DEFFN(CRoomItem);
+DEFFN(CSaveableObject);
+DEFFN(CStaticImage);
+DEFFN(CTurnOnObject);
+DEFFN(CTurnOnPlaySound);
+DEFFN(CTurnOnTurnOff);
+DEFFN(CTreeItem);
+DEFFN(CViewItem);
 
-DEFFN(CAnnounce)
-DEFFN(CAnnoyBarbot)
-DEFFN(CArbBackground)
-DEFFN(CArboretumGate)
-DEFFN(CAutoAnimate)
-DEFFN(CBarBell)
-DEFFN(CBarMenu)
-DEFFN(CBarMenuButton)
-DEFFN(CBelbotGetLight)
-DEFFN(CBilgeSuccUBus)
-DEFFN(CBomb)
-DEFFN(CBottomOfWellMonitor)
-DEFFN(CBowlUnlocker)
-DEFFN(CBrainSlot)
-DEFFN(CBridgeDoor)
-DEFFN(CBridgeView)
-DEFFN(CBrokenPellBase)
-DEFFN(CBrokenPellerator)
-DEFFN(CBrokenPelleratorFroz)
-DEFFN(CCage)
-DEFFN(CCallPellerator)
-DEFFN(CCaptainsWheel)
-DEFFN(CCDROM)
-DEFFN(CCDROMComputer)
-DEFFN(CCDROMTray)
-DEFFN(CCellPointButton)
-DEFFN(CChevCode)
-DEFFN(CChevPanel)
-DEFFN(CChickenCooler)
-DEFFN(CChickenDispensor)
-DEFFN(CCloseBrokenPel)
-DEFFN(CodeWheel)
-DEFFN(CComputer)
-DEFFN(CComputerScreen)
-DEFFN(CCookie)
-DEFFN(CCredits)
-DEFFN(CCreditsButton)
-DEFFN(CDeadArea)
-DEFFN(CDeskClickResponder)
-DEFFN(CDoorbotElevatorHandler)
-DEFFN(CDoorbotHomeHandler)
-DEFFN(CEarSweetBowl)
-DEFFN(CEjectPhonographButton)
-DEFFN(CElevatorActionArea)
-DEFFN(CEmmaControl)
-DEFFN(CEmptyNutBowl)
-DEFFN(CEndCreditText)
-DEFFN(CEndCredits)
-DEFFN(CEndExplodeShip)
-DEFFN(CEndGameCredits)
-DEFFN(CEndSequenceControl)
-DEFFN(CFan)
-DEFFN(CFanControl)
-DEFFN(CFanDecrease)
-DEFFN(CFanIncrease)
-DEFFN(CFanNoises)
-DEFFN(CFloorIndicator)
-DEFFN(CGamesConsole)
-DEFFN(CGetLiftEye2)
-DEFFN(CGlassSmasher)
-DEFFN(CHammerClip)
-DEFFN(CHammerDispensor)
-DEFFN(CHammerDispensorButton)
-DEFFN(CHeadSlot)
-DEFFN(CHeadSmashEvent)
-DEFFN(CHeadSmashLever)
-DEFFN(CHeadSpinner)
-DEFFN(CIdleSummoner)
-DEFFN(CLeaveSecClassState)
-DEFFN(CLemonDispensor)
-DEFFN(CLight)
-DEFFN(CLightSwitch)
-DEFFN(CLittleLiftButton)
-DEFFN(CLongStickDispenser)
-DEFFN(CMissiveOMat)
-DEFFN(CMissiveOMatButton)
-DEFFN(CMovieTester)
-DEFFN(CMusicalInstrument)
-DEFFN(CMusicConsoleButton)
-DEFFN(CMusicRoomPhonograph)
-DEFFN(CMusicRoomStopPhonographButton)
-DEFFN(CMusicSystemLock)
-DEFFN(CNavHelmet)
-DEFFN(CNavigationComputer)
-DEFFN(CNoNutBowl)
-DEFFN(CNoseHolder)
-DEFFN(CNullPortHole)
-DEFFN(CNutReplacer)
-DEFFN(CPetDisabler)
-DEFFN(CPhonograph)
-DEFFN(CPhonographLid)
-DEFFN(CPlayMusicButton)
-DEFFN(CPlayOnAct)
-DEFFN(CPortHole)
-DEFFN(CRecordPhonographButton)
-DEFFN(CReplacementEar)
-DEFFN(CReservedTable)
-DEFFN(CRestaurantCylinderHolder)
-DEFFN(CRestaurantPhonograph)
-DEFFN(CSauceDispensor)
-DEFFN(CSearchPoint)
-DEFFN(CSeasonBackground)
-DEFFN(CSeasonBarrel)
-DEFFN(CSeasonalAdjustment)
-DEFFN(CServiceElevatorWindow)
-DEFFN(CShipSetting)
-DEFFN(CShipSettingButton)
-DEFFN(CShowCellpoints)
-DEFFN(CSpeechDispensor)
-DEFFN(CSplashAnimation)
-DEFFN(CStarlingPuret)
-DEFFN(CStartAction)
-DEFFN(CStopPhonographButton)
-DEFFN(CSUBGlass)
-DEFFN(CSUBWrapper)
-DEFFN(CSweetBowl)
-DEFFN(CTelevision)
-DEFFN(CThirdClassCanal)
-DEFFN(CThrowTVDownWell)
-DEFFN(CTitaniaStillControl)
-DEFFN(CTOWParrotNav)
-DEFFN(CUpLighter)
-DEFFN(CUselessLever)
-DEFFN(CVolumeControl)
-DEFFN(CWheelButton)
-DEFFN(CWheelHotSpot)
-DEFFN(CWheelSpin)
-DEFFN(CWheelSpinHorn)
-DEFFN(CGondolierBase)
-DEFFN(CGondolierChest)
-DEFFN(CGondolierFace)
-DEFFN(CGondolierMixer)
-DEFFN(CGondolierSlider)
-DEFFN(CMaitreDArmHolder)
-DEFFN(CMaitreDBody)
-DEFFN(CMaitreDLegs)
-DEFFN(CMaitreDProdReceptor)
-DEFFN(CParrotLobbyController)
-DEFFN(CParrotLobbyLinkUpdater)
-DEFFN(CParrotLobbyObject)
-DEFFN(CParrotLobbyViewObject)
-DEFFN(CParrotLoser)
-DEFFN(CParrotNutBowlActor)
-DEFFN(CParrotNutEater)
-DEFFN(CParrotPerchHolder)
-DEFFN(CParrotSuccUBus)
-DEFFN(CParrotTrigger)
-DEFFN(CPlayerMeetsParrot)
-DEFFN(CPET)
-DEFFN(CPETClass1)
-DEFFN(CPETClass2)
-DEFFN(CPETClass3)
-DEFFN(CPetControl)
-DEFFN(CPetDragChev)
-DEFFN(CPetGraphic)
-DEFFN(CPetGraphic2)
-DEFFN(PETLeaf)
-DEFFN(CPETLift)
-DEFFN(CPETMonitor)
-DEFFN(CPETPellerator)
-DEFFN(CPETPosition)
-DEFFN(CPETSentinal)
-DEFFN(CPETSounds)
-DEFFN(CPETTransition)
-DEFFN(CPETTransport)
-DEFFN(CPickUp)
-DEFFN(CPickUpBarGlass)
-DEFFN(CPickUpHose)
-DEFFN(CPickUpLemon)
-DEFFN(CPickUpSpeechCentre)
-DEFFN(CPickUpVisCentre)
-DEFFN(CBarShelfVisCentre)
-DEFFN(CLemonOnBar)
-DEFFN(CPlaceHolderItem)
-DEFFN(CTVOnBar)
-DEFFN(CArmchair)
-DEFFN(CBasin)
-DEFFN(CBedfoot)
-DEFFN(CBedhead)
-DEFFN(CChestOfDrawers)
-DEFFN(CDesk)
-DEFFN(CDeskchair)
-DEFFN(CDrawer)
-DEFFN(CSGTDoors)
-DEFFN(SGTNav)
-DEFFN(CSGTNavigation)
-DEFFN(CSGTRestaurantDoors)
-DEFFN(CSGTStateControl)
-DEFFN(CSGTStateRoom)
-DEFFN(CSGTTV)
-DEFFN(CSGTUpperDoorsSound)
-DEFFN(CToilet)
-DEFFN(CVase)
-DEFFN(CWashstand)
+DEFFN(CAnnounce);
+DEFFN(CAnnoyBarbot);
+DEFFN(CArbBackground);
+DEFFN(CArboretumGate);
+DEFFN(CAutoAnimate);
+DEFFN(CBarBell);
+DEFFN(CBarMenu);
+DEFFN(CBarMenuButton);
+DEFFN(CBelbotGetLight);
+DEFFN(CBilgeSuccUBus);
+DEFFN(CBomb);
+DEFFN(CBottomOfWellMonitor);
+DEFFN(CBowlUnlocker);
+DEFFN(CBrainSlot);
+DEFFN(CBridgeDoor);
+DEFFN(CBridgeView);
+DEFFN(CBrokenPellBase);
+DEFFN(CBrokenPellerator);
+DEFFN(CBrokenPelleratorFroz);
+DEFFN(CCage);
+DEFFN(CCallPellerator);
+DEFFN(CCaptainsWheel);
+DEFFN(CCDROM);
+DEFFN(CCDROMComputer);
+DEFFN(CCDROMTray);
+DEFFN(CCellPointButton);
+DEFFN(CChevCode);
+DEFFN(CChevPanel);
+DEFFN(CChickenCooler);
+DEFFN(CChickenDispensor);
+DEFFN(CCloseBrokenPel);
+DEFFN(CodeWheel);
+DEFFN(CComputer);
+DEFFN(CComputerScreen);
+DEFFN(CCookie);
+DEFFN(CCredits);
+DEFFN(CCreditsButton);
+DEFFN(CDeadArea);
+DEFFN(CDeskClickResponder);
+DEFFN(CDoorbotElevatorHandler);
+DEFFN(CDoorbotHomeHandler);
+DEFFN(CEarSweetBowl);
+DEFFN(CEjectPhonographButton);
+DEFFN(CElevatorActionArea);
+DEFFN(CEmmaControl);
+DEFFN(CEmptyNutBowl);
+DEFFN(CEndCreditText);
+DEFFN(CEndCredits);
+DEFFN(CEndExplodeShip);
+DEFFN(CEndGameCredits);
+DEFFN(CEndSequenceControl);
+DEFFN(CFan);
+DEFFN(CFanControl);
+DEFFN(CFanDecrease);
+DEFFN(CFanIncrease);
+DEFFN(CFanNoises);
+DEFFN(CFloorIndicator);
+DEFFN(CGamesConsole);
+DEFFN(CGetLiftEye2);
+DEFFN(CGlassSmasher);
+DEFFN(CHammerClip);
+DEFFN(CHammerDispensor);
+DEFFN(CHammerDispensorButton);
+DEFFN(CHeadSlot);
+DEFFN(CHeadSmashEvent);
+DEFFN(CHeadSmashLever);
+DEFFN(CHeadSpinner);
+DEFFN(CIdleSummoner);
+DEFFN(CLeaveSecClassState);
+DEFFN(CLemonDispensor);
+DEFFN(CLight);
+DEFFN(CLightSwitch);
+DEFFN(CLittleLiftButton);
+DEFFN(CLongStickDispenser);
+DEFFN(CMissiveOMat);
+DEFFN(CMissiveOMatButton);
+DEFFN(CMovieTester);
+DEFFN(CMusicalInstrument);
+DEFFN(CMusicConsoleButton);
+DEFFN(CMusicRoomPhonograph);
+DEFFN(CMusicRoomStopPhonographButton);
+DEFFN(CMusicSystemLock);
+DEFFN(CNavHelmet);
+DEFFN(CNavigationComputer);
+DEFFN(CNoNutBowl);
+DEFFN(CNoseHolder);
+DEFFN(CNullPortHole);
+DEFFN(CNutReplacer);
+DEFFN(CPetDisabler);
+DEFFN(CPhonograph);
+DEFFN(CPhonographLid);
+DEFFN(CPlayMusicButton);
+DEFFN(CPlayOnAct);
+DEFFN(CPortHole);
+DEFFN(CRecordPhonographButton);
+DEFFN(CReplacementEar);
+DEFFN(CReservedTable);
+DEFFN(CRestaurantCylinderHolder);
+DEFFN(CRestaurantPhonograph);
+DEFFN(CSauceDispensor);
+DEFFN(CSearchPoint);
+DEFFN(CSeasonBackground);
+DEFFN(CSeasonBarrel);
+DEFFN(CSeasonalAdjustment);
+DEFFN(CServiceElevatorWindow);
+DEFFN(CShipSetting);
+DEFFN(CShipSettingButton);
+DEFFN(CShowCellpoints);
+DEFFN(CSpeechDispensor);
+DEFFN(CSplashAnimation);
+DEFFN(CStarlingPuret);
+DEFFN(CStartAction);
+DEFFN(CStopPhonographButton);
+DEFFN(CSUBGlass);
+DEFFN(CSUBWrapper);
+DEFFN(CSweetBowl);
+DEFFN(CTelevision);
+DEFFN(CThirdClassCanal);
+DEFFN(CThrowTVDownWell);
+DEFFN(CTitaniaStillControl);
+DEFFN(CTOWParrotNav);
+DEFFN(CUpLighter);
+DEFFN(CUselessLever);
+DEFFN(CVolumeControl);
+DEFFN(CWheelButton);
+DEFFN(CWheelHotSpot);
+DEFFN(CWheelSpin);
+DEFFN(CWheelSpinHorn);
+DEFFN(CGondolierBase);
+DEFFN(CGondolierChest);
+DEFFN(CGondolierFace);
+DEFFN(CGondolierMixer);
+DEFFN(CGondolierSlider);
+DEFFN(CMaitreDArmHolder);
+DEFFN(CMaitreDBody);
+DEFFN(CMaitreDLegs);
+DEFFN(CMaitreDProdReceptor);
+DEFFN(CParrotLobbyController);
+DEFFN(CParrotLobbyLinkUpdater);
+DEFFN(CParrotLobbyObject);
+DEFFN(CParrotLobbyViewObject);
+DEFFN(CParrotLoser);
+DEFFN(CParrotNutBowlActor);
+DEFFN(CParrotNutEater);
+DEFFN(CParrotPerchHolder);
+DEFFN(CParrotSuccUBus);
+DEFFN(CParrotTrigger);
+DEFFN(CPlayerMeetsParrot);
+DEFFN(CPET);
+DEFFN(CPETClass1);
+DEFFN(CPETClass2);
+DEFFN(CPETClass3);
+DEFFN(CPetControl);
+DEFFN(CPetDragChev);
+DEFFN(CPetGraphic);
+DEFFN(CPetGraphic2);
+DEFFN(PETLeaf);
+DEFFN(CPETLift);
+DEFFN(CPETMonitor);
+DEFFN(CPETPellerator);
+DEFFN(CPETPosition);
+DEFFN(CPETSentinal);
+DEFFN(CPETSounds);
+DEFFN(CPETTransition);
+DEFFN(CPETTransport);
+DEFFN(CPickUp);
+DEFFN(CPickUpBarGlass);
+DEFFN(CPickUpHose);
+DEFFN(CPickUpLemon);
+DEFFN(CPickUpSpeechCentre);
+DEFFN(CPickUpVisCentre);
+DEFFN(CBarShelfVisCentre);
+DEFFN(CLemonOnBar);
+DEFFN(CPlaceHolderItem);
+DEFFN(CTVOnBar);
+DEFFN(CArmchair);
+DEFFN(CBasin);
+DEFFN(CBedfoot);
+DEFFN(CBedhead);
+DEFFN(CChestOfDrawers);
+DEFFN(CDesk);
+DEFFN(CDeskchair);
+DEFFN(CDrawer);
+DEFFN(CSGTDoors);
+DEFFN(SGTNav);
+DEFFN(CSGTNavigation);
+DEFFN(CSGTRestaurantDoors);
+DEFFN(CSGTStateControl);
+DEFFN(CSGTStateRoom);
+DEFFN(CSGTTV);
+DEFFN(CSGTUpperDoorsSound);
+DEFFN(CToilet);
+DEFFN(CVase);
+DEFFN(CWashstand);
 
-DEFFN(CGondolier)
-DEFFN(CLift)
-DEFFN(CLiftindicator)
-DEFFN(CPellerator)
-DEFFN(CServiceElevator)
-DEFFN(CTransport)
+DEFFN(CGondolier);
+DEFFN(CLift);
+DEFFN(CLiftindicator);
+DEFFN(CPellerator);
+DEFFN(CServiceElevator);
+DEFFN(CTransport);
 
-DEFFN(CActButton)
-DEFFN(CChangesSeasonButton)
-DEFFN(CChevLeftOff)
-DEFFN(CChevLeftOn)
-DEFFN(CChevRightOff)
-DEFFN(CChevRightOn)
-DEFFN(CChevSendRecSwitch)
-DEFFN(CChevSwitch)
-DEFFN(CEditControl)
-DEFFN(CElevatorButton)
-DEFFN(CGetFromSucc)
-DEFFN(CHelmetOnOff)
-DEFFN(CHomePhoto)
-DEFFN(CIconNavAction)
-DEFFN(CIconNavButt)
-DEFFN(CIconNavDown)
-DEFFN(CIconNavImage)
-DEFFN(CIconNavLeft)
-DEFFN(CIconNavReceive)
-DEFFN(CIconNavRight)
-DEFFN(CIconNavSend)
-DEFFN(CIconNavUp)
-DEFFN(CKeybrdButt)
-DEFFN(CMoveObjectButton)
-DEFFN(CMusicControl)
-DEFFN(CMusicSlider)
-DEFFN(CMusicSliderPitch)
-DEFFN(CMusicSliderSpeed)
-DEFFN(CMusicSwitch)
-DEFFN(CMusicSwitchInversion)
-DEFFN(CMusicSwitchReverse)
-DEFFN(CMusicVoiceMute)
-DEFFN(CPetModeOff)
-DEFFN(CPetModeOn)
-DEFFN(CPetModePanel)
-DEFFN(CPetPannel1)
-DEFFN(CPetPannel2)
-DEFFN(CPetPannel3)
-DEFFN(CSendToSucc)
-DEFFN(CSGTSelector)
-DEFFN(CSliderButton)
-DEFFN(CSmallChevLeftOff)
-DEFFN(CSmallChevLeftOn)
-DEFFN(CSmallChevRightOff)
-DEFFN(CSmallChevRightOn)
-DEFFN(CStatusChangeButton)
-DEFFN(CSTButton)
-DEFFN(CTextDown)
-DEFFN(CTextSkrew)
-DEFFN(CTextUp)
-DEFFN(CToggleButton)
-DEFFN(CToggleSwitch)
+DEFFN(CActButton);
+DEFFN(CChangesSeasonButton);
+DEFFN(CChevLeftOff);
+DEFFN(CChevLeftOn);
+DEFFN(CChevRightOff);
+DEFFN(CChevRightOn);
+DEFFN(CChevSendRecSwitch);
+DEFFN(CChevSwitch);
+DEFFN(CEditControl);
+DEFFN(CElevatorButton);
+DEFFN(CGetFromSucc);
+DEFFN(CHelmetOnOff);
+DEFFN(CHomePhoto);
+DEFFN(CIconNavAction);
+DEFFN(CIconNavButt);
+DEFFN(CIconNavDown);
+DEFFN(CIconNavImage);
+DEFFN(CIconNavLeft);
+DEFFN(CIconNavReceive);
+DEFFN(CIconNavRight);
+DEFFN(CIconNavSend);
+DEFFN(CIconNavUp);
+DEFFN(CKeybrdButt);
+DEFFN(CMoveObjectButton);
+DEFFN(CMusicControl);
+DEFFN(CMusicSlider);
+DEFFN(CMusicSliderPitch);
+DEFFN(CMusicSliderSpeed);
+DEFFN(CMusicSwitch);
+DEFFN(CMusicSwitchInversion);
+DEFFN(CMusicSwitchReverse);
+DEFFN(CMusicVoiceMute);
+DEFFN(CPetModeOff);
+DEFFN(CPetModeOn);
+DEFFN(CPetModePanel);
+DEFFN(CPetPannel1);
+DEFFN(CPetPannel2);
+DEFFN(CPetPannel3);
+DEFFN(CSendToSucc);
+DEFFN(CSGTSelector);
+DEFFN(CSliderButton);
+DEFFN(CSmallChevLeftOff);
+DEFFN(CSmallChevLeftOn);
+DEFFN(CSmallChevRightOff);
+DEFFN(CSmallChevRightOn);
+DEFFN(CStatusChangeButton);
+DEFFN(CSTButton);
+DEFFN(CTextDown);
+DEFFN(CTextSkrew);
+DEFFN(CTextUp);
+DEFFN(CToggleButton);
+DEFFN(CToggleSwitch);
 
-DEFFN(CActMsg)
-DEFFN(CActivationmsg)
-DEFFN(CAddHeadPieceMsg)
-DEFFN(CAnimateMaitreDMsg)
-DEFFN(CArboretumGateMsg)
-DEFFN(CArmPickedUpFromTableMsg)
-DEFFN(CAutoSoundEvent)
-DEFFN(CBilgeAutoSoundEvent)
-DEFFN(CBilgeDispensorEvent)
-DEFFN(CBodyInBilgeRoomMsg)
-DEFFN(CBowlStateChange)
-DEFFN(CCarryObjectArrivedMsg)
-DEFFN(CChangeMusicMsg)
-DEFFN(CChangeSeasonMsg)
-DEFFN(CCheckAllPossibleCodes)
-DEFFN(CCheckChevCode)
-DEFFN(CChildDragEndMsg)
-DEFFN(CChildDragMoveMsg)
-DEFFN(CChildDragStartMsg)
-DEFFN(CClearChevPanelBits)
-DEFFN(CCorrectMusicPlayedMsg)
-DEFFN(CCreateMusicPlayerMsg)
-DEFFN(CCylinderHolderReadyMsg)
-DEFFN(CDeactivationMsg)
-DEFFN(CDeliverCCarryMsg)
-DEFFN(CDisableMaitreDProdReceptor)
-DEFFN(CDismissBotMsg)
-DEFFN(CDoffNavHelmet)
-DEFFN(CDonNavHelmet)
-DEFFN(CDoorAutoSoundEvent)
-DEFFN(CDoorbotNeededInElevatorMsg)
-DEFFN(CDoorbotNeededInHomeMsg)
-DEFFN(CDropObjectMsg)
-DEFFN(CDropZoneGotObjectMsg)
-DEFFN(CDropZoneLostObjectMsg)
-DEFFN(CEditControlMsg)
-DEFFN(CEnterNodeMsg)
-DEFFN(CEnterRoomMsg)
-DEFFN(CEnterViewMsg)
-DEFFN(CEjectCylinderMsg)
-DEFFN(CErasePhonographCylinderMsg)
-DEFFN(CFrameMsg)
-DEFFN(CFreshenCookieMsg)
-DEFFN(CGetChevClassBits)
-DEFFN(CGetChevClassNum)
-DEFFN(CGetChevCodeFromRoomNameMsg)
-DEFFN(CGetChevFloorBits)
-DEFFN(CGetChevFloorNum)
-DEFFN(CGetChevLiftBits)
-DEFFN(CGetChevLiftNum)
-DEFFN(CGetChevRoomBits)
-DEFFN(CGetChevRoomNum)
-DEFFN(CHoseConnectedMsg)
-DEFFN(CInitializeAnimMsg)
-DEFFN(CIsEarBowlPuzzleDone)
-DEFFN(CIsHookedOnMsg)
-DEFFN(CIsParrotPresentMsg)
-DEFFN(CKeyCharMsg)
-DEFFN(CLeaveNodeMsg)
-DEFFN(CLeaveRoomMsg)
-DEFFN(CLeaveViewMsg)
-DEFFN(CLemonFallsFromTreeMsg)
-DEFFN(CLightsMsg)
-DEFFN(CLoadSuccessMsg)
-DEFFN(CLockPhonographMsg)
-DEFFN(CMaitreDDefeatedMsg)
-DEFFN(CMaitreDHappyMsg)
-DEFFN(CMessage)
-DEFFN(CMissiveOMatActionMsg)
-DEFFN(CMouseMsg)
-DEFFN(CMouseMoveMsg)
-DEFFN(CMouseButtonMsg)
-DEFFN(CMouseButtonDownMsg)
-DEFFN(CMouseButtonUpMsg)
-DEFFN(CMouseDoubleClickMsg)
-DEFFN(CMouseDragMsg)
-DEFFN(CMouseDragStartMsg)
-DEFFN(CMouseDragMoveMsg)
-DEFFN(CMouseDragEndMsg)
-DEFFN(CMoveToStartPosMsg)
-DEFFN(CMovieEndMsg)
-DEFFN(CMovieFrameMsg)
-DEFFN(CMusicHasStartedMsg)
-DEFFN(CMusicHasStoppedMsg)
-DEFFN(CMusicSettingChangedMsg)
-DEFFN(CNPCPlayAnimationMsg)
-DEFFN(CNPCPlayIdleAnimationMsg)
-DEFFN(CNPCPlayTalkingAnimationMsg)
-DEFFN(CNPCQueueIdleAnimMsg)
-DEFFN(CNutPuzzleMsg)
-DEFFN(COnSummonBotMsg)
-DEFFN(COpeningCreditsMsg)
-DEFFN(CPETDeliverMsg)
-DEFFN(CPETGainedObjectMsg)
-DEFFN(CPETHelmetOnOffMsg)
-DEFFN(CPETKeyboardOnOffMsg)
-DEFFN(CPETLostObjectMsg)
-DEFFN(CPETObjectSelectedMsg)
-DEFFN(CPETObjectStateMsg)
-DEFFN(CPETPhotoOnOffMsg)
-DEFFN(CPETPlaySoundMsg)
-DEFFN(CPETReceiveMsg)
-DEFFN(CPETSetStarDestinationMsg)
-DEFFN(CPETStarFieldLockMsg)
-DEFFN(CPETStereoFieldOnOffMsg)
-DEFFN(CPETTargetMsg)
-DEFFN(CPETUpMsg)
-DEFFN(CPETDownMsg)
-DEFFN(CPETLeftMsg)
-DEFFN(CPETRightMsg)
-DEFFN(CPETActivateMsg)
-DEFFN(CPanningAwayFromParrotMsg)
-DEFFN(CParrotSpeakMsg)
-DEFFN(CParrotTriesChickenMsg)
-DEFFN(CPassOnDragStartMsg)
-DEFFN(CPhonographPlayMsg)
-DEFFN(CPhonographReadyToPlayMsg)
-DEFFN(CPhonographRecordMsg)
-DEFFN(CPhonographStopMsg)
-DEFFN(CPlayRangeMsg)
-DEFFN(CPlayerTriesRestaurantTableMsg)
-DEFFN(CPreEnterNodeMsg)
-DEFFN(CPreEnterRoomMsg)
-DEFFN(CPreEnterViewMsg)
-DEFFN(CPreSaveMsg)
-DEFFN(CProdMaitreDMsg)
-DEFFN(CPumpingMsg)
-DEFFN(CPutBotBackInHisBoxMsg)
-DEFFN(CPutParrotBackMsg)
-DEFFN(CPuzzleSolvedMsg)
-DEFFN(CQueryCylinderHolderMsg)
-DEFFN(CQueryCylinderMsg)
-DEFFN(CQueryCylinderNameMsg)
-DEFFN(CQueryCylinderTypeMsg)
-DEFFN(CQueryMusicControlSettingMsg)
-DEFFN(CQueryPhonographState)
-DEFFN(CRecordOntoCylinderMsg)
-DEFFN(CRemoveFromGameMsg)
-DEFFN(CReplaceBowlAndNutsMsg)
-DEFFN(CRestaurantMusicChanged)
-DEFFN(CSendCCarryMsg)
-DEFFN(CSenseWorkingMsg)
-DEFFN(CServiceElevatorDoor)
-DEFFN(CServiceElevatorFloorChangeMsg)
-DEFFN(CServiceElevatorFloorRequestMsg)
-DEFFN(CServiceElevatorMsg)
-DEFFN(CSetChevButtonImageMsg)
-DEFFN(CSetChevClassBits)
-DEFFN(CSetChevFloorBits)
-DEFFN(CSetChevLiftBits)
-DEFFN(CSetChevPanelBitMsg)
-DEFFN(CSetChevPanelButtonsMsg)
-DEFFN(CSetChevRoomBits)
-DEFFN(CSetFrameMsg)
-DEFFN(CSetMusicControlsMsg)
-DEFFN(CSetVarMsg)
-DEFFN(CSetVolumeMsg)
-DEFFN(CShipSettingMsg)
-DEFFN(CShowTextMsg)
-DEFFN(CSignalObject)
-DEFFN(CSpeechFallsFromTreeMsg)
-DEFFN(CStartMusicMsg)
-DEFFN(CStatusChangeMsg)
-DEFFN(CStopMusicMsg)
-DEFFN(CSubAcceptCCarryMsg)
-DEFFN(CSubDeliverCCarryMsg)
-DEFFN(CSubSendCCarryMsg)
-DEFFN(CSUBTransition)
-DEFFN(CSubTurnOffMsg)
-DEFFN(CSubTurnOnMsg)
-DEFFN(CSummonBotMsg)
-DEFFN(CSummonBotQueryMsg)
-DEFFN(CTakeHeadPieceMsg)
-DEFFN(CTextInputMsg)
-DEFFN(CTimeDilationMsg)
-DEFFN(CTimeMsg)
-DEFFN(CTimerMsg)
-DEFFN(CTitleSequenceEndedMsg)
-DEFFN(CTransitMsg)
-DEFFN(CTranslateObjectMsg)
-DEFFN(CTransportMsg)
-DEFFN(CTriggerAutoMusicPlayerMsg)
-DEFFN(CTriggerNPCEvent)
-DEFFN(CTrueTalkGetAnimSetMsg)
-DEFFN(CTrueTalkGetAssetDetailsMsg)
-DEFFN(CTrueTalkGetStateValueMsg)
-DEFFN(CTrueTalkNotifySpeechEndedMsg)
-DEFFN(CTrueTalkNotifySpeechStartedMsg)
-DEFFN(CTrueTalkQueueUpAnimSetMsg)
-DEFFN(CTrueTalkSelfQueueAnimSetMsg)
-DEFFN(CTrueTalkTriggerActionMsg)
-DEFFN(CTurnOff)
-DEFFN(CTurnOn)
-DEFFN(CUse)
-DEFFN(CUseWithCharMsg)
-DEFFN(CUseWithOtherMsg)
-DEFFN(CVirtualKeyCharMsg)
-DEFFN(CVisibleMsg)
+DEFFN(CActMsg);
+DEFFN(CActivationmsg);
+DEFFN(CAddHeadPieceMsg);
+DEFFN(CAnimateMaitreDMsg);
+DEFFN(CArboretumGateMsg);
+DEFFN(CArmPickedUpFromTableMsg);
+DEFFN(CAutoSoundEvent);
+DEFFN(CBilgeAutoSoundEvent);
+DEFFN(CBilgeDispensorEvent);
+DEFFN(CBodyInBilgeRoomMsg);
+DEFFN(CBowlStateChange);
+DEFFN(CCarryObjectArrivedMsg);
+DEFFN(CChangeMusicMsg);
+DEFFN(CChangeSeasonMsg);
+DEFFN(CCheckAllPossibleCodes);
+DEFFN(CCheckChevCode);
+DEFFN(CChildDragEndMsg);
+DEFFN(CChildDragMoveMsg);
+DEFFN(CChildDragStartMsg);
+DEFFN(CClearChevPanelBits);
+DEFFN(CCorrectMusicPlayedMsg);
+DEFFN(CCreateMusicPlayerMsg);
+DEFFN(CCylinderHolderReadyMsg);
+DEFFN(CDeactivationMsg);
+DEFFN(CDeliverCCarryMsg);
+DEFFN(CDisableMaitreDProdReceptor);
+DEFFN(CDismissBotMsg);
+DEFFN(CDoffNavHelmet);
+DEFFN(CDonNavHelmet);
+DEFFN(CDoorAutoSoundEvent);
+DEFFN(CDoorbotNeededInElevatorMsg);
+DEFFN(CDoorbotNeededInHomeMsg);
+DEFFN(CDropObjectMsg);
+DEFFN(CDropZoneGotObjectMsg);
+DEFFN(CDropZoneLostObjectMsg);
+DEFFN(CEditControlMsg);
+DEFFN(CEnterNodeMsg);
+DEFFN(CEnterRoomMsg);
+DEFFN(CEnterViewMsg);
+DEFFN(CEjectCylinderMsg);
+DEFFN(CErasePhonographCylinderMsg);
+DEFFN(CFrameMsg);
+DEFFN(CFreshenCookieMsg);
+DEFFN(CGetChevClassBits);
+DEFFN(CGetChevClassNum);
+DEFFN(CGetChevCodeFromRoomNameMsg);
+DEFFN(CGetChevFloorBits);
+DEFFN(CGetChevFloorNum);
+DEFFN(CGetChevLiftBits);
+DEFFN(CGetChevLiftNum);
+DEFFN(CGetChevRoomBits);
+DEFFN(CGetChevRoomNum);
+DEFFN(CHoseConnectedMsg);
+DEFFN(CInitializeAnimMsg);
+DEFFN(CIsEarBowlPuzzleDone);
+DEFFN(CIsHookedOnMsg);
+DEFFN(CIsParrotPresentMsg);
+DEFFN(CKeyCharMsg);
+DEFFN(CLeaveNodeMsg);
+DEFFN(CLeaveRoomMsg);
+DEFFN(CLeaveViewMsg);
+DEFFN(CLemonFallsFromTreeMsg);
+DEFFN(CLightsMsg);
+DEFFN(CLoadSuccessMsg);
+DEFFN(CLockPhonographMsg);
+DEFFN(CMaitreDDefeatedMsg);
+DEFFN(CMaitreDHappyMsg);
+DEFFN(CMessage);
+DEFFN(CMissiveOMatActionMsg);
+DEFFN(CMouseMsg);
+DEFFN(CMouseMoveMsg);
+DEFFN(CMouseButtonMsg);
+DEFFN(CMouseButtonDownMsg);
+DEFFN(CMouseButtonUpMsg);
+DEFFN(CMouseDoubleClickMsg);
+DEFFN(CMouseDragMsg);
+DEFFN(CMouseDragStartMsg);
+DEFFN(CMouseDragMoveMsg);
+DEFFN(CMouseDragEndMsg);
+DEFFN(CMoveToStartPosMsg);
+DEFFN(CMovieEndMsg);
+DEFFN(CMovieFrameMsg);
+DEFFN(CMusicHasStartedMsg);
+DEFFN(CMusicHasStoppedMsg);
+DEFFN(CMusicSettingChangedMsg);
+DEFFN(CNPCPlayAnimationMsg);
+DEFFN(CNPCPlayIdleAnimationMsg);
+DEFFN(CNPCPlayTalkingAnimationMsg);
+DEFFN(CNPCQueueIdleAnimMsg);
+DEFFN(CNutPuzzleMsg);
+DEFFN(COnSummonBotMsg);
+DEFFN(COpeningCreditsMsg);
+DEFFN(CPETDeliverMsg);
+DEFFN(CPETGainedObjectMsg);
+DEFFN(CPETHelmetOnOffMsg);
+DEFFN(CPETKeyboardOnOffMsg);
+DEFFN(CPETLostObjectMsg);
+DEFFN(CPETObjectSelectedMsg);
+DEFFN(CPETObjectStateMsg);
+DEFFN(CPETPhotoOnOffMsg);
+DEFFN(CPETPlaySoundMsg);
+DEFFN(CPETReceiveMsg);
+DEFFN(CPETSetStarDestinationMsg);
+DEFFN(CPETStarFieldLockMsg);
+DEFFN(CPETStereoFieldOnOffMsg);
+DEFFN(CPETTargetMsg);
+DEFFN(CPETUpMsg);
+DEFFN(CPETDownMsg);
+DEFFN(CPETLeftMsg);
+DEFFN(CPETRightMsg);
+DEFFN(CPETActivateMsg);
+DEFFN(CPanningAwayFromParrotMsg);
+DEFFN(CParrotSpeakMsg);
+DEFFN(CParrotTriesChickenMsg);
+DEFFN(CPassOnDragStartMsg);
+DEFFN(CPhonographPlayMsg);
+DEFFN(CPhonographReadyToPlayMsg);
+DEFFN(CPhonographRecordMsg);
+DEFFN(CPhonographStopMsg);
+DEFFN(CPlayRangeMsg);
+DEFFN(CPlayerTriesRestaurantTableMsg);
+DEFFN(CPreEnterNodeMsg);
+DEFFN(CPreEnterRoomMsg);
+DEFFN(CPreEnterViewMsg);
+DEFFN(CPreSaveMsg);
+DEFFN(CProdMaitreDMsg);
+DEFFN(CPumpingMsg);
+DEFFN(CPutBotBackInHisBoxMsg);
+DEFFN(CPutParrotBackMsg);
+DEFFN(CPuzzleSolvedMsg);
+DEFFN(CQueryCylinderHolderMsg);
+DEFFN(CQueryCylinderMsg);
+DEFFN(CQueryCylinderNameMsg);
+DEFFN(CQueryCylinderTypeMsg);
+DEFFN(CQueryMusicControlSettingMsg);
+DEFFN(CQueryPhonographState);
+DEFFN(CRecordOntoCylinderMsg);
+DEFFN(CRemoveFromGameMsg);
+DEFFN(CReplaceBowlAndNutsMsg);
+DEFFN(CRestaurantMusicChanged);
+DEFFN(CSendCCarryMsg);
+DEFFN(CSenseWorkingMsg);
+DEFFN(CServiceElevatorDoor);
+DEFFN(CServiceElevatorFloorChangeMsg);
+DEFFN(CServiceElevatorFloorRequestMsg);
+DEFFN(CServiceElevatorMsg);
+DEFFN(CSetChevButtonImageMsg);
+DEFFN(CSetChevClassBits);
+DEFFN(CSetChevFloorBits);
+DEFFN(CSetChevLiftBits);
+DEFFN(CSetChevPanelBitMsg);
+DEFFN(CSetChevPanelButtonsMsg);
+DEFFN(CSetChevRoomBits);
+DEFFN(CSetFrameMsg);
+DEFFN(CSetMusicControlsMsg);
+DEFFN(CSetVarMsg);
+DEFFN(CSetVolumeMsg);
+DEFFN(CShipSettingMsg);
+DEFFN(CShowTextMsg);
+DEFFN(CSignalObject);
+DEFFN(CSpeechFallsFromTreeMsg);
+DEFFN(CStartMusicMsg);
+DEFFN(CStatusChangeMsg);
+DEFFN(CStopMusicMsg);
+DEFFN(CSubAcceptCCarryMsg);
+DEFFN(CSubDeliverCCarryMsg);
+DEFFN(CSubSendCCarryMsg);
+DEFFN(CSUBTransition);
+DEFFN(CSubTurnOffMsg);
+DEFFN(CSubTurnOnMsg);
+DEFFN(CSummonBotMsg);
+DEFFN(CSummonBotQueryMsg);
+DEFFN(CTakeHeadPieceMsg);
+DEFFN(CTextInputMsg);
+DEFFN(CTimeDilationMsg);
+DEFFN(CTimeMsg);
+DEFFN(CTimerMsg);
+DEFFN(CTitleSequenceEndedMsg);
+DEFFN(CTransitMsg);
+DEFFN(CTranslateObjectMsg);
+DEFFN(CTransportMsg);
+DEFFN(CTriggerAutoMusicPlayerMsg);
+DEFFN(CTriggerNPCEvent);
+DEFFN(CTrueTalkGetAnimSetMsg);
+DEFFN(CTrueTalkGetAssetDetailsMsg);
+DEFFN(CTrueTalkGetStateValueMsg);
+DEFFN(CTrueTalkNotifySpeechEndedMsg);
+DEFFN(CTrueTalkNotifySpeechStartedMsg);
+DEFFN(CTrueTalkQueueUpAnimSetMsg);
+DEFFN(CTrueTalkSelfQueueAnimSetMsg);
+DEFFN(CTrueTalkTriggerActionMsg);
+DEFFN(CTurnOff);
+DEFFN(CTurnOn);
+DEFFN(CUse);
+DEFFN(CUseWithCharMsg);
+DEFFN(CUseWithOtherMsg);
+DEFFN(CVirtualKeyCharMsg);
+DEFFN(CVisibleMsg);
 
-DEFFN(CEnterBombRoom)
-DEFFN(CEnterBridge)
-DEFFN(CEnterExitFirstClassState)
-DEFFN(CEnterExitMiniLift)
-DEFFN(CEnterExitSecClassMiniLift)
-DEFFN(CEnterExitView)
-DEFFN(CEnterSecClassState)
-DEFFN(CExitArboretum)
-DEFFN(CExitBridge)
-DEFFN(CExitLift)
-DEFFN(CExitPellerator)
-DEFFN(CExitStateRoom)
-DEFFN(CExitTiania)
-DEFFN(CMovePlayerInParrotRoom)
-DEFFN(CMovePlayerTo)
-DEFFN(CMovePlayerToFrom)
-DEFFN(CMultiMove)
-DEFFN(CPanFromPel)
-DEFFN(CRestaurantPanHandler)
-DEFFN(CScraliontisTable)
-DEFFN(CRestrictedMove)
-DEFFN(CTripDownCanal)
+DEFFN(CEnterBombRoom);
+DEFFN(CEnterBridge);
+DEFFN(CEnterExitFirstClassState);
+DEFFN(CEnterExitMiniLift);
+DEFFN(CEnterExitSecClassMiniLift);
+DEFFN(CEnterExitView);
+DEFFN(CEnterSecClassState);
+DEFFN(CExitArboretum);
+DEFFN(CExitBridge);
+DEFFN(CExitLift);
+DEFFN(CExitPellerator);
+DEFFN(CExitStateRoom);
+DEFFN(CExitTiania);
+DEFFN(CMovePlayerInParrotRoom);
+DEFFN(CMovePlayerTo);
+DEFFN(CMovePlayerToFrom);
+DEFFN(CMultiMove);
+DEFFN(CPanFromPel);
+DEFFN(CRestaurantPanHandler);
+DEFFN(CScraliontisTable);
+DEFFN(CRestrictedMove);
+DEFFN(CTripDownCanal);
 
-DEFFN(CBarbot)
-DEFFN(CBellBot)
-DEFFN(CCallBot)
-DEFFN(CCharacter)
-DEFFN(CDeskbot)
-DEFFN(CDoorbot)
-DEFFN(CLiftBot)
-DEFFN(CMaitreD)
-DEFFN(CMobile)
-DEFFN(CParrot)
-DEFFN(CRobotController)
-DEFFN(CStarlings)
-DEFFN(CSummonBots)
-DEFFN(CSuccUBus)
-DEFFN(CTitania)
-DEFFN(CTrueTalkNPC)
-DEFFN(CAutoMusicPlayer)
-DEFFN(CAutoMusicPlayerBase)
-DEFFN(CAutoSoundPlayer)
-DEFFN(CAutoSoundPlayerADSR)
-DEFFN(CBackgroundSoundMaker)
-DEFFN(CBirdSong)
-DEFFN(CDomeFromTopOfWell)
-DEFFN(CEnterViewTogglesOtherMusic)
-DEFFN(CGondolierSong)
-DEFFN(CMusicPlayer)
-DEFFN(CNodeAutoSoundPlayer)
-DEFFN(CRestrictedAutoMusicPlayer)
-DEFFN(CRoomAutoSoundPlayer)
-DEFFN(CRoomTriggerAutoMusicPlayer)
-DEFFN(CSeasonNoises)
-DEFFN(CSeasonalMusicPlayer)
-DEFFN(CTitaniaSpeech)
-DEFFN(CTriggerAutoMusicPlayer)
-DEFFN(CViewAutoSoundPlayer)
-DEFFN(CViewTogglesOtherMusic)
-DEFFN(CWaterLappingSounds)
-DEFFN(CStarControl)
-DEFFN(CTimeEventInfo)
+DEFFN(CBarbot);
+DEFFN(CBellBot);
+DEFFN(CCallBot);
+DEFFN(CCharacter);
+DEFFN(CDeskbot);
+DEFFN(CDoorbot);
+DEFFN(CLiftBot);
+DEFFN(CMaitreD);
+DEFFN(CMobile);
+DEFFN(CParrot);
+DEFFN(CRobotController);
+DEFFN(CStarlings);
+DEFFN(CSummonBots);
+DEFFN(CSuccUBus);
+DEFFN(CTitania);
+DEFFN(CTrueTalkNPC);
+DEFFN(CAutoMusicPlayer);
+DEFFN(CAutoMusicPlayerBase);
+DEFFN(CAutoSoundPlayer);
+DEFFN(CAutoSoundPlayerADSR);
+DEFFN(CBackgroundSoundMaker);
+DEFFN(CBirdSong);
+DEFFN(CDomeFromTopOfWell);
+DEFFN(CEnterViewTogglesOtherMusic);
+DEFFN(CGondolierSong);
+DEFFN(CMusicPlayer);
+DEFFN(CNodeAutoSoundPlayer);
+DEFFN(CRestrictedAutoMusicPlayer);
+DEFFN(CRoomAutoSoundPlayer);
+DEFFN(CRoomTriggerAutoMusicPlayer);
+DEFFN(CSeasonNoises);
+DEFFN(CSeasonalMusicPlayer);
+DEFFN(CTitaniaSpeech);
+DEFFN(CTriggerAutoMusicPlayer);
+DEFFN(CViewAutoSoundPlayer);
+DEFFN(CViewTogglesOtherMusic);
+DEFFN(CWaterLappingSounds);
+DEFFN(CStarControl);
+DEFFN(CTimeEventInfo);
 
 void CSaveableObject::initClassList() {
 	_classDefs = new Common::List<ClassDef *>();


Commit: eb98b984fb5a630422013ab5f030d49b0aa39552
    https://github.com/scummvm/scummvm/commit/eb98b984fb5a630422013ab5f030d49b0aa39552
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T20:11:49-04:00

Commit Message:
TITANIC: Add semicolon after EMPTY_MESSAGE_MAP macro usages

Changed paths:
    engines/titanic/carry/feathers.cpp
    engines/titanic/carry/hose_end.cpp
    engines/titanic/carry/parcel.cpp
    engines/titanic/core/dont_save_file_item.cpp
    engines/titanic/core/file_item.cpp
    engines/titanic/core/game_object.cpp
    engines/titanic/core/link_item.cpp
    engines/titanic/core/message_target.h
    engines/titanic/core/named_item.cpp
    engines/titanic/core/node_item.cpp
    engines/titanic/core/project_item.cpp
    engines/titanic/core/room_item.cpp
    engines/titanic/core/static_image.cpp
    engines/titanic/core/tree_item.cpp
    engines/titanic/game/arb_background.cpp
    engines/titanic/game/broken_pell_base.cpp
    engines/titanic/game/leave_sec_class_state.cpp
    engines/titanic/game/music_room_phonograph.cpp
    engines/titanic/game/musical_instrument.cpp
    engines/titanic/game/navigation_computer.cpp
    engines/titanic/game/null_port_hole.cpp
    engines/titanic/game/parrot/parrot_lobby_object.cpp
    engines/titanic/game/pet/pet_class1.cpp
    engines/titanic/game/pet/pet_class2.cpp
    engines/titanic/game/pet/pet_class3.cpp
    engines/titanic/game/splash_animation.cpp
    engines/titanic/game/transport/transport.cpp
    engines/titanic/gfx/chev_left_off.cpp
    engines/titanic/gfx/chev_left_on.cpp
    engines/titanic/gfx/chev_right_off.cpp
    engines/titanic/gfx/chev_right_on.cpp
    engines/titanic/gfx/chev_send_rec_switch.cpp
    engines/titanic/gfx/elevator_button.cpp
    engines/titanic/gfx/get_from_succ.cpp
    engines/titanic/gfx/helmet_on_off.cpp
    engines/titanic/gfx/home_photo.cpp
    engines/titanic/gfx/icon_nav_action.cpp
    engines/titanic/gfx/icon_nav_butt.cpp
    engines/titanic/gfx/icon_nav_down.cpp
    engines/titanic/gfx/icon_nav_image.cpp
    engines/titanic/gfx/icon_nav_left.cpp
    engines/titanic/gfx/icon_nav_receive.cpp
    engines/titanic/gfx/icon_nav_right.cpp
    engines/titanic/gfx/icon_nav_send.cpp
    engines/titanic/gfx/icon_nav_up.cpp
    engines/titanic/gfx/keybrd_butt.cpp
    engines/titanic/gfx/music_slider.cpp
    engines/titanic/gfx/music_switch.cpp
    engines/titanic/gfx/send_to_succ.cpp
    engines/titanic/gfx/sgt_selector.cpp
    engines/titanic/gfx/small_chev_left_off.cpp
    engines/titanic/gfx/small_chev_left_on.cpp
    engines/titanic/gfx/small_chev_right_off.cpp
    engines/titanic/gfx/small_chev_right_on.cpp
    engines/titanic/gfx/text_down.cpp
    engines/titanic/gfx/text_skrew.cpp
    engines/titanic/gfx/text_up.cpp
    engines/titanic/gfx/toggle_button.cpp
    engines/titanic/npcs/mobile.cpp
    engines/titanic/pet_control/pet_graphic.cpp
    engines/titanic/pet_control/pet_graphic2.cpp
    engines/titanic/pet_control/pet_leaf.cpp
    engines/titanic/pet_control/pet_mode_off.cpp
    engines/titanic/pet_control/pet_mode_on.cpp
    engines/titanic/pet_control/pet_mode_panel.cpp
    engines/titanic/pet_control/pet_pannel1.cpp
    engines/titanic/pet_control/pet_pannel2.cpp
    engines/titanic/pet_control/pet_pannel3.cpp
    engines/titanic/sound/dome_from_top_of_well.cpp
    engines/titanic/sound/water_lapping_sounds.cpp



diff --git a/engines/titanic/carry/feathers.cpp b/engines/titanic/carry/feathers.cpp
index c2cf369..a5d2bab 100644
--- a/engines/titanic/carry/feathers.cpp
+++ b/engines/titanic/carry/feathers.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CFeathers, CCarry)
+EMPTY_MESSAGE_MAP(CFeathers, CCarry);
 
 CFeathers::CFeathers() : CCarry() {
 }
diff --git a/engines/titanic/carry/hose_end.cpp b/engines/titanic/carry/hose_end.cpp
index f6097c4..c999643 100644
--- a/engines/titanic/carry/hose_end.cpp
+++ b/engines/titanic/carry/hose_end.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CHoseEnd, CHose)
+EMPTY_MESSAGE_MAP(CHoseEnd, CHose);
 
 CHoseEnd::CHoseEnd() : CHose() {
 	_string6 = "Connection refused by remote hose.";
diff --git a/engines/titanic/carry/parcel.cpp b/engines/titanic/carry/parcel.cpp
index 13e2f6d..2ffe8b0 100644
--- a/engines/titanic/carry/parcel.cpp
+++ b/engines/titanic/carry/parcel.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CParcel, CCarry)
+EMPTY_MESSAGE_MAP(CParcel, CCarry);
 
 CParcel::CParcel() : CCarry() {
 }
diff --git a/engines/titanic/core/dont_save_file_item.cpp b/engines/titanic/core/dont_save_file_item.cpp
index 87ab77e..b8864bb 100644
--- a/engines/titanic/core/dont_save_file_item.cpp
+++ b/engines/titanic/core/dont_save_file_item.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CDontSaveFileItem, CFileItem)
+EMPTY_MESSAGE_MAP(CDontSaveFileItem, CFileItem);
 
 void CDontSaveFileItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
diff --git a/engines/titanic/core/file_item.cpp b/engines/titanic/core/file_item.cpp
index 824195d..b783c75 100644
--- a/engines/titanic/core/file_item.cpp
+++ b/engines/titanic/core/file_item.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CFileItem, CTreeItem)
+EMPTY_MESSAGE_MAP(CFileItem, CTreeItem);
 
 void CFileItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index af4ffab..39e4f84 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -35,7 +35,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CGameObject, CNamedItem)
+EMPTY_MESSAGE_MAP(CGameObject, CNamedItem);
 
 CCreditText *CGameObject::_credits;
 
diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp
index 5de0d4c..1102184 100644
--- a/engines/titanic/core/link_item.cpp
+++ b/engines/titanic/core/link_item.cpp
@@ -27,7 +27,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CLinkItem, CNamedItem)
+EMPTY_MESSAGE_MAP(CLinkItem, CNamedItem);
 
 CLinkItem::CLinkItem() : CNamedItem() {
 	_roomNumber = -1;
diff --git a/engines/titanic/core/message_target.h b/engines/titanic/core/message_target.h
index 5508c47..cfd7ac1 100644
--- a/engines/titanic/core/message_target.h
+++ b/engines/titanic/core/message_target.h
@@ -80,7 +80,8 @@ protected: \
 		static const MSGMAP messageMap = \
 		{ &TheBaseClass::getThisMessageMap, &_messageEntries[0] }; \
 		return &messageMap; \
-	}
+	} \
+	static const int DUMMY
 
 class CMessageTarget: public CSaveableObject {
 	DECLARE_MESSAGE_MAP
diff --git a/engines/titanic/core/named_item.cpp b/engines/titanic/core/named_item.cpp
index 2b741f7..6eafbf8 100644
--- a/engines/titanic/core/named_item.cpp
+++ b/engines/titanic/core/named_item.cpp
@@ -27,7 +27,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CNamedItem, CTreeItem)
+EMPTY_MESSAGE_MAP(CNamedItem, CTreeItem);
 
 CString CNamedItem::dumpItem(int indent) const {
 	CString result = CTreeItem::dumpItem(indent);
diff --git a/engines/titanic/core/node_item.cpp b/engines/titanic/core/node_item.cpp
index 79188dd..1de065a 100644
--- a/engines/titanic/core/node_item.cpp
+++ b/engines/titanic/core/node_item.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CNodeItem, CNamedItem)
+EMPTY_MESSAGE_MAP(CNodeItem, CNamedItem);
 
 CNodeItem::CNodeItem() : CNamedItem(), _nodeNumber(0) {
 }
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 4fd2ea2..7629323 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -41,7 +41,7 @@ namespace Titanic {
 static const char *const SAVEGAME_STR = "TNIC";
 #define SAVEGAME_STR_SIZE 4
 
-EMPTY_MESSAGE_MAP(CProjectItem, CFileItem)
+EMPTY_MESSAGE_MAP(CProjectItem, CFileItem);
 
 void CFileListItem::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(0, indent);
diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp
index a88238d..541a8e1 100644
--- a/engines/titanic/core/room_item.cpp
+++ b/engines/titanic/core/room_item.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CRoomItem, CNamedItem)
+EMPTY_MESSAGE_MAP(CRoomItem, CNamedItem);
 
 CRoomItem::CRoomItem() : CNamedItem(), _roomNumber(0),
 		_roomDimensionX(0.0), _roomDimensionY(0.0) {
diff --git a/engines/titanic/core/static_image.cpp b/engines/titanic/core/static_image.cpp
index 6728610..977009e 100644
--- a/engines/titanic/core/static_image.cpp
+++ b/engines/titanic/core/static_image.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CStaticImage, CGameObject)
+EMPTY_MESSAGE_MAP(CStaticImage, CGameObject);
 
 void CStaticImage::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 5fcd74b..6adbbe3 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -38,7 +38,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CTreeItem, CMessageTarget)
+EMPTY_MESSAGE_MAP(CTreeItem, CMessageTarget);
 
 CTreeItem::CTreeItem() : _parent(nullptr), _firstChild(nullptr),
 	_nextSibling(nullptr), _priorSibling(nullptr), _field14(0) {
diff --git a/engines/titanic/game/arb_background.cpp b/engines/titanic/game/arb_background.cpp
index b86ecb1..f71bcf9 100644
--- a/engines/titanic/game/arb_background.cpp
+++ b/engines/titanic/game/arb_background.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CArbBackground, CBackground)
+EMPTY_MESSAGE_MAP(CArbBackground, CBackground);
 
 CArbBackground::CArbBackground() : CBackground(),
 	_fieldE0(0), _fieldE4(61), _fieldE8(62), _fieldEC(118) {
diff --git a/engines/titanic/game/broken_pell_base.cpp b/engines/titanic/game/broken_pell_base.cpp
index 77d3aee..59e2b9b 100644
--- a/engines/titanic/game/broken_pell_base.cpp
+++ b/engines/titanic/game/broken_pell_base.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CBrokenPellBase, CBackground)
+EMPTY_MESSAGE_MAP(CBrokenPellBase, CBackground);
 
 int CBrokenPellBase::_v1;
 int CBrokenPellBase::_v2;
diff --git a/engines/titanic/game/leave_sec_class_state.cpp b/engines/titanic/game/leave_sec_class_state.cpp
index 0143062..3e23e3a 100644
--- a/engines/titanic/game/leave_sec_class_state.cpp
+++ b/engines/titanic/game/leave_sec_class_state.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CLeaveSecClassState, CGameObject)
+EMPTY_MESSAGE_MAP(CLeaveSecClassState, CGameObject);
 
 void CLeaveSecClassState::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/game/music_room_phonograph.cpp b/engines/titanic/game/music_room_phonograph.cpp
index 2fceca2..06a35dc 100644
--- a/engines/titanic/game/music_room_phonograph.cpp
+++ b/engines/titanic/game/music_room_phonograph.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CMusicRoomPhonograph, CRestaurantPhonograph)
+EMPTY_MESSAGE_MAP(CMusicRoomPhonograph, CRestaurantPhonograph);
 
 void CMusicRoomPhonograph::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/game/musical_instrument.cpp b/engines/titanic/game/musical_instrument.cpp
index aea58b4..3bd2e37 100644
--- a/engines/titanic/game/musical_instrument.cpp
+++ b/engines/titanic/game/musical_instrument.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CMusicalInstrument, CBackground)
+EMPTY_MESSAGE_MAP(CMusicalInstrument, CBackground);
 
 void CMusicalInstrument::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/game/navigation_computer.cpp b/engines/titanic/game/navigation_computer.cpp
index 042901c..49bd252 100644
--- a/engines/titanic/game/navigation_computer.cpp
+++ b/engines/titanic/game/navigation_computer.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CNavigationComputer, CGameObject)
+EMPTY_MESSAGE_MAP(CNavigationComputer, CGameObject);
 
 void CNavigationComputer::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/game/null_port_hole.cpp b/engines/titanic/game/null_port_hole.cpp
index 060e5f0..e651b1b 100644
--- a/engines/titanic/game/null_port_hole.cpp
+++ b/engines/titanic/game/null_port_hole.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CNullPortHole, CClickResponder)
+EMPTY_MESSAGE_MAP(CNullPortHole, CClickResponder);
 
 CNullPortHole::CNullPortHole() : CClickResponder() {
 	_string1 = "For a better view, why not visit the Promenade Deck?";
diff --git a/engines/titanic/game/parrot/parrot_lobby_object.cpp b/engines/titanic/game/parrot/parrot_lobby_object.cpp
index 9d556b5..a78ab2b 100644
--- a/engines/titanic/game/parrot/parrot_lobby_object.cpp
+++ b/engines/titanic/game/parrot/parrot_lobby_object.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CParrotLobbyObject, CGameObject)
+EMPTY_MESSAGE_MAP(CParrotLobbyObject, CGameObject);
 
 int CParrotLobbyObject::_v1;
 int CParrotLobbyObject::_v2;
diff --git a/engines/titanic/game/pet/pet_class1.cpp b/engines/titanic/game/pet/pet_class1.cpp
index 096977e..651a8f9 100644
--- a/engines/titanic/game/pet/pet_class1.cpp
+++ b/engines/titanic/game/pet/pet_class1.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CPETClass1, CGameObject)
+EMPTY_MESSAGE_MAP(CPETClass1, CGameObject);
 
 void CPETClass1::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/game/pet/pet_class2.cpp b/engines/titanic/game/pet/pet_class2.cpp
index d13ed66..e3e23f6 100644
--- a/engines/titanic/game/pet/pet_class2.cpp
+++ b/engines/titanic/game/pet/pet_class2.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CPETClass2, CGameObject)
+EMPTY_MESSAGE_MAP(CPETClass2, CGameObject);
 
 void CPETClass2::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/game/pet/pet_class3.cpp b/engines/titanic/game/pet/pet_class3.cpp
index 0c0adf2..7751b99 100644
--- a/engines/titanic/game/pet/pet_class3.cpp
+++ b/engines/titanic/game/pet/pet_class3.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CPETClass3, CGameObject)
+EMPTY_MESSAGE_MAP(CPETClass3, CGameObject);
 
 void CPETClass3::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/game/splash_animation.cpp b/engines/titanic/game/splash_animation.cpp
index cfaf697..2094ec1 100644
--- a/engines/titanic/game/splash_animation.cpp
+++ b/engines/titanic/game/splash_animation.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CSplashAnimation, CGameObject)
+EMPTY_MESSAGE_MAP(CSplashAnimation, CGameObject);
 
 void CSplashAnimation::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/game/transport/transport.cpp b/engines/titanic/game/transport/transport.cpp
index f9598c7..6fe45c2 100644
--- a/engines/titanic/game/transport/transport.cpp
+++ b/engines/titanic/game/transport/transport.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CTransport, CMobile)
+EMPTY_MESSAGE_MAP(CTransport, CMobile);
 
 CTransport::CTransport() : CMobile(), _string1("*.*.*") {
 }
diff --git a/engines/titanic/gfx/chev_left_off.cpp b/engines/titanic/gfx/chev_left_off.cpp
index 5158399..d5c7dcf 100644
--- a/engines/titanic/gfx/chev_left_off.cpp
+++ b/engines/titanic/gfx/chev_left_off.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CChevLeftOff, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CChevLeftOff, CToggleSwitch);
 
 CChevLeftOff::CChevLeftOff() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/chev_left_on.cpp b/engines/titanic/gfx/chev_left_on.cpp
index 5b3f6a8..9b4a5b6 100644
--- a/engines/titanic/gfx/chev_left_on.cpp
+++ b/engines/titanic/gfx/chev_left_on.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CChevLeftOn, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CChevLeftOn, CToggleSwitch);
 
 CChevLeftOn::CChevLeftOn() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/chev_right_off.cpp b/engines/titanic/gfx/chev_right_off.cpp
index 4cab070..c4ff362 100644
--- a/engines/titanic/gfx/chev_right_off.cpp
+++ b/engines/titanic/gfx/chev_right_off.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CChevRightOff, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CChevRightOff, CToggleSwitch);
 
 CChevRightOff::CChevRightOff() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/chev_right_on.cpp b/engines/titanic/gfx/chev_right_on.cpp
index 29a07f0..0351c10 100644
--- a/engines/titanic/gfx/chev_right_on.cpp
+++ b/engines/titanic/gfx/chev_right_on.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CChevRightOn, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CChevRightOn, CToggleSwitch);
 
 CChevRightOn::CChevRightOn() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/chev_send_rec_switch.cpp b/engines/titanic/gfx/chev_send_rec_switch.cpp
index 92b5518..6e30280 100644
--- a/engines/titanic/gfx/chev_send_rec_switch.cpp
+++ b/engines/titanic/gfx/chev_send_rec_switch.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CChevSendRecSwitch, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CChevSendRecSwitch, CToggleSwitch);
 
 CChevSendRecSwitch::CChevSendRecSwitch() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/elevator_button.cpp b/engines/titanic/gfx/elevator_button.cpp
index 3c61869..e66ee19 100644
--- a/engines/titanic/gfx/elevator_button.cpp
+++ b/engines/titanic/gfx/elevator_button.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CElevatorButton, CSTButton)
+EMPTY_MESSAGE_MAP(CElevatorButton, CSTButton);
 
 CElevatorButton::CElevatorButton() : CSTButton() {
 }
diff --git a/engines/titanic/gfx/get_from_succ.cpp b/engines/titanic/gfx/get_from_succ.cpp
index 0f3f4ba..d701f73 100644
--- a/engines/titanic/gfx/get_from_succ.cpp
+++ b/engines/titanic/gfx/get_from_succ.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CGetFromSucc, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CGetFromSucc, CToggleSwitch);
 
 CGetFromSucc::CGetFromSucc() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/helmet_on_off.cpp b/engines/titanic/gfx/helmet_on_off.cpp
index c72c795..06e7d43 100644
--- a/engines/titanic/gfx/helmet_on_off.cpp
+++ b/engines/titanic/gfx/helmet_on_off.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CHelmetOnOff, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CHelmetOnOff, CToggleSwitch);
 
 CHelmetOnOff::CHelmetOnOff() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/home_photo.cpp b/engines/titanic/gfx/home_photo.cpp
index 1c3b064..758a5ca 100644
--- a/engines/titanic/gfx/home_photo.cpp
+++ b/engines/titanic/gfx/home_photo.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CHomePhoto, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CHomePhoto, CToggleSwitch);
 
 CHomePhoto::CHomePhoto() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/icon_nav_action.cpp b/engines/titanic/gfx/icon_nav_action.cpp
index bd32c93..4d32f46 100644
--- a/engines/titanic/gfx/icon_nav_action.cpp
+++ b/engines/titanic/gfx/icon_nav_action.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CIconNavAction, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CIconNavAction, CToggleSwitch);
 
 CIconNavAction::CIconNavAction() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/icon_nav_butt.cpp b/engines/titanic/gfx/icon_nav_butt.cpp
index cc9a217..951c2f5 100644
--- a/engines/titanic/gfx/icon_nav_butt.cpp
+++ b/engines/titanic/gfx/icon_nav_butt.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CIconNavButt, CPetGraphic)
+EMPTY_MESSAGE_MAP(CIconNavButt, CPetGraphic);
 
 void CIconNavButt::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/gfx/icon_nav_down.cpp b/engines/titanic/gfx/icon_nav_down.cpp
index 09a0332..efa2124 100644
--- a/engines/titanic/gfx/icon_nav_down.cpp
+++ b/engines/titanic/gfx/icon_nav_down.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CIconNavDown, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CIconNavDown, CToggleSwitch);
 
 CIconNavDown::CIconNavDown() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/icon_nav_image.cpp b/engines/titanic/gfx/icon_nav_image.cpp
index 59a50bb..403ae44 100644
--- a/engines/titanic/gfx/icon_nav_image.cpp
+++ b/engines/titanic/gfx/icon_nav_image.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CIconNavImage, CPetGraphic)
+EMPTY_MESSAGE_MAP(CIconNavImage, CPetGraphic);
 
 void CIconNavImage::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/gfx/icon_nav_left.cpp b/engines/titanic/gfx/icon_nav_left.cpp
index 272e2a6..8d98f37 100644
--- a/engines/titanic/gfx/icon_nav_left.cpp
+++ b/engines/titanic/gfx/icon_nav_left.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CIconNavLeft, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CIconNavLeft, CToggleSwitch);
 
 CIconNavLeft::CIconNavLeft() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/icon_nav_receive.cpp b/engines/titanic/gfx/icon_nav_receive.cpp
index ba5d8ea..e3e0986 100644
--- a/engines/titanic/gfx/icon_nav_receive.cpp
+++ b/engines/titanic/gfx/icon_nav_receive.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CIconNavReceive, CPetGraphic)
+EMPTY_MESSAGE_MAP(CIconNavReceive, CPetGraphic);
 
 void CIconNavReceive::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/gfx/icon_nav_right.cpp b/engines/titanic/gfx/icon_nav_right.cpp
index a661e0d..de82791 100644
--- a/engines/titanic/gfx/icon_nav_right.cpp
+++ b/engines/titanic/gfx/icon_nav_right.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CIconNavRight, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CIconNavRight, CToggleSwitch);
 
 CIconNavRight::CIconNavRight() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/icon_nav_send.cpp b/engines/titanic/gfx/icon_nav_send.cpp
index 067e448..9baa9e8 100644
--- a/engines/titanic/gfx/icon_nav_send.cpp
+++ b/engines/titanic/gfx/icon_nav_send.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CIconNavSend, CPetGraphic)
+EMPTY_MESSAGE_MAP(CIconNavSend, CPetGraphic);
 
 void CIconNavSend::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/gfx/icon_nav_up.cpp b/engines/titanic/gfx/icon_nav_up.cpp
index 5671dee..4268d97 100644
--- a/engines/titanic/gfx/icon_nav_up.cpp
+++ b/engines/titanic/gfx/icon_nav_up.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CIconNavUp, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CIconNavUp, CToggleSwitch);
 
 CIconNavUp::CIconNavUp() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/keybrd_butt.cpp b/engines/titanic/gfx/keybrd_butt.cpp
index 1a0a927..063e709 100644
--- a/engines/titanic/gfx/keybrd_butt.cpp
+++ b/engines/titanic/gfx/keybrd_butt.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CKeybrdButt, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CKeybrdButt, CToggleSwitch);
 
 CKeybrdButt::CKeybrdButt() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/music_slider.cpp b/engines/titanic/gfx/music_slider.cpp
index fcf4d4b..ec7ff5e 100644
--- a/engines/titanic/gfx/music_slider.cpp
+++ b/engines/titanic/gfx/music_slider.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CMusicSlider, CMusicControl)
+EMPTY_MESSAGE_MAP(CMusicSlider, CMusicControl);
 
 void CMusicSlider::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/gfx/music_switch.cpp b/engines/titanic/gfx/music_switch.cpp
index fb1c6de..1c2ced0 100644
--- a/engines/titanic/gfx/music_switch.cpp
+++ b/engines/titanic/gfx/music_switch.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CMusicSwitch, CMusicControl)
+EMPTY_MESSAGE_MAP(CMusicSwitch, CMusicControl);
 
 void CMusicSwitch::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/gfx/send_to_succ.cpp b/engines/titanic/gfx/send_to_succ.cpp
index 3054191..0e2b833 100644
--- a/engines/titanic/gfx/send_to_succ.cpp
+++ b/engines/titanic/gfx/send_to_succ.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CSendToSucc, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CSendToSucc, CToggleSwitch);
 
 CSendToSucc::CSendToSucc() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/sgt_selector.cpp b/engines/titanic/gfx/sgt_selector.cpp
index c7b52f8..81cccb7 100644
--- a/engines/titanic/gfx/sgt_selector.cpp
+++ b/engines/titanic/gfx/sgt_selector.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CSGTSelector, CPetGraphic)
+EMPTY_MESSAGE_MAP(CSGTSelector, CPetGraphic);
 
 void CSGTSelector::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/gfx/small_chev_left_off.cpp b/engines/titanic/gfx/small_chev_left_off.cpp
index b0b22e9..f7c27f9 100644
--- a/engines/titanic/gfx/small_chev_left_off.cpp
+++ b/engines/titanic/gfx/small_chev_left_off.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CSmallChevLeftOff, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CSmallChevLeftOff, CToggleSwitch);
 
 CSmallChevLeftOff::CSmallChevLeftOff() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/small_chev_left_on.cpp b/engines/titanic/gfx/small_chev_left_on.cpp
index a2df2b5..7a82c18 100644
--- a/engines/titanic/gfx/small_chev_left_on.cpp
+++ b/engines/titanic/gfx/small_chev_left_on.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CSmallChevLeftOn, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CSmallChevLeftOn, CToggleSwitch);
 
 CSmallChevLeftOn::CSmallChevLeftOn() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/small_chev_right_off.cpp b/engines/titanic/gfx/small_chev_right_off.cpp
index 48f0941..f07c5a3 100644
--- a/engines/titanic/gfx/small_chev_right_off.cpp
+++ b/engines/titanic/gfx/small_chev_right_off.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CSmallChevRightOff, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CSmallChevRightOff, CToggleSwitch);
 
 CSmallChevRightOff::CSmallChevRightOff() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/small_chev_right_on.cpp b/engines/titanic/gfx/small_chev_right_on.cpp
index af794fa..18aba4a 100644
--- a/engines/titanic/gfx/small_chev_right_on.cpp
+++ b/engines/titanic/gfx/small_chev_right_on.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CSmallChevRightOn, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CSmallChevRightOn, CToggleSwitch);
 
 CSmallChevRightOn::CSmallChevRightOn() : CToggleSwitch() {
 }
diff --git a/engines/titanic/gfx/text_down.cpp b/engines/titanic/gfx/text_down.cpp
index 4a68752..4d9bb0b 100644
--- a/engines/titanic/gfx/text_down.cpp
+++ b/engines/titanic/gfx/text_down.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CTextDown, CPetGraphic)
+EMPTY_MESSAGE_MAP(CTextDown, CPetGraphic);
 
 void CTextDown::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/gfx/text_skrew.cpp b/engines/titanic/gfx/text_skrew.cpp
index 391ed37..6d403ea 100644
--- a/engines/titanic/gfx/text_skrew.cpp
+++ b/engines/titanic/gfx/text_skrew.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CTextSkrew, CPetGraphic)
+EMPTY_MESSAGE_MAP(CTextSkrew, CPetGraphic);
 
 void CTextSkrew::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/gfx/text_up.cpp b/engines/titanic/gfx/text_up.cpp
index d5e2b1b..842be63 100644
--- a/engines/titanic/gfx/text_up.cpp
+++ b/engines/titanic/gfx/text_up.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CTextUp, CPetGraphic)
+EMPTY_MESSAGE_MAP(CTextUp, CPetGraphic);
 
 void CTextUp::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/gfx/toggle_button.cpp b/engines/titanic/gfx/toggle_button.cpp
index 78e5356..2b7c80d 100644
--- a/engines/titanic/gfx/toggle_button.cpp
+++ b/engines/titanic/gfx/toggle_button.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CToggleButton, CBackground)
+EMPTY_MESSAGE_MAP(CToggleButton, CBackground);
 
 void CToggleButton::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/npcs/mobile.cpp b/engines/titanic/npcs/mobile.cpp
index 83f886e..8a45f9e 100644
--- a/engines/titanic/npcs/mobile.cpp
+++ b/engines/titanic/npcs/mobile.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CMobile, CCharacter)
+EMPTY_MESSAGE_MAP(CMobile, CCharacter);
 
 CMobile::CMobile() : CCharacter(), _fieldDC(0) {
 }
diff --git a/engines/titanic/pet_control/pet_graphic.cpp b/engines/titanic/pet_control/pet_graphic.cpp
index c4e1849..bc7d861 100644
--- a/engines/titanic/pet_control/pet_graphic.cpp
+++ b/engines/titanic/pet_control/pet_graphic.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CPetGraphic, CGameObject)
+EMPTY_MESSAGE_MAP(CPetGraphic, CGameObject);
 
 void CPetGraphic::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/pet_control/pet_graphic2.cpp b/engines/titanic/pet_control/pet_graphic2.cpp
index 79cf42e..36c4d0f 100644
--- a/engines/titanic/pet_control/pet_graphic2.cpp
+++ b/engines/titanic/pet_control/pet_graphic2.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CPetGraphic2, CGameObject)
+EMPTY_MESSAGE_MAP(CPetGraphic2, CGameObject);
 
 void CPetGraphic2::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/pet_control/pet_leaf.cpp b/engines/titanic/pet_control/pet_leaf.cpp
index bf40b6c..718ffe5 100644
--- a/engines/titanic/pet_control/pet_leaf.cpp
+++ b/engines/titanic/pet_control/pet_leaf.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(PETLeaf, CGameObject)
+EMPTY_MESSAGE_MAP(PETLeaf, CGameObject);
 
 void PETLeaf::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/pet_control/pet_mode_off.cpp b/engines/titanic/pet_control/pet_mode_off.cpp
index 277b8e5..119c15a 100644
--- a/engines/titanic/pet_control/pet_mode_off.cpp
+++ b/engines/titanic/pet_control/pet_mode_off.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CPetModeOff, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CPetModeOff, CToggleSwitch);
 
 CPetModeOff::CPetModeOff() : CToggleSwitch() {
 }
diff --git a/engines/titanic/pet_control/pet_mode_on.cpp b/engines/titanic/pet_control/pet_mode_on.cpp
index 89845dc..2b61461 100644
--- a/engines/titanic/pet_control/pet_mode_on.cpp
+++ b/engines/titanic/pet_control/pet_mode_on.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CPetModeOn, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CPetModeOn, CToggleSwitch);
 
 CPetModeOn::CPetModeOn() : CToggleSwitch() {
 }
diff --git a/engines/titanic/pet_control/pet_mode_panel.cpp b/engines/titanic/pet_control/pet_mode_panel.cpp
index 1384602..8579c31 100644
--- a/engines/titanic/pet_control/pet_mode_panel.cpp
+++ b/engines/titanic/pet_control/pet_mode_panel.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CPetModePanel, CToggleSwitch)
+EMPTY_MESSAGE_MAP(CPetModePanel, CToggleSwitch);
 
 CPetModePanel::CPetModePanel() : CToggleSwitch() {
 }
diff --git a/engines/titanic/pet_control/pet_pannel1.cpp b/engines/titanic/pet_control/pet_pannel1.cpp
index 9906212..7a757bf 100644
--- a/engines/titanic/pet_control/pet_pannel1.cpp
+++ b/engines/titanic/pet_control/pet_pannel1.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CPetPannel1, CPetGraphic)
+EMPTY_MESSAGE_MAP(CPetPannel1, CPetGraphic);
 
 void CPetPannel1::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/pet_control/pet_pannel2.cpp b/engines/titanic/pet_control/pet_pannel2.cpp
index b67e0ed..096a39a 100644
--- a/engines/titanic/pet_control/pet_pannel2.cpp
+++ b/engines/titanic/pet_control/pet_pannel2.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CPetPannel2, CPetGraphic)
+EMPTY_MESSAGE_MAP(CPetPannel2, CPetGraphic);
 
 void CPetPannel2::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/pet_control/pet_pannel3.cpp b/engines/titanic/pet_control/pet_pannel3.cpp
index a2a1fbe..0d095a6 100644
--- a/engines/titanic/pet_control/pet_pannel3.cpp
+++ b/engines/titanic/pet_control/pet_pannel3.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CPetPannel3, CPetGraphic)
+EMPTY_MESSAGE_MAP(CPetPannel3, CPetGraphic);
 
 void CPetPannel3::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/sound/dome_from_top_of_well.cpp b/engines/titanic/sound/dome_from_top_of_well.cpp
index 778f016..3721b9f 100644
--- a/engines/titanic/sound/dome_from_top_of_well.cpp
+++ b/engines/titanic/sound/dome_from_top_of_well.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CDomeFromTopOfWell, CViewAutoSoundPlayer)
+EMPTY_MESSAGE_MAP(CDomeFromTopOfWell, CViewAutoSoundPlayer);
 
 void CDomeFromTopOfWell::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);
diff --git a/engines/titanic/sound/water_lapping_sounds.cpp b/engines/titanic/sound/water_lapping_sounds.cpp
index 74af787..c33db41 100644
--- a/engines/titanic/sound/water_lapping_sounds.cpp
+++ b/engines/titanic/sound/water_lapping_sounds.cpp
@@ -24,7 +24,7 @@
 
 namespace Titanic {
 
-EMPTY_MESSAGE_MAP(CWaterLappingSounds, CRoomAutoSoundPlayer)
+EMPTY_MESSAGE_MAP(CWaterLappingSounds, CRoomAutoSoundPlayer);
 
 void CWaterLappingSounds::save(SimpleFile *file, int indent) {
 	file->writeNumberLine(1, indent);


Commit: 4d79ee16c07e2398e9058fe93947b4704cd6048a
    https://github.com/scummvm/scummvm/commit/4d79ee16c07e2398e9058fe93947b4704cd6048a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T20:30:56-04:00

Commit Message:
TITANIC: Add semicolon after CLASSDEF macro usage

Changed paths:
    engines/titanic/carry/arm.h
    engines/titanic/carry/auditory_centre.h
    engines/titanic/carry/bowl_ear.h
    engines/titanic/carry/brain.h
    engines/titanic/carry/bridge_piece.h
    engines/titanic/carry/carry.h
    engines/titanic/carry/carry_parrot.h
    engines/titanic/carry/central_core.h
    engines/titanic/carry/chicken.h
    engines/titanic/carry/crushed_tv.h
    engines/titanic/carry/ear.h
    engines/titanic/carry/eye.h
    engines/titanic/carry/feathers.h
    engines/titanic/carry/fruit.h
    engines/titanic/carry/glass.h
    engines/titanic/carry/hammer.h
    engines/titanic/carry/head_piece.h
    engines/titanic/carry/hose.h
    engines/titanic/carry/hose_end.h
    engines/titanic/carry/key.h
    engines/titanic/carry/liftbot_head.h
    engines/titanic/carry/long_stick.h
    engines/titanic/carry/magazine.h
    engines/titanic/carry/maitred_left_arm.h
    engines/titanic/carry/maitred_right_arm.h
    engines/titanic/carry/mouth.h
    engines/titanic/carry/napkin.h
    engines/titanic/carry/nose.h
    engines/titanic/carry/note.h
    engines/titanic/carry/parcel.h
    engines/titanic/carry/perch.h
    engines/titanic/carry/phonograph_cylinder.h
    engines/titanic/carry/phonograph_ear.h
    engines/titanic/carry/photograph.h
    engines/titanic/carry/plug_in.h
    engines/titanic/carry/speech_centre.h
    engines/titanic/carry/sweets.h
    engines/titanic/carry/test_carry.h
    engines/titanic/carry/vision_centre.h
    engines/titanic/core/background.h
    engines/titanic/core/click_responder.h
    engines/titanic/core/dont_save_file_item.h
    engines/titanic/core/drop_target.h
    engines/titanic/core/file_item.h
    engines/titanic/core/game_object.h
    engines/titanic/core/game_object_desc_item.h
    engines/titanic/core/link_item.h
    engines/titanic/core/list.h
    engines/titanic/core/mail_man.h
    engines/titanic/core/message_target.h
    engines/titanic/core/multi_drop_target.h
    engines/titanic/core/named_item.h
    engines/titanic/core/node_item.h
    engines/titanic/core/project_item.h
    engines/titanic/core/resource_key.h
    engines/titanic/core/room_item.h
    engines/titanic/core/static_image.h
    engines/titanic/core/tree_item.h
    engines/titanic/core/turn_on_object.h
    engines/titanic/core/turn_on_play_sound.h
    engines/titanic/core/turn_on_turn_off.h
    engines/titanic/core/view_item.h
    engines/titanic/game/announce.h
    engines/titanic/game/annoy_barbot.h
    engines/titanic/game/arb_background.h
    engines/titanic/game/arboretum_gate.h
    engines/titanic/game/auto_animate.h
    engines/titanic/game/bar_bell.h
    engines/titanic/game/bar_menu.h
    engines/titanic/game/bar_menu_button.h
    engines/titanic/game/belbot_get_light.h
    engines/titanic/game/bilge_succubus.h
    engines/titanic/game/bomb.h
    engines/titanic/game/bottom_of_well_monitor.h
    engines/titanic/game/bowl_unlocker.h
    engines/titanic/game/brain_slot.h
    engines/titanic/game/bridge_door.h
    engines/titanic/game/bridge_view.h
    engines/titanic/game/broken_pell_base.h
    engines/titanic/game/broken_pellerator.h
    engines/titanic/game/broken_pellerator_froz.h
    engines/titanic/game/cage.h
    engines/titanic/game/call_pellerator.h
    engines/titanic/game/captains_wheel.h
    engines/titanic/game/cdrom.h
    engines/titanic/game/cdrom_computer.h
    engines/titanic/game/cdrom_tray.h
    engines/titanic/game/cell_point_button.h
    engines/titanic/game/chev_code.h
    engines/titanic/game/chev_panel.h
    engines/titanic/game/chicken_cooler.h
    engines/titanic/game/chicken_dispensor.h
    engines/titanic/game/close_broken_pel.h
    engines/titanic/game/code_wheel.h
    engines/titanic/game/computer.h
    engines/titanic/game/computer_screen.h
    engines/titanic/game/cookie.h
    engines/titanic/game/credits.h
    engines/titanic/game/credits_button.h
    engines/titanic/game/dead_area.h
    engines/titanic/game/desk_click_responder.h
    engines/titanic/game/doorbot_elevator_handler.h
    engines/titanic/game/doorbot_home_handler.h
    engines/titanic/game/ear_sweet_bowl.h
    engines/titanic/game/eject_phonograph_button.h
    engines/titanic/game/elevator_action_area.h
    engines/titanic/game/emma_control.h
    engines/titanic/game/empty_nut_bowl.h
    engines/titanic/game/end_credit_text.h
    engines/titanic/game/end_credits.h
    engines/titanic/game/end_explode_ship.h
    engines/titanic/game/end_game_credits.h
    engines/titanic/game/end_sequence_control.h
    engines/titanic/game/fan.h
    engines/titanic/game/fan_control.h
    engines/titanic/game/fan_decrease.h
    engines/titanic/game/fan_increase.h
    engines/titanic/game/fan_noises.h
    engines/titanic/game/floor_indicator.h
    engines/titanic/game/games_console.h
    engines/titanic/game/get_lift_eye2.h
    engines/titanic/game/glass_smasher.h
    engines/titanic/game/gondolier/gondolier_base.h
    engines/titanic/game/gondolier/gondolier_chest.h
    engines/titanic/game/gondolier/gondolier_face.h
    engines/titanic/game/gondolier/gondolier_mixer.h
    engines/titanic/game/gondolier/gondolier_slider.h
    engines/titanic/game/hammer_clip.h
    engines/titanic/game/hammer_dispensor.h
    engines/titanic/game/hammer_dispensor_button.h
    engines/titanic/game/head_slot.h
    engines/titanic/game/head_smash_event.h
    engines/titanic/game/head_smash_lever.h
    engines/titanic/game/head_spinner.h
    engines/titanic/game/idle_summoner.h
    engines/titanic/game/leave_sec_class_state.h
    engines/titanic/game/lemon_dispensor.h
    engines/titanic/game/light.h
    engines/titanic/game/light_switch.h
    engines/titanic/game/little_lift_button.h
    engines/titanic/game/long_stick_dispenser.h
    engines/titanic/game/maitred/maitred_arm_holder.h
    engines/titanic/game/maitred/maitred_body.h
    engines/titanic/game/maitred/maitred_legs.h
    engines/titanic/game/maitred/maitred_prod_receptor.h
    engines/titanic/game/missiveomat.h
    engines/titanic/game/missiveomat_button.h
    engines/titanic/game/movie_tester.h
    engines/titanic/game/music_console_button.h
    engines/titanic/game/music_room_phonograph.h
    engines/titanic/game/music_room_stop_phonograph_button.h
    engines/titanic/game/music_system_lock.h
    engines/titanic/game/musical_instrument.h
    engines/titanic/game/nav_helmet.h
    engines/titanic/game/navigation_computer.h
    engines/titanic/game/no_nut_bowl.h
    engines/titanic/game/nose_holder.h
    engines/titanic/game/null_port_hole.h
    engines/titanic/game/nut_replacer.h
    engines/titanic/game/parrot/parrot_lobby_controller.h
    engines/titanic/game/parrot/parrot_lobby_link_updater.h
    engines/titanic/game/parrot/parrot_lobby_object.h
    engines/titanic/game/parrot/parrot_lobby_view_object.h
    engines/titanic/game/parrot/parrot_loser.h
    engines/titanic/game/parrot/parrot_nut_bowl_actor.h
    engines/titanic/game/parrot/parrot_nut_eater.h
    engines/titanic/game/parrot/parrot_perch_holder.h
    engines/titanic/game/parrot/parrot_succubus.h
    engines/titanic/game/parrot/parrot_trigger.h
    engines/titanic/game/parrot/player_meets_parrot.h
    engines/titanic/game/pet/pet.h
    engines/titanic/game/pet/pet_class1.h
    engines/titanic/game/pet/pet_class2.h
    engines/titanic/game/pet/pet_class3.h
    engines/titanic/game/pet/pet_lift.h
    engines/titanic/game/pet/pet_monitor.h
    engines/titanic/game/pet/pet_pellerator.h
    engines/titanic/game/pet/pet_position.h
    engines/titanic/game/pet/pet_sentinal.h
    engines/titanic/game/pet/pet_sounds.h
    engines/titanic/game/pet/pet_transition.h
    engines/titanic/game/pet/pet_transport.h
    engines/titanic/game/pet_disabler.h
    engines/titanic/game/phonograph.h
    engines/titanic/game/phonograph_lid.h
    engines/titanic/game/pickup/pick_up.h
    engines/titanic/game/pickup/pick_up_bar_glass.h
    engines/titanic/game/pickup/pick_up_hose.h
    engines/titanic/game/pickup/pick_up_lemon.h
    engines/titanic/game/pickup/pick_up_speech_centre.h
    engines/titanic/game/pickup/pick_up_vis_centre.h
    engines/titanic/game/placeholder/bar_shelf_vis_centre.h
    engines/titanic/game/placeholder/lemon_on_bar.h
    engines/titanic/game/placeholder/place_holder_item.h
    engines/titanic/game/placeholder/tv_on_bar.h
    engines/titanic/game/play_music_button.h
    engines/titanic/game/play_on_act.h
    engines/titanic/game/port_hole.h
    engines/titanic/game/record_phonograph_button.h
    engines/titanic/game/replacement_ear.h
    engines/titanic/game/reserved_table.h
    engines/titanic/game/restaurant_cylinder_holder.h
    engines/titanic/game/restaurant_phonograph.h
    engines/titanic/game/sauce_dispensor.h
    engines/titanic/game/search_point.h
    engines/titanic/game/season_background.h
    engines/titanic/game/season_barrel.h
    engines/titanic/game/seasonal_adjustment.h
    engines/titanic/game/service_elevator_window.h
    engines/titanic/game/sgt/armchair.h
    engines/titanic/game/sgt/basin.h
    engines/titanic/game/sgt/bedfoot.h
    engines/titanic/game/sgt/bedhead.h
    engines/titanic/game/sgt/chest_of_drawers.h
    engines/titanic/game/sgt/desk.h
    engines/titanic/game/sgt/deskchair.h
    engines/titanic/game/sgt/drawer.h
    engines/titanic/game/sgt/sgt_doors.h
    engines/titanic/game/sgt/sgt_nav.h
    engines/titanic/game/sgt/sgt_navigation.h
    engines/titanic/game/sgt/sgt_restaurant_doors.h
    engines/titanic/game/sgt/sgt_state_control.h
    engines/titanic/game/sgt/sgt_state_room.h
    engines/titanic/game/sgt/sgt_tv.h
    engines/titanic/game/sgt/sgt_upper_doors_sound.h
    engines/titanic/game/sgt/toilet.h
    engines/titanic/game/sgt/vase.h
    engines/titanic/game/sgt/washstand.h
    engines/titanic/game/ship_setting.h
    engines/titanic/game/ship_setting_button.h
    engines/titanic/game/show_cell_points.h
    engines/titanic/game/speech_dispensor.h
    engines/titanic/game/splash_animation.h
    engines/titanic/game/starling_puret.h
    engines/titanic/game/start_action.h
    engines/titanic/game/stop_phonograph_button.h
    engines/titanic/game/sub_glass.h
    engines/titanic/game/sub_wrapper.h
    engines/titanic/game/sweet_bowl.h
    engines/titanic/game/television.h
    engines/titanic/game/third_class_canal.h
    engines/titanic/game/throw_tv_down_well.h
    engines/titanic/game/titania_still_control.h
    engines/titanic/game/tow_parrot_nav.h
    engines/titanic/game/transport/exit_pellerator.h
    engines/titanic/game/transport/gondolier.h
    engines/titanic/game/transport/lift.h
    engines/titanic/game/transport/lift_indicator.h
    engines/titanic/game/transport/pellerator.h
    engines/titanic/game/transport/service_elevator.h
    engines/titanic/game/transport/transport.h
    engines/titanic/game/up_lighter.h
    engines/titanic/game/useless_lever.h
    engines/titanic/game/volume_control.h
    engines/titanic/game/wheel_button.h
    engines/titanic/game/wheel_hotspot.h
    engines/titanic/game/wheel_spin.h
    engines/titanic/game/wheel_spin_horn.h
    engines/titanic/gfx/act_button.h
    engines/titanic/gfx/changes_season_button.h
    engines/titanic/gfx/chev_left_off.h
    engines/titanic/gfx/chev_left_on.h
    engines/titanic/gfx/chev_right_off.h
    engines/titanic/gfx/chev_right_on.h
    engines/titanic/gfx/chev_send_rec_switch.h
    engines/titanic/gfx/chev_switch.h
    engines/titanic/gfx/edit_control.h
    engines/titanic/gfx/elevator_button.h
    engines/titanic/gfx/get_from_succ.h
    engines/titanic/gfx/helmet_on_off.h
    engines/titanic/gfx/home_photo.h
    engines/titanic/gfx/icon_nav_action.h
    engines/titanic/gfx/icon_nav_butt.h
    engines/titanic/gfx/icon_nav_down.h
    engines/titanic/gfx/icon_nav_image.h
    engines/titanic/gfx/icon_nav_left.h
    engines/titanic/gfx/icon_nav_receive.h
    engines/titanic/gfx/icon_nav_right.h
    engines/titanic/gfx/icon_nav_send.h
    engines/titanic/gfx/icon_nav_up.h
    engines/titanic/gfx/keybrd_butt.h
    engines/titanic/gfx/move_object_button.h
    engines/titanic/gfx/music_control.h
    engines/titanic/gfx/music_slider.h
    engines/titanic/gfx/music_slider_pitch.h
    engines/titanic/gfx/music_slider_speed.h
    engines/titanic/gfx/music_switch.h
    engines/titanic/gfx/music_switch_inversion.h
    engines/titanic/gfx/music_switch_reverse.h
    engines/titanic/gfx/music_voice_mute.h
    engines/titanic/gfx/send_to_succ.h
    engines/titanic/gfx/sgt_selector.h
    engines/titanic/gfx/slider_button.h
    engines/titanic/gfx/small_chev_left_off.h
    engines/titanic/gfx/small_chev_left_on.h
    engines/titanic/gfx/small_chev_right_off.h
    engines/titanic/gfx/small_chev_right_on.h
    engines/titanic/gfx/st_button.h
    engines/titanic/gfx/status_change_button.h
    engines/titanic/gfx/text_down.h
    engines/titanic/gfx/text_skrew.h
    engines/titanic/gfx/text_up.h
    engines/titanic/gfx/toggle_button.h
    engines/titanic/gfx/toggle_switch.h
    engines/titanic/messages/auto_sound_event.h
    engines/titanic/messages/bilge_auto_sound_event.h
    engines/titanic/messages/bilge_dispensor_event.h
    engines/titanic/messages/door_auto_sound_event.h
    engines/titanic/messages/messages.h
    engines/titanic/messages/mouse_messages.h
    engines/titanic/messages/pet_messages.h
    engines/titanic/messages/service_elevator_door.h
    engines/titanic/moves/enter_bomb_room.h
    engines/titanic/moves/enter_bridge.h
    engines/titanic/moves/enter_exit_first_class_state.h
    engines/titanic/moves/enter_exit_mini_lift.h
    engines/titanic/moves/enter_exit_sec_class_mini_lift.h
    engines/titanic/moves/enter_exit_view.h
    engines/titanic/moves/enter_sec_class_state.h
    engines/titanic/moves/exit_arboretum.h
    engines/titanic/moves/exit_bridge.h
    engines/titanic/moves/exit_lift.h
    engines/titanic/moves/exit_pellerator.h
    engines/titanic/moves/exit_state_room.h
    engines/titanic/moves/exit_tiania.h
    engines/titanic/moves/move_player_in_parrot_room.h
    engines/titanic/moves/move_player_to.h
    engines/titanic/moves/move_player_to_from.h
    engines/titanic/moves/multi_move.h
    engines/titanic/moves/pan_from_pel.h
    engines/titanic/moves/restaurant_pan_handler.h
    engines/titanic/moves/restricted_move.h
    engines/titanic/moves/scraliontis_table.h
    engines/titanic/moves/trip_down_canal.h
    engines/titanic/npcs/barbot.h
    engines/titanic/npcs/bellbot.h
    engines/titanic/npcs/callbot.h
    engines/titanic/npcs/character.h
    engines/titanic/npcs/deskbot.h
    engines/titanic/npcs/doorbot.h
    engines/titanic/npcs/liftbot.h
    engines/titanic/npcs/maitre_d.h
    engines/titanic/npcs/mobile.h
    engines/titanic/npcs/parrot.h
    engines/titanic/npcs/robot_controller.h
    engines/titanic/npcs/starlings.h
    engines/titanic/npcs/succubus.h
    engines/titanic/npcs/summon_bots.h
    engines/titanic/npcs/titania.h
    engines/titanic/npcs/true_talk_npc.h
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_drag_chev.h
    engines/titanic/pet_control/pet_graphic.h
    engines/titanic/pet_control/pet_graphic2.h
    engines/titanic/pet_control/pet_leaf.h
    engines/titanic/pet_control/pet_mode_off.h
    engines/titanic/pet_control/pet_mode_on.h
    engines/titanic/pet_control/pet_mode_panel.h
    engines/titanic/pet_control/pet_pannel1.h
    engines/titanic/pet_control/pet_pannel2.h
    engines/titanic/pet_control/pet_pannel3.h
    engines/titanic/sound/auto_music_player.h
    engines/titanic/sound/auto_music_player_base.h
    engines/titanic/sound/auto_sound_player.h
    engines/titanic/sound/auto_sound_player_adsr.h
    engines/titanic/sound/background_sound_maker.h
    engines/titanic/sound/bird_song.h
    engines/titanic/sound/dome_from_top_of_well.h
    engines/titanic/sound/enter_view_toggles_other_music.h
    engines/titanic/sound/gondolier_song.h
    engines/titanic/sound/music_player.h
    engines/titanic/sound/node_auto_sound_player.h
    engines/titanic/sound/restricted_auto_music_player.h
    engines/titanic/sound/room_auto_sound_player.h
    engines/titanic/sound/room_trigger_auto_music_player.h
    engines/titanic/sound/season_noises.h
    engines/titanic/sound/seasonal_music_player.h
    engines/titanic/sound/titania_speech.h
    engines/titanic/sound/trigger_auto_music_player.h
    engines/titanic/sound/view_auto_sound_player.h
    engines/titanic/sound/view_toggles_other_music.h
    engines/titanic/sound/water_lapping_sounds.h
    engines/titanic/star_control/star_control.h
    engines/titanic/support/movie_clip.h
    engines/titanic/support/time_event_info.h



diff --git a/engines/titanic/carry/arm.h b/engines/titanic/carry/arm.h
index afef22b..48201ed 100644
--- a/engines/titanic/carry/arm.h
+++ b/engines/titanic/carry/arm.h
@@ -49,7 +49,7 @@ private:
 	int _field16C;
 	int _field170;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CArm();
 
 	/**
diff --git a/engines/titanic/carry/auditory_centre.h b/engines/titanic/carry/auditory_centre.h
index d4b9bee..743f8f2 100644
--- a/engines/titanic/carry/auditory_centre.h
+++ b/engines/titanic/carry/auditory_centre.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CAuditoryCentre : public CBrain {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/carry/bowl_ear.h b/engines/titanic/carry/bowl_ear.h
index 39d5dc9..4f2fbea 100644
--- a/engines/titanic/carry/bowl_ear.h
+++ b/engines/titanic/carry/bowl_ear.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CBowlEar : public CEar {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/carry/brain.h b/engines/titanic/carry/brain.h
index fd70a7e..5f76e7d 100644
--- a/engines/titanic/carry/brain.h
+++ b/engines/titanic/carry/brain.h
@@ -42,7 +42,7 @@ private:
 	int _field134;
 	int _field138;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBrain();
 
 	/**
diff --git a/engines/titanic/carry/bridge_piece.h b/engines/titanic/carry/bridge_piece.h
index 04bc7b9..01c44c0 100644
--- a/engines/titanic/carry/bridge_piece.h
+++ b/engines/titanic/carry/bridge_piece.h
@@ -36,7 +36,7 @@ private:
 	Point _pos3;
 	int _field140;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBridgePiece();
 
 	/**
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index 3658963..f4ea648 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -62,7 +62,7 @@ protected:
 	bool _enterFrameSet;
 	int _visibleFrame;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CCarry();
 
 	/**
diff --git a/engines/titanic/carry/carry_parrot.h b/engines/titanic/carry/carry_parrot.h
index 84c656c..70caee8 100644
--- a/engines/titanic/carry/carry_parrot.h
+++ b/engines/titanic/carry/carry_parrot.h
@@ -51,7 +51,7 @@ private:
 	int _field14C;
 	int _field150;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CCarryParrot();
 
 	/**
diff --git a/engines/titanic/carry/central_core.h b/engines/titanic/carry/central_core.h
index 852d2b6..9d7bef2 100644
--- a/engines/titanic/carry/central_core.h
+++ b/engines/titanic/carry/central_core.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CCentralCore : public CBrain {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/carry/chicken.h b/engines/titanic/carry/chicken.h
index e9e8f00..c78d4a0 100644
--- a/engines/titanic/carry/chicken.h
+++ b/engines/titanic/carry/chicken.h
@@ -49,7 +49,7 @@ public:
 	int _field13C;
 	int _timerId;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CChicken();
 
 	/**
diff --git a/engines/titanic/carry/crushed_tv.h b/engines/titanic/carry/crushed_tv.h
index d141589..ba6b52c 100644
--- a/engines/titanic/carry/crushed_tv.h
+++ b/engines/titanic/carry/crushed_tv.h
@@ -35,7 +35,7 @@ class CCrushedTV : public CCarry {
 	bool UseWithCharMsg(CUseWithCharMsg *msg);
 	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
 public:
-	CLASSDEF
+	CLASSDEF;
 	CCrushedTV();
 
 	/**
diff --git a/engines/titanic/carry/ear.h b/engines/titanic/carry/ear.h
index bdffdc2..edef873 100644
--- a/engines/titanic/carry/ear.h
+++ b/engines/titanic/carry/ear.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CEar : public CHeadPiece {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEar();
 
 	/**
diff --git a/engines/titanic/carry/eye.h b/engines/titanic/carry/eye.h
index 2531666..066a856 100644
--- a/engines/titanic/carry/eye.h
+++ b/engines/titanic/carry/eye.h
@@ -31,7 +31,7 @@ class CEye : public CHeadPiece {
 private:
 	int _eyeNum;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEye();
 
 	/**
diff --git a/engines/titanic/carry/feathers.h b/engines/titanic/carry/feathers.h
index e2c8ab7..4d193af 100644
--- a/engines/titanic/carry/feathers.h
+++ b/engines/titanic/carry/feathers.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CFeathers : public CCarry {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CFeathers();
 
 	/**
diff --git a/engines/titanic/carry/fruit.h b/engines/titanic/carry/fruit.h
index 595f27d..93fe920 100644
--- a/engines/titanic/carry/fruit.h
+++ b/engines/titanic/carry/fruit.h
@@ -34,7 +34,7 @@ private:
 	int _field134;
 	int _field138;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CFruit();
 
 	/**
diff --git a/engines/titanic/carry/glass.h b/engines/titanic/carry/glass.h
index 4e54015..9f4056b 100644
--- a/engines/titanic/carry/glass.h
+++ b/engines/titanic/carry/glass.h
@@ -31,7 +31,7 @@ class CGlass : public CCarry {
 private:
 	CString _string6;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CGlass();
 
 	/**
diff --git a/engines/titanic/carry/hammer.h b/engines/titanic/carry/hammer.h
index e35fdd1..a455d71 100644
--- a/engines/titanic/carry/hammer.h
+++ b/engines/titanic/carry/hammer.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CHammer : public CCarry {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CHammer();
 
 	/**
diff --git a/engines/titanic/carry/head_piece.h b/engines/titanic/carry/head_piece.h
index 1989b0e..05ac772 100644
--- a/engines/titanic/carry/head_piece.h
+++ b/engines/titanic/carry/head_piece.h
@@ -33,7 +33,7 @@ private:
 	CString _string6;
 	int _field13C;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CHeadPiece();
 
 	/**
diff --git a/engines/titanic/carry/hose.h b/engines/titanic/carry/hose.h
index d45fc08..ebd4586 100644
--- a/engines/titanic/carry/hose.h
+++ b/engines/titanic/carry/hose.h
@@ -38,7 +38,7 @@ protected:
 
 	CString _string6;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CHose();
 	static void init();
 	static void deinit();
diff --git a/engines/titanic/carry/hose_end.h b/engines/titanic/carry/hose_end.h
index 8a82ec5..6996d63 100644
--- a/engines/titanic/carry/hose_end.h
+++ b/engines/titanic/carry/hose_end.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CHoseEnd : public CHose {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CHoseEnd();
 
 	/**
diff --git a/engines/titanic/carry/key.h b/engines/titanic/carry/key.h
index 6b7a134..8f1600f 100644
--- a/engines/titanic/carry/key.h
+++ b/engines/titanic/carry/key.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CKey : public CCarry {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CKey();
 
 	/**
diff --git a/engines/titanic/carry/liftbot_head.h b/engines/titanic/carry/liftbot_head.h
index 9dc6250..2fcd6a7 100644
--- a/engines/titanic/carry/liftbot_head.h
+++ b/engines/titanic/carry/liftbot_head.h
@@ -31,7 +31,7 @@ class CLiftbotHead : public CCarry {
 private:
 	int _field12C;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CLiftbotHead();
 
 	/**
diff --git a/engines/titanic/carry/long_stick.h b/engines/titanic/carry/long_stick.h
index 60bff0d..2ff5b72 100644
--- a/engines/titanic/carry/long_stick.h
+++ b/engines/titanic/carry/long_stick.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CLongStick : public CCarry {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CLongStick();
 
 	/**
diff --git a/engines/titanic/carry/magazine.h b/engines/titanic/carry/magazine.h
index afe9598..69b9937 100644
--- a/engines/titanic/carry/magazine.h
+++ b/engines/titanic/carry/magazine.h
@@ -39,7 +39,7 @@ private:
 	int _field12C;
 	int _field130;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMagazine();
 
 	/**
diff --git a/engines/titanic/carry/maitred_left_arm.h b/engines/titanic/carry/maitred_left_arm.h
index e59d84e..8f5090b 100644
--- a/engines/titanic/carry/maitred_left_arm.h
+++ b/engines/titanic/carry/maitred_left_arm.h
@@ -31,7 +31,7 @@ class CMaitreDLeftArm : public CArm {
 private:
 	int _field174;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMaitreDLeftArm() : CArm(), _field174(0) {}
 
 	/**
diff --git a/engines/titanic/carry/maitred_right_arm.h b/engines/titanic/carry/maitred_right_arm.h
index f8a7861..ce07ed7 100644
--- a/engines/titanic/carry/maitred_right_arm.h
+++ b/engines/titanic/carry/maitred_right_arm.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CMaitreDRightArm : public CArm {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/carry/mouth.h b/engines/titanic/carry/mouth.h
index 0efaf73..e394330 100644
--- a/engines/titanic/carry/mouth.h
+++ b/engines/titanic/carry/mouth.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CMouth : public CHeadPiece {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMouth();
 
 	/**
diff --git a/engines/titanic/carry/napkin.h b/engines/titanic/carry/napkin.h
index b94a618..cec7a6b 100644
--- a/engines/titanic/carry/napkin.h
+++ b/engines/titanic/carry/napkin.h
@@ -32,7 +32,7 @@ class CNapkin : public CCarry {
 	DECLARE_MESSAGE_MAP
 	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
 public:
-	CLASSDEF
+	CLASSDEF;
 	CNapkin();
 
 	/**
diff --git a/engines/titanic/carry/nose.h b/engines/titanic/carry/nose.h
index 337617c..b688da2 100644
--- a/engines/titanic/carry/nose.h
+++ b/engines/titanic/carry/nose.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CNose : public CHeadPiece {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CNose();
 
 	/**
diff --git a/engines/titanic/carry/note.h b/engines/titanic/carry/note.h
index f0563f5..4edb202 100644
--- a/engines/titanic/carry/note.h
+++ b/engines/titanic/carry/note.h
@@ -35,7 +35,7 @@ private:
 	CString _string6;
 	int _field138;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CNote();
 
 	/**
diff --git a/engines/titanic/carry/parcel.h b/engines/titanic/carry/parcel.h
index 7209bd3..88282a6 100644
--- a/engines/titanic/carry/parcel.h
+++ b/engines/titanic/carry/parcel.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CParcel : public CCarry {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CParcel();
 
 	/**
diff --git a/engines/titanic/carry/perch.h b/engines/titanic/carry/perch.h
index ef04d11..d23868d 100644
--- a/engines/titanic/carry/perch.h
+++ b/engines/titanic/carry/perch.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CPerch : public CCentralCore {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/carry/phonograph_cylinder.h b/engines/titanic/carry/phonograph_cylinder.h
index 2f950d1..ba56bb3 100644
--- a/engines/titanic/carry/phonograph_cylinder.h
+++ b/engines/titanic/carry/phonograph_cylinder.h
@@ -57,7 +57,7 @@ private:
 	bool _bassInversionControl;
 	bool _bassDirectionControl;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPhonographCylinder();
 
 	/**
diff --git a/engines/titanic/carry/phonograph_ear.h b/engines/titanic/carry/phonograph_ear.h
index d450f28..582db9f 100644
--- a/engines/titanic/carry/phonograph_ear.h
+++ b/engines/titanic/carry/phonograph_ear.h
@@ -31,7 +31,7 @@ class CPhonographEar : public CEar {
 private:
 	int _field140;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPhonographEar() : CEar(), _field140(1) {}
 
 	/**
diff --git a/engines/titanic/carry/photograph.h b/engines/titanic/carry/photograph.h
index 3161e48..fcae07b 100644
--- a/engines/titanic/carry/photograph.h
+++ b/engines/titanic/carry/photograph.h
@@ -42,7 +42,7 @@ private:
 	int _field12C;
 	int _field130;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPhotograph();
 
 	/**
diff --git a/engines/titanic/carry/plug_in.h b/engines/titanic/carry/plug_in.h
index e788d15..9601dc1 100644
--- a/engines/titanic/carry/plug_in.h
+++ b/engines/titanic/carry/plug_in.h
@@ -33,7 +33,7 @@ class CPlugIn : public CCarry {
 private:
 	int _field12C;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPlugIn();
 
 	/**
diff --git a/engines/titanic/carry/speech_centre.h b/engines/titanic/carry/speech_centre.h
index e16556e..50f47e9 100644
--- a/engines/titanic/carry/speech_centre.h
+++ b/engines/titanic/carry/speech_centre.h
@@ -33,7 +33,7 @@ private:
 	CString _string1;
 	int _field14C;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSpeechCentre() : CBrain(), _string1("Summer"),
 		_field13C(1), _field14C(0) {}
 
diff --git a/engines/titanic/carry/sweets.h b/engines/titanic/carry/sweets.h
index 8eb0a16..ed59876 100644
--- a/engines/titanic/carry/sweets.h
+++ b/engines/titanic/carry/sweets.h
@@ -32,7 +32,7 @@ class CSweets : public CCarry {
 	DECLARE_MESSAGE_MAP
 	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSweets();
 
 	/**
diff --git a/engines/titanic/carry/test_carry.h b/engines/titanic/carry/test_carry.h
index b9591a7..75e8bb9 100644
--- a/engines/titanic/carry/test_carry.h
+++ b/engines/titanic/carry/test_carry.h
@@ -31,7 +31,7 @@ class CTestArray : public CGameObject {
 public:
 	int _value1, _value2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CTestArray() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
diff --git a/engines/titanic/carry/vision_centre.h b/engines/titanic/carry/vision_centre.h
index 6cf2d9d..6cf8e2c 100644
--- a/engines/titanic/carry/vision_centre.h
+++ b/engines/titanic/carry/vision_centre.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CVisionCentre : public CBrain {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/background.h b/engines/titanic/core/background.h
index ef9a6c3..004ab4d 100644
--- a/engines/titanic/core/background.h
+++ b/engines/titanic/core/background.h
@@ -40,7 +40,7 @@ protected:
 	CString _string2;
 	int _fieldDC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBackground();
 
 	/**
diff --git a/engines/titanic/core/click_responder.h b/engines/titanic/core/click_responder.h
index c682530..78381b9 100644
--- a/engines/titanic/core/click_responder.h
+++ b/engines/titanic/core/click_responder.h
@@ -31,7 +31,7 @@ class CClickResponder : public CGameObject {
 protected:
 	CString _string1, _string2;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/dont_save_file_item.h b/engines/titanic/core/dont_save_file_item.h
index 242e373..92425ae 100644
--- a/engines/titanic/core/dont_save_file_item.h
+++ b/engines/titanic/core/dont_save_file_item.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CDontSaveFileItem : public CFileItem {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/drop_target.h b/engines/titanic/core/drop_target.h
index 99734d7..4bd0ae4 100644
--- a/engines/titanic/core/drop_target.h
+++ b/engines/titanic/core/drop_target.h
@@ -44,7 +44,7 @@ private:
 	int _field110;
 	int _field114;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CDropTarget();
 
 	/**
diff --git a/engines/titanic/core/file_item.h b/engines/titanic/core/file_item.h
index 4210251..4b7c341 100644
--- a/engines/titanic/core/file_item.h
+++ b/engines/titanic/core/file_item.h
@@ -34,7 +34,7 @@ class CFileItem: public CTreeItem {
 private:
 	CString _filename;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index bde5e25..746ef45 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -504,7 +504,7 @@ public:
 	 */
 	static void deinit();
 public:
-	CLASSDEF
+	CLASSDEF;
 	CGameObject();
 	~CGameObject();
 
diff --git a/engines/titanic/core/game_object_desc_item.h b/engines/titanic/core/game_object_desc_item.h
index df9ef7b..7bfecaf 100644
--- a/engines/titanic/core/game_object_desc_item.h
+++ b/engines/titanic/core/game_object_desc_item.h
@@ -37,7 +37,7 @@ protected:
 	List<ListItem> _list2;
 	CMovieClipList _clipList;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CGameObjectDescItem();
 
 	/**
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index f194bc1..4b31680 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -50,7 +50,7 @@ public:
 	Rect _bounds;
 	CursorId _cursorId;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CLinkItem();
 
 	/**
diff --git a/engines/titanic/core/list.h b/engines/titanic/core/list.h
index eb87d7f..91a74ad 100644
--- a/engines/titanic/core/list.h
+++ b/engines/titanic/core/list.h
@@ -35,7 +35,7 @@ namespace Titanic {
  */
 class ListItem: public CSaveableObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/mail_man.h b/engines/titanic/core/mail_man.h
index 27a6cd1..4c63cdf 100644
--- a/engines/titanic/core/mail_man.h
+++ b/engines/titanic/core/mail_man.h
@@ -31,7 +31,7 @@ class CMailMan : public CGameObject {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMailMan() : CGameObject(), _value(1) {}
 
 	/**
diff --git a/engines/titanic/core/message_target.h b/engines/titanic/core/message_target.h
index cfd7ac1..05ceaad 100644
--- a/engines/titanic/core/message_target.h
+++ b/engines/titanic/core/message_target.h
@@ -86,7 +86,7 @@ protected: \
 class CMessageTarget: public CSaveableObject {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/multi_drop_target.h b/engines/titanic/core/multi_drop_target.h
index 22cc094..c004b9b 100644
--- a/engines/titanic/core/multi_drop_target.h
+++ b/engines/titanic/core/multi_drop_target.h
@@ -32,7 +32,7 @@ public:
 	CString _string5;
 	CString _string6;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMultiDropTarget() : CDropTarget(), _string5("1,2") {}
 
 	/**
diff --git a/engines/titanic/core/named_item.h b/engines/titanic/core/named_item.h
index 889a847..2ff34c7 100644
--- a/engines/titanic/core/named_item.h
+++ b/engines/titanic/core/named_item.h
@@ -36,7 +36,7 @@ class CNamedItem: public CTreeItem {
 public:
 	CString _name;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Dump the item
diff --git a/engines/titanic/core/node_item.h b/engines/titanic/core/node_item.h
index ff57448..f54e882 100644
--- a/engines/titanic/core/node_item.h
+++ b/engines/titanic/core/node_item.h
@@ -33,7 +33,7 @@ public:
 	int _nodeNumber;
 	Point _nodePos;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CNodeItem();
 
 	/**
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index 9270bdf..00c13e5 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -56,7 +56,7 @@ class CFileListItem : public ListItem {
 public:
 	CString _name;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
@@ -150,7 +150,7 @@ public:
 	 */
 	static bool readSavegameHeader(SimpleFile *file, TitanicSavegameHeader &header);
 public:
-	CLASSDEF
+	CLASSDEF;
 	CProjectItem();
 
 	/**
diff --git a/engines/titanic/core/resource_key.h b/engines/titanic/core/resource_key.h
index eb08334..27b23ed 100644
--- a/engines/titanic/core/resource_key.h
+++ b/engines/titanic/core/resource_key.h
@@ -35,7 +35,7 @@ private:
 
 	void setValue(const CString &name);
 public:
-	CLASSDEF
+	CLASSDEF;
 	CResourceKey() {}
 	CResourceKey(const CString &name) { setValue(name); }
 
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index bcdc95e..22d6e8b 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -46,7 +46,7 @@ public:
 	CResourceKey _exitMovieKey;
 	double _roomDimensionX, _roomDimensionY;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CRoomItem();
 
 	/**
diff --git a/engines/titanic/core/static_image.h b/engines/titanic/core/static_image.h
index 27f861e..16cae82 100644
--- a/engines/titanic/core/static_image.h
+++ b/engines/titanic/core/static_image.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CStaticImage : public CGameObject {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 3754bd4..85d0215 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -45,7 +45,7 @@ private:
 	CTreeItem *_firstChild;
 	int _field14;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CTreeItem();
 
 
diff --git a/engines/titanic/core/turn_on_object.h b/engines/titanic/core/turn_on_object.h
index 7150069..67cef9c 100644
--- a/engines/titanic/core/turn_on_object.h
+++ b/engines/titanic/core/turn_on_object.h
@@ -34,7 +34,7 @@ class CTurnOnObject : public CBackground {
 protected:
 	CString _msgName;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CTurnOnObject();
 
 	/**
diff --git a/engines/titanic/core/turn_on_play_sound.h b/engines/titanic/core/turn_on_play_sound.h
index 58d33ab..1164135 100644
--- a/engines/titanic/core/turn_on_play_sound.h
+++ b/engines/titanic/core/turn_on_play_sound.h
@@ -33,7 +33,7 @@ private:
 	int _fieldF8;
 	int _fieldFC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CTurnOnPlaySound();
 
 	/**
diff --git a/engines/titanic/core/turn_on_turn_off.h b/engines/titanic/core/turn_on_turn_off.h
index 2df8830..adca687 100644
--- a/engines/titanic/core/turn_on_turn_off.h
+++ b/engines/titanic/core/turn_on_turn_off.h
@@ -35,7 +35,7 @@ private:
 	int _fieldEC;
 	int _fieldF0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CTurnOnTurnOff();
 
 	/**
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index 4e25c00..227319f 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -59,7 +59,7 @@ protected:
 public:
 	int _viewNumber;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CViewItem();
 
 	/**
diff --git a/engines/titanic/game/announce.h b/engines/titanic/game/announce.h
index 3845d96..f960241 100644
--- a/engines/titanic/game/announce.h
+++ b/engines/titanic/game/announce.h
@@ -34,7 +34,7 @@ private:
 	int _fieldC4;
 	int _fieldC8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CAnnounce();
 
 	/**
diff --git a/engines/titanic/game/annoy_barbot.h b/engines/titanic/game/annoy_barbot.h
index e29c0c4..955a82b 100644
--- a/engines/titanic/game/annoy_barbot.h
+++ b/engines/titanic/game/annoy_barbot.h
@@ -31,7 +31,7 @@ class CAnnoyBarbot : public CGameObject {
 private:
 	static int _v1;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/arb_background.h b/engines/titanic/game/arb_background.h
index 4227667..b80c988 100644
--- a/engines/titanic/game/arb_background.h
+++ b/engines/titanic/game/arb_background.h
@@ -35,7 +35,7 @@ public:
 	int _fieldE8;
 	int _fieldEC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CArbBackground();
 
 	/**
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
index bd41dd1..7e07261 100644
--- a/engines/titanic/game/arboretum_gate.h
+++ b/engines/titanic/game/arboretum_gate.h
@@ -74,7 +74,7 @@ private:
 	int _field150;
 	CString _string2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CArboretumGate();
 
 	/**
diff --git a/engines/titanic/game/auto_animate.h b/engines/titanic/game/auto_animate.h
index fe70400..7bca808 100644
--- a/engines/titanic/game/auto_animate.h
+++ b/engines/titanic/game/auto_animate.h
@@ -35,7 +35,7 @@ private:
 	int _fieldE4;
 	int _fieldE8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CAutoAnimate() : CBackground(), _fieldE0(1), _fieldE4(1), _fieldE8(0) {}
 
 	/**
diff --git a/engines/titanic/game/bar_bell.h b/engines/titanic/game/bar_bell.h
index 9010012..5d1d2c5 100644
--- a/engines/titanic/game/bar_bell.h
+++ b/engines/titanic/game/bar_bell.h
@@ -37,7 +37,7 @@ public:
 	int _fieldC8;
 	int _fieldCC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBarBell();
 
 	/**
diff --git a/engines/titanic/game/bar_menu.h b/engines/titanic/game/bar_menu.h
index db3c937..84c0219 100644
--- a/engines/titanic/game/bar_menu.h
+++ b/engines/titanic/game/bar_menu.h
@@ -33,7 +33,7 @@ public:
 	int _fieldC0;
 	int _fieldC4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBarMenu();
 
 	/**
diff --git a/engines/titanic/game/bar_menu_button.h b/engines/titanic/game/bar_menu_button.h
index fe7d7d9..c666df4 100644
--- a/engines/titanic/game/bar_menu_button.h
+++ b/engines/titanic/game/bar_menu_button.h
@@ -31,7 +31,7 @@ class CBarMenuButton : public CGameObject {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBarMenuButton() : CGameObject(), _value(1) {}
 
 	/**
diff --git a/engines/titanic/game/belbot_get_light.h b/engines/titanic/game/belbot_get_light.h
index dd6f361..a3aa0f7 100644
--- a/engines/titanic/game/belbot_get_light.h
+++ b/engines/titanic/game/belbot_get_light.h
@@ -31,7 +31,7 @@ class CBelbotGetLight : public CGameObject {
 private:
 	CString _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/bilge_succubus.h b/engines/titanic/game/bilge_succubus.h
index 9546d00..4b2a626 100644
--- a/engines/titanic/game/bilge_succubus.h
+++ b/engines/titanic/game/bilge_succubus.h
@@ -34,7 +34,7 @@ public:
 	int _field1E4;
 	int _field1E8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBilgeSuccUBus();
 
 	/**
diff --git a/engines/titanic/game/bomb.h b/engines/titanic/game/bomb.h
index 59351db..ab4df16 100644
--- a/engines/titanic/game/bomb.h
+++ b/engines/titanic/game/bomb.h
@@ -42,7 +42,7 @@ private:
 	int _startingTicks;
 	int _field104;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBomb();
 
 	/**
diff --git a/engines/titanic/game/bottom_of_well_monitor.h b/engines/titanic/game/bottom_of_well_monitor.h
index cae02b9..65424aa 100644
--- a/engines/titanic/game/bottom_of_well_monitor.h
+++ b/engines/titanic/game/bottom_of_well_monitor.h
@@ -32,7 +32,7 @@ public:
 	static int _v1, _v2;
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBottomOfWellMonitor() : _value(1) {}
 
 	/**
diff --git a/engines/titanic/game/bowl_unlocker.h b/engines/titanic/game/bowl_unlocker.h
index 9ab9e63..2559ac2 100644
--- a/engines/titanic/game/bowl_unlocker.h
+++ b/engines/titanic/game/bowl_unlocker.h
@@ -31,7 +31,7 @@ class CBowlUnlocker : public CGameObject {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBowlUnlocker() : CGameObject(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/brain_slot.h b/engines/titanic/game/brain_slot.h
index f94ffc7..94b6d7f 100644
--- a/engines/titanic/game/brain_slot.h
+++ b/engines/titanic/game/brain_slot.h
@@ -34,7 +34,7 @@ public:
 	int _value1;
 	CString _value2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBrainSlot() : CGameObject(), _value1(0) {}
 
 	/**
diff --git a/engines/titanic/game/bridge_door.h b/engines/titanic/game/bridge_door.h
index f14d601..c1872a2 100644
--- a/engines/titanic/game/bridge_door.h
+++ b/engines/titanic/game/bridge_door.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CBridgeDoor : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/bridge_view.h b/engines/titanic/game/bridge_view.h
index be349f3..d7c7c35 100644
--- a/engines/titanic/game/bridge_view.h
+++ b/engines/titanic/game/bridge_view.h
@@ -31,7 +31,7 @@ class CBridgeView : public CBackground {
 public:
 	int _fieldE0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBridgeView() : CBackground(), _fieldE0(0) {}
 
 	/**
diff --git a/engines/titanic/game/broken_pell_base.h b/engines/titanic/game/broken_pell_base.h
index d3157fd..f62f04d 100644
--- a/engines/titanic/game/broken_pell_base.h
+++ b/engines/titanic/game/broken_pell_base.h
@@ -35,7 +35,7 @@ private:
 
 	int _fieldE0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBrokenPellBase() : CBackground(), _fieldE0(0) {}
 
 	/**
diff --git a/engines/titanic/game/broken_pellerator.h b/engines/titanic/game/broken_pellerator.h
index ebb31d5..6fbde91 100644
--- a/engines/titanic/game/broken_pellerator.h
+++ b/engines/titanic/game/broken_pellerator.h
@@ -34,7 +34,7 @@ private:
 	CString _string4;
 	CString _string5;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/broken_pellerator_froz.h b/engines/titanic/game/broken_pellerator_froz.h
index cc2ed31..1df6d2d 100644
--- a/engines/titanic/game/broken_pellerator_froz.h
+++ b/engines/titanic/game/broken_pellerator_froz.h
@@ -34,7 +34,7 @@ private:
 	CString _string4;
 	CString _string5;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/cage.h b/engines/titanic/game/cage.h
index 72de9fb..bbce978 100644
--- a/engines/titanic/game/cage.h
+++ b/engines/titanic/game/cage.h
@@ -32,7 +32,7 @@ public:
 	static int _v1;
 	static int _v2;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/call_pellerator.h b/engines/titanic/game/call_pellerator.h
index fc8110a..7da4b40 100644
--- a/engines/titanic/game/call_pellerator.h
+++ b/engines/titanic/game/call_pellerator.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CCallPellerator : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/captains_wheel.h b/engines/titanic/game/captains_wheel.h
index f817ee7..549dcbe 100644
--- a/engines/titanic/game/captains_wheel.h
+++ b/engines/titanic/game/captains_wheel.h
@@ -36,7 +36,7 @@ public:
 	int _fieldF0;
 	int _fieldF4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CCaptainsWheel();
 
 	/**
diff --git a/engines/titanic/game/cdrom.h b/engines/titanic/game/cdrom.h
index ece7242..9dcb270 100644
--- a/engines/titanic/game/cdrom.h
+++ b/engines/titanic/game/cdrom.h
@@ -38,7 +38,7 @@ class CCDROM : public CGameObject {
 private:
 	Point _tempPos;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CCDROM();
 
 	/**
diff --git a/engines/titanic/game/cdrom_computer.h b/engines/titanic/game/cdrom_computer.h
index da6e0e7..90b7b51 100644
--- a/engines/titanic/game/cdrom_computer.h
+++ b/engines/titanic/game/cdrom_computer.h
@@ -34,7 +34,7 @@ class CCDROMComputer : public CGameObject {
 private:
 	Rect _clickRect;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CCDROMComputer();
 
 	/**
diff --git a/engines/titanic/game/cdrom_tray.h b/engines/titanic/game/cdrom_tray.h
index c91e045..76c7a9a 100644
--- a/engines/titanic/game/cdrom_tray.h
+++ b/engines/titanic/game/cdrom_tray.h
@@ -37,7 +37,7 @@ public:
 	bool _isOpened;
 	CString _insertedCD;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CCDROMTray();
 
 	/**
diff --git a/engines/titanic/game/cell_point_button.h b/engines/titanic/game/cell_point_button.h
index 0a04350..6f1fdc3 100644
--- a/engines/titanic/game/cell_point_button.h
+++ b/engines/titanic/game/cell_point_button.h
@@ -43,7 +43,7 @@ public:
 	CString _string3;
 	int _field118;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CCellPointButton();
 
 	/**
diff --git a/engines/titanic/game/chev_code.h b/engines/titanic/game/chev_code.h
index df7421e..c4552d0 100644
--- a/engines/titanic/game/chev_code.h
+++ b/engines/titanic/game/chev_code.h
@@ -31,7 +31,7 @@ class CChevCode : public CGameObject {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CChevCode() : CGameObject(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/chev_panel.h b/engines/titanic/game/chev_panel.h
index e53a94e..99b5501 100644
--- a/engines/titanic/game/chev_panel.h
+++ b/engines/titanic/game/chev_panel.h
@@ -33,7 +33,7 @@ public:
 	int _fieldC0;
 	int _fieldC4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CChevPanel() : _fieldBC(0), _fieldC0(0), _fieldC4(0) {}
 
 	/**
diff --git a/engines/titanic/game/chicken_cooler.h b/engines/titanic/game/chicken_cooler.h
index b735b0f..724727b 100644
--- a/engines/titanic/game/chicken_cooler.h
+++ b/engines/titanic/game/chicken_cooler.h
@@ -34,7 +34,7 @@ private:
 	int _fieldBC;
 	int _fieldC0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CChickenCooler() : CGameObject(), _fieldBC(0), _fieldC0(0) {}
 
 	/**
diff --git a/engines/titanic/game/chicken_dispensor.h b/engines/titanic/game/chicken_dispensor.h
index 21163c6..d86b850 100644
--- a/engines/titanic/game/chicken_dispensor.h
+++ b/engines/titanic/game/chicken_dispensor.h
@@ -33,7 +33,7 @@ public:
 	int _fieldE4;
 	int _fieldE8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CChickenDispensor();
 
 	/**
diff --git a/engines/titanic/game/close_broken_pel.h b/engines/titanic/game/close_broken_pel.h
index 252d089..aacda6c 100644
--- a/engines/titanic/game/close_broken_pel.h
+++ b/engines/titanic/game/close_broken_pel.h
@@ -31,7 +31,7 @@ class CCloseBrokenPel : public CBackground {
 public:
 	CString _string3;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/code_wheel.h b/engines/titanic/game/code_wheel.h
index 1776ad6..63af97c 100644
--- a/engines/titanic/game/code_wheel.h
+++ b/engines/titanic/game/code_wheel.h
@@ -33,7 +33,7 @@ private:
 	int _field10C;
 	int _field110;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CodeWheel();
 
 	/**
diff --git a/engines/titanic/game/computer.h b/engines/titanic/game/computer.h
index e9716aa..f64f723 100644
--- a/engines/titanic/game/computer.h
+++ b/engines/titanic/game/computer.h
@@ -36,7 +36,7 @@ public:
 	CString _currentCD;
 	int _state;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CComputer() : CBackground(), _currentCD("None"), _state(0) {}
 
 	/**
diff --git a/engines/titanic/game/computer_screen.h b/engines/titanic/game/computer_screen.h
index 032c724..1aed01c 100644
--- a/engines/titanic/game/computer_screen.h
+++ b/engines/titanic/game/computer_screen.h
@@ -34,7 +34,7 @@ class CComputerScreen : public CGameObject {
 	bool EnterViewMsg(CEnterViewMsg *msg);
 	bool TimerMsg(CTimerMsg *msg);
 public:
-	CLASSDEF
+	CLASSDEF;
 	CComputerScreen();
 
 	/**
diff --git a/engines/titanic/game/cookie.h b/engines/titanic/game/cookie.h
index 72b29dc..7ae04f1 100644
--- a/engines/titanic/game/cookie.h
+++ b/engines/titanic/game/cookie.h
@@ -32,7 +32,7 @@ public:
 	int _value1;
 	int _value2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CCookie() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
diff --git a/engines/titanic/game/credits.h b/engines/titanic/game/credits.h
index 5b3fe29..fa9794b 100644
--- a/engines/titanic/game/credits.h
+++ b/engines/titanic/game/credits.h
@@ -31,7 +31,7 @@ class CCredits : public CGameObject {
 public:
 	int _fieldBC, _fieldC0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CCredits();
 
 	/**
diff --git a/engines/titanic/game/credits_button.h b/engines/titanic/game/credits_button.h
index 74fcdc0..5e0bf96 100644
--- a/engines/titanic/game/credits_button.h
+++ b/engines/titanic/game/credits_button.h
@@ -31,7 +31,7 @@ class CCreditsButton : public CBackground {
 public:
 	int _fieldE0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CCreditsButton();
 
 	/**
diff --git a/engines/titanic/game/dead_area.h b/engines/titanic/game/dead_area.h
index 8bffed7..05a3f4e 100644
--- a/engines/titanic/game/dead_area.h
+++ b/engines/titanic/game/dead_area.h
@@ -36,7 +36,7 @@ class CDeadArea : public CGameObject {
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return true; }
 	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) { return true; }
 public:
-	CLASSDEF
+	CLASSDEF;
 	CDeadArea();
 
 	/**
diff --git a/engines/titanic/game/desk_click_responder.h b/engines/titanic/game/desk_click_responder.h
index 3967b68..12825ba 100644
--- a/engines/titanic/game/desk_click_responder.h
+++ b/engines/titanic/game/desk_click_responder.h
@@ -32,7 +32,7 @@ protected:
 	int _fieldD4;
 	int _fieldD8;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/doorbot_elevator_handler.h b/engines/titanic/game/doorbot_elevator_handler.h
index 57722c5..7b39e72 100644
--- a/engines/titanic/game/doorbot_elevator_handler.h
+++ b/engines/titanic/game/doorbot_elevator_handler.h
@@ -34,7 +34,7 @@ private:
 	static int _v1;
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/doorbot_home_handler.h b/engines/titanic/game/doorbot_home_handler.h
index 66cec70..99ba6d3 100644
--- a/engines/titanic/game/doorbot_home_handler.h
+++ b/engines/titanic/game/doorbot_home_handler.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CDoorbotHomeHandler : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CDoorbotHomeHandler();
 
 	/**
diff --git a/engines/titanic/game/ear_sweet_bowl.h b/engines/titanic/game/ear_sweet_bowl.h
index a5386d4..3f41950 100644
--- a/engines/titanic/game/ear_sweet_bowl.h
+++ b/engines/titanic/game/ear_sweet_bowl.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CEarSweetBowl : public CSweetBowl {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/eject_phonograph_button.h b/engines/titanic/game/eject_phonograph_button.h
index 670670b..5f5da80 100644
--- a/engines/titanic/game/eject_phonograph_button.h
+++ b/engines/titanic/game/eject_phonograph_button.h
@@ -34,7 +34,7 @@ public:
 	CString _string3;
 	CString _string4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEjectPhonographButton() : CBackground(), _fieldE0(0), _fieldE4(0) {}
 
 	/**
diff --git a/engines/titanic/game/elevator_action_area.h b/engines/titanic/game/elevator_action_area.h
index 361f19a..6c756fb 100644
--- a/engines/titanic/game/elevator_action_area.h
+++ b/engines/titanic/game/elevator_action_area.h
@@ -31,7 +31,7 @@ class CElevatorActionArea : public CGameObject {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CElevatorActionArea() : CGameObject(), _value(4) {}
 
 	/**
diff --git a/engines/titanic/game/emma_control.h b/engines/titanic/game/emma_control.h
index 654d3c5..721660f 100644
--- a/engines/titanic/game/emma_control.h
+++ b/engines/titanic/game/emma_control.h
@@ -33,7 +33,7 @@ private:
 
 	CString _wavFile1, _wavFile2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEmmaControl() : CBackground(), _wavFile1("b#39.wav"), _wavFile2("b#38.wav") {}
 
 	/**
diff --git a/engines/titanic/game/empty_nut_bowl.h b/engines/titanic/game/empty_nut_bowl.h
index 31f31e2..112e2c6 100644
--- a/engines/titanic/game/empty_nut_bowl.h
+++ b/engines/titanic/game/empty_nut_bowl.h
@@ -31,7 +31,7 @@ class CEmptyNutBowl : public CGameObject {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEmptyNutBowl() : CGameObject(), _value(1) {}
 
 	/**
diff --git a/engines/titanic/game/end_credit_text.h b/engines/titanic/game/end_credit_text.h
index 137e510..54c6c7f 100644
--- a/engines/titanic/game/end_credit_text.h
+++ b/engines/titanic/game/end_credit_text.h
@@ -31,7 +31,7 @@ class CEndCreditText : public CGameObject {
 private:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEndCreditText() : CGameObject(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/end_credits.h b/engines/titanic/game/end_credits.h
index 9aad297..d160bc9 100644
--- a/engines/titanic/game/end_credits.h
+++ b/engines/titanic/game/end_credits.h
@@ -31,7 +31,7 @@ class CEndCredits : public CGameObject {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEndCredits() : CGameObject(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/end_explode_ship.h b/engines/titanic/game/end_explode_ship.h
index 48bbeca..b8159d3 100644
--- a/engines/titanic/game/end_explode_ship.h
+++ b/engines/titanic/game/end_explode_ship.h
@@ -31,7 +31,7 @@ class CEndExplodeShip : public CGameObject {
 public:
 	int _value1, _value2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEndExplodeShip() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
diff --git a/engines/titanic/game/end_game_credits.h b/engines/titanic/game/end_game_credits.h
index 5eee5fc..5962950 100644
--- a/engines/titanic/game/end_game_credits.h
+++ b/engines/titanic/game/end_game_credits.h
@@ -32,7 +32,7 @@ private:
 	int _fieldBC;
 	Point _pos1;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEndGameCredits();
 
 	/**
diff --git a/engines/titanic/game/end_sequence_control.h b/engines/titanic/game/end_sequence_control.h
index 0a9d6f0..35e9a93 100644
--- a/engines/titanic/game/end_sequence_control.h
+++ b/engines/titanic/game/end_sequence_control.h
@@ -31,7 +31,7 @@ namespace Titanic {
 class CEndSequenceControl : public CGameObject {
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/fan.h b/engines/titanic/game/fan.h
index d3cf527..2c5a241 100644
--- a/engines/titanic/game/fan.h
+++ b/engines/titanic/game/fan.h
@@ -31,7 +31,7 @@ class CFan : public CGameObject {
 public:
 	int _value1, _value2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CFan() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
diff --git a/engines/titanic/game/fan_control.h b/engines/titanic/game/fan_control.h
index 14b56db..4d89adb 100644
--- a/engines/titanic/game/fan_control.h
+++ b/engines/titanic/game/fan_control.h
@@ -35,7 +35,7 @@ public:
 	int _fieldC8;
 	int _fieldCC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CFanControl();
 
 	/**
diff --git a/engines/titanic/game/fan_decrease.h b/engines/titanic/game/fan_decrease.h
index 7d0c4a3..765c7d1 100644
--- a/engines/titanic/game/fan_decrease.h
+++ b/engines/titanic/game/fan_decrease.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CFanDecrease : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/fan_increase.h b/engines/titanic/game/fan_increase.h
index e81ff46..08ec132 100644
--- a/engines/titanic/game/fan_increase.h
+++ b/engines/titanic/game/fan_increase.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CFanIncrease : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/fan_noises.h b/engines/titanic/game/fan_noises.h
index f187853..bb2c359 100644
--- a/engines/titanic/game/fan_noises.h
+++ b/engines/titanic/game/fan_noises.h
@@ -39,7 +39,7 @@ private:
 	int _fieldD0;
 	int _fieldD4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CFanNoises();
 
 	/**
diff --git a/engines/titanic/game/floor_indicator.h b/engines/titanic/game/floor_indicator.h
index ccd6a8b..066209e 100644
--- a/engines/titanic/game/floor_indicator.h
+++ b/engines/titanic/game/floor_indicator.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CFloorIndicator : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/games_console.h b/engines/titanic/game/games_console.h
index 8d37186..2b1da70 100644
--- a/engines/titanic/game/games_console.h
+++ b/engines/titanic/game/games_console.h
@@ -31,7 +31,7 @@ class CGamesConsole : public CBackground {
 public:
 	int _fieldE0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CGamesConsole() : CBackground(), _fieldE0(0) {}
 
 	/**
diff --git a/engines/titanic/game/get_lift_eye2.h b/engines/titanic/game/get_lift_eye2.h
index 7a3caa1..496784a 100644
--- a/engines/titanic/game/get_lift_eye2.h
+++ b/engines/titanic/game/get_lift_eye2.h
@@ -32,7 +32,7 @@ class CGetLiftEye2 : public CGameObject {
 public:
 	static CString *_v1;
 public:
-	CLASSDEF
+	CLASSDEF;
 	static void init();
 	static void deinit();
 
diff --git a/engines/titanic/game/glass_smasher.h b/engines/titanic/game/glass_smasher.h
index 1c4e703..7e38f4e 100644
--- a/engines/titanic/game/glass_smasher.h
+++ b/engines/titanic/game/glass_smasher.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CGlassSmasher : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/gondolier/gondolier_base.h b/engines/titanic/game/gondolier/gondolier_base.h
index e5efaf8..a7ea2d4 100644
--- a/engines/titanic/game/gondolier/gondolier_base.h
+++ b/engines/titanic/game/gondolier/gondolier_base.h
@@ -40,7 +40,7 @@ private:
 	static int _v9;
 	static int _v10;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/gondolier/gondolier_chest.h b/engines/titanic/game/gondolier/gondolier_chest.h
index 55e5a2b..d796917 100644
--- a/engines/titanic/game/gondolier/gondolier_chest.h
+++ b/engines/titanic/game/gondolier/gondolier_chest.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CGondolierChest : public CGondolierBase {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/gondolier/gondolier_face.h b/engines/titanic/game/gondolier/gondolier_face.h
index 03e221e..71bdd6d 100644
--- a/engines/titanic/game/gondolier/gondolier_face.h
+++ b/engines/titanic/game/gondolier/gondolier_face.h
@@ -31,7 +31,7 @@ class CGondolierFace : public CGondolierBase {
 private:
 	int _fieldBC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CGondolierFace() : CGondolierBase(), _fieldBC(0) {}
 
 	/**
diff --git a/engines/titanic/game/gondolier/gondolier_mixer.h b/engines/titanic/game/gondolier/gondolier_mixer.h
index 0276de1..247e520 100644
--- a/engines/titanic/game/gondolier/gondolier_mixer.h
+++ b/engines/titanic/game/gondolier/gondolier_mixer.h
@@ -39,7 +39,7 @@ private:
 	CString _string2;
 	int _fieldE4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CGondolierMixer();
 
 	/**
diff --git a/engines/titanic/game/gondolier/gondolier_slider.h b/engines/titanic/game/gondolier/gondolier_slider.h
index c5fd08f..0ae14a9 100644
--- a/engines/titanic/game/gondolier/gondolier_slider.h
+++ b/engines/titanic/game/gondolier/gondolier_slider.h
@@ -48,7 +48,7 @@ private:
 	CString _string3;
 	int _field118;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CGondolierSlider();
 
 	/**
diff --git a/engines/titanic/game/hammer_clip.h b/engines/titanic/game/hammer_clip.h
index 01f419c..7f5c5ab 100644
--- a/engines/titanic/game/hammer_clip.h
+++ b/engines/titanic/game/hammer_clip.h
@@ -31,7 +31,7 @@ class CHammerClip : public CGameObject {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CHammerClip() : CGameObject(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/hammer_dispensor.h b/engines/titanic/game/hammer_dispensor.h
index 9a58850..e1b30d9 100644
--- a/engines/titanic/game/hammer_dispensor.h
+++ b/engines/titanic/game/hammer_dispensor.h
@@ -33,7 +33,7 @@ private:
 	int _fieldE4;
 	int _fieldE8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CHammerDispensor();
 
 	/**
diff --git a/engines/titanic/game/hammer_dispensor_button.h b/engines/titanic/game/hammer_dispensor_button.h
index 5b91bbd..36732ad 100644
--- a/engines/titanic/game/hammer_dispensor_button.h
+++ b/engines/titanic/game/hammer_dispensor_button.h
@@ -37,7 +37,7 @@ private:
 	int _field10C;
 	int _field110;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CHammerDispensorButton();
 
 	/**
diff --git a/engines/titanic/game/head_slot.h b/engines/titanic/game/head_slot.h
index b097947..0080411 100644
--- a/engines/titanic/game/head_slot.h
+++ b/engines/titanic/game/head_slot.h
@@ -41,7 +41,7 @@ public:
 	int _fieldE8;
 	int _fieldEC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CHeadSlot();
 
 	/**
diff --git a/engines/titanic/game/head_smash_event.h b/engines/titanic/game/head_smash_event.h
index 9e21080..912cf36 100644
--- a/engines/titanic/game/head_smash_event.h
+++ b/engines/titanic/game/head_smash_event.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CHeadSmashEvent : public CBackground {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/head_smash_lever.h b/engines/titanic/game/head_smash_lever.h
index a35a18c..b8f04d3 100644
--- a/engines/titanic/game/head_smash_lever.h
+++ b/engines/titanic/game/head_smash_lever.h
@@ -33,7 +33,7 @@ public:
 	int _fieldE4;
 	int _fieldE8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CHeadSmashLever();
 
 	/**
diff --git a/engines/titanic/game/head_spinner.h b/engines/titanic/game/head_spinner.h
index 8f1f8c2..4456070 100644
--- a/engines/titanic/game/head_spinner.h
+++ b/engines/titanic/game/head_spinner.h
@@ -32,7 +32,7 @@ public:
 	int _value1, _value2;
 public:
 	CHeadSpinner() : CGameObject(), _value1(0), _value2(0) {}
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/idle_summoner.h b/engines/titanic/game/idle_summoner.h
index ccee7bc..1d9fcdd 100644
--- a/engines/titanic/game/idle_summoner.h
+++ b/engines/titanic/game/idle_summoner.h
@@ -40,7 +40,7 @@ public:
 	int _fieldDC;
 public:
 	CIdleSummoner();
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/leave_sec_class_state.h b/engines/titanic/game/leave_sec_class_state.h
index fe55b94..67300b6 100644
--- a/engines/titanic/game/leave_sec_class_state.h
+++ b/engines/titanic/game/leave_sec_class_state.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CLeaveSecClassState : public CGameObject {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/lemon_dispensor.h b/engines/titanic/game/lemon_dispensor.h
index fe5ab52..d6315ed 100644
--- a/engines/titanic/game/lemon_dispensor.h
+++ b/engines/titanic/game/lemon_dispensor.h
@@ -38,7 +38,7 @@ private:
 	int _fieldE8;
 	int _fieldEC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CLemonDispensor();
 
 	/**
diff --git a/engines/titanic/game/light.h b/engines/titanic/game/light.h
index b919c5f..79e4bc4 100644
--- a/engines/titanic/game/light.h
+++ b/engines/titanic/game/light.h
@@ -40,7 +40,7 @@ private:
 	int _fieldF8;
 	int _fieldFC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CLight();
 
 	/**
diff --git a/engines/titanic/game/light_switch.h b/engines/titanic/game/light_switch.h
index c8728e0..ce62d7d 100644
--- a/engines/titanic/game/light_switch.h
+++ b/engines/titanic/game/light_switch.h
@@ -37,7 +37,7 @@ private:
 	int _fieldE4;
 	int _fieldE8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CLightSwitch();
 
 	/**
diff --git a/engines/titanic/game/little_lift_button.h b/engines/titanic/game/little_lift_button.h
index 451c6ce..b14651f 100644
--- a/engines/titanic/game/little_lift_button.h
+++ b/engines/titanic/game/little_lift_button.h
@@ -31,7 +31,7 @@ class CLittleLiftButton : public CBackground {
 private:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CLittleLiftButton() : CBackground(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/long_stick_dispenser.h b/engines/titanic/game/long_stick_dispenser.h
index 6306686..2a1b86f 100644
--- a/engines/titanic/game/long_stick_dispenser.h
+++ b/engines/titanic/game/long_stick_dispenser.h
@@ -35,7 +35,7 @@ private:
 	int _fieldC0;
 	int _fieldC4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CLongStickDispenser() : CGameObject(), _fieldBC(0),
 		_fieldC0(0), _fieldC4(1) {}
 
diff --git a/engines/titanic/game/maitred/maitred_arm_holder.h b/engines/titanic/game/maitred/maitred_arm_holder.h
index c823bd9..3392d60 100644
--- a/engines/titanic/game/maitred/maitred_arm_holder.h
+++ b/engines/titanic/game/maitred/maitred_arm_holder.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CMaitreDArmHolder : public CDropTarget {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/maitred/maitred_body.h b/engines/titanic/game/maitred/maitred_body.h
index 52e2ac8..7016c15 100644
--- a/engines/titanic/game/maitred/maitred_body.h
+++ b/engines/titanic/game/maitred/maitred_body.h
@@ -31,7 +31,7 @@ class CMaitreDBody : public CMaitreDProdReceptor {
 private:
 	int _fieldC8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMaitreDBody() : CMaitreDProdReceptor(), _fieldC8(1) {}
 
 	/**
diff --git a/engines/titanic/game/maitred/maitred_legs.h b/engines/titanic/game/maitred/maitred_legs.h
index 5ee9482..24ba01e 100644
--- a/engines/titanic/game/maitred/maitred_legs.h
+++ b/engines/titanic/game/maitred/maitred_legs.h
@@ -31,7 +31,7 @@ class CMaitreDLegs : public CMaitreDProdReceptor {
 private:
 	int _fieldC8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMaitreDLegs() : CMaitreDProdReceptor(), _fieldC8(1) {}
 
 	/**
diff --git a/engines/titanic/game/maitred/maitred_prod_receptor.h b/engines/titanic/game/maitred/maitred_prod_receptor.h
index 5138d46..f3a547b 100644
--- a/engines/titanic/game/maitred/maitred_prod_receptor.h
+++ b/engines/titanic/game/maitred/maitred_prod_receptor.h
@@ -33,7 +33,7 @@ protected:
 	int _fieldC0;
 	int _fieldC4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMaitreDProdReceptor() : CGameObject(),
 		_fieldBC(0), _fieldC0(0), _fieldC4(1) {}
 
diff --git a/engines/titanic/game/missiveomat.h b/engines/titanic/game/missiveomat.h
index 1b7850f..7fde8cf 100644
--- a/engines/titanic/game/missiveomat.h
+++ b/engines/titanic/game/missiveomat.h
@@ -36,7 +36,7 @@ public:
 	CString _string2;
 	int _fieldE0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMissiveOMat();
 
 	/**
diff --git a/engines/titanic/game/missiveomat_button.h b/engines/titanic/game/missiveomat_button.h
index eb00b7e..d36f5bd 100644
--- a/engines/titanic/game/missiveomat_button.h
+++ b/engines/titanic/game/missiveomat_button.h
@@ -31,7 +31,7 @@ class CMissiveOMatButton : public CEditControl {
 public:
 	int _fieldFC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMissiveOMatButton() : CEditControl(), _fieldFC(2) {}
 
 	/**
diff --git a/engines/titanic/game/movie_tester.h b/engines/titanic/game/movie_tester.h
index cf39ae3..de2ef2c 100644
--- a/engines/titanic/game/movie_tester.h
+++ b/engines/titanic/game/movie_tester.h
@@ -31,7 +31,7 @@ class CMovieTester : public CGameObject {
 public:
 	int _value1, _value2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMovieTester() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
diff --git a/engines/titanic/game/music_console_button.h b/engines/titanic/game/music_console_button.h
index 1a1861b..8e05b69 100644
--- a/engines/titanic/game/music_console_button.h
+++ b/engines/titanic/game/music_console_button.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CMusicConsoleButton : public CMusicPlayer {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/music_room_phonograph.h b/engines/titanic/game/music_room_phonograph.h
index dcc7267..58afe7f 100644
--- a/engines/titanic/game/music_room_phonograph.h
+++ b/engines/titanic/game/music_room_phonograph.h
@@ -32,7 +32,7 @@ class CMusicRoomPhonograph : public CRestaurantPhonograph {
 private:
 	int _field118;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMusicRoomPhonograph() : CRestaurantPhonograph(), _field118(0) {}
 
 	/**
diff --git a/engines/titanic/game/music_room_stop_phonograph_button.h b/engines/titanic/game/music_room_stop_phonograph_button.h
index 81cd755..7260e5a 100644
--- a/engines/titanic/game/music_room_stop_phonograph_button.h
+++ b/engines/titanic/game/music_room_stop_phonograph_button.h
@@ -31,7 +31,7 @@ class CMusicRoomStopPhonographButton : public CEjectPhonographButton {
 private:
 	int _field100;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMusicRoomStopPhonographButton() : CEjectPhonographButton(), _field100(0) {}
 
 	/**
diff --git a/engines/titanic/game/music_system_lock.h b/engines/titanic/game/music_system_lock.h
index ad722ca..ff826f5 100644
--- a/engines/titanic/game/music_system_lock.h
+++ b/engines/titanic/game/music_system_lock.h
@@ -31,7 +31,7 @@ class CMusicSystemLock : public CDropTarget {
 private:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMusicSystemLock() : CDropTarget(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/musical_instrument.h b/engines/titanic/game/musical_instrument.h
index 273770c..8b53460 100644
--- a/engines/titanic/game/musical_instrument.h
+++ b/engines/titanic/game/musical_instrument.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CMusicalInstrument : public CBackground {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/nav_helmet.h b/engines/titanic/game/nav_helmet.h
index 5e17622..74caa52 100644
--- a/engines/titanic/game/nav_helmet.h
+++ b/engines/titanic/game/nav_helmet.h
@@ -31,7 +31,7 @@ class CNavHelmet : public CGameObject {
 private:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CNavHelmet() : CGameObject(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/navigation_computer.h b/engines/titanic/game/navigation_computer.h
index f24cbad..6de7543 100644
--- a/engines/titanic/game/navigation_computer.h
+++ b/engines/titanic/game/navigation_computer.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CNavigationComputer : public CGameObject {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/no_nut_bowl.h b/engines/titanic/game/no_nut_bowl.h
index 5cb3aa2..548b324 100644
--- a/engines/titanic/game/no_nut_bowl.h
+++ b/engines/titanic/game/no_nut_bowl.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CNoNutBowl : public CBackground {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/nose_holder.h b/engines/titanic/game/nose_holder.h
index 6e25835..b8cca95 100644
--- a/engines/titanic/game/nose_holder.h
+++ b/engines/titanic/game/nose_holder.h
@@ -32,7 +32,7 @@ private:
 	int _field118;
 	int _field11C;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CNoseHolder();
 
 	/**
diff --git a/engines/titanic/game/null_port_hole.h b/engines/titanic/game/null_port_hole.h
index 3170a84..2924aff 100644
--- a/engines/titanic/game/null_port_hole.h
+++ b/engines/titanic/game/null_port_hole.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CNullPortHole : public CClickResponder {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CNullPortHole();
 
 	/**
diff --git a/engines/titanic/game/nut_replacer.h b/engines/titanic/game/nut_replacer.h
index 6a8e014..ead9713 100644
--- a/engines/titanic/game/nut_replacer.h
+++ b/engines/titanic/game/nut_replacer.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CNutReplacer : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/parrot/parrot_lobby_controller.h b/engines/titanic/game/parrot/parrot_lobby_controller.h
index 9f5ddca..d2fa4a1 100644
--- a/engines/titanic/game/parrot/parrot_lobby_controller.h
+++ b/engines/titanic/game/parrot/parrot_lobby_controller.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CParrotLobbyController : public CParrotLobbyObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/parrot/parrot_lobby_link_updater.h b/engines/titanic/game/parrot/parrot_lobby_link_updater.h
index a433f0b..0470a62 100644
--- a/engines/titanic/game/parrot/parrot_lobby_link_updater.h
+++ b/engines/titanic/game/parrot/parrot_lobby_link_updater.h
@@ -31,7 +31,7 @@ class CParrotLobbyLinkUpdater : public CParrotLobbyObject {
 public:
 	int _fieldBC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CParrotLobbyLinkUpdater() : CParrotLobbyObject(), _fieldBC(1) {}
 
 	/**
diff --git a/engines/titanic/game/parrot/parrot_lobby_object.h b/engines/titanic/game/parrot/parrot_lobby_object.h
index 967ad23..dfb6592 100644
--- a/engines/titanic/game/parrot/parrot_lobby_object.h
+++ b/engines/titanic/game/parrot/parrot_lobby_object.h
@@ -37,7 +37,7 @@ public:
 
 	static void init();
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/parrot/parrot_lobby_view_object.h b/engines/titanic/game/parrot/parrot_lobby_view_object.h
index 656924f..3179bb9 100644
--- a/engines/titanic/game/parrot/parrot_lobby_view_object.h
+++ b/engines/titanic/game/parrot/parrot_lobby_view_object.h
@@ -31,7 +31,7 @@ class CParrotLobbyViewObject : public CParrotLobbyObject {
 public:
 	int _fieldBC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CParrotLobbyViewObject() : CParrotLobbyObject(), _fieldBC(1) {}
 
 	/**
diff --git a/engines/titanic/game/parrot/parrot_loser.h b/engines/titanic/game/parrot/parrot_loser.h
index c1e6c9f..819fd66 100644
--- a/engines/titanic/game/parrot/parrot_loser.h
+++ b/engines/titanic/game/parrot/parrot_loser.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CParrotLoser : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/parrot/parrot_nut_bowl_actor.h b/engines/titanic/game/parrot/parrot_nut_bowl_actor.h
index 34be83a..d8395bb 100644
--- a/engines/titanic/game/parrot/parrot_nut_bowl_actor.h
+++ b/engines/titanic/game/parrot/parrot_nut_bowl_actor.h
@@ -31,7 +31,7 @@ class CParrotNutBowlActor : public CGameObject {
 public:
 	int _value1, _value2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CParrotNutBowlActor();
 
 	/**
diff --git a/engines/titanic/game/parrot/parrot_nut_eater.h b/engines/titanic/game/parrot/parrot_nut_eater.h
index fe0a3ae..5dcb01c 100644
--- a/engines/titanic/game/parrot/parrot_nut_eater.h
+++ b/engines/titanic/game/parrot/parrot_nut_eater.h
@@ -35,7 +35,7 @@ public:
 	int _fieldC8;
 	int _fieldCC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CParrotNutEater();
 
 	/**
diff --git a/engines/titanic/game/parrot/parrot_perch_holder.h b/engines/titanic/game/parrot/parrot_perch_holder.h
index 8c7a441..ff618f0 100644
--- a/engines/titanic/game/parrot/parrot_perch_holder.h
+++ b/engines/titanic/game/parrot/parrot_perch_holder.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CParrotPerchHolder : public CMultiDropTarget {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/parrot/parrot_succubus.h b/engines/titanic/game/parrot/parrot_succubus.h
index 7984cc6..6f5d9e6 100644
--- a/engines/titanic/game/parrot/parrot_succubus.h
+++ b/engines/titanic/game/parrot/parrot_succubus.h
@@ -35,7 +35,7 @@ public:
 	int _field1F0;
 	int _field1F4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CParrotSuccUBus();
 
 	/**
diff --git a/engines/titanic/game/parrot/parrot_trigger.h b/engines/titanic/game/parrot/parrot_trigger.h
index f2d1d7e..28a1663 100644
--- a/engines/titanic/game/parrot/parrot_trigger.h
+++ b/engines/titanic/game/parrot/parrot_trigger.h
@@ -31,7 +31,7 @@ class CParrotTrigger : public CGameObject {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CParrotTrigger() : CGameObject(), _value(0x446AB) {}
 
 	/**
diff --git a/engines/titanic/game/parrot/player_meets_parrot.h b/engines/titanic/game/parrot/player_meets_parrot.h
index 0a72099..9cee9ee 100644
--- a/engines/titanic/game/parrot/player_meets_parrot.h
+++ b/engines/titanic/game/parrot/player_meets_parrot.h
@@ -32,7 +32,7 @@ class CPlayerMeetsParrot : public CGameObject {
 protected:
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet.h b/engines/titanic/game/pet/pet.h
index de62294..cdad649 100644
--- a/engines/titanic/game/pet/pet.h
+++ b/engines/titanic/game/pet/pet.h
@@ -37,7 +37,7 @@ public:
 	int _fieldD8;
 	int _fieldDC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPET();
 
 	/**
diff --git a/engines/titanic/game/pet/pet_class1.h b/engines/titanic/game/pet/pet_class1.h
index aeb01ad..ad97f45 100644
--- a/engines/titanic/game/pet/pet_class1.h
+++ b/engines/titanic/game/pet/pet_class1.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CPETClass1 : public CGameObject {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_class2.h b/engines/titanic/game/pet/pet_class2.h
index aa85397..6ae78f4 100644
--- a/engines/titanic/game/pet/pet_class2.h
+++ b/engines/titanic/game/pet/pet_class2.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CPETClass2 : public CGameObject {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_class3.h b/engines/titanic/game/pet/pet_class3.h
index 733186a..780cad3 100644
--- a/engines/titanic/game/pet/pet_class3.h
+++ b/engines/titanic/game/pet/pet_class3.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CPETClass3 : public CGameObject {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_lift.h b/engines/titanic/game/pet/pet_lift.h
index 9bdf531..88b4e1c 100644
--- a/engines/titanic/game/pet/pet_lift.h
+++ b/engines/titanic/game/pet/pet_lift.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CPETLift : public CPETTransport {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_monitor.h b/engines/titanic/game/pet/pet_monitor.h
index 140c17b..3fc50bd 100644
--- a/engines/titanic/game/pet/pet_monitor.h
+++ b/engines/titanic/game/pet/pet_monitor.h
@@ -32,7 +32,7 @@ class CPETMonitor : public CGameObject {
 	DECLARE_MESSAGE_MAP
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_pellerator.h b/engines/titanic/game/pet/pet_pellerator.h
index 31b44e3..9b90c9a 100644
--- a/engines/titanic/game/pet/pet_pellerator.h
+++ b/engines/titanic/game/pet/pet_pellerator.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CPETPellerator : public CPETTransport {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_position.h b/engines/titanic/game/pet/pet_position.h
index 63c0bf2..9419684 100644
--- a/engines/titanic/game/pet/pet_position.h
+++ b/engines/titanic/game/pet/pet_position.h
@@ -32,7 +32,7 @@ class CPETPosition : public CGameObject {
 	DECLARE_MESSAGE_MAP
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_sentinal.h b/engines/titanic/game/pet/pet_sentinal.h
index 8b1e992..f7f9fef 100644
--- a/engines/titanic/game/pet/pet_sentinal.h
+++ b/engines/titanic/game/pet/pet_sentinal.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CPETSentinal : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_sounds.h b/engines/titanic/game/pet/pet_sounds.h
index 3513da5..1d3acdb 100644
--- a/engines/titanic/game/pet/pet_sounds.h
+++ b/engines/titanic/game/pet/pet_sounds.h
@@ -31,7 +31,7 @@ class CPETSounds : public CGameObject {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPETSounds() : CGameObject(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/pet/pet_transition.h b/engines/titanic/game/pet/pet_transition.h
index 9e4a628..4abf16d 100644
--- a/engines/titanic/game/pet/pet_transition.h
+++ b/engines/titanic/game/pet/pet_transition.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CPETTransition : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet/pet_transport.h b/engines/titanic/game/pet/pet_transport.h
index e580ab8..44beafe 100644
--- a/engines/titanic/game/pet/pet_transport.h
+++ b/engines/titanic/game/pet/pet_transport.h
@@ -32,7 +32,7 @@ class CPETTransport : public CGameObject {
 	DECLARE_MESSAGE_MAP
 	virtual bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pet_disabler.h b/engines/titanic/game/pet_disabler.h
index 5928d44..92b4dff 100644
--- a/engines/titanic/game/pet_disabler.h
+++ b/engines/titanic/game/pet_disabler.h
@@ -31,7 +31,7 @@ class CPetDisabler : public CGameObject {
 public:
 	CString _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPetDisabler() : CGameObject() {}
 
 	/**
diff --git a/engines/titanic/game/phonograph.h b/engines/titanic/game/phonograph.h
index e0f407b..274d4ba 100644
--- a/engines/titanic/game/phonograph.h
+++ b/engines/titanic/game/phonograph.h
@@ -39,7 +39,7 @@ protected:
 	int _fieldF0;
 	int _fieldF4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPhonograph();
 
 	/**
diff --git a/engines/titanic/game/phonograph_lid.h b/engines/titanic/game/phonograph_lid.h
index 486a9b4..ab32be2 100644
--- a/engines/titanic/game/phonograph_lid.h
+++ b/engines/titanic/game/phonograph_lid.h
@@ -31,7 +31,7 @@ class CPhonographLid : public CGameObject {
 private:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPhonographLid() : CGameObject(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/pickup/pick_up.h b/engines/titanic/game/pickup/pick_up.h
index 76537d1..f0b6794 100644
--- a/engines/titanic/game/pickup/pick_up.h
+++ b/engines/titanic/game/pickup/pick_up.h
@@ -31,7 +31,7 @@ class CPickUp : public CGameObject {
 private:
 	int _fieldBC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPickUp() : CGameObject(), _fieldBC(0) {}
 
 	/**
diff --git a/engines/titanic/game/pickup/pick_up_bar_glass.h b/engines/titanic/game/pickup/pick_up_bar_glass.h
index f9bcb00..b5ef6f5 100644
--- a/engines/titanic/game/pickup/pick_up_bar_glass.h
+++ b/engines/titanic/game/pickup/pick_up_bar_glass.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CPickUpBarGlass : public CPickUp {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pickup/pick_up_hose.h b/engines/titanic/game/pickup/pick_up_hose.h
index 68bec36..80ccedc 100644
--- a/engines/titanic/game/pickup/pick_up_hose.h
+++ b/engines/titanic/game/pickup/pick_up_hose.h
@@ -33,7 +33,7 @@ private:
 
 	CString _string1;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pickup/pick_up_lemon.h b/engines/titanic/game/pickup/pick_up_lemon.h
index 9bed9ce..0312c71 100644
--- a/engines/titanic/game/pickup/pick_up_lemon.h
+++ b/engines/titanic/game/pickup/pick_up_lemon.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CPickUpLemon : public CPickUp {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pickup/pick_up_speech_centre.h b/engines/titanic/game/pickup/pick_up_speech_centre.h
index a74566b..29dce04 100644
--- a/engines/titanic/game/pickup/pick_up_speech_centre.h
+++ b/engines/titanic/game/pickup/pick_up_speech_centre.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CPickUpSpeechCentre : public CPickUp {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/pickup/pick_up_vis_centre.h b/engines/titanic/game/pickup/pick_up_vis_centre.h
index 059c4f8..4f808f7 100644
--- a/engines/titanic/game/pickup/pick_up_vis_centre.h
+++ b/engines/titanic/game/pickup/pick_up_vis_centre.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CPickUpVisCentre : public CPickUp {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/placeholder/bar_shelf_vis_centre.h b/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
index 7cb4478..a53ef26 100644
--- a/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
+++ b/engines/titanic/game/placeholder/bar_shelf_vis_centre.h
@@ -31,7 +31,7 @@ class CBarShelfVisCentre : public CPlaceHolderItem {
 private:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBarShelfVisCentre() : CPlaceHolderItem(), _value(0) {}
 	
 	/**
diff --git a/engines/titanic/game/placeholder/lemon_on_bar.h b/engines/titanic/game/placeholder/lemon_on_bar.h
index 030481e..92dd54c 100644
--- a/engines/titanic/game/placeholder/lemon_on_bar.h
+++ b/engines/titanic/game/placeholder/lemon_on_bar.h
@@ -31,7 +31,7 @@ class CLemonOnBar : public CPlaceHolderItem {
 private:
 	Point _pos1;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/placeholder/place_holder_item.h b/engines/titanic/game/placeholder/place_holder_item.h
index 72f49c0..de04a64 100644
--- a/engines/titanic/game/placeholder/place_holder_item.h
+++ b/engines/titanic/game/placeholder/place_holder_item.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CPlaceHolderItem : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/placeholder/tv_on_bar.h b/engines/titanic/game/placeholder/tv_on_bar.h
index ffe8109..d41d972 100644
--- a/engines/titanic/game/placeholder/tv_on_bar.h
+++ b/engines/titanic/game/placeholder/tv_on_bar.h
@@ -31,7 +31,7 @@ class CTVOnBar : public CPlaceHolderItem {
 private:
 	Point _pos1;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/play_music_button.h b/engines/titanic/game/play_music_button.h
index 8ae32dc..4e34741 100644
--- a/engines/titanic/game/play_music_button.h
+++ b/engines/titanic/game/play_music_button.h
@@ -32,7 +32,7 @@ public:
 	int _fieldE0;
 	int _fieldE4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPlayMusicButton() : CBackground(), _fieldE0(0), _fieldE4(0) {}
 
 	/**
diff --git a/engines/titanic/game/play_on_act.h b/engines/titanic/game/play_on_act.h
index bd60600..197e647 100644
--- a/engines/titanic/game/play_on_act.h
+++ b/engines/titanic/game/play_on_act.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CPlayOnAct : public CBackground {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/port_hole.h b/engines/titanic/game/port_hole.h
index 4e952cc..7bba18d 100644
--- a/engines/titanic/game/port_hole.h
+++ b/engines/titanic/game/port_hole.h
@@ -32,7 +32,7 @@ private:
 	int _fieldBC;
 	CString _string1, _string2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPortHole();
 
 	/**
diff --git a/engines/titanic/game/record_phonograph_button.h b/engines/titanic/game/record_phonograph_button.h
index 9750b7d..3383c01 100644
--- a/engines/titanic/game/record_phonograph_button.h
+++ b/engines/titanic/game/record_phonograph_button.h
@@ -31,7 +31,7 @@ class CRecordPhonographButton : public CBackground {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CRecordPhonographButton() : CBackground(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/replacement_ear.h b/engines/titanic/game/replacement_ear.h
index 59d291f..0d282b7 100644
--- a/engines/titanic/game/replacement_ear.h
+++ b/engines/titanic/game/replacement_ear.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CReplacementEar : public CBackground {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/reserved_table.h b/engines/titanic/game/reserved_table.h
index a0927fa..a3532c7 100644
--- a/engines/titanic/game/reserved_table.h
+++ b/engines/titanic/game/reserved_table.h
@@ -31,7 +31,7 @@ class CReservedTable : public CGameObject {
 public:
 	int _value1, _value2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CReservedTable() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
diff --git a/engines/titanic/game/restaurant_cylinder_holder.h b/engines/titanic/game/restaurant_cylinder_holder.h
index d679dd1..3aa979b 100644
--- a/engines/titanic/game/restaurant_cylinder_holder.h
+++ b/engines/titanic/game/restaurant_cylinder_holder.h
@@ -37,7 +37,7 @@ private:
 	CString _string6;
 	int _field140;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CRestaurantCylinderHolder();
 
 	/**
diff --git a/engines/titanic/game/restaurant_phonograph.h b/engines/titanic/game/restaurant_phonograph.h
index 6243497..710a2ed 100644
--- a/engines/titanic/game/restaurant_phonograph.h
+++ b/engines/titanic/game/restaurant_phonograph.h
@@ -34,7 +34,7 @@ private:
 	CString _string3;
 	int _field114;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CRestaurantPhonograph();
 
 	/**
diff --git a/engines/titanic/game/sauce_dispensor.h b/engines/titanic/game/sauce_dispensor.h
index f87420b..aa17705 100644
--- a/engines/titanic/game/sauce_dispensor.h
+++ b/engines/titanic/game/sauce_dispensor.h
@@ -37,7 +37,7 @@ public:
 	int _field104;
 	int _field108;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSauceDispensor();
 
 	/**
diff --git a/engines/titanic/game/search_point.h b/engines/titanic/game/search_point.h
index 057bb4d..3c5639b 100644
--- a/engines/titanic/game/search_point.h
+++ b/engines/titanic/game/search_point.h
@@ -31,7 +31,7 @@ class CSearchPoint : public CGameObject {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSearchPoint() : CGameObject(), _value(2) {}
 
 	/**
diff --git a/engines/titanic/game/season_background.h b/engines/titanic/game/season_background.h
index c89e6a6..f0fd2cd 100644
--- a/engines/titanic/game/season_background.h
+++ b/engines/titanic/game/season_background.h
@@ -34,7 +34,7 @@ public:
 	int _fieldE8;
 	int _fieldEC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSeasonBackground();
 
 	/**
diff --git a/engines/titanic/game/season_barrel.h b/engines/titanic/game/season_barrel.h
index 145dfa0..f778645 100644
--- a/engines/titanic/game/season_barrel.h
+++ b/engines/titanic/game/season_barrel.h
@@ -32,7 +32,7 @@ public:
 	int _fieldE0;
 	int _fieldE4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSeasonBarrel() : CBackground(), _fieldE0(0), _fieldE4(7) {}
 
 	/**
diff --git a/engines/titanic/game/seasonal_adjustment.h b/engines/titanic/game/seasonal_adjustment.h
index 4f251ad..39132d6 100644
--- a/engines/titanic/game/seasonal_adjustment.h
+++ b/engines/titanic/game/seasonal_adjustment.h
@@ -32,7 +32,7 @@ public:
 	int _fieldE0;
 	int _fieldE4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSeasonalAdjustment() : CBackground(), _fieldE0(0), _fieldE4(0) {}
 
 	/**
diff --git a/engines/titanic/game/service_elevator_window.h b/engines/titanic/game/service_elevator_window.h
index 0815023..4233b84 100644
--- a/engines/titanic/game/service_elevator_window.h
+++ b/engines/titanic/game/service_elevator_window.h
@@ -34,7 +34,7 @@ public:
 	int _fieldE8;
 	int _fieldEC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CServiceElevatorWindow();
 
 	/**
diff --git a/engines/titanic/game/sgt/armchair.h b/engines/titanic/game/sgt/armchair.h
index 5dfd94d..b550555 100644
--- a/engines/titanic/game/sgt/armchair.h
+++ b/engines/titanic/game/sgt/armchair.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CArmchair : public CSGTStateRoom {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/basin.h b/engines/titanic/game/sgt/basin.h
index 950bdb8..e4a36eb 100644
--- a/engines/titanic/game/sgt/basin.h
+++ b/engines/titanic/game/sgt/basin.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CBasin : public CSGTStateRoom {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/bedfoot.h b/engines/titanic/game/sgt/bedfoot.h
index db1e1dd..df3db42 100644
--- a/engines/titanic/game/sgt/bedfoot.h
+++ b/engines/titanic/game/sgt/bedfoot.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CBedfoot : public CSGTStateRoom {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/bedhead.h b/engines/titanic/game/sgt/bedhead.h
index b938dcd..f1ba317 100644
--- a/engines/titanic/game/sgt/bedhead.h
+++ b/engines/titanic/game/sgt/bedhead.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CBedhead : public CSGTStateRoom {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/chest_of_drawers.h b/engines/titanic/game/sgt/chest_of_drawers.h
index 5b72f3e..16a1bf8 100644
--- a/engines/titanic/game/sgt/chest_of_drawers.h
+++ b/engines/titanic/game/sgt/chest_of_drawers.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CChestOfDrawers : public CSGTStateRoom {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/desk.h b/engines/titanic/game/sgt/desk.h
index d35417c..77b5fa1 100644
--- a/engines/titanic/game/sgt/desk.h
+++ b/engines/titanic/game/sgt/desk.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CDesk : public CSGTStateRoom {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/deskchair.h b/engines/titanic/game/sgt/deskchair.h
index 38e4d6d..5181b65 100644
--- a/engines/titanic/game/sgt/deskchair.h
+++ b/engines/titanic/game/sgt/deskchair.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CDeskchair : public CSGTStateRoom {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/drawer.h b/engines/titanic/game/sgt/drawer.h
index 4f68b1b..c079be3 100644
--- a/engines/titanic/game/sgt/drawer.h
+++ b/engines/titanic/game/sgt/drawer.h
@@ -31,7 +31,7 @@ class CDrawer : public CSGTStateRoom {
 private:
 	int _fieldF4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CDrawer();
 
 	/**
diff --git a/engines/titanic/game/sgt/sgt_doors.h b/engines/titanic/game/sgt/sgt_doors.h
index 11825c0..4b4f4a3 100644
--- a/engines/titanic/game/sgt/sgt_doors.h
+++ b/engines/titanic/game/sgt/sgt_doors.h
@@ -31,7 +31,7 @@ class CSGTDoors : public CGameObject {
 public:
 	int _value1, _value2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSGTDoors() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
diff --git a/engines/titanic/game/sgt/sgt_nav.h b/engines/titanic/game/sgt/sgt_nav.h
index 39b267f..40fdc4e 100644
--- a/engines/titanic/game/sgt/sgt_nav.h
+++ b/engines/titanic/game/sgt/sgt_nav.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class SGTNav : public CSGTStateRoom {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/sgt_navigation.h b/engines/titanic/game/sgt/sgt_navigation.h
index ac8c475..6d24fe6 100644
--- a/engines/titanic/game/sgt/sgt_navigation.h
+++ b/engines/titanic/game/sgt/sgt_navigation.h
@@ -37,7 +37,7 @@ class CSGTNavigation : public CGameObject {
 private:
 	static CSGTNavigationStatics *_statics;
 public:
-	CLASSDEF
+	CLASSDEF;
 	static void init();
 	static void deinit();
 
diff --git a/engines/titanic/game/sgt/sgt_restaurant_doors.h b/engines/titanic/game/sgt/sgt_restaurant_doors.h
index e740db6..2a10d8f 100644
--- a/engines/titanic/game/sgt/sgt_restaurant_doors.h
+++ b/engines/titanic/game/sgt/sgt_restaurant_doors.h
@@ -31,7 +31,7 @@ class CSGTRestaurantDoors : public CGameObject {
 private:
 	int _fieldBC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSGTRestaurantDoors() : CGameObject(), _fieldBC(0) {}
 
 	/**
diff --git a/engines/titanic/game/sgt/sgt_state_control.h b/engines/titanic/game/sgt/sgt_state_control.h
index af51274..49fd511 100644
--- a/engines/titanic/game/sgt/sgt_state_control.h
+++ b/engines/titanic/game/sgt/sgt_state_control.h
@@ -31,7 +31,7 @@ class CSGTStateControl : public CBackground {
 private:
 	int _fieldE0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSGTStateControl() : CBackground(), _fieldE0(1) {}
 
 	/**
diff --git a/engines/titanic/game/sgt/sgt_state_room.h b/engines/titanic/game/sgt/sgt_state_room.h
index 1809ec8..ee90799 100644
--- a/engines/titanic/game/sgt/sgt_state_room.h
+++ b/engines/titanic/game/sgt/sgt_state_room.h
@@ -57,7 +57,7 @@ private:
 	int _fieldEC;
 	int _fieldF0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSGTStateRoom();
 	static void init();
 	static void deinit();
diff --git a/engines/titanic/game/sgt/sgt_tv.h b/engines/titanic/game/sgt/sgt_tv.h
index e97f974..90fed90 100644
--- a/engines/titanic/game/sgt/sgt_tv.h
+++ b/engines/titanic/game/sgt/sgt_tv.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CSGTTV : public CSGTStateRoom {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/sgt_upper_doors_sound.h b/engines/titanic/game/sgt/sgt_upper_doors_sound.h
index 3289b88..fc8c6c2 100644
--- a/engines/titanic/game/sgt/sgt_upper_doors_sound.h
+++ b/engines/titanic/game/sgt/sgt_upper_doors_sound.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CSGTUpperDoorsSound : public CClickResponder {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSGTUpperDoorsSound();
 
 	/**
diff --git a/engines/titanic/game/sgt/toilet.h b/engines/titanic/game/sgt/toilet.h
index d0d2851..d87531a 100644
--- a/engines/titanic/game/sgt/toilet.h
+++ b/engines/titanic/game/sgt/toilet.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CToilet : public CSGTStateRoom {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/vase.h b/engines/titanic/game/sgt/vase.h
index ec3662b..8aa35ac 100644
--- a/engines/titanic/game/sgt/vase.h
+++ b/engines/titanic/game/sgt/vase.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CVase : public CSGTStateRoom {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sgt/washstand.h b/engines/titanic/game/sgt/washstand.h
index ea7636c..f140b17 100644
--- a/engines/titanic/game/sgt/washstand.h
+++ b/engines/titanic/game/sgt/washstand.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CWashstand : public CSGTStateRoom {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/ship_setting.h b/engines/titanic/game/ship_setting.h
index e0a52dd..4fcc10a 100644
--- a/engines/titanic/game/ship_setting.h
+++ b/engines/titanic/game/ship_setting.h
@@ -36,7 +36,7 @@ public:
 	CString _string4;
 	CString _string5;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CShipSetting();
 
 	/**
diff --git a/engines/titanic/game/ship_setting_button.h b/engines/titanic/game/ship_setting_button.h
index e5a889b..e152e8e 100644
--- a/engines/titanic/game/ship_setting_button.h
+++ b/engines/titanic/game/ship_setting_button.h
@@ -33,7 +33,7 @@ private:
 	int _fieldC8;
 	int _fieldCC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CShipSettingButton();
 
 	/**
diff --git a/engines/titanic/game/show_cell_points.h b/engines/titanic/game/show_cell_points.h
index 8359221..9de2e06 100644
--- a/engines/titanic/game/show_cell_points.h
+++ b/engines/titanic/game/show_cell_points.h
@@ -32,7 +32,7 @@ public:
 	CString _strValue;
 	int _numValue;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CShowCellpoints() : CGameObject(), _numValue(0) {}
 
 	/**
diff --git a/engines/titanic/game/speech_dispensor.h b/engines/titanic/game/speech_dispensor.h
index 6302ca3..3b877e8 100644
--- a/engines/titanic/game/speech_dispensor.h
+++ b/engines/titanic/game/speech_dispensor.h
@@ -38,7 +38,7 @@ private:
 	int _fieldF8;
 	int _fieldFC;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/splash_animation.h b/engines/titanic/game/splash_animation.h
index 4b70b38..b1de994 100644
--- a/engines/titanic/game/splash_animation.h
+++ b/engines/titanic/game/splash_animation.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CSplashAnimation : public CGameObject {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/starling_puret.h b/engines/titanic/game/starling_puret.h
index 36cd23e..fcd3319 100644
--- a/engines/titanic/game/starling_puret.h
+++ b/engines/titanic/game/starling_puret.h
@@ -31,7 +31,7 @@ class CStarlingPuret : public CGameObject {
 private:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CStarlingPuret() : CGameObject(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/start_action.h b/engines/titanic/game/start_action.h
index 6b6860e..8be17f0 100644
--- a/engines/titanic/game/start_action.h
+++ b/engines/titanic/game/start_action.h
@@ -36,7 +36,7 @@ protected:
 	CString _msgTarget;
 	CString _msgAction;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CStartAction();
 
 	/**
diff --git a/engines/titanic/game/stop_phonograph_button.h b/engines/titanic/game/stop_phonograph_button.h
index 1109f81..b469375 100644
--- a/engines/titanic/game/stop_phonograph_button.h
+++ b/engines/titanic/game/stop_phonograph_button.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CStopPhonographButton : public CBackground {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/sub_glass.h b/engines/titanic/game/sub_glass.h
index 1aa73d2..aab5c84 100644
--- a/engines/titanic/game/sub_glass.h
+++ b/engines/titanic/game/sub_glass.h
@@ -36,7 +36,7 @@ private:
 	int _fieldCC;
 	CString _string;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSUBGlass();
 
 	/**
diff --git a/engines/titanic/game/sub_wrapper.h b/engines/titanic/game/sub_wrapper.h
index d2fc914..81f8fdc 100644
--- a/engines/titanic/game/sub_wrapper.h
+++ b/engines/titanic/game/sub_wrapper.h
@@ -31,7 +31,7 @@ class CSUBWrapper : public CGameObject {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSUBWrapper() : CGameObject(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/sweet_bowl.h b/engines/titanic/game/sweet_bowl.h
index 5beb960..cf3d002 100644
--- a/engines/titanic/game/sweet_bowl.h
+++ b/engines/titanic/game/sweet_bowl.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CSweetBowl : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
index 27dd3d6..3ce5505 100644
--- a/engines/titanic/game/television.h
+++ b/engines/titanic/game/television.h
@@ -58,7 +58,7 @@ private:
 	int _fieldEC;
 	int _soundHandle;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CTelevision();
 	static void init();
 	static void deinit();
diff --git a/engines/titanic/game/third_class_canal.h b/engines/titanic/game/third_class_canal.h
index 1cc5394..f6fc471 100644
--- a/engines/titanic/game/third_class_canal.h
+++ b/engines/titanic/game/third_class_canal.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CThirdClassCanal : public CBackground {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/throw_tv_down_well.h b/engines/titanic/game/throw_tv_down_well.h
index ce10264..b6003aa 100644
--- a/engines/titanic/game/throw_tv_down_well.h
+++ b/engines/titanic/game/throw_tv_down_well.h
@@ -32,7 +32,7 @@ public:
 	CString _strValue;
 	int _numValue;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CThrowTVDownWell() : CGameObject(), _numValue(0) {}
 
 	/**
diff --git a/engines/titanic/game/titania_still_control.h b/engines/titanic/game/titania_still_control.h
index dbff0c7..66c3045 100644
--- a/engines/titanic/game/titania_still_control.h
+++ b/engines/titanic/game/titania_still_control.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CTitaniaStillControl : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/tow_parrot_nav.h b/engines/titanic/game/tow_parrot_nav.h
index 651b8be..17618ff 100644
--- a/engines/titanic/game/tow_parrot_nav.h
+++ b/engines/titanic/game/tow_parrot_nav.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CTOWParrotNav : public CGameObject {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/transport/exit_pellerator.h b/engines/titanic/game/transport/exit_pellerator.h
index e55a8fb..53056c7 100644
--- a/engines/titanic/game/transport/exit_pellerator.h
+++ b/engines/titanic/game/transport/exit_pellerator.h
@@ -32,7 +32,7 @@ private:
 	static int _v1;
 	static int _v2;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/transport/gondolier.h b/engines/titanic/game/transport/gondolier.h
index 4f4c570..ac16172 100644
--- a/engines/titanic/game/transport/gondolier.h
+++ b/engines/titanic/game/transport/gondolier.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CGondolier : public CTransport {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h
index 4b39d34..9c90466 100644
--- a/engines/titanic/game/transport/lift.h
+++ b/engines/titanic/game/transport/lift.h
@@ -41,7 +41,7 @@ private:
 
 	int _fieldF8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CLift() : CTransport(), _fieldF8(1) {}
 
 	/**
diff --git a/engines/titanic/game/transport/lift_indicator.h b/engines/titanic/game/transport/lift_indicator.h
index 2b08da5..ff394d7 100644
--- a/engines/titanic/game/transport/lift_indicator.h
+++ b/engines/titanic/game/transport/lift_indicator.h
@@ -37,7 +37,7 @@ private:
 	int _field108;
 	int _field10C;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CLiftindicator();
 
 	/**
diff --git a/engines/titanic/game/transport/pellerator.h b/engines/titanic/game/transport/pellerator.h
index ac1486d..9d223ec 100644
--- a/engines/titanic/game/transport/pellerator.h
+++ b/engines/titanic/game/transport/pellerator.h
@@ -35,7 +35,7 @@ private:
 	static int _v1;
 	static int _v2;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/transport/service_elevator.h b/engines/titanic/game/transport/service_elevator.h
index 472f458..b2c1350 100644
--- a/engines/titanic/game/transport/service_elevator.h
+++ b/engines/titanic/game/transport/service_elevator.h
@@ -38,7 +38,7 @@ private:
 	int _field100;
 	int _field104;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CServiceElevator();
 
 	/**
diff --git a/engines/titanic/game/transport/transport.h b/engines/titanic/game/transport/transport.h
index 6690688..b2c9aee 100644
--- a/engines/titanic/game/transport/transport.h
+++ b/engines/titanic/game/transport/transport.h
@@ -33,7 +33,7 @@ public:
 	CString _string1;
 	CString _string2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CTransport();
 
 	/**
diff --git a/engines/titanic/game/up_lighter.h b/engines/titanic/game/up_lighter.h
index be76f57..2367e41 100644
--- a/engines/titanic/game/up_lighter.h
+++ b/engines/titanic/game/up_lighter.h
@@ -36,7 +36,7 @@ private:
 	int _field120;
 	int _field124;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CUpLighter();
 
 	/**
diff --git a/engines/titanic/game/useless_lever.h b/engines/titanic/game/useless_lever.h
index d6c5480..27397de 100644
--- a/engines/titanic/game/useless_lever.h
+++ b/engines/titanic/game/useless_lever.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CUselessLever : public CToggleButton {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/game/volume_control.h b/engines/titanic/game/volume_control.h
index 77e3346..dcc6f63 100644
--- a/engines/titanic/game/volume_control.h
+++ b/engines/titanic/game/volume_control.h
@@ -35,7 +35,7 @@ private:
 	CString _string1;
 	int _fieldCC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CVolumeControl();
 
 	/**
diff --git a/engines/titanic/game/wheel_button.h b/engines/titanic/game/wheel_button.h
index 78ea708..cb089a6 100644
--- a/engines/titanic/game/wheel_button.h
+++ b/engines/titanic/game/wheel_button.h
@@ -33,7 +33,7 @@ public:
 	int _fieldE4;
 	int _fieldE8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CWheelButton();
 
 	/**
diff --git a/engines/titanic/game/wheel_hotspot.h b/engines/titanic/game/wheel_hotspot.h
index 75b597c..364fe9a 100644
--- a/engines/titanic/game/wheel_hotspot.h
+++ b/engines/titanic/game/wheel_hotspot.h
@@ -32,7 +32,7 @@ public:
 	int _fieldE0;
 	int _fieldE4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CWheelHotSpot() : CBackground(), _fieldE0(0), _fieldE4(0) {}
 
 	/**
diff --git a/engines/titanic/game/wheel_spin.h b/engines/titanic/game/wheel_spin.h
index 9e584a1..509db1a 100644
--- a/engines/titanic/game/wheel_spin.h
+++ b/engines/titanic/game/wheel_spin.h
@@ -31,7 +31,7 @@ class CWheelSpin : public CBackground {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CWheelSpin() : CBackground(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/game/wheel_spin_horn.h b/engines/titanic/game/wheel_spin_horn.h
index ac4021f..2118225 100644
--- a/engines/titanic/game/wheel_spin_horn.h
+++ b/engines/titanic/game/wheel_spin_horn.h
@@ -32,7 +32,7 @@ public:
 	CString _string1;
 	CString _string2;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/act_button.h b/engines/titanic/gfx/act_button.h
index 3b78e0c..26e5595 100644
--- a/engines/titanic/gfx/act_button.h
+++ b/engines/titanic/gfx/act_button.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CActButton : public CSTButton {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CActButton();
 
 	/**
diff --git a/engines/titanic/gfx/changes_season_button.h b/engines/titanic/gfx/changes_season_button.h
index 2fe4672..2b58a31 100644
--- a/engines/titanic/gfx/changes_season_button.h
+++ b/engines/titanic/gfx/changes_season_button.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CChangesSeasonButton : public CSTButton {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CChangesSeasonButton();
 
 	/**
diff --git a/engines/titanic/gfx/chev_left_off.h b/engines/titanic/gfx/chev_left_off.h
index 572f58a..1e356d3 100644
--- a/engines/titanic/gfx/chev_left_off.h
+++ b/engines/titanic/gfx/chev_left_off.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CChevLeftOff : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CChevLeftOff();
 
 	/**
diff --git a/engines/titanic/gfx/chev_left_on.h b/engines/titanic/gfx/chev_left_on.h
index c015eef..2014002 100644
--- a/engines/titanic/gfx/chev_left_on.h
+++ b/engines/titanic/gfx/chev_left_on.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CChevLeftOn : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CChevLeftOn();
 
 	/**
diff --git a/engines/titanic/gfx/chev_right_off.h b/engines/titanic/gfx/chev_right_off.h
index 05b62f3..2bd3e24 100644
--- a/engines/titanic/gfx/chev_right_off.h
+++ b/engines/titanic/gfx/chev_right_off.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CChevRightOff : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CChevRightOff();
 
 	/**
diff --git a/engines/titanic/gfx/chev_right_on.h b/engines/titanic/gfx/chev_right_on.h
index 56672f2..bc3e0ff 100644
--- a/engines/titanic/gfx/chev_right_on.h
+++ b/engines/titanic/gfx/chev_right_on.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CChevRightOn : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CChevRightOn();
 
 	/**
diff --git a/engines/titanic/gfx/chev_send_rec_switch.h b/engines/titanic/gfx/chev_send_rec_switch.h
index 17a1b0a..0414928 100644
--- a/engines/titanic/gfx/chev_send_rec_switch.h
+++ b/engines/titanic/gfx/chev_send_rec_switch.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CChevSendRecSwitch : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CChevSendRecSwitch();
 
 	/**
diff --git a/engines/titanic/gfx/chev_switch.h b/engines/titanic/gfx/chev_switch.h
index d3c884e..0305a6c 100644
--- a/engines/titanic/gfx/chev_switch.h
+++ b/engines/titanic/gfx/chev_switch.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CChevSwitch : public CToggleSwitch {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CChevSwitch();
 
 	/**
diff --git a/engines/titanic/gfx/edit_control.h b/engines/titanic/gfx/edit_control.h
index 4288637..77d03cb 100644
--- a/engines/titanic/gfx/edit_control.h
+++ b/engines/titanic/gfx/edit_control.h
@@ -43,7 +43,7 @@ protected:
 	int _fieldF0;
 	int _fieldF4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEditControl();
 
 	/**
diff --git a/engines/titanic/gfx/elevator_button.h b/engines/titanic/gfx/elevator_button.h
index da7e25a..dec4775 100644
--- a/engines/titanic/gfx/elevator_button.h
+++ b/engines/titanic/gfx/elevator_button.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CElevatorButton : public CSTButton {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CElevatorButton();
 
 	/**
diff --git a/engines/titanic/gfx/get_from_succ.h b/engines/titanic/gfx/get_from_succ.h
index 5f16f91..d93341e 100644
--- a/engines/titanic/gfx/get_from_succ.h
+++ b/engines/titanic/gfx/get_from_succ.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CGetFromSucc : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CGetFromSucc();
 
 	/**
diff --git a/engines/titanic/gfx/helmet_on_off.h b/engines/titanic/gfx/helmet_on_off.h
index c0e1a0a..881757a 100644
--- a/engines/titanic/gfx/helmet_on_off.h
+++ b/engines/titanic/gfx/helmet_on_off.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CHelmetOnOff : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CHelmetOnOff();
 
 	/**
diff --git a/engines/titanic/gfx/home_photo.h b/engines/titanic/gfx/home_photo.h
index c143523..9181bfd 100644
--- a/engines/titanic/gfx/home_photo.h
+++ b/engines/titanic/gfx/home_photo.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CHomePhoto : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CHomePhoto();
 
 	/**
diff --git a/engines/titanic/gfx/icon_nav_action.h b/engines/titanic/gfx/icon_nav_action.h
index 2a5961d..9a63a47 100644
--- a/engines/titanic/gfx/icon_nav_action.h
+++ b/engines/titanic/gfx/icon_nav_action.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CIconNavAction : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CIconNavAction();
 
 	/**
diff --git a/engines/titanic/gfx/icon_nav_butt.h b/engines/titanic/gfx/icon_nav_butt.h
index 3c73a27..a27fc8b 100644
--- a/engines/titanic/gfx/icon_nav_butt.h
+++ b/engines/titanic/gfx/icon_nav_butt.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CIconNavButt : public CPetGraphic {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/icon_nav_down.h b/engines/titanic/gfx/icon_nav_down.h
index 6de13ea..759d887 100644
--- a/engines/titanic/gfx/icon_nav_down.h
+++ b/engines/titanic/gfx/icon_nav_down.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CIconNavDown : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CIconNavDown();
 
 	/**
diff --git a/engines/titanic/gfx/icon_nav_image.h b/engines/titanic/gfx/icon_nav_image.h
index 3ff82f3..ab0e955 100644
--- a/engines/titanic/gfx/icon_nav_image.h
+++ b/engines/titanic/gfx/icon_nav_image.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CIconNavImage : public CPetGraphic {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/icon_nav_left.h b/engines/titanic/gfx/icon_nav_left.h
index bba3016..d58a426 100644
--- a/engines/titanic/gfx/icon_nav_left.h
+++ b/engines/titanic/gfx/icon_nav_left.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CIconNavLeft : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CIconNavLeft();
 
 	/**
diff --git a/engines/titanic/gfx/icon_nav_receive.h b/engines/titanic/gfx/icon_nav_receive.h
index 8fff0d0..5d055dd 100644
--- a/engines/titanic/gfx/icon_nav_receive.h
+++ b/engines/titanic/gfx/icon_nav_receive.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CIconNavReceive : public CPetGraphic {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/icon_nav_right.h b/engines/titanic/gfx/icon_nav_right.h
index 1df1043..c12ff7c 100644
--- a/engines/titanic/gfx/icon_nav_right.h
+++ b/engines/titanic/gfx/icon_nav_right.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CIconNavRight : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CIconNavRight();
 
 	/**
diff --git a/engines/titanic/gfx/icon_nav_send.h b/engines/titanic/gfx/icon_nav_send.h
index d709205..f2b220f 100644
--- a/engines/titanic/gfx/icon_nav_send.h
+++ b/engines/titanic/gfx/icon_nav_send.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CIconNavSend : public CPetGraphic {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/icon_nav_up.h b/engines/titanic/gfx/icon_nav_up.h
index 73d4fc3..a9702c7 100644
--- a/engines/titanic/gfx/icon_nav_up.h
+++ b/engines/titanic/gfx/icon_nav_up.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CIconNavUp : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CIconNavUp();
 
 	/**
diff --git a/engines/titanic/gfx/keybrd_butt.h b/engines/titanic/gfx/keybrd_butt.h
index 4bf38a1..5514f11 100644
--- a/engines/titanic/gfx/keybrd_butt.h
+++ b/engines/titanic/gfx/keybrd_butt.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CKeybrdButt : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CKeybrdButt();
 
 	/**
diff --git a/engines/titanic/gfx/move_object_button.h b/engines/titanic/gfx/move_object_button.h
index a255ecf..eb2fdc4 100644
--- a/engines/titanic/gfx/move_object_button.h
+++ b/engines/titanic/gfx/move_object_button.h
@@ -32,7 +32,7 @@ private:
 	Point _pos1;
 	int _field11C;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMoveObjectButton();
 
 	/**
diff --git a/engines/titanic/gfx/music_control.h b/engines/titanic/gfx/music_control.h
index 4b79270..04085f7 100644
--- a/engines/titanic/gfx/music_control.h
+++ b/engines/titanic/gfx/music_control.h
@@ -34,7 +34,7 @@ public:
 	int _fieldE8;
 	int _fieldEC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMusicControl();
 
 	/**
diff --git a/engines/titanic/gfx/music_slider.h b/engines/titanic/gfx/music_slider.h
index 87a06c6..1636afe 100644
--- a/engines/titanic/gfx/music_slider.h
+++ b/engines/titanic/gfx/music_slider.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CMusicSlider : public CMusicControl {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/music_slider_pitch.h b/engines/titanic/gfx/music_slider_pitch.h
index edb8f42..10c1d62 100644
--- a/engines/titanic/gfx/music_slider_pitch.h
+++ b/engines/titanic/gfx/music_slider_pitch.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CMusicSliderPitch : public CMusicSlider {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/music_slider_speed.h b/engines/titanic/gfx/music_slider_speed.h
index c6a35dd..9814ca0 100644
--- a/engines/titanic/gfx/music_slider_speed.h
+++ b/engines/titanic/gfx/music_slider_speed.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 	class CMusicSliderSpeed : public CMusicSlider {
 	public:
-		CLASSDEF
+		CLASSDEF;
 
 		/**
 		* Save the data for the class to file
diff --git a/engines/titanic/gfx/music_switch.h b/engines/titanic/gfx/music_switch.h
index bb90a8f..6ee615d 100644
--- a/engines/titanic/gfx/music_switch.h
+++ b/engines/titanic/gfx/music_switch.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CMusicSwitch : public CMusicControl {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/music_switch_inversion.h b/engines/titanic/gfx/music_switch_inversion.h
index 052c812..8b3718c 100644
--- a/engines/titanic/gfx/music_switch_inversion.h
+++ b/engines/titanic/gfx/music_switch_inversion.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CMusicSwitchInversion : public CMusicSwitch {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/music_switch_reverse.h b/engines/titanic/gfx/music_switch_reverse.h
index 5a6208c..3bfcb53 100644
--- a/engines/titanic/gfx/music_switch_reverse.h
+++ b/engines/titanic/gfx/music_switch_reverse.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 	class CMusicSwitchReverse : public CMusicSwitch {
 	public:
-		CLASSDEF
+		CLASSDEF;
 
 		/**
 		 * Save the data for the class to file
diff --git a/engines/titanic/gfx/music_voice_mute.h b/engines/titanic/gfx/music_voice_mute.h
index 85aeda8..ca15806 100644
--- a/engines/titanic/gfx/music_voice_mute.h
+++ b/engines/titanic/gfx/music_voice_mute.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CMusicVoiceMute : public CMusicControl {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/send_to_succ.h b/engines/titanic/gfx/send_to_succ.h
index 1b8d177..dfcb345 100644
--- a/engines/titanic/gfx/send_to_succ.h
+++ b/engines/titanic/gfx/send_to_succ.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CSendToSucc : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSendToSucc();
 	
 	/**
diff --git a/engines/titanic/gfx/sgt_selector.h b/engines/titanic/gfx/sgt_selector.h
index c6d2a16..2afd402 100644
--- a/engines/titanic/gfx/sgt_selector.h
+++ b/engines/titanic/gfx/sgt_selector.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CSGTSelector : public CPetGraphic {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/slider_button.h b/engines/titanic/gfx/slider_button.h
index 3bd33aa..398290b 100644
--- a/engines/titanic/gfx/slider_button.h
+++ b/engines/titanic/gfx/slider_button.h
@@ -34,7 +34,7 @@ private:
 	int _field11C;
 	Point _pos1;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSliderButton();
 
 	/**
diff --git a/engines/titanic/gfx/small_chev_left_off.h b/engines/titanic/gfx/small_chev_left_off.h
index a164235..c3af9bb 100644
--- a/engines/titanic/gfx/small_chev_left_off.h
+++ b/engines/titanic/gfx/small_chev_left_off.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CSmallChevLeftOff : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSmallChevLeftOff();
 
 	/**
diff --git a/engines/titanic/gfx/small_chev_left_on.h b/engines/titanic/gfx/small_chev_left_on.h
index ab94147..4fcba62 100644
--- a/engines/titanic/gfx/small_chev_left_on.h
+++ b/engines/titanic/gfx/small_chev_left_on.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CSmallChevLeftOn : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSmallChevLeftOn();
 
 	/**
diff --git a/engines/titanic/gfx/small_chev_right_off.h b/engines/titanic/gfx/small_chev_right_off.h
index 3283eb2..f56cc83 100644
--- a/engines/titanic/gfx/small_chev_right_off.h
+++ b/engines/titanic/gfx/small_chev_right_off.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CSmallChevRightOff : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSmallChevRightOff();
 
 	/**
diff --git a/engines/titanic/gfx/small_chev_right_on.h b/engines/titanic/gfx/small_chev_right_on.h
index fe522c4..aeb9ce3 100644
--- a/engines/titanic/gfx/small_chev_right_on.h
+++ b/engines/titanic/gfx/small_chev_right_on.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CSmallChevRightOn : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSmallChevRightOn();
 
 	/**
diff --git a/engines/titanic/gfx/st_button.h b/engines/titanic/gfx/st_button.h
index b3bd5e8..6a8af1b 100644
--- a/engines/titanic/gfx/st_button.h
+++ b/engines/titanic/gfx/st_button.h
@@ -43,7 +43,7 @@ private:
 	CString _soundName;
 	int _buttonFrame;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSTButton();
 
 	/**
diff --git a/engines/titanic/gfx/status_change_button.h b/engines/titanic/gfx/status_change_button.h
index 818f21e..9e410c6 100644
--- a/engines/titanic/gfx/status_change_button.h
+++ b/engines/titanic/gfx/status_change_button.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CStatusChangeButton : public CSTButton {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CStatusChangeButton();
 
 	/**
diff --git a/engines/titanic/gfx/text_down.h b/engines/titanic/gfx/text_down.h
index 04805e7..5c924b8 100644
--- a/engines/titanic/gfx/text_down.h
+++ b/engines/titanic/gfx/text_down.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CTextDown : public CPetGraphic {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/text_skrew.h b/engines/titanic/gfx/text_skrew.h
index a932633..df90d95 100644
--- a/engines/titanic/gfx/text_skrew.h
+++ b/engines/titanic/gfx/text_skrew.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CTextSkrew : public CPetGraphic {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/text_up.h b/engines/titanic/gfx/text_up.h
index 19f150b..0e839e0 100644
--- a/engines/titanic/gfx/text_up.h
+++ b/engines/titanic/gfx/text_up.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CTextUp : public CPetGraphic {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/gfx/toggle_button.h b/engines/titanic/gfx/toggle_button.h
index b82e255..9eb6fdb 100644
--- a/engines/titanic/gfx/toggle_button.h
+++ b/engines/titanic/gfx/toggle_button.h
@@ -32,7 +32,7 @@ class CToggleButton : public CBackground {
 private:
 	int _fieldE0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CToggleButton() : CBackground(), _fieldE0(1) {}
 
 	/**
diff --git a/engines/titanic/gfx/toggle_switch.h b/engines/titanic/gfx/toggle_switch.h
index ce39fee..ae96c75 100644
--- a/engines/titanic/gfx/toggle_switch.h
+++ b/engines/titanic/gfx/toggle_switch.h
@@ -32,7 +32,7 @@ private:
 	int _fieldBC;
 	Point _pos1;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CToggleSwitch();
 
 	/**
diff --git a/engines/titanic/messages/auto_sound_event.h b/engines/titanic/messages/auto_sound_event.h
index 599404d..eb1c11c 100644
--- a/engines/titanic/messages/auto_sound_event.h
+++ b/engines/titanic/messages/auto_sound_event.h
@@ -32,7 +32,7 @@ public:
 	int _value1;
 	int _value2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CAutoSoundEvent();
 
 	/**
diff --git a/engines/titanic/messages/bilge_auto_sound_event.h b/engines/titanic/messages/bilge_auto_sound_event.h
index 5d32282..9a7fbd6 100644
--- a/engines/titanic/messages/bilge_auto_sound_event.h
+++ b/engines/titanic/messages/bilge_auto_sound_event.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CBilgeAutoSoundEvent : public CAutoSoundEvent {
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/messages/bilge_dispensor_event.h b/engines/titanic/messages/bilge_dispensor_event.h
index 8616373..96ef92a 100644
--- a/engines/titanic/messages/bilge_dispensor_event.h
+++ b/engines/titanic/messages/bilge_dispensor_event.h
@@ -31,7 +31,7 @@ namespace Titanic {
 class CBilgeDispensorEvent : public CAutoSoundEvent {
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/messages/door_auto_sound_event.h b/engines/titanic/messages/door_auto_sound_event.h
index 9b3ebbc..e6ea1b0 100644
--- a/engines/titanic/messages/door_auto_sound_event.h
+++ b/engines/titanic/messages/door_auto_sound_event.h
@@ -34,7 +34,7 @@ public:
 	int _fieldDC;
 	int _fieldE0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CDoorAutoSoundEvent() : CAutoSoundEvent(),
 		_string1("z#44.wav"), _string2("z#43.wav"), _fieldDC(25), _fieldE0(25) {
 	}
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 0fe6968..b7205df 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -38,7 +38,7 @@ enum MessageFlag {
 #define MESSAGE0(NAME) \
 	class NAME: public CMessage { \
 	public: NAME() : CMessage() {} \
-	CLASSDEF \
+	CLASSDEF; \
 	static bool isSupportedBy(const CTreeItem *item) { \
 		return supports(item, _type); } \
 }
@@ -47,7 +47,7 @@ enum MessageFlag {
 	public: F1 _##N1; \
 	NAME() : CMessage(), _##N1(V1) {} \
 	NAME(F1 N1) : CMessage(), _##N1(N1) {} \
-	CLASSDEF \
+	CLASSDEF; \
 	static bool isSupportedBy(const CTreeItem *item) { \
 		return supports(item, _type); } \
 }
@@ -56,7 +56,7 @@ enum MessageFlag {
 	public: F1 _##N1; F2 _##N2; \
 	NAME() : CMessage(), _##N1(V1), _##N2(V2) {} \
 	NAME(F1 N1, F2 N2) : CMessage(), _##N1(N1), _##N2(N2) {} \
-	CLASSDEF \
+	CLASSDEF; \
 	static bool isSupportedBy(const CTreeItem *item) { \
 		return supports(item, _type); } \
 }
@@ -65,7 +65,7 @@ enum MessageFlag {
 	public: F1 _##N1; F2 _##N2; F3 _##N3; \
 	NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3) {} \
 	NAME(F1 N1, F2 N2, F3 N3) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3) {} \
-	CLASSDEF \
+	CLASSDEF; \
 	static bool isSupportedBy(const CTreeItem *item) { \
 		return supports(item, _type); } \
 }
@@ -74,7 +74,7 @@ enum MessageFlag {
 	public: F1 _##N1; F2 _##N2; F3 _##N3; F4 _##N4; \
 	NAME() : CMessage(), _##N1(V1), _##N2(V2), _##N3(V3), _##N4(V4) {} \
 	NAME(F1 N1, F2 N2, F3 N3, F4 N4) : CMessage(), _##N1(N1), _##N2(N2), _##N3(N3), _##N4(N4) {} \
-	CLASSDEF \
+	CLASSDEF; \
 	static bool isSupportedBy(const CTreeItem *item) { \
 		return supports(item, _type); } \
 }
@@ -93,7 +93,7 @@ private:
 	 */
 	static const MSGMAP_ENTRY *findMapEntry(const CTreeItem *treeItem, const ClassDef *classDef);
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMessage();
 
 	/**
@@ -155,7 +155,7 @@ public:
 	int _field1C;
 	int _field20;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEditControlMsg() : _field4(0), _field8(0), _field18(0),
 		_field1C(0), _field20(0) {}
 
@@ -171,7 +171,7 @@ public:
 	int _fieldC;
 	int _field10;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CLightsMsg() : CMessage(), _field4(0), _field8(0),
 		_fieldC(0), _field10(0) {}
 
@@ -188,7 +188,7 @@ public:
 	int _actionVal;
 	CString _action;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CTimerMsg() : CTimeMsg(), _timerCtr(0), _actionVal(0) {}
 	CTimerMsg(uint ticks, uint timerCtr, int actionVal, const CString &action) :
 		CTimeMsg(ticks), _timerCtr(timerCtr), _actionVal(actionVal), _action(action) {}
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 8d5aa8b..d17bd51 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -35,7 +35,7 @@ public:
 	int _buttons;
 	Point _mousePos;
 public:
-	CLASSDEF
+	CLASSDEF;
 	static bool isSupportedBy(const CTreeItem *item) {
 		return supports(item, _type);
 	}
@@ -47,7 +47,7 @@ public:
 
 class CMouseMoveMsg : public CMouseMsg {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMouseMoveMsg() : CMouseMsg() {}
 	CMouseMoveMsg(const Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
 
@@ -60,7 +60,7 @@ class CMouseButtonMsg : public CMouseMsg {
 public:
 	int _field10;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMouseButtonMsg() : CMouseMsg(), _field10(0) {}
 	CMouseButtonMsg(const Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
 
@@ -71,7 +71,7 @@ public:
 
 class CMouseButtonDownMsg : public CMouseButtonMsg {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMouseButtonDownMsg() : CMouseButtonMsg() {}
 	CMouseButtonDownMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
@@ -87,7 +87,7 @@ public:
 
 class CMouseButtonUpMsg : public CMouseButtonMsg {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMouseButtonUpMsg() : CMouseButtonMsg() {}
 	CMouseButtonUpMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
@@ -103,7 +103,7 @@ public:
 
 class CMouseDoubleClickMsg : public CMouseButtonMsg {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMouseDoubleClickMsg() : CMouseButtonMsg() {}
 	CMouseDoubleClickMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
 
@@ -114,7 +114,7 @@ public:
 
 class CMouseDragMsg : public CMouseMsg {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMouseDragMsg() : CMouseMsg() {}
 	CMouseDragMsg(const Point &pt) : CMouseMsg(pt, 0) {}
 
@@ -125,7 +125,7 @@ public:
 
 class CMouseDragMoveMsg : public CMouseDragMsg {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMouseDragMoveMsg() : CMouseDragMsg() {}
 	CMouseDragMoveMsg(const Point &pt) : CMouseDragMsg(pt) {}
 
@@ -139,7 +139,7 @@ public:
 	CTreeItem *_dragItem;
 	bool _handled;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMouseDragStartMsg() : CMouseDragMsg(), _dragItem(nullptr), _handled(false) {}
 	CMouseDragStartMsg(const Point &pt) : CMouseDragMsg(pt),
 		_dragItem(nullptr), _handled(false) {}
@@ -155,7 +155,7 @@ public:
 	int _value3;
 	int _value4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPassOnDragStartMsg() : CMessage() {}
 	CPassOnDragStartMsg(const Point &pt, int v3 = 0, int v4 = 0) : 
 		CMessage(), _mousePos(pt), _value3(v3), _value4(v4) {}
@@ -169,7 +169,7 @@ class CMouseDragEndMsg : public CMouseDragMsg {
 public:
 	CGameObject *_dropTarget;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMouseDragEndMsg() : CMouseDragMsg(), _dropTarget(nullptr) {}
 	CMouseDragEndMsg(const Point &pt, CGameObject *dropTarget = nullptr) :
 		CMouseDragMsg(pt), _dropTarget(dropTarget) {}
diff --git a/engines/titanic/messages/pet_messages.h b/engines/titanic/messages/pet_messages.h
index f7d9c30..48e5bab 100644
--- a/engines/titanic/messages/pet_messages.h
+++ b/engines/titanic/messages/pet_messages.h
@@ -47,7 +47,7 @@ MESSAGE2(CPETTargetMsg, CString, name, "", int, numValue, -1);
 	public: \
 	NAME() : CPETTargetMsg() {} \
 	NAME(const CString &name, int num) : CPETTargetMsg(name, num) {} \
-	CLASSDEF \
+	CLASSDEF; \
 	static bool isSupportedBy(const CTreeItem *item) { \
 		return supports(item, _type); \
 	} \
diff --git a/engines/titanic/messages/service_elevator_door.h b/engines/titanic/messages/service_elevator_door.h
index 104b573..cc8da09 100644
--- a/engines/titanic/messages/service_elevator_door.h
+++ b/engines/titanic/messages/service_elevator_door.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CServiceElevatorDoor : public CDoorAutoSoundEvent {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CServiceElevatorDoor();
 
 	/**
diff --git a/engines/titanic/moves/enter_bomb_room.h b/engines/titanic/moves/enter_bomb_room.h
index d49b176..7fe8287 100644
--- a/engines/titanic/moves/enter_bomb_room.h
+++ b/engines/titanic/moves/enter_bomb_room.h
@@ -31,7 +31,7 @@ class CEnterBombRoom : public CMovePlayerTo {
 protected:
 	int _fieldC8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEnterBombRoom();
 
 	/**
diff --git a/engines/titanic/moves/enter_bridge.h b/engines/titanic/moves/enter_bridge.h
index 86cc2f3..a2410a6 100644
--- a/engines/titanic/moves/enter_bridge.h
+++ b/engines/titanic/moves/enter_bridge.h
@@ -33,7 +33,7 @@ class CEnterBridge : public CGameObject {
 private:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEnterBridge() : CGameObject(), _value(1) {}
 
 	/**
diff --git a/engines/titanic/moves/enter_exit_first_class_state.h b/engines/titanic/moves/enter_exit_first_class_state.h
index 2038084..a08de07 100644
--- a/engines/titanic/moves/enter_exit_first_class_state.h
+++ b/engines/titanic/moves/enter_exit_first_class_state.h
@@ -41,7 +41,7 @@ public:
 	 */
 	static void deinit();
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/moves/enter_exit_mini_lift.h b/engines/titanic/moves/enter_exit_mini_lift.h
index e973cf8..26f3dba 100644
--- a/engines/titanic/moves/enter_exit_mini_lift.h
+++ b/engines/titanic/moves/enter_exit_mini_lift.h
@@ -32,7 +32,7 @@ private:
 	int _fieldBC;
 	int _fieldC0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEnterExitMiniLift() : CSGTNavigation(), _fieldBC(0), _fieldC0(1) {}
 
 	/**
diff --git a/engines/titanic/moves/enter_exit_sec_class_mini_lift.h b/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
index 935dfb7..10c7edc 100644
--- a/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
+++ b/engines/titanic/moves/enter_exit_sec_class_mini_lift.h
@@ -39,7 +39,7 @@ private:
 	static CEnterExitSecClassMiniLiftStatics *_statics;
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEnterExitSecClassMiniLift() : CGameObject(), _value(0) {}
 	static void init();
 	static void deinit();
diff --git a/engines/titanic/moves/enter_exit_view.h b/engines/titanic/moves/enter_exit_view.h
index 774c72e..4a3f1a9 100644
--- a/engines/titanic/moves/enter_exit_view.h
+++ b/engines/titanic/moves/enter_exit_view.h
@@ -35,7 +35,7 @@ public:
 	int _fieldC8;
 	int _fieldCC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEnterExitView();
 
 	/**
diff --git a/engines/titanic/moves/enter_sec_class_state.h b/engines/titanic/moves/enter_sec_class_state.h
index 3eadfa2..c3e3cab 100644
--- a/engines/titanic/moves/enter_sec_class_state.h
+++ b/engines/titanic/moves/enter_sec_class_state.h
@@ -31,7 +31,7 @@ class CEnterSecClassState : public CGameObject {
 public:
 	int _value1, _value2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEnterSecClassState() : CGameObject(), _value1(0), _value2(0) {}
 
 	/**
diff --git a/engines/titanic/moves/exit_arboretum.h b/engines/titanic/moves/exit_arboretum.h
index a20cf46..f6ebf71 100644
--- a/engines/titanic/moves/exit_arboretum.h
+++ b/engines/titanic/moves/exit_arboretum.h
@@ -33,7 +33,7 @@ protected:
 	int _fieldCC;
 	int _fieldD0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CExitArboretum();
 
 	/**
diff --git a/engines/titanic/moves/exit_bridge.h b/engines/titanic/moves/exit_bridge.h
index b5fcd9a..4ab2952 100644
--- a/engines/titanic/moves/exit_bridge.h
+++ b/engines/titanic/moves/exit_bridge.h
@@ -31,7 +31,7 @@ class CExitBridge : public CMovePlayerTo {
 private:
 	CString _string1;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CExitBridge();
 
 	/**
diff --git a/engines/titanic/moves/exit_lift.h b/engines/titanic/moves/exit_lift.h
index 6144d43..04dabfa 100644
--- a/engines/titanic/moves/exit_lift.h
+++ b/engines/titanic/moves/exit_lift.h
@@ -31,7 +31,7 @@ class CExitLift : public CGameObject {
 public:
 	CString _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/moves/exit_pellerator.h b/engines/titanic/moves/exit_pellerator.h
index 3610831..280d1e9 100644
--- a/engines/titanic/moves/exit_pellerator.h
+++ b/engines/titanic/moves/exit_pellerator.h
@@ -37,7 +37,7 @@ class CExitPellerator : public CGameObject {
 private:
 	static CExitPelleratorStatics *_statics;
 public:
-	CLASSDEF
+	CLASSDEF;
 	static void init();
 	static void deinit();
 
diff --git a/engines/titanic/moves/exit_state_room.h b/engines/titanic/moves/exit_state_room.h
index ac94297..c0f9737 100644
--- a/engines/titanic/moves/exit_state_room.h
+++ b/engines/titanic/moves/exit_state_room.h
@@ -31,7 +31,7 @@ class CExitStateRoom : public CMovePlayerTo {
 protected:
 	int _fieldC8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CExitStateRoom();
 
 	/**
diff --git a/engines/titanic/moves/exit_tiania.h b/engines/titanic/moves/exit_tiania.h
index 6ae3bc8..c2b7772 100644
--- a/engines/titanic/moves/exit_tiania.h
+++ b/engines/titanic/moves/exit_tiania.h
@@ -34,7 +34,7 @@ private:
 	CString _string2;
 	CString _string3;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CExitTiania();
 
 	/**
diff --git a/engines/titanic/moves/move_player_in_parrot_room.h b/engines/titanic/moves/move_player_in_parrot_room.h
index cdb0007..de693fe 100644
--- a/engines/titanic/moves/move_player_in_parrot_room.h
+++ b/engines/titanic/moves/move_player_in_parrot_room.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CMovePlayerInParrotRoom : public CMovePlayerTo {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMovePlayerInParrotRoom();
 
 	/**
diff --git a/engines/titanic/moves/move_player_to.h b/engines/titanic/moves/move_player_to.h
index 890c822..4bfffcb 100644
--- a/engines/titanic/moves/move_player_to.h
+++ b/engines/titanic/moves/move_player_to.h
@@ -31,7 +31,7 @@ class CMovePlayerTo : public CGameObject {
 protected:
 	CString _destination;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMovePlayerTo();
 
 	/**
diff --git a/engines/titanic/moves/move_player_to_from.h b/engines/titanic/moves/move_player_to_from.h
index 14c6e3a..c9eefe5 100644
--- a/engines/titanic/moves/move_player_to_from.h
+++ b/engines/titanic/moves/move_player_to_from.h
@@ -31,7 +31,7 @@ class CMovePlayerToFrom : public CGameObject {
 private:
 	CString _string2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMovePlayerToFrom();
 
 	/**
diff --git a/engines/titanic/moves/multi_move.h b/engines/titanic/moves/multi_move.h
index a18eb76..977afc2 100644
--- a/engines/titanic/moves/multi_move.h
+++ b/engines/titanic/moves/multi_move.h
@@ -35,7 +35,7 @@ private:
 	CString _string4;
 	CString _string5;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMultiMove();
 
 	/**
diff --git a/engines/titanic/moves/pan_from_pel.h b/engines/titanic/moves/pan_from_pel.h
index 936bac8..c81be9f 100644
--- a/engines/titanic/moves/pan_from_pel.h
+++ b/engines/titanic/moves/pan_from_pel.h
@@ -32,7 +32,7 @@ protected:
 	int _fieldC8;
 	CString _string1;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPanFromPel();
 
 	/**
diff --git a/engines/titanic/moves/restaurant_pan_handler.h b/engines/titanic/moves/restaurant_pan_handler.h
index 2caf286..4925aa6 100644
--- a/engines/titanic/moves/restaurant_pan_handler.h
+++ b/engines/titanic/moves/restaurant_pan_handler.h
@@ -34,7 +34,7 @@ protected:
 	CString _string1;
 	CString _string2;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/moves/restricted_move.h b/engines/titanic/moves/restricted_move.h
index 59ff69f..bdf093c 100644
--- a/engines/titanic/moves/restricted_move.h
+++ b/engines/titanic/moves/restricted_move.h
@@ -31,7 +31,7 @@ class CRestrictedMove : public CMovePlayerTo {
 protected:
 	int _fieldC8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CRestrictedMove();
 
 	/**
diff --git a/engines/titanic/moves/scraliontis_table.h b/engines/titanic/moves/scraliontis_table.h
index a1b8052..2ce3745 100644
--- a/engines/titanic/moves/scraliontis_table.h
+++ b/engines/titanic/moves/scraliontis_table.h
@@ -34,7 +34,7 @@ private:
 	int _fieldE8;
 	int _fieldEC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CScraliontisTable();
 
 	/**
diff --git a/engines/titanic/moves/trip_down_canal.h b/engines/titanic/moves/trip_down_canal.h
index debe064..736caf4 100644
--- a/engines/titanic/moves/trip_down_canal.h
+++ b/engines/titanic/moves/trip_down_canal.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class CTripDownCanal : public CMovePlayerTo {
 public:
-	CLASSDEF
+	CLASSDEF;
 	CTripDownCanal();
 
 	/**
diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h
index 27a091e..7557fdd 100644
--- a/engines/titanic/npcs/barbot.h
+++ b/engines/titanic/npcs/barbot.h
@@ -175,7 +175,7 @@ private:
 	int _field33C;
 	int _field340;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBarbot();
 
 	/**
diff --git a/engines/titanic/npcs/bellbot.h b/engines/titanic/npcs/bellbot.h
index 6be0615..93c4a28 100644
--- a/engines/titanic/npcs/bellbot.h
+++ b/engines/titanic/npcs/bellbot.h
@@ -31,7 +31,7 @@ class CBellBot : public CTrueTalkNPC {
 private:
 	int _field108;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBellBot();
 
 	/**
diff --git a/engines/titanic/npcs/callbot.h b/engines/titanic/npcs/callbot.h
index 6848121..9b89d59 100644
--- a/engines/titanic/npcs/callbot.h
+++ b/engines/titanic/npcs/callbot.h
@@ -32,7 +32,7 @@ protected:
 	CString _string1;
 	int _fieldC8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CCallBot();
 
 	/**
diff --git a/engines/titanic/npcs/character.h b/engines/titanic/npcs/character.h
index 2362f01..6f3de9a 100644
--- a/engines/titanic/npcs/character.h
+++ b/engines/titanic/npcs/character.h
@@ -38,7 +38,7 @@ protected:
 	int _fieldC4;
 	CString _charName;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CCharacter();
 
 	/**
diff --git a/engines/titanic/npcs/deskbot.h b/engines/titanic/npcs/deskbot.h
index ff54599..e900781 100644
--- a/engines/titanic/npcs/deskbot.h
+++ b/engines/titanic/npcs/deskbot.h
@@ -47,7 +47,7 @@ public:
 	bool _deskbotActive;
 	int _classNum;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CDeskbot();
 
 	/**
diff --git a/engines/titanic/npcs/doorbot.h b/engines/titanic/npcs/doorbot.h
index 9ea7de6..b62026c 100644
--- a/engines/titanic/npcs/doorbot.h
+++ b/engines/titanic/npcs/doorbot.h
@@ -37,7 +37,7 @@ private:
 	int _field110;
 	int _field114;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CDoorbot();
 
 	/**
diff --git a/engines/titanic/npcs/liftbot.h b/engines/titanic/npcs/liftbot.h
index e993da0..7550a8a 100644
--- a/engines/titanic/npcs/liftbot.h
+++ b/engines/titanic/npcs/liftbot.h
@@ -36,7 +36,7 @@ private:
 private:
 	int _field108;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CLiftBot();
 
 	/**
diff --git a/engines/titanic/npcs/maitre_d.h b/engines/titanic/npcs/maitre_d.h
index 6a63348..af73f02 100644
--- a/engines/titanic/npcs/maitre_d.h
+++ b/engines/titanic/npcs/maitre_d.h
@@ -41,7 +41,7 @@ private:
 	int _field134;
 	int _field138;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMaitreD();
 
 	/**
diff --git a/engines/titanic/npcs/mobile.h b/engines/titanic/npcs/mobile.h
index 42effc6..f9b3955 100644
--- a/engines/titanic/npcs/mobile.h
+++ b/engines/titanic/npcs/mobile.h
@@ -33,7 +33,7 @@ private:
 	Point _pos1;
 	int _fieldDC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMobile();
 
 	/**
diff --git a/engines/titanic/npcs/parrot.h b/engines/titanic/npcs/parrot.h
index 010d9af..a3c8540 100644
--- a/engines/titanic/npcs/parrot.h
+++ b/engines/titanic/npcs/parrot.h
@@ -92,7 +92,7 @@ private:
 	int _field1E8;
 	int _field1EC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CParrot();
 
 	/**
diff --git a/engines/titanic/npcs/robot_controller.h b/engines/titanic/npcs/robot_controller.h
index 54b0a20..6cbf57a 100644
--- a/engines/titanic/npcs/robot_controller.h
+++ b/engines/titanic/npcs/robot_controller.h
@@ -31,7 +31,7 @@ class CRobotController : public CGameObject {
 protected:
 	CString _string1;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CRobotController();
 
 	/**
diff --git a/engines/titanic/npcs/starlings.h b/engines/titanic/npcs/starlings.h
index 40cb1b8..4d96e5c 100644
--- a/engines/titanic/npcs/starlings.h
+++ b/engines/titanic/npcs/starlings.h
@@ -31,7 +31,7 @@ class CStarlings : public CCharacter {
 private:
 	static int _v1;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CStarlings();
 
 	/**
diff --git a/engines/titanic/npcs/succubus.h b/engines/titanic/npcs/succubus.h
index a78a88b..f6f5a6b 100644
--- a/engines/titanic/npcs/succubus.h
+++ b/engines/titanic/npcs/succubus.h
@@ -87,7 +87,7 @@ private:
 	int _field1D4;
 	int _field1D8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSuccUBus();
 
 	/**
diff --git a/engines/titanic/npcs/summon_bots.h b/engines/titanic/npcs/summon_bots.h
index 245d047..ee537fe 100644
--- a/engines/titanic/npcs/summon_bots.h
+++ b/engines/titanic/npcs/summon_bots.h
@@ -33,7 +33,7 @@ protected:
 	int _fieldC8;
 	int _fieldCC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSummonBots();
 
 	/**
diff --git a/engines/titanic/npcs/titania.h b/engines/titanic/npcs/titania.h
index 3eb95c0..4edd626 100644
--- a/engines/titanic/npcs/titania.h
+++ b/engines/titanic/npcs/titania.h
@@ -42,7 +42,7 @@ private:
 	int _fieldFC;
 	int _field100;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CTitania();
 
 	/**
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index 7202f25..cece8ed 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -78,7 +78,7 @@ protected:
 	 */
 	void performAction(bool startTalking, CViewItem *view);
 public:
-	CLASSDEF
+	CLASSDEF;
 	CTrueTalkNPC();
 
 	/**
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 39df91c..468c4f3 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -122,7 +122,7 @@ public:
 	CTreeItem *_activeNPC;
 	CGameObject *_remoteTarget;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPetControl();
 
 	/**
diff --git a/engines/titanic/pet_control/pet_drag_chev.h b/engines/titanic/pet_control/pet_drag_chev.h
index 1ca9788..153b954 100644
--- a/engines/titanic/pet_control/pet_drag_chev.h
+++ b/engines/titanic/pet_control/pet_drag_chev.h
@@ -34,7 +34,7 @@ protected:
 	bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
 	bool MouseDragEndMsg(CMouseDragEndMsg *msg);
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/pet_control/pet_graphic.h b/engines/titanic/pet_control/pet_graphic.h
index 34badfd..082a27f 100644
--- a/engines/titanic/pet_control/pet_graphic.h
+++ b/engines/titanic/pet_control/pet_graphic.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CPetGraphic : public CGameObject {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/pet_control/pet_graphic2.h b/engines/titanic/pet_control/pet_graphic2.h
index 4e77662..6b832fe 100644
--- a/engines/titanic/pet_control/pet_graphic2.h
+++ b/engines/titanic/pet_control/pet_graphic2.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CPetGraphic2 : public CGameObject {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/pet_control/pet_leaf.h b/engines/titanic/pet_control/pet_leaf.h
index 0d18742..8428647 100644
--- a/engines/titanic/pet_control/pet_leaf.h
+++ b/engines/titanic/pet_control/pet_leaf.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class PETLeaf : public CGameObject {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/pet_control/pet_mode_off.h b/engines/titanic/pet_control/pet_mode_off.h
index 0a4851a..a906bc6 100644
--- a/engines/titanic/pet_control/pet_mode_off.h
+++ b/engines/titanic/pet_control/pet_mode_off.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CPetModeOff : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPetModeOff();
 
 	/**
diff --git a/engines/titanic/pet_control/pet_mode_on.h b/engines/titanic/pet_control/pet_mode_on.h
index d33a0d2..074e33e 100644
--- a/engines/titanic/pet_control/pet_mode_on.h
+++ b/engines/titanic/pet_control/pet_mode_on.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CPetModeOn : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPetModeOn();
 
 	/**
diff --git a/engines/titanic/pet_control/pet_mode_panel.h b/engines/titanic/pet_control/pet_mode_panel.h
index 17ce48d..0812c11 100644
--- a/engines/titanic/pet_control/pet_mode_panel.h
+++ b/engines/titanic/pet_control/pet_mode_panel.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CPetModePanel : public CToggleSwitch {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 	CPetModePanel();
 
 	/**
diff --git a/engines/titanic/pet_control/pet_pannel1.h b/engines/titanic/pet_control/pet_pannel1.h
index c81d451..7ca7378 100644
--- a/engines/titanic/pet_control/pet_pannel1.h
+++ b/engines/titanic/pet_control/pet_pannel1.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CPetPannel1 : public CPetGraphic {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/pet_control/pet_pannel2.h b/engines/titanic/pet_control/pet_pannel2.h
index 404dd88..62dd2aa 100644
--- a/engines/titanic/pet_control/pet_pannel2.h
+++ b/engines/titanic/pet_control/pet_pannel2.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CPetPannel2 : public CPetGraphic {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/pet_control/pet_pannel3.h b/engines/titanic/pet_control/pet_pannel3.h
index addf614..2acf269 100644
--- a/engines/titanic/pet_control/pet_pannel3.h
+++ b/engines/titanic/pet_control/pet_pannel3.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CPetPannel3 : public CPetGraphic {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/auto_music_player.h b/engines/titanic/sound/auto_music_player.h
index 5d9bb0f..e9e9763 100644
--- a/engines/titanic/sound/auto_music_player.h
+++ b/engines/titanic/sound/auto_music_player.h
@@ -33,7 +33,7 @@ class CAutoMusicPlayer : public CAutoMusicPlayerBase {
 private:
 	CString _string2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CAutoMusicPlayer();
 
 	/**
diff --git a/engines/titanic/sound/auto_music_player_base.h b/engines/titanic/sound/auto_music_player_base.h
index d6d9926..657c527 100644
--- a/engines/titanic/sound/auto_music_player_base.h
+++ b/engines/titanic/sound/auto_music_player_base.h
@@ -35,7 +35,7 @@ protected:
 	int _fieldD0;
 	int _fieldD4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CAutoMusicPlayerBase();
 
 	/**
diff --git a/engines/titanic/sound/auto_sound_player.h b/engines/titanic/sound/auto_sound_player.h
index b85bb68..6de2b12 100644
--- a/engines/titanic/sound/auto_sound_player.h
+++ b/engines/titanic/sound/auto_sound_player.h
@@ -40,7 +40,7 @@ public:
 	int _fieldE4;
 	int _fieldE8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CAutoSoundPlayer();
 
 	/**
diff --git a/engines/titanic/sound/auto_sound_player_adsr.h b/engines/titanic/sound/auto_sound_player_adsr.h
index 9dd9ec5..6dc2853 100644
--- a/engines/titanic/sound/auto_sound_player_adsr.h
+++ b/engines/titanic/sound/auto_sound_player_adsr.h
@@ -33,7 +33,7 @@ private:
 	CString _string3;
 	CString _string4;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/background_sound_maker.h b/engines/titanic/sound/background_sound_maker.h
index 32fb50b..022d8f4 100644
--- a/engines/titanic/sound/background_sound_maker.h
+++ b/engines/titanic/sound/background_sound_maker.h
@@ -31,7 +31,7 @@ class CBackgroundSoundMaker : public CGameObject {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBackgroundSoundMaker() : CGameObject(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/sound/bird_song.h b/engines/titanic/sound/bird_song.h
index 1b1e309..35758e5 100644
--- a/engines/titanic/sound/bird_song.h
+++ b/engines/titanic/sound/bird_song.h
@@ -31,7 +31,7 @@ class CBirdSong : public CRoomAutoSoundPlayer {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CBirdSong() : CRoomAutoSoundPlayer(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/sound/dome_from_top_of_well.h b/engines/titanic/sound/dome_from_top_of_well.h
index 62c97da..fba7168 100644
--- a/engines/titanic/sound/dome_from_top_of_well.h
+++ b/engines/titanic/sound/dome_from_top_of_well.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class CDomeFromTopOfWell : public CViewAutoSoundPlayer {
 	DECLARE_MESSAGE_MAP
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/enter_view_toggles_other_music.h b/engines/titanic/sound/enter_view_toggles_other_music.h
index adcf3df..6bbeea4 100644
--- a/engines/titanic/sound/enter_view_toggles_other_music.h
+++ b/engines/titanic/sound/enter_view_toggles_other_music.h
@@ -31,7 +31,7 @@ class CEnterViewTogglesOtherMusic : public CTriggerAutoMusicPlayer {
 protected:
 	int _fieldC8;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CEnterViewTogglesOtherMusic();
 
 	/**
diff --git a/engines/titanic/sound/gondolier_song.h b/engines/titanic/sound/gondolier_song.h
index 710cd96..0a7120c 100644
--- a/engines/titanic/sound/gondolier_song.h
+++ b/engines/titanic/sound/gondolier_song.h
@@ -31,7 +31,7 @@ class CGondolierSong : public CRoomAutoSoundPlayer {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CGondolierSong() : CRoomAutoSoundPlayer(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/sound/music_player.h b/engines/titanic/sound/music_player.h
index fa877ec..a2c495d 100644
--- a/engines/titanic/sound/music_player.h
+++ b/engines/titanic/sound/music_player.h
@@ -36,7 +36,7 @@ protected:
 	int _fieldCC;
 	int _fieldD0;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMusicPlayer() : CGameObject(),
 		_fieldBC(0), _fieldCC(0), _fieldD0(100) {}
 
diff --git a/engines/titanic/sound/node_auto_sound_player.h b/engines/titanic/sound/node_auto_sound_player.h
index 06322f8..e980841 100644
--- a/engines/titanic/sound/node_auto_sound_player.h
+++ b/engines/titanic/sound/node_auto_sound_player.h
@@ -33,7 +33,7 @@ class CNodeAutoSoundPlayer : public CAutoSoundPlayer {
 private:
 	int _fieldEC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CNodeAutoSoundPlayer() : CAutoSoundPlayer(), _fieldEC(1) {}
 
 	/**
diff --git a/engines/titanic/sound/restricted_auto_music_player.h b/engines/titanic/sound/restricted_auto_music_player.h
index be40bd8..4a26d37 100644
--- a/engines/titanic/sound/restricted_auto_music_player.h
+++ b/engines/titanic/sound/restricted_auto_music_player.h
@@ -36,7 +36,7 @@ private:
 	CString _string5;
 	CString _string6;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/room_auto_sound_player.h b/engines/titanic/sound/room_auto_sound_player.h
index 8b5fc86..9c3feb5 100644
--- a/engines/titanic/sound/room_auto_sound_player.h
+++ b/engines/titanic/sound/room_auto_sound_player.h
@@ -31,7 +31,7 @@ namespace Titanic {
 class CRoomAutoSoundPlayer : public CAutoSoundPlayer {
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/room_trigger_auto_music_player.h b/engines/titanic/sound/room_trigger_auto_music_player.h
index da378a3..250adad 100644
--- a/engines/titanic/sound/room_trigger_auto_music_player.h
+++ b/engines/titanic/sound/room_trigger_auto_music_player.h
@@ -31,7 +31,7 @@ namespace Titanic {
 class CRoomTriggerAutoMusicPlayer : public CTriggerAutoMusicPlayer {
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/season_noises.h b/engines/titanic/sound/season_noises.h
index 6d65de8..ff39b01 100644
--- a/engines/titanic/sound/season_noises.h
+++ b/engines/titanic/sound/season_noises.h
@@ -35,7 +35,7 @@ private:
 	CString _string4;
 	CString _string5;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSeasonNoises();
 
 	/**
diff --git a/engines/titanic/sound/seasonal_music_player.h b/engines/titanic/sound/seasonal_music_player.h
index 3c434ec..30c296d 100644
--- a/engines/titanic/sound/seasonal_music_player.h
+++ b/engines/titanic/sound/seasonal_music_player.h
@@ -38,7 +38,7 @@ private:
 	int _fieldF0;
 	int _fieldF4;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CSeasonalMusicPlayer();
 
 	/**
diff --git a/engines/titanic/sound/titania_speech.h b/engines/titanic/sound/titania_speech.h
index 1ff52be..c9b9304 100644
--- a/engines/titanic/sound/titania_speech.h
+++ b/engines/titanic/sound/titania_speech.h
@@ -33,7 +33,7 @@ class CTitaniaSpeech : public CGameObject {
 private:
 	int _value1, _value2;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CTitaniaSpeech() : CGameObject(), _value1(1), _value2(0) {}
 
 	/**
diff --git a/engines/titanic/sound/trigger_auto_music_player.h b/engines/titanic/sound/trigger_auto_music_player.h
index 11c0966..537e780 100644
--- a/engines/titanic/sound/trigger_auto_music_player.h
+++ b/engines/titanic/sound/trigger_auto_music_player.h
@@ -31,7 +31,7 @@ class CTriggerAutoMusicPlayer : public CGameObject {
 protected:
 	CString _fieldBC;
 public:
-	CLASSDEF
+	CLASSDEF;
 
 	/**
 	 * Save the data for the class to file
diff --git a/engines/titanic/sound/view_auto_sound_player.h b/engines/titanic/sound/view_auto_sound_player.h
index dab9667..29bdee7 100644
--- a/engines/titanic/sound/view_auto_sound_player.h
+++ b/engines/titanic/sound/view_auto_sound_player.h
@@ -31,7 +31,7 @@ class CViewAutoSoundPlayer : public CAutoSoundPlayer {
 private:
 	int _fieldEC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CViewAutoSoundPlayer() : CAutoSoundPlayer(), _fieldEC(0) {}
 
 	/**
diff --git a/engines/titanic/sound/view_toggles_other_music.h b/engines/titanic/sound/view_toggles_other_music.h
index f97f690..a5ba68b 100644
--- a/engines/titanic/sound/view_toggles_other_music.h
+++ b/engines/titanic/sound/view_toggles_other_music.h
@@ -31,7 +31,7 @@ class CViewTogglesOtherMusic : public CEnterViewTogglesOtherMusic {
 private:
 	int _fieldCC;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CViewTogglesOtherMusic();
 
 	/**
diff --git a/engines/titanic/sound/water_lapping_sounds.h b/engines/titanic/sound/water_lapping_sounds.h
index 7fc7cc4..d7017d2 100644
--- a/engines/titanic/sound/water_lapping_sounds.h
+++ b/engines/titanic/sound/water_lapping_sounds.h
@@ -32,7 +32,7 @@ class CWaterLappingSounds : public CRoomAutoSoundPlayer {
 public:
 	int _value;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CWaterLappingSounds() : CRoomAutoSoundPlayer(), _value(0) {}
 
 	/**
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index 2f6a86a..f5f0af2 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -47,7 +47,7 @@ private:
 	 */
 	void newFrame();
 public:
-	CLASSDEF
+	CLASSDEF;
 	CStarControl();
 	virtual ~CStarControl();
 
diff --git a/engines/titanic/support/movie_clip.h b/engines/titanic/support/movie_clip.h
index 813996b..513ed4a 100644
--- a/engines/titanic/support/movie_clip.h
+++ b/engines/titanic/support/movie_clip.h
@@ -49,7 +49,7 @@ public:
 	int _startFrame;
 	int _endFrame;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CMovieClip();
 	CMovieClip(const CString &name, int startFrame, int endFrame);
 
diff --git a/engines/titanic/support/time_event_info.h b/engines/titanic/support/time_event_info.h
index ee787bc..ebf5b54 100644
--- a/engines/titanic/support/time_event_info.h
+++ b/engines/titanic/support/time_event_info.h
@@ -62,7 +62,7 @@ public:
 	bool _persisent;
 	CString _targetName;
 public:
-	CLASSDEF
+	CLASSDEF;
 	CTimeEventInfo();
 	CTimeEventInfo(uint ticks, bool repeated, uint firstDuration, uint repeatDuration,
 		CTreeItem *target, int endVal, const CString &action);


Commit: c6e2f4e68020dddea2a8248e8dd7ecdcb2147314
    https://github.com/scummvm/scummvm/commit/c6e2f4e68020dddea2a8248e8dd7ecdcb2147314
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T20:48:44-04:00

Commit Message:
TITANIC: gcc compilation fix

Changed paths:
    engines/titanic/core/message_target.h



diff --git a/engines/titanic/core/message_target.h b/engines/titanic/core/message_target.h
index 05ceaad..0afd847 100644
--- a/engines/titanic/core/message_target.h
+++ b/engines/titanic/core/message_target.h
@@ -81,7 +81,7 @@ protected: \
 		{ &TheBaseClass::getThisMessageMap, &_messageEntries[0] }; \
 		return &messageMap; \
 	} \
-	static const int DUMMY
+	static const int DUMMY = 0
 
 class CMessageTarget: public CSaveableObject {
 	DECLARE_MESSAGE_MAP


Commit: 875002daea7a007c2727685a767eaaf3709a5252
    https://github.com/scummvm/scummvm/commit/875002daea7a007c2727685a767eaaf3709a5252
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T20:52:21-04:00

Commit Message:
TITANIC: Add semicolon to DECLARE_MESSAGE_MAP usage

Changed paths:
    engines/titanic/carry/arm.h
    engines/titanic/carry/brain.h
    engines/titanic/carry/bridge_piece.h
    engines/titanic/carry/carry.h
    engines/titanic/carry/carry_parrot.h
    engines/titanic/carry/chicken.h
    engines/titanic/carry/crushed_tv.h
    engines/titanic/carry/feathers.h
    engines/titanic/carry/hose_end.h
    engines/titanic/carry/magazine.h
    engines/titanic/carry/napkin.h
    engines/titanic/carry/note.h
    engines/titanic/carry/parcel.h
    engines/titanic/carry/phonograph_cylinder.h
    engines/titanic/carry/photograph.h
    engines/titanic/carry/plug_in.h
    engines/titanic/carry/sweets.h
    engines/titanic/core/background.h
    engines/titanic/core/dont_save_file_item.h
    engines/titanic/core/file_item.h
    engines/titanic/core/game_object.h
    engines/titanic/core/link_item.h
    engines/titanic/core/message_target.h
    engines/titanic/core/named_item.h
    engines/titanic/core/node_item.h
    engines/titanic/core/project_item.h
    engines/titanic/core/room_item.h
    engines/titanic/core/static_image.h
    engines/titanic/core/tree_item.h
    engines/titanic/core/turn_on_object.h
    engines/titanic/core/view_item.h
    engines/titanic/game/arb_background.h
    engines/titanic/game/arboretum_gate.h
    engines/titanic/game/broken_pell_base.h
    engines/titanic/game/cdrom.h
    engines/titanic/game/cdrom_computer.h
    engines/titanic/game/cdrom_tray.h
    engines/titanic/game/computer.h
    engines/titanic/game/computer_screen.h
    engines/titanic/game/dead_area.h
    engines/titanic/game/leave_sec_class_state.h
    engines/titanic/game/music_room_phonograph.h
    engines/titanic/game/musical_instrument.h
    engines/titanic/game/navigation_computer.h
    engines/titanic/game/null_port_hole.h
    engines/titanic/game/parrot/parrot_lobby_object.h
    engines/titanic/game/pet/pet_class1.h
    engines/titanic/game/pet/pet_class2.h
    engines/titanic/game/pet/pet_class3.h
    engines/titanic/game/pet/pet_monitor.h
    engines/titanic/game/pet/pet_position.h
    engines/titanic/game/pet/pet_transport.h
    engines/titanic/game/sgt/sgt_state_room.h
    engines/titanic/game/splash_animation.h
    engines/titanic/game/start_action.h
    engines/titanic/game/television.h
    engines/titanic/game/transport/lift.h
    engines/titanic/game/transport/lift_indicator.h
    engines/titanic/game/transport/pellerator.h
    engines/titanic/game/transport/transport.h
    engines/titanic/gfx/chev_left_off.h
    engines/titanic/gfx/chev_left_on.h
    engines/titanic/gfx/chev_right_off.h
    engines/titanic/gfx/chev_right_on.h
    engines/titanic/gfx/chev_send_rec_switch.h
    engines/titanic/gfx/elevator_button.h
    engines/titanic/gfx/get_from_succ.h
    engines/titanic/gfx/helmet_on_off.h
    engines/titanic/gfx/home_photo.h
    engines/titanic/gfx/icon_nav_action.h
    engines/titanic/gfx/icon_nav_butt.h
    engines/titanic/gfx/icon_nav_down.h
    engines/titanic/gfx/icon_nav_image.h
    engines/titanic/gfx/icon_nav_left.h
    engines/titanic/gfx/icon_nav_receive.h
    engines/titanic/gfx/icon_nav_right.h
    engines/titanic/gfx/icon_nav_send.h
    engines/titanic/gfx/icon_nav_up.h
    engines/titanic/gfx/keybrd_butt.h
    engines/titanic/gfx/music_slider.h
    engines/titanic/gfx/music_switch.h
    engines/titanic/gfx/send_to_succ.h
    engines/titanic/gfx/sgt_selector.h
    engines/titanic/gfx/small_chev_left_off.h
    engines/titanic/gfx/small_chev_left_on.h
    engines/titanic/gfx/small_chev_right_off.h
    engines/titanic/gfx/small_chev_right_on.h
    engines/titanic/gfx/st_button.h
    engines/titanic/gfx/text_down.h
    engines/titanic/gfx/text_skrew.h
    engines/titanic/gfx/text_up.h
    engines/titanic/gfx/toggle_button.h
    engines/titanic/npcs/character.h
    engines/titanic/npcs/deskbot.h
    engines/titanic/npcs/mobile.h
    engines/titanic/npcs/true_talk_npc.h
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_drag_chev.h
    engines/titanic/pet_control/pet_graphic.h
    engines/titanic/pet_control/pet_graphic2.h
    engines/titanic/pet_control/pet_leaf.h
    engines/titanic/pet_control/pet_mode_off.h
    engines/titanic/pet_control/pet_mode_on.h
    engines/titanic/pet_control/pet_mode_panel.h
    engines/titanic/pet_control/pet_pannel1.h
    engines/titanic/pet_control/pet_pannel2.h
    engines/titanic/pet_control/pet_pannel3.h
    engines/titanic/sound/dome_from_top_of_well.h
    engines/titanic/sound/water_lapping_sounds.h
    engines/titanic/star_control/star_control.h



diff --git a/engines/titanic/carry/arm.h b/engines/titanic/carry/arm.h
index 48201ed..fc8bba1 100644
--- a/engines/titanic/carry/arm.h
+++ b/engines/titanic/carry/arm.h
@@ -31,7 +31,7 @@
 namespace Titanic {
 
 class CArm : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool PuzzleSolvedMsg(CPuzzleSolvedMsg *msg);
 	bool TranslateObjectMsg(CTranslateObjectMsg *msg);
 	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
diff --git a/engines/titanic/carry/brain.h b/engines/titanic/carry/brain.h
index 5f76e7d..bcba161 100644
--- a/engines/titanic/carry/brain.h
+++ b/engines/titanic/carry/brain.h
@@ -31,7 +31,7 @@
 namespace Titanic {
 
 class CBrain : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
 	bool VisibleMsg(CVisibleMsg *msg);
 	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
diff --git a/engines/titanic/carry/bridge_piece.h b/engines/titanic/carry/bridge_piece.h
index 01c44c0..80a1cc9 100644
--- a/engines/titanic/carry/bridge_piece.h
+++ b/engines/titanic/carry/bridge_piece.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CBridgePiece : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
 	bool PassOnDragStartMsg(CPassOnDragStartMsg *msg);
 private:
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index f4ea648..72f4024 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -30,7 +30,7 @@
 namespace Titanic {
 
 class CCarry : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
 	bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
 	bool MouseDragEndMsg(CMouseDragEndMsg *msg);
diff --git a/engines/titanic/carry/carry_parrot.h b/engines/titanic/carry/carry_parrot.h
index 70caee8..2980f26 100644
--- a/engines/titanic/carry/carry_parrot.h
+++ b/engines/titanic/carry/carry_parrot.h
@@ -31,7 +31,7 @@
 namespace Titanic {
 
 class CCarryParrot : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
 	bool TimerMsg(CTimerMsg *msg);
 	bool IsParrotPresentMsg(CIsParrotPresentMsg *msg);
diff --git a/engines/titanic/carry/chicken.h b/engines/titanic/carry/chicken.h
index c78d4a0..65fe30f 100644
--- a/engines/titanic/carry/chicken.h
+++ b/engines/titanic/carry/chicken.h
@@ -30,7 +30,7 @@
 namespace Titanic {
 
 class CChicken : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
 	bool UseWithCharMsg(CUseWithCharMsg *msg);
 	bool ActMsg(CActMsg *msg);
diff --git a/engines/titanic/carry/crushed_tv.h b/engines/titanic/carry/crushed_tv.h
index ba6b52c..340930f 100644
--- a/engines/titanic/carry/crushed_tv.h
+++ b/engines/titanic/carry/crushed_tv.h
@@ -30,7 +30,7 @@
 namespace Titanic {
 
 class CCrushedTV : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool ActMsg(CActMsg *msg);
 	bool UseWithCharMsg(CUseWithCharMsg *msg);
 	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
diff --git a/engines/titanic/carry/feathers.h b/engines/titanic/carry/feathers.h
index 4d193af..7282bcb 100644
--- a/engines/titanic/carry/feathers.h
+++ b/engines/titanic/carry/feathers.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CFeathers : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CFeathers();
diff --git a/engines/titanic/carry/hose_end.h b/engines/titanic/carry/hose_end.h
index 6996d63..836c944 100644
--- a/engines/titanic/carry/hose_end.h
+++ b/engines/titanic/carry/hose_end.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CHoseEnd : public CHose {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CHoseEnd();
diff --git a/engines/titanic/carry/magazine.h b/engines/titanic/carry/magazine.h
index 69b9937..d1db468 100644
--- a/engines/titanic/carry/magazine.h
+++ b/engines/titanic/carry/magazine.h
@@ -30,7 +30,7 @@
 namespace Titanic {
 
 class CMagazine : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool UseWithCharMsg(CUseWithCharMsg *msg);
 	bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
 	bool VisibleMsg(CVisibleMsg *msg);
diff --git a/engines/titanic/carry/napkin.h b/engines/titanic/carry/napkin.h
index cec7a6b..ce47dd6 100644
--- a/engines/titanic/carry/napkin.h
+++ b/engines/titanic/carry/napkin.h
@@ -29,7 +29,7 @@
 namespace Titanic {
 
 class CNapkin : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
 public:
 	CLASSDEF;
diff --git a/engines/titanic/carry/note.h b/engines/titanic/carry/note.h
index 4edb202..37ebf96 100644
--- a/engines/titanic/carry/note.h
+++ b/engines/titanic/carry/note.h
@@ -29,7 +29,7 @@
 namespace Titanic {
 
 class CNote : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool MouseDoubleClickMsg(CMouseDoubleClickMsg *msg);
 private:
 	CString _string6;
diff --git a/engines/titanic/carry/parcel.h b/engines/titanic/carry/parcel.h
index 88282a6..f33c2ff 100644
--- a/engines/titanic/carry/parcel.h
+++ b/engines/titanic/carry/parcel.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CParcel : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CParcel();
diff --git a/engines/titanic/carry/phonograph_cylinder.h b/engines/titanic/carry/phonograph_cylinder.h
index ba56bb3..bbb1524 100644
--- a/engines/titanic/carry/phonograph_cylinder.h
+++ b/engines/titanic/carry/phonograph_cylinder.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPhonographCylinder : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
 	bool QueryCylinderMsg(CQueryCylinderMsg *msg);
 	bool RecordOntoCylinderMsg(CRecordOntoCylinderMsg *msg);
diff --git a/engines/titanic/carry/photograph.h b/engines/titanic/carry/photograph.h
index fcae07b..9cea1e4 100644
--- a/engines/titanic/carry/photograph.h
+++ b/engines/titanic/carry/photograph.h
@@ -31,7 +31,7 @@
 namespace Titanic {
 
 class CPhotograph : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool MouseDragEndMsg(CMouseDragEndMsg *msg);
 	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
 	bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
diff --git a/engines/titanic/carry/plug_in.h b/engines/titanic/carry/plug_in.h
index 9601dc1..1358a99 100644
--- a/engines/titanic/carry/plug_in.h
+++ b/engines/titanic/carry/plug_in.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPlugIn : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool UseWithOtherMsg(CUseWithOtherMsg *msg);
 private:
 	int _field12C;
diff --git a/engines/titanic/carry/sweets.h b/engines/titanic/carry/sweets.h
index ed59876..3655fab 100644
--- a/engines/titanic/carry/sweets.h
+++ b/engines/titanic/carry/sweets.h
@@ -29,7 +29,7 @@
 namespace Titanic {
 
 class CSweets : public CCarry {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
 public:
 	CLASSDEF;
diff --git a/engines/titanic/core/background.h b/engines/titanic/core/background.h
index 004ab4d..6a2fd21 100644
--- a/engines/titanic/core/background.h
+++ b/engines/titanic/core/background.h
@@ -29,7 +29,7 @@
 namespace Titanic {
 
 class CBackground : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool StatusChangeMsg(CStatusChangeMsg *msg);
 	bool SetFrameMsg(CSetFrameMsg *msg);
 	bool VisibleMsg(CVisibleMsg *msg);
diff --git a/engines/titanic/core/dont_save_file_item.h b/engines/titanic/core/dont_save_file_item.h
index 92425ae..f5ec4f7 100644
--- a/engines/titanic/core/dont_save_file_item.h
+++ b/engines/titanic/core/dont_save_file_item.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CDontSaveFileItem : public CFileItem {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/core/file_item.h b/engines/titanic/core/file_item.h
index 4b7c341..4cecee4 100644
--- a/engines/titanic/core/file_item.h
+++ b/engines/titanic/core/file_item.h
@@ -30,7 +30,7 @@
 namespace Titanic {
 
 class CFileItem: public CTreeItem {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 private:
 	CString _filename;
 public:
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 746ef45..69036b1 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -50,7 +50,7 @@ class OSMovie;
 
 class CGameObject : public CNamedItem {
 	friend class OSMovie;
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 private:
 	static CCreditText *_credits;
 private:
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index 4b31680..dd93e2a 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -34,7 +34,7 @@ class CNodeItem;
 class CRoomItem;
 
 class CLinkItem : public CNamedItem {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 private:
 	/**
 	 * Returns a new name for the link item, based on the
diff --git a/engines/titanic/core/message_target.h b/engines/titanic/core/message_target.h
index 0afd847..a52de59 100644
--- a/engines/titanic/core/message_target.h
+++ b/engines/titanic/core/message_target.h
@@ -45,7 +45,7 @@ struct MSGMAP {
 #define DECLARE_MESSAGE_MAP \
 protected: \
 	static const MSGMAP *getThisMessageMap(); \
-	virtual const MSGMAP *getMessageMap() const;
+	virtual const MSGMAP *getMessageMap() const
 
 #define BEGIN_MESSAGE_MAP(theClass, baseClass) \
 	const MSGMAP *theClass::getMessageMap() const \
@@ -84,7 +84,7 @@ protected: \
 	static const int DUMMY = 0
 
 class CMessageTarget: public CSaveableObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/core/named_item.h b/engines/titanic/core/named_item.h
index 2ff34c7..809cda1 100644
--- a/engines/titanic/core/named_item.h
+++ b/engines/titanic/core/named_item.h
@@ -32,7 +32,7 @@ class CNodeItem;
 class CRoomItem;
 
 class CNamedItem: public CTreeItem {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CString _name;
 public:
diff --git a/engines/titanic/core/node_item.h b/engines/titanic/core/node_item.h
index f54e882..8fda946 100644
--- a/engines/titanic/core/node_item.h
+++ b/engines/titanic/core/node_item.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CNodeItem : public CNamedItem {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	int _nodeNumber;
 	Point _nodePos;
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index 00c13e5..473ffd9 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -76,7 +76,7 @@ class CFileList: public List<CFileListItem> {
 };
 
 class CProjectItem : public CFileItem {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 private:
 	CString _filename;
 	CFileList _files;
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index 22d6e8b..cb343a1 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -32,7 +32,7 @@
 namespace Titanic {
 
 class CRoomItem : public CNamedItem {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 private:
 	/**
 	 * Handles post-load processing
diff --git a/engines/titanic/core/static_image.h b/engines/titanic/core/static_image.h
index 16cae82..7a715a8 100644
--- a/engines/titanic/core/static_image.h
+++ b/engines/titanic/core/static_image.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CStaticImage : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index 85d0215..db4ba30 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -37,7 +37,7 @@ class CViewItem;
 
 class CTreeItem: public CMessageTarget {
 	friend class CMessage;
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 private:
 	CTreeItem *_parent;
 	CTreeItem *_nextSibling;
diff --git a/engines/titanic/core/turn_on_object.h b/engines/titanic/core/turn_on_object.h
index 67cef9c..0f7cd76 100644
--- a/engines/titanic/core/turn_on_object.h
+++ b/engines/titanic/core/turn_on_object.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CTurnOnObject : public CBackground {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
 protected:
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index 227319f..6e8003d 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -31,7 +31,7 @@
 namespace Titanic {
 
 class CViewItem : public CNamedItem {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
 	bool MouseMoveMsg(CMouseMoveMsg *msg);
diff --git a/engines/titanic/game/arb_background.h b/engines/titanic/game/arb_background.h
index b80c988..88d4d1b 100644
--- a/engines/titanic/game/arb_background.h
+++ b/engines/titanic/game/arb_background.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CArbBackground : public CBackground {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	int _fieldE0;
 	int _fieldE4;
diff --git a/engines/titanic/game/arboretum_gate.h b/engines/titanic/game/arboretum_gate.h
index 7e07261..927b219 100644
--- a/engines/titanic/game/arboretum_gate.h
+++ b/engines/titanic/game/arboretum_gate.h
@@ -30,7 +30,7 @@
 namespace Titanic {
 
 class CArboretumGate : public CBackground {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool ActMsg(CActMsg *msg);
 	bool LeaveViewMsg(CLeaveViewMsg *msg);
 	bool TurnOff(CTurnOff *msg);
diff --git a/engines/titanic/game/broken_pell_base.h b/engines/titanic/game/broken_pell_base.h
index f62f04d..f63cd01 100644
--- a/engines/titanic/game/broken_pell_base.h
+++ b/engines/titanic/game/broken_pell_base.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CBrokenPellBase : public CBackground {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 private:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/game/cdrom.h b/engines/titanic/game/cdrom.h
index 9dcb270..0179148 100644
--- a/engines/titanic/game/cdrom.h
+++ b/engines/titanic/game/cdrom.h
@@ -30,7 +30,7 @@
 namespace Titanic {
 
 class CCDROM : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
 	bool MouseDragEndMsg(CMouseDragEndMsg *msg);
 	bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
diff --git a/engines/titanic/game/cdrom_computer.h b/engines/titanic/game/cdrom_computer.h
index 90b7b51..39fa9b9 100644
--- a/engines/titanic/game/cdrom_computer.h
+++ b/engines/titanic/game/cdrom_computer.h
@@ -29,7 +29,7 @@
 namespace Titanic {
 
 class CCDROMComputer : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 private:
 	Rect _clickRect;
diff --git a/engines/titanic/game/cdrom_tray.h b/engines/titanic/game/cdrom_tray.h
index 76c7a9a..10fc1e1 100644
--- a/engines/titanic/game/cdrom_tray.h
+++ b/engines/titanic/game/cdrom_tray.h
@@ -29,7 +29,7 @@
 namespace Titanic {
 
 class CCDROMTray : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool ActMsg(CActMsg *msg);
 	bool MovieEndMsg(CMovieEndMsg *msg);
 	bool StatusChangeMsg(CStatusChangeMsg *msg);
diff --git a/engines/titanic/game/computer.h b/engines/titanic/game/computer.h
index f64f723..6acdba2 100644
--- a/engines/titanic/game/computer.h
+++ b/engines/titanic/game/computer.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CComputer : public CBackground {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool ActMsg(CActMsg *msg);
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 	bool MovieEndMsg(CMovieEndMsg *msg);
diff --git a/engines/titanic/game/computer_screen.h b/engines/titanic/game/computer_screen.h
index 1aed01c..8fb1dcd 100644
--- a/engines/titanic/game/computer_screen.h
+++ b/engines/titanic/game/computer_screen.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CComputerScreen : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool ActMsg(CActMsg *msg);
 	bool MovieEndMsg(CMovieEndMsg *msg);
 	bool EnterViewMsg(CEnterViewMsg *msg);
diff --git a/engines/titanic/game/dead_area.h b/engines/titanic/game/dead_area.h
index 05a3f4e..fdb44ef 100644
--- a/engines/titanic/game/dead_area.h
+++ b/engines/titanic/game/dead_area.h
@@ -32,7 +32,7 @@ namespace Titanic {
  * Implements a non-responsive screen area
  */
 class CDeadArea : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg) { return true; }
 	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg) { return true; }
 public:
diff --git a/engines/titanic/game/leave_sec_class_state.h b/engines/titanic/game/leave_sec_class_state.h
index 67300b6..0b1e854 100644
--- a/engines/titanic/game/leave_sec_class_state.h
+++ b/engines/titanic/game/leave_sec_class_state.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CLeaveSecClassState : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/game/music_room_phonograph.h b/engines/titanic/game/music_room_phonograph.h
index 58afe7f..9286861 100644
--- a/engines/titanic/game/music_room_phonograph.h
+++ b/engines/titanic/game/music_room_phonograph.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CMusicRoomPhonograph : public CRestaurantPhonograph {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 private:
 	int _field118;
 public:
diff --git a/engines/titanic/game/musical_instrument.h b/engines/titanic/game/musical_instrument.h
index 8b53460..5d18ed9 100644
--- a/engines/titanic/game/musical_instrument.h
+++ b/engines/titanic/game/musical_instrument.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CMusicalInstrument : public CBackground {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/game/navigation_computer.h b/engines/titanic/game/navigation_computer.h
index 6de7543..27d06c1 100644
--- a/engines/titanic/game/navigation_computer.h
+++ b/engines/titanic/game/navigation_computer.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CNavigationComputer : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/game/null_port_hole.h b/engines/titanic/game/null_port_hole.h
index 2924aff..2656427 100644
--- a/engines/titanic/game/null_port_hole.h
+++ b/engines/titanic/game/null_port_hole.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CNullPortHole : public CClickResponder {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CNullPortHole();
diff --git a/engines/titanic/game/parrot/parrot_lobby_object.h b/engines/titanic/game/parrot/parrot_lobby_object.h
index dfb6592..5272303 100644
--- a/engines/titanic/game/parrot/parrot_lobby_object.h
+++ b/engines/titanic/game/parrot/parrot_lobby_object.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CParrotLobbyObject : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	static int _v1;
 	static int _v2;
diff --git a/engines/titanic/game/pet/pet_class1.h b/engines/titanic/game/pet/pet_class1.h
index ad97f45..fb7a48b 100644
--- a/engines/titanic/game/pet/pet_class1.h
+++ b/engines/titanic/game/pet/pet_class1.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPETClass1 : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/game/pet/pet_class2.h b/engines/titanic/game/pet/pet_class2.h
index 6ae78f4..c8855c8 100644
--- a/engines/titanic/game/pet/pet_class2.h
+++ b/engines/titanic/game/pet/pet_class2.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPETClass2 : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/game/pet/pet_class3.h b/engines/titanic/game/pet/pet_class3.h
index 780cad3..59d8389 100644
--- a/engines/titanic/game/pet/pet_class3.h
+++ b/engines/titanic/game/pet/pet_class3.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPETClass3 : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/game/pet/pet_monitor.h b/engines/titanic/game/pet/pet_monitor.h
index 3fc50bd..61d1ba8 100644
--- a/engines/titanic/game/pet/pet_monitor.h
+++ b/engines/titanic/game/pet/pet_monitor.h
@@ -29,7 +29,7 @@
 namespace Titanic {
 
 class CPETMonitor : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
 	CLASSDEF;
diff --git a/engines/titanic/game/pet/pet_position.h b/engines/titanic/game/pet/pet_position.h
index 9419684..d1ac050 100644
--- a/engines/titanic/game/pet/pet_position.h
+++ b/engines/titanic/game/pet/pet_position.h
@@ -29,7 +29,7 @@
 namespace Titanic {
 
 class CPETPosition : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
 	CLASSDEF;
diff --git a/engines/titanic/game/pet/pet_transport.h b/engines/titanic/game/pet/pet_transport.h
index 44beafe..58aefe6 100644
--- a/engines/titanic/game/pet/pet_transport.h
+++ b/engines/titanic/game/pet/pet_transport.h
@@ -29,7 +29,7 @@
 namespace Titanic {
 
 class CPETTransport : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	virtual bool EnterRoomMsg(CEnterRoomMsg *msg);
 public:
 	CLASSDEF;
diff --git a/engines/titanic/game/sgt/sgt_state_room.h b/engines/titanic/game/sgt/sgt_state_room.h
index ee90799..375da71 100644
--- a/engines/titanic/game/sgt/sgt_state_room.h
+++ b/engines/titanic/game/sgt/sgt_state_room.h
@@ -46,7 +46,7 @@ struct CSGTStateRoomStatics {
 };
 
 class CSGTStateRoom : public CBackground {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	static CSGTStateRoomStatics *_statics;
diff --git a/engines/titanic/game/splash_animation.h b/engines/titanic/game/splash_animation.h
index b1de994..11715b4 100644
--- a/engines/titanic/game/splash_animation.h
+++ b/engines/titanic/game/splash_animation.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CSplashAnimation : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/game/start_action.h b/engines/titanic/game/start_action.h
index 8be17f0..60381ba 100644
--- a/engines/titanic/game/start_action.h
+++ b/engines/titanic/game/start_action.h
@@ -29,7 +29,7 @@
 namespace Titanic {
 
 class CStartAction : public CBackground {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
 protected:
diff --git a/engines/titanic/game/television.h b/engines/titanic/game/television.h
index 3ce5505..6e6d9b2 100644
--- a/engines/titanic/game/television.h
+++ b/engines/titanic/game/television.h
@@ -30,7 +30,7 @@
 namespace Titanic {
 
 class CTelevision : public CBackground {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool LeaveViewMsg(CLeaveViewMsg *msg);
 	bool ChangeSeasonMsg(CChangeSeasonMsg *msg);
 	bool EnterViewMsg(CEnterViewMsg *msg);
diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h
index 9c90466..4595f0f 100644
--- a/engines/titanic/game/transport/lift.h
+++ b/engines/titanic/game/transport/lift.h
@@ -29,7 +29,7 @@
 namespace Titanic {
 
 class CLift : public CTransport {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	static int _v1;
diff --git a/engines/titanic/game/transport/lift_indicator.h b/engines/titanic/game/transport/lift_indicator.h
index ff394d7..945f627 100644
--- a/engines/titanic/game/transport/lift_indicator.h
+++ b/engines/titanic/game/transport/lift_indicator.h
@@ -29,7 +29,7 @@
 namespace Titanic {
 
 class CLiftindicator : public CLift {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool EnterRoomMsg(CEnterRoomMsg *msg) { return true; }
 private:
 	int _fieldFC;
diff --git a/engines/titanic/game/transport/pellerator.h b/engines/titanic/game/transport/pellerator.h
index 9d223ec..fa400a4 100644
--- a/engines/titanic/game/transport/pellerator.h
+++ b/engines/titanic/game/transport/pellerator.h
@@ -29,7 +29,7 @@
 namespace Titanic {
 
 class CPellerator : public CTransport {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool EnterRoomMsg(CEnterRoomMsg *msg);
 private:
 	static int _v1;
diff --git a/engines/titanic/game/transport/transport.h b/engines/titanic/game/transport/transport.h
index b2c9aee..d872512 100644
--- a/engines/titanic/game/transport/transport.h
+++ b/engines/titanic/game/transport/transport.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CTransport : public CMobile {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CString _string1;
 	CString _string2;
diff --git a/engines/titanic/gfx/chev_left_off.h b/engines/titanic/gfx/chev_left_off.h
index 1e356d3..5034c1a 100644
--- a/engines/titanic/gfx/chev_left_off.h
+++ b/engines/titanic/gfx/chev_left_off.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CChevLeftOff : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CChevLeftOff();
diff --git a/engines/titanic/gfx/chev_left_on.h b/engines/titanic/gfx/chev_left_on.h
index 2014002..df430f6 100644
--- a/engines/titanic/gfx/chev_left_on.h
+++ b/engines/titanic/gfx/chev_left_on.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CChevLeftOn : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CChevLeftOn();
diff --git a/engines/titanic/gfx/chev_right_off.h b/engines/titanic/gfx/chev_right_off.h
index 2bd3e24..8f6c3fc 100644
--- a/engines/titanic/gfx/chev_right_off.h
+++ b/engines/titanic/gfx/chev_right_off.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CChevRightOff : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CChevRightOff();
diff --git a/engines/titanic/gfx/chev_right_on.h b/engines/titanic/gfx/chev_right_on.h
index bc3e0ff..accd42c 100644
--- a/engines/titanic/gfx/chev_right_on.h
+++ b/engines/titanic/gfx/chev_right_on.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CChevRightOn : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CChevRightOn();
diff --git a/engines/titanic/gfx/chev_send_rec_switch.h b/engines/titanic/gfx/chev_send_rec_switch.h
index 0414928..b3ccab2 100644
--- a/engines/titanic/gfx/chev_send_rec_switch.h
+++ b/engines/titanic/gfx/chev_send_rec_switch.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CChevSendRecSwitch : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CChevSendRecSwitch();
diff --git a/engines/titanic/gfx/elevator_button.h b/engines/titanic/gfx/elevator_button.h
index dec4775..28110d8 100644
--- a/engines/titanic/gfx/elevator_button.h
+++ b/engines/titanic/gfx/elevator_button.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CElevatorButton : public CSTButton {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CElevatorButton();
diff --git a/engines/titanic/gfx/get_from_succ.h b/engines/titanic/gfx/get_from_succ.h
index d93341e..f85f1b4 100644
--- a/engines/titanic/gfx/get_from_succ.h
+++ b/engines/titanic/gfx/get_from_succ.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CGetFromSucc : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CGetFromSucc();
diff --git a/engines/titanic/gfx/helmet_on_off.h b/engines/titanic/gfx/helmet_on_off.h
index 881757a..c2910eb 100644
--- a/engines/titanic/gfx/helmet_on_off.h
+++ b/engines/titanic/gfx/helmet_on_off.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CHelmetOnOff : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CHelmetOnOff();
diff --git a/engines/titanic/gfx/home_photo.h b/engines/titanic/gfx/home_photo.h
index 9181bfd..09b18b7 100644
--- a/engines/titanic/gfx/home_photo.h
+++ b/engines/titanic/gfx/home_photo.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CHomePhoto : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CHomePhoto();
diff --git a/engines/titanic/gfx/icon_nav_action.h b/engines/titanic/gfx/icon_nav_action.h
index 9a63a47..841334d 100644
--- a/engines/titanic/gfx/icon_nav_action.h
+++ b/engines/titanic/gfx/icon_nav_action.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CIconNavAction : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CIconNavAction();
diff --git a/engines/titanic/gfx/icon_nav_butt.h b/engines/titanic/gfx/icon_nav_butt.h
index a27fc8b..c60877e 100644
--- a/engines/titanic/gfx/icon_nav_butt.h
+++ b/engines/titanic/gfx/icon_nav_butt.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CIconNavButt : public CPetGraphic {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/gfx/icon_nav_down.h b/engines/titanic/gfx/icon_nav_down.h
index 759d887..6c0c287 100644
--- a/engines/titanic/gfx/icon_nav_down.h
+++ b/engines/titanic/gfx/icon_nav_down.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CIconNavDown : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CIconNavDown();
diff --git a/engines/titanic/gfx/icon_nav_image.h b/engines/titanic/gfx/icon_nav_image.h
index ab0e955..580762c 100644
--- a/engines/titanic/gfx/icon_nav_image.h
+++ b/engines/titanic/gfx/icon_nav_image.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CIconNavImage : public CPetGraphic {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/gfx/icon_nav_left.h b/engines/titanic/gfx/icon_nav_left.h
index d58a426..bb61c26 100644
--- a/engines/titanic/gfx/icon_nav_left.h
+++ b/engines/titanic/gfx/icon_nav_left.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CIconNavLeft : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CIconNavLeft();
diff --git a/engines/titanic/gfx/icon_nav_receive.h b/engines/titanic/gfx/icon_nav_receive.h
index 5d055dd..0744105 100644
--- a/engines/titanic/gfx/icon_nav_receive.h
+++ b/engines/titanic/gfx/icon_nav_receive.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CIconNavReceive : public CPetGraphic {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/gfx/icon_nav_right.h b/engines/titanic/gfx/icon_nav_right.h
index c12ff7c..a1bed9c 100644
--- a/engines/titanic/gfx/icon_nav_right.h
+++ b/engines/titanic/gfx/icon_nav_right.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CIconNavRight : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CIconNavRight();
diff --git a/engines/titanic/gfx/icon_nav_send.h b/engines/titanic/gfx/icon_nav_send.h
index f2b220f..f3af8d9 100644
--- a/engines/titanic/gfx/icon_nav_send.h
+++ b/engines/titanic/gfx/icon_nav_send.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CIconNavSend : public CPetGraphic {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/gfx/icon_nav_up.h b/engines/titanic/gfx/icon_nav_up.h
index a9702c7..4b7320d 100644
--- a/engines/titanic/gfx/icon_nav_up.h
+++ b/engines/titanic/gfx/icon_nav_up.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CIconNavUp : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CIconNavUp();
diff --git a/engines/titanic/gfx/keybrd_butt.h b/engines/titanic/gfx/keybrd_butt.h
index 5514f11..822be41 100644
--- a/engines/titanic/gfx/keybrd_butt.h
+++ b/engines/titanic/gfx/keybrd_butt.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CKeybrdButt : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CKeybrdButt();
diff --git a/engines/titanic/gfx/music_slider.h b/engines/titanic/gfx/music_slider.h
index 1636afe..be2c563 100644
--- a/engines/titanic/gfx/music_slider.h
+++ b/engines/titanic/gfx/music_slider.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CMusicSlider : public CMusicControl {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/gfx/music_switch.h b/engines/titanic/gfx/music_switch.h
index 6ee615d..35af84b 100644
--- a/engines/titanic/gfx/music_switch.h
+++ b/engines/titanic/gfx/music_switch.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CMusicSwitch : public CMusicControl {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/gfx/send_to_succ.h b/engines/titanic/gfx/send_to_succ.h
index dfcb345..734c4a7 100644
--- a/engines/titanic/gfx/send_to_succ.h
+++ b/engines/titanic/gfx/send_to_succ.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CSendToSucc : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CSendToSucc();
diff --git a/engines/titanic/gfx/sgt_selector.h b/engines/titanic/gfx/sgt_selector.h
index 2afd402..be35635 100644
--- a/engines/titanic/gfx/sgt_selector.h
+++ b/engines/titanic/gfx/sgt_selector.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CSGTSelector : public CPetGraphic {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/gfx/small_chev_left_off.h b/engines/titanic/gfx/small_chev_left_off.h
index c3af9bb..bed64be 100644
--- a/engines/titanic/gfx/small_chev_left_off.h
+++ b/engines/titanic/gfx/small_chev_left_off.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CSmallChevLeftOff : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CSmallChevLeftOff();
diff --git a/engines/titanic/gfx/small_chev_left_on.h b/engines/titanic/gfx/small_chev_left_on.h
index 4fcba62..9d17713 100644
--- a/engines/titanic/gfx/small_chev_left_on.h
+++ b/engines/titanic/gfx/small_chev_left_on.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CSmallChevLeftOn : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CSmallChevLeftOn();
diff --git a/engines/titanic/gfx/small_chev_right_off.h b/engines/titanic/gfx/small_chev_right_off.h
index f56cc83..eb6ca45 100644
--- a/engines/titanic/gfx/small_chev_right_off.h
+++ b/engines/titanic/gfx/small_chev_right_off.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CSmallChevRightOff : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CSmallChevRightOff();
diff --git a/engines/titanic/gfx/small_chev_right_on.h b/engines/titanic/gfx/small_chev_right_on.h
index aeb9ce3..1dfb2d6 100644
--- a/engines/titanic/gfx/small_chev_right_on.h
+++ b/engines/titanic/gfx/small_chev_right_on.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CSmallChevRightOn : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CSmallChevRightOn();
diff --git a/engines/titanic/gfx/st_button.h b/engines/titanic/gfx/st_button.h
index 6a8af1b..7894376 100644
--- a/engines/titanic/gfx/st_button.h
+++ b/engines/titanic/gfx/st_button.h
@@ -30,7 +30,7 @@
 namespace Titanic {
 
 class CSTButton : public CBackground {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 	bool MouseButtonUpMsg(CMouseButtonUpMsg *msg);
 	bool EnterViewMsg(CEnterViewMsg *msg);
diff --git a/engines/titanic/gfx/text_down.h b/engines/titanic/gfx/text_down.h
index 5c924b8..9766060 100644
--- a/engines/titanic/gfx/text_down.h
+++ b/engines/titanic/gfx/text_down.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CTextDown : public CPetGraphic {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/gfx/text_skrew.h b/engines/titanic/gfx/text_skrew.h
index df90d95..d0d9b82 100644
--- a/engines/titanic/gfx/text_skrew.h
+++ b/engines/titanic/gfx/text_skrew.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CTextSkrew : public CPetGraphic {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/gfx/text_up.h b/engines/titanic/gfx/text_up.h
index 0e839e0..dda8d84 100644
--- a/engines/titanic/gfx/text_up.h
+++ b/engines/titanic/gfx/text_up.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CTextUp : public CPetGraphic {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/gfx/toggle_button.h b/engines/titanic/gfx/toggle_button.h
index 9eb6fdb..5328072 100644
--- a/engines/titanic/gfx/toggle_button.h
+++ b/engines/titanic/gfx/toggle_button.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CToggleButton : public CBackground {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 private:
 	int _fieldE0;
 public:
diff --git a/engines/titanic/npcs/character.h b/engines/titanic/npcs/character.h
index 6f3de9a..4912740 100644
--- a/engines/titanic/npcs/character.h
+++ b/engines/titanic/npcs/character.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CCharacter : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool LeaveViewMsg(CLeaveViewMsg *msg);
 	bool TurnOn(CTurnOn *msg);
 	bool TurnOff(CTurnOff *msg);
diff --git a/engines/titanic/npcs/deskbot.h b/engines/titanic/npcs/deskbot.h
index e900781..ab48d63 100644
--- a/engines/titanic/npcs/deskbot.h
+++ b/engines/titanic/npcs/deskbot.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CDeskbot : public CTrueTalkNPC {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool TurnOn(CTurnOn *msg);
 	bool EnterViewMsg(CEnterViewMsg *msg);
 	bool ActMsg(CActMsg *msg);
diff --git a/engines/titanic/npcs/mobile.h b/engines/titanic/npcs/mobile.h
index f9b3955..68e74a5 100644
--- a/engines/titanic/npcs/mobile.h
+++ b/engines/titanic/npcs/mobile.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CMobile : public CCharacter {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 private:
 	Point _pos1;
 	int _fieldDC;
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index cece8ed..0deb832 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -38,7 +38,7 @@ enum NpcFlag {
 class CViewItem;
 
 class CTrueTalkNPC : public CCharacter {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool TextInputMsg(CTextInputMsg *msg);
 	bool TrueTalkGetAssetDetailsMsg(CTrueTalkGetAssetDetailsMsg *msg);
 	bool DismissBotMsg(CDismissBotMsg *msg);
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 468c4f3..5e77b15 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -43,7 +43,7 @@ namespace Titanic {
 enum SummonResult { SUMMON_CANT = 0, SUMMON_PRESENT = 1, SUMMON_CAN = 2 };
 
 class CPetControl : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	struct PetEventInfo {
 		int _id;
 		CPetSection *_target;
diff --git a/engines/titanic/pet_control/pet_drag_chev.h b/engines/titanic/pet_control/pet_drag_chev.h
index 153b954..9f4a6f0 100644
--- a/engines/titanic/pet_control/pet_drag_chev.h
+++ b/engines/titanic/pet_control/pet_drag_chev.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPetDragChev : public CPetGraphic2 {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 protected:
 	bool MouseDragStartMsg(CMouseDragStartMsg *msg);
 	bool MouseDragMoveMsg(CMouseDragMoveMsg *msg);
diff --git a/engines/titanic/pet_control/pet_graphic.h b/engines/titanic/pet_control/pet_graphic.h
index 082a27f..630c844 100644
--- a/engines/titanic/pet_control/pet_graphic.h
+++ b/engines/titanic/pet_control/pet_graphic.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPetGraphic : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/pet_control/pet_graphic2.h b/engines/titanic/pet_control/pet_graphic2.h
index 6b832fe..58852fc 100644
--- a/engines/titanic/pet_control/pet_graphic2.h
+++ b/engines/titanic/pet_control/pet_graphic2.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPetGraphic2 : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/pet_control/pet_leaf.h b/engines/titanic/pet_control/pet_leaf.h
index 8428647..0c21352 100644
--- a/engines/titanic/pet_control/pet_leaf.h
+++ b/engines/titanic/pet_control/pet_leaf.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class PETLeaf : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/pet_control/pet_mode_off.h b/engines/titanic/pet_control/pet_mode_off.h
index a906bc6..9162270 100644
--- a/engines/titanic/pet_control/pet_mode_off.h
+++ b/engines/titanic/pet_control/pet_mode_off.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPetModeOff : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CPetModeOff();
diff --git a/engines/titanic/pet_control/pet_mode_on.h b/engines/titanic/pet_control/pet_mode_on.h
index 074e33e..f77fd1f 100644
--- a/engines/titanic/pet_control/pet_mode_on.h
+++ b/engines/titanic/pet_control/pet_mode_on.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPetModeOn : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CPetModeOn();
diff --git a/engines/titanic/pet_control/pet_mode_panel.h b/engines/titanic/pet_control/pet_mode_panel.h
index 0812c11..f37c543 100644
--- a/engines/titanic/pet_control/pet_mode_panel.h
+++ b/engines/titanic/pet_control/pet_mode_panel.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPetModePanel : public CToggleSwitch {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 	CPetModePanel();
diff --git a/engines/titanic/pet_control/pet_pannel1.h b/engines/titanic/pet_control/pet_pannel1.h
index 7ca7378..f39314f 100644
--- a/engines/titanic/pet_control/pet_pannel1.h
+++ b/engines/titanic/pet_control/pet_pannel1.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPetPannel1 : public CPetGraphic {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/pet_control/pet_pannel2.h b/engines/titanic/pet_control/pet_pannel2.h
index 62dd2aa..f820847 100644
--- a/engines/titanic/pet_control/pet_pannel2.h
+++ b/engines/titanic/pet_control/pet_pannel2.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPetPannel2 : public CPetGraphic {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/pet_control/pet_pannel3.h b/engines/titanic/pet_control/pet_pannel3.h
index 2acf269..dd0d2f9 100644
--- a/engines/titanic/pet_control/pet_pannel3.h
+++ b/engines/titanic/pet_control/pet_pannel3.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CPetPannel3 : public CPetGraphic {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/sound/dome_from_top_of_well.h b/engines/titanic/sound/dome_from_top_of_well.h
index fba7168..e3d2877 100644
--- a/engines/titanic/sound/dome_from_top_of_well.h
+++ b/engines/titanic/sound/dome_from_top_of_well.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CDomeFromTopOfWell : public CViewAutoSoundPlayer {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	CLASSDEF;
 
diff --git a/engines/titanic/sound/water_lapping_sounds.h b/engines/titanic/sound/water_lapping_sounds.h
index d7017d2..5db41a3 100644
--- a/engines/titanic/sound/water_lapping_sounds.h
+++ b/engines/titanic/sound/water_lapping_sounds.h
@@ -28,7 +28,7 @@
 namespace Titanic {
 
 class CWaterLappingSounds : public CRoomAutoSoundPlayer {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 public:
 	int _value;
 public:
diff --git a/engines/titanic/star_control/star_control.h b/engines/titanic/star_control/star_control.h
index f5f0af2..c0561ce 100644
--- a/engines/titanic/star_control/star_control.h
+++ b/engines/titanic/star_control/star_control.h
@@ -30,7 +30,7 @@
 namespace Titanic {
 
 class CStarControl : public CGameObject {
-	DECLARE_MESSAGE_MAP
+	DECLARE_MESSAGE_MAP;
 	bool MouseButtonDownMsg(CMouseButtonDownMsg *msg);
 	bool MouseMoveMsg(CMouseMoveMsg *msg);
 	bool KeyCharMsg(CKeyCharMsg *msg);


Commit: 13ce0156ff16cddbdfe108b92fbcf83a28c090e7
    https://github.com/scummvm/scummvm/commit/13ce0156ff16cddbdfe108b92fbcf83a28c090e7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T20:56:58-04:00

Commit Message:
TITANIC: Fix crash loading Sentences/Default NPC data

Changed paths:
    engines/titanic/titanic.cpp



diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 66d4e46..6b23a25 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -82,6 +82,9 @@ void TitanicEngine::initialize() {
 	DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
 	DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
 
+	_debugger = new Debugger(this);
+	_filesManager = new CFilesManager();
+
 	CSaveableObject::initClassList();
 	CEnterExitFirstClassState::init();
 	CGameObject::init();
@@ -97,9 +100,7 @@ void TitanicEngine::initialize() {
 	TTnpcScript::init();
 	OSVideoSurface::setup();
 
-	_debugger = new Debugger(this);
 	_events = new Events(this);
-	_filesManager = new CFilesManager();
 	_screen = new Graphics::Screen(0, 0);
 	_screenManager = new OSScreenManager(this);
 	_window = new CMainGameWindow(this);


Commit: cf805b07d33adb7809f88e8e5d297831d75df166
    https://github.com/scummvm/scummvm/commit/cf805b07d33adb7809f88e8e5d297831d75df166
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T22:13:55-04:00

Commit Message:
TITANIC: Adding NPC Script support methods

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 03aa1cd..cd44d63 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -756,8 +756,87 @@ done:
 }
 
 ScriptChangedResult BarbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
-	warning("TODO");
-	return SCR_1;
+	switch (id) {
+	case 1:
+	case 100:
+		if (!isState9()) {
+			selectResponse(250210);
+			applyResponse();
+		}
+
+		adjustDial(0, getRandomBit() ? getRandomNumber(5) * 4 :
+			-getRandomNumber(5) * 4);
+		break;
+
+	case 3:
+		if (isState9()) {
+			selectResponse(250244);
+			applyResponse();
+			resetFlags();
+		} else {
+			if (!getValue(28) || !fn10(true)) {
+				addResponse(getDialogueId(251627 + getValue(28) ? -1034 : 0));
+				applyResponse();
+			}
+
+			CTrueTalkManager::setFlags(28, 1);
+			resetFlags();
+		}
+		break;
+
+	case 4:
+		selectResponse(isState9() ? 250141 : 250140);
+		applyResponse();
+		adjustDial(2, getDialLevel(2, false) < 50 ? -15 - getRandomNumber(30) :
+			15 + getRandomNumber(30));
+
+		if (getDialRegion(1) != 0 && getRandomNumber(100) > 75)
+			adjustDial(1, -35);
+		break;
+
+	case 143:
+		addResponse(getDialogueId(isState9() ? 250577 : 250576));
+		break;
+
+	case 144:
+		addResponse(getDialogueId(isState9() ? 250577 : 250584));
+		break;
+
+	case 145:
+		if (isState9()) {
+			addResponse(getDialogueId(250577));
+			applyResponse();
+		} else {
+			set34(57);
+		}
+		break;
+
+	case 146:
+		addResponse(getDialogueId(isState9() ? 250577 : 250574));
+		break;
+
+	case 147:
+		addResponse(getDialogueId(250579));
+		break;
+
+	}
+
+	if (id >= 250000 && id <= 251900) {
+		if (id > 250571) {
+			if (id != 250575 && (id == 250586 || id == 251858 || !isState9())) {
+				addResponse(getDialogueId(id));
+				applyResponse();
+			}
+		} else if (id == 250571 || (id != 250244 && !isState9()) || isState9()) {
+			addResponse(getDialogueId(id));
+			applyResponse();
+		} else {
+			addResponse(getDialogueId(251018));
+			applyResponse();
+		}
+	}
+
+	return SCR_2;
 }
 
 int BarbotScript::proc15() const {
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index cd06d71..c466546 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -24,6 +24,7 @@
 #include "titanic/true_talk/tt_concept.h"
 #include "titanic/true_talk/tt_sentence.h"
 #include "titanic/true_talk/tt_parser.h"
+#include "titanic/true_talk/tt_word.h"
 #include "titanic/titanic.h"
 
 namespace Titanic {
@@ -117,4 +118,25 @@ int CScriptHandler::setResponse(TTscriptBase *script, TTresponse *response) {
 	return _owner->setResponse(script, response);
 }
 
+void CScriptHandler::handleWord(TTstring &str) {
+	handleWord1(str);
+	handleWord2(str);
+}
+
+void CScriptHandler::handleWord1(TTstring &str) {
+	if (_concept2P)
+		delete _concept2P;
+
+	TTword word(str, WC_UNKNOWN, 0);
+	_concept2P = new TTconcept(&word);
+}
+
+void CScriptHandler::handleWord2(TTstring &str) {
+	if (_concept1P)
+		delete _concept1P;
+
+	TTword word(str, WC_UNKNOWN, 0);
+	_concept1P = new TTconcept(&word);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 93abbc3..11976d9 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -42,6 +42,9 @@ private:
 	int _field10;
 	int _inputCtr;
 	int _field30;
+private:
+	void handleWord1(TTstring &str);
+	void handleWord2(TTstring &str);
 public:
 	TTparser _parser;
 	TTvocab *_vocab;
@@ -77,6 +80,8 @@ public:
 	 * Sets a conversation reponse
 	 */
 	int setResponse(TTscriptBase *script, TTresponse *response);
+
+	void handleWord(TTstring &str);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index f673cc0..70be472 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -929,4 +929,47 @@ void TTnpcScript::updateCurrentDial(bool changeDial) {
 	}
 }
 
+bool TTnpcScript::fn10(bool flag) {
+	if (_itemStringP) {
+		for (const ItemRec *ir = ARRAY1; ir->_id; ++ir) {
+			if (!strcmp(ir->_name, _itemStringP)) {
+				_itemStringP = nullptr;
+				uint id = getDialogueId(ir->_id);
+				if (id == 4) {
+					return true;
+				} else if (id != 0) {
+					addResponse(id);
+					applyResponse();
+					return true;
+				}
+				break;
+			}
+		}
+
+		_itemStringP = nullptr;
+	}
+
+	if (flag && getRandomNumber(100) > 60) {
+		int val = getRandomNumber(18) - 1;
+
+		if (val == 0 && !getRoom54(101) && !getRoom54(132))
+			val = -1;
+		else if ((val == 1 && !_field7C) || val == 2)
+			val = -1;
+
+		if (val >= 0) {
+			val = getDialogueId(ARRAY2[val]);
+			if (val == 4) {
+				return true;
+			} else {
+				addResponse(val);
+				applyResponse();
+				return true;
+			}
+		}
+	}
+
+	return false;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 8a17064..2bd4e6d 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -263,6 +263,9 @@ protected:
 	 * Updates the current dial with the given delta
 	 */
 	void updateCurrentDial(bool changeDial);
+
+	bool fn10(bool flag);
+
 public:
 	static void init();
 	static void deinit();


Commit: 6558eb78c351aa852c02071ef1c73b5b9ff7259f
    https://github.com/scummvm/scummvm/commit/6558eb78c351aa852c02071ef1c73b5b9ff7259f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T22:30:30-04:00

Commit Message:
TITANIC: More NPC Script support methods

Changed paths:
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 70be472..d7e3bc1 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -22,6 +22,7 @@
 
 #include "common/algorithm.h"
 #include "common/textconsole.h"
+#include "titanic/messages/messages.h"
 #include "titanic/pet_control/pet_control.h"
 #include "titanic/true_talk/tt_npc_script.h"
 #include "titanic/true_talk/tt_sentence.h"
@@ -972,4 +973,23 @@ bool TTnpcScript::fn10(bool flag) {
 	return false;
 }
 
+bool TTnpcScript::getStateValue() const {
+	if (!CTrueTalkManager::_currentNPC)
+		return false;
+
+	CGameObject *bomb;
+	if (CTrueTalkManager::_currentNPC->find("Bomb", &bomb, FIND_GLOBAL) && bomb) {
+		CTrueTalkGetStateValueMsg stateMsg(10, -1000);
+		stateMsg.execute(bomb);
+		if (stateMsg._stateVal)
+			return true;
+	}
+
+	return false;
+}
+
+bool TTnpcScript::sentence2C(TTsentence *sentence) {
+	return sentence->_field2C >= 2 && sentence->_field2C <= 7;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 2bd4e6d..ab4379b 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -266,6 +266,12 @@ protected:
 
 	bool fn10(bool flag);
 
+	static bool sentence2C(TTsentence *sentence);
+
+	/**
+	 * Gets the True Talk state value
+	 */
+	bool getStateValue() const;
 public:
 	static void init();
 	static void deinit();


Commit: d59b012442289e81f021957306bee36de294aac5
    https://github.com/scummvm/scummvm/commit/d59b012442289e81f021957306bee36de294aac5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T23:08:19-04:00

Commit Message:
DEVTOOLS: Add NPC Script word lists to create_titanic

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 199a8d1..1ddfd46 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -52,7 +52,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x700
+#define HEADER_SIZE 0x740
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -441,6 +441,29 @@ void writeSentenceEntries(const char *name, uint tableOffset) {
 	dataOffset += size;
 }
 
+void writeWords(const char *name, uint tableOffset, int recordCount = 2) {
+	outputFile.seek(dataOffset);
+	int recordSize = recordCount * 4;
+
+	uint val, strOffset;
+	for (uint idx = 0; ; ++idx) {
+		inputFile.seek(tableOffset - FILE_DIFF + idx * recordSize);
+		val = inputFile.readLong();
+		strOffset = inputFile.readLong();
+
+		if (!val)
+			// Reached end of list
+			break;
+
+		outputFile.writeLong(val);
+		writeString(strOffset);
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader(name, dataOffset, size);
+	dataOffset += size;
+}
+
 void writeSentenceMappings(const char *name, uint offset, int numValues) {
 	inputFile.seek(offset - FILE_DIFF);
 	outputFile.seek(dataOffset);
@@ -553,6 +576,11 @@ void writeData() {
 	writeSentenceMappings("Mappings/MaitreD", 0x6125C8, 1);
 	writeSentenceMappings("Mappings/Parrot", 0x615B68, 1);
 	writeSentenceMappings("Mappings/SuccUBus", 0x6189F0, 1);
+	writeWords("Words/Barbot", 0x5BE2E0);
+	writeWords("Words/Bellbot", 0x5D8230);
+	writeWords("Words/Deskbot", 0x5EAAA8);
+	writeWords("Words/Doorbot", 0x601098, 3);
+	writeWords("Words/Liftbot", 0x60C788);
 
 	writeResponseTree();
 	writeNumbers();


Commit: 3c547b6b354fc54a19dc88cc2470fb51093eb5bb
    https://github.com/scummvm/scummvm/commit/3c547b6b354fc54a19dc88cc2470fb51093eb5bb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T23:08:46-04:00

Commit Message:
TITANIC: Load word lists for each NPC Script class

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/script_handler.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index cd44d63..6317f16 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -63,6 +63,7 @@ void BarbotScript::setupSentences() {
 	_mappings.load("Mappings/Barbot", 8);
 	_entries.load("Sentences/Barbot");
 	_entries2.load("Sentences/Barbot2");
+	_words.load("Words/Barbot");
 }
 
 int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index a13f9d6..baf75cd 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -43,6 +43,7 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	loadResponses("Responses/Bellbot", 4);
 	setupSentences();
 	_tagMappings.load("TagMap/Bellbot");
+	_words.load("Words/Bellbot");
 }
 
 void BellbotScript::setupSentences() {
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 61e1f71..1349a78 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -44,6 +44,7 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 	loadResponses("Responses/Deskbot", 4);
 	setupSentences();
 	_tagMappings.load("TagMap/Deskbot");
+	_words.load("Words/Deskbot");
 }
 
 void DeskbotScript::setupSentences() {
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 0db7547..4be2511 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -38,6 +38,7 @@ DoorbotScript::DoorbotScript(int val1, const char *charClass, int v2,
 	loadResponses("Responses/Doorbot");
 	setupSentences();
 	_tagMappings.load("TagMap/Doorbot");
+	_words.load("Words/Doorbot");
 }
 
 void DoorbotScript::setupSentences() {
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index e911fe1..dae80c2 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -39,6 +39,7 @@ LiftbotScript::LiftbotScript(int val1, const char *charClass, int v2,
 	loadResponses("Responses/Liftbot");
 	setupSentences();
 	_tagMappings.load("TagMap/Liftbot");
+	_words.load("Words/Liftbot");
 }
 
 void LiftbotScript::setupSentences() {
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index c466546..23ecf35 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -118,25 +118,31 @@ int CScriptHandler::setResponse(TTscriptBase *script, TTresponse *response) {
 	return _owner->setResponse(script, response);
 }
 
-void CScriptHandler::handleWord(TTstring &str) {
+void CScriptHandler::handleWord(const TTstring *str) {
 	handleWord1(str);
 	handleWord2(str);
 }
 
-void CScriptHandler::handleWord1(TTstring &str) {
+void CScriptHandler::handleWord1(const TTstring *str) {
 	if (_concept2P)
 		delete _concept2P;
+	_concept2P = nullptr;
 
-	TTword word(str, WC_UNKNOWN, 0);
-	_concept2P = new TTconcept(&word);
+	if (str) {
+		TTword word(*str, WC_UNKNOWN, 0);
+		_concept2P = new TTconcept(&word);
+	}
 }
 
-void CScriptHandler::handleWord2(TTstring &str) {
+void CScriptHandler::handleWord2(const TTstring *str) {
 	if (_concept1P)
 		delete _concept1P;
+	_concept1P = nullptr;
 
-	TTword word(str, WC_UNKNOWN, 0);
-	_concept1P = new TTconcept(&word);
+	if (str) {
+		TTword word(*str, WC_UNKNOWN, 0);
+		_concept1P = new TTconcept(&word);
+	}
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 11976d9..193c60f 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -43,8 +43,8 @@ private:
 	int _inputCtr;
 	int _field30;
 private:
-	void handleWord1(TTstring &str);
-	void handleWord2(TTstring &str);
+	void handleWord1(const TTstring *str);
+	void handleWord2(const TTstring *str);
 public:
 	TTparser _parser;
 	TTvocab *_vocab;
@@ -81,7 +81,7 @@ public:
 	 */
 	int setResponse(TTscriptBase *script, TTresponse *response);
 
-	void handleWord(TTstring &str);
+	void handleWord(const TTstring *str);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index d7e3bc1..c552d00 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -206,6 +206,22 @@ void TTtagMappings::load(const char *name) {
 
 /*------------------------------------------------------------------------*/
 
+void TTwordEntries::load(const char *name) {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+
+	while (r->pos() < r->size()) {
+		TTwordEntry we;
+		we._id = r->readUint32LE();
+		we._text = readStringFromStream(r);
+
+		push_back(we);
+	}
+
+	delete r;
+}
+
+/*------------------------------------------------------------------------*/
+
 TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTscriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
@@ -298,7 +314,7 @@ void TTnpcScript::addResponse(int id) {
 	if (id > 200000)
 		id = getDialogueId(id);
 
-	proc15(id);
+	handleWord(id);
 	TTscriptBase::addResponse(id);
 }
 
@@ -350,8 +366,21 @@ void TTnpcScript::selectResponse(int id) {
 	addResponse(id);
 }
 
-int TTnpcScript::proc15(int id) const {
-	return 0;
+bool TTnpcScript::handleWord(uint id) const {
+	if (_words.empty())
+		return false;
+
+	for (uint idx = 0; idx < _words.size(); ++idx) {
+		const TTwordEntry &we = _words[idx];
+		if (we._id == id) {
+			TTstring str(we._text);
+			g_vm->_scriptHandler->handleWord(&str);
+			return true;
+		}
+	}
+
+	g_vm->_scriptHandler->handleWord(nullptr);
+	return true;
 }
 
 bool TTnpcScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index ab4379b..29b174b 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -120,6 +120,18 @@ public:
 	void load(const char *name);
 };
 
+struct TTwordEntry {
+	uint _id;
+	CString _text;
+
+	TTwordEntry() : _id(0) {}
+};
+
+class TTwordEntries : public Common::Array<TTwordEntry> {
+public:
+	void load(const char *name);
+};
+
 class TTnpcScriptBase : public TTscriptBase {
 protected:
 	int _field54;
@@ -167,6 +179,7 @@ protected:
 	TTscriptMappings _mappings;
 	TTsentenceEntries _entries;
 	TTtagMappings _tagMappings;
+	TTwordEntries _words;
 	int _entryCount;
 	int _field68;
 	int _field6C;
@@ -313,7 +326,11 @@ public:
 	 */
 	virtual void selectResponse(int id);
 	
-	virtual int proc15(int id) const;
+	/**
+	 * Handles scanning the word list for a given Id, and if
+	 * found adds it to the sentence concept list
+	 */
+	virtual bool handleWord(uint id) const;
 
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;


Commit: 539f13f5a4238a091dc4ff6bf1ddbe0bf2e201e3
    https://github.com/scummvm/scummvm/commit/539f13f5a4238a091dc4ff6bf1ddbe0bf2e201e3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T23:13:37-04:00

Commit Message:
TITANIC: Remove deprecated code

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 6317f16..080b48a 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -766,7 +766,7 @@ ScriptChangedResult BarbotScript::scriptChanged(TTscriptBase *roomScript, uint i
 		}
 
 		adjustDial(0, getRandomBit() ? getRandomNumber(5) * 4 :
-			-getRandomNumber(5) * 4);
+			-(int)getRandomNumber(5) * 4);
 		break;
 
 	case 3:
@@ -840,11 +840,6 @@ ScriptChangedResult BarbotScript::scriptChanged(TTscriptBase *roomScript, uint i
 	return SCR_2;
 }
 
-int BarbotScript::proc15() const {
-	warning("TODO");
-	return 0;
-}
-
 bool BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	int val, uint tagId, uint remainder) const {
 	warning("TODO: handleQuote");
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 9449149..a5e6b50 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -65,8 +65,6 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-	virtual int proc15() const;
-
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 	
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 1349a78..0458868 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -65,11 +65,6 @@ ScriptChangedResult DeskbotScript::scriptChanged(TTscriptBase *roomScript, uint
 	return SCR_1;
 }
 
-int DeskbotScript::proc15() const {
-	warning("TODO");
-	return 0;
-}
-
 bool DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	int val, uint tagId, uint remainder) const {
 	warning("TODO");
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index f685b7a..417cebd 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -48,8 +48,6 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-	virtual int proc15() const;
-
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 4be2511..51647b9 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -119,11 +119,6 @@ ScriptChangedResult DoorbotScript::scriptChanged(TTscriptBase *roomScript, uint
 	return SCR_1;
 }
 
-int DoorbotScript::proc15() const {
-	warning("TODO");
-	return 0;
-}
-
 bool DoorbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const {
 	warning("TODO");
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index f50fa28..16f5c96 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -59,8 +59,6 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-	virtual int proc15() const;
-
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index dae80c2..826690b 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -96,11 +96,6 @@ ScriptChangedResult LiftbotScript::scriptChanged(TTscriptBase *roomScript, uint
 	return SCR_1;
 }
 
-int LiftbotScript::proc15() const {
-	warning("TODO");
-	return 0;
-}
-
 bool LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const {
 	warning("TODO");
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index b2662b1..20c9444 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -56,8 +56,6 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-	virtual int proc15() const;
-
 	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		int val, uint tagId, uint remainder) const;
 


Commit: 2844574dc0f9e8c50e13cbebddd68db8c4dbc0bf
    https://github.com/scummvm/scummvm/commit/2844574dc0f9e8c50e13cbebddd68db8c4dbc0bf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-24T23:29:59-04:00

Commit Message:
TITANIC: Added NPC Script setDialRegion methods

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 080b48a..36916e2 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -869,12 +869,13 @@ int BarbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentenc
 void BarbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
-void BarbotScript::proc32() {
-	warning("TODO");
+void BarbotScript::setDialRegion(int dialNum, int region) {
+	TTnpcScript::setDialRegion(dialNum, region);
+	selectResponse(250365);
+	applyResponse();
 }
 
 int BarbotScript::proc36(int tagId) const {
-	warning("TODO");
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index a5e6b50..cc8c2f1 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -73,7 +73,12 @@ public:
 	virtual int proc23() const;
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
-	virtual void proc32();
+
+	/**
+	 * Sets a given dial to be pointing in a specified region (0 to 2)
+	 */
+	virtual void setDialRegion(int dialNum, int region);
+
 	virtual int proc36(int val) const;
 };
 
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 51647b9..15ede3a 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -148,8 +148,14 @@ int DoorbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsenten
 void DoorbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
-void DoorbotScript::proc32() {
-	warning("TODO");
+void DoorbotScript::setDialRegion(int dialNum, int region) {
+	TTnpcScript::setDialRegion(dialNum, region);
+	if (dialNum == 1 && region != 1) {
+		CTrueTalkManager::setFlags(37, dialNum);
+	} else {
+		addResponse(getDialogueId(221777));
+		applyResponse();
+	}
 }
 
 int DoorbotScript::proc36(int id) const {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 16f5c96..21a3e7f 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -67,7 +67,12 @@ public:
 	virtual int proc23() const;
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
-	virtual void proc32();
+
+	/**
+	 * Sets a given dial to be pointing in a specified region (0 to 2)
+	 */
+	virtual void setDialRegion(int dialNum, int region);
+
 	virtual int proc36(int val) const;
 };
 
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 826690b..cfa8a70 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -125,8 +125,10 @@ int LiftbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsenten
 void LiftbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
-void LiftbotScript::proc32() {
-	warning("TODO");
+void LiftbotScript::setDialRegion(int dialNum, int region) {
+	TTnpcScript::setDialRegion(dialNum, region);
+	addResponse(getDialogueId(210688));
+	applyResponse();
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 20c9444..553c371 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -64,7 +64,11 @@ public:
 	virtual int proc23() const;
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
-	virtual void proc32();
+
+	/**
+	 * Sets a given dial to be pointing in a specified region (0 to 2)
+	 */
+	virtual void setDialRegion(int dialNum, int region);
 };
 
 } // End of namespace Titanic


Commit: 3efc9f5cdea40c1658466b1f0d6ea8235567b293
    https://github.com/scummvm/scummvm/commit/3efc9f5cdea40c1658466b1f0d6ea8235567b293
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-25T08:17:22-04:00

Commit Message:
TITANIC: Added NPC scripts gitDialsBitsets methods

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 36916e2..d191f4d 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -92,7 +92,7 @@ int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 
 	} else if (tag == MKTAG('B', 'A', 'R', 'K') && getRandomNumber(100) > 50) {
 		selectResponse(250025);
-		switch (proc23()) {
+		switch (getDialsBitset()) {
 		case 4:
 		case 6:
 			addResponse(getDialogueId(250125));
@@ -106,7 +106,7 @@ int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 	
 	} else if (tag == MKTAG('B', 'A', 'R', 'U') && getRandomNumber(100) > 50) {
 		selectResponse(250025);
-		switch (proc23()) {
+		switch (getDialsBitset()) {
 		case 4:
 		case 6:
 			addResponse(getDialogueId(250112));
@@ -856,9 +856,16 @@ int BarbotScript::proc22(int id) const {
 	return 0;
 }
 
-int BarbotScript::proc23() const {
-	warning("TODO");
-	return 0;
+uint BarbotScript::getDialsBitset() const {
+	uint bits = 0;
+	if (!getDialRegion(0))
+		bits = 1;
+	if (!getDialRegion(1))
+		bits |= 2;
+	if (!getDialRegion(2))
+		bits |= 4;
+	
+	return bits;
 }
 
 int BarbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index cc8c2f1..a673911 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -70,7 +70,12 @@ public:
 	
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
-	virtual int proc23() const;
+
+	/**
+	 * Returns a bitset of the first three dialgs being on or not
+	 */
+	virtual uint getDialsBitset() const;
+
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 15ede3a..ba84c9a 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -135,9 +135,14 @@ int DoorbotScript::proc22(int id) const {
 	return 0;
 }
 
-int DoorbotScript::proc23() const {
-	warning("TODO");
-	return 0;
+uint DoorbotScript::getDialsBitset() const {
+	uint bits = 0;
+	if (!getDialRegion(1))
+		bits = 1;
+	if (!getDialRegion(0))
+		bits |= 2;
+
+	return bits;
 }
 
 int DoorbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 21a3e7f..cc3428c 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -64,7 +64,12 @@ public:
 
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
-	virtual int proc23() const;
+
+	/**
+	 * Returns a bitset of the dials being off or not
+	 */
+	virtual uint getDialsBitset() const;
+
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index cfa8a70..b37274a 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -112,11 +112,19 @@ int LiftbotScript::proc22(int id) const {
 	return 0;
 }
 
-int LiftbotScript::proc23() const {
-	warning("TODO");
-	return 0;
+uint LiftbotScript::getDialsBitset() const {
+	uint bits = 0;
+	if (!getDialRegion(1))
+		bits = 1;
+	if (!getDialRegion(0))
+		bits |= 2;
+	if (bits > 1)
+		bits ^= 1;
+
+	return bits;
 }
 
+
 int LiftbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 553c371..6e38287 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -61,7 +61,12 @@ public:
 
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
-	virtual int proc23() const;
+
+	/**
+	 * Returns a bitset of the dials being off or not
+	 */
+	virtual uint getDialsBitset() const;
+
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index c552d00..68e7446 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -444,10 +444,6 @@ int TTnpcScript::proc22(int id) const {
 	return 0;
 }
 
-int TTnpcScript::proc23() const {
-	return 0;
-}
-
 const TTscriptMapping *TTnpcScript::getMapping(int index) {
 	if (index >= 0 && index < (int)_mappings.size())
 		return &_mappings[index];
@@ -705,7 +701,7 @@ uint TTnpcScript::getDialogueId(uint tagId) {
 	if (tagId != oldTagId)
 		tagId = getRangeValue(tagId);
 
-	oldTagId = proc23();
+	oldTagId = getDialsBitset();
 	uint newId = proc21(origId, tagId, oldTagId);
 	if (!newId)
 		return 0;
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 29b174b..ff4c34e 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -349,7 +349,12 @@ public:
 
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
-	virtual int proc23() const;
+
+	/**
+	 * Returns a bitset of the dials being off or not
+	 */
+	virtual uint getDialsBitset() const { return 0; }
+	
 	virtual const TTscriptMapping *getMapping(int index);
 	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);


Commit: 9c763c978d9ba5b5115ca305429b7dea81091731
    https://github.com/scummvm/scummvm/commit/9c763c978d9ba5b5115ca305429b7dea81091731
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-25T19:38:33-04:00

Commit Message:
TITANIC: Added BarbotScript proc25

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index d191f4d..d3e25ea 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -868,9 +868,141 @@ uint BarbotScript::getDialsBitset() const {
 	return bits;
 }
 
-int BarbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
-	warning("TODO");
-	return 0;
+int BarbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
+	int v34 = get34();
+	uint id = 0;
+
+	if (v34 > 0x200) {
+		switch (v34 - 0x201) {
+		case 0:
+			if (getValue(4) != 2)
+				id = 250738;
+			break;
+		case 1:
+			if (getValue(4) != 3)
+				id = 250738;
+		case 2:
+			if (getValue(4) != 0)
+				id = 250738;
+			break;
+		default:
+			break;
+		}
+	} else if (v34 == 0x200) {
+		if (getValue(4) != 1)
+			id = 250738;
+	} else {
+		switch (v34) {
+		case 2:
+			if (getValue(1) != 1)
+				return 1;
+			break;
+		case 3:
+			if (getValue(1) != 2)
+				return 1;
+			break;
+		case 4:
+			if (getValue(1) != 3)
+				return 1;
+			break;
+		case 5:
+			if (getValue(1) == 3)
+				return 1;
+			break;
+		case 6:
+			if (sentence->contains("do not") || sentence->contains("have no") ||
+					sentence->contains("got no"))
+				return 1;
+			break;
+		case 7:
+			if (!sentence->contains("do not") && !sentence->contains("have no") &&
+					!sentence->contains("got no"))
+				return 1;
+			break;
+		case 8:
+			if (sentence->_field38 == 2)
+				return 1;
+			break;
+		case 9: {
+			uint val = CTrueTalkManager::getStateValue(3);
+			bool bit0 = (val & 1) != 0;
+			bool bit2 = (val & 4) != 0;
+			bool bit3 = (val & 8) != 0;
+
+			if (bit2) {
+				if (!bit0) {
+					id = 250085 - bit3 ? 0 : 199715;
+					break;
+				} else if (!bit3) {
+					id = 250627;
+				}
+			} else {
+				if (!bit0) {
+					id = 50365 + bit3 ? 0 : 2;
+				} else if (!bit3) {
+					id = 50370;
+				}
+			}
+
+			if (id) {
+				addResponse(getDialogueId(id));
+				applyResponse();
+				return 2;
+			}
+			break;
+		}
+			
+		case 10: {
+			uint val = CTrueTalkManager::getStateValue(3);
+			bool bit0 = (val & 1) != 0;
+			bool bit2 = (val & 4) != 0;
+			bool bit3 = (val & 8) != 0;
+
+			if (bit0 && bit2 && bit3) {
+				addResponse(getDialogueId(251027));
+				applyResponse();
+				CTrueTalkManager::triggerAction(7, 0);
+				return 2;
+			} else {
+				if (getDialRegion(1) == 1) {
+					if (*val2 != 251650)
+						id = 251651;
+				} else {
+					addResponse(getDialRegion(0) != 0 ? 51444 : 51530);
+					applyResponse();
+					return 2;
+				}
+			}
+			break;
+		}
+
+		case 11:
+			if (CTrueTalkManager::getStateValue(2) != 0) {
+				CTrueTalkManager::triggerAction(6, 0);
+				id = 251003;
+			}
+			break;
+
+		case 12:
+			if (getDialRegion(1) == 0) {
+				addResponse(getDialogueId(251871));
+				applyResponse();
+				return 2;
+			} else if (getRandomNumber(100) > 25 && addRandomResponse(false)) {
+				return 2;
+			}
+
+		default:
+			break;
+		}
+	}
+
+	if (id) {
+		addResponse(getDialogueId(id));
+		applyResponse();
+	}
+
+	return 2;
 }
 
 void BarbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index a673911..4ce9be6 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -76,7 +76,8 @@ public:
 	 */
 	virtual uint getDialsBitset() const;
 
-	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
+
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index baf75cd..66719be 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -90,7 +90,7 @@ int BellbotScript::proc23() const {
 	return 0;
 }
 
-int BellbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
+int BellbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index b21d689..dbe3d62 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -61,7 +61,9 @@ public:
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
-	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+
+	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
+
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
 };
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 0458868..b50f4ad 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -86,7 +86,7 @@ int DeskbotScript::proc23() const {
 	return 0;
 }
 
-int DeskbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
+int DeskbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 417cebd..2348a2b 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -54,7 +54,7 @@ public:
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
-	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
 
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index ba84c9a..5450bbe 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -145,7 +145,7 @@ uint DoorbotScript::getDialsBitset() const {
 	return bits;
 }
 
-int DoorbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
+int DoorbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index cc3428c..25d66ac 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -70,7 +70,7 @@ public:
 	 */
 	virtual uint getDialsBitset() const;
 
-	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index b37274a..fe45624 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -125,7 +125,7 @@ uint LiftbotScript::getDialsBitset() const {
 }
 
 
-int LiftbotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
+int LiftbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 6e38287..8fec92e 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -67,7 +67,7 @@ public:
 	 */
 	virtual uint getDialsBitset() const;
 
-	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 998048f..dc96e8f 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -94,7 +94,7 @@ int MaitreDScript::proc23() const {
 	return 0;
 }
 
-int MaitreDScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
+int MaitreDScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index c210f71..4b6d967 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -58,7 +58,7 @@ public:
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
-	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
 
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index 358c943..d69f6b7 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -107,7 +107,7 @@ int ParrotScript::proc23() const {
 	return 0;
 }
 
-int ParrotScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
+int ParrotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index 921dc22..2da5897 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -53,7 +53,7 @@ public:
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
 	virtual int proc23() const;
-	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
 
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index cb1c12f..346c75e 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -94,7 +94,7 @@ int SuccUBusScript::proc23() const {
 	return 0;
 }
 
-int SuccUBusScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
+int SuccUBusScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index c5ba51e..1ff07d4 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -56,7 +56,7 @@ public:
 
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc23() const;
-	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
 
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 68e7446..6199f11 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -450,7 +450,7 @@ const TTscriptMapping *TTnpcScript::getMapping(int index) {
 	return nullptr;
 }
 
-int TTnpcScript::proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const {
+int TTnpcScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
 	return 0;
 }
 
@@ -789,7 +789,7 @@ int TTnpcScript::processEntries(const TTsentenceEntries *entries, uint entryCoun
 					if (!flag2) {
 						flag = false;
 					} else {
-						int result = proc25(entry._field2C & 0xFFFFFF, entry._field0,
+						int result = proc25(entry._field2C & 0xFFFFFF, &entry._field0,
 							roomScript, sentence);
 						if (result == 2)
 							return 2;
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index ff4c34e..346ed69 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -356,7 +356,7 @@ public:
 	virtual uint getDialsBitset() const { return 0; }
 	
 	virtual const TTscriptMapping *getMapping(int index);
-	virtual int proc25(int val1, int val2, TTroomScript *roomScript, TTsentence *sentence) const;
+	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void save(SimpleFile *file);
 	virtual void load(SimpleFile *file);
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 94cc265..2e40dd7 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -51,7 +51,6 @@ private:
 	CScriptHandler *_owner;
 	int _inputCtr;
 	int _field34;
-	int _field38;
 	TTsentenceNode *_nodesP;
 	int _field5C;
 	int _status;
@@ -64,6 +63,7 @@ public:
 	TTsentenceConcept _sentenceConcept;
 	TTstring _initialLine;
 	TTstring _normalizedLine;
+	int _field38;
 	int _field58;
 	TTroomScript *_roomScript;
 	TTnpcScript *_npcScript;


Commit: fcb42d57150297725bd0f4aacb802fda78ec5695
    https://github.com/scummvm/scummvm/commit/fcb42d57150297725bd0f4aacb802fda78ec5695
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-25T21:01:36-04:00

Commit Message:
TITANIC: Added Bellbot & Deskbot proc25

Changed paths:
    engines/titanic/pet_control/pet_control.h
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 5e77b15..362fc11 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -524,7 +524,7 @@ public:
 	/**
 	 * Returns the elevator number for the player's currently assigned room
 	 */
-	int getRoomsElevatorNum1() const {
+	int getAssignedElevatorNum() const {
 		return _rooms.getAssignedElevatorNum();
 	}
 
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index d3e25ea..93fa50e 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -868,7 +868,7 @@ uint BarbotScript::getDialsBitset() const {
 	return bits;
 }
 
-int BarbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
+int BarbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	int v34 = get34();
 	uint id = 0;
 
@@ -965,7 +965,7 @@ int BarbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TT
 				return 2;
 			} else {
 				if (getDialRegion(1) == 1) {
-					if (*val2 != 251650)
+					if (*srcIdP != 251650)
 						id = 251651;
 				} else {
 					addResponse(getDialRegion(0) != 0 ? 51444 : 51530);
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 4ce9be6..90f4d95 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -76,7 +76,7 @@ public:
 	 */
 	virtual uint getDialsBitset() const;
 
-	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 66719be..72ea5a4 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -23,6 +23,7 @@
 #include "common/textconsole.h"
 #include "titanic/true_talk/bellbot_script.h"
 #include "titanic/true_talk/true_talk_manager.h"
+#include "titanic/core/node_item.h"
 
 namespace Titanic {
 
@@ -90,8 +91,87 @@ int BellbotScript::proc23() const {
 	return 0;
 }
 
-int BellbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
-	warning("TODO");
+int BellbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+	switch (val1) {
+	case 1:
+		addResponse(getDialogueId(*srcIdP));
+		applyResponse();
+		return 2;
+
+	case 2:
+		addResponse(getDialogueId(*srcIdP));
+		addResponse(getDialogueId(getRandomNumber(2) == 1 ? 200192 : 200157));
+		addResponse(getDialogueId(200176));
+		applyResponse();
+		return 2;
+
+	case 21:
+		if (CTrueTalkManager::getStateValue(7) == 0) {
+			selectResponse(21372);
+			applyResponse();
+			return 2;
+		}
+
+		if (!sentence->localWord("broken") && !sentence->contains("broken") &&
+				CTrueTalkManager::_currentNPC) {
+			CNodeItem *node = CTrueTalkManager::_currentNPC->getNode();
+			if (node) {
+				CString nodeName = node->getName();
+				if (nodeName == "5" || nodeName == "6" || nodeName == "7") {
+					CTrueTalkManager::triggerAction(29, 2);
+					selectResponse(201571);
+					applyResponse();
+					return 2;
+				}
+			}
+		}
+
+		CTrueTalkManager::triggerAction(29, 1);
+		selectResponse(201771);
+		applyResponse();
+		return 2;
+
+	case 22:
+		if (CTrueTalkManager::getStateValue(7) == 0) {
+			selectResponse(21372);
+			applyResponse();
+			return 2;
+		}
+
+		if (!sentence->localWord("broken") && !sentence->contains("broken") &&
+			CTrueTalkManager::_currentNPC) {
+			CNodeItem *node = CTrueTalkManager::_currentNPC->getNode();
+			if (node) {
+				CString nodeName = node->getName();
+				if (nodeName == "5" || nodeName == "6" || nodeName != "7") {
+					CTrueTalkManager::triggerAction(29, 2);
+					selectResponse(201571);
+					applyResponse();
+					return 2;
+				}
+			}
+		}
+
+		CTrueTalkManager::triggerAction(29, 1);
+		selectResponse(201771);
+		applyResponse();
+		return 2;
+
+	case 23:
+	case 24:
+		if (CTrueTalkManager::getStateValue(7) == 0) {
+			selectResponse(21372);
+			applyResponse();
+			return 2;
+		}
+
+		CTrueTalkManager::triggerAction(29, val1 == 23 ? 3 : 4);
+		break;
+
+	default:
+		break;
+	}
+
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index dbe3d62..e990e32 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -62,7 +62,7 @@ public:
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
 
-	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index b50f4ad..20431b3 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -86,8 +86,48 @@ int DeskbotScript::proc23() const {
 	return 0;
 }
 
-int DeskbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
-	warning("TODO");
+int DeskbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+	uint id;
+
+	switch (val1) {
+	case 1:
+		id = *srcIdP;
+		if (id == 240431 || id == 240432) {
+			switch (getValue(1)) {
+			case 1:
+				id = 240336;
+				break;
+			case 2:
+				id = addAssignedRoomDialogue();
+				break;
+			case 3:
+				if (getValue(3) == 1) {
+					if (id == 240431)
+						id = 240432;
+				}
+				else {
+					if (id == 240432)
+						id = 240431;
+				}
+			default:
+				break;
+			}
+
+			addResponse(getDialogueId(id));
+			applyResponse();
+			return 2;
+		}
+		break;
+
+	case 2:
+		if (getValue(1) == 1)
+			return true;
+		break;
+
+	default:
+		break;
+	}
+	
 	return 0;
 }
 
@@ -115,4 +155,25 @@ bool DeskbotScript::isDial1Low() const {
 	return getDialRegion(1) == 0;
 }
 
+int DeskbotScript::addAssignedRoomDialogue() {
+	if (isDial1Medium()) {
+		addResponse(getDialogueId(240407));
+		addResponse(getDialogueId(241510));
+		CTrueTalkManager::setFlags(1, 1);
+		CTrueTalkManager::triggerAction(19, 1);
+
+		int roomNum, floorNum, elevatorNum;
+		getAssignedRoom(&roomNum, &floorNum, &elevatorNum);
+
+		addResponse(getDialogueId(241317 + roomNum));
+		addResponse(getDialogueId(241271 + floorNum));
+		addResponse(getDialogueId(241511));
+		addResponse(getDialogueId(241313 + elevatorNum));
+
+		return 241512;
+	} else {
+		return 240567;
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 2348a2b..2cc8145 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -34,6 +34,11 @@ private:
 	 * Setup sentence data
 	 */
 	void setupSentences();
+
+	/**
+	 * Adds dialogue for the player's assigned room
+	 */
+	int addAssignedRoomDialogue();
 public:
 	DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
@@ -54,7 +59,7 @@ public:
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
-	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
 
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 5450bbe..0ed9a68 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -145,7 +145,7 @@ uint DoorbotScript::getDialsBitset() const {
 	return bits;
 }
 
-int DoorbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
+int DoorbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 25d66ac..233a247 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -70,7 +70,7 @@ public:
 	 */
 	virtual uint getDialsBitset() const;
 
-	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index fe45624..123eb7f 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -125,7 +125,7 @@ uint LiftbotScript::getDialsBitset() const {
 }
 
 
-int LiftbotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
+int LiftbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 8fec92e..db85a85 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -67,7 +67,7 @@ public:
 	 */
 	virtual uint getDialsBitset() const;
 
-	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index dc96e8f..a59583c 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -94,7 +94,7 @@ int MaitreDScript::proc23() const {
 	return 0;
 }
 
-int MaitreDScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
+int MaitreDScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 4b6d967..91732cd 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -58,7 +58,7 @@ public:
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
-	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
 
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index d69f6b7..01d998d 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -107,7 +107,7 @@ int ParrotScript::proc23() const {
 	return 0;
 }
 
-int ParrotScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
+int ParrotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index 2da5897..e832f7c 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -53,7 +53,7 @@ public:
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
 	virtual int proc23() const;
-	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
 
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 346c75e..876cd16 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -94,7 +94,7 @@ int SuccUBusScript::proc23() const {
 	return 0;
 }
 
-int SuccUBusScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
+int SuccUBusScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 1ff07d4..9e393b8 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -56,7 +56,7 @@ public:
 
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc23() const;
-	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
 
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 6199f11..7a2ab85 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -450,7 +450,7 @@ const TTscriptMapping *TTnpcScript::getMapping(int index) {
 	return nullptr;
 }
 
-int TTnpcScript::proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence) {
+int TTnpcScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	return 0;
 }
 
@@ -1017,4 +1017,31 @@ bool TTnpcScript::sentence2C(TTsentence *sentence) {
 	return sentence->_field2C >= 2 && sentence->_field2C <= 7;
 }
 
+void TTnpcScript::getAssignedRoom(int *roomNum, int *floorNum, int *elevatorNum) const {
+	if (roomNum)
+		*roomNum = 5;
+	if (floorNum)
+		*floorNum = 40;
+	if (elevatorNum)
+		*elevatorNum = 3;
+
+	CGameManager *gameManager = g_vm->_trueTalkManager->getGameManager();
+	CPetControl *petControl = getPetControl(gameManager);
+	if (petControl) {
+		if (roomNum)
+			*roomNum = petControl->getAssignedRoomNum();
+		if (floorNum)
+			*floorNum = petControl->getAssignedFloorNum();
+		if (elevatorNum)
+			*elevatorNum = petControl->getAssignedElevatorNum();
+	}
+
+	if (floorNum)
+		*floorNum = CLIP(*floorNum, 1, 42);
+	if (roomNum)
+		*roomNum = CLIP(*roomNum, 1, 18);
+	if (elevatorNum)
+		*elevatorNum = CLIP(*elevatorNum, 1, 4);
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 346ed69..5b992f0 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -285,6 +285,11 @@ protected:
 	 * Gets the True Talk state value
 	 */
 	bool getStateValue() const;
+
+	/**
+	 * Gets the assigned room's room, floor, and elevator number
+	 */
+	void getAssignedRoom(int *roomNum, int *floorNum, int *elevatorNum) const;
 public:
 	static void init();
 	static void deinit();
@@ -356,7 +361,7 @@ public:
 	virtual uint getDialsBitset() const { return 0; }
 	
 	virtual const TTscriptMapping *getMapping(int index);
-	virtual int proc25(int val1, const int *val2, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void save(SimpleFile *file);
 	virtual void load(SimpleFile *file);


Commit: 2faa3125c0978bbfceecc8913148f0f5eefb1a2e
    https://github.com/scummvm/scummvm/commit/2faa3125c0978bbfceecc8913148f0f5eefb1a2e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-25T22:07:23-04:00

Commit Message:
TITANIC: Added DoorbotScript proc25

Changed paths:
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h



diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 0ed9a68..04530f1 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -31,6 +31,26 @@ static const int STATE_ARRAY[9] = {
 	0x2E2A, 0x2E2B, 0x2E2C, 0x2E2D, 0x2E2E, 0x2E2F, 0x2E30, 0x2E31, 0x2E32
 };
 
+struct RoomDialogueId {
+	int _roomNum;
+	int _dialogueId;
+};
+static const RoomDialogueId ROOM_DIALOGUES1[] = {
+	{ 100, 10523 }, { 101, 10499 }, { 107, 10516 }, { 108, 10500 },
+	{ 109, 10490 }, { 110, 10504 }, { 111, 10506 }, { 112, 10498 },
+	{ 113, 10502 }, { 114, 10507 }, { 115, 10497 }, { 116, 10508 },
+	{ 117, 10505 }, { 118, 10505 }, { 122, 10516 }, { 123, 10383 },
+	{ 124, 10510 }, { 125, 10511 }, { 126, 10513 }, { 127, 10512 },
+	{ 128, 10495 }, { 129, 10496 }, { 130, 10491 }, { 131, 10493 },
+	{ 132, 10492 }, { 0, 0 }
+};
+static const RoomDialogueId ROOM_DIALOGUES2[] = {
+	{ 102, 221981 }, { 110, 221948 }, { 111, 221968 }, { 107, 222000 },
+	{ 101, 221935 }, { 112, 221924 }, { 113, 221942 }, { 116, 221977 },
+	{ 124, 221987 }, { 125, 221984 }, { 127, 221991 }, { 128, 221916 },
+	{ 129, 221919 }, { 131, 221912 }, { 132, 221908 }, { 0, 0 }
+};
+
 DoorbotScript::DoorbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
@@ -146,6 +166,176 @@ uint DoorbotScript::getDialsBitset() const {
 }
 
 int DoorbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+	int id2, id = 0;
+
+	switch (val1) {
+	case 2:
+		if (getValue(1) != 1)
+			return 1;
+		break;
+	case 3:
+		if (getValue(1) != 2)
+			return 1;
+		break;
+	case 4:
+		if (getValue(1) != 3)
+			return 1;
+		break;
+	case 5:
+		if (getValue(1) == 3)
+			return 1;
+	case 6:
+		if (getRoom54(132))
+			return 1;
+		break;
+	case 9:
+		if (sentence->localWord("my") || sentence->contains("my"))
+			return true;
+		id2 = getRoomDialogueId1(roomScript);
+		if (id2) {
+			addResponse(id2);
+			applyResponse();
+			return 2;
+		}
+		break;
+	case 11:
+		switch (getValue(1)) {
+		case 1:
+			id = 220837;
+			break;
+		case 2:
+			id = 220849;
+			break;
+		default:
+			id = 220858;
+			break;
+		}
+		break;
+	case 12:
+		if (getValue(4) != 1)
+			id = 221157;
+		break;
+	case 13:
+		if (getValue(4) != 2)
+			id = 221157;
+		break;
+	case 14:
+		if (getValue(4) != 3)
+			id = 221157;
+		break;
+	case 15:
+		if (getValue(4) != 0)
+			id = 221157;
+		break;
+	case 16:
+		if (!sentence->localWord("weather"))
+			return true;
+		switch (getRandomNumber(4)) {
+		case 1:
+			if (getValue(4) != 0)
+				id = 221354 - getRandomNumber(2) ? -489 : 0;
+			break;
+		case 2:
+			switch (getValue(4)) {
+			case 0:
+				id = 220851;
+				break;
+			case 1:
+				id = 221268;
+				break;
+			case 2:
+				id = 221270;
+				break;
+			default:
+				id = 220865;
+			}
+			break;
+		case 3:
+			id = 221280;
+			break;
+		default:
+			break;
+		}
+		break;
+	case 17:
+		if (get34())
+			return 1;
+		set34(0);
+		break;
+	case 18:
+		if (roomScript->_scriptId == 100) {
+			CTrueTalkManager::triggerAction(3, 0);
+			return 2;
+		}
+		break;
+	case 19:
+		CTrueTalkManager::_v9 = 104;
+		CTrueTalkManager::triggerAction(4, 0);
+		break;
+	case 20:
+		CTrueTalkManager::triggerAction(28, 0);
+		break;
+	case 22:
+		CTrueTalkManager::triggerAction(29, 1);
+		break;
+	case 23:
+		CTrueTalkManager::triggerAction(29, 2);
+		break;
+	case 24:
+		CTrueTalkManager::triggerAction(29, 3);
+		break;
+	case 25:
+		CTrueTalkManager::triggerAction(29, 4);
+		break;
+	case 26:
+		if (!sentence->localWord("my") && !sentence->contains("my"))
+			return 1;
+		break;
+	case 27:
+		if (!sentence->localWord("earth") && !sentence->contains("earth"))
+			return 1;
+		break;
+	case 28:
+		id2 = getRoomDialogueId2(roomScript);
+		if (id2) {
+			addResponse(id2);
+			applyResponse();
+			return 2;
+		}
+		break;
+	case 29:
+		if (sentence->localWord("another") || sentence->localWord("more") ||
+				sentence->localWord("additional") || sentence->contains("another") ||
+				sentence->contains("more") || sentence->contains("additional")) { 
+			addResponse(getDialogueId(220058));
+			applyResponse();
+			return 2;
+		}
+		break;
+	case 30:
+		if (!sentence->localWord("because") && !sentence->contains("because"))
+			return 1;
+		break;
+	case 0x200:
+		if (getValue(4) != 1)
+			id = 221157;
+		break;
+	case 0x201:
+		if (getValue(4) != 2)
+			id = 221157;
+		break;
+	case 0x202:
+		if (getValue(4) != 3)
+			id = 221157;
+		break;
+	case 0x203:
+		if (getValue(4) != 0)
+			id = 221157;
+		break;
+	default:
+		break;
+	}
+
 	warning("TODO");
 	return 0;
 }
@@ -177,4 +367,22 @@ int DoorbotScript::setResponse(int dialogueId, int v34) {
 	return 2;
 }
 
+int DoorbotScript::getRoomDialogueId1(const TTroomScript *roomScript) {
+	for (const RoomDialogueId *r = ROOM_DIALOGUES1; r->_roomNum; ++r) {
+		if (r->_roomNum == roomScript->_scriptId == r->_roomNum)
+			return getDialogueId(r->_dialogueId);
+	}
+
+	return 0;
+}
+
+int DoorbotScript::getRoomDialogueId2(const TTroomScript *roomScript) {
+	for (const RoomDialogueId *r = ROOM_DIALOGUES2; r->_roomNum; ++r) {
+		if (r->_roomNum == roomScript->_scriptId == r->_roomNum)
+			return getDialogueId(r->_dialogueId);
+	}
+
+	return 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 233a247..3ec4cfb 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -40,6 +40,16 @@ private:
 	 * Sets a response
 	 */
 	int setResponse(int dialogueId, int v34 = -1);
+
+	/**
+	 * Gets the dialogue Id for a given room
+	 */
+	int getRoomDialogueId1(const TTroomScript *roomScript);
+
+	/**
+	 * Gets the dialogue Id for a given room
+	 */
+	int getRoomDialogueId2(const TTroomScript *roomScript);
 public:
 	DoorbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);


Commit: f1c4647c9b721d5a1b166d0974a98d9f8b5ae894
    https://github.com/scummvm/scummvm/commit/f1c4647c9b721d5a1b166d0974a98d9f8b5ae894
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-25T23:51:41-04:00

Commit Message:
TITANIC: Added LiftbotScript proc25

Changed paths:
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h



diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 123eb7f..c91bd73 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -126,7 +126,109 @@ uint LiftbotScript::getDialsBitset() const {
 
 
 int LiftbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
-	warning("TODO");
+	static const int ARRAY13[] = {
+		210724, 210735, 210746, 210757, 210758, 210759, 210760,
+		210761, 210762, 210725, 210726, 210727, 210728, 210729,
+		210730, 210731, 210732, 210733, 210734, 210736, 210737,
+		210738, 210739, 210740, 210741, 210742, 210743, 210744,
+		210745, 210747, 210748, 210749, 210750, 210751, 210752,
+		210753, 210754, 210755, 210756
+	};
+	static const int ARRAY14[] = {
+		0, 210849, 210850, 210851, 210852, 210838, 210839, 210840, 210841, 0
+	};
+
+	get34();
+	int stateVal;
+
+	switch (val1) {
+	case 1:
+		if (getValue(1) != 1)
+			return 1;
+		break;
+	case 2:
+		if (getValue(1) != 2)
+			return 1;
+		break;
+	case 3:
+		if (getValue(1) != 3)
+			return 1;
+		break;
+	case 4:
+	case 5:
+		return !sentence1(sentence);
+	case 6:
+		if (sentence->localWord("big") || sentence->localWord("small")) {
+			addResponse(getDialogueId(210215));
+			applyResponse();
+		} else if (sentence->localWord("my") || sentence->contains("my") ||
+				sentence->contains("bedroom") || sentence->contains("state")) {
+			addResponse1(CTrueTalkManager::getStateValue(4), true, 0);
+		} else {
+			selectResponse(210763);
+			applyResponse();
+		}
+		return 2;
+	case 7:
+		if (!sentence->localWord("ill") && !sentence->localWord("well"))
+			return 1;
+		break;
+	case 8:
+		if (!sentence->localWord("long"))
+			return 1;
+		break;
+	case 9:
+		if (addResponse1(1, false, 0))
+			return 2;
+		break;
+	case 10:
+		if (addResponse1(39, false, 0))
+			return 2;
+		break;
+	case 11:
+		if (getState6() == 2 || getState6() == 4)
+			return 1;
+		break;
+	case 12:
+		if (getState6() == 1 || getState6() == 3)
+			return 1;
+		break;
+	case 13:
+		selectResponse(ARRAY13[getState5()]);
+		applyResponse();
+		return 2;
+	case 14:
+		stateVal = getState6();
+		if (sentence->contains("elevator") ||
+			(!sentence->contains("lift") && getRandomNumber(100) > 60))
+			stateVal += 4;
+		selectResponse(ARRAY14[stateVal]);
+		applyResponse();
+		return 2;
+	case 15:
+		if (getRandomNumber(100) > 60) {
+			addResponse(getDialogueId(210440));
+		} else {
+			addResponse(getDialogueId(210906));
+			addResponse(getDialogueId(210901));
+		}
+		applyResponse();
+		return 2;
+	case 16:
+		if (sentence->contains("elevator") || sentence->contains("elavator"))
+			addResponse(30579);
+		else
+			addResponse(30580);
+		applyResponse();
+		return 2;
+	case 17:
+		if (sentence->localWord("restaurant") || sentence->contains("restaurant"))
+			return 1;
+		break;
+	default:
+		break;
+	}
+
 	return 0;
 }
 
@@ -139,4 +241,103 @@ void LiftbotScript::setDialRegion(int dialNum, int region) {
 	applyResponse();
 }
 
+int LiftbotScript::getState5() const {
+	int val = CTrueTalkManager::getStateValue(5);
+	return CLIP(val, 1, 39);
+}
+
+int LiftbotScript::getState6() const {
+	int val = CTrueTalkManager::getStateValue(6);
+	return (val < 1 || val > 4) ? 1 : val;
+}
+
+int LiftbotScript::addDialogueAndState(int id, int state) {
+	addResponse(id);
+	applyResponse();
+
+	if (state != 1)
+		set34(state);
+	return 2;
+}
+
+int LiftbotScript::addResponse1(int index, bool flag, int id) {
+	static const int DIALOGUE_IDS[37] = {
+		210735, 210746, 210757, 210758, 210759, 210760, 210761, 210762,
+		210725, 210726, 210727, 210728, 210729, 210730, 210731, 210732,
+		210733, 210734, 210736, 210737, 210738, 210739, 210740, 210741,
+		210742, 210743, 210744, 210745, 210747, 210748, 210749, 210750,
+		210751, 210752, 210753, 210754, 210755
+	};
+
+	int stateVal = getState6();
+	int maxIndex = (stateVal == 2 || stateVal == 4) ? 27 : 39;
+
+	if (index < 1 || index > maxIndex) {
+		addResponse(getDialogueId(maxIndex == 27 ? 210587 : 210586));
+		applyResponse();
+		return 1;
+	} else if (index == getState5()) {
+		if (index == 1) {
+			addResponse(30558 - getRandomBit() ? 290 : 0);
+			addResponse(getDialogueId(210589));
+		} else {
+			if (index == 39)
+				addResponse(30346);
+			addResponse(getDialogueId(210589));
+		}
+
+		applyResponse();
+		return 2;
+	}
+
+	stateVal = getValue(1);
+	if (index >= 2 && index <= 19 && stateVal > 1) {
+		addResponse(getDialogueId(210203));
+		applyResponse();
+		set34(7);
+		return true;
+	}
+
+	if (index >= 20 && index <= 27 && stateVal > 2) {
+		addResponse(getDialogueId(210210));
+		applyResponse();
+		set34(8);
+		return true;
+	}
+
+	if (flag) {
+		if (index == 1) {
+			selectResponse(30558 - getRandomBit() ? 290 : 0);
+		} else if (index == 39) {
+			addResponse(30346);
+		} else {
+			if (getRandomNumber(100) > 35 && index >= 2 && index <= 38) {
+				addResponse(getDialogueId(DIALOGUE_IDS[index - 2]));
+			}
+
+			addResponse(getDialogueId(210588));
+		}
+
+		if (id) {
+			if (id == 210717 || id == 210716 || id == 210719 || id == 210718) {
+				addResponse(getDialogueId(210720));
+				addResponse(getDialogueId(id));
+				addResponse(getDialogueId(210715));
+			} else {
+				addResponse(getDialogueId(id));
+			}
+		}
+
+		applyResponse();
+	}
+
+	CTrueTalkManager::triggerAction(2, index);
+	return flag;
+}
+
+int LiftbotScript::sentence1(const TTsentence *sentence) {
+	warning("TODO: LiftbotScript::sentence1");
+	return 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index db85a85..03c4eac 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -35,6 +35,16 @@ private:
 	 * Setup sentence data
 	 */
 	void setupSentences();
+
+	int addResponse1(int mode, bool flag, int id);
+	int sentence1(const TTsentence *sentence);
+	int getState5() const;
+	int getState6() const;
+
+	/**
+	 * Adds a dialogue response and sets the state
+	 */
+	int addDialogueAndState(int id, int state);
 public:
 	LiftbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);


Commit: 40955e590c627f600ae4708eb1980cf2ab81931d
    https://github.com/scummvm/scummvm/commit/40955e590c627f600ae4708eb1980cf2ab81931d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-26T17:39:40-04:00

Commit Message:
TITANIC: Handled tag switch in BarbotScript handleQuote

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 93fa50e..141603c 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -841,8 +841,112 @@ ScriptChangedResult BarbotScript::scriptChanged(TTscriptBase *roomScript, uint i
 }
 
 bool BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-	int val, uint tagId, uint remainder) const {
-	warning("TODO: handleQuote");
+		int val, uint tagId, uint remainder) const {
+	switch (tagId) {
+	case MKTAG('A', 'D', 'V', 'T'):
+	case MKTAG('A', 'R', 'T', 'I'):
+	case MKTAG('A', 'R', 'T', 'Y'):
+	case MKTAG('B', 'R', 'N', 'D'):
+	case MKTAG('C', 'O', 'M', 'D'):
+	case MKTAG('D', 'N', 'C', 'E'):
+	case MKTAG('H', 'B', 'B', 'Y'):
+	case MKTAG('M', 'A', 'G', 'S'):
+	case MKTAG('L', 'I', 'T', 'R'):
+	case MKTAG('M', 'C', 'P', 'Y'):
+	case MKTAG('M', 'I', 'N', 'S'):
+	case MKTAG('M', 'U', 'S', 'I'):
+	case MKTAG('N', 'I', 'K', 'E'):
+	case MKTAG('S', 'F', 'S', 'F'):
+	case MKTAG('S', 'O', 'A', 'P'):
+	case MKTAG('S', 'O', 'N', 'G'):
+	case MKTAG('S', 'P', 'R', 'T'):
+	case MKTAG('T', 'E', 'A', 'M'):
+	case MKTAG('T', 'U', 'S', 'H'):
+	case MKTAG('W', 'W', 'E', 'B'):
+		tagId = MKTAG('E', 'N', 'T', 'N');
+		break;
+	case MKTAG('A', 'U', 'T', 'H'):
+	case MKTAG('B', 'A', 'R', 'K'):
+	case MKTAG('B', 'L', 'R', '1'):
+	case MKTAG('B', 'L', 'P', '1'):
+	case MKTAG('B', 'L', 'P', '2'):
+	case MKTAG('B', 'L', 'P', '3'):
+	case MKTAG('B', 'L', 'P', '4'):
+	case MKTAG('B', 'L', 'T', '1'):
+	case MKTAG('B', 'L', 'T', '2'):
+	case MKTAG('B', 'L', 'T', '3'):
+	case MKTAG('B', 'L', 'T', '4'):
+	case MKTAG('B', 'L', 'T', '5'):
+	case MKTAG('B', 'O', 'Y', 'S'):
+	case MKTAG('C', 'O', 'P', 'S'):
+	case MKTAG('D', 'C', 'T', 'R'):
+	case MKTAG('F', 'A', 'M', 'E'):
+	case MKTAG('F', 'A', 'S', 'H'):
+	case MKTAG('G', 'I', 'R', 'L'):
+	case MKTAG('H', 'E', 'R', 'O'):
+	case MKTAG('H', 'O', 'S', 'T'):
+	case MKTAG('K', 'N', 'O', 'B'):
+	case MKTAG('N', 'H', 'R', 'O'):
+	case MKTAG('R', 'A', 'C', 'E'):
+	case MKTAG('S', 'C', 'I', 'T'):
+	case MKTAG('T', 'D', 'U', 'P'):
+	case MKTAG('T', 'W', 'A', 'T'):
+	case MKTAG('W', 'E', 'A', 'T'):
+		tagId = MKTAG('P', 'R', 'S', 'N');
+		break;
+	case MKTAG('C', 'H', 'S', 'E'):
+	case MKTAG('C', 'M', 'N', 'T'):
+	case MKTAG('F', 'I', 'L', 'M'):
+	case MKTAG('J', 'F', 'O', 'D'):
+	case MKTAG('L', 'I', 'Q', 'D'):
+		tagId = MKTAG('F', 'O', 'O', 'D');
+		break;
+	case MKTAG('C', 'R', 'M', 'N'):
+	case MKTAG('C', 'S', 'P', 'Y'):
+	case MKTAG('U', 'B', 'A', 'D'):
+		tagId = MKTAG('U', 'B', 'A', 'D');
+		break;
+	case MKTAG('E', 'A', 'R', 'T'):
+	case MKTAG('H', 'O', 'M', 'E'):
+	case MKTAG('N', 'P', 'L', 'C'):
+	case MKTAG('P', 'L', 'A', 'C'):
+	case MKTAG('P', 'L', 'A', 'N'):
+		tagId = MKTAG('P', 'L', 'A', 'C');
+		break;
+	case MKTAG('F', 'A', 'U', 'N'):
+	case MKTAG('F', 'I', 'S', 'H'):
+	case MKTAG('F', 'L', 'O', 'R'):
+		tagId = MKTAG('N', 'A', 'T', 'R');
+		break;
+	case MKTAG('H', 'H', 'L', 'D'):
+	case MKTAG('T', 'O', 'Y', 'S'):
+	case MKTAG('W', 'E', 'A', 'P'):
+		tagId = MKTAG('M', 'A', 'C', 'H');
+			break;
+	case MKTAG('M', 'L', 'T', 'Y'):
+	case MKTAG('P', 'G', 'R', 'P'):
+	case MKTAG('P', 'T', 'I', 'C'):
+		tagId = MKTAG('G', 'R', 'U', 'P');
+		break;
+	case MKTAG('P', 'K', 'U', 'P'):
+	case MKTAG('S', 'E', 'X', '1'):
+	case MKTAG('S', 'W', 'E', 'R'):
+		tagId = MKTAG('R', 'U', 'D', 'E');
+		break;
+	case MKTAG('P', 'H', 'I', 'L'):
+	case MKTAG('R', 'C', 'K', 'T'):
+	case MKTAG('S', 'C', 'I', 'E'):		
+		tagId = MKTAG('S', 'C', 'I', 'E');
+		break;
+	case MKTAG('T', 'R', 'A', '2'):
+	case MKTAG('T', 'R', 'A', '3'):
+		tagId = MKTAG('T', 'R', 'A', 'V');
+		break;
+	default:
+		break;
+	}
+	
+	warning("TODO: handleQuote - %d", tagId);
 	return false;
 }
 


Commit: 78d8c4e3da631e4749d70cc4923cd12871d0232f
    https://github.com/scummvm/scummvm/commit/78d8c4e3da631e4749d70cc4923cd12871d0232f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-26T18:37:39-04:00

Commit Message:
TITANIC: Handled tag switch in BellbotScript handleQuote

Changed paths:
    engines/titanic/true_talk/bellbot_script.cpp



diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 72ea5a4..ecb503c 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -71,7 +71,113 @@ int BellbotScript::proc15() const {
 }
 
 bool BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-	int val, uint tagId, uint remainder) const {
+		int val, uint tagId, uint remainder) const {
+	switch (tagId) {
+	case MKTAG('A', 'D', 'V', 'T'):
+	case MKTAG('A', 'R', 'T', 'I'):
+	case MKTAG('A', 'R', 'T', 'Y'):
+	case MKTAG('B', 'R', 'N', 'D'):
+	case MKTAG('C', 'O', 'M', 'D'):
+	case MKTAG('D', 'N', 'C', 'E'):
+	case MKTAG('H', 'B', 'B', 'Y'):
+	case MKTAG('L', 'I', 'T', 'R'):
+	case MKTAG('M', 'A', 'G', 'S'):
+	case MKTAG('M', 'C', 'P', 'Y'):
+	case MKTAG('M', 'I', 'N', 'S'):
+	case MKTAG('M', 'U', 'S', 'I'):
+	case MKTAG('N', 'I', 'K', 'E'):
+	case MKTAG('S', 'F', 'S', 'F'):
+	case MKTAG('S', 'O', 'A', 'P'):
+	case MKTAG('S', 'O', 'N', 'G'):
+	case MKTAG('S', 'P', 'R', 'T'):
+	case MKTAG('T', 'E', 'A', 'M'):
+	case MKTAG('T', 'V', 'S', 'H'):
+	case MKTAG('W', 'W', 'E', 'B'):
+		tagId = MKTAG('E', 'N', 'T', 'N');
+		break;
+	case MKTAG('A', 'C', 'T', 'R'):
+	case MKTAG('A', 'C', 'T', 'S'):
+	case MKTAG('A', 'U', 'T', 'H'):
+	case MKTAG('B', 'A', 'R', 'K'):
+	case MKTAG('B', 'A', 'R', 'U'):
+	case MKTAG('B', 'L', 'F', '1'):
+	case MKTAG('B', 'L', 'F', '2'):
+	case MKTAG('B', 'L', 'P', '1'):
+	case MKTAG('B', 'L', 'P', '2'):
+	case MKTAG('B', 'L', 'P', '3'):
+	case MKTAG('B', 'L', 'P', '4'):
+	case MKTAG('B', 'L', 'R', '1'):
+	case MKTAG('B', 'L', 'R', '2'):
+	case MKTAG('B', 'L', 'T', '1'):
+	case MKTAG('B', 'L', 'T', '2'):
+	case MKTAG('B', 'L', 'T', '3'):
+	case MKTAG('B', 'L', 'T', '4'):
+	case MKTAG('B', 'L', 'T', '5'):
+	case MKTAG('C', 'O', 'P', 'S'):
+	case MKTAG('D', 'C', 'T', 'R'):
+	case MKTAG('F', 'A', 'S', 'H'):
+	case MKTAG('F', 'A', 'M', 'E'):
+	case MKTAG('H', 'E', 'R', 'D'):
+	case MKTAG('H', 'O', 'S', 'T'):
+	case MKTAG('K', 'N', 'O', 'B'):
+	case MKTAG('N', 'H', 'R', 'O'):
+	case MKTAG('R', 'A', 'C', 'E'):
+	case MKTAG('S', 'C', 'I', 'T'):
+	case MKTAG('T', 'O', 'U', 'P'):
+	case MKTAG('T', 'W', 'A', 'T'):
+	case MKTAG('W', 'E', 'A', 'T'):
+		tagId = MKTAG('P', 'R', 'S', 'N');
+		break;
+	case MKTAG('C', 'H', 'S', 'E'):
+	case MKTAG('C', 'M', 'N', 't'):
+	case MKTAG('F', 'I', 'L', 'M'):
+	case MKTAG('J', 'F', 'O', 'D'):
+	case MKTAG('L', 'I', 'Q', 'D'):
+		tagId = MKTAG('F', 'O', 'O', 'D');
+		break;
+	case MKTAG('C', 'R', 'I', 'M'):
+	case MKTAG('C', 'S', 'P', 'Y'):
+	case MKTAG('D', 'R', 'U', 'G'):
+		tagId = MKTAG('V', 'B', 'A', 'D');
+		break;
+	case MKTAG('E', 'A', 'R', 'T'):
+	case MKTAG('H', 'O', 'M', 'E'):
+	case MKTAG('N', 'P', 'L', 'C'):
+	case MKTAG('P', 'L', 'A', 'N'):
+		tagId = MKTAG('P', 'L', 'A', 'C');
+		break;
+	case MKTAG('F', 'A', 'U', 'N'):
+	case MKTAG('F', 'I', 'S', 'H'):
+	case MKTAG('F', 'L', 'O', 'R'):
+		tagId = MKTAG('N', 'A', 'T', 'R');
+		break;
+	case MKTAG('H', 'H', 'L', 'D'):
+	case MKTAG('T', 'O', 'Y', 'S'):
+	case MKTAG('W', 'E', 'A', 'P'):
+		tagId = MKTAG('M', 'A', 'C', 'H');
+		break;
+	case MKTAG('M', 'L', 'T', 'Y'):
+	case MKTAG('P', 'G', 'R', 'P'):
+	case MKTAG('P', 'T', 'I', 'C'):
+		tagId = MKTAG('G', 'R', 'U', 'P');
+		break;
+	case MKTAG('P', 'K', 'U', 'P'):
+	case MKTAG('S', 'E', 'X', '1'):
+	case MKTAG('S', 'W', 'E', 'R'):
+		tagId = MKTAG('R', 'U', 'D', 'E');
+		break;
+	case MKTAG('P', 'H', 'I', 'L'):
+	case MKTAG('R', 'C', 'K', 'T'):
+		tagId = MKTAG('S', 'C', 'I', 'E');
+		break;
+	case MKTAG('T', 'R', 'A', '2'):
+	case MKTAG('T', 'R', 'A', '3'):
+		tagId = MKTAG('T', 'R', 'A', 'V');
+		break;
+	default:
+		break;
+	}
+
 	warning("TODO: handleQuote");
 	return false;
 }


Commit: de494c8c27ac2ede69f6e73b76fa48c3a9597314
    https://github.com/scummvm/scummvm/commit/de494c8c27ac2ede69f6e73b76fa48c3a9597314
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-26T19:10:57-04:00

Commit Message:
TITANIC: Handled tag switch in DeskbotScript handleQuote

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/deskbot_script.cpp



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 141603c..cbb58cd 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -889,7 +889,7 @@ bool BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	case MKTAG('N', 'H', 'R', 'O'):
 	case MKTAG('R', 'A', 'C', 'E'):
 	case MKTAG('S', 'C', 'I', 'T'):
-	case MKTAG('T', 'D', 'U', 'P'):
+	case MKTAG('T', 'D', 'V', 'P'):
 	case MKTAG('T', 'W', 'A', 'T'):
 	case MKTAG('W', 'E', 'A', 'T'):
 		tagId = MKTAG('P', 'R', 'S', 'N');
@@ -904,7 +904,7 @@ bool BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	case MKTAG('C', 'R', 'M', 'N'):
 	case MKTAG('C', 'S', 'P', 'Y'):
 	case MKTAG('U', 'B', 'A', 'D'):
-		tagId = MKTAG('U', 'B', 'A', 'D');
+		tagId = MKTAG('V', 'B', 'A', 'D');
 		break;
 	case MKTAG('E', 'A', 'R', 'T'):
 	case MKTAG('H', 'O', 'M', 'E'):
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 20431b3..28eff25 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -66,7 +66,115 @@ ScriptChangedResult DeskbotScript::scriptChanged(TTscriptBase *roomScript, uint
 }
 
 bool DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-	int val, uint tagId, uint remainder) const {
+		int val, uint tagId, uint remainder) const {
+	switch (tagId) {
+	case MKTAG('A', 'D', 'V', 'T'):
+	case MKTAG('A', 'R', 'T', 'I'):
+	case MKTAG('A', 'R', 'T', 'Y'):
+	case MKTAG('B', 'R', 'N', 'D'):
+	case MKTAG('C', 'O', 'M', 'D'):
+	case MKTAG('D', 'N', 'C', 'E'):
+	case MKTAG('H', 'B', 'B', 'Y'):
+	case MKTAG('L', 'I', 'T', 'R'):
+	case MKTAG('M', 'A', 'G', 'S'):
+	case MKTAG('M', 'C', 'P', 'Y'):
+	case MKTAG('M', 'I', 'N', 'S'):
+	case MKTAG('M', 'U', 'S', 'I'):
+	case MKTAG('N', 'I', 'K', 'E'):
+	case MKTAG('S', 'F', 'S', 'F'):
+	case MKTAG('S', 'O', 'A', 'P'):
+	case MKTAG('S', 'O', 'N', 'G'):
+	case MKTAG('S', 'P', 'R', 'T'):
+	case MKTAG('T', 'E', 'A', 'M'):
+	case MKTAG('T', 'V', 'S', 'H'):
+		tagId = MKTAG('E', 'N', 'T', 'N');
+		break;
+	case MKTAG('A', 'C', 'T', 'R'):
+	case MKTAG('A', 'C', 'T', 'S'):
+	case MKTAG('A', 'U', 'T', 'H'):
+	case MKTAG('B', 'A', 'R', 'K'):
+	case MKTAG('B', 'A', 'R', 'U'):
+	case MKTAG('B', 'L', 'F', '1'):
+	case MKTAG('B', 'L', 'F', '2'):
+	case MKTAG('B', 'L', 'P', '1'):
+	case MKTAG('B', 'L', 'P', '2'):
+	case MKTAG('B', 'L', 'P', '3'):
+	case MKTAG('B', 'L', 'P', '4'):
+	case MKTAG('B', 'L', 'R', '1'):
+	case MKTAG('B', 'L', 'R', '2'):
+	case MKTAG('B', 'L', 'T', '1'):
+	case MKTAG('B', 'L', 'T', '2'):
+	case MKTAG('B', 'L', 'T', '3'):
+	case MKTAG('B', 'L', 'T', '4'):
+	case MKTAG('B', 'L', 'T', '5'):
+	case MKTAG('B', 'O', 'Y', 'S'):
+	case MKTAG('C', 'O', 'P', 'S'):
+	case MKTAG('D', 'C', 'T', 'R'):
+	case MKTAG('F', 'A', 'M', 'E'):
+	case MKTAG('F', 'A', 'S', 'H'):
+	case MKTAG('G', 'I', 'R', 'L'):
+	case MKTAG('H', 'E', 'R', 'O'):
+	case MKTAG('H', 'O', 'S', 'T'):
+	case MKTAG('K', 'N', 'O', 'B'):
+	case MKTAG('N', 'H', 'R', 'O'):
+	case MKTAG('R', 'A', 'C', 'E'):
+	case MKTAG('S', 'C', 'I', 'T'):
+	case MKTAG('T', 'D', 'V', 'P'):
+	case MKTAG('T', 'W', 'A', 'T'):
+	case MKTAG('W', 'E', 'A', 'T'):
+	case MKTAG('W', 'W', 'E', 'B'):
+		tagId = MKTAG('P', 'R', 'S', 'N');
+		break;
+	case MKTAG('C', 'H', 'S', 'E'):
+	case MKTAG('C', 'M', 'N', 'T'):
+	case MKTAG('F', 'I', 'L', 'M'):
+	case MKTAG('J', 'F', 'O', 'D'):
+	case MKTAG('L', 'I', 'Q', 'D'):
+		tagId = MKTAG('F', 'O', 'O', 'D');
+		break;
+	case MKTAG('C', 'R', 'I', 'M'):
+	case MKTAG('C', 'S', 'P', 'Y'):
+	case MKTAG('D', 'R', 'U', 'G'):
+		tagId = MKTAG('V', 'B', 'A', 'D');
+		break;
+	case MKTAG('E', 'A', 'R', 'T'):
+	case MKTAG('H', 'O', 'M', 'E'):
+	case MKTAG('N', 'P', 'L', 'C'):
+	case MKTAG('P', 'L', 'A', 'N'):
+		tagId = MKTAG('P', 'L', 'A', 'C');
+		break;
+	case MKTAG('F', 'A', 'U', 'N'):
+	case MKTAG('F', 'I', 'S', 'H'):
+	case MKTAG('F', 'L', 'O', 'R'):
+		tagId = MKTAG('N', 'A', 'T', 'R');
+		break;
+	case MKTAG('H', 'H', 'L', 'D'):
+	case MKTAG('T', 'O', 'Y', 'S'):
+	case MKTAG('W', 'E', 'A', 'P'):
+		tagId = MKTAG('M', 'A', 'C', 'H');
+		break;
+	case MKTAG('M', 'L', 'T', 'Y'):
+	case MKTAG('P', 'G', 'R', 'P'):
+	case MKTAG('P', 'T', 'I', 'C'):
+		tagId = MKTAG('G', 'R', 'U', 'P');
+		break;
+	case MKTAG('P', 'K', 'U', 'P'):
+	case MKTAG('S', 'E', 'X', '1'):
+	case MKTAG('S', 'W', 'E', 'R'):
+		tagId = MKTAG('R', 'U', 'D', 'E');
+		break;
+	case MKTAG('P', 'H', 'I', 'L'):
+	case MKTAG('R', 'C', 'K', 'T'):
+		tagId = MKTAG('S', 'C', 'I', 'E');
+		break;
+	case MKTAG('T', 'R', 'A', '2'):
+	case MKTAG('T', 'R', 'A', '3'):
+		tagId = MKTAG('T', 'R', 'A', 'V');
+		break;
+	default:
+		break;
+	}
+	
 	warning("TODO");
 	return 0;
 }


Commit: 04931130b49482262f24bf330a698d254690bb90
    https://github.com/scummvm/scummvm/commit/04931130b49482262f24bf330a698d254690bb90
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-26T20:25:44-04:00

Commit Message:
TITANIC: Split NPC script support data structures to their own file

Changed paths:
  A engines/titanic/true_talk/script_support.cpp
  A engines/titanic/true_talk/script_support.h
    engines/titanic/module.mk
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 60a95bc..1107fdd 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -481,6 +481,7 @@ MODULE_OBJS := \
 	true_talk/succubus_script.o \
 	true_talk/title_engine.o \
 	true_talk/script_handler.o \
+	true_talk/script_support.o \
 	true_talk/true_talk_manager.o \
 	true_talk/tt_action.o \
 	true_talk/tt_adj.o \
diff --git a/engines/titanic/true_talk/script_support.cpp b/engines/titanic/true_talk/script_support.cpp
new file mode 100644
index 0000000..857d774
--- /dev/null
+++ b/engines/titanic/true_talk/script_support.cpp
@@ -0,0 +1,143 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/script_support.h"
+#include "titanic/titanic.h"
+
+namespace Titanic {
+
+int TTnpcScriptResponse::size() const {
+	for (int idx = 0; idx < 4; ++idx) {
+		if (_values[idx] == 0)
+			return idx;
+	}
+
+	return 4;
+}
+
+/*------------------------------------------------------------------------*/
+
+TTscriptRange::TTscriptRange(uint id, const Common::Array<uint> &values, 
+		bool isRandom, bool isSequential) :
+		_id(id), _nextP(nullptr) {
+	_mode = SF_NONE;
+	if (isRandom)
+		_mode = SF_RANDOM;
+	if (isSequential)
+		_mode = SF_SEQUENTIAL;
+
+	for (uint idx = 0; idx < values.size(); ++idx)
+		_values.push_back(values[idx]);
+}
+
+/*------------------------------------------------------------------------*/
+
+
+bool TTsentenceEntry::load(Common::SeekableReadStream *s) {
+	if (s->pos() >= s->size())
+		return false;
+
+	_field0 = s->readUint32LE();
+	_field4 = s->readUint32LE();
+	_string8 = readStringFromStream(s);
+	_fieldC = s->readUint32LE();
+	_string10 = readStringFromStream(s);
+	_string14 = readStringFromStream(s);
+	_string18 = readStringFromStream(s);
+	_string1C = readStringFromStream(s);
+	_field20 = s->readUint32LE();
+	_string24 = readStringFromStream(s);
+	_field28 = s->readUint32LE();
+	_field2C = s->readUint32LE();
+	_field30 = s->readUint32LE();
+
+	return true;
+}
+
+/*------------------------------------------------------------------------*/
+
+void TTsentenceEntries::load(const CString &resName) {
+	TTsentenceEntry entry;
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(resName);
+
+	while (entry.load(r))
+		push_back(entry);
+
+	delete r;
+}
+
+/*------------------------------------------------------------------------*/
+
+TTscriptMapping::TTscriptMapping() : _id(0) {
+	Common::fill(&_values[0], &_values[8], 0);
+}
+
+/*------------------------------------------------------------------------*/
+
+void TTscriptMappings::load(const char *name, int valuesPerMapping) {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+	_valuesPerMapping = valuesPerMapping;
+
+	while (r->pos() < r->size()) {
+		resize(size() + 1);
+		TTscriptMapping &m = (*this)[size() - 1];
+
+		m._id = r->readUint32LE();
+		for (int idx = 0; idx < valuesPerMapping; ++idx)
+			m._values[idx] = r->readUint32LE();
+	}
+
+	delete r;
+}
+
+/*------------------------------------------------------------------------*/
+
+void TTtagMappings::load(const char *name) {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+
+	while (r->pos() < r->size()) {
+		uint src = r->readUint32LE();
+		uint dest = r->readUint32LE();
+
+		push_back(TTtagMapping(src, dest));
+	}
+
+	delete r;
+}
+
+/*------------------------------------------------------------------------*/
+
+void TTwordEntries::load(const char *name) {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+
+	while (r->pos() < r->size()) {
+		TTwordEntry we;
+		we._id = r->readUint32LE();
+		we._text = readStringFromStream(r);
+
+		push_back(we);
+	}
+
+	delete r;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/script_support.h b/engines/titanic/true_talk/script_support.h
new file mode 100644
index 0000000..c87b553
--- /dev/null
+++ b/engines/titanic/true_talk/script_support.h
@@ -0,0 +1,130 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_SCRIPT_SUPPORT_H
+#define TITANIC_SCRIPT_SUPPORT_H
+
+#include "titanic/support/simple_file.h"
+
+namespace Titanic {
+
+#define DIALS_ARRAY_COUNT 10
+
+enum ScriptArrayFlag { SF_NONE = 0, SF_RANDOM = 1, SF_SEQUENTIAL = 2 };
+
+struct TTnpcScriptResponse {
+	uint _tag;
+	uint _values[4];
+
+	/**
+	 * Returns the size of the values list plus 1
+	 */
+	int size() const;
+};
+
+struct TTscriptRange {
+	uint _id;
+	Common::Array<uint> _values;
+	TTscriptRange *_nextP;
+	uint _priorIndex;
+	ScriptArrayFlag _mode;
+
+	TTscriptRange() : _id(0), _nextP(nullptr),
+		_priorIndex(0), _mode(SF_NONE) {}
+	TTscriptRange(uint id, const Common::Array<uint> &values, bool isRandom, 
+		bool isSequential);
+};
+
+
+struct TTsentenceEntry {
+	int _field0;
+	int _field4;
+	CString _string8;
+	int _fieldC;
+	CString _string10;
+	CString _string14;
+	CString _string18;
+	CString _string1C;
+	int _field20;
+	CString _string24;
+	int _field28;
+	int _field2C;
+	int _field30;
+
+	TTsentenceEntry() : _field0(0), _field4(0), _fieldC(0),
+		_field20(0), _field28(0), _field2C(0), _field30(0) {}
+
+	/**
+	* Load an entry from the passed stream, and returns true
+	* if an entry was successfully loaded
+	*/
+	bool load(Common::SeekableReadStream *s);
+};
+
+class TTsentenceEntries : public Common::Array<TTsentenceEntry> {
+public:
+	/**
+	* Load a list of entries from the specified resource
+	*/
+	void load(const CString &resName);
+};
+
+struct TTscriptMapping {
+	uint _id;
+	uint _values[8];
+
+	TTscriptMapping();
+};
+
+class TTscriptMappings : public Common::Array<TTscriptMapping> {
+public:
+	int _valuesPerMapping;
+
+	void load(const char *name, int valuesPerMapping);
+};
+
+struct TTtagMapping {
+	uint _src, _dest;
+	TTtagMapping() : _src(0), _dest(0) {}
+	TTtagMapping(uint src, uint dest) : _src(src), _dest(dest) {}
+};
+
+class TTtagMappings : public Common::Array<TTtagMapping> {
+public:
+	void load(const char *name);
+};
+
+struct TTwordEntry {
+	uint _id;
+	CString _text;
+
+	TTwordEntry() : _id(0) {}
+};
+
+class TTwordEntries : public Common::Array<TTwordEntry> {
+public:
+	void load(const char *name);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_NPC_SCRIPT_H */
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 7a2ab85..dde16d1 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -105,123 +105,6 @@ static const uint RANDOM9[] = {
 
 /*------------------------------------------------------------------------*/
 
-int TTnpcScriptResponse::size() const {
-	for (int idx = 0; idx < 4; ++idx) {
-		if (_values[idx] == 0)
-			return idx;
-	}
-
-	return 4;
-}
-
-/*------------------------------------------------------------------------*/
-
-TTscriptRange::TTscriptRange(uint id, const Common::Array<uint> &values, 
-		bool isRandom, bool isSequential) :
-		_id(id), _nextP(nullptr) {
-	_mode = SF_NONE;
-	if (isRandom)
-		_mode = SF_RANDOM;
-	if (isSequential)
-		_mode = SF_SEQUENTIAL;
-
-	for (uint idx = 0; idx < values.size(); ++idx)
-		_values.push_back(values[idx]);
-}
-
-/*------------------------------------------------------------------------*/
-
-
-bool TTsentenceEntry::load(Common::SeekableReadStream *s) {
-	if (s->pos() >= s->size())
-		return false;
-
-	_field0 = s->readUint32LE();
-	_field4 = s->readUint32LE();
-	_string8 = readStringFromStream(s);
-	_fieldC = s->readUint32LE();
-	_string10 = readStringFromStream(s);
-	_string14 = readStringFromStream(s);
-	_string18 = readStringFromStream(s);
-	_string1C = readStringFromStream(s);
-	_field20 = s->readUint32LE();
-	_string24 = readStringFromStream(s);
-	_field28 = s->readUint32LE();
-	_field2C = s->readUint32LE();
-	_field30 = s->readUint32LE();
-
-	return true;
-}
-
-/*------------------------------------------------------------------------*/
-
-void TTsentenceEntries::load(const CString &resName) {
-	TTsentenceEntry entry;
-	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(resName);
-
-	while (entry.load(r))
-		push_back(entry);
-
-	delete r;
-}
-
-/*------------------------------------------------------------------------*/
-
-TTscriptMapping::TTscriptMapping() : _id(0) {
-	Common::fill(&_values[0], &_values[8], 0);
-}
-
-/*------------------------------------------------------------------------*/
-
-void TTscriptMappings::load(const char *name, int valuesPerMapping) {
-	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
-	_valuesPerMapping = valuesPerMapping;
-
-	while (r->pos() < r->size()) {
-		resize(size() + 1);
-		TTscriptMapping &m = (*this)[size() - 1];
-
-		m._id = r->readUint32LE();
-		for (int idx = 0; idx < valuesPerMapping; ++idx)
-			m._values[idx] = r->readUint32LE();
-	}
-
-	delete r;
-}
-
-/*------------------------------------------------------------------------*/
-
-void TTtagMappings::load(const char *name) {
-	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
-
-	while (r->pos() < r->size()) {
-		uint src = r->readUint32LE();
-		uint dest = r->readUint32LE();
-
-		push_back(TTtagMapping(src, dest));
-	}
-
-	delete r;
-}
-
-/*------------------------------------------------------------------------*/
-
-void TTwordEntries::load(const char *name) {
-	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
-
-	while (r->pos() < r->size()) {
-		TTwordEntry we;
-		we._id = r->readUint32LE();
-		we._text = readStringFromStream(r);
-
-		push_back(we);
-	}
-
-	delete r;
-}
-
-/*------------------------------------------------------------------------*/
-
 TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTscriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 5b992f0..111298c 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -25,112 +25,15 @@
 
 #include "titanic/support/simple_file.h"
 #include "titanic/true_talk/tt_script_base.h"
+#include "titanic/true_talk/script_support.h"
 
 namespace Titanic {
 
 #define DIALS_ARRAY_COUNT 10
 
-enum ScriptArrayFlag { SF_NONE = 0, SF_RANDOM = 1, SF_SEQUENTIAL = 2 };
-
 class CGameManager;
 class CPetControl;
 class TTroomScript;
-class TTsentence;
-struct TTsentenceEntry;
-
-struct TTnpcScriptResponse {
-	uint _tag;
-	uint _values[4];
-
-	/**
-	 * Returns the size of the values list plus 1
-	 */
-	int size() const;
-};
-
-struct TTscriptRange {
-	uint _id;
-	Common::Array<uint> _values;
-	TTscriptRange *_nextP;
-	uint _priorIndex;
-	ScriptArrayFlag _mode;
-
-	TTscriptRange() : _id(0), _nextP(nullptr),
-		_priorIndex(0), _mode(SF_NONE) {}
-	TTscriptRange(uint id, const Common::Array<uint> &values, bool isRandom, 
-		bool isSequential);
-};
-
-
-struct TTsentenceEntry {
-	int _field0;
-	int _field4;
-	CString _string8;
-	int _fieldC;
-	CString _string10;
-	CString _string14;
-	CString _string18;
-	CString _string1C;
-	int _field20;
-	CString _string24;
-	int _field28;
-	int _field2C;
-	int _field30;
-
-	TTsentenceEntry() : _field0(0), _field4(0), _fieldC(0),
-		_field20(0), _field28(0), _field2C(0), _field30(0) {}
-
-	/**
-	* Load an entry from the passed stream, and returns true
-	* if an entry was successfully loaded
-	*/
-	bool load(Common::SeekableReadStream *s);
-};
-
-class TTsentenceEntries : public Common::Array<TTsentenceEntry> {
-public:
-	/**
-	* Load a list of entries from the specified resource
-	*/
-	void load(const CString &resName);
-};
-
-struct TTscriptMapping {
-	uint _id;
-	uint _values[8];
-
-	TTscriptMapping();
-};
-
-class TTscriptMappings : public Common::Array<TTscriptMapping> {
-public:
-	int _valuesPerMapping;
-
-	void load(const char *name, int valuesPerMapping);
-};
-
-struct TTtagMapping {
-	uint _src, _dest;
-	TTtagMapping() : _src(0), _dest(0) {}
-	TTtagMapping(uint src, uint dest) : _src(src), _dest(dest) {}
-};
-
-class TTtagMappings : public Common::Array<TTtagMapping> {
-public:
-	void load(const char *name);
-};
-
-struct TTwordEntry {
-	uint _id;
-	CString _text;
-
-	TTwordEntry() : _id(0) {}
-};
-
-class TTwordEntries : public Common::Array<TTwordEntry> {
-public:
-	void load(const char *name);
-};
 
 class TTnpcScriptBase : public TTscriptBase {
 protected:


Commit: ebeea1bb232845b5a863bc73edc2aafd56da36fc
    https://github.com/scummvm/scummvm/commit/ebeea1bb232845b5a863bc73edc2aafd56da36fc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-26T22:27:47-04:00

Commit Message:
TITANIC: Added remainder of BarbotScript handleQuote

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/script_support.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index cbb58cd..5c0c5fb 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -40,6 +40,55 @@ static const uint ARRAY2[] = {
 	51899, 51900, 51901, 51902, 51903, 51904, 51905, 51906, 51907, 0
 };
 
+static const TThandleQuoteEntry QUOTES[] = {
+	{ 0x00000008, 0x00000000, 0x0003D372 },
+	{ 0x00000007, 0x00000000, 0x0003D72B },
+	{ 0x00000004, 0x00000000, 0x0003D722 },
+	{ 0x00000006, 0x00000000, 0x0003D264 },
+	{ 0x00000005, 0x00000000, 0x0003D72F },
+	{ 0x00000001, 0x00000032, 0x00000001 },
+	{ 0x00000002, 0x00000032, 0x00000001 },
+	{ 0x00000003, 0x00000032, 0x00000001 },
+	{ 0x00000010, 0x54524156, 0x0003D2B1 },
+	{ 0x00000010, 0x0000003C, 0x00000000 },
+	{ 0x00000011, 0x00000000, 0x0003D484 },
+	{ 0x00000015, 0x00000032, 0x0003D2B2 },
+	{ 0x00000012, 0x00000042, 0x0003D499 },
+	{ 0x00000013, 0x00000021, 0x0003D31E },
+	{ 0x0000001D, 0x00000021, 0x0003D31E },
+	{ 0x00000014, 0x00000042, 0x0003D49E },
+	{ 0x00000016, 0x0000003C, 0x0003D2B6 },
+	{ 0x00000017, 0x00000028, 0x0003D2B5 },
+	{ 0x00000018, 0x00000000, 0x0003D35E },
+	{ 0x00000019, 0x00000000, 0x0003D35E },
+	{ 0x0000001A, 0x0000003C, 0x0003D38B },
+	{ 0x0000001B, 0x00000000, 0x0003D2F8 },
+	{ 0x00000009, 0x00000019, 0x0003D326 },
+	{ 0x0000000A, 0x00000019, 0x0003D314 },
+	{ 0x0000000B, 0x00000028, 0x0003D311 },
+	{ 0x0000001E, 0x00000000, 0x0003D6F2 },
+	{ 0x0000001F, 0x00000000, 0x0003D26C },
+	{ 0x0000000C, 0x00000000, 0x0003D2F4 },
+	{ 0x0000000D, 0x00000000, 0x0003D2F4 },
+	{ 0x0000000E, 0x00000000, 0x0003D2F4 },
+	{ 0x0000000F, 0x00000000, 0x0003D2F4 },
+	{ 0x00000020, 0x00000019, 0x0003D389 },
+	{ 0x00000021, 0x0000000F, 0x0003D29C },
+	{ 0x00000022, 0x0000000F, 0x0003D494 },
+	{ 0x0000001C, 0x00000032, 0x00000000 },
+	{ 0x00000023, 0x00000000, 0x0003D7F8 },
+	{ 0x00000024, 0x00000000, 0x0003D7F9 },
+	{ 0x00000031, 0x00000000, 0x0003D722 },
+	{ 0x00000032, 0x00000000, 0x0003D722 },
+	{ 0x00000033, 0x00000000, 0x0003D372 },
+	{ 0x00000034, 0x00000000, 0x0003D323 },
+	{ 0x0000003E, 0x00000000, 0x0003D163 },
+	{ 0x0000003F, 0x00000000, 0x0003D163 },
+	{ 0x00000040, 0x00000000, 0x0003D163 },
+	{ 0x00000041, 0x00000000, 0x0003D691 },
+	{ 0x00000000, 0x00000000, 0x00000000 }
+};
+
 BarbotScript::BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
@@ -840,8 +889,8 @@ ScriptChangedResult BarbotScript::scriptChanged(TTscriptBase *roomScript, uint i
 	return SCR_2;
 }
 
-bool BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const {
+int BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder) {
 	switch (tagId) {
 	case MKTAG('A', 'D', 'V', 'T'):
 	case MKTAG('A', 'R', 'T', 'I'):
@@ -945,9 +994,64 @@ bool BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	default:
 		break;
 	}
-	
-	warning("TODO: handleQuote - %d", tagId);
-	return false;
+
+	if (val == 36) {
+		switch (getValue(1)) {
+		case 1:
+			return setResponse(getDialogueId(220837), -1);
+			break;
+		case 2:
+			return setResponse(getDialogueId(220849), -1);
+		default:
+			return setResponse(getDialogueId(220858), -1);
+		}
+	} else if (val == 61 && getValue(1) > 2) {
+		return setResponse(getDialogueId(222301), -1);
+	}
+
+	int loopCounter = 0;
+	for (const TThandleQuoteEntry *qe = QUOTES; qe->_index && loopCounter < 2; ++qe) {
+		if (!qe->_index) {
+			// End of list; start at beginning again
+			++loopCounter;
+			qe = QUOTES;
+		}
+
+		if (qe->_index == val && (
+				(tagId == 0 && loopCounter == 2) ||
+				(qe->_tagId < MKTAG('A', 'A', 'A', 'A')) ||
+				(qe->_tagId == tagId)
+				)) {
+			uint foundTagId = qe->_tagId;
+			if (foundTagId > 0 && foundTagId < 100) {
+				if (!tagId)
+					foundTagId >>= 1;
+				if (getRandomNumber(100) < foundTagId)
+					return 1;
+			}
+
+			uint dialogueId = qe->_dialogueId;
+			if (dialogueId < 1000) {
+				if (dialogueId >= 3)
+					error("Invalid dialogue index in BarbotScript");
+				const int RANDOM_LIMITS[3] = { 30, 50, 70 };
+				int rangeLimit = RANDOM_LIMITS[dialogueId];
+				int dialRegion = getDialRegion(0);
+
+				if (dialRegion != 1) {
+					rangeLimit = MAX(rangeLimit - 20, 20);
+				}
+
+				dialogueId = (((int)remainder + 25) % 100) > rangeLimit ? 221376 : 221375;
+			}
+
+			addResponse(getDialogueId(dialogueId));
+			applyResponse();
+			return 2;
+		}
+	}
+
+	return 1;
 }
 
 int BarbotScript::proc21(int v1, int v2, int v3) {
@@ -1152,4 +1256,13 @@ int BarbotScript::applySentenceIds(int dialogueId, int v34) {
 	return -2;
 }
 
+int BarbotScript::setResponse(int dialogueId, int state) {
+	addResponse(dialogueId);
+	applyResponse();
+
+	if (state != -1)
+		set34(state);
+	return 2;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 90f4d95..977d0a1 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -46,6 +46,11 @@ private:
 	bool isState9() const;
 
 	int applySentenceIds(int dialogueId, int v34 = -1);
+
+	/**
+	 * Add a response and optionally set the state
+	 */
+	int setResponse(int dialogueId, int state = -1);
 public:
 	BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7);
@@ -65,8 +70,8 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const;
+	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder);
 	
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index ecb503c..f4a0a3e 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -70,8 +70,8 @@ int BellbotScript::proc15() const {
 	return 0;
 }
 
-bool BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const {
+int BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder) {
 	switch (tagId) {
 	case MKTAG('A', 'D', 'V', 'T'):
 	case MKTAG('A', 'R', 'T', 'I'):
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index e990e32..704bce8 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -55,8 +55,8 @@ public:
 
 	virtual int proc15() const;
 
-	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const;
+	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder);
 
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 28eff25..a1d2055 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -65,8 +65,8 @@ ScriptChangedResult DeskbotScript::scriptChanged(TTscriptBase *roomScript, uint
 	return SCR_1;
 }
 
-bool DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const {
+int DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder) {
 	switch (tagId) {
 	case MKTAG('A', 'D', 'V', 'T'):
 	case MKTAG('A', 'R', 'T', 'I'):
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 2cc8145..efe71de 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -53,8 +53,8 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const;
+	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder);
 
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 04530f1..8ae1966 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -139,8 +139,8 @@ ScriptChangedResult DoorbotScript::scriptChanged(TTscriptBase *roomScript, uint
 	return SCR_1;
 }
 
-bool DoorbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const {
+int DoorbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 3ec4cfb..3d2fdfd 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -69,8 +69,8 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const;
+	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder);
 
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index c91bd73..926d96f 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -96,8 +96,8 @@ ScriptChangedResult LiftbotScript::scriptChanged(TTscriptBase *roomScript, uint
 	return SCR_1;
 }
 
-bool LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const {
+int LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 03c4eac..ba917f4 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -66,8 +66,8 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const;
+	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder);
 
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index a59583c..891c661 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -73,8 +73,8 @@ ScriptChangedResult MaitreDScript::scriptChanged(TTscriptBase *roomScript, uint
 	return SCR_1;
 }
 
-bool MaitreDScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const {
+int MaitreDScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 91732cd..178979c 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -52,8 +52,8 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const;
+	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder);
 
 	virtual int proc21(int v1, int v2, int v3);
 	virtual int proc22(int id) const;
diff --git a/engines/titanic/true_talk/script_support.h b/engines/titanic/true_talk/script_support.h
index c87b553..50576ca 100644
--- a/engines/titanic/true_talk/script_support.h
+++ b/engines/titanic/true_talk/script_support.h
@@ -125,6 +125,12 @@ public:
 	void load(const char *name);
 };
 
+struct TThandleQuoteEntry {
+	uint _index;
+	uint _tagId;
+	uint _dialogueId;
+};
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_TT_NPC_SCRIPT_H */
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index dde16d1..3fc6d0a 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -266,9 +266,9 @@ bool TTnpcScript::handleWord(uint id) const {
 	return true;
 }
 
-bool TTnpcScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const {
-	return true;
+int TTnpcScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder) {
+	return 1;
 }
 
 uint TTnpcScript::getRangeValue(uint id) {
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 111298c..bd5b759 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -240,8 +240,8 @@ public:
 	 */
 	virtual bool handleWord(uint id) const;
 
-	virtual bool handleQuote(TTroomScript *roomScript, TTsentence *sentence,
-		int val, uint tagId, uint remainder) const;
+	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+		uint val, uint tagId, uint remainder);
 
 	/**
 	 * Given an Id for a previously registered set of random number values,


Commit: 7eece359513890137358a27366d488bc629be47a
    https://github.com/scummvm/scummvm/commit/7eece359513890137358a27366d488bc629be47a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-26T22:54:32-04:00

Commit Message:
TITANIC: Added remainder of BellbotScript handleQuote

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/bellbot_script.cpp



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 5c0c5fb..a3ab058 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -1042,7 +1042,7 @@ int BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 					rangeLimit = MAX(rangeLimit - 20, 20);
 				}
 
-				dialogueId = (((int)remainder + 25) % 100) > rangeLimit ? 221376 : 221375;
+				dialogueId = (((int)remainder + 25) % 100) >= rangeLimit ? 221376 : 221375;
 			}
 
 			addResponse(getDialogueId(dialogueId));
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index f4a0a3e..b91d78b 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -27,6 +27,87 @@
 
 namespace Titanic {
 
+static const TThandleQuoteEntry QUOTES[] = {
+	{ 0x00000008, 0x00000000, 0x00031116 },
+	{ 0x00000007, 0x00000000, 0x00031447 },
+	{ 0x00000006, 0x00000000, 0x000310F9 },
+	{ 0x00000005, 0x00000000, 0x000313A1 },
+	{ 0x00000001, 0x56424144, 0x000313D7 },
+	{ 0x00000001, 0x52554445, 0x000313D7 },
+	{ 0x00000001, 0x5052534E, 0x00041EB3 },
+	{ 0x00000001, 0x424F5953, 0x00041EB3 },
+	{ 0x00000001, 0x4749524C, 0x00041EB3 },
+	{ 0x00000001, 0x464F4F44, 0x00041EB3 },
+	{ 0x00000001, 0x00000032, 0x00041EB1 },
+	{ 0x0000001C, 0x00000032, 0x00041EB0 },
+	{ 0x00000010, 0x54524156, 0x000313C6 },
+	{ 0x00000010, 0x0000003C, 0x00041EB0 },
+	{ 0x00000011, 0x00000000, 0x0003139E },
+	{ 0x00000015, 0x00000032, 0x0003139F },
+	{ 0x00000012, 0x00000042, 0x000313A0 },
+	{ 0x00000013, 0x00000021, 0x000313A7 },
+	{ 0x0000001D, 0x00000021, 0x000313A7 },
+	{ 0x00000014, 0x00000042, 0x000313A4 },
+	{ 0x0000001B, 0x00000000, 0x0003139B },
+	{ 0x0000001E, 0x00000000, 0x000313A2 },
+	{ 0x0000001F, 0x00000000, 0x00030DC0 },
+	{ 0x0000000C, 0x00000000, 0x000313A9 },
+	{ 0x0000000D, 0x00000000, 0x000313A9 },
+	{ 0x0000000E, 0x00000000, 0x000313A8 },
+	{ 0x0000000F, 0x00000000, 0x000313A8 },
+	{ 0x00000020, 0x00000019, 0x000313AB },
+	{ 0x00000021, 0x0000000F, 0x000313AC },
+	{ 0x00000023, 0x00000000, 0x00031337 },
+	{ 0x00000024, 0x00000000, 0x0003135A },
+	{ 0x00000025, 0x00000000, 0x000311AB },
+	{ 0x00000026, 0x00000000, 0x0003112E },
+	{ 0x00000030, 0x00000000, 0x0003106C },
+	{ 0x00000027, 0x424F5953, 0x0003140C },
+	{ 0x00000027, 0x4749524C, 0x0003140D },
+	{ 0x00000027, 0x00000000, 0x0003140D },
+	{ 0x00000028, 0x00000000, 0x00031404 },
+	{ 0x00000029, 0x00000000, 0x00031405 },
+	{ 0x0000002A, 0x00000000, 0x00031406 },
+	{ 0x0000002B, 0x00000000, 0x00031407 },
+	{ 0x0000002C, 0x00000000, 0x00031408 },
+	{ 0x0000002D, 0x00000000, 0x00031409 },
+	{ 0x0000002E, 0x424F5953, 0x0003140A },
+	{ 0x0000002E, 0x4749524C, 0x0003140B },
+	{ 0x0000002E, 0x00000000, 0x0003140B },
+	{ 0x00000032, 0x00000000, 0x000313D6 },
+	{ 0x00000033, 0x00000000, 0x000313D7 },
+	{ 0x00000034, 0x00000000, 0x000313D8 },
+	{ 0x00000035, 0x00000000, 0x0003113D },
+	{ 0x00000036, 0x00000000, 0x00030DCB },
+	{ 0x00000031, 0x00000000, 0x00030DB5 },
+	{ 0x00000037, 0x00000000, 0x000313DD },
+	{ 0x00000038, 0x00000000, 0x00030EE4 },
+	{ 0x00000039, 0x00000000, 0x0003160B },
+	{ 0x0000003A, 0x00000000, 0x000310C4 },
+	{ 0x0000003B, 0x00000000, 0x000310C5 },
+	{ 0x0000003C, 0x00000000, 0x0003121C },
+	{ 0x0000003D, 0x00000000, 0x00031623 },
+	{ 0x0000003F, 0x00000000, 0x00030D99 },
+	{ 0x0000003E, 0x00000000, 0x00030D99 },
+	{ 0x00000040, 0x00000000, 0x000315CE },
+	{ 0x00000041, 0x00000000, 0x000315DC },
+	{ 0x00000042, 0x00000000, 0x00031478 },
+	{ 0x00000043, 0x00000000, 0x00030FC8 },
+	{ 0x00000044, 0x00000000, 0x0003106D },
+	{ 0x00000054, 0x00000000, 0x00031514 },
+	{ 0x00000055, 0x00000000, 0x00031515 },
+	{ 0x00000056, 0x00000000, 0x000315CF },
+	{ 0x0000005A, 0x00000000, 0x000310F9 },
+	{ 0x00000058, 0x00000000, 0x000315DF },
+	{ 0x0000005B, 0x00000000, 0x00031620 },
+	{ 0x0000005C, 0x00000000, 0x0003134B },
+	{ 0x00000059, 0x00000000, 0x0003150F },
+	{ 0x00000057, 0x00000000, 0x00030D58 },
+	{ 0x00000045, 0x0000000A, 0x000310C3 },
+	{ 0x00000046, 0x00000000, 0x00030EAD },
+	{ 0x00000000, 0x00000000, 0x00000000 }
+};
+
 BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
@@ -178,8 +259,50 @@ int BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		break;
 	}
 
-	warning("TODO: handleQuote");
-	return false;
+	int loopCounter = 0;
+	for (const TThandleQuoteEntry *qe = QUOTES; qe->_index && loopCounter < 2; ++qe) {
+		if (!qe->_index) {
+			// End of list; start at beginning again
+			++loopCounter;
+			qe = QUOTES;
+		}
+
+		if (qe->_index == val && (
+				(tagId == 0 && loopCounter == 2) ||
+				(qe->_tagId < MKTAG('A', 'A', 'A', 'A')) ||
+				(qe->_tagId == tagId)
+				)) {
+			uint foundTagId = qe->_tagId;
+			if (foundTagId > 0 && foundTagId < 100) {
+				if (!tagId)
+					foundTagId >>= 1;
+				if (getRandomNumber(100) < foundTagId)
+					return 1;
+			}
+
+			uint dialogueId = qe->_dialogueId;
+			if (dialogueId >= 270000 && dialogueId <= 275000) {
+				dialogueId -= 270000;
+				if (dialogueId >= 3)
+					error("Invalid dialogue index in BarbotScript");
+				const int RANDOM_LIMITS[3] = { 30, 50, 70 };
+				int rangeLimit = RANDOM_LIMITS[dialogueId];
+				int dialRegion = getDialRegion(0);
+
+				if (dialRegion != 1) {
+					rangeLimit = MAX(rangeLimit - 20, 20);
+				}
+
+				dialogueId = (((int)remainder + 25) % 100) >= rangeLimit ? 201687 : 201686;
+			}
+
+			addResponse(getDialogueId(dialogueId));
+			applyResponse();
+			return 2;
+		}
+	}
+
+	return 1;
 }
 
 int BellbotScript::proc21(int v1, int v2, int v3) {


Commit: a0441c83ec642db914b08895b0ddb400ae7bdbce
    https://github.com/scummvm/scummvm/commit/a0441c83ec642db914b08895b0ddb400ae7bdbce
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-26T23:12:20-04:00

Commit Message:
TITANIC: Added remainder of DeskbotScript handleQuote

Changed paths:
    engines/titanic/true_talk/deskbot_script.cpp



diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index a1d2055..8e92007 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -26,6 +26,84 @@
 
 namespace Titanic {
 
+static const TThandleQuoteEntry QUOTES[] = {
+	{ 0x00000008, 0x00000000, 0x0003ACD0 },
+	{ 0x00000007, 0x00000000, 0x0003ACDC },
+	{ 0x00000006, 0x00000000, 0x0003ABF9 },
+	{ 0x00000005, 0x00000000, 0x0003AD04 },
+	{ 0x00000001, 0x56424144, 0x0003AE27 },
+	{ 0x00000001, 0x52554445, 0x0003AE27 },
+	{ 0x00000001, 0x5052534E, 0x00041EB3 },
+	{ 0x00000001, 0x464F4F44, 0x00041EB3 },
+	{ 0x00000001, 0x00000032, 0x00041EB1 },
+	{ 0x00000002, 0x56424144, 0x0003AE27 },
+	{ 0x00000002, 0x52554445, 0x0003AE27 },
+	{ 0x00000002, 0x5052534E, 0x00041EB3 },
+	{ 0x00000002, 0x464F4F44, 0x00041EB3 },
+	{ 0x00000002, 0x00000032, 0x00041EB1 },
+	{ 0x00000003, 0x56424144, 0x0003AE0E },
+	{ 0x00000003, 0x52554445, 0x0003AE0E },
+	{ 0x00000003, 0x5052534E, 0x00041EB3 },
+	{ 0x00000003, 0x464F4F44, 0x00041EB3 },
+	{ 0x00000003, 0x00000032, 0x00041EB1 },
+	{ 0x00000010, 0x54524156, 0x0003ACFE },
+	{ 0x00000010, 0x0000003C, 0x00041EB0 },
+	{ 0x00000011, 0x00000000, 0x0003ABF9 },
+	{ 0x00000015, 0x00000032, 0x0003AC70 },
+	{ 0x00000012, 0x00000042, 0x0003AC7E },
+	{ 0x00000013, 0x00000021, 0x0003AC70 },
+	{ 0x0000001D, 0x00000021, 0x0003AC09 },
+	{ 0x00000014, 0x00000042, 0x0003AE07 },
+	{ 0x0000001B, 0x00000000, 0x00041EB2 },
+	{ 0x0000001E, 0x00000000, 0x0003ACC1 },
+	{ 0x0000001F, 0x00000000, 0x0003AC3E },
+	{ 0x0000000C, 0x00000000, 0x0003AE4C },
+	{ 0x0000000D, 0x00000000, 0x0003AE4C },
+	{ 0x0000000E, 0x00000000, 0x0003AE4B },
+	{ 0x0000000F, 0x00000000, 0x0003AE4B },
+	{ 0x00000020, 0x00000019, 0x0003AE24 },
+	{ 0x00000021, 0x0000000F, 0x0003AE10 },
+	{ 0x0000001C, 0x00000032, 0x00041EB0 },
+	{ 0x00000023, 0x00000000, 0x0003AC46 },
+	{ 0x00000024, 0x00000000, 0x0003AE1F },
+	{ 0x00000025, 0x00000000, 0x0003AE14 },
+	{ 0x00000026, 0x00000000, 0x0003AC7B },
+	{ 0x00000030, 0x00000000, 0x0003AE3D },
+	{ 0x00000027, 0x424F5953, 0x0003AE5D },
+	{ 0x00000027, 0x4749524C, 0x0003AE5E },
+	{ 0x00000027, 0x00000000, 0x0003AE5C },
+	{ 0x00000028, 0x00000000, 0x0003AE5B },
+	{ 0x00000029, 0x00000000, 0x0003AE58 },
+	{ 0x0000002A, 0x00000000, 0x0003AE59 },
+	{ 0x0000002B, 0x00000000, 0x0003AE5A },
+	{ 0x0000002C, 0x00000000, 0x0003AE57 },
+	{ 0x0000002D, 0x00000000, 0x0003AE5C },
+	{ 0x0000002E, 0x424F5953, 0x0003AE5A },
+	{ 0x0000002E, 0x4749524C, 0x0003AE5A },
+	{ 0x0000002E, 0x00000000, 0x0003AE5A },
+	{ 0x00000032, 0x00000000, 0x0003AE0E },
+	{ 0x00000033, 0x00000000, 0x0003AE27 },
+	{ 0x00000034, 0x00000000, 0x0003AE24 },
+	{ 0x00000035, 0x00000000, 0x0003AE3E },
+	{ 0x00000037, 0x00000000, 0x0003AE26 },
+	{ 0x00000038, 0x00000000, 0x0003AEC0 },
+	{ 0x00000039, 0x00000000, 0x0003AEC1 },
+	{ 0x0000003A, 0x00000000, 0x0003AC7F },
+	{ 0x0000003B, 0x00000000, 0x0003ADD5 },
+	{ 0x0000003C, 0x00000000, 0x0003AEC5 },
+	{ 0x0000003D, 0x00000000, 0x0003AEC9 },
+	{ 0x0000003F, 0x00000000, 0x0003ABC5 },
+	{ 0x0000003E, 0x00000000, 0x0003ABC5 },
+	{ 0x00000040, 0x00000000, 0x0003AFB0 },
+	{ 0x00000041, 0x00000000, 0x0003AFDC },
+	{ 0x00000042, 0x00000000, 0x0003AFB5 },
+	{ 0x00000043, 0x00000000, 0x0003AFDD },
+	{ 0x00000044, 0x00000000, 0x0003AFDD },
+	{ 0x00000045, 0x0000000A, 0x0003AC7E },
+	{ 0x00000046, 0x00000000, 0x0003AF6E },
+	{ 0x00000000, 0x00000000, 0x00000000 }
+};
+
 DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
@@ -175,8 +253,50 @@ int DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		break;
 	}
 	
-	warning("TODO");
-	return 0;
+	int loopCounter = 0;
+	for (const TThandleQuoteEntry *qe = QUOTES; qe->_index && loopCounter < 2; ++qe) {
+		if (!qe->_index) {
+			// End of list; start at beginning again
+			++loopCounter;
+			qe = QUOTES;
+		}
+
+		if (qe->_index == val && (
+			(tagId == 0 && loopCounter == 2) ||
+			(qe->_tagId < MKTAG('A', 'A', 'A', 'A')) ||
+			(qe->_tagId == tagId)
+			)) {
+			uint foundTagId = qe->_tagId;
+			if (foundTagId > 0 && foundTagId < 100) {
+				if (!tagId)
+					foundTagId >>= 1;
+				if (getRandomNumber(100) < foundTagId)
+					return 1;
+			}
+
+			uint dialogueId = qe->_dialogueId;
+			if (dialogueId >= 270000 && dialogueId <= 275000) {
+				dialogueId -= 270000;
+				if (dialogueId >= 3)
+					error("Invalid dialogue index in BarbotScript");
+				const int RANDOM_LIMITS[3] = { 30, 50, 70 };
+				int rangeLimit = RANDOM_LIMITS[dialogueId];
+				int dialRegion = getDialRegion(0);
+
+				if (dialRegion != 1) {
+					rangeLimit = MAX(rangeLimit - 20, 20);
+				}
+
+				dialogueId = (((int)remainder + 25) % 100) >= rangeLimit ? 241191 : 241166;
+			}
+
+			addResponse(getDialogueId(dialogueId));
+			applyResponse();
+			return 2;
+		}
+	}
+
+	return 1;
 }
 
 int DeskbotScript::proc21(int v1, int v2, int v3) {


Commit: 95529c6a6ea17b88da2f0d3f93e3cfdae6cac5e8
    https://github.com/scummvm/scummvm/commit/95529c6a6ea17b88da2f0d3f93e3cfdae6cac5e8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-27T06:42:40-04:00

Commit Message:
DEVTOOLS: Added handleQuote methods arrays to create_titanic

Changed paths:
  A devtools/create_titanic/script_quotes.cpp
  A devtools/create_titanic/script_quotes.h
    devtools/create_titanic/create_titanic_dat.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 1ddfd46..c202e75 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -36,6 +36,7 @@
 #include "common/rect.h"
 #include "winexe_pe.h"
 #include "file.h"
+#include "script_quotes.h"
 #include "script_responses.h"
 #include "script_ranges.h"
 #include "tag_maps.h"
@@ -52,7 +53,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x740
+#define HEADER_SIZE 0x800
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -584,6 +585,7 @@ void writeData() {
 
 	writeResponseTree();
 	writeNumbers();
+	writeAllScriptQuotes();
 	writeAllScriptResponses();
 	writeAllScriptRanges();
 	writeAllTagMappings();
diff --git a/devtools/create_titanic/script_quotes.cpp b/devtools/create_titanic/script_quotes.cpp
new file mode 100644
index 0000000..7e4838c
--- /dev/null
+++ b/devtools/create_titanic/script_quotes.cpp
@@ -0,0 +1,457 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+ // Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+// HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
+#include "file.h"
+#include "script_quotes.h"
+
+static const ScriptQuote BARBOT_QUOTES[] = {
+	{ 0x00000008, 0x00000000, 0x0003D372 },
+	{ 0x00000007, 0x00000000, 0x0003D72B },
+	{ 0x00000004, 0x00000000, 0x0003D722 },
+	{ 0x00000006, 0x00000000, 0x0003D264 },
+	{ 0x00000005, 0x00000000, 0x0003D72F },
+	{ 0x00000001, 0x00000032, 0x00000001 },
+	{ 0x00000002, 0x00000032, 0x00000001 },
+	{ 0x00000003, 0x00000032, 0x00000001 },
+	{ 0x00000010, 0x54524156, 0x0003D2B1 },
+	{ 0x00000010, 0x0000003C, 0x00000000 },
+	{ 0x00000011, 0x00000000, 0x0003D484 },
+	{ 0x00000015, 0x00000032, 0x0003D2B2 },
+	{ 0x00000012, 0x00000042, 0x0003D499 },
+	{ 0x00000013, 0x00000021, 0x0003D31E },
+	{ 0x0000001D, 0x00000021, 0x0003D31E },
+	{ 0x00000014, 0x00000042, 0x0003D49E },
+	{ 0x00000016, 0x0000003C, 0x0003D2B6 },
+	{ 0x00000017, 0x00000028, 0x0003D2B5 },
+	{ 0x00000018, 0x00000000, 0x0003D35E },
+	{ 0x00000019, 0x00000000, 0x0003D35E },
+	{ 0x0000001A, 0x0000003C, 0x0003D38B },
+	{ 0x0000001B, 0x00000000, 0x0003D2F8 },
+	{ 0x00000009, 0x00000019, 0x0003D326 },
+	{ 0x0000000A, 0x00000019, 0x0003D314 },
+	{ 0x0000000B, 0x00000028, 0x0003D311 },
+	{ 0x0000001E, 0x00000000, 0x0003D6F2 },
+	{ 0x0000001F, 0x00000000, 0x0003D26C },
+	{ 0x0000000C, 0x00000000, 0x0003D2F4 },
+	{ 0x0000000D, 0x00000000, 0x0003D2F4 },
+	{ 0x0000000E, 0x00000000, 0x0003D2F4 },
+	{ 0x0000000F, 0x00000000, 0x0003D2F4 },
+	{ 0x00000020, 0x00000019, 0x0003D389 },
+	{ 0x00000021, 0x0000000F, 0x0003D29C },
+	{ 0x00000022, 0x0000000F, 0x0003D494 },
+	{ 0x0000001C, 0x00000032, 0x00000000 },
+	{ 0x00000023, 0x00000000, 0x0003D7F8 },
+	{ 0x00000024, 0x00000000, 0x0003D7F9 },
+	{ 0x00000031, 0x00000000, 0x0003D722 },
+	{ 0x00000032, 0x00000000, 0x0003D722 },
+	{ 0x00000033, 0x00000000, 0x0003D372 },
+	{ 0x00000034, 0x00000000, 0x0003D323 },
+	{ 0x0000003E, 0x00000000, 0x0003D163 },
+	{ 0x0000003F, 0x00000000, 0x0003D163 },
+	{ 0x00000040, 0x00000000, 0x0003D163 },
+	{ 0x00000041, 0x00000000, 0x0003D691 },
+	{ 0x00000000, 0x00000000, 0x00000000 }
+};
+
+static const ScriptQuote BELLBOT_QUOTES[] = {
+	{ 0x00000008, 0x00000000, 0x00031116 },
+	{ 0x00000007, 0x00000000, 0x00031447 },
+	{ 0x00000006, 0x00000000, 0x000310F9 },
+	{ 0x00000005, 0x00000000, 0x000313A1 },
+	{ 0x00000001, 0x56424144, 0x000313D7 },
+	{ 0x00000001, 0x52554445, 0x000313D7 },
+	{ 0x00000001, 0x5052534E, 0x00041EB3 },
+	{ 0x00000001, 0x424F5953, 0x00041EB3 },
+	{ 0x00000001, 0x4749524C, 0x00041EB3 },
+	{ 0x00000001, 0x464F4F44, 0x00041EB3 },
+	{ 0x00000001, 0x00000032, 0x00041EB1 },
+	{ 0x0000001C, 0x00000032, 0x00041EB0 },
+	{ 0x00000010, 0x54524156, 0x000313C6 },
+	{ 0x00000010, 0x0000003C, 0x00041EB0 },
+	{ 0x00000011, 0x00000000, 0x0003139E },
+	{ 0x00000015, 0x00000032, 0x0003139F },
+	{ 0x00000012, 0x00000042, 0x000313A0 },
+	{ 0x00000013, 0x00000021, 0x000313A7 },
+	{ 0x0000001D, 0x00000021, 0x000313A7 },
+	{ 0x00000014, 0x00000042, 0x000313A4 },
+	{ 0x0000001B, 0x00000000, 0x0003139B },
+	{ 0x0000001E, 0x00000000, 0x000313A2 },
+	{ 0x0000001F, 0x00000000, 0x00030DC0 },
+	{ 0x0000000C, 0x00000000, 0x000313A9 },
+	{ 0x0000000D, 0x00000000, 0x000313A9 },
+	{ 0x0000000E, 0x00000000, 0x000313A8 },
+	{ 0x0000000F, 0x00000000, 0x000313A8 },
+	{ 0x00000020, 0x00000019, 0x000313AB },
+	{ 0x00000021, 0x0000000F, 0x000313AC },
+	{ 0x00000023, 0x00000000, 0x00031337 },
+	{ 0x00000024, 0x00000000, 0x0003135A },
+	{ 0x00000025, 0x00000000, 0x000311AB },
+	{ 0x00000026, 0x00000000, 0x0003112E },
+	{ 0x00000030, 0x00000000, 0x0003106C },
+	{ 0x00000027, 0x424F5953, 0x0003140C },
+	{ 0x00000027, 0x4749524C, 0x0003140D },
+	{ 0x00000027, 0x00000000, 0x0003140D },
+	{ 0x00000028, 0x00000000, 0x00031404 },
+	{ 0x00000029, 0x00000000, 0x00031405 },
+	{ 0x0000002A, 0x00000000, 0x00031406 },
+	{ 0x0000002B, 0x00000000, 0x00031407 },
+	{ 0x0000002C, 0x00000000, 0x00031408 },
+	{ 0x0000002D, 0x00000000, 0x00031409 },
+	{ 0x0000002E, 0x424F5953, 0x0003140A },
+	{ 0x0000002E, 0x4749524C, 0x0003140B },
+	{ 0x0000002E, 0x00000000, 0x0003140B },
+	{ 0x00000032, 0x00000000, 0x000313D6 },
+	{ 0x00000033, 0x00000000, 0x000313D7 },
+	{ 0x00000034, 0x00000000, 0x000313D8 },
+	{ 0x00000035, 0x00000000, 0x0003113D },
+	{ 0x00000036, 0x00000000, 0x00030DCB },
+	{ 0x00000031, 0x00000000, 0x00030DB5 },
+	{ 0x00000037, 0x00000000, 0x000313DD },
+	{ 0x00000038, 0x00000000, 0x00030EE4 },
+	{ 0x00000039, 0x00000000, 0x0003160B },
+	{ 0x0000003A, 0x00000000, 0x000310C4 },
+	{ 0x0000003B, 0x00000000, 0x000310C5 },
+	{ 0x0000003C, 0x00000000, 0x0003121C },
+	{ 0x0000003D, 0x00000000, 0x00031623 },
+	{ 0x0000003F, 0x00000000, 0x00030D99 },
+	{ 0x0000003E, 0x00000000, 0x00030D99 },
+	{ 0x00000040, 0x00000000, 0x000315CE },
+	{ 0x00000041, 0x00000000, 0x000315DC },
+	{ 0x00000042, 0x00000000, 0x00031478 },
+	{ 0x00000043, 0x00000000, 0x00030FC8 },
+	{ 0x00000044, 0x00000000, 0x0003106D },
+	{ 0x00000054, 0x00000000, 0x00031514 },
+	{ 0x00000055, 0x00000000, 0x00031515 },
+	{ 0x00000056, 0x00000000, 0x000315CF },
+	{ 0x0000005A, 0x00000000, 0x000310F9 },
+	{ 0x00000058, 0x00000000, 0x000315DF },
+	{ 0x0000005B, 0x00000000, 0x00031620 },
+	{ 0x0000005C, 0x00000000, 0x0003134B },
+	{ 0x00000059, 0x00000000, 0x0003150F },
+	{ 0x00000057, 0x00000000, 0x00030D58 },
+	{ 0x00000045, 0x0000000A, 0x000310C3 },
+	{ 0x00000046, 0x00000000, 0x00030EAD },
+	{ 0x00000000, 0x00000000, 0x00000000 }
+};
+
+static const ScriptQuote DESKBOT_QUOTES[] = {
+	{ 0x00000008, 0x00000000, 0x0003ACD0 },
+	{ 0x00000007, 0x00000000, 0x0003ACDC },
+	{ 0x00000006, 0x00000000, 0x0003ABF9 },
+	{ 0x00000005, 0x00000000, 0x0003AD04 },
+	{ 0x00000001, 0x56424144, 0x0003AE27 },
+	{ 0x00000001, 0x52554445, 0x0003AE27 },
+	{ 0x00000001, 0x5052534E, 0x00041EB3 },
+	{ 0x00000001, 0x464F4F44, 0x00041EB3 },
+	{ 0x00000001, 0x00000032, 0x00041EB1 },
+	{ 0x00000002, 0x56424144, 0x0003AE27 },
+	{ 0x00000002, 0x52554445, 0x0003AE27 },
+	{ 0x00000002, 0x5052534E, 0x00041EB3 },
+	{ 0x00000002, 0x464F4F44, 0x00041EB3 },
+	{ 0x00000002, 0x00000032, 0x00041EB1 },
+	{ 0x00000003, 0x56424144, 0x0003AE0E },
+	{ 0x00000003, 0x52554445, 0x0003AE0E },
+	{ 0x00000003, 0x5052534E, 0x00041EB3 },
+	{ 0x00000003, 0x464F4F44, 0x00041EB3 },
+	{ 0x00000003, 0x00000032, 0x00041EB1 },
+	{ 0x00000010, 0x54524156, 0x0003ACFE },
+	{ 0x00000010, 0x0000003C, 0x00041EB0 },
+	{ 0x00000011, 0x00000000, 0x0003ABF9 },
+	{ 0x00000015, 0x00000032, 0x0003AC70 },
+	{ 0x00000012, 0x00000042, 0x0003AC7E },
+	{ 0x00000013, 0x00000021, 0x0003AC70 },
+	{ 0x0000001D, 0x00000021, 0x0003AC09 },
+	{ 0x00000014, 0x00000042, 0x0003AE07 },
+	{ 0x0000001B, 0x00000000, 0x00041EB2 },
+	{ 0x0000001E, 0x00000000, 0x0003ACC1 },
+	{ 0x0000001F, 0x00000000, 0x0003AC3E },
+	{ 0x0000000C, 0x00000000, 0x0003AE4C },
+	{ 0x0000000D, 0x00000000, 0x0003AE4C },
+	{ 0x0000000E, 0x00000000, 0x0003AE4B },
+	{ 0x0000000F, 0x00000000, 0x0003AE4B },
+	{ 0x00000020, 0x00000019, 0x0003AE24 },
+	{ 0x00000021, 0x0000000F, 0x0003AE10 },
+	{ 0x0000001C, 0x00000032, 0x00041EB0 },
+	{ 0x00000023, 0x00000000, 0x0003AC46 },
+	{ 0x00000024, 0x00000000, 0x0003AE1F },
+	{ 0x00000025, 0x00000000, 0x0003AE14 },
+	{ 0x00000026, 0x00000000, 0x0003AC7B },
+	{ 0x00000030, 0x00000000, 0x0003AE3D },
+	{ 0x00000027, 0x424F5953, 0x0003AE5D },
+	{ 0x00000027, 0x4749524C, 0x0003AE5E },
+	{ 0x00000027, 0x00000000, 0x0003AE5C },
+	{ 0x00000028, 0x00000000, 0x0003AE5B },
+	{ 0x00000029, 0x00000000, 0x0003AE58 },
+	{ 0x0000002A, 0x00000000, 0x0003AE59 },
+	{ 0x0000002B, 0x00000000, 0x0003AE5A },
+	{ 0x0000002C, 0x00000000, 0x0003AE57 },
+	{ 0x0000002D, 0x00000000, 0x0003AE5C },
+	{ 0x0000002E, 0x424F5953, 0x0003AE5A },
+	{ 0x0000002E, 0x4749524C, 0x0003AE5A },
+	{ 0x0000002E, 0x00000000, 0x0003AE5A },
+	{ 0x00000032, 0x00000000, 0x0003AE0E },
+	{ 0x00000033, 0x00000000, 0x0003AE27 },
+	{ 0x00000034, 0x00000000, 0x0003AE24 },
+	{ 0x00000035, 0x00000000, 0x0003AE3E },
+	{ 0x00000037, 0x00000000, 0x0003AE26 },
+	{ 0x00000038, 0x00000000, 0x0003AEC0 },
+	{ 0x00000039, 0x00000000, 0x0003AEC1 },
+	{ 0x0000003A, 0x00000000, 0x0003AC7F },
+	{ 0x0000003B, 0x00000000, 0x0003ADD5 },
+	{ 0x0000003C, 0x00000000, 0x0003AEC5 },
+	{ 0x0000003D, 0x00000000, 0x0003AEC9 },
+	{ 0x0000003F, 0x00000000, 0x0003ABC5 },
+	{ 0x0000003E, 0x00000000, 0x0003ABC5 },
+	{ 0x00000040, 0x00000000, 0x0003AFB0 },
+	{ 0x00000041, 0x00000000, 0x0003AFDC },
+	{ 0x00000042, 0x00000000, 0x0003AFB5 },
+	{ 0x00000043, 0x00000000, 0x0003AFDD },
+	{ 0x00000044, 0x00000000, 0x0003AFDD },
+	{ 0x00000045, 0x0000000A, 0x0003AC7E },
+	{ 0x00000046, 0x00000000, 0x0003AF6E },
+	{ 0x00000000, 0x00000000, 0x00000000 }
+};
+
+static const ScriptQuote DOORBOT_QUOTES[] = {
+	{ 0x00000008, 0x00000000, 0x00035F14 },
+	{ 0x00000007, 0x00000000, 0x00035F6F },
+	{ 0x00000004, 0x00000000, 0x000360BF },
+	{ 0x00000006, 0x00000000, 0x000360AF },
+	{ 0x00000005, 0x00000000, 0x000360BC },
+	{ 0x00000001, 0x56424144, 0x000360C0 },
+	{ 0x00000001, 0x52554445, 0x000360C0 },
+	{ 0x00000001, 0x5052534E, 0x00000003 },
+	{ 0x00000001, 0x464F4F44, 0x00000003 },
+	{ 0x00000001, 0x00000032, 0x00000001 },
+	{ 0x00000002, 0x56424144, 0x000360C0 },
+	{ 0x00000002, 0x52554445, 0x000360C0 },
+	{ 0x00000002, 0x5052534E, 0x00000003 },
+	{ 0x00000002, 0x464F4F44, 0x00000003 },
+	{ 0x00000002, 0x00000032, 0x00000001 },
+	{ 0x00000003, 0x56424144, 0x000360C0 },
+	{ 0x00000003, 0x52554445, 0x000360C0 },
+	{ 0x00000003, 0x5052534E, 0x00000003 },
+	{ 0x00000003, 0x464F4F44, 0x00000003 },
+	{ 0x00000003, 0x00000032, 0x00000001 },
+	{ 0x00000010, 0x54524156, 0x00035F6A },
+	{ 0x00000010, 0x0000003C, 0x00000000 },
+	{ 0x00000011, 0x00000000, 0x0003604F },
+	{ 0x00000015, 0x00000032, 0x00036046 },
+	{ 0x00000012, 0x00000042, 0x00036057 },
+	{ 0x00000013, 0x00000021, 0x00035FC8 },
+	{ 0x0000001D, 0x00000021, 0x00035FC8 },
+	{ 0x00000014, 0x00000042, 0x00036059 },
+	{ 0x00000016, 0x0000003C, 0x00035F6E },
+	{ 0x00000017, 0x00000028, 0x00035F6D },
+	{ 0x00000018, 0x00000000, 0x00035F68 },
+	{ 0x00000019, 0x00000000, 0x00035F68 },
+	{ 0x0000001A, 0x0000003C, 0x00035F67 },
+	{ 0x0000001B, 0x00000000, 0x00035FA0 },
+	{ 0x00000009, 0x00000019, 0x00035FD3 },
+	{ 0x0000000A, 0x00000019, 0x00036051 },
+	{ 0x0000000B, 0x00000028, 0x00035FC4 },
+	{ 0x0000001E, 0x00000000, 0x00035F5C },
+	{ 0x0000001F, 0x00000000, 0x00035F5C },
+	{ 0x0000000C, 0x00000000, 0x00035F9D },
+	{ 0x0000000D, 0x00000000, 0x00035F9D },
+	{ 0x0000000E, 0x00000000, 0x00035F9C },
+	{ 0x0000000F, 0x00000000, 0x00035F9C },
+	{ 0x00000020, 0x00000019, 0x00035FFF },
+	{ 0x00000021, 0x0000000F, 0x00035F59 },
+	{ 0x00000022, 0x0000000F, 0x00036055 },
+	{ 0x0000001C, 0x00000032, 0x00000000 },
+	{ 0x00000023, 0x00000000, 0x000360C3 },
+	{ 0x00000024, 0x00000000, 0x00035F5B },
+	{ 0x00000025, 0x00000000, 0x00035EFE },
+	{ 0x00000026, 0x00000000, 0x00035F03 },
+	{ 0x0000002C, 0x00000000, 0x000360C0 },
+	{ 0x0000002D, 0x00000000, 0x000360C0 },
+	{ 0x00000030, 0x00000000, 0x00035F42 },
+	{ 0x00000031, 0x00000000, 0x000360BF },
+	{ 0x00000032, 0x00000000, 0x000360BF },
+	{ 0x00000033, 0x00000000, 0x000360C0 },
+	{ 0x00000034, 0x00000000, 0x00035FC9 },
+	{ 0x00000035, 0x00000000, 0x00035E8B },
+	{ 0x00000036, 0x00000000, 0x00035DFA },
+	{ 0x00000037, 0x00000000, 0x000363AB },
+	{ 0x00000038, 0x00000000, 0x00035F0F },
+	{ 0x0000003C, 0x00000000, 0x00036379 },
+	{ 0x0000003E, 0x00000000, 0x00036262 },
+	{ 0x0000003F, 0x00000000, 0x00036262 },
+	{ 0x00000040, 0x00000000, 0x00036271 },
+	{ 0x00000041, 0x00000000, 0x0003626C },
+	{ 0x00000042, 0x00000000, 0x0003625D },
+	{ 0x00000043, 0x00000000, 0x0003649B },
+	{ 0x00000044, 0x00000000, 0x0003649B },
+	{ 0x00000046, 0x00000000, 0x00036035 },
+	{ 0x00000000, 0x00000000, 0x00000000 }
+};
+
+static const ScriptQuote LIFTBOT_QUOTES[] = {
+	{ 0x00000008, 0x00000000, 0x00033655 },
+	{ 0x00000007, 0x00000000, 0x000335A0 },
+	{ 0x00000006, 0x00000000, 0x0003368B },
+	{ 0x00000005, 0x00000028, 0x00033693 },
+	{ 0x00000001, 0x56424144, 0x00033695 },
+	{ 0x00000001, 0x52554445, 0x00033695 },
+	{ 0x00000001, 0x5052534E, 0x00000003 },
+	{ 0x00000001, 0x464F4F44, 0x00000003 },
+	{ 0x00000001, 0x00000032, 0x00000001 },
+	{ 0x00000002, 0x56424144, 0x00033695 },
+	{ 0x00000002, 0x52554445, 0x00033695 },
+	{ 0x00000002, 0x5052534E, 0x00000003 },
+	{ 0x00000002, 0x464F4F44, 0x00000003 },
+	{ 0x00000002, 0x00000032, 0x00000001 },
+	{ 0x00000003, 0x56424144, 0x00033695 },
+	{ 0x00000003, 0x52554445, 0x00033695 },
+	{ 0x00000003, 0x5052534E, 0x00000003 },
+	{ 0x00000003, 0x464F4F44, 0x00000003 },
+	{ 0x00000003, 0x00000032, 0x00000001 },
+	{ 0x00000010, 0x54524156, 0x000335A4 },
+	{ 0x00000010, 0x0000003C, 0x00000000 },
+	{ 0x00000011, 0x00000000, 0x0003367B },
+	{ 0x00000015, 0x00000032, 0x000335A1 },
+	{ 0x00000012, 0x00000042, 0x00033672 },
+	{ 0x00000013, 0x00000021, 0x00033679 },
+	{ 0x0000001D, 0x00000021, 0x00033679 },
+	{ 0x00000014, 0x00000042, 0x00033688 },
+	{ 0x00000016, 0x0000003C, 0x000335A4 },
+	{ 0x00000017, 0x00000028, 0x00033689 },
+	{ 0x00000018, 0x00000000, 0x00033670 },
+	{ 0x00000019, 0x00000000, 0x000335A0 },
+	{ 0x0000001A, 0x0000003C, 0x0003368F },
+	{ 0x0000001B, 0x00000000, 0x00033695 },
+	{ 0x00000009, 0x00000019, 0x000335A2 },
+	{ 0x0000000A, 0x00000019, 0x000335A6 },
+	{ 0x0000000B, 0x00000028, 0x00033668 },
+	{ 0x0000001E, 0x00000000, 0x00033691 },
+	{ 0x0000001F, 0x00000000, 0x00033691 },
+	{ 0x0000000C, 0x00000014, 0x00033666 },
+	{ 0x0000000D, 0x00000014, 0x00033666 },
+	{ 0x0000000E, 0x00000014, 0x0003367A },
+	{ 0x0000000F, 0x00000014, 0x0003367A },
+	{ 0x00000020, 0x00000019, 0x0003367C },
+	{ 0x00000021, 0x0000000F, 0x00033690 },
+	{ 0x00000022, 0x0000000F, 0x00033682 },
+	{ 0x0000001C, 0x00000032, 0x00000000 },
+	{ 0x00000023, 0x00000000, 0x00033698 },
+	{ 0x00000024, 0x00000000, 0x00033699 },
+	{ 0x00000031, 0x00000000, 0x00033694 },
+	{ 0x00000032, 0x00000000, 0x00033694 },
+	{ 0x00000033, 0x00000000, 0x00033695 },
+	{ 0x00000034, 0x00000000, 0x0003369F },
+	{ 0x00000035, 0x00000000, 0x000336A0 },
+	{ 0x00000036, 0x00000000, 0x00033585 },
+	{ 0x0000003E, 0x00000000, 0x0003380D },
+	{ 0x0000003F, 0x00000000, 0x0003380D },
+	{ 0x00000040, 0x00000000, 0x0003380D },
+	{ 0x00000041, 0x00000000, 0x000337E7 },
+	{ 0x00000042, 0x00000000, 0x00033711 },
+	{ 0x00000000, 0x00000000, 0x00000000 }
+};
+
+static const ScriptQuote MAITRED_QUOTES[] = {
+	{ 0x00000008, 0x00000000, 0x0003F967 },
+	{ 0x00000007, 0x00000000, 0x0003F995 },
+	{ 0x00000006, 0x00000000, 0x0003F833 },
+	{ 0x00000005, 0x00000000, 0x0003F95B },
+	{ 0x00000001, 0x56424144, 0x0003F847 },
+	{ 0x00000001, 0x52554445, 0x0003F847 },
+	{ 0x00000001, 0x5052534E, 0x00041EB3 },
+	{ 0x00000001, 0x464F4F44, 0x0003FB88 },
+	{ 0x00000001, 0x00000032, 0x00041EB1 },
+	{ 0x00000010, 0x54524156, 0x0003F9FA },
+	{ 0x00000010, 0x0000003C, 0x00041EB0 },
+	{ 0x00000011, 0x00000000, 0x0003F967 },
+	{ 0x00000015, 0x00000032, 0x0003F83D },
+	{ 0x00000012, 0x00000042, 0x0003F83D },
+	{ 0x00000013, 0x00000021, 0x0003F95B },
+	{ 0x0000001D, 0x00000021, 0x0003F971 },
+	{ 0x00000014, 0x00000042, 0x0003F96C },
+	{ 0x0000001B, 0x00000000, 0x0003F95B },
+	{ 0x0000001E, 0x00000000, 0x0003FA3C },
+	{ 0x0000001F, 0x00000000, 0x0003F991 },
+	{ 0x0000000C, 0x00000000, 0x0003F9C9 },
+	{ 0x0000000D, 0x00000000, 0x0003F9C9 },
+	{ 0x0000000E, 0x00000000, 0x0003F9C9 },
+	{ 0x0000000F, 0x00000000, 0x0003F9C9 },
+	{ 0x00000020, 0x00000019, 0x0003F847 },
+	{ 0x00000021, 0x0000000F, 0x0003FA22 },
+	{ 0x00000037, 0x00000000, 0x0003FA9C },
+	{ 0x0000003C, 0x00000000, 0x0003FAA0 },
+	{ 0x00000047, 0x00000000, 0x0003FAA1 },
+	{ 0x0000003F, 0x00000000, 0x0003FABD },
+	{ 0x0000003E, 0x00000000, 0x0003FABD },
+	{ 0x00000040, 0x00000000, 0x0003FABB },
+	{ 0x00000041, 0x00000000, 0x0003FABB },
+	{ 0x00000042, 0x00000000, 0x0003FABC },
+	{ 0x00000048, 0x00000000, 0x0003FB45 },
+	{ 0x00000049, 0x00000000, 0x0003FB48 },
+	{ 0x0000004A, 0x00000000, 0x0003FB52 },
+	{ 0x0000004B, 0x00000000, 0x0003FB4A },
+	{ 0x0000004C, 0x00000000, 0x0003FB47 },
+	{ 0x0000004D, 0x00000000, 0x0003FB49 },
+	{ 0x0000004E, 0x00000000, 0x0003FB53 },
+	{ 0x0000004F, 0x00000000, 0x0003FB4C },
+	{ 0x00000050, 0x00000000, 0x0003FB4E },
+	{ 0x00000051, 0x00000000, 0x0003FB50 },
+	{ 0x00000052, 0x00000000, 0x0003FB75 },
+	{ 0x00000053, 0x00000000, 0x0003F9A8 },
+	{ 0x00000000, 0x00000000, 0x00000000 }
+};
+
+void writeScriptQuotes(const char *name, const ScriptQuote *quotes, 
+		uint tag1, uint tag2, uint rangeStart, uint rangeEnd) {
+	outputFile.seek(dataOffset);
+	outputFile.writeLong(tag1);
+	outputFile.writeLong(tag2);
+	outputFile.writeLong(rangeStart);
+	outputFile.writeLong(rangeEnd);
+
+	for (; quotes->_index; ++quotes) {
+		outputFile.writeLong(quotes->_index);
+		outputFile.writeLong(quotes->_tagId);
+		outputFile.writeLong(quotes->_dialogueId);
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader(name, dataOffset, size);
+	dataOffset += size;
+}
+
+void writeAllScriptQuotes() {
+	writeScriptQuotes("Quotes/Barbot", BARBOT_QUOTES, 221376, 221375, 0, 999);
+	writeScriptQuotes("Quotes/Bellbot", BELLBOT_QUOTES, 201687, 201686, 270000, 270500);
+	writeScriptQuotes("Quotes/Deskbot", DESKBOT_QUOTES, 241191, 241166, 270000, 270500);
+	writeScriptQuotes("Quotes/Doorbot", DOORBOT_QUOTES, 221376, 221375, 0, 999);
+	writeScriptQuotes("Quotes/Liftbot", LIFTBOT_QUOTES, 210581, 210580, 0, 999);
+	writeScriptQuotes("Quotes/MaitreD", MAITRED_QUOTES, 260167, 260147, 270000, 270500);
+}
\ No newline at end of file
diff --git a/devtools/create_titanic/script_quotes.h b/devtools/create_titanic/script_quotes.h
new file mode 100644
index 0000000..5b4f25c
--- /dev/null
+++ b/devtools/create_titanic/script_quotes.h
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef COMMON_SCRIPT_QUOTES_H
+#define COMMON_SCRIPT_QUOTES_H
+
+#include "common/scummsys.h"
+
+struct ScriptQuote {
+	uint _index;
+	uint _tagId;
+	uint _dialogueId;
+};
+
+extern void writeAllScriptQuotes();
+extern void writeEntryHeader(const char *name, uint offset, uint size);
+extern uint dataOffset;
+
+#endif


Commit: 89da2a88573f1acd8c311764a84f0054011f46c2
    https://github.com/scummvm/scummvm/commit/89da2a88573f1acd8c311764a84f0054011f46c2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-27T06:43:12-04:00

Commit Message:
TITANIC: Moved handleQuote data arrays to datafile

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/script_support.cpp
    engines/titanic/true_talk/script_support.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index a3ab058..7a20ee4 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -40,55 +40,6 @@ static const uint ARRAY2[] = {
 	51899, 51900, 51901, 51902, 51903, 51904, 51905, 51906, 51907, 0
 };
 
-static const TThandleQuoteEntry QUOTES[] = {
-	{ 0x00000008, 0x00000000, 0x0003D372 },
-	{ 0x00000007, 0x00000000, 0x0003D72B },
-	{ 0x00000004, 0x00000000, 0x0003D722 },
-	{ 0x00000006, 0x00000000, 0x0003D264 },
-	{ 0x00000005, 0x00000000, 0x0003D72F },
-	{ 0x00000001, 0x00000032, 0x00000001 },
-	{ 0x00000002, 0x00000032, 0x00000001 },
-	{ 0x00000003, 0x00000032, 0x00000001 },
-	{ 0x00000010, 0x54524156, 0x0003D2B1 },
-	{ 0x00000010, 0x0000003C, 0x00000000 },
-	{ 0x00000011, 0x00000000, 0x0003D484 },
-	{ 0x00000015, 0x00000032, 0x0003D2B2 },
-	{ 0x00000012, 0x00000042, 0x0003D499 },
-	{ 0x00000013, 0x00000021, 0x0003D31E },
-	{ 0x0000001D, 0x00000021, 0x0003D31E },
-	{ 0x00000014, 0x00000042, 0x0003D49E },
-	{ 0x00000016, 0x0000003C, 0x0003D2B6 },
-	{ 0x00000017, 0x00000028, 0x0003D2B5 },
-	{ 0x00000018, 0x00000000, 0x0003D35E },
-	{ 0x00000019, 0x00000000, 0x0003D35E },
-	{ 0x0000001A, 0x0000003C, 0x0003D38B },
-	{ 0x0000001B, 0x00000000, 0x0003D2F8 },
-	{ 0x00000009, 0x00000019, 0x0003D326 },
-	{ 0x0000000A, 0x00000019, 0x0003D314 },
-	{ 0x0000000B, 0x00000028, 0x0003D311 },
-	{ 0x0000001E, 0x00000000, 0x0003D6F2 },
-	{ 0x0000001F, 0x00000000, 0x0003D26C },
-	{ 0x0000000C, 0x00000000, 0x0003D2F4 },
-	{ 0x0000000D, 0x00000000, 0x0003D2F4 },
-	{ 0x0000000E, 0x00000000, 0x0003D2F4 },
-	{ 0x0000000F, 0x00000000, 0x0003D2F4 },
-	{ 0x00000020, 0x00000019, 0x0003D389 },
-	{ 0x00000021, 0x0000000F, 0x0003D29C },
-	{ 0x00000022, 0x0000000F, 0x0003D494 },
-	{ 0x0000001C, 0x00000032, 0x00000000 },
-	{ 0x00000023, 0x00000000, 0x0003D7F8 },
-	{ 0x00000024, 0x00000000, 0x0003D7F9 },
-	{ 0x00000031, 0x00000000, 0x0003D722 },
-	{ 0x00000032, 0x00000000, 0x0003D722 },
-	{ 0x00000033, 0x00000000, 0x0003D372 },
-	{ 0x00000034, 0x00000000, 0x0003D323 },
-	{ 0x0000003E, 0x00000000, 0x0003D163 },
-	{ 0x0000003F, 0x00000000, 0x0003D163 },
-	{ 0x00000040, 0x00000000, 0x0003D163 },
-	{ 0x00000041, 0x00000000, 0x0003D691 },
-	{ 0x00000000, 0x00000000, 0x00000000 }
-};
-
 BarbotScript::BarbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
@@ -99,6 +50,7 @@ BarbotScript::BarbotScript(int val1, const char *charClass, int v2,
 	loadResponses("Responses/Barbot");
 	setupSentences();
 	_tagMappings.load("TagMap/Barbot");
+	_quotes.load("Quotes/Barbot");
 }
 
 void BarbotScript::setupSentences() {
@@ -1009,49 +961,7 @@ int BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		return setResponse(getDialogueId(222301), -1);
 	}
 
-	int loopCounter = 0;
-	for (const TThandleQuoteEntry *qe = QUOTES; qe->_index && loopCounter < 2; ++qe) {
-		if (!qe->_index) {
-			// End of list; start at beginning again
-			++loopCounter;
-			qe = QUOTES;
-		}
-
-		if (qe->_index == val && (
-				(tagId == 0 && loopCounter == 2) ||
-				(qe->_tagId < MKTAG('A', 'A', 'A', 'A')) ||
-				(qe->_tagId == tagId)
-				)) {
-			uint foundTagId = qe->_tagId;
-			if (foundTagId > 0 && foundTagId < 100) {
-				if (!tagId)
-					foundTagId >>= 1;
-				if (getRandomNumber(100) < foundTagId)
-					return 1;
-			}
-
-			uint dialogueId = qe->_dialogueId;
-			if (dialogueId < 1000) {
-				if (dialogueId >= 3)
-					error("Invalid dialogue index in BarbotScript");
-				const int RANDOM_LIMITS[3] = { 30, 50, 70 };
-				int rangeLimit = RANDOM_LIMITS[dialogueId];
-				int dialRegion = getDialRegion(0);
-
-				if (dialRegion != 1) {
-					rangeLimit = MAX(rangeLimit - 20, 20);
-				}
-
-				dialogueId = (((int)remainder + 25) % 100) >= rangeLimit ? 221376 : 221375;
-			}
-
-			addResponse(getDialogueId(dialogueId));
-			applyResponse();
-			return 2;
-		}
-	}
-
-	return 1;
+	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
 int BarbotScript::proc21(int v1, int v2, int v3) {
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index b91d78b..988efa9 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -27,87 +27,6 @@
 
 namespace Titanic {
 
-static const TThandleQuoteEntry QUOTES[] = {
-	{ 0x00000008, 0x00000000, 0x00031116 },
-	{ 0x00000007, 0x00000000, 0x00031447 },
-	{ 0x00000006, 0x00000000, 0x000310F9 },
-	{ 0x00000005, 0x00000000, 0x000313A1 },
-	{ 0x00000001, 0x56424144, 0x000313D7 },
-	{ 0x00000001, 0x52554445, 0x000313D7 },
-	{ 0x00000001, 0x5052534E, 0x00041EB3 },
-	{ 0x00000001, 0x424F5953, 0x00041EB3 },
-	{ 0x00000001, 0x4749524C, 0x00041EB3 },
-	{ 0x00000001, 0x464F4F44, 0x00041EB3 },
-	{ 0x00000001, 0x00000032, 0x00041EB1 },
-	{ 0x0000001C, 0x00000032, 0x00041EB0 },
-	{ 0x00000010, 0x54524156, 0x000313C6 },
-	{ 0x00000010, 0x0000003C, 0x00041EB0 },
-	{ 0x00000011, 0x00000000, 0x0003139E },
-	{ 0x00000015, 0x00000032, 0x0003139F },
-	{ 0x00000012, 0x00000042, 0x000313A0 },
-	{ 0x00000013, 0x00000021, 0x000313A7 },
-	{ 0x0000001D, 0x00000021, 0x000313A7 },
-	{ 0x00000014, 0x00000042, 0x000313A4 },
-	{ 0x0000001B, 0x00000000, 0x0003139B },
-	{ 0x0000001E, 0x00000000, 0x000313A2 },
-	{ 0x0000001F, 0x00000000, 0x00030DC0 },
-	{ 0x0000000C, 0x00000000, 0x000313A9 },
-	{ 0x0000000D, 0x00000000, 0x000313A9 },
-	{ 0x0000000E, 0x00000000, 0x000313A8 },
-	{ 0x0000000F, 0x00000000, 0x000313A8 },
-	{ 0x00000020, 0x00000019, 0x000313AB },
-	{ 0x00000021, 0x0000000F, 0x000313AC },
-	{ 0x00000023, 0x00000000, 0x00031337 },
-	{ 0x00000024, 0x00000000, 0x0003135A },
-	{ 0x00000025, 0x00000000, 0x000311AB },
-	{ 0x00000026, 0x00000000, 0x0003112E },
-	{ 0x00000030, 0x00000000, 0x0003106C },
-	{ 0x00000027, 0x424F5953, 0x0003140C },
-	{ 0x00000027, 0x4749524C, 0x0003140D },
-	{ 0x00000027, 0x00000000, 0x0003140D },
-	{ 0x00000028, 0x00000000, 0x00031404 },
-	{ 0x00000029, 0x00000000, 0x00031405 },
-	{ 0x0000002A, 0x00000000, 0x00031406 },
-	{ 0x0000002B, 0x00000000, 0x00031407 },
-	{ 0x0000002C, 0x00000000, 0x00031408 },
-	{ 0x0000002D, 0x00000000, 0x00031409 },
-	{ 0x0000002E, 0x424F5953, 0x0003140A },
-	{ 0x0000002E, 0x4749524C, 0x0003140B },
-	{ 0x0000002E, 0x00000000, 0x0003140B },
-	{ 0x00000032, 0x00000000, 0x000313D6 },
-	{ 0x00000033, 0x00000000, 0x000313D7 },
-	{ 0x00000034, 0x00000000, 0x000313D8 },
-	{ 0x00000035, 0x00000000, 0x0003113D },
-	{ 0x00000036, 0x00000000, 0x00030DCB },
-	{ 0x00000031, 0x00000000, 0x00030DB5 },
-	{ 0x00000037, 0x00000000, 0x000313DD },
-	{ 0x00000038, 0x00000000, 0x00030EE4 },
-	{ 0x00000039, 0x00000000, 0x0003160B },
-	{ 0x0000003A, 0x00000000, 0x000310C4 },
-	{ 0x0000003B, 0x00000000, 0x000310C5 },
-	{ 0x0000003C, 0x00000000, 0x0003121C },
-	{ 0x0000003D, 0x00000000, 0x00031623 },
-	{ 0x0000003F, 0x00000000, 0x00030D99 },
-	{ 0x0000003E, 0x00000000, 0x00030D99 },
-	{ 0x00000040, 0x00000000, 0x000315CE },
-	{ 0x00000041, 0x00000000, 0x000315DC },
-	{ 0x00000042, 0x00000000, 0x00031478 },
-	{ 0x00000043, 0x00000000, 0x00030FC8 },
-	{ 0x00000044, 0x00000000, 0x0003106D },
-	{ 0x00000054, 0x00000000, 0x00031514 },
-	{ 0x00000055, 0x00000000, 0x00031515 },
-	{ 0x00000056, 0x00000000, 0x000315CF },
-	{ 0x0000005A, 0x00000000, 0x000310F9 },
-	{ 0x00000058, 0x00000000, 0x000315DF },
-	{ 0x0000005B, 0x00000000, 0x00031620 },
-	{ 0x0000005C, 0x00000000, 0x0003134B },
-	{ 0x00000059, 0x00000000, 0x0003150F },
-	{ 0x00000057, 0x00000000, 0x00030D58 },
-	{ 0x00000045, 0x0000000A, 0x000310C3 },
-	{ 0x00000046, 0x00000000, 0x00030EAD },
-	{ 0x00000000, 0x00000000, 0x00000000 }
-};
-
 BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
@@ -126,6 +45,7 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	setupSentences();
 	_tagMappings.load("TagMap/Bellbot");
 	_words.load("Words/Bellbot");
+	_quotes.load("Quotes/Bellbot");
 }
 
 void BellbotScript::setupSentences() {
@@ -258,51 +178,8 @@ int BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	default:
 		break;
 	}
-
-	int loopCounter = 0;
-	for (const TThandleQuoteEntry *qe = QUOTES; qe->_index && loopCounter < 2; ++qe) {
-		if (!qe->_index) {
-			// End of list; start at beginning again
-			++loopCounter;
-			qe = QUOTES;
-		}
-
-		if (qe->_index == val && (
-				(tagId == 0 && loopCounter == 2) ||
-				(qe->_tagId < MKTAG('A', 'A', 'A', 'A')) ||
-				(qe->_tagId == tagId)
-				)) {
-			uint foundTagId = qe->_tagId;
-			if (foundTagId > 0 && foundTagId < 100) {
-				if (!tagId)
-					foundTagId >>= 1;
-				if (getRandomNumber(100) < foundTagId)
-					return 1;
-			}
-
-			uint dialogueId = qe->_dialogueId;
-			if (dialogueId >= 270000 && dialogueId <= 275000) {
-				dialogueId -= 270000;
-				if (dialogueId >= 3)
-					error("Invalid dialogue index in BarbotScript");
-				const int RANDOM_LIMITS[3] = { 30, 50, 70 };
-				int rangeLimit = RANDOM_LIMITS[dialogueId];
-				int dialRegion = getDialRegion(0);
-
-				if (dialRegion != 1) {
-					rangeLimit = MAX(rangeLimit - 20, 20);
-				}
-
-				dialogueId = (((int)remainder + 25) % 100) >= rangeLimit ? 201687 : 201686;
-			}
-
-			addResponse(getDialogueId(dialogueId));
-			applyResponse();
-			return 2;
-		}
-	}
-
-	return 1;
+	
+	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
 int BellbotScript::proc21(int v1, int v2, int v3) {
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 8e92007..a95e4df 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -26,84 +26,6 @@
 
 namespace Titanic {
 
-static const TThandleQuoteEntry QUOTES[] = {
-	{ 0x00000008, 0x00000000, 0x0003ACD0 },
-	{ 0x00000007, 0x00000000, 0x0003ACDC },
-	{ 0x00000006, 0x00000000, 0x0003ABF9 },
-	{ 0x00000005, 0x00000000, 0x0003AD04 },
-	{ 0x00000001, 0x56424144, 0x0003AE27 },
-	{ 0x00000001, 0x52554445, 0x0003AE27 },
-	{ 0x00000001, 0x5052534E, 0x00041EB3 },
-	{ 0x00000001, 0x464F4F44, 0x00041EB3 },
-	{ 0x00000001, 0x00000032, 0x00041EB1 },
-	{ 0x00000002, 0x56424144, 0x0003AE27 },
-	{ 0x00000002, 0x52554445, 0x0003AE27 },
-	{ 0x00000002, 0x5052534E, 0x00041EB3 },
-	{ 0x00000002, 0x464F4F44, 0x00041EB3 },
-	{ 0x00000002, 0x00000032, 0x00041EB1 },
-	{ 0x00000003, 0x56424144, 0x0003AE0E },
-	{ 0x00000003, 0x52554445, 0x0003AE0E },
-	{ 0x00000003, 0x5052534E, 0x00041EB3 },
-	{ 0x00000003, 0x464F4F44, 0x00041EB3 },
-	{ 0x00000003, 0x00000032, 0x00041EB1 },
-	{ 0x00000010, 0x54524156, 0x0003ACFE },
-	{ 0x00000010, 0x0000003C, 0x00041EB0 },
-	{ 0x00000011, 0x00000000, 0x0003ABF9 },
-	{ 0x00000015, 0x00000032, 0x0003AC70 },
-	{ 0x00000012, 0x00000042, 0x0003AC7E },
-	{ 0x00000013, 0x00000021, 0x0003AC70 },
-	{ 0x0000001D, 0x00000021, 0x0003AC09 },
-	{ 0x00000014, 0x00000042, 0x0003AE07 },
-	{ 0x0000001B, 0x00000000, 0x00041EB2 },
-	{ 0x0000001E, 0x00000000, 0x0003ACC1 },
-	{ 0x0000001F, 0x00000000, 0x0003AC3E },
-	{ 0x0000000C, 0x00000000, 0x0003AE4C },
-	{ 0x0000000D, 0x00000000, 0x0003AE4C },
-	{ 0x0000000E, 0x00000000, 0x0003AE4B },
-	{ 0x0000000F, 0x00000000, 0x0003AE4B },
-	{ 0x00000020, 0x00000019, 0x0003AE24 },
-	{ 0x00000021, 0x0000000F, 0x0003AE10 },
-	{ 0x0000001C, 0x00000032, 0x00041EB0 },
-	{ 0x00000023, 0x00000000, 0x0003AC46 },
-	{ 0x00000024, 0x00000000, 0x0003AE1F },
-	{ 0x00000025, 0x00000000, 0x0003AE14 },
-	{ 0x00000026, 0x00000000, 0x0003AC7B },
-	{ 0x00000030, 0x00000000, 0x0003AE3D },
-	{ 0x00000027, 0x424F5953, 0x0003AE5D },
-	{ 0x00000027, 0x4749524C, 0x0003AE5E },
-	{ 0x00000027, 0x00000000, 0x0003AE5C },
-	{ 0x00000028, 0x00000000, 0x0003AE5B },
-	{ 0x00000029, 0x00000000, 0x0003AE58 },
-	{ 0x0000002A, 0x00000000, 0x0003AE59 },
-	{ 0x0000002B, 0x00000000, 0x0003AE5A },
-	{ 0x0000002C, 0x00000000, 0x0003AE57 },
-	{ 0x0000002D, 0x00000000, 0x0003AE5C },
-	{ 0x0000002E, 0x424F5953, 0x0003AE5A },
-	{ 0x0000002E, 0x4749524C, 0x0003AE5A },
-	{ 0x0000002E, 0x00000000, 0x0003AE5A },
-	{ 0x00000032, 0x00000000, 0x0003AE0E },
-	{ 0x00000033, 0x00000000, 0x0003AE27 },
-	{ 0x00000034, 0x00000000, 0x0003AE24 },
-	{ 0x00000035, 0x00000000, 0x0003AE3E },
-	{ 0x00000037, 0x00000000, 0x0003AE26 },
-	{ 0x00000038, 0x00000000, 0x0003AEC0 },
-	{ 0x00000039, 0x00000000, 0x0003AEC1 },
-	{ 0x0000003A, 0x00000000, 0x0003AC7F },
-	{ 0x0000003B, 0x00000000, 0x0003ADD5 },
-	{ 0x0000003C, 0x00000000, 0x0003AEC5 },
-	{ 0x0000003D, 0x00000000, 0x0003AEC9 },
-	{ 0x0000003F, 0x00000000, 0x0003ABC5 },
-	{ 0x0000003E, 0x00000000, 0x0003ABC5 },
-	{ 0x00000040, 0x00000000, 0x0003AFB0 },
-	{ 0x00000041, 0x00000000, 0x0003AFDC },
-	{ 0x00000042, 0x00000000, 0x0003AFB5 },
-	{ 0x00000043, 0x00000000, 0x0003AFDD },
-	{ 0x00000044, 0x00000000, 0x0003AFDD },
-	{ 0x00000045, 0x0000000A, 0x0003AC7E },
-	{ 0x00000046, 0x00000000, 0x0003AF6E },
-	{ 0x00000000, 0x00000000, 0x00000000 }
-};
-
 DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
@@ -123,6 +45,7 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 	setupSentences();
 	_tagMappings.load("TagMap/Deskbot");
 	_words.load("Words/Deskbot");
+	_quotes.load("Quotes/Deskbot");
 }
 
 void DeskbotScript::setupSentences() {
@@ -253,50 +176,8 @@ int DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		break;
 	}
 	
-	int loopCounter = 0;
-	for (const TThandleQuoteEntry *qe = QUOTES; qe->_index && loopCounter < 2; ++qe) {
-		if (!qe->_index) {
-			// End of list; start at beginning again
-			++loopCounter;
-			qe = QUOTES;
-		}
-
-		if (qe->_index == val && (
-			(tagId == 0 && loopCounter == 2) ||
-			(qe->_tagId < MKTAG('A', 'A', 'A', 'A')) ||
-			(qe->_tagId == tagId)
-			)) {
-			uint foundTagId = qe->_tagId;
-			if (foundTagId > 0 && foundTagId < 100) {
-				if (!tagId)
-					foundTagId >>= 1;
-				if (getRandomNumber(100) < foundTagId)
-					return 1;
-			}
-
-			uint dialogueId = qe->_dialogueId;
-			if (dialogueId >= 270000 && dialogueId <= 275000) {
-				dialogueId -= 270000;
-				if (dialogueId >= 3)
-					error("Invalid dialogue index in BarbotScript");
-				const int RANDOM_LIMITS[3] = { 30, 50, 70 };
-				int rangeLimit = RANDOM_LIMITS[dialogueId];
-				int dialRegion = getDialRegion(0);
-
-				if (dialRegion != 1) {
-					rangeLimit = MAX(rangeLimit - 20, 20);
-				}
-
-				dialogueId = (((int)remainder + 25) % 100) >= rangeLimit ? 241191 : 241166;
-			}
-
-			addResponse(getDialogueId(dialogueId));
-			applyResponse();
-			return 2;
-		}
-	}
+	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 
-	return 1;
 }
 
 int DeskbotScript::proc21(int v1, int v2, int v3) {
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 8ae1966..a864141 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -59,6 +59,7 @@ DoorbotScript::DoorbotScript(int val1, const char *charClass, int v2,
 	setupSentences();
 	_tagMappings.load("TagMap/Doorbot");
 	_words.load("Words/Doorbot");
+	_quotes.load("Quotes/Doorbot");
 }
 
 void DoorbotScript::setupSentences() {
@@ -142,7 +143,8 @@ ScriptChangedResult DoorbotScript::scriptChanged(TTscriptBase *roomScript, uint
 int DoorbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
 	warning("TODO");
-	return 0;
+
+	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
 int DoorbotScript::proc21(int v1, int v2, int v3) {
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 926d96f..b6b2428 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -40,6 +40,7 @@ LiftbotScript::LiftbotScript(int val1, const char *charClass, int v2,
 	setupSentences();
 	_tagMappings.load("TagMap/Liftbot");
 	_words.load("Words/Liftbot");
+	_quotes.load("Quotes/Liftbot");
 }
 
 void LiftbotScript::setupSentences() {
@@ -99,7 +100,8 @@ ScriptChangedResult LiftbotScript::scriptChanged(TTscriptBase *roomScript, uint
 int LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
 	warning("TODO");
-	return 0;
+
+	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
 int LiftbotScript::proc21(int v1, int v2, int v3) {
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 891c661..d02a2ad 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -42,6 +42,7 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
 	loadResponses("Responses/MaitreD");
 	setupSentences();
 	_tagMappings.load("TagMap/MaitreD");
+	_quotes.load("Quotes/MaitreD");
 }
 
 void MaitreDScript::setupSentences() {
@@ -76,7 +77,8 @@ ScriptChangedResult MaitreDScript::scriptChanged(TTscriptBase *roomScript, uint
 int MaitreDScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
 	warning("TODO");
-	return 0;
+
+	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
 int MaitreDScript::proc21(int v1, int v2, int v3) {
diff --git a/engines/titanic/true_talk/script_support.cpp b/engines/titanic/true_talk/script_support.cpp
index 857d774..dd20edd 100644
--- a/engines/titanic/true_talk/script_support.cpp
+++ b/engines/titanic/true_talk/script_support.cpp
@@ -140,4 +140,26 @@ void TTwordEntries::load(const char *name) {
 	delete r;
 }
 
+/*------------------------------------------------------------------------*/
+
+void TThandleQuoteEntries::load(const char *name) {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+
+	_tag1 = r->readUint32LE();
+	_tag2 = r->readUint32LE();
+	_rangeStart = r->readUint32LE();
+	_rangeEnd = r->readUint32LE();
+
+	while (r->pos() < r->size()) {
+		TThandleQuoteEntry qe;
+		qe._index = r->readUint32LE();
+		qe._tagId = r->readUint32LE();
+		qe._dialogueId = r->readUint32LE();
+
+		push_back(qe);
+	}
+
+	delete r;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/script_support.h b/engines/titanic/true_talk/script_support.h
index 50576ca..625ae3f 100644
--- a/engines/titanic/true_talk/script_support.h
+++ b/engines/titanic/true_talk/script_support.h
@@ -129,8 +129,20 @@ struct TThandleQuoteEntry {
 	uint _index;
 	uint _tagId;
 	uint _dialogueId;
+
+	TThandleQuoteEntry() : _index(0), _tagId(0), _dialogueId(0) {}
 };
 
+class TThandleQuoteEntries : public Common::Array<TThandleQuoteEntry> {
+public:
+	uint _tag1, _tag2;
+	uint _rangeStart, _rangeEnd;
+public:
+	TThandleQuoteEntries() : _tag1(0), _tag2(0), _rangeStart(0), _rangeEnd(0) {}
+	void load(const char *name);
+};
+
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_TT_NPC_SCRIPT_H */
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 3fc6d0a..3e8564c 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -268,7 +268,60 @@ bool TTnpcScript::handleWord(uint id) const {
 
 int TTnpcScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
+	if (_quotes.empty())
+		return 1;
+
+
+	int loopCounter = 0;
+	for (uint idx = 0; idx < _quotes.size() && loopCounter < 2; ++idx) {
+		const TThandleQuoteEntry *qe = &_quotes[idx];
+
+		if (!qe->_index) {
+			// End of list; start at beginning again
+			++loopCounter;
+			idx = 0;
+			qe = &_quotes[0];
+		}
+
+		if (qe->_index == val && (
+				(tagId == 0 && loopCounter == 2) ||
+				(qe->_tagId < MKTAG('A', 'A', 'A', 'A')) ||
+				(qe->_tagId == tagId)
+				)) {
+			uint foundTagId = qe->_tagId;
+			if (foundTagId > 0 && foundTagId < 100) {
+				if (!tagId)
+					foundTagId >>= 1;
+				if (getRandomNumber(100) < foundTagId)
+					return 1;
+			}
+
+			uint dialogueId = qe->_dialogueId;
+			if (dialogueId >= _quotes._rangeStart && dialogueId <= _quotes._rangeEnd) {
+				dialogueId -= _quotes._rangeStart;
+				if (dialogueId > 3)
+					error("Invalid dialogue index in BarbotScript");
+				
+				const int RANDOM_LIMITS[4] = { 30, 50, 70, 60 };
+				int rangeLimit = RANDOM_LIMITS[dialogueId];
+				int dialRegion = getDialRegion(0);
+
+				if (dialRegion != 1) {
+					rangeLimit = MAX(rangeLimit - 20, 20);
+				}
+
+				dialogueId = (((int)remainder + 25) % 100) >= rangeLimit 
+					? _quotes._tag1 : _quotes._tag2;
+			}
+
+			addResponse(getDialogueId(dialogueId));
+			applyResponse();
+			return 2;
+		}
+	}
+
 	return 1;
+
 }
 
 uint TTnpcScript::getRangeValue(uint id) {
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index bd5b759..819de77 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -83,6 +83,7 @@ protected:
 	TTsentenceEntries _entries;
 	TTtagMappings _tagMappings;
 	TTwordEntries _words;
+	TThandleQuoteEntries _quotes;
 	int _entryCount;
 	int _field68;
 	int _field6C;


Commit: 5bc347007c3168bf99fe4847d09904f5f236624b
    https://github.com/scummvm/scummvm/commit/5bc347007c3168bf99fe4847d09904f5f236624b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-27T11:57:44-04:00

Commit Message:
TITANIC: Finish DoorbotScript handleQuote

Changed paths:
    engines/titanic/true_talk/doorbot_script.cpp



diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index a864141..bd654fc 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -142,7 +142,110 @@ ScriptChangedResult DoorbotScript::scriptChanged(TTscriptBase *roomScript, uint
 
 int DoorbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
-	warning("TODO");
+	switch (tagId) {
+	case MKTAG('A', 'D', 'V', 'T'):
+	case MKTAG('A', 'R', 'T', 'I'):
+	case MKTAG('A', 'R', 'T', 'Y'):
+	case MKTAG('B', 'R', 'N', 'D'):
+	case MKTAG('C', 'O', 'M', 'D'):
+	case MKTAG('D', 'N', 'C', 'E'):
+	case MKTAG('H', 'B', 'B', 'Y'):
+	case MKTAG('L', 'I', 'T', 'R'):
+	case MKTAG('M', 'A', 'G', 'S'):
+	case MKTAG('M', 'C', 'P', 'Y'):
+	case MKTAG('M', 'I', 'N', 'S'):
+	case MKTAG('M', 'U', 'S', 'I'):
+	case MKTAG('N', 'I', 'K', 'E'):
+	case MKTAG('S', 'F', 'S', 'F'):
+	case MKTAG('S', 'O', 'A', 'P'):
+	case MKTAG('S', 'O', 'N', 'G'):
+	case MKTAG('S', 'P', 'R', 'T'):
+	case MKTAG('T', 'E', 'A', 'M'):
+	case MKTAG('T', 'V', 'S', 'H'):
+	case MKTAG('W', 'W', 'E', 'B'):
+		tagId = MKTAG('E', 'N', 'T', 'N');
+		break;
+	case MKTAG('A', 'C', 'T', 'R'):
+	case MKTAG('A', 'C', 'T', 'S'):
+	case MKTAG('A', 'U', 'T', 'H'):
+	case MKTAG('B', 'A', 'R', 'K'):
+	case MKTAG('B', 'A', 'R', 'U'):
+	case MKTAG('B', 'L', 'F', '1'):
+	case MKTAG('B', 'L', 'F', '2'):
+	case MKTAG('B', 'L', 'P', '1'):
+	case MKTAG('B', 'L', 'P', '2'):
+	case MKTAG('B', 'L', 'P', '3'):
+	case MKTAG('B', 'L', 'P', '4'):
+	case MKTAG('B', 'L', 'T', '1'):
+	case MKTAG('B', 'L', 'T', '2'):
+	case MKTAG('B', 'L', 'T', '3'):
+	case MKTAG('B', 'L', 'T', '4'):
+	case MKTAG('B', 'L', 'T', '5'):
+	case MKTAG('B', 'O', 'Y', 'S'):
+	case MKTAG('D', 'C', 'T', 'R'):
+	case MKTAG('F', 'A', 'M', 'E'):
+	case MKTAG('F', 'A', 'S', 'H'):
+	case MKTAG('G', 'I', 'R', 'L'):
+	case MKTAG('H', 'E', 'R', 'O'):
+	case MKTAG('H', 'O', 'S', 'T'):
+	case MKTAG('K', 'N', 'O', 'B'):
+	case MKTAG('N', 'H', 'R', 'O'):
+	case MKTAG('R', 'A', 'C', 'E'):
+	case MKTAG('S', 'C', 'I', 'T'):
+	case MKTAG('T', 'D', 'V', 'P'):
+	case MKTAG('T', 'W', 'A', 'T'):
+	case MKTAG('W', 'E', 'A', 'T'):
+		tagId = MKTAG('P', 'R', 'S', 'N');
+		break;
+	case MKTAG('C', 'H', 'S', 'E'):
+	case MKTAG('C', 'M', 'N', 'T'):
+	case MKTAG('F', 'I', 'L', 'M'):
+	case MKTAG('J', 'F', 'O', 'D'):
+	case MKTAG('L', 'I', 'Q', 'D'):
+		tagId = MKTAG('F', 'O', 'O', 'D');
+		break;
+	case MKTAG('C', 'R', 'I', 'M'):
+	case MKTAG('C', 'S', 'P', 'Y'):
+	case MKTAG('D', 'R', 'U', 'G'):
+		tagId = MKTAG('V', 'B', 'A', 'D');
+		break;
+	case MKTAG('E', 'A', 'R', 'T'):
+	case MKTAG('H', 'O', 'M', 'E'):
+	case MKTAG('N', 'P', 'L', 'C'):
+	case MKTAG('P', 'L', 'A', 'N'):
+		tagId = MKTAG('P', 'L', 'A', 'C');
+		break;
+	case MKTAG('F', 'A', 'U', 'N'):
+	case MKTAG('F', 'I', 'S', 'H'):
+	case MKTAG('F', 'L', 'O', 'R'):
+		tagId = MKTAG('N', 'A', 'T', 'R');
+		break;
+	case MKTAG('H', 'H', 'L', 'D'):
+	case MKTAG('T', 'O', 'Y', 'S'):
+	case MKTAG('W', 'E', 'A', 'P'):
+		tagId = MKTAG('M', 'A', 'C', 'H');
+		break;
+	case MKTAG('M', 'L', 'T', 'Y'):
+	case MKTAG('P', 'G', 'R', 'P'):
+	case MKTAG('P', 'T', 'I', 'C'):
+		tagId = MKTAG('G', 'R', 'U', 'P');
+		break;
+	case MKTAG('P', 'K', 'U', 'P'):
+	case MKTAG('S', 'E', 'X', '1'):
+	case MKTAG('S', 'W', 'E', 'R'):
+		tagId = MKTAG('R', 'U', 'D', 'E');
+		break;
+	case MKTAG('P', 'H', 'I', 'L'):
+	case MKTAG('R', 'C', 'K', 'T'):
+		tagId = MKTAG('S', 'C', 'I', 'E');
+		break;
+	case MKTAG('T', 'R', 'A', '2'):
+	case MKTAG('T', 'R', 'A', '3'):
+		tagId = MKTAG('T', 'R', 'A', 'V');
+		break;
+	default:
+		break;
+	}
 
 	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }


Commit: 13114f1d836f90eca211ea69a50d5e4a4ae0497a
    https://github.com/scummvm/scummvm/commit/13114f1d836f90eca211ea69a50d5e4a4ae0497a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-27T12:20:46-04:00

Commit Message:
TITANIC: Finish LiftbotScript handleQuote

Changed paths:
    engines/titanic/true_talk/liftbot_script.cpp



diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index b6b2428..30016ac 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -99,7 +99,111 @@ ScriptChangedResult LiftbotScript::scriptChanged(TTscriptBase *roomScript, uint
 
 int LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
-	warning("TODO");
+	switch (tagId) {
+	case MKTAG('A', 'D', 'V', 'T'):
+	case MKTAG('A', 'R', 'T', 'I'):
+	case MKTAG('A', 'R', 'T', 'Y'):
+	case MKTAG('B', 'R', 'N', 'D'):
+	case MKTAG('C', 'O', 'M', 'D'):
+	case MKTAG('D', 'N', 'C', 'E'):
+	case MKTAG('H', 'B', 'B', 'Y'):
+	case MKTAG('L', 'I', 'T', 'R'):
+	case MKTAG('M', 'A', 'G', 'S'):
+	case MKTAG('M', 'C', 'P', 'Y'):
+	case MKTAG('M', 'I', 'N', 'S'):
+	case MKTAG('M', 'U', 'S', 'I'):
+	case MKTAG('N', 'I', 'K', 'E'):
+	case MKTAG('S', 'F', 'S', 'F'):
+	case MKTAG('S', 'O', 'A', 'P'):
+	case MKTAG('S', 'O', 'N', 'G'):
+	case MKTAG('S', 'P', 'R', 'T'):
+	case MKTAG('T', 'E', 'A', 'M'):
+	case MKTAG('T', 'V', 'S', 'H'):
+	case MKTAG('W', 'W', 'E', 'B'):
+		tagId = MKTAG('E', 'N', 'T', 'N');
+		break;
+	case MKTAG('A', 'C', 'T', 'R'):
+	case MKTAG('A', 'C', 'T', 'S'):
+	case MKTAG('A', 'U', 'T', 'H'):
+	case MKTAG('B', 'A', 'R', 'K'):
+	case MKTAG('B', 'A', 'R', 'U'):
+	case MKTAG('B', 'L', 'F', '1'):
+	case MKTAG('B', 'L', 'F', '2'):
+	case MKTAG('B', 'L', 'R', '1'):
+	case MKTAG('B', 'L', 'R', '2'):
+	case MKTAG('B', 'L', 'P', '1'):
+	case MKTAG('B', 'L', 'P', '2'):
+	case MKTAG('B', 'L', 'P', '3'):
+	case MKTAG('B', 'L', 'P', '4'):
+	case MKTAG('B', 'L', 'T', '1'):
+	case MKTAG('B', 'L', 'T', '2'):
+	case MKTAG('B', 'L', 'T', '3'):
+	case MKTAG('B', 'L', 'T', '4'):
+	case MKTAG('B', 'L', 'T', '5'):
+	case MKTAG('B', 'O', 'Y', 'S'):
+	case MKTAG('C', 'O', 'P', 'S'):
+	case MKTAG('D', 'C', 'T', 'R'):
+	case MKTAG('F', 'A', 'M', 'E'):
+	case MKTAG('F', 'A', 'S', 'H'):
+	case MKTAG('G', 'I', 'R', 'L'):
+	case MKTAG('H', 'E', 'R', 'O'):
+	case MKTAG('H', 'O', 'S', 'T'):
+	case MKTAG('K', 'N', 'O', 'B'):
+	case MKTAG('N', 'H', 'R', 'O'):
+	case MKTAG('R', 'A', 'C', 'E'):
+	case MKTAG('S', 'C', 'I', 'T'):
+	case MKTAG('T', 'D', 'V', 'P'):
+	case MKTAG('T', 'W', 'A', 'T'):
+	case MKTAG('W', 'E', 'A', 'T'):
+		tagId = MKTAG('P', 'R', 'S', 'N');
+		break;
+	case MKTAG('C', 'H', 'S', 'E'):
+	case MKTAG('C', 'M', 'N', 'T'):
+	case MKTAG('F', 'I', 'L', 'M'):
+	case MKTAG('J', 'F', 'O', 'D'):
+	case MKTAG('L', 'I', 'Q', 'D'):
+		tagId = MKTAG('F', 'O', 'O', 'D');
+		break;
+	case MKTAG('C', 'R', 'I', 'M'):
+	case MKTAG('C', 'S', 'P', 'Y'):
+	case MKTAG('D', 'R', 'U', 'G'):
+		tagId = MKTAG('V', 'B', 'A', 'D');
+		break;
+	case MKTAG('E', 'A', 'R', 'T'):
+	case MKTAG('H', 'O', 'M', 'E'):
+	case MKTAG('N', 'P', 'L', 'C'):
+	case MKTAG('P', 'L', 'A', 'N'):
+		tagId = MKTAG('P', 'L', 'A', 'C');
+		break;
+	case MKTAG('F', 'A', 'U', 'N'):
+	case MKTAG('F', 'I', 'S', 'H'):
+	case MKTAG('F', 'L', 'O', 'R'):
+		tagId = MKTAG('N', 'A', 'T', 'R');
+		break;
+	case MKTAG('H', 'H', 'L', 'D'):
+	case MKTAG('T', 'O', 'Y', 'S'):
+	case MKTAG('W', 'E', 'A', 'P'):
+		tagId = MKTAG('M', 'A', 'C', 'H');
+		break;
+	case MKTAG('M', 'L', 'T', 'Y'):
+	case MKTAG('P', 'G', 'R', 'P'):
+	case MKTAG('P', 'T', 'I', 'C'):
+		tagId = MKTAG('G', 'R', 'U', 'P');
+		break;
+	case MKTAG('P', 'K', 'U', 'P'):
+	case MKTAG('S', 'E', 'X', '1'):
+	case MKTAG('S', 'W', 'E', 'R'):
+		tagId = MKTAG('R', 'U', 'D', 'E');
+		break;
+	case MKTAG('P', 'H', 'I', 'L'):
+	case MKTAG('R', 'C', 'K', 'T'):
+		tagId = MKTAG('S', 'C', 'I', 'E');
+		break;
+	case MKTAG('T', 'R', 'A', '2'):
+	case MKTAG('T', 'R', 'A', '3'):
+		tagId = MKTAG('T', 'R', 'A', 'V');
+		break;
+	}
 
 	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }


Commit: 2457340315e73617b6a9a1a37e28628aacfde45c
    https://github.com/scummvm/scummvm/commit/2457340315e73617b6a9a1a37e28628aacfde45c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-27T12:44:49-04:00

Commit Message:
TITANIC: Finish MaitreDScript handleQuote

Changed paths:
    engines/titanic/true_talk/maitred_script.cpp



diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index d02a2ad..86862a7 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -76,7 +76,110 @@ ScriptChangedResult MaitreDScript::scriptChanged(TTscriptBase *roomScript, uint
 
 int MaitreDScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
-	warning("TODO");
+	switch (tagId) {
+	case MKTAG('A', 'D', 'V', 'T'):
+	case MKTAG('A', 'R', 'T', 'I'):
+	case MKTAG('A', 'R', 'T', 'Y'):
+	case MKTAG('B', 'R', 'N', 'D'):
+	case MKTAG('C', 'O', 'M', 'D'):
+	case MKTAG('D', 'N', 'C', 'E'):
+	case MKTAG('H', 'B', 'B', 'Y'):
+	case MKTAG('L', 'I', 'T', 'R'):
+	case MKTAG('M', 'A', 'G', 'S'):
+	case MKTAG('M', 'C', 'P', 'Y'):
+	case MKTAG('M', 'I', 'N', 'S'):
+	case MKTAG('M', 'U', 'S', 'I'):
+	case MKTAG('N', 'I', 'K', 'E'):
+	case MKTAG('S', 'F', 'S', 'F'):
+	case MKTAG('S', 'O', 'A', 'P'):
+	case MKTAG('S', 'P', 'R', 'T'):
+	case MKTAG('S', 'O', 'N', 'G'):
+	case MKTAG('T', 'E', 'A', 'M'):
+	case MKTAG('T', 'V', 'S', 'H'):
+	case MKTAG('W', 'W', 'E', 'B'):
+		tagId = MKTAG('E', 'N', 'T', 'N');
+		break;
+	case MKTAG('A', 'C', 'T', 'R'):
+	case MKTAG('A', 'C', 'T', 'S'):
+	case MKTAG('A', 'U', 'T', 'H'):
+	case MKTAG('B', 'A', 'R', 'K'):
+	case MKTAG('B', 'A', 'R', 'U'):
+	case MKTAG('B', 'L', 'F', '1'):
+	case MKTAG('B', 'L', 'F', '2'):
+	case MKTAG('B', 'L', 'P', '1'):
+	case MKTAG('B', 'L', 'P', '2'):
+	case MKTAG('B', 'L', 'P', '3'):
+	case MKTAG('B', 'L', 'P', '4'):
+	case MKTAG('B', 'L', 'R', '1'):
+	case MKTAG('B', 'L', 'R', '2'):
+	case MKTAG('B', 'L', 'T', '1'):
+	case MKTAG('B', 'L', 'T', '2'):
+	case MKTAG('B', 'L', 'T', '3'):
+	case MKTAG('B', 'L', 'T', '4'):
+	case MKTAG('B', 'L', 'T', '5'):
+	case MKTAG('C', 'O', 'P', 'S'):
+	case MKTAG('D', 'C', 'T', 'R'):
+	case MKTAG('F', 'A', 'M', 'E'):
+	case MKTAG('F', 'A', 'S', 'H'):
+	case MKTAG('G', 'I', 'R', 'L'):
+	case MKTAG('H', 'E', 'R', 'O'):
+	case MKTAG('H', 'O', 'S', 'T'):
+	case MKTAG('K', 'N', 'O', 'B'):
+	case MKTAG('N', 'H', 'R', 'O'):
+	case MKTAG('R', 'A', 'C', 'E'):
+	case MKTAG('S', 'C', 'I', 'T'):
+	case MKTAG('T', 'D', 'V', 'P'):
+	case MKTAG('T', 'W', 'A', 'T'):
+	case MKTAG('W', 'E', 'A', 'T'):
+		tagId = MKTAG('P', 'R', 'S', 'N');
+		break;
+	case MKTAG('C', 'H', 'S', 'E'):
+	case MKTAG('C', 'M', 'N', 'T'):
+	case MKTAG('F', 'I', 'L', 'M'):
+	case MKTAG('L', 'I', 'Q', 'D'):
+		tagId = MKTAG('F', 'O', 'O', 'D');
+		break;
+	case MKTAG('C', 'R', 'I', 'M'):
+	case MKTAG('C', 'S', 'P', 'Y'):
+	case MKTAG('D', 'R', 'U', 'G'):
+		tagId = MKTAG('V', 'B', 'A', 'D');
+		break;
+	case MKTAG('E', 'A', 'R', 'T'):
+	case MKTAG('H', 'O', 'M', 'E'):
+	case MKTAG('N', 'P', 'L', 'C'):
+	case MKTAG('P', 'L', 'A', 'N'):
+		tagId = MKTAG('P', 'L', 'A', 'C');
+		break;
+	case MKTAG('F', 'A', 'U', 'N'):
+	case MKTAG('F', 'I', 'S', 'H'):
+	case MKTAG('F', 'L', 'O', 'R'):
+		tagId = MKTAG('N', 'A', 'T', 'R');
+		break;
+	case MKTAG('H', 'H', 'L', 'D'):
+	case MKTAG('T', 'O', 'Y', 'S'):
+	case MKTAG('W', 'E', 'A', 'P'):
+		tagId = MKTAG('M', 'A', 'C', 'H');
+		break;
+	case MKTAG('M', 'L', 'T', 'Y'):
+	case MKTAG('P', 'G', 'R', 'P'):
+	case MKTAG('P', 'T', 'I', 'C'):
+		tagId = MKTAG('G', 'R', 'U', 'P');
+		break;
+	case MKTAG('P', 'K', 'U', 'P'):
+	case MKTAG('S', 'E', 'X', '1'):
+	case MKTAG('S', 'W', 'E', 'R'):
+		tagId = MKTAG('R', 'U', 'D', 'E');
+		break;
+	case MKTAG('P', 'H', 'I', 'L'):
+	case MKTAG('R', 'C', 'K', 'T'):
+		tagId = MKTAG('S', 'C', 'I', 'E');
+		break;
+	case MKTAG('T', 'R', 'A', '2'):
+	case MKTAG('T', 'R', 'A', '3'):
+		tagId = MKTAG('T', 'R', 'A', 'V');
+		break;
+
+	}
 
 	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }


Commit: 8cc9142a92298dbf16f438dcf36d3e4d74e3d9f9
    https://github.com/scummvm/scummvm/commit/8cc9142a92298dbf16f438dcf36d3e4d74e3d9f9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-27T19:41:07-04:00

Commit Message:
TITANIC: Renaming for NPC state methods

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_concept.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_script_base.cpp
    engines/titanic/true_talk/tt_script_base.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 7a20ee4..1119722 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -74,7 +74,7 @@ int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 			addResponse(STATE_ARRAY[_state++]);
 		} else {
 			selectResponse(51896);
-			set34(1);
+			setState(1);
 			_state = 0;
 		}
 
@@ -202,8 +202,8 @@ int BarbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	CTrueTalkManager::setFlags(33, getValue(33) - 1);
 	CTrueTalkManager::setFlags(34, getValue(34) - 1);
 	
-	int val34 = get34();
-	set34(0);
+	int val34 = getState();
+	setState(0);
 
 	int val2C = sentence->_field2C;
 	bool flag = val2C == 11 || val2C == 13;
@@ -533,7 +533,7 @@ int BarbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	case 59:
 		if (flag) {
 			if (addRandomResponse(true)) {
-				set34(59);
+				setState(59);
 				return 2;
 			}
 		} else if (flag2) {
@@ -542,7 +542,7 @@ int BarbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 		break;
 	case 60:
 		if (flag && addRandomResponse(true)) {
-			set34(59);
+			setState(59);
 			return 2;
 		} else if (flag2 || val2C == 7 || val2C == 10) {
 			return applySentenceIds(getDialogueId(251712));
@@ -613,7 +613,7 @@ int BarbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 
 done:
 	// Adjust primary dial
-	set34(0);
+	setState(0);
 	if (sentence->get58() != 5) {
 		adjustDial(0, sentence->get58() * 4 - 20);
 	} else if (getDialLevel(0, false) > 65) {
@@ -809,7 +809,7 @@ ScriptChangedResult BarbotScript::scriptChanged(TTscriptBase *roomScript, uint i
 			addResponse(getDialogueId(250577));
 			applyResponse();
 		} else {
-			set34(57);
+			setState(57);
 		}
 		break;
 
@@ -964,7 +964,7 @@ int BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
-int BarbotScript::proc21(int v1, int v2, int v3) {
+int BarbotScript::updateState(int oldId, int newId, int index) {
 	warning("TODO");
 	return 0;
 }
@@ -987,7 +987,7 @@ uint BarbotScript::getDialsBitset() const {
 }
 
 int BarbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
-	int v34 = get34();
+	int v34 = getState();
 	uint id = 0;
 
 	if (v34 > 0x200) {
@@ -1150,13 +1150,13 @@ int BarbotScript::applySentenceIds(int dialogueId, int v34) {
 	applyResponse();
 
 	if (v34 != -1) {
-		set34(v34);
+		setState(v34);
 	} else {
 		for (uint idx = 0; idx < _mappings.size(); ++idx) {
 			const TTscriptMapping &m = _mappings[idx];
 			for (int vidx = 0; vidx < _mappings._valuesPerMapping; ++idx) {
 				if (m._values[vidx] == (uint)dialogueId) {
-					proc21(m._id, m._id, vidx);
+					updateState(m._id, m._id, vidx);
 					break;
 				}
 			}
@@ -1171,7 +1171,7 @@ int BarbotScript::setResponse(int dialogueId, int state) {
 	applyResponse();
 
 	if (state != -1)
-		set34(state);
+		setState(state);
 	return 2;
 }
 
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 977d0a1..dff72d5 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -73,7 +73,11 @@ public:
 	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 	
-	virtual int proc21(int v1, int v2, int v3);
+	/**
+	 * Handles updating NPC state based on specified dialogue Ids and dial positions
+	 */
+	virtual int updateState(int oldId, int newId, int index);
+
 	virtual int proc22(int id) const;
 
 	/**
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 988efa9..573015c 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -182,7 +182,7 @@ int BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
-int BellbotScript::proc21(int v1, int v2, int v3) {
+int BellbotScript::updateState(int oldId, int newId, int index) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 704bce8..2350768 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -58,7 +58,11 @@ public:
 	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 
-	virtual int proc21(int v1, int v2, int v3);
+	/**
+	 * Handles updating NPC state based on specified dialogue Ids and dial positions
+	 */
+	virtual int updateState(int oldId, int newId, int index);
+
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
 
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index a95e4df..e1c596b 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -180,7 +180,7 @@ int DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 
 }
 
-int DeskbotScript::proc21(int v1, int v2, int v3) {
+int DeskbotScript::updateState(int oldId, int newId, int index) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index efe71de..1481cdd 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -56,7 +56,11 @@ public:
 	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 
-	virtual int proc21(int v1, int v2, int v3);
+	/**
+	 * Handles updating NPC state based on specified dialogue Ids and dial positions
+	 */
+	virtual int updateState(int oldId, int newId, int index);
+
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index bd654fc..4f74b19 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -83,7 +83,7 @@ int DoorbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence
 		applyResponse();
 
 		if (STATE_ARRAY[_state] == 11826)
-			set34(1);
+			setState(1);
 		++_state;
 		return 2;
 	}
@@ -250,7 +250,7 @@ int DoorbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
-int DoorbotScript::proc21(int v1, int v2, int v3) {
+int DoorbotScript::updateState(int oldId, int newId, int index) {
 	warning("TODO");
 	return 0;
 }
@@ -363,9 +363,9 @@ int DoorbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript,
 		}
 		break;
 	case 17:
-		if (get34())
+		if (getState())
 			return 1;
-		set34(0);
+		setState(0);
 		break;
 	case 18:
 		if (roomScript->_scriptId == 100) {
@@ -468,7 +468,7 @@ int DoorbotScript::setResponse(int dialogueId, int v34) {
 	applyResponse();
 
 	if (v34 != -1)
-		set34(v34);
+		setState(v34);
 	return 2;
 }
 
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 3d2fdfd..db81882 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -72,7 +72,11 @@ public:
 	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 
-	virtual int proc21(int v1, int v2, int v3);
+	/**
+	 * Handles updating NPC state based on specified dialogue Ids and dial positions
+	 */
+	virtual int updateState(int oldId, int newId, int index);
+
 	virtual int proc22(int id) const;
 
 	/**
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 30016ac..6e7d16a 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -60,7 +60,7 @@ int LiftbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence
 	case MKTAG('A', 'N', 'S', 'W'):
 		if (_state >= 7) {
 			selectResponse(30918);
-			set34(2);
+			setState(2);
 			_state = 0;
 		} else {
 			addResponse(STATE_ARRAY[_state++]);
@@ -208,7 +208,7 @@ int LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
-int LiftbotScript::proc21(int v1, int v2, int v3) {
+int LiftbotScript::updateState(int oldId, int newId, int index) {
 	warning("TODO");
 	return 0;
 }
@@ -244,7 +244,7 @@ int LiftbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript,
 		0, 210849, 210850, 210851, 210852, 210838, 210839, 210840, 210841, 0
 	};
 
-	get34();
+	getState();
 	int stateVal;
 
 	switch (val1) {
@@ -362,7 +362,7 @@ int LiftbotScript::addDialogueAndState(int id, int state) {
 	applyResponse();
 
 	if (state != 1)
-		set34(state);
+		setState(state);
 	return 2;
 }
 
@@ -400,14 +400,14 @@ int LiftbotScript::addResponse1(int index, bool flag, int id) {
 	if (index >= 2 && index <= 19 && stateVal > 1) {
 		addResponse(getDialogueId(210203));
 		applyResponse();
-		set34(7);
+		setState(7);
 		return true;
 	}
 
 	if (index >= 20 && index <= 27 && stateVal > 2) {
 		addResponse(getDialogueId(210210));
 		applyResponse();
-		set34(8);
+		setState(8);
 		return true;
 	}
 
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index ba917f4..3aa620d 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -69,7 +69,11 @@ public:
 	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 
-	virtual int proc21(int v1, int v2, int v3);
+	/**
+	 * Handles updating NPC state based on specified dialogue Ids and dial positions
+	 */
+	virtual int updateState(int oldId, int newId, int index);
+
 	virtual int proc22(int id) const;
 
 	/**
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 86862a7..d1d6424 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -184,7 +184,7 @@ int MaitreDScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
-int MaitreDScript::proc21(int v1, int v2, int v3) {
+int MaitreDScript::updateState(int oldId, int newId, int index) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 178979c..5937b7d 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -55,7 +55,11 @@ public:
 	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 
-	virtual int proc21(int v1, int v2, int v3);
+	/**
+	 * Handles updating NPC state based on specified dialogue Ids and dial positions
+	 */
+	virtual int updateState(int oldId, int newId, int index);
+
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 23ecf35..51e88ec 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -88,7 +88,7 @@ int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScrip
 
 	int canProcess = 0;
 	if (result) {
-		sentence->set34(result);
+		sentence->setState(result);
 		if (roomScript->canRespond(npcScript, sentence, result)) {
 			canProcess = npcScript->chooseResponse(roomScript, sentence, result);
 		}
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 876cd16..b1e4351 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -84,7 +84,7 @@ ScriptChangedResult SuccUBusScript::scriptChanged(TTscriptBase *roomScript, uint
 	return SCR_1;
 }
 
-int SuccUBusScript::proc21(int v1, int v2, int v3) {
+int SuccUBusScript::updateState(int oldId, int newId, int index) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 9e393b8..ba8bc61 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -54,7 +54,11 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-	virtual int proc21(int v1, int v2, int v3);
+	/**
+	 * Handles updating NPC state based on specified dialogue Ids and dial positions
+	 */
+	virtual int updateState(int oldId, int newId, int index);
+
 	virtual int proc23() const;
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 3301926..88afb6f 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -132,7 +132,7 @@ public:
 	void setFlag(bool val) { _flag = val; }
 	void set1C(int val) { _field1C = val; }
 	int get20() const { return _field20; }
-	int get34() const { return _field34; }
+	int getState() const { return _field34; }
 
 	bool checkWordId1() const;
 	bool checkWordId2() const;
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 3e8564c..1c133bd 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -372,8 +372,8 @@ void TTnpcScript::resetRange(int id) {
 		range->_priorIndex = 0;
 }
 
-int TTnpcScript::proc21(int v1, int v2, int v3) {
-	return v2;
+int TTnpcScript::updateState(int oldId, int newId, int index) {
+	return newId;
 }
 
 int TTnpcScript::proc22(int id) const {
@@ -638,7 +638,7 @@ uint TTnpcScript::getDialogueId(uint tagId) {
 		tagId = getRangeValue(tagId);
 
 	oldTagId = getDialsBitset();
-	uint newId = proc21(origId, tagId, oldTagId);
+	uint newId = updateState(origId, tagId, oldTagId);
 	if (!newId)
 		return 0;
 
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 819de77..1353dcd 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -256,7 +256,11 @@ public:
 	 */
 	virtual void resetRange(int id);
 
-	virtual int proc21(int v1, int v2, int v3);
+	/**
+	 * Handles updating NPC state based on specified dialogue Ids and dial positions
+	 */
+	virtual int updateState(int oldId, int newId, int index);
+
 	virtual int proc22(int id) const;
 
 	/**
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index c6a197a..e96f877 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -26,12 +26,12 @@
 
 namespace Titanic {
 
-TTscriptBase::TTscriptBase(int scriptId, const char *charClass, int v2,
+TTscriptBase::TTscriptBase(int scriptId, const char *charClass, int state,
 		const char *charName, int v3, int v4, int v5, int v6, int v7) :
 		_charName(charName), _charClass(charClass), _status(0),
 		_nodesP(nullptr), _id(0), _hist1P(nullptr),
 		_field20(0), _field24(0), _field28(0), _field2C(0),
-		_field30(0), _field34(0), _hist2P(nullptr), _field3C(0),
+		_field30(0), _state(0), _hist2P(nullptr), _field3C(0),
 		_respHeadP(nullptr), _respTailP(nullptr), _oldResponseP(nullptr) {
 	if (!isValid()) {
 		if (!v7 || !getStatus()) {
@@ -41,7 +41,7 @@ TTscriptBase::TTscriptBase(int scriptId, const char *charClass, int v2,
 			_field28 = v5;
 			_field2C = v6;
 			_field30 = v7;
-			_field34 = v2;
+			_state = state;
 		} else {
 			_status = 5;
 		}
@@ -79,7 +79,7 @@ void TTscriptBase::reset() {
 	_field28 = -1;
 	_field2C = -1;
 	_field30 = 0;
-	_field34 = 0;
+	_state = 0;
 	_hist2P = nullptr;
 	_field3C = 0;
 	_respHeadP = nullptr;
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index e94bab3..3060602 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -48,7 +48,7 @@ protected:
 	int _field28;
 	int _field2C;
 	int _field30;
-	int _field34;
+	int _state;
 	TThist *_hist2P;
 	int _field3C;
 	TTresponse *_respHeadP;
@@ -72,8 +72,15 @@ protected:
 		appendResponse(val1, val2, str);
 	}
 
-	void set34(int val) { _field34 = val; }
-	int get34() const { return _field34; }
+	/**
+	 * Set the script state
+	 */
+	void setState(int state) { _state = state; }
+	
+	/**
+	 * Get the current state
+	 */
+	int getState() const { return _state; }
 public:
 	int _id;
 public:
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 56ccc5a..467f6a1 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -258,7 +258,7 @@ int TTsentence::is1C(int val, const TTconceptNode *node) const {
 
 bool TTsentence::isConcept34(int slotIndex, TTconceptNode *node) {
 	TTconcept *concept = getFrameEntry(slotIndex, node);
-	return concept && concept->get34();
+	return concept && concept->getState();
 }
 
 bool TTsentence::localWord(const char *str) const {
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 2e40dd7..2900a4d 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -74,7 +74,7 @@ public:
 	TTsentence(const TTsentence *src);
 	~TTsentence();
 
-	void set34(int v) { _field34 = v; }
+	void setState(int v) { _field34 = v; }
 	void set38(int v) { _field38 = v; }
 	bool check2C() const { return _field2C > 1 && _field2C <= 10; }
 	int concept18(TTconceptNode *conceptNode) {


Commit: 875a9998c5c537f861c5c4e9855bf7d84332cd6b
    https://github.com/scummvm/scummvm/commit/875a9998c5c537f861c5c4e9855bf7d84332cd6b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-27T22:26:23-04:00

Commit Message:
TITANIC: Added BellbotScript updateState

Changed paths:
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/script_support.cpp
    engines/titanic/true_talk/script_support.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 573015c..87bdb93 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -23,10 +23,14 @@
 #include "common/textconsole.h"
 #include "titanic/true_talk/bellbot_script.h"
 #include "titanic/true_talk/true_talk_manager.h"
+#include "titanic/pet_control/pet_control.h"
 #include "titanic/core/node_item.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
+int BellbotScript::_oldId;
+
 BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
@@ -183,8 +187,115 @@ int BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 }
 
 int BellbotScript::updateState(int oldId, int newId, int index) {
-	warning("TODO");
-	return 0;
+	if (!getValue(25)) {
+		newId = 202043 - getValue(1) <= 2 ? 994 : 0;
+		CTrueTalkManager::setFlags(25, 1);
+	}
+
+	if (oldId == _oldId && _rangeResetCtr >= 3) {
+		TTscriptRange *range = findRange(oldId);
+		if (range)
+			range->_priorIndex = 0;
+
+		_rangeResetCtr = 0;
+		return getRangeValue(200370);
+	}
+
+	if (oldId != _oldId) {
+		_oldId = oldId;
+		_rangeResetCtr = 0;
+	}
+
+	if (oldId >= 201709 && oldId <= 201754) {
+		addResponse(getDialogueId(201705));
+		addResponse(getDialogueId(201706));
+		newId = getRangeValue(201707);
+	}
+
+	if (newId == 202276)
+		newId = addLocation();
+	if (newId == 202275)
+		newId = getStateDialogueId();
+
+	if (getValue(1) >= 2) {
+		if (newId == 200840 || newId == 200845 || newId == 200846 || newId == 200851) {
+			if (getValue(1) == 2) {
+				newId = 202047;
+			} else {
+				newId = getRangeValue(202848);
+			}
+		}
+	}
+
+	if (getValue(1) >= 3) {
+		if (newId == 200841 || newId == 200842 || newId == 200843 ||
+				newId == 200847 || newId == 200848 || newId == 200854) {
+			newId = getRangeValue(202038);
+		}
+	}
+
+	if (newId == 200264 && getValue(1) == 1)
+		newId = 200267;
+	if (newId == 202231 && getValue(1) == 1)
+		newId = 200848;
+
+	int v4 = getValue(4);
+	if (newId == 200187 && v4) {
+		return 200188;
+	} else if (newId == 200188 && !v4) {
+		return 200187;
+	} else if (newId == 200014 && (v4 == 1 || v4 == 2)) {
+		return 200011;
+	} else if (newId == 200011 && !v4) {
+		return 200014;
+	}
+
+	if (oldId == 200612) {
+		CTrueTalkManager::setFlags(25, 2);
+		CTrueTalkManager::setFlags(5, 1);
+	}
+
+	if (newId == 200423 || newId == 200424 || newId == 200425) {
+		if (getValue(5)) {
+			CTrueTalkManager::triggerAction(16, 0);
+		} else {
+			newId = 200611;
+		}
+	}
+
+	if (oldId == 200261 && getRandomNumber(10) == 1) {
+		if (getValue(1) >= 3)
+			newId = getRangeValue(200283);
+		else if (getValue(1) == 2)
+			newId = getRangeValue(200279);
+	}
+
+	if (oldId == 200962) {
+		if (getValue(1) == 2)
+			return 200963;
+		if (getValue(1) == 1)
+			return 200964;
+	}
+	if (oldId == 200989 && getValue(1) <= 2)
+		return 200990;
+
+	if (oldId == 201760) {
+		CGameManager *gameManager = g_vm->_trueTalkManager->getGameManager();
+		CPetControl *pet = getPetControl(gameManager);
+
+		if (pet) {
+			bool canSummon = pet->canSummonBot("DoorBot");
+			if (canSummon) {
+				CTrueTalkManager::_v9 = 101;
+				CTrueTalkManager::triggerAction(5, 0);
+			} else {
+				newId = 201857;
+			}
+		}
+	}
+
+	setValue25(newId);
+	return newId;
 }
 
 int BellbotScript::proc22(int id) const {
@@ -289,4 +400,31 @@ int BellbotScript::proc36(int id) const {
 	return 0;
 }
 
+int BellbotScript::addLocation() {
+	addResponse(getDialogueId(202228));
+	int roomNum, floorNum, elevatorNum;
+	getAssignedRoom(&roomNum, &floorNum, &elevatorNum);
+
+	addResponse(getDialogueId(202071 + roomNum));
+	addResponse(getDialogueId(201933 + floorNum));
+	addResponse(getDialogueId(201916 + elevatorNum));
+
+	return 200858;
+}
+
+int BellbotScript::getStateDialogueId() const {
+	switch (getValue(1)) {
+	case 1:
+		return 201253;
+	case 2:
+		return 200282;
+	default:
+		return 201246;
+	}
+}
+
+void BellbotScript::setValue25(int id) {
+	// TODO
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 2350768..e3cea8b 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -29,6 +29,7 @@ namespace Titanic {
 
 class BellbotScript : public TTnpcScript {
 private:
+	static int _oldId;
 	int _array[150];
 	int _field2D0;
 	int _field2D4;
@@ -39,6 +40,21 @@ private:
 	 * Setup sentence data
 	 */
 	void setupSentences();
+
+	/**
+	 * Add the current location to the response
+	 */
+	int addLocation();
+
+	/**
+	 * Get a dialogue Id based on the state
+	 */
+	int getStateDialogueId() const;
+
+	/**
+	 * Sets the state value 25 based on the passed Id
+	 */
+	void setValue25(int id);
 public:
 	BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
diff --git a/engines/titanic/true_talk/script_support.cpp b/engines/titanic/true_talk/script_support.cpp
index dd20edd..3a7c33e 100644
--- a/engines/titanic/true_talk/script_support.cpp
+++ b/engines/titanic/true_talk/script_support.cpp
@@ -162,4 +162,21 @@ void TThandleQuoteEntries::load(const char *name) {
 	delete r;
 }
 
+/*------------------------------------------------------------------------*/
+
+void TTupdateStateEntries::load(const char *name) {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+
+	while (r->pos() < r->size()) {
+		TTupdateStateEntry ue;
+		ue._v1 = r->readUint32LE();
+		ue._v2 = r->readUint32LE();
+		ue._v3 = r->readUint32LE();
+
+		push_back(ue);
+	}
+
+	delete r;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/script_support.h b/engines/titanic/true_talk/script_support.h
index 625ae3f..915b9eb 100644
--- a/engines/titanic/true_talk/script_support.h
+++ b/engines/titanic/true_talk/script_support.h
@@ -142,6 +142,16 @@ public:
 	void load(const char *name);
 };
 
+struct TTupdateStateEntry {
+	uint _v1;
+	uint _v2;
+	uint _v3;
+};
+
+class TTupdateStateEntries : public Common::Array<TTupdateStateEntry> {
+public:
+	void load(const char *name);
+};
 
 } // End of namespace Titanic
 
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 1c133bd..f211111 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -559,7 +559,7 @@ int TTnpcScript::getRoom54(int roomId) {
 	return room ? room->_field54 : 0;
 }
 
-int TTnpcScript::getValue(int testNum) {
+int TTnpcScript::getValue(int testNum) const {
 	switch (testNum) {
 	case 0:
 		return CTrueTalkManager::_v2;
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 1353dcd..833262d 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -121,7 +121,7 @@ protected:
 	/**
 	 * Perform test on various state values
 	 */
-	int getValue(int testNum);
+	int getValue(int testNum) const;
 
 	/**
 	 * Gets a random number between 1 and a given max


Commit: a185a99a86b44f0a05580b9dc3da308b7666b8bf
    https://github.com/scummvm/scummvm/commit/a185a99a86b44f0a05580b9dc3da308b7666b8bf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-27T23:04:26-04:00

Commit Message:
TTIANIC: Added support methods for BellbotScript updateState

Changed paths:
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/script_support.cpp
    engines/titanic/true_talk/script_support.h



diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 87bdb93..7748a9d 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -50,6 +50,7 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	_tagMappings.load("TagMap/Bellbot");
 	_words.load("Words/Bellbot");
 	_quotes.load("Quotes/Bellbot");
+	_states.load("States/Bellbot");
 }
 
 void BellbotScript::setupSentences() {
@@ -294,7 +295,7 @@ int BellbotScript::updateState(int oldId, int newId, int index) {
 		}
 	}
 
-	setValue25(newId);
+	setValue23(newId);
 	return newId;
 }
 
@@ -423,8 +424,15 @@ int BellbotScript::getStateDialogueId() const {
 	}
 }
 
-void BellbotScript::setValue25(int id) {
-	// TODO
+void BellbotScript::setValue23(uint id) {
+	uint val = 0;
+	for (uint idx = 0; idx < _states.size() && !val; ++idx) {
+		TTmapEntry &me = _states[idx];
+		if (me._src == id)
+			val = me._dest;
+	}
+
+	CTrueTalkManager::setFlags(23, val);
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index e3cea8b..98dd2c9 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -30,6 +30,7 @@ namespace Titanic {
 class BellbotScript : public TTnpcScript {
 private:
 	static int _oldId;
+	TTmapEntries _states;
 	int _array[150];
 	int _field2D0;
 	int _field2D4;
@@ -54,7 +55,7 @@ private:
 	/**
 	 * Sets the state value 25 based on the passed Id
 	 */
-	void setValue25(int id);
+	void setValue23(uint id);
 public:
 	BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
diff --git a/engines/titanic/true_talk/script_support.cpp b/engines/titanic/true_talk/script_support.cpp
index 3a7c33e..17820ab 100644
--- a/engines/titanic/true_talk/script_support.cpp
+++ b/engines/titanic/true_talk/script_support.cpp
@@ -179,4 +179,20 @@ void TTupdateStateEntries::load(const char *name) {
 	delete r;
 }
 
+/*------------------------------------------------------------------------*/
+
+void TTmapEntries::load(const char *name) {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+
+	while (r->pos() < r->size()) {
+		TTmapEntry me;
+		me._src = r->readUint32LE();
+		me._dest = r->readUint32LE();
+
+		push_back(me);
+	}
+
+	delete r;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/script_support.h b/engines/titanic/true_talk/script_support.h
index 915b9eb..7bc9bb8 100644
--- a/engines/titanic/true_talk/script_support.h
+++ b/engines/titanic/true_talk/script_support.h
@@ -153,6 +153,18 @@ public:
 	void load(const char *name);
 };
 
+struct TTmapEntry {
+	uint _src;
+	uint _dest;
+
+	TTmapEntry() : _src(0), _dest(0) {}
+};
+
+class TTmapEntries : public Common::Array<TTmapEntry> {
+public:
+	void load(const char *name);
+};
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_TT_NPC_SCRIPT_H */


Commit: 7a2a705a7a2aeba7ca7d96b0e561b6d4a56fc4a5
    https://github.com/scummvm/scummvm/commit/7a2a705a7a2aeba7ca7d96b0e561b6d4a56fc4a5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-28T19:00:22-04:00

Commit Message:
TITANIC: Added DeskbotScript updateState

Changed paths:
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/script_support.cpp
    engines/titanic/true_talk/script_support.h



diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index e1c596b..facc5fd 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -26,6 +26,8 @@
 
 namespace Titanic {
 
+int DeskbotScript::_oldId;
+
 DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
@@ -181,8 +183,71 @@ int DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 }
 
 int DeskbotScript::updateState(int oldId, int newId, int index) {
-	warning("TODO");
-	return 0;
+	if (isDial1Medium() || getValue(1) < 4)
+		CTrueTalkManager::setFlags(22, 1);
+
+	if (newId == 240420 || newId == 240947 || newId == 241261) {
+		if (getValue(22) && (newId == 240947 || newId == 241261))
+			newId = getRangeValue(241184);
+	}
+
+	if (newId == 240832)
+		setDialRegion(1, 0);
+
+	if (oldId == 241183) {
+		if (getValue(1) == 2)
+			newId = getRangeValue(241182);
+		else if (getValue(1) == 1)
+			newId = getRangeValue(241181);
+	}
+
+	if (newId == 240931 && getValue(1) <= 2) {
+		newId = 240924;
+	} else if (newId == 240924 && getValue(1) > 2) {
+		newId = 240931;
+	}
+
+	if (newId == 240830 && getValue(1) == 1) {
+		newId = 240801;
+	} else if (newId == 240801 && getValue(1) > 1) {
+		newId = 240830;
+	}
+
+	if (oldId >= 241217 && oldId <= 241259) {
+		addResponse(getDialogueId(241202));
+		addResponse(getDialogueId(241200));
+		newId = getRangeValue(241199);
+	}
+
+	if (newId == 241354)
+		newId = addAssignedRoomDialogue2();
+	if (newId == 241353)
+		newId = getStateDialogueId();
+	if (newId == 240464 && getValue(1) != 1)
+		newId = 240462;
+	
+	if (newId == 241635 && isDial1Medium()) {
+		addResponse(getDialogueId(241556));
+		newId = getRangeValue(241632);
+	}
+
+	if (getValue(20) && (oldId == 240569 || oldId == 240576))
+		newId = 240460;
+	if (!getValue(20)) {
+		if (newId != 240460)
+			goto exit;
+		CTrueTalkManager::setFlags(20, 1);
+	}
+	if (newId == 240460 && _oldId != 240569) {
+		CTrueTalkManager::setFlags(20, 0);
+		newId = 240455;
+	}
+
+exit:
+	_oldId = oldId;
+	setFlags17(newId, index);
+
+	return newId;
 }
 
 int DeskbotScript::proc22(int id) const {
@@ -285,4 +350,53 @@ int DeskbotScript::addAssignedRoomDialogue() {
 	}
 }
 
+int DeskbotScript::addAssignedRoomDialogue2() {
+	addResponse(getDialogueId(241355));
+	int roomNum = 0, floorNum = 0, elevatorNum = 0;
+	getAssignedRoom(&roomNum, &floorNum, &elevatorNum);
+
+	addResponse(getDialogueId(241317 + roomNum));
+	addResponse(getDialogueId(241271 + floorNum));
+	addResponse(getDialogueId(241356));
+	addResponse(getDialogueId(241313 + elevatorNum));
+
+	return 241357;
+}
+
+void DeskbotScript::addAssignedRoomDialogue3() {
+	addResponse(getDialogueId(241513));
+	addResponse(getDialogueId(241510));
+	
+	CTrueTalkManager::setFlags(1, 2);
+	setDialRegion(0, 0);
+	setDialRegion(1, 0);
+	CTrueTalkManager::triggerAction(19, 2);
+	CTrueTalkManager::setFlags(3, 0);
+
+	int roomNum = 1, floorNum = 1, elevatorNum = 1;
+	getAssignedRoom(&roomNum, &floorNum, &elevatorNum);
+
+	addResponse(getDialogueId(241317 + roomNum));
+	addResponse(getDialogueId(241271 + floorNum));
+	addResponse(getDialogueId(241511));
+	addResponse(getDialogueId(241313 + elevatorNum));
+	addResponse(getDialogueId(241512));
+	applyResponse();
+}
+
+int DeskbotScript::getStateDialogueId() const {
+	switch (getValue(1)) {
+	case 1:
+		return 241503;
+	case 2:
+		return 241504;
+	default:
+		return 241505;
+	}
+}
+
+void DeskbotScript::setFlags17(int newId, int index) {
+	// TODO
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 1481cdd..c1313a0 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -30,6 +30,8 @@ namespace Titanic {
 
 class DeskbotScript : public TTnpcScript {
 private:
+	static int _oldId;
+private:
 	/**
 	 * Setup sentence data
 	 */
@@ -39,6 +41,26 @@ private:
 	 * Adds dialogue for the player's assigned room
 	 */
 	int addAssignedRoomDialogue();
+
+	/**
+	 * Adds dialogue for the player's assigned room
+	 */
+	int addAssignedRoomDialogue2();
+
+	/**
+	 * Adds dialogue for the player's assigned room
+	 */
+	void addAssignedRoomDialogue3();
+
+	/**
+	 * Gets a dialogue Id based on the NPC's state
+	 */
+	int getStateDialogueId() const;
+
+	/**
+	 * Sets state data in flags 17
+	 */
+	void setFlags17(int newId, int index);
 public:
 	DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
diff --git a/engines/titanic/true_talk/script_support.cpp b/engines/titanic/true_talk/script_support.cpp
index 17820ab..1a3d66a 100644
--- a/engines/titanic/true_talk/script_support.cpp
+++ b/engines/titanic/true_talk/script_support.cpp
@@ -169,9 +169,9 @@ void TTupdateStateEntries::load(const char *name) {
 
 	while (r->pos() < r->size()) {
 		TTupdateStateEntry ue;
-		ue._v1 = r->readUint32LE();
-		ue._v2 = r->readUint32LE();
-		ue._v3 = r->readUint32LE();
+		ue._newId = r->readUint32LE();
+		ue._newValue = r->readUint32LE();
+		ue._idMatch = r->readUint32LE();
 
 		push_back(ue);
 	}
diff --git a/engines/titanic/true_talk/script_support.h b/engines/titanic/true_talk/script_support.h
index 7bc9bb8..ef71ff0 100644
--- a/engines/titanic/true_talk/script_support.h
+++ b/engines/titanic/true_talk/script_support.h
@@ -143,9 +143,9 @@ public:
 };
 
 struct TTupdateStateEntry {
-	uint _v1;
-	uint _v2;
-	uint _v3;
+	uint _newId;
+	uint _newValue;
+	uint _idMatch;
 };
 
 class TTupdateStateEntries : public Common::Array<TTupdateStateEntry> {


Commit: f36d392c11ef58c33050d952459870a9c931e427
    https://github.com/scummvm/scummvm/commit/f36d392c11ef58c33050d952459870a9c931e427
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-28T21:03:02-04:00

Commit Message:
DEVTOOLS: Add updateState methods arrays to create_titanic

Changed paths:
  A devtools/create_titanic/script_states.cpp
  A devtools/create_titanic/script_states.h
    devtools/create_titanic/create_titanic_dat.cpp
    devtools/create_titanic/module.mk



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index c202e75..cc0283e 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -39,6 +39,7 @@
 #include "script_quotes.h"
 #include "script_responses.h"
 #include "script_ranges.h"
+#include "script_states.h"
 #include "tag_maps.h"
 
 /**
@@ -53,7 +54,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x800
+#define HEADER_SIZE 0x880
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -589,6 +590,7 @@ void writeData() {
 	writeAllScriptResponses();
 	writeAllScriptRanges();
 	writeAllTagMappings();
+	writeAllUpdateStates();
 }
 
 void createScriptMap() {
diff --git a/devtools/create_titanic/module.mk b/devtools/create_titanic/module.mk
index ef5b2a0..aae7b4b 100644
--- a/devtools/create_titanic/module.mk
+++ b/devtools/create_titanic/module.mk
@@ -4,7 +4,10 @@ MODULE := devtools/create_titanic
 MODULE_OBJS := \
 	create_titanic_dat.o \
 	hashmap.o \
+	script_quotes.o \
+	script_ranges.o \
 	script_responses.o \
+	script_states.o \
 	str.o \
 	winexe.o \
 	winexe_pe.o
diff --git a/devtools/create_titanic/script_states.cpp b/devtools/create_titanic/script_states.cpp
new file mode 100644
index 0000000..8115744
--- /dev/null
+++ b/devtools/create_titanic/script_states.cpp
@@ -0,0 +1,548 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+ // Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+// HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
+#include "file.h"
+#include "script_states.h"
+
+static const UpdateState12 BARBOT_STATES[] = {
+	{ 0x0003AB24, 0x00000005, 0x00 },
+	{ 0x0003AD33, 0x00000005, 0x00 },
+	{ 0x0003AB40, 0x00000008, 0x00 },
+	{ 0x0003AC6A, 0x00000008, 0x00 },
+	{ 0x0003AB3E, 0x00000006, 0x00 },
+	{ 0x0003AB3D, 0x00000006, 0x00 },
+	{ 0x0003AB41, 0x00000007, 0x00 },
+	{ 0x0003AB69, 0x00000008, 0x00 },
+	{ 0x0003AE6D, 0x0000004E, 0x00 },
+	{ 0x0003AC69, 0x0000004E, 0x00 },
+	{ 0x0003AE6E, 0x0000004F, 0x00 },
+	{ 0x0003AE6F, 0x00000051, 0x00 },
+	{ 0x0003AE70, 0x00000051, 0x00 },
+	{ 0x0003AE71, 0x00000051, 0x00 },
+	{ 0x0003AE72, 0x00000051, 0x00 },
+	{ 0x0003AE73, 0x00000051, 0x00 },
+	{ 0x0003AE74, 0x00000051, 0x00 },
+	{ 0x0003AE75, 0x00000051, 0x00 },
+	{ 0x0003AE76, 0x00000051, 0x00 },
+	{ 0x0003AE77, 0x00000051, 0x00 },
+	{ 0x0003AEB8, 0x00000051, 0x00 },
+	{ 0x0003AB20, 0x00000009, 0x00 },
+	{ 0x0003AB14, 0x0000000A, 0x00 },
+	{ 0x0003AB15, 0x0000000B, 0x00 },
+	{ 0x0003AB16, 0x0000000C, 0x00 },
+	{ 0x0003AB63, 0x0000000D, 0x00 },
+	{ 0x0003AB64, 0x0000000D, 0x00 },
+	{ 0x0003AB44, 0x00000001, 0x00 },
+	{ 0x0003AB43, 0x00000001, 0x0B },
+	{ 0x0003AB2A, 0x00000002, 0x00 },
+	{ 0x0003AB4A, 0x00000003, 0x0B },
+	{ 0x0003AB4C, 0x00000003, 0x0B },
+	{ 0x0003AB65, 0x00000004, 0x00 },
+	{ 0x0003AB2F, 0x0000000E, 0x00 },
+	{ 0x0003AB30, 0x0000000F, 0x00 },
+	{ 0x0003AB17, 0x00000010, 0x0B },
+	{ 0x0003AB18, 0x00000010, 0x0B },
+	{ 0x0003AAE3, 0x0000003E, 0x00 },
+	{ 0x0003AAE4, 0x0000003E, 0x00 },
+	{ 0x0003AAE5, 0x0000003E, 0x00 },
+	{ 0x0003AB0F, 0x00000011, 0x00 },
+	{ 0x0003AB11, 0x00000012, 0x00 },
+	{ 0x0003AB12, 0x00000013, 0x00 },
+	{ 0x0003AB13, 0x00000014, 0x00 },
+	{ 0x0003AADC, 0x00000019, 0x00 },
+	{ 0x0003AADD, 0x0000001A, 0x00 },
+	{ 0x0003AADE, 0x0000001B, 0x00 },
+	{ 0x0003AAFD, 0x00000015, 0x00 },
+	{ 0x0003AAFE, 0x00000016, 0x00 },
+	{ 0x0003AAFF, 0x00000017, 0x00 },
+	{ 0x0003AB00, 0x00000018, 0x00 },
+	{ 0x0003AAF4, 0x0000001C, 0x00 },
+	{ 0x0003AAF5, 0x0000001D, 0x00 },
+	{ 0x0003AAF6, 0x0000001E, 0x00 },
+	{ 0x0003AAD9, 0x0000001F, 0x00 },
+	{ 0x0003AADA, 0x00000020, 0x00 },
+	{ 0x0003AADB, 0x00000021, 0x00 },
+	{ 0x0003AAF7, 0x00000022, 0x00 },
+	{ 0x0003AAF8, 0x00000023, 0x00 },
+	{ 0x0003AAF9, 0x00000024, 0x00 },
+	{ 0x0003AB04, 0x0000002C, 0x00 },
+	{ 0x0003AB05, 0x0000002D, 0x00 },
+	{ 0x0003AB06, 0x0000002E, 0x00 },
+	{ 0x0003AADF, 0x00000029, 0x00 },
+	{ 0x0003AAE0, 0x0000002A, 0x00 },
+	{ 0x0003AAE1, 0x0000002B, 0x00 },
+	{ 0x0003AB07, 0x00000038, 0x00 },
+	{ 0x0003AB08, 0x00000039, 0x00 },
+	{ 0x0003AB09, 0x0000003A, 0x00 },
+	{ 0x0003AB01, 0x0000003B, 0x00 },
+	{ 0x0003AB02, 0x0000003C, 0x00 },
+	{ 0x0003AB03, 0x0000003D, 0x00 },
+	{ 0x0003AAF0, 0x00000025, 0x00 },
+	{ 0x0003AAF1, 0x00000026, 0x00 },
+	{ 0x0003AAF2, 0x00000027, 0x00 },
+	{ 0x0003AAF3, 0x00000028, 0x00 },
+	{ 0x0003AB0A, 0x0000002F, 0x00 },
+	{ 0x0003AB0B, 0x00000030, 0x00 },
+	{ 0x0003AB0C, 0x00000031, 0x00 },
+	{ 0x0003AB0D, 0x00000032, 0x00 },
+	{ 0x0003AAEA, 0x00000033, 0x00 },
+	{ 0x0003AAEB, 0x00000034, 0x00 },
+	{ 0x0003AAEC, 0x00000035, 0x00 },
+	{ 0x0003AAED, 0x00000036, 0x00 },
+	{ 0x0003AAEE, 0x00000037, 0x00 },
+	{ 0x0003ACC3, 0x0000003F, 0x00 },
+	{ 0x0003ACC4, 0x00000040, 0x00 },
+	{ 0x0003ACC5, 0x00000041, 0x00 },
+	{ 0x0003ACC6, 0x00000042, 0x00 },
+	{ 0x0003ACC7, 0x00000043, 0x00 },
+	{ 0x0003ACC8, 0x00000044, 0x00 },
+	{ 0x0003ADCF, 0x00000045, 0x00 },
+	{ 0x0003ADD0, 0x00000046, 0x00 },
+	{ 0x0003ADD1, 0x00000047, 0x00 },
+	{ 0x0003ADD2, 0x00000048, 0x00 },
+	{ 0x0003ADD3, 0x00000049, 0x00 },
+	{ 0x0003ACA4, 0x0000004A, 0x00 },
+	{ 0x0003ACA7, 0x0000004B, 0x00 },
+	{ 0x0003ADD5, 0x0000004C, 0x00 },
+	{ 0x0003AC7E, 0x0000004C, 0x00 },
+	{ 0x0003ABF9, 0x0000004C, 0x00 },
+	{ 0x0003AD14, 0x0000004C, 0x00 },
+	{ 0x0003AD15, 0x0000004C, 0x00 },
+	{ 0x0003AD10, 0x0000004C, 0x00 },
+	{ 0x0003AD17, 0x0000004C, 0x00 },
+	{ 0x0003AD21, 0x0000004C, 0x00 },
+	{ 0x0003AD2F, 0x0000004C, 0x00 },
+	{ 0x0003AC7F, 0x0000004D, 0x00 },
+	{ 0x0003AEBA, 0x00000052, 0x0E },
+	{ 0x0003AED5, 0x00000053, 0x00 },
+	{ 0x0003B034, 0x00000054, 0x00 },
+	{ 0x0003B037, 0x00000054, 0x00 },
+	{ 0x0003B036, 0x00000055, 0x00 },
+	{ 0x0003B035, 0x00000055, 0x00 },
+	{ 0x0003B02D, 0x00000055, 0x00 },
+	{ 0x0003B02F, 0x00000055, 0x00 },
+	{ 0x0003B02E, 0x00000056, 0x00 },
+	{ 0x0003B031, 0x00000056, 0x00 },
+	{ 0x0003B033, 0x00000056, 0x00 },
+	{ 0x0003B032, 0x00000057, 0x00 },
+	{ 0x0003B023, 0x00000057, 0x00 },
+	{ 0x0003B025, 0x00000057, 0x00 },
+	{ 0x0003B024, 0x00000058, 0x00 },
+	{ 0x0003B017, 0x00000058, 0x00 },
+	{ 0x0003B01C, 0x00000058, 0x00 },
+	{ 0x0003B01A, 0x00000059, 0x00 },
+	{ 0x0003B01B, 0x0000005A, 0x00 },
+	{ 0x0003B018, 0x0000005B, 0x00 },
+	{ 0x0003B019, 0x0000005D, 0x00 },
+	{ 0x0003B01D, 0x0000005D, 0x00 },
+	{ 0x0003B01E, 0x0000005D, 0x00 },
+	{ 0x0003B01F, 0x0000005D, 0x00 },
+	{ 0x0003B026, 0x0000005D, 0x00 },
+	{ 0x0003B027, 0x0000005D, 0x00 },
+	{ 0x0003B028, 0x0000005D, 0x00 },
+	{ 0x0003B029, 0x0000005D, 0x00 },
+	{ 0x0003B030, 0x0000005D, 0x00 },
+	{ 0x0003B02A, 0x0000005E, 0x00 },
+	{ 0x0003ABF7, 0x0000005F, 0x00 },
+	{ 0x0003AF6A, 0x00000060, 0x00 },
+	{ 0x0003AEC6, 0x00000061, 0x00 },
+	{ 0x00000000, 0x00000000, 0x00 }
+};
+
+static const UpdateState8 BELLBOT_STATES[] = {
+	{ 0x00031070, 0x00000001 }, { 0x0003107B, 0x00000002 }, { 0x0003107E, 0x00000003 },
+	{ 0x0003104F, 0x00000004 }, { 0x00030F23, 0x00000005 }, { 0x00030F2A, 0x00000006 },
+	{ 0x00030F31, 0x00000007 }, { 0x00030F32, 0x00000007 }, { 0x00030F33, 0x00000007 },
+	{ 0x00030F34, 0x00000007 }, { 0x00030F35, 0x00000007 }, { 0x00030F36, 0x00000007 }, 
+	{ 0x00030F37, 0x00000008 }, { 0x00030F2E, 0x00000009 }, { 0x00030E78, 0x0000000A },
+	{ 0x00030E42, 0x0000000C }, { 0x00030E0C, 0x0000000D }, { 0x00030E9C, 0x0000000E },
+	{ 0x00030DC1, 0x0000000F }, { 0x00030DC2, 0x00000010 }, { 0x00030D6B, 0x00000011 },
+	{ 0x00030D6C, 0x00000011 }, { 0x00030E1D, 0x00000012 }, { 0x00030E1E, 0x00000013 },
+	{ 0x00030E3B, 0x00000014 }, { 0x00030EBA, 0x00000015 }, { 0x00031086, 0x00000016 },
+	{ 0x000310A4, 0x00000017 }, { 0x00031058, 0x00000018 }, { 0x00031059, 0x00000019 },
+	{ 0x00030E3F, 0x0000001A }, { 0x00030EBC, 0x0000001B }, { 0x00030E9B, 0x0000001C },
+	{ 0x00030E32, 0x0000001D }, { 0x00030E76, 0x0000001E }, { 0x00031060, 0x0000001F },
+	{ 0x00031065, 0x00000020 }, { 0x00031075, 0x00000021 }, { 0x00031077, 0x00000022 },
+	{ 0x00031041, 0x00000023 }, { 0x00031038, 0x00000024 }, { 0x00030FAB, 0x00000025 },
+	{ 0x00030FAF, 0x00000026 }, { 0x00030FB1, 0x00000027 }, { 0x00030FB8, 0x00000028 },
+	{ 0x00030FB2, 0x00000029 }, { 0x00030FC1, 0x0000002A }, { 0x00030FC2, 0x0000002B },
+	{ 0x00030FA4, 0x0000002C }, { 0x00030FA5, 0x0000002D }, { 0x00030FA7, 0x0000002E },
+	{ 0x00030FA8, 0x0000002C }, { 0x00030FA6, 0x0000002C }, { 0x00030EAD, 0x0000002F },
+	{ 0x00030EAE, 0x00000030 }, { 0x00030ED6, 0x00000031 }, { 0x00030ED7, 0x00000032 },
+	{ 0x00030ED8, 0x00000033 }, { 0x000310A9, 0x00000034 }, { 0x00030F4C, 0x00000035 },
+	{ 0x00030DA7, 0x00000036 }, { 0x00030D9F, 0x00000037 }, { 0x00030FC8, 0x00000038 },
+	{ 0x00030FC9, 0x00000039 }, { 0x00030FCF, 0x0000003A }, { 0x00030FCA, 0x0000003B },
+	{ 0x00030FCB, 0x0000003C }, { 0x00030FCC, 0x0000003D }, { 0x00030E41, 0x0000003E },
+	{ 0x00030E12, 0x0000003F }, { 0x00030D72, 0x00000040 }, { 0x00030D76, 0x00000041 },
+	{ 0x00030D78, 0x00000042 }, { 0x00030D79, 0x00000043 }, { 0x000310AE, 0x00000044 },
+	{ 0x0003112C, 0x00000044 }, { 0x00031132, 0x00000045 }, { 0x00031133, 0x00000046 },
+	{ 0x00031134, 0x00000047 }, { 0x000310D7, 0x00000048 }, { 0x0003113C, 0x00000049 },
+	{ 0x0003113E, 0x0000004A }, { 0x0003113D, 0x0000004A }, { 0x00031146, 0x0000004B },
+	{ 0x00031149, 0x0000004C }, { 0x0003114A, 0x0000004D }, { 0x0003114E, 0x0000004E },
+	{ 0x00031151, 0x0000004E }, { 0x0003114F, 0x0000004E }, { 0x00031152, 0x0000004E },
+	{ 0x0003115B, 0x0000004F }, { 0x00031163, 0x00000050 }, { 0x00031164, 0x00000051 },
+	{ 0x00031165, 0x00000051 }, { 0x00031166, 0x00000051 }, { 0x00031167, 0x00000052 },
+	{ 0x0003117A, 0x00000053 }, { 0x0003149A, 0x00000054 }, { 0x00031454, 0x00000055 },
+	{ 0x0003157B, 0x00000056 }, { 0x00031177, 0x00000057 }, { 0x00031171, 0x00000057 },
+	{ 0x0003117A, 0x00000057 }, { 0x00031507, 0x00000057 }, { 0x0003159D, 0x00000058 },
+	{ 0x000315DD, 0x00000059 }, { 0x00031147, 0x0000005A }, { 0x00031148, 0x0000005A },
+	{ 0x00000000, 0x00000000 }
+};
+
+static const UpdateState12 DESKBOT_STATES[] = {
+	{ 0x0003AB24, 0x00000005, 0x00 },
+	{ 0x0003AD33, 0x00000005, 0x00 },
+	{ 0x0003AB40, 0x00000008, 0x00 },
+	{ 0x0003AC6A, 0x00000008, 0x00 },
+	{ 0x0003AB3E, 0x00000006, 0x00 },
+	{ 0x0003AB3D, 0x00000006, 0x00 },
+	{ 0x0003AB41, 0x00000007, 0x00 },
+	{ 0x0003AB69, 0x00000008, 0x00 },
+	{ 0x0003AE6D, 0x0000004E, 0x00 },
+	{ 0x0003AC69, 0x0000004E, 0x00 },
+	{ 0x0003AE6E, 0x0000004F, 0x00 },
+	{ 0x0003AE6F, 0x00000051, 0x00 },
+	{ 0x0003AE70, 0x00000051, 0x00 },
+	{ 0x0003AE71, 0x00000051, 0x00 },
+	{ 0x0003AE72, 0x00000051, 0x00 },
+	{ 0x0003AE73, 0x00000051, 0x00 },
+	{ 0x0003AE74, 0x00000051, 0x00 },
+	{ 0x0003AE75, 0x00000051, 0x00 },
+	{ 0x0003AE76, 0x00000051, 0x00 },
+	{ 0x0003AE77, 0x00000051, 0x00 },
+	{ 0x0003AEB8, 0x00000051, 0x00 },
+	{ 0x0003AB20, 0x00000009, 0x00 },
+	{ 0x0003AB14, 0x0000000A, 0x00 },
+	{ 0x0003AB15, 0x0000000B, 0x00 },
+	{ 0x0003AB16, 0x0000000C, 0x00 },
+	{ 0x0003AB63, 0x0000000D, 0x00 },
+	{ 0x0003AB64, 0x0000000D, 0x00 },
+	{ 0x0003AB44, 0x00000001, 0x00 },
+	{ 0x0003AB43, 0x00000001, 0x0B },
+	{ 0x0003AB2A, 0x00000002, 0x00 },
+	{ 0x0003AB4A, 0x00000003, 0x0B },
+	{ 0x0003AB4C, 0x00000003, 0x0B },
+	{ 0x0003AB65, 0x00000004, 0x00 },
+	{ 0x0003AB2F, 0x0000000E, 0x00 },
+	{ 0x0003AB30, 0x0000000F, 0x00 },
+	{ 0x0003AB17, 0x00000010, 0x0B },
+	{ 0x0003AB18, 0x00000010, 0x0B },
+	{ 0x0003AAE3, 0x0000003E, 0x00 },
+	{ 0x0003AAE4, 0x0000003E, 0x00 },
+	{ 0x0003AAE5, 0x0000003E, 0x00 },
+	{ 0x0003AB0F, 0x00000011, 0x00 },
+	{ 0x0003AB11, 0x00000012, 0x00 },
+	{ 0x0003AB12, 0x00000013, 0x00 },
+	{ 0x0003AB13, 0x00000014, 0x00 },
+	{ 0x0003AADC, 0x00000019, 0x00 },
+	{ 0x0003AADD, 0x0000001A, 0x00 },
+	{ 0x0003AADE, 0x0000001B, 0x00 },
+	{ 0x0003AAFD, 0x00000015, 0x00 },
+	{ 0x0003AAFE, 0x00000016, 0x00 },
+	{ 0x0003AAFF, 0x00000017, 0x00 },
+	{ 0x0003AB00, 0x00000018, 0x00 },
+	{ 0x0003AAF4, 0x0000001C, 0x00 },
+	{ 0x0003AAF5, 0x0000001D, 0x00 },
+	{ 0x0003AAF6, 0x0000001E, 0x00 },
+	{ 0x0003AAD9, 0x0000001F, 0x00 },
+	{ 0x0003AADA, 0x00000020, 0x00 },
+	{ 0x0003AADB, 0x00000021, 0x00 },
+	{ 0x0003AAF7, 0x00000022, 0x00 },
+	{ 0x0003AAF8, 0x00000023, 0x00 },
+	{ 0x0003AAF9, 0x00000024, 0x00 },
+	{ 0x0003AB04, 0x0000002C, 0x00 },
+	{ 0x0003AB05, 0x0000002D, 0x00 },
+	{ 0x0003AB06, 0x0000002E, 0x00 },
+	{ 0x0003AADF, 0x00000029, 0x00 },
+	{ 0x0003AAE0, 0x0000002A, 0x00 },
+	{ 0x0003AAE1, 0x0000002B, 0x00 },
+	{ 0x0003AB07, 0x00000038, 0x00 },
+	{ 0x0003AB08, 0x00000039, 0x00 },
+	{ 0x0003AB09, 0x0000003A, 0x00 },
+	{ 0x0003AB01, 0x0000003B, 0x00 },
+	{ 0x0003AB02, 0x0000003C, 0x00 },
+	{ 0x0003AB03, 0x0000003D, 0x00 },
+	{ 0x0003AAF0, 0x00000025, 0x00 },
+	{ 0x0003AAF1, 0x00000026, 0x00 },
+	{ 0x0003AAF2, 0x00000027, 0x00 },
+	{ 0x0003AAF3, 0x00000028, 0x00 },
+	{ 0x0003AB0A, 0x0000002F, 0x00 },
+	{ 0x0003AB0B, 0x00000030, 0x00 },
+	{ 0x0003AB0C, 0x00000031, 0x00 },
+	{ 0x0003AB0D, 0x00000032, 0x00 },
+	{ 0x0003AAEA, 0x00000033, 0x00 },
+	{ 0x0003AAEB, 0x00000034, 0x00 },
+	{ 0x0003AAEC, 0x00000035, 0x00 },
+	{ 0x0003AAED, 0x00000036, 0x00 },
+	{ 0x0003AAEE, 0x00000037, 0x00 },
+	{ 0x0003ACC3, 0x0000003F, 0x00 },
+	{ 0x0003ACC4, 0x00000040, 0x00 },
+	{ 0x0003ACC5, 0x00000041, 0x00 },
+	{ 0x0003ACC6, 0x00000042, 0x00 },
+	{ 0x0003ACC7, 0x00000043, 0x00 },
+	{ 0x0003ACC8, 0x00000044, 0x00 },
+	{ 0x0003ADCF, 0x00000045, 0x00 },
+	{ 0x0003ADD0, 0x00000046, 0x00 },
+	{ 0x0003ADD1, 0x00000047, 0x00 },
+	{ 0x0003ADD2, 0x00000048, 0x00 },
+	{ 0x0003ADD3, 0x00000049, 0x00 },
+	{ 0x0003ACA4, 0x0000004A, 0x00 },
+	{ 0x0003ACA7, 0x0000004B, 0x00 },
+	{ 0x0003ADD5, 0x0000004C, 0x00 },
+	{ 0x0003AC7E, 0x0000004C, 0x00 },
+	{ 0x0003ABF9, 0x0000004C, 0x00 },
+	{ 0x0003AD14, 0x0000004C, 0x00 },
+	{ 0x0003AD15, 0x0000004C, 0x00 },
+	{ 0x0003AD10, 0x0000004C, 0x00 },
+	{ 0x0003AD17, 0x0000004C, 0x00 },
+	{ 0x0003AD21, 0x0000004C, 0x00 },
+	{ 0x0003AD2F, 0x0000004C, 0x00 },
+	{ 0x0003AC7F, 0x0000004D, 0x00 },
+	{ 0x0003AEBA, 0x00000052, 0x0E },
+	{ 0x0003AED5, 0x00000053, 0x00 },
+	{ 0x0003B034, 0x00000054, 0x00 },
+	{ 0x0003B037, 0x00000054, 0x00 },
+	{ 0x0003B036, 0x00000055, 0x00 },
+	{ 0x0003B035, 0x00000055, 0x00 },
+	{ 0x0003B02D, 0x00000055, 0x00 },
+	{ 0x0003B02F, 0x00000055, 0x00 },
+	{ 0x0003B02E, 0x00000056, 0x00 },
+	{ 0x0003B031, 0x00000056, 0x00 },
+	{ 0x0003B033, 0x00000056, 0x00 },
+	{ 0x0003B032, 0x00000057, 0x00 },
+	{ 0x0003B023, 0x00000057, 0x00 },
+	{ 0x0003B025, 0x00000057, 0x00 },
+	{ 0x0003B024, 0x00000058, 0x00 },
+	{ 0x0003B017, 0x00000058, 0x00 },
+	{ 0x0003B01C, 0x00000058, 0x00 },
+	{ 0x0003B01A, 0x00000059, 0x00 },
+	{ 0x0003B01B, 0x0000005A, 0x00 },
+	{ 0x0003B018, 0x0000005B, 0x00 },
+	{ 0x0003B019, 0x0000005D, 0x00 },
+	{ 0x0003B01D, 0x0000005D, 0x00 },
+	{ 0x0003B01E, 0x0000005D, 0x00 },
+	{ 0x0003B01F, 0x0000005D, 0x00 },
+	{ 0x0003B026, 0x0000005D, 0x00 },
+	{ 0x0003B027, 0x0000005D, 0x00 },
+	{ 0x0003B028, 0x0000005D, 0x00 },
+	{ 0x0003B029, 0x0000005D, 0x00 },
+	{ 0x0003B030, 0x0000005D, 0x00 },
+	{ 0x0003B02A, 0x0000005E, 0x00 },
+	{ 0x0003ABF7, 0x0000005F, 0x00 },
+	{ 0x0003AF6A, 0x00000060, 0x00 },
+	{ 0x0003AEC6, 0x00000061, 0x00 },
+	{ 0x00000000, 0x00000000, 0x00 }
+};
+
+static const UpdateState12 DOORBOT_STATES[] = {
+	{ 0x00035BD0, 0x00000004, 0x06 },
+	{ 0x00035BE7, 0x00000005, 0x00 },
+	{ 0x00035BED, 0x00000006, 0x0A },
+	{ 0x00035E41, 0x0000000C, 0x0A },
+	{ 0x00035F9D, 0x0000000F, 0x00 },
+	{ 0x00035F81, 0x00000010, 0x00 },
+	{ 0x00035F82, 0x00000010, 0x00 },
+	{ 0x00035F83, 0x00000010, 0x00 },
+	{ 0x00035F84, 0x00000010, 0x00 },
+	{ 0x00035F85, 0x00000010, 0x00 },
+	{ 0x00035FC5, 0x00000011, 0x00 },
+	{ 0x00035B6C, 0x00000021, 0x02 },
+	{ 0x00035B6D, 0x00000022, 0x02 },
+	{ 0x00035FCD, 0x00000012, 0x00 },
+	{ 0x00035EF0, 0x00000020, 0x00 },
+	{ 0x00035EF1, 0x00000020, 0x00 },
+	{ 0x00035F0A, 0x00000020, 0x00 },
+	{ 0x000362B0, 0x00000013, 0x00 },
+	{ 0x000362B1, 0x00000013, 0x00 },
+	{ 0x000362B2, 0x00000013, 0x00 },
+	{ 0x000362B3, 0x00000013, 0x00 },
+	{ 0x000362B4, 0x00000013, 0x00 },
+	{ 0x000362B5, 0x00000013, 0x00 },
+	{ 0x000362B9, 0x00000013, 0x00 },
+	{ 0x000362BB, 0x00000013, 0x00 },
+	{ 0x000362BA, 0x00000013, 0x00 },
+	{ 0x000362BC, 0x00000013, 0x00 },
+	{ 0x000362B8, 0x00000013, 0x00 },
+	{ 0x000362BD, 0x00000013, 0x00 },
+	{ 0x000362BE, 0x00000013, 0x00 },
+	{ 0x000362BF, 0x00000013, 0x00 },
+	{ 0x000362C0, 0x00000013, 0x00 },
+	{ 0x000362C1, 0x00000013, 0x00 },
+	{ 0x000362C2, 0x00000013, 0x00 },
+	{ 0x000362B6, 0x00000014, 0x00 },
+	{ 0x00035F8A, 0x00000015, 0x00 },
+	{ 0x00036407, 0x00000016, 0x00 },
+	{ 0x0003640C, 0x00000016, 0x00 },
+	{ 0x0003641A, 0x00000016, 0x00 },
+	{ 0x00036420, 0x00000016, 0x00 },
+	{ 0x00036421, 0x00000016, 0x00 },
+	{ 0x00036422, 0x00000016, 0x00 },
+	{ 0x00036408, 0x00000016, 0x00 },
+	{ 0x0003640A, 0x00000016, 0x00 },
+	{ 0x0003640B, 0x00000016, 0x00 },
+	{ 0x0003640D, 0x00000018, 0x00 },
+	{ 0x00036415, 0x00000016, 0x00 },
+	{ 0x00036416, 0x00000016, 0x00 },
+	{ 0x00036417, 0x00000016, 0x00 },
+	{ 0x00036418, 0x00000016, 0x00 },
+	{ 0x00036419, 0x00000016, 0x00 },
+	{ 0x0003640E, 0x00000016, 0x00 },
+	{ 0x0003640F, 0x00000016, 0x00 },
+	{ 0x00036410, 0x00000016, 0x00 },
+	{ 0x00036411, 0x00000019, 0x00 },
+	{ 0x00036412, 0x0000001A, 0x00 },
+	{ 0x0003641B, 0x00000016, 0x00 },
+	{ 0x0003641C, 0x00000016, 0x00 },
+	{ 0x0003641D, 0x00000016, 0x00 },
+	{ 0x0003641F, 0x00000016, 0x00 },
+	{ 0x00035FF6, 0x0000001B, 0x00 },
+	{ 0x00035FF7, 0x0000001C, 0x00 },
+	{ 0x00035FF8, 0x0000001D, 0x00 },
+	{ 0x00035FF9, 0x0000001E, 0x00 },
+	{ 0x0003627F, 0x00000023, 0x00 },
+	{ 0x00036280, 0x00000024, 0x00 },
+	{ 0x00036281, 0x00000025, 0x00 },
+	{ 0x00036282, 0x00000025, 0x00 },
+	{ 0x00036457, 0x00000026, 0x00 },
+	{ 0x00000000, 0x00000000, 0x00 }
+};
+
+static const UpdateState8 LIFTBOT_STATES[] = {
+	{ 0x000335D6, 0x00000004 },
+	{ 0x000337A7, 0x00000005 },
+	{ 0x00033781, 0x00000006 },
+	{ 0x0003381A, 0x00000009 },
+	{ 0x0003381B, 0x00000009 },
+	{ 0x0003381E, 0x00000009 },
+	{ 0x0003381F, 0x00000009 },
+	{ 0x00033820, 0x00000009 },
+	{ 0x00033821, 0x00000009 },
+	{ 0x00033822, 0x00000009 },
+	{ 0x00033823, 0x00000009 },
+	{ 0x00033824, 0x00000009 },
+	{ 0x00033825, 0x00000009 },
+	{ 0x0003381C, 0x00000009 },
+	{ 0x0003381D, 0x00000009 },
+	{ 0x00000000, 0x00000000 }
+};
+
+static const UpdateState8 MAITRED_STATES[] = {
+	{ 0x0003F7D4, 0x00000002 },
+	{ 0x0003F808, 0x00000003 },
+	{ 0x0003F809, 0x00000009 },
+	{ 0x0003F7F9, 0x00000009 },
+	{ 0x0003F7D2, 0x00000009 },
+	{ 0x0003F7F6, 0x00000004 },
+	{ 0x0003F7D3, 0x00000005 },
+	{ 0x0003F800, 0x00000006 },
+	{ 0x0003F801, 0x00000007 },
+	{ 0x0003F7FC, 0x00000008 },
+	{ 0x0003F7FD, 0x00000008 },
+	{ 0x0003F7F8, 0x00000008 },
+	{ 0x0003F7FA, 0x00000008 },
+	{ 0x0003F7F1, 0x0000000A },
+	{ 0x0003F7F2, 0x0000000A },
+	{ 0x0003F7F3, 0x0000000A },
+	{ 0x0003F7F4, 0x0000000A },
+	{ 0x0003F7F5, 0x0000000A },
+	{ 0x0003F877, 0x0000000B },
+	{ 0x0003FA55, 0x0000000C },
+	{ 0x0003F863, 0x0000000C },
+	{ 0x0003F864, 0x0000000C },
+	{ 0x0003F865, 0x0000000C },
+	{ 0x0003F866, 0x0000000D },
+	{ 0x0003F867, 0x0000000E },
+	{ 0x0003F86E, 0x0000000E },
+	{ 0x0003F868, 0x0000000F },
+	{ 0x0003F869, 0x0000000C },
+	{ 0x0003F870, 0x00000010 },
+	{ 0x0003F87C, 0x00000011 },
+	{ 0x0003F87D, 0x00000011 },
+	{ 0x0003F886, 0x00000012 },
+	{ 0x0003F889, 0x00000013 },
+	{ 0x0003F88A, 0x00000014 },
+	{ 0x0003F88B, 0x00000015 },
+	{ 0x0003F88C, 0x00000015 },
+	{ 0x0003F88D, 0x00000016 },
+	{ 0x0003F88E, 0x00000016 },
+	{ 0x0003F895, 0x00000016 },
+	{ 0x0003F893, 0x00000017 },
+	{ 0x0003F89A, 0x00000018 },
+	{ 0x0003F875, 0x00000019 },
+	{ 0x0003F89C, 0x00000019 },
+	{ 0x0003F8A3, 0x00000019 },
+	{ 0x0003F8A2, 0x00000019 },
+	{ 0x0003F89D, 0x0000001A },
+	{ 0x0003F89E, 0x0000001A },
+	{ 0x0003F89F, 0x0000001A },
+	{ 0x0003F8A5, 0x0000001B },
+	{ 0x0003F921, 0x0000001C },
+	{ 0x0003F922, 0x0000001C },
+	{ 0x0003FA56, 0x0000001E },
+	{ 0x00000000, 0x00000000 }
+};
+
+void writeUpdateStates(const char *name, const UpdateState8 *states) {
+	outputFile.seek(dataOffset);
+
+	for (; states->_src; ++states) {
+		outputFile.writeLong(states->_src);
+		outputFile.writeLong(states->_dest);
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader(name, dataOffset, size);
+	dataOffset += size;
+}
+
+void writeUpdateStates(const char *name, const UpdateState12 *states) {
+	outputFile.seek(dataOffset);
+
+	for (; states->_newId; ++states) {
+		outputFile.writeLong(states->_newId);
+		outputFile.writeLong(states->_newValue);
+		outputFile.writeLong(states->_idMatch);
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader(name, dataOffset, size);
+	dataOffset += size;
+}
+
+void writeAllUpdateStates() {
+	writeUpdateStates("States/Barbot", BARBOT_STATES);
+	writeUpdateStates("States/Bellbot", BELLBOT_STATES);
+	writeUpdateStates("States/Deskbot", DESKBOT_STATES);
+	writeUpdateStates("States/Doorbot", DOORBOT_STATES);
+	writeUpdateStates("States/Liftbot", LIFTBOT_STATES);
+	writeUpdateStates("States/MaitreD", MAITRED_STATES);
+
+}
\ No newline at end of file
diff --git a/devtools/create_titanic/script_states.h b/devtools/create_titanic/script_states.h
new file mode 100644
index 0000000..27dfe22
--- /dev/null
+++ b/devtools/create_titanic/script_states.h
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef COMMON_SCRIPT_STATES_H
+#define COMMON_SCRIPT_STATES_H
+
+#include "common/scummsys.h"
+
+struct UpdateState12 {
+	uint _newId;
+	uint _newValue;
+	uint _idMatch;
+};
+
+struct UpdateState8 {
+	uint _src;
+	uint _dest;
+};
+
+extern void writeAllUpdateStates();
+extern void writeEntryHeader(const char *name, uint offset, uint size);
+extern uint dataOffset;
+
+#endif


Commit: 52b6c92ac0ac843ef1c7e54ee187fb0a16f381eb
    https://github.com/scummvm/scummvm/commit/52b6c92ac0ac843ef1c7e54ee187fb0a16f381eb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-28T21:17:01-04:00

Commit Message:
TITANIC: Add loading of updateState arrays

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/script_support.cpp
    engines/titanic/true_talk/script_support.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 1119722..345e9a3 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -51,6 +51,7 @@ BarbotScript::BarbotScript(int val1, const char *charClass, int v2,
 	setupSentences();
 	_tagMappings.load("TagMap/Barbot");
 	_quotes.load("Quotes/Barbot");
+	_states.load("States/Barbot");
 }
 
 void BarbotScript::setupSentences() {
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index dff72d5..ba6c5e9 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -32,6 +32,7 @@ private:
 	int _state;
 	int _arrIndex;
 	TTsentenceEntries _entries2;
+	TTupdateState3Array _states;
 private:
 	/**
 	 * Adjust a given dial number by a given delta amount
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 7748a9d..3eb840f 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -427,9 +427,9 @@ int BellbotScript::getStateDialogueId() const {
 void BellbotScript::setValue23(uint id) {
 	uint val = 0;
 	for (uint idx = 0; idx < _states.size() && !val; ++idx) {
-		TTmapEntry &me = _states[idx];
-		if (me._src == id)
-			val = me._dest;
+		TTupdateState2 &us = _states[idx];
+		if (us._src == id)
+			val = us._dest;
 	}
 
 	CTrueTalkManager::setFlags(23, val);
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 98dd2c9..ef11985 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -30,7 +30,7 @@ namespace Titanic {
 class BellbotScript : public TTnpcScript {
 private:
 	static int _oldId;
-	TTmapEntries _states;
+	TTupdateState2Array _states;
 	int _array[150];
 	int _field2D0;
 	int _field2D4;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index facc5fd..a10aef2 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -48,6 +48,7 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 	_tagMappings.load("TagMap/Deskbot");
 	_words.load("Words/Deskbot");
 	_quotes.load("Quotes/Deskbot");
+	_states.load("States/Deskbot");
 }
 
 void DeskbotScript::setupSentences() {
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index c1313a0..628a743 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -31,6 +31,7 @@ namespace Titanic {
 class DeskbotScript : public TTnpcScript {
 private:
 	static int _oldId;
+	TTupdateState3Array _states;
 private:
 	/**
 	 * Setup sentence data
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 4f74b19..700ad3a 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -60,6 +60,7 @@ DoorbotScript::DoorbotScript(int val1, const char *charClass, int v2,
 	_tagMappings.load("TagMap/Doorbot");
 	_words.load("Words/Doorbot");
 	_quotes.load("Quotes/Doorbot");
+	_states.load("States/Doorbot");
 }
 
 void DoorbotScript::setupSentences() {
@@ -77,14 +78,14 @@ void DoorbotScript::setupSentences() {
 int DoorbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
 	if (tag == MKTAG('D', 'N', 'A', '1') || tag == MKTAG('H', 'H', 'G', 'Q') ||
 		tag == MKTAG('A', 'N', 'S', 'W') || tag == MKTAG('S', 'U', 'M', 'S')) {
-		if (_state > 9)
-			_state = 0;
-		addResponse(STATE_ARRAY[_state]);
+		if (_stateIndex > 9)
+			_stateIndex = 0;
+		addResponse(STATE_ARRAY[_stateIndex]);
 		applyResponse();
 
-		if (STATE_ARRAY[_state] == 11826)
+		if (STATE_ARRAY[_stateIndex] == 11826)
 			setState(1);
-		++_state;
+		++_stateIndex;
 		return 2;
 	}
 
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index db81882..fa7d390 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -29,7 +29,8 @@ namespace Titanic {
 
 class DoorbotScript : public TTnpcScript {
 private:
-	int _state;
+	TTupdateState3Array _states;
+	int _stateIndex;
 private:
 	/**
 	 * Setup sentence data
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 6e7d16a..04a5c15 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -26,6 +26,8 @@
 
 namespace Titanic {
 
+int LiftbotScript::_stateIndex;
+
 static const int STATE_ARRAY[7] = {
 	0x78BE, 0x78C0, 0x78C1, 0x78C2, 0x78C3, 0x78C4, 0x78C5
 };
@@ -33,7 +35,7 @@ static const int STATE_ARRAY[7] = {
 LiftbotScript::LiftbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {
-	_state = 0;
+	_stateIndex = 0;
 
 	loadRanges("Ranges/Liftbot");
 	loadResponses("Responses/Liftbot");
@@ -41,6 +43,7 @@ LiftbotScript::LiftbotScript(int val1, const char *charClass, int v2,
 	_tagMappings.load("TagMap/Liftbot");
 	_words.load("Words/Liftbot");
 	_quotes.load("Quotes/Liftbot");
+	_states.load("States/Liftbot");
 }
 
 void LiftbotScript::setupSentences() {
@@ -58,12 +61,12 @@ int LiftbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence
 	case MKTAG('D', 'N', 'A', '1'):
 	case MKTAG('H', 'H', 'G', 'Q'):
 	case MKTAG('A', 'N', 'S', 'W'):
-		if (_state >= 7) {
+		if (_stateIndex >= 7) {
 			selectResponse(30918);
 			setState(2);
-			_state = 0;
+			_stateIndex = 0;
 		} else {
-			addResponse(STATE_ARRAY[_state++]);
+			addResponse(STATE_ARRAY[_stateIndex++]);
 		}
 
 		applyResponse();
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 3aa620d..ec71e41 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -29,7 +29,8 @@ namespace Titanic {
 
 class LiftbotScript : public TTnpcScript {
 private:
-	int _state;
+	TTupdateState2Array _states;
+	static int _stateIndex;
 private:
 	/**
 	 * Setup sentence data
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index d1d6424..089aff0 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -43,6 +43,7 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
 	setupSentences();
 	_tagMappings.load("TagMap/MaitreD");
 	_quotes.load("Quotes/MaitreD");
+	_states.load("States/MaitreD");
 }
 
 void MaitreDScript::setupSentences() {
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 5937b7d..a310b0a 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -29,6 +29,8 @@ namespace Titanic {
 
 class MaitreDScript : public TTnpcScript {
 private:
+	TTupdateState2Array _states;
+private:
 	/**
 	 * Setup sentence data
 	 */
diff --git a/engines/titanic/true_talk/script_support.cpp b/engines/titanic/true_talk/script_support.cpp
index 1a3d66a..3577712 100644
--- a/engines/titanic/true_talk/script_support.cpp
+++ b/engines/titanic/true_talk/script_support.cpp
@@ -164,16 +164,15 @@ void TThandleQuoteEntries::load(const char *name) {
 
 /*------------------------------------------------------------------------*/
 
-void TTupdateStateEntries::load(const char *name) {
+void TTupdateState2Array::load(const char *name) {
 	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
 
 	while (r->pos() < r->size()) {
-		TTupdateStateEntry ue;
-		ue._newId = r->readUint32LE();
-		ue._newValue = r->readUint32LE();
-		ue._idMatch = r->readUint32LE();
+		TTupdateState2 us;
+		us._src = r->readUint32LE();
+		us._dest = r->readUint32LE();
 
-		push_back(ue);
+		push_back(us);
 	}
 
 	delete r;
@@ -181,15 +180,16 @@ void TTupdateStateEntries::load(const char *name) {
 
 /*------------------------------------------------------------------------*/
 
-void TTmapEntries::load(const char *name) {
+void TTupdateState3Array::load(const char *name) {
 	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
 
 	while (r->pos() < r->size()) {
-		TTmapEntry me;
-		me._src = r->readUint32LE();
-		me._dest = r->readUint32LE();
+		TTupdateState3 ue;
+		ue._newId = r->readUint32LE();
+		ue._newValue = r->readUint32LE();
+		ue._idMatch = r->readUint32LE();
 
-		push_back(me);
+		push_back(ue);
 	}
 
 	delete r;
diff --git a/engines/titanic/true_talk/script_support.h b/engines/titanic/true_talk/script_support.h
index ef71ff0..595105f 100644
--- a/engines/titanic/true_talk/script_support.h
+++ b/engines/titanic/true_talk/script_support.h
@@ -142,25 +142,27 @@ public:
 	void load(const char *name);
 };
 
-struct TTupdateStateEntry {
-	uint _newId;
-	uint _newValue;
-	uint _idMatch;
+struct TTupdateState2 {
+	uint _src;
+	uint _dest;
+
+	TTupdateState2() : _src(0), _dest(0) {}
 };
 
-class TTupdateStateEntries : public Common::Array<TTupdateStateEntry> {
+class TTupdateState2Array : public Common::Array<TTupdateState2> {
 public:
 	void load(const char *name);
 };
 
-struct TTmapEntry {
-	uint _src;
-	uint _dest;
+struct TTupdateState3 {
+	uint _newId;
+	uint _newValue;
+	uint _idMatch;
 
-	TTmapEntry() : _src(0), _dest(0) {}
+	TTupdateState3() : _newId(0), _newValue(0), _idMatch(0) {}
 };
 
-class TTmapEntries : public Common::Array<TTmapEntry> {
+class TTupdateState3Array : public Common::Array<TTupdateState3> {
 public:
 	void load(const char *name);
 };


Commit: c7bd63d8818bb064be19957c32a1ee4abe7c9515
    https://github.com/scummvm/scummvm/commit/c7bd63d8818bb064be19957c32a1ee4abe7c9515
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-28T22:05:16-04:00

Commit Message:
TITANIC: Added BarbotScript updateState

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/script_support.cpp
    engines/titanic/true_talk/script_support.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 345e9a3..f77b0b1 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -965,9 +965,36 @@ int BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
-int BarbotScript::updateState(int oldId, int newId, int index) {
-	warning("TODO");
-	return 0;
+int BarbotScript::updateState(uint oldId, uint newId, int index) {
+	if (newId == 250538) {
+		CTrueTalkManager::triggerAction(28, 0);
+		return 250538;
+	}
+	if (newId == 251704) {
+		return 251701 + _field7C ? 3 : 0;
+	}
+
+	for (const TTupdateState3 *us = &_states[0]; us->_newId; ++us) {
+		if (us->_newId == newId) {
+			if ((us->_dialBits & 1) && !getDialRegion(0))
+				continue;
+			if ((us->_dialBits & 2) && getDialRegion(0))
+				continue;
+			if ((us->_dialBits & 4) && !getDialRegion(1))
+				continue;
+			if ((us->_dialBits & 8) && getDialRegion(1))
+				continue;
+			if ((us->_dialBits & 0x10) && !getDialRegion(2))
+				continue;
+			if ((us->_dialBits & 0x20) && getDialRegion(2))
+				continue;
+
+			setState(us->_newValue);
+			break;
+		}
+	}
+
+	return newId;
 }
 
 int BarbotScript::proc22(int id) const {
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index ba6c5e9..c8b2962 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -77,7 +77,7 @@ public:
 	/**
 	 * Handles updating NPC state based on specified dialogue Ids and dial positions
 	 */
-	virtual int updateState(int oldId, int newId, int index);
+	virtual int updateState(uint oldId, uint newId, int index);
 
 	virtual int proc22(int id) const;
 
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 3eb840f..1a9a607 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -29,7 +29,7 @@
 
 namespace Titanic {
 
-int BellbotScript::_oldId;
+uint BellbotScript::_oldId;
 
 BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2) :
@@ -187,7 +187,7 @@ int BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
-int BellbotScript::updateState(int oldId, int newId, int index) {
+int BellbotScript::updateState(uint oldId, uint newId, int index) {
 	if (!getValue(25)) {
 		newId = 202043 - getValue(1) <= 2 ? 994 : 0;
 		CTrueTalkManager::setFlags(25, 1);
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index ef11985..798eecb 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class BellbotScript : public TTnpcScript {
 private:
-	static int _oldId;
+	static uint _oldId;
 	TTupdateState2Array _states;
 	int _array[150];
 	int _field2D0;
@@ -78,7 +78,7 @@ public:
 	/**
 	 * Handles updating NPC state based on specified dialogue Ids and dial positions
 	 */
-	virtual int updateState(int oldId, int newId, int index);
+	virtual int updateState(uint oldId, uint newId, int index);
 
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index a10aef2..219ac74 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -183,7 +183,7 @@ int DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 
 }
 
-int DeskbotScript::updateState(int oldId, int newId, int index) {
+int DeskbotScript::updateState(uint oldId, uint newId, int index) {
 	if (isDial1Medium() || getValue(1) < 4)
 		CTrueTalkManager::setFlags(22, 1);
 
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 628a743..be12b52 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -82,7 +82,7 @@ public:
 	/**
 	 * Handles updating NPC state based on specified dialogue Ids and dial positions
 	 */
-	virtual int updateState(int oldId, int newId, int index);
+	virtual int updateState(uint oldId, uint newId, int index);
 
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 700ad3a..f644142 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -251,7 +251,7 @@ int DoorbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
-int DoorbotScript::updateState(int oldId, int newId, int index) {
+int DoorbotScript::updateState(uint oldId, uint newId, int index) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index fa7d390..15463d5 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -76,7 +76,7 @@ public:
 	/**
 	 * Handles updating NPC state based on specified dialogue Ids and dial positions
 	 */
-	virtual int updateState(int oldId, int newId, int index);
+	virtual int updateState(uint oldId, uint newId, int index);
 
 	virtual int proc22(int id) const;
 
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 04a5c15..2308ea1 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -211,7 +211,7 @@ int LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
-int LiftbotScript::updateState(int oldId, int newId, int index) {
+int LiftbotScript::updateState(uint oldId, uint newId, int index) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index ec71e41..ee8dbc1 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -73,7 +73,7 @@ public:
 	/**
 	 * Handles updating NPC state based on specified dialogue Ids and dial positions
 	 */
-	virtual int updateState(int oldId, int newId, int index);
+	virtual int updateState(uint oldId, uint newId, int index);
 
 	virtual int proc22(int id) const;
 
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 089aff0..abf0bc9 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -185,7 +185,7 @@ int MaitreDScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 	return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
 }
 
-int MaitreDScript::updateState(int oldId, int newId, int index) {
+int MaitreDScript::updateState(uint oldId, uint newId, int index) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index a310b0a..ad43438 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -60,7 +60,7 @@ public:
 	/**
 	 * Handles updating NPC state based on specified dialogue Ids and dial positions
 	 */
-	virtual int updateState(int oldId, int newId, int index);
+	virtual int updateState(uint oldId, uint newId, int index);
 
 	virtual int proc22(int id) const;
 	virtual int proc23() const;
diff --git a/engines/titanic/true_talk/script_support.cpp b/engines/titanic/true_talk/script_support.cpp
index 3577712..af5ef05 100644
--- a/engines/titanic/true_talk/script_support.cpp
+++ b/engines/titanic/true_talk/script_support.cpp
@@ -187,7 +187,7 @@ void TTupdateState3Array::load(const char *name) {
 		TTupdateState3 ue;
 		ue._newId = r->readUint32LE();
 		ue._newValue = r->readUint32LE();
-		ue._idMatch = r->readUint32LE();
+		ue._dialBits = r->readUint32LE();
 
 		push_back(ue);
 	}
diff --git a/engines/titanic/true_talk/script_support.h b/engines/titanic/true_talk/script_support.h
index 595105f..6a60563 100644
--- a/engines/titanic/true_talk/script_support.h
+++ b/engines/titanic/true_talk/script_support.h
@@ -157,9 +157,9 @@ public:
 struct TTupdateState3 {
 	uint _newId;
 	uint _newValue;
-	uint _idMatch;
+	uint _dialBits;
 
-	TTupdateState3() : _newId(0), _newValue(0), _idMatch(0) {}
+	TTupdateState3() : _newId(0), _newValue(0), _dialBits(0) {}
 };
 
 class TTupdateState3Array : public Common::Array<TTupdateState3> {
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index b1e4351..a6e1f7f 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -84,7 +84,7 @@ ScriptChangedResult SuccUBusScript::scriptChanged(TTscriptBase *roomScript, uint
 	return SCR_1;
 }
 
-int SuccUBusScript::updateState(int oldId, int newId, int index) {
+int SuccUBusScript::updateState(uint oldId, uint newId, int index) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index ba8bc61..560272b 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -57,7 +57,7 @@ public:
 	/**
 	 * Handles updating NPC state based on specified dialogue Ids and dial positions
 	 */
-	virtual int updateState(int oldId, int newId, int index);
+	virtual int updateState(uint oldId, uint newId, int index);
 
 	virtual int proc23() const;
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index f211111..18ade0c 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -372,7 +372,7 @@ void TTnpcScript::resetRange(int id) {
 		range->_priorIndex = 0;
 }
 
-int TTnpcScript::updateState(int oldId, int newId, int index) {
+int TTnpcScript::updateState(uint oldId, uint newId, int index) {
 	return newId;
 }
 
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 833262d..eb53dc9 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -259,7 +259,7 @@ public:
 	/**
 	 * Handles updating NPC state based on specified dialogue Ids and dial positions
 	 */
-	virtual int updateState(int oldId, int newId, int index);
+	virtual int updateState(uint oldId, uint newId, int index);
 
 	virtual int proc22(int id) const;
 


Commit: c08ad39a9442d6f15bacb33b34597338121fa5b4
    https://github.com/scummvm/scummvm/commit/c08ad39a9442d6f15bacb33b34597338121fa5b4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-28T22:36:29-04:00

Commit Message:
TITANIC: Added DeskbotScript setFlags17

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/deskbot_script.cpp



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index f77b0b1..1c652faf 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -974,22 +974,23 @@ int BarbotScript::updateState(uint oldId, uint newId, int index) {
 		return 251701 + _field7C ? 3 : 0;
 	}
 
-	for (const TTupdateState3 *us = &_states[0]; us->_newId; ++us) {
-		if (us->_newId == newId) {
-			if ((us->_dialBits & 1) && !getDialRegion(0))
+	for (uint idx = 0; idx < _states.size(); ++idx) {
+		const TTupdateState3 &us = _states[idx];
+		if (us._newId == newId) {
+			if ((us._dialBits & 1) && !getDialRegion(0))
 				continue;
-			if ((us->_dialBits & 2) && getDialRegion(0))
+			if ((us._dialBits & 2) && getDialRegion(0))
 				continue;
-			if ((us->_dialBits & 4) && !getDialRegion(1))
+			if ((us._dialBits & 4) && !getDialRegion(1))
 				continue;
-			if ((us->_dialBits & 8) && getDialRegion(1))
+			if ((us._dialBits & 8) && getDialRegion(1))
 				continue;
-			if ((us->_dialBits & 0x10) && !getDialRegion(2))
+			if ((us._dialBits & 0x10) && !getDialRegion(2))
 				continue;
-			if ((us->_dialBits & 0x20) && getDialRegion(2))
+			if ((us._dialBits & 0x20) && getDialRegion(2))
 				continue;
 
-			setState(us->_newValue);
+			setState(us._newValue);
 			break;
 		}
 	}
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 219ac74..1e3eaae 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -397,7 +397,25 @@ int DeskbotScript::getStateDialogueId() const {
 }
 
 void DeskbotScript::setFlags17(int newId, int index) {
-	// TODO
+	int newValue = getValue(17);
+
+	for (uint idx = 0; idx < _states.size(); ++idx) {
+		const TTupdateState3 &us = _states[idx];
+		if (newId == (idx == 0 ? 0 : us._newId)) {
+			uint bits = us._dialBits;
+
+			if (!bits
+				|| (index == 1 && (bits & 1) && (bits & 4))
+				|| (index == 0 && (bits & 2) && (bits & 4))
+				|| (index == 3 && (bits & 1) && (bits & 8))
+				|| (index == 2 && (bits & 2) && (bits & 8))) {
+				newValue = us._newValue;
+				break;
+			}
+		}
+	}
+
+	CTrueTalkManager::setFlags(17, newValue);
 }
 
 } // End of namespace Titanic


Commit: 186b4e095a7f91bf1d5a186c0da9b4a81a0ae525
    https://github.com/scummvm/scummvm/commit/186b4e095a7f91bf1d5a186c0da9b4a81a0ae525
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-28T23:23:27-04:00

Commit Message:
TITANIC: Added DoorbotScript updateState

Changed paths:
    engines/titanic/true_talk/doorbot_script.cpp



diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index f644142..3dc1e7f 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -252,8 +252,72 @@ int DoorbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 }
 
 int DoorbotScript::updateState(uint oldId, uint newId, int index) {
-	warning("TODO");
-	return 0;
+	getValue(38);
+	bool flag39 = getValue(39) != 0;
+	CTrueTalkManager::setFlags(38, 0);
+	CTrueTalkManager::setFlags(39, 0);
+	
+	if (newId > 220890) {
+		switch (newId) {
+		case 221064:
+			return getValue(1) == 2 ? newId : 221062;
+		case 221080:
+			return getValue(1) >= 2 ? newId : 221066;
+		case 221078:
+		case 221079:
+			return getValue(1) >= 3 ? newId : 221065;
+		case 221081:
+			return getValue(7) == 0 ? newId : 221070;
+		case 221251:
+			CTrueTalkManager::triggerAction(28, 0);
+			break;
+		default:
+			break;
+		}
+	} else if (newId >= 220883) {
+		CTrueTalkManager::setFlags(38, 1);
+		CTrueTalkManager::triggerAction(28, 0);
+	} else if (newId >= 220076) {
+		switch (newId) {
+		case 220078:
+		case 220080:
+		case 220081:
+		case 220082:
+		case 220083:
+		case 220084:
+			if (flag39)
+				return getRangeValue(221381);
+			break;
+		default:
+			break;
+		}
+
+		CTrueTalkManager::setFlags(39, 1);
+	} else if (newId == 220075) {
+		if (flag39)
+			return getRangeValue(221381);
+		CTrueTalkManager::setFlags(39, 1);
+	} else if (newId == 220038) {
+		return 220038;
+	}
+
+	for (uint idx = 0; idx < _states.size(); ++idx) {
+		TTupdateState3 &us = _states[idx];
+		if (us._newId == newId) {
+			uint bits = us._dialBits;
+
+			if (!bits
+				|| (index == 0 && (bits == 5 || bits == 1))
+				|| (index == 1 && (bits == 6 || bits == 2))
+				|| (index == 2 && (bits == 9 || bits == 1))
+				|| (index == 3 && (bits == 10 || bits == 2))) {
+				setState(us._newValue);
+				break;
+			}
+		}
+	}
+
+	return newId;
 }
 
 int DoorbotScript::proc22(int id) const {


Commit: 39f882d9f3bfcf304806968f97cfb43e5ce95481
    https://github.com/scummvm/scummvm/commit/39f882d9f3bfcf304806968f97cfb43e5ce95481
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-28T23:25:38-04:00

Commit Message:
TITANIC: Added LiftbotScript updateState

Changed paths:
    engines/titanic/true_talk/liftbot_script.cpp



diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 2308ea1..66e2042 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -212,8 +212,15 @@ int LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 }
 
 int LiftbotScript::updateState(uint oldId, uint newId, int index) {
-	warning("TODO");
-	return 0;
+	for (uint idx = 0; idx < _states.size(); ++idx) {
+		TTupdateState2 &us = _states[idx];
+		if (us._src == newId) {
+			setState(us._dest);
+			break;
+		}
+	}
+
+	return newId;
 }
 
 int LiftbotScript::proc22(int id) const {


Commit: 72ef0e767508fedb5fa9670bed72463077df768c
    https://github.com/scummvm/scummvm/commit/72ef0e767508fedb5fa9670bed72463077df768c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-29T19:36:57-04:00

Commit Message:
TITANIC: Added MaitreDScript updateState

Changed paths:
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h



diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index abf0bc9..6eabcb4 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -186,8 +186,112 @@ int MaitreDScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 }
 
 int MaitreDScript::updateState(uint oldId, uint newId, int index) {
-	warning("TODO");
-	return 0;
+	if (getValue(8)) {
+		if (oldId == 260112)
+			return getRangeValue(260654);
+		if (oldId != 260655 && oldId != 260654)
+			return getRangeValue(260655);
+	}
+
+	newId = getStateDialogueId(oldId, newId);
+
+	if (newId == 260023) {
+		switch (getValue(13)) {
+		case 1:
+			newId = 260023; break;
+		case 2:
+			newId = 260024; break;
+		case 3:
+			newId = 260025; break;
+		case 4:
+			newId = 260026; break;
+		case 5:
+			newId = 260027; break;
+		default:
+			newId = 260016; break;
+		}
+	}
+
+	if (newId == 260034) {
+		switch (getValue(13)) {
+		case 1:
+			newId = 260034; break;
+		case 2:
+			newId = 260035; break;
+		case 3:
+			newId = 260036; break;
+		case 4:
+			newId = 260037; break;
+		case 5:
+			newId = 260038; break;
+		default:
+			newId = 260045; break;
+		}
+	}
+
+	if (newId == 260070) {
+		switch (getValue(13)) {
+		case 1:
+			newId = 260070; break;
+		case 2:
+			newId = 260071; break;
+		case 3:
+			newId = 260072; break;
+		case 4:
+			newId = 260073; break;
+		case 5:
+			newId = 260074; break;
+		default:
+			newId = 260110; break;
+		}
+	}
+
+	if (newId == 260076 || newId == 260181 || newId == 261010) {
+		CTrueTalkManager::setFlags(14, 1);
+		trigger12(true);
+		setFlags10(newId, index);
+		return newId;
+	}
+
+	if (!getValue(12)) {
+		static const int FLAG_IDS[] = {
+			260080, 260066, 260067, 260062, 260050, 260087, 260090, 260171, 260173,
+			260184, 260193, 260202, 260205, 260220, 260221, 260223, 260231, 260232,
+			260365, 260373, 260374, 260387, 260421, 260622, 260695, 0
+		};
+
+		for (uint idx = 0; FLAG_IDS[idx]; ++idx) {
+			if (FLAG_IDS[idx] == newId) {
+				setFlags12();
+				break;
+			}
+		}
+	}
+
+	if (newId == 261018) {
+		if (getValue(8) == 0 && getValue(9) == 0) {
+			newId = getRangeValue(260961);
+			setFlags10(newId, index);
+			return newId;
+		}
+
+		if (getValue(8) == 1 && getValue(9) == 1) {
+			newId = getRangeValue(260655);
+			setFlags10(newId, index);
+			return newId;
+		}
+
+		if (getValue(9) && getValue(16)) {
+			newId = getValue(16);
+			setFlags10(newId, index);
+			return index;
+		}
+
+		newId = 260989;
+	}
+
+	setFlags10(newId, index);
+	return newId;
 }
 
 int MaitreDScript::proc22(int id) const {
@@ -208,4 +312,90 @@ int MaitreDScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript,
 void MaitreDScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
 }
 
+uint MaitreDScript::getStateDialogueId(uint oldId, uint newId) {
+	if (getValue(8) || getValue(9))
+		return newId;
+
+	switch (newId) {
+	case 260009:
+	case 260010:
+	case 260011:
+	case 260012:
+		return getRangeValue(260961);
+	case 260052:
+		return 260094;
+	case 260203:
+		return 260204;
+	case 260211:
+	case 260212:
+	case 260761:
+	case 260986:
+	case 260987:
+	case 260989:
+		return getRangeValue(260961);
+	case 260263:
+	case 260264:
+		return 260265;
+	case 260411:
+		return 260457;
+	case 260427:
+	case 260053:
+	case 260054:
+	case 260055:
+	case 260056:
+	case 260057:
+	case 260058:
+	case 260059:
+	case 260060:
+		return 260135;
+	case 260698:
+	case 260895:
+	case 260896:
+		return 260457;
+	case 260799:
+		return 260214;
+
+	default:
+		return newId;
+	}
+}
+
+
+void MaitreDScript::setFlags12() {
+	int val = getValue(12);
+	CTrueTalkManager::setFlags(12, 1);
+
+	if (!val) {
+		CTrueTalkManager::triggerAction(8, 0);
+		resetRange(260121);
+		resetRange(260122);
+		resetRange(260123);
+		resetRange(260124);
+		resetRange(260125);
+		resetRange(260126);
+	}
+}
+
+void MaitreDScript::setFlags10(int newId, int index) {
+	int val = 28;
+	for (uint idx = 0; idx < _states.size(); ++idx) {
+		TTupdateState2 &us = _states[idx];
+		if (us._src == newId) {
+			val = us._dest;
+			break;
+		}
+	}
+
+	CTrueTalkManager::setFlags(10, val);
+}
+
+void MaitreDScript::trigger12(bool flag) {
+	int val = getValue(12);
+	CTrueTalkManager::setFlags(12, 0);
+
+	if (val) {
+		CTrueTalkManager::triggerAction(flag ? 10 : 9, 0);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index ad43438..7195fb2 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -35,6 +35,27 @@ private:
 	 * Setup sentence data
 	 */
 	void setupSentences();
+
+	/**
+	 * Alter dialogue Id based on current NPC state
+	 */
+	uint getStateDialogueId(uint oldId, uint newId);
+
+	/**
+	 * Sets flags 12 and resets some ranges
+	 */
+	void setFlags12();
+
+	/**
+	 * Sets flags 10 to different values based on the passed
+	 * dialogue Id
+	 */
+	void setFlags10(int newId, int index);
+
+	/**
+	 * Trigers 12
+	 */
+	void trigger12(bool flag);
 public:
 	MaitreDScript(int val1, const char *charClass, int v2,
 			const char *charName, int v3, int val2);


Commit: 0ab3c53e15507fc410507f5500e70fb53e7fc6fe
    https://github.com/scummvm/scummvm/commit/0ab3c53e15507fc410507f5500e70fb53e7fc6fe
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-29T21:57:19-04:00

Commit Message:
DEVTOOLS: Add NPC pre-response arrays to create_titanic

Changed paths:
  A devtools/create_titanic/script_preresponses.cpp
  A devtools/create_titanic/script_preresponses.h
    devtools/create_titanic/create_titanic_dat.cpp
    devtools/create_titanic/module.mk



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index cc0283e..cffbf3c 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -36,6 +36,7 @@
 #include "common/rect.h"
 #include "winexe_pe.h"
 #include "file.h"
+#include "script_preresponses.h"
 #include "script_quotes.h"
 #include "script_responses.h"
 #include "script_ranges.h"
@@ -54,7 +55,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x880
+#define HEADER_SIZE 0x900
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -591,6 +592,7 @@ void writeData() {
 	writeAllScriptRanges();
 	writeAllTagMappings();
 	writeAllUpdateStates();
+	writeAllScriptPreResponses();
 }
 
 void createScriptMap() {
diff --git a/devtools/create_titanic/module.mk b/devtools/create_titanic/module.mk
index aae7b4b..9f77866 100644
--- a/devtools/create_titanic/module.mk
+++ b/devtools/create_titanic/module.mk
@@ -4,11 +4,14 @@ MODULE := devtools/create_titanic
 MODULE_OBJS := \
 	create_titanic_dat.o \
 	hashmap.o \
+	memorypool.o \
+	script_preresponses.o \
 	script_quotes.o \
 	script_ranges.o \
 	script_responses.o \
 	script_states.o \
 	str.o \
+	tag_maps.o \
 	winexe.o \
 	winexe_pe.o
 
diff --git a/devtools/create_titanic/script_preresponses.cpp b/devtools/create_titanic/script_preresponses.cpp
new file mode 100644
index 0000000..d906015
--- /dev/null
+++ b/devtools/create_titanic/script_preresponses.cpp
@@ -0,0 +1,156 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+ // Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+// HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
+#include "file.h"
+#include "script_preresponses.h"
+
+static const PreResponse BARBOT_PRERESPONSES[] = {
+	{ 0x0000CA02, 0x0003D102 },
+	{ 0x0000CA68, 0x0003D102 },
+	{ 0x0000C9DA, 0x0003D102 },
+	{ 0x0000CA6A, 0x0003D103 },
+	{ 0x0000C922, 0x0003D099 },
+	{ 0x0000C97C, 0x0003D099 },
+	{ 0x0000CA0B, 0x0003D099 },
+	{ 0x0000CA72, 0x0003D099 },
+	{ 0x0000CA0E, 0x0003D107 },
+	{ 0x0000CA73, 0x0003D107 },
+	{ 0x0000CA12, 0x0003D108 },
+	{ 0x0000CA1C, 0x0003D10E },
+	{ 0x0000CA83, 0x0003D10E },
+	{ 0x0000CA1F, 0x0003D110 },
+	{ 0x0000CA86, 0x0003D110 },
+	{ 0x0000CA23, 0x0003D112 },
+	{ 0x0000CA8A, 0x0003D112 },
+	{ 0x0000CA92, 0x0003D122 },
+	{ 0x0000CA30, 0x0003D116 },
+	{ 0x0000CA96, 0x0003D116 },
+	{ 0x0000CA36, 0x0003D117 },
+	{ 0x0000C9FC, 0x0003D117 },
+	{ 0x0000CA9B, 0x0003D117 },
+	{ 0x0000CA63, 0x0003D117 },
+	{ 0x0000CA38, 0x0003D11B },
+	{ 0x0000CA15, 0x0003D109 },
+	{ 0x0000CA7B, 0x0003D109 },
+	{ 0x0000CA2E, 0x0003D115 },
+	{ 0x0000CA94, 0x0003D115 },
+	{ 0x0000CA5C, 0x0003D115 },
+	{ 0x0000CA21, 0x0003D111 },
+	{ 0x0000CA88, 0x0003D111 },
+	{ 0x0000CA2A, 0x0003D114 },
+	{ 0x0000CA28, 0x0003D119 },
+	{ 0x0000CA8E, 0x0003D119 },
+	{ 0x0000CA17, 0x0003D10B },
+	{ 0x0000CA7D, 0x0003D10B },
+	{ 0x0000CA4C, 0x0003D10B },
+	{ 0x0000CA06, 0x0003D105 },
+	{ 0x0000CA6C, 0x0003D105 },
+	{ 0x0000CA0A, 0x0003D106 },
+	{ 0x0000CA70, 0x0003D106 },
+	{ 0x0000CA19, 0x0003D10C },
+	{ 0x0000CA7F, 0x0003D10C },
+	{ 0x0000C9FF, 0x0003D101 },
+	{ 0x0000CA65, 0x0003D101 },
+	{ 0x00000000, 0x00000000 }
+};
+
+static const PreResponse BELLBOT_PRERESPONSES[] = {
+	{ 0x000052DC, 0x00030D40 },
+	{ 0x000054E9, 0x00030D40 },
+	{ 0x000054EC, 0x00030D40 },
+	{ 0x000054F0, 0x00030D40 },
+	{ 0x0000532C, 0x00031625 },
+	{ 0x00005330, 0x00031625 },
+	{ 0x00005368, 0x00031625 },
+	{ 0x00005369, 0x00031625 },
+	{ 0x0000536A, 0x00031625 },
+	{ 0x0000536B, 0x00031625 },
+	{ 0x0000536C, 0x00031625 },
+	{ 0x0000536D, 0x00031625 },
+	{ 0x000053A4, 0x00031625 },
+	{ 0x0000558A, 0x00031625 },
+	{ 0x00005485, 0x00031625 },
+	{ 0x00004EE7, 0x00031625 },
+	{ 0x00004EE8, 0x00031625 },
+	{ 0x0000530A, 0x00031625 },
+	{ 0x0000530B, 0x00031625 },
+	{ 0x000053F6, 0x00031625 },
+	{ 0x000053F7, 0x00031625 },
+	{ 0x000053F8, 0x00031625 },
+	{ 0x000053F9, 0x00031625 },
+	{ 0x000053FA, 0x00031625 },
+	{ 0x000053FB, 0x00031625 },
+	{ 0x000053FC, 0x00031625 },
+	{ 0x000053FD, 0x00031625 },
+	{ 0x0000556B, 0x00031041 },
+	{ 0x00005499, 0x00030D40 },
+	{ 0x000053E9, 0x00030E01 },
+	{ 0x000053EB, 0x00030E01 },
+	{ 0x000053EC, 0x00030E01 },
+	{ 0x000053ED, 0x00030E01 },
+	{ 0x000053EE, 0x00030E01 },
+	{ 0x000053EF, 0x00030E01 },
+	{ 0x000053F0, 0x00030E01 },
+	{ 0x000053F1, 0x00030E01 },
+	{ 0x000053F2, 0x00030E01 },
+	{ 0x000053EA, 0x00030E01 },
+	{ 0x00005441, 0x00030F00 },
+	{ 0x00005444, 0x00030F00 },
+	{ 0x00005445, 0x00030F00 },
+	{ 0x00005443, 0x00030F00 },
+	{ 0x00005446, 0x00030F00 },
+	{ 0x00005447, 0x00030F00 },
+	{ 0x00005448, 0x00030F00 },
+	{ 0x00005449, 0x00030F00 },
+	{ 0x0000544A, 0x00030F00 },
+	{ 0x0000544B, 0x00030F00 },
+	{ 0x00005442, 0x00030F00 },
+	{ 0x0000527C, 0x000315C8 },
+	{ 0x00000000, 0x00000000 }
+};
+
+void writeScriptPreResponses(const char *name, const PreResponse *states) {
+	outputFile.seek(dataOffset);
+
+	for (; states->_src; ++states) {
+		outputFile.writeLong(states->_src);
+		outputFile.writeLong(states->_dest);
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader(name, dataOffset, size);
+	dataOffset += size;
+}
+
+void writeAllScriptPreResponses() {
+	writeScriptPreResponses("PreResponses/Barbot", BARBOT_PRERESPONSES);
+	writeScriptPreResponses("PreResponses/Bellbot", BELLBOT_PRERESPONSES);
+}
\ No newline at end of file
diff --git a/devtools/create_titanic/script_preresponses.h b/devtools/create_titanic/script_preresponses.h
new file mode 100644
index 0000000..b4377be
--- /dev/null
+++ b/devtools/create_titanic/script_preresponses.h
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef COMMON_SCRIPT_PRERESPONSES_H
+#define COMMON_SCRIPT_PRERESPONSES_H
+
+#include "common/scummsys.h"
+
+struct PreResponse {
+	uint _src;
+	uint _dest;
+};
+
+extern void writeAllScriptPreResponses();
+extern void writeEntryHeader(const char *name, uint offset, uint size);
+extern uint dataOffset;
+
+#endif


Commit: 0243d5b677c758f7b88598326e84d3d1034bd166
    https://github.com/scummvm/scummvm/commit/0243d5b677c758f7b88598326e84d3d1034bd166
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-29T21:57:35-04:00

Commit Message:
TITANIC: Add NPC preResponse methods

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/script_support.cpp
    engines/titanic/true_talk/script_support.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 1c652faf..81682a2 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -52,6 +52,7 @@ BarbotScript::BarbotScript(int val1, const char *charClass, int v2,
 	_tagMappings.load("TagMap/Barbot");
 	_quotes.load("Quotes/Barbot");
 	_states.load("States/Barbot");
+	_preResponses.load("PreResponses/Barbot");
 }
 
 void BarbotScript::setupSentences() {
@@ -975,7 +976,7 @@ int BarbotScript::updateState(uint oldId, uint newId, int index) {
 	}
 
 	for (uint idx = 0; idx < _states.size(); ++idx) {
-		const TTupdateState3 &us = _states[idx];
+		const TTupdateState &us = _states[idx];
 		if (us._newId == newId) {
 			if ((us._dialBits & 1) && !getDialRegion(0))
 				continue;
@@ -998,9 +999,11 @@ int BarbotScript::updateState(uint oldId, uint newId, int index) {
 	return newId;
 }
 
-int BarbotScript::proc22(int id) const {
-	warning("TODO");
-	return 0;
+int BarbotScript::preResponse(uint id) {
+	if (getDialRegion(0) == 0 && getRandomNumber(100) > 80)
+		return 251250;
+
+	return _preResponses.find(id);
 }
 
 uint BarbotScript::getDialsBitset() const {
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index c8b2962..8a81099 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -32,7 +32,8 @@ private:
 	int _state;
 	int _arrIndex;
 	TTsentenceEntries _entries2;
-	TTupdateState3Array _states;
+	TTupdateStateArray _states;
+	TTmapEntryArray _preResponses;
 private:
 	/**
 	 * Adjust a given dial number by a given delta amount
@@ -79,7 +80,10 @@ public:
 	 */
 	virtual int updateState(uint oldId, uint newId, int index);
 
-	virtual int proc22(int id) const;
+	/**
+	 * Handles getting a pre-response
+	 */
+	virtual int preResponse(uint id);
 
 	/**
 	 * Returns a bitset of the first three dialgs being on or not
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 1a9a607..88f13cc 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -51,6 +51,7 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	_words.load("Words/Bellbot");
 	_quotes.load("Quotes/Bellbot");
 	_states.load("States/Bellbot");
+	_preResponses.load("PreResponses/Bellbot");
 }
 
 void BellbotScript::setupSentences() {
@@ -299,9 +300,22 @@ int BellbotScript::updateState(uint oldId, uint newId, int index) {
 	return newId;
 }
 
-int BellbotScript::proc22(int id) const {
-	warning("TODO");
-	return 0;
+int BellbotScript::preResponse(uint id) {
+	int newId = _preResponses.find(id);
+
+	if (newId == 202277) {
+		applyResponse();
+		CTrueTalkManager::triggerAction(1, 0);
+	}
+	if (newId == 200769) {
+		applyResponse();
+		CTrueTalkManager::triggerAction(18, 0);
+	}
+
+	if (id == 21790)
+		CTrueTalkManager::triggerAction(13, 0);
+
+	return newId;
 }
 
 int BellbotScript::proc23() const {
@@ -427,7 +441,7 @@ int BellbotScript::getStateDialogueId() const {
 void BellbotScript::setValue23(uint id) {
 	uint val = 0;
 	for (uint idx = 0; idx < _states.size() && !val; ++idx) {
-		TTupdateState2 &us = _states[idx];
+		TTmapEntry &us = _states[idx];
 		if (us._src == id)
 			val = us._dest;
 	}
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 798eecb..6045965 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -30,7 +30,8 @@ namespace Titanic {
 class BellbotScript : public TTnpcScript {
 private:
 	static uint _oldId;
-	TTupdateState2Array _states;
+	TTmapEntryArray _states;
+	TTmapEntryArray _preResponses;
 	int _array[150];
 	int _field2D0;
 	int _field2D4;
@@ -80,7 +81,11 @@ public:
 	 */
 	virtual int updateState(uint oldId, uint newId, int index);
 
-	virtual int proc22(int id) const;
+	/**
+	 * Handles getting a pre-response
+	 */
+	virtual int preResponse(uint id);
+
 	virtual int proc23() const;
 
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 1e3eaae..90fab86 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -251,9 +251,15 @@ exit:
 	return newId;
 }
 
-int DeskbotScript::proc22(int id) const {
-	warning("TODO");
-	return 0;
+int DeskbotScript::preResponse(uint id) {
+	int newId = 0;
+	if (getValue(1) >= 3 && (id == 41176 || id == 41738 || id == 41413 || id == 41740))
+		newId = 241601;
+
+	if (id == 42114)
+		CTrueTalkManager::triggerAction(20, 0);
+
+	return newId;
 }
 
 int DeskbotScript::proc23() const {
@@ -330,7 +336,7 @@ bool DeskbotScript::isDial1Low() const {
 	return getDialRegion(1) == 0;
 }
 
-int DeskbotScript::addAssignedRoomDialogue() {
+uint DeskbotScript::addAssignedRoomDialogue() {
 	if (isDial1Medium()) {
 		addResponse(getDialogueId(240407));
 		addResponse(getDialogueId(241510));
@@ -351,7 +357,7 @@ int DeskbotScript::addAssignedRoomDialogue() {
 	}
 }
 
-int DeskbotScript::addAssignedRoomDialogue2() {
+uint DeskbotScript::addAssignedRoomDialogue2() {
 	addResponse(getDialogueId(241355));
 	int roomNum = 0, floorNum = 0, elevatorNum = 0;
 	getAssignedRoom(&roomNum, &floorNum, &elevatorNum);
@@ -385,7 +391,7 @@ void DeskbotScript::addAssignedRoomDialogue3() {
 	applyResponse();
 }
 
-int DeskbotScript::getStateDialogueId() const {
+uint DeskbotScript::getStateDialogueId() const {
 	switch (getValue(1)) {
 	case 1:
 		return 241503;
@@ -396,11 +402,11 @@ int DeskbotScript::getStateDialogueId() const {
 	}
 }
 
-void DeskbotScript::setFlags17(int newId, int index) {
+void DeskbotScript::setFlags17(uint newId, uint index) {
 	int newValue = getValue(17);
 
 	for (uint idx = 0; idx < _states.size(); ++idx) {
-		const TTupdateState3 &us = _states[idx];
+		const TTupdateState &us = _states[idx];
 		if (newId == (idx == 0 ? 0 : us._newId)) {
 			uint bits = us._dialBits;
 
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index be12b52..09ae9c8 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -31,7 +31,7 @@ namespace Titanic {
 class DeskbotScript : public TTnpcScript {
 private:
 	static int _oldId;
-	TTupdateState3Array _states;
+	TTupdateStateArray _states;
 private:
 	/**
 	 * Setup sentence data
@@ -41,12 +41,12 @@ private:
 	/**
 	 * Adds dialogue for the player's assigned room
 	 */
-	int addAssignedRoomDialogue();
+	uint addAssignedRoomDialogue();
 
 	/**
 	 * Adds dialogue for the player's assigned room
 	 */
-	int addAssignedRoomDialogue2();
+	uint addAssignedRoomDialogue2();
 
 	/**
 	 * Adds dialogue for the player's assigned room
@@ -56,12 +56,12 @@ private:
 	/**
 	 * Gets a dialogue Id based on the NPC's state
 	 */
-	int getStateDialogueId() const;
+	uint getStateDialogueId() const;
 
 	/**
 	 * Sets state data in flags 17
 	 */
-	void setFlags17(int newId, int index);
+	void setFlags17(uint newId, uint index);
 public:
 	DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
@@ -84,7 +84,11 @@ public:
 	 */
 	virtual int updateState(uint oldId, uint newId, int index);
 
-	virtual int proc22(int id) const;
+	/**
+	 * Handles getting a pre-response
+	 */
+	virtual int preResponse(uint id);
+
 	virtual int proc23() const;
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 3dc1e7f..d4c18cf 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -302,7 +302,7 @@ int DoorbotScript::updateState(uint oldId, uint newId, int index) {
 	}
 
 	for (uint idx = 0; idx < _states.size(); ++idx) {
-		TTupdateState3 &us = _states[idx];
+		TTupdateState &us = _states[idx];
 		if (us._newId == newId) {
 			uint bits = us._dialBits;
 
@@ -320,9 +320,14 @@ int DoorbotScript::updateState(uint oldId, uint newId, int index) {
 	return newId;
 }
 
-int DoorbotScript::proc22(int id) const {
-	warning("TODO");
-	return 0;
+int DoorbotScript::preResponse(uint id) {
+	uint newId = 0;
+	if (getDialRegion(0) != 1 && getRandomNumber(100) > 60) {
+		addResponse(11195);
+		newId = 222193;
+	}
+
+	return newId;
 }
 
 uint DoorbotScript::getDialsBitset() const {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 15463d5..7aac6b2 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class DoorbotScript : public TTnpcScript {
 private:
-	TTupdateState3Array _states;
+	TTupdateStateArray _states;
 	int _stateIndex;
 private:
 	/**
@@ -78,7 +78,10 @@ public:
 	 */
 	virtual int updateState(uint oldId, uint newId, int index);
 
-	virtual int proc22(int id) const;
+	/**
+	 * Handles getting a pre-response
+	 */
+	virtual int preResponse(uint id);
 
 	/**
 	 * Returns a bitset of the dials being off or not
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 66e2042..0f58215 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -213,7 +213,7 @@ int LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 
 int LiftbotScript::updateState(uint oldId, uint newId, int index) {
 	for (uint idx = 0; idx < _states.size(); ++idx) {
-		TTupdateState2 &us = _states[idx];
+		TTmapEntry &us = _states[idx];
 		if (us._src == newId) {
 			setState(us._dest);
 			break;
@@ -223,8 +223,14 @@ int LiftbotScript::updateState(uint oldId, uint newId, int index) {
 	return newId;
 }
 
-int LiftbotScript::proc22(int id) const {
-	warning("TODO");
+int LiftbotScript::preResponse(uint id) {
+	if (id == 30565 || id == 30566 || id == 30567 || id == 30568
+			|| id == 30569 || id == 30570 || id == 30571)
+		return 210901;
+
+	if (getDialRegion(0) == 0 && getRandomNumber(100) > 60)
+		return 210830;
+
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index ee8dbc1..33da983 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class LiftbotScript : public TTnpcScript {
 private:
-	TTupdateState2Array _states;
+	TTmapEntryArray _states;
 	static int _stateIndex;
 private:
 	/**
@@ -75,7 +75,10 @@ public:
 	 */
 	virtual int updateState(uint oldId, uint newId, int index);
 
-	virtual int proc22(int id) const;
+	/**
+	 * Handles getting a pre-response
+	 */
+	virtual int preResponse(uint id);
 
 	/**
 	 * Returns a bitset of the dials being off or not
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 6eabcb4..c6ceca8 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -254,7 +254,7 @@ int MaitreDScript::updateState(uint oldId, uint newId, int index) {
 	}
 
 	if (!getValue(12)) {
-		static const int FLAG_IDS[] = {
+		static const uint FLAG_IDS[] = {
 			260080, 260066, 260067, 260062, 260050, 260087, 260090, 260171, 260173,
 			260184, 260193, 260202, 260205, 260220, 260221, 260223, 260231, 260232,
 			260365, 260373, 260374, 260387, 260421, 260622, 260695, 0
@@ -294,8 +294,10 @@ int MaitreDScript::updateState(uint oldId, uint newId, int index) {
 	return newId;
 }
 
-int MaitreDScript::proc22(int id) const {
-	warning("TODO");
+int MaitreDScript::preResponse(uint id) {
+	if (id == 60911)
+		return 260101;
+
 	return 0;
 }
 
@@ -376,10 +378,10 @@ void MaitreDScript::setFlags12() {
 	}
 }
 
-void MaitreDScript::setFlags10(int newId, int index) {
+void MaitreDScript::setFlags10(uint newId, uint index) {
 	int val = 28;
 	for (uint idx = 0; idx < _states.size(); ++idx) {
-		TTupdateState2 &us = _states[idx];
+		TTmapEntry &us = _states[idx];
 		if (us._src == newId) {
 			val = us._dest;
 			break;
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 7195fb2..60113b8 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -29,7 +29,7 @@ namespace Titanic {
 
 class MaitreDScript : public TTnpcScript {
 private:
-	TTupdateState2Array _states;
+	TTmapEntryArray _states;
 private:
 	/**
 	 * Setup sentence data
@@ -50,7 +50,7 @@ private:
 	 * Sets flags 10 to different values based on the passed
 	 * dialogue Id
 	 */
-	void setFlags10(int newId, int index);
+	void setFlags10(uint newId, uint index);
 
 	/**
 	 * Trigers 12
@@ -83,7 +83,11 @@ public:
 	 */
 	virtual int updateState(uint oldId, uint newId, int index);
 
-	virtual int proc22(int id) const;
+	/**
+	 * Handles getting a pre-response
+	 */
+	virtual int preResponse(uint id);
+
 	virtual int proc23() const;
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
diff --git a/engines/titanic/true_talk/script_support.cpp b/engines/titanic/true_talk/script_support.cpp
index af5ef05..f2c473d 100644
--- a/engines/titanic/true_talk/script_support.cpp
+++ b/engines/titanic/true_talk/script_support.cpp
@@ -164,11 +164,11 @@ void TThandleQuoteEntries::load(const char *name) {
 
 /*------------------------------------------------------------------------*/
 
-void TTupdateState2Array::load(const char *name) {
+void TTmapEntryArray::load(const char *name) {
 	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
 
 	while (r->pos() < r->size()) {
-		TTupdateState2 us;
+		TTmapEntry us;
 		us._src = r->readUint32LE();
 		us._dest = r->readUint32LE();
 
@@ -178,13 +178,23 @@ void TTupdateState2Array::load(const char *name) {
 	delete r;
 }
 
+int TTmapEntryArray::find(uint id) const {
+	for (uint idx = 0; idx < size(); ++idx) {
+		const TTmapEntry &me = (*this)[idx];
+		if (me._src == id)
+			return me._dest;
+	}
+
+	return 0;
+}
+
 /*------------------------------------------------------------------------*/
 
-void TTupdateState3Array::load(const char *name) {
+void TTupdateStateArray::load(const char *name) {
 	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
 
 	while (r->pos() < r->size()) {
-		TTupdateState3 ue;
+		TTupdateState ue;
 		ue._newId = r->readUint32LE();
 		ue._newValue = r->readUint32LE();
 		ue._dialBits = r->readUint32LE();
diff --git a/engines/titanic/true_talk/script_support.h b/engines/titanic/true_talk/script_support.h
index 6a60563..ca70b09 100644
--- a/engines/titanic/true_talk/script_support.h
+++ b/engines/titanic/true_talk/script_support.h
@@ -142,27 +142,32 @@ public:
 	void load(const char *name);
 };
 
-struct TTupdateState2 {
+struct TTmapEntry {
 	uint _src;
 	uint _dest;
 
-	TTupdateState2() : _src(0), _dest(0) {}
+	TTmapEntry() : _src(0), _dest(0) {}
 };
 
-class TTupdateState2Array : public Common::Array<TTupdateState2> {
+class TTmapEntryArray : public Common::Array<TTmapEntry> {
 public:
 	void load(const char *name);
+
+	/**
+	 * Finds a record by Id, and returns it's associated value
+	 */
+	int find(uint id) const;
 };
 
-struct TTupdateState3 {
+struct TTupdateState {
 	uint _newId;
 	uint _newValue;
 	uint _dialBits;
 
-	TTupdateState3() : _newId(0), _newValue(0), _dialBits(0) {}
+	TTupdateState() : _newId(0), _newValue(0), _dialBits(0) {}
 };
 
-class TTupdateState3Array : public Common::Array<TTupdateState3> {
+class TTupdateStateArray : public Common::Array<TTupdateState> {
 public:
 	void load(const char *name);
 };
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 18ade0c..4cd964d 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -376,7 +376,7 @@ int TTnpcScript::updateState(uint oldId, uint newId, int index) {
 	return newId;
 }
 
-int TTnpcScript::proc22(int id) const {
+int TTnpcScript::preResponse(uint id) {
 	return 0;
 }
 
@@ -742,7 +742,7 @@ int TTnpcScript::processEntries(const TTsentenceEntries *entries, uint entryCoun
 						return 2;	
 					addResponse(dialogueId);
 
-					id = proc22(dialogueId);
+					id = preResponse(dialogueId);
 					if (id)
 						addResponse(getDialogueId(id));
 					applyResponse();
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index eb53dc9..f52df35 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -261,7 +261,10 @@ public:
 	 */
 	virtual int updateState(uint oldId, uint newId, int index);
 
-	virtual int proc22(int id) const;
+	/**
+	 * Handles getting a pre-response
+	 */
+	virtual int preResponse(uint id);
 
 	/**
 	 * Returns a bitset of the dials being off or not


Commit: eef9303027fd2ff8c71b111bb0a3bcda242098bc
    https://github.com/scummvm/scummvm/commit/eef9303027fd2ff8c71b111bb0a3bcda242098bc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-29T22:07:49-04:00

Commit Message:
TITANIC: Handle NPC postResponse methods

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 81682a2..25252cc 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -1155,9 +1155,6 @@ int BarbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript,
 	return 2;
 }
 
-void BarbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
-}
-
 void BarbotScript::setDialRegion(int dialNum, int region) {
 	TTnpcScript::setDialRegion(dialNum, region);
 	selectResponse(250365);
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 8a81099..d1da7e1 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -92,8 +92,6 @@ public:
 
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
-	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
-
 	/**
 	 * Sets a given dial to be pointing in a specified region (0 to 2)
 	 */
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 88f13cc..ee964cb 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -407,9 +407,6 @@ int BellbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript,
 	return 0;
 }
 
-void BellbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
-}
-
 int BellbotScript::proc36(int id) const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 6045965..fc88f62 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -90,7 +90,6 @@ public:
 
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
-	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
 };
 
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 90fab86..5b4eec1 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -312,9 +312,6 @@ int DeskbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript,
 	return 0;
 }
 
-void DeskbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
-}
-
 int DeskbotScript::proc36(int id) const {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 09ae9c8..2e814ee 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -91,7 +91,6 @@ public:
 
 	virtual int proc23() const;
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
-	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
 
 	/**
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index d4c18cf..050a544 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -515,9 +515,6 @@ int DoorbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript,
 	return 0;
 }
 
-void DoorbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
-}
-
 void DoorbotScript::setDialRegion(int dialNum, int region) {
 	TTnpcScript::setDialRegion(dialNum, region);
 	if (dialNum == 1 && region != 1) {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 7aac6b2..11d4dd3 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -89,7 +89,6 @@ public:
 	virtual uint getDialsBitset() const;
 
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
-	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
 	 * Sets a given dial to be pointing in a specified region (0 to 2)
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 0f58215..7afd2c4 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -354,9 +354,6 @@ int LiftbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript,
 	return 0;
 }
 
-void LiftbotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
-}
-
 void LiftbotScript::setDialRegion(int dialNum, int region) {
 	TTnpcScript::setDialRegion(dialNum, region);
 	addResponse(getDialogueId(210688));
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 33da983..968e80d 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -86,7 +86,6 @@ public:
 	virtual uint getDialsBitset() const;
 
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
-	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
 	 * Sets a given dial to be pointing in a specified region (0 to 2)
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index c6ceca8..0ef94e0 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -311,9 +311,6 @@ int MaitreDScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript,
 	return 0;
 }
 
-void MaitreDScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
-}
-
 uint MaitreDScript::getStateDialogueId(uint oldId, uint newId) {
 	if (getValue(8) || getValue(9))
 		return newId;
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 60113b8..3cb2b5a 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -90,7 +90,6 @@ public:
 
 	virtual int proc23() const;
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
-	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index 01d998d..c2f08ca 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -111,7 +111,4 @@ int ParrotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript,
 	return 0;
 }
 
-void ParrotScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index e832f7c..620e098 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -54,7 +54,6 @@ public:
 
 	virtual int proc23() const;
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
-	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index a6e1f7f..1050ba2 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -99,7 +99,4 @@ int SuccUBusScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript
 	return 0;
 }
 
-void SuccUBusScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
-}
-
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 560272b..7acc27f 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -61,7 +61,6 @@ public:
 
 	virtual int proc23() const;
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
-	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 4cd964d..7b25c66 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -390,9 +390,6 @@ int TTnpcScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, T
 	return 0;
 }
 
-void TTnpcScript::proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {
-}
-
 void TTnpcScript::save(SimpleFile *file) {
 	file->writeNumber(charId());
 	saveBody(file);
@@ -748,7 +745,7 @@ int TTnpcScript::processEntries(const TTsentenceEntries *entries, uint entryCoun
 					applyResponse();
 
 					if (entry._field30)
-						proc26(entry._field30, &entry, roomScript, sentence);
+						postResponse(entry._field30, &entry, roomScript, sentence);
 
 					return 2;
 				}
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index f52df35..735e8b8 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -273,7 +273,12 @@ public:
 	
 	virtual const TTscriptMapping *getMapping(int index);
 	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
-	virtual void proc26(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence);
+
+	/**
+	 * Handles any post-response NPC processing
+	 */
+	virtual void postResponse(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {}
+	
 	virtual void save(SimpleFile *file);
 	virtual void load(SimpleFile *file);
 	virtual void saveBody(SimpleFile *file);


Commit: 4df8e58cf39615398bf484e1eda34a7e9c507acb
    https://github.com/scummvm/scummvm/commit/4df8e58cf39615398bf484e1eda34a7e9c507acb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-29T22:22:37-04:00

Commit Message:
TITANIC: Fix commented out quotes tree searches

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 25252cc..1ea2cae 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -23,6 +23,7 @@
 #include "common/textconsole.h"
 #include "titanic/true_talk/barbot_script.h"
 #include "titanic/true_talk/true_talk_manager.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -204,6 +205,7 @@ int BarbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	CTrueTalkManager::setFlags(33, getValue(33) - 1);
 	CTrueTalkManager::setFlags(34, getValue(34) - 1);
 	
+	TTtreeResult treeResult;
 	int val34 = getState();
 	setState(0);
 
@@ -297,18 +299,15 @@ int BarbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 			return applySentenceIds(getDialogueId(250946));
 		break;
 	case 15:
-		/* TODO 
 		if (flag || sentence->contains("or")) {
 			return applySentenceIds(getDialogueId(250526), 16);
 		} else {
-			TTtreeResult treeResult;
-			if (TTquotesTree::search(sentence->_normalizedLine.c_str(), 
-					&TTnpcScript_BTREE_3, &treeResult, 0, 0) != -1) {
-				id = getDialogueId(250526);
-				return applySentenceIds(id, 16);
+			if (g_vm->_trueTalkManager->_quotesTree.search(
+					sentence->_normalizedLine.c_str(), TREE_3, &treeResult, 0, nullptr) != -1) {
+				uint newId = getDialogueId(250526);
+				return applySentenceIds(newId, 16);
 			}
 		}
-		*/
 		break;
 	case 17:
 		if (flag) {
@@ -358,12 +357,10 @@ int BarbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 			return applySentenceIds(50215);
 		break;
 	case 26:
-		/* TODO
-		v43 = TTstring_cstr(&sentence->normalizedLine);
-		if (TTquotesTree_Search(v43, &TTnpcScript_BTREE_3, &buffer, 0, 0) == -1)
-			break;
-		*/
-		return applySentenceIds(getDialogueId(251899), 26);
+		if (g_vm->_trueTalkManager->_quotesTree.search(
+				sentence->_normalizedLine.c_str(), TREE_3, &treeResult, 0, nullptr) != -1)
+			return applySentenceIds(getDialogueId(251899), 26);
+		break;
 
 	case 27:
 		if (flag)


Commit: 6aef21517f5f65f6421103e1b2d150f44a6f17c6
    https://github.com/scummvm/scummvm/commit/6aef21517f5f65f6421103e1b2d150f44a6f17c6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-29T22:27:07-04:00

Commit Message:
TITANIC: Rename NPC scripts proc25 to doSentenceEntry

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 1ea2cae..fbda554 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -1015,7 +1015,7 @@ uint BarbotScript::getDialsBitset() const {
 	return bits;
 }
 
-int BarbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int BarbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	int v34 = getState();
 	uint id = 0;
 
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index d1da7e1..d7fb190 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -90,7 +90,7 @@ public:
 	 */
 	virtual uint getDialsBitset() const;
 
-	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
 	 * Sets a given dial to be pointing in a specified region (0 to 2)
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index ee964cb..d3fa24b 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -323,7 +323,7 @@ int BellbotScript::proc23() const {
 	return 0;
 }
 
-int BellbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int BellbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	switch (val1) {
 	case 1:
 		addResponse(getDialogueId(*srcIdP));
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index fc88f62..ace2862 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -88,7 +88,7 @@ public:
 
 	virtual int proc23() const;
 
-	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
 	virtual int proc36(int val) const;
 };
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 5b4eec1..88bf111 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -267,7 +267,7 @@ int DeskbotScript::proc23() const {
 	return 0;
 }
 
-int DeskbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int DeskbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	uint id;
 
 	switch (val1) {
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 2e814ee..2991e06 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -90,7 +90,7 @@ public:
 	virtual int preResponse(uint id);
 
 	virtual int proc23() const;
-	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 	virtual int proc36(int val) const;
 
 	/**
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 050a544..8b83734 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -340,7 +340,7 @@ uint DoorbotScript::getDialsBitset() const {
 	return bits;
 }
 
-int DoorbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int DoorbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	int id2, id = 0;
 
 	switch (val1) {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 11d4dd3..5f740db 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -88,7 +88,7 @@ public:
 	 */
 	virtual uint getDialsBitset() const;
 
-	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
 	 * Sets a given dial to be pointing in a specified region (0 to 2)
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 7afd2c4..397338a 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -247,7 +247,7 @@ uint LiftbotScript::getDialsBitset() const {
 }
 
 
-int LiftbotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int LiftbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	static const int ARRAY13[] = {
 		210724, 210735, 210746, 210757, 210758, 210759, 210760,
 		210761, 210762, 210725, 210726, 210727, 210728, 210729,
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 968e80d..04d4b02 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -85,7 +85,7 @@ public:
 	 */
 	virtual uint getDialsBitset() const;
 
-	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
 	 * Sets a given dial to be pointing in a specified region (0 to 2)
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 0ef94e0..08e8119 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -306,7 +306,7 @@ int MaitreDScript::proc23() const {
 	return 0;
 }
 
-int MaitreDScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int MaitreDScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 3cb2b5a..5d26bec 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -89,7 +89,7 @@ public:
 	virtual int preResponse(uint id);
 
 	virtual int proc23() const;
-	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index c2f08ca..5894cd0 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -107,7 +107,7 @@ int ParrotScript::proc23() const {
 	return 0;
 }
 
-int ParrotScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int ParrotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index 620e098..f83d1f5 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -53,7 +53,7 @@ public:
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
 	virtual int proc23() const;
-	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 1050ba2..2a44043 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -94,7 +94,7 @@ int SuccUBusScript::proc23() const {
 	return 0;
 }
 
-int SuccUBusScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int SuccUBusScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 7acc27f..6401df0 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -60,7 +60,7 @@ public:
 	virtual int updateState(uint oldId, uint newId, int index);
 
 	virtual int proc23() const;
-	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 7b25c66..3e9af65 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -386,7 +386,7 @@ const TTscriptMapping *TTnpcScript::getMapping(int index) {
 	return nullptr;
 }
 
-int TTnpcScript::proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int TTnpcScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	return 0;
 }
 
@@ -722,7 +722,7 @@ int TTnpcScript::processEntries(const TTsentenceEntries *entries, uint entryCoun
 					if (!flag2) {
 						flag = false;
 					} else {
-						int result = proc25(entry._field2C & 0xFFFFFF, &entry._field0,
+						int result = doSentenceEntry(entry._field2C & 0xFFFFFF, &entry._field0,
 							roomScript, sentence);
 						if (result == 2)
 							return 2;
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 735e8b8..e758cff 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -272,7 +272,7 @@ public:
 	virtual uint getDialsBitset() const { return 0; }
 	
 	virtual const TTscriptMapping *getMapping(int index);
-	virtual int proc25(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
 	 * Handles any post-response NPC processing


Commit: a97dd2cda9a3352d74b66e1c317fa3aa2369ffe7
    https://github.com/scummvm/scummvm/commit/a97dd2cda9a3352d74b66e1c317fa3aa2369ffe7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-29T22:41:12-04:00

Commit Message:
TITANIC: Handle NPC getDialsBitset methods

Changed paths:
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h



diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index d7fb190..77c7cce 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -90,6 +90,9 @@ public:
 	 */
 	virtual uint getDialsBitset() const;
 
+	/**
+	 * Process a sentence fragment entry
+	 */
 	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index d3fa24b..3149439 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -318,11 +318,6 @@ int BellbotScript::preResponse(uint id) {
 	return newId;
 }
 
-int BellbotScript::proc23() const {
-	warning("TODO");
-	return 0;
-}
-
 int BellbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	switch (val1) {
 	case 1:
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index ace2862..8b43e32 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -86,8 +86,9 @@ public:
 	 */
 	virtual int preResponse(uint id);
 
-	virtual int proc23() const;
-
+	/**
+	 * Process a sentence fragment entry
+	 */
 	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
 	virtual int proc36(int val) const;
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 88bf111..debd6ea 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -262,9 +262,11 @@ int DeskbotScript::preResponse(uint id) {
 	return newId;
 }
 
-int DeskbotScript::proc23() const {
-	warning("TODO");
-	return 0;
+uint DeskbotScript::getDialsBitset() const {
+	if (getDialRegion(1))
+		return getDialRegion(0) ? 2 : 3;
+	else
+		return getDialRegion(0) ? 0 : 1;
 }
 
 int DeskbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 2991e06..7a09c28 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -89,8 +89,16 @@ public:
 	 */
 	virtual int preResponse(uint id);
 
-	virtual int proc23() const;
+	/**
+	 * Returns a bitset of the first three dialgs being on or not
+	 */
+	virtual uint getDialsBitset() const;
+
+	/**
+	 * Process a sentence fragment entry
+	 */
 	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+
 	virtual int proc36(int val) const;
 
 	/**
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 5f740db..4c3c9ed 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -88,6 +88,9 @@ public:
 	 */
 	virtual uint getDialsBitset() const;
 
+	/**
+	 * Process a sentence fragment entry
+	 */
 	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 04d4b02..118d658 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -85,6 +85,9 @@ public:
 	 */
 	virtual uint getDialsBitset() const;
 
+	/**
+	 * Process a sentence fragment entry
+	 */
 	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 08e8119..d013380 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -301,11 +301,6 @@ int MaitreDScript::preResponse(uint id) {
 	return 0;
 }
 
-int MaitreDScript::proc23() const {
-	warning("TODO");
-	return 0;
-}
-
 int MaitreDScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 5d26bec..b3185d3 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -88,7 +88,9 @@ public:
 	 */
 	virtual int preResponse(uint id);
 
-	virtual int proc23() const;
+	/**
+	 * Process a sentence fragment entry
+	 */
 	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 };
 
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index 5894cd0..0cd8082 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -103,10 +103,6 @@ ScriptChangedResult ParrotScript::scriptChanged(TTscriptBase *roomScript, uint i
 	return (id == 3) ? SCR_2 : SCR_1;
 }
 
-int ParrotScript::proc23() const {
-	return 0;
-}
-
 int ParrotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	return 0;
 }
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index f83d1f5..a27c159 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -52,7 +52,9 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-	virtual int proc23() const;
+	/**
+	 * Process a sentence fragment entry
+	 */
 	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 };
 
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 2a44043..07442ed 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -89,11 +89,6 @@ int SuccUBusScript::updateState(uint oldId, uint newId, int index) {
 	return 0;
 }
 
-int SuccUBusScript::proc23() const {
-	warning("TODO");
-	return 0;
-}
-
 int SuccUBusScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
 	warning("TODO");
 	return 0;
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 6401df0..4710e79 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -59,7 +59,9 @@ public:
 	 */
 	virtual int updateState(uint oldId, uint newId, int index);
 
-	virtual int proc23() const;
+	/**
+	 * Process a sentence fragment entry
+	 */
 	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 };
 


Commit: 1adebe83dc719699e0f32a238c5792a65847c76f
    https://github.com/scummvm/scummvm/commit/1adebe83dc719699e0f32a238c5792a65847c76f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-30T12:15:28-04:00

Commit Message:
TITANIC: Added NPC randomResponse methods, reworked NPC data

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index fbda554..cc987f0 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -1158,10 +1158,6 @@ void BarbotScript::setDialRegion(int dialNum, int region) {
 	applyResponse();
 }
 
-int BarbotScript::proc36(int tagId) const {
-	return 0;
-}
-
 void BarbotScript::adjustDial(int dialNum, int amount) {
 	int level = CLIP(getDialLevel(dialNum) + amount, 0, 100);
 	setDial(dialNum, level);
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index 77c7cce..cf53e66 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -99,8 +99,6 @@ public:
 	 * Sets a given dial to be pointing in a specified region (0 to 2)
 	 */
 	virtual void setDialRegion(int dialNum, int region);
-
-	virtual int proc36(int val) const;
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 3149439..7472111 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -72,11 +72,6 @@ ScriptChangedResult BellbotScript::scriptChanged(TTscriptBase *roomScript, uint
 	return SCR_1;
 }
 
-int BellbotScript::proc15() const {
-	warning("TODO");
-	return 0;
-}
-
 int BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
 	switch (tagId) {
@@ -402,9 +397,19 @@ int BellbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *ro
 	return 0;
 }
 
-int BellbotScript::proc36(int id) const {
-	warning("TODO");
-	return 0;
+bool BellbotScript::randomResponse(int index) {
+	if (getRandomNumber(100) > 10 || getRandomNumber(10) <= index)
+		return 0;
+
+	if (getRandomNumber(100) > 95) {
+		deleteResponses();
+		addResponse(getDialogueId(201695));
+		applyResponse();
+	} else {
+		setResponseFromArray(index, 201696);
+	}
+
+	return true;
 }
 
 int BellbotScript::addLocation() {
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 8b43e32..a006bb6 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -71,8 +71,6 @@ public:
 	 */
 	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
 
-	virtual int proc15() const;
-
 	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 
@@ -91,7 +89,10 @@ public:
 	 */
 	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
-	virtual int proc36(int val) const;
+	/**
+	 * Handles a randomzied response
+	 */
+	virtual bool randomResponse(int index);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index debd6ea..c06e138 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -38,7 +38,7 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 	CTrueTalkManager::setFlags(22, 0);
 
 	setupDials(0, 0, 0);
-	_array[0] = 100;
+	_data[0] = 100;
 	if (_currentDialNum == 1)
 		_currentDialNum = 0;
 
@@ -314,9 +314,19 @@ int DeskbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *ro
 	return 0;
 }
 
-int DeskbotScript::proc36(int id) const {
-	warning("TODO");
-	return 0;
+bool DeskbotScript::randomResponse(int index) {
+	if (getValue(1) == 1 || getRandomNumber(100) > 10 || getRandomNumber(2) <= index)
+		return 0;
+
+	if (getRandomNumber(100) > 95) {
+		deleteResponses();
+		addResponse(getDialogueId(241195));
+		applyResponse();
+	} else {
+		setResponseFromArray(index, 241193);
+	}
+
+	return true;
 }
 
 bool DeskbotScript::isDial0Medium() const {
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 7a09c28..02a1126 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -99,7 +99,10 @@ public:
 	 */
 	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
 
-	virtual int proc36(int val) const;
+	/**
+	 * Handles a randomzied response
+	 */
+	virtual bool randomResponse(int index);
 
 	/**
 	 * Returns true if dial 1 is the medium (1) region
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 8b83734..fa1078f 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -525,9 +525,41 @@ void DoorbotScript::setDialRegion(int dialNum, int region) {
 	}
 }
 
-int DoorbotScript::proc36(int id) const {
-	warning("TODO");
-	return 0;
+bool DoorbotScript::randomResponse(int index) {
+	static const int DIALOGUE_IDS[] = {
+		220133, 220074, 220000, 220008, 220009, 220010, 220011,
+		220012, 220013, 220014, 220015, 220016, 221053, 221054,
+		221055, 221056, 221057, 221058, 221059, 221060, 221061,
+		221173, 221174, 221175, 221176, 221177, 222415, 222416,
+		221157, 221165, 221166, 221167, 221168, 221169, 221170,
+		221171, 221172, 221158, 221159, 221356, 221364, 221365,
+		221366, 221367, 221368, 221369, 221370, 221371, 221357,
+		221358, 221359, 221360, 221252, 221019, 221355, 220952,
+		220996, 220916, 220924, 220926, 220931, 220948, 220956,
+		220965, 220967, 220968, 220980, 220981, 220982, 220983,
+		220984, 220988, 220903, 221095, 222202, 222239, 221758,
+		221759, 221762, 221763, 221766, 221767, 221768, 0
+	};
+
+	int *dataP = _data.getSlot(index);
+	bool flag = false;
+	for (const int *idP = DIALOGUE_IDS; *idP && !flag; ++idP) {
+		flag = *idP == *dataP;
+	}
+
+	if (flag || (getDialRegion(1) != 1 && getRandomNumber(100) > 33)
+			|| getRandomNumber(8) <= index)
+		return false;
+
+	if (getRandomNumber(100) > 40) {
+		deleteResponses();
+		addResponse(getDialogueId(221242));
+		applyResponse();
+	} else {
+		setResponseFromArray(index, 221245);
+	}
+
+	return true;
 }
 
 int DoorbotScript::setResponse(int dialogueId, int v34) {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 4c3c9ed..c84af8c 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -98,7 +98,10 @@ public:
 	 */
 	virtual void setDialRegion(int dialNum, int region);
 
-	virtual int proc36(int val) const;
+	/**
+	 * Handles a randomzied response
+	 */
+	virtual bool randomResponse(int index);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 3e9af65..dd32114 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -105,6 +105,16 @@ static const uint RANDOM9[] = {
 
 /*------------------------------------------------------------------------*/
 
+TTnpcData::TTnpcData() {
+	Common::fill(&_array[0], &_array[136], 0);
+}
+
+void TTnpcData::resetFlags() {
+	Common::fill(&_array[20], &_array[136], 0);
+}
+
+/*------------------------------------------------------------------------*/
+
 TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
 		const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
 		TTscriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
@@ -130,7 +140,6 @@ TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
 		_currentDialNum(0), _dialDelta(0), _field7C(0), _itemStringP(nullptr), _field2CC(false) {
 	CTrueTalkManager::_v2 = 0;
 	Common::fill(&_dialValues[0], &_dialValues[DIALS_ARRAY_COUNT], 0);
-	Common::fill(&_array[0], &_array[136], 0);
 
 	if (!CTrueTalkManager::_v10) {
 		Common::fill(&CTrueTalkManager::_v11[0], &CTrueTalkManager::_v11[41], 0);
@@ -178,7 +187,7 @@ void TTnpcScript::loadRanges(const char *name) {
 }
 
 void TTnpcScript::resetFlags() {
-	Common::fill(&_array[20], &_array[136], 0);
+	_data.resetFlags();
 	_field2CC = false;
 }
 
@@ -402,7 +411,7 @@ void TTnpcScript::save(SimpleFile *file) {
 	
 	file->writeNumber(10);
 	for (int idx = 0; idx < 10; ++idx)
-		file->writeNumber(_array[idx]);
+		file->writeNumber(_data[idx]);
 }
 
 void TTnpcScript::load(SimpleFile *file) {
@@ -421,7 +430,7 @@ void TTnpcScript::load(SimpleFile *file) {
 	for (int idx = 0; idx < count; ++idx) {
 		int v = file->readNumber();
 		if (idx < 10)
-			_array[idx] = v;
+			_data[idx] = v;
 	}
 }
 
@@ -533,8 +542,8 @@ int TTnpcScript::getDialLevel(uint dialNum, bool randomizeFlag) {
 	return result;
 }
 
-int TTnpcScript::proc36(int id) const {
-	return 0;
+bool TTnpcScript::randomResponse(int index) {
+	return false;
 }
 
 uint TTnpcScript::translateId(uint id) const {
@@ -624,7 +633,7 @@ uint TTnpcScript::getDialogueId(uint tagId) {
 		_field2CC = true;
 		int val = translateByArray(tagId);
 		if (val > 0) {
-			if (proc36(val))
+			if (randomResponse(val))
 				return 4;
 		}
 	}
@@ -651,28 +660,32 @@ uint TTnpcScript::getDialogueId(uint tagId) {
 	}
 	uint newVal = tableP->_values[oldTagId];
 
+	// First slot dialogue Ids
 	idx = 0;
-	int *arrP = &_array[26];
+	int *arrP = _data.getSlot(0);
 	while (idx < 4 && arrP[idx])
 		++idx;
+
 	if (idx == 4)
 		return newVal;
-
-	_array[26] = origId;
+	arrP[idx] = origId;
+	
+	// Second slot dialogue Ids
 	idx = 0;
-	arrP = &_array[30];
+	arrP = _data.getSlot(1);
 	while (idx < 4 && arrP[idx])
 		++idx;
+	
 	if (idx == 4)
 		return newVal;
-
 	arrP[idx] = newVal;
+
 	return newVal;
 }
 
 int TTnpcScript::translateByArray(int id) {
 	for (uint idx = 1, arrIndex = 35; idx < 15; ++idx, arrIndex += 8) {
-		if (_array[idx - 1] == id && _array[idx] == 0)
+		if (_data[idx - 1] == id && _data[idx] == 0)
 			return idx;
 	}
 
@@ -977,4 +990,24 @@ void TTnpcScript::getAssignedRoom(int *roomNum, int *floorNum, int *elevatorNum)
 		*elevatorNum = CLIP(*elevatorNum, 1, 4);
 }
 
+void TTnpcScript::setResponseFromArray(int index, int id) {
+	if (index >= 0 && index <= 15) {
+		deleteResponses();
+		if (id)
+			addResponse(getDialogueId(id));
+		
+		// Add any loaded responses
+		int *vals = _data.getSlot(index + 1);
+		for (int idx = 0; idx < 4; ++idx) {
+			if (vals[idx])
+				addResponse(vals[idx]);
+		}
+		applyResponse();
+
+		// Clear out the values used
+		if (index)
+			Common::fill(vals, vals + 4, 0);
+	}
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index e758cff..4f83f27 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -35,6 +35,16 @@ class CGameManager;
 class CPetControl;
 class TTroomScript;
 
+struct TTnpcData {
+private:
+	int _array[136];
+public:
+	TTnpcData();
+	int &operator[](int idx) { return _array[idx]; }
+	int *getSlot(int idx) { return &_array[16 + idx * 4]; }
+	void resetFlags();
+};
+
 class TTnpcScriptBase : public TTscriptBase {
 protected:
 	int _field54;
@@ -93,7 +103,7 @@ protected:
 	int _field7C;
 	const char *_itemStringP;
 	int _dialValues[DIALS_ARRAY_COUNT];
-	int _array[136];
+	TTnpcData _data;
 	bool _field2CC;
 protected:
 	/**
@@ -194,6 +204,11 @@ protected:
 	 * Gets the assigned room's room, floor, and elevator number
 	 */
 	void getAssignedRoom(int *roomNum, int *floorNum, int *elevatorNum) const;
+
+	/**
+	 * Uses a porition of the state _array to set up a new response
+	 */
+	void setResponseFromArray(int index, int id);
 public:
 	static void init();
 	static void deinit();
@@ -308,7 +323,11 @@ public:
 	 */
 	virtual int getDialLevel(uint dialNum, bool randomizeFlag = true);
 
-	virtual int proc36(int val) const;
+	/**
+	 * Handles a randomzied response
+	 */
+	virtual bool randomResponse(int index);
+	
 	virtual uint translateId(uint id) const;
 
 	void preLoad();


Commit: c3ba0badd1183e1f201c78690663e521b625196b
    https://github.com/scummvm/scummvm/commit/c3ba0badd1183e1f201c78690663e521b625196b
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-30T16:41:01-04:00

Commit Message:
TITANIC: Added BellbotScript preprocess

Changed paths:
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 7472111..9fbb492 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -397,7 +397,7 @@ int BellbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *ro
 	return 0;
 }
 
-bool BellbotScript::randomResponse(int index) {
+bool BellbotScript::randomResponse(uint index) {
 	if (getRandomNumber(100) > 10 || getRandomNumber(10) <= index)
 		return 0;
 
@@ -446,4 +446,815 @@ void BellbotScript::setValue23(uint id) {
 	CTrueTalkManager::setFlags(23, val);
 }
 
+int BellbotScript::preProcess(TTroomScript *roomScript, TTsentence *sentence) {
+	if (!roomScript || !sentence)
+		return true;
+
+	bool applyFlag = false, stateFlag = true;
+	switch (getValue(23)) {
+	case 1:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200818));
+			applyFlag = true;
+		}
+		if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(200817));
+			applyFlag = true;
+		}
+		break;
+
+	case 2:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200835));
+			addResponse(getDialogueId(200830));
+			applyFlag = true;
+		} else if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(200834));
+			addResponse(getDialogueId(200830));
+			applyFlag = true;
+		}
+		break;
+
+	case 3:
+		if (sentence->_field2C >= 11 && sentence->_field2C <= 13) {
+			addResponse(getDialogueId(200831));
+			addResponse(getDialogueId(200833));
+			applyFlag = true;
+		}
+		break;
+
+	case 4:
+		if (sentence->_field2C == 11) {
+			addResponse(getDialogueId(200872));
+			applyFlag = true;
+		}
+		if (sentence->_field2C == 12 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200873));
+			applyFlag = true;
+		}
+		break;
+	
+	case 5:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200492));
+			applyFlag = true;
+		}
+		if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(200491));
+			applyFlag = true;
+		}
+		break;
+
+	case 6:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200496));
+			applyResponse();
+			setState(0);
+			CTrueTalkManager::setFlags(23, 7);
+			return 2;
+		}
+		if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(200127));
+			applyFlag = true;
+		}
+		break;
+
+	case 7:
+		addResponse(getDialogueId(200504));
+		addResponse(getDialogueId(200496));
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 8:
+		addResponse(getDialogueId(200494));
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 9:
+		addResponse(getDialogueId(sentence->localWord("guess") ? 200495 : 200493));
+		applyFlag = true;
+		break;
+
+	case 10:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200317));
+			applyResponse();
+			setState(0);
+			CTrueTalkManager::setFlags(23, 11);
+			return 2;
+		}
+
+		addResponse(getDialogueId(sentence->_field2C == 12 ? 200316 : 200315));
+		applyFlag = true;
+		break;
+
+	case 11:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200055));
+		} else if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(200318));
+		} else {
+			addResponse(getDialogueId(200315));
+		}
+
+		applyFlag = true;
+		break;
+
+	case 12:
+		if (sentence->_field2C == 6) {
+			addResponse(getDialogueId(200259));
+			applyFlag = true;
+		}
+		break;
+
+	case 13:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200207));
+			applyFlag = true;
+		} else if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(200206));
+			applyFlag = true;
+		}
+		break;
+
+	case 14:
+		if (sentence->_field2C == 6) {
+			addResponse(getDialogueId(200349));
+			applyFlag = true;
+		}
+
+	case 15:
+		if (sentence->_field2C == 6) {
+			addResponse(getDialogueId(200130));
+			applyResponse();
+			setState(0);
+			CTrueTalkManager::setFlags(23, 16);
+			return 2;
+		}
+		break;
+
+	case 16:
+		if (sentence->localWord("invented")) {
+			addResponse(getDialogueId(200131));
+			applyFlag = true;
+		}
+		break;
+
+	case 17:
+		if ((sentence->_field2C == 3 && sentence->localWord("code"))
+				|| (sentence->localWord("which") && sentence->localWord("is"))
+				|| sentence->localWord("remember")
+				|| sentence->localWord("know")
+		) {
+			addResponse(getDialogueId(200044));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 19:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200223));
+			applyFlag = true;
+		}
+		break;
+
+	case 20:
+		addResponse(getDialogueId(200254));
+		applyFlag = true;
+		break;
+
+	case 21:
+		if (sentence->contains("hiker") || sentence->contains("hug")) {
+			addResponse(getDialogueId(200379));
+			applyFlag = true;
+		}
+		break;
+
+	case 22:
+		if (sentence->localWord("get") || sentence->localWord("it")) {
+			addResponse(getDialogueId(200474));
+			applyFlag = true;
+		}
+		break;
+
+	case 23:
+		addResponse(getDialogueId(sentence->localWord("long") ? 200870 : 200871));
+		applyFlag = true;
+		break;
+
+	case 24:
+		addResponse(getDialogueId(200793));
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 25:
+		if (sentence->localWord("parrot")) {
+			addResponse(getDialogueId(200255));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 26:
+		if (sentence->localWord("cage")) {
+			addResponse(getDialogueId(200380));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 27:
+		addResponse(getDialogueId(200347));
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 28:
+		if (sentence->localWord("perch")) {
+			addResponse(getDialogueId(200242));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 29:
+		if (sentence->localWord("brain") || sentence->localWord("titania")) {
+			addResponse(getDialogueId(200392));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 30:
+		if ((sentence->localWord("did") || sentence->localWord("not"))
+				|| (sentence->localWord("would") || sentence->localWord("not"))
+				|| (sentence->localWord("could") || sentence->localWord("not"))
+				|| sentence->localWord("tried")) {
+			addResponse(getDialogueId(200416));
+			applyFlag = true;
+		}
+		break;
+
+	case 31:
+		addResponse(getDialogueId(sentence->_field2C == 11 ? 200810 : 200811));
+		applyFlag = true;
+		break;
+
+	case 32:
+		addResponse(getDialogueId(sentence->_field2C == 11 ? 200810 : 200812));
+		applyFlag = true;
+		break;
+
+	case 33:
+		addResponse(getDialogueId(200822));
+		applyFlag = true;
+		break;
+
+	case 34:
+		addResponse(getDialogueId(200824));
+		applyFlag = true;
+		break;
+
+	case 35:
+		if (sentence->_field2C == 3 && sentence->localWord("it")
+				&& (sentence->localWord("for") || sentence->localWord("do"))) {
+			addResponse(getDialogueId(200768));
+			applyFlag = true;
+		}
+		break;
+
+	case 36:
+		if (sentence->_field2C == 11) {
+			CTrueTalkManager::triggerAction(14, 0);
+			addResponse(getDialogueId(200761));
+			applyFlag = true;
+		}
+		break;
+
+	case 37:
+		addResponse(getDialogueId(200630));
+		applyFlag = true;
+		break;
+
+	case 38:
+		if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(200631));
+			applyFlag = true;
+		}
+		break;
+
+	case 39:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200632));
+			stateFlag = false;
+		} else {
+			addResponse(getDialogueId(200633));
+		}
+		applyFlag = true;
+		break;
+
+	case 40:
+		addResponse(getDialogueId(200633));
+		applyFlag = true;
+		break;
+
+	case 41:
+		addResponse(getDialogueId(sentence->contains("42") ? 200139 : 200627));
+		applyFlag = true;
+		break;
+
+	case 42:
+		if ((sentence->localWord("carry") && sentence->localWord("on"))
+				|| (sentence->localWord("go") && sentence->localWord("on"))
+				|| sentence->localWord("more")
+				|| sentence->localWord("going")
+				|| sentence->localWord("elaborate")
+				|| sentence->localWord("suspicious")
+				|| sentence->localWord("they")) {
+			addResponse(getDialogueId(200642));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 43:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200643));
+			applyFlag = true;
+		}
+		break;
+
+	case 44:
+case44:
+		if (better(sentence, 200615, 200613)) {
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 45:
+		if (sentence->contains("surprise")) {
+			addResponse(getDialogueId(200614));
+			applyFlag = true;
+			stateFlag = false;
+			break;
+		}
+		goto case44;
+
+	case 46:
+		if (sentence->contains("good")) {
+			addResponse(getDialogueId(200616));
+			applyFlag = true;
+			stateFlag = false;
+			break;
+		}
+		goto case44;
+
+	case 47:
+		if (sentence->_field2C == 12)
+			addResponse(getDialogueId(200368));
+		addResponse(getDialogueId(200366));
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 48:
+		if ((sentence->localWord("carry") && sentence->localWord("on"))
+				|| sentence->localWord("more")
+				|| (sentence->localWord("go") && sentence->localWord("on"))
+				|| sentence->localWord("going")
+				|| sentence->localWord("yes")
+				|| sentence->localWord("really")) {
+			addResponse(getDialogueId(200367));
+			applyFlag = true;
+		}
+		break;
+
+	case 49:
+		if (sentence->_field2C >= 11 && sentence->_field2C <= 13) {
+			addResponse(getDialogueId(200407));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 50:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200408));
+			stateFlag = false;
+		} else {
+			addResponse(getDialogueId(200409));
+		}
+		applyFlag = true;
+		break;
+
+	case 51:
+		if (sentence->localWord("no") || sentence->localWord("it")
+				|| sentence->localWord("is") || sentence->localWord("not")
+				|| sentence->contains("yeah right")) {
+			addResponse(getDialogueId(200636));
+			applyFlag = true;
+		}
+		break;
+
+	case 52:
+		if (sentence->_field2C >= 11 && sentence->_field2C <= 13) {
+			addResponse(getDialogueId(200872));
+			applyFlag = true;
+		}
+		break;
+
+	case 53:
+		if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(200525));
+			applyFlag = true;
+		} else if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200526));
+			applyFlag = true;
+		}
+		break;
+
+	case 54:
+		if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(200095));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 55:
+		if (sentence->_field2C == 6) {
+			addResponse(getDialogueId(200112));
+			applyFlag = true;
+		}
+		break;
+
+	case 56:
+		if (sentence->localWord("sure")
+			|| (sentence->localWord("nothing") && sentence->localWord("else"))) {
+			addResponse(getDialogueId(200649));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 57:
+		if (sentence->localWord("bad")
+				|| (sentence->localWord("not") && sentence->localWord("good"))) {
+			addResponse(getDialogueId(200654));
+		} else {
+			addResponse(getDialogueId(200655));
+			stateFlag = false;
+		}
+		applyFlag = true;
+		break;
+
+	case 58:
+		if (sentence->localWord("more")
+				|| (sentence->localWord("go") && sentence->localWord("on"))
+				|| (sentence->_field2C == 11 && sentence->localWord("really"))) {
+			addResponse(getDialogueId(200650));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 59:
+		if (!sentence->localWord("shutup")) {
+			addResponse(getDialogueId(200651));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 60:
+		if (sentence->_field2C == 3 && sentence->localWord("they") && sentence->localWord("do")) {
+			addResponse(getDialogueId(200652));
+			applyFlag = true;
+stateFlag = false;
+		}
+		break;
+
+	case 61:
+		if ((sentence->localWord("that") && sentence->localWord("all"))
+			|| (sentence->localWord("anything") && sentence->localWord("else"))) {
+			addResponse(getDialogueId(200653));
+			applyFlag = true;
+		}
+		break;
+
+	case 62:
+		if (sentence->localWord("meant") || sentence->localWord("woman")) {
+			addResponse(getDialogueId(200743));
+			applyFlag = true;
+		}
+		break;
+
+	case 63:
+		addResponse(getDialogueId(200208));
+		applyFlag = true;
+		break;
+
+	case 64:
+		if (sentence->localWord("rowboat")) {
+			addResponse(getDialogueId(200052));
+			applyFlag = true;
+		}
+		break;
+
+	case 65:
+		if (sentence->localWord("sorry")) {
+			addResponse(getDialogueId(200056));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 66:
+		if (sentence->localWord("sorry")) {
+			addResponse(getDialogueId(200057));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 67:
+		if (sentence->localWord("sorry")) {
+			addResponse(getDialogueId(200055));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 68:
+		if ((sentence->localWord("i") && sentence->localWord("care"))
+			|| sentence->localWord("do")
+			|| sentence->localWord("me")) {
+			addResponse(getDialogueId(201006));
+			applyFlag = true;
+		}
+		break;
+
+	case 69:
+		if ((sentence->localWord("what") && sentence->localWord("happen"))
+			|| sentence->localWord("filigon")) {
+			addResponse(getDialogueId(201011));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 70:
+		if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(201012));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 71:
+		if (sentence->localWord("why")) {
+			addResponse(getDialogueId(201013));
+			applyFlag = true;
+		}
+		break;
+
+	case 72:
+		if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(200921));
+			applyFlag = true;
+		} else if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(200920));
+			applyFlag = true;
+		}
+		break;
+
+	case 73:
+		if (sentence->localWord("mood") && (charId() == 7 || charId() == 5)) {
+			addResponse(getDialogueId(201021));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 74:
+		if (sentence->_field2C == 6) {
+			addResponse(getDialogueId(201022));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 75:
+		if (sentence->_field2C == 3) {
+			if (sentence->localWord("that") || sentence->localWord("worb")) {
+				addResponse(getDialogueId(201802));
+				applyFlag = true;
+			}
+		}
+		break;
+
+	case 76:
+		if (sentence->_field2C == 2 && (sentence->localWord("that") || sentence->localWord("gat"))) {
+			addResponse(getDialogueId(201034));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 77:
+		if (sentence->_field2C == 4 || sentence->_field2C == 3) {
+			if (sentence->localWord("that") || sentence->localWord("blerontis")) {
+				addResponse(getDialogueId(201035));
+				applyFlag = true;
+			}
+		}
+		break;
+
+	case 78:
+		if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(201034));
+			applyFlag = true;
+			stateFlag = false;
+		} else if (sentence->_field2C == 11) {
+			addResponse(getDialogueId(201040));
+			applyFlag = true;
+		} else if ((sentence->localWord("not") && sentence->localWord("remember"))
+				|| sentence->localWord("forgot")) {
+			addResponse(getDialogueId(201041));
+			applyFlag = true;
+			stateFlag = false;
+		} else if (sentence->localWord("why")) {
+			addResponse(getDialogueId(201042));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 79:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(201052));
+			CTrueTalkManager::triggerAction(14, 0);
+			applyFlag = true;
+			stateFlag = false;
+		} else if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(202119));
+			addResponse(getDialogueId(200256));
+			applyFlag = true;
+		}
+		break;
+
+	case 80:
+		if ((!sentence->localWord("what") && sentence->localWord("how"))
+				|| sentence->localWord("about")
+				|| sentence->localWord("you")) {
+			if (sentence->_field2C != 3 && sentence->_field2C != 4 && sentence->_field2C != 7) {
+				addResponse(getDialogueId(201694));
+				applyFlag = true;
+				stateFlag = false;
+			}
+		} else {
+			addResponse(getDialogueId(201135));
+			applyFlag = true;
+		}
+		break;
+
+	case 81:
+		if ((!sentence->localWord("what") && !sentence->localWord("how"))
+				|| !sentence->localWord("about")
+				|| !sentence->localWord("you")) {
+			if (!sentence->localWord("and") || !sentence->localWord("yourself"))
+				break;
+		}
+		addResponse(getDialogueId(201135));
+		applyFlag = true;
+		break;
+
+	case 82:
+		if ((sentence->_field2C == 3 && sentence->localWord("mean"))
+				|| sentence->localWord("surf")
+				|| (sentence->localWord("what") && sentence->localWord("talk")
+					&& sentence->localWord("about"))) {
+			addResponse(getDialogueId(201694));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 83:
+		if (sentence->_field2C != 3 && sentence->_field2C != 4 && sentence->_field2C != 7) {
+			addResponse(getDialogueId(201083));
+			applyFlag = true;
+		}
+		break;
+
+	case 84:
+		if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(202119));
+			
+			switch (getValue(1)) {
+			case 1:
+				addResponse(getDialogueId(202024));
+				applyFlag = true;
+				break;
+			case 2:
+				addResponse(getDialogueId(201812));
+				applyFlag = true;
+				stateFlag = false;
+				break;
+			default:
+				break;
+			}
+		} else if (sentence->_field2C == 11) {
+			addResponse(getDialogueId(201060));
+			addResponse(getDialogueId(201079));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 85:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(201814));
+			applyFlag = true;
+		}
+		if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(201813));
+			applyFlag = true;
+		}
+		break;
+
+	case 86:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(202109));
+			applyFlag = true;
+		}
+		if (sentence->_field2C == 12) {
+			addResponse(getDialogueId(202108));
+			applyFlag = true;
+		}
+		break;
+
+	case 87:
+		if (better(sentence, 201993, 200720)) {
+			applyFlag = true;
+		}
+		break;
+
+	case 88:
+		if (sentence->_field2C == 6 || sentence->contains("upside down")) {
+			addResponse(getDialogueId(202142));
+			applyFlag = true;
+		}
+		break;
+
+	case 89:
+		if (sentence->_field2C == 2) {
+			addResponse(getDialogueId(200739));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 90:
+		if (sentence->contains("like") && (sentence->contains("slug") || sentence->contains("snail"))) {
+			addResponse(getDialogueId(201029));
+			applyFlag = true;
+			stateFlag = false;
+		} else if (sentence->contains("slime") || sentence->localWord("what")) {
+			addResponse(getDialogueId(201220));
+			applyFlag = true;
+			stateFlag = false;
+		}
+
+	default:
+		break;
+	}
+
+	if (applyFlag)
+		applyResponse();
+	if (stateFlag) {
+		setState(0);
+		CTrueTalkManager::setFlags(23, 0);
+	}
+
+	return applyFlag ? 2 : 1;
+}
+
+bool BellbotScript::better(TTsentence *sentence, uint id1, uint id2) {
+	if (sentence->contains("good") || sentence->localWord("better")) {
+		addResponse(getDialogueId(id1));
+	} else if (sentence->localWord("bad")) {
+		addResponse(getDialogueId(id2));
+	} else {
+		return false;
+	}
+
+	return true;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index a006bb6..d144b41 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -57,6 +57,16 @@ private:
 	 * Sets the state value 25 based on the passed Id
 	 */
 	void setValue23(uint id);
+
+	/**
+	 * Does preprocessing for the sentence
+	 */
+	int preProcess(TTroomScript *roomScript, TTsentence *sentence);
+
+	/**
+	 * Checks for good, better, or bad in the sentence
+	 */
+	bool better(TTsentence *sentence, uint id1, uint id2);
 public:
 	BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
@@ -92,7 +102,7 @@ public:
 	/**
 	 * Handles a randomzied response
 	 */
-	virtual bool randomResponse(int index);
+	virtual bool randomResponse(uint index);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index c06e138..4ac04c7 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -314,7 +314,7 @@ int DeskbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *ro
 	return 0;
 }
 
-bool DeskbotScript::randomResponse(int index) {
+bool DeskbotScript::randomResponse(uint index) {
 	if (getValue(1) == 1 || getRandomNumber(100) > 10 || getRandomNumber(2) <= index)
 		return 0;
 
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 02a1126..d8a181c 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -102,7 +102,7 @@ public:
 	/**
 	 * Handles a randomzied response
 	 */
-	virtual bool randomResponse(int index);
+	virtual bool randomResponse(uint index);
 
 	/**
 	 * Returns true if dial 1 is the medium (1) region
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index fa1078f..a9f1689 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -525,7 +525,7 @@ void DoorbotScript::setDialRegion(int dialNum, int region) {
 	}
 }
 
-bool DoorbotScript::randomResponse(int index) {
+bool DoorbotScript::randomResponse(uint index) {
 	static const int DIALOGUE_IDS[] = {
 		220133, 220074, 220000, 220008, 220009, 220010, 220011,
 		220012, 220013, 220014, 220015, 220016, 221053, 221054,
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index c84af8c..70cdfea 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -101,7 +101,7 @@ public:
 	/**
 	 * Handles a randomzied response
 	 */
-	virtual bool randomResponse(int index);
+	virtual bool randomResponse(uint index);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index dd32114..14da486 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -542,7 +542,7 @@ int TTnpcScript::getDialLevel(uint dialNum, bool randomizeFlag) {
 	return result;
 }
 
-bool TTnpcScript::randomResponse(int index) {
+bool TTnpcScript::randomResponse(uint index) {
 	return false;
 }
 
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 4f83f27..09fe470 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -326,7 +326,7 @@ public:
 	/**
 	 * Handles a randomzied response
 	 */
-	virtual bool randomResponse(int index);
+	virtual bool randomResponse(uint index);
 	
 	virtual uint translateId(uint id) const;
 


Commit: 6eca1801726de8e4c64c043eb16e89c64f72473e
    https://github.com/scummvm/scummvm/commit/6eca1801726de8e4c64c043eb16e89c64f72473e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-30T17:07:48-04:00

Commit Message:
DEVTOOLS: Compilation fix for create_titanic under gcc

Changed paths:
  A devtools/create_titanic/memorypool.cpp
  A devtools/create_titanic/memorypool.h
    devtools/create_titanic/hashmap.h
    devtools/create_titanic/str.cpp



diff --git a/devtools/create_titanic/hashmap.h b/devtools/create_titanic/hashmap.h
index d7ba100..c8691ae 100644
--- a/devtools/create_titanic/hashmap.h
+++ b/devtools/create_titanic/hashmap.h
@@ -50,7 +50,7 @@
 #endif
 
 #ifdef USE_HASHMAP_MEMORY_POOL
-#include "common/memorypool.h"
+#include "memorypool.h"
 #endif
 
 
diff --git a/devtools/create_titanic/memorypool.cpp b/devtools/create_titanic/memorypool.cpp
new file mode 100644
index 0000000..13c640b
--- /dev/null
+++ b/devtools/create_titanic/memorypool.cpp
@@ -0,0 +1,182 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "memorypool.h"
+#include "common/util.h"
+
+namespace Common {
+
+enum {
+	INITIAL_CHUNKS_PER_PAGE = 8
+};
+
+static size_t adjustChunkSize(size_t chunkSize) {
+	// You must at least fit the pointer in the node (technically unneeded considering the next rounding statement)
+	chunkSize = MAX(chunkSize, sizeof(void *));
+	// There might be an alignment problem on some platforms when trying to load a void* on a non natural boundary
+	// so we round to the next sizeof(void *)
+	chunkSize = (chunkSize + sizeof(void *) - 1) & (~(sizeof(void *) - 1));
+
+	return chunkSize;
+}
+
+
+MemoryPool::MemoryPool(size_t chunkSize)
+	: _chunkSize(adjustChunkSize(chunkSize)) {
+
+	_next = NULL;
+
+	_chunksPerPage = INITIAL_CHUNKS_PER_PAGE;
+}
+
+MemoryPool::~MemoryPool() {
+#if 0
+	freeUnusedPages();
+	if (!_pages.empty())
+		warning("Memory leak found in pool");
+#endif
+
+	for (size_t i = 0; i < _pages.size(); ++i)
+		::free(_pages[i].start);
+}
+
+void MemoryPool::allocPage() {
+	Page page;
+
+	// Allocate a new page
+	page.numChunks = _chunksPerPage;
+	assert(page.numChunks * _chunkSize < 16*1024*1024);	// Refuse to allocate pages bigger than 16 MB
+
+	page.start = ::malloc(page.numChunks * _chunkSize);
+	assert(page.start);
+	_pages.push_back(page);
+
+
+	// Next time, we'll allocate a page twice as big as this one.
+	_chunksPerPage *= 2;
+
+	// Add the page to the pool of free chunk
+	addPageToPool(page);
+}
+
+void MemoryPool::addPageToPool(const Page &page) {
+	// Add all chunks of the new page to the linked list (pool) of free chunks
+	void *current = page.start;
+	for (size_t i = 1; i < page.numChunks; ++i) {
+		void *next = (byte *)current + _chunkSize;
+		*(void **)current = next;
+
+		current = next;
+	}
+
+	// Last chunk points to the old _next
+	*(void **)current = _next;
+
+	// From now on, the first free chunk is the first chunk of the new page
+	_next = page.start;
+}
+
+void *MemoryPool::allocChunk() {
+	// No free chunks left? Allocate a new page
+	if (!_next)
+		allocPage();
+
+	assert(_next);
+	void *result = _next;
+	_next = *(void **)result;
+	return result;
+}
+
+void MemoryPool::freeChunk(void *ptr) {
+	// Add the chunk back to (the start of) the list of free chunks
+	*(void **)ptr = _next;
+	_next = ptr;
+}
+
+// Technically not compliant C++ to compare unrelated pointers. In practice...
+bool MemoryPool::isPointerInPage(void *ptr, const Page &page) {
+	return (ptr >= page.start) && (ptr < (char *)page.start + page.numChunks * _chunkSize);
+}
+
+void MemoryPool::freeUnusedPages() {
+	//std::sort(_pages.begin(), _pages.end());
+	Array<size_t> numberOfFreeChunksPerPage;
+	numberOfFreeChunksPerPage.resize(_pages.size());
+	for (size_t i = 0; i < numberOfFreeChunksPerPage.size(); ++i) {
+		numberOfFreeChunksPerPage[i] = 0;
+	}
+
+	// Compute for each page how many chunks in it are still in use.
+	void *iterator = _next;
+	while (iterator) {
+		// TODO: This should be a binary search (requiring us to keep _pages sorted)
+		for (size_t i = 0; i < _pages.size(); ++i) {
+			if (isPointerInPage(iterator, _pages[i])) {
+				++numberOfFreeChunksPerPage[i];
+				break;
+			}
+		}
+
+		iterator = *(void **)iterator;
+	}
+
+	// Free all pages which are not in use.
+	size_t freedPagesCount = 0;
+	for (size_t i = 0; i < _pages.size(); ++i)  {
+		if (numberOfFreeChunksPerPage[i] == _pages[i].numChunks) {
+			// Remove all chunks of this page from the list of free chunks
+			void **iter2 = &_next;
+			while (*iter2) {
+				if (isPointerInPage(*iter2, _pages[i]))
+					*iter2 = **(void ***)iter2;
+				else
+					iter2 = *(void ***)iter2;
+			}
+
+			::free(_pages[i].start);
+			++freedPagesCount;
+			_pages[i].start = NULL;
+		}
+	}
+
+//	debug("freed %d pages out of %d", (int)freedPagesCount, (int)_pages.size());
+
+	// Remove all now unused pages
+	size_t newSize = 0;
+	for (size_t i = 0; i < _pages.size(); ++i) {
+		if (_pages[i].start != NULL) {
+			if (newSize != i)
+				_pages[newSize] = _pages[i];
+			++newSize;
+		}
+	}
+	_pages.resize(newSize);
+
+	// Reset _chunksPerPage
+	_chunksPerPage = INITIAL_CHUNKS_PER_PAGE;
+	for (size_t i = 0; i < _pages.size(); ++i) {
+		if (_chunksPerPage < _pages[i].numChunks)
+			_chunksPerPage = _pages[i].numChunks;
+	}
+}
+
+} // End of namespace Common
diff --git a/devtools/create_titanic/memorypool.h b/devtools/create_titanic/memorypool.h
new file mode 100644
index 0000000..c8a8fc7
--- /dev/null
+++ b/devtools/create_titanic/memorypool.h
@@ -0,0 +1,162 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef COMMON_MEMORYPOOL_H
+#define COMMON_MEMORYPOOL_H
+
+#include "common/array.h"
+
+
+namespace Common {
+
+/**
+ * This class provides a pool of memory 'chunks' of identical size.
+ * The size of a chunk is determined when creating the memory pool.
+ *
+ * Using a memory pool may yield better performance and memory usage
+ * when allocating and deallocating many memory blocks of equal size.
+ * E.g. the Common::String class uses a memory pool for the refCount
+ * variables (each the size of an int) it allocates for each string
+ * instance.
+ */
+class MemoryPool {
+protected:
+	MemoryPool(const MemoryPool&);
+	MemoryPool& operator=(const MemoryPool&);
+
+	struct Page {
+		void *start;
+		size_t numChunks;
+	};
+
+	const size_t	_chunkSize;
+	Array<Page>		_pages;
+	void			*_next;
+	size_t			_chunksPerPage;
+
+	void	allocPage();
+	void	addPageToPool(const Page &page);
+	bool	isPointerInPage(void *ptr, const Page &page);
+
+public:
+	/**
+	 * Constructor for a memory pool with the given chunk size.
+	 * @param chunkSize		the chunk size of this memory pool
+	 */
+	explicit MemoryPool(size_t chunkSize);
+	~MemoryPool();
+
+	/**
+	 * Allocate a new chunk from the memory pool.
+	 */
+	void	*allocChunk();
+	/**
+	 * Return a chunk to the memory pool. The given pointer must have
+	 * been obtained from calling the allocChunk() method of the very
+	 * same MemoryPool instance. Passing any other pointer (e.g. to
+	 * a chunk from another MemoryPool, or a malloc'ed memory block)
+	 * will lead to undefined behavior and may result in a crash (if
+	 * you are lucky) or in silent data corruption.
+	 */
+	void	freeChunk(void *ptr);
+
+	/**
+	 * Perform garbage collection. The memory pool stores all the
+	 * chunks it manages in memory 'pages' obtained via the classic
+	 * memory allocation APIs (i.e. malloc/free). Ordinarily, once
+	 * a page has been allocated, it won't be released again during
+	 * the life time of the memory pool. The exception is when this
+	 * method is called.
+	 */
+	void	freeUnusedPages();
+
+	/**
+	 * Return the chunk size used by this memory pool.
+	 */
+	size_t	getChunkSize() const { return _chunkSize; }
+};
+
+/**
+ * This is a memory pool which already contains in itself some storage
+ * space for a fixed number of chunks. Thus if the memory pool is only
+ * lightly used, no malloc() calls have to be made at all.
+ */
+template<size_t CHUNK_SIZE, size_t NUM_INTERNAL_CHUNKS = 32>
+class FixedSizeMemoryPool : public MemoryPool {
+private:
+	enum {
+		REAL_CHUNK_SIZE = (CHUNK_SIZE + sizeof(void *) - 1) & (~(sizeof(void *) - 1))
+	};
+
+	byte	_storage[NUM_INTERNAL_CHUNKS * REAL_CHUNK_SIZE];
+public:
+	FixedSizeMemoryPool() : MemoryPool(CHUNK_SIZE) {
+		assert(REAL_CHUNK_SIZE == _chunkSize);
+		// Insert some static storage
+		Page internalPage = { _storage, NUM_INTERNAL_CHUNKS };
+		addPageToPool(internalPage);
+	}
+};
+
+// Ensure NUM_INTERNAL_CHUNKS == 0 results in a compile error
+template<size_t CHUNK_SIZE>
+class FixedSizeMemoryPool<CHUNK_SIZE,0> : public MemoryPool {
+public:
+	FixedSizeMemoryPool() : MemoryPool(CHUNK_SIZE) {}
+};
+
+/**
+ * A memory pool for C++ objects.
+ */
+template<class T, size_t NUM_INTERNAL_CHUNKS = 32>
+class ObjectPool : public FixedSizeMemoryPool<sizeof(T), NUM_INTERNAL_CHUNKS> {
+public:
+	/**
+	 * Return the memory chunk used as storage for the given object back
+	 * to the pool, after calling its destructor.
+	 */
+	void deleteChunk(T *ptr) {
+		ptr->~T();
+		this->freeChunk(ptr);
+	}
+};
+
+} // End of namespace Common
+
+/**
+ * A custom placement new operator, using an arbitrary MemoryPool.
+ *
+ * This *should* work with all C++ implementations, but may not.
+ *
+ * For details on using placement new for custom allocators, see e.g.
+ * <http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.14>
+ */
+inline void *operator new(size_t nbytes, Common::MemoryPool &pool) {
+	assert(nbytes <= pool.getChunkSize());
+	return pool.allocChunk();
+}
+
+inline void operator delete(void *p, Common::MemoryPool &pool) {
+	pool.freeChunk(p);
+}
+
+#endif
diff --git a/devtools/create_titanic/str.cpp b/devtools/create_titanic/str.cpp
index 14a6e50..6aa66d0 100644
--- a/devtools/create_titanic/str.cpp
+++ b/devtools/create_titanic/str.cpp
@@ -22,7 +22,7 @@
 
 #include "common/hash-str.h"
 #include "common/list.h"
-#include "common/memorypool.h"
+#include "memorypool.h"
 #include "common/str.h"
 #include "common/util.h"
 


Commit: 6dbbb173bd7738ff725eefbd12923699d1663392
    https://github.com/scummvm/scummvm/commit/6dbbb173bd7738ff725eefbd12923699d1663392
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-30T17:39:09-04:00

Commit Message:
TITANIC: Fix identified warnings

Changed paths:
    engines/titanic/core/link_item.cpp
    engines/titanic/sound/sound_manager.cpp
    engines/titanic/sound/sound_manager.h
    engines/titanic/support/simple_file.cpp
    engines/titanic/support/simple_file.h



diff --git a/engines/titanic/core/link_item.cpp b/engines/titanic/core/link_item.cpp
index 1102184..f77d081 100644
--- a/engines/titanic/core/link_item.cpp
+++ b/engines/titanic/core/link_item.cpp
@@ -50,24 +50,24 @@ CString CLinkItem::formName() {
 	switch (_linkMode) {
 	case 1:
 		return CString::format("_PANL,%d,%s,%s", node->_nodeNumber,
-			view->getName(), destView->getName());
+			view->getName().c_str(), destView->getName().c_str());
 
 	case 2:
 		return CString::format("_PANR,%d,%s,%s", node->_nodeNumber,
-			view->getName(), destView->getName());
+			view->getName().c_str(), destView->getName().c_str());
 
 	case 3:
 		return CString::format("_TRACK,%d,%s,%d,%s", 
-			node->_nodeNumber, view->getName(), 
-			destNode->_nodeNumber, destView->getName());
+			node->_nodeNumber, view->getName().c_str(), 
+			destNode->_nodeNumber, destView->getName().c_str());
 
 	case 4:
 		return CString::format("_EXIT,%d,%d,%s,%d,%d,%s",
-			room->_roomNumber, node->_nodeNumber, view->getName(),
-			destRoom->_roomNumber, destNode->_nodeNumber, destView->getName());
+			room->_roomNumber, node->_nodeNumber, view->getName().c_str(),
+			destRoom->_roomNumber, destNode->_nodeNumber, destView->getName().c_str());
 
 	default:
-		return getName();
+		return getName().c_str();
 	}
 }
 
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index 440d74a..1cafe3b 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -39,12 +39,12 @@ int QSoundManager::loadSound(const CString &name) {
 	return 0;
 }
 
-int QSoundManager::proc4() {
+int QSoundManager::proc4() const {
 	warning("TODO");
 	return 0;
 }
 
-int QSoundManager::proc5() {
+int QSoundManager::proc5() const {
 	warning("TODO");
 	return 0;
 }
@@ -91,7 +91,7 @@ bool QSoundManager::isActive(int handle) const {
 	return false;
 }
 
-int QSoundManager::proc16() {
+int QSoundManager::proc16() const {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index 942124e..a65162d 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -119,8 +119,8 @@ public:
 	 */
 	virtual int loadSound(const CString &name);
 
-	virtual int proc4();
-	virtual int proc5();
+	virtual int proc4() const;
+	virtual int proc5() const;
 	virtual void proc6();
 	virtual void proc7();
 	virtual void proc8(int v);
@@ -131,7 +131,7 @@ public:
 	virtual void proc13();
 	virtual bool proc14();
 	virtual bool isActive(int handle) const;
-	virtual int proc16();
+	virtual int proc16() const;
 	virtual void WaveMixPump();
 
 	
diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp
index e60b7c7..35b2e28 100644
--- a/engines/titanic/support/simple_file.cpp
+++ b/engines/titanic/support/simple_file.cpp
@@ -36,9 +36,9 @@ CString readStringFromStream(Common::SeekableReadStream *s) {
 
 /*------------------------------------------------------------------------*/
 
-bool File::open(const Common::String &name) {
-	if (!Common::File::open(name))
-		error("Could not open file - %s", name.c_str());
+bool File::open(const Common::String &filename) {
+	if (!Common::File::open(filename))
+		error("Could not open file - %s", filename.c_str());
 	return true;
 }
 
@@ -466,8 +466,9 @@ void SimpleFile::skipSpaces() {
 
 /*------------------------------------------------------------------------*/
 
-void StdCWadFile::open(const CString &name) {
+bool StdCWadFile::open(const Common::String &filename) {
 	File f;
+	CString name = filename;
 
 	// Check for whether it is indeed a file/resource pair
 	int idx = name.indexOf('#');
@@ -478,17 +479,17 @@ void StdCWadFile::open(const CString &name) {
 		f.open(name);
 
 		SimpleFile::open(f.readStream(f.size()));
-		return;
+		return true;
 	}
 
 	// Split up the name and resource, and get the resource index
-	CString filename = name.left(idx) + ".st";
+	CString fname = name.left(idx) + ".st";
 	int extPos = name.lastIndexOf('.');
 	CString resStr = name.mid(idx + 1, extPos - idx - 1);
 	int resIndex = resStr.readInt();
 
 	// Open up the index for access 
-	f.open(filename);
+	f.open(fname);
 	int indexSize = f.readUint32LE() / 4;
 	assert(resIndex < indexSize);
 
@@ -505,6 +506,7 @@ void StdCWadFile::open(const CString &name) {
 	SimpleFile::open(stream);
 
 	f.close();
+	return true;
 }
 
 } // End of namespace Titanic
diff --git a/engines/titanic/support/simple_file.h b/engines/titanic/support/simple_file.h
index 0cfb424..6cf9995 100644
--- a/engines/titanic/support/simple_file.h
+++ b/engines/titanic/support/simple_file.h
@@ -41,7 +41,7 @@ class DecompressorData;
  */
 class File : public Common::File {
 public:
-	virtual bool open(const Common::String &name);
+	virtual bool open(const Common::String &filename);
 };
 
 /**
@@ -293,7 +293,7 @@ public:
 	/**
 	 * Open up the specified file
 	 */
-	void open(const CString &name);
+	virtual bool open(const Common::String &filename);
 
 	/**
 	 * Return a reference to the read stream


Commit: 01910f32f091debc62a8151b3bbde919d95d3fb3
    https://github.com/scummvm/scummvm/commit/01910f32f091debc62a8151b3bbde919d95d3fb3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-30T17:45:50-04:00

Commit Message:
TITANIC: Fix identified warnings

Changed paths:
    engines/titanic/pet_control/pet_control.cpp
    engines/titanic/pet_control/pet_control.h
    engines/titanic/pet_control/pet_conversations.cpp
    engines/titanic/pet_control/pet_conversations.h
    engines/titanic/pet_control/pet_inventory.cpp
    engines/titanic/pet_control/pet_inventory.h
    engines/titanic/pet_control/pet_rooms.cpp
    engines/titanic/pet_control/pet_rooms.h



diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 8308145..b32a790 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -142,7 +142,7 @@ void CPetControl::draw(CScreenManager *screenManager) {
 	}
 }
 
-Rect CPetControl::getBounds() {
+Rect CPetControl::getBounds() const {
 	return _sections[_currentArea]->getBounds();
 }
 
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 362fc11..ef7e49d 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -143,7 +143,7 @@ public:
 	/**
 	 * Gets the bounds occupied by the item
 	 */
-	virtual Rect getBounds();
+	virtual Rect getBounds() const;
 
 	/**
 	 * Setups the sections within the PET
diff --git a/engines/titanic/pet_control/pet_conversations.cpp b/engines/titanic/pet_control/pet_conversations.cpp
index 0a8a71b..9bae8e7 100644
--- a/engines/titanic/pet_control/pet_conversations.cpp
+++ b/engines/titanic/pet_control/pet_conversations.cpp
@@ -130,7 +130,7 @@ void CPetConversations::draw(CScreenManager *screenManager) {
 		_npcIcons[_npcNum].draw(screenManager);
 }
 
-Rect CPetConversations::getBounds() {
+Rect CPetConversations::getBounds() const {
 	Rect rect = _dials[0].getBounds();
 	rect.combine(_dials[1].getBounds());
 	rect.combine(_dials[2].getBounds());
diff --git a/engines/titanic/pet_control/pet_conversations.h b/engines/titanic/pet_control/pet_conversations.h
index 62cddd4..9e8b093 100644
--- a/engines/titanic/pet_control/pet_conversations.h
+++ b/engines/titanic/pet_control/pet_conversations.h
@@ -160,7 +160,7 @@ public:
 	/**
 	 * Get the bounds for the section
 	 */
-	virtual Rect getBounds();
+	virtual Rect getBounds() const;
 	
 	/**
 	 * Returns true if the object is in a valid state
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 2f8125c..2fb60bf 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -53,7 +53,7 @@ void CPetInventory::draw(CScreenManager *screenManager) {
 	_text.draw(screenManager);
 }
 
-Rect CPetInventory::getBounds() { 
+Rect CPetInventory::getBounds() const { 
 	return _movie ? _movie->getBounds() : Rect();
 }
 
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 9e074dd..1764954 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -79,7 +79,7 @@ public:
 	/**
 	 * Get the bounds for the section
 	 */
-	virtual Rect getBounds();
+	virtual Rect getBounds() const;
 	
 	/**
 	 * Called when a general change occurs
diff --git a/engines/titanic/pet_control/pet_rooms.cpp b/engines/titanic/pet_control/pet_rooms.cpp
index 2d73113..dfaa040 100644
--- a/engines/titanic/pet_control/pet_rooms.cpp
+++ b/engines/titanic/pet_control/pet_rooms.cpp
@@ -172,7 +172,7 @@ CPetText *CPetRooms::getText() {
 	return &_text;
 }
 
-CGameObject *CPetRooms::getBackground(int index) {
+CGameObject *CPetRooms::getBackground(int index) const {
 	switch (index) {
 	case 8:
 		return _chevLeftOnDim;
diff --git a/engines/titanic/pet_control/pet_rooms.h b/engines/titanic/pet_control/pet_rooms.h
index b82b42c..ba33560 100644
--- a/engines/titanic/pet_control/pet_rooms.h
+++ b/engines/titanic/pet_control/pet_rooms.h
@@ -145,7 +145,7 @@ public:
 	/**
 	 * Special retrieval of glyph background image
 	 */
-	virtual CGameObject *getBackground(int index);
+	virtual CGameObject *getBackground(int index) const;
 
 	/**
 	 * Reset the highlight


Commit: d9435e538f3b06e4e51b414076134126ae498e72
    https://github.com/scummvm/scummvm/commit/d9435e538f3b06e4e51b414076134126ae498e72
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-30T20:02:52-04:00

Commit Message:
TITANIC: Added BellbotScript process

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/script_handler.cpp
    engines/titanic/true_talk/tt_script_base.cpp
    engines/titanic/true_talk/tt_script_base.h



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index cffbf3c..afed200 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -55,7 +55,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0x900
+#define HEADER_SIZE 0xB00
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -565,6 +565,26 @@ void writeData() {
 	writeSentenceEntries("Sentences/Barbot", 0x5ABE60);
 	writeSentenceEntries("Sentences/Barbot2", 0x5BD4E8);
 	writeSentenceEntries("Sentences/Bellbot", 0x5C2230);
+	writeSentenceEntries("Sentences/Bellbot/1", 0x5D1670);
+	writeSentenceEntries("Sentences/Bellbot/2", 0x5D1A80);
+	writeSentenceEntries("Sentences/Bellbot/3", 0x5D1AE8);
+	writeSentenceEntries("Sentences/Bellbot/4", 0x5D1B88);
+	writeSentenceEntries("Sentences/Bellbot/5", 0x5D2A60);
+	writeSentenceEntries("Sentences/Bellbot/6", 0x5D2CD0);
+	writeSentenceEntries("Sentences/Bellbot/7", 0x5D3488);
+	writeSentenceEntries("Sentences/Bellbot/8", 0x5D3900);
+	writeSentenceEntries("Sentences/Bellbot/9", 0x5D3968);
+	writeSentenceEntries("Sentences/Bellbot/10", 0x5D4668);
+	writeSentenceEntries("Sentences/Bellbot/11", 0x5D47A0);
+	writeSentenceEntries("Sentences/Bellbot/12", 0x5D4EC0);
+	writeSentenceEntries("Sentences/Bellbot/13", 0x5D5100);
+	writeSentenceEntries("Sentences/Bellbot/14", 0x5D5370);
+	writeSentenceEntries("Sentences/Bellbot/15", 0x5D5548);
+	writeSentenceEntries("Sentences/Bellbot/16", 0x5D56B8);
+	writeSentenceEntries("Sentences/Bellbot/17", 0x5D57C0);
+	writeSentenceEntries("Sentences/Bellbot/18", 0x5D5B38);
+	writeSentenceEntries("Sentences/Bellbot/19", 0x5D61B8);
+
 	writeSentenceEntries("Sentences/Deskbot", 0x5DCD10);
 	writeSentenceEntries("Sentences/Doorbot", 0x5EC110);
 	writeSentenceEntries("Sentences/Liftbot", 0x6026B0);
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 9fbb492..8f465b90 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -57,14 +57,279 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 void BellbotScript::setupSentences() {
 	_mappings.load("Mappings/Bellbot", 1);
 	_entries.load("Sentences/Bellbot");
+	for (int idx = 1; idx < 20; ++idx)
+		_sentences[idx].load(CString::format("Sentences/Bellbot/%d", idx));
+
 	_field2DC = 0;
 	_field68 = 0;
 	_entryCount = 0;
 }
 
 int BellbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
-	// TODO
-	return 0;
+	int val24 = getValue(24);
+	CTrueTalkManager::setFlags(24, 0);
+
+	int result = preprocess(roomScript, sentence);
+	if (result != 1)
+		return 1;
+
+	CTrueTalkManager::setFlags(23, 0);
+	setState(0);
+	if (getValue(1) <= 2)
+		updateCurrentDial(1);
+
+	// Handle room specific sentences
+	switch (roomScript->_scriptId) {
+	case 101:
+		if (getValue(2) == 1) {
+			result = processEntries(&_sentences[11], 0, roomScript, sentence);
+		}
+		break;
+
+	case 107:
+		result = processEntries(&_sentences[5], 0, roomScript, sentence);
+		break;
+
+	case 108:
+		result = processEntries(&_sentences[7], 0, roomScript, sentence);
+		break;
+
+	case 109:
+		result = processEntries(&_sentences[13], 0, roomScript, sentence);
+		break;
+
+	case 110:
+		result = processEntries(&_sentences[16], 0, roomScript, sentence);
+		break;
+
+	case 111:
+		result = processEntries(&_sentences[10], 0, roomScript, sentence);
+		break;
+
+	case 112:
+		result = processEntries(&_sentences[15], 0, roomScript, sentence);
+		break;
+
+	case 113:
+		result = processEntries(&_sentences[9], 0, roomScript, sentence);
+		break;
+
+	case 114:
+		result = processEntries(&_sentences[18], 0, roomScript, sentence);
+		break;
+
+	case 115:
+		result = processEntries(&_sentences[12], 0, roomScript, sentence);
+		break;
+
+	case 116:
+		result = processEntries(&_sentences[8], 0, roomScript, sentence);
+		break;
+
+	case 117:
+		result = processEntries(&_sentences[6], 0, roomScript, sentence);
+		break;
+
+	case 123:
+		result = processEntries(&_sentences[17], 0, roomScript, sentence);
+		break;
+
+	case 125:
+		result = processEntries(&_sentences[14], 0, roomScript, sentence);
+		break;
+
+	case 131:
+		if (getValue(26) == 0) {
+			result = processEntries(&_sentences[getValue(6) ? 5 : 4], 0, roomScript, sentence);
+		}
+		break;
+	}
+
+	if (result == 2)
+		return 2;
+	if (sentence->contains("pretend you summoned yourself") ||
+		sentence->contains("pretend you just summoned yourself")) {
+		if (scriptChanged(roomScript, 157) == 2)
+			return 2;
+	}
+
+	if (sentence->localWord("television") || roomScript->_scriptId == 111) {
+		if (sentence->localWord("drop") || sentence->localWord("throw")
+			|| sentence->localWord("smash") || sentence->localWord("destroy")
+			|| sentence->localWord("toss") || sentence->localWord("put")
+			|| sentence->localWord("pitch") || sentence->localWord("heft")) {
+			if (getValue(40) == 1) {
+				addResponse(getDialogueId(201687));
+				applyResponse();
+				return 2;
+			}
+			else if (roomScript->_scriptId == 111) {
+				addResponse(getDialogueId(201687));
+				applyResponse();
+				CTrueTalkManager::triggerAction(17, 0);
+				CTrueTalkManager::setFlags(40, 1);
+				return 2;
+			}
+			else {
+				addResponse(getDialogueId(200710));
+				addResponse(getDialogueId(201334));
+				applyResponse();
+				return 2;
+			}
+		}
+	}
+
+	if (sentence->contains("what should i do here")
+		|| sentence->contains("what do i do here")
+		|| sentence->contains("what shall i do in here")
+		|| sentence->contains("what shall i do in this room")
+		|| sentence->contains("what should i do in this room")
+		|| sentence->contains("what am i supposed to do in here")
+		|| sentence->contains("what should i do in here")
+		|| sentence->contains("what do i do in this room")) {
+		if (randomResponse4(roomScript)) {
+			applyResponse();
+			return 2;
+		}
+	}
+
+	if (sentence->contains("help")
+			|| sentence->contains("what now")
+			|| sentence->contains("what next")
+			|| sentence->contains("give me a hint")
+			|| sentence->contains("i need a hint")
+			|| sentence->contains("what should i be doing")
+			|| sentence->contains("what do you reckon i should do now")
+			|| sentence->contains("what shall i do")
+			|| sentence->contains("what would you do")
+			|| sentence->contains("what should i do")
+			|| sentence->contains("what do i do")) {
+		if (getDialRegion(0) == 1) {
+			randomResponse5(roomScript, getValue(1));
+			applyResponse();
+			return 2;
+		} else {
+			randomResponse3(roomScript, getValue(1));
+		}
+	}
+
+	if (sentence->get58() > 6 && sentence->contains("please")) {
+		addResponse(getDialogueId(200432));
+		applyResponse();
+		return 2;
+	}
+
+	if (checkCommonSentences(roomScript, sentence) == 2)
+		return 2;
+
+	// WORKAROUND: Skip processEntries call on unassigned sentence array
+
+	// Standard sentence list
+	if (processEntries(&_entries, _entryCount, roomScript, sentence) == 2)
+		return 2;
+
+	if ((sentence->_field2C == 4 && sentence->localWord("am") && sentence->localWord("i"))
+			|| (sentence->localWord("are") && sentence->localWord("we"))
+			|| (sentence->_field2C == 3 && sentence->localWord("room")
+					&& sentence->localWord("we") && sentence->localWord("in"))
+			|| (sentence->_field2C == 3 && sentence->localWord("rom")
+					&& sentence->localWord("is") && sentence->localWord("this"))
+			) { 
+		uint id = getRangeValue(getRoomDialogueId(roomScript));
+		addResponse(getDialogueId(id ? id : 201384));
+		applyResponse();
+		return 2;
+	}
+
+	if (getValue(1) >= 3) {
+		result = processEntries(&_sentences[1], 0, roomScript, sentence);
+	} else if (getValue(1) == 2) {
+		result = processEntries(&_sentences[2], 0, roomScript, sentence);
+	} else if (getValue(1) == 1) {
+		result = processEntries(&_sentences[3], 0, roomScript, sentence);
+		
+		if (sentence->contains("shrinkbot")) {
+			addResponse(getDialogueId(200583));
+			applyResponse();
+			return 2;
+		}
+	}
+
+	if (sentence->localWord("television") || sentence->localWord("tv")
+			|| sentence->localWord("crush") || sentence->localWord("crushed")) {
+		if (roomScript->_scriptId == 111 || getRandomBit()) {
+			addResponse(getDialogueId(getRandomBit() ? 200912 : 200913));
+		} else {
+			addResponse(getDialogueId(200710));
+			addResponse(getDialogueId(201334));
+		}
+
+		applyResponse();
+		return 2;
+	}
+
+	if (checkCommonWords(roomScript, sentence)) {
+		applyResponse();
+		setState(0);
+		return 2;
+	}
+
+	if (sentence->contains("my") && (sentence->contains("where can i find")
+			|| sentence->contains("where is")
+			|| sentence->contains("wheres")
+			|| sentence->contains("help me find")
+			|| sentence->contains("what have you done with")
+			|| sentence->contains("have you got")
+			|| sentence->contains("id like")
+			|| sentence->contains("i would like")
+			|| sentence->contains("have you seen")
+			)) {
+		addResponse(getDialogueId(200799));
+		applyResponse();
+		return 2;
+	}
+
+	setupSentences();
+	uint tagId = g_vm->_trueTalkManager->_quotes.find(sentence->_normalizedLine);
+	if (tagId && chooseResponse(roomScript, sentence, tagId) == 2)
+		return 2;
+	if (defaultProcess(roomScript, sentence))
+		return 2;
+	if (!processEntries(&_sentences[19], 0, roomScript, sentence))
+		return 2;
+	if (!processEntries(_defaultEntries, 0, roomScript, sentence))
+		return 2;
+
+	if (sentence->contains("42")) {
+		addResponse(getDialogueId(200515));
+		applyResponse();
+		return 2;
+	}
+
+	CTrueTalkManager::setFlags(24, val24 + 1);
+	if (getValue(24) > 3) {
+		addResponse(getDialogueId(200200));
+		applyResponse();
+		return 2;
+	}
+
+	if (sentence->localWord("get")) {
+		addResponse(getDialogueId(200475));
+		applyResponse();
+		return 2;
+	}
+
+	if (getRandomNumber(100) <= 75) {
+		addResponse(getDialogueId(200060));
+		applyResponse();
+		return 2;
+	}
+
+	addResponse(getDialogueId(200140));
+	addResponse(getDialogueId(getRandomBit() ? 200192 : 200157));
+	addResponse(getDialogueId(200176));
+	applyResponse();
+	return 2;
 }
 
 ScriptChangedResult BellbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
@@ -446,7 +711,7 @@ void BellbotScript::setValue23(uint id) {
 	CTrueTalkManager::setFlags(23, val);
 }
 
-int BellbotScript::preProcess(TTroomScript *roomScript, TTsentence *sentence) {
+int BellbotScript::preprocess(TTroomScript *roomScript, TTsentence *sentence) {
 	if (!roomScript || !sentence)
 		return true;
 
@@ -1257,4 +1522,44 @@ bool BellbotScript::better(TTsentence *sentence, uint id1, uint id2) {
 	return true;
 }
 
+bool BellbotScript::randomResponse1(TTroomScript *roomScript, uint id) {
+	// TODO
+	return false;
+}
+
+bool BellbotScript::randomResponse2(TTroomScript *roomScript, uint id) {
+	// TODO
+	return false;
+}
+
+bool BellbotScript::randomResponse3(TTroomScript *roomScript, uint id) {
+	// TODO
+	return false;
+}
+
+bool BellbotScript::randomResponse4(TTroomScript *roomScript) {
+	// TODO
+	return false;
+}
+
+bool BellbotScript::randomResponse5(TTroomScript *roomScript, uint id) {
+	// TODO
+	return false;
+}
+
+int BellbotScript::checkCommonSentences(TTroomScript *roomScript, TTsentence *sentence) {
+	// TODO
+	return 0;
+}
+
+int BellbotScript::checkCommonWords(TTroomScript *roomScript, TTsentence *sentence) {
+	// TODO
+	return 0;
+}
+
+int BellbotScript::getRoomDialogueId(TTroomScript *roomScript) {
+	// TODO
+	return 0;
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index d144b41..4fe850b 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -32,6 +32,7 @@ private:
 	static uint _oldId;
 	TTmapEntryArray _states;
 	TTmapEntryArray _preResponses;
+	TTsentenceEntries _sentences[20];
 	int _array[150];
 	int _field2D0;
 	int _field2D4;
@@ -61,12 +62,24 @@ private:
 	/**
 	 * Does preprocessing for the sentence
 	 */
-	int preProcess(TTroomScript *roomScript, TTsentence *sentence);
+	int preprocess(TTroomScript *roomScript, TTsentence *sentence);
 
 	/**
 	 * Checks for good, better, or bad in the sentence
 	 */
 	bool better(TTsentence *sentence, uint id1, uint id2);
+
+	bool randomResponse1(TTroomScript *roomScript, uint id);
+	bool randomResponse2(TTroomScript *roomScript, uint id);
+	bool randomResponse3(TTroomScript *roomScript, uint id);
+	bool randomResponse4(TTroomScript *roomScript);
+	bool randomResponse5(TTroomScript *roomScript, uint id);
+
+	int checkCommonSentences(TTroomScript *roomScript, TTsentence *sentence);
+	int checkCommonWords(TTroomScript *roomScript, TTsentence *sentence);
+
+	int getRoomDialogueId(TTroomScript *roomScript);
+
 public:
 	BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 51e88ec..64e789a 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -83,8 +83,8 @@ int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScrip
 	
 	TTsentence *sentence = new TTsentence(_inputCtr++, line, this, roomScript, npcScript);
 	int result = _parser.preprocess(sentence);
-	roomScript->preprocess(sentence);
-	npcScript->preprocess(sentence);
+	roomScript->scriptPreprocess(sentence);
+	npcScript->scriptPreprocess(sentence);
 
 	int canProcess = 0;
 	if (result) {
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index e96f877..4109134 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -87,7 +87,7 @@ void TTscriptBase::reset() {
 	_oldResponseP = nullptr;
 }
 
-int TTscriptBase::preprocess(TTsentence *sentence) {
+int TTscriptBase::scriptPreprocess(TTsentence *sentence) {
 	delete _hist1P;
 	_hist1P = new TTscriptHist(sentence);
 
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index 3060602..3377aaa 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -121,7 +121,7 @@ public:
 	/**
 	 * Gets passed a newly created input wrapper during conversation text processing
 	 */
-	int preprocess(TTsentence *sentence);
+	int scriptPreprocess(TTsentence *sentence);
 
 };
 


Commit: cf63ceeb3c8e0b32b08e01186fe741bd42653c7e
    https://github.com/scummvm/scummvm/commit/cf63ceeb3c8e0b32b08e01186fe741bd42653c7e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-30T21:34:41-04:00

Commit Message:
TITANIC: Adding BellbotScript support methods

Changed paths:
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/script_support.h
    engines/titanic/true_talk/tt_room_script.h
    engines/titanic/true_talk/tt_scripts.cpp
    engines/titanic/true_talk/tt_scripts.h



diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 8f465b90..9d2b93e 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -34,7 +34,8 @@ uint BellbotScript::_oldId;
 BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
-		_field2D0(0), _field2D4(0), _field2D8(0), _field2DC(0) {
+		_field2D0(0), _field2D4(0), _field2D8(0), _field2DC(0),
+		_room107First(false) {
 	CTrueTalkManager::setFlags(25, 0);
 	CTrueTalkManager::setFlags(24, 0);
 	CTrueTalkManager::setFlags(40, 0);
@@ -187,7 +188,7 @@ int BellbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 		|| sentence->contains("what am i supposed to do in here")
 		|| sentence->contains("what should i do in here")
 		|| sentence->contains("what do i do in this room")) {
-		if (randomResponse4(roomScript)) {
+		if (addRoomDescription(roomScript)) {
 			applyResponse();
 			return 2;
 		}
@@ -205,7 +206,7 @@ int BellbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 			|| sentence->contains("what should i do")
 			|| sentence->contains("what do i do")) {
 		if (getDialRegion(0) == 1) {
-			randomResponse5(roomScript, getValue(1));
+			randomResponse4(roomScript, getValue(1));
 			applyResponse();
 			return 2;
 		} else {
@@ -1522,29 +1523,88 @@ bool BellbotScript::better(TTsentence *sentence, uint id1, uint id2) {
 	return true;
 }
 
+bool BellbotScript::randomResponse0(TTroomScript *roomScript, uint id) {
+	bool dr0 = getDialRegion(0) == 1;
+	uint newId = getValue(1);
+
+	if (getValue(25) == 0) {
+		CTrueTalkManager::setFlags(25, 1);
+		if (getValue(1) > 2) {
+			addResponse(getDialogueId(202043));
+			applyResponse();
+			return true;
+		}
+	}
+
+	bool result = dr0 ? randomResponse1(roomScript, newId) :
+		randomResponse2(roomScript, newId);
+	if (result)
+		CTrueTalkManager::triggerAction(1, 0);
+
+	return true;
+}
+
 bool BellbotScript::randomResponse1(TTroomScript *roomScript, uint id) {
-	// TODO
+	if (getRandomNumber(100) < 10) {
+		addResponse(getDialogueId(201978));
+		applyResponse();
+	} else {
+		if (getRandomNumber(100) < 50)
+			addResponse(getDialogueId(202259));
+
+		randomResponse3(roomScript, id);
+		applyResponse();
+	}
+	
 	return false;
 }
 
 bool BellbotScript::randomResponse2(TTroomScript *roomScript, uint id) {
-	// TODO
-	return false;
-}
+	if (getRandomNumber(100) < 5) {
+		addResponse(getDialogueId(202262));
+		applyResponse();
+	} else {
+		if (getRandomNumber(100) < 40)
+			addResponse(getDialogueId(202258));
+
+		randomResponse4(roomScript, id);
+		applyResponse();
+	}
 
-bool BellbotScript::randomResponse3(TTroomScript *roomScript, uint id) {
-	// TODO
 	return false;
 }
 
-bool BellbotScript::randomResponse4(TTroomScript *roomScript) {
-	// TODO
-	return false;
+void BellbotScript::randomResponse3(TTroomScript *roomScript, uint id) {
+	bool result = false;
+	if (roomScript && getRandomNumber(100) < 50)
+		result = addRoomDescription(roomScript);
+
+	if (result)
+		return;
+	if (getRandomNumber(100) >= 50) {
+		addResponse(getDialogueId(202262));
+		return;
+	}
+
+	if (id <= 2) {
+		if (getRandomNumber(100) < 50) {
+			addResponse(getDialogueId(202266));
+			return;
+		} else if (id == 2) {
+			addResponse(getDialogueId(202264));
+			return;
+		}
+	}
+
+	addResponse(getDialogueId(id == 1 ? 202265 : 202263));
 }
 
-bool BellbotScript::randomResponse5(TTroomScript *roomScript, uint id) {
-	// TODO
-	return false;
+void BellbotScript::randomResponse4(TTroomScript *roomScript, uint id) {
+	if (getRandomNumber(100) < 4 && id <= 2) {
+		addResponse(getDialogueId(202268));
+	} else {
+		addResponse(getDialogueId(202267));
+	}
 }
 
 int BellbotScript::checkCommonSentences(TTroomScript *roomScript, TTsentence *sentence) {
@@ -1557,9 +1617,104 @@ int BellbotScript::checkCommonWords(TTroomScript *roomScript, TTsentence *senten
 	return 0;
 }
 
-int BellbotScript::getRoomDialogueId(TTroomScript *roomScript) {
-	// TODO
+uint BellbotScript::getRoomDialogueId(TTroomScript *roomScript) {
+	if (!roomScript)
+		return 0;
+
+	static const RoomDialogueId ROOM_DIALOGUE_IDS[] = {
+		{ 100, 201442 }, { 101, 201417 }, { 107, 201491 }, { 108, 201421 },
+		{ 109, 201437 }, { 110, 201431 }, { 111, 201457 }, { 112, 201411 },
+		{ 113, 201424 }, { 114, 201464 }, { 115, 201407 }, { 116, 201468 },
+		{ 117, 201447 }, { 122, 201491 }, { 123, 201299 }, { 124, 201479 },
+		{ 125, 201480 }, { 126, 201476 }, { 127, 201483 }, { 128, 201399 },
+		{ 129, 201400 }, { 130, 201387 }, { 131, 201395 }, { 132, 201388 },
+		{ 0, 0 }
+	};
+
+	for (int idx = 0; ROOM_DIALOGUE_IDS[idx]._roomNum; ++idx) {
+		if (ROOM_DIALOGUE_IDS[idx]._roomNum == roomScript->_scriptId)
+			return ROOM_DIALOGUE_IDS[idx]._dialogueId;
+	}
+
 	return 0;
 }
 
+bool BellbotScript::addRoomDescription(TTroomScript *roomScript) {
+	if (!roomScript)
+		return false;
+
+	switch (roomScript->_scriptId) {
+	case 101:
+		addResponse(getDialogueId(getValue(2) == 1 ? 20185 : 201832));
+		break;
+	case 107:
+		if (_room107First) {
+			addResponse(getDialogueId(202162));
+		} else {
+			addResponse(getDialogueId(202162));
+			_room107First = true;
+		}
+		break;
+	case 108:
+		addResponse(getDialogueId(201844));
+		break;
+	case 109:
+		addResponse(getDialogueId(200303));
+		break;
+	case 110:
+		addResponse(getDialogueId(202257));
+		break;
+	case 111:
+		addResponse(getDialogueId(202056));
+		break;
+	case 112:
+		addResponse(getDialogueId(201828));
+		break;
+	case 113:
+		addResponse(getDialogueId(201859));
+		break;
+	case 114:
+		addResponse(getDialogueId(202052));
+		break;
+	case 115:
+		addResponse(getDialogueId(202004));
+		break;
+	case 116:
+		addResponse(getDialogueId(202092));
+		break;
+	case 117:
+		addResponse(getDialogueId(202027));
+		break;
+	case 124:
+		addResponse(getDialogueId(202110));
+		break;
+	case 125:
+		addResponse(getDialogueId(202103));
+		break;
+	case 126:
+		addResponse(getDialogueId(202116));
+		break;
+	case 127:
+		addResponse(getDialogueId(202111));
+		break;
+	case 128:
+		addResponse(getDialogueId(201815));
+		break;
+	case 129:
+		addResponse(getDialogueId(201816));
+		break;
+	case 131:
+		addResponse(getDialogueId(201930));
+		break;
+	case 132:
+		addResponse(getDialogueId(201924));
+		break;
+	default:
+		return false;
+	}
+
+	return true;
+}
+
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 4fe850b..f960521 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -38,6 +38,7 @@ private:
 	int _field2D4;
 	int _field2D8;
 	int _field2DC;
+	bool _room107First;
 private:
 	/**
 	 * Setup sentence data
@@ -69,17 +70,21 @@ private:
 	 */
 	bool better(TTsentence *sentence, uint id1, uint id2);
 
+	bool randomResponse0(TTroomScript *roomScript, uint id);
 	bool randomResponse1(TTroomScript *roomScript, uint id);
 	bool randomResponse2(TTroomScript *roomScript, uint id);
-	bool randomResponse3(TTroomScript *roomScript, uint id);
-	bool randomResponse4(TTroomScript *roomScript);
-	bool randomResponse5(TTroomScript *roomScript, uint id);
+	void randomResponse3(TTroomScript *roomScript, uint id);
+	void randomResponse4(TTroomScript *roomScript, uint id);
 
 	int checkCommonSentences(TTroomScript *roomScript, TTsentence *sentence);
 	int checkCommonWords(TTroomScript *roomScript, TTsentence *sentence);
 
-	int getRoomDialogueId(TTroomScript *roomScript);
-
+	uint getRoomDialogueId(TTroomScript *roomScript);
+	
+	/**
+	 * Adds a description of the room to the conversation response
+	 */
+	bool addRoomDescription(TTroomScript *roomScript);
 public:
 	BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index a9f1689..5839b72 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -31,10 +31,6 @@ static const int STATE_ARRAY[9] = {
 	0x2E2A, 0x2E2B, 0x2E2C, 0x2E2D, 0x2E2E, 0x2E2F, 0x2E30, 0x2E31, 0x2E32
 };
 
-struct RoomDialogueId {
-	int _roomNum;
-	int _dialogueId;
-};
 static const RoomDialogueId ROOM_DIALOGUES1[] = {
 	{ 100, 10523 }, { 101, 10499 }, { 107, 10516 }, { 108, 10500 },
 	{ 109, 10490 }, { 110, 10504 }, { 111, 10506 }, { 112, 10498 },
@@ -573,7 +569,7 @@ int DoorbotScript::setResponse(int dialogueId, int v34) {
 
 int DoorbotScript::getRoomDialogueId1(const TTroomScript *roomScript) {
 	for (const RoomDialogueId *r = ROOM_DIALOGUES1; r->_roomNum; ++r) {
-		if (r->_roomNum == roomScript->_scriptId == r->_roomNum)
+		if (r->_roomNum == roomScript->_scriptId)
 			return getDialogueId(r->_dialogueId);
 	}
 
@@ -582,7 +578,7 @@ int DoorbotScript::getRoomDialogueId1(const TTroomScript *roomScript) {
 
 int DoorbotScript::getRoomDialogueId2(const TTroomScript *roomScript) {
 	for (const RoomDialogueId *r = ROOM_DIALOGUES2; r->_roomNum; ++r) {
-		if (r->_roomNum == roomScript->_scriptId == r->_roomNum)
+		if (r->_roomNum == roomScript->_scriptId)
 			return getDialogueId(r->_dialogueId);
 	}
 
diff --git a/engines/titanic/true_talk/script_support.h b/engines/titanic/true_talk/script_support.h
index ca70b09..bc18464 100644
--- a/engines/titanic/true_talk/script_support.h
+++ b/engines/titanic/true_talk/script_support.h
@@ -31,6 +31,11 @@ namespace Titanic {
 
 enum ScriptArrayFlag { SF_NONE = 0, SF_RANDOM = 1, SF_SEQUENTIAL = 2 };
 
+struct RoomDialogueId {
+	uint _roomNum;
+	uint _dialogueId;
+};
+
 struct TTnpcScriptResponse {
 	uint _tag;
 	uint _values[4];
diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h
index d4da5fc..39a50ac 100644
--- a/engines/titanic/true_talk/tt_room_script.h
+++ b/engines/titanic/true_talk/tt_room_script.h
@@ -32,7 +32,7 @@ class TTsentence;
 
 class TTroomScriptBase : public TTscriptBase {
 public:
-	int _scriptId;
+	uint _scriptId;
 public:
 	TTroomScriptBase(int scriptId, const char *charClass, const char *charName,
 		int v3, int v4, int v5, int v6, int v2, int v7);
diff --git a/engines/titanic/true_talk/tt_scripts.cpp b/engines/titanic/true_talk/tt_scripts.cpp
index 5783866..f8ea65a 100644
--- a/engines/titanic/true_talk/tt_scripts.cpp
+++ b/engines/titanic/true_talk/tt_scripts.cpp
@@ -45,7 +45,7 @@ TTnpcScript *TTnpcScriptList::findById(int charId) const {
 
 /*------------------------------------------------------------------------*/
 
-TTroomScript *TTroomScriptList::findById(int scriptId) const {
+TTroomScript *TTroomScriptList::findById(uint scriptId) const {
 	for (TTroomScriptList::const_iterator i = begin(); i != end(); ++i) {
 		const TTroomScriptListItem *item = *i;
 		if (item->_item->_scriptId == scriptId)
diff --git a/engines/titanic/true_talk/tt_scripts.h b/engines/titanic/true_talk/tt_scripts.h
index afcc2c3..734d862 100644
--- a/engines/titanic/true_talk/tt_scripts.h
+++ b/engines/titanic/true_talk/tt_scripts.h
@@ -51,7 +51,7 @@ public:
 
 class TTroomScriptList : public List<TTroomScriptListItem> {
 public:
-	TTroomScript *findById(int scriptId) const;
+	TTroomScript *findById(uint scriptId) const;
 };
 
 class TTscripts {


Commit: 2b38dd4ff110e56e741b6ae6c2ea1598ddee6fc6
    https://github.com/scummvm/scummvm/commit/2b38dd4ff110e56e741b6ae6c2ea1598ddee6fc6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-30T23:28:03-04:00

Commit Message:
TITANIC: Added Bellbot common phrase list to create_titanic

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index afed200..bf1da8e 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -202,6 +202,54 @@ const NumberEntry NUMBERS[76] = {
 	{ "hundredth", 100, 6 }
 };
 
+struct CommonPhrase {
+	const char *_str;
+	uint _dialogueId;
+	uint _roomNum;
+	uint _val1;
+};
+
+static const CommonPhrase BELLBOT_COMMON_PHRASES[] = {
+	{ "what is wrong with her", 0x30FF9, 0x7B, 0 },
+	{ "what is wrong with titania", 0x30FF9, 0x7B, 0 },
+	{ "something for the weekend", 0x30D8B, 0x00, 0 },
+	{ "other food", 0x30E1D, 0x00, 3 },
+	{ "different food", 0x30E1D, 0x00, 3 },
+	{ "alternative food", 0x30E1D, 0x00, 3 },
+	{ "decent food", 0x30E1D, 0x00, 3 },
+	{ "nice food", 0x30E1D, 0x00, 3 },
+	{ "nicer food", 0x30E1D, 0x00, 3 },
+	{ "make me happy", 0x31011, 0x00, 0 },
+	{ "cheer me up", 0x31011, 0x00, 0 },
+	{ "help me if im unhappy", 0x31011, 0x00, 0 },
+	{ "i obtain a better room", 0x30E8A, 0x00, 3 },
+	{ "i obtain a better room", 0x30E8A, 0x00, 2 },
+	{ "i get a better room", 0x30E8A, 0x00, 3 },
+	{ "i get a better room", 0x30E8A, 0x00, 2 },
+	{ "i want a better room", 0x30E8A, 0x00, 3 },
+	{ "i want a better room", 0x30E8A, 0x00, 2 },
+	{ "i understood", 0x30D75, 0x6D, 0 },
+	{ "i knew", 0x30D75, 0x6D, 0 },
+	{ "i know", 0x30D75, 0x6D, 0 },
+	{ "not stupid", 0x30D75, 0x6D, 0 },
+	{ "cheeky", 0x30D75, 0x6D, 0 },
+	{ "not help", 0x30D6F, 0x6D, 0 },
+	{ "not helpful", 0x30D6F, 0x6D, 0 },
+	{ "dont help", 0x30D6F, 0x6D, 0 },
+	{ "no help", 0x30D6F, 0x6D, 0 },
+	{ "sorry", 0x30D76, 0x6D, 0 },
+	{ "not mean that", 0x30D76, 0x6D, 0 },
+	{ "didnt mean that", 0x30D76, 0x6D, 0 },
+	{ "apologise", 0x30D76, 0x6D, 0 },
+	{ "play golf", 0x313B6, 0x00, 0 },
+	{ "is not the captain meant to go down with the ship", 0x31482, 0x00, 0 },
+	{ "is not the captain supposed to go down with the ship", 0x31482, 0x00, 0 },
+	{ "sauce sticks to the chicken", 0x3156B, 0x00, 0 },
+	{ "sauce gets stuck to the chicken", 0x3156B, 0x00, 0 },
+	{ nullptr, 0, 0, 0 }
+};
+
+
 void NORETURN_PRE error(const char *s, ...) {
 	printf("%s\n", s);
 	exit(1);
@@ -514,6 +562,20 @@ void writeStarfieldPoints2() {
 	dataOffset += size;
 }
 
+void writePhrases(const char *name, const CommonPhrase *phrases) {
+	for (uint idx = 0; phrases->_str; ++idx, ++phrases) {
+		outputFile.seek(dataOffset + idx * 4);
+		outputFile.writeString(phrases->_str);
+		outputFile.writeLong(phrases->_dialogueId);
+		outputFile.writeLong(phrases->_roomNum);
+		outputFile.writeLong(phrases->_val1);
+	}
+
+	uint size = outputFile.size() - dataOffset;
+	writeEntryHeader("Phrases/Bellbot", dataOffset, size);
+	dataOffset += size;
+}
+
 void writeHeader() {
 	// Write out magic string
 	const char *MAGIC_STR = "SVTN";
@@ -604,6 +666,7 @@ void writeData() {
 	writeWords("Words/Deskbot", 0x5EAAA8);
 	writeWords("Words/Doorbot", 0x601098, 3);
 	writeWords("Words/Liftbot", 0x60C788);
+	writePhrases("Phrases/Bellbot", BELLBOT_COMMON_PHRASES);
 
 	writeResponseTree();
 	writeNumbers();


Commit: 45fb6a2d32d46ab5c1acbc90302a324520474fed
    https://github.com/scummvm/scummvm/commit/45fb6a2d32d46ab5c1acbc90302a324520474fed
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-30T23:28:22-04:00

Commit Message:
TITANIC: Added BellbotScript checkCommonPhrases

Changed paths:
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/script_support.cpp
    engines/titanic/true_talk/script_support.h



diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 9d2b93e..15cbc21 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -31,6 +31,16 @@ namespace Titanic {
 
 uint BellbotScript::_oldId;
 
+static const RoomDialogueId ROOM_DIALOGUE_IDS[] = {
+	{ 100, 201442 },{ 101, 201417 },{ 107, 201491 },{ 108, 201421 },
+	{ 109, 201437 },{ 110, 201431 },{ 111, 201457 },{ 112, 201411 },
+	{ 113, 201424 },{ 114, 201464 },{ 115, 201407 },{ 116, 201468 },
+	{ 117, 201447 },{ 122, 201491 },{ 123, 201299 },{ 124, 201479 },
+	{ 125, 201480 },{ 126, 201476 },{ 127, 201483 },{ 128, 201399 },
+	{ 129, 201400 },{ 130, 201387 },{ 131, 201395 },{ 132, 201388 },
+	{ 0, 0 }
+};
+
 BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2) :
 		TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
@@ -53,6 +63,7 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
 	_quotes.load("Quotes/Bellbot");
 	_states.load("States/Bellbot");
 	_preResponses.load("PreResponses/Bellbot");
+	_phrases.load("Phrases/Bellbot");
 }
 
 void BellbotScript::setupSentences() {
@@ -1608,29 +1619,138 @@ void BellbotScript::randomResponse4(TTroomScript *roomScript, uint id) {
 }
 
 int BellbotScript::checkCommonSentences(TTroomScript *roomScript, TTsentence *sentence) {
-	// TODO
+	if (!roomScript || !sentence)
+		return 1;
+
+	uint val1 = getValue(1);
+	uint newId = 0;
+	for (uint idx = 0; idx < _phrases.size(); ++idx) {
+		TTcommonPhrase &cp = _phrases[idx];
+
+		if (cp._roomNum != 0 && cp._roomNum != roomScript->_scriptId)
+			continue;
+		if (cp._val1 != 0 && cp._val1 != val1 && (cp._val1 == 3 || val1 != 4))
+			continue;
+		if (!sentence->contains(cp._str.c_str()))
+			continue;
+
+		addResponse(getDialogueId(cp._dialogueId));
+		applyResponse();
+		return 2;
+	}
+
 	return 0;
 }
 
-int BellbotScript::checkCommonWords(TTroomScript *roomScript, TTsentence *sentence) {
-	// TODO
-	return 0;
+bool BellbotScript::checkCommonWords(TTroomScript *roomScript, TTsentence *sentence) {
+	if (!roomScript || !sentence)
+		return 0;
+	CTrueTalkManager::setFlags(23, 0);
+	if (sentence->_field2C != 4)
+		return 0;
+
+	if (sentence->localWord("garage")) {
+		addResponse(getDialogueId(200874));
+	} else if (sentence->localWord("parrotfoodshop")) {
+		addResponse(getDialogueId(200821));
+	} else if (sentence->localWord("sgt") && sentence->localWord("restaurant")) {
+		addResponse(getDialogueId(200857));
+	} else if (sentence->localWord("firstclass") && sentence->localWord("restaurant")) {
+		addResponse(getDialogueId(200839));
+	} else if (sentence->localWord("restaurant")) {
+		addResponse(getDialogueId(getValue(1) == 1 ? 200839 : 200857));
+	} else if (getValue(1) == 1 && sentence->localWord("canal") && sentence->localWord("firstclass")) {
+		addResponse(getDialogueId(200846));
+	} else if (getValue(1) == 2 && sentence->localWord("canal") && sentence->localWord("secondclass")) {
+		addResponse(getDialogueId(200847));
+	} else if (sentence->localWord("canal")) {
+		addResponse(getDialogueId(getValue(1) == 1 ? 200846 : 200847));
+	} else if (sentence->localWord("firstclass") && 
+			(sentence->localWord("stateroom") || sentence->localWord("room"))) {
+		addResponse(getDialogueId(getValue(1) == 1 ? 200840 : 200306));
+	} else if (sentence->localWord("secondclass") && sentence->localWord("stateroom") && sentence->localWord("room")) {
+		addResponse(getDialogueId(getValue(1) < 3 ? 202231 : 200306));
+	} else if (sentence->localWord("stateroom") || sentence->contains("my room")) {
+		addResponse(getDialogueId(202231));
+	} else if (sentence->localWord("firstclass")) {
+		addResponse(getDialogueId(200840));
+	} else if (sentence->localWord("secondclass")) {
+		addResponse(getDialogueId(200841));
+	} else if (sentence->localWord("thirdclass")) {
+		addResponse(getDialogueId(202231));
+	} else if (sentence->localWord("arboretum")) {
+		addResponse(getDialogueId(200842));
+	} else if (sentence->localWord("bar")) {
+		addResponse(getDialogueId(200843));
+	} else if (sentence->localWord("bottomofwell")) {
+		addResponse(getDialogueId(200860));
+	} else if (sentence->localWord("topwell") || sentence->localWord("well")) {
+		addResponse(getDialogueId(200861));
+	} else if (sentence->localWord("bridge")) {
+		addResponse(getDialogueId(202213));
+	} else if (sentence->localWord("creatorroom")) {
+		addResponse(getDialogueId(200848));
+	} else if (sentence->localWord("servicelift")) {
+		addResponse(getDialogueId(200855));
+	} else if (sentence->localWord("lift")) {
+		addResponse(getDialogueId(202256));
+	} else if (sentence->localWord("bilgeroom")) {
+		addResponse(getDialogueId(202255));
+	} else if (sentence->localWord("musicroom")) {
+		addResponse(getDialogueId(200851));
+	} else if (sentence->localWord("parrotlobby")) {
+		addResponse(getDialogueId(200852));
+	} else if (sentence->localWord("parrot") &&
+			(sentence->localWord("room") || sentence->localWord("lobby"))) {
+		addResponse(getDialogueId(200852));
+	} else if (sentence->localWord("promenade")) {
+		addResponse(getDialogueId(200853));
+	} else if (sentence->localWord("sculpture") || sentence->localWord("sculptureroom")
+				|| sentence->localWord("statue")) {
+		addResponse(getDialogueId(200854));
+	} else if (sentence->localWord("lounge")) {
+		addResponse(getDialogueId(200856));
+	} else if (sentence->localWord("titania")) {
+		if (sentence->localWord("room")) {
+			addResponse(getDialogueId(200859));
+		} else if (sentence->localWord("nose")) {
+			addResponse(getDialogueId(200703));
+		} else if (sentence->localWord("mouth")) {
+			addResponse(getDialogueId(200702));
+		} else if (sentence->localWord("eyes")) {
+			addResponse(getDialogueId(200701));
+		} else if (sentence->localWord("ear")) {
+			addResponse(getDialogueId(200698));
+		} else if (sentence->localWord("brain")) {
+			addResponse(getDialogueId(200693));
+		} else {
+			addResponse(getDialogueId(200686));
+		}
+	} else if (sentence->localWord("embarklobby") 
+			|| sentence->localWord("lobby")) {
+		addResponse(getDialogueId(200850));
+	} else if (sentence->localWord("pellerator")) {
+		addResponse(getDialogueId(200862));
+	} else if (sentence->localWord("servicelift") 
+			|| (sentence->localWord("service") && sentence->localWord("elevator"))) {
+		addResponse(getDialogueId(200855));
+	} else if (sentence->localWord("elevator")) {
+		addResponse(getDialogueId(202256));
+	} else if (sentence->localWord("now")) {
+		addResponse(getDialogueId(200788));
+	} else if (sentence->localWord("room")) {
+		addResponse(getDialogueId(200311));
+	} else {
+		return false;
+	}
+
+	return true;
 }
 
 uint BellbotScript::getRoomDialogueId(TTroomScript *roomScript) {
 	if (!roomScript)
 		return 0;
 
-	static const RoomDialogueId ROOM_DIALOGUE_IDS[] = {
-		{ 100, 201442 }, { 101, 201417 }, { 107, 201491 }, { 108, 201421 },
-		{ 109, 201437 }, { 110, 201431 }, { 111, 201457 }, { 112, 201411 },
-		{ 113, 201424 }, { 114, 201464 }, { 115, 201407 }, { 116, 201468 },
-		{ 117, 201447 }, { 122, 201491 }, { 123, 201299 }, { 124, 201479 },
-		{ 125, 201480 }, { 126, 201476 }, { 127, 201483 }, { 128, 201399 },
-		{ 129, 201400 }, { 130, 201387 }, { 131, 201395 }, { 132, 201388 },
-		{ 0, 0 }
-	};
-
 	for (int idx = 0; ROOM_DIALOGUE_IDS[idx]._roomNum; ++idx) {
 		if (ROOM_DIALOGUE_IDS[idx]._roomNum == roomScript->_scriptId)
 			return ROOM_DIALOGUE_IDS[idx]._dialogueId;
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index f960521..58fb762 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -33,6 +33,7 @@ private:
 	TTmapEntryArray _states;
 	TTmapEntryArray _preResponses;
 	TTsentenceEntries _sentences[20];
+	TTcommonPhraseArray _phrases;
 	int _array[150];
 	int _field2D0;
 	int _field2D4;
@@ -77,7 +78,7 @@ private:
 	void randomResponse4(TTroomScript *roomScript, uint id);
 
 	int checkCommonSentences(TTroomScript *roomScript, TTsentence *sentence);
-	int checkCommonWords(TTroomScript *roomScript, TTsentence *sentence);
+	bool checkCommonWords(TTroomScript *roomScript, TTsentence *sentence);
 
 	uint getRoomDialogueId(TTroomScript *roomScript);
 	
diff --git a/engines/titanic/true_talk/script_support.cpp b/engines/titanic/true_talk/script_support.cpp
index f2c473d..c24e275 100644
--- a/engines/titanic/true_talk/script_support.cpp
+++ b/engines/titanic/true_talk/script_support.cpp
@@ -194,12 +194,30 @@ void TTupdateStateArray::load(const char *name) {
 	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
 
 	while (r->pos() < r->size()) {
-		TTupdateState ue;
-		ue._newId = r->readUint32LE();
-		ue._newValue = r->readUint32LE();
-		ue._dialBits = r->readUint32LE();
+		TTupdateState us;
+		us._newId = r->readUint32LE();
+		us._newValue = r->readUint32LE();
+		us._dialBits = r->readUint32LE();
 
-		push_back(ue);
+		push_back(us);
+	}
+
+	delete r;
+}
+
+/*------------------------------------------------------------------------*/
+
+void TTcommonPhraseArray::load(const char *name) {
+	Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name);
+
+	while (r->pos() < r->size()) {
+		TTcommonPhrase cp;
+		cp._str = readStringFromStream(r);
+		cp._dialogueId = r->readUint32LE();
+		cp._roomNum = r->readUint32LE();
+		cp._val1 = r->readUint32LE();
+
+		push_back(cp);
 	}
 
 	delete r;
diff --git a/engines/titanic/true_talk/script_support.h b/engines/titanic/true_talk/script_support.h
index bc18464..a41673b 100644
--- a/engines/titanic/true_talk/script_support.h
+++ b/engines/titanic/true_talk/script_support.h
@@ -177,6 +177,18 @@ public:
 	void load(const char *name);
 };
 
+struct TTcommonPhrase {
+	CString _str;
+	uint _dialogueId;
+	uint _roomNum;
+	uint _val1;
+};
+
+class TTcommonPhraseArray : public Common::Array<TTcommonPhrase> {
+public:
+	void load(const char *name);
+};
+
 } // End of namespace Titanic
 
 #endif /* TITANIC_TT_NPC_SCRIPT_H */


Commit: 377f926a6bfba385c883ba14d96e247e6fcf88f8
    https://github.com/scummvm/scummvm/commit/377f926a6bfba385c883ba14d96e247e6fcf88f8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-30T23:52:09-04:00

Commit Message:
TITANIC: Added BellbotScript scriptChanged

Changed paths:
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_npc_script.h



diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index cc987f0..6d69244 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -756,7 +756,7 @@ done:
 	return 2;
 }
 
-ScriptChangedResult BarbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
+ScriptChangedResult BarbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
 	switch (id) {
 	case 1:
 	case 100:
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index cf53e66..b7a1933 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -70,7 +70,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
 
 	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 15cbc21..ddfd315 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -344,9 +344,75 @@ int BellbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	return 2;
 }
 
-ScriptChangedResult BellbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
-	warning("TODO");
-	return SCR_1;
+ScriptChangedResult BellbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
+	if (!roomScript)
+		return SCR_2;
+
+	switch (id) {
+	case 104:
+		addResponse(getDialogueId(200617));
+		applyResponse();
+		break;
+
+	case 105:
+		addResponse(getDialogueId(200732));
+		applyResponse();
+		break;
+
+	case 106:
+		addResponse(getDialogueId(200733));
+		applyResponse();
+		break;
+
+	case 107:
+		addResponse(getDialogueId(200731));
+		applyResponse();
+		break;
+
+	case 157:
+		_field2DC = 1;
+		break;
+
+	case 158:
+		CTrueTalkManager::setFlags(26, 1);
+		break;
+
+	case 3:
+		if (_field2DC) {
+			if (randomResponse0(roomScript, id))
+				return SCR_2;
+		} else {
+			addResponse(getDialogueId(201693));
+			applyResponse();
+		}
+
+		_field2DC = 0;
+		CTrueTalkManager::_v9 = 0;
+		// Deliberate fall-through
+	default:
+		if (roomScript->_scriptId == 115 && id == 103) {
+			switch (getValue(4)) {
+			case 0:
+				addResponse(getDialogueId(200014));
+				applyResponse();
+				break;
+			case 1:
+			case 2:
+				addResponse(getDialogueId(200011));
+				applyResponse();
+				break;
+			case 3:
+				addResponse(getDialogueId(200007));
+				applyResponse();
+				break;
+			default:
+				break;
+			}
+		}
+		break;
+	}
+
+	return SCR_2;
 }
 
 int BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
@@ -1623,7 +1689,6 @@ int BellbotScript::checkCommonSentences(TTroomScript *roomScript, TTsentence *se
 		return 1;
 
 	uint val1 = getValue(1);
-	uint newId = 0;
 	for (uint idx = 0; idx < _phrases.size(); ++idx) {
 		TTcommonPhrase &cp = _phrases[idx];
 
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 58fb762..ee5a679 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -98,7 +98,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
 
 	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 4ac04c7..13d6869 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -64,7 +64,7 @@ int DeskbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	return 0;
 }
 
-ScriptChangedResult DeskbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
+ScriptChangedResult DeskbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
 	warning("TODO");
 	return SCR_1;
 }
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index d8a181c..bbe52bd 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -74,7 +74,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
 
 	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 5839b72..7319058 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -132,7 +132,7 @@ int DoorbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	return 0;
 }
 
-ScriptChangedResult DoorbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
+ScriptChangedResult DoorbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
 	warning("TODO");
 	return SCR_1;
 }
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index 70cdfea..be653fd 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -68,7 +68,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
 
 	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 397338a..2f079cb 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -95,7 +95,7 @@ int LiftbotScript::proc9() const {
 	return 0;
 }
 
-ScriptChangedResult LiftbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
+ScriptChangedResult LiftbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
 	warning("TODO");
 	return SCR_1;
 }
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 118d658..55752e1 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -65,7 +65,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
 
 	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index d013380..7da541f 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -70,7 +70,7 @@ int MaitreDScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	return 0;
 }
 
-ScriptChangedResult MaitreDScript::scriptChanged(TTscriptBase *roomScript, uint id) {
+ScriptChangedResult MaitreDScript::scriptChanged(TTroomScript *roomScript, uint id) {
 	warning("TODO");
 	return SCR_1;
 }
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index b3185d3..06fc686 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -73,7 +73,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
 
 	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index 0cd8082..96efc62 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -63,7 +63,7 @@ int ParrotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	return 2;
 }
 
-ScriptChangedResult ParrotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
+ScriptChangedResult ParrotScript::scriptChanged(TTroomScript *roomScript, uint id) {
 	if (id >= 280000 && id <= 280276) {
 		if (id == 280258) {
 			if (CTrueTalkManager::_currentNPC) {
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index a27c159..7e473bf 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -50,7 +50,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
 
 	/**
 	 * Process a sentence fragment entry
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 07442ed..9be7795 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -79,7 +79,7 @@ int SuccUBusScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	return 0;
 }
 
-ScriptChangedResult SuccUBusScript::scriptChanged(TTscriptBase *roomScript, uint id) {
+ScriptChangedResult SuccUBusScript::scriptChanged(TTroomScript *roomScript, uint id) {
 	warning("TODO");
 	return SCR_1;
 }
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 4710e79..4ea85f1 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -52,7 +52,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
 
 	/**
 	 * Handles updating NPC state based on specified dialogue Ids and dial positions
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index 09fe470..d208576 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -72,7 +72,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id) = 0;
+	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id) = 0;
 
 	virtual int proc11() const = 0;
 	virtual int proc12() const = 0;
@@ -237,7 +237,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id) {
+	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id) {
 		return SCR_2;
 	}
 
@@ -335,8 +335,8 @@ public:
 	/**
 	 * Called with the script and id changes
 	 */
-	ScriptChangedResult notifyScript(TTscriptBase *npcScript, int id) {
-		return scriptChanged(npcScript, id);
+	ScriptChangedResult notifyScript(TTroomScript *roomScript, int id) {
+		return scriptChanged(roomScript, id);
 	}
 };
 


Commit: 2bb4e83d5a0022c3083547b056bdc1444633b3d4
    https://github.com/scummvm/scummvm/commit/2bb4e83d5a0022c3083547b056bdc1444633b3d4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-31T00:05:22-04:00

Commit Message:
DEVTOOLS: Properly set up PARROT_RANGES array in create_titanic

Changed paths:
    devtools/create_titanic/script_ranges.cpp



diff --git a/devtools/create_titanic/script_ranges.cpp b/devtools/create_titanic/script_ranges.cpp
index b6550f7..6ac8092 100644
--- a/devtools/create_titanic/script_ranges.cpp
+++ b/devtools/create_titanic/script_ranges.cpp
@@ -1687,43 +1687,43 @@ const uint PARROT_RANGE34[] = { 280268, 280269, 280270, 280271, 280272, 280273,
 
 #define PARROT_RANGE_COUNT 34
 const ScriptRange PARROT_RANGES[34] = {
-	{ 280235, PARROT_RANGE1, false, false },
-	{ 280236, PARROT_RANGE1, false, false },
-	{ 280237, PARROT_RANGE1, false, false },
-	{ 280238, PARROT_RANGE1, false, false },
-	{ 280239, PARROT_RANGE1, false, false },
-	{ 280240, PARROT_RANGE1, false, false },
-	{ 280241, PARROT_RANGE1, false, false },
-	{ 280242, PARROT_RANGE1, false, false },
-	{ 280243, PARROT_RANGE1, false, false },
-	{ 280244, PARROT_RANGE1, false, false },
-
-	{ 280245, PARROT_RANGE1, false, false },
-	{ 280246, PARROT_RANGE1, false, false },
-	{ 280247, PARROT_RANGE1, false, false },
-	{ 280248, PARROT_RANGE1, false, false },
-	{ 280249, PARROT_RANGE1, false, false },
-	{ 280250, PARROT_RANGE1, false, false },
-	{ 280251, PARROT_RANGE1, false, false },
-	{ 280252, PARROT_RANGE1, false, false },
-	{ 280253, PARROT_RANGE1, false, false },
-	{ 280254, PARROT_RANGE1, false, false },
-
-	{ 280255, PARROT_RANGE1, false, false },
-	{ 280256, PARROT_RANGE1, false, false },
-	{ 280257, PARROT_RANGE1, false, false },
-	{ 280258, PARROT_RANGE1, false, false },
-	{ 280259, PARROT_RANGE1, false, false },
-	{ 280260, PARROT_RANGE1, false, false },
-	{ 280261, PARROT_RANGE1, false, false },
-	{ 280262, PARROT_RANGE1, false, false },
-	{ 280263, PARROT_RANGE1, false, false },
-	{ 280264, PARROT_RANGE1, false, false },
-
-	{ 280265, PARROT_RANGE1, false, false },
-	{ 280266, PARROT_RANGE1, false, false },
-	{ 280222, PARROT_RANGE1, false, false },
-	{ 280267, PARROT_RANGE1, false, false }
+	{ 280235, PARROT_RANGE1, true, false },
+	{ 280236, PARROT_RANGE2, false, false },
+	{ 280237, PARROT_RANGE3, false, false },
+	{ 280238, PARROT_RANGE4, false, false },
+	{ 280239, PARROT_RANGE5, false, false },
+	{ 280240, PARROT_RANGE6, false, false },
+	{ 280241, PARROT_RANGE7, false, false },
+	{ 280242, PARROT_RANGE8, false, false },
+	{ 280243, PARROT_RANGE9, false, false },
+	{ 280244, PARROT_RANGE10, false, false },
+
+	{ 280245, PARROT_RANGE11, false, false },
+	{ 280246, PARROT_RANGE12, false, false },
+	{ 280247, PARROT_RANGE13, false, false },
+	{ 280248, PARROT_RANGE14, false, false },
+	{ 280249, PARROT_RANGE15, false, false },
+	{ 280250, PARROT_RANGE16, false, false },
+	{ 280251, PARROT_RANGE17, false, false },
+	{ 280252, PARROT_RANGE18, false, false },
+	{ 280253, PARROT_RANGE19, false, false },
+	{ 280254, PARROT_RANGE20, false, false },
+
+	{ 280255, PARROT_RANGE21, false, false },
+	{ 280256, PARROT_RANGE22, false, false },
+	{ 280257, PARROT_RANGE23, true, false },
+	{ 280258, PARROT_RANGE24, false, true },
+	{ 280259, PARROT_RANGE25, false, false },
+	{ 280260, PARROT_RANGE26, false, false },
+	{ 280261, PARROT_RANGE27, false, false },
+	{ 280262, PARROT_RANGE28, false, false },
+	{ 280263, PARROT_RANGE29, false, false },
+	{ 280264, PARROT_RANGE30, false, false },
+
+	{ 280265, PARROT_RANGE31, false, false },
+	{ 280266, PARROT_RANGE32, false, false },
+	{ 280222, PARROT_RANGE33, true, false },
+	{ 280267, PARROT_RANGE34, true, false }
 };
 
 const uint SUCCUBUS_RANGE1[] = { 230001, 230149, 230078, 230002, 230033, 230067, 230003, 230079, 230034, 230055,


Commit: 8a2491c51b1b7d27382030f3cb9d58c5b56265f0
    https://github.com/scummvm/scummvm/commit/8a2491c51b1b7d27382030f3cb9d58c5b56265f0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-31T07:24:07-04:00

Commit Message:
TITANIC: Fix some clang warnings

Changed paths:
    engines/titanic/support/simple_file.h
    engines/titanic/support/video_surface.h



diff --git a/engines/titanic/support/simple_file.h b/engines/titanic/support/simple_file.h
index 6cf9995..f5d0bc7 100644
--- a/engines/titanic/support/simple_file.h
+++ b/engines/titanic/support/simple_file.h
@@ -296,6 +296,16 @@ public:
 	virtual bool open(const Common::String &filename);
 
 	/**
+	 * Unsupported open method from parent class
+	 */
+	virtual void open(Common::SeekableReadStream *stream) {}
+
+	/**
+	 * Unsupported open method from parent class
+	 */
+	virtual void open(Common::OutSaveFile *stream) {}
+
+	/**
 	 * Return a reference to the read stream
 	 */
 	Common::SeekableReadStream *readStream() const { return _inStream; }
diff --git a/engines/titanic/support/video_surface.h b/engines/titanic/support/video_surface.h
index 1f3a0fa..053eabb 100644
--- a/engines/titanic/support/video_surface.h
+++ b/engines/titanic/support/video_surface.h
@@ -86,6 +86,13 @@ public:
 	void setSurface(CScreenManager *screenManager, DirectDrawSurface *surface);
 
 	/**
+	 * Load the data for the class from file
+	 */
+	virtual void load(SimpleFile *file) {
+		ListItem::load(file);
+	}
+
+	/**
 	 * Load the surface with the passed resource
 	 */
 	virtual void loadResource(const CResourceKey &key) = 0;


Commit: e2b00938c7488af62521e1ad4e62566fa4077af0
    https://github.com/scummvm/scummvm/commit/e2b00938c7488af62521e1ad4e62566fa4077af0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-31T13:06:51-04:00

Commit Message:
TITANIC: Added DeskbotScript preprocess

Changed paths:
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_quotes.cpp
    engines/titanic/true_talk/tt_quotes.h



diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 13d6869..c955e7e 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -23,6 +23,7 @@
 #include "common/textconsole.h"
 #include "titanic/true_talk/deskbot_script.h"
 #include "titanic/true_talk/true_talk_manager.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -60,6 +61,17 @@ void DeskbotScript::setupSentences() {
 }
 
 int DeskbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+	if (roomScript->_scriptId != 110)
+		return 2;
+
+	bool flag20 = getValue(20) != 0;
+	CTrueTalkManager::setFlags(20, 0);
+	checkItems(nullptr, nullptr);
+	getState();
+
+	if (preprocess(roomScript, sentence) != 1)
+		return 1;
+
 	// TODO
 	return 0;
 }
@@ -433,4 +445,972 @@ void DeskbotScript::setFlags17(uint newId, uint index) {
 	CTrueTalkManager::setFlags(17, newValue);
 }
 
+int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence *sentence) {
+	if (!roomScript || !sentence)
+		return 1;
+
+	bool stateFlag = true, applyFlag = false;
+	switch (getValue(17)) {
+	case 1:
+		if (sentence->_field2C != 3 && sentence->_field2C != 4
+				&& sentence->_field2C != 6 && sentence->_field2C != 10
+				&& sentence->_field2C != 2) {
+			addResponse(getDialogueId(240423));
+			applyFlag = true;
+		}
+		break;
+
+	case 2:
+		if (sentence->localWord("gobbledygook")) {
+			addResponse(getDialogueId(240427));
+			applyFlag = true;
+		}
+		break;
+
+	case 3:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13
+				|| sentence->_field2C == 3 || sentence->localWord("upgrade")) {
+			addResponse(getDialogueId(240433));
+			applyFlag = true;
+		}
+		break;
+
+	case 4:
+		addResponse(getDialogueId(sentence->_field2C == 11 || sentence->_field2C == 13
+			? 240495 : 240494));
+		applyFlag = true;
+		break;
+
+	case 5:
+		if (isDial1Low() && getValue(1) == 4) {
+			if (sentence->localWord("name") || sentence->localWord("called")
+				|| sentence->localWord("passenger")) {
+				addResponse(getDialogueId(240867));
+				addResponse(getDialogueId(240745));
+			} else {
+				addResponse(getDialogueId(240446));
+			}
+
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 6:
+		if (isDial1Low() && getValue(1) == 4) {
+			if (sentence->localWord("passenger")) {
+				addResponse(getDialogueId(240449));
+				applyFlag = true;
+				stateFlag = false;
+			} else if (sentence->localWord("home")
+				|| sentence->localWord("destroy")) {
+				addResponse(getDialogueId(240574));
+				stateFlag = true;
+			} else if (sentence->localWord("name")
+				|| sentence->localWord("called")
+				|| sentence->_field2C == 11) {
+				addResponse(getDialogueId(240448));
+				stateFlag = true;
+			} else {
+				addResponse(getDialogueId(240489));
+				stateFlag = true;
+			}
+		}
+		break;
+
+	case 7:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13
+				|| (sentence->localWord("what") && sentence->localWord("wrong"))
+				|| sentence->localWord("clothes")) {
+			addResponse(getDialogueId(240489));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 8:
+		if (isDial1Low() && getValue(1) == 4) {
+			if (sentence->_field2C == 12 || sentence->_field2C == 13
+					|| sentence->contains("do not")) {
+				
+				addResponse(getDialogueId(240447));
+				setDialRegion(0, 0);
+				setDialRegion(1, 0);
+				CTrueTalkManager::setFlags(1, 3);
+				CTrueTalkManager::triggerAction(19, 3);
+				CTrueTalkManager::setFlags(22, 1);
+				applyFlag = true;
+			} else if (sentence->_field2C == 11) {
+				addResponse(getDialogueId(240746));
+				applyFlag = true;
+				stateFlag = false;
+			} else {
+				addResponse(getDialogueId(240448));
+				applyFlag = true;
+				stateFlag = false;
+			}
+		}
+		break;
+
+	case 9:
+		if (searchQuotes(roomScript, sentence)) {
+			if (isDial0Medium()) {
+				addResponse(getDialogueId(240382));
+				applyFlag = true;
+				stateFlag = false;
+			} else {
+				addResponse(getDialogueId(240548));
+				applyFlag = true;
+			}
+		}
+		break;
+
+	case 10:
+		if (isDial1Medium() && searchQuotes(roomScript, sentence)) {
+			if (isDial0Medium()) {
+				addResponse(getDialogueId(240405));
+				applyFlag = true;
+				stateFlag = false;
+			} else {
+				addResponse(getDialogueId(240548));
+				applyFlag = true;
+			}
+		}
+		break;
+
+	case 11:
+		if (isDial0Medium() && isDial1Medium()
+				&& searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240403));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 12:
+		if (isDial0Medium() && isDial1Medium()
+				&& searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240548));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 13:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240348));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 14:
+		if (isDial1Medium()) {
+			addResponse(getDialogueId(240568));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 15:
+		if (sentence->localWord("magazine")) {
+			addAssignedRoomDialogue3();
+			stateFlag = true;
+		}
+		break;
+
+	case 17:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240401));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 18:
+		if (!isDial0Low() || !isDial1Low()) {
+			if (searchQuotes(roomScript, sentence)) {
+				addResponse(getDialogueId(240402));
+				applyFlag = true;
+				stateFlag = false;
+			}
+		}
+		break;
+
+	case 19:
+		if (!isDial0Low() && searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240403));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 20:
+		if (!isDial1Medium() && searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240548));
+			applyFlag = true;
+		}
+		break;
+
+	case 21:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240382));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 22:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240383));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 23:
+		if (isDial0Medium() && searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240384));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 24:
+		setDialRegion(0, 0);
+
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240548));
+			applyFlag = true;
+		}
+		break;
+
+	case 25:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240349));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 26:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240350));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 27:
+	case 30:
+	case 33:
+	case 36:
+	case 40:
+	case 43:
+	case 46:
+	case 50:
+	case 55:
+	case 58:
+	case 61:
+	case 68:
+	case 73:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240548));
+			applyFlag = true;
+		}
+		break;
+
+	case 28:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240373));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 29:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240374));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 31:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240346));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 32:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240347));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 34:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240376));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 35:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240377));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 37:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240369));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 38:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240370));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 39:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240371));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 41:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240352));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 42:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240353));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 44:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240389));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 45:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240390));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 47:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240395));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 48:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240396));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 49:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240397));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 51:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240363));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 52:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240364));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 53:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240365));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 54:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240366));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 56:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240392));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 57:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240393));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 59:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240386));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 60:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240387));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 62:
+		if (isDial1Medium() && getValue(1) == 1) {
+			if (isDial0Medium()) {
+				if (sentence->localWord("down")) {
+					addResponse(getDialogueId(240413));
+					applyFlag = true;
+				}
+			} else if (sentence->contains("left") || sentence->contains("right")) {
+				addResponse(getDialogueId(240415));
+				CTrueTalkManager::triggerAction(sentence->localWord("down") ? 22 : 23, 0);
+			} else {
+				addResponse(getDialogueId(240414));
+				applyFlag = true;
+			}
+		}
+		break;
+
+	case 63:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240836));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 64:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240837));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 65:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240838));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 66:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240839));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 67:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(240840));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 69:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(241104));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 70:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(241105));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 71:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(241106));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 72:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(241107));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 74:
+	case 75:
+		if (sentence->_field2C == 24) {
+			addResponse(getDialogueId(240972));
+			applyFlag = true;
+		} else if (sentence->localWord("good") || sentence->localWord("yes")
+				|| sentence->localWord("well") || sentence->localWord("ill")
+				|| sentence->localWord("sad")) {
+			addResponse(getDialogueId(240805));
+			applyFlag = true;
+		}
+		break;
+
+	case 76:
+		if (sentence->_field2C == 6) {
+			addResponse(getDialogueId(240767));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 77:
+		if (sentence->_field2C == 3) {
+			addResponse(getDialogueId(241109));
+			applyFlag = true;
+			stateFlag = false;
+		}
+
+	case 78:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(241262));
+		} else if (sentence->_field2C == 12 || sentence->contains("do not")) {
+			setDialRegion(0, 0);
+			setDialRegion(1, 0);
+			addResponse(getDialogueId(241268));
+			add241716();
+		} else {
+			addResponse(getDialogueId(240745));
+		}
+
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 79:
+		switch (checkCommonWords(sentence)) {
+		case 1:
+			addResponse(getDialogueId(241263));
+			break;
+		case 2:
+			addResponse(getDialogueId(241266));
+			break;
+		case 3:
+			addAssignedRoom();
+			setState(0);
+			CTrueTalkManager::setFlags(17, 0);
+			return 2;
+		default:
+			addResponse(getDialogueId(241267));
+			break;
+		}
+		
+		add241716();
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 81:
+		addResponse(getDialogueId(sentence->_field2C == 12 ? 240602 : 241337));
+		applyResponse();
+		setState(0);
+		CTrueTalkManager::setFlags(17, 0);
+		return 2;
+
+	case 82:
+		if (sentence->_field2C == 2) {
+			addResponse(getDialogueId(241339));
+			applyFlag = true;
+		}
+		break;
+
+	case 83:
+		if ((isDial1Medium() && isDial0Low()) ||
+				(isDial1Low() && isDial0Medium())) {
+			if (sentence->localWord("yes") || sentence->localWord("but")) {
+				if (sentence->localWord("will") || sentence->localWord("do")) {
+					addResponse(getDialogueId(241366));
+					applyFlag = true;
+				}
+			}
+		}
+		break;
+
+	case 84:
+		if (sentence->_field2C == 12 || sentence->contains("vegetarian")
+				|| sentence->contains("vegitarian")) {
+			addResponse(getDialogueId(241718));
+			addResponse(getDialogueId(241709));
+			applyFlag = true;
+			stateFlag = false;
+		} else if (sentence->contains("continental")
+				|| sentence->contains("full")
+				|| sentence->contains("porky")
+				|| sentence->contains("the 1")
+				|| sentence->contains("the 2")
+				|| sentence->contains("former")
+				|| sentence->contains("latter")) {
+			addResponse(getDialogueId(241717));
+			addResponse(getDialogueId(241709));
+			applyFlag = true;
+			stateFlag = false;
+		} else {
+			if (sentence2C(sentence))
+				addResponse(getDialogueId(241707));
+			addResponse(getDialogueId(241719));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 85:
+		if (sentence->_field2C == 12 || sentence->contains("bugle")
+				|| sentence->contains("buggle") || sentence->contains("trumpet")
+				|| sentence->contains("saxophone") || sentence->contains("kazoo")
+				|| sentence->contains("blerontin 1") || sentence->contains("the 1")
+				|| sentence->contains("the 2") || sentence->contains("the 3")
+				|| sentence->contains("the 4") || sentence->contains("all of them")
+				|| sentence->contains("the lot")) {
+			addResponse(getDialogueId(241710));
+			addResponse(getDialogueId(241713));
+		} else {
+			if (getRandomNumber(100) < 80 && sentence2C(sentence))
+				addResponse(getDialogueId(241707));
+
+			addResponse(getDialogueId(241711));
+		}
+			
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 86:
+		if (sentence->_field2C == 12 || sentence->_field2C == 11 || sentence->contains("view")) {
+			addResponse(getDialogueId(241714));
+			addResponse(getDialogueId(241699));
+		} else {
+			if (getRandomNumber(100) < 80 && sentence2C(sentence))
+				addResponse(getDialogueId(241707));
+
+			if (getRandomNumber(100) < 50) {
+				addResponse(getDialogueId(241715));
+			} else {
+				addResponse(getDialogueId(241712));
+				addResponse(getDialogueId(241713));
+			}
+
+		}
+		
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 87:
+		if (sentence->contains("corner") || sentence->contains("on the end")
+				|| sentence->contains("balcony") || sentence->contains("neither")
+				|| sentence->contains("the 1") || sentence->contains("the 2")
+				|| sentence->contains("former") || sentence->contains("latter")
+				|| sentence->contains("either")) { 
+			addResponse(getDialogueId(241700));
+			addResponse(getDialogueId(241687));
+		} else {
+			if (getRandomNumber(100) < 80 && sentence2C(sentence))
+				addResponse(getDialogueId(241707));
+
+			addResponse(getDialogueId(241701));
+			addResponse(getDialogueId(241699));
+		}
+
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 88:
+		if (sentence->contains("imperial") || sentence->contains("the 1")) {
+			addResponse(getDialogueId(241700));
+			addResponse(getDialogueId(241739));
+		} else if (sentence->contains("royal") || sentence->contains("the 2")) {
+			addResponse(getDialogueId(241690));
+		} else if (sentence->contains("despotic") || sentence->contains("the last")
+				|| sentence->contains("latter")) {
+			addResponse(getDialogueId(241688));
+		} else if (sentence->contains("president") || sentence->contains("presidential")
+			|| sentence->contains("the 3")) {
+			addResponse(getDialogueId(241689));
+		} else {
+			if (getRandomNumber(100) < 80 && sentence2C(sentence))
+				addResponse(getDialogueId(241707));
+
+			addResponse(getDialogueId(241692));
+		}
+
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 89:
+		if (sentence->contains("king")) {
+			addResponse(getDialogueId(241691));
+		} else if (sentence->contains("queen") || sentence->contains("prince")
+				|| sentence->contains("princess") || sentence->contains("small")
+				|| sentence->contains("the 1") || sentence->contains("the 2")
+				|| sentence->contains("the 3") || sentence->contains("the 4")
+				|| sentence->contains("big") || sentence->contains("large")) { 
+			addResponse(getDialogueId(241700));
+			addResponse(getDialogueId(241739));
+		} else {
+			if (getRandomNumber(100) < 100 && sentence2C(sentence))
+				addResponse(getDialogueId(241707));
+
+			addResponse(getDialogueId(241690));
+		}
+
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 90:
+		if (sentence->contains("constitutional") || sentence->contains("const")
+				|| sentence->contains("absolute") || sentence->contains("small")
+				|| sentence->contains("the 1") || sentence->contains("the 2")
+				|| sentence->contains("big") || sentence->contains("large")) { 
+			addResponse(getDialogueId(241700));
+			addResponse(getDialogueId(241739));
+		} else {
+			if (getRandomNumber(100) < 80 && sentence2C(sentence))
+				addResponse(getDialogueId(241708));
+
+			addResponse(getDialogueId(241691));
+		}
+
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 91:
+		if (sentence->contains("benev") || sentence->contains("dict")
+				|| sentence->contains("small") || sentence->contains("the 1")
+				|| sentence->contains("the 2") || sentence->contains("big") 
+				|| sentence->contains("large") || sentence->contains("former")
+				|| sentence->contains("latter")) {
+			addResponse(getDialogueId(241700));
+			addResponse(getDialogueId(241739));
+		} else {
+			if (getRandomNumber(100) < 80 && sentence2C(sentence))
+				addResponse(getDialogueId(241708));
+
+			addResponse(getDialogueId(241688));
+		}
+
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 92:
+	case 93:
+		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			addResponse(getDialogueId(241077));
+			addResponse(getDialogueId(241706));
+		} else if (sentence->_field2C == 12) {
+			addAssignedRoom();
+			setState(0);
+			CTrueTalkManager::setFlags(17, 0);
+			return 2;
+		} else if (g_vm->_trueTalkManager->_quotes.find(sentence->_normalizedLine.c_str())
+				== MKTAG('F', 'I', 'S', 'H')) {
+			addResponse(getDialogueId(240877));
+			addResponse(getDialogueId(241706));
+		}else {
+			if (getRandomNumber(100) < 80 && sentence2C(sentence))
+				addResponse(getDialogueId(241707));
+
+			addResponse(getDialogueId(241705));
+			if (getRandomNumber(100) < 80)
+				addResponse(getDialogueId(241739));
+		}
+
+		applyFlag = true;
+		stateFlag = false;
+		break;
+
+	case 94:
+		if (sentence->contains("seperate") || sentence->contains("separate")
+				|| sentence->contains("detached") || sentence->contains("outside")
+				|| sentence->contains("onsweet") || sentence->contains("ensuite")
+				|| sentence->contains("suite") || sentence->contains("next door")
+				|| sentence->contains("the 1") || sentence->contains("the 2")
+				|| sentence->contains("former") || sentence->contains("latter")
+				|| sentence->contains("same room")) { 
+			addAssignedRoom();
+			setState(0);
+			CTrueTalkManager::setFlags(17, 0);
+			return 2;
+		} else {
+			if (getRandomNumber(100) < 80 && sentence2C(sentence))
+				addResponse(getDialogueId(241707));
+			addResponse(getDialogueId(241706));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 95:
+		if (isDial1Medium()) {
+			if ((sentence->localWord("i") && sentence->localWord("am"))
+				|| sentence->localWord("me")) {
+				addResponse(getDialogueId(240632));
+				applyFlag = true;
+				stateFlag = false;
+			}
+		}
+		break;
+
+	case 96:
+		if (sentence->_field2C == 2) {
+			addResponse(getDialogueId(241350));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+
+	case 97:
+		if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(241351));
+			applyFlag = true;
+			stateFlag = false;
+		}
+		break;
+	
+	default:
+		break;
+	}
+
+	if (applyFlag)
+		applyResponse();
+	if (stateFlag) {
+		setState(0);
+		CTrueTalkManager::setFlags(17, 0);
+	}
+
+	return applyFlag ? 2 : 1;
+}
+
+int DeskbotScript::searchQuotes(const TTroomScript *roomScript, const TTsentence *sentence) {
+	TTtreeResult treeResult;
+	return g_vm->_trueTalkManager->_quotesTree.search(sentence->_normalizedLine.c_str(),
+		TREE_2, &treeResult, 0, 0) != -1;
+}
+
+int DeskbotScript::checkCommonWords(const TTsentence *sentence) {
+	if (sentence->contains("xyzzy"))
+		return 3;
+
+	const TTquotes &quotes = g_vm->_trueTalkManager->_quotes;
+	if (quotes._loaded) {
+		uint tagId = quotes.find(sentence->_normalizedLine.c_str());
+		if (tagId == MKTAG('F', 'U', 'L', 'N')
+				|| tagId == MKTAG('T', 'D', 'V', 'P')
+				|| tagId == MKTAG('H', 'E', 'R', 'O')
+				|| sentence->contains("douglas adam"))
+			return 1;
+		else if (tagId == MKTAG('J', 'N', 'A', 'M')
+				|| tagId == MKTAG('N', 'I', 'K', 'N')
+				|| tagId == MKTAG('B', 'O', 'Y', 'S')
+				|| tagId == MKTAG('G', 'I', 'R', 'L'))
+			return 2;
+	} else {
+		if (sentence->contains("douglas adams")
+				|| sentence->contains("shaikh")
+				|| sentence->contains("millican")
+				|| sentence->contains("williams")
+				|| sentence->contains("henkes")
+				|| sentence->contains("kenny"))
+			return 1;
+		else if (sentence->contains("richard")
+				|| sentence->contains("jason")
+				|| sentence->contains("mike")
+				|| sentence->contains("renata"))
+			return 2;
+	}
+
+	return 0;
+}
+
+void DeskbotScript::add241716() {
+	addResponse(getDialogueId(241716));
+}
+
+void DeskbotScript::addAssignedRoom() {
+	addResponse(getDialogueId(241696));
+	addResponse(getDialogueId(241697));
+	CTrueTalkManager::setFlags(1, 3);
+	CTrueTalkManager::triggerAction(19, 3);
+	CTrueTalkManager::setFlags(22, 1);
+
+	int roomNum = 1, floorNum = 1, elevatorNum = 1;
+	getAssignedRoom(&roomNum, &floorNum, &elevatorNum);
+	addResponse(getDialogueId(241313 + elevatorNum));
+	addResponse(getDialogueId(241271 + floorNum));
+	addResponse(getDialogueId(241317 + roomNum));
+	addResponse(getDialogueId(241698));
+}
+
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index bbe52bd..55896a2 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -62,6 +62,31 @@ private:
 	 * Sets state data in flags 17
 	 */
 	void setFlags17(uint newId, uint index);
+
+	/**
+	 * Does preprocessing for the sentence
+	 */
+	int preprocess(const TTroomScript *roomScript, const TTsentence *sentence);
+
+	/**
+	 * Scans the quotes tree
+	 */
+	int searchQuotes(const TTroomScript *roomScript, const TTsentence *sentence);
+
+	/**
+	 * Checks for common words
+	 */
+	int checkCommonWords(const TTsentence *sentence);
+
+	/**
+	 * Adds response dialogue 241716
+	 */
+	void add241716();
+
+	/**
+	 * Adds a dialogue description for the player's assigned room
+	 */
+	void addAssignedRoom();
 public:
 	DeskbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 14da486..b61b9d5 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -959,7 +959,7 @@ bool TTnpcScript::getStateValue() const {
 	return false;
 }
 
-bool TTnpcScript::sentence2C(TTsentence *sentence) {
+bool TTnpcScript::sentence2C(const TTsentence *sentence) {
 	return sentence->_field2C >= 2 && sentence->_field2C <= 7;
 }
 
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index d208576..ddb5b8f 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -193,7 +193,7 @@ protected:
 
 	bool fn10(bool flag);
 
-	static bool sentence2C(TTsentence *sentence);
+	static bool sentence2C(const TTsentence *sentence);
 
 	/**
 	 * Gets the True Talk state value
diff --git a/engines/titanic/true_talk/tt_quotes.cpp b/engines/titanic/true_talk/tt_quotes.cpp
index 825210a..c690ac8 100644
--- a/engines/titanic/true_talk/tt_quotes.cpp
+++ b/engines/titanic/true_talk/tt_quotes.cpp
@@ -26,11 +26,9 @@
 
 namespace Titanic {
 
-TTquotes::TTquotes() {
+TTquotes::TTquotes() : _loaded(false), _dataP(nullptr), _dataSize(0),
+		_field544(0) {
 	Common::fill(&_tags[0], &_tags[256], 0);
-	_dataP = nullptr;
-	_dataSize = 0;
-	_field544 = 0;
 }
 
 TTquotes::~TTquotes() {
@@ -40,6 +38,7 @@ TTquotes::~TTquotes() {
 void TTquotes::load() {
 	Common::SeekableReadStream *r = g_vm->_filesManager->getResource("TEXT/JRQUOTES.TXT");
 	size_t size = r->readUint32LE();
+	_loaded = true;
 
 	_dataSize = _field544 = size;
 	_dataP = new char[size + 0x10];
@@ -68,7 +67,7 @@ void TTquotes::load() {
 	delete r;
 }
 
-int TTquotes::find(const char *str) {
+int TTquotes::find(const char *str)  const {
 	if (!str || !*str)
 		return 0;
 
@@ -95,7 +94,7 @@ int TTquotes::find(const char *str) {
 	return 0;
 }
 
-int TTquotes::find(const char *startP, const char *endP) {
+int TTquotes::find(const char *startP, const char *endP) const {
 	int size = endP - startP;
 	if (size < 3)
 		return 0;
diff --git a/engines/titanic/true_talk/tt_quotes.h b/engines/titanic/true_talk/tt_quotes.h
index c6627dc..5958c9e 100644
--- a/engines/titanic/true_talk/tt_quotes.h
+++ b/engines/titanic/true_talk/tt_quotes.h
@@ -53,7 +53,9 @@ private:
 	 * Test whether a substring contains one of the quotes,
 	 * and if so, returns the 4-character tag Id associated with it
 	 */
-	int find(const char *startP, const char *endP);
+	int find(const char *startP, const char *endP) const;
+public:
+	bool _loaded;
 public:
 	TTquotes();
 	~TTquotes();
@@ -67,7 +69,7 @@ public:
 	 * Test whether a passed string contains one of the quotes,
 	 * and if so, returns the 4-character tag Id associated with it
 	 */
-	int find(const char *str);
+	int find(const char *str) const;
 };
 
 } // End of namespace Titanic


Commit: 07bf7304433174203cc1cecec23aee54718b3d76
    https://github.com/scummvm/scummvm/commit/07bf7304433174203cc1cecec23aee54718b3d76
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-31T14:31:36-04:00

Commit Message:
TITANIC: Adding lots of const prefixes

Changed paths:
    engines/titanic/pet_control/pet_glyphs.h
    engines/titanic/pet_control/pet_real_life.h
    engines/titanic/pet_control/pet_section.h
    engines/titanic/true_talk/barbot_script.cpp
    engines/titanic/true_talk/barbot_script.h
    engines/titanic/true_talk/bellbot_script.cpp
    engines/titanic/true_talk/bellbot_script.h
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h
    engines/titanic/true_talk/liftbot_script.cpp
    engines/titanic/true_talk/liftbot_script.h
    engines/titanic/true_talk/maitred_script.cpp
    engines/titanic/true_talk/maitred_script.h
    engines/titanic/true_talk/parrot_script.cpp
    engines/titanic/true_talk/parrot_script.h
    engines/titanic/true_talk/succubus_script.cpp
    engines/titanic/true_talk/succubus_script.h
    engines/titanic/true_talk/tt_npc_script.cpp
    engines/titanic/true_talk/tt_npc_script.h
    engines/titanic/true_talk/tt_sentence.cpp
    engines/titanic/true_talk/tt_sentence.h



diff --git a/engines/titanic/pet_control/pet_glyphs.h b/engines/titanic/pet_control/pet_glyphs.h
index 7271d6c..c07cc5e 100644
--- a/engines/titanic/pet_control/pet_glyphs.h
+++ b/engines/titanic/pet_control/pet_glyphs.h
@@ -101,7 +101,7 @@ public:
 	/**
 	 * Get the bounds for the glyph
 	 */
-	virtual Rect getBounds() { return Rect(); }
+	virtual Rect getBounds() const { return Rect(); }
 
 	/**
 	 * Called for mouse button down messages
diff --git a/engines/titanic/pet_control/pet_real_life.h b/engines/titanic/pet_control/pet_real_life.h
index a4ae67f..40bc87d 100644
--- a/engines/titanic/pet_control/pet_real_life.h
+++ b/engines/titanic/pet_control/pet_real_life.h
@@ -67,7 +67,7 @@ public:
 	/**
 	 * Get the bounds for the section
 	 */
-	virtual Rect getBounds() { return Rect(); }
+	virtual Rect getBounds() const { return Rect(); }
 	
 	/**
 	 * Following are handlers for the various messages that the PET can
diff --git a/engines/titanic/pet_control/pet_section.h b/engines/titanic/pet_control/pet_section.h
index 4047ab0..8bc427e 100644
--- a/engines/titanic/pet_control/pet_section.h
+++ b/engines/titanic/pet_control/pet_section.h
@@ -89,7 +89,7 @@ public:
 	/**
 	 * Get the bounds for the section
 	 */
-	virtual Rect getBounds() { return Rect(); }
+	virtual Rect getBounds() const { return Rect(); }
 	
 	/**
 	 * Called when a general change occurs
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp
index 6d69244..ccc5833 100644
--- a/engines/titanic/true_talk/barbot_script.cpp
+++ b/engines/titanic/true_talk/barbot_script.cpp
@@ -70,7 +70,7 @@ void BarbotScript::setupSentences() {
 	_words.load("Words/Barbot");
 }
 
-int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
+int BarbotScript::chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag) {
 	if (tag == MKTAG('D', 'N', 'A', '1') || tag == MKTAG('H', 'H', 'G', 'Q') ||
 			tag == MKTAG('A', 'N', 'S', 'W') || tag == MKTAG('S', 'U', 'M', 'S')) {
 		if (_state < 7) {
@@ -132,7 +132,7 @@ int BarbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 	return TTnpcScript::chooseResponse(roomScript, sentence, tag);
 }
 
-int BarbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+int BarbotScript::process(const TTroomScript *roomScript, const TTsentence *sentence) {
 	int dialogueId = 0;
 
 	if (roomScript->_scriptId != 112)
@@ -756,7 +756,7 @@ done:
 	return 2;
 }
 
-ScriptChangedResult BarbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
+ScriptChangedResult BarbotScript::scriptChanged(const TTroomScript *roomScript, uint id) {
 	switch (id) {
 	case 1:
 	case 100:
@@ -840,7 +840,7 @@ ScriptChangedResult BarbotScript::scriptChanged(TTroomScript *roomScript, uint i
 	return SCR_2;
 }
 
-int BarbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+int BarbotScript::handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
 	switch (tagId) {
 	case MKTAG('A', 'D', 'V', 'T'):
@@ -1015,7 +1015,7 @@ uint BarbotScript::getDialsBitset() const {
 	return bits;
 }
 
-int BarbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int BarbotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence) {
 	int v34 = getState();
 	uint id = 0;
 
diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h
index b7a1933..1820d77 100644
--- a/engines/titanic/true_talk/barbot_script.h
+++ b/engines/titanic/true_talk/barbot_script.h
@@ -60,19 +60,19 @@ public:
 	/**
 	 * Chooses and adds a conversation response based on a specified tag Id.
 	 */
-	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+	virtual int chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag);
 
 	/**
 	 * Does NPC specific processing of the parsed sentence
 	 */
-	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
+	virtual int process(const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(const TTroomScript *roomScript, uint id);
 
-	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+	virtual int handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 	
 	/**
@@ -93,7 +93,7 @@ public:
 	/**
 	 * Process a sentence fragment entry
 	 */
-	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Sets a given dial to be pointing in a specified region (0 to 2)
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index ddfd315..7da2ab6 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -77,7 +77,7 @@ void BellbotScript::setupSentences() {
 	_entryCount = 0;
 }
 
-int BellbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+int BellbotScript::process(const TTroomScript *roomScript, const TTsentence *sentence) {
 	int val24 = getValue(24);
 	CTrueTalkManager::setFlags(24, 0);
 
@@ -344,7 +344,7 @@ int BellbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	return 2;
 }
 
-ScriptChangedResult BellbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
+ScriptChangedResult BellbotScript::scriptChanged(const TTroomScript *roomScript, uint id) {
 	if (!roomScript)
 		return SCR_2;
 
@@ -415,7 +415,7 @@ ScriptChangedResult BellbotScript::scriptChanged(TTroomScript *roomScript, uint
 	return SCR_2;
 }
 
-int BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+int BellbotScript::handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
 	switch (tagId) {
 	case MKTAG('A', 'D', 'V', 'T'):
@@ -656,7 +656,7 @@ int BellbotScript::preResponse(uint id) {
 	return newId;
 }
 
-int BellbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int BellbotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence) {
 	switch (val1) {
 	case 1:
 		addResponse(getDialogueId(*srcIdP));
@@ -789,7 +789,7 @@ void BellbotScript::setValue23(uint id) {
 	CTrueTalkManager::setFlags(23, val);
 }
 
-int BellbotScript::preprocess(TTroomScript *roomScript, TTsentence *sentence) {
+int BellbotScript::preprocess(const TTroomScript *roomScript, const TTsentence *sentence) {
 	if (!roomScript || !sentence)
 		return true;
 
@@ -1588,7 +1588,7 @@ stateFlag = false;
 	return applyFlag ? 2 : 1;
 }
 
-bool BellbotScript::better(TTsentence *sentence, uint id1, uint id2) {
+bool BellbotScript::better(const TTsentence *sentence, uint id1, uint id2) {
 	if (sentence->contains("good") || sentence->localWord("better")) {
 		addResponse(getDialogueId(id1));
 	} else if (sentence->localWord("bad")) {
@@ -1600,7 +1600,7 @@ bool BellbotScript::better(TTsentence *sentence, uint id1, uint id2) {
 	return true;
 }
 
-bool BellbotScript::randomResponse0(TTroomScript *roomScript, uint id) {
+bool BellbotScript::randomResponse0(const TTroomScript *roomScript, uint id) {
 	bool dr0 = getDialRegion(0) == 1;
 	uint newId = getValue(1);
 
@@ -1621,7 +1621,7 @@ bool BellbotScript::randomResponse0(TTroomScript *roomScript, uint id) {
 	return true;
 }
 
-bool BellbotScript::randomResponse1(TTroomScript *roomScript, uint id) {
+bool BellbotScript::randomResponse1(const TTroomScript *roomScript, uint id) {
 	if (getRandomNumber(100) < 10) {
 		addResponse(getDialogueId(201978));
 		applyResponse();
@@ -1636,7 +1636,7 @@ bool BellbotScript::randomResponse1(TTroomScript *roomScript, uint id) {
 	return false;
 }
 
-bool BellbotScript::randomResponse2(TTroomScript *roomScript, uint id) {
+bool BellbotScript::randomResponse2(const TTroomScript *roomScript, uint id) {
 	if (getRandomNumber(100) < 5) {
 		addResponse(getDialogueId(202262));
 		applyResponse();
@@ -1651,7 +1651,7 @@ bool BellbotScript::randomResponse2(TTroomScript *roomScript, uint id) {
 	return false;
 }
 
-void BellbotScript::randomResponse3(TTroomScript *roomScript, uint id) {
+void BellbotScript::randomResponse3(const TTroomScript *roomScript, uint id) {
 	bool result = false;
 	if (roomScript && getRandomNumber(100) < 50)
 		result = addRoomDescription(roomScript);
@@ -1676,7 +1676,7 @@ void BellbotScript::randomResponse3(TTroomScript *roomScript, uint id) {
 	addResponse(getDialogueId(id == 1 ? 202265 : 202263));
 }
 
-void BellbotScript::randomResponse4(TTroomScript *roomScript, uint id) {
+void BellbotScript::randomResponse4(const TTroomScript *roomScript, uint id) {
 	if (getRandomNumber(100) < 4 && id <= 2) {
 		addResponse(getDialogueId(202268));
 	} else {
@@ -1684,7 +1684,7 @@ void BellbotScript::randomResponse4(TTroomScript *roomScript, uint id) {
 	}
 }
 
-int BellbotScript::checkCommonSentences(TTroomScript *roomScript, TTsentence *sentence) {
+int BellbotScript::checkCommonSentences(const TTroomScript *roomScript, const TTsentence *sentence) {
 	if (!roomScript || !sentence)
 		return 1;
 
@@ -1707,7 +1707,7 @@ int BellbotScript::checkCommonSentences(TTroomScript *roomScript, TTsentence *se
 	return 0;
 }
 
-bool BellbotScript::checkCommonWords(TTroomScript *roomScript, TTsentence *sentence) {
+bool BellbotScript::checkCommonWords(const TTroomScript *roomScript, const TTsentence *sentence) {
 	if (!roomScript || !sentence)
 		return 0;
 	CTrueTalkManager::setFlags(23, 0);
@@ -1812,7 +1812,7 @@ bool BellbotScript::checkCommonWords(TTroomScript *roomScript, TTsentence *sente
 	return true;
 }
 
-uint BellbotScript::getRoomDialogueId(TTroomScript *roomScript) {
+uint BellbotScript::getRoomDialogueId(const TTroomScript *roomScript) {
 	if (!roomScript)
 		return 0;
 
@@ -1824,7 +1824,7 @@ uint BellbotScript::getRoomDialogueId(TTroomScript *roomScript) {
 	return 0;
 }
 
-bool BellbotScript::addRoomDescription(TTroomScript *roomScript) {
+bool BellbotScript::addRoomDescription(const TTroomScript *roomScript) {
 	if (!roomScript)
 		return false;
 
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index ee5a679..3080b56 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -64,28 +64,28 @@ private:
 	/**
 	 * Does preprocessing for the sentence
 	 */
-	int preprocess(TTroomScript *roomScript, TTsentence *sentence);
+	int preprocess(const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Checks for good, better, or bad in the sentence
 	 */
-	bool better(TTsentence *sentence, uint id1, uint id2);
+	bool better(const TTsentence *sentence, uint id1, uint id2);
 
-	bool randomResponse0(TTroomScript *roomScript, uint id);
-	bool randomResponse1(TTroomScript *roomScript, uint id);
-	bool randomResponse2(TTroomScript *roomScript, uint id);
-	void randomResponse3(TTroomScript *roomScript, uint id);
-	void randomResponse4(TTroomScript *roomScript, uint id);
+	bool randomResponse0(const TTroomScript *roomScript, uint id);
+	bool randomResponse1(const TTroomScript *roomScript, uint id);
+	bool randomResponse2(const TTroomScript *roomScript, uint id);
+	void randomResponse3(const TTroomScript *roomScript, uint id);
+	void randomResponse4(const TTroomScript *roomScript, uint id);
 
-	int checkCommonSentences(TTroomScript *roomScript, TTsentence *sentence);
-	bool checkCommonWords(TTroomScript *roomScript, TTsentence *sentence);
+	int checkCommonSentences(const TTroomScript *roomScript, const TTsentence *sentence);
+	bool checkCommonWords(const TTroomScript *roomScript, const TTsentence *sentence);
 
-	uint getRoomDialogueId(TTroomScript *roomScript);
+	uint getRoomDialogueId(const TTroomScript *roomScript);
 	
 	/**
 	 * Adds a description of the room to the conversation response
 	 */
-	bool addRoomDescription(TTroomScript *roomScript);
+	bool addRoomDescription(const TTroomScript *roomScript);
 public:
 	BellbotScript(int val1, const char *charClass, int v2,
 		const char *charName, int v3, int val2);
@@ -93,14 +93,14 @@ public:
 	/**
 	 * Does NPC specific processing of the parsed sentence
 	 */
-	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
+	virtual int process(const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(const TTroomScript *roomScript, uint id);
 
-	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+	virtual int handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 
 	/**
@@ -116,7 +116,7 @@ public:
 	/**
 	 * Process a sentence fragment entry
 	 */
-	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Handles a randomzied response
diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index c955e7e..d9bab2e 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -60,7 +60,7 @@ void DeskbotScript::setupSentences() {
 	_entryCount = 0;
 }
 
-int DeskbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+int DeskbotScript::process(const TTroomScript *roomScript, const TTsentence *sentence) {
 	if (roomScript->_scriptId != 110)
 		return 2;
 
@@ -76,12 +76,12 @@ int DeskbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	return 0;
 }
 
-ScriptChangedResult DeskbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
+ScriptChangedResult DeskbotScript::scriptChanged(const TTroomScript *roomScript, uint id) {
 	warning("TODO");
 	return SCR_1;
 }
 
-int DeskbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+int DeskbotScript::handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
 	switch (tagId) {
 	case MKTAG('A', 'D', 'V', 'T'):
@@ -281,7 +281,7 @@ uint DeskbotScript::getDialsBitset() const {
 		return getDialRegion(0) ? 0 : 1;
 }
 
-int DeskbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int DeskbotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence) {
 	uint id;
 
 	switch (val1) {
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 55896a2..8f37b4b 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -94,14 +94,14 @@ public:
 	/**
 	 * Does NPC specific processing of the parsed sentence
 	 */
-	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
+	virtual int process(const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(const TTroomScript *roomScript, uint id);
 
-	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+	virtual int handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 
 	/**
@@ -122,7 +122,7 @@ public:
 	/**
 	 * Process a sentence fragment entry
 	 */
-	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Handles a randomzied response
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 7319058..6a31f93 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -71,7 +71,7 @@ void DoorbotScript::setupSentences() {
 	_entryCount = 0;
 }
 
-int DoorbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
+int DoorbotScript::chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag) {
 	if (tag == MKTAG('D', 'N', 'A', '1') || tag == MKTAG('H', 'H', 'G', 'Q') ||
 		tag == MKTAG('A', 'N', 'S', 'W') || tag == MKTAG('S', 'U', 'M', 'S')) {
 		if (_stateIndex > 9)
@@ -127,17 +127,17 @@ int DoorbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence
 	return TTnpcScript::chooseResponse(roomScript, sentence, tag);
 }
 
-int DoorbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+int DoorbotScript::process(const TTroomScript *roomScript, const TTsentence *sentence) {
 	// TODO
 	return 0;
 }
 
-ScriptChangedResult DoorbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
+ScriptChangedResult DoorbotScript::scriptChanged(const TTroomScript *roomScript, uint id) {
 	warning("TODO");
 	return SCR_1;
 }
 
-int DoorbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+int DoorbotScript::handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
 	switch (tagId) {
 	case MKTAG('A', 'D', 'V', 'T'):
@@ -336,7 +336,7 @@ uint DoorbotScript::getDialsBitset() const {
 	return bits;
 }
 
-int DoorbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int DoorbotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence) {
 	int id2, id = 0;
 
 	switch (val1) {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index be653fd..ec61529 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -58,19 +58,19 @@ public:
 	/**
 	 * Chooses and adds a conversation response based on a specified tag Id.
 	 */
-	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+	virtual int chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag);
 
 	/**
 	 * Does NPC specific processing of the parsed sentence
 	 */
-	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
+	virtual int process(const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(const TTroomScript *roomScript, uint id);
 
-	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+	virtual int handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 
 	/**
@@ -91,7 +91,7 @@ public:
 	/**
 	 * Process a sentence fragment entry
 	 */
-	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Sets a given dial to be pointing in a specified region (0 to 2)
diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp
index 2f079cb..027d597 100644
--- a/engines/titanic/true_talk/liftbot_script.cpp
+++ b/engines/titanic/true_talk/liftbot_script.cpp
@@ -56,7 +56,7 @@ void LiftbotScript::setupSentences() {
 	_entryCount = 0;
 }
 
-int LiftbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
+int LiftbotScript::chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag) {
 	switch (tag) {
 	case MKTAG('D', 'N', 'A', '1'):
 	case MKTAG('H', 'H', 'G', 'Q'):
@@ -85,7 +85,7 @@ int LiftbotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence
 	}
 }
 
-int LiftbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+int LiftbotScript::process(const TTroomScript *roomScript, const TTsentence *sentence) {
 	// TODO
 	return 0;
 }
@@ -95,12 +95,12 @@ int LiftbotScript::proc9() const {
 	return 0;
 }
 
-ScriptChangedResult LiftbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
+ScriptChangedResult LiftbotScript::scriptChanged(const TTroomScript *roomScript, uint id) {
 	warning("TODO");
 	return SCR_1;
 }
 
-int LiftbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+int LiftbotScript::handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
 	switch (tagId) {
 	case MKTAG('A', 'D', 'V', 'T'):
@@ -247,7 +247,7 @@ uint LiftbotScript::getDialsBitset() const {
 }
 
 
-int LiftbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int LiftbotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence) {
 	static const int ARRAY13[] = {
 		210724, 210735, 210746, 210757, 210758, 210759, 210760,
 		210761, 210762, 210725, 210726, 210727, 210728, 210729,
diff --git a/engines/titanic/true_talk/liftbot_script.h b/engines/titanic/true_talk/liftbot_script.h
index 55752e1..d2f5a30 100644
--- a/engines/titanic/true_talk/liftbot_script.h
+++ b/engines/titanic/true_talk/liftbot_script.h
@@ -53,21 +53,21 @@ public:
 	/**
 	 * Chooses and adds a conversation response based on a specified tag Id.
 	 */
-	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+	virtual int chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag);
 
 	/**
 	 * Does NPC specific processing of the parsed sentence
 	 */
-	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
+	virtual int process(const TTroomScript *roomScript, const TTsentence *sentence);
 
 	virtual int proc9() const;
 
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(const TTroomScript *roomScript, uint id);
 
-	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+	virtual int handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 
 	/**
@@ -88,7 +88,7 @@ public:
 	/**
 	 * Process a sentence fragment entry
 	 */
-	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Sets a given dial to be pointing in a specified region (0 to 2)
diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp
index 7da541f..57ae517 100644
--- a/engines/titanic/true_talk/maitred_script.cpp
+++ b/engines/titanic/true_talk/maitred_script.cpp
@@ -53,7 +53,7 @@ void MaitreDScript::setupSentences() {
 	_entryCount = 0;
 }
 
-int MaitreDScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
+int MaitreDScript::chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag) {
 	if (tag == MKTAG('F', 'O', 'O', 'D') || tag == MKTAG('F', 'I', 'S', 'H') ||
 			tag == MKTAG('C', 'H', 'S', 'E')) {
 		addResponse(getDialogueId(260388));
@@ -65,17 +65,17 @@ int MaitreDScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence
 	return TTnpcScript::chooseResponse(roomScript, sentence, tag);
 }
 
-int MaitreDScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+int MaitreDScript::process(const TTroomScript *roomScript, const TTsentence *sentence) {
 	// TODO
 	return 0;
 }
 
-ScriptChangedResult MaitreDScript::scriptChanged(TTroomScript *roomScript, uint id) {
+ScriptChangedResult MaitreDScript::scriptChanged(const TTroomScript *roomScript, uint id) {
 	warning("TODO");
 	return SCR_1;
 }
 
-int MaitreDScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+int MaitreDScript::handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
 	switch (tagId) {
 	case MKTAG('A', 'D', 'V', 'T'):
@@ -301,7 +301,7 @@ int MaitreDScript::preResponse(uint id) {
 	return 0;
 }
 
-int MaitreDScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int MaitreDScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/maitred_script.h b/engines/titanic/true_talk/maitred_script.h
index 06fc686..bed93fa 100644
--- a/engines/titanic/true_talk/maitred_script.h
+++ b/engines/titanic/true_talk/maitred_script.h
@@ -63,19 +63,19 @@ public:
 	/**
 	 * Chooses and adds a conversation response based on a specified tag Id.
 	 */
-	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+	virtual int chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag);
 
 	/**
 	 * Does NPC specific processing of the parsed sentence
 	 */
-	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
+	virtual int process(const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(const TTroomScript *roomScript, uint id);
 
-	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+	virtual int handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 
 	/**
@@ -91,7 +91,7 @@ public:
 	/**
 	 * Process a sentence fragment entry
 	 */
-	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp
index 96efc62..b09e745 100644
--- a/engines/titanic/true_talk/parrot_script.cpp
+++ b/engines/titanic/true_talk/parrot_script.cpp
@@ -41,7 +41,7 @@ void ParrotScript::setupSentences() {
 	_entryCount = 0;
 }
 
-int ParrotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
+int ParrotScript::chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag) {
 	if (tag == MKTAG('B', 'Y', 'Z', 'A')) {
 		addResponse(getDialogueId(280246));
 		applyResponse();
@@ -51,7 +51,7 @@ int ParrotScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 	}
 }
 
-int ParrotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+int ParrotScript::process(const TTroomScript *roomScript, const TTsentence *sentence) {
 	if (processEntries(roomScript, sentence) == 2) {
 		int tagId = g_vm->_trueTalkManager->_quotes.find(sentence->_normalizedLine);
 		if (!tagId || chooseResponse(roomScript, sentence, tagId) != 2) {
@@ -63,7 +63,7 @@ int ParrotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
 	return 2;
 }
 
-ScriptChangedResult ParrotScript::scriptChanged(TTroomScript *roomScript, uint id) {
+ScriptChangedResult ParrotScript::scriptChanged(const TTroomScript *roomScript, uint id) {
 	if (id >= 280000 && id <= 280276) {
 		if (id == 280258) {
 			if (CTrueTalkManager::_currentNPC) {
@@ -103,7 +103,7 @@ ScriptChangedResult ParrotScript::scriptChanged(TTroomScript *roomScript, uint i
 	return (id == 3) ? SCR_2 : SCR_1;
 }
 
-int ParrotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int ParrotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence) {
 	return 0;
 }
 
diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h
index 7e473bf..ec7bec7 100644
--- a/engines/titanic/true_talk/parrot_script.h
+++ b/engines/titanic/true_talk/parrot_script.h
@@ -40,22 +40,22 @@ public:
 	/**
 	 * Chooses and adds a conversation response based on a specified tag Id.
 	 */
-	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+	virtual int chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag);
 
 	/**
 	 * Does NPC specific processing of the parsed sentence
 	 */
-	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
+	virtual int process(const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(const TTroomScript *roomScript, uint id);
 
 	/**
 	 * Process a sentence fragment entry
 	 */
-	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp
index 9be7795..e950f54 100644
--- a/engines/titanic/true_talk/succubus_script.cpp
+++ b/engines/titanic/true_talk/succubus_script.cpp
@@ -41,7 +41,7 @@ void SuccUBusScript::setupSentences() {
 	_entryCount = 0;
 }
 
-int SuccUBusScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
+int SuccUBusScript::chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag) {
 	uint dialogueId = tag;
 
 	switch (tag) {
@@ -74,12 +74,12 @@ int SuccUBusScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentenc
 	}
 }
 
-int SuccUBusScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+int SuccUBusScript::process(const TTroomScript *roomScript, const TTsentence *sentence) {
 	// TODO
 	return 0;
 }
 
-ScriptChangedResult SuccUBusScript::scriptChanged(TTroomScript *roomScript, uint id) {
+ScriptChangedResult SuccUBusScript::scriptChanged(const TTroomScript *roomScript, uint id) {
 	warning("TODO");
 	return SCR_1;
 }
@@ -89,7 +89,7 @@ int SuccUBusScript::updateState(uint oldId, uint newId, int index) {
 	return 0;
 }
 
-int SuccUBusScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int SuccUBusScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence) {
 	warning("TODO");
 	return 0;
 }
diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h
index 4ea85f1..541392e 100644
--- a/engines/titanic/true_talk/succubus_script.h
+++ b/engines/titanic/true_talk/succubus_script.h
@@ -42,17 +42,17 @@ public:
 	/**
 	 * Chooses and adds a conversation response based on a specified tag Id.
 	 */
-	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+	virtual int chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag);
 
 	/**
 	 * Does NPC specific processing of the parsed sentence
 	 */
-	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
+	virtual int process(const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
+	virtual ScriptChangedResult scriptChanged(const TTroomScript *roomScript, uint id);
 
 	/**
 	 * Handles updating NPC state based on specified dialogue Ids and dial positions
@@ -62,7 +62,7 @@ public:
 	/**
 	 * Process a sentence fragment entry
 	 */
-	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence);
 };
 
 } // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index b61b9d5..614b607 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -210,7 +210,7 @@ void TTnpcScript::addResponse(int id) {
 	TTscriptBase::addResponse(id);
 }
 
-int TTnpcScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) {
+int TTnpcScript::chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag) {
 	for (uint idx = 0; idx < _responses.size(); ++idx) {
 		const TTnpcScriptResponse &response = _responses[idx];
 
@@ -231,7 +231,7 @@ int TTnpcScript::chooseResponse(TTroomScript *roomScript, TTsentence *sentence,
 	return 1;
 }
 
-int TTnpcScript::process(TTroomScript *roomScript, TTsentence *sentence) {
+int TTnpcScript::process(const TTroomScript *roomScript, const TTsentence *sentence) {
 	return processEntries(&_entries, _entryCount, roomScript, sentence);
 }
 
@@ -275,7 +275,7 @@ bool TTnpcScript::handleWord(uint id) const {
 	return true;
 }
 
-int TTnpcScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+int TTnpcScript::handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder) {
 	if (_quotes.empty())
 		return 1;
@@ -395,7 +395,7 @@ const TTscriptMapping *TTnpcScript::getMapping(int index) {
 	return nullptr;
 }
 
-int TTnpcScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
+int TTnpcScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence) {
 	return 0;
 }
 
@@ -698,7 +698,7 @@ CPetControl *TTnpcScript::getPetControl(CGameManager *gameManager) {
 	return nullptr;
 }
 
-int TTnpcScript::processEntries(const TTsentenceEntries *entries, uint entryCount, TTroomScript *roomScript, TTsentence *sentence) {
+int TTnpcScript::processEntries(const TTsentenceEntries *entries, uint entryCount, const TTroomScript *roomScript, const TTsentence *sentence) {
 	if (!entries)
 		return SS_1;
 	if (!entryCount)
@@ -769,7 +769,7 @@ int TTnpcScript::processEntries(const TTsentenceEntries *entries, uint entryCoun
 	return 1;
 }
 
-bool TTnpcScript::defaultProcess(TTroomScript *roomScript, TTsentence *sentence) {
+bool TTnpcScript::defaultProcess(const TTroomScript *roomScript, const TTsentence *sentence) {
 	uint remainder;
 	TTtreeResult results[32];
 	const TTstring &line = sentence->_normalizedLine;
@@ -803,7 +803,7 @@ TTscriptRange *TTnpcScript::findRange(uint id) {
 	return nullptr;
 }
 
-void TTnpcScript::checkItems(TTroomScript *roomScript, TTsentence *sentence) {
+void TTnpcScript::checkItems(const TTroomScript *roomScript, const TTsentence *sentence) {
 	_field2CC = 0;
 	++CTrueTalkManager::_v2;
 
diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h
index ddb5b8f..21ab1be 100644
--- a/engines/titanic/true_talk/tt_npc_script.h
+++ b/engines/titanic/true_talk/tt_npc_script.h
@@ -59,12 +59,12 @@ public:
 	/**
 	 * Chooses and adds a conversation response based on a specified tag Id.
 	 */
-	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag) = 0;
+	virtual int chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag) = 0;
 
 	/**
 	 * Does NPC specific processing of the parsed sentence
 	 */
-	virtual int process(TTroomScript *roomScript, TTsentence *sentence) = 0;
+	virtual int process(const TTroomScript *roomScript, const TTsentence *sentence) = 0;
 
 	virtual int proc8() const = 0;
 	virtual int proc9() const = 0;
@@ -72,7 +72,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id) = 0;
+	virtual ScriptChangedResult scriptChanged(const TTroomScript *roomScript, uint id) = 0;
 
 	virtual int proc11() const = 0;
 	virtual int proc12() const = 0;
@@ -168,18 +168,18 @@ protected:
 	/**
 	 * Scans through a list of sentence entries for a matching standardized response
 	 */
-	int processEntries(const TTsentenceEntries *entries, uint entryCount, TTroomScript *roomScript, TTsentence *sentence);
+	int processEntries(const TTsentenceEntries *entries, uint entryCount, const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Scans through a list of sentence entries for a matching standardized response
 	 */
-	int processEntries(TTroomScript *roomScript, TTsentence *sentence) {
+	int processEntries(const TTroomScript *roomScript, const TTsentence *sentence) {
 		return processEntries(&_entries, _entryCount, roomScript, sentence);
 	}
 
-	bool defaultProcess(TTroomScript *roomScript, TTsentence *sentence);
+	bool defaultProcess(const TTroomScript *roomScript, const TTsentence *sentence);
 
-	void checkItems(TTroomScript *roomScript, TTsentence *sentence);
+	void checkItems(const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Adds a random conversation response
@@ -224,12 +224,12 @@ public:
 	 * This default implementation does a lookup into a list of known tags,
 	 * and chooses a random dialogue Id from the available ones for that tag
 	 */
-	virtual int chooseResponse(TTroomScript *roomScript, TTsentence *sentence, uint tag);
+	virtual int chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag);
 
 	/**
 	 * Does NPC specific processing of the parsed sentence
 	 */
-	virtual int process(TTroomScript *roomScript, TTsentence *sentence);
+	virtual int process(const TTroomScript *roomScript, const TTsentence *sentence);
 
 	virtual int proc8() const;
 	virtual int proc9() const;
@@ -237,7 +237,7 @@ public:
 	/**
 	 * Called when the script/id changes
 	 */
-	virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id) {
+	virtual ScriptChangedResult scriptChanged(const TTroomScript *roomScript, uint id) {
 		return SCR_2;
 	}
 
@@ -256,7 +256,7 @@ public:
 	 */
 	virtual bool handleWord(uint id) const;
 
-	virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
+	virtual int handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,
 		uint val, uint tagId, uint remainder);
 
 	/**
@@ -287,12 +287,12 @@ public:
 	virtual uint getDialsBitset() const { return 0; }
 	
 	virtual const TTscriptMapping *getMapping(int index);
-	virtual int doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence);
+	virtual int doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence);
 
 	/**
 	 * Handles any post-response NPC processing
 	 */
-	virtual void postResponse(int v1, const TTsentenceEntry *entry, TTroomScript *roomScript, TTsentence *sentence) {}
+	virtual void postResponse(int v1, const TTsentenceEntry *entry, const TTroomScript *roomScript, const TTsentence *sentence) {}
 	
 	virtual void save(SimpleFile *file);
 	virtual void load(SimpleFile *file);
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 467f6a1..6a8e74d 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -108,19 +108,19 @@ int TTsentence::storeVocabHit(TTword *word) {
 }
 
 bool TTsentence::fn1(const CString &str, int wordId1, const CString &str1, const CString &str2,
-		const CString &str3, int wordId2, int val, int val2, const TTconceptNode *node) {
+		const CString &str3, int wordId2, int val, int val2, const TTconceptNode *node) const {
 	// TODO
 	return false;
 }
 
 bool TTsentence::fn3(const CString &str1, const CString &str2, const CString &str3,
 		const CString &str4, const CString &str5, const CString &str6,
-		int val, int val2, const TTconceptNode *node) {
+		int val, int val2, const TTconceptNode *node) const {
 	// TODO
 	return false;
 }
 
-bool TTsentence::fn2(int slotIndex, const TTstring &str, TTconceptNode *conceptNode) {
+bool TTsentence::fn2(int slotIndex, const TTstring &str, const TTconceptNode *conceptNode) const {
 	if (!conceptNode)
 		conceptNode = &_sentenceConcept;
 	TTconcept *concept = getFrameSlot(slotIndex, conceptNode);
@@ -199,7 +199,7 @@ exit:
 	return abortFlag;
 }
 
-bool TTsentence::fn4(int mode, int wordId, TTconceptNode *node) {
+bool TTsentence::fn4(int mode, int wordId, const TTconceptNode *node) const {
 	if (!node)
 		node = &_sentenceConcept;
 
@@ -256,7 +256,7 @@ int TTsentence::is1C(int val, const TTconceptNode *node) const {
 	return node->_field1C == val;
 }
 
-bool TTsentence::isConcept34(int slotIndex, TTconceptNode *node) {
+bool TTsentence::isConcept34(int slotIndex, const TTconceptNode *node) const {
 	TTconcept *concept = getFrameEntry(slotIndex, node);
 	return concept && concept->getState();
 }
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 2900a4d..8cecaed 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -109,14 +109,14 @@ public:
 	int storeVocabHit(TTword *word);
 
 	bool fn1(const CString &str, int wordId1, const CString &str1, const CString &str2,
-		const CString &str3, int wordId2, int val, int val2, const TTconceptNode *node);
+		const CString &str3, int wordId2, int val, int val2, const TTconceptNode *node) const;
 	bool fn3(const CString &str1, const CString &str2, const CString &str3,
 		const CString &str4, const CString &str5, const CString &str6,
-		int val, int val2, const TTconceptNode *node);
-	bool fn2(int slotIndex, const TTstring &str, TTconceptNode *conceptNode);
-	bool fn4(int mode, int wordId, TTconceptNode *node);
+		int val, int val2, const TTconceptNode *node) const;
+	bool fn2(int slotIndex, const TTstring &str, const TTconceptNode *conceptNode) const;
+	bool fn4(int mode, int wordId, const TTconceptNode *node) const;
 
-	bool isConcept34(int slotIndex, TTconceptNode *node = nullptr);
+	bool isConcept34(int slotIndex, const TTconceptNode *node = nullptr) const;
 
 	bool localWord(const char *str) const;
 


Commit: af286f2c979c2a959894ec003843c295b04d49ee
    https://github.com/scummvm/scummvm/commit/af286f2c979c2a959894ec003843c295b04d49ee
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-31T15:02:09-04:00

Commit Message:
DEVTOOLS: Add entries sentence sets for Deskbot in create_titanic

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index bf1da8e..1f359c4 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -648,6 +648,8 @@ void writeData() {
 	writeSentenceEntries("Sentences/Bellbot/19", 0x5D61B8);
 
 	writeSentenceEntries("Sentences/Deskbot", 0x5DCD10);
+	writeSentenceEntries("Sentences/Deskbot/2", 0x5E8E18);
+	writeSentenceEntries("Sentences/Deskbot/3", 0x5E8BA8);
 	writeSentenceEntries("Sentences/Doorbot", 0x5EC110);
 	writeSentenceEntries("Sentences/Liftbot", 0x6026B0);
 	writeSentenceEntries("Sentences/MaitreD", 0x60CFD8);


Commit: 267b8405fdf71b13eaa68b09ae74b1986deea4fa
    https://github.com/scummvm/scummvm/commit/267b8405fdf71b13eaa68b09ae74b1986deea4fa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-31T15:02:29-04:00

Commit Message:
TITANIC: Added DeskbotScript process

Changed paths:
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h



diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index d9bab2e..56f20f9 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -55,6 +55,8 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
 void DeskbotScript::setupSentences() {
 	_mappings.load("Mappings/Deskbot", 4);
 	_entries.load("Sentences/Deskbot");
+	_entries2.load("Sentences/Deskbot/2");
+	_entries3.load("Sentences/Deskbot/3");
 	_dialValues[0] = _dialValues[1] = 0;
 	_field68 = 0;
 	_entryCount = 0;
@@ -72,8 +74,66 @@ int DeskbotScript::process(const TTroomScript *roomScript, const TTsentence *sen
 	if (preprocess(roomScript, sentence) != 1)
 		return 1;
 
-	// TODO
-	return 0;
+	CTrueTalkManager::setFlags(17, 0);
+	setState(0);
+	updateCurrentDial(false);
+
+	if (getValue(1) == 3) {
+		if (sentence->localWord("competition") || sentence->contains("competition")
+				|| sentence->localWord("won") || sentence->contains("won")
+				|| sentence->localWord("winning") || sentence->contains("winning")
+				|| sentence->localWord("winner") || sentence->contains("winner")
+				|| sentence->contains("35279") || sentence->contains("3 5 2 7 9")
+				) {
+			addResponse(getDialogueId(41773));
+			applyResponse();
+			return 2;
+		} else if (sentence->localWord("magazine") || sentence->contains("magazine")) {
+			addResponse(getDialogueId(41771));
+			applyResponse();
+			return 2;
+		} else if (sentence->localWord("upgrade") || sentence->contains("upgrade")) {
+			if (CTrueTalkManager::_currentNPC) {
+				CGameObject *obj;
+				if (CTrueTalkManager::_currentNPC->find("Magazine", &obj, FIND_PET)) {
+					addResponse(getDialogueId(41773));
+					applyResponse();
+					return 2;
+				}
+			}
+		}
+	}
+
+	if (processEntries(&_entries, _entryCount, roomScript, sentence) != 2
+			&& processEntries(&_entries2, 0, roomScript, sentence) != 2) {
+		if (sentence->localWord("sauce") || sentence->localWord("pureed")) {
+			addResponse(getDialogueId(240398));
+			applyResponse();
+		} else if (sentence->contains("cherries")) {
+			addResponse(getDialogueId(240358));
+			applyResponse();
+		} else if (sentence->contains("42")) {
+			addResponse(getDialogueId(240453));
+			applyResponse();
+		} else if (searchQuotes(roomScript, sentence)) {
+			addResponse(getDialogueId(241778));
+			applyResponse();
+		} else {
+			if (sentence->contains("98129812"))
+				setDialRegion(1, 1);
+
+			if (!defaultProcess(roomScript, sentence)
+					&& processEntries(&_entries3, 0, roomScript, sentence) != 2
+					&& processEntries(_defaultEntries, 0, roomScript, sentence) != 2) {
+				if (flag20)
+					CTrueTalkManager::setFlags(20, 1);
+				addResponse(getDialogueId(240569));
+				applyResponse();
+			}
+		}
+	}
+
+	return 2;
 }
 
 ScriptChangedResult DeskbotScript::scriptChanged(const TTroomScript *roomScript, uint id) {
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index 8f37b4b..f597855 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -32,6 +32,8 @@ class DeskbotScript : public TTnpcScript {
 private:
 	static int _oldId;
 	TTupdateStateArray _states;
+	TTsentenceEntries _entries2;
+	TTsentenceEntries _entries3;
 private:
 	/**
 	 * Setup sentence data


Commit: 16aeae7819c61d7b324564fd4ddf62f86e1cb28c
    https://github.com/scummvm/scummvm/commit/16aeae7819c61d7b324564fd4ddf62f86e1cb28c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-31T15:07:48-04:00

Commit Message:
TITANIC: Added DeskbotScript scriptChanged

Changed paths:
    engines/titanic/true_talk/deskbot_script.cpp



diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 56f20f9..3f35888 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -137,8 +137,35 @@ int DeskbotScript::process(const TTroomScript *roomScript, const TTsentence *sen
 }
 
 ScriptChangedResult DeskbotScript::scriptChanged(const TTroomScript *roomScript, uint id) {
-	warning("TODO");
-	return SCR_1;
+	switch (id) {
+	case 3:
+	case 100:
+	case 108:
+		CTrueTalkManager::setFlags(21, getValue(21) + 1);
+		addResponse(getDialogueId(getValue(22) ? 240577 : 241261));
+		applyResponse();
+		break;
+
+	case 109:
+		addResponse(getDialogueId(241627));
+		applyResponse();
+		break;
+
+	case 140:
+		if (getValue(1) == 3)
+			addAssignedRoomDialogue3();
+		break;
+
+	case 148:
+		CTrueTalkManager::setFlags(3, 1);
+		break;
+
+	case 150:
+		CTrueTalkManager::setFlags(2, 1);
+		break;
+	}
+
+	return SCR_2;
 }
 
 int DeskbotScript::handleQuote(const TTroomScript *roomScript, const TTsentence *sentence,


Commit: 19f8a0965be832a71a101054748cf000adf16add
    https://github.com/scummvm/scummvm/commit/19f8a0965be832a71a101054748cf000adf16add
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-07-31T17:16:23-04:00

Commit Message:
TITANIC: Added DoorbotScript process

Changed paths:
    devtools/create_titanic/create_titanic_dat.cpp
    engines/titanic/true_talk/doorbot_script.cpp
    engines/titanic/true_talk/doorbot_script.h



diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 1f359c4..2fe6679 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -55,7 +55,7 @@
  */
 
 #define VERSION_NUMBER 1
-#define HEADER_SIZE 0xB00
+#define HEADER_SIZE 0xD00
 
 Common::File inputFile, outputFile;
 Common::PEResources res;
@@ -650,7 +650,20 @@ void writeData() {
 	writeSentenceEntries("Sentences/Deskbot", 0x5DCD10);
 	writeSentenceEntries("Sentences/Deskbot/2", 0x5E8E18);
 	writeSentenceEntries("Sentences/Deskbot/3", 0x5E8BA8);
+	
 	writeSentenceEntries("Sentences/Doorbot", 0x5EC110);
+	writeSentenceEntries("Sentences/Doorbot/2", 0x5FD930);
+	writeSentenceEntries("Sentences/Doorbot/100", 0x5FD930);
+	writeSentenceEntries("Sentences/Doorbot/101", 0x5FE668);
+	writeSentenceEntries("Sentences/Doorbot/102", 0x5FDD40);
+	writeSentenceEntries("Sentences/Doorbot/107", 0x5FFF08);
+	writeSentenceEntries("Sentences/Doorbot/110", 0x5FE3C0);
+	writeSentenceEntries("Sentences/Doorbot/111", 0x5FF0C8);
+	writeSentenceEntries("Sentences/Doorbot/124", 0x5FF780);
+	writeSentenceEntries("Sentences/Doorbot/129", 0x5FFAC0);
+	writeSentenceEntries("Sentences/Doorbot/131", 0x5FFC30);
+	writeSentenceEntries("Sentences/Doorbot/132", 0x6000E0);
+
 	writeSentenceEntries("Sentences/Liftbot", 0x6026B0);
 	writeSentenceEntries("Sentences/MaitreD", 0x60CFD8);
 	writeSentenceEntries("Sentences/Parrot", 0x615858);
diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp
index 6a31f93..230acf7 100644
--- a/engines/titanic/true_talk/doorbot_script.cpp
+++ b/engines/titanic/true_talk/doorbot_script.cpp
@@ -24,6 +24,7 @@
 #include "titanic/true_talk/doorbot_script.h"
 #include "titanic/true_talk/tt_room_script.h"
 #include "titanic/true_talk/true_talk_manager.h"
+#include "titanic/titanic.h"
 
 namespace Titanic {
 
@@ -63,12 +64,20 @@ void DoorbotScript::setupSentences() {
 	for (int idx = 35; idx < 40; ++idx)
 		CTrueTalkManager::setFlags(idx, 0);
 	_state = 1;
+	_field68 = 0;
+	_entryCount = 0;
 	_dialValues[0] = _dialValues[1] = 100;
 
 	_mappings.load("Mappings/Doorbot", 4);
 	_entries.load("Sentences/Doorbot");
-	_field68 = 0;
-	_entryCount = 0;
+	
+	static const int SENTENCE_NUMS[11] = {
+		2, 100, 101, 102, 107, 110, 111, 124, 129, 131, 132
+	};
+	for (int idx = 0; idx < 11; ++idx) {
+		_sentences[idx] = TTsentenceEntries();
+		_sentences[idx].load(CString::format("Sentences/Doorbot/%d", SENTENCE_NUMS[idx]));
+	}
 }
 
 int DoorbotScript::chooseResponse(const TTroomScript *roomScript, const TTsentence *sentence, uint tag) {
@@ -128,8 +137,368 @@ int DoorbotScript::chooseResponse(const TTroomScript *roomScript, const TTsenten
 }
 
 int DoorbotScript::process(const TTroomScript *roomScript, const TTsentence *sentence) {
-	// TODO
-	return 0;
+	int currState;
+
+	switch (roomScript->_scriptId) {
+	case 100:
+	case 101:
+	case 102:
+	case 103:
+	case 104:
+	case 106:
+	case 107:
+	case 108:
+	case 109:
+	case 110:
+	case 111:
+	case 113:
+	case 116:
+	case 117:
+	case 118:
+	case 122:
+	case 123:
+	case 124:
+	case 125:
+	case 126:
+	case 127:
+	case 128:
+	case 129:
+	case 130:
+	case 131:
+	case 132:
+		break;
+
+	default:
+		return 2;
+	}
+
+	checkItems(nullptr, nullptr);
+	if (getState() == 0) {
+		if (CTrueTalkManager::_v2 > getValue(36)) {
+			if (getDialRegion(1) == 1 && getRandomBit()) {
+				setDialRegion(0, getDialRegion(1) ? 0 : 1);
+			} else {
+				setDialRegion(1, getDialRegion(1) ? 0 : 1);
+			}
+			CTrueTalkManager::setFlags(36, CTrueTalkManager::_v2 + 3 + getRandomNumber(5));
+
+			if (getValue(37)) {
+				CTrueTalkManager::setFlags(37, 0);
+				setState(0);
+				return setResponse(getDialogueId(221140));
+			}
+		}
+	}
+
+	if (getValue(35) == 0 && roomScript->_scriptId != 100 && sentence->localWord("parrot")) {
+		CTrueTalkManager::setFlags(35, 1);
+		setState(0);
+		return setResponse(getDialogueId(220113));
+	}
+
+	if (sentence->_field2C == 6 && sentence->contains("why not")) {
+		return setResponse(11871, 8);
+	}
+
+	currState = getState();
+	if (currState) {
+		int sentMode = sentence->_field2C;
+		bool al = sentMode == 11 || sentMode == 13;
+		bool bl = sentMode == 12;
+
+		switch (currState) {
+		case 1:
+			if (al)
+				return setResponse(11828, 2);
+			if (bl)
+				return setResponse(11827, 0);
+			break;
+
+		case 2:
+			if (al)
+				return setResponse(11827, 0);
+			break;
+
+		case 3:
+			if (sentMode == 3)
+				return setResponse(10406, 0);
+			break;
+
+		case 4:
+			if (al)
+				return setResponse(11332, 0);
+			if (bl)
+				return setResponse(11331, 0);
+			break;
+
+		case 5:
+			return setResponse(11868, 0);
+
+		case 6:
+			return setResponse(11872, 0);
+
+		case 7:
+			return setResponse(11869, 0);
+
+		case 8:
+			return setResponse(11870, 0);
+
+		case 12:
+			if (al)
+				return setResponse(11894, 13);
+			if (bl)
+				return setResponse(11893, 13);
+			break;
+
+		case 13:
+			return setResponse(11895, 12);
+
+		case 15:
+			if (sentMode == 3 || sentMode == 6)
+				return setResponse(10257, 0);
+			break;
+
+		case 16: {
+			TTtreeResult treeResult;
+			if (g_vm->_trueTalkManager->_quotesTree.search(sentence->_normalizedLine.c_str(),
+					TREE_3, &treeResult, 0, nullptr) != -1)
+				return setResponse(getDialogueId(221380), 0);
+			break;
+		}
+
+		case 17:
+			return setResponse(getDialogueId(221126), 0);
+
+		case 18:
+			if (al)
+				return setResponse(getDialogueId(221135), 0);
+			if (bl)
+				return setResponse(getDialogueId(221134), 0);
+			break;
+
+		case 19:
+			if (al) {
+				if (addRandomResponse(true)) {
+					setState(10);
+					return 2;
+				}
+			}
+			if (bl)
+				return setResponse(getDialogueId(221966), 0);
+			break;
+
+		case 20:
+			if (al) {
+				if (addRandomResponse(true)) {
+					setState(19);
+					return 2;
+				}
+			}
+			if (bl || sentMode == 7 || sentMode == 10) {
+				return setResponse(getDialogueId(221879), 0);
+			}
+			break;
+
+		case 21:
+			if (bl)
+				return setResponse(10935, 0);
+			break;
+
+		case 22:
+			if (al) {
+				if (getRandomBit()) {
+					return setResponse(11211, 23);
+				} else {
+					return setResponse(10127, 0);
+				}
+			}
+			if (bl)
+				return setResponse(10136, 0);
+			break;
+
+		case 23:
+			return setResponse(10212, 0);
+
+		case 24:
+			if (al)
+				return setResponse(11151, 0);
+			if (bl)
+				return setResponse(11150, 0);
+			break;
+
+		case 25:
+		case 26:
+			if (bl) {
+				if (getRandomBit()) {
+					return setResponse(11211, 23);
+				} else {
+					return setResponse(10127, 0);
+				}
+			}
+			if (al)
+				return setResponse(10136, 0);
+			break;
+
+		case 27:
+			if (al || sentence->localWord("did") || sentence->contains("did"))
+				return setResponse(221175, 28);
+			break;
+
+		case 28:
+			if (al || sentence->localWord("did") || sentence->contains("did"))
+				return setResponse(getDialogueId(221176), 29);
+			break;
+
+		case 29:
+			if (al || sentence->localWord("did") || sentence->contains("did"))
+				return setResponse(getDialogueId(221177), 30);
+			break;
+
+		case 30:
+			return setResponse(getDialogueId(221178), 31);
+
+		case 31:
+			if (sentMode == 3 || sentMode == 10)
+				return setResponse(10350, 0);
+			break;
+
+		case 32:
+			return setResponse(10110, 0);
+			
+		case 33:
+			if (sentence->contains("sieve") || sentence->contains("colander")
+					|| sentence->contains("vegetable") || sentence->contains("ground")
+					|| sentence->contains("earth") || sentence->contains("garden")
+					|| sentence->contains("cheese") || sentence->contains("strainer")) {
+				return setResponse(getDialogueId(221375), 0);
+			} else if (getRandomNumber(100) > 30) {
+				return setResponse(getDialogueId(221376), 33);
+			} else {
+				return setResponse(getDialogueId(221376), 0);
+			}
+			break;
+
+		case 34:
+			if (sentence->localWord("bellbot"))
+				return setResponse(10094, 0);
+			if (sentence->localWord("bellbot"))
+				return setResponse(10349, 0);
+			if (sentence->localWord("deskbot") || sentence->localWord("titania"))
+				return setResponse(10148, 0);
+			if (sentence->localWord("barbot") || sentence->localWord("rowbot")
+				|| sentence->localWord("liftbot") || sentence->localWord("maitredbot"))
+				return setResponse(10147, 0);
+			break;
+
+		case 35:
+			return setResponse(10811, 36);
+
+		case 36:
+			if (al)
+				return setResponse(10813, 37);
+			if (bl)
+				return setResponse(10812, 37);
+			break;
+
+		case 37:
+			if (al)
+				return setResponse(10815, 37);
+			if (bl)
+				return setResponse(10814, 37);
+			break;
+
+		case 38:
+			return setResponse(10848, 39);
+
+		case 39:
+			return setResponse(10823, 40);
+
+		case 40:
+			return setResponse(10832, 41);
+
+		case 41:
+			addResponse(10833);
+			return setResponse(10835, 0);
+
+		case 42:
+			if (sentence->localWord("please"))
+				return setResponse(10840, 43);
+			return setResponse(10844, 0);
+
+		case 43:
+		case 45:
+			return setResponse(10844, 0);
+
+		case 44:
+			if (sentence->localWord("thanks"))
+				return setResponse(10843, 45);
+			return setResponse(10844, 0);
+
+		case 46:
+			if (al)
+				return setResponse(getDialogueId(222251), 0);
+			if (bl)
+				return setResponse(10713, 0);
+			break;
+
+		}
+	}
+
+	if (currState != 14)
+		setState(0);
+
+	if (getDialRegion(1) != 1 && getRandomNumber(100) > 92)
+		return setResponse(getDialogueId(221043), 0);
+
+	int result = 0;
+	switch (roomScript->_scriptId) {
+	case 100:
+	case 101:
+	case 102:
+	case 107:
+	case 110:
+	case 111:
+	case 124:
+	case 129:
+	case 131:
+	case 132:
+		result = processEntries(&_sentences[roomScript->_scriptId], 0, roomScript, sentence);
+		break;
+	default:
+		break;
+	}
+	if (result == 2)
+		return 2;
+
+	if (processEntries(&_entries, _entryCount, roomScript, sentence) == 2
+			|| processEntries(_defaultEntries, 0, roomScript, sentence) == 2
+			|| defaultProcess(roomScript, sentence))
+		return 2;
+
+	switch (sentence->_field2C) {
+	case 11:
+		if (getRandomNumber(100) > 90)
+			return setResponse(10839, 42);
+		return setResponse(222415, 0);
+
+	case 12:
+		if (getRandomNumber(100) > 90)
+			return setResponse(10841, 44);
+		return setResponse(getDialogueId(222416), 0);
+
+	case 13:
+		return setResponse(getDialogueId(222415), 0);
+
+	default:
+		if (getRandomNumber(100) > 75 && getStateValue())
+			return setResponse(getDialogueId(221095));
+
+		if (processEntries(&_sentences[2], 0, roomScript, sentence) != 2)
+			return setResponse(getDialogueId(220000));
+		break;
+	}
+	
+	return 2;
 }
 
 ScriptChangedResult DoorbotScript::scriptChanged(const TTroomScript *roomScript, uint id) {
diff --git a/engines/titanic/true_talk/doorbot_script.h b/engines/titanic/true_talk/doorbot_script.h
index ec61529..09bbd56 100644
--- a/engines/titanic/true_talk/doorbot_script.h
+++ b/engines/titanic/true_talk/doorbot_script.h
@@ -23,13 +23,16 @@
 #ifndef TITANIC_DOORBOT_SCRIPT_H
 #define TITANIC_DOORBOT_SCRIPT_H
 
+#include "common/hashmap.h"
 #include "titanic/true_talk/tt_npc_script.h"
 
 namespace Titanic {
 
 class DoorbotScript : public TTnpcScript {
+	typedef Common::HashMap<uint, TTsentenceEntries> SentenceEntriesMap;
 private:
 	TTupdateStateArray _states;
+	SentenceEntriesMap _sentences;
 	int _stateIndex;
 private:
 	/**


Commit: 9d3a2c1c7f9365f65908f583e62047830f60693d
    https://github.com/scummvm/scummvm/commit/9d3a2c1c7f9365f65908f583e62047830f60693d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-08-01T00:27:28+03:00

Commit Message:
Merge pull request #786 from dreammaster/titanic

TITANIC: Starship Titanic engine

Changed paths:
  A devtools/create_titanic/create_titanic_dat.cpp
  A devtools/create_titanic/file.h
  A devtools/create_titanic/hash-str.h
  A devtools/create_titanic/hashmap.cpp
  A devtools/create_titanic/hashmap.h
  A devtools/create_titanic/memorypool.cpp
  A devtools/create_titanic/memorypool.h
  A devtools/create_titanic/module.mk
  A devtools/create_titanic/script_preresponses.cpp
  A devtools/create_titanic/script_preresponses.h
  A devtools/create_titanic/script_quotes.cpp
  A devtools/create_titanic/script_quotes.h
  A devtools/create_titanic/script_ranges.cpp
  A devtools/create_titanic/script_ranges.h
  A devtools/create_titanic/script_responses.cpp
  A devtools/create_titanic/script_responses.h
  A devtools/create_titanic/script_states.cpp
  A devtools/create_titanic/script_states.h
  A devtools/create_titanic/str.cpp
  A devtools/create_titanic/str.h
  A devtools/create_titanic/tag_maps.cpp
  A devtools/create_titanic/tag_maps.h
  A devtools/create_titanic/winexe.cpp
  A devtools/create_titanic/winexe.h
  A devtools/create_titanic/winexe_pe.cpp
  A devtools/create_titanic/winexe_pe.h
  A engines/titanic/carry/arm.cpp
  A engines/titanic/carry/arm.h
  A engines/titanic/carry/auditory_centre.cpp
  A engines/titanic/carry/auditory_centre.h
  A engines/titanic/carry/bowl_ear.cpp
  A engines/titanic/carry/bowl_ear.h
  A engines/titanic/carry/brain.cpp
  A engines/titanic/carry/brain.h
  A engines/titanic/carry/bridge_piece.cpp
  A engines/titanic/carry/bridge_piece.h
  A engines/titanic/carry/carry.cpp
  A engines/titanic/carry/carry.h
  A engines/titanic/carry/carry_parrot.cpp
  A engines/titanic/carry/carry_parrot.h
  A engines/titanic/carry/central_core.cpp
  A engines/titanic/carry/central_core.h
  A engines/titanic/carry/chicken.cpp
  A engines/titanic/carry/chicken.h
  A engines/titanic/carry/crushed_tv.cpp
  A engines/titanic/carry/crushed_tv.h
  A engines/titanic/carry/ear.cpp
  A engines/titanic/carry/ear.h
  A engines/titanic/carry/eye.cpp
  A engines/titanic/carry/eye.h
  A engines/titanic/carry/feathers.cpp
  A engines/titanic/carry/feathers.h
  A engines/titanic/carry/fruit.cpp
  A engines/titanic/carry/fruit.h
  A engines/titanic/carry/glass.cpp
  A engines/titanic/carry/glass.h
  A engines/titanic/carry/hammer.cpp
  A engines/titanic/carry/hammer.h
  A engines/titanic/carry/head_piece.cpp
  A engines/titanic/carry/head_piece.h
  A engines/titanic/carry/hose.cpp
  A engines/titanic/carry/hose.h
  A engines/titanic/carry/hose_end.cpp
  A engines/titanic/carry/hose_end.h
  A engines/titanic/carry/key.cpp
  A engines/titanic/carry/key.h
  A engines/titanic/carry/liftbot_head.cpp
  A engines/titanic/carry/liftbot_head.h
  A engines/titanic/carry/long_stick.cpp
  A engines/titanic/carry/long_stick.h
  A engines/titanic/carry/magazine.cpp
  A engines/titanic/carry/magazine.h
  A engines/titanic/carry/maitred_left_arm.cpp
  A engines/titanic/carry/maitred_left_arm.h
  A engines/titanic/carry/maitred_right_arm.cpp
  A engines/titanic/carry/maitred_right_arm.h
  A engines/titanic/carry/mouth.cpp
  A engines/titanic/carry/mouth.h
  A engines/titanic/carry/napkin.cpp
  A engines/titanic/carry/napkin.h
  A engines/titanic/carry/nose.cpp
  A engines/titanic/carry/nose.h
  A engines/titanic/carry/note.cpp
  A engines/titanic/carry/note.h
  A engines/titanic/carry/parcel.cpp
  A engines/titanic/carry/parcel.h
  A engines/titanic/carry/perch.cpp
  A engines/titanic/carry/perch.h
  A engines/titanic/carry/phonograph_cylinder.cpp
  A engines/titanic/carry/phonograph_cylinder.h
  A engines/titanic/carry/phonograph_ear.cpp
  A engines/titanic/carry/phonograph_ear.h
  A engines/titanic/carry/photograph.cpp
  A engines/titanic/carry/photograph.h
  A engines/titanic/carry/plug_in.cpp
  A engines/titanic/carry/plug_in.h
  A engines/titanic/carry/speech_centre.cpp
  A engines/titanic/carry/speech_centre.h
  A engines/titanic/carry/sweets.cpp
  A engines/titanic/carry/sweets.h
  A engines/titanic/carry/test_carry.cpp
  A engines/titanic/carry/test_carry.h
  A engines/titanic/carry/vision_centre.cpp
  A engines/titanic/carry/vision_centre.h
  A engines/titanic/configure.engine
  A engines/titanic/continue_save_dialog.cpp
  A engines/titanic/continue_save_dialog.h
  A engines/titanic/core/background.cpp
  A engines/titanic/core/background.h
  A engines/titanic/core/click_responder.cpp
  A engines/titanic/core/click_responder.h
  A engines/titanic/core/dont_save_file_item.cpp
  A engines/titanic/core/dont_save_file_item.h
  A engines/titanic/core/drop_target.cpp
  A engines/titanic/core/drop_target.h
  A engines/titanic/core/file_item.cpp
  A engines/titanic/core/file_item.h
  A engines/titanic/core/game_object.cpp
  A engines/titanic/core/game_object.h
  A engines/titanic/core/game_object_desc_item.cpp
  A engines/titanic/core/game_object_desc_item.h
  A engines/titanic/core/link_item.cpp
  A engines/titanic/core/link_item.h
  A engines/titanic/core/list.cpp
  A engines/titanic/core/list.h
  A engines/titanic/core/mail_man.cpp
  A engines/titanic/core/mail_man.h
  A engines/titanic/core/message_target.cpp
  A engines/titanic/core/message_target.h
  A engines/titanic/core/multi_drop_target.cpp
  A engines/titanic/core/multi_drop_target.h
  A engines/titanic/core/named_item.cpp
  A engines/titanic/core/named_item.h
  A engines/titanic/core/node_item.cpp
  A engines/titanic/core/node_item.h
  A engines/titanic/core/project_item.cpp
  A engines/titanic/core/project_item.h
  A engines/titanic/core/resource_key.cpp
  A engines/titanic/core/resource_key.h
  A engines/titanic/core/room_item.cpp
  A engines/titanic/core/room_item.h
  A engines/titanic/core/saveable_object.cpp
  A engines/titanic/core/saveable_object.h
  A engines/titanic/core/static_image.cpp
  A engines/titanic/core/static_image.h
  A engines/titanic/core/tree_item.cpp
  A engines/titanic/core/tree_item.h
  A engines/titanic/core/turn_on_object.cpp
  A engines/titanic/core/turn_on_object.h
  A engines/titanic/core/turn_on_play_sound.cpp
  A engines/titanic/core/turn_on_play_sound.h
  A engines/titanic/core/turn_on_turn_off.cpp
  A engines/titanic/core/turn_on_turn_off.h
  A engines/titanic/core/view_item.cpp
  A engines/titanic/core/view_item.h
  A engines/titanic/debugger.cpp
  A engines/titanic/debugger.h
  A engines/titanic/detection.cpp
  A engines/titanic/detection_tables.h
  A engines/titanic/events.cpp
  A engines/titanic/events.h
  A engines/titanic/game/announce.cpp
  A engines/titanic/game/announce.h
  A engines/titanic/game/annoy_barbot.cpp
  A engines/titanic/game/annoy_barbot.h
  A engines/titanic/game/arb_background.cpp
  A engines/titanic/game/arb_background.h
  A engines/titanic/game/arboretum_gate.cpp
  A engines/titanic/game/arboretum_gate.h
  A engines/titanic/game/auto_animate.cpp
  A engines/titanic/game/auto_animate.h
  A engines/titanic/game/bar_bell.cpp
  A engines/titanic/game/bar_bell.h
  A engines/titanic/game/bar_menu.cpp
  A engines/titanic/game/bar_menu.h
  A engines/titanic/game/bar_menu_button.cpp
  A engines/titanic/game/bar_menu_button.h
  A engines/titanic/game/belbot_get_light.cpp
  A engines/titanic/game/belbot_get_light.h
  A engines/titanic/game/bilge_succubus.cpp
  A engines/titanic/game/bilge_succubus.h
  A engines/titanic/game/bomb.cpp
  A engines/titanic/game/bomb.h
  A engines/titanic/game/bottom_of_well_monitor.cpp
  A engines/titanic/game/bottom_of_well_monitor.h
  A engines/titanic/game/bowl_unlocker.cpp
  A engines/titanic/game/bowl_unlocker.h
  A engines/titanic/game/brain_slot.cpp
  A engines/titanic/game/brain_slot.h
  A engines/titanic/game/bridge_door.cpp
  A engines/titanic/game/bridge_door.h
  A engines/titanic/game/bridge_view.cpp
  A engines/titanic/game/bridge_view.h
  A engines/titanic/game/broken_pell_base.cpp
  A engines/titanic/game/broken_pell_base.h
  A engines/titanic/game/broken_pellerator.cpp
  A engines/titanic/game/broken_pellerator.h
  A engines/titanic/game/broken_pellerator_froz.cpp
  A engines/titanic/game/broken_pellerator_froz.h
  A engines/titanic/game/cage.cpp
  A engines/titanic/game/cage.h
  A engines/titanic/game/call_pellerator.cpp
  A engines/titanic/game/call_pellerator.h
  A engines/titanic/game/captains_wheel.cpp
  A engines/titanic/game/captains_wheel.h
  A engines/titanic/game/cdrom.cpp
  A engines/titanic/game/cdrom.h
  A engines/titanic/game/cdrom_computer.cpp
  A engines/titanic/game/cdrom_computer.h
  A engines/titanic/game/cdrom_tray.cpp
  A engines/titanic/game/cdrom_tray.h
  A engines/titanic/game/cell_point_button.cpp
  A engines/titanic/game/cell_point_button.h
  A engines/titanic/game/chev_code.cpp
  A engines/titanic/game/chev_code.h
  A engines/titanic/game/chev_panel.cpp
  A engines/titanic/game/chev_panel.h
  A engines/titanic/game/chicken_cooler.cpp
  A engines/titanic/game/chicken_cooler.h
  A engines/titanic/game/chicken_dispensor.cpp
  A engines/titanic/game/chicken_dispensor.h
  A engines/titanic/game/close_broken_pel.cpp
  A engines/titanic/game/close_broken_pel.h
  A engines/titanic/game/code_wheel.cpp
  A engines/titanic/game/code_wheel.h
  A engines/titanic/game/computer.cpp
  A engines/titanic/game/computer.h
  A engines/titanic/game/computer_screen.cpp
  A engines/titanic/game/computer_screen.h
  A engines/titanic/game/cookie.cpp
  A engines/titanic/game/cookie.h
  A engines/titanic/game/credits.cpp
  A engines/titanic/game/credits.h
  A engines/titanic/game/credits_button.cpp
  A engines/titanic/game/credits_button.h
  A engines/titanic/game/dead_area.cpp
  A engines/titanic/game/dead_area.h
  A engines/titanic/game/desk_click_responder.cpp
  A engines/titanic/game/desk_click_responder.h
  A engines/titanic/game/doorbot_elevator_handler.cpp
  A engines/titanic/game/doorbot_elevator_handler.h
  A engines/titanic/game/doorbot_home_handler.cpp
  A engines/titanic/game/doorbot_home_handler.h
  A engines/titanic/game/ear_sweet_bowl.cpp
  A engines/titanic/game/ear_sweet_bowl.h
  A engines/titanic/game/eject_phonograph_button.cpp
  A engines/titanic/game/eject_phonograph_button.h
  A engines/titanic/game/elevator_action_area.cpp
  A engines/titanic/game/elevator_action_area.h
  A engines/titanic/game/emma_control.cpp
  A engines/titanic/game/emma_control.h
  A engines/titanic/game/empty_nut_bowl.cpp
  A engines/titanic/game/empty_nut_bowl.h
  A engines/titanic/game/end_credit_text.cpp
  A engines/titanic/game/end_credit_text.h
  A engines/titanic/game/end_credits.cpp
  A engines/titanic/game/end_credits.h
  A engines/titanic/game/end_explode_ship.cpp
  A engines/titanic/game/end_explode_ship.h
  A engines/titanic/game/end_game_credits.cpp
  A engines/titanic/game/end_game_credits.h
  A engines/titanic/game/end_sequence_control.cpp
  A engines/titanic/game/end_sequence_control.h
  A engines/titanic/game/fan.cpp
  A engines/titanic/game/fan.h
  A engines/titanic/game/fan_control.cpp
  A engines/titanic/game/fan_control.h
  A engines/titanic/game/fan_decrease.cpp
  A engines/titanic/game/fan_decrease.h
  A engines/titanic/game/fan_increase.cpp
  A engines/titanic/game/fan_increase.h
  A engines/titanic/game/fan_noises.cpp
  A engines/titanic/game/fan_noises.h
  A engines/titanic/game/floor_indicator.cpp
  A engines/titanic/game/floor_indicator.h
  A engines/titanic/game/games_console.cpp
  A engines/titanic/game/games_console.h
  A engines/titanic/game/get_lift_eye2.cpp
  A engines/titanic/game/get_lift_eye2.h
  A engines/titanic/game/glass_smasher.cpp
  A engines/titanic/game/glass_smasher.h
  A engines/titanic/game/gondolier/gondolier_base.cpp
  A engines/titanic/game/gondolier/gondolier_base.h
  A engines/titanic/game/gondolier/gondolier_chest.cpp
  A engines/titanic/game/gondolier/gondolier_chest.h
  A engines/titanic/game/gondolier/gondolier_face.cpp
  A engines/titanic/game/gondolier/gondolier_face.h
  A engines/titanic/game/gondolier/gondolier_mixer.cpp
  A engines/titanic/game/gondolier/gondolier_mixer.h
  A engines/titanic/game/gondolier/gondolier_slider.cpp
  A engines/titanic/game/gondolier/gondolier_slider.h
  A engines/titanic/game/hammer_clip.cpp
  A engines/titanic/game/hammer_clip.h
  A engines/titanic/game/hammer_dispensor.cpp
  A engines/titanic/game/hammer_dispensor.h
  A engines/titanic/game/hammer_dispensor_button.cpp
  A engines/titanic/game/hammer_dispensor_button.h
  A engines/titanic/game/head_slot.cpp
  A engines/titanic/game/head_slot.h
  A engines/titanic/game/head_smash_event.cpp
  A engines/titanic/game/head_smash_event.h
  A engines/titanic/game/head_smash_lever.cpp
  A engines/titanic/game/head_smash_lever.h
  A engines/titanic/game/head_spinner.cpp
  A engines/titanic/game/head_spinner.h
  A engines/titanic/game/idle_summoner.cpp
  A engines/titanic/game/idle_summoner.h
  A engines/titanic/game/leave_sec_class_state.cpp
  A engines/titanic/game/leave_sec_class_state.h
  A engines/titanic/game/lemon_dispensor.cpp
  A engines/titanic/game/lemon_dispensor.h
  A engines/titanic/game/light.cpp
  A engines/titanic/game/light.h
  A engines/titanic/game/light_switch.cpp
  A engines/titanic/game/light_switch.h
  A engines/titanic/game/little_lift_button.cpp
  A engines/titanic/game/little_lift_button.h
  A engines/titanic/game/long_stick_dispenser.cpp
  A engines/titanic/game/long_stick_dispenser.h
  A engines/titanic/game/maitred/maitred_arm_holder.cpp
  A engines/titanic/game/maitred/maitred_arm_holder.h
  A engines/titanic/game/maitred/maitred_body.cpp
  A engines/titanic/game/maitred/maitred_body.h
  A engines/titanic/game/maitred/maitred_legs.cpp
  A engines/titanic/game/maitred/maitred_legs.h
  A engines/titanic/game/maitred/maitred_prod_receptor.cpp
  A engines/titanic/game/maitred/maitred_prod_receptor.h
  A engines/titanic/game/missiveomat.cpp
  A engines/titanic/game/missiveomat.h
  A engines/titanic/game/missiveomat_button.cpp
  A engines/titanic/game/missiveomat_button.h
  A engines/titanic/game/movie_tester.cpp
  A engines/titanic/game/movie_tester.h
  A engines/titanic/game/music_console_button.cpp
  A engines/titanic/game/music_console_button.h
  A engines/titanic/game/music_room_phonograph.cpp
  A engines/titanic/game/music_room_phonograph.h
  A engines/titanic/game/music_room_stop_phonograph_button.cpp
  A engines/titanic/game/music_room_stop_phonograph_button.h
  A engines/titanic/game/music_system_lock.cpp
  A engines/titanic/game/music_system_lock.h
  A engines/titanic/game/musical_instrument.cpp
  A engines/titanic/game/musical_instrument.h
  A engines/titanic/game/nav_helmet.cpp
  A engines/titanic/game/nav_helmet.h
  A engines/titanic/game/navigation_computer.cpp
  A engines/titanic/game/navigation_computer.h
  A engines/titanic/game/no_nut_bowl.cpp
  A engines/titanic/game/no_nut_bowl.h
  A engines/titanic/game/nose_holder.cpp
  A engines/titanic/game/nose_holder.h
  A engines/titanic/game/null_port_hole.cpp
  A engines/titanic/game/null_port_hole.h
  A engines/titanic/game/nut_replacer.cpp
  A engines/titanic/game/nut_replacer.h
  A engines/titanic/game/parrot/parrot_lobby_controller.cpp
  A engines/titanic/game/parrot/parrot_lobby_controller.h
  A engines/titanic/game/parrot/parrot_lobby_link_updater.cpp
  A engines/titanic/game/parrot/parrot_lobby_link_updater.h
  A engines/titanic/game/parrot/parrot_lobby_object.cpp
  A engines/titanic/game/parrot/parrot_lobby_object.h
  A engines/titanic/game/parrot/parrot_lobby_view_object.cpp
  A engines/titanic/game/parrot/parrot_lobby_view_object.h
  A engines/titanic/game/parrot/parrot_loser.cpp
  A engines/titanic/game/parrot/parrot_loser.h
  A engines/titanic/game/parrot/parrot_nut_bowl_actor.cpp
  A engines/titanic/game/parrot/parrot_nut_bowl_actor.h
  A engines/titanic/game/parrot/parrot_nut_eater.cpp
  A engines/titanic/game/parrot/parrot_nut_eater.h
  A engines/titanic/game/parrot/parrot_perch_holder.cpp
  A engines/titanic/game/parrot/parrot_perch_holder.h
  A engines/titanic/game/parrot/parrot_succubus.cpp
  A engines/titanic/game/parrot/parrot_succubus.h
  A engines/titanic/game/parrot/parrot_trigger.cpp
  A engines/titanic/game/parrot/parrot_trigger.h
  A engines/titanic/game/parrot/player_meets_parrot.cpp
  A engines/titanic/game/parrot/player_meets_parrot.h
  A engines/titanic/game/pet/pet.cpp
  A engines/titanic/game/pet/pet.h
  A engines/titanic/game/pet/pet_class1.cpp
  A engines/titanic/game/pet/pet_class1.h
  A engines/titanic/game/pet/pet_class2.cpp
  A engines/titanic/game/pet/pet_class2.h
  A engines/titanic/game/pet/pet_class3.cpp
  A engines/titanic/game/pet/pet_class3.h
  A engines/titanic/game/pet/pet_lift.cpp
  A engines/titanic/game/pet/pet_lift.h
  A engines/titanic/game/pet/pet_monitor.cpp
  A engines/titanic/game/pet/pet_monitor.h
  A engines/titanic/game/pet/pet_pellerator.cpp
  A engines/titanic/game/pet/pet_pellerator.h
  A engines/titanic/game/pet/pet_position.cpp
  A engines/titanic/game/pet/pet_position.h
  A engines/titanic/game/pet/pet_sentinal.cpp
  A engines/titanic/game/pet/pet_sentinal.h
  A engines/titanic/game/pet/pet_sounds.cpp
  A engines/titanic/game/pet/pet_sounds.h
  A engines/titanic/game/pet/pet_transition.cpp
  A engines/titanic/game/pet/pet_transition.h
  A engines/titanic/game/pet/pet_transport.cpp
  A engines/titanic/game/pet/pet_transport.h
  A engines/titanic/game/pet/pet_val_base.cpp
  A engines/titanic/game/pet/pet_val_base.h
  A engines/titanic/game/pet_disabler.cpp
  A engines/titanic/game/pet_disabler.h
  A engines/titanic/game/phonograph.cpp
  A engines/titanic/game/phonograph.h
  A engines/titanic/game/phonograph_lid.cpp
  A engines/titanic/game/phonograph_lid.h
  A engines/titanic/game/pickup/pick_up.cpp
  A engines/titanic/game/pickup/pick_up.h
  A engines/titanic/game/pickup/pick_up_bar_glass.cpp
  A engines/titanic/game/pickup/pick_up_bar_glass.h
  A engines/titanic/game/pickup/pick_up_hose.cpp
  A engines/titanic/game/pickup/pick_up_hose.h
  A engines/titanic/game/pickup/pick_up_lemon.cpp
  A engines/titanic/game/pickup/pick_up_lemon.h
  A engines/titanic/game/pickup/pick_up_speech_centre.cpp
  A engines/titanic/game/pickup/pick_up_speech_centre.h
  A engines/titanic/game/pickup/pick_up_vis_centre.cpp
  A engines/titanic/game/pickup/pick_up_vis_centre.h
  A engines/titanic/game/placeholder/bar_shelf_vis_centre.cpp
  A engines/titanic/game/placeholder/bar_shelf_vis_centre.h
  A engines/titanic/game/placeholder/lemon_on_bar.cpp
  A engines/titanic/game/placeholder/lemon_on_bar.h
  A engines/titanic/game/placeholder/place_holder_item.cpp
  A engines/titanic/game/placeholder/place_holder_item.h
  A engines/titanic/game/placeholder/tv_on_bar.cpp
  A engines/titanic/game/placeholder/tv_on_bar.h
  A engines/titanic/game/play_music_button.cpp
  A engines/titanic/game/play_music_button.h
  A engines/titanic/game/play_on_act.cpp
  A engines/titanic/game/play_on_act.h
  A engines/titanic/game/port_hole.cpp
  A engines/titanic/game/port_hole.h
  A engines/titanic/game/record_phonograph_button.cpp
  A engines/titanic/game/record_phonograph_button.h
  A engines/titanic/game/replacement_ear.cpp
  A engines/titanic/game/replacement_ear.h
  A engines/titanic/game/reserved_table.cpp
  A engines/titanic/game/reserved_table.h
  A engines/titanic/game/restaurant_cylinder_holder.cpp
  A engines/titanic/game/restaurant_cylinder_holder.h
  A engines/titanic/game/restaurant_phonograph.cpp
  A engines/titanic/game/restaurant_phonograph.h
  A engines/titanic/game/sauce_dispensor.cpp
  A engines/titanic/game/sauce_dispensor.h
  A engines/titanic/game/search_point.cpp
  A engines/titanic/game/search_point.h
  A engines/titanic/game/season_background.cpp
  A engines/titanic/game/season_background.h
  A engines/titanic/game/season_barrel.cpp
  A engines/titanic/game/season_barrel.h
  A engines/titanic/game/seasonal_adjustment.cpp
  A engines/titanic/game/seasonal_adjustment.h
  A engines/titanic/game/service_elevator_window.cpp
  A engines/titanic/game/service_elevator_window.h
  A engines/titanic/game/sgt/armchair.cpp
  A engines/titanic/game/sgt/armchair.h
  A engines/titanic/game/sgt/basin.cpp
  A engines/titanic/game/sgt/basin.h
  A engines/titanic/game/sgt/bedfoot.cpp
  A engines/titanic/game/sgt/bedfoot.h
  A engines/titanic/game/sgt/bedhead.cpp
  A engines/titanic/game/sgt/bedhead.h
  A engines/titanic/game/sgt/chest_of_drawers.cpp
  A engines/titanic/game/sgt/chest_of_drawers.h
  A engines/titanic/game/sgt/desk.cpp
  A engines/titanic/game/sgt/desk.h
  A engines/titanic/game/sgt/deskchair.cpp
  A engines/titanic/game/sgt/deskchair.h
  A engines/titanic/game/sgt/drawer.cpp
  A engines/titanic/game/sgt/drawer.h
  A engines/titanic/game/sgt/sgt_doors.cpp
  A engines/titanic/game/sgt/sgt_doors.h
  A engines/titanic/game/sgt/sgt_nav.cpp
  A engines/titanic/game/sgt/sgt_nav.h
  A engines/titanic/game/sgt/sgt_navigation.cpp
  A engines/titanic/game/sgt/sgt_navigation.h
  A engines/titanic/game/sgt/sgt_restaurant_doors.cpp
  A engines/titanic/game/sgt/sgt_restaurant_doors.h
  A engines/titanic/game/sgt/sgt_state_control.cpp
  A engines/titanic/game/sgt/sgt_state_control.h
  A engines/titanic/game/sgt/sgt_state_room.cpp
  A engines/titanic/game/sgt/sgt_state_room.h
  A engines/titanic/game/sgt/sgt_tv.cpp
  A engines/titanic/game/sgt/sgt_tv.h
  A engines/titanic/game/sgt/sgt_upper_doors_sound.cpp
  A engines/titanic/game/sgt/sgt_upper_doors_sound.h
  A engines/titanic/game/sgt/toilet.cpp
  A engines/titanic/game/sgt/toilet.h
  A engines/titanic/game/sgt/vase.cpp
  A engines/titanic/game/sgt/vase.h
  A engines/titanic/game/sgt/washstand.cpp
  A engines/titanic/game/sgt/washstand.h
  A engines/titanic/game/ship_setting.cpp
  A engines/titanic/game/ship_setting.h
  A engines/titanic/game/ship_setting_button.cpp
  A engines/titanic/game/ship_setting_button.h
  A engines/titanic/game/show_cell_points.cpp
  A engines/titanic/game/show_cell_points.h
  A engines/titanic/game/speech_dispensor.cpp
  A engines/titanic/game/speech_dispensor.h
  A engines/titanic/game/splash_animation.cpp
  A engines/titanic/game/splash_animation.h
  A engines/titanic/game/starling_puret.cpp
  A engines/titanic/game/starling_puret.h
  A engines/titanic/game/start_action.cpp
  A engines/titanic/game/start_action.h
  A engines/titanic/game/stop_phonograph_button.cpp
  A engines/titanic/game/stop_phonograph_button.h
  A engines/titanic/game/sub_glass.cpp
  A engines/titanic/game/sub_glass.h
  A engines/titanic/game/sub_wrapper.cpp
  A engines/titanic/game/sub_wrapper.h
  A engines/titanic/game/sweet_bowl.cpp
  A engines/titanic/game/sweet_bowl.h
  A engines/titanic/game/television.cpp
  A engines/titanic/game/television.h
  A engines/titanic/game/third_class_canal.cpp
  A engines/titanic/game/third_class_canal.h
  A engines/titanic/game/throw_tv_down_well.cpp
  A engines/titanic/game/throw_tv_down_well.h
  A engines/titanic/game/titania_still_control.cpp
  A engines/titanic/game/titania_still_control.h
  A engines/titanic/game/tow_parrot_nav.cpp
  A engines/titanic/game/tow_parrot_nav.h
  A engines/titanic/game/transport/exit_pellerator.cpp
  A engines/titanic/game/transport/exit_pellerator.h
  A engines/titanic/game/transport/gondolier.cpp
  A engines/titanic/game/transport/gondolier.h
  A engines/titanic/game/transport/lift.cpp
  A engines/titanic/game/transport/lift.h
  A engines/titanic/game/transport/lift_indicator.cpp
  A engines/titanic/game/transport/lift_indicator.h
  A engines/titanic/game/transport/pellerator.cpp
  A engines/titanic/game/transport/pellerator.h
  A engines/titanic/game/transport/service_elevator.cpp
  A engines/titanic/game/transport/service_elevator.h
  A engines/titanic/game/transport/transport.cpp
  A engines/titanic/game/transport/transport.h
  A engines/titanic/game/up_lighter.cpp
  A engines/titanic/game/up_lighter.h
  A engines/titanic/game/useless_lever.cpp
  A engines/titanic/game/useless_lever.h
  A engines/titanic/game/volume_control.cpp
  A engines/titanic/game/volume_control.h
  A engines/titanic/game/wheel_button.cpp
  A engines/titanic/game/wheel_button.h
  A engines/titanic/game/wheel_hotspot.cpp
  A engines/titanic/game/wheel_hotspot.h
  A engines/titanic/game/wheel_spin.cpp
  A engines/titanic/game/wheel_spin.h
  A engines/titanic/game/wheel_spin_horn.cpp
  A engines/titanic/game/wheel_spin_horn.h
  A engines/titanic/game_location.cpp
  A engines/titanic/game_location.h
  A engines/titanic/game_manager.cpp
  A engines/titanic/game_manager.h
  A engines/titanic/game_state.cpp
  A engines/titanic/game_state.h
  A engines/titanic/game_view.cpp
  A engines/titanic/game_view.h
  A engines/titanic/gfx/act_button.cpp
  A engines/titanic/gfx/act_button.h
  A engines/titanic/gfx/changes_season_button.cpp
  A engines/titanic/gfx/changes_season_button.h
  A engines/titanic/gfx/chev_left_off.cpp
  A engines/titanic/gfx/chev_left_off.h
  A engines/titanic/gfx/chev_left_on.cpp
  A engines/titanic/gfx/chev_left_on.h
  A engines/titanic/gfx/chev_right_off.cpp
  A engines/titanic/gfx/chev_right_off.h
  A engines/titanic/gfx/chev_right_on.cpp
  A engines/titanic/gfx/chev_right_on.h
  A engines/titanic/gfx/chev_send_rec_switch.cpp
  A engines/titanic/gfx/chev_send_rec_switch.h
  A engines/titanic/gfx/chev_switch.cpp
  A engines/titanic/gfx/chev_switch.h
  A engines/titanic/gfx/edit_control.cpp
  A engines/titanic/gfx/edit_control.h
  A engines/titanic/gfx/elevator_button.cpp
  A engines/titanic/gfx/elevator_button.h
  A engines/titanic/gfx/get_from_succ.cpp
  A engines/titanic/gfx/get_from_succ.h
  A engines/titanic/gfx/helmet_on_off.cpp
  A engines/titanic/gfx/helmet_on_off.h
  A engines/titanic/gfx/home_photo.cpp
  A engines/titanic/gfx/home_photo.h
  A engines/titanic/gfx/icon_nav_action.cpp
  A engines/titanic/gfx/icon_nav_action.h
  A engines/titanic/gfx/icon_nav_butt.cpp
  A engines/titanic/gfx/icon_nav_butt.h
  A engines/titanic/gfx/icon_nav_down.cpp
  A engines/titanic/gfx/icon_nav_down.h
  A engines/titanic/gfx/icon_nav_image.cpp
  A engines/titanic/gfx/icon_nav_image.h
  A engines/titanic/gfx/icon_nav_left.cpp
  A engines/titanic/gfx/icon_nav_left.h
  A engines/titanic/gfx/icon_nav_receive.cpp
  A engines/titanic/gfx/icon_nav_receive.h
  A engines/titanic/gfx/icon_nav_right.cpp
  A engines/titanic/gfx/icon_nav_right.h
  A engines/titanic/gfx/icon_nav_send.cpp
  A engines/titanic/gfx/icon_nav_send.h
  A engines/titanic/gfx/icon_nav_up.cpp
  A engines/titanic/gfx/icon_nav_up.h
  A engines/titanic/gfx/keybrd_butt.cpp
  A engines/titanic/gfx/keybrd_butt.h
  A engines/titanic/gfx/move_object_button.cpp
  A engines/titanic/gfx/move_object_button.h
  A engines/titanic/gfx/music_control.cpp
  A engines/titanic/gfx/music_control.h
  A engines/titanic/gfx/music_slider.cpp
  A engines/titanic/gfx/music_slider.h
  A engines/titanic/gfx/music_slider_pitch.h
  A engines/titanic/gfx/music_slider_speed.h
  A engines/titanic/gfx/music_switch.cpp
  A engines/titanic/gfx/music_switch.h
  A engines/titanic/gfx/music_switch_inversion.h
  A engines/titanic/gfx/music_switch_reverse.h
  A engines/titanic/gfx/music_voice_mute.h
  A engines/titanic/gfx/send_to_succ.cpp
  A engines/titanic/gfx/send_to_succ.h
  A engines/titanic/gfx/sgt_selector.cpp
  A engines/titanic/gfx/sgt_selector.h
  A engines/titanic/gfx/slider_button.cpp
  A engines/titanic/gfx/slider_button.h
  A engines/titanic/gfx/small_chev_left_off.cpp
  A engines/titanic/gfx/small_chev_left_off.h
  A engines/titanic/gfx/small_chev_left_on.cpp
  A engines/titanic/gfx/small_chev_left_on.h
  A engines/titanic/gfx/small_chev_right_off.cpp
  A engines/titanic/gfx/small_chev_right_off.h
  A engines/titanic/gfx/small_chev_right_on.cpp
  A engines/titanic/gfx/small_chev_right_on.h
  A engines/titanic/gfx/st_button.cpp
  A engines/titanic/gfx/st_button.h
  A engines/titanic/gfx/status_change_button.cpp
  A engines/titanic/gfx/status_change_button.h
  A engines/titanic/gfx/text_down.cpp
  A engines/titanic/gfx/text_down.h
  A engines/titanic/gfx/text_skrew.cpp
  A engines/titanic/gfx/text_skrew.h
  A engines/titanic/gfx/text_up.cpp
  A engines/titanic/gfx/text_up.h
  A engines/titanic/gfx/toggle_button.cpp
  A engines/titanic/gfx/toggle_button.h
  A engines/titanic/gfx/toggle_switch.cpp
  A engines/titanic/gfx/toggle_switch.h
  A engines/titanic/input_handler.cpp
  A engines/titanic/input_handler.h
  A engines/titanic/input_translator.cpp
  A engines/titanic/input_translator.h
  A engines/titanic/main_game_window.cpp
  A engines/titanic/main_game_window.h
  A engines/titanic/messages/auto_sound_event.cpp
  A engines/titanic/messages/auto_sound_event.h
  A engines/titanic/messages/bilge_auto_sound_event.cpp
  A engines/titanic/messages/bilge_auto_sound_event.h
  A engines/titanic/messages/bilge_dispensor_event.cpp
  A engines/titanic/messages/bilge_dispensor_event.h
  A engines/titanic/messages/door_auto_sound_event.cpp
  A engines/titanic/messages/door_auto_sound_event.h
  A engines/titanic/messages/messages.cpp
  A engines/titanic/messages/messages.h
  A engines/titanic/messages/mouse_messages.cpp
  A engines/titanic/messages/mouse_messages.h
  A engines/titanic/messages/pet_messages.h
  A engines/titanic/messages/service_elevator_door.cpp
  A engines/titanic/messages/service_elevator_door.h
  A engines/titanic/module.mk
  A engines/titanic/moves/enter_bomb_room.cpp
  A engines/titanic/moves/enter_bomb_room.h
  A engines/titanic/moves/enter_bridge.cpp
  A engines/titanic/moves/enter_bridge.h
  A engines/titanic/moves/enter_exit_first_class_state.cpp
  A engines/titanic/moves/enter_exit_first_class_state.h
  A engines/titanic/moves/enter_exit_mini_lift.cpp
  A engines/titanic/moves/enter_exit_mini_lift.h
  A engines/titanic/moves/enter_exit_sec_class_mini_lift.cpp
  A engines/titanic/moves/enter_exit_sec_class_mini_lift.h
  A engines/titanic/moves/enter_exit_view.cpp
  A engines/titanic/moves/enter_exit_view.h
  A engines/titanic/moves/enter_sec_class_state.cpp
  A engines/titanic/moves/enter_sec_class_state.h
  A engines/titanic/moves/exit_arboretum.cpp
  A engines/titanic/moves/exit_arboretum.h
  A engines/titanic/moves/exit_bridge.cpp
  A engines/titanic/moves/exit_bridge.h
  A engines/titanic/moves/exit_lift.cpp
  A engines/titanic/moves/exit_lift.h
  A engines/titanic/moves/exit_pellerator.cpp
  A engines/titanic/moves/exit_pellerator.h
  A engines/titanic/moves/exit_state_room.cpp
  A engines/titanic/moves/exit_state_room.h
  A engines/titanic/moves/exit_tiania.cpp
  A engines/titanic/moves/exit_tiania.h
  A engines/titanic/moves/move_player_in_parrot_room.cpp
  A engines/titanic/moves/move_player_in_parrot_room.h
  A engines/titanic/moves/move_player_to.cpp
  A engines/titanic/moves/move_player_to.h
  A engines/titanic/moves/move_player_to_from.cpp
  A engines/titanic/moves/move_player_to_from.h
  A engines/titanic/moves/multi_move.cpp
  A engines/titanic/moves/multi_move.h
  A engines/titanic/moves/pan_from_pel.cpp
  A engines/titanic/moves/pan_from_pel.h
  A engines/titanic/moves/restaurant_pan_handler.cpp
  A engines/titanic/moves/restaurant_pan_handler.h
  A engines/titanic/moves/restricted_move.cpp
  A engines/titanic/moves/restricted_move.h
  A engines/titanic/moves/scraliontis_table.cpp
  A engines/titanic/moves/scraliontis_table.h
  A engines/titanic/moves/trip_down_canal.cpp
  A engines/titanic/moves/trip_down_canal.h
  A engines/titanic/npcs/barbot.cpp
  A engines/titanic/npcs/barbot.h
  A engines/titanic/npcs/bellbot.cpp
  A engines/titanic/npcs/bellbot.h
  A engines/titanic/npcs/callbot.cpp
  A engines/titanic/npcs/callbot.h
  A engines/titanic/npcs/character.cpp
  A engines/titanic/npcs/character.h
  A engines/titanic/npcs/deskbot.cpp
  A engines/titanic/npcs/deskbot.h
  A engines/titanic/npcs/doorbot.cpp
  A engines/titanic/npcs/doorbot.h
  A engines/titanic/npcs/liftbot.cpp
  A engines/titanic/npcs/liftbot.h
  A engines/titanic/npcs/maitre_d.cpp
  A engines/titanic/npcs/maitre_d.h
  A engines/titanic/npcs/mobile.cpp
  A engines/titanic/npcs/mobile.h
  A engines/titanic/npcs/parrot.cpp
  A engines/titanic/npcs/parrot.h
  A engines/titanic/npcs/robot_controller.cpp
  A engines/titanic/npcs/robot_controller.h
  A engines/titanic/npcs/starlings.cpp
  A engines/titanic/npcs/starlings.h
  A engines/titanic/npcs/succubus.cpp
  A engines/titanic/npcs/succubus.h
  A engines/titanic/npcs/summon_bots.cpp
  A engines/titanic/npcs/summon_bots.h
  A engines/titanic/npcs/titania.cpp
  A engines/titanic/npcs/titania.h
  A engines/titanic/npcs/true_talk_npc.cpp
  A engines/titanic/npcs/true_talk_npc.h
  A engines/titanic/pet_control/pet_control.cpp
  A engines/titanic/pet_control/pet_control.h
  A engines/titanic/pet_control/pet_conversations.cpp
  A engines/titanic/pet_control/pet_conversations.h
  A engines/titanic/pet_control/pet_drag_chev.cpp
  A engines/titanic/pet_control/pet_drag_chev.h
  A engines/titanic/pet_control/pet_element.cpp
  A engines/titanic/pet_control/pet_element.h
  A engines/titanic/pet_control/pet_frame.cpp
  A engines/titanic/pet_control/pet_frame.h
  A engines/titanic/pet_control/pet_gfx_element.cpp
  A engines/titanic/pet_control/pet_gfx_element.h
  A engines/titanic/pet_control/pet_glyphs.cpp
  A engines/titanic/pet_control/pet_glyphs.h
  A engines/titanic/pet_control/pet_graphic.cpp
  A engines/titanic/pet_control/pet_graphic.h
  A engines/titanic/pet_control/pet_graphic2.cpp
  A engines/titanic/pet_control/pet_graphic2.h
  A engines/titanic/pet_control/pet_inventory.cpp
  A engines/titanic/pet_control/pet_inventory.h
  A engines/titanic/pet_control/pet_inventory_glyphs.cpp
  A engines/titanic/pet_control/pet_inventory_glyphs.h
  A engines/titanic/pet_control/pet_leaf.cpp
  A engines/titanic/pet_control/pet_leaf.h
  A engines/titanic/pet_control/pet_load.cpp
  A engines/titanic/pet_control/pet_load.h
  A engines/titanic/pet_control/pet_load_save.cpp
  A engines/titanic/pet_control/pet_load_save.h
  A engines/titanic/pet_control/pet_message.cpp
  A engines/titanic/pet_control/pet_message.h
  A engines/titanic/pet_control/pet_mode_off.cpp
  A engines/titanic/pet_control/pet_mode_off.h
  A engines/titanic/pet_control/pet_mode_on.cpp
  A engines/titanic/pet_control/pet_mode_on.h
  A engines/titanic/pet_control/pet_mode_panel.cpp
  A engines/titanic/pet_control/pet_mode_panel.h
  A engines/titanic/pet_control/pet_pannel1.cpp
  A engines/titanic/pet_control/pet_pannel1.h
  A engines/titanic/pet_control/pet_pannel2.cpp
  A engines/titanic/pet_control/pet_pannel2.h
  A engines/titanic/pet_control/pet_pannel3.cpp
  A engines/titanic/pet_control/pet_pannel3.h
  A engines/titanic/pet_control/pet_quit.cpp
  A engines/titanic/pet_control/pet_quit.h
  A engines/titanic/pet_control/pet_real_life.cpp
  A engines/titanic/pet_control/pet_real_life.h
  A engines/titanic/pet_control/pet_remote.cpp
  A engines/titanic/pet_control/pet_remote.h
  A engines/titanic/pet_control/pet_remote_glyphs.cpp
  A engines/titanic/pet_control/pet_remote_glyphs.h
  A engines/titanic/pet_control/pet_rooms.cpp
  A engines/titanic/pet_control/pet_rooms.h
  A engines/titanic/pet_control/pet_rooms_glyphs.cpp
  A engines/titanic/pet_control/pet_rooms_glyphs.h
  A engines/titanic/pet_control/pet_save.cpp
  A engines/titanic/pet_control/pet_save.h
  A engines/titanic/pet_control/pet_section.cpp
  A engines/titanic/pet_control/pet_section.h
  A engines/titanic/pet_control/pet_slider.cpp
  A engines/titanic/pet_control/pet_slider.h
  A engines/titanic/pet_control/pet_sound.cpp
  A engines/titanic/pet_control/pet_sound.h
  A engines/titanic/pet_control/pet_starfield.cpp
  A engines/titanic/pet_control/pet_starfield.h
  A engines/titanic/pet_control/pet_text.cpp
  A engines/titanic/pet_control/pet_text.h
  A engines/titanic/room_flags.cpp
  A engines/titanic/room_flags.h
  A engines/titanic/sound/auto_music_player.cpp
  A engines/titanic/sound/auto_music_player.h
  A engines/titanic/sound/auto_music_player_base.cpp
  A engines/titanic/sound/auto_music_player_base.h
  A engines/titanic/sound/auto_sound_player.cpp
  A engines/titanic/sound/auto_sound_player.h
  A engines/titanic/sound/auto_sound_player_adsr.cpp
  A engines/titanic/sound/auto_sound_player_adsr.h
  A engines/titanic/sound/background_sound_maker.cpp
  A engines/titanic/sound/background_sound_maker.h
  A engines/titanic/sound/bird_song.cpp
  A engines/titanic/sound/bird_song.h
  A engines/titanic/sound/dome_from_top_of_well.cpp
  A engines/titanic/sound/dome_from_top_of_well.h
  A engines/titanic/sound/enter_view_toggles_other_music.cpp
  A engines/titanic/sound/enter_view_toggles_other_music.h
  A engines/titanic/sound/gondolier_song.cpp
  A engines/titanic/sound/gondolier_song.h
  A engines/titanic/sound/music_player.cpp
  A engines/titanic/sound/music_player.h
  A engines/titanic/sound/music_room.cpp
  A engines/titanic/sound/music_room.h
  A engines/titanic/sound/node_auto_sound_player.cpp
  A engines/titanic/sound/node_auto_sound_player.h
  A engines/titanic/sound/restricted_auto_music_player.cpp
  A engines/titanic/sound/restricted_auto_music_player.h
  A engines/titanic/sound/room_auto_sound_player.cpp
  A engines/titanic/sound/room_auto_sound_player.h
  A engines/titanic/sound/room_trigger_auto_music_player.cpp
  A engines/titanic/sound/room_trigger_auto_music_player.h
  A engines/titanic/sound/season_noises.cpp
  A engines/titanic/sound/season_noises.h
  A engines/titanic/sound/seasonal_music_player.cpp
  A engines/titanic/sound/seasonal_music_player.h
  A engines/titanic/sound/sound.cpp
  A engines/titanic/sound/sound.h
  A engines/titanic/sound/sound_manager.cpp
  A engines/titanic/sound/sound_manager.h
  A engines/titanic/sound/titania_speech.cpp
  A engines/titanic/sound/titania_speech.h
  A engines/titanic/sound/trigger_auto_music_player.cpp
  A engines/titanic/sound/trigger_auto_music_player.h
  A engines/titanic/sound/view_auto_sound_player.cpp
  A engines/titanic/sound/view_auto_sound_player.h
  A engines/titanic/sound/view_toggles_other_music.cpp
  A engines/titanic/sound/view_toggles_other_music.h
  A engines/titanic/sound/water_lapping_sounds.cpp
  A engines/titanic/sound/water_lapping_sounds.h
  A engines/titanic/sound/wave_file.cpp
  A engines/titanic/sound/wave_file.h
  A engines/titanic/star_control/base_star.cpp
  A engines/titanic/star_control/base_star.h
  A engines/titanic/star_control/dmatrix.cpp
  A engines/titanic/star_control/dmatrix.h
  A engines/titanic/star_control/dvector.cpp
  A engines/titanic/star_control/dvector.h
  A engines/titanic/star_control/error_code.h
  A engines/titanic/star_control/fmatrix.cpp
  A engines/titanic/star_control/fmatrix.h
  A engines/titanic/star_control/fpoint.cpp
  A engines/titanic/star_control/fpoint.h
  A engines/titanic/star_control/fvector.cpp
  A engines/titanic/star_control/fvector.h
  A engines/titanic/star_control/star_control.cpp
  A engines/titanic/star_control/star_control.h
  A engines/titanic/star_control/star_control_sub12.cpp
  A engines/titanic/star_control/star_control_sub12.h
  A engines/titanic/star_control/star_control_sub13.cpp
  A engines/titanic/star_control/star_control_sub13.h
  A engines/titanic/star_control/star_control_sub2.cpp
  A engines/titanic/star_control/star_control_sub2.h
  A engines/titanic/star_control/star_control_sub20.cpp
  A engines/titanic/star_control/star_control_sub20.h
  A engines/titanic/star_control/star_control_sub21.cpp
  A engines/titanic/star_control/star_control_sub21.h
  A engines/titanic/star_control/star_control_sub22.cpp
  A engines/titanic/star_control/star_control_sub22.h
  A engines/titanic/star_control/star_control_sub23.cpp
  A engines/titanic/star_control/star_control_sub23.h
  A engines/titanic/star_control/star_control_sub24.cpp
  A engines/titanic/star_control/star_control_sub24.h
  A engines/titanic/star_control/star_control_sub25.cpp
  A engines/titanic/star_control/star_control_sub25.h
  A engines/titanic/star_control/star_control_sub26.cpp
  A engines/titanic/star_control/star_control_sub26.h
  A engines/titanic/star_control/star_control_sub27.cpp
  A engines/titanic/star_control/star_control_sub27.h
  A engines/titanic/star_control/star_control_sub4.cpp
  A engines/titanic/star_control/star_control_sub4.h
  A engines/titanic/star_control/star_control_sub5.cpp
  A engines/titanic/star_control/star_control_sub5.h
  A engines/titanic/star_control/star_control_sub6.cpp
  A engines/titanic/star_control/star_control_sub6.h
  A engines/titanic/star_control/star_control_sub7.cpp
  A engines/titanic/star_control/star_control_sub7.h
  A engines/titanic/star_control/star_control_sub8.cpp
  A engines/titanic/star_control/star_control_sub8.h
  A engines/titanic/star_control/star_field.cpp
  A engines/titanic/star_control/star_field.h
  A engines/titanic/star_control/star_points1.cpp
  A engines/titanic/star_control/star_points1.h
  A engines/titanic/star_control/star_points2.cpp
  A engines/titanic/star_control/star_points2.h
  A engines/titanic/star_control/star_view.cpp
  A engines/titanic/star_control/star_view.h
  A engines/titanic/star_control/surface_area.cpp
  A engines/titanic/star_control/surface_area.h
  A engines/titanic/star_control/surface_fader.cpp
  A engines/titanic/star_control/surface_fader.h
  A engines/titanic/star_control/surface_fader_base.cpp
  A engines/titanic/star_control/surface_fader_base.h
  A engines/titanic/support/avi_surface.cpp
  A engines/titanic/support/avi_surface.h
  A engines/titanic/support/credit_text.cpp
  A engines/titanic/support/credit_text.h
  A engines/titanic/support/direct_draw.cpp
  A engines/titanic/support/direct_draw.h
  A engines/titanic/support/direct_draw_surface.cpp
  A engines/titanic/support/direct_draw_surface.h
  A engines/titanic/support/exe_resources.cpp
  A engines/titanic/support/exe_resources.h
  A engines/titanic/support/files_manager.cpp
  A engines/titanic/support/files_manager.h
  A engines/titanic/support/font.cpp
  A engines/titanic/support/font.h
  A engines/titanic/support/image.cpp
  A engines/titanic/support/image.h
  A engines/titanic/support/image_decoders.cpp
  A engines/titanic/support/image_decoders.h
  A engines/titanic/support/mouse_cursor.cpp
  A engines/titanic/support/mouse_cursor.h
  A engines/titanic/support/movie.cpp
  A engines/titanic/support/movie.h
  A engines/titanic/support/movie_clip.cpp
  A engines/titanic/support/movie_clip.h
  A engines/titanic/support/movie_event.cpp
  A engines/titanic/support/movie_event.h
  A engines/titanic/support/movie_manager.cpp
  A engines/titanic/support/movie_manager.h
  A engines/titanic/support/movie_range_info.cpp
  A engines/titanic/support/movie_range_info.h
  A engines/titanic/support/proximity.cpp
  A engines/titanic/support/proximity.h
  A engines/titanic/support/rect.cpp
  A engines/titanic/support/rect.h
  A engines/titanic/support/screen_manager.cpp
  A engines/titanic/support/screen_manager.h
  A engines/titanic/support/simple_file.cpp
  A engines/titanic/support/simple_file.h
  A engines/titanic/support/string.cpp
  A engines/titanic/support/string.h
  A engines/titanic/support/text_cursor.cpp
  A engines/titanic/support/text_cursor.h
  A engines/titanic/support/time_event_info.cpp
  A engines/titanic/support/time_event_info.h
  A engines/titanic/support/video_surface.cpp
  A engines/titanic/support/video_surface.h
  A engines/titanic/titanic.cpp
  A engines/titanic/titanic.h
  A engines/titanic/true_talk/barbot_script.cpp
  A engines/titanic/true_talk/barbot_script.h
  A engines/titanic/true_talk/bellbot_script.cpp
  A engines/titanic/true_talk/bellbot_script.h
  A engines/titanic/true_talk/deskbot_script.cpp
  A engines/titanic/true_talk/deskbot_script.h
  A engines/titanic/true_talk/dialogue_file.cpp
  A engines/titanic/true_talk/dialogue_file.h
  A engines/titanic/true_talk/doorbot_script.cpp
  A engines/titanic/true_talk/doorbot_script.h
  A engines/titanic/true_talk/liftbot_script.cpp
  A engines/titanic/true_talk/liftbot_script.h
  A engines/titanic/true_talk/maitred_script.cpp
  A engines/titanic/true_talk/maitred_script.h
  A engines/titanic/true_talk/parrot_script.cpp
  A engines/titanic/true_talk/parrot_script.h
  A engines/titanic/true_talk/script_handler.cpp
  A engines/titanic/true_talk/script_handler.h
  A engines/titanic/true_talk/script_support.cpp
  A engines/titanic/true_talk/script_support.h
  A engines/titanic/true_talk/succubus_script.cpp
  A engines/titanic/true_talk/succubus_script.h
  A engines/titanic/true_talk/title_engine.cpp
  A engines/titanic/true_talk/title_engine.h
  A engines/titanic/true_talk/true_talk_manager.cpp
  A engines/titanic/true_talk/true_talk_manager.h
  A engines/titanic/true_talk/tt_action.cpp
  A engines/titanic/true_talk/tt_action.h
  A engines/titanic/true_talk/tt_adj.cpp
  A engines/titanic/true_talk/tt_adj.h
  A engines/titanic/true_talk/tt_concept.cpp
  A engines/titanic/true_talk/tt_concept.h
  A engines/titanic/true_talk/tt_concept_node.cpp
  A engines/titanic/true_talk/tt_concept_node.h
  A engines/titanic/true_talk/tt_hist.cpp
  A engines/titanic/true_talk/tt_hist.h
  A engines/titanic/true_talk/tt_major_word.cpp
  A engines/titanic/true_talk/tt_major_word.h
  A engines/titanic/true_talk/tt_node.cpp
  A engines/titanic/true_talk/tt_node.h
  A engines/titanic/true_talk/tt_npc_script.cpp
  A engines/titanic/true_talk/tt_npc_script.h
  A engines/titanic/true_talk/tt_parser.cpp
  A engines/titanic/true_talk/tt_parser.h
  A engines/titanic/true_talk/tt_picture.cpp
  A engines/titanic/true_talk/tt_picture.h
  A engines/titanic/true_talk/tt_pronoun.cpp
  A engines/titanic/true_talk/tt_pronoun.h
  A engines/titanic/true_talk/tt_quotes.cpp
  A engines/titanic/true_talk/tt_quotes.h
  A engines/titanic/true_talk/tt_quotes_tree.cpp
  A engines/titanic/true_talk/tt_quotes_tree.h
  A engines/titanic/true_talk/tt_response.cpp
  A engines/titanic/true_talk/tt_response.h
  A engines/titanic/true_talk/tt_room_script.cpp
  A engines/titanic/true_talk/tt_room_script.h
  A engines/titanic/true_talk/tt_script_base.cpp
  A engines/titanic/true_talk/tt_script_base.h
  A engines/titanic/true_talk/tt_scripts.cpp
  A engines/titanic/true_talk/tt_scripts.h
  A engines/titanic/true_talk/tt_sentence.cpp
  A engines/titanic/true_talk/tt_sentence.h
  A engines/titanic/true_talk/tt_sentence_node.cpp
  A engines/titanic/true_talk/tt_sentence_node.h
  A engines/titanic/true_talk/tt_string.cpp
  A engines/titanic/true_talk/tt_string.h
  A engines/titanic/true_talk/tt_string_node.cpp
  A engines/titanic/true_talk/tt_string_node.h
  A engines/titanic/true_talk/tt_synonym.cpp
  A engines/titanic/true_talk/tt_synonym.h
  A engines/titanic/true_talk/tt_talker.cpp
  A engines/titanic/true_talk/tt_talker.h
  A engines/titanic/true_talk/tt_title_script.cpp
  A engines/titanic/true_talk/tt_title_script.h
  A engines/titanic/true_talk/tt_vocab.cpp
  A engines/titanic/true_talk/tt_vocab.h
  A engines/titanic/true_talk/tt_word.cpp
  A engines/titanic/true_talk/tt_word.h
    common/util.cpp
    common/util.h
    video/avi_decoder.cpp
    video/avi_decoder.h









More information about the Scummvm-git-logs mailing list